Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | # Android makefile for the WLAN Module |
| 2 | |
| 3 | # Assume no targets will be supported |
| 4 | WLAN_CHIPSET := |
| 5 | |
| 6 | ifeq ($(BOARD_HAS_QCOM_WLAN), true) |
| 7 | |
Yue Ma | 1e382ff | 2016-04-21 12:04:26 -0700 | [diff] [blame] | 8 | # Check if this driver needs be built for current target |
| 9 | ifneq ($(findstring qca_cld3,$(WIFI_DRIVER_BUILT)),) |
Satish Singh | fbb9b37 | 2015-11-25 19:57:38 -0800 | [diff] [blame] | 10 | WLAN_CHIPSET := qca_cld3 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11 | WLAN_SELECT := CONFIG_QCA_CLD_WLAN=m |
Yue Ma | 1e382ff | 2016-04-21 12:04:26 -0700 | [diff] [blame] | 12 | endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 13 | |
| 14 | # Build/Package only in case of supported target |
| 15 | ifneq ($(WLAN_CHIPSET),) |
| 16 | |
| 17 | LOCAL_PATH := $(call my-dir) |
| 18 | |
| 19 | # This makefile is only for DLKM |
| 20 | ifneq ($(findstring vendor,$(LOCAL_PATH)),) |
| 21 | |
| 22 | ifneq ($(findstring opensource,$(LOCAL_PATH)),) |
Sameer Thalappil | ba309e1 | 2017-04-04 16:18:59 -0700 | [diff] [blame] | 23 | WLAN_BLD_DIR := $(ANDROID_BUILD_TOP)/vendor/qcom/opensource/wlan |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 24 | endif # opensource |
| 25 | |
| 26 | # DLKM_DIR was moved for JELLY_BEAN (PLATFORM_SDK 16) |
| 27 | ifeq ($(call is-platform-sdk-version-at-least,16),true) |
Yue Ma | 1e382ff | 2016-04-21 12:04:26 -0700 | [diff] [blame] | 28 | DLKM_DIR := $(TOP)/device/qcom/common/dlkm |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 29 | else |
Yue Ma | 1e382ff | 2016-04-21 12:04:26 -0700 | [diff] [blame] | 30 | DLKM_DIR := build/dlkm |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 31 | endif # platform-sdk-version |
| 32 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 33 | # Build wlan.ko as $(WLAN_CHIPSET)_wlan.ko |
| 34 | ########################################################### |
| 35 | # This is set once per LOCAL_PATH, not per (kernel) module |
Sameer Thalappil | ba309e1 | 2017-04-04 16:18:59 -0700 | [diff] [blame] | 36 | KBUILD_OPTIONS := WLAN_ROOT=$(WLAN_BLD_DIR)/qcacld-3.0 |
Yue Ma | 188f59a | 2016-04-20 12:46:03 -0700 | [diff] [blame] | 37 | KBUILD_OPTIONS += WLAN_COMMON_ROOT=../qca-wifi-host-cmn |
Sameer Thalappil | ba309e1 | 2017-04-04 16:18:59 -0700 | [diff] [blame] | 38 | KBUILD_OPTIONS += WLAN_COMMON_INC=$(WLAN_BLD_DIR)/qca-wifi-host-cmn |
Prakash Dhavali | 08abad6 | 2016-04-11 23:41:47 -0700 | [diff] [blame] | 39 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 40 | # We are actually building wlan.ko here, as per the |
| 41 | # requirement we are specifying <chipset>_wlan.ko as LOCAL_MODULE. |
| 42 | # This means we need to rename the module to <chipset>_wlan.ko |
| 43 | # after wlan.ko is built. |
| 44 | KBUILD_OPTIONS += MODNAME=wlan |
| 45 | KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) |
| 46 | KBUILD_OPTIONS += $(WLAN_SELECT) |
| 47 | |
| 48 | include $(CLEAR_VARS) |
Prakash Dhavali | 08abad6 | 2016-04-11 23:41:47 -0700 | [diff] [blame] | 49 | LOCAL_MODULE := $(WLAN_CHIPSET)_wlan.ko |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 50 | LOCAL_MODULE_KBUILD_NAME := wlan.ko |
| 51 | LOCAL_MODULE_TAGS := debug |
| 52 | LOCAL_MODULE_DEBUG_ENABLE := true |
Sameer Thalappil | 6427151 | 2017-07-12 16:36:04 -0700 | [diff] [blame] | 53 | ifeq ($(PRODUCT_VENDOR_MOVE_ENABLED),true) |
| 54 | ifeq ($(WIFI_DRIVER_INSTALL_TO_KERNEL_OUT),true) |
| 55 | LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) |
| 56 | else |
Sameer Thalappil | b4d7b21 | 2017-07-18 09:07:09 -0700 | [diff] [blame] | 57 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/lib/modules/$(WLAN_CHIPSET) |
Sameer Thalappil | 6427151 | 2017-07-12 16:36:04 -0700 | [diff] [blame] | 58 | endif |
| 59 | else |
| 60 | LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/modules/$(WLAN_CHIPSET) |
| 61 | endif |
| 62 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 63 | include $(DLKM_DIR)/AndroidKernelModule.mk |
| 64 | ########################################################### |
| 65 | |
| 66 | # Create Symbolic link |
Yue Ma | 1e382ff | 2016-04-21 12:04:26 -0700 | [diff] [blame] | 67 | ifneq ($(findstring $(WLAN_CHIPSET),$(WIFI_DRIVER_DEFAULT)),) |
Sameer Thalappil | 6427151 | 2017-07-12 16:36:04 -0700 | [diff] [blame] | 68 | ifeq ($(PRODUCT_VENDOR_MOVE_ENABLED),true) |
| 69 | ifneq ($(WIFI_DRIVER_INSTALL_TO_KERNEL_OUT),) |
| 70 | $(shell mkdir -p $(TARGET_OUT_VENDOR)/lib/modules; \ |
Rajiv Ranjan | 11f3a57 | 2017-07-18 12:20:56 +0530 | [diff] [blame] | 71 | ln -sf /$(TARGET_COPY_OUT_VENDOR)/lib/modules/$(WLAN_CHIPSET)/$(LOCAL_MODULE) $(TARGET_OUT_VENDOR)/lib/modules/wlan.ko) |
Sameer Thalappil | 6427151 | 2017-07-12 16:36:04 -0700 | [diff] [blame] | 72 | endif |
| 73 | else |
Yue Ma | 1e382ff | 2016-04-21 12:04:26 -0700 | [diff] [blame] | 74 | $(shell mkdir -p $(TARGET_OUT)/lib/modules; \ |
| 75 | ln -sf /system/lib/modules/$(WLAN_CHIPSET)/$(LOCAL_MODULE) $(TARGET_OUT)/lib/modules/wlan.ko) |
| 76 | endif |
Sameer Thalappil | 6427151 | 2017-07-12 16:36:04 -0700 | [diff] [blame] | 77 | endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 78 | |
Sameer Thalappil | 6427151 | 2017-07-12 16:36:04 -0700 | [diff] [blame] | 79 | ifeq ($(PRODUCT_VENDOR_MOVE_ENABLED),true) |
| 80 | $(shell ln -sf /persist/wlan_mac.bin $(TARGET_OUT_VENDOR)/firmware/wlan/qca_cld/wlan_mac.bin) |
| 81 | else |
| 82 | $(shell ln -sf /persist/wlan_mac.bin $(TARGET_OUT_ETC)/firmware/wlan/qca_cld/wlan_mac.bin) |
| 83 | endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 84 | endif # DLKM check |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 85 | endif # supported target check |
| 86 | endif # WLAN enabled check |