aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-5000.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2009-07-24 14:13:01 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-27 15:24:20 -0400
commit672639de13c4db92ed6a47e68043a4317e219902 (patch)
tree68159ff1d3e182780cb62aa4f69725287e417474 /drivers/net/wireless/iwlwifi/iwl-5000.c
parente3139fe741b25a0f8a27fd2cdf2ad11734c3d4d3 (diff)
iwlwifi: critical temperature enter/exit condition
If advance thermal throttling is used the driver need to pass both "enter" and "exit" temperature to uCode. Using different critical temperature threshold for legacy and advance thermal throttling management based on the type of thermal throttling method is used except 1000. For 1000, it use advance thermal throttling critical temperature threshold, but with legacy thermal management implementation until ucode has the necessary implementations in place. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-5000.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 702db07fa382..076acb13ba6d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -91,7 +91,7 @@ static int iwl5000_apm_stop_master(struct iwl_priv *priv)
91} 91}
92 92
93 93
94static int iwl5000_apm_init(struct iwl_priv *priv) 94int iwl5000_apm_init(struct iwl_priv *priv)
95{ 95{
96 int ret = 0; 96 int ret = 0;
97 97
@@ -137,7 +137,7 @@ static int iwl5000_apm_init(struct iwl_priv *priv)
137} 137}
138 138
139/* FIXME: this is identical to 4965 */ 139/* FIXME: this is identical to 4965 */
140static void iwl5000_apm_stop(struct iwl_priv *priv) 140void iwl5000_apm_stop(struct iwl_priv *priv)
141{ 141{
142 unsigned long flags; 142 unsigned long flags;
143 143
@@ -156,7 +156,7 @@ static void iwl5000_apm_stop(struct iwl_priv *priv)
156} 156}
157 157
158 158
159static int iwl5000_apm_reset(struct iwl_priv *priv) 159int iwl5000_apm_reset(struct iwl_priv *priv)
160{ 160{
161 int ret = 0; 161 int ret = 0;
162 162
@@ -198,7 +198,7 @@ out:
198} 198}
199 199
200 200
201static void iwl5000_nic_config(struct iwl_priv *priv) 201void iwl5000_nic_config(struct iwl_priv *priv)
202{ 202{
203 unsigned long flags; 203 unsigned long flags;
204 u16 radio_cfg; 204 u16 radio_cfg;
@@ -290,7 +290,7 @@ static u32 eeprom_indirect_address(const struct iwl_priv *priv, u32 address)
290 return (address & ADDRESS_MSK) + (offset << 1); 290 return (address & ADDRESS_MSK) + (offset << 1);
291} 291}
292 292
293static u16 iwl5000_eeprom_calib_version(struct iwl_priv *priv) 293u16 iwl5000_eeprom_calib_version(struct iwl_priv *priv)
294{ 294{
295 struct iwl_eeprom_calib_hdr { 295 struct iwl_eeprom_calib_hdr {
296 u8 version; 296 u8 version;
@@ -436,7 +436,7 @@ static struct iwl_sensitivity_ranges iwl5150_sensitivity = {
436 .nrg_th_ofdm = 95, 436 .nrg_th_ofdm = 95,
437}; 437};
438 438
439static const u8 *iwl5000_eeprom_query_addr(const struct iwl_priv *priv, 439const u8 *iwl5000_eeprom_query_addr(const struct iwl_priv *priv,
440 size_t offset) 440 size_t offset)
441{ 441{
442 u32 address = eeprom_indirect_address(priv, offset); 442 u32 address = eeprom_indirect_address(priv, offset);
@@ -447,7 +447,7 @@ static const u8 *iwl5000_eeprom_query_addr(const struct iwl_priv *priv,
447static void iwl5150_set_ct_threshold(struct iwl_priv *priv) 447static void iwl5150_set_ct_threshold(struct iwl_priv *priv)
448{ 448{
449 const s32 volt2temp_coef = IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF; 449 const s32 volt2temp_coef = IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF;
450 s32 threshold = (s32)CELSIUS_TO_KELVIN(CT_KILL_THRESHOLD) - 450 s32 threshold = (s32)CELSIUS_TO_KELVIN(CT_KILL_THRESHOLD_LEGACY) -
451 iwl_temp_calib_to_offset(priv); 451 iwl_temp_calib_to_offset(priv);
452 452
453 priv->hw_params.ct_kill_threshold = threshold * volt2temp_coef; 453 priv->hw_params.ct_kill_threshold = threshold * volt2temp_coef;
@@ -456,7 +456,7 @@ static void iwl5150_set_ct_threshold(struct iwl_priv *priv)
456static void iwl5000_set_ct_threshold(struct iwl_priv *priv) 456static void iwl5000_set_ct_threshold(struct iwl_priv *priv)
457{ 457{
458 /* want Celsius */ 458 /* want Celsius */
459 priv->hw_params.ct_kill_threshold = CT_KILL_THRESHOLD; 459 priv->hw_params.ct_kill_threshold = CT_KILL_THRESHOLD_LEGACY;
460} 460}
461 461
462/* 462/*
@@ -631,7 +631,7 @@ static int iwl5000_load_given_ucode(struct iwl_priv *priv,
631 return ret; 631 return ret;
632} 632}
633 633
634static int iwl5000_load_ucode(struct iwl_priv *priv) 634int iwl5000_load_ucode(struct iwl_priv *priv)
635{ 635{
636 int ret = 0; 636 int ret = 0;
637 637
@@ -658,7 +658,7 @@ static int iwl5000_load_ucode(struct iwl_priv *priv)
658 return ret; 658 return ret;
659} 659}
660 660
661static void iwl5000_init_alive_start(struct iwl_priv *priv) 661void iwl5000_init_alive_start(struct iwl_priv *priv)
662{ 662{
663 int ret = 0; 663 int ret = 0;
664 664
@@ -734,7 +734,7 @@ static int iwl5000_send_wimax_coex(struct iwl_priv *priv)
734 sizeof(coex_cmd), &coex_cmd); 734 sizeof(coex_cmd), &coex_cmd);
735} 735}
736 736
737static int iwl5000_alive_notify(struct iwl_priv *priv) 737int iwl5000_alive_notify(struct iwl_priv *priv)
738{ 738{
739 u32 a; 739 u32 a;
740 unsigned long flags; 740 unsigned long flags;
@@ -821,7 +821,7 @@ static int iwl5000_alive_notify(struct iwl_priv *priv)
821 return 0; 821 return 0;
822} 822}
823 823
824static int iwl5000_hw_set_hw_params(struct iwl_priv *priv) 824int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
825{ 825{
826 if ((priv->cfg->mod_params->num_of_queues > IWL50_NUM_QUEUES) || 826 if ((priv->cfg->mod_params->num_of_queues > IWL50_NUM_QUEUES) ||
827 (priv->cfg->mod_params->num_of_queues < IWL_MIN_NUM_QUEUES)) { 827 (priv->cfg->mod_params->num_of_queues < IWL_MIN_NUM_QUEUES)) {
@@ -892,7 +892,7 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
892/** 892/**
893 * iwl5000_txq_update_byte_cnt_tbl - Set up entry in Tx byte-count array 893 * iwl5000_txq_update_byte_cnt_tbl - Set up entry in Tx byte-count array
894 */ 894 */
895static void iwl5000_txq_update_byte_cnt_tbl(struct iwl_priv *priv, 895void iwl5000_txq_update_byte_cnt_tbl(struct iwl_priv *priv,
896 struct iwl_tx_queue *txq, 896 struct iwl_tx_queue *txq,
897 u16 byte_cnt) 897 u16 byte_cnt)
898{ 898{
@@ -932,7 +932,7 @@ static void iwl5000_txq_update_byte_cnt_tbl(struct iwl_priv *priv,
932 tfd_offset[TFD_QUEUE_SIZE_MAX + write_ptr] = bc_ent; 932 tfd_offset[TFD_QUEUE_SIZE_MAX + write_ptr] = bc_ent;
933} 933}
934 934
935static void iwl5000_txq_inval_byte_cnt_tbl(struct iwl_priv *priv, 935void iwl5000_txq_inval_byte_cnt_tbl(struct iwl_priv *priv,
936 struct iwl_tx_queue *txq) 936 struct iwl_tx_queue *txq)
937{ 937{
938 struct iwl5000_scd_bc_tbl *scd_bc_tbl = priv->scd_bc_tbls.addr; 938 struct iwl5000_scd_bc_tbl *scd_bc_tbl = priv->scd_bc_tbls.addr;
@@ -987,7 +987,7 @@ static void iwl5000_tx_queue_stop_scheduler(struct iwl_priv *priv, u16 txq_id)
987 (1 << IWL50_SCD_QUEUE_STTS_REG_POS_SCD_ACT_EN)); 987 (1 << IWL50_SCD_QUEUE_STTS_REG_POS_SCD_ACT_EN));
988} 988}
989 989
990static int iwl5000_txq_agg_enable(struct iwl_priv *priv, int txq_id, 990int iwl5000_txq_agg_enable(struct iwl_priv *priv, int txq_id,
991 int tx_fifo, int sta_id, int tid, u16 ssn_idx) 991 int tx_fifo, int sta_id, int tid, u16 ssn_idx)
992{ 992{
993 unsigned long flags; 993 unsigned long flags;
@@ -1048,7 +1048,7 @@ static int iwl5000_txq_agg_enable(struct iwl_priv *priv, int txq_id,
1048 return 0; 1048 return 0;
1049} 1049}
1050 1050
1051static int iwl5000_txq_agg_disable(struct iwl_priv *priv, u16 txq_id, 1051int iwl5000_txq_agg_disable(struct iwl_priv *priv, u16 txq_id,
1052 u16 ssn_idx, u8 tx_fifo) 1052 u16 ssn_idx, u8 tx_fifo)
1053{ 1053{
1054 if ((IWL50_FIRST_AMPDU_QUEUE > txq_id) || 1054 if ((IWL50_FIRST_AMPDU_QUEUE > txq_id) ||
@@ -1091,7 +1091,7 @@ u16 iwl5000_build_addsta_hcmd(const struct iwl_addsta_cmd *cmd, u8 *data)
1091 * Activate/Deactivate Tx DMA/FIFO channels according tx fifos mask 1091 * Activate/Deactivate Tx DMA/FIFO channels according tx fifos mask
1092 * must be called under priv->lock and mac access 1092 * must be called under priv->lock and mac access
1093 */ 1093 */
1094static void iwl5000_txq_set_sched(struct iwl_priv *priv, u32 mask) 1094void iwl5000_txq_set_sched(struct iwl_priv *priv, u32 mask)
1095{ 1095{
1096 iwl_write_prph(priv, IWL50_SCD_TXFACT, mask); 1096 iwl_write_prph(priv, IWL50_SCD_TXFACT, mask);
1097} 1097}
@@ -1312,13 +1312,13 @@ u16 iwl5000_get_hcmd_size(u8 cmd_id, u16 len)
1312 return len; 1312 return len;
1313} 1313}
1314 1314
1315static void iwl5000_setup_deferred_work(struct iwl_priv *priv) 1315void iwl5000_setup_deferred_work(struct iwl_priv *priv)
1316{ 1316{
1317 /* in 5000 the tx power calibration is done in uCode */ 1317 /* in 5000 the tx power calibration is done in uCode */
1318 priv->disable_tx_power_cal = 1; 1318 priv->disable_tx_power_cal = 1;
1319} 1319}
1320 1320
1321static void iwl5000_rx_handler_setup(struct iwl_priv *priv) 1321void iwl5000_rx_handler_setup(struct iwl_priv *priv)
1322{ 1322{
1323 /* init calibration handlers */ 1323 /* init calibration handlers */
1324 priv->rx_handlers[CALIBRATION_RES_NOTIFICATION] = 1324 priv->rx_handlers[CALIBRATION_RES_NOTIFICATION] =
@@ -1329,7 +1329,7 @@ static void iwl5000_rx_handler_setup(struct iwl_priv *priv)
1329} 1329}
1330 1330
1331 1331
1332static int iwl5000_hw_valid_rtc_data_addr(u32 addr) 1332int iwl5000_hw_valid_rtc_data_addr(u32 addr)
1333{ 1333{
1334 return (addr >= IWL50_RTC_DATA_LOWER_BOUND) && 1334 return (addr >= IWL50_RTC_DATA_LOWER_BOUND) &&
1335 (addr < IWL50_RTC_DATA_UPPER_BOUND); 1335 (addr < IWL50_RTC_DATA_UPPER_BOUND);
@@ -1381,7 +1381,7 @@ static int iwl5000_send_rxon_assoc(struct iwl_priv *priv)
1381 1381
1382 return ret; 1382 return ret;
1383} 1383}
1384static int iwl5000_send_tx_power(struct iwl_priv *priv) 1384int iwl5000_send_tx_power(struct iwl_priv *priv)
1385{ 1385{
1386 struct iwl5000_tx_power_dbm_cmd tx_power_cmd; 1386 struct iwl5000_tx_power_dbm_cmd tx_power_cmd;
1387 u8 tx_ant_cfg_cmd; 1387 u8 tx_ant_cfg_cmd;
@@ -1401,7 +1401,7 @@ static int iwl5000_send_tx_power(struct iwl_priv *priv)
1401 NULL); 1401 NULL);
1402} 1402}
1403 1403
1404static void iwl5000_temperature(struct iwl_priv *priv) 1404void iwl5000_temperature(struct iwl_priv *priv)
1405{ 1405{
1406 /* store temperature from statistics (in Celsius) */ 1406 /* store temperature from statistics (in Celsius) */
1407 priv->temperature = le32_to_cpu(priv->statistics.general.temperature); 1407 priv->temperature = le32_to_cpu(priv->statistics.general.temperature);