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 | |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 3 | # Build/Package options for 8960 target |
Nagender Telkar | 3d40631 | 2012-12-12 13:20:58 -0800 | [diff] [blame] | 4 | ifeq ($(call is-board-platform,msm8960),true) |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 5 | WLAN_CHIPSET := prima |
| 6 | WLAN_SELECT := CONFIG_PRIMA_WLAN=m |
| 7 | endif |
| 8 | |
Gopichand Nakkala | f0b2a74 | 2013-04-08 14:29:57 -0700 | [diff] [blame] | 9 | # Build/Package options for 8974, 8226, 8610 targets |
| 10 | ifeq ($(call is-board-platform-in-list,msm8974 msm8226 msm8610),true) |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 11 | WLAN_CHIPSET := pronto |
| 12 | WLAN_SELECT := CONFIG_PRONTO_WLAN=m |
| 13 | endif |
| 14 | |
| 15 | # Build/Package only in case of supported target |
| 16 | ifneq ($(WLAN_CHIPSET),) |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 17 | |
| 18 | LOCAL_PATH := $(call my-dir) |
| 19 | |
| 20 | # This makefile is only for DLKM |
| 21 | ifneq ($(findstring vendor,$(LOCAL_PATH)),) |
| 22 | |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 23 | # Determine if we are Proprietary or Open Source |
| 24 | ifneq ($(findstring opensource,$(LOCAL_PATH)),) |
| 25 | WLAN_PROPRIETARY := 0 |
| 26 | else |
| 27 | WLAN_PROPRIETARY := 1 |
| 28 | endif |
| 29 | |
| 30 | ifeq ($(WLAN_PROPRIETARY),1) |
| 31 | WLAN_BLD_DIR := vendor/qcom/proprietary/wlan |
| 32 | else |
| 33 | WLAN_BLD_DIR := vendor/qcom/opensource/wlan |
| 34 | endif |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 35 | |
| 36 | ifeq ($(call is-android-codename,JELLY_BEAN),true) |
| 37 | DLKM_DIR := $(TOP)/device/qcom/common/dlkm |
| 38 | else |
| 39 | DLKM_DIR := build/dlkm |
| 40 | endif |
| 41 | |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 42 | ifeq ($(WLAN_PROPRIETARY),1) |
| 43 | # For the proprietary driver the firmware files are handled here |
| 44 | include $(CLEAR_VARS) |
| 45 | LOCAL_MODULE := WCNSS_qcom_wlan_nv.bin |
| 46 | LOCAL_MODULE_TAGS := optional |
| 47 | LOCAL_MODULE_CLASS := ETC |
| 48 | LOCAL_MODULE_PATH := $(PRODUCT_OUT)/persist |
| 49 | LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE) |
| 50 | include $(BUILD_PREBUILT) |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 51 | |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 52 | include $(CLEAR_VARS) |
| 53 | LOCAL_MODULE := WCNSS_cfg.dat |
| 54 | LOCAL_MODULE_TAGS := optional |
| 55 | LOCAL_MODULE_CLASS := ETC |
| 56 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/firmware/wlan/prima |
| 57 | LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE) |
| 58 | include $(BUILD_PREBUILT) |
| 59 | |
| 60 | include $(CLEAR_VARS) |
| 61 | LOCAL_MODULE := WCNSS_qcom_cfg.ini |
| 62 | LOCAL_MODULE_TAGS := optional |
| 63 | LOCAL_MODULE_CLASS := ETC |
| 64 | LOCAL_MODULE_PATH := $(PRODUCT_OUT)/persist |
| 65 | LOCAL_SRC_FILES := firmware_bin/$(LOCAL_MODULE) |
| 66 | include $(BUILD_PREBUILT) |
| 67 | |
| 68 | endif |
| 69 | |
| 70 | # Build wlan.ko as either prima_wlan.ko or pronto_wlan.ko |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 71 | ########################################################### |
| 72 | |
| 73 | # This is set once per LOCAL_PATH, not per (kernel) module |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 74 | KBUILD_OPTIONS := WLAN_ROOT=../$(WLAN_BLD_DIR)/prima |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 75 | # We are actually building wlan.ko here, as per the |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 76 | # requirement we are specifying <chipset>_wlan.ko as LOCAL_MODULE. |
| 77 | # This means we need to rename the module to <chipset>_wlan.ko |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 78 | # after wlan.ko is built. |
| 79 | KBUILD_OPTIONS += MODNAME=wlan |
| 80 | KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM) |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 81 | KBUILD_OPTIONS += $(WLAN_SELECT) |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 82 | |
Sameer Thalappil | 0874faf | 2013-01-22 15:39:29 -0800 | [diff] [blame] | 83 | |
| 84 | VERSION=$(shell grep -w "VERSION =" $(TOP)/kernel/Makefile | sed 's/^VERSION = //' ) |
| 85 | PATCHLEVEL=$(shell grep -w "PATCHLEVEL =" $(TOP)/kernel/Makefile | sed 's/^PATCHLEVEL = //' ) |
| 86 | |
Sameer Thalappil | 0874faf | 2013-01-22 15:39:29 -0800 | [diff] [blame] | 87 | include $(CLEAR_VARS) |
| 88 | LOCAL_MODULE := $(WLAN_CHIPSET)_wlan.ko |
| 89 | LOCAL_MODULE_KBUILD_NAME := wlan.ko |
| 90 | LOCAL_MODULE_TAGS := debug |
| 91 | LOCAL_MODULE_DEBUG_ENABLE := true |
| 92 | LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/modules/$(WLAN_CHIPSET) |
| 93 | include $(DLKM_DIR)/AndroidKernelModule.mk |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 94 | ########################################################### |
| 95 | |
| 96 | #Create symbolic link |
| 97 | $(shell mkdir -p $(TARGET_OUT)/lib/modules; \ |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 98 | ln -sf /system/lib/modules/$(WLAN_CHIPSET)/$(WLAN_CHIPSET)_wlan.ko \ |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 99 | $(TARGET_OUT)/lib/modules/wlan.ko) |
| 100 | |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 101 | ifeq ($(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 Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 107 | endif |
Nagender Telkar | 3d40631 | 2012-12-12 13:20:58 -0800 | [diff] [blame] | 108 | |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame] | 109 | endif # DLKM check |
| 110 | |
| 111 | endif # supported target check |