Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and

IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to
ifnet.if_drv_flags.  Device drivers are now responsible for
synchronizing access to these flags, as they are in if_drv_flags.  This
helps prevent races between the network stack and device driver in
maintaining the interface flags field.

Many __FreeBSD__ and __FreeBSD_version checks maintained and continued;
some less so.

Reviewed by:	pjd, bz
MFC after:	7 days
This commit is contained in:
Robert Watson 2005-08-09 10:20:02 +00:00
parent 292ee7be1c
commit 13f4c340ae
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=148887
142 changed files with 1255 additions and 1088 deletions

View File

@ -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) {

View File

@ -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);

View File

@ -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);

View File

@ -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 @@ oltr_start(struct ifnet *ifp)
*/
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 @@ oltr_start(struct ifnet *ifp)
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);
}

View File

@ -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);

View File

@ -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)

View File

@ -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);

View File

@ -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 @@ arstart(struct ar_softc *sc)
*/
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 */

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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:

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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);

View File

@ -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.

View File

@ -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;
}

View File

@ -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);

View File

@ -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);
}
}

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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);

View File

@ -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 @@ ed_start(struct ifnet *ifp)
/*
* 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 @@ ed_start(struct ifnet *ifp)
* 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;
}
}

View File

@ -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)

View File

@ -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;
}
/*

View File

@ -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);

View File

@ -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 @@ epstart_locked(struct ifnet *ifp)
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 @@ ep_intr(void *arg)
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 @@ ep_intr(void *arg)
/* 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);
}

View File

@ -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"););

View File

@ -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;

View File

@ -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);

View File

@ -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 @@ fwe_init(void *arg)
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);
}

View File

@ -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 @@ fwip_init(void *arg)
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);
}

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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);
}
}

View File

@ -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);

View File

@ -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;

View File

@ -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.

View File

@ -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);

View File

@ -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);

View File

@ -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();

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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)

View File

@ -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;
}

View File

@ -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.

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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)");

View File

@ -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);

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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 */

View File

@ -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);

View File

@ -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);
}

View File

@ -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
*/
}

View File

@ -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)

View File

@ -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 */

View File

@ -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;

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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 @@ snstart_locked(struct ifnet *ifp)
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 @@ snstart_locked(struct ifnet *ifp)
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 @@ snresume(struct ifnet *ifp)
/*
* 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 */

View File

@ -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 @@ sncstart(ifp)
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);

View File

@ -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);

View File

@ -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 @@ srstart(struct sr_softc *sc)
*/
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? */

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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);
}

View File

@ -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;

View File

@ -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);

View File

@ -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 */

View File

@ -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 */

View File

@ -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 @@ vxstart(struct ifnet *ifp)
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);
}

View File

@ -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)) {

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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;
}

View File

@ -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);
*/

View File

@ -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);
}

View File

@ -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));
}

View File

@ -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);

View File

@ -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;

View File

@ -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)

Some files were not shown because too many files have changed in this diff Show More