From 564865e1d48ffa057cef1ecaf2eec59ae98e0be1 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 29 Mar 2012 21:05:56 +0300 Subject: [PATCH] Stop sched_scan if requested to run full scan This allows the ctrl_iface SCAN command to be used to run through a scan to collect full scan results when sched_scan is in progress. sched_scan will be re-started automatically after the full scan. Signed-hostap: Jouni Malinen --- wpa_supplicant/ctrl_iface.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index daece5ff1..20ce8c1df 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -3944,13 +3944,20 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s, wpa_supplicant_deauthenticate(wpa_s, WLAN_REASON_DEAUTH_LEAVING); } else if (os_strcmp(buf, "SCAN") == 0) { - wpa_s->normal_scans = 0; if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) reply_len = -1; else { if (!wpa_s->scanning && ((wpa_s->wpa_state <= WPA_SCANNING) || (wpa_s->wpa_state == WPA_COMPLETED))) { + wpa_s->normal_scans = 0; + wpa_s->scan_req = 2; + wpa_supplicant_req_scan(wpa_s, 0, 0); + } else if (wpa_s->sched_scanning) { + wpa_printf(MSG_DEBUG, "Stop ongoing " + "sched_scan to allow requested " + "full scan to proceed"); + wpa_supplicant_cancel_sched_scan(wpa_s); wpa_s->scan_req = 2; wpa_supplicant_req_scan(wpa_s, 0, 0); } else {