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