18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* Copyright(c) 2009-2012 Realtek Corporation.*/ 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ci#ifndef __RTL8723E_DEF_H__ 58c2ecf20Sopenharmony_ci#define __RTL8723E_DEF_H__ 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#define HAL_PRIME_CHNL_OFFSET_DONT_CARE 0 88c2ecf20Sopenharmony_ci#define HAL_PRIME_CHNL_OFFSET_LOWER 1 98c2ecf20Sopenharmony_ci#define HAL_PRIME_CHNL_OFFSET_UPPER 2 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#define RX_MPDU_QUEUE 0 128c2ecf20Sopenharmony_ci#define RX_CMD_QUEUE 1 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#define CHIP_BONDING_IDENTIFIER(_value) (((_value)>>22)&0x3) 158c2ecf20Sopenharmony_ci#define CHIP_BONDING_92C_1T2R 0x1 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci#define CHIP_8723 BIT(0) 188c2ecf20Sopenharmony_ci#define NORMAL_CHIP BIT(3) 198c2ecf20Sopenharmony_ci#define RF_TYPE_1T1R (~(BIT(4)|BIT(5)|BIT(6))) 208c2ecf20Sopenharmony_ci#define RF_TYPE_1T2R BIT(4) 218c2ecf20Sopenharmony_ci#define RF_TYPE_2T2R BIT(5) 228c2ecf20Sopenharmony_ci#define CHIP_VENDOR_UMC BIT(7) 238c2ecf20Sopenharmony_ci#define B_CUT_VERSION BIT(12) 248c2ecf20Sopenharmony_ci#define C_CUT_VERSION BIT(13) 258c2ecf20Sopenharmony_ci#define D_CUT_VERSION ((BIT(12)|BIT(13))) 268c2ecf20Sopenharmony_ci#define E_CUT_VERSION BIT(14) 278c2ecf20Sopenharmony_ci#define RF_RL_ID (BIT(31)|BIT(30)|BIT(29)|BIT(28)) 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci/* MASK */ 308c2ecf20Sopenharmony_ci#define IC_TYPE_MASK (BIT(0)|BIT(1)|BIT(2)) 318c2ecf20Sopenharmony_ci#define CHIP_TYPE_MASK BIT(3) 328c2ecf20Sopenharmony_ci#define RF_TYPE_MASK (BIT(4)|BIT(5)|BIT(6)) 338c2ecf20Sopenharmony_ci#define MANUFACTUER_MASK BIT(7) 348c2ecf20Sopenharmony_ci#define ROM_VERSION_MASK (BIT(11)|BIT(10)|BIT(9)|BIT(8)) 358c2ecf20Sopenharmony_ci#define CUT_VERSION_MASK (BIT(15)|BIT(14)|BIT(13)|BIT(12)) 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci/* Get element */ 388c2ecf20Sopenharmony_ci#define GET_CVID_IC_TYPE(version) ((version) & IC_TYPE_MASK) 398c2ecf20Sopenharmony_ci#define GET_CVID_CHIP_TYPE(version) ((version) & CHIP_TYPE_MASK) 408c2ecf20Sopenharmony_ci#define GET_CVID_RF_TYPE(version) ((version) & RF_TYPE_MASK) 418c2ecf20Sopenharmony_ci#define GET_CVID_MANUFACTUER(version) ((version) & MANUFACTUER_MASK) 428c2ecf20Sopenharmony_ci#define GET_CVID_ROM_VERSION(version) ((version) & ROM_VERSION_MASK) 438c2ecf20Sopenharmony_ci#define GET_CVID_CUT_VERSION(version) ((version) & CUT_VERSION_MASK) 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ci#define IS_81XXC(version) ((GET_CVID_IC_TYPE(version) == 0) ?\ 468c2ecf20Sopenharmony_ci true : false) 478c2ecf20Sopenharmony_ci#define IS_8723_SERIES(version) ((GET_CVID_IC_TYPE(version) == CHIP_8723) ? \ 488c2ecf20Sopenharmony_ci true : false) 498c2ecf20Sopenharmony_ci#define IS_1T1R(version) ((GET_CVID_RF_TYPE(version)) ? false : true) 508c2ecf20Sopenharmony_ci#define IS_1T2R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_1T2R)\ 518c2ecf20Sopenharmony_ci ? true : false) 528c2ecf20Sopenharmony_ci#define IS_2T2R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_2T2R)\ 538c2ecf20Sopenharmony_ci ? true : false) 548c2ecf20Sopenharmony_ci#define IS_CHIP_VENDOR_UMC(version) ((GET_CVID_MANUFACTUER(version)) ? \ 558c2ecf20Sopenharmony_ci true : false) 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ci#define IS_VENDOR_UMC_A_CUT(version) ((IS_CHIP_VENDOR_UMC(version))\ 588c2ecf20Sopenharmony_ci ? ((GET_CVID_CUT_VERSION(version)) ? \ 598c2ecf20Sopenharmony_ci false : true) : false) 608c2ecf20Sopenharmony_ci#define IS_VENDOR_8723_A_CUT(version) ((IS_8723_SERIES(version))\ 618c2ecf20Sopenharmony_ci ? ((GET_CVID_CUT_VERSION(version)) ? \ 628c2ecf20Sopenharmony_ci false : true) : false) 638c2ecf20Sopenharmony_ci#define IS_VENDOR_8723A_B_CUT(version) ((IS_8723_SERIES(version))\ 648c2ecf20Sopenharmony_ci ? ((GET_CVID_CUT_VERSION(version) == \ 658c2ecf20Sopenharmony_ci B_CUT_VERSION) ? true : false) : false) 668c2ecf20Sopenharmony_ci#define IS_81XXC_VENDOR_UMC_B_CUT(version) ((IS_CHIP_VENDOR_UMC(version))\ 678c2ecf20Sopenharmony_ci ? ((GET_CVID_CUT_VERSION(version) == \ 688c2ecf20Sopenharmony_ci B_CUT_VERSION) ? true : false) : false) 698c2ecf20Sopenharmony_ci 708c2ecf20Sopenharmony_cienum rf_optype { 718c2ecf20Sopenharmony_ci RF_OP_BY_SW_3WIRE = 0, 728c2ecf20Sopenharmony_ci RF_OP_BY_FW, 738c2ecf20Sopenharmony_ci RF_OP_MAX 748c2ecf20Sopenharmony_ci}; 758c2ecf20Sopenharmony_ci 768c2ecf20Sopenharmony_cienum rf_power_state { 778c2ecf20Sopenharmony_ci RF_ON, 788c2ecf20Sopenharmony_ci RF_OFF, 798c2ecf20Sopenharmony_ci RF_SLEEP, 808c2ecf20Sopenharmony_ci RF_SHUT_DOWN, 818c2ecf20Sopenharmony_ci}; 828c2ecf20Sopenharmony_ci 838c2ecf20Sopenharmony_cienum power_save_mode { 848c2ecf20Sopenharmony_ci POWER_SAVE_MODE_ACTIVE, 858c2ecf20Sopenharmony_ci POWER_SAVE_MODE_SAVE, 868c2ecf20Sopenharmony_ci}; 878c2ecf20Sopenharmony_ci 888c2ecf20Sopenharmony_cienum power_policy_config { 898c2ecf20Sopenharmony_ci POWERCFG_MAX_POWER_SAVINGS, 908c2ecf20Sopenharmony_ci POWERCFG_GLOBAL_POWER_SAVINGS, 918c2ecf20Sopenharmony_ci POWERCFG_LOCAL_POWER_SAVINGS, 928c2ecf20Sopenharmony_ci POWERCFG_LENOVO, 938c2ecf20Sopenharmony_ci}; 948c2ecf20Sopenharmony_ci 958c2ecf20Sopenharmony_cienum interface_select_pci { 968c2ecf20Sopenharmony_ci INTF_SEL1_MINICARD = 0, 978c2ecf20Sopenharmony_ci INTF_SEL0_PCIE = 1, 988c2ecf20Sopenharmony_ci INTF_SEL2_RSV = 2, 998c2ecf20Sopenharmony_ci INTF_SEL3_RSV = 3, 1008c2ecf20Sopenharmony_ci}; 1018c2ecf20Sopenharmony_ci 1028c2ecf20Sopenharmony_cienum rtl_desc_qsel { 1038c2ecf20Sopenharmony_ci QSLT_BK = 0x2, 1048c2ecf20Sopenharmony_ci QSLT_BE = 0x0, 1058c2ecf20Sopenharmony_ci QSLT_VI = 0x5, 1068c2ecf20Sopenharmony_ci QSLT_VO = 0x7, 1078c2ecf20Sopenharmony_ci QSLT_BEACON = 0x10, 1088c2ecf20Sopenharmony_ci QSLT_HIGH = 0x11, 1098c2ecf20Sopenharmony_ci QSLT_MGNT = 0x12, 1108c2ecf20Sopenharmony_ci QSLT_CMD = 0x13, 1118c2ecf20Sopenharmony_ci}; 1128c2ecf20Sopenharmony_ci 1138c2ecf20Sopenharmony_cienum rtl_desc8723e_rate { 1148c2ecf20Sopenharmony_ci DESC92C_RATE1M = 0x00, 1158c2ecf20Sopenharmony_ci DESC92C_RATE2M = 0x01, 1168c2ecf20Sopenharmony_ci DESC92C_RATE5_5M = 0x02, 1178c2ecf20Sopenharmony_ci DESC92C_RATE11M = 0x03, 1188c2ecf20Sopenharmony_ci 1198c2ecf20Sopenharmony_ci DESC92C_RATE6M = 0x04, 1208c2ecf20Sopenharmony_ci DESC92C_RATE9M = 0x05, 1218c2ecf20Sopenharmony_ci DESC92C_RATE12M = 0x06, 1228c2ecf20Sopenharmony_ci DESC92C_RATE18M = 0x07, 1238c2ecf20Sopenharmony_ci DESC92C_RATE24M = 0x08, 1248c2ecf20Sopenharmony_ci DESC92C_RATE36M = 0x09, 1258c2ecf20Sopenharmony_ci DESC92C_RATE48M = 0x0a, 1268c2ecf20Sopenharmony_ci DESC92C_RATE54M = 0x0b, 1278c2ecf20Sopenharmony_ci 1288c2ecf20Sopenharmony_ci DESC92C_RATEMCS0 = 0x0c, 1298c2ecf20Sopenharmony_ci DESC92C_RATEMCS1 = 0x0d, 1308c2ecf20Sopenharmony_ci DESC92C_RATEMCS2 = 0x0e, 1318c2ecf20Sopenharmony_ci DESC92C_RATEMCS3 = 0x0f, 1328c2ecf20Sopenharmony_ci DESC92C_RATEMCS4 = 0x10, 1338c2ecf20Sopenharmony_ci DESC92C_RATEMCS5 = 0x11, 1348c2ecf20Sopenharmony_ci DESC92C_RATEMCS6 = 0x12, 1358c2ecf20Sopenharmony_ci DESC92C_RATEMCS7 = 0x13, 1368c2ecf20Sopenharmony_ci DESC92C_RATEMCS8 = 0x14, 1378c2ecf20Sopenharmony_ci DESC92C_RATEMCS9 = 0x15, 1388c2ecf20Sopenharmony_ci DESC92C_RATEMCS10 = 0x16, 1398c2ecf20Sopenharmony_ci DESC92C_RATEMCS11 = 0x17, 1408c2ecf20Sopenharmony_ci DESC92C_RATEMCS12 = 0x18, 1418c2ecf20Sopenharmony_ci DESC92C_RATEMCS13 = 0x19, 1428c2ecf20Sopenharmony_ci DESC92C_RATEMCS14 = 0x1a, 1438c2ecf20Sopenharmony_ci DESC92C_RATEMCS15 = 0x1b, 1448c2ecf20Sopenharmony_ci DESC92C_RATEMCS15_SG = 0x1c, 1458c2ecf20Sopenharmony_ci DESC92C_RATEMCS32 = 0x20, 1468c2ecf20Sopenharmony_ci}; 1478c2ecf20Sopenharmony_ci 1488c2ecf20Sopenharmony_cistruct phy_sts_cck_8723e_t { 1498c2ecf20Sopenharmony_ci u8 adc_pwdb_X[4]; 1508c2ecf20Sopenharmony_ci u8 sq_rpt; 1518c2ecf20Sopenharmony_ci u8 cck_agc_rpt; 1528c2ecf20Sopenharmony_ci}; 1538c2ecf20Sopenharmony_ci 1548c2ecf20Sopenharmony_cistruct h2c_cmd_8723e { 1558c2ecf20Sopenharmony_ci u8 element_id; 1568c2ecf20Sopenharmony_ci u32 cmd_len; 1578c2ecf20Sopenharmony_ci u8 *p_cmdbuffer; 1588c2ecf20Sopenharmony_ci}; 1598c2ecf20Sopenharmony_ci 1608c2ecf20Sopenharmony_ci#endif 161