svn commit: r191707 - user/thompsa/vaptq/sys/net80211
Andrew Thompson
thompsa at FreeBSD.org
Thu Apr 30 21:48:32 UTC 2009
Author: thompsa
Date: Thu Apr 30 21:48:31 2009
New Revision: 191707
URL: http://svn.freebsd.org/changeset/base/191707
Log:
Add a reinit flag which lets the state be forced back to INIT before
proceeding.
Modified:
user/thompsa/vaptq/sys/net80211/ieee80211_proto.c
user/thompsa/vaptq/sys/net80211/ieee80211_var.h
Modified: user/thompsa/vaptq/sys/net80211/ieee80211_proto.c
==============================================================================
--- user/thompsa/vaptq/sys/net80211/ieee80211_proto.c Thu Apr 30 21:39:56 2009 (r191706)
+++ user/thompsa/vaptq/sys/net80211/ieee80211_proto.c Thu Apr 30 21:48:31 2009 (r191707)
@@ -1199,8 +1199,7 @@ ieee80211_start_locked(struct ieee80211v
* preempted if the station is locked to a particular
* channel.
*/
- /* XXX needed? */
- ieee80211_new_state_locked(vap, IEEE80211_S_INIT, 0);
+ vap->iv_flags_ext |= IEEE80211_FEXT_REINIT;
if (vap->iv_opmode == IEEE80211_M_MONITOR ||
vap->iv_opmode == IEEE80211_M_WDS)
ieee80211_new_state_locked(vap,
@@ -1598,15 +1597,25 @@ ieee80211_newstate_cb_locked(struct ieee
enum ieee80211_state nstate, int arg)
{
struct ieee80211com *ic = vap->iv_ic;
- enum ieee80211_state ostate = vap->iv_state;
+ enum ieee80211_state ostate;
int rc;
IEEE80211_LOCK_ASSERT(ic);
- IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
- "%s: %s -> %s arg %d\n", __func__,
- ieee80211_state_name[ostate], ieee80211_state_name[nstate], arg);
+ if (vap->iv_flags_ext & IEEE80211_FEXT_REINIT) {
+ /*
+ * We have been requested to drop back to the INIT before
+ * proceeding to the new state.
+ */
+ IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
+ "%s: %s -> %s arg %d\n", __func__,
+ ieee80211_state_name[vap->iv_state],
+ ieee80211_state_name[IEEE80211_S_INIT], arg);
+ vap->iv_newstate(vap, IEEE80211_S_INIT, arg);
+ vap->iv_flags_ext &= ~IEEE80211_FEXT_REINIT;
+ }
+ ostate = vap->iv_state;
if (nstate == IEEE80211_S_SCAN && ostate != IEEE80211_S_INIT) {
/*
* SCAN was forced; e.g. on beacon miss. Force other running
@@ -1619,6 +1628,9 @@ ieee80211_newstate_cb_locked(struct ieee
*/
markwaiting(vap);
}
+ IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
+ "%s: %s -> %s arg %d\n", __func__,
+ ieee80211_state_name[ostate], ieee80211_state_name[nstate], arg);
rc = vap->iv_newstate(vap, nstate, arg);
vap->iv_flags_ext &= ~IEEE80211_FEXT_STATEWAIT;
Modified: user/thompsa/vaptq/sys/net80211/ieee80211_var.h
==============================================================================
--- user/thompsa/vaptq/sys/net80211/ieee80211_var.h Thu Apr 30 21:39:56 2009 (r191706)
+++ user/thompsa/vaptq/sys/net80211/ieee80211_var.h Thu Apr 30 21:48:31 2009 (r191707)
@@ -515,6 +515,8 @@ MALLOC_DECLARE(M_80211_VAP);
#define IEEE80211_FEXT_SWBMISS 0x00000400 /* CONF: do bmiss in s/w */
#define IEEE80211_FEXT_DFS 0x00000800 /* CONF: DFS enabled */
#define IEEE80211_FEXT_DOTD 0x00001000 /* CONF: 11d enabled */
+#define IEEE80211_FEXT_STATEWAIT 0x00002000 /* STATUS: awaiting state chg */
+#define IEEE80211_FEXT_REINIT 0x00004000 /* STATUS: INIT state first */
/* NB: immutable: should be set only when creating a vap */
#define IEEE80211_FEXT_WDSLEGACY 0x00010000 /* CONF: legacy WDS operation */
#define IEEE80211_FEXT_PROBECHAN 0x00020000 /* CONF: probe passive channel*/
@@ -529,13 +531,12 @@ MALLOC_DECLARE(M_80211_VAP);
#define IEEE80211_FEXT_SHORTGI40 0x08000000 /* CONF: short GI in HT40 */
#define IEEE80211_FEXT_HTCOMPAT 0x10000000 /* CONF: HT vendor OUI's */
#define IEEE80211_FEXT_RIFS 0x20000000 /* CONF: RIFS enabled */
-#define IEEE80211_FEXT_STATEWAIT 0x40000000 /* STATUS: awaiting state chg */
#define IEEE80211_FEXT_BITS \
"\20\1NONHT_PR\2INACT\3SCANWAIT\4BGSCAN\5WPS\6TSN\7SCANREQ\10RESUME" \
- "\12NONEPR_PR\13SWBMISS\14DFS\15DOTD\22WDSLEGACY\23PROBECHAN\24HT" \
- "\25AMDPU_TX\26AMPDU_TX\27AMSDU_TX\30AMSDU_RX\31USEHT40\32PUREN" \
- "\33SHORTGI20\34SHORTGI40\35HTCOMPAT\36RIFS\37STATEWAIT"
+ "\12NONEPR_PR\13SWBMISS\14DFS\15DOTD\16STATEWAIT\17REINIT\22WDSLEGACY" \
+ "\23PROBECHAN\24HT\25AMDPU_TX\26AMPDU_TX\27AMSDU_TX\30AMSDU_RX" \
+ "\31USEHT40\32PUREN\33SHORTGI20\34SHORTGI40\35HTCOMPAT\36RIFS"
#define IEEE80211_FVEN_BITS "\20"
More information about the svn-src-user
mailing list