ath5k: fix tx status reporting
[openwrt/staging/yousong.git] / package / mac80211 / patches / 460-ath5k_fix_tx_status_reporting.patch
1 --- a/drivers/net/wireless/ath/ath5k/base.c
2 +++ b/drivers/net/wireless/ath/ath5k/base.c
3 @@ -1580,21 +1580,14 @@ ath5k_tx_frame_completed(struct ath5k_so
4 info = IEEE80211_SKB_CB(skb);
5
6 ieee80211_tx_info_clear_status(info);
7 - for (i = 0; i < 4; i++) {
8 + for (i = 0; i <= ts->ts_final_idx; i++) {
9 struct ieee80211_tx_rate *r =
10 &info->status.rates[i];
11
12 - if (ts->ts_rate[i]) {
13 - r->idx = ath5k_hw_to_driver_rix(sc, ts->ts_rate[i]);
14 - r->count = ts->ts_retry[i];
15 - } else {
16 - r->idx = -1;
17 - r->count = 0;
18 - }
19 + r->count = ts->ts_retry[i];
20 }
21
22 - /* count the successful attempt as well */
23 - info->status.rates[ts->ts_final_idx].count++;
24 + info->status.rates[ts->ts_final_idx + 1].idx = -1;
25
26 if (unlikely(ts->ts_status)) {
27 sc->stats.ack_fail++;
28 @@ -1609,6 +1602,9 @@ ath5k_tx_frame_completed(struct ath5k_so
29 } else {
30 info->flags |= IEEE80211_TX_STAT_ACK;
31 info->status.ack_signal = ts->ts_rssi;
32 +
33 + /* count the successful attempt as well */
34 + info->status.rates[ts->ts_final_idx].count++;
35 }
36
37 /*