1 /******************************************************************************
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
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 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19 ******************************************************************************/
20 #ifndef __DRV_CONF_H__
21 #define __DRV_CONF_H__
23 #include "hal_ic_cfg.h"
25 #if defined(PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
27 #error "Shall be Linux or Windows, but not both!\n"
31 #if defined(CONFIG_MCC_MODE) && (!defined(CONFIG_CONCURRENT_MODE))
33 #error "Enable CONCURRENT_MODE before enable MCC MODE\n"
37 #if defined(CONFIG_MCC_MODE) && defined(CONFIG_BT_COEXIST)
39 #error "Disable BT COEXIST before enable MCC MODE\n"
43 #if defined(CONFIG_MCC_MODE) && defined(CONFIG_TDLS)
45 #error "Disable TDLS before enable MCC MODE\n"
49 #if defined(CONFIG_RTW_80211R) && !defined(CONFIG_LAYER2_ROAMING)
51 #error "Enable CONFIG_LAYER2_ROAMING before enable CONFIG_RTW_80211R\n"
55 /* Older Android kernel doesn't has CONFIG_ANDROID defined,
56 * add this to force CONFIG_ANDROID defined */
57 #ifdef CONFIG_PLATFORM_ANDROID
58 #ifndef CONFIG_ANDROID
59 #define CONFIG_ANDROID
64 /* Some Android build will restart the UI while non-printable ascii is passed
65 * between java and c/c++ layer (JNI). We force CONFIG_VALIDATE_SSID
66 * for Android here. If you are sure there is no risk on your system about this,
67 * mask this macro define to support non-printable ascii ssid.
68 * #define CONFIG_VALIDATE_SSID */
70 /* Android expect dbm as the rx signal strength unit */
71 #define CONFIG_SIGNAL_DISPLAY_DBM
75 #if defined(CONFIG_HAS_EARLYSUSPEND) && defined(CONFIG_RESUME_IN_WORKQUEUE)
76 #warning "You have CONFIG_HAS_EARLYSUSPEND enabled in your system, we disable CONFIG_RESUME_IN_WORKQUEUE automatically"
77 #undef CONFIG_RESUME_IN_WORKQUEUE
80 #if defined(CONFIG_ANDROID_POWER) && defined(CONFIG_RESUME_IN_WORKQUEUE)
81 #warning "You have CONFIG_ANDROID_POWER enabled in your system, we disable CONFIG_RESUME_IN_WORKQUEUE automatically"
82 #undef CONFIG_RESUME_IN_WORKQUEUE
86 #ifdef CONFIG_RESUME_IN_WORKQUEUE /* this can be removed, because there is no case for this... */
87 #if !defined(CONFIG_WAKELOCK) && !defined(CONFIG_ANDROID_POWER)
88 #error "enable CONFIG_RESUME_IN_WORKQUEUE without CONFIG_WAKELOCK or CONFIG_ANDROID_POWER will suffer from the danger of wifi's unfunctionality..."
89 #error "If you still want to enable CONFIG_RESUME_IN_WORKQUEUE in this case, mask this preprossor checking and GOOD LUCK..."
93 /* About USB VENDOR REQ */
94 #if defined(CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC) && !defined(CONFIG_USB_VENDOR_REQ_MUTEX)
95 #warning "define CONFIG_USB_VENDOR_REQ_MUTEX for CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC automatically"
96 #define CONFIG_USB_VENDOR_REQ_MUTEX
98 #if defined(CONFIG_VENDOR_REQ_RETRY) && !defined(CONFIG_USB_VENDOR_REQ_MUTEX)
99 #warning "define CONFIG_USB_VENDOR_REQ_MUTEX for CONFIG_VENDOR_REQ_RETRY automatically"
100 #define CONFIG_USB_VENDOR_REQ_MUTEX
103 #if !defined(CONFIG_AP_MODE) && defined(CONFIG_DFS_MASTER)
104 #warning "undef CONFIG_DFS_MASTER because CONFIG_AP_MODE is not defined"
105 #undef CONFIG_DFS_MASTER
108 #define RTW_SCAN_SPARSE_MIRACAST 1
109 #define RTW_SCAN_SPARSE_BG 0
110 #define RTW_SCAN_SPARSE_ROAMING_ACTIVE 1
112 #ifndef CONFIG_RTW_HIQ_FILTER
113 #define CONFIG_RTW_HIQ_FILTER 1
116 #ifndef CONFIG_RTW_FORCE_IGI_LB
117 #define CONFIG_RTW_FORCE_IGI_LB 0
120 #ifndef CONFIG_RTW_ADAPTIVITY_EN
121 #define CONFIG_RTW_ADAPTIVITY_EN 0
124 #ifndef CONFIG_RTW_ADAPTIVITY_MODE
125 #define CONFIG_RTW_ADAPTIVITY_MODE 0
128 #ifndef CONFIG_RTW_ADAPTIVITY_DML
129 #define CONFIG_RTW_ADAPTIVITY_DML 0
132 #ifndef CONFIG_RTW_ADAPTIVITY_DC_BACKOFF
133 #define CONFIG_RTW_ADAPTIVITY_DC_BACKOFF 2
136 #ifndef CONFIG_RTW_ADAPTIVITY_TH_L2H_INI
137 #define CONFIG_RTW_ADAPTIVITY_TH_L2H_INI 0
140 #ifndef CONFIG_RTW_ADAPTIVITY_TH_EDCCA_HL_DIFF
141 #define CONFIG_RTW_ADAPTIVITY_TH_EDCCA_HL_DIFF 0
144 #ifndef CONFIG_RTW_EXCL_CHS
145 #define CONFIG_RTW_EXCL_CHS {0}
148 #ifndef CONFIG_RTW_DFS_REGION_DOMAIN
149 #define CONFIG_RTW_DFS_REGION_DOMAIN 0
152 #ifndef CONFIG_TXPWR_BY_RATE_EN
153 #define CONFIG_TXPWR_BY_RATE_EN 2 /* by efuse */
155 #ifndef CONFIG_TXPWR_LIMIT_EN
156 #define CONFIG_TXPWR_LIMIT_EN 2 /* by efuse */
159 /* compatible with old fashion configuration */
160 #if defined(CONFIG_CALIBRATE_TX_POWER_BY_REGULATORY)
161 #undef CONFIG_TXPWR_BY_RATE_EN
162 #undef CONFIG_TXPWR_LIMIT_EN
163 #define CONFIG_TXPWR_BY_RATE_EN 1
164 #define CONFIG_TXPWR_LIMIT_EN 1
165 #elif defined(CONFIG_CALIBRATE_TX_POWER_TO_MAX)
166 #undef CONFIG_TXPWR_BY_RATE_EN
167 #undef CONFIG_TXPWR_LIMIT_EN
168 #define CONFIG_TXPWR_BY_RATE_EN 1
169 #define CONFIG_TXPWR_LIMIT_EN 0
172 #ifndef RTW_DEF_MODULE_REGULATORY_CERT
173 #define RTW_DEF_MODULE_REGULATORY_CERT 0
176 #if RTW_DEF_MODULE_REGULATORY_CERT
177 /* force enable TX power by rate and TX power limit */
178 #undef CONFIG_TXPWR_BY_RATE_EN
179 #undef CONFIG_TXPWR_LIMIT_EN
180 #define CONFIG_TXPWR_BY_RATE_EN 1
181 #define CONFIG_TXPWR_LIMIT_EN 1
184 #ifndef CONFIG_RTW_RX_AMPDU_SZ_LIMIT_1SS
185 #define CONFIG_RTW_RX_AMPDU_SZ_LIMIT_1SS {0xFF, 0xFF, 0xFF, 0xFF}
187 #ifndef CONFIG_RTW_RX_AMPDU_SZ_LIMIT_2SS
188 #define CONFIG_RTW_RX_AMPDU_SZ_LIMIT_2SS {0xFF, 0xFF, 0xFF, 0xFF}
190 #ifndef CONFIG_RTW_RX_AMPDU_SZ_LIMIT_3SS
191 #define CONFIG_RTW_RX_AMPDU_SZ_LIMIT_3SS {0xFF, 0xFF, 0xFF, 0xFF}
193 #ifndef CONFIG_RTW_RX_AMPDU_SZ_LIMIT_4SS
194 #define CONFIG_RTW_RX_AMPDU_SZ_LIMIT_4SS {0xFF, 0xFF, 0xFF, 0xFF}
197 #ifndef CONFIG_RTW_TARGET_TX_PWR_2G_A
198 #define CONFIG_RTW_TARGET_TX_PWR_2G_A {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
201 #ifndef CONFIG_RTW_TARGET_TX_PWR_2G_B
202 #define CONFIG_RTW_TARGET_TX_PWR_2G_B {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
205 #ifndef CONFIG_RTW_TARGET_TX_PWR_2G_C
206 #define CONFIG_RTW_TARGET_TX_PWR_2G_C {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
209 #ifndef CONFIG_RTW_TARGET_TX_PWR_2G_D
210 #define CONFIG_RTW_TARGET_TX_PWR_2G_D {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
213 #ifndef CONFIG_RTW_TARGET_TX_PWR_5G_A
214 #define CONFIG_RTW_TARGET_TX_PWR_5G_A {-1, -1, -1, -1, -1, -1, -1, -1, -1}
217 #ifndef CONFIG_RTW_TARGET_TX_PWR_5G_B
218 #define CONFIG_RTW_TARGET_TX_PWR_5G_B {-1, -1, -1, -1, -1, -1, -1, -1, -1}
221 #ifndef CONFIG_RTW_TARGET_TX_PWR_5G_C
222 #define CONFIG_RTW_TARGET_TX_PWR_5G_C {-1, -1, -1, -1, -1, -1, -1, -1, -1}
225 #ifndef CONFIG_RTW_TARGET_TX_PWR_5G_D
226 #define CONFIG_RTW_TARGET_TX_PWR_5G_D {-1, -1, -1, -1, -1, -1, -1, -1, -1}
229 #ifndef CONFIG_RTW_AMPLIFIER_TYPE_2G
230 #define CONFIG_RTW_AMPLIFIER_TYPE_2G 0
233 #ifndef CONFIG_RTW_AMPLIFIER_TYPE_5G
234 #define CONFIG_RTW_AMPLIFIER_TYPE_5G 0
237 #ifndef CONFIG_RTW_RFE_TYPE
238 #define CONFIG_RTW_RFE_TYPE 64
241 #ifndef CONFIG_RTW_GLNA_TYPE
242 #define CONFIG_RTW_GLNA_TYPE 0
245 #ifndef CONFIG_RTW_PLL_REF_CLK_SEL
246 #define CONFIG_RTW_PLL_REF_CLK_SEL 0x0F
249 #ifndef CONFIG_IFACE_NUMBER
250 #ifdef CONFIG_CONCURRENT_MODE
251 #define CONFIG_IFACE_NUMBER 2
253 #define CONFIG_IFACE_NUMBER 1
257 #ifndef CONFIG_CONCURRENT_MODE
258 #if (CONFIG_IFACE_NUMBER > 1)
259 #error "CONFIG_IFACE_NUMBER over 1,but CONFIG_CONCURRENT_MODE not defined"
263 #if (CONFIG_IFACE_NUMBER == 0)
264 #error "CONFIG_IFACE_NUMBER cound not equel to 0 !!"
267 #if (CONFIG_IFACE_NUMBER > 3)
268 #error "Not support over 3 interfaces yet !!"
271 #if (CONFIG_IFACE_NUMBER > 8) /*IFACE_ID_MAX*/
272 #error "HW count not support over 8 interfaces !!"
275 #if (CONFIG_IFACE_NUMBER > 2)
276 #define CONFIG_MI_WITH_MBSSID_CAM
278 #ifdef CONFIG_MI_WITH_MBSSID_CAM
279 #define CONFIG_MBSSID_CAM
280 #if defined(CONFIG_RUNTIME_PORT_SWITCH)
281 #undef CONFIG_RUNTIME_PORT_SWITCH
285 #ifdef CONFIG_AP_MODE
286 #define CONFIG_SWTIMER_BASED_TXBCN
287 /*#define CONFIG_FW_BASED_BCN*/
291 #define MACID_NUM_SW_LIMIT 32
292 #define SEC_CAM_ENT_NUM_SW_LIMIT 32
294 #if defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A) || defined(CONFIG_RTL8814A)
295 #define CONFIG_IEEE80211_BAND_5GHZ
298 #if defined(CONFIG_WOWLAN) && (defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C))
299 #define CONFIG_WOW_PATTERN_HW_CAM
303 Mark CONFIG_DEAUTH_BEFORE_CONNECT by Arvin 2015/07/20
304 If the failure of Wi-Fi connection is due to some irregular disconnection behavior (like unplug dongle,
305 power down etc.) in last time, we can unmark this flag to avoid some unpredictable response from AP.
307 /*#define CONFIG_DEAUTH_BEFORE_CONNECT */
309 /*#define CONFIG_WEXT_DONT_JOIN_BYSSID */
310 /* #include <rtl871x_byteorder.h> */
313 /*#define CONFIG_DOSCAN_IN_BUSYTRAFFIC */
315 /*Don't release SDIO irq in suspend/resume procedure*/
316 #define CONFIG_RTW_SDIO_KEEP_IRQ 0
319 * Add by Lucas@2016/02/15
322 #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_USB_RX_AGGREGATION)
323 #define RTW_RX_AGGREGATION
324 #endif /* CONFIG_SDIO_HCI || CONFIG_USB_RX_AGGREGATION */
326 #endif /* __DRV_CONF_H__ */