Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 1 | # Android makefile for the WLAN Module |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 2 | |
Jeff Johnson | ccf1b2d | 2013-10-01 12:02:53 -0700 | [diff] [blame] | 3 | # Assume no targets will be supported |
| 4 | WLAN_CHIPSET := |
| 5 | |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 6 | # Build/Package options for 8960 target |
AUDITYA BHATTARAM | 1c715a0 | 2013-11-26 02:19:37 +0530 | [diff] [blame] | 7 | ifeq ($(TARGET_BOARD_PLATFORM),msm8960) |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 8 | WLAN_CHIPSET := prima |
| 9 | WLAN_SELECT := CONFIG_PRIMA_WLAN=m |
| 10 | endif |
| 11 | |
Gopichand Nakkala | f0b2a74 | 2013-04-08 14:29:57 -0700 | [diff] [blame] | 12 | # Build/Package options for 8974, 8226, 8610 targets |
AUDITYA BHATTARAM | 1c715a0 | 2013-11-26 02:19:37 +0530 | [diff] [blame] | 13 | ifneq (,$(filter msm8974 msm8226 msm8610,$(TARGET_BOARD_PLATFORM))) |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 14 | WLAN_CHIPSET := pronto |
| 15 | WLAN_SELECT := CONFIG_PRONTO_WLAN=m |
| 16 | endif |
| 17 | |
| 18 | # Build/Package only in case of supported target |
| 19 | ifneq ($(WLAN_CHIPSET),) |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 20 | |
| 21 | LOCAL_PATH := $(call my-dir) |
| 22 | |
| 23 | # This makefile is only for DLKM |
| 24 | ifneq ($(findstring vendor,$(LOCAL_PATH)),) |
| 25 | |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 26 | # Determine if we are Proprietary or Open Source |
| 27 | ifneq ($(findstring opensource,$(LOCAL_PATH)),) |
| 28 | WLAN_PROPRIETARY := 0 |
| 29 | else |
| 30 | WLAN_PROPRIETARY := 1 |
| 31 | endif |
| 32 | |
| 33 | ifeq ($(WLAN_PROPRIETARY),1) |
| 34 | WLAN_BLD_DIR := vendor/qcom/proprietary/wlan |
| 35 | else |
| 36 | WLAN_BLD_DIR := vendor/qcom/opensource/wlan |
| 37 | endif |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 38 | |
Jeff Johnson | 0d9ae26 | 2013-09-21 12:27:59 -0700 | [diff] [blame] | 39 | # DLKM_DIR was moved for JELLY_BEAN (PLATFORM_SDK 16) |
AUDITYA BHATTARAM | 1c715a0 | 2013-11-26 02:19:37 +0530 | [diff] [blame] | 40 | ifeq (1,$(filter 1,$(shell echo "$$(( $(PLATFORM_SDK_VERSION) >= 16 ))" ))) |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 41 | DLKM_DIR := $(TOP)/device/qcom/common/dlkm |
| 42 | else |
| 43 | DLKM_DIR := build/dlkm |
| 44 | endif |
| 45 | |
Rashmi Ramanna | 75512e3 | 2014-02-10 13:04:42 +0530 | [diff] [blame] | 46 | # 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 Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 49 | |
| 50 | # Build wlan.ko as either prima_wlan.ko or pronto_wlan.ko |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 51 | ########################################################### |
| 52 | |
| 53 | # This is set once per LOCAL_PATH, not per (kernel) module |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 54 | KBUILD_OPTIONS := WLAN_ROOT=../$(WLAN_BLD_DIR)/prima |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 55 | # We are actually building wlan.ko here, as per the |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 56 | # requirement we are specifying <chipset>_wlan.ko as LOCAL_MODULE. |
| 57 | # This means we need to rename the module to <chipset>_wlan.ko |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 58 | # after wlan.ko is built. |
| 59 | KBUILD_OPTIONS += MODNAME=wlan |
| 60 | KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 61 | KBUILD_OPTIONS += $(WLAN_SELECT) |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 62 | |
Sameer Thalappil | 0874faf | 2013-01-22 15:39:29 -0800 | [diff] [blame] | 63 | |
| 64 | VERSION=$(shell grep -w "VERSION =" $(TOP)/kernel/Makefile | sed 's/^VERSION = //' ) |
| 65 | PATCHLEVEL=$(shell grep -w "PATCHLEVEL =" $(TOP)/kernel/Makefile | sed 's/^PATCHLEVEL = //' ) |
| 66 | |
Sameer Thalappil | 0874faf | 2013-01-22 15:39:29 -0800 | [diff] [blame] | 67 | include $(CLEAR_VARS) |
| 68 | LOCAL_MODULE := $(WLAN_CHIPSET)_wlan.ko |
| 69 | LOCAL_MODULE_KBUILD_NAME := wlan.ko |
| 70 | LOCAL_MODULE_TAGS := debug |
| 71 | LOCAL_MODULE_DEBUG_ENABLE := true |
| 72 | LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/modules/$(WLAN_CHIPSET) |
| 73 | include $(DLKM_DIR)/AndroidKernelModule.mk |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 74 | ########################################################### |
| 75 | |
| 76 | #Create symbolic link |
| 77 | $(shell mkdir -p $(TARGET_OUT)/lib/modules; \ |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 78 | ln -sf /system/lib/modules/$(WLAN_CHIPSET)/$(WLAN_CHIPSET)_wlan.ko \ |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 79 | $(TARGET_OUT)/lib/modules/wlan.ko) |
| 80 | |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 81 | endif # DLKM check |
| 82 | |
| 83 | endif # supported target check |