linux/drivers/net/wireless/broadcom/b43/tables_nphy.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef B43_TABLES_NPHY_H_
#define B43_TABLES_NPHY_H_

#include <linux/types.h>

struct b43_phy_n_sfo_cfg {};

struct b43_wldev;

struct nphy_txiqcal_ladder {};

struct nphy_rf_control_override_rev2 {};

struct nphy_rf_control_override_rev3 {};

struct nphy_rf_control_override_rev7 {};

struct nphy_gain_ctl_workaround_entry {};

/* Get entry with workaround values for gain ctl. Does not return NULL. */
struct nphy_gain_ctl_workaround_entry *b43_nphy_get_gain_ctl_workaround_ent(
	struct b43_wldev *dev, bool ghz5, bool ext_lna);


/* The N-PHY tables. */
#define B43_NTAB_TYPEMASK
#define B43_NTAB_8BIT
#define B43_NTAB_16BIT
#define B43_NTAB_32BIT
#define B43_NTAB8(table, offset)
#define B43_NTAB16(table, offset)
#define B43_NTAB32(table, offset)

/* Static N-PHY tables */
#define B43_NTAB_FRAMESTRUCT
#define B43_NTAB_FRAMESTRUCT_SIZE
#define B43_NTAB_FRAMELT
#define B43_NTAB_FRAMELT_SIZE
#define B43_NTAB_TMAP
#define B43_NTAB_TMAP_SIZE
#define B43_NTAB_TDTRN
#define B43_NTAB_TDTRN_SIZE
#define B43_NTAB_INTLEVEL
#define B43_NTAB_INTLEVEL_SIZE
#define B43_NTAB_PILOT
#define B43_NTAB_PILOT_SIZE
#define B43_NTAB_PILOTLT
#define B43_NTAB_PILOTLT_SIZE
#define B43_NTAB_TDI20A0
#define B43_NTAB_TDI20A0_SIZE
#define B43_NTAB_TDI20A1
#define B43_NTAB_TDI20A1_SIZE
#define B43_NTAB_TDI40A0
#define B43_NTAB_TDI40A0_SIZE
#define B43_NTAB_TDI40A1
#define B43_NTAB_TDI40A1_SIZE
#define B43_NTAB_BDI
#define B43_NTAB_BDI_SIZE
#define B43_NTAB_CHANEST
#define B43_NTAB_CHANEST_SIZE
#define B43_NTAB_MCS
#define B43_NTAB_MCS_SIZE

/* Volatile N-PHY tables */
#define B43_NTAB_NOISEVAR10
#define B43_NTAB_NOISEVAR10_SIZE
#define B43_NTAB_NOISEVAR11
#define B43_NTAB_NOISEVAR11_SIZE
#define B43_NTAB_C0_ESTPLT
#define B43_NTAB_C0_ESTPLT_SIZE
#define B43_NTAB_C0_ADJPLT
#define B43_NTAB_C0_ADJPLT_SIZE
#define B43_NTAB_C0_GAINCTL
#define B43_NTAB_C0_GAINCTL_SIZE
#define B43_NTAB_C0_IQLT
#define B43_NTAB_C0_IQLT_SIZE
#define B43_NTAB_C0_LOFEEDTH
#define B43_NTAB_C0_LOFEEDTH_SIZE
#define B43_NTAB_C1_ESTPLT
#define B43_NTAB_C1_ESTPLT_SIZE
#define B43_NTAB_C1_ADJPLT
#define B43_NTAB_C1_ADJPLT_SIZE
#define B43_NTAB_C1_GAINCTL
#define B43_NTAB_C1_GAINCTL_SIZE
#define B43_NTAB_C1_IQLT
#define B43_NTAB_C1_IQLT_SIZE
#define B43_NTAB_C1_LOFEEDTH
#define B43_NTAB_C1_LOFEEDTH_SIZE

/* Volatile N-PHY tables, PHY revision >= 3 */
#define B43_NTAB_ANT_SW_CTL_R3

/* Static N-PHY tables, PHY revision >= 3 */
#define B43_NTAB_FRAMESTRUCT_R3
#define B43_NTAB_PILOT_R3
#define B43_NTAB_TMAP_R3
#define B43_NTAB_INTLEVEL_R3
#define B43_NTAB_TDTRN_R3
#define B43_NTAB_NOISEVAR_R3
#define B43_NTAB_MCS_R3
#define B43_NTAB_TDI20A0_R3
#define B43_NTAB_TDI20A1_R3
#define B43_NTAB_TDI40A0_R3
#define B43_NTAB_TDI40A1_R3
#define B43_NTAB_PILOTLT_R3
#define B43_NTAB_CHANEST_R3
#define B43_NTAB_FRAMELT_R3
#define B43_NTAB_C0_ESTPLT_R3
#define B43_NTAB_C0_ADJPLT_R3
#define B43_NTAB_C0_GAINCTL_R3
#define B43_NTAB_C0_IQLT_R3
#define B43_NTAB_C0_LOFEEDTH_R3
#define B43_NTAB_C0_PAPD_COMP_R3
#define B43_NTAB_C1_ESTPLT_R3
#define B43_NTAB_C1_ADJPLT_R3
#define B43_NTAB_C1_GAINCTL_R3
#define B43_NTAB_C1_IQLT_R3
#define B43_NTAB_C1_LOFEEDTH_R3
#define B43_NTAB_C1_PAPD_COMP_R3

/* Static N-PHY tables, PHY revision >= 7 */
#define B43_NTAB_TMAP_R7
#define B43_NTAB_NOISEVAR_R7

#define B43_NTAB_TX_IQLO_CAL_LOFT_LADDER_40_SIZE
#define B43_NTAB_TX_IQLO_CAL_LOFT_LADDER_20_SIZE
#define B43_NTAB_TX_IQLO_CAL_IQIMB_LADDER_40_SIZE
#define B43_NTAB_TX_IQLO_CAL_IQIMB_LADDER_20_SIZE
#define B43_NTAB_TX_IQLO_CAL_STARTCOEFS_REV3
#define B43_NTAB_TX_IQLO_CAL_STARTCOEFS
#define B43_NTAB_TX_IQLO_CAL_CMDS_RECAL_REV3
#define B43_NTAB_TX_IQLO_CAL_CMDS_RECAL
#define B43_NTAB_TX_IQLO_CAL_CMDS_FULLCAL
#define B43_NTAB_TX_IQLO_CAL_CMDS_FULLCAL_REV3

u32 b43_ntab_read(struct b43_wldev *dev, u32 offset);
void b43_ntab_read_bulk(struct b43_wldev *dev, u32 offset,
			 unsigned int nr_elements, void *_data);
void b43_ntab_write(struct b43_wldev *dev, u32 offset, u32 value);
void b43_ntab_write_bulk(struct b43_wldev *dev, u32 offset,
			  unsigned int nr_elements, const void *_data);

void b43_nphy_tables_init(struct b43_wldev *dev);

const u32 *b43_nphy_get_tx_gain_table(struct b43_wldev *dev);

const s16 *b43_ntab_get_rf_pwr_offset_table(struct b43_wldev *dev);

extern const s8 b43_ntab_papd_pga_gain_delta_ipa_2g[];

extern const u16 tbl_iqcal_gainparams[2][9][8];
extern const struct nphy_txiqcal_ladder ladder_lo[];
extern const struct nphy_txiqcal_ladder ladder_iq[];
extern const u16 loscale[];

extern const u16 tbl_tx_iqlo_cal_loft_ladder_40[];
extern const u16 tbl_tx_iqlo_cal_loft_ladder_20[];
extern const u16 tbl_tx_iqlo_cal_iqimb_ladder_40[];
extern const u16 tbl_tx_iqlo_cal_iqimb_ladder_20[];
extern const u16 tbl_tx_iqlo_cal_startcoefs_nphyrev3[];
extern const u16 tbl_tx_iqlo_cal_startcoefs[];
extern const u16 tbl_tx_iqlo_cal_cmds_recal_nphyrev3[];
extern const u16 tbl_tx_iqlo_cal_cmds_recal[];
extern const u16 tbl_tx_iqlo_cal_cmds_fullcal[];
extern const u16 tbl_tx_iqlo_cal_cmds_fullcal_nphyrev3[];
extern const s16 tbl_tx_filter_coef_rev4[7][15];

extern const struct nphy_rf_control_override_rev2
	tbl_rf_control_override_rev2[];
extern const struct nphy_rf_control_override_rev3
	tbl_rf_control_override_rev3[];
const struct nphy_rf_control_override_rev7 *b43_nphy_get_rf_ctl_over_rev7(
	struct b43_wldev *dev, u16 field, u8 override);

#endif /* B43_TABLES_NPHY_H_ */