1 --- a/drivers/net/wireless/ath/ath5k/ath5k.h
2 +++ b/drivers/net/wireless/ath/ath5k/ath5k.h
3 @@ -452,11 +452,10 @@ struct ath5k_tx_status {
16 --- a/drivers/net/wireless/ath/ath5k/base.c
17 +++ b/drivers/net/wireless/ath/ath5k/base.c
18 @@ -1573,20 +1573,27 @@ ath5k_tx_frame_completed(struct ath5k_so
19 struct ath5k_txq *txq, struct ath5k_tx_status *ts)
21 struct ieee80211_tx_info *info;
25 sc->stats.tx_all_count++;
26 sc->stats.tx_bytes_count += skb->len;
27 info = IEEE80211_SKB_CB(skb);
29 + tries[0] = info->status.rates[0].count;
30 + tries[1] = info->status.rates[1].count;
31 + tries[2] = info->status.rates[2].count;
33 ieee80211_tx_info_clear_status(info);
34 - for (i = 0; i <= ts->ts_final_idx; i++) {
36 + for (i = 0; i < ts->ts_final_idx; i++) {
37 struct ieee80211_tx_rate *r =
38 &info->status.rates[i];
40 - r->count = ts->ts_retry[i];
41 + r->count = tries[i];
44 + info->status.rates[ts->ts_final_idx].count = ts->ts_final_retry;
45 info->status.rates[ts->ts_final_idx + 1].idx = -1;
47 if (unlikely(ts->ts_status)) {
48 --- a/drivers/net/wireless/ath/ath5k/desc.c
49 +++ b/drivers/net/wireless/ath/ath5k/desc.c
50 @@ -366,7 +366,7 @@ static int ath5k_hw_proc_2word_tx_status
51 AR5K_DESC_TX_STATUS0_SEND_TIMESTAMP);
52 ts->ts_shortretry = AR5K_REG_MS(tx_status->tx_status_0,
53 AR5K_DESC_TX_STATUS0_SHORT_RETRY_COUNT);
54 - ts->ts_longretry = AR5K_REG_MS(tx_status->tx_status_0,
55 + ts->ts_final_retry = AR5K_REG_MS(tx_status->tx_status_0,
56 AR5K_DESC_TX_STATUS0_LONG_RETRY_COUNT);
57 /*TODO: ts->ts_virtcol + test*/
58 ts->ts_seqnum = AR5K_REG_MS(tx_status->tx_status_1,
59 @@ -375,7 +375,6 @@ static int ath5k_hw_proc_2word_tx_status
60 AR5K_DESC_TX_STATUS1_ACK_SIG_STRENGTH);
63 - ts->ts_retry[0] = ts->ts_longretry;
66 if (!(tx_status->tx_status_0 & AR5K_DESC_TX_STATUS0_FRAME_XMIT_OK)) {
67 @@ -401,7 +400,7 @@ static int ath5k_hw_proc_4word_tx_status
69 struct ath5k_hw_4w_tx_ctl *tx_ctl;
70 struct ath5k_hw_tx_status *tx_status;
71 - u32 txstat0, txstat1, txctl2;
72 + u32 txstat0, txstat1;
74 tx_ctl = &desc->ud.ds_tx5212.tx_ctl;
75 tx_status = &desc->ud.ds_tx5212.tx_stat;
76 @@ -413,7 +412,6 @@ static int ath5k_hw_proc_4word_tx_status
79 txstat0 = ACCESS_ONCE(tx_status->tx_status_0);
80 - txctl2 = ACCESS_ONCE(tx_ctl->tx_control_2);
83 * Get descriptor status
84 @@ -422,7 +420,7 @@ static int ath5k_hw_proc_4word_tx_status
85 AR5K_DESC_TX_STATUS0_SEND_TIMESTAMP);
86 ts->ts_shortretry = AR5K_REG_MS(txstat0,
87 AR5K_DESC_TX_STATUS0_SHORT_RETRY_COUNT);
88 - ts->ts_longretry = AR5K_REG_MS(txstat0,
89 + ts->ts_final_retry = AR5K_REG_MS(txstat0,
90 AR5K_DESC_TX_STATUS0_LONG_RETRY_COUNT);
91 ts->ts_seqnum = AR5K_REG_MS(txstat1,
92 AR5K_DESC_TX_STATUS1_SEQ_NUM);
93 @@ -435,32 +433,6 @@ static int ath5k_hw_proc_4word_tx_status
94 ts->ts_final_idx = AR5K_REG_MS(txstat1,
95 AR5K_DESC_TX_STATUS1_FINAL_TS_IX_5212);
97 - /* The longretry counter has the number of un-acked retries
98 - * for the final rate. To get the total number of retries
99 - * we have to add the retry counters for the other rates
102 - ts->ts_retry[ts->ts_final_idx] = ts->ts_longretry;
103 - switch (ts->ts_final_idx) {
105 - ts->ts_retry[2] = AR5K_REG_MS(txctl2,
106 - AR5K_4W_TX_DESC_CTL2_XMIT_TRIES2);
107 - ts->ts_longretry += ts->ts_retry[2];
110 - ts->ts_retry[1] = AR5K_REG_MS(txctl2,
111 - AR5K_4W_TX_DESC_CTL2_XMIT_TRIES1);
112 - ts->ts_longretry += ts->ts_retry[1];
115 - ts->ts_retry[0] = AR5K_REG_MS(txctl2,
116 - AR5K_4W_TX_DESC_CTL2_XMIT_TRIES1);
117 - ts->ts_longretry += ts->ts_retry[0];
124 if (!(txstat0 & AR5K_DESC_TX_STATUS0_FRAME_XMIT_OK)) {
125 if (txstat0 & AR5K_DESC_TX_STATUS0_EXCESSIVE_RETRIES)