]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/net/wireless/iwlwifi/iwl-6000.c
iwlwifi: add support for device tx flush request
[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         .txfifo_flush = iwlagn_txfifo_flush,
331         .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
332 };
333
334 static const struct iwl_ops iwl6000_ops = {
335         .lib = &iwl6000_lib,
336         .hcmd = &iwlagn_hcmd,
337         .utils = &iwlagn_hcmd_utils,
338         .led = &iwlagn_led_ops,
339 };
340
341 static void do_not_send_bt_config(struct iwl_priv *priv)
342 {
343 }
344
345 static struct iwl_hcmd_ops iwl6000g2b_hcmd = {
346         .rxon_assoc = iwlagn_send_rxon_assoc,
347         .commit_rxon = iwl_commit_rxon,
348         .set_rxon_chain = iwl_set_rxon_chain,
349         .set_tx_ant = iwlagn_send_tx_ant_config,
350         .send_bt_config = do_not_send_bt_config,
351 };
352
353 static const struct iwl_ops iwl6000g2b_ops = {
354         .lib = &iwl6000_lib,
355         .hcmd = &iwl6000g2b_hcmd,
356         .utils = &iwlagn_hcmd_utils,
357         .led = &iwlagn_led_ops,
358 };
359
360 struct iwl_cfg iwl6000g2a_2agn_cfg = {
361         .name = "6000 Series 2x2 AGN Gen2a",
362         .fw_name_pre = IWL6000G2A_FW_PRE,
363         .ucode_api_max = IWL6000G2_UCODE_API_MAX,
364         .ucode_api_min = IWL6000G2_UCODE_API_MIN,
365         .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
366         .ops = &iwl6000_ops,
367         .eeprom_size = OTP_LOW_IMAGE_SIZE,
368         .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
369         .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
370         .num_of_queues = IWLAGN_NUM_QUEUES,
371         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
372         .mod_params = &iwlagn_mod_params,
373         .valid_tx_ant = ANT_AB,
374         .valid_rx_ant = ANT_AB,
375         .pll_cfg_val = 0,
376         .set_l0s = true,
377         .use_bsm = false,
378         .pa_type = IWL_PA_SYSTEM,
379         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
380         .shadow_ram_support = true,
381         .ht_greenfield_support = true,
382         .led_compensation = 51,
383         .use_rts_for_ht = true, /* use rts/cts protection */
384         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
385         .supports_idle = true,
386         .adv_thermal_throttle = true,
387         .support_ct_kill_exit = true,
388         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
389         .chain_noise_scale = 1000,
390         .monitor_recover_period = IWL_MONITORING_PERIOD,
391         .max_event_log_size = 512,
392         .ucode_tracing = true,
393         .sensitivity_calib_by_driver = true,
394         .chain_noise_calib_by_driver = true,
395         .need_dc_calib = true,
396 };
397
398 struct iwl_cfg iwl6000g2a_2abg_cfg = {
399         .name = "6000 Series 2x2 ABG Gen2a",
400         .fw_name_pre = IWL6000G2A_FW_PRE,
401         .ucode_api_max = IWL6000G2_UCODE_API_MAX,
402         .ucode_api_min = IWL6000G2_UCODE_API_MIN,
403         .sku = IWL_SKU_A|IWL_SKU_G,
404         .ops = &iwl6000_ops,
405         .eeprom_size = OTP_LOW_IMAGE_SIZE,
406         .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
407         .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
408         .num_of_queues = IWLAGN_NUM_QUEUES,
409         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
410         .mod_params = &iwlagn_mod_params,
411         .valid_tx_ant = ANT_AB,
412         .valid_rx_ant = ANT_AB,
413         .pll_cfg_val = 0,
414         .set_l0s = true,
415         .use_bsm = false,
416         .pa_type = IWL_PA_SYSTEM,
417         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
418         .shadow_ram_support = true,
419         .led_compensation = 51,
420         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
421         .supports_idle = true,
422         .adv_thermal_throttle = true,
423         .support_ct_kill_exit = true,
424         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
425         .chain_noise_scale = 1000,
426         .monitor_recover_period = IWL_MONITORING_PERIOD,
427         .max_event_log_size = 512,
428         .sensitivity_calib_by_driver = true,
429         .chain_noise_calib_by_driver = true,
430         .need_dc_calib = true,
431 };
432
433 struct iwl_cfg iwl6000g2a_2bg_cfg = {
434         .name = "6000 Series 2x2 BG Gen2a",
435         .fw_name_pre = IWL6000G2A_FW_PRE,
436         .ucode_api_max = IWL6000G2_UCODE_API_MAX,
437         .ucode_api_min = IWL6000G2_UCODE_API_MIN,
438         .sku = IWL_SKU_G,
439         .ops = &iwl6000_ops,
440         .eeprom_size = OTP_LOW_IMAGE_SIZE,
441         .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
442         .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
443         .num_of_queues = IWLAGN_NUM_QUEUES,
444         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
445         .mod_params = &iwlagn_mod_params,
446         .valid_tx_ant = ANT_AB,
447         .valid_rx_ant = ANT_AB,
448         .pll_cfg_val = 0,
449         .set_l0s = true,
450         .use_bsm = false,
451         .pa_type = IWL_PA_SYSTEM,
452         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
453         .shadow_ram_support = true,
454         .led_compensation = 51,
455         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
456         .supports_idle = true,
457         .adv_thermal_throttle = true,
458         .support_ct_kill_exit = true,
459         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
460         .chain_noise_scale = 1000,
461         .monitor_recover_period = IWL_MONITORING_PERIOD,
462         .max_event_log_size = 512,
463         .sensitivity_calib_by_driver = true,
464         .chain_noise_calib_by_driver = true,
465         .need_dc_calib = true,
466 };
467
468 struct iwl_cfg iwl6000g2b_2agn_cfg = {
469         .name = "6000 Series 2x2 AGN Gen2b",
470         .fw_name_pre = IWL6000G2B_FW_PRE,
471         .ucode_api_max = IWL6000G2_UCODE_API_MAX,
472         .ucode_api_min = IWL6000G2_UCODE_API_MIN,
473         .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
474         .ops = &iwl6000g2b_ops,
475         .eeprom_size = OTP_LOW_IMAGE_SIZE,
476         .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
477         .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
478         .num_of_queues = IWLAGN_NUM_QUEUES,
479         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
480         .mod_params = &iwlagn_mod_params,
481         .valid_tx_ant = ANT_AB,
482         .valid_rx_ant = ANT_AB,
483         .pll_cfg_val = 0,
484         .set_l0s = true,
485         .use_bsm = false,
486         .pa_type = IWL_PA_SYSTEM,
487         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
488         .shadow_ram_support = true,
489         .ht_greenfield_support = true,
490         .led_compensation = 51,
491         .use_rts_for_ht = true, /* use rts/cts protection */
492         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
493         .supports_idle = true,
494         .adv_thermal_throttle = true,
495         .support_ct_kill_exit = true,
496         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
497         .chain_noise_scale = 1000,
498         .monitor_recover_period = IWL_MONITORING_PERIOD,
499         .max_event_log_size = 512,
500         .sensitivity_calib_by_driver = true,
501         .chain_noise_calib_by_driver = true,
502         .need_dc_calib = true,
503 };
504
505 struct iwl_cfg iwl6000g2b_2abg_cfg = {
506         .name = "6000 Series 2x2 ABG Gen2b",
507         .fw_name_pre = IWL6000G2B_FW_PRE,
508         .ucode_api_max = IWL6000G2_UCODE_API_MAX,
509         .ucode_api_min = IWL6000G2_UCODE_API_MIN,
510         .sku = IWL_SKU_A|IWL_SKU_G,
511         .ops = &iwl6000g2b_ops,
512         .eeprom_size = OTP_LOW_IMAGE_SIZE,
513         .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
514         .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
515         .num_of_queues = IWLAGN_NUM_QUEUES,
516         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
517         .mod_params = &iwlagn_mod_params,
518         .valid_tx_ant = ANT_AB,
519         .valid_rx_ant = ANT_AB,
520         .pll_cfg_val = 0,
521         .set_l0s = true,
522         .use_bsm = false,
523         .pa_type = IWL_PA_SYSTEM,
524         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
525         .shadow_ram_support = true,
526         .led_compensation = 51,
527         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
528         .supports_idle = true,
529         .adv_thermal_throttle = true,
530         .support_ct_kill_exit = true,
531         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
532         .chain_noise_scale = 1000,
533         .monitor_recover_period = IWL_MONITORING_PERIOD,
534         .max_event_log_size = 512,
535         .sensitivity_calib_by_driver = true,
536         .chain_noise_calib_by_driver = true,
537         .need_dc_calib = true,
538 };
539
540 struct iwl_cfg iwl6000g2b_2bgn_cfg = {
541         .name = "6000 Series 2x2 BGN Gen2b",
542         .fw_name_pre = IWL6000G2B_FW_PRE,
543         .ucode_api_max = IWL6000G2_UCODE_API_MAX,
544         .ucode_api_min = IWL6000G2_UCODE_API_MIN,
545         .sku = IWL_SKU_G|IWL_SKU_N,
546         .ops = &iwl6000g2b_ops,
547         .eeprom_size = OTP_LOW_IMAGE_SIZE,
548         .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
549         .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
550         .num_of_queues = IWLAGN_NUM_QUEUES,
551         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
552         .mod_params = &iwlagn_mod_params,
553         .valid_tx_ant = ANT_AB,
554         .valid_rx_ant = ANT_AB,
555         .pll_cfg_val = 0,
556         .set_l0s = true,
557         .use_bsm = false,
558         .pa_type = IWL_PA_SYSTEM,
559         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
560         .shadow_ram_support = true,
561         .ht_greenfield_support = true,
562         .led_compensation = 51,
563         .use_rts_for_ht = true, /* use rts/cts protection */
564         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
565         .supports_idle = true,
566         .adv_thermal_throttle = true,
567         .support_ct_kill_exit = true,
568         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
569         .chain_noise_scale = 1000,
570         .monitor_recover_period = IWL_MONITORING_PERIOD,
571         .max_event_log_size = 512,
572         .sensitivity_calib_by_driver = true,
573         .chain_noise_calib_by_driver = true,
574         .need_dc_calib = true,
575 };
576
577 struct iwl_cfg iwl6000g2b_2bg_cfg = {
578         .name = "6000 Series 2x2 BG Gen2b",
579         .fw_name_pre = IWL6000G2B_FW_PRE,
580         .ucode_api_max = IWL6000G2_UCODE_API_MAX,
581         .ucode_api_min = IWL6000G2_UCODE_API_MIN,
582         .sku = IWL_SKU_G,
583         .ops = &iwl6000g2b_ops,
584         .eeprom_size = OTP_LOW_IMAGE_SIZE,
585         .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
586         .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
587         .num_of_queues = IWLAGN_NUM_QUEUES,
588         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
589         .mod_params = &iwlagn_mod_params,
590         .valid_tx_ant = ANT_AB,
591         .valid_rx_ant = ANT_AB,
592         .pll_cfg_val = 0,
593         .set_l0s = true,
594         .use_bsm = false,
595         .pa_type = IWL_PA_SYSTEM,
596         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
597         .shadow_ram_support = true,
598         .led_compensation = 51,
599         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
600         .supports_idle = true,
601         .adv_thermal_throttle = true,
602         .support_ct_kill_exit = true,
603         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
604         .chain_noise_scale = 1000,
605         .monitor_recover_period = IWL_MONITORING_PERIOD,
606         .max_event_log_size = 512,
607         .sensitivity_calib_by_driver = true,
608         .chain_noise_calib_by_driver = true,
609         .need_dc_calib = true,
610 };
611
612 struct iwl_cfg iwl6000g2b_bgn_cfg = {
613         .name = "6000 Series 1x2 BGN Gen2b",
614         .fw_name_pre = IWL6000G2B_FW_PRE,
615         .ucode_api_max = IWL6000G2_UCODE_API_MAX,
616         .ucode_api_min = IWL6000G2_UCODE_API_MIN,
617         .sku = IWL_SKU_G|IWL_SKU_N,
618         .ops = &iwl6000g2b_ops,
619         .eeprom_size = OTP_LOW_IMAGE_SIZE,
620         .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
621         .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
622         .num_of_queues = IWLAGN_NUM_QUEUES,
623         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
624         .mod_params = &iwlagn_mod_params,
625         .valid_tx_ant = ANT_A,
626         .valid_rx_ant = ANT_AB,
627         .pll_cfg_val = 0,
628         .set_l0s = true,
629         .use_bsm = false,
630         .pa_type = IWL_PA_SYSTEM,
631         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
632         .shadow_ram_support = true,
633         .ht_greenfield_support = true,
634         .led_compensation = 51,
635         .use_rts_for_ht = true, /* use rts/cts protection */
636         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
637         .supports_idle = true,
638         .adv_thermal_throttle = true,
639         .support_ct_kill_exit = true,
640         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
641         .chain_noise_scale = 1000,
642         .monitor_recover_period = IWL_MONITORING_PERIOD,
643         .max_event_log_size = 512,
644         .sensitivity_calib_by_driver = true,
645         .chain_noise_calib_by_driver = true,
646         .need_dc_calib = true,
647 };
648
649 struct iwl_cfg iwl6000g2b_bg_cfg = {
650         .name = "6000 Series 1x2 BG Gen2b",
651         .fw_name_pre = IWL6000G2B_FW_PRE,
652         .ucode_api_max = IWL6000G2_UCODE_API_MAX,
653         .ucode_api_min = IWL6000G2_UCODE_API_MIN,
654         .sku = IWL_SKU_G,
655         .ops = &iwl6000g2b_ops,
656         .eeprom_size = OTP_LOW_IMAGE_SIZE,
657         .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
658         .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
659         .num_of_queues = IWLAGN_NUM_QUEUES,
660         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
661         .mod_params = &iwlagn_mod_params,
662         .valid_tx_ant = ANT_A,
663         .valid_rx_ant = ANT_AB,
664         .pll_cfg_val = 0,
665         .set_l0s = true,
666         .use_bsm = false,
667         .pa_type = IWL_PA_SYSTEM,
668         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
669         .shadow_ram_support = true,
670         .led_compensation = 51,
671         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
672         .supports_idle = true,
673         .adv_thermal_throttle = true,
674         .support_ct_kill_exit = true,
675         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
676         .chain_noise_scale = 1000,
677         .monitor_recover_period = IWL_MONITORING_PERIOD,
678         .max_event_log_size = 512,
679         .sensitivity_calib_by_driver = true,
680         .chain_noise_calib_by_driver = true,
681         .need_dc_calib = true,
682 };
683
684 /*
685  * "i": Internal configuration, use internal Power Amplifier
686  */
687 struct iwl_cfg iwl6000i_2agn_cfg = {
688         .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
689         .fw_name_pre = IWL6000_FW_PRE,
690         .ucode_api_max = IWL6000_UCODE_API_MAX,
691         .ucode_api_min = IWL6000_UCODE_API_MIN,
692         .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
693         .ops = &iwl6000_ops,
694         .eeprom_size = OTP_LOW_IMAGE_SIZE,
695         .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
696         .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
697         .num_of_queues = IWLAGN_NUM_QUEUES,
698         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
699         .mod_params = &iwlagn_mod_params,
700         .valid_tx_ant = ANT_BC,
701         .valid_rx_ant = ANT_BC,
702         .pll_cfg_val = 0,
703         .set_l0s = true,
704         .use_bsm = false,
705         .pa_type = IWL_PA_INTERNAL,
706         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
707         .shadow_ram_support = true,
708         .ht_greenfield_support = true,
709         .led_compensation = 51,
710         .use_rts_for_ht = true, /* use rts/cts protection */
711         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
712         .supports_idle = true,
713         .adv_thermal_throttle = true,
714         .support_ct_kill_exit = true,
715         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
716         .chain_noise_scale = 1000,
717         .monitor_recover_period = IWL_MONITORING_PERIOD,
718         .max_event_log_size = 1024,
719         .ucode_tracing = true,
720         .sensitivity_calib_by_driver = true,
721         .chain_noise_calib_by_driver = true,
722 };
723
724 struct iwl_cfg iwl6000i_2abg_cfg = {
725         .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
726         .fw_name_pre = IWL6000_FW_PRE,
727         .ucode_api_max = IWL6000_UCODE_API_MAX,
728         .ucode_api_min = IWL6000_UCODE_API_MIN,
729         .sku = IWL_SKU_A|IWL_SKU_G,
730         .ops = &iwl6000_ops,
731         .eeprom_size = OTP_LOW_IMAGE_SIZE,
732         .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
733         .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
734         .num_of_queues = IWLAGN_NUM_QUEUES,
735         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
736         .mod_params = &iwlagn_mod_params,
737         .valid_tx_ant = ANT_BC,
738         .valid_rx_ant = ANT_BC,
739         .pll_cfg_val = 0,
740         .set_l0s = true,
741         .use_bsm = false,
742         .pa_type = IWL_PA_INTERNAL,
743         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
744         .shadow_ram_support = true,
745         .led_compensation = 51,
746         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
747         .supports_idle = true,
748         .adv_thermal_throttle = true,
749         .support_ct_kill_exit = true,
750         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
751         .chain_noise_scale = 1000,
752         .monitor_recover_period = IWL_MONITORING_PERIOD,
753         .max_event_log_size = 1024,
754         .ucode_tracing = true,
755         .sensitivity_calib_by_driver = true,
756         .chain_noise_calib_by_driver = true,
757 };
758
759 struct iwl_cfg iwl6000i_2bg_cfg = {
760         .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
761         .fw_name_pre = IWL6000_FW_PRE,
762         .ucode_api_max = IWL6000_UCODE_API_MAX,
763         .ucode_api_min = IWL6000_UCODE_API_MIN,
764         .sku = IWL_SKU_G,
765         .ops = &iwl6000_ops,
766         .eeprom_size = OTP_LOW_IMAGE_SIZE,
767         .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
768         .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
769         .num_of_queues = IWLAGN_NUM_QUEUES,
770         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
771         .mod_params = &iwlagn_mod_params,
772         .valid_tx_ant = ANT_BC,
773         .valid_rx_ant = ANT_BC,
774         .pll_cfg_val = 0,
775         .set_l0s = true,
776         .use_bsm = false,
777         .pa_type = IWL_PA_INTERNAL,
778         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
779         .shadow_ram_support = true,
780         .led_compensation = 51,
781         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
782         .supports_idle = true,
783         .adv_thermal_throttle = true,
784         .support_ct_kill_exit = true,
785         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
786         .chain_noise_scale = 1000,
787         .monitor_recover_period = IWL_MONITORING_PERIOD,
788         .max_event_log_size = 1024,
789         .ucode_tracing = true,
790         .sensitivity_calib_by_driver = true,
791         .chain_noise_calib_by_driver = true,
792 };
793
794 struct iwl_cfg iwl6050_2agn_cfg = {
795         .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
796         .fw_name_pre = IWL6050_FW_PRE,
797         .ucode_api_max = IWL6050_UCODE_API_MAX,
798         .ucode_api_min = IWL6050_UCODE_API_MIN,
799         .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
800         .ops = &iwl6000_ops,
801         .eeprom_size = OTP_LOW_IMAGE_SIZE,
802         .eeprom_ver = EEPROM_6050_EEPROM_VERSION,
803         .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION,
804         .num_of_queues = IWLAGN_NUM_QUEUES,
805         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
806         .mod_params = &iwlagn_mod_params,
807         .valid_tx_ant = ANT_AB,
808         .valid_rx_ant = ANT_AB,
809         .pll_cfg_val = 0,
810         .set_l0s = true,
811         .use_bsm = false,
812         .pa_type = IWL_PA_SYSTEM,
813         .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
814         .shadow_ram_support = true,
815         .ht_greenfield_support = true,
816         .led_compensation = 51,
817         .use_rts_for_ht = true, /* use rts/cts protection */
818         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
819         .supports_idle = true,
820         .adv_thermal_throttle = true,
821         .support_ct_kill_exit = true,
822         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
823         .chain_noise_scale = 1500,
824         .monitor_recover_period = IWL_MONITORING_PERIOD,
825         .max_event_log_size = 1024,
826         .ucode_tracing = true,
827         .sensitivity_calib_by_driver = true,
828         .chain_noise_calib_by_driver = true,
829         .need_dc_calib = true,
830 };
831
832 struct iwl_cfg iwl6050_2abg_cfg = {
833         .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG",
834         .fw_name_pre = IWL6050_FW_PRE,
835         .ucode_api_max = IWL6050_UCODE_API_MAX,
836         .ucode_api_min = IWL6050_UCODE_API_MIN,
837         .sku = IWL_SKU_A|IWL_SKU_G,
838         .ops = &iwl6000_ops,
839         .eeprom_size = OTP_LOW_IMAGE_SIZE,
840         .eeprom_ver = EEPROM_6050_EEPROM_VERSION,
841         .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION,
842         .num_of_queues = IWLAGN_NUM_QUEUES,
843         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
844         .mod_params = &iwlagn_mod_params,
845         .valid_tx_ant = ANT_AB,
846         .valid_rx_ant = ANT_AB,
847         .pll_cfg_val = 0,
848         .set_l0s = true,
849         .use_bsm = false,
850         .pa_type = IWL_PA_SYSTEM,
851         .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
852         .shadow_ram_support = true,
853         .led_compensation = 51,
854         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
855         .supports_idle = true,
856         .adv_thermal_throttle = true,
857         .support_ct_kill_exit = true,
858         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
859         .chain_noise_scale = 1500,
860         .monitor_recover_period = IWL_MONITORING_PERIOD,
861         .max_event_log_size = 1024,
862         .ucode_tracing = true,
863         .sensitivity_calib_by_driver = true,
864         .chain_noise_calib_by_driver = true,
865         .need_dc_calib = true,
866 };
867
868 struct iwl_cfg iwl6000_3agn_cfg = {
869         .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
870         .fw_name_pre = IWL6000_FW_PRE,
871         .ucode_api_max = IWL6000_UCODE_API_MAX,
872         .ucode_api_min = IWL6000_UCODE_API_MIN,
873         .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
874         .ops = &iwl6000_ops,
875         .eeprom_size = OTP_LOW_IMAGE_SIZE,
876         .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
877         .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
878         .num_of_queues = IWLAGN_NUM_QUEUES,
879         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
880         .mod_params = &iwlagn_mod_params,
881         .valid_tx_ant = ANT_ABC,
882         .valid_rx_ant = ANT_ABC,
883         .pll_cfg_val = 0,
884         .set_l0s = true,
885         .use_bsm = false,
886         .pa_type = IWL_PA_SYSTEM,
887         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
888         .shadow_ram_support = true,
889         .ht_greenfield_support = true,
890         .led_compensation = 51,
891         .use_rts_for_ht = true, /* use rts/cts protection */
892         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
893         .supports_idle = true,
894         .adv_thermal_throttle = true,
895         .support_ct_kill_exit = true,
896         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
897         .chain_noise_scale = 1000,
898         .monitor_recover_period = IWL_MONITORING_PERIOD,
899         .max_event_log_size = 1024,
900         .ucode_tracing = true,
901         .sensitivity_calib_by_driver = true,
902         .chain_noise_calib_by_driver = true,
903 };
904
905 MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
906 MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
907 MODULE_FIRMWARE(IWL6000G2A_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
908 MODULE_FIRMWARE(IWL6000G2B_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));