diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-07-30 07:23:12 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-08-16 15:26:36 -0400 |
commit | fc88518916793af8ad6a02e05ff254d95c36d875 (patch) | |
tree | b164651d584846d85e929da1e333b23427f861f2 /net/mac80211/rx.c | |
parent | 86df5f7284ffdea9923153764691e490abf36081 (diff) |
mac80211: don't check rates on PLCP error frames
Frames that failed PLCP error checks are most likely
microwave transmissions (well, maybe not ...) and
don't have a proper rate detected, so ignore it.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r-- | net/mac80211/rx.c | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index fa0f37e4afe4..225e8ee682e3 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -2615,28 +2615,37 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
2615 | if (WARN_ON(!local->started)) | 2615 | if (WARN_ON(!local->started)) |
2616 | goto drop; | 2616 | goto drop; |
2617 | 2617 | ||
2618 | if (status->flag & RX_FLAG_HT) { | 2618 | if (likely(!(status->flag & RX_FLAG_FAILED_PLCP_CRC))) { |
2619 | /* | 2619 | /* |
2620 | * rate_idx is MCS index, which can be [0-76] as documented on: | 2620 | * Validate the rate, unless a PLCP error means that |
2621 | * | 2621 | * we probably can't have a valid rate here anyway. |
2622 | * http://wireless.kernel.org/en/developers/Documentation/ieee80211/802.11n | ||
2623 | * | ||
2624 | * Anything else would be some sort of driver or hardware error. | ||
2625 | * The driver should catch hardware errors. | ||
2626 | */ | 2622 | */ |
2627 | if (WARN((status->rate_idx < 0 || | 2623 | |
2628 | status->rate_idx > 76), | 2624 | if (status->flag & RX_FLAG_HT) { |
2629 | "Rate marked as an HT rate but passed " | 2625 | /* |
2630 | "status->rate_idx is not " | 2626 | * rate_idx is MCS index, which can be [0-76] |
2631 | "an MCS index [0-76]: %d (0x%02x)\n", | 2627 | * as documented on: |
2632 | status->rate_idx, | 2628 | * |
2633 | status->rate_idx)) | 2629 | * http://wireless.kernel.org/en/developers/Documentation/ieee80211/802.11n |
2634 | goto drop; | 2630 | * |
2635 | } else { | 2631 | * Anything else would be some sort of driver or |
2636 | if (WARN_ON(status->rate_idx < 0 || | 2632 | * hardware error. The driver should catch hardware |
2637 | status->rate_idx >= sband->n_bitrates)) | 2633 | * errors. |
2638 | goto drop; | 2634 | */ |
2639 | rate = &sband->bitrates[status->rate_idx]; | 2635 | if (WARN((status->rate_idx < 0 || |
2636 | status->rate_idx > 76), | ||
2637 | "Rate marked as an HT rate but passed " | ||
2638 | "status->rate_idx is not " | ||
2639 | "an MCS index [0-76]: %d (0x%02x)\n", | ||
2640 | status->rate_idx, | ||
2641 | status->rate_idx)) | ||
2642 | goto drop; | ||
2643 | } else { | ||
2644 | if (WARN_ON(status->rate_idx < 0 || | ||
2645 | status->rate_idx >= sband->n_bitrates)) | ||
2646 | goto drop; | ||
2647 | rate = &sband->bitrates[status->rate_idx]; | ||
2648 | } | ||
2640 | } | 2649 | } |
2641 | 2650 | ||
2642 | /* | 2651 | /* |