-
Notifications
You must be signed in to change notification settings - Fork 164
/
core.h
6719 lines (5872 loc) · 161 KB
/
core.h
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
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
324
325
326
327
328
329
330
331
332
333
334
335
336
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
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/* Copyright(c) 2019-2020 Realtek Corporation
*/
#ifndef __RTW89_CORE_H__
#define __RTW89_CORE_H__
#include <linux/average.h>
#include <linux/bitfield.h>
#include <linux/dmi.h>
#include <linux/firmware.h>
#include <linux/iopoll.h>
#include <linux/workqueue.h>
#include <net/mac80211.h>
#include <linux/version.h>
struct rtw89_dev;
struct rtw89_pci_info;
struct rtw89_mac_gen_def;
struct rtw89_phy_gen_def;
struct rtw89_efuse_block_cfg;
struct rtw89_h2c_rf_tssi;
struct rtw89_fw_txpwr_track_cfg;
struct rtw89_phy_rfk_log_fmt;
extern const struct ieee80211_ops rtw89_ops;
#define MASKBYTE0 0xff
#define MASKBYTE1 0xff00
#define MASKBYTE2 0xff0000
#define MASKBYTE3 0xff000000
#define MASKBYTE4 0xff00000000ULL
#define MASKHWORD 0xffff0000
#define MASKLWORD 0x0000ffff
#define MASKDWORD 0xffffffff
#define RFREG_MASK 0xfffff
#define INV_RF_DATA 0xffffffff
#define BYPASS_CR_DATA 0xbabecafe
#ifndef RHEL_RELEASE_CODE
#define RHEL_RELEASE_VERSION(a,b) (((a) << 8) + (b))
#define RHEL_RELEASE_CODE 0
#endif
#define RTW89_TRACK_WORK_PERIOD round_jiffies_relative(HZ * 2)
#define RTW89_FORBID_BA_TIMER round_jiffies_relative(HZ * 4)
#define CFO_TRACK_MAX_USER 64
#define MAX_RSSI 110
#define RSSI_FACTOR 1
#define RTW89_RSSI_RAW_TO_DBM(rssi) ((s8)((rssi) >> RSSI_FACTOR) - MAX_RSSI)
#define RTW89_TX_DIV_RSSI_RAW_TH (2 << RSSI_FACTOR)
#define DELTA_SWINGIDX_SIZE 30
#define RTW89_RADIOTAP_ROOM_HE sizeof(struct ieee80211_radiotap_he)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)
#define RTW89_RADIOTAP_ROOM_EHT \
(sizeof(struct ieee80211_radiotap_tlv) + \
ALIGN(struct_size((struct ieee80211_radiotap_eht *)0, user_info, 1), 4) + \
sizeof(struct ieee80211_radiotap_tlv) + \
ALIGN(sizeof(struct ieee80211_radiotap_eht_usig), 4))
#define RTW89_RADIOTAP_ROOM \
ALIGN(max(RTW89_RADIOTAP_ROOM_HE, RTW89_RADIOTAP_ROOM_EHT), 64)
#else
#define RTW89_RADIOTAP_ROOM ALIGN(sizeof(struct ieee80211_radiotap_he), 64)
#endif
#define RTW89_HTC_MASK_VARIANT GENMASK(1, 0)
#define RTW89_HTC_VARIANT_HE 3
#define RTW89_HTC_MASK_CTL_ID GENMASK(5, 2)
#define RTW89_HTC_VARIANT_HE_CID_OM 1
#define RTW89_HTC_VARIANT_HE_CID_CAS 6
#define RTW89_HTC_MASK_CTL_INFO GENMASK(31, 6)
#define RTW89_HTC_MASK_HTC_OM_RX_NSS GENMASK(8, 6)
enum htc_om_channel_width {
HTC_OM_CHANNEL_WIDTH_20 = 0,
HTC_OM_CHANNEL_WIDTH_40 = 1,
HTC_OM_CHANNEL_WIDTH_80 = 2,
HTC_OM_CHANNEL_WIDTH_160_OR_80_80 = 3,
};
#define RTW89_HTC_MASK_HTC_OM_CH_WIDTH GENMASK(10, 9)
#define RTW89_HTC_MASK_HTC_OM_UL_MU_DIS BIT(11)
#define RTW89_HTC_MASK_HTC_OM_TX_NSTS GENMASK(14, 12)
#define RTW89_HTC_MASK_HTC_OM_ER_SU_DIS BIT(15)
#define RTW89_HTC_MASK_HTC_OM_DL_MU_MIMO_RR BIT(16)
#define RTW89_HTC_MASK_HTC_OM_UL_MU_DATA_DIS BIT(17)
#define RTW89_TF_PAD GENMASK(11, 0)
#define RTW89_TF_BASIC_USER_INFO_SZ 6
#define RTW89_GET_TF_USER_INFO_AID12(data) \
le32_get_bits(*((const __le32 *)(data)), GENMASK(11, 0))
#define RTW89_GET_TF_USER_INFO_RUA(data) \
le32_get_bits(*((const __le32 *)(data)), GENMASK(19, 12))
#define RTW89_GET_TF_USER_INFO_UL_MCS(data) \
le32_get_bits(*((const __le32 *)(data)), GENMASK(24, 21))
enum rtw89_subband {
RTW89_CH_2G = 0,
RTW89_CH_5G_BAND_1 = 1,
/* RTW89_CH_5G_BAND_2 = 2, unused */
RTW89_CH_5G_BAND_3 = 3,
RTW89_CH_5G_BAND_4 = 4,
RTW89_CH_6G_BAND_IDX0, /* Low */
RTW89_CH_6G_BAND_IDX1, /* Low */
RTW89_CH_6G_BAND_IDX2, /* Mid */
RTW89_CH_6G_BAND_IDX3, /* Mid */
RTW89_CH_6G_BAND_IDX4, /* High */
RTW89_CH_6G_BAND_IDX5, /* High */
RTW89_CH_6G_BAND_IDX6, /* Ultra-high */
RTW89_CH_6G_BAND_IDX7, /* Ultra-high */
RTW89_SUBBAND_NR,
RTW89_SUBBAND_2GHZ_5GHZ_NR = RTW89_CH_5G_BAND_4 + 1,
};
enum rtw89_gain_offset {
RTW89_GAIN_OFFSET_2G_CCK,
RTW89_GAIN_OFFSET_2G_OFDM,
RTW89_GAIN_OFFSET_5G_LOW,
RTW89_GAIN_OFFSET_5G_MID,
RTW89_GAIN_OFFSET_5G_HIGH,
RTW89_GAIN_OFFSET_6G_L0,
RTW89_GAIN_OFFSET_6G_L1,
RTW89_GAIN_OFFSET_6G_M0,
RTW89_GAIN_OFFSET_6G_M1,
RTW89_GAIN_OFFSET_6G_H0,
RTW89_GAIN_OFFSET_6G_H1,
RTW89_GAIN_OFFSET_6G_UH0,
RTW89_GAIN_OFFSET_6G_UH1,
RTW89_GAIN_OFFSET_NR,
};
enum rtw89_hci_type {
RTW89_HCI_TYPE_PCIE,
RTW89_HCI_TYPE_USB,
RTW89_HCI_TYPE_SDIO,
};
enum rtw89_core_chip_id {
RTL8852A,
RTL8852B,
RTL8852C,
RTL8851B,
RTL8922A,
};
enum rtw89_chip_gen {
RTW89_CHIP_AX,
RTW89_CHIP_BE,
RTW89_CHIP_GEN_NUM,
};
enum rtw89_cv {
CHIP_CAV,
CHIP_CBV,
CHIP_CCV,
CHIP_CDV,
CHIP_CEV,
CHIP_CFV,
CHIP_CV_MAX,
CHIP_CV_INVALID = CHIP_CV_MAX,
};
enum rtw89_bacam_ver {
RTW89_BACAM_V0,
RTW89_BACAM_V1,
RTW89_BACAM_V0_EXT = 99,
};
enum rtw89_core_tx_type {
RTW89_CORE_TX_TYPE_DATA,
RTW89_CORE_TX_TYPE_MGMT,
RTW89_CORE_TX_TYPE_FWCMD,
};
enum rtw89_core_rx_type {
RTW89_CORE_RX_TYPE_WIFI = 0,
RTW89_CORE_RX_TYPE_PPDU_STAT = 1,
RTW89_CORE_RX_TYPE_CHAN_INFO = 2,
RTW89_CORE_RX_TYPE_BB_SCOPE = 3,
RTW89_CORE_RX_TYPE_F2P_TXCMD = 4,
RTW89_CORE_RX_TYPE_SS2FW = 5,
RTW89_CORE_RX_TYPE_TX_REPORT = 6,
RTW89_CORE_RX_TYPE_TX_REL_HOST = 7,
RTW89_CORE_RX_TYPE_DFS_REPORT = 8,
RTW89_CORE_RX_TYPE_TX_REL_CPU = 9,
RTW89_CORE_RX_TYPE_C2H = 10,
RTW89_CORE_RX_TYPE_CSI = 11,
RTW89_CORE_RX_TYPE_CQI = 12,
RTW89_CORE_RX_TYPE_H2C = 13,
RTW89_CORE_RX_TYPE_FWDL = 14,
};
enum rtw89_txq_flags {
RTW89_TXQ_F_AMPDU = 0,
RTW89_TXQ_F_BLOCK_BA = 1,
RTW89_TXQ_F_FORBID_BA = 2,
};
enum rtw89_net_type {
RTW89_NET_TYPE_NO_LINK = 0,
RTW89_NET_TYPE_AD_HOC = 1,
RTW89_NET_TYPE_INFRA = 2,
RTW89_NET_TYPE_AP_MODE = 3,
};
enum rtw89_wifi_role {
RTW89_WIFI_ROLE_NONE,
RTW89_WIFI_ROLE_STATION,
RTW89_WIFI_ROLE_AP,
RTW89_WIFI_ROLE_AP_VLAN,
RTW89_WIFI_ROLE_ADHOC,
RTW89_WIFI_ROLE_ADHOC_MASTER,
RTW89_WIFI_ROLE_MESH_POINT,
RTW89_WIFI_ROLE_MONITOR,
RTW89_WIFI_ROLE_P2P_DEVICE,
RTW89_WIFI_ROLE_P2P_CLIENT,
RTW89_WIFI_ROLE_P2P_GO,
RTW89_WIFI_ROLE_NAN,
RTW89_WIFI_ROLE_MLME_MAX
};
enum rtw89_upd_mode {
RTW89_ROLE_CREATE,
RTW89_ROLE_REMOVE,
RTW89_ROLE_TYPE_CHANGE,
RTW89_ROLE_INFO_CHANGE,
RTW89_ROLE_CON_DISCONN,
RTW89_ROLE_BAND_SW,
RTW89_ROLE_FW_RESTORE,
};
enum rtw89_self_role {
RTW89_SELF_ROLE_CLIENT,
RTW89_SELF_ROLE_AP,
RTW89_SELF_ROLE_AP_CLIENT
};
enum rtw89_msk_sO_el {
RTW89_NO_MSK,
RTW89_SMA,
RTW89_TMA,
RTW89_BSSID
};
enum rtw89_sch_tx_sel {
RTW89_SCH_TX_SEL_ALL,
RTW89_SCH_TX_SEL_HIQ,
RTW89_SCH_TX_SEL_MG0,
RTW89_SCH_TX_SEL_MACID,
};
/* RTW89_ADDR_CAM_SEC_NONE : not enabled
* RTW89_ADDR_CAM_SEC_ALL_UNI : 0 - 6 unicast
* RTW89_ADDR_CAM_SEC_NORMAL : 0 - 1 unicast, 2 - 4 group, 5 - 6 BIP
* RTW89_ADDR_CAM_SEC_4GROUP : 0 - 1 unicast, 2 - 5 group, 6 BIP
*/
enum rtw89_add_cam_sec_mode {
RTW89_ADDR_CAM_SEC_NONE = 0,
RTW89_ADDR_CAM_SEC_ALL_UNI = 1,
RTW89_ADDR_CAM_SEC_NORMAL = 2,
RTW89_ADDR_CAM_SEC_4GROUP = 3,
};
enum rtw89_sec_key_type {
RTW89_SEC_KEY_TYPE_NONE = 0,
RTW89_SEC_KEY_TYPE_WEP40 = 1,
RTW89_SEC_KEY_TYPE_WEP104 = 2,
RTW89_SEC_KEY_TYPE_TKIP = 3,
RTW89_SEC_KEY_TYPE_WAPI = 4,
RTW89_SEC_KEY_TYPE_GCMSMS4 = 5,
RTW89_SEC_KEY_TYPE_CCMP128 = 6,
RTW89_SEC_KEY_TYPE_CCMP256 = 7,
RTW89_SEC_KEY_TYPE_GCMP128 = 8,
RTW89_SEC_KEY_TYPE_GCMP256 = 9,
RTW89_SEC_KEY_TYPE_BIP_CCMP128 = 10,
};
enum rtw89_port {
RTW89_PORT_0 = 0,
RTW89_PORT_1 = 1,
RTW89_PORT_2 = 2,
RTW89_PORT_3 = 3,
RTW89_PORT_4 = 4,
RTW89_PORT_NUM
};
enum rtw89_band {
RTW89_BAND_2G = 0,
RTW89_BAND_5G = 1,
RTW89_BAND_6G = 2,
RTW89_BAND_NUM,
};
enum rtw89_hw_rate {
RTW89_HW_RATE_CCK1 = 0x0,
RTW89_HW_RATE_CCK2 = 0x1,
RTW89_HW_RATE_CCK5_5 = 0x2,
RTW89_HW_RATE_CCK11 = 0x3,
RTW89_HW_RATE_OFDM6 = 0x4,
RTW89_HW_RATE_OFDM9 = 0x5,
RTW89_HW_RATE_OFDM12 = 0x6,
RTW89_HW_RATE_OFDM18 = 0x7,
RTW89_HW_RATE_OFDM24 = 0x8,
RTW89_HW_RATE_OFDM36 = 0x9,
RTW89_HW_RATE_OFDM48 = 0xA,
RTW89_HW_RATE_OFDM54 = 0xB,
RTW89_HW_RATE_MCS0 = 0x80,
RTW89_HW_RATE_MCS1 = 0x81,
RTW89_HW_RATE_MCS2 = 0x82,
RTW89_HW_RATE_MCS3 = 0x83,
RTW89_HW_RATE_MCS4 = 0x84,
RTW89_HW_RATE_MCS5 = 0x85,
RTW89_HW_RATE_MCS6 = 0x86,
RTW89_HW_RATE_MCS7 = 0x87,
RTW89_HW_RATE_MCS8 = 0x88,
RTW89_HW_RATE_MCS9 = 0x89,
RTW89_HW_RATE_MCS10 = 0x8A,
RTW89_HW_RATE_MCS11 = 0x8B,
RTW89_HW_RATE_MCS12 = 0x8C,
RTW89_HW_RATE_MCS13 = 0x8D,
RTW89_HW_RATE_MCS14 = 0x8E,
RTW89_HW_RATE_MCS15 = 0x8F,
RTW89_HW_RATE_MCS16 = 0x90,
RTW89_HW_RATE_MCS17 = 0x91,
RTW89_HW_RATE_MCS18 = 0x92,
RTW89_HW_RATE_MCS19 = 0x93,
RTW89_HW_RATE_MCS20 = 0x94,
RTW89_HW_RATE_MCS21 = 0x95,
RTW89_HW_RATE_MCS22 = 0x96,
RTW89_HW_RATE_MCS23 = 0x97,
RTW89_HW_RATE_MCS24 = 0x98,
RTW89_HW_RATE_MCS25 = 0x99,
RTW89_HW_RATE_MCS26 = 0x9A,
RTW89_HW_RATE_MCS27 = 0x9B,
RTW89_HW_RATE_MCS28 = 0x9C,
RTW89_HW_RATE_MCS29 = 0x9D,
RTW89_HW_RATE_MCS30 = 0x9E,
RTW89_HW_RATE_MCS31 = 0x9F,
RTW89_HW_RATE_VHT_NSS1_MCS0 = 0x100,
RTW89_HW_RATE_VHT_NSS1_MCS1 = 0x101,
RTW89_HW_RATE_VHT_NSS1_MCS2 = 0x102,
RTW89_HW_RATE_VHT_NSS1_MCS3 = 0x103,
RTW89_HW_RATE_VHT_NSS1_MCS4 = 0x104,
RTW89_HW_RATE_VHT_NSS1_MCS5 = 0x105,
RTW89_HW_RATE_VHT_NSS1_MCS6 = 0x106,
RTW89_HW_RATE_VHT_NSS1_MCS7 = 0x107,
RTW89_HW_RATE_VHT_NSS1_MCS8 = 0x108,
RTW89_HW_RATE_VHT_NSS1_MCS9 = 0x109,
RTW89_HW_RATE_VHT_NSS2_MCS0 = 0x110,
RTW89_HW_RATE_VHT_NSS2_MCS1 = 0x111,
RTW89_HW_RATE_VHT_NSS2_MCS2 = 0x112,
RTW89_HW_RATE_VHT_NSS2_MCS3 = 0x113,
RTW89_HW_RATE_VHT_NSS2_MCS4 = 0x114,
RTW89_HW_RATE_VHT_NSS2_MCS5 = 0x115,
RTW89_HW_RATE_VHT_NSS2_MCS6 = 0x116,
RTW89_HW_RATE_VHT_NSS2_MCS7 = 0x117,
RTW89_HW_RATE_VHT_NSS2_MCS8 = 0x118,
RTW89_HW_RATE_VHT_NSS2_MCS9 = 0x119,
RTW89_HW_RATE_VHT_NSS3_MCS0 = 0x120,
RTW89_HW_RATE_VHT_NSS3_MCS1 = 0x121,
RTW89_HW_RATE_VHT_NSS3_MCS2 = 0x122,
RTW89_HW_RATE_VHT_NSS3_MCS3 = 0x123,
RTW89_HW_RATE_VHT_NSS3_MCS4 = 0x124,
RTW89_HW_RATE_VHT_NSS3_MCS5 = 0x125,
RTW89_HW_RATE_VHT_NSS3_MCS6 = 0x126,
RTW89_HW_RATE_VHT_NSS3_MCS7 = 0x127,
RTW89_HW_RATE_VHT_NSS3_MCS8 = 0x128,
RTW89_HW_RATE_VHT_NSS3_MCS9 = 0x129,
RTW89_HW_RATE_VHT_NSS4_MCS0 = 0x130,
RTW89_HW_RATE_VHT_NSS4_MCS1 = 0x131,
RTW89_HW_RATE_VHT_NSS4_MCS2 = 0x132,
RTW89_HW_RATE_VHT_NSS4_MCS3 = 0x133,
RTW89_HW_RATE_VHT_NSS4_MCS4 = 0x134,
RTW89_HW_RATE_VHT_NSS4_MCS5 = 0x135,
RTW89_HW_RATE_VHT_NSS4_MCS6 = 0x136,
RTW89_HW_RATE_VHT_NSS4_MCS7 = 0x137,
RTW89_HW_RATE_VHT_NSS4_MCS8 = 0x138,
RTW89_HW_RATE_VHT_NSS4_MCS9 = 0x139,
RTW89_HW_RATE_HE_NSS1_MCS0 = 0x180,
RTW89_HW_RATE_HE_NSS1_MCS1 = 0x181,
RTW89_HW_RATE_HE_NSS1_MCS2 = 0x182,
RTW89_HW_RATE_HE_NSS1_MCS3 = 0x183,
RTW89_HW_RATE_HE_NSS1_MCS4 = 0x184,
RTW89_HW_RATE_HE_NSS1_MCS5 = 0x185,
RTW89_HW_RATE_HE_NSS1_MCS6 = 0x186,
RTW89_HW_RATE_HE_NSS1_MCS7 = 0x187,
RTW89_HW_RATE_HE_NSS1_MCS8 = 0x188,
RTW89_HW_RATE_HE_NSS1_MCS9 = 0x189,
RTW89_HW_RATE_HE_NSS1_MCS10 = 0x18A,
RTW89_HW_RATE_HE_NSS1_MCS11 = 0x18B,
RTW89_HW_RATE_HE_NSS2_MCS0 = 0x190,
RTW89_HW_RATE_HE_NSS2_MCS1 = 0x191,
RTW89_HW_RATE_HE_NSS2_MCS2 = 0x192,
RTW89_HW_RATE_HE_NSS2_MCS3 = 0x193,
RTW89_HW_RATE_HE_NSS2_MCS4 = 0x194,
RTW89_HW_RATE_HE_NSS2_MCS5 = 0x195,
RTW89_HW_RATE_HE_NSS2_MCS6 = 0x196,
RTW89_HW_RATE_HE_NSS2_MCS7 = 0x197,
RTW89_HW_RATE_HE_NSS2_MCS8 = 0x198,
RTW89_HW_RATE_HE_NSS2_MCS9 = 0x199,
RTW89_HW_RATE_HE_NSS2_MCS10 = 0x19A,
RTW89_HW_RATE_HE_NSS2_MCS11 = 0x19B,
RTW89_HW_RATE_HE_NSS3_MCS0 = 0x1A0,
RTW89_HW_RATE_HE_NSS3_MCS1 = 0x1A1,
RTW89_HW_RATE_HE_NSS3_MCS2 = 0x1A2,
RTW89_HW_RATE_HE_NSS3_MCS3 = 0x1A3,
RTW89_HW_RATE_HE_NSS3_MCS4 = 0x1A4,
RTW89_HW_RATE_HE_NSS3_MCS5 = 0x1A5,
RTW89_HW_RATE_HE_NSS3_MCS6 = 0x1A6,
RTW89_HW_RATE_HE_NSS3_MCS7 = 0x1A7,
RTW89_HW_RATE_HE_NSS3_MCS8 = 0x1A8,
RTW89_HW_RATE_HE_NSS3_MCS9 = 0x1A9,
RTW89_HW_RATE_HE_NSS3_MCS10 = 0x1AA,
RTW89_HW_RATE_HE_NSS3_MCS11 = 0x1AB,
RTW89_HW_RATE_HE_NSS4_MCS0 = 0x1B0,
RTW89_HW_RATE_HE_NSS4_MCS1 = 0x1B1,
RTW89_HW_RATE_HE_NSS4_MCS2 = 0x1B2,
RTW89_HW_RATE_HE_NSS4_MCS3 = 0x1B3,
RTW89_HW_RATE_HE_NSS4_MCS4 = 0x1B4,
RTW89_HW_RATE_HE_NSS4_MCS5 = 0x1B5,
RTW89_HW_RATE_HE_NSS4_MCS6 = 0x1B6,
RTW89_HW_RATE_HE_NSS4_MCS7 = 0x1B7,
RTW89_HW_RATE_HE_NSS4_MCS8 = 0x1B8,
RTW89_HW_RATE_HE_NSS4_MCS9 = 0x1B9,
RTW89_HW_RATE_HE_NSS4_MCS10 = 0x1BA,
RTW89_HW_RATE_HE_NSS4_MCS11 = 0x1BB,
RTW89_HW_RATE_V1_MCS0 = 0x100,
RTW89_HW_RATE_V1_MCS1 = 0x101,
RTW89_HW_RATE_V1_MCS2 = 0x102,
RTW89_HW_RATE_V1_MCS3 = 0x103,
RTW89_HW_RATE_V1_MCS4 = 0x104,
RTW89_HW_RATE_V1_MCS5 = 0x105,
RTW89_HW_RATE_V1_MCS6 = 0x106,
RTW89_HW_RATE_V1_MCS7 = 0x107,
RTW89_HW_RATE_V1_MCS8 = 0x108,
RTW89_HW_RATE_V1_MCS9 = 0x109,
RTW89_HW_RATE_V1_MCS10 = 0x10A,
RTW89_HW_RATE_V1_MCS11 = 0x10B,
RTW89_HW_RATE_V1_MCS12 = 0x10C,
RTW89_HW_RATE_V1_MCS13 = 0x10D,
RTW89_HW_RATE_V1_MCS14 = 0x10E,
RTW89_HW_RATE_V1_MCS15 = 0x10F,
RTW89_HW_RATE_V1_MCS16 = 0x110,
RTW89_HW_RATE_V1_MCS17 = 0x111,
RTW89_HW_RATE_V1_MCS18 = 0x112,
RTW89_HW_RATE_V1_MCS19 = 0x113,
RTW89_HW_RATE_V1_MCS20 = 0x114,
RTW89_HW_RATE_V1_MCS21 = 0x115,
RTW89_HW_RATE_V1_MCS22 = 0x116,
RTW89_HW_RATE_V1_MCS23 = 0x117,
RTW89_HW_RATE_V1_MCS24 = 0x118,
RTW89_HW_RATE_V1_MCS25 = 0x119,
RTW89_HW_RATE_V1_MCS26 = 0x11A,
RTW89_HW_RATE_V1_MCS27 = 0x11B,
RTW89_HW_RATE_V1_MCS28 = 0x11C,
RTW89_HW_RATE_V1_MCS29 = 0x11D,
RTW89_HW_RATE_V1_MCS30 = 0x11E,
RTW89_HW_RATE_V1_MCS31 = 0x11F,
RTW89_HW_RATE_V1_VHT_NSS1_MCS0 = 0x200,
RTW89_HW_RATE_V1_VHT_NSS1_MCS1 = 0x201,
RTW89_HW_RATE_V1_VHT_NSS1_MCS2 = 0x202,
RTW89_HW_RATE_V1_VHT_NSS1_MCS3 = 0x203,
RTW89_HW_RATE_V1_VHT_NSS1_MCS4 = 0x204,
RTW89_HW_RATE_V1_VHT_NSS1_MCS5 = 0x205,
RTW89_HW_RATE_V1_VHT_NSS1_MCS6 = 0x206,
RTW89_HW_RATE_V1_VHT_NSS1_MCS7 = 0x207,
RTW89_HW_RATE_V1_VHT_NSS1_MCS8 = 0x208,
RTW89_HW_RATE_V1_VHT_NSS1_MCS9 = 0x209,
RTW89_HW_RATE_V1_VHT_NSS1_MCS10 = 0x20A,
RTW89_HW_RATE_V1_VHT_NSS1_MCS11 = 0x20B,
RTW89_HW_RATE_V1_VHT_NSS2_MCS0 = 0x220,
RTW89_HW_RATE_V1_VHT_NSS2_MCS1 = 0x221,
RTW89_HW_RATE_V1_VHT_NSS2_MCS2 = 0x222,
RTW89_HW_RATE_V1_VHT_NSS2_MCS3 = 0x223,
RTW89_HW_RATE_V1_VHT_NSS2_MCS4 = 0x224,
RTW89_HW_RATE_V1_VHT_NSS2_MCS5 = 0x225,
RTW89_HW_RATE_V1_VHT_NSS2_MCS6 = 0x226,
RTW89_HW_RATE_V1_VHT_NSS2_MCS7 = 0x227,
RTW89_HW_RATE_V1_VHT_NSS2_MCS8 = 0x228,
RTW89_HW_RATE_V1_VHT_NSS2_MCS9 = 0x229,
RTW89_HW_RATE_V1_VHT_NSS2_MCS10 = 0x22A,
RTW89_HW_RATE_V1_VHT_NSS2_MCS11 = 0x22B,
RTW89_HW_RATE_V1_VHT_NSS3_MCS0 = 0x240,
RTW89_HW_RATE_V1_VHT_NSS3_MCS1 = 0x241,
RTW89_HW_RATE_V1_VHT_NSS3_MCS2 = 0x242,
RTW89_HW_RATE_V1_VHT_NSS3_MCS3 = 0x243,
RTW89_HW_RATE_V1_VHT_NSS3_MCS4 = 0x244,
RTW89_HW_RATE_V1_VHT_NSS3_MCS5 = 0x245,
RTW89_HW_RATE_V1_VHT_NSS3_MCS6 = 0x246,
RTW89_HW_RATE_V1_VHT_NSS3_MCS7 = 0x247,
RTW89_HW_RATE_V1_VHT_NSS3_MCS8 = 0x248,
RTW89_HW_RATE_V1_VHT_NSS3_MCS9 = 0x249,
RTW89_HW_RATE_V1_VHT_NSS3_MCS10 = 0x24A,
RTW89_HW_RATE_V1_VHT_NSS3_MCS11 = 0x24B,
RTW89_HW_RATE_V1_VHT_NSS4_MCS0 = 0x260,
RTW89_HW_RATE_V1_VHT_NSS4_MCS1 = 0x261,
RTW89_HW_RATE_V1_VHT_NSS4_MCS2 = 0x262,
RTW89_HW_RATE_V1_VHT_NSS4_MCS3 = 0x263,
RTW89_HW_RATE_V1_VHT_NSS4_MCS4 = 0x264,
RTW89_HW_RATE_V1_VHT_NSS4_MCS5 = 0x265,
RTW89_HW_RATE_V1_VHT_NSS4_MCS6 = 0x266,
RTW89_HW_RATE_V1_VHT_NSS4_MCS7 = 0x267,
RTW89_HW_RATE_V1_VHT_NSS4_MCS8 = 0x268,
RTW89_HW_RATE_V1_VHT_NSS4_MCS9 = 0x269,
RTW89_HW_RATE_V1_VHT_NSS4_MCS10 = 0x26A,
RTW89_HW_RATE_V1_VHT_NSS4_MCS11 = 0x26B,
RTW89_HW_RATE_V1_HE_NSS1_MCS0 = 0x300,
RTW89_HW_RATE_V1_HE_NSS1_MCS1 = 0x301,
RTW89_HW_RATE_V1_HE_NSS1_MCS2 = 0x302,
RTW89_HW_RATE_V1_HE_NSS1_MCS3 = 0x303,
RTW89_HW_RATE_V1_HE_NSS1_MCS4 = 0x304,
RTW89_HW_RATE_V1_HE_NSS1_MCS5 = 0x305,
RTW89_HW_RATE_V1_HE_NSS1_MCS6 = 0x306,
RTW89_HW_RATE_V1_HE_NSS1_MCS7 = 0x307,
RTW89_HW_RATE_V1_HE_NSS1_MCS8 = 0x308,
RTW89_HW_RATE_V1_HE_NSS1_MCS9 = 0x309,
RTW89_HW_RATE_V1_HE_NSS1_MCS10 = 0x30A,
RTW89_HW_RATE_V1_HE_NSS1_MCS11 = 0x30B,
RTW89_HW_RATE_V1_HE_NSS2_MCS0 = 0x320,
RTW89_HW_RATE_V1_HE_NSS2_MCS1 = 0x321,
RTW89_HW_RATE_V1_HE_NSS2_MCS2 = 0x322,
RTW89_HW_RATE_V1_HE_NSS2_MCS3 = 0x323,
RTW89_HW_RATE_V1_HE_NSS2_MCS4 = 0x324,
RTW89_HW_RATE_V1_HE_NSS2_MCS5 = 0x325,
RTW89_HW_RATE_V1_HE_NSS2_MCS6 = 0x326,
RTW89_HW_RATE_V1_HE_NSS2_MCS7 = 0x327,
RTW89_HW_RATE_V1_HE_NSS2_MCS8 = 0x328,
RTW89_HW_RATE_V1_HE_NSS2_MCS9 = 0x329,
RTW89_HW_RATE_V1_HE_NSS2_MCS10 = 0x32A,
RTW89_HW_RATE_V1_HE_NSS2_MCS11 = 0x32B,
RTW89_HW_RATE_V1_HE_NSS3_MCS0 = 0x340,
RTW89_HW_RATE_V1_HE_NSS3_MCS1 = 0x341,
RTW89_HW_RATE_V1_HE_NSS3_MCS2 = 0x342,
RTW89_HW_RATE_V1_HE_NSS3_MCS3 = 0x343,
RTW89_HW_RATE_V1_HE_NSS3_MCS4 = 0x344,
RTW89_HW_RATE_V1_HE_NSS3_MCS5 = 0x345,
RTW89_HW_RATE_V1_HE_NSS3_MCS6 = 0x346,
RTW89_HW_RATE_V1_HE_NSS3_MCS7 = 0x347,
RTW89_HW_RATE_V1_HE_NSS3_MCS8 = 0x348,
RTW89_HW_RATE_V1_HE_NSS3_MCS9 = 0x349,
RTW89_HW_RATE_V1_HE_NSS3_MCS10 = 0x34A,
RTW89_HW_RATE_V1_HE_NSS3_MCS11 = 0x34B,
RTW89_HW_RATE_V1_HE_NSS4_MCS0 = 0x360,
RTW89_HW_RATE_V1_HE_NSS4_MCS1 = 0x361,
RTW89_HW_RATE_V1_HE_NSS4_MCS2 = 0x362,
RTW89_HW_RATE_V1_HE_NSS4_MCS3 = 0x363,
RTW89_HW_RATE_V1_HE_NSS4_MCS4 = 0x364,
RTW89_HW_RATE_V1_HE_NSS4_MCS5 = 0x365,
RTW89_HW_RATE_V1_HE_NSS4_MCS6 = 0x366,
RTW89_HW_RATE_V1_HE_NSS4_MCS7 = 0x367,
RTW89_HW_RATE_V1_HE_NSS4_MCS8 = 0x368,
RTW89_HW_RATE_V1_HE_NSS4_MCS9 = 0x369,
RTW89_HW_RATE_V1_HE_NSS4_MCS10 = 0x36A,
RTW89_HW_RATE_V1_HE_NSS4_MCS11 = 0x36B,
RTW89_HW_RATE_V1_EHT_NSS1_MCS0 = 0x400,
RTW89_HW_RATE_V1_EHT_NSS1_MCS1 = 0x401,
RTW89_HW_RATE_V1_EHT_NSS1_MCS2 = 0x402,
RTW89_HW_RATE_V1_EHT_NSS1_MCS3 = 0x403,
RTW89_HW_RATE_V1_EHT_NSS1_MCS4 = 0x404,
RTW89_HW_RATE_V1_EHT_NSS1_MCS5 = 0x405,
RTW89_HW_RATE_V1_EHT_NSS1_MCS6 = 0x406,
RTW89_HW_RATE_V1_EHT_NSS1_MCS7 = 0x407,
RTW89_HW_RATE_V1_EHT_NSS1_MCS8 = 0x408,
RTW89_HW_RATE_V1_EHT_NSS1_MCS9 = 0x409,
RTW89_HW_RATE_V1_EHT_NSS1_MCS10 = 0x40A,
RTW89_HW_RATE_V1_EHT_NSS1_MCS11 = 0x40B,
RTW89_HW_RATE_V1_EHT_NSS1_MCS12 = 0x40C,
RTW89_HW_RATE_V1_EHT_NSS1_MCS13 = 0x40D,
RTW89_HW_RATE_V1_EHT_NSS1_MCS14 = 0x40E,
RTW89_HW_RATE_V1_EHT_NSS1_MCS15 = 0x40F,
RTW89_HW_RATE_V1_EHT_NSS2_MCS0 = 0x420,
RTW89_HW_RATE_V1_EHT_NSS2_MCS1 = 0x421,
RTW89_HW_RATE_V1_EHT_NSS2_MCS2 = 0x422,
RTW89_HW_RATE_V1_EHT_NSS2_MCS3 = 0x423,
RTW89_HW_RATE_V1_EHT_NSS2_MCS4 = 0x424,
RTW89_HW_RATE_V1_EHT_NSS2_MCS5 = 0x425,
RTW89_HW_RATE_V1_EHT_NSS2_MCS6 = 0x426,
RTW89_HW_RATE_V1_EHT_NSS2_MCS7 = 0x427,
RTW89_HW_RATE_V1_EHT_NSS2_MCS8 = 0x428,
RTW89_HW_RATE_V1_EHT_NSS2_MCS9 = 0x429,
RTW89_HW_RATE_V1_EHT_NSS2_MCS10 = 0x42A,
RTW89_HW_RATE_V1_EHT_NSS2_MCS11 = 0x42B,
RTW89_HW_RATE_V1_EHT_NSS2_MCS12 = 0x42C,
RTW89_HW_RATE_V1_EHT_NSS2_MCS13 = 0x42D,
RTW89_HW_RATE_V1_EHT_NSS3_MCS0 = 0x440,
RTW89_HW_RATE_V1_EHT_NSS3_MCS1 = 0x441,
RTW89_HW_RATE_V1_EHT_NSS3_MCS2 = 0x442,
RTW89_HW_RATE_V1_EHT_NSS3_MCS3 = 0x443,
RTW89_HW_RATE_V1_EHT_NSS3_MCS4 = 0x444,
RTW89_HW_RATE_V1_EHT_NSS3_MCS5 = 0x445,
RTW89_HW_RATE_V1_EHT_NSS3_MCS6 = 0x446,
RTW89_HW_RATE_V1_EHT_NSS3_MCS7 = 0x447,
RTW89_HW_RATE_V1_EHT_NSS3_MCS8 = 0x448,
RTW89_HW_RATE_V1_EHT_NSS3_MCS9 = 0x449,
RTW89_HW_RATE_V1_EHT_NSS3_MCS10 = 0x44A,
RTW89_HW_RATE_V1_EHT_NSS3_MCS11 = 0x44B,
RTW89_HW_RATE_V1_EHT_NSS3_MCS12 = 0x44C,
RTW89_HW_RATE_V1_EHT_NSS3_MCS13 = 0x44D,
RTW89_HW_RATE_V1_EHT_NSS4_MCS0 = 0x460,
RTW89_HW_RATE_V1_EHT_NSS4_MCS1 = 0x461,
RTW89_HW_RATE_V1_EHT_NSS4_MCS2 = 0x462,
RTW89_HW_RATE_V1_EHT_NSS4_MCS3 = 0x463,
RTW89_HW_RATE_V1_EHT_NSS4_MCS4 = 0x464,
RTW89_HW_RATE_V1_EHT_NSS4_MCS5 = 0x465,
RTW89_HW_RATE_V1_EHT_NSS4_MCS6 = 0x466,
RTW89_HW_RATE_V1_EHT_NSS4_MCS7 = 0x467,
RTW89_HW_RATE_V1_EHT_NSS4_MCS8 = 0x468,
RTW89_HW_RATE_V1_EHT_NSS4_MCS9 = 0x469,
RTW89_HW_RATE_V1_EHT_NSS4_MCS10 = 0x46A,
RTW89_HW_RATE_V1_EHT_NSS4_MCS11 = 0x46B,
RTW89_HW_RATE_V1_EHT_NSS4_MCS12 = 0x46C,
RTW89_HW_RATE_V1_EHT_NSS4_MCS13 = 0x46D,
RTW89_HW_RATE_NR,
RTW89_HW_RATE_INVAL,
RTW89_HW_RATE_MASK_MOD = GENMASK(8, 7),
RTW89_HW_RATE_MASK_VAL = GENMASK(6, 0),
RTW89_HW_RATE_V1_MASK_MOD = GENMASK(10, 8),
RTW89_HW_RATE_V1_MASK_VAL = GENMASK(7, 0),
};
/* 2G channels,
* 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
*/
#define RTW89_2G_CH_NUM 14
/* 5G channels,
* 36, 38, 40, 42, 44, 46, 48, 50,
* 52, 54, 56, 58, 60, 62, 64,
* 100, 102, 104, 106, 108, 110, 112, 114,
* 116, 118, 120, 122, 124, 126, 128, 130,
* 132, 134, 136, 138, 140, 142, 144,
* 149, 151, 153, 155, 157, 159, 161, 163,
* 165, 167, 169, 171, 173, 175, 177
*/
#define RTW89_5G_CH_NUM 53
/* 6G channels,
* 1, 3, 5, 7, 9, 11, 13, 15,
* 17, 19, 21, 23, 25, 27, 29, 33,
* 35, 37, 39, 41, 43, 45, 47, 49,
* 51, 53, 55, 57, 59, 61, 65, 67,
* 69, 71, 73, 75, 77, 79, 81, 83,
* 85, 87, 89, 91, 93, 97, 99, 101,
* 103, 105, 107, 109, 111, 113, 115, 117,
* 119, 121, 123, 125, 129, 131, 133, 135,
* 137, 139, 141, 143, 145, 147, 149, 151,
* 153, 155, 157, 161, 163, 165, 167, 169,
* 171, 173, 175, 177, 179, 181, 183, 185,
* 187, 189, 193, 195, 197, 199, 201, 203,
* 205, 207, 209, 211, 213, 215, 217, 219,
* 221, 225, 227, 229, 231, 233, 235, 237,
* 239, 241, 243, 245, 247, 249, 251, 253,
*/
#define RTW89_6G_CH_NUM 120
enum rtw89_rate_section {
RTW89_RS_CCK,
RTW89_RS_OFDM,
RTW89_RS_MCS, /* for HT/VHT/HE */
RTW89_RS_HEDCM,
RTW89_RS_OFFSET,
RTW89_RS_NUM,
RTW89_RS_LMT_NUM = RTW89_RS_MCS + 1,
RTW89_RS_TX_SHAPE_NUM = RTW89_RS_OFDM + 1,
};
enum rtw89_rate_offset_indexes {
RTW89_RATE_OFFSET_HE,
RTW89_RATE_OFFSET_VHT,
RTW89_RATE_OFFSET_HT,
RTW89_RATE_OFFSET_OFDM,
RTW89_RATE_OFFSET_CCK,
RTW89_RATE_OFFSET_DLRU_EHT,
RTW89_RATE_OFFSET_DLRU_HE,
RTW89_RATE_OFFSET_EHT,
__RTW89_RATE_OFFSET_NUM,
RTW89_RATE_OFFSET_NUM_AX = RTW89_RATE_OFFSET_CCK + 1,
RTW89_RATE_OFFSET_NUM_BE = RTW89_RATE_OFFSET_EHT + 1,
};
enum rtw89_rate_num {
RTW89_RATE_CCK_NUM = 4,
RTW89_RATE_OFDM_NUM = 8,
RTW89_RATE_HEDCM_NUM = 4, /* for HEDCM MCS0/1/3/4 */
RTW89_RATE_MCS_NUM_AX = 12,
RTW89_RATE_MCS_NUM_BE = 16,
__RTW89_RATE_MCS_NUM = 16,
};
enum rtw89_nss {
RTW89_NSS_1 = 0,
RTW89_NSS_2 = 1,
/* HE DCM only support 1ss and 2ss */
RTW89_NSS_HEDCM_NUM = RTW89_NSS_2 + 1,
RTW89_NSS_3 = 2,
RTW89_NSS_4 = 3,
RTW89_NSS_NUM,
};
enum rtw89_ntx {
RTW89_1TX = 0,
RTW89_2TX = 1,
RTW89_NTX_NUM,
};
enum rtw89_beamforming_type {
RTW89_NONBF = 0,
RTW89_BF = 1,
RTW89_BF_NUM,
};
enum rtw89_ofdma_type {
RTW89_NON_OFDMA = 0,
RTW89_OFDMA = 1,
RTW89_OFDMA_NUM,
};
enum rtw89_regulation_type {
RTW89_WW = 0,
RTW89_ETSI = 1,
RTW89_FCC = 2,
RTW89_MKK = 3,
RTW89_NA = 4,
RTW89_IC = 5,
RTW89_KCC = 6,
RTW89_ACMA = 7,
RTW89_NCC = 8,
RTW89_MEXICO = 9,
RTW89_CHILE = 10,
RTW89_UKRAINE = 11,
RTW89_CN = 12,
RTW89_QATAR = 13,
RTW89_UK = 14,
RTW89_THAILAND = 15,
RTW89_REGD_NUM,
};
enum rtw89_reg_6ghz_power {
RTW89_REG_6GHZ_POWER_VLP = 0,
RTW89_REG_6GHZ_POWER_LPI = 1,
RTW89_REG_6GHZ_POWER_STD = 2,
NUM_OF_RTW89_REG_6GHZ_POWER,
RTW89_REG_6GHZ_POWER_DFLT = RTW89_REG_6GHZ_POWER_VLP,
};
enum rtw89_fw_pkt_ofld_type {
RTW89_PKT_OFLD_TYPE_PROBE_RSP = 0,
RTW89_PKT_OFLD_TYPE_PS_POLL = 1,
RTW89_PKT_OFLD_TYPE_NULL_DATA = 2,
RTW89_PKT_OFLD_TYPE_QOS_NULL = 3,
RTW89_PKT_OFLD_TYPE_CTS2SELF = 4,
RTW89_PKT_OFLD_TYPE_ARP_RSP = 5,
RTW89_PKT_OFLD_TYPE_NDP = 6,
RTW89_PKT_OFLD_TYPE_EAPOL_KEY = 7,
RTW89_PKT_OFLD_TYPE_SA_QUERY = 8,
RTW89_PKT_OFLD_TYPE_PROBE_REQ = 12,
RTW89_PKT_OFLD_TYPE_NUM,
};
struct rtw89_txpwr_byrate {
s8 cck[RTW89_RATE_CCK_NUM];
s8 ofdm[RTW89_RATE_OFDM_NUM];
s8 mcs[RTW89_OFDMA_NUM][RTW89_NSS_NUM][__RTW89_RATE_MCS_NUM];
s8 hedcm[RTW89_OFDMA_NUM][RTW89_NSS_HEDCM_NUM][RTW89_RATE_HEDCM_NUM];
s8 offset[__RTW89_RATE_OFFSET_NUM];
s8 trap;
};
struct rtw89_rate_desc {
enum rtw89_nss nss;
enum rtw89_rate_section rs;
enum rtw89_ofdma_type ofdma;
u8 idx;
};
#define PHY_STS_HDR_LEN 8
#define RF_PATH_MAX 4
#define RTW89_MAX_PPDU_CNT 8
struct rtw89_rx_phy_ppdu {
void *buf;
u32 len;
u8 rssi_avg;
u8 rssi[RF_PATH_MAX];
u8 mac_id;
u8 chan_idx;
u8 ie;
u16 rate;
struct {
bool has;
u8 avg_snr;
u8 evm_max;
u8 evm_min;
} ofdm;
bool to_self;
bool valid;
};
enum rtw89_mac_idx {
RTW89_MAC_0 = 0,
RTW89_MAC_1 = 1,
RTW89_MAC_NUM,
};
enum rtw89_phy_idx {
RTW89_PHY_0 = 0,
RTW89_PHY_1 = 1,
RTW89_PHY_MAX
};
enum rtw89_sub_entity_idx {
RTW89_SUB_ENTITY_0 = 0,
RTW89_SUB_ENTITY_1 = 1,
NUM_OF_RTW89_SUB_ENTITY,
RTW89_SUB_ENTITY_IDLE = NUM_OF_RTW89_SUB_ENTITY,
};
enum rtw89_rf_path {
RF_PATH_A = 0,
RF_PATH_B = 1,
RF_PATH_C = 2,
RF_PATH_D = 3,
RF_PATH_AB,
RF_PATH_AC,
RF_PATH_AD,
RF_PATH_BC,
RF_PATH_BD,
RF_PATH_CD,
RF_PATH_ABC,
RF_PATH_ABD,
RF_PATH_ACD,
RF_PATH_BCD,
RF_PATH_ABCD,
};
enum rtw89_rf_path_bit {
RF_A = BIT(0),
RF_B = BIT(1),
RF_C = BIT(2),
RF_D = BIT(3),
RF_AB = (RF_A | RF_B),
RF_AC = (RF_A | RF_C),
RF_AD = (RF_A | RF_D),
RF_BC = (RF_B | RF_C),
RF_BD = (RF_B | RF_D),
RF_CD = (RF_C | RF_D),
RF_ABC = (RF_A | RF_B | RF_C),
RF_ABD = (RF_A | RF_B | RF_D),
RF_ACD = (RF_A | RF_C | RF_D),
RF_BCD = (RF_B | RF_C | RF_D),
RF_ABCD = (RF_A | RF_B | RF_C | RF_D),
};
enum rtw89_bandwidth {
RTW89_CHANNEL_WIDTH_20 = 0,
RTW89_CHANNEL_WIDTH_40 = 1,
RTW89_CHANNEL_WIDTH_80 = 2,
RTW89_CHANNEL_WIDTH_160 = 3,
RTW89_CHANNEL_WIDTH_320 = 4,
/* keep index order above */
RTW89_CHANNEL_WIDTH_ORDINARY_NUM = 5,
RTW89_CHANNEL_WIDTH_80_80 = 5,
RTW89_CHANNEL_WIDTH_5 = 6,
RTW89_CHANNEL_WIDTH_10 = 7,
};
enum rtw89_ps_mode {
RTW89_PS_MODE_NONE = 0,
RTW89_PS_MODE_RFOFF = 1,
RTW89_PS_MODE_CLK_GATED = 2,
RTW89_PS_MODE_PWR_GATED = 3,
};
#define RTW89_2G_BW_NUM (RTW89_CHANNEL_WIDTH_40 + 1)
#define RTW89_5G_BW_NUM (RTW89_CHANNEL_WIDTH_160 + 1)
#define RTW89_6G_BW_NUM (RTW89_CHANNEL_WIDTH_320 + 1)
#define RTW89_BYR_BW_NUM (RTW89_CHANNEL_WIDTH_320 + 1)
#define RTW89_PPE_BW_NUM (RTW89_CHANNEL_WIDTH_320 + 1)
enum rtw89_ru_bandwidth {
RTW89_RU26 = 0,
RTW89_RU52 = 1,
RTW89_RU106 = 2,
RTW89_RU52_26 = 3,
RTW89_RU106_26 = 4,
RTW89_RU_NUM,
};
enum rtw89_sc_offset {
RTW89_SC_DONT_CARE = 0,
RTW89_SC_20_UPPER = 1,
RTW89_SC_20_LOWER = 2,
RTW89_SC_20_UPMOST = 3,
RTW89_SC_20_LOWEST = 4,
RTW89_SC_20_UP2X = 5,
RTW89_SC_20_LOW2X = 6,
RTW89_SC_20_UP3X = 7,
RTW89_SC_20_LOW3X = 8,
RTW89_SC_40_UPPER = 9,
RTW89_SC_40_LOWER = 10,
};
enum rtw89_wow_flags {
RTW89_WOW_FLAG_EN_MAGIC_PKT,
RTW89_WOW_FLAG_EN_REKEY_PKT,
RTW89_WOW_FLAG_EN_DISCONNECT,
RTW89_WOW_FLAG_NUM,
};
struct rtw89_chan {
u8 channel;
u8 primary_channel;
enum rtw89_band band_type;
enum rtw89_bandwidth band_width;
/* The follow-up are derived from the above. We must ensure that it
* is assigned correctly in rtw89_chan_create() if new one is added.
*/
u32 freq;
enum rtw89_subband subband_type;
enum rtw89_sc_offset pri_ch_idx;
u8 pri_sb_idx;
};
struct rtw89_chan_rcd {
u8 prev_primary_channel;
enum rtw89_band prev_band_type;
bool band_changed;
};
struct rtw89_channel_help_params {
u32 tx_en;
};
struct rtw89_port_reg {
u32 port_cfg;
u32 tbtt_prohib;
u32 bcn_area;
u32 bcn_early;
u32 tbtt_early;
u32 tbtt_agg;
u32 bcn_space;
u32 bcn_forcetx;
u32 bcn_err_cnt;
u32 bcn_err_flag;
u32 dtim_ctrl;
u32 tbtt_shift;
u32 bcn_cnt_tmr;
u32 tsftr_l;
u32 tsftr_h;
u32 md_tsft;
u32 bss_color;
u32 mbssid;
u32 mbssid_drop;
u32 tsf_sync;
u32 ptcl_dbg;
u32 ptcl_dbg_info;
u32 bcn_drop_all;
u32 hiq_win[RTW89_PORT_NUM];
};
struct rtw89_txwd_body {
__le32 dword0;
__le32 dword1;
__le32 dword2;
__le32 dword3;
__le32 dword4;
__le32 dword5;
} __packed;
struct rtw89_txwd_body_v1 {
__le32 dword0;
__le32 dword1;
__le32 dword2;
__le32 dword3;
__le32 dword4;
__le32 dword5;
__le32 dword6;
__le32 dword7;
} __packed;
struct rtw89_txwd_body_v2 {
__le32 dword0;