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>2009-07-24 14:13:03 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-27 15:24:21 -0400
commit46f9381aa3fb62f6a141bfd41dcbeda1ec5fa26e (patch)
tree1023c715eac2b99b4443afbfefddb52719923593 /drivers/net/wireless/iwlwifi/iwl-agn-rs.c
parent39b73fb15e4704fd4d1e33688135810637f5f3fb (diff)
iwlwifi: Thermal Throttling Management - part 2
Part 2 of Thermal Throttling Management - Thermal Throttling feature is used to put NIC into low power state when driver detect the Radio temperature reach pre-defined threshold Two Thermal Throttling Management Methods; this patch introduce the Advance Thermal Throttling: TI-0: system power index, no tx/rx restriction, HT enabled TI-1: power index 5, 1 spatial stream Tx, multiple spatial stream Rx, HT enabled TI-2: power index 5: 1 spatial stream Tx, 1 spatial stream Rx, HT disabled TI-CT-KILL: power index 5, no Tx, no Rx, HT disabled For advance Thermal Throttling, CT_KILL_ENTER threshold and CT_KILL_EXIT threshold are different; uCode will not stay awake until reach CT_KILL_EXIT threshold. 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/net/wireless/iwlwifi/iwl-agn-rs.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c48
1 files changed, 39 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 40207dac6db5..52a4810274e9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -177,7 +177,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
177 struct sk_buff *skb, 177 struct sk_buff *skb,
178 struct ieee80211_sta *sta, 178 struct ieee80211_sta *sta,
179 struct iwl_lq_sta *lq_sta); 179 struct iwl_lq_sta *lq_sta);
180static void rs_fill_link_cmd(const struct iwl_priv *priv, 180static void rs_fill_link_cmd(struct iwl_priv *priv,
181 struct iwl_lq_sta *lq_sta, u32 rate_n_flags); 181 struct iwl_lq_sta *lq_sta, u32 rate_n_flags);
182 182
183 183
@@ -1398,6 +1398,12 @@ static int rs_move_legacy_other(struct iwl_priv *priv,
1398 int ret = 0; 1398 int ret = 0;
1399 u8 update_search_tbl_counter = 0; 1399 u8 update_search_tbl_counter = 0;
1400 1400
1401 if (!iwl_ht_enabled(priv))
1402 /* stay in Legacy */
1403 tbl->action = IWL_LEGACY_SWITCH_ANTENNA1;
1404 else if (iwl_tx_ant_restriction(priv) == IWL_TX_SINGLE &&
1405 tbl->action > IWL_LEGACY_SWITCH_SISO)
1406 tbl->action = IWL_LEGACY_SWITCH_SISO;
1401 for (; ;) { 1407 for (; ;) {
1402 lq_sta->action_counter++; 1408 lq_sta->action_counter++;
1403 switch (tbl->action) { 1409 switch (tbl->action) {
@@ -1529,6 +1535,11 @@ static int rs_move_siso_to_other(struct iwl_priv *priv,
1529 u8 update_search_tbl_counter = 0; 1535 u8 update_search_tbl_counter = 0;
1530 int ret; 1536 int ret;
1531 1537
1538 if (iwl_tx_ant_restriction(priv) == IWL_TX_SINGLE &&
1539 tbl->action > IWL_SISO_SWITCH_ANTENNA2) {
1540 /* stay in SISO */
1541 tbl->action = IWL_SISO_SWITCH_ANTENNA1;
1542 }
1532 for (;;) { 1543 for (;;) {
1533 lq_sta->action_counter++; 1544 lq_sta->action_counter++;
1534 switch (tbl->action) { 1545 switch (tbl->action) {
@@ -1663,6 +1674,12 @@ static int rs_move_mimo2_to_other(struct iwl_priv *priv,
1663 u8 update_search_tbl_counter = 0; 1674 u8 update_search_tbl_counter = 0;
1664 int ret; 1675 int ret;
1665 1676
1677 if ((iwl_tx_ant_restriction(priv) == IWL_TX_SINGLE) &&
1678 (tbl->action < IWL_MIMO2_SWITCH_SISO_A ||
1679 tbl->action > IWL_MIMO2_SWITCH_SISO_C)) {
1680 /* switch in SISO */
1681 tbl->action = IWL_MIMO2_SWITCH_SISO_A;
1682 }
1666 for (;;) { 1683 for (;;) {
1667 lq_sta->action_counter++; 1684 lq_sta->action_counter++;
1668 switch (tbl->action) { 1685 switch (tbl->action) {
@@ -1799,6 +1816,12 @@ static int rs_move_mimo3_to_other(struct iwl_priv *priv,
1799 int ret; 1816 int ret;
1800 u8 update_search_tbl_counter = 0; 1817 u8 update_search_tbl_counter = 0;
1801 1818
1819 if ((iwl_tx_ant_restriction(priv) == IWL_TX_SINGLE) &&
1820 (tbl->action < IWL_MIMO3_SWITCH_SISO_A ||
1821 tbl->action > IWL_MIMO3_SWITCH_SISO_C)) {
1822 /* switch in SISO */
1823 tbl->action = IWL_MIMO3_SWITCH_SISO_A;
1824 }
1802 for (;;) { 1825 for (;;) {
1803 lq_sta->action_counter++; 1826 lq_sta->action_counter++;
1804 switch (tbl->action) { 1827 switch (tbl->action) {
@@ -2178,8 +2201,8 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
2178 tbl->expected_tpt[index] + 64) / 128)); 2201 tbl->expected_tpt[index] + 64) / 128));
2179 2202
2180 /* If we are searching for better modulation mode, check success. */ 2203 /* If we are searching for better modulation mode, check success. */
2181 if (lq_sta->search_better_tbl) { 2204 if (lq_sta->search_better_tbl &&
2182 2205 (iwl_tx_ant_restriction(priv) == IWL_TX_MULTI)) {
2183 /* If good success, continue using the "search" mode; 2206 /* If good success, continue using the "search" mode;
2184 * no need to send new link quality command, since we're 2207 * no need to send new link quality command, since we're
2185 * continuing to use the setup that we've been trying. */ 2208 * continuing to use the setup that we've been trying. */
@@ -2307,7 +2330,11 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
2307 ((sr > IWL_RATE_HIGH_TH) || 2330 ((sr > IWL_RATE_HIGH_TH) ||
2308 (current_tpt > (100 * tbl->expected_tpt[low])))) 2331 (current_tpt > (100 * tbl->expected_tpt[low]))))
2309 scale_action = 0; 2332 scale_action = 0;
2310 2333 if (!iwl_ht_enabled(priv) && !is_legacy(tbl->lq_type))
2334 scale_action = -1;
2335 if (iwl_tx_ant_restriction(priv) != IWL_TX_MULTI &&
2336 (is_mimo2(tbl->lq_type) || is_mimo3(tbl->lq_type)))
2337 scale_action = -1;
2311 switch (scale_action) { 2338 switch (scale_action) {
2312 case -1: 2339 case -1:
2313 /* Decrease starting rate, update uCode's rate table */ 2340 /* Decrease starting rate, update uCode's rate table */
@@ -2341,9 +2368,11 @@ lq_update:
2341 rate = rs_update_rate_tbl(priv, lq_sta, 2368 rate = rs_update_rate_tbl(priv, lq_sta,
2342 tbl, index, is_green); 2369 tbl, index, is_green);
2343 2370
2344 /* Should we stay with this modulation mode, or search for a new one? */ 2371 if (iwl_tx_ant_restriction(priv) == IWL_TX_MULTI) {
2345 rs_stay_in_table(lq_sta); 2372 /* Should we stay with this modulation mode,
2346 2373 * or search for a new one? */
2374 rs_stay_in_table(lq_sta);
2375 }
2347 /* 2376 /*
2348 * Search for new modulation mode if we're: 2377 * Search for new modulation mode if we're:
2349 * 1) Not changing rates right now 2378 * 1) Not changing rates right now
@@ -2400,7 +2429,8 @@ lq_update:
2400 * have been tried and compared, stay in this best modulation 2429 * have been tried and compared, stay in this best modulation
2401 * mode for a while before next round of mode comparisons. */ 2430 * mode for a while before next round of mode comparisons. */
2402 if (lq_sta->enable_counter && 2431 if (lq_sta->enable_counter &&
2403 (lq_sta->action_counter >= tbl1->max_search)) { 2432 (lq_sta->action_counter >= tbl1->max_search) &&
2433 iwl_ht_enabled(priv)) {
2404 if ((lq_sta->last_tpt > IWL_AGG_TPT_THREHOLD) && 2434 if ((lq_sta->last_tpt > IWL_AGG_TPT_THREHOLD) &&
2405 (lq_sta->tx_agg_tid_en & (1 << tid)) && 2435 (lq_sta->tx_agg_tid_en & (1 << tid)) &&
2406 (tid != MAX_TID_COUNT)) { 2436 (tid != MAX_TID_COUNT)) {
@@ -2686,7 +2716,7 @@ static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband,
2686 rs_initialize_lq(priv, conf, sta, lq_sta); 2716 rs_initialize_lq(priv, conf, sta, lq_sta);
2687} 2717}
2688 2718
2689static void rs_fill_link_cmd(const struct iwl_priv *priv, 2719static void rs_fill_link_cmd(struct iwl_priv *priv,
2690 struct iwl_lq_sta *lq_sta, u32 new_rate) 2720 struct iwl_lq_sta *lq_sta, u32 new_rate)
2691{ 2721{
2692 struct iwl_scale_tbl_info tbl_type; 2722 struct iwl_scale_tbl_info tbl_type;