diff options
author | Robert Watson <rwatson@FreeBSD.org> | 2005-08-09 10:20:02 +0000 |
---|---|---|
committer | Robert Watson <rwatson@FreeBSD.org> | 2005-08-09 10:20:02 +0000 |
commit | 13f4c340aeeeb104844712bb36899d1adef50579 (patch) | |
tree | bb70e59641e2310a3c26ec449af5ab0cb7420d9d | |
parent | 292ee7be1c404a624dda68ddff1bd988a1851e5a (diff) | |
download | src-test2-13f4c340aeeeb104844712bb36899d1adef50579.tar.gz src-test2-13f4c340aeeeb104844712bb36899d1adef50579.zip |
Notes
142 files changed, 1255 insertions, 1088 deletions
diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index ce3b51f8d09f..8cfd3d280b15 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -2212,9 +2212,9 @@ linux_gifflags(struct thread *td, struct ifnet *ifp, struct l_ifreq *ifr) { l_short flags; - flags = ifp->if_flags & 0xffff; + flags = (ifp->if_flags | ifp->if_drv_flags) & 0xffff; /* these flags have no Linux equivalent */ - flags &= ~(IFF_SMART|IFF_OACTIVE|IFF_SIMPLEX| + flags &= ~(IFF_SMART|IFF_DRV_OACTIVE|IFF_SIMPLEX| IFF_LINK0|IFF_LINK1|IFF_LINK2); /* Linux' multicast flag is in a different bit */ if (flags & IFF_MULTICAST) { diff --git a/sys/compat/svr4/svr4_sockio.c b/sys/compat/svr4/svr4_sockio.c index 9eee1567ed6d..7468c544d195 100644 --- a/sys/compat/svr4/svr4_sockio.c +++ b/sys/compat/svr4/svr4_sockio.c @@ -62,7 +62,8 @@ bsd_to_svr4_flags(bf) #if defined(IFF_NOTRAILERS) bsd_to_svr4_flag(FF_NOTRAILERS); #endif - bsd_to_svr4_flag(FF_RUNNING); + if (bf & IFF_DRV_RUNNING) + sf |= SVR4_IFF_RUNNING; bsd_to_svr4_flag(FF_NOARP); bsd_to_svr4_flag(FF_PROMISC); bsd_to_svr4_flag(FF_ALLMULTI); diff --git a/sys/contrib/altq/altq/altq_cbq.c b/sys/contrib/altq/altq/altq_cbq.c index 00808958818d..ef759165805e 100644 --- a/sys/contrib/altq/altq/altq_cbq.c +++ b/sys/contrib/altq/altq/altq_cbq.c @@ -598,7 +598,7 @@ cbqrestart(struct ifaltq *ifq) ifp = ifq->altq_ifp; if (ifp->if_start && - cbqp->cbq_qlen > 0 && (ifp->if_flags & IFF_OACTIVE) == 0) { + cbqp->cbq_qlen > 0 && (ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) { IFQ_UNLOCK(ifq); (*ifp->if_start)(ifp); IFQ_LOCK(ifq); diff --git a/sys/contrib/dev/oltr/if_oltr.c b/sys/contrib/dev/oltr/if_oltr.c index 82d76c41dfe5..d74663316517 100644 --- a/sys/contrib/dev/oltr/if_oltr.c +++ b/sys/contrib/dev/oltr/if_oltr.c @@ -230,7 +230,7 @@ oltr_start(struct ifnet *ifp) /* * Check to see if output is already active */ - if (ifp->if_flags & IFF_OACTIVE) + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; outloop: @@ -240,7 +240,7 @@ outloop: */ if (sc->tx_avail <= 0) { printf("oltr%d: tx queue full\n", sc->unit); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; return; } @@ -298,7 +298,7 @@ bad: nobuffers: printf("oltr%d: queue full\n", sc->unit); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; ifp->if_oerrors++; /*m_freem(m0);*/ sc->restart = m0; @@ -323,7 +323,8 @@ oltr_stop(struct oltr_softc *sc) /*printf("oltr%d: oltr_stop\n", sc->unit);*/ - ifp->if_flags &= ~(IFF_UP | IFF_RUNNING | IFF_OACTIVE); + ifp->if_flags &= ~IFF_UP; + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); TRlldClose(sc->TRlldAdapter, 0); sc->state = OL_CLOSING; } @@ -539,8 +540,8 @@ oltr_init(void * xsc) sc->restart = NULL; - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* * Set up adapter statistics poll @@ -577,7 +578,7 @@ oltr_ioctl(struct ifnet *ifp, u_long command, caddr_t data) if (ifp->if_flags & IFF_UP) { oltr_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { oltr_close(sc); } } @@ -902,9 +903,9 @@ DriverTransmitFrameCompleted(void *DriverHandle, void *FrameHandle, int Transmit sc->tx_avail += frame->FragmentCount; - if (ifp->if_flags & IFF_OACTIVE) { + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { printf("oltr%d: queue restart\n", sc->unit); - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; oltr_start(ifp); } diff --git a/sys/contrib/pf/net/if_pflog.c b/sys/contrib/pf/net/if_pflog.c index ed5cf1360274..9047c4fc05a4 100644 --- a/sys/contrib/pf/net/if_pflog.c +++ b/sys/contrib/pf/net/if_pflog.c @@ -272,9 +272,9 @@ pflogioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCSIFDSTADDR: case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; else - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; break; default: return (EINVAL); diff --git a/sys/contrib/pf/net/if_pfsync.c b/sys/contrib/pf/net/if_pfsync.c index 77b4b5feb3d3..1df46048ad75 100644 --- a/sys/contrib/pf/net/if_pfsync.c +++ b/sys/contrib/pf/net/if_pfsync.c @@ -990,9 +990,9 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCSIFDSTADDR: case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; else - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; break; case SIOCSIFMTU: if (ifr->ifr_mtu < PFSYNC_MINMTU) diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c index 9e04e3bce95f..f10f30e95c5b 100644 --- a/sys/dev/an/if_an.c +++ b/sys/dev/an/if_an.c @@ -834,7 +834,7 @@ an_detach(device_t dev) an_stop(sc); sc->an_gone = 1; ifmedia_removeall(&sc->an_ifmedia); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; AN_UNLOCK(sc); ether_ifdetach(ifp); if_free(ifp); @@ -1118,7 +1118,7 @@ an_txeof(sc, status) ifp = sc->an_ifp; ifp->if_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (!sc->mpi350) { id = CSR_READ_2(sc, AN_TX_CMP_FID(sc->mpi350)); @@ -1180,7 +1180,7 @@ an_stats_update(xsc) sc->an_associated = 0; /* Don't do this while we're transmitting */ - if (ifp->if_flags & IFF_OACTIVE) { + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { sc->an_stat_ch = timeout(an_stats_update, sc, hz); AN_UNLOCK(sc); return; @@ -1951,18 +1951,18 @@ an_ioctl(ifp, command, data) switch (command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->an_if_flags & IFF_PROMISC)) { an_promisc(sc, 1); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->an_if_flags & IFF_PROMISC) { an_promisc(sc, 0); } else an_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) an_stop(sc); } sc->an_if_flags = ifp->if_flags; @@ -2544,7 +2544,7 @@ an_init(xsc) return; } - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) an_stop(sc); sc->an_associated = 0; @@ -2631,8 +2631,8 @@ an_init(xsc) /* enable interrupts */ CSR_WRITE_2(sc, AN_INT_EN(sc->mpi350), AN_INTRS(sc->mpi350)); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->an_stat_ch = timeout(an_stats_update, sc, hz); AN_UNLOCK(sc); @@ -2658,7 +2658,7 @@ an_start(ifp) if (sc->an_gone) return; - if (ifp->if_flags & IFF_OACTIVE) + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; if (!sc->an_associated) @@ -2819,7 +2819,7 @@ an_start(ifp) } if (m0 != NULL) - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; sc->an_rdata.an_tx_prod = idx; @@ -2851,7 +2851,7 @@ an_stop(sc) untimeout(an_stats_update, sc, sc->an_stat_ch); - ifp->if_flags &= ~(IFF_RUNNING|IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING|IFF_DRV_OACTIVE); if (sc->an_flash_buffer) { free(sc->an_flash_buffer, M_DEVBUF); diff --git a/sys/dev/ar/if_ar.c b/sys/dev/ar/if_ar.c index 3c5896903f37..da657dd2e257 100644 --- a/sys/dev/ar/if_ar.c +++ b/sys/dev/ar/if_ar.c @@ -607,9 +607,9 @@ ar_xmit(struct ar_softc *sc) * This function only place the data in the oncard buffers. It does not * start the transmition. ar_xmit() does that. * - * Transmitter idle state is indicated by the IFF_OACTIVE flag. The function - * that clears that should ensure that the transmitter and its DMA is - * in a "good" idle state. + * Transmitter idle state is indicated by the IFF_DRV_OACTIVE flag. The + * function that clears that should ensure that the transmitter and its + * DMA is in a "good" idle state. */ #ifndef NETGRAPH static void @@ -628,7 +628,7 @@ arstart(struct ar_softc *sc) struct buf_block *blkp; #ifndef NETGRAPH - if(!(ifp->if_flags & IFF_RUNNING)) + if(!(ifp->if_drv_flags & IFF_DRV_RUNNING)) return; #else /* NETGRAPH */ /* XXX */ @@ -641,9 +641,9 @@ top_arstart: */ if(sc->txb_inuse == AR_TX_BLOCKS) { #ifndef NETGRAPH - ifp->if_flags |= IFF_OACTIVE; /* yes, mark active */ + ifp->if_drv_flags |= IFF_DRV_OACTIVE; /* yes, mark active */ #else /* NETGRAPH */ -/*XXX*/ /*ifp->if_flags |= IFF_OACTIVE;*/ /* yes, mark active */ +/*XXX*/ /*ifp->if_drv_flags |= IFF_DRV_OACTIVE;*/ /* yes, mark active */ #endif /* NETGRAPH */ return; } @@ -775,7 +775,7 @@ arioctl(struct ifnet *ifp, u_long cmd, caddr_t data) TRC(if_printf(ifp, "arioctl.\n");) - was_up = ifp->if_flags & IFF_RUNNING; + was_up = ifp->if_drv_flags & IFF_DRV_RUNNING; error = sppp_ioctl(ifp, cmd, data); TRC(if_printf(ifp, "ioctl: ifsppp.pp_flags = %x, if_flags %x.\n", @@ -790,7 +790,7 @@ arioctl(struct ifnet *ifp, u_long cmd, caddr_t data) (cmd == SIOCSIFFLAGS) ? "SIOCSIFFLAGS" : "SIOCSIFADDR");) s = splimp(); - should_be_up = ifp->if_flags & IFF_RUNNING; + should_be_up = ifp->if_drv_flags & IFF_DRV_RUNNING; if(!was_up && should_be_up) { /* Interface should be up -- start it. */ @@ -824,7 +824,7 @@ arwatchdog(struct ar_softc *sc) msci_channel *msci = &sc->sca->msci[sc->scachan]; #ifndef NETGRAPH - if(!(ifp->if_flags & IFF_RUNNING)) + if(!(ifp->if_drv_flags & IFF_DRV_RUNNING)) return; #endif /* NETGRAPH */ @@ -848,9 +848,9 @@ arwatchdog(struct ar_softc *sc) sc->xmit_busy = 0; #ifndef NETGRAPH - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; #else /* NETGRAPH */ - /* XXX ifp->if_flags &= ~IFF_OACTIVE; */ + /* XXX ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; */ #endif /* NETGRAPH */ if(sc->txb_inuse && --sc->txb_inuse) @@ -1853,17 +1853,17 @@ ar_dmac_intr(struct ar_hardc *hc, int scano, u_char isr1) /* * This should be the most common case. * - * Clear the IFF_OACTIVE flag. + * Clear the IFF_DRV_OACTIVE flag. * * Call arstart to start a new transmit if * there is data to transmit. */ sc->xmit_busy = 0; #ifndef NETGRAPH - SC2IFP(sc)->if_flags &= ~IFF_OACTIVE; + SC2IFP(sc)->if_drv_flags &= ~IFF_DRV_OACTIVE; SC2IFP(sc)->if_timer = 0; #else /* NETGRAPH */ - /* XXX SC2IFP(sc)->if_flags &= ~IFF_OACTIVE; */ + /* XXX SC2IFP(sc)->if_drv_flags &= ~IFF_DRV_OACTIVE; */ sc->out_dog = 0; /* XXX */ #endif /* NETGRAPH */ diff --git a/sys/dev/arl/if_arl.c b/sys/dev/arl/if_arl.c index 86b31081c9d0..60cb73bd3d2a 100644 --- a/sys/dev/arl/if_arl.c +++ b/sys/dev/arl/if_arl.c @@ -456,10 +456,10 @@ arl_ioctl(ifp, cmd, data) case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (!(ifp->if_flags & IFF_RUNNING)) + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) arl_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) arl_stop(sc); } break; @@ -694,7 +694,7 @@ arl_waitreg(ifp) D(("wait reg\n")); - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { if (ARL_CHECKREG(sc)) { /* wait registration */ D(("wait registration\n")); @@ -718,7 +718,7 @@ arl_watchdog(ifp) { struct arl_softc *sc = ifp->if_softc; - if (!(ifp->if_flags & IFF_RUNNING)) + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) return; D(("device timeout\n")); @@ -753,8 +753,8 @@ arl_init(xsc) /* set flags */ - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; arl_start(ifp); @@ -826,7 +826,7 @@ arl_start(ifp) D(("start\n")); /* Don't do anything if output is active */ - if (ifp->if_flags & IFF_OACTIVE) + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; /* Dequeue the next datagram */ @@ -834,7 +834,7 @@ arl_start(ifp) /* If there's nothing to send, return. */ if (m0 != NULL) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; /* Copy the datagram to the buffer. */ sc->tx_len = 0; @@ -881,7 +881,7 @@ arl_stop(sc) ifp = sc->arl_ifp; ifp->if_timer = 0; /* disable timer */ - ifp->if_flags &= ~(IFF_RUNNING|IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING|IFF_DRV_OACTIVE); /* arl_hwreset(unit); */ sc->rx_len = 0; sc->tx_len = 0; @@ -1064,7 +1064,7 @@ arl_intr(arg) if (ar->txStatusVector != 1) sc->arl_ifp->if_collisions++; ifp->if_timer = 0; /* disable timer */ - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; arl_start(ifp); ar->txStatusVector = 0; #ifdef ARLCACHE diff --git a/sys/dev/ath/ath_rate/amrr/amrr.c b/sys/dev/ath/ath_rate/amrr/amrr.c index 257a7377b117..18a3fa5c3bbe 100644 --- a/sys/dev/ath/ath_rate/amrr/amrr.c +++ b/sys/dev/ath/ath_rate/amrr/amrr.c @@ -464,7 +464,7 @@ ath_ratectl(void *arg) struct ieee80211com *ic = &sc->sc_ic; int interval; - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { sc->sc_stats.ast_rate_calls++; if (ic->ic_opmode == IEEE80211_M_STA) diff --git a/sys/dev/ath/ath_rate/onoe/onoe.c b/sys/dev/ath/ath_rate/onoe/onoe.c index ac0eac7afb42..3cf8073d9ad1 100644 --- a/sys/dev/ath/ath_rate/onoe/onoe.c +++ b/sys/dev/ath/ath_rate/onoe/onoe.c @@ -445,7 +445,7 @@ ath_ratectl(void *arg) struct ieee80211com *ic = &sc->sc_ic; int interval; - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { sc->sc_stats.ast_rate_calls++; if (ic->ic_opmode == IEEE80211_M_STA) diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index ac99401bde4d..afd9d615935a 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -653,7 +653,7 @@ ath_resume(struct ath_softc *sc) if (ifp->if_flags & IFF_UP) { ath_init(sc); - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) ath_start(ifp); } if (sc->sc_softled) { @@ -694,7 +694,8 @@ ath_intr(void *arg) } if (!ath_hal_intrpend(ah)) /* shared irq, not for us */ return; - if ((ifp->if_flags & (IFF_RUNNING|IFF_UP)) != (IFF_RUNNING|IFF_UP)) { + if (!((ifp->if_flags & IFF_UP) && (ifp->if_drv_flags & + IFF_DRV_RUNNING))) { DPRINTF(sc, ATH_DEBUG_ANY, "%s: if_flags 0x%x\n", __func__, ifp->if_flags); ath_hal_getisr(ah, &status); /* clear ISR */ @@ -909,7 +910,7 @@ ath_init(void *arg) sc->sc_imask |= HAL_INT_MIB; ath_hal_intrset(ah, sc->sc_imask); - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; ic->ic_state = IEEE80211_S_INIT; /* @@ -940,7 +941,7 @@ ath_stop_locked(struct ifnet *ifp) __func__, sc->sc_invalid, ifp->if_flags); ATH_LOCK_ASSERT(sc); - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* * Shutdown the hardware and driver: * reset 802.11 state machine @@ -957,7 +958,7 @@ ath_stop_locked(struct ifnet *ifp) * hardware is gone (invalid). */ ieee80211_new_state(ic, IEEE80211_S_INIT, -1); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ifp->if_timer = 0; if (!sc->sc_invalid) { if (sc->sc_softled) { @@ -1062,7 +1063,7 @@ ath_start(struct ifnet *ifp) struct ieee80211_frame *wh; struct ether_header *eh; - if ((ifp->if_flags & IFF_RUNNING) == 0 || sc->sc_invalid) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->sc_invalid) return; for (;;) { /* @@ -1077,7 +1078,7 @@ ath_start(struct ifnet *ifp) DPRINTF(sc, ATH_DEBUG_ANY, "%s: out of xmit buffers\n", __func__); sc->sc_stats.ast_tx_qstop++; - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } /* @@ -1205,7 +1206,7 @@ static int ath_media_change(struct ifnet *ifp) { #define IS_UP(ifp) \ - ((ifp->if_flags & (IFF_RUNNING|IFF_UP)) == (IFF_RUNNING|IFF_UP)) + ((ifp->if_flags & IFF_UP) && (ifp->if_drv_flags & IFF_DRV_RUNNING)) int error; error = ieee80211_media_change(ifp); @@ -3712,7 +3713,7 @@ ath_tx_proc_q0(void *arg, int npending) ath_tx_processq(sc, &sc->sc_txq[0]); ath_tx_processq(sc, sc->sc_cabq); - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->sc_tx_timer = 0; if (sc->sc_softled) @@ -3740,7 +3741,7 @@ ath_tx_proc_q0123(void *arg, int npending) ath_tx_processq(sc, &sc->sc_txq[3]); ath_tx_processq(sc, sc->sc_cabq); - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->sc_tx_timer = 0; if (sc->sc_softled) @@ -3767,7 +3768,7 @@ ath_tx_proc(void *arg, int npending) if (ATH_TXQ_SETUP(sc, i)) ath_tx_processq(sc, &sc->sc_txq[i]); - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->sc_tx_timer = 0; if (sc->sc_softled) @@ -3855,7 +3856,7 @@ ath_draintxq(struct ath_softc *sc) for (i = 0; i < HAL_NUM_TX_QUEUES; i++) if (ATH_TXQ_SETUP(sc, i)) ath_tx_draintxq(sc, &sc->sc_txq[i]); - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->sc_tx_timer = 0; } @@ -4555,7 +4556,7 @@ ath_watchdog(struct ifnet *ifp) struct ieee80211com *ic = &sc->sc_ic; ifp->if_timer = 0; - if ((ifp->if_flags & IFF_RUNNING) == 0 || sc->sc_invalid) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->sc_invalid) return; if (sc->sc_tx_timer) { if (--sc->sc_tx_timer == 0) { @@ -4634,7 +4635,7 @@ static int ath_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { #define IS_RUNNING(ifp) \ - ((ifp->if_flags & (IFF_RUNNING|IFF_UP)) == (IFF_RUNNING|IFF_UP)) + ((ifp->if_flags & IFF_UP) && (ifp->if_drv_flags & IFF_DRV_RUNNING)) struct ath_softc *sc = ifp->if_softc; struct ieee80211com *ic = &sc->sc_ic; struct ifreq *ifr = (struct ifreq *)data; @@ -4672,7 +4673,7 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) * the multicast address(es), just recalculate the * multicast filter for the card. */ - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) ath_mode_init(sc); break; case SIOCGATHSTATS: diff --git a/sys/dev/awi/awi.c b/sys/dev/awi/awi.c index 4e2aab16b47f..27e339d2fcd3 100644 --- a/sys/dev/awi/awi.c +++ b/sys/dev/awi/awi.c @@ -653,8 +653,8 @@ awi_init(struct ifnet *ifp) sc->sc_rxdoff = awi_read_4(sc, AWI_CA_IRX_DATA_DESC); sc->sc_rxmoff = awi_read_4(sc, AWI_CA_IRX_PS_DESC); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ic->ic_state = IEEE80211_S_INIT; if (ic->ic_opmode == IEEE80211_M_AHDEMO || @@ -720,7 +720,7 @@ awi_stop(struct ifnet *ifp, int disable) awi_write_1(sc, AWI_CA_FTX_CF, 0); (void)awi_cmd(sc, AWI_CMD_FLUSH_TX, AWI_WAIT); } - ifp->if_flags &= ~(IFF_RUNNING|IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING|IFF_DRV_OACTIVE); ifp->if_timer = 0; sc->sc_tx_timer = sc->sc_rx_timer = 0; if (sc->sc_rxpend != NULL) { @@ -763,7 +763,7 @@ awi_start(struct ifnet *ifp) if (m0 != NULL) { len = m0->m_pkthdr.len; if (awi_next_txd(sc, len, &frame, &ntxd)) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } IF_DEQUEUE(&ic->ic_mgtq, m0); @@ -790,7 +790,7 @@ awi_start(struct ifnet *ifp) IEEE80211_WEP_KIDLEN + IEEE80211_WEP_CRCLEN; } if (awi_next_txd(sc, len, &frame, &ntxd)) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } IFQ_DEQUEUE(&ifp->if_snd, m0); @@ -1293,7 +1293,7 @@ awi_tx_int(struct awi_softc *sc) DPRINTF2(("awi_txint: txdone %d txnext %d txbase %d txend %d\n", sc->sc_txdone, sc->sc_txnext, sc->sc_txbase, sc->sc_txend)); sc->sc_tx_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; awi_start(ifp); } diff --git a/sys/dev/bfe/if_bfe.c b/sys/dev/bfe/if_bfe.c index 5f902f8447a6..5d6309a2b13e 100644 --- a/sys/dev/bfe/if_bfe.c +++ b/sys/dev/bfe/if_bfe.c @@ -1110,7 +1110,7 @@ bfe_txeof(struct bfe_softc *sc) if(i != sc->bfe_tx_cons) { /* we freed up some mbufs */ sc->bfe_tx_cons = i; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } if(sc->bfe_tx_cnt == 0) ifp->if_timer = 0; @@ -1219,7 +1219,7 @@ bfe_intr(void *xsc) if(flag & BFE_RX_FLAG_ERRORS) ifp->if_ierrors++; - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; bfe_init_locked(sc); } @@ -1232,7 +1232,8 @@ bfe_intr(void *xsc) bfe_txeof(sc); /* We have packets pending, fire them out */ - if (ifp->if_flags & IFF_RUNNING && !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + if (ifp->if_drv_flags & IFF_DRV_RUNNING && + !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) bfe_start_locked(ifp); BFE_UNLOCK(sc); @@ -1354,7 +1355,7 @@ bfe_start_locked(struct ifnet *ifp) if (!sc->bfe_link && ifp->if_snd.ifq_len < 10) return; - if (ifp->if_flags & IFF_OACTIVE) + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; while(sc->bfe_tx_ring[idx].bfe_mbuf == NULL) { @@ -1368,7 +1369,7 @@ bfe_start_locked(struct ifnet *ifp) */ if(bfe_encap(sc, m_head, &idx)) { IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } @@ -1410,7 +1411,7 @@ bfe_init_locked(void *xsc) BFE_LOCK_ASSERT(sc); - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) return; bfe_stop(sc); @@ -1431,8 +1432,8 @@ bfe_init_locked(void *xsc) CSR_WRITE_4(sc, BFE_IMASK, BFE_IMASK_DEF); bfe_ifmedia_upd(ifp); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->bfe_stat_ch = timeout(bfe_tick, sc, hz); } @@ -1488,18 +1489,18 @@ bfe_ioctl(struct ifnet *ifp, u_long command, caddr_t data) case SIOCSIFFLAGS: BFE_LOCK(sc); if(ifp->if_flags & IFF_UP) - if(ifp->if_flags & IFF_RUNNING) + if(ifp->if_drv_flags & IFF_DRV_RUNNING) bfe_set_rx_mode(sc); else bfe_init_locked(sc); - else if(ifp->if_flags & IFF_RUNNING) + else if(ifp->if_drv_flags & IFF_DRV_RUNNING) bfe_stop(sc); BFE_UNLOCK(sc); break; case SIOCADDMULTI: case SIOCDELMULTI: BFE_LOCK(sc); - if(ifp->if_flags & IFF_RUNNING) + if(ifp->if_drv_flags & IFF_DRV_RUNNING) bfe_set_rx_mode(sc); BFE_UNLOCK(sc); break; @@ -1528,7 +1529,7 @@ bfe_watchdog(struct ifnet *ifp) printf("bfe%d: watchdog timeout -- resetting\n", sc->bfe_unit); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; bfe_init_locked(sc); ifp->if_oerrors++; @@ -1584,5 +1585,5 @@ bfe_stop(struct bfe_softc *sc) bfe_tx_ring_free(sc); bfe_rx_ring_free(sc); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); } diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index c21509703c3c..be8c7860a4c1 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -2895,7 +2895,7 @@ bge_txeof(sc) } if (cur_tx != NULL) - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; return; } @@ -2995,7 +2995,7 @@ bge_intr(xsc) } } - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* Check RX return ring producer/consumer */ bge_rxeof(sc); @@ -3011,7 +3011,8 @@ bge_intr(xsc) /* Re-enable interrupts. */ CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, 0); - if (ifp->if_flags & IFF_RUNNING && !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + if (ifp->if_drv_flags & IFF_DRV_RUNNING && + !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) bge_start_locked(ifp); BGE_UNLOCK(sc); @@ -3262,7 +3263,7 @@ bge_start_locked(ifp) if ((BGE_TX_RING_CNT - sc->bge_txcnt) < m_head->m_pkthdr.csum_data + 16) { IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } } @@ -3274,7 +3275,7 @@ bge_start_locked(ifp) */ if (bge_encap(sc, m_head, &prodidx)) { IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } ++count; @@ -3332,7 +3333,7 @@ bge_init_locked(sc) ifp = sc->bge_ifp; - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) return; /* Cancel pending I/O and flush buffers. */ @@ -3417,8 +3418,8 @@ bge_init_locked(sc) bge_ifmedia_upd(ifp); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; callout_reset(&sc->bge_stat_ch, hz, bge_tick, sc); @@ -3561,7 +3562,7 @@ bge_ioctl(ifp, command, data) error = EINVAL; else { ifp->if_mtu = ifr->ifr_mtu; - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; bge_init(sc); } break; @@ -3576,12 +3577,12 @@ bge_ioctl(ifp, command, data) * waiting for it to start up, which may take a * second or two. */ - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->bge_if_flags & IFF_PROMISC)) { BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_RX_PROMISC); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->bge_if_flags & IFF_PROMISC) { BGE_CLRBIT(sc, BGE_RX_MODE, @@ -3589,7 +3590,7 @@ bge_ioctl(ifp, command, data) } else bge_init_locked(sc); } else { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { bge_stop(sc); } } @@ -3599,7 +3600,7 @@ bge_ioctl(ifp, command, data) break; case SIOCADDMULTI: case SIOCDELMULTI: - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { BGE_LOCK(sc); bge_setmulti(sc); BGE_UNLOCK(sc); @@ -3647,7 +3648,7 @@ bge_watchdog(ifp) printf("bge%d: watchdog timeout -- resetting\n", sc->bge_unit); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; bge_init(sc); ifp->if_oerrors++; @@ -3760,7 +3761,7 @@ bge_stop(sc) sc->bge_tx_saved_considx = BGE_TXCONS_UNSET; - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); return; } diff --git a/sys/dev/cm/if_cm_isa.c b/sys/dev/cm/if_cm_isa.c index 027d13998d27..1baa6870991c 100644 --- a/sys/dev/cm/if_cm_isa.c +++ b/sys/dev/cm/if_cm_isa.c @@ -107,7 +107,7 @@ cm_isa_detach(device_t dev) int s; cm_stop(sc); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; s = splimp(); arc_ifdetach(ifp); diff --git a/sys/dev/cm/smc90cx6.c b/sys/dev/cm/smc90cx6.c index b2316b08ea51..e61829220b36 100644 --- a/sys/dev/cm/smc90cx6.c +++ b/sys/dev/cm/smc90cx6.c @@ -131,7 +131,7 @@ devclass_t cm_devclass; * else fill tx_act ^ 1 && inc tx_fillcount * * check tx_fillcount again. - * case 2: set IFF_OACTIVE to stop arc_output from filling us. + * case 2: set IFF_DRV_OACTIVE to stop arc_output from filling us. * case 1: start tx * * tint clears IFF_OCATIVE, decrements and checks tx_fillcount @@ -360,9 +360,9 @@ cm_init(xsc) ifp = sc->sc_ifp; - if ((ifp->if_flags & IFF_RUNNING) == 0) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { s = splimp(); - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; cm_reset(sc); cm_start(ifp); splx(s); @@ -441,8 +441,8 @@ cm_reset(sc) sc->sc_tx_act = 0; sc->sc_tx_fillcount = 0; - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; cm_start(ifp); } @@ -490,7 +490,7 @@ cm_start(ifp) if_printf(ifp, "start(%p)\n", ifp); #endif - if ((ifp->if_flags & IFF_RUNNING) == 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; s = splimp(); @@ -577,7 +577,7 @@ cm_start(ifp) * We are filled up to the rim. No more bufs for the moment, * please. */ - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; } else { #ifdef CM_DEBUG if_printf(ifp, "start: starting transmitter on buffer %d\n", @@ -588,7 +588,7 @@ cm_start(ifp) /* * We still can accept another buf, so don't: - * ifp->if_flags |= IFF_OACTIVE; + * ifp->if_drv_flags |= IFF_DRV_OACTIVE; */ sc->sc_intmask |= CM_TA; PUTREG(CMCMD, CM_TX(buffer)); @@ -763,7 +763,7 @@ cm_tint(sc, isr) /* We know we can accept another buffer at this point. */ - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (--sc->sc_tx_fillcount > 0) { @@ -1004,15 +1004,15 @@ cm_ioctl(ifp, command, data) case SIOCSIFFLAGS: if ((ifp->if_flags & IFF_UP) == 0 && - (ifp->if_flags & IFF_RUNNING) != 0) { + (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { /* * If interface is marked down and it is running, * then stop it. */ cm_stop(sc); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; } else if ((ifp->if_flags & IFF_UP) != 0 && - (ifp->if_flags & IFF_RUNNING) == 0) { + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { /* * If interface is marked up and it is stopped, then * start it. diff --git a/sys/dev/cnw/if_cnw.c b/sys/dev/cnw/if_cnw.c index 3baf8a07312a..900feb94274d 100644 --- a/sys/dev/cnw/if_cnw.c +++ b/sys/dev/cnw/if_cnw.c @@ -773,16 +773,22 @@ cnw_start(ifp) #ifdef CNW_DEBUG if (sc->sc_ethercom.ec_if.if_flags & IFF_DEBUG) printf("%s: cnw_start\n", ifp->if_xname); +#if defined(__FreeBSD__) + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) +#else if (ifp->if_flags & IFF_OACTIVE) +#endif printf("%s: cnw_start reentered\n", ifp->if_xname); #endif #if defined(__FreeBSD__) if (sc->cnw_gone) return; -#endif + ifp->if_drv_flags |= IFF_DRV_OACTIVE; +#else ifp->if_flags |= IFF_OACTIVE; +#endif for (;;) { #ifdef ONE_AT_A_TIME @@ -863,7 +869,11 @@ cnw_start(ifp) sc->sc_active = 1; } +#if defined(__FreeBSD__) + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; +#else ifp->if_flags &= ~IFF_OACTIVE; +#endif } /* @@ -1086,7 +1096,7 @@ cnw_intr(arg) (sc->sc_dev.dv_flags & DVF_ACTIVE) == 0) return (0); #else - if ((ifp->if_flags & IFF_RUNNING) == 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; #endif ifp->if_timer = 0; /* stop watchdog timer */ @@ -1201,7 +1211,11 @@ cnw_intr(arg) } sc->sc_active = 0; +#if defined(__FreeBSD__) + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; +#else ifp->if_flags &= ~IFF_OACTIVE; +#endif /* Continue to send packets from the queue */ #if !defined(__FreeBSD__) @@ -1291,7 +1305,7 @@ cnw_ioctl(ifp, cmd, data) if (ifp->if_flags & IFF_UP) { cnw_freebsd_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { cnw_stop(sc); } else { cnw_freebsd_init(sc); @@ -1352,7 +1366,11 @@ cnw_ioctl(ifp, cmd, data) #endif if (error) break; +#if !defined(__FreeBSD__) if ((ifp->if_flags & IFF_RUNNING) == 0) +#else + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) +#endif break; bus_space_read_region_1(sc->sc_memt, sc->sc_memh, sc->sc_memoff + CNW_EREG_CB, @@ -1464,7 +1482,7 @@ cnw_detach(self, flags) struct cnw_softc *sc = (struct cnw_softc *)self; struct ifnet *ifp = &sc->sc_ethercom.ec_if; - /* cnw_disable() checks IFF_RUNNING */ + /* cnw_disable() checks IFF_DRV_RUNNING */ cnw_disable(sc); if ((sc->sc_resource & CNW_RES_NET) != 0) { @@ -1508,12 +1526,12 @@ static void cnw_freebsd_init(xsc) cnw_init(sc); #if 0 - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) cnw_stop(sc); #endif - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* sc->cnw_stat_ch = timeout(cnw_inquire, sc, hz * 60); */ @@ -1535,7 +1553,7 @@ static void cnw_stop(sc) cnw_reset(sc); ifp = sc->sc_ifp; - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); return; } diff --git a/sys/dev/cp/if_cp.c b/sys/dev/cp/if_cp.c index a5692fdc5436..6a0355e31700 100644 --- a/sys/dev/cp/if_cp.c +++ b/sys/dev/cp/if_cp.c @@ -714,7 +714,7 @@ static int cp_sioctl (struct ifnet *ifp, u_long cmd, caddr_t data) bdrv_t *bd = d->board->sys; int error, s, was_up, should_be_up; - was_up = (ifp->if_flags & IFF_RUNNING) != 0; + was_up = (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0; error = sppp_ioctl (ifp, cmd, data); if (error) @@ -736,7 +736,7 @@ static int cp_sioctl (struct ifnet *ifp, u_long cmd, caddr_t data) /* We get here only in case of SIFFLAGS or SIFADDR. */ s = splimp (); CP_LOCK (bd); - should_be_up = (ifp->if_flags & IFF_RUNNING) != 0; + should_be_up = (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0; if (! was_up && should_be_up) { /* Interface goes up -- start it. */ cp_up (d); @@ -844,7 +844,7 @@ static void cp_send (drv_t *d) #endif } #ifndef NETGRAPH - d->ifp->if_flags |= IFF_OACTIVE; + d->ifp->if_drv_flags |= IFF_DRV_OACTIVE; #endif } @@ -896,7 +896,7 @@ static void cp_transmit (cp_chan_t *c, void *attachment, int len) d->timeout = 0; #else ++d->ifp->if_opackets; - d->ifp->if_flags &= ~IFF_OACTIVE; + d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; d->ifp->if_timer = 0; #endif cp_start (d); @@ -973,7 +973,7 @@ static void cp_error (cp_chan_t *c, int data) d->timeout = 0; #else ++d->ifp->if_oerrors; - d->ifp->if_flags &= ~IFF_OACTIVE; + d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; d->ifp->if_timer = 0; #endif cp_start (d); @@ -1063,7 +1063,7 @@ static int cp_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc error = suser (td); if (error) return error; - if (d->ifp->if_flags & IFF_RUNNING) + if (d->ifp->if_drv_flags & IFF_DRV_RUNNING) return EBUSY; if (! strcmp ("cisco", (char*)data)) { IFP2SP(d->ifp)->pp_flags &= ~(PP_FR); diff --git a/sys/dev/cs/if_cs.c b/sys/dev/cs/if_cs.c index 293ae807056a..afa3fb7af6ca 100644 --- a/sys/dev/cs/if_cs.c +++ b/sys/dev/cs/if_cs.c @@ -694,7 +694,7 @@ cs_detach(device_t dev) ifp = sc->ifp; cs_stop(sc); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ether_ifdetach(ifp); if_free(ifp); cs_release_resources(dev); @@ -768,8 +768,8 @@ cs_init(void *xsc) /* * Set running and clear output active flags */ - sc->ifp->if_flags |= IFF_RUNNING; - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* * Start sending process @@ -882,18 +882,18 @@ csintr(void *arg) ifp->if_opackets++; else ifp->if_oerrors++; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_timer = 0; break; case ISQ_BUFFER_EVENT: if (status & READY_FOR_TX) { - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_timer = 0; } if (status & TX_UNDERRUN) { - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_timer = 0; ifp->if_oerrors++; } @@ -909,7 +909,7 @@ csintr(void *arg) } } - if (!(ifp->if_flags & IFF_OACTIVE)) { + if (!(ifp->if_drv_flags & IFF_DRV_OACTIVE)) { cs_start(ifp); } } @@ -1003,7 +1003,7 @@ cs_start(struct ifnet *ifp) if (!(cs_readreg(sc, PP_BusST) & READY_FOR_TX_NOW)) { ifp->if_timer = sc->buf_len; (void) splx(s); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; return; } @@ -1017,7 +1017,7 @@ cs_start(struct ifnet *ifp) ifp->if_timer = length; (void) splx(s); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; return; } } @@ -1035,7 +1035,7 @@ cs_stop(struct cs_softc *sc) cs_writereg(sc, PP_BufCFG, 0); cs_writereg(sc, PP_BusCTL, 0); - sc->ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + sc->ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); sc->ifp->if_timer = 0; (void) splx(s); @@ -1112,11 +1112,11 @@ cs_ioctl(register struct ifnet *ifp, u_long command, caddr_t data) * "stopped", reflecting the UP flag. */ if (sc->ifp->if_flags & IFF_UP) { - if ((sc->ifp->if_flags & IFF_RUNNING)==0) { + if ((sc->ifp->if_drv_flags & IFF_DRV_RUNNING)==0) { cs_init(sc); } } else { - if ((sc->ifp->if_flags & IFF_RUNNING)!=0) { + if ((sc->ifp->if_drv_flags & IFF_DRV_RUNNING)!=0) { cs_stop(sc); } } diff --git a/sys/dev/ctau/if_ct.c b/sys/dev/ctau/if_ct.c index f231820816e0..00751e2e9158 100644 --- a/sys/dev/ctau/if_ct.c +++ b/sys/dev/ctau/if_ct.c @@ -935,7 +935,7 @@ static int ct_sioctl (struct ifnet *ifp, u_long cmd, caddr_t data) bdrv_t *bd = d->bd; int error, s, was_up, should_be_up; - was_up = (ifp->if_flags & IFF_RUNNING) != 0; + was_up = (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0; error = sppp_ioctl (ifp, cmd, data); if (error) return error; @@ -956,7 +956,7 @@ static int ct_sioctl (struct ifnet *ifp, u_long cmd, caddr_t data) /* We get here only in case of SIFFLAGS or SIFADDR. */ s = splimp (); CT_LOCK (bd); - should_be_up = (ifp->if_flags & IFF_RUNNING) != 0; + should_be_up = (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0; if (! was_up && should_be_up) { /* Interface goes up -- start it. */ ct_up (d); @@ -1053,7 +1053,7 @@ static void ct_send (drv_t *d) #endif } #ifndef NETGRAPH - d->ifp->if_flags |= IFF_OACTIVE; + d->ifp->if_drv_flags |= IFF_DRV_OACTIVE; #endif } @@ -1113,7 +1113,7 @@ static void ct_transmit (ct_chan_t *c, void *attachment, int len) d->timeout = 0; #else ++d->ifp->if_opackets; - d->ifp->if_flags &= ~IFF_OACTIVE; + d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; d->ifp->if_timer = 0; #endif ct_start (d); @@ -1199,7 +1199,7 @@ static void ct_error (ct_chan_t *c, int data) d->timeout = 0; #else ++d->ifp->if_oerrors; - d->ifp->if_flags &= ~IFF_OACTIVE; + d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; d->ifp->if_timer = 0; #endif ct_start (d); @@ -1294,7 +1294,7 @@ static int ct_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc error = suser (td); if (error) return error; - if (d->ifp->if_flags & IFF_RUNNING) + if (d->ifp->if_drv_flags & IFF_DRV_RUNNING) return EBUSY; if (! strcmp ("cisco", (char*)data)) { IFP2SP(d->ifp)->pp_flags &= ~(PP_FR); diff --git a/sys/dev/cx/if_cx.c b/sys/dev/cx/if_cx.c index 7b0425e412ea..2d75f97a9d5c 100644 --- a/sys/dev/cx/if_cx.c +++ b/sys/dev/cx/if_cx.c @@ -1090,7 +1090,7 @@ static int cx_sioctl (struct ifnet *ifp, u_long cmd, caddr_t data) return EBUSY; /* Socket ioctls on slave subchannels are not allowed. */ - was_up = (ifp->if_flags & IFF_RUNNING) != 0; + was_up = (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0; error = sppp_ioctl (ifp, cmd, data); if (error) return error; @@ -1111,7 +1111,7 @@ static int cx_sioctl (struct ifnet *ifp, u_long cmd, caddr_t data) /* We get here only in case of SIFFLAGS or SIFADDR. */ s = splhigh (); CX_LOCK (bd); - should_be_up = (ifp->if_flags & IFF_RUNNING) != 0; + should_be_up = (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0; if (!was_up && should_be_up) { /* Interface goes up -- start it. */ cx_up (d); @@ -1207,7 +1207,7 @@ static void cx_send (drv_t *d) #endif } #ifndef NETGRAPH - d->ifp->if_flags |= IFF_OACTIVE; + d->ifp->if_drv_flags |= IFF_DRV_OACTIVE; #endif } @@ -1275,7 +1275,7 @@ static void cx_transmit (cx_chan_t *c, void *attachment, int len) d->timeout = 0; #else ++d->ifp->if_opackets; - d->ifp->if_flags &= ~IFF_OACTIVE; + d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; d->ifp->if_timer = 0; #endif cx_start (d); @@ -1435,7 +1435,7 @@ static void cx_error (cx_chan_t *c, int data) d->timeout = 0; #else ++d->ifp->if_oerrors; - d->ifp->if_flags &= ~IFF_OACTIVE; + d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; d->ifp->if_timer = 0; cx_start (d); #endif @@ -1654,7 +1654,7 @@ static int cx_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struc return error; if (c->mode == M_ASYNC) return EBUSY; - if (d->ifp->if_flags & IFF_RUNNING) + if (d->ifp->if_drv_flags & IFF_DRV_RUNNING) return EBUSY; if (! strcmp ("cisco", (char*)data)) { IFP2SP(d->ifp)->pp_flags &= ~(PP_FR); diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index 7fd956812523..b1ef62aef091 100644 --- a/sys/dev/dc/if_dc.c +++ b/sys/dev/dc/if_dc.c @@ -1330,7 +1330,7 @@ dc_setfilt_xircom(struct dc_softc *sc) DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_TX_ON); DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_ON); - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; sframe->dc_status = htole32(DC_TXSTAT_OWN); CSR_WRITE_4(sc, DC_TXSTART, 0xFFFFFFFF); @@ -2908,7 +2908,7 @@ dc_txeof(struct dc_softc *sc) if (idx != sc->dc_cdata.dc_tx_cons) { /* Some buffers have been freed. */ sc->dc_cdata.dc_tx_cons = idx; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } ifp->if_timer = (sc->dc_cdata.dc_tx_cnt == 0) ? 0 : 5; } @@ -3057,7 +3057,8 @@ dc_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) sc->rxcycles = count; dc_rxeof(sc); dc_txeof(sc); - if (!IFQ_IS_EMPTY(&ifp->if_snd) && !(ifp->if_flags & IFF_OACTIVE)) + if (!IFQ_IS_EMPTY(&ifp->if_snd) && + !(ifp->if_drv_flags & IFF_DRV_OACTIVE)) dc_start(ifp); if (cmd == POLL_AND_CHECK_STATUS) { /* also check status register */ @@ -3328,7 +3329,7 @@ dc_start(struct ifnet *ifp) return; } - if (ifp->if_flags & IFF_OACTIVE) { + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { DC_UNLOCK(sc); return; } @@ -3346,7 +3347,7 @@ dc_start(struct ifnet *ifp) m = m_defrag(m_head, M_DONTWAIT); if (m == NULL) { IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } else { m_head = m; @@ -3355,7 +3356,7 @@ dc_start(struct ifnet *ifp) if (dc_encap(sc, &m_head)) { IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } idx = sc->dc_cdata.dc_tx_prod; @@ -3368,7 +3369,7 @@ dc_start(struct ifnet *ifp) BPF_MTAP(ifp, m_head); if (sc->dc_flags & DC_TX_ONE) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } } @@ -3550,8 +3551,8 @@ dc_init(void *xsc) mii_mediachg(mii); dc_setcfg(sc, sc->dc_if_media); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* Don't start the ticker if this is a homePNA link. */ if (IFM_SUBTYPE(mii->mii_media.ifm_media) == IFM_HPNA_1) @@ -3640,7 +3641,7 @@ dc_ioctl(struct ifnet *ifp, u_long command, caddr_t data) int need_setfilt = (ifp->if_flags ^ sc->dc_if_flags) & (IFF_PROMISC | IFF_ALLMULTI); - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { if (need_setfilt) dc_setfilt(sc); } else { @@ -3648,7 +3649,7 @@ dc_ioctl(struct ifnet *ifp, u_long command, caddr_t data) dc_init(sc); } } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) dc_stop(sc); } sc->dc_if_flags = ifp->if_flags; @@ -3726,7 +3727,7 @@ dc_stop(struct dc_softc *sc) callout_stop(&sc->dc_stat_ch); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); #ifdef DEVICE_POLLING ether_poll_deregister(ifp); #endif diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c index 421d1aa38aaa..d786abe2c1f8 100644 --- a/sys/dev/de/if_de.c +++ b/sys/dev/de/if_de.c @@ -308,7 +308,7 @@ tulip_linkup( if ((sc->tulip_flags & TULIP_LINKUP) == 0) sc->tulip_flags |= TULIP_PRINTLINKUP; sc->tulip_flags |= TULIP_LINKUP; - sc->tulip_ifp->if_flags &= ~IFF_OACTIVE; + sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; #if 0 /* XXX how does with work with ifmedia? */ if ((sc->tulip_flags & TULIP_DIDNWAY) == 0) { if (sc->tulip_ifp->if_flags & IFF_FULLDUPLEX) { @@ -606,7 +606,7 @@ tulip_media_poll( } if (event == TULIP_MEDIAPOLL_START) { - sc->tulip_ifp->if_flags |= IFF_OACTIVE; + sc->tulip_ifp->if_drv_flags |= IFF_DRV_OACTIVE; if (sc->tulip_probe_state != TULIP_PROBE_INACTIVE) return; sc->tulip_probe_mediamask = 0; @@ -778,7 +778,7 @@ tulip_media_poll( if (++sc->tulip_probe_passes == 3) { if_printf(ifp, "autosense failed: cable problem?\n"); if ((sc->tulip_ifp->if_flags & IFF_UP) == 0) { - sc->tulip_ifp->if_flags &= ~IFF_RUNNING; + sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sc->tulip_probe_state = TULIP_PROBE_INACTIVE; return; } @@ -1027,7 +1027,7 @@ tulip_21041_media_poll( * restart the probe (and reset the tulip to a known state). */ if (event == TULIP_MEDIAPOLL_START) { - sc->tulip_ifp->if_flags |= IFF_OACTIVE; + sc->tulip_ifp->if_drv_flags |= IFF_DRV_OACTIVE; sc->tulip_cmdmode &= ~(TULIP_CMD_FULLDUPLEX|TULIP_CMD_RXRUN); #ifdef notyet if (sc->tulip_revinfo >= 0x20) { @@ -1134,7 +1134,7 @@ tulip_21041_media_poll( if_printf(sc->tulip_ifp, "autosense failed: cable problem?\n"); if ((sc->tulip_ifp->if_flags & IFF_UP) == 0) { - sc->tulip_ifp->if_flags &= ~IFF_RUNNING; + sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sc->tulip_probe_state = TULIP_PROBE_INACTIVE; return; } @@ -1354,7 +1354,8 @@ tulip_mii_autonegotiate( ifp->if_xname, phyaddr); sc->tulip_flags &= ~TULIP_TXPROBE_ACTIVE; sc->tulip_probe_state = TULIP_PROBE_FAILED; - sc->tulip_ifp->if_flags &= ~(IFF_UP|IFF_RUNNING); + sc->tulip_ifp->if_flags &= ~IFF_UP; + sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; return; } status = tulip_mii_readreg(sc, phyaddr, PHYREG_STATUS); @@ -3184,7 +3185,7 @@ tulip_reset( if (!inreset) { sc->tulip_flags |= TULIP_INRESET; sc->tulip_flags &= ~(TULIP_NEEDRESET|TULIP_RXBUFSLOW); - sc->tulip_ifp->if_flags &= ~IFF_OACTIVE; + sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } #if defined(TULIP_BUS_DMA) && !defined(TULIP_BUS_DMA_NOTX) @@ -3318,11 +3319,11 @@ tulip_init( tulip_softc_t * const sc) { if (sc->tulip_ifp->if_flags & IFF_UP) { - if ((sc->tulip_ifp->if_flags & IFF_RUNNING) == 0) { + if ((sc->tulip_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { /* initialize the media */ tulip_reset(sc); } - sc->tulip_ifp->if_flags |= IFF_RUNNING; + sc->tulip_ifp->if_drv_flags |= IFF_DRV_RUNNING; if (sc->tulip_ifp->if_flags & IFF_PROMISC) { sc->tulip_flags |= TULIP_PROMISC; sc->tulip_cmdmode |= TULIP_CMD_PROMISCUOUS; @@ -3342,7 +3343,7 @@ tulip_init( sc->tulip_cmdmode |= TULIP_CMD_RXRUN; sc->tulip_intrmask |= TULIP_STS_RXSTOPPED; } else { - sc->tulip_ifp->if_flags |= IFF_OACTIVE; + sc->tulip_ifp->if_drv_flags |= IFF_DRV_OACTIVE; sc->tulip_cmdmode &= ~TULIP_CMD_RXRUN; sc->tulip_intrmask &= ~TULIP_STS_RXSTOPPED; } @@ -3351,7 +3352,7 @@ tulip_init( if ((sc->tulip_flags & (TULIP_WANTSETUP|TULIP_TXPROBE_ACTIVE)) == TULIP_WANTSETUP) tulip_txput_setup(sc); } else { - sc->tulip_ifp->if_flags &= ~IFF_RUNNING; + sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; tulip_reset(sc); } } @@ -3774,7 +3775,7 @@ tulip_tx_intr( ri->ri_nextin = ri->ri_first; if ((sc->tulip_flags & TULIP_TXPROBE_ACTIVE) == 0) - sc->tulip_ifp->if_flags &= ~IFF_OACTIVE; + sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } /* * If nothing left to transmit, disable the timer. @@ -4280,7 +4281,7 @@ tulip_txput( if (sc->tulip_flags & TULIP_TXPROBE_ACTIVE) { TULIP_CSR_WRITE(sc, csr_txpoll, 1); - sc->tulip_ifp->if_flags |= IFF_OACTIVE; + sc->tulip_ifp->if_drv_flags |= IFF_DRV_OACTIVE; TULIP_PERFEND(txput); return NULL; } @@ -4309,7 +4310,7 @@ tulip_txput( sc->tulip_dbg.dbg_txput_finishes[6]++; #endif if (sc->tulip_flags & (TULIP_WANTTXSTART|TULIP_DOINGSETUP)) { - sc->tulip_ifp->if_flags |= IFF_OACTIVE; + sc->tulip_ifp->if_drv_flags |= IFF_DRV_OACTIVE; if ((sc->tulip_intrmask & TULIP_STS_TXINTR) == 0) { sc->tulip_intrmask |= TULIP_STS_TXINTR; TULIP_CSR_WRITE(sc, csr_intr, sc->tulip_intrmask); @@ -4494,7 +4495,7 @@ tulip_ifstart( TULIP_PERFSTART(ifstart) tulip_softc_t * const sc = (tulip_softc_t *)ifp->if_softc; - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { TULIP_LOCK(sc); tulip_start(sc); TULIP_UNLOCK(sc); diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index 46e98d555ddc..18b625e2de20 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -353,7 +353,7 @@ ed_detach(device_t dev) if (sc->gone) return (0); ed_stop(sc); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ether_ifdetach(ifp); if_free(ifp); sc->gone = 1; @@ -595,8 +595,8 @@ ed_init(void *xsc) /* * Set 'running' flag, and clear output active flag. */ - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* * ...and attempt to start output @@ -665,7 +665,7 @@ ed_xmit(struct ed_softc *sc) * 1) that the current priority is set to splimp _before_ this code * is called *and* is returned to the appropriate priority after * return - * 2) that the IFF_OACTIVE flag is checked before this code is called + * 2) that the IFF_DRV_OACTIVE flag is checked before this code is called * (i.e. that the output part of the interface is idle) */ static void @@ -699,7 +699,7 @@ outloop: /* * No room. Indicate this to the outside world and exit. */ - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; return; } IFQ_DRV_DEQUEUE(&ifp->if_snd, m); @@ -712,7 +712,7 @@ outloop: * transmitter may be active, but if we haven't filled all the * buffers with data then we still want to accept more. */ - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; return; } @@ -1069,7 +1069,7 @@ edintr(void *arg) * reset tx busy and output active flags */ sc->xmit_busy = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* * clear watchdog timer @@ -1180,7 +1180,7 @@ edintr(void *arg) * attempt to start output on the interface. This is done * after handling the receiver to give the receiver priority. */ - if ((ifp->if_flags & IFF_OACTIVE) == 0) + if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) ed_start(ifp); /* @@ -1218,7 +1218,7 @@ ed_ioctl(struct ifnet *ifp, u_long command, caddr_t data) int s, error = 0; if (sc == NULL || sc->gone) { - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; return ENXIO; } s = splimp(); @@ -1231,12 +1231,12 @@ ed_ioctl(struct ifnet *ifp, u_long command, caddr_t data) * If it is marked down and running, then stop it. */ if (ifp->if_flags & IFF_UP) { - if ((ifp->if_flags & IFF_RUNNING) == 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) ed_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { ed_stop(sc); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; } } diff --git a/sys/dev/em/if_em.c b/sys/dev/em/if_em.c index 076b4ff95ed6..c41c38edd25c 100644 --- a/sys/dev/em/if_em.c +++ b/sys/dev/em/if_em.c @@ -562,7 +562,7 @@ em_detach(device_t dev) EM_LOCK_DESTROY(adapter); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); ifp->if_timer = 0; return(0); @@ -619,7 +619,7 @@ em_start_locked(struct ifnet *ifp) if (em_encap(adapter, &m_head)) { if (m_head == NULL) break; - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; IFQ_DRV_PREPEND(&ifp->if_snd, m_head); break; } @@ -693,14 +693,14 @@ em_ioctl(struct ifnet *ifp, u_long command, caddr_t data) IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFFLAGS (Set Interface Flags)"); EM_LOCK(adapter); if (ifp->if_flags & IFF_UP) { - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { em_init_locked(adapter); } em_disable_promisc(adapter); em_set_promisc(adapter); } else { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { em_stop(adapter); } } @@ -709,7 +709,7 @@ em_ioctl(struct ifnet *ifp, u_long command, caddr_t data) case SIOCADDMULTI: case SIOCDELMULTI: IOCTL_DEBUGOUT("ioctl rcv'd: SIOC(ADD|DEL)MULTI"); - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { EM_LOCK(adapter); em_disable_intr(adapter); em_set_multi(adapter); @@ -742,7 +742,7 @@ em_ioctl(struct ifnet *ifp, u_long command, caddr_t data) ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; reinit = 1; } - if (reinit && (ifp->if_flags & IFF_RUNNING)) + if (reinit && (ifp->if_drv_flags & IFF_DRV_RUNNING)) em_init(adapter); break; default: @@ -777,7 +777,7 @@ em_watchdog(struct ifnet *ifp) if (em_check_for_link(&adapter->hw)) printf("em%d: watchdog timeout -- resetting\n", adapter->unit); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; em_init(adapter); @@ -878,8 +878,8 @@ em_init_locked(struct adapter * adapter) /* Don't loose promiscuous settings */ em_set_promisc(adapter); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (adapter->hw.mac_type >= em_82543) { if (ifp->if_capenable & IFCAP_TXCSUM) @@ -948,12 +948,13 @@ em_poll_locked(struct ifnet *ifp, enum poll_cmd cmd, int count) callout_reset(&adapter->timer, hz, em_local_timer, adapter); } } - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { em_process_receive_interrupts(adapter, count); em_clean_transmit_interrupts(adapter); } - if (ifp->if_flags & IFF_RUNNING && !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + if (ifp->if_drv_flags & IFF_DRV_RUNNING && + !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) em_start_locked(ifp); } @@ -1016,14 +1017,15 @@ em_intr(void *arg) } while (loop_cnt > 0) { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { em_process_receive_interrupts(adapter, -1); em_clean_transmit_interrupts(adapter); } loop_cnt--; } - if (ifp->if_flags & IFF_RUNNING && !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + if (ifp->if_drv_flags & IFF_DRV_RUNNING && + !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) em_start_locked(ifp); EM_UNLOCK(adapter); @@ -1654,7 +1656,7 @@ em_local_timer(void *arg) em_check_for_link(&adapter->hw); em_print_link_status(adapter); em_update_stats_counters(adapter); - if (em_display_debug_stats && ifp->if_flags & IFF_RUNNING) { + if (em_display_debug_stats && ifp->if_drv_flags & IFF_DRV_RUNNING) { em_print_hw_stats(adapter); } em_smartspeed(adapter); @@ -1728,7 +1730,7 @@ em_stop(void *arg) /* Tell the stack that the interface is no longer active */ - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); return; } @@ -2471,13 +2473,13 @@ em_clean_transmit_interrupts(struct adapter * adapter) adapter->oldest_used_tx_desc = i; /* - * If we have enough room, clear IFF_OACTIVE to tell the stack + * If we have enough room, clear IFF_DRV_OACTIVE to tell the stack * that it is OK to send packets. * If there are no pending descriptors, clear the timeout. Otherwise, * if some descriptors have been freed, restart the timeout. */ if (num_avail > EM_TX_CLEANUP_THRESHOLD) { - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (num_avail == adapter->num_tx_desc) ifp->if_timer = 0; else if (num_avail == adapter->num_tx_desc_avail) diff --git a/sys/dev/en/if_en_pci.c b/sys/dev/en/if_en_pci.c index c167e2acdfdd..77724d4e20eb 100644 --- a/sys/dev/en/if_en_pci.c +++ b/sys/dev/en/if_en_pci.c @@ -304,9 +304,9 @@ en_pci_detach(device_t dev) /* * Stop DMA and drop transmit queue. */ - if ((sc->ifp->if_flags & IFF_RUNNING)) { + if ((sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) { if_printf(sc->ifp, "still running\n"); - sc->ifp->if_flags &= ~IFF_RUNNING; + sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; } /* diff --git a/sys/dev/en/midway.c b/sys/dev/en/midway.c index 165655ead0fe..219d5420aca7 100644 --- a/sys/dev/en/midway.c +++ b/sys/dev/en/midway.c @@ -1043,7 +1043,7 @@ en_start(struct ifnet *ifp) continue; } - if ((ifp->if_flags & IFF_RUNNING) == 0) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { EN_UNLOCK(sc); uma_zfree(sc->map_zone, map); m_freem(m); @@ -1314,12 +1314,12 @@ en_close_vcc(struct en_softc *sc, struct atmio_closevcc *cl) goto done; vc->vflags |= VCC_CLOSE_RX; - while ((sc->ifp->if_flags & IFF_RUNNING) && + while ((sc->ifp->if_drv_flags & IFF_DRV_RUNNING) && (vc->vflags & VCC_DRAIN)) cv_wait(&sc->cv_close, &sc->en_mtx); en_close_finish(sc, vc); - if (!(sc->ifp->if_flags & IFF_RUNNING)) { + if (!(sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) { error = EIO; goto done; } @@ -1350,7 +1350,7 @@ en_reset_ul(struct en_softc *sc) int lcv; if_printf(sc->ifp, "reset\n"); - sc->ifp->if_flags &= ~IFF_RUNNING; + sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; if (sc->en_busreset) sc->en_busreset(sc); @@ -1446,7 +1446,7 @@ en_init(struct en_softc *sc) } DBG(sc, INIT, ("going up")); - sc->ifp->if_flags |= IFF_RUNNING; /* enable */ + sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; /* enable */ if (sc->en_busreset) sc->en_busreset(sc); @@ -1550,7 +1550,7 @@ en_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) #if defined(INET) || defined(INET6) if (ifa->ifa_addr->sa_family == AF_INET || ifa->ifa_addr->sa_family == AF_INET6) { - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { en_reset_ul(sc); en_init(sc); } @@ -1559,7 +1559,7 @@ en_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; } #endif /* INET */ - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { en_reset_ul(sc); en_init(sc); } @@ -1569,10 +1569,10 @@ en_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCSIFFLAGS: EN_LOCK(sc); if (ifp->if_flags & IFF_UP) { - if (!(ifp->if_flags & IFF_RUNNING)) + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) en_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) en_reset_ul(sc); } EN_UNLOCK(sc); @@ -2434,7 +2434,7 @@ en_intr(void *arg) "resetting\n", reg, MID_INTBITS); #ifdef EN_DEBUG kdb_enter("en: unexpected error"); - sc->ifp->if_flags &= ~IFF_RUNNING; /* FREEZE! */ + sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; /* FREEZE! */ #else en_reset_ul(sc); en_init(sc); diff --git a/sys/dev/ep/if_ep.c b/sys/dev/ep/if_ep.c index af7e3f7a11be..3cf9623bbbc0 100644 --- a/sys/dev/ep/if_ep.c +++ b/sys/dev/ep/if_ep.c @@ -358,7 +358,7 @@ ep_detach(device_t dev) if (bus_child_present(dev)) epstop(sc); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ether_ifdetach(ifp); if_free(ifp); @@ -438,8 +438,8 @@ epinit_locked(struct ep_softc *sc) CSR_WRITE_2(sc, EP_COMMAND, RX_ENABLE); CSR_WRITE_2(sc, EP_COMMAND, TX_ENABLE); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; /* just in case */ + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* just in case */ #ifdef EP_LOCAL_STATS sc->rx_no_first = sc->rx_no_mbuf = @@ -480,7 +480,7 @@ epstart_locked(struct ifnet *ifp) return; EP_ASSERT_LOCKED(sc); EP_BUSY_WAIT(sc); - if (ifp->if_flags & IFF_OACTIVE) + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; startagain: /* Sneak a peek at the next packet */ @@ -508,7 +508,7 @@ startagain: CSR_WRITE_2(sc, EP_COMMAND, SET_TX_AVAIL_THRESH | (len + pad + 4)); /* make sure */ if (CSR_READ_2(sc, EP_W1_FREE_TX) < len + pad + 4) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; IF_PREPEND(&ifp->if_snd, m0); goto done; } @@ -607,7 +607,7 @@ rescan: if (status & S_TX_AVAIL) { /* we need ACK */ ifp->if_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; GO_WINDOW(sc, 1); CSR_READ_2(sc, EP_W1_FREE_TX); epstart_locked(ifp); @@ -681,7 +681,7 @@ rescan: /* pops up the next status */ CSR_WRITE_1(sc, EP_W1_TX_STATUS, 0x0); } /* while */ - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; GO_WINDOW(sc, 1); CSR_READ_2(sc, EP_W1_FREE_TX); epstart_locked(ifp); @@ -910,8 +910,8 @@ epioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCSIFFLAGS: EP_LOCK(sc); if (((ifp->if_flags & IFF_UP) == 0) && - (ifp->if_flags & IFF_RUNNING)) { - ifp->if_flags &= ~IFF_RUNNING; + (ifp->if_drv_flags & IFF_DRV_RUNNING)) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; epstop(sc); } else /* reinitialize card on any parameter change */ @@ -956,7 +956,7 @@ epwatchdog(struct ifnet *ifp) if (sc->gone) return; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; epstart(ifp); ep_intr(ifp->if_softc); } diff --git a/sys/dev/ex/if_ex.c b/sys/dev/ex/if_ex.c index 51fc4f493628..e3d4859d9a79 100644 --- a/sys/dev/ex/if_ex.c +++ b/sys/dev/ex/if_ex.c @@ -274,7 +274,7 @@ ex_detach(device_t dev) ex_stop(sc); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ether_ifdetach(ifp); if_free(ifp); @@ -354,8 +354,8 @@ ex_init(void *xsc) CSR_WRITE_2(sc, XMT_BAR, sc->tx_lower_limit); sc->tx_head = sc->tx_tail = sc->tx_lower_limit; - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; DODEBUG(Status, printf("OIDLE init\n");); ex_setmulti(sc); @@ -392,7 +392,7 @@ ex_start(struct ifnet *ifp) * more packets left, or the card cannot accept any more yet. */ while (((opkt = ifp->if_snd.ifq_head) != NULL) && - !(ifp->if_flags & IFF_OACTIVE)) { + !(ifp->if_drv_flags & IFF_DRV_OACTIVE)) { /* * Ensure there is enough free transmit buffer space for @@ -538,7 +538,7 @@ ex_start(struct ifnet *ifp) ifp->if_opackets++; m_freem(opkt); } else { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; DODEBUG(Status, printf("OACTIVE start\n");); } } @@ -656,7 +656,7 @@ ex_tx_intr(struct ex_softc *sc) * The card should be ready to accept more packets now. */ - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; DODEBUG(Status, printf("OIDLE tx_intr\n");); DODEBUG(Start_End, printf("ex_tx_intr%d: finish\n", unit);); @@ -792,9 +792,9 @@ ex_ioctl(register struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCSIFFLAGS: DODEBUG(Start_End, printf("SIOCSIFFLAGS");); if ((ifp->if_flags & IFF_UP) == 0 && - (ifp->if_flags & IFF_RUNNING)) { + (ifp->if_drv_flags & IFF_DRV_RUNNING)) { - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ex_stop(sc); } else { ex_init(sc); @@ -951,7 +951,7 @@ ex_watchdog(struct ifnet *ifp) DODEBUG(Start_End, printf("%s: ex_watchdog: start\n", ifp->if_xname);); - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; DODEBUG(Status, printf("OIDLE watchdog\n");); diff --git a/sys/dev/fatm/if_fatm.c b/sys/dev/fatm/if_fatm.c index 25c2f78a707b..cf4437415313 100644 --- a/sys/dev/fatm/if_fatm.c +++ b/sys/dev/fatm/if_fatm.c @@ -171,7 +171,7 @@ fatm_utopia_writereg(struct ifatm *ifatm, u_int reg, u_int mask, u_int val) sc = ifatm->ifp->if_softc; FATM_CHECKLOCK(sc); - if (!(ifatm->ifp->if_flags & IFF_RUNNING)) + if (!(ifatm->ifp->if_drv_flags & IFF_DRV_RUNNING)) return (EIO); /* get queue element and fill it */ @@ -254,7 +254,7 @@ fatm_utopia_readregs_internal(struct fatm_softc *sc) /* get the buffer */ for (;;) { - if (!(sc->ifp->if_flags & IFF_RUNNING)) + if (!(sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) return (EIO); if (!(sc->flags & FATM_REGS_INUSE)) break; @@ -396,7 +396,7 @@ fatm_watchdog(struct ifnet *ifp) struct fatm_softc *sc = ifp->if_softc; FATM_LOCK(sc); - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { fatm_check_heartbeat(sc); ifp->if_timer = 5; } @@ -476,8 +476,8 @@ fatm_stop(struct fatm_softc *sc) /* stop watchdog */ sc->ifp->if_timer = 0; - if (sc->ifp->if_flags & IFF_RUNNING) { - sc->ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + if (sc->ifp->if_drv_flags & IFF_DRV_RUNNING) { + sc->ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); ATMEV_SEND_IFSTATE_CHANGED(IFP2IFATM(sc->ifp), sc->utopia.carrier == UTP_CARR_OK); @@ -1260,7 +1260,7 @@ fatm_init_locked(struct fatm_softc *sc) uint32_t start; DBG(sc, INIT, ("initialize")); - if (sc->ifp->if_flags & IFF_RUNNING) + if (sc->ifp->if_drv_flags & IFF_DRV_RUNNING) fatm_stop(sc); /* @@ -1336,7 +1336,7 @@ fatm_init_locked(struct fatm_softc *sc) /* * Now set flags, that we are ready */ - sc->ifp->if_flags |= IFF_RUNNING; + sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; /* * Start the watchdog timer @@ -1635,7 +1635,7 @@ fatm_intr(void *p) } WRITE4(sc, FATMO_HCR, FATM_HCR_CLRIRQ); - if (!(sc->ifp->if_flags & IFF_RUNNING)) { + if (!(sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) { FATM_UNLOCK(sc); return; } @@ -1690,7 +1690,7 @@ fatm_getstat(struct fatm_softc *sc) * statistics buffer */ for (;;) { - if (!(sc->ifp->if_flags & IFF_RUNNING)) + if (!(sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) return (EIO); if (!(sc->flags & FATM_STAT_INUSE)) break; @@ -2096,7 +2096,7 @@ fatm_start(struct ifnet *ifp) * From here on we need the softc */ FATM_LOCK(sc); - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { FATM_UNLOCK(sc); m_freem(m); break; @@ -2264,7 +2264,7 @@ fatm_open_vcc(struct fatm_softc *sc, struct atmio_openvcc *op) error = 0; FATM_LOCK(sc); - if (!(sc->ifp->if_flags & IFF_RUNNING)) { + if (!(sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) { error = EIO; goto done; } @@ -2404,7 +2404,7 @@ fatm_close_vcc(struct fatm_softc *sc, struct atmio_closevcc *cl) error = 0; FATM_LOCK(sc); - if (!(sc->ifp->if_flags & IFF_RUNNING)) { + if (!(sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) { error = EIO; goto done; } @@ -2467,7 +2467,7 @@ fatm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t arg) case SIOCSIFADDR: FATM_LOCK(sc); ifp->if_flags |= IFF_UP; - if (!(ifp->if_flags & IFF_RUNNING)) + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) fatm_init_locked(sc); switch (ifa->ifa_addr->sa_family) { #ifdef INET @@ -2485,11 +2485,11 @@ fatm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t arg) case SIOCSIFFLAGS: FATM_LOCK(sc); if (ifp->if_flags & IFF_UP) { - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { fatm_init_locked(sc); } } else { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { fatm_stop(sc); } } @@ -2498,7 +2498,7 @@ fatm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t arg) case SIOCGIFMEDIA: case SIOCSIFMEDIA: - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) error = ifmedia_ioctl(ifp, ifr, &sc->media, cmd); else error = EINVAL; diff --git a/sys/dev/fe/if_fe.c b/sys/dev/fe/if_fe.c index 8b54c011a7a3..ce5b57aaf764 100644 --- a/sys/dev/fe/if_fe.c +++ b/sys/dev/fe/if_fe.c @@ -976,7 +976,7 @@ fe_stop (struct fe_softc *sc) DELAY(200); /* Reset transmitter variables and interface flags. */ - sc->ifp->if_flags &= ~(IFF_OACTIVE | IFF_RUNNING); + sc->ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE | IFF_DRV_RUNNING); sc->ifp->if_timer = 0; sc->txb_free = sc->txb_size; sc->txb_count = 0; @@ -1110,7 +1110,7 @@ fe_init (void * xsc) #endif /* Set 'running' flag, because we are now running. */ - sc->ifp->if_flags |= IFF_RUNNING; + sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; /* * At this point, the interface is running properly, @@ -1162,7 +1162,7 @@ fe_xmit (struct fe_softc *sc) * 1) that the current priority is set to splimp _before_ this code * is called *and* is returned to the appropriate priority after * return - * 2) that the IFF_OACTIVE flag is checked before this code is called + * 2) that the IFF_DRV_OACTIVE flag is checked before this code is called * (i.e. that the output part of the interface is idle) */ static void @@ -1300,7 +1300,7 @@ fe_start (struct ifnet *ifp) * filled all the buffers with data then we still * want to accept more. */ - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; return; indicate_active: @@ -1308,7 +1308,7 @@ fe_start (struct ifnet *ifp) * The transmitter is active, and there are no room for * more outgoing packets in the transmission buffer. */ - sc->ifp->if_flags |= IFF_OACTIVE; + sc->ifp->if_drv_flags |= IFF_DRV_OACTIVE; return; } @@ -1532,7 +1532,7 @@ fe_tint (struct fe_softc * sc, u_char tstat) * The transmitter is no more active. * Reset output active flag and watchdog timer. */ - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->ifp->if_timer = 0; /* @@ -1723,7 +1723,7 @@ fe_intr (void *arg) if (sc->filter_change && sc->txb_count == 0 && sc->txb_sched == 0) { fe_loadmar(sc); - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } /* @@ -1739,7 +1739,7 @@ fe_intr (void *arg) * receiver interrupts. 86960 can raise a receiver * interrupt when the transmission buffer is full. */ - if ((sc->ifp->if_flags & IFF_OACTIVE) == 0) + if ((sc->ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) fe_start(sc->ifp); } @@ -1767,10 +1767,10 @@ fe_ioctl (struct ifnet * ifp, u_long command, caddr_t data) * "stopped", reflecting the UP flag. */ if (sc->ifp->if_flags & IFF_UP) { - if ((sc->ifp->if_flags & IFF_RUNNING) == 0) + if ((sc->ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) fe_init(sc); } else { - if ((sc->ifp->if_flags & IFF_RUNNING) != 0) + if ((sc->ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) fe_stop(sc); } @@ -2084,7 +2084,6 @@ fe_mcaf ( struct fe_softc *sc ) static void fe_setmode (struct fe_softc *sc) { - int flags = sc->ifp->if_flags; /* * If the interface is not running, we postpone the update @@ -2096,13 +2095,13 @@ fe_setmode (struct fe_softc *sc) * To complete the trick, fe_init() calls fe_setmode() after * restarting the interface. */ - if (!(flags & IFF_RUNNING)) + if (!(sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) return; /* * Promiscuous mode is handled separately. */ - if (flags & IFF_PROMISC) { + if (sc->ifp->if_flags & IFF_PROMISC) { /* * Program 86960 to receive all packets on the segment * including those directed to other stations. @@ -2128,7 +2127,7 @@ fe_setmode (struct fe_softc *sc) /* * Find the new multicast filter value. */ - if (flags & IFF_ALLMULTI) + if (sc->ifp->if_flags & IFF_ALLMULTI) sc->filter = fe_filter_all; else sc->filter = fe_mcaf(sc); diff --git a/sys/dev/firewire/if_fwe.c b/sys/dev/firewire/if_fwe.c index df57f27d4786..e9d9107b4b4d 100644 --- a/sys/dev/firewire/if_fwe.c +++ b/sys/dev/firewire/if_fwe.c @@ -289,7 +289,11 @@ fwe_stop(struct fwe_softc *fwe) fwe->dma_ch = -1; } +#if defined(__FreeBSD__) + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); +#else ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); +#endif } static int @@ -404,8 +408,13 @@ found: if ((xferq->flag & FWXFERQ_RUNNING) == 0) fc->irx_enable(fc, fwe->dma_ch); +#if defined(__FreeBSD__) + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; +#else ifp->if_flags |= IFF_RUNNING; ifp->if_flags &= ~IFF_OACTIVE; +#endif FWE_POLL_REGISTER(fwe_poll, fwe, ifp); #if 0 @@ -426,10 +435,18 @@ fwe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCSIFFLAGS: s = splimp(); if (ifp->if_flags & IFF_UP) { +#if defined(__FreeBSD__) + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) +#else if (!(ifp->if_flags & IFF_RUNNING)) +#endif fwe_init(&fwe->eth_softc); } else { +#if defined(__FreeBSD__) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) +#else if (ifp->if_flags & IFF_RUNNING) +#endif fwe_stop(fwe); } /* XXX keep promiscoud mode */ @@ -525,12 +542,20 @@ fwe_start(struct ifnet *ifp) } s = splimp(); +#if defined(__FreeBSD__) + ifp->if_drv_flags |= IFF_DRV_OACTIVE; +#else ifp->if_flags |= IFF_OACTIVE; +#endif if (ifp->if_snd.ifq_len != 0) fwe_as_output(fwe, ifp); +#if defined(__FreeBSD__) + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; +#else ifp->if_flags &= ~IFF_OACTIVE; +#endif splx(s); } diff --git a/sys/dev/firewire/if_fwip.c b/sys/dev/firewire/if_fwip.c index 3d12ad2dd685..9fcfac65a09c 100644 --- a/sys/dev/firewire/if_fwip.c +++ b/sys/dev/firewire/if_fwip.c @@ -269,7 +269,11 @@ fwip_stop(struct fwip_softc *fwip) fwip->dma_ch = -1; } +#if defined(__FreeBSD__) + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); +#else ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); +#endif } static int @@ -397,8 +401,13 @@ found: if ((xferq->flag & FWXFERQ_RUNNING) == 0) fc->irx_enable(fc, fwip->dma_ch); +#if defined(__FreeBSD__) + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; +#else ifp->if_flags |= IFF_RUNNING; ifp->if_flags &= ~IFF_OACTIVE; +#endif FWIP_POLL_REGISTER(fwip_poll, fwip, ifp); #if 0 @@ -417,10 +426,18 @@ fwip_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCSIFFLAGS: s = splimp(); if (ifp->if_flags & IFF_UP) { +#if defined(__FreeBSD__) + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) +#else if (!(ifp->if_flags & IFF_RUNNING)) +#endif fwip_init(&fwip->fw_softc); } else { +#if defined(__FreeBSD__) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) +#else if (ifp->if_flags & IFF_RUNNING) +#endif fwip_stop(fwip); } splx(s); @@ -536,12 +553,20 @@ fwip_start(struct ifnet *ifp) } s = splimp(); +#if defined(__FreeBSD__) + ifp->if_drv_flags |= IFF_DRV_OACTIVE; +#else ifp->if_flags |= IFF_OACTIVE; +#endif if (ifp->if_snd.ifq_len != 0) fwip_async_output(fwip, ifp); +#if defined(__FreeBSD__) + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; +#else ifp->if_flags &= ~IFF_OACTIVE; +#endif splx(s); } diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index 65752839db1f..f87325b0482f 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -1835,7 +1835,7 @@ fxp_stop(struct fxp_softc *sc) struct fxp_tx *txp; int i; - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); ifp->if_timer = 0; #ifdef DEVICE_POLLING @@ -2153,8 +2153,8 @@ fxp_init_body(struct fxp_softc *sc) if (sc->miibus != NULL) mii_mediachg(device_get_softc(sc->miibus)); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* * Enable interrupts. @@ -2378,7 +2378,7 @@ fxp_ioctl(struct ifnet *ifp, u_long command, caddr_t data) if (ifp->if_flags & IFF_UP) { fxp_init_body(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) fxp_stop(sc); } FXP_UNLOCK(sc); diff --git a/sys/dev/gem/if_gem.c b/sys/dev/gem/if_gem.c index 900af18eac57..a1347c0e19f9 100644 --- a/sys/dev/gem/if_gem.c +++ b/sys/dev/gem/if_gem.c @@ -638,7 +638,7 @@ gem_stop(ifp, disable) /* * Mark the interface down and cancel the watchdog timer. */ - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); ifp->if_timer = 0; } @@ -972,8 +972,8 @@ gem_init_locked(sc) /* Start the one second timer. */ callout_reset(&sc->sc_tick_ch, hz, gem_tick, sc); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_timer = 0; sc->sc_ifflags = ifp->if_flags; } @@ -1139,7 +1139,8 @@ gem_start_locked(ifp) struct mbuf *m0 = NULL; int firsttx, ntx = 0, ofree, txmfail; - if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING) + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) return; /* @@ -1198,7 +1199,7 @@ gem_start_locked(ifp) if (txmfail == -1 || sc->sc_txfree == 0) { /* No more slots left; notify upper layer. */ - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; } if (ntx > 0) { @@ -1338,8 +1339,8 @@ gem_tint(sc) if (sc->sc_txfree == GEM_NTXDESC - 1) sc->sc_txwin = 0; - /* Freed some descriptors, so reset IFF_OACTIVE and restart. */ - ifp->if_flags &= ~IFF_OACTIVE; + /* Freed some descriptors, so reset IFF_DRV_OACTIVE and restart. */ + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; gem_start_locked(ifp); if (STAILQ_EMPTY(&sc->sc_txdirtyq)) @@ -1873,7 +1874,7 @@ gem_ioctl(ifp, cmd, data) else gem_init_locked(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) gem_stop(ifp, 0); } sc->sc_ifflags = ifp->if_flags; diff --git a/sys/dev/hatm/if_hatm.c b/sys/dev/hatm/if_hatm.c index 16740f0f2310..cd955acc147d 100644 --- a/sys/dev/hatm/if_hatm.c +++ b/sys/dev/hatm/if_hatm.c @@ -1974,7 +1974,7 @@ hatm_initialize(struct hatm_softc *sc) u_int cid; static const u_int layout[2][7] = HE_CONFIG_MEM_LAYOUT; - if (sc->ifp->if_flags & IFF_RUNNING) + if (sc->ifp->if_drv_flags & IFF_DRV_RUNNING) return; hatm_init_bus_width(sc); @@ -2244,7 +2244,7 @@ hatm_initialize(struct hatm_softc *sc) v |= HE_PCIM_CTL0_INIT_ENB | HE_PCIM_CTL0_INT_PROC_ENB; pci_write_config(sc->dev, HE_PCIR_GEN_CNTL_0, v, 4); - sc->ifp->if_flags |= IFF_RUNNING; + sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; sc->ifp->if_baudrate = 53 * 8 * IFP2IFATM(sc->ifp)->mib.pcr; sc->utopia.flags &= ~UTP_FL_POLL_CARRIER; @@ -2272,9 +2272,9 @@ hatm_stop(struct hatm_softc *sc) mtx_assert(&sc->mtx, MA_OWNED); - if (!(sc->ifp->if_flags & IFF_RUNNING)) + if (!(sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) return; - sc->ifp->if_flags &= ~IFF_RUNNING; + sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ATMEV_SEND_IFSTATE_CHANGED(IFP2IFATM(sc->ifp), sc->utopia.carrier == UTP_CARR_OK); @@ -2318,7 +2318,7 @@ hatm_stop(struct hatm_softc *sc) /* * Give any waiters on closing a VCC a chance. They will stop - * to wait if they see that IFF_RUNNING disappeared. + * to wait if they see that IFF_DRV_RUNNING disappeared. */ cv_broadcast(&sc->vcc_cv); cv_broadcast(&sc->cv_rcclose); diff --git a/sys/dev/hatm/if_hatm_intr.c b/sys/dev/hatm/if_hatm_intr.c index 3da034f1d58a..750364a8971c 100644 --- a/sys/dev/hatm/if_hatm_intr.c +++ b/sys/dev/hatm/if_hatm_intr.c @@ -537,7 +537,7 @@ hatm_intr(void *p) /* if we have a stray interrupt with a non-initialized card, * we cannot even lock before looking at the flag */ - if (!(sc->ifp->if_flags & IFF_RUNNING)) + if (!(sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) return; mtx_lock(&sc->mtx); diff --git a/sys/dev/hatm/if_hatm_ioctl.c b/sys/dev/hatm/if_hatm_ioctl.c index 0a4724af1727..5e37b5dc75ea 100644 --- a/sys/dev/hatm/if_hatm_ioctl.c +++ b/sys/dev/hatm/if_hatm_ioctl.c @@ -116,7 +116,7 @@ hatm_open_vcc(struct hatm_softc *sc, struct atmio_openvcc *arg) return (ENOMEM); mtx_lock(&sc->mtx); - if (!(sc->ifp->if_flags & IFF_RUNNING)) { + if (!(sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) { error = EIO; goto done; } @@ -230,7 +230,7 @@ hatm_close_vcc(struct hatm_softc *sc, struct atmio_closevcc *arg) mtx_lock(&sc->mtx); vcc = sc->vccs[cid]; - if (!(sc->ifp->if_flags & IFF_RUNNING)) { + if (!(sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) { error = EIO; goto done; } @@ -248,11 +248,11 @@ hatm_close_vcc(struct hatm_softc *sc, struct atmio_closevcc *arg) if (vcc->param.flags & ATMIO_FLAG_ASYNC) goto done; - while ((sc->ifp->if_flags & IFF_RUNNING) && + while ((sc->ifp->if_drv_flags & IFF_DRV_RUNNING) && (vcc->vflags & (HE_VCC_TX_CLOSING | HE_VCC_RX_CLOSING))) cv_wait(&sc->vcc_cv, &sc->mtx); - if (!(sc->ifp->if_flags & IFF_RUNNING)) { + if (!(sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) { error = EIO; goto done; } @@ -284,7 +284,7 @@ hatm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCSIFADDR: mtx_lock(&sc->mtx); ifp->if_flags |= IFF_UP; - if (!(ifp->if_flags & IFF_RUNNING)) + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) hatm_initialize(sc); switch (ifa->ifa_addr->sa_family) { @@ -303,11 +303,11 @@ hatm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCSIFFLAGS: mtx_lock(&sc->mtx); if (ifp->if_flags & IFF_UP) { - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { hatm_initialize(sc); } } else { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { hatm_stop(sc); } } diff --git a/sys/dev/hatm/if_hatm_rx.c b/sys/dev/hatm/if_hatm_rx.c index bf6c7f7d9c52..b79b2fcd7c02 100644 --- a/sys/dev/hatm/if_hatm_rx.c +++ b/sys/dev/hatm/if_hatm_rx.c @@ -316,11 +316,11 @@ hatm_rx_vcc_close(struct hatm_softc *sc, u_int cid) WRITE_RSR(sc, cid, 0, 0xf, 0); v = READ4(sc, HE_REGO_RCCSTAT); - while ((sc->ifp->if_flags & IFF_RUNNING) && + while ((sc->ifp->if_drv_flags & IFF_DRV_RUNNING) && (READ4(sc, HE_REGO_RCCSTAT) & HE_REGM_RCCSTAT_PROG)) cv_timedwait(&sc->cv_rcclose, &sc->mtx, 1); - if (!(sc->ifp->if_flags & IFF_RUNNING)) + if (!(sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) return; WRITE_MBOX4(sc, HE_REGO_RCON_CLOSE, cid); diff --git a/sys/dev/hatm/if_hatm_tx.c b/sys/dev/hatm/if_hatm_tx.c index 7e2676aae2ef..868b5a3d43d6 100644 --- a/sys/dev/hatm/if_hatm_tx.c +++ b/sys/dev/hatm/if_hatm_tx.c @@ -360,7 +360,7 @@ hatm_start(struct ifnet *ifp) u_int len; int error; - if (!(ifp->if_flags & IFF_RUNNING)) + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) return; mtx_lock(&sc->mtx); arg.sc = sc; diff --git a/sys/dev/hme/if_hme.c b/sys/dev/hme/if_hme.c index 82f43a9bd7e8..7d19092f6f2e 100644 --- a/sys/dev/hme/if_hme.c +++ b/sys/dev/hme/if_hme.c @@ -880,8 +880,8 @@ hme_init_locked(struct hme_softc *sc) /* Start the one second timer. */ callout_reset(&sc->sc_tick_ch, hz, hme_tick, sc); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_timer = 0; hme_start_locked(ifp); } @@ -1107,7 +1107,8 @@ hme_start_locked(struct ifnet *ifp) struct mbuf *m; int error, enq = 0; - if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING) + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) return; error = 0; @@ -1118,7 +1119,7 @@ hme_start_locked(struct ifnet *ifp) error = hme_load_txmbuf(sc, m); if (error == -1) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; IFQ_DRV_PREPEND(&ifp->if_snd, m); break; } else if (error > 0) { @@ -1131,7 +1132,7 @@ hme_start_locked(struct ifnet *ifp) } if (sc->sc_rb.rb_td_nbusy == HME_NTXDESC || error == -1) - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; /* Set watchdog timer if a packet was queued */ if (enq) { bus_dmamap_sync(sc->sc_cdmatag, sc->sc_cdmamap, @@ -1184,7 +1185,7 @@ hme_tint(struct hme_softc *sc) CTR0(KTR_HME, "hme_tint: not owned"); --sc->sc_rb.rb_td_nbusy; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* Complete packet transmitted? */ if ((txflags & HME_XD_EOP) == 0) @@ -1558,15 +1559,15 @@ hme_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) switch (cmd) { case SIOCSIFFLAGS: if ((ifp->if_flags & IFF_UP) == 0 && - (ifp->if_flags & IFF_RUNNING) != 0) { + (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { /* * If interface is marked down and it is running, then * stop it. */ hme_stop(sc); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; } else if ((ifp->if_flags & IFF_UP) != 0 && - (ifp->if_flags & IFF_RUNNING) == 0) { + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { /* * If interface is marked up and it is stopped, then * start it. diff --git a/sys/dev/ie/if_ie.c b/sys/dev/ie/if_ie.c index b00b69aff7b1..4326f98e75b0 100644 --- a/sys/dev/ie/if_ie.c +++ b/sys/dev/ie/if_ie.c @@ -466,7 +466,7 @@ ietint(struct ie_softc *sc) int i; sc->ifp->if_timer = 0; - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; for (i = 0; i < sc->xmit_count; i++) { status = sc->xmit_cmds[i]->ie_xmit_status; @@ -927,9 +927,9 @@ iestart(struct ifnet *ifp) */ volatile u_short *bptr = &sc->scb->ie_command_list; - if (!(ifp->if_flags & IFF_RUNNING)) + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) return; - if (ifp->if_flags & IFF_OACTIVE) + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; do { @@ -985,7 +985,7 @@ iestart(struct ifnet *ifp) * command. I wish I understood what was happening here. */ command_and_wait(sc, IE_CU_START, 0, 0); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; } return; } @@ -1601,9 +1601,9 @@ ieinit(xsc) ee16_interrupt_enable(sc); ee16_chan_attn(sc); } - sc->ifp->if_flags |= IFF_RUNNING; /* tell higher levels + sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; /* tell higher levels * we're here */ - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; start_receiver(sc); @@ -1632,11 +1632,11 @@ ieioctl(struct ifnet *ifp, u_long command, caddr_t data) * filtering manually. */ if ((ifp->if_flags & IFF_UP) == 0 && - (ifp->if_flags & IFF_RUNNING)) { - ifp->if_flags &= ~IFF_RUNNING; + (ifp->if_drv_flags & IFF_DRV_RUNNING)) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ie_stop(sc); } else if ((ifp->if_flags & IFF_UP) && - (ifp->if_flags & IFF_RUNNING) == 0) { + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { sc->promisc = ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI); ieinit(sc); @@ -1794,7 +1794,7 @@ ie_detach (device_t dev) ee16_shutdown(sc, 0); ie_stop(sc); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ether_ifdetach(ifp); if_free(ifp); ie_release_resources(dev); diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c index 2053bc5a2e12..616887df0221 100644 --- a/sys/dev/if_ndis/if_ndis.c +++ b/sys/dev/if_ndis/if_ndis.c @@ -1310,7 +1310,7 @@ ndis_txeof(adapter, packet, status) else ifp->if_oerrors++; ifp->if_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; NDIS_UNLOCK(sc); @@ -1549,7 +1549,7 @@ ndis_start(ifp) NDIS_LOCK(sc); - if (!sc->ndis_link || ifp->if_flags & IFF_OACTIVE) { + if (!sc->ndis_link || ifp->if_drv_flags & IFF_DRV_OACTIVE) { NDIS_UNLOCK(sc); return; } @@ -1651,7 +1651,7 @@ ndis_start(ifp) } if (sc->ndis_txpending == 0) - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; /* * Set a timeout in case the chip goes out to lunch. @@ -1732,8 +1732,8 @@ ndis_init(xsc) sc->ndis_txpending = sc->ndis_maxpkts; sc->ndis_link = 0; - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; NDIS_UNLOCK(sc); @@ -2274,7 +2274,7 @@ ndis_ioctl(ifp, command, data) switch(command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->ndis_if_flags & IFF_PROMISC)) { sc->ndis_filter |= @@ -2283,7 +2283,7 @@ ndis_ioctl(ifp, command, data) error = ndis_set_info(sc, OID_GEN_CURRENT_PACKET_FILTER, &sc->ndis_filter, &i); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->ndis_if_flags & IFF_PROMISC) { sc->ndis_filter &= @@ -2295,7 +2295,7 @@ ndis_ioctl(ifp, command, data) } else ndis_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) ndis_stop(sc); } sc->ndis_if_flags = ifp->if_flags; @@ -3000,7 +3000,7 @@ ndis_stop(sc) NDIS_LOCK(sc); ifp->if_timer = 0; sc->ndis_link = 0; - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); NDIS_UNLOCK(sc); ndis_halt_nic(sc); diff --git a/sys/dev/iicbus/if_ic.c b/sys/dev/iicbus/if_ic.c index fba21d169f91..5c6e05b45791 100644 --- a/sys/dev/iicbus/if_ic.c +++ b/sys/dev/iicbus/if_ic.c @@ -182,16 +182,18 @@ icioctl(struct ifnet *ifp, u_long cmd, caddr_t data) ifp->if_flags |= IFF_UP; /* FALLTHROUGH */ case SIOCSIFFLAGS: - if ((!(ifp->if_flags & IFF_UP)) && (ifp->if_flags & IFF_RUNNING)) { + if ((!(ifp->if_flags & IFF_UP)) && + (ifp->if_drv_flags & IFF_DRV_RUNNING)) { /* XXX disable PCF */ - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; /* IFF_UP is not set, try to release the bus anyway */ iicbus_release_bus(parent, icdev); break; } - if (((ifp->if_flags & IFF_UP)) && (!(ifp->if_flags & IFF_RUNNING))) { + if (((ifp->if_flags & IFF_UP)) && + (!(ifp->if_drv_flags & IFF_DRV_RUNNING))) { if ((error = iicbus_request_bus(parent, icdev, IIC_WAIT|IIC_INTR))) return (error); @@ -212,7 +214,7 @@ icioctl(struct ifnet *ifp, u_long cmd, caddr_t data) iicbus_reset(parent, IIC_FASTEST, 0, NULL); - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; } break; @@ -382,7 +384,7 @@ icoutput(struct ifnet *ifp, struct mbuf *m, else hdr = dst->sa_family; - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; s = splhigh(); diff --git a/sys/dev/ipw/if_ipw.c b/sys/dev/ipw/if_ipw.c index 75af5ac3d5a0..88afe1ca7af3 100644 --- a/sys/dev/ipw/if_ipw.c +++ b/sys/dev/ipw/if_ipw.c @@ -733,7 +733,7 @@ ipw_resume(device_t dev) if (ifp->if_flags & IFF_UP) { ifp->if_init(ifp->if_softc); - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) ifp->if_start(ifp); } @@ -756,7 +756,7 @@ ipw_media_change(struct ifnet *ifp) return error; } - if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == (IFF_UP | IFF_RUNNING)) + if ((ifp->if_flags & IFF_UP) && (ifp->if_drv_flags & IFF_DRV_RUNNING)) ipw_init(sc); IPW_UNLOCK(sc); @@ -1199,7 +1199,7 @@ ipw_tx_intr(struct ipw_softc *sc) /* remember what the firmware has processed */ sc->txold = (r == 0) ? IPW_NTBD - 1 : r - 1; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ipw_start(ifp); } @@ -1475,7 +1475,7 @@ ipw_start(struct ifnet *ifp) if (sc->txfree < 1 + IPW_MAX_NSEG) { IFQ_DRV_PREPEND(&ifp->if_snd, m0); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } @@ -1549,10 +1549,10 @@ ipw_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) switch (cmd) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (!(ifp->if_flags & IFF_RUNNING)) + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) ipw_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) ipw_stop(sc); } break; @@ -1581,8 +1581,8 @@ ipw_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } if (error == ENETRESET) { - if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == - (IFF_UP | IFF_RUNNING)) + if ((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING)) ipw_init(sc); error = 0; } @@ -2090,8 +2090,8 @@ ipw_init(void *priv) goto fail; } - ifp->if_flags &= ~IFF_OACTIVE; - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; return; @@ -2119,7 +2119,7 @@ ipw_stop(void *priv) sc->sc_tx_timer = 0; ifp->if_timer = 0; - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); ieee80211_new_state(ic, IEEE80211_S_INIT, -1); } diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c index 61474dae1362..ba662a41afea 100644 --- a/sys/dev/iwi/if_iwi.c +++ b/sys/dev/iwi/if_iwi.c @@ -786,7 +786,7 @@ iwi_resume(device_t dev) if (ifp->if_flags & IFF_UP) { ifp->if_init(ifp->if_softc); - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) ifp->if_start(ifp); } @@ -809,7 +809,7 @@ iwi_media_change(struct ifnet *ifp) return error; } - if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == (IFF_UP | IFF_RUNNING)) + if ((ifp->if_flags & IFF_UP) && (ifp->if_drv_flags & IFF_DRV_RUNNING)) iwi_init(sc); IWI_UNLOCK(sc); @@ -1247,7 +1247,7 @@ iwi_tx_intr(struct iwi_softc *sc) } sc->sc_tx_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; iwi_start(ifp); } @@ -1460,7 +1460,7 @@ iwi_start(struct ifnet *ifp) if (sc->txq.queued >= IWI_TX_RING_COUNT - 4) { IFQ_DRV_PREPEND(&ifp->if_snd, m0); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } @@ -1538,10 +1538,10 @@ iwi_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) switch (cmd) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (!(ifp->if_flags & IFF_RUNNING)) + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) iwi_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) iwi_stop(sc); } break; @@ -1570,8 +1570,8 @@ iwi_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } if (error == ENETRESET) { - if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == - (IFF_UP | IFF_RUNNING)) + if ((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING)) iwi_init(sc); error = 0; } @@ -2276,8 +2276,8 @@ iwi_init(void *priv) else ieee80211_new_state(ic, IEEE80211_S_SCAN, -1); - ifp->if_flags &= ~IFF_OACTIVE; - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; return; @@ -2303,7 +2303,7 @@ iwi_stop(void *priv) sc->sc_tx_timer = 0; ifp->if_timer = 0; - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); ieee80211_new_state(ic, IEEE80211_S_INIT, -1); } diff --git a/sys/dev/ixgb/if_ixgb.c b/sys/dev/ixgb/if_ixgb.c index bd017d172f61..6453262d27ef 100644 --- a/sys/dev/ixgb/if_ixgb.c +++ b/sys/dev/ixgb/if_ixgb.c @@ -401,7 +401,7 @@ ixgb_detach(device_t dev) if (adapter->prev != NULL) adapter->prev->next = adapter->next; - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); ifp->if_timer = 0; IXGB_LOCK_DESTROY(adapter); @@ -453,7 +453,7 @@ ixgb_start_locked(struct ifnet * ifp) break; if (ixgb_encap(adapter, m_head)) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; IF_PREPEND(&ifp->if_snd, m_head); break; } @@ -525,13 +525,13 @@ ixgb_ioctl(struct ifnet * ifp, IOCTL_CMD_TYPE command, caddr_t data) IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFFLAGS (Set Interface Flags)"); IXGB_LOCK(adapter); if (ifp->if_flags & IFF_UP) { - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { ixgb_init_locked(adapter); } ixgb_disable_promisc(adapter); ixgb_set_promisc(adapter); } else { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { ixgb_stop(adapter); } } @@ -540,7 +540,7 @@ ixgb_ioctl(struct ifnet * ifp, IOCTL_CMD_TYPE command, caddr_t data) case SIOCADDMULTI: case SIOCDELMULTI: IOCTL_DEBUGOUT("ioctl rcv'd: SIOC(ADD|DEL)MULTI"); - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { IXGB_LOCK(adapter); ixgb_disable_intr(adapter); ixgb_set_multi(adapter); @@ -561,7 +561,7 @@ ixgb_ioctl(struct ifnet * ifp, IOCTL_CMD_TYPE command, caddr_t data) ifp->if_capenable &= ~IFCAP_HWCSUM; else ifp->if_capenable |= IFCAP_HWCSUM; - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) ixgb_init(adapter); } break; @@ -597,7 +597,7 @@ ixgb_watchdog(struct ifnet * ifp) } printf("ixgb%d: watchdog timeout -- resetting\n", adapter->unit); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ixgb_stop(adapter); @@ -668,8 +668,8 @@ ixgb_init_locked(struct adapter *adapter) ixgb_set_promisc(adapter); ifp = adapter->ifp; - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (ifp->if_capenable & IFCAP_TXCSUM) @@ -744,11 +744,12 @@ ixgb_poll_locked(struct ifnet * ifp, enum poll_cmd cmd, int count) adapter); } } - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { ixgb_process_receive_interrupts(adapter, count); ixgb_clean_transmit_interrupts(adapter); } - if (ifp->if_flags & IFF_RUNNING && ifp->if_snd.ifq_head != NULL) + if (ifp->if_drv_flags & IFF_DRV_RUNNING && + ifp->if_snd.ifq_head != NULL) ixgb_start_locked(ifp); } @@ -826,7 +827,7 @@ ixgb_intr(void *arg) adapter); } while (loop_cnt > 0) { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { ixgb_process_receive_interrupts(adapter, -1); ixgb_clean_transmit_interrupts(adapter); } @@ -837,7 +838,7 @@ ixgb_intr(void *arg) IXGB_WRITE_REG(&adapter->hw, IMC, IXGB_INT_RXDMT0); IXGB_WRITE_REG(&adapter->hw, IMS, IXGB_INT_RXDMT0); } - if (ifp->if_flags & IFF_RUNNING && ifp->if_snd.ifq_head != NULL) + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_snd.ifq_head != NULL) ixgb_start_locked(ifp); IXGB_UNLOCK(adapter); @@ -1116,7 +1117,7 @@ ixgb_local_timer(void *arg) ixgb_check_for_link(&adapter->hw); ixgb_print_link_status(adapter); ixgb_update_stats_counters(adapter); - if (ixgb_display_debug_stats && ifp->if_flags & IFF_RUNNING) { + if (ixgb_display_debug_stats && ifp->if_drv_flags & IFF_DRV_RUNNING) { ixgb_print_hw_stats(adapter); } callout_reset(&adapter->timer, 2 * hz, ixgb_local_timer, adapter); @@ -1174,7 +1175,7 @@ ixgb_stop(void *arg) /* Tell the stack that the interface is no longer active */ - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); return; } @@ -1733,7 +1734,7 @@ ixgb_clean_transmit_interrupts(struct adapter * adapter) adapter->oldest_used_tx_desc = i; /* - * If we have enough room, clear IFF_OACTIVE to tell the stack that + * If we have enough room, clear IFF_DRV_OACTIVE to tell the stack that * it is OK to send packets. If there are no pending descriptors, * clear the timeout. Otherwise, if some descriptors have been freed, * restart the timeout. @@ -1741,7 +1742,7 @@ ixgb_clean_transmit_interrupts(struct adapter * adapter) if (num_avail > IXGB_TX_CLEANUP_THRESHOLD) { struct ifnet *ifp = adapter->ifp; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (num_avail == adapter->num_tx_desc) ifp->if_timer = 0; else if (num_avail == adapter->num_tx_desc_avail) diff --git a/sys/dev/lge/if_lge.c b/sys/dev/lge/if_lge.c index 5fa639141f8e..f1d73d4716ba 100644 --- a/sys/dev/lge/if_lge.c +++ b/sys/dev/lge/if_lge.c @@ -986,7 +986,7 @@ lge_rxeoc(sc) struct ifnet *ifp; ifp = sc->lge_ifp; - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; lge_init(sc); return; } @@ -1034,7 +1034,7 @@ lge_txeof(sc) sc->lge_cdata.lge_tx_cons = idx; if (cur_tx != NULL) - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; return; } @@ -1204,7 +1204,7 @@ lge_start(ifp) idx = sc->lge_cdata.lge_tx_prod; - if (ifp->if_flags & IFF_OACTIVE) + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; while(sc->lge_ldata->lge_tx_list[idx].lge_mbuf == NULL) { @@ -1217,7 +1217,7 @@ lge_start(ifp) if (lge_encap(sc, m_head, &idx)) { IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } @@ -1247,7 +1247,7 @@ lge_init(xsc) struct mii_data *mii; int s; - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) return; s = splimp(); @@ -1363,8 +1363,8 @@ lge_init(xsc) lge_ifmedia_upd(ifp); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; (void)splx(s); @@ -1441,23 +1441,23 @@ lge_ioctl(ifp, command, data) break; case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->lge_if_flags & IFF_PROMISC)) { CSR_WRITE_4(sc, LGE_MODE1, LGE_MODE1_SETRST_CTL1| LGE_MODE1_RX_PROMISC); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->lge_if_flags & IFF_PROMISC) { CSR_WRITE_4(sc, LGE_MODE1, LGE_MODE1_RX_PROMISC); } else { - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; lge_init(sc); } } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) lge_stop(sc); } sc->lge_if_flags = ifp->if_flags; @@ -1496,7 +1496,7 @@ lge_watchdog(ifp) lge_stop(sc); lge_reset(sc); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; lge_init(sc); if (ifp->if_snd.ifq_head != NULL) @@ -1550,7 +1550,7 @@ lge_stop(sc) bzero((char *)&sc->lge_ldata->lge_tx_list, sizeof(sc->lge_ldata->lge_tx_list)); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); return; } diff --git a/sys/dev/lnc/if_lnc.c b/sys/dev/lnc/if_lnc.c index 4829639beb93..ca7f8c0998fc 100644 --- a/sys/dev/lnc/if_lnc.c +++ b/sys/dev/lnc/if_lnc.c @@ -820,7 +820,7 @@ lnc_tint(struct lnc_softc *sc) * more packets again. */ - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; lookahead++; @@ -1070,8 +1070,8 @@ printf("Enabling lnc interrupts\n"); * running and transmit any pending packets. */ write_csr(sc, CSR0, STRT | INEA); - sc->ifp->if_flags |= IFF_RUNNING; - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; lnc_start(sc->ifp); } else log(LOG_ERR, "%s: Initialisation failed\n", @@ -1130,8 +1130,8 @@ lncintr(void *arg) printf("IDON\n"); sc->ifp->if_timer = 0; write_csr(sc, CSR0, STRT | INEA); - sc->ifp->if_flags |= IFF_RUNNING; - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; lnc_start(sc->ifp); continue; } @@ -1174,7 +1174,7 @@ printf("IDON\n"); * some more transmit packets. */ - if (!(sc->ifp->if_flags & IFF_OACTIVE)) + if (!(sc->ifp->if_drv_flags & IFF_DRV_OACTIVE)) lnc_start(sc->ifp); } } @@ -1213,9 +1213,9 @@ chain_to_cluster(struct mbuf *m) } /* - * IFF_OACTIVE and IFF_RUNNING are checked in ether_output so it's redundant - * to check them again since we wouldn't have got here if they were not - * appropriately set. This is also called from lnc_init and lncintr but the + * IFF_DRV_OACTIVE and IFF_DRV_RUNNING are checked in ether_output so it's + * redundant to check them again since we wouldn't have got here if they were + * not appropriately set. This is also called from lnc_init and lncintr but the * flags should be ok at those points too. */ @@ -1366,11 +1366,11 @@ lnc_start(struct ifnet *ifp) } while (sc->pending_transmits < NDESC(sc->ntdre)); /* - * Transmit ring is full so set IFF_OACTIVE + * Transmit ring is full so set IFF_DRV_OACTIVE * since we can't buffer any more packets. */ - sc->ifp->if_flags |= IFF_OACTIVE; + sc->ifp->if_drv_flags |= IFF_DRV_OACTIVE; LNCSTATS(trans_ring_full) } @@ -1412,15 +1412,15 @@ lnc_ioctl(struct ifnet * ifp, u_long command, caddr_t data) } if ((ifp->if_flags & IFF_UP) == 0 && - (ifp->if_flags & IFF_RUNNING) != 0) { + (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { /* * If interface is marked down and it is running, * then stop it. */ lnc_stop(sc); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; } else if ((ifp->if_flags & IFF_UP) != 0 && - (ifp->if_flags & IFF_RUNNING) == 0) { + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { /* * If interface is marked up and it is stopped, then * start it. diff --git a/sys/dev/my/if_my.c b/sys/dev/my/if_my.c index 1741ab7ffa9e..ea89b1c7b671 100644 --- a/sys/dev/my/if_my.c +++ b/sys/dev/my/if_my.c @@ -1322,7 +1322,7 @@ my_txeoc(struct my_softc * sc) ifp = sc->my_ifp; ifp->if_timer = 0; if (sc->my_cdata.my_tx_head == NULL) { - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->my_cdata.my_tx_tail = NULL; if (sc->my_want_auto) my_autoneg_mii(sc, MY_FLAG_SCHEDDELAY, 1); @@ -1480,7 +1480,7 @@ my_start(struct ifnet * ifp) * Check for an available queue slot. If there are none, punt. */ if (sc->my_cdata.my_tx_free->my_mbuf != NULL) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; MY_UNLOCK(sc); return; } @@ -1627,8 +1627,8 @@ my_init(void *xsc) /* Restore state of BMCR */ if (sc->my_pinfo != NULL) my_phy_writereg(sc, PHY_BMCR, phy_bmcr); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; (void)splx(s); MY_UNLOCK(sc); return; @@ -1733,7 +1733,7 @@ my_ioctl(struct ifnet * ifp, u_long command, caddr_t data) case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) my_init(sc); - else if (ifp->if_flags & IFF_RUNNING) + else if (ifp->if_drv_flags & IFF_DRV_RUNNING) my_stop(sc); error = 0; break; @@ -1822,7 +1822,7 @@ my_stop(struct my_softc * sc) } bzero((char *)&sc->my_ldata->my_tx_list, sizeof(sc->my_ldata->my_tx_list)); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); MY_UNLOCK(sc); return; } diff --git a/sys/dev/nge/if_nge.c b/sys/dev/nge/if_nge.c index a4f4514d95e6..ed60cf35ee0d 100644 --- a/sys/dev/nge/if_nge.c +++ b/sys/dev/nge/if_nge.c @@ -1291,7 +1291,7 @@ nge_txeof(sc) if (cur_tx->nge_mbuf != NULL) { m_freem(cur_tx->nge_mbuf); cur_tx->nge_mbuf = NULL; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } sc->nge_cdata.nge_tx_cnt--; @@ -1484,7 +1484,7 @@ nge_intr(arg) if (status & NGE_ISR_SYSERR) { nge_reset(sc); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; nge_init_locked(sc); } @@ -1622,7 +1622,7 @@ nge_start_locked(ifp) idx = sc->nge_cdata.nge_tx_prod; - if (ifp->if_flags & IFF_OACTIVE) + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; while(sc->nge_ldata->nge_tx_list[idx].nge_mbuf == NULL) { @@ -1632,7 +1632,7 @@ nge_start_locked(ifp) if (nge_encap(sc, m_head, &idx)) { IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } @@ -1676,7 +1676,7 @@ nge_init_locked(sc) NGE_LOCK_ASSERT(sc); - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) return; /* @@ -1849,8 +1849,8 @@ nge_init_locked(sc) nge_ifmedia_upd(ifp); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; return; } @@ -1999,13 +1999,13 @@ nge_ioctl(ifp, command, data) case SIOCSIFFLAGS: NGE_LOCK(sc); if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->nge_if_flags & IFF_PROMISC)) { NGE_SETBIT(sc, NGE_RXFILT_CTL, NGE_RXFILTCTL_ALLPHYS| NGE_RXFILTCTL_ALLMULTI); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->nge_if_flags & IFF_PROMISC) { NGE_CLRBIT(sc, NGE_RXFILT_CTL, @@ -2014,11 +2014,11 @@ nge_ioctl(ifp, command, data) NGE_CLRBIT(sc, NGE_RXFILT_CTL, NGE_RXFILTCTL_ALLMULTI); } else { - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; nge_init_locked(sc); } } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) nge_stop(sc); } sc->nge_if_flags = ifp->if_flags; @@ -2069,7 +2069,7 @@ nge_watchdog(ifp) NGE_LOCK(sc); nge_stop(sc); nge_reset(sc); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; nge_init_locked(sc); if (ifp->if_snd.ifq_head != NULL) @@ -2142,7 +2142,7 @@ nge_stop(sc) bzero((char *)&sc->nge_ldata->nge_tx_list, sizeof(sc->nge_ldata->nge_tx_list)); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); return; } diff --git a/sys/dev/nve/if_nve.c b/sys/dev/nve/if_nve.c index d0f287261fa4..a04d8fce1db6 100644 --- a/sys/dev/nve/if_nve.c +++ b/sys/dev/nve/if_nve.c @@ -621,7 +621,7 @@ nve_init(void *xsc) ifp = sc->ifp; /* Do nothing if already running */ - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) goto fail; nve_stop(sc); @@ -650,8 +650,8 @@ nve_init(void *xsc) nve_ifmedia_upd(ifp); /* Update interface parameters */ - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->stat_ch = timeout(nve_tick, sc, hz); @@ -692,7 +692,7 @@ nve_stop(struct nve_softc *sc) sc->cur_rx = 0; sc->pending_rxs = 0; - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); DEBUGOUT(NVE_DEBUG_RUNNING, "nve: nve_stop - exit\n"); @@ -840,7 +840,7 @@ nve_ifstart(struct ifnet *ifp) DEBUGOUT(NVE_DEBUG_RUNNING, "nve: nve_ifstart - entry\n"); /* If link is down/busy or queue is empty do nothing */ - if (ifp->if_flags & IFF_OACTIVE || ifp->if_snd.ifq_head == NULL) + if (ifp->if_drv_flags & IFF_DRV_OACTIVE || ifp->if_snd.ifq_head == NULL) return; /* Transmit queued packets until sent or TX ring is full */ @@ -915,7 +915,7 @@ nve_ifstart(struct ifnet *ifp) /* The API TX queue is full - requeue the packet */ device_printf(sc->dev, "nve_ifstart: transmit queue is full\n"); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; bus_dmamap_unload(sc->mtag, buf->map); IF_PREPEND(&ifp->if_snd, buf->mbuf); buf->mbuf = NULL; @@ -936,7 +936,7 @@ nve_ifstart(struct ifnet *ifp) /* Copy packet to BPF tap */ BPF_MTAP(ifp, m0); } - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; DEBUGOUT(NVE_DEBUG_RUNNING, "nve: nve_ifstart - exit\n"); } @@ -970,12 +970,12 @@ nve_ioctl(struct ifnet *ifp, u_long command, caddr_t data) case SIOCSIFFLAGS: /* Setup interface flags */ if (ifp->if_flags & IFF_UP) { - if ((ifp->if_flags & IFF_RUNNING) == 0) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { nve_init(sc); break; } } else { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { nve_stop(sc); break; } @@ -987,7 +987,7 @@ nve_ioctl(struct ifnet *ifp, u_long command, caddr_t data) case SIOCADDMULTI: case SIOCDELMULTI: /* Setup multicast filter */ - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { nve_setmulti(sc); } break; @@ -1249,7 +1249,7 @@ nve_watchdog(struct ifnet *ifp) sc->tx_errors++; nve_stop(sc); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; nve_init(sc); if (ifp->if_snd.ifq_head != NULL) @@ -1490,7 +1490,7 @@ nve_ospackettx(PNV_VOID ctx, PNV_VOID id, NV_UINT32 success) /* Send more packets if we have them */ if (sc->pending_txs < TX_RING_SIZE) - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (ifp->if_snd.ifq_head != NULL && sc->pending_txs < TX_RING_SIZE) nve_ifstart(ifp); diff --git a/sys/dev/owi/if_owi.c b/sys/dev/owi/if_owi.c index a0d8bc0c0df7..b0f546968348 100644 --- a/sys/dev/owi/if_owi.c +++ b/sys/dev/owi/if_owi.c @@ -669,7 +669,7 @@ wi_txeof(sc, status) ifp = sc->ifp; ifp->if_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (status & WI_EV_TX_EXC) ifp->if_oerrors++; @@ -693,7 +693,7 @@ wi_inquire(xsc) sc->wi_stat_ch = timeout(wi_inquire, sc, hz * 60); /* Don't do this while we're transmitting */ - if (ifp->if_flags & IFF_OACTIVE) + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; WI_LOCK(sc, s); @@ -1358,7 +1358,7 @@ wi_ioctl(ifp, command, data) * wi_init() by just setting PROMISC in the hardware. */ if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { if (ifp->if_flags & IFF_PROMISC && !(sc->wi_if_flags & IFF_PROMISC)) { WI_SETVAL(WI_RID_PROMISC, 1); @@ -1372,7 +1372,7 @@ wi_ioctl(ifp, command, data) wi_init(sc); } } else { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { owi_stop(sc); } } @@ -1704,7 +1704,7 @@ wi_init(xsc) return; } - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) owi_stop(sc); wi_reset(sc); @@ -1792,8 +1792,8 @@ wi_init(xsc) /* enable interrupts */ CSR_WRITE_2(sc, WI_INT_EN, WI_INTRS); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->wi_stat_ch = timeout(wi_inquire, sc, hz * 60); WI_UNLOCK(sc, s); @@ -1820,7 +1820,7 @@ wi_start(ifp) return; } - if (ifp->if_flags & IFF_OACTIVE) { + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { WI_UNLOCK(sc, s); return; } @@ -1888,7 +1888,7 @@ wi_start(ifp) if (wi_cmd(sc, WI_CMD_TX|WI_RECLAIM, id, 0, 0)) device_printf(sc->dev, "xmit failed\n"); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; /* * Set a timeout in case the chip goes out to lunch. @@ -1927,7 +1927,7 @@ owi_stop(sc) wi_cmd(sc, WI_CMD_DISABLE|sc->wi_portnum, 0, 0, 0); } - ifp->if_flags &= ~(IFF_RUNNING|IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING|IFF_DRV_OACTIVE); WI_UNLOCK(sc, s); return; diff --git a/sys/dev/patm/if_patm.c b/sys/dev/patm/if_patm.c index 0c8cf4623199..279afde1d440 100644 --- a/sys/dev/patm/if_patm.c +++ b/sys/dev/patm/if_patm.c @@ -204,7 +204,7 @@ patm_initialize(struct patm_softc *sc) patm_debug(sc, ATTACH, "go..."); sc->utopia.flags &= ~UTP_FL_POLL_CARRIER; - sc->ifp->if_flags |= IFF_RUNNING; + sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; /* enable interrupts, Tx and Rx paths */ cfg |= IDT_CFG_RXPTH | IDT_CFG_RXIIMM | IDT_CFG_RAWIE | IDT_CFG_RQFIE | @@ -245,7 +245,7 @@ patm_stop(struct patm_softc *sc) struct patm_txmap *map; struct patm_scd *scd; - sc->ifp->if_flags &= ~IFF_RUNNING; + sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sc->utopia.flags |= UTP_FL_POLL_CARRIER; patm_reset(sc); @@ -265,7 +265,7 @@ patm_stop(struct patm_softc *sc) /* * Give any waiters on closing a VCC a chance. They will stop - * to wait if they see that IFF_RUNNING disappeared. + * to wait if they see that IFF_DRV_RUNNING disappeared. */ cv_broadcast(&sc->vcc_cv); diff --git a/sys/dev/patm/if_patm_intr.c b/sys/dev/patm/if_patm_intr.c index b19dfc0c1cec..9f44d583d5b7 100644 --- a/sys/dev/patm/if_patm_intr.c +++ b/sys/dev/patm/if_patm_intr.c @@ -119,7 +119,7 @@ patm_intr(void *p) stat = patm_nor_read(sc, IDT_NOR_STAT); patm_nor_write(sc, IDT_NOR_STAT, stat & (ints | fbqa)); - if (!(sc->ifp->if_flags & IFF_RUNNING)) { + if (!(sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) { /* if we are stopped ack all interrupts and handle PHYI */ if (stat & IDT_STAT_PHYI) { patm_debug(sc, INTR, "PHYI (stopped)"); diff --git a/sys/dev/patm/if_patm_ioctl.c b/sys/dev/patm/if_patm_ioctl.c index 651bed60461b..2ed466d81f2b 100644 --- a/sys/dev/patm/if_patm_ioctl.c +++ b/sys/dev/patm/if_patm_ioctl.c @@ -107,7 +107,7 @@ patm_open_vcc(struct patm_softc *sc, struct atmio_openvcc *arg) return (ENOMEM); mtx_lock(&sc->mtx); - if (!(sc->ifp->if_flags & IFF_RUNNING)) { + if (!(sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) { /* stopped while we have analyzed the arguments */ error = EIO; goto done; @@ -224,7 +224,7 @@ patm_close_vcc(struct patm_softc *sc, struct atmio_closevcc *arg) cid = PATM_CID(sc, arg->vpi, arg->vci); mtx_lock(&sc->mtx); - if (!(sc->ifp->if_flags & IFF_RUNNING)) { + if (!(sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) { /* stopped while we have analyzed the arguments */ error = EIO; goto done; @@ -246,7 +246,7 @@ patm_close_vcc(struct patm_softc *sc, struct atmio_closevcc *arg) while (vcc->vflags & (PATM_VCC_TX_CLOSING | PATM_VCC_RX_CLOSING)) { cv_wait(&sc->vcc_cv, &sc->mtx); - if (!(sc->ifp->if_flags & IFF_RUNNING)) { + if (!(sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) { /* ups, has been stopped */ error = EIO; goto done; @@ -299,7 +299,7 @@ patm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCSIFADDR: mtx_lock(&sc->mtx); ifp->if_flags |= IFF_UP; - if (!(ifp->if_flags & IFF_RUNNING)) + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) patm_initialize(sc); switch (ifa->ifa_addr->sa_family) { @@ -318,11 +318,11 @@ patm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCSIFFLAGS: mtx_lock(&sc->mtx); if (ifp->if_flags & IFF_UP) { - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { patm_initialize(sc); } } else { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { patm_stop(sc); } } @@ -339,7 +339,7 @@ patm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) * null cells of it gets the timing wrong. */ mtx_lock(&sc->mtx); - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { if (sc->utopia.state & UTP_ST_UNASS) { if (!(sc->flags & PATM_UNASS)) { cfg = patm_nor_read(sc, IDT_NOR_CFG); diff --git a/sys/dev/patm/if_patm_tx.c b/sys/dev/patm/if_patm_tx.c index 887e2d591612..cb40aa530fc5 100644 --- a/sys/dev/patm/if_patm_tx.c +++ b/sys/dev/patm/if_patm_tx.c @@ -289,7 +289,7 @@ patm_start(struct ifnet *ifp) struct patm_vcc *vcc; mtx_lock(&sc->mtx); - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { mtx_unlock(&sc->mtx); return; } diff --git a/sys/dev/pdq/pdq_ifsubr.c b/sys/dev/pdq/pdq_ifsubr.c index 7fb420b4af11..409779a7df5d 100644 --- a/sys/dev/pdq/pdq_ifsubr.c +++ b/sys/dev/pdq/pdq_ifsubr.c @@ -74,7 +74,7 @@ pdq_ifinit( pdq_softc_t *sc) { if (PDQ_IFNET(sc)->if_flags & IFF_UP) { - PDQ_IFNET(sc)->if_flags |= IFF_RUNNING; + PDQ_IFNET(sc)->if_drv_flags |= IFF_DRV_RUNNING; if (PDQ_IFNET(sc)->if_flags & IFF_PROMISC) { sc->sc_pdq->pdq_flags |= PDQ_PROMISC; } else { @@ -88,7 +88,7 @@ pdq_ifinit( sc->sc_pdq->pdq_flags |= PDQ_RUNNING; pdq_run(sc->sc_pdq); } else { - PDQ_IFNET(sc)->if_flags &= ~IFF_RUNNING; + PDQ_IFNET(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; sc->sc_pdq->pdq_flags &= ~PDQ_RUNNING; pdq_stop(sc->sc_pdq); } @@ -103,7 +103,7 @@ pdq_ifwatchdog( * seconds. Remove all queued packets. */ - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_timer = 0; for (;;) { struct mbuf *m; @@ -122,14 +122,14 @@ pdq_ifstart( struct mbuf *m; int tx = 0; - if ((ifp->if_flags & IFF_RUNNING) == 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; if (PDQ_IFNET(sc)->if_timer == 0) PDQ_IFNET(sc)->if_timer = PDQ_OS_TX_TIMEOUT; if ((sc->sc_pdq->pdq_flags & PDQ_TXOK) == 0) { - PDQ_IFNET(sc)->if_flags |= IFF_OACTIVE; + PDQ_IFNET(sc)->if_drv_flags |= IFF_DRV_OACTIVE; return; } sc->sc_flags |= PDQIF_DOWNCALL; @@ -170,7 +170,7 @@ pdq_ifstart( break; } if (m != NULL) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; IF_PREPEND(&ifp->if_snd, m); } if (tx) @@ -226,7 +226,7 @@ pdq_os_restart_transmitter( pdq_t *pdq) { pdq_softc_t *sc = pdq->pdq_os_ctx; - PDQ_IFNET(sc)->if_flags &= ~IFF_OACTIVE; + PDQ_IFNET(sc)->if_drv_flags &= ~IFF_DRV_OACTIVE; if (IFQ_IS_EMPTY(&PDQ_IFNET(sc)->if_snd) == 0) { PDQ_IFNET(sc)->if_timer = PDQ_OS_TX_TIMEOUT; if ((sc->sc_flags & PDQIF_DOWNCALL) == 0) @@ -379,7 +379,7 @@ pdq_ifioctl( case SIOCADDMULTI: case SIOCDELMULTI: { - if (PDQ_IFNET(sc)->if_flags & IFF_RUNNING) { + if (PDQ_IFNET(sc)->if_drv_flags & IFF_DRV_RUNNING) { pdq_run(sc->sc_pdq); error = 0; } diff --git a/sys/dev/ppbus/if_plip.c b/sys/dev/ppbus/if_plip.c index 59bb5d6e0bee..8a35336ea99b 100644 --- a/sys/dev/ppbus/if_plip.c +++ b/sys/dev/ppbus/if_plip.c @@ -321,16 +321,18 @@ lpioctl (struct ifnet *ifp, u_long cmd, caddr_t data) ifp->if_flags |= IFF_UP; /* FALLTHROUGH */ case SIOCSIFFLAGS: - if ((!(ifp->if_flags & IFF_UP)) && (ifp->if_flags & IFF_RUNNING)) { + if ((!(ifp->if_flags & IFF_UP)) && + (ifp->if_drv_flags & IFF_DRV_RUNNING)) { ppb_wctr(ppbus, 0x00); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; /* IFF_UP is not set, try to release the bus anyway */ ppb_release_bus(ppbus, dev); break; } - if (((ifp->if_flags & IFF_UP)) && (!(ifp->if_flags & IFF_RUNNING))) { + if (((ifp->if_flags & IFF_UP)) && + (!(ifp->if_drv_flags & IFF_DRV_RUNNING))) { /* XXX * Should the request be interruptible? @@ -362,7 +364,7 @@ lpioctl (struct ifnet *ifp, u_long cmd, caddr_t data) } ppb_wctr(ppbus, IRQENABLE); - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; } break; @@ -577,7 +579,7 @@ lp_intr (void *arg) if (sc->sc_iferrs > LPMAXERRS) { printf("lp%d: Too many errors, Going off-line.\n", device_get_unit(dev)); ppb_wctr(ppbus, 0x00); - sc->sc_ifp->if_flags &= ~IFF_RUNNING; + sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sc->sc_iferrs=0; } @@ -615,7 +617,7 @@ lpoutput (struct ifnet *ifp, struct mbuf *m, /* We need a sensible value if we abort */ cp++; - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; err = 1; /* assume we're aborting because of an error */ diff --git a/sys/dev/ral/if_ral.c b/sys/dev/ral/if_ral.c index 429233ab7ef2..716bde490f93 100644 --- a/sys/dev/ral/if_ral.c +++ b/sys/dev/ral/if_ral.c @@ -915,7 +915,8 @@ ral_media_change(struct ifnet *ifp) if (error != ENETRESET) return error; - if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == (IFF_UP | IFF_RUNNING)) + if ((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING)) ral_init(sc); return 0; @@ -1220,7 +1221,7 @@ ral_tx_intr(struct ral_softc *sc) BUS_DMASYNC_PREWRITE); sc->sc_tx_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ral_start(ifp); } @@ -1286,7 +1287,7 @@ ral_prio_intr(struct ral_softc *sc) BUS_DMASYNC_PREWRITE); sc->sc_tx_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ral_start(ifp); } @@ -2058,7 +2059,7 @@ ral_start(struct ifnet *ifp) IF_POLL(&ic->ic_mgtq, m0); if (m0 != NULL) { if (sc->prioq.queued >= RAL_PRIO_RING_COUNT) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } IF_DEQUEUE(&ic->ic_mgtq, m0); @@ -2080,7 +2081,7 @@ ral_start(struct ifnet *ifp) break; if (sc->txq.queued >= RAL_TX_RING_COUNT - 1) { IFQ_DRV_PREPEND(&ifp->if_snd, m0); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } @@ -2176,12 +2177,12 @@ ral_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) switch (cmd) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) ral_update_promisc(sc); else ral_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) ral_stop(sc); } break; @@ -2191,8 +2192,8 @@ ral_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } if (error == ENETRESET) { - if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == - (IFF_UP | IFF_RUNNING)) + if ((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING)) ral_init(sc); error = 0; } @@ -2761,8 +2762,8 @@ ral_init(void *priv) /* enable interrupts */ RAL_WRITE(sc, RAL_CSR8, RAL_INTR_MASK); - ifp->if_flags &= ~IFF_OACTIVE; - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; if (ic->ic_opmode == IEEE80211_M_MONITOR) ieee80211_new_state(ic, IEEE80211_S_RUN, -1); @@ -2782,7 +2783,7 @@ ral_stop(void *priv) sc->sc_tx_timer = 0; ifp->if_timer = 0; - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); /* abort Tx */ RAL_WRITE(sc, RAL_TXCSR0, RAL_ABORT_TX); diff --git a/sys/dev/ral/if_ral_pci.c b/sys/dev/ral/if_ral_pci.c index 3c1b7b185ec9..362f92db5614 100644 --- a/sys/dev/ral/if_ral_pci.c +++ b/sys/dev/ral/if_ral_pci.c @@ -160,7 +160,7 @@ ral_pci_resume(device_t dev) if (ifp->if_flags & IFF_UP) { ifp->if_init(ifp->if_softc); - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) ifp->if_start(ifp); } diff --git a/sys/dev/ray/if_ray.c b/sys/dev/ray/if_ray.c index 463a9824c276..9ea6680289ad 100644 --- a/sys/dev/ray/if_ray.c +++ b/sys/dev/ray/if_ray.c @@ -602,7 +602,7 @@ ray_detach(device_t dev) */ sc->sc_gone = 1; sc->sc_c.np_havenet = 0; - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); ether_ifdetach(ifp); if_free(ifp); @@ -769,7 +769,7 @@ ray_init(void *xsc) * Returns values are either 0 for success, a varity of resource allocation * failures or errors in the command sent to the card. * - * Note, IFF_RUNNING is eventually set by init_sj_done or init_assoc_done + * Note, IFF_DRV_RUNNING is eventually set by init_sj_done or init_assoc_done */ static int ray_init_user(struct ray_softc *sc) @@ -792,7 +792,7 @@ ray_init_user(struct ray_softc *sc) * We may enter this routine from a simple change of IP * address and do not need to get the card to do these things. * However, we cannot perform the check here as there may be - * commands in the runq that change the IFF_RUNNING state of + * commands in the runq that change the IFF_DRV_RUNNING state of * the interface. */ ncom = 0; @@ -1156,15 +1156,15 @@ ray_init_sj_done(struct ray_softc *sc, u_int8_t status, size_t ccs) /* * Hurrah! The network is now active. * - * Clearing IFF_OACTIVE will ensure that the system will send us + * Clearing IFF_DRV_OACTIVE will ensure that the system will send us * packets. Just before we return from the interrupt context * we check to see if packets have been queued. */ if (SRAM_READ_FIELD_1(sc, ccs, ray_cmd, c_cmd) == RAY_CMD_START_NET) { sc->sc_c.np_havenet = 1; sc->sc_c.np_framing = sc->sc_d.np_framing; - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } ray_com_ecf_done(sc); @@ -1313,14 +1313,14 @@ ray_init_assoc_done(struct ray_softc *sc, u_int8_t status, size_t ccs) /* * Hurrah! The network is now active. * - * Clearing IFF_OACTIVE will ensure that the system will send us + * Clearing IFF_DRV_OACTIVE will ensure that the system will send us * packets. Just before we return from the interrupt context * we check to see if packets have been queued. */ sc->sc_c.np_havenet = 1; sc->sc_c.np_framing = sc->sc_d.np_framing; - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ray_com_ecf_done(sc); } @@ -1371,7 +1371,7 @@ ray_stop(struct ray_softc *sc, struct ray_comq_entry *com) /* * Mark as not running and drain output queue */ - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); ifp->if_timer = 0; for (;;) { IF_DEQUEUE(&ifp->if_snd, m); @@ -1408,7 +1408,7 @@ ray_watchdog(struct ifnet *ifp) * 1) That the current priority is set to splimp _before_ this code * is called *and* is returned to the appropriate priority after * return - * 2) That the IFF_OACTIVE flag is checked before this code is called + * 2) That the IFF_DRV_OACTIVE flag is checked before this code is called * (i.e. that the output part of the interface is idle) * * A simple one packet at a time TX routine is used - we don't bother @@ -1447,7 +1447,7 @@ ray_tx(struct ifnet *ifp) */ if ((sc == NULL) || (sc->sc_gone)) return; - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { RAY_RECERR(sc, "cannot transmit - not running"); return; } @@ -1473,7 +1473,7 @@ ray_tx(struct ifnet *ifp) * errors and the packet wouldn't get through anyway. */ if (ray_ccs_tx(sc, &ccs, &bufp)) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; return; } @@ -1628,7 +1628,7 @@ ray_tx_timo(void *xsc) RAY_DPRINTF(sc, RAY_DBG_SUBR, ""); - if (!(ifp->if_flags & IFF_OACTIVE) && (ifp->if_snd.ifq_head != NULL)) { + if (!(ifp->if_drv_flags & IFF_DRV_OACTIVE) && (ifp->if_snd.ifq_head != NULL)) { s = splimp(); ray_tx(ifp); splx(s); @@ -1746,8 +1746,8 @@ ray_tx_done(struct ray_softc *sc, u_int8_t status, size_t ccs) RAY_CCS_FREE(sc, ccs); ifp->if_timer = 0; - if (ifp->if_flags & IFF_OACTIVE) - ifp->if_flags &= ~IFF_OACTIVE; + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } /* @@ -2490,7 +2490,7 @@ ray_intr(void *xsc) } /* Send any packets lying around and update error counters */ - if (!(ifp->if_flags & IFF_OACTIVE) && (ifp->if_snd.ifq_head != NULL)) + if (!(ifp->if_drv_flags & IFF_DRV_OACTIVE) && (ifp->if_snd.ifq_head != NULL)) ray_tx(ifp); if ((++sc->sc_checkcounters % 32) == 0) ray_intr_updt_errcntrs(sc); @@ -2694,7 +2694,7 @@ ray_mcast(struct ray_softc *sc, struct ray_comq_entry *com) /* * If card is not running we don't need to update this. */ - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { RAY_DPRINTF(sc, RAY_DBG_IOCTL, "not running"); ray_com_runq_done(sc); return; @@ -2770,7 +2770,7 @@ ray_promisc(struct ray_softc *sc, struct ray_comq_entry *com) * we don't need to update this */ sc->sc_d.np_promisc = !!(ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)); - if (!(ifp->if_flags & IFF_RUNNING) || + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING) || (sc->sc_c.np_promisc == sc->sc_d.np_promisc)) { ray_com_runq_done(sc); return; @@ -3317,7 +3317,7 @@ ray_com_runq_done(struct ray_softc *sc) /* XXX what about error on completion then? deal with when i fix * XXX the status checking * - * XXX all the runq_done calls from IFF_RUNNING checks in runq + * XXX all the runq_done calls from IFF_DRV_RUNNING checks in runq * XXX routines should return EIO but shouldn't abort the runq */ } diff --git a/sys/dev/ray/if_rayvar.h b/sys/dev/ray/if_rayvar.h index b2eb2b887a67..7376405bb19a 100644 --- a/sys/dev/ray/if_rayvar.h +++ b/sys/dev/ray/if_rayvar.h @@ -191,7 +191,7 @@ static int mib_info[RAY_MIB_MAX+1][3] = RAY_MIB_INFO; #define RAY_COM_FRUNNING 0x0002 /* This one running */ #define RAY_COM_FCOMPLETED 0x0004 /* This one completed */ #define RAY_COM_FWAIT 0x0008 /* Do not run the queue */ -#define RAY_COM_FCHKRUNNING 0x0010 /* Check IFF_RUNNING */ +#define RAY_COM_FCHKRUNNING 0x0010 /* Check IFF_DRV_RUNNING*/ #define RAY_COM_FDETACHED 0x0020 /* Card is gone */ #define RAY_COM_FWOKEN 0x0040 /* Woken by detach */ #define RAY_COM_FLAGS_PRINTFB \ @@ -272,13 +272,13 @@ static int mib_info[RAY_MIB_MAX+1][3] = RAY_MIB_INFO; * of a change to the cards operating parameters (e.g. BSSID change), and * b) those that happen as a result of a change to the interface parameters * (e.g. a change to the IP address). The second set of entries need not - * send a command to the card when the card is IFF_RUNNING. The + * send a command to the card when the card is IFF_DRV_RUNNING. The * RAY_COM_FCHKRUNNING flags indicates when the RUNNING flag should be * checked, and this macro does the necessary check and command abort. */ #define RAY_COM_CHKRUNNING(sc, com, ifp) do { \ if (((com)->c_flags & RAY_COM_FCHKRUNNING) && \ - ((ifp)->if_flags & IFF_RUNNING)) { \ + ((ifp)->if_drv_flags & IFF_DRV_RUNNING)) { \ ray_com_runq_done(sc); \ return; \ } } while (0) diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index 40799c503387..ca6bb1b29c4d 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -1731,7 +1731,7 @@ re_txeof(sc) if (idx != sc->rl_ldata.rl_tx_considx) { sc->rl_ldata.rl_tx_considx = idx; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_timer = 0; } @@ -2039,7 +2039,7 @@ re_start_locked(ifp) if (re_encap(sc, &m_head, &idx)) { IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } @@ -2257,8 +2257,8 @@ re_init_locked(sc) CSR_WRITE_1(sc, RL_CFG1, RL_CFG1_DRVLOAD|RL_CFG1_FULLDUPLEX); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->rl_stat_ch = timeout(re_tick, sc, hz); } @@ -2320,7 +2320,7 @@ re_ioctl(ifp, command, data) RL_LOCK(sc); if (ifp->if_flags & IFF_UP) re_init_locked(sc); - else if (ifp->if_flags & IFF_RUNNING) + else if (ifp->if_drv_flags & IFF_DRV_RUNNING) re_stop(sc); RL_UNLOCK(sc); error = 0; @@ -2345,7 +2345,7 @@ re_ioctl(ifp, command, data) ifp->if_hwassist = RE_CSUM_FEATURES; else ifp->if_hwassist = 0; - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) re_init(sc); break; default: @@ -2391,7 +2391,7 @@ re_stop(sc) ifp->if_timer = 0; untimeout(re_tick, sc, sc->rl_stat_ch); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); #ifdef DEVICE_POLLING ether_poll_deregister(ifp); #endif /* DEVICE_POLLING */ diff --git a/sys/dev/sbni/if_sbni.c b/sys/dev/sbni/if_sbni.c index 8c4008406900..580d37aff64e 100644 --- a/sys/dev/sbni/if_sbni.c +++ b/sys/dev/sbni/if_sbni.c @@ -271,7 +271,7 @@ sbni_init(void *xsc) * kludge to avoid multiple initialization when more than once * protocols configured */ - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) return; s = splimp(); @@ -279,8 +279,8 @@ sbni_init(void *xsc) card_start(sc); sc->wch = timeout(sbni_timeout, sc, hz/SBNI_HZ); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* attempt to start output */ sbni_start(ifp); @@ -669,7 +669,7 @@ prepare_to_send(struct sbni_softc *sc) sc->pktlen = 0; sc->tx_frameno = 0; sc->framelen = 0; - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; return; } @@ -689,7 +689,7 @@ prepare_to_send(struct sbni_softc *sc) sc->framelen = min(len, sc->maxframe); sbni_outb(sc, CSR0, sbni_inb(sc, CSR0) | TR_REQ); - sc->ifp->if_flags |= IFF_OACTIVE; + sc->ifp->if_drv_flags |= IFF_DRV_OACTIVE; BPF_MTAP(sc->ifp, sc->tx_buf_p); } @@ -717,7 +717,7 @@ drop_xmit_queue(struct sbni_softc *sc) sc->framelen = 0; sc->outpos = 0; sc->state &= ~(FL_WAIT_ACK | FL_NEED_RESEND); - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } @@ -1062,12 +1062,12 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t data) * If it is marked down and running, then stop it. */ if (ifp->if_flags & IFF_UP) { - if (!(ifp->if_flags & IFF_RUNNING)) + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) sbni_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { sbni_stop(sc); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; } } break; diff --git a/sys/dev/sbsh/if_sbsh.c b/sys/dev/sbsh/if_sbsh.c index 7242386bb542..03cff465cb41 100644 --- a/sys/dev/sbsh/if_sbsh.c +++ b/sys/dev/sbsh/if_sbsh.c @@ -345,7 +345,7 @@ sbsh_init(void *xsc) int s; u_int8_t t; - if ((ifp->if_flags & IFF_RUNNING) || sc->state == NOT_LOADED) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) || sc->state == NOT_LOADED) return; s = splimp(); @@ -360,8 +360,8 @@ sbsh_init(void *xsc) if (issue_cx28975_cmd(sc, _DSL_ACTIVATION, &t, 1) == 0) { sc->state = ACTIVATION; - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } splx(s); @@ -488,7 +488,7 @@ sbsh_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { if (sc->state == NOT_LOADED) { if_printf(ifp, "firmware wasn't loaded\n"); error = EBUSY; @@ -496,9 +496,9 @@ sbsh_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) sbsh_init(sc); } } else { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { sbsh_stop(sc); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; } } break; @@ -658,9 +658,9 @@ start_xmit_frames(struct sbsh_softc *sc) } if (sc->regs->CTDR != sc->regs->LTDR) - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; else - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } diff --git a/sys/dev/sf/if_sf.c b/sys/dev/sf/if_sf.c index 5485fb7e6cfe..e166b9391a28 100644 --- a/sys/dev/sf/if_sf.c +++ b/sys/dev/sf/if_sf.c @@ -512,18 +512,18 @@ sf_ioctl(ifp, command, data) switch(command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->sf_if_flags & IFF_PROMISC)) { SF_SETBIT(sc, SF_RXFILT, SF_RXFILT_PROMISC); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->sf_if_flags & IFF_PROMISC) { SF_CLRBIT(sc, SF_RXFILT, SF_RXFILT_PROMISC); - } else if (!(ifp->if_flags & IFF_RUNNING)) + } else if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) sf_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) sf_stop(sc); } sc->sf_if_flags = ifp->if_flags; @@ -1013,7 +1013,7 @@ sf_txeof(sc) } ifp->if_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; csr_write_4(sc, SF_CQ_CONSIDX, (txcons & ~SF_CQ_CONSIDX_TXQ) | @@ -1286,8 +1286,8 @@ sf_init(xsc) /*mii_mediachg(mii);*/ sf_ifmedia_upd(ifp); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->sf_stat_ch = timeout(sf_stats_update, sc, hz); @@ -1375,7 +1375,7 @@ sf_start(ifp) return; } - if (ifp->if_flags & IFF_OACTIVE) { + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { SF_UNLOCK(sc); return; } @@ -1392,7 +1392,7 @@ sf_start(ifp) while(sc->sf_ldata->sf_tx_dlist[i].sf_mbuf == NULL) { if (sc->sf_tx_cnt >= (SF_TX_DLIST_CNT - 5)) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; cur_tx = NULL; break; } @@ -1403,7 +1403,7 @@ sf_start(ifp) cur_tx = &sc->sf_ldata->sf_tx_dlist[i]; if (sf_encap(sc, cur_tx, m_head)) { IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; cur_tx = NULL; break; } @@ -1482,7 +1482,7 @@ sf_stop(sc) } } - ifp->if_flags &= ~(IFF_RUNNING|IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING|IFF_DRV_OACTIVE); SF_UNLOCK(sc); } diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c index 0daf42e543f4..65b3a5f90aa4 100644 --- a/sys/dev/sk/if_sk.c +++ b/sys/dev/sk/if_sk.c @@ -1244,14 +1244,14 @@ sk_ioctl(ifp, command, data) error = EINVAL; else { ifp->if_mtu = ifr->ifr_mtu; - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sk_init(sc_if); } break; case SIOCSIFFLAGS: SK_IF_LOCK(sc_if); if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { if ((ifp->if_flags ^ sc_if->sk_if_flags) & IFF_PROMISC) { sk_setpromisc(sc_if); @@ -1260,7 +1260,7 @@ sk_ioctl(ifp, command, data) } else sk_init(sc_if); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) sk_stop(sc_if); } sc_if->sk_if_flags = ifp->if_flags; @@ -1269,7 +1269,7 @@ sk_ioctl(ifp, command, data) break; case SIOCADDMULTI: case SIOCDELMULTI: - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { SK_IF_LOCK(sc_if); sk_setmulti(sc_if); SK_IF_UNLOCK(sc_if); @@ -2052,7 +2052,7 @@ sk_start(ifp) */ if (sk_encap(sc_if, m_head, &idx)) { IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } @@ -2086,7 +2086,7 @@ sk_watchdog(ifp) sc_if = ifp->if_softc; printf("sk%d: watchdog timeout\n", sc_if->sk_unit); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sk_init(sc_if); return; @@ -2221,7 +2221,7 @@ sk_txeof(sc_if) CSR_WRITE_4(sc, sc_if->sk_tx_bmu, SK_TXBMU_TX_START); if (sc_if->sk_cdata.sk_tx_cnt < SK_TX_RING_CNT - 2) - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc_if->sk_cdata.sk_tx_cons = idx; } @@ -2297,7 +2297,7 @@ sk_intr_bcom(sc_if) */ status = sk_xmac_miibus_readreg(sc_if, SK_PHYADDR_BCOM, BRGPHY_MII_ISR); - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { sk_init_xmac(sc_if); return; } @@ -2429,14 +2429,16 @@ sk_intr(xsc) } /* Then MAC interrupts. */ - if (status & SK_ISR_MAC1 && ifp0->if_flags & IFF_RUNNING) { + if (status & SK_ISR_MAC1 && + ifp0->if_drv_flags & IFF_DRV_RUNNING) { if (sc->sk_type == SK_GENESIS) sk_intr_xmac(sc_if0); else sk_intr_yukon(sc_if0); } - if (status & SK_ISR_MAC2 && ifp1->if_flags & IFF_RUNNING) { + if (status & SK_ISR_MAC2 && + ifp1->if_drv_flags & IFF_DRV_RUNNING) { if (sc->sk_type == SK_GENESIS) sk_intr_xmac(sc_if1); else @@ -2760,7 +2762,7 @@ sk_init(xsc) sc = sc_if->sk_softc; mii = device_get_softc(sc_if->sk_miibus); - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { SK_IF_UNLOCK(sc_if); return; } @@ -2889,8 +2891,8 @@ sk_init(xsc) SK_YU_WRITE_2(sc_if, YUKON_GPCR, reg); } - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; SK_IF_UNLOCK(sc_if); @@ -2975,7 +2977,7 @@ sk_stop(sc_if) } } - ifp->if_flags &= ~(IFF_RUNNING|IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING|IFF_DRV_OACTIVE); SK_IF_UNLOCK(sc_if); return; } diff --git a/sys/dev/sn/if_sn.c b/sys/dev/sn/if_sn.c index ddfc09990c56..6524eb0593ed 100644 --- a/sys/dev/sn/if_sn.c +++ b/sys/dev/sn/if_sn.c @@ -231,7 +231,7 @@ sn_detach(device_t dev) struct ifnet *ifp = sc->ifp; snstop(sc); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ether_ifdetach(ifp); if_free(ifp); sn_deactivate(dev); @@ -337,8 +337,8 @@ sninit_locked(void *xsc) /* * Mark the interface running but not active. */ - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* * Attempt to push out any waiting packets. @@ -373,7 +373,7 @@ snstart_locked(struct ifnet *ifp) SN_ASSERT_LOCKED(sc); - if (sc->ifp->if_flags & IFF_OACTIVE) + if (sc->ifp->if_drv_flags & IFF_DRV_OACTIVE) return; if (sc->pages_wanted != -1) { if_printf(ifp, "snstart() while memory allocation pending\n"); @@ -461,7 +461,7 @@ startagain: sc->intr_mask = mask; sc->ifp->if_timer = 1; - sc->ifp->if_flags |= IFF_OACTIVE; + sc->ifp->if_drv_flags |= IFF_DRV_OACTIVE; sc->pages_wanted = numPages; return; } @@ -544,7 +544,7 @@ startagain: CSR_WRITE_2(sc, MMU_CMD_REG_W, MMUCR_ENQUEUE); - sc->ifp->if_flags |= IFF_OACTIVE; + sc->ifp->if_drv_flags |= IFF_DRV_OACTIVE; sc->ifp->if_timer = 1; BPF_MTAP(ifp, top); @@ -751,14 +751,14 @@ try_start: /* * Now pass control to snstart() to queue any additional packets */ - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; snstart(ifp); /* * We've sent something, so we're active. Set a watchdog in case the * TX_EMPTY interrupt is lost. */ - sc->ifp->if_flags |= IFF_OACTIVE; + sc->ifp->if_drv_flags |= IFF_DRV_OACTIVE; sc->ifp->if_timer = 1; return; @@ -845,7 +845,7 @@ sn_intr(void *arg) * Disable this interrupt. */ mask &= ~IM_ALLOC_INT; - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; snresume(sc->ifp); } /* @@ -912,7 +912,7 @@ sn_intr(void *arg) /* * Attempt to queue more transmits. */ - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; snstart_locked(sc->ifp); } /* @@ -950,7 +950,7 @@ sn_intr(void *arg) /* * Attempt to enqueue some more stuff. */ - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; snstart_locked(sc->ifp); } /* @@ -1131,8 +1131,9 @@ snioctl(struct ifnet *ifp, u_long cmd, caddr_t data) switch (cmd) { case SIOCSIFFLAGS: SN_LOCK(sc); - if ((ifp->if_flags & IFF_UP) == 0 && ifp->if_flags & IFF_RUNNING) { - ifp->if_flags &= ~IFF_RUNNING; + if ((ifp->if_flags & IFF_UP) == 0 && + ifp->if_drv_flags & IFF_DRV_RUNNING) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; snstop(sc); } else { /* reinitialize card on any parameter change */ diff --git a/sys/dev/snc/dp83932.c b/sys/dev/snc/dp83932.c index b85170c43450..bbc1e97380fd 100644 --- a/sys/dev/snc/dp83932.c +++ b/sys/dev/snc/dp83932.c @@ -266,16 +266,16 @@ sncioctl(ifp, cmd, data) case SIOCSIFFLAGS: if ((ifp->if_flags & IFF_UP) == 0 && - (ifp->if_flags & IFF_RUNNING) != 0) { + (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { /* * If interface is marked down and it is running, * then stop it. */ sncstop(sc); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; snc_disable(sc); } else if ((ifp->if_flags & IFF_UP) != 0 && - (ifp->if_flags & IFF_RUNNING) == 0) { + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { /* * If interface is marked up and it is stopped, * then start it. @@ -330,7 +330,8 @@ sncstart(ifp) struct mbuf *m; int mtd_next; - if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING) + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) return; outloop: @@ -339,7 +340,7 @@ outloop: mtd_next = 0; if (mtd_next == sc->mtd_hw) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; return; } @@ -399,7 +400,7 @@ sncinit(xsc) u_long s_rcr; int s; - if (sc->sc_ifp->if_flags & IFF_RUNNING) + if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) /* already running */ return; @@ -451,8 +452,8 @@ sncinit(xsc) wbflush(); /* flag interface as "running" */ - sc->sc_ifp->if_flags |= IFF_RUNNING; - sc->sc_ifp->if_flags &= ~IFF_OACTIVE; + sc->sc_ifp->if_drv_flags |= IFF_DRV_RUNNING; + sc->sc_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; splx(s); return; @@ -485,7 +486,8 @@ sncstop(sc) } sc->sc_ifp->if_timer = 0; - sc->sc_ifp->if_flags &= ~(IFF_RUNNING | IFF_UP); + sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + sc->sc_ifp->if_flags &= ~IFF_UP; splx(s); return (0); @@ -939,7 +941,7 @@ sonictxint(sc) } #endif /* SNCDEBUG */ - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (mtd->mtd_mbuf != 0) { m_freem(mtd->mtd_mbuf); diff --git a/sys/dev/snc/if_snc_pccard.c b/sys/dev/snc/if_snc_pccard.c index a8150803b7cf..64e2faf782c0 100644 --- a/sys/dev/snc/if_snc_pccard.c +++ b/sys/dev/snc/if_snc_pccard.c @@ -95,7 +95,7 @@ snc_pccard_detach(device_t dev) return (0); } sncshutdown(sc); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; if_detach(ifp); sc->gone = 1; bus_teardown_intr(dev, sc->irq, sc->irq_handle); diff --git a/sys/dev/sr/if_sr.c b/sys/dev/sr/if_sr.c index bd9138263eff..0260b1255aa4 100644 --- a/sys/dev/sr/if_sr.c +++ b/sys/dev/sr/if_sr.c @@ -744,7 +744,7 @@ sr_xmit(struct sr_softc *sc) * This function only place the data in the oncard buffers. It does not * start the transmition. sr_xmit() does that. * - * Transmitter idle state is indicated by the IFF_OACTIVE flag. + * Transmitter idle state is indicated by the IFF_DRV_OACTIVE flag. * The function that clears that should ensure that the transmitter * and its DMA is in a "good" idle state. */ @@ -773,7 +773,7 @@ srstart(struct sr_softc *sc) printf("sr: srstart( ifp=%08x)\n", ifp); #endif sc = ifp->if_softc; - if ((ifp->if_flags & IFF_RUNNING) == 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; #endif /* NETGRAPH */ hc = sc->hc; @@ -799,9 +799,9 @@ top_srstart: */ if (sc->txb_inuse == SR_TX_BLOCKS) { /* out of space? */ #ifndef NETGRAPH - ifp->if_flags |= IFF_OACTIVE; /* yes, mark active */ + ifp->if_drv_flags |= IFF_DRV_OACTIVE; /* yes, mark active */ #else - /*ifp->if_flags |= IFF_OACTIVE;*/ /* yes, mark active */ + /*ifp->if_drv_flags |= IFF_DRV_OACTIVE;*/ /* yes, mark active */ #endif /* NETGRAPH */ if (hc->mempages) @@ -1009,7 +1009,7 @@ srioctl(struct ifnet *ifp, u_long cmd, caddr_t data) ifp, cmd, data); #endif - was_up = ifp->if_flags & IFF_RUNNING; + was_up = ifp->if_drv_flags & IFF_DRV_RUNNING; error = sppp_ioctl(ifp, cmd, data); @@ -1048,7 +1048,7 @@ srioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } s = splimp(); - should_be_up = ifp->if_flags & IFF_RUNNING; + should_be_up = ifp->if_drv_flags & IFF_DRV_RUNNING; if (!was_up && should_be_up) { /* @@ -1101,7 +1101,7 @@ srwatchdog(struct sr_softc *sc) #endif #ifndef NETGRAPH - if (!(ifp->if_flags & IFF_RUNNING)) + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) return; ifp->if_oerrors++; /* update output error count */ @@ -1133,9 +1133,9 @@ srwatchdog(struct sr_softc *sc) } sc->xmit_busy = 0; #ifndef NETGRAPH - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; #else - /*ifp->if_flags &= ~IFF_OACTIVE; */ + /*ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; */ #endif /* NETGRAPH */ if (sc->txb_inuse && --sc->txb_inuse) @@ -2281,7 +2281,7 @@ sr_dmac_intr(struct sr_hardc *hc, u_char isr1) /* * This should be the most common case. * - * Clear the IFF_OACTIVE flag. + * Clear the IFF_DRV_OACTIVE flag. * * Call srstart to start a new transmit if * there is data to transmit. @@ -2291,7 +2291,7 @@ sr_dmac_intr(struct sr_hardc *hc, u_char isr1) #endif sc->xmit_busy = 0; #ifndef NETGRAPH - SC2IFP(sc)->if_flags &= ~IFF_OACTIVE; + SC2IFP(sc)->if_drv_flags &= ~IFF_DRV_OACTIVE; SC2IFP(sc)->if_timer = 0; #else /* XXX may need to mark tx inactive? */ diff --git a/sys/dev/ti/if_ti.c b/sys/dev/ti/if_ti.c index 5ce58c555a78..bef01aecf63c 100644 --- a/sys/dev/ti/if_ti.c +++ b/sys/dev/ti/if_ti.c @@ -2594,7 +2594,7 @@ ti_txeof(sc) } if (cur_tx != NULL) - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } static void @@ -2620,7 +2620,7 @@ ti_intr(xsc) /* Ack interrupt and stop others from occuring. */ CSR_WRITE_4(sc, TI_MB_HOSTINTR, 1); - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* Check RX return ring producer/consumer */ ti_rxeof(sc); @@ -2633,7 +2633,8 @@ ti_intr(xsc) /* Re-enable interrupts. */ CSR_WRITE_4(sc, TI_MB_HOSTINTR, 0); - if (ifp->if_flags & IFF_RUNNING && ifp->if_snd.ifq_head != NULL) + if (ifp->if_drv_flags & IFF_DRV_RUNNING && + ifp->if_snd.ifq_head != NULL) ti_start(ifp); TI_UNLOCK(sc); @@ -2789,7 +2790,7 @@ ti_start(ifp) if ((TI_TX_RING_CNT - sc->ti_txcnt) < m_head->m_pkthdr.csum_data + 16) { IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } } @@ -2801,7 +2802,7 @@ ti_start(ifp) */ if (ti_encap(sc, m_head, &prodidx)) { IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } @@ -2909,8 +2910,8 @@ static void ti_init2(sc) /* Enable host interrupts. */ CSR_WRITE_4(sc, TI_MB_HOSTINTR, 0); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* * Make sure to set media properly. We have to do this @@ -3110,12 +3111,12 @@ ti_ioctl(ifp, command, data) * waiting for it to start up, which may take a * second or two. */ - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->ti_if_flags & IFF_PROMISC)) { TI_DO_CMD(TI_CMD_SET_PROMISC_MODE, TI_CMD_CODE_PROMISC_ENB, 0); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->ti_if_flags & IFF_PROMISC) { TI_DO_CMD(TI_CMD_SET_PROMISC_MODE, @@ -3123,7 +3124,7 @@ ti_ioctl(ifp, command, data) } else ti_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { ti_stop(sc); } } @@ -3132,7 +3133,7 @@ ti_ioctl(ifp, command, data) break; case SIOCADDMULTI: case SIOCDELMULTI: - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { ti_setmulti(sc); error = 0; } @@ -3148,7 +3149,7 @@ ti_ioctl(ifp, command, data) ifp->if_capenable &= ~IFCAP_HWCSUM; else ifp->if_capenable |= IFCAP_HWCSUM; - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) ti_init(sc); } error = 0; @@ -3529,7 +3530,7 @@ ti_stop(sc) sc->ti_tx_considx.ti_idx = 0; sc->ti_tx_saved_considx = TI_TXCONS_UNSET; - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); TI_UNLOCK(sc); } diff --git a/sys/dev/tx/if_tx.c b/sys/dev/tx/if_tx.c index 16a386c64b4a..34b26ec89c38 100644 --- a/sys/dev/tx/if_tx.c +++ b/sys/dev/tx/if_tx.c @@ -567,12 +567,12 @@ epic_ifioctl(ifp, command, data) * If it is marked down and running, then stop it. */ if (ifp->if_flags & IFF_UP) { - if ((ifp->if_flags & IFF_RUNNING) == 0) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { epic_init(sc); break; } } else { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { epic_stop(sc); break; } @@ -719,7 +719,7 @@ epic_ifstart(ifp) BPF_MTAP(ifp, m0); } - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; } /* @@ -852,7 +852,7 @@ epic_tx_done(sc) } if (sc->pending_txs < TX_RING_SIZE) - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; bus_dmamap_sync(sc->ttag, sc->tmap, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); } @@ -1267,7 +1267,7 @@ epic_init(xsc) s = splimp(); /* If interface is already running, then we need not do anything. */ - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { splx(s); return; } @@ -1323,12 +1323,12 @@ epic_init(xsc) /* Mark interface running ... */ if (ifp->if_flags & IFF_UP) - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; else - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; /* ... and free */ - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* Start Rx process */ epic_start_activity(sc); @@ -1590,7 +1590,7 @@ epic_stop(sc) CSR_WRITE_4(sc, GENCTL, GENCTL_POWER_DOWN); /* Mark as stoped */ - sc->ifp->if_flags &= ~IFF_RUNNING; + sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; splx(s); } diff --git a/sys/dev/txp/if_txp.c b/sys/dev/txp/if_txp.c index 5ca11b3923d7..4205a9b844e0 100644 --- a/sys/dev/txp/if_txp.c +++ b/sys/dev/txp/if_txp.c @@ -811,7 +811,7 @@ txp_rxbuf_reclaim(sc) struct txp_swdesc *sd; u_int32_t i; - if (!(ifp->if_flags & IFF_RUNNING)) + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) return; i = sc->sc_rxbufprod; @@ -884,7 +884,7 @@ txp_tx_reclaim(sc, r) ifp->if_opackets++; } } - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (++cons == TX_ENTRIES) { txd = r->r_desc; @@ -1078,7 +1078,7 @@ txp_ioctl(ifp, command, data) if (ifp->if_flags & IFF_UP) { txp_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) txp_stop(sc); } break; @@ -1178,7 +1178,7 @@ txp_init(xsc) sc = xsc; ifp = sc->sc_ifp; - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) return; txp_stop(sc); @@ -1212,8 +1212,8 @@ txp_init(xsc) TXP_INT_PCI_TABORT | TXP_INT_PCI_MABORT | TXP_INT_LATCH); WRITE_REG(sc, TXP_IMR, TXP_INT_A2H_3); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_timer = 0; sc->sc_tick = timeout(txp_tick, sc, hz); @@ -1276,7 +1276,8 @@ txp_start(ifp) u_int32_t firstprod, firstcnt, prod, cnt; struct m_tag *mtag; - if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING) + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) return; prod = r->r_prod; @@ -1362,7 +1363,7 @@ txp_start(ifp) return; oactive: - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; r->r_prod = firstprod; r->r_cnt = firstcnt; IF_PREPEND(&ifp->if_snd, m); @@ -1580,7 +1581,7 @@ txp_stop(sc) ifp = sc->sc_ifp; - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); untimeout(txp_tick, sc, sc->sc_tick); diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c index af5fe5f46f32..5112d7b4e6a2 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -818,7 +818,7 @@ aue_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) AUE_LOCK(sc); ifp = sc->aue_ifp; - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { AUE_UNLOCK(sc); return; } @@ -897,7 +897,7 @@ aue_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) AUE_LOCK(sc); ifp = sc->aue_ifp; - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { AUE_UNLOCK(sc); return; } @@ -986,7 +986,7 @@ aue_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) } ifp->if_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; usbd_get_xfer_status(c->ue_xfer, NULL, NULL, NULL, &err); if (c->ue_mbuf != NULL) { @@ -1095,7 +1095,7 @@ aue_start(struct ifnet *ifp) return; } - if (ifp->if_flags & IFF_OACTIVE) { + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { AUE_UNLOCK(sc); return; } @@ -1108,7 +1108,7 @@ aue_start(struct ifnet *ifp) if (aue_encap(sc, m_head, 0)) { IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; AUE_UNLOCK(sc); return; } @@ -1119,7 +1119,7 @@ aue_start(struct ifnet *ifp) */ BPF_MTAP(ifp, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; /* * Set a timeout in case the chip goes out to lunch. @@ -1142,7 +1142,7 @@ aue_init(void *xsc) AUE_LOCK(sc); - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { AUE_UNLOCK(sc); return; } @@ -1232,8 +1232,8 @@ aue_init(void *xsc) usbd_transfer(c->ue_xfer); } - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->aue_stat_ch = timeout(aue_tick, sc, hz); @@ -1291,18 +1291,18 @@ aue_ioctl(struct ifnet *ifp, u_long command, caddr_t data) switch(command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->aue_if_flags & IFF_PROMISC)) { AUE_SETBIT(sc, AUE_CTL2, AUE_CTL2_RX_PROMISC); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->aue_if_flags & IFF_PROMISC) { AUE_CLRBIT(sc, AUE_CTL2, AUE_CTL2_RX_PROMISC); - } else if (!(ifp->if_flags & IFF_RUNNING)) + } else if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) aue_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) aue_stop(sc); } sc->aue_if_flags = ifp->if_flags; @@ -1426,7 +1426,7 @@ aue_stop(struct aue_softc *sc) sc->aue_link = 0; - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); AUE_UNLOCK(sc); return; diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c index c5493900d83a..349c917069bd 100644 --- a/sys/dev/usb/if_axe.c +++ b/sys/dev/usb/if_axe.c @@ -612,7 +612,7 @@ axe_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) AXE_LOCK(sc); ifp = sc->axe_ifp; - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { AXE_UNLOCK(sc); return; } @@ -691,7 +691,7 @@ axe_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) } ifp->if_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; usbd_get_xfer_status(c->ue_xfer, NULL, NULL, NULL, &err); if (c->ue_mbuf != NULL) { @@ -791,7 +791,7 @@ axe_start(struct ifnet *ifp) return; } - if (ifp->if_flags & IFF_OACTIVE) { + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { AXE_UNLOCK(sc); return; } @@ -804,7 +804,7 @@ axe_start(struct ifnet *ifp) if (axe_encap(sc, m_head, 0)) { IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; AXE_UNLOCK(sc); return; } @@ -815,7 +815,7 @@ axe_start(struct ifnet *ifp) */ BPF_MTAP(ifp, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; /* * Set a timeout in case the chip goes out to lunch. @@ -836,7 +836,7 @@ axe_init(void *xsc) int i; int rxmode; - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) return; AXE_LOCK(sc); @@ -918,8 +918,8 @@ axe_init(void *xsc) usbd_transfer(c->ue_xfer); } - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; AXE_UNLOCK(sc); @@ -940,7 +940,7 @@ axe_ioctl(struct ifnet *ifp, u_long command, caddr_t data) switch(command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->axe_if_flags & IFF_PROMISC)) { AXE_LOCK(sc); @@ -951,7 +951,7 @@ axe_ioctl(struct ifnet *ifp, u_long command, caddr_t data) 0, rxmode, NULL); AXE_UNLOCK(sc); axe_setmulti(sc); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->axe_if_flags & IFF_PROMISC) { AXE_LOCK(sc); @@ -962,10 +962,10 @@ axe_ioctl(struct ifnet *ifp, u_long command, caddr_t data) 0, rxmode, NULL); AXE_UNLOCK(sc); axe_setmulti(sc); - } else if (!(ifp->if_flags & IFF_RUNNING)) + } else if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) axe_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) axe_stop(sc); } sc->axe_if_flags = ifp->if_flags; @@ -1084,7 +1084,7 @@ axe_stop(struct axe_softc *sc) /* Free TX resources. */ usb_ether_tx_list_free(&sc->axe_cdata); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); sc->axe_link = 0; AXE_UNLOCK(sc); diff --git a/sys/dev/usb/if_cdce.c b/sys/dev/usb/if_cdce.c index fabbbbeabdc2..b44b2991e6d3 100644 --- a/sys/dev/usb/if_cdce.c +++ b/sys/dev/usb/if_cdce.c @@ -322,7 +322,7 @@ USB_DETACH(cdce) CDCE_LOCK(sc); sc->cdce_dying = 1; ifp = GET_IFP(sc); - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) cdce_shutdown(sc->cdce_dev); ether_ifdetach(ifp); @@ -344,8 +344,8 @@ cdce_start(struct ifnet *ifp) if (sc->cdce_dying || - ifp->if_flags & IFF_OACTIVE || - !(ifp->if_flags & IFF_RUNNING)) { + ifp->if_drv_flags & IFF_DRV_OACTIVE || + !(ifp->if_drv_flags & IFF_DRV_RUNNING)) { CDCE_UNLOCK(sc); return; } @@ -358,14 +358,14 @@ cdce_start(struct ifnet *ifp) if (cdce_encap(sc, m_head, 0)) { IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; CDCE_UNLOCK(sc); return; } BPF_MTAP(ifp, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; CDCE_UNLOCK(sc); @@ -445,7 +445,7 @@ cdce_stop(struct cdce_softc *sc) usb_ether_rx_list_free(&sc->cdce_cdata); usb_ether_tx_list_free(&sc->cdce_cdata); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); CDCE_UNLOCK(sc); return; @@ -474,10 +474,10 @@ cdce_ioctl(struct ifnet *ifp, u_long command, caddr_t data) switch(command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (!(ifp->if_flags & IFF_RUNNING)) + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) cdce_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) cdce_stop(sc); } error = 0; @@ -507,7 +507,7 @@ cdce_init(void *xsc) usbd_status err; int i; - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) return; CDCE_LOCK(sc); @@ -555,8 +555,8 @@ cdce_init(void *xsc) usbd_transfer(c->ue_xfer); } - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; CDCE_UNLOCK(sc); @@ -575,7 +575,7 @@ cdce_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) CDCE_LOCK(sc); ifp = GET_IFP(sc); - if (sc->cdce_dying || !(ifp->if_flags & IFF_RUNNING)) { + if (sc->cdce_dying || !(ifp->if_drv_flags & IFF_DRV_RUNNING)) { CDCE_UNLOCK(sc); return; } @@ -643,7 +643,7 @@ cdce_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) ifp = GET_IFP(sc); if (sc->cdce_dying || - !(ifp->if_flags & IFF_RUNNING)) { + !(ifp->if_drv_flags & IFF_DRV_RUNNING)) { CDCE_UNLOCK(sc); return; } @@ -662,7 +662,7 @@ cdce_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) return; } - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; usbd_get_xfer_status(c->ue_xfer, NULL, NULL, NULL, &err); if (c->ue_mbuf != NULL) { @@ -690,7 +690,7 @@ cdce_rxstart(struct ifnet *ifp) sc = ifp->if_softc; CDCE_LOCK(sc); - if (sc->cdce_dying || !(ifp->if_flags & IFF_RUNNING)) { + if (sc->cdce_dying || !(ifp->if_drv_flags & IFF_DRV_RUNNING)) { CDCE_UNLOCK(sc); return; } diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c index ae219579a72c..e5970513dac8 100644 --- a/sys/dev/usb/if_cue.c +++ b/sys/dev/usb/if_cue.c @@ -620,7 +620,7 @@ cue_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) CUE_LOCK(sc); ifp = sc->cue_ifp; - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { CUE_UNLOCK(sc); return; } @@ -704,7 +704,7 @@ cue_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) } ifp->if_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; usbd_get_xfer_status(c->ue_xfer, NULL, NULL, NULL, &err); if (c->ue_mbuf != NULL) { @@ -798,7 +798,7 @@ cue_start(struct ifnet *ifp) sc = ifp->if_softc; CUE_LOCK(sc); - if (ifp->if_flags & IFF_OACTIVE) { + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { CUE_UNLOCK(sc); return; } @@ -811,7 +811,7 @@ cue_start(struct ifnet *ifp) if (cue_encap(sc, m_head, 0)) { IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; CUE_UNLOCK(sc); return; } @@ -822,7 +822,7 @@ cue_start(struct ifnet *ifp) */ BPF_MTAP(ifp, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; /* * Set a timeout in case the chip goes out to lunch. @@ -842,7 +842,7 @@ cue_init(void *xsc) usbd_status err; int i; - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) return; CUE_LOCK(sc); @@ -928,8 +928,8 @@ cue_init(void *xsc) usbd_transfer(c->ue_xfer); } - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; CUE_UNLOCK(sc); @@ -949,20 +949,20 @@ cue_ioctl(struct ifnet *ifp, u_long command, caddr_t data) switch(command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->cue_if_flags & IFF_PROMISC)) { CUE_SETBIT(sc, CUE_ETHCTL, CUE_ETHCTL_PROMISC); cue_setmulti(sc); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->cue_if_flags & IFF_PROMISC) { CUE_CLRBIT(sc, CUE_ETHCTL, CUE_ETHCTL_PROMISC); cue_setmulti(sc); - } else if (!(ifp->if_flags & IFF_RUNNING)) + } else if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) cue_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) cue_stop(sc); } sc->cue_if_flags = ifp->if_flags; @@ -1074,7 +1074,7 @@ cue_stop(struct cue_softc *sc) /* Free TX resources. */ usb_ether_tx_list_free(&sc->cue_cdata); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); CUE_UNLOCK(sc); return; diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c index fce9adf95aad..f8c9d9548525 100644 --- a/sys/dev/usb/if_kue.c +++ b/sys/dev/usb/if_kue.c @@ -598,7 +598,7 @@ Static void kue_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, KUE_LOCK(sc); ifp = sc->kue_ifp; - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { KUE_UNLOCK(sc); return; } @@ -672,7 +672,7 @@ kue_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) ifp = sc->kue_ifp; ifp->if_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (status != USBD_NORMAL_COMPLETION) { if (status == USBD_NOT_STARTED || status == USBD_CANCELLED) { @@ -752,7 +752,7 @@ kue_start(struct ifnet *ifp) sc = ifp->if_softc; KUE_LOCK(sc); - if (ifp->if_flags & IFF_OACTIVE) { + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { KUE_UNLOCK(sc); return; } @@ -765,7 +765,7 @@ kue_start(struct ifnet *ifp) if (kue_encap(sc, m_head, 0)) { IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; KUE_UNLOCK(sc); return; } @@ -776,7 +776,7 @@ kue_start(struct ifnet *ifp) */ BPF_MTAP(ifp, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; /* * Set a timeout in case the chip goes out to lunch. @@ -798,7 +798,7 @@ kue_init(void *xsc) KUE_LOCK(sc); - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { KUE_UNLOCK(sc); return; } @@ -872,8 +872,8 @@ kue_init(void *xsc) usbd_transfer(c->ue_xfer); } - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; KUE_UNLOCK(sc); @@ -891,22 +891,22 @@ kue_ioctl(struct ifnet *ifp, u_long command, caddr_t data) switch(command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->kue_if_flags & IFF_PROMISC)) { sc->kue_rxfilt |= KUE_RXFILT_PROMISC; kue_setword(sc, KUE_CMD_SET_PKT_FILTER, sc->kue_rxfilt); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->kue_if_flags & IFF_PROMISC) { sc->kue_rxfilt &= ~KUE_RXFILT_PROMISC; kue_setword(sc, KUE_CMD_SET_PKT_FILTER, sc->kue_rxfilt); - } else if (!(ifp->if_flags & IFF_RUNNING)) + } else if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) kue_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) kue_stop(sc); } sc->kue_if_flags = ifp->if_flags; @@ -1012,7 +1012,7 @@ kue_stop(struct kue_softc *sc) /* Free TX resources. */ usb_ether_tx_list_free(&sc->kue_cdata); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); KUE_UNLOCK(sc); return; diff --git a/sys/dev/usb/if_rue.c b/sys/dev/usb/if_rue.c index e544e11f94ec..ff6551ab3519 100644 --- a/sys/dev/usb/if_rue.c +++ b/sys/dev/usb/if_rue.c @@ -766,7 +766,7 @@ rue_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) RUE_LOCK(sc); ifp = sc->rue_ifp; - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { RUE_UNLOCK(sc); return; } @@ -842,7 +842,7 @@ rue_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) RUE_LOCK(sc); ifp = sc->rue_ifp; - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { RUE_UNLOCK(sc); return; } @@ -929,7 +929,7 @@ rue_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) } ifp->if_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; usbd_get_xfer_status(c->ue_xfer, NULL, NULL, NULL, &err); if (c->ue_mbuf != NULL) { @@ -1032,7 +1032,7 @@ rue_start(struct ifnet *ifp) return; } - if (ifp->if_flags & IFF_OACTIVE) { + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { RUE_UNLOCK(sc); return; } @@ -1045,7 +1045,7 @@ rue_start(struct ifnet *ifp) if (rue_encap(sc, m_head, 0)) { IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; RUE_UNLOCK(sc); return; } @@ -1056,7 +1056,7 @@ rue_start(struct ifnet *ifp) */ BPF_MTAP(ifp, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; /* * Set a timeout in case the chip goes out to lunch. @@ -1079,7 +1079,7 @@ rue_init(void *xsc) RUE_LOCK(sc); - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { RUE_UNLOCK(sc); return; } @@ -1183,8 +1183,8 @@ rue_init(void *xsc) usbd_transfer(c->ue_xfer); } - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->rue_stat_ch = timeout(rue_tick, sc, hz); @@ -1240,22 +1240,22 @@ rue_ioctl(struct ifnet *ifp, u_long command, caddr_t data) switch (command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->rue_if_flags & IFF_PROMISC)) { RUE_SETBIT_2(sc, RUE_RCR, (RUE_RCR_AAM | RUE_RCR_AAP)); rue_setmulti(sc); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->rue_if_flags & IFF_PROMISC) { RUE_CLRBIT_2(sc, RUE_RCR, (RUE_RCR_AAM | RUE_RCR_AAP)); rue_setmulti(sc); - } else if (!(ifp->if_flags & IFF_RUNNING)) + } else if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) rue_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) rue_stop(sc); } sc->rue_if_flags = ifp->if_flags; @@ -1381,7 +1381,7 @@ rue_stop(struct rue_softc *sc) sc->rue_link = 0; - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); RUE_UNLOCK(sc); } diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c index 19f64cb9211a..690c9ded613a 100644 --- a/sys/dev/usb/if_udav.c +++ b/sys/dev/usb/if_udav.c @@ -519,7 +519,11 @@ USB_DETACH(udav) /* Wait for processes to go away */ usb_detach_wait(USBDEV(sc->sc_dev)); } +#if defined(__FreeBSD__) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) +#else if (ifp->if_flags & IFF_RUNNING) +#endif udav_stop(GET_IFP(sc), 1); #if NRND > 0 @@ -913,8 +917,13 @@ udav_init(void *xsc) } } +#if defined(__FreeBSD__) + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; +#else ifp->if_flags |= IFF_RUNNING; ifp->if_flags &= ~IFF_OACTIVE; +#endif #if defined(__NetBSD__) splx(s); @@ -1151,7 +1160,11 @@ udav_start(struct ifnet *ifp) if (!sc->sc_link) return; +#if defined(__FreeBSD__) + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) +#else if (ifp->if_flags & IFF_OACTIVE) +#endif return; #if defined(__NetBSD__) IFQ_POLL(&ifp->if_snd, m_head); @@ -1164,8 +1177,10 @@ udav_start(struct ifnet *ifp) if (udav_send(sc, m_head, 0)) { #if defined(__FreeBSD__) IF_PREPEND(&ifp->if_snd, m_head); -#endif + ifp->if_drv_flags |= IFF_DRV_OACTIVE; +#else ifp->if_flags |= IFF_OACTIVE; +#endif return; } @@ -1177,7 +1192,11 @@ udav_start(struct ifnet *ifp) BPF_MTAP(ifp, m_head); #endif +#if defined(__FreeBSD__) + ifp->if_drv_flags |= IFF_DRV_OACTIVE; +#else ifp->if_flags |= IFF_OACTIVE; +#endif /* Set a timeout in case the chip goes out to lunch. */ ifp->if_timer = 5; @@ -1257,7 +1276,11 @@ udav_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) DPRINTF(("%s: %s: enter\n", USBDEVNAME(sc->sc_dev), __func__)); ifp->if_timer = 0; +#if defined(__FreeBSD__) + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; +#else ifp->if_flags &= ~IFF_OACTIVE; +#endif if (status != USBD_NORMAL_COMPLETION) { if (status == USBD_NOT_STARTED || status == USBD_CANCELLED) { @@ -1458,11 +1481,11 @@ udav_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) #if defined(__FreeBSD__) case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC) { UDAV_SETBIT(sc, UDAV_RCR, UDAV_RCR_ALL|UDAV_RCR_PRMSC); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC)) { if (ifp->if_flags & IFF_ALLMULTI) UDAV_CLRBIT(sc, UDAV_RCR, @@ -1470,10 +1493,10 @@ udav_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) else UDAV_CLRBIT(sc, UDAV_RCR, UDAV_RCR_ALL|UDAV_RCR_PRMSC); - } else if (!(ifp->if_flags & IFF_RUNNING)) + } else if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) udav_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) udav_stop(ifp, 1); } error = 0; @@ -1617,7 +1640,11 @@ udav_stop(struct ifnet *ifp, int disable) usb_ether_tx_list_free(&sc->sc_cdata); sc->sc_link = 0; +#if defined(__FreeBSD__) + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); +#else ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); +#endif } /* Set media options */ @@ -1655,7 +1682,11 @@ udav_ifmedia_status(struct ifnet *ifp, struct ifmediareq *ifmr) if (sc->sc_dying) return; +#if defined(__FreeBSD__) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { +#else if ((ifp->if_flags & IFF_RUNNING) == 0) { +#endif ifmr->ifm_active = IFM_ETHER | IFM_NONE; ifmr->ifm_status = 0; return; diff --git a/sys/dev/usb/if_ural.c b/sys/dev/usb/if_ural.c index 239dc22ec1c9..00836523592d 100644 --- a/sys/dev/usb/if_ural.c +++ b/sys/dev/usb/if_ural.c @@ -677,7 +677,8 @@ ural_media_change(struct ifnet *ifp) return error; } - if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == (IFF_UP | IFF_RUNNING)) + if ((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING)) ural_init(sc); RAL_UNLOCK(sc); @@ -820,7 +821,7 @@ ural_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) DPRINTFN(10, ("tx done\n")); sc->sc_tx_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ural_start(ifp); } @@ -1275,7 +1276,7 @@ ural_start(struct ifnet *ifp) IF_POLL(&ic->ic_mgtq, m0); if (m0 != NULL) { if (sc->tx_queued >= RAL_TX_LIST_COUNT) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } IF_DEQUEUE(&ic->ic_mgtq, m0); @@ -1297,7 +1298,7 @@ ural_start(struct ifnet *ifp) break; if (sc->tx_queued >= RAL_TX_LIST_COUNT) { IFQ_DRV_PREPEND(&ifp->if_snd, m0); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } @@ -1391,12 +1392,12 @@ ural_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) switch (cmd) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) ural_update_promisc(sc); else ural_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) ural_stop(sc); } break; @@ -1406,8 +1407,8 @@ ural_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } if (error == ENETRESET) { - if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == - (IFF_UP | IFF_RUNNING)) + if ((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING)) ural_init(sc); error = 0; } @@ -2033,8 +2034,8 @@ ural_init(void *priv) } ural_write(sc, RAL_TXRX_CSR2, tmp); - ifp->if_flags &= ~IFF_OACTIVE; - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; if (ic->ic_opmode == IEEE80211_M_MONITOR) ieee80211_new_state(ic, IEEE80211_S_RUN, -1); @@ -2058,7 +2059,7 @@ ural_stop(void *priv) sc->sc_tx_timer = 0; ifp->if_timer = 0; - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); /* disable Rx */ ural_write(sc, RAL_TXRX_CSR2, RAL_DISABLE_RX); diff --git a/sys/dev/vge/if_vge.c b/sys/dev/vge/if_vge.c index e1ebaaa36a1b..c269c0f38a68 100644 --- a/sys/dev/vge/if_vge.c +++ b/sys/dev/vge/if_vge.c @@ -1551,7 +1551,7 @@ vge_txeof(sc) if (idx != sc->vge_ldata.vge_tx_considx) { sc->vge_ldata.vge_tx_considx = idx; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_timer = 0; } @@ -1866,7 +1866,7 @@ vge_start(ifp) sc = ifp->if_softc; VGE_LOCK(sc); - if (!sc->vge_link || ifp->if_flags & IFF_OACTIVE) { + if (!sc->vge_link || ifp->if_drv_flags & IFF_DRV_OACTIVE) { VGE_UNLOCK(sc); return; } @@ -1902,7 +1902,7 @@ vge_start(ifp) #else IF_PREPEND(&ifp->if_snd, m_head); #endif - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } @@ -2119,8 +2119,8 @@ vge_init(xsc) mii_mediachg(mii); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->vge_if_flags = 0; sc->vge_link = 0; @@ -2237,13 +2237,13 @@ vge_ioctl(ifp, command, data) break; case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->vge_if_flags & IFF_PROMISC)) { CSR_SETBIT_1(sc, VGE_RXCTL, VGE_RXCTL_RX_PROMISC); vge_setmulti(sc); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->vge_if_flags & IFF_PROMISC) { CSR_CLRBIT_1(sc, VGE_RXCTL, @@ -2252,7 +2252,7 @@ vge_ioctl(ifp, command, data) } else vge_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) vge_stop(sc); } sc->vge_if_flags = ifp->if_flags; @@ -2282,7 +2282,7 @@ vge_ioctl(ifp, command, data) ifp->if_hwassist = VGE_CSUM_FEATURES; else ifp->if_hwassist = 0; - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) vge_init(sc); break; default: @@ -2329,7 +2329,7 @@ vge_stop(sc) ifp = sc->vge_ifp; ifp->if_timer = 0; - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); #ifdef DEVICE_POLLING ether_poll_deregister(ifp); #endif /* DEVICE_POLLING */ diff --git a/sys/dev/vr/if_vr.c b/sys/dev/vr/if_vr.c index 654de6f2235c..340aac71fde5 100644 --- a/sys/dev/vr/if_vr.c +++ b/sys/dev/vr/if_vr.c @@ -1109,7 +1109,7 @@ vr_txeof(struct vr_softc *sc) ifp->if_opackets++; m_freem(cur_tx->vr_mbuf); cur_tx->vr_mbuf = NULL; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; cur_tx = cur_tx->vr_nextdesc; } @@ -1400,7 +1400,7 @@ vr_start_locked(struct ifnet *ifp) struct mbuf *m_head; struct vr_chain *cur_tx; - if (ifp->if_flags & IFF_OACTIVE) + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; cur_tx = sc->vr_cdata.vr_tx_prod; @@ -1436,7 +1436,7 @@ vr_start_locked(struct ifnet *ifp) ifp->if_timer = 5; if (cur_tx->vr_mbuf != NULL) - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; } } @@ -1545,8 +1545,8 @@ vr_init_locked(struct vr_softc *sc) mii_mediachg(mii); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->vr_stat_ch = timeout(vr_tick, sc, hz); } @@ -1596,7 +1596,7 @@ vr_ioctl(struct ifnet *ifp, u_long command, caddr_t data) if (ifp->if_flags & IFF_UP) { vr_init_locked(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) vr_stop(sc); } VR_UNLOCK(sc); @@ -1661,7 +1661,7 @@ vr_stop(struct vr_softc *sc) ifp->if_timer = 0; untimeout(vr_tick, sc, sc->vr_stat_ch); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); #ifdef DEVICE_POLLING ether_poll_deregister(ifp); #endif /* DEVICE_POLLING */ diff --git a/sys/dev/vx/if_vx.c b/sys/dev/vx/if_vx.c index 98aa192c1b82..142f17410657 100644 --- a/sys/dev/vx/if_vx.c +++ b/sys/dev/vx/if_vx.c @@ -245,8 +245,8 @@ vxinit(void *xsc) vxmbuffill((caddr_t) sc); /* Interface is now `running', with no output active. */ - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* Attempt to start output, if any. */ vxstart(ifp); @@ -405,8 +405,8 @@ vxstart(struct ifnet *ifp) int sh, len, pad; /* Don't transmit if interface is busy or not running */ - if ((sc->ifp->if_flags & - (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING) + if ((sc->ifp->if_drv_flags & + (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) return; startagain: @@ -439,7 +439,7 @@ startagain: SET_TX_AVAIL_THRESH | ((len + pad + 4) >> 2)); /* not enough room in FIFO - make sure */ if (CSR_READ_2(sc, VX_W1_FREE_TX) < len + pad + 4) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; ifp->if_timer = 1; return; } @@ -585,7 +585,7 @@ vxtxstat(struct vx_softc *sc) } else if (i & TXS_MAX_COLLISION) { ++sc->ifp->if_collisions; CSR_WRITE_2(sc, VX_COMMAND, TX_ENABLE); - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } else sc->tx_succ_ok = (sc->tx_succ_ok + 1) & 127; } @@ -619,7 +619,7 @@ vxintr(void *voidsc) vxread(sc); if (status & S_TX_AVAIL) { ifp->if_timer = 0; - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; vxstart(sc->ifp); } if (status & S_CARD_FAILURE) { @@ -854,15 +854,15 @@ vxioctl(register struct ifnet *ifp, u_long cmd, caddr_t data) switch (cmd) { case SIOCSIFFLAGS: if ((ifp->if_flags & IFF_UP) == 0 && - (ifp->if_flags & IFF_RUNNING) != 0) { + (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { /* * If interface is marked up and it is stopped, then * start it. */ vxstop(sc); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; } else if ((ifp->if_flags & IFF_UP) != 0 && - (ifp->if_flags & IFF_RUNNING) == 0) { + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { /* * If interface is marked up and it is stopped, then * start it. @@ -930,7 +930,7 @@ vxwatchdog(struct ifnet *ifp) if (ifp->if_flags & IFF_DEBUG) if_printf(ifp, "device timeout\n"); - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; vxstart(ifp); vxintr(sc); } diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c index bb545e618118..4de137ce52fd 100644 --- a/sys/dev/wi/if_wi.c +++ b/sys/dev/wi/if_wi.c @@ -629,7 +629,7 @@ wi_intr(void *arg) wi_tx_ex_intr(sc); if (status & WI_EV_INFO) wi_info_intr(sc); - if ((ifp->if_flags & IFF_OACTIVE) == 0 && + if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0 && (sc->sc_flags & WI_FLAGS_OUTRANGE) == 0 && !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) wi_start(ifp); @@ -792,8 +792,8 @@ wi_init(void *arg) wi_cmd(sc, WI_CMD_ENABLE | sc->sc_portnum, 0, 0, 0); sc->sc_enabled = 1; - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (ic->ic_opmode == IEEE80211_M_AHDEMO || ic->ic_opmode == IEEE80211_M_IBSS || ic->ic_opmode == IEEE80211_M_MONITOR || @@ -866,7 +866,7 @@ wi_stop(struct ifnet *ifp, int disable) sc->sc_scan_timer = 0; sc->sc_false_syns = 0; sc->sc_naps = 0; - ifp->if_flags &= ~(IFF_OACTIVE | IFF_RUNNING); + ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE | IFF_DRV_RUNNING); ifp->if_timer = 0; WI_UNLOCK(sc); @@ -902,7 +902,7 @@ wi_start(struct ifnet *ifp) IF_POLL(&ic->ic_mgtq, m0); if (m0 != NULL) { if (sc->sc_txd[cur].d_len != 0) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } IF_DEQUEUE(&ic->ic_mgtq, m0); @@ -930,7 +930,7 @@ wi_start(struct ifnet *ifp) break; if (sc->sc_txd[cur].d_len != 0) { IFQ_DRV_PREPEND(&ifp->if_snd, m0); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } if (m0->m_len < sizeof(struct ether_header) && @@ -1121,7 +1121,7 @@ wi_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) WI_LOCK(sc); if (ifp->if_flags & IFF_UP) { if (ic->ic_opmode != IEEE80211_M_HOSTAP && - ifp->if_flags & IFF_RUNNING) { + ifp->if_drv_flags & IFF_DRV_RUNNING) { if (ifp->if_flags & IFF_PROMISC && !(sc->sc_if_flags & IFF_PROMISC)) { wi_write_val(sc, WI_RID_PROMISC, 1); @@ -1135,7 +1135,7 @@ wi_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) wi_init(sc); } } else { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { wi_stop(ifp, 1); } sc->wi_gone = 0; @@ -1164,7 +1164,7 @@ wi_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = copyin(ifr->ifr_data, &wreq, sizeof(wreq)); if (error) break; - if (!(ifp->if_flags & IFF_RUNNING) || + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING) || sc->sc_firmware_type == WI_LUCENT) { error = EIO; break; @@ -1631,7 +1631,7 @@ wi_tx_intr(struct wi_softc *sc) sc->sc_txd[cur].d_len = 0; sc->sc_txcur = cur = (cur + 1) % sc->sc_ntxbuf; if (sc->sc_txd[cur].d_len == 0) - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; else { if (wi_cmd(sc, WI_CMD_TX | WI_RECLAIM, sc->sc_txd[cur].d_fid, 0, 0)) { diff --git a/sys/dev/wi/if_wi_pci.c b/sys/dev/wi/if_wi_pci.c index a8e955fa8d87..cddc9298d50b 100644 --- a/sys/dev/wi/if_wi_pci.c +++ b/sys/dev/wi/if_wi_pci.c @@ -267,7 +267,7 @@ wi_pci_resume(device_t dev) if (ifp->if_flags & IFF_UP) { ifp->if_init(ifp->if_softc); - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) ifp->if_start(ifp); } diff --git a/sys/dev/wl/if_wl.c b/sys/dev/wl/if_wl.c index ce3ed0da808e..aa57433eb936 100644 --- a/sys/dev/wl/if_wl.c +++ b/sys/dev/wl/if_wl.c @@ -810,12 +810,12 @@ wlinit(void *xsc) WL_LOCK(sc); oldpri = splimp(); if ((stat = wlhwrst(sc)) == TRUE) { - sc->ifp->if_flags |= IFF_RUNNING; /* same as DSF_RUNNING */ + sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; /* same as DSF_RUNNING */ /* * OACTIVE is used by upper-level routines * and must be set */ - sc->ifp->if_flags &= ~IFF_OACTIVE; /* same as tbusy below */ + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* same as tbusy below */ sc->flags |= DSF_RUNNING; sc->tbusy = 0; @@ -990,7 +990,7 @@ wlstart(struct ifnet *ifp) (cu_status & AC_SW_B) == 0){ sc->tbusy = 0; untimeout(wlwatchdog, sc, sc->watchdog_ch); - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* * This is probably just a race. The xmt'r is just * became idle but WE have masked interrupts so ... @@ -1027,11 +1027,11 @@ wlstart(struct ifnet *ifp) */ /* try 10 ticks, not very long */ sc->watchdog_ch = timeout(wlwatchdog, sc, 10); - sc->ifp->if_flags |= IFF_OACTIVE; + sc->ifp->if_drv_flags |= IFF_DRV_OACTIVE; sc->ifp->if_opackets++; wlxmt(sc, m); } else { - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } WL_UNLOCK(sc); return; @@ -1074,7 +1074,7 @@ wlread(struct wl_softc *sc, u_short fd_p) if (sc->ifp->if_flags & IFF_DEBUG) printf("wl%d: entered wlread()\n", sc->unit); #endif - if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) { + if (!((ifp->if_flags & IFF_UP) && (ifp->if_drv_flags & IFF_DRV_RUNNING))) { printf("%s read(): board is not running.\n", ifp->if_xname); sc->hacr &= ~HACR_INTRON; CMD(sc); /* turn off interrupts */ @@ -1627,7 +1627,7 @@ wlintr(void *arg) } sc->tbusy = 0; untimeout(wlwatchdog, sc, sc->watchdog_ch); - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; wlstart(sc->ifp); } } diff --git a/sys/dev/xe/if_xe.c b/sys/dev/xe/if_xe.c index de1e2a0cf67d..54d3cdc4d8ef 100644 --- a/sys/dev/xe/if_xe.c +++ b/sys/dev/xe/if_xe.c @@ -411,8 +411,8 @@ xe_init(void *xscp) { xe_setmedia(scp); /* Enable output */ - scp->ifp->if_flags |= IFF_RUNNING; - scp->ifp->if_flags &= ~IFF_OACTIVE; + scp->ifp->if_drv_flags |= IFF_DRV_RUNNING; + scp->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; (void)splx(s); } @@ -420,8 +420,8 @@ xe_init(void *xscp) { /* * Start output on interface. Should be called at splimp() priority. Check - * that the output is idle (ie, IFF_OACTIVE is not set) before calling this - * function. If media selection is in progress we set IFF_OACTIVE ourselves + * that the output is idle (ie, IFF_DRV_OACTIVE is not set) before calling this + * function. If media selection is in progress we set IFF_DRV_OACTIVE ourselves * and return immediately. */ static void @@ -430,7 +430,7 @@ xe_start(struct ifnet *ifp) { struct mbuf *mbp; if (scp->autoneg_status != XE_AUTONEG_NONE) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; return; } @@ -451,14 +451,14 @@ xe_start(struct ifnet *ifp) { * we haven't filled all the buffers with data then we still want to * accept more. */ - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; return; } if (xe_pio_write_packet(scp, mbp) != 0) { /* Push the packet back onto the queue */ IF_PREPEND(&ifp->if_snd, mbp); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; return; } @@ -496,13 +496,13 @@ xe_ioctl (register struct ifnet *ifp, u_long command, caddr_t data) { * marked down and running, then stop it. */ if (ifp->if_flags & IFF_UP) { - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { xe_reset(scp); xe_init(scp); } } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) xe_stop(scp); } /* FALL THROUGH (handle changes to PROMISC/ALLMULTI flags) */ @@ -630,7 +630,7 @@ xe_intr(void *xscp) } } ifp->if_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } /* Handle most MAC interrupts */ @@ -935,7 +935,7 @@ static void xe_setmedia(void *xscp) { case XE_AUTONEG_NONE: DEVPRINTF(2, (scp->dev, "Waiting for idle transmitter\n")); - scp->ifp->if_flags |= IFF_OACTIVE; + scp->ifp->if_drv_flags |= IFF_DRV_OACTIVE; scp->autoneg_status = XE_AUTONEG_WAITING; /* FALL THROUGH */ @@ -1129,7 +1129,7 @@ static void xe_setmedia(void *xscp) { /* Restart output? */ xe_enable_intr(scp); - scp->ifp->if_flags &= ~IFF_OACTIVE; + scp->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; xe_start(scp->ifp); } @@ -1198,10 +1198,10 @@ xe_stop(struct xe_softc *scp) { } /* - * ~IFF_RUNNING == interface down. + * ~IFF_DRV_RUNNING == interface down. */ - scp->ifp->if_flags &= ~IFF_RUNNING; - scp->ifp->if_flags &= ~IFF_OACTIVE; + scp->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + scp->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; scp->ifp->if_timer = 0; (void)splx(s); diff --git a/sys/dev/xe/if_xe_pccard.c b/sys/dev/xe/if_xe_pccard.c index cfa5253f3548..fa0d9c764de9 100644 --- a/sys/dev/xe/if_xe_pccard.c +++ b/sys/dev/xe/if_xe_pccard.c @@ -350,7 +350,7 @@ xe_pccard_detach(device_t dev) DEVPRINTF(2, (dev, "pccard_detach\n")); - sc->ifp->if_flags &= ~IFF_RUNNING; + sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; ether_ifdetach(sc->ifp); if_free(sc->ifp); xe_deactivate(dev); diff --git a/sys/i386/isa/if_el.c b/sys/i386/isa/if_el.c index 6ba3c0cddc37..ad174bd165fe 100644 --- a/sys/i386/isa/if_el.c +++ b/sys/i386/isa/if_el.c @@ -386,8 +386,8 @@ el_init(xsc) CSR_WRITE_1(sc,EL_AC,(EL_AC_IRQE|EL_AC_RX)); /* Set flags appropriately */ - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* And start output. */ el_start(ifp); @@ -413,9 +413,9 @@ el_start(struct ifnet *ifp) EL_LOCK(sc); /* Don't do anything if output is active */ - if(sc->el_ifp->if_flags & IFF_OACTIVE) + if(sc->el_ifp->if_drv_flags & IFF_DRV_OACTIVE) return; - sc->el_ifp->if_flags |= IFF_OACTIVE; + sc->el_ifp->if_drv_flags |= IFF_DRV_OACTIVE; /* The main loop. They warned me against endless loops, but * would I listen? NOOO.... @@ -426,7 +426,7 @@ el_start(struct ifnet *ifp) /* If there's nothing to send, return. */ if(m0 == NULL) { - sc->el_ifp->if_flags &= ~IFF_OACTIVE; + sc->el_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; EL_UNLOCK(sc); return; } @@ -744,15 +744,15 @@ el_ioctl(ifp, command, data) * If interface is marked down and it is running, then stop it */ if (((ifp->if_flags & IFF_UP) == 0) && - (ifp->if_flags & IFF_RUNNING)) { + (ifp->if_drv_flags & IFF_DRV_RUNNING)) { el_stop(ifp->if_softc); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; } else { /* * If interface is marked up and it is stopped, then start it */ if ((ifp->if_flags & IFF_UP) && - ((ifp->if_flags & IFF_RUNNING) == 0)) + ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)) el_init(ifp->if_softc); } break; diff --git a/sys/i4b/driver/i4b_ipr.c b/sys/i4b/driver/i4b_ipr.c index 1309d73013a0..7fbebc82ea3e 100644 --- a/sys/i4b/driver/i4b_ipr.c +++ b/sys/i4b/driver/i4b_ipr.c @@ -444,12 +444,13 @@ i4biprioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCSIFFLAGS: /* set interface flags */ if(!(ifr->ifr_flags & IFF_UP)) { - if(sc->sc_ifp->if_flags & IFF_RUNNING) + if(sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) { /* disconnect ISDN line */ i4b_l4_drvrdisc(BDRV_IPR, ifp->if_dunit); - sc->sc_ifp->if_flags &= ~IFF_RUNNING; + sc->sc_ifp->if_drv_flags &= + ~IFF_DRV_RUNNING; } sc->sc_state = ST_IDLE; @@ -594,7 +595,7 @@ ipr_connect(int unit, void *cdp) NDBGL4(L4_DIALST, "ipr%d: setting dial state to ST_CONNECTED", unit); - sc->sc_ifp->if_flags |= IFF_RUNNING; + sc->sc_ifp->if_drv_flags |= IFF_DRV_RUNNING; sc->sc_state = ST_CONNECTED_W; sc->sc_dialresp = DSTAT_NONE; @@ -687,7 +688,7 @@ ipr_disconnect(int unit, void *cdp) sc->sc_dialresp = DSTAT_NONE; sc->sc_lastdialresp = DSTAT_NONE; - sc->sc_ifp->if_flags &= ~IFF_RUNNING; + sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sc->sc_state = ST_IDLE; } diff --git a/sys/i4b/driver/i4b_isppp.c b/sys/i4b/driver/i4b_isppp.c index 1cacdea0c76d..2d9abe8b77c0 100644 --- a/sys/i4b/driver/i4b_isppp.c +++ b/sys/i4b/driver/i4b_isppp.c @@ -280,7 +280,7 @@ i4bisppp_start(struct ifnet *ifp) /* * s = splimp(); - * ifp->if_flags |= IFF_OACTIVE; // - need to clear this somewhere + * ifp->if_drv_flags |= IFF_DRV_OACTIVE; // - need to clear this somewhere * splx(s); */ diff --git a/sys/kern/kern_poll.c b/sys/kern/kern_poll.c index 2fe13246ab34..f1e7e415d813 100644 --- a/sys/kern/kern_poll.c +++ b/sys/kern/kern_poll.c @@ -66,7 +66,7 @@ void ether_poll(int); /* polling while in trap */ * POLL_DEREGISTER: deregister and return to interrupt mode. * * The first two commands are only issued if the interface is marked as - * 'IFF_UP and IFF_RUNNING', the last one only if IFF_RUNNING is set. + * 'IFF_UP and IFF_DRV_RUNNING', the last one only if IFF_DRV_RUNNING is set. * * The count limit specifies how much work the handler can do during the * call -- typically this is the number of packets to be received, or @@ -251,8 +251,9 @@ ether_poll(int count) if (count > poll_each_burst) count = poll_each_burst; for (i = 0 ; i < poll_handlers ; i++) - if (pr[i].handler && (IFF_UP|IFF_RUNNING) == - (pr[i].ifp->if_flags & (IFF_UP|IFF_RUNNING)) ) + if (pr[i].handler && + (pr[i].ifp->if_flags & IFF_UP) && + (pr[i].ifp->if_drv_flags & IFF_DRV_RUNNING)) pr[i].handler(pr[i].ifp, 0, count); /* quick check */ mtx_unlock(&Giant); } @@ -373,13 +374,14 @@ netisr_poll(void) if (polling) { for (i = 0 ; i < poll_handlers ; i++) - if (pr[i].handler && (IFF_UP|IFF_RUNNING) == - (pr[i].ifp->if_flags & (IFF_UP|IFF_RUNNING)) ) + if (pr[i].handler && + (pr[i].ifp->if_flags & IFF_UP) && + (pr[i].ifp->if_drv_flags & IFF_DRV_RUNNING)) pr[i].handler(pr[i].ifp, arg, cycles); } else { /* unregister */ for (i = 0 ; i < poll_handlers ; i++) { if (pr[i].handler && - pr[i].ifp->if_flags & IFF_RUNNING) { + pr[i].ifp->if_drv_flags & IFF_DRV_RUNNING) { pr[i].ifp->if_flags &= ~IFF_POLLING; pr[i].handler(pr[i].ifp, POLL_DEREGISTER, 1); } diff --git a/sys/net/bridge.c b/sys/net/bridge.c index 211f0e5bceb0..b95fa57541bf 100644 --- a/sys/net/bridge.c +++ b/sys/net/bridge.c @@ -908,7 +908,8 @@ bridge_ifok(struct ifnet *ifp, struct ifnet *src, struct ifnet *dst) return (BDG_USED(ifp) && !BDG_MUTED(ifp) && !_IF_QFULL(&ifp->if_snd) - && (ifp->if_flags & (IFF_UP|IFF_RUNNING)) == (IFF_UP|IFF_RUNNING) + && (ifp->if_flags & IFF_UP) + && (ifp->if_drv_flags & IFF_DRV_RUNNING) && ifp != src && BDG_SAMECLUSTER(ifp, dst)); } diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c index ccb76742c6da..b4d0a821419a 100644 --- a/sys/net/bridgestp.c +++ b/sys/net/bridgestp.c @@ -228,7 +228,7 @@ bstp_send_config_bpdu(struct bridge_softc *sc, struct bridge_iflist *bif, ifp = bif->bif_ifp; - if ((ifp->if_flags & IFF_RUNNING) == 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; MGETHDR(m, M_DONTWAIT, MT_DATA); @@ -370,7 +370,7 @@ bstp_transmit_tcn(struct bridge_softc *sc) BRIDGE_LOCK_ASSERT(sc); - if ((ifp->if_flags & IFF_RUNNING) == 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; MGETHDR(m, M_DONTWAIT, MT_DATA); @@ -1137,7 +1137,7 @@ bstp_tick(void *arg) bstp_hold_timer_expiry(sc, bif); } - if (sc->sc_ifp->if_flags & IFF_RUNNING) + if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) callout_reset(&sc->sc_bstpcallout, hz, bstp_tick, sc); BRIDGE_UNLOCK(sc); diff --git a/sys/net/if_arcsubr.c b/sys/net/if_arcsubr.c index 09a672ff3604..94f6681b6309 100644 --- a/sys/net/if_arcsubr.c +++ b/sys/net/if_arcsubr.c @@ -112,7 +112,8 @@ arc_output(ifp, m, dst, rt0) int loop_copy = 0; int isphds; - if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) + if (!((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING))) return(ENETDOWN); /* m, m1 aren't initialized yet */ error = 0; diff --git a/sys/net/if_atm.h b/sys/net/if_atm.h index 4b07f36739de..99cc27757148 100644 --- a/sys/net/if_atm.h +++ b/sys/net/if_atm.h @@ -320,8 +320,8 @@ void atm_event(struct ifnet *, u_int, void *); #define ATMEV_SEND_IFSTATE_CHANGED(ATMIF, CARRIER) \ do { \ struct atmev_ifstate_changed _arg; \ - _arg.running = (((ATMIF)->ifp->if_flags & \ - IFF_RUNNING) != 0); \ + _arg.running = (((ATMIF)->ifp->if_drv_flags & \ + IFF_DRV_RUNNING) != 0); \ _arg.carrier = ((CARRIER) != 0); \ atm_event((ATMIF)->ifp, ATMEV_IFSTATE_CHANGED, &_arg); \ } while (0) diff --git a/sys/net/if_atmsubr.c b/sys/net/if_atmsubr.c index fa8778de9413..6e662a02f563 100644 --- a/sys/net/if_atmsubr.c +++ b/sys/net/if_atmsubr.c @@ -138,7 +138,8 @@ atm_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, senderr(error); #endif - if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) != (IFF_UP | IFF_RUNNING)) + if (!((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING))) senderr(ENETDOWN); /* diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 841c7af45e9a..65185138744e 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -584,13 +584,15 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; case SIOCSIFFLAGS: - if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) == IFF_RUNNING) { + if (!(ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING)) { /* * If interface is marked down and it is running, * then stop and disable it. */ bridge_stop(ifp, 1); - } else if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) == IFF_UP) { + } else if ((ifp->if_flags & IFF_UP) && + !(ifp->if_drv_flags & IFF_DRV_RUNNING)) { /* * If interface is marked up and it is stopped, then * start it. @@ -699,7 +701,7 @@ bridge_delete_member(struct bridge_softc *sc, struct bridge_iflist *bif) free(bif, M_DEVBUF); - if (sc->sc_ifp->if_flags & IFF_RUNNING) + if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) bstp_initialization(sc); } @@ -764,7 +766,7 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg) */ LIST_INSERT_HEAD(&sc->sc_iflist, bif, bif_next); - if (sc->sc_ifp->if_flags & IFF_RUNNING) + if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) bstp_initialization(sc); else bstp_stop(sc); @@ -841,7 +843,7 @@ bridge_ioctl_sifflags(struct bridge_softc *sc, void *arg) bif->bif_flags = req->ifbr_ifsflags; - if (sc->sc_ifp->if_flags & IFF_RUNNING) + if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) bstp_initialization(sc); return (0); @@ -1042,7 +1044,7 @@ bridge_ioctl_spri(struct bridge_softc *sc, void *arg) sc->sc_bridge_priority = param->ifbrp_prio; - if (sc->sc_ifp->if_flags & IFF_RUNNING) + if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) bstp_initialization(sc); return (0); @@ -1071,7 +1073,7 @@ bridge_ioctl_sht(struct bridge_softc *sc, void *arg) return (EINVAL); sc->sc_bridge_hello_time = param->ifbrp_hellotime << 8; - if (sc->sc_ifp->if_flags & IFF_RUNNING) + if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) bstp_initialization(sc); return (0); @@ -1100,7 +1102,7 @@ bridge_ioctl_sfd(struct bridge_softc *sc, void *arg) return (EINVAL); sc->sc_bridge_forward_delay = param->ifbrp_fwddelay << 8; - if (sc->sc_ifp->if_flags & IFF_RUNNING) + if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) bstp_initialization(sc); return (0); @@ -1129,7 +1131,7 @@ bridge_ioctl_sma(struct bridge_softc *sc, void *arg) return (EINVAL); sc->sc_bridge_max_age = param->ifbrp_maxage << 8; - if (sc->sc_ifp->if_flags & IFF_RUNNING) + if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) bstp_initialization(sc); return (0); @@ -1149,7 +1151,7 @@ bridge_ioctl_sifprio(struct bridge_softc *sc, void *arg) bif->bif_priority = req->ifbr_priority; - if (sc->sc_ifp->if_flags & IFF_RUNNING) + if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) bstp_initialization(sc); return (0); @@ -1169,7 +1171,7 @@ bridge_ioctl_sifcost(struct bridge_softc *sc, void *arg) bif->bif_path_cost = req->ifbr_path_cost; - if (sc->sc_ifp->if_flags & IFF_RUNNING) + if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) bstp_initialization(sc); return (0); @@ -1206,13 +1208,13 @@ bridge_init(void *xsc) struct bridge_softc *sc = (struct bridge_softc *)xsc; struct ifnet *ifp = sc->sc_ifp; - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) return; callout_reset(&sc->sc_brcallout, bridge_rtable_prune_period * hz, bridge_timer, sc); - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; bstp_initialization(sc); return; } @@ -1227,7 +1229,7 @@ bridge_stop(struct ifnet *ifp, int disable) { struct bridge_softc *sc = ifp->if_softc; - if ((ifp->if_flags & IFF_RUNNING) == 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; callout_stop(&sc->sc_brcallout); @@ -1235,7 +1237,7 @@ bridge_stop(struct ifnet *ifp, int disable) bridge_rtflush(sc, IFBF_FLUSHDYN); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; } /* @@ -1279,7 +1281,7 @@ bridge_enqueue(struct bridge_softc *sc, struct ifnet *dst_ifp, struct mbuf *m) } } - if ((dst_ifp->if_flags & IFF_OACTIVE) == 0) + if ((dst_ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) (*dst_ifp->if_start)(dst_ifp); } @@ -1356,7 +1358,7 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa, * go ahead and send out that interface. Otherwise, the packet * is dropped below. */ - if ((sc->sc_ifp->if_flags & IFF_RUNNING) == 0) { + if ((sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { dst_if = ifp; goto sendunicast; } @@ -1381,7 +1383,7 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa, } LIST_FOREACH(bif, &sc->sc_iflist, bif_next) { dst_if = bif->bif_ifp; - if ((dst_if->if_flags & IFF_RUNNING) == 0) + if ((dst_if->if_drv_flags & IFF_DRV_RUNNING) == 0) continue; /* @@ -1424,7 +1426,7 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa, * XXX Spanning tree consideration here? */ - if ((dst_if->if_flags & IFF_RUNNING) == 0) { + if ((dst_if->if_drv_flags & IFF_DRV_RUNNING) == 0) { m_freem(m); BRIDGE_UNLOCK(sc); return (0); @@ -1451,7 +1453,7 @@ bridge_start(struct ifnet *ifp) sc = ifp->if_softc; - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; for (;;) { IFQ_DEQUEUE(&ifp->if_snd, m); if (m == 0) @@ -1485,7 +1487,7 @@ bridge_start(struct ifnet *ifp) bridge_enqueue(sc, dst_if, m); } } - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; return; } @@ -1607,7 +1609,7 @@ bridge_forward(struct bridge_softc *sc, struct mbuf *m) * At this point, we're dealing with a unicast frame * going to a different interface. */ - if ((dst_if->if_flags & IFF_RUNNING) == 0) { + if ((dst_if->if_drv_flags & IFF_DRV_RUNNING) == 0) { BRIDGE_UNLOCK(sc); m_freem(m); return; @@ -1663,7 +1665,7 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) struct ether_header *eh; struct mbuf *mc; - if ((sc->sc_ifp->if_flags & IFF_RUNNING) == 0) + if ((sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return (m); BRIDGE_LOCK(sc); @@ -1829,7 +1831,7 @@ bridge_broadcast(struct bridge_softc *sc, struct ifnet *src_if, (m->m_flags & (M_BCAST|M_MCAST)) == 0) continue; - if ((dst_if->if_flags & IFF_RUNNING) == 0) + if ((dst_if->if_drv_flags & IFF_DRV_RUNNING) == 0) continue; if (LIST_NEXT(bif, bif_next) == NULL) { @@ -1985,7 +1987,7 @@ bridge_timer(void *arg) bridge_rtage(sc); BRIDGE_UNLOCK(sc); - if (sc->sc_ifp->if_flags & IFF_RUNNING) + if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) callout_reset(&sc->sc_brcallout, bridge_rtable_prune_period * hz, bridge_timer, sc); } diff --git a/sys/net/if_ef.c b/sys/net/if_ef.c index f61548566f58..448240e39568 100644 --- a/sys/net/if_ef.c +++ b/sys/net/if_ef.c @@ -143,7 +143,7 @@ ef_attach(struct efnet *sc) ifp->if_resolvemulti = 0; ifp->if_type = IFT_XETHER; - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; EFDEBUG("%s: attached\n", ifp->if_xname); return 1; @@ -214,7 +214,7 @@ ef_start(struct ifnet *ifp) struct mbuf *m; int error; - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; p = sc->ef_pifp; EFDEBUG("\n"); @@ -230,7 +230,7 @@ ef_start(struct ifnet *ifp) } ifp->if_opackets++; } - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; return; } diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index d2423a495e96..eada2f90c7ee 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -163,7 +163,8 @@ ether_output(struct ifnet *ifp, struct mbuf *m, if (ifp->if_flags & IFF_MONITOR) senderr(ENETDOWN); - if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) + if (!((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING))) senderr(ENETDOWN); hlen = ETHER_HDR_LEN; diff --git a/sys/net/if_faith.c b/sys/net/if_faith.c index 36bc0cd65334..d71a3fa1922e 100644 --- a/sys/net/if_faith.c +++ b/sys/net/if_faith.c @@ -300,7 +300,8 @@ faithioctl(ifp, cmd, data) switch (cmd) { case SIOCSIFADDR: - ifp->if_flags |= IFF_UP | IFF_RUNNING; + ifp->if_flags |= IFF_UP; + ifp->if_drv_flags |= IFF_DRV_RUNNING; ifa = (struct ifaddr *)data; ifa->ifa_rtrequest = faithrtrequest; /* diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c index 4c626f21c2d5..ed33313c1f0e 100644 --- a/sys/net/if_fddisubr.c +++ b/sys/net/if_fddisubr.c @@ -127,7 +127,8 @@ fddi_output(ifp, m, dst, rt0) if (ifp->if_flags & IFF_MONITOR) senderr(ENETDOWN); - if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) + if (!((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING))) senderr(ENETDOWN); getmicrotime(&ifp->if_lastchange); @@ -387,7 +388,8 @@ fddi_input(ifp, m) /* * Discard packet if interface is not up. */ - if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) + if (!((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING))) goto dropanyway; /* diff --git a/sys/net/if_fwsubr.c b/sys/net/if_fwsubr.c index baff6ec15f32..0aaa949b0cd5 100644 --- a/sys/net/if_fwsubr.c +++ b/sys/net/if_fwsubr.c @@ -97,7 +97,8 @@ firewire_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, goto bad; #endif - if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) { + if (!((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING))) { error = ENETDOWN; goto bad; } diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index d5c7cd752aab..7b01bbb76caa 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -876,18 +876,18 @@ gif_set_tunnel(ifp, src, dst) free((caddr_t)odst, M_IFADDR); if (sc->gif_psrc && sc->gif_pdst) - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; else - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; splx(s); return 0; bad: if (sc->gif_psrc && sc->gif_pdst) - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; else - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; splx(s); return error; @@ -919,8 +919,8 @@ gif_delete_tunnel(ifp) #endif if (sc->gif_psrc && sc->gif_pdst) - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; else - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; splx(s); } diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c index dc7355d21edc..aa575262f4bc 100644 --- a/sys/net/if_gre.c +++ b/sys/net/if_gre.c @@ -257,7 +257,8 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, goto end; } - if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == 0 || + if (!((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING)) || sc->g_src.s_addr == INADDR_ANY || sc->g_dst.s_addr == INADDR_ANY) { m_freem(m); error = ENETDOWN; @@ -559,9 +560,9 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) if (sc->route.ro_rt != 0) /* free old route */ RTFREE(sc->route.ro_rt); if (gre_compute_route(sc) == 0) - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; else - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; } break; case GREGADDRS: diff --git a/sys/net/if_iso88025subr.c b/sys/net/if_iso88025subr.c index 6c30564ab811..2170e0e52215 100644 --- a/sys/net/if_iso88025subr.c +++ b/sys/net/if_iso88025subr.c @@ -253,7 +253,8 @@ iso88025_output(ifp, m, dst, rt0) if (ifp->if_flags & IFF_MONITOR) senderr(ENETDOWN); - if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) + if (!((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING))) senderr(ENETDOWN); getmicrotime(&ifp->if_lastchange); @@ -484,7 +485,8 @@ iso88025_input(ifp, m) /* * Discard packet if interface is not up. */ - if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) + if (!((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING))) goto dropanyway; /* diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index 12231b26e35c..94f1c3e47b7d 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -349,7 +349,8 @@ loioctl(ifp, cmd, data) switch (cmd) { case SIOCSIFADDR: - ifp->if_flags |= IFF_UP | IFF_RUNNING; + ifp->if_flags |= IFF_UP; + ifp->if_drv_flags |= IFF_DRV_RUNNING; ifa = (struct ifaddr *)data; ifa->ifa_rtrequest = lortrequest; /* diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c index c21b66351f2e..8050d81213bc 100644 --- a/sys/net/if_ppp.c +++ b/sys/net/if_ppp.c @@ -404,7 +404,8 @@ pppdealloc(sc) struct mbuf *m; if_down(PPP2IFP(sc)); - PPP2IFP(sc)->if_flags &= ~(IFF_UP|IFF_RUNNING); + PPP2IFP(sc)->if_flags &= ~IFF_UP; + PPP2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; getmicrotime(&PPP2IFP(sc)->if_lastchange); sc->sc_devp = NULL; sc->sc_xfer = 0; @@ -688,7 +689,7 @@ pppsioctl(ifp, cmd, data) switch (cmd) { case SIOCSIFFLAGS: - if ((ifp->if_flags & IFF_RUNNING) == 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) ifp->if_flags &= ~IFF_UP; break; @@ -822,7 +823,7 @@ pppoutput(ifp, m0, dst, rtp) goto bad; #endif - if (sc->sc_devp == NULL || (ifp->if_flags & IFF_RUNNING) == 0 + if (sc->sc_devp == NULL || (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || ((ifp->if_flags & IFF_UP) == 0 && dst->sa_family != AF_UNSPEC)) { error = ENETDOWN; /* sort of */ goto bad; diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index b3d1df5786a4..875cb1cd9836 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -839,8 +839,9 @@ sppp_output(struct ifnet *ifp, struct mbuf *m, s = splimp(); SPPP_LOCK(sp); - if ((ifp->if_flags & IFF_UP) == 0 || - (ifp->if_flags & (IFF_RUNNING | IFF_AUTO)) == 0) { + if (!(ifp->if_flags & IFF_UP) || + (!(ifp->if_flags & IFF_AUTO) && + !(ifp->if_drv_flags & IFF_DRV_RUNNING))) { #ifdef INET6 drop: #endif @@ -850,7 +851,8 @@ sppp_output(struct ifnet *ifp, struct mbuf *m, return (ENETDOWN); } - if ((ifp->if_flags & (IFF_RUNNING | IFF_AUTO)) == IFF_AUTO) { + if ((ifp->if_flags & IFF_AUTO) && + !(ifp->if_drv_flags & IFF_DRV_RUNNING)) { #ifdef INET6 /* * XXX @@ -868,7 +870,7 @@ sppp_output(struct ifnet *ifp, struct mbuf *m, * Interface is not yet running, but auto-dial. Need * to start LCP for it. */ - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; splx(s); lcp.Open(sp); s = splimp(); @@ -1268,9 +1270,9 @@ sppp_ioctl(struct ifnet *ifp, IOCTL_CMD_T cmd, void *data) case SIOCSIFFLAGS: going_up = ifp->if_flags & IFF_UP && - (ifp->if_flags & IFF_RUNNING) == 0; + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0; going_down = (ifp->if_flags & IFF_UP) == 0 && - ifp->if_flags & IFF_RUNNING; + ifp->if_drv_flags & IFF_DRV_RUNNING; newmode = ifp->if_flags & IFF_PASSIVE; if (!newmode) @@ -1286,7 +1288,7 @@ sppp_ioctl(struct ifnet *ifp, IOCTL_CMD_T cmd, void *data) if (newmode != sp->pp_mode) { going_down = 1; if (!going_up) - going_up = ifp->if_flags & IFF_RUNNING; + going_up = ifp->if_drv_flags & IFF_DRV_RUNNING; } if (going_down) { @@ -1296,7 +1298,7 @@ sppp_ioctl(struct ifnet *ifp, IOCTL_CMD_T cmd, void *data) else if (sp->pp_tlf) (sp->pp_tlf)(sp); sppp_flush_unlocked(ifp); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sp->pp_mode = newmode; } @@ -1306,14 +1308,14 @@ sppp_ioctl(struct ifnet *ifp, IOCTL_CMD_T cmd, void *data) lcp.Close(sp); sp->pp_mode = newmode; if (sp->pp_mode == 0) { - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; lcp.Open(sp); } if ((sp->pp_mode == IFF_CISCO) || (sp->pp_mode == PP_FR)) { if (sp->pp_tls) (sp->pp_tls)(sp); - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; } } @@ -1428,7 +1430,7 @@ sppp_cisco_input(struct sppp *sp, struct mbuf *m) } sp->pp_loopcnt = 0; if (! (ifp->if_flags & IFF_UP) && - (ifp->if_flags & IFF_RUNNING)) { + (ifp->if_drv_flags & IFF_DRV_RUNNING)) { if_up(ifp); printf (SPP_FMT "up\n", SPP_ARGS(ifp)); } @@ -2268,7 +2270,7 @@ sppp_lcp_up(struct sppp *sp) if (debug) log(LOG_DEBUG, SPP_FMT "Up event", SPP_ARGS(ifp)); - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; if (sp->state[IDX_LCP] == STATE_INITIAL) { if (debug) log(-1, "(incoming call)\n"); @@ -2278,7 +2280,7 @@ sppp_lcp_up(struct sppp *sp) log(-1, "\n"); } else if ((ifp->if_flags & (IFF_AUTO | IFF_PASSIVE)) == 0 && (sp->state[IDX_LCP] == STATE_INITIAL)) { - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; lcp.Open(sp); } @@ -2312,7 +2314,7 @@ sppp_lcp_down(struct sppp *sp) sp->pp_flags &= ~PP_CALLIN; if (sp->state[IDX_LCP] != STATE_INITIAL) lcp.Close(sp); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; } } @@ -2718,7 +2720,7 @@ sppp_lcp_tlu(struct sppp *sp) /* XXX ? */ if (! (ifp->if_flags & IFF_UP) && - (ifp->if_flags & IFF_RUNNING)) { + (ifp->if_drv_flags & IFF_DRV_RUNNING)) { /* Coming out of loopback mode. */ if_up(ifp); printf (SPP_FMT "up\n", SPP_ARGS(ifp)); @@ -4819,7 +4821,7 @@ sppp_keepalive(void *dummy) SPPP_LOCK(sp); /* Keepalive mode disabled or channel down? */ if (! (sp->pp_flags & PP_KEEPALIVE) || - ! (ifp->if_flags & IFF_RUNNING)) + ! (ifp->if_drv_flags & IFF_DRV_RUNNING)) goto out; if (sp->pp_mode == PP_FR) { diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c index f631c09fccac..4e1b7278de7f 100644 --- a/sys/net/if_tap.c +++ b/sys/net/if_tap.c @@ -393,8 +393,8 @@ tapopen(dev, flag, mode, td) mtx_unlock(&tp->tap_mtx); s = splimp(); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; splx(s); TAPDEBUG("%s is open. minor = %#x\n", ifp->if_xname, minor(dev)); @@ -433,12 +433,12 @@ tapclose(dev, foo, bar, td) mtx_unlock(&tp->tap_mtx); s = splimp(); if_down(ifp); - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { rtinit(ifa, (int)RTM_DELETE, 0); } if_purgeaddrs(ifp); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; } splx(s); } else @@ -473,8 +473,8 @@ tapifinit(xtp) TAPDEBUG("initializing %s\n", ifp->if_xname); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* attempt to start output */ tapifstart(ifp); @@ -570,7 +570,7 @@ tapifstart(ifp) mtx_unlock(&tp->tap_mtx); s = splimp(); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; if (ifp->if_snd.ifq_len != 0) { mtx_lock(&tp->tap_mtx); @@ -589,7 +589,7 @@ tapifstart(ifp) ifp->if_opackets ++; /* obytes are counted in ether_output */ } - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; splx(s); } /* tapifstart */ diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index d9c31e2ed11b..eafcdb569965 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -360,7 +360,7 @@ tunclose(struct cdev *dev, int foo, int bar, struct thread *td) splx(s); } - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { struct ifaddr *ifa; s = splimp(); @@ -370,7 +370,7 @@ tunclose(struct cdev *dev, int foo, int bar, struct thread *td) /* Unlocked read. */ rtinit(ifa, (int)RTM_DELETE, tp->tun_flags & TUN_DSTADDR ? RTF_HOST : 0); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; splx(s); } @@ -389,7 +389,8 @@ tuninit(struct ifnet *ifp) TUNDEBUG(ifp, "tuninit\n"); - ifp->if_flags |= IFF_UP | IFF_RUNNING; + ifp->if_flags |= IFF_UP; + ifp->if_drv_flags |= IFF_DRV_RUNNING; getmicrotime(&ifp->if_lastchange); for (ifa = TAILQ_FIRST(&ifp->if_addrhead); ifa; diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index f909dbe64891..7be7a78dc7b1 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -413,7 +413,7 @@ vlan_clone_create(struct if_clone *ifc, char *name, size_t len) return (error); } ifv->ifv_tag = tag; - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; VLAN_UNLOCK(); /* Update promiscuous mode, if necessary. */ @@ -467,7 +467,7 @@ vlan_start(struct ifnet *ifp) ifv = ifp->if_softc; p = ifv->ifv_p; - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; for (;;) { IF_DEQUEUE(&ifp->if_snd, m); if (m == 0) @@ -478,8 +478,8 @@ vlan_start(struct ifnet *ifp) * Do not run parent's if_start() if the parent is not up, * or parent's driver will cause a system crash. */ - if ((p->if_flags & (IFF_UP | IFF_RUNNING)) != - (IFF_UP | IFF_RUNNING)) { + if (!((p->if_flags & IFF_UP) && + (p->if_drv_flags & IFF_DRV_RUNNING))) { m_freem(m); ifp->if_collisions++; continue; @@ -550,7 +550,7 @@ vlan_start(struct ifnet *ifp) else ifp->if_oerrors++; } - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } static void @@ -926,7 +926,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) vlan_unconfig(ifp); if (ifp->if_flags & IFF_UP) if_down(ifp); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; VLAN_UNLOCK(); break; } @@ -950,7 +950,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; } ifv->ifv_tag = vlr.vlr_tag; - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; VLAN_UNLOCK(); /* Update promiscuous mode, if necessary. */ diff --git a/sys/net/ppp_tty.c b/sys/net/ppp_tty.c index 51c11cf307ee..cd45438858d2 100644 --- a/sys/net/ppp_tty.c +++ b/sys/net/ppp_tty.c @@ -207,7 +207,7 @@ pppopen(dev, tp) sc->sc_setmtu = pppasyncsetmtu; sc->sc_outm = NULL; pppgetm(sc); - PPP2IFP(sc)->if_flags |= IFF_RUNNING; + PPP2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; getmicrotime(&PPP2IFP(sc)->if_lastchange); PPP2IFP(sc)->if_baudrate = tp->t_ospeed; diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index 0bb26315e134..db9439f47d9c 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -68,7 +68,8 @@ __FBSDID("$FreeBSD$"); #include <dev/wi/if_wavelan_ieee.h> #define IS_UP(_ic) \ - (((_ic)->ic_ifp->if_flags & (IFF_RUNNING|IFF_UP)) == (IFF_RUNNING|IFF_UP)) + (((_ic)->ic_ifp->if_flags & IFF_UP) && \ + ((_ic)->ic_ifp->if_drv_flags & IFF_DRV_RUNNING)) #define IS_UP_AUTO(_ic) \ (IS_UP(_ic) && (_ic)->ic_roaming == IEEE80211_ROAMING_AUTO) diff --git a/sys/netatm/atm_if.c b/sys/netatm/atm_if.c index f6f78b9c8b48..cc9cfb0a9133 100644 --- a/sys/netatm/atm_if.c +++ b/sys/netatm/atm_if.c @@ -518,7 +518,8 @@ atm_physif_ioctl(code, data, arg) if_initname(ifp, nip->nif_name, count); ifp->if_mtu = ATM_NIF_MTU; - ifp->if_flags = IFF_UP | IFF_BROADCAST | IFF_RUNNING; + ifp->if_flags = IFF_UP | IFF_BROADCAST; + ifp->if_drv_flags = IFF_DRV_RUNNING; ifp->if_output = atm_ifoutput; ifp->if_ioctl = atm_if_ioctl; ifp->if_snd.ifq_maxlen = ifqmaxlen; @@ -992,7 +993,8 @@ atm_if_ioctl(ifp, cmd, data) case SIOCSIFADDR: error = atm_nif_setaddr ( nip, (struct ifaddr *)data); - ifp->if_flags |= IFF_UP | IFF_RUNNING | IFF_BROADCAST; + ifp->if_flags |= IFF_UP | IFF_BROADCAST; + ifp->if_drv_flags |= IFF_DRV_RUNNING; break; case SIOCGIFFLAGS: diff --git a/sys/netgraph/ng_eiface.c b/sys/netgraph/ng_eiface.c index 7ca104f6c46f..6a21cbac50aa 100644 --- a/sys/netgraph/ng_eiface.c +++ b/sys/netgraph/ng_eiface.c @@ -147,13 +147,14 @@ ng_eiface_ioctl(struct ifnet *ifp, u_long command, caddr_t data) * If it is marked down and running, then stop it. */ if (ifr->ifr_flags & IFF_UP) { - if (!(ifp->if_flags & IFF_RUNNING)) { - ifp->if_flags &= ~(IFF_OACTIVE); - ifp->if_flags |= IFF_RUNNING; + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { + ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE); + ifp->if_drv_flags |= IFF_DRV_RUNNING; } } else { - if (ifp->if_flags & IFF_RUNNING) - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | + IFF_DRV_OACTIVE); } break; @@ -192,8 +193,8 @@ ng_eiface_init(void *xsc) s = splimp(); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; splx(s); } @@ -212,14 +213,16 @@ ng_eiface_start2(node_p node, hook_p hook, void *arg1, int arg2) struct mbuf *m; /* Check interface flags */ - if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) != (IFF_UP | IFF_RUNNING)) + + if (!((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING))) return; /* Don't do anything if output is active */ - if (ifp->if_flags & IFF_OACTIVE) + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; /* * Grab a packet to transmit. @@ -228,7 +231,7 @@ ng_eiface_start2(node_p node, hook_p hook, void *arg1, int arg2) /* If there's nothing to send, return. */ if (m == NULL) { - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; return; } @@ -254,7 +257,7 @@ ng_eiface_start2(node_p node, hook_p hook, void *arg1, int arg2) ifp->if_opackets++; } - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; return; } @@ -523,8 +526,8 @@ ng_eiface_rcvdata(hook_p hook, item_p item) NGI_GET_M(item, m); NG_FREE_ITEM(item); - if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) != - (IFF_UP | IFF_RUNNING)) { + if (!((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING))) { NG_FREE_M(m); return (ENETDOWN); } diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c index 21eb2d45f313..be6c76f7691a 100644 --- a/sys/netgraph/ng_ether.c +++ b/sys/netgraph/ng_ether.c @@ -601,7 +601,8 @@ ng_ether_rcv_lower(node_p node, struct mbuf *m) struct ifnet *const ifp = priv->ifp; /* Check whether interface is ready for packets */ - if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) { + if (!((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING))) { NG_FREE_M(m); return (ENETDOWN); } diff --git a/sys/netgraph/ng_fec.c b/sys/netgraph/ng_fec.c index 84b3e8f1b618..463aeb1053c3 100644 --- a/sys/netgraph/ng_fec.c +++ b/sys/netgraph/ng_fec.c @@ -637,7 +637,7 @@ ng_fec_tick(void *arg) } ifp = priv->ifp; - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) priv->fec_ch = timeout(ng_fec_tick, priv, hz); return; @@ -704,7 +704,7 @@ ng_fec_ioctl(struct ifnet *ifp, u_long command, caddr_t data) * If it is marked down and running, then stop it. */ if (ifr->ifr_flags & IFF_UP) { - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { /* Sanity. */ if (b->fec_ifcnt == 1 || b->fec_ifcnt == 3) { printf("fec%d: invalid bundle " @@ -713,8 +713,8 @@ ng_fec_ioctl(struct ifnet *ifp, u_long command, caddr_t data) error = EINVAL; break; } - ifp->if_flags &= ~(IFF_OACTIVE); - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE); + ifp->if_drv_flags |= IFF_DRV_RUNNING; ng_fec_init(ifp); } /* @@ -727,8 +727,9 @@ ng_fec_ioctl(struct ifnet *ifp, u_long command, caddr_t data) priv->if_flags = ifp->if_flags; } } else { - if (ifp->if_flags & IFF_RUNNING) - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | + IFF_DRV_OACTIVE); ng_fec_stop(ifp); } break; @@ -834,7 +835,8 @@ ng_fec_output(struct ifnet *ifp, struct mbuf *m, int error; /* Check interface flags */ - if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) { + if (!((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING))) { m_freem(m); return (ENETDOWN); } diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c index b7c2314d0c74..34526851d505 100644 --- a/sys/netgraph/ng_iface.c +++ b/sys/netgraph/ng_iface.c @@ -290,8 +290,9 @@ ng_iface_ioctl(struct ifnet *ifp, u_long command, caddr_t data) /* These two are mostly handled at a higher layer */ case SIOCSIFADDR: - ifp->if_flags |= (IFF_UP | IFF_RUNNING); - ifp->if_flags &= ~(IFF_OACTIVE); + ifp->if_flags |= IFF_UP; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE); break; case SIOCGIFADDR: break; @@ -303,13 +304,14 @@ ng_iface_ioctl(struct ifnet *ifp, u_long command, caddr_t data) * If it is marked down and running, then stop it. */ if (ifr->ifr_flags & IFF_UP) { - if (!(ifp->if_flags & IFF_RUNNING)) { - ifp->if_flags &= ~(IFF_OACTIVE); - ifp->if_flags |= IFF_RUNNING; + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { + ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE); + ifp->if_drv_flags |= IFF_DRV_RUNNING; } } else { - if (ifp->if_flags & IFF_RUNNING) - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | + IFF_DRV_OACTIVE); } break; @@ -355,7 +357,8 @@ ng_iface_output(struct ifnet *ifp, struct mbuf *m, u_int32_t af; /* Check interface flags */ - if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) { + if (!((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING))) { m_freem(m); return (ENETDOWN); } @@ -628,10 +631,10 @@ ng_iface_rcvmsg(node_p node, item_p item, hook_p lasthook) case NGM_FLOW_COOKIE: switch (msg->header.cmd) { case NGM_LINK_IS_UP: - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; break; case NGM_LINK_IS_DOWN: - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; break; default: break; diff --git a/sys/netgraph/ng_sppp.c b/sys/netgraph/ng_sppp.c index aeee31d60c4b..dc96acfd195f 100644 --- a/sys/netgraph/ng_sppp.c +++ b/sys/netgraph/ng_sppp.c @@ -205,17 +205,18 @@ ng_sppp_start (struct ifnet *ifp) * are not UP. If we are not running we still want to send LCP term * packets. */ -/* if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) {*/ +/* if (!((ifp->if_flags & IFF_UP) && */ +/* (ifp->if_drv_flags & IFF_DRV_RUNNING))) { */ /* return;*/ /* }*/ - if (ifp->if_flags & IFF_OACTIVE) + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; if (!priv->hook) return; - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; while ((m = sppp_dequeue (ifp)) != NULL) { if (ifp->if_bpf) @@ -225,11 +226,11 @@ ng_sppp_start (struct ifnet *ifp) NG_SEND_DATA_ONLY (error, priv->hook, m); if (error) { - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; return; } } - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } /************************************************************************ diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 52e003b3fdce..606bf1c93179 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -628,8 +628,8 @@ carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af) if (sc->sc_vhid == ch->carp_vhid) break; - if (!sc || (SC2IFP(sc)->if_flags & (IFF_UP|IFF_RUNNING)) != - (IFF_UP|IFF_RUNNING)) { + if (!sc || !((SC2IFP(sc)->if_flags & IFF_UP) && + (SC2IFP(sc)->if_drv_flags & IFF_DRV_RUNNING))) { carpstats.carps_badvhid++; CARP_UNLOCK(ifp->if_carp); m_freem(m); @@ -828,7 +828,8 @@ carp_send_ad_all(void) if (sc->sc_carpdev == NULL) continue; CARP_SCLOCK(sc); - if ((SC2IFP(sc)->if_flags & (IFF_UP|IFF_RUNNING)) && + if ((SC2IFP(sc)->if_flags & IFF_UP) && + (SC2IFP(sc)->if_drv_flags & IFF_DRV_RUNNING) && sc->sc_state == MASTER) carp_send_ad_locked(sc); CARP_SCUNLOCK(sc); @@ -858,8 +859,8 @@ carp_send_ad_locked(struct carp_softc *sc) CARP_SCLOCK_ASSERT(sc); /* bow out if we've lost our UPness or RUNNINGuiness */ - if ((SC2IFP(sc)->if_flags & - (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) { + if (!((SC2IFP(sc)->if_flags & IFF_UP) && + (SC2IFP(sc)->if_drv_flags & IFF_DRV_RUNNING))) { advbase = 255; advskew = 255; } else { @@ -1086,8 +1087,8 @@ carp_addrcount(struct carp_if *cif, struct in_ifaddr *ia, int type) TAILQ_FOREACH(vh, &cif->vhif_vrs, sc_list) { if ((type == CARP_COUNT_RUNNING && - (SC2IFP(vh)->if_flags & (IFF_UP|IFF_RUNNING)) == - (IFF_UP|IFF_RUNNING)) || + (SC2IFP(vh)->if_flags & IFF_UP) && + (SC2IFP(vh)->if_drv_flags & IFF_DRV_RUNNING)) || (type == CARP_COUNT_MASTER && vh->sc_state == MASTER)) { TAILQ_FOREACH(ifa, &SC2IFP(vh)->if_addrlist, ifa_list) { @@ -1132,8 +1133,8 @@ carp_iamatch(void *v, struct in_ifaddr *ia, count = 0; TAILQ_FOREACH(vh, &cif->vhif_vrs, sc_list) { - if ((SC2IFP(vh)->if_flags & (IFF_UP|IFF_RUNNING)) == - (IFF_UP|IFF_RUNNING)) { + if ((SC2IFP(vh)->if_flags & IFF_UP) && + (SC2IFP(vh)->if_drv_flags & IFF_DRV_RUNNING)) { TAILQ_FOREACH(ifa, &SC2IFP(vh)->if_addrlist, ifa_list) { if (ifa->ifa_addr->sa_family == @@ -1158,9 +1159,9 @@ carp_iamatch(void *v, struct in_ifaddr *ia, } } else { TAILQ_FOREACH(vh, &cif->vhif_vrs, sc_list) { - if ((SC2IFP(vh)->if_flags & (IFF_UP|IFF_RUNNING)) == - (IFF_UP|IFF_RUNNING) && ia->ia_ifp == - SC2IFP(vh)) { + if ((SC2IFP(vh)->if_flags & IFF_UP) && + (SC2IFP(vh)->if_drv_flags & IFF_DRV_RUNNING) && + ia->ia_ifp == SC2IFP(vh)) { *enaddr = IFP2ENADDR(vh->sc_ifp); CARP_UNLOCK(cif); return (1); @@ -1184,8 +1185,8 @@ carp_iamatch6(void *v, struct in6_addr *taddr) TAILQ_FOREACH(ifa, &SC2IFP(vh)->if_addrlist, ifa_list) { if (IN6_ARE_ADDR_EQUAL(taddr, &ifatoia6(ifa)->ia_addr.sin6_addr) && - ((SC2IFP(vh)->if_flags & - (IFF_UP|IFF_RUNNING)) == (IFF_UP|IFF_RUNNING))) { + (SC2IFP(vh)->if_flags & IFF_UP) && + (SC2IFP(vh)->if_drv_flags & IFF_DRV_RUNNING)) { CARP_UNLOCK(cif); return (ifa); } @@ -1209,8 +1210,8 @@ carp_macmatch6(void *v, struct mbuf *m, const struct in6_addr *taddr) TAILQ_FOREACH(ifa, &SC2IFP(sc)->if_addrlist, ifa_list) { if (IN6_ARE_ADDR_EQUAL(taddr, &ifatoia6(ifa)->ia_addr.sin6_addr) && - ((SC2IFP(sc)->if_flags & - (IFF_UP|IFF_RUNNING)) == (IFF_UP|IFF_RUNNING))) { + (SC2IFP(sc)->if_flags & IFF_UP) && + (SC2IFP(sc)->if_drv_flags & IFF_DRV_RUNNING)) { struct ifnet *ifp = SC2IFP(sc); mtag = m_tag_get(PACKET_TAG_CARP, sizeof(struct ifnet *), M_NOWAIT); @@ -1246,8 +1247,9 @@ carp_forus(void *v, void *dhost) CARP_LOCK(cif); TAILQ_FOREACH(vh, &cif->vhif_vrs, sc_list) - if ((SC2IFP(vh)->if_flags & (IFF_UP|IFF_RUNNING)) == - (IFF_UP|IFF_RUNNING) && vh->sc_state == MASTER && + if ((SC2IFP(vh)->if_flags & IFF_UP) && + (SC2IFP(vh)->if_drv_flags & IFF_DRV_RUNNING) && + vh->sc_state == MASTER && !bcmp(dhost, IFP2ENADDR(vh->sc_ifp), ETHER_ADDR_LEN)) { CARP_UNLOCK(cif); return (SC2IFP(vh)); @@ -1307,9 +1309,9 @@ carp_setrun(struct carp_softc *sc, sa_family_t af) if (SC2IFP(sc)->if_flags & IFF_UP && sc->sc_vhid > 0 && (sc->sc_naddrs || sc->sc_naddrs6)) - SC2IFP(sc)->if_flags |= IFF_RUNNING; + SC2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; else { - SC2IFP(sc)->if_flags &= ~IFF_RUNNING; + SC2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; carp_setroute(sc, RTM_DELETE); return; } @@ -1511,7 +1513,8 @@ carp_del_addr(struct carp_softc *sc, struct sockaddr_in *sin) CARP_LOCK(cif); callout_stop(&sc->sc_ad_tmo); - SC2IFP(sc)->if_flags &= ~(IFF_UP|IFF_RUNNING); + SC2IFP(sc)->if_flags &= ~IFF_UP; + SC2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; sc->sc_vhid = -1; in_delmulti(imo->imo_membership[--imo->imo_num_memberships]); imo->imo_multicast_ifp = NULL; @@ -1700,7 +1703,8 @@ carp_del_addr6(struct carp_softc *sc, struct sockaddr_in6 *sin6) CARP_LOCK(cif); callout_stop(&sc->sc_ad_tmo); - SC2IFP(sc)->if_flags &= ~(IFF_UP|IFF_RUNNING); + SC2IFP(sc)->if_flags &= ~IFF_UP; + SC2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; sc->sc_vhid = -1; while (!LIST_EMPTY(&im6o->im6o_memberships)) { struct in6_multi_mship *imm = @@ -2096,7 +2100,8 @@ carp_sc_state_locked(struct carp_softc *sc) if (sc->sc_carpdev->if_link_state != LINK_STATE_UP || !(sc->sc_carpdev->if_flags & IFF_UP)) { sc->sc_flags_backup = SC2IFP(sc)->if_flags; - SC2IFP(sc)->if_flags &= ~(IFF_UP|IFF_RUNNING); + SC2IFP(sc)->if_flags &= ~IFF_UP; + SC2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; callout_stop(&sc->sc_ad_tmo); callout_stop(&sc->sc_md_tmo); callout_stop(&sc->sc_md6_tmo); diff --git a/sys/netinet/ip_fastfwd.c b/sys/netinet/ip_fastfwd.c index b40d5509168e..6c5f669311f2 100644 --- a/sys/netinet/ip_fastfwd.c +++ b/sys/netinet/ip_fastfwd.c @@ -129,7 +129,7 @@ ip_findroute(struct route *ro, struct in_addr dest, struct mbuf *m) rt = ro->ro_rt; if (rt && (rt->rt_flags & RTF_UP) && (rt->rt_ifp->if_flags & IFF_UP) && - (rt->rt_ifp->if_flags & IFF_RUNNING)) { + (rt->rt_ifp->if_drv_flags & IFF_DRV_RUNNING)) { if (rt->rt_flags & RTF_GATEWAY) dst = (struct sockaddr_in *)rt->rt_gateway; } else { diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index a123a7c13f75..a5a7d046606b 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1993,8 +1993,8 @@ in6if_do_dad(ifp) * XXX: we should rather mark "tentative" on such addresses, * and do DAD after the interface becomes ready. */ - if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != - (IFF_UP|IFF_RUNNING)) + if (!((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING))) return (0); return (1); diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index 4a4930200424..4af0f1a8be5d 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -1371,7 +1371,7 @@ nd6_dad_ns_output(dp, ifa) #endif return; } - if ((ifp->if_flags & IFF_RUNNING) == 0) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { #if 0 printf("%s: interface not running?\n", if_name(ifp)); #endif diff --git a/sys/netnatm/natm.c b/sys/netnatm/natm.c index 4dc75b29593d..ae0ecd4637f8 100644 --- a/sys/netnatm/natm.c +++ b/sys/netnatm/natm.c @@ -178,7 +178,7 @@ natm_usr_connect(struct socket *so, struct sockaddr *nam, d_thread_t *p) * convert interface string to ifp, validate. */ ifp = ifunit(snatm->snatm_if); - if (ifp == NULL || (ifp->if_flags & IFF_RUNNING) == 0) { + if (ifp == NULL || (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { error = ENXIO; goto out; } diff --git a/sys/pci/if_dc.c b/sys/pci/if_dc.c index 7fd956812523..b1ef62aef091 100644 --- a/sys/pci/if_dc.c +++ b/sys/pci/if_dc.c @@ -1330,7 +1330,7 @@ dc_setfilt_xircom(struct dc_softc *sc) DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_TX_ON); DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_ON); - ifp->if_flags |= IFF_RUNNING; + ifp->if_drv_flags |= IFF_DRV_RUNNING; sframe->dc_status = htole32(DC_TXSTAT_OWN); CSR_WRITE_4(sc, DC_TXSTART, 0xFFFFFFFF); @@ -2908,7 +2908,7 @@ dc_txeof(struct dc_softc *sc) if (idx != sc->dc_cdata.dc_tx_cons) { /* Some buffers have been freed. */ sc->dc_cdata.dc_tx_cons = idx; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } ifp->if_timer = (sc->dc_cdata.dc_tx_cnt == 0) ? 0 : 5; } @@ -3057,7 +3057,8 @@ dc_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) sc->rxcycles = count; dc_rxeof(sc); dc_txeof(sc); - if (!IFQ_IS_EMPTY(&ifp->if_snd) && !(ifp->if_flags & IFF_OACTIVE)) + if (!IFQ_IS_EMPTY(&ifp->if_snd) && + !(ifp->if_drv_flags & IFF_DRV_OACTIVE)) dc_start(ifp); if (cmd == POLL_AND_CHECK_STATUS) { /* also check status register */ @@ -3328,7 +3329,7 @@ dc_start(struct ifnet *ifp) return; } - if (ifp->if_flags & IFF_OACTIVE) { + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { DC_UNLOCK(sc); return; } @@ -3346,7 +3347,7 @@ dc_start(struct ifnet *ifp) m = m_defrag(m_head, M_DONTWAIT); if (m == NULL) { IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } else { m_head = m; @@ -3355,7 +3356,7 @@ dc_start(struct ifnet *ifp) if (dc_encap(sc, &m_head)) { IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } idx = sc->dc_cdata.dc_tx_prod; @@ -3368,7 +3369,7 @@ dc_start(struct ifnet *ifp) BPF_MTAP(ifp, m_head); if (sc->dc_flags & DC_TX_ONE) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } } @@ -3550,8 +3551,8 @@ dc_init(void *xsc) mii_mediachg(mii); dc_setcfg(sc, sc->dc_if_media); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* Don't start the ticker if this is a homePNA link. */ if (IFM_SUBTYPE(mii->mii_media.ifm_media) == IFM_HPNA_1) @@ -3640,7 +3641,7 @@ dc_ioctl(struct ifnet *ifp, u_long command, caddr_t data) int need_setfilt = (ifp->if_flags ^ sc->dc_if_flags) & (IFF_PROMISC | IFF_ALLMULTI); - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { if (need_setfilt) dc_setfilt(sc); } else { @@ -3648,7 +3649,7 @@ dc_ioctl(struct ifnet *ifp, u_long command, caddr_t data) dc_init(sc); } } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) dc_stop(sc); } sc->dc_if_flags = ifp->if_flags; @@ -3726,7 +3727,7 @@ dc_stop(struct dc_softc *sc) callout_stop(&sc->dc_stat_ch); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); #ifdef DEVICE_POLLING ether_poll_deregister(ifp); #endif diff --git a/sys/pci/if_de.c b/sys/pci/if_de.c index 421d1aa38aaa..d786abe2c1f8 100644 --- a/sys/pci/if_de.c +++ b/sys/pci/if_de.c @@ -308,7 +308,7 @@ tulip_linkup( if ((sc->tulip_flags & TULIP_LINKUP) == 0) sc->tulip_flags |= TULIP_PRINTLINKUP; sc->tulip_flags |= TULIP_LINKUP; - sc->tulip_ifp->if_flags &= ~IFF_OACTIVE; + sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; #if 0 /* XXX how does with work with ifmedia? */ if ((sc->tulip_flags & TULIP_DIDNWAY) == 0) { if (sc->tulip_ifp->if_flags & IFF_FULLDUPLEX) { @@ -606,7 +606,7 @@ tulip_media_poll( } if (event == TULIP_MEDIAPOLL_START) { - sc->tulip_ifp->if_flags |= IFF_OACTIVE; + sc->tulip_ifp->if_drv_flags |= IFF_DRV_OACTIVE; if (sc->tulip_probe_state != TULIP_PROBE_INACTIVE) return; sc->tulip_probe_mediamask = 0; @@ -778,7 +778,7 @@ tulip_media_poll( if (++sc->tulip_probe_passes == 3) { if_printf(ifp, "autosense failed: cable problem?\n"); if ((sc->tulip_ifp->if_flags & IFF_UP) == 0) { - sc->tulip_ifp->if_flags &= ~IFF_RUNNING; + sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sc->tulip_probe_state = TULIP_PROBE_INACTIVE; return; } @@ -1027,7 +1027,7 @@ tulip_21041_media_poll( * restart the probe (and reset the tulip to a known state). */ if (event == TULIP_MEDIAPOLL_START) { - sc->tulip_ifp->if_flags |= IFF_OACTIVE; + sc->tulip_ifp->if_drv_flags |= IFF_DRV_OACTIVE; sc->tulip_cmdmode &= ~(TULIP_CMD_FULLDUPLEX|TULIP_CMD_RXRUN); #ifdef notyet if (sc->tulip_revinfo >= 0x20) { @@ -1134,7 +1134,7 @@ tulip_21041_media_poll( if_printf(sc->tulip_ifp, "autosense failed: cable problem?\n"); if ((sc->tulip_ifp->if_flags & IFF_UP) == 0) { - sc->tulip_ifp->if_flags &= ~IFF_RUNNING; + sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sc->tulip_probe_state = TULIP_PROBE_INACTIVE; return; } @@ -1354,7 +1354,8 @@ tulip_mii_autonegotiate( ifp->if_xname, phyaddr); sc->tulip_flags &= ~TULIP_TXPROBE_ACTIVE; sc->tulip_probe_state = TULIP_PROBE_FAILED; - sc->tulip_ifp->if_flags &= ~(IFF_UP|IFF_RUNNING); + sc->tulip_ifp->if_flags &= ~IFF_UP; + sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; return; } status = tulip_mii_readreg(sc, phyaddr, PHYREG_STATUS); @@ -3184,7 +3185,7 @@ tulip_reset( if (!inreset) { sc->tulip_flags |= TULIP_INRESET; sc->tulip_flags &= ~(TULIP_NEEDRESET|TULIP_RXBUFSLOW); - sc->tulip_ifp->if_flags &= ~IFF_OACTIVE; + sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } #if defined(TULIP_BUS_DMA) && !defined(TULIP_BUS_DMA_NOTX) @@ -3318,11 +3319,11 @@ tulip_init( tulip_softc_t * const sc) { if (sc->tulip_ifp->if_flags & IFF_UP) { - if ((sc->tulip_ifp->if_flags & IFF_RUNNING) == 0) { + if ((sc->tulip_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { /* initialize the media */ tulip_reset(sc); } - sc->tulip_ifp->if_flags |= IFF_RUNNING; + sc->tulip_ifp->if_drv_flags |= IFF_DRV_RUNNING; if (sc->tulip_ifp->if_flags & IFF_PROMISC) { sc->tulip_flags |= TULIP_PROMISC; sc->tulip_cmdmode |= TULIP_CMD_PROMISCUOUS; @@ -3342,7 +3343,7 @@ tulip_init( sc->tulip_cmdmode |= TULIP_CMD_RXRUN; sc->tulip_intrmask |= TULIP_STS_RXSTOPPED; } else { - sc->tulip_ifp->if_flags |= IFF_OACTIVE; + sc->tulip_ifp->if_drv_flags |= IFF_DRV_OACTIVE; sc->tulip_cmdmode &= ~TULIP_CMD_RXRUN; sc->tulip_intrmask &= ~TULIP_STS_RXSTOPPED; } @@ -3351,7 +3352,7 @@ tulip_init( if ((sc->tulip_flags & (TULIP_WANTSETUP|TULIP_TXPROBE_ACTIVE)) == TULIP_WANTSETUP) tulip_txput_setup(sc); } else { - sc->tulip_ifp->if_flags &= ~IFF_RUNNING; + sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; tulip_reset(sc); } } @@ -3774,7 +3775,7 @@ tulip_tx_intr( ri->ri_nextin = ri->ri_first; if ((sc->tulip_flags & TULIP_TXPROBE_ACTIVE) == 0) - sc->tulip_ifp->if_flags &= ~IFF_OACTIVE; + sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } /* * If nothing left to transmit, disable the timer. @@ -4280,7 +4281,7 @@ tulip_txput( if (sc->tulip_flags & TULIP_TXPROBE_ACTIVE) { TULIP_CSR_WRITE(sc, csr_txpoll, 1); - sc->tulip_ifp->if_flags |= IFF_OACTIVE; + sc->tulip_ifp->if_drv_flags |= IFF_DRV_OACTIVE; TULIP_PERFEND(txput); return NULL; } @@ -4309,7 +4310,7 @@ tulip_txput( sc->tulip_dbg.dbg_txput_finishes[6]++; #endif if (sc->tulip_flags & (TULIP_WANTTXSTART|TULIP_DOINGSETUP)) { - sc->tulip_ifp->if_flags |= IFF_OACTIVE; + sc->tulip_ifp->if_drv_flags |= IFF_DRV_OACTIVE; if ((sc->tulip_intrmask & TULIP_STS_TXINTR) == 0) { sc->tulip_intrmask |= TULIP_STS_TXINTR; TULIP_CSR_WRITE(sc, csr_intr, sc->tulip_intrmask); @@ -4494,7 +4495,7 @@ tulip_ifstart( TULIP_PERFSTART(ifstart) tulip_softc_t * const sc = (tulip_softc_t *)ifp->if_softc; - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { TULIP_LOCK(sc); tulip_start(sc); TULIP_UNLOCK(sc); diff --git a/sys/pci/if_pcn.c b/sys/pci/if_pcn.c index c61f12da58cc..1dea7f4ee5be 100644 --- a/sys/pci/if_pcn.c +++ b/sys/pci/if_pcn.c @@ -909,7 +909,7 @@ pcn_txeof(sc) if (idx != sc->pcn_cdata.pcn_tx_cons) { /* Some buffers have been freed. */ sc->pcn_cdata.pcn_tx_cons = idx; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } ifp->if_timer = (sc->pcn_cdata.pcn_tx_cnt == 0) ? 0 : 5; @@ -927,7 +927,7 @@ pcn_tick(xsc) sc = xsc; ifp = sc->pcn_ifp; PCN_LOCK(sc); - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { PCN_UNLOCK(sc); return; } @@ -1087,7 +1087,7 @@ pcn_start_locked(ifp) idx = sc->pcn_cdata.pcn_tx_prod; - if (ifp->if_flags & IFF_OACTIVE) + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; while(sc->pcn_cdata.pcn_tx_chain[idx] == NULL) { @@ -1097,7 +1097,7 @@ pcn_start_locked(ifp) if (pcn_encap(sc, m_head, &idx)) { IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } @@ -1254,8 +1254,8 @@ pcn_init_locked(sc) mii_mediachg(mii); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; callout_reset(&sc->pcn_stat_callout, hz, pcn_tick, sc); @@ -1326,7 +1326,7 @@ pcn_ioctl(ifp, command, data) case SIOCSIFFLAGS: PCN_LOCK(sc); if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->pcn_if_flags & IFF_PROMISC)) { PCN_CSR_SETBIT(sc, PCN_CSR_EXTCTL1, @@ -1336,7 +1336,7 @@ pcn_ioctl(ifp, command, data) PCN_EXTCTL1_SPND); pcn_csr_write(sc, PCN_CSR_CSR, PCN_CSR_INTEN|PCN_CSR_START); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->pcn_if_flags & IFF_PROMISC) { PCN_CSR_SETBIT(sc, PCN_CSR_EXTCTL1, @@ -1346,10 +1346,10 @@ pcn_ioctl(ifp, command, data) PCN_EXTCTL1_SPND); pcn_csr_write(sc, PCN_CSR_CSR, PCN_CSR_INTEN|PCN_CSR_START); - } else if (!(ifp->if_flags & IFF_RUNNING)) + } else if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) pcn_init_locked(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) pcn_stop(sc); } sc->pcn_if_flags = ifp->if_flags; @@ -1449,7 +1449,7 @@ pcn_stop(sc) bzero((char *)&sc->pcn_ldata->pcn_tx_list, sizeof(sc->pcn_ldata->pcn_tx_list)); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); return; } diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c index 8d27fb328745..56350351d4d2 100644 --- a/sys/pci/if_rl.c +++ b/sys/pci/if_rl.c @@ -1266,7 +1266,7 @@ rl_txeof(struct rl_softc *sc) return; } RL_INC(sc->rl_cdata.last_tx); - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } while (sc->rl_cdata.last_tx != sc->rl_cdata.cur_tx); if (RL_LAST_TXMBUF(sc) == NULL) @@ -1499,7 +1499,7 @@ rl_start_locked(struct ifnet *ifp) * packets from the queue. */ if (RL_CUR_TXMBUF(sc) != NULL) - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; } static void @@ -1607,8 +1607,8 @@ rl_init_locked(struct rl_softc *sc) CSR_WRITE_1(sc, RL_CFG1, RL_CFG1_DRVLOAD|RL_CFG1_FULLDUPLEX); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->rl_stat_ch = timeout(rl_tick, sc, hz); } @@ -1659,7 +1659,7 @@ rl_ioctl(struct ifnet *ifp, u_long command, caddr_t data) if (ifp->if_flags & IFF_UP) { rl_init_locked(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) rl_stop(sc); } RL_UNLOCK(sc); @@ -1720,7 +1720,7 @@ rl_stop(struct rl_softc *sc) ifp->if_timer = 0; untimeout(rl_tick, sc, sc->rl_stat_ch); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); #ifdef DEVICE_POLLING ether_poll_deregister(ifp); #endif /* DEVICE_POLLING */ diff --git a/sys/pci/if_sf.c b/sys/pci/if_sf.c index 5485fb7e6cfe..e166b9391a28 100644 --- a/sys/pci/if_sf.c +++ b/sys/pci/if_sf.c @@ -512,18 +512,18 @@ sf_ioctl(ifp, command, data) switch(command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->sf_if_flags & IFF_PROMISC)) { SF_SETBIT(sc, SF_RXFILT, SF_RXFILT_PROMISC); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->sf_if_flags & IFF_PROMISC) { SF_CLRBIT(sc, SF_RXFILT, SF_RXFILT_PROMISC); - } else if (!(ifp->if_flags & IFF_RUNNING)) + } else if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) sf_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) sf_stop(sc); } sc->sf_if_flags = ifp->if_flags; @@ -1013,7 +1013,7 @@ sf_txeof(sc) } ifp->if_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; csr_write_4(sc, SF_CQ_CONSIDX, (txcons & ~SF_CQ_CONSIDX_TXQ) | @@ -1286,8 +1286,8 @@ sf_init(xsc) /*mii_mediachg(mii);*/ sf_ifmedia_upd(ifp); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->sf_stat_ch = timeout(sf_stats_update, sc, hz); @@ -1375,7 +1375,7 @@ sf_start(ifp) return; } - if (ifp->if_flags & IFF_OACTIVE) { + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { SF_UNLOCK(sc); return; } @@ -1392,7 +1392,7 @@ sf_start(ifp) while(sc->sf_ldata->sf_tx_dlist[i].sf_mbuf == NULL) { if (sc->sf_tx_cnt >= (SF_TX_DLIST_CNT - 5)) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; cur_tx = NULL; break; } @@ -1403,7 +1403,7 @@ sf_start(ifp) cur_tx = &sc->sf_ldata->sf_tx_dlist[i]; if (sf_encap(sc, cur_tx, m_head)) { IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; cur_tx = NULL; break; } @@ -1482,7 +1482,7 @@ sf_stop(sc) } } - ifp->if_flags &= ~(IFF_RUNNING|IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING|IFF_DRV_OACTIVE); SF_UNLOCK(sc); } diff --git a/sys/pci/if_sis.c b/sys/pci/if_sis.c index 48a613275ace..469ab0202992 100644 --- a/sys/pci/if_sis.c +++ b/sys/pci/if_sis.c @@ -1551,7 +1551,7 @@ sis_txeof(struct sis_softc *sc) if (idx != sc->sis_tx_cons) { /* we freed up some buffers */ sc->sis_tx_cons = idx; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } ifp->if_timer = (sc->sis_tx_cnt == 0) ? 0 : 5; @@ -1815,7 +1815,7 @@ sis_startl(struct ifnet *ifp) idx = sc->sis_tx_prod; - if (ifp->if_flags & IFF_OACTIVE) + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; while(sc->sis_tx_list[idx].sis_mbuf == NULL) { @@ -1825,7 +1825,7 @@ sis_startl(struct ifnet *ifp) if (sis_encap(sc, &m_head, &idx)) { IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } @@ -2068,8 +2068,8 @@ sis_initl(struct sis_softc *sc) mii_mediachg(mii); #endif - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (!sc->in_tick) callout_reset(&sc->sis_stat_ch, hz, sis_tick, sc); @@ -2127,7 +2127,7 @@ sis_ioctl(struct ifnet *ifp, u_long command, caddr_t data) case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { sis_init(sc); - } else if (ifp->if_flags & IFF_RUNNING) { + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { SIS_LOCK(sc); sis_stop(sc); SIS_UNLOCK(sc); @@ -2208,7 +2208,7 @@ sis_stop(struct sis_softc *sc) callout_stop(&sc->sis_stat_ch); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); #ifdef DEVICE_POLLING ether_poll_deregister(ifp); #endif diff --git a/sys/pci/if_sk.c b/sys/pci/if_sk.c index 0daf42e543f4..65b3a5f90aa4 100644 --- a/sys/pci/if_sk.c +++ b/sys/pci/if_sk.c @@ -1244,14 +1244,14 @@ sk_ioctl(ifp, command, data) error = EINVAL; else { ifp->if_mtu = ifr->ifr_mtu; - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sk_init(sc_if); } break; case SIOCSIFFLAGS: SK_IF_LOCK(sc_if); if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { if ((ifp->if_flags ^ sc_if->sk_if_flags) & IFF_PROMISC) { sk_setpromisc(sc_if); @@ -1260,7 +1260,7 @@ sk_ioctl(ifp, command, data) } else sk_init(sc_if); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) sk_stop(sc_if); } sc_if->sk_if_flags = ifp->if_flags; @@ -1269,7 +1269,7 @@ sk_ioctl(ifp, command, data) break; case SIOCADDMULTI: case SIOCDELMULTI: - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { SK_IF_LOCK(sc_if); sk_setmulti(sc_if); SK_IF_UNLOCK(sc_if); @@ -2052,7 +2052,7 @@ sk_start(ifp) */ if (sk_encap(sc_if, m_head, &idx)) { IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } @@ -2086,7 +2086,7 @@ sk_watchdog(ifp) sc_if = ifp->if_softc; printf("sk%d: watchdog timeout\n", sc_if->sk_unit); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sk_init(sc_if); return; @@ -2221,7 +2221,7 @@ sk_txeof(sc_if) CSR_WRITE_4(sc, sc_if->sk_tx_bmu, SK_TXBMU_TX_START); if (sc_if->sk_cdata.sk_tx_cnt < SK_TX_RING_CNT - 2) - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc_if->sk_cdata.sk_tx_cons = idx; } @@ -2297,7 +2297,7 @@ sk_intr_bcom(sc_if) */ status = sk_xmac_miibus_readreg(sc_if, SK_PHYADDR_BCOM, BRGPHY_MII_ISR); - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { sk_init_xmac(sc_if); return; } @@ -2429,14 +2429,16 @@ sk_intr(xsc) } /* Then MAC interrupts. */ - if (status & SK_ISR_MAC1 && ifp0->if_flags & IFF_RUNNING) { + if (status & SK_ISR_MAC1 && + ifp0->if_drv_flags & IFF_DRV_RUNNING) { if (sc->sk_type == SK_GENESIS) sk_intr_xmac(sc_if0); else sk_intr_yukon(sc_if0); } - if (status & SK_ISR_MAC2 && ifp1->if_flags & IFF_RUNNING) { + if (status & SK_ISR_MAC2 && + ifp1->if_drv_flags & IFF_DRV_RUNNING) { if (sc->sk_type == SK_GENESIS) sk_intr_xmac(sc_if1); else @@ -2760,7 +2762,7 @@ sk_init(xsc) sc = sc_if->sk_softc; mii = device_get_softc(sc_if->sk_miibus); - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { SK_IF_UNLOCK(sc_if); return; } @@ -2889,8 +2891,8 @@ sk_init(xsc) SK_YU_WRITE_2(sc_if, YUKON_GPCR, reg); } - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; SK_IF_UNLOCK(sc_if); @@ -2975,7 +2977,7 @@ sk_stop(sc_if) } } - ifp->if_flags &= ~(IFF_RUNNING|IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING|IFF_DRV_OACTIVE); SK_IF_UNLOCK(sc_if); return; } diff --git a/sys/pci/if_ste.c b/sys/pci/if_ste.c index 8e73f65667cf..55a4b0e8f5ea 100644 --- a/sys/pci/if_ste.c +++ b/sys/pci/if_ste.c @@ -901,7 +901,7 @@ ste_txeof(sc) m_freem(cur_tx->ste_mbuf); cur_tx->ste_mbuf = NULL; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_opackets++; STE_INC(idx, STE_TX_LIST_CNT); @@ -1376,8 +1376,8 @@ ste_init(xsc) ste_ifmedia_upd(ifp); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->ste_stat_ch = timeout(ste_stats_update, sc, hz); STE_UNLOCK(sc); @@ -1396,7 +1396,7 @@ ste_stop(sc) ifp = sc->ste_ifp; untimeout(ste_stats_update, sc, sc->ste_stat_ch); - ifp->if_flags &= ~(IFF_RUNNING|IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING|IFF_DRV_OACTIVE); #ifdef DEVICE_POLLING ether_poll_deregister(ifp); #endif /* DEVICE_POLLING */ @@ -1480,26 +1480,26 @@ ste_ioctl(ifp, command, data) switch(command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->ste_if_flags & IFF_PROMISC)) { STE_SETBIT1(sc, STE_RX_MODE, STE_RXMODE_PROMISC); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->ste_if_flags & IFF_PROMISC) { STE_CLRBIT1(sc, STE_RX_MODE, STE_RXMODE_PROMISC); } - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && (ifp->if_flags ^ sc->ste_if_flags) & IFF_ALLMULTI) ste_setmulti(sc); - if (!(ifp->if_flags & IFF_RUNNING)) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { sc->ste_tx_thresh = STE_TXSTART_THRESH; ste_init(sc); } } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) ste_stop(sc); } sc->ste_if_flags = ifp->if_flags; @@ -1596,7 +1596,7 @@ ste_start(ifp) return; } - if (ifp->if_flags & IFF_OACTIVE) { + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { STE_UNLOCK(sc); return; } @@ -1610,7 +1610,7 @@ ste_start(ifp) */ if (STE_NEXT(idx, STE_TX_LIST_CNT) == sc->ste_cdata.ste_tx_cons) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } diff --git a/sys/pci/if_ti.c b/sys/pci/if_ti.c index 5ce58c555a78..bef01aecf63c 100644 --- a/sys/pci/if_ti.c +++ b/sys/pci/if_ti.c @@ -2594,7 +2594,7 @@ ti_txeof(sc) } if (cur_tx != NULL) - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } static void @@ -2620,7 +2620,7 @@ ti_intr(xsc) /* Ack interrupt and stop others from occuring. */ CSR_WRITE_4(sc, TI_MB_HOSTINTR, 1); - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* Check RX return ring producer/consumer */ ti_rxeof(sc); @@ -2633,7 +2633,8 @@ ti_intr(xsc) /* Re-enable interrupts. */ CSR_WRITE_4(sc, TI_MB_HOSTINTR, 0); - if (ifp->if_flags & IFF_RUNNING && ifp->if_snd.ifq_head != NULL) + if (ifp->if_drv_flags & IFF_DRV_RUNNING && + ifp->if_snd.ifq_head != NULL) ti_start(ifp); TI_UNLOCK(sc); @@ -2789,7 +2790,7 @@ ti_start(ifp) if ((TI_TX_RING_CNT - sc->ti_txcnt) < m_head->m_pkthdr.csum_data + 16) { IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } } @@ -2801,7 +2802,7 @@ ti_start(ifp) */ if (ti_encap(sc, m_head, &prodidx)) { IF_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } @@ -2909,8 +2910,8 @@ static void ti_init2(sc) /* Enable host interrupts. */ CSR_WRITE_4(sc, TI_MB_HOSTINTR, 0); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* * Make sure to set media properly. We have to do this @@ -3110,12 +3111,12 @@ ti_ioctl(ifp, command, data) * waiting for it to start up, which may take a * second or two. */ - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->ti_if_flags & IFF_PROMISC)) { TI_DO_CMD(TI_CMD_SET_PROMISC_MODE, TI_CMD_CODE_PROMISC_ENB, 0); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->ti_if_flags & IFF_PROMISC) { TI_DO_CMD(TI_CMD_SET_PROMISC_MODE, @@ -3123,7 +3124,7 @@ ti_ioctl(ifp, command, data) } else ti_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { ti_stop(sc); } } @@ -3132,7 +3133,7 @@ ti_ioctl(ifp, command, data) break; case SIOCADDMULTI: case SIOCDELMULTI: - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { ti_setmulti(sc); error = 0; } @@ -3148,7 +3149,7 @@ ti_ioctl(ifp, command, data) ifp->if_capenable &= ~IFCAP_HWCSUM; else ifp->if_capenable |= IFCAP_HWCSUM; - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) ti_init(sc); } error = 0; @@ -3529,7 +3530,7 @@ ti_stop(sc) sc->ti_tx_considx.ti_idx = 0; sc->ti_tx_saved_considx = TI_TXCONS_UNSET; - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); TI_UNLOCK(sc); } diff --git a/sys/pci/if_tl.c b/sys/pci/if_tl.c index f9d981598056..42ae12869d4c 100644 --- a/sys/pci/if_tl.c +++ b/sys/pci/if_tl.c @@ -1655,7 +1655,7 @@ tl_intvec_txeoc(xsc, type) ifp->if_timer = 0; if (sc->tl_cdata.tl_tx_head == NULL) { - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->tl_cdata.tl_tx_tail = NULL; sc->tl_txeoc = 1; } else { @@ -1969,7 +1969,7 @@ tl_start(ifp) * punt. */ if (sc->tl_cdata.tl_tx_free == NULL) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; TL_UNLOCK(sc); return; } @@ -2124,8 +2124,8 @@ tl_init(xsc) /* Send the RX go command */ CMD_SET(sc, TL_CMD_GO|TL_CMD_NES|TL_CMD_RT); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* Start the stats update counter */ sc->tl_stat_ch = timeout(tl_stats_update, sc, hz); @@ -2206,12 +2206,12 @@ tl_ioctl(ifp, command, data) switch(command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->tl_if_flags & IFF_PROMISC)) { tl_dio_setbit(sc, TL_NETCMD, TL_CMD_CAF); tl_setmulti(sc); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->tl_if_flags & IFF_PROMISC) { tl_dio_clrbit(sc, TL_NETCMD, TL_CMD_CAF); @@ -2219,7 +2219,7 @@ tl_ioctl(ifp, command, data) } else tl_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { tl_stop(sc); } } @@ -2332,7 +2332,7 @@ tl_stop(sc) bzero((char *)&sc->tl_ldata->tl_tx_list, sizeof(sc->tl_ldata->tl_tx_list)); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); TL_UNLOCK(sc); return; diff --git a/sys/pci/if_vr.c b/sys/pci/if_vr.c index 654de6f2235c..340aac71fde5 100644 --- a/sys/pci/if_vr.c +++ b/sys/pci/if_vr.c @@ -1109,7 +1109,7 @@ vr_txeof(struct vr_softc *sc) ifp->if_opackets++; m_freem(cur_tx->vr_mbuf); cur_tx->vr_mbuf = NULL; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; cur_tx = cur_tx->vr_nextdesc; } @@ -1400,7 +1400,7 @@ vr_start_locked(struct ifnet *ifp) struct mbuf *m_head; struct vr_chain *cur_tx; - if (ifp->if_flags & IFF_OACTIVE) + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; cur_tx = sc->vr_cdata.vr_tx_prod; @@ -1436,7 +1436,7 @@ vr_start_locked(struct ifnet *ifp) ifp->if_timer = 5; if (cur_tx->vr_mbuf != NULL) - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; } } @@ -1545,8 +1545,8 @@ vr_init_locked(struct vr_softc *sc) mii_mediachg(mii); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->vr_stat_ch = timeout(vr_tick, sc, hz); } @@ -1596,7 +1596,7 @@ vr_ioctl(struct ifnet *ifp, u_long command, caddr_t data) if (ifp->if_flags & IFF_UP) { vr_init_locked(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) vr_stop(sc); } VR_UNLOCK(sc); @@ -1661,7 +1661,7 @@ vr_stop(struct vr_softc *sc) ifp->if_timer = 0; untimeout(vr_tick, sc, sc->vr_stat_ch); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); #ifdef DEVICE_POLLING ether_poll_deregister(ifp); #endif /* DEVICE_POLLING */ diff --git a/sys/pci/if_wb.c b/sys/pci/if_wb.c index 9c44e2e12e69..723c1d30565d 100644 --- a/sys/pci/if_wb.c +++ b/sys/pci/if_wb.c @@ -1226,7 +1226,7 @@ wb_txeoc(sc) ifp->if_timer = 0; if (sc->wb_cdata.wb_tx_head == NULL) { - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->wb_cdata.wb_tx_tail = NULL; } else { if (WB_TXOWN(sc->wb_cdata.wb_tx_head) == WB_UNSENT) { @@ -1462,7 +1462,7 @@ wb_start(ifp) * punt. */ if (sc->wb_cdata.wb_tx_free->wb_mbuf != NULL) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; WB_UNLOCK(sc); return; } @@ -1649,8 +1649,8 @@ wb_init(xsc) mii_mediachg(mii); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->wb_stat_ch = timeout(wb_tick, sc, hz); WB_UNLOCK(sc); @@ -1715,7 +1715,7 @@ wb_ioctl(ifp, command, data) if (ifp->if_flags & IFF_UP) { wb_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) wb_stop(sc); } error = 0; @@ -1814,7 +1814,7 @@ wb_stop(sc) bzero((char *)&sc->wb_ldata->wb_tx_list, sizeof(sc->wb_ldata->wb_tx_list)); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); WB_UNLOCK(sc); return; diff --git a/sys/pci/if_xl.c b/sys/pci/if_xl.c index 72c8ce04d30a..78d100de5d37 100644 --- a/sys/pci/if_xl.c +++ b/sys/pci/if_xl.c @@ -2159,7 +2159,7 @@ xl_txeof(struct xl_softc *sc) } if (sc->xl_cdata.xl_tx_head == NULL) { - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->xl_cdata.xl_tx_tail = NULL; } else { if (CSR_READ_4(sc, XL_DMACTL) & XL_DMACTL_DOWN_STALLED || @@ -2209,7 +2209,7 @@ xl_txeof_90xB(struct xl_softc *sc) sc->xl_cdata.xl_tx_cons = idx; if (cur_tx != NULL) - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } /* @@ -2611,7 +2611,7 @@ xl_start_locked(struct ifnet *ifp) xl_txeoc(sc); xl_txeof(sc); if (sc->xl_cdata.xl_tx_free == NULL) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; return; } } @@ -2729,7 +2729,7 @@ xl_start_90xB_locked(struct ifnet *ifp) XL_LOCK_ASSERT(sc); - if (ifp->if_flags & IFF_OACTIVE) + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; idx = sc->xl_cdata.xl_tx_prod; @@ -2738,7 +2738,7 @@ xl_start_90xB_locked(struct ifnet *ifp) while (sc->xl_cdata.xl_tx_chain[idx].xl_mbuf == NULL) { if ((XL_TX_LIST_CNT - sc->xl_cdata.xl_tx_cnt) < 3) { - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } @@ -3029,8 +3029,8 @@ xl_init_locked(struct xl_softc *sc) /* Select window 7 for normal operations. */ XL_SEL_WIN(7); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->xl_stat_ch = timeout(xl_stats_update, sc, hz); } @@ -3166,14 +3166,14 @@ xl_ioctl(struct ifnet *ifp, u_long command, caddr_t data) XL_SEL_WIN(5); rxfilt = CSR_READ_1(sc, XL_W5_RX_FILTER); if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->xl_if_flags & IFF_PROMISC)) { rxfilt |= XL_RXFILTER_ALLFRAMES; CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RX_SET_FILT|rxfilt); XL_SEL_WIN(7); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->xl_if_flags & IFF_PROMISC) { rxfilt &= ~XL_RXFILTER_ALLFRAMES; @@ -3181,11 +3181,11 @@ xl_ioctl(struct ifnet *ifp, u_long command, caddr_t data) XL_CMD_RX_SET_FILT|rxfilt); XL_SEL_WIN(7); } else { - if ((ifp->if_flags & IFF_RUNNING) == 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) xl_init_locked(sc); } } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) xl_stop(sc); } sc->xl_if_flags = ifp->if_flags; @@ -3344,7 +3344,7 @@ xl_stop(struct xl_softc *sc) if (sc->xl_ldata.xl_tx_list != NULL) bzero(sc->xl_ldata.xl_tx_list, XL_TX_LIST_SZ); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); } /* |