Commit 7a5e3fa2 authored by Karl Beldan's avatar Karl Beldan Committed by Johannes Berg

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: default avatarKarl Beldan <karl.beldan@rivierawaves.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 21f659bf
...@@ -135,7 +135,7 @@ minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi); ...@@ -135,7 +135,7 @@ minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi);
static int static int
minstrel_ht_get_group_idx(struct ieee80211_tx_rate *rate) minstrel_ht_get_group_idx(struct ieee80211_tx_rate *rate)
{ {
return GROUP_IDX((rate->idx / MCS_GROUP_RATES) + 1, return GROUP_IDX((rate->idx / 8) + 1,
!!(rate->flags & IEEE80211_TX_RC_SHORT_GI), !!(rate->flags & IEEE80211_TX_RC_SHORT_GI),
!!(rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH)); !!(rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH));
} }
...@@ -148,7 +148,7 @@ minstrel_ht_get_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi, ...@@ -148,7 +148,7 @@ minstrel_ht_get_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
if (rate->flags & IEEE80211_TX_RC_MCS) { if (rate->flags & IEEE80211_TX_RC_MCS) {
group = minstrel_ht_get_group_idx(rate); group = minstrel_ht_get_group_idx(rate);
idx = rate->idx % MCS_GROUP_RATES; idx = rate->idx % 8;
} else { } else {
group = MINSTREL_CCK_GROUP; group = MINSTREL_CCK_GROUP;
...@@ -636,8 +636,7 @@ minstrel_ht_set_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi, ...@@ -636,8 +636,7 @@ minstrel_ht_set_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
idx = mp->cck_rates[index % ARRAY_SIZE(mp->cck_rates)]; idx = mp->cck_rates[index % ARRAY_SIZE(mp->cck_rates)];
flags = 0; flags = 0;
} else { } else {
idx = index % MCS_GROUP_RATES + idx = index % MCS_GROUP_RATES + (group->streams - 1) * 8;
(group->streams - 1) * MCS_GROUP_RATES;
flags = IEEE80211_TX_RC_MCS | group->flags; flags = IEEE80211_TX_RC_MCS | group->flags;
} }
...@@ -817,7 +816,7 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, ...@@ -817,7 +816,7 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
} }
rate->idx = sample_idx % MCS_GROUP_RATES + rate->idx = sample_idx % MCS_GROUP_RATES +
(sample_group->streams - 1) * MCS_GROUP_RATES; (sample_group->streams - 1) * 8;
rate->flags = IEEE80211_TX_RC_MCS | sample_group->flags; rate->flags = IEEE80211_TX_RC_MCS | sample_group->flags;
} }
......
...@@ -54,8 +54,7 @@ minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, char *p) ...@@ -54,8 +54,7 @@ minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, char *p)
int r = bitrates[j % 4]; int r = bitrates[j % 4];
p += sprintf(p, " %2u.%1uM", r / 10, r % 10); p += sprintf(p, " %2u.%1uM", r / 10, r % 10);
} else { } else {
p += sprintf(p, " MCS%-2u", (mg->streams - 1) * p += sprintf(p, " MCS%-2u", (mg->streams - 1) * 8 + j);
MCS_GROUP_RATES + j);
} }
tp = mr->cur_tp / 10; tp = mr->cur_tp / 10;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment