1 /******************************************************************************
2  * Copyright (c) 2013-2016 Realtek Semiconductor Corp.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  ******************************************************************************/
16 
17 
18 #ifndef WLANCONFIG_H
19 #define WLANCONFIG_H
20 
21 /*
22  * Include user defined options first. Anything not defined in these files
23  * will be set to standard values. Override anything you dont like!
24  */
25 #include "platform_opts.h"
26 
27 #if defined(CONFIG_PLATFORM_8195A) || defined(CONFIG_PLATFORM_8711B) || defined(CONFIG_PLATFORM_8721D) || defined(CONFIG_PLATFORM_8195BHP) || defined(CONFIG_PLATFORM_8710C)
28 #ifndef CONFIG_PLATFORM_AMEBA_X
29 #define CONFIG_PLATFORM_AMEBA_X 1
30 #endif
31 #else
32 #define CONFIG_PLATFORM_AMEBA_X 0
33 #endif
34 
35 #if (CONFIG_PLATFORM_AMEBA_X == 1)
36 #if defined(CONFIG_PLATFORM_8195BHP) || defined(CONFIG_PLATFORM_8710C)
37 	#define CONFIG_AXI_HCI
38 	#else
39 	#define CONFIG_LX_HCI
40 	#endif
41 #else
42 	#if defined(CONFIG_PLATFOMR_CUSTOMER_RTOS)
43 	#define PLATFORM_CUSTOMER_RTOS 1
44 	#define CONFIG_LWIP_LAYER 0
45 	#else
46 	#define PLATFORM_FREERTOS	1
47 	#endif
48 #if 1
49 	#undef PLATFORM_FREERTOS
50 	//#undef PLATFORM_ALIOS
51 	#define PLATFORM_ALIOS	1
52 #endif
53 	#ifdef USE_SDIO_INTERFACE
54 	#define CONFIG_SDIO_HCI
55 	#else
56 	#define CONFIG_GSPI_HCI
57 #endif
58 #endif // #if (CONFIG_PLATFORM_AMEBA_X == 1)
59 
60 
61 #if defined(CONFIG_HARDWARE_8188F) || defined(CONFIG_HARDWARE_8192E)|| defined(CONFIG_HARDWARE_8723D) || defined(CONFIG_HARDWARE_8821C) || defined(CONFIG_PLATFORM_8195BHP) || defined(CONFIG_HARDWARE_8188E) || defined(CONFIG_PLATFORM_8721D) || defined(CONFIG_PLATFORM_8710C)
62 #define CONFIG_FW_C2H_PKT
63 #define PHYDM_LINUX_CODING_STYLE 1
64 #else
65 #define PHYDM_LINUX_CODING_STYLE 0
66 #endif
67 
68 #if (PHYDM_LINUX_CODING_STYLE == 1)
69 #define PHYDM_NEW_INTERFACE 1
70 #else
71 #define PHYDM_NEW_INTERFACE 0
72 #endif
73 
74 #ifndef CONFIG_INIC_EN
75 #define CONFIG_INIC_EN 0 //For iNIC project
76 #endif
77 
78 #if CONFIG_INIC_EN
79 #define CONFIG_LWIP_LAYER    0
80 #endif
81 
82 #ifndef CONFIG_WIFI_CRITICAL_CODE_SECTION
83 #define CONFIG_WIFI_CRITICAL_CODE_SECTION
84 #endif
85 #define CONFIG_LITTLE_ENDIAN
86 #define CONFIG_80211N_HT
87 #define CONFIG_RECV_REORDERING_CTRL
88 #define RTW_NOTCH_FILTER 0
89 #define CONFIG_EMBEDDED_FWIMG
90 #define CONFIG_PHY_SETTING_WITH_ODM
91 #if (CONFIG_PLATFORM_AMEBA_X == 0)
92 #define HAL_MAC_ENABLE 1
93 #define HAL_BB_ENABLE 1
94 #define HAL_RF_ENABLE 1
95 #endif
96 #if (CONFIG_PLATFORM_AMEBA_X == 1)
97 /* Patch when dynamic mechanism is not ready */
98 //#define CONFIG_DM_PATCH
99 #endif
100 
101 //#define CONFIG_DEBUG
102 //#define CONFIG_DEBUG_RTL871X
103 #if (CONFIG_PLATFORM_AMEBA_X == 1)
104 	#define CONFIG_MEM_MONITOR	MEM_MONITOR_SIMPLE
105 	#define WLAN_INTF_DBG		0
106 	//#define CONFIG_DEBUG_DYNAMIC
107 	//#define DBG_TX 1
108 	//#define DBG_XMIT_BUF 1
109 	//#define DBG_XMIT_BUF_EXT 1
110 	#define DBG_TX_DROP_FRAME
111 #else
112 	#define CONFIG_MEM_MONITOR	MEM_MONITOR_SIMPLE
113 	//#define CONFIG_TRACE_SKB
114 	//#define WLAN_INTF_DBG
115 #endif // CONFIG_PLATFORM_AMEBA_X
116 
117 //#define CONFIG_DONT_CARE_TP
118 //#define CONFIG_HIGH_TP
119 //#define CONFIG_MEMORY_ACCESS_ALIGNED
120 
121 #define CONFIG_POWER_SAVING
122 #ifdef CONFIG_POWER_SAVING
123 	#define CONFIG_IPS
124 	#define CONFIG_LPS
125 	#ifdef CONFIG_LPS
126 		#define CONFIG_LPS_CHK_BY_TP
127 	#endif
128 	//#define CONFIG_LPS_LCLK
129 #if (CONFIG_PLATFORM_AMEBA_X == 0)
130 #ifdef CONFIG_LPS_LCLK
131 	#define CONFIG_DETECT_CPWM_BY_POLLING
132 	#define LPS_RPWM_WAIT_MS 300
133 #endif
134 #else
135 	#define CONFIG_LPS_32K
136 	#define TDMA_POWER_SAVING
137 #endif
138 	#define CONFIG_WAIT_PS_ACK
139 	#define CONFIG_FW_PSTIMEOUT
140 #endif
141 
142 #define BAD_MIC_COUNTERMEASURE 1
143 #define DEFRAGMENTATION 1
144 #define RX_AGGREGATION 1
145 #define RX_AMSDU 1
146 
147 #define WIFI_LOGO_CERTIFICATION 0
148 
149 #if defined(CONFIG_PLATFORM_8711B)
150 	#define CONFIG_FW_C2H_PKT
151 #endif
152 
153 #if (CONFIG_PLATFORM_AMEBA_X == 1)
154 	#if defined(CONFIG_PLATFORM_8195A)
155 		#define CONFIG_USE_TCM_HEAP 1					/* USE TCM HEAP */
156 	#endif
157 	#define CONFIG_RECV_TASKLET_THREAD
158 	#define CONFIG_XMIT_TASKLET_THREAD
159 #else
160 	#define CONFIG_XMIT_THREAD_MODE
161 #endif // CONFIG_PLATFORM_AMEBA_X
162 //#define CONFIG_RECV_THREAD_MODE				/* Wlan IRQ Polling  Mode*/
163 //#define CONFIG_ISR_THREAD_MODE_POLLING		/* Wlan IRQ Polling  Mode*/
164 
165 //1 Chris
166 #ifndef CONFIG_SDIO_HCI
167 #define CONFIG_ISR_THREAD_MODE_INTERRUPT	/* Wlan IRQ Interrupt  Mode*/
168 #endif
169 
170 #if defined(CONFIG_ISR_THREAD_MODE_POLLING) && defined(CONFIG_ISR_THREAD_MODE_INTERRUPT)
171 #error "CONFIG_ISR_THREAD_MODE_POLLING and CONFIG_ISR_THREAD_MODE_INTERRUPT are mutually exclusive. "
172 #endif
173 
174 //#define CONFIG_RECV_TASK_THREAD_MODE
175 
176 #if (CONFIG_PLATFORM_AMEBA_X == 1)
177 /* CRC DMEM optimized mode consume 1k less SRM memory consumption */
178 #define CRC_IMPLEMENTATION_MODE CRC_IMPLEMENTATION_DMEM_OPTIMIZED
179 #endif
180 
181 /* AES DMEM optimized mode comsume 10k less memory compare to
182      IMEM optimized mode AES_IMPLEMENTATION_IMEM_OPTIMIZED */
183 #define AES_IMPLEMENTATION_MODE AES_IMPLEMENTATION_DMEM_OPTIMIZED
184 
185 #define USE_SKB_AS_XMITBUF	1
186 #if (CONFIG_PLATFORM_AMEBA_X == 1)
187 #define USE_XMIT_EXTBUFF	1
188 #else
189 #define USE_XMIT_EXTBUFF	0
190 #endif
191 #define USE_MUTEX_FOR_SPINLOCK	1
192 
193 // remove function to reduce code
194 #define NOT_SUPPORT_5G
195 #define SUPPORT_5G_CHANNEL	0
196 #if !defined(CONFIG_HARDWARE_8192E)
197 #define NOT_SUPPORT_RF_MULTIPATH
198 #endif
199 #define NOT_SUPPORT_VHT
200 //#define NOT_SUPPORT_40M
201 #define NOT_SUPPORT_80M
202 #if defined(CONFIG_PLATFORM_8195A)
203 #define NOT_SUPPORT_BBSWING
204 #endif
205 #ifdef CONFIG_HIGH_TP_TEST
206 	#undef NOT_SUPPORT_40M
207 #endif
208 #define NOT_SUPPORT_OLD_CHANNEL_PLAN
209 #define NOT_SUPPORT_BT
210 
211 #define CONFIG_WIFI_SPEC	0
212 #define CONFIG_FAKE_EFUSE	0
213 #if CONFIG_FAKE_EFUSE
214 	#define FAKE_CHIPID		CHIPID_8710BN
215 #endif
216 
217 #define CONFIG_AUTO_RECONNECT 1
218 #define ENABLE_HWPDN_PIN
219 #define SUPPORT_SCAN_BUF	1
220 #if (CONFIG_PLATFORM_AMEBA_X == 0)
221 #define BE_I_CUT			1
222 #endif
223 
224 /* For WPA2 */
225 #define CONFIG_INCLUDE_WPA_PSK
226 #ifdef CONFIG_INCLUDE_WPA_PSK
227 #define CONFIG_MULTIPLE_WPA_STA
228 #define PSK_SUPPORT_TKIP	1
229 #endif
230 
231 #define CONFIG_PMKSA_CACHING
232 
233 /* For WPA3 */
234 #define CONFIG_IEEE80211W
235 #define CONFIG_SAE_SUPPORT
236 #ifdef CONFIG_SAE_SUPPORT
237 #define CONFIG_SAE_DH_SUPPORT 1
238 #define ALL_DH_GROUPS
239 #endif
240 
241 
242 /* For repeater mode */
243 #define CONFIG_REPEATER		0
244 #if defined(CONFIG_REPEATER) && CONFIG_REPEATER
245 #define NOT_SUPPORT_40M
246 #endif
247 
248 /* For promiscuous mode */
249 #define CONFIG_PROMISC
250 
251 #define PROMISC_DENY_PAIRWISE	0
252 
253 /* For Simple Link */
254 #ifndef CONFIG_INCLUDE_SIMPLE_CONFIG
255 //#define CONFIG_INCLUDE_SIMPLE_CONFIG 1
256 #endif
257 
258 // for probe request with custom vendor specific IE
259 #define CONFIG_CUSTOM_IE
260 
261 #if (CONFIG_PLATFORM_AMEBA_X == 0)
262 /* For multicast */
263 #define CONFIG_MULTICAST
264 #endif
265 
266 #define CONFIG_RX_PACKET_APPEND_FCS
267 
268 /* For STA+AP Concurrent MODE */
269 #define CONFIG_CONCURRENT_MODE
270 #ifdef CONFIG_CONCURRENT_MODE
271 //#define CONFIG_MCC_MODE
272   #if defined(CONFIG_PLATFORM_8195A) || defined(CONFIG_PLATFORM_8195BHP) || defined(CONFIG_PLATFORM_8710C)
273     #define CONFIG_RUNTIME_PORT_SWITCH
274   #endif
275   #ifdef CONFIG_BRIDGE
276     #define NET_IF_NUM ((CONFIG_ETHERNET) + (CONFIG_BRIDGE) + (CONFIG_WLAN) + 1)
277   #else
278     #define NET_IF_NUM ((CONFIG_ETHERNET) + (CONFIG_WLAN) + 1)
279   #endif
280 #else
281   #define NET_IF_NUM ((CONFIG_ETHERNET) + (CONFIG_WLAN))
282 #endif
283 
284 
285 /****************** For EAP auth configurations *******************/
286 #define CONFIG_TLS	1
287 #define CONFIG_PEAP	1
288 #define CONFIG_TTLS	1
289 
290 // DO NOT change the below config of EAP
291 #ifdef PRE_CONFIG_EAP
292 #undef CONFIG_TLS
293 #define CONFIG_TLS	1
294 #undef CONFIG_PEAP
295 #define CONFIG_PEAP	1
296 #undef CONFIG_TTLS
297 #define CONFIG_TTLS	1
298 #endif
299 
300 // enable 1X code in lib_wlan as default (increase 380 bytes)
301 #define CONFIG_EAP
302 
303 #if CONFIG_TLS || CONFIG_PEAP || CONFIG_TTLS
304 #define EAP_REMOVE_UNUSED_CODE 1
305 #endif
306 
307 #define EAP_SSL_VERIFY_SERVER
308 
309 #if CONFIG_TLS
310 #define EAP_SSL_VERIFY_CLIENT
311 #endif
312 
313 #if CONFIG_TTLS
314 #define EAP_MSCHAPv2
315 #define EAP_TTLS_MSCHAPv2
316 //#define EAP_TTLS_EAP
317 //#define EAP_TTLS_MSCHAP
318 //#define EAP_TTLS_PAP
319 //#define EAP_TTLS_CHAP
320 #endif
321 /****************** End of EAP configurations *******************/
322 
323 /* For WPS and P2P */
324 #define CONFIG_WPS
325 #if 0
326 #define CONFIG_WPS_AP
327 #define CONFIG_P2P_NEW
328 #if (!defined(SUPPORT_SCAN_BUF)||!defined(CONFIG_WPS_AP)) && defined(CONFIG_P2P_NEW)
329 #error "If CONFIG_P2P_NEW, need to SUPPORT_SCAN_BUF"
330 #endif
331 #endif
332 
333 #define CONFIG_NEW_SIGNAL_STAT_PROCESS
334 #define CONFIG_SKIP_SIGNAL_SCALE_MAPPING
335 
336 /* For AP_MODE */
337 #define CONFIG_AP_MODE
338 extern unsigned char g_user_ap_sta_num;
339 #define USER_AP_STA_NUM g_user_ap_sta_num
340 #if (CONFIG_PLATFORM_AMEBA_X == 1)
341 #if defined(CONFIG_PLATFORM_8721D)
342 #define AP_STA_NUM	5
343 #else
344 #define AP_STA_NUM	3	//2014/10/27 modify to 3
345 #endif
346 #define USE_DEDICATED_BCN_TX	0
347 #if USE_DEDICATED_BCN_TX
348 #error "WLAN driver for Ameba should not enable USE_DEDICATED_BCN_TX"
349 #endif
350 #else
351 extern unsigned int g_ap_sta_num;
352 #define AP_STA_NUM 3//g_ap_sta_num
353 #endif
354 #ifdef CONFIG_AP_MODE
355 #if defined(CONFIG_PLATFORM_8195A)
356 	 //softap sent qos null0 polling client alive or not
357 	#define CONFIG_AP_POLLING_CLIENT_ALIVE
358 #endif
359 	#define CONFIG_NATIVEAP_MLME
360 #if (CONFIG_PLATFORM_AMEBA_X == 1)
361 	#define CONFIG_INTERRUPT_BASED_TXBCN
362 #endif
363 	#ifdef CONFIG_INTERRUPT_BASED_TXBCN
364 		//#define CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT
365 		#define CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR
366 	#endif
367 //	#define CONFIG_GK_REKEY
368 #if (CONFIG_PLATFORM_AMEBA_X == 0)
369 	#define USE_DEDICATED_BCN_TX	1
370 #endif
371 #if CONFIG_INIC_EN
372 //	#define REPORT_STA_EVENT //useless
373 #endif
374 #else
375 #if (CONFIG_PLATFORM_AMEBA_X == 0)
376 	#define USE_DEDICATED_BCN_TX	0
377 #endif
378 #endif
379 
380 #if defined(CONFIG_AP_MODE) && defined(CONFIG_GK_REKEY) && !defined(CONFIG_MULTIPLE_WPA_STA)
381 #error "If CONFIG_GK_REKEY when CONFIG_AP_MODE, need to CONFIG_MULTIPLE_WPA_STA"
382 #endif
383 
384 #if (CONFIG_PLATFORM_AMEBA_X == 0)
385 #if !defined(CONFIG_AP_MODE) && defined(CONFIG_CONCURRENT_MODE)
386 #error "If CONFIG_CONCURRENT_MODEE, need to CONFIG_AP_MODE"
387 #endif
388 #endif
389 
390 /* For efuse or flash config */
391 #if (CONFIG_PLATFORM_AMEBA_X == 1)
392 	#define CONFIG_RW_PHYSICAL_EFUSE			0	// Mask efuse user blocks
393 	#define CONFIG_HIDE_PROTECT_EFUSE			1
394 	#define CONFIG_ADAPTOR_INFO_CACHING_FLASH	1
395 	#define CHECK_FLASH_VALID_MASK				1
396 	#define CHECK_EFUSE_VALID_MASK				1
397 	/* For K-free */
398 	#define CONFIG_RF_GAIN_OFFSET
399 #endif	// CONFIG_PLATFORM_AMEBA_X
400 
401 /* For MP_MODE */
402 //#define CONFIG_MP_INCLUDED
403 #ifdef CONFIG_MP_INCLUDED
404 	#define MP_DRIVER		1
405 	#define CONFIG_MP_IWPRIV_SUPPORT
406 //	#define HAL_EFUSE_MEMORY
407 	#if (CONFIG_PLATFORM_AMEBA_X == 1)
408 		#define MP_REG_TEST
409 	#endif
410 #else
411 	#define MP_DRIVER		0
412 	#if defined(CONFIG_PLATFORM_8195A)
413 		//Control wifi mcu function
414 		#define CONFIG_LITTLE_WIFI_MCU_FUNCTION_THREAD
415 		#define CONFIG_ODM_REFRESH_RAMASK
416 		#define CONFIG_ANTENNA_DIVERSITY
417 		//#define CONFIG_ANTENNA_DIVERSITY_FORCE_ON
418 		//#define CONFIG_BT_COEXIST
419 	#endif
420 	#if defined(CONFIG_PLATFORM_8721D)
421 		#define CONFIG_ANTENNA_DIVERSITY
422 		//#define CONFIG_BT_COEXIST
423 		//#define CONFIG_SW_MAILBOX_EN
424 		//#define NEW_BT_COEX
425 		#define CONFIG_BT_COEXIST_SOC
426 	#endif
427 	#if defined(CONFIG_PLATFORM_8710C)
428 		//#define CONFIG_ANTENNA_DIVERSITY
429 		//#define CONFIG_BT_COEXIST
430 		//#define CONFIG_SW_MAILBOX_EN
431 		//#define NEW_BT_COEX
432 	#endif
433 #endif // #ifdef CONFIG_MP_INCLUDED
434 
435 #ifdef CONFIG_BT_COEXIST
436 	#undef NOT_SUPPORT_BT
437 	#define CONFIG_BT_MAILBOX
438 	#define CONFIG_BT_EFUSE
439 	//#define CONFIG_BT_TWO_ANTENNA
440 #endif
441 
442 // for Debug message
443 #define DBG 0
444 #if (CONFIG_PLATFORM_AMEBA_X == 1)
445 #if(DBG == 0)
446 	#define ROM_E_RTW_MSG 1
447 	#define ROM_F_RTW_MSG 1
448 #if (CONFIG_INIC_EN == 0) && (PHYDM_LINUX_CODING_STYLE == 0)
449 	/* For DM debug*/
450 	// BB
451 	#define DBG_RX_INFO 1
452 	#define DBG_DM_DIG 1			// DebugComponents: bit0
453 	#define DBG_DM_RA_MASK 1		// DebugComponents: bit1
454 	#define DBG_DM_ANT_DIV 1		// DebugComponents: bit6
455 	#define DBG_TX_RATE 1			// DebugComponents: bit9
456 	#define DBG_DM_RA 1				// DebugComponents: bit9
457 	#define DBG_DM_ADAPTIVITY 1		// DebugComponents: bit17
458 	// RF
459 	#define DBG_PWR_TRACKING 1		// DebugComponents: bit24
460 	#define DBG_RF_IQK 1			// DebugComponents: bit26
461 	#define DBG_RF_DPK 1			// DebugComponents:
462 	// Common
463 	#define DBG_PWR_INDEX 1			// DebugComponents: bit30
464 #endif
465 #endif
466 #endif
467 
468 #if (CONFIG_PLATFORM_AMEBA_X == 1)
469 	#if defined(CONFIG_PLATFORM_8195A)
470 		#undef CONFIG_RTL8195A
471 		#define CONFIG_RTL8195A
472 	#endif
473 	#if defined(CONFIG_PLATFORM_8711B)
474 		#ifndef CONFIG_RTL8711B
475 			#define CONFIG_RTL8711B
476 		#endif
477 		#undef CONFIG_ADAPTOR_INFO_CACHING_FLASH
478 		#define CONFIG_ADAPTOR_INFO_CACHING_FLASH 0
479 		//#undef CONFIG_EAP
480 		//#undef CONFIG_IPS
481 		#define CONFIG_8710B_MOVE_TO_ROM
482 		#define CONFIG_EFUSE_SEPARATE
483 		#define CONFIG_MOVE_PSK_TO_ROM
484 		#define CONFIG_WOWLAN
485 		#define CONFIG_TRAFFIC_PROTECT
486 		#define CONFIG_FABVERSION_UMC 	1
487 		#if (CONFIG_INIC_EN == 1)
488 			#undef CONFIG_PROMISC
489 			#undef CONFIG_WPS
490 			#undef CONFIG_AP_MODE
491 			#undef CONFIG_NATIVEAP_MLME
492 			#undef CONFIG_INTERRUPT_BASED_TXBCN
493 			#undef CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR
494 			#undef USE_DEDICATED_BCN_TX
495 			//#undef SUPPORT_SCAN_BUF
496 			#undef CONFIG_CONCURRENT_MODE
497 			#undef CONFIG_AUTO_RECONNECT
498 		#endif
499 	#endif
500 	#if defined(CONFIG_PLATFORM_8721D)
501 	#define CONFIG_EMPTY_EFUSE_PG_ENABLE
502 		#define CONFIG_APP_CTRL_RF_ONOFF
503 		#ifndef CONFIG_RTL8721D
504 			#define CONFIG_RTL8721D
505 		#endif
506 		#undef NOT_SUPPORT_5G
507 		#undef CONFIG_ADAPTOR_INFO_CACHING_FLASH
508 		#define CONFIG_ADAPTOR_INFO_CACHING_FLASH 0
509 		#define CONFIG_EFUSE_SEPARATE
510 		#define CONFIG_WOWLAN
511 		//#define CONFIG_TRAFFIC_PROTECT
512 		#undef SUPPORT_5G_CHANNEL
513 		#define SUPPORT_5G_CHANNEL	1
514 		#define CONFIG_DFS
515 		#define CONFIG_XMIT_ACK
516 		#define TXBD_PRE_MALLOC
517 		#define USER_CTL_POWER_SAVE
518 		#define RTL8721D_SPECIFIC		//Patch for rtl8721d, avoid misunderstanding when porting to next new IC
519 		#ifdef CONFIG_DFS
520 			#define CONFIG_DFS_ACTION
521 		#endif
522 		#define DBG_DM_DIG 0			// DebugComponents: bit0
523 		//#define CONFIG_SUPPORT_DYNAMIC_TXPWR   //rtw_phydm_fill_desc_dpt todo
524 		#if (CONFIG_INIC_EN == 1)
525 			#undef CONFIG_PROMISC
526 			#undef CONFIG_WPS
527 			#undef CONFIG_AP_MODE
528 			#undef CONFIG_NATIVEAP_MLME
529 			#undef CONFIG_INTERRUPT_BASED_TXBCN
530 			#undef CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR
531 			#undef USE_DEDICATED_BCN_TX
532 			//#undef SUPPORT_SCAN_BUF
533 			#undef CONFIG_CONCURRENT_MODE
534 			#undef CONFIG_AUTO_RECONNECT
535 		#endif
536 	#define CONFIG_WLAN_SWITCH_MODE         //save memory while switching mode without driver re-init
537 	//#define LOW_POWER_WIFI_CONNECT
538 	//#define LONG_PERIOD_TICKLESS
539 	#endif
540 	#if defined(CONFIG_PLATFORM_8195BHP)
541 		#define CONFIG_RTL8195B
542 		#undef CONFIG_EAP
543 //		#undef CONFIG_ADAPTOR_INFO_CACHING_FLASH
544 //		#define CONFIG_ADAPTOR_INFO_CACHING_FLASH 0
545 		#undef CHECK_FLASH_VALID_MASK
546 		#define CHECK_FLASH_VALID_MASK				0
547 		#undef CHECK_EFUSE_VALID_MASK
548 		#define CHECK_EFUSE_VALID_MASK				0
549 		#undef CONFIG_RW_PHYSICAL_EFUSE
550 		#define CONFIG_RW_PHYSICAL_EFUSE			1	// efuse_get realraw
551 		#undef NOT_SUPPORT_5G
552 		#undef NOT_SUPPORT_VHT
553 //		#undef NOT_SUPPORT_40M
554 //		#undef NOT_SUPPORT_80M
555 		#undef DBG
556 		#define DBG 1
557 		#ifdef CONFIG_POWER_SAVING
558 			#define CONFIG_LPS_LCLK
559 			#ifdef CONFIG_LPS_LCLK
560 				#define CONFIG_DETECT_CPWM_BY_POLLING
561 				#define LPS_RPWM_WAIT_MS 300
562 			#endif
563 			#define CONFIG_LPS_PG
564 		#endif
565 		#define CONFIG_80211AC_VHT
566 		#undef CONFIG_IPS
567 //		#define CONFIG_NO_FW
568 		#define CONFIG_EX_FW_BIN
569 		#define CONFIG_WOWLAN
570                 #define CONFIG_WOWLAN_HW_CAM
571 		#define CONFIG_WOWLAN_CUSTOM_PATTERN
572 		#ifdef CONFIG_WOWLAN
573 			#define CONFIG_WOWLAN_TCP_KEEP_ALIVE
574 		#endif
575 		#define LOAD_FW_HEADER_FROM_DRIVER
576 		#define FW_IQK
577 //		#define RTW_IQK_FW_OFFLOAD
578 		#define CONFIG_PHY_CAPABILITY_QUERY
579 		#define CONFIG_ISR_THREAD_MODE_INTERRUPT	/* Wlan IRQ Interrupt  Mode*/
580 //		#define CONFIG_WLAN_RF_CNTL
581 		#define SUPPORT_5G_CHANNEL	1
582 		#define CONFIG_DFS
583 		#ifdef CONFIG_DFS
584 			#define CONFIG_DFS_ACTION
585 		#endif
586 
587 		#define DBG_DM_DIG 0			// DebugComponents: bit0
588 //		#define CONFIG_DEBUG
589 
590 		#define RTW_HALMAC		/* Use HALMAC architecture */
591 		#define RTW_HALMAC_MU_BF	0
592 		#define RTW_HALMAC_SU_BF	0
593 		#define RTW_HALMAC_BT_COEX	0
594 		#define RTW_HALMAC_DUMP_INFO  0
595 		#define RTW_HALMAC_TXBF		0
596 		#define RTW_HALMAC_FW_OFFLOAD  0
597 		#define RTW_HALMAC_PHYSICAL_EFUSE  0
598 		#define RTW_HALMAC_SIZE_OPTIMIZATION 1
599 		#define RTW_HALMAC_SDIO_CIA_READ 0
600 		#define RTW_HALMAC_LTE_COEX 0
601 
602 		#define CONFIG_MAC_LOOPBACK_DRIVER_RTL8195B 0
603 	#endif
604 	#if defined(CONFIG_PLATFORM_8710C)
605 		#ifndef CONFIG_RTL8710C
606 			#define CONFIG_RTL8710C
607 		#endif
608 		#undef CONFIG_EAP
609 		#undef CONFIG_ADAPTOR_INFO_CACHING_FLASH
610 		#undef CHECK_FLASH_VALID_MASK
611 		#undef NOT_SUPPORT_40M
612 		#define NOT_SUPPORT_40M
613 		#define CONFIG_ADAPTOR_INFO_CACHING_FLASH 0
614 		#undef CONFIG_RW_PHYSICAL_EFUSE
615 		#define CONFIG_RW_PHYSICAL_EFUSE		1// efuse_get realraw enable physical read/write
616 		#define LOAD_FW_HEADER_FROM_DRIVER
617 		//#define CONFIG_EFUSE_SEPARATE
618 		#define CONFIG_TRAFFIC_PROTECT
619 		#ifdef CONFIG_POWER_SAVING
620 			#define CONFIG_WOWLAN
621 			//#define CONFIG_LPS_LCLK
622 			#ifdef CONFIG_LPS_LCLK
623 				//#define CONFIG_DETECT_CPWM_BY_POLLING
624 				#define LPS_RPWM_WAIT_MS 300
625 			#endif
626 			//#define CONFIG_LPS_PG
627 			//#define CONFIG_LPS_POFF
628 			#ifdef CONFIG_WOWLAN
629 				//#define CONFIG_WOWLAN_TCP_KEEP_ALIVE
630 			#endif
631 		#endif
632 		#define DBG_DM_DIG 0			// DebugComponents: bit0
633 //		#define CONFIG_DEBUG
634 
635 		//#define RTW_HALMAC		/* Use HALMAC architecture */
636 		//#define RTW_HALMAC_MU_BF	0
637 		//#define RTW_HALMAC_SU_BF	0
638 		//#define RTW_HALMAC_BT_COEX	0
639 		//#define RTW_HALMAC_DUMP_INFO  0
640 		//#define RTW_HALMAC_TXBF		0
641 		//#define RTW_HALMAC_FW_OFFLOAD  0
642 		//#define RTW_HALMAC_PHYSICAL_EFUSE  0
643 		//#define RTW_HALMAC_SIZE_OPTIMIZATION 1
644 		//#define RTW_HALMAC_SDIO_CIA_READ 0
645 		//#define RTW_HALMAC_LTE_COEX 0
646 
647 		//#define CONFIG_MAC_LOOPBACK_DRIVER_RTL8710C 1 // 1: HAL+MAC LOOPBACK, 2: HAL+MAC+BB LOOPBACK 3: DRV+HAL+MAC LOOPBACK
648 		#if defined(CONFIG_MAC_LOOPBACK_DRIVER_RTL8710C) && (CONFIG_MAC_LOOPBACK_DRIVER_RTL8710C == 3)
649 		#define CONFIG_MAC_LOOPBACK_DRIVER_AMEBA
650 		#endif
651 		#define CONFIG_WLAN_SWITCH_MODE         //save memory while switching mode without driver re-init
652 	#endif
653 #elif defined(CONFIG_HARDWARE_8188F)
654 #define CONFIG_RTL8188F
655 #elif defined(CONFIG_HARDWARE_8192E)
656 #define CONFIG_RTL8192E
657 #elif defined(CONFIG_HARDWARE_8821C)
658 #define CONFIG_RTL8821C
659 #elif defined(CONFIG_HARDWARE_8723D)
660 #define CONFIG_RTL8723D
661 #elif defined(CONFIG_HARDWARE_8188E)
662 #define CONFIG_RTL8188E
663 #else
664 #define CONFIG_RTL8188E
665 #endif
666 
667 #define RTL8192E_SUPPORT 0
668 #define RTL8812A_SUPPORT 0
669 #define RTL8821A_SUPPORT 0
670 #define RTL8723B_SUPPORT 0
671 #define RTL8195A_SUPPORT 0
672 #define RTL8188E_SUPPORT 0
673 #define RTL8188F_SUPPORT 0
674 #define RTL8711B_SUPPORT 0
675 #define RTL8721D_SUPPORT 0
676 #define RTL8821C_SUPPORT 0
677 #define RTL8723D_SUPPORT 0
678 #define RTL8195B_SUPPORT 0
679 #define RTL8710C_SUPPORT 0
680 #if defined(CONFIG_PLATFORM_8195A)
681 #undef RTL8195A_SUPPORT
682 #define RTL8195A_SUPPORT 1
683 #elif defined(CONFIG_PLATFORM_8711B)
684 #undef RTL8711B_SUPPORT
685 #define RTL8711B_SUPPORT 1
686 #elif defined(CONFIG_PLATFORM_8721D)
687 #undef RTL8721D_SUPPORT
688 #define RTL8721D_SUPPORT 1
689 #elif defined(CONFIG_PLATFORM_8195BHP)
690 #undef RTL8195B_SUPPORT
691 #define RTL8195B_SUPPORT 1
692 #elif defined(CONFIG_PLATFORM_8710C)
693 #undef RTL8710C_SUPPORT
694 #define RTL8710C_SUPPORT 1
695 #elif defined(CONFIG_HARDWARE_8188F)
696 #undef	RTL8188F_SUPPORT
697 #define RTL8188F_SUPPORT 1
698 #elif defined(CONFIG_HARDWARE_8192E)
699 #undef RTL8192E_SUPPORT
700 #define RTL8192E_SUPPORT 1
701 #elif defined(CONFIG_HARDWARE_8821C)
702 #undef	RTL8821C_SUPPORT
703 #define RTL8821C_SUPPORT 1
704 #elif defined(CONFIG_HARDWARE_8723D)
705 #undef	RTL8723D_SUPPORT
706 #define RTL8723D_SUPPORT 1
707 #elif defined(CONFIG_HARDWARE_8188E)
708 #undef RTL8188E_SUPPORT
709 #define RTL8188E_SUPPORT 1
710 #else
711 #undef RTL8188E_SUPPORT
712 #define RTL8188E_SUPPORT 1
713 #endif
714 
715 /* For DM support */
716 #if defined(CONFIG_RTL8188F)
717 #define RATE_ADAPTIVE_SUPPORT 0
718 #elif defined(CONFIG_RTL8821C)
719 #define RATE_ADAPTIVE_SUPPORT 0
720 #elif defined(CONFIG_RTL8192E)
721 #define RATE_ADAPTIVE_SUPPORT 0
722 #elif defined(CONFIG_RTL8723D)
723 #define RATE_ADAPTIVE_SUPPORT 0
724 #elif defined(CONFIG_PLATFORM_8711B)
725 #define RATE_ADAPTIVE_SUPPORT 0
726 #define CONFIG_ODM_REFRESH_RAMASK
727 #elif defined(CONFIG_PLATFORM_8721D)
728 #define RATE_ADAPTIVE_SUPPORT 0
729 //#define CONFIG_ODM_REFRESH_RAMASK
730 #elif defined(CONFIG_PLATFORM_8710C)
731 #define RATE_ADAPTIVE_SUPPORT 0
732 //#define CONFIG_ODM_REFRESH_RAMASK
733 #else
734 #define RATE_ADAPTIVE_SUPPORT 1
735 #endif
736 // adaptivity
737 #define RTW_ADAPTIVITY_EN_DISABLE			0
738 #define RTW_ADAPTIVITY_EN_ENABLE			1
739 #define CONFIG_RTW_ADAPTIVITY_EN			RTW_ADAPTIVITY_EN_DISABLE
740 #define RTW_ADAPTIVITY_MODE_NORMAL			0
741 #define RTW_ADAPTIVITY_MODE_CARRIER_SENSE	1
742 #define CONFIG_RTW_ADAPTIVITY_MODE			RTW_ADAPTIVITY_MODE_CARRIER_SENSE
743 #define CONFIG_RTW_ADAPTIVITY_DML			0
744 
745 
746 #if (CONFIG_PLATFORM_AMEBA_X == 1)
747 	#define CONFIG_POWER_TRAINING_WIL 0 // in RA
748 #else
749 	#define POWER_BY_RATE_SUPPORT 0
750 #endif
751 
752 #if (CONFIG_PLATFORM_AMEBA_X == 1)
753 #define RTL8195A_FOR_TEST_CHIP 0
754 
755 //#define CONFIG_WIFI_TEST 1
756 //#define CONFIG_MAC_LOOPBACK_DRIVER 1
757 //#define CONFIG_WLAN_HAL_TEST 1
758 //#define SKB_PRE_ALLOCATE_TX 1
759 #ifdef CONFIG_HIGH_TP_TEST
760 	#define SKB_PRE_ALLOCATE_RX	1
761 #else
762 	#define SKB_PRE_ALLOCATE_RX	0
763 #endif
764 
765 #if (!defined(CONFIG_PLATFORM_8721D))
766 	#define TX_CHECK_DSEC_ALWAYS 1
767 #endif
768 
769 #define CONFIG_DBG_DISABLE_RDU_INTERRUPT
770 //#define CONFIG_WLAN_HAL_RX_TASK
771 #if (SKB_PRE_ALLOCATE_RX == 1)
772 	#ifdef CONFIG_HIGH_TP_TEST
773 		#define EXCHANGE_LXBUS_RX_SKB 1
774 	#else
775 		#define EXCHANGE_LXBUS_RX_SKB 0
776 	#endif
777 #endif
778 #if (defined(CONFIG_FPGA) && !defined(CONFIG_PLATFORM_8710C))\
779 	|| (defined(CONFIG_PLATFORM_8710C) && defined(CONFIG_MAC_LOOPBACK_DRIVER_RTL8710C) && (CONFIG_MAC_LOOPBACK_DRIVER_RTL8710C == 1))
780 	//Enable mac loopback for test mode (Ameba)
781 	#ifdef CONFIG_WIFI_NORMAL
782 		#define CONFIG_TWO_MAC_DRIVER // for test mode
783 	#else //CONFIG_WIFI_VERIFY
784 		#define ENABLE_MAC_LB_FOR_TEST_MODE
785 	#endif
786 
787 	#define AP_PSK_SUPPORT_TKIP
788 #endif
789 
790 #ifdef ENABLE_MAC_LB_FOR_TEST_MODE
791 	#define CONFIG_SUDO_PHY_SETTING
792 	#define INT_HANDLE_IN_ISR 1
793 #ifdef CONFIG_LWIP_LAYER
794         #undef CONFIG_LWIP_LAYER
795 	#define CONFIG_LWIP_LAYER 0
796 #else
797         #define CONFIG_LWIP_LAYER 0
798 #endif
799 	#define CONFIG_WLAN_HAL_TEST
800 	#define CONFIG_WLAN_HAL_RX_TASK
801 	#define CONFIG_MAC_LOOPBACK_DRIVER_AMEBA 1
802 	#define HAL_MAC_ENABLE 1
803 	#if !defined(CONFIG_PLATFORM_8710C)
804 	#define CONFIG_TWO_MAC_TEST_MODE
805 	#endif
806 	#if defined(CONFIG_MAC_LOOPBACK_DRIVER_RTL8710C) && (CONFIG_MAC_LOOPBACK_DRIVER_RTL8710C == 2)
807 	// Enable BB loopback test
808 	#define HAL_BB_ENABLE 1
809 	#define HAL_RF_ENABLE 1
810 	#define DISABLE_BB_RF 0
811 	#else
812 	#define DISABLE_BB_RF 1
813 	#endif
814 #else
815 	//#define CONFIG_TWO_MAC_DRIVER //for mornal driver; two mac
816 	#if defined(CONFIG_TWO_MAC_DRIVER) || defined(CONFIG_MAC_LOOPBACK_DRIVER_AMEBA)
817 		#define CONFIG_SUDO_PHY_SETTING
818 		#define HAL_MAC_ENABLE 1
819 		#define DISABLE_BB_RF 1
820 	#else
821 		#define HAL_MAC_ENABLE 1
822 		#define HAL_BB_ENABLE 1
823 		#define HAL_RF_ENABLE 1
824 		#define DISABLE_BB_RF 0
825 	#endif
826 	//#define INT_HANDLE_IN_ISR 1
827 #endif
828 #endif // CONFIG_PLATFORM_AMEBA_X
829 
830 #ifndef CONFIG_LWIP_LAYER
831 #define CONFIG_LWIP_LAYER 1
832 #endif
833 #define CONFIG_MAC_ADDRESS 0
834 //fast reconnection
835 //#define CONFIG_FAST_RECONNECTION 1
836 #if defined(CONFIG_INIC_EN)&&(CONFIG_INIC_EN==1)
837 #define CONFIG_RECV_REORDERING_CTRL //enable reordering for iNIC high throughput
838 #undef RX_AGGREGATION
839 #define RX_AGGREGATION 1
840 #undef NOT_SUPPORT_40M
841 #undef CONFIG_CONCURRENT_MODE
842 #endif
843 
844 #if defined(CONFIG_HARDWARE_8821C)
845 #define FW_IQK
846 #define RTW_HALMAC
847 #define LOAD_FW_HEADER_FROM_DRIVER
848 #define RTW_HALMAC_SIZE_OPTIMIZATION 1
849 //#define CONFIG_NO_FW
850 #ifdef NOT_SUPPORT_5G
851 #undef NOT_SUPPORT_5G
852 #define SUPPORT_5G_CHANNEL	1
853 #endif
854 #endif
855 
856 //#define CONFIG_ADDRESS_ALIGNMENT
857 #ifdef CONFIG_ADDRESS_ALIGNMENT
858 #define ALIGNMENT_SIZE 32
859 #endif
860 
861 #define CONFIG_DFS
862 //#define CONFIG_EMPTY_EFUSE_PG_ENABLE
863 
864 #define WLAN_WRAPPER_VERSION 1
865 
866 #define TIME_THRES	20
867 
868 /* 80211 - K V R */
869 #define CONFIG_IEEE80211K
870 #define CONFIG_LAYER2_ROAMING
871 #ifdef CONFIG_LAYER2_ROAMING
872     #define CONFIG_RTW_WNM
873     #define CONFIG_IEEE80211R
874 #endif
875 
876 #endif //WLANCONFIG_H
877