Lines Matching refs:ifp

257 static int xl_poll(struct ifnet *ifp, enum poll_cmd cmd, int count);
258 static int xl_poll_locked(struct ifnet *ifp, enum poll_cmd cmd, int count);
612 struct ifnet *ifp;
618 ifp = sc->xl_ifp;
628 if (ifp->if_flags & IFF_BROADCAST)
632 if (ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) {
633 if (ifp->if_flags & IFF_PROMISC)
635 if (ifp->if_flags & IFF_ALLMULTI)
638 if_maddr_rlock(ifp);
639 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
645 if_maddr_runlock(ifp);
658 struct ifnet *ifp;
666 ifp = sc->xl_ifp;
677 if (ifp->if_flags & IFF_BROADCAST)
681 if (ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) {
682 if (ifp->if_flags & IFF_PROMISC)
684 if (ifp->if_flags & IFF_ALLMULTI)
693 if_maddr_rlock(ifp);
694 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
715 if_maddr_runlock(ifp);
1073 struct ifnet *ifp;
1203 ifp = sc->xl_ifp = if_alloc(IFT_ETHER);
1204 if (ifp == NULL) {
1209 ifp->if_softc = sc;
1210 if_initname(ifp, device_get_name(dev), device_get_unit(dev));
1349 ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
1350 ifp->if_ioctl = xl_ioctl;
1351 ifp->if_capabilities = IFCAP_VLAN_MTU;
1353 ifp->if_hwassist = XL905B_CSUM_FEATURES;
1355 ifp->if_capabilities |= IFCAP_RXCSUM;
1357 ifp->if_capabilities |= IFCAP_HWCSUM;
1361 ifp->if_capabilities |= IFCAP_WOL_MAGIC;
1362 ifp->if_capenable = ifp->if_capabilities;
1364 ifp->if_capabilities |= IFCAP_POLLING;
1366 ifp->if_start = xl_start;
1367 ifp->if_init = xl_init;
1368 IFQ_SET_MAXLEN(&ifp->if_snd, XL_TX_LIST_CNT - 1);
1369 ifp->if_snd.ifq_drv_maxlen = XL_TX_LIST_CNT - 1;
1370 IFQ_SET_READY(&ifp->if_snd);
1409 error = mii_attach(dev, &sc->xl_miibus, ifp, xl_ifmedia_upd,
1488 ether_ifattach(ifp, eaddr);
1494 ether_ifdetach(ifp);
1569 struct ifnet *ifp;
1573 ifp = sc->xl_ifp;
1578 if (ifp && ifp->if_capenable & IFCAP_POLLING)
1579 ether_poll_deregister(ifp);
1597 ether_ifdetach(ifp);
1614 if (ifp)
1615 if_free(ifp);
1843 struct ifnet *ifp = sc->xl_ifp;
1855 if (ifp->if_capenable & IFCAP_POLLING) {
1882 if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
1897 if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
1917 if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
1926 if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
1927 m->m_pkthdr.rcvif = ifp;
1930 if (ifp->if_capenable & IFCAP_RXCSUM) {
1947 (*ifp->if_input)(ifp, m);
1955 if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
2005 struct ifnet *ifp = sc->xl_ifp;
2030 if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
2031 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
2054 struct ifnet *ifp = sc->xl_ifp;
2077 if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
2088 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
2165 struct ifnet *ifp = sc->xl_ifp;
2171 if (ifp->if_capenable & IFCAP_POLLING) {
2189 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
2207 if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
2212 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
2228 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd) &&
2229 ifp->if_drv_flags & IFF_DRV_RUNNING) {
2231 xl_start_90xB_locked(ifp);
2233 xl_start_locked(ifp);
2241 xl_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
2243 struct xl_softc *sc = ifp->if_softc;
2247 if (ifp->if_drv_flags & IFF_DRV_RUNNING)
2248 rx_npkts = xl_poll_locked(ifp, cmd, count);
2254 xl_poll_locked(struct ifnet *ifp, enum poll_cmd cmd, int count)
2256 struct xl_softc *sc = ifp->if_softc;
2268 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) {
2270 xl_start_90xB_locked(ifp);
2272 xl_start_locked(ifp);
2284 if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
2289 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
2324 struct ifnet *ifp = sc->xl_ifp;
2341 if_inc_counter(ifp, IFCOUNTER_IERRORS, xl_stats.xl_rx_overrun);
2343 if_inc_counter(ifp, IFCOUNTER_COLLISIONS,
2367 struct ifnet *ifp = sc->xl_ifp;
2377 if_printf(ifp, "can't map mbuf (error %d)\n", error);
2403 if_printf(ifp, "can't map mbuf (error %d)\n", error);
2459 xl_start(struct ifnet *ifp)
2461 struct xl_softc *sc = ifp->if_softc;
2466 xl_start_90xB_locked(ifp);
2468 xl_start_locked(ifp);
2474 xl_start_locked(struct ifnet *ifp)
2476 struct xl_softc *sc = ifp->if_softc;
2484 if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
2495 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
2502 for (; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) &&
2504 IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
2518 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
2519 IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
2537 BPF_MTAP(ifp, cur_tx->xl_mbuf);
2606 xl_start_90xB_locked(struct ifnet *ifp)
2608 struct xl_softc *sc = ifp->if_softc;
2616 if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
2623 for (; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) &&
2626 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
2630 IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
2643 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
2644 IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
2657 BPF_MTAP(ifp, cur_tx->xl_mbuf);
2703 struct ifnet *ifp = sc->xl_ifp;
2709 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
2873 if (ifp->if_capenable & IFCAP_POLLING)
2898 ifp->if_drv_flags |= IFF_DRV_RUNNING;
2899 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
2909 xl_ifmedia_upd(struct ifnet *ifp)
2911 struct xl_softc *sc = ifp->if_softc;
2937 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
2952 xl_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
2954 struct xl_softc *sc = ifp->if_softc;
3016 if_printf(ifp, "unknown XCVR type: %d\n", icfg);
3024 xl_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
3026 struct xl_softc *sc = ifp->if_softc;
3034 if (ifp->if_flags & IFF_UP) {
3035 if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
3036 (ifp->if_flags ^ sc->xl_if_flags) &
3042 if (ifp->if_drv_flags & IFF_DRV_RUNNING)
3045 sc->xl_if_flags = ifp->if_flags;
3052 if (ifp->if_drv_flags & IFF_DRV_RUNNING)
3061 error = ifmedia_ioctl(ifp, ifr,
3064 error = ifmedia_ioctl(ifp, ifr,
3068 mask = ifr->ifr_reqcap ^ ifp->if_capenable;
3071 (ifp->if_capabilities & IFCAP_POLLING) != 0) {
3072 ifp->if_capenable ^= IFCAP_POLLING;
3073 if ((ifp->if_capenable & IFCAP_POLLING) != 0) {
3074 error = ether_poll_register(xl_poll, ifp);
3080 ifp->if_capenable |= IFCAP_POLLING;
3083 error = ether_poll_deregister(ifp);
3099 (ifp->if_capabilities & IFCAP_TXCSUM) != 0) {
3100 ifp->if_capenable ^= IFCAP_TXCSUM;
3101 if ((ifp->if_capenable & IFCAP_TXCSUM) != 0)
3102 ifp->if_hwassist |= XL905B_CSUM_FEATURES;
3104 ifp->if_hwassist &= ~XL905B_CSUM_FEATURES;
3107 (ifp->if_capabilities & IFCAP_RXCSUM) != 0)
3108 ifp->if_capenable ^= IFCAP_RXCSUM;
3110 (ifp->if_capabilities & IFCAP_WOL_MAGIC) != 0)
3111 ifp->if_capenable ^= IFCAP_WOL_MAGIC;
3115 error = ether_ioctl(ifp, command, data);
3125 struct ifnet *ifp = sc->xl_ifp;
3152 if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
3161 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
3164 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) {
3166 xl_start_90xB_locked(ifp);
3168 xl_start_locked(ifp);
3182 struct ifnet *ifp = sc->xl_ifp;
3244 ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
3277 struct ifnet *ifp;
3280 ifp = sc->xl_ifp;
3284 if (ifp->if_flags & IFF_UP) {
3285 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
3297 struct ifnet *ifp;
3303 ifp = sc->xl_ifp;
3308 if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0)
3312 if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0)
3317 if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0)