[PATCH v2 3/3] nl80211: Add FILS discovery support

Aloka Dixit alokad at codeaurora.org
Thu Sep 10 22:21:49 EDT 2020


This patch adds new attributes to support FILS discovery transmission.
New attribute, NL80211_ATTR_FILS_DISCOVERY, is nested which
supports following parameters (IEEE Std 802.11ai-2016, Annex C.3 MIB
detail):
(1) NL80211_FILS_DISCOVERY_ATTR_MIN_INT - Minimum packet interval
(2) NL80211_FILS_DISCOVERY_ATTR_MAX_INT - Maximum packet interval
(3) NL80211_FILS_DISCOVERY_ATTR_TMPL - Template data

Signed-off-by: Aloka Dixit <alokad at codeaurora.org>
---
 src/drivers/driver_nl80211.c      | 54 +++++++++++++++++++++++++++++++
 src/drivers/driver_nl80211.h      |  1 +
 src/drivers/driver_nl80211_capa.c |  4 +++
 3 files changed, 59 insertions(+)

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 2ee34d11d64e..3a7d36966f8c 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -4301,6 +4301,49 @@ static int nl80211_set_multicast_to_unicast(struct i802_bss *bss,
 }
 
 
+#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 transmission for %s\n",
+			   bss->ifname);
+		return -1;
+	}
+
+	attr = nla_nest_start(msg, NL80211_ATTR_FILS_DISCOVERY);
+	if (!attr)
+		return -1;
+
+	if (nla_put_u32(msg, NL80211_FILS_DISCOVERY_ATTR_INT_MIN,
+			params->fils_discovery_min_int) ||
+	    nla_put_u32(msg, NL80211_FILS_DISCOVERY_ATTR_INT_MAX,
+			params->fils_discovery_max_int)) {
+		wpa_printf(MSG_ERROR,
+			   "nl80211: Failed to build FILS discovery msg for %s\n",
+			   bss->ifname);
+		return -1;
+	}
+
+	if (params->fils_discovery_tmpl &&
+	    nla_put(msg, NL80211_FILS_DISCOVERY_ATTR_TMPL,
+		    params->fils_discovery_tmpl_len,
+		    params->fils_discovery_tmpl)) {
+		wpa_printf(MSG_ERROR,
+			   "nl80211: Failed to build FILS discovery msg for %s\n",
+			   bss->ifname);
+		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)
 {
@@ -4561,6 +4604,17 @@ static int wpa_driver_nl80211_set_ap(void *priv,
 	}
 #endif /* CONFIG_IEEE80211AX */
 
+#ifdef CONFIG_FILS
+	if (params->fils_discovery_max_int) {
+		wpa_printf(MSG_DEBUG,
+			   "nl80211: FILS discovery maximum interval = %u\n",
+                           params->fils_discovery_max_int);
+		ret = nl80211_fils_discovery(bss, msg, params);
+		if (ret < 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) {
diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
index 017c025a0d75..d3e82c982810 100644
--- a/src/drivers/driver_nl80211.h
+++ b/src/drivers/driver_nl80211.h
@@ -174,6 +174,7 @@ struct wpa_driver_nl80211_data {
 	unsigned int control_port_ap:1;
 	unsigned int multicast_registrations:1;
 	unsigned int no_rrm:1;
+	unsigned int fils_discovery:1;
 
 	u64 vendor_scan_cookie;
 	u64 remain_on_chan_cookie;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
index 46f61fdbf925..90f55db99d15 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -644,6 +644,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;
 }
 
 
-- 
2.25.0




More information about the Hostap mailing list