Forráskód Böngészése

qcacmn: Replace interface of dp stats updation to upper layer

Replace ol_if interface with WDI for dp stats updation to upper layer.
Define a new CDP API to get radiostats.

CRs-Fixed: 2326789
Change-Id: Ieaee2fe18fc9a0ad0e259e36f59529fe9bc4e208
Amir Patel 6 éve
szülő
commit
756d05e9e5

+ 51 - 0
dp/inc/cdp_txrx_host_stats.h

@@ -590,6 +590,57 @@ cdp_get_vdev_extd_stats(ol_txrx_soc_handle soc,
 	return soc->ops->host_stats_ops->txrx_get_vdev_extd_stats(vdev, buf);
 }
 
+/**
+ * @brief Call to get cdp_pdev_stats
+ *
+ * @param pdev - dp pdev object
+ * @return - cdp_pdev_stats
+ */
+static inline struct cdp_pdev_stats*
+cdp_host_get_pdev_stats(ol_txrx_soc_handle soc,
+			struct cdp_pdev *pdev)
+{
+	if (!soc || !soc->ops) {
+		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
+			  "%s: Invalid Instance", __func__);
+		QDF_BUG(0);
+		return 0;
+	}
+
+	if (!soc->ops->host_stats_ops ||
+	    !soc->ops->host_stats_ops->txrx_get_pdev_stats)
+		return 0;
+
+	return soc->ops->host_stats_ops->txrx_get_pdev_stats(pdev);
+}
+
+/**
+ * @brief Call to get radio stats
+ *
+ * @param pdev - dp pdev object
+ * @param scn_stats_user - stats buffer
+ * @return - int
+ */
+static inline int
+cdp_host_get_radio_stats(ol_txrx_soc_handle soc,
+			 struct cdp_pdev *pdev,
+			 void *buf)
+{
+	if (!soc || !soc->ops) {
+		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
+			  "%s: Invalid Instance", __func__);
+		QDF_BUG(0);
+		return 0;
+	}
+
+	if (!soc->ops->host_stats_ops ||
+	    !soc->ops->host_stats_ops->txrx_get_radio_stats)
+		return 0;
+
+	return soc->ops->host_stats_ops->txrx_get_radio_stats(pdev,
+							      buf);
+}
+
 /**
  * @brief Parse the stats header and get the payload from the message.
  *

+ 5 - 0
dp/inc/cdp_txrx_ops.h

@@ -711,6 +711,11 @@ struct cdp_host_stats_ops {
 	void
 		(*txrx_update_vdev_stats)(struct cdp_vdev *vdev, void *buf,
 					  uint16_t stats_id);
+	int
+		(*txrx_get_radio_stats)(struct cdp_pdev *pdev,
+					void *buf);
+	struct cdp_pdev_stats*
+		(*txrx_get_pdev_stats)(struct cdp_pdev *pdev);
 };
 
 struct cdp_wds_ops {

+ 5 - 6
dp/wifi3.0/dp_htt.c

@@ -200,12 +200,11 @@ static void dp_tx_stats_update(struct dp_soc *soc, struct dp_peer *peer,
 					peer->stats.tx.tx_success.num) * 100) /
 					peer->stats.tx.ucast.num;
 
-	if (soc->cdp_soc.ol_ops->update_dp_stats) {
-		soc->cdp_soc.ol_ops->update_dp_stats(pdev->ctrl_pdev,
-				&peer->stats, ppdu->peer_id,
-				UPDATE_PEER_STATS);
-
-	}
+#if defined(FEATURE_PERPKT_INFO) && WDI_EVENT_ENABLE
+	dp_wdi_event_handler(WDI_EVENT_UPDATE_DP_STATS, pdev->soc,
+			     &peer->stats, ppdu->peer_id,
+			     UPDATE_PEER_STATS, pdev->pdev_id);
+#endif
 }
 #endif
 

+ 35 - 22
dp/wifi3.0/dp_main.c

@@ -5470,17 +5470,17 @@ void dp_aggregate_vdev_stats(struct dp_vdev *vdev,
 			     struct cdp_vdev_stats *vdev_stats)
 {
 	struct dp_peer *peer = NULL;
-	struct dp_soc *soc = vdev->pdev->soc;
 
 	qdf_mem_copy(vdev_stats, &vdev->stats, sizeof(vdev->stats));
 
 	TAILQ_FOREACH(peer, &vdev->peer_list, peer_list_elem)
 		dp_update_vdev_stats(vdev_stats, peer);
 
-	if (soc->cdp_soc.ol_ops->update_dp_stats)
-		soc->cdp_soc.ol_ops->update_dp_stats(vdev->pdev->ctrl_pdev,
-			&vdev->stats, (uint16_t) vdev->vdev_id,
-			UPDATE_VDEV_STATS);
+#if defined(FEATURE_PERPKT_INFO) && WDI_EVENT_ENABLE
+	dp_wdi_event_handler(WDI_EVENT_UPDATE_DP_STATS, vdev->pdev->soc,
+			     vdev_stats, vdev->vdev_id,
+			     UPDATE_VDEV_STATS, vdev->pdev->pdev_id);
+#endif
 
 }
 
@@ -5493,7 +5493,6 @@ void dp_aggregate_vdev_stats(struct dp_vdev *vdev,
 static inline void dp_aggregate_pdev_stats(struct dp_pdev *pdev)
 {
 	struct dp_vdev *vdev = NULL;
-	struct dp_soc *soc = pdev->soc;
 	struct cdp_vdev_stats *vdev_stats =
 			qdf_mem_malloc(sizeof(struct cdp_vdev_stats));
 
@@ -5564,9 +5563,10 @@ static inline void dp_aggregate_pdev_stats(struct dp_pdev *pdev)
 	qdf_spin_unlock_bh(&pdev->vdev_list_lock);
 	qdf_mem_free(vdev_stats);
 
-	if (soc->cdp_soc.ol_ops->update_dp_stats)
-		soc->cdp_soc.ol_ops->update_dp_stats(pdev->ctrl_pdev,
-				&pdev->stats, pdev->pdev_id, UPDATE_PDEV_STATS);
+#if defined(FEATURE_PERPKT_INFO) && WDI_EVENT_ENABLE
+	dp_wdi_event_handler(WDI_EVENT_UPDATE_DP_STATS, pdev->soc, &pdev->stats,
+			     pdev->pdev_id, UPDATE_PDEV_STATS, pdev->pdev_id);
+#endif
 
 }
 
@@ -6127,7 +6127,6 @@ static inline void
 dp_txrx_host_stats_clr(struct dp_vdev *vdev)
 {
 	struct dp_peer *peer = NULL;
-	struct dp_soc *soc = (struct dp_soc *)vdev->pdev->soc;
 
 	DP_STATS_CLR(vdev->pdev);
 	DP_STATS_CLR(vdev->pdev->soc);
@@ -6137,20 +6136,18 @@ dp_txrx_host_stats_clr(struct dp_vdev *vdev)
 			return;
 		DP_STATS_CLR(peer);
 
-		if (soc->cdp_soc.ol_ops->update_dp_stats) {
-			soc->cdp_soc.ol_ops->update_dp_stats(
-					vdev->pdev->ctrl_pdev,
-					&peer->stats,
-					peer->peer_ids[0],
-					UPDATE_PEER_STATS);
-		}
-
+#if defined(FEATURE_PERPKT_INFO) && WDI_EVENT_ENABLE
+		dp_wdi_event_handler(WDI_EVENT_UPDATE_DP_STATS, vdev->pdev->soc,
+				     &peer->stats,  peer->peer_ids[0],
+				     UPDATE_PEER_STATS, vdev->pdev->pdev_id);
+#endif
 	}
 
-	if (soc->cdp_soc.ol_ops->update_dp_stats)
-		soc->cdp_soc.ol_ops->update_dp_stats(vdev->pdev->ctrl_pdev,
-				&vdev->stats, (uint16_t)vdev->vdev_id,
-				UPDATE_VDEV_STATS);
+#if defined(FEATURE_PERPKT_INFO) && WDI_EVENT_ENABLE
+	dp_wdi_event_handler(WDI_EVENT_UPDATE_DP_STATS, vdev->pdev->soc,
+			     &vdev->stats,  vdev->vdev_id,
+			     UPDATE_VDEV_STATS, vdev->pdev->pdev_id);
+#endif
 }
 
 /**
@@ -7312,6 +7309,21 @@ static void dp_set_vdev_dscp_tid_map_wifi3(struct cdp_vdev *vdev_handle,
 	return;
 }
 
+/* dp_txrx_get_pdev_stats - Returns cdp_pdev_stats
+ * @peer_handle: DP pdev handle
+ *
+ * return : cdp_pdev_stats pointer
+ */
+static struct cdp_pdev_stats*
+dp_txrx_get_pdev_stats(struct cdp_pdev *pdev_handle)
+{
+	struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
+
+	dp_aggregate_pdev_stats(pdev);
+
+	return &pdev->stats;
+}
+
 /* dp_txrx_get_peer_stats - will return cdp_peer_stats
  * @peer_handle: DP_PEER handle
  *
@@ -8353,6 +8365,7 @@ static struct cdp_host_stats_ops dp_ops_host_stats = {
 	.txrx_get_vdev_stats  = dp_txrx_get_vdev_stats,
 	.txrx_get_peer_stats = dp_txrx_get_peer_stats,
 	.txrx_reset_peer_stats = dp_txrx_reset_peer_stats,
+	.txrx_get_pdev_stats = dp_txrx_get_pdev_stats,
 	/* TODO */
 };
 

+ 7 - 7
dp/wifi3.0/dp_rx.c

@@ -1215,13 +1215,13 @@ static void dp_rx_msdu_stats_update(struct dp_soc *soc,
 
 	if ((soc->process_rx_status) &&
 	    hal_rx_attn_first_mpdu_get(rx_tlv_hdr)) {
-		if (soc->cdp_soc.ol_ops->update_dp_stats) {
-			soc->cdp_soc.ol_ops->update_dp_stats(
-					vdev->pdev->ctrl_pdev,
-					&peer->stats,
-					peer_id,
-					UPDATE_PEER_STATS);
-		}
+#if defined(FEATURE_PERPKT_INFO) && WDI_EVENT_ENABLE
+		dp_wdi_event_handler(WDI_EVENT_UPDATE_DP_STATS, vdev->pdev->soc,
+				     &peer->stats, peer_id,
+				     UPDATE_PEER_STATS,
+				     vdev->pdev->pdev_id);
+#endif
+
 	}
 }
 

+ 5 - 6
dp/wifi3.0/dp_rx_mon_status.c

@@ -248,12 +248,11 @@ static void dp_rx_stats_update(struct dp_pdev *pdev, struct dp_peer *peer,
 
 	dp_rx_rate_stats_update(peer, ppdu);
 
-	if (soc->cdp_soc.ol_ops->update_dp_stats) {
-		soc->cdp_soc.ol_ops->update_dp_stats(pdev->ctrl_pdev,
-				&peer->stats, ppdu->peer_id,
-				UPDATE_PEER_STATS);
-
-	}
+#if defined(FEATURE_PERPKT_INFO) && WDI_EVENT_ENABLE
+	dp_wdi_event_handler(WDI_EVENT_UPDATE_DP_STATS, pdev->soc,
+			     &peer->stats, ppdu->peer_id,
+			     UPDATE_PEER_STATS, pdev->pdev_id);
+#endif
 }
 #endif
 

+ 6 - 5
dp/wifi3.0/dp_tx.c

@@ -2646,11 +2646,12 @@ dp_tx_update_peer_stats(struct dp_peer *peer,
 	DP_STATS_INCC(peer, tx.ldpc, 1, ts->ldpc);
 	DP_STATS_INCC(peer, tx.retries, 1, ts->transmit_cnt > 1);
 
-	if (soc->cdp_soc.ol_ops->update_dp_stats) {
-		soc->cdp_soc.ol_ops->update_dp_stats(pdev->ctrl_pdev,
-				&peer->stats, ts->peer_id,
-				UPDATE_PEER_STATS);
-	}
+#if defined(FEATURE_PERPKT_INFO) && WDI_EVENT_ENABLE
+	dp_wdi_event_handler(WDI_EVENT_UPDATE_DP_STATS, pdev->soc,
+			     &peer->stats, ts->peer_id,
+			     UPDATE_PEER_STATS, pdev->pdev_id);
+#endif
+
 }
 
 #ifdef QCA_LL_TX_FLOW_CONTROL_V2