@@ -166,6 +166,9 @@ ieee80211_determine_ap_chan(struct ieee80211_sub_if_data *sdata,
166166 bool no_vht = false;
167167 u32 ht_cfreq ;
168168
169+ if (ieee80211_hw_check (& sdata -> local -> hw , STRICT ))
170+ ignore_ht_channel_mismatch = false;
171+
169172 * chandef = (struct cfg80211_chan_def ) {
170173 .chan = channel ,
171174 .width = NL80211_CHAN_WIDTH_20_NOHT ,
@@ -385,7 +388,7 @@ ieee80211_verify_peer_he_mcs_support(struct ieee80211_sub_if_data *sdata,
385388 * zeroes, which is nonsense, and completely inconsistent with itself
386389 * (it doesn't have 8 streams). Accept the settings in this case anyway.
387390 */
388- if (!ap_min_req_set )
391+ if (!ieee80211_hw_check ( & sdata -> local -> hw , STRICT ) && ! ap_min_req_set )
389392 return true;
390393
391394 /* make sure the AP is consistent with itself
@@ -445,7 +448,7 @@ ieee80211_verify_sta_he_mcs_support(struct ieee80211_sub_if_data *sdata,
445448 * zeroes, which is nonsense, and completely inconsistent with itself
446449 * (it doesn't have 8 streams). Accept the settings in this case anyway.
447450 */
448- if (!ap_min_req_set )
451+ if (!ieee80211_hw_check ( & sdata -> local -> hw , STRICT ) && ! ap_min_req_set )
449452 return true;
450453
451454 /* Need to go over for 80MHz, 160MHz and for 80+80 */
@@ -1212,13 +1215,15 @@ static bool ieee80211_add_vht_ie(struct ieee80211_sub_if_data *sdata,
12121215 * Some APs apparently get confused if our capabilities are better
12131216 * than theirs, so restrict what we advertise in the assoc request.
12141217 */
1215- if (!(ap_vht_cap -> vht_cap_info &
1216- cpu_to_le32 (IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE )))
1217- cap &= ~(IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |
1218- IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE );
1219- else if (!(ap_vht_cap -> vht_cap_info &
1220- cpu_to_le32 (IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE )))
1221- cap &= ~IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE ;
1218+ if (!ieee80211_hw_check (& local -> hw , STRICT )) {
1219+ if (!(ap_vht_cap -> vht_cap_info &
1220+ cpu_to_le32 (IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE )))
1221+ cap &= ~(IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |
1222+ IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE );
1223+ else if (!(ap_vht_cap -> vht_cap_info &
1224+ cpu_to_le32 (IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE )))
1225+ cap &= ~IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE ;
1226+ }
12221227
12231228 /*
12241229 * If some other vif is using the MU-MIMO capability we cannot associate
@@ -1260,14 +1265,16 @@ static bool ieee80211_add_vht_ie(struct ieee80211_sub_if_data *sdata,
12601265 return mu_mimo_owner ;
12611266}
12621267
1263- static void ieee80211_assoc_add_rates (struct sk_buff * skb ,
1268+ static void ieee80211_assoc_add_rates (struct ieee80211_local * local ,
1269+ struct sk_buff * skb ,
12641270 enum nl80211_chan_width width ,
12651271 struct ieee80211_supported_band * sband ,
12661272 struct ieee80211_mgd_assoc_data * assoc_data )
12671273{
12681274 u32 rates ;
12691275
1270- if (assoc_data -> supp_rates_len ) {
1276+ if (assoc_data -> supp_rates_len &&
1277+ !ieee80211_hw_check (& local -> hw , STRICT )) {
12711278 /*
12721279 * Get all rates supported by the device and the AP as
12731280 * some APs don't like getting a superset of their rates
@@ -1481,7 +1488,7 @@ static size_t ieee80211_assoc_link_elems(struct ieee80211_sub_if_data *sdata,
14811488 * capab |= WLAN_CAPABILITY_SPECTRUM_MGMT ;
14821489
14831490 if (sband -> band != NL80211_BAND_S1GHZ )
1484- ieee80211_assoc_add_rates (skb , width , sband , assoc_data );
1491+ ieee80211_assoc_add_rates (local , skb , width , sband , assoc_data );
14851492
14861493 if (* capab & WLAN_CAPABILITY_SPECTRUM_MGMT ||
14871494 * capab & WLAN_CAPABILITY_RADIO_MEASURE ) {
@@ -1925,7 +1932,8 @@ static int ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
19251932 * for some reason check it and want it to be set, set the bit for all
19261933 * pre-EHT connections as we used to do.
19271934 */
1928- if (link -> u .mgd .conn .mode < IEEE80211_CONN_MODE_EHT )
1935+ if (link -> u .mgd .conn .mode < IEEE80211_CONN_MODE_EHT &&
1936+ !ieee80211_hw_check (& local -> hw , STRICT ))
19291937 capab |= WLAN_CAPABILITY_ESS ;
19301938
19311939 /* add the elements for the assoc (main) link */
@@ -4710,7 +4718,7 @@ static bool ieee80211_assoc_config_link(struct ieee80211_link_data *link,
47104718 * 2G/3G/4G wifi routers, reported models include the "Onda PN51T",
47114719 * "Vodafone PocketWiFi 2", "ZTE MF60" and a similar T-Mobile device.
47124720 */
4713- if (!is_6ghz &&
4721+ if (!ieee80211_hw_check ( & local -> hw , STRICT ) && ! is_6ghz &&
47144722 ((assoc_data -> wmm && !elems -> wmm_param ) ||
47154723 (link -> u .mgd .conn .mode >= IEEE80211_CONN_MODE_HT &&
47164724 (!elems -> ht_cap_elem || !elems -> ht_operation )) ||
@@ -4846,6 +4854,15 @@ static bool ieee80211_assoc_config_link(struct ieee80211_link_data *link,
48464854 bss_vht_cap = (const void * )elem -> data ;
48474855 }
48484856
4857+ if (ieee80211_hw_check (& local -> hw , STRICT ) &&
4858+ (!bss_vht_cap || memcmp (bss_vht_cap , elems -> vht_cap_elem ,
4859+ sizeof (* bss_vht_cap )))) {
4860+ rcu_read_unlock ();
4861+ ret = false;
4862+ link_info (link , "VHT capabilities mismatch\n" );
4863+ goto out ;
4864+ }
4865+
48494866 ieee80211_vht_cap_ie_to_sta_vht_cap (sdata , sband ,
48504867 elems -> vht_cap_elem ,
48514868 bss_vht_cap , link_sta );
0 commit comments