summaryrefslogtreecommitdiffstats
path: root/sys/dev/iwi/if_iwi.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2009-05-09 19:22:37 +0000
committersam <sam@FreeBSD.org>2009-05-09 19:22:37 +0000
commitbe3decb79f61298da7998be016a4b268b0d7ef66 (patch)
tree797192208a2650768a0174a7d6772c706cfe53be /sys/dev/iwi/if_iwi.c
parent0fa15cdc8a6d05a985785338f7aa927fb6a5d82b (diff)
downloadFreeBSD-src-be3decb79f61298da7998be016a4b268b0d7ef66.zip
FreeBSD-src-be3decb79f61298da7998be016a4b268b0d7ef66.tar.gz
push wme parameter setting to the taskq thread; the update callback from
net80211 can happen from the ithread and submitting the fw cmd requires a sleepable context
Diffstat (limited to 'sys/dev/iwi/if_iwi.c')
-rw-r--r--sys/dev/iwi/if_iwi.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c
index b04403b..6513522 100644
--- a/sys/dev/iwi/if_iwi.c
+++ b/sys/dev/iwi/if_iwi.c
@@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$");
#include <sys/namei.h>
#include <sys/linker.h>
#include <sys/firmware.h>
-#include <sys/kthread.h>
#include <sys/taskqueue.h>
#include <machine/bus.h>
@@ -154,6 +153,7 @@ static void iwi_media_status(struct ifnet *, struct ifmediareq *);
static int iwi_newstate(struct ieee80211vap *, enum ieee80211_state, int);
static void iwi_wme_init(struct iwi_softc *);
static int iwi_wme_setparams(struct iwi_softc *, struct ieee80211com *);
+static void iwi_update_wme(void *, int);
static int iwi_wme_update(struct ieee80211com *);
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,
@@ -291,6 +291,7 @@ iwi_attach(device_t dev)
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);
+ TASK_INIT(&sc->sc_wmetask, 0, iwi_update_wme, sc);
callout_init_mtx(&sc->sc_wdtimer, &sc->sc_mtx, 0);
callout_init_mtx(&sc->sc_rftimer, &sc->sc_mtx, 0);
@@ -1082,6 +1083,18 @@ iwi_wme_setparams(struct iwi_softc *sc, struct ieee80211com *ic)
#undef IWI_USEC
#undef IWI_EXP2
+static void
+iwi_update_wme(void *arg, int npending)
+{
+ struct ieee80211com *ic = arg;
+ struct iwi_softc *sc = ic->ic_ifp->if_softc;
+ IWI_LOCK_DECL;
+
+ IWI_LOCK(sc);
+ (void) iwi_wme_setparams(sc, ic);
+ IWI_UNLOCK(sc);
+}
+
static int
iwi_wme_update(struct ieee80211com *ic)
{
@@ -1091,13 +1104,13 @@ iwi_wme_update(struct ieee80211com *ic)
/*
* We may be called to update the WME parameters in
* the adapter at various places. If we're already
- * associated then initiate the request immediately
- * (via the taskqueue); otherwise we assume the params
- * will get sent down to the adapter as part of the
- * work iwi_auth_and_assoc does.
+ * associated then initiate the request immediately;
+ * otherwise we assume the params will get sent down
+ * to the adapter as part of the work iwi_auth_and_assoc
+ * does.
*/
if (vap->iv_state == IEEE80211_S_RUN)
- (void) iwi_wme_setparams(sc, ic);
+ ieee80211_runtask(ic, &sc->sc_wmetask);
return (0);
}
OpenPOWER on IntegriCloud