svn commit: r238836 - head/sys/dev/ath
Adrian Chadd
adrian at FreeBSD.org
Fri Jul 27 10:41:55 UTC 2012
Author: adrian
Date: Fri Jul 27 10:41:54 2012
New Revision: 238836
URL: http://svn.freebsd.org/changeset/base/238836
Log:
Allocate a descriptor ring for EDMA TX completion status.
Configure the hardware with said ring physical address and size.
Modified:
head/sys/dev/ath/if_ath_tx_edma.c
head/sys/dev/ath/if_athvar.h
Modified: head/sys/dev/ath/if_ath_tx_edma.c
==============================================================================
--- head/sys/dev/ath/if_ath_tx_edma.c Fri Jul 27 10:41:53 2012 (r238835)
+++ head/sys/dev/ath/if_ath_tx_edma.c Fri Jul 27 10:41:54 2012 (r238836)
@@ -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);
}
Modified: head/sys/dev/ath/if_athvar.h
==============================================================================
--- head/sys/dev/ath/if_athvar.h Fri Jul 27 10:41:53 2012 (r238835)
+++ head/sys/dev/ath/if_athvar.h Fri Jul 27 10:41:54 2012 (r238836)
@@ -557,6 +557,7 @@ struct ath_softc {
int sc_txbuf_cnt; /* how many buffers avail */
struct ath_descdma sc_txdma_mgmt; /* mgmt TX descriptors */
ath_bufhead sc_txbuf_mgmt; /* mgmt transmit buffer */
+ struct ath_descdma sc_txsdma; /* EDMA TX status desc's */
struct mtx sc_txbuflock; /* txbuf lock */
char sc_txname[12]; /* e.g. "ath0_buf" */
u_int sc_txqsetup; /* h/w queues setup */
More information about the svn-src-all
mailing list