aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-power.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-08-07 18:41:51 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-14 09:13:50 -0400
commite312c24cf8229f9b6e76dbfd5d99eefe21f4ac0a (patch)
tree79e3b967f3905716baef4bc73b4510543b38ceb5 /drivers/net/wireless/iwlwifi/iwl-power.h
parentd91b1ba37744bc7fb7524516be855c9fa81142e2 (diff)
iwlwifi: automatically adjust sleep level
Depending on required latency requested by pm_qos (via mac80211) we can automatically adjust the sleep state. Also, mac80211 has a user-visible dynamic sleep feature where we are supposed to stay awake after sending/receiving frames to better receive response frames to our packets, this can be integrated into the sleep command. Currently, and this patch doesn't change that yet, we default to using sleep level 1 if PS is enabled. With a module parameter to iwlcore, automatic adjustment to changing network latency requirements can be enabled -- this isn't yet the default due to requiring more testing. The goal is to enable automatic adjustment and then go into the deepest possible sleep state possible depending on the networking latency requirements. This patch does, however, enable IEEE80211_HW_SUPPORTS_DYNAMIC_PS to avoid the double-timer (one in software and one in the device) when transmitting -- the exact timeout may be ignored but that is not of big concern. Note also that we keep the hard-coded power indices around for thermal throttling -- the specification of that calls for using the specified power levels. Those can also be selected in debugfs to allow easier testing of such parameters. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> 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.h30
1 files changed, 6 insertions, 24 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.h b/drivers/net/wireless/iwlwifi/iwl-power.h
index 15e3eabd2e84..df6f6a49712b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-power.h
+++ b/drivers/net/wireless/iwlwifi/iwl-power.h
@@ -28,11 +28,8 @@
28#ifndef __iwl_power_setting_h__ 28#ifndef __iwl_power_setting_h__
29#define __iwl_power_setting_h__ 29#define __iwl_power_setting_h__
30 30
31#include <net/mac80211.h>
32#include "iwl-commands.h" 31#include "iwl-commands.h"
33 32
34struct iwl_priv;
35
36#define IWL_ABSOLUTE_ZERO 0 33#define IWL_ABSOLUTE_ZERO 0
37#define IWL_ABSOLUTE_MAX 0xFFFFFFFF 34#define IWL_ABSOLUTE_MAX 0xFFFFFFFF
38#define IWL_TT_INCREASE_MARGIN 5 35#define IWL_TT_INCREASE_MARGIN 5
@@ -93,8 +90,6 @@ struct iwl_tt_trans {
93 * when thermal throttling state != IWL_TI_0 90 * when thermal throttling state != IWL_TI_0
94 * the tt_power_mode should set to different 91 * the tt_power_mode should set to different
95 * power mode based on the current tt state 92 * power mode based on the current tt state
96 * @sys_power_mode: previous system power mode
97 * before transition into TT state
98 * @tt_previous_temperature: last measured temperature 93 * @tt_previous_temperature: last measured temperature
99 * @iwl_tt_restriction: ptr to restriction tbl, used by advance 94 * @iwl_tt_restriction: ptr to restriction tbl, used by advance
100 * thermal throttling to determine how many tx/rx streams 95 * thermal throttling to determine how many tx/rx streams
@@ -108,7 +103,6 @@ struct iwl_tt_mgmt {
108 enum iwl_tt_state state; 103 enum iwl_tt_state state;
109 bool advanced_tt; 104 bool advanced_tt;
110 u8 tt_power_mode; 105 u8 tt_power_mode;
111 u8 sys_power_mode;
112 bool ct_kill_toggle; 106 bool ct_kill_toggle;
113#ifdef CONFIG_IWLWIFI_DEBUG 107#ifdef CONFIG_IWLWIFI_DEBUG
114 s32 tt_previous_temp; 108 s32 tt_previous_temp;
@@ -118,8 +112,7 @@ struct iwl_tt_mgmt {
118 struct timer_list ct_kill_exit_tm; 112 struct timer_list ct_kill_exit_tm;
119}; 113};
120 114
121enum { 115enum iwl_power_level {
122 IWL_POWER_MODE_CAM, /* Continuously Aware Mode, always on */
123 IWL_POWER_INDEX_1, 116 IWL_POWER_INDEX_1,
124 IWL_POWER_INDEX_2, 117 IWL_POWER_INDEX_2,
125 IWL_POWER_INDEX_3, 118 IWL_POWER_INDEX_3,
@@ -128,26 +121,13 @@ enum {
128 IWL_POWER_NUM 121 IWL_POWER_NUM
129}; 122};
130 123
131/* Power management (not Tx power) structures */
132
133struct iwl_power_vec_entry {
134 struct iwl_powertable_cmd cmd;
135 u8 no_dtim;
136};
137
138struct iwl_power_mgr { 124struct iwl_power_mgr {
139 struct iwl_power_vec_entry pwr_range_0[IWL_POWER_NUM]; 125 struct iwl_powertable_cmd sleep_cmd;
140 struct iwl_power_vec_entry pwr_range_1[IWL_POWER_NUM]; 126 int debug_sleep_level_override;
141 struct iwl_power_vec_entry pwr_range_2[IWL_POWER_NUM]; 127 bool pci_pm;
142 u32 dtim_period;
143 /* final power level that used to calculate final power command */
144 u8 power_mode;
145 u8 user_power_setting; /* set by user through sysfs */
146 u8 power_disabled; /* set by mac80211's CONF_PS */
147}; 128};
148 129
149int iwl_power_update_mode(struct iwl_priv *priv, bool force); 130int iwl_power_update_mode(struct iwl_priv *priv, bool force);
150int iwl_power_set_user_mode(struct iwl_priv *priv, u16 mode);
151bool iwl_ht_enabled(struct iwl_priv *priv); 131bool iwl_ht_enabled(struct iwl_priv *priv);
152enum iwl_antenna_ok iwl_tx_ant_restriction(struct iwl_priv *priv); 132enum iwl_antenna_ok iwl_tx_ant_restriction(struct iwl_priv *priv);
153enum iwl_antenna_ok iwl_rx_ant_restriction(struct iwl_priv *priv); 133enum iwl_antenna_ok iwl_rx_ant_restriction(struct iwl_priv *priv);
@@ -158,4 +138,6 @@ void iwl_tt_initialize(struct iwl_priv *priv);
158void iwl_tt_exit(struct iwl_priv *priv); 138void iwl_tt_exit(struct iwl_priv *priv);
159void iwl_power_initialize(struct iwl_priv *priv); 139void iwl_power_initialize(struct iwl_priv *priv);
160 140
141extern bool no_sleep_autoadjust;
142
161#endif /* __iwl_power_setting_h__ */ 143#endif /* __iwl_power_setting_h__ */