aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00
diff options
context:
space:
mode:
authorHelmut Schaa <helmut.schaa@googlemail.com>2010-06-14 16:12:26 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-15 16:00:50 -0400
commit3d2bc1036a64bc015671283833430035f7dbbed0 (patch)
tree328aa6fd4f2c93f3c5512eedc4a1bb9b80249961 /drivers/net/wireless/rt2x00
parent3f2bee249926194313f7001bdfedb9c9634a48fc (diff)
rt2x00: Fix tx status reporting when falling back to the lowest rate
In some corner cases the reported tx rates/retries didn't match the really used ones. The hardware lowers the tx rate on each consecutive retry by 1 (but won't fall back from MCS to legacy rates) _until_ it reaches the lowest one. In case the frame wasn't sent succesful the number of retries is 7 and if a rate index <7 was used the previous code reported negative rate indexes which were then ignored by the rate control algorithm and mac80211. Instead, report the remaining number of retries to have happened with the lowest rate (index 0). This should give the rate control algorithm slightly more accurate information about the used tx rates/retries. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 8faee4c6f04b..339cc84bf4fb 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -258,11 +258,22 @@ void rt2x00lib_txdone(struct queue_entry *entry,
258 /* 258 /*
259 * Frame was send with retries, hardware tried 259 * Frame was send with retries, hardware tried
260 * different rates to send out the frame, at each 260 * different rates to send out the frame, at each
261 * retry it lowered the rate 1 step. 261 * retry it lowered the rate 1 step except when the
262 * lowest rate was used.
262 */ 263 */
263 for (i = 0; i < retry_rates && i < IEEE80211_TX_MAX_RATES; i++) { 264 for (i = 0; i < retry_rates && i < IEEE80211_TX_MAX_RATES; i++) {
264 tx_info->status.rates[i].idx = rate_idx - i; 265 tx_info->status.rates[i].idx = rate_idx - i;
265 tx_info->status.rates[i].flags = rate_flags; 266 tx_info->status.rates[i].flags = rate_flags;
267
268 if (rate_idx - i == 0) {
269 /*
270 * The lowest rate (index 0) was used until the
271 * number of max retries was reached.
272 */
273 tx_info->status.rates[i].count = retry_rates - i;
274 i++;
275 break;
276 }
266 tx_info->status.rates[i].count = 1; 277 tx_info->status.rates[i].count = 1;
267 } 278 }
268 if (i < (IEEE80211_TX_MAX_RATES - 1)) 279 if (i < (IEEE80211_TX_MAX_RATES - 1))