Path: blob/master/drivers/net/wireless/realtek/rtw88/rtw8703b.h
25924 views
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */1/* Copyright Fiona Klute <[email protected]> */23#ifndef __RTW8703B_H__4#define __RTW8703B_H__56#include "rtw8723x.h"78extern const struct rtw_chip_info rtw8703b_hw_spec;910/* phy status parsing */11#define VGA_BITS GENMASK(4, 0)12#define LNA_L_BITS GENMASK(7, 5)13#define LNA_H_BIT BIT(7)14/* masks for assembling LNA index from high and low bits */15#define BIT_LNA_H_MASK BIT(3)16#define BIT_LNA_L_MASK GENMASK(2, 0)1718struct phy_rx_agc_info {19#ifdef __LITTLE_ENDIAN20u8 gain: 7;21u8 trsw: 1;22#else23u8 trsw: 1;24u8 gain: 7;25#endif26} __packed;2728/* This struct is called phy_status_rpt_8192cd in the vendor driver,29* there might be potential to share it with drivers for other chips30* of the same generation.31*/32struct phy_status_8703b {33struct phy_rx_agc_info path_agc[2];34u8 ch_corr[2];35u8 cck_sig_qual_ofdm_pwdb_all;36/* for CCK: bits 0:4: VGA index, bits 5:7: LNA index (low) */37u8 cck_agc_rpt_ofdm_cfosho_a;38/* for CCK: bit 7 is high bit of LNA index if long report type */39u8 cck_rpt_b_ofdm_cfosho_b;40u8 reserved_1;41u8 noise_power_db_msb;42s8 path_cfotail[2];43u8 pcts_mask[2];44s8 stream_rxevm[2];45u8 path_rxsnr[2];46u8 noise_power_db_lsb;47u8 reserved_2[3];48u8 stream_csi[2];49u8 stream_target_csi[2];50s8 sig_evm;51u8 reserved_3;5253#ifdef __LITTLE_ENDIAN54u8 antsel_rx_keep_2: 1;55u8 sgi_en: 1;56u8 rxsc: 2;57u8 idle_long: 1;58u8 r_ant_train_en: 1;59u8 ant_sel_b: 1;60u8 ant_sel: 1;61#else /* __BIG_ENDIAN */62u8 ant_sel: 1;63u8 ant_sel_b: 1;64u8 r_ant_train_en: 1;65u8 idle_long: 1;66u8 rxsc: 2;67u8 sgi_en: 1;68u8 antsel_rx_keep_2: 1;69#endif70} __packed;7172/* Baseband registers */73#define REG_BB_PWR_SAV5_11N 0x081874/* BIT(11) should be 1 for 8703B *and* 8723D, which means LNA uses 475* bit for CCK rates in report, not 3. Vendor driver logs a warning if76* it's 0, but handles the case.77*78* Purpose of other parts of this register is unknown, 8723cs driver79* code indicates some other chips use certain bits for antenna80* diversity.81*/82#define REG_BB_AMP 0x095083#define BIT_MASK_RX_LNA (BIT(11))8485/* 0xaXX: 40MHz channel settings */86#define REG_CCK_TXSF2 0x0a24 /* CCK TX filter 2 */87#define REG_CCK_DBG 0x0a28 /* debug port */88#define REG_OFDM0_A_TX_AFE 0x0c8489#define REG_TXIQK_MATRIXB_LSB2_11N 0x0c9c90#define REG_OFDM0_TX_PSD_NOISE 0x0ce4 /* TX pseudo noise weighting */91#define REG_IQK_RDY 0x0e90 /* is != 0 when IQK is done */9293/* RF registers */94#define RF_RCK1 0x1E9596#define AGG_BURST_NUM 397#define AGG_BURST_SIZE 0 /* 1K */98#define BIT_MASK_AGG_BURST_NUM (GENMASK(3, 2))99#define BIT_MASK_AGG_BURST_SIZE (GENMASK(5, 4))100101#endif /* __RTW8703B_H__ */102103104