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