2024-03-12 05:01:16

by kangyang

[permalink] [raw]
Subject: [PATCH 1/2] wifi: mac80211: supplement parsing of puncturing bitmap

Current mac80211 won't parsing puncturing bitmap when process EHT
Operation element in 6 GHz band or Bandwidth Indication element. This
leads to puncturing bitmap cannot be updated in related situations, such
as connecting to an EHT AP in 6 GHz band.

So supplement parsing of puncturing bitmap for these elements.

Signed-off-by: Kang Yang <[email protected]>
---
net/mac80211/spectmgmt.c | 4 ++++
net/mac80211/util.c | 2 ++
2 files changed, 6 insertions(+)

diff --git a/net/mac80211/spectmgmt.c b/net/mac80211/spectmgmt.c
index 327c74e296e2..077d7c7efc82 100644
--- a/net/mac80211/spectmgmt.c
+++ b/net/mac80211/spectmgmt.c
@@ -348,6 +348,10 @@ int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata,
new_chandef = csa_ie->chanreq.oper;
/* and update the width accordingly */
ieee80211_chandef_eht_oper(&bwi->info, &new_chandef);
+
+ if (bwi->params & IEEE80211_BW_IND_DIS_SUBCH_PRESENT)
+ new_chandef.punctured =
+ get_unaligned_le16(bwi->info.optional);
} else if (!wide_bw_chansw_ie || !wbcs_elem_to_chandef(wide_bw_chansw_ie,
&new_chandef)) {
if (!ieee80211_operating_class_to_chandef(new_op_class, new_chan,
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index a237cbcf7b49..a5d5e05688b4 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -3136,6 +3136,8 @@ bool ieee80211_chandef_he_6ghz_oper(struct ieee80211_local *local,
} else {
ieee80211_chandef_eht_oper((const void *)eht_oper->optional,
&he_chandef);
+ he_chandef.punctured =
+ ieee80211_eht_oper_dis_subchan_bitmap(eht_oper);
}

if (!cfg80211_chandef_valid(&he_chandef))
--
2.34.1



2024-03-12 08:16:48

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 1/2] wifi: mac80211: supplement parsing of puncturing bitmap

On Tue, 2024-03-12 at 12:59 +0800, Kang Yang wrote:
> Current mac80211 won't parsing puncturing bitmap when process EHT
> Operation element in 6 GHz band or Bandwidth Indication element. This
> leads to puncturing bitmap cannot be updated in related situations, such
> as connecting to an EHT AP in 6 GHz band.
>
> So supplement parsing of puncturing bitmap for these elements.

Hah, yes, I just noticed that too and fixed the second part yesterday,
and was still thinking about how I could test the first part :-)

johannes


2024-03-12 08:46:10

by kangyang

[permalink] [raw]
Subject: Re: [PATCH 1/2] wifi: mac80211: supplement parsing of puncturing bitmap



On 3/12/2024 4:16 PM, Johannes Berg wrote:
> On Tue, 2024-03-12 at 12:59 +0800, Kang Yang wrote:
>> Current mac80211 won't parsing puncturing bitmap when process EHT
>> Operation element in 6 GHz band or Bandwidth Indication element. This
>> leads to puncturing bitmap cannot be updated in related situations, such
>> as connecting to an EHT AP in 6 GHz band.
>>
>> So supplement parsing of puncturing bitmap for these elements.
>
> Hah, yes, I just noticed that too and fixed the second part yesterday,
> and was still thinking about how I could test the first part :-)
>

Our AP could set puncturing bitmap manually.

So i just add printk() to check if it matches the value sent by AP.


> johannes
>
>

2024-03-12 09:26:01

by kangyang

[permalink] [raw]
Subject: Re: [PATCH 1/2] wifi: mac80211: supplement parsing of puncturing bitmap



On 3/12/2024 4:16 PM, Johannes Berg wrote:
> On Tue, 2024-03-12 at 12:59 +0800, Kang Yang wrote:
>> Current mac80211 won't parsing puncturing bitmap when process EHT
>> Operation element in 6 GHz band or Bandwidth Indication element. This
>> leads to puncturing bitmap cannot be updated in related situations, such
>> as connecting to an EHT AP in 6 GHz band.
>>
>> So supplement parsing of puncturing bitmap for these elements.
>
> Hah, yes, I just noticed that too and fixed the second part yesterday,
> and was still thinking about how I could test the first part :-)
>

Should we add validation for puncturing bitmap in
validate_chandef_by_6ghz_he_eht_oper()?



> johannes
>
>

2024-03-12 10:17:43

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 1/2] wifi: mac80211: supplement parsing of puncturing bitmap

On Tue, 2024-03-12 at 17:22 +0800, Kang Yang wrote:
>
> On 3/12/2024 4:16 PM, Johannes Berg wrote:
> > On Tue, 2024-03-12 at 12:59 +0800, Kang Yang wrote:
> > > Current mac80211 won't parsing puncturing bitmap when process EHT
> > > Operation element in 6 GHz band or Bandwidth Indication element. This
> > > leads to puncturing bitmap cannot be updated in related situations, such
> > > as connecting to an EHT AP in 6 GHz band.
> > >
> > > So supplement parsing of puncturing bitmap for these elements.
> >
> > Hah, yes, I just noticed that too and fixed the second part yesterday,
> > and was still thinking about how I could test the first part :-)
> >
>
> Should we add validation for puncturing bitmap in
> validate_chandef_by_6ghz_he_eht_oper()?
>

We already have, no?

It calls ieee80211_chandef_he_6ghz_oper(), which checks
cfg80211_chandef_valid(), which includes puncturing.

johannes

2024-03-14 03:22:52

by kangyang

[permalink] [raw]
Subject: Re: [PATCH 1/2] wifi: mac80211: supplement parsing of puncturing bitmap



On 3/12/2024 4:16 PM, Johannes Berg wrote:
> On Tue, 2024-03-12 at 12:59 +0800, Kang Yang wrote:
>> Current mac80211 won't parsing puncturing bitmap when process EHT
>> Operation element in 6 GHz band or Bandwidth Indication element. This
>> leads to puncturing bitmap cannot be updated in related situations, such
>> as connecting to an EHT AP in 6 GHz band.
>>
>> So supplement parsing of puncturing bitmap for these elements.
>
> Hah, yes, I just noticed that too and fixed the second part yesterday,
> and was still thinking about how I could test the first part :-)
>


So what are you planning to do with this patch?

Any suggestions or you want to add puncutring bitmap parsing by your patch?


> johannes
>
>

2024-03-14 08:04:02

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 1/2] wifi: mac80211: supplement parsing of puncturing bitmap

On Thu, 2024-03-14 at 11:21 +0800, Kang Yang wrote:
>
> On 3/12/2024 4:16 PM, Johannes Berg wrote:
> > On Tue, 2024-03-12 at 12:59 +0800, Kang Yang wrote:
> > > Current mac80211 won't parsing puncturing bitmap when process EHT
> > > Operation element in 6 GHz band or Bandwidth Indication element. This
> > > leads to puncturing bitmap cannot be updated in related situations, such
> > > as connecting to an EHT AP in 6 GHz band.
> > >
> > > So supplement parsing of puncturing bitmap for these elements.
> >
> > Hah, yes, I just noticed that too and fixed the second part yesterday,
> > and was still thinking about how I could test the first part :-)
> >
>
>
> So what are you planning to do with this patch?
>
> Any suggestions or you want to add puncutring bitmap parsing by your patch?
>

No no, all good. I was just commenting :)

Once the trees settle and all (we're in the middle of the merge window)
I'll apply this.

johannes