1 /* 2 * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. 3 * Copyright (c) 2022 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_RX_MON_H_ 21 #define _DP_RX_MON_H_ 22 23 #define dp_rx_mon_status_alert(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_DP_RX_MON_STATUS, params) 24 #define dp_rx_mon_status_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_DP_RX_MON_STATUS, params) 25 #define dp_rx_mon_status_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_DP_RX_MON_STATUS, params) 26 #define dp_rx_mon_status_info(params...) \ 27 __QDF_TRACE_FL(QDF_TRACE_LEVEL_INFO_HIGH, QDF_MODULE_ID_DP_RX_MON_STATUS, ## params) 28 #define dp_rx_mon_status_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_DP_RX_MON_STATUS, params) 29 30 #define dp_rx_mon_dest_alert(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_DP_RX_MON_DEST, params) 31 #define dp_rx_mon_dest_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_DP_RX_MON_DEST, params) 32 #define dp_rx_mon_dest_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_DP_RX_MON_DEST, params) 33 #define dp_rx_mon_dest_info(params...) \ 34 __QDF_TRACE_FL(QDF_TRACE_LEVEL_INFO_HIGH, QDF_MODULE_ID_DP_RX_MON_DEST, ## params) 35 #define dp_rx_mon_dest_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_DP_RX_MON_DEST, params) 36 37 /* The maximum buffer length allocated for radiotap for monitor status buffer */ 38 #define MAX_MONITOR_HEADER (512) 39 40 /** 41 * enum dp_mon_reap_status - monitor status ring ppdu status 42 * 43 * @DP_MON_STATUS_NO_DMA - DMA not done for status ring entry 44 * @DP_MON_STATUS_MATCH - status and dest ppdu id mathes 45 * @DP_MON_STATUS_LAG - status ppdu id is lagging 46 * @DP_MON_STATUS_LEAD - status ppdu id is leading 47 * @DP_MON_STATUS_REPLENISH - status ring entry is NULL 48 */ 49 enum dp_mon_reap_status { 50 DP_MON_STATUS_NO_DMA, 51 DP_MON_STATUS_MATCH, 52 DP_MON_STATUS_LAG, 53 DP_MON_STATUS_LEAD, 54 DP_MON_STATUS_REPLENISH 55 }; 56 57 /* 58 * dp_rx_mon_status_process() - Process monitor status ring and 59 * TLV in status ring. 60 * 61 * @soc: core txrx main context 62 * @int_ctx: interrupt context 63 * @mac_id: mac_id which is one of 3 mac_ids 64 * @quota: No. of ring entry that can be serviced in one shot. 65 66 * Return: uint32_t: No. of ring entry that is processed. 67 */ 68 uint32_t 69 dp_rx_mon_status_process(struct dp_soc *soc, struct dp_intr *int_ctx, 70 uint32_t mac_id, uint32_t quota); 71 72 /* 73 * dp_rx_populate_cbf_hdr - Send CBF frame with htt header 74 * @soc: Datapath soc handle 75 * @mac_id: Datapath mac id 76 * @event: WDI event 77 * @mpdu: mpdu buffer 78 * @msdu_timesstamp: time stamp 79 * 80 * Return: QDF_STATUS 81 */ 82 QDF_STATUS dp_rx_populate_cbf_hdr(struct dp_soc *soc, 83 uint32_t mac_id, uint32_t event, 84 qdf_nbuf_t data, uint32_t msdu_timestamp); 85 86 /** 87 * dp_rx_mon_handle_status_buf_done () - Handle DMA not done case for 88 * monitor status ring 89 * 90 * @pdev: DP pdev handle 91 * @mon_status_srng: Monitor status SRNG 92 * 93 * Return: enum dp_mon_reap_status 94 */ 95 enum dp_mon_reap_status 96 dp_rx_mon_handle_status_buf_done(struct dp_pdev *pdev, 97 void *mon_status_srng); 98 99 #ifdef QCA_SUPPORT_FULL_MON 100 101 /** 102 * dp_full_mon_attach() - Full monitor mode attach 103 * This API initilises full monitor mode resources 104 * 105 * @pdev: dp pdev object 106 * 107 * Return: void 108 * 109 */ 110 void dp_full_mon_attach(struct dp_pdev *pdev); 111 112 /** 113 * dp_full_mon_detach() - Full monitor mode attach 114 * This API deinitilises full monitor mode resources 115 * 116 * @pdev: dp pdev object 117 * 118 * Return: void 119 * 120 */ 121 void dp_full_mon_detach(struct dp_pdev *pdev); 122 123 /** 124 * dp_rx_mon_process ()- API to process monitor destination ring for 125 * full monitor mode 126 * 127 * @soc: dp soc handle 128 * @int_ctx: interrupt context 129 * @mac_id: lmac id 130 * @quota: No. of ring entry that can be serviced in one shot. 131 */ 132 133 uint32_t dp_rx_mon_process(struct dp_soc *soc, struct dp_intr *int_ctx, 134 uint32_t mac_id, uint32_t quota); 135 136 #else 137 /** 138 * dp_full_mon_attach() - attach full monitor mode resources 139 * @pdev: Datapath PDEV handle 140 * 141 * Return: void 142 */ 143 static inline void dp_full_mon_attach(struct dp_pdev *pdev) 144 { 145 } 146 147 /** 148 * dp_full_mon_detach() - detach full monitor mode resources 149 * @pdev: Datapath PDEV handle 150 * 151 * Return: void 152 * 153 */ 154 static inline void dp_full_mon_detach(struct dp_pdev *pdev) 155 { 156 } 157 #endif 158 159 /** 160 * dp_mon_link_free() - free monitor link desc pool 161 * @pdev: core txrx pdev context 162 * 163 * This function will release DP link desc pool for monitor mode from 164 * main device context. 165 * 166 * Return: QDF_STATUS_SUCCESS: success 167 * QDF_STATUS_E_RESOURCES: Error return 168 */ 169 QDF_STATUS dp_mon_link_free(struct dp_pdev *pdev); 170 171 172 /** 173 * dp_mon_process() - Main monitor mode processing roution. 174 * @soc: core txrx main context 175 * @int_ctx: interrupt context 176 * @mac_id: mac_id which is one of 3 mac_ids 177 * @quota: No. of status ring entry that can be serviced in one shot. 178 * 179 * This call monitor status ring process then monitor 180 * destination ring process. 181 * Called from the bottom half (tasklet/NET_RX_SOFTIRQ) 182 * 183 * Return: uint32_t: No. of ring entry that is processed. 184 */ 185 uint32_t dp_mon_process(struct dp_soc *soc, struct dp_intr *int_ctx, 186 uint32_t mac_id, uint32_t quota); 187 188 QDF_STATUS dp_rx_mon_deliver(struct dp_soc *soc, uint32_t mac_id, 189 qdf_nbuf_t head_msdu, qdf_nbuf_t tail_msdu); 190 /* 191 * dp_rx_mon_deliver_non_std() - deliver frames for non standard path 192 * @soc: core txrx main contex 193 * @mac_id: MAC ID 194 * 195 * This function delivers the radio tap and dummy MSDU 196 * into user layer application for preamble only PPDU. 197 * 198 * Return: Operation status 199 */ 200 QDF_STATUS dp_rx_mon_deliver_non_std(struct dp_soc *soc, uint32_t mac_id); 201 202 #ifndef REMOVE_MON_DBG_STATS 203 /* 204 * dp_rx_mon_update_dbg_ppdu_stats() - Update status ring TLV count 205 * @ppdu_info: HAL RX PPDU info retrieved from status ring TLV 206 * @rx_mon_stats: monitor mode status/destination ring PPDU and MPDU count 207 * 208 * Update status ring PPDU start and end count. Keep track TLV state on 209 * PPDU start and end to find out if start and end is matching. Keep 210 * track missing PPDU start and end count. Keep track matching PPDU 211 * start and end count. 212 * 213 * Return: None 214 */ 215 static inline void 216 dp_rx_mon_update_dbg_ppdu_stats(struct hal_rx_ppdu_info *ppdu_info, 217 struct cdp_pdev_mon_stats *rx_mon_stats) 218 { 219 if (ppdu_info->rx_state == 220 HAL_RX_MON_PPDU_START) { 221 rx_mon_stats->status_ppdu_start++; 222 if (rx_mon_stats->status_ppdu_state 223 != CDP_MON_PPDU_END) 224 rx_mon_stats->status_ppdu_end_mis++; 225 rx_mon_stats->status_ppdu_state 226 = CDP_MON_PPDU_START; 227 ppdu_info->rx_state = HAL_RX_MON_PPDU_RESET; 228 } else if (ppdu_info->rx_state == 229 HAL_RX_MON_PPDU_END) { 230 rx_mon_stats->status_ppdu_end++; 231 if (rx_mon_stats->status_ppdu_state 232 != CDP_MON_PPDU_START) 233 rx_mon_stats->status_ppdu_start_mis++; 234 else 235 rx_mon_stats->status_ppdu_compl++; 236 rx_mon_stats->status_ppdu_state 237 = CDP_MON_PPDU_END; 238 ppdu_info->rx_state = HAL_RX_MON_PPDU_RESET; 239 } 240 } 241 242 /* 243 * dp_rx_mon_init_dbg_ppdu_stats() - initialization for monitor mode stats 244 * @ppdu_info: HAL RX PPDU info retrieved from status ring TLV 245 * @rx_mon_stats: monitor mode status/destination ring PPDU and MPDU count 246 * 247 * Return: None 248 */ 249 static inline void 250 dp_rx_mon_init_dbg_ppdu_stats(struct hal_rx_ppdu_info *ppdu_info, 251 struct cdp_pdev_mon_stats *rx_mon_stats) 252 { 253 ppdu_info->rx_state = HAL_RX_MON_PPDU_END; 254 rx_mon_stats->status_ppdu_state 255 = CDP_MON_PPDU_END; 256 } 257 258 #else 259 static inline void 260 dp_rx_mon_update_dbg_ppdu_stats(struct hal_rx_ppdu_info *ppdu_info, 261 struct cdp_pdev_mon_stats *rx_mon_stats) 262 { 263 } 264 265 static inline void 266 dp_rx_mon_init_dbg_ppdu_stats(struct hal_rx_ppdu_info *ppdu_info, 267 struct cdp_pdev_mon_stats *rx_mon_stats) 268 { 269 } 270 271 #endif 272 273 #ifdef QCA_ENHANCED_STATS_SUPPORT 274 void 275 dp_rx_populate_rx_rssi_chain(struct hal_rx_ppdu_info *ppdu_info, 276 struct cdp_rx_indication_ppdu *cdp_rx_ppdu); 277 278 /* 279 * dp_rx_populate_su_evm_details() - Populate su evm info 280 * @ppdu_info: ppdu info structure from ppdu ring 281 * @cdp_rx_ppdu: rx ppdu indication structure 282 */ 283 void 284 dp_rx_populate_su_evm_details(struct hal_rx_ppdu_info *ppdu_info, 285 struct cdp_rx_indication_ppdu *cdp_rx_ppdu); 286 287 /** 288 * dp_rx_handle_ppdu_stats() - Allocate and deliver ppdu stats to cdp layer 289 * @soc: core txrx main context 290 * @pdev: pdev strcuture 291 * @ppdu_info: structure for rx ppdu ring 292 * 293 * Return: none 294 */ 295 void 296 dp_rx_handle_ppdu_stats(struct dp_soc *soc, struct dp_pdev *pdev, 297 struct hal_rx_ppdu_info *ppdu_info); 298 #else 299 static inline void 300 dp_rx_populate_rx_rssi_chain(struct hal_rx_ppdu_info *ppdu_info, 301 struct cdp_rx_indication_ppdu *cdp_rx_ppdu) 302 { 303 } 304 305 static inline void 306 dp_rx_populate_su_evm_details(struct hal_rx_ppdu_info *ppdu_info, 307 struct cdp_rx_indication_ppdu *cdp_rx_ppdu) 308 { 309 } 310 311 static inline void 312 dp_rx_populate_cdp_indication_ppdu_user(struct dp_pdev *pdev, 313 struct hal_rx_ppdu_info *ppdu_info, 314 struct cdp_rx_indication_ppdu 315 *cdp_rx_ppdu) 316 { 317 } 318 319 static inline void 320 dp_rx_populate_cdp_indication_ppdu(struct dp_pdev *pdev, 321 struct hal_rx_ppdu_info *ppdu_info, 322 struct cdp_rx_indication_ppdu *cdp_rx_ppdu) 323 { 324 } 325 326 static inline void dp_rx_rate_stats_update(struct dp_peer *peer, 327 struct cdp_rx_indication_ppdu *ppdu, 328 uint32_t user) 329 { 330 } 331 332 static inline void 333 dp_rx_handle_ppdu_stats(struct dp_soc *soc, struct dp_pdev *pdev, 334 struct hal_rx_ppdu_info *ppdu_info) 335 { 336 } 337 #endif /* QCA_ENHANCED_STATS_SUPPORT */ 338 339 #ifdef QCA_UNDECODED_METADATA_SUPPORT 340 /** 341 * dp_rx_handle_ppdu_undecoded_metadata() - Allocate and deliver ppdu info 342 * undecoded metadata to cdp layer 343 * @soc: core txrx main context 344 * @pdev: pdev strcuture 345 * @ppdu_info: structure for rx ppdu ring 346 * 347 * Return: none 348 */ 349 void 350 dp_rx_handle_ppdu_undecoded_metadata(struct dp_soc *soc, struct dp_pdev *pdev, 351 struct hal_rx_ppdu_info *ppdu_info); 352 353 #else 354 static inline void 355 dp_rx_handle_ppdu_undecoded_metadata(struct dp_soc *soc, struct dp_pdev *pdev, 356 struct hal_rx_ppdu_info *ppdu_info) 357 { 358 } 359 #endif /* QCA_UNDECODED_METADATA_SUPPORT */ 360 361 #ifdef QCA_MCOPY_SUPPORT 362 /** 363 * dp_rx_handle_mcopy_mode() - Allocate and deliver first MSDU payload 364 * @soc: core txrx main context 365 * @pdev: pdev structure 366 * @ppdu_info: structure for rx ppdu ring 367 * @nbuf: QDF nbuf 368 * @fcs_ok_mpdu_cnt: fcs passsed mpdu index 369 * @deliver_frame: flag to deliver wdi event 370 * 371 * Return: QDF_STATUS_SUCCESS - If nbuf to be freed by caller 372 * QDF_STATUS_E_ALREADY - If nbuf not to be freed by caller 373 */ 374 QDF_STATUS 375 dp_rx_handle_mcopy_mode(struct dp_soc *soc, struct dp_pdev *pdev, 376 struct hal_rx_ppdu_info *ppdu_info, qdf_nbuf_t nbuf, 377 uint8_t fcs_ok_mpdu_cnt, bool deliver_frame); 378 379 /** 380 * dp_rx_mcopy_handle_last_mpdu() - cache and delive last MPDU header in a 381 * status buffer if MPDU end tlv is received in different buffer 382 * @soc: core txrx main context 383 * @pdev: pdev structure 384 * @ppdu_info: structure for rx ppdu ring 385 * @status_nbuf: QDF nbuf 386 * 387 * Return: void 388 */ 389 void 390 dp_rx_mcopy_handle_last_mpdu(struct dp_soc *soc, struct dp_pdev *pdev, 391 struct hal_rx_ppdu_info *ppdu_info, 392 qdf_nbuf_t status_nbuf); 393 394 /** 395 * dp_rx_mcopy_process_ppdu_info() - update mcopy ppdu info 396 * @ppdu_info: structure for rx ppdu ring 397 * @tlv_status: processed TLV status 398 * 399 * Return: void 400 */ 401 void 402 dp_rx_mcopy_process_ppdu_info(struct dp_pdev *pdev, 403 struct hal_rx_ppdu_info *ppdu_info, 404 uint32_t tlv_status); 405 406 void 407 dp_rx_process_mcopy_mode(struct dp_soc *soc, struct dp_pdev *pdev, 408 struct hal_rx_ppdu_info *ppdu_info, 409 uint32_t tlv_status, 410 qdf_nbuf_t status_nbuf); 411 #else 412 static inline QDF_STATUS 413 dp_rx_handle_mcopy_mode(struct dp_soc *soc, struct dp_pdev *pdev, 414 struct hal_rx_ppdu_info *ppdu_info, qdf_nbuf_t nbuf, 415 uint8_t fcs_ok_cnt, bool deliver_frame) 416 { 417 return QDF_STATUS_SUCCESS; 418 } 419 420 static inline void 421 dp_rx_mcopy_handle_last_mpdu(struct dp_soc *soc, struct dp_pdev *pdev, 422 struct hal_rx_ppdu_info *ppdu_info, 423 qdf_nbuf_t status_nbuf) 424 { 425 } 426 427 static inline void 428 dp_rx_mcopy_process_ppdu_info(struct dp_pdev *pdev, 429 struct hal_rx_ppdu_info *ppdu_info, 430 uint32_t tlv_status) 431 { 432 } 433 434 static inline void 435 dp_rx_process_mcopy_mode(struct dp_soc *soc, struct dp_pdev *pdev, 436 struct hal_rx_ppdu_info *ppdu_info, 437 uint32_t tlv_status, 438 qdf_nbuf_t status_nbuf) 439 { 440 } 441 #endif /* QCA_MCOPY_SUPPORT */ 442 443 /** 444 * dp_rx_handle_smart_mesh_mode() - Deliver header for smart mesh 445 * @soc: Datapath SOC handle 446 * @pdev: Datapath PDEV handle 447 * @ppdu_info: Structure for rx ppdu info 448 * @nbuf: Qdf nbuf abstraction for linux skb 449 * 450 * Return: 0 on success, 1 on failure 451 */ 452 int 453 dp_rx_handle_smart_mesh_mode(struct dp_soc *soc, struct dp_pdev *pdev, 454 struct hal_rx_ppdu_info *ppdu_info, 455 qdf_nbuf_t nbuf); 456 /* 457 * dp_rx_nbuf_prepare() - prepare RX nbuf 458 * @soc: core txrx main context 459 * @pdev: core txrx pdev context 460 * 461 * This function alloc & map nbuf for RX dma usage, retry it if failed 462 * until retry times reaches max threshold or succeeded. 463 * 464 * Return: qdf_nbuf_t pointer if succeeded, NULL if failed. 465 */ 466 qdf_nbuf_t 467 dp_rx_nbuf_prepare(struct dp_soc *soc, struct dp_pdev *pdev); 468 469 #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE) 470 471 /* 472 * dp_rx_mon_handle_cfr_mu_info() - Gather macaddr and ast_index of peer(s) in 473 * the PPDU received, this will be used for correlation of CFR data captured 474 * for an UL-MU-PPDU 475 * @pdev: pdev ctx 476 * @ppdu_info: pointer to ppdu info structure populated from ppdu status TLVs 477 * @cdp_rx_ppdu: Rx PPDU indication structure 478 * 479 * Return: none 480 */ 481 void 482 dp_rx_mon_handle_cfr_mu_info(struct dp_pdev *pdev, 483 struct hal_rx_ppdu_info *ppdu_info, 484 struct cdp_rx_indication_ppdu *cdp_rx_ppdu); 485 486 /* 487 * dp_rx_mon_populate_cfr_ppdu_info() - Populate cdp ppdu info from hal ppdu 488 * info 489 * @pdev: pdev ctx 490 * @ppdu_info: ppdu info structure from ppdu ring 491 * @cdp_rx_ppdu : Rx PPDU indication structure 492 * 493 * Return: none 494 */ 495 void 496 dp_rx_mon_populate_cfr_ppdu_info(struct dp_pdev *pdev, 497 struct hal_rx_ppdu_info *ppdu_info, 498 struct cdp_rx_indication_ppdu *cdp_rx_ppdu); 499 500 /** 501 * dp_cfr_rcc_mode_status() - Return status of cfr rcc mode 502 * @pdev: pdev ctx 503 * 504 * Return: True or False 505 */ 506 bool 507 dp_cfr_rcc_mode_status(struct dp_pdev *pdev); 508 509 /* 510 * dp_rx_mon_populate_cfr_info() - Populate cdp ppdu info from hal cfr info 511 * @pdev: pdev ctx 512 * @ppdu_info: ppdu info structure from ppdu ring 513 * @cdp_rx_ppdu: Rx PPDU indication structure 514 * 515 * Return: none 516 */ 517 void 518 dp_rx_mon_populate_cfr_info(struct dp_pdev *pdev, 519 struct hal_rx_ppdu_info *ppdu_info, 520 struct cdp_rx_indication_ppdu *cdp_rx_ppdu); 521 522 /** 523 * dp_update_cfr_dbg_stats() - Increment RCC debug statistics 524 * @pdev: pdev structure 525 * @ppdu_info: structure for rx ppdu ring 526 * 527 * Return: none 528 */ 529 void 530 dp_update_cfr_dbg_stats(struct dp_pdev *pdev, 531 struct hal_rx_ppdu_info *ppdu_info); 532 533 /* 534 * dp_rx_handle_cfr() - Gather cfr info from hal ppdu info 535 * @soc: core txrx main context 536 * @pdev: pdev ctx 537 * @ppdu_info: ppdu info structure from ppdu ring 538 * 539 * Return: none 540 */ 541 void 542 dp_rx_handle_cfr(struct dp_soc *soc, struct dp_pdev *pdev, 543 struct hal_rx_ppdu_info *ppdu_info); 544 545 /** 546 * dp_rx_populate_cfr_non_assoc_sta() - Populate cfr ppdu info for PPDUs from 547 * non-associated stations 548 * @pdev: pdev ctx 549 * @ppdu_info: ppdu info structure from ppdu ring 550 * @cdp_rx_ppdu: Rx PPDU indication structure 551 * 552 * Return: none 553 */ 554 void 555 dp_rx_populate_cfr_non_assoc_sta(struct dp_pdev *pdev, 556 struct hal_rx_ppdu_info *ppdu_info, 557 struct cdp_rx_indication_ppdu *cdp_rx_ppdu); 558 559 #else 560 static inline void 561 dp_rx_mon_handle_cfr_mu_info(struct dp_pdev *pdev, 562 struct hal_rx_ppdu_info *ppdu_info, 563 struct cdp_rx_indication_ppdu *cdp_rx_ppdu) 564 { 565 } 566 567 static inline void 568 dp_rx_mon_populate_cfr_ppdu_info(struct dp_pdev *pdev, 569 struct hal_rx_ppdu_info *ppdu_info, 570 struct cdp_rx_indication_ppdu *cdp_rx_ppdu) 571 { 572 } 573 574 static inline void 575 dp_rx_mon_populate_cfr_info(struct dp_pdev *pdev, 576 struct hal_rx_ppdu_info *ppdu_info, 577 struct cdp_rx_indication_ppdu *cdp_rx_ppdu) 578 { 579 } 580 581 static inline void 582 dp_rx_handle_cfr(struct dp_soc *soc, struct dp_pdev *pdev, 583 struct hal_rx_ppdu_info *ppdu_info) 584 { 585 } 586 587 static inline void 588 dp_rx_populate_cfr_non_assoc_sta(struct dp_pdev *pdev, 589 struct hal_rx_ppdu_info *ppdu_info, 590 struct cdp_rx_indication_ppdu *cdp_rx_ppdu) 591 { 592 } 593 594 static inline void 595 dp_update_cfr_dbg_stats(struct dp_pdev *pdev, 596 struct hal_rx_ppdu_info *ppdu_info) 597 { 598 } 599 600 static inline bool 601 dp_cfr_rcc_mode_status(struct dp_pdev *pdev) 602 { 603 return false; 604 } 605 #endif /* WLAN_CFR_ENABLE && WLAN_ENH_CFR_ENABLE */ 606 607 /* 608 * dp_rx_mon_deliver(): function to deliver packets to stack 609 * @soc: DP soc 610 * @mac_id: MAC ID 611 * @head_msdu: head of msdu list 612 * @tail_msdu: tail of msdu list 613 * 614 * Return: status: 0 - Success, non-zero: Failure 615 */ 616 QDF_STATUS dp_rx_mon_deliver(struct dp_soc *soc, 617 uint32_t mac_id, 618 qdf_nbuf_t head_msdu, 619 qdf_nbuf_t tail_msdu); 620 621 /** 622 * dp_rx_mon_deliver_non_std() 623 * @soc: core txrx main contex 624 * @mac_id: MAC ID 625 * 626 * This function delivers the radio tap and dummy MSDU 627 * into user layer application for preamble only PPDU. 628 * 629 * Return: QDF_STATUS 630 */ 631 QDF_STATUS dp_rx_mon_deliver_non_std(struct dp_soc *soc, 632 uint32_t mac_id); 633 634 #ifdef DP_RX_MON_MEM_FRAG 635 #if defined(WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG) ||\ 636 defined(WLAN_SUPPORT_RX_FLOW_TAG) 637 void dp_rx_mon_update_pf_tag_to_buf_headroom(struct dp_soc *soc, 638 qdf_nbuf_t nbuf); 639 #else 640 static inline 641 void dp_rx_mon_update_pf_tag_to_buf_headroom(struct dp_soc *soc, 642 qdf_nbuf_t nbuf) 643 { 644 } 645 #endif 646 #else 647 static inline 648 void dp_rx_mon_update_pf_tag_to_buf_headroom(struct dp_soc *soc, 649 qdf_nbuf_t nbuf) 650 { 651 } 652 #endif 653 654 qdf_nbuf_t dp_rx_mon_restitch_mpdu(struct dp_soc *soc, uint32_t mac_id, 655 qdf_nbuf_t head_msdu, qdf_nbuf_t tail_msdu, 656 struct cdp_mon_status *rs); 657 658 #ifdef DP_RX_MON_MEM_FRAG 659 /** 660 * dp_rx_mon_get_nbuf_80211_hdr() - Get 80211 hdr from nbuf 661 * @nbuf: qdf_nbuf_t 662 * 663 * This function must be called after moving radiotap header. 664 * 665 * Return: Ptr pointing to 80211 header or NULL. 666 */ 667 static inline 668 qdf_frag_t dp_rx_mon_get_nbuf_80211_hdr(qdf_nbuf_t nbuf) 669 { 670 /* Return NULL if nr_frag is Zero */ 671 if (!qdf_nbuf_get_nr_frags(nbuf)) 672 return NULL; 673 674 return qdf_nbuf_get_frag_addr(nbuf, 0); 675 } 676 #else 677 static inline 678 qdf_frag_t dp_rx_mon_get_nbuf_80211_hdr(qdf_nbuf_t nbuf) 679 { 680 return qdf_nbuf_data(nbuf); 681 } 682 #endif 683 684 /* 685 * dp_rx_mon_process_dest_pktlog(): function to log packet contents to 686 * pktlog buffer and send to pktlog module 687 * @soc: DP soc 688 * @mac_id: MAC ID 689 * @mpdu: MPDU buf 690 * Return: status: 0 - Success, non-zero: Failure 691 */ 692 QDF_STATUS dp_rx_mon_process_dest_pktlog(struct dp_soc *soc, 693 uint32_t mac_id, 694 qdf_nbuf_t mpdu); 695 696 #ifdef WLAN_TX_PKT_CAPTURE_ENH 697 void 698 dp_handle_tx_capture(struct dp_soc *soc, struct dp_pdev *pdev, 699 qdf_nbuf_t mon_mpdu); 700 #else 701 static inline void 702 dp_handle_tx_capture(struct dp_soc *soc, struct dp_pdev *pdev, 703 qdf_nbuf_t mon_mpdu) 704 { 705 } 706 #endif 707 708 /** 709 * dp_rx_get_mon_desc_pool() - Return monitor descriptor pool 710 * based on target 711 * @soc: soc handle 712 * @mac_id: mac id number 713 * @pdev_id: pdev id number 714 * 715 * Return: descriptor pool address 716 */ 717 static inline 718 struct rx_desc_pool *dp_rx_get_mon_desc_pool(struct dp_soc *soc, 719 uint8_t mac_id, 720 uint8_t pdev_id) 721 { 722 if (soc->wlan_cfg_ctx->rxdma1_enable) 723 return &soc->rx_desc_mon[mac_id]; 724 725 return &soc->rx_desc_buf[pdev_id]; 726 } 727 728 /** 729 * dp_rx_process_peer_based_pktlog() - Process Rx pktlog if peer based 730 * filtering enabled 731 * @soc: core txrx main context 732 * @ppdu_info: Structure for rx ppdu info 733 * @status_nbuf: Qdf nbuf abstraction for linux skb 734 * @pdev_id: mac_id/pdev_id correspondinggly for MCL and WIN 735 * 736 * Return: none 737 */ 738 void 739 dp_rx_process_peer_based_pktlog(struct dp_soc *soc, 740 struct hal_rx_ppdu_info *ppdu_info, 741 qdf_nbuf_t status_nbuf, uint32_t pdev_id); 742 #endif /* _DP_RX_MON_H_ */ 743