From fc3c8cf33088b39218efd5c98d751e7e1ea3451c Mon Sep 17 00:00:00 2001 From: Sravan Kumar Kairam Date: Mon, 19 Nov 2018 18:32:50 +0530 Subject: [PATCH] qcacmn: Add support for IPA using GSI When IPA using GSI instead of UC different IPA TX and RX clients needs to be configured. In this change when IPA uses GSI configure appropriate TX and RX clients/pipes. Change-Id: I0302323d91f0cc4256a1b08ddbb1345d0daa2939 CRs-Fixed: 2368003 --- dp/inc/cdp_txrx_ipa.h | 8 +++++--- dp/inc/cdp_txrx_ops.h | 3 ++- dp/wifi3.0/dp_ipa.c | 16 ++++++++++++---- dp/wifi3.0/dp_ipa.h | 4 ++-- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/dp/inc/cdp_txrx_ipa.h b/dp/inc/cdp_txrx_ipa.h index 1109ad002af6..e1cba5dc478e 100644 --- a/dp/inc/cdp_txrx_ipa.h +++ b/dp/inc/cdp_txrx_ipa.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -350,6 +350,7 @@ cdp_ipa_disable_autonomy(ol_txrx_soc_handle soc, struct cdp_pdev *pdev) * @rx_pipe_handle: pointer to Rx pipe handle * @is_smmu_enabled: Is SMMU enabled or not * @sys_in: parameters to setup sys pipe in mcc mode + * @over_gsi: Is IPA using GSI * * Return: QDF_STATUS */ @@ -358,7 +359,8 @@ cdp_ipa_setup(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, void *ipa_i2w_cb, void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb, uint32_t ipa_desc_size, void *ipa_priv, bool is_rm_enabled, uint32_t *tx_pipe_handle, uint32_t *rx_pipe_handle, - bool is_smmu_enabled, qdf_ipa_sys_connect_params_t *sys_in) + bool is_smmu_enabled, qdf_ipa_sys_connect_params_t *sys_in, + bool over_gsi) { if (!soc || !soc->ops || !soc->ops->ipa_ops || !pdev) { QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, @@ -375,7 +377,7 @@ cdp_ipa_setup(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, void *ipa_i2w_cb, tx_pipe_handle, rx_pipe_handle, is_smmu_enabled, - sys_in); + sys_in, over_gsi); return QDF_STATUS_SUCCESS; } diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index 1185b81b23a5..6838304882c8 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -1147,7 +1147,8 @@ struct cdp_ipa_ops { void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb, uint32_t ipa_desc_size, void *ipa_priv, bool is_rm_enabled, uint32_t *tx_pipe_handle, uint32_t *rx_pipe_handle, - bool is_smmu_enabled, qdf_ipa_sys_connect_params_t *sys_in); + bool is_smmu_enabled, qdf_ipa_sys_connect_params_t *sys_in, + bool over_gsi); #else /* CONFIG_IPA_WDI_UNIFIED_API */ QDF_STATUS (*ipa_setup)(struct cdp_pdev *pdev, void *ipa_i2w_cb, void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb, diff --git a/dp/wifi3.0/dp_ipa.c b/dp/wifi3.0/dp_ipa.c index eaced3823c29..1153f75e71a9 100644 --- a/dp/wifi3.0/dp_ipa.c +++ b/dp/wifi3.0/dp_ipa.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -648,7 +648,7 @@ QDF_STATUS dp_ipa_setup(struct cdp_pdev *ppdev, void *ipa_i2w_cb, uint32_t ipa_desc_size, void *ipa_priv, bool is_rm_enabled, uint32_t *tx_pipe_handle, uint32_t *rx_pipe_handle, bool is_smmu_enabled, - qdf_ipa_sys_connect_params_t *sys_in) + qdf_ipa_sys_connect_params_t *sys_in, bool over_gsi) { struct dp_pdev *pdev = (struct dp_pdev *)ppdev; struct dp_soc *soc = pdev->soc; @@ -712,7 +712,10 @@ QDF_STATUS dp_ipa_setup(struct cdp_pdev *ppdev, void *ipa_i2w_cb, return QDF_STATUS_E_FAILURE; } - QDF_IPA_WDI_SETUP_INFO_CLIENT(tx) = IPA_CLIENT_WLAN1_CONS; + if (over_gsi) + QDF_IPA_WDI_SETUP_INFO_CLIENT(tx) = IPA_CLIENT_WLAN2_CONS; + else + QDF_IPA_WDI_SETUP_INFO_CLIENT(tx) = IPA_CLIENT_WLAN1_CONS; QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_BASE_PA(tx) = ipa_res->tx_comp_ring_base_paddr; QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_SIZE(tx) = @@ -776,7 +779,12 @@ QDF_STATUS dp_ipa_setup(struct cdp_pdev *ppdev, void *ipa_i2w_cb, "%s: SMMU is not implementation on host", __func__); return QDF_STATUS_E_FAILURE; } else { - QDF_IPA_WDI_SETUP_INFO_CLIENT(rx) = IPA_CLIENT_WLAN1_PROD; + if (over_gsi) + QDF_IPA_WDI_SETUP_INFO_CLIENT(rx) = + IPA_CLIENT_WLAN2_PROD; + else + QDF_IPA_WDI_SETUP_INFO_CLIENT(rx) = + IPA_CLIENT_WLAN1_PROD; QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_BASE_PA(rx) = ipa_res->rx_rdy_ring_base_paddr; QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_SIZE(rx) = diff --git a/dp/wifi3.0/dp_ipa.h b/dp/wifi3.0/dp_ipa.h index 856560864b92..1fed10cbb016 100644 --- a/dp/wifi3.0/dp_ipa.h +++ b/dp/wifi3.0/dp_ipa.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -63,7 +63,7 @@ QDF_STATUS dp_ipa_setup(struct cdp_pdev *pdev, void *ipa_i2w_cb, bool is_rm_enabled, uint32_t *tx_pipe_handle, uint32_t *rx_pipe_handle, bool is_smmu_enabled, - qdf_ipa_sys_connect_params_t *sys_in); + qdf_ipa_sys_connect_params_t *sys_in, bool over_gsi); #else /* CONFIG_IPA_WDI_UNIFIED_API */ QDF_STATUS dp_ipa_setup(struct cdp_pdev *pdev, void *ipa_i2w_cb, void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb,