During 6 GHz Channel Switch Announcement (CSA) handling, mac80211 parses the disabled subchannel bitmap from the Bandwidth Indication element into the new channel definition. The channel definition is subsequently validated by reconstructing a local EHT operation element and passing it to ieee80211_chandef_he_6ghz_oper(). However, the reconstructed element does not include the disabled subchannel bitmap or its presence flag. Consequently, ieee80211_chandef_he_6ghz_oper() overwrites the parsed puncturing configuration with zero. Preserve the parsed puncturing configuration by carrying the disabled subchannel bitmap presence flag into the reconstructed EHT operation element and populating its bitmap from the channel definition. Signed-off-by: Hongcheng Zhang --- net/mac80211/spectmgmt.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/net/mac80211/spectmgmt.c b/net/mac80211/spectmgmt.c index f5e4970869b6..5d26291e7569 100644 --- a/net/mac80211/spectmgmt.c +++ b/net/mac80211/spectmgmt.c @@ -152,7 +152,12 @@ validate_chandef_by_6ghz_he_eht_oper(struct ieee80211_sub_if_data *sdata, struct ieee80211_he_6ghz_oper *_6ghz_oper = (struct ieee80211_he_6ghz_oper *)he->optional; DEFINE_RAW_FLEX(struct ieee80211_eht_operation, eht, optional, - sizeof(struct ieee80211_eht_operation_info)); + sizeof(struct ieee80211_eht_operation_info) + + /* + * Additional space for the optional + * Disabled Subchannel Bitmap + */ + sizeof(u16)); struct ieee80211_eht_operation_info *_oper_info = (struct ieee80211_eht_operation_info *)eht->optional; const struct ieee80211_eht_operation *eht_oper; @@ -207,6 +212,13 @@ validate_chandef_by_6ghz_he_eht_oper(struct ieee80211_sub_if_data *sdata, eht_oper = NULL; } else { eht->params = IEEE80211_EHT_OPER_INFO_PRESENT; + + if (chandef->punctured) { + eht->params |= + IEEE80211_EHT_OPER_DISABLED_SUBCHANNEL_BITMAP_PRESENT; + put_unaligned_le16(chandef->punctured, _oper_info->optional); + } + _oper_info->control = _6ghz_oper->control; _oper_info->ccfs0 = _6ghz_oper->ccfs0; _oper_info->ccfs1 = _6ghz_oper->ccfs1; base-commit: 734bef548a96e8774d6eef5dfa2026c6edc4e80b -- 2.34.1