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 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19 ******************************************************************************/
20 #ifndef __INC_HAL8188EPHYCFG_H__
21 #define __INC_HAL8188EPHYCFG_H__
24 /*--------------------------Define Parameters-------------------------------*/
26 #define MAX_STALL_TIME 50 /* us */
27 #define AntennaDiversityValue 0x80 /* (Adapter->bSoftwareAntennaDiversity ? 0x00 : 0x80) */
28 #define MAX_TXPWR_IDX_NMODE_92S 63
29 #define Reset_Cnt_Limit 3
32 #define MAX_AGGR_NUM 0x0B
34 #define MAX_AGGR_NUM 0x07
35 #endif /* CONFIG_PCI_HCI */
38 /*--------------------------Define Parameters-------------------------------*/
41 /*------------------------------Define structure----------------------------*/
43 #define MAX_TX_COUNT_8188E 1
48 /*------------------------------Define structure----------------------------*/
51 /*------------------------Export global variable----------------------------*/
52 /*------------------------Export global variable----------------------------*/
55 /*------------------------Export Marco Definition---------------------------*/
56 /*------------------------Export Marco Definition---------------------------*/
59 /*--------------------------Exported Function prototype---------------------*/
61 * BB and RF register read/write
63 u32 PHY_QueryBBReg8188E(IN PADAPTER Adapter,
66 void PHY_SetBBReg8188E(IN PADAPTER Adapter,
70 u32 PHY_QueryRFReg8188E(IN PADAPTER Adapter,
74 void PHY_SetRFReg8188E(IN PADAPTER Adapter,
81 * Initialization related function
83 /* MAC/BB/RF HAL config */
84 int PHY_MACConfig8188E(IN PADAPTER Adapter);
85 int PHY_BBConfig8188E(IN PADAPTER Adapter);
86 int PHY_RFConfig8188E(IN PADAPTER Adapter);
89 int rtl8188e_PHY_ConfigRFWithParaFile(IN PADAPTER Adapter, IN u8 *pFileName, u8 eRFPath);
94 /* extern BOOLEAN PHY_SetRFPowerState(IN PADAPTER Adapter,
95 * IN RT_RF_POWER_STATE eRFPowerState); */
100 void PHY_GetTxPowerLevel8188E(IN PADAPTER Adapter,
101 OUT s32 *powerlevel);
102 void PHY_SetTxPowerLevel8188E(IN PADAPTER Adapter,
104 BOOLEAN PHY_UpdateTxPowerDbm8188E(IN PADAPTER Adapter,
108 PHY_SetTxPowerIndex_8188E(
116 PHY_GetTxPowerIndex_8188E(
117 IN PADAPTER pAdapter,
122 struct txpwr_idx_comp *tic
126 * Switch bandwidth for 8192S
128 /* extern void PHY_SetBWModeCallback8192C( IN PRT_TIMER pTimer ); */
129 void PHY_SetBWMode8188E(IN PADAPTER pAdapter,
130 IN CHANNEL_WIDTH ChnlWidth,
131 IN unsigned char Offset);
134 * Set FW CMD IO for 8192S.
136 /* extern BOOLEAN HalSetIO8192C( IN PADAPTER Adapter,
137 * IN IO_TYPE IOType); */
140 * Set A2 entry to fw for 8192S
142 extern void FillA2Entry8192C(IN PADAPTER Adapter,
148 * channel switch related funciton
150 /* extern void PHY_SwChnlCallback8192C( IN PRT_TIMER pTimer ); */
151 void PHY_SwChnl8188E(IN PADAPTER pAdapter,
155 PHY_SetSwChnlBWMode8188E(
158 IN CHANNEL_WIDTH Bandwidth,
168 * BB/MAC/RF other monitor API
170 VOID phy_set_rf_path_switch_8188e(IN PADAPTER pAdapter, IN bool bMain);
173 PHY_SwitchEphyParameter(
178 PHY_EnableHostClkReq(
188 /*--------------------------Exported Function prototype---------------------*/
191 * Initialization related function
193 * MAC/BB/RF HAL config */
194 /* extern s32 PHY_MACConfig8723(PADAPTER padapter);
195 * s32 PHY_BBConfig8723(PADAPTER padapter);
196 * s32 PHY_RFConfig8723(PADAPTER padapter); */
200 /* ******************************************************************
201 * Note: If SIC_ENABLE under PCIE, because of the slow operation
203 * 2) "#define RTL8723_FPGA_VERIFICATION 1" in Precomp.h.WlanE.Windows
204 * 3) "#define RTL8190_Download_Firmware_From_Header 0" in Precomp.h.WlanE.Windows if needed.
206 #if (RTL8188E_SUPPORT == 1) && (RTL8188E_FPGA_TRUE_PHY_VERIFICATION == 1)
208 #define SIC_HW_SUPPORT 1
211 #define SIC_HW_SUPPORT 0
213 /* ****************************************************************** */
216 #define SIC_MAX_POLL_CNT 5
218 #if (SIC_HW_SUPPORT == 1)
219 #define SIC_CMD_READY 0
220 #define SIC_CMD_PREWRITE 0x1
221 #if (RTL8188E_SUPPORT == 1)
222 #define SIC_CMD_WRITE 0x40
223 #define SIC_CMD_PREREAD 0x2
224 #define SIC_CMD_READ 0x80
225 #define SIC_CMD_INIT 0xf0
226 #define SIC_INIT_VAL 0xff
228 #define SIC_INIT_REG 0x1b7
229 #define SIC_CMD_REG 0x1EB /* 1byte */
230 #define SIC_ADDR_REG 0x1E8 /* 1b4~1b5, 2 bytes */
231 #define SIC_DATA_REG 0x1EC /* 1b0~1b3 */
233 #define SIC_CMD_WRITE 0x11
234 #define SIC_CMD_PREREAD 0x2
235 #define SIC_CMD_READ 0x12
236 #define SIC_CMD_INIT 0x1f
237 #define SIC_INIT_VAL 0xff
239 #define SIC_INIT_REG 0x1b7
240 #define SIC_CMD_REG 0x1b6 /* 1byte */
241 #define SIC_ADDR_REG 0x1b4 /* 1b4~1b5, 2 bytes */
242 #define SIC_DATA_REG 0x1b0 /* 1b0~1b3 */
245 #define SIC_CMD_READY 0
246 #define SIC_CMD_WRITE 1
247 #define SIC_CMD_READ 2
249 #if (RTL8188E_SUPPORT == 1)
250 #define SIC_CMD_REG 0x1EB /* 1byte */
251 #define SIC_ADDR_REG 0x1E8 /* 1b9~1ba, 2 bytes */
252 #define SIC_DATA_REG 0x1EC /* 1bc~1bf */
254 #define SIC_CMD_REG 0x1b8 /* 1byte */
255 #define SIC_ADDR_REG 0x1b9 /* 1b9~1ba, 2 bytes */
256 #define SIC_DATA_REG 0x1bc /* 1bc~1bf */
260 #if (SIC_ENABLE == 1)
261 VOID SIC_Init(IN PADAPTER Adapter);
265 #endif /* __INC_HAL8192CPHYCFG_H */