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