Sfoglia il codice sorgente

qcacmn: Move peer_extd_stats to peer_mc_cp_stats structure

Currently peer_extd_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_extd_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: I18c30db36d34dd3fb3e4f8ad2d3c553c4648548b
CRs-fixed: 2427126
Ashish Kumar Dhanotiya 6 anni fa
parent
commit
788ab15578

+ 0 - 2
umac/cp_stats/core/src/wlan_cp_stats_defs.h

@@ -88,7 +88,6 @@ struct vdev_cp_stats {
  * @peer_obj: pointer to peer
  * @peer_stats: pointer to ic/mc specific stats
  * @peer_adv_stats: pointer to peer adv stats
- * @peer_extd_stats: Pointer to peer extended stats
  * @peer_comp_priv_obj[]: component's private object pointers
  * @peer_cp_stats_lock:	lock to protect object
  */
@@ -96,7 +95,6 @@ struct peer_cp_stats {
 	struct wlan_objmgr_peer  *peer_obj;
 	void                     *peer_stats;
 	void                     *peer_adv_stats;
-	void                     *peer_extd_stats;
 	void *peer_comp_priv_obj[WLAN_CP_STATS_MAX_COMPONENTS];
 	qdf_spinlock_t peer_cp_stats_lock;
 };

+ 2 - 0
umac/cp_stats/dispatcher/inc/wlan_cp_stats_mc_defs.h

@@ -267,12 +267,14 @@ struct peer_extd_stats {
  * @rx_rate: rx rate
  * @peer_rssi: rssi
  * @peer_macaddr: mac address
+ * @peer_extd_stats: Pointer to peer extended stats
  */
 struct peer_mc_cp_stats {
 	uint32_t tx_rate;
 	uint32_t rx_rate;
 	int8_t peer_rssi;
 	uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
+	struct peer_extd_stats *extd_stats;
 };
 
 /**

+ 9 - 4
umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c

@@ -135,7 +135,7 @@ static void peer_rssi_iterator(struct wlan_objmgr_pdev *pdev,
 	ev->peer_stats[ev->num_peer_stats] = *peer_mc_stats;
 	ev->num_peer_stats++;
 
-	peer_extd_mc_stats = peer_cp_stats_priv->peer_extd_stats;
+	peer_extd_mc_stats = peer_mc_stats->extd_stats;
 	ev->peer_extended_stats[ev->num_peer_extd_stats] = *peer_extd_mc_stats;
 	ev->num_peer_extd_stats++;
 	wlan_cp_stats_peer_obj_unlock(peer_cp_stats_priv);
@@ -218,7 +218,7 @@ tgt_mc_cp_stats_prepare_raw_peer_rssi(struct wlan_objmgr_psoc *psoc,
 		peer_mc_stats = peer_cp_stats_priv->peer_stats;
 		*ev.peer_stats = *peer_mc_stats;
 
-		peer_mc_extd_stats = peer_cp_stats_priv->peer_extd_stats;
+		peer_mc_extd_stats = peer_mc_stats->extd_stats;
 		*ev.peer_extended_stats = *peer_mc_extd_stats;
 		wlan_cp_stats_peer_obj_unlock(peer_cp_stats_priv);
 	}
@@ -341,6 +341,7 @@ tgt_mc_cp_stats_update_peer_extd_stats(
 {
 	uint8_t *peer_mac_addr;
 	struct wlan_objmgr_peer *peer;
+	struct peer_mc_cp_stats *peer_mc_stats;
 	struct peer_extd_stats *peer_extd_mc_stats;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	struct peer_cp_stats *peer_cp_stats_priv;
@@ -364,7 +365,8 @@ tgt_mc_cp_stats_update_peer_extd_stats(
 	}
 
 	wlan_cp_stats_peer_obj_lock(peer_cp_stats_priv);
-	peer_extd_mc_stats = peer_cp_stats_priv->peer_extd_stats;
+	peer_mc_stats = peer_cp_stats_priv->peer_stats;
+	peer_extd_mc_stats = peer_mc_stats->extd_stats;
 	if (!peer_extd_mc_stats) {
 		wlan_cp_stats_peer_obj_unlock(peer_cp_stats_priv);
 		cp_stats_err("No peer_extd_mc_stats");
@@ -411,8 +413,9 @@ static void tgt_mc_cp_stats_extract_peer_extd_stats(
 		status = tgt_mc_cp_stats_update_peer_extd_stats(
 						psoc,
 						&ev->peer_extended_stats[i]);
+
 		if (!QDF_IS_ADDR_BROADCAST(last_req.peer_mac_addr) &&
-		    !qdf_mem_cmp(ev->peer_stats[i].peer_macaddr,
+		    !qdf_mem_cmp(ev->peer_extended_stats[i].peer_macaddr,
 				 last_req.peer_mac_addr,
 				 QDF_MAC_ADDR_SIZE)) {
 			/* mac is specified, but failed to update the peer */
@@ -845,6 +848,8 @@ QDF_STATUS tgt_mc_cp_stats_process_stats_event(struct wlan_objmgr_psoc *psoc,
 	if (ucfg_mc_cp_stats_is_req_pending(psoc, TYPE_STATION_STATS))
 		tgt_mc_cp_stats_extract_station_stats(psoc, ev);
 
+	else
+		cp_stats_err("No pending request");
 	tgt_mc_cp_stats_extract_cca_stats(psoc, ev);
 
 	return QDF_STATUS_SUCCESS;

+ 15 - 9
umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_ucfg_api.c

@@ -84,35 +84,41 @@ QDF_STATUS wlan_cp_stats_pdev_cs_deinit(struct pdev_cp_stats *pdev_cs)
 
 QDF_STATUS wlan_cp_stats_peer_cs_init(struct peer_cp_stats *peer_cs)
 {
-	peer_cs->peer_stats = qdf_mem_malloc(sizeof(struct peer_mc_cp_stats));
-	if (!peer_cs->peer_stats)
+	struct peer_mc_cp_stats *peer_mc_stats;
+
+	peer_mc_stats = qdf_mem_malloc(sizeof(struct peer_mc_cp_stats));
+	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) {
-		qdf_mem_free(peer_cs->peer_stats);
+		qdf_mem_free(peer_mc_stats);
 		return QDF_STATUS_E_NOMEM;
 	}
 
-	peer_cs->peer_extd_stats =
+	peer_mc_stats->extd_stats =
 			qdf_mem_malloc(sizeof(struct peer_extd_stats));
-	if (!peer_cs->peer_extd_stats) {
-		qdf_mem_free(peer_cs->peer_stats);
-		peer_cs->peer_stats = NULL;
+	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);
+		peer_mc_stats = NULL;
 		return QDF_STATUS_E_NOMEM;
 	}
+	peer_cs->peer_stats = peer_mc_stats;
+
 	return QDF_STATUS_SUCCESS;
 }
 
 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_cs->peer_extd_stats);
-	peer_cs->peer_extd_stats = NULL;
+	qdf_mem_free(peer_mc_stats->extd_stats);
+	peer_mc_stats->extd_stats = NULL;
 	qdf_mem_free(peer_cs->peer_stats);
 	peer_cs->peer_stats = NULL;