xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/rtl8723bs/include/drv_conf.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2017 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 #if defined(PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
21 
22 	#error "Shall be Linux or Windows, but not both!\n"
23 
24 #endif
25 
26 #ifdef CONFIG_RTW_REPEATER_SON
27 	#ifndef CONFIG_AP
28 		#define CONFIG_AP
29 	#endif
30 	#ifndef CONFIG_CONCURRENT_MODE
31 		#define CONFIG_CONCURRENT_MODE
32 	#endif
33 	#ifndef CONFIG_BR_EXT
34 		#define CONFIG_BR_EXT
35 	#endif
36 	#ifndef CONFIG_RTW_REPEATER_SON_ID
37 		#define CONFIG_RTW_REPEATER_SON_ID			0x02040608
38 	#endif
39 	//#define CONFIG_RTW_REPEATER_SON_ROOT
40 	#ifndef CONFIG_RTW_REPEATER_SON_ROOT
41 		#define CONFIG_LAYER2_ROAMING_ACTIVE
42 	#endif
43 	#undef CONFIG_POWER_SAVING
44 #endif
45 
46 #if defined(CONFIG_MCC_MODE) && (!defined(CONFIG_CONCURRENT_MODE))
47 
48 	#error "Enable CONCURRENT_MODE before enable MCC MODE\n"
49 
50 #endif
51 
52 #if defined(CONFIG_MCC_MODE) && defined(CONFIG_BT_COEXIST)
53 
54 	#error "Disable BT COEXIST before enable MCC MODE\n"
55 
56 #endif
57 
58 #if defined(CONFIG_MCC_MODE) && defined(CONFIG_TDLS)
59 
60 	#error "Disable TDLS before enable MCC MODE\n"
61 
62 #endif
63 
64 #if defined(CONFIG_RTW_80211R) && !defined(CONFIG_LAYER2_ROAMING)
65 
66 	#error "Enable CONFIG_LAYER2_ROAMING before enable CONFIG_RTW_80211R\n"
67 
68 #endif
69 
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
75 	#endif
76 #endif
77 
78 #ifdef 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 */
84 
85 	/* Android expect dbm as the rx signal strength unit */
86 	#define CONFIG_SIGNAL_DISPLAY_DBM
87 #endif
88 
89 /*
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
93 #endif
94 
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
98 #endif
99 */
100 
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..."
105 	#endif
106 #endif
107 
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
112 #endif
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
116 #endif
117 
118 #if !defined(CONFIG_AP_MODE) && defined(CONFIG_DFS_MASTER)
119 	#warning "undef CONFIG_DFS_MASTER because CONFIG_AP_MODE is not defined"
120 	#undef CONFIG_DFS_MASTER
121 #endif
122 
123 #define RTW_SCAN_SPARSE_MIRACAST 1
124 #define RTW_SCAN_SPARSE_BG 0
125 #define RTW_SCAN_SPARSE_ROAMING_ACTIVE 1
126 
127 #ifndef CONFIG_RTW_HIQ_FILTER
128 	#define CONFIG_RTW_HIQ_FILTER 1
129 #endif
130 
131 #ifndef CONFIG_RTW_ADAPTIVITY_EN
132 	#define CONFIG_RTW_ADAPTIVITY_EN 0
133 #endif
134 
135 #ifndef CONFIG_RTW_ADAPTIVITY_MODE
136 	#define CONFIG_RTW_ADAPTIVITY_MODE 0
137 #endif
138 
139 #ifndef CONFIG_RTW_ADAPTIVITY_DML
140 	#define CONFIG_RTW_ADAPTIVITY_DML 0
141 #endif
142 
143 #ifndef CONFIG_RTW_ADAPTIVITY_DC_BACKOFF
144 	#define CONFIG_RTW_ADAPTIVITY_DC_BACKOFF 2
145 #endif
146 
147 #ifndef CONFIG_RTW_ADAPTIVITY_TH_L2H_INI
148 	#define CONFIG_RTW_ADAPTIVITY_TH_L2H_INI 0
149 #endif
150 
151 #ifndef CONFIG_RTW_ADAPTIVITY_TH_EDCCA_HL_DIFF
152 	#define CONFIG_RTW_ADAPTIVITY_TH_EDCCA_HL_DIFF 0
153 #endif
154 
155 #ifndef CONFIG_RTW_EXCL_CHS
156 	#define CONFIG_RTW_EXCL_CHS {0}
157 #endif
158 
159 #ifndef CONFIG_RTW_DFS_REGION_DOMAIN
160 	#define CONFIG_RTW_DFS_REGION_DOMAIN 0
161 #endif
162 
163 #ifndef CONFIG_TXPWR_BY_RATE_EN
164 #define CONFIG_TXPWR_BY_RATE_EN 2 /* by efuse */
165 #endif
166 #ifndef CONFIG_TXPWR_LIMIT_EN
167 #define CONFIG_TXPWR_LIMIT_EN 2 /* by efuse */
168 #endif
169 
170 #ifndef CONFIG_RTW_CHPLAN
171 #define CONFIG_RTW_CHPLAN 0xFF /* RTW_CHPLAN_UNSPECIFIED */
172 #endif
173 
174 /* compatible with old fashion configuration */
175 #if defined(CONFIG_CALIBRATE_TX_POWER_BY_REGULATORY)
176 	#undef CONFIG_TXPWR_BY_RATE_EN
177 	#undef CONFIG_TXPWR_LIMIT_EN
178 	#define CONFIG_TXPWR_BY_RATE_EN 1
179 	#define CONFIG_TXPWR_LIMIT_EN 1
180 #elif defined(CONFIG_CALIBRATE_TX_POWER_TO_MAX)
181 	#undef CONFIG_TXPWR_BY_RATE_EN
182 	#undef CONFIG_TXPWR_LIMIT_EN
183 	#define CONFIG_TXPWR_BY_RATE_EN 1
184 	#define CONFIG_TXPWR_LIMIT_EN 0
185 #endif
186 
187 #ifndef RTW_DEF_MODULE_REGULATORY_CERT
188 	#define RTW_DEF_MODULE_REGULATORY_CERT 0
189 #endif
190 
191 #if RTW_DEF_MODULE_REGULATORY_CERT
192 	/* force enable TX power by rate and TX power limit */
193 	#undef CONFIG_TXPWR_BY_RATE_EN
194 	#undef CONFIG_TXPWR_LIMIT_EN
195 	#define CONFIG_TXPWR_BY_RATE_EN 1
196 	#define CONFIG_TXPWR_LIMIT_EN 1
197 #endif
198 
199 #if !defined(CONFIG_TXPWR_LIMIT) && CONFIG_TXPWR_LIMIT_EN
200 	#define CONFIG_TXPWR_LIMIT
201 #endif
202 
203 #ifdef CONFIG_RTW_IPCAM_APPLICATION
204 	#undef CONFIG_TXPWR_BY_RATE_EN
205 	#define CONFIG_TXPWR_BY_RATE_EN 1
206 	#define CONFIG_RTW_CUSTOMIZE_BEEDCA		0x0000431C
207 	#define CONFIG_RTW_CUSTOMIZE_BWMODE		0x00
208 	#define CONFIG_RTW_CUSTOMIZE_RLSTA		0x7
209 #endif
210 
211 
212 #ifndef CONFIG_RTW_RX_AMPDU_SZ_LIMIT_1SS
213 	#define CONFIG_RTW_RX_AMPDU_SZ_LIMIT_1SS {0xFF, 0xFF, 0xFF, 0xFF}
214 #endif
215 #ifndef CONFIG_RTW_RX_AMPDU_SZ_LIMIT_2SS
216 	#define CONFIG_RTW_RX_AMPDU_SZ_LIMIT_2SS {0xFF, 0xFF, 0xFF, 0xFF}
217 #endif
218 #ifndef CONFIG_RTW_RX_AMPDU_SZ_LIMIT_3SS
219 	#define CONFIG_RTW_RX_AMPDU_SZ_LIMIT_3SS {0xFF, 0xFF, 0xFF, 0xFF}
220 #endif
221 #ifndef CONFIG_RTW_RX_AMPDU_SZ_LIMIT_4SS
222 	#define CONFIG_RTW_RX_AMPDU_SZ_LIMIT_4SS {0xFF, 0xFF, 0xFF, 0xFF}
223 #endif
224 
225 #ifndef CONFIG_RTW_TARGET_TX_PWR_2G_A
226 	#define CONFIG_RTW_TARGET_TX_PWR_2G_A {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
227 #endif
228 
229 #ifndef CONFIG_RTW_TARGET_TX_PWR_2G_B
230 	#define CONFIG_RTW_TARGET_TX_PWR_2G_B {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
231 #endif
232 
233 #ifndef CONFIG_RTW_TARGET_TX_PWR_2G_C
234 	#define CONFIG_RTW_TARGET_TX_PWR_2G_C {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
235 #endif
236 
237 #ifndef CONFIG_RTW_TARGET_TX_PWR_2G_D
238 	#define CONFIG_RTW_TARGET_TX_PWR_2G_D {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
239 #endif
240 
241 #ifndef CONFIG_RTW_TARGET_TX_PWR_5G_A
242 	#define CONFIG_RTW_TARGET_TX_PWR_5G_A {-1, -1, -1, -1, -1, -1, -1, -1, -1}
243 #endif
244 
245 #ifndef CONFIG_RTW_TARGET_TX_PWR_5G_B
246 	#define CONFIG_RTW_TARGET_TX_PWR_5G_B {-1, -1, -1, -1, -1, -1, -1, -1, -1}
247 #endif
248 
249 #ifndef CONFIG_RTW_TARGET_TX_PWR_5G_C
250 	#define CONFIG_RTW_TARGET_TX_PWR_5G_C {-1, -1, -1, -1, -1, -1, -1, -1, -1}
251 #endif
252 
253 #ifndef CONFIG_RTW_TARGET_TX_PWR_5G_D
254 	#define CONFIG_RTW_TARGET_TX_PWR_5G_D {-1, -1, -1, -1, -1, -1, -1, -1, -1}
255 #endif
256 
257 #ifndef CONFIG_RTW_AMPLIFIER_TYPE_2G
258 	#define CONFIG_RTW_AMPLIFIER_TYPE_2G 0
259 #endif
260 
261 #ifndef CONFIG_RTW_AMPLIFIER_TYPE_5G
262 	#define CONFIG_RTW_AMPLIFIER_TYPE_5G 0
263 #endif
264 
265 #ifndef CONFIG_RTW_RFE_TYPE
266 	#define CONFIG_RTW_RFE_TYPE 64
267 #endif
268 
269 #ifndef CONFIG_RTW_GLNA_TYPE
270 	#define CONFIG_RTW_GLNA_TYPE 0
271 #endif
272 
273 #ifndef CONFIG_RTW_PLL_REF_CLK_SEL
274 	#define CONFIG_RTW_PLL_REF_CLK_SEL 0x0F
275 #endif
276 
277 #ifndef CONFIG_IFACE_NUMBER
278 	#ifdef CONFIG_CONCURRENT_MODE
279 		#define CONFIG_IFACE_NUMBER	2
280 	#else
281 		#define CONFIG_IFACE_NUMBER	1
282 	#endif
283 #endif
284 
285 #ifndef CONFIG_CONCURRENT_MODE
286 	#if (CONFIG_IFACE_NUMBER > 1)
287 		#error "CONFIG_IFACE_NUMBER over 1,but CONFIG_CONCURRENT_MODE not defined"
288 	#endif
289 #endif
290 
291 #if (CONFIG_IFACE_NUMBER == 0)
292 	#error "CONFIG_IFACE_NUMBER cound not equel to 0 !!"
293 #endif
294 
295 #if (CONFIG_IFACE_NUMBER > 3)
296 	#error "Not support over 3 interfaces yet !!"
297 #endif
298 
299 #if (CONFIG_IFACE_NUMBER > 8)	/*IFACE_ID_MAX*/
300 	#error "HW count not support over 8 interfaces !!"
301 #endif
302 
303 #if (CONFIG_IFACE_NUMBER > 2)
304 	#define CONFIG_MI_WITH_MBSSID_CAM
305 
306 	#ifdef CONFIG_MI_WITH_MBSSID_CAM
307 		#define CONFIG_MBSSID_CAM
308 		#if defined(CONFIG_RUNTIME_PORT_SWITCH)
309 			#undef CONFIG_RUNTIME_PORT_SWITCH
310 		#endif
311 	#endif
312 
313 	#ifdef CONFIG_AP_MODE
314 		#define CONFIG_SWTIMER_BASED_TXBCN
315 		/*#define CONFIG_FW_BASED_BCN*/
316 	#endif
317 #endif
318 
319 #define MACID_NUM_SW_LIMIT 32
320 #define SEC_CAM_ENT_NUM_SW_LIMIT 32
321 
322 #if defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A) || defined(CONFIG_RTL8814A)
323 	#define CONFIG_IEEE80211_BAND_5GHZ
324 #endif
325 
326 #if defined(CONFIG_WOWLAN) && (defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C))
327 	#define CONFIG_WOW_PATTERN_HW_CAM
328 #endif
329 
330 /*
331 	Mark CONFIG_DEAUTH_BEFORE_CONNECT by Arvin 2015/07/20
332 	If the failure of Wi-Fi connection is due to some irregular disconnection behavior (like unplug dongle,
333 	power down etc.) in last time, we can unmark this flag to avoid some unpredictable response from AP.
334 */
335 /*#define CONFIG_DEAUTH_BEFORE_CONNECT */
336 
337 /*#define CONFIG_WEXT_DONT_JOIN_BYSSID	*/
338 /* #include <rtl871x_byteorder.h> */
339 
340 
341 /*#define CONFIG_DOSCAN_IN_BUSYTRAFFIC	*/
342 
343 /*Don't release SDIO irq in suspend/resume procedure*/
344 #define CONFIG_RTW_SDIO_KEEP_IRQ	0
345 
346 /*
347  * Add by Lucas@2016/02/15
348  * For RX Aggregation
349  */
350 #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_USB_RX_AGGREGATION)
351 	#define RTW_RX_AGGREGATION
352 #endif /* CONFIG_SDIO_HCI || CONFIG_USB_RX_AGGREGATION */
353 
354 #ifdef CONFIG_RTW_HOSTAPD_ACS
355 	#if defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A) || defined(CONFIG_RTL8814A)
356 		#ifndef CONFIG_FIND_BEST_CHANNEL
357 			#define CONFIG_FIND_BEST_CHANNEL
358 		#endif
359 	#else
360 		#ifdef CONFIG_FIND_BEST_CHANNEL
361 			#undef CONFIG_FIND_BEST_CHANNEL
362 		#endif
363 		#ifndef CONFIG_RTW_ACS
364 			#define CONFIG_RTW_ACS
365 		#endif
366 		#ifndef CONFIG_BACKGROUND_NOISE_MONITOR
367 			#define CONFIG_BACKGROUND_NOISE_MONITOR
368 		#endif
369 	#endif
370 #endif
371 
372 #ifdef DBG_CONFIG_ERROR_RESET
373 #ifndef CONFIG_IPS
374 #define CONFIG_IPS
375 #endif
376 #endif
377 #endif /* __DRV_CONF_H__ */
378