1 /* 2 * Copyright (c) 2020-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 6 * any purpose with or without fee is hereby granted, provided that the 7 * above copyright notice and this permission notice appear in all 8 * copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 17 * PERFORMANCE OF THIS SOFTWARE. 18 */ 19 20 #ifndef _DP_MON_FILTER_H_ 21 #define _DP_MON_FILTER_H_ 22 23 /* 24 * Accessor Macros to access the software 25 * defined HTT filter htt_rx_ring_tlv_filter. 26 */ 27 #define DP_MON_FILTER_TLV_OFFSET 0x00000000 28 #define DP_MON_FILTER_TLV_MASK 0xffffffff 29 #define DP_MON_FILTER_TLV_LSB 0 30 31 #define DP_MON_FILTER_FP_MGMT_OFFSET 0x00000004 32 #define DP_MON_FILTER_FP_MGMT_MASK 0x0000ffff 33 #define DP_MON_FILTER_FP_MGMT_LSB 0 34 35 #define DP_MON_FILTER_MO_MGMT_OFFSET 0x00000004 36 #define DP_MON_FILTER_MO_MGMT_MASK 0xffff0000 37 #define DP_MON_FILTER_MO_MGMT_LSB 16 38 39 #define DP_MON_FILTER_FP_CTRL_OFFSET 0x00000008 40 #define DP_MON_FILTER_FP_CTRL_MASK 0x0000ffff 41 #define DP_MON_FILTER_FP_CTRL_LSB 0 42 43 #define DP_MON_FILTER_MO_CTRL_OFFSET 0x00000008 44 #define DP_MON_FILTER_MO_CTRL_MASK 0xffff0000 45 #define DP_MON_FILTER_MO_CTRL_LSB 16 46 47 #define DP_MON_FILTER_FP_DATA_OFFSET 0x0000000c 48 #define DP_MON_FILTER_FP_DATA_MASK 0x0000ffff 49 #define DP_MON_FILTER_FP_DATA_LSB 0 50 51 #define DP_MON_FILTER_MO_DATA_OFFSET 0x0000000c 52 #define DP_MON_FILTER_MO_DATA_MASK 0xffff0000 53 #define DP_MON_FILTER_MO_DATA_LSB 16 54 55 #define DP_MON_FILTER_MD_DATA_OFFSET 0x00000010 56 #define DP_MON_FILTER_MD_DATA_MASK 0x0000ffff 57 #define DP_MON_FILTER_MD_DATA_LSB 0 58 59 #define DP_MON_FILTER_MD_MGMT_OFFSET 0x00000010 60 #define DP_MON_FILTER_MD_MGMT_MASK 0xffff0000 61 #define DP_MON_FILTER_MD_MGMT_LSB 16 62 63 #define DP_MON_FILTER_MD_CTRL_OFFSET 0x00000014 64 #define DP_MON_FILTER_MD_CTRL_MASK 0x0000ffff 65 #define DP_MON_FILTER_MD_CTRL_LSB 0 66 67 #define DP_MON_FILTER_GET(src, field) \ 68 ((*((uint32_t *)((uint8_t *)(src) + DP_MON_ ## field ## _OFFSET)) & \ 69 (DP_MON_ ## field ## _MASK)) >> DP_MON_ ## field ## _LSB) \ 70 71 #define DP_MON_FILTER_SET(dst, field, value) \ 72 do { \ 73 uint32_t *val = \ 74 ((uint32_t *)((uint8_t *)(dst) + DP_MON_ ## field ## _OFFSET)); \ 75 *val &= ~(DP_MON_ ## field ## _MASK); \ 76 *val |= ((value) << DP_MON_ ## field ## _LSB); \ 77 } while (0) 78 79 #if defined(WLAN_PKT_CAPTURE_RX_2_0) || defined(CONFIG_WORD_BASED_TLV) || \ 80 defined(WLAN_FEATURE_LOCAL_PKT_CAPTURE) 81 #define DP_RX_MON_FILTER_SET_RX_HDR_LEN(dst, src) \ 82 do { \ 83 (dst)->rx_hdr_length = src.rx_hdr_length; \ 84 } while (0) 85 #else 86 #define DP_RX_MON_FILTER_SET_RX_HDR_LEN(dst, src) 87 #endif 88 89 #define DP_MON_FILTER_PRINT(fmt, args ...) \ 90 QDF_TRACE(QDF_MODULE_ID_MON_FILTER, QDF_TRACE_LEVEL_DEBUG, \ 91 fmt, ## args) 92 93 #define dp_mon_filter_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_MON_FILTER, params) 94 #define dp_mon_filter_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_MON_FILTER, params) 95 #define dp_mon_filter_info(params...) \ 96 __QDF_TRACE_FL(QDF_TRACE_LEVEL_INFO_HIGH, QDF_MODULE_ID_MON_FILTER, ## params) 97 #define dp_mon_filter_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_MON_FILTER, params) 98 99 /** 100 * struct dp_mon_filter - Monitor TLV filter 101 * @valid: enable/disable TLV filter 102 * @tlv_filter: Rx ring TLV filter 103 */ 104 struct dp_mon_filter { 105 bool valid; 106 struct htt_rx_ring_tlv_filter tlv_filter; 107 }; 108 109 /* rx hdr tlv dma lengths */ 110 enum dp_rx_hdr_dma_length { 111 /* default dma length(128B) */ 112 DEFAULT_RX_HDR_DMA_LENGTH = 0, 113 /* dma length 64 bytes */ 114 RX_HDR_DMA_LENGTH_64B = 1, 115 /* dma length 128 bytes */ 116 RX_HDR_DMA_LENGTH_128B = 2, 117 /* dma length 256 bytes */ 118 RX_HDR_DMA_LENGTH_256B = 3, 119 }; 120 121 /* 122 * NB: intentionally not using kernel-doc comment because the kernel-doc 123 * script does not handle the complex conditional compilation 124 * enum dp_mon_filter_mode - Different modes for SRNG filters 125 * @DP_MON_FILTER_ENHACHED_STATS_MODE: PPDU enhanced stats mode 126 * @DP_MON_FILTER_SMART_MONITOR_MODE: Smart monitor mode 127 * @DP_MON_FILTER_MCOPY_MODE: AM copy mode 128 * @DP_MON_FILTER_MONITOR_MODE: Monitor mode 129 * @DP_MON_FILTER_RX_CAPTURE_MODE: Rx Capture mode 130 * @DP_MON_FILTER_PKT_LOG_FULL_MODE: Packet log full mode 131 * @DP_MON_FILTER_PKT_LOG_LITE_MODE: Packet log lite mode 132 * @DP_MON_FILTER_PKT_LOG_CBF_MODE: Packet log cbf mode 133 * @DP_MON_FILTER_PKT_LOG_HYBRID_MODE: Packet log hybrid mode 134 * @DP_MON_FILTER_UNDECODED_METADATA_CAPTURE_MODE: Undecoded frame capture 135 * @DP_MON_FILTER_LITE_MON_MODE: 136 * @DP_MON_FILTER_MAX_MODE: max filter mode 137 */ 138 enum dp_mon_filter_mode { 139 #ifdef QCA_ENHANCED_STATS_SUPPORT 140 DP_MON_FILTER_ENHACHED_STATS_MODE, 141 #endif /* QCA_ENHANCED_STATS_SUPPORT */ 142 #ifdef QCA_MCOPY_SUPPORT 143 DP_MON_FILTER_MCOPY_MODE, 144 #endif /* QCA_MCOPY_SUPPORT */ 145 #if defined(ATH_SUPPORT_NAC_RSSI) || defined(ATH_SUPPORT_NAC) 146 DP_MON_FILTER_SMART_MONITOR_MODE, 147 #endif /* ATH_SUPPORT_NAC_RSSI || ATH_SUPPORT_NAC */ 148 DP_MON_FILTER_MONITOR_MODE, 149 #ifdef WLAN_RX_PKT_CAPTURE_ENH 150 DP_MON_FILTER_RX_CAPTURE_MODE, 151 #endif /* WLAN_RX_PKT_CAPTURE_ENH */ 152 153 #ifdef WDI_EVENT_ENABLE 154 DP_MON_FILTER_PKT_LOG_FULL_MODE, 155 DP_MON_FILTER_PKT_LOG_LITE_MODE, 156 DP_MON_FILTER_PKT_LOG_CBF_MODE, 157 #ifdef BE_PKTLOG_SUPPORT 158 DP_MON_FILTER_PKT_LOG_HYBRID_MODE, 159 #endif 160 #endif /* WDI_EVENT_ENABLE */ 161 #ifdef QCA_UNDECODED_METADATA_SUPPORT 162 DP_MON_FILTER_UNDECODED_METADATA_CAPTURE_MODE, 163 #endif 164 #ifdef QCA_SUPPORT_LITE_MONITOR 165 DP_MON_FILTER_LITE_MON_MODE, 166 #endif /*QCA_SUPPORT_LITE_MONITOR*/ 167 DP_MON_FILTER_MAX_MODE 168 }; 169 170 /** 171 * enum dp_mon_filter_srng_type - Srng types dynamic mode filter 172 * settings. 173 * @DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF: RXDMA srng type 174 * @DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS: RxDMA monitor status srng 175 * @DP_MON_FILTER_SRNG_TYPE_RXDMA_MON_BUF: RxDMA destination srng 176 * @DP_MON_FILTER_SRNG_TYPE_RXMON_DEST: RxMON destination srng 177 * @DP_MON_FILTER_SRNG_TYPE_TXMON_DEST: TxMON destination srng 178 * @DP_MON_FILTER_SRNG_TYPE_MAX: Srng max type 179 */ 180 enum dp_mon_filter_srng_type { 181 DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF, 182 DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS, 183 DP_MON_FILTER_SRNG_TYPE_RXDMA_MON_BUF, 184 DP_MON_FILTER_SRNG_TYPE_RXMON_DEST, 185 DP_MON_FILTER_SRNG_TYPE_TXMON_DEST, 186 DP_MON_FILTER_SRNG_TYPE_MAX 187 }; 188 189 /** 190 * enum dp_mon_filter_action - Action for storing the filters 191 * into the radio structure. 192 * @DP_MON_FILTER_CLEAR: Clears the filter for a mode 193 * @DP_MON_FILTER_SET: Set the filtes for a mode 194 */ 195 enum dp_mon_filter_action { 196 DP_MON_FILTER_CLEAR, 197 DP_MON_FILTER_SET, 198 }; 199 200 #ifdef QCA_UNDECODED_METADATA_SUPPORT 201 /** 202 * enum dp_mon_fp_phy_err_buf_source - fp_phy_err_buf_src indicates the source 203 * ring selection for the FP PHY ERR status tlv. 204 * @WBM2RXDMA_BUF_SOURCE_RING: 0 - wbm2rxdma_buf_source_ring 205 * @FW2RXDMA_BUF_SOURCE_RING: 1 - fw2rxdma_buf_source_ring 206 * @SW2RXDMA_BUF_SOURCE_RING: 2 - sw2rxdma_buf_source_ring 207 * @NO_BUFFER_RING: 3 - no_buffer_ring 208 */ 209 enum dp_mon_fp_phy_err_buf_source { 210 WBM2RXDMA_BUF_SOURCE_RING, 211 FW2RXDMA_BUF_SOURCE_RING, 212 SW2RXDMA_BUF_SOURCE_RING, 213 NO_BUFFER_RING 214 }; 215 216 /** 217 * enum dp_mon_fp_phy_err_buf_dest - fp_phy_err_buf_dest indicates the 218 * destination ring selection for the FP PHY ERR status tlv. 219 * @RXDMA_RELEASING_RING: 0 - rxdma_release_ring 220 * @RXDMA2FW_RING: 1 - rxdma2fw_ring 221 * @RXDMA2SW_RING: 2 - rxdma2sw_ring 222 * @RXDMA2REO_RING: 3 - rxdma2reo_ring 223 */ 224 enum dp_mon_fp_phy_err_buf_dest { 225 RXDMA_RELEASING_RING, 226 RXDMA2FW_RING, 227 RXDMA2SW_RING, 228 RXDMA2REO_RING 229 }; 230 #endif 231 232 /** 233 * dp_mon_filters_reset() - reset all filters 234 * @pdev: DP pdev handle 235 */ 236 void dp_mon_filters_reset(struct dp_pdev *pdev); 237 238 #ifdef QCA_ENHANCED_STATS_SUPPORT 239 /** 240 * dp_mon_filter_setup_enhanced_stats() - Setup the enhanced stats filter 241 * @pdev: DP pdev handle 242 */ 243 void dp_mon_filter_setup_enhanced_stats(struct dp_pdev *pdev); 244 245 /*** 246 * dp_mon_filter_reset_enhanced_stats() - Reset the enhanced stats filter 247 * @pdev: DP pdev handle 248 */ 249 void dp_mon_filter_reset_enhanced_stats(struct dp_pdev *pdev); 250 #endif /* QCA_ENHANCED_STATS_SUPPORT */ 251 252 #ifdef QCA_MCOPY_SUPPORT 253 /** 254 * dp_mon_filter_setup_mcopy_mode() - Setup the m_copy mode filter 255 * @pdev: DP pdev handle 256 */ 257 void dp_mon_filter_setup_mcopy_mode(struct dp_pdev *pdev); 258 259 /** 260 * dp_mon_filter_reset_mcopy_mode() - Reset the m_copy mode filter 261 * @pdev: DP pdev handle 262 */ 263 void dp_mon_filter_reset_mcopy_mode(struct dp_pdev *pdev); 264 #endif /* QCA_MCOPY_SUPPORT */ 265 266 #ifdef QCA_UNDECODED_METADATA_SUPPORT 267 /** 268 * dp_mon_filter_setup_undecoded_metadata_mode() - Setup the undecoded 269 * metadata capture mode filter 270 * @pdev: DP pdev handle 271 */ 272 void dp_mon_filter_setup_undecoded_metadata_mode(struct dp_pdev *pdev); 273 274 /** 275 * dp_mon_filter_reset_undecoded_metadata_mode() - Reset the undecoded 276 * metadata capture mode filter 277 * @pdev: DP pdev handle 278 */ 279 void dp_mon_filter_reset_undecoded_metadata_mode(struct dp_pdev *pdev); 280 #endif /* QCA_UNDECODED_METADATA_SUPPORT */ 281 282 #if defined(ATH_SUPPORT_NAC_RSSI) || defined(ATH_SUPPORT_NAC) 283 /** 284 * dp_mon_filter_setup_smart_monitor() - Setup the smart monitor mode filter 285 * @pdev: DP pdev handle 286 */ 287 void dp_mon_filter_setup_smart_monitor(struct dp_pdev *pdev); 288 289 /** 290 * dp_mon_filter_reset_smart_monitor() - Reset the smart monitor mode filter 291 * @pdev: DP pdev handle 292 */ 293 void dp_mon_filter_reset_smart_monitor(struct dp_pdev *pdev); 294 #endif /* ATH_SUPPORT_NAC_RSSI || ATH_SUPPORT_NAC */ 295 296 /** 297 * dp_mon_filter_set_reset_mon_mac_filter() - Setup the monitor mac filter 298 * @pdev: DP pdev handle 299 * @val: indicating set/reset 300 */ 301 void dp_mon_filter_set_reset_mon_mac_filter(struct dp_pdev *pdev, bool val); 302 303 #ifdef WLAN_RX_PKT_CAPTURE_ENH 304 /** 305 * dp_mon_filter_setup_rx_enh_capture() - Setup the Rx capture mode filters 306 * @pdev: DP pdev handle 307 */ 308 void dp_mon_filter_setup_rx_enh_capture(struct dp_pdev *pdev); 309 310 /** 311 * dp_mon_filter_reset_rx_enh_capture() - Reset the Rx capture mode filters 312 * @pdev: DP pdev handle 313 */ 314 void dp_mon_filter_reset_rx_enh_capture(struct dp_pdev *pdev); 315 #endif /* WLAN_RX_PKT_CAPTURE_ENH */ 316 317 /** 318 * dp_mon_filter_setup_mon_mode() - Setup the Rx and Tx monitor mode filter 319 * @pdev: DP pdev handle 320 */ 321 void dp_mon_filter_setup_mon_mode(struct dp_pdev *pdev); 322 323 /** 324 * dp_mon_filter_setup_tx_mon_mode() - Setup the Tx monitor mode filter 325 * @pdev: DP pdev handle 326 */ 327 void dp_mon_filter_setup_tx_mon_mode(struct dp_pdev *pdev); 328 329 /** 330 * dp_mon_filter_reset_mon_mode() - Reset the Rx monitor mode filter 331 * @pdev: DP pdev handle 332 */ 333 void dp_mon_filter_reset_mon_mode(struct dp_pdev *pdev); 334 335 #ifdef WDI_EVENT_ENABLE 336 /** 337 * dp_mon_filter_setup_rx_pkt_log_full() - Setup the Rx pktlog full mode filter 338 * @pdev: DP pdev handle 339 */ 340 void dp_mon_filter_setup_rx_pkt_log_full(struct dp_pdev *pdev); 341 342 /** 343 * dp_mon_filter_reset_rx_pkt_log_full() - Reset the Rx pktlog full mode filter 344 * @pdev: DP pdev handle 345 */ 346 void dp_mon_filter_reset_rx_pkt_log_full(struct dp_pdev *pdev); 347 348 /** 349 * dp_mon_filter_setup_rx_pkt_log_lite() - Setup the Rx pktlog lite mode filter 350 * in the radio object. 351 * @pdev: DP pdev handle 352 */ 353 void dp_mon_filter_setup_rx_pkt_log_lite(struct dp_pdev *pdev); 354 355 /** 356 * dp_mon_filter_reset_rx_pkt_log_lite() - Reset the Rx pktlog lite mode filter 357 * @pdev: DP pdev handle 358 */ 359 void dp_mon_filter_reset_rx_pkt_log_lite(struct dp_pdev *pdev); 360 361 /** 362 * dp_mon_filter_setup_rx_pkt_log_cbf() - Setup the Rx pktlog cbf mode filter 363 * in the radio object. 364 * @pdev: DP pdev handle 365 */ 366 void dp_mon_filter_setup_rx_pkt_log_cbf(struct dp_pdev *pdev); 367 368 /** 369 * dp_mon_filter_reset_rx_pktlog_cbf() - Reset the Rx pktlog cbf mode filter 370 * @pdev: DP pdev handle 371 */ 372 void dp_mon_filter_reset_rx_pktlog_cbf(struct dp_pdev *pdev); 373 374 #ifdef BE_PKTLOG_SUPPORT 375 /** 376 * dp_mon_filter_setup_pktlog_hybrid() - Setup the pktlog hybrid mode filter 377 * in the radio object. 378 * @pdev: DP pdev handle 379 */ 380 void dp_mon_filter_setup_pktlog_hybrid(struct dp_pdev *pdev); 381 382 /** 383 * dp_mon_filter_reset_pktlog_hybrid() - Reset the pktlog hybrid mode filter 384 * @pdev: DP pdev handle 385 */ 386 void dp_mon_filter_reset_pktlog_hybrid(struct dp_pdev *pdev); 387 #endif 388 #endif /* WDI_EVENT_ENABLE */ 389 390 /** 391 * dp_mon_filter_set_status_cbf() - Set the cbf status filters 392 * @pdev: DP pdev handle 393 * @filter: Dp mon filters 394 * 395 * Return: void 396 */ 397 void dp_mon_filter_set_status_cbf(struct dp_pdev *pdev, 398 struct dp_mon_filter *filter); 399 400 /** 401 * dp_mon_filter_update() - Setup the RX & Tx monitor filter setting for a srng 402 * type 403 * @pdev: DP pdev handle 404 * 405 * Return: QDF_STATUS 406 */ 407 QDF_STATUS dp_mon_filter_update(struct dp_pdev *pdev); 408 409 /** 410 * dp_mon_filter_dealloc() - Deallocate the filter objects to be stored in 411 * the radio object. 412 * @mon_pdev: monitor pdev handle 413 */ 414 void dp_mon_filter_dealloc(struct dp_mon_pdev *mon_pdev); 415 416 /** 417 * dp_mon_filter_alloc() - Allocate the filter objects to be stored in 418 * the radio object. 419 * @mon_pdev: monitor pdev handle 420 */ 421 struct dp_mon_filter **dp_mon_filter_alloc(struct dp_mon_pdev *mon_pdev); 422 423 /** 424 * dp_mon_filter_show_filter() - Show the set filters 425 * @mon_pdev: DP pdev handle 426 * @mode: The filter modes 427 * @filter: tlv filter 428 */ 429 void dp_mon_filter_show_filter(struct dp_mon_pdev *mon_pdev, 430 enum dp_mon_filter_mode mode, 431 struct dp_mon_filter *filter); 432 433 /** 434 * dp_mon_ht2_rx_ring_cfg() - Send the tlv config to fw for a srng_type 435 * based on target 436 * @soc: DP soc handle 437 * @pdev: DP pdev handle 438 * @srng_type: The srng type for which filter will be set 439 * @tlv_filter: tlv filter 440 */ 441 QDF_STATUS 442 dp_mon_ht2_rx_ring_cfg(struct dp_soc *soc, 443 struct dp_pdev *pdev, 444 enum dp_mon_filter_srng_type srng_type, 445 struct htt_rx_ring_tlv_filter *tlv_filter); 446 447 /** 448 * dp_mon_filter_reset_mon_srng() 449 * @soc: DP SoC handle 450 * @pdev: DP pdev handle 451 * @mon_srng_type: Monitor srng type 452 */ 453 void 454 dp_mon_filter_reset_mon_srng(struct dp_soc *soc, struct dp_pdev *pdev, 455 enum dp_mon_filter_srng_type mon_srng_type); 456 457 /** 458 * dp_mon_filter_set_mon_cmn() - Setp the common mon filters 459 * @pdev: DP pdev handle 460 * @filter: DP mon filter 461 * 462 * Return: None 463 */ 464 void dp_mon_filter_set_mon_cmn(struct dp_pdev *pdev, 465 struct dp_mon_filter *filter); 466 467 /** 468 * dp_mon_filter_set_status_cmn() - Setp the common status filters 469 * @mon_pdev: DP pdev handle 470 * @filter: Dp mon filters 471 * 472 * Return: QDF_STATUS 473 */ 474 void dp_mon_filter_set_status_cmn(struct dp_mon_pdev *mon_pdev, 475 struct dp_mon_filter *filter); 476 477 /** 478 * dp_mon_filter_setup_mon_mode() - Setup the Rx monitor mode filter 479 * @pdev: DP pdev handle 480 */ 481 void dp_mon_filter_setup_mon_mode(struct dp_pdev *pdev); 482 483 /** 484 * dp_mon_filter_setup_tx_mon_mode() - Setup the Tx monitor mode filter 485 * @pdev: DP pdev handle 486 */ 487 void dp_mon_filter_setup_tx_mon_mode(struct dp_pdev *pdev); 488 489 /** 490 * dp_mon_filter_reset_tx_mon_mode() - Reset the Tx monitor mode filter 491 * @pdev: DP pdev handle 492 */ 493 void dp_mon_filter_reset_tx_mon_mode(struct dp_pdev *pdev); 494 495 /** 496 * dp_mon_filter_reset_mon_mode() - Reset the Rx monitor mode filter 497 * @pdev: DP pdev handle 498 */ 499 void dp_mon_filter_reset_mon_mode(struct dp_pdev *pdev); 500 501 /** 502 * dp_mon_filter_set_cbf_cmn() - Set the common cbf mode filters 503 * @pdev: DP pdev handle 504 * @filter: Dp mon filters 505 * 506 * Return: void 507 */ 508 void dp_mon_filter_set_cbf_cmn(struct dp_pdev *pdev, 509 struct dp_mon_filter *filter); 510 511 /** 512 * dp_tx_mon_filter_update() - Setup the tx monitor filter setting for a srng 513 * type 514 * @pdev: DP pdev handle 515 * 516 * Return: QDF_STATUS 517 */ 518 QDF_STATUS dp_tx_mon_filter_update(struct dp_pdev *pdev); 519 520 /** 521 * dp_mon_filter_dealloc() - Deallocate the filter objects to be stored in 522 * the radio object. 523 * @mon_pdev: DP pdev handle 524 */ 525 void dp_mon_filter_dealloc(struct dp_mon_pdev *mon_pdev); 526 527 /** 528 * dp_mon_filter_alloc() - Allocate the filter objects to be stored in 529 * the radio object. 530 * @mon_pdev: DP pdev handle 531 */ 532 struct dp_mon_filter **dp_mon_filter_alloc(struct dp_mon_pdev *mon_pdev); 533 534 /** 535 * dp_mon_filter_h2t_setup() - Setup filter 536 * @soc: Dp soc handle 537 * @pdev: pdev handle 538 * @srng_type: srng type 539 * @filter: filter 540 */ 541 void dp_mon_filter_h2t_setup(struct dp_soc *soc, struct dp_pdev *pdev, 542 enum dp_mon_filter_srng_type srng_type, 543 struct dp_mon_filter *filter); 544 545 /** 546 * dp_mon_ht2_rx_ring_cfg() - Configure filter to HW 547 * @soc: Dp soc handle 548 * @pdev: Dp pdev handle 549 * @srng_type: SRNG type 550 * @tlv_filter: filter 551 */ 552 QDF_STATUS 553 dp_mon_ht2_rx_ring_cfg(struct dp_soc *soc, 554 struct dp_pdev *pdev, 555 enum dp_mon_filter_srng_type srng_type, 556 struct htt_rx_ring_tlv_filter *tlv_filter); 557 558 /** 559 * dp_rx_mon_hdr_length_set() - Setup rx monitor hdr tlv length 560 * @msg_word: msg word 561 * @tlv_filter: rx ring filter configuration 562 */ 563 void 564 dp_rx_mon_hdr_length_set(uint32_t *msg_word, 565 struct htt_rx_ring_tlv_filter *tlv_filter); 566 567 #ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE 568 /** 569 * dp_mon_start_local_pkt_capture() - start local packet capture 570 * @cdp_soc: cdp soc 571 * @pdev_id: pdev id 572 * @filter: filter configuration 573 */ 574 QDF_STATUS dp_mon_start_local_pkt_capture(struct cdp_soc_t *cdp_soc, 575 uint8_t pdev_id, 576 struct cdp_monitor_filter *filter); 577 578 /** 579 * dp_mon_stop_local_pkt_capture() - stop local packet capture 580 * @cdp_soc: cdp soc 581 * @pdev_id: pdev id 582 */ 583 QDF_STATUS dp_mon_stop_local_pkt_capture(struct cdp_soc_t *cdp_soc, 584 uint8_t pdev_id); 585 586 /** 587 * dp_mon_set_local_pkt_capture_running() - set local packet capture running 588 * @mon_pdev: monitor pdev 589 * @val: value 590 */ 591 QDF_STATUS dp_mon_set_local_pkt_capture_running(struct dp_mon_pdev *mon_pdev, 592 bool val); 593 594 /** 595 * dp_mon_get_is_local_pkt_capture_running() - get local packet capture running 596 * @cdp_soc: cdp soc 597 * @pdev_id: pdev id 598 */ 599 bool dp_mon_get_is_local_pkt_capture_running(struct cdp_soc_t *cdp_soc, 600 uint8_t pdev_id); 601 #else 602 static inline 603 QDF_STATUS dp_mon_set_local_pkt_capture_running(struct dp_mon_pdev *mon_pdev, 604 bool val) 605 { 606 return QDF_STATUS_E_NOSUPPORT; 607 } 608 609 static inline 610 QDF_STATUS dp_mon_start_local_pkt_capture(struct cdp_soc_t *cdp_soc, 611 uint8_t pdev_id, 612 struct cdp_monitor_filter *filter) 613 { 614 return QDF_STATUS_E_NOSUPPORT; 615 } 616 617 static inline 618 QDF_STATUS dp_mon_stop_local_pkt_capture(struct cdp_soc_t *cdp_soc, 619 uint8_t pdev_id) 620 { 621 return QDF_STATUS_E_NOSUPPORT; 622 } 623 624 static inline 625 bool dp_mon_get_is_local_pkt_capture_running(struct cdp_soc_t *cdp_soc, 626 uint8_t pdev_id) 627 { 628 return false; 629 } 630 631 #endif /* WLAN_FEATURE_LOCAL_PKT_CAPTURE */ 632 #endif /* #ifndef _DP_MON_FILTER_H_ */ 633