diff options
author | rwatson <rwatson@FreeBSD.org> | 2005-08-09 10:20:02 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2005-08-09 10:20:02 +0000 |
commit | 5d770a09e85126b8b3e9fe302c36350a90210cbe (patch) | |
tree | bb70e59641e2310a3c26ec449af5ab0cb7420d9d /sys/dev/an | |
parent | 74759aaa78777146f23aa05c856f574efdfb41d9 (diff) | |
download | FreeBSD-src-5d770a09e85126b8b3e9fe302c36350a90210cbe.zip FreeBSD-src-5d770a09e85126b8b3e9fe302c36350a90210cbe.tar.gz |
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
Diffstat (limited to 'sys/dev/an')
-rw-r--r-- | sys/dev/an/if_an.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c index 9e04e3b..f10f30e 100644 --- a/sys/dev/an/if_an.c +++ b/sys/dev/an/if_an.c @@ -834,7 +834,7 @@ an_detach(device_t dev) an_stop(sc); sc->an_gone = 1; ifmedia_removeall(&sc->an_ifmedia); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; AN_UNLOCK(sc); ether_ifdetach(ifp); if_free(ifp); @@ -1118,7 +1118,7 @@ an_txeof(sc, status) ifp = sc->an_ifp; ifp->if_timer = 0; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (!sc->mpi350) { id = CSR_READ_2(sc, AN_TX_CMP_FID(sc->mpi350)); @@ -1180,7 +1180,7 @@ an_stats_update(xsc) sc->an_associated = 0; /* Don't do this while we're transmitting */ - if (ifp->if_flags & IFF_OACTIVE) { + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { sc->an_stat_ch = timeout(an_stats_update, sc, hz); AN_UNLOCK(sc); return; @@ -1951,18 +1951,18 @@ an_ioctl(ifp, command, data) switch (command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { - if (ifp->if_flags & IFF_RUNNING && + if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && !(sc->an_if_flags & IFF_PROMISC)) { an_promisc(sc, 1); - } else if (ifp->if_flags & IFF_RUNNING && + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && !(ifp->if_flags & IFF_PROMISC) && sc->an_if_flags & IFF_PROMISC) { an_promisc(sc, 0); } else an_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) an_stop(sc); } sc->an_if_flags = ifp->if_flags; @@ -2544,7 +2544,7 @@ an_init(xsc) return; } - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) an_stop(sc); sc->an_associated = 0; @@ -2631,8 +2631,8 @@ an_init(xsc) /* enable interrupts */ CSR_WRITE_2(sc, AN_INT_EN(sc->mpi350), AN_INTRS(sc->mpi350)); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->an_stat_ch = timeout(an_stats_update, sc, hz); AN_UNLOCK(sc); @@ -2658,7 +2658,7 @@ an_start(ifp) if (sc->an_gone) return; - if (ifp->if_flags & IFF_OACTIVE) + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; if (!sc->an_associated) @@ -2819,7 +2819,7 @@ an_start(ifp) } if (m0 != NULL) - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; sc->an_rdata.an_tx_prod = idx; @@ -2851,7 +2851,7 @@ an_stop(sc) untimeout(an_stats_update, sc, sc->an_stat_ch); - ifp->if_flags &= ~(IFF_RUNNING|IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING|IFF_DRV_OACTIVE); if (sc->an_flash_buffer) { free(sc->an_flash_buffer, M_DEVBUF); |