nuke special handling to extend cts when bursting; it was race prone

MFC after:	7 days
This commit is contained in:
sam 2005-11-15 05:49:02 +00:00
parent 0ad5382f77
commit e0af8384a5
3 changed files with 2 additions and 65 deletions

View File

@ -3114,13 +3114,6 @@ static int
ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf,
struct mbuf *m0)
{
#define CTS_DURATION \
ath_hal_computetxtime(ah, rt, IEEE80211_ACK_LEN, cix, AH_TRUE)
#define updateCTSForBursting(_ah, _ds, _txq) \
ath_hal_updateCTSForBursting(_ah, _ds, \
_txq->axq_linkbuf != NULL ? _txq->axq_linkbuf->bf_desc : NULL, \
_txq->axq_lastdsWithCTS, _txq->axq_gatingds, \
txopLimit, CTS_DURATION)
struct ieee80211com *ic = &sc->sc_ic;
struct ath_hal *ah = sc->sc_ah;
struct ifnet *ifp = sc->sc_ifp;
@ -3535,39 +3528,6 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf
* pass it on to the hardware.
*/
ATH_TXQ_LOCK(txq);
if (flags & (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA)) {
u_int32_t txopLimit = IEEE80211_TXOP_TO_US(
cap->cap_wmeParams[pri].wmep_txopLimit);
/*
* When bursting, potentially extend the CTS duration
* of a previously queued frame to cover this frame
* and not exceed the txopLimit. If that can be done
* then disable RTS/CTS on this frame since it's now
* covered (burst extension). Otherwise we must terminate
* the burst before this frame goes out so as not to
* violate the WME parameters. All this is complicated
* as we need to update the state of packets on the
* (live) hardware queue. The logic is buried in the hal
* because it's highly chip-specific.
*/
if (txopLimit != 0) {
sc->sc_stats.ast_tx_ctsburst++;
if (updateCTSForBursting(ah, ds0, txq) == 0) {
/*
* This frame was not covered by RTS/CTS from
* the previous frame in the burst; update the
* descriptor pointers so this frame is now
* treated as the last frame for extending a
* burst.
*/
txq->axq_lastdsWithCTS = ds0;
/* set gating Desc to final desc */
txq->axq_gatingds =
(struct ath_desc *)txq->axq_link;
} else
sc->sc_stats.ast_tx_ctsext++;
}
}
ATH_TXQ_INSERT_TAIL(txq, bf, bf_list);
if (txq->axq_link == NULL) {
ath_hal_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr);
@ -3592,8 +3552,6 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf
ATH_TXQ_UNLOCK(txq);
return 0;
#undef updateCTSForBursting
#undef CTS_DURATION
}
/*
@ -3635,10 +3593,6 @@ ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
ATH_TXQ_UNLOCK(txq);
break;
}
if (ds0 == txq->axq_lastdsWithCTS)
txq->axq_lastdsWithCTS = NULL;
if (ds == txq->axq_gatingds)
txq->axq_gatingds = NULL;
ATH_TXQ_REMOVE_HEAD(txq, bf_list);
ATH_TXQ_UNLOCK(txq);

View File

@ -75,8 +75,8 @@ struct ath_stats {
u_int32_t ast_tx_shortpre;/* tx frames with short preamble */
u_int32_t ast_tx_altrate; /* tx frames with alternate rate */
u_int32_t ast_tx_protect; /* tx frames with protection */
u_int32_t ast_tx_ctsburst;/* tx frames with cts and bursting */
u_int32_t ast_tx_ctsext; /* tx frames with cts extension */
u_int32_t ast_unused1;
u_int32_t ast_unused2;
u_int32_t ast_rx_nombuf; /* rx setup failed 'cuz no mbuf */
u_int32_t ast_rx_busdma; /* rx setup failed for dma resrcs */
u_int32_t ast_rx_orn; /* rx failed 'cuz of desc overrun */

View File

@ -140,19 +140,6 @@ struct ath_txq {
u_int32_t *axq_link; /* link ptr in last TX desc */
STAILQ_HEAD(, ath_buf) axq_q; /* transmit queue */
struct mtx axq_lock; /* lock on q and link */
/*
* State for patching up CTS when bursting.
*/
struct ath_buf *axq_linkbuf; /* va of last buffer */
struct ath_desc *axq_lastdsWithCTS;
/* first desc of last descriptor
* that contains CTS
*/
struct ath_desc *axq_gatingds; /* final desc of the gating desc
* that determines whether
* lastdsWithCTS has been DMA'ed
* or not
*/
};
#define ATH_TXQ_LOCK_INIT(_sc, _tq) \
@ -512,10 +499,6 @@ void ath_intr(void *);
((*(_ah)->ah_fillTxDesc)((_ah), (_ds), (_l), (_first), (_last), (_ds0)))
#define ath_hal_txprocdesc(_ah, _ds) \
((*(_ah)->ah_procTxDesc)((_ah), (_ds)))
#define ath_hal_updateCTSForBursting(_ah, _ds, _prevds, _prevdsWithCTS, \
_gatingds, _txOpLimit, _ctsDuration) \
((*(_ah)->ah_updateCTSForBursting)((_ah), (_ds), (_prevds), \
(_prevdsWithCTS), (_gatingds), (_txOpLimit), (_ctsDuration)))
#define ath_hal_gpioCfgOutput(_ah, _gpio) \
((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio)))