From f31c071fd5c3369edb2bec93b98b22643b28e8f7 Mon Sep 17 00:00:00 2001 From: Sourav Mohapatra Date: Tue, 25 Jun 2019 09:40:24 +0530 Subject: [PATCH] qcacmn: Move peer_adv_stats to MC specific peer_mc_cp_stats struct Currently peer_adv_stats is present in peer_cp_stats structure which is shared between WIN and MCL and only common features should be part of this structure as peer_cp_stats is an abstraction structure for WIN and MCL for cp stats component. Since peer_adv_stats is MCL specific structure, this should be moved to peer_mc_cp_stats which is MCL specific feature for cp stats component. Change-Id: Id46cdd153aa6b8137c24fdca30365221d2646d3f CRs-Fixed: 2480147 --- umac/cp_stats/core/src/wlan_cp_stats_defs.h | 2 -- .../dispatcher/inc/wlan_cp_stats_mc_defs.h | 4 +++- .../dispatcher/src/wlan_cp_stats_mc_tgt_api.c | 10 ++++++---- .../dispatcher/src/wlan_cp_stats_mc_ucfg_api.c | 17 ++++++++++------- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/umac/cp_stats/core/src/wlan_cp_stats_defs.h b/umac/cp_stats/core/src/wlan_cp_stats_defs.h index dcad1b24f1ad..621c36b11096 100644 --- a/umac/cp_stats/core/src/wlan_cp_stats_defs.h +++ b/umac/cp_stats/core/src/wlan_cp_stats_defs.h @@ -87,14 +87,12 @@ struct vdev_cp_stats { * struct peer_cp_stats - defines cp stats at peer object * @peer_obj: pointer to peer * @peer_stats: pointer to ic/mc specific stats - * @peer_adv_stats: pointer to peer adv stats * @peer_comp_priv_obj[]: component's private object pointers * @peer_cp_stats_lock: lock to protect object */ struct peer_cp_stats { struct wlan_objmgr_peer *peer_obj; void *peer_stats; - void *peer_adv_stats; void *peer_comp_priv_obj[WLAN_CP_STATS_MAX_COMPONENTS]; qdf_spinlock_t peer_cp_stats_lock; }; diff --git a/umac/cp_stats/dispatcher/inc/wlan_cp_stats_mc_defs.h b/umac/cp_stats/dispatcher/inc/wlan_cp_stats_mc_defs.h index f5843098ea6e..770e0b1b5965 100644 --- a/umac/cp_stats/dispatcher/inc/wlan_cp_stats_mc_defs.h +++ b/umac/cp_stats/dispatcher/inc/wlan_cp_stats_mc_defs.h @@ -267,7 +267,8 @@ struct peer_extd_stats { * @rx_rate: rx rate * @peer_rssi: rssi * @peer_macaddr: mac address - * @peer_extd_stats: Pointer to peer extended stats + * @extd_stats: Pointer to peer extended stats + * @adv_stats: Pointer to peer adv (extd2) stats */ struct peer_mc_cp_stats { uint32_t tx_rate; @@ -275,6 +276,7 @@ struct peer_mc_cp_stats { int8_t peer_rssi; uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE]; struct peer_extd_stats *extd_stats; + struct peer_adv_mc_cp_stats *adv_stats; }; /** diff --git a/umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c b/umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c index 848419ef8329..a77494ccf97c 100644 --- a/umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c +++ b/umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c @@ -256,6 +256,7 @@ tgt_mc_cp_stats_update_peer_adv_stats(struct wlan_objmgr_psoc *psoc, { uint8_t *peer_mac_addr; struct wlan_objmgr_peer *peer; + struct peer_mc_cp_stats *peer_mc_stats; struct peer_adv_mc_cp_stats *peer_adv_mc_stats; QDF_STATUS status = QDF_STATUS_SUCCESS; struct peer_cp_stats *peer_cp_stats_priv; @@ -277,7 +278,8 @@ tgt_mc_cp_stats_update_peer_adv_stats(struct wlan_objmgr_psoc *psoc, goto end; } wlan_cp_stats_peer_obj_lock(peer_cp_stats_priv); - peer_adv_mc_stats = peer_cp_stats_priv->peer_adv_stats; + peer_mc_stats = peer_cp_stats_priv->peer_stats; + peer_adv_mc_stats = peer_mc_stats->adv_stats; qdf_mem_copy(peer_adv_mc_stats->peer_macaddr, peer_adv_stats->peer_macaddr, @@ -794,11 +796,11 @@ tgt_mc_cp_stats_prepare_n_send_raw_station_stats(struct wlan_objmgr_psoc *psoc, info.tx_rate = peer_mc_stats->tx_rate / 100; info.rx_rate = peer_mc_stats->rx_rate / 100; - if (peer_cp_stats_priv->peer_adv_stats) { + if (peer_mc_stats->adv_stats) { info.num_peer_adv_stats = 1; qdf_mem_copy(info.peer_adv_stats, - peer_cp_stats_priv->peer_adv_stats, - sizeof(peer_cp_stats_priv->peer_adv_stats)); + peer_mc_stats->adv_stats, + sizeof(peer_mc_stats->adv_stats)); } wlan_cp_stats_peer_obj_unlock(peer_cp_stats_priv); diff --git a/umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_ucfg_api.c b/umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_ucfg_api.c index 30bdbdcae297..97779efc20f1 100644 --- a/umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_ucfg_api.c +++ b/umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_ucfg_api.c @@ -90,18 +90,21 @@ QDF_STATUS wlan_cp_stats_peer_cs_init(struct peer_cp_stats *peer_cs) if (!peer_mc_stats) return QDF_STATUS_E_NOMEM; - peer_cs->peer_adv_stats = qdf_mem_malloc(sizeof - (struct peer_adv_mc_cp_stats)); - if (!peer_cs->peer_adv_stats) { + peer_mc_stats->adv_stats = + qdf_mem_malloc(sizeof(struct peer_adv_mc_cp_stats)); + + if (!peer_mc_stats->adv_stats) { qdf_mem_free(peer_mc_stats); + peer_mc_stats = NULL; return QDF_STATUS_E_NOMEM; } peer_mc_stats->extd_stats = qdf_mem_malloc(sizeof(struct peer_extd_stats)); + if (!peer_mc_stats->extd_stats) { - qdf_mem_free(peer_cs->peer_adv_stats); - peer_cs->peer_adv_stats = NULL; + qdf_mem_free(peer_mc_stats->adv_stats); + peer_mc_stats->adv_stats = NULL; qdf_mem_free(peer_mc_stats); peer_mc_stats = NULL; return QDF_STATUS_E_NOMEM; @@ -115,8 +118,8 @@ QDF_STATUS wlan_cp_stats_peer_cs_deinit(struct peer_cp_stats *peer_cs) { struct peer_mc_cp_stats *peer_mc_stats = peer_cs->peer_stats; - qdf_mem_free(peer_cs->peer_adv_stats); - peer_cs->peer_adv_stats = NULL; + qdf_mem_free(peer_mc_stats->adv_stats); + peer_mc_stats->adv_stats = NULL; qdf_mem_free(peer_mc_stats->extd_stats); peer_mc_stats->extd_stats = NULL; qdf_mem_free(peer_cs->peer_stats);