diff options
| author | Tomas Winkler <tomas.winkler@intel.com> | 2008-12-01 19:32:20 -0500 |
|---|---|---|
| committer | John W. Linville <linville@tuxdriver.com> | 2008-12-05 09:35:49 -0500 |
| commit | 339afc893d3c1a36151c7578d7eacd2f4b293d5f (patch) | |
| tree | 062616b69aebd4e887fb5624f9915a5e69c7fbad | |
| parent | 819500c5892aeeed079d3ea1671df40f2dd1d417 (diff) | |
iwlwifi: 5150 compute ct kill threshold
This patch adds computation of ct kill threshold
for 5150. Threshold is computed from calibration
data in the EEPROM.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
| -rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000.c | 13 | ||||
| -rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-eeprom.h | 1 |
2 files changed, 13 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index c1e7a4264086..26e04eccaa85 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
| @@ -426,6 +426,17 @@ static const u8 *iwl5000_eeprom_query_addr(const struct iwl_priv *priv, | |||
| 426 | return &priv->eeprom[address]; | 426 | return &priv->eeprom[address]; |
| 427 | } | 427 | } |
| 428 | 428 | ||
| 429 | static s32 iwl5150_get_ct_threshold(struct iwl_priv *priv) | ||
| 430 | { | ||
| 431 | const s32 volt2temp_coef = -5; | ||
| 432 | u16 *temp_calib = (u16 *)iwl_eeprom_query_addr(priv, | ||
| 433 | EEPROM_5000_TEMPERATURE); | ||
| 434 | /* offset = temperate - voltage / coef */ | ||
| 435 | s32 offset = temp_calib[0] - temp_calib[1] / volt2temp_coef; | ||
| 436 | s32 threshold = (s32)CELSIUS_TO_KELVIN(CT_KILL_THRESHOLD) - offset; | ||
| 437 | return threshold * volt2temp_coef; | ||
| 438 | } | ||
| 439 | |||
| 429 | /* | 440 | /* |
| 430 | * Calibration | 441 | * Calibration |
| 431 | */ | 442 | */ |
| @@ -859,7 +870,7 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv) | |||
| 859 | case CSR_HW_REV_TYPE_5150: | 870 | case CSR_HW_REV_TYPE_5150: |
| 860 | /* 5150 wants in Kelvin */ | 871 | /* 5150 wants in Kelvin */ |
| 861 | priv->hw_params.ct_kill_threshold = | 872 | priv->hw_params.ct_kill_threshold = |
| 862 | CELSIUS_TO_KELVIN(CT_KILL_THRESHOLD); | 873 | iwl5150_get_ct_threshold(priv); |
| 863 | break; | 874 | break; |
| 864 | } | 875 | } |
| 865 | 876 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.h b/drivers/net/wireless/iwlwifi/iwl-eeprom.h index 997f23c8db2e..8f6b05fa2330 100644 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom.h +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.h | |||
| @@ -147,6 +147,7 @@ struct iwl_eeprom_channel { | |||
| 147 | /*5000 calibrations */ | 147 | /*5000 calibrations */ |
| 148 | #define EEPROM_5000_CALIB_ALL (INDIRECT_ADDRESS | INDIRECT_CALIBRATION) | 148 | #define EEPROM_5000_CALIB_ALL (INDIRECT_ADDRESS | INDIRECT_CALIBRATION) |
| 149 | #define EEPROM_5000_XTAL ((2*0x128) | EEPROM_5000_CALIB_ALL) | 149 | #define EEPROM_5000_XTAL ((2*0x128) | EEPROM_5000_CALIB_ALL) |
| 150 | #define EEPROM_5000_TEMPERATURE ((2*0x12A) | EEPROM_5000_CALIB_ALL) | ||
| 150 | 151 | ||
| 151 | /* 5000 links */ | 152 | /* 5000 links */ |
| 152 | #define EEPROM_5000_LINK_HOST (2*0x64) | 153 | #define EEPROM_5000_LINK_HOST (2*0x64) |
