Lines Matching refs:ifp

603 	struct ifnet		*ifp;
608 ifp = sc->rl_ifp;
609 if (mii == NULL || ifp == NULL ||
610 (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
643 struct ifnet *ifp;
650 ifp = sc->rl_ifp;
654 if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) {
655 if (ifp->if_flags & IFF_PROMISC)
667 if_maddr_rlock(ifp);
668 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
678 if_maddr_runlock(ifp);
750 struct ifnet *ifp = sc->rl_ifp;
776 ifp->if_flags |= IFF_PROMISC;
778 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
814 IF_HANDOFF(&ifp->if_snd, m0, ifp);
892 ifp->if_flags &= ~IFF_PROMISC;
1190 struct ifnet *ifp;
1552 ifp = sc->rl_ifp = if_alloc(IFT_ETHER);
1553 if (ifp == NULL) {
1580 ifp->if_softc = sc;
1581 if_initname(ifp, device_get_name(dev), device_get_unit(dev));
1582 ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
1583 ifp->if_ioctl = re_ioctl;
1584 ifp->if_start = re_start;
1591 ifp->if_hwassist = CSUM_TCP | CSUM_UDP;
1593 ifp->if_hwassist = CSUM_IP | CSUM_TCP | CSUM_UDP;
1594 ifp->if_hwassist |= CSUM_TSO;
1595 ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_TSO4;
1596 ifp->if_capenable = ifp->if_capabilities;
1597 ifp->if_init = re_init;
1598 IFQ_SET_MAXLEN(&ifp->if_snd, RL_IFQ_MAXLEN);
1599 ifp->if_snd.ifq_drv_maxlen = RL_IFQ_MAXLEN;
1600 IFQ_SET_READY(&ifp->if_snd);
1610 error = mii_attach(dev, &sc->rl_miibus, ifp, re_ifmedia_upd,
1620 ether_ifattach(ifp, eaddr);
1623 ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING;
1624 if (ifp->if_capabilities & IFCAP_HWCSUM)
1625 ifp->if_capabilities |= IFCAP_VLAN_HWCSUM;
1628 ifp->if_capabilities |= IFCAP_WOL;
1629 ifp->if_capenable = ifp->if_capabilities;
1630 ifp->if_capenable &= ~(IFCAP_WOL_UCAST | IFCAP_WOL_MCAST);
1636 ifp->if_hwassist &= ~CSUM_TSO;
1637 ifp->if_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO);
1639 ifp->if_capabilities |= IFCAP_POLLING;
1646 ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
1663 ether_ifdetach(ifp);
1685 ether_ifdetach(ifp);
1707 struct ifnet *ifp;
1711 ifp = sc->rl_ifp;
1717 if (ifp->if_capenable & IFCAP_POLLING)
1718 ether_poll_deregister(ifp);
1740 ifp->if_flags &= ~IFF_UP;
1741 ether_ifdetach(ifp);
1756 if (ifp != NULL)
1757 if_free(ifp);
1847 netmap_detach(ifp);
2103 struct ifnet *ifp;
2111 ifp = sc->rl_ifp;
2113 if (ifp->if_capenable & IFCAP_NETMAP) {
2114 NA(ifp)->rx_rings->nr_kflags |= NKR_PENDINTR;
2115 selwakeuppri(&NA(ifp)->rx_rings->si, PI_NET);
2119 if (ifp->if_mtu > RL_MTU && (sc->rl_flags & RL_FLAG_JUMBOV2) != 0)
2132 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
2208 ifp->if_ierrors++;
2231 ifp->if_iqdrops++;
2273 ifp->if_ipackets++;
2274 m->m_pkthdr.rcvif = ifp;
2278 if (ifp->if_capenable & IFCAP_RXCSUM) {
2326 (*ifp->if_input)(ifp, m);
2350 struct ifnet *ifp;
2359 ifp = sc->rl_ifp;
2361 if (ifp->if_capenable & IFCAP_NETMAP) {
2362 selwakeuppri(&NA(ifp)->tx_rings[0].si, PI_NET);
2394 ifp->if_collisions++;
2396 ifp->if_oerrors++;
2398 ifp->if_opackets++;
2401 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
2448 re_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
2450 struct rl_softc *sc = ifp->if_softc;
2454 if (ifp->if_drv_flags & IFF_DRV_RUNNING)
2455 rx_npkts = re_poll_locked(ifp, cmd, count);
2461 re_poll_locked(struct ifnet *ifp, enum poll_cmd cmd, int count)
2463 struct rl_softc *sc = ifp->if_softc;
2472 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
2473 re_start_locked(ifp);
2492 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
2522 struct ifnet *ifp;
2527 ifp = sc->rl_ifp;
2535 (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
2541 if (ifp->if_capenable & IFCAP_POLLING) {
2571 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
2575 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
2576 re_start_locked(ifp);
2592 struct ifnet *ifp;
2598 ifp = sc->rl_ifp;
2600 if (ifp->if_capenable & IFCAP_POLLING) {
2607 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
2625 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
2657 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
2661 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
2662 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
2663 re_start_locked(ifp);
2862 re_start(struct ifnet *ifp)
2866 sc = ifp->if_softc;
2868 re_start_locked(ifp);
2876 re_start_locked(struct ifnet *ifp)
2882 sc = ifp->if_softc;
2886 if (ifp->if_capenable & IFCAP_NETMAP) {
2887 struct netmap_kring *kring = &NA(ifp)->tx_rings[0];
2899 if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
2903 for (queued = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) &&
2905 IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
2912 IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
2913 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
2921 ETHER_BPF_MTAP(ifp, m_head);
3026 struct ifnet *ifp = sc->rl_ifp;
3039 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
3054 if (ifp->if_mtu > RL_MTU) {
3062 ifp->if_capenable &= ~(IFCAP_HWCSUM | IFCAP_TSO4);
3063 ifp->if_hwassist &= ~(RE_CSUM_FEATURES | CSUM_TSO);
3072 re_set_jumbo(sc, ifp->if_mtu > RL_MTU);
3081 if (ifp->if_mtu > RL_MTU)
3095 if ((ifp->if_capenable & IFCAP_RXCSUM) != 0)
3097 if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0)
3121 if (ifp->if_mtu > RL_TSO_MTU && (ifp->if_capenable & IFCAP_TSO4) != 0) {
3122 ifp->if_capenable &= ~IFCAP_TSO4;
3123 ifp->if_hwassist &= ~CSUM_TSO;
3132 bcopy(IF_LLADDR(ifp), eaddr.eaddr, ETHER_ADDR_LEN);
3189 if (ifp->if_capenable & IFCAP_POLLING)
3255 if (ifp->if_mtu > RL_MTU)
3277 ifp->if_drv_flags |= IFF_DRV_RUNNING;
3278 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
3291 re_ifmedia_upd(struct ifnet *ifp)
3297 sc = ifp->if_softc;
3310 re_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
3315 sc = ifp->if_softc;
3326 re_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
3328 struct rl_softc *sc = ifp->if_softc;
3342 if (ifp->if_mtu != ifr->ifr_mtu) {
3343 ifp->if_mtu = ifr->ifr_mtu;
3345 (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
3346 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
3349 if (ifp->if_mtu > RL_TSO_MTU &&
3350 (ifp->if_capenable & IFCAP_TSO4) != 0) {
3351 ifp->if_capenable &= ~(IFCAP_TSO4 |
3353 ifp->if_hwassist &= ~CSUM_TSO;
3355 VLAN_CAPABILITIES(ifp);
3361 if ((ifp->if_flags & IFF_UP) != 0) {
3362 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
3363 if (((ifp->if_flags ^ sc->rl_if_flags)
3369 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
3372 sc->rl_if_flags = ifp->if_flags;
3378 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
3385 error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
3391 mask = ifr->ifr_reqcap ^ ifp->if_capenable;
3396 error = ether_poll_register(re_poll, ifp);
3402 ifp->if_capenable |= IFCAP_POLLING;
3405 error = ether_poll_deregister(ifp);
3409 ifp->if_capenable &= ~IFCAP_POLLING;
3416 (ifp->if_capabilities & IFCAP_TXCSUM) != 0) {
3417 ifp->if_capenable ^= IFCAP_TXCSUM;
3418 if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) {
3422 ifp->if_hwassist |= CSUM_TCP | CSUM_UDP;
3424 ifp->if_hwassist |= RE_CSUM_FEATURES;
3426 ifp->if_hwassist &= ~RE_CSUM_FEATURES;
3430 (ifp->if_capabilities & IFCAP_RXCSUM) != 0) {
3431 ifp->if_capenable ^= IFCAP_RXCSUM;
3435 (ifp->if_capabilities & IFCAP_TSO4) != 0) {
3436 ifp->if_capenable ^= IFCAP_TSO4;
3437 if ((IFCAP_TSO4 & ifp->if_capenable) != 0)
3438 ifp->if_hwassist |= CSUM_TSO;
3440 ifp->if_hwassist &= ~CSUM_TSO;
3441 if (ifp->if_mtu > RL_TSO_MTU &&
3442 (ifp->if_capenable & IFCAP_TSO4) != 0) {
3443 ifp->if_capenable &= ~IFCAP_TSO4;
3444 ifp->if_hwassist &= ~CSUM_TSO;
3448 (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0)
3449 ifp->if_capenable ^= IFCAP_VLAN_HWTSO;
3451 (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) {
3452 ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
3454 if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0)
3455 ifp->if_capenable &= ~IFCAP_VLAN_HWTSO;
3463 (ifp->if_capabilities & IFCAP_WOL) != 0) {
3465 ifp->if_capenable ^= IFCAP_WOL_UCAST;
3467 ifp->if_capenable ^= IFCAP_WOL_MCAST;
3469 ifp->if_capenable ^= IFCAP_WOL_MAGIC;
3471 if (reinit && ifp->if_drv_flags & IFF_DRV_RUNNING) {
3472 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
3476 VLAN_CAPABILITIES(ifp);
3480 error = ether_ioctl(ifp, command, data);
3490 struct ifnet *ifp;
3497 ifp = sc->rl_ifp;
3500 if_printf(ifp, "watchdog timeout (missed Tx interrupts) "
3502 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
3503 re_start_locked(ifp);
3507 if_printf(ifp, "watchdog timeout\n");
3508 ifp->if_oerrors++;
3511 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
3513 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
3514 re_start_locked(ifp);
3525 struct ifnet *ifp;
3531 ifp = sc->rl_ifp;
3535 ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
3654 struct ifnet *ifp;
3660 ifp = sc->rl_ifp;
3675 if (ifp->if_flags & IFF_UP)
3780 struct ifnet *ifp;
3790 ifp = sc->rl_ifp;
3797 if ((ifp->if_capenable & IFCAP_WOL) != 0) {
3810 if ((ifp->if_capenable & IFCAP_WOL) != 0)
3816 if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0)
3823 if ((ifp->if_capenable & IFCAP_WOL_UCAST) != 0)
3825 if ((ifp->if_capenable & IFCAP_WOL_MCAST) != 0)
3827 if ((ifp->if_capenable & IFCAP_WOL) != 0)
3834 if ((ifp->if_capenable & IFCAP_WOL) == 0 &&
3846 if ((ifp->if_capenable & IFCAP_WOL) != 0)