summaryrefslogtreecommitdiffstats
path: root/sys/dev/ath/if_ath_tx_edma.c
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2012-07-27 10:41:54 +0000
committeradrian <adrian@FreeBSD.org>2012-07-27 10:41:54 +0000
commit99b2311120477843dccf7372aac20a2f112f929a (patch)
tree0935af903c4496b35497003dd742e4d1ac95defe /sys/dev/ath/if_ath_tx_edma.c
parent4e7839007ab707452aab4262d6fee9846bb28767 (diff)
downloadFreeBSD-src-99b2311120477843dccf7372aac20a2f112f929a.zip
FreeBSD-src-99b2311120477843dccf7372aac20a2f112f929a.tar.gz
Allocate a descriptor ring for EDMA TX completion status.
Configure the hardware with said ring physical address and size.
Diffstat (limited to 'sys/dev/ath/if_ath_tx_edma.c')
-rw-r--r--sys/dev/ath/if_ath_tx_edma.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/sys/dev/ath/if_ath_tx_edma.c b/sys/dev/ath/if_ath_tx_edma.c
index c5db404..c4dc384 100644
--- a/sys/dev/ath/if_ath_tx_edma.c
+++ b/sys/dev/ath/if_ath_tx_edma.c
@@ -119,17 +119,33 @@ __FBSDID("$FreeBSD$");
/*
* some general macros
- */
+ */
#define INCR(_l, _sz) (_l) ++; (_l) &= ((_sz) - 1)
#define DECR(_l, _sz) (_l) --; (_l) &= ((_sz) - 1)
+/*
+ * XXX doesn't belong here, and should be tunable
+ */
+#define ATH_TXSTATUS_RING_SIZE 512
+
MALLOC_DECLARE(M_ATHDEV);
static int
ath_edma_dma_txsetup(struct ath_softc *sc)
{
+ int error;
+
+ error = ath_descdma_alloc_desc(sc, &sc->sc_txsdma,
+ NULL, "txcomp", sc->sc_tx_statuslen, ATH_TXSTATUS_RING_SIZE);
+ if (error != 0)
+ return (error);
+
+ ath_hal_setuptxstatusring(sc->sc_ah,
+ (void *) sc->sc_txsdma.dd_desc,
+ sc->sc_txsdma.dd_desc_paddr,
+ ATH_TXSTATUS_RING_SIZE);
+
- /* XXX placeholder */
return (0);
}
@@ -137,7 +153,7 @@ static int
ath_edma_dma_txteardown(struct ath_softc *sc)
{
- /* XXX placeholder */
+ ath_descdma_cleanup(sc, &sc->sc_txsdma, NULL);
return (0);
}
OpenPOWER on IntegriCloud