From e23020bd46d67146b3dcfbc24ff64249d2e03909 Mon Sep 17 00:00:00 2001 From: Surabhi Vishnoi Date: Wed, 29 Sep 2021 18:05:28 +0530 Subject: [PATCH] qcacmn: Add cdp api to update the packet capture mode Add a CDP api to update the packet capture mode in dp_soc when it get updated by user using vendor command. Change-Id: Id0856aeeb5e1a77e1ce6fb23562fdbff4a2fb320 CRs-Fixed: 3048344 --- dp/inc/cdp_txrx_cmn.h | 29 +++++++++++++++++++++++++++++ dp/inc/cdp_txrx_ops.h | 3 +++ dp/wifi3.0/dp_main.c | 13 +++++++++++++ 3 files changed, 45 insertions(+) diff --git a/dp/inc/cdp_txrx_cmn.h b/dp/inc/cdp_txrx_cmn.h index 3fc8d89427dc..620513343129 100644 --- a/dp/inc/cdp_txrx_cmn.h +++ b/dp/inc/cdp_txrx_cmn.h @@ -2730,4 +2730,33 @@ cdp_drain_txrx(ol_txrx_soc_handle soc) return soc->ops->cmn_drv_ops->txrx_drain(soc); } + +#ifdef WLAN_FEATURE_PKT_CAPTURE_V2 +/** + * cdp_set_pkt_capture_mode() - set pkt capture mode in dp ctx + * @soc: opaque soc handle + * @val: value to be set + */ +static inline void +cdp_set_pkt_capture_mode(ol_txrx_soc_handle soc, bool val) +{ + if (!soc || !soc->ops) { + QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, + "%s: Invalid Instance", __func__); + QDF_BUG(0); + return; + } + + if (!soc->ops->cmn_drv_ops || + !soc->ops->cmn_drv_ops->set_pkt_capture_mode) + return; + + soc->ops->cmn_drv_ops->set_pkt_capture_mode(soc, val); +} +#else +static inline void +cdp_set_pkt_capture_mode(ol_txrx_soc_handle soc, bool val) +{ +} +#endif #endif /* _CDP_TXRX_CMN_H_ */ diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index 93789956bb51..921876d0a690 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -578,6 +578,9 @@ struct cdp_cmn_ops { ol_osif_peer_handle osif_peer); #endif /* QCA_SUPPORT_WDS_EXTENDED */ void (*txrx_drain)(ol_txrx_soc_handle soc); +#ifdef WLAN_FEATURE_PKT_CAPTURE_V2 + void (*set_pkt_capture_mode)(struct cdp_soc_t *soc, bool val); +#endif }; struct cdp_ctrl_ops { diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index c1615ed0da86..4c6578961d33 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -11294,6 +11294,16 @@ static void dp_drain_txrx(struct cdp_soc_t *soc_handle) } #endif +#ifdef WLAN_FEATURE_PKT_CAPTURE_V2 +static void +dp_set_pkt_capture_mode(struct cdp_soc_t *soc_handle, bool val) +{ + struct dp_soc *soc = (struct dp_soc *)soc_handle; + + soc->wlan_cfg_ctx->pkt_capture_mode = val; +} +#endif + static struct cdp_cmn_ops dp_ops_cmn = { .txrx_soc_attach_target = dp_soc_attach_target_wifi3, .txrx_vdev_attach = dp_vdev_attach_wifi3, @@ -11396,6 +11406,9 @@ static struct cdp_cmn_ops dp_ops_cmn = { #if defined(FEATURE_RUNTIME_PM) || defined(DP_POWER_SAVE) .txrx_drain = dp_drain_txrx, #endif +#ifdef WLAN_FEATURE_PKT_CAPTURE_V2 + .set_pkt_capture_mode = dp_set_pkt_capture_mode, +#endif }; static struct cdp_ctrl_ops dp_ops_ctrl = {