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 #ifndef _DP_MON_FILTER_1_0_H_
18 #define _DP_MON_FILTER_1_0_H_
19
20 #ifdef QCA_ENHANCED_STATS_SUPPORT
21 /**
22 * dp_mon_filter_setup_enhanced_stats_1_0() - Setup the enhanced stats filter
23 * @pdev: DP pdev handle
24 */
25 void dp_mon_filter_setup_enhanced_stats_1_0(struct dp_pdev *pdev);
26
27 /**
28 * dp_mon_filter_reset_enhanced_stats_1_0() - Reset the enhanced stats filter
29 * @pdev: DP pdev handle
30 */
31 void dp_mon_filter_reset_enhanced_stats_1_0(struct dp_pdev *pdev);
32 #else
dp_mon_filter_setup_enhanced_stats_1_0(struct dp_pdev * pdev)33 static inline void dp_mon_filter_setup_enhanced_stats_1_0(struct dp_pdev *pdev)
34 {
35 }
36
dp_mon_filter_reset_enhanced_stats_1_0(struct dp_pdev * pdev)37 static inline void dp_mon_filter_reset_enhanced_stats_1_0(struct dp_pdev *pdev)
38 {
39 }
40 #endif
41
42 #ifdef QCA_UNDECODED_METADATA_SUPPORT
43 /**
44 * dp_mon_filter_setup_undecoded_metadata_capture_1_0() - Setup the filter
45 * for undecoded metadata capture
46 * @pdev: DP pdev handle
47 */
48 void dp_mon_filter_setup_undecoded_metadata_capture_1_0(struct dp_pdev *pdev);
49
50 /**
51 * dp_mon_filter_reset_undecoded_metadata_capture_1_0() - Reset the filter
52 * for undecoded metadata capture
53 * @pdev: DP pdev handle
54 */
55 void dp_mon_filter_reset_undecoded_metadata_capture_1_0(struct dp_pdev *pdev);
56 #else
57 static inline void
dp_mon_filter_setup_undecoded_metadata_capture_1_0(struct dp_pdev * pdev)58 dp_mon_filter_setup_undecoded_metadata_capture_1_0(struct dp_pdev *pdev)
59 {
60 }
61
62 static inline void
dp_mon_filter_reset_undecoded_metadata_capture_1_0(struct dp_pdev * pdev)63 dp_mon_filter_reset_undecoded_metadata_capture_1_0(struct dp_pdev *pdev)
64 {
65 }
66 #endif /* QCA_UNDECODED_METADATA_SUPPORT */
67
68 #ifdef QCA_MCOPY_SUPPORT
69 /**
70 * dp_mon_filter_setup_mcopy_mode_1_0() - Setup the m_copy mode filter
71 * @pdev: DP pdev handle
72 */
73 void dp_mon_filter_setup_mcopy_mode_1_0(struct dp_pdev *pdev);
74
75 /**
76 * dp_mon_filter_reset_mcopy_mode_1_0() - Reset the m_copy mode filter
77 * @pdev: DP pdev handle
78 */
79 void dp_mon_filter_reset_mcopy_mode_1_0(struct dp_pdev *pdev);
80 #else
dp_mon_filter_setup_mcopy_mode_1_0(struct dp_pdev * pdev)81 static inline void dp_mon_filter_setup_mcopy_mode_1_0(struct dp_pdev *pdev)
82 {
83 }
84
dp_mon_filter_reset_mcopy_mode_1_0(struct dp_pdev * pdev)85 static inline void dp_mon_filter_reset_mcopy_mode_1_0(struct dp_pdev *pdev)
86 {
87 }
88 #endif
89
90 #if defined(ATH_SUPPORT_NAC_RSSI) || defined(ATH_SUPPORT_NAC)
91 /**
92 * dp_mon_filter_setup_smart_monitor_1_0() - Setup the smart monitor mode filter
93 * @pdev: DP pdev handle
94 */
95 void dp_mon_filter_setup_smart_monitor_1_0(struct dp_pdev *pdev);
96
97 /**
98 * dp_mon_filter_reset_smart_monitor_1_0() - Reset the smart monitor mode filter
99 * @pdev: DP pdev handle
100 */
101 void dp_mon_filter_reset_smart_monitor_1_0(struct dp_pdev *pdev);
102 #else
dp_mon_filter_setup_smart_monitor_1_0(struct dp_pdev * pdev)103 static inline void dp_mon_filter_setup_smart_monitor_1_0(struct dp_pdev *pdev)
104 {
105 }
106
dp_mon_filter_reset_smart_monitor_1_0(struct dp_pdev * pdev)107 static inline void dp_mon_filter_reset_smart_monitor_1_0(struct dp_pdev *pdev)
108 {
109 }
110 #endif
111
112 /**
113 * dp_mon_set_reset_mon_mac_filter_1_0() - Set/Reset the monitor mode filter
114 * @pdev: DP pdev handle
115 * @val: Indicate set/reset filter
116 */
117 void dp_mon_set_reset_mon_mac_filter_1_0(struct dp_pdev *pdev, bool val);
118
119 #ifdef WLAN_RX_PKT_CAPTURE_ENH
120 /**
121 * dp_mon_filter_setup_rx_enh_capture_1_0() - Setup the Rx capture mode filters
122 * @pdev: DP pdev handle
123 */
124 void dp_mon_filter_setup_rx_enh_capture_1_0(struct dp_pdev *pdev);
125
126 /**
127 * dp_mon_filter_reset_rx_enh_capture_1_0() - Reset the Rx capture mode filters
128 * @pdev: DP pdev handle
129 */
130 void dp_mon_filter_reset_rx_enh_capture_1_0(struct dp_pdev *pdev);
131 #else
dp_mon_filter_setup_rx_enh_capture_1_0(struct dp_pdev * pdev)132 static inline void dp_mon_filter_setup_rx_enh_capture_1_0(struct dp_pdev *pdev)
133 {
134 }
135
dp_mon_filter_reset_rx_enh_capture_1_0(struct dp_pdev * pdev)136 static inline void dp_mon_filter_reset_rx_enh_capture_1_0(struct dp_pdev *pdev)
137 {
138 }
139 #endif
140
141 /**
142 * dp_mon_filter_setup_mon_mode_1_0() - Setup the Rx monitor mode filter
143 * @pdev: DP pdev handle
144 */
145 void dp_mon_filter_setup_mon_mode_1_0(struct dp_pdev *pdev);
146
147 /**
148 * dp_mon_filter_reset_mon_mode_1_0() - Reset the Rx monitor mode filter
149 * @pdev: DP pdev handle
150 */
151 void dp_mon_filter_reset_mon_mode_1_0(struct dp_pdev *pdev);
152
153 #ifdef WDI_EVENT_ENABLE
154 /**
155 * dp_mon_filter_setup_rx_pkt_log_full_1_0() - Setup the Rx pktlog full mode
156 * filter in the radio object.
157 * @pdev: DP pdev handle
158 */
159 void dp_mon_filter_setup_rx_pkt_log_full_1_0(struct dp_pdev *pdev);
160
161 /**
162 * dp_mon_filter_reset_rx_pkt_log_full_1_0() - Reset the Rx pktlog full mode
163 * filter in the radio object.
164 * @pdev: DP pdev handle
165 */
166 void dp_mon_filter_reset_rx_pkt_log_full_1_0(struct dp_pdev *pdev);
167
168 /**
169 * dp_mon_filter_setup_rx_pkt_log_lite_1_0() - Setup the Rx pktlog lite mode
170 * filter in the radio object.
171 * @pdev: DP pdev handle
172 */
173 void dp_mon_filter_setup_rx_pkt_log_lite_1_0(struct dp_pdev *pdev);
174
175 /**
176 * dp_mon_filter_reset_rx_pkt_log_lite_1_0() - Reset the Rx pktlog lite mode
177 * filter in the radio object.
178 * @pdev: DP pdev handle
179 */
180 void dp_mon_filter_reset_rx_pkt_log_lite_1_0(struct dp_pdev *pdev);
181
182 /**
183 * dp_mon_filter_setup_rx_pkt_log_cbf_1_0() - Setup the Rx pktlog cbf mode
184 * filter in the radio object.
185 * @pdev: DP pdev handle
186 */
187 void dp_mon_filter_setup_rx_pkt_log_cbf_1_0(struct dp_pdev *pdev);
188
189 /**
190 * dp_mon_filter_reset_rx_pktlog_cbf_1_0() - Reset the Rx pktlog cbf mode filter
191 * @pdev: DP pdev handle
192 */
193 void dp_mon_filter_reset_rx_pktlog_cbf_1_0(struct dp_pdev *pdev);
194 #else
dp_mon_filter_setup_rx_pkt_log_full_1_0(struct dp_pdev * pdev)195 static inline void dp_mon_filter_setup_rx_pkt_log_full_1_0(struct dp_pdev *pdev)
196 {
197 }
198
dp_mon_filter_reset_rx_pkt_log_full_1_0(struct dp_pdev * pdev)199 static inline void dp_mon_filter_reset_rx_pkt_log_full_1_0(struct dp_pdev *pdev)
200 {
201 }
202
dp_mon_filter_setup_rx_pkt_log_lite_1_0(struct dp_pdev * pdev)203 static inline void dp_mon_filter_setup_rx_pkt_log_lite_1_0(struct dp_pdev *pdev)
204 {
205 }
206
dp_mon_filter_reset_rx_pkt_log_lite_1_0(struct dp_pdev * pdev)207 static inline void dp_mon_filter_reset_rx_pkt_log_lite_1_0(struct dp_pdev *pdev)
208 {
209 }
210
dp_mon_filter_setup_rx_pkt_log_cbf_1_0(struct dp_pdev * pdev)211 static inline void dp_mon_filter_setup_rx_pkt_log_cbf_1_0(struct dp_pdev *pdev)
212 {
213 }
214
dp_mon_filter_reset_rx_pktlog_cbf_1_0(struct dp_pdev * pdev)215 static inline void dp_mon_filter_reset_rx_pktlog_cbf_1_0(struct dp_pdev *pdev)
216 {
217 }
218 #endif
219
220 QDF_STATUS dp_mon_filter_update_1_0(struct dp_pdev *pdev);
221
222 #ifdef QCA_MAC_FILTER_FW_SUPPORT
223 /**
224 * dp_mon_mac_filter_set() - Setup rx monitor mac filter feature
225 * @msg_word: msg word
226 * @tlv_filter: rx ring filter configuration
227 */
228 void dp_mon_mac_filter_set(uint32_t *msg_word,
229 struct htt_rx_ring_tlv_filter *tlv_filter);
230 #else
231 static inline
dp_mon_mac_filter_set(uint32_t * msg_word,struct htt_rx_ring_tlv_filter * tlv_filter)232 void dp_mon_mac_filter_set(uint32_t *msg_word,
233 struct htt_rx_ring_tlv_filter *tlv_filter)
234 {
235 }
236 #endif
237
238 #endif /* _DP_MON_FILTER_1_0_H_ */
239