diff options
author | sam <sam@FreeBSD.org> | 2003-10-13 03:39:38 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2003-10-13 03:39:38 +0000 |
commit | a0342c83578012dde08525a3d6d30cd5fe66e897 (patch) | |
tree | 4b47f9fa3e0ece8f01b6f0be00d9cc88c1eaba9d /sys/dev/ath | |
parent | b6e95ddc2ce5a31fcee02d01abb9cd7a913bc279 (diff) | |
download | FreeBSD-src-a0342c83578012dde08525a3d6d30cd5fe66e897.zip FreeBSD-src-a0342c83578012dde08525a3d6d30cd5fe66e897.tar.gz |
MFp4:
o don't grab the mutex at the top of ath_detach; it does nothing
useful
o deal with entry to ath_ioctl during detach to disable promiscuous
mode as a result of calling bpfdetach2: cannot call ath_init when
the device is marked invalid as the code isn't prepared to deal
with it (in particular by that time the hal reference may have
been yanked)
Diffstat (limited to 'sys/dev/ath')
-rw-r--r-- | sys/dev/ath/if_ath.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index e766a38..10a1b6d 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -330,7 +330,6 @@ ath_detach(struct ath_softc *sc) DPRINTF(("ath_detach: if_flags %x\n", ifp->if_flags)); - mtx_lock(&sc->sc_mtx); ath_stop(ifp); bpfdetach(ifp); ath_desc_free(sc); @@ -851,8 +850,19 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) * only reflect promisc mode settings. */ ath_mode_init(sc); - } else - ath_init(ifp); /* XXX lose error */ + } else { + /* + * Beware of being called during detach to + * reset promiscuous mode. In that case we + * will still be marked UP but not RUNNING. + * However trying to re-init the interface + * is the wrong thing to do as we've already + * torn down much of our state. There's + * probably a better way to deal with this. + */ + if (!sc->sc_invalid) + ath_init(ifp); /* XXX lose error */ + } } else ath_stop(ifp); break; |