diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 37 |
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 | */ | ||
2009 | static 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 | */ |
2008 | static void rs_rate_scale_perform(struct iwl_priv *priv, | 2027 | static 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 | ||
2309 | lq_update: | 2338 | lq_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); |