aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2010-08-03 11:23:32 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-08-24 16:32:02 -0400
commit80e9158c3fc1b55301b71cbeea2b31aa1d3c9b76 (patch)
tree7e6055e7dc9ec83fa61ef7a9e1d737f0d13224a6 /drivers/net/wireless/iwlwifi/iwl-agn-rs.c
parentb1a78858c4579d678444c007617292ccf6f7a315 (diff)
iwlagn: continue perform rate scale when error detected
If for some reason, the actual link command not matching neither active nor search table; instead of return and not performing rate scale, by-pass the data collection and continue the rate scale process. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-rs.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 4d5738dfc7eb..a4563389bad0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -82,6 +82,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
82 struct iwl_lq_sta *lq_sta); 82 struct iwl_lq_sta *lq_sta);
83static void rs_fill_link_cmd(struct iwl_priv *priv, 83static void rs_fill_link_cmd(struct iwl_priv *priv,
84 struct iwl_lq_sta *lq_sta, u32 rate_n_flags); 84 struct iwl_lq_sta *lq_sta, u32 rate_n_flags);
85static void rs_stay_in_table(struct iwl_lq_sta *lq_sta);
85 86
86 87
87#ifdef CONFIG_MAC80211_DEBUGFS 88#ifdef CONFIG_MAC80211_DEBUGFS
@@ -502,6 +503,7 @@ static int rs_get_tbl_info_from_mcs(const u32 rate_n_flags,
502 u8 num_of_ant = get_num_of_ant_from_rate(rate_n_flags); 503 u8 num_of_ant = get_num_of_ant_from_rate(rate_n_flags);
503 u8 mcs; 504 u8 mcs;
504 505
506 memset(tbl, 0, sizeof(struct iwl_scale_tbl_info));
505 *rate_idx = iwl_hwrate_to_plcp_idx(rate_n_flags); 507 *rate_idx = iwl_hwrate_to_plcp_idx(rate_n_flags);
506 508
507 if (*rate_idx == IWL_RATE_INVALID) { 509 if (*rate_idx == IWL_RATE_INVALID) {
@@ -848,7 +850,20 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
848 other_tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); 850 other_tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
849 } else { 851 } else {
850 IWL_DEBUG_RATE(priv, "Neither active nor search matches tx rate\n"); 852 IWL_DEBUG_RATE(priv, "Neither active nor search matches tx rate\n");
851 return; 853 tmp_tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
854 IWL_DEBUG_RATE(priv, "active- lq:%x, ant:%x, SGI:%d\n",
855 tmp_tbl->lq_type, tmp_tbl->ant_type, tmp_tbl->is_SGI);
856 tmp_tbl = &(lq_sta->lq_info[1 - lq_sta->active_tbl]);
857 IWL_DEBUG_RATE(priv, "search- lq:%x, ant:%x, SGI:%d\n",
858 tmp_tbl->lq_type, tmp_tbl->ant_type, tmp_tbl->is_SGI);
859 IWL_DEBUG_RATE(priv, "actual- lq:%x, ant:%x, SGI:%d\n",
860 tbl_type.lq_type, tbl_type.ant_type, tbl_type.is_SGI);
861 /*
862 * no matching table found, let's by-pass the data collection
863 * and continue to perform rate scale to find the rate table
864 */
865 rs_stay_in_table(lq_sta);
866 goto done;
852 } 867 }
853 868
854 /* 869 /*
@@ -909,7 +924,7 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
909 } 924 }
910 /* The last TX rate is cached in lq_sta; it's set in if/else above */ 925 /* The last TX rate is cached in lq_sta; it's set in if/else above */
911 lq_sta->last_rate_n_flags = tx_rate; 926 lq_sta->last_rate_n_flags = tx_rate;
912 927done:
913 /* See if there's a better rate or modulation mode to try. */ 928 /* See if there's a better rate or modulation mode to try. */
914 if (sta && sta->supp_rates[sband->band]) 929 if (sta && sta->supp_rates[sband->band])
915 rs_rate_scale_perform(priv, skb, sta, lq_sta); 930 rs_rate_scale_perform(priv, skb, sta, lq_sta);
@@ -2598,7 +2613,6 @@ static void rs_fill_link_cmd(struct iwl_priv *priv,
2598 rs_dbgfs_set_mcs(lq_sta, &new_rate, index); 2613 rs_dbgfs_set_mcs(lq_sta, &new_rate, index);
2599 2614
2600 /* Interpret new_rate (rate_n_flags) */ 2615 /* Interpret new_rate (rate_n_flags) */
2601 memset(&tbl_type, 0, sizeof(tbl_type));
2602 rs_get_tbl_info_from_mcs(new_rate, lq_sta->band, 2616 rs_get_tbl_info_from_mcs(new_rate, lq_sta->band,
2603 &tbl_type, &rate_idx); 2617 &tbl_type, &rate_idx);
2604 2618