]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix channel switch without 'ht' for HE and EHT modes in 2.4 GHz band
authorPradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
Wed, 8 May 2024 18:04:05 +0000 (11:04 -0700)
committerJouni Malinen <j@w1.fi>
Fri, 12 Jul 2024 09:25:55 +0000 (12:25 +0300)
hostapd_cli chan_switch command fails in 2.4 GHz band for HE and EHT
modes if the user does not explicitly specify 'ht' option in the
command.

For example:
"hostapd_cli -i wlan2 chan_switch 10 2412 sec_channel_offset=0 \
 center_freq1=2412 bandwidth=20 blocktx he"

Fix this by enabling HT by default if HE is enabled in the 2.4 GHz and 5
GHz bands. Similarly, enable VHT by default when HE is enabled in the 5
GHz band.

Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
hostapd/ctrl_iface.c

index 92df81c6c013672d77eb36623d4b5a7d522d7003..39b9ef59dc57a4b7e79fbe7aead5db9ca3acb231 100644 (file)
@@ -2477,6 +2477,21 @@ static int hostapd_ctrl_check_freq_params(struct hostapd_freq_params *params,
                            bw_idx[bw] != params->bandwidth)
                                return -1;
                }
+       } else { /* Non-6 GHz channel */
+               /* An EHT STA is also an HE STA as defined in
+                * IEEE P802.11be/D5.0, 4.3.16a. */
+               if (params->he_enabled || params->eht_enabled) {
+                       params->he_enabled = 1;
+                       /* An HE STA is also a VHT STA if operating in the 5 GHz
+                        * band and an HE STA is also an HT STA in the 2.4 GHz
+                        * band as defined in IEEE Std 802.11ax-2021, 4.3.15a.
+                        * A VHT STA is an HT STA as defined in IEEE
+                        * Std 802.11, 4.3.15. */
+                       if (IS_5GHZ(params->freq))
+                               params->vht_enabled = 1;
+
+                       params->ht_enabled = 1;
+               }
        }
 
        switch (params->bandwidth) {