6db0a4067b8d3884e757c8e1df43dca192244b77
[deliverable/linux.git] / drivers / net / wireless / iwlwifi / iwl-6000.c
1 /******************************************************************************
2 *
3 * Copyright(c) 2008 - 2012 Intel Corporation. All rights reserved.
4 *
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
27 #include <linux/module.h>
28 #include <linux/stringify.h>
29 #include "iwl-config.h"
30 #include "iwl-cfg.h"
31 #include "iwl-dev.h" /* still needed */
32
33 /* Highest firmware API version supported */
34 #define IWL6000_UCODE_API_MAX 6
35 #define IWL6050_UCODE_API_MAX 5
36 #define IWL6000G2_UCODE_API_MAX 6
37
38 /* Oldest version we won't warn about */
39 #define IWL6000_UCODE_API_OK 4
40 #define IWL6000G2_UCODE_API_OK 5
41
42 /* Lowest firmware API version supported */
43 #define IWL6000_UCODE_API_MIN 4
44 #define IWL6050_UCODE_API_MIN 4
45 #define IWL6000G2_UCODE_API_MIN 4
46
47 /* EEPROM versions */
48 #define EEPROM_6000_TX_POWER_VERSION (4)
49 #define EEPROM_6000_EEPROM_VERSION (0x423)
50 #define EEPROM_6050_TX_POWER_VERSION (4)
51 #define EEPROM_6050_EEPROM_VERSION (0x532)
52 #define EEPROM_6150_TX_POWER_VERSION (6)
53 #define EEPROM_6150_EEPROM_VERSION (0x553)
54 #define EEPROM_6005_TX_POWER_VERSION (6)
55 #define EEPROM_6005_EEPROM_VERSION (0x709)
56 #define EEPROM_6030_TX_POWER_VERSION (6)
57 #define EEPROM_6030_EEPROM_VERSION (0x709)
58 #define EEPROM_6035_TX_POWER_VERSION (6)
59 #define EEPROM_6035_EEPROM_VERSION (0x753)
60
61 #define IWL6000_FW_PRE "iwlwifi-6000-"
62 #define IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE __stringify(api) ".ucode"
63
64 #define IWL6050_FW_PRE "iwlwifi-6050-"
65 #define IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE __stringify(api) ".ucode"
66
67 #define IWL6005_FW_PRE "iwlwifi-6000g2a-"
68 #define IWL6005_MODULE_FIRMWARE(api) IWL6005_FW_PRE __stringify(api) ".ucode"
69
70 #define IWL6030_FW_PRE "iwlwifi-6000g2b-"
71 #define IWL6030_MODULE_FIRMWARE(api) IWL6030_FW_PRE __stringify(api) ".ucode"
72
73 static const struct iwl_base_params iwl6000_base_params = {
74 .eeprom_size = OTP_LOW_IMAGE_SIZE,
75 .num_of_queues = IWLAGN_NUM_QUEUES,
76 .pll_cfg_val = 0,
77 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
78 .shadow_ram_support = true,
79 .led_compensation = 51,
80 .adv_thermal_throttle = true,
81 .support_ct_kill_exit = true,
82 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
83 .chain_noise_scale = 1000,
84 .wd_timeout = IWL_DEF_WD_TIMEOUT,
85 .max_event_log_size = 512,
86 .shadow_reg_enable = true,
87 };
88
89 static const struct iwl_base_params iwl6050_base_params = {
90 .eeprom_size = OTP_LOW_IMAGE_SIZE,
91 .num_of_queues = IWLAGN_NUM_QUEUES,
92 .pll_cfg_val = 0,
93 .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
94 .shadow_ram_support = true,
95 .led_compensation = 51,
96 .adv_thermal_throttle = true,
97 .support_ct_kill_exit = true,
98 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
99 .chain_noise_scale = 1500,
100 .wd_timeout = IWL_DEF_WD_TIMEOUT,
101 .max_event_log_size = 1024,
102 .shadow_reg_enable = true,
103 };
104
105 static const struct iwl_base_params iwl6000_g2_base_params = {
106 .eeprom_size = OTP_LOW_IMAGE_SIZE,
107 .num_of_queues = IWLAGN_NUM_QUEUES,
108 .pll_cfg_val = 0,
109 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
110 .shadow_ram_support = true,
111 .led_compensation = 57,
112 .adv_thermal_throttle = true,
113 .support_ct_kill_exit = true,
114 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
115 .chain_noise_scale = 1000,
116 .wd_timeout = IWL_LONG_WD_TIMEOUT,
117 .max_event_log_size = 512,
118 .shadow_reg_enable = true,
119 };
120
121 static const struct iwl_ht_params iwl6000_ht_params = {
122 .ht_greenfield_support = true,
123 .use_rts_for_aggregation = true, /* use rts/cts protection */
124 };
125
126 static const struct iwl_bt_params iwl6000_bt_params = {
127 /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
128 .advanced_bt_coexist = true,
129 .agg_time_limit = BT_AGG_THRESHOLD_DEF,
130 .bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE,
131 .bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT,
132 .bt_sco_disable = true,
133 };
134
135 #define IWL_DEVICE_6005 \
136 .fw_name_pre = IWL6005_FW_PRE, \
137 .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
138 .ucode_api_ok = IWL6000G2_UCODE_API_OK, \
139 .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
140 .device_family = IWL_DEVICE_FAMILY_6005, \
141 .max_inst_size = IWL60_RTC_INST_SIZE, \
142 .max_data_size = IWL60_RTC_DATA_SIZE, \
143 .eeprom_ver = EEPROM_6005_EEPROM_VERSION, \
144 .eeprom_calib_ver = EEPROM_6005_TX_POWER_VERSION, \
145 .base_params = &iwl6000_g2_base_params, \
146 .need_temp_offset_calib = true, \
147 .led_mode = IWL_LED_RF_STATE
148
149 const struct iwl_cfg iwl6005_2agn_cfg = {
150 .name = "Intel(R) Centrino(R) Advanced-N 6205 AGN",
151 IWL_DEVICE_6005,
152 .ht_params = &iwl6000_ht_params,
153 };
154
155 const struct iwl_cfg iwl6005_2abg_cfg = {
156 .name = "Intel(R) Centrino(R) Advanced-N 6205 ABG",
157 IWL_DEVICE_6005,
158 };
159
160 const struct iwl_cfg iwl6005_2bg_cfg = {
161 .name = "Intel(R) Centrino(R) Advanced-N 6205 BG",
162 IWL_DEVICE_6005,
163 };
164
165 const struct iwl_cfg iwl6005_2agn_sff_cfg = {
166 .name = "Intel(R) Centrino(R) Advanced-N 6205S AGN",
167 IWL_DEVICE_6005,
168 .ht_params = &iwl6000_ht_params,
169 };
170
171 const struct iwl_cfg iwl6005_2agn_d_cfg = {
172 .name = "Intel(R) Centrino(R) Advanced-N 6205D AGN",
173 IWL_DEVICE_6005,
174 .ht_params = &iwl6000_ht_params,
175 };
176
177 const struct iwl_cfg iwl6005_2agn_mow1_cfg = {
178 .name = "Intel(R) Centrino(R) Advanced-N 6206 AGN",
179 IWL_DEVICE_6005,
180 .ht_params = &iwl6000_ht_params,
181 };
182
183 const struct iwl_cfg iwl6005_2agn_mow2_cfg = {
184 .name = "Intel(R) Centrino(R) Advanced-N 6207 AGN",
185 IWL_DEVICE_6005,
186 .ht_params = &iwl6000_ht_params,
187 };
188
189 #define IWL_DEVICE_6030 \
190 .fw_name_pre = IWL6030_FW_PRE, \
191 .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
192 .ucode_api_ok = IWL6000G2_UCODE_API_OK, \
193 .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
194 .device_family = IWL_DEVICE_FAMILY_6030, \
195 .max_inst_size = IWL60_RTC_INST_SIZE, \
196 .max_data_size = IWL60_RTC_DATA_SIZE, \
197 .eeprom_ver = EEPROM_6030_EEPROM_VERSION, \
198 .eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
199 .base_params = &iwl6000_g2_base_params, \
200 .bt_params = &iwl6000_bt_params, \
201 .need_temp_offset_calib = true, \
202 .led_mode = IWL_LED_RF_STATE, \
203 .adv_pm = true \
204
205 const struct iwl_cfg iwl6030_2agn_cfg = {
206 .name = "Intel(R) Centrino(R) Advanced-N 6230 AGN",
207 IWL_DEVICE_6030,
208 .ht_params = &iwl6000_ht_params,
209 };
210
211 const struct iwl_cfg iwl6030_2abg_cfg = {
212 .name = "Intel(R) Centrino(R) Advanced-N 6230 ABG",
213 IWL_DEVICE_6030,
214 };
215
216 const struct iwl_cfg iwl6030_2bgn_cfg = {
217 .name = "Intel(R) Centrino(R) Advanced-N 6230 BGN",
218 IWL_DEVICE_6030,
219 .ht_params = &iwl6000_ht_params,
220 };
221
222 const struct iwl_cfg iwl6030_2bg_cfg = {
223 .name = "Intel(R) Centrino(R) Advanced-N 6230 BG",
224 IWL_DEVICE_6030,
225 };
226
227 const struct iwl_cfg iwl6035_2agn_cfg = {
228 .name = "Intel(R) Centrino(R) Advanced-N 6235 AGN",
229 IWL_DEVICE_6030,
230 .ht_params = &iwl6000_ht_params,
231 };
232
233 const struct iwl_cfg iwl1030_bgn_cfg = {
234 .name = "Intel(R) Centrino(R) Wireless-N 1030 BGN",
235 IWL_DEVICE_6030,
236 .ht_params = &iwl6000_ht_params,
237 };
238
239 const struct iwl_cfg iwl1030_bg_cfg = {
240 .name = "Intel(R) Centrino(R) Wireless-N 1030 BG",
241 IWL_DEVICE_6030,
242 };
243
244 const struct iwl_cfg iwl130_bgn_cfg = {
245 .name = "Intel(R) Centrino(R) Wireless-N 130 BGN",
246 IWL_DEVICE_6030,
247 .ht_params = &iwl6000_ht_params,
248 .rx_with_siso_diversity = true,
249 };
250
251 const struct iwl_cfg iwl130_bg_cfg = {
252 .name = "Intel(R) Centrino(R) Wireless-N 130 BG",
253 IWL_DEVICE_6030,
254 .rx_with_siso_diversity = true,
255 };
256
257 /*
258 * "i": Internal configuration, use internal Power Amplifier
259 */
260 #define IWL_DEVICE_6000i \
261 .fw_name_pre = IWL6000_FW_PRE, \
262 .ucode_api_max = IWL6000_UCODE_API_MAX, \
263 .ucode_api_ok = IWL6000_UCODE_API_OK, \
264 .ucode_api_min = IWL6000_UCODE_API_MIN, \
265 .device_family = IWL_DEVICE_FAMILY_6000i, \
266 .max_inst_size = IWL60_RTC_INST_SIZE, \
267 .max_data_size = IWL60_RTC_DATA_SIZE, \
268 .valid_tx_ant = ANT_BC, /* .cfg overwrite */ \
269 .valid_rx_ant = ANT_BC, /* .cfg overwrite */ \
270 .eeprom_ver = EEPROM_6000_EEPROM_VERSION, \
271 .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION, \
272 .base_params = &iwl6000_base_params, \
273 .led_mode = IWL_LED_BLINK
274
275 const struct iwl_cfg iwl6000i_2agn_cfg = {
276 .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
277 IWL_DEVICE_6000i,
278 .ht_params = &iwl6000_ht_params,
279 };
280
281 const struct iwl_cfg iwl6000i_2abg_cfg = {
282 .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
283 IWL_DEVICE_6000i,
284 };
285
286 const struct iwl_cfg iwl6000i_2bg_cfg = {
287 .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
288 IWL_DEVICE_6000i,
289 };
290
291 #define IWL_DEVICE_6050 \
292 .fw_name_pre = IWL6050_FW_PRE, \
293 .ucode_api_max = IWL6050_UCODE_API_MAX, \
294 .ucode_api_min = IWL6050_UCODE_API_MIN, \
295 .device_family = IWL_DEVICE_FAMILY_6050, \
296 .max_inst_size = IWL60_RTC_INST_SIZE, \
297 .max_data_size = IWL60_RTC_DATA_SIZE, \
298 .valid_tx_ant = ANT_AB, /* .cfg overwrite */ \
299 .valid_rx_ant = ANT_AB, /* .cfg overwrite */ \
300 .eeprom_ver = EEPROM_6050_EEPROM_VERSION, \
301 .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION, \
302 .base_params = &iwl6050_base_params, \
303 .led_mode = IWL_LED_BLINK, \
304 .internal_wimax_coex = true
305
306 const struct iwl_cfg iwl6050_2agn_cfg = {
307 .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
308 IWL_DEVICE_6050,
309 .ht_params = &iwl6000_ht_params,
310 };
311
312 const struct iwl_cfg iwl6050_2abg_cfg = {
313 .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG",
314 IWL_DEVICE_6050,
315 };
316
317 #define IWL_DEVICE_6150 \
318 .fw_name_pre = IWL6050_FW_PRE, \
319 .ucode_api_max = IWL6050_UCODE_API_MAX, \
320 .ucode_api_min = IWL6050_UCODE_API_MIN, \
321 .device_family = IWL_DEVICE_FAMILY_6150, \
322 .max_inst_size = IWL60_RTC_INST_SIZE, \
323 .max_data_size = IWL60_RTC_DATA_SIZE, \
324 .eeprom_ver = EEPROM_6150_EEPROM_VERSION, \
325 .eeprom_calib_ver = EEPROM_6150_TX_POWER_VERSION, \
326 .base_params = &iwl6050_base_params, \
327 .led_mode = IWL_LED_BLINK, \
328 .internal_wimax_coex = true
329
330 const struct iwl_cfg iwl6150_bgn_cfg = {
331 .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN",
332 IWL_DEVICE_6150,
333 .ht_params = &iwl6000_ht_params,
334 };
335
336 const struct iwl_cfg iwl6150_bg_cfg = {
337 .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BG",
338 IWL_DEVICE_6150,
339 };
340
341 const struct iwl_cfg iwl6000_3agn_cfg = {
342 .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
343 .fw_name_pre = IWL6000_FW_PRE,
344 .ucode_api_max = IWL6000_UCODE_API_MAX,
345 .ucode_api_ok = IWL6000_UCODE_API_OK,
346 .ucode_api_min = IWL6000_UCODE_API_MIN,
347 .device_family = IWL_DEVICE_FAMILY_6000,
348 .max_inst_size = IWL60_RTC_INST_SIZE,
349 .max_data_size = IWL60_RTC_DATA_SIZE,
350 .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
351 .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
352 .base_params = &iwl6000_base_params,
353 .ht_params = &iwl6000_ht_params,
354 .led_mode = IWL_LED_BLINK,
355 };
356
357 MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_OK));
358 MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
359 MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
360 MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
This page took 0.037406 seconds and 4 git commands to generate.