2019-08-02 14:04:31

by Arend Van Spriel

[permalink] [raw]
Subject: [PATCH V3 0/8] nl80211: add 6GHz band support

Changing to formal patch series instead of RFC.

In 802.11ax D4.0 a new band has been proposed. This series contains
changes to cfg80211 for supporting this band. With 2GHz and 5GHz there
was no overlap in channel number. However, this new band has channel
numbers with a range from 1 up to 253. The only place I could find an
issue with this is in cfg80211_wext_freq(). Not sure how to deal with
that so it is not part of this series.

The series applies to the master branch of the mac80211-next repository.

Arend van Spriel (8):
nl80211: add 6GHz band definition to enum nl80211_band
cfg80211: add 6GHz UNII band definitions
cfg80211: util: add 6GHz channel to freq conversion and vice versa
cfg80211: extend ieee80211_operating_class_to_band() for 6GHz
cfg80211: add 6GHz in code handling array with NUM_NL80211_BANDS
entries
cfg80211: use same IR permissive rules for 6GHz band
cfg80211: ibss: use 11a mandatory rates for 6GHz band operation
cfg80211: apply same mandatory rate flags for 5GHz and 6GHz

include/uapi/linux/nl80211.h | 2 ++
net/mac80211/tx.c | 1 +
net/wireless/chan.c | 3 ++-
net/wireless/ibss.c | 16 +++++++++++-----
net/wireless/nl80211.c | 1 +
net/wireless/reg.c | 21 +++++++++++++++++++--
net/wireless/trace.h | 3 ++-
net/wireless/util.c | 14 +++++++++++++-
8 files changed, 51 insertions(+), 10 deletions(-)

--
1.9.1


2019-08-02 14:04:31

by Arend Van Spriel

[permalink] [raw]
Subject: [PATCH V3 5/8] cfg80211: add 6GHz in code handling array with NUM_NL80211_BANDS entries

In nl80211.c there is a policy for all bands in NUM_NL80211_BANDS and
in trace.h there is a callback trace for multicast rates which is per
band in NUM_NL80211_BANDS. Both need to be extended for the new
NL80211_BAND_6GHZ.

Reviewed-by: Pieter-Paul Giesberts <[email protected]>
Reviewed-by: Leon Zegers <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
net/wireless/nl80211.c | 1 +
net/wireless/trace.h | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 1a107f2..d28d745 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -677,6 +677,7 @@ static int validate_ie_attr(const struct nlattr *attr,
nl80211_match_band_rssi_policy[NUM_NL80211_BANDS] = {
[NL80211_BAND_2GHZ] = { .type = NLA_S32 },
[NL80211_BAND_5GHZ] = { .type = NLA_S32 },
+ [NL80211_BAND_6GHZ] = { .type = NLA_S32 },
[NL80211_BAND_60GHZ] = { .type = NLA_S32 },
};

diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index 4fbb91a..d98ad2b 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -2446,10 +2446,11 @@
sizeof(int) * NUM_NL80211_BANDS);
),
TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", "
- "mcast_rates [2.4GHz=0x%x, 5.2GHz=0x%x, 60GHz=0x%x]",
+ "mcast_rates [2.4GHz=0x%x, 5.2GHz=0x%x, 6GHz=0x%x, 60GHz=0x%x]",
WIPHY_PR_ARG, NETDEV_PR_ARG,
__entry->mcast_rate[NL80211_BAND_2GHZ],
__entry->mcast_rate[NL80211_BAND_5GHZ],
+ __entry->mcast_rate[NL80211_BAND_6GHZ],
__entry->mcast_rate[NL80211_BAND_60GHZ])
);

--
1.9.1

2019-08-02 14:04:48

by Arend Van Spriel

[permalink] [raw]
Subject: [PATCH V3 7/8] cfg80211: ibss: use 11a mandatory rates for 6GHz band operation

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 <[email protected]>
Reviewed-by: Leon Zegers <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
net/wireless/ibss.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)

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);
--
1.9.1

2019-08-02 14:04:48

by Arend Van Spriel

[permalink] [raw]
Subject: [PATCH V3 4/8] cfg80211: extend ieee80211_operating_class_to_band() for 6GHz

Add 6GHz operating class range as defined in 802.11ax D4.1 Annex E.

Reviewed-by: Pieter-Paul Giesberts <[email protected]>
Reviewed-by: Leon Zegers <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
net/wireless/util.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/net/wireless/util.c b/net/wireless/util.c
index 4e633d4..4462837 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -1474,6 +1474,9 @@ bool ieee80211_operating_class_to_band(u8 operating_class,
case 128 ... 130:
*band = NL80211_BAND_5GHZ;
return true;
+ case 131 ... 135:
+ *band = NL80211_BAND_6GHZ;
+ return true;
case 81:
case 82:
case 83:
--
1.9.1

2019-08-02 14:04:48

by Arend Van Spriel

[permalink] [raw]
Subject: [PATCH V3 8/8] cfg80211: apply same mandatory rate flags for 5GHz and 6GHz

For the new 6GHz band the same rules apply for mandatory rates so
add it to set_mandatory_flags_band() function.

Reviewed-by: Pieter-Paul Giesberts <[email protected]>
Reviewed-by: Leon Zegers <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
net/wireless/util.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/net/wireless/util.c b/net/wireless/util.c
index 4462837..f0558e7 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -156,6 +156,7 @@ static void set_mandatory_flags_band(struct ieee80211_supported_band *sband)

switch (sband->band) {
case NL80211_BAND_5GHZ:
+ case NL80211_BAND_6GHZ:
want = 3;
for (i = 0; i < sband->n_bitrates; i++) {
if (sband->bitrates[i].bitrate == 60 ||
--
1.9.1

2019-08-02 14:06:31

by Arend Van Spriel

[permalink] [raw]
Subject: [PATCH V3 6/8] cfg80211: use same IR permissive rules for 6GHz band

The function cfg80211_ir_permissive_chan() is applicable for
6GHz band as well so make sure it is handled.

Reviewed-by: Pieter-Paul Giesberts <[email protected]>
Reviewed-by: Leon Zegers <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
net/wireless/chan.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index 7dc1bbd..7c9d204 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -894,7 +894,8 @@ static bool cfg80211_ir_permissive_chan(struct wiphy *wiphy,
if (chan == other_chan)
return true;

- if (chan->band != NL80211_BAND_5GHZ)
+ if (chan->band != NL80211_BAND_5GHZ &&
+ chan->band != NL80211_BAND_6GHZ)
continue;

r1 = cfg80211_get_unii(chan->center_freq);
--
1.9.1

2019-08-02 14:06:31

by Arend Van Spriel

[permalink] [raw]
Subject: [PATCH V3 2/8] cfg80211: add 6GHz UNII band definitions

For the new 6GHz there are new UNII band definitions as listed
in the FCC notice [1].

[1] https://docs.fcc.gov/public/attachments/FCC-18-147A1_Rcd.pdf

Reviewed-by: Pieter-Paul Giesberts <[email protected]>
Reviewed-by: Leon Zegers <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
net/wireless/reg.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 4831ad74..646107a 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -3806,8 +3806,9 @@ void wiphy_regulatory_deregister(struct wiphy *wiphy)
}

/*
- * See http://www.fcc.gov/document/5-ghz-unlicensed-spectrum-unii, for
- * UNII band definitions
+ * See FCC notices for UNII band definitions
+ * 5GHz: https://www.fcc.gov/document/5-ghz-unlicensed-spectrum-unii
+ * 6GHz: https://www.fcc.gov/document/fcc-proposes-more-spectrum-unlicensed-use-0
*/
int cfg80211_get_unii(int freq)
{
@@ -3831,6 +3832,22 @@ int cfg80211_get_unii(int freq)
if (freq > 5725 && freq <= 5825)
return 4;

+ /* UNII-5 */
+ if (freq > 5925 && freq <= 6425)
+ return 5;
+
+ /* UNII-6 */
+ if (freq > 6425 && freq <= 6525)
+ return 6;
+
+ /* UNII-7 */
+ if (freq > 6525 && freq <= 6875)
+ return 7;
+
+ /* UNII-8 */
+ if (freq > 6875 && freq <= 7125)
+ return 8;
+
return -EINVAL;
}

--
1.9.1

2019-08-02 14:06:31

by Arend Van Spriel

[permalink] [raw]
Subject: [PATCH V3 1/8] nl80211: add 6GHz band definition to enum nl80211_band

In the 802.11ax specification a new band is introduced, which
is also proposed by FCC for unlicensed use. This band is referred
to as 6GHz spanning frequency range from 5925 to 7125 MHz.

Reviewed-by: Pieter-Paul Giesberts <[email protected]>
Reviewed-by: Leon Zegers <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
changes:
- V2
fix ABI breakage by appending the new band definition.
- V3
fix warning (-Wswitch) in mac80211.
---
include/uapi/linux/nl80211.h | 2 ++
net/mac80211/tx.c | 1 +
2 files changed, 3 insertions(+)

diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 822851d..4d5988f 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -4543,6 +4543,7 @@ enum nl80211_txrate_gi {
* @NL80211_BAND_2GHZ: 2.4 GHz ISM band
* @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz)
* @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 69.12 GHz)
+ * @NL80211_BAND_6GHZ: around 6 GHz band (5.9 - 7.2 GHz)
* @NUM_NL80211_BANDS: number of bands, avoid using this in userspace
* since newer kernel versions may support more bands
*/
@@ -4550,6 +4551,7 @@ enum nl80211_band {
NL80211_BAND_2GHZ,
NL80211_BAND_5GHZ,
NL80211_BAND_60GHZ,
+ NL80211_BAND_6GHZ,

NUM_NL80211_BANDS,
};
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 235c637..1fa4227 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -162,6 +162,7 @@ static __le16 ieee80211_duration(struct ieee80211_tx_data *tx,
break;
}
case NL80211_BAND_5GHZ:
+ case NL80211_BAND_6GHZ:
if (r->flags & IEEE80211_RATE_MANDATORY_A)
mrate = r->bitrate;
break;
--
1.9.1

2019-09-22 19:21:31

by Arend Van Spriel

[permalink] [raw]
Subject: Re: [PATCH V3 0/8] nl80211: add 6GHz band support

+ linux-wireless

On September 19, 2019 8:25:57 PM Jeff Johnson <[email protected]>
wrote:

> On 2019-08-02 04:30, Arend van Spriel wrote:
>> Changing to formal patch series instead of RFC.
>>
>>
>> In 802.11ax D4.0 a new band has been proposed. This series contains
>> changes to cfg80211 for supporting this band. With 2GHz and 5GHz there
>> was no overlap in channel number. However, this new band has channel
>> numbers with a range from 1 up to 253. The only place I could find an
>> issue with this is in cfg80211_wext_freq(). Not sure how to deal with
>> that so it is not part of this series.
>>
>>
>> The series applies to the master branch of the mac80211-next
>> repository.
>>
>>
>> Arend van Spriel (8):
>> nl80211: add 6GHz band definition to enum nl80211_band
>> cfg80211: add 6GHz UNII band definitions
>> cfg80211: util: add 6GHz channel to freq conversion and vice versa
>> cfg80211: extend ieee80211_operating_class_to_band() for 6GHz
>> cfg80211: add 6GHz in code handling array with NUM_NL80211_BANDS
>> entries
>> cfg80211: use same IR permissive rules for 6GHz band
>> cfg80211: ibss: use 11a mandatory rates for 6GHz band operation
>> cfg80211: apply same mandatory rate flags for 5GHz and 6GHz
>>
>>
>> include/uapi/linux/nl80211.h | 2 ++
>> net/mac80211/tx.c | 1 +
>> net/wireless/chan.c | 3 ++-
>> net/wireless/ibss.c | 16 +++++++++++-----
>> net/wireless/nl80211.c | 1 +
>> net/wireless/reg.c | 21 +++++++++++++++++++--
>> net/wireless/trace.h | 3 ++-
>> net/wireless/util.c | 14 +++++++++++++-
>> 8 files changed, 51 insertions(+), 10 deletions(-)
>
> Curious how you are populating the wiphy->bands[6 GHz].
> If we don't set ht_cap.ht_supported and/or vht_cap.vht_supported then
> cfg80211_chandef_usable() fails, but setting those flags on 6 GHz seems
> broken.

Hi Jeff,

Good point. Actually, for 6GHz a couple of (v)ht capabilities are still
applicable and exchanged using HE extended capabilities element. My idea
was that these (v)ht capabilities would be reported to user-space same
as for the other bands so that would imply those flags are also set for
6GHz. This may look odd as the statement "6G is HE only" applies, but
still some (v)ht functionality is used in HE. Despite this it may be
good to extend the cfg80211_chandef_usable() for HE in general and cover
the 6G case as well. The intended driver implementation in brcmfmac is
still being worked on so issues might arise.

Regards,
Arend