svn commit: r191728 - user/thompsa/vaptq/sys/net80211
Andrew Thompson
thompsa at FreeBSD.org
Fri May 1 19:05:08 UTC 2009
Author: thompsa
Date: Fri May 1 19:05:07 2009
New Revision: 191728
URL: http://svn.freebsd.org/changeset/base/191728
Log:
Add a comment to note that the vap list traversal is safe from the taskqeueue.
Suggested by: sam
Modified:
user/thompsa/vaptq/sys/net80211/ieee80211_proto.c
Modified: user/thompsa/vaptq/sys/net80211/ieee80211_proto.c
==============================================================================
--- user/thompsa/vaptq/sys/net80211/ieee80211_proto.c Fri May 1 17:50:40 2009 (r191727)
+++ user/thompsa/vaptq/sys/net80211/ieee80211_proto.c Fri May 1 19:05:07 2009 (r191728)
@@ -1527,17 +1527,21 @@ ieee80211_cac_completeswitch(struct ieee
* and mark them as waiting for a scan to complete. These vaps
* will be brought up when the scan completes and the scanning vap
* reaches RUN state by wakeupwaiting.
- * This is called from the state taskqueue.
*/
static void
markwaiting(struct ieee80211vap *vap0)
{
struct ieee80211com *ic = vap0->iv_ic;
- struct ieee80211vap *vap, *next;
+ struct ieee80211vap *vap;
IEEE80211_LOCK_ASSERT(ic);
- TAILQ_FOREACH_SAFE(vap, &ic->ic_vaps, iv_next, next) {
+ /*
+ * A vap list entry can not disappear since we are running on the
+ * taskqueue and a vap destroy will queue and drain another state
+ * change task.
+ */
+ TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
if (vap == vap0)
continue;
if (vap->iv_state != IEEE80211_S_INIT) {
@@ -1552,17 +1556,21 @@ markwaiting(struct ieee80211vap *vap0)
* Wakeup all vap's waiting for a scan to complete. This is the
* companion to markwaiting (above) and is used to coordinate
* multiple vaps scanning.
- * This is called from the state taskqueue.
*/
static void
wakeupwaiting(struct ieee80211vap *vap0)
{
struct ieee80211com *ic = vap0->iv_ic;
- struct ieee80211vap *vap, *next;
+ struct ieee80211vap *vap;
IEEE80211_LOCK_ASSERT(ic);
- TAILQ_FOREACH_SAFE(vap, &ic->ic_vaps, iv_next, next) {
+ /*
+ * A vap list entry can not disappear since we are running on the
+ * taskqueue and a vap destroy will queue and drain another state
+ * change task.
+ */
+ TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
if (vap == vap0)
continue;
if (vap->iv_flags_ext & IEEE80211_FEXT_SCANWAIT) {
More information about the svn-src-user
mailing list