aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/bgscan_learn.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-12-16 20:08:32 (GMT)
committerJouni Malinen <j@w1.fi>2013-12-24 05:34:43 (GMT)
commite72a001b0f15b039d3ce21e9781f8236a21bbf06 (patch)
tree9d93306b9d51f5d05afbe24836dfae52761ee672 /wpa_supplicant/bgscan_learn.c
parente05f0605bfa70314c26720d3fb5ea17bbb16eb00 (diff)
downloadhostap-e72a001b0f15b039d3ce21e9781f8236a21bbf06.zip
hostap-e72a001b0f15b039d3ce21e9781f8236a21bbf06.tar.gz
hostap-e72a001b0f15b039d3ce21e9781f8236a21bbf06.tar.bz2
bgscan: Use monotonic time
The bgscan simple and learn algorithms should run regardless of wall clock time jumps, so make them use monotonic time. Signed-hostap: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'wpa_supplicant/bgscan_learn.c')
-rw-r--r--wpa_supplicant/bgscan_learn.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/wpa_supplicant/bgscan_learn.c b/wpa_supplicant/bgscan_learn.c
index fa0475d..6a92b73 100644
--- a/wpa_supplicant/bgscan_learn.c
+++ b/wpa_supplicant/bgscan_learn.c
@@ -34,7 +34,7 @@ struct bgscan_learn_data {
int signal_threshold;
int short_interval; /* use if signal < threshold */
int long_interval; /* use if signal > threshold */
- struct os_time last_bgscan;
+ struct os_reltime last_bgscan;
char *fname;
struct dl_list bss;
int *supp_freqs;
@@ -310,7 +310,7 @@ static void bgscan_learn_timeout(void *eloop_ctx, void *timeout_ctx)
eloop_register_timeout(data->scan_interval, 0,
bgscan_learn_timeout, data, NULL);
} else
- os_get_time(&data->last_bgscan);
+ os_get_reltime(&data->last_bgscan);
os_free(freqs);
}
@@ -438,7 +438,7 @@ static void * bgscan_learn_init(struct wpa_supplicant *wpa_s,
* us skip an immediate new scan in cases where the current signal
* level is below the bgscan threshold.
*/
- os_get_time(&data->last_bgscan);
+ os_get_reltime(&data->last_bgscan);
return data;
}
@@ -565,7 +565,7 @@ static void bgscan_learn_notify_signal_change(void *priv, int above,
{
struct bgscan_learn_data *data = priv;
int scan = 0;
- struct os_time now;
+ struct os_reltime now;
if (data->short_interval == data->long_interval ||
data->signal_threshold == 0)
@@ -579,7 +579,7 @@ static void bgscan_learn_notify_signal_change(void *priv, int above,
wpa_printf(MSG_DEBUG, "bgscan learn: Start using short bgscan "
"interval");
data->scan_interval = data->short_interval;
- os_get_time(&now);
+ os_get_reltime(&now);
if (now.sec > data->last_bgscan.sec + 1)
scan = 1;
} else if (data->scan_interval == data->short_interval && above) {
@@ -594,7 +594,7 @@ static void bgscan_learn_notify_signal_change(void *priv, int above,
* Signal dropped further 4 dB. Request a new scan if we have
* not yet scanned in a while.
*/
- os_get_time(&now);
+ os_get_reltime(&now);
if (now.sec > data->last_bgscan.sec + 10)
scan = 1;
}