forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/drivers/net/wireless/rockchip_wlan/cywdhd/bcmdhd/Makefile
....@@ -1,92 +1,222 @@
1
-# SPDX-License-Identifier: GPL-2.0
2
-# cywdhd
3
-#################
4
-# Usage and porting guide for this Makefile
5
-#################
6
-# 1 Default to the module external build, that is, no need to copy the driver into the kernel source tree
7
-# Build with:
8
-# make KDIR=/path/to/your/kernel
9
-# 2 Default to x86 build: Build the x86 driver without any modification outside of kernel
10
-# 3 Just change the 'DHD_PLATFORM=imx' and the IMx OOB version can work!
11
-# 4 Copy DHD_PLATFORM=imx as the start point and create your own name
1
+# bcmdhd
2
+#
3
+# Portions of this code are copyright (c) 2022 Cypress Semiconductor Corporation
4
+#
5
+# Copyright (C) 1999-2017, Broadcom Corporation
6
+#
7
+# Unless you and Broadcom execute a separate written software license
8
+# agreement governing use of this software, this software is licensed to you
9
+# under the terms of the GNU General Public License version 2 (the "GPL"),
10
+# available at http://www.broadcom.com/licenses/GPLv2.php, with the
11
+# following added to such license:
12
+#
13
+# As a special exception, the copyright holders of this software give you
14
+# permission to link this software with independent modules, and to copy and
15
+# distribute the resulting executable under terms of your choice, provided that
16
+# you also meet, for each linked independent module, the terms and conditions of
17
+# the license of that module. An independent module is a module which is not
18
+# derived from this software. The special exception does not apply to any
19
+# modifications of the software.
20
+#
21
+# Notwithstanding the above, under no circumstances may you combine this
22
+# software in any way with any other Broadcom software provided under a license
23
+# other than the GPL, without Broadcom's express prior written consent.
24
+#
25
+#
26
+# <<Broadcom-WL-IPTag/Open:>>
27
+#
1228
1329 #####################
1430 # SDIO Basic feature
1531 #####################
32
+CONFIG_DHD_PLATFORM=Rockchip
33
+CONFIG_BCMDHD_OOB=y
34
+CONFIG_BCMDHD_SDIO=y
35
+CONFIG_BCMDHD_WPA3=y
36
+CONFIG_BCMDHD_SDMMC=y
37
+CONFIG_DHD_ANDROID_VTS=y
38
+CONFIG_BCMDHD=m
39
+
1640
1741 DHDCFLAGS += -Wall -Wstrict-prototypes -Dlinux -DLINUX -DBCMDRIVER \
1842 -DBCMDONGLEHOST -DUNRELEASEDCHIP -DBCMDMA32 -DBCMFILEIMAGE \
19
- -DSHOW_EVENTS -DBCMDBG -DWLP2P \
43
+ -DDHDTHREAD -DSHOW_EVENTS -DBCMDBG -DWLP2P \
2044 -DWIFI_ACT_FRAME -DARP_OFFLOAD_SUPPORT \
2145 -DKEEP_ALIVE -DCSCAN -DPKT_FILTER_SUPPORT \
22
- -DEMBEDDED_PLATFORM -DPNO_SUPPORT \
23
- -DCUSTOMER_HW2
24
-# -DCUSTOMER_HW2 -DENABLE_INSMOD_NO_FW_LOAD -DGET_OTP_MAC_ENABLE
46
+ -DEMBEDDED_PLATFORM -DPNO_SUPPORT -DSHOW_LOGTRACE \
47
+ -DGET_CUSTOM_MAC_ENABLE \
48
+ -DSEC_ENHANCEMENT -DDHD_FW_COREDUMP -DCHIPS_CUSTOMER_HW6 \
49
+ -DDHD_RND_DEBUG -DDHD_DUMP_FILE_WRITE_FROM_KERNEL \
50
+ -DDHD_DONOT_FORWARD_BCMEVENT_AS_NETWORK_PKT -DWL11AX
2551
26
-#ifeq ($(CONFIG_SDIO_CIS_CYW43438)$(CONFIG_SDIO_CIS_CYW43012),)
27
-#DHDCFLAGS += -DDHD_DONOT_FORWARD_BCMEVENT_AS_NETWORK_PKT
28
-#endif
52
+GCCVERSIONGTEQ9 := $(shell expr `$(CROSS_COMPILE)gcc -dumpversion | cut -f1 -d.` \>= 9)
53
+ifeq "$(GCCVERSIONGTEQ9)" "1"
54
+ DHDCFLAGS += -Wno-error=date-time
55
+endif
56
+#DHDCFLAGS += $(call cc-disable-warning, date-time)
57
+#DHDCFLAGS += $(call cc-disable-warning, stringop-overflow)
58
+DHDCFLAGS += -Wno-implicit-function-declaration -Wno-incompatible-pointer-types
59
+DHDCFLAGS += -Wno-unused-const-variable -Wno-unused-function
2960
3061 #################
3162 # Common feature
3263 #################
64
+DHDCFLAGS += -DAUTOMOTIVE_FEATURE
65
+DHDCFLAGS += -DWL_VIRTUAL_APSTA
66
+# Dongle init fail
67
+DHDCFLAGS += -DDEBUG_DNGL_INIT_FAIL
68
+DHDCFLAGS += -DPOWERUP_MAX_RETRY=0
69
+DHDCFLAGS += -DWL_SUPPORT_AUTO_CHANNEL
70
+
71
+# Wapi
72
+DHDCFLAGS += -DBCMWAPI_WPI -DBCMWAPI_WAI
73
+
74
+# Allow wl event forwarding as network packet
75
+DHDCFLAGS += -DWL_EVENT_ENAB
76
+
3377 DHDCFLAGS += -DWL_CFG80211
3478 # Print out kernel panic point of file and line info when assertion happened
3579 DHDCFLAGS += -DBCMASSERT_LOG
80
+
81
+# Enable Log Dump
82
+#DHDCFLAGS += -DDHD_LOG_DUMP
83
+DHDCFLAGS += -DOEM_ANDROID
84
+
85
+# Enable Register access via dhd IOVAR
86
+DHDCFLAGS += -DDHD_PCIE_REG_ACCESS -DDHD_BUS_MEM_ACCESS
87
+
88
+# CUSTOMER4 flags
89
+DHDCFLAGS += -DDHD_PKTID_AUDIT_ENABLED
90
+DHDCFLAGS += -DSUPPORT_HIDDEN_AP
91
+DHDCFLAGS += -DPASS_ALL_MCAST_PKTS -DESCAN_BUF_OVERFLOW_MGMT -DPKTPRIO_OVERRIDE
92
+DHDCFLAGS += -DUSE_INITIAL_SHORT_DWELL_TIME
93
+DHDCFLAGS += -DSOFTAP_UAPSD_OFF
94
+DHDCFLAGS += -DSUPPORT_LTECX -DSUPPORT_2G_VHT
95
+DHDCFLAGS += -DSUPPORT_WL_TXPOWER -DBLOCK_IPV6_PACKET -DSUPPORT_DEEP_SLEEP
96
+DHDCFLAGS += -DSUPPORT_AMPDU_MPDU_CMD -DSOFTAP_SEND_HANGEVT -DNUM_SCB_MAX_PROBE=3
97
+DHDCFLAGS += -DCUSTOM_TCPACK_DELAY_TIME=10
98
+DHDCFLAGS += -DDEBUGFS_CFG80211
99
+DHDCFLAGS += -DSUPPORT_SOFTAP_WPAWPA2_MIXED
100
+DHDCFLAGS += -DSUPPORT_2G_VHT -DSUPPORT_5G_1024QAM_VHT
101
+#DHDCFLAGS += -DEWP_ECNTRS_LOGGING
102
+#DHDCFLAGS += -DEWP_ETD_PRSRV_LOGS
103
+DHDCFLAGS += -DCFI_CHECK
104
+
105
+# Runtime PM feature
106
+# DHDCFLAGS += -DDHD_PCIE_RUNTIMEPM -DMAX_IDLE_COUNT=11 -DCUSTOM_DHD_RUNTIME_MS=100
107
+
108
+# DMA64 suppports on 64bit Architecture
109
+ifeq ($(CONFIG_ARM64),y)
110
+ DHDCFLAGS := $(filter-out -DBCMDMA32,$(DHDCFLAGS))
111
+ DHDCFLAGS += -DBCMDMA64OSL
112
+endif
113
+
114
+# DMA64 suppports on x64bit Architecture
115
+#ifeq ($(CONFIG_64BIT),y)
116
+# DHDCFLAGS := $(filter-out -DBCMDMA32,$(DHDCFLAGS))
117
+# DHDCFLAGS += -DBCMDMA64OSL
118
+#endif // endif
119
+
120
+## OOB
121
+ifeq ($(CONFIG_BCMDHD_OOB_HOST_WAKE),y)
122
+ DHDCFLAGS += -DBCMPCIE_OOB_HOST_WAKE
123
+endif
36124
37125 # keepalive
38126 DHDCFLAGS += -DCUSTOM_KEEP_ALIVE_SETTING=28000
39127
40128 DHDCFLAGS += -DVSDB
41129
42
-# Fix __DATE__ & __TIME__ error on gcc version 4.9 or later
43
-GCCVERSION = $(shell $(CC) -dumpversion | cut -f1-2 -d.)
44
-ifeq ($(shell expr $(GCCVERSION) \>= 4.9),1)
45
- DHDCFLAGS += -Wno-error=date-time
46
-endif
47
-
48130 # For p2p connection issue
49131 DHDCFLAGS += -DWL_SCB_TIMEOUT=10
50132
51133 # TDLS enable
52
-DHDCFLAGS += -DWLTDLS
134
+DHDCFLAGS += -DWLTDLS -DWLTDLS_AUTO_ENABLE
53135 # For TDLS tear down inactive time 40 sec
54
-DHDCFLAGS += -DCUSTOM_TDLS_IDLE_MODE_SETTING=40000
136
+DHDCFLAGS += -DCUSTOM_TDLS_IDLE_MODE_SETTING=10000
55137 # for TDLS RSSI HIGH for establishing TDLS link
56
-DHDCFLAGS += -DCUSTOM_TDLS_RSSI_THRESHOLD_HIGH=-60
138
+DHDCFLAGS += -DCUSTOM_TDLS_RSSI_THRESHOLD_HIGH=-80
57139 # for TDLS RSSI HIGH for tearing down TDLS link
58
-DHDCFLAGS += -DCUSTOM_TDLS_RSSI_THRESHOLD_LOW=-70
140
+DHDCFLAGS += -DCUSTOM_TDLS_RSSI_THRESHOLD_LOW=-85
59141
60
-# Roaming/
142
+# Roaming
61143 DHDCFLAGS += -DROAM_AP_ENV_DETECTION
62144 DHDCFLAGS += -DROAM_ENABLE -DROAM_CHANNEL_CACHE -DROAM_API
63145 DHDCFLAGS += -DENABLE_FW_ROAM_SUSPEND
64146 # Roaming trigger
65147 DHDCFLAGS += -DCUSTOM_ROAM_TRIGGER_SETTING=-75
66148 DHDCFLAGS += -DCUSTOM_ROAM_DELTA_SETTING=10
67
-# Voice Enterprise
68
-DHDCFLAGS += -DWLFBT
69149 # Set PM 2 always regardless suspend/resume
70150 DHDCFLAGS += -DSUPPORT_PM2_ONLY
151
+
152
+# FT roam
153
+DHDCFLAGS += -DWLFBT -DGTK_OFFLOAD_SUPPORT
154
+DHDCFLAGS += -DBCMCCX
155
+DHDCFLAGS += -DWBTEXT
156
+DHDCFLAGS += -DDHD_LOSSLESS_ROAMING
157
+
158
+# Hog flags
159
+#DHDCFLAGS += -DENABLE_HOGSQS
160
+#ifeq ($(ENABLE_HOGSQS), y)
161
+#DHDCFLAGS += -DM_HOGSQS_CFG=0x1910
162
+#endif // endif
71163
72164 # For special PNO Event keep wake lock for 10sec
73165 DHDCFLAGS += -DCUSTOM_PNO_EVENT_LOCK_xTIME=10
74166 DHDCFLAGS += -DMIRACAST_AMPDU_SIZE=8
75
-
167
+#Vendor Extension
168
+#DHDCFLAGS += -DWL_VENDOR_EXT_SUPPORT
76169 #Gscan
77170 DHDCFLAGS += -DGSCAN_SUPPORT
78
-#RTT
79
-DHDCFLAGS += -DRTT_SUPPORT -DRTT_DEBUG
80
-
171
+#PNO Scan Result Version
172
+DHDCFLAGS += -DPFN_SCANRESULT_2
173
+#RSSI Monitor
174
+DHDCFLAGS += -DRSSI_MONITOR_SUPPORT
175
+#APF
176
+DHDCFLAGS += -DAPF
177
+#NDOffload
178
+DHDCFLAGS += -DNDO_CONFIG_SUPPORT
179
+DHDCFLAGS += -DIPV6_NDO_SUPPORT
81180
82181 #Link Statistics
83182 DHDCFLAGS += -DLINKSTAT_SUPPORT
183
+
184
+#Debugaility
185
+DHDCFLAGS += -DDBG_PKT_MON -DDBG_PKT_MON_INIT_DEFAULT
186
+DHDCFLAGS += -DWL_SCHED_SCAN
187
+DHDCFLAGS += -DDNGL_EVENT_SUPPORT
188
+
189
+#RSSI Monitor
190
+DHDCFLAGS += -DRSSI_MONITOR_SUPPORT
84191
85192 # Early suspend
86193 DHDCFLAGS += -DDHD_USE_EARLYSUSPEND
87194
88195 # For Scan result patch
89196 DHDCFLAGS += -DESCAN_RESULT_PATCH
197
+
198
+# NAN
199
+#DHDCFLAGS += -DWL_NAN -DWL_NAN_DISC_CACHE
200
+
201
+
202
+ifeq ($(CONFIG_DHD_PLATFORM), Rockchip)
203
+ DHDCFLAGS += -DCONFIG_DHD_PLAT_ROCKCHIP
204
+ DHDCFLAGS += -DWL_ENABLE_P2P_IF
205
+ DHDCFLAGS += -DDHD_FIRMWARE_DIR_PATH=\"/vendor/etc/firmware\"
206
+ifeq ($(CONFIG_BCMDHD_SDIO),y)
207
+ DHDCFLAGS += -DDHD_OF_SUPPORT
208
+ DHDCFLAGS += -DDHD_CUSTOM_PLAT_DATA
209
+# DHDCFLAGS += -DDHD_SDIO_MEM_BUF
210
+# DHDCFLAGS += -DANDROID_SDIO_RESET
211
+ DHDOFILES += dhd_custom_rockchip.o
212
+endif
213
+ifeq ($(CONFIG_BCMDHD_OOB),y)
214
+ DHDCFLAGS += -DOOB_INTR_ONLY -DCUSTOMER_OOB -DHW_OOB
215
+else
216
+ DHDCFLAGS += -DSDIO_ISR_THREAD
217
+endif
218
+endif
219
+
90220
91221 # For Static Buffer
92222 ifeq ($(CONFIG_DHD_USE_STATIC_BUF),y)
....@@ -96,9 +226,6 @@
96226 ifneq ($(CONFIG_DHD_USE_SCHED_SCAN),)
97227 DHDCFLAGS += -DWL_SCHED_SCAN
98228 endif
99
-
100
-# Ioctl timeout 5000ms
101
-DHDCFLAGS += -DIOCTL_RESP_TIMEOUT=5000
102229
103230 # Prevent rx thread monopolize
104231 DHDCFLAGS += -DWAIT_DEQUEUE
....@@ -113,15 +240,61 @@
113240 DHDCFLAGS += -DWL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST
114241 DHDCFLAGS += -DWL_CFG80211_STA_EVENT
115242 DHDCFLAGS += -DWL_IFACE_COMB_NUM_CHANNELS
116
-DHDCFLAGS += -DWL_ENABLE_P2P_IF
243
+DHDCFLAGS += -DWL_SUPPORT_MULTIP2P
117244 #SCAN time
118245 DHDCFLAGS += -DCUSTOM_SET_SHORT_DWELL_TIME
119246 DHDCFLAGS += -DCUSTOM_FORCE_NODFS_FLAG
247
+ifeq ($(CONFIG_ANDROID),y)
248
+ DHDCFLAGS += -DKEEP_WIFION_OPTION
249
+ DHDCFLAGS += -Wno-date-time
120250
251
+# To support android12 Wifi-HAL
252
+ifeq ($(CONFIG_ANDROID12),y)
253
+ DHDCFLAGS += -DANDROID12_SUPPORT
254
+endif
255
+
256
+# To support ACS on hostapd
257
+# DHDCFLAGS += -DWL_SUPPORT_ACS_OFFLOAD
258
+endif
121259
122260 # SoftAP
123261 DHDCFLAGS += -DSET_RANDOM_MAC_SOFTAP
124262 DHDCFLAGS += -DWL_CFG80211_ACL
263
+ifeq ($(CONFIG_WL_AP_IF),y)
264
+ DHDCFLAGS += -DWL_STATIC_IF
265
+ DHDCFLAGS += -DDHD_NUM_STATIC_IFACES=2
266
+endif
267
+
268
+# QT support
269
+ifeq ($(CONFIG_QT), y)
270
+ DHDCFLAGS += -DBCMQT_HW -DBCMSLTGT -DBCMQT
271
+endif
272
+
273
+# Disable FRAMEBURST on VSDB
274
+DHDCFLAGS += -DDISABLE_FRAMEBURST_VSDB
275
+
276
+# WPS
277
+DHDCFLAGS += -DWL_WPS_SYNC -DBCMCRYPTO_COMPONENT
278
+
279
+#WPA3
280
+ifneq ($(CONFIG_BCMDHD_WPA3),)
281
+ DHDCFLAGS += -DWL_SAE
282
+endif
283
+
284
+ifneq ($(CONFIG_BCMDHD_PCIE),)
285
+DHDCFLAGS += -DDHD_4WAYM4_FAIL_DISCONNECT
286
+endif
287
+
288
+#6Ghz
289
+ifneq ($(CONFIG_BCMDHD_6E),)
290
+ DHDCFLAGS += -DWL_6E
291
+endif
292
+
293
+# Uncomment the below line for AP to receive disconnect management frame.
294
+# DHDCFLAGS += -DWL_CFG80211_AP_RX_MGMT_DISCONNECT
295
+
296
+# Bandsteer support
297
+# DHDCFLAGS += -DDHD_BANDSTEER
125298
126299 ##########################
127300 # driver type
....@@ -130,194 +303,271 @@
130303 ##########################
131304 DRIVER_TYPE ?= $(CONFIG_CYW_BCMDHD)
132305
306
+#############################
307
+# Bring up WARs for CYW89570.
308
+# # To be removed later
309
+# #############################
310
+ifneq ($(CONFIG_WIRELESS_EXT),)
311
+ DHDOFILES += wl_iw.o bcm_app_utils.o
312
+ DHDCFLAGS += -DWL_WIRELESS_EXT -DWLLXIW -DUSE_IW
313
+endif
314
+
315
+ifeq ($(CONFIG_TRXHDR_V3),y)
316
+ DHDCFLAGS += -DBCMTRXV3
317
+else
318
+ DHDCFLAGS += -DBCMTRXV4
319
+endif
320
+
133321 #########################
134322 # Chip dependent feature
135323 #########################
136324
137
-DHDCFLAGS += -DUSE_WL_TXBF
138
-# DHDCFLAGS += -DUSE_WL_FRAMEBURST
139
-DHDCFLAGS += -DCUSTOM_DPC_CPUCORE=0
140
-DHDCFLAGS += -DPROP_TXSTATUS_VSDB
141
-DHDCFLAGS += -DCUSTOM_PSPRETEND_THR=30
325
+ DHDCFLAGS += -DUSE_WL_TXBF
326
+ DHDCFLAGS += -DCUSTOM_DPC_CPUCORE=0
327
+
142328 # New Features
143
-DHDCFLAGS += -DWL11U
144
-DHDCFLAGS += -DMFP
145
-# The LPC would have the Tx 5G tput drop around 10Mbps but saving powers
329
+ DHDCFLAGS += -DWL11U
330
+ DHDCFLAGS += -DMFP
331
+# Disabling LPC for 89570 for now.
146332 # DHDCFLAGS += -DDHD_ENABLE_LPC
147
-DHDCFLAGS += -DCUSTOM_COUNTRY_CODE
333
+ DHDCFLAGS += -DCUSTOM_COUNTRY_CODE
334
+ DHDCFLAGS += -DNDO_CONFIG_SUPPORT
335
+ DHDCFLAGS += -DIPV6_NDO_SUPPORT
336
+ DHDCFLAGS += -DIGUANA_LEGACY_CHIPS
148337
149
-### Platform dependent START
150
-DHD_PLATFORM ?= rockchip
151
-
152
-#Rochip Platform
153
-ifeq ($(DHD_PLATFORM), rockchip)
154
- CONFIG_BCMDHD_SDIO = y
155
- CONFIG_BCMDHD_OOB = y
156
- CONFIG_PLAT_ROCKCHIP = y
157
-
158
- ## We only add here for the flags in our rockchip code
159
- DHDCFLAGS += -DANDROID_SDIO_RESET
160
- DHDCFLAGS += -DCUSTOM_SDIO_F2_BLKSIZE=256
161
- DHDCFLAGS += -DDHD_OF_SUPPORT
162
- DHDCFLAGS += -DCONFIG_PLAT_ROCKCHIP
163
-ifeq ($(CONFIG_BCMDHD_OOB),y)
164
-DHDCFLAGS += -DOOB_INTR_ONLY -DCUSTOMER_OOB -DHW_OOB
165
-ifeq ($(CONFIG_BCMDHD_DISABLE_WOWLAN),y)
166
-DHDCFLAGS += -DDISABLE_WOWLAN
167
-endif
168
-else
169
-DHDCFLAGS += -DSDIO_ISR_THREAD
170
-endif
171
- DHDCFLAGS += -DHOST_FLAG
172
- DHDCFLAGS += -DLOAD_DHD_WITH_FW_ALIVE
173
- FW_ALIVE = 1
174
-endif
175
-
176
-ifeq ($(DHD_PLATFORM), ingenic)
177
- CONFIG_BCMDHD_SDIO = y
178
- ## We only add here for the flags in our generic code
179
- DHDCFLAGS += -DOOB_INTR_ONLY -DHW_OOB
180
- DHDCFLAGS += -DCUSTOM_SDIO_F2_BLKSIZE=128
181
- DHDCFLAGS += -DDHD_OF_SUPPORT -DCUSTOMER_OOB
182
- DHDCFLAGS += -DLOAD_DHD_WITH_FW_ALIVE
183
- FW_ALIVE = 1
184
-endif
185
-
186
-
187
-ifeq ($(DHD_PLATFORM), imx_android)
188
- CONFIG_BCMDHD_SDIO = y
189
-# Config DTS support
190
- DHDCFLAGS += -DCONFIG_DTS
191
-# for iMX platform
192
- DHDCFLAGS += -DCUSTOMER_IMX
193
- DHDCFLAGS += -DOOB_INTR_ONLY -DHW_OOB
194
- DHDCFLAGS += -DANDROID_SDIO_RESET
195
-# The flags only worked for supported host
196
-# Remove it if you found the dhdsdio_rxglom erros
197
- DHDCFLAGS += -DCUSTOM_RXCHAIN=1
198
-endif
199
-
200
-ifeq ($(DHD_PLATFORM), imx)
201
- CONFIG_BCMDHD_SDIO = y
202
-# Config DTS support
203
- DHDCFLAGS += -DCONFIG_DTS
204
-# for iMX platform
205
- DHDCFLAGS += -DCUSTOMER_IMX
206
- DHDCFLAGS += -DOOB_INTR_ONLY -DHW_OOB
207
-# The flags only worked for supported host
208
-# Remove it if you found the dhdsdio_rxglom erros
209
- DHDCFLAGS += -DCUSTOM_RXCHAIN=1
210
-endif
211
-
212
-ifeq ($(CONFIG_BCMDHD_PCIE), y)
213
- CONFIG_BCMDHD_PCIE = y
214
-else
215
-ifeq ($(CONFIG_BCMDHD_USB), y)
216
- CONFIG_BCMDHD_USB = y
217
-else
218
- CONFIG_BCMDHD_SDIO = y
338
+ifeq ($(CONFIG_BCMDHD_SDMMC),y)
339
+ DHDCFLAGS += -DBCMLXSDMMC -DCUSTOM_TXGLOM=1
340
+ifneq ($(CONFIG_HAVE_IMX8_SOC),)
341
+ DHDCFLAGS += \
342
+ -DCONFIG_DTS \
343
+ -DOEM_EMBEDDED_LINUX \
344
+ -DPLATFORM_IMX \
345
+ -DSDIO_ISR_THREAD \
346
+ -DWL_VIF_SUPPORT
219347 endif
220348 endif
221349
222
-### Platform dependent END
350
+ifeq ($(CONFIG_BCMDHD_SDIOH_STD),y)
351
+ DHDCFLAGS += -DBCMSDIOH_STD
352
+endif
223353
224
-ifneq ($(CONFIG_BCMDHD_SDIO),)
225
- DHDCFLAGS += -DBDC -DTOE -DDHD_BCMEVENTS -DMMC_SDIO_ABORT
226
- DHDCFLAGS += -DBCMSDIO -DBCMLXSDMMC -DUSE_SDIOFIFO_IOVAR
227
- DHDCFLAGS += -DPROP_TXSTATUS
228
- DHDCFLAGS += -DCUSTOM_AMPDU_MPDU=16
229
- DHDCFLAGS += -DCUSTOM_AMPDU_BA_WSIZE=64
354
+ifeq ($(CONFIG_BCMDHD_SDIO),y)
355
+ DHDCFLAGS += -DBDC -DHW_OOB -DDHD_BCMEVENTS -DMMC_SDIO_ABORT
356
+ DHDCFLAGS += -DBCMSDIO -DUSE_SDIOFIFO_IOVAR
357
+ DHDCFLAGS += -DPROP_TXSTATUS -DLIMIT_BORROW
358
+ DHDCFLAGS += -DPROP_TXSTATUS_VSDB
359
+ DHDCFLAGS += -DUSE_WL_FRAMEBURST
230360 # tput enhancement
231
- DHDCFLAGS += -DCUSTOM_GLOM_SETTING=8
232
- DHDCFLAGS += -DBCMSDIOH_TXGLOM -DCUSTOM_TXGLOM=1
361
+ DHDCFLAGS += -DCUSTOM_GLOM_SETTING=8 -DCUSTOM_RXCHAIN=1
362
+ DHDCFLAGS += -DUSE_DYNAMIC_F2_BLKSIZE -DDYNAMIC_F2_BLKSIZE_FOR_NONLEGACY=128
363
+ DHDCFLAGS += -DBCMSDIOH_TXGLOM -DAMPDU_HOSTREORDER
233364 DHDCFLAGS += -DDHDTCPACK_SUPPRESS
234365 DHDCFLAGS += -DRXFRAME_THREAD
235
- DHDCFLAGS += -DCUSTOM_MAX_TXGLOM_SIZE=31
366
+ DHDCFLAGS += -DREPEAT_READFRAME
367
+ DHDCFLAGS += -DCUSTOM_MAX_TXGLOM_SIZE=40
236368 DHDCFLAGS += -DMAX_HDR_READ=128
237
- DHDCFLAGS += -DDHD_FIRSTREAD=128
238
- # bcn_timeout
239
- DHDCFLAGS += -DCUSTOM_BCN_TIMEOUT=5
240
- endif
369
+ DHDCFLAGS += -DDHD_FIRSTREAD=64
370
+ifneq ($(CONFIG_BCM4373),)
371
+ DHDCFLAGS += -DCUSTOM_AMPDU_BA_WSIZE=32
372
+else
373
+ DHDCFLAGS += -DCUSTOM_AMPDU_BA_WSIZE=64
374
+
375
+endif
376
+
377
+# bcn_timeout
378
+ DHDCFLAGS += -DCUSTOM_BCN_TIMEOUT_SETTING=5
379
+
380
+ DHDCFLAGS += -DWLFC_STATE_PREALLOC
381
+ DHDCFLAGS += -DREVERSE_AIFSN
382
+
383
+# btsharedsdio
384
+ifneq ($(CONFIG_BT_OVER_SDIO),)
385
+ DHDCFLAGS += -DBT_OVER_SDIO
386
+endif
387
+endif
388
+
389
+# Expand TCP tx queue to 10 times of default size
390
+ DHDCFLAGS += -DTSQ_MULTIPLIER=10
241391
242392 ifneq ($(CONFIG_BCMDHD_PCIE),)
243393 DHDCFLAGS += -DPCIE_FULL_DONGLE -DBCMPCIE -DCUSTOM_DPC_PRIO_SETTING=-1
244394 # tput enhancement
245395 DHDCFLAGS += -DCUSTOM_AMPDU_BA_WSIZE=64
246
- DHDCFLAGS += -DCUSTOM_AMPDU_MPDU=32
247
- DHDCFLAGS += -DCUSTOM_AMPDU_RELEASE=16
396
+ DHDCFLAGS += -DPROP_TXSTATUS_VSDB
397
+# Disable watchdog thread
398
+ DHDCFLAGS += -DCUSTOM_DHD_WATCHDOG_MS=0
399
+# HEAP ASLR
400
+ DHDCFLAGS += -DBCM_ASLR_HEAP
401
+ DHDCFLAGS += -DMAX_CNTL_TX_TIMEOUT=1
402
+ifneq ($(CONFIG_ARCH_MSM),)
403
+ DHDCFLAGS += -DMSM_PCIE_LINKDOWN_RECOVERY
404
+endif
405
+ifeq ($(CONFIG_DHD_USE_STATIC_BUF),y)
406
+ DHDCFLAGS += -DDHD_USE_STATIC_IOCTLBUF
407
+endif
408
+
409
+# Enable health check event handling
410
+ DHDCFLAGS += -DDNGL_EVENT_SUPPORT
411
+ DHDCFLAGS += -DHCHK_COMMON_SW_EVENT
412
+ifneq ($(CONFIG_DHD_OF_SUPPORT),)
413
+ DHDCFLAGS += -DDHD_OF_SUPPORT
414
+ DHDOFILES += dhd_custom_msm.o
415
+ifneq ($(CONFIG_BROADCOM_WIFI_RESERVED_MEM),)
416
+ DHDOFILES += dhd_custom_memprealloc.o
417
+endif
418
+endif
419
+
420
+# Enable Load Balancing support by default.
421
+# DHD_LB_RXP - Perform RX Packet processing in parallel
422
+# DHD_LB_STATS - To display the Load Blancing statistics
423
+DHDCFLAGS += -DDHD_LB -DDHD_LB_RXP -DDHD_LB_STATS
424
+DHDCFLAGS += -DDHD_LB_PRIMARY_CPUS=0xF0 -DDHD_LB_SECONDARY_CPUS=0x0E
425
+
426
+# Runtime PM feature
427
+# DHDCFLAGS += -DDHD_PCIE_RUNTIMEPM -DMAX_IDLE_COUNT=11 -DCUSTOM_DHD_RUNTIME_MS=100
428
+
429
+# debug info
430
+ DHDCFLAGS += -DDHD_WAKE_STATUS -DDHD_WAKE_RX_STATUS
431
+
432
+# Enable SSSR Dump
433
+ DHDCFLAGS += -DDHD_SSSR_DUMP
434
+endif
435
+
436
+# Print 802.1X packets
437
+ DHDCFLAGS += -DDHD_8021X_DUMP
438
+# prioritize 802.1x packet
439
+ DHDCFLAGS += -DEAPOL_PKT_PRIO
440
+
441
+# Enable MSI interrupt Support
442
+ DHDCFLAGS += -DDHD_MSI_SUPPORT
443
+
444
+# Enabling temporarily due to build failure
445
+ DHDCFLAGS += -DDHD_PKTTS -DTX_STATUS_LATENCY_STATS
446
+
447
+ifneq ($(filter y, $(CONFIG_BCM4354) $(CONFIG_BCM4356)),)
448
+ DHDCFLAGS += -DUSE_WL_TXBF
449
+ DHDCFLAGS += -DUSE_WL_FRAMEBURST
450
+ DHDCFLAGS += -DCUSTOM_DPC_CPUCORE=0
451
+ DHDCFLAGS += -DPROP_TXSTATUS_VSDB
452
+ DHDCFLAGS += -DCUSTOM_PSPRETEND_THR=30
453
+ DHDCFLAGS += -DMAX_AP_CLIENT_CNT=10
454
+ DHDCFLAGS += -DMAX_GO_CLIENT_CNT=5
455
+# New Features
456
+ DHDCFLAGS += -DWL11U
457
+ DHDCFLAGS += -DMFP
458
+ DHDCFLAGS += -DDHD_ENABLE_LPC
459
+ DHDCFLAGS += -DCUSTOM_COUNTRY_CODE
460
+ DHDCFLAGS += -DSAR_SUPPORT
461
+# debug info
462
+ DHDCFLAGS += -DDHD_WAKE_STATUS
463
+ifeq ($(CONFIG_BCMDHD_SDIO),y)
464
+ DHDCFLAGS += -DBDC -DOOB_INTR_ONLY -DHW_OOB -DDHD_BCMEVENTS -DMMC_SDIO_ABORT
465
+ DHDCFLAGS += -DBCMSDIO -DBCMLXSDMMC -DUSE_SDIOFIFO_IOVAR
466
+ DHDCFLAGS += -DPROP_TXSTATUS
467
+ DHDCFLAGS += -DCUSTOM_AMPDU_MPDU=16
468
+ DHDCFLAGS += -DCUSTOM_AMPDU_BA_WSIZE=64
469
+# tput enhancement
470
+ DHDCFLAGS += -DCUSTOM_GLOM_SETTING=8 -DCUSTOM_RXCHAIN=1
471
+ DHDCFLAGS += -DUSE_DYNAMIC_F2_BLKSIZE -DDYNAMIC_F2_BLKSIZE_FOR_NONLEGACY=128
472
+ DHDCFLAGS += -DBCMSDIOH_TXGLOM -DCUSTOM_TXGLOM=1 -DBCMSDIOH_TXGLOM_HIGHSPEED
473
+ DHDCFLAGS += -DDHDTCPACK_SUPPRESS
474
+ DHDCFLAGS += -DRXFRAME_THREAD
475
+ DHDCFLAGS += -DREPEAT_READFRAME
476
+ DHDCFLAGS += -DCUSTOM_MAX_TXGLOM_SIZE=40
477
+ DHDCFLAGS += -DMAX_HDR_READ=128
478
+ DHDCFLAGS += -DDHD_FIRSTREAD=128
479
+# bcn_timeout
480
+ DHDCFLAGS += -DCUSTOM_BCN_TIMEOUT=5
481
+ DHDCFLAGS += -DWLFC_STATE_PREALLOC
482
+endif
483
+
484
+ifneq ($(CONFIG_BCMDHD_PCIE),)
485
+ DHDCFLAGS += -DPCIE_FULL_DONGLE -DBCMPCIE -DCUSTOM_DPC_PRIO_SETTING=-1
486
+# tput enhancement
487
+ DHDCFLAGS += -DCUSTOM_AMPDU_BA_WSIZE=64
248488 DHDCFLAGS += -DPROP_TXSTATUS_VSDB
249489 # Disable watchdog thread
250490 DHDCFLAGS += -DCUSTOM_DHD_WATCHDOG_MS=0
251491 DHDCFLAGS += -DMAX_CNTL_TX_TIMEOUT=1
252492 DHDCFLAGS += -DSUPPORT_LINKDOWN_RECOVERY
493
+# Enable health check event handling
494
+ DHDCFLAGS += -DDNGL_EVENT_SUPPORT
495
+ DHDCFLAGS += -DHCHK_COMMON_SW_EVENT
253496 endif
254
-
255
-ifneq ($(CONFIG_BCMDHD_USB),)
256
- DHDCFLAGS += -DBDC -DTOE
257
- DHDCFLAGS += -DDHD_BCMEVENTS -DSHOW_EVENTS -DSHOW_LOGTRACE
258
- DHDCFLAGS += -DBCMDHDUSB -DBCMDBUS -DBCMTRXV2 -DDBUS_USB_LOOPBACK
259
- DHDCFLAGS += -DPROP_TXSTATUS
260
- DHDCFLAGS += -DLIMIT_BORROW
261
-endif
262
-
263497 ifeq ($(CONFIG_DHD_USE_STATIC_BUF),y)
264498 DHDCFLAGS += -DDHD_USE_STATIC_IOCTLBUF
265499 endif
266500 # Print 802.1X packets
267
-DHDCFLAGS += -DDHD_8021X_DUMP
501
+ DHDCFLAGS += -DDHD_8021X_DUMP
268502 # Print DHCP packets
269
-DHDCFLAGS += -DDHD_DHCP_DUMP
503
+ DHDCFLAGS += -DDHD_DHCP_DUMP
504
+endif
270505
506
+ifneq ($(CONFIG_BCM4339),)
507
+ DHDCFLAGS += -DBCM4339_CHIP -DHW_OOB
271508
272
-EXTRA_LDFLAGS += --strip-debug
509
+ # tput enhancement
510
+ DHDCFLAGS += -DCUSTOM_GLOM_SETTING=8 -DCUSTOM_RXCHAIN=1
511
+ DHDCFLAGS += -DUSE_DYNAMIC_F2_BLKSIZE -DDYNAMIC_F2_BLKSIZE_FOR_NONLEGACY=128
512
+ DHDCFLAGS += -DBCMSDIOH_TXGLOM -DCUSTOM_TXGLOM=1 -DBCMSDIOH_TXGLOM_HIGHSPEED
513
+ DHDCFLAGS += -DDHDTCPACK_SUPPRESS
514
+ DHDCFLAGS += -DUSE_WL_TXBF
515
+ DHDCFLAGS += -DUSE_WL_FRAMEBURST
516
+ DHDCFLAGS += -DRXFRAME_THREAD
517
+ DHDCFLAGS += -DCUSTOM_AMPDU_BA_WSIZE=64
518
+ DHDCFLAGS += -DCUSTOM_DPC_CPUCORE=0
519
+ DHDCFLAGS += -DPROP_TXSTATUS_VSDB
520
+ DHDCFLAGS += -DCUSTOM_MAX_TXGLOM_SIZE=32
521
+
522
+ # New Features
523
+ DHDCFLAGS += -DWL11U
524
+ DHDCFLAGS += -DDHD_ENABLE_LPC
525
+ DHDCFLAGS += -DCUSTOM_PSPRETEND_THR=30
526
+endif
527
+
528
+#EXTRA_LDFLAGS += --strip-debug
273529
274530 ifeq ($(DRIVER_TYPE),y)
531
+ DHDCFLAGS += -DENABLE_INSMOD_NO_FW_LOAD
275532 DHDCFLAGS += -DUSE_LATE_INITCALL_SYNC
533
+ # Use kernel strlcpy() implementation instead of one, defined in bcmstdlib_s.c
534
+ DHDCFLAGS += -DBCM_USE_PLATFORM_STRLCPY
276535 endif
277536
278
-## Attend to fix the suspend/resume -16 error issue, refer to SWDHD-409
279
-DHDCFLAGS += -DSUSPEND16
537
+DHDOFILES += dhd_pno.o dhd_common.o dhd_ip.o dhd_custom_gpio.o \
538
+ dhd_linux.o dhd_linux_sched.o dhd_cfg80211.o dhd_linux_wq.o aiutils.o \
539
+ bcmevent.o bcmutils.o bcmwifi_channels.o hndpmu.o linux_osl.o linux_pkt.o \
540
+ sbutils.o siutils.o wl_android.o wl_roam.o wl_cfg80211.o wl_cfgscan.o wl_cfgp2p.o \
541
+ wl_cfg_btcoex.o wldev_common.o dhd_linux_platdev.o \
542
+ dhd_pno.o dhd_linux_pktdump.o wl_cfg_btcoex.o hnd_pktq.o \
543
+ hnd_pktpool.o wl_cfgvendor.o bcmxtlv.o bcm_app_utils.o dhd_debug.o \
544
+ dhd_debug_linux.o dhd_mschdbg.o bcmbloom.o dhd_dbg_ring.o bcmstdlib_s.o \
545
+ dhd_linux_exportfs.o
280546
281
-
282
-## Flags merged from Linux build
283
-DHDCFLAGS += -DCUSTOMER_IPCAM -DWL11ULB -DWL_NAN -DWL_SUPPORT_AUTO_CHANNEL -DWL_VIRTUAL_APSTA
284
-
285
-## Flags that may depends on Linux kernel versions
286
-DHDCFLAGS += -DTSQ_MULTIPLIER=10
287
-
288
-## Flags maybe useful but disable it
289
-
290
-# The WLFC AC queue credit borrow
291
-# DHDCFLAGS += -DLIMIT_BORROW
292
-
293
-# Advanced IBSS features
294
-# DHDCFLAGS += -DWLAIBSS -DWLAIBSS_PS
295
-
296
-# p2P service discovery offload
297
-# DHDCFLAGS += -DWL_SDO
298
-
299
-EXTRA_CFLAGS += $(DHDCFLAGS) -DDHD_DEBUG
300
-EXTRA_CFLAGS += -DSRCBASE=\"$(src)\"
301
-EXTRA_CFLAGS += -I$(src)/include/ -I$(src)/
302
-KBUILD_CFLAGS += -I$(LINUXDIR)/include -I$(shell pwd)
303
-
304
-DHDOFILES := dhd_pno.o dhd_common.o dhd_ip.o dhd_custom_gpio.o \
305
- dhd_linux.o dhd_linux_sched.o dhd_cfg80211.o dhd_linux_wq.o aiutils.o bcmevent.o \
306
- bcmutils.o bcmwifi_channels.o hndpmu.o linux_osl.o sbutils.o siutils.o \
307
- wl_android.o wl_cfg80211.o wl_cfgp2p.o wl_cfg_btcoex.o wldev_common.o wl_linux_mon.o \
308
- dhd_linux_platdev.o dhd_pno.o dhd_rtt.o dhd_linux_wq.o wl_cfg_btcoex.o \
309
- hnd_pktq.o hnd_pktpool.o wl_cfgvendor.o dhd_debug_linux.o bcmxtlv.o dhd_debug.o bcm_app_utils.o \
310
- wl_cfgnan.o
311
-
312
-ifeq ($(FW_ALIVE), 1)
313
- DHDCFLAGS += -DLOAD_DHD_WITH_FW_ALIVE
314
- DHDOFILES += dhd_chip_info.o
547
+ifneq ($(CONFIG_DHD_MONITOR_INTERFACE),)
548
+ DHDCFLAGS += -DDHD_MONITOR_INTERFACE
549
+ DHDOFILES += wl_linux_mon.o
315550 endif
316551
552
+ifneq ($(CONFIG_DHD_OF_SUPPORT),)
553
+ DHDCFLAGS += -DDHD_OF_SUPPORT
554
+ DHDOFILES += dhd_custom_msm.o
555
+ifneq ($(CONFIG_BROADCOM_WIFI_RESERVED_MEM),)
556
+ DHDOFILES += dhd_custom_memprealloc.o
557
+endif
558
+endif
317559
318
-ifneq ($(CONFIG_BCMDHD_SDIO),)
319
- DHDOFILES += bcmsdh.o bcmsdh_linux.o bcmsdh_sdmmc.o bcmsdh_sdmmc_linux.o
560
+ifeq ($(CONFIG_BCMDHD_SDMMC),y)
561
+ DHDOFILES += bcmsdh_sdmmc.o bcmsdh_sdmmc_linux.o
562
+endif
563
+
564
+ifeq ($(CONFIG_BCMDHD_SDIO),y)
565
+ DHDOFILES += bcmsdh.o bcmsdh_linux.o
320566 DHDOFILES += dhd_cdc.o dhd_wlfc.o dhd_sdio.o
567
+endif
568
+
569
+ifeq ($(CONFIG_BCMDHD_SDIOH_STD),y)
570
+ DHDOFILES += bcmsdstd.o bcmsdstd_linux.o
321571 endif
322572
323573 ifneq ($(CONFIG_BCMDHD_PCIE),)
....@@ -325,21 +575,28 @@
325575 DHDOFILES += pcie_core.o
326576 endif
327577
328
-ifneq ($(CONFIG_BCMDHD_USB),)
329
- DHDOFILES += dbus.o dbus_usb.o dbus_usb_linux.o
330
- DHDOFILES += dhd_cdc.o dhd_wlfc.o
578
+ifneq ($(filter -DDHD_LB, $(DHDCFLAGS)),)
579
+DHDOFILES += dhd_linux_lb.o
580
+endif
581
+ifneq ($(filter -DDHD_BANDSTEER, $(DHDCFLAGS)),)
582
+ DHDOFILES += dhd_bandsteer.o
331583 endif
332584
333
-ifneq ($(CONFIG_PLAT_ROCKCHIP),)
334
- DHDOFILES += dhd_gpio.o
585
+ifneq ($(CONFIG_QT),y)
586
+ DHDCFLAGS += -DRTT_SUPPORT -DRTT_DEBUG
587
+ DHDOFILES += dhd_rtt.o
335588 endif
589
+EXTRA_CFLAGS += $(DHDCFLAGS) -DDHD_DEBUG
590
+EXTRA_CFLAGS += -DSRCBASE=\"$(src)\"
591
+EXTRA_CFLAGS += -I$(src)/include/ -I$(src)/
592
+KBUILD_CFLAGS += -I$(KDIR)/include -I$(CURDIR)
336593
337
-cywdhd-objs := $(DHDOFILES)
338
-obj-$(DRIVER_TYPE) += cywdhd.o
594
+bcmdhd-objs := $(DHDOFILES)
595
+obj-$(DRIVER_TYPE) += bcmdhd.o
339596
340597 all:
341
- @echo "$(MAKE) --no-print-directory -C $(KDIR) SUBDIRS=$(CURDIR) modules"
342
- @$(MAKE) --no-print-directory -C $(KDIR) SUBDIRS=$(CURDIR) modules
598
+ @echo "$(MAKE) --no-print-directory -C $(KDIR) M=$(CURDIR) modules"
599
+ @$(MAKE) --no-print-directory -C $(KDIR) M=$(CURDIR) modules
343600
344601 clean:
345602 rm -rf *.o *.ko *.mod.c *~ .*.cmd *.o.cmd .*.o.cmd \