aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2009-07-24 14:13:00 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-27 15:24:20 -0400
commite3139fe741b25a0f8a27fd2cdf2ad11734c3d4d3 (patch)
tree6691e85878072f6f4dd88a3457c30ededfdf39a0 /drivers
parent21f5fc75deca63bc41c9d13007d35981d4485622 (diff)
iwlwifi: revert to active table when rate is not valid
When performing rate scaling, if detected that the new rate index is invalid, clear the search_better_tbl flag so it will not be stuck in the loop. Since the search table is already set up in uCode, we need to empty out the the search table; revert back to the "active" rate and throughput info. Also pass the "active" table setup to uCode to make sure the rate scale is functioning correctly. 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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c37
1 files changed, 32 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 63280411fd58..40207dac6db5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -2003,6 +2003,25 @@ static void rs_stay_in_table(struct iwl_lq_sta *lq_sta)
2003} 2003}
2004 2004
2005/* 2005/*
2006 * setup rate table in uCode
2007 * return rate_n_flags as used in the table
2008 */
2009static u32 rs_update_rate_tbl(struct iwl_priv *priv,
2010 struct iwl_lq_sta *lq_sta,
2011 struct iwl_scale_tbl_info *tbl,
2012 int index, u8 is_green)
2013{
2014 u32 rate;
2015
2016 /* Update uCode's rate table. */
2017 rate = rate_n_flags_from_tbl(priv, tbl, index, is_green);
2018 rs_fill_link_cmd(priv, lq_sta, rate);
2019 iwl_send_lq_cmd(priv, &lq_sta->lq, CMD_ASYNC);
2020
2021 return rate;
2022}
2023
2024/*
2006 * Do rate scaling and search for new modulation mode. 2025 * Do rate scaling and search for new modulation mode.
2007 */ 2026 */
2008static void rs_rate_scale_perform(struct iwl_priv *priv, 2027static void rs_rate_scale_perform(struct iwl_priv *priv,
@@ -2098,6 +2117,16 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
2098 2117
2099 if (!((1 << index) & rate_scale_index_msk)) { 2118 if (!((1 << index) & rate_scale_index_msk)) {
2100 IWL_ERR(priv, "Current Rate is not valid\n"); 2119 IWL_ERR(priv, "Current Rate is not valid\n");
2120 if (lq_sta->search_better_tbl) {
2121 /* revert to active table if search table is not valid*/
2122 tbl->lq_type = LQ_NONE;
2123 lq_sta->search_better_tbl = 0;
2124 tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
2125 /* get "active" rate info */
2126 index = iwl_hwrate_to_plcp_idx(tbl->current_rate);
2127 rate = rs_update_rate_tbl(priv, lq_sta,
2128 tbl, index, is_green);
2129 }
2101 return; 2130 return;
2102 } 2131 }
2103 2132
@@ -2308,11 +2337,9 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
2308 2337
2309lq_update: 2338lq_update:
2310 /* Replace uCode's rate table for the destination station. */ 2339 /* Replace uCode's rate table for the destination station. */
2311 if (update_lq) { 2340 if (update_lq)
2312 rate = rate_n_flags_from_tbl(priv, tbl, index, is_green); 2341 rate = rs_update_rate_tbl(priv, lq_sta,
2313 rs_fill_link_cmd(priv, lq_sta, rate); 2342 tbl, index, is_green);
2314 iwl_send_lq_cmd(priv, &lq_sta->lq, CMD_ASYNC);
2315 }
2316 2343
2317 /* Should we stay with this modulation mode, or search for a new one? */ 2344 /* Should we stay with this modulation mode, or search for a new one? */
2318 rs_stay_in_table(lq_sta); 2345 rs_stay_in_table(lq_sta);