Date: Wed, 4 Mar 2009 22:05:25 +0000 (UTC) From: Sam Leffler <sam@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r189377 - head/sys/net80211 Message-ID: <200903042205.n24M5Pav054674@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sam Date: Wed Mar 4 22:05:25 2009 New Revision: 189377 URL: http://svn.freebsd.org/changeset/base/189377 Log: add the desired channel to the scan list if not already present and compatible with other scan controls Modified: head/sys/net80211/ieee80211_scan_sta.c Modified: head/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sta.c Wed Mar 4 21:40:08 2009 (r189376) +++ head/sys/net80211/ieee80211_scan_sta.c Wed Mar 4 22:05:25 2009 (r189377) @@ -476,6 +476,18 @@ checktable(const struct scanlist *scan, 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_stat /* 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903042205.n24M5Pav054674>