Skip to content

Commit

Permalink
cfg80211: add warning when calculating MCS rates >= 32
Browse files Browse the repository at this point in the history
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: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Johannes Berg authored and John W. Linville committed May 16, 2012
1 parent 4472037 commit 2615f37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/wireless/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ u16 cfg80211_calculate_bitrate(struct rate_info *rate)
return rate->legacy;

/* 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;

modulation = rate->mcs & 7;
Expand Down

0 comments on commit 2615f37

Please sign in to comment.