svn commit: r330211 - stable/11/sys/dev/iwm

Eitan Adler eadler at FreeBSD.org
Thu Mar 1 06:42:19 UTC 2018


Author: eadler
Date: Thu Mar  1 06:42:19 2018
New Revision: 330211
URL: https://svnweb.freebsd.org/changeset/base/330211

Log:
  MFC r318223:
  
  [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.

Modified:
  stable/11/sys/dev/iwm/if_iwm.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/iwm/if_iwm.c
==============================================================================
--- stable/11/sys/dev/iwm/if_iwm.c	Thu Mar  1 06:41:35 2018	(r330210)
+++ stable/11/sys/dev/iwm/if_iwm.c	Thu Mar  1 06:42:19 2018	(r330211)
@@ -4389,6 +4389,39 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_
 
 	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:


More information about the svn-src-all mailing list