Lines Matching refs:ifp

322 	struct ifnet		*ifp;
328 ifp = sc->vr_ifp;
329 if (mii == NULL || ifp == NULL ||
330 (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
462 struct ifnet *ifp;
472 ifp = sc->vr_ifp;
476 if (ifp->if_flags & IFF_BROADCAST)
478 if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
480 if (ifp->if_flags & IFF_PROMISC)
491 if_maddr_rlock(ifp);
498 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
520 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
532 if_maddr_runlock(ifp);
618 struct ifnet *ifp;
670 ifp = sc->vr_ifp = if_alloc(IFT_ETHER);
671 if (ifp == NULL) {
676 ifp->if_softc = sc;
677 if_initname(ifp, device_get_name(dev), device_get_unit(dev));
678 ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
679 ifp->if_ioctl = vr_ioctl;
680 ifp->if_start = vr_start;
681 ifp->if_init = vr_init;
682 IFQ_SET_MAXLEN(&ifp->if_snd, VR_TX_RING_CNT - 1);
683 ifp->if_snd.ifq_maxlen = VR_TX_RING_CNT - 1;
684 IFQ_SET_READY(&ifp->if_snd);
698 ifp->if_hwassist = VR_CSUM_FEATURES;
699 ifp->if_capabilities |= IFCAP_HWCSUM;
709 ifp->if_capabilities |= IFCAP_WOL_UCAST | IFCAP_WOL_MAGIC;
712 ifp->if_capabilities |= IFCAP_VLAN_MTU;
713 ifp->if_capenable = ifp->if_capabilities;
715 ifp->if_capabilities |= IFCAP_POLLING;
793 error = mii_attach(dev, &sc->vr_miibus, ifp, vr_ifmedia_upd,
802 ether_ifattach(ifp, eaddr);
808 ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
816 ether_ifdetach(ifp);
838 struct ifnet *ifp = sc->vr_ifp;
843 if (ifp != NULL && ifp->if_capenable & IFCAP_POLLING)
844 ether_poll_deregister(ifp);
854 ether_ifdetach(ifp);
868 if (ifp)
869 if_free(ifp);
1307 struct ifnet *ifp;
1313 ifp = sc->vr_ifp;
1323 if (ifp->if_capenable & IFCAP_POLLING) {
1350 ifp->if_ierrors++;
1373 ifp->if_iqdrops++;
1400 m->m_pkthdr.rcvif = ifp;
1401 ifp->if_ipackets++;
1403 if ((ifp->if_capenable & IFCAP_RXCSUM) != 0 &&
1419 (*ifp->if_input)(ifp, m);
1453 struct ifnet *ifp;
1468 ifp = sc->vr_ifp;
1481 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
1491 ifp->if_oerrors++;
1529 ifp->if_collisions++;
1533 ifp->if_collisions++;
1538 ifp->if_opackets++;
1545 ifp->if_collisions +=
1550 ifp->if_collisions += (txstat & 0x0f);
1593 vr_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
1598 sc = ifp->if_softc;
1602 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
1603 rx_npkts = vr_poll_locked(ifp, cmd, count);
1609 vr_poll_locked(struct ifnet *ifp, enum poll_cmd cmd, int count)
1614 sc = ifp->if_softc;
1621 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
1622 vr_start_locked(ifp);
1685 struct ifnet *ifp;
1699 ifp = sc->vr_ifp;
1701 if ((ifp->if_capenable & IFCAP_POLLING) != 0)
1706 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 ||
1741 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
1742 vr_start_locked(ifp);
1951 vr_start(struct ifnet *ifp)
1955 sc = ifp->if_softc;
1957 vr_start_locked(ifp);
1962 vr_start_locked(struct ifnet *ifp)
1968 sc = ifp->if_softc;
1972 if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
1976 for (enq = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) &&
1978 IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
1989 IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
1990 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
1999 ETHER_BPF_MTAP(ifp, m_head);
2024 struct ifnet *ifp;
2031 ifp = sc->vr_ifp;
2034 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
2150 if (ifp->if_capenable & IFCAP_POLLING)
2161 ifp->if_drv_flags |= IFF_DRV_RUNNING;
2162 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
2174 vr_ifmedia_upd(struct ifnet *ifp)
2181 sc = ifp->if_softc;
2197 vr_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
2202 sc = ifp->if_softc;
2205 if ((ifp->if_flags & IFF_UP) == 0) {
2216 vr_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
2223 sc = ifp->if_softc;
2230 if (ifp->if_flags & IFF_UP) {
2231 if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
2232 if ((ifp->if_flags ^ sc->vr_if_flags) &
2240 if (ifp->if_drv_flags & IFF_DRV_RUNNING)
2243 sc->vr_if_flags = ifp->if_flags;
2255 error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
2258 mask = ifr->ifr_reqcap ^ ifp->if_capenable;
2262 error = ether_poll_register(vr_poll, ifp);
2268 ifp->if_capenable |= IFCAP_POLLING;
2271 error = ether_poll_deregister(ifp);
2275 ifp->if_capenable &= ~IFCAP_POLLING;
2281 (IFCAP_TXCSUM & ifp->if_capabilities) != 0) {
2282 ifp->if_capenable ^= IFCAP_TXCSUM;
2283 if ((IFCAP_TXCSUM & ifp->if_capenable) != 0)
2284 ifp->if_hwassist |= VR_CSUM_FEATURES;
2286 ifp->if_hwassist &= ~VR_CSUM_FEATURES;
2289 (IFCAP_RXCSUM & ifp->if_capabilities) != 0)
2290 ifp->if_capenable ^= IFCAP_RXCSUM;
2292 (ifp->if_capabilities & IFCAP_WOL_UCAST) != 0)
2293 ifp->if_capenable ^= IFCAP_WOL_UCAST;
2295 (ifp->if_capabilities & IFCAP_WOL_MAGIC) != 0)
2296 ifp->if_capenable ^= IFCAP_WOL_MAGIC;
2299 error = ether_ioctl(ifp, command, data);
2309 struct ifnet *ifp;
2316 ifp = sc->vr_ifp;
2328 ifp->if_oerrors++;
2329 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
2334 ifp->if_oerrors++;
2335 if_printf(ifp, "watchdog timeout\n");
2337 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
2340 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
2341 vr_start_locked(ifp);
2432 struct ifnet *ifp;
2437 ifp = sc->vr_ifp;
2441 ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
2512 struct ifnet *ifp;
2517 ifp = sc->vr_ifp;
2520 if (ifp->if_flags & IFF_UP)
2532 struct ifnet *ifp;
2543 ifp = sc->vr_ifp;
2556 if ((ifp->if_capenable & IFCAP_WOL_UCAST) != 0)
2558 if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0)
2566 if ((ifp->if_capenable & IFCAP_WOL) != 0) {
2581 if ((ifp->if_capenable & IFCAP_WOL) != 0)