All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Kazior <michal.kazior@tieto.com>
To: ath10k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org, Michal Kazior <michal.kazior@tieto.com>
Subject: [PATCH 1/5] ath10k: improve 11b coex
Date: Wed, 10 Dec 2014 13:31:50 +0100	[thread overview]
Message-ID: <1418214714-29689-2-git-send-email-michal.kazior@tieto.com> (raw)
In-Reply-To: <1418214714-29689-1-git-send-email-michal.kazior@tieto.com>

Some firmware revisions need peer phymode to be
specified as MODE_11B when associating as station
to a 11b AP. Otherwise they can starve other
stations.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
 drivers/net/wireless/ath/ath10k/mac.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index fe61201..950322d 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -1416,6 +1416,12 @@ static void ath10k_peer_assoc_h_qos(struct ath10k *ar,
 	}
 }
 
+static bool ath10k_mac_sta_has_11g_rates(struct ieee80211_sta *sta)
+{
+	/* First 4 rates in ath10k_rates are CCK (11b) rates. */
+	return sta->supp_rates[IEEE80211_BAND_2GHZ] >> 4;
+}
+
 static void ath10k_peer_assoc_h_phymode(struct ath10k *ar,
 					struct ieee80211_vif *vif,
 					struct ieee80211_sta *sta,
@@ -1430,8 +1436,10 @@ static void ath10k_peer_assoc_h_phymode(struct ath10k *ar,
 				phymode = MODE_11NG_HT40;
 			else
 				phymode = MODE_11NG_HT20;
-		} else {
+		} else if (ath10k_mac_sta_has_11g_rates(sta)) {
 			phymode = MODE_11G;
+		} else {
+			phymode = MODE_11B;
 		}
 
 		break;
@@ -4724,6 +4732,9 @@ static const struct ieee80211_channel ath10k_5ghz_channels[] = {
 	CHAN5G(165, 5825, 0),
 };
 
+/* Note: Be careful if you re-order these. There is code which depends on this
+ * ordering.
+ */
 static struct ieee80211_rate ath10k_rates[] = {
 	/* CCK */
 	RATETAB_ENT(10,  0x82, 0),
-- 
1.8.5.3


WARNING: multiple messages have this Message-ID (diff)
From: Michal Kazior <michal.kazior@tieto.com>
To: ath10k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org, Michal Kazior <michal.kazior@tieto.com>
Subject: [PATCH 1/5] ath10k: improve 11b coex
Date: Wed, 10 Dec 2014 13:31:50 +0100	[thread overview]
Message-ID: <1418214714-29689-2-git-send-email-michal.kazior@tieto.com> (raw)
In-Reply-To: <1418214714-29689-1-git-send-email-michal.kazior@tieto.com>

Some firmware revisions need peer phymode to be
specified as MODE_11B when associating as station
to a 11b AP. Otherwise they can starve other
stations.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
 drivers/net/wireless/ath/ath10k/mac.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index fe61201..950322d 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -1416,6 +1416,12 @@ static void ath10k_peer_assoc_h_qos(struct ath10k *ar,
 	}
 }
 
+static bool ath10k_mac_sta_has_11g_rates(struct ieee80211_sta *sta)
+{
+	/* First 4 rates in ath10k_rates are CCK (11b) rates. */
+	return sta->supp_rates[IEEE80211_BAND_2GHZ] >> 4;
+}
+
 static void ath10k_peer_assoc_h_phymode(struct ath10k *ar,
 					struct ieee80211_vif *vif,
 					struct ieee80211_sta *sta,
@@ -1430,8 +1436,10 @@ static void ath10k_peer_assoc_h_phymode(struct ath10k *ar,
 				phymode = MODE_11NG_HT40;
 			else
 				phymode = MODE_11NG_HT20;
-		} else {
+		} else if (ath10k_mac_sta_has_11g_rates(sta)) {
 			phymode = MODE_11G;
+		} else {
+			phymode = MODE_11B;
 		}
 
 		break;
@@ -4724,6 +4732,9 @@ static const struct ieee80211_channel ath10k_5ghz_channels[] = {
 	CHAN5G(165, 5825, 0),
 };
 
+/* Note: Be careful if you re-order these. There is code which depends on this
+ * ordering.
+ */
 static struct ieee80211_rate ath10k_rates[] = {
 	/* CCK */
 	RATETAB_ENT(10,  0x82, 0),
-- 
1.8.5.3


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

  reply	other threads:[~2014-12-10 12:44 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-10 12:31 [PATCH 0/5] ath10k: a bunch of STA-related fixes Michal Kazior
2014-12-10 12:31 ` Michal Kazior
2014-12-10 12:31 ` Michal Kazior [this message]
2014-12-10 12:31   ` [PATCH 1/5] ath10k: improve 11b coex Michal Kazior
2014-12-10 12:31 ` [PATCH 2/5] ath10k: fix STA u-APSD Michal Kazior
2014-12-10 12:31   ` Michal Kazior
2014-12-11  9:56   ` Michal Kazior
2014-12-11  9:56     ` Michal Kazior
2014-12-10 12:31 ` [PATCH 3/5] ath10k: prevent invalid ps timeout config Michal Kazior
2014-12-10 12:31   ` Michal Kazior
2014-12-10 12:31 ` [PATCH 4/5] ath10k: enable per-vif sta powersave Michal Kazior
2014-12-10 12:31   ` Michal Kazior
2014-12-10 12:31 ` [PATCH 5/5] ath10k: advertise p2p dev support Michal Kazior
2014-12-10 12:31   ` Michal Kazior
2014-12-12 11:41 ` [PATCH v2 0/5] ath10k: a bunch of STA-related fixes Michal Kazior
2014-12-12 11:41   ` Michal Kazior
2014-12-12 11:41   ` [PATCH v2 1/5] ath10k: improve 11b coex Michal Kazior
2014-12-12 11:41     ` Michal Kazior
2014-12-12 11:41   ` [PATCH v2 2/5] ath10k: fix STA u-APSD Michal Kazior
2014-12-12 11:41     ` Michal Kazior
2014-12-12 11:41   ` [PATCH v2 3/5] ath10k: prevent invalid ps timeout config Michal Kazior
2014-12-12 11:41     ` Michal Kazior
2014-12-12 11:41   ` [PATCH v2 4/5] ath10k: enable per-vif sta powersave Michal Kazior
2014-12-12 11:41     ` Michal Kazior
2014-12-12 11:41   ` [PATCH v2 5/5] ath10k: advertise p2p dev support Michal Kazior
2014-12-12 11:41     ` Michal Kazior
2014-12-16  7:27   ` [PATCH v2 0/5] ath10k: a bunch of STA-related fixes Kalle Valo
2014-12-16  7:27     ` Kalle Valo

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=1418214714-29689-2-git-send-email-michal.kazior@tieto.com \
    --to=michal.kazior@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.