forked from eli-zh/mt7610u
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
402 lines (299 loc) · 7.62 KB
/
Makefile
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
# Support WDS function
HAS_WDS=n
# Support Wpa_Supplicant
# i.e. wpa_supplicant -Dralink
HAS_WPA_SUPPLICANT=y
# Support Native WpaSupplicant for Network Maganger
# i.e. wpa_supplicant -Dwext
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y
#Support IGMP-Snooping function.
HAS_IGMP_SNOOP_SUPPORT=n
#Support DFS function
HAS_DFS_SUPPORT=n
#Support WEPAUTO mode try Open first then shared
HAS_WEPAUTO_OPEN_FIRST_SUPPORT=n
# Support user specific transmit rate of Multicast packet.
HAS_MCAST_RATE_SPECIFIC_SUPPORT=n
#Support for IEEE802.11e DLS
HAS_QOS_DLS_SUPPORT=n
HAS_KTHREAD_SUPPORT=n
#Support for Auto channel select enhance
HAS_AUTO_CH_SELECT_ENHANCE=n
#Support TSSI Antenna Variation
HAS_TSSI_ANTENNA_VARIATION=n
#Support USB_BULK_BUF_ALIGMENT
HAS_USB_BULK_BUF_ALIGMENT=n
#Support for Bridge Fast Path & Bridge Fast Path function open to other module
HAS_BGFP_SUPPORT=n
HAS_BGFP_OPEN_SUPPORT=n
# Support HOSTAPD function
HAS_HOSTAPD_SUPPORT=n
#Support GreenAP function
HAS_GREENAP_SUPPORT=n
#Support MAC80211 LINUX-only function
#Please make sure the version for CFG80211.ko and MAC80211.ko is same as the one
#our driver references to.
HAS_CFG80211_SUPPORT=y
#Support RFKILL hardware block/unblock LINUX-only function
HAS_RFKILL_HW_SUPPORT=n
HAS_LED_CONTROL_SUPPORT=y
#Support WIDI feature
#Must enable HAS_WSC at the same time.
HAS_NEW_RATE_ADAPT_SUPPORT=y
HAS_MAC_REPEATER_SUPPORT=n
HAS_WIFI_P2P_CONCURRENT_FAST_SCAN=n
#################################################
WFLAGS += -g -DAGGREGATION_SUPPORT -DPIGGYBACK_SUPPORT -DWMM_SUPPORT -DLINUX -Wall -Wstrict-prototypes -Wno-trigraphs
WFLAGS += -DRT28xx_MODE=$(RT28xx_MODE) -DENHANCED_STAT_DISPLAY
WFLAGS += -I$(PWD)/include
ifeq ($(HAS_WIFI_P2P_CONCURRENT_FAST_SCAN),y)
WFLAGS += -DWIFI_P2P_CONCURRENT_FAST_SCAN
endif
ifeq ($(HAS_HE_SUPPORT),y)
WFLAGS += -DHE_SUPPORT
WFLAGS += -DIP_ASSEMBLY
endif
ifeq ($(HAS_HE_BD_SUPPORT),y)
WFLAGS += -DHE_BD_SUPPORT
endif
ifeq ($(HAS_WEPAUTO_OPEN_FIRST_SUPPORT),y)
WFLAGS += -DWEPAUTO_OPEN_FIRST
endif
ifeq ($(HAS_HE_TV_SUPPORT),y)
WFLAGS += -DHE_TV_SUPPORT
endif
ifeq ($(HAS_KTHREAD_SUPPORT),y)
WFLAGS += -DKTHREAD_SUPPORT
endif
ifeq ($(HAS_MAC_REPEATER_SUPPORT),y)
WFLAGS += -DMAC_REPEATER_SUPPORT
endif
#################################################
# config for STA mode
ifeq ($(RT28xx_MODE),STA)
WFLAGS += -DCONFIG_STA_SUPPORT -DSCAN_SUPPORT -DDBG
ifeq ($(HAS_WPA_SUPPLICANT),y)
WFLAGS += -DWPA_SUPPLICANT_SUPPORT
ifeq ($(HAS_NATIVE_WPA_SUPPLICANT_SUPPORT),y)
WFLAGS += -DNATIVE_WPA_SUPPLICANT_SUPPORT
endif
endif
ifeq ($(HAS_QOS_DLS_SUPPORT),y)
WFLAGS += -DQOS_DLS_SUPPORT
endif
ifeq ($(HAS_NEW_RATE_ADAPT_SUPPORT),y)
WFLAGS += -DNEW_RATE_ADAPT_SUPPORT
endif
ifeq ($(HAS_TSSI_ANTENNA_VARIATION),y)
WFLAGS += -DTSSI_ANTENNA_VARIATION
endif
ifeq ($(HAS_CFG80211_SUPPORT),y)
WFLAGS += -DRT_CFG80211_SUPPORT
ifeq ($(HAS_RFKILL_HW_SUPPORT),y)
WFLAGS += -DRFKILL_HW_SUPPORT
endif
endif
endif
# endif of ifeq ($(RT28xx_MODE),STA)
#################################################
#################################################
#
# Common compiler flag
#
ifeq ($(HAS_BGFP_SUPPORT),y)
WFLAGS += -DBG_FT_SUPPORT
endif
ifeq ($(HAS_BGFP_OPEN_SUPPORT),y)
WFLAGS += -DBG_FT_OPEN_SUPPORT
endif
ifeq ($(HAS_LED_CONTROL_SUPPORT),y)
WFLAGS += -DLED_CONTROL_SUPPORT
endif
WFLAGS += -DMT76x0 -DRLT_MAC -DRLT_RF -DCONFIG_ANDES_SUPPORT
#-DRTMP_FREQ_CALIBRATION_SUPPORT
#-DRX_DMA_SCATTER
ifeq ($(HAS_CSO_SUPPORT), y)
WFLAGS += -DCONFIG_CSO_SUPPORT -DCONFIG_TSO_SUPPORT
endif
#################################################
ifeq ($(HAS_DFS_SUPPORT),y)
WFLAGS += -DDFS_SUPPORT
endif
#kernel build options for 2.4
# move to Makefile outside LINUX_SRC := /opt/star/kernel/linux-2.4.27-star
ifeq ($(PLATFORM),PC)
EXTRA_CFLAGS := $(WFLAGS)
endif
RT28xx_MODE = STA
TARGET = LINUX
MODULE = mt7610u
PWD = $(shell pwd)
RTMP_SRC_DIR = $(PWD)/RT$(MODULE)
#PLATFORM: Target platform
PLATFORM = PC
#APSOC
#RELEASE Package
RELEASE = DPO
obj_wsc :=
obj_vht :=
obj_cmm := \
common/crypt_md5.o\
common/crypt_sha2.o\
common/crypt_hmac.o\
common/crypt_aes.o\
common/crypt_arc4.o\
common/mlme.o\
common/cmm_wep.o\
common/action.o\
common/cmm_data.o\
common/rtmp_init.o\
common/rtmp_init_inf.o\
common/cmm_tkip.o\
common/cmm_aes.o\
common/cmm_sync.o\
common/cmm_sanity.o\
common/cmm_info.o\
common/cmm_cfg.o\
common/cmm_wpa.o\
common/cmm_radar.o\
common/spectrum.o\
common/rtmp_timer.o\
common/rt_channel.o\
common/cmm_profile.o\
common/cmm_asic.o\
common/scan.o\
common/cmm_cmd.o\
common/uapsd.o\
common/ps.o\
rate_ctrl/ra_ctrl.o\
rate_ctrl/alg_legacy.o\
rate_ctrl/alg_ags.o\
chips/rtmp_chip.o\
common/txpower.o\
mac/rtmp_mac.o\
mgmt/mgmt_entrytb.o\
phy/rlt_phy.o\
phy/rlt_rf.o
ifeq ($(HAS_NEW_RATE_ADAPT_SUPPORT),y)
obj_cmm += rate_ctrl/alg_grp.o
endif
ifeq ($(HAS_DFS_SUPPORT),y)
obj_cmm += common/cmm_dfs.o
endif
obj_cmm += common/ba_action.o\
mgmt/mgmt_ht.o
obj_vht += mgmt/mgmt_vht.o\
common/vht.o
#ifdef CONFIG_STA_SUPPORT
MOD_NAME = $(MODULE)
#endif // CONFIG_STA_SUPPORT //
obj-m := $(MOD_NAME).o
#ifdef CONFIG_STA_SUPPORT
ifeq ($(RT28xx_MODE), STA)
$(MOD_NAME)-objs := \
os/linux/rt_profile.o\
sta/assoc.o\
sta/auth.o\
sta/auth_rsp.o\
sta/sync.o\
sta/sanity.o\
sta/rtmp_data.o\
sta/connect.o\
sta/wpa.o\
sta/sta_cfg.o\
$(obj_vht)\
$(obj_cmm)\
$(obj_wsc)
$(MOD_NAME)-objs += \
common/rt_os_util.o\
os/linux/sta_ioctl.o\
os/linux/rt_linux.o\
os/linux/rt_main_dev.o
ifeq ($(HAS_QOS_DLS_SUPPORT),y)
$(MOD_NAME)-objs += \
sta/dls.o
endif
#ifdef LED_CONTROL_SUPPORT
ifeq ($(HAS_LED_CONTROL_SUPPORT),y)
$(MOD_NAME)-objs += \
common/rt_led.o
endif
#endif // LED_CONTROL_SUPPORT //
#ifdef CRDA_SUPPORT
ifeq ($(HAS_CFG80211_SUPPORT),y)
$(MOD_NAME)-objs += \
os/linux/cfg80211.o \
os/linux/cfg80211drv.o
endif
#endif // CRDA_SUPPORT //
endif
#endif // CONFIG_STA_SUPPORT //
#chip releated
#ifdef MT76x0
$(MOD_NAME)-objs += \
common/cmm_mac_usb.o\
common/cmm_data_usb.o\
common/rtusb_io.o\
common/rtusb_data.o\
common/rtusb_bulk.o\
os/linux/rt_usb.o\
common/rt_rf.o\
chips/rt65xx.o\
chips/mt76x0.o\
mac/ral_nmac.o\
mcu/mcu.o\
mcu/mcu_and.o
ifeq ($(HAS_CSO_SUPPORT), y)
$(MOD_NAME)-objs += \
naf/net_acc.o\
naf/cso.o
endif
$(MOD_NAME)-objs += \
os/linux/rt_usb.o\
os/linux/rt_usb_util.o\
os/linux/usb_main_dev.o
ifneq ($(findstring $(RT28xx_MODE),STA APSTA),)
$(MOD_NAME)-objs += \
common/frq_cal.o
endif
EXTRA_CFLAGS += -Wno-unused-label
EXTRA_CFLAGS += -Wno-unused
MAKE = make
ifeq ($(PLATFORM),PC)
# Linux 2.6
KSRC = /lib/modules/$(shell uname -r)/build
CROSS_COMPILE =
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
SUBARCH := $(shell uname -m | sed -e s/i.86/i386/)
ARCH ?= $(SUBARCH)
endif
export PWD RT28xx_MODE KSRC CROSS_COMPILE CROSS_COMPILE_INCLUDE PLATFORM RELEASE MODULE RTMP_SRC_DIR TARGET
# The targets that may be used.
PHONY += all build_tools test LINUX clean
all: modules
modules:
$(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KSRC) M=$(PWD) modules
clean:
rm -f */*.o
rm -f */.*.{cmd,flags,d}
rm -f *.{o,ko,mod.{o,c}}
rm -f */*/*.{o,ko,mod.{o,c}}
rm -f */*/.*.{cmd,flags,d}
rm -fr .tmp_versions
rm -f include/mcu/mt76*
#Must clean Module.symvers; or you will suffer symbol version not match
#when OS_ABL = YES.
rm -f Module.symvers
rm -f Modules.symvers
rm -f Module.markers
rm -f modules.order
installfw:
cp -n firmware/* /lib/firmware
help:
@echo "options :"
@echo "modules build this module"
@echo "installfw install firmware file"
@echo "clean clean"
@echo "help this help text"
# Declare the contents of the .PHONY variable as phony. We keep that information in a variable
.PHONY: $(PHONY)