From owner-svn-src-user@FreeBSD.ORG Fri May 1 19:05:08 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25CA9106566B; Fri, 1 May 2009 19:05:08 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE8478FC12; Fri, 1 May 2009 19:05:07 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n41J57GY050904; Fri, 1 May 2009 19:05:07 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n41J57DZ050903; Fri, 1 May 2009 19:05:07 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200905011905.n41J57DZ050903@svn.freebsd.org> From: Andrew Thompson Date: Fri, 1 May 2009 19:05:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r191728 - user/thompsa/vaptq/sys/net80211 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 May 2009 19:05:08 -0000 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) {