| 1 | --- a/drivers/net/wireless/ath/ath9k/xmit.c |
| 2 | +++ b/drivers/net/wireless/ath/ath9k/xmit.c |
| 3 | @@ -259,14 +259,17 @@ static void ath_tid_drain(struct ath_sof |
| 4 | } |
| 5 | |
| 6 | static void ath_tx_set_retry(struct ath_softc *sc, struct ath_txq *txq, |
| 7 | - struct sk_buff *skb) |
| 8 | + struct sk_buff *skb, int count) |
| 9 | { |
| 10 | struct ath_frame_info *fi = get_frame_info(skb); |
| 11 | struct ath_buf *bf = fi->bf; |
| 12 | struct ieee80211_hdr *hdr; |
| 13 | + int prev = fi->retries; |
| 14 | |
| 15 | TX_STAT_INC(txq->axq_qnum, a_retries); |
| 16 | - if (fi->retries++ > 0) |
| 17 | + fi->retries += count; |
| 18 | + |
| 19 | + if (prev > 0) |
| 20 | return; |
| 21 | |
| 22 | hdr = (struct ieee80211_hdr *)skb->data; |
| 23 | @@ -382,6 +385,7 @@ static void ath_tx_complete_aggr(struct |
| 24 | int nframes; |
| 25 | u8 tidno; |
| 26 | bool flush = !!(ts->ts_status & ATH9K_TX_FLUSH); |
| 27 | + int i, retries; |
| 28 | |
| 29 | skb = bf->bf_mpdu; |
| 30 | hdr = (struct ieee80211_hdr *)skb->data; |
| 31 | @@ -390,6 +394,10 @@ static void ath_tx_complete_aggr(struct |
| 32 | |
| 33 | memcpy(rates, tx_info->control.rates, sizeof(rates)); |
| 34 | |
| 35 | + retries = ts->ts_longretry + 1; |
| 36 | + for (i = 0; i < ts->ts_rateindex; i++) |
| 37 | + retries += rates[i].count; |
| 38 | + |
| 39 | rcu_read_lock(); |
| 40 | |
| 41 | sta = ieee80211_find_sta_by_ifaddr(hw, hdr->addr1, hdr->addr2); |
| 42 | @@ -476,7 +484,8 @@ static void ath_tx_complete_aggr(struct |
| 43 | txpending = 1; |
| 44 | } else if (fi->retries < ATH_MAX_SW_RETRIES) { |
| 45 | if (txok || !an->sleeping) |
| 46 | - ath_tx_set_retry(sc, txq, bf->bf_mpdu); |
| 47 | + ath_tx_set_retry(sc, txq, bf->bf_mpdu, |
| 48 | + retries); |
| 49 | |
| 50 | txpending = 1; |
| 51 | } else { |
| 52 | --- a/drivers/net/wireless/ath/ath9k/ath9k.h |
| 53 | +++ b/drivers/net/wireless/ath/ath9k/ath9k.h |
| 54 | @@ -542,7 +542,7 @@ struct ath_ant_comb { |
| 55 | #define DEFAULT_CACHELINE 32 |
| 56 | #define ATH_REGCLASSIDS_MAX 10 |
| 57 | #define ATH_CABQ_READY_TIME 80 /* % of beacon interval */ |
| 58 | -#define ATH_MAX_SW_RETRIES 10 |
| 59 | +#define ATH_MAX_SW_RETRIES 20 |
| 60 | #define ATH_CHAN_MAX 255 |
| 61 | |
| 62 | #define ATH_TXPOWER_MAX 100 /* .5 dBm units */ |
| 63 | |