iwlwifi: mvm: Disable power save for monitor interface
[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
08a5dd38
EG
243const struct iwl_cfg iwl6035_2agn_sff_cfg = {
244 .name = "Intel(R) Centrino(R) Ultimate-N 6235 AGN",
245 IWL_DEVICE_6035,
246 .ht_params = &iwl6000_ht_params,
247};
248
706c4ff6 249const struct iwl_cfg iwl1030_bgn_cfg = {
d2eceef0 250 .name = "Intel(R) Centrino(R) Wireless-N 1030 BGN",
65af8dea 251 IWL_DEVICE_6030,
7cb1b088 252 .ht_params = &iwl6000_ht_params,
1808972f
SZ
253};
254
706c4ff6 255const struct iwl_cfg iwl1030_bg_cfg = {
d2eceef0 256 .name = "Intel(R) Centrino(R) Wireless-N 1030 BG",
65af8dea
WYG
257 IWL_DEVICE_6030,
258};
259
706c4ff6 260const struct iwl_cfg iwl130_bgn_cfg = {
65af8dea
WYG
261 .name = "Intel(R) Centrino(R) Wireless-N 130 BGN",
262 IWL_DEVICE_6030,
263 .ht_params = &iwl6000_ht_params,
264 .rx_with_siso_diversity = true,
265};
266
706c4ff6 267const struct iwl_cfg iwl130_bg_cfg = {
65af8dea
WYG
268 .name = "Intel(R) Centrino(R) Wireless-N 130 BG",
269 IWL_DEVICE_6030,
270 .rx_with_siso_diversity = true,
1808972f
SZ
271};
272
95b13014
SZ
273/*
274 * "i": Internal configuration, use internal Power Amplifier
275 */
65af8dea
WYG
276#define IWL_DEVICE_6000i \
277 .fw_name_pre = IWL6000_FW_PRE, \
278 .ucode_api_max = IWL6000_UCODE_API_MAX, \
b9148115 279 .ucode_api_ok = IWL6000_UCODE_API_OK, \
65af8dea 280 .ucode_api_min = IWL6000_UCODE_API_MIN, \
2d771cb6 281 .device_family = IWL_DEVICE_FAMILY_6000i, \
dae66d0d
EG
282 .max_inst_size = IWL60_RTC_INST_SIZE, \
283 .max_data_size = IWL60_RTC_DATA_SIZE, \
65af8dea
WYG
284 .valid_tx_ant = ANT_BC, /* .cfg overwrite */ \
285 .valid_rx_ant = ANT_BC, /* .cfg overwrite */ \
b7998c8b
EL
286 .nvm_ver = EEPROM_6000_EEPROM_VERSION, \
287 .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION, \
65af8dea 288 .base_params = &iwl6000_base_params, \
26a7ca9a 289 .eeprom_params = &iwl6000_eeprom_params, \
65af8dea
WYG
290 .led_mode = IWL_LED_BLINK
291
706c4ff6 292const struct iwl_cfg iwl6000i_2agn_cfg = {
c11362c0 293 .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
65af8dea 294 IWL_DEVICE_6000i,
7cb1b088 295 .ht_params = &iwl6000_ht_params,
e1228374
JS
296};
297
706c4ff6 298const struct iwl_cfg iwl6000i_2abg_cfg = {
c11362c0 299 .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
65af8dea 300 IWL_DEVICE_6000i,
5953a62e
WYG
301};
302
706c4ff6 303const struct iwl_cfg iwl6000i_2bg_cfg = {
c11362c0 304 .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
65af8dea
WYG
305 IWL_DEVICE_6000i,
306};
307
308#define IWL_DEVICE_6050 \
309 .fw_name_pre = IWL6050_FW_PRE, \
310 .ucode_api_max = IWL6050_UCODE_API_MAX, \
311 .ucode_api_min = IWL6050_UCODE_API_MIN, \
2d771cb6 312 .device_family = IWL_DEVICE_FAMILY_6050, \
dae66d0d
EG
313 .max_inst_size = IWL60_RTC_INST_SIZE, \
314 .max_data_size = IWL60_RTC_DATA_SIZE, \
ff458edc
WYG
315 .valid_tx_ant = ANT_AB, /* .cfg overwrite */ \
316 .valid_rx_ant = ANT_AB, /* .cfg overwrite */ \
b7998c8b
EL
317 .nvm_ver = EEPROM_6050_EEPROM_VERSION, \
318 .nvm_calib_ver = EEPROM_6050_TX_POWER_VERSION, \
65af8dea 319 .base_params = &iwl6050_base_params, \
26a7ca9a 320 .eeprom_params = &iwl6000_eeprom_params, \
65af8dea
WYG
321 .led_mode = IWL_LED_BLINK, \
322 .internal_wimax_coex = true
5953a62e 323
706c4ff6 324const struct iwl_cfg iwl6050_2agn_cfg = {
c11362c0 325 .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
65af8dea 326 IWL_DEVICE_6050,
7cb1b088 327 .ht_params = &iwl6000_ht_params,
65af8dea
WYG
328};
329
706c4ff6 330const struct iwl_cfg iwl6050_2abg_cfg = {
65af8dea
WYG
331 .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG",
332 IWL_DEVICE_6050,
03264339
SZ
333};
334
1144181c
WYG
335#define IWL_DEVICE_6150 \
336 .fw_name_pre = IWL6050_FW_PRE, \
337 .ucode_api_max = IWL6050_UCODE_API_MAX, \
338 .ucode_api_min = IWL6050_UCODE_API_MIN, \
2d771cb6 339 .device_family = IWL_DEVICE_FAMILY_6150, \
dae66d0d
EG
340 .max_inst_size = IWL60_RTC_INST_SIZE, \
341 .max_data_size = IWL60_RTC_DATA_SIZE, \
b7998c8b
EL
342 .nvm_ver = EEPROM_6150_EEPROM_VERSION, \
343 .nvm_calib_ver = EEPROM_6150_TX_POWER_VERSION, \
1144181c 344 .base_params = &iwl6050_base_params, \
26a7ca9a 345 .eeprom_params = &iwl6000_eeprom_params, \
1144181c
WYG
346 .led_mode = IWL_LED_BLINK, \
347 .internal_wimax_coex = true
348
706c4ff6 349const struct iwl_cfg iwl6150_bgn_cfg = {
f9dc6467 350 .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN",
1144181c 351 IWL_DEVICE_6150,
7cb1b088 352 .ht_params = &iwl6000_ht_params,
1144181c
WYG
353};
354
706c4ff6 355const struct iwl_cfg iwl6150_bg_cfg = {
1144181c
WYG
356 .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BG",
357 IWL_DEVICE_6150,
e1228374
JS
358};
359
706c4ff6 360const struct iwl_cfg iwl6000_3agn_cfg = {
c11362c0 361 .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
e1228374
JS
362 .fw_name_pre = IWL6000_FW_PRE,
363 .ucode_api_max = IWL6000_UCODE_API_MAX,
b9148115 364 .ucode_api_ok = IWL6000_UCODE_API_OK,
e1228374 365 .ucode_api_min = IWL6000_UCODE_API_MIN,
2d771cb6 366 .device_family = IWL_DEVICE_FAMILY_6000,
dae66d0d
EG
367 .max_inst_size = IWL60_RTC_INST_SIZE,
368 .max_data_size = IWL60_RTC_DATA_SIZE,
b7998c8b
EL
369 .nvm_ver = EEPROM_6000_EEPROM_VERSION,
370 .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION,
7cb1b088 371 .base_params = &iwl6000_base_params,
26a7ca9a 372 .eeprom_params = &iwl6000_eeprom_params,
7cb1b088 373 .ht_params = &iwl6000_ht_params,
564b344c 374 .led_mode = IWL_LED_BLINK,
e1228374
JS
375};
376
b9148115 377MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_OK));
78cbcf2b
MV
378MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_OK));
379MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_OK));
380MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2B_UCODE_API_OK));
This page took 0.705897 seconds and 5 git commands to generate.