On Wed, Mar 4, 2015 at 12:38 PM, Marek Puzyniak <marek.puzyniak@xxxxxxxxx> wrote: > On 4 March 2015 at 11:04, Arik Nemtsov <arik@xxxxxxxxxx> 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
From 133a9b280c23fa0d49e93dae8655b9514ac71fee Mon Sep 17 00:00:00 2001 From: Marek Puzyniak <marek.puzyniak@xxxxxxxxx> 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@xxxxxxxxx> Signed-off-by: Arik Nemtsov <arikx.nemtsov@xxxxxxxxx> --- 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