1 /******************************************************************************
3 * Copyright(c) 2007 - 2017 Realtek Corporation.
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.
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
14 *****************************************************************************/
15 #ifndef __DRV_CONF_H__
16 #define __DRV_CONF_H__
18 #include "hal_ic_cfg.h"
20 #if defined(PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
22 #error "Shall be Linux or Windows, but not both!\n"
25 #define CONFIG_RSSI_PRIORITY
26 #ifdef CONFIG_RTW_REPEATER_SON
30 #ifndef CONFIG_CONCURRENT_MODE
31 #define CONFIG_CONCURRENT_MODE
36 #ifndef CONFIG_RTW_REPEATER_SON_ID
37 #define CONFIG_RTW_REPEATER_SON_ID 0x02040608
39 //#define CONFIG_RTW_REPEATER_SON_ROOT
40 #ifndef CONFIG_RTW_REPEATER_SON_ROOT
41 #define CONFIG_LAYER2_ROAMING_ACTIVE
43 #undef CONFIG_POWER_SAVING
46 #if defined(CONFIG_MCC_MODE) && (!defined(CONFIG_CONCURRENT_MODE))
48 #error "Enable CONCURRENT_MODE before enable MCC MODE\n"
52 #if defined(CONFIG_MCC_MODE) && defined(CONFIG_BT_COEXIST)
54 #error "Disable BT COEXIST before enable MCC MODE\n"
58 #if defined(CONFIG_MCC_MODE) && defined(CONFIG_TDLS)
60 #error "Disable TDLS before enable MCC MODE\n"
64 #if defined(CONFIG_RTW_80211R) && !defined(CONFIG_LAYER2_ROAMING)
66 #error "Enable CONFIG_LAYER2_ROAMING before enable CONFIG_RTW_80211R\n"
70 /* Older Android kernel doesn't has CONFIG_ANDROID defined,
71 * add this to force CONFIG_ANDROID defined */
72 #ifdef CONFIG_PLATFORM_ANDROID
73 #ifndef CONFIG_ANDROID
74 #define CONFIG_ANDROID
79 /* Some Android build will restart the UI while non-printable ascii is passed
80 * between java and c/c++ layer (JNI). We force CONFIG_VALIDATE_SSID
81 * for Android here. If you are sure there is no risk on your system about this,
82 * mask this macro define to support non-printable ascii ssid.
83 * #define CONFIG_VALIDATE_SSID */
85 /* Android expect dbm as the rx signal strength unit */
86 #define CONFIG_SIGNAL_DISPLAY_DBM
90 #if defined(CONFIG_HAS_EARLYSUSPEND) && defined(CONFIG_RESUME_IN_WORKQUEUE)
91 #warning "You have CONFIG_HAS_EARLYSUSPEND enabled in your system, we disable CONFIG_RESUME_IN_WORKQUEUE automatically"
92 #undef CONFIG_RESUME_IN_WORKQUEUE
95 #if defined(CONFIG_ANDROID_POWER) && defined(CONFIG_RESUME_IN_WORKQUEUE)
96 #warning "You have CONFIG_ANDROID_POWER enabled in your system, we disable CONFIG_RESUME_IN_WORKQUEUE automatically"
97 #undef CONFIG_RESUME_IN_WORKQUEUE
101 #ifdef CONFIG_RESUME_IN_WORKQUEUE /* this can be removed, because there is no case for this... */
102 #if !defined(CONFIG_WAKELOCK) && !defined(CONFIG_ANDROID_POWER)
103 #error "enable CONFIG_RESUME_IN_WORKQUEUE without CONFIG_WAKELOCK or CONFIG_ANDROID_POWER will suffer from the danger of wifi's unfunctionality..."
104 #error "If you still want to enable CONFIG_RESUME_IN_WORKQUEUE in this case, mask this preprossor checking and GOOD LUCK..."
108 /* About USB VENDOR REQ */
109 #if defined(CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC) && !defined(CONFIG_USB_VENDOR_REQ_MUTEX)
110 #warning "define CONFIG_USB_VENDOR_REQ_MUTEX for CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC automatically"
111 #define CONFIG_USB_VENDOR_REQ_MUTEX
113 #if defined(CONFIG_VENDOR_REQ_RETRY) && !defined(CONFIG_USB_VENDOR_REQ_MUTEX)
114 #warning "define CONFIG_USB_VENDOR_REQ_MUTEX for CONFIG_VENDOR_REQ_RETRY automatically"
115 #define CONFIG_USB_VENDOR_REQ_MUTEX
118 #if defined(CONFIG_DFS_SLAVE_WITH_RADAR_DETECT) && !defined(CONFIG_DFS_MASTER)
119 #define CONFIG_DFS_MASTER
122 #if !defined(CONFIG_AP_MODE) && defined(CONFIG_DFS_MASTER)
123 #error "enable CONFIG_DFS_MASTER without CONFIG_AP_MODE"
126 #ifdef CONFIG_RTW_MESH
127 #ifndef CONFIG_RTW_MESH_ACNODE_PREVENT
128 #define CONFIG_RTW_MESH_ACNODE_PREVENT 1
131 #ifndef CONFIG_RTW_MESH_OFFCH_CAND
132 #define CONFIG_RTW_MESH_OFFCH_CAND 1
135 #ifndef CONFIG_RTW_MESH_PEER_BLACKLIST
136 #define CONFIG_RTW_MESH_PEER_BLACKLIST 1
139 #ifndef CONFIG_RTW_MESH_CTO_MGATE_BLACKLIST
140 #define CONFIG_RTW_MESH_CTO_MGATE_BLACKLIST 1
142 #ifndef CONFIG_RTW_MESH_CTO_MGATE_CARRIER
143 #define CONFIG_RTW_MESH_CTO_MGATE_CARRIER CONFIG_RTW_MESH_CTO_MGATE_BLACKLIST
146 #ifndef CONFIG_RTW_MPM_TX_IES_SYNC_BSS
147 #define CONFIG_RTW_MPM_TX_IES_SYNC_BSS 1
149 #if CONFIG_RTW_MPM_TX_IES_SYNC_BSS
150 #ifndef CONFIG_RTW_MESH_AEK
151 #define CONFIG_RTW_MESH_AEK
155 #ifndef CONFIG_RTW_MESH_DATA_BMC_TO_UC
156 #define CONFIG_RTW_MESH_DATA_BMC_TO_UC 1
160 #if !defined(CONFIG_SCAN_BACKOP) && defined(CONFIG_AP_MODE)
161 #define CONFIG_SCAN_BACKOP
164 #define RTW_SCAN_SPARSE_MIRACAST 1
165 #define RTW_SCAN_SPARSE_BG 0
166 #define RTW_SCAN_SPARSE_ROAMING_ACTIVE 1
168 #ifndef CONFIG_RTW_HIQ_FILTER
169 #define CONFIG_RTW_HIQ_FILTER 1
172 #ifndef CONFIG_RTW_ADAPTIVITY_EN
173 #define CONFIG_RTW_ADAPTIVITY_EN 0
176 #ifndef CONFIG_RTW_ADAPTIVITY_MODE
177 #define CONFIG_RTW_ADAPTIVITY_MODE 0
180 #ifndef CONFIG_RTW_ADAPTIVITY_TH_L2H_INI
181 #define CONFIG_RTW_ADAPTIVITY_TH_L2H_INI 0
184 #ifndef CONFIG_RTW_ADAPTIVITY_TH_EDCCA_HL_DIFF
185 #define CONFIG_RTW_ADAPTIVITY_TH_EDCCA_HL_DIFF 0
188 #ifndef CONFIG_RTW_EXCL_CHS
189 #define CONFIG_RTW_EXCL_CHS {0}
192 #ifndef CONFIG_RTW_DFS_REGION_DOMAIN
193 #define CONFIG_RTW_DFS_REGION_DOMAIN 0
196 #ifndef CONFIG_TXPWR_BY_RATE_EN
197 #define CONFIG_TXPWR_BY_RATE_EN 2 /* by efuse */
199 #ifndef CONFIG_TXPWR_LIMIT_EN
200 #define CONFIG_TXPWR_LIMIT_EN 2 /* by efuse */
203 #ifndef CONFIG_RTW_CHPLAN
204 #define CONFIG_RTW_CHPLAN 0xFF /* RTW_CHPLAN_UNSPECIFIED */
207 /* compatible with old fashion configuration */
208 #if defined(CONFIG_CALIBRATE_TX_POWER_BY_REGULATORY)
209 #undef CONFIG_TXPWR_BY_RATE_EN
210 #undef CONFIG_TXPWR_LIMIT_EN
211 #define CONFIG_TXPWR_BY_RATE_EN 1
212 #define CONFIG_TXPWR_LIMIT_EN 1
213 #elif defined(CONFIG_CALIBRATE_TX_POWER_TO_MAX)
214 #undef CONFIG_TXPWR_BY_RATE_EN
215 #undef CONFIG_TXPWR_LIMIT_EN
216 #define CONFIG_TXPWR_BY_RATE_EN 1
217 #define CONFIG_TXPWR_LIMIT_EN 0
220 #ifndef RTW_DEF_MODULE_REGULATORY_CERT
221 #define RTW_DEF_MODULE_REGULATORY_CERT 0
224 #if RTW_DEF_MODULE_REGULATORY_CERT
225 /* force enable TX power by rate and TX power limit */
226 #undef CONFIG_TXPWR_BY_RATE_EN
227 #undef CONFIG_TXPWR_LIMIT_EN
228 #define CONFIG_TXPWR_BY_RATE_EN 1
229 #define CONFIG_TXPWR_LIMIT_EN 1
232 #if !defined(CONFIG_TXPWR_LIMIT) && CONFIG_TXPWR_LIMIT_EN
233 #define CONFIG_TXPWR_LIMIT
236 #ifdef CONFIG_RTW_IPCAM_APPLICATION
237 #undef CONFIG_TXPWR_BY_RATE_EN
238 #define CONFIG_TXPWR_BY_RATE_EN 1
239 #define CONFIG_RTW_CUSTOMIZE_BEEDCA 0x0000431C
240 #define CONFIG_RTW_CUSTOMIZE_BWMODE 0x00
241 #define CONFIG_RTW_CUSTOMIZE_RLSTA 0x7
242 #if defined(CONFIG_RTL8192E) || defined(CONFIG_RTL8192F) || defined(CONFIG_RTL8822B)
243 #define CONFIG_RTW_TX_2PATH_EN /* mutually incompatible with STBC_TX & Beamformer */
246 /*#define CONFIG_EXTEND_LOWRATE_TXOP */
248 #ifndef CONFIG_RTW_RX_AMPDU_SZ_LIMIT_1SS
249 #define CONFIG_RTW_RX_AMPDU_SZ_LIMIT_1SS {0xFF, 0xFF, 0xFF, 0xFF}
251 #ifndef CONFIG_RTW_RX_AMPDU_SZ_LIMIT_2SS
252 #define CONFIG_RTW_RX_AMPDU_SZ_LIMIT_2SS {0xFF, 0xFF, 0xFF, 0xFF}
254 #ifndef CONFIG_RTW_RX_AMPDU_SZ_LIMIT_3SS
255 #define CONFIG_RTW_RX_AMPDU_SZ_LIMIT_3SS {0xFF, 0xFF, 0xFF, 0xFF}
257 #ifndef CONFIG_RTW_RX_AMPDU_SZ_LIMIT_4SS
258 #define CONFIG_RTW_RX_AMPDU_SZ_LIMIT_4SS {0xFF, 0xFF, 0xFF, 0xFF}
261 #ifndef CONFIG_RTW_TARGET_TX_PWR_2G_A
262 #define CONFIG_RTW_TARGET_TX_PWR_2G_A {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
265 #ifndef CONFIG_RTW_TARGET_TX_PWR_2G_B
266 #define CONFIG_RTW_TARGET_TX_PWR_2G_B {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
269 #ifndef CONFIG_RTW_TARGET_TX_PWR_2G_C
270 #define CONFIG_RTW_TARGET_TX_PWR_2G_C {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
273 #ifndef CONFIG_RTW_TARGET_TX_PWR_2G_D
274 #define CONFIG_RTW_TARGET_TX_PWR_2G_D {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
277 #ifndef CONFIG_RTW_TARGET_TX_PWR_5G_A
278 #define CONFIG_RTW_TARGET_TX_PWR_5G_A {-1, -1, -1, -1, -1, -1, -1, -1, -1}
281 #ifndef CONFIG_RTW_TARGET_TX_PWR_5G_B
282 #define CONFIG_RTW_TARGET_TX_PWR_5G_B {-1, -1, -1, -1, -1, -1, -1, -1, -1}
285 #ifndef CONFIG_RTW_TARGET_TX_PWR_5G_C
286 #define CONFIG_RTW_TARGET_TX_PWR_5G_C {-1, -1, -1, -1, -1, -1, -1, -1, -1}
289 #ifndef CONFIG_RTW_TARGET_TX_PWR_5G_D
290 #define CONFIG_RTW_TARGET_TX_PWR_5G_D {-1, -1, -1, -1, -1, -1, -1, -1, -1}
293 #ifndef CONFIG_RTW_AMPLIFIER_TYPE_2G
294 #define CONFIG_RTW_AMPLIFIER_TYPE_2G 0
297 #ifndef CONFIG_RTW_AMPLIFIER_TYPE_5G
298 #define CONFIG_RTW_AMPLIFIER_TYPE_5G 0
301 #ifndef CONFIG_RTW_RFE_TYPE
302 #define CONFIG_RTW_RFE_TYPE 64
305 #ifndef CONFIG_RTW_GLNA_TYPE
306 #define CONFIG_RTW_GLNA_TYPE 0
309 #ifndef CONFIG_RTW_PLL_REF_CLK_SEL
310 #define CONFIG_RTW_PLL_REF_CLK_SEL 0x0F
313 #ifndef CONFIG_IFACE_NUMBER
314 #ifdef CONFIG_CONCURRENT_MODE
315 #define CONFIG_IFACE_NUMBER 2
317 #define CONFIG_IFACE_NUMBER 1
321 #ifndef CONFIG_CONCURRENT_MODE
322 #if (CONFIG_IFACE_NUMBER > 1)
323 #error "CONFIG_IFACE_NUMBER over 1,but CONFIG_CONCURRENT_MODE not defined"
327 #if (CONFIG_IFACE_NUMBER == 0)
328 #error "CONFIG_IFACE_NUMBER cound not be 0 !!"
331 #if defined(CONFIG_RTL8188E) || defined(CONFIG_RTL8192E) || defined(CONFIG_RTL8188F) || \
332 defined(CONFIG_RTL8188GTV) || defined(CONFIG_RTL8192F) || \
333 defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A) || defined(CONFIG_RTL8710B) || \
334 defined(CONFIG_RTL8723B) || defined(CONFIG_RTL8703B) || defined(CONFIG_RTL8723D)
335 #define CONFIG_HWMPCAP_GEN1
336 #elif defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8822C) /*|| defined(CONFIG_RTL8814A)*/
337 #define CONFIG_HWMPCAP_GEN2
338 #elif defined(CONFIG_RTL8814B) /*Address CAM - 128*/
339 #define CONFIG_HWMPCAP_GEN3
342 #if defined(CONFIG_HWMPCAP_GEN1) && (CONFIG_IFACE_NUMBER > 2)
343 #ifdef CONFIG_POWER_SAVING
344 /*#warning "Disable PS when CONFIG_IFACE_NUMBER > 2"*/
345 #undef CONFIG_POWER_SAVING
349 #error "This IC can't support MI and WoWLan at the same time"
353 #if (CONFIG_IFACE_NUMBER > 4)
354 #error "Not support over 4 interfaces yet !!"
357 #if (CONFIG_IFACE_NUMBER > 8) /*IFACE_ID_MAX*/
358 #error "HW count not support over 8 interfaces !!"
361 #if (CONFIG_IFACE_NUMBER > 2)
362 #define CONFIG_MI_WITH_MBSSID_CAM
364 #ifdef CONFIG_MI_WITH_MBSSID_CAM
365 #define CONFIG_MBSSID_CAM
366 #if defined(CONFIG_RUNTIME_PORT_SWITCH)
367 #undef CONFIG_RUNTIME_PORT_SWITCH
371 #ifdef CONFIG_AP_MODE
372 #define CONFIG_SUPPORT_MULTI_BCN
374 #define CONFIG_SWTIMER_BASED_TXBCN
376 #ifdef CONFIG_HWMPCAP_GEN2 /*CONFIG_RTL8822B/CONFIG_RTL8821C/CONFIG_RTL8822C*/
377 #define CONFIG_FW_HANDLE_TXBCN
379 #ifdef CONFIG_FW_HANDLE_TXBCN
380 #ifdef CONFIG_SWTIMER_BASED_TXBCN
381 #undef CONFIG_SWTIMER_BASED_TXBCN
384 #define CONFIG_LIMITED_AP_NUM 4
386 #endif /*CONFIG_HWMPCAP_GEN2*/
387 #endif /*CONFIG_AP_MODE*/
389 #ifdef CONFIG_HWMPCAP_GEN2 /*CONFIG_RTL8822B/CONFIG_RTL8821C/CONFIG_RTL8822C*/
390 #define CONFIG_CLIENT_PORT_CFG
391 #define CONFIG_NEW_NETDEV_HDL
392 #endif/*CONFIG_HWMPCAP_GEN2*/
393 #endif/*(CONFIG_IFACE_NUMBER > 2)*/
395 #define MACID_NUM_SW_LIMIT 32
396 #define SEC_CAM_ENT_NUM_SW_LIMIT 32
398 #if defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A) || defined(CONFIG_RTL8814A)
399 #define CONFIG_IEEE80211_BAND_5GHZ
402 #if defined(CONFIG_WOWLAN) && (defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8814A))
403 #define CONFIG_WOW_PATTERN_HW_CAM
406 #ifndef CONFIG_TSF_UPDATE_PAUSE_FACTOR
407 #define CONFIG_TSF_UPDATE_PAUSE_FACTOR 200
410 #ifndef CONFIG_TSF_UPDATE_RESTORE_FACTOR
411 #define CONFIG_TSF_UPDATE_RESTORE_FACTOR 5
415 Mark CONFIG_DEAUTH_BEFORE_CONNECT by Arvin 2015/07/20
416 If the failure of Wi-Fi connection is due to some irregular disconnection behavior (like unplug dongle,
417 power down etc.) in last time, we can unmark this flag to avoid some unpredictable response from AP.
419 /*#define CONFIG_DEAUTH_BEFORE_CONNECT */
421 /*#define CONFIG_WEXT_DONT_JOIN_BYSSID */
422 /* #include <rtl871x_byteorder.h> */
425 /*#define CONFIG_DOSCAN_IN_BUSYTRAFFIC */
426 /*#define CONFIG_PHDYM_FW_FIXRATE */ /* Another way to fix tx rate */
428 /*Don't release SDIO irq in suspend/resume procedure*/
429 #define CONFIG_RTW_SDIO_KEEP_IRQ 0
432 * Add by Lucas@2016/02/15
435 #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_USB_RX_AGGREGATION)
436 #define RTW_RX_AGGREGATION
437 #endif /* CONFIG_SDIO_HCI || CONFIG_USB_RX_AGGREGATION */
439 #ifdef CONFIG_RTW_HOSTAPD_ACS
440 #if defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A) || defined(CONFIG_RTL8814A)
441 #ifndef CONFIG_FIND_BEST_CHANNEL
442 #define CONFIG_FIND_BEST_CHANNEL
445 #ifdef CONFIG_FIND_BEST_CHANNEL
446 #undef CONFIG_FIND_BEST_CHANNEL
448 #ifndef CONFIG_RTW_ACS
449 #define CONFIG_RTW_ACS
451 #ifndef CONFIG_BACKGROUND_NOISE_MONITOR
452 #define CONFIG_BACKGROUND_NOISE_MONITOR
457 #ifdef CONFIG_RTW_80211K
458 #ifndef CONFIG_RTW_ACS
459 #define CONFIG_RTW_ACS
461 #endif /*CONFIG_RTW_80211K*/
463 #ifdef DBG_CONFIG_ERROR_RESET
469 #ifdef RTW_REDUCE_SCAN_SWITCH_CH_TIME
470 #ifndef CONFIG_RTL8822B
471 #error "Only 8822B support RTW_REDUCE_SCAN_SWITCH_CH_TIME"
473 #ifndef RTW_CHANNEL_SWITCH_OFFLOAD
474 #define RTW_CHANNEL_SWITCH_OFFLOAD
478 #endif /* __DRV_CONF_H__ */