diff options
author | wpaul <wpaul@FreeBSD.org> | 2003-12-25 09:44:49 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 2003-12-25 09:44:49 +0000 |
commit | 757e456f2848f3517bfbcf13237c5aeeb88b0cca (patch) | |
tree | 195c05f8e456857d0fd6741c95035e150bc370c1 /sys/dev/if_ndis/if_ndis.c | |
parent | 41facc2cd68777079dd8e655f83ed4cce3538f91 (diff) | |
download | FreeBSD-src-757e456f2848f3517bfbcf13237c5aeeb88b0cca.zip FreeBSD-src-757e456f2848f3517bfbcf13237c5aeeb88b0cca.tar.gz |
- In ndis_intr(), don't do any interrupt processing if the IFF_UP
flag isn't set.
- In ndis_attach(), halt the NIC before exiting the routine. Calling
ndis_init() will bring it up again, and we don't want it running
(and potentially generating interrupts) until we're ready to deal
with it.
Diffstat (limited to 'sys/dev/if_ndis/if_ndis.c')
-rw-r--r-- | sys/dev/if_ndis/if_ndis.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c index e199567..0bad3c9 100644 --- a/sys/dev/if_ndis/if_ndis.c +++ b/sys/dev/if_ndis/if_ndis.c @@ -566,6 +566,9 @@ fail: if (error) ndis_detach(dev); + /* We're done talking to the NIC for now; halt it. */ + ndis_halt_nic(sc); + return(error); } @@ -587,13 +590,13 @@ ndis_detach(dev) KASSERT(mtx_initialized(&sc->ndis_mtx), ("ndis mutex not initialized")); NDIS_LOCK(sc); ifp = &sc->arpcom.ac_if; + ifp->if_flags &= ~IFF_UP; if (device_is_attached(dev)) { if (sc->ndis_80211) { ifmedia_removeall(&sc->ic.ic_media); ieee80211_node_detach(ifp); } - ifp->if_flags &= ~IFF_UP; NDIS_UNLOCK(sc); ndis_stop(sc); ether_ifdetach(ifp); @@ -761,15 +764,11 @@ ndis_intr(arg) int call_isr = 0; sc = arg; - /*NDIS_LOCK(sc);*/ ifp = &sc->arpcom.ac_if; -/* - if (!(ifp->if_flags & IFF_UP)) { - NDIS_UNLOCK(sc); + if (!(ifp->if_flags & IFF_UP)) return; - } -*/ + ndis_isr(sc, &is_our_intr, &call_isr); if (is_our_intr || call_isr) @@ -778,8 +777,6 @@ ndis_intr(arg) if (ifp->if_snd.ifq_head != NULL) ndis_start(ifp); - /*NDIS_UNLOCK(sc);*/ - return; } |