]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Unsolicited broadcast Probe Response configuration
authorAloka Dixit <alokad@codeaurora.org>
Fri, 11 Sep 2020 02:45:47 +0000 (02:45 +0000)
committerJouni Malinen <j@w1.fi>
Sun, 14 Feb 2021 21:04:26 +0000 (23:04 +0200)
Unsolicited broadcast Probe Response transmission is used for in-band
discovery in the 6 GHz band (IEEE P802.11ax/D8.0 26.17.2.3.2, AP
behavior for fast passive scanning). Add support for configuring the
parameters for such frames.

Signed-off-by: Aloka Dixit <alokad@codeaurora.org>
src/drivers/driver_nl80211.c
src/drivers/driver_nl80211.h
src/drivers/driver_nl80211_capa.c

index 86b70d54649b674d4e39d7639c976b65bdd81d83..80d2b4a40015e2f531a3495b9c6d033c96bc1c71 100644 (file)
@@ -4433,6 +4433,39 @@ static int nl80211_fils_discovery(struct i802_bss *bss, struct nl_msg *msg,
 #endif /* CONFIG_FILS */
 
 
+#ifdef CONFIG_IEEE80211AX
+static int nl80211_unsol_bcast_probe_resp(struct i802_bss *bss,
+                                         struct nl_msg *msg,
+                                         struct wpa_driver_ap_params *params)
+{
+       struct nlattr *attr;
+
+       if (!bss->drv->unsol_bcast_probe_resp) {
+               wpa_printf(MSG_ERROR,
+                          "nl80211: Driver does not support unsolicited broadcast Probe Response frame transmission for %s",
+                          bss->ifname);
+               return -1;
+       }
+
+       wpa_printf(MSG_DEBUG,
+                  "nl80211: Unsolicited broadcast Probe Response frame interval: %u",
+                  params->unsol_bcast_probe_resp_interval);
+       attr = nla_nest_start(msg, NL80211_ATTR_UNSOL_BCAST_PROBE_RESP);
+       if (!attr ||
+           nla_put_u32(msg, NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT,
+                       params->unsol_bcast_probe_resp_interval) ||
+           (params->unsol_bcast_probe_resp_tmpl &&
+            nla_put(msg, NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL,
+                    params->unsol_bcast_probe_resp_tmpl_len,
+                    params->unsol_bcast_probe_resp_tmpl)))
+               return -1;
+
+       nla_nest_end(msg, attr);
+       return 0;
+}
+#endif /* CONFIG_IEEE80211AX */
+
+
 static int wpa_driver_nl80211_set_ap(void *priv,
                                     struct wpa_driver_ap_params *params)
 {
@@ -4709,6 +4742,10 @@ static int wpa_driver_nl80211_set_ap(void *priv,
                if (nla_put_flag(msg, NL80211_ATTR_TWT_RESPONDER))
                        goto fail;
        }
+
+       if (params->unsol_bcast_probe_resp_interval &&
+           nl80211_unsol_bcast_probe_resp(bss, msg, params) < 0)
+               goto fail;
 #endif /* CONFIG_IEEE80211AX */
 
 #ifdef CONFIG_SAE
index 343403017a7c5fb9d360f88646a12802d640adbe..940d82c87b6a0c9b402af5dfda1bcc27fa5cc02c 100644 (file)
@@ -176,6 +176,7 @@ struct wpa_driver_nl80211_data {
        unsigned int no_rrm:1;
        unsigned int get_sta_info_vendor_cmd_avail:1;
        unsigned int fils_discovery:1;
+       unsigned int unsol_bcast_probe_resp:1;
 
        u64 vendor_scan_cookie;
        u64 remain_on_chan_cookie;
index 3296ce9d67c83f723aeb14ae15ee94396bb3f02c..7eae0e325112b8b9f79d6bdd183cce7e1292b53e 100644 (file)
@@ -652,6 +652,10 @@ static void wiphy_info_ext_feature_flags(struct wiphy_info_data *info,
        if (ext_feature_isset(ext_features, len,
                              NL80211_EXT_FEATURE_FILS_DISCOVERY))
                info->drv->fils_discovery = 1;
+
+       if (ext_feature_isset(ext_features, len,
+                             NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP))
+               info->drv->unsol_bcast_probe_resp = 1;
 }