iwlagn: temperature should be measure for all _agn devices
authorWey-Yi Guy <wey-yi.w.guy@intel.com>
Mon, 18 Apr 2011 16:30:09 +0000 (09:30 -0700)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Mon, 18 Apr 2011 16:30:09 +0000 (09:30 -0700)
Thermal throttling functions are available for all _agn devices, call the
functions directly.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
drivers/net/wireless/iwlwifi/iwl-1000.c
drivers/net/wireless/iwlwifi/iwl-2000.c
drivers/net/wireless/iwlwifi/iwl-5000.c
drivers/net/wireless/iwlwifi/iwl-6000.c
drivers/net/wireless/iwlwifi/iwl-core.h
drivers/net/wireless/iwlwifi/iwl-power.c
drivers/net/wireless/iwlwifi/iwl-tx.c

index e7844565ef554be1f02afb02e9b7eaf91b05f2d7..946c7dca440a7293fc8bd12d7632e45f934f715f 100644 (file)
@@ -214,11 +214,6 @@ static struct iwl_lib_ops iwl1000_lib = {
        },
        .txfifo_flush = iwlagn_txfifo_flush,
        .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
-       .tt_ops = {
-               .lower_power_detection = iwl_tt_is_low_power_state,
-               .tt_power_mode = iwl_tt_current_power_mode,
-               .ct_kill_check = iwl_check_for_ct_kill,
-       }
 };
 
 static const struct iwl_ops iwl1000_ops = {
index dcd660818d213f6cc8758146f45206f363375697..c8bb4a4930dfffabf232ec7caf3119640983a236 100644 (file)
@@ -298,11 +298,6 @@ static struct iwl_lib_ops iwl2000_lib = {
        },
        .txfifo_flush = iwlagn_txfifo_flush,
        .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
-       .tt_ops = {
-               .lower_power_detection = iwl_tt_is_low_power_state,
-               .tt_power_mode = iwl_tt_current_power_mode,
-               .ct_kill_check = iwl_check_for_ct_kill,
-       }
 };
 
 static const struct iwl_ops iwl2000_ops = {
index 14b75f1de18650bf0b717915931def55d3f465b5..ced89f662bd10b61791019706b7554fd6de8a449 100644 (file)
@@ -383,11 +383,6 @@ static struct iwl_lib_ops iwl5000_lib = {
        },
        .txfifo_flush = iwlagn_txfifo_flush,
        .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
-       .tt_ops = {
-               .lower_power_detection = iwl_tt_is_low_power_state,
-               .tt_power_mode = iwl_tt_current_power_mode,
-               .ct_kill_check = iwl_check_for_ct_kill,
-       }
 };
 
 static struct iwl_lib_ops iwl5150_lib = {
@@ -435,11 +430,6 @@ static struct iwl_lib_ops iwl5150_lib = {
        },
        .txfifo_flush = iwlagn_txfifo_flush,
        .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
-       .tt_ops = {
-               .lower_power_detection = iwl_tt_is_low_power_state,
-               .tt_power_mode = iwl_tt_current_power_mode,
-               .ct_kill_check = iwl_check_for_ct_kill,
-       }
 };
 
 static const struct iwl_ops iwl5000_ops = {
index 81881aad87513707ed29e558ae7c4c5cec19a84b..ed6a0ed0f501cc77955a2dea7c6bf3f74c49b49d 100644 (file)
@@ -323,11 +323,6 @@ static struct iwl_lib_ops iwl6000_lib = {
        },
        .txfifo_flush = iwlagn_txfifo_flush,
        .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
-       .tt_ops = {
-               .lower_power_detection = iwl_tt_is_low_power_state,
-               .tt_power_mode = iwl_tt_current_power_mode,
-               .ct_kill_check = iwl_check_for_ct_kill,
-       }
 };
 
 static struct iwl_lib_ops iwl6030_lib = {
@@ -377,11 +372,6 @@ static struct iwl_lib_ops iwl6030_lib = {
        },
        .txfifo_flush = iwlagn_txfifo_flush,
        .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
-       .tt_ops = {
-               .lower_power_detection = iwl_tt_is_low_power_state,
-               .tt_power_mode = iwl_tt_current_power_mode,
-               .ct_kill_check = iwl_check_for_ct_kill,
-       }
 };
 
 static struct iwl_nic_ops iwl6050_nic_ops = {
index 2e8c936e556de04a633edc2f8001bcb6a3f826b8..abee5074d30e13636cc81cd8962b0aeb194fb7b4 100644 (file)
@@ -139,12 +139,6 @@ struct iwl_temp_ops {
        void (*temperature)(struct iwl_priv *priv);
 };
 
-struct iwl_tt_ops {
-       bool (*lower_power_detection)(struct iwl_priv *priv);
-       u8 (*tt_power_mode)(struct iwl_priv *priv);
-       bool (*ct_kill_check)(struct iwl_priv *priv);
-};
-
 struct iwl_lib_ops {
        /* set hw dependent parameters */
        int (*set_hw_params)(struct iwl_priv *priv);
@@ -190,9 +184,6 @@ struct iwl_lib_ops {
        void (*dev_txfifo_flush)(struct iwl_priv *priv, u16 flush_control);
 
        struct iwl_debugfs_ops debugfs_ops;
-
-       /* thermal throttling */
-       struct iwl_tt_ops tt_ops;
 };
 
 struct iwl_led_ops {
index b7cd95820ff830a221a11c6b32051a11cdd9f32f..595c930b28aebaf9bccd9ec50ab936190246345a 100644 (file)
@@ -357,12 +357,10 @@ static void iwl_power_build_cmd(struct iwl_priv *priv,
 
        if (priv->hw->conf.flags & IEEE80211_CONF_IDLE)
                iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, 20);
-       else if (priv->cfg->ops->lib->tt_ops.lower_power_detection &&
-                priv->cfg->ops->lib->tt_ops.tt_power_mode &&
-                priv->cfg->ops->lib->tt_ops.lower_power_detection(priv)) {
+       else if (iwl_tt_is_low_power_state(priv)) {
                /* in thermal throttling low power state */
                iwl_static_sleep_cmd(priv, cmd,
-                   priv->cfg->ops->lib->tt_ops.tt_power_mode(priv), dtimper);
+                   iwl_tt_current_power_mode(priv), dtimper);
        } else if (!enabled)
                iwl_power_sleep_cam_cmd(priv, cmd);
        else if (priv->power_data.debug_sleep_level_override >= 0)
index 1b69507db5fcd0d0360f495bb43fc9c00fd4a611..80c3565a66ae5361810d87de034f1284b3ed94d8 100644 (file)
@@ -484,10 +484,7 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
                spin_unlock_irqrestore(&priv->hcmd_lock, flags);
 
                IWL_ERR(priv, "No space in command queue\n");
-               if (priv->cfg->ops->lib->tt_ops.ct_kill_check) {
-                       is_ct_kill =
-                               priv->cfg->ops->lib->tt_ops.ct_kill_check(priv);
-               }
+               is_ct_kill = iwl_check_for_ct_kill(priv);
                if (!is_ct_kill) {
                        IWL_ERR(priv, "Restarting adapter due to queue full\n");
                        iwlagn_fw_error(priv, false);