]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_supplicant: Add option to disable 80+80 MHz opclass advertisement
authorHu Wang <huw@qti.qualcomm.com>
Tue, 19 Aug 2025 06:43:40 +0000 (23:43 -0700)
committerJouni Malinen <j@w1.fi>
Thu, 21 Aug 2025 21:35:38 +0000 (00:35 +0300)
Introduce a new global configuration parameter,
disable_op_classes_80_80_mhz, to wpa_supplicant. When set to 1, this
option prevents the advertisement of 80+80 MHz channel capabilities in
the Supported Operating Classes element sent in (Re)Association Request
frames.

This addresses a specific compatibility issue reported with certain
legacy or less compliant Soft AP implementations (e.g., on Windows PCs)
which may misinterpret or fail to process the specific octet sequence
used for 80+80 MHz channel advertisements within this element.

Signed-off-by: Hu Wang <huw@qti.qualcomm.com>
wpa_supplicant/config.c
wpa_supplicant/config.h
wpa_supplicant/config_file.c
wpa_supplicant/op_classes.c
wpa_supplicant/p2p_supplicant.c
wpa_supplicant/wpa_cli.c

index aad4e75086b29f36fd0c7a4dac85a09187aeee6a..a0f71cfc6ecc670b26474a0468c8d5dc4a1d850b 100644 (file)
@@ -5705,6 +5705,7 @@ static const struct global_parse_data global_fields[] = {
        { INT_RANGE(wfa_gen_capa, 0, 2), 0},
        { BIN(wfa_gen_capa_supp), 0 },
        { BIN(wfa_gen_capa_cert), 0 },
+       { BOOL(disable_op_classes_80_80_mhz), 0 },
        /* NOTE: When adding new parameters here, add_interface() in
         * wpa_supplicant/dbus_new_introspect.c may need to be modified to
         * increase the size of the iface->xml buffer. */
index 83083b509bc48515852a8d1d598125be122e94bf..c187d36edecc1bdab255083610271e061519d19f 100644 (file)
@@ -1899,6 +1899,16 @@ struct wpa_config {
         * wfa_gen_capa_supp.
         */
        struct wpabuf *wfa_gen_capa_cert;
+
+       /**
+        * disable_op_classes_80_80_mhz - Disable advertisement of 80+80 MHz
+        * channel capabilities in the Supported Operating Classes element
+        *
+        * By default, %wpa_supplicant tries to advertise 80+80 MHz channel
+        * capabilities in the Supported Operating Classes element if the driver
+        * supports this.
+       */
+       bool disable_op_classes_80_80_mhz;
 };
 
 
index e9a8fa47050444e6e84ad35fea76027d5d3e676e..b1ba03ac5a7199c538dd1a3032a3bf2a389b3d94 100644 (file)
@@ -1753,6 +1753,9 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
                fprintf(f, "wfa_gen_capa=%d\n", config->wfa_gen_capa);
        write_global_bin(f, "wfa_gen_capa_supp", config->wfa_gen_capa_supp);
        write_global_bin(f, "wfa_gen_capa_cert", config->wfa_gen_capa_cert);
+       if (config->disable_op_classes_80_80_mhz)
+               fprintf(f, "disable_op_classes_80_80_mhz=%d\n",
+                       config->disable_op_classes_80_80_mhz);
 }
 
 static void wpa_config_write_identity(FILE *f, struct wpa_dev_ik *dev_ik)
index ec66e8ccd204769c5e67aee786030c5c014b9f03..72ac3e91ba35ab042ea886e0493a2c9100255548 100644 (file)
@@ -15,6 +15,7 @@
 #include "common/ieee802_11_common.h"
 #include "wpa_supplicant_i.h"
 #include "bss.h"
+#include "config.h"
 
 
 static enum chan_allowed allow_channel(struct hostapd_hw_modes *mode,
@@ -530,6 +531,8 @@ size_t wpas_supp_op_class_ie(struct wpa_supplicant *wpa_s,
        u8 *ie_len;
        size_t res;
        bool op128 = false, op130 = false, op133 = false, op135 = false;
+       bool disable_op_classes_80_80_mhz = wpa_s->conf ?
+               wpa_s->conf->disable_op_classes_80_80_mhz : false;
 
        /*
         * Determine the current operating class correct mode based on
@@ -586,7 +589,8 @@ size_t wpas_supp_op_class_ie(struct wpa_supplicant *wpa_s,
        }
 
        /* Add the 2-octet operating classes (i.e., 80+80 MHz cases), if any */
-       if ((op128 && op130) || (op133 && op135)) {
+       if (!disable_op_classes_80_80_mhz &&
+           ((op128 && op130) || (op133 && op135))) {
                /* Operating Class Duple Sequence field */
 
                /* Zero Delimiter */
index 300e118f33bde34f8297d97c9db508e44bdbea9e..e62b74d7b82b9ecb9859c65253d6b58814a427d5 100644 (file)
@@ -2643,6 +2643,7 @@ do {                                    \
        d->go_venue_group = s->go_venue_group;
        d->go_venue_type = s->go_venue_type;
        d->p2p_add_cli_chan = s->p2p_add_cli_chan;
+       d->disable_op_classes_80_80_mhz = s->disable_op_classes_80_80_mhz;
 }
 
 
index b13bf49924f4e5084912ec43a0654151c2d6f549..03180a316ffed15e27b3c29a85bc17c6a1fcd931 100644 (file)
@@ -524,6 +524,7 @@ static char ** wpa_cli_complete_set(const char *str, int pos)
 #endif /* CONFIG_TESTING_OPTIONS */
                "relative_rssi", "relative_band_adjust",
                "extended_key_id",
+               "disable_op_classes_80_80_mhz",
        };
        int i, num_fields = ARRAY_SIZE(fields);
 
@@ -624,7 +625,8 @@ static char ** wpa_cli_complete_get(const char *str, int pos)
                "tdls_external_control", "wowlan_triggers",
                "p2p_search_delay", "mac_addr", "rand_addr_lifetime",
                "preassoc_mac_addr", "key_mgmt_offload", "passive_scan",
-               "reassoc_same_bss_optim", "extended_key_id"
+               "reassoc_same_bss_optim", "extended_key_id",
+               "disable_op_classes_80_80_mhz"
        };
        int i, num_fields = ARRAY_SIZE(fields);