aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-power.h
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-power.h
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-power.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-power.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.h b/drivers/net/wireless/iwlwifi/iwl-power.h
index 7bb10d41ae5f..3d49b7a45b74 100644
--- a/drivers/net/wireless/iwlwifi/iwl-power.h
+++ b/drivers/net/wireless/iwlwifi/iwl-power.h
@@ -33,8 +33,18 @@
33 33
34struct iwl_priv; 34struct iwl_priv;
35 35
36#define IWL_ABSOLUTE_ZERO 0
37#define IWL_ABSOLUTE_MAX 0xFFFFFFFF
36#define IWL_TT_INCREASE_MARGIN 5 38#define IWL_TT_INCREASE_MARGIN 5
37 39
40/* Tx/Rx restrictions */
41#define IWL_TX_MULTI 0x02
42#define IWL_TX_SINGLE 0x01
43#define IWL_TX_NONE 0x00
44#define IWL_RX_MULTI 0x02
45#define IWL_RX_SINGLE 0x01
46#define IWL_RX_NONE 0x00
47
38/* Thermal Throttling State Machine states */ 48/* Thermal Throttling State Machine states */
39enum iwl_tt_state { 49enum iwl_tt_state {
40 IWL_TI_0, /* normal temperature, system power state */ 50 IWL_TI_0, /* normal temperature, system power state */
@@ -45,6 +55,35 @@ enum iwl_tt_state {
45}; 55};
46 56
47/** 57/**
58 * struct iwl_tt_restriction - Thermal Throttling restriction table used
59 * by advance thermal throttling management
60 * based on the current thermal throttling state, determine
61 * number of tx/rx streams; and the status of HT operation
62 * @tx_stream: number of tx stream allowed
63 * @is_ht: ht enable/disable
64 * @rx_stream: number of rx stream allowed
65 */
66struct iwl_tt_restriction {
67 u8 tx_stream;
68 bool is_ht;
69 u8 rx_stream;
70};
71
72/**
73 * struct iwl_tt_trans - Thermal Throttling transaction table; used by
74 * advance thermal throttling algorithm to determine next
75 * thermal state to go based on the current temperature
76 * @next_state: next thermal throttling mode
77 * @tt_low: low temperature threshold to change state
78 * @tt_high: high temperature threshold to change state
79 */
80struct iwl_tt_trans {
81 enum iwl_tt_state next_state;
82 u32 tt_low;
83 u32 tt_high;
84};
85
86/**
48 * struct iwl_tt_mgnt - Thermal Throttling Management structure 87 * struct iwl_tt_mgnt - Thermal Throttling Management structure
49 * @state: current Thermal Throttling state 88 * @state: current Thermal Throttling state
50 * @tt_power_mode: Thermal Throttling power mode index 89 * @tt_power_mode: Thermal Throttling power mode index
@@ -55,6 +94,11 @@ enum iwl_tt_state {
55 * @sys_power_mode: previous system power mode 94 * @sys_power_mode: previous system power mode
56 * before transition into TT state 95 * before transition into TT state
57 * @tt_previous_temperature: last measured temperature 96 * @tt_previous_temperature: last measured temperature
97 * @iwl_tt_restriction: ptr to restriction tbl, used by advance
98 * thermal throttling to determine how many tx/rx streams
99 * should be used in tt state; and can HT be enabled or not
100 * @iwl_tt_trans: ptr to adv trans table, used by advance thermal throttling
101 * state transaction
58 */ 102 */
59struct iwl_tt_mgmt { 103struct iwl_tt_mgmt {
60 enum iwl_tt_state state; 104 enum iwl_tt_state state;
@@ -63,6 +107,8 @@ struct iwl_tt_mgmt {
63#ifdef CONFIG_IWLWIFI_DEBUG 107#ifdef CONFIG_IWLWIFI_DEBUG
64 s32 tt_previous_temp; 108 s32 tt_previous_temp;
65#endif 109#endif
110 struct iwl_tt_restriction *restriction;
111 struct iwl_tt_trans *transaction;
66}; 112};
67 113
68enum { 114enum {
@@ -92,6 +138,8 @@ struct iwl_power_mgr {
92 u8 user_power_setting; /* set by user through sysfs */ 138 u8 user_power_setting; /* set by user through sysfs */
93 u8 power_disabled; /* set by mac80211's CONF_PS */ 139 u8 power_disabled; /* set by mac80211's CONF_PS */
94 struct iwl_tt_mgmt tt; /* Thermal Throttling Management */ 140 struct iwl_tt_mgmt tt; /* Thermal Throttling Management */
141 bool adv_tt; /* false: legacy mode */
142 /* true: advance mode */
95 bool ct_kill_toggle; /* use to toggle the CSR bit when 143 bool ct_kill_toggle; /* use to toggle the CSR bit when
96 * checking uCode temperature 144 * checking uCode temperature
97 */ 145 */
@@ -100,6 +148,9 @@ struct iwl_power_mgr {
100 148
101int iwl_power_update_mode(struct iwl_priv *priv, bool force); 149int iwl_power_update_mode(struct iwl_priv *priv, bool force);
102int iwl_power_set_user_mode(struct iwl_priv *priv, u16 mode); 150int iwl_power_set_user_mode(struct iwl_priv *priv, u16 mode);
151bool iwl_ht_enabled(struct iwl_priv *priv);
152u8 iwl_tx_ant_restriction(struct iwl_priv *priv);
153u8 iwl_rx_ant_restriction(struct iwl_priv *priv);
103void iwl_tt_enter_ct_kill(struct iwl_priv *priv); 154void iwl_tt_enter_ct_kill(struct iwl_priv *priv);
104void iwl_tt_exit_ct_kill(struct iwl_priv *priv); 155void iwl_tt_exit_ct_kill(struct iwl_priv *priv);
105void iwl_tt_handler(struct iwl_priv *priv); 156void iwl_tt_handler(struct iwl_priv *priv);