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