diff options
author | Winkler, Tomas <tomas.winkler@intel.com> | 2009-01-27 17:27:58 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-09 15:03:34 -0500 |
commit | d25aabb0a1a2f659206ba21f6ac8ec28047e5595 (patch) | |
tree | 2ac07193062fbeb1ac8b784f33dce21a9a668230 /drivers/net/wireless/iwlwifi/iwl-power.c | |
parent | e1623446bb1de1834ff1c57b3e8ed341d5d4a927 (diff) |
iwlwifi: unify iwlagn and 3945 power save management
This patch unifies 3945 and iwlagn power save management
This patch also better separates system state from user setting.
System state shall be removed later as this shall be shifted to user space
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Mohamed Abbas <mohamed.abbas@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.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-power.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c index abe0d2966a56..4c5a775f48b7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-power.c +++ b/drivers/net/wireless/iwlwifi/iwl-power.c | |||
@@ -102,6 +102,7 @@ static struct iwl_power_vec_entry range_2[IWL_POWER_MAX] = { | |||
102 | {{SLP, SLP_TOUT(25), SLP_TOUT(25), SLP_VEC(4, 7, 10, 10, 0xFF)}, 0} | 102 | {{SLP, SLP_TOUT(25), SLP_TOUT(25), SLP_VEC(4, 7, 10, 10, 0xFF)}, 0} |
103 | }; | 103 | }; |
104 | 104 | ||
105 | |||
105 | /* set card power command */ | 106 | /* set card power command */ |
106 | static int iwl_set_power(struct iwl_priv *priv, void *cmd) | 107 | static int iwl_set_power(struct iwl_priv *priv, void *cmd) |
107 | { | 108 | { |
@@ -126,13 +127,6 @@ static u16 iwl_get_auto_power_mode(struct iwl_priv *priv) | |||
126 | else | 127 | else |
127 | mode = IWL_POWER_ON_AC_DISASSOC; | 128 | mode = IWL_POWER_ON_AC_DISASSOC; |
128 | break; | 129 | break; |
129 | /* FIXME: remove battery and ac from here */ | ||
130 | case IWL_POWER_BATTERY: | ||
131 | mode = IWL_POWER_INDEX_3; | ||
132 | break; | ||
133 | case IWL_POWER_AC: | ||
134 | mode = IWL_POWER_MODE_CAM; | ||
135 | break; | ||
136 | default: | 130 | default: |
137 | mode = priv->power_data.user_power_setting; | 131 | mode = priv->power_data.user_power_setting; |
138 | break; | 132 | break; |
@@ -357,7 +351,7 @@ EXPORT_SYMBOL(iwl_power_enable_management); | |||
357 | /* set user_power_setting */ | 351 | /* set user_power_setting */ |
358 | int iwl_power_set_user_mode(struct iwl_priv *priv, u16 mode) | 352 | int iwl_power_set_user_mode(struct iwl_priv *priv, u16 mode) |
359 | { | 353 | { |
360 | if (mode > IWL_POWER_LIMIT) | 354 | if (mode > IWL_POWER_MAX) |
361 | return -EINVAL; | 355 | return -EINVAL; |
362 | 356 | ||
363 | priv->power_data.user_power_setting = mode; | 357 | priv->power_data.user_power_setting = mode; |
@@ -371,11 +365,10 @@ EXPORT_SYMBOL(iwl_power_set_user_mode); | |||
371 | */ | 365 | */ |
372 | int iwl_power_set_system_mode(struct iwl_priv *priv, u16 mode) | 366 | int iwl_power_set_system_mode(struct iwl_priv *priv, u16 mode) |
373 | { | 367 | { |
374 | if (mode > IWL_POWER_LIMIT) | 368 | if (mode < IWL_POWER_SYS_MAX) |
369 | priv->power_data.system_power_setting = mode; | ||
370 | else | ||
375 | return -EINVAL; | 371 | return -EINVAL; |
376 | |||
377 | priv->power_data.system_power_setting = mode; | ||
378 | |||
379 | return iwl_power_update_mode(priv, 0); | 372 | return iwl_power_update_mode(priv, 0); |
380 | } | 373 | } |
381 | EXPORT_SYMBOL(iwl_power_set_system_mode); | 374 | EXPORT_SYMBOL(iwl_power_set_system_mode); |