1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
4 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
6 ******************************************************************************/
7 #ifndef __HAL_COM_PHYCFG_H__
8 #define __HAL_COM_PHYCFG_H__
10 #define PathA 0x0 /* Useless */
34 RF_TX_NUM_NONIMPLEMENT,
37 #define MAX_POWER_INDEX 0x3F
39 enum _REGULATION_TXPWR_LMT {
44 TXPWR_LMT_MAX_REGULATION_NUM,
47 /*------------------------------Define structure----------------------------*/
48 struct bb_register_def {
49 u32 rfintfs; /* set software control: */
50 /* 0x870~0x877[8 bytes] */
52 u32 rfintfo; /* output data: */
53 /* 0x860~0x86f [16 bytes] */
55 u32 rfintfe; /* output enable: */
56 /* 0x860~0x86f [16 bytes] */
58 u32 rf3wireOffset; /* LSSI data: */
59 /* 0x840~0x84f [16 bytes] */
61 u32 rfHSSIPara2; /* wire parameter control2 : */
62 /* 0x824~0x827, 0x82c~0x82f,
63 * 0x834~0x837, 0x83c~0x83f
65 u32 rfLSSIReadBack; /* LSSI RF readback data SI mode */
66 /* 0x8a0~0x8af [16 bytes] */
68 u32 rfLSSIReadBackPi; /* LSSI RF readback data PI mode
69 * 0x8b8-8bc for Path A and B */
74 PHY_GetTxPowerByRateBase(
75 struct adapter * Adapter,
79 enum RATE_SECTION RateSection
83 PHY_GetRateSectionIndexOfTxPowerByRate(
84 struct adapter *padapter,
90 PHY_GetRateValuesOfTxPowerByRate(
91 struct adapter *padapter,
101 PHY_GetRateIndexOfTxPowerByRate(
106 PHY_SetTxPowerIndexByRateSection(
107 struct adapter * padapter,
114 PHY_GetTxPowerByRate(
115 struct adapter *padapter,
123 PHY_SetTxPowerByRate(
124 struct adapter *padapter,
133 PHY_SetTxPowerLevelByPath(
134 struct adapter *Adapter,
140 PHY_SetTxPowerIndexByRateArray(
141 struct adapter * padapter,
143 enum CHANNEL_WIDTH BandWidth,
150 PHY_InitTxPowerByRate(
151 struct adapter *padapter
155 PHY_StoreTxPowerByRate(
156 struct adapter *padapter,
166 PHY_TxPowerByRateConfiguration(
167 struct adapter * padapter
171 PHY_GetTxPowerIndexBase(
172 struct adapter * padapter,
175 enum CHANNEL_WIDTH BandWidth,
180 s8 phy_get_tx_pwr_lmt (struct adapter *adapter, u32 RegPwrTblSel,
181 enum BAND_TYPE Band, enum CHANNEL_WIDTH Bandwidth,
189 struct adapter * Adapter,
200 PHY_ConvertTxPowerLimitToPowerIndex(
201 struct adapter * Adapter
205 PHY_InitTxPowerLimit(
206 struct adapter * Adapter
210 PHY_GetTxPowerTrackingOffset(
211 struct adapter *padapter,
218 struct adapter * padapter,
221 enum CHANNEL_WIDTH BandWidth,
227 struct adapter * padapter,
234 Hal_ChannelPlanToRegulation(
235 struct adapter * Adapter,
239 #define MAX_PARA_FILE_BUF_LEN 25600
241 #define LOAD_MAC_PARA_FILE BIT0
242 #define LOAD_BB_PARA_FILE BIT1
243 #define LOAD_BB_PG_PARA_FILE BIT2
244 #define LOAD_BB_MP_PARA_FILE BIT3
245 #define LOAD_RF_PARA_FILE BIT4
246 #define LOAD_RF_TXPWR_TRACK_PARA_FILE BIT5
247 #define LOAD_RF_TXPWR_LMT_PARA_FILE BIT6
249 int phy_ConfigMACWithParaFile(struct adapter *Adapter, char*pFileName);
251 int phy_ConfigBBWithParaFile(struct adapter *Adapter, char*pFileName, u32 ConfigType);
253 int phy_ConfigBBWithPgParaFile(struct adapter *Adapter, char*pFileName);
255 int phy_ConfigBBWithMpParaFile(struct adapter *Adapter, char*pFileName);
257 int PHY_ConfigRFWithParaFile(struct adapter *Adapter, char*pFileName, u8 eRFPath);
259 int PHY_ConfigRFWithTxPwrTrackParaFile(struct adapter *Adapter, char*pFileName);
261 int PHY_ConfigRFWithPowerLimitTableParaFile(struct adapter *Adapter, char*pFileName);
263 void phy_free_filebuf(struct adapter *padapter);
265 #endif /* __HAL_COMMON_H__ */