6b1f9573b11f3aed12e6b200cb592d7e92d88da6
[GitHub/LineageOS/android_kernel_samsung_universal7580.git] / drivers / net / wireless / bcmdhd_1_77 / dhd_sec_feature.h
1 /*
2 * Customer HW 4 dependant file
3 *
4 * Copyright (C) 1999-2017, Broadcom Corporation
5 *
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
11 *
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
19 *
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
23 *
24 *
25 * <<Broadcom-WL-IPTag/Open:>>
26 *
27 * $Id: dhd_sec_feature.h$
28 */
29
30
31 /*
32 * ** Desciption ***
33 * 1. Module vs COB
34 * If your model's WIFI HW chip is COB type, you must add below feature
35 * - #undef USE_CID_CHECK
36 * - #define READ_MACADDR
37 * Because COB type chip have not CID and Mac address.
38 * So, you must add below feature to defconfig file.
39 * - CONFIG_WIFI_BROADCOM_COB
40 *
41 * 2. PROJECTS
42 * If you want add some feature only own Project, you can add it in 'PROJECTS' part.
43 *
44 * 3. Region code
45 * If you want add some feature only own region model, you can use below code.
46 * - 100 : EUR OPEN
47 * - 101 : EUR ORG
48 * - 200 : KOR OPEN
49 * - 201 : KOR SKT
50 * - 202 : KOR KTT
51 * - 203 : KOR LGT
52 * - 300 : CHN OPEN
53 * - 400 : USA OPEN
54 * - 401 : USA ATT
55 * - 402 : USA TMO
56 * - 403 : USA VZW
57 * - 404 : USA SPR
58 * - 405 : USA USC
59 * You can refer how to using it below this file.
60 * And, you can add more region code, too.
61 */
62
63 #ifndef _dhd_sec_feature_h_
64 #define _dhd_sec_feature_h_
65
66 #include <linuxver.h>
67
68 /* For COB type feature */
69 #ifdef CONFIG_WIFI_BROADCOM_COB
70 #undef USE_CID_CHECK
71 #define READ_MACADDR
72 #endif /* CONFIG_WIFI_BROADCOM_COB */
73
74 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) && (defined(CONFIG_BCM4334) || \
75 defined(CONFIG_BCM4334_MODULE))
76 #define RXFRAME_THREAD
77 #endif /* (LINUX_VERSION >= VERSION(3, 4, 0)) && ( CONFIG_BCM4334 || CONFIG_BCM4334_MODULE) */
78
79 #if defined(CONFIG_SEC_TRLTE_PROJECT)
80 #define SUPPORT_MULTIPLE_BOARD_REV
81 #endif /* CONFIG_SEC_TRLTE_PROJECT */
82
83 #if defined(CONFIG_MACH_UNIVERSAL7420) || defined(CONFIG_ARCH_MSM8994) || \
84 defined(CONFIG_ARCH_MSM8996) || defined(CONFIG_SOC_EXYNOS8890)
85 #define SUPPORT_MULTIPLE_MODULE_CIS
86 #endif /* CONFIG_MACH_UNIVERSAL7420 || CONFIG_ARCH_MSM8994 ||
87 * CONFIG_ARCH_MSM8996 || CONFIG_SOC_EXYNOS8890
88 */
89
90 #if defined(CONFIG_ARCH_MSM8996) || defined(CONFIG_SOC_EXYNOS8890)
91 #define SUPPORT_BCM4359_MIXED_MODULES
92 #endif /* CONFIG_ARCH_MSM8996 || CONFIG_SOC_EXYNOS8890 */
93
94 /* For EXYNOS PCIe RC Control */
95 #if defined(CONFIG_MACH_UNIVERSAL5433) || defined(CONFIG_MACH_UNIVERSAL7420) || \
96 defined(CONFIG_SOC_EXYNOS8890) || defined(CONFIG_SOC_EXYNOS8895)
97 #define EXYNOS_PCIE_LINKDOWN_RECOVERY
98 #define USE_EXYNOS_PCIE_RC_PMPATCH
99 #endif /* CONFIG_MACH_UNIVERSAL5433 || CONFIGA_MACH_UNIVERSAL7420 ||
100 * CONFIG_SOC_EXYNOS8890 || CONFIG_SOC_EXYNOS8895
101 */
102
103 #if defined(CONFIG_ARGOS)
104 #if defined(CONFIG_SPLIT_ARGOS_SET)
105 #define ARGOS_IRQ_WIFI_TABLE_LABEL "WIFI TX"
106 #define ARGOS_WIFI_TABLE_LABEL "WIFI RX"
107 #else /* CONFIG_SPLIT_ARGOS_SET */
108 #define ARGOS_IRQ_WIFI_TABLE_LABEL "WIFI"
109 #define ARGOS_WIFI_TABLE_LABEL "WIFI"
110 #endif /* CONFIG_SPLIT_ARGOS_SET */
111 #define ARGOS_P2P_TABLE_LABEL "P2P"
112 #endif /* CONFIG_ARGOS */
113
114 #if defined(CONFIG_ARCH_MSM8998)
115 #define SET_PCIE_IRQ_CPU_CORE
116 #define PCIE_IRQ_BIG_CORE 6
117 #define PCIE_IRQ_LITTLE_CORE 0
118 #endif
119
120 /* PROJECTS START */
121
122 #if defined(CONFIG_MACH_SAMSUNG_ESPRESSO) || defined(CONFIG_MACH_SAMSUNG_ESPRESSO_10)
123 #define READ_MACADDR
124 #define HW_OOB
125 #endif /* CONFIG_MACH_SAMSUNG_ESPRESSO && CONFIG_MACH_SAMSUNG_ESPRESSO_10 */
126
127 #if defined(CONFIG_MACH_UNIVERSAL5430) && !defined(CONFIG_BCM43455)
128 #undef CUSTOM_SET_CPUCORE
129 #define PRIMARY_CPUCORE 0
130 #define DPC_CPUCORE 4
131 #define RXF_CPUCORE 7
132 #define ARGOS_CPU_SCHEDULER
133 #elif defined(CONFIG_MACH_UNIVERSAL5430) && defined(CONFIG_BCM43455)
134 #define CUSTOM_SET_CPUCORE
135 #define PRIMARY_CPUCORE 0
136 #define MAX_RETRY_SET_CPUCORE 5
137 #define DPC_CPUCORE 0
138 #define RXF_CPUCORE 4
139 #elif defined(CONFIG_MACH_UNIVERSAL7580) && defined(CONFIG_BCM43455)
140 #define CUSTOM_SET_CPUCORE
141 #define PRIMARY_CPUCORE 0
142 #define MAX_RETRY_SET_CPUCORE 5
143 #define DPC_CPUCORE 1
144 #define RXF_CPUCORE 2
145 #elif defined(CONFIG_MACH_UNIVERSAL5433) || defined(CONFIG_MACH_UNIVERSAL7420) || \
146 defined(CONFIG_SOC_EXYNOS8890) || defined(CONFIG_SOC_EXYNOS8895)
147 #undef CUSTOM_SET_CPUCORE
148 #define PRIMARY_CPUCORE 0
149 #define DPC_CPUCORE 4
150 #define RXF_CPUCORE 5
151 #define TASKLET_CPUCORE 5
152 #define ARGOS_CPU_SCHEDULER
153 #define ARGOS_RPS_CPU_CTL
154
155 #ifdef CONFIG_SOC_EXYNOS8895
156 #define ARGOS_DPC_TASKLET_CTL
157 #endif /* CONFIG_SOC_EXYNOS8895 */
158
159 #ifdef CONFIG_MACH_UNIVERSAL7420
160 #define EXYNOS_PCIE_DEBUG
161 #endif /* CONFIG_MACH_UNIVERSAL7420 */
162
163 #elif defined(CONFIG_MACH_HL3G) || defined(CONFIG_MACH_HLLTE) || \
164 defined(CONFIG_MACH_UNIVERSAL5422) || defined(CONFIG_MACH_UNIVERSAL5430)
165 #define CUSTOM_SET_CPUCORE
166 #define PRIMARY_CPUCORE 0
167 #define MAX_RETRY_SET_CPUCORE 5
168 #define DPC_CPUCORE 4
169 #define RXF_CPUCORE 5
170 #endif /* CONFIG_MACH_UNIVERSAL5433 || CONFIG_MACH_UNIVERSAL7420 || CONFIG_SOC_EXYNOS8890 */
171
172 #if defined(DHD_LB)
173 #if defined(CONFIG_SOC_EXYNOS8890)
174 /*
175 * Removed core 6~7 from NAPI CPU mask.
176 * Exynos 8890 disabled core 6~7 by default.
177 */
178 #define DHD_LB_PRIMARY_CPUS (0x30)
179 #define DHD_LB_SECONDARY_CPUS (0x0E)
180 #elif defined(CONFIG_SOC_EXYNOS8895)
181 /* using whole big core with NAPI mask */
182 #define DHD_LB_PRIMARY_CPUS (0xF0)
183 #define DHD_LB_SECONDARY_CPUS (0x0E)
184 #elif defined(CONFIG_ARCH_MSM8998)
185 #define DHD_LB_PRIMARY_CPUS (0x20)
186 #define DHD_LB_SECONDARY_CPUS (0x0E)
187 #elif defined(CONFIG_ARCH_MSM8996)
188 #define DHD_LB_PRIMARY_CPUS (0x0C)
189 #define DHD_LB_SECONDARY_CPUS (0x03)
190 #else /* Default LB masks */
191 /* using whole big core with NAPI mask */
192 #define DHD_LB_PRIMARY_CPUS (0xF0)
193 #define DHD_LB_SECONDARY_CPUS (0x0E)
194 #endif /* CONFIG_SOC_EXYNOS8890 */
195 #else /* !DHD_LB */
196 #define ARGOS_DPC_TASKLET_CTL
197 #endif /* !DHD_LB */
198
199 #if defined(CONFIG_ARCH_MSM) || defined(CONFIG_SOC_EXYNOS8895)
200 #if defined(CONFIG_BCMDHD_PCIE)
201 #define BCMPCIE_DISABLE_ASYNC_SUSPEND
202 #endif /* CONFIG_BCMDHD_PCIE */
203 #endif /* CONFIG_ARCH_MSM */
204
205 /* Q1 also uses this feature */
206 #if defined(CONFIG_MACH_U1) || defined(CONFIG_MACH_TRATS)
207 #ifdef CONFIG_MACH_Q1_BD
208 #define HW_OOB
209 #endif /* CONFIG_MACH_Q1_BD */
210 #define USE_CID_CHECK
211 #define WRITE_MACADDR
212 #endif /* CONFIG_MACH_U1 || CONFIG_MACH_TRATS */
213
214 #ifdef CONFIG_ARCH_MSM7X30
215 #define HW_OOB
216 #define READ_MACADDR
217 #endif /* CONFIG_ARCH_MSM7X30 */
218
219 #if defined(CONFIG_MACH_GC1) || defined(CONFIG_MACH_U1_NA_SPR) || \
220 defined(CONFIG_MACH_VIENNAEUR) || defined(CONFIG_MACH_LT03EUR) || \
221 defined(CONFIG_MACH_LT03SKT) || defined(CONFIG_MACH_LT03KTT) || \
222 defined(CONFIG_MACH_LT03LGT) || defined(CONFIG_V1A) || defined(CONFIG_N1A) || \
223 defined(CONFIG_N2A) || defined(CONFIG_V2A) || defined(CONFIG_MACH_VIENNAEUR)
224 #undef USE_CID_CHECK
225 #define READ_MACADDR
226 #endif /* CONFIG_MACH_GC1 || CONFIG_MACH_U1_NA_SPR || CONFIG_MACH_VIENNAEUR ||
227 * CONFIG_MACH_LT03EUR || CONFIG_MACH_LT03SKT || CONFIG_MACH_LT03KTT ||
228 * CONFIG_MACH_LT03LGT || CONFIG_V1A ||
229 * CONFIG_N1A || CONFIG_N2A || CONFIG_V2A ||
230 * CONFIG_MACH_VIENNAEUR
231 */
232
233 #ifdef CONFIG_MACH_P10
234 #define READ_MACADDR
235 #endif /* CONFIG_MACH_P10 */
236
237 #ifdef CONFIG_ARCH_MSM8960
238 #undef WIFI_TURNOFF_DELAY
239 #define WIFI_TURNOFF_DELAY 200
240 #endif /* CONFIG_ARCH_MSM8960 */
241
242 /* PROJECTS END */
243
244
245 /* REGION CODE START */
246
247 #ifndef CONFIG_WLAN_REGION_CODE
248 #define CONFIG_WLAN_REGION_CODE 100
249 #endif /* CONFIG_WLAN_REGION_CODE */
250
251 #if (CONFIG_WLAN_REGION_CODE >= 100) && (CONFIG_WLAN_REGION_CODE < 200) /* EUR */
252 #if (CONFIG_WLAN_REGION_CODE == 101) /* EUR ORG */
253 /* GAN LITE NAT KEEPALIVE FILTER */
254 #define GAN_LITE_NAT_KEEPALIVE_FILTER
255 #endif /* CONFIG_WLAN_REGION_CODE == 101 */
256 #if (CONFIG_WLAN_REGION_CODE == 150) /* EUR FD(DualSIM) */
257 #define SUPPORT_MULTIPLE_BOARD_REV_FROM_HW
258 #endif /* CONFIG_WLAN_REGION_CODE == 150 */
259 #endif /* CONFIG_WLAN_REGION_CODE >= 100 && CONFIG_WLAN_REGION_CODE < 200 */
260
261 #if defined(CONFIG_WIFI_MULTIPLE_CHIP)
262 #define SUPPORT_MULTIPLE_CHIP_4345X
263 #endif /* CONFIG_WIFI_MULTIPLE_CHIP */
264
265 #if defined(CONFIG_V1A) || defined(CONFIG_V2A) || defined(CONFIG_MACH_VIENNAEUR)
266 #define SUPPORT_MULTIPLE_CHIPS
267 #endif /* CONFIG_V1A || CONFIG_V2A || CONFIG_MACH_VIENNAEUR */
268
269 #if (CONFIG_WLAN_REGION_CODE >= 200) && (CONFIG_WLAN_REGION_CODE < 300) /* KOR */
270 #undef USE_INITIAL_2G_SCAN
271 #ifndef ROAM_ENABLE
272 #define ROAM_ENABLE
273 #endif /* ROAM_ENABLE */
274 #ifndef ROAM_API
275 #define ROAM_API
276 #endif /* ROAM_API */
277 #ifndef ROAM_CHANNEL_CACHE
278 #define ROAM_CHANNEL_CACHE
279 #endif /* ROAM_CHANNEL_CACHE */
280 #ifndef OKC_SUPPORT
281 #define OKC_SUPPORT
282 #endif /* OKC_SUPPORT */
283
284 #ifndef ROAM_AP_ENV_DETECTION
285 #define ROAM_AP_ENV_DETECTION
286 #endif /* ROAM_AP_ENV_DETECTION */
287
288 #undef WRITE_MACADDR
289 #ifndef READ_MACADDR
290 #define READ_MACADDR
291 #endif /* READ_MACADDR */
292
293 #if (CONFIG_WLAN_REGION_CODE == 201) /* SKT */
294 #ifdef CONFIG_MACH_UNIVERSAL5410
295 /* Make CPU core clock 300MHz & assign dpc thread workqueue to CPU1 */
296 #define FIX_CPU_MIN_CLOCK
297 #endif /* CONFIG_MACH_UNIVERSAL5410 */
298 #endif /* CONFIG_WLAN_REGION_CODE == 201 */
299
300 #if (CONFIG_WLAN_REGION_CODE == 202) /* KTT */
301 #define VLAN_MODE_OFF
302 #define FULL_ROAMING_SCAN_PERIOD_60_SEC
303
304 #ifdef CONFIG_MACH_UNIVERSAL5410
305 /* Make CPU core clock 300MHz & assign dpc thread workqueue to CPU1 */
306 #define FIX_CPU_MIN_CLOCK
307 #endif /* CONFIG_MACH_UNIVERSAL5410 */
308 #endif /* CONFIG_WLAN_REGION_CODE == 202 */
309
310 #if (CONFIG_WLAN_REGION_CODE == 203) /* LGT */
311 #ifdef CONFIG_MACH_UNIVERSAL5410
312 /* Make CPU core clock 300MHz & assign dpc thread workqueue to CPU1 */
313 #define FIX_CPU_MIN_CLOCK
314 #define FIX_BUS_MIN_CLOCK
315 #endif /* CONFIG_MACH_UNIVERSAL5410 */
316 #endif /* CONFIG_WLAN_REGION_CODE == 203 */
317 #endif /* CONFIG_WLAN_REGION_CODE >= 200 && CONFIG_WLAN_REGION_CODE < 300 */
318
319 #if (CONFIG_WLAN_REGION_CODE >= 300) && (CONFIG_WLAN_REGION_CODE < 400) /* CHN */
320 #define BCMWAPI_WPI
321 #define BCMWAPI_WAI
322 #endif /* CONFIG_WLAN_REGION_CODE >= 300 && CONFIG_WLAN_REGION_CODE < 400 */
323
324 #if (CONFIG_WLAN_REGION_CODE == 402) /* TMO */
325 #undef CUSTOM_SUSPEND_BCN_LI_DTIM
326 #define CUSTOM_SUSPEND_BCN_LI_DTIM 3
327 #endif /* CONFIG_WLAN_REGION_CODE == 402 */
328
329 /* REGION CODE END */
330
331 #if !defined(READ_MACADDR) && !defined(WRITE_MACADDR)
332 #define GET_MAC_FROM_OTP
333 #define SHOW_NVRAM_TYPE
334 #endif /* !READ_MACADDR && !WRITE_MACADDR */
335
336 #define WRITE_WLANINFO
337
338 #if defined(CONFIG_MACH_KONA)
339 #define DISABLE_FLOW_CONTROL
340 #endif /* CONFIG_MACH_KONA */
341
342 #endif /* _dhd_sec_feature_h_ */