Don't try to hold the mutex if we are disabling the card because we can

be called from an interrupt context. While this is not strictly correct,
we are SoL anyway so this does not matter.
This commit is contained in:
christos 2010-08-29 07:00:13 +00:00
parent c1e0a5bd50
commit 26a6b06d3f

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_iwn.c,v 1.49 2010/07/10 04:09:35 christos Exp $ */
/* $NetBSD: if_iwn.c,v 1.50 2010/08/29 07:00:13 christos Exp $ */
/* $OpenBSD: if_iwn.c,v 1.96 2010/05/13 09:25:03 damien Exp $ */
/*-
@ -22,7 +22,7 @@
* adapters.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.49 2010/07/10 04:09:35 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.50 2010/08/29 07:00:13 christos Exp $");
#define IWN_USE_RBUF /* Use local storage for RX */
#undef IWN_HWCRYPTO /* XXX does not even compile yet */
@ -5913,7 +5913,8 @@ iwn_stop(struct ifnet *ifp, int disable)
struct iwn_softc *sc = ifp->if_softc;
struct ieee80211com *ic = &sc->sc_ic;
mutex_enter(&sc->sc_mtx);
if (!disable)
mutex_enter(&sc->sc_mtx);
sc->sc_flags &= ~IWN_FLAG_HW_INITED;
ifp->if_timer = sc->sc_tx_timer = 0;
ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
@ -5928,7 +5929,8 @@ iwn_stop(struct ifnet *ifp, int disable)
sc->sc_sensor.value_cur = 0;
sc->sc_sensor.state = ENVSYS_SINVALID;
#endif
mutex_exit(&sc->sc_mtx);
if (!disable)
mutex_exit(&sc->sc_mtx);
}
/*