aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorPaul Stewart <pstew@chromium.org>2013-02-03 19:08:31 (GMT)
committerJouni Malinen <j@w1.fi>2013-02-03 19:08:31 (GMT)
commitcecdddc18419048dfe30866eb02c305c752a39c2 (patch)
treed00db1a085ab09c67992ffdaab9e3955024d018f /wpa_supplicant/events.c
parent9e737f08d41ab089b0737d3c002a62c4175be241 (diff)
downloadhostap-cecdddc18419048dfe30866eb02c305c752a39c2.zip
hostap-cecdddc18419048dfe30866eb02c305c752a39c2.tar.gz
hostap-cecdddc18419048dfe30866eb02c305c752a39c2.tar.bz2
wpa_supplicant: Implement fast-associate on SelectNetwork
If scan results are available when we perform a SelectNetwork, use them to make an associate decision. This can save an entire scan interval-worth of time in situations where something external to wpa_supplicant (like a connection manager) has just previously requested a scan before calling SelectNetwork. Signed-hostap: Paul Stewart <pstew@chromium.org>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 7fe9c7f..47e7eb8 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1308,6 +1308,26 @@ static void wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
#endif /* CONFIG_NO_SCAN_PROCESSING */
+int wpa_supplicant_fast_associate(struct wpa_supplicant *wpa_s)
+{
+#ifdef CONFIG_NO_SCAN_PROCESSING
+ return -1;
+#else /* CONFIG_NO_SCAN_PROCESSING */
+ struct os_time now;
+
+ if (wpa_s->last_scan_res_used <= 0)
+ return -1;
+
+ os_get_time(&now);
+ if (now.sec - wpa_s->last_scan.sec > 5) {
+ wpa_printf(MSG_DEBUG, "Fast associate: Old scan results");
+ return -1;
+ }
+
+ return wpas_select_network_from_last_scan(wpa_s);
+#endif /* CONFIG_NO_SCAN_PROCESSING */
+}
+
#ifdef CONFIG_WNM
static void wnm_bss_keep_alive(void *eloop_ctx, void *sock_ctx)