Android.mk 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # Android makefile for the WLAN Module
  2. # Assume no targets will be supported
  3. WLAN_CHIPSET :=
  4. ifeq ($(BOARD_HAS_QCOM_WLAN), true)
  5. # Check if this driver needs be built for current target
  6. ifneq ($(findstring qca_cld3,$(WIFI_DRIVER_BUILT)),)
  7. WLAN_CHIPSET := qca_cld3
  8. WLAN_SELECT := CONFIG_QCA_CLD_WLAN=m
  9. endif
  10. # Build/Package only in case of supported target
  11. ifneq ($(WLAN_CHIPSET),)
  12. LOCAL_PATH := $(call my-dir)
  13. # This makefile is only for DLKM
  14. ifneq ($(findstring vendor,$(LOCAL_PATH)),)
  15. ifneq ($(findstring opensource,$(LOCAL_PATH)),)
  16. WLAN_BLD_DIR := $(ANDROID_BUILD_TOP)/vendor/qcom/opensource/wlan
  17. endif # opensource
  18. # DLKM_DIR was moved for JELLY_BEAN (PLATFORM_SDK 16)
  19. ifeq ($(call is-platform-sdk-version-at-least,16),true)
  20. DLKM_DIR := $(TOP)/device/qcom/common/dlkm
  21. else
  22. DLKM_DIR := build/dlkm
  23. endif # platform-sdk-version
  24. # Build wlan.ko as $(WLAN_CHIPSET)_wlan.ko
  25. ###########################################################
  26. # This is set once per LOCAL_PATH, not per (kernel) module
  27. KBUILD_OPTIONS := WLAN_ROOT=$(WLAN_BLD_DIR)/qcacld-3.0
  28. KBUILD_OPTIONS += WLAN_COMMON_ROOT=../qca-wifi-host-cmn
  29. KBUILD_OPTIONS += WLAN_COMMON_INC=$(WLAN_BLD_DIR)/qca-wifi-host-cmn
  30. # We are actually building wlan.ko here, as per the
  31. # requirement we are specifying <chipset>_wlan.ko as LOCAL_MODULE.
  32. # This means we need to rename the module to <chipset>_wlan.ko
  33. # after wlan.ko is built.
  34. KBUILD_OPTIONS += MODNAME=wlan
  35. KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)
  36. KBUILD_OPTIONS += $(WLAN_SELECT)
  37. include $(CLEAR_VARS)
  38. LOCAL_MODULE := $(WLAN_CHIPSET)_wlan.ko
  39. LOCAL_MODULE_KBUILD_NAME := wlan.ko
  40. LOCAL_MODULE_TAGS := debug
  41. LOCAL_MODULE_DEBUG_ENABLE := true
  42. LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/modules/$(WLAN_CHIPSET)
  43. include $(DLKM_DIR)/AndroidKernelModule.mk
  44. ###########################################################
  45. # Create Symbolic link
  46. ifneq ($(findstring $(WLAN_CHIPSET),$(WIFI_DRIVER_DEFAULT)),)
  47. $(shell mkdir -p $(TARGET_OUT)/lib/modules; \
  48. ln -sf /system/lib/modules/$(WLAN_CHIPSET)/$(LOCAL_MODULE) $(TARGET_OUT)/lib/modules/wlan.ko)
  49. endif
  50. $(shell ln -sf /persist/wlan_mac.bin $(TARGET_OUT_ETC)/firmware/wlan/qca_cld/wlan_mac.bin)
  51. endif # DLKM check
  52. endif # supported target check
  53. endif # WLAN enabled check