aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ath/if_ath.c
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2012-07-23 23:40:13 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2012-07-23 23:40:13 +0000
commit1006fc0c3bc4da106121abe5ddc72c1b57c6360b (patch)
treeee595f54ee113486a7fca35a2bbc3fe116ece1b0 /sys/dev/ath/if_ath.c
parent8a489dc248c293cc42ed70806225a02376af3f65 (diff)
downloadsrc-1006fc0c3bc4da106121abe5ddc72c1b57c6360b.tar.gz
src-1006fc0c3bc4da106121abe5ddc72c1b57c6360b.zip
Modify ath_descdma_setup() to take a descriptor size parameter.
The AR9300 and later descriptors are 128 bytes, however I'd like to make sure that isn't used for earlier chips. * Populate the TX descriptor length field in the softc with sizeof(ath_desc) * Use this field when allocating the TX descriptors * Pre-AR93xx TX/RX descriptors will use the ath_desc size; newer ones will query the HAL for these sizes.
Notes
Notes: svn path=/head/; revision=238729
Diffstat (limited to 'sys/dev/ath/if_ath.c')
-rw-r--r--sys/dev/ath/if_ath.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 4b0bae86540a..3f831d85a29d 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -2767,7 +2767,7 @@ ath_load_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
int
ath_descdma_setup(struct ath_softc *sc,
struct ath_descdma *dd, ath_bufhead *head,
- const char *name, int nbuf, int ndesc)
+ const char *name, int ds_size, int nbuf, int ndesc)
{
#define DS2PHYS(_dd, _ds) \
((_dd)->dd_desc_paddr + ((caddr_t)(_ds) - (caddr_t)(_dd)->dd_desc))
@@ -2778,7 +2778,7 @@ ath_descdma_setup(struct ath_softc *sc,
struct ath_buf *bf;
int i, bsize, error;
- dd->dd_descsize = sizeof(struct ath_desc);
+ dd->dd_descsize = ds_size;
DPRINTF(sc, ATH_DEBUG_RESET,
"%s: %s DMA: %u buffers %u desc/buf, %d bytes per descriptor\n",
@@ -3010,14 +3010,15 @@ ath_desc_alloc(struct ath_softc *sc)
int error;
error = ath_descdma_setup(sc, &sc->sc_txdma, &sc->sc_txbuf,
- "tx", ath_txbuf, ATH_TXDESC);
+ "tx", sc->sc_tx_desclen, ath_txbuf, ATH_TXDESC);
if (error != 0) {
return error;
}
sc->sc_txbuf_cnt = ath_txbuf;
error = ath_descdma_setup(sc, &sc->sc_txdma_mgmt, &sc->sc_txbuf_mgmt,
- "tx_mgmt", ath_txbuf_mgmt, ATH_TXDESC);
+ "tx_mgmt", sc->sc_tx_desclen, ath_txbuf_mgmt,
+ ATH_TXDESC);
if (error != 0) {
ath_descdma_cleanup(sc, &sc->sc_txdma, &sc->sc_txbuf);
return error;
@@ -3029,7 +3030,7 @@ ath_desc_alloc(struct ath_softc *sc)
*/
error = ath_descdma_setup(sc, &sc->sc_bdma, &sc->sc_bbuf,
- "beacon", ATH_BCBUF, 1);
+ "beacon", sc->sc_tx_desclen, ATH_BCBUF, 1);
if (error != 0) {
ath_descdma_cleanup(sc, &sc->sc_txdma, &sc->sc_txbuf);
ath_descdma_cleanup(sc, &sc->sc_txdma_mgmt,