xref: /wlan-dirver/qca-wifi-host-cmn/dp/inc/cdp_txrx_stats_struct.h (revision d0c05845839e5f2ba5a8dcebe0cd3e4cd4e8dfcf)
1 /*
2  * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /**
21  * @file cdp_txrx_stats_struct.h
22  * @brief Define the host data path stats API functions
23  * called by the host control SW and the OS interface module
24  */
25 #ifndef _CDP_TXRX_STATS_STRUCT_H_
26 #define _CDP_TXRX_STATS_STRUCT_H_
27 
28 #include <qdf_types.h>
29 #include <cdp_txrx_hist_struct.h>
30 
31 #define TXRX_STATS_LEVEL_OFF   0
32 #define TXRX_STATS_LEVEL_BASIC 1
33 #define TXRX_STATS_LEVEL_FULL  2
34 
35 #define BSS_CHAN_INFO_READ                        1
36 #define BSS_CHAN_INFO_READ_AND_CLEAR              2
37 
38 #define TX_FRAME_TYPE_DATA 0
39 #define TX_FRAME_TYPE_MGMT 1
40 #define TX_FRAME_TYPE_BEACON 2
41 
42 #ifndef TXRX_STATS_LEVEL
43 #define TXRX_STATS_LEVEL TXRX_STATS_LEVEL_BASIC
44 #endif
45 
46 /* 1 additional MCS is for invalid values */
47 #ifdef WLAN_FEATURE_11BE
48 #define MAX_MCS (16 + 1)
49 #define MAX_MCS_11BE 16
50 #define MAX_PUNCTURED_MODE 5
51 #else
52 #define MAX_MCS (14 + 1)
53 #endif
54 
55 #define MCS_INVALID_ARRAY_INDEX MAX_MCS
56 #define MAX_MCS_11A 8
57 #define MAX_MCS_11B 7
58 #define MAX_MCS_11N 8
59 #define MAX_MCS_11AC 12
60 #define MAX_MCS_11AX 14
61 /* 1 additional GI is for invalid values */
62 #define MAX_GI (4 + 1)
63 #define SS_COUNT 8
64 #define MAX_BW 8
65 #define MAX_RECEPTION_TYPES 4
66 
67 #define CDP_MAX_RX_DEST_RINGS 8
68 #define CDP_MAX_TX_DATA_RINGS 5
69 #define CDP_MAX_WIFI_INT_ERROR_REASONS 5
70 /**
71  * This header file is being accessed in userspace applications.
72  * NR_CPUS is a linux kernel macro and cannot be accessible by user space apps.
73  * Defining maximum possible cpu count locally.
74  */
75 #define CDP_NR_CPUS 8
76 
77 #define MAX_TRANSMIT_TYPES	9
78 
79 #define MAX_USER_POS		8
80 #define MAX_MU_GROUP_ID		64
81 
82 #ifdef WLAN_FEATURE_11BE
83 #define MAX_RU_LOCATIONS	16
84 #else
85 #define MAX_RU_LOCATIONS	6
86 #endif
87 #define RU_26			1
88 #define RU_52			2
89 #define RU_106			4
90 #define RU_242			9
91 #define RU_484			18
92 #define RU_996			37
93 #ifdef WLAN_FEATURE_11BE
94 #define RU_2X996		74
95 #define RU_3X996		111
96 #define RU_4X996		148
97 #define RU_52_26		RU_52 + RU_26
98 #define RU_106_26		RU_106 + RU_26
99 #define RU_484_242		RU_484 + RU_242
100 #define RU_996_484		RU_996 + RU_484
101 #define RU_996_484_242		RU_996 + RU_484_242
102 #define RU_2X996_484		RU_2X996 + RU_484
103 #define RU_3X996_484		RU_3X996 + RU_484
104 #endif
105 
106 
107 /* WME stream classes */
108 #define WME_AC_BE    0    /* best effort */
109 #define WME_AC_BK    1    /* background */
110 #define WME_AC_VI    2    /* video */
111 #define WME_AC_VO    3    /* voice */
112 #define WME_AC_MAX   4    /* MAX AC Value */
113 
114 #define CDP_MAX_RX_RINGS 8  /* max rx rings */
115 #define CDP_MAX_TX_COMP_RINGS 5 /* max tx/completion rings */
116 
117 #define CDP_MAX_TX_TQM_STATUS 9  /* max tx tqm completion status */
118 #define CDP_MAX_TX_HTT_STATUS 7  /* max tx htt completion status */
119 
120 #define CDP_DMA_CODE_MAX 14 /* max rxdma error */
121 #define CDP_REO_CODE_MAX 15 /* max reo error */
122 
123 #define CDP_MAX_LMACS 2 /* max lmacs */
124 
125 /*
126  * Max of TxRx context
127  */
128 #define CDP_MAX_TXRX_CTX CDP_MAX_RX_RINGS
129 
130 /* TID level VoW stats macros
131  * to add and get stats
132  */
133 #define PFLOW_TXRX_TIDQ_STATS_ADD(_peer, _tid, _var, _val) \
134 	(((_peer)->tidq_stats[_tid]).stats[_var]) += _val
135 #define PFLOW_TXRX_TIDQ_STATS_GET(_peer, _tid, _var, _val) \
136 	((_peer)->tidq_stats[_tid].stats[_var])
137 /*
138  * Video only stats
139  */
140 #define PFLOW_CTRL_PDEV_VIDEO_STATS_SET(_pdev, _var, _val) \
141 	(((_pdev)->vow.vistats[_var]).value) = _val
142 #define PFLOW_CTRL_PDEV_VIDEO_STATS_GET(_pdev, _var) \
143 	((_pdev)->vow.vistats[_var].value)
144 #define PFLOW_CTRL_PDEV_VIDEO_STATS_ADD(_pdev, _var, _val) \
145 	(((_pdev)->vow.vistats[_var]).value) += _val
146 /*
147  * video delay stats
148  */
149 #define PFLOW_CTRL_PDEV_DELAY_VIDEO_STATS_SET(_pdev, _var, _val) \
150 	(((_pdev)->vow.delaystats[_var]).value) = _val
151 #define PFLOW_CTRL_PDEV_DELAY_VIDEO_STATS_GET(_pdev, _var) \
152 	((_pdev)->vow.delaystats[_var].value)
153 #define PFLOW_CTRL_PDEV_DELAY_VIDEO_STATS_ADD(_pdev, _var, _val) \
154 	(((_pdev)->vow.delaystats[_var]).value) += _val
155 /*
156  * Number of TLVs sent by FW. Needs to reflect
157  * HTT_PPDU_STATS_MAX_TAG declared in FW
158  */
159 #define CDP_PPDU_STATS_MAX_TAG 14
160 #define CDP_MAX_DATA_TIDS 9
161 #define CDP_MAX_VOW_TID 4
162 
163 #define CDP_MAX_TIDS 17
164 
165 #define CDP_WDI_NUM_EVENTS WDI_NUM_EVENTS
166 
167 #define CDP_FCTL_RETRY 0x0800
168 #define CDP_FC_IS_RETRY_SET(_fc) \
169 	((_fc) & qdf_cpu_to_le16(CDP_FCTL_RETRY))
170 
171 #define CDP_INVALID_SNR 255
172 
173 #define CDP_SNR_MULTIPLIER BIT(8)
174 #define CDP_SNR_MUL(x, mul) ((x) * (mul))
175 #define CDP_SNR_RND(x, mul) ((((x) % (mul)) >= ((mul) / 2)) ?\
176 	((x) + ((mul) - 1)) / (mul) : (x) / (mul))
177 
178 #define CDP_SNR_OUT(x) (CDP_SNR_RND((x), CDP_SNR_MULTIPLIER))
179 #define CDP_SNR_IN(x)  (CDP_SNR_MUL((x), CDP_SNR_MULTIPLIER))
180 #define CDP_SNR_AVG(x, y) ((((x) << 2) + (y) - (x)) >> 2)
181 
182 #define CDP_SNR_UPDATE_AVG(x, y) x = CDP_SNR_AVG((x), CDP_SNR_IN((y)))
183 
184 /*Max SU EVM count */
185 #define DP_RX_MAX_SU_EVM_COUNT 32
186 
187 #define WDI_EVENT_BASE 0x100
188 
189 #define CDP_TXRX_RATECODE_MCS_MASK 0xF
190 #define CDP_TXRX_RATECODE_NSS_MASK 0x3
191 #define CDP_TXRX_RATECODE_NSS_LSB 4
192 #define CDP_TXRX_RATECODE_PREM_MASK 0x3
193 #define CDP_TXRX_RATECODE_PREM_LSB 6
194 
195 /* Below BW_GAIN should be added to the SNR value of every ppdu based on the
196  * bandwidth. This table is obtained from HALPHY.
197  * BW         BW_Gain
198  * 20          0
199  * 40          3dBm
200  * 80          6dBm
201  * 160/80P80   9dBm
202  * 320         12dBm
203  */
204 
205 #define PKT_BW_GAIN_20MHZ 0
206 #define PKT_BW_GAIN_40MHZ 3
207 #define PKT_BW_GAIN_80MHZ 6
208 #define PKT_BW_GAIN_160MHZ 9
209 #ifdef WLAN_FEATURE_11BE
210 #define PKT_BW_GAIN_320MHZ 12
211 #endif
212 
213 /**
214  * This enum is a direct replica of hal_rxdma_error_code enum.
215  * New element addition to the enum need to make a entry in this enum too.
216  * enum cdp_wifi_error_code - Code describing the type of WIFI error detected
217  *
218  * @CDP_WIFI_ERR_OVERFLOW: MPDU frame is not complete due to overflow
219  * @CDP_WIFI_ERR_MPDU_LENGTH: MPDU frame is not complete due to receiving
220  * incomplete MPDU from the PHY
221  * @CDP_WIFI_ERR_FCS: FCS check on the MPDU frame failed
222  * @CDP_WIFI_ERR_DECRYPT: Decryption error
223  * @CDP_WIFI_ERR_TKIP_MIC: TKIP MIC error
224  * @CDP_WIFI_ERR_UNENCRYPTED: Received a frame that was expected to be
225  * encrypted but wasn’t
226  * @CDP_WIFI_ERR_MSDU_LEN: MSDU related length error
227  * @CDP_WIFI_ERR_MSDU_LIMIT: Number of MSDUs in the MPDUs exceeded the max
228  * allowed
229  * @CDP_WIFI_ERR_WIFI_PARSE: Wifi parsing error
230  * @CDP_WIFI_ERR_AMSDU_PARSE: Amsdu parsing error
231  * @CDP_WIFI_ERR_SA_TIMEOUT: Source Address search timeout
232  * @CDP_WIFI_ERR_DA_TIMEOUT: Destination Address search timeout
233  * @CDP_WIFI_ERR_FLOW_TIMEOUT: Flow Search Timeout
234  * @CDP_WIFI_ERR_FLUSH_REQUEST: Flush request error
235  * @CDP_WIFI_ERR_AMSDU_FRAGMENT: Reported A-MSDU present along with a fragmented
236  * MPDU
237  * @CDP_WIFI_ERR_MULTICAST_ECHO: Reported a multicast echo error
238  * @CDP_WIFI_ERR_DUMMY: Dummy errors
239  */
240 enum cdp_wifi_error_code {
241 	CDP_WIFI_ERR_OVERFLOW = 0,
242 	CDP_WIFI_ERR_MPDU_LENGTH,
243 	CDP_WIFI_ERR_FCS,
244 	CDP_WIFI_ERR_DECRYPT,
245 	CDP_WIFI_ERR_TKIP_MIC,
246 	CDP_WIFI_ERR_UNENCRYPTED,
247 	CDP_WIFI_ERR_MSDU_LEN,
248 	CDP_WIFI_ERR_MSDU_LIMIT,
249 	CDP_WIFI_ERR_WIFI_PARSE,
250 	CDP_WIFI_ERR_AMSDU_PARSE,
251 	CDP_WIFI_ERR_SA_TIMEOUT,
252 	CDP_WIFI_ERR_DA_TIMEOUT,
253 	CDP_WIFI_ERR_FLOW_TIMEOUT,
254 	CDP_WIFI_ERR_FLUSH_REQUEST,
255 	CDP_WIFI_ERR_AMSDU_FRAGMENT,
256 	CDP_WIFI_ERR_MULTICAST_ECHO,
257 	CDP_WIFI_ERR_DUMMY = 31,
258 	CDP_WIFI_ERR_MAX
259 };
260 
261 /**
262  * This enum is a direct replica of hal_reo_error_code enum.
263  * New element addition to the enum need to make a entry in this enum too.
264  * enum cdp_phy_rx_error_code - Error code describing the type of error detected
265  *
266  * @CDP_RX_ERR_QUEUE_ADDR_0: Rx queue descriptor is set to 0
267  * @CDP_RX_ERR_QUEUE_INVALID: Rx queue descriptor valid bit is NOT set
268  * @CDP_RX_ERR_AMPDU_IN_NON_BA: AMPDU frame received without BA session having
269  * been setup
270  * @CDP_RX_ERR_NON_BA_DUPLICATE: Non-BA session, SN equal to SSN retry bit set
271  * duplicate frame
272  * @CDP_RX_ERR_BA_DUPLICATE: BA session, duplicate frame
273  * @CDP_RX_ERR_REGULAR_FRAME_2K_JUMP: A normal management/data frame received
274  * with 2K jump in SN
275  * @CDP_RX_ERR_BAR_FRAME_2K_JUMP: A bar received with 2K jump in SSN
276  * @CDP_RX_ERR_REGULAR_FRAME_OOR: A normal management/data frame received with
277  * SN falling within the OOR window
278  * @CDP_RX_ERR_BAR_FRAME_OOR: A bar received with SSN falling within the OOR
279  * window
280  * @CDP_RX_ERR_BAR_FRAME_NO_BA_SESSION: A bar received without a BA session
281  * @CDP_RX_ERR_BAR_FRAME_SN_EQUALS_SSN: A bar received with SSN equal to SN
282  * @CDP_RX_ERR_PN_CHECK_FAILED: PN Check Failed packet
283  * @CDP_RX_ERR_2K_ERROR_HANDLING_FLAG_SET: Frame is forwarded as a result of
284  * the Seq_2k_error_detected_flag been set in the REO Queue descriptor
285  * @CDP_RX_ERR_PN_ERROR_HANDLING_FLAG_SET: Frame is forwarded as a result of
286  * the pn_error_detected_flag been set in the REO Queue descriptor
287  * @CDP_RX_ERR_QUEUE_BLOCKED_SET: Frame is forwarded as a result of the queue
288  * descriptor(address) being blocked as SW/FW seems to be currently in the
289  * process of making updates to this descriptor
290  */
291 enum cdp_phy_rx_error_code {
292 	CDP_RX_ERR_QUEUE_ADDR_0 = 0,
293 	CDP_RX_ERR_QUEUE_INVALID,
294 	CDP_RX_ERR_AMPDU_IN_NON_BA,
295 	CDP_RX_ERR_NON_BA_DUPLICATE,
296 	CDP_RX_ERR_BA_DUPLICATE,
297 	CDP_RX_ERR_REGULAR_FRAME_2K_JUMP,
298 	CDP_RX_ERR_BAR_FRAME_2K_JUMP,
299 	CDP_RX_ERR_REGULAR_FRAME_OOR,
300 	CDP_RX_ERR_BAR_FRAME_OOR,
301 	CDP_RX_ERR_BAR_FRAME_NO_BA_SESSION,
302 	CDP_RX_ERR_BAR_FRAME_SN_EQUALS_SSN,
303 	CDP_RX_ERR_PN_CHECK_FAILED,
304 	CDP_RX_ERR_2K_ERROR_HANDLING_FLAG_SET,
305 	CDP_RX_ERR_PN_ERROR_HANDLING_FLAG_SET,
306 	CDP_RX_ERR_QUEUE_BLOCKED_SET,
307 	CDP_RX_ERR_MAX
308 };
309 
310 /*
311  * cdp_tx_transmit_type: Transmit type index
312  * SU: SU Transmit type index
313  * MU_MIMO: MU_MIMO Transmit type index
314  * MU_OFDMA: MU_OFDMA Transmit type index
315  * MU_MIMO_OFDMA: MU MIMO OFDMA Transmit type index
316  */
317 enum cdp_tx_transmit_type {
318 	SU = 0,
319 	MU_MIMO,
320 	MU_OFDMA,
321 	MU_MIMO_OFDMA,
322 };
323 
324 /*
325  * cdp_ru_index: Different RU index
326  *
327  * RU_26_INDEX : 26-tone Resource Unit index
328  * RU_52_INDEX : 52-tone Resource Unit index
329  * RU_52_26_INDEX : 52_26-tone Resource Unit index
330  * RU_106_INDEX: 106-tone Resource Unit index
331  * RU_106_26_INDEX: 106_26-tone Resource Unit index
332  * RU_242_INDEX: 242-tone Resource Unit index
333  * RU_484_INDEX: 484-tone Resource Unit index
334  * RU_484_242_INDEX: 484_242-tone Resource Unit index
335  * RU_996_INDEX: 996-tone Resource Unit index
336  * RU_996_484_INDEX: 996_484-tone Resource Unit index
337  * RU_996_484_242_INDEX: 996_484_242-tone Resource Unit index
338  * RU_2X996_INDEX: 2X996-tone Resource Unit index
339  * RU_2X996_484_INDEX: 2X996_484-tone Resource Unit index
340  * RU_3X996_INDEX: 3X996-tone Resource Unit index
341  * RU_3X996_484_INDEX: 3X996_484-tone Resource Unit index
342  * RU_4X996_INDEX: 4X996-tone Resource Unit index
343  */
344 
345 #ifdef WLAN_FEATURE_11BE
346 enum cdp_ru_index {
347 	RU_26_INDEX = 0,
348 	RU_52_INDEX,
349 	RU_52_26_INDEX,
350 	RU_106_INDEX,
351 	RU_106_26_INDEX,
352 	RU_242_INDEX,
353 	RU_484_INDEX,
354 	RU_484_242_INDEX,
355 	RU_996_INDEX,
356 	RU_996_484_INDEX,
357 	RU_996_484_242_INDEX,
358 	RU_2X996_INDEX,
359 	RU_2X996_484_INDEX,
360 	RU_3X996_INDEX,
361 	RU_3X996_484_INDEX,
362 	RU_4X996_INDEX,
363 	RU_INDEX_MAX,
364 };
365 #else
366 enum cdp_ru_index {
367 	RU_26_INDEX = 0,
368 	RU_52_INDEX,
369 	RU_106_INDEX,
370 	RU_242_INDEX,
371 	RU_484_INDEX,
372 	RU_996_INDEX,
373 	RU_INDEX_MAX,
374 };
375 #endif
376 
377 struct cdp_ru_debug {
378 	char *ru_type;
379 };
380 
381 #ifdef WLAN_FEATURE_11BE
382 static const struct cdp_ru_debug cdp_ru_string[RU_INDEX_MAX] = {
383 	{ "RU_26" },
384 	{ "RU_52" },
385 	{ "RU_52_26" },
386 	{ "RU_106" },
387 	{ "RU_106_26" },
388 	{ "RU_242" },
389 	{ "RU_484" },
390 	{ "RU_484_242" },
391 	{ "RU_996" },
392 	{ "RU_996_484" },
393 	{ "RU_996_484_242" },
394 	{ "RU_2x996" },
395 	{ "RU_2x996_484" },
396 	{ "RU_3x996" },
397 	{ "RU_3x996_484" },
398 	{ "RU_4x996" },
399 };
400 #else
401 static const struct cdp_ru_debug cdp_ru_string[RU_INDEX_MAX] = {
402 	{ "RU_26" },
403 	{ "RU_52" },
404 	{ "RU_106" },
405 	{ "RU_242" },
406 	{ "RU_484" },
407 	{ "RU_996" }
408 };
409 #endif
410 
411 #ifdef FEATURE_TSO_STATS
412 /* Number of TSO Packet Statistics captured */
413 #define CDP_MAX_TSO_PACKETS 5
414 /* Information for Number of Segments for a TSO Packet captured */
415 #define CDP_MAX_TSO_SEGMENTS 2
416 /* Information for Number of Fragments for a TSO Segment captured */
417 #define CDP_MAX_TSO_FRAGMENTS 6
418 #endif /* FEATURE_TSO_STATS */
419 
420 /* Different Packet Types */
421 enum cdp_packet_type {
422 	DOT11_A = 0,
423 	DOT11_B = 1,
424 	DOT11_N = 2,
425 	DOT11_AC = 3,
426 	DOT11_AX = 4,
427 #ifdef WLAN_FEATURE_11BE
428 	DOT11_BE = 5,
429 #endif
430 	DOT11_MAX,
431 };
432 
433 #define MCS_VALID 1
434 #define MCS_INVALID 0
435 
436 #ifdef WLAN_FEATURE_11BE
437 #define CDP_IS_PKT_TYPE_SUPPORT_NSS(_pkt_type) \
438 		(DOT11_N == (_pkt_type) || DOT11_AC == (_pkt_type) || \
439 		 DOT11_AX == (_pkt_type) || DOT11_BE == (_pkt_type))
440 #else
441 #define CDP_IS_PKT_TYPE_SUPPORT_NSS(_pkt_type) \
442 		(DOT11_N == (_pkt_type) || DOT11_AC == (_pkt_type) || \
443 		 DOT11_AX == (_pkt_type))
444 #endif /* WLAN_FEATURE_11BE */
445 
446 #define CDP_MAX_MCS_STRING_LEN 34
447 /*
448  * struct cdp_rate_debug
449  *
450  * @mcs_type: print string for a given mcs
451  * @valid: valid mcs rate?
452  */
453 struct cdp_rate_debug {
454 	char mcs_type[CDP_MAX_MCS_STRING_LEN];
455 	uint8_t valid;
456 };
457 
458 #ifdef WLAN_FEATURE_11BE
459 static const struct cdp_rate_debug cdp_rate_string[DOT11_MAX][MAX_MCS] = {
460 	{
461 		{"OFDM 48 Mbps", MCS_VALID},
462 		{"OFDM 24 Mbps", MCS_VALID},
463 		{"OFDM 12 Mbps", MCS_VALID},
464 		{"OFDM 6 Mbps ", MCS_VALID},
465 		{"OFDM 54 Mbps", MCS_VALID},
466 		{"OFDM 36 Mbps", MCS_VALID},
467 		{"OFDM 18 Mbps", MCS_VALID},
468 		{"OFDM 9 Mbps ", MCS_VALID},
469 		{"INVALID ", MCS_INVALID},
470 		{"INVALID ", MCS_INVALID},
471 		{"INVALID ", MCS_INVALID},
472 		{"INVALID ", MCS_INVALID},
473 		{"INVALID ", MCS_INVALID},
474 		{"INVALID ", MCS_INVALID},
475 		{"INVALID ", MCS_INVALID},
476 		{"INVALID ", MCS_INVALID},
477 		{"INVALID ", MCS_INVALID},
478 	},
479 	{
480 		{"CCK 11 Mbps Long  ", MCS_VALID},
481 		{"CCK 5.5 Mbps Long ", MCS_VALID},
482 		{"CCK 2 Mbps Long   ", MCS_VALID},
483 		{"CCK 1 Mbps Long   ", MCS_VALID},
484 		{"CCK 11 Mbps Short ", MCS_VALID},
485 		{"CCK 5.5 Mbps Short", MCS_VALID},
486 		{"CCK 2 Mbps Short  ", MCS_VALID},
487 		{"INVALID ", MCS_INVALID},
488 		{"INVALID ", MCS_INVALID},
489 		{"INVALID ", MCS_INVALID},
490 		{"INVALID ", MCS_INVALID},
491 		{"INVALID ", MCS_INVALID},
492 		{"INVALID ", MCS_INVALID},
493 		{"INVALID ", MCS_INVALID},
494 		{"INVALID ", MCS_INVALID},
495 		{"INVALID ", MCS_INVALID},
496 		{"INVALID ", MCS_INVALID},
497 	},
498 	{
499 		{"HT MCS 0 (BPSK 1/2)  ", MCS_VALID},
500 		{"HT MCS 1 (QPSK 1/2)  ", MCS_VALID},
501 		{"HT MCS 2 (QPSK 3/4)  ", MCS_VALID},
502 		{"HT MCS 3 (16-QAM 1/2)", MCS_VALID},
503 		{"HT MCS 4 (16-QAM 3/4)", MCS_VALID},
504 		{"HT MCS 5 (64-QAM 2/3)", MCS_VALID},
505 		{"HT MCS 6 (64-QAM 3/4)", MCS_VALID},
506 		{"HT MCS 7 (64-QAM 5/6)", MCS_VALID},
507 		{"INVALID ", MCS_INVALID},
508 		{"INVALID ", MCS_INVALID},
509 		{"INVALID ", MCS_INVALID},
510 		{"INVALID ", MCS_INVALID},
511 		{"INVALID ", MCS_INVALID},
512 		{"INVALID ", MCS_INVALID},
513 		{"INVALID ", MCS_INVALID},
514 		{"INVALID ", MCS_INVALID},
515 		{"INVALID ", MCS_INVALID},
516 	},
517 	{
518 		{"VHT MCS 0 (BPSK 1/2)     ", MCS_VALID},
519 		{"VHT MCS 1 (QPSK 1/2)     ", MCS_VALID},
520 		{"VHT MCS 2 (QPSK 3/4)     ", MCS_VALID},
521 		{"VHT MCS 3 (16-QAM 1/2)   ", MCS_VALID},
522 		{"VHT MCS 4 (16-QAM 3/4)   ", MCS_VALID},
523 		{"VHT MCS 5 (64-QAM 2/3)   ", MCS_VALID},
524 		{"VHT MCS 6 (64-QAM 3/4)   ", MCS_VALID},
525 		{"VHT MCS 7 (64-QAM 5/6)   ", MCS_VALID},
526 		{"VHT MCS 8 (256-QAM 3/4)  ", MCS_VALID},
527 		{"VHT MCS 9 (256-QAM 5/6)  ", MCS_VALID},
528 		{"VHT MCS 10 (1024-QAM 3/4)", MCS_VALID},
529 		{"VHT MCS 11 (1024-QAM 5/6)", MCS_VALID},
530 		{"INVALID ", MCS_INVALID},
531 		{"INVALID ", MCS_INVALID},
532 		{"INVALID ", MCS_INVALID},
533 		{"INVALID ", MCS_INVALID},
534 	},
535 	{
536 		{"HE MCS 0 (BPSK 1/2)     ", MCS_VALID},
537 		{"HE MCS 1 (QPSK 1/2)     ", MCS_VALID},
538 		{"HE MCS 2 (QPSK 3/4)     ", MCS_VALID},
539 		{"HE MCS 3 (16-QAM 1/2)   ", MCS_VALID},
540 		{"HE MCS 4 (16-QAM 3/4)   ", MCS_VALID},
541 		{"HE MCS 5 (64-QAM 2/3)   ", MCS_VALID},
542 		{"HE MCS 6 (64-QAM 3/4)   ", MCS_VALID},
543 		{"HE MCS 7 (64-QAM 5/6)   ", MCS_VALID},
544 		{"HE MCS 8 (256-QAM 3/4)  ", MCS_VALID},
545 		{"HE MCS 9 (256-QAM 5/6)  ", MCS_VALID},
546 		{"HE MCS 10 (1024-QAM 3/4)", MCS_VALID},
547 		{"HE MCS 11 (1024-QAM 5/6)", MCS_VALID},
548 		{"HE MCS 12 (4096-QAM 3/4)", MCS_VALID},
549 		{"HE MCS 13 (4096-QAM 5/6)", MCS_VALID},
550 		{"INVALID ", MCS_INVALID},
551 		{"INVALID ", MCS_INVALID},
552 		{"INVALID ", MCS_INVALID},
553 	},
554 	{
555 		{"EHT MCS 0 (BPSK 1/2)     ", MCS_VALID},
556 		{"EHT MCS 1 (QPSK 1/2)     ", MCS_VALID},
557 		{"EHT MCS 2 (QPSK 3/4)     ", MCS_VALID},
558 		{"EHT MCS 3 (16-QAM 1/2)   ", MCS_VALID},
559 		{"EHT MCS 4 (16-QAM 3/4)   ", MCS_VALID},
560 		{"EHT MCS 5 (64-QAM 2/3)   ", MCS_VALID},
561 		{"EHT MCS 6 (64-QAM 3/4)   ", MCS_VALID},
562 		{"EHT MCS 7 (64-QAM 5/6)   ", MCS_VALID},
563 		{"EHT MCS 8 (256-QAM 3/4)  ", MCS_VALID},
564 		{"EHT MCS 9 (256-QAM 5/6)  ", MCS_VALID},
565 		{"EHT MCS 10 (1024-QAM 3/4)", MCS_VALID},
566 		{"EHT MCS 11 (1024-QAM 5/6)", MCS_VALID},
567 		{"EHT MCS 12 (4096-QAM 3/4)", MCS_VALID},
568 		{"EHT MCS 13 (4096-QAM 5/6)", MCS_VALID},
569 		{"EHT MCS 14 (BPSK-DCM 1/2)", MCS_VALID},
570 		{"EHT MCS 15 (BPSK-DCM 1/2)", MCS_VALID},
571 		{"INVALID ", MCS_INVALID},
572 	}
573 };
574 #else
575 static const struct cdp_rate_debug cdp_rate_string[DOT11_MAX][MAX_MCS] = {
576 	{
577 		{"OFDM 48 Mbps", MCS_VALID},
578 		{"OFDM 24 Mbps", MCS_VALID},
579 		{"OFDM 12 Mbps", MCS_VALID},
580 		{"OFDM 6 Mbps ", MCS_VALID},
581 		{"OFDM 54 Mbps", MCS_VALID},
582 		{"OFDM 36 Mbps", MCS_VALID},
583 		{"OFDM 18 Mbps", MCS_VALID},
584 		{"OFDM 9 Mbps ", MCS_VALID},
585 		{"INVALID ", MCS_INVALID},
586 		{"INVALID ", MCS_INVALID},
587 		{"INVALID ", MCS_INVALID},
588 		{"INVALID ", MCS_INVALID},
589 		{"INVALID ", MCS_INVALID},
590 	},
591 	{
592 		{"CCK 11 Mbps Long  ", MCS_VALID},
593 		{"CCK 5.5 Mbps Long ", MCS_VALID},
594 		{"CCK 2 Mbps Long   ", MCS_VALID},
595 		{"CCK 1 Mbps Long   ", MCS_VALID},
596 		{"CCK 11 Mbps Short ", MCS_VALID},
597 		{"CCK 5.5 Mbps Short", MCS_VALID},
598 		{"CCK 2 Mbps Short  ", MCS_VALID},
599 		{"INVALID ", MCS_INVALID},
600 		{"INVALID ", MCS_INVALID},
601 		{"INVALID ", MCS_INVALID},
602 		{"INVALID ", MCS_INVALID},
603 		{"INVALID ", MCS_INVALID},
604 		{"INVALID ", MCS_INVALID},
605 	},
606 	{
607 		{"HT MCS 0 (BPSK 1/2)  ", MCS_VALID},
608 		{"HT MCS 1 (QPSK 1/2)  ", MCS_VALID},
609 		{"HT MCS 2 (QPSK 3/4)  ", MCS_VALID},
610 		{"HT MCS 3 (16-QAM 1/2)", MCS_VALID},
611 		{"HT MCS 4 (16-QAM 3/4)", MCS_VALID},
612 		{"HT MCS 5 (64-QAM 2/3)", MCS_VALID},
613 		{"HT MCS 6 (64-QAM 3/4)", MCS_VALID},
614 		{"HT MCS 7 (64-QAM 5/6)", MCS_VALID},
615 		{"INVALID ", MCS_INVALID},
616 		{"INVALID ", MCS_INVALID},
617 		{"INVALID ", MCS_INVALID},
618 		{"INVALID ", MCS_INVALID},
619 		{"INVALID ", MCS_INVALID},
620 	},
621 	{
622 		{"VHT MCS 0 (BPSK 1/2)     ", MCS_VALID},
623 		{"VHT MCS 1 (QPSK 1/2)     ", MCS_VALID},
624 		{"VHT MCS 2 (QPSK 3/4)     ", MCS_VALID},
625 		{"VHT MCS 3 (16-QAM 1/2)   ", MCS_VALID},
626 		{"VHT MCS 4 (16-QAM 3/4)   ", MCS_VALID},
627 		{"VHT MCS 5 (64-QAM 2/3)   ", MCS_VALID},
628 		{"VHT MCS 6 (64-QAM 3/4)   ", MCS_VALID},
629 		{"VHT MCS 7 (64-QAM 5/6)   ", MCS_VALID},
630 		{"VHT MCS 8 (256-QAM 3/4)  ", MCS_VALID},
631 		{"VHT MCS 9 (256-QAM 5/6)  ", MCS_VALID},
632 		{"VHT MCS 10 (1024-QAM 3/4)", MCS_VALID},
633 		{"VHT MCS 11 (1024-QAM 5/6)", MCS_VALID},
634 		{"INVALID ", MCS_INVALID},
635 	},
636 	{
637 		{"HE MCS 0 (BPSK 1/2)     ", MCS_VALID},
638 		{"HE MCS 1 (QPSK 1/2)     ", MCS_VALID},
639 		{"HE MCS 2 (QPSK 3/4)     ", MCS_VALID},
640 		{"HE MCS 3 (16-QAM 1/2)   ", MCS_VALID},
641 		{"HE MCS 4 (16-QAM 3/4)   ", MCS_VALID},
642 		{"HE MCS 5 (64-QAM 2/3)   ", MCS_VALID},
643 		{"HE MCS 6 (64-QAM 3/4)   ", MCS_VALID},
644 		{"HE MCS 7 (64-QAM 5/6)   ", MCS_VALID},
645 		{"HE MCS 8 (256-QAM 3/4)  ", MCS_VALID},
646 		{"HE MCS 9 (256-QAM 5/6)  ", MCS_VALID},
647 		{"HE MCS 10 (1024-QAM 3/4)", MCS_VALID},
648 		{"HE MCS 11 (1024-QAM 5/6)", MCS_VALID},
649 		{"HE MCS 12 (4096-QAM 3/4)", MCS_VALID},
650 		{"HE MCS 13 (4096-QAM 5/6)", MCS_VALID},
651 		{"INVALID ", MCS_INVALID},
652 	}
653 };
654 #endif
655 
656 /*
657  * cdp_mu_packet_type: MU type index
658  * TXRX_TYPE_MU_MIMO: MU MIMO type index
659  * TXRX_TYPE_MU_OFDMA: MU OFDMA type index
660  * TXRX_TYPE_MU_MAX: MU MAX type index
661  */
662 enum cdp_mu_packet_type {
663 	TXRX_TYPE_MU_MIMO = 0,
664 	TXRX_TYPE_MU_OFDMA = 1,
665 	TXRX_TYPE_MU_MAX = 2,
666 };
667 
668 /*
669  * peer_stats_type: peer stats type
670  * PEER_TX_STATS: stats type for tx
671  * PEER_RX_STATS: stats type for rx
672  */
673 enum peer_stats_type {
674 	PEER_TX_STATS,
675 	PEER_RX_STATS,
676 };
677 
678 enum WDI_EVENT {
679 	WDI_EVENT_TX_STATUS = WDI_EVENT_BASE,
680 	WDI_EVENT_OFFLOAD_ALL,
681 	WDI_EVENT_RX_DESC_REMOTE,
682 	WDI_EVENT_RX_PEER_INVALID,
683 	WDI_EVENT_DBG_PRINT, /* NEED to integrate pktlog changes*/
684 	WDI_EVENT_RX_CBF_REMOTE,
685 	WDI_EVENT_RATE_FIND,
686 	WDI_EVENT_RATE_UPDATE,
687 	WDI_EVENT_SW_EVENT,
688 	WDI_EVENT_RX_DESC,
689 	WDI_EVENT_LITE_T2H,
690 	WDI_EVENT_LITE_RX,
691 	WDI_EVENT_RX_PPDU_DESC,
692 	WDI_EVENT_TX_PPDU_DESC,
693 	WDI_EVENT_TX_MSDU_DESC,
694 	WDI_EVENT_TX_DATA,
695 	WDI_EVENT_RX_DATA,
696 	WDI_EVENT_TX_MGMT_CTRL,
697 	WDI_EVENT_TX_PKT_CAPTURE,
698 	WDI_EVENT_HTT_STATS,
699 	WDI_EVENT_TX_BEACON,
700 	WDI_EVENT_PEER_STATS,
701 	WDI_EVENT_TX_SOJOURN_STAT,
702 	WDI_EVENT_UPDATE_DP_STATS,
703 	WDI_EVENT_RX_MGMT_CTRL,
704 	WDI_EVENT_PEER_CREATE,
705 	WDI_EVENT_PEER_DESTROY,
706 	WDI_EVENT_PEER_FLUSH_RATE_STATS,
707 	WDI_EVENT_FLUSH_RATE_STATS_REQ,
708 	WDI_EVENT_RX_MPDU,
709 	WDI_EVENT_HMWDS_AST_ADD_STATUS,
710 	WDI_EVENT_PEER_QOS_STATS,
711 	WDI_EVENT_PKT_CAPTURE_TX_DATA,
712 	WDI_EVENT_PKT_CAPTURE_RX_DATA,
713 	WDI_EVENT_PKT_CAPTURE_RX_DATA_NO_PEER,
714 	WDI_EVENT_PKT_CAPTURE_OFFLOAD_TX_DATA,
715 	WDI_EVENT_RX_CBF,
716 	WDI_EVENT_PKT_CAPTURE_PPDU_STATS,
717 	WDI_EVENT_HOST_SW_EVENT,
718 	WDI_EVENT_HYBRID_TX,
719 #ifdef WLAN_FEATURE_11BE_MLO
720 	WDI_EVENT_MLO_TSTMP,
721 #endif
722 #ifdef QCA_UNDECODED_METADATA_SUPPORT
723 	WDI_EVENT_RX_PPDU_DESC_UNDECODED_METADATA,
724 #endif
725 	WDI_EVENT_LITE_MON_RX,
726 	WDI_EVENT_LITE_MON_TX,
727 	/* End of new event items */
728 	WDI_EVENT_LAST
729 };
730 
731 #define WDI_NUM_EVENTS WDI_EVENT_LAST - WDI_EVENT_BASE
732 
733 struct cdp_stats_extd {
734 };
735 
736 /* TID level Tx/Rx stats
737  *
738  */
739 enum cdp_txrx_tidq_stats {
740 	/* Tx Counters */
741 	TX_MSDU_TOTAL_LINUX_SUBSYSTEM,
742 	TX_MSDU_TOTAL_FROM_OSIF,
743 	TX_MSDU_TX_COMP_PKT_CNT,
744 	/* Rx Counters */
745 	RX_MSDU_TOTAL_FROM_FW,
746 	RX_MSDU_MCAST_FROM_FW,
747 	RX_TID_MISMATCH_FROM_FW,
748 	RX_MSDU_MISC_PKTS,
749 	RX_MSDU_IS_ARP,
750 	RX_MSDU_IS_EAP,
751 	RX_MSDU_IS_DHCP,
752 	RX_AGGREGATE_10,
753 	RX_AGGREGATE_20,
754 	RX_AGGREGATE_30,
755 	RX_AGGREGATE_40,
756 	RX_AGGREGATE_50,
757 	RX_AGGREGATE_60,
758 	RX_AGGREGATE_MORE,
759 	RX_AMSDU_1,
760 	RX_AMSDU_2,
761 	RX_AMSDU_3,
762 	RX_AMSDU_4,
763 	RX_AMSDU_MORE,
764 	RX_MSDU_CHAINED_FROM_FW,
765 	RX_MSDU_REORDER_FAILED_FROM_FW,
766 	RX_MSDU_REORDER_FLUSHED_FROM_FW,
767 	RX_MSDU_DISCARD_FROM_FW,
768 	RX_MSDU_DUPLICATE_FROM_FW,
769 	RX_MSDU_DELIVERED_TO_STACK,
770 	TIDQ_STATS_MAX,
771 };
772 
773 struct cdp_tidq_stats {
774 	uint32_t stats[TIDQ_STATS_MAX];
775 };
776 
777 #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
778 /**
779  * struct cdp_rx_ppdu_cfr_info - struct for storing ppdu info extracted from HW
780  * TLVs, this will be used for CFR correlation
781  *
782  * @bb_captured_channel : Set by RXPCU when MACRX_FREEZE_CAPTURE_CHANNEL TLV is
783  * sent to PHY, SW checks it to correlate current PPDU TLVs with uploaded
784  * channel information.
785  *
786  * @bb_captured_timeout : Set by RxPCU to indicate channel capture condition is
787  * met, but MACRX_FREEZE_CAPTURE_CHANNEL is not sent to PHY due to AST delay,
788  * which means the rx_frame_falling edge to FREEZE TLV ready time exceeds
789  * the threshold time defined by RXPCU register FREEZE_TLV_DELAY_CNT_THRESH.
790  * Bb_captured_reason is still valid in this case.
791  *
792  * @bb_captured_reason : Copy capture_reason of MACRX_FREEZE_CAPTURE_CHANNEL
793  * TLV to here for FW usage. Valid when bb_captured_channel or
794  * bb_captured_timeout is set.
795  * <enum 0 freeze_reason_TM>
796  * <enum 1 freeze_reason_FTM>
797  * <enum 2 freeze_reason_ACK_resp_to_TM_FTM>
798  * <enum 3 freeze_reason_TA_RA_TYPE_FILTER>
799  * <enum 4 freeze_reason_NDPA_NDP>
800  * <enum 5 freeze_reason_ALL_PACKET>
801  * <legal 0-5>
802  *
803  * @rx_location_info_valid: Indicates whether CFR DMA address in the PPDU TLV
804  * is valid
805  * <enum 0 rx_location_info_is_not_valid>
806  * <enum 1 rx_location_info_is_valid>
807  * <legal all>
808  *
809  * @chan_capture_status : capture status reported by ucode
810  * a. CAPTURE_IDLE: FW has disabled "REPETITIVE_CHE_CAPTURE_CTRL"
811  * b. CAPTURE_BUSY: previous PPDU’s channel capture upload DMA ongoing. (Note
812  * that this upload is triggered after receiving freeze_channel_capture TLV
813  * after last PPDU is rx)
814  * c. CAPTURE_ACTIVE: channel capture is enabled and no previous channel
815  * capture ongoing
816  * d. CAPTURE_NO_BUFFER: next buffer in IPC ring not available
817  *
818  * @rtt_che_buffer_pointer_high8 : The high 8 bits of the 40 bits pointer to
819  * external RTT channel information buffer
820  *
821  * @rtt_che_buffer_pointer_low32 : The low 32 bits of the 40 bits pointer to
822  * external RTT channel information buffer
823  *
824  * @rtt_cfo_measurement : raw cfo data extracted from hardware, which is 14 bit
825  * signed number. The first bit used for sign representation and 13 bits for
826  * fractional part.
827  *
828  * @agc_gain_info0: Chain 0 & chain 1 agc gain information reported by PHY
829  *
830  * @agc_gain_info1: Chain 2 & chain 3 agc gain information reported by PHY
831  *
832  * @agc_gain_info2: Chain 4 & chain 5 agc gain information reported by PHY
833  *
834  * @agc_gain_info3: Chain 6 & chain 7 agc gain information reported by PHY
835  *
836  * @rx_start_ts: Rx packet timestamp, the time the first L-STF ADC sample
837  * arrived at Rx antenna.
838  *
839  * @mcs_rate: Indicates the mcs/rate in which packet is received.
840  * If HT,
841  *    0-7: MCS0-MCS7
842  * If VHT,
843  *    0-9: MCS0 to MCS9
844  * If HE,
845  *    0-11: MCS0 to MCS11,
846  *    12-13: 4096QAM,
847  *    14-15: reserved
848  * If Legacy,
849  *    0: 48 Mbps
850  *    1: 24 Mbps
851  *    2: 12 Mbps
852  *    3: 6 Mbps
853  *    4: 54 Mbps
854  *    5: 36 Mbps
855  *    6: 18 Mbps
856  *    7: 9 Mbps
857  *
858  * @gi_type: Indicates the gaurd interval.
859  *    0: 0.8 us
860  *    1: 0.4 us
861  *    2: 1.6 us
862  *    3: 3.2 us
863  */
864 struct cdp_rx_ppdu_cfr_info {
865 	bool bb_captured_channel;
866 	bool bb_captured_timeout;
867 	uint8_t bb_captured_reason;
868 	bool rx_location_info_valid;
869 	uint8_t chan_capture_status;
870 	uint8_t rtt_che_buffer_pointer_high8;
871 	uint32_t rtt_che_buffer_pointer_low32;
872 	int16_t rtt_cfo_measurement;
873 	uint32_t agc_gain_info0;
874 	uint32_t agc_gain_info1;
875 	uint32_t agc_gain_info2;
876 	uint32_t agc_gain_info3;
877 	uint32_t rx_start_ts;
878 	uint32_t mcs_rate;
879 	uint32_t gi_type;
880 };
881 #endif
882 /*
883  * struct cdp_rx_su_evm_info: Rx evm info
884  * @number_of_symbols: number of symbols
885  * @nss_count: number of spatial streams
886  * @pilot_count: number of pilot count
887  */
888 struct cdp_rx_su_evm_info {
889 	uint16_t number_of_symbols;
890 	uint8_t  nss_count;
891 	uint8_t  pilot_count;
892 	uint32_t pilot_evm[DP_RX_MAX_SU_EVM_COUNT];
893 };
894 
895 /*
896  * cdp_delay_stats_mode: Different types of delay statistics
897  *
898  * @CDP_DELAY_STATS_SW_ENQ: Stack to hw enqueue delay
899  * @CDP_DELAY_STATS_TX_INTERFRAME: Interframe delay at radio entry point
900  * @CDP_DELAY_STATS_FW_HW_TRANSMIT: Hw enqueue to tx completion delay
901  * @CDP_DELAY_STATS_REAP_STACK: Delay in ring reap to indicating network stack
902  * @CDP_DELAY_STATS_RX_INTERFRAME: Rx inteframe delay
903  * @CDP_DELAY_STATS_MODE_MAX: Maximum delay mode
904  */
905 enum cdp_delay_stats_mode {
906 	CDP_DELAY_STATS_SW_ENQ,
907 	CDP_DELAY_STATS_TX_INTERFRAME,
908 	CDP_DELAY_STATS_FW_HW_TRANSMIT,
909 	CDP_DELAY_STATS_REAP_STACK,
910 	CDP_DELAY_STATS_RX_INTERFRAME,
911 	CDP_DELAY_STATS_MODE_MAX,
912 };
913 
914 /*
915  * cdp_delay_bucket_index
916  *	Index to be used for all delay stats
917  */
918 enum cdp_delay_bucket_index {
919 	CDP_DELAY_BUCKET_0,
920 	CDP_DELAY_BUCKET_1,
921 	CDP_DELAY_BUCKET_2,
922 	CDP_DELAY_BUCKET_3,
923 	CDP_DELAY_BUCKET_4,
924 	CDP_DELAY_BUCKET_5,
925 	CDP_DELAY_BUCKET_6,
926 	CDP_DELAY_BUCKET_7,
927 	CDP_DELAY_BUCKET_8,
928 	CDP_DELAY_BUCKET_9,
929 	CDP_DELAY_BUCKET_10,
930 	CDP_DELAY_BUCKET_11,
931 	CDP_DELAY_BUCKET_12,
932 	CDP_DELAY_BUCKET_MAX,
933 };
934 
935 /*
936  * struct cdp_tx_host_drop - packet drop due to following reasons.
937  */
938 enum cdp_tx_sw_drop {
939 	TX_DESC_ERR,
940 	TX_HAL_RING_ACCESS_ERR,
941 	TX_DMA_MAP_ERR,
942 	TX_HW_ENQUEUE,
943 	TX_SW_ENQUEUE,
944 	TX_MAX_DROP,
945 };
946 
947 /*
948  * struct cdp_rx_host_drop - packet drop due to following reasons.
949  */
950 enum cdp_rx_sw_drop {
951 	INTRABSS_DROP,
952 	MSDU_DONE_FAILURE,
953 	INVALID_PEER_VDEV,
954 	POLICY_CHECK_DROP,
955 	MEC_DROP,
956 	NAWDS_MCAST_DROP,
957 	MESH_FILTER_DROP,
958 	ENQUEUE_DROP,
959 	RX_MAX_DROP,
960 };
961 
962 /*
963  * struct cdp_delay_stats
964  * @delay_bucket: division of buckets as per latency
965  * @min_delay: minimum delay
966  * @max_delay: maximum delay
967  * @avg_delay: average delay
968  */
969 struct cdp_delay_stats {
970 	uint64_t delay_bucket[CDP_DELAY_BUCKET_MAX];
971 	uint32_t min_delay;
972 	uint32_t max_delay;
973 	uint32_t avg_delay;
974 };
975 
976 /*
977  * struct cdp_tid_tx_stats
978  * @swq_delay: delay between wifi driver entry point and enqueue to HW in tx
979  * @hwtx_delay: delay between wifi driver exit (enqueue to HW) and tx completion
980  * @intfrm_delay: interframe delay
981  * @success_cnt: total successful transmit count
982  * @comp_fail_cnt: firmware drop found in tx completion path
983  * @swdrop_cnt: software drop in tx path
984  * @tqm_status_cnt: TQM completion status count
985  * @htt_status_cnt: HTT completion status count
986  */
987 struct cdp_tid_tx_stats {
988 	struct cdp_delay_stats swq_delay;
989 	struct cdp_delay_stats hwtx_delay;
990 	struct cdp_delay_stats intfrm_delay;
991 	uint64_t success_cnt;
992 	uint64_t comp_fail_cnt;
993 	uint64_t swdrop_cnt[TX_MAX_DROP];
994 	uint64_t tqm_status_cnt[CDP_MAX_TX_TQM_STATUS];
995 	uint64_t htt_status_cnt[CDP_MAX_TX_HTT_STATUS];
996 };
997 
998 /*
999  * cdp_reo_error_stats
1000  * @err_src_reo_code_inv: Wireless Buffer Manager source receive reorder ring reason unknown
1001  * @err_reo_codes: Receive reoder error codes
1002  */
1003 struct cdp_reo_error_stats {
1004 	uint64_t err_src_reo_code_inv;
1005 	uint64_t err_reo_codes[CDP_REO_CODE_MAX];
1006 };
1007 
1008 /*
1009  * cdp_rxdma_error_stats
1010  * @err_src_rxdma_code_inv: DMA reason unknown count
1011  * @err_reo_codes: Receive reoder error codes count
1012  */
1013 struct cdp_rxdma_error_stats {
1014 	uint64_t err_src_rxdma_code_inv;
1015 	uint64_t err_dma_codes[CDP_DMA_CODE_MAX];
1016 };
1017 
1018 /*
1019  * struct cdp_tid_tx_stats
1020  * @to_stack_delay: Time taken between ring reap to indication to network stack
1021  * @intfrm_delay: Interframe rx delay
1022  * @delivered_cnt: Total packets indicated to stack
1023  * @intrabss_cnt: Rx total intraBSS frames
1024  * @msdu_cnt: number of msdu received from HW
1025  * @mcast_msdu_cnt: Num Mcast Msdus received from HW in Rx
1026  * @bcast_msdu_cnt: Num Bcast Msdus received from HW in Rx
1027  * @fail_cnt: Rx deliver drop counters
1028  * @reo_err: V3 reo error statistics
1029  * @rxdma_err: V3 rxdma error statistics
1030  */
1031 struct cdp_tid_rx_stats {
1032 	struct cdp_delay_stats to_stack_delay;
1033 	struct cdp_delay_stats intfrm_delay;
1034 	uint64_t delivered_to_stack;
1035 	uint64_t intrabss_cnt;
1036 	uint64_t msdu_cnt;
1037 	uint64_t mcast_msdu_cnt;
1038 	uint64_t bcast_msdu_cnt;
1039 	uint64_t fail_cnt[RX_MAX_DROP];
1040 	struct cdp_reo_error_stats reo_err;
1041 	struct cdp_rxdma_error_stats rxdma_err;
1042 };
1043 
1044 /*
1045  * struct cdp_tid_stats
1046  * @ingress_stack: Total packets received from linux stack
1047  * @osif_drop: drops in osif layer
1048  * @tid_tx_stats: transmit counters per tid
1049  * @tid_rx_stats: receive counters per tid
1050  */
1051 struct cdp_tid_stats {
1052 	uint64_t ingress_stack;
1053 	uint64_t osif_drop;
1054 	struct cdp_tid_tx_stats tid_tx_stats[CDP_MAX_TX_COMP_RINGS]
1055 					    [CDP_MAX_DATA_TIDS];
1056 	struct cdp_tid_rx_stats tid_rx_stats[CDP_MAX_RX_RINGS]
1057 					    [CDP_MAX_DATA_TIDS];
1058 };
1059 
1060 /*
1061  * struct cdp_tid_stats_intf
1062  * @ingress_stack: Total packets received from linux stack
1063  * @osif_drop: drops in osif layer
1064  * @tx_total: total of per ring transmit counters per tid
1065  * @rx_total: total of per ring receive counters per tid
1066  */
1067 struct cdp_tid_stats_intf {
1068 	uint64_t ingress_stack;
1069 	uint64_t osif_drop;
1070 	struct cdp_tid_tx_stats tx_total[CDP_MAX_DATA_TIDS];
1071 	struct cdp_tid_rx_stats rx_total[CDP_MAX_DATA_TIDS];
1072 };
1073 
1074 /*
1075  * struct cdp_delay_tx_stats: Tx delay stats
1076  * @tx_swq_delay: software enqueue delay
1077  * @hwtx_delay: HW enque to completion delay
1078  */
1079 struct cdp_delay_tx_stats {
1080 	struct cdp_hist_stats    tx_swq_delay;
1081 	struct cdp_hist_stats    hwtx_delay;
1082 };
1083 
1084 /*
1085  * struct cdp_delay_rx_stats: Rx delay stats
1086  * @to_stack_delay: To stack delay
1087  */
1088 struct cdp_delay_rx_stats {
1089 	struct cdp_hist_stats    to_stack_delay;
1090 };
1091 
1092 /*
1093  * struct cdp_delay_tid_stats: Delay tid stats
1094  * @tx_delay: Tx delay related stats
1095  * @rx_delay: Rx delay related stats
1096  */
1097 struct cdp_delay_tid_stats {
1098 	struct cdp_delay_tx_stats  tx_delay;
1099 	struct cdp_delay_rx_stats  rx_delay;
1100 };
1101 
1102 /* struct cdp_pkt_info - packet info
1103  * @num: no of packets
1104  * @bytes: total no of bytes
1105  */
1106 struct cdp_pkt_info {
1107 	uint32_t num;
1108 	uint64_t bytes;
1109 };
1110 
1111 /* struct cdp_pkt_type - packet type
1112  * @mcs_count: Counter array for each MCS index
1113  */
1114 struct cdp_pkt_type {
1115 	uint32_t mcs_count[MAX_MCS];
1116 };
1117 
1118 /*
1119  * struct cdp_rx_mu - Rx MU Stats
1120  * @ppdu_nss[SS_COUNT]: Packet Count in spatial streams
1121  * @mpdu_cnt_fcs_ok: Rx success mpdu count
1122  * @mpdu_cnt_fcs_err: Rx fail mpdu count
1123  * @cdp_pkt_type: counter array for each MCS index
1124  */
1125 struct cdp_rx_mu {
1126 	uint32_t ppdu_nss[SS_COUNT];
1127 	uint32_t mpdu_cnt_fcs_ok;
1128 	uint32_t mpdu_cnt_fcs_err;
1129 	struct cdp_pkt_type ppdu;
1130 };
1131 
1132 /* struct cdp_tx_pkt_info - tx packet info
1133  * num_msdu - successful msdu
1134  * num_mpdu - successful mpdu from compltn common
1135  * mpdu_tried - mpdu tried
1136  *
1137  * tx packet info counter field for mpdu success/tried and msdu
1138  */
1139 struct cdp_tx_pkt_info {
1140 	uint32_t num_msdu;
1141 	uint32_t num_mpdu;
1142 	uint32_t mpdu_tried;
1143 };
1144 
1145 #ifdef FEATURE_TSO_STATS
1146 /**
1147  * struct cdp_tso_seg_histogram - Segment histogram for TCP Packets
1148  * @segs_1: packets with single segments
1149  * @segs_2_5: packets with 2-5 segments
1150  * @segs_6_10: packets with 6-10 segments
1151  * @segs_11_15: packets with 11-15 segments
1152  * @segs_16_20: packets with 16-20 segments
1153  * @segs_20_plus: packets with 20 plus segments
1154  */
1155 struct cdp_tso_seg_histogram {
1156 	uint64_t segs_1;
1157 	uint64_t segs_2_5;
1158 	uint64_t segs_6_10;
1159 	uint64_t segs_11_15;
1160 	uint64_t segs_16_20;
1161 	uint64_t segs_20_plus;
1162 };
1163 
1164 /**
1165  * struct cdp_tso_packet_info - Stats for TSO segments within a TSO packet
1166  * @tso_seg: TSO Segment information
1167  * @num_seg: Number of segments
1168  * @tso_packet_len: Size of the tso packet
1169  * @tso_seg_idx: segment number
1170  */
1171 struct cdp_tso_packet_info {
1172 	struct qdf_tso_seg_t tso_seg[CDP_MAX_TSO_SEGMENTS];
1173 	uint8_t num_seg;
1174 	size_t tso_packet_len;
1175 	uint32_t tso_seg_idx;
1176 };
1177 
1178 /**
1179  * struct cdp_tso_info - stats for tso packets
1180  * @tso_packet_info: TSO packet information
1181  */
1182 struct cdp_tso_info {
1183 	struct cdp_tso_packet_info tso_packet_info[CDP_MAX_TSO_PACKETS];
1184 };
1185 #endif /* FEATURE_TSO_STATS */
1186 
1187 /**
1188  * struct cdp_tso_stats -  TSO stats information
1189  * @num_tso_pkts: Total number of TSO Packets
1190  * @tso_comp: Total tso packet completions
1191  * @dropped_host: TSO packets dropped by host
1192  * @tso_no_mem_dropped: TSO packets dropped by host due to descriptor
1193 			unavailablity
1194  * @dropped_target: TSO packets_dropped by target
1195  * @tso_info: Per TSO packet counters
1196  * @seg_histogram: TSO histogram stats
1197  */
1198 struct cdp_tso_stats {
1199 	struct cdp_pkt_info num_tso_pkts;
1200 	uint32_t tso_comp;
1201 	struct cdp_pkt_info dropped_host;
1202 	struct cdp_pkt_info tso_no_mem_dropped;
1203 	uint32_t dropped_target;
1204 #ifdef FEATURE_TSO_STATS
1205 	struct cdp_tso_info tso_info;
1206 	struct cdp_tso_seg_histogram seg_histogram;
1207 #endif /* FEATURE_TSO_STATS */
1208 };
1209 
1210 #define CDP_PEER_STATS_START 0
1211 
1212 enum cdp_peer_stats_type {
1213 	cdp_peer_stats_min = CDP_PEER_STATS_START,
1214 	/* Peer per pkt stats */
1215 	cdp_peer_per_pkt_stats_min = cdp_peer_stats_min,
1216 	cdp_peer_tx_ucast = cdp_peer_per_pkt_stats_min,
1217 	cdp_peer_tx_mcast,
1218 	cdp_peer_tx_inactive_time,
1219 	cdp_peer_rx_ucast,
1220 	/* Add enum for peer per pkt stats before this */
1221 	cdp_peer_per_pkt_stats_max,
1222 
1223 	/* Peer extd stats */
1224 	cdp_peer_extd_stats_min,
1225 	cdp_peer_tx_rate = cdp_peer_extd_stats_min,
1226 	cdp_peer_tx_last_tx_rate,
1227 	cdp_peer_tx_ratecode,
1228 	cdp_peer_tx_flags,
1229 	cdp_peer_tx_power,
1230 	cdp_peer_rx_rate,
1231 	cdp_peer_rx_last_rx_rate,
1232 	cdp_peer_rx_ratecode,
1233 	cdp_peer_rx_flags,
1234 	cdp_peer_rx_avg_snr,
1235 	cdp_peer_rx_snr,
1236 	/* Add enum for peer extd stats before this */
1237 	cdp_peer_extd_stats_max,
1238 	cdp_peer_stats_max = cdp_peer_extd_stats_max,
1239 };
1240 
1241 /*
1242  * The max size of cdp_peer_stats_param_t is limited to 16 bytes.
1243  * If the buffer size is exceeding this size limit,
1244  * dp_txrx_get_peer_stats is to be used instead.
1245  */
1246 typedef union cdp_peer_stats_buf {
1247 	/* Tx types */
1248 	struct cdp_pkt_info tx_ucast;
1249 	struct cdp_pkt_info tx_mcast;
1250 	uint32_t tx_rate;
1251 	uint32_t last_tx_rate;
1252 	uint32_t tx_inactive_time;
1253 	uint32_t tx_flags;
1254 	uint32_t tx_power;
1255 	uint16_t tx_ratecode;
1256 
1257 	/* Rx types */
1258 	struct cdp_pkt_info rx_ucast;
1259 	uint32_t rx_rate;
1260 	uint32_t last_rx_rate;
1261 	uint32_t rx_ratecode;
1262 	uint32_t rx_flags;
1263 	uint32_t rx_avg_snr;
1264 	uint32_t rx_snr;
1265 } cdp_peer_stats_param_t; /* Max union size 16 bytes */
1266 
1267 /**
1268  * enum cdp_protocol_trace -  Protocols supported by per-peer protocol trace
1269  * @CDP_TRACE_ICMP: ICMP packets
1270  * @CDP_TRACE_EAP: EAPOL packets
1271  * @CDP_TRACE_ARP: ARP packets
1272  *
1273  * Enumeration of all protocols supported by per-peer protocol trace feature
1274  */
1275 enum cdp_protocol_trace {
1276 	CDP_TRACE_ICMP,
1277 	CDP_TRACE_EAP,
1278 	CDP_TRACE_ARP,
1279 	CDP_TRACE_MAX
1280 };
1281 
1282 /**
1283  * struct protocol_trace_count - type of count on per-peer protocol trace
1284  * @egress_cnt: how many packets go out of host driver
1285  * @ingress_cnt: how many packets come into the host driver
1286  *
1287  * Type of count on per-peer protocol trace
1288  */
1289 struct protocol_trace_count {
1290 	uint16_t egress_cnt;
1291 	uint16_t ingress_cnt;
1292 };
1293 /* struct cdp_tx_stats - tx stats
1294  * @cdp_pkt_info comp_pkt: Pkt Info for which completions were received
1295  * @cdp_pkt_info ucast: Unicast Packet Count
1296  * @cdp_pkt_info mcast: Multicast Packet Count
1297  * @cdp_pkt_info bcast: Broadcast Packet Count
1298  * @cdp_pkt_info nawds_mcast: NAWDS  Multicast Packet Count
1299  * @cdp_pkt_info tx_success: Successful Tx Packets
1300  * @nawds_mcast_drop: NAWDS  Multicast Drop Count
1301  * @protocol_trace_cnt: per-peer protocol counter
1302  * @tx_failed: Total Tx failure
1303  * @ofdma: Total Packets as ofdma
1304  * @stbc: Packets in STBC
1305  * @ldpc: Packets in LDPC
1306  * @retries: Packet retries
1307  * @retries_mpdu: mpdu number of successfully transmitted after retries
1308  * @non_amsdu_cnt: Number of MSDUs with no MSDU level aggregation
1309  * @amsdu_cnt: Number of MSDUs part of AMSDU
1310  * @tx_rate: Tx Rate
1311  * @last_tx_rate: Last tx rate for unicast packets
1312  * @last_tx_rate_mcs: Tx rate mcs for unicast packets
1313  * @mcast_last_tx_rate: Last tx rate for multicast packets
1314  * @mcast_last_tx_rate_mcs: Last tx rate mcs for multicast
1315  * @last_per: Tx Per
1316  * @rnd_avg_tx_rate: Rounded average tx rate
1317  * @avg_tx_rate: Average TX rate
1318  * @last_ack_rssi: RSSI of last acked packet
1319  * @tx_bytes_success_last: last Tx success bytes
1320  * @tx_data_success_last: last Tx success data
1321  * @tx_byte_rate: Bytes Trasmitted in last one sec
1322  * @tx_data_rate: Data Transmitted in last one sec
1323  * @sgi_count[MAX_GI]: SGI count
1324  * @pream_punct_cnt: Preamble Punctured count
1325  * @nss[SS_COUNT]: Packet count for different num_spatial_stream values
1326  * @bw[MAX_BW]: Packet Count for different bandwidths
1327  * @wme_ac_type[WME_AC_MAX]: Wireless Multimedia type Count
1328  * @excess_retries_per_ac[WME_AC_MAX]: Wireless Multimedia type Count
1329  * @dot11_tx_pkts: dot11 tx packets
1330  * @fw_rem: Discarded by firmware
1331  * @fw_rem_notx: firmware_discard_untransmitted
1332  * @fw_rem_tx: firmware_discard_transmitted
1333  * @age_out: aged out in mpdu/msdu queues
1334  * @fw_reason1: discarded by firmware reason 1
1335  * @fw_reason2: discarded by firmware reason 2
1336  * @fw_reason3: discarded by firmware reason 3
1337  * @fw_rem_queue_disable: dropped due to queue disable
1338  * @fw_rem_no_match: dropped due to fw no match command
1339  * @drop_threshold: dropped due to HW threshold
1340  * @drop_link_desc_na: dropped due resource not available in HW
1341  * @invalid_drop: Invalid msdu drop
1342  * @mcast_vdev_drop: MCAST drop configured for VDEV in HW
1343  * @invalid_rr: Invalid TQM release reason
1344  * @mcs_count: MCS Count
1345  * @an_tx_cnt: ald tx count
1346  * @an_tx_rates_used: ald rx rate used
1347  * @an_tx_bytes: ald tx bytes
1348  * @ald_txcount: ald tx count
1349  * @ald_lastper: ald last PER
1350  * @ald_max4msframelen: ald max frame len
1351  * @an_tx_ratecount: ald tx ratecount
1352  * @ald_retries: ald retries
1353  * @ald_ac_nobufs: #buffer overflows per node per AC
1354  * @ald_ac_excretries: #pkts dropped after excessive retries per node per AC
1355  * @rssi_chain: rssi chain
1356  * @inactive_time: inactive time in secs
1357  * @tx_flags: tx flags
1358  * @tx_power: Tx power latest
1359  * @is_tx_no_ack: no ack received
1360  * @tx_ratecode: Tx rate code of last frame
1361  * @is_tx_nodefkey: tx failed 'cuz no defkey
1362  * @is_tx_noheadroom: tx failed 'cuz no space
1363  * @is_crypto_enmicfail:
1364  * @is_tx_nonode: tx failed for no node
1365  * @is_tx_unknownmgt: tx of unknown mgt frame
1366  * @is_tx_badcipher: tx failed 'cuz key type
1367  * @ampdu_cnt: completion of aggregation
1368  * @non_ampdu_cnt: tx completion not aggregated
1369  * @failed_retry_count: packets failed due to retry above 802.11 retry limit
1370  * @retry_count: packets successfully send after one or more retry
1371  * @multiple_retry_count: packets successfully sent after more than one retry
1372  * @tx_ppdus: ppdus in tx
1373  * @tx_mpdus_success: mpdus successful in tx
1374  * @tx_mpdus_tried: mpdus tried in tx
1375  * @transmit_type: pkt info for tx transmit type
1376  * @mu_group_id: mumimo mu group id
1377  * @ru_start: RU start index
1378  * @ru_tones: RU tones size
1379  * @ru_loc: pkt info for RU location 26/ 52/ 106/ 242/ 484 counter
1380  * @num_ppdu_cookie_valid : Number of comp received with valid ppdu cookie
1381  * @tx_success_twt: Successful Tx Packets in TWT session
1382  * @nss_info: NSS 1,2, ...8
1383  * @mcs_info: MCS index
1384  * @bw_info: Bandwidth
1385  *       <enum 0 bw_20_MHz>
1386  *       <enum 1 bw_40_MHz>
1387  *       <enum 2 bw_80_MHz>
1388  *       <enum 3 bw_160_MHz>
1389  * @gi_info: <enum 0     0_8_us_sgi > Legacy normal GI
1390  *       <enum 1     0_4_us_sgi > Legacy short GI
1391  *       <enum 2     1_6_us_sgi > HE related GI
1392  *       <enum 3     3_2_us_sgi > HE
1393  * @preamble_info: preamble
1394  * @last_tx_ts: last timestamp in jiffies when tx comp occurred
1395  * @su_be_ppdu_cnt: SU Tx packet count
1396  * @mu_be_ppdu_cnt: MU Tx packet count
1397  * @punc_bw[MAX_PUNCTURED_MODE]: MSDU count for punctured BW
1398  * @release_src_not_tqm: Counter to keep track of release source is not TQM
1399  *			 in TX completion status processing
1400  */
1401 struct cdp_tx_stats {
1402 	struct cdp_pkt_info comp_pkt;
1403 	struct cdp_pkt_info ucast;
1404 	struct cdp_pkt_info mcast;
1405 	struct cdp_pkt_info bcast;
1406 	struct cdp_pkt_info nawds_mcast;
1407 #ifdef VDEV_PEER_PROTOCOL_COUNT
1408 	struct protocol_trace_count protocol_trace_cnt[CDP_TRACE_MAX];
1409 #endif
1410 	struct cdp_pkt_info tx_success;
1411 	uint32_t nawds_mcast_drop;
1412 	uint32_t tx_failed;
1413 	uint32_t ofdma;
1414 	uint32_t stbc;
1415 	uint32_t ldpc;
1416 	uint32_t retries;
1417 	uint32_t retries_mpdu;
1418 	uint32_t non_amsdu_cnt;
1419 	uint32_t amsdu_cnt;
1420 	uint32_t tx_rate;
1421 	uint32_t last_tx_rate;
1422 	uint32_t last_tx_rate_mcs;
1423 	uint32_t mcast_last_tx_rate;
1424 	uint32_t mcast_last_tx_rate_mcs;
1425 	uint32_t last_per;
1426 	uint64_t rnd_avg_tx_rate;
1427 	uint64_t avg_tx_rate;
1428 	uint32_t last_ack_rssi;
1429 	uint32_t tx_bytes_success_last;
1430 	uint32_t tx_data_success_last;
1431 	uint32_t tx_byte_rate;
1432 	uint32_t tx_data_rate;
1433 	uint32_t tx_data_ucast_last;
1434 	uint32_t tx_data_ucast_rate;
1435 	struct cdp_pkt_type pkt_type[DOT11_MAX];
1436 	uint32_t sgi_count[MAX_GI];
1437 	uint32_t pream_punct_cnt;
1438 
1439 	uint32_t nss[SS_COUNT];
1440 
1441 	uint32_t bw[MAX_BW];
1442 
1443 	uint32_t wme_ac_type[WME_AC_MAX];
1444 
1445 	uint32_t excess_retries_per_ac[WME_AC_MAX];
1446 	struct cdp_pkt_info dot11_tx_pkts;
1447 
1448 	struct {
1449 		struct cdp_pkt_info fw_rem;
1450 		uint32_t fw_rem_notx;
1451 		uint32_t fw_rem_tx;
1452 		uint32_t age_out;
1453 		uint32_t fw_reason1;
1454 		uint32_t fw_reason2;
1455 		uint32_t fw_reason3;
1456 		uint32_t fw_rem_queue_disable;
1457 		uint32_t fw_rem_no_match;
1458 		uint32_t drop_threshold;
1459 		uint32_t drop_link_desc_na;
1460 		uint32_t invalid_drop;
1461 		uint32_t mcast_vdev_drop;
1462 		uint32_t invalid_rr;
1463 	} dropped;
1464 
1465 
1466 	uint32_t fw_tx_cnt;
1467 	uint32_t fw_tx_bytes;
1468 	uint32_t fw_txcount;
1469 	uint32_t fw_max4msframelen;
1470 	uint32_t fw_ratecount;
1471 
1472 	uint32_t ac_nobufs[WME_AC_MAX];
1473 	uint32_t rssi_chain[WME_AC_MAX];
1474 	uint32_t inactive_time;
1475 
1476 	uint32_t tx_flags;
1477 	uint32_t tx_power;
1478 
1479 	/* MSDUs which the target sent but couldn't get an ack for */
1480 	struct cdp_pkt_info is_tx_no_ack;
1481 	uint16_t tx_ratecode;
1482 
1483 	/*add for peer and upadted from ppdu*/
1484 	uint32_t ampdu_cnt;
1485 	uint32_t non_ampdu_cnt;
1486 	uint32_t failed_retry_count;
1487 	uint32_t retry_count;
1488 	uint32_t multiple_retry_count;
1489 	uint32_t last_tx_rate_used;
1490 	uint32_t tx_ppdus;
1491 	uint32_t tx_mpdus_success;
1492 	uint32_t tx_mpdus_tried;
1493 
1494 	struct cdp_tx_pkt_info transmit_type[MAX_TRANSMIT_TYPES];
1495 	uint32_t mu_group_id[MAX_MU_GROUP_ID];
1496 	uint32_t ru_start;
1497 	uint32_t ru_tones;
1498 	struct cdp_tx_pkt_info ru_loc[MAX_RU_LOCATIONS];
1499 
1500 	uint32_t num_ppdu_cookie_valid;
1501 	uint32_t no_ack_count[QDF_PROTO_SUBTYPE_MAX];
1502 	struct cdp_pkt_info tx_success_twt;
1503 
1504 	uint32_t nss_info:4,
1505 		 mcs_info:4,
1506 		 bw_info:4,
1507 		 gi_info:4,
1508 		 preamble_info:4;
1509 	/* mpdu retry count in case of successful transmission */
1510 	uint32_t mpdu_success_with_retries;
1511 	unsigned long last_tx_ts;
1512 #ifdef WLAN_FEATURE_11BE
1513 	struct cdp_pkt_type su_be_ppdu_cnt;
1514 	struct cdp_pkt_type mu_be_ppdu_cnt[TXRX_TYPE_MU_MAX];
1515 	uint32_t punc_bw[MAX_PUNCTURED_MODE];
1516 #endif
1517 	uint32_t release_src_not_tqm;
1518 };
1519 
1520 /* struct cdp_rx_stats - rx Level Stats
1521  * @to_stack: Total packets sent up the stack
1522  * @rcvd_reo[CDP_MAX_RX_RINGS]:  Packets received on the reo ring
1523  * @rx_lmac[CDP_MAX_LMACS]: Packets received on which lmac
1524  * @unicast: Total unicast packets
1525  * @multicast: Total multicast packets
1526  * @bcast:  Broadcast Packet Count
1527  * @raw: Raw Pakets received
1528  * @nawds_mcast_drop: Total multicast packets
1529  * @mec_drop: Total MEC packets dropped
1530  * @last_rx_ts: last timestamp in jiffies when RX happened
1531  * @pkts: Intra BSS packets received
1532  * @fail: Intra BSS packets failed
1533  * @mdns_no_fwd: Intra BSS MDNS packets not forwarded
1534  * @protocol_trace_cnt: per-peer protocol counters
1535  * @mic_err: Rx MIC errors CCMP
1536  * @decrypt_err: Rx Decryption Errors CRC
1537  * @fcserr: rx MIC check failed (CCMP)
1538  * @pn_err: pn check failed
1539  * @oor_err: Rx OOR errors
1540  * @jump_2k_err: 2k jump errors
1541  * @rxdma_wifi_parse_err: rxdma wifi parse errors
1542  * @wme_ac_type[WME_AC_MAX]: Wireless Multimedia type Count
1543  * @reception_type[MAX_RECEPTION_TYPES]: Reception type os packets
1544  * @mcs_count[MAX_MCS]: mcs count
1545  * @sgi_count[MAX_GI]: sgi count
1546  * @nss[SS_COUNT]: packet count in spatiel Streams
1547  * @ppdu_nss[SS_COUNT]: PPDU packet count in spatial streams
1548  * @mpdu_cnt_fcs_ok: SU Rx success mpdu count
1549  * @mpdu_cnt_fcs_err: SU Rx fail mpdu count
1550  * @su_ax_ppdu_cnt: SU Rx packet count
1551  * @ppdu_cnt[MAX_RECEPTION_TYPES]: PPDU packet count in reception type
1552  * @rx_mu[TXRX_TYPE_MU_MAX]: Rx MU stats
1553  * @bw[MAX_BW]:  Packet Count in different bandwidths
1554  * @non_ampdu_cnt: Number of MSDUs with no MPDU level aggregation
1555  * @ampdu_cnt: Number of MSDUs part of AMSPU
1556  * @non_amsdu_cnt: Number of MSDUs with no MSDU level aggregation
1557  * @amsdu_cnt: Number of MSDUs part of AMSDU
1558  * @bar_recv_cnt: Number of bar received
1559  * @avg_snr: Average snr
1560  * @rx_rate: Rx rate
1561  * @last_rx_rate: Previous rx rate
1562  * @rnd_avg_rx_rate: Rounded average rx rate
1563  * @avg_rx_rate:  Average Rx rate
1564  * @dot11_rx_pkts: dot11 rx packets
1565  * @rx_bytes_last: last Rx success bytes
1566  * @rx_data_last: last rx success data
1567  * @rx_byte_rate: bytes received in last one sec
1568  * @rx_data_rate: data received in last one sec
1569  * @rx_retries: retries of packet in rx
1570  * @rx_mpdus: mpdu in rx
1571  * @rx_ppdus: ppdu in rx
1572  * @is_rx_tooshort: tooshort
1573  * @is_rx_decap: rx decap
1574  * @rx_ccmpmic: rx MIC check failed (CCMP)
1575  * @rx_tkipmic: rx MIC check failed (TKIP)
1576  * @rx_tkipicv: rx ICV check failed (TKIP)
1577  * @rx_wpimic: rx MIC check failed (WPI)
1578  * @rx_wepfail: rx wep processing failed
1579  * @rx_aggr: aggregation on rx
1580  * @rx_discard: packets discard in rx
1581  * @rx_ratecode: Rx rate code of last frame
1582  * @rx_flags: rx flags
1583  * @rx_snr_measured_time: Time at which snr is measured
1584  * @snr: SNR of received signal
1585  * @last_snr: Previous snr
1586  * @multipass_rx_pkt_drop: Dropped multipass rx pkt
1587  * @peer_unauth_rx_pkt_drop: Unauth rx packet drops
1588  * @policy_check_drop: policy check drops
1589  * @rx_mpdu_cnt: rx mpdu count per MCS rate
1590  * @nss_info: NSS 1,2, ...8
1591  * @mcs_info: MCS index
1592  * @bw_info: Bandwidth
1593  *       <enum 0 bw_20_MHz>
1594  *       <enum 1 bw_40_MHz>
1595  *       <enum 2 bw_80_MHz>
1596  *       <enum 3 bw_160_MHz>
1597  * @gi_info: <enum 0     0_8_us_sgi > Legacy normal GI
1598  *       <enum 1     0_4_us_sgi > Legacy short GI
1599  *       <enum 2     1_6_us_sgi > HE related GI
1600  *       <enum 3     3_2_us_sgi > HE
1601  * @preamble_info: preamble
1602  * @to_stack_twt: Total packets sent up the stack in TWT session
1603  * @mpdu_retry_cnt: retries of mpdu in rx
1604  * @su_be_ppdu_cnt: SU Rx packet count for BE
1605  * @mu_be_ppdu_cnt: MU rx packet count for BE
1606  * @punc_bw[MAX_PUNCTURED_MODE]: MSDU count for punctured BW
1607  */
1608 struct cdp_rx_stats {
1609 	struct cdp_pkt_info to_stack;
1610 	struct cdp_pkt_info rcvd_reo[CDP_MAX_RX_RINGS];
1611 	struct cdp_pkt_info rx_lmac[CDP_MAX_LMACS];
1612 	struct cdp_pkt_info unicast;
1613 	struct cdp_pkt_info multicast;
1614 	struct cdp_pkt_info bcast;
1615 	struct cdp_pkt_info raw;
1616 	uint32_t nawds_mcast_drop;
1617 	struct cdp_pkt_info mec_drop;
1618 	unsigned long last_rx_ts;
1619 	struct {
1620 		struct cdp_pkt_info pkts;
1621 		struct cdp_pkt_info fail;
1622 		uint32_t mdns_no_fwd;
1623 	} intra_bss;
1624 #ifdef VDEV_PEER_PROTOCOL_COUNT
1625 	struct protocol_trace_count protocol_trace_cnt[CDP_TRACE_MAX];
1626 #endif
1627 
1628 	struct {
1629 		uint32_t mic_err;
1630 		uint32_t decrypt_err;
1631 		uint32_t fcserr;
1632 		uint32_t pn_err;
1633 		uint32_t oor_err;
1634 		uint32_t jump_2k_err;
1635 		uint32_t rxdma_wifi_parse_err;
1636 	} err;
1637 
1638 	uint32_t wme_ac_type[WME_AC_MAX];
1639 	uint32_t reception_type[MAX_RECEPTION_TYPES];
1640 	struct cdp_pkt_type pkt_type[DOT11_MAX];
1641 	uint32_t sgi_count[MAX_GI];
1642 	uint32_t nss[SS_COUNT];
1643 	uint32_t ppdu_nss[SS_COUNT];
1644 	uint32_t mpdu_cnt_fcs_ok;
1645 	uint32_t mpdu_cnt_fcs_err;
1646 	struct cdp_pkt_type su_ax_ppdu_cnt;
1647 	uint32_t ppdu_cnt[MAX_RECEPTION_TYPES];
1648 	struct cdp_rx_mu rx_mu[TXRX_TYPE_MU_MAX];
1649 	uint32_t bw[MAX_BW];
1650 	uint32_t non_ampdu_cnt;
1651 	uint32_t ampdu_cnt;
1652 	uint32_t non_amsdu_cnt;
1653 	uint32_t amsdu_cnt;
1654 	uint32_t bar_recv_cnt;
1655 	uint32_t avg_snr;
1656 	uint32_t rx_rate;
1657 	uint32_t last_rx_rate;
1658 	uint32_t rnd_avg_rx_rate;
1659 	uint32_t avg_rx_rate;
1660 	struct cdp_pkt_info  dot11_rx_pkts;
1661 
1662 	uint32_t rx_bytes_success_last;
1663 	uint32_t rx_data_success_last;
1664 	uint32_t rx_byte_rate;
1665 	uint32_t rx_data_rate;
1666 
1667 	uint32_t rx_retries;
1668 	uint32_t rx_mpdus;
1669 	uint32_t rx_ppdus;
1670 
1671 	/*add for peer updated for ppdu*/
1672 	uint32_t rx_aggr;
1673 	uint32_t rx_discard;
1674 	uint32_t rx_ratecode;
1675 	uint32_t rx_flags;
1676 	uint32_t rx_snr_measured_time;
1677 	uint8_t snr;
1678 	uint8_t last_snr;
1679 	uint32_t multipass_rx_pkt_drop;
1680 	uint32_t peer_unauth_rx_pkt_drop;
1681 	uint32_t policy_check_drop;
1682 	uint32_t rx_mpdu_cnt[MAX_MCS];
1683 	uint32_t nss_info:4,
1684 		 mcs_info:4,
1685 		 bw_info:4,
1686 		 gi_info:4,
1687 	         preamble_info:4;
1688 	struct cdp_pkt_info to_stack_twt;
1689 	uint32_t mpdu_retry_cnt;
1690 #ifdef WLAN_FEATURE_11BE
1691 	struct cdp_pkt_type su_be_ppdu_cnt;
1692 	struct cdp_pkt_type mu_be_ppdu_cnt[TXRX_TYPE_MU_MAX];
1693 	uint32_t punc_bw[MAX_PUNCTURED_MODE];
1694 #endif
1695 	uint32_t mcast_3addr_drop;
1696 };
1697 
1698 /* struct cdp_tx_ingress_stats - Tx ingress Stats
1699  * @rcvd: Total packets received for transmission
1700  * @processed: Tx packets processed
1701  * @inspect_pkts: Total packets passed to inspect handler
1702  * @nawds_mcast: NAWDS  Multicast Packet Count
1703  * @bcast: Number of broadcast packets
1704  * @raw_pkt: Total Raw packets
1705  * @dma_map_error: DMA map error
1706  * @num_frags_overflow_err: msdu's nbuf count exceeds num of segemnts
1707  * @num_seg: No of segments in TSO packets
1708  * @tso_pkt:total no of TSO packets
1709  * @non_tso_pkts: non - TSO packets
1710  * @dropped_host: TSO packets dropped by host
1711  * @dropped_target:TSO packets dropped by target
1712  * @sg_pkt: Total scatter gather packets
1713  * @non_sg_pkts: non SG packets
1714  * @dropped_host: SG packets dropped by host
1715  * @dropped_target: SG packets dropped by target
1716  * @dma_map_error: Dma map error
1717  * @mcast_pkt: total no of multicast conversion packets
1718  * @dropped_map_error: packets dropped due to map error
1719  * @dropped_self_mac: packets dropped due to self Mac address
1720  * @dropped_send_fail: Packets dropped due to send fail
1721  * @ucast: total unicast packets transmitted
1722  * @fail_seg_alloc: Segment allocation failure
1723  * @clone_fail: NBUF clone failure
1724  * @igmp_rcvd: igmp pkts received for conversion to ucast pkts
1725  * @igmp_ucast_converted: unicast pkts sent as part of VoW IGMP improvements
1726  * @dropped_pkt: Total scatter gather packets
1727  * @desc_na: Desc Not Available
1728  * @exc_desc_na: Exception desc Not Available
1729  * @ring_full: ring full
1730  * @enqueue_fail: hw enqueue fail
1731  * @dma_error: dma fail
1732  * @res_full: Resource Full: Congestion Control
1733  * @fail_per_pkt_vdev_id_check: Per pkt vdev id check
1734  * @exception_fw: packets sent to fw
1735  * @completion_fw: packets completions received from fw
1736  * @cce_classified:Number of packets classified by CCE
1737  * @cce_classified_raw:Number of raw packets classified by CCE
1738  * @sniffer_rcvd: Number of packets received with ppdu cookie
1739  */
1740 struct cdp_tx_ingress_stats {
1741 	struct cdp_pkt_info rcvd;
1742 	struct cdp_pkt_info processed;
1743 	struct cdp_pkt_info reinject_pkts;
1744 	struct cdp_pkt_info inspect_pkts;
1745 	struct cdp_pkt_info nawds_mcast;
1746 	struct cdp_pkt_info bcast;
1747 
1748 	struct {
1749 		struct cdp_pkt_info raw_pkt;
1750 		uint32_t dma_map_error;
1751 		uint32_t invalid_raw_pkt_datatype;
1752 		uint32_t num_frags_overflow_err;
1753 	} raw;
1754 
1755 	/* Scatter Gather packet info */
1756 	struct {
1757 		struct cdp_pkt_info sg_pkt;
1758 		struct cdp_pkt_info non_sg_pkts;
1759 		struct cdp_pkt_info  dropped_host;
1760 		uint32_t dropped_target;
1761 		uint32_t dma_map_error;
1762 	} sg;
1763 
1764 	/* Multicast Enhancement packets info */
1765 	struct {
1766 		struct cdp_pkt_info mcast_pkt;
1767 		uint32_t dropped_map_error;
1768 		uint32_t dropped_self_mac;
1769 		uint32_t dropped_send_fail;
1770 		uint32_t ucast;
1771 		uint32_t fail_seg_alloc;
1772 		uint32_t clone_fail;
1773 	} mcast_en;
1774 
1775 	/* IGMP Multicast Enhancement packets info */
1776 	struct {
1777 		uint32_t igmp_rcvd;
1778 		uint32_t igmp_ucast_converted;
1779 	} igmp_mcast_en;
1780 
1781 	/* Packets dropped on the Tx side */
1782 	struct {
1783 		struct cdp_pkt_info dropped_pkt;
1784 		struct cdp_pkt_info  desc_na;
1785 		struct cdp_pkt_info  desc_na_exc_alloc_fail;
1786 		struct cdp_pkt_info  desc_na_exc_outstand;
1787 		struct cdp_pkt_info  exc_desc_na;
1788 		uint32_t ring_full;
1789 		uint32_t enqueue_fail;
1790 		uint32_t dma_error;
1791 		uint32_t res_full;
1792 		/* headroom insufficient */
1793 		uint32_t headroom_insufficient;
1794 		uint32_t fail_per_pkt_vdev_id_check;
1795 	} dropped;
1796 
1797 	/* Mesh packets info */
1798 	struct {
1799 		uint32_t exception_fw;
1800 		uint32_t completion_fw;
1801 	} mesh;
1802 
1803 	uint32_t cce_classified;
1804 	uint32_t cce_classified_raw;
1805 	struct cdp_pkt_info sniffer_rcvd;
1806 	struct cdp_tso_stats tso_stats;
1807 };
1808 
1809 /* struct cdp_rx_ingress_stats - rx ingress stats
1810  * @reo_rcvd_pkt: packets received at REO block
1811  * @ null_q_desc_pkt: null queue desc pkt count
1812  * @ routed_eapol_pkt: routed eapol pkt count
1813  */
1814 struct cdp_rx_ingress_stats {
1815 	struct cdp_pkt_info reo_rcvd_pkt;
1816 	struct cdp_pkt_info null_q_desc_pkt;
1817 	struct cdp_pkt_info routed_eapol_pkt;
1818 };
1819 
1820 /* struct cdp_vdev_stats - vdev stats structure
1821  * @tx_i: ingress tx stats
1822  * @rx_i: ingress rx stats
1823  * @tx: cdp tx stats
1824  * @rx: cdp rx stats
1825  * @tso_stats: tso stats
1826  * @tid_tx_stats: tid tx stats
1827  */
1828 struct cdp_vdev_stats {
1829 	struct cdp_tx_ingress_stats tx_i;
1830 	struct cdp_rx_ingress_stats rx_i;
1831 	struct cdp_tx_stats tx;
1832 	struct cdp_rx_stats rx;
1833 	struct cdp_tso_stats tso_stats;
1834 #ifdef HW_TX_DELAY_STATS_ENABLE
1835 	struct cdp_tid_tx_stats tid_tx_stats[CDP_MAX_TX_COMP_RINGS]
1836 					    [CDP_MAX_DATA_TIDS];
1837 #endif
1838 };
1839 
1840 /* struct cdp_calibr_stats - Calibrated stats
1841  * @last_per: Tx last packet error rate
1842  * @tx_bytes_success_last: last Tx success bytes
1843  * @tx_data_success_last: last Tx success data
1844  * @tx_byte_rate: Bytes Trasmitted in last one sec
1845  * @tx_data_rate: Data Transmitted in last one sec
1846  * @tx_data_ucast_last: last unicast Tx bytes
1847  * @tx_data_ucast_rate: last unicast Tx data
1848  * @inactive_time: inactive time in secs
1849  * @rx_bytes_success_last: last Rx success bytes
1850  * @rx_data_success_last: last Rx success data
1851  * @rx_byte_rate: Bytes received in last one sec
1852  * @rx_data_rate: Data received in last one sec
1853  */
1854 struct cdp_calibr_stats {
1855 	struct {
1856 		uint32_t last_per;
1857 		uint32_t tx_bytes_success_last;
1858 		uint32_t tx_data_success_last;
1859 		uint32_t tx_byte_rate;
1860 		uint32_t tx_data_rate;
1861 		uint32_t tx_data_ucast_last;
1862 		uint32_t tx_data_ucast_rate;
1863 		uint32_t inactive_time;
1864 	} tx;
1865 
1866 	struct {
1867 		uint32_t rx_bytes_success_last;
1868 		uint32_t rx_data_success_last;
1869 		uint32_t rx_byte_rate;
1870 		uint32_t rx_data_rate;
1871 	} rx;
1872 };
1873 
1874 /* struct cdp_calibr_stats_intf: Calibrated stats interface
1875  * @to_stack: Total packets sent up the stack
1876  * @tx_success: Successful Tx Packets
1877  * @tx_ucast: Tx Unicast Packet Count
1878  */
1879 struct cdp_calibr_stats_intf {
1880 	struct cdp_pkt_info to_stack;
1881 	struct cdp_pkt_info tx_success;
1882 	struct cdp_pkt_info tx_ucast;
1883 };
1884 
1885 /* struct cdp_peer_stats - peer stats structure
1886  * @tx: cdp tx stats
1887  * @rx: cdp rx stats
1888  */
1889 struct cdp_peer_stats {
1890 	/* CDP Tx Stats */
1891 	struct cdp_tx_stats tx;
1892 	/* CDP Rx Stats */
1893 	struct cdp_rx_stats rx;
1894 };
1895 
1896 /* struct cdp_peer_tid_stats - Per peer and per TID stats
1897  * @tx_avg_jitter: tx average jitter
1898  * @tx_avg_delay: tx average delay
1899  * @tx_avg_err: tx average error
1900  * @tx_total_success: tx total success
1901  * @tx_drop: tx drop
1902  */
1903 struct cdp_peer_tid_stats {
1904 #ifdef WLAN_PEER_JITTER
1905 	uint32_t tx_avg_jitter;
1906 	uint32_t tx_avg_delay;
1907 	uint64_t tx_avg_err;
1908 	uint64_t tx_total_success;
1909 	uint64_t tx_drop;
1910 #endif
1911 };
1912 
1913 /* struct cdp_interface_peer_stats - interface structure for txrx peer stats
1914  * @peer_mac: peer mac address
1915  * @vdev_id : vdev_id for the peer
1916  * @rssi_changed: denotes rssi is changed
1917  * @last_peer_tx_rate: peer tx rate for last transmission
1918  * @peer_tx_rate: tx rate for current transmission
1919  * @peer_rssi: current rssi value of peer
1920  * @tx_packet_count: tx packet count
1921  * @rx_packet_count: rx packet count
1922  * @tx_byte_count: tx byte count
1923  * @rx_byte_count: rx byte count
1924  * @per: per error rate
1925  * @ack_rssi: RSSI of the last ack received
1926  * @free_buff: free tx descriptor count
1927  * @rx_avg_snr: Avg Rx SNR
1928  */
1929 struct cdp_interface_peer_stats {
1930 	uint8_t  peer_mac[QDF_MAC_ADDR_SIZE];
1931 	uint8_t  vdev_id;
1932 	uint8_t  rssi_changed;
1933 	uint32_t last_peer_tx_rate;
1934 	uint32_t peer_tx_rate;
1935 	uint32_t peer_rssi;
1936 	uint32_t tx_packet_count;
1937 	uint32_t rx_packet_count;
1938 	uint32_t tx_byte_count;
1939 	uint32_t rx_byte_count;
1940 	uint32_t per;
1941 	uint32_t ack_rssi;
1942 	uint32_t free_buff;
1943 	uint32_t rx_avg_snr;
1944 };
1945 
1946 /* struct cdp_interface_peer_qos_stats - interface structure for peer qos stats
1947  * @peer_mac: peer mac address
1948  * @frame_control: frame control field
1949  * @qos_control: qos control field
1950  * @frame_control_info_valid: frame_control valid
1951  * @qos_control_info_valid: qos_control valid
1952  * @vdev_id : vdev_id for the peer
1953  */
1954 struct cdp_interface_peer_qos_stats {
1955 	uint8_t  peer_mac[QDF_MAC_ADDR_SIZE];
1956 	uint16_t frame_control;
1957 	uint16_t qos_control;
1958 	uint8_t  frame_control_info_valid;
1959 	uint8_t  qos_control_info_valid;
1960 	uint8_t  vdev_id;
1961 };
1962 
1963 /* Tx completions per interrupt */
1964 struct cdp_hist_tx_comp {
1965 	uint32_t pkts_1;
1966 	uint32_t pkts_2_20;
1967 	uint32_t pkts_21_40;
1968 	uint32_t pkts_41_60;
1969 	uint32_t pkts_61_80;
1970 	uint32_t pkts_81_100;
1971 	uint32_t pkts_101_200;
1972 	uint32_t pkts_201_plus;
1973 };
1974 
1975 /* Rx ring descriptors reaped per interrupt */
1976 struct cdp_hist_rx_ind {
1977 	uint32_t pkts_1;
1978 	uint32_t pkts_2_20;
1979 	uint32_t pkts_21_40;
1980 	uint32_t pkts_41_60;
1981 	uint32_t pkts_61_80;
1982 	uint32_t pkts_81_100;
1983 	uint32_t pkts_101_200;
1984 	uint32_t pkts_201_plus;
1985 };
1986 
1987 struct cdp_htt_tlv_hdr {
1988 	/* BIT [11 :  0]   :- tag
1989 	 * BIT [23 : 12]   :- length
1990 	 * BIT [31 : 24]   :- reserved
1991 	 */
1992 	uint32_t tag__length;
1993 };
1994 
1995 #define HTT_STATS_SUBTYPE_MAX     16
1996 
1997 struct cdp_htt_rx_pdev_fw_stats_tlv {
1998     struct cdp_htt_tlv_hdr tlv_hdr;
1999 
2000     /* BIT [ 7 :  0]   :- mac_id
2001      * BIT [31 :  8]   :- reserved
2002      */
2003     uint32_t mac_id__word;
2004     /* Num PPDU status processed from HW */
2005     uint32_t ppdu_recvd;
2006     /* Num MPDU across PPDUs with FCS ok */
2007     uint32_t mpdu_cnt_fcs_ok;
2008     /* Num MPDU across PPDUs with FCS err */
2009     uint32_t mpdu_cnt_fcs_err;
2010     /* Num MSDU across PPDUs */
2011     uint32_t tcp_msdu_cnt;
2012     /* Num MSDU across PPDUs */
2013     uint32_t tcp_ack_msdu_cnt;
2014     /* Num MSDU across PPDUs */
2015     uint32_t udp_msdu_cnt;
2016     /* Num MSDU across PPDUs */
2017     uint32_t other_msdu_cnt;
2018     /* Num MPDU on FW ring indicated */
2019     uint32_t fw_ring_mpdu_ind;
2020     /* Num MGMT MPDU given to protocol */
2021     uint32_t fw_ring_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
2022     /* Num ctrl MPDU given to protocol */
2023     uint32_t fw_ring_ctrl_subtype[HTT_STATS_SUBTYPE_MAX];
2024     /* Num mcast data packet received */
2025     uint32_t fw_ring_mcast_data_msdu;
2026     /* Num broadcast data packet received */
2027     uint32_t fw_ring_bcast_data_msdu;
2028     /* Num unicat data packet received */
2029     uint32_t fw_ring_ucast_data_msdu;
2030     /* Num null data packet received  */
2031     uint32_t fw_ring_null_data_msdu;
2032     /* Num MPDU on FW ring dropped */
2033     uint32_t fw_ring_mpdu_drop;
2034 
2035     /* Num buf indication to offload */
2036     uint32_t ofld_local_data_ind_cnt;
2037     /* Num buf recycle from offload */
2038     uint32_t ofld_local_data_buf_recycle_cnt;
2039     /* Num buf indication to data_rx */
2040     uint32_t drx_local_data_ind_cnt;
2041     /* Num buf recycle from data_rx */
2042     uint32_t drx_local_data_buf_recycle_cnt;
2043     /* Num buf indication to protocol */
2044     uint32_t local_nondata_ind_cnt;
2045     /* Num buf recycle from protocol */
2046     uint32_t local_nondata_buf_recycle_cnt;
2047 
2048     /* Num buf fed */
2049     uint32_t fw_status_buf_ring_refill_cnt;
2050     /* Num ring empty encountered */
2051     uint32_t fw_status_buf_ring_empty_cnt;
2052     /* Num buf fed  */
2053     uint32_t fw_pkt_buf_ring_refill_cnt;
2054     /* Num ring empty encountered */
2055     uint32_t fw_pkt_buf_ring_empty_cnt;
2056     /* Num buf fed  */
2057     uint32_t fw_link_buf_ring_refill_cnt;
2058     /* Num ring empty encountered  */
2059     uint32_t fw_link_buf_ring_empty_cnt;
2060 
2061     /* Num buf fed */
2062     uint32_t host_pkt_buf_ring_refill_cnt;
2063     /* Num ring empty encountered */
2064     uint32_t host_pkt_buf_ring_empty_cnt;
2065     /* Num buf fed */
2066     uint32_t mon_pkt_buf_ring_refill_cnt;
2067     /* Num ring empty encountered */
2068     uint32_t mon_pkt_buf_ring_empty_cnt;
2069     /* Num buf fed */
2070     uint32_t mon_status_buf_ring_refill_cnt;
2071     /* Num ring empty encountered */
2072     uint32_t mon_status_buf_ring_empty_cnt;
2073     /* Num buf fed */
2074     uint32_t mon_desc_buf_ring_refill_cnt;
2075     /* Num ring empty encountered */
2076     uint32_t mon_desc_buf_ring_empty_cnt;
2077     /* Num buf fed */
2078     uint32_t mon_dest_ring_update_cnt;
2079     /* Num ring full encountered */
2080     uint32_t mon_dest_ring_full_cnt;
2081 
2082     /* Num rx suspend is attempted */
2083     uint32_t rx_suspend_cnt;
2084     /* Num rx suspend failed */
2085     uint32_t rx_suspend_fail_cnt;
2086     /* Num rx resume attempted */
2087     uint32_t rx_resume_cnt;
2088     /* Num rx resume failed */
2089     uint32_t rx_resume_fail_cnt;
2090     /* Num rx ring switch */
2091     uint32_t rx_ring_switch_cnt;
2092     /* Num rx ring restore */
2093     uint32_t rx_ring_restore_cnt;
2094     /* Num rx flush issued */
2095     uint32_t rx_flush_cnt;
2096 };
2097 
2098 /* == TX PDEV STATS == */
2099 struct cdp_htt_tx_pdev_stats_cmn_tlv {
2100     struct cdp_htt_tlv_hdr tlv_hdr;
2101 
2102     /* BIT [ 7 :  0]   :- mac_id
2103      * BIT [31 :  8]   :- reserved
2104      */
2105     uint32_t mac_id__word;
2106     /* Num queued to HW */
2107     uint32_t hw_queued;
2108     /* Num PPDU reaped from HW */
2109     uint32_t hw_reaped;
2110     /* Num underruns */
2111     uint32_t underrun;
2112     /* Num HW Paused counter. */
2113     uint32_t hw_paused;
2114     /* Num HW flush counter. */
2115     uint32_t hw_flush;
2116     /* Num HW filtered counter. */
2117     uint32_t hw_filt;
2118     /* Num PPDUs cleaned up in TX abort */
2119     uint32_t tx_abort;
2120     /* Num MPDUs requed by SW */
2121     uint32_t mpdu_requed;
2122     /* excessive retries */
2123     uint32_t tx_xretry;
2124     /* Last used data hw rate code */
2125     uint32_t data_rc;
2126     /* frames dropped due to excessive sw retries */
2127     uint32_t mpdu_dropped_xretry;
2128     /* illegal rate phy errors  */
2129     uint32_t illgl_rate_phy_err;
2130     /* wal pdev continuous xretry */
2131     uint32_t cont_xretry;
2132     /* wal pdev continuous xretry */
2133     uint32_t tx_timeout;
2134     /* wal pdev resets  */
2135     uint32_t pdev_resets;
2136     /* PhY/BB underrun */
2137     uint32_t phy_underrun;
2138     /* MPDU is more than txop limit */
2139     uint32_t txop_ovf;
2140     /* Number of Sequences posted */
2141     uint32_t seq_posted;
2142     /* Number of Sequences failed queueing */
2143     uint32_t seq_failed_queueing;
2144     /* Number of Sequences completed */
2145     uint32_t seq_completed;
2146     /* Number of Sequences restarted */
2147     uint32_t seq_restarted;
2148     /* Number of MU Sequences posted */
2149     uint32_t mu_seq_posted;
2150     /* Number of time HW ring is paused between seq switch within ISR */
2151     uint32_t seq_switch_hw_paused;
2152     /* Number of times seq continuation in DSR */
2153     uint32_t next_seq_posted_dsr;
2154     /* Number of times seq continuation in ISR */
2155     uint32_t seq_posted_isr;
2156     /* Number of seq_ctrl cached. */
2157     uint32_t seq_ctrl_cached;
2158     /* Number of MPDUs successfully transmitted */
2159     uint32_t mpdu_count_tqm;
2160     /* Number of MSDUs successfully transmitted */
2161     uint32_t msdu_count_tqm;
2162     /* Number of MPDUs dropped */
2163     uint32_t mpdu_removed_tqm;
2164     /* Number of MSDUs dropped */
2165     uint32_t msdu_removed_tqm;
2166     /* Num MPDUs flushed by SW, HWPAUSED, SW TXABORT (Reset,channel change) */
2167     uint32_t mpdus_sw_flush;
2168     /* Num MPDUs filtered by HW, all filter condition (TTL expired) */
2169     uint32_t mpdus_hw_filter;
2170     /* Num MPDUs truncated by PDG (TXOP, TBTT, PPDU_duration based on rate, dyn_bw) */
2171     uint32_t mpdus_truncated;
2172     /* Num MPDUs that was tried but didn't receive ACK or BA */
2173     uint32_t mpdus_ack_failed;
2174     /* Num MPDUs that was dropped due to expiry (MSDU TTL). */
2175     uint32_t mpdus_expired;
2176     /* Num MPDUs that was retried within seq_ctrl (MGMT/LEGACY) */
2177     uint32_t mpdus_seq_hw_retry;
2178     /* Num of TQM acked cmds processed */
2179     uint32_t ack_tlv_proc;
2180     /* coex_abort_mpdu_cnt valid. */
2181     uint32_t coex_abort_mpdu_cnt_valid;
2182     /* coex_abort_mpdu_cnt from TX FES stats. */
2183     uint32_t coex_abort_mpdu_cnt;
2184     /* Number of total PPDUs(DATA, MGMT, excludes selfgen) tried over the air (OTA) */
2185     uint32_t num_total_ppdus_tried_ota;
2186     /* Number of data PPDUs tried over the air (OTA) */
2187     uint32_t num_data_ppdus_tried_ota;
2188     /* Num Local control/mgmt frames (MSDUs) queued */
2189     uint32_t local_ctrl_mgmt_enqued;
2190     /* local_ctrl_mgmt_freed:
2191      * Num Local control/mgmt frames (MSDUs) done
2192      * It includes all local ctrl/mgmt completions
2193      * (acked, no ack, flush, TTL, etc)
2194      */
2195     uint32_t local_ctrl_mgmt_freed;
2196     /* Num Local data frames (MSDUs) queued */
2197     uint32_t local_data_enqued;
2198     /* local_data_freed:
2199      * Num Local data frames (MSDUs) done
2200      * It includes all local data completions
2201      * (acked, no ack, flush, TTL, etc)
2202      */
2203     uint32_t local_data_freed;
2204 
2205 	/* Num MPDUs tried by SW */
2206 	uint32_t mpdu_tried;
2207 	/* Num of waiting seq posted in isr completion handler */
2208 	uint32_t isr_wait_seq_posted;
2209 	uint32_t tx_active_dur_us_low;
2210 	uint32_t tx_active_dur_us_high;
2211 };
2212 
2213 struct cdp_htt_tx_pdev_stats_urrn_tlv_v {
2214     struct cdp_htt_tlv_hdr tlv_hdr;
2215     uint32_t urrn_stats[1]; /* HTT_TX_PDEV_MAX_URRN_STATS */
2216 };
2217 
2218 /* NOTE: Variable length TLV, use length spec to infer array size */
2219 struct cdp_htt_tx_pdev_stats_flush_tlv_v {
2220     struct cdp_htt_tlv_hdr tlv_hdr;
2221     uint32_t flush_errs[1]; /* HTT_TX_PDEV_MAX_FLUSH_REASON_STATS */
2222 };
2223 
2224 /* NOTE: Variable length TLV, use length spec to infer array size */
2225 struct cdp_htt_tx_pdev_stats_sifs_tlv_v {
2226     struct cdp_htt_tlv_hdr tlv_hdr;
2227     uint32_t sifs_status[1]; /* HTT_TX_PDEV_MAX_SIFS_BURST_STATS */
2228 };
2229 
2230 /* NOTE: Variable length TLV, use length spec to infer array size */
2231 struct cdp_htt_tx_pdev_stats_phy_err_tlv_v {
2232     struct cdp_htt_tlv_hdr tlv_hdr;
2233     uint32_t  phy_errs[1]; /* HTT_TX_PDEV_MAX_PHY_ERR_STATS */
2234 };
2235 
2236 /* == RX PDEV/SOC STATS == */
2237 /* HTT_STATS_RX_SOC_FW_STATS_TAG */
2238 struct cdp_htt_rx_soc_fw_stats_tlv {
2239     struct cdp_htt_tlv_hdr tlv_hdr;
2240     /* Num Packets received on REO FW ring */
2241     uint32_t fw_reo_ring_data_msdu;
2242     /* Num bc/mc packets indicated from fw to host */
2243     uint32_t fw_to_host_data_msdu_bcmc;
2244     /* Num unicast packets indicated from fw to host */
2245     uint32_t fw_to_host_data_msdu_uc;
2246     /* Num remote buf recycle from offload  */
2247     uint32_t ofld_remote_data_buf_recycle_cnt;
2248     /* Num remote free buf given to offload */
2249     uint32_t ofld_remote_free_buf_indication_cnt;
2250 };
2251 
2252 struct cdp_htt_rx_soc_fw_refill_ring_num_refill_tlv_v {
2253     struct cdp_htt_tlv_hdr tlv_hdr;
2254     /* Num total buf refilled from refill ring */
2255     uint32_t refill_ring_num_refill[1]; /* HTT_RX_STATS_REFILL_MAX_RING */
2256 };
2257 
2258 struct cdp_htt_rx_pdev_fw_ring_mpdu_err_tlv_v {
2259     struct cdp_htt_tlv_hdr tlv_hdr;
2260     /* Num error MPDU for each RxDMA error type  */
2261     uint32_t fw_ring_mpdu_err[1]; /* HTT_RX_STATS_RXDMA_MAX_ERR */
2262 };
2263 
2264 struct cdp_htt_rx_pdev_fw_mpdu_drop_tlv_v {
2265     struct cdp_htt_tlv_hdr tlv_hdr;
2266     /* Num MPDU dropped  */
2267     uint32_t fw_mpdu_drop[1]; /* HTT_RX_STATS_FW_DROP_REASON_MAX */
2268 };
2269 
2270 #define HTT_STATS_PHY_ERR_MAX 43
2271 
2272 struct cdp_htt_rx_pdev_fw_stats_phy_err_tlv {
2273     struct cdp_htt_tlv_hdr tlv_hdr;
2274 
2275     /* BIT [ 7 :  0]   :- mac_id
2276      * BIT [31 :  8]   :- reserved
2277      */
2278     uint32_t mac_id__word;
2279     /* Num of phy err */
2280     uint32_t total_phy_err_cnt;
2281     /* Counts of different types of phy errs
2282      * The mapping of PHY error types to phy_err array elements is HW dependent.
2283      * The only currently-supported mapping is shown below:
2284      *
2285      * 0 phyrx_err_phy_off Reception aborted due to receiving a PHY_OFF TLV
2286      * 1 phyrx_err_synth_off
2287      * 2 phyrx_err_ofdma_timing
2288      * 3 phyrx_err_ofdma_signal_parity
2289      * 4 phyrx_err_ofdma_rate_illegal
2290      * 5 phyrx_err_ofdma_length_illegal
2291      * 6 phyrx_err_ofdma_restart
2292      * 7 phyrx_err_ofdma_service
2293      * 8 phyrx_err_ppdu_ofdma_power_drop
2294      * 9 phyrx_err_cck_blokker
2295      * 10 phyrx_err_cck_timing
2296      * 11 phyrx_err_cck_header_crc
2297      * 12 phyrx_err_cck_rate_illegal
2298      * 13 phyrx_err_cck_length_illegal
2299      * 14 phyrx_err_cck_restart
2300      * 15 phyrx_err_cck_service
2301      * 16 phyrx_err_cck_power_drop
2302      * 17 phyrx_err_ht_crc_err
2303      * 18 phyrx_err_ht_length_illegal
2304      * 19 phyrx_err_ht_rate_illegal
2305      * 20 phyrx_err_ht_zlf
2306      * 21 phyrx_err_false_radar_ext
2307      * 22 phyrx_err_green_field
2308      * 23 phyrx_err_bw_gt_dyn_bw
2309      * 24 phyrx_err_leg_ht_mismatch
2310      * 25 phyrx_err_vht_crc_error
2311      * 26 phyrx_err_vht_siga_unsupported
2312      * 27 phyrx_err_vht_lsig_len_invalid
2313      * 28 phyrx_err_vht_ndp_or_zlf
2314      * 29 phyrx_err_vht_nsym_lt_zero
2315      * 30 phyrx_err_vht_rx_extra_symbol_mismatch
2316      * 31 phyrx_err_vht_rx_skip_group_id0
2317      * 32 phyrx_err_vht_rx_skip_group_id1to62
2318      * 33 phyrx_err_vht_rx_skip_group_id63
2319      * 34 phyrx_err_ofdm_ldpc_decoder_disabled
2320      * 35 phyrx_err_defer_nap
2321      * 36 phyrx_err_fdomain_timeout
2322      * 37 phyrx_err_lsig_rel_check
2323      * 38 phyrx_err_bt_collision
2324      * 39 phyrx_err_unsupported_mu_feedback
2325      * 40 phyrx_err_ppdu_tx_interrupt_rx
2326      * 41 phyrx_err_unsupported_cbf
2327      * 42 phyrx_err_other
2328      */
2329     uint32_t phy_err[HTT_STATS_PHY_ERR_MAX];
2330 };
2331 
2332 struct cdp_htt_rx_soc_fw_refill_ring_empty_tlv_v {
2333     struct cdp_htt_tlv_hdr tlv_hdr;
2334     /* Num ring empty encountered */
2335     uint32_t refill_ring_empty_cnt[1]; /* HTT_RX_STATS_REFILL_MAX_RING */
2336 };
2337 
2338 struct cdp_htt_tx_pdev_stats {
2339     struct cdp_htt_tx_pdev_stats_cmn_tlv cmn_tlv;
2340     struct cdp_htt_tx_pdev_stats_urrn_tlv_v underrun_tlv;
2341     struct cdp_htt_tx_pdev_stats_sifs_tlv_v sifs_tlv;
2342     struct cdp_htt_tx_pdev_stats_flush_tlv_v flush_tlv;
2343     struct cdp_htt_tx_pdev_stats_phy_err_tlv_v phy_err_tlv;
2344 };
2345 
2346 struct cdp_htt_rx_soc_stats_t {
2347     struct cdp_htt_rx_soc_fw_stats_tlv fw_tlv;
2348     struct cdp_htt_rx_soc_fw_refill_ring_empty_tlv_v fw_refill_ring_empty_tlv;
2349     struct cdp_htt_rx_soc_fw_refill_ring_num_refill_tlv_v fw_refill_ring_num_refill_tlv;
2350 };
2351 
2352 struct cdp_htt_rx_pdev_stats {
2353     struct cdp_htt_rx_soc_stats_t soc_stats;
2354     struct cdp_htt_rx_pdev_fw_stats_tlv fw_stats_tlv;
2355     struct cdp_htt_rx_pdev_fw_ring_mpdu_err_tlv_v fw_ring_mpdu_err_tlv;
2356     struct cdp_htt_rx_pdev_fw_mpdu_drop_tlv_v fw_ring_mpdu_drop;
2357     struct cdp_htt_rx_pdev_fw_stats_phy_err_tlv fw_stats_phy_err_tlv;
2358 };
2359 
2360 #ifdef WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG
2361 /* Since protocol type enumeration value is passed as CCE metadata
2362  * to firmware, add a constant offset before passing it to firmware
2363  */
2364 #define RX_PROTOCOL_TAG_START_OFFSET  128
2365 /* This should align with packet type enumerations in ieee80211_ioctl.h
2366  * and wmi_unified_param.h files
2367  */
2368 #define RX_PROTOCOL_TAG_MAX   24
2369 /* Macro that should be used to dump the statistics counter for all
2370  * protocol types
2371  */
2372 #define RX_PROTOCOL_TAG_ALL 0xff
2373 #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */
2374 
2375 #ifdef WLAN_FEATURE_11BE
2376 #define OFDMA_NUM_RU_SIZE 16
2377 #else
2378 #define OFDMA_NUM_RU_SIZE 7
2379 #endif
2380 
2381 #define OFDMA_NUM_USERS	37
2382 
2383 #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
2384 /*
2385  * mac_freeze_capture_reason - capture reason counters
2386  * @FREEZE_REASON_TM: When m_directed_ftm is enabled, this CFR data is
2387  * captured for a Timing Measurement (TM) frame.
2388  * @FREEZE_REASON_FTM: When m_directed_ftm is enabled, this CFR data is
2389  * captured for a Fine Timing Measurement (FTM) frame.
2390  * @FREEZE_REASON_ACK_RESP_TO_TM_FTM: When m_all_ftm_ack is enabled, this CFR
2391  * data is captured for an ACK received for the FTM/TM frame sent to a station.
2392  * @FREEZE_REASON_TA_RA_TYPE_FILTER: When m_ta_ra_filter is enabled, this CFR
2393  * data is captured for a PPDU received,since the CFR TA_RA filter is met.
2394  * @FREEZE_REASON_NDPA_NDP: When m_ndpa_ndp_directed(or)m_ndpa_ndp_all is
2395  * enabled, this CFR data is captured for an NDP frame received.
2396  * @FREEZE_REASON_ALL_PACKET: When m_all_packet is enabled, this CFR data is
2397  * captured for an incoming PPDU.
2398  */
2399 enum mac_freeze_capture_reason {
2400 	FREEZE_REASON_TM = 0,
2401 	FREEZE_REASON_FTM,
2402 	FREEZE_REASON_ACK_RESP_TO_TM_FTM,
2403 	FREEZE_REASON_TA_RA_TYPE_FILTER,
2404 	FREEZE_REASON_NDPA_NDP,
2405 	FREEZE_REASON_ALL_PACKET,
2406 	FREEZE_REASON_MAX,
2407 };
2408 
2409 /*
2410  * chan_capture_status: capture status counters
2411  * @CAPTURE_IDLE: CFR data is not captured, since VCSR setting for CFR/RCC is
2412  * not enabled.
2413  * @CAPTURE_BUSY: CFR data is not available, since previous channel
2414  * upload is in progress
2415  * @CAPTURE_ACTIVE: CFR data is captured in HW registers
2416  * @CAPTURE_NO_BUFFER: CFR data is not captured, since no buffer is available
2417  * in IPC ring to DMA CFR data
2418  */
2419 enum chan_capture_status {
2420 	CAPTURE_IDLE = 0,
2421 	CAPTURE_BUSY,
2422 	CAPTURE_ACTIVE,
2423 	CAPTURE_NO_BUFFER,
2424 	CAPTURE_MAX,
2425 };
2426 
2427 /* struct cdp_cfr_rcc_stats - CFR RCC debug statistics
2428  * @bb_captured_channel_cnt: No. of PPDUs for which MAC sent Freeze TLV to PHY
2429  * @bb_captured_timeout_cnt: No. of PPDUs for which CFR filter criteria matched
2430  * but MAC did not send Freeze TLV to PHY as time exceeded freeze tlv delay
2431  * count threshold
2432  * @rx_loc_info_valid_cnt: No. of PPDUs for which PHY could find a valid buffer
2433  * in ucode IPC ring
2434  * @chan_capture_status[]: capture status counters
2435  *	[0] - No. of PPDUs with capture status CAPTURE_IDLE
2436  *	[1] - No. of PPDUs with capture status CAPTURE_BUSY
2437  *	[2] - No. of PPDUs with capture status CAPTURE_ACTIVE
2438  *	[3] - No. of PPDUs with capture status CAPTURE_NO_BUFFER
2439  * @reason_cnt[]: capture reason counters
2440  *	[0] - No. PPDUs filtered due to freeze_reason_TM
2441  *	[1] - No. PPDUs filtered due to freeze_reason_FTM
2442  *	[2] - No. PPDUs filtered due to freeze_reason_ACK_resp_to_TM_FTM
2443  *	[3] - No. PPDUs filtered due to freeze_reason_TA_RA_TYPE_FILTER
2444  *	[4] - No. PPDUs filtered due to freeze_reason_NDPA_NDP
2445  *	[5] - No. PPDUs filtered due to freeze_reason_ALL_PACKET
2446  */
2447 struct cdp_cfr_rcc_stats {
2448 	uint64_t bb_captured_channel_cnt;
2449 	uint64_t bb_captured_timeout_cnt;
2450 	uint64_t rx_loc_info_valid_cnt;
2451 	uint64_t chan_capture_status[CAPTURE_MAX];
2452 	uint64_t reason_cnt[FREEZE_REASON_MAX];
2453 };
2454 #else
2455 struct cdp_cfr_rcc_stats {
2456 };
2457 #endif
2458 
2459 /* struct cdp_per_cpu_packets - Per cpu packets
2460  * @num_cpus: Number of cpus
2461  * @pkts: packet count per core
2462  */
2463 struct cdp_per_cpu_packets {
2464 	uint8_t num_cpus;
2465 	uint64_t pkts[CDP_NR_CPUS][CDP_MAX_RX_DEST_RINGS];
2466 };
2467 
2468 /* struct cdp_soc_stats - soc stats
2469  * @tx.egress: Total packets transmitted
2470  * @tx.tx_invalid_peer: packets dropped on tx because of no peer
2471  * @tx.tx_hw_enq: Enqueues per tx hw ring
2472  * @tx.tx_hw_ring_full: descriptors in each tx hw ring
2473  * @tx.desc_in_use: Descriptors in use at soc
2474  * @tx.dropped_fw_removed: HW_release_reason == FW removed
2475  * @tx.invalid_release_source: tx completion release_src != HW or FW
2476  * @tx.wifi_internal_error: tx completion wifi_internal_error
2477  * @tx.non_wifi_internal_err: tx completion non_wifi_internal_error
2478  * @tx.tx_comp_loop_pkt_limit_hit: TX Comp loop packet limit hit
2479  * @tx.hp_oos2: Head pointer Out of sync at the end of dp_tx_comp_handler
2480  * @tx.tx_comp_exception: tx desc freed as part of vdev detach
2481  * @rx.ingress: Total rx packets count
2482  * @rx.err_ring_pkts: Total Packets in Rx Error ring
2483  * @rx.rx_frags: No of Fragments
2484  * @rx.rx_hw_reinject: No of reinjected packets
2485  * @rx.bar_frame: Number of bar frames received
2486  * @rx.rx_frag_err_len_error: Fragments dropped due to len errors in skb
2487  * @rx.rx_frag_err_no_peer: Fragments dropped due to no peer found
2488  * @rx.rx_frag_wait: No of incomplete fragments in waitlist
2489  * @rx.rx_frag_err: Fragments dropped due to errors
2490  * @rx.rx_frag_oor: Fragments received OOR causing sequence num mismatch
2491  * @rx.reap_loop_pkt_limit_hit: Reap loop packet limit hit
2492  * @rx.hp_oos2: Head pointer Out of sync at the end of dp_rx_process
2493  * @rx.near_full: Rx ring near full
2494  * @rx.msdu_scatter_wait_break: Break ring reaping as not all scattered msdu
2495  * received
2496  * @rx.rx_sw_route_drop: Number of frames routed from rx sw ring
2497  * @rx.rx_hw_route_drop: Number of frames routed from rx hw ring
2498  * @rx.rx_packets: packet count per core
2499  * @rx.err.rx_rejected: RX msdu rejected count on delivery to vdev stack_fn
2500  * @rx.err.raw_frm_drop: RX raw frame dropped count
2501  * @rx.err.phy_ring_access_fail: phy ring access Fail error count
2502  * @rx.err.phy_ring_access_full_fail: phy ring access full Fail error count
2503  * @rx.err.phy_rx_error: phy rx order ERR Count
2504  * @rx.err.phy_rx_dest_dup: phy rx order DEST Duplicate count
2505  * @rx.err.phy_wifi_rel_dup: phy wifi RELEASE Duplicate count
2506  * @rx.err.phy_rx_sw_err_dup: phy rx sw error Duplicate count
2507  * @rx.err.invalid_rbm: Invalid RBM error count
2508  * @rx.err.invalid_vdev: Invalid VDEV Error count
2509  * @rx.err.invalid_pdev: Invalid PDEV error count
2510  * @rx.err.pkt_delivered_no_peer: Pkts delivered to stack that no related peer
2511  * @rx.err.defrag_peer_uninit: Defrag peer uninit error count
2512  * @rx.err.invalid_sa_da_idx: Invalid sa_idx or da_idx
2513  * @rx.err.msdu_done_fail: MSDU DONE failures
2514  * @ex.err.rx_invalid_peer: Invalid PEER Error count
2515  * @rx.err.rx_invalid_peer_id: Invalid PEER ID count
2516  * @rx.err.rx_invalid_pkt_len: Invalid packet length count
2517  * @rx.err.rx_sw_error: RX sw error count
2518  * @rx.err.rx_desc_invalid_magic: RX DEST Desc Invalid Magic count
2519  * @rx.err.rx_hw_error: rx hw Error count
2520  * @rx.err.rx_hw_cmd_send_fail: Rx hw cmd send fail/requeue count
2521  * @rx.err.rx_hw_cmd_send_drain: Rx hw cmd send drain count
2522  * @rx.err.scatter_msdu: RX msdu drop count due to scatter
2523  * @rx.err.invalid_cookie: RX msdu drop count due to invalid cookie
2524  * @rx.err.stale_cookie: Count of stale cookie read in RX path
2525  * @rx.err.rx_2k_jump_delba_sent: Delba sent count due to RX 2k jump
2526  * @rx.err.rx_2k_jump_to_stack: RX 2k jump msdu indicated to stack count
2527  * @rx.err.rx_2k_jump_drop: RX 2k jump msdu dropped count
2528  * @rx.err.rx_hw_err_oor_drop: Rx HW OOR msdu drop count
2529  * @rx.err.rx_hw_err_oor_to_stack: Rx HW OOR msdu indicated to stack count
2530  * @rx.err.rx_hw_err_oor_sg_count: Rx HW OOR scattered msdu count
2531  * @rx.err.msdu_count_mismatch: Incorrect msdu count in MPDU desc info
2532  * @rx.err.invalid_link_cookie: Stale link desc cookie count
2533  * @rx.err.nbuf_sanity_fail: Nbuf sanity failure
2534  * @rx.err.dup_refill_link_desc: Duplicate link desc refilled
2535  * @rx.err.msdu_continuation_err: Incorrect msdu continuation bit in MSDU desc
2536  * @rx.err.ssn_update_count: Count of start sequence (ssn) updates
2537  * @rx.err.bar_handle_fail_count: Count of bar handling fail
2538  * @rx.err.intrabss_eapol_drop: EAPOL drop count in intrabss scenario
2539  * @rx.err.pn_in_dest_check_fail: PN check failed for 2K-jump or OOR error
2540  * @rx.err.msdu_len_err: MSDU len err count
2541  * @rx.err.rx_flush_count: Rx flush count
2542  * @ast.added: ast entry added count
2543  * @ast.deleted: ast entry deleted count
2544  * @ast.aged_out: ast entry aged out count
2545  * @ast.map_err: ast entry mapping error count
2546  * @ast.ast_mismatch: ast entry mismatch count
2547  * @mec.added: Mec added count
2548  * @mec.deleted: Mec deleted count
2549  */
2550 struct cdp_soc_stats {
2551 	struct {
2552 		struct cdp_pkt_info egress;
2553 		struct cdp_pkt_info tx_invalid_peer;
2554 		uint32_t tx_hw_enq[CDP_MAX_TX_DATA_RINGS];
2555 		uint32_t tx_hw_ring_full[CDP_MAX_TX_DATA_RINGS];
2556 		uint32_t desc_in_use;
2557 		uint32_t dropped_fw_removed;
2558 		uint32_t invalid_release_source;
2559 		uint32_t wifi_internal_error[CDP_MAX_WIFI_INT_ERROR_REASONS];
2560 		uint32_t non_wifi_internal_err;
2561 		uint32_t tx_comp_loop_pkt_limit_hit;
2562 		uint32_t hp_oos2;
2563 		uint32_t tx_comp_exception;
2564 	} tx;
2565 
2566 	struct {
2567 		struct cdp_pkt_info ingress;
2568 		uint32_t err_ring_pkts;
2569 		uint32_t rx_frags;
2570 		uint32_t rx_hw_reinject;
2571 		uint32_t bar_frame;
2572 		uint32_t rx_frag_err_len_error;
2573 		uint32_t rx_frag_err_no_peer;
2574 		uint32_t rx_frag_wait;
2575 		uint32_t rx_frag_err;
2576 		uint32_t rx_frag_oor;
2577 		uint32_t reap_loop_pkt_limit_hit;
2578 		uint32_t hp_oos2;
2579 		uint32_t near_full;
2580 		uint32_t msdu_scatter_wait_break;
2581 		uint32_t rx_sw_route_drop;
2582 		uint32_t rx_hw_route_drop;
2583 		struct cdp_per_cpu_packets rx_packets;
2584 
2585 		struct {
2586 			uint32_t rx_rejected;
2587 			uint32_t rx_raw_frm_drop;
2588 			uint32_t phy_ring_access_fail;
2589 			uint32_t phy_ring_access_full_fail;
2590 			uint32_t phy_rx_hw_error[CDP_MAX_RX_DEST_RINGS];
2591 			uint32_t phy_rx_hw_dest_dup;
2592 			uint32_t phy_wifi_rel_dup;
2593 			uint32_t phy_rx_sw_err_dup;
2594 			uint32_t invalid_rbm;
2595 			uint32_t invalid_vdev;
2596 			uint32_t invalid_pdev;
2597 			uint32_t pkt_delivered_no_peer;
2598 			uint32_t defrag_peer_uninit;
2599 			uint32_t invalid_sa_da_idx;
2600 			uint32_t msdu_done_fail;
2601 			struct cdp_pkt_info rx_invalid_peer;
2602 			struct cdp_pkt_info rx_invalid_peer_id;
2603 			struct cdp_pkt_info rx_invalid_pkt_len;
2604 			uint32_t rx_sw_error[CDP_WIFI_ERR_MAX];
2605 			uint32_t rx_desc_invalid_magic;
2606 			uint32_t rx_hw_error[CDP_RX_ERR_MAX];
2607 			uint32_t rx_hw_cmd_send_fail;
2608 			uint32_t rx_hw_cmd_send_drain;
2609 			uint32_t scatter_msdu;
2610 			uint32_t invalid_cookie;
2611 			uint32_t stale_cookie;
2612 			uint32_t rx_2k_jump_delba_sent;
2613 			uint32_t rx_2k_jump_to_stack;
2614 			uint32_t rx_2k_jump_drop;
2615 			uint32_t rx_hw_err_msdu_buf_rcved;
2616 			uint32_t rx_hw_err_msdu_buf_invalid_cookie;
2617 			uint32_t rx_hw_err_oor_drop;
2618 			uint32_t rx_hw_err_oor_to_stack;
2619 			uint32_t rx_hw_err_oor_sg_count;
2620 			uint32_t msdu_count_mismatch;
2621 			uint32_t invalid_link_cookie;
2622 			uint32_t nbuf_sanity_fail;
2623 			uint32_t dup_refill_link_desc;
2624 			uint32_t msdu_continuation_err;
2625 			uint32_t ssn_update_count;
2626 			uint32_t bar_handle_fail_count;
2627 			uint32_t intrabss_eapol_drop;
2628 			uint32_t pn_in_dest_check_fail;
2629 			uint32_t msdu_len_err;
2630 			uint32_t rx_flush_count;
2631 		} err;
2632 	} rx;
2633 
2634 	struct {
2635 		uint32_t added;
2636 		uint32_t deleted;
2637 		uint32_t aged_out;
2638 		uint32_t map_err;
2639 		uint32_t ast_mismatch;
2640 	} ast;
2641 
2642 	struct {
2643 		uint32_t added;
2644 		uint32_t deleted;
2645 	} mec;
2646 };
2647 
2648 #ifdef WLAN_TELEMETRY_STATS_SUPPORT
2649 /**
2650  * struct cdp_pdev_telemetry_stats- Structure to hold pdev telemetry stats
2651  * @tx_mpdu_failed: Tx mpdu failed
2652  * @tx_mpdu_total: Total tx mpdus
2653  */
2654 struct cdp_pdev_telemetry_stats {
2655 	uint32_t tx_mpdu_failed;
2656 	uint32_t tx_mpdu_total;
2657 };
2658 
2659 /**
2660  * struct cdp_peer_telemetry_stats- Structure to hold peer telemetry stats
2661  * @tx_mpdu_retried: Tx mpdus retried
2662  * @tx_mpdu_total: Total tx mpdus
2663  * @rx_mpdu_retried: Rx mpdus retried
2664  * @rx_mpdu_total: Total rx mpdus
2665  * @airtime_consumption: airtime consumption of that peer
2666  * @snr: peer average snr
2667  */
2668 struct cdp_peer_telemetry_stats {
2669 	uint32_t tx_mpdu_retried;
2670 	uint32_t tx_mpdu_total;
2671 	uint32_t rx_mpdu_retried;
2672 	uint32_t rx_mpdu_total;
2673 	uint8_t airtime_consumption;
2674 	uint8_t snr;
2675 };
2676 #endif
2677 
2678 /* struct cdp_pdev_stats - pdev stats
2679  * @msdu_not_done: packets dropped because msdu done bit not set
2680  * @mec:Multicast Echo check
2681  * @mesh_filter: Mesh Filtered packets
2682  * @mon_rx_drop: packets dropped on monitor vap
2683  * @wifi_parse: rxdma errors due to wifi parse error
2684  * @mon_radiotap_update_err: not enough space to update radiotap
2685  * @pkts: total packets replenished
2686  * @rxdma_err: rxdma errors for replenished
2687  * @nbuf_alloc_fail: nbuf alloc failed
2688  * @frag_alloc_fail: frag alloc failed
2689  * @map_err: Mapping failure
2690  * @x86_fail: x86 failures
2691  * @low_thresh_intrs: low threshold interrupts
2692  * @rx_raw_pkts: Rx Raw Packets
2693  * @mesh_mem_alloc: Mesh Rx Stats Alloc fail
2694  * @tso_desc_cnt: TSO descriptors
2695  * @sg_desc_cnt: SG Descriptors
2696  * @vlan_tag_stp_cnt: Vlan tagged Stp packets in wifi parse error
2697  * @desc_alloc_fail: desc alloc failed errors
2698  * @ip_csum_err: ip checksum errors
2699  * @tcp_udp_csum_err: tcp/udp checksum errors
2700  * @buf_freelist: buffers added back in freelist
2701  * @tx_i: Tx Ingress stats
2702  * @rx_i: Rx Ingress stats
2703  * @tx:CDP Tx Stats
2704  * @rx: CDP Rx Stats
2705  * @tx_comp_histogram: Number of Tx completions per interrupt
2706  * @rx_ind_histogram:  Number of Rx ring descriptors reaped per interrupt
2707  * @ppdu_stats_counter: ppdu stats counter
2708  * @cdp_delayed_ba_not_recev: counter for delayed ba not received
2709  * @htt_tx_pdev_stats: htt pdev stats for tx
2710  * @htt_rx_pdev_stats: htt pdev stats for rx
2711  * @data_rx_ru_size: UL ofdma data ru size counter array
2712  * @nondata_rx_ru_size: UL ofdma non data ru size counter array
2713  * @data_rx_ppdu: data rx ppdu counter
2714  * @data_user: data user counter array
2715  * @tx_ppdu_proc: stats counter for tx ppdu processed
2716  * @ack_ba_comes_twice: stats counter for ack_ba_comes twice
2717  * @ppdu_drop: stats counter for ppdu_desc drop once threshold reached
2718  * @ppdu_wrap_drop: stats counter for ppdu desc drop on wrap around
2719  * @peer_unauth_rx_pkt_drop: stats counter for drops due to unauthorized peer
2720  * @telemetry_stats: pdev telemetry stats
2721  */
2722 struct cdp_pdev_stats {
2723 	struct {
2724 		uint32_t msdu_not_done;
2725 		uint32_t mec;
2726 		uint32_t mesh_filter;
2727 		uint32_t wifi_parse;
2728 		/* Monitor mode related */
2729 		uint32_t mon_rx_drop;
2730 		uint32_t mon_radiotap_update_err;
2731 	} dropped;
2732 
2733 	struct {
2734 		struct cdp_pkt_info pkts;
2735 		uint32_t rxdma_err;
2736 		uint32_t nbuf_alloc_fail;
2737 		uint32_t frag_alloc_fail;
2738 		uint32_t map_err;
2739 		uint32_t x86_fail;
2740 		uint32_t low_thresh_intrs;
2741 	} replenish;
2742 
2743 	uint32_t rx_raw_pkts;
2744 	uint32_t mesh_mem_alloc;
2745 	uint32_t tso_desc_cnt;
2746 	uint32_t sg_desc_cnt;
2747 	uint32_t vlan_tag_stp_cnt;
2748 
2749 	/* Rx errors */
2750 	struct {
2751 		uint32_t desc_alloc_fail;
2752 		uint32_t desc_lt_alloc_fail;
2753 		uint32_t ip_csum_err;
2754 		uint32_t tcp_udp_csum_err;
2755 		uint32_t rxdma_error;
2756 		uint32_t reo_error;
2757 	} err;
2758 
2759 	uint32_t buf_freelist;
2760 	struct cdp_tx_ingress_stats tx_i;
2761 	struct cdp_rx_ingress_stats rx_i;
2762 	struct cdp_tx_stats tx;
2763 	struct cdp_rx_stats rx;
2764 	struct cdp_hist_tx_comp tx_comp_histogram;
2765 	struct cdp_hist_rx_ind rx_ind_histogram;
2766 	uint64_t ppdu_stats_counter[CDP_PPDU_STATS_MAX_TAG];
2767 	uint32_t cdp_delayed_ba_not_recev;
2768 
2769 	struct cdp_htt_tx_pdev_stats  htt_tx_pdev_stats;
2770 	struct cdp_htt_rx_pdev_stats  htt_rx_pdev_stats;
2771 
2772 	/* Received wdi messages from fw */
2773 	uint32_t wdi_event[CDP_WDI_NUM_EVENTS];
2774 	struct cdp_tid_stats tid_stats;
2775 
2776 	/* numbers of data/nondata per RU sizes */
2777 	struct {
2778 		uint32_t data_rx_ru_size[OFDMA_NUM_RU_SIZE];
2779 		uint32_t nondata_rx_ru_size[OFDMA_NUM_RU_SIZE];
2780 		uint32_t data_rx_ppdu;
2781 		uint32_t data_users[OFDMA_NUM_USERS];
2782 	} ul_ofdma;
2783 
2784 	struct cdp_tso_stats tso_stats;
2785 	struct cdp_cfr_rcc_stats rcc;
2786 
2787 	uint64_t tx_ppdu_proc;
2788 	uint64_t ack_ba_comes_twice;
2789 	uint64_t ppdu_drop;
2790 	uint64_t ppdu_wrap_drop;
2791 
2792 	struct {
2793 		uint64_t num_bufs_consumed;
2794 		uint64_t num_pool_bufs_replenish;
2795 		uint64_t num_bufs_alloc_success;
2796 	} rx_buffer_pool;
2797 
2798 	struct {
2799 		uint64_t num_bufs_refilled;
2800 		uint64_t num_bufs_allocated;
2801 	} rx_refill_buff_pool;
2802 
2803 	uint32_t peer_unauth_rx_pkt_drop;
2804 #ifdef WLAN_TELEMETRY_STATS_SUPPORT
2805 	struct cdp_pdev_telemetry_stats telemetry_stats;
2806 #endif
2807 };
2808 
2809 /* struct cdp_peer_hmwds_ast_add_status - hmwds peer ast add status
2810  * @vdev_id: vdev id
2811  * @status: ast add status
2812  * @peer_mac: peer mac address
2813  * @ast_mac: ast node mac address
2814  */
2815 struct cdp_peer_hmwds_ast_add_status {
2816 	uint32_t vdev_id;
2817 	uint32_t status;
2818 	uint8_t  peer_mac[QDF_MAC_ADDR_SIZE];
2819 	uint8_t  ast_mac[QDF_MAC_ADDR_SIZE];
2820 };
2821 
2822 /*
2823  * Enumeration of cdp soc parameters
2824  * @DP_SOC_PARAM_EAPOL_OVER_CONTROL_PORT: For sending EAPOL's over control port
2825  * @DP_SOC_PARAM_MULTI_PEER_GRP_CMD_SUPPORT: For sending bulk AST delete
2826  * @DP_SOC_PARAM_RSSI_DBM_CONV_SUPPORT: To set the rssi dbm support bit
2827  * @DP_SOC_PARAM_UMAC_HW_RESET_SUPPORT: Whether target supports UMAC HW reset
2828  */
2829 enum cdp_soc_param_t {
2830 	DP_SOC_PARAM_MSDU_EXCEPTION_DESC,
2831 	DP_SOC_PARAM_CMEM_FSE_SUPPORT,
2832 	DP_SOC_PARAM_MAX_AST_AGEOUT,
2833 	DP_SOC_PARAM_EAPOL_OVER_CONTROL_PORT,
2834 	DP_SOC_PARAM_MULTI_PEER_GRP_CMD_SUPPORT,
2835 	DP_SOC_PARAM_RSSI_DBM_CONV_SUPPORT,
2836 	DP_SOC_PARAM_UMAC_HW_RESET_SUPPORT,
2837 	DP_SOC_PARAM_MAX,
2838 };
2839 
2840 #ifdef QCA_ENH_V3_STATS_SUPPORT
2841 /*
2842  * Enumeration of PDEV Configuration parameter
2843  */
2844 enum _dp_param_t {
2845 	DP_PARAM_MSDU_TTL,
2846 	DP_PARAM_TOTAL_Q_SIZE_RANGE0,
2847 	DP_PARAM_TOTAL_Q_SIZE_RANGE1,
2848 	DP_PARAM_TOTAL_Q_SIZE_RANGE2,
2849 	DP_PARAM_TOTAL_Q_SIZE_RANGE3,
2850 	DP_PARAM_VIDEO_DELAY_STATS_FC,
2851 	DP_PARAM_QFLUSHINTERVAL,
2852 	DP_PARAM_TOTAL_Q_SIZE,
2853 	DP_PARAM_MIN_THRESHOLD,
2854 	DP_PARAM_MAX_Q_LIMIT,
2855 	DP_PARAM_MIN_Q_LIMIT,
2856 	DP_PARAM_CONG_CTRL_TIMER_INTV,
2857 	DP_PARAM_STATS_TIMER_INTV,
2858 	DP_PARAM_ROTTING_TIMER_INTV,
2859 	DP_PARAM_LATENCY_PROFILE,
2860 	DP_PARAM_HOSTQ_DUMP,
2861 	DP_PARAM_TIDQ_MAP,
2862 	DP_PARAM_VIDEO_STATS_FC,
2863 	DP_PARAM_STATS_FC,
2864 
2865 	DP_PARAM_MAX,
2866 };
2867 #endif
2868 /* Bitmasks for stats that can block */
2869 #define EXT_TXRX_FW_STATS		0x0001
2870 
2871 #define CDP_TX_CAP_HTT_MAX_FTYPE 19
2872 #define CDP_FC0_TYPE_SHIFT 2
2873 #define CDP_FC0_SUBTYPE_SHIFT 4
2874 #define CDP_FC0_TYPE_DATA 0x08
2875 #define CDP_FC0_SUBTYPE_MASK 0xf0
2876 
2877 #define CDP_TXCAP_MAX_TYPE \
2878 	((CDP_FC0_TYPE_DATA >> CDP_FC0_TYPE_SHIFT) + 1)
2879 #define CDP_TXCAP_MAX_SUBTYPE \
2880 	((CDP_FC0_SUBTYPE_MASK >> CDP_FC0_SUBTYPE_SHIFT) + 1)
2881 
2882 enum CDP_PEER_MSDU_DESC {
2883 	PEER_MSDU_SUCC,
2884 	PEER_MSDU_ENQ,
2885 	PEER_MSDU_DEQ,
2886 	PEER_MSDU_FLUSH,
2887 	PEER_MSDU_DROP,
2888 	PEER_MSDU_XRETRY,
2889 	PEER_MSDU_DESC_MAX,
2890 };
2891 
2892 enum CDP_PEER_MPDU_DESC {
2893 	PEER_MPDU_TRI,
2894 	PEER_MPDU_SUCC,
2895 	PEER_MPDU_RESTITCH,
2896 	PEER_MPDU_ARR,
2897 	PEER_MPDU_CLONE,
2898 	PEER_MPDU_TO_STACK,
2899 	PEER_MPDU_DESC_MAX,
2900 };
2901 
2902 /**
2903  * struct cdp_tid_q_len - Structure to hold consolidated queue length
2904  * @defer_msdu_len: Defered MSDU queue length
2905  * @tasklet_msdu_len: MSDU complete queue length
2906  * @pending_q_len: MSDU pending queue length
2907  */
2908 struct cdp_tid_q_len {
2909 	uint64_t defer_msdu_len;
2910 	uint64_t tasklet_msdu_len;
2911 	uint64_t pending_q_len;
2912 };
2913 
2914 /**
2915  * struct cdp_peer_tx_capture_stats - Structure to hold peer tx capture stats
2916  * @len_stats: Per TID defered, pending and completed msdu queue length
2917  * @mpdu: Mpdu success and restich count
2918  * @msdu: Msdu success and restich count
2919  */
2920 struct cdp_peer_tx_capture_stats {
2921 	struct cdp_tid_q_len len_stats[CDP_MAX_TIDS];
2922 #ifdef WLAN_TX_PKT_CAPTURE_ENH_DEBUG
2923 	uint32_t mpdu[PEER_MPDU_DESC_MAX];
2924 	uint32_t msdu[PEER_MSDU_DESC_MAX];
2925 #endif
2926 };
2927 
2928 /**
2929  * struct cdp_pdev_tx_capture_stats - Structure to hold pdev tx capture stats
2930  * @peer_mismatch: Peer mismatched
2931  * @last_rcv_ppdu: Last received PPDU stats in ms
2932  * @ppdu_stats_queue_depth: PPDU stats queue depth
2933  * @ppdu_stats_defer_queue_depth: PPDU stats defered queue depth
2934  * @ppdu_dropped: PPDU dropped count
2935  * @pend_ppdu_dropped: Pending PPDU dropped count
2936  * @ppdu_flush_count: PPDU flush count
2937  * @msdu_threshold_drop: MSDU threshold drop count
2938  * @ctl_mgmt_q_len: Control management queue length
2939  * @retries_ctl_mgmt_q_len: Control management retries queue length
2940  * @htt_frame_type: HTT frame type
2941  * @len_stats: Consolidated msdu, ppdu and pending queue length
2942  */
2943 struct cdp_pdev_tx_capture_stats {
2944 	uint64_t peer_mismatch;
2945 	uint32_t last_rcv_ppdu;
2946 	uint32_t ppdu_stats_queue_depth;
2947 	uint32_t ppdu_stats_defer_queue_depth;
2948 	uint32_t ppdu_dropped;
2949 	uint32_t pend_ppdu_dropped;
2950 	uint32_t ppdu_flush_count;
2951 	uint32_t msdu_threshold_drop;
2952 	unsigned int ctl_mgmt_q_len[CDP_TXCAP_MAX_TYPE][CDP_TXCAP_MAX_SUBTYPE];
2953 	unsigned int retries_ctl_mgmt_q_len[CDP_TXCAP_MAX_TYPE]
2954 					   [CDP_TXCAP_MAX_SUBTYPE];
2955 	uint32_t htt_frame_type[CDP_TX_CAP_HTT_MAX_FTYPE];
2956 	struct cdp_tid_q_len len_stats;
2957 };
2958 #endif
2959