xref: /wlan-dirver/qca-wifi-host-cmn/dp/wifi3.0/monitor/1.0/dp_mon_1.0.h (revision 8cfe6b10058a04cafb17eed051f2ddf11bee8931)
1 /*
2  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2023 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_MON_1_0_H_
19 #define _DP_MON_1_0_H_
20 
21 #ifdef WLAN_RX_PKT_CAPTURE_ENH
22 #include <dp_rx_mon_feature.h>
23 #endif
24 
25 #include <dp_rx_mon.h>
26 
27 void dp_flush_monitor_rings(struct dp_soc *soc);
28 
29 /* MCL specific functions */
30 #if defined(DP_CON_MON)
31 
32 /*
33  * dp_service_mon_rings()- service monitor rings
34  * @soc: soc dp handle
35  * @quota: number of ring entry that can be serviced
36  *
37  * Return: None
38  *
39  */
40 void dp_service_mon_rings(struct  dp_soc *soc, uint32_t quota);
41 #endif
42 
43 /**
44  * dp_mon_drop_packets_for_mac() - Drop the mon status ring and
45  *  dest ring packets for a given mac. Packets in status ring and
46  *  dest ring are dropped independently.
47  * @pdev: DP pdev
48  * @mac_id: mac id
49  * @quota: max number of status ring entries that can be processed
50  *
51  * Return: work done
52  */
53 uint32_t dp_mon_drop_packets_for_mac(struct dp_pdev *pdev, uint32_t mac_id,
54 				     uint32_t quota);
55 
56 /**
57  * struct dp_mon_soc_li - Extended DP mon soc for LI targets
58  * @mon_soc: dp_mon_soc structure
59  */
60 struct dp_mon_soc_li {
61 	struct dp_mon_soc mon_soc;
62 };
63 
64 /**
65  * struct dp_mon_pdev_li - Extended DP mon pdev for LI targets
66  * @mon_pdev: dp_mon_pdev structure
67  */
68 struct dp_mon_pdev_li {
69 	struct dp_mon_pdev mon_pdev;
70 };
71 
72 /**
73  * dp_mon_get_context_size_li() - get LI specific size for mon pdev/soc
74  * @context_type: context type for which the size is needed
75  *
76  * Return: size in bytes for the context_type
77  */
78 static inline
79 qdf_size_t dp_mon_get_context_size_li(enum dp_context_type context_type)
80 {
81 	switch (context_type) {
82 	case DP_CONTEXT_TYPE_MON_PDEV:
83 		return sizeof(struct dp_mon_pdev_li);
84 	case DP_CONTEXT_TYPE_MON_SOC:
85 		return sizeof(struct dp_mon_soc_li);
86 	default:
87 		return 0;
88 	}
89 }
90 #endif /* _DP_MON_1_0_H_ */
91