aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2009-03-10 17:35:12 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-03-16 18:09:45 -0400
commit3c4955f8d9b706231d226d7a73877cb7d786277f (patch)
treebb7148499ca7a47031e3f8a60d828a65fe95949c
parentdf36c044f51ba6889c2d8b0efd285303bf2a0fbe (diff)
iwlwifi: verify the antenna selection when receive fixed rate debugfs
When iwlwifi driver receive fixed rate debugfs command, validate the antenna selection, if the selection is invalid, report the valid antenna choice and do not set the rate scale table to fixed rate. Otherwise, set the entire rate scale table to the fixed rate request by the user. this validation can prevent sysassert happen in uCode Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 43c796bb5800..cab7842a73aa 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -2473,18 +2473,25 @@ static void rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta,
2473 u32 *rate_n_flags, int index) 2473 u32 *rate_n_flags, int index)
2474{ 2474{
2475 struct iwl_priv *priv; 2475 struct iwl_priv *priv;
2476 u8 valid_tx_ant;
2477 u8 ant_sel_tx;
2476 2478
2477 priv = lq_sta->drv; 2479 priv = lq_sta->drv;
2480 valid_tx_ant = priv->hw_params.valid_tx_ant;
2478 if (lq_sta->dbg_fixed_rate) { 2481 if (lq_sta->dbg_fixed_rate) {
2479 if (index < 12) { 2482 ant_sel_tx =
2483 ((lq_sta->dbg_fixed_rate & RATE_MCS_ANT_ABC_MSK)
2484 >> RATE_MCS_ANT_POS);
2485 if ((valid_tx_ant & ant_sel_tx) == ant_sel_tx) {
2480 *rate_n_flags = lq_sta->dbg_fixed_rate; 2486 *rate_n_flags = lq_sta->dbg_fixed_rate;
2487 IWL_DEBUG_RATE(priv, "Fixed rate ON\n");
2481 } else { 2488 } else {
2482 if (lq_sta->band == IEEE80211_BAND_5GHZ) 2489 lq_sta->dbg_fixed_rate = 0;
2483 *rate_n_flags = 0x800D; 2490 IWL_ERR(priv,
2484 else 2491 "Invalid antenna selection 0x%X, Valid is 0x%X\n",
2485 *rate_n_flags = 0x820A; 2492 ant_sel_tx, valid_tx_ant);
2493 IWL_DEBUG_RATE(priv, "Fixed rate OFF\n");
2486 } 2494 }
2487 IWL_DEBUG_RATE(priv, "Fixed rate ON\n");
2488 } else { 2495 } else {
2489 IWL_DEBUG_RATE(priv, "Fixed rate OFF\n"); 2496 IWL_DEBUG_RATE(priv, "Fixed rate OFF\n");
2490 } 2497 }