2019-06-25 12:59:47

by Arend van Spriel

[permalink] [raw]
Subject: [RFC V2 0/8] nl80211: add 6GHz band support

This is more or less a resend. The difference with the previous RFC is
in the nl80211 API as the previous RFC was breaking ABI.

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/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 +++++++++++++-
7 files changed, 50 insertions(+), 10 deletions(-)

--
1.9.1


2019-06-25 13:01:25

by Arend van Spriel

[permalink] [raw]
Subject: [RFC V2 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-06-25 13:01:37

by Arend van Spriel

[permalink] [raw]
Subject: [RFC V2 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 fc83dd1..57bc35a 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -667,6 +667,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-06-25 13:02:28

by Arend van Spriel

[permalink] [raw]
Subject: [RFC V2 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-06-25 13:02:32

by Arend van Spriel

[permalink] [raw]
Subject: [RFC V2 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-06-25 13:03:03

by Arend van Spriel

[permalink] [raw]
Subject: [RFC V2 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-06-25 13:03:06

by Arend van Spriel

[permalink] [raw]
Subject: [RFC V2 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.
---
include/uapi/linux/nl80211.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 8fc3a43..45b9117 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -4536,6 +4536,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
*/
@@ -4543,6 +4544,7 @@ enum nl80211_band {
NL80211_BAND_2GHZ,
NL80211_BAND_5GHZ,
NL80211_BAND_60GHZ,
+ NL80211_BAND_6GHZ,

NUM_NL80211_BANDS,
};
--
1.9.1

2019-06-28 13:05:22

by Johannes Berg

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

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

2019-06-28 13:06:31

by Johannes Berg

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

On Tue, 2019-06-25 at 13:10 +0200, Arend van Spriel wrote:
>
> +++ 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])
> );

This doesn't really - you just pointed out that legacy rates aren't
permitted, and so this bitmap doesn't make sense for 6 GHz?

johannes

2019-06-28 22:22:16

by Igor Mitsyanko

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

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).

2019-07-24 09:35:38

by Johannes Berg

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

Hi Arend,

After all the discussion, I think we want this? Care to resend?

I think I want it at least because we shouldn't advertise HT/VHT on 6
GHz as is (just as part of HE) and that's easier if we have a different
band enum, for the capability storage...

> 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.

Just finally break wext and say if you want to use 6 GHz you need to use
nl80211? :)

johannes

2019-07-24 14:07:01

by Arend van Spriel

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

On July 24, 2019 11:35:14 AM Johannes Berg <[email protected]> wrote:

> Hi Arend,
>
>
>
>
> After all the discussion, I think we want this?

I think so yes. Even if it is just informational for user-space it seems to
make sense for kernel side.

> Care to resend?

Will do.

> I think I want it at least because we shouldn't advertise HT/VHT on 6
> GHz as is (just as part of HE) and that's easier if we have a different
> band enum, for the capability storage...

Right.

>
>> 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.
>
> Just finally break wext and say if you want to use 6 GHz you need to use
> nl80211? :)

Probably is true for he support as well. Not sure. Have not been using wext
for the last decade ;-)

Regards,
Arend


2019-07-24 14:08:33

by Johannes Berg

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

On Wed, 2019-07-24 at 15:40 +0200, Arend Van Spriel wrote:
>
> > > 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.
> >
> > Just finally break wext and say if you want to use 6 GHz you need to use
> > nl80211? :)
>
> Probably is true for he support as well. Not sure. Have not been using wext
> for the last decade ;-)

Me neither, our official releases don't even support it.

Btw, there's a compiler warning introduced by the first patch, I think
the fix is trivial though to add the 6GHZ in one place in mac80211
already.

johannes