Commit 351df099 authored by Karl Beldan's avatar Karl Beldan Committed by Johannes Berg

mac80211: minstrel_ht: fix rates selection

When initializing rates selections starting indexes upon stats update,
the minstrel_sta->max_* rates should be 'group * MCS_GROUP_RATES + i'
not 'i'. This affects settings where one of the peers does not support
any of the rates of the group 0 (i.e. when ht_cap.mcs.rx_mask[0] == 0).
Signed-off-by: default avatarKarl Beldan <karl.beldan@rivierawaves.com>
Acked-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 6c751ef8
...@@ -277,13 +277,15 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) ...@@ -277,13 +277,15 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
if (!(mg->supported & BIT(i))) if (!(mg->supported & BIT(i)))
continue; continue;
index = MCS_GROUP_RATES * group + i;
/* initialize rates selections starting indexes */ /* initialize rates selections starting indexes */
if (!mg_rates_valid) { if (!mg_rates_valid) {
mg->max_tp_rate = mg->max_tp_rate2 = mg->max_tp_rate = mg->max_tp_rate2 =
mg->max_prob_rate = i; mg->max_prob_rate = i;
if (!mi_rates_valid) { if (!mi_rates_valid) {
mi->max_tp_rate = mi->max_tp_rate2 = mi->max_tp_rate = mi->max_tp_rate2 =
mi->max_prob_rate = i; mi->max_prob_rate = index;
mi_rates_valid = true; mi_rates_valid = true;
} }
mg_rates_valid = true; mg_rates_valid = true;
...@@ -291,7 +293,6 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) ...@@ -291,7 +293,6 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
mr = &mg->rates[i]; mr = &mg->rates[i];
mr->retry_updated = false; mr->retry_updated = false;
index = MCS_GROUP_RATES * group + i;
minstrel_calc_rate_ewma(mr); minstrel_calc_rate_ewma(mr);
minstrel_ht_calc_tp(mi, group, i); minstrel_ht_calc_tp(mi, group, i);
......
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