[RFC 16/34] nl80211: Configure 'enable dw notification' NAN flag

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

 



Add enable_dw_notif flag to NAN cluster configuration parameters.
This flag is needed to toggle DW notifications generated by kernel in
case user space DE implementation is used.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@xxxxxxxxx>
---
 src/drivers/driver.h         |  1 +
 src/drivers/driver_nl80211.c | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index ad916f4f6c..337f77275f 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -3185,6 +3185,7 @@ struct driver_sta_mlo_info {
 struct nan_cluster_config {
 	u8 master_pref;
 	u8 dual_band;
+	bool enable_dw_notif;
 };
 
 /**
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 71ddb7664a..81313a116f 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -15020,6 +15020,7 @@ static int wpa_driver_nl80211_nan_start(void *priv,
 	struct i802_bss *bss = priv;
 	struct wpa_driver_nl80211_data *drv = bss->drv;
 	struct nl_msg *msg;
+	struct nlattr *conf;
 	u32 bands = 0;
 	int ret;
 
@@ -15055,6 +15056,25 @@ static int wpa_driver_nl80211_nan_start(void *priv,
 		goto fail;
 	}
 
+	conf = nla_nest_start(msg, NL80211_ATTR_NAN_CONFIG);
+	if (!conf)
+		goto fail;
+
+	if (params->enable_dw_notif) {
+		if (!(drv->capa.nan_flags &
+		      WPA_DRIVER_FLAGS_NAN_SUPPORT_USERSPACE_DE)) {
+			wpa_printf(MSG_DEBUG,
+				   "nl80211: Driver doesn't support NAN DW notifications");
+			goto fail;
+		}
+
+		if (nla_put_flag(msg, NL80211_NAN_CONF_NOTIFY_DW))
+			goto fail;
+	}
+
+	/* TODO: Set more attributes */
+	nla_nest_end(msg, conf);
+
 	ret = send_and_recv_resp(drv, msg, NULL, NULL);
 	if (!ret)
 		drv->nan_started = 1;
-- 
2.49.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