OMAP3: SR: Remove redundant defines
[linux-ginger.git] / drivers / staging / rt3090 / rt_ate.h
blob38d596162e7467dcc39116c2a24945f5fc8ac9e4
1 /*
2 *************************************************************************
3 * Ralink Tech Inc.
4 * 5F., No.36, Taiyuan St., Jhubei City,
5 * Hsinchu County 302,
6 * Taiwan, R.O.C.
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. *
14 * *
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. *
19 * *
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. *
24 * *
25 *************************************************************************
28 #ifndef __ATE_H__
29 #define __ATE_H__
32 #ifdef LINUX
33 #define ate_print printk
34 #define ATEDBGPRINT DBGPRINT
35 #ifdef RTMP_MAC_PCI
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 //
41 #endif // LINUX //
44 #define ATE_ON(_p) (((_p)->ate.Mode) != ATE_STOP)
46 #ifdef RTMP_MAC_PCI
47 #define ATE_BBP_IO_READ8_BY_REG_ID(_A, _I, _pV) \
48 { \
49 BBP_CSR_CFG_STRUC BbpCsr; \
50 int j, k; \
51 for (j=0; j<MAX_BUSY_COUNT; j++) \
52 { \
53 RTMP_IO_READ32(_A, BBP_CSR_CFG, &BbpCsr.word); \
54 if (BbpCsr.field.Busy == BUSY) \
55 { \
56 continue; \
57 } \
58 BbpCsr.word = 0; \
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++) \
65 { \
66 RTMP_IO_READ32(_A, BBP_CSR_CFG, &BbpCsr.word); \
67 if (BbpCsr.field.Busy == IDLE) \
68 break; \
69 } \
70 if ((BbpCsr.field.Busy == IDLE) && \
71 (BbpCsr.field.RegNum == _I)) \
72 { \
73 *(_pV) = (UCHAR)BbpCsr.field.Value; \
74 break; \
75 } \
76 } \
77 if (BbpCsr.field.Busy == BUSY) \
78 { \
79 ATEDBGPRINT(RT_DEBUG_ERROR, ("BBP read R%d fail\n", _I)); \
80 *(_pV) = (_A)->BbpWriteLatch[_I]; \
81 } \
84 #define ATE_BBP_IO_WRITE8_BY_REG_ID(_A, _I, _V) \
85 { \
86 BBP_CSR_CFG_STRUC BbpCsr; \
87 int BusyCnt; \
88 for (BusyCnt=0; BusyCnt<MAX_BUSY_COUNT; BusyCnt++) \
89 { \
90 RTMP_IO_READ32(_A, BBP_CSR_CFG, &BbpCsr.word); \
91 if (BbpCsr.field.Busy == BUSY) \
92 continue; \
93 BbpCsr.word = 0; \
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; \
101 break; \
103 if (BusyCnt == MAX_BUSY_COUNT) \
105 ATEDBGPRINT(RT_DEBUG_ERROR, ("BBP write R%d fail\n", _I)); \
108 #endif // RTMP_MAC_PCI //
111 #ifdef RT30xx
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)
114 #endif // RT30xx //
117 VOID rt_ee_read_all(
118 IN PRTMP_ADAPTER pAd,
119 OUT USHORT *Data);
121 VOID rt_ee_write_all(
122 IN PRTMP_ADAPTER pAd,
123 IN USHORT *Data);
125 INT Set_ATE_Proc(
126 IN PRTMP_ADAPTER pAd,
127 IN PSTRING arg);
129 INT Set_ATE_DA_Proc(
130 IN PRTMP_ADAPTER pAd,
131 IN PSTRING arg);
133 INT Set_ATE_SA_Proc(
134 IN PRTMP_ADAPTER pAd,
135 IN PSTRING arg);
137 INT Set_ATE_BSSID_Proc(
138 IN PRTMP_ADAPTER pAd,
139 IN PSTRING arg);
141 INT Set_ATE_CHANNEL_Proc(
142 IN PRTMP_ADAPTER pAd,
143 IN PSTRING arg);
145 INT Set_ATE_TX_POWER0_Proc(
146 IN PRTMP_ADAPTER pAd,
147 IN PSTRING arg);
149 INT Set_ATE_TX_POWER1_Proc(
150 IN PRTMP_ADAPTER pAd,
151 IN PSTRING arg);
153 INT Set_ATE_TX_Antenna_Proc(
154 IN PRTMP_ADAPTER pAd,
155 IN PSTRING arg);
157 INT Set_ATE_RX_Antenna_Proc(
158 IN PRTMP_ADAPTER pAd,
159 IN PSTRING arg);
161 INT Set_ATE_TX_FREQOFFSET_Proc(
162 IN PRTMP_ADAPTER pAd,
163 IN PSTRING arg);
165 INT Set_ATE_TX_BW_Proc(
166 IN PRTMP_ADAPTER pAd,
167 IN PSTRING arg);
169 INT Set_ATE_TX_LENGTH_Proc(
170 IN PRTMP_ADAPTER pAd,
171 IN PSTRING arg);
173 INT Set_ATE_TX_COUNT_Proc(
174 IN PRTMP_ADAPTER pAd,
175 IN PSTRING arg);
177 INT Set_ATE_TX_MCS_Proc(
178 IN PRTMP_ADAPTER pAd,
179 IN PSTRING arg);
181 INT Set_ATE_TX_MODE_Proc(
182 IN PRTMP_ADAPTER pAd,
183 IN PSTRING arg);
185 INT Set_ATE_TX_GI_Proc(
186 IN PRTMP_ADAPTER pAd,
187 IN PSTRING arg);
190 INT Set_ATE_RX_FER_Proc(
191 IN PRTMP_ADAPTER pAd,
192 IN PSTRING arg);
194 INT Set_ATE_Read_RF_Proc(
195 IN PRTMP_ADAPTER pAd,
196 IN PSTRING arg);
198 INT Set_ATE_Write_RF1_Proc(
199 IN PRTMP_ADAPTER pAd,
200 IN PSTRING arg);
202 INT Set_ATE_Write_RF2_Proc(
203 IN PRTMP_ADAPTER pAd,
204 IN PSTRING arg);
206 INT Set_ATE_Write_RF3_Proc(
207 IN PRTMP_ADAPTER pAd,
208 IN PSTRING arg);
210 INT Set_ATE_Write_RF4_Proc(
211 IN PRTMP_ADAPTER pAd,
212 IN PSTRING arg);
214 INT Set_ATE_Load_E2P_Proc(
215 IN PRTMP_ADAPTER pAd,
216 IN PSTRING arg);
218 INT Set_ATE_Read_E2P_Proc(
219 IN PRTMP_ADAPTER pAd,
220 IN PSTRING arg);
223 INT Set_ATE_Show_Proc(
224 IN PRTMP_ADAPTER pAd,
225 IN PSTRING arg);
227 INT Set_ATE_Help_Proc(
228 IN PRTMP_ADAPTER pAd,
229 IN PSTRING arg);
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);
238 VOID RtmpDoAte(
239 IN PRTMP_ADAPTER pAdapter,
240 IN struct iwreq *wrq);
242 VOID BubbleSort(
243 IN INT32 n,
244 IN INT32 a[]);
246 VOID CalNoiseLevel(
247 IN PRTMP_ADAPTER pAdapter,
248 IN UCHAR channel,
249 OUT INT32 buffer[3][10]);
251 BOOLEAN SyncTxRxConfig(
252 IN PRTMP_ADAPTER pAdapter,
253 IN USHORT offset,
254 IN UCHAR value);
256 INT Set_TxStop_Proc(
257 IN PRTMP_ADAPTER pAd,
258 IN PSTRING arg);
260 INT Set_RxStop_Proc(
261 IN PRTMP_ADAPTER pAd,
262 IN PSTRING arg);
264 #ifdef DBG
265 INT Set_EERead_Proc(
266 IN PRTMP_ADAPTER pAd,
267 IN PSTRING arg);
269 INT Set_EEWrite_Proc(
270 IN PRTMP_ADAPTER pAd,
271 IN PSTRING arg);
273 INT Set_BBPRead_Proc(
274 IN PRTMP_ADAPTER pAd,
275 IN PSTRING arg);
277 INT Set_BBPWrite_Proc(
278 IN PRTMP_ADAPTER pAd,
279 IN PSTRING arg);
281 INT Set_RFWrite_Proc(
282 IN PRTMP_ADAPTER pAd,
283 IN PSTRING arg);
284 #endif // DBG //
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,
299 IN CHAR Rssi,
300 IN UCHAR RssiNumber);
302 VOID ATESampleRssi(
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__ //