diff options
author | Vasanthakumar Thiagarajan <vasanth@atheros.com> | 2009-03-18 10:52:00 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-03-27 20:13:01 -0400 |
commit | 0934af2340caf3c9f247ae650bf0c6faa4203dba (patch) | |
tree | 03992c5c27f067ed21d6136339f9ce39cf7ef5c0 /drivers | |
parent | b3a902850a8f5bc11a660051faae707f928d4bd6 (diff) |
ath9k: Fix rate control update for aggregated frames
We will miss rate control update if first A-MPDU of an
aggregation is not Block Acked as we always tell if the
rate control needs to updated through update_rc of first
A-MPDU. This patch does rate control update for the first
A-MPDU which notifies it's tx status (which is not
necessarily the first A-MPDU of an aggregation) to mac80211.
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath9k/xmit.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c index 8968abe7f485..f2877193e958 100644 --- a/drivers/net/wireless/ath9k/xmit.c +++ b/drivers/net/wireless/ath9k/xmit.c | |||
@@ -64,6 +64,10 @@ static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf, | |||
64 | static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq, | 64 | static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq, |
65 | struct list_head *head); | 65 | struct list_head *head); |
66 | static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf); | 66 | static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf); |
67 | static int ath_tx_num_badfrms(struct ath_softc *sc, struct ath_buf *bf, | ||
68 | int txok); | ||
69 | static void ath_tx_rc_status(struct ath_buf *bf, struct ath_desc *ds, | ||
70 | int nbad, int txok); | ||
67 | 71 | ||
68 | /*********************/ | 72 | /*********************/ |
69 | /* Aggregation logic */ | 73 | /* Aggregation logic */ |
@@ -274,9 +278,10 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
274 | struct ath_buf *bf_next, *bf_last = bf->bf_lastbf; | 278 | struct ath_buf *bf_next, *bf_last = bf->bf_lastbf; |
275 | struct ath_desc *ds = bf_last->bf_desc; | 279 | struct ath_desc *ds = bf_last->bf_desc; |
276 | struct list_head bf_head, bf_pending; | 280 | struct list_head bf_head, bf_pending; |
277 | u16 seq_st = 0; | 281 | u16 seq_st = 0, acked_cnt = 0, txfail_cnt = 0; |
278 | u32 ba[WME_BA_BMP_SIZE >> 5]; | 282 | u32 ba[WME_BA_BMP_SIZE >> 5]; |
279 | int isaggr, txfail, txpending, sendbar = 0, needreset = 0; | 283 | int isaggr, txfail, txpending, sendbar = 0, needreset = 0, nbad = 0; |
284 | bool rc_update = true; | ||
280 | 285 | ||
281 | skb = (struct sk_buff *)bf->bf_mpdu; | 286 | skb = (struct sk_buff *)bf->bf_mpdu; |
282 | hdr = (struct ieee80211_hdr *)skb->data; | 287 | hdr = (struct ieee80211_hdr *)skb->data; |
@@ -316,6 +321,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
316 | INIT_LIST_HEAD(&bf_pending); | 321 | INIT_LIST_HEAD(&bf_pending); |
317 | INIT_LIST_HEAD(&bf_head); | 322 | INIT_LIST_HEAD(&bf_head); |
318 | 323 | ||
324 | nbad = ath_tx_num_badfrms(sc, bf, txok); | ||
319 | while (bf) { | 325 | while (bf) { |
320 | txfail = txpending = 0; | 326 | txfail = txpending = 0; |
321 | bf_next = bf->bf_next; | 327 | bf_next = bf->bf_next; |
@@ -323,8 +329,10 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
323 | if (ATH_BA_ISSET(ba, ATH_BA_INDEX(seq_st, bf->bf_seqno))) { | 329 | if (ATH_BA_ISSET(ba, ATH_BA_INDEX(seq_st, bf->bf_seqno))) { |
324 | /* transmit completion, subframe is | 330 | /* transmit completion, subframe is |
325 | * acked by block ack */ | 331 | * acked by block ack */ |
332 | acked_cnt++; | ||
326 | } else if (!isaggr && txok) { | 333 | } else if (!isaggr && txok) { |
327 | /* transmit completion */ | 334 | /* transmit completion */ |
335 | acked_cnt++; | ||
328 | } else { | 336 | } else { |
329 | if (!(tid->state & AGGR_CLEANUP) && | 337 | if (!(tid->state & AGGR_CLEANUP) && |
330 | ds->ds_txstat.ts_flags != ATH9K_TX_SW_ABORTED) { | 338 | ds->ds_txstat.ts_flags != ATH9K_TX_SW_ABORTED) { |
@@ -335,6 +343,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
335 | bf->bf_state.bf_type |= BUF_XRETRY; | 343 | bf->bf_state.bf_type |= BUF_XRETRY; |
336 | txfail = 1; | 344 | txfail = 1; |
337 | sendbar = 1; | 345 | sendbar = 1; |
346 | txfail_cnt++; | ||
338 | } | 347 | } |
339 | } else { | 348 | } else { |
340 | /* | 349 | /* |
@@ -361,6 +370,11 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
361 | ath_tx_update_baw(sc, tid, bf->bf_seqno); | 370 | ath_tx_update_baw(sc, tid, bf->bf_seqno); |
362 | spin_unlock_bh(&txq->axq_lock); | 371 | spin_unlock_bh(&txq->axq_lock); |
363 | 372 | ||
373 | if (rc_update) | ||
374 | if (acked_cnt == 1 || txfail_cnt == 1) { | ||
375 | ath_tx_rc_status(bf, ds, nbad, txok); | ||
376 | rc_update = false; | ||
377 | } | ||
364 | ath_tx_complete_buf(sc, bf, &bf_head, !txfail, sendbar); | 378 | ath_tx_complete_buf(sc, bf, &bf_head, !txfail, sendbar); |
365 | } else { | 379 | } else { |
366 | /* retry the un-acked ones */ | 380 | /* retry the un-acked ones */ |
@@ -1901,7 +1915,7 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq) | |||
1901 | struct ath_buf *bf, *lastbf, *bf_held = NULL; | 1915 | struct ath_buf *bf, *lastbf, *bf_held = NULL; |
1902 | struct list_head bf_head; | 1916 | struct list_head bf_head; |
1903 | struct ath_desc *ds; | 1917 | struct ath_desc *ds; |
1904 | int txok, nbad = 0; | 1918 | int txok; |
1905 | int status; | 1919 | int status; |
1906 | 1920 | ||
1907 | DPRINTF(sc, ATH_DBG_QUEUE, "tx queue %d (%x), link %p\n", | 1921 | DPRINTF(sc, ATH_DBG_QUEUE, "tx queue %d (%x), link %p\n", |
@@ -1995,13 +2009,9 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq) | |||
1995 | bf->bf_retries = ds->ds_txstat.ts_longretry; | 2009 | bf->bf_retries = ds->ds_txstat.ts_longretry; |
1996 | if (ds->ds_txstat.ts_status & ATH9K_TXERR_XRETRY) | 2010 | if (ds->ds_txstat.ts_status & ATH9K_TXERR_XRETRY) |
1997 | bf->bf_state.bf_type |= BUF_XRETRY; | 2011 | bf->bf_state.bf_type |= BUF_XRETRY; |
1998 | nbad = 0; | 2012 | ath_tx_rc_status(bf, ds, 0, txok); |
1999 | } else { | ||
2000 | nbad = ath_tx_num_badfrms(sc, bf, txok); | ||
2001 | } | 2013 | } |
2002 | 2014 | ||
2003 | ath_tx_rc_status(bf, ds, nbad, txok); | ||
2004 | |||
2005 | if (bf_isampdu(bf)) | 2015 | if (bf_isampdu(bf)) |
2006 | ath_tx_complete_aggr(sc, txq, bf, &bf_head, txok); | 2016 | ath_tx_complete_aggr(sc, txq, bf, &bf_head, txok); |
2007 | else | 2017 | else |