xref: /wlan-dirver/qca-wifi-host-cmn/dp/wifi3.0/monitor/2.0/dp_tx_mon_2.0.h (revision 2888b71da71bce103343119fa1b31f4a0cee07c8)
1 /*
2  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  */
17 
18 #ifndef _DP_TX_MON_2_0_H_
19 #define _DP_TX_MON_2_0_H_
20 
21 #include <qdf_nbuf_frag.h>
22 #include <hal_be_api_mon.h>
23 
24 struct dp_mon_desc;
25 
26 /**
27  * dp_tx_mon_desc_list - structure to store double linked liskt
28  * @tx_ppdu_info_dlist_elem: support adding to double linked list
29  * @tx_ppdu_info_slist_elem: support adding to single linked list
30  * @tx_mon_reap_cnt: tx monitor reap count
31  */
32 struct dp_tx_mon_desc_list {
33 	union dp_mon_desc_list_elem_t *desc_list;
34 	union dp_mon_desc_list_elem_t *tail;
35 	uint32_t tx_mon_reap_cnt;
36 };
37 
38 /*
39  * dp_tx_mon_buffers_alloc() - allocate tx monitor buffers
40  * @soc: DP soc handle
41  *
42  * Return: QDF_STATUS_SUCCESS: Success
43  *         QDF_STATUS_E_FAILURE: Error
44  */
45 QDF_STATUS
46 dp_tx_mon_buffers_alloc(struct dp_soc *soc, uint32_t size);
47 
48 /*
49  * dp_tx_mon_buffers_free() - free tx monitor buffers
50  * @soc: dp soc handle
51  *
52  */
53 void
54 dp_tx_mon_buffers_free(struct dp_soc *soc);
55 
56 /*
57  * dp_tx_mon_desc_pool_deinit() - deinit tx monitor descriptor pool
58  * @soc: dp soc handle
59  *
60  */
61 void
62 dp_tx_mon_buf_desc_pool_deinit(struct dp_soc *soc);
63 
64 /*
65  * dp_tx_mon_desc_pool_deinit() - deinit tx monitor descriptor pool
66  * @soc: dp soc handle
67  *
68  * Return: QDF_STATUS_SUCCESS: Success
69  *         QDF_STATUS_E_FAILURE: Error
70  */
71 QDF_STATUS
72 dp_tx_mon_buf_desc_pool_init(struct dp_soc *soc);
73 
74 /*
75  * dp_tx_mon_buf_desc_pool_free() - free tx monitor descriptor pool
76  * @soc: dp soc handle
77  *
78  */
79 void dp_tx_mon_buf_desc_pool_free(struct dp_soc *soc);
80 
81 /*
82  * dp_tx_mon_buf_desc_pool_alloc() - allocate tx monitor descriptor pool
83  * @soc: DP soc handle
84  *
85  * Return: QDF_STATUS_SUCCESS: Success
86  *         QDF_STATUS_E_FAILURE: Error
87  */
88 QDF_STATUS
89 dp_tx_mon_buf_desc_pool_alloc(struct dp_soc *soc);
90 
91 /**
92  * dp_tx_mon_update_end_reason() - API to update end reason
93  *
94  * @mon_pdev - DP_MON_PDEV handle
95  * @ppdu_id - ppdu_id
96  * @end_reason - monitor destiantion descriptor end reason
97  *
98  * Return: void
99  */
100 void dp_tx_mon_update_end_reason(struct dp_mon_pdev *mon_pdev,
101 				 int ppdu_id, int end_reason);
102 
103 /**
104  * dp_tx_mon_status_free_packet_buf() - API to free packet buffer
105  * @pdev: pdev Handle
106  * @status_frag: status frag
107  * @end_offset: status fragment end offset
108  * @mon_desc_list_ref: tx monitor descriptor list reference
109  *
110  * Return: void
111  */
112 void
113 dp_tx_mon_status_free_packet_buf(struct dp_pdev *pdev,
114 				 qdf_frag_t status_frag,
115 				 uint32_t end_offset,
116 				 struct dp_tx_mon_desc_list *mon_desc_list_ref);
117 
118 /*
119  * dp_tx_mon_process_status_tlv() - API to processed TLV
120  * invoked from interrupt handler
121  *
122  * @soc - DP_SOC handle
123  * @pdev - DP_PDEV handle
124  * @mon_ring_desc - descriptor status info
125  * @addr - status buffer frag address
126  * @end_offset - end offset of buffer that has valid buffer
127  * @mon_desc_list_ref: tx monitor descriptor list reference
128  *
129  * Return: QDF_STATUS
130  */
131 QDF_STATUS
132 dp_tx_mon_process_status_tlv(struct dp_soc *soc,
133 			     struct dp_pdev *pdev,
134 			     struct hal_mon_desc *mon_ring_desc,
135 			     qdf_frag_t status_frag,
136 			     uint32_t end_offset,
137 			     struct dp_tx_mon_desc_list *mon_desc_list_ref);
138 
139 /*
140  * dp_tx_mon_process_2_0() - tx monitor interrupt process
141  * @soc: dp soc handle
142  * @int_ctx: interrupt context
143  * @mac_id: mac id
144  * @quota: quota to process
145  *
146  */
147 uint32_t
148 dp_tx_mon_process_2_0(struct dp_soc *soc, struct dp_intr *int_ctx,
149 		      uint32_t mac_id, uint32_t quota);
150 
151 /* The maximum buffer length allocated for radiotap for monitor status buffer */
152 #define MAX_MONITOR_HEADER (512)
153 #define MAX_DUMMY_FRM_BODY (128)
154 
155 #define MAX_STATUS_BUFFER_IN_PPDU (64)
156 #define TXMON_NO_BUFFER_SZ (64)
157 
158 #define DP_BA_ACK_FRAME_SIZE (sizeof(struct ieee80211_ctlframe_addr2) + 36)
159 #define DP_ACK_FRAME_SIZE (sizeof(struct ieee80211_frame_min_one))
160 #define DP_CTS_FRAME_SIZE (sizeof(struct ieee80211_frame_min_one))
161 #define DP_ACKNOACK_FRAME_SIZE (sizeof(struct ieee80211_frame) + 16)
162 
163 #define DP_IEEE80211_BAR_CTL_TID_S 12
164 #define DP_IEEE80211_BAR_CTL_TID_M 0xf
165 #define DP_IEEE80211_BAR_CTL_POLICY_S 0
166 #define DP_IEEE80211_BAR_CTL_POLICY_M 0x1
167 #define DP_IEEE80211_BA_S_SEQ_S 4
168 #define DP_IEEE80211_BAR_CTL_COMBA 0x0004
169 
170 #define TXMON_PPDU(ppdu_info, field)	ppdu_info->field
171 #define TXMON_PPDU_USR(ppdu_info, user_index, field)	\
172 			ppdu_info->hal_txmon.rx_user_status[user_index].field
173 #define TXMON_PPDU_COM(ppdu_info, field) ppdu_info->hal_txmon.rx_status.field
174 #define TXMON_PPDU_HAL(ppdu_info, field) ppdu_info->hal_txmon.field
175 
176 #define HE_DATA_CNT	6
177 
178 #define INITIATOR_WINDOW 0
179 #define RESPONSE_WINDOW 1
180 
181 /**
182  * bf_type -  tx monitor supported Beamformed type
183  */
184 enum bf_type {
185 	NO_BF = 0,
186 	LEGACY_BF,
187 	SU_BF,
188 	MU_BF
189 };
190 
191 /**
192  * dot11b_preamble_type - tx monitor supported 11b preamble type
193  */
194 enum dot11b_preamble_type {
195 	SHORT_PREAMBLE = 0,
196 	LONG_PREAMBLE,
197 };
198 
199 /**
200  * bw_type - tx monitor supported bandwidth type
201  */
202 enum bw_type {
203 	TXMON_BW_20_MHZ = 0,
204 	TXMON_BW_40_MHZ,
205 	TXMON_BW_80_MHZ,
206 	TXMON_BW_160_MHZ,
207 	TXMON_BW_240_MHZ,
208 	TXMON_BW_320_MHZ
209 };
210 
211 /**
212  * ppdu_start_reason - tx monitor supported PPDU start reason type
213  */
214 enum ppdu_start_reason {
215 	TXMON_FES_PROTECTION_FRAME,
216 	TXMON_FES_AFTER_PROTECTION,
217 	TXMON_FES_ONLY,
218 	TXMON_RESPONSE_FRAME,
219 	TXMON_TRIG_RESPONSE_FRAME,
220 	TXMON_DYNAMIC_PROTECTION_FES_ONLY
221 };
222 
223 /**
224  * guard_interval - tx monitor supported Guard interval type
225  */
226 enum guard_interval {
227 	TXMON_GI_0_8_US = 0,
228 	TXMON_GI_0_4_US,
229 	TXMON_GI_1_6_US,
230 	TXMON_GI_3_2_US
231 };
232 
233 /**
234  * RU_size_start - tx monitor supported RU size start type
235  */
236 enum RU_size_start {
237 	TXMON_RU_26 = 0,
238 	TXMON_RU_52,
239 	TXMON_RU_106,
240 	TXMON_RU_242,
241 	TXMON_RU_484,
242 	TXMON_RU_996,
243 	TXMON_RU_1992,
244 	TXMON_RU_FULLBW_240,
245 	TXMON_RU_FULLBW_320,
246 	TXMON_RU_MULTI_LARGE,
247 	TXMON_RU_78,
248 	TXMON_RU_132
249 };
250 
251 /**
252  * response_type_expected - expected response type
253  */
254 enum response_type_expected {
255 	TXMON_RESP_NO_RESP = 0,
256 	TXMON_RESP_ACK,
257 	TXMON_RESP_BA_64_BITMAP,
258 	TXMON_RESP_BA_256,
259 	TXMON_RESP_ACTIONNOACK,
260 	TXMON_RESP_ACK_BA,
261 	TXMON_RESP_CTS,
262 	TXMON_RESP_ACK_DATA,
263 	TXMON_RESP_NDP_ACK,
264 	TXMON_RESP_NDP_MODIFIED_ACK,
265 	TXMON_RESP_NDP_BA,
266 	TXMON_RESP_NDP_CTS,
267 	TXMON_RESP_NDP_ACK_OR_NDP_MODIFIED_ACK,
268 	TXMON_RESP_UL_MU_BA,
269 	TXMON_RESP_UL_MU_BA_AND_DATA,
270 	TXMON_RESP_UL_MU_CBF,
271 	TXMON_RESP_UL_MU_FRAMES,
272 	TXMON_RESP_ANY_RESP_TO_DEVICE,
273 	TXMON_RESP_ANY_RESP_ACCEPTED,
274 	TXMON_RESP_FRAMELESS_PHYRX_RESP_ACCEPTED,
275 	TXMON_RESP_RANGING_NDP_AND_LMR,
276 	TXMON_RESP_BA_512,
277 	TXMON_RESP_BA_1024,
278 	TXMON_RESP_UL_MU_RANGING_CTS2S,
279 	TXMON_RESP_UL_MU_RANGING_NDP,
280 	TXMON_RESP_UL_MU_RANGING_LMR
281 };
282 
283 /**
284  * resposne_to_respone - tx monitor supported response to response type
285  */
286 enum resposne_to_respone {
287 	TXMON_RESP_TO_RESP_NONE = 0,
288 	TXMON_RESP_TO_RESP_SU_BA,
289 	TXMON_RESP_TO_RESP_MU_BA,
290 	TXMON_RESP_TO_RESP_CMD
291 };
292 
293 /**
294  * medium_protection_type - tx monitor supported protection type
295  */
296 enum medium_protection_type {
297 	TXMON_MEDIUM_NO_PROTECTION,
298 	TXMON_MEDIUM_RTS_LEGACY,
299 	TXMON_MEDIUM_RTS_11AC_STATIC_BW,
300 	TXMON_MEDIUM_RTS_11AC_DYNAMIC_BW,
301 	TXMON_MEDIUM_CTS2SELF,
302 	TXMON_MEDIUM_QOS_NULL_NO_ACK_3ADDR,
303 	TXMON_MEDIUM_QOS_NULL_NO_ACK_4ADDR,
304 };
305 
306 /**
307  * ndp_frame - tx monitor supported ndp frame type
308  */
309 enum ndp_frame {
310 	TXMON_NO_NDP_TRANSMISSION,
311 	TXMON_BEAMFORMING_NDP,
312 	TXMON_HE_RANGING_NDP,
313 	TXMON_HE_FEEDBACK_NDP,
314 };
315 
316 /**
317  * tx_ppdu_info_type - tx monitor supported ppdu type
318  */
319 enum tx_ppdu_info_type {
320 	TX_PROT_PPDU_INFO,
321 	TX_DATA_PPDU_INFO,
322 };
323 
324 /**
325  * dp_tx_ppdu_info - structure to store tx ppdu info
326  * @ppdu_id: current ppdu info ppdu id
327  * @frametype: ppdu info frame type
328  * @cur_usr_idx: current user index of ppdu info
329  * @tx_ppdu_info_dlist_elem: support adding to double linked list
330  * @tx_ppdu_info_slist_elem: support adding to single linked list
331  * @hal_txmon: hal tx monitor info for that ppdu
332  */
333 struct dp_tx_ppdu_info {
334 	uint32_t ppdu_id;
335 	uint8_t frame_type;
336 	uint8_t cur_usr_idx;
337 
338 	union {
339 		TAILQ_ENTRY(dp_tx_ppdu_info) tx_ppdu_info_dlist_elem;
340 		STAILQ_ENTRY(dp_tx_ppdu_info) tx_ppdu_info_slist_elem;
341 	} ulist;
342 
343 	#define tx_ppdu_info_list_elem ulist.tx_ppdu_info_dlist_elem
344 	#define tx_ppdu_info_queue_elem ulist.tx_ppdu_info_slist_elem
345 
346 	struct hal_tx_ppdu_info hal_txmon;
347 };
348 
349 /**
350  * dp_tx_monitor_drop_stats - structure to store tx monitor drop statistic
351  * @ppdu_drop_cnt: ppdu drop counter
352  * @mpdu_drop_cnt: mpdu drop counter
353  * @tlv_drop_cnt: tlv drop counter
354  * @pkt_buf_recv: tx monitor packet buffer received
355  * @pkt_buf_free: tx monitor packet buffer free
356  * @pkt_buf_processed: tx monitor packet buffer processed
357  * @pkt_buf_to_stack: tx monitor packet buffer send to stack
358  * @status_buf_recv: tx monitor status buffer received
359  * @status_buf_free: tx monitor status buffer free
360  * @totat_tx_mon_replenish_cnt: tx monitor replenish count
361  * @total_tx_mon_reap_cnt: tx monitor reap count
362  * @tx_mon_stuck: tx monitor stuck count
363  * @total_tx_mon_stuck: tx monitor stuck count
364  * @ppdu_info_drop_th: count ppdu info been dropped due threshold reached
365  * @ppdu_info_drop_flush: count ppdu info been dropped due to flush detected
366  * @ppdu_info_drop_trunc: count ppdu info been dropped due to truncated
367  */
368 struct dp_tx_monitor_drop_stats {
369 	uint64_t ppdu_drop_cnt;
370 	uint64_t mpdu_drop_cnt;
371 	uint64_t tlv_drop_cnt;
372 
373 	uint64_t pkt_buf_recv;
374 	uint64_t pkt_buf_free;
375 	uint64_t pkt_buf_processed;
376 	uint64_t pkt_buf_to_stack;
377 
378 	uint64_t status_buf_recv;
379 	uint64_t status_buf_free;
380 
381 	uint64_t totat_tx_mon_replenish_cnt;
382 	uint64_t total_tx_mon_reap_cnt;
383 	uint8_t tx_mon_stuck;
384 	uint32_t total_tx_mon_stuck;
385 
386 	uint64_t ppdu_info_drop_th;
387 	uint64_t ppdu_info_drop_flush;
388 	uint64_t ppdu_info_drop_trunc;
389 };
390 
391 /**
392  * dp_tx_monitor_mode - tx monitor supported mode
393  * @TX_MON_BE_DISABLE: tx monitor disable
394  * @TX_MON_BE_FULL_CAPTURE: tx monitor mode to capture full packet
395  * @TX_MON_BE_PEER_FILTER: tx monitor mode to capture peer filter
396  */
397 enum dp_tx_monitor_mode {
398 	TX_MON_BE_DISABLE,
399 	TX_MON_BE_FULL_CAPTURE,
400 	TX_MON_BE_PEER_FILTER,
401 };
402 
403 /**
404  * dp_tx_monitor_framework_mode - tx monitor framework mode
405  * @TX_MON_BE_FRM_WRK_DISABLE: tx monitor frame work disable
406  * @TX_MON_BE_FRM_WRK_FULL_CAPTURE: tx monitor frame work full capture
407  * @TX_MON_BE_FRM_WRK_128B_CAPTURE: tx monitor frame work 128B capture
408  */
409 enum dp_tx_monitor_framework_mode {
410 	TX_MON_BE_FRM_WRK_DISABLE,
411 	TX_MON_BE_FRM_WRK_FULL_CAPTURE,
412 	TX_MON_BE_FRM_WRK_128B_CAPTURE,
413 };
414 
415 #define TX_TAILQ_INSERT_TAIL(pdev, tx_ppdu_info)			\
416 	do {								\
417 		STAILQ_INSERT_TAIL(&pdev->tx_ppdu_info_list,		\
418 				   tx_ppdu_info, tx_ppdu_info_list_elem);\
419 		pdev->tx_ppdu_info_queue_depth++;			\
420 	} while (0)
421 
422 #define TX_TAILQ_REMOVE(pdev, tx_ppdu_info)				\
423 	do {								\
424 		TAILQ_REMOVE(&pdev->tx_ppdu_info_list, tx_ppdu_info,	\
425 			     tx_ppdu_info_list_elem);			\
426 		pdev->tx_ppdu_info_queue_depth--;			\
427 	} while (0)
428 
429 #define TX_TAILQ_FIRST(pdev) TAILQ_FIRST(&pdev->tx_ppdu_info_list)
430 
431 #define TX_TAILQ_FOREACH_SAFE(pdev, tx_ppdu_info)			\
432 	do {								\
433 		struct dp_tx_ppdu_info *tx_ppdu_info_next = NULL;	\
434 		TAILQ_FOREACH_SAFE(tx_ppdu_info,			\
435 				   &pdev->tx_ppdu_info_list,		\
436 				   tx_ppdu_info_list_elem,		\
437 				   tx_ppdu_info_next);			\
438 	} while (0)
439 
440 #ifndef WLAN_TX_PKT_CAPTURE_ENH_BE
441 /**
442  * dp_pdev_tx_monitor_be - info to store tx capture information in pdev
443  * @be_ppdu_id: current ppdu id
444  * @mode: tx monitor core framework current mode
445  * @stats: tx monitor drop stats for that mac
446  *
447  */
448 struct dp_pdev_tx_monitor_be {
449 	uint32_t be_ppdu_id;
450 	uint32_t mode;
451 	struct dp_tx_monitor_drop_stats stats;
452 };
453 
454 /**
455  * dp_peer_tx_capture_be: Tx monitor peer structure
456  *
457  * This is a dummy structure
458  */
459 struct dp_peer_tx_capture_be {
460 };
461 #else
462 
463 /**
464  * struct dp_txmon_frag_vec - a contiguous range of physical memory address
465  * @frag_buf: frag buffer address
466  * @end_offset: byte offset within the frag buffer where valid data resides
467  */
468 struct dp_txmon_frag_vec {
469 	qdf_frag_t frag_buf;
470 	uint32_t end_offset;
471 };
472 
473 /**
474  * dp_pdev_tx_monitor_be - info to store tx capture information in pdev
475  * @be_ppdu_id: current ppdu id
476  * @be_end_reason_bitmap: current end reason bitmap
477  * @mode: tx monitor current mode
478  * @tx_mon_list_lock: spinlock protection to list
479  * @post_ppdu_workqueue: tx monitor workqueue representation
480  * @post_ppdu_work: tx monitor post ppdu work
481  * @tx_ppdu_info_list_depth: list depth counter
482  * @tx_ppdu_info_list: ppdu info list to hold ppdu
483  * @defer_ppdu_info_list_depth: defer ppdu list depth counter
484  * @defer_ppdu_info_list: defer ppdu info list to hold defer ppdu
485  * @stats: tx monitor drop stats for that mac
486  * @tx_prot_ppdu_info: tx monitor protection ppdu info
487  * @tx_data_ppdu_info: tx monitor data ppdu info
488  * @last_prot_ppdu_info: last tx monitor protection ppdu info
489  * @last_data_ppdu_info: last tx monitor data ppdu info
490  * @prot_status_info: protection status info
491  * @data_status_info: data status info
492  * @last_tsft: last received tsft
493  * @last_ppdu_timestamp: last received ppdu_timestamp
494  * @last_frag_q_idx: last index of frag buffer
495  * @cur_frag_q_idx: current index of frag buffer
496  * @status_frag_queue: array of status frag queue to hold 64 status buffer
497  */
498 struct dp_pdev_tx_monitor_be {
499 	uint32_t be_ppdu_id;
500 	uint32_t be_end_reason_bitmap;
501 	uint32_t mode;
502 
503 	qdf_spinlock_t tx_mon_list_lock;
504 
505 	qdf_work_t post_ppdu_work;
506 	qdf_workqueue_t *post_ppdu_workqueue;
507 
508 	uint32_t tx_ppdu_info_list_depth;
509 
510 	STAILQ_HEAD(, dp_tx_ppdu_info) tx_ppdu_info_queue;
511 
512 	uint32_t defer_ppdu_info_list_depth;
513 
514 	STAILQ_HEAD(, dp_tx_ppdu_info) defer_tx_ppdu_info_queue;
515 
516 	struct dp_tx_monitor_drop_stats stats;
517 
518 	struct dp_tx_ppdu_info *tx_prot_ppdu_info;
519 	struct dp_tx_ppdu_info *tx_data_ppdu_info;
520 
521 	struct dp_tx_ppdu_info *last_prot_ppdu_info;
522 	struct dp_tx_ppdu_info *last_data_ppdu_info;
523 
524 	struct hal_tx_status_info prot_status_info;
525 	struct hal_tx_status_info data_status_info;
526 
527 	uint64_t last_tsft;
528 	uint32_t last_ppdu_timestamp;
529 
530 	uint8_t last_frag_q_idx;
531 	uint8_t cur_frag_q_idx;
532 	struct dp_txmon_frag_vec frag_q_vec[MAX_STATUS_BUFFER_IN_PPDU];
533 };
534 
535 /**
536  * dp_peer_tx_capture_be: Tx monitor peer structure
537  *
538  * need to be added here
539  */
540 struct dp_peer_tx_capture_be {
541 };
542 #endif /* WLAN_TX_PKT_CAPTURE_ENH_BE */
543 
544 /*
545  * dp_tx_mon_ppdu_info_free() - API to free dp_tx_ppdu_info
546  * @tx_ppdu_info - pointer to tx_ppdu_info
547  *
548  * Return: void
549  */
550 void dp_tx_mon_ppdu_info_free(struct dp_tx_ppdu_info *tx_ppdu_info);
551 
552 /*
553  * dp_tx_mon_free_usr_mpduq() - API to free user mpduq
554  * @tx_ppdu_info - pointer to tx_ppdu_info
555  * @usr_idx - user index
556  * @tx_cap_be - pointer to tx capture be
557  *
558  * Return: void
559  */
560 void dp_tx_mon_free_usr_mpduq(struct dp_tx_ppdu_info *tx_ppdu_info,
561 			      uint8_t usr_idx,
562 			      struct dp_pdev_tx_monitor_be *tx_mon_be);
563 
564 /*
565  * dp_tx_mon_free_ppdu_info() - API to free dp_tx_ppdu_info
566  * @tx_ppdu_info - pointer to tx_ppdu_info
567  * @tx_cap_be - pointer to tx capture be
568  *
569  * Return: void
570  */
571 void dp_tx_mon_free_ppdu_info(struct dp_tx_ppdu_info *tx_ppdu_info,
572 			      struct dp_pdev_tx_monitor_be *tx_mon_be);
573 
574 /*
575  * dp_tx_mon_get_ppdu_info() - API to allocate dp_tx_ppdu_info
576  * @pdev - pdev handle
577  * @type - type of ppdu_info data or protection
578  * @num_user - number user in a ppdu_info
579  * @ppdu_id - ppdu_id number
580  *
581  * Return: pointer to dp_tx_ppdu_info
582  */
583 struct dp_tx_ppdu_info *dp_tx_mon_get_ppdu_info(struct dp_pdev *pdev,
584 						enum tx_ppdu_info_type type,
585 						uint8_t num_user,
586 						uint32_t ppdu_id);
587 
588 #ifdef WLAN_TX_PKT_CAPTURE_ENH_BE
589 /**
590  * dp_tx_ppdu_stats_attach_2_0 - Initialize Tx PPDU stats and enhanced capture
591  * @pdev: DP PDEV
592  *
593  * Return: none
594  */
595 void dp_tx_ppdu_stats_attach_2_0(struct dp_pdev *pdev);
596 
597 /**
598  * dp_tx_ppdu_stats_detach_2_0 - Cleanup Tx PPDU stats and enhanced capture
599  * @pdev: DP PDEV
600  *
601  * Return: none
602  */
603 void dp_tx_ppdu_stats_detach_2_0(struct dp_pdev *pdev);
604 
605 /*
606  * dp_print_pdev_tx_monitor_stats_2_0: print tx capture stats
607  * @pdev: DP PDEV handle
608  *
609  * return: void
610  */
611 void dp_print_pdev_tx_monitor_stats_2_0(struct dp_pdev *pdev);
612 
613 /*
614  * dp_config_enh_tx_monitor_2_0()- API to enable/disable enhanced tx capture
615  * @pdev_handle: DP_PDEV handle
616  * @val: user provided value
617  *
618  * Return: QDF_STATUS
619  */
620 QDF_STATUS dp_config_enh_tx_monitor_2_0(struct dp_pdev *pdev, uint8_t val);
621 
622 /*
623  * dp_peer_set_tx_capture_enabled_2_0() -  add tx monitor peer filter
624  * @pdev: Datapath PDEV handle
625  * @peer: Datapath PEER handle
626  * @is_tx_pkt_cap_enable: flag for tx capture enable/disable
627  * @peer_mac: peer mac address
628  *
629  * Return: status
630  */
631 QDF_STATUS dp_peer_set_tx_capture_enabled_2_0(struct dp_pdev *pdev_handle,
632 					      struct dp_peer *peer_handle,
633 					      uint8_t is_tx_pkt_cap_enable,
634 					      uint8_t *peer_mac);
635 #endif /* WLAN_TX_PKT_CAPTURE_ENH_BE */
636 
637 #if (defined(WIFI_MONITOR_SUPPORT) && !defined(WLAN_TX_PKT_CAPTURE_ENH_BE))
638 /*
639  * dp_config_enh_tx_core_monitor_2_0()- API to validate core framework
640  * @pdev_handle: DP_PDEV handle
641  * @val: user provided value
642  *
643  * Return: QDF_STATUS
644  */
645 QDF_STATUS dp_config_enh_tx_core_monitor_2_0(struct dp_pdev *pdev, uint8_t val);
646 #endif
647 
648 #endif /* _DP_TX_MON_2_0_H_ */
649