blob: 9128ccd8dfaee9ae0b1bd4e3e886ba9fce2905bf [file] [log] [blame]
Tomas Winkler5a6a2562008-04-24 11:55:23 -07001/******************************************************************************
2 *
Reinette Chatre1f447802010-01-15 13:43:41 -08003 * Copyright(c) 2007 - 2010 Intel Corporation. All rights reserved.
Tomas Winkler5a6a2562008-04-24 11:55:23 -07004 *
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 Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
23 *
24 *****************************************************************************/
25
26#include <linux/kernel.h>
27#include <linux/module.h>
Tomas Winkler5a6a2562008-04-24 11:55:23 -070028#include <linux/init.h>
29#include <linux/pci.h>
30#include <linux/dma-mapping.h>
31#include <linux/delay.h>
Alexey Dobriyand43c36d2009-10-07 17:09:06 +040032#include <linux/sched.h>
Tomas Winkler5a6a2562008-04-24 11:55:23 -070033#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"
Tomas Winkler3e0d4cb2008-04-24 11:55:38 -070041#include "iwl-dev.h"
Tomas Winkler5a6a2562008-04-24 11:55:23 -070042#include "iwl-core.h"
43#include "iwl-io.h"
Tomas Winklere26e47d2008-06-12 09:46:56 +080044#include "iwl-sta.h"
Tomas Winkler5a6a2562008-04-24 11:55:23 -070045#include "iwl-helpers.h"
Johannes Berga1175122010-01-21 06:21:10 -080046#include "iwl-agn.h"
Johannes Berge932a602009-10-02 13:44:03 -070047#include "iwl-agn-led.h"
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -070048#include "iwl-agn-hw.h"
Tomas Winkler5a6a2562008-04-24 11:55:23 -070049#include "iwl-5000-hw.h"
Jay Sternbergc0bac762009-02-02 16:21:14 -080050#include "iwl-6000-hw.h"
Tomas Winkler5a6a2562008-04-24 11:55:23 -070051
Reinette Chatrea0987a82008-12-02 12:14:06 -080052/* Highest firmware API version supported */
Jay Sternbergc9d2fbf2009-05-19 14:56:36 -070053#define IWL5000_UCODE_API_MAX 2
Jay Sternberg39e6d222009-02-27 16:21:19 -080054#define IWL5150_UCODE_API_MAX 2
Tomas Winkler5a6a2562008-04-24 11:55:23 -070055
Reinette Chatrea0987a82008-12-02 12:14:06 -080056/* Lowest firmware API version supported */
57#define IWL5000_UCODE_API_MIN 1
58#define IWL5150_UCODE_API_MIN 1
59
60#define IWL5000_FW_PRE "iwlwifi-5000-"
61#define _IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE #api ".ucode"
62#define IWL5000_MODULE_FIRMWARE(api) _IWL5000_MODULE_FIRMWARE(api)
63
64#define IWL5150_FW_PRE "iwlwifi-5150-"
65#define _IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE #api ".ucode"
66#define IWL5150_MODULE_FIRMWARE(api) _IWL5150_MODULE_FIRMWARE(api)
Jay Sternberg4e062f92008-10-14 12:32:41 -070067
Wey-Yi Guy9371d4e2009-09-11 10:38:10 -070068/* NIC configuration for 5000 series */
Wey-Yi Guy672639d2009-07-24 11:13:01 -070069void iwl5000_nic_config(struct iwl_priv *priv)
Tomas Winklere86fe9f2008-04-24 11:55:36 -070070{
71 unsigned long flags;
72 u16 radio_cfg;
Tomas Winklere86fe9f2008-04-24 11:55:36 -070073
74 spin_lock_irqsave(&priv->lock, flags);
75
Tomas Winklere86fe9f2008-04-24 11:55:36 -070076 radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG);
77
78 /* write radio config values to register */
Wey-Yi Guy9371d4e2009-09-11 10:38:10 -070079 if (EEPROM_RF_CFG_TYPE_MSK(radio_cfg) < EEPROM_RF_CONFIG_TYPE_MAX)
Tomas Winklere86fe9f2008-04-24 11:55:36 -070080 iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
81 EEPROM_RF_CFG_TYPE_MSK(radio_cfg) |
82 EEPROM_RF_CFG_STEP_MSK(radio_cfg) |
83 EEPROM_RF_CFG_DASH_MSK(radio_cfg));
84
85 /* set CSR_HW_CONFIG_REG for uCode use */
86 iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
87 CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI |
88 CSR_HW_IF_CONFIG_REG_BIT_MAC_SI);
89
Tomas Winkler4c43e0d2008-08-04 16:00:39 +080090 /* W/A : NIC is stuck in a reset state after Early PCIe power off
91 * (PCIe power is lost before PERST# is asserted),
92 * causing ME FW to lose ownership and not being able to obtain it back.
93 */
Tomas Winkler2d3db672008-08-04 16:00:47 +080094 iwl_set_bits_mask_prph(priv, APMG_PS_CTRL_REG,
Tomas Winkler4c43e0d2008-08-04 16:00:39 +080095 APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS,
96 ~APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS);
97
Wey-Yi Guy02c06e42009-07-17 09:30:14 -070098
Tomas Winklere86fe9f2008-04-24 11:55:36 -070099 spin_unlock_irqrestore(&priv->lock, flags);
100}
101
102
Tomas Winkler25ae3982008-04-24 11:55:27 -0700103/*
104 * EEPROM
105 */
106static u32 eeprom_indirect_address(const struct iwl_priv *priv, u32 address)
107{
108 u16 offset = 0;
109
110 if ((address & INDIRECT_ADDRESS) == 0)
111 return address;
112
113 switch (address & INDIRECT_TYPE_MSK) {
114 case INDIRECT_HOST:
115 offset = iwl_eeprom_query16(priv, EEPROM_5000_LINK_HOST);
116 break;
117 case INDIRECT_GENERAL:
118 offset = iwl_eeprom_query16(priv, EEPROM_5000_LINK_GENERAL);
119 break;
120 case INDIRECT_REGULATORY:
121 offset = iwl_eeprom_query16(priv, EEPROM_5000_LINK_REGULATORY);
122 break;
123 case INDIRECT_CALIBRATION:
124 offset = iwl_eeprom_query16(priv, EEPROM_5000_LINK_CALIBRATION);
125 break;
126 case INDIRECT_PROCESS_ADJST:
127 offset = iwl_eeprom_query16(priv, EEPROM_5000_LINK_PROCESS_ADJST);
128 break;
129 case INDIRECT_OTHERS:
130 offset = iwl_eeprom_query16(priv, EEPROM_5000_LINK_OTHERS);
131 break;
132 default:
Winkler, Tomas15b16872008-12-19 10:37:33 +0800133 IWL_ERR(priv, "illegal indirect type: 0x%X\n",
Tomas Winkler25ae3982008-04-24 11:55:27 -0700134 address & INDIRECT_TYPE_MSK);
135 break;
136 }
137
138 /* translate the offset from words to byte */
139 return (address & ADDRESS_MSK) + (offset << 1);
140}
141
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700142u16 iwl5000_eeprom_calib_version(struct iwl_priv *priv)
Tomas Winklerf1f69412008-04-24 11:55:35 -0700143{
Tomas Winklerf1f69412008-04-24 11:55:35 -0700144 struct iwl_eeprom_calib_hdr {
145 u8 version;
146 u8 pa_type;
147 u16 voltage;
148 } *hdr;
149
Tomas Winklerf1f69412008-04-24 11:55:35 -0700150 hdr = (struct iwl_eeprom_calib_hdr *)iwl_eeprom_query_addr(priv,
151 EEPROM_5000_CALIB_ALL);
Tomas Winkler0ef2ca62008-10-23 23:48:51 -0700152 return hdr->version;
Tomas Winklerf1f69412008-04-24 11:55:35 -0700153
154}
155
Emmanuel Grumbach33fd5032008-04-24 11:55:30 -0700156static struct iwl_sensitivity_ranges iwl5000_sensitivity = {
157 .min_nrg_cck = 95,
Wey-Yi Guyfe6efb42009-06-12 13:22:54 -0700158 .max_nrg_cck = 0, /* not used, set to 0 */
Emmanuel Grumbach33fd5032008-04-24 11:55:30 -0700159 .auto_corr_min_ofdm = 90,
160 .auto_corr_min_ofdm_mrc = 170,
161 .auto_corr_min_ofdm_x1 = 120,
162 .auto_corr_min_ofdm_mrc_x1 = 240,
163
164 .auto_corr_max_ofdm = 120,
165 .auto_corr_max_ofdm_mrc = 210,
Wey-Yi Guy9bead762010-01-20 12:22:53 -0800166 .auto_corr_max_ofdm_x1 = 120,
167 .auto_corr_max_ofdm_mrc_x1 = 240,
Emmanuel Grumbach33fd5032008-04-24 11:55:30 -0700168
169 .auto_corr_min_cck = 125,
170 .auto_corr_max_cck = 200,
171 .auto_corr_min_cck_mrc = 170,
172 .auto_corr_max_cck_mrc = 400,
173 .nrg_th_cck = 95,
174 .nrg_th_ofdm = 95,
Wey-Yi Guy55036d62009-10-09 13:20:24 -0700175
176 .barker_corr_th_min = 190,
177 .barker_corr_th_min_mrc = 390,
178 .nrg_th_cca = 62,
Emmanuel Grumbach33fd5032008-04-24 11:55:30 -0700179};
180
Wey-Yi Guy9d671872009-06-12 13:22:53 -0700181static struct iwl_sensitivity_ranges iwl5150_sensitivity = {
182 .min_nrg_cck = 95,
183 .max_nrg_cck = 0, /* not used, set to 0 */
184 .auto_corr_min_ofdm = 90,
185 .auto_corr_min_ofdm_mrc = 170,
186 .auto_corr_min_ofdm_x1 = 105,
187 .auto_corr_min_ofdm_mrc_x1 = 220,
188
189 .auto_corr_max_ofdm = 120,
190 .auto_corr_max_ofdm_mrc = 210,
191 /* max = min for performance bug in 5150 DSP */
192 .auto_corr_max_ofdm_x1 = 105,
193 .auto_corr_max_ofdm_mrc_x1 = 220,
194
195 .auto_corr_min_cck = 125,
196 .auto_corr_max_cck = 200,
197 .auto_corr_min_cck_mrc = 170,
198 .auto_corr_max_cck_mrc = 400,
199 .nrg_th_cck = 95,
200 .nrg_th_ofdm = 95,
Wey-Yi Guy55036d62009-10-09 13:20:24 -0700201
202 .barker_corr_th_min = 190,
203 .barker_corr_th_min_mrc = 390,
204 .nrg_th_cca = 62,
Wey-Yi Guy9d671872009-06-12 13:22:53 -0700205};
206
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700207const u8 *iwl5000_eeprom_query_addr(const struct iwl_priv *priv,
Tomas Winkler25ae3982008-04-24 11:55:27 -0700208 size_t offset)
209{
210 u32 address = eeprom_indirect_address(priv, offset);
211 BUG_ON(address >= priv->cfg->eeprom_size);
212 return &priv->eeprom[address];
213}
214
Wey-Yi Guy62161ae2009-05-21 13:44:23 -0700215static void iwl5150_set_ct_threshold(struct iwl_priv *priv)
Tomas Winkler339afc82008-12-01 16:32:20 -0800216{
Wey-Yi Guy62161ae2009-05-21 13:44:23 -0700217 const s32 volt2temp_coef = IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF;
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700218 s32 threshold = (s32)CELSIUS_TO_KELVIN(CT_KILL_THRESHOLD_LEGACY) -
Wey-Yi Guy62161ae2009-05-21 13:44:23 -0700219 iwl_temp_calib_to_offset(priv);
220
221 priv->hw_params.ct_kill_threshold = threshold * volt2temp_coef;
222}
223
224static void iwl5000_set_ct_threshold(struct iwl_priv *priv)
225{
226 /* want Celsius */
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700227 priv->hw_params.ct_kill_threshold = CT_KILL_THRESHOLD_LEGACY;
Tomas Winkler339afc82008-12-01 16:32:20 -0800228}
229
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700230int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
Tomas Winklerfdd3e8a2008-04-24 11:55:28 -0700231{
Wey-Yi Guy88804e22009-10-09 13:20:28 -0700232 if (priv->cfg->mod_params->num_of_queues >= IWL_MIN_NUM_QUEUES &&
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700233 priv->cfg->mod_params->num_of_queues <= IWLAGN_NUM_QUEUES)
Wey-Yi Guy88804e22009-10-09 13:20:28 -0700234 priv->cfg->num_of_queues =
235 priv->cfg->mod_params->num_of_queues;
Tomas Winkler25ae3982008-04-24 11:55:27 -0700236
Wey-Yi Guy88804e22009-10-09 13:20:28 -0700237 priv->hw_params.max_txq_num = priv->cfg->num_of_queues;
Zhu Yif3f911d2008-12-02 12:14:04 -0800238 priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM;
Tomas Winkler4ddbb7d2008-11-07 09:58:40 -0800239 priv->hw_params.scd_bc_tbls_size =
Wey-Yi Guy88804e22009-10-09 13:20:28 -0700240 priv->cfg->num_of_queues *
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700241 sizeof(struct iwlagn_scd_bc_tbl);
Samuel Ortiza8e74e22009-01-23 13:45:14 -0800242 priv->hw_params.tfd_size = sizeof(struct iwl_tfd);
Tomas Winklerfdd3e8a2008-04-24 11:55:28 -0700243 priv->hw_params.max_stations = IWL5000_STATION_COUNT;
244 priv->hw_params.bcast_sta_id = IWL5000_BROADCAST_ID;
Jay Sternbergc0bac762009-02-02 16:21:14 -0800245
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700246 priv->hw_params.max_data_size = IWLAGN_RTC_DATA_SIZE;
247 priv->hw_params.max_inst_size = IWLAGN_RTC_INST_SIZE;
Jay Sternbergc0bac762009-02-02 16:21:14 -0800248
Ron Rindjunskyda154e32008-06-30 17:23:20 +0800249 priv->hw_params.max_bsm_size = 0;
Wey-Yi Guy7aafef12009-08-07 15:41:38 -0700250 priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
Tomas Winklerfdd3e8a2008-04-24 11:55:28 -0700251 BIT(IEEE80211_BAND_5GHZ);
Winkler, Tomas141c43a2009-01-08 10:19:53 -0800252 priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
253
Jay Sternbergc0bac762009-02-02 16:21:14 -0800254 priv->hw_params.tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant);
255 priv->hw_params.rx_chains_num = num_of_ant(priv->cfg->valid_rx_ant);
256 priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
257 priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
Emmanuel Grumbachc031bf82008-04-24 11:55:29 -0700258
Wey-Yi Guy62161ae2009-05-21 13:44:23 -0700259 if (priv->cfg->ops->lib->temp_ops.set_ct_kill)
260 priv->cfg->ops->lib->temp_ops.set_ct_kill(priv);
Emmanuel Grumbachc031bf82008-04-24 11:55:29 -0700261
Wey-Yi Guy9d671872009-06-12 13:22:53 -0700262 /* Set initial sensitivity parameters */
Tomas Winklerbe5d56e2008-10-08 09:37:27 +0800263 /* Set initial calibration set */
264 switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) {
Tomas Winklerbe5d56e2008-10-08 09:37:27 +0800265 case CSR_HW_REV_TYPE_5150:
Wey-Yi Guy9d671872009-06-12 13:22:53 -0700266 priv->hw_params.sens = &iwl5150_sensitivity;
Tomas Winkler819500c2008-12-01 16:32:19 -0800267 priv->hw_params.calib_init_cfg =
Winkler, Tomas7470d7f2008-12-01 16:32:22 -0800268 BIT(IWL_CALIB_DC) |
269 BIT(IWL_CALIB_LO) |
270 BIT(IWL_CALIB_TX_IQ) |
271 BIT(IWL_CALIB_BASE_BAND);
Tomas Winkler819500c2008-12-01 16:32:19 -0800272
Tomas Winklerbe5d56e2008-10-08 09:37:27 +0800273 break;
Jay Sternbergc0bac762009-02-02 16:21:14 -0800274 default:
Wey-Yi Guy9d671872009-06-12 13:22:53 -0700275 priv->hw_params.sens = &iwl5000_sensitivity;
Jay Sternbergc0bac762009-02-02 16:21:14 -0800276 priv->hw_params.calib_init_cfg =
277 BIT(IWL_CALIB_XTAL) |
278 BIT(IWL_CALIB_LO) |
279 BIT(IWL_CALIB_TX_IQ) |
280 BIT(IWL_CALIB_TX_IQ_PERD) |
281 BIT(IWL_CALIB_BASE_BAND);
282 break;
Tomas Winklerbe5d56e2008-10-08 09:37:27 +0800283 }
284
Tomas Winklerfdd3e8a2008-04-24 11:55:28 -0700285 return 0;
286}
Ron Rindjunskyd4100dd2008-04-24 11:55:33 -0700287
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800288static inline u32 iwl5000_get_scd_ssn(struct iwl5000_tx_resp *tx_resp)
289{
Tomas Winkler3ac7f142008-07-21 02:40:14 +0300290 return le32_to_cpup((__le32 *)&tx_resp->status +
Tomas Winkler25a65722008-06-12 09:47:07 +0800291 tx_resp->frame_count) & MAX_SN;
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800292}
293
294static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv,
295 struct iwl_ht_agg *agg,
296 struct iwl5000_tx_resp *tx_resp,
Tomas Winkler25a65722008-06-12 09:47:07 +0800297 int txq_id, u16 start_idx)
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800298{
299 u16 status;
300 struct agg_tx_status *frame_status = &tx_resp->status;
301 struct ieee80211_tx_info *info = NULL;
302 struct ieee80211_hdr *hdr = NULL;
Tomas Winklere7d326a2008-06-12 09:47:11 +0800303 u32 rate_n_flags = le32_to_cpu(tx_resp->rate_n_flags);
Tomas Winkler25a65722008-06-12 09:47:07 +0800304 int i, sh, idx;
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800305 u16 seq;
306
307 if (agg->wait_for_ba)
Tomas Winklere1623442009-01-27 14:27:56 -0800308 IWL_DEBUG_TX_REPLY(priv, "got tx response w/o block-ack\n");
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800309
310 agg->frame_count = tx_resp->frame_count;
311 agg->start_idx = start_idx;
Tomas Winklere7d326a2008-06-12 09:47:11 +0800312 agg->rate_n_flags = rate_n_flags;
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800313 agg->bitmap = 0;
314
315 /* # frames attempted by Tx command */
316 if (agg->frame_count == 1) {
317 /* Only one frame was attempted; no block-ack will arrive */
318 status = le16_to_cpu(frame_status[0].status);
Tomas Winkler25a65722008-06-12 09:47:07 +0800319 idx = start_idx;
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800320
321 /* FIXME: code repetition */
Tomas Winklere1623442009-01-27 14:27:56 -0800322 IWL_DEBUG_TX_REPLY(priv, "FrameCnt = %d, StartIdx=%d idx=%d\n",
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800323 agg->frame_count, agg->start_idx, idx);
324
325 info = IEEE80211_SKB_CB(priv->txq[txq_id].txb[idx].skb[0]);
Johannes Berge6a98542008-10-21 12:40:02 +0200326 info->status.rates[0].count = tx_resp->failure_frame + 1;
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800327 info->flags &= ~IEEE80211_TX_CTL_AMPDU;
Johannes Bergc397bf12009-11-13 11:56:35 -0800328 info->flags |= iwl_tx_status_to_mac80211(status);
Tomas Winklere7d326a2008-06-12 09:47:11 +0800329 iwl_hwrate_to_tx_control(priv, rate_n_flags, info);
330
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800331 /* FIXME: code repetition end */
332
Tomas Winklere1623442009-01-27 14:27:56 -0800333 IWL_DEBUG_TX_REPLY(priv, "1 Frame 0x%x failure :%d\n",
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800334 status & 0xff, tx_resp->failure_frame);
Tomas Winklere1623442009-01-27 14:27:56 -0800335 IWL_DEBUG_TX_REPLY(priv, "Rate Info rate_n_flags=%x\n", rate_n_flags);
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800336
337 agg->wait_for_ba = 0;
338 } else {
339 /* Two or more frames were attempted; expect block-ack */
340 u64 bitmap = 0;
341 int start = agg->start_idx;
342
343 /* Construct bit-map of pending frames within Tx window */
344 for (i = 0; i < agg->frame_count; i++) {
345 u16 sc;
346 status = le16_to_cpu(frame_status[i].status);
347 seq = le16_to_cpu(frame_status[i].sequence);
348 idx = SEQ_TO_INDEX(seq);
349 txq_id = SEQ_TO_QUEUE(seq);
350
351 if (status & (AGG_TX_STATE_FEW_BYTES_MSK |
352 AGG_TX_STATE_ABORT_MSK))
353 continue;
354
Tomas Winklere1623442009-01-27 14:27:56 -0800355 IWL_DEBUG_TX_REPLY(priv, "FrameCnt = %d, txq_id=%d idx=%d\n",
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800356 agg->frame_count, txq_id, idx);
357
358 hdr = iwl_tx_queue_get_hdr(priv, txq_id, idx);
Stanislaw Gruszka6c6a22e2009-09-23 10:51:34 +0200359 if (!hdr) {
360 IWL_ERR(priv,
361 "BUG_ON idx doesn't point to valid skb"
362 " idx=%d, txq_id=%d\n", idx, txq_id);
363 return -1;
364 }
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800365
366 sc = le16_to_cpu(hdr->seq_ctrl);
367 if (idx != (SEQ_TO_SN(sc) & 0xff)) {
Winkler, Tomas15b16872008-12-19 10:37:33 +0800368 IWL_ERR(priv,
369 "BUG_ON idx doesn't match seq control"
370 " idx=%d, seq_idx=%d, seq=%d\n",
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800371 idx, SEQ_TO_SN(sc),
372 hdr->seq_ctrl);
373 return -1;
374 }
375
Tomas Winklere1623442009-01-27 14:27:56 -0800376 IWL_DEBUG_TX_REPLY(priv, "AGG Frame i=%d idx %d seq=%d\n",
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800377 i, idx, SEQ_TO_SN(sc));
378
379 sh = idx - start;
380 if (sh > 64) {
381 sh = (start - idx) + 0xff;
382 bitmap = bitmap << sh;
383 sh = 0;
384 start = idx;
385 } else if (sh < -64)
386 sh = 0xff - (start - idx);
387 else if (sh < 0) {
388 sh = start - idx;
389 start = idx;
390 bitmap = bitmap << sh;
391 sh = 0;
392 }
Emmanuel Grumbach4aa41f12008-07-18 13:53:09 +0800393 bitmap |= 1ULL << sh;
Tomas Winklere1623442009-01-27 14:27:56 -0800394 IWL_DEBUG_TX_REPLY(priv, "start=%d bitmap=0x%llx\n",
Emmanuel Grumbach4aa41f12008-07-18 13:53:09 +0800395 start, (unsigned long long)bitmap);
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800396 }
397
398 agg->bitmap = bitmap;
399 agg->start_idx = start;
Tomas Winklere1623442009-01-27 14:27:56 -0800400 IWL_DEBUG_TX_REPLY(priv, "Frames %d start_idx=%d bitmap=0x%llx\n",
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800401 agg->frame_count, agg->start_idx,
402 (unsigned long long)agg->bitmap);
403
404 if (bitmap)
405 agg->wait_for_ba = 1;
406 }
407 return 0;
408}
409
410static void iwl5000_rx_reply_tx(struct iwl_priv *priv,
411 struct iwl_rx_mem_buffer *rxb)
412{
Zhu Yi2f301222009-10-09 17:19:45 +0800413 struct iwl_rx_packet *pkt = rxb_addr(rxb);
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800414 u16 sequence = le16_to_cpu(pkt->hdr.sequence);
415 int txq_id = SEQ_TO_QUEUE(sequence);
416 int index = SEQ_TO_INDEX(sequence);
417 struct iwl_tx_queue *txq = &priv->txq[txq_id];
418 struct ieee80211_tx_info *info;
419 struct iwl5000_tx_resp *tx_resp = (void *)&pkt->u.raw[0];
420 u32 status = le16_to_cpu(tx_resp->status.status);
Tomas Winkler3fd07a12008-10-23 23:48:49 -0700421 int tid;
422 int sta_id;
423 int freed;
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800424
425 if ((index >= txq->q.n_bd) || (iwl_queue_used(&txq->q, index) == 0)) {
Winkler, Tomas15b16872008-12-19 10:37:33 +0800426 IWL_ERR(priv, "Read index for DMA queue txq_id (%d) index %d "
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800427 "is out of range [0-%d] %d %d\n", txq_id,
428 index, txq->q.n_bd, txq->q.write_ptr,
429 txq->q.read_ptr);
430 return;
431 }
432
433 info = IEEE80211_SKB_CB(txq->txb[txq->q.read_ptr].skb[0]);
434 memset(&info->status, 0, sizeof(info->status));
435
Tomas Winkler3fd07a12008-10-23 23:48:49 -0700436 tid = (tx_resp->ra_tid & IWL50_TX_RES_TID_MSK) >> IWL50_TX_RES_TID_POS;
437 sta_id = (tx_resp->ra_tid & IWL50_TX_RES_RA_MSK) >> IWL50_TX_RES_RA_POS;
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800438
439 if (txq->sched_retry) {
440 const u32 scd_ssn = iwl5000_get_scd_ssn(tx_resp);
441 struct iwl_ht_agg *agg = NULL;
442
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800443 agg = &priv->stations[sta_id].tid[tid].agg;
444
Tomas Winkler25a65722008-06-12 09:47:07 +0800445 iwl5000_tx_status_reply_tx(priv, agg, tx_resp, txq_id, index);
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800446
Ron Rindjunsky32354272008-07-01 10:44:51 +0300447 /* check if BAR is needed */
448 if ((tx_resp->frame_count == 1) && !iwl_is_tx_success(status))
449 info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK;
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800450
451 if (txq->q.read_ptr != (scd_ssn & 0xff)) {
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800452 index = iwl_queue_dec_wrap(scd_ssn & 0xff, txq->q.n_bd);
Tomas Winklere1623442009-01-27 14:27:56 -0800453 IWL_DEBUG_TX_REPLY(priv, "Retry scheduler reclaim "
Tomas Winkler3fd07a12008-10-23 23:48:49 -0700454 "scd_ssn=%d idx=%d txq=%d swq=%d\n",
455 scd_ssn , index, txq_id, txq->swq_id);
456
Tomas Winkler17b88922008-05-29 16:35:12 +0800457 freed = iwl_tx_queue_reclaim(priv, txq_id, index);
Wey-Yi Guya239a8b2010-02-19 15:47:32 -0800458 iwl_free_tfds_in_queue(priv, sta_id, tid, freed);
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800459
Tomas Winkler3fd07a12008-10-23 23:48:49 -0700460 if (priv->mac80211_registered &&
461 (iwl_queue_space(&txq->q) > txq->q.low_mark) &&
462 (agg->state != IWL_EMPTYING_HW_QUEUE_DELBA)) {
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800463 if (agg->state == IWL_AGG_OFF)
Johannes Berge4e72fb2009-03-23 17:28:42 +0100464 iwl_wake_queue(priv, txq_id);
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800465 else
Johannes Berge4e72fb2009-03-23 17:28:42 +0100466 iwl_wake_queue(priv, txq->swq_id);
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800467 }
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800468 }
469 } else {
Tomas Winkler3fd07a12008-10-23 23:48:49 -0700470 BUG_ON(txq_id != txq->swq_id);
471
Johannes Berge6a98542008-10-21 12:40:02 +0200472 info->status.rates[0].count = tx_resp->failure_frame + 1;
Johannes Bergc397bf12009-11-13 11:56:35 -0800473 info->flags |= iwl_tx_status_to_mac80211(status);
Tomas Winklere7d326a2008-06-12 09:47:11 +0800474 iwl_hwrate_to_tx_control(priv,
Ron Rindjunsky4f85f5b2008-06-09 22:54:35 +0300475 le32_to_cpu(tx_resp->rate_n_flags),
476 info);
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800477
Tomas Winklere1623442009-01-27 14:27:56 -0800478 IWL_DEBUG_TX_REPLY(priv, "TXQ %d status %s (0x%08x) rate_n_flags "
Tomas Winkler3fd07a12008-10-23 23:48:49 -0700479 "0x%x retries %d\n",
480 txq_id,
481 iwl_get_tx_fail_reason(status), status,
482 le32_to_cpu(tx_resp->rate_n_flags),
483 tx_resp->failure_frame);
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800484
Tomas Winkler3fd07a12008-10-23 23:48:49 -0700485 freed = iwl_tx_queue_reclaim(priv, txq_id, index);
Stanislaw Gruszkaa120e912010-02-19 15:47:33 -0800486 iwl_free_tfds_in_queue(priv, sta_id, tid, freed);
Tomas Winkler3fd07a12008-10-23 23:48:49 -0700487
488 if (priv->mac80211_registered &&
489 (iwl_queue_space(&txq->q) > txq->q.low_mark))
Johannes Berge4e72fb2009-03-23 17:28:42 +0100490 iwl_wake_queue(priv, txq_id);
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800491 }
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800492
Stanislaw Gruszkaa120e912010-02-19 15:47:33 -0800493 iwl_txq_check_empty(priv, sta_id, tid, txq_id);
Tomas Winkler3fd07a12008-10-23 23:48:49 -0700494
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800495 if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK))
Winkler, Tomas15b16872008-12-19 10:37:33 +0800496 IWL_ERR(priv, "TODO: Implement Tx ABORT REQUIRED!!!\n");
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800497}
498
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700499void iwl5000_setup_deferred_work(struct iwl_priv *priv)
Emmanuel Grumbach203566f2008-06-12 09:46:54 +0800500{
501 /* in 5000 the tx power calibration is done in uCode */
502 priv->disable_tx_power_cal = 1;
503}
504
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700505void iwl5000_rx_handler_setup(struct iwl_priv *priv)
Ron Rindjunskyb600e4e2008-05-15 13:54:11 +0800506{
Tomas Winkler7c616cb2008-05-29 16:35:05 +0800507 /* init calibration handlers */
508 priv->rx_handlers[CALIBRATION_RES_NOTIFICATION] =
Wey-Yi Guy741a6262010-03-16 12:37:24 -0700509 iwlagn_rx_calib_result;
Tomas Winkler7c616cb2008-05-29 16:35:05 +0800510 priv->rx_handlers[CALIBRATION_COMPLETE_NOTIFICATION] =
Wey-Yi Guy741a6262010-03-16 12:37:24 -0700511 iwlagn_rx_calib_complete;
Ron Rindjunskye532fa02008-05-29 16:35:09 +0800512 priv->rx_handlers[REPLY_TX] = iwl5000_rx_reply_tx;
Ron Rindjunskyb600e4e2008-05-15 13:54:11 +0800513}
514
Tomas Winkler7c616cb2008-05-29 16:35:05 +0800515
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700516int iwl5000_hw_valid_rtc_data_addr(u32 addr)
Ron Rindjunsky87283cc2008-05-29 16:34:47 +0800517{
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700518 return (addr >= IWLAGN_RTC_DATA_LOWER_BOUND) &&
519 (addr < IWLAGN_RTC_DATA_UPPER_BOUND);
Ron Rindjunsky87283cc2008-05-29 16:34:47 +0800520}
521
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700522int iwl5000_send_tx_power(struct iwl_priv *priv)
Tomas Winkler630fe9b2008-06-12 09:47:08 +0800523{
524 struct iwl5000_tx_power_dbm_cmd tx_power_cmd;
Jay Sternberg76a24072009-01-29 11:09:14 -0800525 u8 tx_ant_cfg_cmd;
Tomas Winkler630fe9b2008-06-12 09:47:08 +0800526
527 /* half dBm need to multiply */
528 tx_power_cmd.global_lmt = (s8)(2 * priv->tx_power_user_lmt);
Wey-Yi Guyae16fc32009-11-13 11:56:30 -0800529
530 if (priv->tx_power_lmt_in_half_dbm &&
531 priv->tx_power_lmt_in_half_dbm < tx_power_cmd.global_lmt) {
532 /*
533 * For the newer devices which using enhanced/extend tx power
534 * table in EEPROM, the format is in half dBm. driver need to
535 * convert to dBm format before report to mac80211.
536 * By doing so, there is a possibility of 1/2 dBm resolution
537 * lost. driver will perform "round-up" operation before
538 * reporting, but it will cause 1/2 dBm tx power over the
539 * regulatory limit. Perform the checking here, if the
540 * "tx_power_user_lmt" is higher than EEPROM value (in
541 * half-dBm format), lower the tx power based on EEPROM
542 */
543 tx_power_cmd.global_lmt = priv->tx_power_lmt_in_half_dbm;
544 }
Gregory Greenman853554a2008-06-30 17:23:01 +0800545 tx_power_cmd.flags = IWL50_TX_POWER_NO_CLOSED;
Tomas Winkler630fe9b2008-06-12 09:47:08 +0800546 tx_power_cmd.srv_chan_lmt = IWL50_TX_POWER_AUTO;
Jay Sternberg76a24072009-01-29 11:09:14 -0800547
548 if (IWL_UCODE_API(priv->ucode_ver) == 1)
549 tx_ant_cfg_cmd = REPLY_TX_POWER_DBM_CMD_V1;
550 else
551 tx_ant_cfg_cmd = REPLY_TX_POWER_DBM_CMD;
552
553 return iwl_send_cmd_pdu_async(priv, tx_ant_cfg_cmd,
Tomas Winkler630fe9b2008-06-12 09:47:08 +0800554 sizeof(tx_power_cmd), &tx_power_cmd,
555 NULL);
556}
557
Wey-Yi Guy672639d2009-07-24 11:13:01 -0700558void iwl5000_temperature(struct iwl_priv *priv)
Emmanuel Grumbach8f91aec2008-06-30 17:23:07 +0800559{
560 /* store temperature from statistics (in Celsius) */
Zhu Yi52256402008-06-30 17:23:31 +0800561 priv->temperature = le32_to_cpu(priv->statistics.general.temperature);
Wey-Yi Guy39b73fb2009-07-24 11:13:02 -0700562 iwl_tt_handler(priv);
Emmanuel Grumbach8f91aec2008-06-30 17:23:07 +0800563}
Ron Rindjunskyfe7a90c2008-05-29 16:35:14 +0800564
Wey-Yi Guy62161ae2009-05-21 13:44:23 -0700565static void iwl5150_temperature(struct iwl_priv *priv)
566{
567 u32 vt = 0;
568 s32 offset = iwl_temp_calib_to_offset(priv);
569
570 vt = le32_to_cpu(priv->statistics.general.temperature);
571 vt = vt / IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF + offset;
572 /* now vt hold the temperature in Kelvin */
573 priv->temperature = KELVIN_TO_CELSIUS(vt);
Wey-Yi Guy15993e02009-08-13 13:31:00 -0700574 iwl_tt_handler(priv);
Wey-Yi Guy62161ae2009-05-21 13:44:23 -0700575}
576
Wey-Yi Guy4a56e962009-10-23 13:42:29 -0700577static int iwl5000_hw_channel_switch(struct iwl_priv *priv, u16 channel)
578{
579 struct iwl5000_channel_switch_cmd cmd;
580 const struct iwl_channel_info *ch_info;
581 struct iwl_host_cmd hcmd = {
582 .id = REPLY_CHANNEL_SWITCH,
583 .len = sizeof(cmd),
584 .flags = CMD_SIZE_HUGE,
585 .data = &cmd,
586 };
587
588 IWL_DEBUG_11H(priv, "channel switch from %d to %d\n",
589 priv->active_rxon.channel, channel);
590 cmd.band = priv->band == IEEE80211_BAND_2GHZ;
591 cmd.channel = cpu_to_le16(channel);
Wey-Yi Guy0924e512009-11-06 14:52:54 -0800592 cmd.rxon_flags = priv->staging_rxon.flags;
593 cmd.rxon_filter_flags = priv->staging_rxon.filter_flags;
Wey-Yi Guy4a56e962009-10-23 13:42:29 -0700594 cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time);
595 ch_info = iwl_get_channel_info(priv, priv->band, channel);
596 if (ch_info)
597 cmd.expect_beacon = is_channel_radar(ch_info);
598 else {
599 IWL_ERR(priv, "invalid channel switch from %u to %u\n",
600 priv->active_rxon.channel, channel);
601 return -EFAULT;
602 }
Wey-Yi Guy0924e512009-11-06 14:52:54 -0800603 priv->switch_rxon.channel = cpu_to_le16(channel);
604 priv->switch_rxon.switch_in_progress = true;
Wey-Yi Guy4a56e962009-10-23 13:42:29 -0700605
606 return iwl_send_cmd_sync(priv, &hcmd);
607}
608
Jay Sternberge8c00dc2009-01-29 11:09:15 -0800609struct iwl_lib_ops iwl5000_lib = {
Tomas Winklerfdd3e8a2008-04-24 11:55:28 -0700610 .set_hw_params = iwl5000_hw_set_hw_params,
Wey-Yi Guyb305a082010-03-16 17:41:22 -0700611 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
612 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
613 .txq_set_sched = iwlagn_txq_set_sched,
614 .txq_agg_enable = iwlagn_txq_agg_enable,
615 .txq_agg_disable = iwlagn_txq_agg_disable,
Samuel Ortiz7aaa1d72009-01-19 15:30:26 -0800616 .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
617 .txq_free_tfd = iwl_hw_txq_free_tfd,
Samuel Ortiza8e74e22009-01-23 13:45:14 -0800618 .txq_init = iwl_hw_tx_queue_init,
Ron Rindjunskyb600e4e2008-05-15 13:54:11 +0800619 .rx_handler_setup = iwl5000_rx_handler_setup,
Emmanuel Grumbach203566f2008-06-12 09:46:54 +0800620 .setup_deferred_work = iwl5000_setup_deferred_work,
Ron Rindjunsky87283cc2008-05-29 16:34:47 +0800621 .is_valid_rtc_data_addr = iwl5000_hw_valid_rtc_data_addr,
Reinette Chatreb7a79402009-09-25 14:24:23 -0700622 .dump_nic_event_log = iwl_dump_nic_event_log,
623 .dump_nic_error_log = iwl_dump_nic_error_log,
Wey-Yi Guy696bdee2009-12-10 14:37:25 -0800624 .dump_csr = iwl_dump_csr,
Wey-Yi Guy1b3eb822010-01-15 13:43:39 -0800625 .dump_fh = iwl_dump_fh,
Wey-Yi Guy81b81762010-03-16 10:23:30 -0700626 .load_ucode = iwlagn_load_ucode,
Wey-Yi Guy741a6262010-03-16 12:37:24 -0700627 .init_alive_start = iwlagn_init_alive_start,
628 .alive_notify = iwlagn_alive_notify,
Tomas Winkler630fe9b2008-06-12 09:47:08 +0800629 .send_tx_power = iwl5000_send_tx_power,
Emmanuel Grumbach5b9f8cd2008-10-29 14:05:46 -0700630 .update_chain_flags = iwl_update_chain_flags,
Wey-Yi Guy4a56e962009-10-23 13:42:29 -0700631 .set_channel_switch = iwl5000_hw_channel_switch,
Tomas Winkler30d59262008-04-24 11:55:25 -0700632 .apm_ops = {
Ben Cahillfadb3582009-10-23 13:42:21 -0700633 .init = iwl_apm_init,
Abhijeet Kolekard68b6032009-10-02 13:44:04 -0700634 .stop = iwl_apm_stop,
Ron Rindjunsky5a835352008-05-05 10:22:29 +0800635 .config = iwl5000_nic_config,
Emmanuel Grumbach5b9f8cd2008-10-29 14:05:46 -0700636 .set_pwr_src = iwl_set_pwr_src,
Tomas Winkler30d59262008-04-24 11:55:25 -0700637 },
Tomas Winklerda8dec22008-04-24 11:55:24 -0700638 .eeprom_ops = {
Tomas Winkler25ae3982008-04-24 11:55:27 -0700639 .regulatory_bands = {
640 EEPROM_5000_REG_BAND_1_CHANNELS,
641 EEPROM_5000_REG_BAND_2_CHANNELS,
642 EEPROM_5000_REG_BAND_3_CHANNELS,
643 EEPROM_5000_REG_BAND_4_CHANNELS,
644 EEPROM_5000_REG_BAND_5_CHANNELS,
Wey-Yi Guy7aafef12009-08-07 15:41:38 -0700645 EEPROM_5000_REG_BAND_24_HT40_CHANNELS,
646 EEPROM_5000_REG_BAND_52_HT40_CHANNELS
Tomas Winkler25ae3982008-04-24 11:55:27 -0700647 },
Tomas Winklerda8dec22008-04-24 11:55:24 -0700648 .verify_signature = iwlcore_eeprom_verify_signature,
649 .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
650 .release_semaphore = iwlcore_eeprom_release_semaphore,
Tomas Winkler0ef2ca62008-10-23 23:48:51 -0700651 .calib_version = iwl5000_eeprom_calib_version,
Tomas Winkler25ae3982008-04-24 11:55:27 -0700652 .query_addr = iwl5000_eeprom_query_addr,
Tomas Winklerda8dec22008-04-24 11:55:24 -0700653 },
Abhijeet Kolekar5bbe2332009-04-08 11:26:35 -0700654 .post_associate = iwl_post_associate,
Mohamed Abbasef850d72009-05-22 11:01:50 -0700655 .isr = iwl_isr_ict,
Abhijeet Kolekar60690a62009-04-08 11:26:49 -0700656 .config_ap = iwl_config_ap,
Wey-Yi Guy62161ae2009-05-21 13:44:23 -0700657 .temp_ops = {
658 .temperature = iwl5000_temperature,
659 .set_ct_kill = iwl5000_set_ct_threshold,
660 },
Reinette Chatre3459ab52010-01-22 14:22:49 -0800661 .add_bcast_station = iwl_add_bcast_station,
Wey-Yi Guyb74e31a2010-03-01 17:23:50 -0800662 .recover_from_tx_stall = iwl_bg_monitor_recover,
Wey-Yi Guyfa8f1302010-03-05 14:22:46 -0800663 .check_plcp_health = iwl_good_plcp_health,
664 .check_ack_health = iwl_good_ack_health,
Wey-Yi Guy62161ae2009-05-21 13:44:23 -0700665};
666
667static struct iwl_lib_ops iwl5150_lib = {
668 .set_hw_params = iwl5000_hw_set_hw_params,
Wey-Yi Guyb305a082010-03-16 17:41:22 -0700669 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
670 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
671 .txq_set_sched = iwlagn_txq_set_sched,
672 .txq_agg_enable = iwlagn_txq_agg_enable,
673 .txq_agg_disable = iwlagn_txq_agg_disable,
Wey-Yi Guy62161ae2009-05-21 13:44:23 -0700674 .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
675 .txq_free_tfd = iwl_hw_txq_free_tfd,
676 .txq_init = iwl_hw_tx_queue_init,
677 .rx_handler_setup = iwl5000_rx_handler_setup,
678 .setup_deferred_work = iwl5000_setup_deferred_work,
679 .is_valid_rtc_data_addr = iwl5000_hw_valid_rtc_data_addr,
Reinette Chatreb7a79402009-09-25 14:24:23 -0700680 .dump_nic_event_log = iwl_dump_nic_event_log,
681 .dump_nic_error_log = iwl_dump_nic_error_log,
Wey-Yi Guy696bdee2009-12-10 14:37:25 -0800682 .dump_csr = iwl_dump_csr,
Wey-Yi Guy81b81762010-03-16 10:23:30 -0700683 .load_ucode = iwlagn_load_ucode,
Wey-Yi Guy741a6262010-03-16 12:37:24 -0700684 .init_alive_start = iwlagn_init_alive_start,
685 .alive_notify = iwlagn_alive_notify,
Wey-Yi Guy62161ae2009-05-21 13:44:23 -0700686 .send_tx_power = iwl5000_send_tx_power,
687 .update_chain_flags = iwl_update_chain_flags,
Wey-Yi Guy4a56e962009-10-23 13:42:29 -0700688 .set_channel_switch = iwl5000_hw_channel_switch,
Wey-Yi Guy62161ae2009-05-21 13:44:23 -0700689 .apm_ops = {
Ben Cahillfadb3582009-10-23 13:42:21 -0700690 .init = iwl_apm_init,
Abhijeet Kolekard68b6032009-10-02 13:44:04 -0700691 .stop = iwl_apm_stop,
Wey-Yi Guy62161ae2009-05-21 13:44:23 -0700692 .config = iwl5000_nic_config,
693 .set_pwr_src = iwl_set_pwr_src,
694 },
695 .eeprom_ops = {
696 .regulatory_bands = {
697 EEPROM_5000_REG_BAND_1_CHANNELS,
698 EEPROM_5000_REG_BAND_2_CHANNELS,
699 EEPROM_5000_REG_BAND_3_CHANNELS,
700 EEPROM_5000_REG_BAND_4_CHANNELS,
701 EEPROM_5000_REG_BAND_5_CHANNELS,
Wey-Yi Guy7aafef12009-08-07 15:41:38 -0700702 EEPROM_5000_REG_BAND_24_HT40_CHANNELS,
703 EEPROM_5000_REG_BAND_52_HT40_CHANNELS
Wey-Yi Guy62161ae2009-05-21 13:44:23 -0700704 },
705 .verify_signature = iwlcore_eeprom_verify_signature,
706 .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
707 .release_semaphore = iwlcore_eeprom_release_semaphore,
708 .calib_version = iwl5000_eeprom_calib_version,
709 .query_addr = iwl5000_eeprom_query_addr,
710 },
711 .post_associate = iwl_post_associate,
Mohamed Abbasef850d72009-05-22 11:01:50 -0700712 .isr = iwl_isr_ict,
Wey-Yi Guy62161ae2009-05-21 13:44:23 -0700713 .config_ap = iwl_config_ap,
714 .temp_ops = {
715 .temperature = iwl5150_temperature,
716 .set_ct_kill = iwl5150_set_ct_threshold,
717 },
Reinette Chatre3459ab52010-01-22 14:22:49 -0800718 .add_bcast_station = iwl_add_bcast_station,
Wey-Yi Guyb74e31a2010-03-01 17:23:50 -0800719 .recover_from_tx_stall = iwl_bg_monitor_recover,
Wey-Yi Guyfa8f1302010-03-05 14:22:46 -0800720 .check_plcp_health = iwl_good_plcp_health,
721 .check_ack_health = iwl_good_ack_health,
Tomas Winklerda8dec22008-04-24 11:55:24 -0700722};
723
Emese Revfy45d5d802009-12-14 00:59:53 +0100724static const struct iwl_ops iwl5000_ops = {
Wey-Yi Guy792bc3c2010-03-16 10:23:29 -0700725 .ucode = &iwlagn_ucode,
Tomas Winklerda8dec22008-04-24 11:55:24 -0700726 .lib = &iwl5000_lib,
Wey-Yi Guy7dc77db2010-03-16 10:23:31 -0700727 .hcmd = &iwlagn_hcmd,
728 .utils = &iwlagn_hcmd_utils,
Johannes Berge932a602009-10-02 13:44:03 -0700729 .led = &iwlagn_led_ops,
Tomas Winklerda8dec22008-04-24 11:55:24 -0700730};
731
Emese Revfy45d5d802009-12-14 00:59:53 +0100732static const struct iwl_ops iwl5150_ops = {
Wey-Yi Guy792bc3c2010-03-16 10:23:29 -0700733 .ucode = &iwlagn_ucode,
Wey-Yi Guy62161ae2009-05-21 13:44:23 -0700734 .lib = &iwl5150_lib,
Wey-Yi Guy7dc77db2010-03-16 10:23:31 -0700735 .hcmd = &iwlagn_hcmd,
736 .utils = &iwlagn_hcmd_utils,
Johannes Berge932a602009-10-02 13:44:03 -0700737 .led = &iwlagn_led_ops,
Wey-Yi Guy62161ae2009-05-21 13:44:23 -0700738};
739
Jay Sternbergcec2d3f2009-01-19 15:30:33 -0800740struct iwl_mod_params iwl50_mod_params = {
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700741 .amsdu_size_8K = 1,
Ester Kummer3a1081e2008-05-06 11:05:14 +0800742 .restart_fw = 1,
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700743 /* the rest are 0 by default */
744};
745
746
747struct iwl_cfg iwl5300_agn_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800748 .name = "Intel(R) Ultimate N WiFi Link 5300 AGN",
Reinette Chatrea0987a82008-12-02 12:14:06 -0800749 .fw_name_pre = IWL5000_FW_PRE,
750 .ucode_api_max = IWL5000_UCODE_API_MAX,
751 .ucode_api_min = IWL5000_UCODE_API_MIN,
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700752 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
Tomas Winklerda8dec22008-04-24 11:55:24 -0700753 .ops = &iwl5000_ops,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700754 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
Tomas Winkler0ef2ca62008-10-23 23:48:51 -0700755 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
756 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700757 .num_of_queues = IWLAGN_NUM_QUEUES,
758 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700759 .mod_params = &iwl50_mod_params,
Jay Sternbergc0bac762009-02-02 16:21:14 -0800760 .valid_tx_ant = ANT_ABC,
761 .valid_rx_ant = ANT_ABC,
Ben Cahillfadb3582009-10-23 13:42:21 -0700762 .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
763 .set_l0s = true,
764 .use_bsm = false,
Daniel C Halperinb2617932009-08-13 13:30:59 -0700765 .ht_greenfield_support = true,
Wey-Yi Guyf2d0d0e2009-09-11 10:38:14 -0700766 .led_compensation = 51,
Wey-Yi Guy1152dcc2010-01-15 13:42:58 -0800767 .use_rts_for_ht = true, /* use rts/cts protection */
Wey-Yi Guyd8c07e72009-09-25 14:24:26 -0700768 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
Trieu 'Andrew' Nguyen3e4fb5f2010-01-22 14:22:46 -0800769 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
Ben Cahilld4fe5ac2010-02-05 11:33:46 -0800770 .chain_noise_scale = 1000,
Wey-Yi Guyb74e31a2010-03-01 17:23:50 -0800771 .monitor_recover_period = IWL_MONITORING_PERIOD,
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700772};
773
Wey-Yi Guyac592572009-11-20 12:05:03 -0800774struct iwl_cfg iwl5100_bgn_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800775 .name = "Intel(R) WiFi Link 5100 BGN",
Reinette Chatrea0987a82008-12-02 12:14:06 -0800776 .fw_name_pre = IWL5000_FW_PRE,
777 .ucode_api_max = IWL5000_UCODE_API_MAX,
778 .ucode_api_min = IWL5000_UCODE_API_MIN,
Wey-Yi Guyac592572009-11-20 12:05:03 -0800779 .sku = IWL_SKU_G|IWL_SKU_N,
Esti Kummer47408632008-07-11 11:53:30 +0800780 .ops = &iwl5000_ops,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700781 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
Tomas Winkler0ef2ca62008-10-23 23:48:51 -0700782 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
783 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700784 .num_of_queues = IWLAGN_NUM_QUEUES,
785 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
Esti Kummer47408632008-07-11 11:53:30 +0800786 .mod_params = &iwl50_mod_params,
Jay Sternbergc0bac762009-02-02 16:21:14 -0800787 .valid_tx_ant = ANT_B,
788 .valid_rx_ant = ANT_AB,
Ben Cahillfadb3582009-10-23 13:42:21 -0700789 .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
790 .set_l0s = true,
791 .use_bsm = false,
Daniel C Halperinb2617932009-08-13 13:30:59 -0700792 .ht_greenfield_support = true,
Wey-Yi Guyf2d0d0e2009-09-11 10:38:14 -0700793 .led_compensation = 51,
Wey-Yi Guy1152dcc2010-01-15 13:42:58 -0800794 .use_rts_for_ht = true, /* use rts/cts protection */
Wey-Yi Guyd8c07e72009-09-25 14:24:26 -0700795 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
Trieu 'Andrew' Nguyen3e4fb5f2010-01-22 14:22:46 -0800796 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
Ben Cahilld4fe5ac2010-02-05 11:33:46 -0800797 .chain_noise_scale = 1000,
Wey-Yi Guyb74e31a2010-03-01 17:23:50 -0800798 .monitor_recover_period = IWL_MONITORING_PERIOD,
Esti Kummer47408632008-07-11 11:53:30 +0800799};
800
801struct iwl_cfg iwl5100_abg_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800802 .name = "Intel(R) WiFi Link 5100 ABG",
Reinette Chatrea0987a82008-12-02 12:14:06 -0800803 .fw_name_pre = IWL5000_FW_PRE,
804 .ucode_api_max = IWL5000_UCODE_API_MAX,
805 .ucode_api_min = IWL5000_UCODE_API_MIN,
Esti Kummer47408632008-07-11 11:53:30 +0800806 .sku = IWL_SKU_A|IWL_SKU_G,
807 .ops = &iwl5000_ops,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700808 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
Tomas Winkler0ef2ca62008-10-23 23:48:51 -0700809 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
810 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700811 .num_of_queues = IWLAGN_NUM_QUEUES,
812 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
Esti Kummer47408632008-07-11 11:53:30 +0800813 .mod_params = &iwl50_mod_params,
Jay Sternbergc0bac762009-02-02 16:21:14 -0800814 .valid_tx_ant = ANT_B,
815 .valid_rx_ant = ANT_AB,
Ben Cahillfadb3582009-10-23 13:42:21 -0700816 .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
817 .set_l0s = true,
818 .use_bsm = false,
Wey-Yi Guyf2d0d0e2009-09-11 10:38:14 -0700819 .led_compensation = 51,
Wey-Yi Guyd8c07e72009-09-25 14:24:26 -0700820 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
Trieu 'Andrew' Nguyen3e4fb5f2010-01-22 14:22:46 -0800821 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
Ben Cahilld4fe5ac2010-02-05 11:33:46 -0800822 .chain_noise_scale = 1000,
Wey-Yi Guyb74e31a2010-03-01 17:23:50 -0800823 .monitor_recover_period = IWL_MONITORING_PERIOD,
Esti Kummer47408632008-07-11 11:53:30 +0800824};
825
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700826struct iwl_cfg iwl5100_agn_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800827 .name = "Intel(R) WiFi Link 5100 AGN",
Reinette Chatrea0987a82008-12-02 12:14:06 -0800828 .fw_name_pre = IWL5000_FW_PRE,
829 .ucode_api_max = IWL5000_UCODE_API_MAX,
830 .ucode_api_min = IWL5000_UCODE_API_MIN,
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700831 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
Tomas Winklerda8dec22008-04-24 11:55:24 -0700832 .ops = &iwl5000_ops,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700833 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
Tomas Winkler0ef2ca62008-10-23 23:48:51 -0700834 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
835 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700836 .num_of_queues = IWLAGN_NUM_QUEUES,
837 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700838 .mod_params = &iwl50_mod_params,
Jay Sternbergc0bac762009-02-02 16:21:14 -0800839 .valid_tx_ant = ANT_B,
840 .valid_rx_ant = ANT_AB,
Ben Cahillfadb3582009-10-23 13:42:21 -0700841 .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
842 .set_l0s = true,
843 .use_bsm = false,
Daniel C Halperinb2617932009-08-13 13:30:59 -0700844 .ht_greenfield_support = true,
Wey-Yi Guyf2d0d0e2009-09-11 10:38:14 -0700845 .led_compensation = 51,
Wey-Yi Guy1152dcc2010-01-15 13:42:58 -0800846 .use_rts_for_ht = true, /* use rts/cts protection */
Wey-Yi Guyd8c07e72009-09-25 14:24:26 -0700847 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
Trieu 'Andrew' Nguyen3e4fb5f2010-01-22 14:22:46 -0800848 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
Ben Cahilld4fe5ac2010-02-05 11:33:46 -0800849 .chain_noise_scale = 1000,
Wey-Yi Guyb74e31a2010-03-01 17:23:50 -0800850 .monitor_recover_period = IWL_MONITORING_PERIOD,
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700851};
852
853struct iwl_cfg iwl5350_agn_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800854 .name = "Intel(R) WiMAX/WiFi Link 5350 AGN",
Reinette Chatrea0987a82008-12-02 12:14:06 -0800855 .fw_name_pre = IWL5000_FW_PRE,
856 .ucode_api_max = IWL5000_UCODE_API_MAX,
857 .ucode_api_min = IWL5000_UCODE_API_MIN,
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700858 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
Tomas Winklerda8dec22008-04-24 11:55:24 -0700859 .ops = &iwl5000_ops,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700860 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
Tomas Winkler0ef2ca62008-10-23 23:48:51 -0700861 .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
862 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700863 .num_of_queues = IWLAGN_NUM_QUEUES,
864 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700865 .mod_params = &iwl50_mod_params,
Jay Sternbergc0bac762009-02-02 16:21:14 -0800866 .valid_tx_ant = ANT_ABC,
867 .valid_rx_ant = ANT_ABC,
Ben Cahillfadb3582009-10-23 13:42:21 -0700868 .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
869 .set_l0s = true,
870 .use_bsm = false,
Daniel C Halperinb2617932009-08-13 13:30:59 -0700871 .ht_greenfield_support = true,
Wey-Yi Guyf2d0d0e2009-09-11 10:38:14 -0700872 .led_compensation = 51,
Wey-Yi Guy1152dcc2010-01-15 13:42:58 -0800873 .use_rts_for_ht = true, /* use rts/cts protection */
Wey-Yi Guyd8c07e72009-09-25 14:24:26 -0700874 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
Trieu 'Andrew' Nguyen3e4fb5f2010-01-22 14:22:46 -0800875 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
Ben Cahilld4fe5ac2010-02-05 11:33:46 -0800876 .chain_noise_scale = 1000,
Wey-Yi Guyb74e31a2010-03-01 17:23:50 -0800877 .monitor_recover_period = IWL_MONITORING_PERIOD,
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700878};
879
Tomas Winkler7100e922008-12-01 16:32:18 -0800880struct iwl_cfg iwl5150_agn_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800881 .name = "Intel(R) WiMAX/WiFi Link 5150 AGN",
Reinette Chatrea0987a82008-12-02 12:14:06 -0800882 .fw_name_pre = IWL5150_FW_PRE,
883 .ucode_api_max = IWL5150_UCODE_API_MAX,
884 .ucode_api_min = IWL5150_UCODE_API_MIN,
Tomas Winkler7100e922008-12-01 16:32:18 -0800885 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
Wey-Yi Guy62161ae2009-05-21 13:44:23 -0700886 .ops = &iwl5150_ops,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700887 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
Tomas Winklerfd63edb2008-12-01 16:32:21 -0800888 .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
889 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700890 .num_of_queues = IWLAGN_NUM_QUEUES,
891 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
Tomas Winkler7100e922008-12-01 16:32:18 -0800892 .mod_params = &iwl50_mod_params,
Jay Sternbergc0bac762009-02-02 16:21:14 -0800893 .valid_tx_ant = ANT_A,
894 .valid_rx_ant = ANT_AB,
Ben Cahillfadb3582009-10-23 13:42:21 -0700895 .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
896 .set_l0s = true,
897 .use_bsm = false,
Daniel C Halperinb2617932009-08-13 13:30:59 -0700898 .ht_greenfield_support = true,
Wey-Yi Guyf2d0d0e2009-09-11 10:38:14 -0700899 .led_compensation = 51,
Wey-Yi Guy1152dcc2010-01-15 13:42:58 -0800900 .use_rts_for_ht = true, /* use rts/cts protection */
Wey-Yi Guyd8c07e72009-09-25 14:24:26 -0700901 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
Trieu 'Andrew' Nguyen3e4fb5f2010-01-22 14:22:46 -0800902 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
Ben Cahilld4fe5ac2010-02-05 11:33:46 -0800903 .chain_noise_scale = 1000,
Wey-Yi Guyb74e31a2010-03-01 17:23:50 -0800904 .monitor_recover_period = IWL_MONITORING_PERIOD,
Tomas Winkler7100e922008-12-01 16:32:18 -0800905};
906
Wey-Yi Guyac592572009-11-20 12:05:03 -0800907struct iwl_cfg iwl5150_abg_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800908 .name = "Intel(R) WiMAX/WiFi Link 5150 ABG",
Wey-Yi Guyac592572009-11-20 12:05:03 -0800909 .fw_name_pre = IWL5150_FW_PRE,
910 .ucode_api_max = IWL5150_UCODE_API_MAX,
911 .ucode_api_min = IWL5150_UCODE_API_MIN,
912 .sku = IWL_SKU_A|IWL_SKU_G,
913 .ops = &iwl5150_ops,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700914 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
Wey-Yi Guyac592572009-11-20 12:05:03 -0800915 .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
916 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -0700917 .num_of_queues = IWLAGN_NUM_QUEUES,
918 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
Wey-Yi Guyac592572009-11-20 12:05:03 -0800919 .mod_params = &iwl50_mod_params,
920 .valid_tx_ant = ANT_A,
921 .valid_rx_ant = ANT_AB,
922 .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
923 .set_l0s = true,
924 .use_bsm = false,
925 .led_compensation = 51,
926 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
Trieu 'Andrew' Nguyen3e4fb5f2010-01-22 14:22:46 -0800927 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
Ben Cahilld4fe5ac2010-02-05 11:33:46 -0800928 .chain_noise_scale = 1000,
Wey-Yi Guyb74e31a2010-03-01 17:23:50 -0800929 .monitor_recover_period = IWL_MONITORING_PERIOD,
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700930};
931
Reinette Chatrea0987a82008-12-02 12:14:06 -0800932MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX));
933MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_MAX));
Tomas Winklerc9f79ed2008-09-11 11:45:21 +0800934
Wey-Yi Guy4e30cb62009-09-17 10:43:47 -0700935module_param_named(swcrypto50, iwl50_mod_params.sw_crypto, bool, S_IRUGO);
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700936MODULE_PARM_DESC(swcrypto50,
937 "using software crypto engine (default 0 [hardware])\n");
Wey-Yi Guy4e30cb62009-09-17 10:43:47 -0700938module_param_named(queues_num50, iwl50_mod_params.num_of_queues, int, S_IRUGO);
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700939MODULE_PARM_DESC(queues_num50, "number of hw queues in 50xx series");
Wey-Yi Guy4e30cb62009-09-17 10:43:47 -0700940module_param_named(11n_disable50, iwl50_mod_params.disable_11n, int, S_IRUGO);
Ron Rindjunsky49779292008-06-30 17:23:21 +0800941MODULE_PARM_DESC(11n_disable50, "disable 50XX 11n functionality");
Wey-Yi Guy4e30cb62009-09-17 10:43:47 -0700942module_param_named(amsdu_size_8K50, iwl50_mod_params.amsdu_size_8K,
943 int, S_IRUGO);
Tomas Winkler5a6a2562008-04-24 11:55:23 -0700944MODULE_PARM_DESC(amsdu_size_8K50, "enable 8K amsdu size in 50XX series");
Wey-Yi Guy4e30cb62009-09-17 10:43:47 -0700945module_param_named(fw_restart50, iwl50_mod_params.restart_fw, int, S_IRUGO);
Ester Kummer3a1081e2008-05-06 11:05:14 +0800946MODULE_PARM_DESC(fw_restart50, "restart firmware in case of error");