Просмотр исходного кода

qcacld-3.0: Support compile driver with out-of-tree CNSS drivers

When sources of CNSS family drivers are compiled out of kernel tree,
all necessary config flags will come from upper level Makefile files
like wlan.mk instead of kernel defconfig. Also module symbol file will
not be part of kernel build output directory anymore. Hence add changes
in Android.mk to handle such case in oreder to compile WLAN host driver.

Change-Id: I3f104ddb7495ca2dfb797adbc7dc982d2f24d30c
CRs-fixed: 3022579
Yue Ma 3 лет назад
Родитель
Сommit
db747806c1
1 измененных файлов с 20 добавлено и 0 удалено
  1. 20 0
      Android.mk

+ 20 - 0
Android.mk

@@ -147,6 +147,20 @@ else
 TARGET_FW_PATH := $(TARGET_OUT_ETC)/$(TARGET_FW_DIR)
 endif
 
+# WLAN_PLATFORM_KBUILD_OPTIONS should be passed from upper level Makefiles
+# like wlan.mk. It indicates sources of CNSS family drivers (cnss2, cnss_nl,
+# cnss_prealloc and cnss_utils etc.) are built out of kernel tree and it
+# should also include all necessary config flags (e.g. CONFIG_CNSS2) which
+# are originally defined from kernel Kconfig/defconfig. KBUILD_EXTRA_SYMBOLS
+# is also needed to indicate all the symbols from these drivers.
+ifneq ($(WLAN_PLATFORM_KBUILD_OPTIONS),)
+KBUILD_OPTIONS += $(foreach wlan_platform_kbuild_option, \
+		   $(WLAN_PLATFORM_KBUILD_OPTIONS), \
+		   $(wlan_platform_kbuild_option))
+
+KBUILD_OPTIONS += KBUILD_EXTRA_SYMBOLS=$(shell pwd)/$(call intermediates-dir-for,DLKM,wlan-platform-module-symvers)/Module.symvers
+endif
+
 include $(CLEAR_VARS)
 
 # Create the module
@@ -193,6 +207,12 @@ $(call wlog,"generate soft link because GENERIC_ODM_IMAGE not true")
 endif
 endif
 
+# Set dependencies so that CNSS family drivers can be compiled ahead.
+ifneq ($(WLAN_PLATFORM_KBUILD_OPTIONS),)
+LOCAL_REQUIRED_MODULES := wlan-platform-module-symvers
+LOCAL_ADDITIONAL_DEPENDENCIES += $(call intermediates-dir-for,DLKM,wlan-platform-module-symvers)/Module.symvers
+endif
+
 $(call wlog,TARGET_USES_KERNEL_PLATFORM=$(TARGET_USES_KERNEL_PLATFORM))
 ifeq ($(TARGET_USES_KERNEL_PLATFORM),true)
     include $(DLKM_DIR)/Build_external_kernelmodule.mk