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/sbni | |
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/sbni')
-rw-r--r-- | sys/dev/sbni/if_sbni.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/dev/sbni/if_sbni.c b/sys/dev/sbni/if_sbni.c index 8c40084..580d37a 100644 --- a/sys/dev/sbni/if_sbni.c +++ b/sys/dev/sbni/if_sbni.c @@ -271,7 +271,7 @@ sbni_init(void *xsc) * kludge to avoid multiple initialization when more than once * protocols configured */ - if (ifp->if_flags & IFF_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) return; s = splimp(); @@ -279,8 +279,8 @@ sbni_init(void *xsc) card_start(sc); sc->wch = timeout(sbni_timeout, sc, hz/SBNI_HZ); - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* attempt to start output */ sbni_start(ifp); @@ -669,7 +669,7 @@ prepare_to_send(struct sbni_softc *sc) sc->pktlen = 0; sc->tx_frameno = 0; sc->framelen = 0; - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; return; } @@ -689,7 +689,7 @@ prepare_to_send(struct sbni_softc *sc) sc->framelen = min(len, sc->maxframe); sbni_outb(sc, CSR0, sbni_inb(sc, CSR0) | TR_REQ); - sc->ifp->if_flags |= IFF_OACTIVE; + sc->ifp->if_drv_flags |= IFF_DRV_OACTIVE; BPF_MTAP(sc->ifp, sc->tx_buf_p); } @@ -717,7 +717,7 @@ drop_xmit_queue(struct sbni_softc *sc) sc->framelen = 0; sc->outpos = 0; sc->state &= ~(FL_WAIT_ACK | FL_NEED_RESEND); - sc->ifp->if_flags &= ~IFF_OACTIVE; + sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } @@ -1062,12 +1062,12 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t data) * If it is marked down and running, then stop it. */ if (ifp->if_flags & IFF_UP) { - if (!(ifp->if_flags & IFF_RUNNING)) + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) sbni_init(sc); } else { - if (ifp->if_flags & IFF_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { sbni_stop(sc); - ifp->if_flags &= ~IFF_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; } } break; |