1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /****************************************************************************** 3 * 4 * Copyright(c) 2016 - 2017 Realtek Corporation. 5 * 6 * This program is free software; you can redistribute it and/or modify it 7 * under the terms of version 2 of the GNU General Public License as 8 * published by the Free Software Foundation. 9 * 10 * This program is distributed in the hope that it will be useful, but WITHOUT 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 * more details. 14 * 15 *****************************************************************************/ 16 /* For debug */ 17 /*#define CONFIG_DISABLE_ODM*/ 18 /*#define CONFIG_NO_FW*/ 19 #define CONFIG_IQK_MONITOR 20 #define DBG_C2H_MAC_HIDDEN_RPT_HANDLE 1 21 #define DBG_H2C_CONTENT 22 23 #ifndef DBG_MEM_ALLOC 24 #define DBG_MEM_ALLOC 25 #endif 26 27 /*#define DBG_XMIT_BLOCK*/ 28 29 /*#define DBG_RX_COUNTER_DUMP*/ 30 #define CONFIG_ERROR_STATE_MONITOR 31 /*#define CONFIG_MONITOR_OVERFLOW*/ 32 33 #define CONFIG_SDIO_INDIRECT_ACCESS 34 #define DBG_SDIO_INDIRECT_ACCESS 35 36 /*#define CONFIG_SUPPORT_TRX_SHARED*/ 37 #ifdef CONFIG_SUPPORT_TRX_SHARED 38 #define DFT_TRX_SHARE_MODE 0 /*default trx share mode,mode could be 0 or 1*/ 39 #endif 40 #define CONFIG_IO_CHECK_IN_ANA_LOW_CLK 41 42 /* 43 * Public General Config 44 */ 45 #define AUTOCONF_INCLUDED 46 47 #define RTL871X_MODULE_NAME "8821CS" 48 #define DRV_NAME "rtl8821cs" 49 50 /* Set CONFIG_RTL8821C from Makefile */ 51 #ifndef CONFIG_RTL8821C 52 #define CONFIG_RTL8821C 53 #endif 54 #define CONFIG_SDIO_HCI 55 #define PLATFORM_LINUX 56 57 58 /* 59 * Wi-Fi Functions Config 60 */ 61 62 #define CONFIG_RECV_REORDERING_CTRL 63 64 #define CONFIG_80211N_HT 65 #define CONFIG_80211AC_VHT 66 #ifdef CONFIG_80211AC_VHT 67 #ifndef CONFIG_80211N_HT 68 #define CONFIG_80211N_HT 69 #endif 70 #endif 71 72 /* Set CONFIG_IOCTL_CFG80211 from Makefile */ 73 #ifdef CONFIG_IOCTL_CFG80211 74 /* 75 * Indecate new sta asoc through cfg80211_new_sta 76 * If kernel version >= 3.2 or 77 * version < 3.2 but already apply cfg80211 patch, 78 * RTW_USE_CFG80211_STA_EVENT must be defiend! 79 */ 80 /* Set RTW_USE_CFG80211_STA_EVENT from Makefile */ 81 #define CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER 82 /* #define CONFIG_DEBUG_CFG80211 */ 83 #define CONFIG_SET_SCAN_DENY_TIMER 84 #endif /* CONFIG_IOCTL_CFG80211 */ 85 86 #ifdef CONFIG_AP_MODE 87 #define CONFIG_INTERRUPT_BASED_TXBCN /* Tx Beacon when driver receive related interrupt*/ 88 #if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_INTERRUPT_BASED_TXBCN) 89 #undef CONFIG_INTERRUPT_BASED_TXBCN 90 #endif 91 #ifdef CONFIG_INTERRUPT_BASED_TXBCN 92 #define CONFIG_INTERRUPT_BASED_TXBCN_EARLY_INT 93 /* #define CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR */ 94 #endif 95 #define CONFIG_NATIVEAP_MLME 96 #ifndef CONFIG_NATIVEAP_MLME 97 #define CONFIG_HOSTAPD_MLME 98 #endif 99 /*#define CONFIG_FIND_BEST_CHANNEL*/ 100 #endif 101 102 #ifdef CONFIG_P2P 103 #define CONFIG_WFD /* Wi-Fi display */ 104 #define CONFIG_P2P_REMOVE_GROUP_INFO 105 /*#define CONFIG_DBG_P2P*/ 106 #define CONFIG_P2P_PS 107 /*#define CONFIG_P2P_IPS*/ 108 #define CONFIG_P2P_OP_CHK_SOCIAL_CH 109 #define CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT /* Replace CONFIG_P2P_CHK_INVITE_CH_LIST flag */ 110 /*#define CONFIG_P2P_INVITE_IOT*/ 111 #endif /* CONFIG_P2P */ 112 113 /* Set CONFIG_TDLS from Makefile */ 114 #ifdef CONFIG_TDLS 115 #define CONFIG_TDLS_DRIVER_SETUP 116 /* #ifndef CONFIG_WFD 117 #define CONFIG_WFD 118 #endif*/ 119 /* #define CONFIG_TDLS_AUTOSETUP*/ 120 #define CONFIG_TDLS_AUTOCHECKALIVE 121 /* 122 * Enable "CONFIG_TDLS_CH_SW" by default, 123 * however limit it to only work in wifi logo test mode 124 * but not in normal mode currently 125 */ 126 #define CONFIG_TDLS_CH_SW 127 #endif /* CONFIG_TDLS */ 128 129 130 /*#define CONFIG_RTW_80211K*/ 131 132 /* 133 * Hareware/Firmware Related Config 134 */ 135 /* Set CONFIG_BT_COEXIST from Makefile */ 136 /* Set CONFIG_ANTENNA_DIVERSITY from Makefile */ 137 /*#define SUPPORT_HW_RFOFF_DETECTED*/ 138 139 /*#define CONFIG_RTW_LED*/ 140 #ifdef CONFIG_RTW_LED 141 /*#define CONFIG_RTW_SW_LED*/ 142 #endif /* CONFIG_RTW_LED */ 143 #define CONFIG_XMIT_ACK 144 #ifdef CONFIG_XMIT_ACK 145 #define CONFIG_ACTIVE_KEEP_ALIVE_CHECK 146 #endif 147 148 #define DISABLE_BB_RF 0 149 #define RTW_NOTCH_FILTER 0 /* 0:Disable, 1:Enable */ 150 151 152 /* 153 * Software feature Related Config 154 */ 155 #define RTW_HALMAC /* Use HALMAC architecture, necessary for 8821C */ 156 157 158 /* 159 * Interface Related Config 160 */ 161 #define CONFIG_TX_AGGREGATION 162 #define CONFIG_XMIT_THREAD_MODE /* necessary for SDIO */ 163 /*#define CONFIG_SDIO_TX_ENABLE_AVAL_INT => Related MAC reg must setting => HAL-MAC ?? */ 164 #define CONFIG_SDIO_RX_COPY 165 166 #define CONFIG_RECV_THREAD_MODE 167 #ifdef CONFIG_RECV_THREAD_MODE 168 #define RTW_RECV_THREAD_HIGH_PRIORITY 169 #endif/*CONFIG_RECV_THREAD_MODE*/ 170 171 #ifdef CONFIG_RTW_NAPI 172 #define CONFIG_RTW_NAPI_DYNAMIC 173 #define CONFIG_RTW_NAPI_V2 174 #endif 175 176 /*#define CONFIG_BEAMFORMING*/ 177 178 #define CONFIG_REDUCE_TX_CPU_LOADING 179 180 /* 181 * Others 182 */ 183 /*#define CONFIG_MAC_LOOPBACK_DRIVER*/ 184 #define CONFIG_SKB_COPY /* for amsdu */ 185 #define CONFIG_NEW_SIGNAL_STAT_PROCESS 186 #define CONFIG_EMBEDDED_FWIMG 187 /*#define CONFIG_FILE_FWIMG*/ 188 #define CONFIG_LONG_DELAY_ISSUE 189 /*#define CONFIG_PATCH_JOIN_WRONG_CHANNEL*/ 190 191 192 /* 193 * Platform 194 */ 195 #ifdef CONFIG_PLATFORM_INTEL_BYT 196 #ifdef CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER 197 #undef CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER 198 #endif 199 #endif /* CONFIG_PLATFORM_INTEL_BYT */ 200 201 202 /* 203 * Auto Config Section 204 */ 205 #ifdef CONFIG_MAC_LOOPBACK_DRIVER 206 #undef CONFIG_IOCTL_CFG80211 207 #undef CONFIG_AP_MODE 208 #undef CONFIG_NATIVEAP_MLME 209 #undef CONFIG_POWER_SAVING 210 #undef CONFIG_BT_COEXIST 211 #undef CONFIG_ANTENNA_DIVERSITY 212 #undef SUPPORT_HW_RFOFF_DETECTED 213 #endif /* CONFIG_MAC_LOOPBACK_DRIVER */ 214 215 #ifdef CONFIG_MP_INCLUDED 216 #define MP_DRIVER 1 217 #define CONFIG_MP_IWPRIV_SUPPORT 218 /* disable unnecessary functions for MP*/ 219 /*#undef CONFIG_POWER_SAVING*/ 220 /*#undef CONFIG_BT_COEXIST*/ 221 /*#undef CONFIG_ANTENNA_DIVERSITY*/ 222 /*#undef SUPPORT_HW_RFOFF_DETECTED*/ 223 #else /* !CONFIG_MP_INCLUDED */ 224 #define MP_DRIVER 0 225 #undef CONFIG_MP_IWPRIV_SUPPORT 226 #endif /* !CONFIG_MP_INCLUDED */ 227 228 #ifdef CONFIG_POWER_SAVING 229 #define CONFIG_IPS 230 #define CONFIG_LPS 231 232 #if defined(CONFIG_LPS) && (defined(CONFIG_GSPI_HCI) || defined(CONFIG_SDIO_HCI)) 233 #define CONFIG_LPS_LCLK 234 #endif 235 236 #ifdef CONFIG_LPS 237 #define CONFIG_CHECK_LEAVE_LPS 238 #define CONFIG_LPS_CHK_BY_TP 239 #ifdef CONFIG_LPS_CHK_BY_TP 240 #define LPS_TX_TP_TH 12 /*Mbps*/ 241 #define LPS_RX_TP_TH 12 /*Mbps*/ 242 #define LPS_BI_TP_TH 12 /*Mbps*//*TX + RX*/ 243 #define LPS_TP_CHK_CNT 5 /*10s*/ 244 #define LPS_CHK_PKTS_TX 100 245 #define LPS_CHK_PKTS_RX 100 246 #endif 247 #endif 248 249 #ifdef CONFIG_LPS_LCLK 250 /*#define CONFIG_DETECT_CPWM_BY_POLLING*/ 251 #define CONFIG_LPS_RPWM_TIMER 252 #if defined(CONFIG_LPS_RPWM_TIMER) || defined(CONFIG_DETECT_CPWM_BY_POLLING) 253 #define LPS_RPWM_WAIT_MS 300 254 #endif 255 #define CONFIG_LPS_LCLK_WD_TIMER /* Watch Dog timer in LPS LCLK */ 256 /*#define CONFIG_LPS_PG*/ 257 #endif 258 259 #ifdef CONFIG_IPS 260 #define CONFIG_IPS_CHECK_IN_WD /* Do IPS Check in WatchDog. */ 261 /*#define CONFIG_FWLPS_IN_IPS*/ /* issue H2C command to let FW do LPS when entering IPS */ 262 #endif 263 264 #ifdef CONFIG_LPS 265 #define CONFIG_WMMPS_STA 1 266 #endif /* CONFIG_LPS */ 267 #endif /* CONFIG_POWER_SAVING */ 268 269 #ifdef CONFIG_BT_COEXIST 270 /* necessary for PHYDM and BT-Coex */ 271 #define BT_30_SUPPORT 1 272 273 #ifndef CONFIG_LPS 274 #define CONFIG_LPS /* download reserved page to FW */ 275 #endif 276 #else /* !CONFIG_BT_COEXIST */ 277 #define BT_30_SUPPORT 0 278 #endif /* !CONFIG_BT_COEXIST */ 279 280 #ifdef CONFIG_WOWLAN 281 #define CONFIG_GTK_OL 282 /* #define CONFIG_ARP_KEEP_ALIVE */ 283 #endif /* CONFIG_WOWLAN */ 284 285 #ifdef CONFIG_GPIO_WAKEUP 286 #ifndef WAKEUP_GPIO_IDX 287 #define WAKEUP_GPIO_IDX 10 /* WIFI Chip Side */ 288 #endif /*!WAKEUP_GPIO_IDX*/ 289 #endif /* CONFIG_GPIO_WAKEUP */ 290 291 #ifdef CONFIG_ANTENNA_DIVERSITY 292 #define CONFIG_HW_ANTENNA_DIVERSITY 293 #endif /* CONFIG_ANTENNA_DIVERSITY */ 294 295 #ifdef CONFIG_PLATFORM_RTK129X 296 #ifdef CONFIG_REDUCE_TX_CPU_LOADING 297 #undef CONFIG_REDUCE_TX_CPU_LOADING 298 #endif 299 #endif 300 301 /* 302 * Debug Related Config 303 */ 304 #ifdef CONFIG_RTW_DEBUG 305 #define DBG 1 /* for ODM & BTCOEX debug */ 306 #else /* !CONFIG_RTW_DEBUG */ 307 #define DBG 0 /* for ODM & BTCOEX debug */ 308 #endif /* CONFIG_RTW_DEBUG */ 309 310 #define DBG_CONFIG_ERROR_DETECT 311 /*#define DBG_XMIT_BUF*/ 312 /*#define DBG_XMIT_BUF_EXT*/ 313 /*#define CONFIG_FW_C2H_DEBUG*/ 314