iPXE
Data Structures | Macros | Enumerations | Functions | Variables
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   0xa55a
 
#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)   (((_r) & 0x3f) << (_s))
 
#define FREQ2FBIN(x, y)   ((y) ? ((x) - 2300) : (((x) - 4800) / 5))
 
#define ath9k_hw_use_flash(_ah)   (!(_ah->ah_flags & AH_USE_EEPROM))
 
#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)   ((_ctl) & 0x3f)
 
#define CTL_EDGE_FLAGS(_ctl)   (((_ctl) >> 6) & 0x03)
 
#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)
 
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

#define AR_EEPROM_MODAL_SPURS   5

Definition at line 25 of file eeprom.h.

◆ AR5416_EEPROM_MAGIC

#define AR5416_EEPROM_MAGIC   0xa55a

Definition at line 33 of file eeprom.h.

◆ CTRY_DEBUG

#define CTRY_DEBUG   0x1ff

Definition at line 36 of file eeprom.h.

◆ CTRY_DEFAULT

#define CTRY_DEFAULT   0

Definition at line 37 of file eeprom.h.

◆ AR_EEPROM_EEPCAP_COMPRESS_DIS

#define AR_EEPROM_EEPCAP_COMPRESS_DIS   0x0001

Definition at line 39 of file eeprom.h.

◆ AR_EEPROM_EEPCAP_AES_DIS

#define AR_EEPROM_EEPCAP_AES_DIS   0x0002

Definition at line 40 of file eeprom.h.

◆ AR_EEPROM_EEPCAP_FASTFRAME_DIS

#define AR_EEPROM_EEPCAP_FASTFRAME_DIS   0x0004

Definition at line 41 of file eeprom.h.

◆ AR_EEPROM_EEPCAP_BURST_DIS

#define AR_EEPROM_EEPCAP_BURST_DIS   0x0008

Definition at line 42 of file eeprom.h.

◆ AR_EEPROM_EEPCAP_MAXQCU

#define AR_EEPROM_EEPCAP_MAXQCU   0x01F0

Definition at line 43 of file eeprom.h.

◆ AR_EEPROM_EEPCAP_MAXQCU_S

#define AR_EEPROM_EEPCAP_MAXQCU_S   4

Definition at line 44 of file eeprom.h.

◆ AR_EEPROM_EEPCAP_HEAVY_CLIP_EN

#define AR_EEPROM_EEPCAP_HEAVY_CLIP_EN   0x0200

Definition at line 45 of file eeprom.h.

◆ AR_EEPROM_EEPCAP_KC_ENTRIES

#define AR_EEPROM_EEPCAP_KC_ENTRIES   0xF000

Definition at line 46 of file eeprom.h.

◆ AR_EEPROM_EEPCAP_KC_ENTRIES_S

#define AR_EEPROM_EEPCAP_KC_ENTRIES_S   12

Definition at line 47 of file eeprom.h.

◆ AR_EEPROM_EEREGCAP_EN_FCC_MIDBAND

#define AR_EEPROM_EEREGCAP_EN_FCC_MIDBAND   0x0040

Definition at line 49 of file eeprom.h.

◆ AR_EEPROM_EEREGCAP_EN_KK_U1_EVEN

#define AR_EEPROM_EEREGCAP_EN_KK_U1_EVEN   0x0080

Definition at line 50 of file eeprom.h.

◆ AR_EEPROM_EEREGCAP_EN_KK_U2

#define AR_EEPROM_EEREGCAP_EN_KK_U2   0x0100

Definition at line 51 of file eeprom.h.

◆ AR_EEPROM_EEREGCAP_EN_KK_MIDBAND

#define AR_EEPROM_EEREGCAP_EN_KK_MIDBAND   0x0200

Definition at line 52 of file eeprom.h.

◆ AR_EEPROM_EEREGCAP_EN_KK_U1_ODD

#define AR_EEPROM_EEREGCAP_EN_KK_U1_ODD   0x0400

Definition at line 53 of file eeprom.h.

◆ AR_EEPROM_EEREGCAP_EN_KK_NEW_11A

#define AR_EEPROM_EEREGCAP_EN_KK_NEW_11A   0x0800

Definition at line 54 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 56 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 57 of file eeprom.h.

◆ AR5416_EEPROM_MAGIC_OFFSET

#define AR5416_EEPROM_MAGIC_OFFSET   0x0

Definition at line 59 of file eeprom.h.

◆ AR5416_EEPROM_S

#define AR5416_EEPROM_S   2

Definition at line 60 of file eeprom.h.

◆ AR5416_EEPROM_OFFSET

#define AR5416_EEPROM_OFFSET   0x2000

Definition at line 61 of file eeprom.h.

◆ AR5416_EEPROM_MAX

#define AR5416_EEPROM_MAX   0xae0

Definition at line 62 of file eeprom.h.

◆ AR5416_EEPROM_START_ADDR

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

Definition at line 64 of file eeprom.h.

◆ SD_NO_CTL

#define SD_NO_CTL   0xE0

Definition at line 67 of file eeprom.h.

◆ NO_CTL

#define NO_CTL   0xff

Definition at line 68 of file eeprom.h.

◆ CTL_MODE_M

#define CTL_MODE_M   0xf

Definition at line 69 of file eeprom.h.

◆ CTL_11A

#define CTL_11A   0

Definition at line 70 of file eeprom.h.

◆ CTL_11B

#define CTL_11B   1

Definition at line 71 of file eeprom.h.

◆ CTL_11G

#define CTL_11G   2

Definition at line 72 of file eeprom.h.

◆ CTL_2GHT20

#define CTL_2GHT20   5

Definition at line 73 of file eeprom.h.

◆ CTL_5GHT20

#define CTL_5GHT20   6

Definition at line 74 of file eeprom.h.

◆ CTL_2GHT40

#define CTL_2GHT40   7

Definition at line 75 of file eeprom.h.

◆ CTL_5GHT40

#define CTL_5GHT40   8

Definition at line 76 of file eeprom.h.

◆ EXT_ADDITIVE

#define EXT_ADDITIVE   (0x8000)

Definition at line 78 of file eeprom.h.

◆ CTL_11A_EXT

#define CTL_11A_EXT   (CTL_11A | EXT_ADDITIVE)

Definition at line 79 of file eeprom.h.

◆ CTL_11G_EXT

#define CTL_11G_EXT   (CTL_11G | EXT_ADDITIVE)

Definition at line 80 of file eeprom.h.

◆ CTL_11B_EXT

#define CTL_11B_EXT   (CTL_11B | EXT_ADDITIVE)

Definition at line 81 of file eeprom.h.

◆ SUB_NUM_CTL_MODES_AT_5G_40

#define SUB_NUM_CTL_MODES_AT_5G_40   2

Definition at line 83 of file eeprom.h.

◆ SUB_NUM_CTL_MODES_AT_2G_40

#define SUB_NUM_CTL_MODES_AT_2G_40   3

Definition at line 84 of file eeprom.h.

◆ INCREASE_MAXPOW_BY_TWO_CHAIN

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

Definition at line 86 of file eeprom.h.

◆ INCREASE_MAXPOW_BY_THREE_CHAIN

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

Definition at line 87 of file eeprom.h.

◆ AR9285_RDEXT_DEFAULT

#define AR9285_RDEXT_DEFAULT   0x1F

Definition at line 99 of file eeprom.h.

◆ ATH9K_POW_SM

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

Definition at line 101 of file eeprom.h.

◆ FREQ2FBIN

#define FREQ2FBIN (   x,
 
)    ((y) ? ((x) - 2300) : (((x) - 4800) / 5))

Definition at line 102 of file eeprom.h.

◆ ath9k_hw_use_flash

#define ath9k_hw_use_flash (   _ah)    (!(_ah->ah_flags & AH_USE_EEPROM))

Definition at line 103 of file eeprom.h.

◆ AR5416_VER_MASK

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

Definition at line 105 of file eeprom.h.

◆ OLC_FOR_AR9280_20_LATER

#define OLC_FOR_AR9280_20_LATER
Value:
ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL))
#define AR_SREV_9280_20_OR_LATER(_ah)
Definition: reg.h:824
uint8_t ah
Definition: registers.h:85

Definition at line 106 of file eeprom.h.

◆ 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:836
uint8_t ah
Definition: registers.h:85

Definition at line 108 of file eeprom.h.

◆ AR_EEPROM_RFSILENT_GPIO_SEL

#define AR_EEPROM_RFSILENT_GPIO_SEL   0x001c

Definition at line 111 of file eeprom.h.

◆ AR_EEPROM_RFSILENT_GPIO_SEL_S

#define AR_EEPROM_RFSILENT_GPIO_SEL_S   2

Definition at line 112 of file eeprom.h.

◆ AR_EEPROM_RFSILENT_POLARITY

#define AR_EEPROM_RFSILENT_POLARITY   0x0002

Definition at line 113 of file eeprom.h.

◆ AR_EEPROM_RFSILENT_POLARITY_S

#define AR_EEPROM_RFSILENT_POLARITY_S   1

Definition at line 114 of file eeprom.h.

◆ EEP_RFSILENT_ENABLED

#define EEP_RFSILENT_ENABLED   0x0001

Definition at line 116 of file eeprom.h.

◆ EEP_RFSILENT_ENABLED_S

#define EEP_RFSILENT_ENABLED_S   0

Definition at line 117 of file eeprom.h.

◆ EEP_RFSILENT_POLARITY

#define EEP_RFSILENT_POLARITY   0x0002

Definition at line 118 of file eeprom.h.

◆ EEP_RFSILENT_POLARITY_S

#define EEP_RFSILENT_POLARITY_S   1

Definition at line 119 of file eeprom.h.

◆ EEP_RFSILENT_GPIO_SEL

#define EEP_RFSILENT_GPIO_SEL   0x001c

Definition at line 120 of file eeprom.h.

◆ EEP_RFSILENT_GPIO_SEL_S

#define EEP_RFSILENT_GPIO_SEL_S   2

Definition at line 121 of file eeprom.h.

◆ AR5416_OPFLAGS_11A

#define AR5416_OPFLAGS_11A   0x01

Definition at line 123 of file eeprom.h.

◆ AR5416_OPFLAGS_11G

#define AR5416_OPFLAGS_11G   0x02

Definition at line 124 of file eeprom.h.

◆ AR5416_OPFLAGS_N_5G_HT40

#define AR5416_OPFLAGS_N_5G_HT40   0x04

Definition at line 125 of file eeprom.h.

◆ AR5416_OPFLAGS_N_2G_HT40

#define AR5416_OPFLAGS_N_2G_HT40   0x08

Definition at line 126 of file eeprom.h.

◆ AR5416_OPFLAGS_N_5G_HT20

#define AR5416_OPFLAGS_N_5G_HT20   0x10

Definition at line 127 of file eeprom.h.

◆ AR5416_OPFLAGS_N_2G_HT20

#define AR5416_OPFLAGS_N_2G_HT20   0x20

Definition at line 128 of file eeprom.h.

◆ AR5416_EEP_NO_BACK_VER

#define AR5416_EEP_NO_BACK_VER   0x1

Definition at line 130 of file eeprom.h.

◆ AR5416_EEP_VER

#define AR5416_EEP_VER   0xE

Definition at line 131 of file eeprom.h.

◆ AR5416_EEP_VER_MINOR_MASK

#define AR5416_EEP_VER_MINOR_MASK   0x0FFF

Definition at line 132 of file eeprom.h.

◆ AR5416_EEP_MINOR_VER_2

#define AR5416_EEP_MINOR_VER_2   0x2

Definition at line 133 of file eeprom.h.

◆ AR5416_EEP_MINOR_VER_3

#define AR5416_EEP_MINOR_VER_3   0x3

Definition at line 134 of file eeprom.h.

◆ AR5416_EEP_MINOR_VER_7

#define AR5416_EEP_MINOR_VER_7   0x7

Definition at line 135 of file eeprom.h.

◆ AR5416_EEP_MINOR_VER_9

#define AR5416_EEP_MINOR_VER_9   0x9

Definition at line 136 of file eeprom.h.

◆ AR5416_EEP_MINOR_VER_16

#define AR5416_EEP_MINOR_VER_16   0x10

Definition at line 137 of file eeprom.h.

◆ AR5416_EEP_MINOR_VER_17

#define AR5416_EEP_MINOR_VER_17   0x11

Definition at line 138 of file eeprom.h.

◆ AR5416_EEP_MINOR_VER_19

#define AR5416_EEP_MINOR_VER_19   0x13

Definition at line 139 of file eeprom.h.

◆ AR5416_EEP_MINOR_VER_20

#define AR5416_EEP_MINOR_VER_20   0x14

Definition at line 140 of file eeprom.h.

◆ AR5416_EEP_MINOR_VER_21

#define AR5416_EEP_MINOR_VER_21   0x15

Definition at line 141 of file eeprom.h.

◆ AR5416_EEP_MINOR_VER_22

#define AR5416_EEP_MINOR_VER_22   0x16

Definition at line 142 of file eeprom.h.

◆ AR5416_NUM_5G_CAL_PIERS

#define AR5416_NUM_5G_CAL_PIERS   8

Definition at line 144 of file eeprom.h.

◆ AR5416_NUM_2G_CAL_PIERS

#define AR5416_NUM_2G_CAL_PIERS   4

Definition at line 145 of file eeprom.h.

◆ AR5416_NUM_5G_20_TARGET_POWERS

#define AR5416_NUM_5G_20_TARGET_POWERS   8

Definition at line 146 of file eeprom.h.

◆ AR5416_NUM_5G_40_TARGET_POWERS

#define AR5416_NUM_5G_40_TARGET_POWERS   8

Definition at line 147 of file eeprom.h.

◆ AR5416_NUM_2G_CCK_TARGET_POWERS

#define AR5416_NUM_2G_CCK_TARGET_POWERS   3

Definition at line 148 of file eeprom.h.

◆ AR5416_NUM_2G_20_TARGET_POWERS

#define AR5416_NUM_2G_20_TARGET_POWERS   4

Definition at line 149 of file eeprom.h.

◆ AR5416_NUM_2G_40_TARGET_POWERS

#define AR5416_NUM_2G_40_TARGET_POWERS   4

Definition at line 150 of file eeprom.h.

◆ AR5416_NUM_CTLS

#define AR5416_NUM_CTLS   24

Definition at line 151 of file eeprom.h.

◆ AR5416_NUM_BAND_EDGES

#define AR5416_NUM_BAND_EDGES   8

Definition at line 152 of file eeprom.h.

◆ AR5416_NUM_PD_GAINS

#define AR5416_NUM_PD_GAINS   4

Definition at line 153 of file eeprom.h.

◆ AR5416_PD_GAINS_IN_MASK

#define AR5416_PD_GAINS_IN_MASK   4

Definition at line 154 of file eeprom.h.

◆ AR5416_PD_GAIN_ICEPTS

#define AR5416_PD_GAIN_ICEPTS   5

Definition at line 155 of file eeprom.h.

◆ AR5416_NUM_PDADC_VALUES

#define AR5416_NUM_PDADC_VALUES   128

Definition at line 156 of file eeprom.h.

◆ AR5416_BCHAN_UNUSED

#define AR5416_BCHAN_UNUSED   0xFF

Definition at line 157 of file eeprom.h.

◆ AR5416_MAX_PWR_RANGE_IN_HALF_DB

#define AR5416_MAX_PWR_RANGE_IN_HALF_DB   64

Definition at line 158 of file eeprom.h.

◆ AR5416_MAX_CHAINS

#define AR5416_MAX_CHAINS   3

Definition at line 159 of file eeprom.h.

◆ AR9300_MAX_CHAINS

#define AR9300_MAX_CHAINS   3

Definition at line 160 of file eeprom.h.

◆ AR5416_PWR_TABLE_OFFSET_DB

#define AR5416_PWR_TABLE_OFFSET_DB   -5

Definition at line 161 of file eeprom.h.

◆ AR5416_EEP_RXGAIN_23DB_BACKOFF

#define AR5416_EEP_RXGAIN_23DB_BACKOFF   0

Definition at line 164 of file eeprom.h.

◆ AR5416_EEP_RXGAIN_13DB_BACKOFF

#define AR5416_EEP_RXGAIN_13DB_BACKOFF   1

Definition at line 165 of file eeprom.h.

◆ AR5416_EEP_RXGAIN_ORIG

#define AR5416_EEP_RXGAIN_ORIG   2

Definition at line 166 of file eeprom.h.

◆ AR5416_EEP_TXGAIN_ORIGINAL

#define AR5416_EEP_TXGAIN_ORIGINAL   0

Definition at line 169 of file eeprom.h.

◆ AR5416_EEP_TXGAIN_HIGH_POWER

#define AR5416_EEP_TXGAIN_HIGH_POWER   1

Definition at line 170 of file eeprom.h.

◆ AR5416_EEP4K_START_LOC

#define AR5416_EEP4K_START_LOC   64

Definition at line 172 of file eeprom.h.

◆ AR5416_EEP4K_NUM_2G_CAL_PIERS

#define AR5416_EEP4K_NUM_2G_CAL_PIERS   3

Definition at line 173 of file eeprom.h.

◆ AR5416_EEP4K_NUM_2G_CCK_TARGET_POWERS

#define AR5416_EEP4K_NUM_2G_CCK_TARGET_POWERS   3

Definition at line 174 of file eeprom.h.

◆ AR5416_EEP4K_NUM_2G_20_TARGET_POWERS

#define AR5416_EEP4K_NUM_2G_20_TARGET_POWERS   3

Definition at line 175 of file eeprom.h.

◆ AR5416_EEP4K_NUM_2G_40_TARGET_POWERS

#define AR5416_EEP4K_NUM_2G_40_TARGET_POWERS   3

Definition at line 176 of file eeprom.h.

◆ AR5416_EEP4K_NUM_CTLS

#define AR5416_EEP4K_NUM_CTLS   12

Definition at line 177 of file eeprom.h.

◆ AR5416_EEP4K_NUM_BAND_EDGES

#define AR5416_EEP4K_NUM_BAND_EDGES   4

Definition at line 178 of file eeprom.h.

◆ AR5416_EEP4K_NUM_PD_GAINS

#define AR5416_EEP4K_NUM_PD_GAINS   2

Definition at line 179 of file eeprom.h.

◆ AR5416_EEP4K_MAX_CHAINS

#define AR5416_EEP4K_MAX_CHAINS   1

Definition at line 180 of file eeprom.h.

◆ AR9280_TX_GAIN_TABLE_SIZE

#define AR9280_TX_GAIN_TABLE_SIZE   22

Definition at line 182 of file eeprom.h.

◆ AR9287_EEP_VER

#define AR9287_EEP_VER   0xE

Definition at line 184 of file eeprom.h.

◆ AR9287_EEP_VER_MINOR_MASK

#define AR9287_EEP_VER_MINOR_MASK   0xFFF

Definition at line 185 of file eeprom.h.

◆ AR9287_EEP_MINOR_VER_1

#define AR9287_EEP_MINOR_VER_1   0x1

Definition at line 186 of file eeprom.h.

◆ AR9287_EEP_MINOR_VER_2

#define AR9287_EEP_MINOR_VER_2   0x2

Definition at line 187 of file eeprom.h.

◆ AR9287_EEP_MINOR_VER_3

#define AR9287_EEP_MINOR_VER_3   0x3

Definition at line 188 of file eeprom.h.

◆ AR9287_EEP_MINOR_VER

#define AR9287_EEP_MINOR_VER   AR9287_EEP_MINOR_VER_3

Definition at line 189 of file eeprom.h.

◆ AR9287_EEP_MINOR_VER_b

#define AR9287_EEP_MINOR_VER_b   AR9287_EEP_MINOR_VER

Definition at line 190 of file eeprom.h.

◆ AR9287_EEP_NO_BACK_VER

#define AR9287_EEP_NO_BACK_VER   AR9287_EEP_MINOR_VER_1

Definition at line 191 of file eeprom.h.

◆ AR9287_EEP_START_LOC

#define AR9287_EEP_START_LOC   128

Definition at line 193 of file eeprom.h.

◆ AR9287_HTC_EEP_START_LOC

#define AR9287_HTC_EEP_START_LOC   256

Definition at line 194 of file eeprom.h.

◆ AR9287_NUM_2G_CAL_PIERS

#define AR9287_NUM_2G_CAL_PIERS   3

Definition at line 195 of file eeprom.h.

◆ AR9287_NUM_2G_CCK_TARGET_POWERS

#define AR9287_NUM_2G_CCK_TARGET_POWERS   3

Definition at line 196 of file eeprom.h.

◆ AR9287_NUM_2G_20_TARGET_POWERS

#define AR9287_NUM_2G_20_TARGET_POWERS   3

Definition at line 197 of file eeprom.h.

◆ AR9287_NUM_2G_40_TARGET_POWERS

#define AR9287_NUM_2G_40_TARGET_POWERS   3

Definition at line 198 of file eeprom.h.

◆ AR9287_NUM_CTLS

#define AR9287_NUM_CTLS   12

Definition at line 199 of file eeprom.h.

◆ AR9287_NUM_BAND_EDGES

#define AR9287_NUM_BAND_EDGES   4

Definition at line 200 of file eeprom.h.

◆ AR9287_PD_GAIN_ICEPTS

#define AR9287_PD_GAIN_ICEPTS   1

Definition at line 201 of file eeprom.h.

◆ AR9287_EEPMISC_BIG_ENDIAN

#define AR9287_EEPMISC_BIG_ENDIAN   0x01

Definition at line 202 of file eeprom.h.

◆ AR9287_EEPMISC_WOW

#define AR9287_EEPMISC_WOW   0x02

Definition at line 203 of file eeprom.h.

◆ AR9287_MAX_CHAINS

#define AR9287_MAX_CHAINS   2

Definition at line 204 of file eeprom.h.

◆ AR9287_ANT_16S

#define AR9287_ANT_16S   32

Definition at line 205 of file eeprom.h.

◆ AR9287_DATA_SZ

#define AR9287_DATA_SZ   32

Definition at line 207 of file eeprom.h.

◆ AR9287_PWR_TABLE_OFFSET_DB

#define AR9287_PWR_TABLE_OFFSET_DB   -5

Definition at line 209 of file eeprom.h.

◆ AR9287_CHECKSUM_LOCATION

#define AR9287_CHECKSUM_LOCATION   (AR9287_EEP_START_LOC + 1)

Definition at line 211 of file eeprom.h.

◆ CTL_EDGE_TPOWER

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

Definition at line 213 of file eeprom.h.

◆ CTL_EDGE_FLAGS

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

Definition at line 214 of file eeprom.h.

◆ LNA_CTL_BUF_MODE

#define LNA_CTL_BUF_MODE   BIT(0)

Definition at line 216 of file eeprom.h.

◆ LNA_CTL_ISEL_LO

#define LNA_CTL_ISEL_LO   BIT(1)

Definition at line 217 of file eeprom.h.

◆ LNA_CTL_ISEL_HI

#define LNA_CTL_ISEL_HI   BIT(2)

Definition at line 218 of file eeprom.h.

◆ LNA_CTL_BUF_IN

#define LNA_CTL_BUF_IN   BIT(3)

Definition at line 219 of file eeprom.h.

◆ LNA_CTL_FEM_BAND

#define LNA_CTL_FEM_BAND   BIT(4)

Definition at line 220 of file eeprom.h.

◆ LNA_CTL_LOCAL_BIAS

#define LNA_CTL_LOCAL_BIAS   BIT(5)

Definition at line 221 of file eeprom.h.

◆ LNA_CTL_FORCE_XPA

#define LNA_CTL_FORCE_XPA   BIT(6)

Definition at line 222 of file eeprom.h.

◆ LNA_CTL_USE_ANT1

#define LNA_CTL_USE_ANT1   BIT(7)

Definition at line 223 of file eeprom.h.

◆ EEP_4K_BB_DESIRED_SCALE_MASK

#define EEP_4K_BB_DESIRED_SCALE_MASK   0x1f

Definition at line 446 of file eeprom.h.

◆ ar5416_get_ntxchains

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

Definition at line 706 of file eeprom.h.

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 225 of file eeprom.h.

225  {
228  EEP_MAC_MSW,
229  EEP_MAC_MID,
230  EEP_MAC_LSW,
231  EEP_REG_0,
232  EEP_REG_1,
233  EEP_OP_CAP,
234  EEP_OP_MODE,
236  EEP_OB_5,
237  EEP_DB_5,
238  EEP_OB_2,
239  EEP_DB_2,
241  EEP_TX_MASK,
242  EEP_RX_MASK,
250  EEP_DEV_TYPE,
256  EEP_SWREG,
257  EEP_PAPRD,
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 263 of file eeprom.h.

263  {
274 };
Definition: eeprom.h:267
Definition: eeprom.h:266
Definition: eeprom.h:266
Definition: eeprom.h:266

◆ ath9k_hal_freq_band

Enumerator
ATH9K_HAL_FREQ_BAND_5GHZ 
ATH9K_HAL_FREQ_BAND_2GHZ 

Definition at line 276 of file eeprom.h.

◆ 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 635 of file eeprom.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( BSD2  )

◆ ath9k_hw_analog_shift_regwrite()

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

Definition at line 32 of file ath9k_eeprom.c.

33 {
34  REG_WRITE(ah, reg, val);
35 
36  if (ah->config.analog_shiftreg)
37  udelay(100);
38 }
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
Definition: timer.c:60
static unsigned int unsigned int reg
Definition: intel.h:245
void __asmcall int val
Definition: setjmp.h:28
#define REG_WRITE(_ah, _reg, _val)
Definition: hw.h:77
uint8_t ah
Definition: registers.h:85

References ah, reg, REG_WRITE, 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 40 of file ath9k_eeprom.c.

42 {
43  u32 regVal;
44 
45  regVal = REG_READ(ah, reg) & ~mask;
46  regVal |= (val << shift) & mask;
47 
48  REG_WRITE(ah, reg, regVal);
49 
50  if (ah->config.analog_shiftreg)
51  udelay(100);
52 }
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
Definition: timer.c:60
static unsigned int unsigned int reg
Definition: intel.h:245
#define REG_READ(_ah, _reg)
Definition: hw.h:80
void __asmcall int val
Definition: setjmp.h:28
#define REG_WRITE(_ah, _reg, _val)
Definition: hw.h:77
uint8_t ah
Definition: registers.h:85
uint32_t u32
Definition: stdint.h:23

References ah, reg, REG_READ, REG_WRITE, 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 54 of file ath9k_eeprom.c.

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

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 69 of file ath9k_eeprom.c.

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

References u16.

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 129 of file ath9k_eeprom.c.

130 {
131  return common->bus_ops->eeprom_read(common, off, data);
132 }
struct ib_cm_common common
Definition: ib_mad.h:11
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12

References common, and data.

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 97 of file ath9k_eeprom.c.

99 {
100  int i = 0, j, addr;
101  u32 addrdata[8];
102  u32 data[8];
103 
104  for (addr = 0; addr < size; addr++) {
105  addrdata[i] = AR5416_EEPROM_OFFSET +
106  ((addr + eep_start_loc) << AR5416_EEPROM_S);
107  i++;
108  if (i == 8) {
109  REG_READ_MULTI(ah, addrdata, data, i);
110 
111  for (j = 0; j < i; j++) {
112  *eep_data = data[j];
113  eep_data++;
114  }
115  i = 0;
116  }
117  }
118 
119  if (i != 0) {
120  REG_READ_MULTI(ah, addrdata, data, i);
121 
122  for (j = 0; j < i; j++) {
123  *eep_data = data[j];
124  eep_data++;
125  }
126  }
127 }
#define REG_READ_MULTI(_ah, _addr, _val, _cnt)
Definition: hw.h:83
u32 addr
Definition: sky2.h:8
uint8_t size
Entry size (in 32-bit words)
Definition: ena.h:16
uint8_t ah
Definition: registers.h:85
#define AR5416_EEPROM_S
Definition: eeprom.h:60
struct arbelprm_port_state_change_st data
Message.
Definition: arbel.h:12
uint32_t u32
Definition: stdint.h:23
#define AR5416_EEPROM_OFFSET
Definition: eeprom.h:61

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

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 134 of file ath9k_eeprom.c.

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

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 161 of file ath9k_eeprom.c.

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

References ah, AR5416_BCHAN_UNUSED, ath9k_hw_fbin2freq(), ath9k_hw_get_channel_centers(), ath9k_hw_interpolate(), chan_centers::ctl_center, chan_centers::ext_center, if(), IS_CHAN_2GHZ, tPow2x, cal_target_power_leg::tPow2x, 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 216 of file ath9k_eeprom.c.

222 {
223  struct chan_centers centers;
224  u16 clo, chi;
225  int i;
226  int matchIndex = -1, lowIndex = -1;
227  u16 freq;
228 
229  ath9k_hw_get_channel_centers(ah, chan, &centers);
230  freq = isHt40Target ? centers.synth_center : centers.ctl_center;
231 
232  if (freq <= ath9k_hw_fbin2freq(powInfo[0].bChannel, IS_CHAN_2GHZ(chan))) {
233  matchIndex = 0;
234  } else {
235  for (i = 0; (i < numChannels) &&
236  (powInfo[i].bChannel != AR5416_BCHAN_UNUSED); i++) {
237  if (freq == ath9k_hw_fbin2freq(powInfo[i].bChannel,
238  IS_CHAN_2GHZ(chan))) {
239  matchIndex = i;
240  break;
241  } else
242  if (freq < ath9k_hw_fbin2freq(powInfo[i].bChannel,
243  IS_CHAN_2GHZ(chan)) && i > 0 &&
244  freq > ath9k_hw_fbin2freq(powInfo[i - 1].bChannel,
245  IS_CHAN_2GHZ(chan))) {
246  lowIndex = i - 1;
247  break;
248  }
249  }
250  if ((matchIndex == -1) && (lowIndex == -1))
251  matchIndex = i - 1;
252  }
253 
254  if (matchIndex != -1) {
255  *pNewPower = powInfo[matchIndex];
256  } else {
257  clo = ath9k_hw_fbin2freq(powInfo[lowIndex].bChannel,
258  IS_CHAN_2GHZ(chan));
259  chi = ath9k_hw_fbin2freq(powInfo[lowIndex + 1].bChannel,
260  IS_CHAN_2GHZ(chan));
261 
262  for (i = 0; i < numRates; i++) {
263  pNewPower->tPow2x[i] = (u8)ath9k_hw_interpolate(freq,
264  clo, chi,
265  powInfo[lowIndex].tPow2x[i],
266  powInfo[lowIndex + 1].tPow2x[i]);
267  }
268  }
269 }
uint16_t u16
Definition: stdint.h:21
static u16 ath9k_hw_fbin2freq(u8 fbin, int is2GHz)
Definition: ath9k_eeprom.c:24
#define IS_CHAN_2GHZ(_c)
Definition: hw.h:361
int16_t ath9k_hw_interpolate(u16 target, u16 srcLeft, u16 srcRight, int16_t targetLeft, int16_t targetRight)
Definition: ath9k_eeprom.c:54
#define u8
Definition: igbvf_osdep.h:38
#define AR5416_BCHAN_UNUSED
Definition: eeprom.h:157
void ath9k_hw_get_channel_centers(struct ath_hw *ah __unused, struct ath9k_channel *chan, struct chan_centers *centers)
Definition: ath9k_hw.c:189
uint8_t ah
Definition: registers.h:85
u8 tPow2x[4]
Definition: ar9003_eeprom.h:24

References ah, AR5416_BCHAN_UNUSED, ath9k_hw_fbin2freq(), ath9k_hw_get_channel_centers(), ath9k_hw_interpolate(), chan_centers::ctl_center, IS_CHAN_2GHZ, chan_centers::synth_center, tPow2x, cal_target_power_ht::tPow2x, 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 271 of file ath9k_eeprom.c.

273 {
274  u16 twiceMaxEdgePower = MAX_RATE_POWER;
275  int i;
276 
277  for (i = 0; (i < num_band_edges) &&
278  (pRdEdgesPower[i].bChannel != AR5416_BCHAN_UNUSED); i++) {
279  if (freq == ath9k_hw_fbin2freq(pRdEdgesPower[i].bChannel, is2GHz)) {
280  twiceMaxEdgePower = CTL_EDGE_TPOWER(pRdEdgesPower[i].ctl);
281  break;
282  } else if ((i > 0) &&
283  (freq < ath9k_hw_fbin2freq(pRdEdgesPower[i].bChannel,
284  is2GHz))) {
285  if (ath9k_hw_fbin2freq(pRdEdgesPower[i - 1].bChannel,
286  is2GHz) < freq &&
287  CTL_EDGE_FLAGS(pRdEdgesPower[i - 1].ctl)) {
288  twiceMaxEdgePower =
289  CTL_EDGE_TPOWER(pRdEdgesPower[i - 1].ctl);
290  }
291  break;
292  }
293  }
294 
295  return twiceMaxEdgePower;
296 }
uint16_t u16
Definition: stdint.h:21
static u16 ath9k_hw_fbin2freq(u8 fbin, int is2GHz)
Definition: ath9k_eeprom.c:24
#define CTL_EDGE_FLAGS(_ctl)
Definition: eeprom.h:214
#define AR5416_BCHAN_UNUSED
Definition: eeprom.h:157
#define CTL_EDGE_TPOWER(_ctl)
Definition: eeprom.h:213
#define MAX_RATE_POWER
Definition: hw.h:144

References AR5416_BCHAN_UNUSED, ath9k_hw_fbin2freq(), CTL_EDGE_FLAGS, CTL_EDGE_TPOWER, and MAX_RATE_POWER.

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 298 of file ath9k_eeprom.c.

299 {
300  struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
301 
302  switch (ar5416_get_ntxchains(ah->txchainmask)) {
303  case 1:
304  break;
305  case 2:
307  break;
308  case 3:
310  break;
311  default:
312  DBG2("ath9k: "
313  "Invalid chainmask configuration\n");
314  break;
315  }
316 }
#define ar5416_get_ntxchains(_txchainmask)
Definition: eeprom.h:706
static struct ath_regulatory * ath9k_hw_regulatory(struct ath_hw *ah)
Definition: hw.h:874
#define INCREASE_MAXPOW_BY_TWO_CHAIN
Definition: eeprom.h:86
#define INCREASE_MAXPOW_BY_THREE_CHAIN
Definition: eeprom.h:87
uint8_t ah
Definition: registers.h:85
u16 max_power_level
Definition: ath.h:139
#define DBG2(...)
Definition: compiler.h:515

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 530 of file ath9k_eeprom.c.

531 {
532  int status;
533 
535  ah->eep_ops = &eep_ar9300_ops;
536  else if (AR_SREV_9287(ah)) {
537  ah->eep_ops = &eep_ar9287_ops;
538  } else if (AR_SREV_9285(ah) || AR_SREV_9271(ah)) {
539  ah->eep_ops = &eep_4k_ops;
540  } else {
541  ah->eep_ops = &eep_def_ops;
542  }
543 
544  if (!ah->eep_ops->fill_eeprom(ah))
545  return -EIO;
546 
547  status = ah->eep_ops->check_eeprom(ah);
548 
549  return status;
550 }
const struct eeprom_ops eep_4k_ops
#define AR_SREV_9285(_ah)
Definition: reg.h:829
const struct eeprom_ops eep_def_ops
uint8_t status
Status.
Definition: ena.h:16
#define AR_SREV_9287(_ah)
Definition: reg.h:834
#define AR_SREV_9300_20_OR_LATER(_ah)
Definition: reg.h:864
const struct eeprom_ops eep_ar9300_ops
const struct eeprom_ops eep_ar9287_ops
#define EIO
Input/output error.
Definition: errno.h:433
#define AR_SREV_9271(_ah)
Definition: reg.h:853
uint8_t ah
Definition: registers.h:85

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 318 of file ath9k_eeprom.c.

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

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

Definition at line 1341 of file ath9k_eeprom_def.c.

Referenced by ath9k_hw_eeprom_init().

◆ eep_4k_ops

const struct eeprom_ops eep_4k_ops

Definition at line 1068 of file ath9k_eeprom_4k.c.

Referenced by ath9k_hw_eeprom_init().

◆ eep_ar9287_ops

const struct eeprom_ops eep_ar9287_ops

Definition at line 713 of file eeprom.h.

Referenced by ath9k_hw_eeprom_init().

◆ eep_ar9300_ops

const struct eeprom_ops eep_ar9300_ops

Definition at line 4995 of file ath9k_ar9003_eeprom.c.

Referenced by ath9k_hw_eeprom_init().