diff options
author | sam <sam@FreeBSD.org> | 2005-01-01 17:48:27 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2005-01-01 17:48:27 +0000 |
commit | 8af7e8df05bc258e668bd73349a32a075ce28dc9 (patch) | |
tree | f80c207a87e6f3b9a953fa998ee3ee73f52780ef /sys/net80211 | |
parent | b89a9aca30aaf0ffeb0dd2bf772e7dfbfc396699 (diff) | |
download | FreeBSD-src-8af7e8df05bc258e668bd73349a32a075ce28dc9.zip FreeBSD-src-8af7e8df05bc258e668bd73349a32a075ce28dc9.tar.gz |
Correct scan candidate selection logic for dual-band devices: prefer
candidate on 5Ghz channel to candidate on 2Ghz channel only when the
rssi are comparable (wasn't considering rssi).
Diffstat (limited to 'sys/net80211')
-rw-r--r-- | sys/net80211/ieee80211_node.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 226b413..f6c49bd 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -547,23 +547,23 @@ ieee80211_node_compare(struct ieee80211com *ic, (b->ni_capinfo & IEEE80211_CAPINFO_PRIVACY)) return -1; - /* best/max rate preferred if signal level close enough XXX */ - maxa = maxrate(a); - maxb = maxrate(b); rssia = ic->ic_node_getrssi(a); rssib = ic->ic_node_getrssi(b); - if (maxa != maxb && abs(rssib - rssia) < 5) - return maxa - maxb; - - /* XXX use freq for channel preference */ - /* for now just prefer 5Ghz band to all other bands */ - if (IEEE80211_IS_CHAN_5GHZ(a->ni_chan) && - !IEEE80211_IS_CHAN_5GHZ(b->ni_chan)) - return 1; - if (!IEEE80211_IS_CHAN_5GHZ(a->ni_chan) && - IEEE80211_IS_CHAN_5GHZ(b->ni_chan)) - return -1; - + if (abs(rssib - rssia) < 5) { + /* best/max rate preferred if signal level close enough XXX */ + maxa = maxrate(a); + maxb = maxrate(b); + if (maxa != maxb) + return maxa - maxb; + /* XXX use freq for channel preference */ + /* for now just prefer 5Ghz band to all other bands */ + if (IEEE80211_IS_CHAN_5GHZ(a->ni_chan) && + !IEEE80211_IS_CHAN_5GHZ(b->ni_chan)) + return 1; + if (!IEEE80211_IS_CHAN_5GHZ(a->ni_chan) && + IEEE80211_IS_CHAN_5GHZ(b->ni_chan)) + return -1; + } /* all things being equal, use signal level */ return rssia - rssib; } |