All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mac80211: SMPS: Fix the overwrite of rx_chains in the interface loop.
@ 2014-01-04 21:24 Chaitanya T K
  2014-01-05  6:42 ` Emmanuel Grumbach
  0 siblings, 1 reply; 6+ messages in thread
From: Chaitanya T K @ 2014-01-04 21:24 UTC (permalink / raw)
  To: johannes, linux-wireless; +Cc: Chaitanya T K

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@gmail.com>
---

 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,

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-01-05  7:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-04 21:24 [PATCH] mac80211: SMPS: Fix the overwrite of rx_chains in the interface loop Chaitanya T K
2014-01-05  6:42 ` Emmanuel Grumbach
2014-01-05  7:21   ` Krishna Chaitanya
2014-01-05  7:33     ` Emmanuel Grumbach
2014-01-05  7:37       ` Emmanuel Grumbach
2014-01-05  7:43         ` Krishna Chaitanya

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.