Lines Matching refs:ifp

578 	struct ifnet		*ifp;
585 ifp = sc->sis_ifp;
586 if (mii == NULL || ifp == NULL ||
587 (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
697 struct ifnet *ifp;
702 ifp = sc->sis_ifp;
715 if (ifp->if_flags & IFF_BROADCAST)
725 if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) {
727 if (ifp->if_flags & IFF_PROMISC)
743 if_maddr_rlock(ifp);
744 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
757 if_maddr_runlock(ifp);
768 struct ifnet *ifp;
773 ifp = sc->sis_ifp;
788 if (ifp->if_flags & IFF_BROADCAST)
791 if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) {
793 if (ifp->if_flags & IFF_PROMISC)
801 if_maddr_rlock(ifp);
802 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
810 if_maddr_runlock(ifp);
891 struct ifnet *ifp;
1051 ifp = sc->sis_ifp = if_alloc(IFT_ETHER);
1052 if (ifp == NULL) {
1057 ifp->if_softc = sc;
1058 if_initname(ifp, device_get_name(dev), device_get_unit(dev));
1059 ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
1060 ifp->if_ioctl = sis_ioctl;
1061 ifp->if_start = sis_start;
1062 ifp->if_init = sis_init;
1063 IFQ_SET_MAXLEN(&ifp->if_snd, SIS_TX_LIST_CNT - 1);
1064 ifp->if_snd.ifq_drv_maxlen = SIS_TX_LIST_CNT - 1;
1065 IFQ_SET_READY(&ifp->if_snd);
1069 ifp->if_capabilities |= IFCAP_WOL;
1071 ifp->if_capabilities |= IFCAP_WOL_MAGIC;
1072 ifp->if_capenable = ifp->if_capabilities;
1078 error = mii_attach(dev, &sc->sis_miibus, ifp, sis_ifmedia_upd,
1088 ether_ifattach(ifp, eaddr);
1093 ifp->if_hdrlen = sizeof(struct ether_vlan_header);
1094 ifp->if_capabilities |= IFCAP_VLAN_MTU;
1095 ifp->if_capenable = ifp->if_capabilities;
1097 ifp->if_capabilities |= IFCAP_POLLING;
1106 ether_ifdetach(ifp);
1128 struct ifnet *ifp;
1132 ifp = sc->sis_ifp;
1135 if (ifp->if_capenable & IFCAP_POLLING)
1136 ether_poll_deregister(ifp);
1145 ether_ifdetach(ifp);
1155 if (ifp)
1156 if_free(ifp);
1478 struct ifnet *ifp;
1490 ifp = sc->sis_ifp;
1492 for (prog = 0; (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0;
1495 if (ifp->if_capenable & IFCAP_POLLING) {
1508 if ((ifp->if_capenable & IFCAP_VLAN_MTU) != 0 &&
1513 if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
1515 if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1);
1523 if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
1539 if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
1540 m->m_pkthdr.rcvif = ifp;
1543 (*ifp->if_input)(ifp, m);
1565 struct ifnet *ifp;
1576 ifp = sc->sis_ifp;
1597 if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
1598 if_inc_counter(ifp, IFCOUNTER_COLLISIONS,
1601 if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
1603 if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1);
1605 if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1);
1609 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
1637 sis_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
1639 struct sis_softc *sc = ifp->if_softc;
1643 if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
1658 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
1659 sis_startl(ifp);
1668 if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
1674 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
1688 struct ifnet *ifp;
1692 ifp = sc->sis_ifp;
1696 if (ifp->if_capenable & IFCAP_POLLING) {
1718 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
1730 if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
1736 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
1744 if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
1748 if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
1749 sis_startl(ifp);
1867 sis_start(struct ifnet *ifp)
1871 sc = ifp->if_softc;
1873 sis_startl(ifp);
1878 sis_startl(struct ifnet *ifp)
1884 sc = ifp->if_softc;
1888 if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
1892 for (queued = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) &&
1894 IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
1901 IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
1902 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
1912 BPF_MTAP(ifp, m_head);
1941 struct ifnet *ifp = sc->sis_ifp;
1947 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
2058 if (ifp->if_capenable & IFCAP_POLLING)
2070 ifp->if_drv_flags |= IFF_DRV_RUNNING;
2071 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
2080 sis_ifmedia_upd(struct ifnet *ifp)
2087 sc = ifp->if_softc;
2103 sis_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
2108 sc = ifp->if_softc;
2119 sis_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
2121 struct sis_softc *sc = ifp->if_softc;
2129 if (ifp->if_flags & IFF_UP) {
2130 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 &&
2131 ((ifp->if_flags ^ sc->sis_if_flags) &
2136 } else if (ifp->if_drv_flags & IFF_DRV_RUNNING)
2138 sc->sis_if_flags = ifp->if_flags;
2144 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
2151 error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
2155 mask = ifr->ifr_reqcap ^ ifp->if_capenable;
2158 (IFCAP_POLLING & ifp->if_capabilities) != 0) {
2159 ifp->if_capenable ^= IFCAP_POLLING;
2160 if ((IFCAP_POLLING & ifp->if_capenable) != 0) {
2161 error = ether_poll_register(sis_poll, ifp);
2169 error = ether_poll_deregister(ifp);
2176 (ifp->if_capabilities & IFCAP_WOL) != 0) {
2178 ifp->if_capenable ^= IFCAP_WOL_UCAST;
2180 ifp->if_capenable ^= IFCAP_WOL_MCAST;
2182 ifp->if_capenable ^= IFCAP_WOL_MAGIC;
2187 error = ether_ioctl(ifp, command, data);
2220 struct ifnet *ifp;
2227 ifp = sc->sis_ifp;
2232 ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
2300 struct ifnet *ifp;
2304 ifp = sc->sis_ifp;
2305 if ((ifp->if_flags & IFF_UP) != 0) {
2306 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
2316 struct ifnet *ifp;
2321 ifp = sc->sis_ifp;
2322 if ((ifp->if_capenable & IFCAP_WOL) == 0)
2332 if ((ifp->if_capenable & IFCAP_WOL_UCAST) != 0)
2334 if ((ifp->if_capenable & IFCAP_WOL_MCAST) != 0)
2336 if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0)
2349 if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0)
2356 if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0)