|
@@ -404,6 +404,185 @@ static inline void cdp_get_dp_htt_stats(ol_txrx_soc_handle soc,
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * @brief Update pdev host stats received from firmware
|
|
|
+ * (wmi_host_pdev_stats and wmi_host_pdev_ext_stats) into dp
|
|
|
+ *
|
|
|
+ * @param pdev - the physical device object
|
|
|
+ * @param data - pdev stats
|
|
|
+ * @return - void
|
|
|
+ */
|
|
|
+static inline void
|
|
|
+cdp_update_pdev_host_stats(ol_txrx_soc_handle soc,
|
|
|
+ struct cdp_pdev *pdev,
|
|
|
+ void *data,
|
|
|
+ uint16_t stats_id)
|
|
|
+{
|
|
|
+ if (soc && soc->ops && soc->ops->host_stats_ops &&
|
|
|
+ soc->ops->host_stats_ops->txrx_update_pdev_stats)
|
|
|
+ return soc->ops->host_stats_ops->txrx_update_pdev_stats
|
|
|
+ (pdev, data, stats_id);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * @brief Call to get peer stats
|
|
|
+ *
|
|
|
+ * @param peer - dp peer object
|
|
|
+ * @return - struct cdp_peer_stats
|
|
|
+ */
|
|
|
+static inline struct cdp_peer_stats *
|
|
|
+cdp_host_get_peer_stats(ol_txrx_soc_handle soc, struct cdp_peer *peer)
|
|
|
+{
|
|
|
+ if (!soc || !soc->ops) {
|
|
|
+ QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
|
|
+ "%s: Invalid Instance", __func__);
|
|
|
+ QDF_BUG(0);
|
|
|
+ return NULL;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!soc->ops->host_stats_ops ||
|
|
|
+ !soc->ops->host_stats_ops->txrx_get_peer_stats)
|
|
|
+ return NULL;
|
|
|
+
|
|
|
+ return soc->ops->host_stats_ops->txrx_get_peer_stats(peer);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * @brief Call to reset ald stats
|
|
|
+ *
|
|
|
+ * @param peer - dp peer object
|
|
|
+ * @return - void
|
|
|
+ */
|
|
|
+static inline void
|
|
|
+cdp_host_reset_peer_ald_stats(ol_txrx_soc_handle soc,
|
|
|
+ struct cdp_peer *peer)
|
|
|
+{
|
|
|
+ if (!soc || !soc->ops) {
|
|
|
+ QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
|
|
+ "%s: Invalid Instance", __func__);
|
|
|
+ QDF_BUG(0);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!soc->ops->host_stats_ops ||
|
|
|
+ !soc->ops->host_stats_ops->txrx_reset_peer_ald_stats)
|
|
|
+ return;
|
|
|
+
|
|
|
+ return soc->ops->host_stats_ops->txrx_reset_peer_ald_stats(peer);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * @brief Call to reset peer stats
|
|
|
+ *
|
|
|
+ * @param peer - dp peer object
|
|
|
+ * @return - void
|
|
|
+ */
|
|
|
+static inline void
|
|
|
+cdp_host_reset_peer_stats(ol_txrx_soc_handle soc,
|
|
|
+ struct cdp_peer *peer)
|
|
|
+{
|
|
|
+ if (!soc || !soc->ops) {
|
|
|
+ QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
|
|
+ "%s: Invalid Instance", __func__);
|
|
|
+ QDF_BUG(0);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!soc->ops->host_stats_ops ||
|
|
|
+ !soc->ops->host_stats_ops->txrx_reset_peer_stats)
|
|
|
+ return;
|
|
|
+
|
|
|
+ return soc->ops->host_stats_ops->txrx_reset_peer_stats(peer);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * @brief Call to get vdev stats
|
|
|
+ *
|
|
|
+ * @param vdev - dp vdev object
|
|
|
+ * @param buf - buffer
|
|
|
+ * @return - int
|
|
|
+ */
|
|
|
+static inline int
|
|
|
+cdp_host_get_vdev_stats(ol_txrx_soc_handle soc,
|
|
|
+ struct cdp_vdev *vdev,
|
|
|
+ struct cdp_vdev_stats *buf,
|
|
|
+ bool is_aggregate)
|
|
|
+{
|
|
|
+ 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_vdev_stats)
|
|
|
+ return 0;
|
|
|
+
|
|
|
+ return soc->ops->host_stats_ops->txrx_get_vdev_stats(vdev,
|
|
|
+ buf,
|
|
|
+ is_aggregate);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * @brief Call to update vdev stats received from firmware
|
|
|
+ * (wmi_host_vdev_stats and wmi_host_vdev_extd_stats) into dp
|
|
|
+ *
|
|
|
+ * @param data - stats data to be updated
|
|
|
+ * @param size - size of stats data
|
|
|
+ * @param stats_id - stats id
|
|
|
+ * @return - int
|
|
|
+ */
|
|
|
+static inline int
|
|
|
+cdp_update_host_vdev_stats(ol_txrx_soc_handle soc,
|
|
|
+ void *data,
|
|
|
+ uint32_t size,
|
|
|
+ uint32_t stats_id)
|
|
|
+{
|
|
|
+ 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_process_wmi_host_vdev_stats)
|
|
|
+ return 0;
|
|
|
+
|
|
|
+ return soc->ops->host_stats_ops->txrx_process_wmi_host_vdev_stats
|
|
|
+ (soc,
|
|
|
+ data,
|
|
|
+ size,
|
|
|
+ stats_id);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * @brief Call to get vdev extd stats
|
|
|
+ *
|
|
|
+ * @param vdev - dp vdev object
|
|
|
+ * @param buf - buffer
|
|
|
+ * @return - int
|
|
|
+ */
|
|
|
+static inline int
|
|
|
+cdp_get_vdev_extd_stats(ol_txrx_soc_handle soc,
|
|
|
+ struct cdp_vdev *vdev,
|
|
|
+ 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_vdev_extd_stats)
|
|
|
+ return 0;
|
|
|
+
|
|
|
+ return soc->ops->host_stats_ops->txrx_get_vdev_extd_stats(vdev, buf);
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* @brief Parse the stats header and get the payload from the message.
|
|
|
*
|