<div dir="ltr"><br><div class="gmail_extra"><div><div>Hi Jouni,</div><div><br></div></div><div>I saw few issues with scheduled scan inter-op with legacy scan . Could you see whether the changes to address below issues are fine.</div>
<div><br></div><div>a) While starting from PNO start context the scheduled</div><div> scan was not setting the flag wpa_s->scanning. This was resulting</div><div> in the subsequent SCAN command to proceed further and send command to nl80211/cfg80211.</div>
<div><div> The expected behaviour of cancelling sched scan is not happening here.</div></div><div class="gmail_extra"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
</blockquote>b) While schedscan is in progress and a legacy scan comes<br><blockquote class="gmail_quote" style="margin:0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;border-right-width:1px;border-right-color:rgb(204,204,204);border-right-style:solid;padding-left:1ex;padding-right:1ex">
</blockquote> on the cli/socket the sched scan is cancelled and normal scan<br><blockquote class="gmail_quote" style="margin:0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;border-right-width:1px;border-right-color:rgb(204,204,204);border-right-style:solid;padding-left:1ex;padding-right:1ex">
</blockquote> is allowed to continue. However, sometimes schedscan cancelled<br> event comes a bit delayed and we will send out the scan command before the </div><div class="gmail_extra"> wpa_s->scanning is cleared. Instead, the incoming scan req is</div>
<div class="gmail_extra"> rescheduled now if the wpa_s->scanning shows that it is still in progress.<br><div> </div><div class="gmail_quote">On Thu, Oct 17, 2013 at 11:56 AM, Jithu Jance <span dir="ltr"><<a href="mailto:jithu@broadcom.com" target="_blank">jithu@broadcom.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Signed-hostap: Jithu Jance <<a href="mailto:jithu@broadcom.com">jithu@broadcom.com</a>><br>
---<br>
wpa_supplicant/ctrl_iface.c | 5 +++--<br>
wpa_supplicant/scan.c | 14 ++++++++++++--<br>
wpa_supplicant/scan.h | 4 ++++<br>
3 files changed, 19 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c<br>
index 0f893f7..e993973 100644<br>
--- a/wpa_supplicant/ctrl_iface.c<br>
+++ b/wpa_supplicant/ctrl_iface.c<br>
@@ -111,7 +111,8 @@ static int pno_start(struct wpa_supplicant *wpa_s)<br>
interval = wpa_s->conf->sched_scan_interval ?<br>
wpa_s->conf->sched_scan_interval : 10;<br>
<br>
- ret = wpa_drv_sched_scan(wpa_s, &params, interval * 1000);<br>
+ ret = wpa_supplicant_start_sched_scan(wpa_s, &params,<br>
+ interval);<br>
os_free(params.filter_ssids);<br>
if (ret == 0)<br>
wpa_s->pno = 1;<br>
@@ -125,7 +126,7 @@ static int pno_stop(struct wpa_supplicant *wpa_s)<br>
<br>
if (wpa_s->pno) {<br>
wpa_s->pno = 0;<br>
- ret = wpa_drv_stop_sched_scan(wpa_s);<br>
+ ret = wpa_supplicant_stop_sched_scan(wpa_s);<br>
}<br>
<br>
if (wpa_s->wpa_state == WPA_SCANNING)<br>
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c<br>
index be826db..0074cf3 100644<br>
--- a/wpa_supplicant/scan.c<br>
+++ b/wpa_supplicant/scan.c<br>
@@ -260,7 +260,7 @@ wpa_supplicant_sched_scan_timeout(void *eloop_ctx, void *timeout_ctx)<br>
}<br>
<br>
<br>
-static int<br>
+int<br>
wpa_supplicant_start_sched_scan(struct wpa_supplicant *wpa_s,<br>
struct wpa_driver_scan_params *params,<br>
int interval)<br>
@@ -278,7 +278,8 @@ wpa_supplicant_start_sched_scan(struct wpa_supplicant *wpa_s,<br>
}<br>
<br>
<br>
-static int wpa_supplicant_stop_sched_scan(struct wpa_supplicant *wpa_s)<br>
+int<br>
+wpa_supplicant_stop_sched_scan(struct wpa_supplicant *wpa_s)<br>
{<br>
int ret;<br>
<br>
@@ -566,6 +567,15 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)<br>
return;<br>
}<br>
<br>
+ if (wpa_s->scanning) {<br>
+ /* If we are already in scanning state, we shall reschedule the<br>
+ * the incomming scan request<br>
+ */<br>
+ wpa_dbg(wpa_s, MSG_DEBUG, "Already scanning - Reschedule the "<br>
+ "incoming scan req");<br>
+ wpa_supplicant_req_scan(wpa_s, 1, 0);<br>
+ return;<br>
+ }<br>
if (!wpa_supplicant_enabled_networks(wpa_s) &&<br>
wpa_s->scan_req == NORMAL_SCAN_REQ) {<br>
wpa_dbg(wpa_s, MSG_DEBUG, "No enabled networks - do not scan");<br>
diff --git a/wpa_supplicant/scan.h b/wpa_supplicant/scan.h<br>
index 66581a9..f6910ae 100644<br>
--- a/wpa_supplicant/scan.h<br>
+++ b/wpa_supplicant/scan.h<br>
@@ -39,5 +39,9 @@ void wpa_supplicant_update_scan_int(struct wpa_supplicant *wpa_s, int sec);<br>
void scan_only_handler(struct wpa_supplicant *wpa_s,<br>
struct wpa_scan_results *scan_res);<br>
int wpas_scan_scheduled(struct wpa_supplicant *wpa_s);<br>
+int wpa_supplicant_start_sched_scan(struct wpa_supplicant *wpa_s,<br>
+ struct wpa_driver_scan_params *params, int interval);<br>
+int<br>
+wpa_supplicant_stop_sched_scan(struct wpa_supplicant *wpa_s);<br>
<br>
#endif /* SCAN_H */<br>
--<br>
1.7.9.5<br>
<br>
<br>
_______________________________________________<br>
HostAP mailing list<br>
<a href="mailto:HostAP@lists.shmoo.com">HostAP@lists.shmoo.com</a><br>
<a href="http://lists.shmoo.com/mailman/listinfo/hostap" target="_blank">http://lists.shmoo.com/mailman/listinfo/hostap</a><br>
</blockquote></div> </div></div>