1 /****************************************************************************** 2 * 3 * Copyright(c) 2019 - 2021 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 _PHL_CONFIG_H_ 16 #define _PHL_CONFIG_H_ 17 18 /* Define correspoding PHL Feature based on information from the Core */ 19 #ifdef PHL_PLATFORM_AP 20 #define PHL_FEATURE_AP 21 #elif defined(PHL_PLATFORM_LINUX) || defined(PHL_PLATFORM_WINDOWS) 22 #define PHL_FEATURE_NIC 23 #else 24 #define PHL_FEATURE_NONE 25 #endif 26 27 /******************* PLATFORM Section **************************/ 28 #ifdef PHL_FEATURE_NONE/* enable compile flag for phl only compilation check */ 29 #define CONFIG_DFS 1 30 #define CONFIG_USB_TX_AGGREGATION 31 #define CONFIG_USB_RX_AGGREGATION 32 #define CONFIG_USB_TX_PADDING_CHK 33 #define CONFIG_LOAD_PHY_PARA_FROM_FILE 34 35 #define CONFIG_WOW 36 #define CONFIG_WPA3_SUITEB_SUPPORT 37 #define CONFIG_SYNC_INTERRUPT 38 39 #define CONFIG_MR_SUPPORT 40 #ifdef CONFIG_MR_SUPPORT 41 #define CONFIG_SCC_SUPPORT 42 #define CONFIG_MCC_SUPPORT 43 #ifdef CONFIG_MCC_SUPPORT 44 #define MCC_ROLE_NUM 2 45 #define RTW_WKARD_GO_BT_TS_ADJUST_VIA_NOA 46 #define RTW_WKARD_HALRF_MCC 47 #define RTW_WKARD_TDMRA_AUTO_GET_STAY_ROLE 48 #endif /*CONFIG_MCC_SUPPORT*/ 49 50 #define CONFIG_DBCC_SUPPORT 51 52 #define DBG_PHL_CHAN 53 #define DBG_PHL_MR 54 #define PHL_MR_PROC_CMD 55 #define DBG_CHCTX_RMAP 56 #endif /*CONFIG_MR_SUPPORT*/ 57 58 #define DBG_PHL_MAC_REG_RW 59 60 #define CONFIG_RTW_ACS 61 #define CONFIG_RX_PSTS_PER_PKT 62 63 #define CONFIG_PHL_TXSC 64 #define RTW_PHL_BCN 65 #define CONFIG_PHL_SDIO_RX_NETBUF_ALLOC_IN_PHL 66 #define CONFIG_PHL_TWT 67 #define CONFIG_CMD_DISP 68 #ifdef CONFIG_CMD_DISP 69 #define CONFIG_PHL_ECSA 70 /*#define CONFIG_CMD_DISP_SOLO_MODE*/ 71 #define CONFIG_PHL_CMD_SCAN 72 #define CONFIG_PHL_CMD_SER 73 #define CONFIG_PHL_CMD_BTC 74 #endif 75 #ifdef CONFIG_PCI_HCI 76 #define PCIE_TRX_MIT_EN 77 #endif 78 #define CONFIG_PHL_P2PPS 79 #define CONFIG_6GHZ 80 #define RTW_WKARD_BFEE_SET_AID 81 #define CONFIG_PHL_THERMAL_PROTECT 82 #define CONFIG_PHL_TX_DBG 83 #endif /* PHL_FEATURE_NONE */ 84 85 #ifdef PHL_PLATFORM_WINDOWS 86 #ifndef CONFIG_FSM 87 #define CONFIG_FSM 88 #endif 89 #ifndef CONFIG_CMD_DISP 90 #define CONFIG_CMD_DISP 91 #endif 92 #endif 93 94 #ifdef PHL_PLATFORM_LINUX 95 /* comment out cfg temporarily */ 96 /* 97 #define CONFIG_FSM 98 99 #ifndef CONFIG_FSM 100 #define CONFIG_CMD_DISP 101 #endif 102 */ 103 #endif 104 105 /******************* Feature flags **************************/ 106 107 #ifdef CONFIG_PHL_TEST_SUITE 108 #define CONFIG_PHL_TEST_MP 109 #define CONFIG_PHL_TEST_VERIFY 110 #endif 111 112 #ifdef CONFIG_CORE_SYNC_INTERRUPT 113 #define CONFIG_SYNC_INTERRUPT 114 #endif 115 116 #ifdef CONFIG_WOW 117 #define CONFIG_WOWLAN 118 /* #define RTW_WKARD_WOW_SKIP_AOAC_RPT */ 119 /* #define RTW_WKARD_WOW_SKIP_WOW_CAM_CONFIG */ 120 #define RTW_WKARD_WOW_L2_PWR 121 #define DBG_RST_BDRAM_TIME 122 #endif 123 124 #define DBG_PHY_ON_TIME 125 126 /*CONFIG_IFACE_NUMBER*/ 127 #ifdef CONFIG_IFACE_NUMBER 128 #define MAX_WIFI_ROLE_NUMBER CONFIG_IFACE_NUMBER 129 #else 130 #define MAX_WIFI_ROLE_NUMBER 5 131 #endif 132 133 #ifdef CONFIG_CONCURRENT_MODE 134 #define CONFIG_MR_SUPPORT 135 #endif 136 137 #ifdef CONFIG_REUSED_FWDL_BUF 138 #define CONFIG_PHL_REUSED_FWDL_BUF 139 #endif 140 141 #ifdef CONFIG_MR_SUPPORT 142 #define CONFIG_SCC_SUPPORT 143 #define CONFIG_MCC_SUPPORT 144 #ifdef CONFIG_MCC_SUPPORT 145 #define MCC_ROLE_NUM 2 146 #define RTW_WKARD_GO_BT_TS_ADJUST_VIA_NOA 147 #define RTW_WKARD_HALRF_MCC 148 #define RTW_WKARD_TDMRA_AUTO_GET_STAY_ROLE 149 #endif /*CONFIG_MCC_SUPPORT*/ 150 /*#define CONFIG_DBCC_SUPPORT*/ 151 152 #define DBG_PHL_CHAN 153 #define DBG_PHL_MR 154 #define PHL_MR_PROC_CMD 155 #define DBG_CHCTX_RMAP 156 #endif 157 158 #define DBG_PHL_STAINFO 159 #define PHL_MAX_STA_NUM 128 160 161 /**** CONFIG_CMD_DISP ***/ 162 #ifdef DISABLE_CMD_DISPR 163 #undef CONFIG_CMD_DISP 164 #endif 165 166 #ifdef CONFIG_CMD_DISP 167 /* enable SOLO mode define to create seperated background thread per dispatcher, 168 * otherwise, all dispatcher would share single background thread, which is in share mode. 169 */ 170 /*#define CONFIG_CMD_DISP_SOLO_MODE*/ 171 172 /* Enable Self-Defined Sequence feature for sender to rearrange dispatch order, 173 * Since this is not a mandatory feature and would have addiional memory cost (arround 2200 Bytes) 174 * Disable by default. 175 */ 176 /*#define CONFIG_CMD_DISP_SUPPORT_CUSTOM_SEQ*/ 177 178 #ifndef CONFIG_FSM 179 #define CONFIG_SND_CMD 180 #endif 181 182 #define CONFIG_PHL_CMD_SCAN 183 184 #ifdef CONFIG_CMD_SER 185 #define CONFIG_PHL_CMD_SER 186 #endif 187 188 #define CONFIG_PHL_CMD_BTC 189 190 #ifdef CONFIG_MSG_NUM 191 #define CONFIG_PHL_MSG_NUM CONFIG_MSG_NUM 192 #endif 193 #endif /**** CONFIG_CMD_DISP ***/ 194 195 #define CONFIG_GEN_GIT_INFO 1 196 /*#define CONFIG_NEW_HALMAC_INTERFACE*/ 197 198 #define CONFIG_BTCOEX 199 200 #ifdef CONFIG_USB_TX_PADDING_CHK 201 #define CONFIG_PHL_USB_TX_PADDING_CHK 202 #endif 203 204 #ifdef CONFIG_USB_TX_AGGREGATION 205 #define CONFIG_PHL_USB_TX_AGGREGATION 206 #endif 207 208 #ifdef CONFIG_USB_RX_AGGREGATION 209 #define CONFIG_PHL_USB_RX_AGGREGATION 210 #endif 211 212 #ifdef CONFIG_DFS_MASTER 213 #define CONFIG_PHL_DFS 214 #endif 215 216 #ifdef CONFIG_PHL_DFS 217 /*#define CONFIG_PHL_DFS_REGD_FCC*/ 218 /*#define CONFIG_PHL_DFS_REGD_JAP*/ 219 #define CONFIG_PHL_DFS_REGD_ETSI 220 #endif 221 222 #ifdef CONFIG_WPP 223 #define CONFIG_PHL_WPP 224 #endif 225 226 #ifdef CONFIG_TCP_CSUM_OFFLOAD_RX 227 #define CONFIG_PHL_CSUM_OFFLOAD_RX 228 #endif 229 230 #ifdef CONFIG_RX_PSTS_PER_PKT 231 #define CONFIG_PHL_RX_PSTS_PER_PKT 232 #define RTW_WKARD_DISABLE_PSTS_PER_PKT_DATA 233 #endif 234 235 #ifdef CONFIG_SDIO_RX_NETBUF_ALLOC_IN_PHL 236 #define CONFIG_PHL_SDIO_RX_NETBUF_ALLOC_IN_PHL 237 #endif 238 239 #ifdef CONFIG_SDIO_READ_RXFF_IN_INT 240 #define CONFIG_PHL_SDIO_READ_RXFF_IN_INT 241 #endif 242 243 #ifdef CONFIG_ECSA 244 #define CONFIG_PHL_ECSA 245 #ifdef CONFIG_ECSA_EXTEND_OPTION 246 #define CONFIG_PHL_ECSA_EXTEND_OPTION 247 #endif 248 #endif 249 250 #ifdef CONFIG_TWT 251 #define CONFIG_PHL_TWT 252 #endif 253 254 #ifdef CONFIG_RA_TXSTS_DBG 255 #define CONFIG_PHL_RA_TXSTS_DBG 256 #endif 257 258 #ifdef CONFIG_USB_RELEASE_RPT 259 #define CONFIG_PHL_USB_RELEASE_RPT_ENABLE 260 #endif 261 262 #ifdef CONFIG_PS_FW_DBG 263 #define CONFIG_PHL_PS_FW_DBG 264 #endif 265 266 #ifdef CONFIG_P2PPS 267 #define CONFIG_PHL_P2PPS 268 #endif 269 270 #ifdef CONFIG_TX_DBG 271 #define CONFIG_PHL_TX_DBG 272 #endif 273 #ifdef CONFIG_PCI_HCI 274 #ifdef CONFIG_PCIE_TRX_MIT 275 #define PCIE_TRX_MIT_EN 276 #endif 277 #endif 278 #ifdef CONFIG_THERMAL_PROTECT 279 #define CONFIG_PHL_THERMAL_PROTECT 280 #endif 281 282 #ifdef CONFIG_RX_BATCH_IND 283 #define PHL_RX_BATCH_IND 284 #endif 285 286 #ifdef CONFIG_TDLS 287 #define CONFIG_PHL_TDLS 288 #endif 289 290 #ifdef CONFIG_SDIO_HCI 291 /* For SDIO TX TP TST - START */ 292 #ifdef CONFIG_SDIO_TX_AGG_NUM_MAX 293 #define PHL_SDIO_TX_AGG_MAX CONFIG_SDIO_TX_AGG_NUM_MAX 294 #endif /* CONFIG_SDIO_TX_AGG_NUM_MAX */ 295 #define CONFIG_PHL_SDIO_TX_CB_THREAD 296 /* 297 * RTW_WKARD_SDIO_TX_USE_YIELD 298 * Define this would use yield() instead of event wait mechanism to improve 299 * throughput on Linux platform. 300 * But yield() doesn't been encouraged to use in Linux, 301 * so if we figure out what happened and find another way to improve 302 * throughput, this workaround would be removed later. 303 * 304 * RTW_WKARD_SDIO_TX_USE_YIELD is depended on CONFIG_PHL_SDIO_TX_CB_THREAD, 305 * because the mechanism only been used with CONFIG_PHL_SDIO_TX_CB_THREAD. 306 * 307 * Usually this flag would be defined from core layer. 308 */ 309 /*#define RTW_WKARD_SDIO_TX_USE_YIELD*/ 310 #define SDIO_TX_THREAD /* Use dedicate thread for SDIO TX */ 311 /* For SDIO TX TP TST - ENDT */ 312 313 /* For SDIO RX TP TST - START */ 314 #define CONFIG_PHL_SDIO_RX_CB_THREAD 315 316 #define PHL_DIS_CTRL_FRAME_TO_HOST 317 #ifdef PHL_DIS_CTRL_FRAME_TO_HOST 318 /* Disable ALL CTRL frame report to host */ 319 #define PHL_DIS_CTRL_FRAME_TO_HOST_ALL 0 320 /* Disable ACK + BA + RTS + CTS frame report to host */ 321 #define PHL_DIS_CTRL_FRAME_TO_HOST_POLICY_1 1 322 #define PHL_DIS_CTRL_FRAME_TO_HOST_POLICY PHL_DIS_CTRL_FRAME_TO_HOST_POLICY_1 323 #endif 324 /* For SDIO RX TP TST - END */ 325 326 #endif /* CONFIG_SDIO_HCI */ 327 328 #ifdef CONFIG_MAC_REG_RW_CHK 329 #define DBG_PHL_MAC_REG_RW 330 #endif 331 332 /******************* WKARD flags **************************/ 333 #define RTW_WKARD_P2PPS_REFINE 334 #define RTW_WKARD_P2PPS_SINGLE_NOA 335 #define RTW_WKARD_P2PPS_NOA_MCC 336 337 #ifdef PHL_PLATFORM_LINUX 338 #define RTW_WKARD_RF_CR_DUMP 339 #define RTW_WKARD_LINUX_CMD_WKARD 340 #endif 341 342 #ifdef PHL_PLATFORM_WINDOWS 343 /* Workaround for doing hal reset in changing MP mode will lost the mac entry */ 344 #define RTW_WKARD_MP_MODE_CHANGE 345 #define RTW_WKARD_WIN_TRX_BALANCE 346 #define RTW_WKARD_DYNAMIC_LTR 347 #endif 348 349 #define RTW_WKARD_PHY_CAP 350 351 #define RTW_WKARD_LAMODE 352 353 #define RTW_WKARD_TXSC 354 355 #define RTW_WKARD_BB_C2H 356 357 /* 358 * One workaround of EFUSE operation 359 * 1. Dump EFUSE with FW fail 360 */ 361 #define RTW_WKARD_EFUSE_OPERATION 362 363 #define RTW_WKARD_STA_BCN_INTERVAL 364 365 #define RTW_WKARD_SER_L1_EXPIRE 366 367 #ifdef CONFIG_USB_HCI 368 #define RTW_WKARD_SER_USB_POLLING_EVENT 369 #endif 370 371 /* #define RTW_WKARD_SER_USB_DISABLE_L1_RCVY_FLOW */ 372 373 #define RTW_WKARD_BTC_RFETYPE 374 375 #define RTW_WKARD_TXBD_UPD_LMT /* 8852AE/8852BE txbd index update limitation */ 376 377 #ifdef CONFIG_WPA3_SUITEB_SUPPORT 378 #define RTW_WKARD_HW_MGNT_GCMP_256_DISABLE 379 #endif 380 381 /* Workaround for cmac table config 382 * - Default is disabled until halbb is ready 383 * - This workaround will be removed once fw handles this cfg 384 */ 385 /*#define RTW_WKARD_DEF_CMACTBL_CFG*/ 386 387 /* Workaround for efuse read hidden report 388 * - Default is disabled until halmac is ready 389 */ 390 391 #define RTW_WKARD_PRELOAD_TRX_RESET 392 393 /* Workaround for cmac table config 394 * - This workaround will be removed once fw handles this cfg 395 */ 396 #define RTW_WKARD_DEF_CMACTBL_CFG 397 398 #define RTW_WKARD_USB_TXAGG_BULK_END_WD 399 #ifdef CONFIG_HOMOLOGATION 400 #define CONFIG_PHL_HOMOLOGATION 401 #endif 402 403 #ifdef RTW_WKARD_TX_DISABLE_BFEE 404 #define RTW_WKARD_DYNAMIC_BFEE_CAP 405 #endif 406 407 #ifdef RTW_WKARD_NTFY_MEDIA_STS 408 #define RTW_WKARD_PHL_NTFY_MEDIA_STS 409 #endif 410 411 #ifdef RTW_WKARD_PHY_INFO_NTFY 412 #define CONFIG_PHY_INFO_NTFY 413 #endif 414 415 #ifdef PHL_PLATFORM_WINDOWS 416 #define CONFIG_WOW_WITH_SER 417 #endif 418 419 #ifdef PHL_PLATFORM_WINDOWS 420 #define CONFIG_DBG_H2C_TX 421 #endif 422 423 /* 424 * Workaround for MRC bk module call phl_mr_offch_hdl with scan_issue_null_data 425 * ops, this should be replaced with phl issue null data function. 426 */ 427 #define RTW_WKARD_MRC_ISSUE_NULL_WITH_SCAN_OPS 428 429 /* 430 * Workaround for phl_mr_offch_hdl sleep after issue null data, 431 * - This workaround will be removed once tx report is ready 432 */ 433 #ifndef RTW_WKARD_TX_NULL_WD_RP 434 #define RTW_WKARD_ISSUE_NULL_SLEEP_PROTECTION 435 #endif 436 #ifdef RTW_WKARD_LPS_IQK_TWICE 437 #define RTW_WKARD_PHL_LPS_IQK_TWICE 438 #endif 439 440 #ifdef RTW_WKARD_FSM_SCAN_PASSIVE_TO_ACTIVE 441 #define RTW_WKARD_PHL_FSM_SCAN_PASSIVE_TO_ACTIVE 442 #endif 443 444 #define RTW_WKARD_BUSCAP_IN_HALSPEC 445 446 #define RTW_WKARD_IBSS_SNIFFER_MODE 447 448 449 #define RTW_WKARD_SINGLE_PATH_RSSI 450 451 /* #define CONFIG_6GHZ */ 452 453 454 #define RTW_WKARD_BFEE_DISABLE_NG16 455 456 #define RTW_WKARD_HW_WMM_ALLOCATE 457 458 #ifdef RTW_WKARD_BFEE_AID 459 #define RTW_WKARD_BFEE_SET_AID 460 #endif 461 462 #define RTW_WKARD_AP_CLIENT_ADD_DEL_NTY 463 464 #ifdef CONFIG_SDIO_HCI 465 #define RTW_WKARD_TX_TP /* Improve TX throughput by busy loop */ 466 #endif /* CONFIG_SDIO_HCI */ 467 468 #ifdef RTW_WKARD_DISABLE_2G40M_ULOFDMA 469 #define RTW_WKARD_BB_DISABLE_STA_2G40M_ULOFDMA 470 #endif 471 472 #endif /*_PHL_CONFIG_H_*/ 473