]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Stop sched_scan if requested to run full scan
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 29 Mar 2012 18:05:56 +0000 (21:05 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 29 Mar 2012 18:05:56 +0000 (21:05 +0300)
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 <jouni@qca.qualcomm.com>

wpa_supplicant/ctrl_iface.c

index daece5ff1be5e4c134b8c3eb7d2bd36a3e504c15..20ce8c1dfae3834c3d18d224b8b4626882aee6a0 100644 (file)
@@ -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 {