blob: 9d430987cc621cfb1eb972aa40dd94c2606028be [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
Johannes Berg670245e2010-08-23 07:56:55 -070055#define IWL6000G2_UCODE_API_MAX 5
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. */
Wey-Yi Guy178d1592010-06-15 16:14:53 -070087static void iwl6000_set_calib_version(struct iwl_priv *priv)
Abhijeet Kolekard5755932010-02-18 22:03:05 -080088{
Wey-Yi Guy178d1592010-06-15 16:14:53 -070089 if (priv->cfg->need_dc_calib &&
90 (priv->cfg->ops->lib->eeprom_ops.calib_version(priv) >= 6))
Abhijeet Kolekard5755932010-02-18 22:03:05 -080091 iwl_set_bit(priv, CSR_GP_DRIVER_REG,
92 CSR_GP_DRIVER_REG_BIT_CALIB_VERSION6);
93}
94
Wey-Yi Guy65b79982009-07-31 14:28:07 -070095/* NIC configuration for 6000 series */
96static void iwl6000_nic_config(struct iwl_priv *priv)
97{
Wey-Yi Guy9371d4e2009-09-11 10:38:10 -070098 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);
Wey-Yi Guy65b79982009-07-31 14:28:07 -0700113
114 /* no locking required for register write */
Wey-Yi Guy740e7f52009-11-06 14:52:55 -0800115 if (priv->cfg->pa_type == IWL_PA_INTERNAL) {
Wey-Yi Guy65b79982009-07-31 14:28:07 -0700116 /* 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 */
Abhijeet Kolekard5755932010-02-18 22:03:05 -0800121 if (priv->cfg->ops->lib->temp_ops.set_calib_version)
122 priv->cfg->ops->lib->temp_ops.set_calib_version(priv);
Wey-Yi Guy65b79982009-07-31 14:28:07 -0700123}
124
Johannes Berg670245e2010-08-23 07:56:55 -0700125/*
126 * Macros to access the lookup table.
127 *
128 * The lookup table has 7 inputs: bt3_prio, bt3_txrx, bt_rf_act, wifi_req,
129 * wifi_prio, wifi_txrx and wifi_sh_ant_req.
130 *
131 * It has three outputs: WLAN_ACTIVE, WLAN_KILL and ANT_SWITCH
132 *
133 * The format is that "registers" 8 through 11 contain the WLAN_ACTIVE bits
134 * one after another in 32-bit registers, and "registers" 0 through 7 contain
135 * the WLAN_KILL and ANT_SWITCH bits interleaved (in that order).
136 *
137 * These macros encode that format.
138 */
139#define LUT_VALUE(bt3_prio, bt3_txrx, bt_rf_act, wifi_req, wifi_prio, \
140 wifi_txrx, wifi_sh_ant_req) \
141 (bt3_prio | (bt3_txrx << 1) | (bt_rf_act << 2) | (wifi_req << 3) | \
142 (wifi_prio << 4) | (wifi_txrx << 5) | (wifi_sh_ant_req << 6))
143
144#define LUT_PTA_WLAN_ACTIVE_OP(lut, op, val) \
145 lut[8 + ((val) >> 5)] op (cpu_to_le32(BIT((val) & 0x1f)))
146#define LUT_TEST_PTA_WLAN_ACTIVE(lut, bt3_prio, bt3_txrx, bt_rf_act, \
147 wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req) \
148 (!!(LUT_PTA_WLAN_ACTIVE_OP(lut, &, LUT_VALUE(bt3_prio, bt3_txrx,\
149 bt_rf_act, wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))))
150#define LUT_SET_PTA_WLAN_ACTIVE(lut, bt3_prio, bt3_txrx, bt_rf_act, \
151 wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req) \
152 LUT_PTA_WLAN_ACTIVE_OP(lut, |=, LUT_VALUE(bt3_prio, bt3_txrx, \
153 bt_rf_act, wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))
154#define LUT_CLEAR_PTA_WLAN_ACTIVE(lut, bt3_prio, bt3_txrx, bt_rf_act, \
155 wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req) \
156 LUT_PTA_WLAN_ACTIVE_OP(lut, &= ~, LUT_VALUE(bt3_prio, bt3_txrx, \
157 bt_rf_act, wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))
158
159#define LUT_WLAN_KILL_OP(lut, op, val) \
160 lut[(val) >> 4] op (cpu_to_le32(BIT(((val) << 1) & 0x1e)))
161#define LUT_TEST_WLAN_KILL(lut, bt3_prio, bt3_txrx, bt_rf_act, wifi_req, \
162 wifi_prio, wifi_txrx, wifi_sh_ant_req) \
163 (!!(LUT_WLAN_KILL_OP(lut, &, LUT_VALUE(bt3_prio, bt3_txrx, bt_rf_act, \
164 wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))))
165#define LUT_SET_WLAN_KILL(lut, bt3_prio, bt3_txrx, bt_rf_act, wifi_req, \
166 wifi_prio, wifi_txrx, wifi_sh_ant_req) \
167 LUT_WLAN_KILL_OP(lut, |=, LUT_VALUE(bt3_prio, bt3_txrx, bt_rf_act, \
168 wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))
169#define LUT_CLEAR_WLAN_KILL(lut, bt3_prio, bt3_txrx, bt_rf_act, wifi_req, \
170 wifi_prio, wifi_txrx, wifi_sh_ant_req) \
171 LUT_WLAN_KILL_OP(lut, &= ~, LUT_VALUE(bt3_prio, bt3_txrx, bt_rf_act, \
172 wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))
173
174#define LUT_ANT_SWITCH_OP(lut, op, val) \
175 lut[(val) >> 4] op (cpu_to_le32(BIT((((val) << 1) & 0x1e) + 1)))
176#define LUT_TEST_ANT_SWITCH(lut, bt3_prio, bt3_txrx, bt_rf_act, wifi_req, \
177 wifi_prio, wifi_txrx, wifi_sh_ant_req) \
178 (!!(LUT_ANT_SWITCH_OP(lut, &, LUT_VALUE(bt3_prio, bt3_txrx, bt_rf_act, \
179 wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))))
180#define LUT_SET_ANT_SWITCH(lut, bt3_prio, bt3_txrx, bt_rf_act, wifi_req, \
181 wifi_prio, wifi_txrx, wifi_sh_ant_req) \
182 LUT_ANT_SWITCH_OP(lut, |=, LUT_VALUE(bt3_prio, bt3_txrx, bt_rf_act, \
183 wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))
184#define LUT_CLEAR_ANT_SWITCH(lut, bt3_prio, bt3_txrx, bt_rf_act, wifi_req, \
185 wifi_prio, wifi_txrx, wifi_sh_ant_req) \
186 LUT_ANT_SWITCH_OP(lut, &= ~, LUT_VALUE(bt3_prio, bt3_txrx, bt_rf_act, \
187 wifi_req, wifi_prio, wifi_txrx, wifi_sh_ant_req))
188
189static const __le32 iwl6000g2b_def_3w_lookup[12] = {
190 cpu_to_le32(0xaaaaaaaa),
191 cpu_to_le32(0xaaaaaaaa),
192 cpu_to_le32(0xaeaaaaaa),
193 cpu_to_le32(0xaaaaaaaa),
194 cpu_to_le32(0xcc00ff28),
195 cpu_to_le32(0x0000aaaa),
196 cpu_to_le32(0xcc00aaaa),
197 cpu_to_le32(0x0000aaaa),
198 cpu_to_le32(0xc0004000),
199 cpu_to_le32(0x00004000),
200 cpu_to_le32(0xf0005000),
201 cpu_to_le32(0xf0004000),
202};
203
204static void iwl6000g2b_send_bt_config(struct iwl_priv *priv)
205{
206 struct iwl6000g2b_bt_cmd bt_cmd = {
207 .prio_boost = IWL6000G2B_BT_PRIO_BOOST_DEFAULT,
208 .max_kill = IWL6000G2B_BT_MAX_KILL_DEFAULT,
209 .bt3_timer_t7_value = IWL6000G2B_BT3_T7_DEFAULT,
210 .kill_ack_mask = IWL6000G2B_BT_KILL_ACK_MASK_DEFAULT,
211 .kill_cts_mask = IWL6000G2B_BT_KILL_CTS_MASK_DEFAULT,
212 .bt3_prio_sample_time = IWL6000G2B_BT3_PRIO_SAMPLE_DEFAULT,
213 .bt3_timer_t2_value = IWL6000G2B_BT3_T2_DEFAULT,
214 .valid = IWL6000G2B_BT_VALID_ENABLE_FLAGS,
215 };
216
217 BUILD_BUG_ON(sizeof(iwl6000g2b_def_3w_lookup) !=
218 sizeof(bt_cmd.bt3_lookup_table));
219
Johannes Berg590799492010-08-23 07:57:00 -0700220 /*
221 * Configure BT coex mode to "no coexistence" when the
222 * user disabled BT coexistence, we have no interface
223 * (might be in monitor mode), or the interface is in
224 * IBSS mode (no proper uCode support for coex then).
225 */
226 if (!bt_coex_active || !priv->vif ||
227 priv->iw_mode == NL80211_IFTYPE_ADHOC) {
Johannes Berg670245e2010-08-23 07:56:55 -0700228 bt_cmd.flags = 0;
229 } else {
230 bt_cmd.flags = IWL6000G2B_BT_FLAG_CHANNEL_INHIBITION |
231 IWL6000G2B_BT_FLAG_COEX_MODE_3W <<
232 IWL6000G2B_BT_FLAG_COEX_MODE_SHIFT;
233 bt_cmd.valid |= IWL6000G2B_BT_ALL_VALID_MSK;
234 }
235
236 memcpy(bt_cmd.bt3_lookup_table, iwl6000g2b_def_3w_lookup,
237 sizeof(iwl6000g2b_def_3w_lookup));
238
239 IWL_DEBUG_INFO(priv, "BT coex %s\n",
240 bt_cmd.flags ? "active" : "disabled");
241
242 if (iwl_send_cmd_pdu(priv, REPLY_BT_CONFIG, sizeof(bt_cmd), &bt_cmd))
243 IWL_ERR(priv, "failed to send BT Coex Config\n");
Johannes Berg511b0822010-08-23 07:57:01 -0700244
245 /*
246 * When we are doing a restart, need to also reconfigure BT
247 * SCO to the device. If not doing a restart, bt_sco_active
248 * will always be false, so there's no need to have an extra
249 * variable to check for it.
250 */
251 if (priv->bt_sco_active) {
252 struct iwl6000g2b_bt_sco_cmd sco_cmd = { .flags = 0 };
253
254 if (priv->bt_sco_active)
255 sco_cmd.flags |= IWL6000G2B_BT_SCO_ACTIVE;
256 if (iwl_send_cmd_pdu(priv, REPLY_BT_COEX_SCO,
257 sizeof(sco_cmd), &sco_cmd))
258 IWL_ERR(priv, "failed to send BT SCO command\n");
259 }
Johannes Berg670245e2010-08-23 07:56:55 -0700260}
261
Wey-Yi Guyf3a2a422009-09-11 10:38:11 -0700262static struct iwl_sensitivity_ranges iwl6000_sensitivity = {
263 .min_nrg_cck = 97,
264 .max_nrg_cck = 0, /* not used, set to 0 */
265 .auto_corr_min_ofdm = 80,
266 .auto_corr_min_ofdm_mrc = 128,
267 .auto_corr_min_ofdm_x1 = 105,
268 .auto_corr_min_ofdm_mrc_x1 = 192,
269
270 .auto_corr_max_ofdm = 145,
271 .auto_corr_max_ofdm_mrc = 232,
Wey-Yi Guy2494f632010-01-20 12:22:52 -0800272 .auto_corr_max_ofdm_x1 = 110,
Wey-Yi Guyf3a2a422009-09-11 10:38:11 -0700273 .auto_corr_max_ofdm_mrc_x1 = 232,
274
275 .auto_corr_min_cck = 125,
276 .auto_corr_max_cck = 175,
277 .auto_corr_min_cck_mrc = 160,
278 .auto_corr_max_cck_mrc = 310,
279 .nrg_th_cck = 97,
280 .nrg_th_ofdm = 100,
Wey-Yi Guy55036d62009-10-09 13:20:24 -0700281
282 .barker_corr_th_min = 190,
283 .barker_corr_th_min_mrc = 390,
284 .nrg_th_cca = 62,
Wey-Yi Guyf3a2a422009-09-11 10:38:11 -0700285};
286
287static int iwl6000_hw_set_hw_params(struct iwl_priv *priv)
288{
Wey-Yi Guy88804e22009-10-09 13:20:28 -0700289 if (priv->cfg->mod_params->num_of_queues >= IWL_MIN_NUM_QUEUES &&
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700290 priv->cfg->mod_params->num_of_queues <= IWLAGN_NUM_QUEUES)
Wey-Yi Guy88804e22009-10-09 13:20:28 -0700291 priv->cfg->num_of_queues =
292 priv->cfg->mod_params->num_of_queues;
Wey-Yi Guyf3a2a422009-09-11 10:38:11 -0700293
Wey-Yi Guy88804e22009-10-09 13:20:28 -0700294 priv->hw_params.max_txq_num = priv->cfg->num_of_queues;
Wey-Yi Guyf3a2a422009-09-11 10:38:11 -0700295 priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM;
296 priv->hw_params.scd_bc_tbls_size =
Wey-Yi Guy88804e22009-10-09 13:20:28 -0700297 priv->cfg->num_of_queues *
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700298 sizeof(struct iwlagn_scd_bc_tbl);
Wey-Yi Guyf3a2a422009-09-11 10:38:11 -0700299 priv->hw_params.tfd_size = sizeof(struct iwl_tfd);
Wey-Yi Guybf3c7fd2010-06-24 14:08:05 -0700300 priv->hw_params.max_stations = IWLAGN_STATION_COUNT;
301 priv->hw_params.bcast_sta_id = IWLAGN_BROADCAST_ID;
Wey-Yi Guyf3a2a422009-09-11 10:38:11 -0700302
303 priv->hw_params.max_data_size = IWL60_RTC_DATA_SIZE;
304 priv->hw_params.max_inst_size = IWL60_RTC_INST_SIZE;
305
306 priv->hw_params.max_bsm_size = 0;
307 priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
308 BIT(IEEE80211_BAND_5GHZ);
309 priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
310
311 priv->hw_params.tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant);
312 priv->hw_params.rx_chains_num = num_of_ant(priv->cfg->valid_rx_ant);
313 priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
314 priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
315
316 if (priv->cfg->ops->lib->temp_ops.set_ct_kill)
317 priv->cfg->ops->lib->temp_ops.set_ct_kill(priv);
318
319 /* Set initial sensitivity parameters */
320 /* Set initial calibration set */
321 priv->hw_params.sens = &iwl6000_sensitivity;
Wey-Yi Guye517736a2010-04-19 18:49:40 -0700322 priv->hw_params.calib_init_cfg =
323 BIT(IWL_CALIB_XTAL) |
324 BIT(IWL_CALIB_LO) |
325 BIT(IWL_CALIB_TX_IQ) |
326 BIT(IWL_CALIB_BASE_BAND);
Wey-Yi Guy178d1592010-06-15 16:14:53 -0700327 if (priv->cfg->need_dc_calib)
328 priv->hw_params.calib_init_cfg |= BIT(IWL_CALIB_DC);
Abhijeet Kolekar07f33f92010-01-22 14:22:47 -0800329
Wey-Yi Guya0ee74c2010-05-06 08:54:10 -0700330 priv->hw_params.beacon_time_tsf_bits = IWLAGN_EXT_BEACON_TIME_POS;
331
Wey-Yi Guyf3a2a422009-09-11 10:38:11 -0700332 return 0;
333}
334
Wey-Yi Guy79d07322010-05-06 08:54:11 -0700335static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
336 struct ieee80211_channel_switch *ch_switch)
Wey-Yi Guy4a56e962009-10-23 13:42:29 -0700337{
338 struct iwl6000_channel_switch_cmd cmd;
339 const struct iwl_channel_info *ch_info;
Wey-Yi Guy79d07322010-05-06 08:54:11 -0700340 u32 switch_time_in_usec, ucode_switch_time;
341 u16 ch;
342 u32 tsf_low;
343 u8 switch_count;
344 u16 beacon_interval = le16_to_cpu(priv->rxon_timing.beacon_interval);
345 struct ieee80211_vif *vif = priv->vif;
Wey-Yi Guy4a56e962009-10-23 13:42:29 -0700346 struct iwl_host_cmd hcmd = {
347 .id = REPLY_CHANNEL_SWITCH,
348 .len = sizeof(cmd),
Wey-Yi Guy3839f7c2010-05-18 09:18:06 -0700349 .flags = CMD_SYNC,
Wey-Yi Guy4a56e962009-10-23 13:42:29 -0700350 .data = &cmd,
351 };
352
Wey-Yi Guy4a56e962009-10-23 13:42:29 -0700353 cmd.band = priv->band == IEEE80211_BAND_2GHZ;
Shanyu Zhao81e95432010-07-28 13:40:27 -0700354 ch = ch_switch->channel->hw_value;
Wey-Yi Guy79d07322010-05-06 08:54:11 -0700355 IWL_DEBUG_11H(priv, "channel switch from %u to %u\n",
356 priv->active_rxon.channel, ch);
357 cmd.channel = cpu_to_le16(ch);
Wey-Yi Guy0924e5192009-11-06 14:52:54 -0800358 cmd.rxon_flags = priv->staging_rxon.flags;
359 cmd.rxon_filter_flags = priv->staging_rxon.filter_flags;
Wey-Yi Guy79d07322010-05-06 08:54:11 -0700360 switch_count = ch_switch->count;
361 tsf_low = ch_switch->timestamp & 0x0ffffffff;
362 /*
363 * calculate the ucode channel switch time
364 * adding TSF as one of the factor for when to switch
365 */
366 if ((priv->ucode_beacon_time > tsf_low) && beacon_interval) {
367 if (switch_count > ((priv->ucode_beacon_time - tsf_low) /
368 beacon_interval)) {
369 switch_count -= (priv->ucode_beacon_time -
370 tsf_low) / beacon_interval;
371 } else
372 switch_count = 0;
373 }
374 if (switch_count <= 1)
375 cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time);
376 else {
377 switch_time_in_usec =
378 vif->bss_conf.beacon_int * switch_count * TIME_UNIT;
379 ucode_switch_time = iwl_usecs_to_beacons(priv,
380 switch_time_in_usec,
381 beacon_interval);
382 cmd.switch_time = iwl_add_beacon_time(priv,
383 priv->ucode_beacon_time,
384 ucode_switch_time,
385 beacon_interval);
386 }
387 IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n",
388 cmd.switch_time);
389 ch_info = iwl_get_channel_info(priv, priv->band, ch);
Wey-Yi Guy4a56e962009-10-23 13:42:29 -0700390 if (ch_info)
391 cmd.expect_beacon = is_channel_radar(ch_info);
392 else {
393 IWL_ERR(priv, "invalid channel switch from %u to %u\n",
Wey-Yi Guy79d07322010-05-06 08:54:11 -0700394 priv->active_rxon.channel, ch);
Wey-Yi Guy4a56e962009-10-23 13:42:29 -0700395 return -EFAULT;
396 }
Wey-Yi Guy79d07322010-05-06 08:54:11 -0700397 priv->switch_rxon.channel = cmd.channel;
Wey-Yi Guy0924e5192009-11-06 14:52:54 -0800398 priv->switch_rxon.switch_in_progress = true;
Wey-Yi Guy4a56e962009-10-23 13:42:29 -0700399
400 return iwl_send_cmd_sync(priv, &hcmd);
401}
402
Johannes Berg9e4afc22010-08-23 07:56:57 -0700403static void iwl6000g2b_bt_traffic_change_work(struct work_struct *work)
404{
405 struct iwl_priv *priv =
406 container_of(work, struct iwl_priv, bt_traffic_change_work);
407 int smps_request = -1;
408
409 switch (priv->bt_traffic_load) {
410 case IWL_BT_COEX_TRAFFIC_LOAD_NONE:
411 smps_request = IEEE80211_SMPS_AUTOMATIC;
412 break;
413 case IWL_BT_COEX_TRAFFIC_LOAD_LOW:
414 smps_request = IEEE80211_SMPS_DYNAMIC;
415 break;
416 case IWL_BT_COEX_TRAFFIC_LOAD_HIGH:
417 case IWL_BT_COEX_TRAFFIC_LOAD_CONTINUOUS:
418 smps_request = IEEE80211_SMPS_STATIC;
419 break;
420 default:
421 IWL_ERR(priv, "Invalid BT traffic load: %d\n",
422 priv->bt_traffic_load);
423 break;
424 }
425
426 mutex_lock(&priv->mutex);
427
428 if (smps_request != -1 &&
429 priv->vif && priv->vif->type == NL80211_IFTYPE_STATION)
430 ieee80211_request_smps(priv->vif, smps_request);
431
432 mutex_unlock(&priv->mutex);
433}
434
435static void iwl6000g2b_bt_coex_profile_notif(struct iwl_priv *priv,
436 struct iwl_rx_mem_buffer *rxb)
437{
438 struct iwl_rx_packet *pkt = rxb_addr(rxb);
439 struct iwl_bt_coex_profile_notif *coex = &pkt->u.bt_coex_profile_notif;
440 struct iwl6000g2b_bt_sco_cmd sco_cmd = { .flags = 0 };
441
442 IWL_DEBUG_NOTIF(priv, "BT Coex notification:\n");
443 IWL_DEBUG_NOTIF(priv, " status: %d\n", coex->bt_status);
444 IWL_DEBUG_NOTIF(priv, " traffic load: %d\n", coex->bt_traffic_load);
445 IWL_DEBUG_NOTIF(priv, " CI compliance: %d\n", coex->bt_ci_compliance);
446 IWL_DEBUG_NOTIF(priv, " UART msg: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x:"
447 "%.2x:%.2x\n",
448 coex->uart_msg[0], coex->uart_msg[1], coex->uart_msg[2],
449 coex->uart_msg[3], coex->uart_msg[4], coex->uart_msg[5],
450 coex->uart_msg[6], coex->uart_msg[7]);
451
Johannes Berg590799492010-08-23 07:57:00 -0700452 priv->notif_bt_traffic_load = coex->bt_traffic_load;
Johannes Berg9e4afc22010-08-23 07:56:57 -0700453
Johannes Berg590799492010-08-23 07:57:00 -0700454 if (priv->iw_mode != NL80211_IFTYPE_ADHOC) {
455 if (coex->bt_traffic_load != priv->bt_traffic_load) {
456 priv->bt_traffic_load = coex->bt_traffic_load;
457
458 queue_work(priv->workqueue,
459 &priv->bt_traffic_change_work);
460 }
461
462 /* FIXME: add defines for this check */
463 priv->bt_sco_active = coex->uart_msg[3] & 1;
464 if (priv->bt_sco_active)
465 sco_cmd.flags |= IWL6000G2B_BT_SCO_ACTIVE;
466 iwl_send_cmd_pdu_async(priv, REPLY_BT_COEX_SCO,
467 sizeof(sco_cmd), &sco_cmd, NULL);
Johannes Berg9e4afc22010-08-23 07:56:57 -0700468 }
Johannes Berg9e4afc22010-08-23 07:56:57 -0700469}
470
471void iwl6000g2b_rx_handler_setup(struct iwl_priv *priv)
472{
473 iwlagn_rx_handler_setup(priv);
474 priv->rx_handlers[REPLY_BT_COEX_PROFILE_NOTIF] =
475 iwl6000g2b_bt_coex_profile_notif;
476}
477
478static void iwl6000g2b_bt_setup_deferred_work(struct iwl_priv *priv)
479{
480 iwlagn_setup_deferred_work(priv);
481
482 INIT_WORK(&priv->bt_traffic_change_work,
483 iwl6000g2b_bt_traffic_change_work);
484
485}
486
487static void iwl6000g2b_bt_cancel_deferred_work(struct iwl_priv *priv)
488{
489 cancel_work_sync(&priv->bt_traffic_change_work);
490}
491
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700492static struct iwl_lib_ops iwl6000_lib = {
Wey-Yi Guyf3a2a422009-09-11 10:38:11 -0700493 .set_hw_params = iwl6000_hw_set_hw_params,
Wey-Yi Guyb305a082010-03-16 17:41:22 -0700494 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
495 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
496 .txq_set_sched = iwlagn_txq_set_sched,
497 .txq_agg_enable = iwlagn_txq_agg_enable,
498 .txq_agg_disable = iwlagn_txq_agg_disable,
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700499 .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
500 .txq_free_tfd = iwl_hw_txq_free_tfd,
501 .txq_init = iwl_hw_tx_queue_init,
Wey-Yi Guye04ed0a2010-03-16 17:47:58 -0700502 .rx_handler_setup = iwlagn_rx_handler_setup,
503 .setup_deferred_work = iwlagn_setup_deferred_work,
504 .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
Wey-Yi Guy81b81762010-03-16 10:23:30 -0700505 .load_ucode = iwlagn_load_ucode,
Reinette Chatreb7a79402009-09-25 14:24:23 -0700506 .dump_nic_event_log = iwl_dump_nic_event_log,
507 .dump_nic_error_log = iwl_dump_nic_error_log,
Wey-Yi Guy696bdee2009-12-10 14:37:25 -0800508 .dump_csr = iwl_dump_csr,
Wey-Yi Guy1b3eb822010-01-15 13:43:39 -0800509 .dump_fh = iwl_dump_fh,
Wey-Yi Guy741a6262010-03-16 12:37:24 -0700510 .init_alive_start = iwlagn_init_alive_start,
511 .alive_notify = iwlagn_alive_notify,
Wey-Yi Guye04ed0a2010-03-16 17:47:58 -0700512 .send_tx_power = iwlagn_send_tx_power,
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700513 .update_chain_flags = iwl_update_chain_flags,
Wey-Yi Guy4a56e962009-10-23 13:42:29 -0700514 .set_channel_switch = iwl6000_hw_channel_switch,
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700515 .apm_ops = {
Ben Cahillfadb3582009-10-23 13:42:21 -0700516 .init = iwl_apm_init,
Abhijeet Kolekard68b6032009-10-02 13:44:04 -0700517 .stop = iwl_apm_stop,
Wey-Yi Guy65b79982009-07-31 14:28:07 -0700518 .config = iwl6000_nic_config,
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700519 .set_pwr_src = iwl_set_pwr_src,
520 },
521 .eeprom_ops = {
522 .regulatory_bands = {
Wey-Yi Guye04ed0a2010-03-16 17:47:58 -0700523 EEPROM_REG_BAND_1_CHANNELS,
524 EEPROM_REG_BAND_2_CHANNELS,
525 EEPROM_REG_BAND_3_CHANNELS,
526 EEPROM_REG_BAND_4_CHANNELS,
527 EEPROM_REG_BAND_5_CHANNELS,
Shanyu Zhaof2fa1b02010-04-07 18:37:52 -0700528 EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
Wey-Yi Guye04ed0a2010-03-16 17:47:58 -0700529 EEPROM_REG_BAND_52_HT40_CHANNELS
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700530 },
531 .verify_signature = iwlcore_eeprom_verify_signature,
532 .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
533 .release_semaphore = iwlcore_eeprom_release_semaphore,
Wey-Yi Guye04ed0a2010-03-16 17:47:58 -0700534 .calib_version = iwlagn_eeprom_calib_version,
535 .query_addr = iwlagn_eeprom_query_addr,
Wey-Yi Guyab9fd1b2009-08-21 13:34:23 -0700536 .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower,
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700537 },
538 .post_associate = iwl_post_associate,
539 .isr = iwl_isr_ict,
540 .config_ap = iwl_config_ap,
541 .temp_ops = {
Wey-Yi Guye04ed0a2010-03-16 17:47:58 -0700542 .temperature = iwlagn_temperature,
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700543 .set_ct_kill = iwl6000_set_ct_threshold,
Wey-Yi Guy178d1592010-06-15 16:14:53 -0700544 .set_calib_version = iwl6000_set_calib_version,
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700545 },
Johannes Berg1fa61b22010-04-28 08:44:52 -0700546 .manage_ibss_station = iwlagn_manage_ibss_station,
Daniel Halperin278c2f62010-06-14 13:10:29 -0700547 .update_bcast_station = iwl_update_bcast_station,
Abhijeet Kolekarb8c76262010-04-08 15:29:07 -0700548 .debugfs_ops = {
549 .rx_stats_read = iwl_ucode_rx_stats_read,
550 .tx_stats_read = iwl_ucode_tx_stats_read,
551 .general_stats_read = iwl_ucode_general_stats_read,
Wey-Yi Guyffb7d892010-07-14 08:09:55 -0700552 .bt_stats_read = iwl_ucode_bt_stats_read,
Abhijeet Kolekarb8c76262010-04-08 15:29:07 -0700553 },
Wey-Yi Guyb74e31a2010-03-01 17:23:50 -0800554 .recover_from_tx_stall = iwl_bg_monitor_recover,
Wey-Yi Guyfa8f130c2010-03-05 14:22:46 -0800555 .check_plcp_health = iwl_good_plcp_health,
556 .check_ack_health = iwl_good_ack_health,
Wey-Yi Guy716c74b2010-06-24 13:22:36 -0700557 .txfifo_flush = iwlagn_txfifo_flush,
Wey-Yi Guy65550632010-06-24 13:18:35 -0700558 .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
Wey-Yi Guy0975cc82010-07-31 08:34:07 -0700559 .tt_ops = {
560 .lower_power_detection = iwl_tt_is_low_power_state,
561 .tt_power_mode = iwl_tt_current_power_mode,
562 .ct_kill_check = iwl_check_for_ct_kill,
563 }
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700564};
565
Johannes Berg9e4afc22010-08-23 07:56:57 -0700566static struct iwl_lib_ops iwl6000g2b_lib = {
567 .set_hw_params = iwl6000_hw_set_hw_params,
568 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
569 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
570 .txq_set_sched = iwlagn_txq_set_sched,
571 .txq_agg_enable = iwlagn_txq_agg_enable,
572 .txq_agg_disable = iwlagn_txq_agg_disable,
573 .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
574 .txq_free_tfd = iwl_hw_txq_free_tfd,
575 .txq_init = iwl_hw_tx_queue_init,
576 .rx_handler_setup = iwl6000g2b_rx_handler_setup,
577 .setup_deferred_work = iwl6000g2b_bt_setup_deferred_work,
578 .cancel_deferred_work = iwl6000g2b_bt_cancel_deferred_work,
579 .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
580 .load_ucode = iwlagn_load_ucode,
581 .dump_nic_event_log = iwl_dump_nic_event_log,
582 .dump_nic_error_log = iwl_dump_nic_error_log,
583 .dump_csr = iwl_dump_csr,
584 .dump_fh = iwl_dump_fh,
585 .init_alive_start = iwlagn_init_alive_start,
586 .alive_notify = iwlagn_alive_notify,
587 .send_tx_power = iwlagn_send_tx_power,
588 .update_chain_flags = iwl_update_chain_flags,
589 .set_channel_switch = iwl6000_hw_channel_switch,
590 .apm_ops = {
591 .init = iwl_apm_init,
592 .stop = iwl_apm_stop,
593 .config = iwl6000_nic_config,
594 .set_pwr_src = iwl_set_pwr_src,
595 },
596 .eeprom_ops = {
597 .regulatory_bands = {
598 EEPROM_REG_BAND_1_CHANNELS,
599 EEPROM_REG_BAND_2_CHANNELS,
600 EEPROM_REG_BAND_3_CHANNELS,
601 EEPROM_REG_BAND_4_CHANNELS,
602 EEPROM_REG_BAND_5_CHANNELS,
603 EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
604 EEPROM_REG_BAND_52_HT40_CHANNELS
605 },
606 .verify_signature = iwlcore_eeprom_verify_signature,
607 .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
608 .release_semaphore = iwlcore_eeprom_release_semaphore,
609 .calib_version = iwlagn_eeprom_calib_version,
610 .query_addr = iwlagn_eeprom_query_addr,
611 .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower,
612 },
613 .post_associate = iwl_post_associate,
614 .isr = iwl_isr_ict,
615 .config_ap = iwl_config_ap,
616 .temp_ops = {
617 .temperature = iwlagn_temperature,
618 .set_ct_kill = iwl6000_set_ct_threshold,
619 .set_calib_version = iwl6000_set_calib_version,
620 },
621 .manage_ibss_station = iwlagn_manage_ibss_station,
622 .update_bcast_station = iwl_update_bcast_station,
623 .debugfs_ops = {
624 .rx_stats_read = iwl_ucode_rx_stats_read,
625 .tx_stats_read = iwl_ucode_tx_stats_read,
626 .general_stats_read = iwl_ucode_general_stats_read,
627 .bt_stats_read = iwl_ucode_bt_stats_read,
628 },
629 .recover_from_tx_stall = iwl_bg_monitor_recover,
630 .check_plcp_health = iwl_good_plcp_health,
631 .check_ack_health = iwl_good_ack_health,
632 .txfifo_flush = iwlagn_txfifo_flush,
633 .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
634 .tt_ops = {
635 .lower_power_detection = iwl_tt_is_low_power_state,
636 .tt_power_mode = iwl_tt_current_power_mode,
637 .ct_kill_check = iwl_check_for_ct_kill,
638 }
639};
640
Emese Revfy45d5d802009-12-14 00:59:53 +0100641static const struct iwl_ops iwl6000_ops = {
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700642 .lib = &iwl6000_lib,
Wey-Yi Guy7dc77db2010-03-16 10:23:31 -0700643 .hcmd = &iwlagn_hcmd,
644 .utils = &iwlagn_hcmd_utils,
Johannes Berge932a602009-10-02 13:44:03 -0700645 .led = &iwlagn_led_ops,
Jay Sternberg29f35c12009-01-29 11:09:16 -0800646};
647
Shanyu Zhao18089722010-05-06 10:15:21 -0700648static struct iwl_hcmd_ops iwl6000g2b_hcmd = {
649 .rxon_assoc = iwlagn_send_rxon_assoc,
650 .commit_rxon = iwl_commit_rxon,
651 .set_rxon_chain = iwl_set_rxon_chain,
652 .set_tx_ant = iwlagn_send_tx_ant_config,
Johannes Berg670245e2010-08-23 07:56:55 -0700653 .send_bt_config = iwl6000g2b_send_bt_config,
Shanyu Zhao18089722010-05-06 10:15:21 -0700654};
655
656static const struct iwl_ops iwl6000g2b_ops = {
Johannes Berg9e4afc22010-08-23 07:56:57 -0700657 .lib = &iwl6000g2b_lib,
Shanyu Zhao18089722010-05-06 10:15:21 -0700658 .hcmd = &iwl6000g2b_hcmd,
659 .utils = &iwlagn_hcmd_utils,
660 .led = &iwlagn_led_ops,
661};
662
Shanyu Zhao95b13012010-04-21 11:46:33 -0700663struct iwl_cfg iwl6000g2a_2agn_cfg = {
664 .name = "6000 Series 2x2 AGN Gen2a",
665 .fw_name_pre = IWL6000G2A_FW_PRE,
Shanyu Zhao4b3e8062010-04-07 18:06:36 -0700666 .ucode_api_max = IWL6000G2_UCODE_API_MAX,
667 .ucode_api_min = IWL6000G2_UCODE_API_MIN,
Jay Sternberg0b5af202010-03-17 16:16:12 -0700668 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
669 .ops = &iwl6000_ops,
670 .eeprom_size = OTP_LOW_IMAGE_SIZE,
Shanyu Zhao4b3e8062010-04-07 18:06:36 -0700671 .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
672 .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
Jay Sternberg0b5af202010-03-17 16:16:12 -0700673 .num_of_queues = IWLAGN_NUM_QUEUES,
674 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
675 .mod_params = &iwlagn_mod_params,
676 .valid_tx_ant = ANT_AB,
677 .valid_rx_ant = ANT_AB,
678 .pll_cfg_val = 0,
679 .set_l0s = true,
680 .use_bsm = false,
Wey-Yi Guy33e6f812010-04-09 09:36:11 -0700681 .pa_type = IWL_PA_SYSTEM,
Jay Sternberg0b5af202010-03-17 16:16:12 -0700682 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
683 .shadow_ram_support = true,
684 .ht_greenfield_support = true,
685 .led_compensation = 51,
Johannes Berg94597ab2010-08-09 10:57:02 -0700686 .use_rts_for_aggregation = true, /* use rts/cts protection */
Jay Sternberg0b5af202010-03-17 16:16:12 -0700687 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
688 .supports_idle = true,
689 .adv_thermal_throttle = true,
690 .support_ct_kill_exit = true,
691 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
692 .chain_noise_scale = 1000,
Wey-Yi Guyce606592010-07-23 13:19:39 -0700693 .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
Shanyu Zhao95b13012010-04-21 11:46:33 -0700694 .max_event_log_size = 512,
Wey-Yi Guy6e5c8002010-04-27 14:00:28 -0700695 .ucode_tracing = true,
Wey-Yi Guy65d1f892010-04-25 15:41:43 -0700696 .sensitivity_calib_by_driver = true,
697 .chain_noise_calib_by_driver = true,
Wey-Yi Guy178d1592010-06-15 16:14:53 -0700698 .need_dc_calib = true,
Jay Sternberg0b5af202010-03-17 16:16:12 -0700699};
700
Shanyu Zhao18089722010-05-06 10:15:21 -0700701struct iwl_cfg iwl6000g2a_2abg_cfg = {
702 .name = "6000 Series 2x2 ABG Gen2a",
703 .fw_name_pre = IWL6000G2A_FW_PRE,
704 .ucode_api_max = IWL6000G2_UCODE_API_MAX,
705 .ucode_api_min = IWL6000G2_UCODE_API_MIN,
706 .sku = IWL_SKU_A|IWL_SKU_G,
707 .ops = &iwl6000_ops,
708 .eeprom_size = OTP_LOW_IMAGE_SIZE,
709 .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
710 .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
711 .num_of_queues = IWLAGN_NUM_QUEUES,
712 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
713 .mod_params = &iwlagn_mod_params,
714 .valid_tx_ant = ANT_AB,
715 .valid_rx_ant = ANT_AB,
716 .pll_cfg_val = 0,
717 .set_l0s = true,
718 .use_bsm = false,
719 .pa_type = IWL_PA_SYSTEM,
720 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
721 .shadow_ram_support = true,
722 .led_compensation = 51,
723 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
724 .supports_idle = true,
725 .adv_thermal_throttle = true,
726 .support_ct_kill_exit = true,
727 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
728 .chain_noise_scale = 1000,
Wey-Yi Guyce606592010-07-23 13:19:39 -0700729 .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
Shanyu Zhao18089722010-05-06 10:15:21 -0700730 .max_event_log_size = 512,
Wey-Yi Guy679db792010-06-21 12:15:17 -0700731 .sensitivity_calib_by_driver = true,
732 .chain_noise_calib_by_driver = true,
Wey-Yi Guy178d1592010-06-15 16:14:53 -0700733 .need_dc_calib = true,
Shanyu Zhao18089722010-05-06 10:15:21 -0700734};
735
736struct iwl_cfg iwl6000g2a_2bg_cfg = {
737 .name = "6000 Series 2x2 BG Gen2a",
738 .fw_name_pre = IWL6000G2A_FW_PRE,
739 .ucode_api_max = IWL6000G2_UCODE_API_MAX,
740 .ucode_api_min = IWL6000G2_UCODE_API_MIN,
741 .sku = IWL_SKU_G,
742 .ops = &iwl6000_ops,
743 .eeprom_size = OTP_LOW_IMAGE_SIZE,
744 .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
745 .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
746 .num_of_queues = IWLAGN_NUM_QUEUES,
747 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
748 .mod_params = &iwlagn_mod_params,
749 .valid_tx_ant = ANT_AB,
750 .valid_rx_ant = ANT_AB,
751 .pll_cfg_val = 0,
752 .set_l0s = true,
753 .use_bsm = false,
754 .pa_type = IWL_PA_SYSTEM,
755 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
756 .shadow_ram_support = true,
757 .led_compensation = 51,
758 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
759 .supports_idle = true,
760 .adv_thermal_throttle = true,
761 .support_ct_kill_exit = true,
762 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
763 .chain_noise_scale = 1000,
Wey-Yi Guyce606592010-07-23 13:19:39 -0700764 .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
Shanyu Zhao18089722010-05-06 10:15:21 -0700765 .max_event_log_size = 512,
Wey-Yi Guy679db792010-06-21 12:15:17 -0700766 .sensitivity_calib_by_driver = true,
767 .chain_noise_calib_by_driver = true,
Wey-Yi Guy178d1592010-06-15 16:14:53 -0700768 .need_dc_calib = true,
Shanyu Zhao18089722010-05-06 10:15:21 -0700769};
770
771struct iwl_cfg iwl6000g2b_2agn_cfg = {
772 .name = "6000 Series 2x2 AGN Gen2b",
773 .fw_name_pre = IWL6000G2B_FW_PRE,
774 .ucode_api_max = IWL6000G2_UCODE_API_MAX,
775 .ucode_api_min = IWL6000G2_UCODE_API_MIN,
776 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
777 .ops = &iwl6000g2b_ops,
778 .eeprom_size = OTP_LOW_IMAGE_SIZE,
779 .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
780 .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
781 .num_of_queues = IWLAGN_NUM_QUEUES,
782 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
783 .mod_params = &iwlagn_mod_params,
784 .valid_tx_ant = ANT_AB,
785 .valid_rx_ant = ANT_AB,
786 .pll_cfg_val = 0,
787 .set_l0s = true,
788 .use_bsm = false,
789 .pa_type = IWL_PA_SYSTEM,
790 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
791 .shadow_ram_support = true,
792 .ht_greenfield_support = true,
793 .led_compensation = 51,
Johannes Berg94597ab2010-08-09 10:57:02 -0700794 .use_rts_for_aggregation = true, /* use rts/cts protection */
Shanyu Zhao18089722010-05-06 10:15:21 -0700795 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
796 .supports_idle = true,
797 .adv_thermal_throttle = true,
798 .support_ct_kill_exit = true,
Wey-Yi Guy74e5c412010-08-23 07:57:02 -0700799 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE,
Shanyu Zhao18089722010-05-06 10:15:21 -0700800 .chain_noise_scale = 1000,
Wey-Yi Guy3198c682010-07-23 13:19:40 -0700801 .monitor_recover_period = IWL_LONG_MONITORING_PERIOD,
Shanyu Zhao18089722010-05-06 10:15:21 -0700802 .max_event_log_size = 512,
Wey-Yi Guy679db792010-06-21 12:15:17 -0700803 .sensitivity_calib_by_driver = true,
804 .chain_noise_calib_by_driver = true,
Wey-Yi Guy178d1592010-06-15 16:14:53 -0700805 .need_dc_calib = true,
Wey-Yi Guyaf8ee052010-07-14 08:08:05 -0700806 .bt_statistics = true,
Johannes Berg670245e2010-08-23 07:56:55 -0700807 /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
808 .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
809 .advanced_bt_coexist = true,
Shanyu Zhao18089722010-05-06 10:15:21 -0700810};
811
812struct iwl_cfg iwl6000g2b_2abg_cfg = {
813 .name = "6000 Series 2x2 ABG Gen2b",
814 .fw_name_pre = IWL6000G2B_FW_PRE,
815 .ucode_api_max = IWL6000G2_UCODE_API_MAX,
816 .ucode_api_min = IWL6000G2_UCODE_API_MIN,
817 .sku = IWL_SKU_A|IWL_SKU_G,
818 .ops = &iwl6000g2b_ops,
819 .eeprom_size = OTP_LOW_IMAGE_SIZE,
820 .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
821 .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
822 .num_of_queues = IWLAGN_NUM_QUEUES,
823 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
824 .mod_params = &iwlagn_mod_params,
825 .valid_tx_ant = ANT_AB,
826 .valid_rx_ant = ANT_AB,
827 .pll_cfg_val = 0,
828 .set_l0s = true,
829 .use_bsm = false,
830 .pa_type = IWL_PA_SYSTEM,
831 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
832 .shadow_ram_support = true,
833 .led_compensation = 51,
834 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
835 .supports_idle = true,
836 .adv_thermal_throttle = true,
837 .support_ct_kill_exit = true,
Wey-Yi Guy74e5c412010-08-23 07:57:02 -0700838 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE,
Shanyu Zhao18089722010-05-06 10:15:21 -0700839 .chain_noise_scale = 1000,
Wey-Yi Guy3198c682010-07-23 13:19:40 -0700840 .monitor_recover_period = IWL_LONG_MONITORING_PERIOD,
Shanyu Zhao18089722010-05-06 10:15:21 -0700841 .max_event_log_size = 512,
Wey-Yi Guy679db792010-06-21 12:15:17 -0700842 .sensitivity_calib_by_driver = true,
843 .chain_noise_calib_by_driver = true,
Wey-Yi Guy178d1592010-06-15 16:14:53 -0700844 .need_dc_calib = true,
Wey-Yi Guyaf8ee052010-07-14 08:08:05 -0700845 .bt_statistics = true,
Johannes Berg670245e2010-08-23 07:56:55 -0700846 /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
847 .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
848 .advanced_bt_coexist = true,
Shanyu Zhao18089722010-05-06 10:15:21 -0700849};
850
Shanyu Zhao9f6e1ba2010-05-11 15:21:54 -0700851struct iwl_cfg iwl6000g2b_2bgn_cfg = {
852 .name = "6000 Series 2x2 BGN Gen2b",
853 .fw_name_pre = IWL6000G2B_FW_PRE,
854 .ucode_api_max = IWL6000G2_UCODE_API_MAX,
855 .ucode_api_min = IWL6000G2_UCODE_API_MIN,
856 .sku = IWL_SKU_G|IWL_SKU_N,
857 .ops = &iwl6000g2b_ops,
858 .eeprom_size = OTP_LOW_IMAGE_SIZE,
859 .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
860 .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
861 .num_of_queues = IWLAGN_NUM_QUEUES,
862 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
863 .mod_params = &iwlagn_mod_params,
864 .valid_tx_ant = ANT_AB,
865 .valid_rx_ant = ANT_AB,
866 .pll_cfg_val = 0,
867 .set_l0s = true,
868 .use_bsm = false,
869 .pa_type = IWL_PA_SYSTEM,
870 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
871 .shadow_ram_support = true,
872 .ht_greenfield_support = true,
873 .led_compensation = 51,
Johannes Berg94597ab2010-08-09 10:57:02 -0700874 .use_rts_for_aggregation = true, /* use rts/cts protection */
Shanyu Zhao9f6e1ba2010-05-11 15:21:54 -0700875 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
876 .supports_idle = true,
877 .adv_thermal_throttle = true,
878 .support_ct_kill_exit = true,
Wey-Yi Guy74e5c412010-08-23 07:57:02 -0700879 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE,
Shanyu Zhao9f6e1ba2010-05-11 15:21:54 -0700880 .chain_noise_scale = 1000,
Wey-Yi Guy3198c682010-07-23 13:19:40 -0700881 .monitor_recover_period = IWL_LONG_MONITORING_PERIOD,
Shanyu Zhao9f6e1ba2010-05-11 15:21:54 -0700882 .max_event_log_size = 512,
Wey-Yi Guy679db792010-06-21 12:15:17 -0700883 .sensitivity_calib_by_driver = true,
884 .chain_noise_calib_by_driver = true,
Wey-Yi Guy178d1592010-06-15 16:14:53 -0700885 .need_dc_calib = true,
Wey-Yi Guyaf8ee052010-07-14 08:08:05 -0700886 .bt_statistics = true,
Johannes Berg670245e2010-08-23 07:56:55 -0700887 /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
888 .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
889 .advanced_bt_coexist = true,
Shanyu Zhao9f6e1ba2010-05-11 15:21:54 -0700890};
891
Shanyu Zhao18089722010-05-06 10:15:21 -0700892struct iwl_cfg iwl6000g2b_2bg_cfg = {
893 .name = "6000 Series 2x2 BG Gen2b",
894 .fw_name_pre = IWL6000G2B_FW_PRE,
895 .ucode_api_max = IWL6000G2_UCODE_API_MAX,
896 .ucode_api_min = IWL6000G2_UCODE_API_MIN,
897 .sku = IWL_SKU_G,
898 .ops = &iwl6000g2b_ops,
899 .eeprom_size = OTP_LOW_IMAGE_SIZE,
900 .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
901 .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
902 .num_of_queues = IWLAGN_NUM_QUEUES,
903 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
904 .mod_params = &iwlagn_mod_params,
905 .valid_tx_ant = ANT_AB,
906 .valid_rx_ant = ANT_AB,
907 .pll_cfg_val = 0,
908 .set_l0s = true,
909 .use_bsm = false,
910 .pa_type = IWL_PA_SYSTEM,
911 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
912 .shadow_ram_support = true,
913 .led_compensation = 51,
914 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
915 .supports_idle = true,
916 .adv_thermal_throttle = true,
917 .support_ct_kill_exit = true,
Wey-Yi Guy74e5c412010-08-23 07:57:02 -0700918 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE,
Shanyu Zhao18089722010-05-06 10:15:21 -0700919 .chain_noise_scale = 1000,
Wey-Yi Guy3198c682010-07-23 13:19:40 -0700920 .monitor_recover_period = IWL_LONG_MONITORING_PERIOD,
Shanyu Zhao18089722010-05-06 10:15:21 -0700921 .max_event_log_size = 512,
Wey-Yi Guy679db792010-06-21 12:15:17 -0700922 .sensitivity_calib_by_driver = true,
923 .chain_noise_calib_by_driver = true,
Wey-Yi Guy178d1592010-06-15 16:14:53 -0700924 .need_dc_calib = true,
Wey-Yi Guyaf8ee052010-07-14 08:08:05 -0700925 .bt_statistics = true,
Johannes Berg670245e2010-08-23 07:56:55 -0700926 /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
927 .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
928 .advanced_bt_coexist = true,
Shanyu Zhao18089722010-05-06 10:15:21 -0700929};
930
931struct iwl_cfg iwl6000g2b_bgn_cfg = {
932 .name = "6000 Series 1x2 BGN Gen2b",
933 .fw_name_pre = IWL6000G2B_FW_PRE,
934 .ucode_api_max = IWL6000G2_UCODE_API_MAX,
935 .ucode_api_min = IWL6000G2_UCODE_API_MIN,
936 .sku = IWL_SKU_G|IWL_SKU_N,
937 .ops = &iwl6000g2b_ops,
938 .eeprom_size = OTP_LOW_IMAGE_SIZE,
939 .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
940 .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
941 .num_of_queues = IWLAGN_NUM_QUEUES,
942 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
943 .mod_params = &iwlagn_mod_params,
944 .valid_tx_ant = ANT_A,
945 .valid_rx_ant = ANT_AB,
946 .pll_cfg_val = 0,
947 .set_l0s = true,
948 .use_bsm = false,
949 .pa_type = IWL_PA_SYSTEM,
950 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
951 .shadow_ram_support = true,
952 .ht_greenfield_support = true,
953 .led_compensation = 51,
Johannes Berg94597ab2010-08-09 10:57:02 -0700954 .use_rts_for_aggregation = true, /* use rts/cts protection */
Shanyu Zhao18089722010-05-06 10:15:21 -0700955 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
956 .supports_idle = true,
957 .adv_thermal_throttle = true,
958 .support_ct_kill_exit = true,
Wey-Yi Guy74e5c412010-08-23 07:57:02 -0700959 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE,
Shanyu Zhao18089722010-05-06 10:15:21 -0700960 .chain_noise_scale = 1000,
Wey-Yi Guy3198c682010-07-23 13:19:40 -0700961 .monitor_recover_period = IWL_LONG_MONITORING_PERIOD,
Shanyu Zhao18089722010-05-06 10:15:21 -0700962 .max_event_log_size = 512,
Wey-Yi Guy679db792010-06-21 12:15:17 -0700963 .sensitivity_calib_by_driver = true,
964 .chain_noise_calib_by_driver = true,
Wey-Yi Guy178d1592010-06-15 16:14:53 -0700965 .need_dc_calib = true,
Wey-Yi Guyaf8ee052010-07-14 08:08:05 -0700966 .bt_statistics = true,
Johannes Berg670245e2010-08-23 07:56:55 -0700967 /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
968 .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
969 .advanced_bt_coexist = true,
Shanyu Zhao18089722010-05-06 10:15:21 -0700970};
971
972struct iwl_cfg iwl6000g2b_bg_cfg = {
973 .name = "6000 Series 1x2 BG Gen2b",
974 .fw_name_pre = IWL6000G2B_FW_PRE,
975 .ucode_api_max = IWL6000G2_UCODE_API_MAX,
976 .ucode_api_min = IWL6000G2_UCODE_API_MIN,
977 .sku = IWL_SKU_G,
978 .ops = &iwl6000g2b_ops,
979 .eeprom_size = OTP_LOW_IMAGE_SIZE,
980 .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
981 .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
982 .num_of_queues = IWLAGN_NUM_QUEUES,
983 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
984 .mod_params = &iwlagn_mod_params,
985 .valid_tx_ant = ANT_A,
986 .valid_rx_ant = ANT_AB,
987 .pll_cfg_val = 0,
988 .set_l0s = true,
989 .use_bsm = false,
990 .pa_type = IWL_PA_SYSTEM,
991 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
992 .shadow_ram_support = true,
993 .led_compensation = 51,
994 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
995 .supports_idle = true,
996 .adv_thermal_throttle = true,
997 .support_ct_kill_exit = true,
Wey-Yi Guy74e5c412010-08-23 07:57:02 -0700998 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE,
Shanyu Zhao18089722010-05-06 10:15:21 -0700999 .chain_noise_scale = 1000,
Wey-Yi Guy3198c682010-07-23 13:19:40 -07001000 .monitor_recover_period = IWL_LONG_MONITORING_PERIOD,
Shanyu Zhao18089722010-05-06 10:15:21 -07001001 .max_event_log_size = 512,
Wey-Yi Guy679db792010-06-21 12:15:17 -07001002 .sensitivity_calib_by_driver = true,
1003 .chain_noise_calib_by_driver = true,
Wey-Yi Guy178d1592010-06-15 16:14:53 -07001004 .need_dc_calib = true,
Wey-Yi Guyaf8ee052010-07-14 08:08:05 -07001005 .bt_statistics = true,
Johannes Berg670245e2010-08-23 07:56:55 -07001006 /* Due to bluetooth, we transmit 2.4 GHz probes only on antenna A */
1007 .scan_tx_antennas[IEEE80211_BAND_2GHZ] = ANT_A,
1008 .advanced_bt_coexist = true,
Shanyu Zhao18089722010-05-06 10:15:21 -07001009};
1010
Shanyu Zhao95b13012010-04-21 11:46:33 -07001011/*
1012 * "i": Internal configuration, use internal Power Amplifier
1013 */
Wey-Yi Guy65b79982009-07-31 14:28:07 -07001014struct iwl_cfg iwl6000i_2agn_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -08001015 .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN",
Wey-Yi Guy65b79982009-07-31 14:28:07 -07001016 .fw_name_pre = IWL6000_FW_PRE,
1017 .ucode_api_max = IWL6000_UCODE_API_MAX,
1018 .ucode_api_min = IWL6000_UCODE_API_MIN,
1019 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
1020 .ops = &iwl6000_ops,
Wey-Yi Guy415e4992009-08-13 13:30:54 -07001021 .eeprom_size = OTP_LOW_IMAGE_SIZE,
Wey-Yi Guy1f4b9662009-09-17 10:43:46 -07001022 .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
Wey-Yi Guy00e70592010-03-16 12:37:26 -07001023 .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -07001024 .num_of_queues = IWLAGN_NUM_QUEUES,
1025 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
Wey-Yi Guy348ee7cd2010-03-16 12:37:27 -07001026 .mod_params = &iwlagn_mod_params,
Wey-Yi Guy65b79982009-07-31 14:28:07 -07001027 .valid_tx_ant = ANT_BC,
1028 .valid_rx_ant = ANT_BC,
Ben Cahillfadb3582009-10-23 13:42:21 -07001029 .pll_cfg_val = 0,
Ben Cahilla6c5c732009-10-30 14:36:07 -07001030 .set_l0s = true,
Ben Cahillfadb3582009-10-23 13:42:21 -07001031 .use_bsm = false,
Wey-Yi Guy65b79982009-07-31 14:28:07 -07001032 .pa_type = IWL_PA_INTERNAL,
Wey-Yi Guy415e4992009-08-13 13:30:54 -07001033 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
1034 .shadow_ram_support = true,
Daniel C Halperinb2617932009-08-13 13:30:59 -07001035 .ht_greenfield_support = true,
Wey-Yi Guyf2d0d0e2009-09-11 10:38:14 -07001036 .led_compensation = 51,
Johannes Berg94597ab2010-08-09 10:57:02 -07001037 .use_rts_for_aggregation = true, /* use rts/cts protection */
Wey-Yi Guyd8c07e72009-09-25 14:24:26 -07001038 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
Johannes Berg78f5fb72009-09-25 14:24:27 -07001039 .supports_idle = true,
Wey-Yi Guy6047b4f2009-10-23 13:42:27 -07001040 .adv_thermal_throttle = true,
Wey-Yi Guy480e8402009-10-23 13:42:28 -07001041 .support_ct_kill_exit = true,
Trieu 'Andrew' Nguyen3e4fb5f2010-01-22 14:22:46 -08001042 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
Ben Cahilld4fe5ac2010-02-05 11:33:46 -08001043 .chain_noise_scale = 1000,
Wey-Yi Guyce606592010-07-23 13:19:39 -07001044 .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
Wey-Yi Guy678b3852010-03-26 12:54:37 -07001045 .max_event_log_size = 1024,
Wey-Yi Guy6e5c8002010-04-27 14:00:28 -07001046 .ucode_tracing = true,
Wey-Yi Guy65d1f892010-04-25 15:41:43 -07001047 .sensitivity_calib_by_driver = true,
1048 .chain_noise_calib_by_driver = true,
Jay Sternberge1228372009-01-19 15:30:34 -08001049};
1050
Wey-Yi Guy5953a622009-09-17 10:43:53 -07001051struct iwl_cfg iwl6000i_2abg_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -08001052 .name = "Intel(R) Centrino(R) Advanced-N 6200 ABG",
Wey-Yi Guy5953a622009-09-17 10:43:53 -07001053 .fw_name_pre = IWL6000_FW_PRE,
1054 .ucode_api_max = IWL6000_UCODE_API_MAX,
1055 .ucode_api_min = IWL6000_UCODE_API_MIN,
1056 .sku = IWL_SKU_A|IWL_SKU_G,
1057 .ops = &iwl6000_ops,
1058 .eeprom_size = OTP_LOW_IMAGE_SIZE,
1059 .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
Wey-Yi Guy00e70592010-03-16 12:37:26 -07001060 .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -07001061 .num_of_queues = IWLAGN_NUM_QUEUES,
1062 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
Wey-Yi Guy348ee7cd2010-03-16 12:37:27 -07001063 .mod_params = &iwlagn_mod_params,
Wey-Yi Guy5953a622009-09-17 10:43:53 -07001064 .valid_tx_ant = ANT_BC,
1065 .valid_rx_ant = ANT_BC,
Ben Cahillfadb3582009-10-23 13:42:21 -07001066 .pll_cfg_val = 0,
Ben Cahilla6c5c732009-10-30 14:36:07 -07001067 .set_l0s = true,
Ben Cahillfadb3582009-10-23 13:42:21 -07001068 .use_bsm = false,
Wey-Yi Guy5953a622009-09-17 10:43:53 -07001069 .pa_type = IWL_PA_INTERNAL,
1070 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
1071 .shadow_ram_support = true,
Wey-Yi Guy5953a622009-09-17 10:43:53 -07001072 .led_compensation = 51,
Wey-Yi Guyd8c07e72009-09-25 14:24:26 -07001073 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
Johannes Berg78f5fb72009-09-25 14:24:27 -07001074 .supports_idle = true,
Wey-Yi Guy6047b4f2009-10-23 13:42:27 -07001075 .adv_thermal_throttle = true,
Wey-Yi Guy480e8402009-10-23 13:42:28 -07001076 .support_ct_kill_exit = true,
Trieu 'Andrew' Nguyen3e4fb5f2010-01-22 14:22:46 -08001077 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
Ben Cahilld4fe5ac2010-02-05 11:33:46 -08001078 .chain_noise_scale = 1000,
Wey-Yi Guyce606592010-07-23 13:19:39 -07001079 .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
Wey-Yi Guy678b3852010-03-26 12:54:37 -07001080 .max_event_log_size = 1024,
Wey-Yi Guy6e5c8002010-04-27 14:00:28 -07001081 .ucode_tracing = true,
Wey-Yi Guy65d1f892010-04-25 15:41:43 -07001082 .sensitivity_calib_by_driver = true,
1083 .chain_noise_calib_by_driver = true,
Wey-Yi Guy5953a622009-09-17 10:43:53 -07001084};
1085
1086struct iwl_cfg iwl6000i_2bg_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -08001087 .name = "Intel(R) Centrino(R) Advanced-N 6200 BG",
Wey-Yi Guy5953a622009-09-17 10:43:53 -07001088 .fw_name_pre = IWL6000_FW_PRE,
1089 .ucode_api_max = IWL6000_UCODE_API_MAX,
1090 .ucode_api_min = IWL6000_UCODE_API_MIN,
1091 .sku = IWL_SKU_G,
1092 .ops = &iwl6000_ops,
1093 .eeprom_size = OTP_LOW_IMAGE_SIZE,
1094 .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
Wey-Yi Guy00e70592010-03-16 12:37:26 -07001095 .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -07001096 .num_of_queues = IWLAGN_NUM_QUEUES,
1097 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
Wey-Yi Guy348ee7cd2010-03-16 12:37:27 -07001098 .mod_params = &iwlagn_mod_params,
Wey-Yi Guy5953a622009-09-17 10:43:53 -07001099 .valid_tx_ant = ANT_BC,
1100 .valid_rx_ant = ANT_BC,
Ben Cahillfadb3582009-10-23 13:42:21 -07001101 .pll_cfg_val = 0,
Ben Cahilla6c5c732009-10-30 14:36:07 -07001102 .set_l0s = true,
Ben Cahillfadb3582009-10-23 13:42:21 -07001103 .use_bsm = false,
Wey-Yi Guy5953a622009-09-17 10:43:53 -07001104 .pa_type = IWL_PA_INTERNAL,
1105 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
1106 .shadow_ram_support = true,
Wey-Yi Guy5953a622009-09-17 10:43:53 -07001107 .led_compensation = 51,
Wey-Yi Guyd8c07e72009-09-25 14:24:26 -07001108 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
Johannes Berg78f5fb72009-09-25 14:24:27 -07001109 .supports_idle = true,
Wey-Yi Guy6047b4f2009-10-23 13:42:27 -07001110 .adv_thermal_throttle = true,
Wey-Yi Guy480e8402009-10-23 13:42:28 -07001111 .support_ct_kill_exit = true,
Trieu 'Andrew' Nguyen3e4fb5f2010-01-22 14:22:46 -08001112 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
Ben Cahilld4fe5ac2010-02-05 11:33:46 -08001113 .chain_noise_scale = 1000,
Wey-Yi Guyce606592010-07-23 13:19:39 -07001114 .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
Wey-Yi Guy678b3852010-03-26 12:54:37 -07001115 .max_event_log_size = 1024,
Wey-Yi Guy6e5c8002010-04-27 14:00:28 -07001116 .ucode_tracing = true,
Wey-Yi Guy65d1f892010-04-25 15:41:43 -07001117 .sensitivity_calib_by_driver = true,
1118 .chain_noise_calib_by_driver = true,
Wey-Yi Guy5953a622009-09-17 10:43:53 -07001119};
1120
Jay Sternberge1228372009-01-19 15:30:34 -08001121struct iwl_cfg iwl6050_2agn_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -08001122 .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN",
Jay Sternberge1228372009-01-19 15:30:34 -08001123 .fw_name_pre = IWL6050_FW_PRE,
1124 .ucode_api_max = IWL6050_UCODE_API_MAX,
1125 .ucode_api_min = IWL6050_UCODE_API_MIN,
1126 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
Wey-Yi Guy178d1592010-06-15 16:14:53 -07001127 .ops = &iwl6000_ops,
Wey-Yi Guy415e4992009-08-13 13:30:54 -07001128 .eeprom_size = OTP_LOW_IMAGE_SIZE,
Wey-Yi Guy32b7e242009-10-16 14:25:51 -07001129 .eeprom_ver = EEPROM_6050_EEPROM_VERSION,
Wey-Yi Guy00e70592010-03-16 12:37:26 -07001130 .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -07001131 .num_of_queues = IWLAGN_NUM_QUEUES,
1132 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
Wey-Yi Guy348ee7cd2010-03-16 12:37:27 -07001133 .mod_params = &iwlagn_mod_params,
Jay Sternberg542cc792009-05-08 13:44:46 -07001134 .valid_tx_ant = ANT_AB,
1135 .valid_rx_ant = ANT_AB,
Ben Cahillfadb3582009-10-23 13:42:21 -07001136 .pll_cfg_val = 0,
Ben Cahilla6c5c732009-10-30 14:36:07 -07001137 .set_l0s = true,
Ben Cahillfadb3582009-10-23 13:42:21 -07001138 .use_bsm = false,
Wey-Yi Guy65b79982009-07-31 14:28:07 -07001139 .pa_type = IWL_PA_SYSTEM,
Wey-Yi Guy3ab312a2009-10-16 14:25:52 -07001140 .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
Wey-Yi Guy415e4992009-08-13 13:30:54 -07001141 .shadow_ram_support = true,
Daniel C Halperinb2617932009-08-13 13:30:59 -07001142 .ht_greenfield_support = true,
Wey-Yi Guyf2d0d0e2009-09-11 10:38:14 -07001143 .led_compensation = 51,
Johannes Berg94597ab2010-08-09 10:57:02 -07001144 .use_rts_for_aggregation = true, /* use rts/cts protection */
Wey-Yi Guyd8c07e72009-09-25 14:24:26 -07001145 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
Johannes Berg78f5fb72009-09-25 14:24:27 -07001146 .supports_idle = true,
Wey-Yi Guy6047b4f2009-10-23 13:42:27 -07001147 .adv_thermal_throttle = true,
Wey-Yi Guy480e8402009-10-23 13:42:28 -07001148 .support_ct_kill_exit = true,
Trieu 'Andrew' Nguyen3e4fb5f2010-01-22 14:22:46 -08001149 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
Ben Cahilld4fe5ac2010-02-05 11:33:46 -08001150 .chain_noise_scale = 1500,
Wey-Yi Guyce606592010-07-23 13:19:39 -07001151 .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
Wey-Yi Guy678b3852010-03-26 12:54:37 -07001152 .max_event_log_size = 1024,
Wey-Yi Guy6e5c8002010-04-27 14:00:28 -07001153 .ucode_tracing = true,
Wey-Yi Guy65d1f892010-04-25 15:41:43 -07001154 .sensitivity_calib_by_driver = true,
1155 .chain_noise_calib_by_driver = true,
Wey-Yi Guy178d1592010-06-15 16:14:53 -07001156 .need_dc_calib = true,
Jay Sternberge1228372009-01-19 15:30:34 -08001157};
1158
Shanyu Zhao03264332010-06-29 17:27:27 -07001159struct iwl_cfg iwl6050g2_bgn_cfg = {
1160 .name = "6050 Series 1x2 BGN Gen2",
1161 .fw_name_pre = IWL6050_FW_PRE,
1162 .ucode_api_max = IWL6050_UCODE_API_MAX,
1163 .ucode_api_min = IWL6050_UCODE_API_MIN,
1164 .sku = IWL_SKU_G|IWL_SKU_N,
1165 .ops = &iwl6000_ops,
1166 .eeprom_size = OTP_LOW_IMAGE_SIZE,
1167 .eeprom_ver = EEPROM_6050G2_EEPROM_VERSION,
1168 .eeprom_calib_ver = EEPROM_6050G2_TX_POWER_VERSION,
1169 .num_of_queues = IWLAGN_NUM_QUEUES,
1170 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
1171 .mod_params = &iwlagn_mod_params,
1172 .valid_tx_ant = ANT_A,
1173 .valid_rx_ant = ANT_AB,
1174 .pll_cfg_val = 0,
1175 .set_l0s = true,
1176 .use_bsm = false,
1177 .pa_type = IWL_PA_SYSTEM,
1178 .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
1179 .shadow_ram_support = true,
1180 .ht_greenfield_support = true,
1181 .led_compensation = 51,
Johannes Berg94597ab2010-08-09 10:57:02 -07001182 .use_rts_for_aggregation = true, /* use rts/cts protection */
Shanyu Zhao03264332010-06-29 17:27:27 -07001183 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
1184 .supports_idle = true,
1185 .adv_thermal_throttle = true,
1186 .support_ct_kill_exit = true,
1187 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
1188 .chain_noise_scale = 1500,
Wey-Yi Guyce606592010-07-23 13:19:39 -07001189 .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
Shanyu Zhao03264332010-06-29 17:27:27 -07001190 .max_event_log_size = 1024,
1191 .ucode_tracing = true,
1192 .sensitivity_calib_by_driver = true,
1193 .chain_noise_calib_by_driver = true,
1194 .need_dc_calib = true,
1195};
1196
Wey-Yi Guy5953a622009-09-17 10:43:53 -07001197struct iwl_cfg iwl6050_2abg_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -08001198 .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 ABG",
Wey-Yi Guy5953a622009-09-17 10:43:53 -07001199 .fw_name_pre = IWL6050_FW_PRE,
1200 .ucode_api_max = IWL6050_UCODE_API_MAX,
1201 .ucode_api_min = IWL6050_UCODE_API_MIN,
1202 .sku = IWL_SKU_A|IWL_SKU_G,
Wey-Yi Guy178d1592010-06-15 16:14:53 -07001203 .ops = &iwl6000_ops,
Wey-Yi Guy5953a622009-09-17 10:43:53 -07001204 .eeprom_size = OTP_LOW_IMAGE_SIZE,
Wey-Yi Guy32b7e242009-10-16 14:25:51 -07001205 .eeprom_ver = EEPROM_6050_EEPROM_VERSION,
Wey-Yi Guy00e70592010-03-16 12:37:26 -07001206 .eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -07001207 .num_of_queues = IWLAGN_NUM_QUEUES,
1208 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
Wey-Yi Guy348ee7cd2010-03-16 12:37:27 -07001209 .mod_params = &iwlagn_mod_params,
Wey-Yi Guy5953a622009-09-17 10:43:53 -07001210 .valid_tx_ant = ANT_AB,
1211 .valid_rx_ant = ANT_AB,
Ben Cahillfadb3582009-10-23 13:42:21 -07001212 .pll_cfg_val = 0,
Ben Cahilla6c5c732009-10-30 14:36:07 -07001213 .set_l0s = true,
Ben Cahillfadb3582009-10-23 13:42:21 -07001214 .use_bsm = false,
Wey-Yi Guy5953a622009-09-17 10:43:53 -07001215 .pa_type = IWL_PA_SYSTEM,
Wey-Yi Guy3ab312a2009-10-16 14:25:52 -07001216 .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
Wey-Yi Guy5953a622009-09-17 10:43:53 -07001217 .shadow_ram_support = true,
Wey-Yi Guy5953a622009-09-17 10:43:53 -07001218 .led_compensation = 51,
Wey-Yi Guyd8c07e72009-09-25 14:24:26 -07001219 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
Johannes Berg78f5fb72009-09-25 14:24:27 -07001220 .supports_idle = true,
Wey-Yi Guy6047b4f2009-10-23 13:42:27 -07001221 .adv_thermal_throttle = true,
Wey-Yi Guy480e8402009-10-23 13:42:28 -07001222 .support_ct_kill_exit = true,
Trieu 'Andrew' Nguyen3e4fb5f2010-01-22 14:22:46 -08001223 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
Ben Cahilld4fe5ac2010-02-05 11:33:46 -08001224 .chain_noise_scale = 1500,
Wey-Yi Guyce606592010-07-23 13:19:39 -07001225 .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
Wey-Yi Guy678b3852010-03-26 12:54:37 -07001226 .max_event_log_size = 1024,
Wey-Yi Guy6e5c8002010-04-27 14:00:28 -07001227 .ucode_tracing = true,
Wey-Yi Guy65d1f892010-04-25 15:41:43 -07001228 .sensitivity_calib_by_driver = true,
1229 .chain_noise_calib_by_driver = true,
Wey-Yi Guy178d1592010-06-15 16:14:53 -07001230 .need_dc_calib = true,
Wey-Yi Guy5953a622009-09-17 10:43:53 -07001231};
1232
Jay Sternberge1228372009-01-19 15:30:34 -08001233struct iwl_cfg iwl6000_3agn_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -08001234 .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN",
Jay Sternberge1228372009-01-19 15:30:34 -08001235 .fw_name_pre = IWL6000_FW_PRE,
1236 .ucode_api_max = IWL6000_UCODE_API_MAX,
1237 .ucode_api_min = IWL6000_UCODE_API_MIN,
1238 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
Jay Sternberg29f35c12009-01-29 11:09:16 -08001239 .ops = &iwl6000_ops,
Wey-Yi Guy415e4992009-08-13 13:30:54 -07001240 .eeprom_size = OTP_LOW_IMAGE_SIZE,
Wey-Yi Guy1f4b9662009-09-17 10:43:46 -07001241 .eeprom_ver = EEPROM_6000_EEPROM_VERSION,
Wey-Yi Guy00e70592010-03-16 12:37:26 -07001242 .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -07001243 .num_of_queues = IWLAGN_NUM_QUEUES,
1244 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
Wey-Yi Guy348ee7cd2010-03-16 12:37:27 -07001245 .mod_params = &iwlagn_mod_params,
Jay Sternbergc0bac762009-02-02 16:21:14 -08001246 .valid_tx_ant = ANT_ABC,
1247 .valid_rx_ant = ANT_ABC,
Ben Cahillfadb3582009-10-23 13:42:21 -07001248 .pll_cfg_val = 0,
Ben Cahilla6c5c732009-10-30 14:36:07 -07001249 .set_l0s = true,
Ben Cahillfadb3582009-10-23 13:42:21 -07001250 .use_bsm = false,
Wey-Yi Guy65b79982009-07-31 14:28:07 -07001251 .pa_type = IWL_PA_SYSTEM,
Wey-Yi Guy415e4992009-08-13 13:30:54 -07001252 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
1253 .shadow_ram_support = true,
Daniel C Halperinb2617932009-08-13 13:30:59 -07001254 .ht_greenfield_support = true,
Wey-Yi Guyf2d0d0e2009-09-11 10:38:14 -07001255 .led_compensation = 51,
Johannes Berg94597ab2010-08-09 10:57:02 -07001256 .use_rts_for_aggregation = true, /* use rts/cts protection */
Wey-Yi Guyd8c07e72009-09-25 14:24:26 -07001257 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
Johannes Berg78f5fb72009-09-25 14:24:27 -07001258 .supports_idle = true,
Wey-Yi Guy6047b4f2009-10-23 13:42:27 -07001259 .adv_thermal_throttle = true,
Wey-Yi Guy480e8402009-10-23 13:42:28 -07001260 .support_ct_kill_exit = true,
Trieu 'Andrew' Nguyen3e4fb5f2010-01-22 14:22:46 -08001261 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
Ben Cahilld4fe5ac2010-02-05 11:33:46 -08001262 .chain_noise_scale = 1000,
Wey-Yi Guyce606592010-07-23 13:19:39 -07001263 .monitor_recover_period = IWL_DEF_MONITORING_PERIOD,
Wey-Yi Guy678b3852010-03-26 12:54:37 -07001264 .max_event_log_size = 1024,
Wey-Yi Guy6e5c8002010-04-27 14:00:28 -07001265 .ucode_tracing = true,
Wey-Yi Guy65d1f892010-04-25 15:41:43 -07001266 .sensitivity_calib_by_driver = true,
1267 .chain_noise_calib_by_driver = true,
Jay Sternberge1228372009-01-19 15:30:34 -08001268};
1269
Jay Sternberge1228372009-01-19 15:30:34 -08001270MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
1271MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
Shanyu Zhao95b13012010-04-21 11:46:33 -07001272MODULE_FIRMWARE(IWL6000G2A_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
Shanyu Zhao18089722010-05-06 10:15:21 -07001273MODULE_FIRMWARE(IWL6000G2B_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));