aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-6000.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-6000.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-6000.c110
1 files changed, 78 insertions, 32 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index dd03384432f4..7acef703253a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -47,17 +47,19 @@
47#include "iwl-agn-hw.h" 47#include "iwl-agn-hw.h"
48#include "iwl-6000-hw.h" 48#include "iwl-6000-hw.h"
49#include "iwl-agn-led.h" 49#include "iwl-agn-led.h"
50#include "iwl-agn-debugfs.h"
50 51
51/* Highest firmware API version supported */ 52/* Highest firmware API version supported */
52#define IWL6000_UCODE_API_MAX 4 53#define IWL6000_UCODE_API_MAX 4
53#define IWL6050_UCODE_API_MAX 4 54#define IWL6050_UCODE_API_MAX 4
55#define IWL6000G2_UCODE_API_MAX 4
54 56
55/* Lowest firmware API version supported */ 57/* Lowest firmware API version supported */
56#define IWL6000_UCODE_API_MIN 4 58#define IWL6000_UCODE_API_MIN 4
57#define IWL6050_UCODE_API_MIN 4 59#define IWL6050_UCODE_API_MIN 4
60#define IWL6000G2_UCODE_API_MIN 4
58 61
59#define IWL6000_FW_PRE "iwlwifi-6000-" 62#define IWL6000_FW_PRE "iwlwifi-6000-"
60#define IWL6000_G2_FW_PRE "iwlwifi-6005-"
61#define _IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE #api ".ucode" 63#define _IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE #api ".ucode"
62#define IWL6000_MODULE_FIRMWARE(api) _IWL6000_MODULE_FIRMWARE(api) 64#define IWL6000_MODULE_FIRMWARE(api) _IWL6000_MODULE_FIRMWARE(api)
63 65
@@ -65,6 +67,10 @@
65#define _IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE #api ".ucode" 67#define _IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE #api ".ucode"
66#define IWL6050_MODULE_FIRMWARE(api) _IWL6050_MODULE_FIRMWARE(api) 68#define IWL6050_MODULE_FIRMWARE(api) _IWL6050_MODULE_FIRMWARE(api)
67 69
70#define IWL6000G2_FW_PRE "iwlwifi-6005-"
71#define _IWL6000G2_MODULE_FIRMWARE(api) IWL6000G2_FW_PRE #api ".ucode"
72#define IWL6000G2_MODULE_FIRMWARE(api) _IWL6000G2_MODULE_FIRMWARE(api)
73
68static void iwl6000_set_ct_threshold(struct iwl_priv *priv) 74static void iwl6000_set_ct_threshold(struct iwl_priv *priv)
69{ 75{
70 /* want Celsius */ 76 /* want Celsius */
@@ -170,24 +176,56 @@ static int iwl6000_hw_set_hw_params(struct iwl_priv *priv)
170 /* Set initial sensitivity parameters */ 176 /* Set initial sensitivity parameters */
171 /* Set initial calibration set */ 177 /* Set initial calibration set */
172 priv->hw_params.sens = &iwl6000_sensitivity; 178 priv->hw_params.sens = &iwl6000_sensitivity;
173 switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) { 179 priv->hw_params.calib_init_cfg =
174 case CSR_HW_REV_TYPE_6x50: 180 BIT(IWL_CALIB_XTAL) |
175 priv->hw_params.calib_init_cfg = 181 BIT(IWL_CALIB_LO) |
176 BIT(IWL_CALIB_XTAL) | 182 BIT(IWL_CALIB_TX_IQ) |
177 BIT(IWL_CALIB_DC) | 183 BIT(IWL_CALIB_BASE_BAND);
178 BIT(IWL_CALIB_LO) | 184
179 BIT(IWL_CALIB_TX_IQ) | 185 return 0;
180 BIT(IWL_CALIB_BASE_BAND); 186}
181 187
182 break; 188static int iwl6050_hw_set_hw_params(struct iwl_priv *priv)
183 default: 189{
184 priv->hw_params.calib_init_cfg = 190 if (priv->cfg->mod_params->num_of_queues >= IWL_MIN_NUM_QUEUES &&
185 BIT(IWL_CALIB_XTAL) | 191 priv->cfg->mod_params->num_of_queues <= IWLAGN_NUM_QUEUES)
186 BIT(IWL_CALIB_LO) | 192 priv->cfg->num_of_queues =
187 BIT(IWL_CALIB_TX_IQ) | 193 priv->cfg->mod_params->num_of_queues;
188 BIT(IWL_CALIB_BASE_BAND); 194
189 break; 195 priv->hw_params.max_txq_num = priv->cfg->num_of_queues;
190 } 196 priv->hw_params.dma_chnl_num = FH50_TCSR_CHNL_NUM;
197 priv->hw_params.scd_bc_tbls_size =
198 priv->cfg->num_of_queues *
199 sizeof(struct iwlagn_scd_bc_tbl);
200 priv->hw_params.tfd_size = sizeof(struct iwl_tfd);
201 priv->hw_params.max_stations = IWL5000_STATION_COUNT;
202 priv->hw_params.bcast_sta_id = IWL5000_BROADCAST_ID;
203
204 priv->hw_params.max_data_size = IWL60_RTC_DATA_SIZE;
205 priv->hw_params.max_inst_size = IWL60_RTC_INST_SIZE;
206
207 priv->hw_params.max_bsm_size = 0;
208 priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
209 BIT(IEEE80211_BAND_5GHZ);
210 priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
211
212 priv->hw_params.tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant);
213 priv->hw_params.rx_chains_num = num_of_ant(priv->cfg->valid_rx_ant);
214 priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
215 priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
216
217 if (priv->cfg->ops->lib->temp_ops.set_ct_kill)
218 priv->cfg->ops->lib->temp_ops.set_ct_kill(priv);
219
220 /* Set initial sensitivity parameters */
221 /* Set initial calibration set */
222 priv->hw_params.sens = &iwl6000_sensitivity;
223 priv->hw_params.calib_init_cfg =
224 BIT(IWL_CALIB_XTAL) |
225 BIT(IWL_CALIB_DC) |
226 BIT(IWL_CALIB_LO) |
227 BIT(IWL_CALIB_TX_IQ) |
228 BIT(IWL_CALIB_BASE_BAND);
191 229
192 return 0; 230 return 0;
193} 231}
@@ -261,7 +299,7 @@ static struct iwl_lib_ops iwl6000_lib = {
261 EEPROM_REG_BAND_3_CHANNELS, 299 EEPROM_REG_BAND_3_CHANNELS,
262 EEPROM_REG_BAND_4_CHANNELS, 300 EEPROM_REG_BAND_4_CHANNELS,
263 EEPROM_REG_BAND_5_CHANNELS, 301 EEPROM_REG_BAND_5_CHANNELS,
264 EEPROM_REG_BAND_24_HT40_CHANNELS, 302 EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
265 EEPROM_REG_BAND_52_HT40_CHANNELS 303 EEPROM_REG_BAND_52_HT40_CHANNELS
266 }, 304 },
267 .verify_signature = iwlcore_eeprom_verify_signature, 305 .verify_signature = iwlcore_eeprom_verify_signature,
@@ -279,6 +317,11 @@ static struct iwl_lib_ops iwl6000_lib = {
279 .set_ct_kill = iwl6000_set_ct_threshold, 317 .set_ct_kill = iwl6000_set_ct_threshold,
280 }, 318 },
281 .add_bcast_station = iwl_add_bcast_station, 319 .add_bcast_station = iwl_add_bcast_station,
320 .debugfs_ops = {
321 .rx_stats_read = iwl_ucode_rx_stats_read,
322 .tx_stats_read = iwl_ucode_tx_stats_read,
323 .general_stats_read = iwl_ucode_general_stats_read,
324 },
282 .recover_from_tx_stall = iwl_bg_monitor_recover, 325 .recover_from_tx_stall = iwl_bg_monitor_recover,
283 .check_plcp_health = iwl_good_plcp_health, 326 .check_plcp_health = iwl_good_plcp_health,
284 .check_ack_health = iwl_good_ack_health, 327 .check_ack_health = iwl_good_ack_health,
@@ -293,7 +336,7 @@ static const struct iwl_ops iwl6000_ops = {
293}; 336};
294 337
295static struct iwl_lib_ops iwl6050_lib = { 338static struct iwl_lib_ops iwl6050_lib = {
296 .set_hw_params = iwl6000_hw_set_hw_params, 339 .set_hw_params = iwl6050_hw_set_hw_params,
297 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl, 340 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
298 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl, 341 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
299 .txq_set_sched = iwlagn_txq_set_sched, 342 .txq_set_sched = iwlagn_txq_set_sched,
@@ -328,7 +371,7 @@ static struct iwl_lib_ops iwl6050_lib = {
328 EEPROM_REG_BAND_3_CHANNELS, 371 EEPROM_REG_BAND_3_CHANNELS,
329 EEPROM_REG_BAND_4_CHANNELS, 372 EEPROM_REG_BAND_4_CHANNELS,
330 EEPROM_REG_BAND_5_CHANNELS, 373 EEPROM_REG_BAND_5_CHANNELS,
331 EEPROM_REG_BAND_24_HT40_CHANNELS, 374 EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
332 EEPROM_REG_BAND_52_HT40_CHANNELS 375 EEPROM_REG_BAND_52_HT40_CHANNELS
333 }, 376 },
334 .verify_signature = iwlcore_eeprom_verify_signature, 377 .verify_signature = iwlcore_eeprom_verify_signature,
@@ -347,6 +390,11 @@ static struct iwl_lib_ops iwl6050_lib = {
347 .set_calib_version = iwl6050_set_calib_version, 390 .set_calib_version = iwl6050_set_calib_version,
348 }, 391 },
349 .add_bcast_station = iwl_add_bcast_station, 392 .add_bcast_station = iwl_add_bcast_station,
393 .debugfs_ops = {
394 .rx_stats_read = iwl_ucode_rx_stats_read,
395 .tx_stats_read = iwl_ucode_tx_stats_read,
396 .general_stats_read = iwl_ucode_general_stats_read,
397 },
350 .recover_from_tx_stall = iwl_bg_monitor_recover, 398 .recover_from_tx_stall = iwl_bg_monitor_recover,
351 .check_plcp_health = iwl_good_plcp_health, 399 .check_plcp_health = iwl_good_plcp_health,
352 .check_ack_health = iwl_good_ack_health, 400 .check_ack_health = iwl_good_ack_health,
@@ -363,16 +411,16 @@ static const struct iwl_ops iwl6050_ops = {
363/* 411/*
364 * "i": Internal configuration, use internal Power Amplifier 412 * "i": Internal configuration, use internal Power Amplifier
365 */ 413 */
366struct iwl_cfg iwl6000i_g2_2agn_cfg = { 414struct iwl_cfg iwl6000g2_2agn_cfg = {
367 .name = "6000 Series 2x2 AGN Gen2", 415 .name = "6000 Series 2x2 AGN Gen2",
368 .fw_name_pre = IWL6000_G2_FW_PRE, 416 .fw_name_pre = IWL6000G2_FW_PRE,
369 .ucode_api_max = IWL6000_UCODE_API_MAX, 417 .ucode_api_max = IWL6000G2_UCODE_API_MAX,
370 .ucode_api_min = IWL6000_UCODE_API_MIN, 418 .ucode_api_min = IWL6000G2_UCODE_API_MIN,
371 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, 419 .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
372 .ops = &iwl6000_ops, 420 .ops = &iwl6000_ops,
373 .eeprom_size = OTP_LOW_IMAGE_SIZE, 421 .eeprom_size = OTP_LOW_IMAGE_SIZE,
374 .eeprom_ver = EEPROM_6000_EEPROM_VERSION, 422 .eeprom_ver = EEPROM_6000G2_EEPROM_VERSION,
375 .eeprom_calib_ver = EEPROM_6000_TX_POWER_VERSION, 423 .eeprom_calib_ver = EEPROM_6000G2_TX_POWER_VERSION,
376 .num_of_queues = IWLAGN_NUM_QUEUES, 424 .num_of_queues = IWLAGN_NUM_QUEUES,
377 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, 425 .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES,
378 .mod_params = &iwlagn_mod_params, 426 .mod_params = &iwlagn_mod_params,
@@ -381,7 +429,7 @@ struct iwl_cfg iwl6000i_g2_2agn_cfg = {
381 .pll_cfg_val = 0, 429 .pll_cfg_val = 0,
382 .set_l0s = true, 430 .set_l0s = true,
383 .use_bsm = false, 431 .use_bsm = false,
384 .pa_type = IWL_PA_INTERNAL, 432 .pa_type = IWL_PA_SYSTEM,
385 .max_ll_items = OTP_MAX_LL_ITEMS_6x00, 433 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
386 .shadow_ram_support = true, 434 .shadow_ram_support = true,
387 .ht_greenfield_support = true, 435 .ht_greenfield_support = true,
@@ -452,7 +500,6 @@ struct iwl_cfg iwl6000i_2abg_cfg = {
452 .pa_type = IWL_PA_INTERNAL, 500 .pa_type = IWL_PA_INTERNAL,
453 .max_ll_items = OTP_MAX_LL_ITEMS_6x00, 501 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
454 .shadow_ram_support = true, 502 .shadow_ram_support = true,
455 .ht_greenfield_support = true,
456 .led_compensation = 51, 503 .led_compensation = 51,
457 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, 504 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
458 .supports_idle = true, 505 .supports_idle = true,
@@ -485,7 +532,6 @@ struct iwl_cfg iwl6000i_2bg_cfg = {
485 .pa_type = IWL_PA_INTERNAL, 532 .pa_type = IWL_PA_INTERNAL,
486 .max_ll_items = OTP_MAX_LL_ITEMS_6x00, 533 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
487 .shadow_ram_support = true, 534 .shadow_ram_support = true,
488 .ht_greenfield_support = true,
489 .led_compensation = 51, 535 .led_compensation = 51,
490 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, 536 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
491 .supports_idle = true, 537 .supports_idle = true,
@@ -552,7 +598,6 @@ struct iwl_cfg iwl6050_2abg_cfg = {
552 .pa_type = IWL_PA_SYSTEM, 598 .pa_type = IWL_PA_SYSTEM,
553 .max_ll_items = OTP_MAX_LL_ITEMS_6x50, 599 .max_ll_items = OTP_MAX_LL_ITEMS_6x50,
554 .shadow_ram_support = true, 600 .shadow_ram_support = true,
555 .ht_greenfield_support = true,
556 .led_compensation = 51, 601 .led_compensation = 51,
557 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, 602 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS,
558 .supports_idle = true, 603 .supports_idle = true,
@@ -600,3 +645,4 @@ struct iwl_cfg iwl6000_3agn_cfg = {
600 645
601MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); 646MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
602MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX)); 647MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
648MODULE_FIRMWARE(IWL6000G2_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));