iwlagn: clean up & autodetect statistics
[linux-block.git] / drivers / net / wireless / iwlwifi / iwl-6000.c
1 /******************************************************************************
2  *
3  * Copyright(c) 2008 - 2011 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 5
55 #define IWL6000G2_UCODE_API_MAX 5
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
65 #define IWL6050_FW_PRE "iwlwifi-6050-"
66 #define IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE #api ".ucode"
67
68 #define IWL6005_FW_PRE "iwlwifi-6000g2a-"
69 #define IWL6005_MODULE_FIRMWARE(api) IWL6005_FW_PRE #api ".ucode"
70
71 #define IWL6030_FW_PRE "iwlwifi-6000g2b-"
72 #define IWL6030_MODULE_FIRMWARE(api) IWL6030_FW_PRE #api ".ucode"
73
74 static void iwl6000_set_ct_threshold(struct iwl_priv *priv)
75 {
76         /* want Celsius */
77         priv->hw_params.ct_kill_threshold = CT_KILL_THRESHOLD;
78         priv->hw_params.ct_kill_exit_threshold = CT_KILL_EXIT_THRESHOLD;
79 }
80
81 static void iwl6050_additional_nic_config(struct iwl_priv *priv)
82 {
83         /* Indicate calibration version to uCode. */
84         if (priv->cfg->ops->lib->eeprom_ops.calib_version(priv) >= 6)
85                 iwl_set_bit(priv, CSR_GP_DRIVER_REG,
86                                 CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6);
87 }
88
89 static void iwl6150_additional_nic_config(struct iwl_priv *priv)
90 {
91         /* Indicate calibration version to uCode. */
92         if (priv->cfg->ops->lib->eeprom_ops.calib_version(priv) >= 6)
93                 iwl_set_bit(priv, CSR_GP_DRIVER_REG,
94                                 CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6);
95         iwl_set_bit(priv, CSR_GP_DRIVER_REG,
96                     CSR_GP_DRIVER_REG_BIT_6050_1x2);
97 }
98
99 /* NIC configuration for 6000 series */
100 static void iwl6000_nic_config(struct iwl_priv *priv)
101 {
102         u16 radio_cfg;
103
104         radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG);
105
106         /* write radio config values to register */
107         if (EEPROM_RF_CFG_TYPE_MSK(radio_cfg) <= EEPROM_RF_CONFIG_TYPE_MAX)
108                 iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
109                             EEPROM_RF_CFG_TYPE_MSK(radio_cfg) |
110                             EEPROM_RF_CFG_STEP_MSK(radio_cfg) |
111                             EEPROM_RF_CFG_DASH_MSK(radio_cfg));
112
113         /* set CSR_HW_CONFIG_REG for uCode use */
114         iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
115                     CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI |
116                     CSR_HW_IF_CONFIG_REG_BIT_MAC_SI);
117
118         /* no locking required for register write */
119         if (priv->cfg->pa_type == IWL_PA_INTERNAL) {
120                 /* 2x2 IPA phy type */
121                 iwl_write32(priv, CSR_GP_DRIVER_REG,
122                              CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_IPA);
123         }
124         /* do additional nic configuration if needed */
125         if (priv->cfg->ops->nic &&
126                 priv->cfg->ops->nic->additional_nic_config) {
127                         priv->cfg->ops->nic->additional_nic_config(priv);
128         }
129 }
130
131 static struct iwl_sensitivity_ranges iwl6000_sensitivity = {
132         .min_nrg_cck = 97,
133         .max_nrg_cck = 0, /* not used, set to 0 */
134         .auto_corr_min_ofdm = 80,
135         .auto_corr_min_ofdm_mrc = 128,
136         .auto_corr_min_ofdm_x1 = 105,
137         .auto_corr_min_ofdm_mrc_x1 = 192,
138
139         .auto_corr_max_ofdm = 145,
140         .auto_corr_max_ofdm_mrc = 232,
141         .auto_corr_max_ofdm_x1 = 110,
142         .auto_corr_max_ofdm_mrc_x1 = 232,
143
144         .auto_corr_min_cck = 125,
145         .auto_corr_max_cck = 175,
146         .auto_corr_min_cck_mrc = 160,
147         .auto_corr_max_cck_mrc = 310,
148         .nrg_th_cck = 97,
149         .nrg_th_ofdm = 100,
150
151         .barker_corr_th_min = 190,
152         .barker_corr_th_min_mrc = 390,
153         .nrg_th_cca = 62,
154 };
155
156 static int iwl6000_hw_set_hw_params(struct iwl_priv *priv)
157 {
158         if (priv->cfg->mod_params->num_of_queues >= IWL_MIN_NUM_QUEUES &&
159             priv->cfg->mod_params->num_of_queues <= IWLAGN_NUM_QUEUES)
160                 priv->cfg->base_params->num_of_queues =
161                         priv->cfg->mod_params->num_of_queues;
162
163         priv->hw_params.max_txq_num = priv->cfg->base_params->num_of_queues;
164         priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM;
165         priv->hw_params.scd_bc_tbls_size =
166                         priv->cfg->base_params->num_of_queues *
167                         sizeof(struct iwlagn_scd_bc_tbl);
168         priv->hw_params.tfd_size = sizeof(struct iwl_tfd);
169         priv->hw_params.max_stations = IWLAGN_STATION_COUNT;
170         priv->contexts[IWL_RXON_CTX_BSS].bcast_sta_id = IWLAGN_BROADCAST_ID;
171
172         priv->hw_params.max_data_size = IWL60_RTC_DATA_SIZE;
173         priv->hw_params.max_inst_size = IWL60_RTC_INST_SIZE;
174
175         priv->hw_params.ht40_channel =  BIT(IEEE80211_BAND_2GHZ) |
176                                         BIT(IEEE80211_BAND_5GHZ);
177         priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
178
179         priv->hw_params.tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant);
180         if (priv->cfg->rx_with_siso_diversity)
181                 priv->hw_params.rx_chains_num = 1;
182         else
183                 priv->hw_params.rx_chains_num =
184                         num_of_ant(priv->cfg->valid_rx_ant);
185         priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
186         priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
187
188         iwl6000_set_ct_threshold(priv);
189
190         /* Set initial sensitivity parameters */
191         /* Set initial calibration set */
192         priv->hw_params.sens = &iwl6000_sensitivity;
193         priv->hw_params.calib_init_cfg =
194                 BIT(IWL_CALIB_XTAL)             |
195                 BIT(IWL_CALIB_LO)               |
196                 BIT(IWL_CALIB_TX_IQ)            |
197                 BIT(IWL_CALIB_BASE_BAND);
198         if (priv->cfg->need_dc_calib)
199                 priv->hw_params.calib_rt_cfg |= BIT(IWL_CALIB_CFG_DC_IDX);
200         if (priv->cfg->need_temp_offset_calib)
201                 priv->hw_params.calib_init_cfg |= BIT(IWL_CALIB_TEMP_OFFSET);
202
203         priv->hw_params.beacon_time_tsf_bits = IWLAGN_EXT_BEACON_TIME_POS;
204
205         return 0;
206 }
207
208 static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
209                                      struct ieee80211_channel_switch *ch_switch)
210 {
211         /*
212          * MULTI-FIXME
213          * See iwl_mac_channel_switch.
214          */
215         struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
216         struct iwl6000_channel_switch_cmd cmd;
217         const struct iwl_channel_info *ch_info;
218         u32 switch_time_in_usec, ucode_switch_time;
219         u16 ch;
220         u32 tsf_low;
221         u8 switch_count;
222         u16 beacon_interval = le16_to_cpu(ctx->timing.beacon_interval);
223         struct ieee80211_vif *vif = ctx->vif;
224         struct iwl_host_cmd hcmd = {
225                 .id = REPLY_CHANNEL_SWITCH,
226                 .len = sizeof(cmd),
227                 .flags = CMD_SYNC,
228                 .data = &cmd,
229         };
230
231         cmd.band = priv->band == IEEE80211_BAND_2GHZ;
232         ch = ch_switch->channel->hw_value;
233         IWL_DEBUG_11H(priv, "channel switch from %u to %u\n",
234                       ctx->active.channel, ch);
235         cmd.channel = cpu_to_le16(ch);
236         cmd.rxon_flags = ctx->staging.flags;
237         cmd.rxon_filter_flags = ctx->staging.filter_flags;
238         switch_count = ch_switch->count;
239         tsf_low = ch_switch->timestamp & 0x0ffffffff;
240         /*
241          * calculate the ucode channel switch time
242          * adding TSF as one of the factor for when to switch
243          */
244         if ((priv->ucode_beacon_time > tsf_low) && beacon_interval) {
245                 if (switch_count > ((priv->ucode_beacon_time - tsf_low) /
246                     beacon_interval)) {
247                         switch_count -= (priv->ucode_beacon_time -
248                                 tsf_low) / beacon_interval;
249                 } else
250                         switch_count = 0;
251         }
252         if (switch_count <= 1)
253                 cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time);
254         else {
255                 switch_time_in_usec =
256                         vif->bss_conf.beacon_int * switch_count * TIME_UNIT;
257                 ucode_switch_time = iwl_usecs_to_beacons(priv,
258                                                          switch_time_in_usec,
259                                                          beacon_interval);
260                 cmd.switch_time = iwl_add_beacon_time(priv,
261                                                       priv->ucode_beacon_time,
262                                                       ucode_switch_time,
263                                                       beacon_interval);
264         }
265         IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n",
266                       cmd.switch_time);
267         ch_info = iwl_get_channel_info(priv, priv->band, ch);
268         if (ch_info)
269                 cmd.expect_beacon = is_channel_radar(ch_info);
270         else {
271                 IWL_ERR(priv, "invalid channel switch from %u to %u\n",
272                         ctx->active.channel, ch);
273                 return -EFAULT;
274         }
275         priv->switch_rxon.channel = cmd.channel;
276         priv->switch_rxon.switch_in_progress = true;
277
278         return iwl_send_cmd_sync(priv, &hcmd);
279 }
280
281 static struct iwl_lib_ops iwl6000_lib = {
282         .set_hw_params = iwl6000_hw_set_hw_params,
283         .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
284         .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
285         .txq_set_sched = iwlagn_txq_set_sched,
286         .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
287         .txq_free_tfd = iwl_hw_txq_free_tfd,
288         .txq_init = iwl_hw_tx_queue_init,
289         .rx_handler_setup = iwlagn_rx_handler_setup,
290         .setup_deferred_work = iwlagn_setup_deferred_work,
291         .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
292         .send_tx_power = iwlagn_send_tx_power,
293         .update_chain_flags = iwl_update_chain_flags,
294         .set_channel_switch = iwl6000_hw_channel_switch,
295         .apm_ops = {
296                 .init = iwl_apm_init,
297                 .config = iwl6000_nic_config,
298         },
299         .eeprom_ops = {
300                 .regulatory_bands = {
301                         EEPROM_REG_BAND_1_CHANNELS,
302                         EEPROM_REG_BAND_2_CHANNELS,
303                         EEPROM_REG_BAND_3_CHANNELS,
304                         EEPROM_REG_BAND_4_CHANNELS,
305                         EEPROM_REG_BAND_5_CHANNELS,
306                         EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
307                         EEPROM_REG_BAND_52_HT40_CHANNELS
308                 },
309                 .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
310                 .release_semaphore = iwlcore_eeprom_release_semaphore,
311                 .calib_version  = iwlagn_eeprom_calib_version,
312                 .query_addr = iwlagn_eeprom_query_addr,
313                 .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower,
314         },
315         .temp_ops = {
316                 .temperature = iwlagn_temperature,
317          },
318         .debugfs_ops = {
319                 .rx_stats_read = iwl_ucode_rx_stats_read,
320                 .tx_stats_read = iwl_ucode_tx_stats_read,
321                 .general_stats_read = iwl_ucode_general_stats_read,
322                 .bt_stats_read = iwl_ucode_bt_stats_read,
323                 .reply_tx_error = iwl_reply_tx_error_read,
324         },
325         .txfifo_flush = iwlagn_txfifo_flush,
326         .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
327         .tt_ops = {
328                 .lower_power_detection = iwl_tt_is_low_power_state,
329                 .tt_power_mode = iwl_tt_current_power_mode,
330                 .ct_kill_check = iwl_check_for_ct_kill,
331         }
332 };
333
334 static struct iwl_lib_ops iwl6030_lib = {
335         .set_hw_params = iwl6000_hw_set_hw_params,
336         .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
337         .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
338         .txq_set_sched = iwlagn_txq_set_sched,
339         .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
340         .txq_free_tfd = iwl_hw_txq_free_tfd,
341         .txq_init = iwl_hw_tx_queue_init,
342         .rx_handler_setup = iwlagn_bt_rx_handler_setup,
343         .setup_deferred_work = iwlagn_bt_setup_deferred_work,
344         .cancel_deferred_work = iwlagn_bt_cancel_deferred_work,
345         .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
346         .send_tx_power = iwlagn_send_tx_power,
347         .update_chain_flags = iwl_update_chain_flags,
348         .set_channel_switch = iwl6000_hw_channel_switch,
349         .apm_ops = {
350                 .init = iwl_apm_init,
351                 .config = iwl6000_nic_config,
352         },
353         .eeprom_ops = {
354                 .regulatory_bands = {
355                         EEPROM_REG_BAND_1_CHANNELS,
356                         EEPROM_REG_BAND_2_CHANNELS,
357                         EEPROM_REG_BAND_3_CHANNELS,
358                         EEPROM_REG_BAND_4_CHANNELS,
359                         EEPROM_REG_BAND_5_CHANNELS,
360                         EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
361                         EEPROM_REG_BAND_52_HT40_CHANNELS
362                 },
363                 .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
364                 .release_semaphore = iwlcore_eeprom_release_semaphore,
365                 .calib_version  = iwlagn_eeprom_calib_version,
366                 .query_addr = iwlagn_eeprom_query_addr,
367                 .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower,
368         },
369         .temp_ops = {
370                 .temperature = iwlagn_temperature,
371          },
372         .debugfs_ops = {
373                 .rx_stats_read = iwl_ucode_rx_stats_read,
374                 .tx_stats_read = iwl_ucode_tx_stats_read,
375                 .general_stats_read = iwl_ucode_general_stats_read,
376                 .bt_stats_read = iwl_ucode_bt_stats_read,
377                 .reply_tx_error = iwl_reply_tx_error_read,
378         },
379         .txfifo_flush = iwlagn_txfifo_flush,
380         .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
381         .tt_ops = {
382                 .lower_power_detection = iwl_tt_is_low_power_state,
383                 .tt_power_mode = iwl_tt_current_power_mode,
384                 .ct_kill_check = iwl_check_for_ct_kill,
385         }
386 };
387
388 static struct iwl_nic_ops iwl6050_nic_ops = {
389         .additional_nic_config = &iwl6050_additional_nic_config,
390 };
391
392 static struct iwl_nic_ops iwl6150_nic_ops = {
393         .additional_nic_config = &iwl6150_additional_nic_config,
394 };
395
396 static const struct iwl_ops iwl6000_ops = {
397         .lib = &iwl6000_lib,
398         .hcmd = &iwlagn_hcmd,
399         .utils = &iwlagn_hcmd_utils,
400         .led = &iwlagn_led_ops,
401         .ieee80211_ops = &iwlagn_hw_ops,
402 };
403
404 static const struct iwl_ops iwl6050_ops = {
405         .lib = &iwl6000_lib,
406         .hcmd = &iwlagn_hcmd,
407         .utils = &iwlagn_hcmd_utils,
408         .led = &iwlagn_led_ops,
409         .nic = &iwl6050_nic_ops,
410         .ieee80211_ops = &iwlagn_hw_ops,
411 };
412
413 static const struct iwl_ops iwl6150_ops = {
414         .lib = &iwl6000_lib,
415         .hcmd = &iwlagn_hcmd,
416         .utils = &iwlagn_hcmd_utils,
417         .led = &iwlagn_led_ops,
418         .nic = &iwl6150_nic_ops,
419         .ieee80211_ops = &iwlagn_hw_ops,
420 };
421
422 static const struct iwl_ops iwl6030_ops = {
423         .lib = &iwl6030_lib,
424         .hcmd = &iwlagn_bt_hcmd,
425         .utils = &iwlagn_hcmd_utils,
426         .led = &iwlagn_led_ops,
427         .ieee80211_ops = &iwlagn_hw_ops,
428 };
429
430 static struct iwl_base_params iwl6000_base_params = {
431         .eeprom_size = OTP_LOW_IMAGE_SIZE,
432         .num_of_queues = IWLAGN_NUM_QUEUES,
433         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
434         .pll_cfg_val = 0,
435         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
436         .shadow_ram_support = true,
437         .led_compensation = 51,
438         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
439         .adv_thermal_throttle = true,
440         .support_ct_kill_exit = true,
441         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
442         .chain_noise_scale = 1000,
443         .wd_timeout = IWL_DEF_WD_TIMEOUT,
444         .max_event_log_size = 512,
445         .ucode_tracing = true,
446         .shadow_reg_enable = true,
447 };
448
449 static struct iwl_base_params iwl6050_base_params = {
450         .eeprom_size = OTP_LOW_IMAGE_SIZE,
451         .num_of_queues = IWLAGN_NUM_QUEUES,
452         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
453         .pll_cfg_val = 0,
454         .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
455         .shadow_ram_support = true,
456         .led_compensation = 51,
457         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
458         .adv_thermal_throttle = true,
459         .support_ct_kill_exit = true,
460         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
461         .chain_noise_scale = 1500,
462         .wd_timeout = IWL_DEF_WD_TIMEOUT,
463         .max_event_log_size = 1024,
464         .ucode_tracing = true,
465         .shadow_reg_enable = true,
466 };
467 static struct iwl_base_params iwl6000_g2_base_params = {
468         .eeprom_size = OTP_LOW_IMAGE_SIZE,
469         .num_of_queues = IWLAGN_NUM_QUEUES,
470         .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
471         .pll_cfg_val = 0,
472         .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
473         .shadow_ram_support = true,
474         .led_compensation = 57,
475         .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
476         .adv_thermal_throttle = true,
477         .support_ct_kill_exit = true,
478         .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
479         .chain_noise_scale = 1000,
480         .wd_timeout = IWL_LONG_WD_TIMEOUT,
481         .max_event_log_size = 512,
482         .ucode_tracing = true,
483         .shadow_reg_enable = true,
484 };
485
486 static struct iwl_ht_params iwl6000_ht_params = {
487         .ht_greenfield_support = true,
488         .use_rts_for_aggregation = true, /* use rts/cts protection */
489 };
490
491 static struct iwl_bt_params iwl6000_bt_params = {
492         /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
493         .advanced_bt_coexist = true,
494         .agg_time_limit = BT_AGG_THRESHOLD_DEF,
495         .bt_init_traffic_load = IWL_BT_COEX_TRAFFIC_LOAD_NONE,
496         .bt_prio_boost = IWLAGN_BT_PRIO_BOOST_DEFAULT,
497         .bt_sco_disable = true,
498 };
499
500 #define IWL_DEVICE_6005                                         \
501         .fw_name_pre = IWL6005_FW_PRE,                  \
502         .ucode_api_max = IWL6000G2_UCODE_API_MAX,               \
503         .ucode_api_min = IWL6000G2_UCODE_API_MIN,               \
504         .eeprom_ver = EEPROM_6005_EEPROM_VERSION,               \
505         .eeprom_calib_ver = EEPROM_6005_TX_POWER_VERSION,       \
506         .ops = &iwl6000_ops,                                    \
507         .mod_params = &iwlagn_mod_params,                       \
508         .base_params = &iwl6000_g2_base_params,                 \
509         .need_dc_calib = true,                                  \
510         .need_temp_offset_calib = true,                         \
511         .led_mode = IWL_LED_RF_STATE
512
513 struct iwl_cfg iwl6005_2agn_cfg = {
514         .name = "Intel(R) Centrino(R) Advanced-N 6205 AGN",
515         IWL_DEVICE_6005,
516         .ht_params = &iwl6000_ht_params,
517 };
518
519 struct iwl_cfg iwl6005_2abg_cfg = {
520         .name = "Intel(R) Centrino(R) Advanced-N 6205 ABG",
521         IWL_DEVICE_6005,
522 };
523
524 struct iwl_cfg iwl6005_2bg_cfg = {
525         .name = "Intel(R) Centrino(R) Advanced-N 6205 BG",
526         IWL_DEVICE_6005,
527 };
528
529 #define IWL_DEVICE_6030                                         \
530         .fw_name_pre = IWL6030_FW_PRE,                  \
531         .ucode_api_max = IWL6000G2_UCODE_API_MAX,               \
532         .ucode_api_min = IWL6000G2_UCODE_API_MIN,               \
533         .eeprom_ver = EEPROM_6030_EEPROM_VERSION,               \
534         .eeprom_calib_ver = EEPROM_6030_TX_POWER_VERSION,       \
535         .ops = &iwl6030_ops,                                    \
536         .mod_params = &iwlagn_mod_params,                       \
537         .base_params = &iwl6000_g2_base_params,                 \
538         .bt_params = &iwl6000_bt_params,                        \
539         .need_dc_calib = true,                                  \
540         .need_temp_offset_calib = true,                         \
541         .led_mode = IWL_LED_RF_STATE,                           \
542         .adv_pm = true                                          \
543
544 struct iwl_cfg iwl6030_2agn_cfg = {
545         .name = "Intel(R) Centrino(R) Advanced-N 6230 AGN",
546         IWL_DEVICE_6030,
547         .ht_params = &iwl6000_ht_params,
548 };
549
550 struct iwl_cfg iwl6030_2abg_cfg = {
551         .name = "Intel(R) Centrino(R) Advanced-N 6230 ABG",
552         IWL_DEVICE_6030,
553 };
554
555 struct iwl_cfg iwl6030_2bgn_cfg = {
556         .name = "Intel(R) Centrino(R) Advanced-N 6230 BGN",
557         IWL_DEVICE_6030,
558         .ht_params = &iwl6000_ht_params,
559 };
560
561 struct iwl_cfg iwl6030_2bg_cfg = {
562         .name = "Intel(R) Centrino(R) Advanced-N 6230 BG",
563         IWL_DEVICE_6030,
564 };
565
566 struct iwl_cfg iwl6035_2agn_cfg = {
567         .name = "6035 Series 2x2 AGN/BT",
568         IWL_DEVICE_6030,
569         .ht_params = &iwl6000_ht_params,
570 };
571
572 struct iwl_cfg iwl6035_2abg_cfg = {
573         .name = "6035 Series 2x2 ABG/BT",
574         IWL_DEVICE_6030,
575 };
576
577 struct iwl_cfg iwl6035_2bg_cfg = {
578         .name = "6035 Series 2x2 BG/BT",
579         IWL_DEVICE_6030,
580 };
581
582 struct iwl_cfg iwl1030_bgn_cfg = {
583         .name = "Intel(R) Centrino(R) Wireless-N 1030 BGN",
584         IWL_DEVICE_6030,
585         .ht_params = &iwl6000_ht_params,
586 };
587
588 struct iwl_cfg iwl1030_bg_cfg = {
589         .name = "Intel(R) Centrino(R) Wireless-N 1030 BG",
590         IWL_DEVICE_6030,
591 };
592
593 struct iwl_cfg iwl130_bgn_cfg = {
594         .name = "Intel(R) Centrino(R) Wireless-N 130 BGN",
595         IWL_DEVICE_6030,
596         .ht_params = &iwl6000_ht_params,
597         .rx_with_siso_diversity = true,
598 };
599
600 struct iwl_cfg iwl130_bg_cfg = {
601         .name = "Intel(R) Centrino(R) Wireless-N 130 BG",
602         IWL_DEVICE_6030,
603         .rx_with_siso_diversity = true,
604 };
605
606 /*
607  * "i": Internal configuration, use internal Power Amplifier
608  */
609 #define IWL_DEVICE_6000i                                        \
610         .fw_name_pre = IWL6000_FW_PRE,                          \
611         .ucode_api_max = IWL6000_UCODE_API_MAX,                 \
612         .ucode_api_min = IWL6000_UCODE_API_MIN,                 \
613         .valid_tx_ant = ANT_BC,         /* .cfg overwrite */    \
614         .valid_rx_ant = ANT_BC,         /* .cfg overwrite */    \
615         .eeprom_ver = EEPROM_6000_EEPROM_VERSION,               \
616         .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,       \
617         .ops = &iwl6000_ops,                                    \
618         .mod_params = &iwlagn_mod_params,                       \
619         .base_params = &iwl6000_base_params,                    \
620         .pa_type = IWL_PA_INTERNAL,                             \
621         .led_mode = IWL_LED_BLINK
622
623 struct iwl_cfg iwl6000i_2agn_cfg = {
624         .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
625         IWL_DEVICE_6000i,
626         .ht_params = &iwl6000_ht_params,
627 };
628
629 struct iwl_cfg iwl6000i_2abg_cfg = {
630         .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
631         IWL_DEVICE_6000i,
632 };
633
634 struct iwl_cfg iwl6000i_2bg_cfg = {
635         .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
636         IWL_DEVICE_6000i,
637 };
638
639 #define IWL_DEVICE_6050                                         \
640         .fw_name_pre = IWL6050_FW_PRE,                          \
641         .ucode_api_max = IWL6050_UCODE_API_MAX,                 \
642         .ucode_api_min = IWL6050_UCODE_API_MIN,                 \
643         .valid_tx_ant = ANT_AB,         /* .cfg overwrite */    \
644         .valid_rx_ant = ANT_AB,         /* .cfg overwrite */    \
645         .ops = &iwl6050_ops,                                    \
646         .eeprom_ver = EEPROM_6050_EEPROM_VERSION,               \
647         .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION,       \
648         .mod_params = &iwlagn_mod_params,                       \
649         .base_params = &iwl6050_base_params,                    \
650         .need_dc_calib = true,                                  \
651         .led_mode = IWL_LED_BLINK,                              \
652         .internal_wimax_coex = true
653
654 struct iwl_cfg iwl6050_2agn_cfg = {
655         .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
656         IWL_DEVICE_6050,
657         .ht_params = &iwl6000_ht_params,
658 };
659
660 struct iwl_cfg iwl6050_2abg_cfg = {
661         .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG",
662         IWL_DEVICE_6050,
663 };
664
665 struct iwl_cfg iwl6150_bgn_cfg = {
666         .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN",
667         .fw_name_pre = IWL6050_FW_PRE,
668         .ucode_api_max = IWL6050_UCODE_API_MAX,
669         .ucode_api_min = IWL6050_UCODE_API_MIN,
670         .eeprom_ver = EEPROM_6150_EEPROM_VERSION,
671         .eeprom_calib_ver = EEPROM_6150_TX_POWER_VERSION,
672         .ops = &iwl6150_ops,
673         .mod_params = &iwlagn_mod_params,
674         .base_params = &iwl6050_base_params,
675         .ht_params = &iwl6000_ht_params,
676         .need_dc_calib = true,
677         .led_mode = IWL_LED_RF_STATE,
678         .internal_wimax_coex = true,
679 };
680
681 struct iwl_cfg iwl6000_3agn_cfg = {
682         .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
683         .fw_name_pre = IWL6000_FW_PRE,
684         .ucode_api_max = IWL6000_UCODE_API_MAX,
685         .ucode_api_min = IWL6000_UCODE_API_MIN,
686         .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
687         .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
688         .ops = &iwl6000_ops,
689         .mod_params = &iwlagn_mod_params,
690         .base_params = &iwl6000_base_params,
691         .ht_params = &iwl6000_ht_params,
692         .need_dc_calib = true,
693         .led_mode = IWL_LED_BLINK,
694 };
695
696 MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
697 MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
698 MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
699 MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));