]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_supplicant: Add HE override support
authorP Praneesh <ppranees@codeaurora.org>
Mon, 9 Mar 2020 10:53:50 +0000 (16:23 +0530)
committerJouni Malinen <j@w1.fi>
Mon, 30 Mar 2020 09:55:01 +0000 (12:55 +0300)
Add HE override support under the build parameter CONFIG_HE_OVERRIDES=y.
The disable_he=1 network profile parameter can be used to disable HE.
This requires a fallback to VHT on the 5 GHz band and to HT on the 2.4
GHz band.

There is no nl80211 support for configuring the driver to disable HE, so
for now, this applies only to IBSS and mesh cases.

Signed-off-by: P Praneesh <ppranees@codeaurora.org>
src/drivers/driver.h
wpa_supplicant/Android.mk
wpa_supplicant/Makefile
wpa_supplicant/config.c
wpa_supplicant/config_file.c
wpa_supplicant/config_ssid.h
wpa_supplicant/sme.c
wpa_supplicant/wpa_cli.c
wpa_supplicant/wpa_supplicant.c
wpa_supplicant/wpa_supplicant_i.h

index bc4f0ef95ca4e54e1ab4657f4b5c528d146c9250..6ffa7fece1468ef96cf1041cddbfd941e8cf1d71 100644 (file)
@@ -1096,6 +1096,13 @@ struct wpa_driver_associate_params {
        const struct ieee80211_vht_capabilities *vhtcaps_mask;
 #endif /* CONFIG_VHT_OVERRIDES */
 
+#ifdef CONFIG_HE_OVERRIDES
+       /**
+        * disable_he - Disable HE for this connection
+        */
+       int disable_he;
+#endif /* CONFIG_HE_OVERRIDES */
+
        /**
         * req_key_mgmt_offload - Request key management offload for connection
         *
index c348766cabdf57164a0f599503d171cf6230a413..fbbb0619129947c08ee655c8e6d785e206000284 100644 (file)
@@ -166,6 +166,10 @@ ifdef CONFIG_VHT_OVERRIDES
 L_CFLAGS += -DCONFIG_VHT_OVERRIDES
 endif
 
+ifdef CONFIG_HE_OVERRIDES
+L_CFLAGS += -DCONFIG_HE_OVERRIDES
+endif
+
 ifndef CONFIG_BACKEND
 CONFIG_BACKEND=file
 endif
index 88f688b6277548bd7fc453b222a642e1a31865fb..0d9950d78794d03b29e5184a88cd3f177bdd3c02 100644 (file)
@@ -198,6 +198,10 @@ ifdef CONFIG_VHT_OVERRIDES
 CFLAGS += -DCONFIG_VHT_OVERRIDES
 endif
 
+ifdef CONFIG_HE_OVERRIDES
+CFLAGS += -DCONFIG_HE_OVERRIDES
+endif
+
 ifndef CONFIG_BACKEND
 CONFIG_BACKEND=file
 endif
index 563d18fb8ffa204a0edb408d48d05efe767a3439..49b25f12452cbc2539513ff27a16b1e524277279 100644 (file)
@@ -2544,6 +2544,9 @@ static const struct parse_data ssid_fields[] = {
        { INT_RANGE(vht_tx_mcs_nss_7, -1, 3) },
        { INT_RANGE(vht_tx_mcs_nss_8, -1, 3) },
 #endif /* CONFIG_VHT_OVERRIDES */
+#ifdef CONFIG_HE_OVERRIDES
+       { INT_RANGE(disable_he, 0, 1)},
+#endif /* CONFIG_HE_OVERRIDES */
        { INT(ap_max_inactivity) },
        { INT(dtim_period) },
        { INT(beacon_int) },
index 074b3b31a6832adddf7d64c8876ea7870f2867c7..a69c4cc6dbc1c005b686c272e6d6a6e88f7464e9 100644 (file)
@@ -971,6 +971,9 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid)
        INT_DEF(vht_tx_mcs_nss_7, -1);
        INT_DEF(vht_tx_mcs_nss_8, -1);
 #endif /* CONFIG_VHT_OVERRIDES */
+#ifdef CONFIG_HE_OVERRIDES
+       INT(disable_he);
+#endif /* CONFIG_HE_OVERRIDES */
 
 #undef STR
 #undef INT
index c214b6c3ffa3320c02dbb8110c8b422c9c6e8799..979f868e3374d669fb8a9bd4e3d5de59276529b8 100644 (file)
@@ -779,6 +779,16 @@ struct wpa_ssid {
            vht_tx_mcs_nss_7, vht_tx_mcs_nss_8;
 #endif /* CONFIG_VHT_OVERRIDES */
 
+#ifdef CONFIG_HE_OVERRIDES
+       /**
+        * disable_he - Disable HE (IEEE 802.11ax) for this network
+        *
+        * By default, use it if it is available, but this can be configured
+        * to 1 to have it disabled.
+        */
+       int disable_he;
+#endif /* CONFIG_HE_OVERRIDES */
+
        /**
         * ap_max_inactivity - Timeout in seconds to detect STA's inactivity
         *
index a35310157417a130d3122dd234471b495b367017..0cc81bf0cdfc7e9050bd3a551fdf7c250ea6e8e5 100644 (file)
@@ -1869,6 +1869,9 @@ pfs_fail:
        params.vhtcaps_mask = &vhtcaps_mask;
        wpa_supplicant_apply_vht_overrides(wpa_s, wpa_s->current_ssid, &params);
 #endif /* CONFIG_VHT_OVERRIDES */
+#ifdef CONFIG_HE_OVERRIDES
+       wpa_supplicant_apply_he_overrides(wpa_s, wpa_s->current_ssid, &params);
+#endif /* CONFIG_HE_OVERRIDES */
 #ifdef CONFIG_IEEE80211R
        if (auth_type == WLAN_AUTH_FT && wpa_s->sme.ft_ies &&
            get_ie(wpa_s->sme.ft_ies, wpa_s->sme.ft_ies_len,
index 730d749fec25c604e7bbf13508b98ccc15f24e83..07d5f315cf5cf3ea595275cf3b3c8022e65504cf 100644 (file)
@@ -1460,6 +1460,9 @@ static const char *network_fields[] = {
        "vht_tx_mcs_nss_3", "vht_tx_mcs_nss_4", "vht_tx_mcs_nss_5",
        "vht_tx_mcs_nss_6", "vht_tx_mcs_nss_7", "vht_tx_mcs_nss_8",
 #endif /* CONFIG_VHT_OVERRIDES */
+#ifdef CONFIG_HE_OVERRIDES
+       "disable_he",
+#endif /* CONFIG_HE_OVERRIDES */
        "ap_max_inactivity", "dtim_period", "beacon_int",
 #ifdef CONFIG_MACSEC
        "macsec_policy",
index 8016fd3ac21f4a5f38b80cfc4ed5485737ad4254..2cacb202d5ceba03eb496d2f6744c35ddcddc7e6 100644 (file)
@@ -2406,6 +2406,10 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
        /* Allow HE on 2.4 GHz without VHT: see nl80211_put_freq_params() */
        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)
@@ -2604,6 +2608,12 @@ skip_ht40:
 #endif /* CONFIG_HT_OVERRIDES */
        }
 
+#ifdef CONFIG_HE_OVERRIDES
+       if (ssid->disable_he) {
+               vht_freq.he_enabled = 0;
+               freq->he_enabled = 0;
+       }
+#endif /* CONFIG_HE_OVERRIDES */
        if (hostapd_set_freq_params(&vht_freq, mode->mode, freq->freq,
                                    freq->channel, ssid->enable_edmg,
                                    ssid->edmg_channel, freq->ht_enabled,
@@ -3710,6 +3720,9 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
        params.vhtcaps_mask = &vhtcaps_mask;
        wpa_supplicant_apply_vht_overrides(wpa_s, ssid, &params);
 #endif /* CONFIG_VHT_OVERRIDES */
+#ifdef CONFIG_HE_OVERRIDES
+       wpa_supplicant_apply_he_overrides(wpa_s, ssid, &params);
+#endif /* CONFIG_HE_OVERRIDES */
 
 #ifdef CONFIG_P2P
        /*
@@ -5272,6 +5285,19 @@ void wpa_supplicant_apply_vht_overrides(
 #endif /* CONFIG_VHT_OVERRIDES */
 
 
+#ifdef CONFIG_HE_OVERRIDES
+void wpa_supplicant_apply_he_overrides(
+       struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
+       struct wpa_driver_associate_params *params)
+{
+       if (!ssid)
+               return;
+
+       params->disable_he = ssid->disable_he;
+}
+#endif /* CONFIG_HE_OVERRIDES */
+
+
 static int pcsc_reader_init(struct wpa_supplicant *wpa_s)
 {
 #ifdef PCSC_FUNCS
index b7cf7f4dfb3ad6c1d68354664110f38fc97ae09f..e0de59fa29714439cbcf9ad5e27a42fa3e904700 100644 (file)
@@ -1311,6 +1311,9 @@ void wpa_supplicant_apply_ht_overrides(
 void wpa_supplicant_apply_vht_overrides(
        struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
        struct wpa_driver_associate_params *params);
+void wpa_supplicant_apply_he_overrides(
+       struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
+       struct wpa_driver_associate_params *params);
 
 int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
 int wpa_supplicant_set_wpa_none_key(struct wpa_supplicant *wpa_s,