blob: 5ed9e918419abd57af3fad4714f6d6022edcafd6 [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
Jeff Johnsonccf1b2d2013-10-01 12:02:53 -07003# Assume no targets will be supported
4WLAN_CHIPSET :=
5
Gopichand Nakkala649976b2013-01-04 12:08:05 -08006# Build/Package options for 8960 target
AUDITYA BHATTARAM1c715a02013-11-26 02:19:37 +05307ifeq ($(TARGET_BOARD_PLATFORM),msm8960)
Gopichand Nakkala649976b2013-01-04 12:08:05 -08008WLAN_CHIPSET := prima
9WLAN_SELECT := CONFIG_PRIMA_WLAN=m
10endif
11
Gopichand Nakkalaf0b2a742013-04-08 14:29:57 -070012# Build/Package options for 8974, 8226, 8610 targets
AUDITYA BHATTARAM1c715a02013-11-26 02:19:37 +053013ifneq (,$(filter msm8974 msm8226 msm8610,$(TARGET_BOARD_PLATFORM)))
Gopichand Nakkala649976b2013-01-04 12:08:05 -080014WLAN_CHIPSET := pronto
15WLAN_SELECT := CONFIG_PRONTO_WLAN=m
16endif
17
18# Build/Package only in case of supported target
19ifneq ($(WLAN_CHIPSET),)
Jeff Johnson9f706b62012-12-01 12:42:42 -080020
21LOCAL_PATH := $(call my-dir)
22
23# This makefile is only for DLKM
24ifneq ($(findstring vendor,$(LOCAL_PATH)),)
25
Gopichand Nakkala649976b2013-01-04 12:08:05 -080026# Determine if we are Proprietary or Open Source
27ifneq ($(findstring opensource,$(LOCAL_PATH)),)
28 WLAN_PROPRIETARY := 0
29else
30 WLAN_PROPRIETARY := 1
31endif
32
33ifeq ($(WLAN_PROPRIETARY),1)
34 WLAN_BLD_DIR := vendor/qcom/proprietary/wlan
35else
36 WLAN_BLD_DIR := vendor/qcom/opensource/wlan
37endif
Jeff Johnson9f706b62012-12-01 12:42:42 -080038
Jeff Johnson0d9ae262013-09-21 12:27:59 -070039# DLKM_DIR was moved for JELLY_BEAN (PLATFORM_SDK 16)
AUDITYA BHATTARAM1c715a02013-11-26 02:19:37 +053040ifeq (1,$(filter 1,$(shell echo "$$(( $(PLATFORM_SDK_VERSION) >= 16 ))" )))
Jeff Johnson9f706b62012-12-01 12:42:42 -080041 DLKM_DIR := $(TOP)/device/qcom/common/dlkm
42else
43 DLKM_DIR := build/dlkm
44endif
45
Rashmi Ramanna75512e32014-02-10 13:04:42 +053046# Copy WCNSS_cfg.dat file from firmware_bin/ folder to target out directory.
47$(shell rm -f $(TARGET_OUT_ETC)/firmware/wlan/prima/WCNSS_cfg.dat)
48$(shell cp $(LOCAL_PATH)/firmware_bin/WCNSS_cfg.dat $(TARGET_OUT_ETC)/firmware/wlan/prima)
Gopichand Nakkala649976b2013-01-04 12:08:05 -080049
50# Build wlan.ko as either prima_wlan.ko or pronto_wlan.ko
Jeff Johnson9f706b62012-12-01 12:42:42 -080051###########################################################
52
53# This is set once per LOCAL_PATH, not per (kernel) module
Gopichand Nakkala649976b2013-01-04 12:08:05 -080054KBUILD_OPTIONS := WLAN_ROOT=../$(WLAN_BLD_DIR)/prima
Jeff Johnson9f706b62012-12-01 12:42:42 -080055# We are actually building wlan.ko here, as per the
Gopichand Nakkala649976b2013-01-04 12:08:05 -080056# requirement we are specifying <chipset>_wlan.ko as LOCAL_MODULE.
57# This means we need to rename the module to <chipset>_wlan.ko
Jeff Johnson9f706b62012-12-01 12:42:42 -080058# after wlan.ko is built.
59KBUILD_OPTIONS += MODNAME=wlan
60KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)
Gopichand Nakkala649976b2013-01-04 12:08:05 -080061KBUILD_OPTIONS += $(WLAN_SELECT)
Jeff Johnson9f706b62012-12-01 12:42:42 -080062
Sameer Thalappil0874faf2013-01-22 15:39:29 -080063
64VERSION=$(shell grep -w "VERSION =" $(TOP)/kernel/Makefile | sed 's/^VERSION = //' )
65PATCHLEVEL=$(shell grep -w "PATCHLEVEL =" $(TOP)/kernel/Makefile | sed 's/^PATCHLEVEL = //' )
66
Sameer Thalappil0874faf2013-01-22 15:39:29 -080067include $(CLEAR_VARS)
68LOCAL_MODULE := $(WLAN_CHIPSET)_wlan.ko
69LOCAL_MODULE_KBUILD_NAME := wlan.ko
70LOCAL_MODULE_TAGS := debug
71LOCAL_MODULE_DEBUG_ENABLE := true
72LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/modules/$(WLAN_CHIPSET)
73include $(DLKM_DIR)/AndroidKernelModule.mk
Jeff Johnson9f706b62012-12-01 12:42:42 -080074###########################################################
75
76#Create symbolic link
77$(shell mkdir -p $(TARGET_OUT)/lib/modules; \
Gopichand Nakkala649976b2013-01-04 12:08:05 -080078 ln -sf /system/lib/modules/$(WLAN_CHIPSET)/$(WLAN_CHIPSET)_wlan.ko \
Jeff Johnson9f706b62012-12-01 12:42:42 -080079 $(TARGET_OUT)/lib/modules/wlan.ko)
80
Gopichand Nakkala649976b2013-01-04 12:08:05 -080081endif # DLKM check
82
83endif # supported target check