From owner-svn-src-user@FreeBSD.ORG Sat Apr 25 06:20:35 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 60DCB106566B; Sat, 25 Apr 2009 06:20:35 +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 4FC5F8FC13; Sat, 25 Apr 2009 06:20:35 +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 n3P6KZRp044281; Sat, 25 Apr 2009 06:20:35 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3P6KZg2044278; Sat, 25 Apr 2009 06:20:35 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904250620.n3P6KZg2044278@svn.freebsd.org> From: Andrew Thompson Date: Sat, 25 Apr 2009 06:20:35 +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: r191483 - 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: Sat, 25 Apr 2009 06:20:35 -0000 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 */