1 /******************************************************************************
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 ******************************************************************************/
15 #ifndef __HAL_COM_PHYCFG_H__
16 #define __HAL_COM_PHYCFG_H__
18 #define PathA 0x0 /* Useless */
42 RF_TX_NUM_NONIMPLEMENT,
45 #define MAX_POWER_INDEX 0x3F
47 enum _REGULATION_TXPWR_LMT {
52 TXPWR_LMT_MAX_REGULATION_NUM,
55 /*------------------------------Define structure----------------------------*/
56 struct bb_register_def {
57 u32 rfintfs; /* set software control: */
58 /* 0x870~0x877[8 bytes] */
60 u32 rfintfo; /* output data: */
61 /* 0x860~0x86f [16 bytes] */
63 u32 rfintfe; /* output enable: */
64 /* 0x860~0x86f [16 bytes] */
66 u32 rf3wireOffset; /* LSSI data: */
67 /* 0x840~0x84f [16 bytes] */
69 u32 rfHSSIPara2; /* wire parameter control2 : */
70 /* 0x824~0x827, 0x82c~0x82f,
71 * 0x834~0x837, 0x83c~0x83f
73 u32 rfLSSIReadBack; /* LSSI RF readback data SI mode */
74 /* 0x8a0~0x8af [16 bytes] */
76 u32 rfLSSIReadBackPi; /* LSSI RF readback data PI mode
77 * 0x8b8-8bc for Path A and B */
82 PHY_GetTxPowerByRateBase(
83 struct adapter * Adapter,
87 enum RATE_SECTION RateSection
91 PHY_GetRateSectionIndexOfTxPowerByRate(
92 struct adapter *padapter,
98 PHY_GetRateValuesOfTxPowerByRate(
99 struct adapter *padapter,
109 PHY_GetRateIndexOfTxPowerByRate(
114 PHY_SetTxPowerIndexByRateSection(
115 struct adapter * padapter,
122 PHY_GetTxPowerByRate(
123 struct adapter *padapter,
131 PHY_SetTxPowerByRate(
132 struct adapter *padapter,
141 PHY_SetTxPowerLevelByPath(
142 struct adapter *Adapter,
148 PHY_SetTxPowerIndexByRateArray(
149 struct adapter * padapter,
151 enum CHANNEL_WIDTH BandWidth,
158 PHY_InitTxPowerByRate(
159 struct adapter *padapter
163 PHY_StoreTxPowerByRate(
164 struct adapter *padapter,
174 PHY_TxPowerByRateConfiguration(
175 struct adapter * padapter
179 PHY_GetTxPowerIndexBase(
180 struct adapter * padapter,
183 enum CHANNEL_WIDTH BandWidth,
188 s8 PHY_GetTxPowerLimit (struct adapter *adapter, u32 RegPwrTblSel,
189 enum BAND_TYPE Band, enum CHANNEL_WIDTH Bandwidth,
197 struct adapter * Adapter,
208 PHY_ConvertTxPowerLimitToPowerIndex(
209 struct adapter * Adapter
213 PHY_InitTxPowerLimit(
214 struct adapter * Adapter
218 PHY_GetTxPowerTrackingOffset(
219 struct adapter *padapter,
226 struct adapter * padapter,
229 enum CHANNEL_WIDTH BandWidth,
235 struct adapter * padapter,
242 Hal_ChannelPlanToRegulation(
243 struct adapter * Adapter,
247 #define MAX_PARA_FILE_BUF_LEN 25600
249 #define LOAD_MAC_PARA_FILE BIT0
250 #define LOAD_BB_PARA_FILE BIT1
251 #define LOAD_BB_PG_PARA_FILE BIT2
252 #define LOAD_BB_MP_PARA_FILE BIT3
253 #define LOAD_RF_PARA_FILE BIT4
254 #define LOAD_RF_TXPWR_TRACK_PARA_FILE BIT5
255 #define LOAD_RF_TXPWR_LMT_PARA_FILE BIT6
257 int phy_ConfigMACWithParaFile(struct adapter *Adapter, char*pFileName);
259 int phy_ConfigBBWithParaFile(struct adapter *Adapter, char*pFileName, u32 ConfigType);
261 int phy_ConfigBBWithPgParaFile(struct adapter *Adapter, char*pFileName);
263 int phy_ConfigBBWithMpParaFile(struct adapter *Adapter, char*pFileName);
265 int PHY_ConfigRFWithParaFile(struct adapter *Adapter, char*pFileName, u8 eRFPath);
267 int PHY_ConfigRFWithTxPwrTrackParaFile(struct adapter *Adapter, char*pFileName);
269 int PHY_ConfigRFWithPowerLimitTableParaFile(struct adapter *Adapter, char*pFileName);
271 void phy_free_filebuf(struct adapter *padapter);
273 #endif /* __HAL_COMMON_H__ */