diff options
author | Benoit PAPILLAULT <benoit.papillault@free.fr> | 2009-08-17 12:56:10 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-20 11:36:02 -0400 |
commit | 92ed48e5230e8f5906dda0cc31715b3b7e3fe303 (patch) | |
tree | c7ae7801a11093fc57d5b603e9a78bc6c4979e27 /drivers/net/wireless/rt2x00/rt2x00dev.c | |
parent | cd80b684a08655e7dcc7a1c96d4b7e7ffa753017 (diff) |
rt2x00: Add support for retry rates
rt2800pci can handle different retry rates,
it will always step 1 rate down after a failed
transmission so creating the retry rate list
for mac80211 is quite simple.
Signed-off-by: Benoit PAPILLAULT <benoit.papillault@free.fr>
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/rt2x00dev.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index b6676c6722fc..9ab70e435b5d 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -220,7 +220,8 @@ void rt2x00lib_txdone(struct queue_entry *entry, | |||
220 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); | 220 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); |
221 | enum data_queue_qid qid = skb_get_queue_mapping(entry->skb); | 221 | enum data_queue_qid qid = skb_get_queue_mapping(entry->skb); |
222 | unsigned int header_length = ieee80211_get_hdrlen_from_skb(entry->skb); | 222 | unsigned int header_length = ieee80211_get_hdrlen_from_skb(entry->skb); |
223 | u8 rate_idx, rate_flags; | 223 | u8 rate_idx, rate_flags, retry_rates; |
224 | unsigned int i; | ||
224 | 225 | ||
225 | /* | 226 | /* |
226 | * Unmap the skb. | 227 | * Unmap the skb. |
@@ -259,16 +260,27 @@ void rt2x00lib_txdone(struct queue_entry *entry, | |||
259 | 260 | ||
260 | rate_idx = skbdesc->tx_rate_idx; | 261 | rate_idx = skbdesc->tx_rate_idx; |
261 | rate_flags = skbdesc->tx_rate_flags; | 262 | rate_flags = skbdesc->tx_rate_flags; |
263 | retry_rates = test_bit(TXDONE_FALLBACK, &txdesc->flags) ? | ||
264 | (txdesc->retry + 1) : 1; | ||
262 | 265 | ||
263 | /* | 266 | /* |
264 | * Initialize TX status | 267 | * Initialize TX status |
265 | */ | 268 | */ |
266 | memset(&tx_info->status, 0, sizeof(tx_info->status)); | 269 | memset(&tx_info->status, 0, sizeof(tx_info->status)); |
267 | tx_info->status.ack_signal = 0; | 270 | tx_info->status.ack_signal = 0; |
268 | tx_info->status.rates[0].idx = rate_idx; | 271 | |
269 | tx_info->status.rates[0].flags = rate_flags; | 272 | /* |
270 | tx_info->status.rates[0].count = txdesc->retry + 1; | 273 | * Frame was send with retries, hardware tried |
271 | tx_info->status.rates[1].idx = -1; /* terminate */ | 274 | * different rates to send out the frame, at each |
275 | * retry it lowered the rate 1 step. | ||
276 | */ | ||
277 | for (i = 0; i < retry_rates && i < IEEE80211_TX_MAX_RATES; i++) { | ||
278 | tx_info->status.rates[i].idx = rate_idx - i; | ||
279 | tx_info->status.rates[i].flags = rate_flags; | ||
280 | tx_info->status.rates[i].count = 1; | ||
281 | } | ||
282 | if (i < (IEEE80211_TX_MAX_RATES -1)) | ||
283 | tx_info->status.rates[i].idx = -1; /* terminate */ | ||
272 | 284 | ||
273 | if (!(tx_info->flags & IEEE80211_TX_CTL_NO_ACK)) { | 285 | if (!(tx_info->flags & IEEE80211_TX_CTL_NO_ACK)) { |
274 | if (test_bit(TXDONE_SUCCESS, &txdesc->flags) || | 286 | if (test_bit(TXDONE_SUCCESS, &txdesc->flags) || |