blob: d7cfd0c6088316006b9c50de464938e421b3f695 [file] [log] [blame]
Gopichand Nakkala649976b2013-01-04 12:08:05 -08001# Android makefile for the WLAN Module
Jeff Johnson9f706b62012-12-01 12:42:42 -08002
Gopichand Nakkala649976b2013-01-04 12:08:05 -08003# Build/Package options for 8960 target
Nagender Telkar3d406312012-12-12 13:20:58 -08004ifeq ($(call is-board-platform,msm8960),true)
Gopichand Nakkala649976b2013-01-04 12:08:05 -08005WLAN_CHIPSET := prima
6WLAN_SELECT := CONFIG_PRIMA_WLAN=m
7endif
8
Gopichand Nakkalaf0b2a742013-04-08 14:29:57 -07009# Build/Package options for 8974, 8226, 8610 targets
10ifeq ($(call is-board-platform-in-list,msm8974 msm8226 msm8610),true)
Gopichand Nakkala649976b2013-01-04 12:08:05 -080011WLAN_CHIPSET := pronto
12WLAN_SELECT := CONFIG_PRONTO_WLAN=m
13endif
14
15# Build/Package only in case of supported target
16ifneq ($(WLAN_CHIPSET),)
Jeff Johnson9f706b62012-12-01 12:42:42 -080017
18LOCAL_PATH := $(call my-dir)
19
20# This makefile is only for DLKM
21ifneq ($(findstring vendor,$(LOCAL_PATH)),)
22
Gopichand Nakkala649976b2013-01-04 12:08:05 -080023# Determine if we are Proprietary or Open Source
24ifneq ($(findstring opensource,$(LOCAL_PATH)),)
25 WLAN_PROPRIETARY := 0
26else
27 WLAN_PROPRIETARY := 1
28endif
29
30ifeq ($(WLAN_PROPRIETARY),1)
31 WLAN_BLD_DIR := vendor/qcom/proprietary/wlan
32else
33 WLAN_BLD_DIR := vendor/qcom/opensource/wlan
34endif
Jeff Johnson9f706b62012-12-01 12:42:42 -080035
36ifeq ($(call is-android-codename,JELLY_BEAN),true)
37 DLKM_DIR := $(TOP)/device/qcom/common/dlkm
38else
39 DLKM_DIR := build/dlkm
40endif
41
Gopichand Nakkala649976b2013-01-04 12:08:05 -080042ifeq ($(WLAN_PROPRIETARY),1)
43# For the proprietary driver the firmware files are handled here
44include $(CLEAR_VARS)
45LOCAL_MODULE := WCNSS_qcom_wlan_nv.bin
46LOCAL_MODULE_TAGS := optional
47LOCAL_MODULE_CLASS := ETC
48LOCAL_MODULE_PATH := $(PRODUCT_OUT)/persist
49LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE)
50include $(BUILD_PREBUILT)
Jeff Johnson9f706b62012-12-01 12:42:42 -080051
Gopichand Nakkala649976b2013-01-04 12:08:05 -080052include $(CLEAR_VARS)
53LOCAL_MODULE := WCNSS_cfg.dat
54LOCAL_MODULE_TAGS := optional
55LOCAL_MODULE_CLASS := ETC
56LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/firmware/wlan/prima
57LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE)
58include $(BUILD_PREBUILT)
59
60include $(CLEAR_VARS)
61LOCAL_MODULE := WCNSS_qcom_cfg.ini
62LOCAL_MODULE_TAGS := optional
63LOCAL_MODULE_CLASS := ETC
64LOCAL_MODULE_PATH := $(PRODUCT_OUT)/persist
65LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE)
66include $(BUILD_PREBUILT)
67
68endif
69
70# Build wlan.ko as either prima_wlan.ko or pronto_wlan.ko
Jeff Johnson9f706b62012-12-01 12:42:42 -080071###########################################################
72
73# This is set once per LOCAL_PATH, not per (kernel) module
Gopichand Nakkala649976b2013-01-04 12:08:05 -080074KBUILD_OPTIONS := WLAN_ROOT=../$(WLAN_BLD_DIR)/prima
Jeff Johnson9f706b62012-12-01 12:42:42 -080075# We are actually building wlan.ko here, as per the
Gopichand Nakkala649976b2013-01-04 12:08:05 -080076# requirement we are specifying <chipset>_wlan.ko as LOCAL_MODULE.
77# This means we need to rename the module to <chipset>_wlan.ko
Jeff Johnson9f706b62012-12-01 12:42:42 -080078# after wlan.ko is built.
79KBUILD_OPTIONS += MODNAME=wlan
80KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)
Gopichand Nakkala649976b2013-01-04 12:08:05 -080081KBUILD_OPTIONS += $(WLAN_SELECT)
Jeff Johnson9f706b62012-12-01 12:42:42 -080082
Sameer Thalappil0874faf2013-01-22 15:39:29 -080083
84VERSION=$(shell grep -w "VERSION =" $(TOP)/kernel/Makefile | sed 's/^VERSION = //' )
85PATCHLEVEL=$(shell grep -w "PATCHLEVEL =" $(TOP)/kernel/Makefile | sed 's/^PATCHLEVEL = //' )
86
Sameer Thalappil0874faf2013-01-22 15:39:29 -080087include $(CLEAR_VARS)
88LOCAL_MODULE := $(WLAN_CHIPSET)_wlan.ko
89LOCAL_MODULE_KBUILD_NAME := wlan.ko
90LOCAL_MODULE_TAGS := debug
91LOCAL_MODULE_DEBUG_ENABLE := true
92LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/modules/$(WLAN_CHIPSET)
93include $(DLKM_DIR)/AndroidKernelModule.mk
Jeff Johnson9f706b62012-12-01 12:42:42 -080094###########################################################
95
96#Create symbolic link
97$(shell mkdir -p $(TARGET_OUT)/lib/modules; \
Gopichand Nakkala649976b2013-01-04 12:08:05 -080098 ln -sf /system/lib/modules/$(WLAN_CHIPSET)/$(WLAN_CHIPSET)_wlan.ko \
Jeff Johnson9f706b62012-12-01 12:42:42 -080099 $(TARGET_OUT)/lib/modules/wlan.ko)
100
Gopichand Nakkala649976b2013-01-04 12:08:05 -0800101ifeq ($(WLAN_PROPRIETARY),1)
102$(shell mkdir -p $(TARGET_OUT_ETC)/firmware/wlan/prima; \
103 ln -sf /persist/WCNSS_qcom_wlan_nv.bin \
104 $(TARGET_OUT_ETC)/firmware/wlan/prima/WCNSS_qcom_wlan_nv.bin; \
105 ln -sf /data/misc/wifi/WCNSS_qcom_cfg.ini \
106 $(TARGET_OUT_ETC)/firmware/wlan/prima/WCNSS_qcom_cfg.ini)
Jeff Johnson9f706b62012-12-01 12:42:42 -0800107endif
Nagender Telkar3d406312012-12-12 13:20:58 -0800108
Gopichand Nakkala649976b2013-01-04 12:08:05 -0800109endif # DLKM check
110
111endif # supported target check