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

Andrew Thompson thompsa at FreeBSD.org
Sat Apr 25 06:20:35 UTC 2009


Author: thompsa
Date: Sat Apr 25 06:20:34 2009
New Revision: 191483
URL: http://svn.freebsd.org/changeset/base/191483

Log:
  Move the software beacon miss handler to the taskqueue so it has a stable view
  of the vap state.

Modified:
  user/thompsa/vaptq/sys/net80211/ieee80211.c
  user/thompsa/vaptq/sys/net80211/ieee80211_proto.c
  user/thompsa/vaptq/sys/net80211/ieee80211_var.h

Modified: user/thompsa/vaptq/sys/net80211/ieee80211.c
==============================================================================
--- user/thompsa/vaptq/sys/net80211/ieee80211.c	Sat Apr 25 05:55:44 2009	(r191482)
+++ user/thompsa/vaptq/sys/net80211/ieee80211.c	Sat Apr 25 06:20:34 2009	(r191483)
@@ -569,6 +569,7 @@ ieee80211_vap_detach(struct ieee80211vap
 	 * NB: must be before ether_ifdetach() and removal from ic_vaps list
 	 */
 	taskqueue_drain(ic->ic_tq, &vap->iv_nstate_task);
+	taskqueue_drain(ic->ic_tq, &vap->iv_swbmiss_task);
 
 	IEEE80211_LOCK(ic);
 	KASSERT(vap->iv_state == IEEE80211_S_INIT , ("vap still running"));

Modified: user/thompsa/vaptq/sys/net80211/ieee80211_proto.c
==============================================================================
--- user/thompsa/vaptq/sys/net80211/ieee80211_proto.c	Sat Apr 25 05:55:44 2009	(r191482)
+++ user/thompsa/vaptq/sys/net80211/ieee80211_proto.c	Sat Apr 25 06:20:34 2009	(r191483)
@@ -97,6 +97,7 @@ const char *ieee80211_wme_acnames[] = {
 };
 
 static void beacon_miss(void *, int);
+static void beacon_swmiss(void *, int);
 static void parent_updown(void *, int);
 static void update_mcast(void *, int);
 static void update_promisc(void *, int);
@@ -188,6 +189,7 @@ ieee80211_proto_vattach(struct ieee80211
 	callout_init(&vap->iv_swbmiss, CALLOUT_MPSAFE);
 	callout_init(&vap->iv_mgtsend, CALLOUT_MPSAFE);
 	TASK_INIT(&vap->iv_nstate_task, 0, ieee80211_newstate_cb, vap);
+	TASK_INIT(&vap->iv_swbmiss_task, 0, beacon_swmiss, vap);
 	/*
 	 * Install default tx rate handling: no fixed rate, lowest
 	 * supported rate for mgmt and multicast frames.  Default
@@ -1389,6 +1391,18 @@ beacon_miss(void *arg, int npending)
 	}
 }
 
+static void
+beacon_swmiss(void *arg, int npending)
+{
+	struct ieee80211vap *vap = arg;
+
+	if (vap->iv_state != IEEE80211_S_RUN)
+		return;
+
+	/* XXX Call multiple times if npending > zero? */
+	vap->iv_bmiss(vap);
+}
+
 /*
  * Software beacon miss handling.  Check if any beacons
  * were received in the last period.  If not post a
@@ -1418,7 +1432,7 @@ ieee80211_swbmiss(void *arg)
 		vap->iv_swbmiss_count = 0;
 	} else if (vap->iv_swbmiss_count == 0) {
 		if (vap->iv_bmiss != NULL)
-			vap->iv_bmiss(vap);
+			taskqueue_enqueue(ic->ic_tq, &vap->iv_swbmiss_task);
 		if (vap->iv_bmiss_count == 0)	/* don't re-arm timer */
 			return;
 	} else

Modified: user/thompsa/vaptq/sys/net80211/ieee80211_var.h
==============================================================================
--- user/thompsa/vaptq/sys/net80211/ieee80211_var.h	Sat Apr 25 05:55:44 2009	(r191482)
+++ user/thompsa/vaptq/sys/net80211/ieee80211_var.h	Sat Apr 25 06:20:34 2009	(r191483)
@@ -325,6 +325,7 @@ struct ieee80211vap {
 	enum ieee80211_state	iv_nstate;	/* pending state */
 	int			iv_nstate_arg;	/* pending state arg */
 	struct task		iv_nstate_task;	/* deferred state processing */
+	struct task		iv_swbmiss_task;/* deferred iv_bmiss call */
 	struct callout		iv_mgtsend;	/* mgmt frame response timer */
 						/* inactivity timer settings */
 	int			iv_inact_init;	/* setting for new station */


More information about the svn-src-user mailing list