aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-5000.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-5000.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c379
1 files changed, 92 insertions, 287 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 48bdcd8d2e94..e816c27db794 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2007 - 2010 Intel Corporation. All rights reserved. 3 * Copyright(c) 2007 - 2011 Intel Corporation. All rights reserved.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 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 6 * under the terms of version 2 of the GNU General Public License as
@@ -37,6 +37,7 @@
37#include <net/mac80211.h> 37#include <net/mac80211.h>
38#include <linux/etherdevice.h> 38#include <linux/etherdevice.h>
39#include <asm/unaligned.h> 39#include <asm/unaligned.h>
40#include <linux/stringify.h>
40 41
41#include "iwl-eeprom.h" 42#include "iwl-eeprom.h"
42#include "iwl-dev.h" 43#include "iwl-dev.h"
@@ -45,13 +46,11 @@
45#include "iwl-sta.h" 46#include "iwl-sta.h"
46#include "iwl-helpers.h" 47#include "iwl-helpers.h"
47#include "iwl-agn.h" 48#include "iwl-agn.h"
48#include "iwl-agn-led.h"
49#include "iwl-agn-hw.h" 49#include "iwl-agn-hw.h"
50#include "iwl-5000-hw.h" 50#include "iwl-5000-hw.h"
51#include "iwl-agn-debugfs.h"
52 51
53/* Highest firmware API version supported */ 52/* Highest firmware API version supported */
54#define IWL5000_UCODE_API_MAX 2 53#define IWL5000_UCODE_API_MAX 5
55#define IWL5150_UCODE_API_MAX 2 54#define IWL5150_UCODE_API_MAX 2
56 55
57/* Lowest firmware API version supported */ 56/* Lowest firmware API version supported */
@@ -59,12 +58,10 @@
59#define IWL5150_UCODE_API_MIN 1 58#define IWL5150_UCODE_API_MIN 1
60 59
61#define IWL5000_FW_PRE "iwlwifi-5000-" 60#define IWL5000_FW_PRE "iwlwifi-5000-"
62#define _IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE #api ".ucode" 61#define IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE __stringify(api) ".ucode"
63#define IWL5000_MODULE_FIRMWARE(api) _IWL5000_MODULE_FIRMWARE(api)
64 62
65#define IWL5150_FW_PRE "iwlwifi-5150-" 63#define IWL5150_FW_PRE "iwlwifi-5150-"
66#define _IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE #api ".ucode" 64#define IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE __stringify(api) ".ucode"
67#define IWL5150_MODULE_FIRMWARE(api) _IWL5150_MODULE_FIRMWARE(api)
68 65
69/* NIC configuration for 5000 series */ 66/* NIC configuration for 5000 series */
70static void iwl5000_nic_config(struct iwl_priv *priv) 67static void iwl5000_nic_config(struct iwl_priv *priv)
@@ -168,24 +165,23 @@ static void iwl5000_set_ct_threshold(struct iwl_priv *priv)
168 165
169static int iwl5000_hw_set_hw_params(struct iwl_priv *priv) 166static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
170{ 167{
171 if (priv->cfg->mod_params->num_of_queues >= IWL_MIN_NUM_QUEUES && 168 if (iwlagn_mod_params.num_of_queues >= IWL_MIN_NUM_QUEUES &&
172 priv->cfg->mod_params->num_of_queues <= IWLAGN_NUM_QUEUES) 169 iwlagn_mod_params.num_of_queues <= IWLAGN_NUM_QUEUES)
173 priv->cfg->num_of_queues = 170 priv->cfg->base_params->num_of_queues =
174 priv->cfg->mod_params->num_of_queues; 171 iwlagn_mod_params.num_of_queues;
175 172
176 priv->hw_params.max_txq_num = priv->cfg->num_of_queues; 173 priv->hw_params.max_txq_num = priv->cfg->base_params->num_of_queues;
177 priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM; 174 priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM;
178 priv->hw_params.scd_bc_tbls_size = 175 priv->hw_params.scd_bc_tbls_size =
179 priv->cfg->num_of_queues * 176 priv->cfg->base_params->num_of_queues *
180 sizeof(struct iwlagn_scd_bc_tbl); 177 sizeof(struct iwlagn_scd_bc_tbl);
181 priv->hw_params.tfd_size = sizeof(struct iwl_tfd); 178 priv->hw_params.tfd_size = sizeof(struct iwl_tfd);
182 priv->hw_params.max_stations = IWLAGN_STATION_COUNT; 179 priv->hw_params.max_stations = IWLAGN_STATION_COUNT;
183 priv->hw_params.bcast_sta_id = IWLAGN_BROADCAST_ID; 180 priv->contexts[IWL_RXON_CTX_BSS].bcast_sta_id = IWLAGN_BROADCAST_ID;
184 181
185 priv->hw_params.max_data_size = IWLAGN_RTC_DATA_SIZE; 182 priv->hw_params.max_data_size = IWLAGN_RTC_DATA_SIZE;
186 priv->hw_params.max_inst_size = IWLAGN_RTC_INST_SIZE; 183 priv->hw_params.max_inst_size = IWLAGN_RTC_INST_SIZE;
187 184
188 priv->hw_params.max_bsm_size = 0;
189 priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) | 185 priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
190 BIT(IEEE80211_BAND_5GHZ); 186 BIT(IEEE80211_BAND_5GHZ);
191 priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR; 187 priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
@@ -195,8 +191,7 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
195 priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant; 191 priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
196 priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant; 192 priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
197 193
198 if (priv->cfg->ops->lib->temp_ops.set_ct_kill) 194 iwl5000_set_ct_threshold(priv);
199 priv->cfg->ops->lib->temp_ops.set_ct_kill(priv);
200 195
201 /* Set initial sensitivity parameters */ 196 /* Set initial sensitivity parameters */
202 /* Set initial calibration set */ 197 /* Set initial calibration set */
@@ -215,24 +210,23 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
215 210
216static int iwl5150_hw_set_hw_params(struct iwl_priv *priv) 211static int iwl5150_hw_set_hw_params(struct iwl_priv *priv)
217{ 212{
218 if (priv->cfg->mod_params->num_of_queues >= IWL_MIN_NUM_QUEUES && 213 if (iwlagn_mod_params.num_of_queues >= IWL_MIN_NUM_QUEUES &&
219 priv->cfg->mod_params->num_of_queues <= IWLAGN_NUM_QUEUES) 214 iwlagn_mod_params.num_of_queues <= IWLAGN_NUM_QUEUES)
220 priv->cfg->num_of_queues = 215 priv->cfg->base_params->num_of_queues =
221 priv->cfg->mod_params->num_of_queues; 216 iwlagn_mod_params.num_of_queues;
222 217
223 priv->hw_params.max_txq_num = priv->cfg->num_of_queues; 218 priv->hw_params.max_txq_num = priv->cfg->base_params->num_of_queues;
224 priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM; 219 priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM;
225 priv->hw_params.scd_bc_tbls_size = 220 priv->hw_params.scd_bc_tbls_size =
226 priv->cfg->num_of_queues * 221 priv->cfg->base_params->num_of_queues *
227 sizeof(struct iwlagn_scd_bc_tbl); 222 sizeof(struct iwlagn_scd_bc_tbl);
228 priv->hw_params.tfd_size = sizeof(struct iwl_tfd); 223 priv->hw_params.tfd_size = sizeof(struct iwl_tfd);
229 priv->hw_params.max_stations = IWLAGN_STATION_COUNT; 224 priv->hw_params.max_stations = IWLAGN_STATION_COUNT;
230 priv->hw_params.bcast_sta_id = IWLAGN_BROADCAST_ID; 225 priv->contexts[IWL_RXON_CTX_BSS].bcast_sta_id = IWLAGN_BROADCAST_ID;
231 226
232 priv->hw_params.max_data_size = IWLAGN_RTC_DATA_SIZE; 227 priv->hw_params.max_data_size = IWLAGN_RTC_DATA_SIZE;
233 priv->hw_params.max_inst_size = IWLAGN_RTC_INST_SIZE; 228 priv->hw_params.max_inst_size = IWLAGN_RTC_INST_SIZE;
234 229
235 priv->hw_params.max_bsm_size = 0;
236 priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) | 230 priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
237 BIT(IEEE80211_BAND_5GHZ); 231 BIT(IEEE80211_BAND_5GHZ);
238 priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR; 232 priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
@@ -242,8 +236,7 @@ static int iwl5150_hw_set_hw_params(struct iwl_priv *priv)
242 priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant; 236 priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
243 priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant; 237 priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
244 238
245 if (priv->cfg->ops->lib->temp_ops.set_ct_kill) 239 iwl5150_set_ct_threshold(priv);
246 priv->cfg->ops->lib->temp_ops.set_ct_kill(priv);
247 240
248 /* Set initial sensitivity parameters */ 241 /* Set initial sensitivity parameters */
249 /* Set initial calibration set */ 242 /* Set initial calibration set */
@@ -265,7 +258,7 @@ static void iwl5150_temperature(struct iwl_priv *priv)
265 u32 vt = 0; 258 u32 vt = 0;
266 s32 offset = iwl_temp_calib_to_offset(priv); 259 s32 offset = iwl_temp_calib_to_offset(priv);
267 260
268 vt = le32_to_cpu(priv->_agn.statistics.general.common.temperature); 261 vt = le32_to_cpu(priv->statistics.common.temperature);
269 vt = vt / IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF + offset; 262 vt = vt / IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF + offset;
270 /* now vt hold the temperature in Kelvin */ 263 /* now vt hold the temperature in Kelvin */
271 priv->temperature = KELVIN_TO_CELSIUS(vt); 264 priv->temperature = KELVIN_TO_CELSIUS(vt);
@@ -275,28 +268,33 @@ static void iwl5150_temperature(struct iwl_priv *priv)
275static int iwl5000_hw_channel_switch(struct iwl_priv *priv, 268static int iwl5000_hw_channel_switch(struct iwl_priv *priv,
276 struct ieee80211_channel_switch *ch_switch) 269 struct ieee80211_channel_switch *ch_switch)
277{ 270{
271 /*
272 * MULTI-FIXME
273 * See iwl_mac_channel_switch.
274 */
275 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
278 struct iwl5000_channel_switch_cmd cmd; 276 struct iwl5000_channel_switch_cmd cmd;
279 const struct iwl_channel_info *ch_info; 277 const struct iwl_channel_info *ch_info;
280 u32 switch_time_in_usec, ucode_switch_time; 278 u32 switch_time_in_usec, ucode_switch_time;
281 u16 ch; 279 u16 ch;
282 u32 tsf_low; 280 u32 tsf_low;
283 u8 switch_count; 281 u8 switch_count;
284 u16 beacon_interval = le16_to_cpu(priv->rxon_timing.beacon_interval); 282 u16 beacon_interval = le16_to_cpu(ctx->timing.beacon_interval);
285 struct ieee80211_vif *vif = priv->vif; 283 struct ieee80211_vif *vif = ctx->vif;
286 struct iwl_host_cmd hcmd = { 284 struct iwl_host_cmd hcmd = {
287 .id = REPLY_CHANNEL_SWITCH, 285 .id = REPLY_CHANNEL_SWITCH,
288 .len = sizeof(cmd), 286 .len = { sizeof(cmd), },
289 .flags = CMD_SYNC, 287 .flags = CMD_SYNC,
290 .data = &cmd, 288 .data = { &cmd, },
291 }; 289 };
292 290
293 cmd.band = priv->band == IEEE80211_BAND_2GHZ; 291 cmd.band = priv->band == IEEE80211_BAND_2GHZ;
294 ch = ieee80211_frequency_to_channel(ch_switch->channel->center_freq); 292 ch = ch_switch->channel->hw_value;
295 IWL_DEBUG_11H(priv, "channel switch from %d to %d\n", 293 IWL_DEBUG_11H(priv, "channel switch from %d to %d\n",
296 priv->active_rxon.channel, ch); 294 ctx->active.channel, ch);
297 cmd.channel = cpu_to_le16(ch); 295 cmd.channel = cpu_to_le16(ch);
298 cmd.rxon_flags = priv->staging_rxon.flags; 296 cmd.rxon_flags = ctx->staging.flags;
299 cmd.rxon_filter_flags = priv->staging_rxon.filter_flags; 297 cmd.rxon_filter_flags = ctx->staging.filter_flags;
300 switch_count = ch_switch->count; 298 switch_count = ch_switch->count;
301 tsf_low = ch_switch->timestamp & 0x0ffffffff; 299 tsf_low = ch_switch->timestamp & 0x0ffffffff;
302 /* 300 /*
@@ -331,43 +329,24 @@ static int iwl5000_hw_channel_switch(struct iwl_priv *priv,
331 cmd.expect_beacon = is_channel_radar(ch_info); 329 cmd.expect_beacon = is_channel_radar(ch_info);
332 else { 330 else {
333 IWL_ERR(priv, "invalid channel switch from %u to %u\n", 331 IWL_ERR(priv, "invalid channel switch from %u to %u\n",
334 priv->active_rxon.channel, ch); 332 ctx->active.channel, ch);
335 return -EFAULT; 333 return -EFAULT;
336 } 334 }
337 priv->switch_rxon.channel = cmd.channel;
338 priv->switch_rxon.switch_in_progress = true;
339 335
340 return iwl_send_cmd_sync(priv, &hcmd); 336 return iwl_send_cmd_sync(priv, &hcmd);
341} 337}
342 338
343static struct iwl_lib_ops iwl5000_lib = { 339static struct iwl_lib_ops iwl5000_lib = {
344 .set_hw_params = iwl5000_hw_set_hw_params, 340 .set_hw_params = iwl5000_hw_set_hw_params,
345 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
346 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
347 .txq_set_sched = iwlagn_txq_set_sched,
348 .txq_agg_enable = iwlagn_txq_agg_enable,
349 .txq_agg_disable = iwlagn_txq_agg_disable,
350 .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
351 .txq_free_tfd = iwl_hw_txq_free_tfd,
352 .txq_init = iwl_hw_tx_queue_init,
353 .rx_handler_setup = iwlagn_rx_handler_setup, 341 .rx_handler_setup = iwlagn_rx_handler_setup,
354 .setup_deferred_work = iwlagn_setup_deferred_work, 342 .setup_deferred_work = iwlagn_setup_deferred_work,
355 .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, 343 .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
356 .dump_nic_event_log = iwl_dump_nic_event_log,
357 .dump_nic_error_log = iwl_dump_nic_error_log,
358 .dump_csr = iwl_dump_csr,
359 .dump_fh = iwl_dump_fh,
360 .load_ucode = iwlagn_load_ucode,
361 .init_alive_start = iwlagn_init_alive_start,
362 .alive_notify = iwlagn_alive_notify,
363 .send_tx_power = iwlagn_send_tx_power, 344 .send_tx_power = iwlagn_send_tx_power,
364 .update_chain_flags = iwl_update_chain_flags, 345 .update_chain_flags = iwl_update_chain_flags,
365 .set_channel_switch = iwl5000_hw_channel_switch, 346 .set_channel_switch = iwl5000_hw_channel_switch,
366 .apm_ops = { 347 .apm_ops = {
367 .init = iwl_apm_init, 348 .init = iwl_apm_init,
368 .stop = iwl_apm_stop,
369 .config = iwl5000_nic_config, 349 .config = iwl5000_nic_config,
370 .set_pwr_src = iwl_set_pwr_src,
371 }, 350 },
372 .eeprom_ops = { 351 .eeprom_ops = {
373 .regulatory_bands = { 352 .regulatory_bands = {
@@ -379,61 +358,26 @@ static struct iwl_lib_ops iwl5000_lib = {
379 EEPROM_REG_BAND_24_HT40_CHANNELS, 358 EEPROM_REG_BAND_24_HT40_CHANNELS,
380 EEPROM_REG_BAND_52_HT40_CHANNELS 359 EEPROM_REG_BAND_52_HT40_CHANNELS
381 }, 360 },
382 .verify_signature = iwlcore_eeprom_verify_signature,
383 .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
384 .release_semaphore = iwlcore_eeprom_release_semaphore,
385 .calib_version = iwlagn_eeprom_calib_version,
386 .query_addr = iwlagn_eeprom_query_addr, 361 .query_addr = iwlagn_eeprom_query_addr,
387 }, 362 },
388 .post_associate = iwl_post_associate,
389 .isr = iwl_isr_ict,
390 .config_ap = iwl_config_ap,
391 .temp_ops = { 363 .temp_ops = {
392 .temperature = iwlagn_temperature, 364 .temperature = iwlagn_temperature,
393 .set_ct_kill = iwl5000_set_ct_threshold,
394 }, 365 },
395 .manage_ibss_station = iwlagn_manage_ibss_station,
396 .update_bcast_station = iwl_update_bcast_station,
397 .debugfs_ops = {
398 .rx_stats_read = iwl_ucode_rx_stats_read,
399 .tx_stats_read = iwl_ucode_tx_stats_read,
400 .general_stats_read = iwl_ucode_general_stats_read,
401 .bt_stats_read = iwl_ucode_bt_stats_read,
402 },
403 .recover_from_tx_stall = iwl_bg_monitor_recover,
404 .check_plcp_health = iwl_good_plcp_health,
405 .check_ack_health = iwl_good_ack_health,
406 .txfifo_flush = iwlagn_txfifo_flush, 366 .txfifo_flush = iwlagn_txfifo_flush,
407 .dev_txfifo_flush = iwlagn_dev_txfifo_flush, 367 .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
408}; 368};
409 369
410static struct iwl_lib_ops iwl5150_lib = { 370static struct iwl_lib_ops iwl5150_lib = {
411 .set_hw_params = iwl5150_hw_set_hw_params, 371 .set_hw_params = iwl5150_hw_set_hw_params,
412 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
413 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
414 .txq_set_sched = iwlagn_txq_set_sched,
415 .txq_agg_enable = iwlagn_txq_agg_enable,
416 .txq_agg_disable = iwlagn_txq_agg_disable,
417 .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
418 .txq_free_tfd = iwl_hw_txq_free_tfd,
419 .txq_init = iwl_hw_tx_queue_init,
420 .rx_handler_setup = iwlagn_rx_handler_setup, 372 .rx_handler_setup = iwlagn_rx_handler_setup,
421 .setup_deferred_work = iwlagn_setup_deferred_work, 373 .setup_deferred_work = iwlagn_setup_deferred_work,
422 .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, 374 .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr,
423 .dump_nic_event_log = iwl_dump_nic_event_log,
424 .dump_nic_error_log = iwl_dump_nic_error_log,
425 .dump_csr = iwl_dump_csr,
426 .load_ucode = iwlagn_load_ucode,
427 .init_alive_start = iwlagn_init_alive_start,
428 .alive_notify = iwlagn_alive_notify,
429 .send_tx_power = iwlagn_send_tx_power, 375 .send_tx_power = iwlagn_send_tx_power,
430 .update_chain_flags = iwl_update_chain_flags, 376 .update_chain_flags = iwl_update_chain_flags,
431 .set_channel_switch = iwl5000_hw_channel_switch, 377 .set_channel_switch = iwl5000_hw_channel_switch,
432 .apm_ops = { 378 .apm_ops = {
433 .init = iwl_apm_init, 379 .init = iwl_apm_init,
434 .stop = iwl_apm_stop,
435 .config = iwl5000_nic_config, 380 .config = iwl5000_nic_config,
436 .set_pwr_src = iwl_set_pwr_src,
437 }, 381 },
438 .eeprom_ops = { 382 .eeprom_ops = {
439 .regulatory_bands = { 383 .regulatory_bands = {
@@ -445,29 +389,11 @@ static struct iwl_lib_ops iwl5150_lib = {
445 EEPROM_REG_BAND_24_HT40_CHANNELS, 389 EEPROM_REG_BAND_24_HT40_CHANNELS,
446 EEPROM_REG_BAND_52_HT40_CHANNELS 390 EEPROM_REG_BAND_52_HT40_CHANNELS
447 }, 391 },
448 .verify_signature = iwlcore_eeprom_verify_signature,
449 .acquire_semaphore = iwlcore_eeprom_acquire_semaphore,
450 .release_semaphore = iwlcore_eeprom_release_semaphore,
451 .calib_version = iwlagn_eeprom_calib_version,
452 .query_addr = iwlagn_eeprom_query_addr, 392 .query_addr = iwlagn_eeprom_query_addr,
453 }, 393 },
454 .post_associate = iwl_post_associate,
455 .isr = iwl_isr_ict,
456 .config_ap = iwl_config_ap,
457 .temp_ops = { 394 .temp_ops = {
458 .temperature = iwl5150_temperature, 395 .temperature = iwl5150_temperature,
459 .set_ct_kill = iwl5150_set_ct_threshold,
460 }, 396 },
461 .manage_ibss_station = iwlagn_manage_ibss_station,
462 .update_bcast_station = iwl_update_bcast_station,
463 .debugfs_ops = {
464 .rx_stats_read = iwl_ucode_rx_stats_read,
465 .tx_stats_read = iwl_ucode_tx_stats_read,
466 .general_stats_read = iwl_ucode_general_stats_read,
467 },
468 .recover_from_tx_stall = iwl_bg_monitor_recover,
469 .check_plcp_health = iwl_good_plcp_health,
470 .check_ack_health = iwl_good_ack_health,
471 .txfifo_flush = iwlagn_txfifo_flush, 397 .txfifo_flush = iwlagn_txfifo_flush,
472 .dev_txfifo_flush = iwlagn_dev_txfifo_flush, 398 .dev_txfifo_flush = iwlagn_dev_txfifo_flush,
473}; 399};
@@ -476,136 +402,70 @@ static const struct iwl_ops iwl5000_ops = {
476 .lib = &iwl5000_lib, 402 .lib = &iwl5000_lib,
477 .hcmd = &iwlagn_hcmd, 403 .hcmd = &iwlagn_hcmd,
478 .utils = &iwlagn_hcmd_utils, 404 .utils = &iwlagn_hcmd_utils,
479 .led = &iwlagn_led_ops,
480}; 405};
481 406
482static const struct iwl_ops iwl5150_ops = { 407static const struct iwl_ops iwl5150_ops = {
483 .lib = &iwl5150_lib, 408 .lib = &iwl5150_lib,
484 .hcmd = &iwlagn_hcmd, 409 .hcmd = &iwlagn_hcmd,
485 .utils = &iwlagn_hcmd_utils, 410 .utils = &iwlagn_hcmd_utils,
486 .led = &iwlagn_led_ops,
487}; 411};
488 412
489struct iwl_cfg iwl5300_agn_cfg = { 413static struct iwl_base_params iwl5000_base_params = {
490 .name = "Intel(R) Ultimate N WiFi Link 5300 AGN",
491 .fw_name_pre = IWL5000_FW_PRE,
492 .ucode_api_max = IWL5000_UCODE_API_MAX,
493 .ucode_api_min = IWL5000_UCODE_API_MIN,
494 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
495 .ops = &iwl5000_ops,
496 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE, 414 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
497 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
498 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
499 .num_of_queues = IWLAGN_NUM_QUEUES, 415 .num_of_queues = IWLAGN_NUM_QUEUES,
500 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, 416 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
501 .mod_params = &iwlagn_mod_params,
502 .valid_tx_ant = ANT_ABC,
503 .valid_rx_ant = ANT_ABC,
504 .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL, 417 .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
505 .set_l0s = true,
506 .use_bsm = false,
507 .ht_greenfield_support = true,
508 .led_compensation = 51, 418 .led_compensation = 51,
509 .use_rts_for_aggregation = true, /* use rts/cts protection */
510 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, 419 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
511 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, 420 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
512 .chain_noise_scale = 1000, 421 .chain_noise_scale = 1000,
513 .monitor_recover_period = IWL_LONG_MONITORING_PERIOD, 422 .wd_timeout = IWL_LONG_WD_TIMEOUT,
514 .max_event_log_size = 512, 423 .max_event_log_size = 512,
515 .ucode_tracing = true, 424};
516 .sensitivity_calib_by_driver = true, 425static struct iwl_ht_params iwl5000_ht_params = {
517 .chain_noise_calib_by_driver = true, 426 .ht_greenfield_support = true,
427};
428
429#define IWL_DEVICE_5000 \
430 .fw_name_pre = IWL5000_FW_PRE, \
431 .ucode_api_max = IWL5000_UCODE_API_MAX, \
432 .ucode_api_min = IWL5000_UCODE_API_MIN, \
433 .eeprom_ver = EEPROM_5000_EEPROM_VERSION, \
434 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, \
435 .ops = &iwl5000_ops, \
436 .base_params = &iwl5000_base_params, \
437 .led_mode = IWL_LED_BLINK
438
439struct iwl_cfg iwl5300_agn_cfg = {
440 .name = "Intel(R) Ultimate N WiFi Link 5300 AGN",
441 IWL_DEVICE_5000,
442 /* at least EEPROM 0x11A has wrong info */
443 .valid_tx_ant = ANT_ABC, /* .cfg overwrite */
444 .valid_rx_ant = ANT_ABC, /* .cfg overwrite */
445 .ht_params = &iwl5000_ht_params,
518}; 446};
519 447
520struct iwl_cfg iwl5100_bgn_cfg = { 448struct iwl_cfg iwl5100_bgn_cfg = {
521 .name = "Intel(R) WiFi Link 5100 BGN", 449 .name = "Intel(R) WiFi Link 5100 BGN",
522 .fw_name_pre = IWL5000_FW_PRE, 450 IWL_DEVICE_5000,
523 .ucode_api_max = IWL5000_UCODE_API_MAX, 451 .valid_tx_ant = ANT_B, /* .cfg overwrite */
524 .ucode_api_min = IWL5000_UCODE_API_MIN, 452 .valid_rx_ant = ANT_AB, /* .cfg overwrite */
525 .sku = IWL_SKU_G|IWL_SKU_N, 453 .ht_params = &iwl5000_ht_params,
526 .ops = &iwl5000_ops,
527 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
528 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
529 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
530 .num_of_queues = IWLAGN_NUM_QUEUES,
531 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
532 .mod_params = &iwlagn_mod_params,
533 .valid_tx_ant = ANT_B,
534 .valid_rx_ant = ANT_AB,
535 .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
536 .set_l0s = true,
537 .use_bsm = false,
538 .ht_greenfield_support = true,
539 .led_compensation = 51,
540 .use_rts_for_aggregation = true, /* use rts/cts protection */
541 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
542 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
543 .chain_noise_scale = 1000,
544 .monitor_recover_period = IWL_LONG_MONITORING_PERIOD,
545 .max_event_log_size = 512,
546 .ucode_tracing = true,
547 .sensitivity_calib_by_driver = true,
548 .chain_noise_calib_by_driver = true,
549}; 454};
550 455
551struct iwl_cfg iwl5100_abg_cfg = { 456struct iwl_cfg iwl5100_abg_cfg = {
552 .name = "Intel(R) WiFi Link 5100 ABG", 457 .name = "Intel(R) WiFi Link 5100 ABG",
553 .fw_name_pre = IWL5000_FW_PRE, 458 IWL_DEVICE_5000,
554 .ucode_api_max = IWL5000_UCODE_API_MAX, 459 .valid_tx_ant = ANT_B, /* .cfg overwrite */
555 .ucode_api_min = IWL5000_UCODE_API_MIN, 460 .valid_rx_ant = ANT_AB, /* .cfg overwrite */
556 .sku = IWL_SKU_A|IWL_SKU_G,
557 .ops = &iwl5000_ops,
558 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
559 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
560 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
561 .num_of_queues = IWLAGN_NUM_QUEUES,
562 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
563 .mod_params = &iwlagn_mod_params,
564 .valid_tx_ant = ANT_B,
565 .valid_rx_ant = ANT_AB,
566 .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
567 .set_l0s = true,
568 .use_bsm = false,
569 .led_compensation = 51,
570 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
571 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
572 .chain_noise_scale = 1000,
573 .monitor_recover_period = IWL_LONG_MONITORING_PERIOD,
574 .max_event_log_size = 512,
575 .ucode_tracing = true,
576 .sensitivity_calib_by_driver = true,
577 .chain_noise_calib_by_driver = true,
578}; 461};
579 462
580struct iwl_cfg iwl5100_agn_cfg = { 463struct iwl_cfg iwl5100_agn_cfg = {
581 .name = "Intel(R) WiFi Link 5100 AGN", 464 .name = "Intel(R) WiFi Link 5100 AGN",
582 .fw_name_pre = IWL5000_FW_PRE, 465 IWL_DEVICE_5000,
583 .ucode_api_max = IWL5000_UCODE_API_MAX, 466 .valid_tx_ant = ANT_B, /* .cfg overwrite */
584 .ucode_api_min = IWL5000_UCODE_API_MIN, 467 .valid_rx_ant = ANT_AB, /* .cfg overwrite */
585 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, 468 .ht_params = &iwl5000_ht_params,
586 .ops = &iwl5000_ops,
587 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
588 .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
589 .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION,
590 .num_of_queues = IWLAGN_NUM_QUEUES,
591 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
592 .mod_params = &iwlagn_mod_params,
593 .valid_tx_ant = ANT_B,
594 .valid_rx_ant = ANT_AB,
595 .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
596 .set_l0s = true,
597 .use_bsm = false,
598 .ht_greenfield_support = true,
599 .led_compensation = 51,
600 .use_rts_for_aggregation = true, /* use rts/cts protection */
601 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
602 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
603 .chain_noise_scale = 1000,
604 .monitor_recover_period = IWL_LONG_MONITORING_PERIOD,
605 .max_event_log_size = 512,
606 .ucode_tracing = true,
607 .sensitivity_calib_by_driver = true,
608 .chain_noise_calib_by_driver = true,
609}; 469};
610 470
611struct iwl_cfg iwl5350_agn_cfg = { 471struct iwl_cfg iwl5350_agn_cfg = {
@@ -613,92 +473,37 @@ struct iwl_cfg iwl5350_agn_cfg = {
613 .fw_name_pre = IWL5000_FW_PRE, 473 .fw_name_pre = IWL5000_FW_PRE,
614 .ucode_api_max = IWL5000_UCODE_API_MAX, 474 .ucode_api_max = IWL5000_UCODE_API_MAX,
615 .ucode_api_min = IWL5000_UCODE_API_MIN, 475 .ucode_api_min = IWL5000_UCODE_API_MIN,
616 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
617 .ops = &iwl5000_ops,
618 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
619 .eeprom_ver = EEPROM_5050_EEPROM_VERSION, 476 .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
620 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, 477 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
621 .num_of_queues = IWLAGN_NUM_QUEUES, 478 .ops = &iwl5000_ops,
622 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, 479 .base_params = &iwl5000_base_params,
623 .mod_params = &iwlagn_mod_params, 480 .ht_params = &iwl5000_ht_params,
624 .valid_tx_ant = ANT_ABC, 481 .led_mode = IWL_LED_BLINK,
625 .valid_rx_ant = ANT_ABC, 482 .internal_wimax_coex = true,
626 .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
627 .set_l0s = true,
628 .use_bsm = false,
629 .ht_greenfield_support = true,
630 .led_compensation = 51,
631 .use_rts_for_aggregation = true, /* use rts/cts protection */
632 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
633 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
634 .chain_noise_scale = 1000,
635 .monitor_recover_period = IWL_LONG_MONITORING_PERIOD,
636 .max_event_log_size = 512,
637 .ucode_tracing = true,
638 .sensitivity_calib_by_driver = true,
639 .chain_noise_calib_by_driver = true,
640}; 483};
641 484
485#define IWL_DEVICE_5150 \
486 .fw_name_pre = IWL5150_FW_PRE, \
487 .ucode_api_max = IWL5150_UCODE_API_MAX, \
488 .ucode_api_min = IWL5150_UCODE_API_MIN, \
489 .eeprom_ver = EEPROM_5050_EEPROM_VERSION, \
490 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, \
491 .ops = &iwl5150_ops, \
492 .base_params = &iwl5000_base_params, \
493 .need_dc_calib = true, \
494 .led_mode = IWL_LED_BLINK, \
495 .internal_wimax_coex = true
496
642struct iwl_cfg iwl5150_agn_cfg = { 497struct iwl_cfg iwl5150_agn_cfg = {
643 .name = "Intel(R) WiMAX/WiFi Link 5150 AGN", 498 .name = "Intel(R) WiMAX/WiFi Link 5150 AGN",
644 .fw_name_pre = IWL5150_FW_PRE, 499 IWL_DEVICE_5150,
645 .ucode_api_max = IWL5150_UCODE_API_MAX, 500 .ht_params = &iwl5000_ht_params,
646 .ucode_api_min = IWL5150_UCODE_API_MIN, 501
647 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
648 .ops = &iwl5150_ops,
649 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
650 .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
651 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
652 .num_of_queues = IWLAGN_NUM_QUEUES,
653 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
654 .mod_params = &iwlagn_mod_params,
655 .valid_tx_ant = ANT_A,
656 .valid_rx_ant = ANT_AB,
657 .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
658 .set_l0s = true,
659 .use_bsm = false,
660 .ht_greenfield_support = true,
661 .led_compensation = 51,
662 .use_rts_for_aggregation = true, /* use rts/cts protection */
663 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
664 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
665 .chain_noise_scale = 1000,
666 .monitor_recover_period = IWL_LONG_MONITORING_PERIOD,
667 .max_event_log_size = 512,
668 .ucode_tracing = true,
669 .sensitivity_calib_by_driver = true,
670 .chain_noise_calib_by_driver = true,
671 .need_dc_calib = true,
672}; 502};
673 503
674struct iwl_cfg iwl5150_abg_cfg = { 504struct iwl_cfg iwl5150_abg_cfg = {
675 .name = "Intel(R) WiMAX/WiFi Link 5150 ABG", 505 .name = "Intel(R) WiMAX/WiFi Link 5150 ABG",
676 .fw_name_pre = IWL5150_FW_PRE, 506 IWL_DEVICE_5150,
677 .ucode_api_max = IWL5150_UCODE_API_MAX,
678 .ucode_api_min = IWL5150_UCODE_API_MIN,
679 .sku = IWL_SKU_A|IWL_SKU_G,
680 .ops = &iwl5150_ops,
681 .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
682 .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
683 .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
684 .num_of_queues = IWLAGN_NUM_QUEUES,
685 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
686 .mod_params = &iwlagn_mod_params,
687 .valid_tx_ant = ANT_A,
688 .valid_rx_ant = ANT_AB,
689 .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
690 .set_l0s = true,
691 .use_bsm = false,
692 .led_compensation = 51,
693 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
694 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
695 .chain_noise_scale = 1000,
696 .monitor_recover_period = IWL_LONG_MONITORING_PERIOD,
697 .max_event_log_size = 512,
698 .ucode_tracing = true,
699 .sensitivity_calib_by_driver = true,
700 .chain_noise_calib_by_driver = true,
701 .need_dc_calib = true,
702}; 507};
703 508
704MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX)); 509MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX));