From de66ac442771d3213779bb78922e51481bcc9d46 Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Tue, 15 Nov 2005 05:49:02 +0000 Subject: [PATCH] nuke special handling to extend cts when bursting; it was race prone MFC after: 7 days --- sys/dev/ath/if_ath.c | 46 --------------------------------------- sys/dev/ath/if_athioctl.h | 4 ++-- sys/dev/ath/if_athvar.h | 17 --------------- 3 files changed, 2 insertions(+), 65 deletions(-) diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 0b545168729..6e92a0592d2 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -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); diff --git a/sys/dev/ath/if_athioctl.h b/sys/dev/ath/if_athioctl.h index 3e7ec733fa4..7eb2cea80d8 100644 --- a/sys/dev/ath/if_athioctl.h +++ b/sys/dev/ath/if_athioctl.h @@ -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 */ diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h index 21c319e76f3..f62864505fa 100644 --- a/sys/dev/ath/if_athvar.h +++ b/sys/dev/ath/if_athvar.h @@ -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))) -- 2.45.2