diff options
author | Karl Beldan <karl.beldan@rivierawaves.com> | 2013-11-11 07:10:49 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-11-25 14:52:21 -0500 |
commit | f12140c04ca49ea34c448b1bd8aa40fb9411690c (patch) | |
tree | 3813e32da22d2d4d830c4afb9b43a6515b1c97ee /net | |
parent | 3ef121b51164282e9eaa732bf79ff027599867c6 (diff) |
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: Karl Beldan <karl.beldan@rivierawaves.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/rc80211_minstrel_ht.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index e66e9f9fd0db..b91655a0d8f0 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c | |||
@@ -700,12 +700,16 @@ minstrel_get_sample_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) | |||
700 | if (!mi->sample_tries) | 700 | if (!mi->sample_tries) |
701 | return -1; | 701 | return -1; |
702 | 702 | ||
703 | mg = &mi->groups[mi->sample_group]; | 703 | sample_group = mi->sample_group; |
704 | mg = &mi->groups[sample_group]; | ||
704 | sample_idx = sample_table[mg->column][mg->index]; | 705 | sample_idx = sample_table[mg->column][mg->index]; |
706 | minstrel_next_sample_idx(mi); | ||
707 | |||
708 | if (!(mg->supported & BIT(sample_idx))) | ||
709 | return -1; | ||
710 | |||
705 | mr = &mg->rates[sample_idx]; | 711 | mr = &mg->rates[sample_idx]; |
706 | sample_group = mi->sample_group; | ||
707 | sample_idx += sample_group * MCS_GROUP_RATES; | 712 | sample_idx += sample_group * MCS_GROUP_RATES; |
708 | minstrel_next_sample_idx(mi); | ||
709 | 713 | ||
710 | /* | 714 | /* |
711 | * Sampling might add some overhead (RTS, no aggregation) | 715 | * Sampling might add some overhead (RTS, no aggregation) |