Lines Matching refs:ifp

195 static int rl_poll(struct ifnet *ifp, enum poll_cmd cmd, int count);
196 static int rl_poll_locked(struct ifnet *ifp, enum poll_cmd cmd, int count);
478 struct ifnet *ifp;
483 ifp = sc->rl_ifp;
484 if (mii == NULL || ifp == NULL ||
485 (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
513 struct ifnet *ifp = sc->rl_ifp;
527 if (ifp->if_flags & IFF_BROADCAST)
529 if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
531 if (ifp->if_flags & IFF_PROMISC)
537 if_maddr_rlock(ifp);
538 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
548 if_maddr_runlock(ifp);
635 struct ifnet *ifp;
780 ifp = sc->rl_ifp = if_alloc(IFT_ETHER);
781 if (ifp == NULL) {
793 error = mii_attach(dev, &sc->rl_miibus, ifp, rl_ifmedia_upd,
800 ifp->if_softc = sc;
801 if_initname(ifp, device_get_name(dev), device_get_unit(dev));
802 ifp->if_mtu = ETHERMTU;
803 ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
804 ifp->if_ioctl = rl_ioctl;
805 ifp->if_start = rl_start;
806 ifp->if_init = rl_init;
807 ifp->if_capabilities = IFCAP_VLAN_MTU;
819 ifp->if_capabilities |= IFCAP_WOL;
827 ifp->if_capenable = ifp->if_capabilities;
828 ifp->if_capenable &= ~(IFCAP_WOL_UCAST | IFCAP_WOL_MCAST);
830 ifp->if_capabilities |= IFCAP_POLLING;
832 IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen);
833 ifp->if_snd.ifq_drv_maxlen = ifqmaxlen;
834 IFQ_SET_READY(&ifp->if_snd);
839 ether_ifattach(ifp, eaddr);
846 ether_ifdetach(ifp);
867 struct ifnet *ifp;
870 ifp = sc->rl_ifp;
875 if (ifp->if_capenable & IFCAP_POLLING)
876 ether_poll_deregister(ifp);
884 ether_ifdetach(ifp);
901 if (ifp)
902 if_free(ifp);
1116 struct ifnet *ifp = sc->rl_ifp;
1143 if (ifp->if_capenable & IFCAP_POLLING) {
1167 ifp->if_ierrors++;
1168 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
1199 m = m_devget(rxbufpos, total_len, RL_ETHER_ALIGN, ifp,
1206 m = m_devget(rxbufpos, total_len, RL_ETHER_ALIGN, ifp,
1216 ifp->if_iqdrops++;
1220 ifp->if_ipackets++;
1222 (*ifp->if_input)(ifp, m);
1238 struct ifnet *ifp = sc->rl_ifp;
1255 ifp->if_collisions += (txstat & RL_TXSTAT_COLLCNT) >> 24;
1271 ifp->if_opackets++;
1274 ifp->if_oerrors++;
1280 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
1287 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
1435 rl_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
1437 struct rl_softc *sc = ifp->if_softc;
1441 if (ifp->if_drv_flags & IFF_DRV_RUNNING)
1442 rx_npkts = rl_poll_locked(ifp, cmd, count);
1448 rl_poll_locked(struct ifnet *ifp, enum poll_cmd cmd, int count)
1450 struct rl_softc *sc = ifp->if_softc;
1459 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
1460 rl_start_locked(ifp);
1475 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
1487 struct ifnet *ifp = sc->rl_ifp;
1497 if (ifp->if_capenable & IFCAP_POLLING)
1501 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
1512 if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
1518 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
1530 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
1531 rl_start_locked(ifp);
1534 if (ifp->if_drv_flags & IFF_DRV_RUNNING)
1611 rl_start(struct ifnet *ifp)
1613 struct rl_softc *sc = ifp->if_softc;
1616 rl_start_locked(ifp);
1621 rl_start_locked(struct ifnet *ifp)
1623 struct rl_softc *sc = ifp->if_softc;
1628 if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
1634 IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
1642 IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
1643 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
1648 BPF_MTAP(ifp, RL_CUR_TXMBUF(sc));
1667 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
1683 struct ifnet *ifp = sc->rl_ifp;
1691 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
1746 if (ifp->if_capenable & IFCAP_POLLING)
1767 ifp->if_drv_flags |= IFF_DRV_RUNNING;
1768 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
1777 rl_ifmedia_upd(struct ifnet *ifp)
1779 struct rl_softc *sc = ifp->if_softc;
1795 rl_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
1797 struct rl_softc *sc = ifp->if_softc;
1810 rl_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
1814 struct rl_softc *sc = ifp->if_softc;
1820 if (ifp->if_flags & IFF_UP) {
1821 if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
1822 ((ifp->if_flags ^ sc->rl_if_flags) &
1827 } else if (ifp->if_drv_flags & IFF_DRV_RUNNING)
1829 sc->rl_if_flags = ifp->if_flags;
1841 error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
1844 mask = ifr->ifr_reqcap ^ ifp->if_capenable;
1847 !(ifp->if_capenable & IFCAP_POLLING)) {
1848 error = ether_poll_register(rl_poll, ifp);
1854 ifp->if_capenable |= IFCAP_POLLING;
1860 ifp->if_capenable & IFCAP_POLLING) {
1861 error = ether_poll_deregister(ifp);
1865 ifp->if_capenable &= ~IFCAP_POLLING;
1871 (ifp->if_capabilities & IFCAP_WOL) != 0) {
1873 ifp->if_capenable ^= IFCAP_WOL_UCAST;
1875 ifp->if_capenable ^= IFCAP_WOL_MCAST;
1877 ifp->if_capenable ^= IFCAP_WOL_MAGIC;
1881 error = ether_ioctl(ifp, command, data);
1914 struct ifnet *ifp = sc->rl_ifp;
1920 ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
1984 struct ifnet *ifp;
1989 ifp = sc->rl_ifp;
1993 if ((ifp->if_capabilities & IFCAP_WOL) != 0 &&
2011 if (ifp->if_flags & IFF_UP)
2049 struct ifnet *ifp;
2056 ifp = sc->rl_ifp;
2057 if ((ifp->if_capabilities & IFCAP_WOL) == 0)
2068 if ((ifp->if_capenable & IFCAP_WOL) != 0)
2074 if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0)
2081 if ((ifp->if_capenable & IFCAP_WOL_UCAST) != 0)
2083 if ((ifp->if_capenable & IFCAP_WOL_MCAST) != 0)
2085 if ((ifp->if_capenable & IFCAP_WOL) != 0)
2095 if ((ifp->if_capenable & IFCAP_WOL) != 0)
2103 struct ifnet *ifp;
2106 ifp = sc->rl_ifp;
2107 if ((ifp->if_capabilities & IFCAP_WOL) == 0)