[RFC 14/34] wpa_supplicant: Check SYNC_CONFIG support

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

 



Currently, NAN support is assumed if NAN device interface is supported.
Since wpa_supplicant implementation is intended to work with new driver
and kernel only, make sure WPA_DRIVER_FLAGS_NAN_SUPPORT_SYNC_CONFIG flag
is set.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@xxxxxxxxx>
---
 wpa_supplicant/nan_supplicant.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/wpa_supplicant/nan_supplicant.c b/wpa_supplicant/nan_supplicant.c
index e8d3650c6b..d29deaa99f 100644
--- a/wpa_supplicant/nan_supplicant.c
+++ b/wpa_supplicant/nan_supplicant.c
@@ -38,7 +38,8 @@ int wpas_nan_init(struct wpa_supplicant *wpa_s)
 {
 	struct nan_config nan;
 
-	if (!(wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_SUPPORT_NAN)) {
+	if (!(wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_SUPPORT_NAN) ||
+	    !(wpa_s->nan_drv_flags & WPA_DRIVER_FLAGS_NAN_SUPPORT_SYNC_CONFIG)) {
 		wpa_printf(MSG_DEBUG, "NAN: NAN is not supported");
 		return -1;
 	}
@@ -84,6 +85,13 @@ int wpas_nan_start(struct wpa_supplicant *wpa_s)
 	if (!wpas_nan_ready(wpa_s))
 		return -1;
 
+	if (!(wpa_s->nan_drv_flags &
+	      WPA_DRIVER_FLAGS_NAN_SUPPORT_SYNC_CONFIG)) {
+		wpa_printf(MSG_DEBUG,
+			   "NAN: Driver doesn't support configurable NAN sync");
+		return -1;
+	}
+
 	cluster_config.master_pref = DEFAULT_NAN_MASTER_PREF;
 	cluster_config.dual_band = DEFAULT_NAN_DUAL_BAND;
 
-- 
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