diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2008-04-21 18:41:58 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-07 15:02:16 -0400 |
commit | b73cdf27e0f412bcd01802287bb9710e6b74fca5 (patch) | |
tree | dd84c4712d7aa630be229d392fed6a925a7210f1 | |
parent | fe7c4040c3d8b7de521e9a48ae583580f8e31127 (diff) |
iwlwifi: CT-Kill configuration fix
This patch fixes the configuration of CT-Kill.
Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index 9b3a745b66b7..91cc03f76e1a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -969,15 +969,9 @@ static void iwl4965_bg_statistics_periodic(unsigned long data) | |||
969 | iwl_send_statistics_request(priv, CMD_ASYNC); | 969 | iwl_send_statistics_request(priv, CMD_ASYNC); |
970 | } | 970 | } |
971 | 971 | ||
972 | #define CT_LIMIT_CONST 259 | ||
973 | #define TM_CT_KILL_THRESHOLD 110 | ||
974 | |||
975 | void iwl4965_rf_kill_ct_config(struct iwl_priv *priv) | 972 | void iwl4965_rf_kill_ct_config(struct iwl_priv *priv) |
976 | { | 973 | { |
977 | struct iwl4965_ct_kill_config cmd; | 974 | struct iwl4965_ct_kill_config cmd; |
978 | u32 R1, R2, R3; | ||
979 | u32 temp_th; | ||
980 | u32 crit_temperature; | ||
981 | unsigned long flags; | 975 | unsigned long flags; |
982 | int ret = 0; | 976 | int ret = 0; |
983 | 977 | ||
@@ -986,27 +980,17 @@ void iwl4965_rf_kill_ct_config(struct iwl_priv *priv) | |||
986 | CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT); | 980 | CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT); |
987 | spin_unlock_irqrestore(&priv->lock, flags); | 981 | spin_unlock_irqrestore(&priv->lock, flags); |
988 | 982 | ||
989 | if (priv->statistics.flag & STATISTICS_REPLY_FLG_FAT_MODE_MSK) { | ||
990 | R1 = (s32)le32_to_cpu(priv->card_alive_init.therm_r1[1]); | ||
991 | R2 = (s32)le32_to_cpu(priv->card_alive_init.therm_r2[1]); | ||
992 | R3 = (s32)le32_to_cpu(priv->card_alive_init.therm_r3[1]); | ||
993 | } else { | ||
994 | R1 = (s32)le32_to_cpu(priv->card_alive_init.therm_r1[0]); | ||
995 | R2 = (s32)le32_to_cpu(priv->card_alive_init.therm_r2[0]); | ||
996 | R3 = (s32)le32_to_cpu(priv->card_alive_init.therm_r3[0]); | ||
997 | } | ||
998 | |||
999 | temp_th = CELSIUS_TO_KELVIN(TM_CT_KILL_THRESHOLD); | ||
1000 | |||
1001 | crit_temperature = ((temp_th * (R3-R1))/CT_LIMIT_CONST) + R2; | ||
1002 | cmd.critical_temperature_R = | 983 | cmd.critical_temperature_R = |
1003 | cpu_to_le32(priv->hw_params.ct_kill_threshold); | 984 | cpu_to_le32(priv->hw_params.ct_kill_threshold); |
985 | |||
1004 | ret = iwl_send_cmd_pdu(priv, REPLY_CT_KILL_CONFIG_CMD, | 986 | ret = iwl_send_cmd_pdu(priv, REPLY_CT_KILL_CONFIG_CMD, |
1005 | sizeof(cmd), &cmd); | 987 | sizeof(cmd), &cmd); |
1006 | if (ret) | 988 | if (ret) |
1007 | IWL_ERROR("REPLY_CT_KILL_CONFIG_CMD failed\n"); | 989 | IWL_ERROR("REPLY_CT_KILL_CONFIG_CMD failed\n"); |
1008 | else | 990 | else |
1009 | IWL_DEBUG_INFO("REPLY_CT_KILL_CONFIG_CMD succeeded\n"); | 991 | IWL_DEBUG_INFO("REPLY_CT_KILL_CONFIG_CMD succeeded, " |
992 | "critical temperature is %d\n", | ||
993 | cmd.critical_temperature_R); | ||
1010 | } | 994 | } |
1011 | 995 | ||
1012 | #ifdef CONFIG_IWL4965_RUN_TIME_CALIB | 996 | #ifdef CONFIG_IWL4965_RUN_TIME_CALIB |