diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2011-06-11 13:00:06 -0400 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2011-06-18 11:23:30 -0400 |
commit | f7538168915271083070a60ebb10def11fce0cb0 (patch) | |
tree | 00471adb17178ec7bd2b8a50cb8fb366c5d45919 | |
parent | 0172b02926493863e2e3a35f1d7bf13e935e655c (diff) |
iwlagn: Add power_level module parameter
Add power_level module parameter to set the default power save level.
Power save level has range from 1 - 5, default power save level is 1.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-power.c | 12 |
4 files changed, 16 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c index 52da53997d4c..efdab6506ae7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c | |||
@@ -624,6 +624,7 @@ struct iwl_mod_params iwlagn_mod_params = { | |||
624 | .plcp_check = true, | 624 | .plcp_check = true, |
625 | .bt_coex_active = true, | 625 | .bt_coex_active = true, |
626 | .no_sleep_autoadjust = true, | 626 | .no_sleep_autoadjust = true, |
627 | .power_level = IWL_POWER_INDEX_1, | ||
627 | /* the rest are 0 by default */ | 628 | /* the rest are 0 by default */ |
628 | }; | 629 | }; |
629 | 630 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index b719628b4fc7..77ceb8deff75 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -3831,6 +3831,11 @@ module_param_named(power_save, iwlagn_mod_params.power_save, | |||
3831 | MODULE_PARM_DESC(power_save, | 3831 | MODULE_PARM_DESC(power_save, |
3832 | "enable WiFi power management (default: disable)"); | 3832 | "enable WiFi power management (default: disable)"); |
3833 | 3833 | ||
3834 | module_param_named(power_level, iwlagn_mod_params.power_level, | ||
3835 | int, S_IRUGO); | ||
3836 | MODULE_PARM_DESC(power_level, | ||
3837 | "default power save level (range from 1 - 5, default: 1)"); | ||
3838 | |||
3834 | /* | 3839 | /* |
3835 | * For now, keep using power level 1 instead of automatically | 3840 | * For now, keep using power level 1 instead of automatically |
3836 | * adjusting ... | 3841 | * adjusting ... |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 6238ac628020..adf9f9b2efb5 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -164,6 +164,7 @@ struct iwl_mod_params { | |||
164 | int led_mode; /* def: 0 = system default */ | 164 | int led_mode; /* def: 0 = system default */ |
165 | bool no_sleep_autoadjust; /* def: true = disable autoadjust */ | 165 | bool no_sleep_autoadjust; /* def: true = disable autoadjust */ |
166 | bool power_save; /* def: false = disable power save */ | 166 | bool power_save; /* def: false = disable power save */ |
167 | int power_level; /* def: 1 = power level */ | ||
167 | }; | 168 | }; |
168 | 169 | ||
169 | /* | 170 | /* |
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c index 970c514623b9..565e57e48be8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-power.c +++ b/drivers/net/wireless/iwlwifi/iwl-power.c | |||
@@ -358,9 +358,15 @@ static void iwl_power_build_cmd(struct iwl_priv *priv, | |||
358 | iwl_static_sleep_cmd(priv, cmd, | 358 | iwl_static_sleep_cmd(priv, cmd, |
359 | priv->power_data.debug_sleep_level_override, | 359 | priv->power_data.debug_sleep_level_override, |
360 | dtimper); | 360 | dtimper); |
361 | else if (iwlagn_mod_params.no_sleep_autoadjust) | 361 | else if (iwlagn_mod_params.no_sleep_autoadjust) { |
362 | iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_1, dtimper); | 362 | if (iwlagn_mod_params.power_level > IWL_POWER_INDEX_1 && |
363 | else | 363 | iwlagn_mod_params.power_level <= IWL_POWER_INDEX_5) |
364 | iwl_static_sleep_cmd(priv, cmd, | ||
365 | iwlagn_mod_params.power_level, dtimper); | ||
366 | else | ||
367 | iwl_static_sleep_cmd(priv, cmd, | ||
368 | IWL_POWER_INDEX_1, dtimper); | ||
369 | } else | ||
364 | iwl_power_fill_sleep_cmd(priv, cmd, | 370 | iwl_power_fill_sleep_cmd(priv, cmd, |
365 | priv->hw->conf.dynamic_ps_timeout, | 371 | priv->hw->conf.dynamic_ps_timeout, |
366 | priv->hw->conf.max_sleep_period); | 372 | priv->hw->conf.max_sleep_period); |