29 #define _RTL871X_EEPROM_C_
54 mask = 0x01 << (count - 1);
66 down_clk(padapter, &x);
85 for (
i = 0;
i < 16;
i++) {
94 down_clk(padapter, &x);
113 static u16 wait_eeprom_cmd_done(
struct _adapter *padapter)
119 for (i = 0; i < 200; i++) {
128 static void eeprom_clean(
struct _adapter *padapter)
141 up_clk(padapter, &x);
144 down_clk(padapter, &x);
150 u8 tmp8_ori, tmp8_new, tmp8_clk_ori, tmp8_clk_new;
153 tmp8_new = tmp8_ori & 0xf7;
154 if (tmp8_ori != tmp8_new)
157 tmp8_clk_new = tmp8_clk_ori | 0x20;
158 if (tmp8_clk_new != tmp8_clk_ori)
166 shift_out_bits(padapter, 0, 6);
168 shift_out_bits(padapter, 0, 4);
182 shift_out_bits(padapter, data, 16);
183 if (wait_eeprom_cmd_done(padapter)) {
186 shift_out_bits(padapter, reg, 4);
187 eeprom_clean(padapter);
189 if (tmp8_clk_new != tmp8_clk_ori)
191 if (tmp8_new != tmp8_ori)
199 u8 tmp8_ori, tmp8_new, tmp8_clk_ori, tmp8_clk_new;
202 tmp8_new = tmp8_ori & 0xf7;
203 if (tmp8_ori != tmp8_new)
206 tmp8_clk_new = tmp8_clk_ori | 0x20;
207 if (tmp8_clk_new != tmp8_clk_ori)
224 data = shift_in_bits(padapter);
225 eeprom_clean(padapter);
227 if (tmp8_clk_new != tmp8_clk_ori)
229 if (tmp8_new != tmp8_ori)