diff options
author | sam <sam@FreeBSD.org> | 2009-03-04 22:05:25 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2009-03-04 22:05:25 +0000 |
commit | 9b33d4c5ea611216fa994fd6fe1fe15325c01a10 (patch) | |
tree | 003a4f8d3315b59217db378ffeb40ee54c87a0bc /sys/net80211/ieee80211_scan_sta.c | |
parent | 08472642cd586632445cbbb114426bd6f29912f6 (diff) | |
download | FreeBSD-src-9b33d4c5ea611216fa994fd6fe1fe15325c01a10.zip FreeBSD-src-9b33d4c5ea611216fa994fd6fe1fe15325c01a10.tar.gz |
add the desired channel to the scan list if not already present and
compatible with other scan controls
Diffstat (limited to 'sys/net80211/ieee80211_scan_sta.c')
-rw-r--r-- | sys/net80211/ieee80211_scan_sta.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sys/net80211/ieee80211_scan_sta.c b/sys/net80211/ieee80211_scan_sta.c index 9dde2ce..bc99817 100644 --- a/sys/net80211/ieee80211_scan_sta.c +++ b/sys/net80211/ieee80211_scan_sta.c @@ -476,6 +476,18 @@ checktable(const struct scanlist *scan, const struct ieee80211_channel *c) return 0; } +static int +onscanlist(const struct ieee80211_scan_state *ss, + const struct ieee80211_channel *c) +{ + int i; + + for (i = 0; i < ss->ss_last; i++) + if (ss->ss_chans[i] == c) + return 1; + return 0; +} + static void sweepchannels(struct ieee80211_scan_state *ss, struct ieee80211vap *vap, const struct scanlist table[]) @@ -524,6 +536,21 @@ sweepchannels(struct ieee80211_scan_state *ss, struct ieee80211vap *vap, /* Add channel to scanning list. */ ss->ss_chans[ss->ss_last++] = c; } + /* + * Explicitly add any desired channel if: + * - not already on the scan list + * - allowed by any desired mode constraint + * - there is space in the scan list + * This allows the channel to be used when the filtering + * mechanisms would otherwise elide it (e.g HT, turbo). + */ + c = vap->iv_des_chan; + if (c != IEEE80211_CHAN_ANYC && + !onscanlist(ss, c) && + (vap->iv_des_mode == IEEE80211_MODE_AUTO || + vap->iv_des_mode == ieee80211_chan2mode(c)) && + ss->ss_last < IEEE80211_SCAN_MAX) + ss->ss_chans[ss->ss_last++] = c; } static void |