1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63#ifndef __IWL_CONFIG_H__
64#define __IWL_CONFIG_H__
65
66#include <linux/types.h>
67#include <net/mac80211.h>
68
69
70enum iwl_device_family {
71 IWL_DEVICE_FAMILY_UNDEFINED,
72 IWL_DEVICE_FAMILY_1000,
73 IWL_DEVICE_FAMILY_100,
74 IWL_DEVICE_FAMILY_2000,
75 IWL_DEVICE_FAMILY_2030,
76 IWL_DEVICE_FAMILY_105,
77 IWL_DEVICE_FAMILY_135,
78 IWL_DEVICE_FAMILY_5000,
79 IWL_DEVICE_FAMILY_5150,
80 IWL_DEVICE_FAMILY_6000,
81 IWL_DEVICE_FAMILY_6000i,
82 IWL_DEVICE_FAMILY_6005,
83 IWL_DEVICE_FAMILY_6030,
84 IWL_DEVICE_FAMILY_6050,
85 IWL_DEVICE_FAMILY_6150,
86 IWL_DEVICE_FAMILY_7000,
87 IWL_DEVICE_FAMILY_8000,
88};
89
90static inline bool iwl_has_secure_boot(u32 hw_rev,
91 enum iwl_device_family family)
92{
93
94 if ((family == IWL_DEVICE_FAMILY_8000) && (hw_rev & 0xC))
95 return 1;
96
97 return 0;
98}
99
100
101
102
103
104
105
106
107
108
109enum iwl_led_mode {
110 IWL_LED_DEFAULT,
111 IWL_LED_RF_STATE,
112 IWL_LED_BLINK,
113 IWL_LED_DISABLE,
114};
115
116
117
118
119
120#define IWL_MAX_PLCP_ERR_THRESHOLD_MIN 1
121#define IWL_MAX_PLCP_ERR_THRESHOLD_DEF 50
122#define IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF 100
123#define IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF 200
124#define IWL_MAX_PLCP_ERR_THRESHOLD_MAX 255
125#define IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE 0
126
127
128#define IWL_WATCHDOG_DISABLED 0
129#define IWL_DEF_WD_TIMEOUT 2500
130#define IWL_LONG_WD_TIMEOUT 10000
131#define IWL_MAX_WD_TIMEOUT 120000
132
133#define IWL_DEFAULT_MAX_TX_POWER 22
134
135
136#define ANT_NONE 0x0
137#define ANT_A BIT(0)
138#define ANT_B BIT(1)
139#define ANT_C BIT(2)
140#define ANT_AB (ANT_A | ANT_B)
141#define ANT_AC (ANT_A | ANT_C)
142#define ANT_BC (ANT_B | ANT_C)
143#define ANT_ABC (ANT_A | ANT_B | ANT_C)
144
145static inline u8 num_of_ant(u8 mask)
146{
147 return !!((mask) & ANT_A) +
148 !!((mask) & ANT_B) +
149 !!((mask) & ANT_C);
150}
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165struct iwl_base_params {
166 int eeprom_size;
167 int num_of_queues;
168
169 u32 pll_cfg_val;
170
171 const u16 max_ll_items;
172 const bool shadow_ram_support;
173 u16 led_compensation;
174 unsigned int wd_timeout;
175 u32 max_event_log_size;
176 const bool shadow_reg_enable;
177 const bool pcie_l1_allowed;
178 const bool apmg_wake_up_wa;
179 const bool scd_chain_ext_wa;
180};
181
182
183
184
185
186
187
188struct iwl_ht_params {
189 enum ieee80211_smps_mode smps_mode;
190 const bool ht_greenfield_support;
191 const bool stbc;
192 const bool ldpc;
193 bool use_rts_for_aggregation;
194 u8 ht40_bands;
195};
196
197
198
199
200#define EEPROM_REG_BAND_1_CHANNELS 0x08
201#define EEPROM_REG_BAND_2_CHANNELS 0x26
202#define EEPROM_REG_BAND_3_CHANNELS 0x42
203#define EEPROM_REG_BAND_4_CHANNELS 0x5C
204#define EEPROM_REG_BAND_5_CHANNELS 0x74
205#define EEPROM_REG_BAND_24_HT40_CHANNELS 0x82
206#define EEPROM_REG_BAND_52_HT40_CHANNELS 0x92
207#define EEPROM_6000_REG_BAND_24_HT40_CHANNELS 0x80
208#define EEPROM_REGULATORY_BAND_NO_HT40 0
209
210
211#define OTP_LOW_IMAGE_SIZE (2 * 512 * sizeof(u16))
212#define OTP_LOW_IMAGE_SIZE_FAMILY_7000 (16 * 512 * sizeof(u16))
213#define OTP_LOW_IMAGE_SIZE_FAMILY_8000 (32 * 512 * sizeof(u16))
214
215struct iwl_eeprom_params {
216 const u8 regulatory_bands[7];
217 bool enhanced_txpower;
218};
219
220
221
222
223
224struct iwl_pwr_tx_backoff {
225 u32 pwr;
226 u32 backoff;
227};
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275struct iwl_cfg {
276
277 const char *name;
278 const char *fw_name_pre;
279 const unsigned int ucode_api_max;
280 const unsigned int ucode_api_ok;
281 const unsigned int ucode_api_min;
282 const enum iwl_device_family device_family;
283 const u32 max_data_size;
284 const u32 max_inst_size;
285 u8 valid_tx_ant;
286 u8 valid_rx_ant;
287 u8 non_shared_ant;
288 bool bt_shared_single_ant;
289 u16 nvm_ver;
290 u16 nvm_calib_ver;
291
292 const struct iwl_base_params *base_params;
293
294 const struct iwl_ht_params *ht_params;
295 const struct iwl_eeprom_params *eeprom_params;
296 enum iwl_led_mode led_mode;
297 const bool rx_with_siso_diversity;
298 const bool internal_wimax_coex;
299 const bool host_interrupt_operation_mode;
300 bool high_temp;
301 bool d0i3;
302 u8 nvm_hw_section_num;
303 bool lp_xtal_workaround;
304 const struct iwl_pwr_tx_backoff *pwr_tx_backoffs;
305 bool no_power_up_nic_in_init;
306 const char *default_nvm_file;
307 const char *default_nvm_file_8000A;
308 unsigned int max_rx_agg_size;
309 bool disable_dummy_notification;
310 unsigned int max_tx_agg_size;
311 unsigned int max_ht_ampdu_exponent;
312 unsigned int max_vht_ampdu_exponent;
313 const u32 dccm_offset;
314 const u32 dccm_len;
315 const u32 dccm2_offset;
316 const u32 dccm2_len;
317 const u32 smem_offset;
318 const u32 smem_len;
319};
320
321
322
323
324#if IS_ENABLED(CONFIG_IWLDVM)
325extern const struct iwl_cfg iwl5300_agn_cfg;
326extern const struct iwl_cfg iwl5100_agn_cfg;
327extern const struct iwl_cfg iwl5350_agn_cfg;
328extern const struct iwl_cfg iwl5100_bgn_cfg;
329extern const struct iwl_cfg iwl5100_abg_cfg;
330extern const struct iwl_cfg iwl5150_agn_cfg;
331extern const struct iwl_cfg iwl5150_abg_cfg;
332extern const struct iwl_cfg iwl6005_2agn_cfg;
333extern const struct iwl_cfg iwl6005_2abg_cfg;
334extern const struct iwl_cfg iwl6005_2bg_cfg;
335extern const struct iwl_cfg iwl6005_2agn_sff_cfg;
336extern const struct iwl_cfg iwl6005_2agn_d_cfg;
337extern const struct iwl_cfg iwl6005_2agn_mow1_cfg;
338extern const struct iwl_cfg iwl6005_2agn_mow2_cfg;
339extern const struct iwl_cfg iwl1030_bgn_cfg;
340extern const struct iwl_cfg iwl1030_bg_cfg;
341extern const struct iwl_cfg iwl6030_2agn_cfg;
342extern const struct iwl_cfg iwl6030_2abg_cfg;
343extern const struct iwl_cfg iwl6030_2bgn_cfg;
344extern const struct iwl_cfg iwl6030_2bg_cfg;
345extern const struct iwl_cfg iwl6000i_2agn_cfg;
346extern const struct iwl_cfg iwl6000i_2abg_cfg;
347extern const struct iwl_cfg iwl6000i_2bg_cfg;
348extern const struct iwl_cfg iwl6000_3agn_cfg;
349extern const struct iwl_cfg iwl6050_2agn_cfg;
350extern const struct iwl_cfg iwl6050_2abg_cfg;
351extern const struct iwl_cfg iwl6150_bgn_cfg;
352extern const struct iwl_cfg iwl6150_bg_cfg;
353extern const struct iwl_cfg iwl1000_bgn_cfg;
354extern const struct iwl_cfg iwl1000_bg_cfg;
355extern const struct iwl_cfg iwl100_bgn_cfg;
356extern const struct iwl_cfg iwl100_bg_cfg;
357extern const struct iwl_cfg iwl130_bgn_cfg;
358extern const struct iwl_cfg iwl130_bg_cfg;
359extern const struct iwl_cfg iwl2000_2bgn_cfg;
360extern const struct iwl_cfg iwl2000_2bgn_d_cfg;
361extern const struct iwl_cfg iwl2030_2bgn_cfg;
362extern const struct iwl_cfg iwl6035_2agn_cfg;
363extern const struct iwl_cfg iwl6035_2agn_sff_cfg;
364extern const struct iwl_cfg iwl105_bgn_cfg;
365extern const struct iwl_cfg iwl105_bgn_d_cfg;
366extern const struct iwl_cfg iwl135_bgn_cfg;
367#endif
368#if IS_ENABLED(CONFIG_IWLMVM)
369extern const struct iwl_cfg iwl7260_2ac_cfg;
370extern const struct iwl_cfg iwl7260_2ac_cfg_high_temp;
371extern const struct iwl_cfg iwl7260_2n_cfg;
372extern const struct iwl_cfg iwl7260_n_cfg;
373extern const struct iwl_cfg iwl3160_2ac_cfg;
374extern const struct iwl_cfg iwl3160_2n_cfg;
375extern const struct iwl_cfg iwl3160_n_cfg;
376extern const struct iwl_cfg iwl3165_2ac_cfg;
377extern const struct iwl_cfg iwl7265_2ac_cfg;
378extern const struct iwl_cfg iwl7265_2n_cfg;
379extern const struct iwl_cfg iwl7265_n_cfg;
380extern const struct iwl_cfg iwl7265d_2ac_cfg;
381extern const struct iwl_cfg iwl7265d_2n_cfg;
382extern const struct iwl_cfg iwl7265d_n_cfg;
383extern const struct iwl_cfg iwl8260_2n_cfg;
384extern const struct iwl_cfg iwl8260_2ac_cfg;
385extern const struct iwl_cfg iwl4165_2ac_cfg;
386extern const struct iwl_cfg iwl8260_2ac_sdio_cfg;
387extern const struct iwl_cfg iwl4165_2ac_sdio_cfg;
388#endif
389
390#endif
391