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_TX_MON_2_0_H_ 19 #define _DP_TX_MON_2_0_H_ 20 21 #include <qdf_nbuf_frag.h> 22 #include <hal_be_api_mon.h> 23 24 struct dp_mon_desc; 25 26 /** 27 * dp_tx_mon_desc_list - structure to store double linked liskt 28 * @tx_ppdu_info_dlist_elem: support adding to double linked list 29 * @tx_ppdu_info_slist_elem: support adding to single linked list 30 * @tx_mon_reap_cnt: tx monitor reap count 31 */ 32 struct dp_tx_mon_desc_list { 33 union dp_mon_desc_list_elem_t *desc_list; 34 union dp_mon_desc_list_elem_t *tail; 35 uint32_t tx_mon_reap_cnt; 36 }; 37 38 /* 39 * dp_tx_mon_buffers_alloc() - allocate tx monitor buffers 40 * @soc: DP soc handle 41 * 42 * Return: QDF_STATUS_SUCCESS: Success 43 * QDF_STATUS_E_FAILURE: Error 44 */ 45 QDF_STATUS 46 dp_tx_mon_buffers_alloc(struct dp_soc *soc, uint32_t size); 47 48 /* 49 * dp_tx_mon_buffers_free() - free tx monitor buffers 50 * @soc: dp soc handle 51 * 52 */ 53 void 54 dp_tx_mon_buffers_free(struct dp_soc *soc); 55 56 /* 57 * dp_tx_mon_desc_pool_deinit() - deinit tx monitor descriptor pool 58 * @soc: dp soc handle 59 * 60 */ 61 void 62 dp_tx_mon_buf_desc_pool_deinit(struct dp_soc *soc); 63 64 /* 65 * dp_tx_mon_desc_pool_deinit() - deinit tx monitor descriptor pool 66 * @soc: dp soc handle 67 * 68 * Return: QDF_STATUS_SUCCESS: Success 69 * QDF_STATUS_E_FAILURE: Error 70 */ 71 QDF_STATUS 72 dp_tx_mon_buf_desc_pool_init(struct dp_soc *soc); 73 74 /* 75 * dp_tx_mon_buf_desc_pool_free() - free tx monitor descriptor pool 76 * @soc: dp soc handle 77 * 78 */ 79 void dp_tx_mon_buf_desc_pool_free(struct dp_soc *soc); 80 81 /* 82 * dp_tx_mon_buf_desc_pool_alloc() - allocate tx monitor descriptor pool 83 * @soc: DP soc handle 84 * 85 * Return: QDF_STATUS_SUCCESS: Success 86 * QDF_STATUS_E_FAILURE: Error 87 */ 88 QDF_STATUS 89 dp_tx_mon_buf_desc_pool_alloc(struct dp_soc *soc); 90 91 /** 92 * dp_tx_mon_update_end_reason() - API to update end reason 93 * 94 * @mon_pdev - DP_MON_PDEV handle 95 * @ppdu_id - ppdu_id 96 * @end_reason - monitor destination descriptor end reason 97 * 98 * Return: void 99 */ 100 void dp_tx_mon_update_end_reason(struct dp_mon_pdev *mon_pdev, 101 int ppdu_id, int end_reason); 102 103 /** 104 * dp_tx_mon_status_free_packet_buf() - API to free packet buffer 105 * @pdev: pdev Handle 106 * @status_frag: status frag 107 * @end_offset: status fragment end offset 108 * @mon_desc_list_ref: tx monitor descriptor list reference 109 * 110 * Return: void 111 */ 112 void 113 dp_tx_mon_status_free_packet_buf(struct dp_pdev *pdev, 114 qdf_frag_t status_frag, 115 uint32_t end_offset, 116 struct dp_tx_mon_desc_list *mon_desc_list_ref); 117 118 /** 119 * dp_tx_process_pktlog_be() - process pktlog 120 * @soc: dp soc handle 121 * @pdev: dp pdev handle 122 * @status_frag: frag pointer which needs to be added to nbuf 123 * @end_offset: Offset in frag to be added to nbuf_frags 124 * 125 * Return: 126 * * 0 - OK to runtime suspend the device 127 * * -EINVAL - invalid argument 128 * * -ENOMEM - out of memory 129 */ 130 QDF_STATUS 131 dp_tx_process_pktlog_be(struct dp_soc *soc, struct dp_pdev *pdev, 132 void *status_frag, uint32_t end_offset); 133 /* 134 * dp_tx_mon_process_status_tlv() - API to processed TLV 135 * invoked from interrupt handler 136 * 137 * @soc - DP_SOC handle 138 * @pdev - DP_PDEV handle 139 * @mon_ring_desc - descriptor status info 140 * @addr - status buffer frag address 141 * @end_offset - end offset of buffer that has valid buffer 142 * @mon_desc_list_ref: tx monitor descriptor list reference 143 * 144 * Return: QDF_STATUS 145 */ 146 QDF_STATUS 147 dp_tx_mon_process_status_tlv(struct dp_soc *soc, 148 struct dp_pdev *pdev, 149 struct hal_mon_desc *mon_ring_desc, 150 qdf_frag_t status_frag, 151 uint32_t end_offset, 152 struct dp_tx_mon_desc_list *mon_desc_list_ref); 153 154 /* 155 * dp_tx_mon_process_2_0() - tx monitor interrupt process 156 * @soc: dp soc handle 157 * @int_ctx: interrupt context 158 * @mac_id: mac id 159 * @quota: quota to process 160 * 161 */ 162 uint32_t 163 dp_tx_mon_process_2_0(struct dp_soc *soc, struct dp_intr *int_ctx, 164 uint32_t mac_id, uint32_t quota); 165 166 /* 167 * dp_tx_mon_print_ring_stat_2_0() - Print monitor ring stats 168 * @pdev: dp pdev handle 169 * 170 */ 171 void 172 dp_tx_mon_print_ring_stat_2_0(struct dp_pdev *pdev); 173 174 /* The maximum buffer length allocated for radiotap for monitor status buffer */ 175 #define MAX_MONITOR_HEADER (512) 176 #define MAX_DUMMY_FRM_BODY (128) 177 178 #define MAX_STATUS_BUFFER_IN_PPDU (64) 179 #define TXMON_NO_BUFFER_SZ (64) 180 181 #define DP_BA_ACK_FRAME_SIZE (sizeof(struct ieee80211_ctlframe_addr2) + 36) 182 #define DP_ACK_FRAME_SIZE (sizeof(struct ieee80211_frame_min_one)) 183 #define DP_CTS_FRAME_SIZE (sizeof(struct ieee80211_frame_min_one)) 184 #define DP_ACKNOACK_FRAME_SIZE (sizeof(struct ieee80211_frame) + 16) 185 186 #define DP_IEEE80211_BAR_CTL_TID_S 12 187 #define DP_IEEE80211_BAR_CTL_TID_M 0xf 188 #define DP_IEEE80211_BAR_CTL_POLICY_S 0 189 #define DP_IEEE80211_BAR_CTL_POLICY_M 0x1 190 #define DP_IEEE80211_BA_S_SEQ_S 4 191 #define DP_IEEE80211_BAR_CTL_COMBA 0x0004 192 193 #define TXMON_PPDU(ppdu_info, field) ppdu_info->field 194 #define TXMON_PPDU_USR(ppdu_info, user_index, field) \ 195 ppdu_info->hal_txmon.rx_user_status[user_index].field 196 #define TXMON_PPDU_COM(ppdu_info, field) ppdu_info->hal_txmon.rx_status.field 197 #define TXMON_PPDU_HAL(ppdu_info, field) ppdu_info->hal_txmon.field 198 199 #define HE_DATA_CNT 6 200 201 #define INITIATOR_WINDOW 0 202 #define RESPONSE_WINDOW 1 203 204 /** 205 * bf_type - tx monitor supported Beamformed type 206 */ 207 enum bf_type { 208 NO_BF = 0, 209 LEGACY_BF, 210 SU_BF, 211 MU_BF 212 }; 213 214 /** 215 * dot11b_preamble_type - tx monitor supported 11b preamble type 216 */ 217 enum dot11b_preamble_type { 218 SHORT_PREAMBLE = 0, 219 LONG_PREAMBLE, 220 }; 221 222 /** 223 * bw_type - tx monitor supported bandwidth type 224 */ 225 enum bw_type { 226 TXMON_BW_20_MHZ = 0, 227 TXMON_BW_40_MHZ, 228 TXMON_BW_80_MHZ, 229 TXMON_BW_160_MHZ, 230 TXMON_BW_240_MHZ, 231 TXMON_BW_320_MHZ 232 }; 233 234 /** 235 * ppdu_start_reason - tx monitor supported PPDU start reason type 236 */ 237 enum ppdu_start_reason { 238 TXMON_FES_PROTECTION_FRAME, 239 TXMON_FES_AFTER_PROTECTION, 240 TXMON_FES_ONLY, 241 TXMON_RESPONSE_FRAME, 242 TXMON_TRIG_RESPONSE_FRAME, 243 TXMON_DYNAMIC_PROTECTION_FES_ONLY 244 }; 245 246 /** 247 * guard_interval - tx monitor supported Guard interval type 248 */ 249 enum guard_interval { 250 TXMON_GI_0_8_US = 0, 251 TXMON_GI_0_4_US, 252 TXMON_GI_1_6_US, 253 TXMON_GI_3_2_US 254 }; 255 256 /** 257 * RU_size_start - tx monitor supported RU size start type 258 */ 259 enum RU_size_start { 260 TXMON_RU_26 = 0, 261 TXMON_RU_52, 262 TXMON_RU_106, 263 TXMON_RU_242, 264 TXMON_RU_484, 265 TXMON_RU_996, 266 TXMON_RU_1992, 267 TXMON_RU_FULLBW_240, 268 TXMON_RU_FULLBW_320, 269 TXMON_RU_MULTI_LARGE, 270 TXMON_RU_78, 271 TXMON_RU_132 272 }; 273 274 /** 275 * response_type_expected - expected response type 276 */ 277 enum response_type_expected { 278 TXMON_RESP_NO_RESP = 0, 279 TXMON_RESP_ACK, 280 TXMON_RESP_BA_64_BITMAP, 281 TXMON_RESP_BA_256, 282 TXMON_RESP_ACTIONNOACK, 283 TXMON_RESP_ACK_BA, 284 TXMON_RESP_CTS, 285 TXMON_RESP_ACK_DATA, 286 TXMON_RESP_NDP_ACK, 287 TXMON_RESP_NDP_MODIFIED_ACK, 288 TXMON_RESP_NDP_BA, 289 TXMON_RESP_NDP_CTS, 290 TXMON_RESP_NDP_ACK_OR_NDP_MODIFIED_ACK, 291 TXMON_RESP_UL_MU_BA, 292 TXMON_RESP_UL_MU_BA_AND_DATA, 293 TXMON_RESP_UL_MU_CBF, 294 TXMON_RESP_UL_MU_FRAMES, 295 TXMON_RESP_ANY_RESP_TO_DEVICE, 296 TXMON_RESP_ANY_RESP_ACCEPTED, 297 TXMON_RESP_FRAMELESS_PHYRX_RESP_ACCEPTED, 298 TXMON_RESP_RANGING_NDP_AND_LMR, 299 TXMON_RESP_BA_512, 300 TXMON_RESP_BA_1024, 301 TXMON_RESP_UL_MU_RANGING_CTS2S, 302 TXMON_RESP_UL_MU_RANGING_NDP, 303 TXMON_RESP_UL_MU_RANGING_LMR 304 }; 305 306 /** 307 * resposne_to_respone - tx monitor supported response to response type 308 */ 309 enum resposne_to_respone { 310 TXMON_RESP_TO_RESP_NONE = 0, 311 TXMON_RESP_TO_RESP_SU_BA, 312 TXMON_RESP_TO_RESP_MU_BA, 313 TXMON_RESP_TO_RESP_CMD 314 }; 315 316 /** 317 * medium_protection_type - tx monitor supported protection type 318 */ 319 enum medium_protection_type { 320 TXMON_MEDIUM_NO_PROTECTION, 321 TXMON_MEDIUM_RTS_LEGACY, 322 TXMON_MEDIUM_RTS_11AC_STATIC_BW, 323 TXMON_MEDIUM_RTS_11AC_DYNAMIC_BW, 324 TXMON_MEDIUM_CTS2SELF, 325 TXMON_MEDIUM_QOS_NULL_NO_ACK_3ADDR, 326 TXMON_MEDIUM_QOS_NULL_NO_ACK_4ADDR, 327 }; 328 329 /** 330 * ndp_frame - tx monitor supported ndp frame type 331 */ 332 enum ndp_frame { 333 TXMON_NO_NDP_TRANSMISSION, 334 TXMON_BEAMFORMING_NDP, 335 TXMON_HE_RANGING_NDP, 336 TXMON_HE_FEEDBACK_NDP, 337 }; 338 339 /** 340 * tx_ppdu_info_type - tx monitor supported ppdu type 341 */ 342 enum tx_ppdu_info_type { 343 TX_PROT_PPDU_INFO, 344 TX_DATA_PPDU_INFO, 345 }; 346 347 /** 348 * dp_tx_ppdu_info - structure to store tx ppdu info 349 * @ppdu_id: current ppdu info ppdu id 350 * @frametype: ppdu info frame type 351 * @cur_usr_idx: current user index of ppdu info 352 * @tx_ppdu_info_dlist_elem: support adding to double linked list 353 * @tx_ppdu_info_slist_elem: support adding to single linked list 354 * @hal_txmon: hal tx monitor info for that ppdu 355 */ 356 struct dp_tx_ppdu_info { 357 uint32_t ppdu_id; 358 uint8_t frame_type; 359 uint8_t cur_usr_idx; 360 361 union { 362 TAILQ_ENTRY(dp_tx_ppdu_info) tx_ppdu_info_dlist_elem; 363 STAILQ_ENTRY(dp_tx_ppdu_info) tx_ppdu_info_slist_elem; 364 } ulist; 365 366 #define tx_ppdu_info_list_elem ulist.tx_ppdu_info_dlist_elem 367 #define tx_ppdu_info_queue_elem ulist.tx_ppdu_info_slist_elem 368 369 struct hal_tx_ppdu_info hal_txmon; 370 }; 371 372 /** 373 * dp_tx_monitor_drop_stats - structure to store tx monitor drop statistic 374 * @ppdu_drop_cnt: ppdu drop counter 375 * @mpdu_drop_cnt: mpdu drop counter 376 * @tlv_drop_cnt: tlv drop counter 377 * @pkt_buf_recv: tx monitor packet buffer received 378 * @pkt_buf_free: tx monitor packet buffer free 379 * @pkt_buf_processed: tx monitor packet buffer processed 380 * @pkt_buf_to_stack: tx monitor packet buffer send to stack 381 * @status_buf_recv: tx monitor status buffer received 382 * @status_buf_free: tx monitor status buffer free 383 * @totat_tx_mon_replenish_cnt: tx monitor replenish count 384 * @total_tx_mon_reap_cnt: tx monitor reap count 385 * @tx_mon_stuck: tx monitor stuck count 386 * @total_tx_mon_stuck: tx monitor stuck count 387 * @ppdu_info_drop_th: count ppdu info been dropped due threshold reached 388 * @ppdu_info_drop_flush: count ppdu info been dropped due to flush detected 389 * @ppdu_info_drop_trunc: count ppdu info been dropped due to truncated 390 */ 391 struct dp_tx_monitor_drop_stats { 392 uint64_t ppdu_drop_cnt; 393 uint64_t mpdu_drop_cnt; 394 uint64_t tlv_drop_cnt; 395 396 uint64_t pkt_buf_recv; 397 uint64_t pkt_buf_free; 398 uint64_t pkt_buf_processed; 399 uint64_t pkt_buf_to_stack; 400 401 uint64_t status_buf_recv; 402 uint64_t status_buf_free; 403 404 uint64_t totat_tx_mon_replenish_cnt; 405 uint64_t total_tx_mon_reap_cnt; 406 uint8_t tx_mon_stuck; 407 uint32_t total_tx_mon_stuck; 408 409 uint64_t ppdu_info_drop_th; 410 uint64_t ppdu_info_drop_flush; 411 uint64_t ppdu_info_drop_trunc; 412 }; 413 414 /** 415 * dp_tx_monitor_mode - tx monitor supported mode 416 * @TX_MON_BE_DISABLE: tx monitor disable 417 * @TX_MON_BE_FULL_CAPTURE: tx monitor mode to capture full packet 418 * @TX_MON_BE_PEER_FILTER: tx monitor mode to capture peer filter 419 */ 420 enum dp_tx_monitor_mode { 421 TX_MON_BE_DISABLE, 422 TX_MON_BE_FULL_CAPTURE, 423 TX_MON_BE_PEER_FILTER, 424 }; 425 426 /** 427 * dp_tx_monitor_framework_mode - tx monitor framework mode 428 * @TX_MON_BE_FRM_WRK_DISABLE: tx monitor frame work disable 429 * @TX_MON_BE_FRM_WRK_FULL_CAPTURE: tx monitor frame work full capture 430 * @TX_MON_BE_FRM_WRK_128B_CAPTURE: tx monitor frame work 128B capture 431 */ 432 enum dp_tx_monitor_framework_mode { 433 TX_MON_BE_FRM_WRK_DISABLE, 434 TX_MON_BE_FRM_WRK_FULL_CAPTURE, 435 TX_MON_BE_FRM_WRK_128B_CAPTURE, 436 }; 437 438 #define TX_TAILQ_INSERT_TAIL(pdev, tx_ppdu_info) \ 439 do { \ 440 STAILQ_INSERT_TAIL(&pdev->tx_ppdu_info_list, \ 441 tx_ppdu_info, tx_ppdu_info_list_elem);\ 442 pdev->tx_ppdu_info_queue_depth++; \ 443 } while (0) 444 445 #define TX_TAILQ_REMOVE(pdev, tx_ppdu_info) \ 446 do { \ 447 TAILQ_REMOVE(&pdev->tx_ppdu_info_list, tx_ppdu_info, \ 448 tx_ppdu_info_list_elem); \ 449 pdev->tx_ppdu_info_queue_depth--; \ 450 } while (0) 451 452 #define TX_TAILQ_FIRST(pdev) TAILQ_FIRST(&pdev->tx_ppdu_info_list) 453 454 #define TX_TAILQ_FOREACH_SAFE(pdev, tx_ppdu_info) \ 455 do { \ 456 struct dp_tx_ppdu_info *tx_ppdu_info_next = NULL; \ 457 TAILQ_FOREACH_SAFE(tx_ppdu_info, \ 458 &pdev->tx_ppdu_info_list, \ 459 tx_ppdu_info_list_elem, \ 460 tx_ppdu_info_next); \ 461 } while (0) 462 463 #ifndef WLAN_TX_PKT_CAPTURE_ENH_BE 464 /** 465 * dp_pdev_tx_monitor_be - info to store tx capture information in pdev 466 * @be_ppdu_id: current ppdu id 467 * @mode: tx monitor core framework current mode 468 * @stats: tx monitor drop stats for that mac 469 * 470 */ 471 struct dp_pdev_tx_monitor_be { 472 uint32_t be_ppdu_id; 473 uint32_t mode; 474 struct dp_tx_monitor_drop_stats stats; 475 }; 476 477 /** 478 * dp_peer_tx_capture_be: Tx monitor peer structure 479 * 480 * This is a dummy structure 481 */ 482 struct dp_peer_tx_capture_be { 483 }; 484 #else 485 486 /** 487 * struct dp_txmon_frag_vec - a contiguous range of physical memory address 488 * @frag_buf: frag buffer address 489 * @end_offset: byte offset within the frag buffer where valid data resides 490 */ 491 struct dp_txmon_frag_vec { 492 qdf_frag_t frag_buf; 493 uint32_t end_offset; 494 }; 495 496 /** 497 * dp_pdev_tx_monitor_be - info to store tx capture information in pdev 498 * @be_ppdu_id: current ppdu id 499 * @be_end_reason_bitmap: current end reason bitmap 500 * @mode: tx monitor current mode 501 * @tx_mon_list_lock: spinlock protection to list 502 * @post_ppdu_workqueue: tx monitor workqueue representation 503 * @post_ppdu_work: tx monitor post ppdu work 504 * @tx_ppdu_info_list_depth: list depth counter 505 * @tx_ppdu_info_list: ppdu info list to hold ppdu 506 * @defer_ppdu_info_list_depth: defer ppdu list depth counter 507 * @defer_ppdu_info_list: defer ppdu info list to hold defer ppdu 508 * @stats: tx monitor drop stats for that mac 509 * @tx_prot_ppdu_info: tx monitor protection ppdu info 510 * @tx_data_ppdu_info: tx monitor data ppdu info 511 * @last_prot_ppdu_info: last tx monitor protection ppdu info 512 * @last_data_ppdu_info: last tx monitor data ppdu info 513 * @prot_status_info: protection status info 514 * @data_status_info: data status info 515 * @last_tsft: last received tsft 516 * @last_ppdu_timestamp: last received ppdu_timestamp 517 * @last_frag_q_idx: last index of frag buffer 518 * @cur_frag_q_idx: current index of frag buffer 519 * @status_frag_queue: array of status frag queue to hold 64 status buffer 520 */ 521 struct dp_pdev_tx_monitor_be { 522 uint32_t be_ppdu_id; 523 uint32_t be_end_reason_bitmap; 524 uint32_t mode; 525 526 qdf_spinlock_t tx_mon_list_lock; 527 528 qdf_work_t post_ppdu_work; 529 qdf_workqueue_t *post_ppdu_workqueue; 530 531 uint32_t tx_ppdu_info_list_depth; 532 533 STAILQ_HEAD(, dp_tx_ppdu_info) tx_ppdu_info_queue; 534 535 uint32_t defer_ppdu_info_list_depth; 536 537 STAILQ_HEAD(, dp_tx_ppdu_info) defer_tx_ppdu_info_queue; 538 539 struct dp_tx_monitor_drop_stats stats; 540 541 struct dp_tx_ppdu_info *tx_prot_ppdu_info; 542 struct dp_tx_ppdu_info *tx_data_ppdu_info; 543 544 struct dp_tx_ppdu_info *last_prot_ppdu_info; 545 struct dp_tx_ppdu_info *last_data_ppdu_info; 546 547 struct hal_tx_status_info prot_status_info; 548 struct hal_tx_status_info data_status_info; 549 550 uint64_t last_tsft; 551 uint32_t last_ppdu_timestamp; 552 553 uint8_t last_frag_q_idx; 554 uint8_t cur_frag_q_idx; 555 struct dp_txmon_frag_vec frag_q_vec[MAX_STATUS_BUFFER_IN_PPDU]; 556 }; 557 558 /** 559 * dp_peer_tx_capture_be: Tx monitor peer structure 560 * 561 * need to be added here 562 */ 563 struct dp_peer_tx_capture_be { 564 }; 565 #endif /* WLAN_TX_PKT_CAPTURE_ENH_BE */ 566 567 /* 568 * dp_tx_mon_ppdu_info_free() - API to free dp_tx_ppdu_info 569 * @tx_ppdu_info - pointer to tx_ppdu_info 570 * 571 * Return: void 572 */ 573 void dp_tx_mon_ppdu_info_free(struct dp_tx_ppdu_info *tx_ppdu_info); 574 575 /* 576 * dp_tx_mon_free_usr_mpduq() - API to free user mpduq 577 * @tx_ppdu_info - pointer to tx_ppdu_info 578 * @usr_idx - user index 579 * @tx_cap_be - pointer to tx capture be 580 * 581 * Return: void 582 */ 583 void dp_tx_mon_free_usr_mpduq(struct dp_tx_ppdu_info *tx_ppdu_info, 584 uint8_t usr_idx, 585 struct dp_pdev_tx_monitor_be *tx_mon_be); 586 587 /* 588 * dp_tx_mon_free_ppdu_info() - API to free dp_tx_ppdu_info 589 * @tx_ppdu_info - pointer to tx_ppdu_info 590 * @tx_cap_be - pointer to tx capture be 591 * 592 * Return: void 593 */ 594 void dp_tx_mon_free_ppdu_info(struct dp_tx_ppdu_info *tx_ppdu_info, 595 struct dp_pdev_tx_monitor_be *tx_mon_be); 596 597 /* 598 * dp_tx_mon_get_ppdu_info() - API to allocate dp_tx_ppdu_info 599 * @pdev - pdev handle 600 * @type - type of ppdu_info data or protection 601 * @num_user - number user in a ppdu_info 602 * @ppdu_id - ppdu_id number 603 * 604 * Return: pointer to dp_tx_ppdu_info 605 */ 606 struct dp_tx_ppdu_info *dp_tx_mon_get_ppdu_info(struct dp_pdev *pdev, 607 enum tx_ppdu_info_type type, 608 uint8_t num_user, 609 uint32_t ppdu_id); 610 611 #ifdef WLAN_TX_PKT_CAPTURE_ENH_BE 612 /** 613 * dp_tx_ppdu_stats_attach_2_0 - Initialize Tx PPDU stats and enhanced capture 614 * @pdev: DP PDEV 615 * 616 * Return: none 617 */ 618 void dp_tx_ppdu_stats_attach_2_0(struct dp_pdev *pdev); 619 620 /** 621 * dp_tx_ppdu_stats_detach_2_0 - Cleanup Tx PPDU stats and enhanced capture 622 * @pdev: DP PDEV 623 * 624 * Return: none 625 */ 626 void dp_tx_ppdu_stats_detach_2_0(struct dp_pdev *pdev); 627 628 /* 629 * dp_print_pdev_tx_monitor_stats_2_0: print tx capture stats 630 * @pdev: DP PDEV handle 631 * 632 * return: void 633 */ 634 void dp_print_pdev_tx_monitor_stats_2_0(struct dp_pdev *pdev); 635 636 /* 637 * dp_config_enh_tx_monitor_2_0()- API to enable/disable enhanced tx capture 638 * @pdev_handle: DP_PDEV handle 639 * @val: user provided value 640 * 641 * Return: QDF_STATUS 642 */ 643 QDF_STATUS dp_config_enh_tx_monitor_2_0(struct dp_pdev *pdev, uint8_t val); 644 645 /* 646 * dp_peer_set_tx_capture_enabled_2_0() - add tx monitor peer filter 647 * @pdev: Datapath PDEV handle 648 * @peer: Datapath PEER handle 649 * @is_tx_pkt_cap_enable: flag for tx capture enable/disable 650 * @peer_mac: peer mac address 651 * 652 * Return: status 653 */ 654 QDF_STATUS dp_peer_set_tx_capture_enabled_2_0(struct dp_pdev *pdev_handle, 655 struct dp_peer *peer_handle, 656 uint8_t is_tx_pkt_cap_enable, 657 uint8_t *peer_mac); 658 #endif /* WLAN_TX_PKT_CAPTURE_ENH_BE */ 659 660 #if (defined(WIFI_MONITOR_SUPPORT) && !defined(WLAN_TX_PKT_CAPTURE_ENH_BE)) 661 /* 662 * dp_config_enh_tx_core_monitor_2_0()- API to validate core framework 663 * @pdev_handle: DP_PDEV handle 664 * @val: user provided value 665 * 666 * Return: QDF_STATUS 667 */ 668 QDF_STATUS dp_config_enh_tx_core_monitor_2_0(struct dp_pdev *pdev, uint8_t val); 669 #endif 670 671 #endif /* _DP_TX_MON_2_0_H_ */ 672