blob: 60cb1321a8c5ecd68cb3a6407f52cb60013291d7 [file] [log] [blame]
Jeff Johnson91a420a2012-12-16 11:16:18 -08001# Android makefile for the WLAN Module
Jeff Johnson25abf4d2012-12-01 12:42:42 -08002
Jeff Johnsonbc1952f2013-10-01 12:02:53 -07003# Assume no targets will be supported
4WLAN_CHIPSET :=
5
Jeff Johnson91a420a2012-12-16 11:16:18 -08006# Build/Package options for 8960 target
Kiet Lam3e694892014-03-13 14:14:58 -07007ifeq ($(TARGET_BOARD_PLATFORM),msm8960)
Jeff Johnson91a420a2012-12-16 11:16:18 -08008WLAN_CHIPSET := prima
9WLAN_SELECT := CONFIG_PRIMA_WLAN=m
10endif
11
Siddharth Bhal4a20bbb2014-10-16 18:51:25 +053012# Build/Package options for 8916, 8974, 8226, 8610, 8909 targets
13ifneq (,$(filter msm8916 msm8974 msm8226 msm8610 msm8909,$(TARGET_BOARD_PLATFORM)))
14
Jeff Johnson91a420a2012-12-16 11:16:18 -080015WLAN_CHIPSET := pronto
16WLAN_SELECT := CONFIG_PRONTO_WLAN=m
17endif
18
19# Build/Package only in case of supported target
20ifneq ($(WLAN_CHIPSET),)
Jeff Johnson25abf4d2012-12-01 12:42:42 -080021
22LOCAL_PATH := $(call my-dir)
23
24# This makefile is only for DLKM
25ifneq ($(findstring vendor,$(LOCAL_PATH)),)
26
Gopichand Nakkala717dba72013-01-04 12:08:05 -080027# Determine if we are Proprietary or Open Source
28ifneq ($(findstring opensource,$(LOCAL_PATH)),)
29 WLAN_PROPRIETARY := 0
30else
31 WLAN_PROPRIETARY := 1
32endif
33
34ifeq ($(WLAN_PROPRIETARY),1)
Kiet Lam3e694892014-03-13 14:14:58 -070035 WLAN_BLD_DIR := vendor/qcom/proprietary/wlan
Gopichand Nakkala717dba72013-01-04 12:08:05 -080036else
37 WLAN_BLD_DIR := vendor/qcom/opensource/wlan
38endif
Jeff Johnson25abf4d2012-12-01 12:42:42 -080039
Jeff Johnson3ebf5ad2013-09-21 12:27:59 -070040# DLKM_DIR was moved for JELLY_BEAN (PLATFORM_SDK 16)
Kiet Lam3e694892014-03-13 14:14:58 -070041ifeq (1,$(filter 1,$(shell echo "$$(( $(PLATFORM_SDK_VERSION) >= 16 ))" )))
Jeff Johnson25abf4d2012-12-01 12:42:42 -080042 DLKM_DIR := $(TOP)/device/qcom/common/dlkm
43else
44 DLKM_DIR := build/dlkm
45endif
46
Rashmi Ramannae35d4f02014-02-10 13:04:42 +053047# Copy WCNSS_cfg.dat file from firmware_bin/ folder to target out directory.
Rashmi Ramanna4a66e312014-02-17 14:58:22 +053048ifeq ($(WLAN_PROPRIETARY),0)
49
Rashmi Ramanna7bb68ab2014-07-01 16:59:33 +053050$(shell mkdir -p $(TARGET_OUT_ETC)/firmware/wlan/prima)
Rashmi Ramannae35d4f02014-02-10 13:04:42 +053051$(shell rm -f $(TARGET_OUT_ETC)/firmware/wlan/prima/WCNSS_cfg.dat)
52$(shell cp $(LOCAL_PATH)/firmware_bin/WCNSS_cfg.dat $(TARGET_OUT_ETC)/firmware/wlan/prima)
Jeff Johnson25abf4d2012-12-01 12:42:42 -080053
Rashmi Ramanna4a66e312014-02-17 14:58:22 +053054else
55
56include $(CLEAR_VARS)
57LOCAL_MODULE := WCNSS_qcom_wlan_nv.bin
58LOCAL_MODULE_TAGS := optional
59LOCAL_MODULE_CLASS := ETC
60LOCAL_MODULE_PATH := $(PRODUCT_OUT)/persist
61LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE)
62include $(BUILD_PREBUILT)
63
64include $(CLEAR_VARS)
65LOCAL_MODULE := WCNSS_cfg.dat
66LOCAL_MODULE_TAGS := optional
67LOCAL_MODULE_CLASS := ETC
68LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/firmware/wlan/prima
69LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE)
70include $(BUILD_PREBUILT)
71
72include $(CLEAR_VARS)
73LOCAL_MODULE := WCNSS_qcom_cfg.ini
74LOCAL_MODULE_TAGS := optional
75LOCAL_MODULE_CLASS := ETC
76LOCAL_MODULE_PATH := $(PRODUCT_OUT)/persist
77LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE)
78include $(BUILD_PREBUILT)
79
80endif
81
Jeff Johnson91a420a2012-12-16 11:16:18 -080082# Build wlan.ko as either prima_wlan.ko or pronto_wlan.ko
Jeff Johnson25abf4d2012-12-01 12:42:42 -080083###########################################################
84
85# This is set once per LOCAL_PATH, not per (kernel) module
Jeff Johnson91a420a2012-12-16 11:16:18 -080086KBUILD_OPTIONS := WLAN_ROOT=../$(WLAN_BLD_DIR)/prima
Jeff Johnson25abf4d2012-12-01 12:42:42 -080087# We are actually building wlan.ko here, as per the
Jeff Johnson91a420a2012-12-16 11:16:18 -080088# requirement we are specifying <chipset>_wlan.ko as LOCAL_MODULE.
89# This means we need to rename the module to <chipset>_wlan.ko
Jeff Johnson25abf4d2012-12-01 12:42:42 -080090# after wlan.ko is built.
91KBUILD_OPTIONS += MODNAME=wlan
92KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)
Jeff Johnson91a420a2012-12-16 11:16:18 -080093KBUILD_OPTIONS += $(WLAN_SELECT)
Jeff Johnson25abf4d2012-12-01 12:42:42 -080094
Kiet Lam3e694892014-03-13 14:14:58 -070095
96VERSION=$(shell grep -w "VERSION =" $(TOP)/kernel/Makefile | sed 's/^VERSION = //' )
97PATCHLEVEL=$(shell grep -w "PATCHLEVEL =" $(TOP)/kernel/Makefile | sed 's/^PATCHLEVEL = //' )
98
Jeff Johnson25abf4d2012-12-01 12:42:42 -080099include $(CLEAR_VARS)
Kiet Lam3e694892014-03-13 14:14:58 -0700100LOCAL_MODULE := $(WLAN_CHIPSET)_wlan.ko
Jeff Johnson25abf4d2012-12-01 12:42:42 -0800101LOCAL_MODULE_KBUILD_NAME := wlan.ko
Kiet Lam3e694892014-03-13 14:14:58 -0700102LOCAL_MODULE_TAGS := debug
Jeff Johnson25abf4d2012-12-01 12:42:42 -0800103LOCAL_MODULE_DEBUG_ENABLE := true
Jeff Johnson91a420a2012-12-16 11:16:18 -0800104LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/modules/$(WLAN_CHIPSET)
Jeff Johnson25abf4d2012-12-01 12:42:42 -0800105include $(DLKM_DIR)/AndroidKernelModule.mk
106###########################################################
107
Kiet Lam3e694892014-03-13 14:14:58 -0700108#Create symbolic link
109$(shell mkdir -p $(TARGET_OUT)/lib/modules; \
110 ln -sf /system/lib/modules/$(WLAN_CHIPSET)/$(WLAN_CHIPSET)_wlan.ko \
111 $(TARGET_OUT)/lib/modules/wlan.ko)
112
Jeff Johnson91a420a2012-12-16 11:16:18 -0800113endif # DLKM check
Nagender Telkarbf4ce932012-12-12 13:20:58 -0800114
Jeff Johnson91a420a2012-12-16 11:16:18 -0800115endif # supported target check