aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/bgscan_learn.c
diff options
context:
space:
mode:
authorEyal Shapira <eyal@wizery.com>2013-12-19 10:03:30 (GMT)
committerJouni Malinen <j@w1.fi>2013-12-24 04:54:24 (GMT)
commitf4c73ae6408a4a6b385cb56be10106dfed21bb3f (patch)
tree3ce422cae78abe35277f276d081e9237cedcea47 /wpa_supplicant/bgscan_learn.c
parent625188e5bf7ab132981b89735b477f3441690f2d (diff)
downloadhostap-f4c73ae6408a4a6b385cb56be10106dfed21bb3f.zip
hostap-f4c73ae6408a4a6b385cb56be10106dfed21bb3f.tar.gz
hostap-f4c73ae6408a4a6b385cb56be10106dfed21bb3f.tar.bz2
bgscan_learn: Fix initial interval
In case the initial signal level of the associated BSS was above the given threshold, bgscan_learn module would begin using the short_interval but never switch to the long_interval as there would be no signal change event. Make the init code poll for the current signal level and set scan_interval accordingly. This logic exists in bgscan_simple but was missing in bgscan_learn. Signed-hostap: Eyal Shapira <eyal@wizery.com>
Diffstat (limited to 'wpa_supplicant/bgscan_learn.c')
-rw-r--r--wpa_supplicant/bgscan_learn.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/wpa_supplicant/bgscan_learn.c b/wpa_supplicant/bgscan_learn.c
index 92ec55c..6fd81c2 100644
--- a/wpa_supplicant/bgscan_learn.c
+++ b/wpa_supplicant/bgscan_learn.c
@@ -422,6 +422,14 @@ static void * bgscan_learn_init(struct wpa_supplicant *wpa_s,
data->supp_freqs = bgscan_learn_get_supp_freqs(wpa_s);
data->scan_interval = data->short_interval;
+ if (data->signal_threshold) {
+ /* Poll for signal info to set initial scan interval */
+ struct wpa_signal_info siginfo;
+ if (wpa_drv_signal_poll(wpa_s, &siginfo) == 0 &&
+ siginfo.current_signal >= data->signal_threshold)
+ data->scan_interval = data->long_interval;
+ }
+
eloop_register_timeout(data->scan_interval, 0, bgscan_learn_timeout,
data, NULL);