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_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 * @htt_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 * @htt_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 * @htt_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 * @htt_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_enable_mpdu_logging() - Setup rx monitor per packet mpdu logging 81 * @msg_word: msg word 82 * @htt_tlv_filter: rx ring filter configuration 83 */ 84 void 85 dp_rx_mon_enable_mpdu_logging(uint32_t *msg_word, 86 struct htt_rx_ring_tlv_filter *tlv_filter); 87 88 /** 89 * dp_rx_mon_enable_fpmo() - Setup rx monitor fpmo mode type/subtype filters 90 * @msg_word: msg word 91 * @htt_tlv_filter: rx ring filter configuration 92 */ 93 void 94 dp_rx_mon_enable_fpmo(uint32_t *msg_word, 95 struct htt_rx_ring_tlv_filter *tlv_filter); 96 97 #ifdef QCA_ENHANCED_STATS_SUPPORT 98 /** 99 * dp_mon_filter_setup_enhanced_stats() - Setup the enhanced stats filter 100 * @pdev: DP pdev handle 101 */ 102 void dp_mon_filter_setup_enhanced_stats_2_0(struct dp_pdev *pdev); 103 104 /*** 105 * dp_mon_filter_reset_enhanced_stats() - Reset the enhanced stats filter 106 * @pdev: DP pdev handle 107 */ 108 void dp_mon_filter_reset_enhanced_stats_2_0(struct dp_pdev *pdev); 109 #else 110 static inline void 111 dp_mon_filter_setup_enhanced_stats_2_0(struct dp_pdev *pdev) 112 { 113 } 114 115 static inline void 116 dp_mon_filter_reset_enhanced_stats_2_0(struct dp_pdev *pdev) 117 { 118 } 119 #endif 120 121 #ifdef QCA_UNDECODED_METADATA_SUPPORT 122 /* 123 * dp_mon_filter_setup_undecoded_metadata_capture() - Setup the filter 124 * for undecoded metadata capture 125 * @pdev: DP pdev handle 126 */ 127 void dp_mon_filter_setup_undecoded_metadata_capture_2_0(struct dp_pdev *pdev); 128 129 /* 130 * dp_mon_filter_reset_undecoded_metadata_capture() - Reset the filter 131 * for undecoded metadata capture 132 * @pdev: DP pdev handle 133 */ 134 void dp_mon_filter_reset_undecoded_metadata_capture_2_0(struct dp_pdev *pdev); 135 #else 136 static inline void 137 dp_mon_filter_setup_undecoded_metadata_capture_2_0(struct dp_pdev *pdev) 138 { 139 } 140 141 static inline void 142 dp_mon_filter_reset_undecoded_metadata_capture_2_0(struct dp_pdev *pdev) 143 { 144 } 145 #endif 146 147 /** 148 * dp_mon_filter_setup_rx_mon_mode() - Setup the Rx monitor mode filter 149 * @pdev: DP pdev handle 150 */ 151 void dp_mon_filter_setup_rx_mon_mode_2_0(struct dp_pdev *pdev); 152 153 /** 154 * dp_mon_filter_reset_mon_mode() - Reset the Rx monitor mode filter 155 * @pdev: DP pdev handle 156 */ 157 void dp_mon_filter_reset_rx_mon_mode_2_0(struct dp_pdev *pdev); 158 159 /** 160 * dp_mon_filter_setup_tx_mon_mode() - Setup the Tx monitor mode filter 161 * @pdev: DP pdev handle 162 */ 163 void dp_mon_filter_setup_tx_mon_mode_2_0(struct dp_pdev *pdev); 164 165 /** 166 * dp_mon_filter_reset_tx_mon_mode() - Reset the Tx monitor mode filter 167 * @pdev: DP pdev handle 168 */ 169 void dp_mon_filter_reset_tx_mon_mode_2_0(struct dp_pdev *pdev); 170 171 #ifdef WDI_EVENT_ENABLE 172 /** 173 * dp_mon_filter_setup_rx_pkt_log_full() - Setup the Rx pktlog full mode filter 174 * @pdev: DP pdev handle 175 */ 176 void dp_mon_filter_setup_rx_pkt_log_full_2_0(struct dp_pdev *pdev); 177 178 /** 179 * dp_mon_filter_reset_rx_pkt_log_full_2_0() - Reset pktlog full mode filter 180 * @pdev: DP pdev handle 181 */ 182 void dp_mon_filter_reset_rx_pkt_log_full_2_0(struct dp_pdev *pdev); 183 184 /** 185 * dp_mon_filter_setup_rx_pkt_log_lite() - Setup the Rx pktlog lite mode filter 186 * in the radio object. 187 * @pdev: DP pdev handle 188 */ 189 void dp_mon_filter_setup_rx_pkt_log_lite_2_0(struct dp_pdev *pdev); 190 191 /** 192 * dp_mon_filter_reset_rx_pkt_log_lite() - Reset the Rx pktlog lite mode filter 193 * @pdev: DP pdev handle 194 */ 195 void dp_mon_filter_reset_rx_pkt_log_lite_2_0(struct dp_pdev *pdev); 196 197 /** 198 * dp_mon_filter_setup_rx_pkt_log_cbf() - Setup the Rx pktlog cbf mode filter 199 * in the radio object. 200 * @pdev: DP pdev handle 201 */ 202 void dp_mon_filter_setup_rx_pkt_log_cbf_2_0(struct dp_pdev *pdev); 203 204 /** 205 * dp_mon_filter_reset_rx_pktlog_cbf() - Reset the Rx pktlog cbf mode filter 206 * @pdev: DP pdev handle 207 */ 208 void dp_mon_filter_reset_rx_pktlog_cbf_2_0(struct dp_pdev *pdev); 209 210 /** 211 * dp_mon_filter_setup_pktlog_hybrid_2_0() - Setup the pktlog hybrid mode filter 212 * @pdev: DP pdev handle 213 */ 214 void dp_mon_filter_setup_pktlog_hybrid_2_0(struct dp_pdev *pdev); 215 216 /** 217 * dp_mon_filter_reset_pktlog_hybrid_2_0() - Reset pktlog hybrid mode filter 218 * @pdev: DP pdev handle 219 */ 220 void dp_mon_filter_reset_pktlog_hybrid_2_0(struct dp_pdev *pdev); 221 #else 222 static inline void 223 dp_mon_filter_setup_rx_pkt_log_full_2_0(struct dp_pdev *pdev) 224 { 225 } 226 227 static inline void 228 dp_mon_filter_reset_rx_pkt_log_full_2_0(struct dp_pdev *pdev) 229 { 230 } 231 232 static inline void 233 dp_mon_filter_setup_rx_pkt_log_lite_2_0(struct dp_pdev *pdev) 234 { 235 } 236 237 static inline void 238 dp_mon_filter_reset_rx_pkt_log_lite_2_0(struct dp_pdev *pdev) 239 { 240 } 241 242 static inline void 243 dp_mon_filter_setup_rx_pkt_log_cbf_2_0(struct dp_pdev *pdev) 244 { 245 } 246 247 static inline void 248 dp_mon_filter_reset_rx_pktlog_cbf_2_0(struct dp_pdev *pdev) 249 { 250 } 251 252 static inline void 253 dp_mon_filter_setup_pktlog_hybrid_2_0(struct dp_pdev *pdev) 254 { 255 } 256 257 static inline void 258 dp_mon_filter_reset_pktlog_hybrid_2_0(struct dp_pdev *pdev) 259 { 260 } 261 #endif 262 263 /** 264 * dp_tx_mon_filter_update_2_0() - Update monitor filter configuration 265 * @pdev: physical device handle 266 * 267 * Return: non-zero for failure, zero for success 268 */ 269 QDF_STATUS dp_tx_mon_filter_update_2_0(struct dp_pdev *pdev); 270 271 /** 272 * dp_rx_mon_filter_update_2_0() - Update monitor filter configuration 273 * @pdev: physical device handle 274 * 275 * Return: non-zero for failure, zero for success 276 */ 277 QDF_STATUS dp_rx_mon_filter_update_2_0(struct dp_pdev *pdev); 278 279 /** 280 * dp_mon_filter_dealloc_2_0() - free tx monitor filter memory 281 * @pdev: physical device handle 282 * 283 * Return: non-zero for failure, zero for success 284 */ 285 void dp_mon_filter_dealloc_2_0(struct dp_pdev *pdev); 286 287 /** 288 * dp_mon_filter_alloc_2_0() - tx monitor filter allocation 289 * @pdev: physical device handle 290 * 291 * Return: non-zero for failure, zero for success 292 */ 293 QDF_STATUS dp_mon_filter_alloc_2_0(struct dp_pdev *pdev); 294 295 #ifdef QCA_SUPPORT_LITE_MONITOR 296 void dp_mon_filter_reset_rx_lite_mon(struct dp_mon_pdev_be *be_mon_pdev); 297 298 void dp_mon_filter_setup_rx_lite_mon(struct dp_mon_pdev_be *be_mon_pdev); 299 300 /** 301 * dp_mon_filter_reset_tx_lite_mon() - Reset tx lite monitor filter 302 * @be_mon_pdev: physical mon device handle 303 * 304 * Return: Null 305 */ 306 void dp_mon_filter_reset_tx_lite_mon(struct dp_mon_pdev_be *be_mon_pdev); 307 308 /** 309 * dp_mon_filter_setup_tx_lite_mon() - Setup tx lite monitor filter 310 * @be_mon_pdev: physical mon device handle 311 * 312 * Return: Null 313 */ 314 void dp_mon_filter_setup_tx_lite_mon(struct dp_mon_pdev_be *be_mon_pdev); 315 #endif 316 #endif /* _DP_MON_FILTER_2_0_H_ */ 317