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