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/pci/if_sis.c | |
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/pci/if_sis.c')
-rw-r--r-- | sys/pci/if_sis.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/pci/if_sis.c b/sys/pci/if_sis.c index 48a6132..469ab02 100644 --- a/sys/pci/if_sis.c +++ b/sys/pci/if_sis.c @@ -1551,7 +1551,7 @@ sis_txeof(struct sis_softc *sc) if (idx != sc->sis_tx_cons) { /* we freed up some buffers */ sc->sis_tx_cons = idx; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } ifp->if_timer = (sc->sis_tx_cnt == 0) ? 0 : 5; @@ -1815,7 +1815,7 @@ sis_startl(struct ifnet *ifp) idx = sc->sis_tx_prod; - if (ifp->if_flags & IFF_OACTIVE) + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; while(sc->sis_tx_list[idx].sis_mbuf == NULL) { @@ -1825,7 +1825,7 @@ sis_startl(struct ifnet *ifp) if (sis_encap(sc, &m_head, &idx)) { IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - ifp->if_flags |= IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } @@ -2068,8 +2068,8 @@ sis_initl(struct sis_softc *sc) mii_mediachg(mii); #endif - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (!sc->in_tick) callout_reset(&sc->sis_stat_ch, hz, sis_tick, sc); @@ -2127,7 +2127,7 @@ sis_ioctl(struct ifnet *ifp, u_long command, caddr_t data) case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { sis_init(sc); - } else if (ifp->if_flags & IFF_RUNNING) { + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { SIS_LOCK(sc); sis_stop(sc); SIS_UNLOCK(sc); @@ -2208,7 +2208,7 @@ sis_stop(struct sis_softc *sc) callout_stop(&sc->sis_stat_ch); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); #ifdef DEVICE_POLLING ether_poll_deregister(ifp); #endif |