wlan-ap-Telecominfraproject/feeds/wifi-ax/hostapd/patches/d00-003-wpa-supplicant-override-HE-toVHT-2G.patch
John Crispin 528a778e38 open-converged-wireless: Import 21.02 based uCentral tree
Signed-off-by: John Crispin <john@phrozen.org>
2021-03-25 12:19:47 +01:00

117 lines
3.8 KiB
Diff

Index: hostapd-2020-07-02-58b384f4/src/drivers/driver.h
===================================================================
--- hostapd-2020-07-02-58b384f4.orig/src/drivers/driver.h
+++ hostapd-2020-07-02-58b384f4/src/drivers/driver.h
@@ -1193,6 +1193,12 @@ struct wpa_driver_associate_params {
* fils_erp_rrk_len - Length of fils_erp_rrk in bytes
*/
size_t fils_erp_rrk_len;
+#ifdef CONFIG_HE_OVERRIDES
+ /**
+ * Disable HE for this connection
+ */
+ int disable_he;
+#endif /* CONFIG_HE_OVERRIDES */
};
enum hide_ssid {
Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/config.c
===================================================================
--- hostapd-2020-07-02-58b384f4.orig/wpa_supplicant/config.c
+++ hostapd-2020-07-02-58b384f4/wpa_supplicant/config.c
@@ -2676,6 +2676,9 @@ static const struct parse_data ssid_fiel
{ INT_RANGE(owe_ptk_workaround, 0, 1) },
{ INT_RANGE(multi_ap_backhaul_sta, 0, 1) },
{ INT_RANGE(ft_eap_pmksa_caching, 0, 1) },
+#ifdef CONFIG_HE_OVERRIDES
+ { INT_RANGE(disable_he,0,1)},
+#endif
{ INT_RANGE(beacon_prot, 0, 1) },
{ INT_RANGE(transition_disable, 0, 255) },
{ INT_RANGE(sae_pk, 0, 2) },
Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/config_ssid.h
===================================================================
--- hostapd-2020-07-02-58b384f4.orig/wpa_supplicant/config_ssid.h
+++ hostapd-2020-07-02-58b384f4/wpa_supplicant/config_ssid.h
@@ -1111,7 +1111,12 @@ struct wpa_ssid {
* FT initial mobility domain association.
*/
int ft_eap_pmksa_caching;
-
+#ifdef CONFIG_HE_OVERRIDES
+ /**
+ * Disable HE for this connection
+ */
+ int disable_he;
+#endif /* CONFIG_HE_OVERRIDES */
/**
* beacon_prot - Whether Beacon protection is enabled
*
Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_cli.c
===================================================================
--- hostapd-2020-07-02-58b384f4.orig/wpa_supplicant/wpa_cli.c
+++ hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_cli.c
@@ -1485,6 +1485,9 @@ static const char *network_fields[] = {
"update_identifier",
#endif /* CONFIG_HS20 */
"mac_addr", "pbss", "wps_disabled"
+#ifdef CONFIG_HE_OVERRIDES
+ "disable_he"
+#endif /* CONFIG_HE_OVERRIDES */
};
Index: hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c
===================================================================
--- hostapd-2020-07-02-58b384f4.orig/wpa_supplicant/wpa_supplicant.c
+++ hostapd-2020-07-02-58b384f4/wpa_supplicant/wpa_supplicant.c
@@ -2480,17 +2480,17 @@ void ibss_mesh_setup_freq(struct wpa_sup
return;
/* Allow HE on 2.4 GHz without VHT: see nl80211_put_freq_params() */
+#ifdef CONFIG_HE_OVERRIDES
+ if (is_24ghz) {
+ if (ssid->disable_he)
+ freq->he_enabled = 0;
+ else
+ freq->he_enabled = mode->he_capab[ieee80211_mode].he_supported;
+#else
if (is_24ghz)
freq->he_enabled = mode->he_capab[ieee80211_mode].he_supported;
-#ifdef CONFIG_HE_OVERRIDES
- if (is_24ghz && ssid->disable_he)
- freq->he_enabled = 0;
#endif /* CONFIG_HE_OVERRIDES */
- /* Setup higher BW only for 5 GHz */
- if (mode->mode != HOSTAPD_MODE_IEEE80211A && !(ssid->noscan))
- return;
-
for (chan_idx = 0; chan_idx < mode->num_channels; chan_idx++) {
pri_chan = &mode->channels[chan_idx];
if (pri_chan->chan == channel)
@@ -2585,6 +2585,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
wpa_scan_results_free(scan_res);
}
+#ifdef CONFIG_HE_OVERRIDES
+skip_vht80:
+ if (ssid->disable_he)
+ vht_freq.he_enabled = 0;
+#endif /* CONFIG_HE_OVERRIDES */
#ifdef CONFIG_HT_OVERRIDES
skip_ht40:
@@ -2617,6 +2622,11 @@ skip_ht40:
/* Enable HE with VHT for 5 GHz */
freq->he_enabled = mode->he_capab[ieee80211_mode].he_supported;
+#ifdef CONFIG_HE_OVERRIDES
+ if (is_24ghz)
+ goto skip_vht80;
+#endif /* CONFIG_HE_OVERRIDES */
+
/* setup center_freq1, bandwidth */
for (j = 0; j < ARRAY_SIZE(vht80); j++) {
if (freq->channel >= vht80[j] &&