diff options
author | Karl Beldan <karl.beldan@rivierawaves.com> | 2013-11-11 07:12:55 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-11-25 14:52:07 -0500 |
commit | 7a5e3fa2c81ca2fdc514c61ad90fb4e0b632258c (patch) | |
tree | e4e0d206aa23783104eff8f52a00bfb06835fd04 /net/mac80211/rc80211_minstrel_ht.c | |
parent | 21f659bf1f93f7052b977d95cca560f02dc2edce (diff) |
mac80211: minstrel_ht: replace some occurences of MCS_GROUP_RATES
Consecutive MCSes in [8*(NSS-1)->8*NSS[ have the same number NSS of
streams (except for MCS32 which is mishandled ATM).
ATM minstrel_ht uses MCS_GROUP_RATES in place of this 8 modulus.
This change replaces such occurences and by doing so allows for different
values of MCS_GROUP_RATES (e.g to cope with VHT MCS8,9).
Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/rc80211_minstrel_ht.c')
-rw-r--r-- | net/mac80211/rc80211_minstrel_ht.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index 5d60779a0c1b..0a4a7c78e814 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c | |||
@@ -135,7 +135,7 @@ minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi); | |||
135 | static int | 135 | static int |
136 | minstrel_ht_get_group_idx(struct ieee80211_tx_rate *rate) | 136 | minstrel_ht_get_group_idx(struct ieee80211_tx_rate *rate) |
137 | { | 137 | { |
138 | return GROUP_IDX((rate->idx / MCS_GROUP_RATES) + 1, | 138 | return GROUP_IDX((rate->idx / 8) + 1, |
139 | !!(rate->flags & IEEE80211_TX_RC_SHORT_GI), | 139 | !!(rate->flags & IEEE80211_TX_RC_SHORT_GI), |
140 | !!(rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH)); | 140 | !!(rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH)); |
141 | } | 141 | } |
@@ -148,7 +148,7 @@ minstrel_ht_get_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi, | |||
148 | 148 | ||
149 | if (rate->flags & IEEE80211_TX_RC_MCS) { | 149 | if (rate->flags & IEEE80211_TX_RC_MCS) { |
150 | group = minstrel_ht_get_group_idx(rate); | 150 | group = minstrel_ht_get_group_idx(rate); |
151 | idx = rate->idx % MCS_GROUP_RATES; | 151 | idx = rate->idx % 8; |
152 | } else { | 152 | } else { |
153 | group = MINSTREL_CCK_GROUP; | 153 | group = MINSTREL_CCK_GROUP; |
154 | 154 | ||
@@ -636,8 +636,7 @@ minstrel_ht_set_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi, | |||
636 | idx = mp->cck_rates[index % ARRAY_SIZE(mp->cck_rates)]; | 636 | idx = mp->cck_rates[index % ARRAY_SIZE(mp->cck_rates)]; |
637 | flags = 0; | 637 | flags = 0; |
638 | } else { | 638 | } else { |
639 | idx = index % MCS_GROUP_RATES + | 639 | idx = index % MCS_GROUP_RATES + (group->streams - 1) * 8; |
640 | (group->streams - 1) * MCS_GROUP_RATES; | ||
641 | flags = IEEE80211_TX_RC_MCS | group->flags; | 640 | flags = IEEE80211_TX_RC_MCS | group->flags; |
642 | } | 641 | } |
643 | 642 | ||
@@ -817,7 +816,7 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, | |||
817 | } | 816 | } |
818 | 817 | ||
819 | rate->idx = sample_idx % MCS_GROUP_RATES + | 818 | rate->idx = sample_idx % MCS_GROUP_RATES + |
820 | (sample_group->streams - 1) * MCS_GROUP_RATES; | 819 | (sample_group->streams - 1) * 8; |
821 | rate->flags = IEEE80211_TX_RC_MCS | sample_group->flags; | 820 | rate->flags = IEEE80211_TX_RC_MCS | sample_group->flags; |
822 | } | 821 | } |
823 | 822 | ||