aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-1000.c76
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c44
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-6000.c59
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-commands.h7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c22
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h34
7 files changed, 217 insertions, 28 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c
index a899be914ebf..80a28184a373 100644
--- a/drivers/net/wireless/iwlwifi/iwl-1000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-1000.c
@@ -55,13 +55,87 @@
55#define _IWL1000_MODULE_FIRMWARE(api) IWL1000_FW_PRE #api ".ucode" 55#define _IWL1000_MODULE_FIRMWARE(api) IWL1000_FW_PRE #api ".ucode"
56#define IWL1000_MODULE_FIRMWARE(api) _IWL1000_MODULE_FIRMWARE(api) 56#define IWL1000_MODULE_FIRMWARE(api) _IWL1000_MODULE_FIRMWARE(api)
57 57
58
59/*
60 * For 1000, use advance thermal throttling critical temperature threshold,
61 * but legacy thermal management implementation for now.
62 * This is for the reason of 1000 uCode using advance thermal throttling API
63 * but not implement ct_kill_exit based on ct_kill exit temperature
64 * so the thermal throttling will still based on legacy thermal throttling
65 * management.
66 * The code here need to be modified once 1000 uCode has the advanced thermal
67 * throttling algorithm in place
68 */
69static void iwl1000_set_ct_threshold(struct iwl_priv *priv)
70{
71 /* want Celsius */
72 priv->hw_params.ct_kill_threshold = CT_KILL_THRESHOLD_LEGACY;
73 priv->hw_params.ct_kill_exit_threshold = CT_KILL_EXIT_THRESHOLD;
74}
75
76static struct iwl_lib_ops iwl1000_lib = {
77 .set_hw_params = iwl5000_hw_set_hw_params,
78 .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl,
79 .txq_inval_byte_cnt_tbl = iwl5000_txq_inval_byte_cnt_tbl,
80 .txq_set_sched = iwl5000_txq_set_sched,
81 .txq_agg_enable = iwl5000_txq_agg_enable,
82 .txq_agg_disable = iwl5000_txq_agg_disable,
83 .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
84 .txq_free_tfd = iwl_hw_txq_free_tfd,
85 .txq_init = iwl_hw_tx_queue_init,
86 .rx_handler_setup = iwl5000_rx_handler_setup,
87 .setup_deferred_work = iwl5000_setup_deferred_work,
88 .is_valid_rtc_data_addr = iwl5000_hw_valid_rtc_data_addr,
89 .load_ucode = iwl5000_load_ucode,
90 .init_alive_start = iwl5000_init_alive_start,
91 .alive_notify = iwl5000_alive_notify,
92 .send_tx_power = iwl5000_send_tx_power,
93 .update_chain_flags = iwl_update_chain_flags,
94 .apm_ops = {
95 .init = iwl5000_apm_init,
96 .reset = iwl5000_apm_reset,
97 .stop = iwl5000_apm_stop,
98 .config = iwl5000_nic_config,
99 .set_pwr_src = iwl_set_pwr_src,
100 },
101 .eeprom_ops = {
102 .regulatory_bands = {
103 EEPROM_5000_REG_BAND_1_CHANNELS,
104 EEPROM_5000_REG_BAND_2_CHANNELS,
105 EEPROM_5000_REG_BAND_3_CHANNELS,
106 EEPROM_5000_REG_BAND_4_CHANNELS,
107 EEPROM_5000_REG_BAND_5_CHANNELS,
108 EEPROM_5000_REG_BAND_24_FAT_CHANNELS,
109 EEPROM_5000_REG_BAND_52_FAT_CHANNELS
110 },
111 .verify_signature = iwlcore_eeprom_verify_signature,
112 .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
113 .release_semaphore = iwlcore_eeprom_release_semaphore,
114 .calib_version = iwl5000_eeprom_calib_version,
115 .query_addr = iwl5000_eeprom_query_addr,
116 },
117 .post_associate = iwl_post_associate,
118 .isr = iwl_isr_ict,
119 .config_ap = iwl_config_ap,
120 .temp_ops = {
121 .temperature = iwl5000_temperature,
122 .set_ct_kill = iwl1000_set_ct_threshold,
123 },
124};
125
126static struct iwl_ops iwl1000_ops = {
127 .lib = &iwl1000_lib,
128 .hcmd = &iwl5000_hcmd,
129 .utils = &iwl5000_hcmd_utils,
130};
131
58struct iwl_cfg iwl1000_bgn_cfg = { 132struct iwl_cfg iwl1000_bgn_cfg = {
59 .name = "1000 Series BGN", 133 .name = "1000 Series BGN",
60 .fw_name_pre = IWL1000_FW_PRE, 134 .fw_name_pre = IWL1000_FW_PRE,
61 .ucode_api_max = IWL1000_UCODE_API_MAX, 135 .ucode_api_max = IWL1000_UCODE_API_MAX,
62 .ucode_api_min = IWL1000_UCODE_API_MIN, 136 .ucode_api_min = IWL1000_UCODE_API_MIN,
63 .sku = IWL_SKU_G|IWL_SKU_N, 137 .sku = IWL_SKU_G|IWL_SKU_N,
64 .ops = &iwl5000_ops, 138 .ops = &iwl1000_ops,
65 .eeprom_size = IWL_5000_EEPROM_IMG_SIZE, 139 .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
66 .eeprom_ver = EEPROM_5000_EEPROM_VERSION, 140 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
67 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, 141 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index c30a1b960576..23925bd81c62 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -776,7 +776,8 @@ static struct iwl_sensitivity_ranges iwl4965_sensitivity = {
776static void iwl4965_set_ct_threshold(struct iwl_priv *priv) 776static void iwl4965_set_ct_threshold(struct iwl_priv *priv)
777{ 777{
778 /* want Kelvin */ 778 /* want Kelvin */
779 priv->hw_params.ct_kill_threshold = CELSIUS_TO_KELVIN(CT_KILL_THRESHOLD); 779 priv->hw_params.ct_kill_threshold =
780 CELSIUS_TO_KELVIN(CT_KILL_THRESHOLD_LEGACY);
780} 781}
781 782
782/** 783/**
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);
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 26c5d4a60d17..59ff73536f3a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -61,6 +61,63 @@
61#define _IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE #api ".ucode" 61#define _IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE #api ".ucode"
62#define IWL6050_MODULE_FIRMWARE(api) _IWL6050_MODULE_FIRMWARE(api) 62#define IWL6050_MODULE_FIRMWARE(api) _IWL6050_MODULE_FIRMWARE(api)
63 63
64static void iwl6000_set_ct_threshold(struct iwl_priv *priv)
65{
66 /* want Celsius */
67 priv->hw_params.ct_kill_threshold = CT_KILL_THRESHOLD;
68 priv->hw_params.ct_kill_exit_threshold = CT_KILL_EXIT_THRESHOLD;
69}
70
71static struct iwl_lib_ops iwl6000_lib = {
72 .set_hw_params = iwl5000_hw_set_hw_params,
73 .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl,
74 .txq_inval_byte_cnt_tbl = iwl5000_txq_inval_byte_cnt_tbl,
75 .txq_set_sched = iwl5000_txq_set_sched,
76 .txq_agg_enable = iwl5000_txq_agg_enable,
77 .txq_agg_disable = iwl5000_txq_agg_disable,
78 .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
79 .txq_free_tfd = iwl_hw_txq_free_tfd,
80 .txq_init = iwl_hw_tx_queue_init,
81 .rx_handler_setup = iwl5000_rx_handler_setup,
82 .setup_deferred_work = iwl5000_setup_deferred_work,
83 .is_valid_rtc_data_addr = iwl5000_hw_valid_rtc_data_addr,
84 .load_ucode = iwl5000_load_ucode,
85 .init_alive_start = iwl5000_init_alive_start,
86 .alive_notify = iwl5000_alive_notify,
87 .send_tx_power = iwl5000_send_tx_power,
88 .update_chain_flags = iwl_update_chain_flags,
89 .apm_ops = {
90 .init = iwl5000_apm_init,
91 .reset = iwl5000_apm_reset,
92 .stop = iwl5000_apm_stop,
93 .config = iwl5000_nic_config,
94 .set_pwr_src = iwl_set_pwr_src,
95 },
96 .eeprom_ops = {
97 .regulatory_bands = {
98 EEPROM_5000_REG_BAND_1_CHANNELS,
99 EEPROM_5000_REG_BAND_2_CHANNELS,
100 EEPROM_5000_REG_BAND_3_CHANNELS,
101 EEPROM_5000_REG_BAND_4_CHANNELS,
102 EEPROM_5000_REG_BAND_5_CHANNELS,
103 EEPROM_5000_REG_BAND_24_FAT_CHANNELS,
104 EEPROM_5000_REG_BAND_52_FAT_CHANNELS
105 },
106 .verify_signature = iwlcore_eeprom_verify_signature,
107 .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
108 .release_semaphore = iwlcore_eeprom_release_semaphore,
109 .calib_version = iwl5000_eeprom_calib_version,
110 .query_addr = iwl5000_eeprom_query_addr,
111 },
112 .post_associate = iwl_post_associate,
113 .isr = iwl_isr_ict,
114 .config_ap = iwl_config_ap,
115 .temp_ops = {
116 .temperature = iwl5000_temperature,
117 .set_ct_kill = iwl6000_set_ct_threshold,
118 },
119};
120
64static struct iwl_hcmd_utils_ops iwl6000_hcmd_utils = { 121static struct iwl_hcmd_utils_ops iwl6000_hcmd_utils = {
65 .get_hcmd_size = iwl5000_get_hcmd_size, 122 .get_hcmd_size = iwl5000_get_hcmd_size,
66 .build_addsta_hcmd = iwl5000_build_addsta_hcmd, 123 .build_addsta_hcmd = iwl5000_build_addsta_hcmd,
@@ -70,7 +127,7 @@ static struct iwl_hcmd_utils_ops iwl6000_hcmd_utils = {
70 127
71static struct iwl_ops iwl6000_ops = { 128static struct iwl_ops iwl6000_ops = {
72 .ucode = &iwl5000_ucode, 129 .ucode = &iwl5000_ucode,
73 .lib = &iwl5000_lib, 130 .lib = &iwl6000_lib,
74 .hcmd = &iwl5000_hcmd, 131 .hcmd = &iwl5000_hcmd,
75 .utils = &iwl6000_hcmd_utils, 132 .utils = &iwl6000_hcmd_utils,
76}; 133};
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index ebb2fbce5365..39ede5727fe4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -2413,6 +2413,13 @@ struct iwl_ct_kill_config {
2413 __le32 critical_temperature_R; 2413 __le32 critical_temperature_R;
2414} __attribute__ ((packed)); 2414} __attribute__ ((packed));
2415 2415
2416/* 1000, and 6x00 */
2417struct iwl_ct_kill_throttling_config {
2418 __le32 critical_temperature_exit;
2419 __le32 reserved;
2420 __le32 critical_temperature_enter;
2421} __attribute__ ((packed));
2422
2416/****************************************************************************** 2423/******************************************************************************
2417 * (8) 2424 * (8)
2418 * Scan Commands, Responses, Notifications: 2425 * Scan Commands, Responses, Notifications:
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 6aea02644809..5ef3c37b5813 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -2224,6 +2224,7 @@ EXPORT_SYMBOL(iwl_verify_ucode);
2224void iwl_rf_kill_ct_config(struct iwl_priv *priv) 2224void iwl_rf_kill_ct_config(struct iwl_priv *priv)
2225{ 2225{
2226 struct iwl_ct_kill_config cmd; 2226 struct iwl_ct_kill_config cmd;
2227 struct iwl_ct_kill_throttling_config adv_cmd;
2227 unsigned long flags; 2228 unsigned long flags;
2228 int ret = 0; 2229 int ret = 0;
2229 2230
@@ -2232,9 +2233,26 @@ void iwl_rf_kill_ct_config(struct iwl_priv *priv)
2232 CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT); 2233 CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT);
2233 spin_unlock_irqrestore(&priv->lock, flags); 2234 spin_unlock_irqrestore(&priv->lock, flags);
2234 2235
2235 cmd.critical_temperature_R = 2236 switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) {
2236 cpu_to_le32(priv->hw_params.ct_kill_threshold); 2237 case CSR_HW_REV_TYPE_1000:
2238 case CSR_HW_REV_TYPE_6x00:
2239 case CSR_HW_REV_TYPE_6x50:
2240 adv_cmd.critical_temperature_enter =
2241 cpu_to_le32(priv->hw_params.ct_kill_threshold);
2242 adv_cmd.critical_temperature_exit =
2243 cpu_to_le32(priv->hw_params.ct_kill_exit_threshold);
2244
2245 ret = iwl_send_cmd_pdu(priv, REPLY_CT_KILL_CONFIG_CMD,
2246 sizeof(adv_cmd), &adv_cmd);
2247 break;
2248 default:
2249 cmd.critical_temperature_R =
2250 cpu_to_le32(priv->hw_params.ct_kill_threshold);
2237 2251
2252 ret = iwl_send_cmd_pdu(priv, REPLY_CT_KILL_CONFIG_CMD,
2253 sizeof(cmd), &cmd);
2254 break;
2255 }
2238 ret = iwl_send_cmd_pdu(priv, REPLY_CT_KILL_CONFIG_CMD, 2256 ret = iwl_send_cmd_pdu(priv, REPLY_CT_KILL_CONFIG_CMD,
2239 sizeof(cmd), &cmd); 2257 sizeof(cmd), &cmd);
2240 if (ret) 2258 if (ret)
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 0751891f4ab7..cddf17350c4b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -63,6 +63,8 @@ extern struct iwl_cfg iwl6050_2agn_cfg;
63extern struct iwl_cfg iwl6050_3agn_cfg; 63extern struct iwl_cfg iwl6050_3agn_cfg;
64extern struct iwl_cfg iwl1000_bgn_cfg; 64extern struct iwl_cfg iwl1000_bgn_cfg;
65 65
66struct iwl_tx_queue;
67
66/* shared structures from iwl-5000.c */ 68/* shared structures from iwl-5000.c */
67extern struct iwl_mod_params iwl50_mod_params; 69extern struct iwl_mod_params iwl50_mod_params;
68extern struct iwl_ops iwl5000_ops; 70extern struct iwl_ops iwl5000_ops;
@@ -79,9 +81,37 @@ extern void iwl5000_rts_tx_cmd_flag(struct ieee80211_tx_info *info,
79 __le32 *tx_flags); 81 __le32 *tx_flags);
80extern int iwl5000_calc_rssi(struct iwl_priv *priv, 82extern int iwl5000_calc_rssi(struct iwl_priv *priv,
81 struct iwl_rx_phy_res *rx_resp); 83 struct iwl_rx_phy_res *rx_resp);
84extern int iwl5000_apm_init(struct iwl_priv *priv);
85extern void iwl5000_apm_stop(struct iwl_priv *priv);
86extern int iwl5000_apm_reset(struct iwl_priv *priv);
87extern void iwl5000_nic_config(struct iwl_priv *priv);
88extern u16 iwl5000_eeprom_calib_version(struct iwl_priv *priv);
89extern const u8 *iwl5000_eeprom_query_addr(const struct iwl_priv *priv,
90 size_t offset);
91extern void iwl5000_txq_update_byte_cnt_tbl(struct iwl_priv *priv,
92 struct iwl_tx_queue *txq,
93 u16 byte_cnt);
94extern void iwl5000_txq_inval_byte_cnt_tbl(struct iwl_priv *priv,
95 struct iwl_tx_queue *txq);
96extern int iwl5000_load_ucode(struct iwl_priv *priv);
97extern void iwl5000_init_alive_start(struct iwl_priv *priv);
98extern int iwl5000_alive_notify(struct iwl_priv *priv);
99extern int iwl5000_hw_set_hw_params(struct iwl_priv *priv);
100extern int iwl5000_txq_agg_enable(struct iwl_priv *priv, int txq_id,
101 int tx_fifo, int sta_id, int tid, u16 ssn_idx);
102extern int iwl5000_txq_agg_disable(struct iwl_priv *priv, u16 txq_id,
103 u16 ssn_idx, u8 tx_fifo);
104extern void iwl5000_txq_set_sched(struct iwl_priv *priv, u32 mask);
105extern void iwl5000_setup_deferred_work(struct iwl_priv *priv);
106extern void iwl5000_rx_handler_setup(struct iwl_priv *priv);
107extern int iwl5000_hw_valid_rtc_data_addr(u32 addr);
108extern int iwl5000_send_tx_power(struct iwl_priv *priv);
109extern void iwl5000_temperature(struct iwl_priv *priv);
82 110
83/* CT-KILL constants */ 111/* CT-KILL constants */
84#define CT_KILL_THRESHOLD 110 /* in Celsius */ 112#define CT_KILL_THRESHOLD_LEGACY 110 /* in Celsius */
113#define CT_KILL_THRESHOLD 114 /* in Celsius */
114#define CT_KILL_EXIT_THRESHOLD 95 /* in Celsius */
85 115
86/* Default noise level to report when noise measurement is not available. 116/* Default noise level to report when noise measurement is not available.
87 * This may be because we're: 117 * This may be because we're:
@@ -630,6 +660,8 @@ struct iwl_hw_params {
630 u32 max_data_size; 660 u32 max_data_size;
631 u32 max_bsm_size; 661 u32 max_bsm_size;
632 u32 ct_kill_threshold; /* value in hw-dependent units */ 662 u32 ct_kill_threshold; /* value in hw-dependent units */
663 u32 ct_kill_exit_threshold; /* value in hw-dependent units */
664 /* for 1000, 6000 series and up */
633 u32 calib_init_cfg; 665 u32 calib_init_cfg;
634 const struct iwl_sensitivity_ranges *sens; 666 const struct iwl_sensitivity_ranges *sens;
635}; 667};