diff --git a/dp/inc/cdp_txrx_cmn.h b/dp/inc/cdp_txrx_cmn.h index cb0dda40a9..4c7129f5ae 100644 --- a/dp/inc/cdp_txrx_cmn.h +++ b/dp/inc/cdp_txrx_cmn.h @@ -2250,4 +2250,98 @@ static inline uint32_t cdp_cfg_get(ol_txrx_soc_handle soc, enum cdp_dp_cfg cfg) return soc->ops->cmn_drv_ops->txrx_get_cfg(soc, cfg); } + +/** + * cdp_soc_set_rate_stats_ctx() - set rate stats context in soc + * @soc: opaque soc handle + * @ctx: rate stats context + * + * Return: void + */ +static inline void +cdp_soc_set_rate_stats_ctx(ol_txrx_soc_handle soc, void *ctx) +{ + 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->cmn_drv_ops || + !soc->ops->cmn_drv_ops->set_rate_stats_ctx) + return; + + soc->ops->cmn_drv_ops->set_rate_stats_ctx((struct cdp_soc_t *)soc, + ctx); +} + +/** + * cdp_soc_get_rate_stats_ctx() - get rate stats context in soc + * @soc: opaque soc handle + * + * Return: void + */ +static inline void* +cdp_soc_get_rate_stats_ctx(ol_txrx_soc_handle soc) +{ + 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->cmn_drv_ops || + !soc->ops->cmn_drv_ops->get_rate_stats_ctx) + return NULL; + + return soc->ops->cmn_drv_ops->get_rate_stats_ctx(soc); +} + +/** + * cdp_peer_flush_rate_stats() - flush peer rate statistics + * @soc: opaque soc handle + * @pdev: pdev handle + * @buf: stats buffer + */ +static inline void +cdp_peer_flush_rate_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; + } + + if (!soc->ops->cmn_drv_ops || + !soc->ops->cmn_drv_ops->txrx_peer_flush_rate_stats) + return; + + soc->ops->cmn_drv_ops->txrx_peer_flush_rate_stats(soc, pdev, buf); +} + +/** + * cdp_flush_rate_stats_request() - request flush rate statistics + * @soc: opaque soc handle + * @pdev: pdev handle + */ +static inline void +cdp_flush_rate_stats_request(struct cdp_soc_t *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; + } + + if (!soc->ops->cmn_drv_ops || + !soc->ops->cmn_drv_ops->txrx_flush_rate_stats_request) + return; + + soc->ops->cmn_drv_ops->txrx_flush_rate_stats_request(soc, pdev); +} #endif /* _CDP_TXRX_CMN_H_ */ diff --git a/dp/inc/cdp_txrx_host_stats.h b/dp/inc/cdp_txrx_host_stats.h index a5f864562d..72867d14a7 100644 --- a/dp/inc/cdp_txrx_host_stats.h +++ b/dp/inc/cdp_txrx_host_stats.h @@ -672,6 +672,30 @@ cdp_host_get_radio_stats(ol_txrx_soc_handle soc, buf); } +/** + * @brief confgure rate stats at soc + * + * @param soc - opaque soc handle + * @param vap - capabilities + * @return - void + */ +static inline void +cdp_soc_configure_rate_stats(ol_txrx_soc_handle soc, uint8_t val) +{ + 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->configure_rate_stats) + return; + + return soc->ops->host_stats_ops->configure_rate_stats(soc, val); +} + /** * @brief Parse the stats header and get the payload from the message. * diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index a3dfbe33c7..71d19842c4 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -439,6 +439,13 @@ struct cdp_cmn_ops { bool (*get_dp_capabilities)(struct cdp_soc_t *soc, enum cdp_capabilities dp_caps); + void (*set_rate_stats_ctx)(struct cdp_soc_t *soc, void *ctx); + void* (*get_rate_stats_ctx)(struct cdp_soc_t *soc); + void (*txrx_peer_flush_rate_stats)(struct cdp_soc_t *soc, + struct cdp_pdev *pdev, + void *buf); + void (*txrx_flush_rate_stats_request)(struct cdp_soc_t *soc, + struct cdp_pdev *pdev); }; struct cdp_ctrl_ops { @@ -792,6 +799,9 @@ struct cdp_host_stats_ops { int (*txrx_get_ratekbps)(int preamb, int mcs, int htflag, int gintval); + void + (*configure_rate_stats)(struct cdp_soc_t *soc, + uint8_t val); }; struct cdp_wds_ops { diff --git a/dp/inc/cdp_txrx_stats_struct.h b/dp/inc/cdp_txrx_stats_struct.h index 5aa737bf74..51a4e580c9 100644 --- a/dp/inc/cdp_txrx_stats_struct.h +++ b/dp/inc/cdp_txrx_stats_struct.h @@ -1579,6 +1579,7 @@ enum _ol_ath_param_t { OL_ATH_PARAM_HE_UL_PPDU_DURATION = 402, OL_ATH_PARAM_HE_UL_RU_ALLOCATION = 403, OL_ATH_PARAM_PERIODIC_CFR_CAPTURE = 404, + OL_ATH_PARAM_FLUSH_PEER_RATE_STATS = 405, }; /* Enumeration of PDEV Configuration parameter */