svn commit: r191432 - user/thompsa/vaptq/sys/dev/iwi
Andrew Thompson
thompsa at FreeBSD.org
Thu Apr 23 17:36:09 UTC 2009
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 */
More information about the svn-src-user
mailing list