Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Feb 2008 00:35:08 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 135690 for review
Message-ID:  <200802190035.m1J0Z868008182@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=135690

Change 135690 by sam@sam_ebb on 2008/02/19 00:34:40

	Change beacon miss handling to dispatch the event only to
	sta vap's in RUN state instead of checking in the handler.

Affected files ...

.. //depot/projects/vap/sys/net80211/ieee80211_proto.c#21 edit
.. //depot/projects/vap/sys/net80211/ieee80211_sta.c#5 edit

Differences ...

==== //depot/projects/vap/sys/net80211/ieee80211_proto.c#21 (text+ko) ====

@@ -1276,13 +1276,21 @@
 void
 ieee80211_beacon_miss(struct ieee80211com *ic)
 {
-	if ((ic->ic_flags & IEEE80211_F_SCAN) == 0) {
-		struct ieee80211vap *vap;
+	struct ieee80211vap *vap;
 
-		/* XXX locking */
-		TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next)
-			if (vap->iv_bmiss != NULL)
-				vap->iv_bmiss(vap);
+	if (ic->ic_flags & IEEE80211_F_SCAN)
+		return;
+	/* XXX locking */
+	TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
+		/*
+		 * We only pass events through for sta vap's in RUN state;
+		 * may be too restrictive but for now this saves all the
+		 * handlers duplicating these checks.
+		 */
+		if (vap->iv_opmode == IEEE80211_M_STA &&
+		    vap->iv_state == IEEE80211_S_RUN &&
+		    vap->iv_bmiss != NULL)
+			vap->iv_bmiss(vap);
 	}
 }
 

==== //depot/projects/vap/sys/net80211/ieee80211_sta.c#5 (text+ko) ====

@@ -94,26 +94,24 @@
 	vap->iv_bmiss = sta_beacon_miss;
 }
 
+/*
+ * Handle a beacon miss event.  The common code filters out
+ * spurious events that can happen when scanning and/or before
+ * reaching RUN state.
+ */
 static void
 sta_beacon_miss(struct ieee80211vap *vap)
 {
 	struct ieee80211com *ic = vap->iv_ic;
 
-	if (ic->ic_flags & IEEE80211_F_SCAN) {
-		/* XXX check ic_curchan != ic_bsschan? */
-		return;
-	}
+	KASSERT((ic->ic_flags & IEEE80211_F_SCAN) == 0, ("scanning"));
+	KASSERT(vap->iv_state == IEEE80211_S_RUN,
+	    ("wrong state %d", vap->iv_state));
+
 	IEEE80211_DPRINTF(vap,
 		IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG,
 		"beacon miss, mode %u state %s\n",
 		vap->iv_opmode, ieee80211_state_name[vap->iv_state]);
-	/*
-	 * Our handling is only meaningful for stations that are
-	 * associated; any other conditions else will be handled
-	 * through different means (e.g. the tx timeout on mgt frames).
-	 */
-	if (vap->iv_state < IEEE80211_S_RUN)
-		return;
 
 	if (++vap->iv_bmiss_count < vap->iv_bmiss_max) {
 		/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802190035.m1J0Z868008182>