162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
262306a36Sopenharmony_ci/* Copyright(c) 2018-2019  Realtek Corporation
362306a36Sopenharmony_ci */
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci#ifndef __RTW8821C_H__
662306a36Sopenharmony_ci#define __RTW8821C_H__
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci#include <asm/byteorder.h>
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci#define RCR_VHT_ACK		BIT(26)
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_cistruct rtw8821cu_efuse {
1362306a36Sopenharmony_ci	u8 res4[4];			/* 0xd0 */
1462306a36Sopenharmony_ci	u8 usb_optional_function;
1562306a36Sopenharmony_ci	u8 res5[0x1e];
1662306a36Sopenharmony_ci	u8 res6[2];
1762306a36Sopenharmony_ci	u8 serial[0x0b];		/* 0xf5 */
1862306a36Sopenharmony_ci	u8 vid;				/* 0x100 */
1962306a36Sopenharmony_ci	u8 res7;
2062306a36Sopenharmony_ci	u8 pid;
2162306a36Sopenharmony_ci	u8 res8[4];
2262306a36Sopenharmony_ci	u8 mac_addr[ETH_ALEN];		/* 0x107 */
2362306a36Sopenharmony_ci	u8 res9[2];
2462306a36Sopenharmony_ci	u8 vendor_name[0x07];
2562306a36Sopenharmony_ci	u8 res10[2];
2662306a36Sopenharmony_ci	u8 device_name[0x14];
2762306a36Sopenharmony_ci	u8 res11[0xcf];
2862306a36Sopenharmony_ci	u8 package_type;		/* 0x1fb */
2962306a36Sopenharmony_ci	u8 res12[0x4];
3062306a36Sopenharmony_ci};
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_cistruct rtw8821ce_efuse {
3362306a36Sopenharmony_ci	u8 mac_addr[ETH_ALEN];		/* 0xd0 */
3462306a36Sopenharmony_ci	u8 vender_id[2];
3562306a36Sopenharmony_ci	u8 device_id[2];
3662306a36Sopenharmony_ci	u8 sub_vender_id[2];
3762306a36Sopenharmony_ci	u8 sub_device_id[2];
3862306a36Sopenharmony_ci	u8 pmc[2];
3962306a36Sopenharmony_ci	u8 exp_device_cap[2];
4062306a36Sopenharmony_ci	u8 msi_cap;
4162306a36Sopenharmony_ci	u8 ltr_cap;			/* 0xe3 */
4262306a36Sopenharmony_ci	u8 exp_link_control[2];
4362306a36Sopenharmony_ci	u8 link_cap[4];
4462306a36Sopenharmony_ci	u8 link_control[2];
4562306a36Sopenharmony_ci	u8 serial_number[8];
4662306a36Sopenharmony_ci	u8 res0:2;			/* 0xf4 */
4762306a36Sopenharmony_ci	u8 ltr_en:1;
4862306a36Sopenharmony_ci	u8 res1:2;
4962306a36Sopenharmony_ci	u8 obff:2;
5062306a36Sopenharmony_ci	u8 res2:3;
5162306a36Sopenharmony_ci	u8 obff_cap:2;
5262306a36Sopenharmony_ci	u8 res3:4;
5362306a36Sopenharmony_ci	u8 res4[3];
5462306a36Sopenharmony_ci	u8 class_code[3];
5562306a36Sopenharmony_ci	u8 pci_pm_L1_2_supp:1;
5662306a36Sopenharmony_ci	u8 pci_pm_L1_1_supp:1;
5762306a36Sopenharmony_ci	u8 aspm_pm_L1_2_supp:1;
5862306a36Sopenharmony_ci	u8 aspm_pm_L1_1_supp:1;
5962306a36Sopenharmony_ci	u8 L1_pm_substates_supp:1;
6062306a36Sopenharmony_ci	u8 res5:3;
6162306a36Sopenharmony_ci	u8 port_common_mode_restore_time;
6262306a36Sopenharmony_ci	u8 port_t_power_on_scale:2;
6362306a36Sopenharmony_ci	u8 res6:1;
6462306a36Sopenharmony_ci	u8 port_t_power_on_value:5;
6562306a36Sopenharmony_ci	u8 res7;
6662306a36Sopenharmony_ci};
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_cistruct rtw8821cs_efuse {
6962306a36Sopenharmony_ci	u8 res4[0x4a];			/* 0xd0 */
7062306a36Sopenharmony_ci	u8 mac_addr[ETH_ALEN];		/* 0x11a */
7162306a36Sopenharmony_ci} __packed;
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_cistruct rtw8821c_efuse {
7462306a36Sopenharmony_ci	__le16 rtl_id;
7562306a36Sopenharmony_ci	u8 res0[0x0e];
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ci	/* power index for four RF paths */
7862306a36Sopenharmony_ci	struct rtw_txpwr_idx txpwr_idx_table[4];
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_ci	u8 channel_plan;		/* 0xb8 */
8162306a36Sopenharmony_ci	u8 xtal_k;
8262306a36Sopenharmony_ci	u8 thermal_meter;
8362306a36Sopenharmony_ci	u8 iqk_lck;
8462306a36Sopenharmony_ci	u8 pa_type;			/* 0xbc */
8562306a36Sopenharmony_ci	u8 lna_type_2g[2];		/* 0xbd */
8662306a36Sopenharmony_ci	u8 lna_type_5g[2];
8762306a36Sopenharmony_ci	u8 rf_board_option;
8862306a36Sopenharmony_ci	u8 rf_feature_option;
8962306a36Sopenharmony_ci	u8 rf_bt_setting;
9062306a36Sopenharmony_ci	u8 eeprom_version;
9162306a36Sopenharmony_ci	u8 eeprom_customer_id;
9262306a36Sopenharmony_ci	u8 tx_bb_swing_setting_2g;
9362306a36Sopenharmony_ci	u8 tx_bb_swing_setting_5g;
9462306a36Sopenharmony_ci	u8 tx_pwr_calibrate_rate;
9562306a36Sopenharmony_ci	u8 rf_antenna_option;		/* 0xc9 */
9662306a36Sopenharmony_ci	u8 rfe_option;
9762306a36Sopenharmony_ci	u8 country_code[2];
9862306a36Sopenharmony_ci	u8 res[3];
9962306a36Sopenharmony_ci	union {
10062306a36Sopenharmony_ci		struct rtw8821ce_efuse e;
10162306a36Sopenharmony_ci		struct rtw8821cu_efuse u;
10262306a36Sopenharmony_ci		struct rtw8821cs_efuse s;
10362306a36Sopenharmony_ci	};
10462306a36Sopenharmony_ci};
10562306a36Sopenharmony_ci
10662306a36Sopenharmony_cistatic inline void
10762306a36Sopenharmony_ci_rtw_write32s_mask(struct rtw_dev *rtwdev, u32 addr, u32 mask, u32 data)
10862306a36Sopenharmony_ci{
10962306a36Sopenharmony_ci	/* 0xC00-0xCFF and 0xE00-0xEFF have the same layout */
11062306a36Sopenharmony_ci	rtw_write32_mask(rtwdev, addr, mask, data);
11162306a36Sopenharmony_ci	rtw_write32_mask(rtwdev, addr + 0x200, mask, data);
11262306a36Sopenharmony_ci}
11362306a36Sopenharmony_ci
11462306a36Sopenharmony_ciextern const struct rtw_chip_info rtw8821c_hw_spec;
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_ci#define rtw_write32s_mask(rtwdev, addr, mask, data)			       \
11762306a36Sopenharmony_ci	do {								       \
11862306a36Sopenharmony_ci		BUILD_BUG_ON((addr) < 0xC00 || (addr) >= 0xD00);	       \
11962306a36Sopenharmony_ci									       \
12062306a36Sopenharmony_ci		_rtw_write32s_mask(rtwdev, addr, mask, data);		       \
12162306a36Sopenharmony_ci	} while (0)
12262306a36Sopenharmony_ci
12362306a36Sopenharmony_ci#define BIT_FEN_PCIEA BIT(6)
12462306a36Sopenharmony_ci#define WLAN_SLOT_TIME		0x09
12562306a36Sopenharmony_ci#define WLAN_PIFS_TIME		0x19
12662306a36Sopenharmony_ci#define WLAN_SIFS_CCK_CONT_TX	0xA
12762306a36Sopenharmony_ci#define WLAN_SIFS_OFDM_CONT_TX	0xE
12862306a36Sopenharmony_ci#define WLAN_SIFS_CCK_TRX	0x10
12962306a36Sopenharmony_ci#define WLAN_SIFS_OFDM_TRX	0x10
13062306a36Sopenharmony_ci#define WLAN_VO_TXOP_LIMIT	0x186
13162306a36Sopenharmony_ci#define WLAN_VI_TXOP_LIMIT	0x3BC
13262306a36Sopenharmony_ci#define WLAN_RDG_NAV		0x05
13362306a36Sopenharmony_ci#define WLAN_TXOP_NAV		0x1B
13462306a36Sopenharmony_ci#define WLAN_CCK_RX_TSF		0x30
13562306a36Sopenharmony_ci#define WLAN_OFDM_RX_TSF	0x30
13662306a36Sopenharmony_ci#define WLAN_TBTT_PROHIBIT	0x04
13762306a36Sopenharmony_ci#define WLAN_TBTT_HOLD_TIME	0x064
13862306a36Sopenharmony_ci#define WLAN_DRV_EARLY_INT	0x04
13962306a36Sopenharmony_ci#define WLAN_BCN_DMA_TIME	0x02
14062306a36Sopenharmony_ci
14162306a36Sopenharmony_ci#define WLAN_RX_FILTER0		0x0FFFFFFF
14262306a36Sopenharmony_ci#define WLAN_RX_FILTER2		0xFFFF
14362306a36Sopenharmony_ci#define WLAN_RCR_CFG		0xE400220E
14462306a36Sopenharmony_ci#define WLAN_RXPKT_MAX_SZ	12288
14562306a36Sopenharmony_ci#define WLAN_RXPKT_MAX_SZ_512	(WLAN_RXPKT_MAX_SZ >> 9)
14662306a36Sopenharmony_ci
14762306a36Sopenharmony_ci#define WLAN_AMPDU_MAX_TIME		0x70
14862306a36Sopenharmony_ci#define WLAN_RTS_LEN_TH			0xFF
14962306a36Sopenharmony_ci#define WLAN_RTS_TX_TIME_TH		0x08
15062306a36Sopenharmony_ci#define WLAN_MAX_AGG_PKT_LIMIT		0x20
15162306a36Sopenharmony_ci#define WLAN_RTS_MAX_AGG_PKT_LIMIT	0x20
15262306a36Sopenharmony_ci#define FAST_EDCA_VO_TH		0x06
15362306a36Sopenharmony_ci#define FAST_EDCA_VI_TH		0x06
15462306a36Sopenharmony_ci#define FAST_EDCA_BE_TH		0x06
15562306a36Sopenharmony_ci#define FAST_EDCA_BK_TH		0x06
15662306a36Sopenharmony_ci#define WLAN_BAR_RETRY_LIMIT		0x01
15762306a36Sopenharmony_ci#define WLAN_RA_TRY_RATE_AGG_LIMIT	0x08
15862306a36Sopenharmony_ci
15962306a36Sopenharmony_ci#define WLAN_TX_FUNC_CFG1		0x30
16062306a36Sopenharmony_ci#define WLAN_TX_FUNC_CFG2		0x30
16162306a36Sopenharmony_ci#define WLAN_MAC_OPT_NORM_FUNC1		0x98
16262306a36Sopenharmony_ci#define WLAN_MAC_OPT_LB_FUNC1		0x80
16362306a36Sopenharmony_ci#define WLAN_MAC_OPT_FUNC2		0xb0810041
16462306a36Sopenharmony_ci
16562306a36Sopenharmony_ci#define WLAN_SIFS_CFG	(WLAN_SIFS_CCK_CONT_TX | \
16662306a36Sopenharmony_ci			(WLAN_SIFS_OFDM_CONT_TX << BIT_SHIFT_SIFS_OFDM_CTX) | \
16762306a36Sopenharmony_ci			(WLAN_SIFS_CCK_TRX << BIT_SHIFT_SIFS_CCK_TRX) | \
16862306a36Sopenharmony_ci			(WLAN_SIFS_OFDM_TRX << BIT_SHIFT_SIFS_OFDM_TRX))
16962306a36Sopenharmony_ci
17062306a36Sopenharmony_ci#define WLAN_TBTT_TIME	(WLAN_TBTT_PROHIBIT |\
17162306a36Sopenharmony_ci			(WLAN_TBTT_HOLD_TIME << BIT_SHIFT_TBTT_HOLD_TIME_AP))
17262306a36Sopenharmony_ci
17362306a36Sopenharmony_ci#define WLAN_NAV_CFG		(WLAN_RDG_NAV | (WLAN_TXOP_NAV << 16))
17462306a36Sopenharmony_ci#define WLAN_RX_TSF_CFG		(WLAN_CCK_RX_TSF | (WLAN_OFDM_RX_TSF) << 8)
17562306a36Sopenharmony_ci#define WLAN_PRE_TXCNT_TIME_TH		0x1E4
17662306a36Sopenharmony_ci
17762306a36Sopenharmony_ci/* phy status page0 */
17862306a36Sopenharmony_ci#define GET_PHY_STAT_P0_PWDB(phy_stat)                                         \
17962306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x00), GENMASK(15, 8))
18062306a36Sopenharmony_ci#define GET_PHY_STAT_P0_VGA(phy_stat)                                          \
18162306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x03), GENMASK(12, 8))
18262306a36Sopenharmony_ci#define GET_PHY_STAT_P0_LNA_L(phy_stat)                                        \
18362306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x03), GENMASK(15, 13))
18462306a36Sopenharmony_ci#define GET_PHY_STAT_P0_LNA_H(phy_stat)                                        \
18562306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x03), BIT(23))
18662306a36Sopenharmony_ci#define BIT_LNA_H_MASK BIT(3)
18762306a36Sopenharmony_ci#define BIT_LNA_L_MASK GENMASK(2, 0)
18862306a36Sopenharmony_ci
18962306a36Sopenharmony_ci/* phy status page1 */
19062306a36Sopenharmony_ci#define GET_PHY_STAT_P1_PWDB_A(phy_stat)                                       \
19162306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x00), GENMASK(15, 8))
19262306a36Sopenharmony_ci#define GET_PHY_STAT_P1_PWDB_B(phy_stat)                                       \
19362306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x00), GENMASK(23, 16))
19462306a36Sopenharmony_ci#define GET_PHY_STAT_P1_RF_MODE(phy_stat)                                      \
19562306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x03), GENMASK(29, 28))
19662306a36Sopenharmony_ci#define GET_PHY_STAT_P1_L_RXSC(phy_stat)                                       \
19762306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x01), GENMASK(11, 8))
19862306a36Sopenharmony_ci#define GET_PHY_STAT_P1_HT_RXSC(phy_stat)                                      \
19962306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x01), GENMASK(15, 12))
20062306a36Sopenharmony_ci#define GET_PHY_STAT_P1_RXEVM_A(phy_stat)                                      \
20162306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x04), GENMASK(7, 0))
20262306a36Sopenharmony_ci#define GET_PHY_STAT_P1_RXEVM_B(phy_stat)                                      \
20362306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x04), GENMASK(15, 8))
20462306a36Sopenharmony_ci#define GET_PHY_STAT_P1_CFO_TAIL_A(phy_stat)                                 \
20562306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x05), GENMASK(7, 0))
20662306a36Sopenharmony_ci#define GET_PHY_STAT_P1_CFO_TAIL_B(phy_stat)                                 \
20762306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x05), GENMASK(15, 8))
20862306a36Sopenharmony_ci#define GET_PHY_STAT_P1_RXSNR_A(phy_stat)                                      \
20962306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x06), GENMASK(7, 0))
21062306a36Sopenharmony_ci#define GET_PHY_STAT_P1_RXSNR_B(phy_stat)                                      \
21162306a36Sopenharmony_ci	le32_get_bits(*((__le32 *)(phy_stat) + 0x06), GENMASK(15, 8))
21262306a36Sopenharmony_ci
21362306a36Sopenharmony_ci#define REG_SYS_CTRL	0x000
21462306a36Sopenharmony_ci#define BIT_FEN_EN	BIT(26)
21562306a36Sopenharmony_ci#define REG_INIRTS_RATE_SEL 0x0480
21662306a36Sopenharmony_ci#define REG_HTSTFWT	0x800
21762306a36Sopenharmony_ci#define REG_RXPSEL	0x808
21862306a36Sopenharmony_ci#define BIT_RX_PSEL_RST		(BIT(28) | BIT(29))
21962306a36Sopenharmony_ci#define REG_TXPSEL	0x80c
22062306a36Sopenharmony_ci#define REG_RXCCAMSK	0x814
22162306a36Sopenharmony_ci#define REG_CCASEL	0x82c
22262306a36Sopenharmony_ci#define REG_PDMFTH	0x830
22362306a36Sopenharmony_ci#define REG_CCA2ND	0x838
22462306a36Sopenharmony_ci#define REG_L1WT	0x83c
22562306a36Sopenharmony_ci#define REG_L1PKWT	0x840
22662306a36Sopenharmony_ci#define REG_MRC		0x850
22762306a36Sopenharmony_ci#define REG_CLKTRK	0x860
22862306a36Sopenharmony_ci#define REG_ADCCLK	0x8ac
22962306a36Sopenharmony_ci#define REG_ADC160	0x8c4
23062306a36Sopenharmony_ci#define REG_ADC40	0x8c8
23162306a36Sopenharmony_ci#define REG_CHFIR	0x8f0
23262306a36Sopenharmony_ci#define REG_CDDTXP	0x93c
23362306a36Sopenharmony_ci#define REG_TXPSEL1	0x940
23462306a36Sopenharmony_ci#define REG_ACBB0	0x948
23562306a36Sopenharmony_ci#define REG_ACBBRXFIR	0x94c
23662306a36Sopenharmony_ci#define REG_ACGG2TBL	0x958
23762306a36Sopenharmony_ci#define REG_FAS		0x9a4
23862306a36Sopenharmony_ci#define REG_RXSB	0xa00
23962306a36Sopenharmony_ci#define REG_ADCINI	0xa04
24062306a36Sopenharmony_ci#define REG_PWRTH	0xa08
24162306a36Sopenharmony_ci#define REG_TXSF2	0xa24
24262306a36Sopenharmony_ci#define REG_TXSF6	0xa28
24362306a36Sopenharmony_ci#define REG_FA_CCK	0xa5c
24462306a36Sopenharmony_ci#define REG_RXDESC	0xa2c
24562306a36Sopenharmony_ci#define REG_ENTXCCK	0xa80
24662306a36Sopenharmony_ci#define BTG_LNA		0xfc84
24762306a36Sopenharmony_ci#define WLG_LNA		0x7532
24862306a36Sopenharmony_ci#define REG_ENRXCCA	0xa84
24962306a36Sopenharmony_ci#define BTG_CCA		0x0e
25062306a36Sopenharmony_ci#define WLG_CCA		0x12
25162306a36Sopenharmony_ci#define REG_PWRTH2	0xaa8
25262306a36Sopenharmony_ci#define REG_CSRATIO	0xaaa
25362306a36Sopenharmony_ci#define REG_TXFILTER	0xaac
25462306a36Sopenharmony_ci#define REG_CNTRST	0xb58
25562306a36Sopenharmony_ci#define REG_AGCTR_A	0xc08
25662306a36Sopenharmony_ci#define REG_TXSCALE_A	0xc1c
25762306a36Sopenharmony_ci#define REG_TXDFIR	0xc20
25862306a36Sopenharmony_ci#define REG_RXIGI_A	0xc50
25962306a36Sopenharmony_ci#define REG_TXAGCIDX	0xc94
26062306a36Sopenharmony_ci#define REG_TRSW	0xca0
26162306a36Sopenharmony_ci#define REG_RFESEL0	0xcb0
26262306a36Sopenharmony_ci#define REG_RFESEL8	0xcb4
26362306a36Sopenharmony_ci#define REG_RFECTL	0xcb8
26462306a36Sopenharmony_ci#define B_BTG_SWITCH	BIT(16)
26562306a36Sopenharmony_ci#define B_CTRL_SWITCH	BIT(18)
26662306a36Sopenharmony_ci#define B_WL_SWITCH	(BIT(20) | BIT(22))
26762306a36Sopenharmony_ci#define B_WLG_SWITCH	BIT(21)
26862306a36Sopenharmony_ci#define B_WLA_SWITCH	BIT(23)
26962306a36Sopenharmony_ci#define REG_RFEINV	0xcbc
27062306a36Sopenharmony_ci#define REG_AGCTR_B	0xe08
27162306a36Sopenharmony_ci#define REG_RXIGI_B	0xe50
27262306a36Sopenharmony_ci#define REG_CRC_CCK	0xf04
27362306a36Sopenharmony_ci#define REG_CRC_OFDM	0xf14
27462306a36Sopenharmony_ci#define REG_CRC_HT	0xf10
27562306a36Sopenharmony_ci#define REG_CRC_VHT	0xf0c
27662306a36Sopenharmony_ci#define REG_CCA_OFDM	0xf08
27762306a36Sopenharmony_ci#define REG_FA_OFDM	0xf48
27862306a36Sopenharmony_ci#define REG_CCA_CCK	0xfcc
27962306a36Sopenharmony_ci#define REG_DMEM_CTRL	0x1080
28062306a36Sopenharmony_ci#define BIT_WL_RST	BIT(16)
28162306a36Sopenharmony_ci#define REG_ANTWT	0x1904
28262306a36Sopenharmony_ci#define REG_IQKFAILMSK	0x1bf0
28362306a36Sopenharmony_ci#define BIT_MASK_R_RFE_SEL_15	GENMASK(31, 28)
28462306a36Sopenharmony_ci#define BIT_SDIO_INT BIT(18)
28562306a36Sopenharmony_ci#define BT_CNT_ENABLE	0x1
28662306a36Sopenharmony_ci#define BIT_BCN_QUEUE	BIT(3)
28762306a36Sopenharmony_ci#define BCN_PRI_EN	0x1
28862306a36Sopenharmony_ci#define PTA_CTRL_PIN	0x66
28962306a36Sopenharmony_ci#define DPDT_CTRL_PIN	0x77
29062306a36Sopenharmony_ci#define ANTDIC_CTRL_PIN	0x88
29162306a36Sopenharmony_ci#define REG_CTRL_TYPE	0x67
29262306a36Sopenharmony_ci#define BIT_CTRL_TYPE1	BIT(5)
29362306a36Sopenharmony_ci#define BIT_CTRL_TYPE2	BIT(4)
29462306a36Sopenharmony_ci#define CTRL_TYPE_MASK	GENMASK(15, 8)
29562306a36Sopenharmony_ci
29662306a36Sopenharmony_ci#define RF18_BAND_MASK		(BIT(16) | BIT(9) | BIT(8))
29762306a36Sopenharmony_ci#define RF18_BAND_2G		(0)
29862306a36Sopenharmony_ci#define RF18_BAND_5G		(BIT(16) | BIT(8))
29962306a36Sopenharmony_ci#define RF18_CHANNEL_MASK	(MASKBYTE0)
30062306a36Sopenharmony_ci#define RF18_RFSI_MASK		(BIT(18) | BIT(17))
30162306a36Sopenharmony_ci#define RF18_RFSI_GE		(BIT(17))
30262306a36Sopenharmony_ci#define RF18_RFSI_GT		(BIT(18))
30362306a36Sopenharmony_ci#define RF18_BW_MASK		(BIT(11) | BIT(10))
30462306a36Sopenharmony_ci#define RF18_BW_20M		(BIT(11) | BIT(10))
30562306a36Sopenharmony_ci#define RF18_BW_40M		(BIT(11))
30662306a36Sopenharmony_ci#define RF18_BW_80M		(BIT(10))
30762306a36Sopenharmony_ci
30862306a36Sopenharmony_ci#endif
309