svn commit: r191426 - user/thompsa/vaptq/sys/net80211

Andrew Thompson thompsa at FreeBSD.org
Thu Apr 23 17:19:00 UTC 2009


Author: thompsa
Date: Thu Apr 23 17:18:59 2009
New Revision: 191426
URL: http://svn.freebsd.org/changeset/base/191426

Log:
  Eliminate an unlock for the channel change and add more comments around the
  driver callbacks.

Modified:
  user/thompsa/vaptq/sys/net80211/ieee80211_scan.c

Modified: user/thompsa/vaptq/sys/net80211/ieee80211_scan.c
==============================================================================
--- user/thompsa/vaptq/sys/net80211/ieee80211_scan.c	Thu Apr 23 16:56:26 2009	(r191425)
+++ user/thompsa/vaptq/sys/net80211/ieee80211_scan.c	Thu Apr 23 17:18:59 2009	(r191426)
@@ -302,17 +302,6 @@ scan_update_locked(struct ieee80211vap *
 	}
 }
 
-static void
-change_channel(struct ieee80211com *ic,
-	struct ieee80211_channel *chan)
-{
-	ic->ic_curchan = chan;
-	ic->ic_rt = ieee80211_get_ratetable(chan);
-	IEEE80211_UNLOCK(ic);
-	ic->ic_set_channel(ic);
-	IEEE80211_LOCK(ic);
-}
-
 static char
 channel_type(const struct ieee80211_channel *c)
 {
@@ -921,7 +910,15 @@ scan_task(void *arg, int pending)
 		/*
 		 * Potentially change channel and phy mode.
 		 */
-		change_channel(ic, chan);
+		ic->ic_curchan = chan;
+		ic->ic_rt = ieee80211_get_ratetable(chan);
+		IEEE80211_UNLOCK(ic);
+		/*
+		 * Perform the channel change and scan unlocked so the driver
+		 * may sleep. Once set_channel returns the hardware has
+		 * completed the channel change.
+		 */
+		ic->ic_set_channel(ic);
 
 		/*
 		 * Scan curchan.  Drivers for "intelligent hardware"
@@ -929,8 +926,12 @@ scan_task(void *arg, int pending)
 		 * the work.  Otherwise we manage the work outselves;
 		 * sending a probe request (as needed), and arming the
 		 * timeout to switch channels after maxdwell ticks.
+		 *
+		 * scan_curchan should only pause for the time required to
+		 * prepare/initiate the hardware for the scan (if at all), the
+		 * below condvar is used to sleep for the channels dwell time
+		 * and allows it to be signalled for abort.
 		 */
-		IEEE80211_UNLOCK(ic);
 		ic->ic_scan_curchan(ss, maxdwell);
 		IEEE80211_LOCK(ic);
 


More information about the svn-src-user mailing list