Lines Matching refs:ifp

253 static int xl_poll(struct ifnet *ifp, enum poll_cmd cmd, int count);
254 static int xl_poll_locked(struct ifnet *ifp, enum poll_cmd cmd, int count);
606 struct ifnet *ifp;
612 ifp = sc->xl_ifp;
622 if (ifp->if_flags & IFF_BROADCAST)
626 if (ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) {
627 if (ifp->if_flags & IFF_PROMISC)
629 if (ifp->if_flags & IFF_ALLMULTI)
632 if_maddr_rlock(ifp);
633 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
639 if_maddr_runlock(ifp);
652 struct ifnet *ifp;
660 ifp = sc->xl_ifp;
671 if (ifp->if_flags & IFF_BROADCAST)
675 if (ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) {
676 if (ifp->if_flags & IFF_PROMISC)
678 if (ifp->if_flags & IFF_ALLMULTI)
687 if_maddr_rlock(ifp);
688 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
709 if_maddr_runlock(ifp);
1067 struct ifnet *ifp;
1197 ifp = sc->xl_ifp = if_alloc(IFT_ETHER);
1198 if (ifp == NULL) {
1203 ifp->if_softc = sc;
1204 if_initname(ifp, device_get_name(dev), device_get_unit(dev));
1343 ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
1344 ifp->if_ioctl = xl_ioctl;
1345 ifp->if_capabilities = IFCAP_VLAN_MTU;
1347 ifp->if_hwassist = XL905B_CSUM_FEATURES;
1349 ifp->if_capabilities |= IFCAP_RXCSUM;
1351 ifp->if_capabilities |= IFCAP_HWCSUM;
1355 ifp->if_capabilities |= IFCAP_WOL_MAGIC;
1356 ifp->if_capenable = ifp->if_capabilities;
1358 ifp->if_capabilities |= IFCAP_POLLING;
1360 ifp->if_start = xl_start;
1361 ifp->if_init = xl_init;
1362 IFQ_SET_MAXLEN(&ifp->if_snd, XL_TX_LIST_CNT - 1);
1363 ifp->if_snd.ifq_drv_maxlen = XL_TX_LIST_CNT - 1;
1364 IFQ_SET_READY(&ifp->if_snd);
1403 error = mii_attach(dev, &sc->xl_miibus, ifp, xl_ifmedia_upd,
1482 ether_ifattach(ifp, eaddr);
1488 ether_ifdetach(ifp);
1563 struct ifnet *ifp;
1567 ifp = sc->xl_ifp;
1572 if (ifp && ifp->if_capenable & IFCAP_POLLING)
1573 ether_poll_deregister(ifp);
1591 ether_ifdetach(ifp);
1608 if (ifp)
1609 if_free(ifp);
1837 struct ifnet *ifp = sc->xl_ifp;
1849 if (ifp->if_capenable & IFCAP_POLLING) {
1876 ifp->if_ierrors++;
1891 ifp->if_ierrors++;
1911 ifp->if_ierrors++;
1920 ifp->if_ipackets++;
1921 m->m_pkthdr.rcvif = ifp;
1924 if (ifp->if_capenable & IFCAP_RXCSUM) {
1941 (*ifp->if_input)(ifp, m);
1949 if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
1999 struct ifnet *ifp = sc->xl_ifp;
2024 ifp->if_opackets++;
2025 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
2048 struct ifnet *ifp = sc->xl_ifp;
2071 ifp->if_opackets++;
2082 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
2159 struct ifnet *ifp = sc->xl_ifp;
2165 if (ifp->if_capenable & IFCAP_POLLING) {
2183 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
2201 ifp->if_oerrors++;
2206 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
2222 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd) &&
2223 ifp->if_drv_flags & IFF_DRV_RUNNING) {
2225 xl_start_90xB_locked(ifp);
2227 xl_start_locked(ifp);
2235 xl_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
2237 struct xl_softc *sc = ifp->if_softc;
2241 if (ifp->if_drv_flags & IFF_DRV_RUNNING)
2242 rx_npkts = xl_poll_locked(ifp, cmd, count);
2248 xl_poll_locked(struct ifnet *ifp, enum poll_cmd cmd, int count)
2250 struct xl_softc *sc = ifp->if_softc;
2262 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) {
2264 xl_start_90xB_locked(ifp);
2266 xl_start_locked(ifp);
2278 ifp->if_oerrors++;
2283 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
2318 struct ifnet *ifp = sc->xl_ifp;
2335 ifp->if_ierrors += xl_stats.xl_rx_overrun;
2337 ifp->if_collisions += xl_stats.xl_tx_multi_collision +
2359 struct ifnet *ifp = sc->xl_ifp;
2369 if_printf(ifp, "can't map mbuf (error %d)\n", error);
2395 if_printf(ifp, "can't map mbuf (error %d)\n", error);
2451 xl_start(struct ifnet *ifp)
2453 struct xl_softc *sc = ifp->if_softc;
2458 xl_start_90xB_locked(ifp);
2460 xl_start_locked(ifp);
2466 xl_start_locked(struct ifnet *ifp)
2468 struct xl_softc *sc = ifp->if_softc;
2476 if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
2487 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
2494 for (; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) &&
2496 IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
2510 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
2511 IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
2529 BPF_MTAP(ifp, cur_tx->xl_mbuf);
2598 xl_start_90xB_locked(struct ifnet *ifp)
2600 struct xl_softc *sc = ifp->if_softc;
2608 if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
2615 for (; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) &&
2618 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
2622 IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
2635 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
2636 IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
2649 BPF_MTAP(ifp, cur_tx->xl_mbuf);
2695 struct ifnet *ifp = sc->xl_ifp;
2701 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
2865 if (ifp->if_capenable & IFCAP_POLLING)
2890 ifp->if_drv_flags |= IFF_DRV_RUNNING;
2891 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
2901 xl_ifmedia_upd(struct ifnet *ifp)
2903 struct xl_softc *sc = ifp->if_softc;
2929 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
2944 xl_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
2946 struct xl_softc *sc = ifp->if_softc;
3008 if_printf(ifp, "unknown XCVR type: %d\n", icfg);
3016 xl_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
3018 struct xl_softc *sc = ifp->if_softc;
3026 if (ifp->if_flags & IFF_UP) {
3027 if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
3028 (ifp->if_flags ^ sc->xl_if_flags) &
3034 if (ifp->if_drv_flags & IFF_DRV_RUNNING)
3037 sc->xl_if_flags = ifp->if_flags;
3044 if (ifp->if_drv_flags & IFF_DRV_RUNNING)
3053 error = ifmedia_ioctl(ifp, ifr,
3056 error = ifmedia_ioctl(ifp, ifr,
3060 mask = ifr->ifr_reqcap ^ ifp->if_capenable;
3063 (ifp->if_capabilities & IFCAP_POLLING) != 0) {
3064 ifp->if_capenable ^= IFCAP_POLLING;
3065 if ((ifp->if_capenable & IFCAP_POLLING) != 0) {
3066 error = ether_poll_register(xl_poll, ifp);
3072 ifp->if_capenable |= IFCAP_POLLING;
3075 error = ether_poll_deregister(ifp);
3091 (ifp->if_capabilities & IFCAP_TXCSUM) != 0) {
3092 ifp->if_capenable ^= IFCAP_TXCSUM;
3093 if ((ifp->if_capenable & IFCAP_TXCSUM) != 0)
3094 ifp->if_hwassist |= XL905B_CSUM_FEATURES;
3096 ifp->if_hwassist &= ~XL905B_CSUM_FEATURES;
3099 (ifp->if_capabilities & IFCAP_RXCSUM) != 0)
3100 ifp->if_capenable ^= IFCAP_RXCSUM;
3102 (ifp->if_capabilities & IFCAP_WOL_MAGIC) != 0)
3103 ifp->if_capenable ^= IFCAP_WOL_MAGIC;
3107 error = ether_ioctl(ifp, command, data);
3117 struct ifnet *ifp = sc->xl_ifp;
3144 ifp->if_oerrors++;
3153 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
3156 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) {
3158 xl_start_90xB_locked(ifp);
3160 xl_start_locked(ifp);
3174 struct ifnet *ifp = sc->xl_ifp;
3236 ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
3269 struct ifnet *ifp;
3272 ifp = sc->xl_ifp;
3276 if (ifp->if_flags & IFF_UP) {
3277 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
3289 struct ifnet *ifp;
3295 ifp = sc->xl_ifp;
3300 if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0)
3304 if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0)
3309 if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0)