]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Enable HE for channel switch commmand
authorMuna Sinada <msinada@codeaurora.org>
Thu, 11 Jun 2020 11:18:42 +0000 (04:18 -0700)
committerJouni Malinen <j@w1.fi>
Sat, 6 Feb 2021 09:41:09 +0000 (11:41 +0200)
Add HE as an accepted option ("he") in the CHAN_SWITCH command similarly
to the way VHT is addressed.

Signed-off-by: Muna Sinada <msinada@codeaurora.org>
src/ap/ap_config.h
src/ap/ctrl_iface_ap.c
src/ap/drv_callbacks.c

index e6913258459553afac28ac22f878f18145e4d033..fb153c40b26a9825e2fedc40c099e2490af5b8ec 100644 (file)
@@ -1049,6 +1049,11 @@ struct hostapd_config {
 #define CH_SWITCH_VHT_DISABLED BIT(1)
        unsigned int ch_switch_vht_config;
 
+       /* HE enable/disable config from CHAN_SWITCH */
+#define CH_SWITCH_HE_ENABLED BIT(0)
+#define CH_SWITCH_HE_DISABLED BIT(1)
+       unsigned int ch_switch_he_config;
+
        int rssi_reject_assoc_rssi;
        int rssi_reject_assoc_timeout;
        int rssi_ignore_probe_request;
index b3d6d62e4aded7a0308cf797828c7f713d6d331f..28e40ba9cedeae798e0c91a0ec6b097ce34ef7ac 100644 (file)
@@ -909,6 +909,7 @@ int hostapd_parse_csa_settings(const char *pos,
        SET_CSA_SETTING(sec_channel_offset);
        settings->freq_params.ht_enabled = !!os_strstr(pos, " ht");
        settings->freq_params.vht_enabled = !!os_strstr(pos, " vht");
+       settings->freq_params.he_enabled = !!os_strstr(pos, " he");
        settings->block_tx = !!os_strstr(pos, " blocktx");
 #undef SET_CSA_SETTING
 
index 9af5445e28ffc78cee67b788e00c8654f9e3e146..53082f53c5f475a82ccb2aafc2ee481080e33b82 100644 (file)
@@ -870,9 +870,10 @@ void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht,
 
        hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
                       HOSTAPD_LEVEL_INFO,
-                      "driver %s channel switch: freq=%d, ht=%d, vht_ch=0x%x, offset=%d, width=%d (%s), cf1=%d, cf2=%d",
+                      "driver %s channel switch: freq=%d, ht=%d, vht_ch=0x%x, he_ch=0x%x, offset=%d, width=%d (%s), cf1=%d, cf2=%d",
                       finished ? "had" : "starting",
-                      freq, ht, hapd->iconf->ch_switch_vht_config, offset,
+                      freq, ht, hapd->iconf->ch_switch_vht_config,
+                      hapd->iconf->ch_switch_he_config, offset,
                       width, channel_width_to_string(width), cf1, cf2);
 
        if (!hapd->iface->current_mode) {
@@ -944,8 +945,17 @@ void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht,
                else if (hapd->iconf->ch_switch_vht_config &
                         CH_SWITCH_VHT_DISABLED)
                        hapd->iconf->ieee80211ac = 0;
+       } else if (hapd->iconf->ch_switch_he_config) {
+               /* CHAN_SWITCH HE config */
+               if (hapd->iconf->ch_switch_he_config &
+                   CH_SWITCH_HE_ENABLED)
+                       hapd->iconf->ieee80211ax = 1;
+               else if (hapd->iconf->ch_switch_he_config &
+                        CH_SWITCH_HE_DISABLED)
+                       hapd->iconf->ieee80211ax = 0;
        }
        hapd->iconf->ch_switch_vht_config = 0;
+       hapd->iconf->ch_switch_he_config = 0;
 
        hapd->iconf->secondary_channel = offset;
        hostapd_set_oper_chwidth(hapd->iconf, chwidth);