From 18f8997caa3c5522feee004bbabec331c693ac59 Mon Sep 17 00:00:00 2001 From: Asutosh Mohapatra Date: Wed, 5 Apr 2023 11:29:19 -0700 Subject: [PATCH] qcacld-3.0: Update link peer mac id per ml vdev Currently host driver doesn't fill peer mac address per ml vdev for station stats request as part of peer stats request hence incorrect stats sent to userspace. To address this issue, save peer mac per ml vdev in request info structure. Change-Id: Iebb1b810e112743602607e31d779be2ba1d48f90 CRs-Fixed: 3450665 --- .../dispatcher/src/wlan_cp_stats_mc_tgt_api.c | 2 +- .../cp_stats/src/wlan_cfg80211_mc_cp_stats.c | 48 ++++++++++++++++++- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/components/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c b/components/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c index 2986d665a9..06146548b9 100644 --- a/components/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c +++ b/components/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c @@ -1226,7 +1226,7 @@ tgt_mc_cp_stats_prepare_n_send_raw_station_stats(struct wlan_objmgr_psoc *psoc, qdf_mem_copy(last_req->peer_mac_addr, &(last_req->ml_peer_mac_addr[i][0]), QDF_MAC_ADDR_SIZE); - cp_stats_nofl_debug("Invoking get_station_cb for vdev_id[%d]", + cp_stats_nofl_debug("Invoking get_station_cb for ml vdev_id[%d]", last_req->vdev_id); tgt_mc_cp_stats_send_raw_station_stats(psoc, last_req); } diff --git a/os_if/cp_stats/src/wlan_cfg80211_mc_cp_stats.c b/os_if/cp_stats/src/wlan_cfg80211_mc_cp_stats.c index 9724b8c2fa..3f849092e3 100644 --- a/os_if/cp_stats/src/wlan_cfg80211_mc_cp_stats.c +++ b/os_if/cp_stats/src/wlan_cfg80211_mc_cp_stats.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1491,6 +1491,49 @@ station_adv_stats_cb_fail: } #ifdef WLAN_FEATURE_11BE_MLO +/** + * wlan_cfg80211_get_mlstats_vdev_peer - get peer per ml vdev + * @psoc: pointer to psoc struct + * @req_info: pointer to request info struct + * + * Return: QDF_STATUS_SUCCESS on success + */ +static QDF_STATUS +wlan_cfg80211_get_mlstats_vdev_peer(struct wlan_objmgr_psoc *psoc, + struct request_info *req_info) +{ + struct wlan_objmgr_vdev *vdev; + struct wlan_objmgr_peer *peer; + struct mlo_stats_vdev_params *info = &req_info->ml_vdev_info; + int i; + + for (i = 0; i < info->ml_vdev_count; i++) { + vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, + info->ml_vdev_id[i], + WLAN_OSIF_STATS_ID); + if (!vdev) { + hdd_err("vdev object is NULL for vdev %d", + info->ml_vdev_id[i]); + return QDF_STATUS_E_INVAL; + } + + peer = wlan_objmgr_vdev_try_get_bsspeer(vdev, + WLAN_OSIF_STATS_ID); + if (!peer) { + hdd_err("peer is null"); + wlan_objmgr_vdev_release_ref(vdev, WLAN_OSIF_STATS_ID); + return QDF_STATUS_E_INVAL; + } + + qdf_mem_copy(&req_info->ml_peer_mac_addr[i][0], peer->macaddr, + QDF_MAC_ADDR_SIZE); + + wlan_objmgr_peer_release_ref(peer, WLAN_OSIF_STATS_ID); + wlan_objmgr_vdev_release_ref(vdev, WLAN_OSIF_STATS_ID); + } + return QDF_STATUS_SUCCESS; +} + static QDF_STATUS wlan_cfg80211_get_mlstats_vdev_params(struct wlan_objmgr_vdev *vdev, struct request_info *info) @@ -1513,7 +1556,8 @@ wlan_cfg80211_get_mlstats_vdev_params(struct wlan_objmgr_vdev *vdev, } } - return QDF_STATUS_SUCCESS; + status = wlan_cfg80211_get_mlstats_vdev_peer(psoc, info); + return status; } #else static QDF_STATUS