Merge tag 'gpio-v3.13-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
[linux-2.6.git] / drivers / net / wireless / iwlwifi / iwl-2000.c
blobc727ec7c90a65ec1f760c6e0cc53b3af026850e4
1 /******************************************************************************
3 * Copyright(c) 2008 - 2013 Intel Corporation. All rights reserved.
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.
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.
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
18 * The full GNU General Public License is included in this distribution in the
19 * file called LICENSE.
21 * Contact Information:
22 * Intel Linux Wireless <ilw@linux.intel.com>
23 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
25 *****************************************************************************/
27 #include <linux/module.h>
28 #include <linux/stringify.h>
29 #include "iwl-config.h"
30 #include "iwl-agn-hw.h"
31 #include "dvm/commands.h" /* needed for BT for now */
33 /* Highest firmware API version supported */
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
39 /* Oldest version we won't warn about */
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
45 /* Lowest firmware API version supported */
46 #define IWL2030_UCODE_API_MIN 5
47 #define IWL2000_UCODE_API_MIN 5
48 #define IWL105_UCODE_API_MIN 5
49 #define IWL135_UCODE_API_MIN 5
51 /* EEPROM version */
52 #define EEPROM_2000_TX_POWER_VERSION (6)
53 #define EEPROM_2000_EEPROM_VERSION (0x805)
56 #define IWL2030_FW_PRE "iwlwifi-2030-"
57 #define IWL2030_MODULE_FIRMWARE(api) IWL2030_FW_PRE __stringify(api) ".ucode"
59 #define IWL2000_FW_PRE "iwlwifi-2000-"
60 #define IWL2000_MODULE_FIRMWARE(api) IWL2000_FW_PRE __stringify(api) ".ucode"
62 #define IWL105_FW_PRE "iwlwifi-105-"
63 #define IWL105_MODULE_FIRMWARE(api) IWL105_FW_PRE __stringify(api) ".ucode"
65 #define IWL135_FW_PRE "iwlwifi-135-"
66 #define IWL135_MODULE_FIRMWARE(api) IWL135_FW_PRE __stringify(api) ".ucode"
68 static const struct iwl_base_params iwl2000_base_params = {
69 .eeprom_size = OTP_LOW_IMAGE_SIZE,
70 .num_of_queues = IWLAGN_NUM_QUEUES,
71 .pll_cfg_val = 0,
72 .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
73 .shadow_ram_support = true,
74 .led_compensation = 51,
75 .wd_timeout = IWL_DEF_WD_TIMEOUT,
76 .max_event_log_size = 512,
77 .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
81 static const struct iwl_base_params iwl2030_base_params = {
82 .eeprom_size = OTP_LOW_IMAGE_SIZE,
83 .num_of_queues = IWLAGN_NUM_QUEUES,
84 .pll_cfg_val = 0,
85 .max_ll_items = OTP_MAX_LL_ITEMS_2x00,
86 .shadow_ram_support = true,
87 .led_compensation = 57,
88 .wd_timeout = IWL_LONG_WD_TIMEOUT,
89 .max_event_log_size = 512,
90 .shadow_reg_enable = false, /* TODO: fix bugs using this feature */
93 static const struct iwl_ht_params iwl2000_ht_params = {
94 .ht_greenfield_support = true,
95 .use_rts_for_aggregation = true, /* use rts/cts protection */
96 .ht40_bands = BIT(IEEE80211_BAND_2GHZ),
99 static const struct iwl_eeprom_params iwl20x0_eeprom_params = {
100 .regulatory_bands = {
101 EEPROM_REG_BAND_1_CHANNELS,
102 EEPROM_REG_BAND_2_CHANNELS,
103 EEPROM_REG_BAND_3_CHANNELS,
104 EEPROM_REG_BAND_4_CHANNELS,
105 EEPROM_REG_BAND_5_CHANNELS,
106 EEPROM_6000_REG_BAND_24_HT40_CHANNELS,
107 EEPROM_REGULATORY_BAND_NO_HT40,
109 .enhanced_txpower = true,
112 #define IWL_DEVICE_2000 \
113 .fw_name_pre = IWL2000_FW_PRE, \
114 .ucode_api_max = IWL2000_UCODE_API_MAX, \
115 .ucode_api_ok = IWL2000_UCODE_API_OK, \
116 .ucode_api_min = IWL2000_UCODE_API_MIN, \
117 .device_family = IWL_DEVICE_FAMILY_2000, \
118 .max_inst_size = IWL60_RTC_INST_SIZE, \
119 .max_data_size = IWL60_RTC_DATA_SIZE, \
120 .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
121 .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
122 .base_params = &iwl2000_base_params, \
123 .eeprom_params = &iwl20x0_eeprom_params, \
124 .led_mode = IWL_LED_RF_STATE
126 const struct iwl_cfg iwl2000_2bgn_cfg = {
127 .name = "Intel(R) Centrino(R) Wireless-N 2200 BGN",
128 IWL_DEVICE_2000,
129 .ht_params = &iwl2000_ht_params,
132 const struct iwl_cfg iwl2000_2bgn_d_cfg = {
133 .name = "Intel(R) Centrino(R) Wireless-N 2200D BGN",
134 IWL_DEVICE_2000,
135 .ht_params = &iwl2000_ht_params,
138 #define IWL_DEVICE_2030 \
139 .fw_name_pre = IWL2030_FW_PRE, \
140 .ucode_api_max = IWL2030_UCODE_API_MAX, \
141 .ucode_api_ok = IWL2030_UCODE_API_OK, \
142 .ucode_api_min = IWL2030_UCODE_API_MIN, \
143 .device_family = IWL_DEVICE_FAMILY_2030, \
144 .max_inst_size = IWL60_RTC_INST_SIZE, \
145 .max_data_size = IWL60_RTC_DATA_SIZE, \
146 .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
147 .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
148 .base_params = &iwl2030_base_params, \
149 .eeprom_params = &iwl20x0_eeprom_params, \
150 .led_mode = IWL_LED_RF_STATE
152 const struct iwl_cfg iwl2030_2bgn_cfg = {
153 .name = "Intel(R) Centrino(R) Wireless-N 2230 BGN",
154 IWL_DEVICE_2030,
155 .ht_params = &iwl2000_ht_params,
158 #define IWL_DEVICE_105 \
159 .fw_name_pre = IWL105_FW_PRE, \
160 .ucode_api_max = IWL105_UCODE_API_MAX, \
161 .ucode_api_ok = IWL105_UCODE_API_OK, \
162 .ucode_api_min = IWL105_UCODE_API_MIN, \
163 .device_family = IWL_DEVICE_FAMILY_105, \
164 .max_inst_size = IWL60_RTC_INST_SIZE, \
165 .max_data_size = IWL60_RTC_DATA_SIZE, \
166 .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
167 .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
168 .base_params = &iwl2000_base_params, \
169 .eeprom_params = &iwl20x0_eeprom_params, \
170 .led_mode = IWL_LED_RF_STATE, \
171 .rx_with_siso_diversity = true
173 const struct iwl_cfg iwl105_bgn_cfg = {
174 .name = "Intel(R) Centrino(R) Wireless-N 105 BGN",
175 IWL_DEVICE_105,
176 .ht_params = &iwl2000_ht_params,
179 const struct iwl_cfg iwl105_bgn_d_cfg = {
180 .name = "Intel(R) Centrino(R) Wireless-N 105D BGN",
181 IWL_DEVICE_105,
182 .ht_params = &iwl2000_ht_params,
185 #define IWL_DEVICE_135 \
186 .fw_name_pre = IWL135_FW_PRE, \
187 .ucode_api_max = IWL135_UCODE_API_MAX, \
188 .ucode_api_ok = IWL135_UCODE_API_OK, \
189 .ucode_api_min = IWL135_UCODE_API_MIN, \
190 .device_family = IWL_DEVICE_FAMILY_135, \
191 .max_inst_size = IWL60_RTC_INST_SIZE, \
192 .max_data_size = IWL60_RTC_DATA_SIZE, \
193 .nvm_ver = EEPROM_2000_EEPROM_VERSION, \
194 .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \
195 .base_params = &iwl2030_base_params, \
196 .eeprom_params = &iwl20x0_eeprom_params, \
197 .led_mode = IWL_LED_RF_STATE, \
198 .rx_with_siso_diversity = true
200 const struct iwl_cfg iwl135_bgn_cfg = {
201 .name = "Intel(R) Centrino(R) Wireless-N 135 BGN",
202 IWL_DEVICE_135,
203 .ht_params = &iwl2000_ht_params,
206 MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_OK));
207 MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_OK));
208 MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_OK));
209 MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_OK));