if_ath_tx_edma.c (238930) | if_ath_tx_edma.c (238931) |
---|---|
1/*- 2 * Copyright (c) 2012 Adrian Chadd <adrian@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27 * THE POSSIBILITY OF SUCH DAMAGES. 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2012 Adrian Chadd <adrian@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27 * THE POSSIBILITY OF SUCH DAMAGES. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath_tx_edma.c 238930 2012-07-31 02:28:32Z adrian $"); | 31__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath_tx_edma.c 238931 2012-07-31 03:09:48Z adrian $"); |
32 33/* 34 * Driver for the Atheros Wireless LAN controller. 35 * 36 * This software is derived from work of Atsushi Onoe; his contribution 37 * is greatly appreciated. 38 */ 39 --- 210 unchanged lines hidden (view full) --- 250 for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { 251 ath_edma_free_txfifo(sc, i); 252 } 253 254 ath_descdma_cleanup(sc, &sc->sc_txsdma, NULL); 255 return (0); 256} 257 | 32 33/* 34 * Driver for the Atheros Wireless LAN controller. 35 * 36 * This software is derived from work of Atsushi Onoe; his contribution 37 * is greatly appreciated. 38 */ 39 --- 210 unchanged lines hidden (view full) --- 250 for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { 251 ath_edma_free_txfifo(sc, i); 252 } 253 254 ath_descdma_cleanup(sc, &sc->sc_txsdma, NULL); 255 return (0); 256} 257 |
258static int 259ath_edma_tx_processq(struct ath_softc *sc, struct ath_txq *txq, int dosched) 260{ 261 262 return (0); 263} 264 265static void 266ath_edma_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq) 267{ 268 269} 270 271static void 272ath_edma_tx_proc(void *arg, int npending) 273{ 274 struct ath_softc *sc = (struct ath_softc *) arg; 275 276 device_printf(sc->sc_dev, "%s: called, npending=%d\n", 277 __func__, npending); 278} 279 280static void 281ath_edma_attach_comp_func(struct ath_softc *sc) 282{ 283 284 TASK_INIT(&sc->sc_txtask, 0, ath_edma_tx_proc, sc); 285} 286 |
|
258void 259ath_xmit_setup_edma(struct ath_softc *sc) 260{ 261 262 /* Fetch EDMA field and buffer sizes */ 263 (void) ath_hal_gettxdesclen(sc->sc_ah, &sc->sc_tx_desclen); 264 (void) ath_hal_gettxstatuslen(sc->sc_ah, &sc->sc_tx_statuslen); 265 (void) ath_hal_getntxmaps(sc->sc_ah, &sc->sc_tx_nmaps); 266 267 device_printf(sc->sc_dev, "TX descriptor length: %d\n", 268 sc->sc_tx_desclen); 269 device_printf(sc->sc_dev, "TX status length: %d\n", 270 sc->sc_tx_statuslen); 271 device_printf(sc->sc_dev, "TX buffers per descriptor: %d\n", 272 sc->sc_tx_nmaps); 273 274 sc->sc_tx.xmit_setup = ath_edma_dma_txsetup; 275 sc->sc_tx.xmit_teardown = ath_edma_dma_txteardown; | 287void 288ath_xmit_setup_edma(struct ath_softc *sc) 289{ 290 291 /* Fetch EDMA field and buffer sizes */ 292 (void) ath_hal_gettxdesclen(sc->sc_ah, &sc->sc_tx_desclen); 293 (void) ath_hal_gettxstatuslen(sc->sc_ah, &sc->sc_tx_statuslen); 294 (void) ath_hal_getntxmaps(sc->sc_ah, &sc->sc_tx_nmaps); 295 296 device_printf(sc->sc_dev, "TX descriptor length: %d\n", 297 sc->sc_tx_desclen); 298 device_printf(sc->sc_dev, "TX status length: %d\n", 299 sc->sc_tx_statuslen); 300 device_printf(sc->sc_dev, "TX buffers per descriptor: %d\n", 301 sc->sc_tx_nmaps); 302 303 sc->sc_tx.xmit_setup = ath_edma_dma_txsetup; 304 sc->sc_tx.xmit_teardown = ath_edma_dma_txteardown; |
305 sc->sc_tx.xmit_attach_comp_func = ath_edma_attach_comp_func; |
|
276 277 sc->sc_tx.xmit_dma_restart = ath_edma_dma_restart; 278 sc->sc_tx.xmit_handoff = ath_edma_xmit_handoff; | 306 307 sc->sc_tx.xmit_dma_restart = ath_edma_dma_restart; 308 sc->sc_tx.xmit_handoff = ath_edma_xmit_handoff; |
309 sc->sc_tx.xmit_processq = ath_edma_tx_processq; 310 sc->sc_tx.xmit_drainq = ath_edma_tx_draintxq; |
|
279} | 311} |