From 0bfa34876fe86af9b853336c57081a8cfd44761c Mon Sep 17 00:00:00 2001 From: Yeshwanth Sriram Guntuka Date: Mon, 15 Jun 2020 11:20:14 +0530 Subject: [PATCH] qcacld-3.0: Update mc_bc rx pkt count in peer stats Update multicast and broadcast rx packet count on receiving wmi update stats event from firmware by fetching the peer stats from DP layer. Change-Id: I0befdbe952aa4e773bbe072affaf698819b3a80f CRs-Fixed: 2709871 --- .../dispatcher/inc/wlan_cp_stats_mc_defs.h | 2 ++ .../cp_stats/src/target_if_mc_cp_stats.c | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/components/cp_stats/dispatcher/inc/wlan_cp_stats_mc_defs.h b/components/cp_stats/dispatcher/inc/wlan_cp_stats_mc_defs.h index 1279ca895ec8..b0fd778a93e1 100644 --- a/components/cp_stats/dispatcher/inc/wlan_cp_stats_mc_defs.h +++ b/components/cp_stats/dispatcher/inc/wlan_cp_stats_mc_defs.h @@ -36,6 +36,8 @@ #define IS_MSB_SET(__num) ((__num) & BIT(31)) #define IS_LSB_SET(__num) ((__num) & BIT(0)) +#define VDEV_ALL 0xFF + /** * enum stats_req_type - enum indicating bit position of various stats type in * request map diff --git a/components/target_if/cp_stats/src/target_if_mc_cp_stats.c b/components/target_if/cp_stats/src/target_if_mc_cp_stats.c index 39b8390852a8..df7787513308 100644 --- a/components/target_if/cp_stats/src/target_if_mc_cp_stats.c +++ b/components/target_if/cp_stats/src/target_if_mc_cp_stats.c @@ -34,6 +34,11 @@ #include #include #include "../../../umac/cmn_services/utils/inc/wlan_utility.h" +#include +#include +#include +#include +#include #ifdef WLAN_FEATURE_MIB_STATS static void target_if_cp_stats_free_mib_stats(struct stats_event *ev) @@ -110,6 +115,8 @@ static void target_if_cp_stats_extract_peer_extd_stats( QDF_STATUS status; uint32_t i; wmi_host_peer_extd_stats peer_extd_stats; + void *soc = cds_get_context(QDF_MODULE_ID_SOC); + struct cdp_peer_stats *peer_stats; if (!stats_param->num_peer_extd_stats) return; @@ -134,6 +141,20 @@ static void target_if_cp_stats_extract_peer_extd_stats( ev->peer_extended_stats[i].peer_macaddr); ev->peer_extended_stats[i].rx_mc_bc_cnt = peer_extd_stats.rx_mc_bc_cnt; + + peer_stats = qdf_mem_malloc(sizeof(*peer_stats)); + if (!peer_stats) + continue; + + status = cdp_host_get_peer_stats(soc, VDEV_ALL, + ev->peer_extended_stats[i].peer_macaddr, + peer_stats); + if (status == QDF_STATUS_SUCCESS) + ev->peer_extended_stats[i].rx_mc_bc_cnt = + peer_stats->rx.multicast.num + + peer_stats->rx.bcast.num; + + qdf_mem_free(peer_stats); } }