linux/drivers/net/wireless/broadcom/b43legacy/phy.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*

  Broadcom B43legacy wireless driver

  Copyright (c) 2005 Martin Langer <[email protected]>,
		     Stefano Brivio <[email protected]>
		     Michael Buesch <[email protected]>
		     Danny van Dyk <[email protected]>
		     Andreas Jaggi <[email protected]>
  Copyright (c) 2007 Larry Finger <[email protected]>

  Some parts of the code in this file are derived from the ipw2200
  driver  Copyright(c) 2003 - 2004 Intel Corporation.


*/

#ifndef B43legacy_PHY_H_
#define B43legacy_PHY_H_

#include <linux/types.h>

enum {};

enum {};

/*** PHY Registers ***/

/* Routing */
#define B43legacy_PHYROUTE_OFDM_GPHY
#define B43legacy_PHYROUTE_EXT_GPHY

/* Base registers. */
#define B43legacy_PHY_BASE(reg)
/* OFDM (A) registers of a G-PHY */
#define B43legacy_PHY_OFDM(reg)
/* Extended G-PHY registers */
#define B43legacy_PHY_EXTG(reg)


/* Extended G-PHY Registers */
#define B43legacy_PHY_CLASSCTL
#define B43legacy_PHY_GTABCTL
#define B43legacy_PHY_GTABOFF
#define B43legacy_PHY_GTABNR
#define B43legacy_PHY_GTABNR_SHIFT
#define B43legacy_PHY_GTABDATA
#define B43legacy_PHY_LO_MASK
#define B43legacy_PHY_LO_CTL
#define B43legacy_PHY_RFOVER
#define B43legacy_PHY_RFOVERVAL
/*** OFDM table numbers ***/
#define B43legacy_OFDMTAB(number, offset)
#define B43legacy_OFDMTAB_AGC1
#define B43legacy_OFDMTAB_GAIN0
#define B43legacy_OFDMTAB_GAINX
#define B43legacy_OFDMTAB_GAIN1
#define B43legacy_OFDMTAB_AGC3
#define B43legacy_OFDMTAB_GAIN2
#define B43legacy_OFDMTAB_LNAHPFGAIN1
#define B43legacy_OFDMTAB_WRSSI
#define B43legacy_OFDMTAB_LNAHPFGAIN2
#define B43legacy_OFDMTAB_NOISESCALE
#define B43legacy_OFDMTAB_AGC2
#define B43legacy_OFDMTAB_ROTOR
#define B43legacy_OFDMTAB_ADVRETARD
#define B43legacy_OFDMTAB_DAC
#define B43legacy_OFDMTAB_DC
#define B43legacy_OFDMTAB_PWRDYN2
#define B43legacy_OFDMTAB_LNAGAIN

#define B43legacy_OFDMTAB_LPFGAIN
#define B43legacy_OFDMTAB_RSSI

#define B43legacy_OFDMTAB_AGC1_R1
#define B43legacy_OFDMTAB_GAINX_R1
#define B43legacy_OFDMTAB_MINSIGSQ
#define B43legacy_OFDMTAB_AGC3_R1
#define B43legacy_OFDMTAB_WRSSI_R1
#define B43legacy_OFDMTAB_TSSI
#define B43legacy_OFDMTAB_DACRFPABB
#define B43legacy_OFDMTAB_DACOFF
#define B43legacy_OFDMTAB_DCBIAS

void b43legacy_put_attenuation_into_ranges(int *_bbatt, int *_rfatt);

/* OFDM (A) PHY Registers */
#define B43legacy_PHY_VERSION_OFDM
#define B43legacy_PHY_BBANDCFG
#define B43legacy_PHY_BBANDCFG_RXANT
#define B43legacy_PHY_BBANDCFG_RXANT_SHIFT
#define B43legacy_PHY_PWRDOWN
#define B43legacy_PHY_CRSTHRES1
#define B43legacy_PHY_LNAHPFCTL
#define B43legacy_PHY_ADIVRELATED
#define B43legacy_PHY_CRS0
#define B43legacy_PHY_ANTDWELL
#define B43legacy_PHY_ANTDWELL_AUTODIV1
#define B43legacy_PHY_ENCORE
#define B43legacy_PHY_ENCORE_EN
#define B43legacy_PHY_LMS
#define B43legacy_PHY_OFDM61
#define B43legacy_PHY_OFDM61_10
#define B43legacy_PHY_IQBAL
#define B43legacy_PHY_OTABLECTL
#define B43legacy_PHY_OTABLEOFF
#define B43legacy_PHY_OTABLENR
#define B43legacy_PHY_OTABLENR_SHIFT
#define B43legacy_PHY_OTABLEI
#define B43legacy_PHY_OTABLEQ
#define B43legacy_PHY_HPWR_TSSICTL
#define B43legacy_PHY_NRSSITHRES
#define B43legacy_PHY_ANTWRSETT
#define B43legacy_PHY_ANTWRSETT_ARXDIV
#define B43legacy_PHY_CLIPPWRDOWNT
#define B43legacy_PHY_OFDM9B
#define B43legacy_PHY_N1P1GAIN
#define B43legacy_PHY_P1P2GAIN
#define B43legacy_PHY_N1N2GAIN
#define B43legacy_PHY_CLIPTHRES
#define B43legacy_PHY_CLIPN1P2THRES
#define B43legacy_PHY_DIVSRCHIDX
#define B43legacy_PHY_CLIPP2THRES
#define B43legacy_PHY_CLIPP3THRES
#define B43legacy_PHY_DIVP1P2GAIN
#define B43legacy_PHY_DIVSRCHGAINBACK
#define B43legacy_PHY_DIVSRCHGAINCHNG
#define B43legacy_PHY_CRSTHRES1_R1
#define B43legacy_PHY_CRSTHRES2_R1
#define B43legacy_PHY_TSSIP_LTBASE
#define B43legacy_PHY_DC_LTBASE
#define B43legacy_PHY_GAIN_LTBASE

void b43legacy_put_attenuation_into_ranges(int *_bbatt, int *_rfatt);

/* Masks for the different PHY versioning registers. */
#define B43legacy_PHYVER_ANALOG
#define B43legacy_PHYVER_ANALOG_SHIFT
#define B43legacy_PHYVER_TYPE
#define B43legacy_PHYVER_TYPE_SHIFT
#define B43legacy_PHYVER_VERSION

struct b43legacy_wldev;

void b43legacy_phy_lock(struct b43legacy_wldev *dev);
void b43legacy_phy_unlock(struct b43legacy_wldev *dev);

/* Card uses the loopback gain stuff */
#define has_loopback_gain(phy)

u16 b43legacy_phy_read(struct b43legacy_wldev *dev, u16 offset);
void b43legacy_phy_write(struct b43legacy_wldev *dev, u16 offset, u16 val);

int b43legacy_phy_init_tssi2dbm_table(struct b43legacy_wldev *dev);
int b43legacy_phy_init(struct b43legacy_wldev *dev);

void b43legacy_set_rx_antenna(struct b43legacy_wldev *dev, int antenna);

void b43legacy_phy_set_antenna_diversity(struct b43legacy_wldev *dev);
void b43legacy_phy_calibrate(struct b43legacy_wldev *dev);
int b43legacy_phy_connect(struct b43legacy_wldev *dev, int connect);

void b43legacy_phy_lo_b_measure(struct b43legacy_wldev *dev);
void b43legacy_phy_lo_g_measure(struct b43legacy_wldev *dev);
void b43legacy_phy_xmitpower(struct b43legacy_wldev *dev);

/* Adjust the LocalOscillator to the saved values.
 * "fixed" is only set to 1 once in initialization. Set to 0 otherwise.
 */
void b43legacy_phy_lo_adjust(struct b43legacy_wldev *dev, int fixed);
void b43legacy_phy_lo_mark_all_unused(struct b43legacy_wldev *dev);

void b43legacy_phy_set_baseband_attenuation(struct b43legacy_wldev *dev,
					    u16 baseband_attenuation);

void b43legacy_power_saving_ctl_bits(struct b43legacy_wldev *dev,
				     int bit25, int bit26);

#endif /* B43legacy_PHY_H_ */