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
64
65
66
67#ifndef __IWL_CONFIG_H__
68#define __IWL_CONFIG_H__
69
70#include <linux/types.h>
71#include <linux/netdevice.h>
72#include <linux/ieee80211.h>
73#include <linux/nl80211.h>
74#include "iwl-csr.h"
75
76enum iwl_device_family {
77 IWL_DEVICE_FAMILY_UNDEFINED,
78 IWL_DEVICE_FAMILY_1000,
79 IWL_DEVICE_FAMILY_100,
80 IWL_DEVICE_FAMILY_2000,
81 IWL_DEVICE_FAMILY_2030,
82 IWL_DEVICE_FAMILY_105,
83 IWL_DEVICE_FAMILY_135,
84 IWL_DEVICE_FAMILY_5000,
85 IWL_DEVICE_FAMILY_5150,
86 IWL_DEVICE_FAMILY_6000,
87 IWL_DEVICE_FAMILY_6000i,
88 IWL_DEVICE_FAMILY_6005,
89 IWL_DEVICE_FAMILY_6030,
90 IWL_DEVICE_FAMILY_6050,
91 IWL_DEVICE_FAMILY_6150,
92 IWL_DEVICE_FAMILY_7000,
93 IWL_DEVICE_FAMILY_8000,
94 IWL_DEVICE_FAMILY_9000,
95 IWL_DEVICE_FAMILY_22000,
96 IWL_DEVICE_FAMILY_22560,
97};
98
99
100
101
102
103
104
105
106
107
108enum iwl_led_mode {
109 IWL_LED_DEFAULT,
110 IWL_LED_RF_STATE,
111 IWL_LED_BLINK,
112 IWL_LED_DISABLE,
113};
114
115
116
117
118
119
120
121enum iwl_nvm_type {
122 IWL_NVM,
123 IWL_NVM_EXT,
124 IWL_NVM_SDP,
125};
126
127
128
129
130
131#define IWL_MAX_PLCP_ERR_THRESHOLD_MIN 1
132#define IWL_MAX_PLCP_ERR_THRESHOLD_DEF 50
133#define IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF 100
134#define IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF 200
135#define IWL_MAX_PLCP_ERR_THRESHOLD_MAX 255
136#define IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE 0
137
138
139#define IWL_WATCHDOG_DISABLED 0
140#define IWL_DEF_WD_TIMEOUT 2500
141#define IWL_LONG_WD_TIMEOUT 10000
142#define IWL_MAX_WD_TIMEOUT 120000
143
144#define IWL_DEFAULT_MAX_TX_POWER 22
145#define IWL_TX_CSUM_NETIF_FLAGS (NETIF_F_IPV6_CSUM | NETIF_F_IP_CSUM |\
146 NETIF_F_TSO | NETIF_F_TSO6)
147
148
149#define ANT_NONE 0x0
150#define ANT_INVALID 0xff
151#define ANT_A BIT(0)
152#define ANT_B BIT(1)
153#define ANT_C BIT(2)
154#define ANT_AB (ANT_A | ANT_B)
155#define ANT_AC (ANT_A | ANT_C)
156#define ANT_BC (ANT_B | ANT_C)
157#define ANT_ABC (ANT_A | ANT_B | ANT_C)
158#define MAX_ANT_NUM 3
159
160
161static inline u8 num_of_ant(u8 mask)
162{
163 return !!((mask) & ANT_A) +
164 !!((mask) & ANT_B) +
165 !!((mask) & ANT_C);
166}
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182struct iwl_base_params {
183 unsigned int wd_timeout;
184
185 u16 eeprom_size;
186 u16 max_event_log_size;
187
188 u8 pll_cfg:1,
189 shadow_ram_support:1,
190 shadow_reg_enable:1,
191 pcie_l1_allowed:1,
192 apmg_wake_up_wa:1,
193 scd_chain_ext_wa:1;
194
195 u16 num_of_queues;
196 u32 max_tfd_queue_size;
197
198 u8 max_ll_items;
199 u8 led_compensation;
200};
201
202
203
204
205
206
207
208struct iwl_ht_params {
209 u8 ht_greenfield_support:1,
210 stbc:1,
211 ldpc:1,
212 use_rts_for_aggregation:1;
213 u8 ht40_bands;
214};
215
216
217
218
219
220
221struct iwl_tt_tx_backoff {
222 s32 temperature;
223 u32 backoff;
224};
225
226#define TT_TX_BACKOFF_SIZE 6
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244struct iwl_tt_params {
245 u32 ct_kill_entry;
246 u32 ct_kill_exit;
247 u32 ct_kill_duration;
248 u32 dynamic_smps_entry;
249 u32 dynamic_smps_exit;
250 u32 tx_protection_entry;
251 u32 tx_protection_exit;
252 struct iwl_tt_tx_backoff tx_backoff[TT_TX_BACKOFF_SIZE];
253 u8 support_ct_kill:1,
254 support_dynamic_smps:1,
255 support_tx_protection:1,
256 support_tx_backoff:1;
257};
258
259
260
261
262#define EEPROM_REG_BAND_1_CHANNELS 0x08
263#define EEPROM_REG_BAND_2_CHANNELS 0x26
264#define EEPROM_REG_BAND_3_CHANNELS 0x42
265#define EEPROM_REG_BAND_4_CHANNELS 0x5C
266#define EEPROM_REG_BAND_5_CHANNELS 0x74
267#define EEPROM_REG_BAND_24_HT40_CHANNELS 0x82
268#define EEPROM_REG_BAND_52_HT40_CHANNELS 0x92
269#define EEPROM_6000_REG_BAND_24_HT40_CHANNELS 0x80
270#define EEPROM_REGULATORY_BAND_NO_HT40 0
271
272
273#define OTP_LOW_IMAGE_SIZE (2 * 512 * sizeof(u16))
274#define OTP_LOW_IMAGE_SIZE_FAMILY_7000 (16 * 512 * sizeof(u16))
275#define OTP_LOW_IMAGE_SIZE_FAMILY_8000 (32 * 512 * sizeof(u16))
276#define OTP_LOW_IMAGE_SIZE_FAMILY_9000 OTP_LOW_IMAGE_SIZE_FAMILY_8000
277#define OTP_LOW_IMAGE_SIZE_FAMILY_22000 OTP_LOW_IMAGE_SIZE_FAMILY_9000
278
279struct iwl_eeprom_params {
280 const u8 regulatory_bands[7];
281 bool enhanced_txpower;
282};
283
284
285
286
287
288struct iwl_pwr_tx_backoff {
289 u32 pwr;
290 u32 backoff;
291};
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324struct iwl_csr_params {
325 u8 flag_sw_reset;
326 u8 flag_mac_clock_ready;
327 u8 flag_init_done;
328 u8 flag_mac_access_req;
329 u8 flag_val_mac_access_en;
330 u8 flag_master_dis;
331 u8 flag_stop_master;
332 u8 addr_sw_reset;
333 u32 mac_addr0_otp;
334 u32 mac_addr1_otp;
335 u32 mac_addr0_strap;
336 u32 mac_addr1_strap;
337};
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396struct iwl_cfg {
397
398 const char *name;
399 const char *fw_name_pre;
400 const char *fw_name_pre_b_or_c_step;
401 const char *fw_name_pre_rf_next_step;
402
403 const struct iwl_base_params *base_params;
404
405 const struct iwl_ht_params *ht_params;
406 const struct iwl_eeprom_params *eeprom_params;
407 const struct iwl_pwr_tx_backoff *pwr_tx_backoffs;
408 const char *default_nvm_file_C_step;
409 const struct iwl_tt_params *thermal_params;
410 const struct iwl_csr_params *csr;
411 enum iwl_device_family device_family;
412 enum iwl_led_mode led_mode;
413 enum iwl_nvm_type nvm_type;
414 u32 max_data_size;
415 u32 max_inst_size;
416 netdev_features_t features;
417 u32 dccm_offset;
418 u32 dccm_len;
419 u32 dccm2_offset;
420 u32 dccm2_len;
421 u32 smem_offset;
422 u32 smem_len;
423 u32 soc_latency;
424 u16 nvm_ver;
425 u16 nvm_calib_ver;
426 u32 rx_with_siso_diversity:1,
427 bt_shared_single_ant:1,
428 internal_wimax_coex:1,
429 host_interrupt_operation_mode:1,
430 high_temp:1,
431 mac_addr_from_csr:1,
432 lp_xtal_workaround:1,
433 disable_dummy_notification:1,
434 apmg_not_supported:1,
435 mq_rx_supported:1,
436 vht_mu_mimo_supported:1,
437 rf_id:1,
438 integrated:1,
439 use_tfh:1,
440 gen2:1,
441 cdb:1,
442 dbgc_supported:1;
443 u8 valid_tx_ant;
444 u8 valid_rx_ant;
445 u8 non_shared_ant;
446 u8 nvm_hw_section_num;
447 u8 max_rx_agg_size;
448 u8 max_tx_agg_size;
449 u8 max_ht_ampdu_exponent;
450 u8 max_vht_ampdu_exponent;
451 u8 ucode_api_max;
452 u8 ucode_api_min;
453 u32 min_umac_error_event_table;
454 u32 extra_phy_cfg_flags;
455};
456
457static const struct iwl_csr_params iwl_csr_v1 = {
458 .flag_mac_clock_ready = 0,
459 .flag_val_mac_access_en = 0,
460 .flag_init_done = 2,
461 .flag_mac_access_req = 3,
462 .flag_sw_reset = 7,
463 .flag_master_dis = 8,
464 .flag_stop_master = 9,
465 .addr_sw_reset = (CSR_BASE + 0x020),
466 .mac_addr0_otp = 0x380,
467 .mac_addr1_otp = 0x384,
468 .mac_addr0_strap = 0x388,
469 .mac_addr1_strap = 0x38C
470};
471
472static const struct iwl_csr_params iwl_csr_v2 = {
473 .flag_init_done = 6,
474 .flag_mac_clock_ready = 20,
475 .flag_val_mac_access_en = 20,
476 .flag_mac_access_req = 21,
477 .flag_master_dis = 28,
478 .flag_stop_master = 29,
479 .flag_sw_reset = 31,
480 .addr_sw_reset = (CSR_BASE + 0x024),
481 .mac_addr0_otp = 0x30,
482 .mac_addr1_otp = 0x34,
483 .mac_addr0_strap = 0x38,
484 .mac_addr1_strap = 0x3C
485};
486
487
488
489
490#if IS_ENABLED(CONFIG_IWLDVM)
491extern const struct iwl_cfg iwl5300_agn_cfg;
492extern const struct iwl_cfg iwl5100_agn_cfg;
493extern const struct iwl_cfg iwl5350_agn_cfg;
494extern const struct iwl_cfg iwl5100_bgn_cfg;
495extern const struct iwl_cfg iwl5100_abg_cfg;
496extern const struct iwl_cfg iwl5150_agn_cfg;
497extern const struct iwl_cfg iwl5150_abg_cfg;
498extern const struct iwl_cfg iwl6005_2agn_cfg;
499extern const struct iwl_cfg iwl6005_2abg_cfg;
500extern const struct iwl_cfg iwl6005_2bg_cfg;
501extern const struct iwl_cfg iwl6005_2agn_sff_cfg;
502extern const struct iwl_cfg iwl6005_2agn_d_cfg;
503extern const struct iwl_cfg iwl6005_2agn_mow1_cfg;
504extern const struct iwl_cfg iwl6005_2agn_mow2_cfg;
505extern const struct iwl_cfg iwl1030_bgn_cfg;
506extern const struct iwl_cfg iwl1030_bg_cfg;
507extern const struct iwl_cfg iwl6030_2agn_cfg;
508extern const struct iwl_cfg iwl6030_2abg_cfg;
509extern const struct iwl_cfg iwl6030_2bgn_cfg;
510extern const struct iwl_cfg iwl6030_2bg_cfg;
511extern const struct iwl_cfg iwl6000i_2agn_cfg;
512extern const struct iwl_cfg iwl6000i_2abg_cfg;
513extern const struct iwl_cfg iwl6000i_2bg_cfg;
514extern const struct iwl_cfg iwl6000_3agn_cfg;
515extern const struct iwl_cfg iwl6050_2agn_cfg;
516extern const struct iwl_cfg iwl6050_2abg_cfg;
517extern const struct iwl_cfg iwl6150_bgn_cfg;
518extern const struct iwl_cfg iwl6150_bg_cfg;
519extern const struct iwl_cfg iwl1000_bgn_cfg;
520extern const struct iwl_cfg iwl1000_bg_cfg;
521extern const struct iwl_cfg iwl100_bgn_cfg;
522extern const struct iwl_cfg iwl100_bg_cfg;
523extern const struct iwl_cfg iwl130_bgn_cfg;
524extern const struct iwl_cfg iwl130_bg_cfg;
525extern const struct iwl_cfg iwl2000_2bgn_cfg;
526extern const struct iwl_cfg iwl2000_2bgn_d_cfg;
527extern const struct iwl_cfg iwl2030_2bgn_cfg;
528extern const struct iwl_cfg iwl6035_2agn_cfg;
529extern const struct iwl_cfg iwl6035_2agn_sff_cfg;
530extern const struct iwl_cfg iwl105_bgn_cfg;
531extern const struct iwl_cfg iwl105_bgn_d_cfg;
532extern const struct iwl_cfg iwl135_bgn_cfg;
533#endif
534#if IS_ENABLED(CONFIG_IWLMVM)
535extern const struct iwl_cfg iwl7260_2ac_cfg;
536extern const struct iwl_cfg iwl7260_2ac_cfg_high_temp;
537extern const struct iwl_cfg iwl7260_2n_cfg;
538extern const struct iwl_cfg iwl7260_n_cfg;
539extern const struct iwl_cfg iwl3160_2ac_cfg;
540extern const struct iwl_cfg iwl3160_2n_cfg;
541extern const struct iwl_cfg iwl3160_n_cfg;
542extern const struct iwl_cfg iwl3165_2ac_cfg;
543extern const struct iwl_cfg iwl3168_2ac_cfg;
544extern const struct iwl_cfg iwl7265_2ac_cfg;
545extern const struct iwl_cfg iwl7265_2n_cfg;
546extern const struct iwl_cfg iwl7265_n_cfg;
547extern const struct iwl_cfg iwl7265d_2ac_cfg;
548extern const struct iwl_cfg iwl7265d_2n_cfg;
549extern const struct iwl_cfg iwl7265d_n_cfg;
550extern const struct iwl_cfg iwl8260_2n_cfg;
551extern const struct iwl_cfg iwl8260_2ac_cfg;
552extern const struct iwl_cfg iwl8265_2ac_cfg;
553extern const struct iwl_cfg iwl8275_2ac_cfg;
554extern const struct iwl_cfg iwl4165_2ac_cfg;
555extern const struct iwl_cfg iwl9160_2ac_cfg;
556extern const struct iwl_cfg iwl9260_2ac_cfg;
557extern const struct iwl_cfg iwl9260_killer_2ac_cfg;
558extern const struct iwl_cfg iwl9270_2ac_cfg;
559extern const struct iwl_cfg iwl9460_2ac_cfg;
560extern const struct iwl_cfg iwl9560_2ac_cfg;
561extern const struct iwl_cfg iwl9460_2ac_cfg_soc;
562extern const struct iwl_cfg iwl9461_2ac_cfg_soc;
563extern const struct iwl_cfg iwl9462_2ac_cfg_soc;
564extern const struct iwl_cfg iwl9560_2ac_cfg_soc;
565extern const struct iwl_cfg iwl9560_killer_2ac_cfg_soc;
566extern const struct iwl_cfg iwl9560_killer_s_2ac_cfg_soc;
567extern const struct iwl_cfg iwl9460_2ac_cfg_shared_clk;
568extern const struct iwl_cfg iwl9461_2ac_cfg_shared_clk;
569extern const struct iwl_cfg iwl9462_2ac_cfg_shared_clk;
570extern const struct iwl_cfg iwl9560_2ac_cfg_shared_clk;
571extern const struct iwl_cfg iwl9560_killer_2ac_cfg_shared_clk;
572extern const struct iwl_cfg iwl9560_killer_s_2ac_cfg_shared_clk;
573extern const struct iwl_cfg iwl22000_2ac_cfg_hr;
574extern const struct iwl_cfg iwl22000_2ac_cfg_hr_cdb;
575extern const struct iwl_cfg iwl22000_2ac_cfg_jf;
576extern const struct iwl_cfg iwl22000_2ax_cfg_hr;
577extern const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_a0_f0;
578extern const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_b0;
579extern const struct iwl_cfg iwl22000_2ax_cfg_qnj_jf_b0;
580extern const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_a0;
581extern const struct iwl_cfg iwl22560_2ax_cfg_su_cdb;
582#endif
583
584#endif
585