ATH11K Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
To: ath11k@lists.infradead.org
Cc: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
Subject: [PATCH] ath11k: set HE phymodes at vdev start by default
Date: Tue, 25 Jun 2019 04:59:15 +0530	[thread overview]
Message-ID: <1561418955-9119-1-git-send-email-pradeepc@codeaurora.org> (raw)

phymode cannot be classified at vdev_start as driver wont be aware of
operating mode (11n/11ac/11ax) at this point. So setting HE phymodes
by default corresponding to bandwidth at vdev start will prevent FW
assert when phymode configured for the connecting peer is greater
than the phymode configured for the VDEV. phymode for each peer is
configured appropriately at the time of peer association.

Tested on IPQ8074.

Suggested-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/mac.c | 34 ++++------------------------------
 1 file changed, 4 insertions(+), 30 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 7a6c92760535..dccf4597d1ef 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -107,48 +107,26 @@
 };
 
 static const int
-ath11k_phymodes[NUM_NL80211_BANDS][2][ATH11K_CHAN_WIDTH_NUM] = {
+ath11k_phymodes[NUM_NL80211_BANDS][ATH11K_CHAN_WIDTH_NUM] = {
 	[NL80211_BAND_2GHZ] = {
-		{
 			[NL80211_CHAN_WIDTH_5] = MODE_UNKNOWN,
 			[NL80211_CHAN_WIDTH_10] = MODE_UNKNOWN,
-			[NL80211_CHAN_WIDTH_20_NOHT] = MODE_11G,
-			[NL80211_CHAN_WIDTH_20] = MODE_11NG_HT20,
-			[NL80211_CHAN_WIDTH_40] = MODE_11NG_HT40,
-			[NL80211_CHAN_WIDTH_80] = MODE_UNKNOWN,
-			[NL80211_CHAN_WIDTH_80P80] = MODE_UNKNOWN,
-			[NL80211_CHAN_WIDTH_160] = MODE_UNKNOWN,
-		}, {
-			[NL80211_CHAN_WIDTH_5] = MODE_UNKNOWN,
-			[NL80211_CHAN_WIDTH_10] = MODE_UNKNOWN,
-			[NL80211_CHAN_WIDTH_20_NOHT] = MODE_11G,
+			[NL80211_CHAN_WIDTH_20_NOHT] = MODE_11AX_HE20_2G,
 			[NL80211_CHAN_WIDTH_20] = MODE_11AX_HE20_2G,
 			[NL80211_CHAN_WIDTH_40] = MODE_11AX_HE40_2G,
 			[NL80211_CHAN_WIDTH_80] = MODE_11AX_HE80_2G,
 			[NL80211_CHAN_WIDTH_80P80] = MODE_UNKNOWN,
 			[NL80211_CHAN_WIDTH_160] = MODE_UNKNOWN,
-		},
 	},
 	[NL80211_BAND_5GHZ] = {
-		{
-			[NL80211_CHAN_WIDTH_5] = MODE_UNKNOWN,
-			[NL80211_CHAN_WIDTH_10] = MODE_UNKNOWN,
-			[NL80211_CHAN_WIDTH_20_NOHT] = MODE_11A,
-			[NL80211_CHAN_WIDTH_20] = MODE_11AC_VHT20,
-			[NL80211_CHAN_WIDTH_40] = MODE_11AC_VHT40,
-			[NL80211_CHAN_WIDTH_80] = MODE_11AC_VHT80,
-			[NL80211_CHAN_WIDTH_160] = MODE_11AC_VHT160,
-			[NL80211_CHAN_WIDTH_80P80] = MODE_11AC_VHT80_80,
-		}, {
 			[NL80211_CHAN_WIDTH_5] = MODE_UNKNOWN,
 			[NL80211_CHAN_WIDTH_10] = MODE_UNKNOWN,
-			[NL80211_CHAN_WIDTH_20_NOHT] = MODE_11A,
+			[NL80211_CHAN_WIDTH_20_NOHT] = MODE_11AX_HE20,
 			[NL80211_CHAN_WIDTH_20] = MODE_11AX_HE20,
 			[NL80211_CHAN_WIDTH_40] = MODE_11AX_HE40,
 			[NL80211_CHAN_WIDTH_80] = MODE_11AX_HE80,
 			[NL80211_CHAN_WIDTH_160] = MODE_11AX_HE160,
 			[NL80211_CHAN_WIDTH_80P80] = MODE_11AX_HE80_80,
-		},
 	},
 };
 
@@ -4168,11 +4146,7 @@ static inline int ath11k_mac_vdev_setup_sync(struct ath11k *ar)
 	arg.channel.band_center_freq1 = chandef->center_freq1;
 	arg.channel.band_center_freq2 = chandef->center_freq2;
 	arg.channel.mode =
-		ath11k_phymodes[chandef->chan->band][he_support][chandef->width];
-	if (arg.channel.mode == MODE_11G &&
-	    chandef->chan->flags & IEEE80211_CHAN_NO_OFDM)
-		arg.channel.mode = MODE_11B;
-	WARN_ON(arg.channel.mode == MODE_UNKNOWN);
+		ath11k_phymodes[chandef->chan->band][chandef->width];
 
 	arg.channel.min_power = 0;
 	arg.channel.max_power = chandef->chan->max_power * 2;
-- 
1.9.1


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

             reply	other threads:[~2019-06-24 23:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24 23:29 Pradeep Kumar Chitrapu [this message]
2019-06-26  7:54 ` [PATCH] ath11k: set HE phymodes at vdev start by default 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=1561418955-9119-1-git-send-email-pradeepc@codeaurora.org \
    --to=pradeepc@codeaurora.org \
    --cc=ath11k@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox