162306a36Sopenharmony_ci/* 262306a36Sopenharmony_ci * Copyright (c) 2010-2011 Atheros Communications Inc. 362306a36Sopenharmony_ci * 462306a36Sopenharmony_ci * Permission to use, copy, modify, and/or distribute this software for any 562306a36Sopenharmony_ci * purpose with or without fee is hereby granted, provided that the above 662306a36Sopenharmony_ci * copyright notice and this permission notice appear in all copies. 762306a36Sopenharmony_ci * 862306a36Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 962306a36Sopenharmony_ci * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 1062306a36Sopenharmony_ci * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 1162306a36Sopenharmony_ci * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 1262306a36Sopenharmony_ci * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 1362306a36Sopenharmony_ci * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 1462306a36Sopenharmony_ci * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1562306a36Sopenharmony_ci */ 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ci#ifndef AR9003_EEPROM_H 1862306a36Sopenharmony_ci#define AR9003_EEPROM_H 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ci#include <linux/types.h> 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ci#define AR9300_EEP_VER 0xD000 2362306a36Sopenharmony_ci#define AR9300_EEP_VER_MINOR_MASK 0xFFF 2462306a36Sopenharmony_ci#define AR9300_EEP_MINOR_VER_1 0x1 2562306a36Sopenharmony_ci#define AR9300_EEP_MINOR_VER AR9300_EEP_MINOR_VER_1 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ci/* 16-bit offset location start of calibration struct */ 2862306a36Sopenharmony_ci#define AR9300_EEP_START_LOC 256 2962306a36Sopenharmony_ci#define AR9300_NUM_5G_CAL_PIERS 8 3062306a36Sopenharmony_ci#define AR9300_NUM_2G_CAL_PIERS 3 3162306a36Sopenharmony_ci#define AR9300_NUM_5G_20_TARGET_POWERS 8 3262306a36Sopenharmony_ci#define AR9300_NUM_5G_40_TARGET_POWERS 8 3362306a36Sopenharmony_ci#define AR9300_NUM_2G_CCK_TARGET_POWERS 2 3462306a36Sopenharmony_ci#define AR9300_NUM_2G_20_TARGET_POWERS 3 3562306a36Sopenharmony_ci#define AR9300_NUM_2G_40_TARGET_POWERS 3 3662306a36Sopenharmony_ci/* #define AR9300_NUM_CTLS 21 */ 3762306a36Sopenharmony_ci#define AR9300_NUM_CTLS_5G 9 3862306a36Sopenharmony_ci#define AR9300_NUM_CTLS_2G 12 3962306a36Sopenharmony_ci#define AR9300_NUM_BAND_EDGES_5G 8 4062306a36Sopenharmony_ci#define AR9300_NUM_BAND_EDGES_2G 4 4162306a36Sopenharmony_ci#define AR9300_EEPMISC_WOW 0x02 4262306a36Sopenharmony_ci#define AR9300_CUSTOMER_DATA_SIZE 20 4362306a36Sopenharmony_ci 4462306a36Sopenharmony_ci#define AR9300_MAX_CHAINS 3 4562306a36Sopenharmony_ci#define AR9300_ANT_16S 25 4662306a36Sopenharmony_ci#define AR9300_FUTURE_MODAL_SZ 6 4762306a36Sopenharmony_ci 4862306a36Sopenharmony_ci#define AR9300_PAPRD_RATE_MASK 0x01ffffff 4962306a36Sopenharmony_ci#define AR9300_PAPRD_SCALE_1 0x0e000000 5062306a36Sopenharmony_ci#define AR9300_PAPRD_SCALE_1_S 25 5162306a36Sopenharmony_ci#define AR9300_PAPRD_SCALE_2 0x70000000 5262306a36Sopenharmony_ci#define AR9300_PAPRD_SCALE_2_S 28 5362306a36Sopenharmony_ci 5462306a36Sopenharmony_ci#define AR9300_EEP_ANTDIV_CONTROL_DEFAULT_VALUE 0xc9 5562306a36Sopenharmony_ci 5662306a36Sopenharmony_ci/* Delta from which to start power to pdadc table */ 5762306a36Sopenharmony_ci/* This offset is used in both open loop and closed loop power control 5862306a36Sopenharmony_ci * schemes. In open loop power control, it is not really needed, but for 5962306a36Sopenharmony_ci * the "sake of consistency" it was kept. For certain AP designs, this 6062306a36Sopenharmony_ci * value is overwritten by the value in the flag "pwrTableOffset" just 6162306a36Sopenharmony_ci * before writing the pdadc vs pwr into the chip registers. 6262306a36Sopenharmony_ci */ 6362306a36Sopenharmony_ci#define AR9300_PWR_TABLE_OFFSET 0 6462306a36Sopenharmony_ci 6562306a36Sopenharmony_ci/* Noise power data definitions 6662306a36Sopenharmony_ci * units are: 4 x dBm - NOISE_PWR_DATA_OFFSET 6762306a36Sopenharmony_ci * (e.g. -25 = (-25/4 - 90) = -96.25 dBm) 6862306a36Sopenharmony_ci * range (for 6 signed bits) is (-32 to 31) + offset => -122dBm to -59dBm 6962306a36Sopenharmony_ci * resolution (2 bits) is 0.25dBm 7062306a36Sopenharmony_ci */ 7162306a36Sopenharmony_ci#define NOISE_PWR_DATA_OFFSET -90 7262306a36Sopenharmony_ci#define NOISE_PWR_DBM_2_INT(_p) ((((_p) + 3) >> 2) + NOISE_PWR_DATA_OFFSET) 7362306a36Sopenharmony_ci#define N2DBM(_p) NOISE_PWR_DBM_2_INT(_p) 7462306a36Sopenharmony_ci 7562306a36Sopenharmony_ci/* byte addressable */ 7662306a36Sopenharmony_ci#define AR9300_EEPROM_SIZE (16*1024) 7762306a36Sopenharmony_ci 7862306a36Sopenharmony_ci#define AR9300_BASE_ADDR_4K 0xfff 7962306a36Sopenharmony_ci#define AR9300_BASE_ADDR 0x3ff 8062306a36Sopenharmony_ci#define AR9300_BASE_ADDR_512 0x1ff 8162306a36Sopenharmony_ci 8262306a36Sopenharmony_ci/* AR5416_EEPMISC_BIG_ENDIAN not set indicates little endian */ 8362306a36Sopenharmony_ci#define AR9300_EEPMISC_LITTLE_ENDIAN 0 8462306a36Sopenharmony_ci 8562306a36Sopenharmony_ci#define AR9300_OTP_BASE(_ah) \ 8662306a36Sopenharmony_ci ((AR_SREV_9340(_ah) || AR_SREV_9550(_ah)) ? 0x30000 : 0x14000) 8762306a36Sopenharmony_ci#define AR9300_OTP_STATUS(_ah) \ 8862306a36Sopenharmony_ci ((AR_SREV_9340(_ah) || AR_SREV_9550(_ah)) ? 0x31018 : 0x15f18) 8962306a36Sopenharmony_ci#define AR9300_OTP_STATUS_TYPE 0x7 9062306a36Sopenharmony_ci#define AR9300_OTP_STATUS_VALID 0x4 9162306a36Sopenharmony_ci#define AR9300_OTP_STATUS_ACCESS_BUSY 0x2 9262306a36Sopenharmony_ci#define AR9300_OTP_STATUS_SM_BUSY 0x1 9362306a36Sopenharmony_ci#define AR9300_OTP_READ_DATA(_ah) \ 9462306a36Sopenharmony_ci ((AR_SREV_9340(_ah) || AR_SREV_9550(_ah)) ? 0x3101c : 0x15f1c) 9562306a36Sopenharmony_ci 9662306a36Sopenharmony_cienum targetPowerHTRates { 9762306a36Sopenharmony_ci HT_TARGET_RATE_0_8_16, 9862306a36Sopenharmony_ci HT_TARGET_RATE_1_3_9_11_17_19, 9962306a36Sopenharmony_ci HT_TARGET_RATE_4, 10062306a36Sopenharmony_ci HT_TARGET_RATE_5, 10162306a36Sopenharmony_ci HT_TARGET_RATE_6, 10262306a36Sopenharmony_ci HT_TARGET_RATE_7, 10362306a36Sopenharmony_ci HT_TARGET_RATE_12, 10462306a36Sopenharmony_ci HT_TARGET_RATE_13, 10562306a36Sopenharmony_ci HT_TARGET_RATE_14, 10662306a36Sopenharmony_ci HT_TARGET_RATE_15, 10762306a36Sopenharmony_ci HT_TARGET_RATE_20, 10862306a36Sopenharmony_ci HT_TARGET_RATE_21, 10962306a36Sopenharmony_ci HT_TARGET_RATE_22, 11062306a36Sopenharmony_ci HT_TARGET_RATE_23 11162306a36Sopenharmony_ci}; 11262306a36Sopenharmony_ci 11362306a36Sopenharmony_cienum targetPowerLegacyRates { 11462306a36Sopenharmony_ci LEGACY_TARGET_RATE_6_24, 11562306a36Sopenharmony_ci LEGACY_TARGET_RATE_36, 11662306a36Sopenharmony_ci LEGACY_TARGET_RATE_48, 11762306a36Sopenharmony_ci LEGACY_TARGET_RATE_54 11862306a36Sopenharmony_ci}; 11962306a36Sopenharmony_ci 12062306a36Sopenharmony_cienum targetPowerCckRates { 12162306a36Sopenharmony_ci LEGACY_TARGET_RATE_1L_5L, 12262306a36Sopenharmony_ci LEGACY_TARGET_RATE_5S, 12362306a36Sopenharmony_ci LEGACY_TARGET_RATE_11L, 12462306a36Sopenharmony_ci LEGACY_TARGET_RATE_11S 12562306a36Sopenharmony_ci}; 12662306a36Sopenharmony_ci 12762306a36Sopenharmony_cienum ar9300_Rates { 12862306a36Sopenharmony_ci ALL_TARGET_LEGACY_6_24, 12962306a36Sopenharmony_ci ALL_TARGET_LEGACY_36, 13062306a36Sopenharmony_ci ALL_TARGET_LEGACY_48, 13162306a36Sopenharmony_ci ALL_TARGET_LEGACY_54, 13262306a36Sopenharmony_ci ALL_TARGET_LEGACY_1L_5L, 13362306a36Sopenharmony_ci ALL_TARGET_LEGACY_5S, 13462306a36Sopenharmony_ci ALL_TARGET_LEGACY_11L, 13562306a36Sopenharmony_ci ALL_TARGET_LEGACY_11S, 13662306a36Sopenharmony_ci ALL_TARGET_HT20_0_8_16, 13762306a36Sopenharmony_ci ALL_TARGET_HT20_1_3_9_11_17_19, 13862306a36Sopenharmony_ci ALL_TARGET_HT20_4, 13962306a36Sopenharmony_ci ALL_TARGET_HT20_5, 14062306a36Sopenharmony_ci ALL_TARGET_HT20_6, 14162306a36Sopenharmony_ci ALL_TARGET_HT20_7, 14262306a36Sopenharmony_ci ALL_TARGET_HT20_12, 14362306a36Sopenharmony_ci ALL_TARGET_HT20_13, 14462306a36Sopenharmony_ci ALL_TARGET_HT20_14, 14562306a36Sopenharmony_ci ALL_TARGET_HT20_15, 14662306a36Sopenharmony_ci ALL_TARGET_HT20_20, 14762306a36Sopenharmony_ci ALL_TARGET_HT20_21, 14862306a36Sopenharmony_ci ALL_TARGET_HT20_22, 14962306a36Sopenharmony_ci ALL_TARGET_HT20_23, 15062306a36Sopenharmony_ci ALL_TARGET_HT40_0_8_16, 15162306a36Sopenharmony_ci ALL_TARGET_HT40_1_3_9_11_17_19, 15262306a36Sopenharmony_ci ALL_TARGET_HT40_4, 15362306a36Sopenharmony_ci ALL_TARGET_HT40_5, 15462306a36Sopenharmony_ci ALL_TARGET_HT40_6, 15562306a36Sopenharmony_ci ALL_TARGET_HT40_7, 15662306a36Sopenharmony_ci ALL_TARGET_HT40_12, 15762306a36Sopenharmony_ci ALL_TARGET_HT40_13, 15862306a36Sopenharmony_ci ALL_TARGET_HT40_14, 15962306a36Sopenharmony_ci ALL_TARGET_HT40_15, 16062306a36Sopenharmony_ci ALL_TARGET_HT40_20, 16162306a36Sopenharmony_ci ALL_TARGET_HT40_21, 16262306a36Sopenharmony_ci ALL_TARGET_HT40_22, 16362306a36Sopenharmony_ci ALL_TARGET_HT40_23, 16462306a36Sopenharmony_ci ar9300RateSize, 16562306a36Sopenharmony_ci}; 16662306a36Sopenharmony_ci 16762306a36Sopenharmony_ci 16862306a36Sopenharmony_cistruct eepFlags { 16962306a36Sopenharmony_ci u8 opFlags; 17062306a36Sopenharmony_ci u8 eepMisc; 17162306a36Sopenharmony_ci} __packed; 17262306a36Sopenharmony_ci 17362306a36Sopenharmony_cienum CompressAlgorithm { 17462306a36Sopenharmony_ci _CompressNone = 0, 17562306a36Sopenharmony_ci _CompressLzma, 17662306a36Sopenharmony_ci _CompressPairs, 17762306a36Sopenharmony_ci _CompressBlock, 17862306a36Sopenharmony_ci _Compress4, 17962306a36Sopenharmony_ci _Compress5, 18062306a36Sopenharmony_ci _Compress6, 18162306a36Sopenharmony_ci _Compress7, 18262306a36Sopenharmony_ci}; 18362306a36Sopenharmony_ci 18462306a36Sopenharmony_cistruct ar9300_base_eep_hdr { 18562306a36Sopenharmony_ci __le16 regDmn[2]; 18662306a36Sopenharmony_ci /* 4 bits tx and 4 bits rx */ 18762306a36Sopenharmony_ci u8 txrxMask; 18862306a36Sopenharmony_ci struct eepFlags opCapFlags; 18962306a36Sopenharmony_ci u8 rfSilent; 19062306a36Sopenharmony_ci u8 blueToothOptions; 19162306a36Sopenharmony_ci u8 deviceCap; 19262306a36Sopenharmony_ci /* takes lower byte in eeprom location */ 19362306a36Sopenharmony_ci u8 deviceType; 19462306a36Sopenharmony_ci /* offset in dB to be added to beginning 19562306a36Sopenharmony_ci * of pdadc table in calibration 19662306a36Sopenharmony_ci */ 19762306a36Sopenharmony_ci int8_t pwrTableOffset; 19862306a36Sopenharmony_ci u8 params_for_tuning_caps[2]; 19962306a36Sopenharmony_ci /* 20062306a36Sopenharmony_ci * bit0 - enable tx temp comp 20162306a36Sopenharmony_ci * bit1 - enable tx volt comp 20262306a36Sopenharmony_ci * bit2 - enable fastClock - default to 1 20362306a36Sopenharmony_ci * bit3 - enable doubling - default to 1 20462306a36Sopenharmony_ci * bit4 - enable internal regulator - default to 1 20562306a36Sopenharmony_ci */ 20662306a36Sopenharmony_ci u8 featureEnable; 20762306a36Sopenharmony_ci /* misc flags: bit0 - turn down drivestrength */ 20862306a36Sopenharmony_ci u8 miscConfiguration; 20962306a36Sopenharmony_ci u8 eepromWriteEnableGpio; 21062306a36Sopenharmony_ci u8 wlanDisableGpio; 21162306a36Sopenharmony_ci u8 wlanLedGpio; 21262306a36Sopenharmony_ci u8 rxBandSelectGpio; 21362306a36Sopenharmony_ci u8 txrxgain; 21462306a36Sopenharmony_ci /* SW controlled internal regulator fields */ 21562306a36Sopenharmony_ci __le32 swreg; 21662306a36Sopenharmony_ci} __packed; 21762306a36Sopenharmony_ci 21862306a36Sopenharmony_cistruct ar9300_modal_eep_header { 21962306a36Sopenharmony_ci /* 4 idle, t1, t2, b (4 bits per setting) */ 22062306a36Sopenharmony_ci __le32 antCtrlCommon; 22162306a36Sopenharmony_ci /* 4 ra1l1, ra2l1, ra1l2, ra2l2, ra12 */ 22262306a36Sopenharmony_ci __le32 antCtrlCommon2; 22362306a36Sopenharmony_ci /* 6 idle, t, r, rx1, rx12, b (2 bits each) */ 22462306a36Sopenharmony_ci __le16 antCtrlChain[AR9300_MAX_CHAINS]; 22562306a36Sopenharmony_ci /* 3 xatten1_db for AR9280 (0xa20c/b20c 5:0) */ 22662306a36Sopenharmony_ci u8 xatten1DB[AR9300_MAX_CHAINS]; 22762306a36Sopenharmony_ci /* 3 xatten1_margin for merlin (0xa20c/b20c 16:12 */ 22862306a36Sopenharmony_ci u8 xatten1Margin[AR9300_MAX_CHAINS]; 22962306a36Sopenharmony_ci int8_t tempSlope; 23062306a36Sopenharmony_ci int8_t voltSlope; 23162306a36Sopenharmony_ci /* spur channels in usual fbin coding format */ 23262306a36Sopenharmony_ci u8 spurChans[AR_EEPROM_MODAL_SPURS]; 23362306a36Sopenharmony_ci /* 3 Check if the register is per chain */ 23462306a36Sopenharmony_ci int8_t noiseFloorThreshCh[AR9300_MAX_CHAINS]; 23562306a36Sopenharmony_ci u8 reserved[11]; 23662306a36Sopenharmony_ci int8_t quick_drop; 23762306a36Sopenharmony_ci u8 xpaBiasLvl; 23862306a36Sopenharmony_ci u8 txFrameToDataStart; 23962306a36Sopenharmony_ci u8 txFrameToPaOn; 24062306a36Sopenharmony_ci u8 txClip; 24162306a36Sopenharmony_ci int8_t antennaGain; 24262306a36Sopenharmony_ci u8 switchSettling; 24362306a36Sopenharmony_ci int8_t adcDesiredSize; 24462306a36Sopenharmony_ci u8 txEndToXpaOff; 24562306a36Sopenharmony_ci u8 txEndToRxOn; 24662306a36Sopenharmony_ci u8 txFrameToXpaOn; 24762306a36Sopenharmony_ci u8 thresh62; 24862306a36Sopenharmony_ci __le32 papdRateMaskHt20; 24962306a36Sopenharmony_ci __le32 papdRateMaskHt40; 25062306a36Sopenharmony_ci __le16 switchcomspdt; 25162306a36Sopenharmony_ci u8 xlna_bias_strength; 25262306a36Sopenharmony_ci u8 futureModal[7]; 25362306a36Sopenharmony_ci} __packed; 25462306a36Sopenharmony_ci 25562306a36Sopenharmony_cistruct ar9300_cal_data_per_freq_op_loop { 25662306a36Sopenharmony_ci int8_t refPower; 25762306a36Sopenharmony_ci /* pdadc voltage at power measurement */ 25862306a36Sopenharmony_ci u8 voltMeas; 25962306a36Sopenharmony_ci /* pcdac used for power measurement */ 26062306a36Sopenharmony_ci u8 tempMeas; 26162306a36Sopenharmony_ci /* range is -60 to -127 create a mapping equation 1db resolution */ 26262306a36Sopenharmony_ci int8_t rxNoisefloorCal; 26362306a36Sopenharmony_ci /*range is same as noisefloor */ 26462306a36Sopenharmony_ci int8_t rxNoisefloorPower; 26562306a36Sopenharmony_ci /* temp measured when noisefloor cal was performed */ 26662306a36Sopenharmony_ci u8 rxTempMeas; 26762306a36Sopenharmony_ci} __packed; 26862306a36Sopenharmony_ci 26962306a36Sopenharmony_cistruct cal_tgt_pow_legacy { 27062306a36Sopenharmony_ci u8 tPow2x[4]; 27162306a36Sopenharmony_ci} __packed; 27262306a36Sopenharmony_ci 27362306a36Sopenharmony_cistruct cal_tgt_pow_ht { 27462306a36Sopenharmony_ci u8 tPow2x[14]; 27562306a36Sopenharmony_ci} __packed; 27662306a36Sopenharmony_ci 27762306a36Sopenharmony_cistruct cal_ctl_data_2g { 27862306a36Sopenharmony_ci u8 ctlEdges[AR9300_NUM_BAND_EDGES_2G]; 27962306a36Sopenharmony_ci} __packed; 28062306a36Sopenharmony_ci 28162306a36Sopenharmony_cistruct cal_ctl_data_5g { 28262306a36Sopenharmony_ci u8 ctlEdges[AR9300_NUM_BAND_EDGES_5G]; 28362306a36Sopenharmony_ci} __packed; 28462306a36Sopenharmony_ci 28562306a36Sopenharmony_ci#define MAX_BASE_EXTENSION_FUTURE 2 28662306a36Sopenharmony_ci 28762306a36Sopenharmony_cistruct ar9300_BaseExtension_1 { 28862306a36Sopenharmony_ci u8 ant_div_control; 28962306a36Sopenharmony_ci u8 future[MAX_BASE_EXTENSION_FUTURE]; 29062306a36Sopenharmony_ci /* 29162306a36Sopenharmony_ci * misc_enable: 29262306a36Sopenharmony_ci * 29362306a36Sopenharmony_ci * BIT 0 - TX Gain Cap enable. 29462306a36Sopenharmony_ci * BIT 1 - Uncompressed Checksum enable. 29562306a36Sopenharmony_ci * BIT 2/3 - MinCCApwr enable 2g/5g. 29662306a36Sopenharmony_ci */ 29762306a36Sopenharmony_ci u8 misc_enable; 29862306a36Sopenharmony_ci int8_t tempslopextension[8]; 29962306a36Sopenharmony_ci int8_t quick_drop_low; 30062306a36Sopenharmony_ci int8_t quick_drop_high; 30162306a36Sopenharmony_ci} __packed; 30262306a36Sopenharmony_ci 30362306a36Sopenharmony_cistruct ar9300_BaseExtension_2 { 30462306a36Sopenharmony_ci int8_t tempSlopeLow; 30562306a36Sopenharmony_ci int8_t tempSlopeHigh; 30662306a36Sopenharmony_ci u8 xatten1DBLow[AR9300_MAX_CHAINS]; 30762306a36Sopenharmony_ci u8 xatten1MarginLow[AR9300_MAX_CHAINS]; 30862306a36Sopenharmony_ci u8 xatten1DBHigh[AR9300_MAX_CHAINS]; 30962306a36Sopenharmony_ci u8 xatten1MarginHigh[AR9300_MAX_CHAINS]; 31062306a36Sopenharmony_ci} __packed; 31162306a36Sopenharmony_ci 31262306a36Sopenharmony_cistruct ar9300_eeprom { 31362306a36Sopenharmony_ci u8 eepromVersion; 31462306a36Sopenharmony_ci u8 templateVersion; 31562306a36Sopenharmony_ci u8 macAddr[6]; 31662306a36Sopenharmony_ci u8 custData[AR9300_CUSTOMER_DATA_SIZE]; 31762306a36Sopenharmony_ci 31862306a36Sopenharmony_ci struct ar9300_base_eep_hdr baseEepHeader; 31962306a36Sopenharmony_ci 32062306a36Sopenharmony_ci struct ar9300_modal_eep_header modalHeader2G; 32162306a36Sopenharmony_ci struct ar9300_BaseExtension_1 base_ext1; 32262306a36Sopenharmony_ci u8 calFreqPier2G[AR9300_NUM_2G_CAL_PIERS]; 32362306a36Sopenharmony_ci struct ar9300_cal_data_per_freq_op_loop 32462306a36Sopenharmony_ci calPierData2G[AR9300_MAX_CHAINS][AR9300_NUM_2G_CAL_PIERS]; 32562306a36Sopenharmony_ci u8 calTarget_freqbin_Cck[AR9300_NUM_2G_CCK_TARGET_POWERS]; 32662306a36Sopenharmony_ci u8 calTarget_freqbin_2G[AR9300_NUM_2G_20_TARGET_POWERS]; 32762306a36Sopenharmony_ci u8 calTarget_freqbin_2GHT20[AR9300_NUM_2G_20_TARGET_POWERS]; 32862306a36Sopenharmony_ci u8 calTarget_freqbin_2GHT40[AR9300_NUM_2G_40_TARGET_POWERS]; 32962306a36Sopenharmony_ci struct cal_tgt_pow_legacy 33062306a36Sopenharmony_ci calTargetPowerCck[AR9300_NUM_2G_CCK_TARGET_POWERS]; 33162306a36Sopenharmony_ci struct cal_tgt_pow_legacy 33262306a36Sopenharmony_ci calTargetPower2G[AR9300_NUM_2G_20_TARGET_POWERS]; 33362306a36Sopenharmony_ci struct cal_tgt_pow_ht 33462306a36Sopenharmony_ci calTargetPower2GHT20[AR9300_NUM_2G_20_TARGET_POWERS]; 33562306a36Sopenharmony_ci struct cal_tgt_pow_ht 33662306a36Sopenharmony_ci calTargetPower2GHT40[AR9300_NUM_2G_40_TARGET_POWERS]; 33762306a36Sopenharmony_ci u8 ctlIndex_2G[AR9300_NUM_CTLS_2G]; 33862306a36Sopenharmony_ci u8 ctl_freqbin_2G[AR9300_NUM_CTLS_2G][AR9300_NUM_BAND_EDGES_2G]; 33962306a36Sopenharmony_ci struct cal_ctl_data_2g ctlPowerData_2G[AR9300_NUM_CTLS_2G]; 34062306a36Sopenharmony_ci struct ar9300_modal_eep_header modalHeader5G; 34162306a36Sopenharmony_ci struct ar9300_BaseExtension_2 base_ext2; 34262306a36Sopenharmony_ci u8 calFreqPier5G[AR9300_NUM_5G_CAL_PIERS]; 34362306a36Sopenharmony_ci struct ar9300_cal_data_per_freq_op_loop 34462306a36Sopenharmony_ci calPierData5G[AR9300_MAX_CHAINS][AR9300_NUM_5G_CAL_PIERS]; 34562306a36Sopenharmony_ci u8 calTarget_freqbin_5G[AR9300_NUM_5G_20_TARGET_POWERS]; 34662306a36Sopenharmony_ci u8 calTarget_freqbin_5GHT20[AR9300_NUM_5G_20_TARGET_POWERS]; 34762306a36Sopenharmony_ci u8 calTarget_freqbin_5GHT40[AR9300_NUM_5G_40_TARGET_POWERS]; 34862306a36Sopenharmony_ci struct cal_tgt_pow_legacy 34962306a36Sopenharmony_ci calTargetPower5G[AR9300_NUM_5G_20_TARGET_POWERS]; 35062306a36Sopenharmony_ci struct cal_tgt_pow_ht 35162306a36Sopenharmony_ci calTargetPower5GHT20[AR9300_NUM_5G_20_TARGET_POWERS]; 35262306a36Sopenharmony_ci struct cal_tgt_pow_ht 35362306a36Sopenharmony_ci calTargetPower5GHT40[AR9300_NUM_5G_40_TARGET_POWERS]; 35462306a36Sopenharmony_ci u8 ctlIndex_5G[AR9300_NUM_CTLS_5G]; 35562306a36Sopenharmony_ci u8 ctl_freqbin_5G[AR9300_NUM_CTLS_5G][AR9300_NUM_BAND_EDGES_5G]; 35662306a36Sopenharmony_ci struct cal_ctl_data_5g ctlPowerData_5G[AR9300_NUM_CTLS_5G]; 35762306a36Sopenharmony_ci} __packed; 35862306a36Sopenharmony_ci 35962306a36Sopenharmony_cis32 ar9003_hw_get_tx_gain_idx(struct ath_hw *ah); 36062306a36Sopenharmony_cis32 ar9003_hw_get_rx_gain_idx(struct ath_hw *ah); 36162306a36Sopenharmony_ciu32 ar9003_hw_ant_ctrl_common_get(struct ath_hw *ah, bool is2ghz); 36262306a36Sopenharmony_ciu32 ar9003_hw_ant_ctrl_common_2_get(struct ath_hw *ah, bool is2ghz); 36362306a36Sopenharmony_ci 36462306a36Sopenharmony_ciu8 *ar9003_get_spur_chan_ptr(struct ath_hw *ah, bool is_2ghz); 36562306a36Sopenharmony_ci 36662306a36Sopenharmony_ciu32 ar9003_get_paprd_rate_mask_ht20(struct ath_hw *ah, bool is2ghz); 36762306a36Sopenharmony_ciu32 ar9003_get_paprd_rate_mask_ht40(struct ath_hw *ah, bool is2ghz); 36862306a36Sopenharmony_ciunsigned int ar9003_get_paprd_scale_factor(struct ath_hw *ah, 36962306a36Sopenharmony_ci struct ath9k_channel *chan); 37062306a36Sopenharmony_ci 37162306a36Sopenharmony_civoid ar9003_hw_internal_regulator_apply(struct ath_hw *ah); 37262306a36Sopenharmony_ciint ar9003_hw_tx_power_regwrite(struct ath_hw *ah, u8 * pPwrArray); 37362306a36Sopenharmony_ci 37462306a36Sopenharmony_ci#endif 375