2020-05-29 08:17:52

by Arend Van Spriel

[permalink] [raw]
Subject: [PATCH] cfg80211: adapt to new channelization of the 6GHz band

The 6GHz band does not have regulatory approval yet, but things are
moving forward. However, that has led to a change in the channelization
of the 6GHz band which has been accepted in the 11ax specification.

This change is primarily thrown in to discuss how to deal with it.
I noticed ath11k adding 6G support with old channelization and ditto
for iw. It probably involves changes in hostapd as well.

Cc: Pradeep Kumar Chitrapu <[email protected]>
Cc: Jouni Malinen <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
net/wireless/util.c | 43 ++++++++++++++++++++++++++++++++++++++-----
1 file changed, 38 insertions(+), 5 deletions(-)

diff --git a/net/wireless/util.c b/net/wireless/util.c
index df75e58eca5d..f0a3a021ee0d 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -92,9 +92,11 @@ u32 ieee80211_channel_to_freq_khz(int chan, enum
nl80211_band band)
return MHZ_TO_KHZ(5000 + chan * 5);
break;
case NL80211_BAND_6GHZ:
- /* see 802.11ax D4.1 27.3.22.2 */
+ /* see 802.11ax D6.1 27.3.23.2 */
+ if (chan == 2)
+ return MHZ_TO_KHZ(5935);
if (chan <= 253)
- return 5940 + chan * 5;
+ return MHZ_TO_KHZ(5950 + chan * 5);
break;
case NL80211_BAND_60GHZ:
if (chan < 7)
@@ -119,11 +121,14 @@ int ieee80211_freq_khz_to_channel(u32 freq)
return (freq - 2407) / 5;
else if (freq >= 4910 && freq <= 4980)
return (freq - 4000) / 5;
- else if (freq < 5945)
+ else if (freq < 5935)
return (freq - 5000) / 5;
+ else if (freq == 5935)
+ /* see 802.11ax D6.1 27.3.23.2 */
+ return 2;
else if (freq <= 45000) /* DMG band lower limit */
- /* see 802.11ax D4.1 27.3.22.2 */
- return (freq - 5940) / 5;
+ /* see 802.11ax D6.1 27.3.23.2 */
+ return (freq - 5950) / 5;
else if (freq >= 58320 && freq <= 70200)
return (freq - 56160) / 2160;
else
@@ -1662,6 +1667,34 @@ bool ieee80211_chandef_to_operating_class(struct
cfg80211_chan_def *chandef,
return true;
}
+ /* 6GHz, channels 1..233 */
+ if (freq >= 5935 && freq <= 7115) {
+ switch (chandef->width) {
+ case NL80211_CHAN_WIDTH_20:
+ *op_class = 131;
+ break;
+ case NL80211_CHAN_WIDTH_40:
+ *op_class = 132;
+ break;
+ case NL80211_CHAN_WIDTH_80:
+ *op_class = 133;
+ break;
+ case NL80211_CHAN_WIDTH_160:
+ *op_class = 134;
+ break;
+ case NL80211_CHAN_WIDTH_80P80:
+ *op_class = 135;
+ break;
+ case NL80211_CHAN_WIDTH_5:
+ case NL80211_CHAN_WIDTH_10:
+ case NL80211_CHAN_WIDTH_20_NOHT:
+ default:
+ return false;
+ }
+
+ return true;
+ }
+
/* 56.16 GHz, channel 1..4 */
if (freq >= 56160 + 2160 * 1 && freq <= 56160 + 2160 * 6) {
if (chandef->width >= NL80211_CHAN_WIDTH_40)
--
2.18.0


2020-05-29 08:20:45

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] cfg80211: adapt to new channelization of the 6GHz band

On Fri, 2020-05-29 at 10:16 +0200, Arend Van Spriel wrote:
> The 6GHz band does not have regulatory approval yet, but things are
> moving forward. However, that has led to a change in the channelization
> of the 6GHz band which has been accepted in the 11ax specification.
>
> case NL80211_BAND_6GHZ:
> - /* see 802.11ax D4.1 27.3.22.2 */
> + /* see 802.11ax D6.1 27.3.23.2 */
> + if (chan == 2)
> + return MHZ_TO_KHZ(5935);

I think Jouni said this was operating class 136?

> + /* 6GHz, channels 1..233 */
> + if (freq >= 5935 && freq <= 7115) {
> + switch (chandef->width) {
> + case NL80211_CHAN_WIDTH_20:
> + *op_class = 131;
> + break;
> + case NL80211_CHAN_WIDTH_40:
> + *op_class = 132;
> + break;
> + case NL80211_CHAN_WIDTH_80:
> + *op_class = 133;
> + break;
> + case NL80211_CHAN_WIDTH_160:
> + *op_class = 134;
> + break;
> + case NL80211_CHAN_WIDTH_80P80:
> + *op_class = 135;
> + break;
> + case NL80211_CHAN_WIDTH_5:
> + case NL80211_CHAN_WIDTH_10:
> + case NL80211_CHAN_WIDTH_20_NOHT:
> + default:
> + return false;
> + }

If so, isn't that missing here?

johannes

2020-05-29 08:43:42

by Arend Van Spriel

[permalink] [raw]
Subject: Re: [PATCH] cfg80211: adapt to new channelization of the 6GHz band

On 5/29/2020 10:19 AM, Johannes Berg wrote:
> On Fri, 2020-05-29 at 10:16 +0200, Arend Van Spriel wrote:
>> The 6GHz band does not have regulatory approval yet, but things are
>> moving forward. However, that has led to a change in the channelization
>> of the 6GHz band which has been accepted in the 11ax specification.
>>
>> case NL80211_BAND_6GHZ:
>> - /* see 802.11ax D4.1 27.3.22.2 */
>> + /* see 802.11ax D6.1 27.3.23.2 */
>> + if (chan == 2)
>> + return MHZ_TO_KHZ(5935);
>
> I think Jouni said this was operating class 136?
>
>> + /* 6GHz, channels 1..233 */
>> + if (freq >= 5935 && freq <= 7115) {
>> + switch (chandef->width) {
>> + case NL80211_CHAN_WIDTH_20:
>> + *op_class = 131;
>> + break;
>> + case NL80211_CHAN_WIDTH_40:
>> + *op_class = 132;
>> + break;
>> + case NL80211_CHAN_WIDTH_80:
>> + *op_class = 133;
>> + break;
>> + case NL80211_CHAN_WIDTH_160:
>> + *op_class = 134;
>> + break;
>> + case NL80211_CHAN_WIDTH_80P80:
>> + *op_class = 135;
>> + break;
>> + case NL80211_CHAN_WIDTH_5:
>> + case NL80211_CHAN_WIDTH_10:
>> + case NL80211_CHAN_WIDTH_20_NOHT:
>> + default:
>> + return false;
>> + }
>
> If so, isn't that missing here?

At least should indeed take it into account here. However I can not get
my hands on the 6.1 spec (yet). I have the document with editor
instructions and operating class for channel 2 is marked as <ANA> in
table Annex E-4. 136 would be the logical value, but without the 6.1
spec I am not sure. I will resend the patch.

Regards,
Arend