From f1bd8a14fa2d275173a38cf3f442428d3e752824 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Fri, 12 May 2017 06:21:03 +0000 Subject: [iwm] Already call iwm_mvm_power_update_mac() during SCAN<->AUTH paths. * Otherwise we would never update powersaving settings until we complete an association, after the first authentication attempt. * This corresponds to what Linux iwlwifi seems to do. Obtained from: dragonflybsd.git aa128dc02a17c2e616232ef0fa997121e969c995 --- sys/dev/iwm/if_iwm.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'sys/dev/iwm/if_iwm.c') diff --git a/sys/dev/iwm/if_iwm.c b/sys/dev/iwm/if_iwm.c index 268ccf836d51..a6f8e5b5b826 100644 --- a/sys/dev/iwm/if_iwm.c +++ b/sys/dev/iwm/if_iwm.c @@ -4029,12 +4029,6 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *sc) "%s: failed to add MAC\n", __func__); goto out; } - if ((error = iwm_mvm_power_update_mac(sc)) != 0) { - device_printf(sc->sc_dev, - "%s: failed to update power management\n", - __func__); - goto out; - } } if ((error = iwm_mvm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0], @@ -4050,6 +4044,12 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *sc) "%s: binding update cmd\n", __func__); goto out; } + if ((error = iwm_mvm_power_update_mac(sc)) != 0) { + device_printf(sc->sc_dev, + "%s: failed to update power management\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__); @@ -4408,6 +4408,12 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) __func__, error); } ivp->phy_ctxt = NULL; + error = iwm_mvm_power_update_mac(sc); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: failed to update power management\n", + __func__); + } IWM_UNLOCK(sc); IEEE80211_LOCK(ic); return myerr; -- cgit v1.2.3