xref: /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8852bs/include/autoconf.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /******************************************************************************
2  *
3  * Copyright(c) 2019 - 2022 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 _AUTOCONF_H_
16 #define _AUTOCONF_H_
17 
18 /***** temporarily flag *******/
19 /*#define CONFIG_NO_FW*/
20 /*#define CONFIG_DISABLE_ODM*/
21 
22 /*
23  * Debug Related Config
24  */
25 #ifdef CONFIG_RTW_DEBUG
26 	#define DBG	1	/* for ODM & BTC debug */
27 #else /* !CONFIG_RTW_DEBUG */
28 	#define DBG	0	/* for ODM & BTC debug */
29 #endif /* CONFIG_RTW_DEBUG */
30 
31 
32 /*#define DBG_CONFIG_ERROR_DETECT*/
33 /*#define DBG_XMIT_BUF*/
34 /*#define DBG_XMIT_BUF_EXT*/
35 /*#define CONFIG_FW_C2H_DEBUG*/
36 
37 /* debug memory management */
38 #if 0
39 	#define DBG_MEM_ALLOC
40 	#define DBG_PHL_MEM_ALLOC
41 	#define DBG_HAL_MAC_MEM_MOINTOR
42 	#define DBG_HAL_MEM_MOINTOR
43 #endif
44 /*#define CONFIG_PHL_USE_KMEM_ALLOC*/
45 
46 /* debug TX/RX */
47 /*#define DBG_XMIT_BLOCK*/
48 /*#define DBG_RX_COUNTER_DUMP*/
49 
50 /*#define DBG_C2H_MAC_HIDDEN_RPT_HANDLE	1*/
51 /*#define DBG_H2C_CONTENT*/
52 
53 #define CONFIG_ERROR_STATE_MONITOR
54 /*#define CONFIG_MONITOR_OVERFLOW*/
55 
56 /*#define CONFIG_SDIO_INDIRECT_ACCESS*/
57 /*#define DBG_SDIO_INDIRECT_ACCESS*/
58 
59 
60 /*
61  * Work around Config
62  */
63 #define RTW_WKARD_DIS_PROBE_REQ_RPT_TO_HOSTAPD
64 
65 #define RTW_WKARD_CORE_RSSI_V1
66 #ifdef RTW_WKARD_CORE_RSSI_V1
67 #define CONFIG_RX_PSTS_PER_PKT
68 #define CONFIG_SIGNAL_STAT_PROCESS
69 /*#define DBG_RX_SIGNAL_DISPLAY_PROCESSING*/
70 #endif
71 
72 /*
73  * Public General Config
74  */
75 #define AUTOCONF_INCLUDED
76 #define DRV_NAME "rtl8852bs"
77 
78 #define CONFIG_SDIO_HCI
79 
80 
81 /*
82  * Wi-Fi Functions Config
83  */
84 
85 /*#define CONFIG_RECV_REORDERING_CTRL*/
86 
87 #define CONFIG_80211N_HT
88 #define CONFIG_80211AC_VHT
89 #define CONFIG_80211AX_HE
90 #ifdef CONFIG_80211AC_VHT
91 	#ifndef CONFIG_80211N_HT
92 		#define CONFIG_80211N_HT
93 	#endif
94 #endif
95 #ifdef CONFIG_80211AX_HE
96 	#ifndef CONFIG_80211N_HT
97 		#define CONFIG_80211N_HT
98 	#endif
99 	#ifndef CONFIG_80211AC_VHT
100 		#define CONFIG_80211AC_VHT
101 	#endif
102 #endif
103 
104 #define CONFIG_TX_AMSDU
105 #ifdef CONFIG_TX_AMSDU
106 	#define CONFIG_TX_AMSDU_SW_MODE
107 #endif
108 
109 #define CONFIG_BEAMFORMING
110 #ifdef CONFIG_BEAMFORMING
111 /*#define RTW_WKARD_TX_DISABLE_BFEE*/
112 #endif
113 
114 /* Set CONFIG_IOCTL_CFG80211 from Makefile */
115 #ifdef CONFIG_IOCTL_CFG80211
116 	/*
117 	 * Indecate new sta asoc through cfg80211_new_sta
118 	 * If kernel version >= 3.2 or
119 	 * version < 3.2 but already apply cfg80211 patch,
120 	 * RTW_USE_CFG80211_STA_EVENT must be defiend!
121 	 */
122 	/* Set RTW_USE_CFG80211_STA_EVENT from Makefile */
123 	#define CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER
124 	/* #define CONFIG_DEBUG_CFG80211 */
125 	#define CONFIG_SET_SCAN_DENY_TIMER
126 #endif /* CONFIG_IOCTL_CFG80211 */
127 
128 #define CONFIG_AP_MODE
129 #ifdef CONFIG_AP_MODE
130 	#define CONFIG_NATIVEAP_MLME
131 	#ifndef CONFIG_NATIVEAP_MLME
132 		#define CONFIG_HOSTAPD_MLME
133 	#endif
134 	/*#define CONFIG_FIND_BEST_CHANNEL*/
135 #endif
136 
137 
138 #define CONFIG_P2P
139 
140 #ifdef CONFIG_P2P
141 	#define CONFIG_WFD	/* Wi-Fi display */
142 	#define CONFIG_P2P_REMOVE_GROUP_INFO
143 	/*#define CONFIG_DBG_P2P*/
144 	#define CONFIG_P2P_PS
145 	/*#define CONFIG_P2P_IPS*/
146 	#define CONFIG_P2P_OP_CHK_SOCIAL_CH
147 	#define CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT  /* Replace CONFIG_P2P_CHK_INVITE_CH_LIST flag */
148 	/*#define CONFIG_P2P_INVITE_IOT*/
149 #endif /* CONFIG_P2P */
150 
151 /* Set CONFIG_TDLS from Makefile */
152 #ifdef CONFIG_TDLS
153 	#define CONFIG_TDLS_DRIVER_SETUP
154 /*	#ifndef CONFIG_WFD
155 		#define CONFIG_WFD
156 	#endif*/
157 /*	#define CONFIG_TDLS_AUTOSETUP*/
158 	#define CONFIG_TDLS_AUTOCHECKALIVE
159 	/*
160 	 * Enable "CONFIG_TDLS_CH_SW" by default,
161 	 * however limit it to only work in wifi logo test mode
162 	 * but not in normal mode currently
163 	 */
164 	#define CONFIG_TDLS_CH_SW
165 #endif /* CONFIG_TDLS */
166 
167 
168 /*#define CONFIG_RTW_80211K*/
169 
170 
171 #define CONFIG_HW_RTS
172 
173 /*
174  * Hareware/Firmware Related Config
175  */
176 /* Set CONFIG_ANTENNA_DIVERSITY from Makefile */
177 
178 /*#define CONFIG_RTW_LED*/
179 #ifdef CONFIG_RTW_LED
180 	/*#define CONFIG_RTW_SW_LED*/
181 #endif /* CONFIG_RTW_LED */
182 /*#define CONFIG_XMIT_ACK*/
183 #ifdef CONFIG_XMIT_ACK
184 	#define CONFIG_ACTIVE_KEEP_ALIVE_CHECK
185 #endif
186 
187 #define DISABLE_BB_RF		0
188 
189 #define CONFIG_TCP_CSUM_OFFLOAD_RX
190 
191 /*
192  * Software feature Related Config
193  */
194 
195 /*
196  * Interface Related Config
197  */
198 #define CONFIG_TX_AGGREGATION
199 #define CONFIG_XMIT_THREAD_MODE	/* necessary for SDIO */
200 /*#define RTW_XMIT_THREAD_HIGH_PRIORITY*/
201 /*#define RTW_XMIT_THREAD_CB_HIGH_PRIORITY*/
202 /*#define CONFIG_SDIO_TX_ENABLE_AVAL_INT => Related MAC reg must setting => HAL-MAC ?? */
203 #define CONFIG_SDIO_RX_COPY
204 
205 #define CONFIG_SDIO_RX_NETBUF_ALLOC_IN_PHL
206 #define CONFIG_SDIO_READ_RXFF_IN_INT
207 
208 /*#define RTW_RECV_THREAD_HIGH_PRIORITY*/
209 
210 
211 #ifdef CONFIG_RTW_NAPI
212 #define CONFIG_RTW_NAPI_DYNAMIC
213 #define CONFIG_RTW_NAPI_V2
214 #ifdef CONFIG_RTW_NAPI_V2
215 #define CONFIG_RX_BATCH_IND
216 #endif
217 #endif
218 
219 #define CONFIG_REDUCE_TX_CPU_LOADING
220 
221 #define MAX_XMITBUF_SZ	26*1024	/* 26 KB */
222 #define MAX_RECVBUF_SZ	68608	/* 67*1024 KB*/
223 #define MAX_PHL_TX_RING_ENTRY_NUM 512
224 #define MAX_PHL_RX_RING_ENTRY_NUM 536
225 #define CONFIG_RTW_REDUCE_MEM
226 #define CONFIG_SCAN_BACKOP_STA
227 /*
228  * Others
229  */
230 /*#define CONFIG_MAC_LOOPBACK_DRIVER*/
231 #define CONFIG_SKB_COPY		/* for amsdu */
232 #define CONFIG_EMBEDDED_FWIMG
233 /*#define CONFIG_FILE_FWIMG*/
234 #define CONFIG_LONG_DELAY_ISSUE
235 /*#define CONFIG_PATCH_JOIN_WRONG_CHANNEL*/
236 
237 
238 /*
239  * Platform
240  */
241 
242 
243 /*
244  * Auto Config Section
245  */
246 #ifdef CONFIG_MAC_LOOPBACK_DRIVER
247 #undef CONFIG_IOCTL_CFG80211
248 #undef CONFIG_AP_MODE
249 #undef CONFIG_NATIVEAP_MLME
250 #undef CONFIG_POWER_SAVING
251 #undef CONFIG_ANTENNA_DIVERSITY
252 #endif /* CONFIG_MAC_LOOPBACK_DRIVER */
253 
254 #ifdef CONFIG_MP_INCLUDED
255 	#define MP_DRIVER	1
256 	/* disable unnecessary functions for MP*/
257 	/*#undef CONFIG_POWER_SAVING*/
258 	/*#undef CONFIG_ANTENNA_DIVERSITY*/
259 #else /* !CONFIG_MP_INCLUDED */
260 	#define MP_DRIVER	0
261 #endif /* !CONFIG_MP_INCLUDED */
262 
263 #ifdef CONFIG_POWER_SAVING
264 	#define CONFIG_IPS
265 	#define CONFIG_LPS
266 
267 	#if defined(CONFIG_LPS) && (defined(CONFIG_GSPI_HCI) || defined(CONFIG_SDIO_HCI))
268 	#define CONFIG_LPS_LCLK
269 	#endif
270 
271 	#ifdef CONFIG_LPS
272 		/*#define CONFIG_CHECK_LEAVE_LPS*/
273 		/*#define CONFIG_LPS_CHK_BY_TP*/
274 		#ifdef CONFIG_LPS_CHK_BY_TP
275 			#define LPS_TX_TP_TH		12 /*Mbps*/
276 			#define LPS_RX_TP_TH	12 /*Mbps*/
277 			#define LPS_BI_TP_TH		12 /*Mbps*//*TX + RX*/
278 			#define LPS_TP_CHK_CNT	5 /*10s*/
279 			#define LPS_CHK_PKTS_TX 100
280 			#define LPS_CHK_PKTS_RX 100
281 		#endif
282 	#endif
283 
284 	#ifdef CONFIG_LPS_LCLK
285 	/*#define CONFIG_DETECT_CPWM_BY_POLLING*/
286 	#define CONFIG_LPS_RPWM_TIMER
287 	#if defined(CONFIG_LPS_RPWM_TIMER) || defined(CONFIG_DETECT_CPWM_BY_POLLING)
288 	#define LPS_RPWM_WAIT_MS 300
289 	#endif
290 	#define CONFIG_LPS_LCLK_WD_TIMER /* Watch Dog timer in LPS LCLK */
291 	/*#define CONFIG_LPS_PG*/
292 	#endif
293 
294 	#ifdef CONFIG_IPS
295 	#define CONFIG_IPS_CHECK_IN_WD /* Do IPS Check in WatchDog. */
296 	/*#define CONFIG_FWLPS_IN_IPS*/ /* issue H2C command to let FW do LPS when entering IPS */
297 	#endif
298 
299 	#ifdef CONFIG_LPS
300 		/*#define CONFIG_WMMPS_STA*/
301 	#endif /* CONFIG_LPS */
302 #endif /* CONFIG_POWER_SAVING */
303 
304 #ifdef CONFIG_POWER_SAVE
305 	/* #define CONFIG_RTW_IPS */
306 	/* #define CONFIG_RTW_LPS */
307 
308 	#if defined(CONFIG_RTW_IPS) || defined(CONFIG_RTW_LPS)
309 		#define CONFIG_PS_FW_DBG
310 	#endif
311 #endif
312 
313 #ifdef CONFIG_WOWLAN
314 	#define CONFIG_GTK_OL
315 	/* #define CONFIG_ARP_KEEP_ALIVE */
316 #endif /* CONFIG_WOWLAN */
317 
318 #ifdef CONFIG_GPIO_WAKEUP
319 	#ifndef WAKEUP_GPIO_IDX
320 		#define WAKEUP_GPIO_IDX	10	/* WIFI Chip Side */
321 	#endif /*!WAKEUP_GPIO_IDX*/
322 #endif /* CONFIG_GPIO_WAKEUP */
323 
324 #ifdef CONFIG_ANTENNA_DIVERSITY
325 #define CONFIG_HW_ANTENNA_DIVERSITY
326 #endif /* CONFIG_ANTENNA_DIVERSITY */
327 
328 #ifdef RTK_129X_PLATFORM
329 	#ifdef CONFIG_REDUCE_TX_CPU_LOADING
330 	#undef CONFIG_REDUCE_TX_CPU_LOADING
331 	#endif
332 #endif
333 
334 #define CONFIG_MSG_NUM 100
335 #define SCAN_PER_CH_EX_TIME 350
336 
337 #endif /* _AUTOCONF_H_ */
338 
339