svn commit: r318221 - head/sys/dev/iwm

Adrian Chadd adrian at FreeBSD.org
Fri May 12 05:53:29 UTC 2017


Author: adrian
Date: Fri May 12 05:53:28 2017
New Revision: 318221
URL: https://svnweb.freebsd.org/changeset/base/318221

Log:
  [iwm] Deduplicate code in iwm_auth() from an if condition.
  
  Obtained from:	dragonflybsd.git 03c6e6970115727c9d39f9358e0500ab4f4634cd

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:51:50 2017	(r318220)
+++ head/sys/dev/iwm/if_iwm.c	Fri May 12 05:53:28 2017	(r318221)
@@ -4152,24 +4152,6 @@ iwm_auth(struct ieee80211vap *vap, struc
 			    "%s: failed to update MAC\n", __func__);
 			goto out;
 		}
-		if ((error = iwm_mvm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0],
-		    in->in_ni.ni_chan, 1, 1)) != 0) {
-			device_printf(sc->sc_dev,
-			    "%s: failed update phy ctxt\n", __func__);
-			goto out;
-		}
-		iv->phy_ctxt = &sc->sc_phyctxt[0];
-
-		if ((error = iwm_mvm_binding_add_vif(sc, iv)) != 0) {
-			device_printf(sc->sc_dev,
-			    "%s: binding update cmd\n", __func__);
-			goto out;
-		}
-		if ((error = iwm_mvm_add_sta(sc, in)) != 0) {
-			device_printf(sc->sc_dev,
-			    "%s: failed to add sta\n", __func__);
-			goto out;
-		}
 	} else {
 		if ((error = iwm_mvm_mac_ctxt_add(sc, vap)) != 0) {
 			device_printf(sc->sc_dev,
@@ -4182,25 +4164,25 @@ iwm_auth(struct ieee80211vap *vap, struc
 			    __func__);
 			goto out;
 		}
-		if ((error = iwm_mvm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0],
-		    in->in_ni.ni_chan, 1, 1)) != 0) {
-			device_printf(sc->sc_dev,
-			    "%s: failed add phy ctxt!\n", __func__);
-			error = ETIMEDOUT;
-			goto out;
-		}
-		iv->phy_ctxt = &sc->sc_phyctxt[0];
+	}
 
-		if ((error = iwm_mvm_binding_add_vif(sc, iv)) != 0) {
-			device_printf(sc->sc_dev,
-			    "%s: binding add cmd\n", __func__);
-			goto out;
-		}
-		if ((error = iwm_mvm_add_sta(sc, in)) != 0) {
-			device_printf(sc->sc_dev,
-			    "%s: failed to add sta\n", __func__);
-			goto out;
-		}
+	if ((error = iwm_mvm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0],
+	    in->in_ni.ni_chan, 1, 1)) != 0) {
+		device_printf(sc->sc_dev,
+		    "%s: failed update phy ctxt\n", __func__);
+		goto out;
+	}
+	iv->phy_ctxt = &sc->sc_phyctxt[0];
+
+	if ((error = iwm_mvm_binding_add_vif(sc, iv)) != 0) {
+		device_printf(sc->sc_dev,
+		    "%s: binding update cmd\n", __func__);
+		goto out;
+	}
+	if ((error = iwm_mvm_add_sta(sc, in)) != 0) {
+		device_printf(sc->sc_dev,
+		    "%s: failed to add sta\n", __func__);
+		goto out;
 	}
 
 	/*


More information about the svn-src-head mailing list