-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
701 lines (576 loc) · 20.1 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
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
# Makefile for MT76x8 combo driver
##############################################################
# Common settings
##############################################################
export MTK_COMBO_CHIP=MT6632
export HIF=usb
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
WLAN_CHIP_ID := mt76x8
PWD=$(shell pwd)
DRIVER_DIR=$(PWD)
ifeq ($(HIF),)
HIF=usb
endif
export CONFIG_MTK_COMBO_WIFI_HIF=$(HIF)
MODULE_NAME := wlan_$(WLAN_CHIP_ID)_$(HIF)
export CONFIG_MTK_PREALLOC_MEMORY=n
#Mstar platform need use prealloc,
#but this need platform insmod prealloc.ko, not suit for all platforms
ifeq "$(UTOPIA)" "true"
export CFG_POWER_OFF_CTRL_SUPPORT=y
ifeq ($(ANDROID),true)
export CONFIG_MTK_PREALLOC_MEMORY=y
endif
endif
WPA3_SUPPORT_VERSION := r-base q-base q-cn r-cn p-cn
ifneq ($(filter $(WPA3_SUPPORT_VERSION), $(MTK_ANDROID_VERSION)),)
$(warning wifi driver MTK_ANDROID_VERSION=$(MTK_ANDROID_VERSION))
export CONFIG_MTK_WPA3_SUPPORT=y
endif
##############################################################
# Platform specific
##############################################################
# Set default platform
#PLATFORM:=MT53XX
PLATFORM:=AML950X4
ifeq ($(TARGET_PRODUCT), rango)
$(warning TARGET_PRODUCT is $(TARGET_PRODUCT))
PLATFORM := AML950X4
endif
ifeq ($(PLATFORM),AML950X4)
$(warning PLATFORM is $(PLATFORM))
#KSRC:= $(shell pwd)/$(LINUX_SRC)
#$(warning PLATFORM is $(KSRC))
LINUX_SRC = $(KERNEL_SRC)
endif
ifeq ($(PLATFORM),avatar)
$(warning CFG_SUPPORT_FWPATH_PREFIX is $(CFG_SUPPORT_FWPATH_PREFIX))
CFG_SUPPORT_FWPATH_PREFIX:=y
endif
64BIT_MODE := false
LINUX_ROOT ?= $(word 1, $(subst /apollo/,/apollo /, $(shell pwd -L)))
ifeq "$(CC)" "gcc"
CC ?= $(CROSS_COMPILE)gcc
endif
$(warning =============================================)
$(warning wifi driver LINUX_SRC=$(LINUX_SRC))
$(warning CROSS_COMPILE=$(CROSS_COMPILE))
$(warning KERNEL_CROSS_COMPILE=$(KERNEL_CROSS_COMPILE))
$(warning =============================================)
#- - - - - - - - - - - - - - - - - - - - - - - - - - - -
# MT53XX end
#= = = = = = = = = = = = = = = = = = = = = = = = = = = =
##############################################################
# Compile options
##############################################################
#/***** Common part ******/
# Extend stack limit size to avoid build error
PLATFORM_FLAGS += -Wframe-larger-than=1400
# 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=y
CFG_DEFAULT_DBG_LEVEL=0xF
CFG_TX_DIRECT_USB=1
CFG_RX_DIRECT_USB=1
CFG_USB_REQ_TX_DATA_FFA_CNT=6
CFG_USB_REQ_TX_DATA_CNT=2
CFG_USB_REQ_RX_DATA_CNT=4
CFG_ENABLE_EFUSE_MAC_ADDR=1
#CFG_SUPPORT_SINGLE_SKU_LOCAL_DB=0
#CFG_SUPPORT_DFS_MASTER=1
CFG_SCAN_CHANNEL_SPECIFIED=1
CFG_SUPPORT_ROAMING=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_mt7668_usb.ko sta=wlan p2p=p2p ap=ap
CFG_DRIVER_INF_NAME_CHANGE=n
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
#/***** Platform dependent part ******/
ifeq ($(PLATFORM),MT53XX)
CFG_DRIVER_INITIAL_RUNNING_MODE=3
CFG_SUPPORT_SINGLE_SKU_LOCAL_DB=0
endif
ifeq ($(WOW_WAKE_UP), 1)
PLATFORM_FLAGS += -DCFG_SUPPORT_WOW_EINT=1
PLATFORM_FLAGS += -DCFG_SUPPORT_MAGIC_PKT_VENDOR_EVENT=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_ENABLE_EFUSE_MAC_ADDR),)
PLATFORM_FLAGS += -DCFG_ENABLE_EFUSE_MAC_ADDR=$(CFG_ENABLE_EFUSE_MAC_ADDR)
endif
ifeq ($(CFG_DRIVER_INF_NAME_CHANGE), y)
PLATFORM_FLAGS += -DCFG_DRIVER_INF_NAME_CHANGE
endif
ifeq ($(CFG_ANDROID_AOSP_PRIV_CMD), y)
PLATFORM_FLAGS += -DCFG_ANDROID_AOSP_PRIV_CMD
endif
ifneq ($(CFG_SUPPORT_SINGLE_SKU_LOCAL_DB),)
PLATFORM_FLAGS += -DCFG_SUPPORT_SINGLE_SKU_LOCAL_DB=$(CFG_SUPPORT_SINGLE_SKU_LOCAL_DB)
endif
ifneq ($(CFG_SUPPORT_DFS_MASTER),)
PLATFORM_FLAGS += -DCFG_SUPPORT_DFS_MASTER=$(CFG_SUPPORT_DFS_MASTER)
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
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
ifeq ($(CFG_SUPPORT_FWPATH_PREFIX),y)
PLATFORM_FLAGS += -DCFG_SUPPORT_FWPATH_PREFIX
endif
# ---------------------------------------------------
# Compile Options
# ---------------------------------------------------
WLAN_CHIP_LIST:=-UMT6620 -UMT6628 -UMT5931 -UMT6630 -UMT6632
ccflags-y += $(WLAN_CHIP_LIST)
#WLAN_CHIP_ID=$(MTK_COMBO_CHIP)
ifeq ($(WLAN_CHIP_ID),)
WLAN_CHIP_ID := MT6632
endif
ccflags-y += -DCFG_SUPPORT_DEBUG_FS=0
ccflags-y += -DWLAN_INCLUDE_PROC
ccflags-y += -DCFG_SUPPORT_AGPS_ASSIST=1
ccflags-y += -DCFG_SUPPORT_TSF_USING_BOOTTIME=1
ccflags-y += -Wno-error
ccflags-y += -Wno-implicit-function-declaration
ccflags-y += -Wno-incompatible-pointer-types
ccflags-y:=$(filter-out -U$(WLAN_CHIP_ID),$(ccflags-y))
ccflags-y += -DLINUX -D$(WLAN_CHIP_ID)
CONFIG_MTK_WIFI_MCC_SUPPORT=y
CONFIG_MTK_WPA3_SUPPORT=y
ifeq ($(CONFIG_MTK_WIFI_MCC_SUPPORT), y)
ccflags-y += -DCFG_SUPPORT_CHNL_CONFLICT_REVISE=0
$(info DCFG_SUPPORT_CHNL_CONFLICT_REVISE=0)
else
ccflags-y += -DCFG_SUPPORT_CHNL_CONFLICT_REVISE=1
$(info DCFG_SUPPORT_CHNL_CONFLICT_REVISE=1)
endif
ifeq ($(CONFIG_MTK_AEE_FEATURE), y)
ccflags-y += -DCFG_SUPPORT_AEE=1
$(info DCFG_SUPPORT_AEE=1)
else
ccflags-y += -DCFG_SUPPORT_AEE=0
$(info DCFG_SUPPORT_AEE=0)
endif
ifeq ($(CONFIG_MTK_WPA3_SUPPORT), y)
ccflags-y += -DCFG_SUPPORT_CFG80211_AUTH=1
ccflags-y += -DCFG_SUPPORT_SAE=1
ccflags-y += -DCFG_SUPPORT_OWE=1
ccflags-y += -DCFG_SUPPORT_SUITB=1
ccflags-y += -DCFG_SUPPORT_CFG80211_QUEUE=1
else
ccflags-y += -DCFG_SUPPORT_CFG80211_AUTH=0
ccflags-y += -DCFG_SUPPORT_SAE=0
ccflags-y += -DCFG_SUPPORT_OWE=0
ccflags-y += -DCFG_SUPPORT_SUITB=0
ccflags-y += -DCFG_SUPPORT_CFG80211_QUEUE=0
endif
ifeq ($(MUL_WIFI_HW_COMPATIBLE), true)
$(warning wifi driver MUL_WIFI_HW_COMPATIBLE=$(MUL_WIFI_HW_COMPATIBLE))
ccflags-y += -DCFG_SUPPORT_MULTI_DONGLE=1
endif
ifeq ($(MDNS_OFFLOAD), true)
ccflags-y += -DCFG_SUPPORT_MDNS_OFFLOAD=1
endif
# Disable ASSERT() for user load, enable for others
ifneq ($(TARGET_BUILD_VARIANT),user)
ccflags-y += -DBUILD_QA_DBG=1
else
ccflags-y += -DBUILD_QA_DBG=0
endif
ifeq ($(CONFIG_MTK_COMBO_WIFI),y)
ccflags-y += -DCFG_BUILT_IN_DRIVER=1
ccflags-y += -DCFG_WPS_DISCONNECT=1
else
ccflags-y += -DCFG_BUILT_IN_DRIVER=0
endif
ifeq ($(CONFIG_MTK_COMBO_WIFI_HIF), sdio)
ccflags-y += -D_HIF_SDIO=1
else ifeq ($(CONFIG_MTK_COMBO_WIFI_HIF), pcie)
ccflags-y += -D_HIF_PCIE=1
else ifeq ($(CONFIG_MTK_COMBO_WIFI_HIF), usb)
ccflags-y += -D_HIF_USB=1
else
$(error Unsuppoted HIF=$(CONFIG_MTK_COMBO_WIFI_HIF)!!)
endif
ifneq ($(CFG_CFG80211_VERSION),)
VERSION_STR = $(subst ",,$(subst ., , $(subst -, ,$(subst v,,$(CFG_CFG80211_VERSION)))))
$(info VERSION_STR=$(VERSION_STR))
X = $(firstword $(VERSION_STR))
Y = $(word 2 ,$(VERSION_STR))
Z = $(word 3 ,$(VERSION_STR))
VERSION := $(shell echo "$$(( $X * 65536 + $Y * 256 + $Z))" )
ccflags-y += -DCFG_CFG80211_VERSION=$(VERSION)
$(info DCFG_CFG80211_VERSION=$(VERSION))
endif
$(info HIF=$(CONFIG_MTK_COMBO_WIFI_HIF))
ifeq ($(CONFIG_MTK_PASSPOINT_R1_SUPPORT), y)
ccflags-y += -DCFG_SUPPORT_PASSPOINT=1
ccflags-y += -DCFG_HS20_DEBUG=1
ccflags-y += -DCFG_ENABLE_GTK_FRAME_FILTER=1
else ifeq ($(CONFIG_MTK_PASSPOINT_R2_SUPPORT), y)
ccflags-y += -DCFG_SUPPORT_PASSPOINT=1
ccflags-y += -DCFG_HS20_DEBUG=1
ccflags-y += -DCFG_ENABLE_GTK_FRAME_FILTER=1
else
ccflags-y += -DCFG_SUPPORT_PASSPOINT=0
ccflags-y += -DCFG_HS20_DEBUG=0
ccflags-y += -DCFG_ENABLE_GTK_FRAME_FILTER=0
endif
MTK_MET_PROFILING_SUPPORT = yes
ifeq ($(MTK_MET_PROFILING_SUPPORT), yes)
ccflags-y += -DCFG_MET_PACKET_TRACE_SUPPORT=1
else
ccflags-y += -DCFG_MET_PACKET_TRACE_SUPPORT=0
endif
MTK_MET_TAG_SUPPORT = no
ifeq ($(MTK_MET_TAG_SUPPORT), yes)
ccflags-y += -DMET_USER_EVENT_SUPPORT
ccflags-y += -DCFG_MET_TAG_SUPPORT=1
else
ccflags-y += -DCFG_MET_TAG_SUPPORT=0
endif
ifeq ($(CFG_POWER_OFF_CTRL_SUPPORT), y)
ccflags-y += -DCFG_POWER_OFF_CTRL_SUPPORT=1
endif
ifeq ($(MODULE_NAME),)
MODULE_NAME := wlan_$(shell echo $(strip $(WLAN_CHIP_ID)) | tr A-Z a-z)_$(CONFIG_MTK_COMBO_WIFI_HIF)
endif
src = $(KERNEL_SRC)/$(M)
ccflags-y += -DDBG=0
ccflags-y += -Wundef
ccflags-y += -I$(src)/os -I$(src)/os/linux/include
ccflags-y += -I$(src)/include -I$(src)/include/nic -I$(src)/include/mgmt -I$(src)/include/chips
ifeq ($(CONFIG_MTK_COMBO_WIFI_HIF), sdio)
ccflags-y += -I$(src)/os/linux/hif/sdio/include
else ifeq ($(CONFIG_MTK_COMBO_WIFI_HIF), pcie)
ccflags-y += -I$(src)/os/linux/hif/pcie/include
else ifeq ($(CONFIG_MTK_COMBO_WIFI_HIF), usb)
ccflags-y += -I$(src)/os/linux/hif/usb/include
endif
ifneq ($(PLATFORM_FLAGS), )
ccflags-y += $(PLATFORM_FLAGS)
endif
ifeq ($(CONFIG_MTK_WIFI_ONLY),$(filter $(CONFIG_MTK_WIFI_ONLY),m y))
obj-$(CONFIG_MTK_WIFI_ONLY) += $(MODULE_NAME).o
else
obj-$(CONFIG_MTK_COMBO_WIFI) += $(MODULE_NAME).o
#obj-y += $(MODULE_NAME).o
endif
# ---------------------------------------------------
# Directory List
# ---------------------------------------------------
COMMON_DIR := common/
OS_DIR := os/linux/
ifeq ($(CONFIG_MTK_COMBO_WIFI_HIF), sdio)
HIF_DIR := os/linux/hif/sdio/
else ifeq ($(CONFIG_MTK_COMBO_WIFI_HIF), pcie)
HIF_DIR := os/linux/hif/pcie/
else ifeq ($(CONFIG_MTK_COMBO_WIFI_HIF), usb)
HIF_DIR := os/linux/hif/usb/
endif
NIC_DIR := nic/
MGMT_DIR := mgmt/
CHIPS := chips/
# ---------------------------------------------------
# Objects List
# ---------------------------------------------------
COMMON_OBJS := $(COMMON_DIR)dump.o \
$(COMMON_DIR)wlan_lib.o \
$(COMMON_DIR)wlan_oid.o \
$(COMMON_DIR)wlan_bow.o
NIC_OBJS := $(NIC_DIR)nic.o \
$(NIC_DIR)nic_tx.o \
$(NIC_DIR)nic_rx.o \
$(NIC_DIR)nic_pwr_mgt.o \
$(NIC_DIR)nic_rate.o \
$(NIC_DIR)cmd_buf.o \
$(NIC_DIR)que_mgt.o \
$(NIC_DIR)nic_cmd_event.o \
$(NIC_DIR)nic_umac.o
OS_OBJS := $(OS_DIR)gl_init.o \
$(OS_DIR)gl_kal.o \
$(OS_DIR)gl_bow.o \
$(OS_DIR)gl_wext.o \
$(OS_DIR)gl_wext_priv.o \
$(OS_DIR)gl_ate_agent.o \
$(OS_DIR)gl_qa_agent.o \
$(OS_DIR)gl_hook_api.o \
$(OS_DIR)gl_rst.o \
$(OS_DIR)gl_cfg80211.o \
$(OS_DIR)gl_proc.o \
$(OS_DIR)gl_vendor.o \
$(OS_DIR)platform.o
ifeq ($(CONFIG_KASAN),y)
CFLAGS_gl_wext_priv.o += -fno-inline
endif
MGMT_OBJS := $(MGMT_DIR)ais_fsm.o \
$(MGMT_DIR)aaa_fsm.o \
$(MGMT_DIR)assoc.o \
$(MGMT_DIR)auth.o \
$(MGMT_DIR)bss.o \
$(MGMT_DIR)cnm.o \
$(MGMT_DIR)cnm_timer.o \
$(MGMT_DIR)cnm_mem.o \
$(MGMT_DIR)hem_mbox.o \
$(MGMT_DIR)mib.o \
$(MGMT_DIR)privacy.o \
$(MGMT_DIR)rate.o \
$(MGMT_DIR)rlm.o \
$(MGMT_DIR)rlm_domain.o \
$(MGMT_DIR)reg_rule.o \
$(MGMT_DIR)rlm_obss.o \
$(MGMT_DIR)rlm_protection.o \
$(MGMT_DIR)rsn.o \
$(MGMT_DIR)saa_fsm.o \
$(MGMT_DIR)scan.o \
$(MGMT_DIR)scan_fsm.o \
$(MGMT_DIR)swcr.o \
$(MGMT_DIR)roaming_fsm.o \
$(MGMT_DIR)tkip_mic.o \
$(MGMT_DIR)hs20.o \
$(MGMT_DIR)tdls.o
CHIPS_OBJS := $(CHIPS)mt6632.o \
$(CHIPS)mt7668.o
# ---------------------------------------------------
# P2P Objects List
# ---------------------------------------------------
COMMON_OBJS += $(COMMON_DIR)wlan_p2p.o
NIC_OBJS += $(NIC_DIR)p2p_nic.o
OS_OBJS += $(OS_DIR)gl_p2p.o \
$(OS_DIR)gl_p2p_cfg80211.o \
$(OS_DIR)gl_p2p_init.o \
$(OS_DIR)gl_p2p_kal.o
MGMT_OBJS += $(MGMT_DIR)p2p_dev_fsm.o\
$(MGMT_DIR)p2p_dev_state.o\
$(MGMT_DIR)p2p_role_fsm.o\
$(MGMT_DIR)p2p_role_state.o\
$(MGMT_DIR)p2p_func.o\
$(MGMT_DIR)p2p_scan.o\
$(MGMT_DIR)p2p_ie.o\
$(MGMT_DIR)p2p_rlm.o\
$(MGMT_DIR)p2p_assoc.o\
$(MGMT_DIR)p2p_bss.o\
$(MGMT_DIR)p2p_rlm_obss.o\
$(MGMT_DIR)p2p_fsm.o
MGMT_OBJS += $(MGMT_DIR)wapi.o
ifeq ($(CONFIG_MTK_COMBO_WIFI_HIF), sdio)
HIF_OBJS := $(HIF_DIR)arm.o \
$(HIF_DIR)sdio.o \
$(HIF_DIR)sdio_test_driver_core.o \
$(HIF_DIR)sdio_test_driver_ops.o
else ifeq ($(CONFIG_MTK_COMBO_WIFI_HIF), pcie)
HIF_OBJS := $(HIF_DIR)arm.o \
$(HIF_DIR)pcie.o
else ifeq ($(CONFIG_MTK_COMBO_WIFI_HIF), usb)
HIF_OBJS := $(HIF_DIR)usb.o
endif
HIF_OBJS += $(HIF_DIR)hal_api.o
$(MODULE_NAME)-objs += $(COMMON_OBJS)
$(MODULE_NAME)-objs += $(NIC_OBJS)
$(MODULE_NAME)-objs += $(OS_OBJS)
$(MODULE_NAME)-objs += $(HIF_OBJS)
$(MODULE_NAME)-objs += $(MGMT_OBJS)
$(MODULE_NAME)-objs += $(CHIPS_OBJS)
#
# mtprealloc
#
ifeq ($(CONFIG_MTK_PREALLOC_MEMORY), y)
ccflags-y += -DCFG_PREALLOC_MEMORY
ccflags-y += -I$(src)/prealloc/include
MODULE_NAME_PREALLOC = mtprealloc
PREALLOC_OBJS := prealloc/prealloc.o
$(MODULE_NAME_PREALLOC)-objs += $(PREALLOC_OBJS)
obj-m += $(MODULE_NAME_PREALLOC).o
endif
DRIVER_BUILD_DATE=$(shell date +%Y%m%d%H%M%S)
ccflags-y += -DDRIVER_BUILD_DATE='"$(DRIVER_BUILD_DATE)"'
##############################################################
# Compile settings
##############################################################
all: modules
modules:
@echo cross_comple = $(CROSS_COMPILE)
@echo CFLAGS = $(CFLAGS)
@echo EXTRA_CFLAGS = $(EXTRA_CFLAGS)
$(MAKE) -C $(KERNEL_SRC) M=$(M) MODULE_NAME=$(MODULE_NAME) PLATFORM_FLAGS="$(PLATFORM_FLAGS)" modules
modules_install:
@$(MAKE) INSTALL_MOD_STRIP=1 M=$(M) -C $(KERNEL_SRC) modules_install
mkdir -p ${OUT_DIR}/../vendor_lib/modules
cd ${OUT_DIR}/$(M)/; find -name $(MODULE_NAME).ko -exec cp {} ${OUT_DIR}/../vendor_lib/modules/$(MODULE_NAME).ko \;
driver:
+make -C $(KSRC) M=$(shell pwd)/$(DRIVER_DIR) PLATFORM_FLAGS="$(PLATFORM_FLAGS)" WLAN_CHIP_ID=$(WLAN_CHIP_ID) modules
ifeq ($(PLATFORM),MSTAR)
$(STRIP) --strip-unneeded $(MODULE_NAME).ko
endif
ifeq ($(PLATFORM),MT53XX)
ifeq ($(DRIVER_PARTIAL_BUILD), y)
@cd $(DRIVER_DIR) && $(STRIP) --strip-unneeded $(MODULE_NAME).ko
else
$(STRIP) --strip-unneeded $(OUT_STA_KO)
ifeq ($(CONFIG_MTK_PREALLOC_MEMORY), y)
$(STRIP) --strip-unneeded $(OUT_STA_KO_DIR)/$(MODULE_NAME)_prealloc.ko
endif
endif
endif
##############################################################
# Post processing
##############################################################
#= = = = = = = = = = = = = = = = = = = = = = = = = = = =
# MT53XX start
#- - - - - - - - - - - - - - - - - - - - - - - - - - - -
ifeq ($(PLATFORM),MT53XX)
ifneq ($(DRIVER_PARTIAL_BUILD), y)
ifneq ($(ANDROID),true)
if [ ! -d $(OUTPUT_ROOT)/basic/wifi_ko ]; then \
mkdir -p $(OUTPUT_ROOT)/basic/wifi_ko/; \
fi
if [ -d $(OUTPUT_ROOT)/basic/wifi_ko ]; then \
cp -f $(OUT_STA_KO) $(OUTPUT_ROOT)/basic/wifi_ko/$(MODULE_NAME).ko; \
$(KERNEL_STRIP) $(STRIP_FLAG) $(OUTPUT_ROOT)/basic/wifi_ko/$(MODULE_NAME).ko; \
fi
else
if [ ! -d $(OUTPUT_ROOT)/basic/modules ]; then \
mkdir -p $(OUTPUT_ROOT)/basic/modules/; \
fi
ifeq ($(MUL_WIFI_HW_COMPATIBLE), true)
if [ -d $(OUTPUT_ROOT)/basic/modules ]; then \
cp -f $(OUT_STA_KO) $(OUTPUT_ROOT)/basic/modules/wlan_mt7668.ko; \
fi
else
if [ -d $(OUTPUT_ROOT)/basic/modules ]; then \
cp -f $(OUT_STA_KO) $(OUTPUT_ROOT)/basic/modules/wlan.ko; \
fi
endif
ifeq ($(CONFIG_MTK_PREALLOC_MEMORY), y)
ifeq ($(MUL_WIFI_HW_COMPATIBLE), true)
if [ -d $(OUTPUT_ROOT)/basic/modules ]; then \
cp -f $(OUT_STA_KO_DIR)/$(MODULE_NAME)_prealloc.ko $(OUTPUT_ROOT)/basic/modules/mtprealloc_mt7668.ko; \
fi
else
if [ -d $(OUTPUT_ROOT)/basic/modules ]; then \
cp -f $(OUT_STA_KO_DIR)/$(MODULE_NAME)_prealloc.ko $(OUTPUT_ROOT)/basic/modules/mtprealloc.ko; \
fi
endif
endif
endif # ifneq ($(ANDROID),true)
ifeq ($(S_PLATFORM),true)
if [ -d $(OUTPUT_ROOT)/basic/modules ]; then \
cp -f $(ANDROID_BUILD_TOP)/vendor/mediatek/open/hardware/prebuilt/wifi/WIFI_RAM_CODE_MT7668.bin $(OUTPUT_ROOT)/basic/modules; \
cp -f $(ANDROID_BUILD_TOP)/vendor/mediatek/open/hardware/prebuilt/wifi/WIFI_RAM_CODE2_USB_MT7668.bin $(OUTPUT_ROOT)/basic/modules; \
cp -f $(ANDROID_BUILD_TOP)/vendor/mediatek/open/hardware/prebuilt/wifi/wifi.cfg $(OUTPUT_ROOT)/basic/modules; \
cp -f $(ANDROID_BUILD_TOP)/vendor/mediatek/open/hardware/prebuilt/wifi/TxPwrLimit_MT76x8.dat $(OUTPUT_ROOT)/basic/modules; \
cp -f $(ANDROID_BUILD_TOP)/vendor/mediatek/open/hardware/prebuilt/bt/mt7668/mt7668_patch_e1_hdr.bin $(OUTPUT_ROOT)/basic/modules; \
cp -f $(ANDROID_BUILD_TOP)/vendor/mediatek/open/hardware/prebuilt/bt/mt7668/mt7668_patch_e2_hdr.bin $(OUTPUT_ROOT)/basic/modules; \
fi
endif
endif # ifneq ($(DRIVER_PARTIAL_BUILD), y)
endif # ifeq ($(PLATFORM),MT53XX)
#- - - - - - - - - - - - - - - - - - - - - - - - - - - -
# MT53XX end
#= = = = = = = = = = = = = = = = = = = = = = = = = = = =
clean: driver_clean
ifeq ($(PLATFORM),MT53XX)
ifeq ($(S_PLATFORM),true)
if [ -d $(OUTPUT_ROOT)/basic/modules ]; then \
rm -f $(OUTPUT_ROOT)/basic/modules/WIFI_RAM_CODE_MT7668.bin; \
rm -f $(OUTPUT_ROOT)/basic/modules/WIFI_RAM_CODE2_USB_MT7668.bin; \
rm -f $(OUTPUT_ROOT)/basic/modules/wifi.cfg; \
rm -f $(OUTPUT_ROOT)/basic/modules/TxPwrLimit_MT76x8.dat; \
rm -f $(OUTPUT_ROOT)/basic/modules/mt7668_patch_e1_hdr.bin; \
rm -f $(OUTPUT_ROOT)/basic/modules/mt7668_patch_e2_hdr.bin; \
fi
endif
endif
driver_clean:
ifneq ($(ANDROID),true)
rm -rf $(THIRDPARTY_LIB_ROOT)/wlan
endif
if [ -d $(DRIVER_DIR) ]; then \
cd $(DRIVER_DIR); \
find -L \
\( -name '*.ko' -o -name '.*.cmd' \
-o -name '*.o' -o -name '*.mod.c' \
-o -name '*.o.d' \
-o -name 'modules.order' \
-o -name 'Module.symvers' \) -type f -print | xargs rm -f; \
find -L \( -name '.tmp_versions' \) -print | xargs rm -rf {}; \
fi
.PHONY: all clean driver driver_clean