aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-07-07 03:31:10 (GMT)
committerJouni Malinen <j@w1.fi>2010-09-05 14:25:27 (GMT)
commit31eff70a2448dbf7c0130cc7dcbed581c185a708 (patch)
tree5b72bf94d90917aa06fff562f300273b28a6f77a
parentee6d6679a5d2493b229212bd51499eaedcea6890 (diff)
downloadhostap-07-31eff70a2448dbf7c0130cc7dcbed581c185a708.zip
hostap-07-31eff70a2448dbf7c0130cc7dcbed581c185a708.tar.gz
hostap-07-31eff70a2448dbf7c0130cc7dcbed581c185a708.tar.bz2
Remove get-first-scan-results-before-request optimization
This has already been disabled in most use cases and can result in problems with some drivers, so better just remove it completely. (cherry picked from commit 24f7694062f64dc9c549fbe8c348b0262bdb90e6)
-rw-r--r--wpa_supplicant/events.c26
-rw-r--r--wpa_supplicant/scan.c13
-rw-r--r--wpa_supplicant/wpa_supplicant_i.h4
3 files changed, 4 insertions, 39 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index b20c440..6328d78 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -700,15 +700,7 @@ wpa_supplicant_pick_network(struct wpa_supplicant *wpa_s,
static void wpa_supplicant_req_new_scan(struct wpa_supplicant *wpa_s,
int timeout_sec, int timeout_usec)
{
- if (wpa_s->scan_res_tried == 1 && wpa_s->conf->ap_scan == 1) {
- /*
- * Quick recovery if the initial scan results were not
- * complete when fetched before the first scan request.
- */
- wpa_s->scan_res_tried++;
- timeout_sec = 0;
- timeout_usec = 0;
- } else if (!wpa_supplicant_enabled_networks(wpa_s->conf)) {
+ if (!wpa_supplicant_enabled_networks(wpa_s->conf)) {
/*
* No networks are enabled; short-circuit request so
* we don't wait timeout seconds before transitioning
@@ -918,19 +910,9 @@ static void wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
return;
}
- /*
- * Don't post the results if this was the initial cached
- * and there were no results.
- */
- if (wpa_s->scan_res_tried == 1 && wpa_s->conf->ap_scan == 1 &&
- scan_res->num == 0) {
- wpa_msg(wpa_s, MSG_DEBUG, "Cached scan results are "
- "empty - not posting");
- } else {
- wpa_printf(MSG_DEBUG, "New scan results available");
- wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SCAN_RESULTS);
- wpas_notify_scan_results(wpa_s);
- }
+ wpa_printf(MSG_DEBUG, "New scan results available");
+ wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SCAN_RESULTS);
+ wpas_notify_scan_results(wpa_s);
wpas_notify_scan_done(wpa_s, 1);
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 4d9114f..ac7fd89 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -289,19 +289,6 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
wps = wpas_wps_in_use(wpa_s->conf, &req_type);
#endif /* CONFIG_WPS */
- if (wpa_s->scan_res_tried == 0 && wpa_s->conf->ap_scan == 1 &&
- !(wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) &&
- !(wpa_s->drv_flags & WPA_DRIVER_FLAGS_USER_SPACE_MLME) &&
- wps != 2 && !wpa_s->conf->filter_ssids &&
- !wpa_s->connect_without_scan) {
- wpa_s->scan_res_tried++;
- wpa_printf(MSG_DEBUG, "Trying to get current scan results "
- "first without requesting a new scan to speed up "
- "initial association");
- wpa_supplicant_event(wpa_s, EVENT_SCAN_RESULTS, NULL);
- return;
- }
-
scan_req = wpa_s->scan_req;
wpa_s->scan_req = 0;
diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h
index 062eedd..6c36a1a 100644
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
@@ -382,10 +382,6 @@ struct wpa_supplicant {
int scan_req; /* manual scan request; this forces a scan even if there
* are no enabled networks in the configuration */
- int scan_res_tried; /* whether ap_scan=1 mode has tried to fetch scan
- * results without a new scan request; this is used
- * to speed up the first association if the driver
- * has already available scan results. */
int scan_runs; /* number of scan runs since WPS was started */
struct wpa_client_mlme mlme;