]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
bgscan_learn: Fix initial interval
authorEyal Shapira <eyal@wizery.com>
Thu, 19 Dec 2013 10:03:30 +0000 (12:03 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 24 Dec 2013 04:54:24 +0000 (06:54 +0200)
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>

wpa_supplicant/bgscan_learn.c

index 92ec55c6d5c2f787a60d443c8ec316106aa64c40..6fd81c282cf124a99cf368d92b3364a9560967f5 100644 (file)
@@ -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);