Every time we settle for the same AP after a background scan,
a timeout value is increased to avoid repeated background scans
in situations where no better AP is available.
The backoff currently increments in steps of half a second.
This causes very frequent background scans for a few minutes
after association to an AP with a weak signal. If my math is
correct, we reach a backoff interval of one minute only after
120 background scans that found no new AP.
We could easily double or triple this backoff.
With this diff, we back off by one more second each time we end
up settling for the same AP. We could probably backoff even more,
but I'd prefer to try a relatively small change, for now.
Tested with an AP where iwn(4) reports -62dBm and triggers
background scans most of the time.
ok?
Index: ieee80211_input.c
===================================================================
RCS file: /cvs/src/sys/net80211/ieee80211_input.c,v
retrieving revision 1.202
diff -u -p -r1.202 ieee80211_input.c
--- ieee80211_input.c 7 Aug 2018 18:13:14 -0000 1.202
+++ ieee80211_input.c 23 Nov 2018 11:36:42 -0000
@@ -276,7 +276,7 @@ ieee80211_input(struct ifnet *ifp, struc
(ic->ic_flags & IEEE80211_F_BGSCAN) == 0 &&
(ic->ic_flags & IEEE80211_F_DESBSSID) == 0)
timeout_add_msec(&ic->ic_bgscan_timeout,
- 500 * (ic->ic_bgscan_fail + 1));
+ 500 * (2 * (ic->ic_bgscan_fail + 1)));
}
}