xref: /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8189fs/include/drv_conf.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2019 Realtek Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of version 2 of the GNU General Public License as
7  * published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  *****************************************************************************/
15 #ifndef __DRV_CONF_H__
16 #define __DRV_CONF_H__
17 #include "autoconf.h"
18 #include "hal_ic_cfg.h"
19 
20 #define CONFIG_RSSI_PRIORITY
21 
22 /*
23  * RTW_BUSY_DENY_SCAN control if scan would be denied by busy traffic.
24  * When this defined, BUSY_TRAFFIC_SCAN_DENY_PERIOD would be used to judge if
25  * scan request coming from scan UI. Scan request from scan UI would be
26  * exception and never be denied by busy traffic.
27  */
28 #define RTW_BUSY_DENY_SCAN
29 
30 #ifdef CONFIG_RTW_REPEATER_SON
31 	#ifndef CONFIG_AP
32 		#define CONFIG_AP
33 	#endif
34 	#ifndef CONFIG_CONCURRENT_MODE
35 		#define CONFIG_CONCURRENT_MODE
36 	#endif
37 	#ifndef CONFIG_BR_EXT
38 		#define CONFIG_BR_EXT
39 	#endif
40 	#ifndef CONFIG_RTW_REPEATER_SON_ID
41 		#define CONFIG_RTW_REPEATER_SON_ID			0x02040608
42 	#endif
43 	//#define CONFIG_RTW_REPEATER_SON_ROOT
44 	#ifndef CONFIG_RTW_REPEATER_SON_ROOT
45 		#define CONFIG_LAYER2_ROAMING_ACTIVE
46 	#endif
47 	#undef CONFIG_POWER_SAVING
48 #endif
49 
50 #if defined(CONFIG_MCC_MODE) && (!defined(CONFIG_CONCURRENT_MODE))
51 
52 	#error "Enable CONCURRENT_MODE before enable MCC MODE\n"
53 
54 #endif
55 
56 #if defined(CONFIG_MCC_MODE) && defined(CONFIG_BT_COEXIST)
57 
58 	#error "Disable BT COEXIST before enable MCC MODE\n"
59 
60 #endif
61 
62 #if defined(CONFIG_MCC_MODE) && defined(CONFIG_TDLS)
63 
64 	#error "Disable TDLS before enable MCC MODE\n"
65 
66 #endif
67 
68 #if defined(CONFIG_RTW_80211R) && !defined(CONFIG_LAYER2_ROAMING)
69 
70 	#error "Enable CONFIG_LAYER2_ROAMING before enable CONFIG_RTW_80211R\n"
71 
72 #endif
73 
74 /* Default enable single wiphy if driver ver >= 5.9 */
75 #define RTW_SINGLE_WIPHY
76 
77 #ifdef CONFIG_RTW_ANDROID
78 
79 	#include <linux/version.h>
80 
81 	#ifndef CONFIG_IOCTL_CFG80211
82 	#define CONFIG_IOCTL_CFG80211
83 	#endif
84 
85 	#ifndef RTW_USE_CFG80211_STA_EVENT
86 	#define RTW_USE_CFG80211_STA_EVENT
87 	#endif
88 
89 	#if (CONFIG_RTW_ANDROID > 4)
90 	#ifndef CONFIG_RADIO_WORK
91 	#define CONFIG_RADIO_WORK
92 	#endif
93 	#endif
94 
95 	#if (CONFIG_RTW_ANDROID <= 7)
96 		#ifdef RTW_SINGLE_WIPHY
97 		#undef RTW_SINGLE_WIPHY
98 		#endif
99 	#endif
100 
101 	#if (CONFIG_RTW_ANDROID >= 8)
102 		#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
103 		#ifndef CONFIG_RTW_WIFI_HAL
104 		#define CONFIG_RTW_WIFI_HAL
105 		#endif
106 		#else
107  		#error "Linux kernel version is too old\n"
108 		#endif
109 	#endif
110 
111 	#ifdef CONFIG_RTW_WIFI_HAL
112 	#ifndef CONFIG_RTW_WIFI_HAL_DEBUG
113 	//#define CONFIG_RTW_WIFI_HAL_DEBUG
114 	#endif
115 	#ifndef CONFIG_RTW_CFGVENDOR_LLSTATS
116 	#define CONFIG_RTW_CFGVENDOR_LLSTATS
117 	#endif
118 	#if (CONFIG_RTW_ANDROID < 11)
119 	#ifndef CONFIG_RTW_CFGVENDOR_RANDOM_MAC_OUI
120 	#define CONFIG_RTW_CFGVENDOR_RANDOM_MAC_OUI
121 	#endif
122 	#else
123 	#ifndef CONFIG_RTW_SCAN_RAND
124 	#define CONFIG_RTW_SCAN_RAND
125 	#endif
126 	#endif
127 	#ifndef CONFIG_RTW_CFGVENDOR_RSSIMONITOR
128 	#define CONFIG_RTW_CFGVENDOR_RSSIMONITOR
129 	#endif
130 	#ifndef CONFIG_RTW_CFGVENDOR_WIFI_LOGGER
131 	#define CONFIG_RTW_CFGVENDOR_WIFI_LOGGER
132 	#endif
133 	#if (CONFIG_RTW_ANDROID >= 10)
134 	#ifndef CONFIG_RTW_CFGVENDOR_WIFI_OFFLOAD
135 	//#define CONFIG_RTW_CFGVENDOR_WIFI_OFFLOAD
136 	#endif
137 	#ifndef CONFIG_RTW_HOSTAPD_ACS
138 	#define CONFIG_RTW_HOSTAPD_ACS
139 	#endif
140 	#ifndef CONFIG_KERNEL_PATCH_EXTERNAL_AUTH
141 	#define CONFIG_KERNEL_PATCH_EXTERNAL_AUTH
142 	#endif
143 	#endif
144 	#endif // CONFIG_RTW_WIFI_HAL
145 
146 
147 	/* Some Android build will restart the UI while non-printable ascii is passed
148 	* between java and c/c++ layer (JNI). We force CONFIG_VALIDATE_SSID
149 	* for Android here. If you are sure there is no risk on your system about this,
150 	* mask this macro define to support non-printable ascii ssid.
151 	* #define CONFIG_VALIDATE_SSID */
152 
153 	/* Android expect dbm as the rx signal strength unit */
154 	#define CONFIG_SIGNAL_DISPLAY_DBM
155 #endif // CONFIG_RTW_ANDROID
156 
157 /*
158 #if defined(CONFIG_HAS_EARLYSUSPEND) && defined(CONFIG_RESUME_IN_WORKQUEUE)
159 	#warning "You have CONFIG_HAS_EARLYSUSPEND enabled in your system, we disable CONFIG_RESUME_IN_WORKQUEUE automatically"
160 	#undef CONFIG_RESUME_IN_WORKQUEUE
161 #endif
162 
163 #if defined(CONFIG_ANDROID_POWER) && defined(CONFIG_RESUME_IN_WORKQUEUE)
164 	#warning "You have CONFIG_ANDROID_POWER enabled in your system, we disable CONFIG_RESUME_IN_WORKQUEUE automatically"
165 	#undef CONFIG_RESUME_IN_WORKQUEUE
166 #endif
167 */
168 
169 #ifdef CONFIG_RESUME_IN_WORKQUEUE /* this can be removed, because there is no case for this... */
170 	#if !defined(CONFIG_WAKELOCK) && !defined(CONFIG_ANDROID_POWER)
171 		#error "enable CONFIG_RESUME_IN_WORKQUEUE without CONFIG_WAKELOCK or CONFIG_ANDROID_POWER will suffer from the danger of wifi's unfunctionality..."
172 		#error "If you still want to enable CONFIG_RESUME_IN_WORKQUEUE in this case, mask this preprossor checking and GOOD LUCK..."
173 	#endif
174 #endif
175 
176 /* About USB VENDOR REQ */
177 #if defined(CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC) && !defined(CONFIG_USB_VENDOR_REQ_MUTEX)
178 	#warning "define CONFIG_USB_VENDOR_REQ_MUTEX for CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC automatically"
179 	#define CONFIG_USB_VENDOR_REQ_MUTEX
180 #endif
181 #if defined(CONFIG_VENDOR_REQ_RETRY) &&  !defined(CONFIG_USB_VENDOR_REQ_MUTEX)
182 	#warning "define CONFIG_USB_VENDOR_REQ_MUTEX for CONFIG_VENDOR_REQ_RETRY automatically"
183 	#define CONFIG_USB_VENDOR_REQ_MUTEX
184 #endif
185 
186 #ifdef CONFIG_WIFI_MONITOR
187 	/*	#define CONFIG_MONITOR_MODE_XMIT	*/
188 #endif
189 
190 #ifdef CONFIG_CUSTOMER_ALIBABA_GENERAL
191 	#ifndef CONFIG_WIFI_MONITOR
192 		#define CONFIG_WIFI_MONITOR
193 	#endif
194 	#ifdef CONFIG_POWER_SAVING
195 		#undef CONFIG_POWER_SAVING
196 	#endif
197 #endif
198 
199 #ifdef CONFIG_CUSTOMER01_SMART_ANTENNA
200 	#ifdef CONFIG_POWER_SAVING
201 		#undef CONFIG_POWER_SAVING
202 	#endif
203 	#ifdef CONFIG_BEAMFORMING
204 		#undef CONFIG_BEAMFORMING
205 	#endif
206 #endif
207 
208 #ifndef CONFIG_RTW_DATA_BMC_TO_UC
209 #define CONFIG_RTW_DATA_BMC_TO_UC 0
210 #endif
211 
212 #ifdef CONFIG_AP_MODE
213 	#define CONFIG_LIMITED_AP_NUM 1
214 
215 	#ifndef CONFIG_RTW_AP_DATA_BMC_TO_UC
216 	#define CONFIG_RTW_AP_DATA_BMC_TO_UC 1
217 	#endif
218 	#if CONFIG_RTW_AP_DATA_BMC_TO_UC
219 	#undef CONFIG_RTW_DATA_BMC_TO_UC
220 	#define CONFIG_RTW_DATA_BMC_TO_UC 1
221 	#endif
222 	#ifndef CONFIG_RTW_AP_SRC_B2U_FLAGS
223 	#define CONFIG_RTW_AP_SRC_B2U_FLAGS 0x8 /* see RTW_AP_B2U_XXX */
224 	#endif
225 	#ifndef CONFIG_RTW_AP_FWD_B2U_FLAGS
226 	#define CONFIG_RTW_AP_FWD_B2U_FLAGS 0x8 /* see RTW_AP_B2U_XXX */
227 	#endif
228 
229 	#ifndef CONFIG_ACTIVE_TPC_REPORT
230 	#define CONFIG_ACTIVE_TPC_REPORT
231 	#endif
232 #endif
233 
234 #ifdef CONFIG_RTW_MULTI_AP
235 	#ifndef CONFIG_AP_MODE
236 	#error "enable CONFIG_RTW_MULTI_AP without CONFIG_AP_MODE"
237 	#endif
238 	#ifndef CONFIG_RTW_WDS
239 	#define CONFIG_RTW_WDS
240 	#endif
241 	#ifndef CONFIG_RTW_UNASOC_STA_MODE_OF_STYPE
242 	#define CONFIG_RTW_UNASOC_STA_MODE_OF_STYPE {2, 1} /* BMC:2 for all, NMY_UC:1 for interested target */
243 	#endif
244 	#ifndef CONFIG_RTW_NLRTW
245 	#define CONFIG_RTW_NLRTW
246 	#endif
247 	#ifndef CONFIG_RTW_WNM
248 	#define CONFIG_RTW_WNM
249 	#endif
250 	#ifndef CONFIG_RTW_80211K
251 	#define CONFIG_RTW_80211K
252 	#endif
253 #endif
254 
255 #ifdef CONFIG_RTW_MESH
256 	#ifndef CONFIG_RTW_MESH_ACNODE_PREVENT
257 	#define CONFIG_RTW_MESH_ACNODE_PREVENT 1
258 	#endif
259 
260 	#ifndef CONFIG_RTW_MESH_OFFCH_CAND
261 	#define CONFIG_RTW_MESH_OFFCH_CAND 1
262 	#endif
263 
264 	#ifndef CONFIG_RTW_MESH_PEER_BLACKLIST
265 	#define CONFIG_RTW_MESH_PEER_BLACKLIST 1
266 	#endif
267 
268 	#ifndef CONFIG_RTW_MESH_CTO_MGATE_BLACKLIST
269 	#define CONFIG_RTW_MESH_CTO_MGATE_BLACKLIST 1
270 	#endif
271 	#ifndef CONFIG_RTW_MESH_CTO_MGATE_CARRIER
272 	#define CONFIG_RTW_MESH_CTO_MGATE_CARRIER CONFIG_RTW_MESH_CTO_MGATE_BLACKLIST
273 	#endif
274 
275 	#ifndef CONFIG_RTW_MPM_TX_IES_SYNC_BSS
276 	#define CONFIG_RTW_MPM_TX_IES_SYNC_BSS 1
277 	#endif
278 	#if CONFIG_RTW_MPM_TX_IES_SYNC_BSS
279 		#ifndef CONFIG_RTW_MESH_AEK
280 		#define CONFIG_RTW_MESH_AEK
281 		#endif
282 	#endif
283 
284 	#ifndef CONFIG_RTW_MESH_DATA_BMC_TO_UC
285 	#define CONFIG_RTW_MESH_DATA_BMC_TO_UC 1
286 	#endif
287 	#if CONFIG_RTW_MESH_DATA_BMC_TO_UC
288 	#undef CONFIG_RTW_DATA_BMC_TO_UC
289 	#define CONFIG_RTW_DATA_BMC_TO_UC 1
290 	#endif
291 	#ifndef CONFIG_RTW_MSRC_B2U_FLAGS
292 	#define CONFIG_RTW_MSRC_B2U_FLAGS 0x0 /* see RTW_MESH_B2U_XXX */
293 	#endif
294 	#ifndef CONFIG_RTW_MFWD_B2U_FLAGS
295 	#define CONFIG_RTW_MFWD_B2U_FLAGS 0x2 /* see RTW_MESH_B2U_XXX */
296 	#endif
297 #endif
298 
299 #if !defined(CONFIG_SCAN_BACKOP) && defined(CONFIG_AP_MODE)
300 #define CONFIG_SCAN_BACKOP
301 #endif
302 
303 #define RTW_SCAN_SPARSE_MIRACAST 1
304 #define RTW_SCAN_SPARSE_BG 0
305 #define RTW_SCAN_SPARSE_ROAMING_ACTIVE 1
306 
307 #ifndef CONFIG_TX_AC_LIFETIME
308 #define CONFIG_TX_AC_LIFETIME 1
309 #endif
310 #ifndef CONFIG_TX_ACLT_FLAGS
311 #define CONFIG_TX_ACLT_FLAGS 0x00
312 #endif
313 #ifndef CONFIG_TX_ACLT_CONF_DEFAULT
314 #define CONFIG_TX_ACLT_CONF_DEFAULT {0x0, 1024 * 1000, 1024 * 1000}
315 #endif
316 #ifndef CONFIG_TX_ACLT_CONF_AP_M2U
317 #define CONFIG_TX_ACLT_CONF_AP_M2U {0xF, 256 * 1000, 256 * 1000}
318 #endif
319 #ifndef CONFIG_TX_ACLT_CONF_MESH
320 #define CONFIG_TX_ACLT_CONF_MESH {0xF, 256 * 1000, 256 * 1000}
321 #endif
322 
323 #ifndef CONFIG_RTW_HIQ_FILTER
324 	#define CONFIG_RTW_HIQ_FILTER 1
325 #endif
326 
327 #ifndef CONFIG_RTW_ADAPTIVITY_EN
328 	#define CONFIG_RTW_ADAPTIVITY_EN 0
329 #endif
330 
331 #ifndef CONFIG_RTW_ADAPTIVITY_MODE
332 	#define CONFIG_RTW_ADAPTIVITY_MODE 0
333 #endif
334 
335 #ifndef CONFIG_RTW_ADAPTIVITY_TH_L2H_INI
336 	#define CONFIG_RTW_ADAPTIVITY_TH_L2H_INI 0
337 #endif
338 
339 #ifndef CONFIG_RTW_ADAPTIVITY_TH_EDCCA_HL_DIFF
340 	#define CONFIG_RTW_ADAPTIVITY_TH_EDCCA_HL_DIFF 0
341 #endif
342 
343 #ifndef CONFIG_RTW_EXCL_CHS
344 	#define CONFIG_RTW_EXCL_CHS {0}
345 #endif
346 
347 #ifndef CONFIG_IEEE80211_BAND_5GHZ
348 	#if defined(CONFIG_RTL8821A) || defined(CONFIG_RTL8821C) \
349 		|| defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8822C) \
350 		|| defined(CONFIG_RTL8814A) || defined(CONFIG_RTL8814B)
351 	#define CONFIG_IEEE80211_BAND_5GHZ 1
352 	#else
353 	#define CONFIG_IEEE80211_BAND_5GHZ 0
354 	#endif
355 #endif
356 
357 #ifndef CONFIG_DFS
358 #define CONFIG_DFS 1
359 #endif
360 
361 #if CONFIG_IEEE80211_BAND_5GHZ && CONFIG_DFS && defined(CONFIG_AP_MODE)
362 	#if !defined(CONFIG_DFS_SLAVE_WITH_RADAR_DETECT)
363 	#define CONFIG_DFS_SLAVE_WITH_RADAR_DETECT 0
364 	#endif
365 	#if !defined(CONFIG_DFS_MASTER) || CONFIG_DFS_SLAVE_WITH_RADAR_DETECT
366 	#define CONFIG_DFS_MASTER
367 	#endif
368 	#if defined(CONFIG_DFS_MASTER) && !defined(CONFIG_RTW_DFS_REGION_DOMAIN)
369 	#define CONFIG_RTW_DFS_REGION_DOMAIN 0
370 	#endif
371 #else
372 	#undef CONFIG_DFS_MASTER
373 	#undef CONFIG_RTW_DFS_REGION_DOMAIN
374 	#define CONFIG_RTW_DFS_REGION_DOMAIN 0
375 	#undef CONFIG_DFS_SLAVE_WITH_RADAR_DETECT
376 	#define CONFIG_DFS_SLAVE_WITH_RADAR_DETECT 0
377 #endif
378 
379 #ifndef CONFIG_TXPWR_BY_RATE_EN
380 #define CONFIG_TXPWR_BY_RATE_EN 2 /* by efuse */
381 #endif
382 #ifndef CONFIG_TXPWR_LIMIT_EN
383 #define CONFIG_TXPWR_LIMIT_EN 2 /* by efuse */
384 #endif
385 
386 #ifndef CONFIG_RTW_CHPLAN
387 #define CONFIG_RTW_CHPLAN 0xFF /* RTW_CHPLAN_UNSPECIFIED */
388 #endif
389 
390 /* compatible with old fashion configuration */
391 #if defined(CONFIG_CALIBRATE_TX_POWER_BY_REGULATORY)
392 	#undef CONFIG_TXPWR_BY_RATE_EN
393 	#undef CONFIG_TXPWR_LIMIT_EN
394 	#define CONFIG_TXPWR_BY_RATE_EN 1
395 	#define CONFIG_TXPWR_LIMIT_EN 1
396 #elif defined(CONFIG_CALIBRATE_TX_POWER_TO_MAX)
397 	#undef CONFIG_TXPWR_BY_RATE_EN
398 	#undef CONFIG_TXPWR_LIMIT_EN
399 	#define CONFIG_TXPWR_BY_RATE_EN 1
400 	#define CONFIG_TXPWR_LIMIT_EN 0
401 #endif
402 
403 #ifndef RTW_DEF_MODULE_REGULATORY_CERT
404 	#define RTW_DEF_MODULE_REGULATORY_CERT 0
405 #endif
406 
407 #if RTW_DEF_MODULE_REGULATORY_CERT
408 	/* force enable TX power by rate and TX power limit */
409 	#undef CONFIG_TXPWR_BY_RATE_EN
410 	#undef CONFIG_TXPWR_LIMIT_EN
411 	#define CONFIG_TXPWR_BY_RATE_EN 1
412 	#define CONFIG_TXPWR_LIMIT_EN 1
413 #endif
414 
415 #if !CONFIG_TXPWR_LIMIT && CONFIG_TXPWR_LIMIT_EN
416 	#undef CONFIG_TXPWR_LIMIT
417 	#define CONFIG_TXPWR_LIMIT 1
418 #endif
419 
420 #ifndef CONFIG_RTW_ACTIVE_TPC_REPORT
421 #define CONFIG_RTW_ACTIVE_TPC_REPORT 1 /* 0:incapable, 1:capable, 2:auto enable */
422 #endif
423 
424 #define CONFIG_IOCTL_WEXT
425 
426 #ifdef CONFIG_RTW_IPCAM_APPLICATION
427 	#undef CONFIG_TXPWR_BY_RATE_EN
428 	#define CONFIG_TXPWR_BY_RATE_EN 1
429 	#define CONFIG_RTW_CUSTOMIZE_BEEDCA		0x0000431C
430 	#define CONFIG_RTW_CUSTOMIZE_BWMODE		0x00
431 	#define CONFIG_RTW_CUSTOMIZE_RLSTA		0x30
432 	#ifdef CONFIG_CUSTOMER_EZVIZ_CHIME2
433 		#undef CONFIG_ACTIVE_KEEP_ALIVE_CHECK
434 	#endif
435 #if defined(CONFIG_RTL8192E) || defined(CONFIG_RTL8192F) || defined(CONFIG_RTL8822B)
436 	#define CONFIG_RTW_TX_NPATH_EN		/*	mutually incompatible with STBC_TX & Beamformer	*/
437 #endif
438 #endif
439 /* #define CONFIG_RTW_TOKEN_BASED_XMIT */
440 #ifdef CONFIG_RTW_TOKEN_BASED_XMIT
441 	#define NR_TBTX_SLOT			4
442 	#define NR_MAXSTA_INSLOT		5
443 	#define TBTX_TX_DURATION		30
444 
445 	#define MAX_TXPAUSE_DURATION	(TBTX_TX_DURATION*NR_TBTX_SLOT)
446 #endif
447 
448 /*#define CONFIG_EXTEND_LOWRATE_TXOP			*/
449 
450 #ifndef CONFIG_RTW_RX_AMPDU_SZ_LIMIT_1SS
451 	#define CONFIG_RTW_RX_AMPDU_SZ_LIMIT_1SS {0xFF, 0xFF, 0xFF, 0xFF}
452 #endif
453 #ifndef CONFIG_RTW_RX_AMPDU_SZ_LIMIT_2SS
454 	#define CONFIG_RTW_RX_AMPDU_SZ_LIMIT_2SS {0xFF, 0xFF, 0xFF, 0xFF}
455 #endif
456 #ifndef CONFIG_RTW_RX_AMPDU_SZ_LIMIT_3SS
457 	#define CONFIG_RTW_RX_AMPDU_SZ_LIMIT_3SS {0xFF, 0xFF, 0xFF, 0xFF}
458 #endif
459 #ifndef CONFIG_RTW_RX_AMPDU_SZ_LIMIT_4SS
460 	#define CONFIG_RTW_RX_AMPDU_SZ_LIMIT_4SS {0xFF, 0xFF, 0xFF, 0xFF}
461 #endif
462 
463 #ifndef CONFIG_RTW_TARGET_TX_PWR_2G_A
464 	#define CONFIG_RTW_TARGET_TX_PWR_2G_A {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
465 #endif
466 
467 #ifndef CONFIG_RTW_TARGET_TX_PWR_2G_B
468 	#define CONFIG_RTW_TARGET_TX_PWR_2G_B {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
469 #endif
470 
471 #ifndef CONFIG_RTW_TARGET_TX_PWR_2G_C
472 	#define CONFIG_RTW_TARGET_TX_PWR_2G_C {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
473 #endif
474 
475 #ifndef CONFIG_RTW_TARGET_TX_PWR_2G_D
476 	#define CONFIG_RTW_TARGET_TX_PWR_2G_D {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
477 #endif
478 
479 #ifndef CONFIG_RTW_TARGET_TX_PWR_5G_A
480 	#define CONFIG_RTW_TARGET_TX_PWR_5G_A {-1, -1, -1, -1, -1, -1, -1, -1, -1}
481 #endif
482 
483 #ifndef CONFIG_RTW_TARGET_TX_PWR_5G_B
484 	#define CONFIG_RTW_TARGET_TX_PWR_5G_B {-1, -1, -1, -1, -1, -1, -1, -1, -1}
485 #endif
486 
487 #ifndef CONFIG_RTW_TARGET_TX_PWR_5G_C
488 	#define CONFIG_RTW_TARGET_TX_PWR_5G_C {-1, -1, -1, -1, -1, -1, -1, -1, -1}
489 #endif
490 
491 #ifndef CONFIG_RTW_TARGET_TX_PWR_5G_D
492 	#define CONFIG_RTW_TARGET_TX_PWR_5G_D {-1, -1, -1, -1, -1, -1, -1, -1, -1}
493 #endif
494 
495 #ifndef CONFIG_RTW_ANTENNA_GAIN
496 #define CONFIG_RTW_ANTENNA_GAIN 0x7FFF /* == UNSPECIFIED_MBM */
497 #endif
498 
499 #ifndef CONFIG_RTW_AMPLIFIER_TYPE_2G
500 	#define CONFIG_RTW_AMPLIFIER_TYPE_2G 0
501 #endif
502 
503 #ifndef CONFIG_RTW_AMPLIFIER_TYPE_5G
504 	#define CONFIG_RTW_AMPLIFIER_TYPE_5G 0
505 #endif
506 
507 #ifndef CONFIG_RTW_RFE_TYPE
508 	#define CONFIG_RTW_RFE_TYPE 64
509 #endif
510 
511 #ifndef CONFIG_RTW_GLNA_TYPE
512 	#define CONFIG_RTW_GLNA_TYPE 0
513 #endif
514 
515 #ifndef CONFIG_RTW_PLL_REF_CLK_SEL
516 	#define CONFIG_RTW_PLL_REF_CLK_SEL 0x0F
517 #endif
518 
519 #ifndef CONFIG_IFACE_NUMBER
520 	#ifdef CONFIG_CONCURRENT_MODE
521 		#define CONFIG_IFACE_NUMBER	2
522 	#else
523 		#define CONFIG_IFACE_NUMBER	1
524 	#endif
525 #endif
526 
527 #ifndef CONFIG_CONCURRENT_MODE
528 	#if (CONFIG_IFACE_NUMBER > 1)
529 		#error "CONFIG_IFACE_NUMBER over 1,but CONFIG_CONCURRENT_MODE not defined"
530 	#endif
531 #endif
532 
533 #if (CONFIG_IFACE_NUMBER == 0)
534 	#error "CONFIG_IFACE_NUMBER cound not be 0 !!"
535 #endif
536 
537 #if defined(CONFIG_RTL8188E) || defined(CONFIG_RTL8192E) || defined(CONFIG_RTL8188F) || \
538 defined(CONFIG_RTL8188GTV) || defined(CONFIG_RTL8192F) || \
539 defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A) || defined(CONFIG_RTL8710B) || \
540 defined(CONFIG_RTL8723B) || defined(CONFIG_RTL8703B) || defined(CONFIG_RTL8723D)
541 #define CONFIG_HWMPCAP_GEN1
542 #elif defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8822C) /*|| defined(CONFIG_RTL8814A)*/
543 #define CONFIG_HWMPCAP_GEN2
544 #elif defined(CONFIG_RTL8814B) /*Address CAM - 128*/
545 #define CONFIG_HWMPCAP_GEN3
546 #endif
547 
548 #if defined(CONFIG_HWMPCAP_GEN1) && (CONFIG_IFACE_NUMBER > 2)
549 	#ifdef CONFIG_POWER_SAVING
550 	/*#warning "Disable PS when CONFIG_IFACE_NUMBER > 2"*/
551 	#undef CONFIG_POWER_SAVING
552 	#endif
553 
554 	#ifdef CONFIG_WOWLAN
555 	#error "This IC can't support MI and WoWLan at the same time"
556 	#endif
557 #endif
558 
559 #if defined(CONFIG_HWMPCAP_GEN1) && (CONFIG_IFACE_NUMBER > 3)
560         #error " This IC can't support over 3 interfaces !!"
561 #endif
562 
563 #if (CONFIG_IFACE_NUMBER > 4)
564 	#error "Not support over 4 interfaces yet !!"
565 #endif
566 
567 #if (CONFIG_IFACE_NUMBER > 8)	/*IFACE_ID_MAX*/
568 	#error "HW count not support over 8 interfaces !!"
569 #endif
570 
571 #if (CONFIG_IFACE_NUMBER > 2)
572 	#ifndef CONFIG_HWMPCAP_GEN3
573 		#define CONFIG_MI_WITH_MBSSID_CAM
574 	#endif
575 
576 	#ifdef CONFIG_MI_WITH_MBSSID_CAM
577 		#define CONFIG_MBSSID_CAM
578 		#if defined(CONFIG_RUNTIME_PORT_SWITCH)
579 			#undef CONFIG_RUNTIME_PORT_SWITCH
580 		#endif
581 	#endif
582 
583 	#ifdef CONFIG_AP_MODE
584 		#undef CONFIG_LIMITED_AP_NUM
585 		#define CONFIG_LIMITED_AP_NUM	2
586 
587 		#define CONFIG_SUPPORT_MULTI_BCN
588 
589 		#define CONFIG_SWTIMER_BASED_TXBCN
590 
591 		#ifdef CONFIG_HWMPCAP_GEN2 /*CONFIG_RTL8822B/CONFIG_RTL8821C/CONFIG_RTL8822C*/
592 		#define CONFIG_FW_HANDLE_TXBCN
593 
594 		#ifdef CONFIG_FW_HANDLE_TXBCN
595 			#ifdef CONFIG_SWTIMER_BASED_TXBCN
596 				#undef CONFIG_SWTIMER_BASED_TXBCN
597 			#endif
598 			#undef CONFIG_LIMITED_AP_NUM
599 			#define CONFIG_LIMITED_AP_NUM	4
600 		#endif
601 
602 		#endif /*CONFIG_HWMPCAP_GEN2*/
603 
604 		#ifdef CONFIG_HWMPCAP_GEN3
605 			#define CONFIG_PORT_BASED_TXBCN
606 			#undef CONFIG_SUPPORT_MULTI_BCN
607 			#undef CONFIG_SWTIMER_BASED_TXBCN
608 			#undef CONFIG_LIMITED_AP_NUM
609 			#define CONFIG_LIMITED_AP_NUM	4
610 			#ifdef CONFIG_PCI_HCI
611 			#define CONFIG_PORT_BASED_HIQ	/* 8814BU doesn't support */
612 			#endif
613 		#endif
614 	#endif /*CONFIG_AP_MODE*/
615 
616 	#ifdef CONFIG_HWMPCAP_GEN2 /*CONFIG_RTL8822B/CONFIG_RTL8821C/CONFIG_RTL8822C*/
617 	#define CONFIG_CLIENT_PORT_CFG
618 	#define CONFIG_NEW_NETDEV_HDL
619 	#endif/*CONFIG_HWMPCAP_GEN2*/
620 #endif/*(CONFIG_IFACE_NUMBER > 2)*/
621 
622 #if defined(CONFIG_MI_UNIQUE_MACADDR_BIT)
623 	#if !defined(CONFIG_MI_WITH_MBSSID_CAM)
624 		#error "CONFIG_MI_UNIQUE_MACADDR_BIT should not be used without multiple interface !!"
625 	#endif
626 	#if (CONFIG_MI_UNIQUE_MACADDR_BIT < 24) || ( 47 < CONFIG_MI_UNIQUE_MACADDR_BIT)
627 		#error "CONFIG_MI_UNIQUE_MACADDR_BIT should be the bit in NIC specific mac address(BIT[24:47] !!"
628 	#endif
629 #endif
630 
631 #define MACID_NUM_SW_LIMIT 32
632 #define SEC_CAM_ENT_NUM_SW_LIMIT 32
633 
634 #ifdef SEC_DEFAULT_KEY_SEARCH
635 	#if (CONFIG_IFACE_NUMBER >= 2)
636 		#error "Default Key Search only work with only one interface case!"
637 	#endif
638 #endif
639 
640 #if defined(CONFIG_WOWLAN) && (defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8814A) || defined(CONFIG_RTL8822C) || defined(CONFIG_RTL8814B))
641 	#define CONFIG_WOW_PATTERN_HW_CAM
642 #endif
643 
644 #ifndef CONFIG_TSF_UPDATE_PAUSE_FACTOR
645 #define CONFIG_TSF_UPDATE_PAUSE_FACTOR 200
646 #endif
647 
648 #ifndef CONFIG_TSF_UPDATE_RESTORE_FACTOR
649 #define CONFIG_TSF_UPDATE_RESTORE_FACTOR 5
650 #endif
651 
652 /*
653 	Mark CONFIG_DEAUTH_BEFORE_CONNECT by Arvin 2015/07/20
654 	If the failure of Wi-Fi connection is due to some irregular disconnection behavior (like unplug dongle,
655 	power down etc.) in last time, we can unmark this flag to avoid some unpredictable response from AP.
656 */
657 /*#define CONFIG_DEAUTH_BEFORE_CONNECT */
658 
659 /*#define CONFIG_WEXT_DONT_JOIN_BYSSID	*/
660 /* #include <rtl871x_byteorder.h> */
661 
662 
663 /*#define CONFIG_DOSCAN_IN_BUSYTRAFFIC	*/
664 /*#define CONFIG_PHDYM_FW_FIXRATE		*/	/*	Another way to fix tx rate	*/
665 
666 /*
667 * CONFIG_RTW_SDIO_RELEASE_IRQ
668 * == 0: static allocated
669 * >= 1: release when suspend
670 * >= 2: release when IPS
671 */
672 #ifndef CONFIG_RTW_SDIO_RELEASE_IRQ
673 #define CONFIG_RTW_SDIO_RELEASE_IRQ	2
674 #endif
675 
676 /*
677  * Add by Lucas@2016/02/15
678  * For RX Aggregation
679  */
680 #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_USB_RX_AGGREGATION)
681 	#define RTW_RX_AGGREGATION
682 #endif /* CONFIG_SDIO_HCI || CONFIG_USB_RX_AGGREGATION */
683 
684 #ifdef CONFIG_RTW_HOSTAPD_ACS
685 	#ifndef CONFIG_RTW_ACS
686 		#define CONFIG_RTW_ACS
687 	#endif
688 #endif
689 
690 #ifdef CONFIG_RTW_80211K
691 	#ifndef CONFIG_RTW_ACS
692 		#define CONFIG_RTW_ACS
693 	#endif
694 #endif /*CONFIG_RTW_80211K*/
695 
696 #ifdef DBG_CONFIG_ERROR_RESET
697 #ifndef CONFIG_IPS
698 #define CONFIG_IPS
699 #endif
700 #endif
701 
702 /* IPS */
703 #ifndef RTW_IPS_MODE
704 	#if defined(CONFIG_IPS)
705 		#define RTW_IPS_MODE 1
706 	#else
707 		#define RTW_IPS_MODE 0
708 	#endif
709 #endif /* !RTW_IPS_MODE */
710 
711 #if (RTW_IPS_MODE > 1 || RTW_IPS_MODE < 0)
712 	#error "The CONFIG_IPS_MODE value is wrong. Please follow HowTo_enable_the_power_saving_functionality.pdf.\n"
713 #endif
714 
715 /* LPS */
716 #ifndef RTW_LPS_MODE
717 	#if defined(CONFIG_LPS_PG) || defined(CONFIG_LPS_PG_DDMA)
718 		#define RTW_LPS_MODE 3
719 	#elif defined(CONFIG_LPS_LCLK)
720 		#define RTW_LPS_MODE 2
721 	#elif defined(CONFIG_LPS)
722 		#define RTW_LPS_MODE 1
723 	#else
724 		#define RTW_LPS_MODE 0
725 	#endif
726 #endif /* !RTW_LPS_MODE */
727 
728 #if (RTW_LPS_MODE > 3 || RTW_LPS_MODE < 0)
729 	#error "The CONFIG_LPS_MODE value is wrong. Please follow HowTo_enable_the_power_saving_functionality.pdf.\n"
730 #endif
731 
732 #ifndef RTW_LPS_1T1R
733 #define RTW_LPS_1T1R 0
734 #endif
735 
736 #ifndef RTW_WOW_LPS_1T1R
737 #define RTW_WOW_LPS_1T1R 0
738 #endif
739 
740 /* WOW LPS */
741 #ifndef RTW_WOW_LPS_MODE
742 	#if defined(CONFIG_LPS_PG) || defined(CONFIG_LPS_PG_DDMA)
743 		#define RTW_WOW_LPS_MODE 3
744 	#elif defined(CONFIG_LPS_LCLK)
745 		#define RTW_WOW_LPS_MODE 2
746 	#elif defined(CONFIG_LPS)
747 		#define RTW_WOW_LPS_MODE 1
748 	#else
749 		#define RTW_WOW_LPS_MODE 0
750 	#endif
751 #endif /* !RTW_WOW_LPS_MODE */
752 
753 #if (RTW_WOW_LPS_MODE > 3 || RTW_WOW_LPS_MODE < 0)
754 	#error "The RTW_WOW_LPS_MODE value is wrong. Please follow HowTo_enable_the_power_saving_functionality.pdf.\n"
755 #endif
756 
757 #ifdef RTW_REDUCE_SCAN_SWITCH_CH_TIME
758 #ifndef CONFIG_RTL8822B
759 	#error "Only 8822B support RTW_REDUCE_SCAN_SWITCH_CH_TIME"
760 #endif
761 	#ifndef RTW_CHANNEL_SWITCH_OFFLOAD
762 		#define RTW_CHANNEL_SWITCH_OFFLOAD
763 	#endif
764 #endif
765 
766 #define CONFIG_RTW_TPT_MODE
767 
768 #ifdef CONFIG_PCI_BCN_POLLING
769 #define CONFIG_BCN_ICF
770 #endif
771 
772 #ifndef CONFIG_PCI_MSI
773 #define CONFIG_RTW_PCI_MSI_DISABLE
774 #endif
775 
776 #if defined(CONFIG_PCI_DYNAMIC_ASPM_L1_LATENCY) ||	\
777     defined(CONFIG_PCI_DYNAMIC_ASPM_LINK_CTRL)
778 #define CONFIG_PCI_DYNAMIC_ASPM
779 #endif
780 
781 #if 0
782 /* Debug related compiler flags */
783 #define DBG_THREAD_PID	/* Add thread pid to debug message prefix */
784 #define DBG_CPU_INFO	/* Add CPU info to debug message prefix */
785 #endif
786 
787 #endif /* __DRV_CONF_H__ */
788