]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Reduce scan wait time during WPS processing
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 28 Nov 2013 10:56:21 +0000 (12:56 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 26 Dec 2013 18:50:28 +0000 (20:50 +0200)
Since the AP is expected to be available, there is no need to wait for
the full five second wait between scans during WPS connection. This
speeds up cases where the first scan misses the AP for some reason.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

wpa_supplicant/events.c
wpa_supplicant/scan.c

index 062c696d05d2d88b0914447362fb3dd0d22b7302..ae05a37e390868541dc6cb2410cdd8767fe32505 100644 (file)
@@ -1395,6 +1395,16 @@ static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s,
                                return 1;
                        }
 #endif /* CONFIG_INTERWORKING */
+#ifdef CONFIG_WPS
+                       if (wpa_s->after_wps > 0) {
+                               wpa_dbg(wpa_s, MSG_DEBUG, "Use shorter wait during WPS processing");
+                               timeout_sec = 0;
+                               timeout_usec = 500000;
+                               wpa_supplicant_req_new_scan(wpa_s, timeout_sec,
+                                                           timeout_usec);
+                               return 0;
+                       }
+#endif /* CONFIG_WPS */
                        if (wpa_supplicant_req_sched_scan(wpa_s))
                                wpa_supplicant_req_new_scan(wpa_s, timeout_sec,
                                                            timeout_usec);
index 899d2a99a6230e64676727518e31ea2d6ecabf70..372685718d85c0c6d0f3a48f56ff3f076d492e49 100644 (file)
@@ -299,7 +299,8 @@ static void wpa_supplicant_optimize_freqs(
                if (params->freqs)
                        params->freqs[0] = wpa_s->wps_freq;
                wpa_s->after_wps--;
-       }
+       } else if (wpa_s->after_wps)
+               wpa_s->after_wps--;
 
        if (params->freqs == NULL && wpa_s->known_wps_freq && wpa_s->wps_freq)
        {