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 | |
| 9 | # Build/Package options for 8974 target |
| 10 | ifeq ($(call is-board-platform,msm8974),true) |
| 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 | |
| 83 | include $(CLEAR_VARS) |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame^] | 84 | LOCAL_MODULE := $(WLAN_CHIPSET)_wlan.ko |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 85 | LOCAL_MODULE_KBUILD_NAME := wlan.ko |
| 86 | LOCAL_MODULE_TAGS := debug |
| 87 | LOCAL_MODULE_DEBUG_ENABLE := true |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame^] | 88 | LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/modules/$(WLAN_CHIPSET) |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 89 | include $(DLKM_DIR)/AndroidKernelModule.mk |
| 90 | ########################################################### |
| 91 | |
| 92 | #Create symbolic link |
| 93 | $(shell mkdir -p $(TARGET_OUT)/lib/modules; \ |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame^] | 94 | ln -sf /system/lib/modules/$(WLAN_CHIPSET)/$(WLAN_CHIPSET)_wlan.ko \ |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 95 | $(TARGET_OUT)/lib/modules/wlan.ko) |
| 96 | |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame^] | 97 | ifeq ($(WLAN_PROPRIETARY),1) |
| 98 | $(shell mkdir -p $(TARGET_OUT_ETC)/firmware/wlan/prima; \ |
| 99 | ln -sf /persist/WCNSS_qcom_wlan_nv.bin \ |
| 100 | $(TARGET_OUT_ETC)/firmware/wlan/prima/WCNSS_qcom_wlan_nv.bin; \ |
| 101 | ln -sf /data/misc/wifi/WCNSS_qcom_cfg.ini \ |
| 102 | $(TARGET_OUT_ETC)/firmware/wlan/prima/WCNSS_qcom_cfg.ini) |
Jeff Johnson | 9f706b6 | 2012-12-01 12:42:42 -0800 | [diff] [blame] | 103 | endif |
Nagender Telkar | 3d40631 | 2012-12-12 13:20:58 -0800 | [diff] [blame] | 104 | |
Gopichand Nakkala | 649976b | 2013-01-04 12:08:05 -0800 | [diff] [blame^] | 105 | endif # DLKM check |
| 106 | |
| 107 | endif # supported target check |