Smita Ghosh | 56a9bf7 | 2019-09-11 19:48:14 -0700 | [diff] [blame] | 1 | ENABLE_QCACLD := true |
| 2 | ifeq ($(TARGET_USES_QMAA), true) |
| 3 | ifneq ($(TARGET_USES_QMAA_OVERRIDE_WLAN), true) |
| 4 | ENABLE_QCACLD := false |
| 5 | else |
| 6 | ENABLE_QCACLD := true |
| 7 | endif |
| 8 | endif |
| 9 | |
| 10 | ifeq ($(ENABLE_QCACLD), true) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 11 | # Android makefile for the WLAN Module |
Yu Wang | 6c4599c | 2018-10-09 10:18:14 +0800 | [diff] [blame] | 12 | LOCAL_PATH := $(call my-dir) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 13 | |
| 14 | # Assume no targets will be supported |
| 15 | WLAN_CHIPSET := |
| 16 | |
| 17 | ifeq ($(BOARD_HAS_QCOM_WLAN), true) |
| 18 | |
Yue Ma | 1e382ff | 2016-04-21 12:04:26 -0700 | [diff] [blame] | 19 | # Check if this driver needs be built for current target |
| 20 | ifneq ($(findstring qca_cld3,$(WIFI_DRIVER_BUILT)),) |
Satish Singh | fbb9b37 | 2015-11-25 19:57:38 -0800 | [diff] [blame] | 21 | WLAN_CHIPSET := qca_cld3 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 22 | WLAN_SELECT := CONFIG_QCA_CLD_WLAN=m |
Yue Ma | 1e382ff | 2016-04-21 12:04:26 -0700 | [diff] [blame] | 23 | endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 24 | |
| 25 | # Build/Package only in case of supported target |
| 26 | ifneq ($(WLAN_CHIPSET),) |
| 27 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 28 | # This makefile is only for DLKM |
| 29 | ifneq ($(findstring vendor,$(LOCAL_PATH)),) |
| 30 | |
| 31 | ifneq ($(findstring opensource,$(LOCAL_PATH)),) |
Yuanyuan Liu | 49948f1 | 2018-10-16 12:42:28 -0700 | [diff] [blame] | 32 | WLAN_BLD_DIR := vendor/qcom/opensource/wlan |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 33 | endif # opensource |
| 34 | |
Yu Wang | 6c4599c | 2018-10-09 10:18:14 +0800 | [diff] [blame] | 35 | # Multi-ko check |
Yu Wang | 8cf2c24 | 2019-09-04 20:09:06 +0800 | [diff] [blame] | 36 | LOCAL_DEV_NAME := $(patsubst .%,%,\ |
| 37 | $(lastword $(strip $(subst /, ,$(LOCAL_PATH))))) |
Yu Wang | 6c4599c | 2018-10-09 10:18:14 +0800 | [diff] [blame] | 38 | |
| 39 | ifeq (1, $(strip $(shell expr $(words $(strip $(TARGET_WLAN_CHIP))) \>= 2))) |
Yu Wang | 7d866f6 | 2019-03-13 17:55:44 +0800 | [diff] [blame] | 40 | |
| 41 | ifeq ($(LOCAL_DEV_NAME), qcacld-3.0) |
Yu Wang | 6c4599c | 2018-10-09 10:18:14 +0800 | [diff] [blame] | 42 | LOCAL_MULTI_KO := true |
| 43 | else |
| 44 | LOCAL_MULTI_KO := false |
| 45 | endif |
Yu Wang | 7d866f6 | 2019-03-13 17:55:44 +0800 | [diff] [blame] | 46 | |
Yu Wang | 6c4599c | 2018-10-09 10:18:14 +0800 | [diff] [blame] | 47 | endif |
| 48 | |
| 49 | ifeq ($(LOCAL_MULTI_KO), true) |
| 50 | LOCAL_ANDROID_ROOT := $(shell pwd) |
| 51 | LOCAL_WLAN_BLD_DIR := $(LOCAL_ANDROID_ROOT)/$(WLAN_BLD_DIR) |
Yu Wang | 8cf2c24 | 2019-09-04 20:09:06 +0800 | [diff] [blame] | 52 | $(shell find $(LOCAL_WLAN_BLD_DIR)/qcacld-3.0/ -maxdepth 1 \ |
| 53 | -name '.*' ! -name '.git' -exec rm -rf {} +) |
Yu Wang | 6c4599c | 2018-10-09 10:18:14 +0800 | [diff] [blame] | 54 | |
| 55 | $(foreach chip, $(TARGET_WLAN_CHIP), \ |
Yu Wang | 8cf2c24 | 2019-09-04 20:09:06 +0800 | [diff] [blame] | 56 | $($(shell mkdir -p $(LOCAL_WLAN_BLD_DIR)/qcacld-3.0/.$(chip); \ |
Yu Wang | 6c4599c | 2018-10-09 10:18:14 +0800 | [diff] [blame] | 57 | ln -sf $(LOCAL_WLAN_BLD_DIR)/qca-wifi-host-cmn \ |
Yu Wang | 8cf2c24 | 2019-09-04 20:09:06 +0800 | [diff] [blame] | 58 | $(LOCAL_WLAN_BLD_DIR)/qcacld-3.0/.$(chip)/qca-wifi-host-cmn); \ |
Yu Wang | 6c4599c | 2018-10-09 10:18:14 +0800 | [diff] [blame] | 59 | $(foreach node, \ |
| 60 | $(shell find $(LOCAL_WLAN_BLD_DIR)/qcacld-3.0/ -maxdepth 1 \ |
Yu Wang | 8cf2c24 | 2019-09-04 20:09:06 +0800 | [diff] [blame] | 61 | ! -name '.*' ! -name '*~' \ |
Yu Wang | 6c4599c | 2018-10-09 10:18:14 +0800 | [diff] [blame] | 62 | ! -name '.' ! -name 'qcacld-3.0'), \ |
| 63 | $(shell ln -sf $(node) \ |
Yu Wang | 8cf2c24 | 2019-09-04 20:09:06 +0800 | [diff] [blame] | 64 | $(LOCAL_WLAN_BLD_DIR)/qcacld-3.0/.$(chip)/$(lastword $(strip $(subst /, ,$(node)))) \ |
Yu Wang | 6c4599c | 2018-10-09 10:18:14 +0800 | [diff] [blame] | 65 | )))) |
| 66 | |
Yu Wang | 8cf2c24 | 2019-09-04 20:09:06 +0800 | [diff] [blame] | 67 | include $(foreach chip, $(TARGET_WLAN_CHIP), $(LOCAL_PATH)/.$(chip)/Android.mk) |
Yu Wang | 6c4599c | 2018-10-09 10:18:14 +0800 | [diff] [blame] | 68 | |
| 69 | else # Multi-ok check |
| 70 | |
Yu Wang | 7d866f6 | 2019-03-13 17:55:44 +0800 | [diff] [blame] | 71 | ifeq ($(LOCAL_DEV_NAME), qcacld-3.0) |
| 72 | |
| 73 | LOCAL_DEV_NAME := wlan |
Yu Wang | 6c4599c | 2018-10-09 10:18:14 +0800 | [diff] [blame] | 74 | LOCAL_MOD_NAME := wlan |
| 75 | CMN_OFFSET := .. |
| 76 | LOCAL_SRC_DIR := |
| 77 | WLAN_PROFILE := default |
| 78 | TARGET_FW_DIR := firmware/wlan/qca_cld |
| 79 | TARGET_CFG_PATH := /vendor/etc/wifi |
| 80 | TARGET_MAC_BIN_PATH := /mnt/vendor/persist |
Yu Wang | 7d866f6 | 2019-03-13 17:55:44 +0800 | [diff] [blame] | 81 | |
Yu Wang | 6c4599c | 2018-10-09 10:18:14 +0800 | [diff] [blame] | 82 | else |
Yu Wang | 7d866f6 | 2019-03-13 17:55:44 +0800 | [diff] [blame] | 83 | |
Yu Wang | 8cf2c24 | 2019-09-04 20:09:06 +0800 | [diff] [blame] | 84 | LOCAL_SRC_DIR := .$(LOCAL_DEV_NAME) |
Yu Wang | 6c4599c | 2018-10-09 10:18:14 +0800 | [diff] [blame] | 85 | CMN_OFFSET := . |
Yu Wang | 7d866f6 | 2019-03-13 17:55:44 +0800 | [diff] [blame] | 86 | WLAN_PROFILE := $(LOCAL_DEV_NAME) |
| 87 | TARGET_FW_DIR := firmware/wlan/qca_cld/$(LOCAL_DEV_NAME) |
| 88 | TARGET_CFG_PATH := /vendor/etc/wifi/$(LOCAL_DEV_NAME) |
| 89 | TARGET_MAC_BIN_PATH := /mnt/vendor/persist/$(LOCAL_DEV_NAME) |
| 90 | |
| 91 | ifneq ($(TARGET_MULTI_WLAN), true) |
| 92 | LOCAL_MOD_NAME := wlan |
| 93 | DYNAMIC_SINGLE_CHIP := $(LOCAL_DEV_NAME) |
| 94 | else |
| 95 | LOCAL_MOD_NAME := $(LOCAL_DEV_NAME) |
| 96 | endif |
| 97 | |
Yu Wang | 6c4599c | 2018-10-09 10:18:14 +0800 | [diff] [blame] | 98 | endif |
| 99 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 100 | # DLKM_DIR was moved for JELLY_BEAN (PLATFORM_SDK 16) |
| 101 | ifeq ($(call is-platform-sdk-version-at-least,16),true) |
Yue Ma | 1e382ff | 2016-04-21 12:04:26 -0700 | [diff] [blame] | 102 | DLKM_DIR := $(TOP)/device/qcom/common/dlkm |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 103 | else |
Yue Ma | 1e382ff | 2016-04-21 12:04:26 -0700 | [diff] [blame] | 104 | DLKM_DIR := build/dlkm |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 105 | endif # platform-sdk-version |
| 106 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 107 | # Build wlan.ko as $(WLAN_CHIPSET)_wlan.ko |
| 108 | ########################################################### |
| 109 | # This is set once per LOCAL_PATH, not per (kernel) module |
Yu Wang | 6c4599c | 2018-10-09 10:18:14 +0800 | [diff] [blame] | 110 | KBUILD_OPTIONS := WLAN_ROOT=$(WLAN_BLD_DIR)/qcacld-3.0/$(LOCAL_SRC_DIR) |
| 111 | KBUILD_OPTIONS += WLAN_COMMON_ROOT=$(CMN_OFFSET)/qca-wifi-host-cmn |
Sameer Thalappil | ba309e1 | 2017-04-04 16:18:59 -0700 | [diff] [blame] | 112 | KBUILD_OPTIONS += WLAN_COMMON_INC=$(WLAN_BLD_DIR)/qca-wifi-host-cmn |
Yu Wang | 6c4599c | 2018-10-09 10:18:14 +0800 | [diff] [blame] | 113 | KBUILD_OPTIONS += WLAN_FW_API=$(WLAN_BLD_DIR)/fw-api |
| 114 | KBUILD_OPTIONS += WLAN_PROFILE=$(WLAN_PROFILE) |
Yu Wang | 7d866f6 | 2019-03-13 17:55:44 +0800 | [diff] [blame] | 115 | KBUILD_OPTIONS += DYNAMIC_SINGLE_CHIP=$(DYNAMIC_SINGLE_CHIP) |
Prakash Dhavali | 08abad6 | 2016-04-11 23:41:47 -0700 | [diff] [blame] | 116 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 117 | # We are actually building wlan.ko here, as per the |
| 118 | # requirement we are specifying <chipset>_wlan.ko as LOCAL_MODULE. |
| 119 | # This means we need to rename the module to <chipset>_wlan.ko |
| 120 | # after wlan.ko is built. |
Yu Wang | 6c4599c | 2018-10-09 10:18:14 +0800 | [diff] [blame] | 121 | KBUILD_OPTIONS += MODNAME=$(LOCAL_MOD_NAME) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 122 | KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) |
| 123 | KBUILD_OPTIONS += $(WLAN_SELECT) |
| 124 | |
Yu Wang | baff800 | 2019-08-08 19:48:16 +0800 | [diff] [blame] | 125 | ifneq ($(WLAN_CFG_OVERRIDE_$(LOCAL_DEV_NAME)),) |
| 126 | KBUILD_OPTIONS += WLAN_CFG_OVERRIDE="$(WLAN_CFG_OVERRIDE_$(LOCAL_DEV_NAME))" |
| 127 | endif |
| 128 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 129 | include $(CLEAR_VARS) |
Yu Wang | 7d866f6 | 2019-03-13 17:55:44 +0800 | [diff] [blame] | 130 | LOCAL_MODULE := $(WLAN_CHIPSET)_$(LOCAL_DEV_NAME).ko |
Yu Wang | 6c4599c | 2018-10-09 10:18:14 +0800 | [diff] [blame] | 131 | LOCAL_MODULE_KBUILD_NAME := $(LOCAL_MOD_NAME).ko |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 132 | LOCAL_MODULE_DEBUG_ENABLE := true |
Sameer Thalappil | 6427151 | 2017-07-12 16:36:04 -0700 | [diff] [blame] | 133 | ifeq ($(PRODUCT_VENDOR_MOVE_ENABLED),true) |
| 134 | ifeq ($(WIFI_DRIVER_INSTALL_TO_KERNEL_OUT),true) |
| 135 | LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) |
| 136 | else |
Sameer Thalappil | b4d7b21 | 2017-07-18 09:07:09 -0700 | [diff] [blame] | 137 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/lib/modules/$(WLAN_CHIPSET) |
Sameer Thalappil | 6427151 | 2017-07-12 16:36:04 -0700 | [diff] [blame] | 138 | endif |
| 139 | else |
| 140 | LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/modules/$(WLAN_CHIPSET) |
| 141 | endif |
| 142 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 143 | include $(DLKM_DIR)/AndroidKernelModule.mk |
| 144 | ########################################################### |
| 145 | |
| 146 | # Create Symbolic link |
Yue Ma | 1e382ff | 2016-04-21 12:04:26 -0700 | [diff] [blame] | 147 | ifneq ($(findstring $(WLAN_CHIPSET),$(WIFI_DRIVER_DEFAULT)),) |
Sameer Thalappil | 6427151 | 2017-07-12 16:36:04 -0700 | [diff] [blame] | 148 | ifeq ($(PRODUCT_VENDOR_MOVE_ENABLED),true) |
| 149 | ifneq ($(WIFI_DRIVER_INSTALL_TO_KERNEL_OUT),) |
| 150 | $(shell mkdir -p $(TARGET_OUT_VENDOR)/lib/modules; \ |
Yu Wang | 7d866f6 | 2019-03-13 17:55:44 +0800 | [diff] [blame] | 151 | ln -sf /$(TARGET_COPY_OUT_VENDOR)/lib/modules/$(WLAN_CHIPSET)/$(LOCAL_MODULE) $(TARGET_OUT_VENDOR)/lib/modules/$(LOCAL_MODULE)) |
Sameer Thalappil | 6427151 | 2017-07-12 16:36:04 -0700 | [diff] [blame] | 152 | endif |
| 153 | else |
Yue Ma | 1e382ff | 2016-04-21 12:04:26 -0700 | [diff] [blame] | 154 | $(shell mkdir -p $(TARGET_OUT)/lib/modules; \ |
Yu Wang | 7d866f6 | 2019-03-13 17:55:44 +0800 | [diff] [blame] | 155 | ln -sf /system/lib/modules/$(WLAN_CHIPSET)/$(LOCAL_MODULE) $(TARGET_OUT)/lib/modules/$(LOCAL_MODULE)) |
Yue Ma | 1e382ff | 2016-04-21 12:04:26 -0700 | [diff] [blame] | 156 | endif |
Sameer Thalappil | 6427151 | 2017-07-12 16:36:04 -0700 | [diff] [blame] | 157 | endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 158 | |
Sameer Thalappil | 6427151 | 2017-07-12 16:36:04 -0700 | [diff] [blame] | 159 | ifeq ($(PRODUCT_VENDOR_MOVE_ENABLED),true) |
Yu Wang | 6c4599c | 2018-10-09 10:18:14 +0800 | [diff] [blame] | 160 | TARGET_FW_PATH := $(TARGET_OUT_VENDOR)/$(TARGET_FW_DIR) |
Sameer Thalappil | 6427151 | 2017-07-12 16:36:04 -0700 | [diff] [blame] | 161 | else |
Yu Wang | 6c4599c | 2018-10-09 10:18:14 +0800 | [diff] [blame] | 162 | TARGET_FW_PATH := $(TARGET_OUT_ETC)/$(TARGET_FW_DIR) |
Sameer Thalappil | 6427151 | 2017-07-12 16:36:04 -0700 | [diff] [blame] | 163 | endif |
Yu Wang | 6c4599c | 2018-10-09 10:18:14 +0800 | [diff] [blame] | 164 | |
| 165 | $(shell mkdir -p $(TARGET_FW_PATH); \ |
| 166 | ln -sf $(TARGET_MAC_BIN_PATH)/wlan_mac.bin $(TARGET_FW_PATH)/wlan_mac.bin; \ |
| 167 | ln -sf $(TARGET_CFG_PATH)/WCNSS_qcom_cfg.ini $(TARGET_FW_PATH)/WCNSS_qcom_cfg.ini) |
| 168 | |
| 169 | endif # Multi-ko check |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 170 | endif # DLKM check |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 171 | endif # supported target check |
| 172 | endif # WLAN enabled check |
Smita Ghosh | 56a9bf7 | 2019-09-11 19:48:14 -0700 | [diff] [blame] | 173 | endif # ENABLE_QCACLD |