Add state debug messages when AP or STA returns to RUN state, indicating
authormtaylor <mtaylor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Fri, 18 Jan 2008 22:14:41 +0000 (22:14 +0000)
committermtaylor <mtaylor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Fri, 18 Jan 2008 22:14:41 +0000 (22:14 +0000)
whether or not beacons were going to be reconfigured.  Add logic so that
any time a STA on an AP mode radio comes back to RUN state we will
reconfigure beacons.  Also reconfigure beacons on AP return to RUN state
in a AP+STA configuration.  In this AP+STA mode, we need to be careful to update the beacons any time a STA or AP comes online to make sure the APs start beaconing.  This fixes issues where beacons are not restarted correctly after the station returns from SCAN/ASSOC/AUTH/INIT to RUN state while APs are pending completation of the STAs activity.

git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3213 0192ed92-7a03-0410-a25b-9323aeb14dbd

ath/if_ath.c

index 3f2a09924a10998ed4c7840d733ed69269b74d0f..c4fa9c7899adb694477897a98612ab3852441e58 100644 (file)
@@ -8846,12 +8846,21 @@ ath_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
                         */
                        TAILQ_FOREACH(tmpvap, &ic->ic_vaps, iv_next) {
                                if ((tmpvap != vap) && 
-                                               (tmpvap->iv_state == IEEE80211_S_RUN) &&
-                                               (tmpvap->iv_opmode == IEEE80211_M_HOSTAP))
+                                   (tmpvap->iv_state == IEEE80211_S_RUN) &&
+                                   (tmpvap->iv_opmode == IEEE80211_M_HOSTAP))
                                        break;
                        }
-                       if (!tmpvap)
+                       if (!tmpvap || sc->sc_nostabeacons)
                                sc->sc_beacons = 0;
+
+                       DPRINTF(sc, ATH_DEBUG_STATE | 
+                               ATH_DEBUG_BEACON | 
+                               ATH_DEBUG_BEACON_PROC, 
+                               "%s: VAP %p[%s] transitioned to RUN state and "
+                               "we %s reconfiguring beacons.\n",
+                               __func__, vap, vap->iv_nickname, 
+                               sc->sc_beacons ? "ARE NOT" : "ARE");
+
                        break;
                case IEEE80211_M_STA:
 #ifdef ATH_SUPERG_COMP
@@ -8868,6 +8877,28 @@ ath_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
                         */
                        sc->sc_dturbo =
                                (ni->ni_ath_flags & IEEE80211_ATHC_TURBOP) != 0;
+
+                       /* When we are in AP mode and we have a station,
+                        * any time the station is in SCAN, AUTH, or ASSOC
+                        * states - all AP VAPs are put down into INIT state
+                        * and marked 'scan pending'.  So, every time the STA
+                        * VAP returns to RUN state on an AP mode radio, we
+                        * are almost certain to have a minimum of one AP VAP
+                        * returning to RUN state, and needing beacons reset.
+                        * Without this, a STA can come back up and leave the
+                        * AP VAP in a state where it is not beaconing. */
+                       if (ic->ic_opmode == IEEE80211_M_HOSTAP || 
+                           sc->sc_nostabeacons) 
+                               sc->sc_beacons = 0;
+
+                       DPRINTF(sc, ATH_DEBUG_STATE | 
+                                   ATH_DEBUG_BEACON | 
+                                   ATH_DEBUG_BEACON_PROC, 
+                               "%s: VAP %p[%s] transitioned to RUN state and "
+                               "we %s reconfiguring beacons.\n",
+                               __func__, vap, vap->iv_nickname, 
+                               sc->sc_beacons ? "ARE NOT" : "ARE");
+
                        break;
                case IEEE80211_M_WDS:
                        wds_ni = ieee80211_find_txnode(vap, vap->wds_mac);