From 676eb33de0fcae703fdd0c84cfe5641f094c398a Mon Sep 17 00:00:00 2001 From: Vulupala Shashank Reddy Date: Wed, 18 Nov 2020 19:51:26 +0530 Subject: [PATCH] qcacmn: Add WDI event for rx packet to packet capture mode Add WDI event and call wdi event handler for to deliver rx packet to packet capture mode. Change-Id: I856ac07f292047136431f67bb2654c855767e5e8 CRs-Fixed: 2844728 --- dp/inc/cdp_txrx_stats_struct.h | 1 + dp/wifi3.0/dp_rx.c | 26 +++++++++++++++++++++++++- dp/wifi3.0/dp_rx.h | 23 +++++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/dp/inc/cdp_txrx_stats_struct.h b/dp/inc/cdp_txrx_stats_struct.h index 90e25ac28b1e..dde3bea612e4 100644 --- a/dp/inc/cdp_txrx_stats_struct.h +++ b/dp/inc/cdp_txrx_stats_struct.h @@ -364,6 +364,7 @@ enum WDI_EVENT { WDI_EVENT_HMWDS_AST_ADD_STATUS, WDI_EVENT_PEER_QOS_STATS, WDI_EVENT_PKT_CAPTURE_TX_DATA, + WDI_EVENT_PKT_CAPTURE_RX_DATA, /* End of new event items */ WDI_EVENT_LAST }; diff --git a/dp/wifi3.0/dp_rx.c b/dp/wifi3.0/dp_rx.c index 0271029be570..166a0de29db2 100644 --- a/dp/wifi3.0/dp_rx.c +++ b/dp/wifi3.0/dp_rx.c @@ -2167,6 +2167,27 @@ static inline void dp_rx_update_stats(struct dp_soc *soc, { } #endif + +#ifdef WLAN_FEATURE_PKT_CAPTURE_LITHIUM +/** + * dp_rx_deliver_to_pkt_capture() - deliver rx packet to packet capture + * @soc : dp_soc handle + * @pdev: dp_pdev handle + * @peer_id: peer_id of the peer for which completion came + * @ppdu_id: ppdu_id + * @netbuf: Buffer pointer + * + * This function is used to deliver rx packet to packet capture + */ +void dp_rx_deliver_to_pkt_capture(struct dp_soc *soc, struct dp_pdev *pdev, + uint16_t peer_id, uint32_t ppdu_id, + qdf_nbuf_t netbuf) +{ + dp_wdi_event_handler(WDI_EVENT_PKT_CAPTURE_RX_DATA, soc, netbuf, + peer_id, WDI_NO_VAL, pdev->pdev_id); +} +#endif + /** * dp_rx_process() - Brain of the Rx processing functionality * Called from the bottom half (tasklet/NET_RX_SOFTIRQ) @@ -2820,10 +2841,13 @@ done: } if (qdf_likely(deliver_list_head)) { - if (qdf_likely(peer)) + if (qdf_likely(peer)) { + dp_rx_deliver_to_pkt_capture(soc, vdev->pdev, peer_id, + 0, deliver_list_head); dp_rx_deliver_to_stack(soc, vdev, peer, deliver_list_head, deliver_list_tail); + } else { nbuf = deliver_list_head; while (nbuf) { diff --git a/dp/wifi3.0/dp_rx.h b/dp/wifi3.0/dp_rx.h index 435d6c548be2..0058bca0d418 100644 --- a/dp/wifi3.0/dp_rx.h +++ b/dp/wifi3.0/dp_rx.h @@ -1554,4 +1554,27 @@ void dp_rx_link_desc_refill_duplicate_check( struct dp_soc *soc, struct hal_buf_info *buf_info, hal_buff_addrinfo_t ring_buf_info); + +#ifdef WLAN_FEATURE_PKT_CAPTURE_LITHIUM +/** + * dp_rx_deliver_to_pkt_capture() - deliver rx packet to packet capture + * @soc : dp_soc handle + * @pdev: dp_pdev handle + * @peer_id: peer_id of the peer for which completion came + * @ppdu_id: ppdu_id + * @netbuf: Buffer pointer + * + * This function is used to deliver rx packet to packet capture + */ +void dp_rx_deliver_to_pkt_capture(struct dp_soc *soc, struct dp_pdev *pdev, + uint16_t peer_id, uint32_t ppdu_id, + qdf_nbuf_t netbuf); +#else +static inline void +dp_rx_deliver_to_pkt_capture(struct dp_soc *soc, struct dp_pdev *pdev, + uint16_t peer_id, uint32_t ppdu_id, + qdf_nbuf_t netbuf) +{ +} +#endif #endif /* _DP_RX_H */