xref: /wlan-driver/fw-api/hw/qca5332/mon_drop.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 
2 /* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 #ifndef _MON_DROP_H_
27 #define _MON_DROP_H_
28 #if !defined(__ASSEMBLER__)
29 #endif
30 
31 #define NUM_OF_DWORDS_MON_DROP 2
32 
33 #define NUM_OF_QWORDS_MON_DROP 1
34 
35 
36 struct mon_drop {
37 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
38              uint32_t ppdu_id                                                 : 32; // [31:0]
39              uint32_t ppdu_drop_cnt                                           : 10, // [9:0]
40                       mpdu_drop_cnt                                           : 10, // [19:10]
41                       tlv_drop_cnt                                            : 10, // [29:20]
42                       end_of_ppdu_seen                                        :  1, // [30:30]
43                       reserved_1a                                             :  1; // [31:31]
44 #else
45              uint32_t ppdu_id                                                 : 32; // [31:0]
46              uint32_t reserved_1a                                             :  1, // [31:31]
47                       end_of_ppdu_seen                                        :  1, // [30:30]
48                       tlv_drop_cnt                                            : 10, // [29:20]
49                       mpdu_drop_cnt                                           : 10, // [19:10]
50                       ppdu_drop_cnt                                           : 10; // [9:0]
51 #endif
52 };
53 
54 
55 /* Description		PPDU_ID
56 
57 			The ID of the last PPDU which saw the back-pressure on AXI
58 
59 
60 			TXMON fills this with the schedule_id from 'TX_FES_SETUP'
61 			in case of a TX FES (TXOP initiator).
62 			TXMON fills this with the Phy_ppdu_id from 'RX_RESPONSE_REQUIRED_INFO'
63 			in case of a response TX (TXOP responder).
64 			RXMON fills this with the Phy_ppdu_id from 'RX_PPDU_START.'
65 
66 			<legal all>
67 */
68 
69 #define MON_DROP_PPDU_ID_OFFSET                                                     0x0000000000000000
70 #define MON_DROP_PPDU_ID_LSB                                                        0
71 #define MON_DROP_PPDU_ID_MSB                                                        31
72 #define MON_DROP_PPDU_ID_MASK                                                       0x00000000ffffffff
73 
74 
75 /* Description		PPDU_DROP_CNT
76 
77 			The number of PPDUs dropped due to the back-pressure
78 
79 			Set to 1023 if >1023 PPDUs got dropped
80 			<legal all>
81 */
82 
83 #define MON_DROP_PPDU_DROP_CNT_OFFSET                                               0x0000000000000000
84 #define MON_DROP_PPDU_DROP_CNT_LSB                                                  32
85 #define MON_DROP_PPDU_DROP_CNT_MSB                                                  41
86 #define MON_DROP_PPDU_DROP_CNT_MASK                                                 0x000003ff00000000
87 
88 
89 /* Description		MPDU_DROP_CNT
90 
91 			The number of MPDUs dropped within the first PPDU due to
92 			 the back-pressure
93 
94 			Set to 1023 if >1023 MPDUs got dropped
95 			<legal all>
96 */
97 
98 #define MON_DROP_MPDU_DROP_CNT_OFFSET                                               0x0000000000000000
99 #define MON_DROP_MPDU_DROP_CNT_LSB                                                  42
100 #define MON_DROP_MPDU_DROP_CNT_MSB                                                  51
101 #define MON_DROP_MPDU_DROP_CNT_MASK                                                 0x000ffc0000000000
102 
103 
104 /* Description		TLV_DROP_CNT
105 
106 			The number of PPDU-level (global or per-user) TLVs dropped
107 			 within the first PPDU due to the back-pressure
108 */
109 
110 #define MON_DROP_TLV_DROP_CNT_OFFSET                                                0x0000000000000000
111 #define MON_DROP_TLV_DROP_CNT_LSB                                                   52
112 #define MON_DROP_TLV_DROP_CNT_MSB                                                   61
113 #define MON_DROP_TLV_DROP_CNT_MASK                                                  0x3ff0000000000000
114 
115 
116 /* Description		END_OF_PPDU_SEEN
117 
118 			Field valid only if mpdu_drop_cnt > 0 or tlv_drop_cnt >
119 			0
120 
121 			Set by TXMON if 'TX_FES_STATUS_END' is received but dropped
122 			 in case of a TX FES (TXOP initiator).
123 			Set by TXMON if 'RESPONSE_END_STATUS' is received but dropped
124 			 in case of a response TX (TXOP responder).
125 			Set by RXMON if 'RX_PPDU_END' is received but dropped
126 */
127 
128 #define MON_DROP_END_OF_PPDU_SEEN_OFFSET                                            0x0000000000000000
129 #define MON_DROP_END_OF_PPDU_SEEN_LSB                                               62
130 #define MON_DROP_END_OF_PPDU_SEEN_MSB                                               62
131 #define MON_DROP_END_OF_PPDU_SEEN_MASK                                              0x4000000000000000
132 
133 
134 /* Description		RESERVED_1A
135 
136 			<legal 0>
137 */
138 
139 #define MON_DROP_RESERVED_1A_OFFSET                                                 0x0000000000000000
140 #define MON_DROP_RESERVED_1A_LSB                                                    63
141 #define MON_DROP_RESERVED_1A_MSB                                                    63
142 #define MON_DROP_RESERVED_1A_MASK                                                   0x8000000000000000
143 
144 
145 
146 #endif   // MON_DROP
147