]> Pileus Git - ~andy/linux/blob - drivers/net/wireless/iwlwifi/iwl-6000.c
Merge branch 'for-jens' of git://git.drbd.org/linux-drbd into for-3.6/drivers
[~andy/linux] / drivers / net / wireless / iwlwifi / iwl-6000.c
1 /******************************************************************************
2  *
3  * Copyright(c) 2008 - 2012 Intel Corporation. All rights reserved.
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
27 #include <linux/module.h>
28 #include <linux/stringify.h>
29 #include "iwl-config.h"
30 #include "iwl-cfg.h"
31 #include "iwl-agn-hw.h"
32 #include "iwl-commands.h" /* needed for BT for now */
33
34 /* Highest firmware API version supported */
35 #define IWL6000_UCODE_API_MAX 6
36 #define IWL6050_UCODE_API_MAX 5
37 #define IWL6000G2_UCODE_API_MAX 6
38 #define IWL6035_UCODE_API_MAX 6
39
40 /* Oldest version we won't warn about */
41 #define IWL6000_UCODE_API_OK 4
42 #define IWL6000G2_UCODE_API_OK 5
43 #define IWL6050_UCODE_API_OK 5
44 #define IWL6000G2B_UCODE_API_OK 6
45 #define IWL6035_UCODE_API_OK 6
46
47 /* Lowest firmware API version supported */
48 #define IWL6000_UCODE_API_MIN 4
49 #define IWL6050_UCODE_API_MIN 4
50 #define IWL6000G2_UCODE_API_MIN 5
51 #define IWL6035_UCODE_API_MIN 6
52
53 /* EEPROM versions */
54 #define EEPROM_6000_TX_POWER_VERSION    (4)
55 #define EEPROM_6000_EEPROM_VERSION      (0x423)
56 #define EEPROM_6050_TX_POWER_VERSION    (4)
57 #define EEPROM_6050_EEPROM_VERSION      (0x532)
58 #define EEPROM_6150_TX_POWER_VERSION    (6)
59 #define EEPROM_6150_EEPROM_VERSION      (0x553)
60 #define EEPROM_6005_TX_POWER_VERSION    (6)
61 #define EEPROM_6005_EEPROM_VERSION      (0x709)
62 #define EEPROM_6030_TX_POWER_VERSION    (6)
63 #define EEPROM_6030_EEPROM_VERSION      (0x709)
64 #define EEPROM_6035_TX_POWER_VERSION    (6)
65 #define EEPROM_6035_EEPROM_VERSION      (0x753)
66
67 #define IWL6000_FW_PRE "iwlwifi-6000-"
68 #define IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE __stringify(api) ".ucode"
69
70 #define IWL6050_FW_PRE "iwlwifi-6050-"
71 #define IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE __stringify(api) ".ucode"
72
73 #define IWL6005_FW_PRE "iwlwifi-6000g2a-"
74 #define IWL6005_MODULE_FIRMWARE(api) IWL6005_FW_PRE __stringify(api) ".ucode"
75
76 #define IWL6030_FW_PRE "iwlwifi-6000g2b-"
77 #define IWL6030_MODULE_FIRMWARE(api) IWL6030_FW_PRE __stringify(api) ".ucode"
78
79 static const struct iwl_base_params iwl6000_base_params = {
80         .eeprom_size = OTP_LOW_IMAGE_SIZE,
81         .num_of_queues = IWLAGN_NUM_QUEUES,
82         .pll_cfg_val = 0,
83         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
84         .shadow_ram_support = true,
85         .led_compensation = 51,
86         .adv_thermal_throttle = true,
87         .support_ct_kill_exit = true,
88         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
89         .chain_noise_scale = 1000,
90         .wd_timeout = IWL_DEF_WD_TIMEOUT,
91         .max_event_log_size = 512,
92         .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
93 };
94
95 static const struct iwl_base_params iwl6050_base_params = {
96         .eeprom_size = OTP_LOW_IMAGE_SIZE,
97         .num_of_queues = IWLAGN_NUM_QUEUES,
98         .pll_cfg_val = 0,
99         .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
100         .shadow_ram_support = true,
101         .led_compensation = 51,
102         .adv_thermal_throttle = true,
103         .support_ct_kill_exit = true,
104         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
105         .chain_noise_scale = 1500,
106         .wd_timeout = IWL_DEF_WD_TIMEOUT,
107         .max_event_log_size = 1024,
108         .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
109 };
110
111 static const struct iwl_base_params iwl6000_g2_base_params = {
112         .eeprom_size = OTP_LOW_IMAGE_SIZE,
113         .num_of_queues = IWLAGN_NUM_QUEUES,
114         .pll_cfg_val = 0,
115         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
116         .shadow_ram_support = true,
117         .led_compensation = 57,
118         .adv_thermal_throttle = true,
119         .support_ct_kill_exit = true,
120         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
121         .chain_noise_scale = 1000,
122         .wd_timeout = IWL_LONG_WD_TIMEOUT,
123         .max_event_log_size = 512,
124         .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
125 };
126
127 static const struct iwl_ht_params iwl6000_ht_params = {
128         .ht_greenfield_support = true,
129         .use_rts_for_aggregation = true, /* use rts/cts protection */
130 };
131
132 static const struct iwl_bt_params iwl6000_bt_params = {
133         /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
134         .advanced_bt_coexist = true,
135         .agg_time_limit = BT_AGG_THRESHOLD_DEF,
136         .bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE,
137         .bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT,
138         .bt_sco_disable = true,
139 };
140
141 #define IWL_DEVICE_6005                                         \
142         .fw_name_pre = IWL6005_FW_PRE,                          \
143         .ucode_api_max = IWL6000G2_UCODE_API_MAX,               \
144         .ucode_api_ok = IWL6000G2_UCODE_API_OK,                 \
145         .ucode_api_min = IWL6000G2_UCODE_API_MIN,               \
146         .device_family = IWL_DEVICE_FAMILY_6005,                \
147         .max_inst_size = IWL60_RTC_INST_SIZE,                   \
148         .max_data_size = IWL60_RTC_DATA_SIZE,                   \
149         .eeprom_ver = EEPROM_6005_EEPROM_VERSION,               \
150         .eeprom_calib_ver = EEPROM_6005_TX_POWER_VERSION,       \
151         .base_params = &iwl6000_g2_base_params,                 \
152         .need_temp_offset_calib = true,                         \
153         .led_mode = IWL_LED_RF_STATE
154
155 const struct iwl_cfg iwl6005_2agn_cfg = {
156         .name = "Intel(R) Centrino(R) Advanced-N 6205 AGN",
157         IWL_DEVICE_6005,
158         .ht_params = &iwl6000_ht_params,
159 };
160
161 const struct iwl_cfg iwl6005_2abg_cfg = {
162         .name = "Intel(R) Centrino(R) Advanced-N 6205 ABG",
163         IWL_DEVICE_6005,
164 };
165
166 const struct iwl_cfg iwl6005_2bg_cfg = {
167         .name = "Intel(R) Centrino(R) Advanced-N 6205 BG",
168         IWL_DEVICE_6005,
169 };
170
171 const struct iwl_cfg iwl6005_2agn_sff_cfg = {
172         .name = "Intel(R) Centrino(R) Advanced-N 6205S AGN",
173         IWL_DEVICE_6005,
174         .ht_params = &iwl6000_ht_params,
175 };
176
177 const struct iwl_cfg iwl6005_2agn_d_cfg = {
178         .name = "Intel(R) Centrino(R) Advanced-N 6205D AGN",
179         IWL_DEVICE_6005,
180         .ht_params = &iwl6000_ht_params,
181 };
182
183 const struct iwl_cfg iwl6005_2agn_mow1_cfg = {
184         .name = "Intel(R) Centrino(R) Advanced-N 6206 AGN",
185         IWL_DEVICE_6005,
186         .ht_params = &iwl6000_ht_params,
187 };
188
189 const struct iwl_cfg iwl6005_2agn_mow2_cfg = {
190         .name = "Intel(R) Centrino(R) Advanced-N 6207 AGN",
191         IWL_DEVICE_6005,
192         .ht_params = &iwl6000_ht_params,
193 };
194
195 #define IWL_DEVICE_6030                                         \
196         .fw_name_pre = IWL6030_FW_PRE,                          \
197         .ucode_api_max = IWL6000G2_UCODE_API_MAX,               \
198         .ucode_api_ok = IWL6000G2B_UCODE_API_OK,                \
199         .ucode_api_min = IWL6000G2_UCODE_API_MIN,               \
200         .device_family = IWL_DEVICE_FAMILY_6030,                \
201         .max_inst_size = IWL60_RTC_INST_SIZE,                   \
202         .max_data_size = IWL60_RTC_DATA_SIZE,                   \
203         .eeprom_ver = EEPROM_6030_EEPROM_VERSION,               \
204         .eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION,       \
205         .base_params = &iwl6000_g2_base_params,                 \
206         .bt_params = &iwl6000_bt_params,                        \
207         .need_temp_offset_calib = true,                         \
208         .led_mode = IWL_LED_RF_STATE,                           \
209         .adv_pm = true                                          \
210
211 const struct iwl_cfg iwl6030_2agn_cfg = {
212         .name = "Intel(R) Centrino(R) Advanced-N 6230 AGN",
213         IWL_DEVICE_6030,
214         .ht_params = &iwl6000_ht_params,
215 };
216
217 const struct iwl_cfg iwl6030_2abg_cfg = {
218         .name = "Intel(R) Centrino(R) Advanced-N 6230 ABG",
219         IWL_DEVICE_6030,
220 };
221
222 const struct iwl_cfg iwl6030_2bgn_cfg = {
223         .name = "Intel(R) Centrino(R) Advanced-N 6230 BGN",
224         IWL_DEVICE_6030,
225         .ht_params = &iwl6000_ht_params,
226 };
227
228 const struct iwl_cfg iwl6030_2bg_cfg = {
229         .name = "Intel(R) Centrino(R) Advanced-N 6230 BG",
230         IWL_DEVICE_6030,
231 };
232
233 #define IWL_DEVICE_6035                                         \
234         .fw_name_pre = IWL6030_FW_PRE,                          \
235         .ucode_api_max = IWL6035_UCODE_API_MAX,                 \
236         .ucode_api_ok = IWL6035_UCODE_API_OK,                   \
237         .ucode_api_min = IWL6035_UCODE_API_MIN,                 \
238         .device_family = IWL_DEVICE_FAMILY_6030,                \
239         .max_inst_size = IWL60_RTC_INST_SIZE,                   \
240         .max_data_size = IWL60_RTC_DATA_SIZE,                   \
241         .eeprom_ver = EEPROM_6030_EEPROM_VERSION,               \
242         .eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION,       \
243         .base_params = &iwl6000_g2_base_params,                 \
244         .bt_params = &iwl6000_bt_params,                        \
245         .need_temp_offset_calib = true,                         \
246         .led_mode = IWL_LED_RF_STATE,                           \
247         .adv_pm = true
248
249 const struct iwl_cfg iwl6035_2agn_cfg = {
250         .name = "Intel(R) Centrino(R) Advanced-N 6235 AGN",
251         IWL_DEVICE_6035,
252         .ht_params = &iwl6000_ht_params,
253 };
254
255 const struct iwl_cfg iwl1030_bgn_cfg = {
256         .name = "Intel(R) Centrino(R) Wireless-N 1030 BGN",
257         IWL_DEVICE_6030,
258         .ht_params = &iwl6000_ht_params,
259 };
260
261 const struct iwl_cfg iwl1030_bg_cfg = {
262         .name = "Intel(R) Centrino(R) Wireless-N 1030 BG",
263         IWL_DEVICE_6030,
264 };
265
266 const struct iwl_cfg iwl130_bgn_cfg = {
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
273 const struct iwl_cfg iwl130_bg_cfg = {
274         .name = "Intel(R) Centrino(R) Wireless-N 130 BG",
275         IWL_DEVICE_6030,
276         .rx_with_siso_diversity = true,
277 };
278
279 /*
280  * "i": Internal configuration, use internal Power Amplifier
281  */
282 #define IWL_DEVICE_6000i                                        \
283         .fw_name_pre = IWL6000_FW_PRE,                          \
284         .ucode_api_max = IWL6000_UCODE_API_MAX,                 \
285         .ucode_api_ok = IWL6000_UCODE_API_OK,                   \
286         .ucode_api_min = IWL6000_UCODE_API_MIN,                 \
287         .device_family = IWL_DEVICE_FAMILY_6000i,               \
288         .max_inst_size = IWL60_RTC_INST_SIZE,                   \
289         .max_data_size = IWL60_RTC_DATA_SIZE,                   \
290         .valid_tx_ant = ANT_BC,         /* .cfg overwrite */    \
291         .valid_rx_ant = ANT_BC,         /* .cfg overwrite */    \
292         .eeprom_ver = EEPROM_6000_EEPROM_VERSION,               \
293         .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,       \
294         .base_params = &iwl6000_base_params,                    \
295         .led_mode = IWL_LED_BLINK
296
297 const struct iwl_cfg iwl6000i_2agn_cfg = {
298         .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
299         IWL_DEVICE_6000i,
300         .ht_params = &iwl6000_ht_params,
301 };
302
303 const struct iwl_cfg iwl6000i_2abg_cfg = {
304         .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
305         IWL_DEVICE_6000i,
306 };
307
308 const struct iwl_cfg iwl6000i_2bg_cfg = {
309         .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
310         IWL_DEVICE_6000i,
311 };
312
313 #define IWL_DEVICE_6050                                         \
314         .fw_name_pre = IWL6050_FW_PRE,                          \
315         .ucode_api_max = IWL6050_UCODE_API_MAX,                 \
316         .ucode_api_min = IWL6050_UCODE_API_MIN,                 \
317         .device_family = IWL_DEVICE_FAMILY_6050,                \
318         .max_inst_size = IWL60_RTC_INST_SIZE,                   \
319         .max_data_size = IWL60_RTC_DATA_SIZE,                   \
320         .valid_tx_ant = ANT_AB,         /* .cfg overwrite */    \
321         .valid_rx_ant = ANT_AB,         /* .cfg overwrite */    \
322         .eeprom_ver = EEPROM_6050_EEPROM_VERSION,               \
323         .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION,       \
324         .base_params = &iwl6050_base_params,                    \
325         .led_mode = IWL_LED_BLINK,                              \
326         .internal_wimax_coex = true
327
328 const struct iwl_cfg iwl6050_2agn_cfg = {
329         .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
330         IWL_DEVICE_6050,
331         .ht_params = &iwl6000_ht_params,
332 };
333
334 const struct iwl_cfg iwl6050_2abg_cfg = {
335         .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG",
336         IWL_DEVICE_6050,
337 };
338
339 #define IWL_DEVICE_6150                                         \
340         .fw_name_pre = IWL6050_FW_PRE,                          \
341         .ucode_api_max = IWL6050_UCODE_API_MAX,                 \
342         .ucode_api_min = IWL6050_UCODE_API_MIN,                 \
343         .device_family = IWL_DEVICE_FAMILY_6150,                \
344         .max_inst_size = IWL60_RTC_INST_SIZE,                   \
345         .max_data_size = IWL60_RTC_DATA_SIZE,                   \
346         .eeprom_ver = EEPROM_6150_EEPROM_VERSION,               \
347         .eeprom_calib_ver = EEPROM_6150_TX_POWER_VERSION,       \
348         .base_params = &iwl6050_base_params,                    \
349         .led_mode = IWL_LED_BLINK,                              \
350         .internal_wimax_coex = true
351
352 const struct iwl_cfg iwl6150_bgn_cfg = {
353         .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN",
354         IWL_DEVICE_6150,
355         .ht_params = &iwl6000_ht_params,
356 };
357
358 const struct iwl_cfg iwl6150_bg_cfg = {
359         .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BG",
360         IWL_DEVICE_6150,
361 };
362
363 const struct iwl_cfg iwl6000_3agn_cfg = {
364         .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
365         .fw_name_pre = IWL6000_FW_PRE,
366         .ucode_api_max = IWL6000_UCODE_API_MAX,
367         .ucode_api_ok = IWL6000_UCODE_API_OK,
368         .ucode_api_min = IWL6000_UCODE_API_MIN,
369         .device_family = IWL_DEVICE_FAMILY_6000,
370         .max_inst_size = IWL60_RTC_INST_SIZE,
371         .max_data_size = IWL60_RTC_DATA_SIZE,
372         .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
373         .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
374         .base_params = &iwl6000_base_params,
375         .ht_params = &iwl6000_ht_params,
376         .led_mode = IWL_LED_BLINK,
377 };
378
379 MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_OK));
380 MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_OK));
381 MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_OK));
382 MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2B_UCODE_API_OK));