]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Abort an ongoing scan before connect
authorKanchanapally, Vidyullatha <vkanchan@qti.qualcomm.com>
Mon, 19 Oct 2015 14:00:34 +0000 (19:30 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 26 Nov 2015 17:44:14 +0000 (19:44 +0200)
Connect radio work is sometimes delayed for a considerable duration if
there is an ongoing scan radio work. To avoid these delays abort the
ongoing scan on that interface before queuing a connect request. Upon a
scan done indication from the driver, connect radio work will be
scheduled.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant/scan.c
wpa_supplicant/scan.h
wpa_supplicant/sme.c
wpa_supplicant/wpa_supplicant.c

index 076766ea2e22b35044045b972d1dc750c86277df..a39922fd5fe05420cfc9cc4d0e0948d9e71f1277 100644 (file)
@@ -2465,3 +2465,14 @@ int wpas_mac_addr_rand_scan_set(struct wpa_supplicant *wpa_s,
        wpa_s->mac_addr_rand_enable |= type;
        return 0;
 }
+
+
+int wpas_abort_ongoing_scan(struct wpa_supplicant *wpa_s)
+{
+       if (wpa_s->scan_work && wpa_s->own_scan_running) {
+               wpa_dbg(wpa_s, MSG_DEBUG, "Abort an ongoing scan");
+               return wpa_drv_abort_scan(wpa_s);
+       }
+
+       return 0;
+}
index 7650f5a250958cb3de86d340816db6f026d82d4d..0f1c8e49833965f96f021b8780b3484262195b7e 100644 (file)
@@ -54,5 +54,6 @@ void wpas_mac_addr_rand_scan_clear(struct wpa_supplicant *wpa_s,
 int wpas_mac_addr_rand_scan_set(struct wpa_supplicant *wpa_s,
                                unsigned int type, const u8 *addr,
                                const u8 *mask);
+int wpas_abort_ongoing_scan(struct wpa_supplicant *wpa_s);
 
 #endif /* SCAN_H */
index f2e5a43b978fd0a5ad8447cef7c0bcaa53b89e6a..2a3a728b2033a32ac545e908ad33925af9387118 100644 (file)
@@ -632,6 +632,8 @@ void sme_authenticate(struct wpa_supplicant *wpa_s,
                radio_remove_works(wpa_s, "sme-connect", 0);
        }
 
+       wpas_abort_ongoing_scan(wpa_s);
+
        cwork = os_zalloc(sizeof(*cwork));
        if (cwork == NULL)
                return;
index 920c281338e4689af8c6184737d13d709fb657f8..94b5eff34c58e5da6259dffa206b98cb47d931a0 100644 (file)
@@ -1706,6 +1706,8 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
                return;
        }
 
+       wpas_abort_ongoing_scan(wpa_s);
+
        cwork = os_zalloc(sizeof(*cwork));
        if (cwork == NULL)
                return;