aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/tx.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2008-10-05 12:04:24 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-10-06 18:14:57 -0400
commit870abdf67170daa9f1022e55a35c469239fcc74c (patch)
tree5ca00db880d71149eea2cdaeb67ed20f5281071d /net/mac80211/tx.c
parent76708dee382a69b2f9d0e50f413f99fefb2dc509 (diff)
mac80211: add multi-rate retry support
This patch adjusts the rate control API to allow multi-rate retry if supported by the driver. The ieee80211_hw struct specifies how many alternate rate selections the driver supports. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r--net/mac80211/tx.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index d7153bbcdb2b..1460537faf33 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -454,15 +454,16 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
454 if (unlikely(rsel.probe_idx >= 0)) { 454 if (unlikely(rsel.probe_idx >= 0)) {
455 info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE; 455 info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE;
456 tx->flags |= IEEE80211_TX_PROBE_LAST_FRAG; 456 tx->flags |= IEEE80211_TX_PROBE_LAST_FRAG;
457 info->control.alt_retry_rate_idx = tx->rate_idx; 457 info->control.retries[0].rate_idx = tx->rate_idx;
458 info->control.retries[0].limit = tx->local->hw.max_altrate_tries;
458 tx->rate_idx = rsel.probe_idx; 459 tx->rate_idx = rsel.probe_idx;
459 } else 460 } else if (info->control.retries[0].limit == 0)
460 info->control.alt_retry_rate_idx = -1; 461 info->control.retries[0].rate_idx = -1;
461 462
462 if (unlikely(tx->rate_idx < 0)) 463 if (unlikely(tx->rate_idx < 0))
463 return TX_DROP; 464 return TX_DROP;
464 } else 465 } else
465 info->control.alt_retry_rate_idx = -1; 466 info->control.retries[0].rate_idx = -1;
466 467
467 if (tx->sdata->bss_conf.use_cts_prot && 468 if (tx->sdata->bss_conf.use_cts_prot &&
468 (tx->flags & IEEE80211_TX_FRAGMENTED) && (rsel.nonerp_idx >= 0)) { 469 (tx->flags & IEEE80211_TX_FRAGMENTED) && (rsel.nonerp_idx >= 0)) {
@@ -521,7 +522,7 @@ ieee80211_tx_h_misc(struct ieee80211_tx_data *tx)
521 * frames. 522 * frames.
522 * TODO: The last fragment could still use multiple retry 523 * TODO: The last fragment could still use multiple retry
523 * rates. */ 524 * rates. */
524 info->control.alt_retry_rate_idx = -1; 525 info->control.retries[0].rate_idx = -1;
525 } 526 }
526 527
527 /* Use CTS protection for unicast frames sent using extended rates if 528 /* Use CTS protection for unicast frames sent using extended rates if
@@ -551,7 +552,7 @@ ieee80211_tx_h_misc(struct ieee80211_tx_data *tx)
551 int idx; 552 int idx;
552 553
553 /* Do not use multiple retry rates when using RTS/CTS */ 554 /* Do not use multiple retry rates when using RTS/CTS */
554 info->control.alt_retry_rate_idx = -1; 555 info->control.retries[0].rate_idx = -1;
555 556
556 /* Use min(data rate, max base rate) as CTS/RTS rate */ 557 /* Use min(data rate, max base rate) as CTS/RTS rate */
557 rate = &sband->bitrates[tx->rate_idx]; 558 rate = &sband->bitrates[tx->rate_idx];