]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Android: Stop/restart supplicant scan on PNO start/stop
authorPandiyarajan Pitchaimuthu <c_ppitch@qca.qualcomm.com>
Tue, 25 Dec 2012 11:54:21 +0000 (13:54 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 25 Dec 2012 11:54:21 +0000 (13:54 +0200)
Cancel the existing supplicant scan and start a new supplicant
scan on PNO start and stop respectively. This makes sure that
supplicant scan is in progress when the device resumes.

Signed-off-by: Pandiyarajan Pitchaimuthu <c_ppitch@qca.qualcomm.com>
wpa_supplicant/ctrl_iface.c

index 35441dd363777e803429a5a46782fa4428ceed6a..864dd7d6d76a3a7fa4e630afcf2cd3ebc0ee65c6 100644 (file)
@@ -58,6 +58,11 @@ static int pno_start(struct wpa_supplicant *wpa_s)
        if (wpa_s->pno)
                return 0;
 
+       if (wpa_s->wpa_state == WPA_SCANNING) {
+               wpa_supplicant_cancel_sched_scan(wpa_s);
+               wpa_supplicant_cancel_scan(wpa_s);
+       }
+
        os_memset(&params, 0, sizeof(params));
 
        num_ssid = 0;
@@ -113,11 +118,17 @@ static int pno_start(struct wpa_supplicant *wpa_s)
 
 static int pno_stop(struct wpa_supplicant *wpa_s)
 {
+       int ret = 0;
+
        if (wpa_s->pno) {
                wpa_s->pno = 0;
-               return wpa_drv_stop_sched_scan(wpa_s);
+               ret = wpa_drv_stop_sched_scan(wpa_s);
        }
-       return 0;
+
+       if (wpa_s->wpa_state == WPA_SCANNING)
+               wpa_supplicant_req_scan(wpa_s, 0, 0);
+
+       return ret;
 }