wifi: mac80211: supplement parsing of puncturing bitmap
authorKang Yang <quic_kangyang@quicinc.com>
Tue, 12 Mar 2024 04:59:46 +0000 (12:59 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 25 Mar 2024 14:36:22 +0000 (15:36 +0100)
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 <quic_kangyang@quicinc.com>
Link: https://msgid.link/20240312045947.576231-2-quic_kangyang@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/spectmgmt.c
net/mac80211/util.c

index 327c74e296e21b4c550bbc1602f62287d19f673d..077d7c7efc8243d98717eebdb6b82bfe4dc443d2 100644 (file)
@@ -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,
index a237cbcf7b49100af8da21b54a29707ed8f7ec91..a5d5e05688b44db3985d950abdf6f28afc8de3c3 100644 (file)
@@ -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))