]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/net/wireless/iwlwifi/iwl-6000.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[karo-tx-linux.git] / drivers / net / wireless / iwlwifi / iwl-6000.c
1 /******************************************************************************
2  *
3  * Copyright(c) 2008 - 2010 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/kernel.h>
28 #include <linux/module.h>
29 #include <linux/init.h>
30 #include <linux/pci.h>
31 #include <linux/dma-mapping.h>
32 #include <linux/delay.h>
33 #include <linux/skbuff.h>
34 #include <linux/netdevice.h>
35 #include <linux/wireless.h>
36 #include <net/mac80211.h>
37 #include <linux/etherdevice.h>
38 #include <asm/unaligned.h>
39
40 #include "iwl-eeprom.h"
41 #include "iwl-dev.h"
42 #include "iwl-core.h"
43 #include "iwl-io.h"
44 #include "iwl-sta.h"
45 #include "iwl-agn.h"
46 #include "iwl-helpers.h"
47 #include "iwl-agn-hw.h"
48 #include "iwl-6000-hw.h"
49 #include "iwl-agn-led.h"
50 #include "iwl-agn-debugfs.h"
51
52 /* Highest firmware API version supported */
53 #define IWL6000_UCODE_API_MAX 4
54 #define IWL6050_UCODE_API_MAX 4
55 #define IWL6000G2_UCODE_API_MAX 4
56
57 /* Lowest firmware API version supported */
58 #define IWL6000_UCODE_API_MIN 4
59 #define IWL6050_UCODE_API_MIN 4
60 #define IWL6000G2_UCODE_API_MIN 4
61
62 #define IWL6000_FW_PRE "iwlwifi-6000-"
63 #define _IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE #api ".ucode"
64 #define IWL6000_MODULE_FIRMWARE(api) _IWL6000_MODULE_FIRMWARE(api)
65
66 #define IWL6050_FW_PRE "iwlwifi-6050-"
67 #define _IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE #api ".ucode"
68 #define IWL6050_MODULE_FIRMWARE(api) _IWL6050_MODULE_FIRMWARE(api)
69
70 #define IWL6000G2A_FW_PRE "iwlwifi-6000g2a-"
71 #define _IWL6000G2A_MODULE_FIRMWARE(api) IWL6000G2A_FW_PRE #api ".ucode"
72 #define IWL6000G2A_MODULE_FIRMWARE(api) _IWL6000G2A_MODULE_FIRMWARE(api)
73
74 #define IWL6000G2B_FW_PRE "iwlwifi-6000g2b-"
75 #define _IWL6000G2B_MODULE_FIRMWARE(api) IWL6000G2B_FW_PRE #api ".ucode"
76 #define IWL6000G2B_MODULE_FIRMWARE(api) _IWL6000G2B_MODULE_FIRMWARE(api)
77
78
79 static void iwl6000_set_ct_threshold(struct iwl_priv *priv)
80 {
81         /* want Celsius */
82         priv->hw_params.ct_kill_threshold = CT_KILL_THRESHOLD;
83         priv->hw_params.ct_kill_exit_threshold = CT_KILL_EXIT_THRESHOLD;
84 }
85
86 /* Indicate calibration version to uCode. */
87 static void iwl6000_set_calib_version(struct iwl_priv *priv)
88 {
89         if (priv->cfg->need_dc_calib &&
90             (priv->cfg->ops->lib->eeprom_ops.calib_version(priv) >= 6))
91                 iwl_set_bit(priv, CSR_GP_DRIVER_REG,
92                                 CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6);
93 }
94
95 /* NIC configuration for 6000 series */
96 static void iwl6000_nic_config(struct iwl_priv *priv)
97 {
98         u16 radio_cfg;
99
100         radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG);
101
102         /* write radio config values to register */
103         if (EEPROM_RF_CFG_TYPE_MSK(radio_cfg) <= EEPROM_RF_CONFIG_TYPE_MAX)
104                 iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
105                             EEPROM_RF_CFG_TYPE_MSK(radio_cfg) |
106                             EEPROM_RF_CFG_STEP_MSK(radio_cfg) |
107                             EEPROM_RF_CFG_DASH_MSK(radio_cfg));
108
109         /* set CSR_HW_CONFIG_REG for uCode use */
110         iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
111                     CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI |
112                     CSR_HW_IF_CONFIG_REG_BIT_MAC_SI);
113
114         /* no locking required for register write */
115         if (priv->cfg->pa_type == IWL_PA_INTERNAL) {
116                 /* 2x2 IPA phy type */
117                 iwl_write32(priv, CSR_GP_DRIVER_REG,
118                              CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_IPA);
119         }
120         /* else do nothing, uCode configured */
121         if (priv->cfg->ops->lib->temp_ops.set_calib_version)
122                 priv->cfg->ops->lib->temp_ops.set_calib_version(priv);
123 }
124
125 static struct iwl_sensitivity_ranges iwl6000_sensitivity = {
126         .min_nrg_cck = 97,
127         .max_nrg_cck = 0, /* not used, set to 0 */
128         .auto_corr_min_ofdm = 80,
129         .auto_corr_min_ofdm_mrc = 128,
130         .auto_corr_min_ofdm_x1 = 105,
131         .auto_corr_min_ofdm_mrc_x1 = 192,
132
133         .auto_corr_max_ofdm = 145,
134         .auto_corr_max_ofdm_mrc = 232,
135         .auto_corr_max_ofdm_x1 = 110,
136         .auto_corr_max_ofdm_mrc_x1 = 232,
137
138         .auto_corr_min_cck = 125,
139         .auto_corr_max_cck = 175,
140         .auto_corr_min_cck_mrc = 160,
141         .auto_corr_max_cck_mrc = 310,
142         .nrg_th_cck = 97,
143         .nrg_th_ofdm = 100,
144
145         .barker_corr_th_min = 190,
146         .barker_corr_th_min_mrc = 390,
147         .nrg_th_cca = 62,
148 };
149
150 static int iwl6000_hw_set_hw_params(struct iwl_priv *priv)
151 {
152         if (priv->cfg->mod_params->num_of_queues >= IWL_MIN_NUM_QUEUES &&
153             priv->cfg->mod_params->num_of_queues <= IWLAGN_NUM_QUEUES)
154                 priv->cfg->num_of_queues =
155                         priv->cfg->mod_params->num_of_queues;
156
157         priv->hw_params.max_txq_num = priv->cfg->num_of_queues;
158         priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM;
159         priv->hw_params.scd_bc_tbls_size =
160                         priv->cfg->num_of_queues *
161                         sizeof(struct iwlagn_scd_bc_tbl);
162         priv->hw_params.tfd_size = sizeof(struct iwl_tfd);
163         priv->hw_params.max_stations = IWL5000_STATION_COUNT;
164         priv->hw_params.bcast_sta_id = IWL5000_BROADCAST_ID;
165
166         priv->hw_params.max_data_size = IWL60_RTC_DATA_SIZE;
167         priv->hw_params.max_inst_size = IWL60_RTC_INST_SIZE;
168
169         priv->hw_params.max_bsm_size = 0;
170         priv->hw_params.ht40_channel =  BIT(IEEE80211_BAND_2GHZ) |
171                                         BIT(IEEE80211_BAND_5GHZ);
172         priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
173
174         priv->hw_params.tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant);
175         priv->hw_params.rx_chains_num = num_of_ant(priv->cfg->valid_rx_ant);
176         priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
177         priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
178
179         if (priv->cfg->ops->lib->temp_ops.set_ct_kill)
180                 priv->cfg->ops->lib->temp_ops.set_ct_kill(priv);
181
182         /* Set initial sensitivity parameters */
183         /* Set initial calibration set */
184         priv->hw_params.sens = &iwl6000_sensitivity;
185         priv->hw_params.calib_init_cfg =
186                 BIT(IWL_CALIB_XTAL)             |
187                 BIT(IWL_CALIB_LO)               |
188                 BIT(IWL_CALIB_TX_IQ)            |
189                 BIT(IWL_CALIB_BASE_BAND);
190         if (priv->cfg->need_dc_calib)
191                 priv->hw_params.calib_init_cfg |= BIT(IWL_CALIB_DC);
192
193         priv->hw_params.beacon_time_tsf_bits = IWLAGN_EXT_BEACON_TIME_POS;
194
195         return 0;
196 }
197
198 static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
199                                      struct ieee80211_channel_switch *ch_switch)
200 {
201         struct iwl6000_channel_switch_cmd cmd;
202         const struct iwl_channel_info *ch_info;
203         u32 switch_time_in_usec, ucode_switch_time;
204         u16 ch;
205         u32 tsf_low;
206         u8 switch_count;
207         u16 beacon_interval = le16_to_cpu(priv->rxon_timing.beacon_interval);
208         struct ieee80211_vif *vif = priv->vif;
209         struct iwl_host_cmd hcmd = {
210                 .id = REPLY_CHANNEL_SWITCH,
211                 .len = sizeof(cmd),
212                 .flags = CMD_SYNC,
213                 .data = &cmd,
214         };
215
216         cmd.band = priv->band == IEEE80211_BAND_2GHZ;
217         ch = ieee80211_frequency_to_channel(ch_switch->channel->center_freq);
218         IWL_DEBUG_11H(priv, "channel switch from %u to %u\n",
219                       priv->active_rxon.channel, ch);
220         cmd.channel = cpu_to_le16(ch);
221         cmd.rxon_flags = priv->staging_rxon.flags;
222         cmd.rxon_filter_flags = priv->staging_rxon.filter_flags;
223         switch_count = ch_switch->count;
224         tsf_low = ch_switch->timestamp & 0x0ffffffff;
225         /*
226          * calculate the ucode channel switch time
227          * adding TSF as one of the factor for when to switch
228          */
229         if ((priv->ucode_beacon_time > tsf_low) && beacon_interval) {
230                 if (switch_count > ((priv->ucode_beacon_time - tsf_low) /
231                     beacon_interval)) {
232                         switch_count -= (priv->ucode_beacon_time -
233                                 tsf_low) / beacon_interval;
234                 } else
235                         switch_count = 0;
236         }
237         if (switch_count <= 1)
238                 cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time);
239         else {
240                 switch_time_in_usec =
241                         vif->bss_conf.beacon_int * switch_count * TIME_UNIT;
242                 ucode_switch_time = iwl_usecs_to_beacons(priv,
243                                                          switch_time_in_usec,
244                                                          beacon_interval);
245                 cmd.switch_time = iwl_add_beacon_time(priv,
246                                                       priv->ucode_beacon_time,
247                                                       ucode_switch_time,
248                                                       beacon_interval);
249         }
250         IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n",
251                       cmd.switch_time);
252         ch_info = iwl_get_channel_info(priv, priv->band, ch);
253         if (ch_info)
254                 cmd.expect_beacon = is_channel_radar(ch_info);
255         else {
256                 IWL_ERR(priv, "invalid channel switch from %u to %u\n",
257                         priv->active_rxon.channel, ch);
258                 return -EFAULT;
259         }
260         priv->switch_rxon.channel = cmd.channel;
261         priv->switch_rxon.switch_in_progress = true;
262
263         return iwl_send_cmd_sync(priv, &hcmd);
264 }
265
266 static struct iwl_lib_ops iwl6000_lib = {
267         .set_hw_params = iwl6000_hw_set_hw_params,
268         .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
269         .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
270         .txq_set_sched = iwlagn_txq_set_sched,
271         .txq_agg_enable = iwlagn_txq_agg_enable,
272         .txq_agg_disable = iwlagn_txq_agg_disable,
273         .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
274         .txq_free_tfd = iwl_hw_txq_free_tfd,
275         .txq_init = iwl_hw_tx_queue_init,
276         .rx_handler_setup = iwlagn_rx_handler_setup,
277         .setup_deferred_work = iwlagn_setup_deferred_work,
278         .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
279         .load_ucode = iwlagn_load_ucode,
280         .dump_nic_event_log = iwl_dump_nic_event_log,
281         .dump_nic_error_log = iwl_dump_nic_error_log,
282         .dump_csr = iwl_dump_csr,
283         .dump_fh = iwl_dump_fh,
284         .init_alive_start = iwlagn_init_alive_start,
285         .alive_notify = iwlagn_alive_notify,
286         .send_tx_power = iwlagn_send_tx_power,
287         .update_chain_flags = iwl_update_chain_flags,
288         .set_channel_switch = iwl6000_hw_channel_switch,
289         .apm_ops = {
290                 .init = iwl_apm_init,
291                 .stop = iwl_apm_stop,
292                 .config = iwl6000_nic_config,
293                 .set_pwr_src = iwl_set_pwr_src,
294         },
295         .eeprom_ops = {
296                 .regulatory_bands = {
297                         EEPROM_REG_BAND_1_CHANNELS,
298                         EEPROM_REG_BAND_2_CHANNELS,
299                         EEPROM_REG_BAND_3_CHANNELS,
300                         EEPROM_REG_BAND_4_CHANNELS,
301                         EEPROM_REG_BAND_5_CHANNELS,
302                         EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
303                         EEPROM_REG_BAND_52_HT40_CHANNELS
304                 },
305                 .verify_signature  = iwlcore_eeprom_verify_signature,
306                 .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
307                 .release_semaphore = iwlcore_eeprom_release_semaphore,
308                 .calib_version  = iwlagn_eeprom_calib_version,
309                 .query_addr = iwlagn_eeprom_query_addr,
310                 .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower,
311         },
312         .post_associate = iwl_post_associate,
313         .isr = iwl_isr_ict,
314         .config_ap = iwl_config_ap,
315         .temp_ops = {
316                 .temperature = iwlagn_temperature,
317                 .set_ct_kill = iwl6000_set_ct_threshold,
318                 .set_calib_version = iwl6000_set_calib_version,
319          },
320         .manage_ibss_station = iwlagn_manage_ibss_station,
321         .update_bcast_station = iwl_update_bcast_station,
322         .debugfs_ops = {
323                 .rx_stats_read = iwl_ucode_rx_stats_read,
324                 .tx_stats_read = iwl_ucode_tx_stats_read,
325                 .general_stats_read = iwl_ucode_general_stats_read,
326         },
327         .recover_from_tx_stall = iwl_bg_monitor_recover,
328         .check_plcp_health = iwl_good_plcp_health,
329         .check_ack_health = iwl_good_ack_health,
330 };
331
332 static const struct iwl_ops iwl6000_ops = {
333         .lib = &iwl6000_lib,
334         .hcmd = &iwlagn_hcmd,
335         .utils = &iwlagn_hcmd_utils,
336         .led = &iwlagn_led_ops,
337 };
338
339 static void do_not_send_bt_config(struct iwl_priv *priv)
340 {
341 }
342
343 static struct iwl_hcmd_ops iwl6000g2b_hcmd = {
344         .rxon_assoc = iwlagn_send_rxon_assoc,
345         .commit_rxon = iwl_commit_rxon,
346         .set_rxon_chain = iwl_set_rxon_chain,
347         .set_tx_ant = iwlagn_send_tx_ant_config,
348         .send_bt_config = do_not_send_bt_config,
349 };
350
351 static const struct iwl_ops iwl6000g2b_ops = {
352         .lib = &iwl6000_lib,
353         .hcmd = &iwl6000g2b_hcmd,
354         .utils = &iwlagn_hcmd_utils,
355         .led = &iwlagn_led_ops,
356 };
357
358 struct iwl_cfg iwl6000g2a_2agn_cfg = {
359         .name = "6000 Series 2x2 AGN Gen2a",
360         .fw_name_pre = IWL6000G2A_FW_PRE,
361         .ucode_api_max = IWL6000G2_UCODE_API_MAX,
362         .ucode_api_min = IWL6000G2_UCODE_API_MIN,
363         .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
364         .ops = &iwl6000_ops,
365         .eeprom_size = OTP_LOW_IMAGE_SIZE,
366         .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
367         .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
368         .num_of_queues = IWLAGN_NUM_QUEUES,
369         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
370         .mod_params = &iwlagn_mod_params,
371         .valid_tx_ant = ANT_AB,
372         .valid_rx_ant = ANT_AB,
373         .pll_cfg_val = 0,
374         .set_l0s = true,
375         .use_bsm = false,
376         .pa_type = IWL_PA_SYSTEM,
377         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
378         .shadow_ram_support = true,
379         .ht_greenfield_support = true,
380         .led_compensation = 51,
381         .use_rts_for_ht = true, /* use rts/cts protection */
382         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
383         .supports_idle = true,
384         .adv_thermal_throttle = true,
385         .support_ct_kill_exit = true,
386         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
387         .chain_noise_scale = 1000,
388         .monitor_recover_period = IWL_MONITORING_PERIOD,
389         .max_event_log_size = 512,
390         .ucode_tracing = true,
391         .sensitivity_calib_by_driver = true,
392         .chain_noise_calib_by_driver = true,
393         .need_dc_calib = true,
394 };
395
396 struct iwl_cfg iwl6000g2a_2abg_cfg = {
397         .name = "6000 Series 2x2 ABG Gen2a",
398         .fw_name_pre = IWL6000G2A_FW_PRE,
399         .ucode_api_max = IWL6000G2_UCODE_API_MAX,
400         .ucode_api_min = IWL6000G2_UCODE_API_MIN,
401         .sku = IWL_SKU_A|IWL_SKU_G,
402         .ops = &iwl6000_ops,
403         .eeprom_size = OTP_LOW_IMAGE_SIZE,
404         .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
405         .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
406         .num_of_queues = IWLAGN_NUM_QUEUES,
407         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
408         .mod_params = &iwlagn_mod_params,
409         .valid_tx_ant = ANT_AB,
410         .valid_rx_ant = ANT_AB,
411         .pll_cfg_val = 0,
412         .set_l0s = true,
413         .use_bsm = false,
414         .pa_type = IWL_PA_SYSTEM,
415         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
416         .shadow_ram_support = true,
417         .led_compensation = 51,
418         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
419         .supports_idle = true,
420         .adv_thermal_throttle = true,
421         .support_ct_kill_exit = true,
422         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
423         .chain_noise_scale = 1000,
424         .monitor_recover_period = IWL_MONITORING_PERIOD,
425         .max_event_log_size = 512,
426         .sensitivity_calib_by_driver = true,
427         .chain_noise_calib_by_driver = true,
428         .need_dc_calib = true,
429 };
430
431 struct iwl_cfg iwl6000g2a_2bg_cfg = {
432         .name = "6000 Series 2x2 BG Gen2a",
433         .fw_name_pre = IWL6000G2A_FW_PRE,
434         .ucode_api_max = IWL6000G2_UCODE_API_MAX,
435         .ucode_api_min = IWL6000G2_UCODE_API_MIN,
436         .sku = IWL_SKU_G,
437         .ops = &iwl6000_ops,
438         .eeprom_size = OTP_LOW_IMAGE_SIZE,
439         .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
440         .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
441         .num_of_queues = IWLAGN_NUM_QUEUES,
442         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
443         .mod_params = &iwlagn_mod_params,
444         .valid_tx_ant = ANT_AB,
445         .valid_rx_ant = ANT_AB,
446         .pll_cfg_val = 0,
447         .set_l0s = true,
448         .use_bsm = false,
449         .pa_type = IWL_PA_SYSTEM,
450         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
451         .shadow_ram_support = true,
452         .led_compensation = 51,
453         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
454         .supports_idle = true,
455         .adv_thermal_throttle = true,
456         .support_ct_kill_exit = true,
457         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
458         .chain_noise_scale = 1000,
459         .monitor_recover_period = IWL_MONITORING_PERIOD,
460         .max_event_log_size = 512,
461         .sensitivity_calib_by_driver = true,
462         .chain_noise_calib_by_driver = true,
463         .need_dc_calib = true,
464 };
465
466 struct iwl_cfg iwl6000g2b_2agn_cfg = {
467         .name = "6000 Series 2x2 AGN Gen2b",
468         .fw_name_pre = IWL6000G2B_FW_PRE,
469         .ucode_api_max = IWL6000G2_UCODE_API_MAX,
470         .ucode_api_min = IWL6000G2_UCODE_API_MIN,
471         .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
472         .ops = &iwl6000g2b_ops,
473         .eeprom_size = OTP_LOW_IMAGE_SIZE,
474         .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
475         .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
476         .num_of_queues = IWLAGN_NUM_QUEUES,
477         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
478         .mod_params = &iwlagn_mod_params,
479         .valid_tx_ant = ANT_AB,
480         .valid_rx_ant = ANT_AB,
481         .pll_cfg_val = 0,
482         .set_l0s = true,
483         .use_bsm = false,
484         .pa_type = IWL_PA_SYSTEM,
485         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
486         .shadow_ram_support = true,
487         .ht_greenfield_support = true,
488         .led_compensation = 51,
489         .use_rts_for_ht = true, /* use rts/cts protection */
490         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
491         .supports_idle = true,
492         .adv_thermal_throttle = true,
493         .support_ct_kill_exit = true,
494         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
495         .chain_noise_scale = 1000,
496         .monitor_recover_period = IWL_MONITORING_PERIOD,
497         .max_event_log_size = 512,
498         .sensitivity_calib_by_driver = true,
499         .chain_noise_calib_by_driver = true,
500         .need_dc_calib = true,
501 };
502
503 struct iwl_cfg iwl6000g2b_2abg_cfg = {
504         .name = "6000 Series 2x2 ABG Gen2b",
505         .fw_name_pre = IWL6000G2B_FW_PRE,
506         .ucode_api_max = IWL6000G2_UCODE_API_MAX,
507         .ucode_api_min = IWL6000G2_UCODE_API_MIN,
508         .sku = IWL_SKU_A|IWL_SKU_G,
509         .ops = &iwl6000g2b_ops,
510         .eeprom_size = OTP_LOW_IMAGE_SIZE,
511         .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
512         .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
513         .num_of_queues = IWLAGN_NUM_QUEUES,
514         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
515         .mod_params = &iwlagn_mod_params,
516         .valid_tx_ant = ANT_AB,
517         .valid_rx_ant = ANT_AB,
518         .pll_cfg_val = 0,
519         .set_l0s = true,
520         .use_bsm = false,
521         .pa_type = IWL_PA_SYSTEM,
522         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
523         .shadow_ram_support = true,
524         .led_compensation = 51,
525         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
526         .supports_idle = true,
527         .adv_thermal_throttle = true,
528         .support_ct_kill_exit = true,
529         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
530         .chain_noise_scale = 1000,
531         .monitor_recover_period = IWL_MONITORING_PERIOD,
532         .max_event_log_size = 512,
533         .sensitivity_calib_by_driver = true,
534         .chain_noise_calib_by_driver = true,
535         .need_dc_calib = true,
536 };
537
538 struct iwl_cfg iwl6000g2b_2bgn_cfg = {
539         .name = "6000 Series 2x2 BGN Gen2b",
540         .fw_name_pre = IWL6000G2B_FW_PRE,
541         .ucode_api_max = IWL6000G2_UCODE_API_MAX,
542         .ucode_api_min = IWL6000G2_UCODE_API_MIN,
543         .sku = IWL_SKU_G|IWL_SKU_N,
544         .ops = &iwl6000g2b_ops,
545         .eeprom_size = OTP_LOW_IMAGE_SIZE,
546         .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
547         .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
548         .num_of_queues = IWLAGN_NUM_QUEUES,
549         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
550         .mod_params = &iwlagn_mod_params,
551         .valid_tx_ant = ANT_AB,
552         .valid_rx_ant = ANT_AB,
553         .pll_cfg_val = 0,
554         .set_l0s = true,
555         .use_bsm = false,
556         .pa_type = IWL_PA_SYSTEM,
557         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
558         .shadow_ram_support = true,
559         .ht_greenfield_support = true,
560         .led_compensation = 51,
561         .use_rts_for_ht = true, /* use rts/cts protection */
562         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
563         .supports_idle = true,
564         .adv_thermal_throttle = true,
565         .support_ct_kill_exit = true,
566         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
567         .chain_noise_scale = 1000,
568         .monitor_recover_period = IWL_MONITORING_PERIOD,
569         .max_event_log_size = 512,
570         .sensitivity_calib_by_driver = true,
571         .chain_noise_calib_by_driver = true,
572         .need_dc_calib = true,
573 };
574
575 struct iwl_cfg iwl6000g2b_2bg_cfg = {
576         .name = "6000 Series 2x2 BG Gen2b",
577         .fw_name_pre = IWL6000G2B_FW_PRE,
578         .ucode_api_max = IWL6000G2_UCODE_API_MAX,
579         .ucode_api_min = IWL6000G2_UCODE_API_MIN,
580         .sku = IWL_SKU_G,
581         .ops = &iwl6000g2b_ops,
582         .eeprom_size = OTP_LOW_IMAGE_SIZE,
583         .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
584         .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
585         .num_of_queues = IWLAGN_NUM_QUEUES,
586         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
587         .mod_params = &iwlagn_mod_params,
588         .valid_tx_ant = ANT_AB,
589         .valid_rx_ant = ANT_AB,
590         .pll_cfg_val = 0,
591         .set_l0s = true,
592         .use_bsm = false,
593         .pa_type = IWL_PA_SYSTEM,
594         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
595         .shadow_ram_support = true,
596         .led_compensation = 51,
597         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
598         .supports_idle = true,
599         .adv_thermal_throttle = true,
600         .support_ct_kill_exit = true,
601         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
602         .chain_noise_scale = 1000,
603         .monitor_recover_period = IWL_MONITORING_PERIOD,
604         .max_event_log_size = 512,
605         .sensitivity_calib_by_driver = true,
606         .chain_noise_calib_by_driver = true,
607         .need_dc_calib = true,
608 };
609
610 struct iwl_cfg iwl6000g2b_bgn_cfg = {
611         .name = "6000 Series 1x2 BGN Gen2b",
612         .fw_name_pre = IWL6000G2B_FW_PRE,
613         .ucode_api_max = IWL6000G2_UCODE_API_MAX,
614         .ucode_api_min = IWL6000G2_UCODE_API_MIN,
615         .sku = IWL_SKU_G|IWL_SKU_N,
616         .ops = &iwl6000g2b_ops,
617         .eeprom_size = OTP_LOW_IMAGE_SIZE,
618         .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
619         .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
620         .num_of_queues = IWLAGN_NUM_QUEUES,
621         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
622         .mod_params = &iwlagn_mod_params,
623         .valid_tx_ant = ANT_A,
624         .valid_rx_ant = ANT_AB,
625         .pll_cfg_val = 0,
626         .set_l0s = true,
627         .use_bsm = false,
628         .pa_type = IWL_PA_SYSTEM,
629         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
630         .shadow_ram_support = true,
631         .ht_greenfield_support = true,
632         .led_compensation = 51,
633         .use_rts_for_ht = true, /* use rts/cts protection */
634         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
635         .supports_idle = true,
636         .adv_thermal_throttle = true,
637         .support_ct_kill_exit = true,
638         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
639         .chain_noise_scale = 1000,
640         .monitor_recover_period = IWL_MONITORING_PERIOD,
641         .max_event_log_size = 512,
642         .sensitivity_calib_by_driver = true,
643         .chain_noise_calib_by_driver = true,
644         .need_dc_calib = true,
645 };
646
647 struct iwl_cfg iwl6000g2b_bg_cfg = {
648         .name = "6000 Series 1x2 BG Gen2b",
649         .fw_name_pre = IWL6000G2B_FW_PRE,
650         .ucode_api_max = IWL6000G2_UCODE_API_MAX,
651         .ucode_api_min = IWL6000G2_UCODE_API_MIN,
652         .sku = IWL_SKU_G,
653         .ops = &iwl6000g2b_ops,
654         .eeprom_size = OTP_LOW_IMAGE_SIZE,
655         .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
656         .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
657         .num_of_queues = IWLAGN_NUM_QUEUES,
658         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
659         .mod_params = &iwlagn_mod_params,
660         .valid_tx_ant = ANT_A,
661         .valid_rx_ant = ANT_AB,
662         .pll_cfg_val = 0,
663         .set_l0s = true,
664         .use_bsm = false,
665         .pa_type = IWL_PA_SYSTEM,
666         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
667         .shadow_ram_support = true,
668         .led_compensation = 51,
669         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
670         .supports_idle = true,
671         .adv_thermal_throttle = true,
672         .support_ct_kill_exit = true,
673         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
674         .chain_noise_scale = 1000,
675         .monitor_recover_period = IWL_MONITORING_PERIOD,
676         .max_event_log_size = 512,
677         .sensitivity_calib_by_driver = true,
678         .chain_noise_calib_by_driver = true,
679         .need_dc_calib = true,
680 };
681
682 /*
683  * "i": Internal configuration, use internal Power Amplifier
684  */
685 struct iwl_cfg iwl6000i_2agn_cfg = {
686         .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
687         .fw_name_pre = IWL6000_FW_PRE,
688         .ucode_api_max = IWL6000_UCODE_API_MAX,
689         .ucode_api_min = IWL6000_UCODE_API_MIN,
690         .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
691         .ops = &iwl6000_ops,
692         .eeprom_size = OTP_LOW_IMAGE_SIZE,
693         .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
694         .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
695         .num_of_queues = IWLAGN_NUM_QUEUES,
696         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
697         .mod_params = &iwlagn_mod_params,
698         .valid_tx_ant = ANT_BC,
699         .valid_rx_ant = ANT_BC,
700         .pll_cfg_val = 0,
701         .set_l0s = true,
702         .use_bsm = false,
703         .pa_type = IWL_PA_INTERNAL,
704         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
705         .shadow_ram_support = true,
706         .ht_greenfield_support = true,
707         .led_compensation = 51,
708         .use_rts_for_ht = true, /* use rts/cts protection */
709         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
710         .supports_idle = true,
711         .adv_thermal_throttle = true,
712         .support_ct_kill_exit = true,
713         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
714         .chain_noise_scale = 1000,
715         .monitor_recover_period = IWL_MONITORING_PERIOD,
716         .max_event_log_size = 1024,
717         .ucode_tracing = true,
718         .sensitivity_calib_by_driver = true,
719         .chain_noise_calib_by_driver = true,
720 };
721
722 struct iwl_cfg iwl6000i_2abg_cfg = {
723         .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
724         .fw_name_pre = IWL6000_FW_PRE,
725         .ucode_api_max = IWL6000_UCODE_API_MAX,
726         .ucode_api_min = IWL6000_UCODE_API_MIN,
727         .sku = IWL_SKU_A|IWL_SKU_G,
728         .ops = &iwl6000_ops,
729         .eeprom_size = OTP_LOW_IMAGE_SIZE,
730         .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
731         .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
732         .num_of_queues = IWLAGN_NUM_QUEUES,
733         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
734         .mod_params = &iwlagn_mod_params,
735         .valid_tx_ant = ANT_BC,
736         .valid_rx_ant = ANT_BC,
737         .pll_cfg_val = 0,
738         .set_l0s = true,
739         .use_bsm = false,
740         .pa_type = IWL_PA_INTERNAL,
741         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
742         .shadow_ram_support = true,
743         .led_compensation = 51,
744         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
745         .supports_idle = true,
746         .adv_thermal_throttle = true,
747         .support_ct_kill_exit = true,
748         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
749         .chain_noise_scale = 1000,
750         .monitor_recover_period = IWL_MONITORING_PERIOD,
751         .max_event_log_size = 1024,
752         .ucode_tracing = true,
753         .sensitivity_calib_by_driver = true,
754         .chain_noise_calib_by_driver = true,
755 };
756
757 struct iwl_cfg iwl6000i_2bg_cfg = {
758         .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
759         .fw_name_pre = IWL6000_FW_PRE,
760         .ucode_api_max = IWL6000_UCODE_API_MAX,
761         .ucode_api_min = IWL6000_UCODE_API_MIN,
762         .sku = IWL_SKU_G,
763         .ops = &iwl6000_ops,
764         .eeprom_size = OTP_LOW_IMAGE_SIZE,
765         .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
766         .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
767         .num_of_queues = IWLAGN_NUM_QUEUES,
768         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
769         .mod_params = &iwlagn_mod_params,
770         .valid_tx_ant = ANT_BC,
771         .valid_rx_ant = ANT_BC,
772         .pll_cfg_val = 0,
773         .set_l0s = true,
774         .use_bsm = false,
775         .pa_type = IWL_PA_INTERNAL,
776         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
777         .shadow_ram_support = true,
778         .led_compensation = 51,
779         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
780         .supports_idle = true,
781         .adv_thermal_throttle = true,
782         .support_ct_kill_exit = true,
783         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
784         .chain_noise_scale = 1000,
785         .monitor_recover_period = IWL_MONITORING_PERIOD,
786         .max_event_log_size = 1024,
787         .ucode_tracing = true,
788         .sensitivity_calib_by_driver = true,
789         .chain_noise_calib_by_driver = true,
790 };
791
792 struct iwl_cfg iwl6050_2agn_cfg = {
793         .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
794         .fw_name_pre = IWL6050_FW_PRE,
795         .ucode_api_max = IWL6050_UCODE_API_MAX,
796         .ucode_api_min = IWL6050_UCODE_API_MIN,
797         .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
798         .ops = &iwl6000_ops,
799         .eeprom_size = OTP_LOW_IMAGE_SIZE,
800         .eeprom_ver = EEPROM_6050_EEPROM_VERSION,
801         .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION,
802         .num_of_queues = IWLAGN_NUM_QUEUES,
803         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
804         .mod_params = &iwlagn_mod_params,
805         .valid_tx_ant = ANT_AB,
806         .valid_rx_ant = ANT_AB,
807         .pll_cfg_val = 0,
808         .set_l0s = true,
809         .use_bsm = false,
810         .pa_type = IWL_PA_SYSTEM,
811         .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
812         .shadow_ram_support = true,
813         .ht_greenfield_support = true,
814         .led_compensation = 51,
815         .use_rts_for_ht = true, /* use rts/cts protection */
816         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
817         .supports_idle = true,
818         .adv_thermal_throttle = true,
819         .support_ct_kill_exit = true,
820         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
821         .chain_noise_scale = 1500,
822         .monitor_recover_period = IWL_MONITORING_PERIOD,
823         .max_event_log_size = 1024,
824         .ucode_tracing = true,
825         .sensitivity_calib_by_driver = true,
826         .chain_noise_calib_by_driver = true,
827         .need_dc_calib = true,
828 };
829
830 struct iwl_cfg iwl6050_2abg_cfg = {
831         .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG",
832         .fw_name_pre = IWL6050_FW_PRE,
833         .ucode_api_max = IWL6050_UCODE_API_MAX,
834         .ucode_api_min = IWL6050_UCODE_API_MIN,
835         .sku = IWL_SKU_A|IWL_SKU_G,
836         .ops = &iwl6000_ops,
837         .eeprom_size = OTP_LOW_IMAGE_SIZE,
838         .eeprom_ver = EEPROM_6050_EEPROM_VERSION,
839         .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION,
840         .num_of_queues = IWLAGN_NUM_QUEUES,
841         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
842         .mod_params = &iwlagn_mod_params,
843         .valid_tx_ant = ANT_AB,
844         .valid_rx_ant = ANT_AB,
845         .pll_cfg_val = 0,
846         .set_l0s = true,
847         .use_bsm = false,
848         .pa_type = IWL_PA_SYSTEM,
849         .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
850         .shadow_ram_support = true,
851         .led_compensation = 51,
852         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
853         .supports_idle = true,
854         .adv_thermal_throttle = true,
855         .support_ct_kill_exit = true,
856         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
857         .chain_noise_scale = 1500,
858         .monitor_recover_period = IWL_MONITORING_PERIOD,
859         .max_event_log_size = 1024,
860         .ucode_tracing = true,
861         .sensitivity_calib_by_driver = true,
862         .chain_noise_calib_by_driver = true,
863         .need_dc_calib = true,
864 };
865
866 struct iwl_cfg iwl6000_3agn_cfg = {
867         .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
868         .fw_name_pre = IWL6000_FW_PRE,
869         .ucode_api_max = IWL6000_UCODE_API_MAX,
870         .ucode_api_min = IWL6000_UCODE_API_MIN,
871         .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
872         .ops = &iwl6000_ops,
873         .eeprom_size = OTP_LOW_IMAGE_SIZE,
874         .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
875         .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
876         .num_of_queues = IWLAGN_NUM_QUEUES,
877         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
878         .mod_params = &iwlagn_mod_params,
879         .valid_tx_ant = ANT_ABC,
880         .valid_rx_ant = ANT_ABC,
881         .pll_cfg_val = 0,
882         .set_l0s = true,
883         .use_bsm = false,
884         .pa_type = IWL_PA_SYSTEM,
885         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
886         .shadow_ram_support = true,
887         .ht_greenfield_support = true,
888         .led_compensation = 51,
889         .use_rts_for_ht = true, /* use rts/cts protection */
890         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
891         .supports_idle = true,
892         .adv_thermal_throttle = true,
893         .support_ct_kill_exit = true,
894         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
895         .chain_noise_scale = 1000,
896         .monitor_recover_period = IWL_MONITORING_PERIOD,
897         .max_event_log_size = 1024,
898         .ucode_tracing = true,
899         .sensitivity_calib_by_driver = true,
900         .chain_noise_calib_by_driver = true,
901 };
902
903 MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
904 MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
905 MODULE_FIRMWARE(IWL6000G2A_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
906 MODULE_FIRMWARE(IWL6000G2B_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));