[PATCH 1/1] Fix NAN USD state machine stall seen with listen failure.

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

 



If driver returns -EBUSY for remain_on_channel operation, NAN USD state-machine gets stuck and no further listen is configured from supplicant.
This patch clears the states and re-triggers the nan_de_timer to restart the listen operation.

bug:298345110
test:benchtested.

Signed-off-by: Ajay Davanageri <ajay.davanageri@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
---
 wpa_supplicant/nan_usd.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/wpa_supplicant/nan_usd.c b/wpa_supplicant/nan_usd.c
index 946d62fb3..46df47291 100644
--- a/wpa_supplicant/nan_usd.c
+++ b/wpa_supplicant/nan_usd.c
@@ -9,6 +9,7 @@
 #include "utils/includes.h"
 
 #include "utils/common.h"
+#include "utils/eloop.h"
 #include "common/nan_de.h"
 #include "wpa_supplicant_i.h"
 #include "offchannel.h"
@@ -180,6 +181,13 @@ static void wpas_nan_usd_listen_work_done(struct wpa_supplicant *wpa_s)
 	wpa_s->nan_usd_listen_work = NULL;
 }
 
+static void wpas_nan_usd_remain_on_channel_timeout(void *eloop_ctx, void *timeout_ctx)
+{
+	struct wpa_supplicant *wpa_s = (struct wpa_supplicant *)eloop_ctx;
+	struct wpas_nan_usd_listen_work *lwork = (struct wpas_nan_usd_listen_work *)timeout_ctx;
+
+	wpas_nan_usd_cancel_remain_on_channel_cb(wpa_s, lwork->freq);
+}
 
 static void wpas_nan_usd_start_listen_cb(struct wpa_radio_work *work,
 					 int deinit)
@@ -208,6 +216,9 @@ static void wpas_nan_usd_start_listen_cb(struct wpa_radio_work *work,
 		wpa_printf(MSG_DEBUG,
 			   "NAN: Failed to request the driver to remain on channel (%u MHz) for listen",
 			   lwork->freq);
+                eloop_cancel_timeout(wpas_nan_usd_remain_on_channel_timeout, wpa_s, NULL);
+		/* restart the listen state after a delay */
+		eloop_register_timeout(0, 500, wpas_nan_usd_remain_on_channel_timeout, wpa_s, lwork)
 		wpas_nan_usd_listen_work_done(wpa_s);
 		return;
 	}
-- 
2.34.1


_______________________________________________
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