-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile.x86
208 lines (149 loc) · 5.42 KB
/
Makefile.x86
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# 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
# 1: Enable SDIO RX Tasklet De-Aggregation
# 0: Disable (default)
CFG_SDIO_RX_AGG_TASKLET=0
# Support disable beacon hint to avoid channel flag be changed.
CFG_SUPPORT_DISABLE_BCN_HINTS=n
#/***** 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
ifneq ($(CFG_SDIO_RX_AGG_TASKLET),)
PLATFORM_FLAGS += -DCFG_SDIO_RX_AGG_TASKLET=$(CFG_SDIO_RX_AGG_TASKLET)
endif
ifeq ($(CFG_SUPPORT_DISABLE_BCN_HINTS), y)
PLATFORM_FLAGS += -DCFG_SUPPORT_DISABLE_BCN_HINTS
endif
#For adjust channel request interval when ais join net work
ifeq ($(CFG_SUPPORT_ADJUST_JOIN_CH_REQ_INTERVAL),y)
PLATFORM_FLAGS += -DCFG_SUPPORT_ADJUST_JOIN_CH_REQ_INTERVAL
endif
ifeq ($(CFG_SUPPORT_P2P_GO_KEEP_RATE_SETTING), y)
PLATFORM_FLAGS += -DCFG_SUPPORT_P2P_GO_KEEP_RATE_SETTING
endif
ifeq ($(CFG_SUPPORT_P2P_GO_11B_RATE),y)
PLATFORM_FLAGS += -DCFG_SUPPORT_P2P_GO_11B_RATE
endif
ifeq ($(CFG_SUPPORT_P2P_OPEN_SECURITY),y)
PLATFORM_FLAGS += -DCFG_SUPPORT_P2P_OPEN_SECURITY
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