Merge tag 'regulator-v3.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git...
[deliverable/linux.git] / drivers / net / wireless / iwlwifi / iwl-6000.c
CommitLineData
e1228374
JS
1/******************************************************************************
2 *
128e63ef 3 * Copyright(c) 2008 - 2013 Intel Corporation. All rights reserved.
e1228374
JS
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
e1228374 27#include <linux/module.h>
8fcbd4dc 28#include <linux/stringify.h>
e9676695 29#include "iwl-config.h"
0db19cde 30#include "iwl-agn-hw.h"
1023fdc4 31#include "dvm/commands.h" /* needed for BT for now */
e1228374
JS
32
33/* Highest firmware API version supported */
b9148115 34#define IWL6000_UCODE_API_MAX 6
62cb3c6a 35#define IWL6050_UCODE_API_MAX 5
ca9a4605 36#define IWL6000G2_UCODE_API_MAX 6
d2c8b15d 37#define IWL6035_UCODE_API_MAX 6
ca9a4605
JB
38
39/* Oldest version we won't warn about */
b9148115 40#define IWL6000_UCODE_API_OK 4
ca9a4605 41#define IWL6000G2_UCODE_API_OK 5
78cbcf2b
MV
42#define IWL6050_UCODE_API_OK 5
43#define IWL6000G2B_UCODE_API_OK 6
d2c8b15d 44#define IWL6035_UCODE_API_OK 6
e1228374
JS
45
46/* Lowest firmware API version supported */
44246421
WYG
47#define IWL6000_UCODE_API_MIN 4
48#define IWL6050_UCODE_API_MIN 4
d2c8b15d
MV
49#define IWL6000G2_UCODE_API_MIN 5
50#define IWL6035_UCODE_API_MIN 6
e1228374 51
586aed96
JB
52/* EEPROM versions */
53#define EEPROM_6000_TX_POWER_VERSION (4)
54#define EEPROM_6000_EEPROM_VERSION (0x423)
55#define EEPROM_6050_TX_POWER_VERSION (4)
56#define EEPROM_6050_EEPROM_VERSION (0x532)
57#define EEPROM_6150_TX_POWER_VERSION (6)
58#define EEPROM_6150_EEPROM_VERSION (0x553)
59#define EEPROM_6005_TX_POWER_VERSION (6)
60#define EEPROM_6005_EEPROM_VERSION (0x709)
61#define EEPROM_6030_TX_POWER_VERSION (6)
62#define EEPROM_6030_EEPROM_VERSION (0x709)
63#define EEPROM_6035_TX_POWER_VERSION (6)
64#define EEPROM_6035_EEPROM_VERSION (0x753)
65
e1228374 66#define IWL6000_FW_PRE "iwlwifi-6000-"
8fcbd4dc 67#define IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE __stringify(api) ".ucode"
e1228374
JS
68
69#define IWL6050_FW_PRE "iwlwifi-6050-"
8fcbd4dc 70#define IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE __stringify(api) ".ucode"
e1228374 71
1956e1ad 72#define IWL6005_FW_PRE "iwlwifi-6000g2a-"
8fcbd4dc 73#define IWL6005_MODULE_FIRMWARE(api) IWL6005_FW_PRE __stringify(api) ".ucode"
95b13014 74
1956e1ad 75#define IWL6030_FW_PRE "iwlwifi-6000g2b-"
8fcbd4dc 76#define IWL6030_MODULE_FIRMWARE(api) IWL6030_FW_PRE __stringify(api) ".ucode"
1808972f 77
6794f3ee 78static const struct iwl_base_params iwl6000_base_params = {
0b5af201 79 .eeprom_size = OTP_LOW_IMAGE_SIZE,
0b5af201 80 .num_of_queues = IWLAGN_NUM_QUEUES,
0b5af201 81 .pll_cfg_val = 0,
0b5af201
JS
82 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
83 .shadow_ram_support = true,
0b5af201 84 .led_compensation = 51,
22de94de 85 .wd_timeout = IWL_DEF_WD_TIMEOUT,
95b13014 86 .max_event_log_size = 512,
66a77072 87 .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
0b5af201
JS
88};
89
6794f3ee 90static const struct iwl_base_params iwl6050_base_params = {
1808972f 91 .eeprom_size = OTP_LOW_IMAGE_SIZE,
1808972f 92 .num_of_queues = IWLAGN_NUM_QUEUES,
1808972f 93 .pll_cfg_val = 0,
7cb1b088 94 .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
1808972f
SZ
95 .shadow_ram_support = true,
96 .led_compensation = 51,
22de94de 97 .wd_timeout = IWL_DEF_WD_TIMEOUT,
7cb1b088 98 .max_event_log_size = 1024,
66a77072 99 .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
7cb1b088 100};
6794f3ee
JB
101
102static const struct iwl_base_params iwl6000_g2_base_params = {
de05ead8
WYG
103 .eeprom_size = OTP_LOW_IMAGE_SIZE,
104 .num_of_queues = IWLAGN_NUM_QUEUES,
de05ead8 105 .pll_cfg_val = 0,
de05ead8
WYG
106 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
107 .shadow_ram_support = true,
4fb33244 108 .led_compensation = 57,
22de94de 109 .wd_timeout = IWL_LONG_WD_TIMEOUT,
de05ead8 110 .max_event_log_size = 512,
66a77072 111 .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
de05ead8 112};
7cb1b088 113
6794f3ee 114static const struct iwl_ht_params iwl6000_ht_params = {
7cb1b088
WYG
115 .ht_greenfield_support = true,
116 .use_rts_for_aggregation = true, /* use rts/cts protection */
d370493f 117 .ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ),
7cb1b088
WYG
118};
119
26a7ca9a
JB
120static const struct iwl_eeprom_params iwl6000_eeprom_params = {
121 .regulatory_bands = {
122 EEPROM_REG_BAND_1_CHANNELS,
123 EEPROM_REG_BAND_2_CHANNELS,
124 EEPROM_REG_BAND_3_CHANNELS,
125 EEPROM_REG_BAND_4_CHANNELS,
126 EEPROM_REG_BAND_5_CHANNELS,
127 EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
128 EEPROM_REG_BAND_52_HT40_CHANNELS
129 },
130 .enhanced_txpower = true,
131};
132
65af8dea 133#define IWL_DEVICE_6005 \
ca9a4605 134 .fw_name_pre = IWL6005_FW_PRE, \
65af8dea 135 .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
ca9a4605 136 .ucode_api_ok = IWL6000G2_UCODE_API_OK, \
65af8dea 137 .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
2d771cb6 138 .device_family = IWL_DEVICE_FAMILY_6005, \
dae66d0d
EG
139 .max_inst_size = IWL60_RTC_INST_SIZE, \
140 .max_data_size = IWL60_RTC_DATA_SIZE, \
b7998c8b
EL
141 .nvm_ver = EEPROM_6005_EEPROM_VERSION, \
142 .nvm_calib_ver = EEPROM_6005_TX_POWER_VERSION, \
65af8dea 143 .base_params = &iwl6000_g2_base_params, \
26a7ca9a 144 .eeprom_params = &iwl6000_eeprom_params, \
65af8dea
WYG
145 .led_mode = IWL_LED_RF_STATE
146
706c4ff6 147const struct iwl_cfg iwl6005_2agn_cfg = {
55017ab8 148 .name = "Intel(R) Centrino(R) Advanced-N 6205 AGN",
65af8dea 149 IWL_DEVICE_6005,
7cb1b088 150 .ht_params = &iwl6000_ht_params,
7cb1b088
WYG
151};
152
706c4ff6 153const struct iwl_cfg iwl6005_2abg_cfg = {
55017ab8 154 .name = "Intel(R) Centrino(R) Advanced-N 6205 ABG",
65af8dea 155 IWL_DEVICE_6005,
1808972f
SZ
156};
157
706c4ff6 158const struct iwl_cfg iwl6005_2bg_cfg = {
55017ab8 159 .name = "Intel(R) Centrino(R) Advanced-N 6205 BG",
65af8dea
WYG
160 IWL_DEVICE_6005,
161};
162
706c4ff6 163const struct iwl_cfg iwl6005_2agn_sff_cfg = {
6a9ae0dc
WYG
164 .name = "Intel(R) Centrino(R) Advanced-N 6205S AGN",
165 IWL_DEVICE_6005,
166 .ht_params = &iwl6000_ht_params,
167};
168
706c4ff6 169const struct iwl_cfg iwl6005_2agn_d_cfg = {
5131a600
WYG
170 .name = "Intel(R) Centrino(R) Advanced-N 6205D AGN",
171 IWL_DEVICE_6005,
172 .ht_params = &iwl6000_ht_params,
173};
174
706c4ff6 175const struct iwl_cfg iwl6005_2agn_mow1_cfg = {
37891123
WYG
176 .name = "Intel(R) Centrino(R) Advanced-N 6206 AGN",
177 IWL_DEVICE_6005,
178 .ht_params = &iwl6000_ht_params,
179};
706c4ff6
JB
180
181const struct iwl_cfg iwl6005_2agn_mow2_cfg = {
37891123
WYG
182 .name = "Intel(R) Centrino(R) Advanced-N 6207 AGN",
183 IWL_DEVICE_6005,
184 .ht_params = &iwl6000_ht_params,
185};
186
65af8dea 187#define IWL_DEVICE_6030 \
ca9a4605 188 .fw_name_pre = IWL6030_FW_PRE, \
65af8dea 189 .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
1ed2ec37 190 .ucode_api_ok = IWL6000G2B_UCODE_API_OK, \
65af8dea 191 .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
2d771cb6 192 .device_family = IWL_DEVICE_FAMILY_6030, \
dae66d0d
EG
193 .max_inst_size = IWL60_RTC_INST_SIZE, \
194 .max_data_size = IWL60_RTC_DATA_SIZE, \
b7998c8b
EL
195 .nvm_ver = EEPROM_6030_EEPROM_VERSION, \
196 .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
65af8dea 197 .base_params = &iwl6000_g2_base_params, \
26a7ca9a 198 .eeprom_params = &iwl6000_eeprom_params, \
0d8877a1 199 .led_mode = IWL_LED_RF_STATE
1808972f 200
706c4ff6 201const struct iwl_cfg iwl6030_2agn_cfg = {
d2eceef0 202 .name = "Intel(R) Centrino(R) Advanced-N 6230 AGN",
65af8dea 203 IWL_DEVICE_6030,
7cb1b088 204 .ht_params = &iwl6000_ht_params,
1808972f
SZ
205};
206
706c4ff6 207const struct iwl_cfg iwl6030_2abg_cfg = {
d2eceef0 208 .name = "Intel(R) Centrino(R) Advanced-N 6230 ABG",
65af8dea 209 IWL_DEVICE_6030,
1808972f
SZ
210};
211
706c4ff6 212const struct iwl_cfg iwl6030_2bgn_cfg = {
d2eceef0 213 .name = "Intel(R) Centrino(R) Advanced-N 6230 BGN",
65af8dea 214 IWL_DEVICE_6030,
7cb1b088 215 .ht_params = &iwl6000_ht_params,
9f6e1baf
SZ
216};
217
706c4ff6 218const struct iwl_cfg iwl6030_2bg_cfg = {
d2eceef0 219 .name = "Intel(R) Centrino(R) Advanced-N 6230 BG",
65af8dea 220 IWL_DEVICE_6030,
1808972f
SZ
221};
222
d2c8b15d
MV
223#define IWL_DEVICE_6035 \
224 .fw_name_pre = IWL6030_FW_PRE, \
225 .ucode_api_max = IWL6035_UCODE_API_MAX, \
226 .ucode_api_ok = IWL6035_UCODE_API_OK, \
227 .ucode_api_min = IWL6035_UCODE_API_MIN, \
228 .device_family = IWL_DEVICE_FAMILY_6030, \
229 .max_inst_size = IWL60_RTC_INST_SIZE, \
230 .max_data_size = IWL60_RTC_DATA_SIZE, \
b7998c8b
EL
231 .nvm_ver = EEPROM_6030_EEPROM_VERSION, \
232 .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
d2c8b15d 233 .base_params = &iwl6000_g2_base_params, \
3c70d087 234 .eeprom_params = &iwl6000_eeprom_params, \
0d8877a1 235 .led_mode = IWL_LED_RF_STATE
d2c8b15d 236
706c4ff6 237const struct iwl_cfg iwl6035_2agn_cfg = {
6195d135 238 .name = "Intel(R) Centrino(R) Advanced-N 6235 AGN",
d2c8b15d 239 IWL_DEVICE_6035,
d103e344
WYG
240 .ht_params = &iwl6000_ht_params,
241};
242
706c4ff6 243const struct iwl_cfg iwl1030_bgn_cfg = {
d2eceef0 244 .name = "Intel(R) Centrino(R) Wireless-N 1030 BGN",
65af8dea 245 IWL_DEVICE_6030,
7cb1b088 246 .ht_params = &iwl6000_ht_params,
1808972f
SZ
247};
248
706c4ff6 249const struct iwl_cfg iwl1030_bg_cfg = {
d2eceef0 250 .name = "Intel(R) Centrino(R) Wireless-N 1030 BG",
65af8dea
WYG
251 IWL_DEVICE_6030,
252};
253
706c4ff6 254const struct iwl_cfg iwl130_bgn_cfg = {
65af8dea
WYG
255 .name = "Intel(R) Centrino(R) Wireless-N 130 BGN",
256 IWL_DEVICE_6030,
257 .ht_params = &iwl6000_ht_params,
258 .rx_with_siso_diversity = true,
259};
260
706c4ff6 261const struct iwl_cfg iwl130_bg_cfg = {
65af8dea
WYG
262 .name = "Intel(R) Centrino(R) Wireless-N 130 BG",
263 IWL_DEVICE_6030,
264 .rx_with_siso_diversity = true,
1808972f
SZ
265};
266
95b13014
SZ
267/*
268 * "i": Internal configuration, use internal Power Amplifier
269 */
65af8dea
WYG
270#define IWL_DEVICE_6000i \
271 .fw_name_pre = IWL6000_FW_PRE, \
272 .ucode_api_max = IWL6000_UCODE_API_MAX, \
b9148115 273 .ucode_api_ok = IWL6000_UCODE_API_OK, \
65af8dea 274 .ucode_api_min = IWL6000_UCODE_API_MIN, \
2d771cb6 275 .device_family = IWL_DEVICE_FAMILY_6000i, \
dae66d0d
EG
276 .max_inst_size = IWL60_RTC_INST_SIZE, \
277 .max_data_size = IWL60_RTC_DATA_SIZE, \
65af8dea
WYG
278 .valid_tx_ant = ANT_BC, /* .cfg overwrite */ \
279 .valid_rx_ant = ANT_BC, /* .cfg overwrite */ \
b7998c8b
EL
280 .nvm_ver = EEPROM_6000_EEPROM_VERSION, \
281 .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION, \
65af8dea 282 .base_params = &iwl6000_base_params, \
26a7ca9a 283 .eeprom_params = &iwl6000_eeprom_params, \
65af8dea
WYG
284 .led_mode = IWL_LED_BLINK
285
706c4ff6 286const struct iwl_cfg iwl6000i_2agn_cfg = {
c11362c0 287 .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
65af8dea 288 IWL_DEVICE_6000i,
7cb1b088 289 .ht_params = &iwl6000_ht_params,
e1228374
JS
290};
291
706c4ff6 292const struct iwl_cfg iwl6000i_2abg_cfg = {
c11362c0 293 .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
65af8dea 294 IWL_DEVICE_6000i,
5953a62e
WYG
295};
296
706c4ff6 297const struct iwl_cfg iwl6000i_2bg_cfg = {
c11362c0 298 .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
65af8dea
WYG
299 IWL_DEVICE_6000i,
300};
301
302#define IWL_DEVICE_6050 \
303 .fw_name_pre = IWL6050_FW_PRE, \
304 .ucode_api_max = IWL6050_UCODE_API_MAX, \
305 .ucode_api_min = IWL6050_UCODE_API_MIN, \
2d771cb6 306 .device_family = IWL_DEVICE_FAMILY_6050, \
dae66d0d
EG
307 .max_inst_size = IWL60_RTC_INST_SIZE, \
308 .max_data_size = IWL60_RTC_DATA_SIZE, \
ff458edc
WYG
309 .valid_tx_ant = ANT_AB, /* .cfg overwrite */ \
310 .valid_rx_ant = ANT_AB, /* .cfg overwrite */ \
b7998c8b
EL
311 .nvm_ver = EEPROM_6050_EEPROM_VERSION, \
312 .nvm_calib_ver = EEPROM_6050_TX_POWER_VERSION, \
65af8dea 313 .base_params = &iwl6050_base_params, \
26a7ca9a 314 .eeprom_params = &iwl6000_eeprom_params, \
65af8dea
WYG
315 .led_mode = IWL_LED_BLINK, \
316 .internal_wimax_coex = true
5953a62e 317
706c4ff6 318const struct iwl_cfg iwl6050_2agn_cfg = {
c11362c0 319 .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
65af8dea 320 IWL_DEVICE_6050,
7cb1b088 321 .ht_params = &iwl6000_ht_params,
65af8dea
WYG
322};
323
706c4ff6 324const struct iwl_cfg iwl6050_2abg_cfg = {
65af8dea
WYG
325 .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG",
326 IWL_DEVICE_6050,
03264339
SZ
327};
328
1144181c
WYG
329#define IWL_DEVICE_6150 \
330 .fw_name_pre = IWL6050_FW_PRE, \
331 .ucode_api_max = IWL6050_UCODE_API_MAX, \
332 .ucode_api_min = IWL6050_UCODE_API_MIN, \
2d771cb6 333 .device_family = IWL_DEVICE_FAMILY_6150, \
dae66d0d
EG
334 .max_inst_size = IWL60_RTC_INST_SIZE, \
335 .max_data_size = IWL60_RTC_DATA_SIZE, \
b7998c8b
EL
336 .nvm_ver = EEPROM_6150_EEPROM_VERSION, \
337 .nvm_calib_ver = EEPROM_6150_TX_POWER_VERSION, \
1144181c 338 .base_params = &iwl6050_base_params, \
26a7ca9a 339 .eeprom_params = &iwl6000_eeprom_params, \
1144181c
WYG
340 .led_mode = IWL_LED_BLINK, \
341 .internal_wimax_coex = true
342
706c4ff6 343const struct iwl_cfg iwl6150_bgn_cfg = {
f9dc6467 344 .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN",
1144181c 345 IWL_DEVICE_6150,
7cb1b088 346 .ht_params = &iwl6000_ht_params,
1144181c
WYG
347};
348
706c4ff6 349const struct iwl_cfg iwl6150_bg_cfg = {
1144181c
WYG
350 .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BG",
351 IWL_DEVICE_6150,
e1228374
JS
352};
353
706c4ff6 354const struct iwl_cfg iwl6000_3agn_cfg = {
c11362c0 355 .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
e1228374
JS
356 .fw_name_pre = IWL6000_FW_PRE,
357 .ucode_api_max = IWL6000_UCODE_API_MAX,
b9148115 358 .ucode_api_ok = IWL6000_UCODE_API_OK,
e1228374 359 .ucode_api_min = IWL6000_UCODE_API_MIN,
2d771cb6 360 .device_family = IWL_DEVICE_FAMILY_6000,
dae66d0d
EG
361 .max_inst_size = IWL60_RTC_INST_SIZE,
362 .max_data_size = IWL60_RTC_DATA_SIZE,
b7998c8b
EL
363 .nvm_ver = EEPROM_6000_EEPROM_VERSION,
364 .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION,
7cb1b088 365 .base_params = &iwl6000_base_params,
26a7ca9a 366 .eeprom_params = &iwl6000_eeprom_params,
7cb1b088 367 .ht_params = &iwl6000_ht_params,
564b344c 368 .led_mode = IWL_LED_BLINK,
e1228374
JS
369};
370
b9148115 371MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_OK));
78cbcf2b
MV
372MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_OK));
373MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_OK));
374MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2B_UCODE_API_OK));
This page took 0.682647 seconds and 5 git commands to generate.