]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP: Support overriding EHT operation puncturing mask
authorIlan Peer <ilan.peer@intel.com>
Thu, 21 Dec 2023 06:49:33 +0000 (08:49 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 22 Dec 2023 12:19:28 +0000 (14:19 +0200)
Add support for overriding EHT Operation element puncturing mask
for testing purposes.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
hostapd/config_file.c
src/ap/ap_config.h
src/ap/ieee802_11_eht.c

index 187e988135e06e438919f70f2756e5c6e791056e..af324bb2540849bc1ee144096d8116b434b88cf7 100644 (file)
@@ -4849,6 +4849,11 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                                   line);
                        return 1;
                }
+#ifdef CONFIG_TESTING_OPTIONS
+       } else if (os_strcmp(buf, "eht_oper_puncturing_override") == 0) {
+               if (get_u16(pos, line, &bss->eht_oper_puncturing_override))
+                       return 1;
+#endif /* CONFIG_TESTING_OPTIONS */
 #endif /* CONFIG_IEEE80211BE */
        } else {
                wpa_printf(MSG_ERROR,
index 0bc799d3e74d80eafd4c2179db02e83242314147..5bf41b43896d6edeb7aa867de2097ec390c08abd 100644 (file)
@@ -704,6 +704,10 @@ struct hostapd_bss_config {
        unsigned int oci_freq_override_ft_assoc;
        unsigned int oci_freq_override_fils_assoc;
        unsigned int oci_freq_override_wnm_sleep;
+
+#ifdef CONFIG_IEEE80211BE
+       u16 eht_oper_puncturing_override;
+#endif /* CONFIG_IEEE80211BE */
 #endif /* CONFIG_TESTING_OPTIONS */
 
 #define MESH_ENABLED BIT(0)
index ab4029197da4d0005698e8ecea4028749e5d458a..d03416b3d593391dcdef95618b72470dab82858a 100644 (file)
@@ -206,22 +206,31 @@ u8 * hostapd_eid_eht_operation(struct hostapd_data *hapd, u8 *eid)
        enum oper_chan_width chwidth;
        size_t elen = 1 + 4;
        bool eht_oper_info_present;
+       u16 punct_bitmap = conf->punct_bitmap;
 
        if (!hapd->iface->current_mode)
                return eid;
 
+#ifdef CONFIG_TESTING_OPTIONS
+       if (!punct_bitmap && hapd->conf->eht_oper_puncturing_override) {
+               wpa_printf(MSG_DEBUG, "EHT: Puncturing mask override=0x%x",
+                          hapd->conf->eht_oper_puncturing_override);
+               punct_bitmap = hapd->conf->eht_oper_puncturing_override;
+       }
+#endif /* CONFIG_TESTING_OPTIONS */
+
        if (is_6ghz_op_class(conf->op_class))
                chwidth = op_class_to_ch_width(conf->op_class);
        else
                chwidth = conf->eht_oper_chwidth;
 
        eht_oper_info_present = chwidth == CONF_OPER_CHWIDTH_320MHZ ||
-               hapd->iconf->punct_bitmap;
+               punct_bitmap;
 
        if (eht_oper_info_present)
                elen += 3;
 
-       if (hapd->iconf->punct_bitmap)
+       if (punct_bitmap)
                elen += EHT_OPER_DISABLED_SUBCHAN_BITMAP_SIZE;
 
        *pos++ = WLAN_EID_EXTENSION;
@@ -277,10 +286,10 @@ u8 * hostapd_eid_eht_operation(struct hostapd_data *hapd, u8 *eid)
        oper->oper_info.ccfs0 = seg0 ? seg0 : hapd->iconf->channel;
        oper->oper_info.ccfs1 = seg1;
 
-       if (hapd->iconf->punct_bitmap) {
+       if (punct_bitmap) {
                oper->oper_params |= EHT_OPER_DISABLED_SUBCHAN_BITMAP_PRESENT;
                oper->oper_info.disabled_chan_bitmap =
-                       host_to_le16(hapd->iconf->punct_bitmap);
+                       host_to_le16(punct_bitmap);
        }
 
        return pos + elen;