Jeff Johnson | 91a420a | 2012-12-16 11:16:18 -0800 | [diff] [blame] | 1 | # Android makefile for the WLAN Module |
Jeff Johnson | 25abf4d | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 2 | |
Jeff Johnson | bc1952f | 2013-10-01 12:02:53 -0700 | [diff] [blame] | 3 | # Assume no targets will be supported |
| 4 | WLAN_CHIPSET := |
| 5 | |
Jeff Johnson | 91a420a | 2012-12-16 11:16:18 -0800 | [diff] [blame] | 6 | # Build/Package options for 8960 target |
Kiet Lam | 3e69489 | 2014-03-13 14:14:58 -0700 | [diff] [blame] | 7 | ifeq ($(TARGET_BOARD_PLATFORM),msm8960) |
Jeff Johnson | 91a420a | 2012-12-16 11:16:18 -0800 | [diff] [blame] | 8 | WLAN_CHIPSET := prima |
| 9 | WLAN_SELECT := CONFIG_PRIMA_WLAN=m |
| 10 | endif |
| 11 | |
Hardik Kantilal Patel | 3c38628 | 2015-03-20 21:36:56 +0530 | [diff] [blame] | 12 | # Build/Package options for 8916, 8974, 8226, 8610, 8909, 8952 targets |
| 13 | ifneq (,$(filter msm8916 msm8974 msm8226 msm8610 msm8909 msm8952,$(TARGET_BOARD_PLATFORM))) |
Siddharth Bhal | 4a20bbb | 2014-10-16 18:51:25 +0530 | [diff] [blame] | 14 | |
Jeff Johnson | 91a420a | 2012-12-16 11:16:18 -0800 | [diff] [blame] | 15 | WLAN_CHIPSET := pronto |
| 16 | WLAN_SELECT := CONFIG_PRONTO_WLAN=m |
| 17 | endif |
| 18 | |
| 19 | # Build/Package only in case of supported target |
| 20 | ifneq ($(WLAN_CHIPSET),) |
Jeff Johnson | 25abf4d | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 21 | |
| 22 | LOCAL_PATH := $(call my-dir) |
| 23 | |
| 24 | # This makefile is only for DLKM |
| 25 | ifneq ($(findstring vendor,$(LOCAL_PATH)),) |
| 26 | |
Gopichand Nakkala | 717dba7 | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 27 | # Determine if we are Proprietary or Open Source |
| 28 | ifneq ($(findstring opensource,$(LOCAL_PATH)),) |
| 29 | WLAN_PROPRIETARY := 0 |
| 30 | else |
| 31 | WLAN_PROPRIETARY := 1 |
| 32 | endif |
| 33 | |
| 34 | ifeq ($(WLAN_PROPRIETARY),1) |
Kiet Lam | 3e69489 | 2014-03-13 14:14:58 -0700 | [diff] [blame] | 35 | WLAN_BLD_DIR := vendor/qcom/proprietary/wlan |
Gopichand Nakkala | 717dba7 | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 36 | else |
| 37 | WLAN_BLD_DIR := vendor/qcom/opensource/wlan |
| 38 | endif |
Jeff Johnson | 25abf4d | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 39 | |
Jeff Johnson | 3ebf5ad | 2013-09-21 12:27:59 -0700 | [diff] [blame] | 40 | # DLKM_DIR was moved for JELLY_BEAN (PLATFORM_SDK 16) |
Kiet Lam | 3e69489 | 2014-03-13 14:14:58 -0700 | [diff] [blame] | 41 | ifeq (1,$(filter 1,$(shell echo "$$(( $(PLATFORM_SDK_VERSION) >= 16 ))" ))) |
Jeff Johnson | 25abf4d | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 42 | DLKM_DIR := $(TOP)/device/qcom/common/dlkm |
| 43 | else |
| 44 | DLKM_DIR := build/dlkm |
| 45 | endif |
| 46 | |
Rashmi Ramanna | e35d4f0 | 2014-02-10 13:04:42 +0530 | [diff] [blame] | 47 | # Copy WCNSS_cfg.dat file from firmware_bin/ folder to target out directory. |
Rashmi Ramanna | 4a66e31 | 2014-02-17 14:58:22 +0530 | [diff] [blame] | 48 | ifeq ($(WLAN_PROPRIETARY),0) |
| 49 | |
Rashmi Ramanna | 7bb68ab | 2014-07-01 16:59:33 +0530 | [diff] [blame] | 50 | $(shell mkdir -p $(TARGET_OUT_ETC)/firmware/wlan/prima) |
Rashmi Ramanna | e35d4f0 | 2014-02-10 13:04:42 +0530 | [diff] [blame] | 51 | $(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 Johnson | 25abf4d | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 53 | |
Rashmi Ramanna | 4a66e31 | 2014-02-17 14:58:22 +0530 | [diff] [blame] | 54 | else |
| 55 | |
| 56 | include $(CLEAR_VARS) |
| 57 | LOCAL_MODULE := WCNSS_qcom_wlan_nv.bin |
| 58 | LOCAL_MODULE_TAGS := optional |
| 59 | LOCAL_MODULE_CLASS := ETC |
| 60 | LOCAL_MODULE_PATH := $(PRODUCT_OUT)/persist |
| 61 | LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE) |
| 62 | include $(BUILD_PREBUILT) |
| 63 | |
| 64 | include $(CLEAR_VARS) |
| 65 | LOCAL_MODULE := WCNSS_cfg.dat |
| 66 | LOCAL_MODULE_TAGS := optional |
| 67 | LOCAL_MODULE_CLASS := ETC |
| 68 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/firmware/wlan/prima |
| 69 | LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE) |
| 70 | include $(BUILD_PREBUILT) |
| 71 | |
| 72 | include $(CLEAR_VARS) |
| 73 | LOCAL_MODULE := WCNSS_qcom_cfg.ini |
| 74 | LOCAL_MODULE_TAGS := optional |
| 75 | LOCAL_MODULE_CLASS := ETC |
| 76 | LOCAL_MODULE_PATH := $(PRODUCT_OUT)/persist |
| 77 | LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE) |
| 78 | include $(BUILD_PREBUILT) |
| 79 | |
| 80 | endif |
| 81 | |
Jeff Johnson | 91a420a | 2012-12-16 11:16:18 -0800 | [diff] [blame] | 82 | # Build wlan.ko as either prima_wlan.ko or pronto_wlan.ko |
Jeff Johnson | 25abf4d | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 83 | ########################################################### |
| 84 | |
| 85 | # This is set once per LOCAL_PATH, not per (kernel) module |
Jeff Johnson | 91a420a | 2012-12-16 11:16:18 -0800 | [diff] [blame] | 86 | KBUILD_OPTIONS := WLAN_ROOT=../$(WLAN_BLD_DIR)/prima |
Jeff Johnson | 25abf4d | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 87 | # We are actually building wlan.ko here, as per the |
Jeff Johnson | 91a420a | 2012-12-16 11:16:18 -0800 | [diff] [blame] | 88 | # requirement we are specifying <chipset>_wlan.ko as LOCAL_MODULE. |
| 89 | # This means we need to rename the module to <chipset>_wlan.ko |
Jeff Johnson | 25abf4d | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 90 | # after wlan.ko is built. |
| 91 | KBUILD_OPTIONS += MODNAME=wlan |
| 92 | KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) |
Jeff Johnson | 91a420a | 2012-12-16 11:16:18 -0800 | [diff] [blame] | 93 | KBUILD_OPTIONS += $(WLAN_SELECT) |
Jeff Johnson | 25abf4d | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 94 | |
Kiet Lam | 3e69489 | 2014-03-13 14:14:58 -0700 | [diff] [blame] | 95 | |
| 96 | VERSION=$(shell grep -w "VERSION =" $(TOP)/kernel/Makefile | sed 's/^VERSION = //' ) |
| 97 | PATCHLEVEL=$(shell grep -w "PATCHLEVEL =" $(TOP)/kernel/Makefile | sed 's/^PATCHLEVEL = //' ) |
| 98 | |
Jeff Johnson | 25abf4d | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 99 | include $(CLEAR_VARS) |
Kiet Lam | 3e69489 | 2014-03-13 14:14:58 -0700 | [diff] [blame] | 100 | LOCAL_MODULE := $(WLAN_CHIPSET)_wlan.ko |
Jeff Johnson | 25abf4d | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 101 | LOCAL_MODULE_KBUILD_NAME := wlan.ko |
Kiet Lam | 3e69489 | 2014-03-13 14:14:58 -0700 | [diff] [blame] | 102 | LOCAL_MODULE_TAGS := debug |
Jeff Johnson | 25abf4d | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 103 | LOCAL_MODULE_DEBUG_ENABLE := true |
Jeff Johnson | 91a420a | 2012-12-16 11:16:18 -0800 | [diff] [blame] | 104 | LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/modules/$(WLAN_CHIPSET) |
Jeff Johnson | 25abf4d | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 105 | include $(DLKM_DIR)/AndroidKernelModule.mk |
| 106 | ########################################################### |
| 107 | |
Kiet Lam | 3e69489 | 2014-03-13 14:14:58 -0700 | [diff] [blame] | 108 | #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 Johnson | 91a420a | 2012-12-16 11:16:18 -0800 | [diff] [blame] | 113 | endif # DLKM check |
Nagender Telkar | bf4ce93 | 2012-12-12 13:20:58 -0800 | [diff] [blame] | 114 | |
Jeff Johnson | 91a420a | 2012-12-16 11:16:18 -0800 | [diff] [blame] | 115 | endif # supported target check |