xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/rtl8822bs/include/autoconf.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /******************************************************************************
2  *
3  * Copyright(c) 2015 - 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 /*
16  * Public General Config
17  */
18 #define AUTOCONF_INCLUDED
19 
20 #define RTL871X_MODULE_NAME "88x2BS"
21 #define DRV_NAME "rtl88x2bs"
22 
23 /* Set CONFIG_RTL8822B from Makefile */
24 #ifndef CONFIG_RTL8822B
25 #define CONFIG_RTL8822B
26 #endif
27 #define CONFIG_SDIO_HCI
28 #define PLATFORM_LINUX
29 
30 
31 /*
32  * Wi-Fi Functions Config
33  */
34 
35 #define CONFIG_RECV_REORDERING_CTRL
36 
37 #define CONFIG_80211N_HT
38 #define CONFIG_80211AC_VHT
39 #ifdef CONFIG_80211AC_VHT
40 	#ifndef CONFIG_80211N_HT
41 		#define CONFIG_80211N_HT
42 	#endif
43 #endif
44 
45 /* Set CONFIG_IOCTL_CFG80211 from Makefile */
46 #ifdef CONFIG_IOCTL_CFG80211
47 	/*
48 	 * Indecate new sta asoc through cfg80211_new_sta
49 	 * If kernel version >= 3.2 or
50 	 * version < 3.2 but already apply cfg80211 patch,
51 	 * RTW_USE_CFG80211_STA_EVENT must be defiend!
52 	 */
53 	/* Set RTW_USE_CFG80211_STA_EVENT from Makefile */
54 	#define CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER
55 	/*#define CONFIG_DEBUG_CFG80211*/
56 	#define CONFIG_SET_SCAN_DENY_TIMER
57 #endif /* CONFIG_IOCTL_CFG80211 */
58 
59 #define CONFIG_AP_MODE
60 #ifdef CONFIG_AP_MODE
61 	#define CONFIG_NATIVEAP_MLME
62 	#ifndef CONFIG_NATIVEAP_MLME
63 		#define CONFIG_HOSTAPD_MLME
64 	#endif
65 	/*#define CONFIG_FIND_BEST_CHANNEL*/
66 #endif
67 
68 #define CONFIG_P2P
69 #ifdef CONFIG_P2P
70 	#define CONFIG_WFD	/* Wi-Fi display */
71 	#define CONFIG_P2P_REMOVE_GROUP_INFO
72 	/*#define CONFIG_DBG_P2P*/
73 	#define CONFIG_P2P_PS
74 	/*#define CONFIG_P2P_IPS*/
75 	#define CONFIG_P2P_OP_CHK_SOCIAL_CH
76 	#define CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT  /* Replace CONFIG_P2P_CHK_INVITE_CH_LIST flag */
77 	/*#define CONFIG_P2P_INVITE_IOT*/
78 #endif /* CONFIG_P2P */
79 
80 /* Set CONFIG_TDLS from Makefile */
81 #ifdef CONFIG_TDLS
82 	#define CONFIG_TDLS_DRIVER_SETUP
83 #if 0
84 	#ifndef CONFIG_WFD
85 		#define CONFIG_WFD
86 	#endif
87 	#define CONFIG_TDLS_AUTOSETUP
88 #endif
89 	#define CONFIG_TDLS_AUTOCHECKALIVE
90 	/*
91 	 * Enable "CONFIG_TDLS_CH_SW" by default,
92 	 * however limit it to only work in wifi logo test mode
93 	 * but not in normal mode currently
94 	 */
95 	#define CONFIG_TDLS_CH_SW
96 #endif /* CONFIG_TDLS */
97 
98 /*#define CONFIG_RTW_80211K*/
99 
100 #define CONFIG_LAYER2_ROAMING
101 #define CONFIG_LAYER2_ROAMING_RESUME
102 
103 #define CONFIG_BEAMFORMING
104 
105 
106 /*
107  * Hareware/Firmware Related Config
108  */
109 /* Set CONFIG_BT_COEXIST from Makefile */
110 /*#define CONFIG_ANTENNA_DIVERSITY*/
111 /*#define SUPPORT_HW_RFOFF_DETECTED*/
112 /*#define CONFIG_RTW_LED*/
113 #ifdef CONFIG_RTW_LED
114 	/*#define CONFIG_RTW_SW_LED*/
115 #endif /* CONFIG_RTW_LED */
116 
117 #define CONFIG_XMIT_ACK
118 #ifdef CONFIG_XMIT_ACK
119 	#define CONFIG_ACTIVE_KEEP_ALIVE_CHECK
120 #endif
121 
122 
123 #define DISABLE_BB_RF		0
124 #define RTW_NOTCH_FILTER	0 /* 0:Disable, 1:Enable */
125 #define CONFIG_DYNAMIC_SOML
126 
127 #define CONFIG_SUPPORT_TRX_SHARED
128 #ifdef CONFIG_SUPPORT_TRX_SHARED
129 #define DFT_TRX_SHARE_MODE	1
130 #endif /* CONFIG_SUPPORT_TRX_SHARED */
131 
132 /*
133  * Software feature Related Config
134  */
135 #define RTW_HALMAC		/* Use HALMAC architecture, necessary for 8822B */
136 #define CONFIG_RECV_THREAD_MODE
137 #ifdef CONFIG_RECV_THREAD_MODE
138 #define RTW_RECV_THREAD_HIGH_PRIORITY
139 #endif/*CONFIG_RECV_THREAD_MODE*/
140 
141 /* Speed up C2H handle and avoid race condition */
142 #define RTW_HANDLE_C2H_IN_ISR
143 
144 /*
145  * Interface Related Config
146  */
147 #define CONFIG_TX_AGGREGATION
148 #define CONFIG_XMIT_THREAD_MODE	/* necessary for SDIO */
149 #define RTW_XMIT_THREAD_HIGH_PRIORITY
150 /*#define RTW_XMIT_THREAD_HIGH_PRIORITY_AGG*/
151 /*#define CONFIG_SDIO_TX_ENABLE_AVAL_INT*/ /* not implemented yet */
152 #define CONFIG_SDIO_RX_COPY
153 #ifdef CONFIG_PREALLOC_RX_SKB_BUFFER
154 #ifndef CONFIG_SDIO_RX_COPY
155 #error "CONFIG_PREALLOC_RX_SKB_BUFFER would need CONFIG_SDIO_RX_COPY"
156 #endif
157 #endif /* CONFIG_PREALLOC_RX_SKB_BUFFER */
158 
159 #define CONFIG_SDIO_HOOK_DEV_SHUTDOWN
160 
161 
162 /*
163  * Others
164  */
165 /*#define CONFIG_MAC_LOOPBACK_DRIVER*/
166 #define CONFIG_SKB_COPY		/* for amsdu */
167 #define CONFIG_NEW_SIGNAL_STAT_PROCESS
168 #define CONFIG_EMBEDDED_FWIMG
169 #ifdef CONFIG_EMBEDDED_FWIMG
170 	#define	LOAD_FW_HEADER_FROM_DRIVER
171 #endif
172 /*#define CONFIG_FILE_FWIMG*/
173 #define CONFIG_LONG_DELAY_ISSUE
174 /*#define CONFIG_PATCH_JOIN_WRONG_CHANNEL*/
175 
176 #ifdef CONFIG_RTW_NAPI
177 #define CONFIG_RTW_NAPI_DYNAMIC
178 #define CONFIG_RTW_NAPI_V2
179 #endif
180 
181 /*
182  * Platform
183  */
184 #ifdef CONFIG_PLATFORM_INTEL_BYT
185 #ifdef CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER
186 #undef CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER
187 #endif
188 #endif /* CONFIG_PLATFORM_INTEL_BYT */
189 
190 
191 /*
192  * Auto Config Section
193  */
194 #ifdef CONFIG_MAC_LOOPBACK_DRIVER
195 #undef CONFIG_IOCTL_CFG80211
196 #undef CONFIG_AP_MODE
197 #undef CONFIG_NATIVEAP_MLME
198 #undef CONFIG_POWER_SAVING
199 #undef CONFIG_BT_COEXIST
200 #undef CONFIG_ANTENNA_DIVERSITY
201 #undef SUPPORT_HW_RFOFF_DETECTED
202 #endif /* CONFIG_MAC_LOOPBACK_DRIVER */
203 
204 #ifdef CONFIG_MP_INCLUDED
205 	#define MP_DRIVER	1
206 	#define CONFIG_MP_IWPRIV_SUPPORT
207 #else /* !CONFIG_MP_INCLUDED */
208 	#define MP_DRIVER	0
209 	#undef CONFIG_MP_IWPRIV_SUPPORT
210 #endif /* !CONFIG_MP_INCLUDED */
211 
212 #ifdef CONFIG_POWER_SAVING
213 	#define CONFIG_IPS
214 	#define CONFIG_LPS
215 
216 	#if defined(CONFIG_LPS) && (defined(CONFIG_GSPI_HCI) || defined(CONFIG_SDIO_HCI))
217 	#define CONFIG_LPS_LCLK
218 	#endif
219 
220 	#ifdef CONFIG_LPS
221 		#define CONFIG_CHECK_LEAVE_LPS
222 		#ifndef CONFIG_PLATFORM_INTEL_BYT
223 		#define CONFIG_LPS_SLOW_TRANSITION
224 		#endif /* !CONFIG_PLATFORM_INTEL_BYT */
225 	#endif
226 
227 	#ifdef CONFIG_LPS_LCLK
228 	#define CONFIG_DETECT_CPWM_BY_POLLING
229 	#define CONFIG_LPS_RPWM_TIMER
230 	#if defined(CONFIG_LPS_RPWM_TIMER) || defined(CONFIG_DETECT_CPWM_BY_POLLING)
231 	#define LPS_RPWM_WAIT_MS 300
232 	#endif
233 	#define CONFIG_LPS_LCLK_WD_TIMER /* Watch Dog timer in LPS LCLK */
234 	#endif
235 
236 	#ifdef CONFIG_IPS
237 	#define CONFIG_IPS_CHECK_IN_WD /* Do IPS Check in WatchDog. */
238 	/*#define CONFIG_SWLPS_IN_IPS*/ /* Do SW LPS flow when entering and leaving IPS */
239 	/*#define CONFIG_FWLPS_IN_IPS*/ /* issue H2C command to let FW do LPS when entering IPS */
240 	#endif
241 
242 	#ifdef CONFIG_LPS
243 		#define CONFIG_WMMPS_STA 1
244 	#endif /* CONFIG_LPS */
245 #endif /* CONFIG_POWER_SAVING */
246 
247 #ifdef CONFIG_BT_COEXIST
248 	/* for ODM and outsrc BT-Coex */
249 	#ifndef CONFIG_LPS
250 		#define CONFIG_LPS	/* download reserved page to FW */
251 	#endif
252 #endif /* !CONFIG_BT_COEXIST */
253 
254 #ifdef CONFIG_GPIO_WAKEUP
255 	#ifndef WAKEUP_GPIO_IDX
256 		/* 1315 module WIFI Chip Side */
257 		#define WAKEUP_GPIO_IDX	10
258 	#endif /* !WAKEUP_GPIO_IDX */
259 #endif /* CONFIG_GPIO_WAKEUP */
260 
261 
262 #ifdef CONFIG_ANTENNA_DIVERSITY
263 #define CONFIG_HW_ANTENNA_DIVERSITY
264 #endif /* CONFIG_ANTENNA_DIVERSITY */
265 
266 /*
267  * Platform
268  */
269 #ifdef CONFIG_PLATFORM_HISILICON_HI3798_MV200_HDMI_DONGLE
270 	#ifdef RTW_XMIT_THREAD_HIGH_PRIORITY
271 		#undef RTW_XMIT_THREAD_HIGH_PRIORITY
272 	#endif
273 	#ifdef RTW_XMIT_THREAD_HIGH_PRIORITY_AGG
274 		#undef RTW_XMIT_THREAD_HIGH_PRIORITY_AGG
275 	#endif
276 
277 	#define CONFIG_REDUCE_TX_CPU_LOADING
278 
279 	#define CONFIG_STA_SCAN_BACKOP
280 
281 	#ifdef CONFIG_POWER_SAVING
282 	#ifdef CONFIG_LPS
283 		#define CONFIG_LPS_NOT_LEAVE_FOR_ICMP
284 		#define CONFIG_LPS_CHK_BY_TP
285 		#ifdef CONFIG_LPS_CHK_BY_TP
286 			#define LPS_TX_TP_TH		60 /*Mbps*/
287 			#define LPS_RX_TP_TH	60 /*Mbps*/
288 			#define LPS_BI_TP_TH		60 /*Mbps*//*TX + RX*/
289 			#define LPS_TP_CHK_CNT	1 /*10s*/
290 			#define LPS_CHK_PKTS_TX	80000
291 			#define LPS_CHK_PKTS_RX	80000
292 			#define LPS_BCN_CNT_MONITOR
293 		#endif
294 		#define CONFIG_LPS_PWR_TRACKING
295 		#ifdef CONFIG_LPS_PWR_TRACKING
296 		#define THERMAL_DIFF_TH 2
297 		#endif
298 	#endif /*CONFIG_LPS*/
299 
300 	#define CONFIG_CTRL_TXSS_BY_TP
301 	#ifdef CONFIG_CTRL_TXSS_BY_TP
302 		#define TXSS_TP_TH	40 /*Mbps 20M:72.2, 40M:150, 80M:325, 160M:650*/
303 		#define TXSS_TP_CHK_CNT	3 /* unit 2s*/
304 		#define DBG_CTRL_TXSS
305 	#endif
306 
307 	#endif/*CONFIG_POWER_SAVING*/
308 #endif /*CONFIG_PLATFORM_HISILICON_HI3798_MV200_HDMI_DONGLE*/
309 
310 
311 /*
312  * Debug Related Config
313  */
314 #ifdef CONFIG_RTW_DEBUG
315 #define DBG	1	/* for ODM & BTCOEX debug */
316 #else /* !CONFIG_RTW_DEBUG */
317 #define DBG	0	/* for ODM & BTCOEX debug */
318 #endif /* !CONFIG_RTW_DEBUG */
319 
320 #define DBG_CONFIG_ERROR_DETECT
321 #if 0
322 #define DBG_XMIT_BUF
323 #define DBG_XMIT_BUF_EXT
324 #define CONFIG_FW_C2H_DEBUG
325 #define DBG_THREAD_PID
326 #define DBG_CPU_INFO
327 #endif
328 
329 #define DBG_SDIO	1
330 
331 /*#define CONFIG_TDMADIG*/
332 #ifdef CONFIG_TDMADIG
333 #endif/*CONFIG_TDMADIG*/
334 
335