blob: 81b83f484f08318c505fb3648ef1a88b15615fcb [file] [log] [blame]
Jay Sternbergc5d05692009-01-19 15:30:35 -08001/******************************************************************************
2 *
Wey-Yi Guy4e318262011-12-27 11:21:32 -08003 * Copyright(c) 2008 - 2012 Intel Corporation. All rights reserved.
Jay Sternbergc5d05692009-01-19 15:30:35 -08004 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17 *
18 * The full GNU General Public License is included in this distribution in the
19 * file called LICENSE.
20 *
21 * Contact Information:
22 * Intel Linux Wireless <ilw@linux.intel.com>
23 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
24 *
25 *****************************************************************************/
26
Jay Sternbergc5d05692009-01-19 15:30:35 -080027#include <linux/module.h>
Evgeni Golov8fcbd4dc2011-06-12 05:34:31 -070028#include <linux/stringify.h>
Johannes Berge9676692012-04-10 14:10:28 -070029#include "iwl-config.h"
Johannes Berg0db19cd2012-04-03 20:57:59 +020030#include "iwl-csr.h"
31#include "iwl-agn-hw.h"
Johannes Berg6468a012012-05-16 19:13:54 +020032#include "cfg.h"
Jay Sternbergc5d05692009-01-19 15:30:35 -080033
34/* Highest firmware API version supported */
Meenakshi Venkataraman78cbcf22012-04-22 07:55:27 -070035#define IWL1000_UCODE_API_MAX 5
36#define IWL100_UCODE_API_MAX 5
Johannes Bergca9a4602011-07-23 10:24:45 -070037
38/* Oldest version we won't warn about */
39#define IWL1000_UCODE_API_OK 5
40#define IWL100_UCODE_API_OK 5
Jay Sternbergc5d05692009-01-19 15:30:35 -080041
42/* Lowest firmware API version supported */
Jay Sternberg77dcb6a2009-03-06 13:52:55 -080043#define IWL1000_UCODE_API_MIN 1
Jay Sternberg1de19ec2010-09-14 15:21:20 -070044#define IWL100_UCODE_API_MIN 5
Jay Sternbergc5d05692009-01-19 15:30:35 -080045
Johannes Berg586aed92012-04-03 20:41:07 +020046/* EEPROM version */
47#define EEPROM_1000_TX_POWER_VERSION (4)
48#define EEPROM_1000_EEPROM_VERSION (0x15C)
49
Jay Sternberg77dcb6a2009-03-06 13:52:55 -080050#define IWL1000_FW_PRE "iwlwifi-1000-"
Evgeni Golov8fcbd4dc2011-06-12 05:34:31 -070051#define IWL1000_MODULE_FIRMWARE(api) IWL1000_FW_PRE __stringify(api) ".ucode"
Jay Sternbergc5d05692009-01-19 15:30:35 -080052
Jay Sternberg1de19ec2010-09-14 15:21:20 -070053#define IWL100_FW_PRE "iwlwifi-100-"
Evgeni Golov8fcbd4dc2011-06-12 05:34:31 -070054#define IWL100_MODULE_FIRMWARE(api) IWL100_FW_PRE __stringify(api) ".ucode"
Jay Sternberg1de19ec2010-09-14 15:21:20 -070055
Wey-Yi Guy672639d2009-07-24 11:13:01 -070056
Johannes Berg6794f3e2012-03-06 13:30:56 -080057static const struct iwl_base_params iwl1000_base_params = {
Wey-Yi Guy19e6cda2010-03-16 17:41:23 -070058 .num_of_queues = IWLAGN_NUM_QUEUES,
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -070059 .eeprom_size = OTP_LOW_IMAGE_SIZE,
Ben Cahillfadb3582009-10-23 13:42:21 -070060 .pll_cfg_val = CSR50_ANA_PLL_CFG_VAL,
Wey-Yi Guy415e4992009-08-13 13:30:54 -070061 .max_ll_items = OTP_MAX_LL_ITEMS_1000,
62 .shadow_ram_support = false,
Wey-Yi Guyf2d0d0e2009-09-11 10:38:14 -070063 .led_compensation = 51,
Wey-Yi Guy480e8402009-10-23 13:42:28 -070064 .support_ct_kill_exit = true,
Trieu 'Andrew' Nguyen6c3872e2010-02-08 13:53:05 -080065 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF,
Ben Cahilld4fe5ac2010-02-05 11:33:46 -080066 .chain_noise_scale = 1000,
Paul Bolle6de49022012-05-30 09:14:41 +020067 .wd_timeout = IWL_WATCHDOG_DISABLED,
Wey-Yi Guy678b3852010-03-26 12:54:37 -070068 .max_event_log_size = 128,
Jay Sternbergc5d05692009-01-19 15:30:35 -080069};
Johannes Berg6794f3e2012-03-06 13:30:56 -080070
71static const struct iwl_ht_params iwl1000_ht_params = {
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -070072 .ht_greenfield_support = true,
73 .use_rts_for_aggregation = true, /* use rts/cts protection */
Johannes Bergd3704932012-05-21 20:03:01 +020074 .ht40_bands = BIT(IEEE80211_BAND_2GHZ),
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -070075};
76
Johannes Berg26a7ca92012-05-21 11:55:54 +020077static const struct iwl_eeprom_params iwl1000_eeprom_params = {
78 .regulatory_bands = {
79 EEPROM_REG_BAND_1_CHANNELS,
80 EEPROM_REG_BAND_2_CHANNELS,
81 EEPROM_REG_BAND_3_CHANNELS,
82 EEPROM_REG_BAND_4_CHANNELS,
83 EEPROM_REG_BAND_5_CHANNELS,
84 EEPROM_REG_BAND_24_HT40_CHANNELS,
85 EEPROM_REGULATORY_BAND_NO_HT40,
86 }
87};
88
Wey-Yi Guy65af8de2010-12-08 07:51:50 -080089#define IWL_DEVICE_1000 \
90 .fw_name_pre = IWL1000_FW_PRE, \
91 .ucode_api_max = IWL1000_UCODE_API_MAX, \
Johannes Bergca9a4602011-07-23 10:24:45 -070092 .ucode_api_ok = IWL1000_UCODE_API_OK, \
Wey-Yi Guy65af8de2010-12-08 07:51:50 -080093 .ucode_api_min = IWL1000_UCODE_API_MIN, \
Johannes Berg2d771cb2012-04-09 17:47:00 -070094 .device_family = IWL_DEVICE_FAMILY_1000, \
Emmanuel Grumbachdae66d02012-02-07 12:56:26 +020095 .max_inst_size = IWLAGN_RTC_INST_SIZE, \
96 .max_data_size = IWLAGN_RTC_DATA_SIZE, \
Wey-Yi Guy65af8de2010-12-08 07:51:50 -080097 .eeprom_ver = EEPROM_1000_EEPROM_VERSION, \
98 .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, \
Wey-Yi Guy65af8de2010-12-08 07:51:50 -080099 .base_params = &iwl1000_base_params, \
Johannes Berg26a7ca92012-05-21 11:55:54 +0200100 .eeprom_params = &iwl1000_eeprom_params, \
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800101 .led_mode = IWL_LED_BLINK
102
Johannes Berg706c4ff2012-03-05 11:24:33 -0800103const struct iwl_cfg iwl1000_bgn_cfg = {
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -0700104 .name = "Intel(R) Centrino(R) Wireless-N 1000 BGN",
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800105 IWL_DEVICE_1000,
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -0700106 .ht_params = &iwl1000_ht_params,
107};
Jay Sternbergc5d05692009-01-19 15:30:35 -0800108
Johannes Berg706c4ff2012-03-05 11:24:33 -0800109const struct iwl_cfg iwl1000_bg_cfg = {
Shanyu Zhaoc11362c2010-03-05 17:05:20 -0800110 .name = "Intel(R) Centrino(R) Wireless-N 1000 BG",
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800111 IWL_DEVICE_1000,
Wey-Yi Guy4bd0914f2009-09-17 10:43:52 -0700112};
113
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800114#define IWL_DEVICE_100 \
115 .fw_name_pre = IWL100_FW_PRE, \
116 .ucode_api_max = IWL100_UCODE_API_MAX, \
Johannes Bergca9a4602011-07-23 10:24:45 -0700117 .ucode_api_ok = IWL100_UCODE_API_OK, \
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800118 .ucode_api_min = IWL100_UCODE_API_MIN, \
Johannes Berg2d771cb2012-04-09 17:47:00 -0700119 .device_family = IWL_DEVICE_FAMILY_100, \
Emmanuel Grumbachdae66d02012-02-07 12:56:26 +0200120 .max_inst_size = IWLAGN_RTC_INST_SIZE, \
121 .max_data_size = IWLAGN_RTC_DATA_SIZE, \
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800122 .eeprom_ver = EEPROM_1000_EEPROM_VERSION, \
123 .eeprom_calib_ver = EEPROM_1000_TX_POWER_VERSION, \
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800124 .base_params = &iwl1000_base_params, \
Johannes Berg26a7ca92012-05-21 11:55:54 +0200125 .eeprom_params = &iwl1000_eeprom_params, \
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800126 .led_mode = IWL_LED_RF_STATE, \
127 .rx_with_siso_diversity = true
128
Johannes Berg706c4ff2012-03-05 11:24:33 -0800129const struct iwl_cfg iwl100_bgn_cfg = {
Wey-Yi Guy638514f2010-11-17 12:13:55 -0800130 .name = "Intel(R) Centrino(R) Wireless-N 100 BGN",
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800131 IWL_DEVICE_100,
Wey-Yi Guy7cb1b082010-10-06 08:10:00 -0700132 .ht_params = &iwl1000_ht_params,
Jay Sternberg1de19ec2010-09-14 15:21:20 -0700133};
134
Johannes Berg706c4ff2012-03-05 11:24:33 -0800135const struct iwl_cfg iwl100_bg_cfg = {
Wey-Yi Guy638514f2010-11-17 12:13:55 -0800136 .name = "Intel(R) Centrino(R) Wireless-N 100 BG",
Wey-Yi Guy65af8de2010-12-08 07:51:50 -0800137 IWL_DEVICE_100,
Jay Sternberg1de19ec2010-09-14 15:21:20 -0700138};
139
Meenakshi Venkataraman78cbcf22012-04-22 07:55:27 -0700140MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_OK));
141MODULE_FIRMWARE(IWL100_MODULE_FIRMWARE(IWL100_UCODE_API_OK));