xref: /wlan-dirver/qca-wifi-host-cmn/dp/wifi3.0/monitor/2.0/dp_mon_filter_2.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_FILTER_2_0_H_
19 #define _DP_MON_FILTER_2_0_H_
20 
21 #include <dp_htt.h>
22 
23 #define DEFAULT_DMA_LENGTH 7
24 #define DMA_LENGTH_64B 1
25 #define DMA_LENGTH_128B 2
26 #define DMA_LENGTH_256B 4
27 
28 /* rx hdr tlv dma lengths */
29 enum dp_rx_hdr_dma_length {
30 	/* default dma length(128B) */
31 	DEFAULT_RX_HDR_DMA_LENGTH = 0,
32 	/* dma length 64 bytes */
33 	RX_HDR_DMA_LENGTH_64B = 1,
34 	/* dma length 128 bytes */
35 	RX_HDR_DMA_LENGTH_128B = 2,
36 	/* dma length 256 bytes */
37 	RX_HDR_DMA_LENGTH_256B = 3,
38 };
39 
40 /* fwd declarations */
41 struct dp_mon_pdev_be;
42 
43 /**
44  * dp_rx_mon_enable_set() - Setup rx monitor feature
45  * @msg_word: msg word
46  * @tlv_filter: rx ring filter configuration
47  */
48 void
49 dp_rx_mon_enable_set(uint32_t *msg_word,
50 		     struct htt_rx_ring_tlv_filter *tlv_filter);
51 
52 /**
53  * dp_rx_mon_hdr_length_set() - Setup rx monitor hdr tlv length
54  * @msg_word: msg word
55  * @tlv_filter: rx ring filter configuration
56  */
57 void
58 dp_rx_mon_hdr_length_set(uint32_t *msg_word,
59 			 struct htt_rx_ring_tlv_filter *tlv_filter);
60 
61 /**
62  * dp_rx_mon_packet_length_set() - Setup rx monitor per packet type length
63  * @msg_word: msg word
64  * @tlv_filter: rx ring filter configuration
65  */
66 void
67 dp_rx_mon_packet_length_set(uint32_t *msg_word,
68 			    struct htt_rx_ring_tlv_filter *tlv_filter);
69 
70 /**
71  * dp_rx_mon_word_mask_subscribe() - Setup rx monitor word mask subscription
72  * @msg_word: msg word
73  * @tlv_filter: rx ring filter configuration
74  */
75 void
76 dp_rx_mon_word_mask_subscribe(uint32_t *msg_word,
77 			      struct htt_rx_ring_tlv_filter *tlv_filter);
78 
79 /**
80  * dp_rx_mon_pkt_tlv_offset_subscribe () Setup rx monitor packet tlv offset
81  * @msg_word: msg word
82  * @htt_tlv_filter: rx ring filter configuration
83  */
84 void
85 dp_rx_mon_pkt_tlv_offset_subscribe(uint32_t *msg_word,
86 				   struct htt_rx_ring_tlv_filter *tlv_filter);
87 
88 /**
89  * dp_rx_mon_enable_mpdu_logging() - Setup rx monitor per packet mpdu logging
90  * @msg_word: msg word
91  * @tlv_filter: rx ring filter configuration
92  */
93 void
94 dp_rx_mon_enable_mpdu_logging(uint32_t *msg_word,
95 			      struct htt_rx_ring_tlv_filter *tlv_filter);
96 
97 /**
98  * dp_rx_mon_enable_fpmo() - Setup rx monitor fpmo mode type/subtype filters
99  * @msg_word: msg word
100  * @tlv_filter: rx ring filter configuration
101  */
102 void
103 dp_rx_mon_enable_fpmo(uint32_t *msg_word,
104 		      struct htt_rx_ring_tlv_filter *tlv_filter);
105 
106 #ifdef QCA_ENHANCED_STATS_SUPPORT
107 /**
108  * dp_mon_filter_setup_enhanced_stats_2_0() - Setup the enhanced stats filter
109  * @pdev: DP pdev handle
110  */
111 void dp_mon_filter_setup_enhanced_stats_2_0(struct dp_pdev *pdev);
112 
113 /**
114  * dp_mon_filter_reset_enhanced_stats_2_0() - Reset the enhanced stats filter
115  * @pdev: DP pdev handle
116  */
117 void dp_mon_filter_reset_enhanced_stats_2_0(struct dp_pdev *pdev);
118 #else
119 static inline void
120 dp_mon_filter_setup_enhanced_stats_2_0(struct dp_pdev *pdev)
121 {
122 }
123 
124 static inline void
125 dp_mon_filter_reset_enhanced_stats_2_0(struct dp_pdev *pdev)
126 {
127 }
128 #endif
129 
130 #ifdef QCA_UNDECODED_METADATA_SUPPORT
131 /**
132  * dp_mon_filter_setup_undecoded_metadata_capture_2_0() - Setup the filter
133  * for undecoded metadata capture
134  * @pdev: DP pdev handle
135  */
136 void dp_mon_filter_setup_undecoded_metadata_capture_2_0(struct dp_pdev *pdev);
137 
138 /**
139  * dp_mon_filter_reset_undecoded_metadata_capture_2_0() - Reset the filter
140  * for undecoded metadata capture
141  * @pdev: DP pdev handle
142  */
143 void dp_mon_filter_reset_undecoded_metadata_capture_2_0(struct dp_pdev *pdev);
144 #else
145 static inline void
146 dp_mon_filter_setup_undecoded_metadata_capture_2_0(struct dp_pdev *pdev)
147 {
148 }
149 
150 static inline void
151 dp_mon_filter_reset_undecoded_metadata_capture_2_0(struct dp_pdev *pdev)
152 {
153 }
154 #endif
155 
156 /**
157  * dp_mon_filter_setup_rx_mon_mode_2_0() - Setup the Rx monitor mode filter
158  * @pdev: DP pdev handle
159  */
160 void dp_mon_filter_setup_rx_mon_mode_2_0(struct dp_pdev *pdev);
161 
162 /**
163  * dp_mon_filter_reset_rx_mon_mode_2_0() - Reset the Rx monitor mode filter
164  * @pdev: DP pdev handle
165  */
166 void dp_mon_filter_reset_rx_mon_mode_2_0(struct dp_pdev *pdev);
167 
168 /**
169  * dp_mon_filter_setup_tx_mon_mode_2_0() - Setup the Tx monitor mode filter
170  * @pdev: DP pdev handle
171  */
172 void dp_mon_filter_setup_tx_mon_mode_2_0(struct dp_pdev *pdev);
173 
174 /**
175  * dp_mon_filter_reset_tx_mon_mode_2_0() - Reset the Tx monitor mode filter
176  * @pdev: DP pdev handle
177  */
178 void dp_mon_filter_reset_tx_mon_mode_2_0(struct dp_pdev *pdev);
179 
180 #ifdef WDI_EVENT_ENABLE
181 /**
182  * dp_mon_filter_setup_rx_pkt_log_full_2_0() - Setup the Rx pktlog full mode
183  *                                             filter
184  * @pdev: DP pdev handle
185  */
186 void dp_mon_filter_setup_rx_pkt_log_full_2_0(struct dp_pdev *pdev);
187 
188 /**
189  * dp_mon_filter_reset_rx_pkt_log_full_2_0() - Reset pktlog full mode filter
190  * @pdev: DP pdev handle
191  */
192 void dp_mon_filter_reset_rx_pkt_log_full_2_0(struct dp_pdev *pdev);
193 
194 /**
195  * dp_mon_filter_setup_rx_pkt_log_lite_2_0() - Setup the Rx pktlog lite mode
196  *                                             filter in the radio object.
197  * @pdev: DP pdev handle
198  */
199 void dp_mon_filter_setup_rx_pkt_log_lite_2_0(struct dp_pdev *pdev);
200 
201 /**
202  * dp_mon_filter_reset_rx_pkt_log_lite_2_0() - Reset the Rx pktlog lite mode
203  *                                             filter in the radio object.
204  * @pdev: DP pdev handle
205  */
206 void dp_mon_filter_reset_rx_pkt_log_lite_2_0(struct dp_pdev *pdev);
207 
208 /**
209  * dp_mon_filter_setup_rx_pkt_log_cbf_2_0() - Setup the Rx pktlog cbf mode
210  *                                            filter in the radio object.
211  * @pdev: DP pdev handle
212  */
213 void dp_mon_filter_setup_rx_pkt_log_cbf_2_0(struct dp_pdev *pdev);
214 
215 /**
216  * dp_mon_filter_reset_rx_pktlog_cbf_2_0() - Reset the Rx pktlog cbf mode filter
217  * @pdev: DP pdev handle
218  */
219 void dp_mon_filter_reset_rx_pktlog_cbf_2_0(struct dp_pdev *pdev);
220 
221 /**
222  * dp_mon_filter_setup_pktlog_hybrid_2_0() - Setup the pktlog hybrid mode filter
223  * @pdev: DP pdev handle
224  */
225 void dp_mon_filter_setup_pktlog_hybrid_2_0(struct dp_pdev *pdev);
226 
227 /**
228  * dp_mon_filter_reset_pktlog_hybrid_2_0() - Reset pktlog hybrid mode filter
229  * @pdev: DP pdev handle
230  */
231 void dp_mon_filter_reset_pktlog_hybrid_2_0(struct dp_pdev *pdev);
232 #else
233 static inline void
234 dp_mon_filter_setup_rx_pkt_log_full_2_0(struct dp_pdev *pdev)
235 {
236 }
237 
238 static inline void
239 dp_mon_filter_reset_rx_pkt_log_full_2_0(struct dp_pdev *pdev)
240 {
241 }
242 
243 static inline void
244 dp_mon_filter_setup_rx_pkt_log_lite_2_0(struct dp_pdev *pdev)
245 {
246 }
247 
248 static inline void
249 dp_mon_filter_reset_rx_pkt_log_lite_2_0(struct dp_pdev *pdev)
250 {
251 }
252 
253 static inline void
254 dp_mon_filter_setup_rx_pkt_log_cbf_2_0(struct dp_pdev *pdev)
255 {
256 }
257 
258 static inline void
259 dp_mon_filter_reset_rx_pktlog_cbf_2_0(struct dp_pdev *pdev)
260 {
261 }
262 
263 static inline void
264 dp_mon_filter_setup_pktlog_hybrid_2_0(struct dp_pdev *pdev)
265 {
266 }
267 
268 static inline void
269 dp_mon_filter_reset_pktlog_hybrid_2_0(struct dp_pdev *pdev)
270 {
271 }
272 #endif
273 
274 /**
275  * dp_tx_mon_filter_update_2_0() - Update monitor filter configuration
276  * @pdev: physical device handle
277  *
278  * Return: non-zero for failure, zero for success
279  */
280 QDF_STATUS dp_tx_mon_filter_update_2_0(struct dp_pdev *pdev);
281 
282 /**
283  * dp_rx_mon_filter_update_2_0() - Update monitor filter configuration
284  * @pdev: physical device handle
285  *
286  * Return: non-zero for failure, zero for success
287  */
288 QDF_STATUS dp_rx_mon_filter_update_2_0(struct dp_pdev *pdev);
289 
290 /**
291  * dp_mon_filter_dealloc_2_0() - free tx monitor filter memory
292  * @pdev: physical device handle
293  *
294  * Return: non-zero for failure, zero for success
295  */
296 void dp_mon_filter_dealloc_2_0(struct dp_pdev *pdev);
297 
298 /**
299  * dp_mon_filter_alloc_2_0() - tx monitor filter allocation
300  * @pdev: physical device handle
301  *
302  * Return: non-zero for failure, zero for success
303  */
304 QDF_STATUS dp_mon_filter_alloc_2_0(struct dp_pdev *pdev);
305 
306 #ifdef QCA_SUPPORT_LITE_MONITOR
307 void dp_mon_filter_reset_rx_lite_mon(struct dp_mon_pdev_be *be_mon_pdev);
308 
309 void dp_mon_filter_setup_rx_lite_mon(struct dp_mon_pdev_be *be_mon_pdev);
310 
311 /**
312  * dp_mon_filter_reset_tx_lite_mon() - Reset tx lite monitor filter
313  * @be_mon_pdev: physical mon device handle
314  *
315  * Return: Null
316  */
317 void dp_mon_filter_reset_tx_lite_mon(struct dp_mon_pdev_be *be_mon_pdev);
318 
319 /**
320  * dp_mon_filter_setup_tx_lite_mon() - Setup tx lite monitor filter
321  * @be_mon_pdev: physical mon device handle
322  *
323  * Return: Null
324  */
325 void dp_mon_filter_setup_tx_lite_mon(struct dp_mon_pdev_be *be_mon_pdev);
326 #endif
327 #endif /* _DP_MON_FILTER_2_0_H_ */
328