Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec...
[deliverable/linux.git] / drivers / net / wireless / iwlwifi / iwl-2000.c
CommitLineData
c5a5e185
WYG
1/******************************************************************************
2 *
51368bf7 3 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
c5a5e185
WYG
4 *
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
c5a5e185 27#include <linux/module.h>
8fcbd4dc 28#include <linux/stringify.h>
e9676695 29#include "iwl-config.h"
0db19cde 30#include "iwl-agn-hw.h"
1023fdc4 31#include "dvm/commands.h" /* needed for BT for now */
c5a5e185
WYG
32
33/* Highest firmware API version supported */
ca9a4605
JB
34#define IWL2030_UCODE_API_MAX 6
35#define IWL2000_UCODE_API_MAX 6
36#define IWL105_UCODE_API_MAX 6
37#define IWL135_UCODE_API_MAX 6
38
39/* Oldest version we won't warn about */
78cbcf2b
MV
40#define IWL2030_UCODE_API_OK 6
41#define IWL2000_UCODE_API_OK 6
42#define IWL105_UCODE_API_OK 6
43#define IWL135_UCODE_API_OK 6
c5a5e185
WYG
44
45/* Lowest firmware API version supported */
46#define IWL2030_UCODE_API_MIN 5
47#define IWL2000_UCODE_API_MIN 5
b4ed221d 48#define IWL105_UCODE_API_MIN 5
54e9c409 49#define IWL135_UCODE_API_MIN 5
c5a5e185 50
586aed96
JB
51/* EEPROM version */
52#define EEPROM_2000_TX_POWER_VERSION (6)
53#define EEPROM_2000_EEPROM_VERSION (0x805)
54
55
c5a5e185 56#define IWL2030_FW_PRE "iwlwifi-2030-"
8fcbd4dc 57#define IWL2030_MODULE_FIRMWARE(api) IWL2030_FW_PRE __stringify(api) ".ucode"
c5a5e185
WYG
58
59#define IWL2000_FW_PRE "iwlwifi-2000-"
8fcbd4dc 60#define IWL2000_MODULE_FIRMWARE(api) IWL2000_FW_PRE __stringify(api) ".ucode"
c5a5e185 61
b4ed221d 62#define IWL105_FW_PRE "iwlwifi-105-"
8fcbd4dc 63#define IWL105_MODULE_FIRMWARE(api) IWL105_FW_PRE __stringify(api) ".ucode"
c5a5e185 64
54e9c409 65#define IWL135_FW_PRE "iwlwifi-135-"
5092e47a 66#define IWL135_MODULE_FIRMWARE(api) IWL135_FW_PRE __stringify(api) ".ucode"
54e9c409 67
6794f3ee 68static const struct iwl_base_params iwl2000_base_params = {
c5a5e185
WYG
69 .eeprom_size = OTP_LOW_IMAGE_SIZE,
70 .num_of_queues = IWLAGN_NUM_QUEUES,
c5a5e185 71 .pll_cfg_val = 0,
c5a5e185
WYG
72 .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
73 .shadow_ram_support = true,
74 .led_compensation = 51,
c5a5e185
WYG
75 .wd_timeout = IWL_DEF_WD_TIMEOUT,
76 .max_event_log_size = 512,
66a77072 77 .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
e03bbb62 78 .scd_chain_ext_wa = true,
c5a5e185
WYG
79};
80
81
6794f3ee 82static const struct iwl_base_params iwl2030_base_params = {
c5a5e185
WYG
83 .eeprom_size = OTP_LOW_IMAGE_SIZE,
84 .num_of_queues = IWLAGN_NUM_QUEUES,
c5a5e185 85 .pll_cfg_val = 0,
c5a5e185
WYG
86 .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
87 .shadow_ram_support = true,
88 .led_compensation = 57,
c5a5e185
WYG
89 .wd_timeout = IWL_LONG_WD_TIMEOUT,
90 .max_event_log_size = 512,
66a77072 91 .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
e03bbb62 92 .scd_chain_ext_wa = true,
c5a5e185
WYG
93};
94
6794f3ee 95static const struct iwl_ht_params iwl2000_ht_params = {
c5a5e185
WYG
96 .ht_greenfield_support = true,
97 .use_rts_for_aggregation = true, /* use rts/cts protection */
d370493f 98 .ht40_bands = BIT(IEEE80211_BAND_2GHZ),
c5a5e185
WYG
99};
100
26a7ca9a
JB
101static const struct iwl_eeprom_params iwl20x0_eeprom_params = {
102 .regulatory_bands = {
103 EEPROM_REG_BAND_1_CHANNELS,
104 EEPROM_REG_BAND_2_CHANNELS,
105 EEPROM_REG_BAND_3_CHANNELS,
106 EEPROM_REG_BAND_4_CHANNELS,
107 EEPROM_REG_BAND_5_CHANNELS,
108 EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
109 EEPROM_REGULATORY_BAND_NO_HT40,
110 },
111 .enhanced_txpower = true,
112};
113
c5a5e185
WYG
114#define IWL_DEVICE_2000 \
115 .fw_name_pre = IWL2000_FW_PRE, \
116 .ucode_api_max = IWL2000_UCODE_API_MAX, \
ca9a4605 117 .ucode_api_ok = IWL2000_UCODE_API_OK, \
c5a5e185 118 .ucode_api_min = IWL2000_UCODE_API_MIN, \
2d771cb6 119 .device_family = IWL_DEVICE_FAMILY_2000, \
dae66d0d
EG
120 .max_inst_size = IWL60_RTC_INST_SIZE, \
121 .max_data_size = IWL60_RTC_DATA_SIZE, \
0d8877a1
JB
122 .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
123 .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
c5a5e185 124 .base_params = &iwl2000_base_params, \
26a7ca9a 125 .eeprom_params = &iwl20x0_eeprom_params, \
cf61686a 126 .led_mode = IWL_LED_RF_STATE
c5a5e185 127
706c4ff6 128const struct iwl_cfg iwl2000_2bgn_cfg = {
6195d135 129 .name = "Intel(R) Centrino(R) Wireless-N 2200 BGN",
c5a5e185
WYG
130 IWL_DEVICE_2000,
131 .ht_params = &iwl2000_ht_params,
132};
133
706c4ff6 134const struct iwl_cfg iwl2000_2bgn_d_cfg = {
6195d135 135 .name = "Intel(R) Centrino(R) Wireless-N 2200D BGN",
1603dd49 136 IWL_DEVICE_2000,
ec8f734f 137 .ht_params = &iwl2000_ht_params,
1603dd49
WYG
138};
139
c5a5e185
WYG
140#define IWL_DEVICE_2030 \
141 .fw_name_pre = IWL2030_FW_PRE, \
142 .ucode_api_max = IWL2030_UCODE_API_MAX, \
ca9a4605 143 .ucode_api_ok = IWL2030_UCODE_API_OK, \
c5a5e185 144 .ucode_api_min = IWL2030_UCODE_API_MIN, \
2d771cb6 145 .device_family = IWL_DEVICE_FAMILY_2030, \
dae66d0d
EG
146 .max_inst_size = IWL60_RTC_INST_SIZE, \
147 .max_data_size = IWL60_RTC_DATA_SIZE, \
b7998c8b
EL
148 .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
149 .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
c5a5e185 150 .base_params = &iwl2030_base_params, \
26a7ca9a 151 .eeprom_params = &iwl20x0_eeprom_params, \
0d8877a1 152 .led_mode = IWL_LED_RF_STATE
c5a5e185 153
706c4ff6 154const struct iwl_cfg iwl2030_2bgn_cfg = {
6195d135 155 .name = "Intel(R) Centrino(R) Wireless-N 2230 BGN",
96234cc8 156 IWL_DEVICE_2030,
c5a5e185
WYG
157 .ht_params = &iwl2000_ht_params,
158};
159
b4ed221d
WYG
160#define IWL_DEVICE_105 \
161 .fw_name_pre = IWL105_FW_PRE, \
162 .ucode_api_max = IWL105_UCODE_API_MAX, \
ca9a4605 163 .ucode_api_ok = IWL105_UCODE_API_OK, \
b4ed221d 164 .ucode_api_min = IWL105_UCODE_API_MIN, \
2d771cb6 165 .device_family = IWL_DEVICE_FAMILY_105, \
dae66d0d
EG
166 .max_inst_size = IWL60_RTC_INST_SIZE, \
167 .max_data_size = IWL60_RTC_DATA_SIZE, \
b7998c8b
EL
168 .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
169 .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
c5a5e185 170 .base_params = &iwl2000_base_params, \
26a7ca9a 171 .eeprom_params = &iwl20x0_eeprom_params, \
c5a5e185 172 .led_mode = IWL_LED_RF_STATE, \
cf61686a 173 .rx_with_siso_diversity = true
c5a5e185 174
706c4ff6 175const struct iwl_cfg iwl105_bgn_cfg = {
6195d135 176 .name = "Intel(R) Centrino(R) Wireless-N 105 BGN",
b4ed221d 177 IWL_DEVICE_105,
c5a5e185
WYG
178 .ht_params = &iwl2000_ht_params,
179};
180
706c4ff6 181const struct iwl_cfg iwl105_bgn_d_cfg = {
6195d135 182 .name = "Intel(R) Centrino(R) Wireless-N 105D BGN",
b319d3eb
WYG
183 IWL_DEVICE_105,
184 .ht_params = &iwl2000_ht_params,
185};
186
b4ed221d 187#define IWL_DEVICE_135 \
54e9c409
WYG
188 .fw_name_pre = IWL135_FW_PRE, \
189 .ucode_api_max = IWL135_UCODE_API_MAX, \
ca9a4605 190 .ucode_api_ok = IWL135_UCODE_API_OK, \
54e9c409 191 .ucode_api_min = IWL135_UCODE_API_MIN, \
2d771cb6 192 .device_family = IWL_DEVICE_FAMILY_135, \
dae66d0d
EG
193 .max_inst_size = IWL60_RTC_INST_SIZE, \
194 .max_data_size = IWL60_RTC_DATA_SIZE, \
b7998c8b
EL
195 .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
196 .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
c5a5e185 197 .base_params = &iwl2030_base_params, \
26a7ca9a 198 .eeprom_params = &iwl20x0_eeprom_params, \
c5a5e185 199 .led_mode = IWL_LED_RF_STATE, \
cf61686a 200 .rx_with_siso_diversity = true
c5a5e185 201
706c4ff6 202const struct iwl_cfg iwl135_bgn_cfg = {
6195d135 203 .name = "Intel(R) Centrino(R) Wireless-N 135 BGN",
b4ed221d 204 IWL_DEVICE_135,
c5a5e185
WYG
205 .ht_params = &iwl2000_ht_params,
206};
207
78cbcf2b
MV
208MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_OK));
209MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_OK));
210MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_OK));
211MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_OK));
This page took 0.281718 seconds and 5 git commands to generate.