aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/bgscan_learn.c
diff options
context:
space:
mode:
authorYoni Divinsky <yoni.divinsky@ti.com>2012-06-04 14:19:08 +0300
committerArik Nemtsov <arik@wizery.com>2012-07-30 17:48:05 +0300
commit2df6d2659602e258447130d5d3be8c6b9cfdf13e (patch)
treec2d2534ffd5a4ed33e4a302aee3614875447940f /wpa_supplicant/bgscan_learn.c
parentb86faa733083b8c614b6683097d1a0070253be6a (diff)
downloadexternal_wpa_supplicant_8_ti-2df6d2659602e258447130d5d3be8c6b9cfdf13e.zip
external_wpa_supplicant_8_ti-2df6d2659602e258447130d5d3be8c6b9cfdf13e.tar.gz
external_wpa_supplicant_8_ti-2df6d2659602e258447130d5d3be8c6b9cfdf13e.tar.bz2
bgscan_learn: scan all freq only if there are no candidates (INTERNAL)
change to patch 19958a54733009e7ef07dc10d98c8b04fa94b882 The original fix to bgscan_learn performs a scan on all frequencies if bss candidates were not seen on other channels. This patch changes it so that if a candidate bss was seen on the channel of the current AP do not scan all frequencies. Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Diffstat (limited to 'wpa_supplicant/bgscan_learn.c')
-rw-r--r--wpa_supplicant/bgscan_learn.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/wpa_supplicant/bgscan_learn.c b/wpa_supplicant/bgscan_learn.c
index b0368f9..27563e4 100644
--- a/wpa_supplicant/bgscan_learn.c
+++ b/wpa_supplicant/bgscan_learn.c
@@ -271,8 +271,9 @@ static void bgscan_learn_timeout(void *eloop_ctx, void *timeout_ctx)
struct wpa_supplicant *wpa_s = data->wpa_s;
struct wpa_driver_scan_params params;
int *freqs = NULL;
- size_t count, i;
+ size_t count, i, bss_count = 0;
char msg[100], *pos;
+ struct bgscan_learn_bss *bss;
os_memset(&params, 0, sizeof(params));
params.num_ssids = 1;
@@ -282,10 +283,14 @@ static void bgscan_learn_timeout(void *eloop_ctx, void *timeout_ctx)
params.freqs = data->ssid->scan_freq;
else {
freqs = bgscan_learn_get_freqs(data, &count);
- wpa_printf(MSG_DEBUG, "bgscan learn: BSSes in this ESS have "
- "been seen on %u channels", (unsigned int) count);
- if (data->scan_interval == data->short_interval && count < 2) {
+ dl_list_for_each(bss, &data->bss, struct bgscan_learn_bss, list)
+ bss_count++;
+
+ wpa_printf(MSG_DEBUG, "bgscan learn: %d BSSes in this ESS have "
+ "been seen on %u channels", (unsigned int) bss_count, (unsigned int) count);
+
+ if (data->scan_interval == data->short_interval && bss_count < 2) {
os_free(freqs);
freqs = NULL;
wpa_printf(MSG_DEBUG,