iwlagn: remove the indirection for the dma channel num
[pandora-kernel.git] / drivers / net / wireless / iwlwifi / iwl-power.c
index 970c514..0c08dfd 100644 (file)
@@ -334,7 +334,7 @@ static int iwl_set_power(struct iwl_priv *priv, struct iwl_powertable_cmd *cmd)
                        le32_to_cpu(cmd->sleep_interval[3]),
                        le32_to_cpu(cmd->sleep_interval[4]));
 
-       return iwl_send_cmd_pdu(priv, POWER_TABLE_CMD,
+       return priv->trans.ops->send_cmd_pdu(priv, POWER_TABLE_CMD, CMD_SYNC,
                                sizeof(struct iwl_powertable_cmd), cmd);
 }
 
@@ -358,9 +358,15 @@ static void iwl_power_build_cmd(struct iwl_priv *priv,
                iwl_static_sleep_cmd(priv, cmd,
                                     priv->power_data.debug_sleep_level_override,
                                     dtimper);
-       else if (iwlagn_mod_params.no_sleep_autoadjust)
-               iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_1, dtimper);
-       else
+       else if (iwlagn_mod_params.no_sleep_autoadjust) {
+               if (iwlagn_mod_params.power_level > IWL_POWER_INDEX_1 &&
+                   iwlagn_mod_params.power_level <= IWL_POWER_INDEX_5)
+                       iwl_static_sleep_cmd(priv, cmd,
+                               iwlagn_mod_params.power_level, dtimper);
+               else
+                       iwl_static_sleep_cmd(priv, cmd,
+                               IWL_POWER_INDEX_1, dtimper);
+       } else
                iwl_power_fill_sleep_cmd(priv, cmd,
                                         priv->hw->conf.dynamic_ps_timeout,
                                         priv->hw->conf.max_sleep_period);