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

Andrew Thompson thompsa at FreeBSD.org
Mon Apr 13 22:07:20 PDT 2009


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);


More information about the svn-src-user mailing list