25 #define AR_EEPROM_MODAL_SPURS 5 30 #if __BYTE_ORDER == __BIG_ENDIAN 31 #define AR5416_EEPROM_MAGIC 0x5aa5 33 #define AR5416_EEPROM_MAGIC 0xa55a 36 #define CTRY_DEBUG 0x1ff 37 #define CTRY_DEFAULT 0 39 #define AR_EEPROM_EEPCAP_COMPRESS_DIS 0x0001 40 #define AR_EEPROM_EEPCAP_AES_DIS 0x0002 41 #define AR_EEPROM_EEPCAP_FASTFRAME_DIS 0x0004 42 #define AR_EEPROM_EEPCAP_BURST_DIS 0x0008 43 #define AR_EEPROM_EEPCAP_MAXQCU 0x01F0 44 #define AR_EEPROM_EEPCAP_MAXQCU_S 4 45 #define AR_EEPROM_EEPCAP_HEAVY_CLIP_EN 0x0200 46 #define AR_EEPROM_EEPCAP_KC_ENTRIES 0xF000 47 #define AR_EEPROM_EEPCAP_KC_ENTRIES_S 12 49 #define AR_EEPROM_EEREGCAP_EN_FCC_MIDBAND 0x0040 50 #define AR_EEPROM_EEREGCAP_EN_KK_U1_EVEN 0x0080 51 #define AR_EEPROM_EEREGCAP_EN_KK_U2 0x0100 52 #define AR_EEPROM_EEREGCAP_EN_KK_MIDBAND 0x0200 53 #define AR_EEPROM_EEREGCAP_EN_KK_U1_ODD 0x0400 54 #define AR_EEPROM_EEREGCAP_EN_KK_NEW_11A 0x0800 56 #define AR_EEPROM_EEREGCAP_EN_KK_U1_ODD_PRE4_0 0x4000 57 #define AR_EEPROM_EEREGCAP_EN_KK_NEW_11A_PRE4_0 0x8000 59 #define AR5416_EEPROM_MAGIC_OFFSET 0x0 60 #define AR5416_EEPROM_S 2 61 #define AR5416_EEPROM_OFFSET 0x2000 62 #define AR5416_EEPROM_MAX 0xae0 64 #define AR5416_EEPROM_START_ADDR \ 65 (AR_SREV_9100(ah)) ? 0x1fff1000 : 0x503f1200 67 #define SD_NO_CTL 0xE0 69 #define CTL_MODE_M 0xf 78 #define EXT_ADDITIVE (0x8000) 79 #define CTL_11A_EXT (CTL_11A | EXT_ADDITIVE) 80 #define CTL_11G_EXT (CTL_11G | EXT_ADDITIVE) 81 #define CTL_11B_EXT (CTL_11B | EXT_ADDITIVE) 83 #define SUB_NUM_CTL_MODES_AT_5G_40 2 84 #define SUB_NUM_CTL_MODES_AT_2G_40 3 86 #define INCREASE_MAXPOW_BY_TWO_CHAIN 6 87 #define INCREASE_MAXPOW_BY_THREE_CHAIN 10 99 #define AR9285_RDEXT_DEFAULT 0x1F 101 #define ATH9K_POW_SM(_r, _s) (((_r) & 0x3f) << (_s)) 102 #define FREQ2FBIN(x, y) ((y) ? ((x) - 2300) : (((x) - 4800) / 5)) 103 #define ath9k_hw_use_flash(_ah) (!(_ah->ah_flags & AH_USE_EEPROM)) 105 #define AR5416_VER_MASK (eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) 106 #define OLC_FOR_AR9280_20_LATER (AR_SREV_9280_20_OR_LATER(ah) && \ 107 ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL)) 108 #define OLC_FOR_AR9287_10_LATER (AR_SREV_9287_11_OR_LATER(ah) && \ 109 ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL)) 111 #define AR_EEPROM_RFSILENT_GPIO_SEL 0x001c 112 #define AR_EEPROM_RFSILENT_GPIO_SEL_S 2 113 #define AR_EEPROM_RFSILENT_POLARITY 0x0002 114 #define AR_EEPROM_RFSILENT_POLARITY_S 1 116 #define EEP_RFSILENT_ENABLED 0x0001 117 #define EEP_RFSILENT_ENABLED_S 0 118 #define EEP_RFSILENT_POLARITY 0x0002 119 #define EEP_RFSILENT_POLARITY_S 1 120 #define EEP_RFSILENT_GPIO_SEL 0x001c 121 #define EEP_RFSILENT_GPIO_SEL_S 2 123 #define AR5416_OPFLAGS_11A 0x01 124 #define AR5416_OPFLAGS_11G 0x02 125 #define AR5416_OPFLAGS_N_5G_HT40 0x04 126 #define AR5416_OPFLAGS_N_2G_HT40 0x08 127 #define AR5416_OPFLAGS_N_5G_HT20 0x10 128 #define AR5416_OPFLAGS_N_2G_HT20 0x20 130 #define AR5416_EEP_NO_BACK_VER 0x1 131 #define AR5416_EEP_VER 0xE 132 #define AR5416_EEP_VER_MINOR_MASK 0x0FFF 133 #define AR5416_EEP_MINOR_VER_2 0x2 134 #define AR5416_EEP_MINOR_VER_3 0x3 135 #define AR5416_EEP_MINOR_VER_7 0x7 136 #define AR5416_EEP_MINOR_VER_9 0x9 137 #define AR5416_EEP_MINOR_VER_16 0x10 138 #define AR5416_EEP_MINOR_VER_17 0x11 139 #define AR5416_EEP_MINOR_VER_19 0x13 140 #define AR5416_EEP_MINOR_VER_20 0x14 141 #define AR5416_EEP_MINOR_VER_21 0x15 142 #define AR5416_EEP_MINOR_VER_22 0x16 144 #define AR5416_NUM_5G_CAL_PIERS 8 145 #define AR5416_NUM_2G_CAL_PIERS 4 146 #define AR5416_NUM_5G_20_TARGET_POWERS 8 147 #define AR5416_NUM_5G_40_TARGET_POWERS 8 148 #define AR5416_NUM_2G_CCK_TARGET_POWERS 3 149 #define AR5416_NUM_2G_20_TARGET_POWERS 4 150 #define AR5416_NUM_2G_40_TARGET_POWERS 4 151 #define AR5416_NUM_CTLS 24 152 #define AR5416_NUM_BAND_EDGES 8 153 #define AR5416_NUM_PD_GAINS 4 154 #define AR5416_PD_GAINS_IN_MASK 4 155 #define AR5416_PD_GAIN_ICEPTS 5 156 #define AR5416_NUM_PDADC_VALUES 128 157 #define AR5416_BCHAN_UNUSED 0xFF 158 #define AR5416_MAX_PWR_RANGE_IN_HALF_DB 64 159 #define AR5416_MAX_CHAINS 3 160 #define AR9300_MAX_CHAINS 3 161 #define AR5416_PWR_TABLE_OFFSET_DB -5 164 #define AR5416_EEP_RXGAIN_23DB_BACKOFF 0 165 #define AR5416_EEP_RXGAIN_13DB_BACKOFF 1 166 #define AR5416_EEP_RXGAIN_ORIG 2 169 #define AR5416_EEP_TXGAIN_ORIGINAL 0 170 #define AR5416_EEP_TXGAIN_HIGH_POWER 1 172 #define AR5416_EEP4K_START_LOC 64 173 #define AR5416_EEP4K_NUM_2G_CAL_PIERS 3 174 #define AR5416_EEP4K_NUM_2G_CCK_TARGET_POWERS 3 175 #define AR5416_EEP4K_NUM_2G_20_TARGET_POWERS 3 176 #define AR5416_EEP4K_NUM_2G_40_TARGET_POWERS 3 177 #define AR5416_EEP4K_NUM_CTLS 12 178 #define AR5416_EEP4K_NUM_BAND_EDGES 4 179 #define AR5416_EEP4K_NUM_PD_GAINS 2 180 #define AR5416_EEP4K_MAX_CHAINS 1 182 #define AR9280_TX_GAIN_TABLE_SIZE 22 184 #define AR9287_EEP_VER 0xE 185 #define AR9287_EEP_VER_MINOR_MASK 0xFFF 186 #define AR9287_EEP_MINOR_VER_1 0x1 187 #define AR9287_EEP_MINOR_VER_2 0x2 188 #define AR9287_EEP_MINOR_VER_3 0x3 189 #define AR9287_EEP_MINOR_VER AR9287_EEP_MINOR_VER_3 190 #define AR9287_EEP_MINOR_VER_b AR9287_EEP_MINOR_VER 191 #define AR9287_EEP_NO_BACK_VER AR9287_EEP_MINOR_VER_1 193 #define AR9287_EEP_START_LOC 128 194 #define AR9287_HTC_EEP_START_LOC 256 195 #define AR9287_NUM_2G_CAL_PIERS 3 196 #define AR9287_NUM_2G_CCK_TARGET_POWERS 3 197 #define AR9287_NUM_2G_20_TARGET_POWERS 3 198 #define AR9287_NUM_2G_40_TARGET_POWERS 3 199 #define AR9287_NUM_CTLS 12 200 #define AR9287_NUM_BAND_EDGES 4 201 #define AR9287_PD_GAIN_ICEPTS 1 202 #define AR9287_EEPMISC_BIG_ENDIAN 0x01 203 #define AR9287_EEPMISC_WOW 0x02 204 #define AR9287_MAX_CHAINS 2 205 #define AR9287_ANT_16S 32 207 #define AR9287_DATA_SZ 32 209 #define AR9287_PWR_TABLE_OFFSET_DB -5 211 #define AR9287_CHECKSUM_LOCATION (AR9287_EEP_START_LOC + 1) 213 #define CTL_EDGE_TPOWER(_ctl) ((_ctl) & 0x3f) 214 #define CTL_EDGE_FLAGS(_ctl) (((_ctl) >> 6) & 0x03) 216 #define LNA_CTL_BUF_MODE BIT(0) 217 #define LNA_CTL_ISEL_LO BIT(1) 218 #define LNA_CTL_ISEL_HI BIT(2) 219 #define LNA_CTL_BUF_IN BIT(3) 220 #define LNA_CTL_FEM_BAND BIT(4) 221 #define LNA_CTL_LOCAL_BIAS BIT(5) 222 #define LNA_CTL_FORCE_XPA BIT(6) 223 #define LNA_CTL_USE_ANT1 BIT(7) 406 #ifdef __BIG_ENDIAN_BITFIELD 422 #ifdef __BIG_ENDIAN_BITFIELD 428 #ifdef __BIG_ENDIAN_BITFIELD 446 #define EEP_4K_BB_DESIRED_SCALE_MASK 0x1f 661 u16 cfgCtl,
u8 twiceAntennaReduction,
662 u8 twiceMaxRegulatoryPower,
u8 powerLimit,
674 u16 *indexL,
u16 *indexR);
677 int eep_start_loc,
int size);
679 u8 *pVpdList,
u16 numIntercepts,
686 u16 numRates,
int isExtTarget);
692 u16 numRates,
int isHt40Target);
694 int is2GHz,
int num_band_edges);
701 u8 *bChans,
u16 availPiers,
703 u16 *pPdGainBoundaries,
u8 *pPDADCValues,
706 #define ar5416_get_ntxchains(_txchainmask) \ 707 (((_txchainmask >> 2) & 1) + \ 708 ((_txchainmask >> 1) & 1) + (_txchainmask & 1)) struct cal_target_power_ht calTargetPower2GHT20[AR9287_NUM_2G_20_TARGET_POWERS]
#define AR5416_NUM_PD_GAINS
u8 calFreqPier2G[AR9287_NUM_2G_CAL_PIERS]
#define AR9287_NUM_2G_CCK_TARGET_POWERS
const struct eeprom_ops eep_4k_ops
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)
static unsigned int unsigned int reg
#define AR5416_NUM_5G_CAL_PIERS
const struct eeprom_ops eep_def_ops
#define AR9287_NUM_BAND_EDGES
#define AR5416_EEP4K_NUM_PD_GAINS
#define AR5416_EEP4K_MAX_CHAINS
struct cal_ctl_edges ctlEdges[AR9287_MAX_CHAINS][AR9287_NUM_BAND_EDGES]
#define AR_EEPROM_MODAL_SPURS
int ath9k_hw_nvram_read(struct ath_common *common, u32 off, u16 *data)
uint8_t size
Entry size (in 32-bit words)
u16 ath9k_hw_get_max_edge_power(u16 freq, struct cal_ctl_edges *pRdEdgesPower, int is2GHz, int num_band_edges)
u8 vpdPdg[AR5416_EEP4K_NUM_PD_GAINS][AR5416_PD_GAIN_ICEPTS]
void(* set_txpower)(struct ath_hw *hw, struct ath9k_channel *chan, u16 cfgCtl, u8 twiceAntennaReduction, u8 twiceMaxRegulatoryPower, u8 powerLimit, int test)
struct cal_ctl_edges ctlEdges[AR5416_MAX_CHAINS][AR5416_NUM_BAND_EDGES]
int ath9k_hw_get_lower_upper_index(u8 target, u8 *pList, u16 listSize, u16 *indexL, u16 *indexR)
u8 calFreqPier5G[AR5416_NUM_5G_CAL_PIERS]
#define AR5416_EEP4K_NUM_CTLS
void ath9k_hw_fill_vpd_table(u8 pwrMin, u8 pwrMax, u8 *pPwrList, u8 *pVpdList, u16 numIntercepts, u8 *pRetVpdList)
#define AR5416_NUM_5G_20_TARGET_POWERS
struct net80211_channel * chan
struct cal_data_op_loop_ar9287 calDataOpen
void ath9k_hw_analog_shift_regwrite(struct ath_hw *ah, u32 reg, u32 val)
struct cal_target_power_leg calTargetPower2G[AR5416_NUM_2G_20_TARGET_POWERS]
u8 pwrPdg[AR5416_EEP4K_NUM_PD_GAINS][AR5416_PD_GAIN_ICEPTS]
struct modal_eep_4k_header modalHeader
#define AR5416_NUM_5G_40_TARGET_POWERS
const struct eeprom_ops eep_ar9287_ops
#define AR9287_NUM_2G_CAL_PIERS
u8 pwrPdg[AR5416_NUM_PD_GAINS][AR9287_PD_GAIN_ICEPTS]
struct cal_target_power_leg calTargetPower2G[AR9287_NUM_2G_20_TARGET_POWERS]
u8 calFreqPier2G[AR5416_EEP4K_NUM_2G_CAL_PIERS]
int(* get_eeprom_ver)(struct ath_hw *hw)
int16_t ath9k_hw_interpolate(u16 target, u16 srcLeft, u16 srcRight, int16_t targetLeft, int16_t targetRight)
u8 pwrPdg[AR5416_NUM_PD_GAINS][AR5416_PD_GAIN_ICEPTS]
int ath9k_hw_eeprom_init(struct ath_hw *ah)
#define AR9287_NUM_2G_40_TARGET_POWERS
struct cal_target_power_ht calTargetPower5GHT20[AR5416_NUM_5G_20_TARGET_POWERS]
struct cal_target_power_leg calTargetPowerCck[AR9287_NUM_2G_CCK_TARGET_POWERS]
#define AR5416_PD_GAIN_ICEPTS
void(* set_addac)(struct ath_hw *hw, struct ath9k_channel *chan)
#define AR5416_NUM_2G_CCK_TARGET_POWERS
struct cal_target_power_leg calTargetPower2G[AR5416_EEP4K_NUM_2G_20_TARGET_POWERS]
#define AR5416_NUM_BAND_EDGES
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)
struct cal_ctl_data ctlData[AR5416_NUM_CTLS]
u8 ctlIndex[AR5416_EEP4K_NUM_CTLS]
#define AR9287_PD_GAIN_ICEPTS
#define AR5416_EEP4K_NUM_BAND_EDGES
struct cal_target_power_leg calTargetPower5G[AR5416_NUM_5G_20_TARGET_POWERS]
struct hv_monitor_parameter param[4][32]
Parameters.
union cal_data_per_freq_ar9287_u calPierData2G[AR9287_MAX_CHAINS][AR9287_NUM_2G_CAL_PIERS]
u8 vpdPdg[AR5416_NUM_PD_GAINS][AR5416_PD_GAIN_ICEPTS]
#define AR5416_NUM_2G_20_TARGET_POWERS
struct cal_data_per_freq_ar9287 calDataClose
u8 calFreqPier2G[AR5416_NUM_2G_CAL_PIERS]
#define AR9287_NUM_2G_20_TARGET_POWERS
struct modal_eep_header modalHeader[2]
u32(* get_eeprom)(struct ath_hw *hw, enum eeprom_param param)
#define AR5416_NUM_2G_40_TARGET_POWERS
struct ib_cm_common common
struct cal_target_power_ht calTargetPower2GHT40[AR9287_NUM_2G_40_TARGET_POWERS]
int(* check_eeprom)(struct ath_hw *hw)
struct cal_target_power_ht calTargetPower2GHT20[AR5416_EEP4K_NUM_2G_20_TARGET_POWERS]
#define AR5416_EEP4K_NUM_2G_40_TARGET_POWERS
struct cal_target_power_leg calTargetPowerCck[AR5416_EEP4K_NUM_2G_CCK_TARGET_POWERS]
u8 vpdPdg[AR5416_NUM_PD_GAINS][AR9287_PD_GAIN_ICEPTS]
#define AR5416_EEP4K_NUM_2G_CAL_PIERS
#define AR5416_MAX_CHAINS
struct cal_target_power_ht calTargetPower5GHT40[AR5416_NUM_5G_40_TARGET_POWERS]
struct cal_target_power_ht calTargetPower2GHT20[AR5416_NUM_2G_20_TARGET_POWERS]
struct cal_target_power_leg calTargetPowerCck[AR5416_NUM_2G_CCK_TARGET_POWERS]
struct cal_ctl_data_ar9287 ctlData[AR9287_NUM_CTLS]
u8 custData[AR9287_DATA_SZ]
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)
u8 ctlIndex[AR5416_NUM_CTLS]
#define AR5416_NUM_2G_CAL_PIERS
void ath9k_hw_update_regulatory_maxpower(struct ath_hw *ah)
struct cal_data_per_freq calPierData5G[AR5416_MAX_CHAINS][AR5416_NUM_5G_CAL_PIERS]
uint8_t data[48]
Additional event data.
void(* set_board_values)(struct ath_hw *hw, struct ath9k_channel *chan)
const struct eeprom_ops eep_ar9300_ops
void ath9k_hw_usb_gen_fill_eeprom(struct ath_hw *ah, u16 *eep_data, int eep_start_loc, int size)
struct cal_target_power_ht calTargetPower2GHT40[AR5416_NUM_2G_40_TARGET_POWERS]
struct cal_data_per_freq_4k calPierData2G[AR5416_EEP4K_MAX_CHAINS][AR5416_EEP4K_NUM_2G_CAL_PIERS]
struct cal_target_power_ht calTargetPower2GHT40[AR5416_EEP4K_NUM_2G_40_TARGET_POWERS]
struct base_eep_header baseEepHeader
struct base_eep_header_4k baseEepHeader
struct cal_ctl_data_4k ctlData[AR5416_EEP4K_NUM_CTLS]
struct cal_ctl_edges ctlEdges[AR5416_EEP4K_MAX_CHAINS][AR5416_EEP4K_NUM_BAND_EDGES]
#define AR5416_EEP4K_NUM_2G_20_TARGET_POWERS
struct modal_eep_ar9287_header modalHeader
int(* fill_eeprom)(struct ath_hw *hw)
int(* get_eeprom_rev)(struct ath_hw *hw)
struct base_eep_ar9287_header baseEepHeader
void ath9k_hw_analog_shift_rmw(struct ath_hw *ah, u32 reg, u32 mask, u32 shift, u32 val)
u8 ctlIndex[AR9287_NUM_CTLS]
u16(* get_spur_channel)(struct ath_hw *ah, u16 i, int is2GHz)
#define AR9287_MAX_CHAINS
struct cal_data_per_freq calPierData2G[AR5416_MAX_CHAINS][AR5416_NUM_2G_CAL_PIERS]
#define AR5416_EEP4K_NUM_2G_CCK_TARGET_POWERS