svn commit: r189377 - head/sys/net80211

Sam Leffler sam at FreeBSD.org
Wed Mar 4 14:05:26 PST 2009


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


More information about the svn-src-head mailing list