diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index b09c82082d30..2b2ab3d458ad 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -397,8 +397,19 @@ ieee80211_determine_ap_chan(struct ieee80211_sub_if_data *sdata, const struct ieee80211_sta_uhr_cap *uhr_cap; const struct ieee80211_uhr_npca_info *npca; + /* frames other than beacons carry UHR capability too */ + if (!elems->uhr_cap) + return IEEE80211_CONN_MODE_EHT; + npca = ieee80211_uhr_npca_info(uhr_oper); + if (npca && !(elems->uhr_cap->mac.mac_cap[0] & + IEEE80211_UHR_MAC_CAP0_NPCA_SUPP)) { + sdata_info(sdata, + "AP without UHR NPCA capability uses it, disabling UHR\n"); + return IEEE80211_CONN_MODE_EHT; + } + /* DBE is not considered yet, so this works */ if (!cfg80211_chandef_npca_valid(sdata->local->hw.wiphy, &npca_chandef, npca) ||