linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: initialize rate control earlier for tdls station
@ 2015-03-08 16:04 Arik Nemtsov
  2015-03-17 10:00 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Arik Nemtsov @ 2015-03-08 16:04 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg

From: Marek Puzyniak <marek.puzyniak@tieto.com>

Currently when TDLS station in driver goes from authorized
to associated state it can not use rate control parameters
because rate control is not initialized yet. Some drivers
require parameters already initialized by rate control when
entering associated state. It can be done by initializing
rate control after station transition to associated state
but before notifying driver about that.

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
---
 net/mac80211/cfg.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 94889de..0e43e6e 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -977,6 +977,14 @@ static int sta_apply_auth_flags(struct ieee80211_local *local,
 	if (mask & BIT(NL80211_STA_FLAG_ASSOCIATED) &&
 	    set & BIT(NL80211_STA_FLAG_ASSOCIATED) &&
 	    !test_sta_flag(sta, WLAN_STA_ASSOC)) {
+		/*
+		 * When peer becomes authorized, init rate control as
+		 * well. Some drivers require rate control initialized
+		 * before drv_sta_state() is called.
+		 */
+		if (test_sta_flag(sta, WLAN_STA_TDLS_PEER))
+			rate_control_rate_init(sta);
+
 		ret = sta_info_move_state(sta, IEEE80211_STA_ASSOC);
 		if (ret)
 			return ret;
@@ -1378,11 +1386,6 @@ static int ieee80211_change_station(struct wiphy *wiphy,
 	if (err)
 		goto out_err;
 
-	/* When peer becomes authorized, init rate control as well */
-	if (test_sta_flag(sta, WLAN_STA_TDLS_PEER) &&
-	    test_sta_flag(sta, WLAN_STA_AUTHORIZED))
-		rate_control_rate_init(sta);
-
 	mutex_unlock(&local->sta_mtx);
 
 	if ((sdata->vif.type == NL80211_IFTYPE_AP ||
-- 
2.1.0


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

* Re: [PATCH] mac80211: initialize rate control earlier for tdls station
  2015-03-08 16:04 [PATCH] mac80211: initialize rate control earlier for tdls station Arik Nemtsov
@ 2015-03-17 10:00 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2015-03-17 10:00 UTC (permalink / raw)
  To: Arik Nemtsov; +Cc: linux-wireless

On Sun, 2015-03-08 at 18:04 +0200, Arik Nemtsov wrote:
> From: Marek Puzyniak <marek.puzyniak@tieto.com>
> 
> Currently when TDLS station in driver goes from authorized

from authenticated

> to associated state it can not use rate control parameters
> because rate control is not initialized yet. Some drivers
> require parameters already initialized by rate control when
> entering associated state. It can be done by initializing
> rate control after station transition to associated state
> but before notifying driver about that.

Applied, with the minor fix in the commit log above and the comment in
the code.

johannes


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

end of thread, other threads:[~2015-03-17 10:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-08 16:04 [PATCH] mac80211: initialize rate control earlier for tdls station Arik Nemtsov
2015-03-17 10:00 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).