X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/56d7991b6076e383dd3a87947ad7bf789b0536a7..759aaf7754a638b3f94a267c9feb888c74181340:/package/wpa_supplicant/patches/130-scanning.patch?ds=sidebyside diff --git a/package/wpa_supplicant/patches/130-scanning.patch b/package/wpa_supplicant/patches/130-scanning.patch index 4b3dc970f..1f8cb4597 100644 --- a/package/wpa_supplicant/patches/130-scanning.patch +++ b/package/wpa_supplicant/patches/130-scanning.patch @@ -1,10 +1,8 @@ Add a scan result cache to improve roaming speed if the driver gave us a background scan before losing the connection. -Index: wpa_supplicant-0.6.3/wpa_supplicant/config.h -=================================================================== ---- wpa_supplicant-0.6.3.orig/wpa_supplicant/config.h 2008-02-23 03:45:24.000000000 +0100 -+++ wpa_supplicant-0.6.3/wpa_supplicant/config.h 2008-07-10 15:08:21.000000000 +0200 -@@ -97,6 +97,12 @@ +--- a/wpa_supplicant/config.h ++++ b/wpa_supplicant/config.h +@@ -97,6 +97,12 @@ struct wpa_config { int ap_scan; /** @@ -17,11 +15,9 @@ Index: wpa_supplicant-0.6.3/wpa_supplicant/config.h * ctrl_interface - Parameters for the control interface * * If this is specified, %wpa_supplicant will open a control interface -Index: wpa_supplicant-0.6.3/wpa_supplicant/config_file.c -=================================================================== ---- wpa_supplicant-0.6.3.orig/wpa_supplicant/config_file.c 2008-02-23 03:45:24.000000000 +0100 -+++ wpa_supplicant-0.6.3/wpa_supplicant/config_file.c 2008-07-10 15:59:38.000000000 +0200 -@@ -312,6 +312,13 @@ +--- a/wpa_supplicant/config_file.c ++++ b/wpa_supplicant/config_file.c +@@ -306,6 +306,13 @@ static int wpa_config_parse_int(const st return 0; } @@ -33,19 +29,17 @@ Index: wpa_supplicant-0.6.3/wpa_supplicant/config_file.c +} + - static int wpa_config_process_fast_reauth(struct wpa_config *config, char *pos) - { -@@ -445,6 +452,9 @@ - if (os_strncmp(pos, "ap_scan=", 8) == 0) - return wpa_config_process_ap_scan(config, pos + 8); - -+ if (os_strncmp(pos, "scan_cache=", 11) == 0) -+ return wpa_config_process_scan_cache(config, pos + 11); -+ - if (os_strncmp(pos, "fast_reauth=", 12) == 0) - return wpa_config_process_fast_reauth(config, pos + 12); - -@@ -810,6 +820,8 @@ + static int wpa_config_parse_str(const struct global_parse_data *data, + struct wpa_config *config, int line, +@@ -433,6 +440,7 @@ static const struct global_parse_data gl + #endif /* CONFIG_CTRL_IFACE */ + { INT_RANGE(eapol_version, 1, 2) }, + { INT(ap_scan) }, ++ { INT(scan_cache) }, + { INT(fast_reauth) }, + #ifdef EAP_TLS_OPENSSL + { STR(opensc_engine_path) }, +@@ -834,6 +842,8 @@ static void wpa_config_write_global(FILE fprintf(f, "eapol_version=%d\n", config->eapol_version); if (config->ap_scan != DEFAULT_AP_SCAN) fprintf(f, "ap_scan=%d\n", config->ap_scan); @@ -54,12 +48,10 @@ Index: wpa_supplicant-0.6.3/wpa_supplicant/config_file.c if (config->fast_reauth != DEFAULT_FAST_REAUTH) fprintf(f, "fast_reauth=%d\n", config->fast_reauth); #ifdef EAP_TLS_OPENSSL -Index: wpa_supplicant-0.6.3/wpa_supplicant/events.c -=================================================================== ---- wpa_supplicant-0.6.3.orig/wpa_supplicant/events.c 2008-07-10 13:27:03.000000000 +0200 -+++ wpa_supplicant-0.6.3/wpa_supplicant/events.c 2008-07-10 17:18:53.000000000 +0200 -@@ -555,6 +555,9 @@ - if (wpa_s->conf->ap_scan == 2 || wpa_s->disconnected) +--- a/wpa_supplicant/events.c ++++ b/wpa_supplicant/events.c +@@ -633,6 +633,9 @@ static void wpa_supplicant_event_scan_re + wpa_s->disconnected) return; + if (wpa_s->wpa_state > WPA_ASSOCIATED) @@ -68,12 +60,20 @@ Index: wpa_supplicant-0.6.3/wpa_supplicant/events.c while (selected == NULL) { for (prio = 0; prio < wpa_s->conf->num_prio; prio++) { selected = wpa_supplicant_select_bss( -@@ -594,13 +597,16 @@ +@@ -645,6 +648,7 @@ static void wpa_supplicant_event_scan_re + wpa_printf(MSG_DEBUG, "No APs found - clear blacklist " + "and try again"); + wpa_blacklist_clear(wpa_s); ++ memset(&wpa_s->last_scan_results, 0, sizeof(wpa_s->last_scan_results)); + } else if (selected == NULL) { + break; + } +@@ -679,10 +683,12 @@ static void wpa_supplicant_event_scan_re rsn_preauth_scan_results(wpa_s->wpa, wpa_s->scan_res); } else { wpa_printf(MSG_DEBUG, "No suitable AP found."); - timeout = 5; -+ timeout = 1; ++ timeout = 0; goto req_scan; } @@ -82,11 +82,7 @@ Index: wpa_supplicant-0.6.3/wpa_supplicant/events.c return; req_scan: -+ memset(&wpa_s->last_scan_results, 0, sizeof(wpa_s->last_scan_results)); - if (wpa_s->scan_res_tried == 1 && wpa_s->conf->ap_scan == 1) { - /* - * Quick recovery if the initial scan results were not -@@ -804,6 +810,9 @@ +@@ -886,6 +892,9 @@ static void wpa_supplicant_event_disasso } if (wpa_s->wpa_state >= WPA_ASSOCIATED) wpa_supplicant_req_scan(wpa_s, 0, 100000); @@ -94,21 +90,19 @@ Index: wpa_supplicant-0.6.3/wpa_supplicant/events.c + wpa_supplicant_req_auth_timeout(wpa_s, 0, 100000); + bssid = wpa_s->bssid; - if (os_memcmp(bssid, "\x00\x00\x00\x00\x00\x00", ETH_ALEN) == 0) + if (is_zero_ether_addr(bssid)) bssid = wpa_s->pending_bssid; -Index: wpa_supplicant-0.6.3/wpa_supplicant/wpa_supplicant_i.h -=================================================================== ---- wpa_supplicant-0.6.3.orig/wpa_supplicant/wpa_supplicant_i.h 2008-07-10 15:03:56.000000000 +0200 -+++ wpa_supplicant-0.6.3/wpa_supplicant/wpa_supplicant_i.h 2008-07-10 15:16:17.000000000 +0200 -@@ -334,6 +334,7 @@ +--- a/wpa_supplicant/wpa_supplicant_i.h ++++ b/wpa_supplicant/wpa_supplicant_i.h +@@ -349,6 +349,7 @@ struct wpa_supplicant { struct wpa_client_mlme mlme; int use_client_mlme; int driver_4way_handshake; + struct os_time last_scan_results; - }; - -@@ -381,6 +382,7 @@ + int pending_mic_error_report; + int pending_mic_error_pairwise; +@@ -402,6 +403,7 @@ int wpa_supplicant_scard_init(struct wpa /* scan.c */ void wpa_supplicant_req_scan(struct wpa_supplicant *wpa_s, int sec, int usec); @@ -116,11 +110,9 @@ Index: wpa_supplicant-0.6.3/wpa_supplicant/wpa_supplicant_i.h void wpa_supplicant_cancel_scan(struct wpa_supplicant *wpa_s); /* events.c */ -Index: wpa_supplicant-0.6.3/wpa_supplicant/scan.c -=================================================================== ---- wpa_supplicant-0.6.3.orig/wpa_supplicant/scan.c 2008-07-10 13:27:03.000000000 +0200 -+++ wpa_supplicant-0.6.3/wpa_supplicant/scan.c 2008-07-10 16:24:31.000000000 +0200 -@@ -40,6 +40,18 @@ +--- a/wpa_supplicant/scan.c ++++ b/wpa_supplicant/scan.c +@@ -40,6 +40,18 @@ static void wpa_supplicant_gen_assoc_eve wpa_supplicant_event(wpa_s, EVENT_ASSOC, &data); } @@ -137,25 +129,23 @@ Index: wpa_supplicant-0.6.3/wpa_supplicant/scan.c + return 1; +} - static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx) - { -@@ -150,8 +162,9 @@ - } else - wpa_s->prev_scan_ssid = BROADCAST_SSID_SCAN; + #ifdef CONFIG_WPS + static int wpas_wps_in_use(struct wpa_config *conf, +@@ -183,8 +195,9 @@ static void wpa_supplicant_scan(void *el + 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->use_client_mlme) { +- !wpa_s->use_client_mlme && wps != 2) { + if (!wpa_supplicant_may_scan(wpa_s) || -+ (wpa_s->scan_res_tried == 0 && wpa_s->conf->ap_scan == 1 && -+ !wpa_s->use_client_mlme)) { ++ (wpa_s->scan_res_tried == 0 && wpa_s->conf->ap_scan == 1 && ++ !wpa_s->use_client_mlme && wps != 2)) { wpa_s->scan_res_tried++; + wpa_s->scan_req = scan_req; wpa_printf(MSG_DEBUG, "Trying to get current scan results " - "first without requesting a new scan to speed up " -Index: wpa_supplicant-0.6.3/wpa_supplicant/wpa_supplicant.c -=================================================================== ---- wpa_supplicant-0.6.3.orig/wpa_supplicant/wpa_supplicant.c 2008-07-10 14:41:16.000000000 +0200 -+++ wpa_supplicant-0.6.3/wpa_supplicant/wpa_supplicant.c 2008-07-10 18:45:59.000000000 +0200 -@@ -1417,6 +1417,9 @@ +--- a/wpa_supplicant/wpa_supplicant.c ++++ b/wpa_supplicant/wpa_supplicant.c +@@ -1491,6 +1491,9 @@ void wpa_supplicant_rx_eapol(void *ctx, { struct wpa_supplicant *wpa_s = ctx;