2 ***************************************************************************
4 * 4F, No. 2 Technology 5th Rd.
5 * Science-based Industrial Park
6 * Hsin-chu, Taiwan, R.O.C.
8 * (c) Copyright 2002, Ralink Technology, Inc.
10 * All rights reserved. Ralink's source code is an unpublished work and the
11 * use of a copyright notice does not imply otherwise. This source code
12 * contains confidential trade secret material of Ralink Tech. Any attemp
13 * or participation in deciphering, decoding, reverse engineering or in any
14 * way altering the source code is stricitly prohibited, unless the prior
15 * written consent of Ralink Technology, Inc. is obtained.
16 ***************************************************************************/
17 #include "rt_config.h"
24 RTMP_IO_WRITE32(pAd
, CSR21
, *x
);
33 RTMP_IO_WRITE32(pAd
, CSR21
, *x
);
43 RTMP_IO_READ32(pAd
, CSR21
, &x
);
52 RTMP_IO_READ32(pAd
, CSR21
, &x
);
71 mask
= 0x01 << (count
- 1);
72 RTMP_IO_READ32(pAd
, CSR21
, &x
);
79 if(data
& mask
) x
|= EEDI
;
81 RTMP_IO_WRITE32(pAd
, CSR21
, x
);
90 RTMP_IO_WRITE32(pAd
, CSR21
, x
);
98 RTMP_IO_READ32(pAd
, CSR21
, &x
);
101 RTMP_IO_WRITE32(pAd
, CSR21
, x
);
108 IN PRTMP_ADAPTER pAd
)
112 // reset bits and set EECS
113 RTMP_IO_READ32(pAd
, CSR21
, &x
);
114 x
&= ~(EEDI
| EEDO
| EESK
);
116 RTMP_IO_WRITE32(pAd
, CSR21
, x
);
122 // output the read_opcode and six pulse in that order
123 ShiftOutBits(pAd
, EEPROM_EWEN_OPCODE
, 5);
124 ShiftOutBits(pAd
, 0, 6);
130 IN PRTMP_ADAPTER pAd
)
134 // reset bits and set EECS
135 RTMP_IO_READ32(pAd
, CSR21
, &x
);
136 x
&= ~(EEDI
| EEDO
| EESK
);
138 RTMP_IO_WRITE32(pAd
, CSR21
, x
);
144 // output the read_opcode and six pulse in that order
145 ShiftOutBits(pAd
, EEPROM_EWDS_OPCODE
, 5);
146 ShiftOutBits(pAd
, 0, 6);
151 USHORT
RTMP_EEPROM_READ16(
152 IN PRTMP_ADAPTER pAd
,
159 // reset bits and set EECS
160 RTMP_IO_READ32(pAd
, CSR21
, &x
);
161 x
&= ~(EEDI
| EEDO
| EESK
);
163 RTMP_IO_WRITE32(pAd
, CSR21
, x
);
169 // output the read_opcode and register number in that order
170 ShiftOutBits(pAd
, EEPROM_READ_OPCODE
, 3);
171 ShiftOutBits(pAd
, Offset
, pAd
->EEPROMAddressNum
);
173 // Now read the data (16 bits) in from the selected EEPROM word
174 data
= ShiftInBits(pAd
);
181 VOID
RTMP_EEPROM_WRITE16(
182 IN PRTMP_ADAPTER pAd
,
192 // reset bits and set EECS
193 RTMP_IO_READ32(pAd
, CSR21
, &x
);
194 x
&= ~(EEDI
| EEDO
| EESK
);
196 RTMP_IO_WRITE32(pAd
, CSR21
, x
);
202 // output the read_opcode ,register number and data in that order
203 ShiftOutBits(pAd
, EEPROM_WRITE_OPCODE
, 3);
204 ShiftOutBits(pAd
, Offset
, pAd
->EEPROMAddressNum
);
205 ShiftOutBits(pAd
, Data
, 16); // 16-bit access
208 RTMP_IO_READ32(pAd
, CSR21
, &x
);
213 udelay(1000); //delay for twp(MAX)=10ms