When assembling the descriptor list, make sure that the "first" descriptor

is marked correctly.

The existing logic assumed that the first descriptor is i == 0, which
doesn't hold for EDMA TX.  In this instance, the first time filltxdesc()
is called can be up to i == 3.

So for a two-buffer descriptor:

* firstSeg is set to 0;
* lastSeg is set to 1;
* the ath_hal_filltxdesc() code will treat it as the last segment in
  a descriptor chain and blank some of the descriptor fields, causing
  the TX to stop.

When firstSeg is set to 1 (regardless of lastSeg), it overrides the
lastSeg setting.  Thus, ath_hal_filltxdesc() won't blank out these
fields.

Tested: AR9380, STA mode.  With this, association is successful.
This commit is contained in:
Adrian Chadd 2012-08-19 02:16:22 +00:00
parent 5435dbc676
commit e2137b86d6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=239380

View File

@ -306,6 +306,7 @@ ath_tx_chaindesclist(struct ath_softc *sc, struct ath_buf *bf)
HAL_DMA_ADDR bufAddrList[4]; HAL_DMA_ADDR bufAddrList[4];
uint32_t segLenList[4]; uint32_t segLenList[4];
int numTxMaps = 1; int numTxMaps = 1;
int isFirstDesc = 1;
/* /*
* XXX There's txdma and txdma_mgmt; the descriptor * XXX There's txdma and txdma_mgmt; the descriptor
@ -369,10 +370,11 @@ ath_tx_chaindesclist(struct ath_softc *sc, struct ath_buf *bf)
, segLenList , segLenList
, bf->bf_descid /* XXX desc id */ , bf->bf_descid /* XXX desc id */
, bf->bf_state.bfs_txq->axq_qnum /* XXX multicast? */ , bf->bf_state.bfs_txq->axq_qnum /* XXX multicast? */
, i == 0 /* first segment */ , isFirstDesc /* first segment */
, i == bf->bf_nseg - 1 /* last segment */ , i == bf->bf_nseg - 1 /* last segment */
, ds0 /* first descriptor */ , ds0 /* first descriptor */
); );
isFirstDesc = 0;
DPRINTF(sc, ATH_DEBUG_XMIT, DPRINTF(sc, ATH_DEBUG_XMIT,
"%s: %d: %08x %08x %08x %08x %08x %08x\n", "%s: %d: %08x %08x %08x %08x %08x %08x\n",
__func__, i, ds->ds_link, ds->ds_data, __func__, i, ds->ds_link, ds->ds_data,