18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * Copyright (c) 2010-2011 Atheros Communications Inc. 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Permission to use, copy, modify, and/or distribute this software for any 58c2ecf20Sopenharmony_ci * purpose with or without fee is hereby granted, provided that the above 68c2ecf20Sopenharmony_ci * copyright notice and this permission notice appear in all copies. 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 98c2ecf20Sopenharmony_ci * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 108c2ecf20Sopenharmony_ci * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 118c2ecf20Sopenharmony_ci * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 128c2ecf20Sopenharmony_ci * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 138c2ecf20Sopenharmony_ci * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 148c2ecf20Sopenharmony_ci * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 158c2ecf20Sopenharmony_ci */ 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci#ifndef AR9003_EEPROM_H 188c2ecf20Sopenharmony_ci#define AR9003_EEPROM_H 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci#include <linux/types.h> 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci#define AR9300_EEP_VER 0xD000 238c2ecf20Sopenharmony_ci#define AR9300_EEP_VER_MINOR_MASK 0xFFF 248c2ecf20Sopenharmony_ci#define AR9300_EEP_MINOR_VER_1 0x1 258c2ecf20Sopenharmony_ci#define AR9300_EEP_MINOR_VER AR9300_EEP_MINOR_VER_1 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci/* 16-bit offset location start of calibration struct */ 288c2ecf20Sopenharmony_ci#define AR9300_EEP_START_LOC 256 298c2ecf20Sopenharmony_ci#define AR9300_NUM_5G_CAL_PIERS 8 308c2ecf20Sopenharmony_ci#define AR9300_NUM_2G_CAL_PIERS 3 318c2ecf20Sopenharmony_ci#define AR9300_NUM_5G_20_TARGET_POWERS 8 328c2ecf20Sopenharmony_ci#define AR9300_NUM_5G_40_TARGET_POWERS 8 338c2ecf20Sopenharmony_ci#define AR9300_NUM_2G_CCK_TARGET_POWERS 2 348c2ecf20Sopenharmony_ci#define AR9300_NUM_2G_20_TARGET_POWERS 3 358c2ecf20Sopenharmony_ci#define AR9300_NUM_2G_40_TARGET_POWERS 3 368c2ecf20Sopenharmony_ci/* #define AR9300_NUM_CTLS 21 */ 378c2ecf20Sopenharmony_ci#define AR9300_NUM_CTLS_5G 9 388c2ecf20Sopenharmony_ci#define AR9300_NUM_CTLS_2G 12 398c2ecf20Sopenharmony_ci#define AR9300_NUM_BAND_EDGES_5G 8 408c2ecf20Sopenharmony_ci#define AR9300_NUM_BAND_EDGES_2G 4 418c2ecf20Sopenharmony_ci#define AR9300_EEPMISC_WOW 0x02 428c2ecf20Sopenharmony_ci#define AR9300_CUSTOMER_DATA_SIZE 20 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci#define AR9300_MAX_CHAINS 3 458c2ecf20Sopenharmony_ci#define AR9300_ANT_16S 25 468c2ecf20Sopenharmony_ci#define AR9300_FUTURE_MODAL_SZ 6 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_ci#define AR9300_PAPRD_RATE_MASK 0x01ffffff 498c2ecf20Sopenharmony_ci#define AR9300_PAPRD_SCALE_1 0x0e000000 508c2ecf20Sopenharmony_ci#define AR9300_PAPRD_SCALE_1_S 25 518c2ecf20Sopenharmony_ci#define AR9300_PAPRD_SCALE_2 0x70000000 528c2ecf20Sopenharmony_ci#define AR9300_PAPRD_SCALE_2_S 28 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_ci#define AR9300_EEP_ANTDIV_CONTROL_DEFAULT_VALUE 0xc9 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci/* Delta from which to start power to pdadc table */ 578c2ecf20Sopenharmony_ci/* This offset is used in both open loop and closed loop power control 588c2ecf20Sopenharmony_ci * schemes. In open loop power control, it is not really needed, but for 598c2ecf20Sopenharmony_ci * the "sake of consistency" it was kept. For certain AP designs, this 608c2ecf20Sopenharmony_ci * value is overwritten by the value in the flag "pwrTableOffset" just 618c2ecf20Sopenharmony_ci * before writing the pdadc vs pwr into the chip registers. 628c2ecf20Sopenharmony_ci */ 638c2ecf20Sopenharmony_ci#define AR9300_PWR_TABLE_OFFSET 0 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_ci/* Noise power data definitions 668c2ecf20Sopenharmony_ci * units are: 4 x dBm - NOISE_PWR_DATA_OFFSET 678c2ecf20Sopenharmony_ci * (e.g. -25 = (-25/4 - 90) = -96.25 dBm) 688c2ecf20Sopenharmony_ci * range (for 6 signed bits) is (-32 to 31) + offset => -122dBm to -59dBm 698c2ecf20Sopenharmony_ci * resolution (2 bits) is 0.25dBm 708c2ecf20Sopenharmony_ci */ 718c2ecf20Sopenharmony_ci#define NOISE_PWR_DATA_OFFSET -90 728c2ecf20Sopenharmony_ci#define NOISE_PWR_DBM_2_INT(_p) ((((_p) + 3) >> 2) + NOISE_PWR_DATA_OFFSET) 738c2ecf20Sopenharmony_ci#define N2DBM(_p) NOISE_PWR_DBM_2_INT(_p) 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_ci/* byte addressable */ 768c2ecf20Sopenharmony_ci#define AR9300_EEPROM_SIZE (16*1024) 778c2ecf20Sopenharmony_ci 788c2ecf20Sopenharmony_ci#define AR9300_BASE_ADDR_4K 0xfff 798c2ecf20Sopenharmony_ci#define AR9300_BASE_ADDR 0x3ff 808c2ecf20Sopenharmony_ci#define AR9300_BASE_ADDR_512 0x1ff 818c2ecf20Sopenharmony_ci 828c2ecf20Sopenharmony_ci/* AR5416_EEPMISC_BIG_ENDIAN not set indicates little endian */ 838c2ecf20Sopenharmony_ci#define AR9300_EEPMISC_LITTLE_ENDIAN 0 848c2ecf20Sopenharmony_ci 858c2ecf20Sopenharmony_ci#define AR9300_OTP_BASE \ 868c2ecf20Sopenharmony_ci ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30000 : 0x14000) 878c2ecf20Sopenharmony_ci#define AR9300_OTP_STATUS \ 888c2ecf20Sopenharmony_ci ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x31018 : 0x15f18) 898c2ecf20Sopenharmony_ci#define AR9300_OTP_STATUS_TYPE 0x7 908c2ecf20Sopenharmony_ci#define AR9300_OTP_STATUS_VALID 0x4 918c2ecf20Sopenharmony_ci#define AR9300_OTP_STATUS_ACCESS_BUSY 0x2 928c2ecf20Sopenharmony_ci#define AR9300_OTP_STATUS_SM_BUSY 0x1 938c2ecf20Sopenharmony_ci#define AR9300_OTP_READ_DATA \ 948c2ecf20Sopenharmony_ci ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x3101c : 0x15f1c) 958c2ecf20Sopenharmony_ci 968c2ecf20Sopenharmony_cienum targetPowerHTRates { 978c2ecf20Sopenharmony_ci HT_TARGET_RATE_0_8_16, 988c2ecf20Sopenharmony_ci HT_TARGET_RATE_1_3_9_11_17_19, 998c2ecf20Sopenharmony_ci HT_TARGET_RATE_4, 1008c2ecf20Sopenharmony_ci HT_TARGET_RATE_5, 1018c2ecf20Sopenharmony_ci HT_TARGET_RATE_6, 1028c2ecf20Sopenharmony_ci HT_TARGET_RATE_7, 1038c2ecf20Sopenharmony_ci HT_TARGET_RATE_12, 1048c2ecf20Sopenharmony_ci HT_TARGET_RATE_13, 1058c2ecf20Sopenharmony_ci HT_TARGET_RATE_14, 1068c2ecf20Sopenharmony_ci HT_TARGET_RATE_15, 1078c2ecf20Sopenharmony_ci HT_TARGET_RATE_20, 1088c2ecf20Sopenharmony_ci HT_TARGET_RATE_21, 1098c2ecf20Sopenharmony_ci HT_TARGET_RATE_22, 1108c2ecf20Sopenharmony_ci HT_TARGET_RATE_23 1118c2ecf20Sopenharmony_ci}; 1128c2ecf20Sopenharmony_ci 1138c2ecf20Sopenharmony_cienum targetPowerLegacyRates { 1148c2ecf20Sopenharmony_ci LEGACY_TARGET_RATE_6_24, 1158c2ecf20Sopenharmony_ci LEGACY_TARGET_RATE_36, 1168c2ecf20Sopenharmony_ci LEGACY_TARGET_RATE_48, 1178c2ecf20Sopenharmony_ci LEGACY_TARGET_RATE_54 1188c2ecf20Sopenharmony_ci}; 1198c2ecf20Sopenharmony_ci 1208c2ecf20Sopenharmony_cienum targetPowerCckRates { 1218c2ecf20Sopenharmony_ci LEGACY_TARGET_RATE_1L_5L, 1228c2ecf20Sopenharmony_ci LEGACY_TARGET_RATE_5S, 1238c2ecf20Sopenharmony_ci LEGACY_TARGET_RATE_11L, 1248c2ecf20Sopenharmony_ci LEGACY_TARGET_RATE_11S 1258c2ecf20Sopenharmony_ci}; 1268c2ecf20Sopenharmony_ci 1278c2ecf20Sopenharmony_cienum ar9300_Rates { 1288c2ecf20Sopenharmony_ci ALL_TARGET_LEGACY_6_24, 1298c2ecf20Sopenharmony_ci ALL_TARGET_LEGACY_36, 1308c2ecf20Sopenharmony_ci ALL_TARGET_LEGACY_48, 1318c2ecf20Sopenharmony_ci ALL_TARGET_LEGACY_54, 1328c2ecf20Sopenharmony_ci ALL_TARGET_LEGACY_1L_5L, 1338c2ecf20Sopenharmony_ci ALL_TARGET_LEGACY_5S, 1348c2ecf20Sopenharmony_ci ALL_TARGET_LEGACY_11L, 1358c2ecf20Sopenharmony_ci ALL_TARGET_LEGACY_11S, 1368c2ecf20Sopenharmony_ci ALL_TARGET_HT20_0_8_16, 1378c2ecf20Sopenharmony_ci ALL_TARGET_HT20_1_3_9_11_17_19, 1388c2ecf20Sopenharmony_ci ALL_TARGET_HT20_4, 1398c2ecf20Sopenharmony_ci ALL_TARGET_HT20_5, 1408c2ecf20Sopenharmony_ci ALL_TARGET_HT20_6, 1418c2ecf20Sopenharmony_ci ALL_TARGET_HT20_7, 1428c2ecf20Sopenharmony_ci ALL_TARGET_HT20_12, 1438c2ecf20Sopenharmony_ci ALL_TARGET_HT20_13, 1448c2ecf20Sopenharmony_ci ALL_TARGET_HT20_14, 1458c2ecf20Sopenharmony_ci ALL_TARGET_HT20_15, 1468c2ecf20Sopenharmony_ci ALL_TARGET_HT20_20, 1478c2ecf20Sopenharmony_ci ALL_TARGET_HT20_21, 1488c2ecf20Sopenharmony_ci ALL_TARGET_HT20_22, 1498c2ecf20Sopenharmony_ci ALL_TARGET_HT20_23, 1508c2ecf20Sopenharmony_ci ALL_TARGET_HT40_0_8_16, 1518c2ecf20Sopenharmony_ci ALL_TARGET_HT40_1_3_9_11_17_19, 1528c2ecf20Sopenharmony_ci ALL_TARGET_HT40_4, 1538c2ecf20Sopenharmony_ci ALL_TARGET_HT40_5, 1548c2ecf20Sopenharmony_ci ALL_TARGET_HT40_6, 1558c2ecf20Sopenharmony_ci ALL_TARGET_HT40_7, 1568c2ecf20Sopenharmony_ci ALL_TARGET_HT40_12, 1578c2ecf20Sopenharmony_ci ALL_TARGET_HT40_13, 1588c2ecf20Sopenharmony_ci ALL_TARGET_HT40_14, 1598c2ecf20Sopenharmony_ci ALL_TARGET_HT40_15, 1608c2ecf20Sopenharmony_ci ALL_TARGET_HT40_20, 1618c2ecf20Sopenharmony_ci ALL_TARGET_HT40_21, 1628c2ecf20Sopenharmony_ci ALL_TARGET_HT40_22, 1638c2ecf20Sopenharmony_ci ALL_TARGET_HT40_23, 1648c2ecf20Sopenharmony_ci ar9300RateSize, 1658c2ecf20Sopenharmony_ci}; 1668c2ecf20Sopenharmony_ci 1678c2ecf20Sopenharmony_ci 1688c2ecf20Sopenharmony_cistruct eepFlags { 1698c2ecf20Sopenharmony_ci u8 opFlags; 1708c2ecf20Sopenharmony_ci u8 eepMisc; 1718c2ecf20Sopenharmony_ci} __packed; 1728c2ecf20Sopenharmony_ci 1738c2ecf20Sopenharmony_cienum CompressAlgorithm { 1748c2ecf20Sopenharmony_ci _CompressNone = 0, 1758c2ecf20Sopenharmony_ci _CompressLzma, 1768c2ecf20Sopenharmony_ci _CompressPairs, 1778c2ecf20Sopenharmony_ci _CompressBlock, 1788c2ecf20Sopenharmony_ci _Compress4, 1798c2ecf20Sopenharmony_ci _Compress5, 1808c2ecf20Sopenharmony_ci _Compress6, 1818c2ecf20Sopenharmony_ci _Compress7, 1828c2ecf20Sopenharmony_ci}; 1838c2ecf20Sopenharmony_ci 1848c2ecf20Sopenharmony_cistruct ar9300_base_eep_hdr { 1858c2ecf20Sopenharmony_ci __le16 regDmn[2]; 1868c2ecf20Sopenharmony_ci /* 4 bits tx and 4 bits rx */ 1878c2ecf20Sopenharmony_ci u8 txrxMask; 1888c2ecf20Sopenharmony_ci struct eepFlags opCapFlags; 1898c2ecf20Sopenharmony_ci u8 rfSilent; 1908c2ecf20Sopenharmony_ci u8 blueToothOptions; 1918c2ecf20Sopenharmony_ci u8 deviceCap; 1928c2ecf20Sopenharmony_ci /* takes lower byte in eeprom location */ 1938c2ecf20Sopenharmony_ci u8 deviceType; 1948c2ecf20Sopenharmony_ci /* offset in dB to be added to beginning 1958c2ecf20Sopenharmony_ci * of pdadc table in calibration 1968c2ecf20Sopenharmony_ci */ 1978c2ecf20Sopenharmony_ci int8_t pwrTableOffset; 1988c2ecf20Sopenharmony_ci u8 params_for_tuning_caps[2]; 1998c2ecf20Sopenharmony_ci /* 2008c2ecf20Sopenharmony_ci * bit0 - enable tx temp comp 2018c2ecf20Sopenharmony_ci * bit1 - enable tx volt comp 2028c2ecf20Sopenharmony_ci * bit2 - enable fastClock - default to 1 2038c2ecf20Sopenharmony_ci * bit3 - enable doubling - default to 1 2048c2ecf20Sopenharmony_ci * bit4 - enable internal regulator - default to 1 2058c2ecf20Sopenharmony_ci */ 2068c2ecf20Sopenharmony_ci u8 featureEnable; 2078c2ecf20Sopenharmony_ci /* misc flags: bit0 - turn down drivestrength */ 2088c2ecf20Sopenharmony_ci u8 miscConfiguration; 2098c2ecf20Sopenharmony_ci u8 eepromWriteEnableGpio; 2108c2ecf20Sopenharmony_ci u8 wlanDisableGpio; 2118c2ecf20Sopenharmony_ci u8 wlanLedGpio; 2128c2ecf20Sopenharmony_ci u8 rxBandSelectGpio; 2138c2ecf20Sopenharmony_ci u8 txrxgain; 2148c2ecf20Sopenharmony_ci /* SW controlled internal regulator fields */ 2158c2ecf20Sopenharmony_ci __le32 swreg; 2168c2ecf20Sopenharmony_ci} __packed; 2178c2ecf20Sopenharmony_ci 2188c2ecf20Sopenharmony_cistruct ar9300_modal_eep_header { 2198c2ecf20Sopenharmony_ci /* 4 idle, t1, t2, b (4 bits per setting) */ 2208c2ecf20Sopenharmony_ci __le32 antCtrlCommon; 2218c2ecf20Sopenharmony_ci /* 4 ra1l1, ra2l1, ra1l2, ra2l2, ra12 */ 2228c2ecf20Sopenharmony_ci __le32 antCtrlCommon2; 2238c2ecf20Sopenharmony_ci /* 6 idle, t, r, rx1, rx12, b (2 bits each) */ 2248c2ecf20Sopenharmony_ci __le16 antCtrlChain[AR9300_MAX_CHAINS]; 2258c2ecf20Sopenharmony_ci /* 3 xatten1_db for AR9280 (0xa20c/b20c 5:0) */ 2268c2ecf20Sopenharmony_ci u8 xatten1DB[AR9300_MAX_CHAINS]; 2278c2ecf20Sopenharmony_ci /* 3 xatten1_margin for merlin (0xa20c/b20c 16:12 */ 2288c2ecf20Sopenharmony_ci u8 xatten1Margin[AR9300_MAX_CHAINS]; 2298c2ecf20Sopenharmony_ci int8_t tempSlope; 2308c2ecf20Sopenharmony_ci int8_t voltSlope; 2318c2ecf20Sopenharmony_ci /* spur channels in usual fbin coding format */ 2328c2ecf20Sopenharmony_ci u8 spurChans[AR_EEPROM_MODAL_SPURS]; 2338c2ecf20Sopenharmony_ci /* 3 Check if the register is per chain */ 2348c2ecf20Sopenharmony_ci int8_t noiseFloorThreshCh[AR9300_MAX_CHAINS]; 2358c2ecf20Sopenharmony_ci u8 reserved[11]; 2368c2ecf20Sopenharmony_ci int8_t quick_drop; 2378c2ecf20Sopenharmony_ci u8 xpaBiasLvl; 2388c2ecf20Sopenharmony_ci u8 txFrameToDataStart; 2398c2ecf20Sopenharmony_ci u8 txFrameToPaOn; 2408c2ecf20Sopenharmony_ci u8 txClip; 2418c2ecf20Sopenharmony_ci int8_t antennaGain; 2428c2ecf20Sopenharmony_ci u8 switchSettling; 2438c2ecf20Sopenharmony_ci int8_t adcDesiredSize; 2448c2ecf20Sopenharmony_ci u8 txEndToXpaOff; 2458c2ecf20Sopenharmony_ci u8 txEndToRxOn; 2468c2ecf20Sopenharmony_ci u8 txFrameToXpaOn; 2478c2ecf20Sopenharmony_ci u8 thresh62; 2488c2ecf20Sopenharmony_ci __le32 papdRateMaskHt20; 2498c2ecf20Sopenharmony_ci __le32 papdRateMaskHt40; 2508c2ecf20Sopenharmony_ci __le16 switchcomspdt; 2518c2ecf20Sopenharmony_ci u8 xlna_bias_strength; 2528c2ecf20Sopenharmony_ci u8 futureModal[7]; 2538c2ecf20Sopenharmony_ci} __packed; 2548c2ecf20Sopenharmony_ci 2558c2ecf20Sopenharmony_cistruct ar9300_cal_data_per_freq_op_loop { 2568c2ecf20Sopenharmony_ci int8_t refPower; 2578c2ecf20Sopenharmony_ci /* pdadc voltage at power measurement */ 2588c2ecf20Sopenharmony_ci u8 voltMeas; 2598c2ecf20Sopenharmony_ci /* pcdac used for power measurement */ 2608c2ecf20Sopenharmony_ci u8 tempMeas; 2618c2ecf20Sopenharmony_ci /* range is -60 to -127 create a mapping equation 1db resolution */ 2628c2ecf20Sopenharmony_ci int8_t rxNoisefloorCal; 2638c2ecf20Sopenharmony_ci /*range is same as noisefloor */ 2648c2ecf20Sopenharmony_ci int8_t rxNoisefloorPower; 2658c2ecf20Sopenharmony_ci /* temp measured when noisefloor cal was performed */ 2668c2ecf20Sopenharmony_ci u8 rxTempMeas; 2678c2ecf20Sopenharmony_ci} __packed; 2688c2ecf20Sopenharmony_ci 2698c2ecf20Sopenharmony_cistruct cal_tgt_pow_legacy { 2708c2ecf20Sopenharmony_ci u8 tPow2x[4]; 2718c2ecf20Sopenharmony_ci} __packed; 2728c2ecf20Sopenharmony_ci 2738c2ecf20Sopenharmony_cistruct cal_tgt_pow_ht { 2748c2ecf20Sopenharmony_ci u8 tPow2x[14]; 2758c2ecf20Sopenharmony_ci} __packed; 2768c2ecf20Sopenharmony_ci 2778c2ecf20Sopenharmony_cistruct cal_ctl_data_2g { 2788c2ecf20Sopenharmony_ci u8 ctlEdges[AR9300_NUM_BAND_EDGES_2G]; 2798c2ecf20Sopenharmony_ci} __packed; 2808c2ecf20Sopenharmony_ci 2818c2ecf20Sopenharmony_cistruct cal_ctl_data_5g { 2828c2ecf20Sopenharmony_ci u8 ctlEdges[AR9300_NUM_BAND_EDGES_5G]; 2838c2ecf20Sopenharmony_ci} __packed; 2848c2ecf20Sopenharmony_ci 2858c2ecf20Sopenharmony_ci#define MAX_BASE_EXTENSION_FUTURE 2 2868c2ecf20Sopenharmony_ci 2878c2ecf20Sopenharmony_cistruct ar9300_BaseExtension_1 { 2888c2ecf20Sopenharmony_ci u8 ant_div_control; 2898c2ecf20Sopenharmony_ci u8 future[MAX_BASE_EXTENSION_FUTURE]; 2908c2ecf20Sopenharmony_ci /* 2918c2ecf20Sopenharmony_ci * misc_enable: 2928c2ecf20Sopenharmony_ci * 2938c2ecf20Sopenharmony_ci * BIT 0 - TX Gain Cap enable. 2948c2ecf20Sopenharmony_ci * BIT 1 - Uncompressed Checksum enable. 2958c2ecf20Sopenharmony_ci * BIT 2/3 - MinCCApwr enable 2g/5g. 2968c2ecf20Sopenharmony_ci */ 2978c2ecf20Sopenharmony_ci u8 misc_enable; 2988c2ecf20Sopenharmony_ci int8_t tempslopextension[8]; 2998c2ecf20Sopenharmony_ci int8_t quick_drop_low; 3008c2ecf20Sopenharmony_ci int8_t quick_drop_high; 3018c2ecf20Sopenharmony_ci} __packed; 3028c2ecf20Sopenharmony_ci 3038c2ecf20Sopenharmony_cistruct ar9300_BaseExtension_2 { 3048c2ecf20Sopenharmony_ci int8_t tempSlopeLow; 3058c2ecf20Sopenharmony_ci int8_t tempSlopeHigh; 3068c2ecf20Sopenharmony_ci u8 xatten1DBLow[AR9300_MAX_CHAINS]; 3078c2ecf20Sopenharmony_ci u8 xatten1MarginLow[AR9300_MAX_CHAINS]; 3088c2ecf20Sopenharmony_ci u8 xatten1DBHigh[AR9300_MAX_CHAINS]; 3098c2ecf20Sopenharmony_ci u8 xatten1MarginHigh[AR9300_MAX_CHAINS]; 3108c2ecf20Sopenharmony_ci} __packed; 3118c2ecf20Sopenharmony_ci 3128c2ecf20Sopenharmony_cistruct ar9300_eeprom { 3138c2ecf20Sopenharmony_ci u8 eepromVersion; 3148c2ecf20Sopenharmony_ci u8 templateVersion; 3158c2ecf20Sopenharmony_ci u8 macAddr[6]; 3168c2ecf20Sopenharmony_ci u8 custData[AR9300_CUSTOMER_DATA_SIZE]; 3178c2ecf20Sopenharmony_ci 3188c2ecf20Sopenharmony_ci struct ar9300_base_eep_hdr baseEepHeader; 3198c2ecf20Sopenharmony_ci 3208c2ecf20Sopenharmony_ci struct ar9300_modal_eep_header modalHeader2G; 3218c2ecf20Sopenharmony_ci struct ar9300_BaseExtension_1 base_ext1; 3228c2ecf20Sopenharmony_ci u8 calFreqPier2G[AR9300_NUM_2G_CAL_PIERS]; 3238c2ecf20Sopenharmony_ci struct ar9300_cal_data_per_freq_op_loop 3248c2ecf20Sopenharmony_ci calPierData2G[AR9300_MAX_CHAINS][AR9300_NUM_2G_CAL_PIERS]; 3258c2ecf20Sopenharmony_ci u8 calTarget_freqbin_Cck[AR9300_NUM_2G_CCK_TARGET_POWERS]; 3268c2ecf20Sopenharmony_ci u8 calTarget_freqbin_2G[AR9300_NUM_2G_20_TARGET_POWERS]; 3278c2ecf20Sopenharmony_ci u8 calTarget_freqbin_2GHT20[AR9300_NUM_2G_20_TARGET_POWERS]; 3288c2ecf20Sopenharmony_ci u8 calTarget_freqbin_2GHT40[AR9300_NUM_2G_40_TARGET_POWERS]; 3298c2ecf20Sopenharmony_ci struct cal_tgt_pow_legacy 3308c2ecf20Sopenharmony_ci calTargetPowerCck[AR9300_NUM_2G_CCK_TARGET_POWERS]; 3318c2ecf20Sopenharmony_ci struct cal_tgt_pow_legacy 3328c2ecf20Sopenharmony_ci calTargetPower2G[AR9300_NUM_2G_20_TARGET_POWERS]; 3338c2ecf20Sopenharmony_ci struct cal_tgt_pow_ht 3348c2ecf20Sopenharmony_ci calTargetPower2GHT20[AR9300_NUM_2G_20_TARGET_POWERS]; 3358c2ecf20Sopenharmony_ci struct cal_tgt_pow_ht 3368c2ecf20Sopenharmony_ci calTargetPower2GHT40[AR9300_NUM_2G_40_TARGET_POWERS]; 3378c2ecf20Sopenharmony_ci u8 ctlIndex_2G[AR9300_NUM_CTLS_2G]; 3388c2ecf20Sopenharmony_ci u8 ctl_freqbin_2G[AR9300_NUM_CTLS_2G][AR9300_NUM_BAND_EDGES_2G]; 3398c2ecf20Sopenharmony_ci struct cal_ctl_data_2g ctlPowerData_2G[AR9300_NUM_CTLS_2G]; 3408c2ecf20Sopenharmony_ci struct ar9300_modal_eep_header modalHeader5G; 3418c2ecf20Sopenharmony_ci struct ar9300_BaseExtension_2 base_ext2; 3428c2ecf20Sopenharmony_ci u8 calFreqPier5G[AR9300_NUM_5G_CAL_PIERS]; 3438c2ecf20Sopenharmony_ci struct ar9300_cal_data_per_freq_op_loop 3448c2ecf20Sopenharmony_ci calPierData5G[AR9300_MAX_CHAINS][AR9300_NUM_5G_CAL_PIERS]; 3458c2ecf20Sopenharmony_ci u8 calTarget_freqbin_5G[AR9300_NUM_5G_20_TARGET_POWERS]; 3468c2ecf20Sopenharmony_ci u8 calTarget_freqbin_5GHT20[AR9300_NUM_5G_20_TARGET_POWERS]; 3478c2ecf20Sopenharmony_ci u8 calTarget_freqbin_5GHT40[AR9300_NUM_5G_40_TARGET_POWERS]; 3488c2ecf20Sopenharmony_ci struct cal_tgt_pow_legacy 3498c2ecf20Sopenharmony_ci calTargetPower5G[AR9300_NUM_5G_20_TARGET_POWERS]; 3508c2ecf20Sopenharmony_ci struct cal_tgt_pow_ht 3518c2ecf20Sopenharmony_ci calTargetPower5GHT20[AR9300_NUM_5G_20_TARGET_POWERS]; 3528c2ecf20Sopenharmony_ci struct cal_tgt_pow_ht 3538c2ecf20Sopenharmony_ci calTargetPower5GHT40[AR9300_NUM_5G_40_TARGET_POWERS]; 3548c2ecf20Sopenharmony_ci u8 ctlIndex_5G[AR9300_NUM_CTLS_5G]; 3558c2ecf20Sopenharmony_ci u8 ctl_freqbin_5G[AR9300_NUM_CTLS_5G][AR9300_NUM_BAND_EDGES_5G]; 3568c2ecf20Sopenharmony_ci struct cal_ctl_data_5g ctlPowerData_5G[AR9300_NUM_CTLS_5G]; 3578c2ecf20Sopenharmony_ci} __packed; 3588c2ecf20Sopenharmony_ci 3598c2ecf20Sopenharmony_cis32 ar9003_hw_get_tx_gain_idx(struct ath_hw *ah); 3608c2ecf20Sopenharmony_cis32 ar9003_hw_get_rx_gain_idx(struct ath_hw *ah); 3618c2ecf20Sopenharmony_ciu32 ar9003_hw_ant_ctrl_common_get(struct ath_hw *ah, bool is2ghz); 3628c2ecf20Sopenharmony_ciu32 ar9003_hw_ant_ctrl_common_2_get(struct ath_hw *ah, bool is2ghz); 3638c2ecf20Sopenharmony_ci 3648c2ecf20Sopenharmony_ciu8 *ar9003_get_spur_chan_ptr(struct ath_hw *ah, bool is_2ghz); 3658c2ecf20Sopenharmony_ci 3668c2ecf20Sopenharmony_ciunsigned int ar9003_get_paprd_scale_factor(struct ath_hw *ah, 3678c2ecf20Sopenharmony_ci struct ath9k_channel *chan); 3688c2ecf20Sopenharmony_ci 3698c2ecf20Sopenharmony_civoid ar9003_hw_internal_regulator_apply(struct ath_hw *ah); 3708c2ecf20Sopenharmony_ciint ar9003_hw_tx_power_regwrite(struct ath_hw *ah, u8 * pPwrArray); 3718c2ecf20Sopenharmony_ci 3728c2ecf20Sopenharmony_ci#endif 373