]> asedeno.scripts.mit.edu Git - linux.git/blob - drivers/net/wireless/intel/iwlwifi/cfg/5000.c
Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
[linux.git] / drivers / net / wireless / intel / iwlwifi / cfg / 5000.c
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved.
4  * Copyright(c) 2018 Intel Corporation
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of version 2 of the GNU General Public License as
8  * published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along with
16  * this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18  *
19  * The full GNU General Public License is included in this distribution in the
20  * file called LICENSE.
21  *
22  * Contact Information:
23  *  Intel Linux Wireless <linuxwifi@intel.com>
24  * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
25  *
26  *****************************************************************************/
27
28 #include <linux/module.h>
29 #include <linux/stringify.h>
30 #include "iwl-config.h"
31 #include "iwl-agn-hw.h"
32
33 /* Highest firmware API version supported */
34 #define IWL5000_UCODE_API_MAX 5
35 #define IWL5150_UCODE_API_MAX 2
36
37 /* Lowest firmware API version supported */
38 #define IWL5000_UCODE_API_MIN 1
39 #define IWL5150_UCODE_API_MIN 1
40
41 /* EEPROM versions */
42 #define EEPROM_5000_TX_POWER_VERSION    (4)
43 #define EEPROM_5000_EEPROM_VERSION      (0x11A)
44 #define EEPROM_5050_TX_POWER_VERSION    (4)
45 #define EEPROM_5050_EEPROM_VERSION      (0x21E)
46
47 #define IWL5000_FW_PRE "iwlwifi-5000-"
48 #define IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE __stringify(api) ".ucode"
49
50 #define IWL5150_FW_PRE "iwlwifi-5150-"
51 #define IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE __stringify(api) ".ucode"
52
53 static const struct iwl_base_params iwl5000_base_params = {
54         .eeprom_size = IWLAGN_EEPROM_IMG_SIZE,
55         .num_of_queues = IWLAGN_NUM_QUEUES,
56         .pll_cfg = true,
57         .led_compensation = 51,
58         .wd_timeout = IWL_WATCHDOG_DISABLED,
59         .max_event_log_size = 512,
60         .scd_chain_ext_wa = true,
61 };
62
63 static const struct iwl_ht_params iwl5000_ht_params = {
64         .ht_greenfield_support = true,
65         .ht40_bands = BIT(NL80211_BAND_2GHZ) | BIT(NL80211_BAND_5GHZ),
66 };
67
68 static const struct iwl_eeprom_params iwl5000_eeprom_params = {
69         .regulatory_bands = {
70                 EEPROM_REG_BAND_1_CHANNELS,
71                 EEPROM_REG_BAND_2_CHANNELS,
72                 EEPROM_REG_BAND_3_CHANNELS,
73                 EEPROM_REG_BAND_4_CHANNELS,
74                 EEPROM_REG_BAND_5_CHANNELS,
75                 EEPROM_REG_BAND_24_HT40_CHANNELS,
76                 EEPROM_REG_BAND_52_HT40_CHANNELS
77         },
78 };
79
80 #define IWL_DEVICE_5000                                         \
81         .fw_name_pre = IWL5000_FW_PRE,                          \
82         .ucode_api_max = IWL5000_UCODE_API_MAX,                 \
83         .ucode_api_min = IWL5000_UCODE_API_MIN,                 \
84         .device_family = IWL_DEVICE_FAMILY_5000,                \
85         .max_inst_size = IWLAGN_RTC_INST_SIZE,                  \
86         .max_data_size = IWLAGN_RTC_DATA_SIZE,                  \
87         .nvm_ver = EEPROM_5000_EEPROM_VERSION,          \
88         .nvm_calib_ver = EEPROM_5000_TX_POWER_VERSION,  \
89         .base_params = &iwl5000_base_params,                    \
90         .eeprom_params = &iwl5000_eeprom_params,                \
91         .led_mode = IWL_LED_BLINK,                              \
92         .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,    \
93         .csr = &iwl_csr_v1
94
95 const struct iwl_cfg iwl5300_agn_cfg = {
96         .name = "Intel(R) Ultimate N WiFi Link 5300 AGN",
97         IWL_DEVICE_5000,
98         /* at least EEPROM 0x11A has wrong info */
99         .valid_tx_ant = ANT_ABC,        /* .cfg overwrite */
100         .valid_rx_ant = ANT_ABC,        /* .cfg overwrite */
101         .ht_params = &iwl5000_ht_params,
102 };
103
104 const struct iwl_cfg iwl5100_bgn_cfg = {
105         .name = "Intel(R) WiFi Link 5100 BGN",
106         IWL_DEVICE_5000,
107         .valid_tx_ant = ANT_B,          /* .cfg overwrite */
108         .valid_rx_ant = ANT_AB,         /* .cfg overwrite */
109         .ht_params = &iwl5000_ht_params,
110 };
111
112 const struct iwl_cfg iwl5100_abg_cfg = {
113         .name = "Intel(R) WiFi Link 5100 ABG",
114         IWL_DEVICE_5000,
115         .valid_tx_ant = ANT_B,          /* .cfg overwrite */
116         .valid_rx_ant = ANT_AB,         /* .cfg overwrite */
117 };
118
119 const struct iwl_cfg iwl5100_agn_cfg = {
120         .name = "Intel(R) WiFi Link 5100 AGN",
121         IWL_DEVICE_5000,
122         .valid_tx_ant = ANT_B,          /* .cfg overwrite */
123         .valid_rx_ant = ANT_AB,         /* .cfg overwrite */
124         .ht_params = &iwl5000_ht_params,
125 };
126
127 const struct iwl_cfg iwl5350_agn_cfg = {
128         .name = "Intel(R) WiMAX/WiFi Link 5350 AGN",
129         .fw_name_pre = IWL5000_FW_PRE,
130         .ucode_api_max = IWL5000_UCODE_API_MAX,
131         .ucode_api_min = IWL5000_UCODE_API_MIN,
132         .device_family = IWL_DEVICE_FAMILY_5000,
133         .max_inst_size = IWLAGN_RTC_INST_SIZE,
134         .max_data_size = IWLAGN_RTC_DATA_SIZE,
135         .nvm_ver = EEPROM_5050_EEPROM_VERSION,
136         .nvm_calib_ver = EEPROM_5050_TX_POWER_VERSION,
137         .base_params = &iwl5000_base_params,
138         .eeprom_params = &iwl5000_eeprom_params,
139         .ht_params = &iwl5000_ht_params,
140         .led_mode = IWL_LED_BLINK,
141         .internal_wimax_coex = true,
142 };
143
144 #define IWL_DEVICE_5150                                         \
145         .fw_name_pre = IWL5150_FW_PRE,                          \
146         .ucode_api_max = IWL5150_UCODE_API_MAX,                 \
147         .ucode_api_min = IWL5150_UCODE_API_MIN,                 \
148         .device_family = IWL_DEVICE_FAMILY_5150,                \
149         .max_inst_size = IWLAGN_RTC_INST_SIZE,                  \
150         .max_data_size = IWLAGN_RTC_DATA_SIZE,                  \
151         .nvm_ver = EEPROM_5050_EEPROM_VERSION,          \
152         .nvm_calib_ver = EEPROM_5050_TX_POWER_VERSION,  \
153         .base_params = &iwl5000_base_params,                    \
154         .eeprom_params = &iwl5000_eeprom_params,                \
155         .led_mode = IWL_LED_BLINK,                              \
156         .internal_wimax_coex = true,                            \
157         .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,    \
158         .csr = &iwl_csr_v1
159
160 const struct iwl_cfg iwl5150_agn_cfg = {
161         .name = "Intel(R) WiMAX/WiFi Link 5150 AGN",
162         IWL_DEVICE_5150,
163         .ht_params = &iwl5000_ht_params,
164
165 };
166
167 const struct iwl_cfg iwl5150_abg_cfg = {
168         .name = "Intel(R) WiMAX/WiFi Link 5150 ABG",
169         IWL_DEVICE_5150,
170 };
171
172 MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX));
173 MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_MAX));