Allocate a descriptor ring for EDMA TX completion status.

Configure the hardware with said ring physical address and size.
This commit is contained in:
Adrian Chadd 2012-07-27 10:41:54 +00:00
parent d5a53d996c
commit ba3fd9d86a
2 changed files with 20 additions and 3 deletions

View File

@ -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);
}

View File

@ -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 */