]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - drivers/net/wireless/intel/iwlwifi/iwl-6000.c
iwlwifi: move notification wait into fw/
[mirror_ubuntu-bionic-kernel.git] / drivers / net / wireless / intel / 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:
d01c5366 22 * Intel Linux Wireless <linuxwifi@intel.com>
e1228374
JS
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 38
e1228374 39/* Lowest firmware API version supported */
44246421
WYG
40#define IWL6000_UCODE_API_MIN 4
41#define IWL6050_UCODE_API_MIN 4
d2c8b15d
MV
42#define IWL6000G2_UCODE_API_MIN 5
43#define IWL6035_UCODE_API_MIN 6
e1228374 44
586aed96
JB
45/* EEPROM versions */
46#define EEPROM_6000_TX_POWER_VERSION (4)
47#define EEPROM_6000_EEPROM_VERSION (0x423)
48#define EEPROM_6050_TX_POWER_VERSION (4)
49#define EEPROM_6050_EEPROM_VERSION (0x532)
50#define EEPROM_6150_TX_POWER_VERSION (6)
51#define EEPROM_6150_EEPROM_VERSION (0x553)
52#define EEPROM_6005_TX_POWER_VERSION (6)
53#define EEPROM_6005_EEPROM_VERSION (0x709)
54#define EEPROM_6030_TX_POWER_VERSION (6)
55#define EEPROM_6030_EEPROM_VERSION (0x709)
56#define EEPROM_6035_TX_POWER_VERSION (6)
57#define EEPROM_6035_EEPROM_VERSION (0x753)
58
e1228374 59#define IWL6000_FW_PRE "iwlwifi-6000-"
8fcbd4dc 60#define IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE __stringify(api) ".ucode"
e1228374
JS
61
62#define IWL6050_FW_PRE "iwlwifi-6050-"
8fcbd4dc 63#define IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE __stringify(api) ".ucode"
e1228374 64
1956e1ad 65#define IWL6005_FW_PRE "iwlwifi-6000g2a-"
8fcbd4dc 66#define IWL6005_MODULE_FIRMWARE(api) IWL6005_FW_PRE __stringify(api) ".ucode"
95b13014 67
1956e1ad 68#define IWL6030_FW_PRE "iwlwifi-6000g2b-"
8fcbd4dc 69#define IWL6030_MODULE_FIRMWARE(api) IWL6030_FW_PRE __stringify(api) ".ucode"
1808972f 70
6794f3ee 71static const struct iwl_base_params iwl6000_base_params = {
0b5af201 72 .eeprom_size = OTP_LOW_IMAGE_SIZE,
0b5af201 73 .num_of_queues = IWLAGN_NUM_QUEUES,
0b5af201
JS
74 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
75 .shadow_ram_support = true,
0b5af201 76 .led_compensation = 51,
22de94de 77 .wd_timeout = IWL_DEF_WD_TIMEOUT,
95b13014 78 .max_event_log_size = 512,
66a77072 79 .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
e03bbb62 80 .scd_chain_ext_wa = true,
0b5af201
JS
81};
82
6794f3ee 83static const struct iwl_base_params iwl6050_base_params = {
1808972f 84 .eeprom_size = OTP_LOW_IMAGE_SIZE,
1808972f 85 .num_of_queues = IWLAGN_NUM_QUEUES,
7cb1b088 86 .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
1808972f
SZ
87 .shadow_ram_support = true,
88 .led_compensation = 51,
22de94de 89 .wd_timeout = IWL_DEF_WD_TIMEOUT,
7cb1b088 90 .max_event_log_size = 1024,
66a77072 91 .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
e03bbb62 92 .scd_chain_ext_wa = true,
7cb1b088 93};
6794f3ee
JB
94
95static const struct iwl_base_params iwl6000_g2_base_params = {
de05ead8
WYG
96 .eeprom_size = OTP_LOW_IMAGE_SIZE,
97 .num_of_queues = IWLAGN_NUM_QUEUES,
de05ead8
WYG
98 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
99 .shadow_ram_support = true,
4fb33244 100 .led_compensation = 57,
22de94de 101 .wd_timeout = IWL_LONG_WD_TIMEOUT,
de05ead8 102 .max_event_log_size = 512,
66a77072 103 .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
e03bbb62 104 .scd_chain_ext_wa = true,
de05ead8 105};
7cb1b088 106
6794f3ee 107static const struct iwl_ht_params iwl6000_ht_params = {
7cb1b088
WYG
108 .ht_greenfield_support = true,
109 .use_rts_for_aggregation = true, /* use rts/cts protection */
57fbcce3 110 .ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
7cb1b088
WYG
111};
112
26a7ca9a
JB
113static const struct iwl_eeprom_params iwl6000_eeprom_params = {
114 .regulatory_bands = {
115 EEPROM_REG_BAND_1_CHANNELS,
116 EEPROM_REG_BAND_2_CHANNELS,
117 EEPROM_REG_BAND_3_CHANNELS,
118 EEPROM_REG_BAND_4_CHANNELS,
119 EEPROM_REG_BAND_5_CHANNELS,
120 EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
121 EEPROM_REG_BAND_52_HT40_CHANNELS
122 },
123 .enhanced_txpower = true,
124};
125
65af8dea 126#define IWL_DEVICE_6005 \
ca9a4605 127 .fw_name_pre = IWL6005_FW_PRE, \
65af8dea
WYG
128 .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
129 .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
2d771cb6 130 .device_family = IWL_DEVICE_FAMILY_6005, \
dae66d0d
EG
131 .max_inst_size = IWL60_RTC_INST_SIZE, \
132 .max_data_size = IWL60_RTC_DATA_SIZE, \
b7998c8b
EL
133 .nvm_ver = EEPROM_6005_EEPROM_VERSION, \
134 .nvm_calib_ver = EEPROM_6005_TX_POWER_VERSION, \
65af8dea 135 .base_params = &iwl6000_g2_base_params, \
26a7ca9a 136 .eeprom_params = &iwl6000_eeprom_params, \
540623ca
EG
137 .led_mode = IWL_LED_RF_STATE, \
138 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
65af8dea 139
706c4ff6 140const struct iwl_cfg iwl6005_2agn_cfg = {
55017ab8 141 .name = "Intel(R) Centrino(R) Advanced-N 6205 AGN",
65af8dea 142 IWL_DEVICE_6005,
7cb1b088 143 .ht_params = &iwl6000_ht_params,
7cb1b088
WYG
144};
145
706c4ff6 146const struct iwl_cfg iwl6005_2abg_cfg = {
55017ab8 147 .name = "Intel(R) Centrino(R) Advanced-N 6205 ABG",
65af8dea 148 IWL_DEVICE_6005,
1808972f
SZ
149};
150
706c4ff6 151const struct iwl_cfg iwl6005_2bg_cfg = {
55017ab8 152 .name = "Intel(R) Centrino(R) Advanced-N 6205 BG",
65af8dea
WYG
153 IWL_DEVICE_6005,
154};
155
706c4ff6 156const struct iwl_cfg iwl6005_2agn_sff_cfg = {
6a9ae0dc
WYG
157 .name = "Intel(R) Centrino(R) Advanced-N 6205S AGN",
158 IWL_DEVICE_6005,
159 .ht_params = &iwl6000_ht_params,
160};
161
706c4ff6 162const struct iwl_cfg iwl6005_2agn_d_cfg = {
5131a600
WYG
163 .name = "Intel(R) Centrino(R) Advanced-N 6205D AGN",
164 IWL_DEVICE_6005,
165 .ht_params = &iwl6000_ht_params,
166};
167
706c4ff6 168const struct iwl_cfg iwl6005_2agn_mow1_cfg = {
37891123
WYG
169 .name = "Intel(R) Centrino(R) Advanced-N 6206 AGN",
170 IWL_DEVICE_6005,
171 .ht_params = &iwl6000_ht_params,
172};
706c4ff6
JB
173
174const struct iwl_cfg iwl6005_2agn_mow2_cfg = {
37891123
WYG
175 .name = "Intel(R) Centrino(R) Advanced-N 6207 AGN",
176 IWL_DEVICE_6005,
177 .ht_params = &iwl6000_ht_params,
178};
179
65af8dea 180#define IWL_DEVICE_6030 \
ca9a4605 181 .fw_name_pre = IWL6030_FW_PRE, \
65af8dea
WYG
182 .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
183 .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
2d771cb6 184 .device_family = IWL_DEVICE_FAMILY_6030, \
dae66d0d
EG
185 .max_inst_size = IWL60_RTC_INST_SIZE, \
186 .max_data_size = IWL60_RTC_DATA_SIZE, \
b7998c8b
EL
187 .nvm_ver = EEPROM_6030_EEPROM_VERSION, \
188 .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
65af8dea 189 .base_params = &iwl6000_g2_base_params, \
26a7ca9a 190 .eeprom_params = &iwl6000_eeprom_params, \
540623ca
EG
191 .led_mode = IWL_LED_RF_STATE, \
192 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
1808972f 193
706c4ff6 194const struct iwl_cfg iwl6030_2agn_cfg = {
d2eceef0 195 .name = "Intel(R) Centrino(R) Advanced-N 6230 AGN",
65af8dea 196 IWL_DEVICE_6030,
7cb1b088 197 .ht_params = &iwl6000_ht_params,
1808972f
SZ
198};
199
706c4ff6 200const struct iwl_cfg iwl6030_2abg_cfg = {
d2eceef0 201 .name = "Intel(R) Centrino(R) Advanced-N 6230 ABG",
65af8dea 202 IWL_DEVICE_6030,
1808972f
SZ
203};
204
706c4ff6 205const struct iwl_cfg iwl6030_2bgn_cfg = {
d2eceef0 206 .name = "Intel(R) Centrino(R) Advanced-N 6230 BGN",
65af8dea 207 IWL_DEVICE_6030,
7cb1b088 208 .ht_params = &iwl6000_ht_params,
9f6e1baf
SZ
209};
210
706c4ff6 211const struct iwl_cfg iwl6030_2bg_cfg = {
d2eceef0 212 .name = "Intel(R) Centrino(R) Advanced-N 6230 BG",
65af8dea 213 IWL_DEVICE_6030,
1808972f
SZ
214};
215
d2c8b15d
MV
216#define IWL_DEVICE_6035 \
217 .fw_name_pre = IWL6030_FW_PRE, \
218 .ucode_api_max = IWL6035_UCODE_API_MAX, \
d2c8b15d
MV
219 .ucode_api_min = IWL6035_UCODE_API_MIN, \
220 .device_family = IWL_DEVICE_FAMILY_6030, \
221 .max_inst_size = IWL60_RTC_INST_SIZE, \
222 .max_data_size = IWL60_RTC_DATA_SIZE, \
b7998c8b
EL
223 .nvm_ver = EEPROM_6030_EEPROM_VERSION, \
224 .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \
d2c8b15d 225 .base_params = &iwl6000_g2_base_params, \
3c70d087 226 .eeprom_params = &iwl6000_eeprom_params, \
540623ca
EG
227 .led_mode = IWL_LED_RF_STATE, \
228 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
d2c8b15d 229
706c4ff6 230const struct iwl_cfg iwl6035_2agn_cfg = {
6195d135 231 .name = "Intel(R) Centrino(R) Advanced-N 6235 AGN",
d2c8b15d 232 IWL_DEVICE_6035,
d103e344
WYG
233 .ht_params = &iwl6000_ht_params,
234};
235
08a5dd38
EG
236const struct iwl_cfg iwl6035_2agn_sff_cfg = {
237 .name = "Intel(R) Centrino(R) Ultimate-N 6235 AGN",
238 IWL_DEVICE_6035,
239 .ht_params = &iwl6000_ht_params,
240};
241
706c4ff6 242const struct iwl_cfg iwl1030_bgn_cfg = {
d2eceef0 243 .name = "Intel(R) Centrino(R) Wireless-N 1030 BGN",
65af8dea 244 IWL_DEVICE_6030,
7cb1b088 245 .ht_params = &iwl6000_ht_params,
1808972f
SZ
246};
247
706c4ff6 248const struct iwl_cfg iwl1030_bg_cfg = {
d2eceef0 249 .name = "Intel(R) Centrino(R) Wireless-N 1030 BG",
65af8dea
WYG
250 IWL_DEVICE_6030,
251};
252
706c4ff6 253const struct iwl_cfg iwl130_bgn_cfg = {
65af8dea
WYG
254 .name = "Intel(R) Centrino(R) Wireless-N 130 BGN",
255 IWL_DEVICE_6030,
256 .ht_params = &iwl6000_ht_params,
257 .rx_with_siso_diversity = true,
258};
259
706c4ff6 260const struct iwl_cfg iwl130_bg_cfg = {
65af8dea
WYG
261 .name = "Intel(R) Centrino(R) Wireless-N 130 BG",
262 IWL_DEVICE_6030,
263 .rx_with_siso_diversity = true,
1808972f
SZ
264};
265
95b13014
SZ
266/*
267 * "i": Internal configuration, use internal Power Amplifier
268 */
65af8dea
WYG
269#define IWL_DEVICE_6000i \
270 .fw_name_pre = IWL6000_FW_PRE, \
271 .ucode_api_max = IWL6000_UCODE_API_MAX, \
272 .ucode_api_min = IWL6000_UCODE_API_MIN, \
2d771cb6 273 .device_family = IWL_DEVICE_FAMILY_6000i, \
dae66d0d
EG
274 .max_inst_size = IWL60_RTC_INST_SIZE, \
275 .max_data_size = IWL60_RTC_DATA_SIZE, \
65af8dea
WYG
276 .valid_tx_ant = ANT_BC, /* .cfg overwrite */ \
277 .valid_rx_ant = ANT_BC, /* .cfg overwrite */ \
b7998c8b
EL
278 .nvm_ver = EEPROM_6000_EEPROM_VERSION, \
279 .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION, \
65af8dea 280 .base_params = &iwl6000_base_params, \
26a7ca9a 281 .eeprom_params = &iwl6000_eeprom_params, \
540623ca
EG
282 .led_mode = IWL_LED_BLINK, \
283 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
65af8dea 284
706c4ff6 285const struct iwl_cfg iwl6000i_2agn_cfg = {
c11362c0 286 .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
65af8dea 287 IWL_DEVICE_6000i,
7cb1b088 288 .ht_params = &iwl6000_ht_params,
e1228374
JS
289};
290
706c4ff6 291const struct iwl_cfg iwl6000i_2abg_cfg = {
c11362c0 292 .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
65af8dea 293 IWL_DEVICE_6000i,
5953a62e
WYG
294};
295
706c4ff6 296const struct iwl_cfg iwl6000i_2bg_cfg = {
c11362c0 297 .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
65af8dea
WYG
298 IWL_DEVICE_6000i,
299};
300
301#define IWL_DEVICE_6050 \
302 .fw_name_pre = IWL6050_FW_PRE, \
303 .ucode_api_max = IWL6050_UCODE_API_MAX, \
304 .ucode_api_min = IWL6050_UCODE_API_MIN, \
2d771cb6 305 .device_family = IWL_DEVICE_FAMILY_6050, \
dae66d0d
EG
306 .max_inst_size = IWL60_RTC_INST_SIZE, \
307 .max_data_size = IWL60_RTC_DATA_SIZE, \
ff458edc
WYG
308 .valid_tx_ant = ANT_AB, /* .cfg overwrite */ \
309 .valid_rx_ant = ANT_AB, /* .cfg overwrite */ \
b7998c8b
EL
310 .nvm_ver = EEPROM_6050_EEPROM_VERSION, \
311 .nvm_calib_ver = EEPROM_6050_TX_POWER_VERSION, \
65af8dea 312 .base_params = &iwl6050_base_params, \
26a7ca9a 313 .eeprom_params = &iwl6000_eeprom_params, \
65af8dea 314 .led_mode = IWL_LED_BLINK, \
540623ca
EG
315 .internal_wimax_coex = true, \
316 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
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 340 .led_mode = IWL_LED_BLINK, \
540623ca
EG
341 .internal_wimax_coex = true, \
342 .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K
1144181c 343
706c4ff6 344const struct iwl_cfg iwl6150_bgn_cfg = {
f9dc6467 345 .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN",
1144181c 346 IWL_DEVICE_6150,
7cb1b088 347 .ht_params = &iwl6000_ht_params,
1144181c
WYG
348};
349
706c4ff6 350const struct iwl_cfg iwl6150_bg_cfg = {
1144181c
WYG
351 .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BG",
352 IWL_DEVICE_6150,
e1228374
JS
353};
354
706c4ff6 355const struct iwl_cfg iwl6000_3agn_cfg = {
c11362c0 356 .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
e1228374
JS
357 .fw_name_pre = IWL6000_FW_PRE,
358 .ucode_api_max = IWL6000_UCODE_API_MAX,
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
9d9b21d1
EG
371MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
372MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
373MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
d8320d75 374MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));