From owner-svn-src-user@FreeBSD.ORG Thu Apr 23 17:19:00 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 06A5A106564A; Thu, 23 Apr 2009 17:19:00 +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 CF15E8FC1C; Thu, 23 Apr 2009 17:18:59 +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 n3NHIx4G094314; Thu, 23 Apr 2009 17:18:59 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3NHIxGY094313; Thu, 23 Apr 2009 17:18:59 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904231718.n3NHIxGY094313@svn.freebsd.org> From: Andrew Thompson Date: Thu, 23 Apr 2009 17:18:59 +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: r191426 - 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, 23 Apr 2009 17:19:00 -0000 Author: thompsa Date: Thu Apr 23 17:18:59 2009 New Revision: 191426 URL: http://svn.freebsd.org/changeset/base/191426 Log: Eliminate an unlock for the channel change and add more comments around the driver callbacks. Modified: user/thompsa/vaptq/sys/net80211/ieee80211_scan.c Modified: user/thompsa/vaptq/sys/net80211/ieee80211_scan.c ============================================================================== --- user/thompsa/vaptq/sys/net80211/ieee80211_scan.c Thu Apr 23 16:56:26 2009 (r191425) +++ user/thompsa/vaptq/sys/net80211/ieee80211_scan.c Thu Apr 23 17:18:59 2009 (r191426) @@ -302,17 +302,6 @@ scan_update_locked(struct ieee80211vap * } } -static void -change_channel(struct ieee80211com *ic, - struct ieee80211_channel *chan) -{ - ic->ic_curchan = chan; - ic->ic_rt = ieee80211_get_ratetable(chan); - IEEE80211_UNLOCK(ic); - ic->ic_set_channel(ic); - IEEE80211_LOCK(ic); -} - static char channel_type(const struct ieee80211_channel *c) { @@ -921,7 +910,15 @@ scan_task(void *arg, int pending) /* * Potentially change channel and phy mode. */ - change_channel(ic, chan); + ic->ic_curchan = chan; + ic->ic_rt = ieee80211_get_ratetable(chan); + IEEE80211_UNLOCK(ic); + /* + * Perform the channel change and scan unlocked so the driver + * may sleep. Once set_channel returns the hardware has + * completed the channel change. + */ + ic->ic_set_channel(ic); /* * Scan curchan. Drivers for "intelligent hardware" @@ -929,8 +926,12 @@ scan_task(void *arg, int pending) * the work. Otherwise we manage the work outselves; * sending a probe request (as needed), and arming the * timeout to switch channels after maxdwell ticks. + * + * scan_curchan should only pause for the time required to + * prepare/initiate the hardware for the scan (if at all), the + * below condvar is used to sleep for the channels dwell time + * and allows it to be signalled for abort. */ - IEEE80211_UNLOCK(ic); ic->ic_scan_curchan(ss, maxdwell); IEEE80211_LOCK(ic); From owner-svn-src-user@FreeBSD.ORG Thu Apr 23 17:27:02 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 63B511065675; Thu, 23 Apr 2009 17:27:02 +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 527CE8FC0A; Thu, 23 Apr 2009 17:27:02 +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 n3NHR2Ql094570; Thu, 23 Apr 2009 17:27:02 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3NHR2Np094569; Thu, 23 Apr 2009 17:27:02 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904231727.n3NHR2Np094569@svn.freebsd.org> From: Andrew Thompson Date: Thu, 23 Apr 2009 17:27:01 +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: r191428 - 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, 23 Apr 2009 17:27:02 -0000 Author: thompsa Date: Thu Apr 23 17:27:01 2009 New Revision: 191428 URL: http://svn.freebsd.org/changeset/base/191428 Log: Remove the done: goto since the rc return code isnt used anymore. Modified: user/thompsa/vaptq/sys/net80211/ieee80211_proto.c Modified: user/thompsa/vaptq/sys/net80211/ieee80211_proto.c ============================================================================== --- user/thompsa/vaptq/sys/net80211/ieee80211_proto.c Thu Apr 23 17:19:25 2009 (r191427) +++ user/thompsa/vaptq/sys/net80211/ieee80211_proto.c Thu Apr 23 17:27:01 2009 (r191428) @@ -1678,7 +1678,7 @@ ieee80211_new_state_locked(struct ieee80 struct ieee80211com *ic = vap->iv_ic; struct ieee80211vap *vp; enum ieee80211_state ostate; - int nrunning, nscanning, rc; + int nrunning, nscanning; IEEE80211_LOCK_ASSERT(ic); @@ -1724,8 +1724,7 @@ ieee80211_new_state_locked(struct ieee80 __func__, ieee80211_state_name[ostate], ieee80211_state_name[nstate]); vap->iv_flags_ext |= IEEE80211_FEXT_SCANWAIT; - rc = 0; - goto done; + return (0); } if (nrunning) { /* @@ -1765,8 +1764,7 @@ ieee80211_new_state_locked(struct ieee80 ieee80211_state_name[ostate], ieee80211_state_name[nstate]); vap->iv_flags_ext |= IEEE80211_FEXT_SCANWAIT; - rc = 0; - goto done; + return (0); } if (vap->iv_opmode == IEEE80211_M_HOSTAP && IEEE80211_IS_CHAN_DFS(ic->ic_bsschan) && @@ -1800,8 +1798,6 @@ ieee80211_new_state_locked(struct ieee80 vap->iv_nstate_arg = arg; taskqueue_enqueue(ic->ic_tq, &vap->iv_nstate_task); return (EINPROGRESS); -done: - return rc; } int From owner-svn-src-user@FreeBSD.ORG Thu Apr 23 17:28:01 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 EFF98106566C; Thu, 23 Apr 2009 17:28:01 +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 DEBDC8FC12; Thu, 23 Apr 2009 17:28:01 +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 n3NHS1R4094624; Thu, 23 Apr 2009 17:28:01 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3NHS1Jn094623; Thu, 23 Apr 2009 17:28:01 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904231728.n3NHS1Jn094623@svn.freebsd.org> From: Andrew Thompson Date: Thu, 23 Apr 2009 17:28:01 +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: r191429 - 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, 23 Apr 2009 17:28:02 -0000 Author: thompsa Date: Thu Apr 23 17:28:01 2009 New Revision: 191429 URL: http://svn.freebsd.org/changeset/base/191429 Log: Call ic_set_channel() unlocked. Modified: user/thompsa/vaptq/sys/net80211/ieee80211_node.c Modified: user/thompsa/vaptq/sys/net80211/ieee80211_node.c ============================================================================== --- user/thompsa/vaptq/sys/net80211/ieee80211_node.c Thu Apr 23 17:27:01 2009 (r191428) +++ user/thompsa/vaptq/sys/net80211/ieee80211_node.c Thu Apr 23 17:28:01 2009 (r191429) @@ -629,7 +629,9 @@ ieee80211_sync_curchan(struct ieee80211c ic->ic_curchan = c; ic->ic_curmode = ieee80211_chan2mode(ic->ic_curchan); ic->ic_rt = ieee80211_get_ratetable(ic->ic_curchan); + IEEE80211_UNLOCK(ic); ic->ic_set_channel(ic); + IEEE80211_LOCK(ic); } } From owner-svn-src-user@FreeBSD.ORG Thu Apr 23 17:31:24 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 61AD510656A8; Thu, 23 Apr 2009 17:31:24 +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 50F838FC16; Thu, 23 Apr 2009 17:31:24 +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 n3NHVOCL094741; Thu, 23 Apr 2009 17:31:24 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3NHVO0u094740; Thu, 23 Apr 2009 17:31:24 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904231731.n3NHVO0u094740@svn.freebsd.org> From: Andrew Thompson Date: Thu, 23 Apr 2009 17:31:24 +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: r191430 - user/thompsa/vaptq/sys/dev/wi 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, 23 Apr 2009 17:31:25 -0000 Author: thompsa Date: Thu Apr 23 17:31:24 2009 New Revision: 191430 URL: http://svn.freebsd.org/changeset/base/191430 Log: Remove unused field. Modified: user/thompsa/vaptq/sys/dev/wi/if_wivar.h Modified: user/thompsa/vaptq/sys/dev/wi/if_wivar.h ============================================================================== --- user/thompsa/vaptq/sys/dev/wi/if_wivar.h Thu Apr 23 17:28:01 2009 (r191429) +++ user/thompsa/vaptq/sys/dev/wi/if_wivar.h Thu Apr 23 17:31:24 2009 (r191430) @@ -72,7 +72,6 @@ struct wi_softc { device_t sc_dev; struct mtx sc_mtx; struct callout sc_watchdog; - struct task sc_oor_task; int sc_unit; int wi_gone; int sc_enabled; From owner-svn-src-user@FreeBSD.ORG Thu Apr 23 17:33: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 5571F106566B; Thu, 23 Apr 2009 17:33: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 43C1C8FC08; Thu, 23 Apr 2009 17:33:32 +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 n3NHXW6U094827; Thu, 23 Apr 2009 17:33:32 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3NHXW3Z094825; Thu, 23 Apr 2009 17:33:32 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904231733.n3NHXW3Z094825@svn.freebsd.org> From: Andrew Thompson Date: Thu, 23 Apr 2009 17:33:32 +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: r191431 - user/thompsa/vaptq/sys/dev/ipw 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, 23 Apr 2009 17:33:32 -0000 Author: thompsa Date: Thu Apr 23 17:33:31 2009 New Revision: 191431 URL: http://svn.freebsd.org/changeset/base/191431 Log: ieee80211_new_state() can be called directly from the interrupt handler so remove the deferred tasks for this. Modified: user/thompsa/vaptq/sys/dev/ipw/if_ipw.c user/thompsa/vaptq/sys/dev/ipw/if_ipwvar.h Modified: user/thompsa/vaptq/sys/dev/ipw/if_ipw.c ============================================================================== --- user/thompsa/vaptq/sys/dev/ipw/if_ipw.c Thu Apr 23 17:31:24 2009 (r191430) +++ user/thompsa/vaptq/sys/dev/ipw/if_ipw.c Thu Apr 23 17:33:31 2009 (r191431) @@ -118,8 +118,6 @@ static void ipw_media_status(struct ifne static int ipw_newstate(struct ieee80211vap *, enum ieee80211_state, int); static uint16_t ipw_read_prom_word(struct ipw_softc *, uint8_t); static void ipw_rx_cmd_intr(struct ipw_softc *, struct ipw_soft_buf *); -static void ipw_assocsuccess(void *, int); -static void ipw_assocfailed(void *, int); static void ipw_rx_newstate_intr(struct ipw_softc *, struct ipw_soft_buf *); static void ipw_rx_data_intr(struct ipw_softc *, struct ipw_status *, struct ipw_soft_bd *, struct ipw_soft_buf *); @@ -504,9 +502,6 @@ ipw_vap_create(struct ieee80211com *ic, return NULL; vap = &ivp->vap; - TASK_INIT(&ivp->assoc_success_task, 0, ipw_assocsuccess, vap); - TASK_INIT(&ivp->assoc_failed_task, 0, ipw_assocfailed, vap); - ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid, mac); /* override with driver methods */ ivp->newstate = vap->iv_newstate; @@ -1008,22 +1003,6 @@ ipw_rx_cmd_intr(struct ipw_softc *sc, st } static void -ipw_assocsuccess(void *arg, int npending) -{ - struct ieee80211vap *vap = arg; - - ieee80211_new_state(vap, IEEE80211_S_RUN, -1); -} - -static void -ipw_assocfailed(void *arg, int npending) -{ - struct ieee80211vap *vap = arg; - - ieee80211_new_state(vap, IEEE80211_S_SCAN, -1); -} - -static void ipw_rx_newstate_intr(struct ipw_softc *sc, struct ipw_soft_buf *sbuf) { #define IEEESTATE(vap) ieee80211_state_name[vap->iv_state] @@ -1048,8 +1027,7 @@ ipw_rx_newstate_intr(struct ipw_softc *s } sc->flags &= ~IPW_FLAG_ASSOCIATING; sc->flags |= IPW_FLAG_ASSOCIATED; - taskqueue_enqueue(taskqueue_swi, - &IPW_VAP(vap)->assoc_success_task); + ieee80211_new_state(vap, IEEE80211_S_RUN, -1); break; case IPW_STATE_SCANNING: @@ -1093,8 +1071,7 @@ ipw_rx_newstate_intr(struct ipw_softc *s IEEESTATE(vap), sc->flags)); sc->flags &= ~(IPW_FLAG_ASSOCIATING | IPW_FLAG_ASSOCIATED); if (vap->iv_state == IEEE80211_S_RUN) - taskqueue_enqueue(taskqueue_swi, - &IPW_VAP(vap)->assoc_failed_task); + ieee80211_new_state(vap, IEEE80211_S_SCAN, -1); break; case IPW_STATE_DISABLED: Modified: user/thompsa/vaptq/sys/dev/ipw/if_ipwvar.h ============================================================================== --- user/thompsa/vaptq/sys/dev/ipw/if_ipwvar.h Thu Apr 23 17:31:24 2009 (r191430) +++ user/thompsa/vaptq/sys/dev/ipw/if_ipwvar.h Thu Apr 23 17:33:31 2009 (r191431) @@ -78,8 +78,6 @@ struct ipw_tx_radiotap_header { struct ipw_vap { struct ieee80211vap vap; - struct task assoc_success_task; - struct task assoc_failed_task; int (*newstate)(struct ieee80211vap *, enum ieee80211_state, int); @@ -92,7 +90,6 @@ struct ipw_softc { struct mtx sc_mtx; struct task sc_init_task; - struct task sc_bmiss_task; struct callout sc_wdtimer; /* watchdog timer */ uint32_t flags; From owner-svn-src-user@FreeBSD.ORG Thu Apr 23 17:36:08 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 A267B1065670; Thu, 23 Apr 2009 17:36:08 +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 868008FC12; Thu, 23 Apr 2009 17:36:08 +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 n3NHa8S7094918; Thu, 23 Apr 2009 17:36:08 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3NHa84H094916; Thu, 23 Apr 2009 17:36:08 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904231736.n3NHa84H094916@svn.freebsd.org> From: Andrew Thompson Date: Thu, 23 Apr 2009 17:36:08 +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: r191432 - user/thompsa/vaptq/sys/dev/iwi 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, 23 Apr 2009 17:36:09 -0000 Author: thompsa Date: Thu Apr 23 17:36:08 2009 New Revision: 191432 URL: http://svn.freebsd.org/changeset/base/191432 Log: ieee80211_new_state() can be called directly from the interrupt handler so remove the deferred tasks for this. Modified: user/thompsa/vaptq/sys/dev/iwi/if_iwi.c user/thompsa/vaptq/sys/dev/iwi/if_iwivar.h Modified: user/thompsa/vaptq/sys/dev/iwi/if_iwi.c ============================================================================== --- user/thompsa/vaptq/sys/dev/iwi/if_iwi.c Thu Apr 23 17:33:31 2009 (r191431) +++ user/thompsa/vaptq/sys/dev/iwi/if_iwi.c Thu Apr 23 17:36:08 2009 (r191432) @@ -158,9 +158,6 @@ static int iwi_wme_update(struct ieee802 static uint16_t iwi_read_prom_word(struct iwi_softc *, uint8_t); static void iwi_frame_intr(struct iwi_softc *, struct iwi_rx_data *, int, struct iwi_frame *); -static void iwi_authsuccess(void *, int); -static void iwi_assocsuccess(void *, int); -static void iwi_assocfailed(void *, int); static void iwi_notification_intr(struct iwi_softc *, struct iwi_notif *); static void iwi_rx_intr(struct iwi_softc *); static void iwi_tx_intr(struct iwi_softc *, struct iwi_tx_ring *); @@ -190,6 +187,7 @@ static void iwi_set_channel(struct ieee8 static void iwi_scan_curchan(struct ieee80211_scan_state *, unsigned long maxdwell); static void iwi_scan_mindwell(struct ieee80211_scan_state *); static int iwi_auth_and_assoc(struct iwi_softc *, struct ieee80211vap *); +static void iwi_disassoc(void *, int); static int iwi_disassociate(struct iwi_softc *, int quiet); static void iwi_init_locked(struct iwi_softc *); static void iwi_init(void *); @@ -292,6 +290,8 @@ iwi_attach(device_t dev) TASK_INIT(&sc->sc_radiontask, 0, iwi_radio_on, sc); TASK_INIT(&sc->sc_radiofftask, 0, iwi_radio_off, sc); TASK_INIT(&sc->sc_restarttask, 0, iwi_restart, sc); + TASK_INIT(&sc->sc_disassoctask, 0, iwi_disassoc, sc); + callout_init_mtx(&sc->sc_wdtimer, &sc->sc_mtx, 0); callout_init_mtx(&sc->sc_rftimer, &sc->sc_mtx, 0); @@ -468,6 +468,7 @@ iwi_detach(device_t dev) taskqueue_drain(taskqueue_swi, &sc->sc_radiontask); taskqueue_drain(taskqueue_swi, &sc->sc_radiofftask); taskqueue_drain(taskqueue_swi, &sc->sc_restarttask); + taskqueue_drain(taskqueue_swi, &sc->sc_disassoctask); iwi_put_firmware(sc); iwi_release_fw_dma(sc); @@ -534,10 +535,6 @@ iwi_vap_create(struct ieee80211com *ic, ivp->iwi_newstate = vap->iv_newstate; vap->iv_newstate = iwi_newstate; - TASK_INIT(&ivp->iwi_authsuccess_task, 0, iwi_authsuccess, vap); - TASK_INIT(&ivp->iwi_assocsuccess_task, 0, iwi_assocsuccess, vap); - TASK_INIT(&ivp->iwi_assocfailed_task, 0, iwi_assocfailed, vap); - /* complete setup */ ieee80211_vap_attach(vap, ieee80211_media_change, iwi_media_status); ic->ic_opmode = opmode; @@ -1375,30 +1372,6 @@ iwi_checkforqos(struct ieee80211vap *vap */ static void -iwi_authsuccess(void *arg, int npending) -{ - struct ieee80211vap *vap = arg; - - ieee80211_new_state(vap, IEEE80211_S_ASSOC, -1); -} - -static void -iwi_assocsuccess(void *arg, int npending) -{ - struct ieee80211vap *vap = arg; - - ieee80211_new_state(vap, IEEE80211_S_RUN, -1); -} - -static void -iwi_assocfailed(void *arg, int npending) -{ - struct ieee80211vap *vap = arg; - - ieee80211_new_state(vap, IEEE80211_S_SCAN, -1); -} - -static void iwi_notification_intr(struct iwi_softc *sc, struct iwi_notif *notif) { struct ifnet *ifp = sc->sc_ifp; @@ -1440,8 +1413,7 @@ iwi_notification_intr(struct iwi_softc * switch (auth->state) { case IWI_AUTH_SUCCESS: DPRINTFN(2, ("Authentication succeeeded\n")); - taskqueue_enqueue(taskqueue_swi, - &IWI_VAP(vap)->iwi_authsuccess_task); + ieee80211_new_state(vap, IEEE80211_S_ASSOC, -1); break; case IWI_AUTH_FAIL: /* @@ -1458,8 +1430,7 @@ iwi_notification_intr(struct iwi_softc * DPRINTFN(2, ("Deauthenticated\n")); vap->iv_stats.is_rx_deauth++; } - taskqueue_enqueue(taskqueue_swi, - &IWI_VAP(vap)->iwi_assocfailed_task); + ieee80211_new_state(vap, IEEE80211_S_SCAN, -1); break; case IWI_AUTH_SENT_1: case IWI_AUTH_RECV_2: @@ -1492,8 +1463,7 @@ iwi_notification_intr(struct iwi_softc * iwi_checkforqos(vap, (const struct ieee80211_frame *)(assoc+1), le16toh(notif->len) - sizeof(*assoc)); - taskqueue_enqueue(taskqueue_swi, - &IWI_VAP(vap)->iwi_assocsuccess_task); + ieee80211_new_state(vap, IEEE80211_S_RUN, -1); break; case IWI_ASSOC_INIT: sc->flags &= ~IWI_FLAG_ASSOCIATED; @@ -1501,16 +1471,14 @@ iwi_notification_intr(struct iwi_softc * case IWI_FW_ASSOCIATING: DPRINTFN(2, ("Association failed\n")); IWI_STATE_END(sc, IWI_FW_ASSOCIATING); - taskqueue_enqueue(taskqueue_swi, - &IWI_VAP(vap)->iwi_assocfailed_task); + ieee80211_new_state(vap, IEEE80211_S_SCAN, -1); break; case IWI_FW_DISASSOCIATING: DPRINTFN(2, ("Dissassociated\n")); IWI_STATE_END(sc, IWI_FW_DISASSOCIATING); vap->iv_stats.is_rx_disassoc++; - taskqueue_enqueue(taskqueue_swi, - &IWI_VAP(vap)->iwi_assocfailed_task); + ieee80211_new_state(vap, IEEE80211_S_SCAN, -1); break; } break; @@ -1549,7 +1517,8 @@ iwi_notification_intr(struct iwi_softc * * to disassociate and then on completion we'll * kick the state machine to scan. */ - //iwi_disassociate(sc, 0); + taskqueue_enqueue(taskqueue_swi, + &sc->sc_disassoctask); } } break; @@ -2958,6 +2927,16 @@ done: return (error); } +static void +iwi_disassoc(void *arg, int pending) +{ + struct iwi_softc *sc = arg; + + IWI_LOCK(sc); + iwi_disassociate(sc, 0); + IWI_UNLOCK(sc); +} + static int iwi_disassociate(struct iwi_softc *sc, int quiet) { Modified: user/thompsa/vaptq/sys/dev/iwi/if_iwivar.h ============================================================================== --- user/thompsa/vaptq/sys/dev/iwi/if_iwivar.h Thu Apr 23 17:33:31 2009 (r191431) +++ user/thompsa/vaptq/sys/dev/iwi/if_iwivar.h Thu Apr 23 17:36:08 2009 (r191432) @@ -116,9 +116,6 @@ struct iwi_fw { struct iwi_vap { struct ieee80211vap iwi_vap; - struct task iwi_authsuccess_task; - struct task iwi_assocsuccess_task; - struct task iwi_assocfailed_task; int (*iwi_newstate)(struct ieee80211vap *, enum ieee80211_state, int); @@ -192,6 +189,7 @@ struct iwi_softc { struct task sc_radiontask; /* radio on processing */ struct task sc_radiofftask; /* radio off processing */ struct task sc_restarttask; /* restart adapter processing */ + struct task sc_disassoctask; unsigned int sc_softled : 1, /* enable LED gpio status */ sc_ledstate: 1, /* LED on/off state */ From owner-svn-src-user@FreeBSD.ORG Sat Apr 25 05:14:57 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 3A6FE106564A; Sat, 25 Apr 2009 05:14:57 +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 2973F8FC17; Sat, 25 Apr 2009 05:14:57 +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 n3P5Ev24042980; Sat, 25 Apr 2009 05:14:57 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3P5Ev8X042979; Sat, 25 Apr 2009 05:14:57 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904250514.n3P5Ev8X042979@svn.freebsd.org> From: Andrew Thompson Date: Sat, 25 Apr 2009 05:14:57 +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: r191479 - 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 05:14:57 -0000 Author: thompsa Date: Sat Apr 25 05:14:56 2009 New Revision: 191479 URL: http://svn.freebsd.org/changeset/base/191479 Log: Put the test for scanning in ieee80211_beacon_miss() before the task is queued, it is not possible for scanning to still be running once the task fires. Modified: user/thompsa/vaptq/sys/net80211/ieee80211_proto.c Modified: user/thompsa/vaptq/sys/net80211/ieee80211_proto.c ============================================================================== --- user/thompsa/vaptq/sys/net80211/ieee80211_proto.c Sat Apr 25 02:59:06 2009 (r191478) +++ user/thompsa/vaptq/sys/net80211/ieee80211_proto.c Sat Apr 25 05:14:56 2009 (r191479) @@ -1361,8 +1361,12 @@ ieee80211_resume_all(struct ieee80211com void ieee80211_beacon_miss(struct ieee80211com *ic) { - /* Process in a taskq, the bmiss handler may reenter the driver */ - taskqueue_enqueue(ic->ic_tq, &ic->ic_bmiss_task); + IEEE80211_LOCK(ic); + if ((ic->ic_flags & IEEE80211_F_SCAN) == 0) { + /* Process in a taskq, the handler may reenter the driver */ + taskqueue_enqueue(ic->ic_tq, &ic->ic_bmiss_task); + } + IEEE80211_UNLOCK(ic); } static void @@ -1371,8 +1375,6 @@ beacon_miss(void *arg, int npending) struct ieee80211com *ic = arg; struct ieee80211vap *vap; - if (ic->ic_flags & IEEE80211_F_SCAN) - return; /* XXX locking */ TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { /* From owner-svn-src-user@FreeBSD.ORG Sat Apr 25 05:45:08 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 670D9106564A; Sat, 25 Apr 2009 05:45:08 +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 55FC88FC16; Sat, 25 Apr 2009 05:45:08 +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 n3P5j8Zt043550; Sat, 25 Apr 2009 05:45:08 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3P5j82A043549; Sat, 25 Apr 2009 05:45:08 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904250545.n3P5j82A043549@svn.freebsd.org> From: Andrew Thompson Date: Sat, 25 Apr 2009 05:45:08 +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: r191480 - 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 05:45:08 -0000 Author: thompsa Date: Sat Apr 25 05:45:08 2009 New Revision: 191480 URL: http://svn.freebsd.org/changeset/base/191480 Log: Add a bandaid for external events trashing the pending state change to INIT. Modified: user/thompsa/vaptq/sys/net80211/ieee80211_proto.c Modified: user/thompsa/vaptq/sys/net80211/ieee80211_proto.c ============================================================================== --- user/thompsa/vaptq/sys/net80211/ieee80211_proto.c Sat Apr 25 05:14:56 2009 (r191479) +++ user/thompsa/vaptq/sys/net80211/ieee80211_proto.c Sat Apr 25 05:45:08 2009 (r191480) @@ -1684,12 +1684,20 @@ ieee80211_new_state_locked(struct ieee80 IEEE80211_LOCK_ASSERT(ic); - /* Warn if the previous state hasn't completed. XXX Queue? */ - if (vap->iv_state != vap->iv_nstate) + if (vap->iv_state != vap->iv_nstate) { + if (vap->iv_nstate == IEEE80211_S_INIT) { + /* + * XXX The vap is being stopped, do no allow any other + * state changes until this is completed. + */ + return (-1); + } + /* Warn if the previous state hasn't completed. */ IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, "%s: pending %s -> %s transition lost\n", __func__, ieee80211_state_name[vap->iv_state], ieee80211_state_name[vap->iv_nstate]); + } nrunning = nscanning = 0; /* XXX can track this state instead of calculating */ From owner-svn-src-user@FreeBSD.ORG Sat Apr 25 05:52:48 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 64FDC106566B; Sat, 25 Apr 2009 05:52:48 +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 5414C8FC13; Sat, 25 Apr 2009 05:52:48 +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 n3P5qmRs043711; Sat, 25 Apr 2009 05:52:48 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3P5qmAo043710; Sat, 25 Apr 2009 05:52:48 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904250552.n3P5qmAo043710@svn.freebsd.org> From: Andrew Thompson Date: Sat, 25 Apr 2009 05:52:48 +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: r191481 - 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 05:52:48 -0000 Author: thompsa Date: Sat Apr 25 05:52:48 2009 New Revision: 191481 URL: http://svn.freebsd.org/changeset/base/191481 Log: - Remove the lock assert before cv_signal() as the pointer to the ic may be dead, as its a static function the callers can be verified. - Assert the scan has been stopped before freeing the memory. Modified: user/thompsa/vaptq/sys/net80211/ieee80211_scan.c Modified: user/thompsa/vaptq/sys/net80211/ieee80211_scan.c ============================================================================== --- user/thompsa/vaptq/sys/net80211/ieee80211_scan.c Sat Apr 25 05:45:08 2009 (r191480) +++ user/thompsa/vaptq/sys/net80211/ieee80211_scan.c Sat Apr 25 05:52:48 2009 (r191481) @@ -131,6 +131,8 @@ ieee80211_scan_detach(struct ieee80211co scan_signal(ss); IEEE80211_UNLOCK(ic); taskqueue_drain(ic->ic_tq, &SCAN_PRIVATE(ss)->ss_scan_task); + KASSERT((ic->ic_flags & IEEE80211_F_SCAN) == 0, + ("scan still running")); if (ss->ss_ops != NULL) { ss->ss_ops->scan_detach(ss); ss->ss_ops = NULL; @@ -813,8 +815,6 @@ scan_signal(void *arg) { struct ieee80211_scan_state *ss = (struct ieee80211_scan_state *) arg; - IEEE80211_LOCK_ASSERT(ss->ss_vap->iv_ic); - cv_signal(&SCAN_PRIVATE(ss)->ss_scan_cv); } From owner-svn-src-user@FreeBSD.ORG Sat Apr 25 05:55:44 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 61054106566B; Sat, 25 Apr 2009 05:55:44 +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 503EA8FC19; Sat, 25 Apr 2009 05:55:44 +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 n3P5tidk043817; Sat, 25 Apr 2009 05:55:44 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3P5ti73043816; Sat, 25 Apr 2009 05:55:44 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904250555.n3P5ti73043816@svn.freebsd.org> From: Andrew Thompson Date: Sat, 25 Apr 2009 05:55:44 +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: r191482 - 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 05:55:44 -0000 Author: thompsa Date: Sat Apr 25 05:55:44 2009 New Revision: 191482 URL: http://svn.freebsd.org/changeset/base/191482 Log: Print the pending state change if it hasnt been completed. Modified: user/thompsa/vaptq/sys/net80211/ieee80211_ddb.c Modified: user/thompsa/vaptq/sys/net80211/ieee80211_ddb.c ============================================================================== --- user/thompsa/vaptq/sys/net80211/ieee80211_ddb.c Sat Apr 25 05:52:48 2009 (r191481) +++ user/thompsa/vaptq/sys/net80211/ieee80211_ddb.c Sat Apr 25 05:55:44 2009 (r191482) @@ -280,6 +280,8 @@ _db_show_vap(const struct ieee80211vap * db_printf("\topmode %s", ieee80211_opmode_name[vap->iv_opmode]); db_printf(" state %s", ieee80211_state_name[vap->iv_state]); + if (vap->iv_state != vap->iv_nstate) + db_printf(" (nstate %s)", ieee80211_state_name[vap->iv_nstate]); db_printf(" ifp %p", vap->iv_ifp); db_printf("\n"); 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 */ From owner-svn-src-user@FreeBSD.ORG Sat Apr 25 23:40:20 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 B9AD91065672; Sat, 25 Apr 2009 23:40:20 +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 8DA0E8FC08; Sat, 25 Apr 2009 23:40:20 +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 n3PNeKmn066554; Sat, 25 Apr 2009 23:40:20 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3PNeKjQ066553; Sat, 25 Apr 2009 23:40:20 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904252340.n3PNeKjQ066553@svn.freebsd.org> From: Andrew Thompson Date: Sat, 25 Apr 2009 23:40:20 +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: r191504 - 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 23:40:21 -0000 Author: thompsa Date: Sat Apr 25 23:40:20 2009 New Revision: 191504 URL: http://svn.freebsd.org/changeset/base/191504 Log: The vap pointer is cleared in ieee80211_scan_vdetach() so keep a pointer to the ic too. Modified: user/thompsa/vaptq/sys/net80211/ieee80211_scan.c user/thompsa/vaptq/sys/net80211/ieee80211_scan.h Modified: user/thompsa/vaptq/sys/net80211/ieee80211_scan.c ============================================================================== --- user/thompsa/vaptq/sys/net80211/ieee80211_scan.c Sat Apr 25 23:09:39 2009 (r191503) +++ user/thompsa/vaptq/sys/net80211/ieee80211_scan.c Sat Apr 25 23:40:20 2009 (r191504) @@ -115,6 +115,7 @@ ieee80211_scan_attach(struct ieee80211co cv_init(&ss->ss_scan_cv, "scan"); TASK_INIT(&ss->ss_scan_task, 0, scan_task, ss); ic->ic_scan = &ss->base; + ss->base.ss_ic = ic; ic->ic_scan_curchan = scan_curchan; ic->ic_scan_mindwell = scan_mindwell; @@ -327,7 +328,7 @@ channel_type(const struct ieee80211_chan void ieee80211_scan_dump_channels(const struct ieee80211_scan_state *ss) { - struct ieee80211com *ic = ss->ss_vap->iv_ic; + struct ieee80211com *ic = ss->ss_ic; const char *sep; int i; @@ -815,6 +816,8 @@ scan_signal(void *arg) { struct ieee80211_scan_state *ss = (struct ieee80211_scan_state *) arg; + IEEE80211_LOCK_ASSERT(ss->ss_ic); + cv_signal(&SCAN_PRIVATE(ss)->ss_scan_cv); } @@ -825,8 +828,7 @@ scan_signal(void *arg) static void scan_mindwell(struct ieee80211_scan_state *ss) { - struct ieee80211vap *vap = ss->ss_vap; - struct ieee80211com *ic = vap->iv_ic; + struct ieee80211com *ic = ss->ss_ic; IEEE80211_LOCK(ic); scan_signal(ss); @@ -839,13 +841,13 @@ scan_task(void *arg, int pending) #define ISCAN_REP (ISCAN_MINDWELL | ISCAN_DISCARD) struct ieee80211_scan_state *ss = (struct ieee80211_scan_state *) arg; struct ieee80211vap *vap = ss->ss_vap; - struct ieee80211com *ic = vap->iv_ic; + struct ieee80211com *ic = ss->ss_ic; struct ieee80211_channel *chan; unsigned long maxdwell, scanend; int scandone = 0; IEEE80211_LOCK(ic); - if ((ic->ic_flags & IEEE80211_F_SCAN) == 0 || + if (vap == NULL || (ic->ic_flags & IEEE80211_F_SCAN) == 0 || (SCAN_PRIVATE(ss)->ss_iflags & ISCAN_ABORT)) { /* Cancelled before we started */ goto done; Modified: user/thompsa/vaptq/sys/net80211/ieee80211_scan.h ============================================================================== --- user/thompsa/vaptq/sys/net80211/ieee80211_scan.h Sat Apr 25 23:09:39 2009 (r191503) +++ user/thompsa/vaptq/sys/net80211/ieee80211_scan.h Sat Apr 25 23:40:20 2009 (r191504) @@ -90,6 +90,7 @@ struct ieee80211_scan_ssid { */ struct ieee80211_scan_state { struct ieee80211vap *ss_vap; + struct ieee80211com *ss_ic; const struct ieee80211_scanner *ss_ops; /* policy hookup, see below */ void *ss_priv; /* scanner private state */ uint16_t ss_flags;