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 *************************************************************************
32 #define ate_print printk
33 #define ATEDBGPRINT DBGPRINT
36 #define EEPROM_SIZE 0x400
37 #ifdef CONFIG_STA_SUPPORT
38 #define EEPROM_BIN_FILE_NAME "/etc/Wireless/RT2870STA/e2p.bin"
39 #endif // CONFIG_STA_SUPPORT //
42 #define fATE_LOAD_EEPROM 0x0C43
44 extern INT ConsoleResponse(IN PUCHAR buff);
45 extern int (*remote_display)(char *);
46 extern void puts (const char *s);
48 /* specificly defined to redirect and show ate-related messages to host. */
49 /* Try to define ate_print as a macro. */
50 #define ate_print(fmt, args...) \
51 do{ int (*org_remote_display)(char *) = NULL; \
52 org_remote_display = remote_display;\
53 /* Save original "remote_display" */\
54 remote_display = (int (*)(char *))ConsoleResponse; \
55 printk(fmt, ## args); \
56 /* Restore the remote_display function pointer */ \
57 remote_display = org_remote_display; }while(0)
59 #define ATEDBGPRINT(Level, Fmt) \
61 if ((Level) <= RTDebugLevel) \
66 #endif // CONFIG_PRINTK //
69 #define ATE_ON(_p) (((_p)->ate.Mode) != ATE_STOP)
71 /* RT2880_iNIC will define "RT2860". */
73 /* RT2880_iNIC will define RT2860. */
76 #define EEPROM_SIZE 0x400
77 #ifdef CONFIG_STA_SUPPORT
78 #define EEPROM_BIN_FILE_NAME "/etc/Wireless/RT2870STA/e2p.bin"
79 #endif // CONFIG_STA_SUPPORT //
83 #define ATE_BBP_IO_READ8_BY_REG_ID(_A, _I, _pV) RTMP_BBP_IO_READ8_BY_REG_ID(_A, _I, _pV)
84 #define ATE_BBP_IO_WRITE8_BY_REG_ID(_A, _I, _V) RTMP_BBP_IO_WRITE8_BY_REG_ID(_A, _I, _V)
86 #define BULK_OUT_LOCK(pLock, IrqFlags) \
87 if(1 /*!(in_interrupt() & 0xffff0000)*/) \
88 RTMP_IRQ_LOCK((pLock), IrqFlags);
90 #define BULK_OUT_UNLOCK(pLock, IrqFlags) \
91 if(1 /*!(in_interrupt() & 0xffff0000)*/) \
92 RTMP_IRQ_UNLOCK((pLock), IrqFlags);
94 // Prototypes of completion funuc.
95 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
96 #define ATE_RTUSBBulkOutDataPacketComplete(purb, pt_regs) ATE_RTUSBBulkOutDataPacketComplete(purb)
99 VOID ATE_RTUSBBulkOutDataPacketComplete(
101 OUT struct pt_regs *pt_regs);
103 VOID ATE_RTUSBBulkOutDataPacket(
104 IN PRTMP_ADAPTER pAd,
105 IN UCHAR BulkOutPipeId);
107 VOID ATE_RTUSBCancelPendingBulkInIRP(
108 IN PRTMP_ADAPTER pAd);
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,
122 VOID rt_ee_write_all(
123 IN PRTMP_ADAPTER pAd,
127 IN PRTMP_ADAPTER pAd,
131 IN PRTMP_ADAPTER pAd,
135 IN PRTMP_ADAPTER pAd,
138 INT Set_ATE_BSSID_Proc(
139 IN PRTMP_ADAPTER pAd,
142 INT Set_ATE_CHANNEL_Proc(
143 IN PRTMP_ADAPTER pAd,
146 INT Set_ATE_TX_POWER0_Proc(
147 IN PRTMP_ADAPTER pAd,
150 INT Set_ATE_TX_POWER1_Proc(
151 IN PRTMP_ADAPTER pAd,
154 INT Set_ATE_TX_Antenna_Proc(
155 IN PRTMP_ADAPTER pAd,
158 INT Set_ATE_RX_Antenna_Proc(
159 IN PRTMP_ADAPTER pAd,
162 INT Set_ATE_TX_FREQOFFSET_Proc(
163 IN PRTMP_ADAPTER pAd,
166 INT Set_ATE_TX_BW_Proc(
167 IN PRTMP_ADAPTER pAd,
170 INT Set_ATE_TX_LENGTH_Proc(
171 IN PRTMP_ADAPTER pAd,
174 INT Set_ATE_TX_COUNT_Proc(
175 IN PRTMP_ADAPTER pAd,
178 INT Set_ATE_TX_MCS_Proc(
179 IN PRTMP_ADAPTER pAd,
182 INT Set_ATE_TX_MODE_Proc(
183 IN PRTMP_ADAPTER pAd,
186 INT Set_ATE_TX_GI_Proc(
187 IN PRTMP_ADAPTER pAd,
191 INT Set_ATE_RX_FER_Proc(
192 IN PRTMP_ADAPTER pAd,
195 INT Set_ATE_Read_RF_Proc(
196 IN PRTMP_ADAPTER pAd,
199 INT Set_ATE_Write_RF1_Proc(
200 IN PRTMP_ADAPTER pAd,
203 INT Set_ATE_Write_RF2_Proc(
204 IN PRTMP_ADAPTER pAd,
207 INT Set_ATE_Write_RF3_Proc(
208 IN PRTMP_ADAPTER pAd,
211 INT Set_ATE_Write_RF4_Proc(
212 IN PRTMP_ADAPTER pAd,
215 INT Set_ATE_Load_E2P_Proc(
216 IN PRTMP_ADAPTER pAd,
219 INT Set_ATE_Read_E2P_Proc(
220 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,
232 #ifdef RALINK_28xx_QA
233 VOID ATE_QA_Statistics(
234 IN PRTMP_ADAPTER pAd,
235 IN PRXWI_STRUC pRxWI,
236 IN PRT28XX_RXD_STRUC p28xxRxD,
237 IN PHEADER_802_11 pHeader);
240 IN PRTMP_ADAPTER pAdapter,
241 IN struct iwreq *wrq);
248 IN PRTMP_ADAPTER pAdapter,
250 OUT INT32 buffer[3][10]);
252 BOOLEAN SyncTxRxConfig(
253 IN PRTMP_ADAPTER pAdapter,
258 IN PRTMP_ADAPTER pAd,
262 IN PRTMP_ADAPTER pAd,
265 #endif // RALINK_28xx_QA //
266 #endif // RALINK_ATE //
268 VOID ATEAsicSwitchChannel(
269 IN PRTMP_ADAPTER pAd);
271 VOID ATEAsicAdjustTxPower(
272 IN PRTMP_ADAPTER pAd);
274 VOID ATEDisableAsicProtect(
275 IN PRTMP_ADAPTER pAd);
277 CHAR ATEConvertToRssi(
278 IN PRTMP_ADAPTER pAd,
280 IN UCHAR RssiNumber);
283 IN PRTMP_ADAPTER pAd,
284 IN PRXWI_STRUC pRxWI);
287 #ifdef CONFIG_STA_SUPPORT
288 VOID RTMPStationStop(
289 IN PRTMP_ADAPTER pAd);
291 VOID RTMPStationStart(
292 IN PRTMP_ADAPTER pAd);
293 #endif // CONFIG_STA_SUPPORT //
294 #endif // __ATE_H__ //