-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathAndroid.mk
127 lines (103 loc) · 3.98 KB
/
Android.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Android makefile for the WLAN Module
# Build/Package options for 8960 target
ifeq ($(call is-board-platform,msm8960),true)
WLAN_CHIPSET := prima
WLAN_SELECT := CONFIG_PRIMA_WLAN=m
endif
# Build/Package options for 8916 8974, 8226, 8610 targets
ifneq (,$(filter msm8916 msm8974 msm8226 msm8610,$(TARGET_BOARD_PLATFORM)))
WLAN_CHIPSET := pronto
WLAN_SELECT := CONFIG_PRONTO_WLAN=m
endif
# Build/Package only in case of supported target
ifneq ($(WLAN_CHIPSET),)
LOCAL_PATH := $(call my-dir)
# This makefile is only for DLKM
ifneq ($(findstring vendor,$(LOCAL_PATH)),)
# Determine if we are Proprietary or Open Source
ifneq ($(findstring opensource,$(LOCAL_PATH)),)
WLAN_PROPRIETARY := 0
else
WLAN_PROPRIETARY := 1
endif
ifeq ($(WLAN_PROPRIETARY),1)
WLAN_BLD_DIR := vendor/qcom/proprietary/wlan
else
WLAN_BLD_DIR := vendor/qcom/opensource/wlan
endif
# DLKM_DIR was moved for JELLY_BEAN (PLATFORM_SDK 16)
ifeq ($(call is-platform-sdk-version-at-least,16),true)
DLKM_DIR := $(TOP)/device/qcom/common/dlkm
else
DLKM_DIR := build/dlkm
endif
# Some kernel include files are being moved. Check to see if
# the old version of the files are present
INCLUDE_SELECT :=
ifneq ($(wildcard $(TOP)/kernel//arch/arm/mach-msm/include/mach/msm_smd.h),)
INCLUDE_SELECT += EXISTS_MSM_SMD=1
endif
ifneq ($(wildcard $(TOP)/kernel//arch/arm/mach-msm/include/mach/msm_smsm.h),)
INCLUDE_SELECT += EXISTS_MSM_SMSM=1
endif
# Copy WCNSS_cfg.dat file from firmware_bin/ folder to target out directory.
ifeq ($(WLAN_PROPRIETARY),0)
$(shell rm -f $(TARGET_OUT_ETC)/firmware/wlan/prima/WCNSS_cfg.dat)
$(shell cp $(LOCAL_PATH)/firmware_bin/WCNSS_cfg.dat $(TARGET_OUT_ETC)/firmware/wlan/prima)
else
# For the proprietary driver the firmware files are handled here
include $(CLEAR_VARS)
LOCAL_MODULE := WCNSS_qcom_wlan_nv.bin
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(PRODUCT_OUT)/persist
LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := WCNSS_cfg.dat
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/firmware/wlan/prima
LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := WCNSS_qcom_cfg.ini
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(PRODUCT_OUT)/persist
LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE)
include $(BUILD_PREBUILT)
endif
# Build wlan.ko as either prima_wlan.ko or pronto_wlan.ko
###########################################################
# This is set once per LOCAL_PATH, not per (kernel) module
KBUILD_OPTIONS := WLAN_ROOT=../$(WLAN_BLD_DIR)/prima
# We are actually building wlan.ko here, as per the
# requirement we are specifying <chipset>_wlan.ko as LOCAL_MODULE.
# This means we need to rename the module to <chipset>_wlan.ko
# after wlan.ko is built.
KBUILD_OPTIONS += MODNAME=wlan
KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)
KBUILD_OPTIONS += $(WLAN_SELECT)
KBUILD_OPTIONS += $(INCLUDE_SELECT)
include $(CLEAR_VARS)
LOCAL_MODULE := $(WLAN_CHIPSET)_wlan.ko
LOCAL_MODULE_KBUILD_NAME := wlan.ko
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_DEBUG_ENABLE := true
LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/modules/$(WLAN_CHIPSET)
include $(DLKM_DIR)/AndroidKernelModule.mk
###########################################################
#Create symbolic link
$(shell mkdir -p $(TARGET_OUT)/lib/modules; \
ln -sf /system/lib/modules/$(WLAN_CHIPSET)/$(WLAN_CHIPSET)_wlan.ko \
$(TARGET_OUT)/lib/modules/wlan.ko)
ifeq ($(WLAN_PROPRIETARY),1)
$(shell mkdir -p $(TARGET_OUT_ETC)/firmware/wlan/prima; \
ln -sf /persist/WCNSS_qcom_wlan_nv.bin \
$(TARGET_OUT_ETC)/firmware/wlan/prima/WCNSS_qcom_wlan_nv.bin; \
ln -sf /data/misc/wifi/WCNSS_qcom_cfg.ini \
$(TARGET_OUT_ETC)/firmware/wlan/prima/WCNSS_qcom_cfg.ini)
endif
endif # DLKM check
endif # supported target check