diff mbox

[v2,3/4] mac80211: initialize rate control earlier for tdls station

Message ID CA+XVXfeG0TZ+jdRKhcZHzUjxffFbmzJBPtW2nrQ0+JjKC_+mbQ@mail.gmail.com (mailing list archive)
State Changes Requested
Delegated to: Johannes Berg
Headers show

Commit Message

Arik Nemtsov March 4, 2015, 4:30 p.m. UTC
On Wed, Mar 4, 2015 at 12:38 PM, Marek Puzyniak
<marek.puzyniak@tieto.com> wrote:
> On 4 March 2015 at 11:04, Arik Nemtsov <arik@wizery.com> wrote:
>> I can do it, but I'll probably only get to it next week.
>
> I will try to prepare patch this week, if not I will wait for Arik's
> proposition.
>
> For ath10k rate control need to be initialised before moving to
> STA_AUTHORIZED, so initialising rate control before STA_ASSOC is
> perfectly fine.

Ok I did get to it today :)
With the attached patch applied, and the patch "mac80211: update TDLS
sta spatial streams before auth" reverted, I'm getting good
performance on iwlwifi.

Arik

Comments

Johannes Berg March 4, 2015, 6:30 p.m. UTC | #1
On Wed, 2015-03-04 at 18:30 +0200, Arik Nemtsov wrote:
> On Wed, Mar 4, 2015 at 12:38 PM, Marek Puzyniak
> <marek.puzyniak@tieto.com> wrote:
> > On 4 March 2015 at 11:04, Arik Nemtsov <arik@wizery.com> wrote:
> >> I can do it, but I'll probably only get to it next week.
> >
> > I will try to prepare patch this week, if not I will wait for Arik's
> > proposition.
> >
> > For ath10k rate control need to be initialised before moving to
> > STA_AUTHORIZED, so initialising rate control before STA_ASSOC is
> > perfectly fine.
> 
> Ok I did get to it today :)
> With the attached patch applied, and the patch "mac80211: update TDLS
> sta spatial streams before auth" reverted, I'm getting good
> performance on iwlwifi.

Cool. I think I'll apply this, but with the comment fixed to say
"associated" :)

But perhaps you can send this as a real patch to the list?

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

From 133a9b280c23fa0d49e93dae8655b9514ac71fee Mon Sep 17 00:00:00 2001
From: Marek Puzyniak <marek.puzyniak@tieto.com>
Date: Wed, 25 Feb 2015 08:55:10 +0100
Subject: [PATCH] mac80211: initialize rate control earlier for tdls station

Currently when TDLS station in driver goes from assoc
to authorized 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 authorized state. It can be done by initializing
rate control after station transition to authorized 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 c13b1af..55b88c7 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;
@@ -1381,11 +1389,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