blob: d0b6fbc1aa6bd8eba1d60785249eade2c03f4eb8 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001# Android makefile for the WLAN Module
2
3# Assume no targets will be supported
4WLAN_CHIPSET :=
5
6ifeq ($(BOARD_HAS_QCOM_WLAN), true)
7
Yue Ma1e382ff2016-04-21 12:04:26 -07008# Check if this driver needs be built for current target
9ifneq ($(findstring qca_cld3,$(WIFI_DRIVER_BUILT)),)
Satish Singhfbb9b372015-11-25 19:57:38 -080010 WLAN_CHIPSET := qca_cld3
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080011 WLAN_SELECT := CONFIG_QCA_CLD_WLAN=m
Yue Ma1e382ff2016-04-21 12:04:26 -070012endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080013
14# Build/Package only in case of supported target
15ifneq ($(WLAN_CHIPSET),)
16
17LOCAL_PATH := $(call my-dir)
18
19# This makefile is only for DLKM
20ifneq ($(findstring vendor,$(LOCAL_PATH)),)
21
22ifneq ($(findstring opensource,$(LOCAL_PATH)),)
Sameer Thalappilba309e12017-04-04 16:18:59 -070023 WLAN_BLD_DIR := $(ANDROID_BUILD_TOP)/vendor/qcom/opensource/wlan
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080024endif # opensource
25
26# DLKM_DIR was moved for JELLY_BEAN (PLATFORM_SDK 16)
27ifeq ($(call is-platform-sdk-version-at-least,16),true)
Yue Ma1e382ff2016-04-21 12:04:26 -070028 DLKM_DIR := $(TOP)/device/qcom/common/dlkm
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080029else
Yue Ma1e382ff2016-04-21 12:04:26 -070030 DLKM_DIR := build/dlkm
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080031endif # platform-sdk-version
32
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080033# Build wlan.ko as $(WLAN_CHIPSET)_wlan.ko
34###########################################################
35# This is set once per LOCAL_PATH, not per (kernel) module
Sameer Thalappilba309e12017-04-04 16:18:59 -070036KBUILD_OPTIONS := WLAN_ROOT=$(WLAN_BLD_DIR)/qcacld-3.0
Yue Ma188f59a2016-04-20 12:46:03 -070037KBUILD_OPTIONS += WLAN_COMMON_ROOT=../qca-wifi-host-cmn
Sameer Thalappilba309e12017-04-04 16:18:59 -070038KBUILD_OPTIONS += WLAN_COMMON_INC=$(WLAN_BLD_DIR)/qca-wifi-host-cmn
Prakash Dhavali08abad62016-04-11 23:41:47 -070039
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080040# 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.
44KBUILD_OPTIONS += MODNAME=wlan
45KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)
46KBUILD_OPTIONS += $(WLAN_SELECT)
47
48include $(CLEAR_VARS)
Prakash Dhavali08abad62016-04-11 23:41:47 -070049LOCAL_MODULE := $(WLAN_CHIPSET)_wlan.ko
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080050LOCAL_MODULE_KBUILD_NAME := wlan.ko
51LOCAL_MODULE_TAGS := debug
52LOCAL_MODULE_DEBUG_ENABLE := true
Sameer Thalappil64271512017-07-12 16:36:04 -070053ifeq ($(PRODUCT_VENDOR_MOVE_ENABLED),true)
54 ifeq ($(WIFI_DRIVER_INSTALL_TO_KERNEL_OUT),true)
55 LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
56 else
Sameer Thalappilb4d7b212017-07-18 09:07:09 -070057 LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/lib/modules/$(WLAN_CHIPSET)
Sameer Thalappil64271512017-07-12 16:36:04 -070058 endif
59else
60 LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/modules/$(WLAN_CHIPSET)
61endif
62
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080063include $(DLKM_DIR)/AndroidKernelModule.mk
64###########################################################
65
66# Create Symbolic link
Yue Ma1e382ff2016-04-21 12:04:26 -070067ifneq ($(findstring $(WLAN_CHIPSET),$(WIFI_DRIVER_DEFAULT)),)
Sameer Thalappil64271512017-07-12 16:36:04 -070068ifeq ($(PRODUCT_VENDOR_MOVE_ENABLED),true)
69ifneq ($(WIFI_DRIVER_INSTALL_TO_KERNEL_OUT),)
70$(shell mkdir -p $(TARGET_OUT_VENDOR)/lib/modules; \
Rajiv Ranjan11f3a572017-07-18 12:20:56 +053071 ln -sf /$(TARGET_COPY_OUT_VENDOR)/lib/modules/$(WLAN_CHIPSET)/$(LOCAL_MODULE) $(TARGET_OUT_VENDOR)/lib/modules/wlan.ko)
Sameer Thalappil64271512017-07-12 16:36:04 -070072endif
73else
Yue Ma1e382ff2016-04-21 12:04:26 -070074$(shell mkdir -p $(TARGET_OUT)/lib/modules; \
75 ln -sf /system/lib/modules/$(WLAN_CHIPSET)/$(LOCAL_MODULE) $(TARGET_OUT)/lib/modules/wlan.ko)
76endif
Sameer Thalappil64271512017-07-12 16:36:04 -070077endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080078
Sameer Thalappil64271512017-07-12 16:36:04 -070079ifeq ($(PRODUCT_VENDOR_MOVE_ENABLED),true)
80$(shell ln -sf /persist/wlan_mac.bin $(TARGET_OUT_VENDOR)/firmware/wlan/qca_cld/wlan_mac.bin)
81else
82$(shell ln -sf /persist/wlan_mac.bin $(TARGET_OUT_ETC)/firmware/wlan/qca_cld/wlan_mac.bin)
83endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080084endif # DLKM check
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080085endif # supported target check
86endif # WLAN enabled check