diff options
author | sam <sam@FreeBSD.org> | 2006-02-09 21:48:51 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2006-02-09 21:48:51 +0000 |
commit | 6c147e8e5a70874ac541503deeb192ba70fcaf08 (patch) | |
tree | f9b7b138c643788a65429ccc3e99fa0d1106dea8 /sys/dev | |
parent | 487bf4aa9e6bf6dba15b56e709bbc0453c6ff0d5 (diff) | |
download | FreeBSD-src-6c147e8e5a70874ac541503deeb192ba70fcaf08.zip FreeBSD-src-6c147e8e5a70874ac541503deeb192ba70fcaf08.tar.gz |
use a private task queue thread
MFC after: 2 weeks
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ath/if_ath.c | 20 | ||||
-rw-r--r-- | sys/dev/ath/if_athvar.h | 2 |
2 files changed, 16 insertions, 6 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 8d91b54..5a650dd 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -60,6 +60,8 @@ __FBSDID("$FreeBSD$"); #include <sys/callout.h> #include <sys/bus.h> #include <sys/endian.h> +#include <sys/kthread.h> +#include <sys/taskqueue.h> #include <machine/bus.h> @@ -381,6 +383,11 @@ ath_attach(u_int16_t devid, struct ath_softc *sc) ATH_TXBUF_LOCK_INIT(sc); + sc->sc_tq = taskqueue_create("ath_taskq", M_NOWAIT, + taskqueue_thread_enqueue, &sc->sc_tq); + taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, + "%s taskq", ifp->if_xname); + TASK_INIT(&sc->sc_rxtask, 0, ath_rx_proc, sc); TASK_INIT(&sc->sc_rxorntask, 0, ath_rxorn_proc, sc); TASK_INIT(&sc->sc_fataltask, 0, ath_fatal_proc, sc); @@ -643,6 +650,7 @@ ath_detach(struct ath_softc *sc) if (sc->sc_tx99 != NULL) sc->sc_tx99->detach(sc->sc_tx99); #endif + taskqueue_free(sc->sc_tq); ath_rate_detach(sc->sc_rc); ath_desc_free(sc); ath_tx_cleanup(sc); @@ -740,11 +748,11 @@ ath_intr(void *arg) */ sc->sc_stats.ast_hardware++; ath_hal_intrset(ah, 0); /* disable intr's until reset */ - taskqueue_enqueue(taskqueue_swi, &sc->sc_fataltask); + taskqueue_enqueue(sc->sc_tq, &sc->sc_fataltask); } else if (status & HAL_INT_RXORN) { sc->sc_stats.ast_rxorn++; ath_hal_intrset(ah, 0); /* disable intr's until reset */ - taskqueue_enqueue(taskqueue_swi, &sc->sc_rxorntask); + taskqueue_enqueue(sc->sc_tq, &sc->sc_rxorntask); } else { if (status & HAL_INT_SWBA) { /* @@ -770,12 +778,12 @@ ath_intr(void *arg) ath_hal_updatetxtriglevel(ah, AH_TRUE); } if (status & HAL_INT_RX) - taskqueue_enqueue(taskqueue_swi, &sc->sc_rxtask); + taskqueue_enqueue(sc->sc_tq, &sc->sc_rxtask); if (status & HAL_INT_TX) - taskqueue_enqueue(taskqueue_swi, &sc->sc_txtask); + taskqueue_enqueue(sc->sc_tq, &sc->sc_txtask); if (status & HAL_INT_BMISS) { sc->sc_stats.ast_bmiss++; - taskqueue_enqueue(taskqueue_swi, &sc->sc_bmisstask); + taskqueue_enqueue(sc->sc_tq, &sc->sc_bmisstask); } if (status & HAL_INT_MIB) { sc->sc_stats.ast_mib++; @@ -1963,7 +1971,7 @@ ath_beacon_proc(void *arg, int pending) "%s: missed %u consecutive beacons\n", __func__, sc->sc_bmisscount); if (sc->sc_bmisscount > 3) /* NB: 3 is a guess */ - taskqueue_enqueue(taskqueue_swi, &sc->sc_bstucktask); + taskqueue_enqueue(sc->sc_tq, &sc->sc_bstucktask); return; } if (sc->sc_bmisscount != 0) { diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h index 3f267b6..584d78a 100644 --- a/sys/dev/ath/if_athvar.h +++ b/sys/dev/ath/if_athvar.h @@ -164,6 +164,7 @@ struct ath_txq { (_tq)->axq_depth--; \ } while (0) +struct taskqueue; struct ath_tx99; struct ath_softc { @@ -184,6 +185,7 @@ struct ath_softc { bus_space_handle_t sc_sh; /* bus space handle */ bus_dma_tag_t sc_dmat; /* bus DMA tag */ struct mtx sc_mtx; /* master lock (recursive) */ + struct taskqueue *sc_tq; /* private task queue */ struct ath_hal *sc_ah; /* Atheros HAL */ struct ath_ratectrl *sc_rc; /* tx rate control support */ struct ath_tx99 *sc_tx99; /* tx99 adjunct state */ |