blob: 077514546d021b93c10b6386a296cf299d76f516 [file] [log] [blame]
Jay Sternberge1228372009-01-19 15:30:34 -08001/******************************************************************************
2 *
Reinette Chatre1f447802010-01-15 13:43:41 -08003 * Copyright(c) 2008 - 2010 Intel Corporation. All rights reserved.
Jay Sternberge1228372009-01-19 15:30:34 -08004 *
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"
Johannes Berga1175122010-01-21 06:21:10 -080045#include "iwl-agn.h"
Jay Sternberge1228372009-01-19 15:30:34 -080046#include "iwl-helpers.h"
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -070047#include "iwl-agn-hw.h"
Wey-Yi Guyf3a2a422009-09-11 10:38:11 -070048#include "iwl-6000-hw.h"
Johannes Berge932a602009-10-02 13:44:03 -070049#include "iwl-agn-led.h"
Abhijeet Kolekarb8c76262010-04-08 15:29:07 -070050#include "iwl-agn-debugfs.h"
Jay Sternberge1228372009-01-19 15:30:34 -080051
52/* Highest firmware API version supported */
Wey-Yi Guyfcbaf8b2009-08-21 13:34:18 -070053#define IWL6000_UCODE_API_MAX 4
54#define IWL6050_UCODE_API_MAX 4
Shanyu Zhao4b3e8062010-04-07 18:06:36 -070055#define IWL6000G2_UCODE_API_MAX 4
Jay Sternberge1228372009-01-19 15:30:34 -080056
57/* Lowest firmware API version supported */
Wey-Yi Guy44246422009-10-23 13:42:34 -070058#define IWL6000_UCODE_API_MIN 4
59#define IWL6050_UCODE_API_MIN 4
Shanyu Zhao4b3e8062010-04-07 18:06:36 -070060#define IWL6000G2_UCODE_API_MIN 4
Jay Sternberge1228372009-01-19 15:30:34 -080061
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
Shanyu Zhao95b13012010-04-21 11:46:33 -070070#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
Shanyu Zhao18089722010-05-06 10:15:21 -070074#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
Shanyu Zhao4b3e8062010-04-07 18:06:36 -070078
Wey-Yi Guy672639d2009-07-24 11:13:01 -070079static 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
Abhijeet Kolekard5755932010-02-18 22:03:05 -080086/* Indicate calibration version to uCode. */
87static void iwl6050_set_calib_version(struct iwl_priv *priv)
88{
89 if (priv->cfg->ops->lib->eeprom_ops.calib_version(priv) >= 6)
90 iwl_set_bit(priv, CSR_GP_DRIVER_REG,
91 CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6);
92}
93
Wey-Yi Guy65b79982009-07-31 14:28:07 -070094/* NIC configuration for 6000 series */
95static void iwl6000_nic_config(struct iwl_priv *priv)
96{
Wey-Yi Guy9371d4e2009-09-11 10:38:10 -070097 u16 radio_cfg;
98
99 radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG);
100
101 /* write radio config values to register */
102 if (EEPROM_RF_CFG_TYPE_MSK(radio_cfg) <= EEPROM_RF_CONFIG_TYPE_MAX)
103 iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
104 EEPROM_RF_CFG_TYPE_MSK(radio_cfg) |
105 EEPROM_RF_CFG_STEP_MSK(radio_cfg) |
106 EEPROM_RF_CFG_DASH_MSK(radio_cfg));
107
108 /* set CSR_HW_CONFIG_REG for uCode use */
109 iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
110 CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI |
111 CSR_HW_IF_CONFIG_REG_BIT_MAC_SI);
Wey-Yi Guy65b79982009-07-31 14:28:07 -0700112
113 /* no locking required for register write */
Wey-Yi Guy740e7f52009-11-06 14:52:55 -0800114 if (priv->cfg->pa_type == IWL_PA_INTERNAL) {
Wey-Yi Guy65b79982009-07-31 14:28:07 -0700115 /* 2x2 IPA phy type */
116 iwl_write32(priv, CSR_GP_DRIVER_REG,
117 CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_IPA);
118 }
119 /* else do nothing, uCode configured */
Abhijeet Kolekard5755932010-02-18 22:03:05 -0800120 if (priv->cfg->ops->lib->temp_ops.set_calib_version)
121 priv->cfg->ops->lib->temp_ops.set_calib_version(priv);
Wey-Yi Guy65b79982009-07-31 14:28:07 -0700122}
123
Wey-Yi Guyf3a2a422009-09-11 10:38:11 -0700124static struct iwl_sensitivity_ranges iwl6000_sensitivity = {
125 .min_nrg_cck = 97,
126 .max_nrg_cck = 0, /* not used, set to 0 */
127 .auto_corr_min_ofdm = 80,
128 .auto_corr_min_ofdm_mrc = 128,
129 .auto_corr_min_ofdm_x1 = 105,
130 .auto_corr_min_ofdm_mrc_x1 = 192,
131
132 .auto_corr_max_ofdm = 145,
133 .auto_corr_max_ofdm_mrc = 232,
Wey-Yi Guy2494f632010-01-20 12:22:52 -0800134 .auto_corr_max_ofdm_x1 = 110,
Wey-Yi Guyf3a2a422009-09-11 10:38:11 -0700135 .auto_corr_max_ofdm_mrc_x1 = 232,
136
137 .auto_corr_min_cck = 125,
138 .auto_corr_max_cck = 175,
139 .auto_corr_min_cck_mrc = 160,
140 .auto_corr_max_cck_mrc = 310,
141 .nrg_th_cck = 97,
142 .nrg_th_ofdm = 100,
Wey-Yi Guy55036d62009-10-09 13:20:24 -0700143
144 .barker_corr_th_min = 190,
145 .barker_corr_th_min_mrc = 390,
146 .nrg_th_cca = 62,
Wey-Yi Guyf3a2a422009-09-11 10:38:11 -0700147};
148
149static int iwl6000_hw_set_hw_params(struct iwl_priv *priv)
150{
Wey-Yi Guy88804e22009-10-09 13:20:28 -0700151 if (priv->cfg->mod_params->num_of_queues >= IWL_MIN_NUM_QUEUES &&
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700152 priv->cfg->mod_params->num_of_queues <= IWLAGN_NUM_QUEUES)
Wey-Yi Guy88804e22009-10-09 13:20:28 -0700153 priv->cfg->num_of_queues =
154 priv->cfg->mod_params->num_of_queues;
Wey-Yi Guyf3a2a422009-09-11 10:38:11 -0700155
Wey-Yi Guy88804e22009-10-09 13:20:28 -0700156 priv->hw_params.max_txq_num = priv->cfg->num_of_queues;
Wey-Yi Guyf3a2a422009-09-11 10:38:11 -0700157 priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM;
158 priv->hw_params.scd_bc_tbls_size =
Wey-Yi Guy88804e22009-10-09 13:20:28 -0700159 priv->cfg->num_of_queues *
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700160 sizeof(struct iwlagn_scd_bc_tbl);
Wey-Yi Guyf3a2a422009-09-11 10:38:11 -0700161 priv->hw_params.tfd_size = sizeof(struct iwl_tfd);
162 priv->hw_params.max_stations = IWL5000_STATION_COUNT;
163 priv->hw_params.bcast_sta_id = IWL5000_BROADCAST_ID;
164
165 priv->hw_params.max_data_size = IWL60_RTC_DATA_SIZE;
166 priv->hw_params.max_inst_size = IWL60_RTC_INST_SIZE;
167
168 priv->hw_params.max_bsm_size = 0;
169 priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
170 BIT(IEEE80211_BAND_5GHZ);
171 priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
172
173 priv->hw_params.tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant);
174 priv->hw_params.rx_chains_num = num_of_ant(priv->cfg->valid_rx_ant);
175 priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
176 priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
177
178 if (priv->cfg->ops->lib->temp_ops.set_ct_kill)
179 priv->cfg->ops->lib->temp_ops.set_ct_kill(priv);
180
181 /* Set initial sensitivity parameters */
182 /* Set initial calibration set */
183 priv->hw_params.sens = &iwl6000_sensitivity;
Wey-Yi Guye5177362010-04-19 18:49:40 -0700184 priv->hw_params.calib_init_cfg =
185 BIT(IWL_CALIB_XTAL) |
186 BIT(IWL_CALIB_LO) |
187 BIT(IWL_CALIB_TX_IQ) |
188 BIT(IWL_CALIB_BASE_BAND);
Abhijeet Kolekar07f33f92010-01-22 14:22:47 -0800189
Wey-Yi Guya0ee74c2010-05-06 08:54:10 -0700190 priv->hw_params.beacon_time_tsf_bits = IWLAGN_EXT_BEACON_TIME_POS;
191
Wey-Yi Guye5177362010-04-19 18:49:40 -0700192 return 0;
193}
194
195static int iwl6050_hw_set_hw_params(struct iwl_priv *priv)
196{
197 if (priv->cfg->mod_params->num_of_queues >= IWL_MIN_NUM_QUEUES &&
198 priv->cfg->mod_params->num_of_queues <= IWLAGN_NUM_QUEUES)
199 priv->cfg->num_of_queues =
200 priv->cfg->mod_params->num_of_queues;
201
202 priv->hw_params.max_txq_num = priv->cfg->num_of_queues;
203 priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM;
204 priv->hw_params.scd_bc_tbls_size =
205 priv->cfg->num_of_queues *
206 sizeof(struct iwlagn_scd_bc_tbl);
207 priv->hw_params.tfd_size = sizeof(struct iwl_tfd);
208 priv->hw_params.max_stations = IWL5000_STATION_COUNT;
209 priv->hw_params.bcast_sta_id = IWL5000_BROADCAST_ID;
210
211 priv->hw_params.max_data_size = IWL60_RTC_DATA_SIZE;
212 priv->hw_params.max_inst_size = IWL60_RTC_INST_SIZE;
213
214 priv->hw_params.max_bsm_size = 0;
215 priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
216 BIT(IEEE80211_BAND_5GHZ);
217 priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
218
219 priv->hw_params.tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant);
220 priv->hw_params.rx_chains_num = num_of_ant(priv->cfg->valid_rx_ant);
221 priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
222 priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
223
224 if (priv->cfg->ops->lib->temp_ops.set_ct_kill)
225 priv->cfg->ops->lib->temp_ops.set_ct_kill(priv);
226
227 /* Set initial sensitivity parameters */
228 /* Set initial calibration set */
229 priv->hw_params.sens = &iwl6000_sensitivity;
230 priv->hw_params.calib_init_cfg =
231 BIT(IWL_CALIB_XTAL) |
232 BIT(IWL_CALIB_DC) |
233 BIT(IWL_CALIB_LO) |
234 BIT(IWL_CALIB_TX_IQ) |
235 BIT(IWL_CALIB_BASE_BAND);
Abhijeet Kolekar07f33f92010-01-22 14:22:47 -0800236
Wey-Yi Guya0ee74c2010-05-06 08:54:10 -0700237 priv->hw_params.beacon_time_tsf_bits = IWLAGN_EXT_BEACON_TIME_POS;
238
Wey-Yi Guyf3a2a422009-09-11 10:38:11 -0700239 return 0;
240}
241
Wey-Yi Guy79d07322010-05-06 08:54:11 -0700242static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
243 struct ieee80211_channel_switch *ch_switch)
Wey-Yi Guy4a56e962009-10-23 13:42:29 -0700244{
245 struct iwl6000_channel_switch_cmd cmd;
246 const struct iwl_channel_info *ch_info;
Wey-Yi Guy79d07322010-05-06 08:54:11 -0700247 u32 switch_time_in_usec, ucode_switch_time;
248 u16 ch;
249 u32 tsf_low;
250 u8 switch_count;
251 u16 beacon_interval = le16_to_cpu(priv->rxon_timing.beacon_interval);
252 struct ieee80211_vif *vif = priv->vif;
Wey-Yi Guy4a56e962009-10-23 13:42:29 -0700253 struct iwl_host_cmd hcmd = {
254 .id = REPLY_CHANNEL_SWITCH,
255 .len = sizeof(cmd),
256 .flags = CMD_SIZE_HUGE,
257 .data = &cmd,
258 };
259
Wey-Yi Guy4a56e962009-10-23 13:42:29 -0700260 cmd.band = priv->band == IEEE80211_BAND_2GHZ;
Wey-Yi Guy79d07322010-05-06 08:54:11 -0700261 ch = ieee80211_frequency_to_channel(ch_switch->channel->center_freq);
262 IWL_DEBUG_11H(priv, "channel switch from %u to %u\n",
263 priv->active_rxon.channel, ch);
264 cmd.channel = cpu_to_le16(ch);
Wey-Yi Guy0924e512009-11-06 14:52:54 -0800265 cmd.rxon_flags = priv->staging_rxon.flags;
266 cmd.rxon_filter_flags = priv->staging_rxon.filter_flags;
Wey-Yi Guy79d07322010-05-06 08:54:11 -0700267 switch_count = ch_switch->count;
268 tsf_low = ch_switch->timestamp & 0x0ffffffff;
269 /*
270 * calculate the ucode channel switch time
271 * adding TSF as one of the factor for when to switch
272 */
273 if ((priv->ucode_beacon_time > tsf_low) && beacon_interval) {
274 if (switch_count > ((priv->ucode_beacon_time - tsf_low) /
275 beacon_interval)) {
276 switch_count -= (priv->ucode_beacon_time -
277 tsf_low) / beacon_interval;
278 } else
279 switch_count = 0;
280 }
281 if (switch_count <= 1)
282 cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time);
283 else {
284 switch_time_in_usec =
285 vif->bss_conf.beacon_int * switch_count * TIME_UNIT;
286 ucode_switch_time = iwl_usecs_to_beacons(priv,
287 switch_time_in_usec,
288 beacon_interval);
289 cmd.switch_time = iwl_add_beacon_time(priv,
290 priv->ucode_beacon_time,
291 ucode_switch_time,
292 beacon_interval);
293 }
294 IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n",
295 cmd.switch_time);
296 ch_info = iwl_get_channel_info(priv, priv->band, ch);
Wey-Yi Guy4a56e962009-10-23 13:42:29 -0700297 if (ch_info)
298 cmd.expect_beacon = is_channel_radar(ch_info);
299 else {
300 IWL_ERR(priv, "invalid channel switch from %u to %u\n",
Wey-Yi Guy79d07322010-05-06 08:54:11 -0700301 priv->active_rxon.channel, ch);
Wey-Yi Guy4a56e962009-10-23 13:42:29 -0700302 return -EFAULT;
303 }
Wey-Yi Guy79d07322010-05-06 08:54:11 -0700304 priv->switch_rxon.channel = cmd.channel;
Wey-Yi Guy0924e512009-11-06 14:52:54 -0800305 priv->switch_rxon.switch_in_progress = true;
Wey-Yi Guy4a56e962009-10-23 13:42:29 -0700306
307 return iwl_send_cmd_sync(priv, &hcmd);
308}
309
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700310static struct iwl_lib_ops iwl6000_lib = {
Wey-Yi Guyf3a2a422009-09-11 10:38:11 -0700311 .set_hw_params = iwl6000_hw_set_hw_params,
Wey-Yi Guyb305a082010-03-16 17:41:22 -0700312 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
313 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
314 .txq_set_sched = iwlagn_txq_set_sched,
315 .txq_agg_enable = iwlagn_txq_agg_enable,
316 .txq_agg_disable = iwlagn_txq_agg_disable,
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700317 .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
318 .txq_free_tfd = iwl_hw_txq_free_tfd,
319 .txq_init = iwl_hw_tx_queue_init,
Wey-Yi Guye04ed0a2010-03-16 17:47:58 -0700320 .rx_handler_setup = iwlagn_rx_handler_setup,
321 .setup_deferred_work = iwlagn_setup_deferred_work,
322 .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
Wey-Yi Guy81b81762010-03-16 10:23:30 -0700323 .load_ucode = iwlagn_load_ucode,
Reinette Chatreb7a79402009-09-25 14:24:23 -0700324 .dump_nic_event_log = iwl_dump_nic_event_log,
325 .dump_nic_error_log = iwl_dump_nic_error_log,
Wey-Yi Guy696bdee2009-12-10 14:37:25 -0800326 .dump_csr = iwl_dump_csr,
Wey-Yi Guy1b3eb822010-01-15 13:43:39 -0800327 .dump_fh = iwl_dump_fh,
Wey-Yi Guy741a6262010-03-16 12:37:24 -0700328 .init_alive_start = iwlagn_init_alive_start,
329 .alive_notify = iwlagn_alive_notify,
Wey-Yi Guye04ed0a2010-03-16 17:47:58 -0700330 .send_tx_power = iwlagn_send_tx_power,
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700331 .update_chain_flags = iwl_update_chain_flags,
Wey-Yi Guy4a56e962009-10-23 13:42:29 -0700332 .set_channel_switch = iwl6000_hw_channel_switch,
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700333 .apm_ops = {
Ben Cahillfadb3582009-10-23 13:42:21 -0700334 .init = iwl_apm_init,
Abhijeet Kolekard68b6032009-10-02 13:44:04 -0700335 .stop = iwl_apm_stop,
Wey-Yi Guy65b79982009-07-31 14:28:07 -0700336 .config = iwl6000_nic_config,
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700337 .set_pwr_src = iwl_set_pwr_src,
338 },
339 .eeprom_ops = {
340 .regulatory_bands = {
Wey-Yi Guye04ed0a2010-03-16 17:47:58 -0700341 EEPROM_REG_BAND_1_CHANNELS,
342 EEPROM_REG_BAND_2_CHANNELS,
343 EEPROM_REG_BAND_3_CHANNELS,
344 EEPROM_REG_BAND_4_CHANNELS,
345 EEPROM_REG_BAND_5_CHANNELS,
Shanyu Zhaof2fa1b02010-04-07 18:37:52 -0700346 EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
Wey-Yi Guye04ed0a2010-03-16 17:47:58 -0700347 EEPROM_REG_BAND_52_HT40_CHANNELS
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700348 },
349 .verify_signature = iwlcore_eeprom_verify_signature,
350 .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
351 .release_semaphore = iwlcore_eeprom_release_semaphore,
Wey-Yi Guye04ed0a2010-03-16 17:47:58 -0700352 .calib_version = iwlagn_eeprom_calib_version,
353 .query_addr = iwlagn_eeprom_query_addr,
Wey-Yi Guyab9fd1b2009-08-21 13:34:23 -0700354 .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower,
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700355 },
356 .post_associate = iwl_post_associate,
357 .isr = iwl_isr_ict,
358 .config_ap = iwl_config_ap,
359 .temp_ops = {
Wey-Yi Guye04ed0a2010-03-16 17:47:58 -0700360 .temperature = iwlagn_temperature,
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700361 .set_ct_kill = iwl6000_set_ct_threshold,
362 },
Johannes Berg1fa61b22010-04-28 08:44:52 -0700363 .manage_ibss_station = iwlagn_manage_ibss_station,
Abhijeet Kolekarb8c76262010-04-08 15:29:07 -0700364 .debugfs_ops = {
365 .rx_stats_read = iwl_ucode_rx_stats_read,
366 .tx_stats_read = iwl_ucode_tx_stats_read,
367 .general_stats_read = iwl_ucode_general_stats_read,
368 },
Wey-Yi Guyb74e31a2010-03-01 17:23:50 -0800369 .recover_from_tx_stall = iwl_bg_monitor_recover,
Wey-Yi Guyfa8f1302010-03-05 14:22:46 -0800370 .check_plcp_health = iwl_good_plcp_health,
371 .check_ack_health = iwl_good_ack_health,
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700372};
373
Emese Revfy45d5d802009-12-14 00:59:53 +0100374static const struct iwl_ops iwl6000_ops = {
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700375 .lib = &iwl6000_lib,
Wey-Yi Guy7dc77db2010-03-16 10:23:31 -0700376 .hcmd = &iwlagn_hcmd,
377 .utils = &iwlagn_hcmd_utils,
Johannes Berge932a602009-10-02 13:44:03 -0700378 .led = &iwlagn_led_ops,
Jay Sternberg29f35c12009-01-29 11:09:16 -0800379};
380
Shanyu Zhao18089722010-05-06 10:15:21 -0700381static void do_not_send_bt_config(struct iwl_priv *priv)
382{
383}
384
385static struct iwl_hcmd_ops iwl6000g2b_hcmd = {
386 .rxon_assoc = iwlagn_send_rxon_assoc,
387 .commit_rxon = iwl_commit_rxon,
388 .set_rxon_chain = iwl_set_rxon_chain,
389 .set_tx_ant = iwlagn_send_tx_ant_config,
390 .send_bt_config = do_not_send_bt_config,
391};
392
393static const struct iwl_ops iwl6000g2b_ops = {
394 .lib = &iwl6000_lib,
395 .hcmd = &iwl6000g2b_hcmd,
396 .utils = &iwlagn_hcmd_utils,
397 .led = &iwlagn_led_ops,
398};
399
Abhijeet Kolekard5755932010-02-18 22:03:05 -0800400static struct iwl_lib_ops iwl6050_lib = {
Wey-Yi Guye5177362010-04-19 18:49:40 -0700401 .set_hw_params = iwl6050_hw_set_hw_params,
Wey-Yi Guyb305a082010-03-16 17:41:22 -0700402 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
403 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
404 .txq_set_sched = iwlagn_txq_set_sched,
405 .txq_agg_enable = iwlagn_txq_agg_enable,
406 .txq_agg_disable = iwlagn_txq_agg_disable,
Abhijeet Kolekard5755932010-02-18 22:03:05 -0800407 .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
408 .txq_free_tfd = iwl_hw_txq_free_tfd,
409 .txq_init = iwl_hw_tx_queue_init,
Wey-Yi Guye04ed0a2010-03-16 17:47:58 -0700410 .rx_handler_setup = iwlagn_rx_handler_setup,
411 .setup_deferred_work = iwlagn_setup_deferred_work,
412 .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
Wey-Yi Guy81b81762010-03-16 10:23:30 -0700413 .load_ucode = iwlagn_load_ucode,
Abhijeet Kolekard5755932010-02-18 22:03:05 -0800414 .dump_nic_event_log = iwl_dump_nic_event_log,
415 .dump_nic_error_log = iwl_dump_nic_error_log,
416 .dump_csr = iwl_dump_csr,
417 .dump_fh = iwl_dump_fh,
Wey-Yi Guy741a6262010-03-16 12:37:24 -0700418 .init_alive_start = iwlagn_init_alive_start,
419 .alive_notify = iwlagn_alive_notify,
Wey-Yi Guye04ed0a2010-03-16 17:47:58 -0700420 .send_tx_power = iwlagn_send_tx_power,
Abhijeet Kolekard5755932010-02-18 22:03:05 -0800421 .update_chain_flags = iwl_update_chain_flags,
422 .set_channel_switch = iwl6000_hw_channel_switch,
423 .apm_ops = {
424 .init = iwl_apm_init,
425 .stop = iwl_apm_stop,
426 .config = iwl6000_nic_config,
427 .set_pwr_src = iwl_set_pwr_src,
428 },
429 .eeprom_ops = {
430 .regulatory_bands = {
Wey-Yi Guye04ed0a2010-03-16 17:47:58 -0700431 EEPROM_REG_BAND_1_CHANNELS,
432 EEPROM_REG_BAND_2_CHANNELS,
433 EEPROM_REG_BAND_3_CHANNELS,
434 EEPROM_REG_BAND_4_CHANNELS,
435 EEPROM_REG_BAND_5_CHANNELS,
Shanyu Zhaof2fa1b02010-04-07 18:37:52 -0700436 EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
Wey-Yi Guye04ed0a2010-03-16 17:47:58 -0700437 EEPROM_REG_BAND_52_HT40_CHANNELS
Abhijeet Kolekard5755932010-02-18 22:03:05 -0800438 },
439 .verify_signature = iwlcore_eeprom_verify_signature,
440 .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
441 .release_semaphore = iwlcore_eeprom_release_semaphore,
Wey-Yi Guye04ed0a2010-03-16 17:47:58 -0700442 .calib_version = iwlagn_eeprom_calib_version,
443 .query_addr = iwlagn_eeprom_query_addr,
Abhijeet Kolekard5755932010-02-18 22:03:05 -0800444 .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower,
445 },
446 .post_associate = iwl_post_associate,
447 .isr = iwl_isr_ict,
448 .config_ap = iwl_config_ap,
449 .temp_ops = {
Wey-Yi Guye04ed0a2010-03-16 17:47:58 -0700450 .temperature = iwlagn_temperature,
Abhijeet Kolekard5755932010-02-18 22:03:05 -0800451 .set_ct_kill = iwl6000_set_ct_threshold,
452 .set_calib_version = iwl6050_set_calib_version,
453 },
Johannes Berg1fa61b22010-04-28 08:44:52 -0700454 .manage_ibss_station = iwlagn_manage_ibss_station,
Abhijeet Kolekarb8c76262010-04-08 15:29:07 -0700455 .debugfs_ops = {
456 .rx_stats_read = iwl_ucode_rx_stats_read,
457 .tx_stats_read = iwl_ucode_tx_stats_read,
458 .general_stats_read = iwl_ucode_general_stats_read,
459 },
Wey-Yi Guyb74e31a2010-03-01 17:23:50 -0800460 .recover_from_tx_stall = iwl_bg_monitor_recover,
Wey-Yi Guyfa8f1302010-03-05 14:22:46 -0800461 .check_plcp_health = iwl_good_plcp_health,
462 .check_ack_health = iwl_good_ack_health,
Abhijeet Kolekard5755932010-02-18 22:03:05 -0800463};
464
465static const struct iwl_ops iwl6050_ops = {
Abhijeet Kolekard5755932010-02-18 22:03:05 -0800466 .lib = &iwl6050_lib,
Wey-Yi Guy7dc77db2010-03-16 10:23:31 -0700467 .hcmd = &iwlagn_hcmd,
468 .utils = &iwlagn_hcmd_utils,
Abhijeet Kolekard5755932010-02-18 22:03:05 -0800469 .led = &iwlagn_led_ops,
470};
471
Shanyu Zhao95b13012010-04-21 11:46:33 -0700472
473struct iwl_cfg iwl6000g2a_2agn_cfg = {
474 .name = "6000 Series 2x2 AGN Gen2a",
475 .fw_name_pre = IWL6000G2A_FW_PRE,
Shanyu Zhao4b3e8062010-04-07 18:06:36 -0700476 .ucode_api_max = IWL6000G2_UCODE_API_MAX,
477 .ucode_api_min = IWL6000G2_UCODE_API_MIN,
Jay Sternberg0b5af202010-03-17 16:16:12 -0700478 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
479 .ops = &iwl6000_ops,
480 .eeprom_size = OTP_LOW_IMAGE_SIZE,
Shanyu Zhao4b3e8062010-04-07 18:06:36 -0700481 .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
482 .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
Jay Sternberg0b5af202010-03-17 16:16:12 -0700483 .num_of_queues = IWLAGN_NUM_QUEUES,
484 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
485 .mod_params = &iwlagn_mod_params,
486 .valid_tx_ant = ANT_AB,
487 .valid_rx_ant = ANT_AB,
488 .pll_cfg_val = 0,
489 .set_l0s = true,
490 .use_bsm = false,
Wey-Yi Guy33e6f812010-04-09 09:36:11 -0700491 .pa_type = IWL_PA_SYSTEM,
Jay Sternberg0b5af202010-03-17 16:16:12 -0700492 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
493 .shadow_ram_support = true,
494 .ht_greenfield_support = true,
495 .led_compensation = 51,
496 .use_rts_for_ht = true, /* use rts/cts protection */
497 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
498 .supports_idle = true,
499 .adv_thermal_throttle = true,
500 .support_ct_kill_exit = true,
501 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
502 .chain_noise_scale = 1000,
503 .monitor_recover_period = IWL_MONITORING_PERIOD,
Shanyu Zhao95b13012010-04-21 11:46:33 -0700504 .max_event_log_size = 512,
Wey-Yi Guy6e5c8002010-04-27 14:00:28 -0700505 .ucode_tracing = true,
Wey-Yi Guy65d1f892010-04-25 15:41:43 -0700506 .sensitivity_calib_by_driver = true,
507 .chain_noise_calib_by_driver = true,
Jay Sternberg0b5af202010-03-17 16:16:12 -0700508};
509
Shanyu Zhao18089722010-05-06 10:15:21 -0700510struct iwl_cfg iwl6000g2a_2abg_cfg = {
511 .name = "6000 Series 2x2 ABG Gen2a",
512 .fw_name_pre = IWL6000G2A_FW_PRE,
513 .ucode_api_max = IWL6000G2_UCODE_API_MAX,
514 .ucode_api_min = IWL6000G2_UCODE_API_MIN,
515 .sku = IWL_SKU_A|IWL_SKU_G,
516 .ops = &iwl6000_ops,
517 .eeprom_size = OTP_LOW_IMAGE_SIZE,
518 .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
519 .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
520 .num_of_queues = IWLAGN_NUM_QUEUES,
521 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
522 .mod_params = &iwlagn_mod_params,
523 .valid_tx_ant = ANT_AB,
524 .valid_rx_ant = ANT_AB,
525 .pll_cfg_val = 0,
526 .set_l0s = true,
527 .use_bsm = false,
528 .pa_type = IWL_PA_SYSTEM,
529 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
530 .shadow_ram_support = true,
531 .led_compensation = 51,
532 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
533 .supports_idle = true,
534 .adv_thermal_throttle = true,
535 .support_ct_kill_exit = true,
536 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
537 .chain_noise_scale = 1000,
538 .monitor_recover_period = IWL_MONITORING_PERIOD,
539 .max_event_log_size = 512,
540};
541
542struct iwl_cfg iwl6000g2a_2bg_cfg = {
543 .name = "6000 Series 2x2 BG Gen2a",
544 .fw_name_pre = IWL6000G2A_FW_PRE,
545 .ucode_api_max = IWL6000G2_UCODE_API_MAX,
546 .ucode_api_min = IWL6000G2_UCODE_API_MIN,
547 .sku = IWL_SKU_G,
548 .ops = &iwl6000_ops,
549 .eeprom_size = OTP_LOW_IMAGE_SIZE,
550 .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
551 .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
552 .num_of_queues = IWLAGN_NUM_QUEUES,
553 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
554 .mod_params = &iwlagn_mod_params,
555 .valid_tx_ant = ANT_AB,
556 .valid_rx_ant = ANT_AB,
557 .pll_cfg_val = 0,
558 .set_l0s = true,
559 .use_bsm = false,
560 .pa_type = IWL_PA_SYSTEM,
561 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
562 .shadow_ram_support = true,
563 .led_compensation = 51,
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};
573
574struct iwl_cfg iwl6000g2b_2agn_cfg = {
575 .name = "6000 Series 2x2 AGN Gen2b",
576 .fw_name_pre = IWL6000G2B_FW_PRE,
577 .ucode_api_max = IWL6000G2_UCODE_API_MAX,
578 .ucode_api_min = IWL6000G2_UCODE_API_MIN,
579 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
580 .ops = &iwl6000g2b_ops,
581 .eeprom_size = OTP_LOW_IMAGE_SIZE,
582 .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
583 .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
584 .num_of_queues = IWLAGN_NUM_QUEUES,
585 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
586 .mod_params = &iwlagn_mod_params,
587 .valid_tx_ant = ANT_AB,
588 .valid_rx_ant = ANT_AB,
589 .pll_cfg_val = 0,
590 .set_l0s = true,
591 .use_bsm = false,
592 .pa_type = IWL_PA_SYSTEM,
593 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
594 .shadow_ram_support = true,
595 .ht_greenfield_support = true,
596 .led_compensation = 51,
597 .use_rts_for_ht = true, /* use rts/cts protection */
598 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
599 .supports_idle = true,
600 .adv_thermal_throttle = true,
601 .support_ct_kill_exit = true,
602 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
603 .chain_noise_scale = 1000,
604 .monitor_recover_period = IWL_MONITORING_PERIOD,
605 .max_event_log_size = 512,
606};
607
608struct iwl_cfg iwl6000g2b_2abg_cfg = {
609 .name = "6000 Series 2x2 ABG Gen2b",
610 .fw_name_pre = IWL6000G2B_FW_PRE,
611 .ucode_api_max = IWL6000G2_UCODE_API_MAX,
612 .ucode_api_min = IWL6000G2_UCODE_API_MIN,
613 .sku = IWL_SKU_A|IWL_SKU_G,
614 .ops = &iwl6000g2b_ops,
615 .eeprom_size = OTP_LOW_IMAGE_SIZE,
616 .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
617 .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
618 .num_of_queues = IWLAGN_NUM_QUEUES,
619 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
620 .mod_params = &iwlagn_mod_params,
621 .valid_tx_ant = ANT_AB,
622 .valid_rx_ant = ANT_AB,
623 .pll_cfg_val = 0,
624 .set_l0s = true,
625 .use_bsm = false,
626 .pa_type = IWL_PA_SYSTEM,
627 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
628 .shadow_ram_support = true,
629 .led_compensation = 51,
630 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
631 .supports_idle = true,
632 .adv_thermal_throttle = true,
633 .support_ct_kill_exit = true,
634 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
635 .chain_noise_scale = 1000,
636 .monitor_recover_period = IWL_MONITORING_PERIOD,
637 .max_event_log_size = 512,
638};
639
Shanyu Zhao9f6e1ba2010-05-11 15:21:54 -0700640struct iwl_cfg iwl6000g2b_2bgn_cfg = {
641 .name = "6000 Series 2x2 BGN Gen2b",
642 .fw_name_pre = IWL6000G2B_FW_PRE,
643 .ucode_api_max = IWL6000G2_UCODE_API_MAX,
644 .ucode_api_min = IWL6000G2_UCODE_API_MIN,
645 .sku = IWL_SKU_G|IWL_SKU_N,
646 .ops = &iwl6000g2b_ops,
647 .eeprom_size = OTP_LOW_IMAGE_SIZE,
648 .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
649 .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
650 .num_of_queues = IWLAGN_NUM_QUEUES,
651 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
652 .mod_params = &iwlagn_mod_params,
653 .valid_tx_ant = ANT_AB,
654 .valid_rx_ant = ANT_AB,
655 .pll_cfg_val = 0,
656 .set_l0s = true,
657 .use_bsm = false,
658 .pa_type = IWL_PA_SYSTEM,
659 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
660 .shadow_ram_support = true,
661 .ht_greenfield_support = true,
662 .led_compensation = 51,
663 .use_rts_for_ht = true, /* use rts/cts protection */
664 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
665 .supports_idle = true,
666 .adv_thermal_throttle = true,
667 .support_ct_kill_exit = true,
668 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
669 .chain_noise_scale = 1000,
670 .monitor_recover_period = IWL_MONITORING_PERIOD,
671 .max_event_log_size = 512,
672};
673
Shanyu Zhao18089722010-05-06 10:15:21 -0700674struct iwl_cfg iwl6000g2b_2bg_cfg = {
675 .name = "6000 Series 2x2 BG Gen2b",
676 .fw_name_pre = IWL6000G2B_FW_PRE,
677 .ucode_api_max = IWL6000G2_UCODE_API_MAX,
678 .ucode_api_min = IWL6000G2_UCODE_API_MIN,
679 .sku = IWL_SKU_G,
680 .ops = &iwl6000g2b_ops,
681 .eeprom_size = OTP_LOW_IMAGE_SIZE,
682 .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
683 .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
684 .num_of_queues = IWLAGN_NUM_QUEUES,
685 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
686 .mod_params = &iwlagn_mod_params,
687 .valid_tx_ant = ANT_AB,
688 .valid_rx_ant = ANT_AB,
689 .pll_cfg_val = 0,
690 .set_l0s = true,
691 .use_bsm = false,
692 .pa_type = IWL_PA_SYSTEM,
693 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
694 .shadow_ram_support = true,
695 .led_compensation = 51,
696 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
697 .supports_idle = true,
698 .adv_thermal_throttle = true,
699 .support_ct_kill_exit = true,
700 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
701 .chain_noise_scale = 1000,
702 .monitor_recover_period = IWL_MONITORING_PERIOD,
703 .max_event_log_size = 512,
704};
705
706struct iwl_cfg iwl6000g2b_bgn_cfg = {
707 .name = "6000 Series 1x2 BGN Gen2b",
708 .fw_name_pre = IWL6000G2B_FW_PRE,
709 .ucode_api_max = IWL6000G2_UCODE_API_MAX,
710 .ucode_api_min = IWL6000G2_UCODE_API_MIN,
711 .sku = IWL_SKU_G|IWL_SKU_N,
712 .ops = &iwl6000g2b_ops,
713 .eeprom_size = OTP_LOW_IMAGE_SIZE,
714 .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
715 .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
716 .num_of_queues = IWLAGN_NUM_QUEUES,
717 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
718 .mod_params = &iwlagn_mod_params,
719 .valid_tx_ant = ANT_A,
720 .valid_rx_ant = ANT_AB,
721 .pll_cfg_val = 0,
722 .set_l0s = true,
723 .use_bsm = false,
724 .pa_type = IWL_PA_SYSTEM,
725 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
726 .shadow_ram_support = true,
727 .ht_greenfield_support = true,
728 .led_compensation = 51,
729 .use_rts_for_ht = true, /* use rts/cts protection */
730 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
731 .supports_idle = true,
732 .adv_thermal_throttle = true,
733 .support_ct_kill_exit = true,
734 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
735 .chain_noise_scale = 1000,
736 .monitor_recover_period = IWL_MONITORING_PERIOD,
737 .max_event_log_size = 512,
738};
739
740struct iwl_cfg iwl6000g2b_bg_cfg = {
741 .name = "6000 Series 1x2 BG Gen2b",
742 .fw_name_pre = IWL6000G2B_FW_PRE,
743 .ucode_api_max = IWL6000G2_UCODE_API_MAX,
744 .ucode_api_min = IWL6000G2_UCODE_API_MIN,
745 .sku = IWL_SKU_G,
746 .ops = &iwl6000g2b_ops,
747 .eeprom_size = OTP_LOW_IMAGE_SIZE,
748 .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
749 .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
750 .num_of_queues = IWLAGN_NUM_QUEUES,
751 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
752 .mod_params = &iwlagn_mod_params,
753 .valid_tx_ant = ANT_A,
754 .valid_rx_ant = ANT_AB,
755 .pll_cfg_val = 0,
756 .set_l0s = true,
757 .use_bsm = false,
758 .pa_type = IWL_PA_SYSTEM,
759 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
760 .shadow_ram_support = true,
761 .led_compensation = 51,
762 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
763 .supports_idle = true,
764 .adv_thermal_throttle = true,
765 .support_ct_kill_exit = true,
766 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
767 .chain_noise_scale = 1000,
768 .monitor_recover_period = IWL_MONITORING_PERIOD,
769 .max_event_log_size = 512,
770};
771
Shanyu Zhao95b13012010-04-21 11:46:33 -0700772/*
773 * "i": Internal configuration, use internal Power Amplifier
774 */
Wey-Yi Guy65b79982009-07-31 14:28:07 -0700775struct iwl_cfg iwl6000i_2agn_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800776 .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
Wey-Yi Guy65b79982009-07-31 14:28:07 -0700777 .fw_name_pre = IWL6000_FW_PRE,
778 .ucode_api_max = IWL6000_UCODE_API_MAX,
779 .ucode_api_min = IWL6000_UCODE_API_MIN,
780 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
781 .ops = &iwl6000_ops,
Wey-Yi Guy415e4992009-08-13 13:30:54 -0700782 .eeprom_size = OTP_LOW_IMAGE_SIZE,
Wey-Yi Guy1f4b9662009-09-17 10:43:46 -0700783 .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
Wey-Yi Guy00e70592010-03-16 12:37:26 -0700784 .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700785 .num_of_queues = IWLAGN_NUM_QUEUES,
786 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
Wey-Yi Guy348ee7c2010-03-16 12:37:27 -0700787 .mod_params = &iwlagn_mod_params,
Wey-Yi Guy65b79982009-07-31 14:28:07 -0700788 .valid_tx_ant = ANT_BC,
789 .valid_rx_ant = ANT_BC,
Ben Cahillfadb3582009-10-23 13:42:21 -0700790 .pll_cfg_val = 0,
Ben Cahilla6c5c732009-10-30 14:36:07 -0700791 .set_l0s = true,
Ben Cahillfadb3582009-10-23 13:42:21 -0700792 .use_bsm = false,
Wey-Yi Guy65b79982009-07-31 14:28:07 -0700793 .pa_type = IWL_PA_INTERNAL,
Wey-Yi Guy415e4992009-08-13 13:30:54 -0700794 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
795 .shadow_ram_support = true,
Daniel C Halperinb2617932009-08-13 13:30:59 -0700796 .ht_greenfield_support = true,
Wey-Yi Guyf2d0d0e2009-09-11 10:38:14 -0700797 .led_compensation = 51,
Wey-Yi Guy47eef9b2009-09-17 10:43:44 -0700798 .use_rts_for_ht = true, /* use rts/cts protection */
Wey-Yi Guyd8c07e72009-09-25 14:24:26 -0700799 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
Johannes Berg78f5fb72009-09-25 14:24:27 -0700800 .supports_idle = true,
Wey-Yi Guy6047b4f2009-10-23 13:42:27 -0700801 .adv_thermal_throttle = true,
Wey-Yi Guy480e8402009-10-23 13:42:28 -0700802 .support_ct_kill_exit = true,
Trieu 'Andrew' Nguyen3e4fb5f2010-01-22 14:22:46 -0800803 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
Ben Cahilld4fe5ac2010-02-05 11:33:46 -0800804 .chain_noise_scale = 1000,
Wey-Yi Guyb74e31a2010-03-01 17:23:50 -0800805 .monitor_recover_period = IWL_MONITORING_PERIOD,
Wey-Yi Guy678b3852010-03-26 12:54:37 -0700806 .max_event_log_size = 1024,
Wey-Yi Guy6e5c8002010-04-27 14:00:28 -0700807 .ucode_tracing = true,
Wey-Yi Guy65d1f892010-04-25 15:41:43 -0700808 .sensitivity_calib_by_driver = true,
809 .chain_noise_calib_by_driver = true,
Jay Sternberge1228372009-01-19 15:30:34 -0800810};
811
Wey-Yi Guy5953a622009-09-17 10:43:53 -0700812struct iwl_cfg iwl6000i_2abg_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800813 .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
Wey-Yi Guy5953a622009-09-17 10:43:53 -0700814 .fw_name_pre = IWL6000_FW_PRE,
815 .ucode_api_max = IWL6000_UCODE_API_MAX,
816 .ucode_api_min = IWL6000_UCODE_API_MIN,
817 .sku = IWL_SKU_A|IWL_SKU_G,
818 .ops = &iwl6000_ops,
819 .eeprom_size = OTP_LOW_IMAGE_SIZE,
820 .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
Wey-Yi Guy00e70592010-03-16 12:37:26 -0700821 .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700822 .num_of_queues = IWLAGN_NUM_QUEUES,
823 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
Wey-Yi Guy348ee7c2010-03-16 12:37:27 -0700824 .mod_params = &iwlagn_mod_params,
Wey-Yi Guy5953a622009-09-17 10:43:53 -0700825 .valid_tx_ant = ANT_BC,
826 .valid_rx_ant = ANT_BC,
Ben Cahillfadb3582009-10-23 13:42:21 -0700827 .pll_cfg_val = 0,
Ben Cahilla6c5c732009-10-30 14:36:07 -0700828 .set_l0s = true,
Ben Cahillfadb3582009-10-23 13:42:21 -0700829 .use_bsm = false,
Wey-Yi Guy5953a622009-09-17 10:43:53 -0700830 .pa_type = IWL_PA_INTERNAL,
831 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
832 .shadow_ram_support = true,
Wey-Yi Guy5953a622009-09-17 10:43:53 -0700833 .led_compensation = 51,
Wey-Yi Guyd8c07e72009-09-25 14:24:26 -0700834 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
Johannes Berg78f5fb72009-09-25 14:24:27 -0700835 .supports_idle = true,
Wey-Yi Guy6047b4f2009-10-23 13:42:27 -0700836 .adv_thermal_throttle = true,
Wey-Yi Guy480e8402009-10-23 13:42:28 -0700837 .support_ct_kill_exit = true,
Trieu 'Andrew' Nguyen3e4fb5f2010-01-22 14:22:46 -0800838 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
Ben Cahilld4fe5ac2010-02-05 11:33:46 -0800839 .chain_noise_scale = 1000,
Wey-Yi Guyb74e31a2010-03-01 17:23:50 -0800840 .monitor_recover_period = IWL_MONITORING_PERIOD,
Wey-Yi Guy678b3852010-03-26 12:54:37 -0700841 .max_event_log_size = 1024,
Wey-Yi Guy6e5c8002010-04-27 14:00:28 -0700842 .ucode_tracing = true,
Wey-Yi Guy65d1f892010-04-25 15:41:43 -0700843 .sensitivity_calib_by_driver = true,
844 .chain_noise_calib_by_driver = true,
Wey-Yi Guy5953a622009-09-17 10:43:53 -0700845};
846
847struct iwl_cfg iwl6000i_2bg_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800848 .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
Wey-Yi Guy5953a622009-09-17 10:43:53 -0700849 .fw_name_pre = IWL6000_FW_PRE,
850 .ucode_api_max = IWL6000_UCODE_API_MAX,
851 .ucode_api_min = IWL6000_UCODE_API_MIN,
852 .sku = IWL_SKU_G,
853 .ops = &iwl6000_ops,
854 .eeprom_size = OTP_LOW_IMAGE_SIZE,
855 .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
Wey-Yi Guy00e70592010-03-16 12:37:26 -0700856 .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700857 .num_of_queues = IWLAGN_NUM_QUEUES,
858 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
Wey-Yi Guy348ee7c2010-03-16 12:37:27 -0700859 .mod_params = &iwlagn_mod_params,
Wey-Yi Guy5953a622009-09-17 10:43:53 -0700860 .valid_tx_ant = ANT_BC,
861 .valid_rx_ant = ANT_BC,
Ben Cahillfadb3582009-10-23 13:42:21 -0700862 .pll_cfg_val = 0,
Ben Cahilla6c5c732009-10-30 14:36:07 -0700863 .set_l0s = true,
Ben Cahillfadb3582009-10-23 13:42:21 -0700864 .use_bsm = false,
Wey-Yi Guy5953a622009-09-17 10:43:53 -0700865 .pa_type = IWL_PA_INTERNAL,
866 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
867 .shadow_ram_support = true,
Wey-Yi Guy5953a622009-09-17 10:43:53 -0700868 .led_compensation = 51,
Wey-Yi Guyd8c07e72009-09-25 14:24:26 -0700869 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
Johannes Berg78f5fb72009-09-25 14:24:27 -0700870 .supports_idle = true,
Wey-Yi Guy6047b4f2009-10-23 13:42:27 -0700871 .adv_thermal_throttle = true,
Wey-Yi Guy480e8402009-10-23 13:42:28 -0700872 .support_ct_kill_exit = true,
Trieu 'Andrew' Nguyen3e4fb5f2010-01-22 14:22:46 -0800873 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
Ben Cahilld4fe5ac2010-02-05 11:33:46 -0800874 .chain_noise_scale = 1000,
Wey-Yi Guyb74e31a2010-03-01 17:23:50 -0800875 .monitor_recover_period = IWL_MONITORING_PERIOD,
Wey-Yi Guy678b3852010-03-26 12:54:37 -0700876 .max_event_log_size = 1024,
Wey-Yi Guy6e5c8002010-04-27 14:00:28 -0700877 .ucode_tracing = true,
Wey-Yi Guy65d1f892010-04-25 15:41:43 -0700878 .sensitivity_calib_by_driver = true,
879 .chain_noise_calib_by_driver = true,
Wey-Yi Guy5953a622009-09-17 10:43:53 -0700880};
881
Jay Sternberge1228372009-01-19 15:30:34 -0800882struct iwl_cfg iwl6050_2agn_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800883 .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
Jay Sternberge1228372009-01-19 15:30:34 -0800884 .fw_name_pre = IWL6050_FW_PRE,
885 .ucode_api_max = IWL6050_UCODE_API_MAX,
886 .ucode_api_min = IWL6050_UCODE_API_MIN,
887 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
Abhijeet Kolekard5755932010-02-18 22:03:05 -0800888 .ops = &iwl6050_ops,
Wey-Yi Guy415e4992009-08-13 13:30:54 -0700889 .eeprom_size = OTP_LOW_IMAGE_SIZE,
Wey-Yi Guy32b7e242009-10-16 14:25:51 -0700890 .eeprom_ver = EEPROM_6050_EEPROM_VERSION,
Wey-Yi Guy00e70592010-03-16 12:37:26 -0700891 .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700892 .num_of_queues = IWLAGN_NUM_QUEUES,
893 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
Wey-Yi Guy348ee7c2010-03-16 12:37:27 -0700894 .mod_params = &iwlagn_mod_params,
Jay Sternberg542cc792009-05-08 13:44:46 -0700895 .valid_tx_ant = ANT_AB,
896 .valid_rx_ant = ANT_AB,
Ben Cahillfadb3582009-10-23 13:42:21 -0700897 .pll_cfg_val = 0,
Ben Cahilla6c5c732009-10-30 14:36:07 -0700898 .set_l0s = true,
Ben Cahillfadb3582009-10-23 13:42:21 -0700899 .use_bsm = false,
Wey-Yi Guy65b79982009-07-31 14:28:07 -0700900 .pa_type = IWL_PA_SYSTEM,
Wey-Yi Guy3ab312a2009-10-16 14:25:52 -0700901 .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
Wey-Yi Guy415e4992009-08-13 13:30:54 -0700902 .shadow_ram_support = true,
Daniel C Halperinb2617932009-08-13 13:30:59 -0700903 .ht_greenfield_support = true,
Wey-Yi Guyf2d0d0e2009-09-11 10:38:14 -0700904 .led_compensation = 51,
Wey-Yi Guy47eef9b2009-09-17 10:43:44 -0700905 .use_rts_for_ht = true, /* use rts/cts protection */
Wey-Yi Guyd8c07e72009-09-25 14:24:26 -0700906 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
Johannes Berg78f5fb72009-09-25 14:24:27 -0700907 .supports_idle = true,
Wey-Yi Guy6047b4f2009-10-23 13:42:27 -0700908 .adv_thermal_throttle = true,
Wey-Yi Guy480e8402009-10-23 13:42:28 -0700909 .support_ct_kill_exit = true,
Trieu 'Andrew' Nguyen3e4fb5f2010-01-22 14:22:46 -0800910 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
Ben Cahilld4fe5ac2010-02-05 11:33:46 -0800911 .chain_noise_scale = 1500,
Wey-Yi Guyb74e31a2010-03-01 17:23:50 -0800912 .monitor_recover_period = IWL_MONITORING_PERIOD,
Wey-Yi Guy678b3852010-03-26 12:54:37 -0700913 .max_event_log_size = 1024,
Wey-Yi Guy6e5c8002010-04-27 14:00:28 -0700914 .ucode_tracing = true,
Wey-Yi Guy65d1f892010-04-25 15:41:43 -0700915 .sensitivity_calib_by_driver = true,
916 .chain_noise_calib_by_driver = true,
Jay Sternberge1228372009-01-19 15:30:34 -0800917};
918
Wey-Yi Guy5953a622009-09-17 10:43:53 -0700919struct iwl_cfg iwl6050_2abg_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800920 .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG",
Wey-Yi Guy5953a622009-09-17 10:43:53 -0700921 .fw_name_pre = IWL6050_FW_PRE,
922 .ucode_api_max = IWL6050_UCODE_API_MAX,
923 .ucode_api_min = IWL6050_UCODE_API_MIN,
924 .sku = IWL_SKU_A|IWL_SKU_G,
Abhijeet Kolekard5755932010-02-18 22:03:05 -0800925 .ops = &iwl6050_ops,
Wey-Yi Guy5953a622009-09-17 10:43:53 -0700926 .eeprom_size = OTP_LOW_IMAGE_SIZE,
Wey-Yi Guy32b7e242009-10-16 14:25:51 -0700927 .eeprom_ver = EEPROM_6050_EEPROM_VERSION,
Wey-Yi Guy00e70592010-03-16 12:37:26 -0700928 .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700929 .num_of_queues = IWLAGN_NUM_QUEUES,
930 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
Wey-Yi Guy348ee7c2010-03-16 12:37:27 -0700931 .mod_params = &iwlagn_mod_params,
Wey-Yi Guy5953a622009-09-17 10:43:53 -0700932 .valid_tx_ant = ANT_AB,
933 .valid_rx_ant = ANT_AB,
Ben Cahillfadb3582009-10-23 13:42:21 -0700934 .pll_cfg_val = 0,
Ben Cahilla6c5c732009-10-30 14:36:07 -0700935 .set_l0s = true,
Ben Cahillfadb3582009-10-23 13:42:21 -0700936 .use_bsm = false,
Wey-Yi Guy5953a622009-09-17 10:43:53 -0700937 .pa_type = IWL_PA_SYSTEM,
Wey-Yi Guy3ab312a2009-10-16 14:25:52 -0700938 .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
Wey-Yi Guy5953a622009-09-17 10:43:53 -0700939 .shadow_ram_support = true,
Wey-Yi Guy5953a622009-09-17 10:43:53 -0700940 .led_compensation = 51,
Wey-Yi Guyd8c07e72009-09-25 14:24:26 -0700941 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
Johannes Berg78f5fb72009-09-25 14:24:27 -0700942 .supports_idle = true,
Wey-Yi Guy6047b4f2009-10-23 13:42:27 -0700943 .adv_thermal_throttle = true,
Wey-Yi Guy480e8402009-10-23 13:42:28 -0700944 .support_ct_kill_exit = true,
Trieu 'Andrew' Nguyen3e4fb5f2010-01-22 14:22:46 -0800945 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
Ben Cahilld4fe5ac2010-02-05 11:33:46 -0800946 .chain_noise_scale = 1500,
Wey-Yi Guyb74e31a2010-03-01 17:23:50 -0800947 .monitor_recover_period = IWL_MONITORING_PERIOD,
Wey-Yi Guy678b3852010-03-26 12:54:37 -0700948 .max_event_log_size = 1024,
Wey-Yi Guy6e5c8002010-04-27 14:00:28 -0700949 .ucode_tracing = true,
Wey-Yi Guy65d1f892010-04-25 15:41:43 -0700950 .sensitivity_calib_by_driver = true,
951 .chain_noise_calib_by_driver = true,
Wey-Yi Guy5953a622009-09-17 10:43:53 -0700952};
953
Jay Sternberge1228372009-01-19 15:30:34 -0800954struct iwl_cfg iwl6000_3agn_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800955 .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
Jay Sternberge1228372009-01-19 15:30:34 -0800956 .fw_name_pre = IWL6000_FW_PRE,
957 .ucode_api_max = IWL6000_UCODE_API_MAX,
958 .ucode_api_min = IWL6000_UCODE_API_MIN,
959 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
Jay Sternberg29f35c12009-01-29 11:09:16 -0800960 .ops = &iwl6000_ops,
Wey-Yi Guy415e4992009-08-13 13:30:54 -0700961 .eeprom_size = OTP_LOW_IMAGE_SIZE,
Wey-Yi Guy1f4b9662009-09-17 10:43:46 -0700962 .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
Wey-Yi Guy00e70592010-03-16 12:37:26 -0700963 .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700964 .num_of_queues = IWLAGN_NUM_QUEUES,
965 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
Wey-Yi Guy348ee7c2010-03-16 12:37:27 -0700966 .mod_params = &iwlagn_mod_params,
Jay Sternbergc0bac762009-02-02 16:21:14 -0800967 .valid_tx_ant = ANT_ABC,
968 .valid_rx_ant = ANT_ABC,
Ben Cahillfadb3582009-10-23 13:42:21 -0700969 .pll_cfg_val = 0,
Ben Cahilla6c5c732009-10-30 14:36:07 -0700970 .set_l0s = true,
Ben Cahillfadb3582009-10-23 13:42:21 -0700971 .use_bsm = false,
Wey-Yi Guy65b79982009-07-31 14:28:07 -0700972 .pa_type = IWL_PA_SYSTEM,
Wey-Yi Guy415e4992009-08-13 13:30:54 -0700973 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
974 .shadow_ram_support = true,
Daniel C Halperinb2617932009-08-13 13:30:59 -0700975 .ht_greenfield_support = true,
Wey-Yi Guyf2d0d0e2009-09-11 10:38:14 -0700976 .led_compensation = 51,
Wey-Yi Guy47eef9b2009-09-17 10:43:44 -0700977 .use_rts_for_ht = true, /* use rts/cts protection */
Wey-Yi Guyd8c07e72009-09-25 14:24:26 -0700978 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
Johannes Berg78f5fb72009-09-25 14:24:27 -0700979 .supports_idle = true,
Wey-Yi Guy6047b4f2009-10-23 13:42:27 -0700980 .adv_thermal_throttle = true,
Wey-Yi Guy480e8402009-10-23 13:42:28 -0700981 .support_ct_kill_exit = true,
Trieu 'Andrew' Nguyen3e4fb5f2010-01-22 14:22:46 -0800982 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
Ben Cahilld4fe5ac2010-02-05 11:33:46 -0800983 .chain_noise_scale = 1000,
Wey-Yi Guyb74e31a2010-03-01 17:23:50 -0800984 .monitor_recover_period = IWL_MONITORING_PERIOD,
Wey-Yi Guy678b3852010-03-26 12:54:37 -0700985 .max_event_log_size = 1024,
Wey-Yi Guy6e5c8002010-04-27 14:00:28 -0700986 .ucode_tracing = true,
Wey-Yi Guy65d1f892010-04-25 15:41:43 -0700987 .sensitivity_calib_by_driver = true,
988 .chain_noise_calib_by_driver = true,
Jay Sternberge1228372009-01-19 15:30:34 -0800989};
990
Jay Sternberge1228372009-01-19 15:30:34 -0800991MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
992MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
Shanyu Zhao95b13012010-04-21 11:46:33 -0700993MODULE_FIRMWARE(IWL6000G2A_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
Shanyu Zhao18089722010-05-06 10:15:21 -0700994MODULE_FIRMWARE(IWL6000G2B_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));