From owner-svn-src-head@freebsd.org Fri May 12 05:51:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E57ED696C6; Fri, 12 May 2017 05:51:51 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49CBF76D; Fri, 12 May 2017 05:51:51 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4C5polX056802; Fri, 12 May 2017 05:51:50 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4C5poVn056801; Fri, 12 May 2017 05:51:50 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201705120551.v4C5poVn056801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 12 May 2017 05:51:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318220 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 May 2017 05:51:51 -0000 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);