diff options
author | adrian <adrian@FreeBSD.org> | 2012-07-23 03:52:18 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2012-07-23 03:52:18 +0000 |
commit | c89f08ceb94c9b4838e31bffd45ddba9b0a0c36b (patch) | |
tree | 33a4d10c47a7d5285706d55a70926eeb452bc2e8 /sys/dev/ath/if_ath.c | |
parent | 505896c97a3490f7902842704e8724d0fccf9117 (diff) | |
download | FreeBSD-src-c89f08ceb94c9b4838e31bffd45ddba9b0a0c36b.zip FreeBSD-src-c89f08ceb94c9b4838e31bffd45ddba9b0a0c36b.tar.gz |
Begin separating out the TX DMA setup in preparation for TX EDMA support.
* Introduce TX DMA setup/teardown methods, mirroring what's done in
the RX path.
Although the TX DMA descriptor is setup via ath_desc_alloc() /
ath_desc_free(), there TX status descriptor ring will be allocated
in this path.
* Remove some of the TX EDMA capability probing from the RX path and
push it into the new TX EDMA path.
Diffstat (limited to 'sys/dev/ath/if_ath.c')
-rw-r--r-- | sys/dev/ath/if_ath.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 9217703..4b0bae8 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -109,6 +109,7 @@ __FBSDID("$FreeBSD$"); #include <dev/ath/if_ath_keycache.h> #include <dev/ath/if_ath_rx.h> #include <dev/ath/if_ath_rx_edma.h> +#include <dev/ath/if_ath_tx_edma.h> #include <dev/ath/if_ath_beacon.h> #include <dev/ath/if_athdfs.h> @@ -306,8 +307,11 @@ ath_attach(u_int16_t devid, struct ath_softc *sc) if (ath_hal_hasedma(sc->sc_ah)) { sc->sc_isedma = 1; ath_recv_setup_edma(sc); - } else + ath_xmit_setup_edma(sc); + } else { ath_recv_setup_legacy(sc); + ath_xmit_setup_legacy(sc); + } /* * Check if the MAC has multi-rate retry support. @@ -367,14 +371,24 @@ ath_attach(u_int16_t devid, struct ath_softc *sc) ath_setcurmode(sc, IEEE80211_MODE_11A); /* - * Allocate tx+rx descriptors and populate the lists. + * Allocate TX descriptors and populate the lists. */ error = ath_desc_alloc(sc); if (error != 0) { - if_printf(ifp, "failed to allocate descriptors: %d\n", error); + if_printf(ifp, "failed to allocate TX descriptors: %d\n", + error); + goto bad; + } + error = ath_txdma_setup(sc); + if (error != 0) { + if_printf(ifp, "failed to allocate TX descriptors: %d\n", + error); goto bad; } + /* + * Allocate RX descriptors and populate the lists. + */ error = ath_rxdma_setup(sc); if (error != 0) { if_printf(ifp, "failed to allocate RX descriptors: %d\n", @@ -858,6 +872,7 @@ ath_attach(u_int16_t devid, struct ath_softc *sc) bad2: ath_tx_cleanup(sc); ath_desc_free(sc); + ath_txdma_teardown(sc); ath_rxdma_teardown(sc); bad: if (ah) |