diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-power.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-power.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c index ae176d8da9e8..595c930b28ae 100644 --- a/drivers/net/wireless/iwlwifi/iwl-power.c +++ b/drivers/net/wireless/iwlwifi/iwl-power.c | |||
@@ -188,9 +188,10 @@ static void iwl_static_sleep_cmd(struct iwl_priv *priv, | |||
188 | table = range_0; | 188 | table = range_0; |
189 | } | 189 | } |
190 | 190 | ||
191 | BUG_ON(lvl < 0 || lvl >= IWL_POWER_NUM); | 191 | if (WARN_ON(lvl < 0 || lvl >= IWL_POWER_NUM)) |
192 | 192 | memset(cmd, 0, sizeof(*cmd)); | |
193 | *cmd = table[lvl].cmd; | 193 | else |
194 | *cmd = table[lvl].cmd; | ||
194 | 195 | ||
195 | if (period == 0) { | 196 | if (period == 0) { |
196 | skip = 0; | 197 | skip = 0; |
@@ -356,12 +357,10 @@ static void iwl_power_build_cmd(struct iwl_priv *priv, | |||
356 | 357 | ||
357 | if (priv->hw->conf.flags & IEEE80211_CONF_IDLE) | 358 | if (priv->hw->conf.flags & IEEE80211_CONF_IDLE) |
358 | iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, 20); | 359 | iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, 20); |
359 | else if (priv->cfg->ops->lib->tt_ops.lower_power_detection && | 360 | else if (iwl_tt_is_low_power_state(priv)) { |
360 | priv->cfg->ops->lib->tt_ops.tt_power_mode && | ||
361 | priv->cfg->ops->lib->tt_ops.lower_power_detection(priv)) { | ||
362 | /* in thermal throttling low power state */ | 361 | /* in thermal throttling low power state */ |
363 | iwl_static_sleep_cmd(priv, cmd, | 362 | iwl_static_sleep_cmd(priv, cmd, |
364 | priv->cfg->ops->lib->tt_ops.tt_power_mode(priv), dtimper); | 363 | iwl_tt_current_power_mode(priv), dtimper); |
365 | } else if (!enabled) | 364 | } else if (!enabled) |
366 | iwl_power_sleep_cam_cmd(priv, cmd); | 365 | iwl_power_sleep_cam_cmd(priv, cmd); |
367 | else if (priv->power_data.debug_sleep_level_override >= 0) | 366 | else if (priv->power_data.debug_sleep_level_override >= 0) |