Android.mk 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 := 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. ifeq ($(PRODUCT_VENDOR_MOVE_ENABLED),true)
  43. ifeq ($(WIFI_DRIVER_INSTALL_TO_KERNEL_OUT),true)
  44. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  45. else
  46. LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/lib/modules/$(WLAN_CHIPSET)
  47. endif
  48. else
  49. LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/modules/$(WLAN_CHIPSET)
  50. endif
  51. include $(DLKM_DIR)/AndroidKernelModule.mk
  52. ###########################################################
  53. # Create Symbolic link
  54. ifneq ($(findstring $(WLAN_CHIPSET),$(WIFI_DRIVER_DEFAULT)),)
  55. ifeq ($(PRODUCT_VENDOR_MOVE_ENABLED),true)
  56. ifneq ($(WIFI_DRIVER_INSTALL_TO_KERNEL_OUT),)
  57. $(shell mkdir -p $(TARGET_OUT_VENDOR)/lib/modules; \
  58. ln -sf /$(TARGET_COPY_OUT_VENDOR)/lib/modules/$(WLAN_CHIPSET)/$(LOCAL_MODULE) $(TARGET_OUT_VENDOR)/lib/modules/wlan.ko)
  59. endif
  60. else
  61. $(shell mkdir -p $(TARGET_OUT)/lib/modules; \
  62. ln -sf /system/lib/modules/$(WLAN_CHIPSET)/$(LOCAL_MODULE) $(TARGET_OUT)/lib/modules/wlan.ko)
  63. endif
  64. endif
  65. ifeq ($(PRODUCT_VENDOR_MOVE_ENABLED),true)
  66. $(shell ln -sf /mnt/vendor/persist/wlan_mac.bin $(TARGET_OUT_VENDOR)/firmware/wlan/qca_cld/wlan_mac.bin)
  67. else
  68. $(shell ln -sf /mnt/vendor/persist/wlan_mac.bin $(TARGET_OUT_ETC)/firmware/wlan/qca_cld/wlan_mac.bin)
  69. endif
  70. endif # DLKM check
  71. endif # supported target check
  72. endif # WLAN enabled check