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