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