The interface loop identifies the no of static and dynamic smps chains, but overwrites their values across the VIF's (assuming there are more than one, in my case its AP and STA loopback), so the driver might not intimated about this update of SMPS mode, is the value is same. So inform driver for every VIF. For Ex: STA's SMPS state is changed, but in the loop AP appears at the last, SMPS state of AP is unchanged hence not intimated to the driver. Signed-off-by: Chaitanya T K <chaitanya.mgit@xxxxxxxxx> --- net/mac80211/chan.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c index f43613a..e153a7e 100644 --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c @@ -483,26 +483,26 @@ void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local, rx_chains_static = max(rx_chains_static, needed_static); rx_chains_dynamic = max(rx_chains_dynamic, needed_dynamic); - } - rcu_read_unlock(); + if (!local->use_chanctx) { + if (rx_chains_static > 1) + local->smps_mode = IEEE80211_SMPS_OFF; + else if (rx_chains_dynamic > 1) + local->smps_mode = IEEE80211_SMPS_DYNAMIC; + else + local->smps_mode = IEEE80211_SMPS_STATIC; + ieee80211_hw_config(local, 0); + } - if (!local->use_chanctx) { - if (rx_chains_static > 1) - local->smps_mode = IEEE80211_SMPS_OFF; - else if (rx_chains_dynamic > 1) - local->smps_mode = IEEE80211_SMPS_DYNAMIC; - else - local->smps_mode = IEEE80211_SMPS_STATIC; - ieee80211_hw_config(local, 0); - } + if (rx_chains_static == chanctx->conf.rx_chains_static && + rx_chains_dynamic == chanctx->conf.rx_chains_dynamic) + return; - if (rx_chains_static == chanctx->conf.rx_chains_static && - rx_chains_dynamic == chanctx->conf.rx_chains_dynamic) - return; + chanctx->conf.rx_chains_static = rx_chains_static; + chanctx->conf.rx_chains_dynamic = rx_chains_dynamic; + drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RX_CHAINS); + } + rcu_read_unlock(); - chanctx->conf.rx_chains_static = rx_chains_static; - chanctx->conf.rx_chains_dynamic = rx_chains_dynamic; - drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RX_CHAINS); } int ieee80211_vif_use_channel(struct ieee80211_sub_if_data *sdata, -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html