diff options
author | John W. Linville <linville@tuxdriver.com> | 2012-05-22 23:18:06 +0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-05-22 23:18:06 +0400 |
commit | a0d0d1685f9763ab26a394df3ab84026b39a06a7 (patch) | |
tree | 4165dc6fd3266977ab4b3fa3b379c47597f97d88 /drivers/net/wireless/iwlwifi/iwl-power.c | |
parent | 31a67102f4762df5544bc2dfb34a931233d2a5b2 (diff) | |
parent | 05f8f25276ea8c7d41b3649890d6eaf179e67a81 (diff) | |
download | linux-a0d0d1685f9763ab26a394df3ab84026b39a06a7.tar.xz |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-power.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-power.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c index 8352265dbc4b..544ddf17f5bd 100644 --- a/drivers/net/wireless/iwlwifi/iwl-power.c +++ b/drivers/net/wireless/iwlwifi/iwl-power.c @@ -253,6 +253,8 @@ static void iwl_static_sleep_cmd(struct iwl_priv *priv, IWL_DEBUG_POWER(priv, "numSkipDtim = %u, dtimPeriod = %d\n", skip, period); + /* The power level here is 0-4 (used as array index), but user expects + to see 1-5 (according to spec). */ IWL_DEBUG_POWER(priv, "Sleep command for index %d\n", lvl + 1); } @@ -308,10 +310,12 @@ static void iwl_power_build_cmd(struct iwl_priv *priv, priv->power_data.debug_sleep_level_override, dtimper); else { + /* Note that the user parameter is 1-5 (according to spec), + but we pass 0-4 because it acts as an array index. */ if (iwlwifi_mod_params.power_level > IWL_POWER_INDEX_1 && - iwlwifi_mod_params.power_level <= IWL_POWER_INDEX_5) + iwlwifi_mod_params.power_level <= IWL_POWER_NUM) iwl_static_sleep_cmd(priv, cmd, - iwlwifi_mod_params.power_level, dtimper); + iwlwifi_mod_params.power_level - 1, dtimper); else iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_1, dtimper); |