From: Emmanuel Grumbach <egrumbach@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: Eyal Shapira <eyal@wizery.com>,
Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: [PATCH 10/13] iwlwifi: mvm: rs: fix mapping from HT/VHT rates to legacy
Date: Mon, 2 Dec 2013 22:59:22 +0200 [thread overview]
Message-ID: <1386017965-13641-10-git-send-email-egrumbach@gmail.com> (raw)
In-Reply-To: <529CF2D6.1080008@gmail.com>
From: Eyal Shapira <eyal@wizery.com>
The table rs_ht_to_legacy is used to get the next legacy rate
following the last HT or VHT rate in the LQ rates table.
The mapping wasn't correct as well as didn't include entries
for MCS8/9 which led to out of bounds access. This didn't
trigger a crash but led to legacy rate entries using 1Mbps
rate.
In 5Ghz this probably caused the Tx to fail completely given
that Tx attempt would have reached the legacy entries and 1Mbps
isn't valid.
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
drivers/net/wireless/iwlwifi/mvm/rs.c | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/mvm/rs.c b/drivers/net/wireless/iwlwifi/mvm/rs.c
index 5c98d462..ef7126a 100644
--- a/drivers/net/wireless/iwlwifi/mvm/rs.c
+++ b/drivers/net/wireless/iwlwifi/mvm/rs.c
@@ -56,19 +56,16 @@
static u8 rs_ht_to_legacy[] = {
- [IWL_RATE_1M_INDEX] = IWL_RATE_6M_INDEX,
- [IWL_RATE_2M_INDEX] = IWL_RATE_6M_INDEX,
- [IWL_RATE_5M_INDEX] = IWL_RATE_6M_INDEX,
- [IWL_RATE_11M_INDEX] = IWL_RATE_6M_INDEX,
- [IWL_RATE_6M_INDEX] = IWL_RATE_6M_INDEX,
- [IWL_RATE_9M_INDEX] = IWL_RATE_6M_INDEX,
- [IWL_RATE_12M_INDEX] = IWL_RATE_9M_INDEX,
- [IWL_RATE_18M_INDEX] = IWL_RATE_12M_INDEX,
- [IWL_RATE_24M_INDEX] = IWL_RATE_18M_INDEX,
- [IWL_RATE_36M_INDEX] = IWL_RATE_24M_INDEX,
- [IWL_RATE_48M_INDEX] = IWL_RATE_36M_INDEX,
- [IWL_RATE_54M_INDEX] = IWL_RATE_48M_INDEX,
- [IWL_RATE_60M_INDEX] = IWL_RATE_54M_INDEX,
+ [IWL_RATE_MCS_0_INDEX] = IWL_RATE_6M_INDEX,
+ [IWL_RATE_MCS_1_INDEX] = IWL_RATE_9M_INDEX,
+ [IWL_RATE_MCS_2_INDEX] = IWL_RATE_12M_INDEX,
+ [IWL_RATE_MCS_3_INDEX] = IWL_RATE_18M_INDEX,
+ [IWL_RATE_MCS_4_INDEX] = IWL_RATE_24M_INDEX,
+ [IWL_RATE_MCS_5_INDEX] = IWL_RATE_36M_INDEX,
+ [IWL_RATE_MCS_6_INDEX] = IWL_RATE_48M_INDEX,
+ [IWL_RATE_MCS_7_INDEX] = IWL_RATE_54M_INDEX,
+ [IWL_RATE_MCS_8_INDEX] = IWL_RATE_54M_INDEX,
+ [IWL_RATE_MCS_9_INDEX] = IWL_RATE_54M_INDEX,
};
static const u8 ant_toggle_lookup[] = {
@@ -682,6 +679,8 @@ static u32 rs_get_lower_rate(struct iwl_lq_sta *lq_sta,
* are always supported (spec demand) */
if (!is_legacy(rate) && (!ht_possible || !scale_index)) {
switch_to_legacy = 1;
+ WARN_ON_ONCE(scale_index < IWL_RATE_MCS_0_INDEX &&
+ scale_index > IWL_RATE_MCS_9_INDEX);
scale_index = rs_ht_to_legacy[scale_index];
if (lq_sta->band == IEEE80211_BAND_5GHZ)
rate->type = LQ_LEGACY_A;
--
1.7.9.5
next prev parent reply other threads:[~2013-12-02 20:59 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-02 20:51 pull request: iwlwifi-next 2013-12-2 Emmanuel Grumbach
2013-12-02 20:59 ` [PATCH 01/13] iwlwifi: mvm: rs: improve debug prints Emmanuel Grumbach
2013-12-02 20:59 ` [PATCH 02/13] iwlwifi: mvm: rs: reduce min failures to end test window Emmanuel Grumbach
2013-12-02 20:59 ` [PATCH 03/13] iwlwifi: mvm: rs: update expected TPT tables if aggregation changed Emmanuel Grumbach
2013-12-02 20:59 ` [PATCH 04/13] iwlwifi: mvm: rs: rename thresholds defines Emmanuel Grumbach
2013-12-02 20:59 ` [PATCH 05/13] iwlwifi: mvm: rs: increase stay in column timeout Emmanuel Grumbach
2013-12-02 20:59 ` [PATCH 06/13] iwlwifi: mvm: rs: remove unused timestamp field Emmanuel Grumbach
2013-12-02 20:59 ` [PATCH 07/13] iwlwifi: mvm: rs: refactor to use rs_rate Emmanuel Grumbach
2013-12-02 20:59 ` [PATCH 08/13] iwlwifi: mvm: rs: remove unused parameter to rs_get_supported_rates Emmanuel Grumbach
2013-12-02 20:59 ` [PATCH 09/13] iwlwifi: mvm: rs: set dual_stream_ant_msk to ANT_AB always Emmanuel Grumbach
2013-12-02 20:59 ` Emmanuel Grumbach [this message]
2013-12-02 20:59 ` [PATCH 11/13] iwlwifi: mvm: rs: use the proper channel width define for legacy rate Emmanuel Grumbach
2013-12-02 20:59 ` [PATCH 12/13] iwlwifi: mvm: rs: overhaul search cycle state machine Emmanuel Grumbach
2014-01-06 15:07 ` Karl Beldan
2014-01-06 18:04 ` Eyal Shapira
2014-01-07 10:27 ` Karl Beldan
2014-01-07 16:30 ` Eyal Shapira
2014-01-07 18:13 ` Karl Beldan
2014-01-07 18:34 ` Eyal Shapira
2013-12-02 20:59 ` [PATCH 13/13] iwlwifi: mvm: BT Coex - enable Sync to SCO Emmanuel Grumbach
2013-12-03 17:19 ` pull request: iwlwifi-next 2013-12-2 Emmanuel Grumbach
2013-12-09 20:27 ` John W. Linville
2013-12-09 20:38 ` Emmanuel Grumbach
2013-12-11 15:50 ` John W. Linville
2013-12-09 20:32 ` Emmanuel Grumbach
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1386017965-13641-10-git-send-email-egrumbach@gmail.com \
--to=egrumbach@gmail.com \
--cc=emmanuel.grumbach@intel.com \
--cc=eyal@wizery.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).