From 633c10d75bd39da5f32e5654ebebdb2cd2bacf02 Mon Sep 17 00:00:00 2001 From: Vevek Venkatesan Date: Thu, 1 Oct 2020 20:38:01 +0530 Subject: [PATCH] qcacmn: add cdp ops for IPA Tx buf smmu_unmapping Add cdp ops for IPA Tx buffer SMMU-S1 unmapping. Change-Id: Ia28509439c27d4b42353c55774926f245fd30abc CRs-Fixed: 2789746 --- dp/inc/cdp_txrx_ipa.h | 28 +++++++++++++++++++++++++++- dp/inc/cdp_txrx_ops.h | 5 ++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/dp/inc/cdp_txrx_ipa.h b/dp/inc/cdp_txrx_ipa.h index 63d33e3610ca..162af82324e6 100644 --- a/dp/inc/cdp_txrx_ipa.h +++ b/dp/inc/cdp_txrx_ipa.h @@ -613,7 +613,7 @@ cdp_ipa_rx_intrabss_fwd(ol_txrx_soc_handle soc, uint8_t vdev_id, /** * cdp_ipa_tx_buf_smmu_mapping() - Create SMMU mappings for Tx - * buffers allocated to IPA + * buffers allocated to IPA * @soc: data path soc handle * @pdev_id: device instance id * @@ -635,6 +635,32 @@ cdp_ipa_tx_buf_smmu_mapping(ol_txrx_soc_handle soc, uint8_t pdev_id) return QDF_STATUS_SUCCESS; } + +/** + * cdp_ipa_tx_buf_smmu_unmapping() - Release SMMU mappings for Tx + * buffers allocated to IPA + * @soc: data path soc handle + * @pdev_id: device instance id + * + * Release SMMU mappings for Tx buffers allocated to IPA + * + * return QDF_STATUS_SUCCESS + */ +static inline QDF_STATUS +cdp_ipa_tx_buf_smmu_unmapping(ol_txrx_soc_handle soc, uint8_t pdev_id) +{ + if (!soc || !soc->ops || !soc->ops->ipa_ops) { + QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, + "%s invalid instance", __func__); + return QDF_STATUS_E_FAILURE; + } + + if (soc->ops->ipa_ops->ipa_tx_buf_smmu_unmapping) + return soc->ops->ipa_ops->ipa_tx_buf_smmu_unmapping(soc, + pdev_id); + + return QDF_STATUS_SUCCESS; +} #endif /* IPA_OFFLOAD */ #endif /* _CDP_TXRX_IPA_H_ */ diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index 9ea060b42382..e0a36b6962ed 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -1537,7 +1537,8 @@ struct cdp_throttle_ops { * @ipa_register_op_cb: * @ipa_get_stat: * @ipa_tx_data_frame: - * @ipa_tx_buf_smmu_mapping: Provide SMMU mappings for Tx + * @ipa_tx_buf_smmu_mapping: Create SMMU mappings for Tx + * @ipa_tx_buf_smmu_unmapping: Release SMMU mappings for Tx * buffers to IPA */ struct cdp_ipa_ops { @@ -1605,6 +1606,8 @@ struct cdp_ipa_ops { qdf_nbuf_t nbuf, bool *fwd_success); QDF_STATUS (*ipa_tx_buf_smmu_mapping)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id); + QDF_STATUS (*ipa_tx_buf_smmu_unmapping)(struct cdp_soc_t *soc_hdl, + uint8_t pdev_id); }; #endif