qcacld-3.0: Use PLD internal flags
Use PLD internal flags in PLD layer instead of using CNSS/ICNSS
kernel flags.
CRs-Fixed: 1018099
Change-Id: Id32c62ccd1749ef5a38fd11aba6ce6e4fbe84a6e
diff --git a/Kbuild b/Kbuild
index d904e99..6986040 100755
--- a/Kbuild
+++ b/Kbuild
@@ -989,6 +989,18 @@
-DCONFIG_160MHZ_SUPPORT \
-DCONFIG_MCL
+ifeq ($(CONFIG_CNSS), y)
+ifeq ($(CONFIG_CNSS_SDIO), y)
+CDEFINES += -DCONFIG_PLD_SDIO_CNSS
+else
+CDEFINES += -DCONFIG_PLD_PCIE_CNSS
+endif
+endif
+
+ifeq ($(CONFIG_ICNSS), y)
+CDEFINES += -DCONFIG_PLD_SNOC_ICNSS
+endif
+
ifeq (y,$(filter y,$(CONFIG_CNSS_EOS) $(CONFIG_ICNSS)))
CDEFINES += -DQCA_WIFI_3_0
CDEFINES += -DQCA_WIFI_3_0_EMU
diff --git a/core/pld/src/pld_common.c b/core/pld/src/pld_common.c
index e3c5bc6..cc9cdb3 100644
--- a/core/pld/src/pld_common.c
+++ b/core/pld/src/pld_common.c
@@ -34,10 +34,10 @@
#include <linux/slab.h>
#include <linux/pm.h>
-#ifdef CONFIG_CNSS
+#if defined(CONFIG_PLD_PCIE_CNSS) || defined(CONFIG_PLD_SDIO_CNSS)
#include <net/cnss.h>
#endif
-#ifdef CONFIG_ICNSS
+#ifdef CONFIG_PLD_SNOC_ICNSS
#include <soc/qcom/icnss.h>
#endif
diff --git a/core/pld/src/pld_pcie.c b/core/pld/src/pld_pcie.c
index d9dc95b..e5585e6 100644
--- a/core/pld/src/pld_pcie.c
+++ b/core/pld/src/pld_pcie.c
@@ -31,7 +31,7 @@
#include <linux/list.h>
#include <linux/slab.h>
-#ifdef CONFIG_CNSS
+#ifdef CONFIG_PLD_PCIE_CNSS
#include <net/cnss.h>
#endif
@@ -121,7 +121,7 @@
spin_unlock_irqrestore(&pld_context->pld_lock, flags);
}
-#ifdef CONFIG_CNSS
+#ifdef CONFIG_PLD_PCIE_CNSS
/**
* pld_pcie_reinit() - SSR re-initialize function for PCIE device
* @pdev: PCIE device
@@ -289,7 +289,7 @@
{ 0 }
};
-#ifdef CONFIG_CNSS
+#ifdef CONFIG_PLD_PCIE_CNSS
#ifdef FEATURE_RUNTIME_PM
struct cnss_wlan_runtime_ops runtime_pm_ops = {
.runtime_suspend = pld_pcie_runtime_suspend,
@@ -372,7 +372,7 @@
return -EINVAL;
}
-#ifdef CONFIG_CNSS
+#ifdef CONFIG_PLD_PCIE_CNSS
#ifdef QCA_WIFI_3_0_ADRASTEA
/**
* pld_pcie_wlan_enable() - Enable WLAN
diff --git a/core/pld/src/pld_pcie.h b/core/pld/src/pld_pcie.h
index 63d0742..d837154 100644
--- a/core/pld/src/pld_pcie.h
+++ b/core/pld/src/pld_pcie.h
@@ -51,7 +51,7 @@
int pld_pcie_get_ce_id(int irq);
#endif
-#if (!defined(CONFIG_CNSS)) || (!defined(QCA_WIFI_3_0_ADRASTEA))
+#if (!defined(CONFIG_PLD_PCIE_CNSS)) || (!defined(QCA_WIFI_3_0_ADRASTEA))
static inline int pld_pcie_wlan_enable(struct pld_wlan_enable_cfg *config,
enum pld_driver_mode mode, const char *host_version)
{
@@ -76,7 +76,7 @@
int pld_pcie_set_fw_debug_mode(bool enablefwlog);
#endif
-#if (!defined(CONFIG_CNSS)) || (!defined(CONFIG_CNSS_SECURE_FW))
+#if (!defined(CONFIG_PLD_PCIE_CNSS)) || (!defined(CONFIG_CNSS_SECURE_FW))
static inline int cnss_get_sha_hash(const u8 *data,
u32 data_len, u8 *hash_idx, u8 *out)
{
@@ -88,15 +88,14 @@
}
#endif
-#if (!defined(CONFIG_CNSS)) || (!defined(CONFIG_PCI_MSM))
+#if (!defined(CONFIG_PLD_PCIE_CNSS)) || (!defined(CONFIG_PCI_MSM))
static inline int cnss_wlan_pm_control(bool vote)
{
return 0;
}
#endif
-#ifndef CONFIG_CNSS
-
+#ifndef CONFIG_PLD_PCIE_CNSS
static inline int
pld_pcie_get_fw_files_for_target(struct pld_fw_files *pfw_files,
u32 target_type, u32 target_version)
diff --git a/core/pld/src/pld_snoc.c b/core/pld/src/pld_snoc.c
index b2d0446..9786d21 100644
--- a/core/pld/src/pld_snoc.c
+++ b/core/pld/src/pld_snoc.c
@@ -30,14 +30,14 @@
#include <linux/list.h>
#include <linux/slab.h>
-#ifdef CONFIG_ICNSS
+#ifdef CONFIG_PLD_SNOC_ICNSS
#include <soc/qcom/icnss.h>
#endif
#include "pld_common.h"
#include "pld_internal.h"
-#ifdef CONFIG_ICNSS
+#ifdef CONFIG_PLD_SNOC_ICNSS
/**
* pld_snoc_probe() - Probe function for platform driver
* @dev: device
diff --git a/core/pld/src/pld_snoc.h b/core/pld/src/pld_snoc.h
index 3217106..b866abf 100644
--- a/core/pld/src/pld_snoc.h
+++ b/core/pld/src/pld_snoc.h
@@ -30,7 +30,7 @@
#include "pld_common.h"
-#ifndef CONFIG_ICNSS
+#ifndef CONFIG_PLD_SNOC_ICNSS
static inline int pld_snoc_register_driver(void)
{
return 0;