blob: 8543ae75bcedf882f9cf142b718875f7b1101a20 [file] [log] [blame]
# Makefile.x86: Makefile for Linux PC
# You can build specific .ko name by assiging the WLAN_CHIP_ID parameter
# Default=wlan_mt6632_usb.ko:
# make -f Makefile.x86
# wlan_mt7668_usb.ko:
# make -f Makefile.x86 WLAN_CHIP_ID=mt7668
LINUX_SRC=/lib/modules/$(shell uname -r)/build
WLAN_CHIP_ID := MT6632
export CONFIG_MTK_COMBO_PLATFORM=x86
PWD=$(shell pwd)
DRIVER_DIR=$(PWD)
export CONFIG_MTK_WIFI_ONLY=m
export CONFIG_MTK_COMBO=m
export CONFIG_MTK_COMBO_WIFI=m
export CONFIG_MTK_COMBO_COMM=m
export CONFIG_MTK_COMBO_COMM_UART=m
export CONFIG_MTK_COMBO_COMM_SDIO=m
export CONFIG_MT_WIFI_CHRDEV=m
ifneq ($(BACKPORTED_KERNEL_VERSION),)
export CFG_CFG80211_VERSION ?= $(BACKPORTED_KERNEL_VERSION)
endif
# pcie | sdio | usb
ifeq ($(hif),)
hif=usb
endif
MODULES_NAME := wlan_$(shell echo $(WLAN_CHIP_ID) | tr A-Z a-z)
export CONFIG_MTK_COMBO_WIFI_HIF=$(hif)
export CONFIG_MTK_COMBO_PLAT_PATH=x86
export CONFIG_MTK_PREALLOC_MEMORY=n
##############################################################
# Compile options
##############################################################
#/***** Common part ******/
# Define maximum different channels supported for ieee80211_iface_combination setting.
#CFG_NUM_DIFFERENT_CHANNELS_STA=1
#CFG_NUM_DIFFERENT_CHANNELS_P2P=1
# Define initial driver running mode.
# 0=RUNNING_P2P_MODE, 1=RUNNING_AP_MODE, 2=RUNNING_DUAL_AP_MODE, 3=RUNNING_P2P_AP_MODE
#CFG_DRIVER_INITIAL_RUNNING_MODE=3
# Define to enable Android wake_lock
#CFG_ENABLE_WAKE_LOCK=0
# For wpa_supplicant w/o MTK priv lib
# y: enable, n: disable
CFG_ANDROID_AOSP_PRIV_CMD=n
#CFG_DEFAULT_DBG_LEVEL=0xF
CFG_TX_DIRECT_USB=1
CFG_RX_DIRECT_USB=1
CFG_USB_REQ_TX_DATA_FFA_CNT=10
CFG_USB_REQ_TX_DATA_CNT=2
CFG_USB_REQ_RX_DATA_CNT=2
#CFG_SUPPORT_DFS_MASTER=1
CFG_SCAN_CHANNEL_SPECIFIED=1
#CFG_SUPPORT_SINGLE_SKU_LOCAL_DB=0
# Report all bss networks to cfg80211 when do p2p scan
CFG_P2P_SCAN_REPORT_ALL_BSS=0
# Support to change sta, p2p, ap interface names
# y: enable, n: disable
# eg. insmod wlan_mt76x8_usb.ko sta=wlan p2p=p2p ap=ap
CFG_DRIVER_INF_NAME_CHANGE=n
# Support firmware auto roaming
#CFG_SUPPORT_ROAMING=0
CFG_CHIP_RESET_SUPPORT=0
ifeq ($(WOW_WAKE_UP), 1)
PLATFORM_FLAGS += -DCFG_USE_LINUX_GPIO_GLUE=1
endif
#/***** Manage configs into compile options ******/
ifneq ($(CFG_NUM_DIFFERENT_CHANNELS_STA),)
PLATFORM_FLAGS += -DCFG_NUM_DIFFERENT_CHANNELS_STA=$(CFG_NUM_DIFFERENT_CHANNELS_STA)
endif
ifneq ($(CFG_NUM_DIFFERENT_CHANNELS_P2P),)
PLATFORM_FLAGS += -DCFG_NUM_DIFFERENT_CHANNELS_P2P=$(CFG_NUM_DIFFERENT_CHANNELS_P2P)
endif
ifneq ($(CFG_DRIVER_INITIAL_RUNNING_MODE),)
PLATFORM_FLAGS += -DCFG_DRIVER_INITIAL_RUNNING_MODE=$(CFG_DRIVER_INITIAL_RUNNING_MODE)
endif
ifneq ($(CFG_ENABLE_WAKE_LOCK),)
PLATFORM_FLAGS += -DCFG_ENABLE_WAKE_LOCK=$(CFG_ENABLE_WAKE_LOCK)
endif
ifneq ($(CFG_DEFAULT_DBG_LEVEL),)
PLATFORM_FLAGS += -DCFG_DEFAULT_DBG_LEVEL=$(CFG_DEFAULT_DBG_LEVEL)
endif
ifneq ($(CFG_TX_DIRECT_USB),)
PLATFORM_FLAGS += -DCFG_TX_DIRECT_USB=$(CFG_TX_DIRECT_USB)
endif
ifneq ($(CFG_RX_DIRECT_USB),)
PLATFORM_FLAGS += -DCFG_RX_DIRECT_USB=$(CFG_RX_DIRECT_USB)
endif
ifneq ($(CFG_USB_REQ_TX_DATA_FFA_CNT),)
PLATFORM_FLAGS += -DCFG_USB_REQ_TX_DATA_FFA_CNT=$(CFG_USB_REQ_TX_DATA_FFA_CNT)
endif
ifneq ($(CFG_USB_REQ_TX_DATA_CNT),)
PLATFORM_FLAGS += -DCFG_USB_REQ_TX_DATA_CNT=$(CFG_USB_REQ_TX_DATA_CNT)
endif
ifneq ($(CFG_USB_REQ_RX_DATA_CNT),)
PLATFORM_FLAGS += -DCFG_USB_REQ_RX_DATA_CNT=$(CFG_USB_REQ_RX_DATA_CNT)
endif
ifneq ($(CFG_SUPPORT_ROAMING),)
PLATFORM_FLAGS += -DCFG_SUPPORT_ROAMING=$(CFG_SUPPORT_ROAMING)
endif
ifneq ($(CFG_SUPPORT_DFS_MASTER),)
PLATFORM_FLAGS += -DCFG_SUPPORT_DFS_MASTER=$(CFG_SUPPORT_DFS_MASTER)
endif
ifneq ($(CFG_SUPPORT_SINGLE_SKU_LOCAL_DB),)
PLATFORM_FLAGS += -DCFG_SUPPORT_SINGLE_SKU_LOCAL_DB=$(CFG_SUPPORT_SINGLE_SKU_LOCAL_DB)
endif
ifeq ($(CFG_DRIVER_INF_NAME_CHANGE), y)
PLATFORM_FLAGS += -DCFG_DRIVER_INF_NAME_CHANGE
endif
ifneq ($(CFG_P2P_SCAN_REPORT_ALL_BSS),)
PLATFORM_FLAGS += -DCFG_P2P_SCAN_REPORT_ALL_BSS=$(CFG_P2P_SCAN_REPORT_ALL_BSS)
endif
ifneq ($(CFG_SCAN_CHANNEL_SPECIFIED),)
PLATFORM_FLAGS += -DCFG_SCAN_CHANNEL_SPECIFIED=$(CFG_SCAN_CHANNEL_SPECIFIED)
endif
ifneq ($(CFG_CHIP_RESET_SUPPORT),)
PLATFORM_FLAGS += -DCFG_CHIP_RESET_SUPPORT=$(CFG_CHIP_RESET_SUPPORT)
endif
ifeq ($(CFG_ANDROID_AOSP_PRIV_CMD), y)
PLATFORM_FLAGS += -DCFG_ANDROID_AOSP_PRIV_CMD
endif
all: driver
driver:
+cd $(DRIVER_DIR) && make -C $(LINUX_SRC) M=$(DRIVER_DIR) PLATFORM_FLAGS="$(PLATFORM_FLAGS)" WLAN_CHIP_ID=$(WLAN_CHIP_ID) modules
@cd $(DRIVER_DIR) && cp $(MODULES_NAME)_$(hif).ko $(MODULES_NAME).ko
clean: driver_clean
driver_clean:
cd $(DRIVER_DIR) && make -C $(LINUX_SRC) M=$(DRIVER_DIR) WLAN_CHIP_ID=$(WLAN_CHIP_ID) clean
.PHONY: all clean driver driver_clean