diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-03-18 13:56:32 -0400 |
---|---|---|
committer | Reinette Chatre <reinette.chatre@intel.com> | 2010-03-25 14:20:58 -0400 |
commit | 2f3f7f9c23287c742af1d435b6fe8b9c9c7b7bd9 (patch) | |
tree | ecba99adab910bc7b49dd1cc6e8c3e04e4e16c20 /drivers | |
parent | ed1b6e99b5e64d2b9cdf764754a072c7fdc1c3c4 (diff) |
iwlwifi: Generic approach to measure temperature
In stead of checking for 4965 and do KELVIN_TO_CELSIUS conversation, add
.cfg parameter for more generic approach.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-power.c | 8 |
3 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index af48d07bb29d..1b5ced5159b8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -2258,6 +2258,7 @@ struct iwl_cfg iwl4965_agn_cfg = { | |||
2258 | .chain_noise_num_beacons = IWL4965_CAL_NUM_BEACONS, | 2258 | .chain_noise_num_beacons = IWL4965_CAL_NUM_BEACONS, |
2259 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, | 2259 | .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF, |
2260 | .monitor_recover_period = IWL_MONITORING_PERIOD, | 2260 | .monitor_recover_period = IWL_MONITORING_PERIOD, |
2261 | .temperature_kelvin = true, | ||
2261 | }; | 2262 | }; |
2262 | 2263 | ||
2263 | /* Module firmware */ | 2264 | /* Module firmware */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 22f84f3c3c40..e9b0411de845 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -305,6 +305,7 @@ struct iwl_cfg { | |||
305 | s32 chain_noise_scale; | 305 | s32 chain_noise_scale; |
306 | /* timer period for monitor the driver queues */ | 306 | /* timer period for monitor the driver queues */ |
307 | u32 monitor_recover_period; | 307 | u32 monitor_recover_period; |
308 | bool temperature_kelvin; | ||
308 | }; | 309 | }; |
309 | 310 | ||
310 | /*************************** | 311 | /*************************** |
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c index 1a1a9f081cc7..e0581a771aab 100644 --- a/drivers/net/wireless/iwlwifi/iwl-power.c +++ b/drivers/net/wireless/iwlwifi/iwl-power.c | |||
@@ -383,10 +383,10 @@ EXPORT_SYMBOL(iwl_ht_enabled); | |||
383 | 383 | ||
384 | bool iwl_within_ct_kill_margin(struct iwl_priv *priv) | 384 | bool iwl_within_ct_kill_margin(struct iwl_priv *priv) |
385 | { | 385 | { |
386 | s32 temp = priv->temperature; /* degrees CELSIUS except 4965 */ | 386 | s32 temp = priv->temperature; /* degrees CELSIUS except specified */ |
387 | bool within_margin = false; | 387 | bool within_margin = false; |
388 | 388 | ||
389 | if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_4965) | 389 | if (priv->cfg->temperature_kelvin) |
390 | temp = KELVIN_TO_CELSIUS(priv->temperature); | 390 | temp = KELVIN_TO_CELSIUS(priv->temperature); |
391 | 391 | ||
392 | if (!priv->thermal_throttle.advanced_tt) | 392 | if (!priv->thermal_throttle.advanced_tt) |
@@ -839,12 +839,12 @@ EXPORT_SYMBOL(iwl_tt_exit_ct_kill); | |||
839 | static void iwl_bg_tt_work(struct work_struct *work) | 839 | static void iwl_bg_tt_work(struct work_struct *work) |
840 | { | 840 | { |
841 | struct iwl_priv *priv = container_of(work, struct iwl_priv, tt_work); | 841 | struct iwl_priv *priv = container_of(work, struct iwl_priv, tt_work); |
842 | s32 temp = priv->temperature; /* degrees CELSIUS except 4965 */ | 842 | s32 temp = priv->temperature; /* degrees CELSIUS except specified */ |
843 | 843 | ||
844 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | 844 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) |
845 | return; | 845 | return; |
846 | 846 | ||
847 | if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_4965) | 847 | if (priv->cfg->temperature_kelvin) |
848 | temp = KELVIN_TO_CELSIUS(priv->temperature); | 848 | temp = KELVIN_TO_CELSIUS(priv->temperature); |
849 | 849 | ||
850 | if (!priv->thermal_throttle.advanced_tt) | 850 | if (!priv->thermal_throttle.advanced_tt) |