blob: 3d4a36cf0408634300ef72c2c5c778f6fcf82417 [file] [log] [blame]
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -08001/******************************************************************************
2 *
Wey-Yi Guy4e318262011-12-27 11:21:32 -08003 * Copyright(c) 2008 - 2012 Intel Corporation. All rights reserved.
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -08004 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17 *
18 * The full GNU General Public License is included in this distribution in the
19 * file called LICENSE.
20 *
21 * Contact Information:
22 * Intel Linux Wireless <ilw@linux.intel.com>
23 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
24 *
25 *****************************************************************************/
26
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080027#include <linux/module.h>
Evgeni Golov8fcbd4dc2011-06-12 05:34:31 -070028#include <linux/stringify.h>
Johannes Berge9676692012-04-10 14:10:28 -070029#include "iwl-config.h"
Johannes Bergcebcbd72011-09-15 11:46:46 -070030#include "iwl-cfg.h"
Johannes Berge9676692012-04-10 14:10:28 -070031#include "iwl-dev.h" /* still needed */
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080032
33/* Highest firmware API version supported */
Johannes Bergca9a4602011-07-23 10:24:45 -070034#define IWL2030_UCODE_API_MAX 6
35#define IWL2000_UCODE_API_MAX 6
36#define IWL105_UCODE_API_MAX 6
37#define IWL135_UCODE_API_MAX 6
38
39/* Oldest version we won't warn about */
40#define IWL2030_UCODE_API_OK 5
41#define IWL2000_UCODE_API_OK 5
42#define IWL105_UCODE_API_OK 5
43#define IWL135_UCODE_API_OK 5
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080044
45/* Lowest firmware API version supported */
46#define IWL2030_UCODE_API_MIN 5
47#define IWL2000_UCODE_API_MIN 5
Wey-Yi Guyb4ed2212011-04-30 08:55:16 -070048#define IWL105_UCODE_API_MIN 5
Wey-Yi Guy54e9c402011-07-01 07:47:59 -070049#define IWL135_UCODE_API_MIN 5
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080050
51#define IWL2030_FW_PRE "iwlwifi-2030-"
Evgeni Golov8fcbd4dc2011-06-12 05:34:31 -070052#define IWL2030_MODULE_FIRMWARE(api) IWL2030_FW_PRE __stringify(api) ".ucode"
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080053
54#define IWL2000_FW_PRE "iwlwifi-2000-"
Evgeni Golov8fcbd4dc2011-06-12 05:34:31 -070055#define IWL2000_MODULE_FIRMWARE(api) IWL2000_FW_PRE __stringify(api) ".ucode"
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080056
Wey-Yi Guyb4ed2212011-04-30 08:55:16 -070057#define IWL105_FW_PRE "iwlwifi-105-"
Evgeni Golov8fcbd4dc2011-06-12 05:34:31 -070058#define IWL105_MODULE_FIRMWARE(api) IWL105_FW_PRE __stringify(api) ".ucode"
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080059
Wey-Yi Guy54e9c402011-07-01 07:47:59 -070060#define IWL135_FW_PRE "iwlwifi-135-"
Fry, Donald H5092e472011-09-15 11:46:37 -070061#define IWL135_MODULE_FIRMWARE(api) IWL135_FW_PRE __stringify(api) ".ucode"
Wey-Yi Guy54e9c402011-07-01 07:47:59 -070062
Johannes Berg6794f3e2012-03-06 13:30:56 -080063static const struct iwl_base_params iwl2000_base_params = {
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080064 .eeprom_size = OTP_LOW_IMAGE_SIZE,
65 .num_of_queues = IWLAGN_NUM_QUEUES,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080066 .pll_cfg_val = 0,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080067 .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
68 .shadow_ram_support = true,
69 .led_compensation = 51,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080070 .adv_thermal_throttle = true,
71 .support_ct_kill_exit = true,
72 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
73 .chain_noise_scale = 1000,
74 .wd_timeout = IWL_DEF_WD_TIMEOUT,
75 .max_event_log_size = 512,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080076 .shadow_reg_enable = true,
Wey-Yi Guyae7f9a72011-07-23 10:24:50 -070077 .hd_v2 = true,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080078};
79
80
Johannes Berg6794f3e2012-03-06 13:30:56 -080081static const struct iwl_base_params iwl2030_base_params = {
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080082 .eeprom_size = OTP_LOW_IMAGE_SIZE,
83 .num_of_queues = IWLAGN_NUM_QUEUES,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080084 .pll_cfg_val = 0,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080085 .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
86 .shadow_ram_support = true,
87 .led_compensation = 57,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080088 .adv_thermal_throttle = true,
89 .support_ct_kill_exit = true,
90 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
91 .chain_noise_scale = 1000,
92 .wd_timeout = IWL_LONG_WD_TIMEOUT,
93 .max_event_log_size = 512,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080094 .shadow_reg_enable = true,
Wey-Yi Guyae7f9a72011-07-23 10:24:50 -070095 .hd_v2 = true,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080096};
97
Johannes Berg6794f3e2012-03-06 13:30:56 -080098static const struct iwl_ht_params iwl2000_ht_params = {
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -080099 .ht_greenfield_support = true,
100 .use_rts_for_aggregation = true, /* use rts/cts protection */
101};
102
Johannes Berg6794f3e2012-03-06 13:30:56 -0800103static const struct iwl_bt_params iwl2030_bt_params = {
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800104 /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
105 .advanced_bt_coexist = true,
106 .agg_time_limit = BT_AGG_THRESHOLD_DEF,
107 .bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE,
108 .bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT,
109 .bt_sco_disable = true,
Wey-Yi Guy60132702011-02-18 17:23:54 -0800110 .bt_session_2 = true,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800111};
112
113#define IWL_DEVICE_2000 \
114 .fw_name_pre = IWL2000_FW_PRE, \
115 .ucode_api_max = IWL2000_UCODE_API_MAX, \
Johannes Bergca9a4602011-07-23 10:24:45 -0700116 .ucode_api_ok = IWL2000_UCODE_API_OK, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800117 .ucode_api_min = IWL2000_UCODE_API_MIN, \
Johannes Berg2d771cb2012-04-09 17:47:00 -0700118 .device_family = IWL_DEVICE_FAMILY_2000, \
Emmanuel Grumbachdae66d02012-02-07 12:56:26 +0200119 .max_inst_size = IWL60_RTC_INST_SIZE, \
120 .max_data_size = IWL60_RTC_DATA_SIZE, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800121 .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \
122 .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800123 .base_params = &iwl2000_base_params, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800124 .need_temp_offset_calib = true, \
Wey-Yi Guyc6f30342011-09-15 11:46:50 -0700125 .temp_offset_v2 = true, \
Johannes Bergcf616862012-03-15 13:26:49 -0700126 .led_mode = IWL_LED_RF_STATE
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800127
Johannes Berg706c4ff2012-03-05 11:24:33 -0800128const struct iwl_cfg iwl2000_2bgn_cfg = {
Don Fry6195d132011-12-06 10:42:41 -0800129 .name = "Intel(R) Centrino(R) Wireless-N 2200 BGN",
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800130 IWL_DEVICE_2000,
131 .ht_params = &iwl2000_ht_params,
132};
133
Johannes Berg706c4ff2012-03-05 11:24:33 -0800134const struct iwl_cfg iwl2000_2bgn_d_cfg = {
Don Fry6195d132011-12-06 10:42:41 -0800135 .name = "Intel(R) Centrino(R) Wireless-N 2200D BGN",
Wey-Yi Guy1603dd42011-08-25 23:11:17 -0700136 IWL_DEVICE_2000,
Wey-Yi Guyec8f7342011-09-06 09:31:23 -0700137 .ht_params = &iwl2000_ht_params,
Wey-Yi Guy1603dd42011-08-25 23:11:17 -0700138};
139
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800140#define IWL_DEVICE_2030 \
141 .fw_name_pre = IWL2030_FW_PRE, \
142 .ucode_api_max = IWL2030_UCODE_API_MAX, \
Johannes Bergca9a4602011-07-23 10:24:45 -0700143 .ucode_api_ok = IWL2030_UCODE_API_OK, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800144 .ucode_api_min = IWL2030_UCODE_API_MIN, \
Johannes Berg2d771cb2012-04-09 17:47:00 -0700145 .device_family = IWL_DEVICE_FAMILY_2030, \
Emmanuel Grumbachdae66d02012-02-07 12:56:26 +0200146 .max_inst_size = IWL60_RTC_INST_SIZE, \
147 .max_data_size = IWL60_RTC_DATA_SIZE, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800148 .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \
149 .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800150 .base_params = &iwl2030_base_params, \
151 .bt_params = &iwl2030_bt_params, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800152 .need_temp_offset_calib = true, \
Wey-Yi Guyc6f30342011-09-15 11:46:50 -0700153 .temp_offset_v2 = true, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800154 .led_mode = IWL_LED_RF_STATE, \
Johannes Bergcf616862012-03-15 13:26:49 -0700155 .adv_pm = true
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800156
Johannes Berg706c4ff2012-03-05 11:24:33 -0800157const struct iwl_cfg iwl2030_2bgn_cfg = {
Don Fry6195d132011-12-06 10:42:41 -0800158 .name = "Intel(R) Centrino(R) Wireless-N 2230 BGN",
Wey-Yi Guy96234cc2011-01-24 11:44:42 -0800159 IWL_DEVICE_2030,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800160 .ht_params = &iwl2000_ht_params,
161};
162
Wey-Yi Guyb4ed2212011-04-30 08:55:16 -0700163#define IWL_DEVICE_105 \
164 .fw_name_pre = IWL105_FW_PRE, \
165 .ucode_api_max = IWL105_UCODE_API_MAX, \
Johannes Bergca9a4602011-07-23 10:24:45 -0700166 .ucode_api_ok = IWL105_UCODE_API_OK, \
Wey-Yi Guyb4ed2212011-04-30 08:55:16 -0700167 .ucode_api_min = IWL105_UCODE_API_MIN, \
Johannes Berg2d771cb2012-04-09 17:47:00 -0700168 .device_family = IWL_DEVICE_FAMILY_105, \
Emmanuel Grumbachdae66d02012-02-07 12:56:26 +0200169 .max_inst_size = IWL60_RTC_INST_SIZE, \
170 .max_data_size = IWL60_RTC_DATA_SIZE, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800171 .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \
172 .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800173 .base_params = &iwl2000_base_params, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800174 .need_temp_offset_calib = true, \
Wey-Yi Guyc6f30342011-09-15 11:46:50 -0700175 .temp_offset_v2 = true, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800176 .led_mode = IWL_LED_RF_STATE, \
177 .adv_pm = true, \
Johannes Bergcf616862012-03-15 13:26:49 -0700178 .rx_with_siso_diversity = true
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800179
Johannes Berg706c4ff2012-03-05 11:24:33 -0800180const struct iwl_cfg iwl105_bgn_cfg = {
Don Fry6195d132011-12-06 10:42:41 -0800181 .name = "Intel(R) Centrino(R) Wireless-N 105 BGN",
Wey-Yi Guyb4ed2212011-04-30 08:55:16 -0700182 IWL_DEVICE_105,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800183 .ht_params = &iwl2000_ht_params,
184};
185
Johannes Berg706c4ff2012-03-05 11:24:33 -0800186const struct iwl_cfg iwl105_bgn_d_cfg = {
Don Fry6195d132011-12-06 10:42:41 -0800187 .name = "Intel(R) Centrino(R) Wireless-N 105D BGN",
Wey-Yi Guyb319d3e2011-10-10 07:27:01 -0700188 IWL_DEVICE_105,
189 .ht_params = &iwl2000_ht_params,
190};
191
Wey-Yi Guyb4ed2212011-04-30 08:55:16 -0700192#define IWL_DEVICE_135 \
Wey-Yi Guy54e9c402011-07-01 07:47:59 -0700193 .fw_name_pre = IWL135_FW_PRE, \
194 .ucode_api_max = IWL135_UCODE_API_MAX, \
Johannes Bergca9a4602011-07-23 10:24:45 -0700195 .ucode_api_ok = IWL135_UCODE_API_OK, \
Wey-Yi Guy54e9c402011-07-01 07:47:59 -0700196 .ucode_api_min = IWL135_UCODE_API_MIN, \
Johannes Berg2d771cb2012-04-09 17:47:00 -0700197 .device_family = IWL_DEVICE_FAMILY_135, \
Emmanuel Grumbachdae66d02012-02-07 12:56:26 +0200198 .max_inst_size = IWL60_RTC_INST_SIZE, \
199 .max_data_size = IWL60_RTC_DATA_SIZE, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800200 .eeprom_ver = EEPROM_2000_EEPROM_VERSION, \
201 .eeprom_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800202 .base_params = &iwl2030_base_params, \
203 .bt_params = &iwl2030_bt_params, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800204 .need_temp_offset_calib = true, \
Wey-Yi Guyc6f30342011-09-15 11:46:50 -0700205 .temp_offset_v2 = true, \
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800206 .led_mode = IWL_LED_RF_STATE, \
207 .adv_pm = true, \
Johannes Bergcf616862012-03-15 13:26:49 -0700208 .rx_with_siso_diversity = true
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800209
Johannes Berg706c4ff2012-03-05 11:24:33 -0800210const struct iwl_cfg iwl135_bgn_cfg = {
Don Fry6195d132011-12-06 10:42:41 -0800211 .name = "Intel(R) Centrino(R) Wireless-N 135 BGN",
Wey-Yi Guyb4ed2212011-04-30 08:55:16 -0700212 IWL_DEVICE_135,
Wey-Yi Guyc5a5e182011-01-21 15:47:21 -0800213 .ht_params = &iwl2000_ht_params,
214};
215
216MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_MAX));
217MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_MAX));
Wey-Yi Guyb4ed2212011-04-30 08:55:16 -0700218MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_MAX));
Wey-Yi Guy54e9c402011-07-01 07:47:59 -0700219MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_MAX));