PERFORCE change 81494 for review
Robert Watson
rwatson at FreeBSD.org
Fri Aug 5 14:12:08 GMT 2005
http://perforce.freebsd.org/chv.cgi?CH=81494
Change 81494 by rwatson at rwatson_zoo on 2005/08/05 14:11:40
First cut at converting all references to IFF_OACTIVE
and IFF_RUNNING to the _DRV_ versions in if_drv_flags.
While most cases are almost search and replace, others
requires tweaking of the logic due to assumptions that
the flags were bits of the same int. As such, this
patch requires careful review.
This change closes a boatload of minor races between
driver use of RUNNING and OACTIVE and various user
administrative activities.
Affected files ...
.. //depot/projects/netsmp/src/sys/compat/linux/linux_ioctl.c#2 edit
.. //depot/projects/netsmp/src/sys/compat/svr4/svr4_sockio.c#2 edit
.. //depot/projects/netsmp/src/sys/contrib/altq/altq/altq_cbq.c#2 edit
.. //depot/projects/netsmp/src/sys/contrib/dev/oltr/if_oltr.c#2 edit
.. //depot/projects/netsmp/src/sys/contrib/pf/net/if_pflog.c#2 edit
.. //depot/projects/netsmp/src/sys/contrib/pf/net/if_pfsync.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/an/if_an.c#3 edit
.. //depot/projects/netsmp/src/sys/dev/ar/if_ar.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/arl/if_arl.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/ath/ath_rate/amrr/amrr.c#3 edit
.. //depot/projects/netsmp/src/sys/dev/ath/ath_rate/onoe/onoe.c#3 edit
.. //depot/projects/netsmp/src/sys/dev/ath/if_ath.c#7 edit
.. //depot/projects/netsmp/src/sys/dev/awi/awi.c#5 edit
.. //depot/projects/netsmp/src/sys/dev/bfe/if_bfe.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/bge/if_bge.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/cm/if_cm_isa.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/cm/smc90cx6.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/cnw/if_cnw.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/cp/if_cp.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/cs/if_cs.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/ctau/if_ct.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/cx/if_cx.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/ed/if_ed.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/em/if_em.c#5 edit
.. //depot/projects/netsmp/src/sys/dev/en/if_en_pci.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/en/midway.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/ep/if_ep.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/ex/if_ex.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/fatm/if_fatm.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/fe/if_fe.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/firewire/if_fwe.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/firewire/if_fwip.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/fxp/if_fxp.c#5 edit
.. //depot/projects/netsmp/src/sys/dev/gem/if_gem.c#5 edit
.. //depot/projects/netsmp/src/sys/dev/hatm/if_hatm.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/hatm/if_hatm_intr.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/hatm/if_hatm_ioctl.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/hatm/if_hatm_rx.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/hatm/if_hatm_tx.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/hme/if_hme.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/ie/if_ie.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/if_ndis/if_ndis.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/iicbus/if_ic.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/ipw/if_ipw.c#3 edit
.. //depot/projects/netsmp/src/sys/dev/iwi/if_iwi.c#3 edit
.. //depot/projects/netsmp/src/sys/dev/ixgb/if_ixgb.c#5 edit
.. //depot/projects/netsmp/src/sys/dev/lge/if_lge.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/lnc/if_lnc.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/my/if_my.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/nge/if_nge.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/nve/if_nve.c#5 edit
.. //depot/projects/netsmp/src/sys/dev/owi/if_owi.c#5 edit
.. //depot/projects/netsmp/src/sys/dev/patm/if_patm.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/patm/if_patm_intr.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/patm/if_patm_ioctl.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/patm/if_patm_tx.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/pdq/pdq_ifsubr.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/ppbus/if_plip.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/ral/if_ral.c#3 edit
.. //depot/projects/netsmp/src/sys/dev/ral/if_ral_pci.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/ray/if_ray.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/ray/if_rayvar.h#2 edit
.. //depot/projects/netsmp/src/sys/dev/re/if_re.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/sbni/if_sbni.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/sbsh/if_sbsh.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/sn/if_sn.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/snc/dp83932.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/snc/if_snc_pccard.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/sr/if_sr.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/tx/if_tx.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/txp/if_txp.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/usb/if_aue.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/usb/if_axe.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/usb/if_cdce.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/usb/if_cue.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/usb/if_kue.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/usb/if_rue.c#5 edit
.. //depot/projects/netsmp/src/sys/dev/usb/if_udav.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/usb/if_ural.c#3 edit
.. //depot/projects/netsmp/src/sys/dev/vge/if_vge.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/vx/if_vx.c#3 edit
.. //depot/projects/netsmp/src/sys/dev/wi/if_wi.c#5 edit
.. //depot/projects/netsmp/src/sys/dev/wi/if_wi_pci.c#2 edit
.. //depot/projects/netsmp/src/sys/dev/wl/if_wl.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/xe/if_xe.c#4 edit
.. //depot/projects/netsmp/src/sys/dev/xe/if_xe_pccard.c#2 edit
.. //depot/projects/netsmp/src/sys/i386/isa/if_el.c#2 edit
.. //depot/projects/netsmp/src/sys/i4b/driver/i4b_ipr.c#2 edit
.. //depot/projects/netsmp/src/sys/i4b/driver/i4b_isppp.c#2 edit
.. //depot/projects/netsmp/src/sys/kern/kern_poll.c#2 edit
.. //depot/projects/netsmp/src/sys/net/bridge.c#2 edit
.. //depot/projects/netsmp/src/sys/net/bridgestp.c#2 edit
.. //depot/projects/netsmp/src/sys/net/if_arcsubr.c#4 edit
.. //depot/projects/netsmp/src/sys/net/if_atm.h#2 edit
.. //depot/projects/netsmp/src/sys/net/if_atmsubr.c#2 edit
.. //depot/projects/netsmp/src/sys/net/if_bridge.c#4 edit
.. //depot/projects/netsmp/src/sys/net/if_ef.c#2 edit
.. //depot/projects/netsmp/src/sys/net/if_ethersubr.c#5 edit
.. //depot/projects/netsmp/src/sys/net/if_faith.c#2 edit
.. //depot/projects/netsmp/src/sys/net/if_fddisubr.c#4 edit
.. //depot/projects/netsmp/src/sys/net/if_fwsubr.c#2 edit
.. //depot/projects/netsmp/src/sys/net/if_gif.c#3 edit
.. //depot/projects/netsmp/src/sys/net/if_gre.c#3 edit
.. //depot/projects/netsmp/src/sys/net/if_iso88025subr.c#4 edit
.. //depot/projects/netsmp/src/sys/net/if_loop.c#2 edit
.. //depot/projects/netsmp/src/sys/net/if_ppp.c#2 edit
.. //depot/projects/netsmp/src/sys/net/if_spppsubr.c#3 edit
.. //depot/projects/netsmp/src/sys/net/if_tap.c#2 edit
.. //depot/projects/netsmp/src/sys/net/if_tun.c#2 edit
.. //depot/projects/netsmp/src/sys/net/if_vlan.c#4 edit
.. //depot/projects/netsmp/src/sys/net/ppp_tty.c#2 edit
.. //depot/projects/netsmp/src/sys/net80211/ieee80211_ioctl.c#3 edit
.. //depot/projects/netsmp/src/sys/netatm/atm_if.c#2 edit
.. //depot/projects/netsmp/src/sys/netgraph/ng_eiface.c#2 edit
.. //depot/projects/netsmp/src/sys/netgraph/ng_ether.c#2 edit
.. //depot/projects/netsmp/src/sys/netgraph/ng_fec.c#2 edit
.. //depot/projects/netsmp/src/sys/netgraph/ng_iface.c#2 edit
.. //depot/projects/netsmp/src/sys/netgraph/ng_sppp.c#2 edit
.. //depot/projects/netsmp/src/sys/netinet/ip_carp.c#3 edit
.. //depot/projects/netsmp/src/sys/netinet/ip_fastfwd.c#3 edit
.. //depot/projects/netsmp/src/sys/netinet6/in6.c#3 edit
.. //depot/projects/netsmp/src/sys/netinet6/nd6_nbr.c#3 edit
.. //depot/projects/netsmp/src/sys/netnatm/natm.c#2 edit
.. //depot/projects/netsmp/src/sys/pci/if_dc.c#4 edit
.. //depot/projects/netsmp/src/sys/pci/if_de.c#6 edit
.. //depot/projects/netsmp/src/sys/pci/if_pcn.c#4 edit
.. //depot/projects/netsmp/src/sys/pci/if_rl.c#4 edit
.. //depot/projects/netsmp/src/sys/pci/if_sf.c#4 edit
.. //depot/projects/netsmp/src/sys/pci/if_sis.c#5 edit
.. //depot/projects/netsmp/src/sys/pci/if_sk.c#4 edit
.. //depot/projects/netsmp/src/sys/pci/if_ste.c#4 edit
.. //depot/projects/netsmp/src/sys/pci/if_ti.c#4 edit
.. //depot/projects/netsmp/src/sys/pci/if_tl.c#4 edit
.. //depot/projects/netsmp/src/sys/pci/if_vr.c#4 edit
.. //depot/projects/netsmp/src/sys/pci/if_wb.c#4 edit
.. //depot/projects/netsmp/src/sys/pci/if_xl.c#5 edit
Differences ...
==== //depot/projects/netsmp/src/sys/compat/linux/linux_ioctl.c#2 (text+ko) ====
@@ -2212,9 +2212,9 @@
{
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) {
==== //depot/projects/netsmp/src/sys/compat/svr4/svr4_sockio.c#2 (text+ko) ====
@@ -62,7 +62,8 @@
#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);
==== //depot/projects/netsmp/src/sys/contrib/altq/altq/altq_cbq.c#2 (text+ko) ====
@@ -598,7 +598,7 @@
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);
==== //depot/projects/netsmp/src/sys/contrib/dev/oltr/if_oltr.c#2 (text+ko) ====
@@ -230,7 +230,7 @@
/*
* 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 @@
*/
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 @@
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 @@
/*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 @@
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 @@
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 @@
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);
}
==== //depot/projects/netsmp/src/sys/contrib/pf/net/if_pflog.c#2 (text+ko) ====
@@ -272,9 +272,9 @@
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);
==== //depot/projects/netsmp/src/sys/contrib/pf/net/if_pfsync.c#2 (text+ko) ====
@@ -990,9 +990,9 @@
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)
==== //depot/projects/netsmp/src/sys/dev/an/if_an.c#3 (text+ko) ====
@@ -834,7 +834,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
/* 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 @@
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 @@
}
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 @@
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);
==== //depot/projects/netsmp/src/sys/dev/ar/if_ar.c#2 (text+ko) ====
@@ -607,9 +607,9 @@
* 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 @@
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 @@
*/
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 @@
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 @@
(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 @@
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 @@
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 @@
/*
* 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 */
==== //depot/projects/netsmp/src/sys/dev/arl/if_arl.c#2 (text+ko) ====
@@ -456,10 +456,10 @@
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 @@
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 @@
{
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 @@
/* 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 @@
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 @@
/* 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 @@
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 @@
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
==== //depot/projects/netsmp/src/sys/dev/ath/ath_rate/amrr/amrr.c#3 (text+ko) ====
@@ -464,7 +464,7 @@
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)
==== //depot/projects/netsmp/src/sys/dev/ath/ath_rate/onoe/onoe.c#3 (text+ko) ====
@@ -445,7 +445,7 @@
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)
==== //depot/projects/netsmp/src/sys/dev/ath/if_ath.c#7 (text+ko) ====
@@ -651,7 +651,7 @@
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) {
@@ -692,7 +692,8 @@
}
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 */
@@ -907,7 +908,7 @@
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;
/*
@@ -938,7 +939,7 @@
__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
@@ -955,7 +956,7 @@
* 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) {
@@ -1060,7 +1061,7 @@
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 (;;) {
/*
@@ -1075,7 +1076,7 @@
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;
}
/*
@@ -1203,7 +1204,7 @@
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);
@@ -3749,7 +3750,7 @@
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)
@@ -3777,7 +3778,7 @@
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)
@@ -3804,7 +3805,7 @@
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)
@@ -3892,7 +3893,7 @@
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;
}
@@ -4591,7 +4592,7 @@
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) {
@@ -4670,7 +4671,7 @@
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;
@@ -4708,7 +4709,7 @@
* 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:
==== //depot/projects/netsmp/src/sys/dev/awi/awi.c#5 (text+ko) ====
@@ -653,8 +653,8 @@
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_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 @@
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 @@
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 @@
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);
}
==== //depot/projects/netsmp/src/sys/dev/bfe/if_bfe.c#4 (text+ko) ====
@@ -1110,7 +1110,7 @@
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 @@
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_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 @@
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 @@
*/
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_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 @@
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 @@
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 @@
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_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);
}
==== //depot/projects/netsmp/src/sys/dev/bge/if_bge.c#4 (text+ko) ====
@@ -2895,7 +2895,7 @@
}
if (cur_tx != NULL)
- ifp->if_flags &= ~IFF_OACTIVE;
+ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
return;
}
@@ -2995,7 +2995,7 @@
}
}
- 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 @@
/* 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 @@
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 @@
*/
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 @@
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_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 @@
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 @@
* 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,17 +3590,17 @@
} else
bge_init_locked(sc);
} else {
- if (ifp->if_flags & IFF_RUNNING) {
+ if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
bge_stop(sc);
}
}
- sc->bge_if_flags = ifp->if_flags;
+ sc->bge_if_flags = ifp->if_flags | ifp->if_drv_flags;
BGE_UNLOCK(sc);
error = 0;
break;
case SIOCADDMULTI:
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list