From owner-svn-src-user@FreeBSD.ORG Tue Apr 14 05:07:20 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 112931065678; Tue, 14 Apr 2009 05:07:20 +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 43F518FC08; Tue, 14 Apr 2009 05:07:18 +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 n3E57Il4095062; Tue, 14 Apr 2009 05:07:18 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3E57IZ9095061; Tue, 14 Apr 2009 05:07:18 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904140507.n3E57IZ9095061@svn.freebsd.org> From: Andrew Thompson Date: Tue, 14 Apr 2009 05:07:18 +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: r191044 - 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: Tue, 14 Apr 2009 05:07:20 -0000 Author: thompsa Date: Tue Apr 14 05:07:17 2009 New Revision: 191044 URL: http://svn.freebsd.org/changeset/base/191044 Log: Drain the state task before removing the vap from the tailq, this should make driver teardown safe. Modified: user/thompsa/vaptq/sys/net80211/ieee80211.c Modified: user/thompsa/vaptq/sys/net80211/ieee80211.c ============================================================================== --- user/thompsa/vaptq/sys/net80211/ieee80211.c Tue Apr 14 04:59:57 2009 (r191043) +++ user/thompsa/vaptq/sys/net80211/ieee80211.c Tue Apr 14 05:07:17 2009 (r191044) @@ -562,7 +562,16 @@ ieee80211_vap_detach(struct ieee80211vap * while we cleanup internal state but that is hard. */ ieee80211_stop_locked(vap); + IEEE80211_UNLOCK(ic); + + /* + * Flush any deferred vap tasks. + * NB: must be before ether_ifdetach() and removal from ic_vaps list + */ + taskqueue_drain(ic->ic_tq, &vap->iv_nstate_task); + IEEE80211_LOCK(ic); + KASSERT(vap->iv_state == IEEE80211_S_INIT , ("vap still running")); TAILQ_REMOVE(&ic->ic_vaps, vap, iv_next); ieee80211_syncflag_locked(ic, IEEE80211_F_WME); #ifdef IEEE80211_SUPPORT_SUPERG @@ -576,12 +585,6 @@ ieee80211_vap_detach(struct ieee80211vap ieee80211_syncifflag_locked(ic, IFF_ALLMULTI); IEEE80211_UNLOCK(ic); - /* - * Flush any deferred vap tasks. - * NB: must be before ether_ifdetach(); - */ - taskqueue_drain(ic->ic_tq, &vap->iv_nstate_task); - /* XXX can't hold com lock */ /* NB: bpfattach is called by ether_ifdetach and claims all taps */ ether_ifdetach(ifp);