Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2615f375 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

cfg80211: add warning when calculating MCS rates >= 32



cfg80211_calculate_bitrate() doesn't work for MCS
rates 32 or higher, and it has always returned 0
in that case. Warn if it ever really happens.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 4472037b
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -880,7 +880,7 @@ u16 cfg80211_calculate_bitrate(struct rate_info *rate)
		return rate->legacy;
		return rate->legacy;


	/* the formula below does only work for MCS values smaller than 32 */
	/* the formula below does only work for MCS values smaller than 32 */
	if (rate->mcs >= 32)
	if (WARN_ON_ONCE(rate->mcs >= 32))
		return 0;
		return 0;


	modulation = rate->mcs & 7;
	modulation = rate->mcs & 7;