Lines Matching refs:ifp

117 static void	ae_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr);
118 static int ae_mediachange(struct ifnet *ifp);
131 static void ae_start(struct ifnet *ifp);
132 static void ae_start_locked(struct ifnet *ifp);
146 static int ae_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
243 struct ifnet *ifp;
333 ifp = sc->ifp = if_alloc(IFT_ETHER);
334 if (ifp == NULL) {
340 ifp->if_softc = sc;
341 if_initname(ifp, device_get_name(dev), device_get_unit(dev));
342 ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
343 ifp->if_ioctl = ae_ioctl;
344 ifp->if_start = ae_start;
345 ifp->if_init = ae_init;
346 ifp->if_capabilities = IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING;
347 ifp->if_hwassist = 0;
348 ifp->if_snd.ifq_drv_maxlen = ifqmaxlen;
349 IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen);
350 IFQ_SET_READY(&ifp->if_snd);
352 ifp->if_capabilities |= IFCAP_WOL_MAGIC;
355 ifp->if_capenable = ifp->if_capabilities;
360 error = mii_attach(dev, &sc->miibus, ifp, ae_mediachange,
368 ether_ifattach(ifp, sc->eaddr);
370 ifp->if_hdrlen = sizeof(struct ether_vlan_header);
379 ether_ifdetach(ifp);
395 ether_ifdetach(ifp);
562 struct ifnet *ifp;
570 ifp = sc->ifp;
571 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
589 bcopy(IF_LLADDR(ifp), eaddr, ETHER_ADDR_LEN);
658 val = ifp->if_mtu + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN +
748 ifp->if_drv_flags |= IFF_DRV_RUNNING;
749 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
762 struct ifnet *ifp;
766 ifp = sc->ifp;
775 ether_ifdetach(ifp);
792 if (ifp != NULL) {
793 if_free(ifp);
794 sc->ifp = NULL;
887 ae_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr)
892 sc = ifp->if_softc;
904 ae_mediachange(struct ifnet *ifp)
912 sc = ifp->if_softc;
1325 struct ifnet *ifp;
1333 ifp = sc->ifp;
1343 if ((ifp->if_capenable & IFCAP_WOL) != 0) {
1391 if ((ifp->if_capenable & IFCAP_WOL) != 0)
1422 if ((sc->ifp->if_flags & IFF_UP) != 0)
1458 if_printf(sc->ifp, "No free Tx available.\n");
1494 if_printf(sc->ifp, "New txd_cur = %d.\n", sc->txd_cur);
1517 ae_start(struct ifnet *ifp)
1521 sc = ifp->if_softc;
1523 ae_start_locked(ifp);
1528 ae_start_locked(struct ifnet *ifp)
1535 sc = ifp->if_softc;
1540 if_printf(ifp, "Start called.\n");
1543 if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
1548 while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) {
1549 IFQ_DRV_DEQUEUE(&ifp->if_snd, m0);
1556 IFQ_DRV_PREPEND(&ifp->if_snd, m0);
1557 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
1559 if_printf(ifp, "Setting OACTIVE.\n");
1568 ETHER_BPF_MTAP(ifp, m0);
1577 if_printf(ifp, "%d packets dequeued.\n", count);
1578 if_printf(ifp, "Tx pos now is %d.\n", sc->txd_cur);
1588 struct ifnet *ifp;
1595 ifp = sc->ifp;
1597 if (mii == NULL || ifp == NULL ||
1598 (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
1758 struct ifnet *ifp;
1765 ifp = sc->ifp;
1779 if_printf(ifp, "Interrupt received: 0x%08x\n", val);
1782 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
1785 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
1800 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
1801 ae_start_locked(ifp);
1811 struct ifnet *ifp;
1818 ifp = sc->ifp;
1821 if_printf(ifp, "Tx interrupt occuried.\n");
1859 if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
1861 if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
1867 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
1869 if_printf(ifp, "Received stray Tx interrupt(s).\n");
1888 struct ifnet *ifp;
1895 ifp = sc->ifp;
1899 if_printf(ifp, "Rx interrupt occuried.\n");
1903 if_printf(ifp, "Runt frame received.");
1904 if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
1908 m = m_devget(&rxd->data[0], size, ETHER_ALIGN, ifp, NULL);
1910 if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
1914 if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0 &&
1920 if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
1925 (*ifp->if_input)(ifp, m);
1933 struct ifnet *ifp;
1941 ifp = sc->ifp;
1966 if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
1982 struct ifnet *ifp;
1986 ifp = sc->ifp;
1992 if_printf(ifp, "watchdog timeout (missed link).\n");
1994 if_printf(ifp, "watchdog timeout - resetting.\n");
1996 if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
1997 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
1999 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
2000 ae_start_locked(ifp);
2022 struct ifnet *ifp;
2026 ifp = sc->ifp;
2029 if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0)
2037 struct ifnet *ifp;
2047 ifp = sc->ifp;
2052 if ((ifp->if_flags & IFF_BROADCAST) != 0)
2054 if ((ifp->if_flags & IFF_PROMISC) != 0)
2056 if ((ifp->if_flags & IFF_ALLMULTI) != 0)
2064 if ((ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0) {
2075 if_maddr_rlock(ifp);
2076 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
2083 if_maddr_runlock(ifp);
2090 ae_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
2097 sc = ifp->if_softc;
2105 else if (ifp->if_mtu != ifr->ifr_mtu) {
2107 ifp->if_mtu = ifr->ifr_mtu;
2108 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
2109 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
2117 if ((ifp->if_flags & IFF_UP) != 0) {
2118 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
2119 if (((ifp->if_flags ^ sc->if_flags)
2127 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
2130 sc->if_flags = ifp->if_flags;
2136 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
2143 error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, cmd);
2147 mask = ifr->ifr_reqcap ^ ifp->if_capenable;
2149 (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) {
2150 ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
2153 VLAN_CAPABILITIES(ifp);
2157 error = ether_ioctl(ifp, cmd, data);
2166 struct ifnet *ifp;
2171 ifp = sc->ifp;
2172 ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);