Author: adrian
Date: Fri May 12 06:05:34 2017
New Revision: 318223
URL: https://svnweb.freebsd.org/changeset/base/318223

Log:
  [iwm] Handle AUTH->SCAN/INIT and ASSOC->SCAN/INIT better
  
  * Tear down the relevant firmware state (i.e. the station, the vif binding)
    in these transition cases.
  
  * Before this case would leave the firmware state lying around, resulting
    in errors and firmware panics in the subsequent association attempts.
  
  Obtained from:        dragonflybsd.git 
94b501399fde6368ae388a669c95b099a6e66e93

Modified:
  head/sys/dev/iwm/if_iwm.c

Modified: head/sys/dev/iwm/if_iwm.c
==============================================================================
--- head/sys/dev/iwm/if_iwm.c   Fri May 12 06:03:23 2017        (r318222)
+++ head/sys/dev/iwm/if_iwm.c   Fri May 12 06:05:34 2017        (r318223)
@@ -4364,6 +4364,39 @@ iwm_newstate(struct ieee80211vap *vap, e
 
        switch (nstate) {
        case IEEE80211_S_INIT:
+       case IEEE80211_S_SCAN:
+               if (vap->iv_state == IEEE80211_S_AUTH ||
+                   vap->iv_state == IEEE80211_S_ASSOC) {
+                       int myerr;
+                       IWM_UNLOCK(sc);
+                       IEEE80211_LOCK(ic);
+                       myerr = ivp->iv_newstate(vap, nstate, arg);
+                       IEEE80211_UNLOCK(ic);
+                       IWM_LOCK(sc);
+                       in = IWM_NODE(vap->iv_bss);
+                       error = iwm_mvm_rm_sta(sc, vap, in);
+                        if (error) {
+                                device_printf(sc->sc_dev,
+                                   "%s: Failed to remove station: %d\n",
+                                   __func__, error);
+                       }
+                       error = iwm_mvm_mac_ctxt_changed(sc, vap);
+                        if (error) {
+                                device_printf(sc->sc_dev,
+                                    "%s: Failed to change mac context: %d\n",
+                                    __func__, error);
+                        }
+                        error = iwm_mvm_binding_remove_vif(sc, ivp);
+                        if (error) {
+                                device_printf(sc->sc_dev,
+                                    "%s: Failed to remove channel ctx: %d\n",
+                                    __func__, error);
+                        }
+                       ivp->phy_ctxt = NULL;
+                       IWM_UNLOCK(sc);
+                       IEEE80211_LOCK(ic);
+                       return myerr;
+               }
                break;
 
        case IEEE80211_S_AUTH:
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to