1
2
3
4
5
6
7 #ifndef _RX_DESC_H_
8 #define _RX_DESC_H_
9
10 #include <linux/bitops.h>
11
12 enum rx_attention_flags {
13 RX_ATTENTION_FLAGS_FIRST_MPDU = BIT(0),
14 RX_ATTENTION_FLAGS_LAST_MPDU = BIT(1),
15 RX_ATTENTION_FLAGS_MCAST_BCAST = BIT(2),
16 RX_ATTENTION_FLAGS_PEER_IDX_INVALID = BIT(3),
17 RX_ATTENTION_FLAGS_PEER_IDX_TIMEOUT = BIT(4),
18 RX_ATTENTION_FLAGS_POWER_MGMT = BIT(5),
19 RX_ATTENTION_FLAGS_NON_QOS = BIT(6),
20 RX_ATTENTION_FLAGS_NULL_DATA = BIT(7),
21 RX_ATTENTION_FLAGS_MGMT_TYPE = BIT(8),
22 RX_ATTENTION_FLAGS_CTRL_TYPE = BIT(9),
23 RX_ATTENTION_FLAGS_MORE_DATA = BIT(10),
24 RX_ATTENTION_FLAGS_EOSP = BIT(11),
25 RX_ATTENTION_FLAGS_U_APSD_TRIGGER = BIT(12),
26 RX_ATTENTION_FLAGS_FRAGMENT = BIT(13),
27 RX_ATTENTION_FLAGS_ORDER = BIT(14),
28 RX_ATTENTION_FLAGS_CLASSIFICATION = BIT(15),
29 RX_ATTENTION_FLAGS_OVERFLOW_ERR = BIT(16),
30 RX_ATTENTION_FLAGS_MSDU_LENGTH_ERR = BIT(17),
31 RX_ATTENTION_FLAGS_TCP_UDP_CHKSUM_FAIL = BIT(18),
32 RX_ATTENTION_FLAGS_IP_CHKSUM_FAIL = BIT(19),
33 RX_ATTENTION_FLAGS_SA_IDX_INVALID = BIT(20),
34 RX_ATTENTION_FLAGS_DA_IDX_INVALID = BIT(21),
35 RX_ATTENTION_FLAGS_SA_IDX_TIMEOUT = BIT(22),
36 RX_ATTENTION_FLAGS_DA_IDX_TIMEOUT = BIT(23),
37 RX_ATTENTION_FLAGS_ENCRYPT_REQUIRED = BIT(24),
38 RX_ATTENTION_FLAGS_DIRECTED = BIT(25),
39 RX_ATTENTION_FLAGS_BUFFER_FRAGMENT = BIT(26),
40 RX_ATTENTION_FLAGS_MPDU_LENGTH_ERR = BIT(27),
41 RX_ATTENTION_FLAGS_TKIP_MIC_ERR = BIT(28),
42 RX_ATTENTION_FLAGS_DECRYPT_ERR = BIT(29),
43 RX_ATTENTION_FLAGS_FCS_ERR = BIT(30),
44 RX_ATTENTION_FLAGS_MSDU_DONE = BIT(31),
45 };
46
47 struct rx_attention {
48 __le32 flags;
49 } __packed;
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 struct rx_frag_info {
200 u8 ring0_more_count;
201 u8 ring1_more_count;
202 u8 ring2_more_count;
203 u8 ring3_more_count;
204 u8 ring4_more_count;
205 u8 ring5_more_count;
206 u8 ring6_more_count;
207 u8 ring7_more_count;
208 } __packed;
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228 enum htt_rx_mpdu_encrypt_type {
229 HTT_RX_MPDU_ENCRYPT_WEP40 = 0,
230 HTT_RX_MPDU_ENCRYPT_WEP104 = 1,
231 HTT_RX_MPDU_ENCRYPT_TKIP_WITHOUT_MIC = 2,
232 HTT_RX_MPDU_ENCRYPT_WEP128 = 3,
233 HTT_RX_MPDU_ENCRYPT_TKIP_WPA = 4,
234 HTT_RX_MPDU_ENCRYPT_WAPI = 5,
235 HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2 = 6,
236 HTT_RX_MPDU_ENCRYPT_NONE = 7,
237 HTT_RX_MPDU_ENCRYPT_AES_CCM256_WPA2 = 8,
238 HTT_RX_MPDU_ENCRYPT_AES_GCMP_WPA2 = 9,
239 HTT_RX_MPDU_ENCRYPT_AES_GCMP256_WPA2 = 10,
240 };
241
242 #define RX_MPDU_START_INFO0_PEER_IDX_MASK 0x000007ff
243 #define RX_MPDU_START_INFO0_PEER_IDX_LSB 0
244 #define RX_MPDU_START_INFO0_SEQ_NUM_MASK 0x0fff0000
245 #define RX_MPDU_START_INFO0_SEQ_NUM_LSB 16
246 #define RX_MPDU_START_INFO0_ENCRYPT_TYPE_MASK 0xf0000000
247 #define RX_MPDU_START_INFO0_ENCRYPT_TYPE_LSB 28
248 #define RX_MPDU_START_INFO0_FROM_DS BIT(11)
249 #define RX_MPDU_START_INFO0_TO_DS BIT(12)
250 #define RX_MPDU_START_INFO0_ENCRYPTED BIT(13)
251 #define RX_MPDU_START_INFO0_RETRY BIT(14)
252 #define RX_MPDU_START_INFO0_TXBF_H_INFO BIT(15)
253
254 #define RX_MPDU_START_INFO1_TID_MASK 0xf0000000
255 #define RX_MPDU_START_INFO1_TID_LSB 28
256 #define RX_MPDU_START_INFO1_DIRECTED BIT(16)
257
258 struct rx_mpdu_start {
259 __le32 info0;
260 union {
261 struct {
262 __le32 pn31_0;
263 __le32 info1;
264 } __packed;
265 struct {
266 u8 pn[6];
267 } __packed;
268 } __packed;
269 } __packed;
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 #define RX_MPDU_END_INFO0_RESERVED_0_MASK 0x00001fff
348 #define RX_MPDU_END_INFO0_RESERVED_0_LSB 0
349 #define RX_MPDU_END_INFO0_POST_DELIM_CNT_MASK 0x0fff0000
350 #define RX_MPDU_END_INFO0_POST_DELIM_CNT_LSB 16
351 #define RX_MPDU_END_INFO0_OVERFLOW_ERR BIT(13)
352 #define RX_MPDU_END_INFO0_LAST_MPDU BIT(14)
353 #define RX_MPDU_END_INFO0_POST_DELIM_ERR BIT(15)
354 #define RX_MPDU_END_INFO0_MPDU_LENGTH_ERR BIT(28)
355 #define RX_MPDU_END_INFO0_TKIP_MIC_ERR BIT(29)
356 #define RX_MPDU_END_INFO0_DECRYPT_ERR BIT(30)
357 #define RX_MPDU_END_INFO0_FCS_ERR BIT(31)
358
359 struct rx_mpdu_end {
360 __le32 info0;
361 } __packed;
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 #define RX_MSDU_START_INFO0_MSDU_LENGTH_MASK 0x00003fff
402 #define RX_MSDU_START_INFO0_MSDU_LENGTH_LSB 0
403 #define RX_MSDU_START_INFO0_IP_OFFSET_MASK 0x000fc000
404 #define RX_MSDU_START_INFO0_IP_OFFSET_LSB 14
405 #define RX_MSDU_START_INFO0_RING_MASK_MASK 0x00f00000
406 #define RX_MSDU_START_INFO0_RING_MASK_LSB 20
407 #define RX_MSDU_START_INFO0_TCP_UDP_OFFSET_MASK 0x7f000000
408 #define RX_MSDU_START_INFO0_TCP_UDP_OFFSET_LSB 24
409
410 #define RX_MSDU_START_INFO1_MSDU_NUMBER_MASK 0x000000ff
411 #define RX_MSDU_START_INFO1_MSDU_NUMBER_LSB 0
412 #define RX_MSDU_START_INFO1_DECAP_FORMAT_MASK 0x00000300
413 #define RX_MSDU_START_INFO1_DECAP_FORMAT_LSB 8
414 #define RX_MSDU_START_INFO1_SA_IDX_MASK 0x07ff0000
415 #define RX_MSDU_START_INFO1_SA_IDX_LSB 16
416 #define RX_MSDU_START_INFO1_IPV4_PROTO BIT(10)
417 #define RX_MSDU_START_INFO1_IPV6_PROTO BIT(11)
418 #define RX_MSDU_START_INFO1_TCP_PROTO BIT(12)
419 #define RX_MSDU_START_INFO1_UDP_PROTO BIT(13)
420 #define RX_MSDU_START_INFO1_IP_FRAG BIT(14)
421 #define RX_MSDU_START_INFO1_TCP_ONLY_ACK BIT(15)
422
423 #define RX_MSDU_START_INFO2_DA_IDX_MASK 0x000007ff
424 #define RX_MSDU_START_INFO2_DA_IDX_LSB 0
425 #define RX_MSDU_START_INFO2_IP_PROTO_FIELD_MASK 0x00ff0000
426 #define RX_MSDU_START_INFO2_IP_PROTO_FIELD_LSB 16
427 #define RX_MSDU_START_INFO2_DA_BCAST_MCAST BIT(11)
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442 enum rx_msdu_decap_format {
443 RX_MSDU_DECAP_RAW = 0,
444
445
446
447
448 RX_MSDU_DECAP_NATIVE_WIFI = 1,
449
450
451 RX_MSDU_DECAP_ETHERNET2_DIX = 2,
452
453
454
455
456 RX_MSDU_DECAP_8023_SNAP_LLC = 3
457 };
458
459 struct rx_msdu_start_common {
460 __le32 info0;
461 __le32 flow_id_crc;
462 __le32 info1;
463 } __packed;
464
465 struct rx_msdu_start_qca99x0 {
466 __le32 info2;
467 } __packed;
468
469 struct rx_msdu_start_wcn3990 {
470 __le32 info2;
471 __le32 info3;
472 } __packed;
473
474 struct rx_msdu_start {
475 struct rx_msdu_start_common common;
476 union {
477 struct rx_msdu_start_qca99x0 qca99x0;
478 struct rx_msdu_start_wcn3990 wcn3990;
479 } __packed;
480 } __packed;
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 #define RX_MSDU_END_INFO0_REPORTED_MPDU_LENGTH_MASK 0x00003fff
561 #define RX_MSDU_END_INFO0_REPORTED_MPDU_LENGTH_LSB 0
562 #define RX_MSDU_END_INFO0_FIRST_MSDU BIT(14)
563 #define RX_MSDU_END_INFO0_LAST_MSDU BIT(15)
564 #define RX_MSDU_END_INFO0_MSDU_LIMIT_ERR BIT(18)
565 #define RX_MSDU_END_INFO0_PRE_DELIM_ERR BIT(30)
566 #define RX_MSDU_END_INFO0_RESERVED_3B BIT(31)
567
568 struct rx_msdu_end_common {
569 __le16 ip_hdr_cksum;
570 __le16 tcp_hdr_cksum;
571 u8 key_id_octet;
572 u8 classification_filter;
573 u8 wapi_pn[10];
574 __le32 info0;
575 } __packed;
576
577 #define RX_MSDU_END_INFO1_TCP_FLAG_MASK 0x000001ff
578 #define RX_MSDU_END_INFO1_TCP_FLAG_LSB 0
579 #define RX_MSDU_END_INFO1_L3_HDR_PAD_MASK 0x00001c00
580 #define RX_MSDU_END_INFO1_L3_HDR_PAD_LSB 10
581 #define RX_MSDU_END_INFO1_WINDOW_SIZE_MASK 0xffff0000
582 #define RX_MSDU_END_INFO1_WINDOW_SIZE_LSB 16
583 #define RX_MSDU_END_INFO1_IRO_ELIGIBLE BIT(9)
584
585 #define RX_MSDU_END_INFO2_DA_OFFSET_MASK 0x0000003f
586 #define RX_MSDU_END_INFO2_DA_OFFSET_LSB 0
587 #define RX_MSDU_END_INFO2_SA_OFFSET_MASK 0x00000fc0
588 #define RX_MSDU_END_INFO2_SA_OFFSET_LSB 6
589 #define RX_MSDU_END_INFO2_TYPE_OFFSET_MASK 0x0003f000
590 #define RX_MSDU_END_INFO2_TYPE_OFFSET_LSB 12
591
592 struct rx_msdu_end_qca99x0 {
593 __le32 ipv6_crc;
594 __le32 tcp_seq_no;
595 __le32 tcp_ack_no;
596 __le32 info1;
597 __le32 info2;
598 } __packed;
599
600 struct rx_msdu_end_wcn3990 {
601 __le32 ipv6_crc;
602 __le32 tcp_seq_no;
603 __le32 tcp_ack_no;
604 __le32 info1;
605 __le32 info2;
606 __le32 rule_indication_0;
607 __le32 rule_indication_1;
608 __le32 rule_indication_2;
609 __le32 rule_indication_3;
610 } __packed;
611
612 struct rx_msdu_end {
613 struct rx_msdu_end_common common;
614 union {
615 struct rx_msdu_end_qca99x0 qca99x0;
616 struct rx_msdu_end_wcn3990 wcn3990;
617 } __packed;
618 } __packed;
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 #define HTT_RX_PPDU_START_PREAMBLE_LEGACY 0x04
687 #define HTT_RX_PPDU_START_PREAMBLE_HT 0x08
688 #define HTT_RX_PPDU_START_PREAMBLE_HT_WITH_TXBF 0x09
689 #define HTT_RX_PPDU_START_PREAMBLE_VHT 0x0C
690 #define HTT_RX_PPDU_START_PREAMBLE_VHT_WITH_TXBF 0x0D
691
692 #define RX_PPDU_START_INFO0_IS_GREENFIELD BIT(0)
693
694 #define RX_PPDU_START_INFO1_L_SIG_RATE_MASK 0x0000000f
695 #define RX_PPDU_START_INFO1_L_SIG_RATE_LSB 0
696 #define RX_PPDU_START_INFO1_L_SIG_LENGTH_MASK 0x0001ffe0
697 #define RX_PPDU_START_INFO1_L_SIG_LENGTH_LSB 5
698 #define RX_PPDU_START_INFO1_L_SIG_TAIL_MASK 0x00fc0000
699 #define RX_PPDU_START_INFO1_L_SIG_TAIL_LSB 18
700 #define RX_PPDU_START_INFO1_PREAMBLE_TYPE_MASK 0xff000000
701 #define RX_PPDU_START_INFO1_PREAMBLE_TYPE_LSB 24
702 #define RX_PPDU_START_INFO1_L_SIG_RATE_SELECT BIT(4)
703 #define RX_PPDU_START_INFO1_L_SIG_PARITY BIT(17)
704
705 #define RX_PPDU_START_INFO2_HT_SIG_VHT_SIG_A_1_MASK 0x00ffffff
706 #define RX_PPDU_START_INFO2_HT_SIG_VHT_SIG_A_1_LSB 0
707
708 #define RX_PPDU_START_INFO3_HT_SIG_VHT_SIG_A_2_MASK 0x00ffffff
709 #define RX_PPDU_START_INFO3_HT_SIG_VHT_SIG_A_2_LSB 0
710 #define RX_PPDU_START_INFO3_TXBF_H_INFO BIT(24)
711
712 #define RX_PPDU_START_INFO4_VHT_SIG_B_MASK 0x1fffffff
713 #define RX_PPDU_START_INFO4_VHT_SIG_B_LSB 0
714
715 #define RX_PPDU_START_INFO5_SERVICE_MASK 0x0000ffff
716 #define RX_PPDU_START_INFO5_SERVICE_LSB 0
717
718
719 #define RX_PPDU_START_RATE_FLAG BIT(3)
720
721 struct rx_ppdu_start {
722 struct {
723 u8 pri20_mhz;
724 u8 ext20_mhz;
725 u8 ext40_mhz;
726 u8 ext80_mhz;
727 } rssi_chains[4];
728 u8 rssi_comb;
729 __le16 rsvd0;
730 u8 info0;
731 __le32 info1;
732 __le32 info2;
733 __le32 info3;
734 __le32 info4;
735 __le32 info5;
736 } __packed;
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 #define RX_PPDU_END_FLAGS_PHY_ERR BIT(0)
900 #define RX_PPDU_END_FLAGS_RX_LOCATION BIT(1)
901 #define RX_PPDU_END_FLAGS_TXBF_H_INFO BIT(2)
902
903 #define RX_PPDU_END_INFO0_RX_ANTENNA_MASK 0x00ffffff
904 #define RX_PPDU_END_INFO0_RX_ANTENNA_LSB 0
905 #define RX_PPDU_END_INFO0_FLAGS_TX_HT_VHT_ACK BIT(24)
906 #define RX_PPDU_END_INFO0_BB_CAPTURED_CHANNEL BIT(25)
907
908 #define RX_PPDU_END_INFO1_PEER_IDX_MASK 0x1ffc
909 #define RX_PPDU_END_INFO1_PEER_IDX_LSB 2
910 #define RX_PPDU_END_INFO1_BB_DATA BIT(0)
911 #define RX_PPDU_END_INFO1_PEER_IDX_VALID BIT(1)
912 #define RX_PPDU_END_INFO1_PPDU_DONE BIT(15)
913
914 struct rx_ppdu_end_common {
915 __le32 evm_p0;
916 __le32 evm_p1;
917 __le32 evm_p2;
918 __le32 evm_p3;
919 __le32 evm_p4;
920 __le32 evm_p5;
921 __le32 evm_p6;
922 __le32 evm_p7;
923 __le32 evm_p8;
924 __le32 evm_p9;
925 __le32 evm_p10;
926 __le32 evm_p11;
927 __le32 evm_p12;
928 __le32 evm_p13;
929 __le32 evm_p14;
930 __le32 evm_p15;
931 __le32 tsf_timestamp;
932 __le32 wb_timestamp;
933 } __packed;
934
935 struct rx_ppdu_end_qca988x {
936 u8 locationing_timestamp;
937 u8 phy_err_code;
938 __le16 flags;
939 __le32 info0;
940 __le16 bb_length;
941 __le16 info1;
942 } __packed;
943
944 #define RX_PPDU_END_RTT_CORRELATION_VALUE_MASK 0x00ffffff
945 #define RX_PPDU_END_RTT_CORRELATION_VALUE_LSB 0
946 #define RX_PPDU_END_RTT_UNUSED_MASK 0x7f000000
947 #define RX_PPDU_END_RTT_UNUSED_LSB 24
948 #define RX_PPDU_END_RTT_NORMAL_MODE BIT(31)
949
950 struct rx_ppdu_end_qca6174 {
951 u8 locationing_timestamp;
952 u8 phy_err_code;
953 __le16 flags;
954 __le32 info0;
955 __le32 rtt;
956 __le16 bb_length;
957 __le16 info1;
958 } __packed;
959
960 #define RX_PKT_END_INFO0_RX_SUCCESS BIT(0)
961 #define RX_PKT_END_INFO0_ERR_TX_INTERRUPT_RX BIT(3)
962 #define RX_PKT_END_INFO0_ERR_OFDM_POWER_DROP BIT(4)
963 #define RX_PKT_END_INFO0_ERR_OFDM_RESTART BIT(5)
964 #define RX_PKT_END_INFO0_ERR_CCK_POWER_DROP BIT(6)
965 #define RX_PKT_END_INFO0_ERR_CCK_RESTART BIT(7)
966
967 #define RX_LOCATION_INFO_RTT_CORR_VAL_MASK 0x0001ffff
968 #define RX_LOCATION_INFO_RTT_CORR_VAL_LSB 0
969 #define RX_LOCATION_INFO_FAC_STATUS_MASK 0x000c0000
970 #define RX_LOCATION_INFO_FAC_STATUS_LSB 18
971 #define RX_LOCATION_INFO_PKT_BW_MASK 0x00700000
972 #define RX_LOCATION_INFO_PKT_BW_LSB 20
973 #define RX_LOCATION_INFO_RTT_TX_FRAME_PHASE_MASK 0x01800000
974 #define RX_LOCATION_INFO_RTT_TX_FRAME_PHASE_LSB 23
975 #define RX_LOCATION_INFO_CIR_STATUS BIT(17)
976 #define RX_LOCATION_INFO_RTT_MAC_PHY_PHASE BIT(25)
977 #define RX_LOCATION_INFO_RTT_TX_DATA_START_X BIT(26)
978 #define RX_LOCATION_INFO_HW_IFFT_MODE BIT(30)
979 #define RX_LOCATION_INFO_RX_LOCATION_VALID BIT(31)
980
981 struct rx_pkt_end {
982 __le32 info0;
983 __le32 phy_timestamp_1;
984 __le32 phy_timestamp_2;
985 } __packed;
986
987 struct rx_pkt_end_wcn3990 {
988 __le32 info0;
989 __le64 phy_timestamp_1;
990 __le64 phy_timestamp_2;
991 } __packed;
992
993 #define RX_LOCATION_INFO0_RTT_FAC_LEGACY_MASK 0x00003fff
994 #define RX_LOCATION_INFO0_RTT_FAC_LEGACY_LSB 0
995 #define RX_LOCATION_INFO0_RTT_FAC_VHT_MASK 0x1fff8000
996 #define RX_LOCATION_INFO0_RTT_FAC_VHT_LSB 15
997 #define RX_LOCATION_INFO0_RTT_STRONGEST_CHAIN_MASK 0xc0000000
998 #define RX_LOCATION_INFO0_RTT_STRONGEST_CHAIN_LSB 30
999 #define RX_LOCATION_INFO0_RTT_FAC_LEGACY_STATUS BIT(14)
1000 #define RX_LOCATION_INFO0_RTT_FAC_VHT_STATUS BIT(29)
1001
1002 #define RX_LOCATION_INFO1_RTT_PREAMBLE_TYPE_MASK 0x0000000c
1003 #define RX_LOCATION_INFO1_RTT_PREAMBLE_TYPE_LSB 2
1004 #define RX_LOCATION_INFO1_PKT_BW_MASK 0x00000030
1005 #define RX_LOCATION_INFO1_PKT_BW_LSB 4
1006 #define RX_LOCATION_INFO1_SKIP_P_SKIP_BTCF_MASK 0x0000ff00
1007 #define RX_LOCATION_INFO1_SKIP_P_SKIP_BTCF_LSB 8
1008 #define RX_LOCATION_INFO1_RTT_MSC_RATE_MASK 0x000f0000
1009 #define RX_LOCATION_INFO1_RTT_MSC_RATE_LSB 16
1010 #define RX_LOCATION_INFO1_RTT_PBD_LEG_BW_MASK 0x00300000
1011 #define RX_LOCATION_INFO1_RTT_PBD_LEG_BW_LSB 20
1012 #define RX_LOCATION_INFO1_TIMING_BACKOFF_MASK 0x07c00000
1013 #define RX_LOCATION_INFO1_TIMING_BACKOFF_LSB 22
1014 #define RX_LOCATION_INFO1_RTT_TX_FRAME_PHASE_MASK 0x18000000
1015 #define RX_LOCATION_INFO1_RTT_TX_FRAME_PHASE_LSB 27
1016 #define RX_LOCATION_INFO1_RTT_CFR_STATUS BIT(0)
1017 #define RX_LOCATION_INFO1_RTT_CIR_STATUS BIT(1)
1018 #define RX_LOCATION_INFO1_RTT_GI_TYPE BIT(7)
1019 #define RX_LOCATION_INFO1_RTT_MAC_PHY_PHASE BIT(29)
1020 #define RX_LOCATION_INFO1_RTT_TX_DATA_START_X_PHASE BIT(30)
1021 #define RX_LOCATION_INFO1_RX_LOCATION_VALID BIT(31)
1022
1023 struct rx_location_info {
1024 __le32 rx_location_info0;
1025 __le32 rx_location_info1;
1026 } __packed;
1027
1028 struct rx_location_info_wcn3990 {
1029 __le32 rx_location_info0;
1030 __le32 rx_location_info1;
1031 __le32 rx_location_info2;
1032 } __packed;
1033
1034 enum rx_phy_ppdu_end_info0 {
1035 RX_PHY_PPDU_END_INFO0_ERR_RADAR = BIT(2),
1036 RX_PHY_PPDU_END_INFO0_ERR_RX_ABORT = BIT(3),
1037 RX_PHY_PPDU_END_INFO0_ERR_RX_NAP = BIT(4),
1038 RX_PHY_PPDU_END_INFO0_ERR_OFDM_TIMING = BIT(5),
1039 RX_PHY_PPDU_END_INFO0_ERR_OFDM_PARITY = BIT(6),
1040 RX_PHY_PPDU_END_INFO0_ERR_OFDM_RATE = BIT(7),
1041 RX_PHY_PPDU_END_INFO0_ERR_OFDM_LENGTH = BIT(8),
1042 RX_PHY_PPDU_END_INFO0_ERR_OFDM_RESTART = BIT(9),
1043 RX_PHY_PPDU_END_INFO0_ERR_OFDM_SERVICE = BIT(10),
1044 RX_PHY_PPDU_END_INFO0_ERR_OFDM_POWER_DROP = BIT(11),
1045 RX_PHY_PPDU_END_INFO0_ERR_CCK_BLOCKER = BIT(12),
1046 RX_PHY_PPDU_END_INFO0_ERR_CCK_TIMING = BIT(13),
1047 RX_PHY_PPDU_END_INFO0_ERR_CCK_HEADER_CRC = BIT(14),
1048 RX_PHY_PPDU_END_INFO0_ERR_CCK_RATE = BIT(15),
1049 RX_PHY_PPDU_END_INFO0_ERR_CCK_LENGTH = BIT(16),
1050 RX_PHY_PPDU_END_INFO0_ERR_CCK_RESTART = BIT(17),
1051 RX_PHY_PPDU_END_INFO0_ERR_CCK_SERVICE = BIT(18),
1052 RX_PHY_PPDU_END_INFO0_ERR_CCK_POWER_DROP = BIT(19),
1053 RX_PHY_PPDU_END_INFO0_ERR_HT_CRC = BIT(20),
1054 RX_PHY_PPDU_END_INFO0_ERR_HT_LENGTH = BIT(21),
1055 RX_PHY_PPDU_END_INFO0_ERR_HT_RATE = BIT(22),
1056 RX_PHY_PPDU_END_INFO0_ERR_HT_ZLF = BIT(23),
1057 RX_PHY_PPDU_END_INFO0_ERR_FALSE_RADAR_EXT = BIT(24),
1058 RX_PHY_PPDU_END_INFO0_ERR_GREEN_FIELD = BIT(25),
1059 RX_PHY_PPDU_END_INFO0_ERR_SPECTRAL_SCAN = BIT(26),
1060 RX_PHY_PPDU_END_INFO0_ERR_RX_DYN_BW = BIT(27),
1061 RX_PHY_PPDU_END_INFO0_ERR_LEG_HT_MISMATCH = BIT(28),
1062 RX_PHY_PPDU_END_INFO0_ERR_VHT_CRC = BIT(29),
1063 RX_PHY_PPDU_END_INFO0_ERR_VHT_SIGA = BIT(30),
1064 RX_PHY_PPDU_END_INFO0_ERR_VHT_LSIG = BIT(31),
1065 };
1066
1067 enum rx_phy_ppdu_end_info1 {
1068 RX_PHY_PPDU_END_INFO1_ERR_VHT_NDP = BIT(0),
1069 RX_PHY_PPDU_END_INFO1_ERR_VHT_NSYM = BIT(1),
1070 RX_PHY_PPDU_END_INFO1_ERR_VHT_RX_EXT_SYM = BIT(2),
1071 RX_PHY_PPDU_END_INFO1_ERR_VHT_RX_SKIP_ID0 = BIT(3),
1072 RX_PHY_PPDU_END_INFO1_ERR_VHT_RX_SKIP_ID1_62 = BIT(4),
1073 RX_PHY_PPDU_END_INFO1_ERR_VHT_RX_SKIP_ID63 = BIT(5),
1074 RX_PHY_PPDU_END_INFO1_ERR_OFDM_LDPC_DECODER = BIT(6),
1075 RX_PHY_PPDU_END_INFO1_ERR_DEFER_NAP = BIT(7),
1076 RX_PHY_PPDU_END_INFO1_ERR_FDOMAIN_TIMEOUT = BIT(8),
1077 RX_PHY_PPDU_END_INFO1_ERR_LSIG_REL_CHECK = BIT(9),
1078 RX_PHY_PPDU_END_INFO1_ERR_BT_COLLISION = BIT(10),
1079 RX_PHY_PPDU_END_INFO1_ERR_MU_FEEDBACK = BIT(11),
1080 RX_PHY_PPDU_END_INFO1_ERR_TX_INTERRUPT_RX = BIT(12),
1081 RX_PHY_PPDU_END_INFO1_ERR_RX_CBF = BIT(13),
1082 };
1083
1084 struct rx_phy_ppdu_end {
1085 __le32 info0;
1086 __le32 info1;
1087 } __packed;
1088
1089 #define RX_PPDU_END_RX_TIMING_OFFSET_MASK 0x00000fff
1090 #define RX_PPDU_END_RX_TIMING_OFFSET_LSB 0
1091
1092 #define RX_PPDU_END_RX_INFO_RX_ANTENNA_MASK 0x00ffffff
1093 #define RX_PPDU_END_RX_INFO_RX_ANTENNA_LSB 0
1094 #define RX_PPDU_END_RX_INFO_TX_HT_VHT_ACK BIT(24)
1095 #define RX_PPDU_END_RX_INFO_RX_PKT_END_VALID BIT(25)
1096 #define RX_PPDU_END_RX_INFO_RX_PHY_PPDU_END_VALID BIT(26)
1097 #define RX_PPDU_END_RX_INFO_RX_TIMING_OFFSET_VALID BIT(27)
1098 #define RX_PPDU_END_RX_INFO_BB_CAPTURED_CHANNEL BIT(28)
1099 #define RX_PPDU_END_RX_INFO_UNSUPPORTED_MU_NC BIT(29)
1100 #define RX_PPDU_END_RX_INFO_OTP_TXBF_DISABLE BIT(30)
1101
1102 struct rx_ppdu_end_qca99x0 {
1103 struct rx_pkt_end rx_pkt_end;
1104 __le32 rx_location_info;
1105 struct rx_phy_ppdu_end rx_phy_ppdu_end;
1106 __le32 rx_timing_offset;
1107 __le32 rx_info;
1108 __le16 bb_length;
1109 __le16 info1;
1110 } __packed;
1111
1112 struct rx_ppdu_end_qca9984 {
1113 struct rx_pkt_end rx_pkt_end;
1114 struct rx_location_info rx_location_info;
1115 struct rx_phy_ppdu_end rx_phy_ppdu_end;
1116 __le32 rx_timing_offset;
1117 __le32 rx_info;
1118 __le16 bb_length;
1119 __le16 info1;
1120 } __packed;
1121
1122 struct rx_ppdu_end_wcn3990 {
1123 struct rx_pkt_end_wcn3990 rx_pkt_end;
1124 struct rx_location_info_wcn3990 rx_location_info;
1125 struct rx_phy_ppdu_end rx_phy_ppdu_end;
1126 __le32 rx_timing_offset;
1127 __le32 reserved_info_0;
1128 __le32 reserved_info_1;
1129 __le32 rx_antenna_info;
1130 __le32 rx_coex_info;
1131 __le32 rx_mpdu_cnt_info;
1132 __le64 phy_timestamp_tx;
1133 __le32 rx_bb_length;
1134 } __packed;
1135
1136 struct rx_ppdu_end {
1137 struct rx_ppdu_end_common common;
1138 union {
1139 struct rx_ppdu_end_qca988x qca988x;
1140 struct rx_ppdu_end_qca6174 qca6174;
1141 struct rx_ppdu_end_qca99x0 qca99x0;
1142 struct rx_ppdu_end_qca9984 qca9984;
1143 struct rx_ppdu_end_wcn3990 wcn3990;
1144 } __packed;
1145 } __packed;
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266 #define FW_RX_DESC_INFO0_DISCARD BIT(0)
1267 #define FW_RX_DESC_INFO0_FORWARD BIT(1)
1268 #define FW_RX_DESC_INFO0_INSPECT BIT(5)
1269 #define FW_RX_DESC_INFO0_EXT_MASK 0xC0
1270 #define FW_RX_DESC_INFO0_EXT_LSB 6
1271
1272 struct fw_rx_desc_base {
1273 u8 info0;
1274 } __packed;
1275
1276 #define FW_RX_DESC_FLAGS_FIRST_MSDU (1 << 0)
1277 #define FW_RX_DESC_FLAGS_LAST_MSDU (1 << 1)
1278 #define FW_RX_DESC_C3_FAILED (1 << 2)
1279 #define FW_RX_DESC_C4_FAILED (1 << 3)
1280 #define FW_RX_DESC_IPV6 (1 << 4)
1281 #define FW_RX_DESC_TCP (1 << 5)
1282 #define FW_RX_DESC_UDP (1 << 6)
1283
1284 struct fw_rx_desc_hl {
1285 u8 info0;
1286 u8 version;
1287 u8 len;
1288 u8 flags;
1289 } __packed;
1290
1291 #endif