diff --git a/dp/inc/cdp_txrx_ipa.h b/dp/inc/cdp_txrx_ipa.h index 19e18102404e..fa2bd1180c37 100644 --- a/dp/inc/cdp_txrx_ipa.h +++ b/dp/inc/cdp_txrx_ipa.h @@ -237,5 +237,51 @@ static inline void cdp_ipa_set_uc_tx_partition_base(ol_txrx_soc_handle soc, return; } + +/** + * cdp_ipa_uc_get_share_stats() - get Tx/Rx byte stats from FW + * @pdev: physical device instance + * @value: reset stats + * + * Return: none + */ +static inline void cdp_ipa_uc_get_share_stats(ol_txrx_soc_handle soc, + struct cdp_pdev *pdev, uint8_t value) +{ + if (!soc || !soc->ops || !soc->ops->ipa_ops) { + QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, + "%s invalid instance", __func__); + return; + } + + if (soc->ops->ipa_ops->ipa_uc_get_share_stats) + return soc->ops->ipa_ops->ipa_uc_get_share_stats(pdev, + value); + + return; +} + +/** + * cdp_ipa_uc_set_quota() - set quota limit to FW + * @pdev: physical device instance + * @value: quota limit bytes + * + * Return: none + */ +static inline void cdp_ipa_uc_set_quota(ol_txrx_soc_handle soc, + struct cdp_pdev *pdev, uint64_t value) +{ + if (!soc || !soc->ops || !soc->ops->ipa_ops) { + QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, + "%s invalid instance", __func__); + return; + } + + if (soc->ops->ipa_ops->ipa_uc_get_share_stats) + return soc->ops->ipa_ops->ipa_uc_set_quota(pdev, + value); + + return; +} #endif /* _CDP_TXRX_IPA_H_ */ diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index a360745e4e0c..0331e9736557 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -704,20 +704,24 @@ struct cdp_lflowctl_ops { */ struct cdp_ipa_ops { void (*ipa_get_resource)(struct cdp_pdev *pdev, - struct ol_txrx_ipa_resources *ipa_res); + struct ol_txrx_ipa_resources *ipa_res); void (*ipa_set_doorbell_paddr)(struct cdp_pdev *pdev, - qdf_dma_addr_t ipa_tx_uc_doorbell_paddr, - qdf_dma_addr_t ipa_rx_uc_doorbell_paddr); + qdf_dma_addr_t ipa_tx_uc_doorbell_paddr, + qdf_dma_addr_t ipa_rx_uc_doorbell_paddr); void (*ipa_set_active)(struct cdp_pdev *pdev, bool uc_active, bool is_tx); void (*ipa_op_response)(struct cdp_pdev *pdev, uint8_t *op_msg); void (*ipa_register_op_cb)(struct cdp_pdev *pdev, - void (*ipa_uc_op_cb_type)(uint8_t *op_msg, void *osif_ctxt), - void *osif_dev); + void (*ipa_uc_op_cb_type)(uint8_t *op_msg, void *osif_ctxt), + void *osif_dev); void (*ipa_get_stat)(struct cdp_pdev *pdev); qdf_nbuf_t (*ipa_tx_data_frame)(struct cdp_vdev *vdev, qdf_nbuf_t skb); void (*ipa_set_uc_tx_partition_base)(struct cdp_cfg *cfg_pdev, uint32_t value); + void (*ipa_uc_get_share_stats)(struct cdp_pdev *pdev, + uint8_t reset_stats); + void (*ipa_uc_set_quota)(struct cdp_pdev *pdev, + uint64_t quota_bytes); }; /**