Remove get-first-scan-results-before-request optimization
authorJouni Malinen <jouni.malinen@atheros.com>
Wed, 7 Jul 2010 03:31:10 +0000 (20:31 -0700)
committerJouni Malinen <j@w1.fi>
Sun, 18 Jul 2010 23:11:03 +0000 (16:11 -0700)
This has already been disabled in most use cases and can result
in problems with some drivers, so better just remove it completely.

wpa_supplicant/events.c
wpa_supplicant/scan.c
wpa_supplicant/wpa_supplicant_i.h

index 55da6f5..40e1200 100644 (file)
@@ -705,15 +705,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
@@ -923,19 +915,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);
 
index 54d86fc..513b8ef 100644 (file)
@@ -294,19 +294,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;
 
index 062eedd..6c36a1a 100644 (file)
@@ -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;