qcacld-3.0: Add IPA over GSI support
For IPA WDI3.0 veresion IPA uses GSI FW. So add IPA
over GSI support.
Change-Id: I3ecdb0b365e6004f7694d19ea8165233f00c6335
CRs-Fixed: 2368038
diff --git a/components/ipa/core/inc/wlan_ipa_priv.h b/components/ipa/core/inc/wlan_ipa_priv.h
index 8497aad..aa4c437 100644
--- a/components/ipa/core/inc/wlan_ipa_priv.h
+++ b/components/ipa/core/inc/wlan_ipa_priv.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-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
@@ -627,6 +627,7 @@
qdf_ipa_wdi_in_params_t prod_pipe_in;
bool uc_loaded;
bool wdi_enabled;
+ bool over_gsi;
qdf_mc_timer_t rt_debug_fill_timer;
qdf_mutex_t rt_debug_lock;
qdf_mutex_t ipa_lock;
diff --git a/components/ipa/core/src/wlan_ipa_core.c b/components/ipa/core/src/wlan_ipa_core.c
index 22cf649..edf2a76 100644
--- a/components/ipa/core/src/wlan_ipa_core.c
+++ b/components/ipa/core/src/wlan_ipa_core.c
@@ -321,7 +321,7 @@
&ipa_ctx->tx_pipe_handle,
&ipa_ctx->rx_pipe_handle,
wlan_ipa_wdi_is_smmu_enabled(ipa_ctx, osdev),
- sys_in);
+ sys_in, ipa_ctx->over_gsi);
}
#ifdef FEATURE_METERING
@@ -373,13 +373,18 @@
return QDF_STATUS_E_FAILURE;
}
+ ipa_ctx->over_gsi =
+ QDF_IPA_WDI_INIT_OUT_PARAMS_IS_OVER_GSI(&out);
+ ipa_ctx->is_smmu_enabled =
+ QDF_IPA_WDI_INIT_OUT_PARAMS_IS_SMMU_ENABLED(&out);
+ ipa_info("ipa_over_gsi: %d, is_smmu_enabled: %d",
+ ipa_ctx->over_gsi, ipa_ctx->is_smmu_enabled);
+
if (QDF_IPA_WDI_INIT_OUT_PARAMS_IS_UC_READY(&out)) {
ipa_debug("IPA uC READY");
ipa_ctx->uc_loaded = true;
- ipa_ctx->is_smmu_enabled =
- QDF_IPA_WDI_INIT_OUT_PARAMS_IS_SMMU_ENABLED(&out);
- ipa_debug("is_smmu_enabled=%d", ipa_ctx->is_smmu_enabled);
} else {
+ ipa_info("IPA uc not ready");
return QDF_STATUS_E_BUSY;
}
@@ -2254,7 +2259,7 @@
#else
/**
* wlan_ipa_setup_tx_sys_pipe() - Setup IPA Tx system pipes
- * @ipa_ctx: Global IPA IPA context
+ * @ipa_ctx: IPA context
* @desc_fifo_sz: Number of descriptors
*
* Return: 0 on success, negative errno on error
@@ -2270,6 +2275,27 @@
}
#endif
+#ifdef CONFIG_IPA_WDI_UNIFIED_API
+/**
+ * wlan_ipa_get_rx_ipa_client() - Get IPA RX ipa client
+ * @ipa_ctx: IPA context
+ *
+ * Return: rx ipa sys client
+ */
+static inline uint8_t wlan_ipa_get_rx_ipa_client(struct wlan_ipa_priv *ipa_ctx)
+{
+ if (ipa_ctx->over_gsi)
+ return IPA_CLIENT_WLAN2_PROD;
+ else
+ return IPA_CLIENT_WLAN1_PROD;
+}
+#else
+static inline uint8_t wlan_ipa_get_rx_ipa_client(struct wlan_ipa_priv *ipa_ctx)
+{
+ return IPA_CLIENT_WLAN1_PROD;
+}
+#endif
+
/**
* wlan_ipa_setup_rx_sys_pipe() - Setup IPA Rx system pipes
* @ipa_ctx: Global IPA IPA context
@@ -2290,8 +2316,7 @@
*/
ipa = &ipa_ctx->sys_pipe[WLAN_IPA_RX_PIPE].ipa_sys_params;
- ipa->client = IPA_CLIENT_WLAN1_PROD;
-
+ ipa->client = wlan_ipa_get_rx_ipa_client(ipa_ctx);
ipa->desc_fifo_sz = desc_fifo_sz;
ipa->priv = ipa_ctx;
ipa->notify = wlan_ipa_w2i_cb;