From owner-svn-src-user@FreeBSD.ORG Thu Apr 30 21:48:32 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06324106568A; Thu, 30 Apr 2009 21:48:32 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E91748FC19; Thu, 30 Apr 2009 21:48:31 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3ULmVSN023762; Thu, 30 Apr 2009 21:48:31 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3ULmVkr023760; Thu, 30 Apr 2009 21:48:31 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904302148.n3ULmVkr023760@svn.freebsd.org> From: Andrew Thompson Date: Thu, 30 Apr 2009 21:48:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r191707 - user/thompsa/vaptq/sys/net80211 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Apr 2009 21:48:32 -0000 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"