18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/* Copyright(c) 2009-2012  Realtek Corporation.*/
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci#ifndef __RTL92C_DEF_H__
58c2ecf20Sopenharmony_ci#define __RTL92C_DEF_H__
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci#define	PHY_RSSI_SLID_WIN_MAX				100
88c2ecf20Sopenharmony_ci#define	PHY_LINKQUALITY_SLID_WIN_MAX			20
98c2ecf20Sopenharmony_ci#define	PHY_BEACON_RSSI_SLID_WIN_MAX			10
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#define RX_SMOOTH_FACTOR				20
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#define HAL_PRIME_CHNL_OFFSET_DONT_CARE			0
148c2ecf20Sopenharmony_ci#define HAL_PRIME_CHNL_OFFSET_LOWER			1
158c2ecf20Sopenharmony_ci#define HAL_PRIME_CHNL_OFFSET_UPPER			2
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#define RX_MPDU_QUEUE					0
188c2ecf20Sopenharmony_ci#define RX_CMD_QUEUE					1
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci#define CHIP_VER_B			BIT(4)
218c2ecf20Sopenharmony_ci#define CHIP_BONDING_IDENTIFIER(_value) (((_value) >> 22) & 0x3)
228c2ecf20Sopenharmony_ci#define CHIP_BONDING_92C_1T2R		0x1
238c2ecf20Sopenharmony_ci#define RF_TYPE_1T2R			BIT(1)
248c2ecf20Sopenharmony_ci#define CHIP_92C_BITMASK		BIT(0)
258c2ecf20Sopenharmony_ci#define CHIP_UNKNOWN			BIT(7)
268c2ecf20Sopenharmony_ci#define CHIP_92C_1T2R			0x03
278c2ecf20Sopenharmony_ci#define CHIP_92C			0x01
288c2ecf20Sopenharmony_ci#define CHIP_88C			0x00
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_cienum version_8192c {
318c2ecf20Sopenharmony_ci	VERSION_A_CHIP_92C = 0x01,
328c2ecf20Sopenharmony_ci	VERSION_A_CHIP_88C = 0x00,
338c2ecf20Sopenharmony_ci	VERSION_B_CHIP_92C = 0x11,
348c2ecf20Sopenharmony_ci	VERSION_B_CHIP_88C = 0x10,
358c2ecf20Sopenharmony_ci	VERSION_TEST_CHIP_88C = 0x00,
368c2ecf20Sopenharmony_ci	VERSION_TEST_CHIP_92C = 0x01,
378c2ecf20Sopenharmony_ci	VERSION_NORMAL_TSMC_CHIP_88C = 0x10,
388c2ecf20Sopenharmony_ci	VERSION_NORMAL_TSMC_CHIP_92C = 0x11,
398c2ecf20Sopenharmony_ci	VERSION_NORMAL_TSMC_CHIP_92C_1T2R = 0x13,
408c2ecf20Sopenharmony_ci	VERSION_NORMAL_UMC_CHIP_88C_A_CUT = 0x30,
418c2ecf20Sopenharmony_ci	VERSION_NORMAL_UMC_CHIP_92C_A_CUT = 0x31,
428c2ecf20Sopenharmony_ci	VERSION_NORMAL_UMC_CHIP_92C_1T2R_A_CUT = 0x33,
438c2ecf20Sopenharmony_ci	VERSION_NORMA_UMC_CHIP_8723_1T1R_A_CUT = 0x34,
448c2ecf20Sopenharmony_ci	VERSION_NORMA_UMC_CHIP_8723_1T1R_B_CUT = 0x3c,
458c2ecf20Sopenharmony_ci	VERSION_NORMAL_UMC_CHIP_88C_B_CUT = 0x70,
468c2ecf20Sopenharmony_ci	VERSION_NORMAL_UMC_CHIP_92C_B_CUT = 0x71,
478c2ecf20Sopenharmony_ci	VERSION_NORMAL_UMC_CHIP_92C_1T2R_B_CUT = 0x73,
488c2ecf20Sopenharmony_ci	VERSION_UNKNOWN = 0x88,
498c2ecf20Sopenharmony_ci};
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_cienum rtl819x_loopback_e {
528c2ecf20Sopenharmony_ci	RTL819X_NO_LOOPBACK = 0,
538c2ecf20Sopenharmony_ci	RTL819X_MAC_LOOPBACK = 1,
548c2ecf20Sopenharmony_ci	RTL819X_DMA_LOOPBACK = 2,
558c2ecf20Sopenharmony_ci	RTL819X_CCK_LOOPBACK = 3,
568c2ecf20Sopenharmony_ci};
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_cienum rf_optype {
598c2ecf20Sopenharmony_ci	RF_OP_BY_SW_3WIRE = 0,
608c2ecf20Sopenharmony_ci	RF_OP_BY_FW,
618c2ecf20Sopenharmony_ci	RF_OP_MAX
628c2ecf20Sopenharmony_ci};
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_cienum rf_power_state {
658c2ecf20Sopenharmony_ci	RF_ON,
668c2ecf20Sopenharmony_ci	RF_OFF,
678c2ecf20Sopenharmony_ci	RF_SLEEP,
688c2ecf20Sopenharmony_ci	RF_SHUT_DOWN,
698c2ecf20Sopenharmony_ci};
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_cienum power_save_mode {
728c2ecf20Sopenharmony_ci	POWER_SAVE_MODE_ACTIVE,
738c2ecf20Sopenharmony_ci	POWER_SAVE_MODE_SAVE,
748c2ecf20Sopenharmony_ci};
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_cienum power_polocy_config {
778c2ecf20Sopenharmony_ci	POWERCFG_MAX_POWER_SAVINGS,
788c2ecf20Sopenharmony_ci	POWERCFG_GLOBAL_POWER_SAVINGS,
798c2ecf20Sopenharmony_ci	POWERCFG_LOCAL_POWER_SAVINGS,
808c2ecf20Sopenharmony_ci	POWERCFG_LENOVO,
818c2ecf20Sopenharmony_ci};
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_cienum interface_select_pci {
848c2ecf20Sopenharmony_ci	INTF_SEL1_MINICARD = 0,
858c2ecf20Sopenharmony_ci	INTF_SEL0_PCIE = 1,
868c2ecf20Sopenharmony_ci	INTF_SEL2_RSV = 2,
878c2ecf20Sopenharmony_ci	INTF_SEL3_RSV = 3,
888c2ecf20Sopenharmony_ci};
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_cienum rtl_desc_qsel {
918c2ecf20Sopenharmony_ci	QSLT_BK = 0x2,
928c2ecf20Sopenharmony_ci	QSLT_BE = 0x0,
938c2ecf20Sopenharmony_ci	QSLT_VI = 0x5,
948c2ecf20Sopenharmony_ci	QSLT_VO = 0x7,
958c2ecf20Sopenharmony_ci	QSLT_BEACON = 0x10,
968c2ecf20Sopenharmony_ci	QSLT_HIGH = 0x11,
978c2ecf20Sopenharmony_ci	QSLT_MGNT = 0x12,
988c2ecf20Sopenharmony_ci	QSLT_CMD = 0x13,
998c2ecf20Sopenharmony_ci};
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_cistruct phy_sts_cck_8192s_t {
1028c2ecf20Sopenharmony_ci	u8 adc_pwdb_X[4];
1038c2ecf20Sopenharmony_ci	u8 sq_rpt;
1048c2ecf20Sopenharmony_ci	u8 cck_agc_rpt;
1058c2ecf20Sopenharmony_ci};
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_cistruct h2c_cmd_8192c {
1088c2ecf20Sopenharmony_ci	u8 element_id;
1098c2ecf20Sopenharmony_ci	u32 cmd_len;
1108c2ecf20Sopenharmony_ci	u8 *p_cmdbuffer;
1118c2ecf20Sopenharmony_ci};
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci#endif
114