aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00
diff options
context:
space:
mode:
authorBenoit PAPILLAULT <benoit.papillault@free.fr>2009-08-17 12:56:10 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-20 11:36:02 -0400
commit92ed48e5230e8f5906dda0cc31715b3b7e3fe303 (patch)
treec7ae7801a11093fc57d5b603e9a78bc6c4979e27 /drivers/net/wireless/rt2x00
parentcd80b684a08655e7dcc7a1c96d4b7e7ffa753017 (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')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c22
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.h2
2 files changed, 19 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) ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h
index 47d175a13790..a5591fb2b191 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.h
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.h
@@ -214,6 +214,7 @@ struct rxdone_entry_desc {
214 * 214 *
215 * @TXDONE_UNKNOWN: Hardware could not determine success of transmission. 215 * @TXDONE_UNKNOWN: Hardware could not determine success of transmission.
216 * @TXDONE_SUCCESS: Frame was successfully send 216 * @TXDONE_SUCCESS: Frame was successfully send
217 * @TXDONE_FALLBACK: Frame was successfully send using a fallback rate.
217 * @TXDONE_FAILURE: Frame was not successfully send 218 * @TXDONE_FAILURE: Frame was not successfully send
218 * @TXDONE_EXCESSIVE_RETRY: In addition to &TXDONE_FAILURE, the 219 * @TXDONE_EXCESSIVE_RETRY: In addition to &TXDONE_FAILURE, the
219 * frame transmission failed due to excessive retries. 220 * frame transmission failed due to excessive retries.
@@ -221,6 +222,7 @@ struct rxdone_entry_desc {
221enum txdone_entry_desc_flags { 222enum txdone_entry_desc_flags {
222 TXDONE_UNKNOWN, 223 TXDONE_UNKNOWN,
223 TXDONE_SUCCESS, 224 TXDONE_SUCCESS,
225 TXDONE_FALLBACK,
224 TXDONE_FAILURE, 226 TXDONE_FAILURE,
225 TXDONE_EXCESSIVE_RETRY, 227 TXDONE_EXCESSIVE_RETRY,
226}; 228};