diff options
author | imp <imp@FreeBSD.org> | 2009-06-02 16:48:10 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2009-06-02 16:48:10 +0000 |
commit | 2f4849a20fcbe8d9274d9ccb3430aaf60dac8da6 (patch) | |
tree | 4a7453584deebd5fe062ee3b60447be5fe57ae3d | |
parent | 0010c8697b23e837454af642ec57927d6751ba6c (diff) | |
download | FreeBSD-src-2f4849a20fcbe8d9274d9ccb3430aaf60dac8da6.zip FreeBSD-src-2f4849a20fcbe8d9274d9ccb3430aaf60dac8da6.tar.gz |
In bwi_newstate, only zero the bssid when we stop a STA. And only
when we've not stopped the card. It hangs the system when we touch
the CSR after bwistop.
This fixes the hanging on kldunload.
-rw-r--r-- | sys/dev/bwi/if_bwi.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/sys/dev/bwi/if_bwi.c b/sys/dev/bwi/if_bwi.c index dba7a7a..327b736 100644 --- a/sys/dev/bwi/if_bwi.c +++ b/sys/dev/bwi/if_bwi.c @@ -1771,10 +1771,12 @@ static int bwi_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct bwi_vap *bvp = BWI_VAP(vap); - struct ifnet *ifp = vap->iv_ic->ic_ifp; + struct ieee80211com *ic= vap->iv_ic; + struct ifnet *ifp = ic->ic_ifp; + enum ieee80211_state ostate = vap->iv_state; struct bwi_softc *sc = ifp->if_softc; struct bwi_mac *mac; - struct ieee80211_node *ni; + struct ieee80211_node *ni = vap->iv_bss; int error; BWI_LOCK(sc); @@ -1790,11 +1792,25 @@ bwi_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) if (error != 0) goto back; + /* + * Clear the BSSID when we stop a STA + */ + if (vap->iv_opmode == IEEE80211_M_STA) { + if (ostate == IEEE80211_S_RUN && nstate != IEEE80211_S_RUN) { + /* + * Clear out the BSSID. If we reassociate to + * the same AP, this will reinialize things + * correctly... + */ + if (ic->ic_opmode == IEEE80211_M_STA && + !(sc->sc_flags & BWI_F_STOP)) + bwi_set_bssid(sc, bwi_zero_addr); + } + } + if (vap->iv_opmode == IEEE80211_M_MONITOR) { /* Nothing to do */ } else if (nstate == IEEE80211_S_RUN) { - ni = vap->iv_bss; - bwi_set_bssid(sc, vap->iv_bss->ni_bssid); KASSERT(sc->sc_cur_regwin->rw_type == BWI_REGWIN_T_MAC, @@ -1814,8 +1830,6 @@ bwi_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) } callout_reset(&sc->sc_calib_ch, hz, bwi_calibrate, sc); - } else { - bwi_set_bssid(sc, bwi_zero_addr); } back: BWI_UNLOCK(sc); |