aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Stewart <pstew@google.com>2011-03-31 15:02:37 (GMT)
committerJouni Malinen <j@w1.fi>2011-03-31 15:02:37 (GMT)
commitdb03ddacffb7fadc5949b2fc37cdbd1aac5b3f6d (patch)
tree60e4685240f0002343299637135ea47a72a08764
parent1c5c7273f55d7ce867bd29558dcd0ebef9264ea1 (diff)
downloadhostap-db03ddacffb7fadc5949b2fc37cdbd1aac5b3f6d.zip
hostap-db03ddacffb7fadc5949b2fc37cdbd1aac5b3f6d.tar.gz
hostap-db03ddacffb7fadc5949b2fc37cdbd1aac5b3f6d.tar.bz2
bgscan-simple: Poll for signal in init
It is not guaranteed that we will get a CQM signal shortly after setting up monitoring. In order to establish the correct initial background scanning rate, poll directly for the signal strength. Signed-off-by: Paul Stewart
-rw-r--r--wpa_supplicant/bgscan_simple.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/wpa_supplicant/bgscan_simple.c b/wpa_supplicant/bgscan_simple.c
index 409d9ce..e2692c4 100644
--- a/wpa_supplicant/bgscan_simple.c
+++ b/wpa_supplicant/bgscan_simple.c
@@ -122,6 +122,15 @@ static void * bgscan_simple_init(struct wpa_supplicant *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;
+ }
+ wpa_printf(MSG_DEBUG, "bgscan simple: Init scan interval: %d",
+ data->scan_interval);
eloop_register_timeout(data->scan_interval, 0, bgscan_simple_timeout,
data, NULL);