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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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_MIN_INT - Minimum packet interval
(2) NL80211_FILS_DISCOVERY_MAX_INT - Maximum packet interval
(3) NL80211_FILS_DISCOVERY_TMPL - Template data

Signed-off-by: Aloka Dixit <alokad@xxxxxxxxxxxxxx>
---
 src/drivers/driver_nl80211.c | 43 ++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 72189da240dd..1deef5231abc 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -4223,6 +4223,43 @@ 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 wpa_driver_nl80211_data *drv = bss->drv;
+	struct nlattr *attr;
+
+	attr = nla_nest_start(msg, NL80211_ATTR_FILS_DISCOVERY);
+	if (!attr)
+		return -1;
+
+	if (nla_put_u32(msg, NL80211_FILS_DISCOVERY_INT_MIN,
+			params->fils_discovery_min_int) ||
+	    nla_put_u32(msg, NL80211_FILS_DISCOVERY_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_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)
 {
@@ -4483,6 +4520,12 @@ static int wpa_driver_nl80211_set_ap(void *priv,
 	}
 #endif /* CONFIG_IEEE80211AX */
 
+#ifdef CONFIG_FILS
+	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);
 	if (ret) {
-- 
2.25.0


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux