Browse Source

qcacld-3.0: Handle flags defined as modules properly

The current way in the driver to handle CONFIG_CNSS_UTILS=m and
CONFIG_WCNSS_MEM_PRE_ALLOC=m will not work if the flags are not
coming from kernel Kconfig directly (e.g. CNSS utils and prealloc
module sources are built out of kernel tree) since "cppflags-
$(CONFIG_FLAG) += -DCONFIG_FLAG" will not take effect if CONFIG_FLAG=m.
Fix it in a proper way which is same as handling CONFIG_CNSS_GENL.

Change-Id: Iab4bf34bd1ae89f947bc5f7080e18569810f5f58
CRs-fixed: 3022560
Yue Ma 3 years ago
parent
commit
2e49f1156d
3 changed files with 17 additions and 5 deletions
  1. 8 2
      Kbuild
  2. 6 0
      configs/default_defconfig
  3. 3 3
      core/pld/inc/pld_common.h

+ 8 - 2
Kbuild

@@ -524,7 +524,6 @@ endif
 $(call add-wlan-objs,dsc,$(DSC_OBJS))
 
 cppflags-$(CONFIG_ONE_MSI_VECTOR) += -DWLAN_ONE_MSI_VECTOR
-cppflags-$(CONFIG_CNSS_UTILS) += -DCONFIG_CNSS_UTILS
 
 cppflags-$(CONFIG_DSC_DEBUG) += -DWLAN_DSC_DEBUG
 cppflags-$(CONFIG_DSC_TEST) += -DWLAN_DSC_TEST
@@ -3085,6 +3084,14 @@ ifeq (y,$(findstring y, $(CONFIG_CNSS_GENL) $(CONFIG_CNSS_GENL_MODULE)))
 cppflags-y += -DCNSS_GENL
 endif
 
+ifeq (y,$(findstring y, $(CONFIG_CNSS_UTILS) $(CONFIG_CNSS_UTILS_MODULE)))
+cppflags-y += -DCNSS_UTILS
+endif
+
+ifeq (y,$(findstring y, $(CONFIG_WCNSS_MEM_PRE_ALLOC) $(CONFIG_WCNSS_MEM_PRE_ALLOC_MODULE)))
+cppflags-y += -DCNSS_MEM_PRE_ALLOC
+endif
+
 cppflags-$(CONFIG_QCACLD_WLAN_LFR2) += -DWLAN_FEATURE_HOST_ROAM
 
 cppflags-$(CONFIG_FEATURE_ROAM_DEBUG) += -DFEATURE_ROAM_DEBUG
@@ -3244,7 +3251,6 @@ endif
 endif
 
 cppflags-$(CONFIG_FEATURE_SKB_PRE_ALLOC) += -DFEATURE_SKB_PRE_ALLOC
-cppflags-$(CONFIG_WCNSS_MEM_PRE_ALLOC) += -DCONFIG_WCNSS_MEM_PRE_ALLOC
 
 #Enable USB specific APIS
 ifeq ($(CONFIG_HIF_USB), y)

+ 6 - 0
configs/default_defconfig

@@ -156,6 +156,12 @@ endif
 ifeq ($(CONFIG_CNSS_GENL), m)
 	CONFIG_CNSS_GENL_MODULE := y
 endif
+ifeq ($(CONFIG_CNSS_UTILS), m)
+	CONFIG_CNSS_UTILS_MODULE := y
+endif
+ifeq ($(CONFIG_WCNSS_MEM_PRE_ALLOC), m)
+	CONFIG_WCNSS_MEM_PRE_ALLOC_MODULE := y
+endif
 
 ifeq (y,$(findstring y,$(CONFIG_ICNSS) $(CONFIG_ICNSS_MODULE)))
 	CONFIG_ROME_IF = snoc

+ 3 - 3
core/pld/inc/pld_common.h

@@ -24,7 +24,7 @@
 #include <linux/pm.h>
 #include <osapi_linux.h>
 
-#if IS_ENABLED(CONFIG_CNSS_UTILS)
+#ifdef CNSS_UTILS
 #include <net/cnss_utils.h>
 #endif
 
@@ -39,7 +39,7 @@
 
 #define TOTAL_DUMP_SIZE         0x00200000
 
-#if IS_ENABLED(CONFIG_WCNSS_MEM_PRE_ALLOC)
+#ifdef CNSS_MEM_PRE_ALLOC
 #include <net/cnss_prealloc.h>
 #endif
 
@@ -969,7 +969,7 @@ void pld_thermal_unregister(struct device *dev, int mon_id);
 int pld_get_thermal_state(struct device *dev, unsigned long *thermal_state,
 			  int mon_id);
 
-#if IS_ENABLED(CONFIG_WCNSS_MEM_PRE_ALLOC) && defined(FEATURE_SKB_PRE_ALLOC)
+#if defined(CNSS_MEM_PRE_ALLOC) && defined(FEATURE_SKB_PRE_ALLOC)
 
 /**
  * pld_nbuf_pre_alloc() - get allocated nbuf from platform driver.