iPXE
eeprom.h File Reference
#include "../ath.h"
#include "ar9003_eeprom.h"

Go to the source code of this file.

Data Structures

struct  base_eep_header
struct  base_eep_header_4k
struct  spur_chan
struct  modal_eep_header
struct  calDataPerFreqOpLoop
struct  modal_eep_4k_header
struct  base_eep_ar9287_header
struct  modal_eep_ar9287_header
struct  cal_data_per_freq
struct  cal_data_per_freq_4k
struct  cal_target_power_leg
struct  cal_target_power_ht
struct  cal_ctl_edges
struct  cal_data_op_loop_ar9287
struct  cal_data_per_freq_ar9287
union  cal_data_per_freq_ar9287_u
struct  cal_ctl_data_ar9287
struct  cal_ctl_data
struct  cal_ctl_data_4k
struct  ar5416_eeprom_def
struct  ar5416_eeprom_4k
struct  ar9287_eeprom
struct  ath9k_country_entry
struct  eeprom_ops

Macros

#define AR_EEPROM_MODAL_SPURS   5
#define AR5416_EEPROM_MAGIC   0x5aa5
#define CTRY_DEBUG   0x1ff
#define CTRY_DEFAULT   0
#define AR_EEPROM_EEPCAP_COMPRESS_DIS   0x0001
#define AR_EEPROM_EEPCAP_AES_DIS   0x0002
#define AR_EEPROM_EEPCAP_FASTFRAME_DIS   0x0004
#define AR_EEPROM_EEPCAP_BURST_DIS   0x0008
#define AR_EEPROM_EEPCAP_MAXQCU   0x01F0
#define AR_EEPROM_EEPCAP_MAXQCU_S   4
#define AR_EEPROM_EEPCAP_HEAVY_CLIP_EN   0x0200
#define AR_EEPROM_EEPCAP_KC_ENTRIES   0xF000
#define AR_EEPROM_EEPCAP_KC_ENTRIES_S   12
#define AR_EEPROM_EEREGCAP_EN_FCC_MIDBAND   0x0040
#define AR_EEPROM_EEREGCAP_EN_KK_U1_EVEN   0x0080
#define AR_EEPROM_EEREGCAP_EN_KK_U2   0x0100
#define AR_EEPROM_EEREGCAP_EN_KK_MIDBAND   0x0200
#define AR_EEPROM_EEREGCAP_EN_KK_U1_ODD   0x0400
#define AR_EEPROM_EEREGCAP_EN_KK_NEW_11A   0x0800
#define AR_EEPROM_EEREGCAP_EN_KK_U1_ODD_PRE4_0   0x4000
#define AR_EEPROM_EEREGCAP_EN_KK_NEW_11A_PRE4_0   0x8000
#define AR5416_EEPROM_MAGIC_OFFSET   0x0
#define AR5416_EEPROM_S   2
#define AR5416_EEPROM_OFFSET   0x2000
#define AR5416_EEPROM_MAX   0xae0
#define AR5416_EEPROM_START_ADDR    (AR_SREV_9100(ah)) ? 0x1fff1000 : 0x503f1200
#define SD_NO_CTL   0xE0
#define NO_CTL   0xff
#define CTL_MODE_M   0xf
#define CTL_11A   0
#define CTL_11B   1
#define CTL_11G   2
#define CTL_2GHT20   5
#define CTL_5GHT20   6
#define CTL_2GHT40   7
#define CTL_5GHT40   8
#define EXT_ADDITIVE   (0x8000)
#define CTL_11A_EXT   (CTL_11A | EXT_ADDITIVE)
#define CTL_11G_EXT   (CTL_11G | EXT_ADDITIVE)
#define CTL_11B_EXT   (CTL_11B | EXT_ADDITIVE)
#define SUB_NUM_CTL_MODES_AT_5G_40   2
#define SUB_NUM_CTL_MODES_AT_2G_40   3
#define INCREASE_MAXPOW_BY_TWO_CHAIN   6 /* 10*log10(2)*2 */
#define INCREASE_MAXPOW_BY_THREE_CHAIN   10 /* 10*log10(3)*2 */
#define AR9285_RDEXT_DEFAULT   0x1F
#define ATH9K_POW_SM(_r, _s)
#define FREQ2FBIN(x, y)
#define ath9k_hw_use_flash(_ah)
#define AR5416_VER_MASK   (eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK)
#define OLC_FOR_AR9280_20_LATER
#define OLC_FOR_AR9287_10_LATER
#define AR_EEPROM_RFSILENT_GPIO_SEL   0x001c
#define AR_EEPROM_RFSILENT_GPIO_SEL_S   2
#define AR_EEPROM_RFSILENT_POLARITY   0x0002
#define AR_EEPROM_RFSILENT_POLARITY_S   1
#define EEP_RFSILENT_ENABLED   0x0001
#define EEP_RFSILENT_ENABLED_S   0
#define EEP_RFSILENT_POLARITY   0x0002
#define EEP_RFSILENT_POLARITY_S   1
#define EEP_RFSILENT_GPIO_SEL   0x001c
#define EEP_RFSILENT_GPIO_SEL_S   2
#define AR5416_OPFLAGS_11A   0x01
#define AR5416_OPFLAGS_11G   0x02
#define AR5416_OPFLAGS_N_5G_HT40   0x04
#define AR5416_OPFLAGS_N_2G_HT40   0x08
#define AR5416_OPFLAGS_N_5G_HT20   0x10
#define AR5416_OPFLAGS_N_2G_HT20   0x20
#define AR5416_EEP_NO_BACK_VER   0x1
#define AR5416_EEP_VER   0xE
#define AR5416_EEP_VER_MINOR_MASK   0x0FFF
#define AR5416_EEP_MINOR_VER_2   0x2
#define AR5416_EEP_MINOR_VER_3   0x3
#define AR5416_EEP_MINOR_VER_7   0x7
#define AR5416_EEP_MINOR_VER_9   0x9
#define AR5416_EEP_MINOR_VER_16   0x10
#define AR5416_EEP_MINOR_VER_17   0x11
#define AR5416_EEP_MINOR_VER_19   0x13
#define AR5416_EEP_MINOR_VER_20   0x14
#define AR5416_EEP_MINOR_VER_21   0x15
#define AR5416_EEP_MINOR_VER_22   0x16
#define AR5416_NUM_5G_CAL_PIERS   8
#define AR5416_NUM_2G_CAL_PIERS   4
#define AR5416_NUM_5G_20_TARGET_POWERS   8
#define AR5416_NUM_5G_40_TARGET_POWERS   8
#define AR5416_NUM_2G_CCK_TARGET_POWERS   3
#define AR5416_NUM_2G_20_TARGET_POWERS   4
#define AR5416_NUM_2G_40_TARGET_POWERS   4
#define AR5416_NUM_CTLS   24
#define AR5416_NUM_BAND_EDGES   8
#define AR5416_NUM_PD_GAINS   4
#define AR5416_PD_GAINS_IN_MASK   4
#define AR5416_PD_GAIN_ICEPTS   5
#define AR5416_NUM_PDADC_VALUES   128
#define AR5416_BCHAN_UNUSED   0xFF
#define AR5416_MAX_PWR_RANGE_IN_HALF_DB   64
#define AR5416_MAX_CHAINS   3
#define AR9300_MAX_CHAINS   3
#define AR5416_PWR_TABLE_OFFSET_DB   -5
#define AR5416_EEP_RXGAIN_23DB_BACKOFF   0
#define AR5416_EEP_RXGAIN_13DB_BACKOFF   1
#define AR5416_EEP_RXGAIN_ORIG   2
#define AR5416_EEP_TXGAIN_ORIGINAL   0
#define AR5416_EEP_TXGAIN_HIGH_POWER   1
#define AR5416_EEP4K_START_LOC   64
#define AR5416_EEP4K_NUM_2G_CAL_PIERS   3
#define AR5416_EEP4K_NUM_2G_CCK_TARGET_POWERS   3
#define AR5416_EEP4K_NUM_2G_20_TARGET_POWERS   3
#define AR5416_EEP4K_NUM_2G_40_TARGET_POWERS   3
#define AR5416_EEP4K_NUM_CTLS   12
#define AR5416_EEP4K_NUM_BAND_EDGES   4
#define AR5416_EEP4K_NUM_PD_GAINS   2
#define AR5416_EEP4K_MAX_CHAINS   1
#define AR9280_TX_GAIN_TABLE_SIZE   22
#define AR9287_EEP_VER   0xE
#define AR9287_EEP_VER_MINOR_MASK   0xFFF
#define AR9287_EEP_MINOR_VER_1   0x1
#define AR9287_EEP_MINOR_VER_2   0x2
#define AR9287_EEP_MINOR_VER_3   0x3
#define AR9287_EEP_MINOR_VER   AR9287_EEP_MINOR_VER_3
#define AR9287_EEP_MINOR_VER_b   AR9287_EEP_MINOR_VER
#define AR9287_EEP_NO_BACK_VER   AR9287_EEP_MINOR_VER_1
#define AR9287_EEP_START_LOC   128
#define AR9287_HTC_EEP_START_LOC   256
#define AR9287_NUM_2G_CAL_PIERS   3
#define AR9287_NUM_2G_CCK_TARGET_POWERS   3
#define AR9287_NUM_2G_20_TARGET_POWERS   3
#define AR9287_NUM_2G_40_TARGET_POWERS   3
#define AR9287_NUM_CTLS   12
#define AR9287_NUM_BAND_EDGES   4
#define AR9287_PD_GAIN_ICEPTS   1
#define AR9287_EEPMISC_BIG_ENDIAN   0x01
#define AR9287_EEPMISC_WOW   0x02
#define AR9287_MAX_CHAINS   2
#define AR9287_ANT_16S   32
#define AR9287_DATA_SZ   32
#define AR9287_PWR_TABLE_OFFSET_DB   -5
#define AR9287_CHECKSUM_LOCATION   (AR9287_EEP_START_LOC + 1)
#define CTL_EDGE_TPOWER(_ctl)
#define CTL_EDGE_FLAGS(_ctl)
#define LNA_CTL_BUF_MODE   BIT(0)
#define LNA_CTL_ISEL_LO   BIT(1)
#define LNA_CTL_ISEL_HI   BIT(2)
#define LNA_CTL_BUF_IN   BIT(3)
#define LNA_CTL_FEM_BAND   BIT(4)
#define LNA_CTL_LOCAL_BIAS   BIT(5)
#define LNA_CTL_FORCE_XPA   BIT(6)
#define LNA_CTL_USE_ANT1   BIT(7)
#define EEP_4K_BB_DESIRED_SCALE_MASK   0x1f
#define ar5416_get_ntxchains(_txchainmask)

Enumerations

enum  eeprom_param {
  EEP_NFTHRESH_5 , EEP_NFTHRESH_2 , EEP_MAC_MSW , EEP_MAC_MID ,
  EEP_MAC_LSW , EEP_REG_0 , EEP_REG_1 , EEP_OP_CAP ,
  EEP_OP_MODE , EEP_RF_SILENT , EEP_OB_5 , EEP_DB_5 ,
  EEP_OB_2 , EEP_DB_2 , EEP_MINOR_REV , EEP_TX_MASK ,
  EEP_RX_MASK , EEP_FSTCLK_5G , EEP_RXGAIN_TYPE , EEP_OL_PWRCTRL ,
  EEP_TXGAIN_TYPE , EEP_RC_CHAIN_MASK , EEP_DAC_HPWR_5G , EEP_FRAC_N_5G ,
  EEP_DEV_TYPE , EEP_TEMPSENSE_SLOPE , EEP_TEMPSENSE_SLOPE_PAL_ON , EEP_PWR_TABLE_OFFSET ,
  EEP_DRIVE_STRENGTH , EEP_INTERNAL_REGULATOR , EEP_SWREG , EEP_PAPRD ,
  EEP_MODAL_VER , EEP_ANT_DIV_CTL1 , EEP_CHAIN_MASK_REDUCE
}
enum  ar5416_rates {
  rate6mb , rate9mb , rate12mb , rate18mb ,
  rate24mb , rate36mb , rate48mb , rate54mb ,
  rate1l , rate2l , rate2s , rate5_5l ,
  rate5_5s , rate11l , rate11s , rateXr ,
  rateHt20_0 , rateHt20_1 , rateHt20_2 , rateHt20_3 ,
  rateHt20_4 , rateHt20_5 , rateHt20_6 , rateHt20_7 ,
  rateHt40_0 , rateHt40_1 , rateHt40_2 , rateHt40_3 ,
  rateHt40_4 , rateHt40_5 , rateHt40_6 , rateHt40_7 ,
  rateDupCck , rateDupOfdm , rateExtCck , rateExtOfdm ,
  Ar5416RateSize
}
enum  ath9k_hal_freq_band { ATH9K_HAL_FREQ_BAND_5GHZ = 0 , ATH9K_HAL_FREQ_BAND_2GHZ = 1 }
enum  reg_ext_bitmap {
  REG_EXT_FCC_MIDBAND = 0 , REG_EXT_JAPAN_MIDBAND = 1 , REG_EXT_FCC_DFS_HT40 = 2 , REG_EXT_JAPAN_NONDFS_HT40 = 3 ,
  REG_EXT_JAPAN_DFS_HT40 = 4
}

Functions

 FILE_LICENCE (BSD2)
 FILE_SECBOOT (FORBIDDEN)
void ath9k_hw_analog_shift_regwrite (struct ath_hw *ah, u32 reg, u32 val)
void ath9k_hw_analog_shift_rmw (struct ath_hw *ah, u32 reg, u32 mask, u32 shift, u32 val)
int16_t ath9k_hw_interpolate (u16 target, u16 srcLeft, u16 srcRight, int16_t targetLeft, int16_t targetRight)
int ath9k_hw_get_lower_upper_index (u8 target, u8 *pList, u16 listSize, u16 *indexL, u16 *indexR)
int ath9k_hw_nvram_read (struct ath_common *common, u32 off, u16 *data)
void ath9k_hw_usb_gen_fill_eeprom (struct ath_hw *ah, u16 *eep_data, int eep_start_loc, int size)
void ath9k_hw_fill_vpd_table (u8 pwrMin, u8 pwrMax, u8 *pPwrList, u8 *pVpdList, u16 numIntercepts, u8 *pRetVpdList)
void ath9k_hw_get_legacy_target_powers (struct ath_hw *ah, struct ath9k_channel *chan, struct cal_target_power_leg *powInfo, u16 numChannels, struct cal_target_power_leg *pNewPower, u16 numRates, int isExtTarget)
void ath9k_hw_get_target_powers (struct ath_hw *ah, struct ath9k_channel *chan, struct cal_target_power_ht *powInfo, u16 numChannels, struct cal_target_power_ht *pNewPower, u16 numRates, int isHt40Target)
u16 ath9k_hw_get_max_edge_power (u16 freq, struct cal_ctl_edges *pRdEdgesPower, int is2GHz, int num_band_edges)
void ath9k_hw_update_regulatory_maxpower (struct ath_hw *ah)
int ath9k_hw_eeprom_init (struct ath_hw *ah)
void ath9k_hw_get_gain_boundaries_pdadcs (struct ath_hw *ah, struct ath9k_channel *chan, void *pRawDataSet, u8 *bChans, u16 availPiers, u16 tPdGainOverlap, u16 *pPdGainBoundaries, u8 *pPDADCValues, u16 numXpdGains)

Variables

const struct eeprom_ops eep_def_ops
const struct eeprom_ops eep_4k_ops
const struct eeprom_ops eep_ar9287_ops
const struct eeprom_ops eep_ar9300_ops

Macro Definition Documentation

◆ AR_EEPROM_MODAL_SPURS

◆ AR5416_EEPROM_MAGIC

#define AR5416_EEPROM_MAGIC   0x5aa5

◆ CTRY_DEBUG

#define CTRY_DEBUG   0x1ff

Definition at line 37 of file eeprom.h.

◆ CTRY_DEFAULT

#define CTRY_DEFAULT   0

Definition at line 38 of file eeprom.h.

Referenced by ath9k_hw_init_defaults().

◆ AR_EEPROM_EEPCAP_COMPRESS_DIS

#define AR_EEPROM_EEPCAP_COMPRESS_DIS   0x0001

Definition at line 40 of file eeprom.h.

◆ AR_EEPROM_EEPCAP_AES_DIS

#define AR_EEPROM_EEPCAP_AES_DIS   0x0002

Definition at line 41 of file eeprom.h.

◆ AR_EEPROM_EEPCAP_FASTFRAME_DIS

#define AR_EEPROM_EEPCAP_FASTFRAME_DIS   0x0004

Definition at line 42 of file eeprom.h.

◆ AR_EEPROM_EEPCAP_BURST_DIS

#define AR_EEPROM_EEPCAP_BURST_DIS   0x0008

Definition at line 43 of file eeprom.h.

◆ AR_EEPROM_EEPCAP_MAXQCU

#define AR_EEPROM_EEPCAP_MAXQCU   0x01F0

Definition at line 44 of file eeprom.h.

◆ AR_EEPROM_EEPCAP_MAXQCU_S

#define AR_EEPROM_EEPCAP_MAXQCU_S   4

Definition at line 45 of file eeprom.h.

◆ AR_EEPROM_EEPCAP_HEAVY_CLIP_EN

#define AR_EEPROM_EEPCAP_HEAVY_CLIP_EN   0x0200

Definition at line 46 of file eeprom.h.

◆ AR_EEPROM_EEPCAP_KC_ENTRIES

#define AR_EEPROM_EEPCAP_KC_ENTRIES   0xF000

Definition at line 47 of file eeprom.h.

◆ AR_EEPROM_EEPCAP_KC_ENTRIES_S

#define AR_EEPROM_EEPCAP_KC_ENTRIES_S   12

Definition at line 48 of file eeprom.h.

◆ AR_EEPROM_EEREGCAP_EN_FCC_MIDBAND

#define AR_EEPROM_EEREGCAP_EN_FCC_MIDBAND   0x0040

Definition at line 50 of file eeprom.h.

◆ AR_EEPROM_EEREGCAP_EN_KK_U1_EVEN

#define AR_EEPROM_EEREGCAP_EN_KK_U1_EVEN   0x0080

Definition at line 51 of file eeprom.h.

◆ AR_EEPROM_EEREGCAP_EN_KK_U2

#define AR_EEPROM_EEREGCAP_EN_KK_U2   0x0100

Definition at line 52 of file eeprom.h.

◆ AR_EEPROM_EEREGCAP_EN_KK_MIDBAND

#define AR_EEPROM_EEREGCAP_EN_KK_MIDBAND   0x0200

Definition at line 53 of file eeprom.h.

◆ AR_EEPROM_EEREGCAP_EN_KK_U1_ODD

#define AR_EEPROM_EEREGCAP_EN_KK_U1_ODD   0x0400

Definition at line 54 of file eeprom.h.

◆ AR_EEPROM_EEREGCAP_EN_KK_NEW_11A

#define AR_EEPROM_EEREGCAP_EN_KK_NEW_11A   0x0800

Definition at line 55 of file eeprom.h.

◆ AR_EEPROM_EEREGCAP_EN_KK_U1_ODD_PRE4_0

#define AR_EEPROM_EEREGCAP_EN_KK_U1_ODD_PRE4_0   0x4000

Definition at line 57 of file eeprom.h.

◆ AR_EEPROM_EEREGCAP_EN_KK_NEW_11A_PRE4_0

#define AR_EEPROM_EEREGCAP_EN_KK_NEW_11A_PRE4_0   0x8000

Definition at line 58 of file eeprom.h.

◆ AR5416_EEPROM_MAGIC_OFFSET

#define AR5416_EEPROM_MAGIC_OFFSET   0x0

◆ AR5416_EEPROM_S

#define AR5416_EEPROM_S   2

Definition at line 61 of file eeprom.h.

Referenced by ath9k_hw_usb_gen_fill_eeprom(), and ath_pci_eeprom_read().

◆ AR5416_EEPROM_OFFSET

#define AR5416_EEPROM_OFFSET   0x2000

Definition at line 62 of file eeprom.h.

Referenced by ath9k_hw_usb_gen_fill_eeprom(), and ath_pci_eeprom_read().

◆ AR5416_EEPROM_MAX

#define AR5416_EEPROM_MAX   0xae0

Definition at line 63 of file eeprom.h.

◆ AR5416_EEPROM_START_ADDR

#define AR5416_EEPROM_START_ADDR    (AR_SREV_9100(ah)) ? 0x1fff1000 : 0x503f1200

Definition at line 65 of file eeprom.h.

65#define AR5416_EEPROM_START_ADDR \
66 (AR_SREV_9100(ah)) ? 0x1fff1000 : 0x503f1200

◆ SD_NO_CTL

◆ NO_CTL

#define NO_CTL   0xff

Definition at line 69 of file eeprom.h.

Referenced by ath_regd_get_band_ctl().

◆ CTL_MODE_M

◆ CTL_11A

◆ CTL_11B

◆ CTL_11G

◆ CTL_2GHT20

◆ CTL_5GHT20

◆ CTL_2GHT40

◆ CTL_5GHT40

◆ EXT_ADDITIVE

#define EXT_ADDITIVE   (0x8000)

Definition at line 79 of file eeprom.h.

◆ CTL_11A_EXT

#define CTL_11A_EXT   (CTL_11A | EXT_ADDITIVE)

Definition at line 80 of file eeprom.h.

◆ CTL_11G_EXT

#define CTL_11G_EXT   (CTL_11G | EXT_ADDITIVE)

Definition at line 81 of file eeprom.h.

◆ CTL_11B_EXT

#define CTL_11B_EXT   (CTL_11B | EXT_ADDITIVE)

Definition at line 82 of file eeprom.h.

◆ SUB_NUM_CTL_MODES_AT_5G_40

#define SUB_NUM_CTL_MODES_AT_5G_40   2

Definition at line 84 of file eeprom.h.

◆ SUB_NUM_CTL_MODES_AT_2G_40

#define SUB_NUM_CTL_MODES_AT_2G_40   3

Definition at line 85 of file eeprom.h.

◆ INCREASE_MAXPOW_BY_TWO_CHAIN

#define INCREASE_MAXPOW_BY_TWO_CHAIN   6 /* 10*log10(2)*2 */

Definition at line 87 of file eeprom.h.

Referenced by ath9k_hw_def_set_txpower(), and ath9k_hw_update_regulatory_maxpower().

◆ INCREASE_MAXPOW_BY_THREE_CHAIN

#define INCREASE_MAXPOW_BY_THREE_CHAIN   10 /* 10*log10(3)*2 */

Definition at line 88 of file eeprom.h.

Referenced by ath9k_hw_def_set_txpower(), and ath9k_hw_update_regulatory_maxpower().

◆ AR9285_RDEXT_DEFAULT

#define AR9285_RDEXT_DEFAULT   0x1F

Definition at line 100 of file eeprom.h.

Referenced by ath9k_hw_fill_cap_info().

◆ ATH9K_POW_SM

#define ATH9K_POW_SM ( _r,
_s )
Value:
(((_r) & 0x3f) << (_s))

Definition at line 102 of file eeprom.h.

Referenced by ath9k_hw_4k_set_txpower(), ath9k_hw_ar9287_set_txpower(), and ath9k_hw_def_set_txpower().

◆ FREQ2FBIN

#define FREQ2FBIN ( x,
y )
Value:
((y) ? ((x) - 2300) : (((x) - 4800) / 5))
static unsigned int unsigned int y
Definition pixbuf.h:63
static unsigned int x
Definition pixbuf.h:63

Definition at line 103 of file eeprom.h.

Referenced by ar9287_eeprom_get_tx_gain_index(), ath9k_get_txgain_index(), ath9k_hw_def_set_addac(), and ath9k_hw_get_gain_boundaries_pdadcs().

◆ ath9k_hw_use_flash

◆ AR5416_VER_MASK

#define AR5416_VER_MASK   (eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK)

◆ OLC_FOR_AR9280_20_LATER

#define OLC_FOR_AR9280_20_LATER
Value:
ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL))
@ EEP_OL_PWRCTRL
Definition eeprom.h:246
#define AR_SREV_9280_20_OR_LATER(_ah)
Definition reg.h:825
uint8_t ah
Definition registers.h:1

Definition at line 107 of file eeprom.h.

107#define OLC_FOR_AR9280_20_LATER (AR_SREV_9280_20_OR_LATER(ah) && \
108 ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL))

Referenced by ar9002_hw_olc_temp_compensation(), ar9002_olc_init(), ath9k_hw_def_set_txpower(), and ath9k_hw_set_def_power_cal_table().

◆ OLC_FOR_AR9287_10_LATER

#define OLC_FOR_AR9287_10_LATER
Value:
ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL))
#define AR_SREV_9287_11_OR_LATER(_ah)
Definition reg.h:837

Definition at line 109 of file eeprom.h.

109#define OLC_FOR_AR9287_10_LATER (AR_SREV_9287_11_OR_LATER(ah) && \
110 ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL))

Referenced by ar9002_hw_olc_temp_compensation(), and ar9002_olc_init().

◆ AR_EEPROM_RFSILENT_GPIO_SEL

#define AR_EEPROM_RFSILENT_GPIO_SEL   0x001c

Definition at line 112 of file eeprom.h.

◆ AR_EEPROM_RFSILENT_GPIO_SEL_S

#define AR_EEPROM_RFSILENT_GPIO_SEL_S   2

Definition at line 113 of file eeprom.h.

◆ AR_EEPROM_RFSILENT_POLARITY

#define AR_EEPROM_RFSILENT_POLARITY   0x0002

Definition at line 114 of file eeprom.h.

◆ AR_EEPROM_RFSILENT_POLARITY_S

#define AR_EEPROM_RFSILENT_POLARITY_S   1

Definition at line 115 of file eeprom.h.

◆ EEP_RFSILENT_ENABLED

#define EEP_RFSILENT_ENABLED   0x0001

Definition at line 117 of file eeprom.h.

Referenced by ath9k_hw_fill_cap_info().

◆ EEP_RFSILENT_ENABLED_S

#define EEP_RFSILENT_ENABLED_S   0

Definition at line 118 of file eeprom.h.

◆ EEP_RFSILENT_POLARITY

#define EEP_RFSILENT_POLARITY   0x0002

Definition at line 119 of file eeprom.h.

Referenced by ath9k_hw_fill_cap_info().

◆ EEP_RFSILENT_POLARITY_S

#define EEP_RFSILENT_POLARITY_S   1

Definition at line 120 of file eeprom.h.

◆ EEP_RFSILENT_GPIO_SEL

#define EEP_RFSILENT_GPIO_SEL   0x001c

Definition at line 121 of file eeprom.h.

Referenced by ath9k_hw_fill_cap_info().

◆ EEP_RFSILENT_GPIO_SEL_S

#define EEP_RFSILENT_GPIO_SEL_S   2

Definition at line 122 of file eeprom.h.

◆ AR5416_OPFLAGS_11A

#define AR5416_OPFLAGS_11A   0x01

Definition at line 124 of file eeprom.h.

Referenced by ath9k_hw_fill_cap_info().

◆ AR5416_OPFLAGS_11G

#define AR5416_OPFLAGS_11G   0x02

Definition at line 125 of file eeprom.h.

Referenced by ath9k_hw_fill_cap_info().

◆ AR5416_OPFLAGS_N_5G_HT40

#define AR5416_OPFLAGS_N_5G_HT40   0x04

Definition at line 126 of file eeprom.h.

◆ AR5416_OPFLAGS_N_2G_HT40

#define AR5416_OPFLAGS_N_2G_HT40   0x08

Definition at line 127 of file eeprom.h.

◆ AR5416_OPFLAGS_N_5G_HT20

#define AR5416_OPFLAGS_N_5G_HT20   0x10

Definition at line 128 of file eeprom.h.

◆ AR5416_OPFLAGS_N_2G_HT20

#define AR5416_OPFLAGS_N_2G_HT20   0x20

Definition at line 129 of file eeprom.h.

◆ AR5416_EEP_NO_BACK_VER

#define AR5416_EEP_NO_BACK_VER   0x1

◆ AR5416_EEP_VER

#define AR5416_EEP_VER   0xE

Definition at line 132 of file eeprom.h.

Referenced by ath9k_hw_4k_check_eeprom(), and ath9k_hw_def_check_eeprom().

◆ AR5416_EEP_VER_MINOR_MASK

◆ AR5416_EEP_MINOR_VER_2

◆ AR5416_EEP_MINOR_VER_3

#define AR5416_EEP_MINOR_VER_3   0x3

◆ AR5416_EEP_MINOR_VER_7

#define AR5416_EEP_MINOR_VER_7   0x7

Definition at line 136 of file eeprom.h.

Referenced by ath9k_hw_4k_set_addac(), and ath9k_hw_def_set_addac().

◆ AR5416_EEP_MINOR_VER_9

#define AR5416_EEP_MINOR_VER_9   0x9

Definition at line 137 of file eeprom.h.

◆ AR5416_EEP_MINOR_VER_16

#define AR5416_EEP_MINOR_VER_16   0x10

Definition at line 138 of file eeprom.h.

Referenced by ath9k_hw_fill_cap_info().

◆ AR5416_EEP_MINOR_VER_17

#define AR5416_EEP_MINOR_VER_17   0x11

Definition at line 139 of file eeprom.h.

Referenced by ar9280_20_hw_init_rxgain_ini().

◆ AR5416_EEP_MINOR_VER_19

#define AR5416_EEP_MINOR_VER_19   0x13

◆ AR5416_EEP_MINOR_VER_20

#define AR5416_EEP_MINOR_VER_20   0x14

Definition at line 141 of file eeprom.h.

Referenced by ath9k_hw_def_get_eeprom(), and ath9k_hw_def_set_board_values().

◆ AR5416_EEP_MINOR_VER_21

#define AR5416_EEP_MINOR_VER_21   0x15

Definition at line 142 of file eeprom.h.

Referenced by ath9k_hw_def_get_eeprom().

◆ AR5416_EEP_MINOR_VER_22

#define AR5416_EEP_MINOR_VER_22   0x16

Definition at line 143 of file eeprom.h.

Referenced by ath9k_hw_def_get_eeprom().

◆ AR5416_NUM_5G_CAL_PIERS

#define AR5416_NUM_5G_CAL_PIERS   8

Definition at line 145 of file eeprom.h.

Referenced by ath9k_hw_set_def_power_cal_table().

◆ AR5416_NUM_2G_CAL_PIERS

#define AR5416_NUM_2G_CAL_PIERS   4

Definition at line 146 of file eeprom.h.

Referenced by ath9k_hw_set_def_power_cal_table().

◆ AR5416_NUM_5G_20_TARGET_POWERS

#define AR5416_NUM_5G_20_TARGET_POWERS   8

Definition at line 147 of file eeprom.h.

Referenced by ath9k_hw_set_def_power_per_rate_table().

◆ AR5416_NUM_5G_40_TARGET_POWERS

#define AR5416_NUM_5G_40_TARGET_POWERS   8

Definition at line 148 of file eeprom.h.

Referenced by ath9k_hw_set_def_power_per_rate_table().

◆ AR5416_NUM_2G_CCK_TARGET_POWERS

#define AR5416_NUM_2G_CCK_TARGET_POWERS   3

◆ AR5416_NUM_2G_20_TARGET_POWERS

#define AR5416_NUM_2G_20_TARGET_POWERS   4

◆ AR5416_NUM_2G_40_TARGET_POWERS

#define AR5416_NUM_2G_40_TARGET_POWERS   4

◆ AR5416_NUM_CTLS

#define AR5416_NUM_CTLS   24

Definition at line 152 of file eeprom.h.

Referenced by ath9k_hw_set_def_power_per_rate_table().

◆ AR5416_NUM_BAND_EDGES

#define AR5416_NUM_BAND_EDGES   8

◆ AR5416_NUM_PD_GAINS

#define AR5416_NUM_PD_GAINS   4

◆ AR5416_PD_GAINS_IN_MASK

◆ AR5416_PD_GAIN_ICEPTS

#define AR5416_PD_GAIN_ICEPTS   5

Definition at line 156 of file eeprom.h.

Referenced by ath9k_hw_get_gain_boundaries_pdadcs().

◆ AR5416_NUM_PDADC_VALUES

◆ AR5416_BCHAN_UNUSED

◆ AR5416_MAX_PWR_RANGE_IN_HALF_DB

#define AR5416_MAX_PWR_RANGE_IN_HALF_DB   64

Definition at line 159 of file eeprom.h.

Referenced by ath9k_hw_get_gain_boundaries_pdadcs().

◆ AR5416_MAX_CHAINS

◆ AR9300_MAX_CHAINS

#define AR9300_MAX_CHAINS   3

Definition at line 161 of file eeprom.h.

◆ AR5416_PWR_TABLE_OFFSET_DB

#define AR5416_PWR_TABLE_OFFSET_DB   -5

◆ AR5416_EEP_RXGAIN_23DB_BACKOFF

#define AR5416_EEP_RXGAIN_23DB_BACKOFF   0

Definition at line 165 of file eeprom.h.

Referenced by ar9280_20_hw_init_rxgain_ini().

◆ AR5416_EEP_RXGAIN_13DB_BACKOFF

#define AR5416_EEP_RXGAIN_13DB_BACKOFF   1

Definition at line 166 of file eeprom.h.

Referenced by ar9280_20_hw_init_rxgain_ini().

◆ AR5416_EEP_RXGAIN_ORIG

#define AR5416_EEP_RXGAIN_ORIG   2

Definition at line 167 of file eeprom.h.

◆ AR5416_EEP_TXGAIN_ORIGINAL

#define AR5416_EEP_TXGAIN_ORIGINAL   0

Definition at line 170 of file eeprom.h.

Referenced by ath9k_hw_4k_get_eeprom().

◆ AR5416_EEP_TXGAIN_HIGH_POWER

#define AR5416_EEP_TXGAIN_HIGH_POWER   1

◆ AR5416_EEP4K_START_LOC

#define AR5416_EEP4K_START_LOC   64

Definition at line 173 of file eeprom.h.

◆ AR5416_EEP4K_NUM_2G_CAL_PIERS

#define AR5416_EEP4K_NUM_2G_CAL_PIERS   3

Definition at line 174 of file eeprom.h.

Referenced by ath9k_hw_set_4k_power_cal_table().

◆ AR5416_EEP4K_NUM_2G_CCK_TARGET_POWERS

#define AR5416_EEP4K_NUM_2G_CCK_TARGET_POWERS   3

Definition at line 175 of file eeprom.h.

◆ AR5416_EEP4K_NUM_2G_20_TARGET_POWERS

#define AR5416_EEP4K_NUM_2G_20_TARGET_POWERS   3

Definition at line 176 of file eeprom.h.

◆ AR5416_EEP4K_NUM_2G_40_TARGET_POWERS

#define AR5416_EEP4K_NUM_2G_40_TARGET_POWERS   3

Definition at line 177 of file eeprom.h.

◆ AR5416_EEP4K_NUM_CTLS

#define AR5416_EEP4K_NUM_CTLS   12

Definition at line 178 of file eeprom.h.

Referenced by ath9k_hw_set_4k_power_per_rate_table().

◆ AR5416_EEP4K_NUM_BAND_EDGES

#define AR5416_EEP4K_NUM_BAND_EDGES   4

Definition at line 179 of file eeprom.h.

Referenced by ath9k_hw_set_4k_power_per_rate_table().

◆ AR5416_EEP4K_NUM_PD_GAINS

#define AR5416_EEP4K_NUM_PD_GAINS   2

Definition at line 180 of file eeprom.h.

Referenced by ath9k_hw_set_4k_power_cal_table().

◆ AR5416_EEP4K_MAX_CHAINS

#define AR5416_EEP4K_MAX_CHAINS   1

Definition at line 181 of file eeprom.h.

Referenced by ath9k_hw_4k_check_eeprom(), and ath9k_hw_set_4k_power_cal_table().

◆ AR9280_TX_GAIN_TABLE_SIZE

#define AR9280_TX_GAIN_TABLE_SIZE   22

◆ AR9287_EEP_VER

#define AR9287_EEP_VER   0xE

Definition at line 185 of file eeprom.h.

Referenced by ath9k_hw_ar9287_check_eeprom().

◆ AR9287_EEP_VER_MINOR_MASK

#define AR9287_EEP_VER_MINOR_MASK   0xFFF

◆ AR9287_EEP_MINOR_VER_1

#define AR9287_EEP_MINOR_VER_1   0x1

Definition at line 187 of file eeprom.h.

◆ AR9287_EEP_MINOR_VER_2

#define AR9287_EEP_MINOR_VER_2   0x2

◆ AR9287_EEP_MINOR_VER_3

#define AR9287_EEP_MINOR_VER_3   0x3

Definition at line 189 of file eeprom.h.

Referenced by ath9k_hw_ar9287_get_eeprom().

◆ AR9287_EEP_MINOR_VER

#define AR9287_EEP_MINOR_VER   AR9287_EEP_MINOR_VER_3

Definition at line 190 of file eeprom.h.

◆ AR9287_EEP_MINOR_VER_b

#define AR9287_EEP_MINOR_VER_b   AR9287_EEP_MINOR_VER

Definition at line 191 of file eeprom.h.

◆ AR9287_EEP_NO_BACK_VER

#define AR9287_EEP_NO_BACK_VER   AR9287_EEP_MINOR_VER_1

Definition at line 192 of file eeprom.h.

◆ AR9287_EEP_START_LOC

#define AR9287_EEP_START_LOC   128

Definition at line 194 of file eeprom.h.

Referenced by __ath9k_hw_ar9287_fill_eeprom().

◆ AR9287_HTC_EEP_START_LOC

#define AR9287_HTC_EEP_START_LOC   256

Definition at line 195 of file eeprom.h.

Referenced by __ath9k_hw_usb_ar9287_fill_eeprom().

◆ AR9287_NUM_2G_CAL_PIERS

#define AR9287_NUM_2G_CAL_PIERS   3

Definition at line 196 of file eeprom.h.

Referenced by ath9k_hw_set_ar9287_power_cal_table().

◆ AR9287_NUM_2G_CCK_TARGET_POWERS

#define AR9287_NUM_2G_CCK_TARGET_POWERS   3

Definition at line 197 of file eeprom.h.

Referenced by ath9k_hw_set_ar9287_power_per_rate_table().

◆ AR9287_NUM_2G_20_TARGET_POWERS

#define AR9287_NUM_2G_20_TARGET_POWERS   3

Definition at line 198 of file eeprom.h.

Referenced by ath9k_hw_set_ar9287_power_per_rate_table().

◆ AR9287_NUM_2G_40_TARGET_POWERS

#define AR9287_NUM_2G_40_TARGET_POWERS   3

Definition at line 199 of file eeprom.h.

Referenced by ath9k_hw_set_ar9287_power_per_rate_table().

◆ AR9287_NUM_CTLS

#define AR9287_NUM_CTLS   12

Definition at line 200 of file eeprom.h.

Referenced by ath9k_hw_set_ar9287_power_per_rate_table().

◆ AR9287_NUM_BAND_EDGES

#define AR9287_NUM_BAND_EDGES   4

Definition at line 201 of file eeprom.h.

◆ AR9287_PD_GAIN_ICEPTS

#define AR9287_PD_GAIN_ICEPTS   1

Definition at line 202 of file eeprom.h.

Referenced by ath9k_hw_get_gain_boundaries_pdadcs().

◆ AR9287_EEPMISC_BIG_ENDIAN

#define AR9287_EEPMISC_BIG_ENDIAN   0x01

Definition at line 203 of file eeprom.h.

◆ AR9287_EEPMISC_WOW

#define AR9287_EEPMISC_WOW   0x02

Definition at line 204 of file eeprom.h.

◆ AR9287_MAX_CHAINS

#define AR9287_MAX_CHAINS   2

◆ AR9287_ANT_16S

#define AR9287_ANT_16S   32

Definition at line 206 of file eeprom.h.

◆ AR9287_DATA_SZ

#define AR9287_DATA_SZ   32

Definition at line 208 of file eeprom.h.

◆ AR9287_PWR_TABLE_OFFSET_DB

#define AR9287_PWR_TABLE_OFFSET_DB   -5

Definition at line 210 of file eeprom.h.

Referenced by ath9k_hw_ar9287_set_txpower(), and ath9k_hw_set_ar9287_power_cal_table().

◆ AR9287_CHECKSUM_LOCATION

#define AR9287_CHECKSUM_LOCATION   (AR9287_EEP_START_LOC + 1)

Definition at line 212 of file eeprom.h.

◆ CTL_EDGE_TPOWER

#define CTL_EDGE_TPOWER ( _ctl)
Value:
((_ctl) & 0x3f)

Definition at line 214 of file eeprom.h.

Referenced by ar9003_hw_get_direct_edge_power(), ar9003_hw_get_indirect_edge_power(), and ath9k_hw_get_max_edge_power().

◆ CTL_EDGE_FLAGS

#define CTL_EDGE_FLAGS ( _ctl)
Value:
(((_ctl) >> 6) & 0x03)

Definition at line 215 of file eeprom.h.

Referenced by ar9003_hw_get_indirect_edge_power(), and ath9k_hw_get_max_edge_power().

◆ LNA_CTL_BUF_MODE

#define LNA_CTL_BUF_MODE   BIT(0)

Definition at line 217 of file eeprom.h.

◆ LNA_CTL_ISEL_LO

#define LNA_CTL_ISEL_LO   BIT(1)

Definition at line 218 of file eeprom.h.

◆ LNA_CTL_ISEL_HI

#define LNA_CTL_ISEL_HI   BIT(2)

Definition at line 219 of file eeprom.h.

◆ LNA_CTL_BUF_IN

#define LNA_CTL_BUF_IN   BIT(3)

Definition at line 220 of file eeprom.h.

◆ LNA_CTL_FEM_BAND

#define LNA_CTL_FEM_BAND   BIT(4)

Definition at line 221 of file eeprom.h.

◆ LNA_CTL_LOCAL_BIAS

#define LNA_CTL_LOCAL_BIAS   BIT(5)

Definition at line 222 of file eeprom.h.

Referenced by ath9k_hw_def_set_board_values().

◆ LNA_CTL_FORCE_XPA

#define LNA_CTL_FORCE_XPA   BIT(6)

Definition at line 223 of file eeprom.h.

Referenced by ath9k_hw_def_set_board_values().

◆ LNA_CTL_USE_ANT1

#define LNA_CTL_USE_ANT1   BIT(7)

Definition at line 224 of file eeprom.h.

◆ EEP_4K_BB_DESIRED_SCALE_MASK

#define EEP_4K_BB_DESIRED_SCALE_MASK   0x1f

Definition at line 447 of file eeprom.h.

Referenced by ath9k_hw_4k_set_board_values().

◆ ar5416_get_ntxchains

#define ar5416_get_ntxchains ( _txchainmask)
Value:
(((_txchainmask >> 2) & 1) + \
((_txchainmask >> 1) & 1) + (_txchainmask & 1))

Definition at line 707 of file eeprom.h.

707#define ar5416_get_ntxchains(_txchainmask) \
708 (((_txchainmask >> 2) & 1) + \
709 ((_txchainmask >> 1) & 1) + (_txchainmask & 1))

Referenced by ar9003_hw_set_power_per_rate_table(), ath9k_hw_def_set_txpower(), ath9k_hw_set_4k_power_per_rate_table(), ath9k_hw_set_ar9287_power_per_rate_table(), ath9k_hw_set_def_power_per_rate_table(), and ath9k_hw_update_regulatory_maxpower().

Enumeration Type Documentation

◆ eeprom_param

Enumerator
EEP_NFTHRESH_5 
EEP_NFTHRESH_2 
EEP_MAC_MSW 
EEP_MAC_MID 
EEP_MAC_LSW 
EEP_REG_0 
EEP_REG_1 
EEP_OP_CAP 
EEP_OP_MODE 
EEP_RF_SILENT 
EEP_OB_5 
EEP_DB_5 
EEP_OB_2 
EEP_DB_2 
EEP_MINOR_REV 
EEP_TX_MASK 
EEP_RX_MASK 
EEP_FSTCLK_5G 
EEP_RXGAIN_TYPE 
EEP_OL_PWRCTRL 
EEP_TXGAIN_TYPE 
EEP_RC_CHAIN_MASK 
EEP_DAC_HPWR_5G 
EEP_FRAC_N_5G 
EEP_DEV_TYPE 
EEP_TEMPSENSE_SLOPE 
EEP_TEMPSENSE_SLOPE_PAL_ON 
EEP_PWR_TABLE_OFFSET 
EEP_DRIVE_STRENGTH 
EEP_INTERNAL_REGULATOR 
EEP_SWREG 
EEP_PAPRD 
EEP_MODAL_VER 
EEP_ANT_DIV_CTL1 
EEP_CHAIN_MASK_REDUCE 

Definition at line 226 of file eeprom.h.

226 {
232 EEP_REG_0,
233 EEP_REG_1,
237 EEP_OB_5,
238 EEP_DB_5,
239 EEP_OB_2,
240 EEP_DB_2,
257 EEP_SWREG,
258 EEP_PAPRD,
262};
@ EEP_RXGAIN_TYPE
Definition eeprom.h:245
@ EEP_TXGAIN_TYPE
Definition eeprom.h:247
@ EEP_RC_CHAIN_MASK
Definition eeprom.h:248
@ EEP_PWR_TABLE_OFFSET
Definition eeprom.h:254
@ EEP_RF_SILENT
Definition eeprom.h:236
@ EEP_REG_0
Definition eeprom.h:232
@ EEP_DRIVE_STRENGTH
Definition eeprom.h:255
@ EEP_DEV_TYPE
Definition eeprom.h:251
@ EEP_MINOR_REV
Definition eeprom.h:241
@ EEP_SWREG
Definition eeprom.h:257
@ EEP_OP_CAP
Definition eeprom.h:234
@ EEP_OB_2
Definition eeprom.h:239
@ EEP_MAC_MSW
Definition eeprom.h:229
@ EEP_MODAL_VER
Definition eeprom.h:259
@ EEP_FRAC_N_5G
Definition eeprom.h:250
@ EEP_NFTHRESH_5
Definition eeprom.h:227
@ EEP_OB_5
Definition eeprom.h:237
@ EEP_DB_2
Definition eeprom.h:240
@ EEP_DAC_HPWR_5G
Definition eeprom.h:249
@ EEP_TEMPSENSE_SLOPE
Definition eeprom.h:252
@ EEP_RX_MASK
Definition eeprom.h:243
@ EEP_MAC_LSW
Definition eeprom.h:231
@ EEP_INTERNAL_REGULATOR
Definition eeprom.h:256
@ EEP_MAC_MID
Definition eeprom.h:230
@ EEP_FSTCLK_5G
Definition eeprom.h:244
@ EEP_PAPRD
Definition eeprom.h:258
@ EEP_OP_MODE
Definition eeprom.h:235
@ EEP_NFTHRESH_2
Definition eeprom.h:228
@ EEP_TX_MASK
Definition eeprom.h:242
@ EEP_REG_1
Definition eeprom.h:233
@ EEP_DB_5
Definition eeprom.h:238
@ EEP_TEMPSENSE_SLOPE_PAL_ON
Definition eeprom.h:253
@ EEP_ANT_DIV_CTL1
Definition eeprom.h:260
@ EEP_CHAIN_MASK_REDUCE
Definition eeprom.h:261

◆ ar5416_rates

Enumerator
rate6mb 
rate9mb 
rate12mb 
rate18mb 
rate24mb 
rate36mb 
rate48mb 
rate54mb 
rate1l 
rate2l 
rate2s 
rate5_5l 
rate5_5s 
rate11l 
rate11s 
rateXr 
rateHt20_0 
rateHt20_1 
rateHt20_2 
rateHt20_3 
rateHt20_4 
rateHt20_5 
rateHt20_6 
rateHt20_7 
rateHt40_0 
rateHt40_1 
rateHt40_2 
rateHt40_3 
rateHt40_4 
rateHt40_5 
rateHt40_6 
rateHt40_7 
rateDupCck 
rateDupOfdm 
rateExtCck 
rateExtOfdm 
Ar5416RateSize 

Definition at line 264 of file eeprom.h.

264 {
275};
@ Ar5416RateSize
Definition eeprom.h:274
@ rateHt20_5
Definition eeprom.h:270
@ rateHt40_2
Definition eeprom.h:271
@ rateExtCck
Definition eeprom.h:273
@ rate5_5s
Definition eeprom.h:268
@ rateHt20_4
Definition eeprom.h:270
@ rate48mb
Definition eeprom.h:266
@ rate12mb
Definition eeprom.h:265
@ rateExtOfdm
Definition eeprom.h:273
@ rate9mb
Definition eeprom.h:265
@ rateDupCck
Definition eeprom.h:273
@ rateHt40_4
Definition eeprom.h:272
@ rateDupOfdm
Definition eeprom.h:273
@ rate18mb
Definition eeprom.h:265
@ rateHt20_3
Definition eeprom.h:269
@ rateHt20_7
Definition eeprom.h:270
@ rateHt40_7
Definition eeprom.h:272
@ rate11l
Definition eeprom.h:268
@ rateHt20_0
Definition eeprom.h:269
@ rateHt40_6
Definition eeprom.h:272
@ rate6mb
Definition eeprom.h:265
@ rate36mb
Definition eeprom.h:266
@ rate5_5l
Definition eeprom.h:267
@ rate1l
Definition eeprom.h:267
@ rate54mb
Definition eeprom.h:266
@ rate24mb
Definition eeprom.h:266
@ rateHt40_1
Definition eeprom.h:271
@ rateHt20_1
Definition eeprom.h:269
@ rate2s
Definition eeprom.h:267
@ rateHt40_5
Definition eeprom.h:272
@ rateHt20_2
Definition eeprom.h:269
@ rate11s
Definition eeprom.h:268
@ rate2l
Definition eeprom.h:267
@ rateHt40_0
Definition eeprom.h:271
@ rateXr
Definition eeprom.h:268
@ rateHt20_6
Definition eeprom.h:270
@ rateHt40_3
Definition eeprom.h:271

◆ ath9k_hal_freq_band

Enumerator
ATH9K_HAL_FREQ_BAND_5GHZ 
ATH9K_HAL_FREQ_BAND_2GHZ 

Definition at line 277 of file eeprom.h.

277 {
280};
@ ATH9K_HAL_FREQ_BAND_2GHZ
Definition eeprom.h:279
@ ATH9K_HAL_FREQ_BAND_5GHZ
Definition eeprom.h:278

◆ reg_ext_bitmap

Enumerator
REG_EXT_FCC_MIDBAND 
REG_EXT_JAPAN_MIDBAND 
REG_EXT_FCC_DFS_HT40 
REG_EXT_JAPAN_NONDFS_HT40 
REG_EXT_JAPAN_DFS_HT40 

Definition at line 636 of file eeprom.h.

636 {
642};
@ REG_EXT_JAPAN_NONDFS_HT40
Definition eeprom.h:640
@ REG_EXT_JAPAN_DFS_HT40
Definition eeprom.h:641
@ REG_EXT_JAPAN_MIDBAND
Definition eeprom.h:638
@ REG_EXT_FCC_MIDBAND
Definition eeprom.h:637
@ REG_EXT_FCC_DFS_HT40
Definition eeprom.h:639

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( BSD2 )

◆ FILE_SECBOOT()

FILE_SECBOOT ( FORBIDDEN )

◆ ath9k_hw_analog_shift_regwrite()

void ath9k_hw_analog_shift_regwrite ( struct ath_hw * ah,
u32 reg,
u32 val )

Definition at line 34 of file ath9k_eeprom.c.

35{
37
38 if (ah->config.analog_shiftreg)
39 udelay(100);
40}
#define REG_WRITE(_ah, _reg, _val)
Definition hw.h:78
void __asmcall int val
Definition setjmp.h:12
static unsigned int unsigned int reg
Definition myson.h:162
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
Definition timer.c:61

References ah, reg, REG_WRITE, u32, udelay(), and val.

Referenced by ath9k_hw_ar9287_set_board_values().

◆ ath9k_hw_analog_shift_rmw()

void ath9k_hw_analog_shift_rmw ( struct ath_hw * ah,
u32 reg,
u32 mask,
u32 shift,
u32 val )

Definition at line 42 of file ath9k_eeprom.c.

44{
45 u32 regVal;
46
47 regVal = REG_READ(ah, reg) & ~mask;
48 regVal |= (val << shift) & mask;
49
50 REG_WRITE(ah, reg, regVal);
51
52 if (ah->config.analog_shiftreg)
53 udelay(100);
54}
#define REG_READ(_ah, _reg)
Definition hw.h:81
#define u32
Definition vga.h:21

References ah, reg, REG_READ, REG_WRITE, u32, udelay(), and val.

Referenced by ar9002_olc_init(), ath9k_hw_4k_set_board_values(), ath9k_hw_ar9287_set_board_values(), and ath9k_hw_def_set_board_values().

◆ ath9k_hw_interpolate()

int16_t ath9k_hw_interpolate ( u16 target,
u16 srcLeft,
u16 srcRight,
int16_t targetLeft,
int16_t targetRight )

Definition at line 56 of file ath9k_eeprom.c.

58{
59 int16_t rv;
60
61 if (srcRight == srcLeft) {
62 rv = targetLeft;
63 } else {
64 rv = (int16_t) (((target - srcLeft) * targetRight +
65 (srcRight - target) * targetLeft) /
66 (srcRight - srcLeft));
67 }
68 return rv;
69}
signed short int16_t
Definition stdint.h:16

References u16.

Referenced by ath9k_hw_get_gain_boundaries_pdadcs(), ath9k_hw_get_legacy_target_powers(), and ath9k_hw_get_target_powers().

◆ ath9k_hw_get_lower_upper_index()

int ath9k_hw_get_lower_upper_index ( u8 target,
u8 * pList,
u16 listSize,
u16 * indexL,
u16 * indexR )

Definition at line 71 of file ath9k_eeprom.c.

73{
74 u16 i;
75
76 if (target <= pList[0]) {
77 *indexL = *indexR = 0;
78 return 1;
79 }
80 if (target >= pList[listSize - 1]) {
81 *indexL = *indexR = (u16) (listSize - 1);
82 return 1;
83 }
84
85 for (i = 0; i < listSize - 1; i++) {
86 if (pList[i] == target) {
87 *indexL = *indexR = i;
88 return 1;
89 }
90 if (target < pList[i + 1]) {
91 *indexL = i;
92 *indexR = (u16) (i + 1);
93 return 0;
94 }
95 }
96 return 0;
97}
#define u16
Definition vga.h:20

References u16, and u8.

Referenced by ar9287_eeprom_get_tx_gain_index(), ath9k_get_txgain_index(), ath9k_hw_fill_vpd_table(), and ath9k_hw_get_gain_boundaries_pdadcs().

◆ ath9k_hw_nvram_read()

int ath9k_hw_nvram_read ( struct ath_common * common,
u32 off,
u16 * data )

Definition at line 131 of file ath9k_eeprom.c.

132{
133 return common->bus_ops->eeprom_read(common, off, data);
134}
uint8_t data[48]
Additional event data.
Definition ena.h:11
struct ib_cm_common common
Definition ib_mad.h:0

References common, data, u16, and u32.

Referenced by __ath9k_hw_4k_fill_eeprom(), __ath9k_hw_ar9287_fill_eeprom(), __ath9k_hw_def_fill_eeprom(), ar9300_eeprom_read_byte(), ar9300_eeprom_read_word(), ar9300_eeprom_restore_flash(), ath9k_hw_4k_check_eeprom(), ath9k_hw_ar9287_check_eeprom(), and ath9k_hw_def_check_eeprom().

◆ ath9k_hw_usb_gen_fill_eeprom()

void ath9k_hw_usb_gen_fill_eeprom ( struct ath_hw * ah,
u16 * eep_data,
int eep_start_loc,
int size )

Definition at line 99 of file ath9k_eeprom.c.

101{
102 int i = 0, j, addr;
103 u32 addrdata[8];
104 u32 data[8];
105
106 for (addr = 0; addr < size; addr++) {
107 addrdata[i] = AR5416_EEPROM_OFFSET +
108 ((addr + eep_start_loc) << AR5416_EEPROM_S);
109 i++;
110 if (i == 8) {
111 REG_READ_MULTI(ah, addrdata, data, i);
112
113 for (j = 0; j < i; j++) {
114 *eep_data = data[j];
115 eep_data++;
116 }
117 i = 0;
118 }
119 }
120
121 if (i != 0) {
122 REG_READ_MULTI(ah, addrdata, data, i);
123
124 for (j = 0; j < i; j++) {
125 *eep_data = data[j];
126 eep_data++;
127 }
128 }
129}
#define AR5416_EEPROM_OFFSET
Definition eeprom.h:62
#define AR5416_EEPROM_S
Definition eeprom.h:61
uint32_t addr
Buffer address.
Definition dwmac.h:9
uint16_t size
Buffer size.
Definition dwmac.h:3
#define REG_READ_MULTI(_ah, _addr, _val, _cnt)
Definition hw.h:84

References addr, ah, AR5416_EEPROM_OFFSET, AR5416_EEPROM_S, data, REG_READ_MULTI, size, u16, and u32.

Referenced by __ath9k_hw_usb_4k_fill_eeprom(), __ath9k_hw_usb_ar9287_fill_eeprom(), and __ath9k_hw_usb_def_fill_eeprom().

◆ ath9k_hw_fill_vpd_table()

void ath9k_hw_fill_vpd_table ( u8 pwrMin,
u8 pwrMax,
u8 * pPwrList,
u8 * pVpdList,
u16 numIntercepts,
u8 * pRetVpdList )

Definition at line 136 of file ath9k_eeprom.c.

139{
140 u16 i, k;
141 u8 currPwr = pwrMin;
142 u16 idxL = 0, idxR = 0;
143
144 for (i = 0; i <= (pwrMax - pwrMin) / 2; i++) {
145 ath9k_hw_get_lower_upper_index(currPwr, pPwrList,
146 numIntercepts, &(idxL),
147 &(idxR));
148 if (idxR < 1)
149 idxR = 1;
150 if (idxL == numIntercepts - 1)
151 idxL = (u16) (numIntercepts - 2);
152 if (pPwrList[idxL] == pPwrList[idxR])
153 k = pVpdList[idxL];
154 else
155 k = (u16)(((currPwr - pPwrList[idxL]) * pVpdList[idxR] +
156 (pPwrList[idxR] - currPwr) * pVpdList[idxL]) /
157 (pPwrList[idxR] - pPwrList[idxL]));
158 pRetVpdList[i] = (u8) k;
159 currPwr += 2;
160 }
161}
int ath9k_hw_get_lower_upper_index(u8 target, u8 *pList, u16 listSize, u16 *indexL, u16 *indexR)
#define u8
Definition igbvf_osdep.h:40
static const uint32_t k[64]
MD5 constants.
Definition md5.c:54

References ath9k_hw_get_lower_upper_index(), k, u16, and u8.

Referenced by ath9k_hw_get_gain_boundaries_pdadcs().

◆ ath9k_hw_get_legacy_target_powers()

void ath9k_hw_get_legacy_target_powers ( struct ath_hw * ah,
struct ath9k_channel * chan,
struct cal_target_power_leg * powInfo,
u16 numChannels,
struct cal_target_power_leg * pNewPower,
u16 numRates,
int isExtTarget )

Definition at line 163 of file ath9k_eeprom.c.

169{
170 struct chan_centers centers;
171 u16 clo, chi;
172 int i;
173 int matchIndex = -1, lowIndex = -1;
174 u16 freq;
175
176 ath9k_hw_get_channel_centers(ah, chan, &centers);
177 freq = (isExtTarget) ? centers.ext_center : centers.ctl_center;
178
179 if (freq <= ath9k_hw_fbin2freq(powInfo[0].bChannel,
180 IS_CHAN_2GHZ(chan))) {
181 matchIndex = 0;
182 } else {
183 for (i = 0; (i < numChannels) &&
184 (powInfo[i].bChannel != AR5416_BCHAN_UNUSED); i++) {
185 if (freq == ath9k_hw_fbin2freq(powInfo[i].bChannel,
186 IS_CHAN_2GHZ(chan))) {
187 matchIndex = i;
188 break;
189 } else if (freq < ath9k_hw_fbin2freq(powInfo[i].bChannel,
190 IS_CHAN_2GHZ(chan)) && i > 0 &&
191 freq > ath9k_hw_fbin2freq(powInfo[i - 1].bChannel,
192 IS_CHAN_2GHZ(chan))) {
193 lowIndex = i - 1;
194 break;
195 }
196 }
197 if ((matchIndex == -1) && (lowIndex == -1))
198 matchIndex = i - 1;
199 }
200
201 if (matchIndex != -1) {
202 *pNewPower = powInfo[matchIndex];
203 } else {
204 clo = ath9k_hw_fbin2freq(powInfo[lowIndex].bChannel,
205 IS_CHAN_2GHZ(chan));
206 chi = ath9k_hw_fbin2freq(powInfo[lowIndex + 1].bChannel,
207 IS_CHAN_2GHZ(chan));
208
209 for (i = 0; i < numRates; i++) {
210 pNewPower->tPow2x[i] =
211 (u8)ath9k_hw_interpolate(freq, clo, chi,
212 powInfo[lowIndex].tPow2x[i],
213 powInfo[lowIndex + 1].tPow2x[i]);
214 }
215 }
216}
u8 tPow2x[4]
#define AR5416_BCHAN_UNUSED
Definition eeprom.h:158
static u16 ath9k_hw_fbin2freq(u8 fbin, int is2GHz)
int16_t ath9k_hw_interpolate(u16 target, u16 srcLeft, u16 srcRight, int16_t targetLeft, int16_t targetRight)
void ath9k_hw_get_channel_centers(struct ath_hw *ah __unused, struct ath9k_channel *chan, struct chan_centers *centers)
Definition ath9k_hw.c:191
#define IS_CHAN_2GHZ(_c)
Definition hw.h:362
u16 ctl_center
Definition hw.h:424

References ah, AR5416_BCHAN_UNUSED, ath9k_hw_fbin2freq(), ath9k_hw_get_channel_centers(), ath9k_hw_interpolate(), cal_target_power_leg::bChannel, chan_centers::ctl_center, chan_centers::ext_center, IS_CHAN_2GHZ, cal_target_power_leg::tPow2x, tPow2x, u16, and u8.

Referenced by ath9k_hw_set_4k_power_per_rate_table(), ath9k_hw_set_ar9287_power_per_rate_table(), and ath9k_hw_set_def_power_per_rate_table().

◆ ath9k_hw_get_target_powers()

void ath9k_hw_get_target_powers ( struct ath_hw * ah,
struct ath9k_channel * chan,
struct cal_target_power_ht * powInfo,
u16 numChannels,
struct cal_target_power_ht * pNewPower,
u16 numRates,
int isHt40Target )

Definition at line 218 of file ath9k_eeprom.c.

224{
225 struct chan_centers centers;
226 u16 clo, chi;
227 int i;
228 int matchIndex = -1, lowIndex = -1;
229 u16 freq;
230
231 ath9k_hw_get_channel_centers(ah, chan, &centers);
232 freq = isHt40Target ? centers.synth_center : centers.ctl_center;
233
234 if (freq <= ath9k_hw_fbin2freq(powInfo[0].bChannel, IS_CHAN_2GHZ(chan))) {
235 matchIndex = 0;
236 } else {
237 for (i = 0; (i < numChannels) &&
238 (powInfo[i].bChannel != AR5416_BCHAN_UNUSED); i++) {
239 if (freq == ath9k_hw_fbin2freq(powInfo[i].bChannel,
240 IS_CHAN_2GHZ(chan))) {
241 matchIndex = i;
242 break;
243 } else
244 if (freq < ath9k_hw_fbin2freq(powInfo[i].bChannel,
245 IS_CHAN_2GHZ(chan)) && i > 0 &&
246 freq > ath9k_hw_fbin2freq(powInfo[i - 1].bChannel,
247 IS_CHAN_2GHZ(chan))) {
248 lowIndex = i - 1;
249 break;
250 }
251 }
252 if ((matchIndex == -1) && (lowIndex == -1))
253 matchIndex = i - 1;
254 }
255
256 if (matchIndex != -1) {
257 *pNewPower = powInfo[matchIndex];
258 } else {
259 clo = ath9k_hw_fbin2freq(powInfo[lowIndex].bChannel,
260 IS_CHAN_2GHZ(chan));
261 chi = ath9k_hw_fbin2freq(powInfo[lowIndex + 1].bChannel,
262 IS_CHAN_2GHZ(chan));
263
264 for (i = 0; i < numRates; i++) {
265 pNewPower->tPow2x[i] = (u8)ath9k_hw_interpolate(freq,
266 clo, chi,
267 powInfo[lowIndex].tPow2x[i],
268 powInfo[lowIndex + 1].tPow2x[i]);
269 }
270 }
271}

References ah, AR5416_BCHAN_UNUSED, ath9k_hw_fbin2freq(), ath9k_hw_get_channel_centers(), ath9k_hw_interpolate(), cal_target_power_ht::bChannel, chan_centers::ctl_center, IS_CHAN_2GHZ, chan_centers::synth_center, cal_target_power_ht::tPow2x, tPow2x, u16, and u8.

Referenced by ath9k_hw_set_4k_power_per_rate_table(), ath9k_hw_set_ar9287_power_per_rate_table(), and ath9k_hw_set_def_power_per_rate_table().

◆ ath9k_hw_get_max_edge_power()

u16 ath9k_hw_get_max_edge_power ( u16 freq,
struct cal_ctl_edges * pRdEdgesPower,
int is2GHz,
int num_band_edges )

Definition at line 273 of file ath9k_eeprom.c.

275{
276 u16 twiceMaxEdgePower = MAX_RATE_POWER;
277 int i;
278
279 for (i = 0; (i < num_band_edges) &&
280 (pRdEdgesPower[i].bChannel != AR5416_BCHAN_UNUSED); i++) {
281 if (freq == ath9k_hw_fbin2freq(pRdEdgesPower[i].bChannel, is2GHz)) {
282 twiceMaxEdgePower = CTL_EDGE_TPOWER(pRdEdgesPower[i].ctl);
283 break;
284 } else if ((i > 0) &&
285 (freq < ath9k_hw_fbin2freq(pRdEdgesPower[i].bChannel,
286 is2GHz))) {
287 if (ath9k_hw_fbin2freq(pRdEdgesPower[i - 1].bChannel,
288 is2GHz) < freq &&
289 CTL_EDGE_FLAGS(pRdEdgesPower[i - 1].ctl)) {
290 twiceMaxEdgePower =
291 CTL_EDGE_TPOWER(pRdEdgesPower[i - 1].ctl);
292 }
293 break;
294 }
295 }
296
297 return twiceMaxEdgePower;
298}
#define CTL_EDGE_TPOWER(_ctl)
Definition eeprom.h:214
#define CTL_EDGE_FLAGS(_ctl)
Definition eeprom.h:215
#define MAX_RATE_POWER
Definition hw.h:145

References AR5416_BCHAN_UNUSED, ath9k_hw_fbin2freq(), cal_ctl_edges::bChannel, CTL_EDGE_FLAGS, CTL_EDGE_TPOWER, MAX_RATE_POWER, and u16.

Referenced by ath9k_hw_set_4k_power_per_rate_table(), ath9k_hw_set_ar9287_power_per_rate_table(), and ath9k_hw_set_def_power_per_rate_table().

◆ ath9k_hw_update_regulatory_maxpower()

void ath9k_hw_update_regulatory_maxpower ( struct ath_hw * ah)

Definition at line 300 of file ath9k_eeprom.c.

301{
302 struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
303
304 switch (ar5416_get_ntxchains(ah->txchainmask)) {
305 case 1:
306 break;
307 case 2:
309 break;
310 case 3:
312 break;
313 default:
314 DBG2("ath9k: "
315 "Invalid chainmask configuration\n");
316 break;
317 }
318}
#define ar5416_get_ntxchains(_txchainmask)
Definition eeprom.h:707
#define INCREASE_MAXPOW_BY_THREE_CHAIN
Definition eeprom.h:88
#define INCREASE_MAXPOW_BY_TWO_CHAIN
Definition eeprom.h:87
#define DBG2(...)
Definition compiler.h:515
static struct ath_regulatory * ath9k_hw_regulatory(struct ath_hw *ah)
Definition hw.h:875
u16 max_power_level
Definition ath.h:141

References ah, ar5416_get_ntxchains, ath9k_hw_regulatory(), DBG2, INCREASE_MAXPOW_BY_THREE_CHAIN, INCREASE_MAXPOW_BY_TWO_CHAIN, and ath_regulatory::max_power_level.

◆ ath9k_hw_eeprom_init()

int ath9k_hw_eeprom_init ( struct ath_hw * ah)

Definition at line 532 of file ath9k_eeprom.c.

533{
534 int status;
535
537 ah->eep_ops = &eep_ar9300_ops;
538 else if (AR_SREV_9287(ah)) {
539 ah->eep_ops = &eep_ar9287_ops;
540 } else if (AR_SREV_9285(ah) || AR_SREV_9271(ah)) {
541 ah->eep_ops = &eep_4k_ops;
542 } else {
543 ah->eep_ops = &eep_def_ops;
544 }
545
546 if (!ah->eep_ops->fill_eeprom(ah))
547 return -EIO;
548
549 status = ah->eep_ops->check_eeprom(ah);
550
551 return status;
552}
#define AR_SREV_9287(_ah)
Definition reg.h:835
#define AR_SREV_9285(_ah)
Definition reg.h:830
#define AR_SREV_9271(_ah)
Definition reg.h:854
#define AR_SREV_9300_20_OR_LATER(_ah)
Definition reg.h:865
const struct eeprom_ops eep_ar9300_ops
const struct eeprom_ops eep_4k_ops
const struct eeprom_ops eep_ar9287_ops
const struct eeprom_ops eep_def_ops
uint8_t status
Status.
Definition ena.h:5
#define EIO
Input/output error.
Definition errno.h:434

References ah, AR_SREV_9271, AR_SREV_9285, AR_SREV_9287, AR_SREV_9300_20_OR_LATER, eep_4k_ops, eep_ar9287_ops, eep_ar9300_ops, eep_def_ops, EIO, and status.

Referenced by ath9k_hw_post_init().

◆ ath9k_hw_get_gain_boundaries_pdadcs()

void ath9k_hw_get_gain_boundaries_pdadcs ( struct ath_hw * ah,
struct ath9k_channel * chan,
void * pRawDataSet,
u8 * bChans,
u16 availPiers,
u16 tPdGainOverlap,
u16 * pPdGainBoundaries,
u8 * pPDADCValues,
u16 numXpdGains )

Definition at line 320 of file ath9k_eeprom.c.

327{
328 int i, j, k;
329 int16_t ss;
330 u16 idxL = 0, idxR = 0, numPiers;
331 static u8 vpdTableL[AR5416_NUM_PD_GAINS]
333 static u8 vpdTableR[AR5416_NUM_PD_GAINS]
335 static u8 vpdTableI[AR5416_NUM_PD_GAINS]
337
338 u8 *pVpdL, *pVpdR, *pPwrL, *pPwrR;
339 u8 minPwrT4[AR5416_NUM_PD_GAINS];
340 u8 maxPwrT4[AR5416_NUM_PD_GAINS];
341 int16_t vpdStep;
342 int16_t tmpVal;
343 u16 sizeCurrVpdTable, maxIndex, tgtIndex;
344 int match;
345 int16_t minDelta = 0;
346 struct chan_centers centers;
347 int pdgain_boundary_default;
348 struct cal_data_per_freq *data_def = pRawDataSet;
349 struct cal_data_per_freq_4k *data_4k = pRawDataSet;
350 struct cal_data_per_freq_ar9287 *data_9287 = pRawDataSet;
351 int eeprom_4k = AR_SREV_9285(ah) || AR_SREV_9271(ah);
352 int intercepts;
353
354 if (AR_SREV_9287(ah))
355 intercepts = AR9287_PD_GAIN_ICEPTS;
356 else
357 intercepts = AR5416_PD_GAIN_ICEPTS;
358
359 memset(&minPwrT4, 0, AR5416_NUM_PD_GAINS);
360 ath9k_hw_get_channel_centers(ah, chan, &centers);
361
362 for (numPiers = 0; numPiers < availPiers; numPiers++) {
363 if (bChans[numPiers] == AR5416_BCHAN_UNUSED)
364 break;
365 }
366
367 match = ath9k_hw_get_lower_upper_index((u8)FREQ2FBIN(centers.synth_center,
368 IS_CHAN_2GHZ(chan)),
369 bChans, numPiers, &idxL, &idxR);
370
371 if (match) {
372 if (AR_SREV_9287(ah)) {
373 for (i = 0; i < numXpdGains; i++) {
374 minPwrT4[i] = data_9287[idxL].pwrPdg[i][0];
375 maxPwrT4[i] = data_9287[idxL].pwrPdg[i][intercepts - 1];
376 ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
377 data_9287[idxL].pwrPdg[i],
378 data_9287[idxL].vpdPdg[i],
379 intercepts,
380 vpdTableI[i]);
381 }
382 } else if (eeprom_4k) {
383 for (i = 0; i < numXpdGains; i++) {
384 minPwrT4[i] = data_4k[idxL].pwrPdg[i][0];
385 maxPwrT4[i] = data_4k[idxL].pwrPdg[i][intercepts - 1];
386 ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
387 data_4k[idxL].pwrPdg[i],
388 data_4k[idxL].vpdPdg[i],
389 intercepts,
390 vpdTableI[i]);
391 }
392 } else {
393 for (i = 0; i < numXpdGains; i++) {
394 minPwrT4[i] = data_def[idxL].pwrPdg[i][0];
395 maxPwrT4[i] = data_def[idxL].pwrPdg[i][intercepts - 1];
396 ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
397 data_def[idxL].pwrPdg[i],
398 data_def[idxL].vpdPdg[i],
399 intercepts,
400 vpdTableI[i]);
401 }
402 }
403 } else {
404 for (i = 0; i < numXpdGains; i++) {
405 if (AR_SREV_9287(ah)) {
406 pVpdL = data_9287[idxL].vpdPdg[i];
407 pPwrL = data_9287[idxL].pwrPdg[i];
408 pVpdR = data_9287[idxR].vpdPdg[i];
409 pPwrR = data_9287[idxR].pwrPdg[i];
410 } else if (eeprom_4k) {
411 pVpdL = data_4k[idxL].vpdPdg[i];
412 pPwrL = data_4k[idxL].pwrPdg[i];
413 pVpdR = data_4k[idxR].vpdPdg[i];
414 pPwrR = data_4k[idxR].pwrPdg[i];
415 } else {
416 pVpdL = data_def[idxL].vpdPdg[i];
417 pPwrL = data_def[idxL].pwrPdg[i];
418 pVpdR = data_def[idxR].vpdPdg[i];
419 pPwrR = data_def[idxR].pwrPdg[i];
420 }
421
422 minPwrT4[i] = max(pPwrL[0], pPwrR[0]);
423
424 maxPwrT4[i] =
425 min(pPwrL[intercepts - 1],
426 pPwrR[intercepts - 1]);
427
428
429 ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
430 pPwrL, pVpdL,
431 intercepts,
432 vpdTableL[i]);
433 ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i],
434 pPwrR, pVpdR,
435 intercepts,
436 vpdTableR[i]);
437
438 for (j = 0; j <= (maxPwrT4[i] - minPwrT4[i]) / 2; j++) {
439 vpdTableI[i][j] =
441 FREQ2FBIN(centers.
442 synth_center,
444 (chan)),
445 bChans[idxL], bChans[idxR],
446 vpdTableL[i][j], vpdTableR[i][j]));
447 }
448 }
449 }
450
451 k = 0;
452
453 for (i = 0; i < numXpdGains; i++) {
454 if (i == (numXpdGains - 1))
455 pPdGainBoundaries[i] =
456 (u16)(maxPwrT4[i] / 2);
457 else
458 pPdGainBoundaries[i] =
459 (u16)((maxPwrT4[i] + minPwrT4[i + 1]) / 4);
460
461 pPdGainBoundaries[i] =
462 min((u16)MAX_RATE_POWER, pPdGainBoundaries[i]);
463
464 if ((i == 0) && !AR_SREV_5416_20_OR_LATER(ah)) {
465 minDelta = pPdGainBoundaries[0] - 23;
466 pPdGainBoundaries[0] = 23;
467 } else {
468 minDelta = 0;
469 }
470
471 if (i == 0) {
473 ss = (int16_t)(0 - (minPwrT4[i] / 2));
474 else
475 ss = 0;
476 } else {
477 ss = (int16_t)((pPdGainBoundaries[i - 1] -
478 (minPwrT4[i] / 2)) -
479 tPdGainOverlap + 1 + minDelta);
480 }
481 vpdStep = (int16_t)(vpdTableI[i][1] - vpdTableI[i][0]);
482 vpdStep = (int16_t)((vpdStep < 1) ? 1 : vpdStep);
483
484 while ((ss < 0) && (k < (AR5416_NUM_PDADC_VALUES - 1))) {
485 tmpVal = (int16_t)(vpdTableI[i][0] + ss * vpdStep);
486 pPDADCValues[k++] = (u8)((tmpVal < 0) ? 0 : tmpVal);
487 ss++;
488 }
489
490 sizeCurrVpdTable = (u8) ((maxPwrT4[i] - minPwrT4[i]) / 2 + 1);
491 tgtIndex = (u8)(pPdGainBoundaries[i] + tPdGainOverlap -
492 (minPwrT4[i] / 2));
493 maxIndex = (tgtIndex < sizeCurrVpdTable) ?
494 tgtIndex : sizeCurrVpdTable;
495
496 while ((ss < maxIndex) && (k < (AR5416_NUM_PDADC_VALUES - 1))) {
497 pPDADCValues[k++] = vpdTableI[i][ss++];
498 }
499
500 vpdStep = (int16_t)(vpdTableI[i][sizeCurrVpdTable - 1] -
501 vpdTableI[i][sizeCurrVpdTable - 2]);
502 vpdStep = (int16_t)((vpdStep < 1) ? 1 : vpdStep);
503
504 if (tgtIndex >= maxIndex) {
505 while ((ss <= tgtIndex) &&
506 (k < (AR5416_NUM_PDADC_VALUES - 1))) {
507 tmpVal = (int16_t)((vpdTableI[i][sizeCurrVpdTable - 1] +
508 (ss - maxIndex + 1) * vpdStep));
509 pPDADCValues[k++] = (u8)((tmpVal > 255) ?
510 255 : tmpVal);
511 ss++;
512 }
513 }
514 }
515
516 if (eeprom_4k)
517 pdgain_boundary_default = 58;
518 else
519 pdgain_boundary_default = pPdGainBoundaries[i - 1];
520
521 while (i < AR5416_PD_GAINS_IN_MASK) {
522 pPdGainBoundaries[i] = pdgain_boundary_default;
523 i++;
524 }
525
526 while (k < AR5416_NUM_PDADC_VALUES) {
527 pPDADCValues[k] = pPDADCValues[k - 1];
528 k++;
529 }
530}
#define AR5416_PD_GAIN_ICEPTS
Definition eeprom.h:156
#define AR5416_NUM_PDADC_VALUES
Definition eeprom.h:157
#define FREQ2FBIN(x, y)
Definition eeprom.h:103
#define AR9287_PD_GAIN_ICEPTS
Definition eeprom.h:202
#define AR5416_NUM_PD_GAINS
Definition eeprom.h:154
#define AR5416_MAX_PWR_RANGE_IN_HALF_DB
Definition eeprom.h:159
#define AR5416_PD_GAINS_IN_MASK
Definition eeprom.h:155
#define AR_SREV_5416_20_OR_LATER(_ah)
Definition reg.h:802
void ath9k_hw_fill_vpd_table(u8 pwrMin, u8 pwrMax, u8 *pPwrList, u8 *pVpdList, u16 numIntercepts, u8 *pRetVpdList)
#define min(x, y)
Definition ath.h:36
#define max(x, y)
Definition ath.h:41
void * memset(void *dest, int character, size_t len) __nonnull
uint32_t ss
Definition librm.h:1
u8 pwrPdg[AR5416_EEP4K_NUM_PD_GAINS][AR5416_PD_GAIN_ICEPTS]
Definition eeprom.h:516
u8 vpdPdg[AR5416_EEP4K_NUM_PD_GAINS][AR5416_PD_GAIN_ICEPTS]
Definition eeprom.h:517
u8 pwrPdg[AR5416_NUM_PD_GAINS][AR9287_PD_GAIN_ICEPTS]
Definition eeprom.h:543
u8 vpdPdg[AR5416_NUM_PD_GAINS][AR9287_PD_GAIN_ICEPTS]
Definition eeprom.h:544
u8 vpdPdg[AR5416_NUM_PD_GAINS][AR5416_PD_GAIN_ICEPTS]
Definition eeprom.h:512
u8 pwrPdg[AR5416_NUM_PD_GAINS][AR5416_PD_GAIN_ICEPTS]
Definition eeprom.h:511

References ah, AR5416_BCHAN_UNUSED, AR5416_MAX_PWR_RANGE_IN_HALF_DB, AR5416_NUM_PD_GAINS, AR5416_NUM_PDADC_VALUES, AR5416_PD_GAIN_ICEPTS, AR5416_PD_GAINS_IN_MASK, AR9287_PD_GAIN_ICEPTS, AR_SREV_5416_20_OR_LATER, AR_SREV_9271, AR_SREV_9280_20_OR_LATER, AR_SREV_9285, AR_SREV_9287, ath9k_hw_fill_vpd_table(), ath9k_hw_get_channel_centers(), ath9k_hw_get_lower_upper_index(), ath9k_hw_interpolate(), FREQ2FBIN, IS_CHAN_2GHZ, k, max, MAX_RATE_POWER, memset(), min, cal_data_per_freq::pwrPdg, cal_data_per_freq_4k::pwrPdg, cal_data_per_freq_ar9287::pwrPdg, ss, chan_centers::synth_center, u16, u8, cal_data_per_freq::vpdPdg, cal_data_per_freq_4k::vpdPdg, and cal_data_per_freq_ar9287::vpdPdg.

Referenced by ath9k_hw_set_4k_power_cal_table(), ath9k_hw_set_ar9287_power_cal_table(), and ath9k_hw_set_def_power_cal_table().

Variable Documentation

◆ eep_def_ops

const struct eeprom_ops eep_def_ops
extern

Definition at line 1343 of file ath9k_eeprom_def.c.

1343 {
1344 .check_eeprom = ath9k_hw_def_check_eeprom,
1345 .get_eeprom = ath9k_hw_def_get_eeprom,
1346 .fill_eeprom = ath9k_hw_def_fill_eeprom,
1347 .get_eeprom_ver = ath9k_hw_def_get_eeprom_ver,
1348 .get_eeprom_rev = ath9k_hw_def_get_eeprom_rev,
1349 .set_board_values = ath9k_hw_def_set_board_values,
1350 .set_addac = ath9k_hw_def_set_addac,
1351 .set_txpower = ath9k_hw_def_set_txpower,
1352 .get_spur_channel = ath9k_hw_def_get_spur_channel
1353};
static void ath9k_hw_def_set_txpower(struct ath_hw *ah, struct ath9k_channel *chan, u16 cfgCtl, u8 twiceAntennaReduction, u8 twiceMaxRegulatoryPower, u8 powerLimit, int test)
static void ath9k_hw_def_set_board_values(struct ath_hw *ah, struct ath9k_channel *chan)
static u16 ath9k_hw_def_get_spur_channel(struct ath_hw *ah, u16 i, int is2GHz)
static int ath9k_hw_def_get_eeprom_rev(struct ath_hw *ah)
static int ath9k_hw_def_get_eeprom_ver(struct ath_hw *ah)
static u32 ath9k_hw_def_get_eeprom(struct ath_hw *ah, enum eeprom_param param)
static int ath9k_hw_def_fill_eeprom(struct ath_hw *ah)
static void ath9k_hw_def_set_addac(struct ath_hw *ah, struct ath9k_channel *chan)
static int ath9k_hw_def_check_eeprom(struct ath_hw *ah)

Referenced by ath9k_hw_eeprom_init().

◆ eep_4k_ops

const struct eeprom_ops eep_4k_ops
extern

Definition at line 1070 of file ath9k_eeprom_4k.c.

1070 {
1071 .check_eeprom = ath9k_hw_4k_check_eeprom,
1072 .get_eeprom = ath9k_hw_4k_get_eeprom,
1073 .fill_eeprom = ath9k_hw_4k_fill_eeprom,
1074 .get_eeprom_ver = ath9k_hw_4k_get_eeprom_ver,
1075 .get_eeprom_rev = ath9k_hw_4k_get_eeprom_rev,
1076 .set_board_values = ath9k_hw_4k_set_board_values,
1077 .set_addac = ath9k_hw_4k_set_addac,
1078 .set_txpower = ath9k_hw_4k_set_txpower,
1079 .get_spur_channel = ath9k_hw_4k_get_spur_channel
1080};
static int ath9k_hw_4k_fill_eeprom(struct ath_hw *ah)
static void ath9k_hw_4k_set_board_values(struct ath_hw *ah, struct ath9k_channel *chan)
static int ath9k_hw_4k_get_eeprom_rev(struct ath_hw *ah)
static u32 ath9k_hw_4k_get_eeprom(struct ath_hw *ah, enum eeprom_param param)
static u16 ath9k_hw_4k_get_spur_channel(struct ath_hw *ah, u16 i, int is2GHz)
static void ath9k_hw_4k_set_txpower(struct ath_hw *ah, struct ath9k_channel *chan, u16 cfgCtl, u8 twiceAntennaReduction, u8 twiceMaxRegulatoryPower, u8 powerLimit, int test)
static void ath9k_hw_4k_set_addac(struct ath_hw *ah, struct ath9k_channel *chan __unused)
static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah)
static int ath9k_hw_4k_get_eeprom_ver(struct ath_hw *ah)

Referenced by ath9k_hw_eeprom_init().

◆ eep_ar9287_ops

const struct eeprom_ops eep_ar9287_ops
extern

Definition at line 714 of file eeprom.h.

Referenced by ath9k_hw_eeprom_init().

◆ eep_ar9300_ops

const struct eeprom_ops eep_ar9300_ops
extern

Definition at line 4997 of file ath9k_ar9003_eeprom.c.

4997 {
4998 .check_eeprom = ath9k_hw_ar9300_check_eeprom,
4999 .get_eeprom = ath9k_hw_ar9300_get_eeprom,
5000 .fill_eeprom = ath9k_hw_ar9300_fill_eeprom,
5001 .get_eeprom_ver = ath9k_hw_ar9300_get_eeprom_ver,
5002 .get_eeprom_rev = ath9k_hw_ar9300_get_eeprom_rev,
5003 .set_board_values = ath9k_hw_ar9300_set_board_values,
5004 .set_addac = ath9k_hw_ar9300_set_addac,
5005 .set_txpower = ath9k_hw_ar9300_set_txpower,
5006 .get_spur_channel = ath9k_hw_ar9300_get_spur_channel
5007};
static u16 ath9k_hw_ar9300_get_spur_channel(struct ath_hw *ah __unused, u16 i __unused, int is2GHz __unused)
static int ath9k_hw_ar9300_fill_eeprom(struct ath_hw *ah)
static void ath9k_hw_ar9300_set_addac(struct ath_hw *ah __unused, struct ath9k_channel *chan __unused)
static void ath9k_hw_ar9300_set_board_values(struct ath_hw *ah, struct ath9k_channel *chan)
static int ath9k_hw_ar9300_get_eeprom_rev(struct ath_hw *ah __unused)
static int ath9k_hw_ar9300_get_eeprom_ver(struct ath_hw *ah)
static void ath9k_hw_ar9300_set_txpower(struct ath_hw *ah, struct ath9k_channel *chan, u16 cfgCtl, u8 twiceAntennaReduction, u8 twiceMaxRegulatoryPower, u8 powerLimit, int test)
static u32 ath9k_hw_ar9300_get_eeprom(struct ath_hw *ah, enum eeprom_param param)
static int ath9k_hw_ar9300_check_eeprom(struct ath_hw *ah __unused)

Referenced by ath9k_hw_eeprom_init().