[PATCH] bgscan_learn: Update the initial value of time interval for scan

Jouni Malinen j
Tue Mar 15 06:45:05 PDT 2011

On Sun, Mar 06, 2011 at 12:18:44PM +0200, Gery Kahn wrote:
> Set initial value of time interval for scan according to current
> bss signal level.
> The current value set to short time interval. In case current bss signal
> level is higher than configured threshold, than there is no event to notify
> signal change and the scanning will happened too often.

This may be a bit problematic since I'm not sure whether drivers in
general would guarantee the signal level in scan results to be matching
with the one used for signal quality events. Use of the shorter interval
here is done on purpose to be safer.

> +	struct wpa_bss *current_bss = wpa_s->current_bss;

> +	if (data->signal_threshold < current_bss->level)
> +		data->scan_interval = data->long_interval;
> +	else
> +		data->scan_interval = data->short_interval;

Are you sure wpa_s->current_bss != NULL here? I think it should be the
case, but I have not verified whether there could be a code path that
gets here without that being the case (e.g., with ap_scan=2).

Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list