Skip to content

Commit a26d8dc

Browse files
Lingbo Kongjmberg-intel
authored andcommitted
wifi: mac80211: correctly parse Spatial Reuse Parameter Set element
Currently, the way of parsing Spatial Reuse Parameter Set element is incorrect and some members of struct ieee80211_he_obss_pd are not assigned. To address this issue, it must be parsed in the order of the elements of Spatial Reuse Parameter Set defined in the IEEE Std 802.11ax specification. The diagram of the Spatial Reuse Parameter Set element (IEEE Std 802.11ax -2021-9.4.2.252). ------------------------------------------------------------------------- | | | | |Non-SRG| SRG | SRG | SRG | SRG | |Element|Length| Element | SR |OBSS PD|OBSS PD|OBSS PD| BSS |Partial| | ID | | ID |Control| Max | Min | Max |Color | BSSID | | | |Extension| | Offset| Offset|Offset |Bitmap|Bitmap | ------------------------------------------------------------------------- Fixes: 1ced169 ("mac80211: allow setting spatial reuse parameters from bss_conf") Signed-off-by: Lingbo Kong <quic_lingbok@quicinc.com> Link: https://msgid.link/20240516021854.5682-3-quic_lingbok@quicinc.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 0c2fd18 commit a26d8dc

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

net/mac80211/he.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,21 @@ ieee80211_he_spr_ie_to_bss_conf(struct ieee80211_vif *vif,
230230

231231
if (!he_spr_ie_elem)
232232
return;
233+
234+
he_obss_pd->sr_ctrl = he_spr_ie_elem->he_sr_control;
233235
data = he_spr_ie_elem->optional;
234236

235237
if (he_spr_ie_elem->he_sr_control &
236238
IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT)
237-
data++;
239+
he_obss_pd->non_srg_max_offset = *data++;
240+
238241
if (he_spr_ie_elem->he_sr_control &
239242
IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT) {
240-
he_obss_pd->max_offset = *data++;
241243
he_obss_pd->min_offset = *data++;
244+
he_obss_pd->max_offset = *data++;
245+
memcpy(he_obss_pd->bss_color_bitmap, data, 8);
246+
data += 8;
247+
memcpy(he_obss_pd->partial_bssid_bitmap, data, 8);
242248
he_obss_pd->enable = true;
243249
}
244250
}

0 commit comments

Comments
 (0)