mac80211: fix 80 MHz association to 160/80+80 AP on 6 GHz

When trying to associate to an AP support 180 or 80+80 MHz on 6 GHz with a
STA that only has 80 Mhz support the cf2 field inside the chandef will get
set causing the association to fail when trying to validate the chandef.
Fix this by checking the support flags prior to setting cf2.

Fixes: 57fa5e85d5 ("mac80211: determine chandef from HE 6 GHz operation")
Signed-off-by: John Crispin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[reword commit message a bit]
Signed-off-by: Johannes Berg <[email protected]>
This commit is contained in:
John Crispin authored and Johannes Berg committed 2020-09-18 14:01:24 +02:00
1 parent 3bd5c7a28a
commit 75bcbd6913
1 file changed
+4 -3
+4 -3
View File
@@ -3353,9 +3353,10 @@ bool ieee80211_chandef_he_6ghz_oper(struct ieee80211_sub_if_data *sdata,
he_chandef.center_freq1 =
ieee80211_channel_to_frequency(he_6ghz_oper->ccfs0,
NL80211_BAND_6GHZ);
he_chandef.center_freq2 =
ieee80211_channel_to_frequency(he_6ghz_oper->ccfs1,
NL80211_BAND_6GHZ);
if (support_80_80 || support_160)
he_chandef.center_freq2 =
ieee80211_channel_to_frequency(he_6ghz_oper->ccfs1,
NL80211_BAND_6GHZ);
}
if (!cfg80211_chandef_valid(&he_chandef)) {