Lines Matching refs:ifp

437 	struct ifnet *ifp = NULL;
485 ifp = sc->bfe_ifp = if_alloc(IFT_ETHER);
486 if (ifp == NULL) {
491 ifp->if_softc = sc;
492 if_initname(ifp, device_get_name(dev), device_get_unit(dev));
493 ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
494 ifp->if_ioctl = bfe_ioctl;
495 ifp->if_start = bfe_start;
496 ifp->if_init = bfe_init;
497 IFQ_SET_MAXLEN(&ifp->if_snd, BFE_TX_QLEN);
498 ifp->if_snd.ifq_drv_maxlen = BFE_TX_QLEN;
499 IFQ_SET_READY(&ifp->if_snd);
508 error = mii_attach(dev, &sc->bfe_miibus, ifp, bfe_ifmedia_upd,
516 ether_ifattach(ifp, sc->bfe_enaddr);
521 ifp->if_hdrlen = sizeof(struct ether_vlan_header);
522 ifp->if_capabilities |= IFCAP_VLAN_MTU;
523 ifp->if_capenable |= IFCAP_VLAN_MTU;
545 struct ifnet *ifp;
549 ifp = sc->bfe_ifp;
557 if (ifp != NULL)
558 ether_ifdetach(ifp);
611 struct ifnet *ifp;
614 ifp = sc->bfe_ifp;
617 if (ifp->if_flags & IFF_UP) {
619 if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
620 !IFQ_DRV_IS_EMPTY(&ifp->if_snd))
621 bfe_start_locked(ifp);
1086 struct ifnet *ifp = sc->bfe_ifp;
1095 if (ifp->if_flags & IFF_PROMISC)
1100 if (ifp->if_flags & IFF_BROADCAST)
1109 if (ifp->if_flags & IFF_ALLMULTI)
1113 if_maddr_rlock(ifp);
1114 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
1120 if_maddr_runlock(ifp);
1253 struct ifnet *ifp;
1266 ifp = sc->bfe_ifp;
1319 if_inc_counter(ifp, IFCOUNTER_OPACKETS, (u_long)mib[MIB_TX_GOOD_P]);
1320 if_inc_counter(ifp, IFCOUNTER_COLLISIONS, (u_long)mib[MIB_TX_TCOLS]);
1321 if_inc_counter(ifp, IFCOUNTER_OERRORS, (u_long)mib[MIB_TX_URUNS] +
1326 if_inc_counter(ifp, IFCOUNTER_IPACKETS, (u_long)mib[MIB_RX_GOOD_P]);
1328 if_inc_counter(ifp, IFCOUNTER_IERRORS, mib[MIB_RX_JABBER] +
1341 struct ifnet *ifp;
1346 ifp = sc->bfe_ifp;
1373 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
1385 struct ifnet *ifp;
1396 ifp = sc->bfe_ifp;
1412 if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
1433 m->m_pkthdr.rcvif = ifp;
1435 (*ifp->if_input)(ifp, m);
1450 struct ifnet *ifp;
1453 ifp = sc->bfe_ifp;
1469 if (istat == 0 || (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
1498 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
1503 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
1504 bfe_start_locked(ifp);
1600 bfe_start(struct ifnet *ifp)
1602 BFE_LOCK((struct bfe_softc *)ifp->if_softc);
1603 bfe_start_locked(ifp);
1604 BFE_UNLOCK((struct bfe_softc *)ifp->if_softc);
1611 bfe_start_locked(struct ifnet *ifp)
1617 sc = ifp->if_softc;
1625 if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
1629 for (queued = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) &&
1631 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;
1653 BPF_MTAP(ifp, m_head);
1695 struct ifnet *ifp = sc->bfe_ifp;
1702 if (ifp->if_drv_flags & IFF_DRV_RUNNING)
1727 ifp->if_drv_flags |= IFF_DRV_RUNNING;
1728 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
1737 bfe_ifmedia_upd(struct ifnet *ifp)
1744 sc = ifp->if_softc;
1760 bfe_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
1762 struct bfe_softc *sc = ifp->if_softc;
1774 bfe_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
1776 struct bfe_softc *sc = ifp->if_softc;
1784 if (ifp->if_flags & IFF_UP) {
1785 if (ifp->if_drv_flags & IFF_DRV_RUNNING)
1789 } else if (ifp->if_drv_flags & IFF_DRV_RUNNING)
1796 if (ifp->if_drv_flags & IFF_DRV_RUNNING)
1803 error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
1806 error = ether_ioctl(ifp, command, data);
1816 struct ifnet *ifp;
1823 ifp = sc->bfe_ifp;
1827 if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
1828 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
1831 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
1832 bfe_start_locked(ifp);
1857 struct ifnet *ifp;
1861 ifp = sc->bfe_ifp;
1862 ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);