All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Puzyniak <marek.puzyniak@tieto.com>
To: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org
Cc: Marek Puzyniak <marek.puzyniak@tieto.com>
Subject: [PATCH v2 3/4] mac80211: initialize rate control earlier for tdls station
Date: Wed, 25 Feb 2015 08:55:10 +0100	[thread overview]
Message-ID: <1424850911-21017-4-git-send-email-marek.puzyniak@tieto.com> (raw)
In-Reply-To: <1424850911-21017-1-git-send-email-marek.puzyniak@tieto.com>

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>
---
 net/mac80211/cfg.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index dd4ff36..ae24ed3 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -983,12 +983,21 @@ static int sta_apply_auth_flags(struct ieee80211_local *local,
 	}
 
 	if (mask & BIT(NL80211_STA_FLAG_AUTHORIZED)) {
-		if (set & BIT(NL80211_STA_FLAG_AUTHORIZED))
+		if (set & BIT(NL80211_STA_FLAG_AUTHORIZED)) {
+			/*
+			 * 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_AUTHORIZED);
-		else if (test_sta_flag(sta, WLAN_STA_AUTHORIZED))
+		} else if (test_sta_flag(sta, WLAN_STA_AUTHORIZED)) {
 			ret = sta_info_move_state(sta, IEEE80211_STA_ASSOC);
-		else
+		} else {
 			ret = 0;
+		}
 		if (ret)
 			return ret;
 	}
@@ -1377,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.4


WARNING: multiple messages have this Message-ID (diff)
From: Marek Puzyniak <marek.puzyniak@tieto.com>
To: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org
Cc: Marek Puzyniak <marek.puzyniak@tieto.com>
Subject: [PATCH v2 3/4] mac80211: initialize rate control earlier for tdls station
Date: Wed, 25 Feb 2015 08:55:10 +0100	[thread overview]
Message-ID: <1424850911-21017-4-git-send-email-marek.puzyniak@tieto.com> (raw)
In-Reply-To: <1424850911-21017-1-git-send-email-marek.puzyniak@tieto.com>

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>
---
 net/mac80211/cfg.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index dd4ff36..ae24ed3 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -983,12 +983,21 @@ static int sta_apply_auth_flags(struct ieee80211_local *local,
 	}
 
 	if (mask & BIT(NL80211_STA_FLAG_AUTHORIZED)) {
-		if (set & BIT(NL80211_STA_FLAG_AUTHORIZED))
+		if (set & BIT(NL80211_STA_FLAG_AUTHORIZED)) {
+			/*
+			 * 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_AUTHORIZED);
-		else if (test_sta_flag(sta, WLAN_STA_AUTHORIZED))
+		} else if (test_sta_flag(sta, WLAN_STA_AUTHORIZED)) {
 			ret = sta_info_move_state(sta, IEEE80211_STA_ASSOC);
-		else
+		} else {
 			ret = 0;
+		}
 		if (ret)
 			return ret;
 	}
@@ -1377,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.4


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

  parent reply	other threads:[~2015-02-25  7:53 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-25  7:55 [PATCH v2 0/4] ath10k: add basic tdls support Marek Puzyniak
2015-02-25  7:55 ` Marek Puzyniak
2015-02-25  7:55 ` [PATCH v2 1/4] ath10k: unify tx mode and dispatch Marek Puzyniak
2015-02-25  7:55   ` Marek Puzyniak
2015-02-25  7:55 ` [PATCH v2 2/4] ath10k: make peer type configurable Marek Puzyniak
2015-02-25  7:55   ` Marek Puzyniak
2015-02-25  7:55 ` Marek Puzyniak [this message]
2015-02-25  7:55   ` [PATCH v2 3/4] mac80211: initialize rate control earlier for tdls station Marek Puzyniak
2015-02-27 12:50   ` Johannes Berg
2015-02-27 12:50     ` Johannes Berg
2015-03-01  8:21     ` Arik Nemtsov
2015-03-01  8:21       ` Arik Nemtsov
2015-03-03  9:18       ` Johannes Berg
2015-03-03  9:18         ` Johannes Berg
2015-03-03 10:02         ` Arik Nemtsov
2015-03-03 10:02           ` Arik Nemtsov
2015-03-03 10:06           ` Johannes Berg
2015-03-03 10:06             ` Johannes Berg
2015-03-03 10:07             ` Arik Nemtsov
2015-03-03 10:07               ` Arik Nemtsov
2015-03-04  8:16               ` Johannes Berg
2015-03-04  8:16                 ` Johannes Berg
2015-03-04 10:04                 ` Arik Nemtsov
2015-03-04 10:04                   ` Arik Nemtsov
2015-03-04 10:38                   ` Marek Puzyniak
2015-03-04 10:38                     ` Marek Puzyniak
2015-03-04 16:30                     ` Arik Nemtsov
2015-03-04 16:30                       ` Arik Nemtsov
2015-03-04 18:30                       ` Johannes Berg
2015-03-04 18:30                         ` Johannes Berg
2015-03-04 15:01     ` Kalle Valo
2015-03-04 15:01       ` Kalle Valo
2015-02-25  7:55 ` [PATCH v2 4/4] ath10k: introduce basic tdls functionality Marek Puzyniak
2015-02-25  7:55   ` Marek Puzyniak
2015-02-25 10:34   ` Michal Kazior
2015-02-25 10:34     ` Michal Kazior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1424850911-21017-4-git-send-email-marek.puzyniak@tieto.com \
    --to=marek.puzyniak@tieto.com \
    --cc=ath10k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.