Date: Tue, 3 May 2005 16:20:48 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 76436 for review Message-ID: <200505031620.j43GKmYK052672@repoman.freebsd.org>
index | next in thread | raw e-mail
http://perforce.freebsd.org/chv.cgi?CH=76436 Change 76436 by sam@sam_ebb on 2005/05/03 16:20:33 use a private taskqueue Affected files ... .. //depot/projects/wifi/sys/dev/ath/if_ath.c#84 edit .. //depot/projects/wifi/sys/dev/ath/if_athvar.h#34 edit Differences ... ==== //depot/projects/wifi/sys/dev/ath/if_ath.c#84 (text+ko) ==== @@ -60,6 +60,8 @@ #include <sys/callout.h> #include <sys/bus.h> #include <sys/endian.h> +#include <sys/kthread.h> +#include <sys/taskqueue.h> #include <machine/bus.h> @@ -367,6 +369,10 @@ ATH_TXBUF_LOCK_INIT(sc); + sc->sc_tq = taskqueue_create("ath_taskq", M_NOWAIT, + taskqueue_thread_enqueue, &sc->sc_tq, &sc->sc_tqproc); + kthread_create(taskqueue_thread_loop, &sc->sc_tq, &sc->sc_tqproc, + 0, 0, "%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); @@ -624,6 +630,7 @@ * Other than that, it's straightforward... */ ieee80211_ifdetach(&sc->sc_ic); + taskqueue_free(sc->sc_tq); ath_rate_detach(sc->sc_rc); ath_desc_free(sc); ath_tx_cleanup(sc); @@ -715,11 +722,11 @@ */ 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) { /* @@ -745,12 +752,12 @@ 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++; @@ -2225,7 +2232,7 @@ "%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) { ==== //depot/projects/wifi/sys/dev/ath/if_athvar.h#34 (text+ko) ==== @@ -42,8 +42,6 @@ #ifndef _DEV_ATH_ATHVAR_H #define _DEV_ATH_ATHVAR_H -#include <sys/taskqueue.h> - #include <contrib/dev/ath/ah.h> #include <net80211/ieee80211_radiotap.h> #include <dev/ath/if_athioctl.h> @@ -61,6 +59,8 @@ #define ATH_FF_TXQMAX 50 /* maximum # of queued frames allowed */ #define ATH_FF_STAGEMAX 5 /* max waiting period for staged frame*/ +struct taskqueue; +struct kthread; struct ath_buf; /* driver-specific node state */ @@ -193,6 +193,8 @@ 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 proc *sc_tqproc; /* thread handling sc_tq */ struct ath_hal *sc_ah; /* Atheros HAL */ struct ath_ratectrl *sc_rc; /* tx rate control support */ void (*sc_setdefantenna)(struct ath_softc *, u_int);home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200505031620.j43GKmYK052672>
