diff options
author | Michael-CY Lee <michael-cy.lee@mediatek.com> | 2024-10-09 20:18:12 +0800 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2024-10-23 16:46:48 +0200 |
commit | 2d63e6530ec1f50f57c1cde598274d055fb7a36c (patch) | |
tree | 7f57ea6bb2219d95e02fb731ccd1391c0377ebb5 /net/mac80211/spectmgmt.c | |
parent | f92e0cf19ae0fd08e7b60f24d27a5819d8d949ba (diff) | |
download | lwn-2d63e6530ec1f50f57c1cde598274d055fb7a36c.tar.gz lwn-2d63e6530ec1f50f57c1cde598274d055fb7a36c.zip |
wifi: mac80211: refactor BW limitation check for CSA parsing
Refactor the BW limitation check to a more general format when
parsing CSA. Also, the original BW check did not account for BW
less than 160 MHz.
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
Link: https://patch.msgid.link/20241009121812.2419-1-michael-cy.lee@mediatek.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/spectmgmt.c')
-rw-r--r-- | net/mac80211/spectmgmt.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/net/mac80211/spectmgmt.c b/net/mac80211/spectmgmt.c index 073ff9e0f397..c6015cd00372 100644 --- a/net/mac80211/spectmgmt.c +++ b/net/mac80211/spectmgmt.c @@ -377,13 +377,8 @@ int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata, /* capture the AP chandef before (potential) downgrading */ csa_ie->chanreq.ap = new_chandef; - if (conn->bw_limit < IEEE80211_CONN_BW_LIMIT_320 && - new_chandef.width == NL80211_CHAN_WIDTH_320) - ieee80211_chandef_downgrade(&new_chandef, NULL); - - if (conn->bw_limit < IEEE80211_CONN_BW_LIMIT_160 && - (new_chandef.width == NL80211_CHAN_WIDTH_80P80 || - new_chandef.width == NL80211_CHAN_WIDTH_160)) + while (conn->bw_limit < + ieee80211_min_bw_limit_from_chandef(&new_chandef)) ieee80211_chandef_downgrade(&new_chandef, NULL); if (!cfg80211_chandef_compatible(&new_chandef, |