diff --git a/dp/inc/cdp_txrx_stats_struct.h b/dp/inc/cdp_txrx_stats_struct.h index 070e3e9e6d..1350d3cfe9 100644 --- a/dp/inc/cdp_txrx_stats_struct.h +++ b/dp/inc/cdp_txrx_stats_struct.h @@ -374,6 +374,7 @@ enum WDI_EVENT { WDI_EVENT_PKT_CAPTURE_RX_DATA_NO_PEER, WDI_EVENT_PKT_CAPTURE_OFFLOAD_TX_DATA, WDI_EVENT_RX_CBF, + WDI_EVENT_PKT_CAPTURE_PPDU_STATS, /* End of new event items */ WDI_EVENT_LAST }; diff --git a/dp/wifi3.0/monitor/dp_mon.c b/dp/wifi3.0/monitor/dp_mon.c index 9585bb3c80..4adacae249 100644 --- a/dp/wifi3.0/monitor/dp_mon.c +++ b/dp/wifi3.0/monitor/dp_mon.c @@ -3530,6 +3530,46 @@ dp_ppdu_desc_user_stats_update(struct dp_pdev *pdev, } #endif /* QCA_ENHANCED_STATS_SUPPORT */ +#ifdef WLAN_FEATURE_PKT_CAPTURE_V2 +static void dp_htt_process_smu_ppdu_stats_tlv(struct dp_soc *soc, + qdf_nbuf_t htt_t2h_msg) +{ + uint32_t length; + uint8_t tlv_type; + uint32_t tlv_length, tlv_expected_size; + uint8_t *tlv_buf; + + uint32_t *msg_word = (uint32_t *)qdf_nbuf_data(htt_t2h_msg); + + length = HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(*msg_word); + + msg_word = msg_word + 4; + + while (length > 0) { + tlv_buf = (uint8_t *)msg_word; + tlv_type = HTT_STATS_TLV_TAG_GET(*msg_word); + tlv_length = HTT_STATS_TLV_LENGTH_GET(*msg_word); + + if (tlv_length == 0) + break; + + tlv_length += HTT_TLV_HDR_LEN; + + if (tlv_type == HTT_PPDU_STATS_FOR_SMU_TLV) { + tlv_expected_size = sizeof(htt_ppdu_stats_for_smu_tlv); + + if (tlv_length >= tlv_expected_size) + dp_wdi_event_handler( + WDI_EVENT_PKT_CAPTURE_PPDU_STATS, + soc, msg_word, HTT_INVALID_VDEV, + WDI_NO_VAL, 0); + } + msg_word = (uint32_t *)((uint8_t *)tlv_buf + tlv_length); + length -= (tlv_length); + } +} +#endif + /** * dp_txrx_ppdu_stats_handler() - Function to process HTT PPDU stats from FW * @soc: DP SOC handle @@ -3580,6 +3620,15 @@ static bool dp_txrx_ppdu_stats_handler(struct dp_soc *soc, return free_buf; } +#elif defined(WLAN_FEATURE_PKT_CAPTURE_V2) +static bool dp_txrx_ppdu_stats_handler(struct dp_soc *soc, + uint8_t pdev_id, qdf_nbuf_t htt_t2h_msg) +{ + if (wlan_cfg_get_pkt_capture_mode(soc->wlan_cfg_ctx)) + dp_htt_process_smu_ppdu_stats_tlv(soc, htt_t2h_msg); + + return true; +} #else static bool dp_txrx_ppdu_stats_handler(struct dp_soc *soc, uint8_t pdev_id, qdf_nbuf_t htt_t2h_msg)