Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 May 2017 05:51:50 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r318220 - head/sys/dev/iwm
Message-ID:  <201705120551.v4C5poVn056801@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Fri May 12 05:51:50 2017
New Revision: 318220
URL: https://svnweb.freebsd.org/changeset/base/318220

Log:
  [iwm] No need for iwm_assoc() in AUTH->ASSOC transition.
  
  * Hence no need to keep stuff in separate iwm_assoc() function, just
    inline the stuff into iwm_newstate().
  
  Obtained from:	dragonflybsd.git e8f7d88e0d030f138f95ecdb7c1a729d9fb0d6ab

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 05:50:38 2017	(r318219)
+++ head/sys/dev/iwm/if_iwm.c	Fri May 12 05:51:50 2017	(r318220)
@@ -359,7 +359,6 @@ static int	iwm_mvm_add_int_sta_common(st
 static int	iwm_mvm_add_aux_sta(struct iwm_softc *);
 static int	iwm_mvm_update_quotas(struct iwm_softc *, struct iwm_vap *);
 static int	iwm_auth(struct ieee80211vap *, struct iwm_softc *);
-static int	iwm_assoc(struct ieee80211vap *, struct iwm_softc *);
 static int	iwm_release(struct iwm_softc *, struct iwm_node *);
 static struct ieee80211_node *
 		iwm_node_alloc(struct ieee80211vap *,
@@ -4166,9 +4165,9 @@ iwm_auth(struct ieee80211vap *vap, struc
 			    "%s: binding update cmd\n", __func__);
 			goto out;
 		}
-		if ((error = iwm_mvm_update_sta(sc, in)) != 0) {
+		if ((error = iwm_mvm_add_sta(sc, in)) != 0) {
 			device_printf(sc->sc_dev,
-			    "%s: failed to update sta\n", __func__);
+			    "%s: failed to add sta\n", __func__);
 			goto out;
 		}
 	} else {
@@ -4220,28 +4219,6 @@ out:
 }
 
 static int
-iwm_assoc(struct ieee80211vap *vap, struct iwm_softc *sc)
-{
-	struct iwm_node *in = IWM_NODE(vap->iv_bss);
-	int error;
-
-	if ((error = iwm_mvm_update_sta(sc, in)) != 0) {
-		device_printf(sc->sc_dev,
-		    "%s: failed to update STA\n", __func__);
-		return error;
-	}
-
-	in->in_assoc = 1;
-	if ((error = iwm_mvm_mac_ctxt_changed(sc, vap)) != 0) {
-		device_printf(sc->sc_dev,
-		    "%s: failed to update MAC\n", __func__);
-		return error;
-	}
-
-	return 0;
-}
-
-static int
 iwm_release(struct iwm_softc *sc, struct iwm_node *in)
 {
 	uint32_t tfd_msk;
@@ -4556,7 +4533,6 @@ iwm_newstate(struct ieee80211vap *vap, e
 			device_printf(sc->sc_dev,
 			    "%s: could not move to auth state: %d\n",
 			    __func__, error);
-			break;
 		}
 		break;
 
@@ -4565,13 +4541,7 @@ iwm_newstate(struct ieee80211vap *vap, e
 		 * EBS may be disabled due to previous failures reported by FW.
 		 * Reset EBS status here assuming environment has been changed.
 		 */
-                sc->last_ebs_successful = TRUE;
-		if ((error = iwm_assoc(vap, sc)) != 0) {
-			device_printf(sc->sc_dev,
-			    "%s: failed to associate: %d\n", __func__,
-			    error);
-			break;
-		}
+		sc->last_ebs_successful = TRUE;
 		break;
 
 	case IEEE80211_S_RUN:
@@ -4582,18 +4552,24 @@ iwm_newstate(struct ieee80211vap *vap, e
 			.flags = IWM_CMD_SYNC,
 		};
 
+		in = IWM_NODE(vap->iv_bss);
 		/* Update the association state, now we have it all */
 		/* (eg associd comes in at this point */
-		error = iwm_assoc(vap, sc);
+		error = iwm_mvm_update_sta(sc, in);
 		if (error != 0) {
 			device_printf(sc->sc_dev,
-			    "%s: failed to update association state: %d\n",
-			    __func__,
-			    error);
-			break;
+			    "%s: failed to update STA\n", __func__);
+			IWM_UNLOCK(sc);
+			IEEE80211_LOCK(ic);
+			return error;
+		}
+		in->in_assoc = 1;
+		error = iwm_mvm_mac_ctxt_changed(sc, vap);
+		if (error != 0) {
+			device_printf(sc->sc_dev,
+			    "%s: failed to update MAC: %d\n", __func__, error);
 		}
 
-		in = IWM_NODE(vap->iv_bss);
 		iwm_mvm_enable_beacon_filter(sc, in);
 		iwm_mvm_power_update_mac(sc);
 		iwm_mvm_update_quotas(sc, ivp);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705120551.v4C5poVn056801>