2 *************************************************************************
4 * 5F., No.36, Taiyuan St., Jhubei City,
8 * (c) Copyright 2002-2007, Ralink Technology, Inc.
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
15 * This program is distributed in the hope that it will be useful, *
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18 * GNU General Public License for more details. *
20 * You should have received a copy of the GNU General Public License *
21 * along with this program; if not, write to the *
22 * Free Software Foundation, Inc., *
23 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
25 *************************************************************************
33 #define ate_print printk
34 #define ATEDBGPRINT DBGPRINT
36 #define EEPROM_SIZE 0x200
37 #ifdef CONFIG_STA_SUPPORT
38 #define EEPROM_BIN_FILE_NAME "/etc/Wireless/RT2860STA/e2p.bin"
39 #endif // CONFIG_STA_SUPPORT //
40 #endif // RTMP_MAC_PCI //
44 #define ATE_ON(_p) (((_p)->ate.Mode) != ATE_STOP)
47 #define ATE_BBP_IO_READ8_BY_REG_ID(_A, _I, _pV) \
49 BBP_CSR_CFG_STRUC BbpCsr; \
51 for (j=0; j<MAX_BUSY_COUNT; j++) \
53 RTMP_IO_READ32(_A, BBP_CSR_CFG, &BbpCsr.word); \
54 if (BbpCsr.field.Busy == BUSY) \
59 BbpCsr.field.fRead = 1; \
60 BbpCsr.field.BBP_RW_MODE = 1; \
61 BbpCsr.field.Busy = 1; \
62 BbpCsr.field.RegNum = _I; \
63 RTMP_IO_WRITE32(_A, BBP_CSR_CFG, BbpCsr.word); \
64 for (k=0; k<MAX_BUSY_COUNT; k++) \
66 RTMP_IO_READ32(_A, BBP_CSR_CFG, &BbpCsr.word); \
67 if (BbpCsr.field.Busy == IDLE) \
70 if ((BbpCsr.field.Busy == IDLE) && \
71 (BbpCsr.field.RegNum == _I)) \
73 *(_pV) = (UCHAR)BbpCsr.field.Value; \
77 if (BbpCsr.field.Busy == BUSY) \
79 ATEDBGPRINT(RT_DEBUG_ERROR, ("BBP read R%d fail\n", _I)); \
80 *(_pV) = (_A)->BbpWriteLatch[_I]; \
84 #define ATE_BBP_IO_WRITE8_BY_REG_ID(_A, _I, _V) \
86 BBP_CSR_CFG_STRUC BbpCsr; \
88 for (BusyCnt=0; BusyCnt<MAX_BUSY_COUNT; BusyCnt++) \
90 RTMP_IO_READ32(_A, BBP_CSR_CFG, &BbpCsr.word); \
91 if (BbpCsr.field.Busy == BUSY) \
94 BbpCsr.field.fRead = 0; \
95 BbpCsr.field.BBP_RW_MODE = 1; \
96 BbpCsr.field.Busy = 1; \
97 BbpCsr.field.Value = _V; \
98 BbpCsr.field.RegNum = _I; \
99 RTMP_IO_WRITE32(_A, BBP_CSR_CFG, BbpCsr.word); \
100 (_A)->BbpWriteLatch[_I] = _V; \
103 if (BusyCnt == MAX_BUSY_COUNT) \
105 ATEDBGPRINT(RT_DEBUG_ERROR, ("BBP write R%d fail\n", _I)); \
108 #endif // RTMP_MAC_PCI //
112 #define ATE_RF_IO_READ8_BY_REG_ID(_A, _I, _pV) RTMP_RF_IO_READ8_BY_REG_ID(_A, _I, _pV)
113 #define ATE_RF_IO_WRITE8_BY_REG_ID(_A, _I, _V) RTMP_RF_IO_WRITE8_BY_REG_ID(_A, _I, _V)
118 IN PRTMP_ADAPTER pAd
,
121 VOID
rt_ee_write_all(
122 IN PRTMP_ADAPTER pAd
,
126 IN PRTMP_ADAPTER pAd
,
130 IN PRTMP_ADAPTER pAd
,
134 IN PRTMP_ADAPTER pAd
,
137 INT
Set_ATE_BSSID_Proc(
138 IN PRTMP_ADAPTER pAd
,
141 INT
Set_ATE_CHANNEL_Proc(
142 IN PRTMP_ADAPTER pAd
,
145 INT
Set_ATE_TX_POWER0_Proc(
146 IN PRTMP_ADAPTER pAd
,
149 INT
Set_ATE_TX_POWER1_Proc(
150 IN PRTMP_ADAPTER pAd
,
153 INT
Set_ATE_TX_Antenna_Proc(
154 IN PRTMP_ADAPTER pAd
,
157 INT
Set_ATE_RX_Antenna_Proc(
158 IN PRTMP_ADAPTER pAd
,
161 INT
Set_ATE_TX_FREQOFFSET_Proc(
162 IN PRTMP_ADAPTER pAd
,
165 INT
Set_ATE_TX_BW_Proc(
166 IN PRTMP_ADAPTER pAd
,
169 INT
Set_ATE_TX_LENGTH_Proc(
170 IN PRTMP_ADAPTER pAd
,
173 INT
Set_ATE_TX_COUNT_Proc(
174 IN PRTMP_ADAPTER pAd
,
177 INT
Set_ATE_TX_MCS_Proc(
178 IN PRTMP_ADAPTER pAd
,
181 INT
Set_ATE_TX_MODE_Proc(
182 IN PRTMP_ADAPTER pAd
,
185 INT
Set_ATE_TX_GI_Proc(
186 IN PRTMP_ADAPTER pAd
,
190 INT
Set_ATE_RX_FER_Proc(
191 IN PRTMP_ADAPTER pAd
,
194 INT
Set_ATE_Read_RF_Proc(
195 IN PRTMP_ADAPTER pAd
,
198 INT
Set_ATE_Write_RF1_Proc(
199 IN PRTMP_ADAPTER pAd
,
202 INT
Set_ATE_Write_RF2_Proc(
203 IN PRTMP_ADAPTER pAd
,
206 INT
Set_ATE_Write_RF3_Proc(
207 IN PRTMP_ADAPTER pAd
,
210 INT
Set_ATE_Write_RF4_Proc(
211 IN PRTMP_ADAPTER pAd
,
214 INT
Set_ATE_Load_E2P_Proc(
215 IN PRTMP_ADAPTER pAd
,
218 INT
Set_ATE_Read_E2P_Proc(
219 IN PRTMP_ADAPTER pAd
,
223 INT
Set_ATE_Show_Proc(
224 IN PRTMP_ADAPTER pAd
,
227 INT
Set_ATE_Help_Proc(
228 IN PRTMP_ADAPTER pAd
,
231 #ifdef RALINK_28xx_QA
232 VOID
ATE_QA_Statistics(
233 IN PRTMP_ADAPTER pAd
,
234 IN PRXWI_STRUC pRxWI
,
235 IN PRT28XX_RXD_STRUC p28xxRxD
,
236 IN PHEADER_802_11 pHeader
);
239 IN PRTMP_ADAPTER pAdapter
,
240 IN
struct iwreq
*wrq
);
247 IN PRTMP_ADAPTER pAdapter
,
249 OUT INT32 buffer
[3][10]);
251 BOOLEAN
SyncTxRxConfig(
252 IN PRTMP_ADAPTER pAdapter
,
257 IN PRTMP_ADAPTER pAd
,
261 IN PRTMP_ADAPTER pAd
,
266 IN PRTMP_ADAPTER pAd
,
269 INT
Set_EEWrite_Proc(
270 IN PRTMP_ADAPTER pAd
,
273 INT
Set_BBPRead_Proc(
274 IN PRTMP_ADAPTER pAd
,
277 INT
Set_BBPWrite_Proc(
278 IN PRTMP_ADAPTER pAd
,
281 INT
Set_RFWrite_Proc(
282 IN PRTMP_ADAPTER pAd
,
285 #endif // RALINK_28xx_QA //
288 VOID
ATEAsicSwitchChannel(
289 IN PRTMP_ADAPTER pAd
);
291 VOID
ATEAsicAdjustTxPower(
292 IN PRTMP_ADAPTER pAd
);
294 VOID
ATEDisableAsicProtect(
295 IN PRTMP_ADAPTER pAd
);
297 CHAR
ATEConvertToRssi(
298 IN PRTMP_ADAPTER pAd
,
300 IN UCHAR RssiNumber
);
303 IN PRTMP_ADAPTER pAd
,
304 IN PRXWI_STRUC pRxWI
);
307 #ifdef CONFIG_STA_SUPPORT
308 VOID
RTMPStationStop(
309 IN PRTMP_ADAPTER pAd
);
311 VOID
RTMPStationStart(
312 IN PRTMP_ADAPTER pAd
);
313 #endif // CONFIG_STA_SUPPORT //
314 #endif // __ATE_H__ //