On 2016/08/15 14:46, Stefan Sperling wrote: > The wireless stack usually runs its scanning loop once per frequency band. > It begins with 5GHz so that APs on this band are preferred. Within a band, > an AP with the best RSSI (receive signal strength indicator) is chosen, > after matching all other desired parameters such as the ESSID etc.
I find that iwn(4) almost always prefers 2GHz - before I did the csa tests it was sitting on chan 6 AP (-45dBm), there's another one visible on chan 104 (-53dBm). > I am not sure what the rationale was at the time this code was written > but today there is a good reason to prefer 5GHz. This band is usually > much less crowded and gives a much better experience as a result. > Because 5GHz is scanned first we'll usually prefer this band. > > However, iwm(4) runs a scan across all bands at once so we pick an AP based > on RSSI alone. In practice, we often end up choosing 2GHz APs instead of > 5GHz APs, even in cases where 5GHz would work fine, just with a slightly > lower RSSI. > > With this diff we prefer 5GHz APs with "good enough" RSSI over 2GHz APs. It makes sense to me, but I don't have an IEEE80211_C_SCANALLBAND adapter to test with.