Skip to content

Commit

Permalink
mac80211: fix max HT rate processing on mac80211
Browse files Browse the repository at this point in the history
The max MCS index is 76, fix the higher check to allow through
frames received at MCS 76. This is a non-issue for current drivers
as MCS 76 is only possible with a device supporting 4 spatial
streams.

While at it change the WARN_ON() on invalid HT rates to a WARN()
to provide more useful information. This will help debug issues
when the driver is passing up a bogus HT rate value.

The rate must map to a valid MCS index which can be any of the
values in the set [0 - 76] (inclusive).

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Nov 11, 2009
1 parent b34e620 commit e5d6eb8
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions net/mac80211/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2441,9 +2441,21 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb)
goto drop;

if (status->flag & RX_FLAG_HT) {
/* rate_idx is MCS index */
if (WARN_ON(status->rate_idx < 0 ||
status->rate_idx >= 76))
/*
* rate_idx is MCS index, which can be [0-76] as documented on:
*
* http://wireless.kernel.org/en/developers/Documentation/ieee80211/802.11n
*
* Anything else would be some sort of driver or hardware error.
* The driver should catch hardware errors.
*/
if (WARN((status->rate_idx < 0 ||
status->rate_idx > 76),
"Rate marked as an HT rate but passed "
"status->rate_idx is not "
"an MCS index [0-76]: %d (0x%02x)\n",
status->rate_idx,
status->rate_idx))
goto drop;
/* HT rates are not in the table - use the highest legacy rate
* for now since other parts of mac80211 may not yet be fully
Expand Down

0 comments on commit e5d6eb8

Please sign in to comment.