diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-06-01 15:33:13 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-06-03 14:14:41 -0400 |
commit | 84642d6bdde9164b7905fba03c0691a806788e0c (patch) | |
tree | c478140600fc9f0406c3911ce1421ffa3681a4f5 /drivers/net/wireless/ath/ath9k/ath9k.h | |
parent | 764580f577a46adce6ad6717a9b34aa8e3a09159 (diff) |
ath9k: fix queue stop/start based on the number of pending frames
Because there is a limited number of tx buffers available, once the
queue has been filled to a certain point, ath9k needs to stop accepting
new frames from mac80211. In order to prevent a full WMM queue from
stopping another queue with fewer frames, this patch limits the number
of queued frames to a quarter of the total available tx buffers, minus
some reserved frames to be used for other purposes (e.g. beacons).
Because tx buffers are reserved for frames when they're staged in
software queues as well, the actual queue depth cannot be used for
this, so this patch stores a reference to the tx queue in the ath_buf
struct and keeps track of the total number of pending frames.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ath9k.h')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ath9k.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index cc6ea4272fd..82aca4b6154 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -136,6 +136,8 @@ void ath_descdma_cleanup(struct ath_softc *sc, struct ath_descdma *dd, | |||
136 | #define ATH_MAX_ANTENNA 3 | 136 | #define ATH_MAX_ANTENNA 3 |
137 | #define ATH_RXBUF 512 | 137 | #define ATH_RXBUF 512 |
138 | #define ATH_TXBUF 512 | 138 | #define ATH_TXBUF 512 |
139 | #define ATH_TXBUF_RESERVE 5 | ||
140 | #define ATH_MAX_QDEPTH (ATH_TXBUF / 4 - ATH_TXBUF_RESERVE) | ||
139 | #define ATH_TXMAXTRY 13 | 141 | #define ATH_TXMAXTRY 13 |
140 | #define ATH_MGT_TXMAXTRY 4 | 142 | #define ATH_MGT_TXMAXTRY 4 |
141 | 143 | ||
@@ -204,6 +206,7 @@ struct ath_txq { | |||
204 | struct list_head txq_fifo_pending; | 206 | struct list_head txq_fifo_pending; |
205 | u8 txq_headidx; | 207 | u8 txq_headidx; |
206 | u8 txq_tailidx; | 208 | u8 txq_tailidx; |
209 | int pending_frames; | ||
207 | }; | 210 | }; |
208 | 211 | ||
209 | struct ath_atx_ac { | 212 | struct ath_atx_ac { |
@@ -241,6 +244,7 @@ struct ath_buf { | |||
241 | struct ath_buf_state bf_state; | 244 | struct ath_buf_state bf_state; |
242 | dma_addr_t bf_dmacontext; | 245 | dma_addr_t bf_dmacontext; |
243 | struct ath_wiphy *aphy; | 246 | struct ath_wiphy *aphy; |
247 | struct ath_txq *txq; | ||
244 | }; | 248 | }; |
245 | 249 | ||
246 | struct ath_atx_tid { | 250 | struct ath_atx_tid { |
@@ -330,7 +334,6 @@ void ath_tx_node_cleanup(struct ath_softc *sc, struct ath_node *an); | |||
330 | void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq); | 334 | void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq); |
331 | int ath_tx_init(struct ath_softc *sc, int nbufs); | 335 | int ath_tx_init(struct ath_softc *sc, int nbufs); |
332 | void ath_tx_cleanup(struct ath_softc *sc); | 336 | void ath_tx_cleanup(struct ath_softc *sc); |
333 | struct ath_txq *ath_test_get_txq(struct ath_softc *sc, struct sk_buff *skb); | ||
334 | int ath_txq_update(struct ath_softc *sc, int qnum, | 337 | int ath_txq_update(struct ath_softc *sc, int qnum, |
335 | struct ath9k_tx_queue_info *q); | 338 | struct ath9k_tx_queue_info *q); |
336 | int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb, | 339 | int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb, |