]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP: Unsolicited broadcast Probe Response configuration
authorAloka Dixit <alokad@codeaurora.org>
Fri, 11 Sep 2020 02:45:46 +0000 (02:45 +0000)
committerJouni Malinen <j@w1.fi>
Sun, 14 Feb 2021 21:04:26 +0000 (23:04 +0200)
Add hostapd configuration options for unsolicited broadcast
Probe Response transmission for in-band discovery in 6 GHz.
Maximum allowed packet interval is 20 TUs (IEEE P802.11ax/D8.0
26.17.2.3.2, AP behavior for fast passive scanning).
Setting value to 0 disables the transmission.

Signed-off-by: Aloka Dixit <alokad@codeaurora.org>
hostapd/config_file.c
hostapd/hostapd.conf
src/ap/ap_config.h
src/ap/beacon.c
src/drivers/driver.h

index a07e71eda18256ce7dd89aefb3a6e31ba5eeab39..64704fb3dc9e688eae99f1976cda2fc649dab1d6 100644 (file)
@@ -3617,6 +3617,16 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                conf->he_6ghz_rx_ant_pat = atoi(pos);
        } else if (os_strcmp(buf, "he_6ghz_tx_ant_pat") == 0) {
                conf->he_6ghz_tx_ant_pat = atoi(pos);
+       } else if (os_strcmp(buf, "unsol_bcast_probe_resp_interval") == 0) {
+               int val = atoi(pos);
+
+               if (val < 0 || val > 20) {
+                       wpa_printf(MSG_ERROR,
+                                  "Line %d: invalid unsol_bcast_probe_resp_interval value",
+                                  line);
+                       return 1;
+               }
+               bss->unsol_bcast_probe_resp_interval = val;
 #endif /* CONFIG_IEEE80211AX */
        } else if (os_strcmp(buf, "max_listen_interval") == 0) {
                bss->max_listen_interval = atoi(pos);
index d8a4e9474b6dad7be8bd0b815e5dd4b6a053f3bd..1f4d33a76593793e6b6b32b44dcf1e9b0b0ca073 100644 (file)
@@ -933,6 +933,14 @@ wmm_ac_vo_acm=0
 #     (default)
 #he_6ghz_tx_ant_pat=1
 
+# Unsolicited broadcast Probe Response transmission settings
+# This is for the 6 GHz band only. If the interval is set to a non-zero value,
+# the AP schedules unsolicited broadcast Probe Response frames to be
+# transmitted for in-band discovery. Refer to
+# IEEE P802.11ax/D8.0 26.17.2.3.2, AP behavior for fast passive scanning.
+# Valid range: 0..20 TUs; default is 0 (disabled)
+#unsol_bcast_probe_resp_interval=0
+
 ##### IEEE 802.1X-2004 related configuration ##################################
 
 # Require IEEE 802.1X authorization
index 23b5b2a5fdeb775d873456f516732bc96f99029f..88200c688d4fb7edf2ac261a1bb985d0eccf989d 100644 (file)
@@ -878,6 +878,8 @@ struct hostapd_bss_config {
 
        int *pasn_groups;
 #endif /* CONFIG_PASN */
+
+       unsigned int unsol_bcast_probe_resp_interval;
 };
 
 /**
index 6187c09638416f6caaf734b91068073396883c51..7d9e8b9230c26b42b2491f38e07134c897519625 100644 (file)
@@ -1124,6 +1124,23 @@ static u8 * hostapd_probe_resp_offloads(struct hostapd_data *hapd,
 #endif /* NEED_AP_MLME */
 
 
+#ifdef CONFIG_IEEE80211AX
+/* Unsolicited broadcast Probe Response transmission, 6 GHz only */
+static u8 * hostapd_unsol_bcast_probe_resp(struct hostapd_data *hapd,
+                                          struct wpa_driver_ap_params *params)
+{
+       if (!is_6ghz_op_class(hapd->iconf->op_class))
+               return NULL;
+
+       params->unsol_bcast_probe_resp_interval =
+               hapd->conf->unsol_bcast_probe_resp_interval;
+
+       return hostapd_gen_probe_resp(hapd, NULL, 0,
+                                     &params->unsol_bcast_probe_resp_tmpl_len);
+}
+#endif /* CONFIG_IEEE80211AX */
+
+
 void sta_track_del(struct hostapd_sta_info *info)
 {
 #ifdef CONFIG_TAXONOMY
@@ -1719,6 +1736,10 @@ void ieee802_11_free_ap_params(struct wpa_driver_ap_params *params)
        os_free(params->fd_frame_tmpl);
        params->fd_frame_tmpl = NULL;
 #endif /* CONFIG_FILS */
+#ifdef CONFIG_IEEE80211AX
+       os_free(params->unsol_bcast_probe_resp_tmpl);
+       params->unsol_bcast_probe_resp_tmpl = NULL;
+#endif /* CONFIG_IEEE80211AX */
 }
 
 
@@ -1769,6 +1790,8 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd)
        params.he_bss_color = hapd->iface->conf->he_op.he_bss_color;
        params.twt_responder = hostapd_get_he_twt_responder(hapd,
                                                            IEEE80211_MODE_AP);
+       params.unsol_bcast_probe_resp_tmpl =
+               hostapd_unsol_bcast_probe_resp(hapd, &params);
 #endif /* CONFIG_IEEE80211AX */
        hapd->reenable_beacon = 0;
 #ifdef CONFIG_SAE
index 2a61b550e6bd98fcc3f055413065929b66292f1d..24fb877e588b33bcbeda48516ffb536c6c677c30 100644 (file)
@@ -1561,6 +1561,21 @@ struct wpa_driver_ap_params {
         * FILS Discovery frame template length
         */
        size_t fd_frame_tmpl_len;
+
+       /**
+        * Unsolicited broadcast Probe Response interval in TUs
+        */
+       unsigned int unsol_bcast_probe_resp_interval;
+
+       /**
+        * Unsolicited broadcast Probe Response template data
+        */
+       u8 *unsol_bcast_probe_resp_tmpl;
+
+       /**
+        * Unsolicited broadcast Probe Response template length
+        */
+       size_t unsol_bcast_probe_resp_tmpl_len;
 };
 
 struct wpa_driver_mesh_bss_params {