]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Add FILS Discovery frame configuration
authorAloka Dixit <alokad@codeaurora.org>
Tue, 15 Dec 2020 02:04:28 +0000 (18:04 -0800)
committerJouni Malinen <j@w1.fi>
Sun, 14 Feb 2021 16:18:18 +0000 (18:18 +0200)
Add support for setting the parameters for FILS Discovery frame
transmission.

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 3790fe2bb1de121f8e851b57942993226181cc13..86b70d54649b674d4e39d7639c976b65bdd81d83 100644 (file)
@@ -4403,6 +4403,36 @@ static int nl80211_put_sae_pwe(struct nl_msg *msg, int pwe)
 #endif /* CONFIG_SAE */
 
 
+#ifdef CONFIG_FILS
+static int nl80211_fils_discovery(struct i802_bss *bss, struct nl_msg *msg,
+                                 struct wpa_driver_ap_params *params)
+{
+       struct nlattr *attr;
+
+       if (!bss->drv->fils_discovery) {
+               wpa_printf(MSG_ERROR,
+                          "nl80211: Driver does not support FILS Discovery frame transmission for %s",
+                          bss->ifname);
+               return -1;
+       }
+
+       attr = nla_nest_start(msg, NL80211_ATTR_FILS_DISCOVERY);
+       if (!attr ||
+           nla_put_u32(msg, NL80211_FILS_DISCOVERY_ATTR_INT_MIN,
+                       params->fd_min_int) ||
+           nla_put_u32(msg, NL80211_FILS_DISCOVERY_ATTR_INT_MAX,
+                       params->fd_max_int) ||
+           (params->fd_frame_tmpl &&
+            nla_put(msg, NL80211_FILS_DISCOVERY_ATTR_TMPL,
+                    params->fd_frame_tmpl_len, params->fd_frame_tmpl)))
+               return -1;
+
+       nla_nest_end(msg, attr);
+       return 0;
+}
+#endif /* CONFIG_FILS */
+
+
 static int wpa_driver_nl80211_set_ap(void *priv,
                                     struct wpa_driver_ap_params *params)
 {
@@ -4688,6 +4718,11 @@ static int wpa_driver_nl80211_set_ap(void *priv,
                goto fail;
 #endif /* CONFIG_SAE */
 
+#ifdef CONFIG_FILS
+       if (params->fd_max_int && nl80211_fils_discovery(bss, msg, params) < 0)
+               goto fail;
+#endif /* CONFIG_FILS */
+
        ret = send_and_recv_msgs_owner(drv, msg, get_connect_handle(bss), 1,
                                       NULL, NULL, NULL, NULL);
        if (ret) {
index 7b9be1f3a9f49b567dbb4c84f29c1bcede4d263d..343403017a7c5fb9d360f88646a12802d640adbe 100644 (file)
@@ -175,6 +175,7 @@ struct wpa_driver_nl80211_data {
        unsigned int multicast_registrations:1;
        unsigned int no_rrm:1;
        unsigned int get_sta_info_vendor_cmd_avail:1;
+       unsigned int fils_discovery:1;
 
        u64 vendor_scan_cookie;
        u64 remain_on_chan_cookie;
index 6dea42f90dce78d6cf9aa42cf8823cb6d1f96fa7..3296ce9d67c83f723aeb14ae15ee94396bb3f02c 100644 (file)
@@ -648,6 +648,10 @@ static void wiphy_info_ext_feature_flags(struct wiphy_info_data *info,
        if (ext_feature_isset(ext_features, len,
                              NL80211_EXT_FEATURE_MULTICAST_REGISTRATIONS))
                info->drv->multicast_registrations = 1;
+
+       if (ext_feature_isset(ext_features, len,
+                             NL80211_EXT_FEATURE_FILS_DISCOVERY))
+               info->drv->fils_discovery = 1;
 }