include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / net / wireless / iwlwifi / iwl-power.c
index 8ccc0bb1d9ed00c0fe9391acae0aa0dff0fbfaa2..548dac2f6a960363b5046f1df0e8f5cf034941ae 100644 (file)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * Copyright(c) 2007 - 2009 Intel Corporation. All rights reserved.
+ * Copyright(c) 2007 - 2010 Intel Corporation. All rights reserved.
  *
  * Portions of this file are derived from the ipw3945 project, as well
  * as portions of the ieee80211 subsystem header files.
@@ -29,6 +29,7 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 
 #include <net/mac80211.h>
@@ -303,13 +304,12 @@ static int iwl_set_power(struct iwl_priv *priv, struct iwl_powertable_cmd *cmd)
                                sizeof(struct iwl_powertable_cmd), cmd);
 }
 
-
+/* priv->mutex must be held */
 int iwl_power_update_mode(struct iwl_priv *priv, bool force)
 {
        int ret = 0;
        struct iwl_tt_mgmt *tt = &priv->thermal_throttle;
-       bool enabled = (priv->iw_mode == NL80211_IFTYPE_STATION) &&
-                       (priv->hw->conf.flags & IEEE80211_CONF_PS);
+       bool enabled = priv->hw->conf.flags & IEEE80211_CONF_PS;
        bool update_chains;
        struct iwl_powertable_cmd cmd;
        int dtimper;
@@ -319,7 +319,7 @@ int iwl_power_update_mode(struct iwl_priv *priv, bool force)
                        priv->chain_noise_data.state == IWL_CHAIN_NOISE_ALIVE;
 
        if (priv->vif)
-               dtimper = priv->vif->bss_conf.dtim_period;
+               dtimper = priv->hw->conf.ps_dtim_period;
        else
                dtimper = 1;