Migrate the 802.11n ath_hal_chaintxdesc() API to use a buffer/segment
array, similar to what filltxdesc() uses. This removes the last reference to ds_data in the TX path outside of debugging statements. These need to be adjusted/fixed. Tested: * AR9280 STA/AP with iperf TCP traffic
This commit is contained in:
parent
f3596e49d4
commit
8624d30ccc
@ -1227,8 +1227,11 @@ struct ath_hal {
|
||||
|
||||
/* 802.11n Functions */
|
||||
HAL_BOOL __ahdecl(*ah_chainTxDesc)(struct ath_hal *,
|
||||
struct ath_desc *, u_int, u_int, HAL_PKT_TYPE,
|
||||
u_int, HAL_CIPHER, uint8_t, u_int, HAL_BOOL,
|
||||
struct ath_desc *,
|
||||
HAL_DMA_ADDR *bufAddrList,
|
||||
uint32_t *segLenList,
|
||||
u_int, u_int, HAL_PKT_TYPE,
|
||||
u_int, HAL_CIPHER, uint8_t, HAL_BOOL,
|
||||
HAL_BOOL, HAL_BOOL);
|
||||
HAL_BOOL __ahdecl(*ah_setupFirstTxDesc)(struct ath_hal *,
|
||||
struct ath_desc *, u_int, u_int, u_int,
|
||||
|
@ -373,8 +373,9 @@ extern int ar5416SetupTxQueue(struct ath_hal *ah, HAL_TX_QUEUE type,
|
||||
const HAL_TXQ_INFO *qInfo);
|
||||
|
||||
extern HAL_BOOL ar5416ChainTxDesc(struct ath_hal *ah, struct ath_desc *ds,
|
||||
HAL_DMA_ADDR *bufAddrList, uint32_t *segLenList,
|
||||
u_int pktLen, u_int hdrLen, HAL_PKT_TYPE type, u_int keyIx,
|
||||
HAL_CIPHER cipher, uint8_t delims, u_int segLen,
|
||||
HAL_CIPHER cipher, uint8_t delims,
|
||||
HAL_BOOL firstSeg, HAL_BOOL lastSeg, HAL_BOOL lastAggr);
|
||||
extern HAL_BOOL ar5416SetupFirstTxDesc(struct ath_hal *ah, struct ath_desc *ds,
|
||||
u_int aggrLen, u_int flags, u_int txPower, u_int txRate0, u_int txTries0,
|
||||
|
@ -335,13 +335,14 @@ ar5416FillTxDesc(struct ath_hal *ah, struct ath_desc *ds,
|
||||
*/
|
||||
HAL_BOOL
|
||||
ar5416ChainTxDesc(struct ath_hal *ah, struct ath_desc *ds,
|
||||
HAL_DMA_ADDR *bufAddrList,
|
||||
uint32_t *segLenList,
|
||||
u_int pktLen,
|
||||
u_int hdrLen,
|
||||
HAL_PKT_TYPE type,
|
||||
u_int keyIx,
|
||||
HAL_CIPHER cipher,
|
||||
uint8_t delims,
|
||||
u_int segLen,
|
||||
HAL_BOOL firstSeg,
|
||||
HAL_BOOL lastSeg,
|
||||
HAL_BOOL lastAggr)
|
||||
@ -349,6 +350,7 @@ ar5416ChainTxDesc(struct ath_hal *ah, struct ath_desc *ds,
|
||||
struct ar5416_desc *ads = AR5416DESC(ds);
|
||||
uint32_t *ds_txstatus = AR5416_DS_TXSTATUS(ah,ads);
|
||||
struct ath_hal_5416 *ahp = AH5416(ah);
|
||||
u_int segLen = segLenList[0];
|
||||
|
||||
int isaggr = 0;
|
||||
uint32_t last_aggr = 0;
|
||||
@ -357,6 +359,7 @@ ar5416ChainTxDesc(struct ath_hal *ah, struct ath_desc *ds,
|
||||
(void) ah;
|
||||
|
||||
HALASSERT((segLen &~ AR_BufLen) == 0);
|
||||
ds->ds_data = bufAddrList[0];
|
||||
|
||||
HALASSERT(isValidPktType(type));
|
||||
if (type == HAL_PKT_TYPE_AMPDU) {
|
||||
|
@ -365,6 +365,9 @@ ath_tx_chaindesclist_subframe(struct ath_softc *sc, struct ath_buf *bf)
|
||||
struct ath_hal *ah = sc->sc_ah;
|
||||
struct ath_desc *ds, *ds0;
|
||||
int i;
|
||||
HAL_DMA_ADDR bufAddrList[4];
|
||||
uint32_t segLenList[4];
|
||||
|
||||
/*
|
||||
* XXX There's txdma and txdma_mgmt; the descriptor
|
||||
* sizes must match.
|
||||
@ -378,25 +381,30 @@ ath_tx_chaindesclist_subframe(struct ath_softc *sc, struct ath_buf *bf)
|
||||
* That's only going to occur for the first frame in an aggregate.
|
||||
*/
|
||||
for (i = 0; i < bf->bf_nseg; i++, ds++) {
|
||||
ds->ds_data = bf->bf_segs[i].ds_addr;
|
||||
bzero(bufAddrList, sizeof(bufAddrList));
|
||||
bzero(segLenList, sizeof(segLenList));
|
||||
if (i == bf->bf_nseg - 1)
|
||||
ath_hal_settxdesclink(ah, ds, 0);
|
||||
else
|
||||
ath_hal_settxdesclink(ah, ds,
|
||||
bf->bf_daddr + dd->dd_descsize * (i + 1));
|
||||
|
||||
bufAddrList[0] = bf->bf_segs[i].ds_addr;
|
||||
segLenList[0] = bf->bf_segs[i].ds_len;
|
||||
|
||||
/*
|
||||
* This performs the setup for an aggregate frame.
|
||||
* This includes enabling the aggregate flags if needed.
|
||||
*/
|
||||
ath_hal_chaintxdesc(ah, ds,
|
||||
bufAddrList,
|
||||
segLenList,
|
||||
bf->bf_state.bfs_pktlen,
|
||||
bf->bf_state.bfs_hdrlen,
|
||||
HAL_PKT_TYPE_AMPDU, /* forces aggregate bits to be set */
|
||||
bf->bf_state.bfs_keyix,
|
||||
0, /* cipher, calculated from keyix */
|
||||
bf->bf_state.bfs_ndelim,
|
||||
bf->bf_segs[i].ds_len, /* segment length */
|
||||
i == 0, /* first segment */
|
||||
i == bf->bf_nseg - 1, /* last segment */
|
||||
bf->bf_next == NULL /* last sub-frame in aggr */
|
||||
|
@ -1130,10 +1130,10 @@ void ath_intr(void *);
|
||||
_txr0, _txtr0, _antm, _rcr, _rcd) \
|
||||
((*(_ah)->ah_setupFirstTxDesc)((_ah), (_ds), (_aggrlen), (_flags), \
|
||||
(_txpower), (_txr0), (_txtr0), (_antm), (_rcr), (_rcd)))
|
||||
#define ath_hal_chaintxdesc(_ah, _ds, _pktlen, _hdrlen, _type, _keyix, \
|
||||
_cipher, _delims, _seglen, _first, _last, _lastaggr) \
|
||||
((*(_ah)->ah_chainTxDesc)((_ah), (_ds), (_pktlen), (_hdrlen), \
|
||||
(_type), (_keyix), (_cipher), (_delims), (_seglen), \
|
||||
#define ath_hal_chaintxdesc(_ah, _ds, _bl, _sl, _pktlen, _hdrlen, _type, \
|
||||
_keyix, _cipher, _delims, _first, _last, _lastaggr) \
|
||||
((*(_ah)->ah_chainTxDesc)((_ah), (_ds), (_bl), (_sl), \
|
||||
(_pktlen), (_hdrlen), (_type), (_keyix), (_cipher), (_delims), \
|
||||
(_first), (_last), (_lastaggr)))
|
||||
#define ath_hal_setuplasttxdesc(_ah, _ds, _ds0) \
|
||||
((*(_ah)->ah_setupLastTxDesc)((_ah), (_ds), (_ds0)))
|
||||
|
Loading…
Reference in New Issue
Block a user