iwlwifi: fix max_ht_ampdu_exponent for older devices
[deliverable/linux.git] / drivers / net / wireless / iwlwifi / iwl-6000.c
CommitLineData
e1228374
JS
1/******************************************************************************
2 *
51368bf7 3 * Copyright(c) 2008 - 2014 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 */
e03bbb62 88 .scd_chain_ext_wa = true,
0b5af201
JS
89};
90
6794f3ee 91static const struct iwl_base_params iwl6050_base_params = {
1808972f 92 .eeprom_size = OTP_LOW_IMAGE_SIZE,
1808972f 93 .num_of_queues = IWLAGN_NUM_QUEUES,
1808972f 94 .pll_cfg_val = 0,
7cb1b088 95 .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
1808972f
SZ
96 .shadow_ram_support = true,
97 .led_compensation = 51,
22de94de 98 .wd_timeout = IWL_DEF_WD_TIMEOUT,
7cb1b088 99 .max_event_log_size = 1024,
66a77072 100 .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
e03bbb62 101 .scd_chain_ext_wa = true,
7cb1b088 102};
6794f3ee
JB
103
104static const struct iwl_base_params iwl6000_g2_base_params = {
de05ead8
WYG
105 .eeprom_size = OTP_LOW_IMAGE_SIZE,
106 .num_of_queues = IWLAGN_NUM_QUEUES,
de05ead8 107 .pll_cfg_val = 0,
de05ead8
WYG
108 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
109 .shadow_ram_support = true,
4fb33244 110 .led_compensation = 57,
22de94de 111 .wd_timeout = IWL_LONG_WD_TIMEOUT,
de05ead8 112 .max_event_log_size = 512,
66a77072 113 .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
e03bbb62 114 .scd_chain_ext_wa = true,
de05ead8 115};
7cb1b088 116
6794f3ee 117static const struct iwl_ht_params iwl6000_ht_params = {
7cb1b088
WYG
118 .ht_greenfield_support = true,
119 .use_rts_for_aggregation = true, /* use rts/cts protection */
d370493f 120 .ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ),
7cb1b088
WYG
121};
122
26a7ca9a
JB
123static const struct iwl_eeprom_params iwl6000_eeprom_params = {
124 .regulatory_bands = {
125 EEPROM_REG_BAND_1_CHANNELS,
126 EEPROM_REG_BAND_2_CHANNELS,
127 EEPROM_REG_BAND_3_CHANNELS,
128 EEPROM_REG_BAND_4_CHANNELS,
129 EEPROM_REG_BAND_5_CHANNELS,
130 EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
131 EEPROM_REG_BAND_52_HT40_CHANNELS
132 },
133 .enhanced_txpower = true,
134};
135
65af8dea 136#define IWL_DEVICE_6005 \
ca9a4605 137 .fw_name_pre = IWL6005_FW_PRE, \
65af8dea 138 .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
ca9a4605 139 .ucode_api_ok = IWL6000G2_UCODE_API_OK, \
65af8dea 140 .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
2d771cb6 141 .device_family = IWL_DEVICE_FAMILY_6005, \
dae66d0d
EG
142 .max_inst_size = IWL60_RTC_INST_SIZE, \
143 .max_data_size = IWL60_RTC_DATA_SIZE, \
b7998c8b
EL
144 .nvm_ver = EEPROM_6005_EEPROM_VERSION, \
145 .nvm_calib_ver = EEPROM_6005_TX_POWER_VERSION, \
65af8dea 146 .base_params = &iwl6000_g2_base_params, \
26a7ca9a 147 .eeprom_params = &iwl6000_eeprom_params, \
540623ca
EG
148 .led_mode = IWL_LED_RF_STATE, \
149 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
65af8dea 150
706c4ff6 151const struct iwl_cfg iwl6005_2agn_cfg = {
55017ab8 152 .name = "Intel(R) Centrino(R) Advanced-N 6205 AGN",
65af8dea 153 IWL_DEVICE_6005,
7cb1b088 154 .ht_params = &iwl6000_ht_params,
7cb1b088
WYG
155};
156
706c4ff6 157const struct iwl_cfg iwl6005_2abg_cfg = {
55017ab8 158 .name = "Intel(R) Centrino(R) Advanced-N 6205 ABG",
65af8dea 159 IWL_DEVICE_6005,
1808972f
SZ
160};
161
706c4ff6 162const struct iwl_cfg iwl6005_2bg_cfg = {
55017ab8 163 .name = "Intel(R) Centrino(R) Advanced-N 6205 BG",
65af8dea
WYG
164 IWL_DEVICE_6005,
165};
166
706c4ff6 167const struct iwl_cfg iwl6005_2agn_sff_cfg = {
6a9ae0dc
WYG
168 .name = "Intel(R) Centrino(R) Advanced-N 6205S AGN",
169 IWL_DEVICE_6005,
170 .ht_params = &iwl6000_ht_params,
171};
172
706c4ff6 173const struct iwl_cfg iwl6005_2agn_d_cfg = {
5131a600
WYG
174 .name = "Intel(R) Centrino(R) Advanced-N 6205D AGN",
175 IWL_DEVICE_6005,
176 .ht_params = &iwl6000_ht_params,
177};
178
706c4ff6 179const struct iwl_cfg iwl6005_2agn_mow1_cfg = {
37891123
WYG
180 .name = "Intel(R) Centrino(R) Advanced-N 6206 AGN",
181 IWL_DEVICE_6005,
182 .ht_params = &iwl6000_ht_params,
183};
706c4ff6
JB
184
185const struct iwl_cfg iwl6005_2agn_mow2_cfg = {
37891123
WYG
186 .name = "Intel(R) Centrino(R) Advanced-N 6207 AGN",
187 IWL_DEVICE_6005,
188 .ht_params = &iwl6000_ht_params,
189};
190
65af8dea 191#define IWL_DEVICE_6030 \
ca9a4605 192 .fw_name_pre = IWL6030_FW_PRE, \
65af8dea 193 .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
1ed2ec37 194 .ucode_api_ok = IWL6000G2B_UCODE_API_OK, \
65af8dea 195 .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
2d771cb6 196 .device_family = IWL_DEVICE_FAMILY_6030, \
dae66d0d
EG
197 .max_inst_size = IWL60_RTC_INST_SIZE, \
198 .max_data_size = IWL60_RTC_DATA_SIZE, \
b7998c8b
EL
199 .nvm_ver = EEPROM_6030_EEPROM_VERSION, \
200 .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
65af8dea 201 .base_params = &iwl6000_g2_base_params, \
26a7ca9a 202 .eeprom_params = &iwl6000_eeprom_params, \
540623ca
EG
203 .led_mode = IWL_LED_RF_STATE, \
204 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
1808972f 205
706c4ff6 206const struct iwl_cfg iwl6030_2agn_cfg = {
d2eceef0 207 .name = "Intel(R) Centrino(R) Advanced-N 6230 AGN",
65af8dea 208 IWL_DEVICE_6030,
7cb1b088 209 .ht_params = &iwl6000_ht_params,
1808972f
SZ
210};
211
706c4ff6 212const struct iwl_cfg iwl6030_2abg_cfg = {
d2eceef0 213 .name = "Intel(R) Centrino(R) Advanced-N 6230 ABG",
65af8dea 214 IWL_DEVICE_6030,
1808972f
SZ
215};
216
706c4ff6 217const struct iwl_cfg iwl6030_2bgn_cfg = {
d2eceef0 218 .name = "Intel(R) Centrino(R) Advanced-N 6230 BGN",
65af8dea 219 IWL_DEVICE_6030,
7cb1b088 220 .ht_params = &iwl6000_ht_params,
9f6e1baf
SZ
221};
222
706c4ff6 223const struct iwl_cfg iwl6030_2bg_cfg = {
d2eceef0 224 .name = "Intel(R) Centrino(R) Advanced-N 6230 BG",
65af8dea 225 IWL_DEVICE_6030,
1808972f
SZ
226};
227
d2c8b15d
MV
228#define IWL_DEVICE_6035 \
229 .fw_name_pre = IWL6030_FW_PRE, \
230 .ucode_api_max = IWL6035_UCODE_API_MAX, \
231 .ucode_api_ok = IWL6035_UCODE_API_OK, \
232 .ucode_api_min = IWL6035_UCODE_API_MIN, \
233 .device_family = IWL_DEVICE_FAMILY_6030, \
234 .max_inst_size = IWL60_RTC_INST_SIZE, \
235 .max_data_size = IWL60_RTC_DATA_SIZE, \
b7998c8b
EL
236 .nvm_ver = EEPROM_6030_EEPROM_VERSION, \
237 .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
d2c8b15d 238 .base_params = &iwl6000_g2_base_params, \
3c70d087 239 .eeprom_params = &iwl6000_eeprom_params, \
540623ca
EG
240 .led_mode = IWL_LED_RF_STATE, \
241 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
d2c8b15d 242
706c4ff6 243const struct iwl_cfg iwl6035_2agn_cfg = {
6195d135 244 .name = "Intel(R) Centrino(R) Advanced-N 6235 AGN",
d2c8b15d 245 IWL_DEVICE_6035,
d103e344
WYG
246 .ht_params = &iwl6000_ht_params,
247};
248
08a5dd38
EG
249const struct iwl_cfg iwl6035_2agn_sff_cfg = {
250 .name = "Intel(R) Centrino(R) Ultimate-N 6235 AGN",
251 IWL_DEVICE_6035,
252 .ht_params = &iwl6000_ht_params,
253};
254
706c4ff6 255const struct iwl_cfg iwl1030_bgn_cfg = {
d2eceef0 256 .name = "Intel(R) Centrino(R) Wireless-N 1030 BGN",
65af8dea 257 IWL_DEVICE_6030,
7cb1b088 258 .ht_params = &iwl6000_ht_params,
1808972f
SZ
259};
260
706c4ff6 261const struct iwl_cfg iwl1030_bg_cfg = {
d2eceef0 262 .name = "Intel(R) Centrino(R) Wireless-N 1030 BG",
65af8dea
WYG
263 IWL_DEVICE_6030,
264};
265
706c4ff6 266const struct iwl_cfg iwl130_bgn_cfg = {
65af8dea
WYG
267 .name = "Intel(R) Centrino(R) Wireless-N 130 BGN",
268 IWL_DEVICE_6030,
269 .ht_params = &iwl6000_ht_params,
270 .rx_with_siso_diversity = true,
271};
272
706c4ff6 273const struct iwl_cfg iwl130_bg_cfg = {
65af8dea
WYG
274 .name = "Intel(R) Centrino(R) Wireless-N 130 BG",
275 IWL_DEVICE_6030,
276 .rx_with_siso_diversity = true,
1808972f
SZ
277};
278
95b13014
SZ
279/*
280 * "i": Internal configuration, use internal Power Amplifier
281 */
65af8dea
WYG
282#define IWL_DEVICE_6000i \
283 .fw_name_pre = IWL6000_FW_PRE, \
284 .ucode_api_max = IWL6000_UCODE_API_MAX, \
b9148115 285 .ucode_api_ok = IWL6000_UCODE_API_OK, \
65af8dea 286 .ucode_api_min = IWL6000_UCODE_API_MIN, \
2d771cb6 287 .device_family = IWL_DEVICE_FAMILY_6000i, \
dae66d0d
EG
288 .max_inst_size = IWL60_RTC_INST_SIZE, \
289 .max_data_size = IWL60_RTC_DATA_SIZE, \
65af8dea
WYG
290 .valid_tx_ant = ANT_BC, /* .cfg overwrite */ \
291 .valid_rx_ant = ANT_BC, /* .cfg overwrite */ \
b7998c8b
EL
292 .nvm_ver = EEPROM_6000_EEPROM_VERSION, \
293 .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION, \
65af8dea 294 .base_params = &iwl6000_base_params, \
26a7ca9a 295 .eeprom_params = &iwl6000_eeprom_params, \
540623ca
EG
296 .led_mode = IWL_LED_BLINK, \
297 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
65af8dea 298
706c4ff6 299const struct iwl_cfg iwl6000i_2agn_cfg = {
c11362c0 300 .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
65af8dea 301 IWL_DEVICE_6000i,
7cb1b088 302 .ht_params = &iwl6000_ht_params,
e1228374
JS
303};
304
706c4ff6 305const struct iwl_cfg iwl6000i_2abg_cfg = {
c11362c0 306 .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
65af8dea 307 IWL_DEVICE_6000i,
5953a62e
WYG
308};
309
706c4ff6 310const struct iwl_cfg iwl6000i_2bg_cfg = {
c11362c0 311 .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
65af8dea
WYG
312 IWL_DEVICE_6000i,
313};
314
315#define IWL_DEVICE_6050 \
316 .fw_name_pre = IWL6050_FW_PRE, \
317 .ucode_api_max = IWL6050_UCODE_API_MAX, \
318 .ucode_api_min = IWL6050_UCODE_API_MIN, \
2d771cb6 319 .device_family = IWL_DEVICE_FAMILY_6050, \
dae66d0d
EG
320 .max_inst_size = IWL60_RTC_INST_SIZE, \
321 .max_data_size = IWL60_RTC_DATA_SIZE, \
ff458edc
WYG
322 .valid_tx_ant = ANT_AB, /* .cfg overwrite */ \
323 .valid_rx_ant = ANT_AB, /* .cfg overwrite */ \
b7998c8b
EL
324 .nvm_ver = EEPROM_6050_EEPROM_VERSION, \
325 .nvm_calib_ver = EEPROM_6050_TX_POWER_VERSION, \
65af8dea 326 .base_params = &iwl6050_base_params, \
26a7ca9a 327 .eeprom_params = &iwl6000_eeprom_params, \
65af8dea 328 .led_mode = IWL_LED_BLINK, \
540623ca
EG
329 .internal_wimax_coex = true, \
330 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
5953a62e 331
706c4ff6 332const struct iwl_cfg iwl6050_2agn_cfg = {
c11362c0 333 .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
65af8dea 334 IWL_DEVICE_6050,
7cb1b088 335 .ht_params = &iwl6000_ht_params,
65af8dea
WYG
336};
337
706c4ff6 338const struct iwl_cfg iwl6050_2abg_cfg = {
65af8dea
WYG
339 .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG",
340 IWL_DEVICE_6050,
03264339
SZ
341};
342
1144181c
WYG
343#define IWL_DEVICE_6150 \
344 .fw_name_pre = IWL6050_FW_PRE, \
345 .ucode_api_max = IWL6050_UCODE_API_MAX, \
346 .ucode_api_min = IWL6050_UCODE_API_MIN, \
2d771cb6 347 .device_family = IWL_DEVICE_FAMILY_6150, \
dae66d0d
EG
348 .max_inst_size = IWL60_RTC_INST_SIZE, \
349 .max_data_size = IWL60_RTC_DATA_SIZE, \
b7998c8b
EL
350 .nvm_ver = EEPROM_6150_EEPROM_VERSION, \
351 .nvm_calib_ver = EEPROM_6150_TX_POWER_VERSION, \
1144181c 352 .base_params = &iwl6050_base_params, \
26a7ca9a 353 .eeprom_params = &iwl6000_eeprom_params, \
1144181c 354 .led_mode = IWL_LED_BLINK, \
540623ca
EG
355 .internal_wimax_coex = true, \
356 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
1144181c 357
706c4ff6 358const struct iwl_cfg iwl6150_bgn_cfg = {
f9dc6467 359 .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN",
1144181c 360 IWL_DEVICE_6150,
7cb1b088 361 .ht_params = &iwl6000_ht_params,
1144181c
WYG
362};
363
706c4ff6 364const struct iwl_cfg iwl6150_bg_cfg = {
1144181c
WYG
365 .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BG",
366 IWL_DEVICE_6150,
e1228374
JS
367};
368
706c4ff6 369const struct iwl_cfg iwl6000_3agn_cfg = {
c11362c0 370 .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
e1228374
JS
371 .fw_name_pre = IWL6000_FW_PRE,
372 .ucode_api_max = IWL6000_UCODE_API_MAX,
b9148115 373 .ucode_api_ok = IWL6000_UCODE_API_OK,
e1228374 374 .ucode_api_min = IWL6000_UCODE_API_MIN,
2d771cb6 375 .device_family = IWL_DEVICE_FAMILY_6000,
dae66d0d
EG
376 .max_inst_size = IWL60_RTC_INST_SIZE,
377 .max_data_size = IWL60_RTC_DATA_SIZE,
b7998c8b
EL
378 .nvm_ver = EEPROM_6000_EEPROM_VERSION,
379 .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION,
7cb1b088 380 .base_params = &iwl6000_base_params,
26a7ca9a 381 .eeprom_params = &iwl6000_eeprom_params,
7cb1b088 382 .ht_params = &iwl6000_ht_params,
564b344c 383 .led_mode = IWL_LED_BLINK,
e1228374
JS
384};
385
b9148115 386MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_OK));
78cbcf2b
MV
387MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_OK));
388MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_OK));
389MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2B_UCODE_API_OK));
This page took 0.651841 seconds and 5 git commands to generate.