Commit f12140c0 authored by Karl Beldan's avatar Karl Beldan Committed by Johannes Berg

mac80211: minstrel_ht: do not sample unsupported rates

ATM minstrel_ht does not check whether a sampling rate is supported.
Unsupported rates attempts can trigger when there are holes in bitfields
of supported MCSes belonging to the same group (e.g many devices are
MCS32 capable without MCS33->39 capable, also we systematically have a
hole for CCK rates).
Drop any attempts to sample unsupported rates, as suggested by Felix.

This is not a problem in minstrel which fills a per STA sample table
with only supported rates (though only at init).
Signed-off-by: default avatarKarl Beldan <karl.beldan@rivierawaves.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 3ef121b5
...@@ -700,12 +700,16 @@ minstrel_get_sample_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) ...@@ -700,12 +700,16 @@ minstrel_get_sample_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
if (!mi->sample_tries) if (!mi->sample_tries)
return -1; return -1;
mg = &mi->groups[mi->sample_group]; sample_group = mi->sample_group;
mg = &mi->groups[sample_group];
sample_idx = sample_table[mg->column][mg->index]; sample_idx = sample_table[mg->column][mg->index];
minstrel_next_sample_idx(mi);
if (!(mg->supported & BIT(sample_idx)))
return -1;
mr = &mg->rates[sample_idx]; mr = &mg->rates[sample_idx];
sample_group = mi->sample_group;
sample_idx += sample_group * MCS_GROUP_RATES; sample_idx += sample_group * MCS_GROUP_RATES;
minstrel_next_sample_idx(mi);
/* /*
* Sampling might add some overhead (RTS, no aggregation) * Sampling might add some overhead (RTS, no aggregation)
......
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