diff mbox series

[RFC,V2,7/8] cfg80211: ibss: use 11a mandatory rates for 6GHz band operation

Message ID 1561461027-10793-8-git-send-email-arend.vanspriel@broadcom.com (mailing list archive)
State RFC
Delegated to: Johannes Berg
Headers show
Series nl80211: add 6GHz band support | expand

Commit Message

Arend van Spriel June 25, 2019, 11:10 a.m. UTC
The default mandatory rates, ie. when not specified by user-space, is
determined by the band. Select 11a rateset for 6GHz band.

Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Leon Zegers <leon.zegers@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
 net/wireless/ibss.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

Comments

Johannes Berg June 28, 2019, 1:04 p.m. UTC | #1
On Tue, 2019-06-25 at 13:10 +0200, Arend van Spriel wrote:
> The default mandatory rates, ie. when not specified by user-space, is
> determined by the band. Select 11a rateset for 6GHz band.

Hmm. Again, didn't you just say that 6 GHz didn't allow legacy rates,
and so these shouldn't be mandatory?

johannes
Igor Mitsyanko June 28, 2019, 9:36 p.m. UTC | #2
On 6/28/19 6:04 AM, Johannes Berg wrote:
>> The default mandatory rates, ie. when not specified by user-space, is
>> determined by the band. Select 11a rateset for 6GHz band.
> Hmm. Again, didn't you just say that 6 GHz didn't allow legacy rates,
> and so these shouldn't be mandatory?
> 
> johannes
> 

I believe 6GHz allows only HE and non-HT rates (for beacons etc).
diff mbox series

Patch

diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c
index d1743e6..ae8fe66 100644
--- a/net/wireless/ibss.c
+++ b/net/wireless/ibss.c
@@ -104,13 +104,19 @@  int __cfg80211_join_ibss(struct cfg80211_registered_device *rdev,
 		* use the mandatory rate set for 11b or
 		* 11a for maximum compatibility.
 		*/
-		struct ieee80211_supported_band *sband =
-			rdev->wiphy.bands[params->chandef.chan->band];
+		struct ieee80211_supported_band *sband;
+		enum nl80211_band band;
+		u32 flag;
 		int j;
-		u32 flag = params->chandef.chan->band == NL80211_BAND_5GHZ ?
-			IEEE80211_RATE_MANDATORY_A :
-			IEEE80211_RATE_MANDATORY_B;
 
+		band = params->chandef.chan->band;
+		if (band == NL80211_BAND_5GHZ ||
+		    band == NL80211_BAND_6GHZ)
+			flag = IEEE80211_RATE_MANDATORY_A;
+		else
+			flag = IEEE80211_RATE_MANDATORY_B;
+
+		sband = rdev->wiphy.bands[band];
 		for (j = 0; j < sband->n_bitrates; j++) {
 			if (sband->bitrates[j].flags & flag)
 				params->basic_rates |= BIT(j);