Lines Matching defs:ifp

516 	struct ifnet *ifp;
521 ifp = sc->vge_ifp;
523 if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0)
538 struct ifnet *ifp;
559 ifp = sc->vge_ifp;
560 if ((ifp->if_flags & IFF_BROADCAST) != 0)
562 if ((ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0) {
563 if ((ifp->if_flags & IFF_PROMISC) != 0)
565 if ((ifp->if_flags & IFF_ALLMULTI) != 0) {
574 if_maddr_rlock(ifp);
575 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
588 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
599 if_maddr_runlock(ifp);
992 struct ifnet *ifp;
1090 ifp = sc->vge_ifp = if_alloc(IFT_ETHER);
1091 if (ifp == NULL) {
1099 error = mii_attach(dev, &sc->vge_miibus, ifp, vge_ifmedia_upd,
1107 ifp->if_softc = sc;
1108 if_initname(ifp, device_get_name(dev), device_get_unit(dev));
1109 ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
1110 ifp->if_ioctl = vge_ioctl;
1111 ifp->if_capabilities = IFCAP_VLAN_MTU;
1112 ifp->if_start = vge_start;
1113 ifp->if_hwassist = VGE_CSUM_FEATURES;
1114 ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM |
1117 ifp->if_capabilities |= IFCAP_WOL;
1118 ifp->if_capenable = ifp->if_capabilities;
1120 ifp->if_capabilities |= IFCAP_POLLING;
1122 ifp->if_init = vge_init;
1123 IFQ_SET_MAXLEN(&ifp->if_snd, VGE_TX_DESC_CNT - 1);
1124 ifp->if_snd.ifq_drv_maxlen = VGE_TX_DESC_CNT - 1;
1125 IFQ_SET_READY(&ifp->if_snd);
1130 ether_ifattach(ifp, eaddr);
1133 ifp->if_hdrlen = sizeof(struct ether_vlan_header);
1141 ether_ifdetach(ifp);
1163 struct ifnet *ifp;
1167 ifp = sc->vge_ifp;
1170 if (ifp->if_capenable & IFCAP_POLLING)
1171 ether_poll_deregister(ifp);
1176 ether_ifdetach(ifp);
1196 if (ifp)
1197 if_free(ifp);
1373 struct ifnet *ifp;
1378 ifp = sc->vge_ifp;
1403 if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
1433 struct ifnet *ifp;
1441 ifp = sc->vge_ifp;
1449 (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0;
1470 if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
1501 if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
1512 if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
1548 m->m_pkthdr.rcvif = ifp;
1551 if ((ifp->if_capenable & IFCAP_RXCSUM) != 0 &&
1580 (*ifp->if_input)(ifp, m);
1604 struct ifnet *ifp;
1612 ifp = sc->vge_ifp;
1633 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
1658 struct ifnet *ifp;
1662 ifp = sc->vge_ifp;
1685 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
1686 vge_start_locked(ifp);
1698 vge_poll (struct ifnet *ifp, enum poll_cmd cmd, int count)
1700 struct vge_softc *sc = ifp->if_softc;
1704 if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
1710 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
1711 vge_start_locked(ifp);
1727 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
1747 struct ifnet *ifp;
1753 ifp = sc->vge_ifp;
1755 (ifp->if_flags & IFF_UP) == 0) {
1761 if (ifp->if_capenable & IFCAP_POLLING) {
1778 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
1791 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
1799 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
1803 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
1804 vge_start_locked(ifp);
1937 vge_start(struct ifnet *ifp)
1941 sc = ifp->if_softc;
1943 vge_start_locked(ifp);
1949 vge_start_locked(struct ifnet *ifp)
1956 sc = ifp->if_softc;
1961 (ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
1967 for (enq = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) &&
1969 IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
1980 IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
1981 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
1994 ETHER_BPF_MTAP(ifp, m_head);
2023 struct ifnet *ifp = sc->vge_ifp;
2028 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
2131 if (ifp->if_capenable & IFCAP_POLLING) {
2147 ifp->if_drv_flags |= IFF_DRV_RUNNING;
2148 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
2156 vge_ifmedia_upd(struct ifnet *ifp)
2161 sc = ifp->if_softc;
2189 vge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
2194 sc = ifp->if_softc;
2198 if ((ifp->if_flags & IFF_UP) == 0) {
2254 vge_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
2256 struct vge_softc *sc = ifp->if_softc;
2266 else if (ifp->if_mtu != ifr->ifr_mtu) {
2271 ifp->if_mtu = ifr->ifr_mtu;
2277 if ((ifp->if_flags & IFF_UP) != 0) {
2278 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 &&
2279 ((ifp->if_flags ^ sc->vge_if_flags) &
2284 } else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
2286 sc->vge_if_flags = ifp->if_flags;
2292 if (ifp->if_drv_flags & IFF_DRV_RUNNING)
2299 error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
2302 mask = ifr->ifr_reqcap ^ ifp->if_capenable;
2306 error = ether_poll_register(vge_poll, ifp);
2314 ifp->if_capenable |= IFCAP_POLLING;
2317 error = ether_poll_deregister(ifp);
2323 ifp->if_capenable &= ~IFCAP_POLLING;
2330 (ifp->if_capabilities & IFCAP_TXCSUM) != 0) {
2331 ifp->if_capenable ^= IFCAP_TXCSUM;
2332 if ((ifp->if_capenable & IFCAP_TXCSUM) != 0)
2333 ifp->if_hwassist |= VGE_CSUM_FEATURES;
2335 ifp->if_hwassist &= ~VGE_CSUM_FEATURES;
2338 (ifp->if_capabilities & IFCAP_RXCSUM) != 0)
2339 ifp->if_capenable ^= IFCAP_RXCSUM;
2341 (ifp->if_capabilities & IFCAP_WOL_UCAST) != 0)
2342 ifp->if_capenable ^= IFCAP_WOL_UCAST;
2344 (ifp->if_capabilities & IFCAP_WOL_MCAST) != 0)
2345 ifp->if_capenable ^= IFCAP_WOL_MCAST;
2347 (ifp->if_capabilities & IFCAP_WOL_MAGIC) != 0)
2348 ifp->if_capenable ^= IFCAP_WOL_MAGIC;
2350 (ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0)
2351 ifp->if_capenable ^= IFCAP_VLAN_HWCSUM;
2353 (IFCAP_VLAN_HWTAGGING & ifp->if_capabilities) != 0) {
2354 ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
2358 VLAN_CAPABILITIES(ifp);
2361 error = ether_ioctl(ifp, command, data);
2372 struct ifnet *ifp;
2381 ifp = sc->vge_ifp;
2382 if_printf(ifp, "watchdog timeout\n");
2383 if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
2388 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
2399 struct ifnet *ifp;
2402 ifp = sc->vge_ifp;
2406 ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
2451 struct ifnet *ifp;
2469 ifp = sc->vge_ifp;
2471 if ((ifp->if_flags & IFF_UP) != 0) {
2472 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
2634 struct ifnet *ifp;
2641 ifp = sc->vge_ifp;
2709 if_inc_counter(ifp, IFCOUNTER_OPACKETS, mib[VGE_MIB_TX_GOOD_FRAMES]);
2711 if_inc_counter(ifp, IFCOUNTER_COLLISIONS,
2714 if_inc_counter(ifp, IFCOUNTER_OERRORS,
2717 if_inc_counter(ifp, IFCOUNTER_IPACKETS, mib[VGE_MIB_RX_GOOD_FRAMES]);
2719 if_inc_counter(ifp, IFCOUNTER_IERRORS,
2843 struct ifnet *ifp;
2857 ifp = sc->vge_ifp;
2865 if ((ifp->if_capenable & IFCAP_WOL) != 0) {
2868 if ((ifp->if_capenable & IFCAP_WOL_UCAST) != 0)
2870 if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0)
2874 if ((ifp->if_capenable & IFCAP_WOL_MCAST) != 0)
2899 if ((ifp->if_capenable & IFCAP_WOL) != 0)