From 0391a23ca338b6f30256bda51eef952d76b57285 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Fri, 2 Aug 2019 11:59:05 -0700 Subject: [PATCH] qcacmn: Add pdev_id for stats request command Currently CP stats component does not fill the proper pdev_id in the command for the stats request. This causes the value sent to firmware to be 0 bydeafult. As per the logic in firmware, if the value is zero then the stats for all the pdevs are sent. To get only stats for a single pdev, send the pdev_id along with the vdev_id in the stats request command. Change-Id: Ic4ecad132c8764196b9f5ed6af76fe4f2778d8d1 CRs-Fixed: 2502459 --- .../cp_stats/src/target_if_mc_cp_stats.c | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/target_if/cp_stats/src/target_if_mc_cp_stats.c b/target_if/cp_stats/src/target_if_mc_cp_stats.c index 0b1fb62c94c6..fa6bf1b36140 100644 --- a/target_if/cp_stats/src/target_if_mc_cp_stats.c +++ b/target_if/cp_stats/src/target_if_mc_cp_stats.c @@ -34,6 +34,9 @@ #include #include #include "../../../umac/cmn_services/utils/inc/wlan_utility.h" +#ifdef WLAN_POLICY_MGR_ENABLE +#include +#endif static void target_if_cp_stats_free_stats_event(struct stats_event *ev) { @@ -595,6 +598,30 @@ static uint32_t get_stats_id(enum stats_req_type type) return 0; } +#ifdef WLAN_POLICY_MGR_ENABLE +static void +target_if_cp_stats_update_pdev_id(struct stats_request_params *param, + struct wlan_objmgr_psoc *psoc, + uint32_t vdev_id) +{ + uint8_t pdev_id; + QDF_STATUS status; + + status = policy_mgr_get_mac_id_by_session_id(psoc, vdev_id, &pdev_id); + if (!QDF_IS_STATUS_ERROR(status)) + param->pdev_id = pdev_id + 1; + + cp_stats_debug("pdev id is %d", param->pdev_id); +} +#else +static void +target_if_cp_stats_update_pdev_id(struct stats_request_params *data, + struct wlan_objmgr_psoc *psoc, + uint32_t vdev_id) +{ +} +#endif + /** * target_if_cp_stats_send_stats_req() - API to send stats request to wmi * @psoc: pointer to psoc object @@ -620,6 +647,7 @@ static QDF_STATUS target_if_cp_stats_send_stats_req( param.stats_id = get_stats_id(type); param.vdev_id = req->vdev_id; param.pdev_id = req->pdev_id; + target_if_cp_stats_update_pdev_id(¶m, psoc, req->vdev_id); return wmi_unified_stats_request_send(wmi_handle, req->peer_mac_addr, ¶m);