From e5430cb03e249aef47f069dd01916fb1af8dbfdb Mon Sep 17 00:00:00 2001 From: Rakesh Pillai Date: Wed, 6 Nov 2019 16:48:53 +0530 Subject: [PATCH] qcacmn: Handle vdev_id as parameter for txrx stats handler The datapath vdev handle is not to be used outside datapath layer. So the cdp api for getting txrx stats will pass vdev_id instead of the vdev handle. Pass vdev id instead of vdev handle for the cdp api used to get txrx stats. Use the vdev_id to retrieve the corresponding vdev handle in the txrx stats handler. CRs-Fixed: 2560364 Change-Id: I57b6c6b232d122583e85929fa972d68bc54e84e0 --- dp/inc/cdp_txrx_cmn.h | 9 +++++---- dp/inc/cdp_txrx_ops.h | 5 +++-- dp/wifi3.0/dp_main.c | 10 ++++++++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/dp/inc/cdp_txrx_cmn.h b/dp/inc/cdp_txrx_cmn.h index 94c43b557bdf..32aa1d6a5e9a 100644 --- a/dp/inc/cdp_txrx_cmn.h +++ b/dp/inc/cdp_txrx_cmn.h @@ -1688,14 +1688,14 @@ static inline void cdp_flush_cache_rx_queue(ol_txrx_soc_handle soc) /** * cdp_txrx_stats_request(): function to map to host and firmware statistics * @soc: soc handle - * @vdev: virtual device + * @vdev_id: virtual device ID * @req: stats request container * * return: status */ static inline -int cdp_txrx_stats_request(ol_txrx_soc_handle soc, struct cdp_vdev *vdev, - struct cdp_txrx_stats_req *req) +int cdp_txrx_stats_request(ol_txrx_soc_handle soc, uint8_t vdev_id, + struct cdp_txrx_stats_req *req) { if (!soc || !soc->ops || !soc->ops->cmn_drv_ops || !req) { QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG, @@ -1705,7 +1705,8 @@ int cdp_txrx_stats_request(ol_txrx_soc_handle soc, struct cdp_vdev *vdev, } if (soc->ops->cmn_drv_ops->txrx_stats_request) - return soc->ops->cmn_drv_ops->txrx_stats_request(vdev, req); + return soc->ops->cmn_drv_ops->txrx_stats_request(soc, vdev_id, + req); return 0; } diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index c6a291aa5b6b..5442676c1b48 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -386,8 +386,9 @@ struct cdp_cmn_ops { void (*hmmc_tid_override_en)(struct cdp_pdev *pdev, bool val); void (*set_hmmc_tid_val)(struct cdp_pdev *pdev, uint8_t tid); - QDF_STATUS (*txrx_stats_request)(struct cdp_vdev *vdev, - struct cdp_txrx_stats_req *req); + QDF_STATUS(*txrx_stats_request)(struct cdp_soc_t *soc_handle, + uint8_t vdev_id, + struct cdp_txrx_stats_req *req); QDF_STATUS (*display_stats)(void *psoc, uint16_t value, enum qdf_stats_verbosity_level level); diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index e6acbf50b830..0bc1f5b9ca7e 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -8280,20 +8280,26 @@ static int dp_fw_stats_process(struct cdp_vdev *vdev_handle, /** * dp_txrx_stats_request - function to map to firmware and host stats - * @vdev: virtual handle + * @soc: soc handle + * @vdev_id: virtual device ID * @req: stats request * * Return: QDF_STATUS */ static -QDF_STATUS dp_txrx_stats_request(struct cdp_vdev *vdev, +QDF_STATUS dp_txrx_stats_request(struct cdp_soc_t *soc_handle, + uint8_t vdev_id, struct cdp_txrx_stats_req *req) { + struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_handle); + struct cdp_vdev *vdev; int host_stats; int fw_stats; enum cdp_stats stats; int num_stats; + vdev = dp_vdev_to_cdp_vdev(dp_get_vdev_from_soc_vdev_id_wifi3(soc, + vdev_id)); if (!vdev || !req) { QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, "Invalid vdev/req instance");