diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-06-28 15:04:35 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-07-16 02:55:56 -0400 |
commit | 1cd158573951f737fbc878a35cb5eb47bf9af3d5 (patch) | |
tree | 6f50d58e5f88f69a0beafe092b13995b0bcd38f2 /net | |
parent | f77b86d7d3acf9dfcb5ee834628d12207584b2cb (diff) |
mac80211/minstrel_ht: fix cck rate sampling
The CCK group needs special treatment to set the right flags and rate
index. Add this missing check to prevent setting broken rates for tx
packets.
Cc: stable@vger.kernel.org # 3.10
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/rc80211_minstrel_ht.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index 5b2d3012b983..f5aed963b22e 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c | |||
@@ -804,10 +804,18 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, | |||
804 | 804 | ||
805 | sample_group = &minstrel_mcs_groups[sample_idx / MCS_GROUP_RATES]; | 805 | sample_group = &minstrel_mcs_groups[sample_idx / MCS_GROUP_RATES]; |
806 | info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE; | 806 | info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE; |
807 | rate->count = 1; | ||
808 | |||
809 | if (sample_idx / MCS_GROUP_RATES == MINSTREL_CCK_GROUP) { | ||
810 | int idx = sample_idx % ARRAY_SIZE(mp->cck_rates); | ||
811 | rate->idx = mp->cck_rates[idx]; | ||
812 | rate->flags = 0; | ||
813 | return; | ||
814 | } | ||
815 | |||
807 | rate->idx = sample_idx % MCS_GROUP_RATES + | 816 | rate->idx = sample_idx % MCS_GROUP_RATES + |
808 | (sample_group->streams - 1) * MCS_GROUP_RATES; | 817 | (sample_group->streams - 1) * MCS_GROUP_RATES; |
809 | rate->flags = IEEE80211_TX_RC_MCS | sample_group->flags; | 818 | rate->flags = IEEE80211_TX_RC_MCS | sample_group->flags; |
810 | rate->count = 1; | ||
811 | } | 819 | } |
812 | 820 | ||
813 | static void | 821 | static void |