2020-09-11 01:12:14

by Aloka Dixit

[permalink] [raw]
Subject: [PATCH] mac80211: Fix radiotap header channel flag for 6GHz band

Radiotap header field 'Channel flags' has '2 GHz spectrum' set to
'true' for 6GHz packet.
Change it to 5GHz as there isn't a separate option available for 6GHz.

Signed-off-by: Aloka Dixit <[email protected]>
---
net/mac80211/rx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 836cde516a18..a959ebf56852 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -451,7 +451,8 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
else if (status->bw == RATE_INFO_BW_5)
channel_flags |= IEEE80211_CHAN_QUARTER;

- if (status->band == NL80211_BAND_5GHZ)
+ if (status->band == NL80211_BAND_5GHZ ||
+ status->band == NL80211_BAND_6GHZ)
channel_flags |= IEEE80211_CHAN_OFDM | IEEE80211_CHAN_5GHZ;
else if (status->encoding != RX_ENC_LEGACY)
channel_flags |= IEEE80211_CHAN_DYN | IEEE80211_CHAN_2GHZ;
--
2.25.0


2020-09-11 07:37:24

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Fix radiotap header channel flag for 6GHz band

On Fri, 2020-09-11 at 01:11 +0000, Aloka Dixit wrote:
> Radiotap header field 'Channel flags' has '2 GHz spectrum' set to
> 'true' for 6GHz packet.
> Change it to 5GHz as there isn't a separate option available for 6GHz.
>
> Signed-off-by: Aloka Dixit <[email protected]>
> ---
> net/mac80211/rx.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
> index 836cde516a18..a959ebf56852 100644
> --- a/net/mac80211/rx.c
> +++ b/net/mac80211/rx.c
> @@ -451,7 +451,8 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
> else if (status->bw == RATE_INFO_BW_5)
> channel_flags |= IEEE80211_CHAN_QUARTER;
>
> - if (status->band == NL80211_BAND_5GHZ)
> + if (status->band == NL80211_BAND_5GHZ ||
> + status->band == NL80211_BAND_6GHZ)
> channel_flags |= IEEE80211_CHAN_OFDM | IEEE80211_CHAN_5GHZ;

I guess we should just not set any of those flags?

Not that anything even cares ... so there's no point in adding a 6GHz
flag to radiotap.

johannes

2020-09-11 20:53:02

by Aloka Dixit

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Fix radiotap header channel flag for 6GHz band

On 2020-09-11 00:36, Johannes Berg wrote:
> On Fri, 2020-09-11 at 01:11 +0000, Aloka Dixit wrote:
>> Radiotap header field 'Channel flags' has '2 GHz spectrum' set to
>> 'true' for 6GHz packet.
>> Change it to 5GHz as there isn't a separate option available for 6GHz.
>>
>> Signed-off-by: Aloka Dixit <[email protected]>
>> ---
>> net/mac80211/rx.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
>> index 836cde516a18..a959ebf56852 100644
>> --- a/net/mac80211/rx.c
>> +++ b/net/mac80211/rx.c
>> @@ -451,7 +451,8 @@ ieee80211_add_rx_radiotap_header(struct
>> ieee80211_local *local,
>> else if (status->bw == RATE_INFO_BW_5)
>> channel_flags |= IEEE80211_CHAN_QUARTER;
>>
>> - if (status->band == NL80211_BAND_5GHZ)
>> + if (status->band == NL80211_BAND_5GHZ ||
>> + status->band == NL80211_BAND_6GHZ)
>> channel_flags |= IEEE80211_CHAN_OFDM | IEEE80211_CHAN_5GHZ;
>
> I guess we should just not set any of those flags?
>
> Not that anything even cares ... so there's no point in adding a 6GHz
> flag to radiotap.
>
> johannes

Separate flag for 6GHz would have been best option, but I still think
better to set 5GHz as 6GHz frequencies start in 5GHz range.
Thanks.

2020-09-11 20:53:36

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Fix radiotap header channel flag for 6GHz band

On Fri, 2020-09-11 at 20:50 +0000, Aloka Dixit wrote:
>
> > Not that anything even cares ... so there's no point in adding a 6GHz
> > flag to radiotap.
> >
> Separate flag for 6GHz would have been best option, but I still think
> better to set 5GHz as 6GHz frequencies start in 5GHz range.

But why? wireshark probably needs to be adjusted anyway, so it can just
look at the frequency instead? And it would pretend that it's now an
"11a" frame ... so that clearly never was important, since that hasn't
been true since HT.

johannes

2020-09-14 09:18:04

by Arend van Spriel

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Fix radiotap header channel flag for 6GHz band

On 9/11/2020 10:52 PM, Johannes Berg wrote:
> On Fri, 2020-09-11 at 20:50 +0000, Aloka Dixit wrote:
>>
>>> Not that anything even cares ... so there's no point in adding a 6GHz
>>> flag to radiotap.
>>>
>> Separate flag for 6GHz would have been best option, but I still think
>> better to set 5GHz as 6GHz frequencies start in 5GHz range.
>
> But why? wireshark probably needs to be adjusted anyway, so it can just
> look at the frequency instead? And it would pretend that it's now an
> "11a" frame ... so that clearly never was important, since that hasn't
> been true since HT.

It has been couple of month ago that I looked into wireshark about this
and I think it is already ignoring the band flags and just looks at the
frequency.

Regards,
Arend


Attachments:
smime.p7s (4.08 kB)
S/MIME Cryptographic Signature

2020-09-20 19:00:04

by Aloka Dixit

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Fix radiotap header channel flag for 6GHz band

On 2020-09-14 02:14, Arend Van Spriel wrote:
> On 9/11/2020 10:52 PM, Johannes Berg wrote:
>> On Fri, 2020-09-11 at 20:50 +0000, Aloka Dixit wrote:
>>>
>>>> Not that anything even cares ... so there's no point in adding a
>>>> 6GHz
>>>> flag to radiotap.
>>>>
>>> Separate flag for 6GHz would have been best option, but I still think
>>> better to set 5GHz as 6GHz frequencies start in 5GHz range.
>>
>> But why? wireshark probably needs to be adjusted anyway, so it can
>> just
>> look at the frequency instead? And it would pretend that it's now an
>> "11a" frame ... so that clearly never was important, since that hasn't
>> been true since HT.
>
> It has been couple of month ago that I looked into wireshark about
> this and I think it is already ignoring the band flags and just looks
> at the frequency.
>
> Regards,
> Arend
Ok, thanks for letting me know!