diff options
author | Helmut Schaa <helmut.schaa@googlemail.com> | 2011-03-09 04:02:38 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-03-14 14:46:58 -0400 |
commit | cf28d7934c57168d530b606c26ab955a56eb13f9 (patch) | |
tree | 47cc3773eb539eb70722500863911d95570d409b /net/mac80211 | |
parent | 81266baf04ce80b088a7fa0dcf3b9f5e79023dd2 (diff) |
mac80211: Shortcut minstrel_ht rate setup for non-MRR capable devices
Devices without multi rate retry support won't be able to use all rates
as specified by mintrel_ht. Hence, we can simply skip setting up further
rates as the devices will only use the first one.
Also add a special case for devices with only two possible tx rates. We
use sample_rate -> max_prob_rate for sampling and max_tp_rate ->
max_prob_rate by default.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/rc80211_minstrel_ht.c | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index bce14fbfc3b6..8212a8bebf06 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c | |||
@@ -598,19 +598,46 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, | |||
598 | sample = true; | 598 | sample = true; |
599 | minstrel_ht_set_rate(mp, mi, &ar[0], sample_idx, | 599 | minstrel_ht_set_rate(mp, mi, &ar[0], sample_idx, |
600 | txrc, true, false); | 600 | txrc, true, false); |
601 | minstrel_ht_set_rate(mp, mi, &ar[1], mi->max_tp_rate, | ||
602 | txrc, false, false); | ||
603 | info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE; | 601 | info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE; |
604 | } else { | 602 | } else { |
605 | minstrel_ht_set_rate(mp, mi, &ar[0], mi->max_tp_rate, | 603 | minstrel_ht_set_rate(mp, mi, &ar[0], mi->max_tp_rate, |
606 | txrc, false, false); | 604 | txrc, false, false); |
607 | minstrel_ht_set_rate(mp, mi, &ar[1], mi->max_tp_rate2, | ||
608 | txrc, false, true); | ||
609 | } | 605 | } |
610 | minstrel_ht_set_rate(mp, mi, &ar[2], mi->max_prob_rate, txrc, false, !sample); | ||
611 | 606 | ||
612 | ar[3].count = 0; | 607 | if (mp->hw->max_rates >= 3) { |
613 | ar[3].idx = -1; | 608 | /* |
609 | * At least 3 tx rates supported, use | ||
610 | * sample_rate -> max_tp_rate -> max_prob_rate for sampling and | ||
611 | * max_tp_rate -> max_tp_rate2 -> max_prob_rate by default. | ||
612 | */ | ||
613 | if (sample_idx >= 0) | ||
614 | minstrel_ht_set_rate(mp, mi, &ar[1], mi->max_tp_rate, | ||
615 | txrc, false, false); | ||
616 | else | ||
617 | minstrel_ht_set_rate(mp, mi, &ar[1], mi->max_tp_rate2, | ||
618 | txrc, false, true); | ||
619 | |||
620 | minstrel_ht_set_rate(mp, mi, &ar[2], mi->max_prob_rate, | ||
621 | txrc, false, !sample); | ||
622 | |||
623 | ar[3].count = 0; | ||
624 | ar[3].idx = -1; | ||
625 | } else if (mp->hw->max_rates == 2) { | ||
626 | /* | ||
627 | * Only 2 tx rates supported, use | ||
628 | * sample_rate -> max_prob_rate for sampling and | ||
629 | * max_tp_rate -> max_prob_rate by default. | ||
630 | */ | ||
631 | minstrel_ht_set_rate(mp, mi, &ar[1], mi->max_prob_rate, | ||
632 | txrc, false, !sample); | ||
633 | |||
634 | ar[2].count = 0; | ||
635 | ar[2].idx = -1; | ||
636 | } else { | ||
637 | /* Not using MRR, only use the first rate */ | ||
638 | ar[1].count = 0; | ||
639 | ar[1].idx = -1; | ||
640 | } | ||
614 | 641 | ||
615 | mi->total_packets++; | 642 | mi->total_packets++; |
616 | 643 | ||