bgscan_simple: Refinements to fast-scan backoff
authorPaul Stewart <pstew@chromium.org>
Sun, 5 Feb 2012 16:43:06 +0000 (18:43 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 5 Feb 2012 16:43:06 +0000 (18:43 +0200)
commit87343c2017dd543098d06ced597860bb8a963141
treeb9cf102647f8ec34bc2c288afee285cea3aa1d65
parent0f4668ceac37e2c98ce6068bd255d0915974a706
bgscan_simple: Refinements to fast-scan backoff

These changes account for situations where the CQM threshold
might be approximately the same as the currently received signal,
and thus CQM events are triggered often due to measurement
error/small fluctuations.  This results in scanning occurring
too frequently.

Firstly, inhibit the immediate scan when the short-scan count
is at the maximum.  This keeps bursts of CQM toggling from
causing a torrent of back-to-back scans.  This does not inhibit
immediate scans if the CQM triggers a second time (if the signal
falls lower past the hysteresis).  This reduces the scan rate in
the worst case (fast-rate toggling high/low CQM events) to the
short scan interval.

Secondly, change the behavior of the short scan count so it acts like
a "leaky bucket".  As we perform short-scans, the bucket fills until
it reaches a maximal short-scan count, at which we back-off and
revert to a long scan interval.  The short scan count decreases by
one (emptying the bucket) every time we complete a long scan interval
without a low-RSSI CQM event.

This reduces the impact of medium-rate toggling of high/low CQM
events, reducing the number of short-interval scans that occur before
returning to a long-interval if the system was recently doing
short scans.
wpa_supplicant/bgscan_simple.c