qcacld-3.0: Enable to use CNSS2 platform driver

Enable the flags to use CNSS2 platform driver for host driver.

Change-Id: I18996443ab8e7c24fb65b6003cfc368b664b5837
diff --git a/Kbuild b/Kbuild
index 6c93432..69644d6 100644
--- a/Kbuild
+++ b/Kbuild
@@ -18,7 +18,7 @@
 	CONFIG_ROME_IF = snoc
 endif
 
-ifeq ($(CONFIG_CNSS), y)
+ifeq (y,$(findstring y,$(CONFIG_CNSS) $(CONFIG_CNSS2)))
 ifndef CONFIG_ROME_IF
 	#use pci as default interface
 	CONFIG_ROME_IF = pci
@@ -107,7 +107,7 @@
 	CONFIG_QCOM_VOWIFI_11R := y
 
 	ifneq ($(CONFIG_QCA_CLD_WLAN),)
-		ifeq (y,$(findstring y,$(CONFIG_CNSS) $(CONFIG_ICNSS)))
+		ifeq (y,$(findstring y,$(CONFIG_CNSS) $(CONFIG_CNSS2) $(CONFIG_ICNSS)))
 		#Flag to enable Protected Managment Frames (11w) feature
 		CONFIG_WLAN_FEATURE_11W := y
 		#Flag to enable LTE CoEx feature
@@ -1107,6 +1107,10 @@
 endif
 endif
 
+ifeq ($(CONFIG_CNSS2), y)
+CDEFINES += -DCONFIG_PLD_PCIE_CNSS
+endif
+
 ifeq ($(CONFIG_ICNSS), y)
 CDEFINES += -DCONFIG_PLD_SNOC_ICNSS
 endif
diff --git a/core/pld/src/pld_common.c b/core/pld/src/pld_common.c
index 649b006..60e669f 100644
--- a/core/pld/src/pld_common.c
+++ b/core/pld/src/pld_common.c
@@ -34,9 +34,24 @@
 #include <linux/slab.h>
 #include <linux/pm.h>
 
-#if defined(CONFIG_PLD_PCIE_CNSS) || defined(CONFIG_PLD_SDIO_CNSS)
+#ifdef CONFIG_PLD_SDIO_CNSS
 #include <net/cnss.h>
 #endif
+#ifdef CONFIG_PLD_PCIE_CNSS
+/*
+ * This is a hack to make sure this change can be merged before the
+ * kernel defconfig change (switching to CNSS2 platform driver) merged,
+ * otherwise the kernel change has to depend on this change to be merged.
+ * Once the kernel change is merged, these CNSS flags can be removed
+ * so that only cnss2.h is needed.
+ */
+#ifdef CONFIG_CNSS
+#include <net/cnss.h>
+#endif
+#ifdef CONFIG_CNSS2
+#include <net/cnss2.h>
+#endif
+#endif
 #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 f481f3c..66dada9 100644
--- a/core/pld/src/pld_pcie.c
+++ b/core/pld/src/pld_pcie.c
@@ -32,8 +32,20 @@
 #include <linux/slab.h>
 
 #ifdef CONFIG_PLD_PCIE_CNSS
+/*
+ * This is a hack to make sure this change can be merged before the
+ * kernel defconfig change (switching to CNSS2 platform driver) merged,
+ * otherwise the kernel change has to depend on this change to be merged.
+ * Once the kernel change is merged, these CNSS flags can be removed
+ * so that only cnss2.h is needed.
+ */
+#ifdef CONFIG_CNSS
 #include <net/cnss.h>
 #endif
+#ifdef CONFIG_CNSS2
+#include <net/cnss2.h>
+#endif
+#endif
 
 #include "pld_internal.h"
 #include "pld_pcie.h"
diff --git a/core/pld/src/pld_pcie.h b/core/pld/src/pld_pcie.h
index 4831120..ec0bde7 100644
--- a/core/pld/src/pld_pcie.h
+++ b/core/pld/src/pld_pcie.h
@@ -29,8 +29,20 @@
 #define __PLD_PCIE_H__
 
 #ifdef CONFIG_PLD_PCIE_CNSS
+/*
+ * This is a hack to make sure this change can be merged before the
+ * kernel defconfig change (switching to CNSS2 platform driver) merged,
+ * otherwise the kernel change has to depend on this change to be merged.
+ * Once the kernel change is merged, these CNSS flags can be removed
+ * so that only cnss2.h is needed.
+ */
+#ifdef CONFIG_CNSS
 #include <net/cnss.h>
 #endif
+#ifdef CONFIG_CNSS2
+#include <net/cnss2.h>
+#endif
+#endif
 #include "pld_internal.h"
 
 #ifndef CONFIG_PCI