re: MACFG50 requires defragmentation in software, but no padding for runt.
[dragonfly.git] / sys / dev / netif / re / re.c
1 /*
2  * Copyright (c) 1997, 1998
3  *      Bill Paul <wpaul@ctr.columbia.edu>.  All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 3. All advertising materials mentioning features or use of this software
14  *    must display the following acknowledgement:
15  *      This product includes software developed by Bill Paul.
16  * 4. Neither the name of the author nor the names of any co-contributors
17  *    may be used to endorse or promote products derived from this software
18  *    without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
21  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
24  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30  * THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  * $FreeBSD: src/sys/dev/if_rl.c,v 1.38.2.7 2001/07/19 18:33:07 wpaul Exp $
33  */
34
35 /*
36  * RealTek 8129/8139 PCI NIC driver
37  *
38  * Written by Bill Paul <wpaul@ctr.columbia.edu>
39  * Electrical Engineering Department
40  * Columbia University, New York City
41  */
42
43 #ifndef __DragonFly__
44 #include <sys/cdefs.h>
45 __FBSDID("$FreeBSD: src/sys/dev/re/if_re.c,v 1.94.01 " __DATE__ " " __TIME__ "  wpaul Exp $");
46
47 /*
48 * This driver also support Realtek 8139C+, 8110S/SB/SC, RTL8111B/C/CP/D and RTL8101E/8102E/8103E.
49 */
50
51 #include <sys/param.h>
52 #include <sys/systm.h>
53 #include <sys/sockio.h>
54 #include <sys/mbuf.h>
55 #include <sys/malloc.h>
56 #include <sys/kernel.h>
57 #include <sys/socket.h>
58 #include <sys/taskqueue.h>
59 #include <sys/random.h>
60
61 #include <net/if.h>
62 #include <net/if_var.h>
63 #include <net/if_arp.h>
64 #include <net/ethernet.h>
65 #include <net/if_dl.h>
66 #include <net/if_media.h>
67
68 #include <net/bpf.h>
69
70 #include <vm/vm.h>              /* for vtophys */
71 #include <vm/pmap.h>            /* for vtophys */
72 #include <machine/clock.h>      /* for DELAY */
73
74 #include <machine/bus.h>
75 #include <machine/resource.h>
76 #include <sys/bus.h>
77 #include <sys/rman.h>
78 #include <sys/endian.h>
79
80 #include <dev/mii/mii.h>
81 #include <dev/re/if_rereg.h>
82
83 #if OS_VER < VERSION(5,3)
84 #include <pci/pcireg.h>
85 #include <pci/pcivar.h>
86 #include <machine/bus_pio.h>
87 #include <machine/bus_memio.h>
88 #else
89 #include <dev/pci/pcireg.h>
90 #include <dev/pci/pcivar.h>
91 #include <sys/module.h>
92 #endif
93
94 #if OS_VER > VERSION(5,9)
95 #include <sys/cdefs.h>
96 #include <sys/endian.h>
97 #include <net/if_types.h>
98 #include <net/if_vlan_var.h>
99 #endif
100 #else   /* __DragonFly__ */
101
102 #include <sys/param.h>
103 #include <sys/bus.h>
104 #include <sys/endian.h>
105 #include <sys/kernel.h>
106 #include <sys/systm.h>
107
108 #include <net/ethernet.h>
109 #include <net/if.h>
110 #include <net/if_arp.h>
111 #include <net/if_dl.h>
112 #include <net/if_media.h>
113 #include <net/if_poll.h>
114 #include <net/vlan/if_vlan_var.h>
115
116 #include <bus/pci/pcireg.h>
117 #include <bus/pci/pcivar.h>
118
119 #include <dev/netif/mii_layer/mii.h>
120 #include <dev/netif/re/if_revar.h>
121 #include <dev/netif/re/re.h>
122 #include <dev/netif/re/re_dragonfly.h>
123
124 #define RE_LOCK(sc)
125 #define RE_UNLOCK(sc)
126 #define RE_LOCK_ASSERT(sc)
127
128 #define RE_GET_IFNET(sc)        &(sc)->arpcom.ac_if
129
130 #endif  /* !__DragonFly__ */
131
132 #define EE_SET(x)                                       \
133         CSR_WRITE_1(sc, RE_EECMD,                       \
134                 CSR_READ_1(sc, RE_EECMD) | x)
135
136 #define EE_CLR(x)                                       \
137         CSR_WRITE_1(sc, RE_EECMD,                       \
138                 CSR_READ_1(sc, RE_EECMD) & ~x)
139
140 #ifndef __DragonFly__
141 /*
142  * Various supported device vendors/types and their names.
143  */
144 static struct re_type re_devs[] = {
145         {
146                 RT_VENDORID, RT_DEVICEID_8169,
147                 "Realtek PCI GBE Family Controller"
148         },
149         {
150                 RT_VENDORID, RT_DEVICEID_8169SC,
151                 "Realtek PCI GBE Family Controller"
152         },
153         {
154                 RT_VENDORID, RT_DEVICEID_8168,
155                 "Realtek PCIe GBE Family Controller"
156         },
157         {
158                 RT_VENDORID, RT_DEVICEID_8161,
159                 "Realtek PCIe GBE Family Controller"
160         },
161         {
162                 RT_VENDORID, RT_DEVICEID_8136,
163                 "Realtek PCIe FE Family Controller"
164         },
165         {
166                 DLINK_VENDORID, 0x4300,
167                 "Realtek PCI GBE Family Controller"
168         },
169         { 0, 0, NULL }
170 };
171
172 static int      re_probe                        __P((device_t));
173 static int      re_attach                       __P((device_t));
174 static int      re_detach                       __P((device_t));
175 static int      re_suspend                      __P((device_t));
176 static int      re_resume                       __P((device_t));
177 static int      re_shutdown                     __P((device_t));
178
179 static void MP_WritePhyUshort                   __P((struct re_softc*, u_int8_t, u_int16_t));
180 static u_int16_t MP_ReadPhyUshort               __P((struct re_softc*, u_int8_t));
181 static void MP_WriteEPhyUshort                  __P((struct re_softc*, u_int8_t, u_int16_t));
182 static u_int16_t MP_ReadEPhyUshort              __P((struct re_softc*, u_int8_t));
183 static u_int8_t MP_ReadEfuse                    __P((struct re_softc*, u_int16_t));
184 static void MP_WritePhyOcpRegWord       __P((struct re_softc*, u_int16_t, u_int8_t, u_int16_t));
185 static u_int16_t MP_ReadPhyOcpRegWord   __P((struct re_softc*, u_int16_t, u_int8_t));
186 static void MP_WriteMcuAccessRegWord    __P((struct re_softc*, u_int16_t, u_int16_t));
187 static u_int16_t MP_ReadMcuAccessRegWord  __P((struct re_softc*, u_int16_t));
188 static void MP_WriteOtherFunPciEConfigSpace    __P((struct re_softc *, u_int8_t, u_int16_t, u_int32_t Regata));
189 static u_int32_t MP_ReadOtherFunPciEConfigSpace   __P((struct re_softc *, u_int8_t, u_int16_t));
190 static void MP_WritePciEConfigSpace     __P((struct re_softc*, u_int16_t, u_int32_t));
191 static u_int32_t MP_ReadPciEConfigSpace __P((struct re_softc*, u_int16_t));
192 #endif  /* !__DragonFly__ */
193
194 static int re_check_dash  __P((struct re_softc *));
195
196 #ifndef __DragonFly__
197 static void re_driver_start             __P((struct re_softc*));
198 static void re_driver_stop              __P((struct re_softc*));
199
200 static void re_hw_phy_config            __P((struct re_softc *));
201 static void re_init                     __P((void *));
202 static int  re_var_init                 __P((struct re_softc *));
203 static void re_reset                    __P((struct re_softc *));
204 static void re_stop                     __P((struct re_softc *));
205 static void re_setwol                   __P((struct re_softc *));
206 #endif  /* !__DragonFly__ */
207 static void re_clrwol                   __P((struct re_softc *));
208 static void re_set_wol_linkspeed        __P((struct re_softc *));
209
210 #ifndef __DragonFly__
211 static void re_start                            __P((struct ifnet *));
212 static int re_encap                             __P((struct re_softc *, struct mbuf *));
213 static void WritePacket                         __P((struct re_softc *, caddr_t, int, int, int, uint32_t, uint32_t));
214 static int CountFreeTxDescNum                   __P((struct re_descriptor));
215 static int CountMbufNum                         __P((struct mbuf *));
216 #ifdef RE_FIXUP_RX
217 static __inline void re_fixup_rx                __P((struct mbuf *));
218 #endif
219 static void re_txeof                            __P((struct re_softc *));
220
221 static void re_rxeof                            __P((struct re_softc *));
222
223 #if OS_VER < VERSION(7,0)
224 static void re_intr                             __P((void *));
225 #else
226 static int re_intr                              __P((void *));
227 #endif //OS_VER < VERSION(7,0)
228 #endif  /* !__DragonFly__ */
229 static void re_set_multicast_reg        __P((struct re_softc *, u_int32_t, u_int32_t));
230 #ifndef __DragonFly__
231 static void re_set_rx_packet_filter_in_sleep_state      __P((struct re_softc *));
232 #endif
233 static void re_set_rx_packet_filter     __P((struct re_softc *));
234 static void re_setmulti                 __P((struct re_softc *));
235 #ifndef __DragonFly__
236 static int  re_ioctl                    __P((struct ifnet *, u_long, caddr_t));
237 #endif
238 static u_int8_t re_link_ok      __P((struct re_softc *));
239 static void re_link_on_patch    __P((struct re_softc *));
240 #ifndef __DragonFly__
241 static void re_link_down_patch  __P((struct re_softc *));
242 static void re_init_timer       __P((struct re_softc *));
243 static void re_stop_timer       __P((struct re_softc *));
244 static void re_start_timer      __P((struct re_softc *));
245 static void re_tick                             __P((void *));
246 #if OS_VER < VERSION(7,0)
247 static void re_watchdog                         __P((struct ifnet *));
248 #endif
249 #endif  /* !__DragonFly__ */
250
251 static int  re_ifmedia_upd                      __P((struct ifnet *));
252 static void re_ifmedia_sts                      __P((struct ifnet *, struct ifmediareq *));
253
254 static void re_eeprom_ShiftOutBits              __P((struct re_softc *, int, int));
255 static u_int16_t re_eeprom_ShiftInBits          __P((struct re_softc *));
256 static void re_eeprom_EEpromCleanup             __P((struct re_softc *));
257 static void re_eeprom_getword                   __P((struct re_softc *, int, u_int16_t *));
258 static void re_read_eeprom                      __P((struct re_softc *, caddr_t, int, int, int));
259 #ifndef __DragonFly__
260 static void re_int_task                         (void *, int);
261 #endif  /* !__DragonFly__ */
262
263 static void re_phy_power_up(device_t dev);
264 static void re_phy_power_down(device_t dev);
265 #ifndef __DragonFly__
266 static int re_alloc_buf(struct re_softc *);
267 static void re_release_buf(struct re_softc *);
268 static void set_rxbufsize(struct re_softc*);
269 static void re_release_rx_buf(struct re_softc *);
270 static void re_release_tx_buf(struct re_softc *);
271 #endif  /* !__DragonFly__ */
272 static u_int32_t re_eri_read(struct re_softc *, int, int, int);
273 static int re_eri_write(struct re_softc *, int, int, u_int32_t, int);
274 static void OOB_mutex_lock(struct re_softc *);
275 static void OOB_mutex_unlock(struct re_softc *);
276
277 #ifdef __DragonFly__
278 u_int16_t MP_ReadMcuAccessRegWord(struct re_softc *, u_int16_t);
279 void MP_WriteMcuAccessRegWord(struct re_softc *, u_int16_t, u_int16_t);
280
281 u_int16_t MP_ReadPhyOcpRegWord(struct re_softc *, u_int16_t, u_int8_t);
282 void MP_WritePhyOcpRegWord(struct re_softc *, u_int16_t, u_int8_t, u_int16_t);
283
284 void MP_WritePhyUshort(struct re_softc *, u_int8_t, u_int16_t);
285 u_int16_t MP_ReadPhyUshort(struct re_softc *, u_int8_t);
286
287 u_int32_t MP_ReadPciEConfigSpace(struct re_softc *, u_int16_t);
288 void MP_WritePciEConfigSpace(struct re_softc *, u_int16_t, u_int32_t);
289 u_int32_t MP_ReadOtherFunPciEConfigSpace(struct re_softc *, u_int8_t,
290     u_int16_t);
291 void MP_WriteOtherFunPciEConfigSpace(struct re_softc *, u_int8_t, u_int16_t,
292     u_int32_t);
293
294 u_int16_t MP_ReadEPhyUshort(struct re_softc *, u_int8_t);
295 void MP_WriteEPhyUshort(struct re_softc *, u_int8_t, u_int16_t);
296
297 u_int8_t MP_ReadEfuse(struct re_softc *, u_int16_t);
298
299 void re_driver_start(struct re_softc *);
300 void re_driver_stop(struct re_softc *);
301 #endif  /* __DragonFly__ */
302
303 /* Tunables. */
304 static int msi_disable = 1;
305 TUNABLE_INT("hw.re.msi_disable", &msi_disable);
306 static int msix_disable = 0;
307 TUNABLE_INT("hw.re.msix_disable", &msix_disable);
308 static int prefer_iomap = 0;
309 TUNABLE_INT("hw.re.prefer_iomap", &prefer_iomap);
310 static int eee_enable = 0;
311 TUNABLE_INT("hw.re.eee_enable", &eee_enable);
312 static int phy_power_saving = 1;
313 TUNABLE_INT("hw.re.phy_power_saving", &phy_power_saving);
314 static int phy_mdix_mode = RE_ETH_PHY_AUTO_MDI_MDIX;
315 TUNABLE_INT("hw.re.phy_mdix_mode", &phy_mdix_mode);
316
317 #define RE_CSUM_FEATURES    (CSUM_IP | CSUM_TCP | CSUM_UDP)
318
319 #ifndef __DragonFly__
320 static device_method_t re_methods[] = {
321         /* Device interface */
322         DEVMETHOD(device_probe, re_probe),
323         DEVMETHOD(device_attach, re_attach),
324         DEVMETHOD(device_detach, re_detach),
325         DEVMETHOD(device_suspend, re_suspend),
326         DEVMETHOD(device_resume, re_resume),
327         DEVMETHOD(device_shutdown, re_shutdown),
328         { 0, 0 }
329 };
330
331 static driver_t re_driver = {
332         "re",
333         re_methods,
334         sizeof(struct re_softc)
335 };
336
337 static devclass_t re_devclass;
338
339 DRIVER_MODULE(if_re, pci, re_driver, re_devclass, 0, 0);
340 #endif  /* !__DragonFly__ */
341
342 static int re_is_ups_resume(struct re_softc *sc)
343 {
344         return (MP_ReadMcuAccessRegWord(sc, 0xD408) & BIT_0);
345 }
346
347 static void re_clear_ups_resume_bit(struct re_softc *sc)
348 {
349         MP_WriteMcuAccessRegWord(sc, 0xD408, MP_ReadMcuAccessRegWord(sc, 0xD408) & ~(BIT_0));
350 }
351
352 static void re_wait_phy_ups_resume(struct re_softc *sc, u_int16_t PhyState)
353 {
354         u_int16_t TmpPhyState;
355         int i=0;
356
357         do {
358                 TmpPhyState = MP_ReadPhyOcpRegWord(sc, 0x0A42, 0x10);
359                 TmpPhyState &= 0x7;
360                 DELAY(1000);
361                 i++;
362         } while ((i < 100) && (TmpPhyState != 2));
363 }
364
365 static void re_phy_power_up(device_t dev)
366 {
367         struct re_softc         *sc;
368         u_int8_t Data8;
369
370         sc = device_get_softc(dev);
371
372         if ((sc->re_if_flags & RL_FLAG_PHYWAKE_PM) != 0)
373                 CSR_WRITE_1(sc, RE_PMCH, CSR_READ_1(sc, RE_PMCH) | (BIT_6|BIT_7));
374
375         MP_WritePhyUshort(sc, 0x1F, 0x0000);
376
377         switch (sc->re_type) {
378         case MACFG_4:
379         case MACFG_5:
380         case MACFG_6:
381         case MACFG_21:
382         case MACFG_22:
383         case MACFG_23:
384         case MACFG_24:
385         case MACFG_25:
386         case MACFG_26:
387         case MACFG_27:
388         case MACFG_28:
389         case MACFG_31:
390         case MACFG_32:
391         case MACFG_33:
392         case MACFG_63:
393         case MACFG_64:
394         case MACFG_65:
395         case MACFG_66:
396                 MP_WritePhyUshort(sc, 0x0e, 0x0000);
397                 break;
398         case MACFG_56:
399         case MACFG_57:
400         case MACFG_58:
401         case MACFG_61:
402                 Data8 = re_eri_read(sc, 0x1AB, 1, ERIAR_ExGMAC);
403                 Data8 |= (BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
404                 re_eri_write(sc, 0x1AB, 1, Data8, ERIAR_ExGMAC);
405                 break;
406         default:
407                 break;
408         };
409
410
411         MP_WritePhyUshort(sc, MII_BMCR, BMCR_AUTOEN);
412
413         //wait mdc/mdio ready
414         switch(sc->re_type) {
415         case MACFG_61:
416         case MACFG_62:
417         case MACFG_67:
418                 DELAY(10000);
419                 break;
420         }
421
422         //wait ups resume (phy state 3)
423         switch(sc->re_type) {
424         case MACFG_68:
425         case MACFG_69:
426         case MACFG_70:
427         case MACFG_71:
428                 re_wait_phy_ups_resume(sc, 3);
429                 break;
430         };
431 }
432
433 static void re_phy_power_down(device_t dev)
434 {
435         struct re_softc         *sc;
436         u_int8_t Data8;
437
438         sc = device_get_softc(dev);
439
440         if (sc->re_dash) {
441                 re_set_wol_linkspeed(sc);
442                 return;
443         }
444
445         MP_WritePhyUshort(sc, 0x1F, 0x0000);
446
447         switch (sc->re_type) {
448         case MACFG_21:
449         case MACFG_22:
450         case MACFG_23:
451         case MACFG_24:
452         case MACFG_25:
453         case MACFG_26:
454         case MACFG_27:
455         case MACFG_28:
456         case MACFG_31:
457         case MACFG_32:
458         case MACFG_33:
459         case MACFG_63:
460         case MACFG_64:
461         case MACFG_65:
462         case MACFG_66:
463                 MP_WritePhyUshort(sc, 0x0e, 0x0200);
464                 MP_WritePhyUshort(sc, MII_BMCR, (BMCR_AUTOEN|BMCR_PDOWN));
465                 break;
466         case MACFG_56:
467         case MACFG_57:
468         case MACFG_58:
469         case MACFG_61:
470                 Data8 = re_eri_read(sc, 0x1AB, 1, ERIAR_ExGMAC);
471                 Data8 &= ~(BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
472                 re_eri_write(sc, 0x1AB, 1, Data8, ERIAR_ExGMAC);
473
474                 MP_WritePhyUshort(sc, MII_BMCR, (BMCR_AUTOEN|BMCR_PDOWN));
475                 break;
476         default:
477                 MP_WritePhyUshort(sc, MII_BMCR, (BMCR_AUTOEN|BMCR_PDOWN));
478                 break;
479         }
480
481         switch (sc->re_type) {
482         case MACFG_56:
483         case MACFG_57:
484                 CSR_WRITE_1(sc, 0xD0, CSR_READ_1(sc, 0xD0) & ~BIT_6);
485                 break;
486         }
487
488         switch (sc->re_type) {
489         case MACFG_68:
490         case MACFG_69:
491                 CSR_WRITE_1(sc, 0xD0, CSR_READ_1(sc, 0xD0) & ~BIT_6);
492                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) & ~BIT_6);
493                 break;
494         }
495
496         if ((sc->re_if_flags & RL_FLAG_PHYWAKE_PM) != 0)
497                 CSR_WRITE_1(sc, RE_PMCH, CSR_READ_1(sc, RE_PMCH) & ~(BIT_6|BIT_7));
498 }
499
500 #ifndef __DragonFly__
501 static void re_tx_dma_map_buf(void *arg, bus_dma_segment_t *segs, int nseg, int error)
502 {
503         union TxDesc *txptr = arg;
504
505         if (error) {
506                 txptr->ul[0] &= ~htole32(RL_TDESC_CMD_BUFLEN);
507                 txptr->so1.TxBuffL = 0;
508                 txptr->so1.TxBuffH = 0;
509                 return;
510         }
511
512         txptr->so1.TxBuffL = htole32(RL_ADDR_LO(segs->ds_addr));
513         txptr->so1.TxBuffH = htole32(RL_ADDR_HI(segs->ds_addr));
514 }
515
516 static void re_rx_dma_map_buf(void *arg, bus_dma_segment_t *segs, int nseg, int error)
517 {
518         union RxDesc *rxptr = arg;
519
520         if (error) {
521                 rxptr->ul[0] &= ~htole32(RL_RDESC_CMD_BUFLEN);
522                 rxptr->so0.RxBuffL = 0;
523                 rxptr->so0.RxBuffH = 0;
524                 return;
525         }
526
527         rxptr->so0.RxBuffL = htole32(RL_ADDR_LO(segs->ds_addr));
528         rxptr->so0.RxBuffH = htole32(RL_ADDR_HI(segs->ds_addr));
529 }
530
531 static void re_dma_map_rxdesc(void *arg, bus_dma_segment_t *segs, int nseg, int error)
532 {
533         struct re_softc *sc = arg;
534
535
536         if (error)
537                 return;
538
539         CSR_WRITE_4(sc, 0xe4, RL_ADDR_LO(segs->ds_addr));
540         CSR_WRITE_4(sc, 0xe8, RL_ADDR_HI(segs->ds_addr));
541 }
542
543 static void re_dma_map_txdesc(void *arg, bus_dma_segment_t *segs, int nseg, int error)
544 {
545         struct re_softc *sc = arg;
546
547
548         if (error)
549                 return;
550
551         CSR_WRITE_4(sc, 0x20, RL_ADDR_LO(segs->ds_addr));
552         CSR_WRITE_4(sc, 0x24, RL_ADDR_HI(segs->ds_addr));
553 }
554
555 /*
556  * Probe for a RealTek 8129/8139 chip. Check the PCI vendor and device
557  * IDs against our list and return a device name if we find a match.
558  */
559 static int re_probe(dev)        /* Search for Realtek NIC chip */
560 device_t                dev;
561 {
562         struct re_type          *t;
563         t = re_devs;
564         while (t->re_name != NULL) {
565                 if ((pci_get_vendor(dev) == t->re_vid) &&
566                     (pci_get_device(dev) == t->re_did)) {
567                         device_set_desc(dev, t->re_name);
568                         return(0);
569                 }
570                 t++;
571         }
572
573         return(ENXIO);
574 }
575 #endif  /* !__DragonFly__ */
576
577
578 static u_int32_t re_eri_read_with_oob_base_address(struct re_softc *sc, int addr, int len, int type, const u_int32_t base_address)
579 {
580         int i, val_shift, shift = 0;
581         u_int32_t value1 = 0, value2 = 0, mask;
582         const u_int32_t transformed_base_address = ((base_address & 0x00FFF000) << 6) | (base_address & 0x000FFF);
583
584         if (len > 4 || len <= 0)
585                 return -1;
586
587         while (len > 0) {
588                 val_shift = addr % ERIAR_Addr_Align;
589                 addr = addr & ~0x3;
590
591                 CSR_WRITE_4(sc,RE_ERIAR,
592                             ERIAR_Read |
593                             transformed_base_address |
594                             type << ERIAR_Type_shift |
595                             ERIAR_ByteEn << ERIAR_ByteEn_shift |
596                             addr);
597
598                 for (i = 0; i < 10; i++) {
599                         DELAY(100);
600
601                         /* Check if the RTL8168 has completed ERI read */
602                         if (CSR_READ_4(sc,RE_ERIAR) & ERIAR_Flag)
603                                 break;
604                 }
605
606                 if (len == 1)           mask = (0xFF << (val_shift * 8)) & 0xFFFFFFFF;
607                 else if (len == 2)      mask = (0xFFFF << (val_shift * 8)) & 0xFFFFFFFF;
608                 else if (len == 3)      mask = (0xFFFFFF << (val_shift * 8)) & 0xFFFFFFFF;
609                 else                    mask = (0xFFFFFFFF << (val_shift * 8)) & 0xFFFFFFFF;
610
611                 value1 = CSR_READ_4(sc,RE_ERIDR) & mask;
612                 value2 |= (value1 >> val_shift * 8) << shift * 8;
613
614                 if (len <= 4 - val_shift)
615                         len = 0;
616                 else {
617                         len -= (4 - val_shift);
618                         shift = 4 - val_shift;
619                         addr += 4;
620                 }
621         }
622
623         return value2;
624 }
625
626 static u_int32_t re_eri_read(struct re_softc *sc, int addr, int len, int type)
627 {
628         return re_eri_read_with_oob_base_address(sc, addr, len, type, 0);
629 }
630
631 static int re_eri_write_with_oob_base_address(struct re_softc *sc, int addr, int len, u_int32_t value, int type, const u_int32_t base_address)
632 {
633
634         int i, val_shift, shift = 0;
635         u_int32_t value1 = 0, mask;
636         const u_int32_t transformed_base_address = ((base_address & 0x00FFF000) << 6) | (base_address & 0x000FFF);
637
638         if (len > 4 || len <= 0)
639                 return -1;
640
641         while (len > 0) {
642                 val_shift = addr % ERIAR_Addr_Align;
643                 addr = addr & ~0x3;
644
645                 if (len == 1)           mask = (0xFF << (val_shift * 8)) & 0xFFFFFFFF;
646                 else if (len == 2)      mask = (0xFFFF << (val_shift * 8)) & 0xFFFFFFFF;
647                 else if (len == 3)      mask = (0xFFFFFF << (val_shift * 8)) & 0xFFFFFFFF;
648                 else                    mask = (0xFFFFFFFF << (val_shift * 8)) & 0xFFFFFFFF;
649
650                 value1 = re_eri_read_with_oob_base_address(sc, addr, 4, type, base_address) & ~mask;
651                 value1 |= ((value << val_shift * 8) >> shift * 8);
652
653                 CSR_WRITE_4(sc,RE_ERIDR, value1);
654                 CSR_WRITE_4(sc,RE_ERIAR,
655                             ERIAR_Write |
656                             transformed_base_address |
657                             type << ERIAR_Type_shift |
658                             ERIAR_ByteEn << ERIAR_ByteEn_shift |
659                             addr);
660
661                 for (i = 0; i < 10; i++) {
662                         DELAY(100);
663
664                         /* Check if the RTL8168 has completed ERI write */
665                         if (!(CSR_READ_4(sc,RE_ERIAR) & ERIAR_Flag))
666                                 break;
667                 }
668
669                 if (len <= 4 - val_shift)
670                         len = 0;
671                 else {
672                         len -= (4 - val_shift);
673                         shift = 4 - val_shift;
674                         addr += 4;
675                 }
676         }
677
678         return 0;
679 }
680
681 static int re_eri_write(struct re_softc *sc, int addr, int len, u_int32_t value, int type)
682 {
683         return re_eri_write_with_oob_base_address(sc, addr, len, value, type, 0);
684 }
685
686 static void
687 ClearAndSetEthPhyBit(
688         struct re_softc *sc,
689         u_int8_t   addr,
690         u_int16_t   clearmask,
691         u_int16_t   setmask
692 )
693 {
694         u_int16_t PhyRegValue;
695
696
697         PhyRegValue = MP_ReadPhyUshort(sc, addr);
698         PhyRegValue &= ~clearmask;
699         PhyRegValue |= setmask;
700         MP_WritePhyUshort(sc, addr, PhyRegValue);
701 }
702
703 static void
704 ClearEthPhyBit(
705         struct re_softc *sc,
706         u_int8_t   addr,
707         u_int16_t   mask
708 )
709 {
710         ClearAndSetEthPhyBit(sc,
711                              addr,
712                              mask,
713                              0
714                             );
715 }
716
717 static void
718 SetEthPhyBit(
719         struct re_softc *sc,
720         u_int8_t   addr,
721         u_int16_t   mask
722 )
723 {
724         ClearAndSetEthPhyBit(sc,
725                              addr,
726                              0,
727                              mask
728                             );
729 }
730
731 #ifndef __DragonFly__
732 static void re_release_rx_buf(struct re_softc *sc)
733 {
734         struct ifnet            *ifp;
735         int i;
736         ifp = RE_GET_IFNET(sc);
737
738         if (sc->re_desc.re_rx_mtag) {
739                 for (i = 0; i < RE_RX_BUF_NUM; i++) {
740                         if (sc->re_desc.rx_buf[i]!=NULL) {
741                                 bus_dmamap_sync(sc->re_desc.re_rx_mtag,
742                                                 sc->re_desc.re_rx_dmamap[i],
743                                                 BUS_DMASYNC_POSTREAD);
744                                 bus_dmamap_unload(sc->re_desc.re_rx_mtag,
745                                                   sc->re_desc.re_rx_dmamap[i]);
746                                 bus_dmamap_destroy(sc->re_desc.re_rx_mtag,
747                                                    sc->re_desc.re_rx_dmamap[i]);
748                                 m_freem(sc->re_desc.rx_buf[i]);
749                                 sc->re_desc.rx_buf[i] =NULL;
750                         }
751                 }
752                 bus_dma_tag_destroy(sc->re_desc.re_rx_mtag);
753                 sc->re_desc.re_rx_mtag =0;
754         }
755
756 }
757 static void re_release_tx_buf(struct re_softc *sc)
758 {
759         struct ifnet            *ifp;
760         int i;
761         ifp = RE_GET_IFNET(sc);
762
763         if (sc->re_desc.re_tx_mtag) {
764                 for (i = 0; i < RE_TX_BUF_NUM; i++) {
765
766                         bus_dmamap_destroy(sc->re_desc.re_tx_mtag,
767                                            sc->re_desc.re_tx_dmamap[i]);
768                         m_freem(sc->re_desc.tx_buf[i]);
769
770                 }
771                 bus_dma_tag_destroy(sc->re_desc.re_tx_mtag);
772                 sc->re_desc.re_tx_mtag = 0;
773         }
774
775
776 }
777 static void re_release_buf(struct re_softc *sc)
778 {
779         re_release_rx_buf(sc);
780         re_release_tx_buf(sc);
781 }
782
783
784
785 static int re_alloc_buf(struct re_softc *sc)
786 {
787         int error =0;
788         int i,size;
789
790         error = bus_dma_tag_create(sc->re_parent_tag, 1, 0,
791                                    BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL,
792                                    NULL, MCLBYTES* RE_NTXSEGS, RE_NTXSEGS, 4096, 0,
793                                    NULL, NULL, &sc->re_desc.re_tx_mtag);
794
795         if (error) {
796                 //device_printf(dev,"re_tx_mtag fail\n");
797                 //goto fail;
798                 return error;
799         }
800
801         error = bus_dma_tag_create(
802                         sc->re_parent_tag,
803                         RE_RX_BUFFER_ALIGN, 0,          /* alignment, boundary */
804                         BUS_SPACE_MAXADDR,              /* lowaddr */
805                         BUS_SPACE_MAXADDR,              /* highaddr */
806                         NULL, NULL,                     /* filter, filterarg */
807                         sc->re_rx_desc_buf_sz, 1,                       /* maxsize,nsegments */
808                         sc->re_rx_desc_buf_sz,                  /* maxsegsize */
809                         0,                              /* flags */
810                         NULL, NULL,                     /* lockfunc, lockarg */
811                         &sc->re_desc.re_rx_mtag);
812         if (error) {
813                 //device_printf(dev,"re_rx_mtag fail\n");
814                 //goto fail;
815                 return error;
816         }
817
818         if (sc->re_rx_mbuf_sz <= MCLBYTES)
819                 size = MCLBYTES;
820         else if (sc->re_rx_mbuf_sz <=  MJUMPAGESIZE)
821                 size = MJUMPAGESIZE;
822         else
823                 size =MJUM9BYTES;
824         for (i = 0; i < RE_RX_BUF_NUM; i++) {
825                 sc->re_desc.rx_buf[i] = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, size);
826                 if (!sc->re_desc.rx_buf[i]) {
827                         //device_printf(dev, "m_getcl fail!!!\n");
828                         error = ENXIO;
829                         //goto fail;
830                         return error;
831                 }
832
833                 sc->re_desc.rx_buf[i]->m_len = sc->re_desc.rx_buf[i]->m_pkthdr.len = size;
834 #ifdef RE_FIXUP_RX
835                 /*
836                  * This is part of an evil trick to deal with non-x86 platforms.
837                  * The RealTek chip requires RX buffers to be aligned on 64-bit
838                  * boundaries, but that will hose non-x86 machines. To get around
839                  * this, we leave some empty space at the start of each buffer
840                  * and for non-x86 hosts, we copy the buffer back six bytes
841                  * to achieve word alignment. This is slightly more efficient
842                  * than allocating a new buffer, copying the contents, and
843                  * discarding the old buffer.
844                  */
845                 m_adj(sc->re_desc.rx_buf[i], RE_ETHER_ALIGN);
846 #endif
847
848                 error = bus_dmamap_create(sc->re_desc.re_rx_mtag, BUS_DMA_NOWAIT, &sc->re_desc.re_rx_dmamap[i]);
849                 if (error) {
850                         //device_printf(dev, "bus_dmamap_create fail!!!\n");
851                         //goto fail;
852                         return error;
853                 }
854         }
855
856         for (i = 0; i < RE_TX_BUF_NUM; i++) {
857                 error = bus_dmamap_create(sc->re_desc.re_tx_mtag, BUS_DMA_NOWAIT, &sc->re_desc.re_tx_dmamap[i]);
858                 if (error) {
859                         //device_printf(dev, "bus_dmamap_create fail!!!\n");
860                         //goto fail;
861                         return error;
862                 }
863         }
864
865         return 0;
866 }
867
868 static void set_rxbufsize(struct re_softc *sc)
869 {
870
871         //printf("set size\n");
872
873         struct ifnet            *ifp;
874         ifp = RE_GET_IFNET(sc);
875         sc->re_rx_desc_buf_sz = (ifp->if_mtu > ETHERMTU) ? ifp->if_mtu: ETHERMTU;
876         sc->re_rx_desc_buf_sz += (ETHER_VLAN_ENCAP_LEN + ETHER_HDR_LEN + ETHER_CRC_LEN + 1);
877         CSR_WRITE_2(sc, RE_RxMaxSize, sc->re_rx_desc_buf_sz);
878 }
879 #endif  /* !__DragonFly__ */
880
881 static void re_enable_cfg9346_write(struct re_softc *sc)
882 {
883         EE_SET(RE_EEMODE_WRITECFG);
884 }
885
886 static void re_disable_cfg9346_write(struct re_softc *sc)
887 {
888         EE_CLR(RE_EEMODE_WRITECFG);
889 }
890
891 static void DisableMcuBPs(struct re_softc *sc)
892 {
893         switch(sc->re_type) {
894         case MACFG_68:
895         case MACFG_69:
896         case MACFG_70:
897         case MACFG_71:
898                 MP_WriteMcuAccessRegWord(sc, 0xFC38, 0x0000);
899                 break;
900         }
901
902         switch(sc->re_type) {
903         case MACFG_56:
904         case MACFG_57:
905         case MACFG_58:
906         case MACFG_59:
907         case MACFG_60:
908         case MACFG_61:
909         case MACFG_62:
910         case MACFG_67:
911         case MACFG_68:
912         case MACFG_69:
913         case MACFG_70:
914         case MACFG_71:
915                 re_enable_cfg9346_write(sc);
916                 CSR_WRITE_1(sc, RE_CFG5, CSR_READ_1(sc, RE_CFG5) & ~BIT_0);
917                 CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) & ~BIT_7);
918                 re_disable_cfg9346_write(sc);
919
920                 MP_WriteMcuAccessRegWord(sc, 0xFC28, 0x0000);
921                 MP_WriteMcuAccessRegWord(sc, 0xFC2A, 0x0000);
922                 MP_WriteMcuAccessRegWord(sc, 0xFC2C, 0x0000);
923                 MP_WriteMcuAccessRegWord(sc, 0xFC2E, 0x0000);
924                 MP_WriteMcuAccessRegWord(sc, 0xFC30, 0x0000);
925                 MP_WriteMcuAccessRegWord(sc, 0xFC32, 0x0000);
926                 MP_WriteMcuAccessRegWord(sc, 0xFC34, 0x0000);
927                 MP_WriteMcuAccessRegWord(sc, 0xFC36, 0x0000);
928
929                 DELAY(3000);
930
931                 MP_WriteMcuAccessRegWord(sc, 0xFC26, 0x0000);
932                 break;
933         }
934 }
935
936 static void re_set_mac_mcu_8168g_1(struct re_softc *sc)
937 {
938         MP_WriteMcuAccessRegWord(sc, 0xE43C, 0x0000);
939         MP_WriteMcuAccessRegWord(sc, 0xE43E, 0x0000);
940
941         MP_WriteMcuAccessRegWord(sc, 0xE434, 0x0004);
942         MP_WriteMcuAccessRegWord(sc, 0xE43C, 0x0004);
943
944         DisableMcuBPs(sc);
945
946         MP_WriteMcuAccessRegWord(sc, 0xF800, 0xE008);
947         MP_WriteMcuAccessRegWord(sc, 0xF802, 0xE01B);
948         MP_WriteMcuAccessRegWord(sc, 0xF804, 0xE022);
949         MP_WriteMcuAccessRegWord(sc, 0xF806, 0xE094);
950         MP_WriteMcuAccessRegWord(sc, 0xF808, 0xE097);
951         MP_WriteMcuAccessRegWord(sc, 0xF80A, 0xE09A);
952         MP_WriteMcuAccessRegWord(sc, 0xF80C, 0xE0B3);
953         MP_WriteMcuAccessRegWord(sc, 0xF80E, 0xE0BA);
954         MP_WriteMcuAccessRegWord(sc, 0xF810, 0x49D2);
955         MP_WriteMcuAccessRegWord(sc, 0xF812, 0xF10D);
956         MP_WriteMcuAccessRegWord(sc, 0xF814, 0x766C);
957         MP_WriteMcuAccessRegWord(sc, 0xF816, 0x49E2);
958         MP_WriteMcuAccessRegWord(sc, 0xF818, 0xF00A);
959         MP_WriteMcuAccessRegWord(sc, 0xF81A, 0x1EC0);
960         MP_WriteMcuAccessRegWord(sc, 0xF81C, 0x8EE1);
961         MP_WriteMcuAccessRegWord(sc, 0xF81E, 0xC60A);
962         MP_WriteMcuAccessRegWord(sc, 0xF820, 0x77C0);
963         MP_WriteMcuAccessRegWord(sc, 0xF822, 0x4870);
964         MP_WriteMcuAccessRegWord(sc, 0xF824, 0x9FC0);
965         MP_WriteMcuAccessRegWord(sc, 0xF826, 0x1EA0);
966         MP_WriteMcuAccessRegWord(sc, 0xF828, 0xC707);
967         MP_WriteMcuAccessRegWord(sc, 0xF82A, 0x8EE1);
968         MP_WriteMcuAccessRegWord(sc, 0xF82C, 0x9D6C);
969         MP_WriteMcuAccessRegWord(sc, 0xF82E, 0xC603);
970         MP_WriteMcuAccessRegWord(sc, 0xF830, 0xBE00);
971         MP_WriteMcuAccessRegWord(sc, 0xF832, 0xB416);
972         MP_WriteMcuAccessRegWord(sc, 0xF834, 0x0076);
973         MP_WriteMcuAccessRegWord(sc, 0xF836, 0xE86C);
974         MP_WriteMcuAccessRegWord(sc, 0xF838, 0xC406);
975         MP_WriteMcuAccessRegWord(sc, 0xF83A, 0x7580);
976         MP_WriteMcuAccessRegWord(sc, 0xF83C, 0x4852);
977         MP_WriteMcuAccessRegWord(sc, 0xF83E, 0x8D80);
978         MP_WriteMcuAccessRegWord(sc, 0xF840, 0xC403);
979         MP_WriteMcuAccessRegWord(sc, 0xF842, 0xBC00);
980         MP_WriteMcuAccessRegWord(sc, 0xF844, 0xD3E0);
981         MP_WriteMcuAccessRegWord(sc, 0xF846, 0x02C8);
982         MP_WriteMcuAccessRegWord(sc, 0xF848, 0x8918);
983         MP_WriteMcuAccessRegWord(sc, 0xF84A, 0xE815);
984         MP_WriteMcuAccessRegWord(sc, 0xF84C, 0x1100);
985         MP_WriteMcuAccessRegWord(sc, 0xF84E, 0xF011);
986         MP_WriteMcuAccessRegWord(sc, 0xF850, 0xE812);
987         MP_WriteMcuAccessRegWord(sc, 0xF852, 0x4990);
988         MP_WriteMcuAccessRegWord(sc, 0xF854, 0xF002);
989         MP_WriteMcuAccessRegWord(sc, 0xF856, 0xE817);
990         MP_WriteMcuAccessRegWord(sc, 0xF858, 0xE80E);
991         MP_WriteMcuAccessRegWord(sc, 0xF85A, 0x4992);
992         MP_WriteMcuAccessRegWord(sc, 0xF85C, 0xF002);
993         MP_WriteMcuAccessRegWord(sc, 0xF85E, 0xE80E);
994         MP_WriteMcuAccessRegWord(sc, 0xF860, 0xE80A);
995         MP_WriteMcuAccessRegWord(sc, 0xF862, 0x4993);
996         MP_WriteMcuAccessRegWord(sc, 0xF864, 0xF002);
997         MP_WriteMcuAccessRegWord(sc, 0xF866, 0xE818);
998         MP_WriteMcuAccessRegWord(sc, 0xF868, 0xE806);
999         MP_WriteMcuAccessRegWord(sc, 0xF86A, 0x4991);
1000         MP_WriteMcuAccessRegWord(sc, 0xF86C, 0xF002);
1001         MP_WriteMcuAccessRegWord(sc, 0xF86E, 0xE838);
1002         MP_WriteMcuAccessRegWord(sc, 0xF870, 0xC25E);
1003         MP_WriteMcuAccessRegWord(sc, 0xF872, 0xBA00);
1004         MP_WriteMcuAccessRegWord(sc, 0xF874, 0xC056);
1005         MP_WriteMcuAccessRegWord(sc, 0xF876, 0x7100);
1006         MP_WriteMcuAccessRegWord(sc, 0xF878, 0xFF80);
1007         MP_WriteMcuAccessRegWord(sc, 0xF87A, 0x7100);
1008         MP_WriteMcuAccessRegWord(sc, 0xF87C, 0x4892);
1009         MP_WriteMcuAccessRegWord(sc, 0xF87E, 0x4813);
1010         MP_WriteMcuAccessRegWord(sc, 0xF880, 0x8900);
1011         MP_WriteMcuAccessRegWord(sc, 0xF882, 0xE00A);
1012         MP_WriteMcuAccessRegWord(sc, 0xF884, 0x7100);
1013         MP_WriteMcuAccessRegWord(sc, 0xF886, 0x4890);
1014         MP_WriteMcuAccessRegWord(sc, 0xF888, 0x4813);
1015         MP_WriteMcuAccessRegWord(sc, 0xF88A, 0x8900);
1016         MP_WriteMcuAccessRegWord(sc, 0xF88C, 0xC74B);
1017         MP_WriteMcuAccessRegWord(sc, 0xF88E, 0x74F8);
1018         MP_WriteMcuAccessRegWord(sc, 0xF890, 0x48C2);
1019         MP_WriteMcuAccessRegWord(sc, 0xF892, 0x4841);
1020         MP_WriteMcuAccessRegWord(sc, 0xF894, 0x8CF8);
1021         MP_WriteMcuAccessRegWord(sc, 0xF896, 0xC746);
1022         MP_WriteMcuAccessRegWord(sc, 0xF898, 0x74FC);
1023         MP_WriteMcuAccessRegWord(sc, 0xF89A, 0x49C0);
1024         MP_WriteMcuAccessRegWord(sc, 0xF89C, 0xF120);
1025         MP_WriteMcuAccessRegWord(sc, 0xF89E, 0x49C1);
1026         MP_WriteMcuAccessRegWord(sc, 0xF8A0, 0xF11E);
1027         MP_WriteMcuAccessRegWord(sc, 0xF8A2, 0x74F8);
1028         MP_WriteMcuAccessRegWord(sc, 0xF8A4, 0x49C0);
1029         MP_WriteMcuAccessRegWord(sc, 0xF8A6, 0xF01B);
1030         MP_WriteMcuAccessRegWord(sc, 0xF8A8, 0x49C6);
1031         MP_WriteMcuAccessRegWord(sc, 0xF8AA, 0xF119);
1032         MP_WriteMcuAccessRegWord(sc, 0xF8AC, 0x74F8);
1033         MP_WriteMcuAccessRegWord(sc, 0xF8AE, 0x49C4);
1034         MP_WriteMcuAccessRegWord(sc, 0xF8B0, 0xF013);
1035         MP_WriteMcuAccessRegWord(sc, 0xF8B2, 0xC536);
1036         MP_WriteMcuAccessRegWord(sc, 0xF8B4, 0x74B0);
1037         MP_WriteMcuAccessRegWord(sc, 0xF8B6, 0x49C1);
1038         MP_WriteMcuAccessRegWord(sc, 0xF8B8, 0xF1FD);
1039         MP_WriteMcuAccessRegWord(sc, 0xF8BA, 0xC537);
1040         MP_WriteMcuAccessRegWord(sc, 0xF8BC, 0xC434);
1041         MP_WriteMcuAccessRegWord(sc, 0xF8BE, 0x9CA0);
1042         MP_WriteMcuAccessRegWord(sc, 0xF8C0, 0xC435);
1043         MP_WriteMcuAccessRegWord(sc, 0xF8C2, 0x1C13);
1044         MP_WriteMcuAccessRegWord(sc, 0xF8C4, 0x484F);
1045         MP_WriteMcuAccessRegWord(sc, 0xF8C6, 0x9CA2);
1046         MP_WriteMcuAccessRegWord(sc, 0xF8C8, 0xC52B);
1047         MP_WriteMcuAccessRegWord(sc, 0xF8CA, 0x74B0);
1048         MP_WriteMcuAccessRegWord(sc, 0xF8CC, 0x49C1);
1049         MP_WriteMcuAccessRegWord(sc, 0xF8CE, 0xF1FD);
1050         MP_WriteMcuAccessRegWord(sc, 0xF8D0, 0x74F8);
1051         MP_WriteMcuAccessRegWord(sc, 0xF8D2, 0x48C4);
1052         MP_WriteMcuAccessRegWord(sc, 0xF8D4, 0x8CF8);
1053         MP_WriteMcuAccessRegWord(sc, 0xF8D6, 0x7100);
1054         MP_WriteMcuAccessRegWord(sc, 0xF8D8, 0x4893);
1055         MP_WriteMcuAccessRegWord(sc, 0xF8DA, 0x8900);
1056         MP_WriteMcuAccessRegWord(sc, 0xF8DC, 0xFF80);
1057         MP_WriteMcuAccessRegWord(sc, 0xF8DE, 0xC520);
1058         MP_WriteMcuAccessRegWord(sc, 0xF8E0, 0x74B0);
1059         MP_WriteMcuAccessRegWord(sc, 0xF8E2, 0x49C1);
1060         MP_WriteMcuAccessRegWord(sc, 0xF8E4, 0xF11C);
1061         MP_WriteMcuAccessRegWord(sc, 0xF8E6, 0xC71E);
1062         MP_WriteMcuAccessRegWord(sc, 0xF8E8, 0x74FC);
1063         MP_WriteMcuAccessRegWord(sc, 0xF8EA, 0x49C1);
1064         MP_WriteMcuAccessRegWord(sc, 0xF8EC, 0xF118);
1065         MP_WriteMcuAccessRegWord(sc, 0xF8EE, 0x49C0);
1066         MP_WriteMcuAccessRegWord(sc, 0xF8F0, 0xF116);
1067         MP_WriteMcuAccessRegWord(sc, 0xF8F2, 0x74F8);
1068         MP_WriteMcuAccessRegWord(sc, 0xF8F4, 0x49C0);
1069         MP_WriteMcuAccessRegWord(sc, 0xF8F6, 0xF013);
1070         MP_WriteMcuAccessRegWord(sc, 0xF8F8, 0x48C3);
1071         MP_WriteMcuAccessRegWord(sc, 0xF8FA, 0x8CF8);
1072         MP_WriteMcuAccessRegWord(sc, 0xF8FC, 0xC516);
1073         MP_WriteMcuAccessRegWord(sc, 0xF8FE, 0x74A2);
1074         MP_WriteMcuAccessRegWord(sc, 0xF900, 0x49CE);
1075         MP_WriteMcuAccessRegWord(sc, 0xF902, 0xF1FE);
1076         MP_WriteMcuAccessRegWord(sc, 0xF904, 0xC411);
1077         MP_WriteMcuAccessRegWord(sc, 0xF906, 0x9CA0);
1078         MP_WriteMcuAccessRegWord(sc, 0xF908, 0xC411);
1079         MP_WriteMcuAccessRegWord(sc, 0xF90A, 0x1C13);
1080         MP_WriteMcuAccessRegWord(sc, 0xF90C, 0x484F);
1081         MP_WriteMcuAccessRegWord(sc, 0xF90E, 0x9CA2);
1082         MP_WriteMcuAccessRegWord(sc, 0xF910, 0x74A2);
1083         MP_WriteMcuAccessRegWord(sc, 0xF912, 0x49CF);
1084         MP_WriteMcuAccessRegWord(sc, 0xF914, 0xF1FE);
1085         MP_WriteMcuAccessRegWord(sc, 0xF916, 0x7100);
1086         MP_WriteMcuAccessRegWord(sc, 0xF918, 0x4891);
1087         MP_WriteMcuAccessRegWord(sc, 0xF91A, 0x8900);
1088         MP_WriteMcuAccessRegWord(sc, 0xF91C, 0xFF80);
1089         MP_WriteMcuAccessRegWord(sc, 0xF91E, 0xE400);
1090         MP_WriteMcuAccessRegWord(sc, 0xF920, 0xD3E0);
1091         MP_WriteMcuAccessRegWord(sc, 0xF922, 0xE000);
1092         MP_WriteMcuAccessRegWord(sc, 0xF924, 0x0481);
1093         MP_WriteMcuAccessRegWord(sc, 0xF926, 0x0C81);
1094         MP_WriteMcuAccessRegWord(sc, 0xF928, 0xDE20);
1095         MP_WriteMcuAccessRegWord(sc, 0xF92A, 0x0000);
1096         MP_WriteMcuAccessRegWord(sc, 0xF92C, 0x0992);
1097         MP_WriteMcuAccessRegWord(sc, 0xF92E, 0x1B76);
1098         MP_WriteMcuAccessRegWord(sc, 0xF930, 0xC602);
1099         MP_WriteMcuAccessRegWord(sc, 0xF932, 0xBE00);
1100         MP_WriteMcuAccessRegWord(sc, 0xF934, 0x059C);
1101         MP_WriteMcuAccessRegWord(sc, 0xF936, 0x1B76);
1102         MP_WriteMcuAccessRegWord(sc, 0xF938, 0xC602);
1103         MP_WriteMcuAccessRegWord(sc, 0xF93A, 0xBE00);
1104         MP_WriteMcuAccessRegWord(sc, 0xF93C, 0x065A);
1105         MP_WriteMcuAccessRegWord(sc, 0xF93E, 0xB400);
1106         MP_WriteMcuAccessRegWord(sc, 0xF940, 0x18DE);
1107         MP_WriteMcuAccessRegWord(sc, 0xF942, 0x2008);
1108         MP_WriteMcuAccessRegWord(sc, 0xF944, 0x4001);
1109         MP_WriteMcuAccessRegWord(sc, 0xF946, 0xF10F);
1110         MP_WriteMcuAccessRegWord(sc, 0xF948, 0x7342);
1111         MP_WriteMcuAccessRegWord(sc, 0xF94A, 0x1880);
1112         MP_WriteMcuAccessRegWord(sc, 0xF94C, 0x2008);
1113         MP_WriteMcuAccessRegWord(sc, 0xF94E, 0x0009);
1114         MP_WriteMcuAccessRegWord(sc, 0xF950, 0x4018);
1115         MP_WriteMcuAccessRegWord(sc, 0xF952, 0xF109);
1116         MP_WriteMcuAccessRegWord(sc, 0xF954, 0x7340);
1117         MP_WriteMcuAccessRegWord(sc, 0xF956, 0x25BC);
1118         MP_WriteMcuAccessRegWord(sc, 0xF958, 0x130F);
1119         MP_WriteMcuAccessRegWord(sc, 0xF95A, 0xF105);
1120         MP_WriteMcuAccessRegWord(sc, 0xF95C, 0xC00A);
1121         MP_WriteMcuAccessRegWord(sc, 0xF95E, 0x7300);
1122         MP_WriteMcuAccessRegWord(sc, 0xF960, 0x4831);
1123         MP_WriteMcuAccessRegWord(sc, 0xF962, 0x9B00);
1124         MP_WriteMcuAccessRegWord(sc, 0xF964, 0xB000);
1125         MP_WriteMcuAccessRegWord(sc, 0xF966, 0x7340);
1126         MP_WriteMcuAccessRegWord(sc, 0xF968, 0x8320);
1127         MP_WriteMcuAccessRegWord(sc, 0xF96A, 0xC302);
1128         MP_WriteMcuAccessRegWord(sc, 0xF96C, 0xBB00);
1129         MP_WriteMcuAccessRegWord(sc, 0xF96E, 0x0C12);
1130         MP_WriteMcuAccessRegWord(sc, 0xF970, 0xE860);
1131         MP_WriteMcuAccessRegWord(sc, 0xF972, 0xC406);
1132         MP_WriteMcuAccessRegWord(sc, 0xF974, 0x7580);
1133         MP_WriteMcuAccessRegWord(sc, 0xF976, 0x4851);
1134         MP_WriteMcuAccessRegWord(sc, 0xF978, 0x8D80);
1135         MP_WriteMcuAccessRegWord(sc, 0xF97A, 0xC403);
1136         MP_WriteMcuAccessRegWord(sc, 0xF97C, 0xBC00);
1137         MP_WriteMcuAccessRegWord(sc, 0xF97E, 0xD3E0);
1138         MP_WriteMcuAccessRegWord(sc, 0xF980, 0x02C8);
1139         MP_WriteMcuAccessRegWord(sc, 0xF982, 0xC406);
1140         MP_WriteMcuAccessRegWord(sc, 0xF984, 0x7580);
1141         MP_WriteMcuAccessRegWord(sc, 0xF986, 0x4850);
1142         MP_WriteMcuAccessRegWord(sc, 0xF988, 0x8D80);
1143         MP_WriteMcuAccessRegWord(sc, 0xF98A, 0xC403);
1144         MP_WriteMcuAccessRegWord(sc, 0xF98C, 0xBC00);
1145         MP_WriteMcuAccessRegWord(sc, 0xF98E, 0xD3E0);
1146         MP_WriteMcuAccessRegWord(sc, 0xF990, 0x0298);
1147
1148         MP_WriteMcuAccessRegWord(sc, 0xDE30, 0x0080);
1149
1150         MP_WriteMcuAccessRegWord(sc, 0xFC26, 0x8000);
1151
1152         MP_WriteMcuAccessRegWord(sc, 0xFC28, 0x0075);
1153         MP_WriteMcuAccessRegWord(sc, 0xFC2A, 0x02B1);
1154         MP_WriteMcuAccessRegWord(sc, 0xFC2C, 0x0991);
1155         MP_WriteMcuAccessRegWord(sc, 0xFC2E, 0x059B);
1156         MP_WriteMcuAccessRegWord(sc, 0xFC30, 0x0659);
1157         MP_WriteMcuAccessRegWord(sc, 0xFC32, 0x0000);
1158         MP_WriteMcuAccessRegWord(sc, 0xFC34, 0x02BB);
1159         MP_WriteMcuAccessRegWord(sc, 0xFC36, 0x0279);
1160 }
1161
1162 static void re_set_mac_mcu_8168gu_1(struct re_softc *sc)
1163 {
1164         DisableMcuBPs(sc);
1165
1166         MP_WriteMcuAccessRegWord(sc, 0xF800, 0xE008);
1167         MP_WriteMcuAccessRegWord(sc, 0xF802, 0xE011);
1168         MP_WriteMcuAccessRegWord(sc, 0xF804, 0xE015);
1169         MP_WriteMcuAccessRegWord(sc, 0xF806, 0xE018);
1170         MP_WriteMcuAccessRegWord(sc, 0xF808, 0xE01B);
1171         MP_WriteMcuAccessRegWord(sc, 0xF80A, 0xE027);
1172         MP_WriteMcuAccessRegWord(sc, 0xF80C, 0xE043);
1173         MP_WriteMcuAccessRegWord(sc, 0xF80E, 0xE065);
1174         MP_WriteMcuAccessRegWord(sc, 0xF810, 0x49E2);
1175         MP_WriteMcuAccessRegWord(sc, 0xF812, 0xF005);
1176         MP_WriteMcuAccessRegWord(sc, 0xF814, 0x49EA);
1177         MP_WriteMcuAccessRegWord(sc, 0xF816, 0xF003);
1178         MP_WriteMcuAccessRegWord(sc, 0xF818, 0xC404);
1179         MP_WriteMcuAccessRegWord(sc, 0xF81A, 0xBC00);
1180         MP_WriteMcuAccessRegWord(sc, 0xF81C, 0xC403);
1181         MP_WriteMcuAccessRegWord(sc, 0xF81E, 0xBC00);
1182         MP_WriteMcuAccessRegWord(sc, 0xF820, 0x0496);
1183         MP_WriteMcuAccessRegWord(sc, 0xF822, 0x051A);
1184         MP_WriteMcuAccessRegWord(sc, 0xF824, 0x1D01);
1185         MP_WriteMcuAccessRegWord(sc, 0xF826, 0x8DE8);
1186         MP_WriteMcuAccessRegWord(sc, 0xF828, 0xC602);
1187         MP_WriteMcuAccessRegWord(sc, 0xF82A, 0xBE00);
1188         MP_WriteMcuAccessRegWord(sc, 0xF82C, 0x0206);
1189         MP_WriteMcuAccessRegWord(sc, 0xF82E, 0x1B76);
1190         MP_WriteMcuAccessRegWord(sc, 0xF830, 0xC202);
1191         MP_WriteMcuAccessRegWord(sc, 0xF832, 0xBA00);
1192         MP_WriteMcuAccessRegWord(sc, 0xF834, 0x058A);
1193         MP_WriteMcuAccessRegWord(sc, 0xF836, 0x1B76);
1194         MP_WriteMcuAccessRegWord(sc, 0xF838, 0xC602);
1195         MP_WriteMcuAccessRegWord(sc, 0xF83A, 0xBE00);
1196         MP_WriteMcuAccessRegWord(sc, 0xF83C, 0x0648);
1197         MP_WriteMcuAccessRegWord(sc, 0xF83E, 0x74E6);
1198         MP_WriteMcuAccessRegWord(sc, 0xF840, 0x1B78);
1199         MP_WriteMcuAccessRegWord(sc, 0xF842, 0x46DC);
1200         MP_WriteMcuAccessRegWord(sc, 0xF844, 0x1300);
1201         MP_WriteMcuAccessRegWord(sc, 0xF846, 0xF005);
1202         MP_WriteMcuAccessRegWord(sc, 0xF848, 0x74F8);
1203         MP_WriteMcuAccessRegWord(sc, 0xF84A, 0x48C3);
1204         MP_WriteMcuAccessRegWord(sc, 0xF84C, 0x48C4);
1205         MP_WriteMcuAccessRegWord(sc, 0xF84E, 0x8CF8);
1206         MP_WriteMcuAccessRegWord(sc, 0xF850, 0x64E7);
1207         MP_WriteMcuAccessRegWord(sc, 0xF852, 0xC302);
1208         MP_WriteMcuAccessRegWord(sc, 0xF854, 0xBB00);
1209         MP_WriteMcuAccessRegWord(sc, 0xF856, 0x068E);
1210         MP_WriteMcuAccessRegWord(sc, 0xF858, 0x74E4);
1211         MP_WriteMcuAccessRegWord(sc, 0xF85A, 0x49C5);
1212         MP_WriteMcuAccessRegWord(sc, 0xF85C, 0xF106);
1213         MP_WriteMcuAccessRegWord(sc, 0xF85E, 0x49C6);
1214         MP_WriteMcuAccessRegWord(sc, 0xF860, 0xF107);
1215         MP_WriteMcuAccessRegWord(sc, 0xF862, 0x48C8);
1216         MP_WriteMcuAccessRegWord(sc, 0xF864, 0x48C9);
1217         MP_WriteMcuAccessRegWord(sc, 0xF866, 0xE011);
1218         MP_WriteMcuAccessRegWord(sc, 0xF868, 0x48C9);
1219         MP_WriteMcuAccessRegWord(sc, 0xF86A, 0x4848);
1220         MP_WriteMcuAccessRegWord(sc, 0xF86C, 0xE00E);
1221         MP_WriteMcuAccessRegWord(sc, 0xF86E, 0x4848);
1222         MP_WriteMcuAccessRegWord(sc, 0xF870, 0x49C7);
1223         MP_WriteMcuAccessRegWord(sc, 0xF872, 0xF00A);
1224         MP_WriteMcuAccessRegWord(sc, 0xF874, 0x48C9);
1225         MP_WriteMcuAccessRegWord(sc, 0xF876, 0xC60D);
1226         MP_WriteMcuAccessRegWord(sc, 0xF878, 0x1D1F);
1227         MP_WriteMcuAccessRegWord(sc, 0xF87A, 0x8DC2);
1228         MP_WriteMcuAccessRegWord(sc, 0xF87C, 0x1D00);
1229         MP_WriteMcuAccessRegWord(sc, 0xF87E, 0x8DC3);
1230         MP_WriteMcuAccessRegWord(sc, 0xF880, 0x1D11);
1231         MP_WriteMcuAccessRegWord(sc, 0xF882, 0x8DC0);
1232         MP_WriteMcuAccessRegWord(sc, 0xF884, 0xE002);
1233         MP_WriteMcuAccessRegWord(sc, 0xF886, 0x4849);
1234         MP_WriteMcuAccessRegWord(sc, 0xF888, 0x94E5);
1235         MP_WriteMcuAccessRegWord(sc, 0xF88A, 0xC602);
1236         MP_WriteMcuAccessRegWord(sc, 0xF88C, 0xBE00);
1237         MP_WriteMcuAccessRegWord(sc, 0xF88E, 0x0238);
1238         MP_WriteMcuAccessRegWord(sc, 0xF890, 0xE434);
1239         MP_WriteMcuAccessRegWord(sc, 0xF892, 0x49D9);
1240         MP_WriteMcuAccessRegWord(sc, 0xF894, 0xF01B);
1241         MP_WriteMcuAccessRegWord(sc, 0xF896, 0xC31E);
1242         MP_WriteMcuAccessRegWord(sc, 0xF898, 0x7464);
1243         MP_WriteMcuAccessRegWord(sc, 0xF89A, 0x49C4);
1244         MP_WriteMcuAccessRegWord(sc, 0xF89C, 0xF114);
1245         MP_WriteMcuAccessRegWord(sc, 0xF89E, 0xC31B);
1246         MP_WriteMcuAccessRegWord(sc, 0xF8A0, 0x6460);
1247         MP_WriteMcuAccessRegWord(sc, 0xF8A2, 0x14FA);
1248         MP_WriteMcuAccessRegWord(sc, 0xF8A4, 0xFA02);
1249         MP_WriteMcuAccessRegWord(sc, 0xF8A6, 0xE00F);
1250         MP_WriteMcuAccessRegWord(sc, 0xF8A8, 0xC317);
1251         MP_WriteMcuAccessRegWord(sc, 0xF8AA, 0x7460);
1252         MP_WriteMcuAccessRegWord(sc, 0xF8AC, 0x49C0);
1253         MP_WriteMcuAccessRegWord(sc, 0xF8AE, 0xF10B);
1254         MP_WriteMcuAccessRegWord(sc, 0xF8B0, 0xC311);
1255         MP_WriteMcuAccessRegWord(sc, 0xF8B2, 0x7462);
1256         MP_WriteMcuAccessRegWord(sc, 0xF8B4, 0x48C1);
1257         MP_WriteMcuAccessRegWord(sc, 0xF8B6, 0x9C62);
1258         MP_WriteMcuAccessRegWord(sc, 0xF8B8, 0x4841);
1259         MP_WriteMcuAccessRegWord(sc, 0xF8BA, 0x9C62);
1260         MP_WriteMcuAccessRegWord(sc, 0xF8BC, 0xC30A);
1261         MP_WriteMcuAccessRegWord(sc, 0xF8BE, 0x1C04);
1262         MP_WriteMcuAccessRegWord(sc, 0xF8C0, 0x8C60);
1263         MP_WriteMcuAccessRegWord(sc, 0xF8C2, 0xE004);
1264         MP_WriteMcuAccessRegWord(sc, 0xF8C4, 0x1C15);
1265         MP_WriteMcuAccessRegWord(sc, 0xF8C6, 0xC305);
1266         MP_WriteMcuAccessRegWord(sc, 0xF8C8, 0x8C60);
1267         MP_WriteMcuAccessRegWord(sc, 0xF8CA, 0xC602);
1268         MP_WriteMcuAccessRegWord(sc, 0xF8CC, 0xBE00);
1269         MP_WriteMcuAccessRegWord(sc, 0xF8CE, 0x0374);
1270         MP_WriteMcuAccessRegWord(sc, 0xF8D0, 0xE434);
1271         MP_WriteMcuAccessRegWord(sc, 0xF8D2, 0xE030);
1272         MP_WriteMcuAccessRegWord(sc, 0xF8D4, 0xE61C);
1273         MP_WriteMcuAccessRegWord(sc, 0xF8D6, 0xE906);
1274         MP_WriteMcuAccessRegWord(sc, 0xF8D8, 0xC602);
1275         MP_WriteMcuAccessRegWord(sc, 0xF8DA, 0xBE00);
1276         MP_WriteMcuAccessRegWord(sc, 0xF8DC, 0x0000);
1277
1278         MP_WriteMcuAccessRegWord(sc, 0xFC26, 0x8000);
1279
1280         MP_WriteMcuAccessRegWord(sc, 0xFC28, 0x0493);
1281         MP_WriteMcuAccessRegWord(sc, 0xFC2A, 0x0205);
1282         MP_WriteMcuAccessRegWord(sc, 0xFC2C, 0x0589);
1283         MP_WriteMcuAccessRegWord(sc, 0xFC2E, 0x0647);
1284         MP_WriteMcuAccessRegWord(sc, 0xFC30, 0x0000);
1285         MP_WriteMcuAccessRegWord(sc, 0xFC32, 0x0215);
1286         MP_WriteMcuAccessRegWord(sc, 0xFC34, 0x0285);
1287 }
1288
1289 static void re_set_mac_mcu_8168gu_2(struct re_softc *sc)
1290 {
1291         DisableMcuBPs(sc);
1292
1293         MP_WriteMcuAccessRegWord(sc, 0xF800, 0xE008);
1294         MP_WriteMcuAccessRegWord(sc, 0xF802, 0xE00A);
1295         MP_WriteMcuAccessRegWord(sc, 0xF804, 0xE00D);
1296         MP_WriteMcuAccessRegWord(sc, 0xF806, 0xE02F);
1297         MP_WriteMcuAccessRegWord(sc, 0xF808, 0xE031);
1298         MP_WriteMcuAccessRegWord(sc, 0xF80A, 0xE038);
1299         MP_WriteMcuAccessRegWord(sc, 0xF80C, 0xE03A);
1300         MP_WriteMcuAccessRegWord(sc, 0xF80E, 0xE051);
1301         MP_WriteMcuAccessRegWord(sc, 0xF810, 0xC202);
1302         MP_WriteMcuAccessRegWord(sc, 0xF812, 0xBA00);
1303         MP_WriteMcuAccessRegWord(sc, 0xF814, 0x0DFC);
1304         MP_WriteMcuAccessRegWord(sc, 0xF816, 0x7444);
1305         MP_WriteMcuAccessRegWord(sc, 0xF818, 0xC502);
1306         MP_WriteMcuAccessRegWord(sc, 0xF81A, 0xBD00);
1307         MP_WriteMcuAccessRegWord(sc, 0xF81C, 0x0A30);
1308         MP_WriteMcuAccessRegWord(sc, 0xF81E, 0x49D9);
1309         MP_WriteMcuAccessRegWord(sc, 0xF820, 0xF019);
1310         MP_WriteMcuAccessRegWord(sc, 0xF822, 0xC520);
1311         MP_WriteMcuAccessRegWord(sc, 0xF824, 0x64A5);
1312         MP_WriteMcuAccessRegWord(sc, 0xF826, 0x1400);
1313         MP_WriteMcuAccessRegWord(sc, 0xF828, 0xF007);
1314         MP_WriteMcuAccessRegWord(sc, 0xF82A, 0x0C01);
1315         MP_WriteMcuAccessRegWord(sc, 0xF82C, 0x8CA5);
1316         MP_WriteMcuAccessRegWord(sc, 0xF82E, 0x1C15);
1317         MP_WriteMcuAccessRegWord(sc, 0xF830, 0xC515);
1318         MP_WriteMcuAccessRegWord(sc, 0xF832, 0x9CA0);
1319         MP_WriteMcuAccessRegWord(sc, 0xF834, 0xE00F);
1320         MP_WriteMcuAccessRegWord(sc, 0xF836, 0xC513);
1321         MP_WriteMcuAccessRegWord(sc, 0xF838, 0x74A0);
1322         MP_WriteMcuAccessRegWord(sc, 0xF83A, 0x48C8);
1323         MP_WriteMcuAccessRegWord(sc, 0xF83C, 0x48CA);
1324         MP_WriteMcuAccessRegWord(sc, 0xF83E, 0x9CA0);
1325         MP_WriteMcuAccessRegWord(sc, 0xF840, 0xC510);
1326         MP_WriteMcuAccessRegWord(sc, 0xF842, 0x1B00);
1327         MP_WriteMcuAccessRegWord(sc, 0xF844, 0x9BA0);
1328         MP_WriteMcuAccessRegWord(sc, 0xF846, 0x1B1C);
1329         MP_WriteMcuAccessRegWord(sc, 0xF848, 0x483F);
1330         MP_WriteMcuAccessRegWord(sc, 0xF84A, 0x9BA2);
1331         MP_WriteMcuAccessRegWord(sc, 0xF84C, 0x1B04);
1332         MP_WriteMcuAccessRegWord(sc, 0xF84E, 0xC506);
1333         MP_WriteMcuAccessRegWord(sc, 0xF850, 0x9BA0);
1334         MP_WriteMcuAccessRegWord(sc, 0xF852, 0xC603);
1335         MP_WriteMcuAccessRegWord(sc, 0xF854, 0xBE00);
1336         MP_WriteMcuAccessRegWord(sc, 0xF856, 0x0298);
1337         MP_WriteMcuAccessRegWord(sc, 0xF858, 0x03DE);
1338         MP_WriteMcuAccessRegWord(sc, 0xF85A, 0xE434);
1339         MP_WriteMcuAccessRegWord(sc, 0xF85C, 0xE096);
1340         MP_WriteMcuAccessRegWord(sc, 0xF85E, 0xE860);
1341         MP_WriteMcuAccessRegWord(sc, 0xF860, 0xDE20);
1342         MP_WriteMcuAccessRegWord(sc, 0xF862, 0xD3C0);
1343         MP_WriteMcuAccessRegWord(sc, 0xF864, 0xC602);
1344         MP_WriteMcuAccessRegWord(sc, 0xF866, 0xBE00);
1345         MP_WriteMcuAccessRegWord(sc, 0xF868, 0x0A64);
1346         MP_WriteMcuAccessRegWord(sc, 0xF86A, 0xC707);
1347         MP_WriteMcuAccessRegWord(sc, 0xF86C, 0x1D00);
1348         MP_WriteMcuAccessRegWord(sc, 0xF86E, 0x8DE2);
1349         MP_WriteMcuAccessRegWord(sc, 0xF870, 0x48C1);
1350         MP_WriteMcuAccessRegWord(sc, 0xF872, 0xC502);
1351         MP_WriteMcuAccessRegWord(sc, 0xF874, 0xBD00);
1352         MP_WriteMcuAccessRegWord(sc, 0xF876, 0x00AA);
1353         MP_WriteMcuAccessRegWord(sc, 0xF878, 0xE0C0);
1354         MP_WriteMcuAccessRegWord(sc, 0xF87A, 0xC502);
1355         MP_WriteMcuAccessRegWord(sc, 0xF87C, 0xBD00);
1356         MP_WriteMcuAccessRegWord(sc, 0xF87E, 0x0132);
1357         MP_WriteMcuAccessRegWord(sc, 0xF880, 0xC50C);
1358         MP_WriteMcuAccessRegWord(sc, 0xF882, 0x74A2);
1359         MP_WriteMcuAccessRegWord(sc, 0xF884, 0x49CE);
1360         MP_WriteMcuAccessRegWord(sc, 0xF886, 0xF1FE);
1361         MP_WriteMcuAccessRegWord(sc, 0xF888, 0x1C00);
1362         MP_WriteMcuAccessRegWord(sc, 0xF88A, 0x9EA0);
1363         MP_WriteMcuAccessRegWord(sc, 0xF88C, 0x1C1C);
1364         MP_WriteMcuAccessRegWord(sc, 0xF88E, 0x484F);
1365         MP_WriteMcuAccessRegWord(sc, 0xF890, 0x9CA2);
1366         MP_WriteMcuAccessRegWord(sc, 0xF892, 0xC402);
1367         MP_WriteMcuAccessRegWord(sc, 0xF894, 0xBC00);
1368         MP_WriteMcuAccessRegWord(sc, 0xF896, 0x0AFA);
1369         MP_WriteMcuAccessRegWord(sc, 0xF898, 0xDE20);
1370         MP_WriteMcuAccessRegWord(sc, 0xF89A, 0xE000);
1371         MP_WriteMcuAccessRegWord(sc, 0xF89C, 0xE092);
1372         MP_WriteMcuAccessRegWord(sc, 0xF89E, 0xE430);
1373         MP_WriteMcuAccessRegWord(sc, 0xF8A0, 0xDE20);
1374         MP_WriteMcuAccessRegWord(sc, 0xF8A2, 0xE0C0);
1375         MP_WriteMcuAccessRegWord(sc, 0xF8A4, 0xE860);
1376         MP_WriteMcuAccessRegWord(sc, 0xF8A6, 0xE84C);
1377         MP_WriteMcuAccessRegWord(sc, 0xF8A8, 0xB400);
1378         MP_WriteMcuAccessRegWord(sc, 0xF8AA, 0xB430);
1379         MP_WriteMcuAccessRegWord(sc, 0xF8AC, 0xE410);
1380         MP_WriteMcuAccessRegWord(sc, 0xF8AE, 0xC0AE);
1381         MP_WriteMcuAccessRegWord(sc, 0xF8B0, 0xB407);
1382         MP_WriteMcuAccessRegWord(sc, 0xF8B2, 0xB406);
1383         MP_WriteMcuAccessRegWord(sc, 0xF8B4, 0xB405);
1384         MP_WriteMcuAccessRegWord(sc, 0xF8B6, 0xB404);
1385         MP_WriteMcuAccessRegWord(sc, 0xF8B8, 0xB403);
1386         MP_WriteMcuAccessRegWord(sc, 0xF8BA, 0xB402);
1387         MP_WriteMcuAccessRegWord(sc, 0xF8BC, 0xB401);
1388         MP_WriteMcuAccessRegWord(sc, 0xF8BE, 0xC7EE);
1389         MP_WriteMcuAccessRegWord(sc, 0xF8C0, 0x76F4);
1390         MP_WriteMcuAccessRegWord(sc, 0xF8C2, 0xC2ED);
1391         MP_WriteMcuAccessRegWord(sc, 0xF8C4, 0xC3ED);
1392         MP_WriteMcuAccessRegWord(sc, 0xF8C6, 0xC1EF);
1393         MP_WriteMcuAccessRegWord(sc, 0xF8C8, 0xC5F3);
1394         MP_WriteMcuAccessRegWord(sc, 0xF8CA, 0x74A0);
1395         MP_WriteMcuAccessRegWord(sc, 0xF8CC, 0x49CD);
1396         MP_WriteMcuAccessRegWord(sc, 0xF8CE, 0xF001);
1397         MP_WriteMcuAccessRegWord(sc, 0xF8D0, 0xC5EE);
1398         MP_WriteMcuAccessRegWord(sc, 0xF8D2, 0x74A0);
1399         MP_WriteMcuAccessRegWord(sc, 0xF8D4, 0x49C1);
1400         MP_WriteMcuAccessRegWord(sc, 0xF8D6, 0xF105);
1401         MP_WriteMcuAccessRegWord(sc, 0xF8D8, 0xC5E4);
1402         MP_WriteMcuAccessRegWord(sc, 0xF8DA, 0x74A2);
1403         MP_WriteMcuAccessRegWord(sc, 0xF8DC, 0x49CE);
1404         MP_WriteMcuAccessRegWord(sc, 0xF8DE, 0xF00B);
1405         MP_WriteMcuAccessRegWord(sc, 0xF8E0, 0x7444);
1406         MP_WriteMcuAccessRegWord(sc, 0xF8E2, 0x484B);
1407         MP_WriteMcuAccessRegWord(sc, 0xF8E4, 0x9C44);
1408         MP_WriteMcuAccessRegWord(sc, 0xF8E6, 0x1C10);
1409         MP_WriteMcuAccessRegWord(sc, 0xF8E8, 0x9C62);
1410         MP_WriteMcuAccessRegWord(sc, 0xF8EA, 0x1C11);
1411         MP_WriteMcuAccessRegWord(sc, 0xF8EC, 0x8C60);
1412         MP_WriteMcuAccessRegWord(sc, 0xF8EE, 0x1C00);
1413         MP_WriteMcuAccessRegWord(sc, 0xF8F0, 0x9CF6);
1414         MP_WriteMcuAccessRegWord(sc, 0xF8F2, 0xE0EC);
1415         MP_WriteMcuAccessRegWord(sc, 0xF8F4, 0x49E7);
1416         MP_WriteMcuAccessRegWord(sc, 0xF8F6, 0xF016);
1417         MP_WriteMcuAccessRegWord(sc, 0xF8F8, 0x1D80);
1418         MP_WriteMcuAccessRegWord(sc, 0xF8FA, 0x8DF4);
1419         MP_WriteMcuAccessRegWord(sc, 0xF8FC, 0x74F8);
1420         MP_WriteMcuAccessRegWord(sc, 0xF8FE, 0x4843);
1421         MP_WriteMcuAccessRegWord(sc, 0xF900, 0x8CF8);
1422         MP_WriteMcuAccessRegWord(sc, 0xF902, 0x74F8);
1423         MP_WriteMcuAccessRegWord(sc, 0xF904, 0x74F8);
1424         MP_WriteMcuAccessRegWord(sc, 0xF906, 0x7444);
1425         MP_WriteMcuAccessRegWord(sc, 0xF908, 0x48C8);
1426         MP_WriteMcuAccessRegWord(sc, 0xF90A, 0x48C9);
1427         MP_WriteMcuAccessRegWord(sc, 0xF90C, 0x48CA);
1428         MP_WriteMcuAccessRegWord(sc, 0xF90E, 0x9C44);
1429         MP_WriteMcuAccessRegWord(sc, 0xF910, 0x74F8);
1430         MP_WriteMcuAccessRegWord(sc, 0xF912, 0x4844);
1431         MP_WriteMcuAccessRegWord(sc, 0xF914, 0x8CF8);
1432         MP_WriteMcuAccessRegWord(sc, 0xF916, 0x1E01);
1433         MP_WriteMcuAccessRegWord(sc, 0xF918, 0xE8DB);
1434         MP_WriteMcuAccessRegWord(sc, 0xF91A, 0x7420);
1435         MP_WriteMcuAccessRegWord(sc, 0xF91C, 0x48C1);
1436         MP_WriteMcuAccessRegWord(sc, 0xF91E, 0x9C20);
1437         MP_WriteMcuAccessRegWord(sc, 0xF920, 0xE0D5);
1438         MP_WriteMcuAccessRegWord(sc, 0xF922, 0x49E6);
1439         MP_WriteMcuAccessRegWord(sc, 0xF924, 0xF02A);
1440         MP_WriteMcuAccessRegWord(sc, 0xF926, 0x1D40);
1441         MP_WriteMcuAccessRegWord(sc, 0xF928, 0x8DF4);
1442         MP_WriteMcuAccessRegWord(sc, 0xF92A, 0x74FC);
1443         MP_WriteMcuAccessRegWord(sc, 0xF92C, 0x49C0);
1444         MP_WriteMcuAccessRegWord(sc, 0xF92E, 0xF124);
1445         MP_WriteMcuAccessRegWord(sc, 0xF930, 0x49C1);
1446         MP_WriteMcuAccessRegWord(sc, 0xF932, 0xF122);
1447         MP_WriteMcuAccessRegWord(sc, 0xF934, 0x74F8);
1448         MP_WriteMcuAccessRegWord(sc, 0xF936, 0x49C0);
1449         MP_WriteMcuAccessRegWord(sc, 0xF938, 0xF01F);
1450         MP_WriteMcuAccessRegWord(sc, 0xF93A, 0xE8D3);
1451         MP_WriteMcuAccessRegWord(sc, 0xF93C, 0x48C4);
1452         MP_WriteMcuAccessRegWord(sc, 0xF93E, 0x8CF8);
1453         MP_WriteMcuAccessRegWord(sc, 0xF940, 0x1E00);
1454         MP_WriteMcuAccessRegWord(sc, 0xF942, 0xE8C6);
1455         MP_WriteMcuAccessRegWord(sc, 0xF944, 0xC5B1);
1456         MP_WriteMcuAccessRegWord(sc, 0xF946, 0x74A0);
1457         MP_WriteMcuAccessRegWord(sc, 0xF948, 0x49C3);
1458         MP_WriteMcuAccessRegWord(sc, 0xF94A, 0xF016);
1459         MP_WriteMcuAccessRegWord(sc, 0xF94C, 0xC5AF);
1460         MP_WriteMcuAccessRegWord(sc, 0xF94E, 0x74A4);
1461         MP_WriteMcuAccessRegWord(sc, 0xF950, 0x49C2);
1462         MP_WriteMcuAccessRegWord(sc, 0xF952, 0xF005);
1463         MP_WriteMcuAccessRegWord(sc, 0xF954, 0xC5AA);
1464         MP_WriteMcuAccessRegWord(sc, 0xF956, 0x74B2);
1465         MP_WriteMcuAccessRegWord(sc, 0xF958, 0x49C9);
1466         MP_WriteMcuAccessRegWord(sc, 0xF95A, 0xF10E);
1467         MP_WriteMcuAccessRegWord(sc, 0xF95C, 0xC5A6);
1468         MP_WriteMcuAccessRegWord(sc, 0xF95E, 0x74A8);
1469         MP_WriteMcuAccessRegWord(sc, 0xF960, 0x4845);
1470         MP_WriteMcuAccessRegWord(sc, 0xF962, 0x4846);
1471         MP_WriteMcuAccessRegWord(sc, 0xF964, 0x4847);
1472         MP_WriteMcuAccessRegWord(sc, 0xF966, 0x4848);
1473         MP_WriteMcuAccessRegWord(sc, 0xF968, 0x9CA8);
1474         MP_WriteMcuAccessRegWord(sc, 0xF96A, 0x74B2);
1475         MP_WriteMcuAccessRegWord(sc, 0xF96C, 0x4849);
1476         MP_WriteMcuAccessRegWord(sc, 0xF96E, 0x9CB2);
1477         MP_WriteMcuAccessRegWord(sc, 0xF970, 0x74A0);
1478         MP_WriteMcuAccessRegWord(sc, 0xF972, 0x484F);
1479         MP_WriteMcuAccessRegWord(sc, 0xF974, 0x9CA0);
1480         MP_WriteMcuAccessRegWord(sc, 0xF976, 0xE0AA);
1481         MP_WriteMcuAccessRegWord(sc, 0xF978, 0x49E4);
1482         MP_WriteMcuAccessRegWord(sc, 0xF97A, 0xF018);
1483         MP_WriteMcuAccessRegWord(sc, 0xF97C, 0x1D10);
1484         MP_WriteMcuAccessRegWord(sc, 0xF97E, 0x8DF4);
1485         MP_WriteMcuAccessRegWord(sc, 0xF980, 0x74F8);
1486         MP_WriteMcuAccessRegWord(sc, 0xF982, 0x74F8);
1487         MP_WriteMcuAccessRegWord(sc, 0xF984, 0x74F8);
1488         MP_WriteMcuAccessRegWord(sc, 0xF986, 0x4843);
1489         MP_WriteMcuAccessRegWord(sc, 0xF988, 0x8CF8);
1490         MP_WriteMcuAccessRegWord(sc, 0xF98A, 0x74F8);
1491         MP_WriteMcuAccessRegWord(sc, 0xF98C, 0x74F8);
1492         MP_WriteMcuAccessRegWord(sc, 0xF98E, 0x74F8);
1493         MP_WriteMcuAccessRegWord(sc, 0xF990, 0x4844);
1494         MP_WriteMcuAccessRegWord(sc, 0xF992, 0x4842);
1495         MP_WriteMcuAccessRegWord(sc, 0xF994, 0x4841);
1496         MP_WriteMcuAccessRegWord(sc, 0xF996, 0x8CF8);
1497         MP_WriteMcuAccessRegWord(sc, 0xF998, 0x1E01);
1498         MP_WriteMcuAccessRegWord(sc, 0xF99A, 0xE89A);
1499         MP_WriteMcuAccessRegWord(sc, 0xF99C, 0x7420);
1500         MP_WriteMcuAccessRegWord(sc, 0xF99E, 0x4841);
1501         MP_WriteMcuAccessRegWord(sc, 0xF9A0, 0x9C20);
1502         MP_WriteMcuAccessRegWord(sc, 0xF9A2, 0x7444);
1503         MP_WriteMcuAccessRegWord(sc, 0xF9A4, 0x4848);
1504         MP_WriteMcuAccessRegWord(sc, 0xF9A6, 0x9C44);
1505         MP_WriteMcuAccessRegWord(sc, 0xF9A8, 0xE091);
1506         MP_WriteMcuAccessRegWord(sc, 0xF9AA, 0x49E5);
1507         MP_WriteMcuAccessRegWord(sc, 0xF9AC, 0xF03E);
1508         MP_WriteMcuAccessRegWord(sc, 0xF9AE, 0x1D20);
1509         MP_WriteMcuAccessRegWord(sc, 0xF9B0, 0x8DF4);
1510         MP_WriteMcuAccessRegWord(sc, 0xF9B2, 0x74F8);
1511         MP_WriteMcuAccessRegWord(sc, 0xF9B4, 0x48C2);
1512         MP_WriteMcuAccessRegWord(sc, 0xF9B6, 0x4841);
1513         MP_WriteMcuAccessRegWord(sc, 0xF9B8, 0x8CF8);
1514         MP_WriteMcuAccessRegWord(sc, 0xF9BA, 0x1E01);
1515         MP_WriteMcuAccessRegWord(sc, 0xF9BC, 0x7444);
1516         MP_WriteMcuAccessRegWord(sc, 0xF9BE, 0x49CA);
1517         MP_WriteMcuAccessRegWord(sc, 0xF9C0, 0xF103);
1518         MP_WriteMcuAccessRegWord(sc, 0xF9C2, 0x49C2);
1519         MP_WriteMcuAccessRegWord(sc, 0xF9C4, 0xF00C);
1520         MP_WriteMcuAccessRegWord(sc, 0xF9C6, 0x49C1);
1521         MP_WriteMcuAccessRegWord(sc, 0xF9C8, 0xF004);
1522         MP_WriteMcuAccessRegWord(sc, 0xF9CA, 0x6447);
1523         MP_WriteMcuAccessRegWord(sc, 0xF9CC, 0x2244);
1524         MP_WriteMcuAccessRegWord(sc, 0xF9CE, 0xE002);
1525         MP_WriteMcuAccessRegWord(sc, 0xF9D0, 0x1C01);
1526         MP_WriteMcuAccessRegWord(sc, 0xF9D2, 0x9C62);
1527         MP_WriteMcuAccessRegWord(sc, 0xF9D4, 0x1C11);
1528         MP_WriteMcuAccessRegWord(sc, 0xF9D6, 0x8C60);
1529         MP_WriteMcuAccessRegWord(sc, 0xF9D8, 0x1C00);
1530         MP_WriteMcuAccessRegWord(sc, 0xF9DA, 0x9CF6);
1531         MP_WriteMcuAccessRegWord(sc, 0xF9DC, 0x7444);
1532         MP_WriteMcuAccessRegWord(sc, 0xF9DE, 0x49C8);
1533         MP_WriteMcuAccessRegWord(sc, 0xF9E0, 0xF01D);
1534         MP_WriteMcuAccessRegWord(sc, 0xF9E2, 0x74FC);
1535         MP_WriteMcuAccessRegWord(sc, 0xF9E4, 0x49C0);
1536         MP_WriteMcuAccessRegWord(sc, 0xF9E6, 0xF11A);
1537         MP_WriteMcuAccessRegWord(sc, 0xF9E8, 0x49C1);
1538         MP_WriteMcuAccessRegWord(sc, 0xF9EA, 0xF118);
1539         MP_WriteMcuAccessRegWord(sc, 0xF9EC, 0x74F8);
1540         MP_WriteMcuAccessRegWord(sc, 0xF9EE, 0x49C0);
1541         MP_WriteMcuAccessRegWord(sc, 0xF9F0, 0xF015);
1542         MP_WriteMcuAccessRegWord(sc, 0xF9F2, 0x49C6);
1543         MP_WriteMcuAccessRegWord(sc, 0xF9F4, 0xF113);
1544         MP_WriteMcuAccessRegWord(sc, 0xF9F6, 0xE875);
1545         MP_WriteMcuAccessRegWord(sc, 0xF9F8, 0x48C4);
1546         MP_WriteMcuAccessRegWord(sc, 0xF9FA, 0x8CF8);
1547         MP_WriteMcuAccessRegWord(sc, 0xF9FC, 0x7420);
1548         MP_WriteMcuAccessRegWord(sc, 0xF9FE, 0x48C1);
1549         MP_WriteMcuAccessRegWord(sc, 0xFA00, 0x9C20);
1550         MP_WriteMcuAccessRegWord(sc, 0xFA02, 0xC50A);
1551         MP_WriteMcuAccessRegWord(sc, 0xFA04, 0x74A2);
1552         MP_WriteMcuAccessRegWord(sc, 0xFA06, 0x8CA5);
1553         MP_WriteMcuAccessRegWord(sc, 0xFA08, 0x74A0);
1554         MP_WriteMcuAccessRegWord(sc, 0xFA0A, 0xC505);
1555         MP_WriteMcuAccessRegWord(sc, 0xFA0C, 0x9CA2);
1556         MP_WriteMcuAccessRegWord(sc, 0xFA0E, 0x1C11);
1557         MP_WriteMcuAccessRegWord(sc, 0xFA10, 0x9CA0);
1558         MP_WriteMcuAccessRegWord(sc, 0xFA12, 0xE00A);
1559         MP_WriteMcuAccessRegWord(sc, 0xFA14, 0xE434);
1560         MP_WriteMcuAccessRegWord(sc, 0xFA16, 0xD3C0);
1561         MP_WriteMcuAccessRegWord(sc, 0xFA18, 0xDC00);
1562         MP_WriteMcuAccessRegWord(sc, 0xFA1A, 0x7444);
1563         MP_WriteMcuAccessRegWord(sc, 0xFA1C, 0x49CA);
1564         MP_WriteMcuAccessRegWord(sc, 0xFA1E, 0xF004);
1565         MP_WriteMcuAccessRegWord(sc, 0xFA20, 0x48CA);
1566         MP_WriteMcuAccessRegWord(sc, 0xFA22, 0x9C44);
1567         MP_WriteMcuAccessRegWord(sc, 0xFA24, 0xE855);
1568         MP_WriteMcuAccessRegWord(sc, 0xFA26, 0xE052);
1569         MP_WriteMcuAccessRegWord(sc, 0xFA28, 0x49E8);
1570         MP_WriteMcuAccessRegWord(sc, 0xFA2A, 0xF024);
1571         MP_WriteMcuAccessRegWord(sc, 0xFA2C, 0x1D01);
1572         MP_WriteMcuAccessRegWord(sc, 0xFA2E, 0x8DF5);
1573         MP_WriteMcuAccessRegWord(sc, 0xFA30, 0x7440);
1574         MP_WriteMcuAccessRegWord(sc, 0xFA32, 0x49C0);
1575         MP_WriteMcuAccessRegWord(sc, 0xFA34, 0xF11E);
1576         MP_WriteMcuAccessRegWord(sc, 0xFA36, 0x7444);
1577         MP_WriteMcuAccessRegWord(sc, 0xFA38, 0x49C8);
1578         MP_WriteMcuAccessRegWord(sc, 0xFA3A, 0xF01B);
1579         MP_WriteMcuAccessRegWord(sc, 0xFA3C, 0x49CA);
1580         MP_WriteMcuAccessRegWord(sc, 0xFA3E, 0xF119);
1581         MP_WriteMcuAccessRegWord(sc, 0xFA40, 0xC5EC);
1582         MP_WriteMcuAccessRegWord(sc, 0xFA42, 0x76A4);
1583         MP_WriteMcuAccessRegWord(sc, 0xFA44, 0x49E3);
1584         MP_WriteMcuAccessRegWord(sc, 0xFA46, 0xF015);
1585         MP_WriteMcuAccessRegWord(sc, 0xFA48, 0x49C0);
1586         MP_WriteMcuAccessRegWord(sc, 0xFA4A, 0xF103);
1587         MP_WriteMcuAccessRegWord(sc, 0xFA4C, 0x49C1);
1588         MP_WriteMcuAccessRegWord(sc, 0xFA4E, 0xF011);
1589         MP_WriteMcuAccessRegWord(sc, 0xFA50, 0x4849);
1590         MP_WriteMcuAccessRegWord(sc, 0xFA52, 0x9C44);
1591         MP_WriteMcuAccessRegWord(sc, 0xFA54, 0x1C00);
1592         MP_WriteMcuAccessRegWord(sc, 0xFA56, 0x9CF6);
1593         MP_WriteMcuAccessRegWord(sc, 0xFA58, 0x7444);
1594         MP_WriteMcuAccessRegWord(sc, 0xFA5A, 0x49C1);
1595         MP_WriteMcuAccessRegWord(sc, 0xFA5C, 0xF004);
1596         MP_WriteMcuAccessRegWord(sc, 0xFA5E, 0x6446);
1597         MP_WriteMcuAccessRegWord(sc, 0xFA60, 0x1E07);
1598         MP_WriteMcuAccessRegWord(sc, 0xFA62, 0xE003);
1599         MP_WriteMcuAccessRegWord(sc, 0xFA64, 0x1C01);
1600         MP_WriteMcuAccessRegWord(sc, 0xFA66, 0x1E03);
1601         MP_WriteMcuAccessRegWord(sc, 0xFA68, 0x9C62);
1602         MP_WriteMcuAccessRegWord(sc, 0xFA6A, 0x1C11);
1603         MP_WriteMcuAccessRegWord(sc, 0xFA6C, 0x8C60);
1604         MP_WriteMcuAccessRegWord(sc, 0xFA6E, 0xE830);
1605         MP_WriteMcuAccessRegWord(sc, 0xFA70, 0xE02D);
1606         MP_WriteMcuAccessRegWord(sc, 0xFA72, 0x49E9);
1607         MP_WriteMcuAccessRegWord(sc, 0xFA74, 0xF004);
1608         MP_WriteMcuAccessRegWord(sc, 0xFA76, 0x1D02);
1609         MP_WriteMcuAccessRegWord(sc, 0xFA78, 0x8DF5);
1610         MP_WriteMcuAccessRegWord(sc, 0xFA7A, 0xE79C);
1611         MP_WriteMcuAccessRegWord(sc, 0xFA7C, 0x49E3);
1612         MP_WriteMcuAccessRegWord(sc, 0xFA7E, 0xF006);
1613         MP_WriteMcuAccessRegWord(sc, 0xFA80, 0x1D08);
1614         MP_WriteMcuAccessRegWord(sc, 0xFA82, 0x8DF4);
1615         MP_WriteMcuAccessRegWord(sc, 0xFA84, 0x74F8);
1616         MP_WriteMcuAccessRegWord(sc, 0xFA86, 0x74F8);
1617         MP_WriteMcuAccessRegWord(sc, 0xFA88, 0xE73A);
1618         MP_WriteMcuAccessRegWord(sc, 0xFA8A, 0x49E1);
1619         MP_WriteMcuAccessRegWord(sc, 0xFA8C, 0xF007);
1620         MP_WriteMcuAccessRegWord(sc, 0xFA8E, 0x1D02);
1621         MP_WriteMcuAccessRegWord(sc, 0xFA90, 0x8DF4);
1622         MP_WriteMcuAccessRegWord(sc, 0xFA92, 0x1E01);
1623         MP_WriteMcuAccessRegWord(sc, 0xFA94, 0xE7A7);
1624         MP_WriteMcuAccessRegWord(sc, 0xFA96, 0xDE20);
1625         MP_WriteMcuAccessRegWord(sc, 0xFA98, 0xE410);
1626         MP_WriteMcuAccessRegWord(sc, 0xFA9A, 0x49E0);
1627         MP_WriteMcuAccessRegWord(sc, 0xFA9C, 0xF017);
1628         MP_WriteMcuAccessRegWord(sc, 0xFA9E, 0x1D01);
1629         MP_WriteMcuAccessRegWord(sc, 0xFAA0, 0x8DF4);
1630         MP_WriteMcuAccessRegWord(sc, 0xFAA2, 0xC5FA);
1631         MP_WriteMcuAccessRegWord(sc, 0xFAA4, 0x1C00);
1632         MP_WriteMcuAccessRegWord(sc, 0xFAA6, 0x8CA0);
1633         MP_WriteMcuAccessRegWord(sc, 0xFAA8, 0x1C1B);
1634         MP_WriteMcuAccessRegWord(sc, 0xFAAA, 0x9CA2);
1635         MP_WriteMcuAccessRegWord(sc, 0xFAAC, 0x74A2);
1636         MP_WriteMcuAccessRegWord(sc, 0xFAAE, 0x49CF);
1637         MP_WriteMcuAccessRegWord(sc, 0xFAB0, 0xF0FE);
1638         MP_WriteMcuAccessRegWord(sc, 0xFAB2, 0xC5F3);
1639         MP_WriteMcuAccessRegWord(sc, 0xFAB4, 0x74A0);
1640         MP_WriteMcuAccessRegWord(sc, 0xFAB6, 0x4849);
1641         MP_WriteMcuAccessRegWord(sc, 0xFAB8, 0x9CA0);
1642         MP_WriteMcuAccessRegWord(sc, 0xFABA, 0x74F8);
1643         MP_WriteMcuAccessRegWord(sc, 0xFABC, 0x49C0);
1644         MP_WriteMcuAccessRegWord(sc, 0xFABE, 0xF006);
1645         MP_WriteMcuAccessRegWord(sc, 0xFAC0, 0x48C3);
1646         MP_WriteMcuAccessRegWord(sc, 0xFAC2, 0x8CF8);
1647         MP_WriteMcuAccessRegWord(sc, 0xFAC4, 0xE820);
1648         MP_WriteMcuAccessRegWord(sc, 0xFAC6, 0x74F8);
1649         MP_WriteMcuAccessRegWord(sc, 0xFAC8, 0x74F8);
1650         MP_WriteMcuAccessRegWord(sc, 0xFACA, 0xC432);
1651         MP_WriteMcuAccessRegWord(sc, 0xFACC, 0xBC00);
1652         MP_WriteMcuAccessRegWord(sc, 0xFACE, 0xC5E4);
1653         MP_WriteMcuAccessRegWord(sc, 0xFAD0, 0x74A2);
1654         MP_WriteMcuAccessRegWord(sc, 0xFAD2, 0x49CE);
1655         MP_WriteMcuAccessRegWord(sc, 0xFAD4, 0xF1FE);
1656         MP_WriteMcuAccessRegWord(sc, 0xFAD6, 0x9EA0);
1657         MP_WriteMcuAccessRegWord(sc, 0xFAD8, 0x1C1C);
1658         MP_WriteMcuAccessRegWord(sc, 0xFADA, 0x484F);
1659         MP_WriteMcuAccessRegWord(sc, 0xFADC, 0x9CA2);
1660         MP_WriteMcuAccessRegWord(sc, 0xFADE, 0xFF80);
1661         MP_WriteMcuAccessRegWord(sc, 0xFAE0, 0xB404);
1662         MP_WriteMcuAccessRegWord(sc, 0xFAE2, 0xB405);
1663         MP_WriteMcuAccessRegWord(sc, 0xFAE4, 0xC5D9);
1664         MP_WriteMcuAccessRegWord(sc, 0xFAE6, 0x74A2);
1665         MP_WriteMcuAccessRegWord(sc, 0xFAE8, 0x49CE);
1666         MP_WriteMcuAccessRegWord(sc, 0xFAEA, 0xF1FE);
1667         MP_WriteMcuAccessRegWord(sc, 0xFAEC, 0xC41F);
1668         MP_WriteMcuAccessRegWord(sc, 0xFAEE, 0x9CA0);
1669         MP_WriteMcuAccessRegWord(sc, 0xFAF0, 0xC41C);
1670         MP_WriteMcuAccessRegWord(sc, 0xFAF2, 0x1C13);
1671         MP_WriteMcuAccessRegWord(sc, 0xFAF4, 0x484F);
1672         MP_WriteMcuAccessRegWord(sc, 0xFAF6, 0x9CA2);
1673         MP_WriteMcuAccessRegWord(sc, 0xFAF8, 0x74A2);
1674         MP_WriteMcuAccessRegWord(sc, 0xFAFA, 0x49CF);
1675         MP_WriteMcuAccessRegWord(sc, 0xFAFC, 0xF1FE);
1676         MP_WriteMcuAccessRegWord(sc, 0xFAFE, 0xB005);
1677         MP_WriteMcuAccessRegWord(sc, 0xFB00, 0xB004);
1678         MP_WriteMcuAccessRegWord(sc, 0xFB02, 0xFF80);
1679         MP_WriteMcuAccessRegWord(sc, 0xFB04, 0xB404);
1680         MP_WriteMcuAccessRegWord(sc, 0xFB06, 0xB405);
1681         MP_WriteMcuAccessRegWord(sc, 0xFB08, 0xC5C7);
1682         MP_WriteMcuAccessRegWord(sc, 0xFB0A, 0x74A2);
1683         MP_WriteMcuAccessRegWord(sc, 0xFB0C, 0x49CE);
1684         MP_WriteMcuAccessRegWord(sc, 0xFB0E, 0xF1FE);
1685         MP_WriteMcuAccessRegWord(sc, 0xFB10, 0xC40E);
1686         MP_WriteMcuAccessRegWord(sc, 0xFB12, 0x9CA0);
1687         MP_WriteMcuAccessRegWord(sc, 0xFB14, 0xC40A);
1688         MP_WriteMcuAccessRegWord(sc, 0xFB16, 0x1C13);
1689         MP_WriteMcuAccessRegWord(sc, 0xFB18, 0x484F);
1690         MP_WriteMcuAccessRegWord(sc, 0xFB1A, 0x9CA2);
1691         MP_WriteMcuAccessRegWord(sc, 0xFB1C, 0x74A2);
1692         MP_WriteMcuAccessRegWord(sc, 0xFB1E, 0x49CF);
1693         MP_WriteMcuAccessRegWord(sc, 0xFB20, 0xF1FE);
1694         MP_WriteMcuAccessRegWord(sc, 0xFB22, 0xB005);
1695         MP_WriteMcuAccessRegWord(sc, 0xFB24, 0xB004);
1696         MP_WriteMcuAccessRegWord(sc, 0xFB26, 0xFF80);
1697         MP_WriteMcuAccessRegWord(sc, 0xFB28, 0x0000);
1698         MP_WriteMcuAccessRegWord(sc, 0xFB2A, 0x0481);
1699         MP_WriteMcuAccessRegWord(sc, 0xFB2C, 0x0C81);
1700         MP_WriteMcuAccessRegWord(sc, 0xFB2E, 0x0AE0);
1701
1702         MP_WriteMcuAccessRegWord(sc, 0xFC26, 0x8000);
1703
1704         MP_WriteMcuAccessRegWord(sc, 0xFC28, 0x0000);
1705         MP_WriteMcuAccessRegWord(sc, 0xFC2A, 0x0000);
1706         MP_WriteMcuAccessRegWord(sc, 0xFC2C, 0x0297);
1707         MP_WriteMcuAccessRegWord(sc, 0xFC2E, 0x0000);
1708         MP_WriteMcuAccessRegWord(sc, 0xFC30, 0x00A9);
1709         MP_WriteMcuAccessRegWord(sc, 0xFC32, 0x012D);
1710         MP_WriteMcuAccessRegWord(sc, 0xFC34, 0x0000);
1711         MP_WriteMcuAccessRegWord(sc, 0xFC36, 0x08DF);
1712 }
1713
1714 static void re_set_mac_mcu_8411b_1(struct re_softc *sc)
1715 {
1716         DisableMcuBPs(sc);
1717
1718         MP_WriteMcuAccessRegWord(sc, 0xF800, 0xE008);
1719         MP_WriteMcuAccessRegWord(sc, 0xF802, 0xE00A);
1720         MP_WriteMcuAccessRegWord(sc, 0xF804, 0xE00C);
1721         MP_WriteMcuAccessRegWord(sc, 0xF806, 0xE00E);
1722         MP_WriteMcuAccessRegWord(sc, 0xF808, 0xE027);
1723         MP_WriteMcuAccessRegWord(sc, 0xF80A, 0xE04F);
1724         MP_WriteMcuAccessRegWord(sc, 0xF80C, 0xE05E);
1725         MP_WriteMcuAccessRegWord(sc, 0xF80E, 0xE065);
1726         MP_WriteMcuAccessRegWord(sc, 0xF810, 0xC602);
1727         MP_WriteMcuAccessRegWord(sc, 0xF812, 0xBE00);
1728         MP_WriteMcuAccessRegWord(sc, 0xF814, 0x0000);
1729         MP_WriteMcuAccessRegWord(sc, 0xF816, 0xC502);
1730         MP_WriteMcuAccessRegWord(sc, 0xF818, 0xBD00);
1731         MP_WriteMcuAccessRegWord(sc, 0xF81A, 0x074C);
1732         MP_WriteMcuAccessRegWord(sc, 0xF81C, 0xC302);
1733         MP_WriteMcuAccessRegWord(sc, 0xF81E, 0xBB00);
1734         MP_WriteMcuAccessRegWord(sc, 0xF820, 0x080A);
1735         MP_WriteMcuAccessRegWord(sc, 0xF822, 0x6420);
1736         MP_WriteMcuAccessRegWord(sc, 0xF824, 0x48C2);
1737         MP_WriteMcuAccessRegWord(sc, 0xF826, 0x8C20);
1738         MP_WriteMcuAccessRegWord(sc, 0xF828, 0xC516);
1739         MP_WriteMcuAccessRegWord(sc, 0xF82A, 0x64A4);
1740         MP_WriteMcuAccessRegWord(sc, 0xF82C, 0x49C0);
1741         MP_WriteMcuAccessRegWord(sc, 0xF82E, 0xF009);
1742         MP_WriteMcuAccessRegWord(sc, 0xF830, 0x74A2);
1743         MP_WriteMcuAccessRegWord(sc, 0xF832, 0x8CA5);
1744         MP_WriteMcuAccessRegWord(sc, 0xF834, 0x74A0);
1745         MP_WriteMcuAccessRegWord(sc, 0xF836, 0xC50E);
1746         MP_WriteMcuAccessRegWord(sc, 0xF838, 0x9CA2);
1747         MP_WriteMcuAccessRegWord(sc, 0xF83A, 0x1C11);
1748         MP_WriteMcuAccessRegWord(sc, 0xF83C, 0x9CA0);
1749         MP_WriteMcuAccessRegWord(sc, 0xF83E, 0xE006);
1750         MP_WriteMcuAccessRegWord(sc, 0xF840, 0x74F8);
1751         MP_WriteMcuAccessRegWord(sc, 0xF842, 0x48C4);
1752         MP_WriteMcuAccessRegWord(sc, 0xF844, 0x8CF8);
1753         MP_WriteMcuAccessRegWord(sc, 0xF846, 0xC404);
1754         MP_WriteMcuAccessRegWord(sc, 0xF848, 0xBC00);
1755         MP_WriteMcuAccessRegWord(sc, 0xF84A, 0xC403);
1756         MP_WriteMcuAccessRegWord(sc, 0xF84C, 0xBC00);
1757         MP_WriteMcuAccessRegWord(sc, 0xF84E, 0x0BF2);
1758         MP_WriteMcuAccessRegWord(sc, 0xF850, 0x0C0A);
1759         MP_WriteMcuAccessRegWord(sc, 0xF852, 0xE434);
1760         MP_WriteMcuAccessRegWord(sc, 0xF854, 0xD3C0);
1761         MP_WriteMcuAccessRegWord(sc, 0xF856, 0x49D9);
1762         MP_WriteMcuAccessRegWord(sc, 0xF858, 0xF01F);
1763         MP_WriteMcuAccessRegWord(sc, 0xF85A, 0xC526);
1764         MP_WriteMcuAccessRegWord(sc, 0xF85C, 0x64A5);
1765         MP_WriteMcuAccessRegWord(sc, 0xF85E, 0x1400);
1766         MP_WriteMcuAccessRegWord(sc, 0xF860, 0xF007);
1767         MP_WriteMcuAccessRegWord(sc, 0xF862, 0x0C01);
1768         MP_WriteMcuAccessRegWord(sc, 0xF864, 0x8CA5);
1769         MP_WriteMcuAccessRegWord(sc, 0xF866, 0x1C15);
1770         MP_WriteMcuAccessRegWord(sc, 0xF868, 0xC51B);
1771         MP_WriteMcuAccessRegWord(sc, 0xF86A, 0x9CA0);
1772         MP_WriteMcuAccessRegWord(sc, 0xF86C, 0xE013);
1773         MP_WriteMcuAccessRegWord(sc, 0xF86E, 0xC519);
1774         MP_WriteMcuAccessRegWord(sc, 0xF870, 0x74A0);
1775         MP_WriteMcuAccessRegWord(sc, 0xF872, 0x48C4);
1776         MP_WriteMcuAccessRegWord(sc, 0xF874, 0x8CA0);
1777         MP_WriteMcuAccessRegWord(sc, 0xF876, 0xC516);
1778         MP_WriteMcuAccessRegWord(sc, 0xF878, 0x74A4);
1779         MP_WriteMcuAccessRegWord(sc, 0xF87A, 0x48C8);
1780         MP_WriteMcuAccessRegWord(sc, 0xF87C, 0x48CA);
1781         MP_WriteMcuAccessRegWord(sc, 0xF87E, 0x9CA4);
1782         MP_WriteMcuAccessRegWord(sc, 0xF880, 0xC512);
1783         MP_WriteMcuAccessRegWord(sc, 0xF882, 0x1B00);
1784         MP_WriteMcuAccessRegWord(sc, 0xF884, 0x9BA0);
1785         MP_WriteMcuAccessRegWord(sc, 0xF886, 0x1B1C);
1786         MP_WriteMcuAccessRegWord(sc, 0xF888, 0x483F);
1787         MP_WriteMcuAccessRegWord(sc, 0xF88A, 0x9BA2);
1788         MP_WriteMcuAccessRegWord(sc, 0xF88C, 0x1B04);
1789         MP_WriteMcuAccessRegWord(sc, 0xF88E, 0xC508);
1790         MP_WriteMcuAccessRegWord(sc, 0xF890, 0x9BA0);
1791         MP_WriteMcuAccessRegWord(sc, 0xF892, 0xC505);
1792         MP_WriteMcuAccessRegWord(sc, 0xF894, 0xBD00);
1793         MP_WriteMcuAccessRegWord(sc, 0xF896, 0xC502);
1794         MP_WriteMcuAccessRegWord(sc, 0xF898, 0xBD00);
1795         MP_WriteMcuAccessRegWord(sc, 0xF89A, 0x0300);
1796         MP_WriteMcuAccessRegWord(sc, 0xF89C, 0x051E);
1797         MP_WriteMcuAccessRegWord(sc, 0xF89E, 0xE434);
1798         MP_WriteMcuAccessRegWord(sc, 0xF8A0, 0xE018);
1799         MP_WriteMcuAccessRegWord(sc, 0xF8A2, 0xE092);
1800         MP_WriteMcuAccessRegWord(sc, 0xF8A4, 0xDE20);
1801         MP_WriteMcuAccessRegWord(sc, 0xF8A6, 0xD3C0);
1802         MP_WriteMcuAccessRegWord(sc, 0xF8A8, 0xC50F);
1803         MP_WriteMcuAccessRegWord(sc, 0xF8AA, 0x76A4);
1804         MP_WriteMcuAccessRegWord(sc, 0xF8AC, 0x49E3);
1805         MP_WriteMcuAccessRegWord(sc, 0xF8AE, 0xF007);
1806         MP_WriteMcuAccessRegWord(sc, 0xF8B0, 0x49C0);
1807         MP_WriteMcuAccessRegWord(sc, 0xF8B2, 0xF103);
1808         MP_WriteMcuAccessRegWord(sc, 0xF8B4, 0xC607);
1809         MP_WriteMcuAccessRegWord(sc, 0xF8B6, 0xBE00);
1810         MP_WriteMcuAccessRegWord(sc, 0xF8B8, 0xC606);
1811         MP_WriteMcuAccessRegWord(sc, 0xF8BA, 0xBE00);
1812         MP_WriteMcuAccessRegWord(sc, 0xF8BC, 0xC602);
1813         MP_WriteMcuAccessRegWord(sc, 0xF8BE, 0xBE00);
1814         MP_WriteMcuAccessRegWord(sc, 0xF8C0, 0x0C4C);
1815         MP_WriteMcuAccessRegWord(sc, 0xF8C2, 0x0C28);
1816         MP_WriteMcuAccessRegWord(sc, 0xF8C4, 0x0C2C);
1817         MP_WriteMcuAccessRegWord(sc, 0xF8C6, 0xDC00);
1818         MP_WriteMcuAccessRegWord(sc, 0xF8C8, 0xC707);
1819         MP_WriteMcuAccessRegWord(sc, 0xF8CA, 0x1D00);
1820         MP_WriteMcuAccessRegWord(sc, 0xF8CC, 0x8DE2);
1821         MP_WriteMcuAccessRegWord(sc, 0xF8CE, 0x48C1);
1822         MP_WriteMcuAccessRegWord(sc, 0xF8D0, 0xC502);
1823         MP_WriteMcuAccessRegWord(sc, 0xF8D2, 0xBD00);
1824         MP_WriteMcuAccessRegWord(sc, 0xF8D4, 0x00AA);
1825         MP_WriteMcuAccessRegWord(sc, 0xF8D6, 0xE0C0);
1826         MP_WriteMcuAccessRegWord(sc, 0xF8D8, 0xC502);
1827         MP_WriteMcuAccessRegWord(sc, 0xF8DA, 0xBD00);
1828         MP_WriteMcuAccessRegWord(sc, 0xF8DC, 0x0132);
1829
1830         MP_WriteMcuAccessRegWord(sc, 0xFC26, 0x8000);
1831
1832         MP_WriteMcuAccessRegWord(sc, 0xFC2A, 0x0743);
1833         MP_WriteMcuAccessRegWord(sc, 0xFC2C, 0x0801);
1834         MP_WriteMcuAccessRegWord(sc, 0xFC2E, 0x0BE9);
1835         MP_WriteMcuAccessRegWord(sc, 0xFC30, 0x02FD);
1836         MP_WriteMcuAccessRegWord(sc, 0xFC32, 0x0C25);
1837         MP_WriteMcuAccessRegWord(sc, 0xFC34, 0x00A9);
1838         MP_WriteMcuAccessRegWord(sc, 0xFC36, 0x012D);
1839 }
1840
1841 static void re_set_mac_mcu_8168ep_1(struct re_softc *sc)
1842 {
1843         DisableMcuBPs(sc);
1844
1845         MP_WriteMcuAccessRegWord(sc, 0xF800, 0xE008);
1846         MP_WriteMcuAccessRegWord(sc, 0xF802, 0xE0D3);
1847         MP_WriteMcuAccessRegWord(sc, 0xF804, 0xE0D6);
1848         MP_WriteMcuAccessRegWord(sc, 0xF806, 0xE0D9);
1849         MP_WriteMcuAccessRegWord(sc, 0xF808, 0xE0DB);
1850         MP_WriteMcuAccessRegWord(sc, 0xF80A, 0xE0DD);
1851         MP_WriteMcuAccessRegWord(sc, 0xF80C, 0xE0DF);
1852         MP_WriteMcuAccessRegWord(sc, 0xF80E, 0xE0E1);
1853         MP_WriteMcuAccessRegWord(sc, 0xF810, 0xC251);
1854         MP_WriteMcuAccessRegWord(sc, 0xF812, 0x7340);
1855         MP_WriteMcuAccessRegWord(sc, 0xF814, 0x49B1);
1856         MP_WriteMcuAccessRegWord(sc, 0xF816, 0xF010);
1857         MP_WriteMcuAccessRegWord(sc, 0xF818, 0x1D02);
1858         MP_WriteMcuAccessRegWord(sc, 0xF81A, 0x8D40);
1859         MP_WriteMcuAccessRegWord(sc, 0xF81C, 0xC202);
1860         MP_WriteMcuAccessRegWord(sc, 0xF81E, 0xBA00);
1861         MP_WriteMcuAccessRegWord(sc, 0xF820, 0x2C3A);
1862         MP_WriteMcuAccessRegWord(sc, 0xF822, 0xC0F0);
1863         MP_WriteMcuAccessRegWord(sc, 0xF824, 0xE8DE);
1864         MP_WriteMcuAccessRegWord(sc, 0xF826, 0x2000);
1865         MP_WriteMcuAccessRegWord(sc, 0xF828, 0x8000);
1866         MP_WriteMcuAccessRegWord(sc, 0xF82A, 0xC0B6);
1867         MP_WriteMcuAccessRegWord(sc, 0xF82C, 0x268C);
1868         MP_WriteMcuAccessRegWord(sc, 0xF82E, 0x752C);
1869         MP_WriteMcuAccessRegWord(sc, 0xF830, 0x49D4);
1870         MP_WriteMcuAccessRegWord(sc, 0xF832, 0xF112);
1871         MP_WriteMcuAccessRegWord(sc, 0xF834, 0xE025);
1872         MP_WriteMcuAccessRegWord(sc, 0xF836, 0xC2F6);
1873         MP_WriteMcuAccessRegWord(sc, 0xF838, 0x7146);
1874         MP_WriteMcuAccessRegWord(sc, 0xF83A, 0xC2F5);
1875         MP_WriteMcuAccessRegWord(sc, 0xF83C, 0x7340);
1876         MP_WriteMcuAccessRegWord(sc, 0xF83E, 0x49BE);
1877         MP_WriteMcuAccessRegWord(sc, 0xF840, 0xF103);
1878         MP_WriteMcuAccessRegWord(sc, 0xF842, 0xC7F2);
1879         MP_WriteMcuAccessRegWord(sc, 0xF844, 0xE002);
1880         MP_WriteMcuAccessRegWord(sc, 0xF846, 0xC7F1);
1881         MP_WriteMcuAccessRegWord(sc, 0xF848, 0x304F);
1882         MP_WriteMcuAccessRegWord(sc, 0xF84A, 0x6226);
1883         MP_WriteMcuAccessRegWord(sc, 0xF84C, 0x49A1);
1884         MP_WriteMcuAccessRegWord(sc, 0xF84E, 0xF1F0);
1885         MP_WriteMcuAccessRegWord(sc, 0xF850, 0x7222);
1886         MP_WriteMcuAccessRegWord(sc, 0xF852, 0x49A0);
1887         MP_WriteMcuAccessRegWord(sc, 0xF854, 0xF1ED);
1888         MP_WriteMcuAccessRegWord(sc, 0xF856, 0x2525);
1889         MP_WriteMcuAccessRegWord(sc, 0xF858, 0x1F28);
1890         MP_WriteMcuAccessRegWord(sc, 0xF85A, 0x3097);
1891         MP_WriteMcuAccessRegWord(sc, 0xF85C, 0x3091);
1892         MP_WriteMcuAccessRegWord(sc, 0xF85E, 0x9A36);
1893         MP_WriteMcuAccessRegWord(sc, 0xF860, 0x752C);
1894         MP_WriteMcuAccessRegWord(sc, 0xF862, 0x21DC);
1895         MP_WriteMcuAccessRegWord(sc, 0xF864, 0x25BC);
1896         MP_WriteMcuAccessRegWord(sc, 0xF866, 0xC6E2);
1897         MP_WriteMcuAccessRegWord(sc, 0xF868, 0x77C0);
1898         MP_WriteMcuAccessRegWord(sc, 0xF86A, 0x1304);
1899         MP_WriteMcuAccessRegWord(sc, 0xF86C, 0xF014);
1900         MP_WriteMcuAccessRegWord(sc, 0xF86E, 0x1303);
1901         MP_WriteMcuAccessRegWord(sc, 0xF870, 0xF014);
1902         MP_WriteMcuAccessRegWord(sc, 0xF872, 0x1302);
1903         MP_WriteMcuAccessRegWord(sc, 0xF874, 0xF014);
1904         MP_WriteMcuAccessRegWord(sc, 0xF876, 0x1301);
1905         MP_WriteMcuAccessRegWord(sc, 0xF878, 0xF014);
1906         MP_WriteMcuAccessRegWord(sc, 0xF87A, 0x49D4);
1907         MP_WriteMcuAccessRegWord(sc, 0xF87C, 0xF103);
1908         MP_WriteMcuAccessRegWord(sc, 0xF87E, 0xC3D7);
1909         MP_WriteMcuAccessRegWord(sc, 0xF880, 0xBB00);
1910         MP_WriteMcuAccessRegWord(sc, 0xF882, 0xC618);
1911         MP_WriteMcuAccessRegWord(sc, 0xF884, 0x67C6);
1912         MP_WriteMcuAccessRegWord(sc, 0xF886, 0x752E);
1913         MP_WriteMcuAccessRegWord(sc, 0xF888, 0x22D7);
1914         MP_WriteMcuAccessRegWord(sc, 0xF88A, 0x26DD);
1915         MP_WriteMcuAccessRegWord(sc, 0xF88C, 0x1505);
1916         MP_WriteMcuAccessRegWord(sc, 0xF88E, 0xF013);
1917         MP_WriteMcuAccessRegWord(sc, 0xF890, 0xC60A);
1918         MP_WriteMcuAccessRegWord(sc, 0xF892, 0xBE00);
1919         MP_WriteMcuAccessRegWord(sc, 0xF894, 0xC309);
1920         MP_WriteMcuAccessRegWord(sc, 0xF896, 0xBB00);
1921         MP_WriteMcuAccessRegWord(sc, 0xF898, 0xC308);
1922         MP_WriteMcuAccessRegWord(sc, 0xF89A, 0xBB00);
1923         MP_WriteMcuAccessRegWord(sc, 0xF89C, 0xC307);
1924         MP_WriteMcuAccessRegWord(sc, 0xF89E, 0xBB00);
1925         MP_WriteMcuAccessRegWord(sc, 0xF8A0, 0xC306);
1926         MP_WriteMcuAccessRegWord(sc, 0xF8A2, 0xBB00);
1927         MP_WriteMcuAccessRegWord(sc, 0xF8A4, 0x25C8);
1928         MP_WriteMcuAccessRegWord(sc, 0xF8A6, 0x25A6);
1929         MP_WriteMcuAccessRegWord(sc, 0xF8A8, 0x25AC);
1930         MP_WriteMcuAccessRegWord(sc, 0xF8AA, 0x25B2);
1931         MP_WriteMcuAccessRegWord(sc, 0xF8AC, 0x25B8);
1932         MP_WriteMcuAccessRegWord(sc, 0xF8AE, 0xCD08);
1933         MP_WriteMcuAccessRegWord(sc, 0xF8B0, 0x0000);
1934         MP_WriteMcuAccessRegWord(sc, 0xF8B2, 0xC0BC);
1935         MP_WriteMcuAccessRegWord(sc, 0xF8B4, 0xC2FF);
1936         MP_WriteMcuAccessRegWord(sc, 0xF8B6, 0x7340);
1937         MP_WriteMcuAccessRegWord(sc, 0xF8B8, 0x49B0);
1938         MP_WriteMcuAccessRegWord(sc, 0xF8BA, 0xF04E);
1939         MP_WriteMcuAccessRegWord(sc, 0xF8BC, 0x1F46);
1940         MP_WriteMcuAccessRegWord(sc, 0xF8BE, 0x308F);
1941         MP_WriteMcuAccessRegWord(sc, 0xF8C0, 0xC3F7);
1942         MP_WriteMcuAccessRegWord(sc, 0xF8C2, 0x1C04);
1943         MP_WriteMcuAccessRegWord(sc, 0xF8C4, 0xE84D);
1944         MP_WriteMcuAccessRegWord(sc, 0xF8C6, 0x1401);
1945         MP_WriteMcuAccessRegWord(sc, 0xF8C8, 0xF147);
1946         MP_WriteMcuAccessRegWord(sc, 0xF8CA, 0x7226);
1947         MP_WriteMcuAccessRegWord(sc, 0xF8CC, 0x49A7);
1948         MP_WriteMcuAccessRegWord(sc, 0xF8CE, 0xF044);
1949         MP_WriteMcuAccessRegWord(sc, 0xF8D0, 0x7222);
1950         MP_WriteMcuAccessRegWord(sc, 0xF8D2, 0x2525);
1951         MP_WriteMcuAccessRegWord(sc, 0xF8D4, 0x1F30);
1952         MP_WriteMcuAccessRegWord(sc, 0xF8D6, 0x3097);
1953         MP_WriteMcuAccessRegWord(sc, 0xF8D8, 0x3091);
1954         MP_WriteMcuAccessRegWord(sc, 0xF8DA, 0x7340);
1955         MP_WriteMcuAccessRegWord(sc, 0xF8DC, 0xC4EA);
1956         MP_WriteMcuAccessRegWord(sc, 0xF8DE, 0x401C);
1957         MP_WriteMcuAccessRegWord(sc, 0xF8E0, 0xF006);
1958         MP_WriteMcuAccessRegWord(sc, 0xF8E2, 0xC6E8);
1959         MP_WriteMcuAccessRegWord(sc, 0xF8E4, 0x75C0);
1960         MP_WriteMcuAccessRegWord(sc, 0xF8E6, 0x49D7);
1961         MP_WriteMcuAccessRegWord(sc, 0xF8E8, 0xF105);
1962         MP_WriteMcuAccessRegWord(sc, 0xF8EA, 0xE036);
1963         MP_WriteMcuAccessRegWord(sc, 0xF8EC, 0x1D08);
1964         MP_WriteMcuAccessRegWord(sc, 0xF8EE, 0x8DC1);
1965         MP_WriteMcuAccessRegWord(sc, 0xF8F0, 0x0208);
1966         MP_WriteMcuAccessRegWord(sc, 0xF8F2, 0x6640);
1967         MP_WriteMcuAccessRegWord(sc, 0xF8F4, 0x2764);
1968         MP_WriteMcuAccessRegWord(sc, 0xF8F6, 0x1606);
1969         MP_WriteMcuAccessRegWord(sc, 0xF8F8, 0xF12F);
1970         MP_WriteMcuAccessRegWord(sc, 0xF8FA, 0x6346);
1971         MP_WriteMcuAccessRegWord(sc, 0xF8FC, 0x133B);
1972         MP_WriteMcuAccessRegWord(sc, 0xF8FE, 0xF12C);
1973         MP_WriteMcuAccessRegWord(sc, 0xF900, 0x9B34);
1974         MP_WriteMcuAccessRegWord(sc, 0xF902, 0x1B18);
1975         MP_WriteMcuAccessRegWord(sc, 0xF904, 0x3093);
1976         MP_WriteMcuAccessRegWord(sc, 0xF906, 0xC32A);
1977         MP_WriteMcuAccessRegWord(sc, 0xF908, 0x1C10);
1978         MP_WriteMcuAccessRegWord(sc, 0xF90A, 0xE82A);
1979         MP_WriteMcuAccessRegWord(sc, 0xF90C, 0x1401);
1980         MP_WriteMcuAccessRegWord(sc, 0xF90E, 0xF124);
1981         MP_WriteMcuAccessRegWord(sc, 0xF910, 0x1A36);
1982         MP_WriteMcuAccessRegWord(sc, 0xF912, 0x308A);
1983         MP_WriteMcuAccessRegWord(sc, 0xF914, 0x7322);
1984         MP_WriteMcuAccessRegWord(sc, 0xF916, 0x25B5);
1985         MP_WriteMcuAccessRegWord(sc, 0xF918, 0x0B0E);
1986         MP_WriteMcuAccessRegWord(sc, 0xF91A, 0x1C00);
1987         MP_WriteMcuAccessRegWord(sc, 0xF91C, 0xE82C);
1988         MP_WriteMcuAccessRegWord(sc, 0xF91E, 0xC71F);
1989         MP_WriteMcuAccessRegWord(sc, 0xF920, 0x4027);
1990         MP_WriteMcuAccessRegWord(sc, 0xF922, 0xF11A);
1991         MP_WriteMcuAccessRegWord(sc, 0xF924, 0xE838);
1992         MP_WriteMcuAccessRegWord(sc, 0xF926, 0x1F42);
1993         MP_WriteMcuAccessRegWord(sc, 0xF928, 0x308F);
1994         MP_WriteMcuAccessRegWord(sc, 0xF92A, 0x1B08);
1995         MP_WriteMcuAccessRegWord(sc, 0xF92C, 0xE824);
1996         MP_WriteMcuAccessRegWord(sc, 0xF92E, 0x7236);
1997         MP_WriteMcuAccessRegWord(sc, 0xF930, 0x7746);
1998         MP_WriteMcuAccessRegWord(sc, 0xF932, 0x1700);
1999         MP_WriteMcuAccessRegWord(sc, 0xF934, 0xF00D);
2000         MP_WriteMcuAccessRegWord(sc, 0xF936, 0xC313);
2001         MP_WriteMcuAccessRegWord(sc, 0xF938, 0x401F);
2002         MP_WriteMcuAccessRegWord(sc, 0xF93A, 0xF103);
2003         MP_WriteMcuAccessRegWord(sc, 0xF93C, 0x1F00);
2004         MP_WriteMcuAccessRegWord(sc, 0xF93E, 0x9F46);
2005         MP_WriteMcuAccessRegWord(sc, 0xF940, 0x7744);
2006         MP_WriteMcuAccessRegWord(sc, 0xF942, 0x449F);
2007         MP_WriteMcuAccessRegWord(sc, 0xF944, 0x445F);
2008         MP_WriteMcuAccessRegWord(sc, 0xF946, 0xE817);
2009         MP_WriteMcuAccessRegWord(sc, 0xF948, 0xC70A);
2010         MP_WriteMcuAccessRegWord(sc, 0xF94A, 0x4027);
2011         MP_WriteMcuAccessRegWord(sc, 0xF94C, 0xF105);
2012         MP_WriteMcuAccessRegWord(sc, 0xF94E, 0xC302);
2013         MP_WriteMcuAccessRegWord(sc, 0xF950, 0xBB00);
2014         MP_WriteMcuAccessRegWord(sc, 0xF952, 0x2E08);
2015         MP_WriteMcuAccessRegWord(sc, 0xF954, 0x2DC2);
2016         MP_WriteMcuAccessRegWord(sc, 0xF956, 0xC7FF);
2017         MP_WriteMcuAccessRegWord(sc, 0xF958, 0xBF00);
2018         MP_WriteMcuAccessRegWord(sc, 0xF95A, 0xCDB8);
2019         MP_WriteMcuAccessRegWord(sc, 0xF95C, 0xFFFF);
2020         MP_WriteMcuAccessRegWord(sc, 0xF95E, 0x0C02);
2021         MP_WriteMcuAccessRegWord(sc, 0xF960, 0xA554);
2022         MP_WriteMcuAccessRegWord(sc, 0xF962, 0xA5DC);
2023         MP_WriteMcuAccessRegWord(sc, 0xF964, 0x402F);
2024         MP_WriteMcuAccessRegWord(sc, 0xF966, 0xF105);
2025         MP_WriteMcuAccessRegWord(sc, 0xF968, 0x1400);
2026         MP_WriteMcuAccessRegWord(sc, 0xF96A, 0xF1FA);
2027         MP_WriteMcuAccessRegWord(sc, 0xF96C, 0x1C01);
2028         MP_WriteMcuAccessRegWord(sc, 0xF96E, 0xE002);
2029         MP_WriteMcuAccessRegWord(sc, 0xF970, 0x1C00);
2030         MP_WriteMcuAccessRegWord(sc, 0xF972, 0xFF80);
2031         MP_WriteMcuAccessRegWord(sc, 0xF974, 0x49B0);
2032         MP_WriteMcuAccessRegWord(sc, 0xF976, 0xF004);
2033         MP_WriteMcuAccessRegWord(sc, 0xF978, 0x0B01);
2034         MP_WriteMcuAccessRegWord(sc, 0xF97A, 0xA1D3);
2035         MP_WriteMcuAccessRegWord(sc, 0xF97C, 0xE003);
2036         MP_WriteMcuAccessRegWord(sc, 0xF97E, 0x0B02);
2037         MP_WriteMcuAccessRegWord(sc, 0xF980, 0xA5D3);
2038         MP_WriteMcuAccessRegWord(sc, 0xF982, 0x3127);
2039         MP_WriteMcuAccessRegWord(sc, 0xF984, 0x3720);
2040         MP_WriteMcuAccessRegWord(sc, 0xF986, 0x0B02);
2041         MP_WriteMcuAccessRegWord(sc, 0xF988, 0xA5D3);
2042         MP_WriteMcuAccessRegWord(sc, 0xF98A, 0x3127);
2043         MP_WriteMcuAccessRegWord(sc, 0xF98C, 0x3720);
2044         MP_WriteMcuAccessRegWord(sc, 0xF98E, 0x1300);
2045         MP_WriteMcuAccessRegWord(sc, 0xF990, 0xF1FB);
2046         MP_WriteMcuAccessRegWord(sc, 0xF992, 0xFF80);
2047         MP_WriteMcuAccessRegWord(sc, 0xF994, 0x7322);
2048         MP_WriteMcuAccessRegWord(sc, 0xF996, 0x25B5);
2049         MP_WriteMcuAccessRegWord(sc, 0xF998, 0x1E28);
2050         MP_WriteMcuAccessRegWord(sc, 0xF99A, 0x30DE);
2051         MP_WriteMcuAccessRegWord(sc, 0xF99C, 0x30D9);
2052         MP_WriteMcuAccessRegWord(sc, 0xF99E, 0x7264);
2053         MP_WriteMcuAccessRegWord(sc, 0xF9A0, 0x1E11);
2054         MP_WriteMcuAccessRegWord(sc, 0xF9A2, 0x2368);
2055         MP_WriteMcuAccessRegWord(sc, 0xF9A4, 0x3116);
2056         MP_WriteMcuAccessRegWord(sc, 0xF9A6, 0xFF80);
2057         MP_WriteMcuAccessRegWord(sc, 0xF9A8, 0x1B7E);
2058         MP_WriteMcuAccessRegWord(sc, 0xF9AA, 0xC602);
2059         MP_WriteMcuAccessRegWord(sc, 0xF9AC, 0xBE00);
2060         MP_WriteMcuAccessRegWord(sc, 0xF9AE, 0x06A6);
2061         MP_WriteMcuAccessRegWord(sc, 0xF9B0, 0x1B7E);
2062         MP_WriteMcuAccessRegWord(sc, 0xF9B2, 0xC602);
2063         MP_WriteMcuAccessRegWord(sc, 0xF9B4, 0xBE00);
2064         MP_WriteMcuAccessRegWord(sc, 0xF9B6, 0x0764);
2065         MP_WriteMcuAccessRegWord(sc, 0xF9B8, 0xC602);
2066         MP_WriteMcuAccessRegWord(sc, 0xF9BA, 0xBE00);
2067         MP_WriteMcuAccessRegWord(sc, 0xF9BC, 0x0000);
2068         MP_WriteMcuAccessRegWord(sc, 0xF9BE, 0xC602);
2069         MP_WriteMcuAccessRegWord(sc, 0xF9C0, 0xBE00);
2070         MP_WriteMcuAccessRegWord(sc, 0xF9C2, 0x0000);
2071         MP_WriteMcuAccessRegWord(sc, 0xF9C4, 0xC602);
2072         MP_WriteMcuAccessRegWord(sc, 0xF9C6, 0xBE00);
2073         MP_WriteMcuAccessRegWord(sc, 0xF9C8, 0x0000);
2074         MP_WriteMcuAccessRegWord(sc, 0xF9CA, 0xC602);
2075         MP_WriteMcuAccessRegWord(sc, 0xF9CC, 0xBE00);
2076         MP_WriteMcuAccessRegWord(sc, 0xF9CE, 0x0000);
2077         MP_WriteMcuAccessRegWord(sc, 0xF9D0, 0xC602);
2078         MP_WriteMcuAccessRegWord(sc, 0xF9D2, 0xBE00);
2079         MP_WriteMcuAccessRegWord(sc, 0xF9D4, 0x0000);
2080
2081         MP_WriteMcuAccessRegWord(sc, 0xFC26, 0x8000);
2082
2083         MP_WriteMcuAccessRegWord(sc, 0xFC28, 0x2549);
2084         MP_WriteMcuAccessRegWord(sc, 0xFC2A, 0x06A5);
2085         MP_WriteMcuAccessRegWord(sc, 0xFC2C, 0x0763);
2086 }
2087
2088 static void re_set_mac_mcu_8168ep_2(struct re_softc *sc)
2089 {
2090         DisableMcuBPs(sc);
2091
2092         MP_WriteMcuAccessRegWord(sc, 0xF800, 0xE008);
2093         MP_WriteMcuAccessRegWord(sc, 0xF802, 0xE017);
2094         MP_WriteMcuAccessRegWord(sc, 0xF804, 0xE019);
2095         MP_WriteMcuAccessRegWord(sc, 0xF806, 0xE01B);
2096         MP_WriteMcuAccessRegWord(sc, 0xF808, 0xE01D);
2097         MP_WriteMcuAccessRegWord(sc, 0xF80A, 0xE01F);
2098         MP_WriteMcuAccessRegWord(sc, 0xF80C, 0xE021);
2099         MP_WriteMcuAccessRegWord(sc, 0xF80E, 0xE023);
2100         MP_WriteMcuAccessRegWord(sc, 0xF810, 0xC50F);
2101         MP_WriteMcuAccessRegWord(sc, 0xF812, 0x76A4);
2102         MP_WriteMcuAccessRegWord(sc, 0xF814, 0x49E3);
2103         MP_WriteMcuAccessRegWord(sc, 0xF816, 0xF007);
2104         MP_WriteMcuAccessRegWord(sc, 0xF818, 0x49C0);
2105         MP_WriteMcuAccessRegWord(sc, 0xF81A, 0xF103);
2106         MP_WriteMcuAccessRegWord(sc, 0xF81C, 0xC607);
2107         MP_WriteMcuAccessRegWord(sc, 0xF81E, 0xBE00);
2108         MP_WriteMcuAccessRegWord(sc, 0xF820, 0xC606);
2109         MP_WriteMcuAccessRegWord(sc, 0xF822, 0xBE00);
2110         MP_WriteMcuAccessRegWord(sc, 0xF824, 0xC602);
2111         MP_WriteMcuAccessRegWord(sc, 0xF826, 0xBE00);
2112         MP_WriteMcuAccessRegWord(sc, 0xF828, 0x0BDA);
2113         MP_WriteMcuAccessRegWord(sc, 0xF82A, 0x0BB0);
2114         MP_WriteMcuAccessRegWord(sc, 0xF82C, 0x0BBA);
2115         MP_WriteMcuAccessRegWord(sc, 0xF82E, 0xDC00);
2116         MP_WriteMcuAccessRegWord(sc, 0xF830, 0xC602);
2117         MP_WriteMcuAccessRegWord(sc, 0xF832, 0xBE00);
2118         MP_WriteMcuAccessRegWord(sc, 0xF834, 0x0000);
2119         MP_WriteMcuAccessRegWord(sc, 0xF836, 0xC602);
2120         MP_WriteMcuAccessRegWord(sc, 0xF838, 0xBE00);
2121         MP_WriteMcuAccessRegWord(sc, 0xF83A, 0x0000);
2122         MP_WriteMcuAccessRegWord(sc, 0xF83C, 0xC602);
2123         MP_WriteMcuAccessRegWord(sc, 0xF83E, 0xBE00);
2124         MP_WriteMcuAccessRegWord(sc, 0xF840, 0x0000);
2125         MP_WriteMcuAccessRegWord(sc, 0xF842, 0xC602);
2126         MP_WriteMcuAccessRegWord(sc, 0xF844, 0xBE00);
2127         MP_WriteMcuAccessRegWord(sc, 0xF846, 0x0000);
2128         MP_WriteMcuAccessRegWord(sc, 0xF848, 0xC602);
2129         MP_WriteMcuAccessRegWord(sc, 0xF84A, 0xBE00);
2130         MP_WriteMcuAccessRegWord(sc, 0xF84C, 0x0000);
2131         MP_WriteMcuAccessRegWord(sc, 0xF84E, 0xC602);
2132         MP_WriteMcuAccessRegWord(sc, 0xF850, 0xBE00);
2133         MP_WriteMcuAccessRegWord(sc, 0xF852, 0x0000);
2134         MP_WriteMcuAccessRegWord(sc, 0xF854, 0xC602);
2135         MP_WriteMcuAccessRegWord(sc, 0xF856, 0xBE00);
2136         MP_WriteMcuAccessRegWord(sc, 0xF858, 0x0000);
2137
2138         MP_WriteMcuAccessRegWord(sc, 0xFC26, 0x8000);
2139
2140         MP_WriteMcuAccessRegWord(sc, 0xFC28, 0x0BB3);
2141 }
2142
2143 static void re_set_mac_mcu_8168h_1(struct re_softc *sc)
2144 {
2145         DisableMcuBPs(sc);
2146
2147         MP_WriteMcuAccessRegWord(sc, 0xF800, 0xE008);
2148         MP_WriteMcuAccessRegWord(sc, 0xF802, 0xE00F);
2149         MP_WriteMcuAccessRegWord(sc, 0xF804, 0xE011);
2150         MP_WriteMcuAccessRegWord(sc, 0xF806, 0xE047);
2151         MP_WriteMcuAccessRegWord(sc, 0xF808, 0xE049);
2152         MP_WriteMcuAccessRegWord(sc, 0xF80A, 0xE073);
2153         MP_WriteMcuAccessRegWord(sc, 0xF80C, 0xE075);
2154         MP_WriteMcuAccessRegWord(sc, 0xF80E, 0xE077);
2155         MP_WriteMcuAccessRegWord(sc, 0xF810, 0xC707);
2156         MP_WriteMcuAccessRegWord(sc, 0xF812, 0x1D00);
2157         MP_WriteMcuAccessRegWord(sc, 0xF814, 0x8DE2);
2158         MP_WriteMcuAccessRegWord(sc, 0xF816, 0x48C1);
2159         MP_WriteMcuAccessRegWord(sc, 0xF818, 0xC502);
2160         MP_WriteMcuAccessRegWord(sc, 0xF81A, 0xBD00);
2161         MP_WriteMcuAccessRegWord(sc, 0xF81C, 0x00E4);
2162         MP_WriteMcuAccessRegWord(sc, 0xF81E, 0xE0C0);
2163         MP_WriteMcuAccessRegWord(sc, 0xF820, 0xC502);
2164         MP_WriteMcuAccessRegWord(sc, 0xF822, 0xBD00);
2165         MP_WriteMcuAccessRegWord(sc, 0xF824, 0x0216);
2166         MP_WriteMcuAccessRegWord(sc, 0xF826, 0xC634);
2167         MP_WriteMcuAccessRegWord(sc, 0xF828, 0x75C0);
2168         MP_WriteMcuAccessRegWord(sc, 0xF82A, 0x49D3);
2169         MP_WriteMcuAccessRegWord(sc, 0xF82C, 0xF027);
2170         MP_WriteMcuAccessRegWord(sc, 0xF82E, 0xC631);
2171         MP_WriteMcuAccessRegWord(sc, 0xF830, 0x75C0);
2172         MP_WriteMcuAccessRegWord(sc, 0xF832, 0x49D3);
2173         MP_WriteMcuAccessRegWord(sc, 0xF834, 0xF123);
2174         MP_WriteMcuAccessRegWord(sc, 0xF836, 0xC627);
2175         MP_WriteMcuAccessRegWord(sc, 0xF838, 0x75C0);
2176         MP_WriteMcuAccessRegWord(sc, 0xF83A, 0xB405);
2177         MP_WriteMcuAccessRegWord(sc, 0xF83C, 0xC525);
2178         MP_WriteMcuAccessRegWord(sc, 0xF83E, 0x9DC0);
2179         MP_WriteMcuAccessRegWord(sc, 0xF840, 0xC621);
2180         MP_WriteMcuAccessRegWord(sc, 0xF842, 0x75C8);
2181         MP_WriteMcuAccessRegWord(sc, 0xF844, 0x49D5);
2182         MP_WriteMcuAccessRegWord(sc, 0xF846, 0xF00A);
2183         MP_WriteMcuAccessRegWord(sc, 0xF848, 0x49D6);
2184         MP_WriteMcuAccessRegWord(sc, 0xF84A, 0xF008);
2185         MP_WriteMcuAccessRegWord(sc, 0xF84C, 0x49D7);
2186         MP_WriteMcuAccessRegWord(sc, 0xF84E, 0xF006);
2187         MP_WriteMcuAccessRegWord(sc, 0xF850, 0x49D8);
2188         MP_WriteMcuAccessRegWord(sc, 0xF852, 0xF004);
2189         MP_WriteMcuAccessRegWord(sc, 0xF854, 0x75D2);
2190         MP_WriteMcuAccessRegWord(sc, 0xF856, 0x49D9);
2191         MP_WriteMcuAccessRegWord(sc, 0xF858, 0xF111);
2192         MP_WriteMcuAccessRegWord(sc, 0xF85A, 0xC517);
2193         MP_WriteMcuAccessRegWord(sc, 0xF85C, 0x9DC8);
2194         MP_WriteMcuAccessRegWord(sc, 0xF85E, 0xC516);
2195         MP_WriteMcuAccessRegWord(sc, 0xF860, 0x9DD2);
2196         MP_WriteMcuAccessRegWord(sc, 0xF862, 0xC618);
2197         MP_WriteMcuAccessRegWord(sc, 0xF864, 0x75C0);
2198         MP_WriteMcuAccessRegWord(sc, 0xF866, 0x49D4);
2199         MP_WriteMcuAccessRegWord(sc, 0xF868, 0xF003);
2200         MP_WriteMcuAccessRegWord(sc, 0xF86A, 0x49D0);
2201         MP_WriteMcuAccessRegWord(sc, 0xF86C, 0xF104);
2202         MP_WriteMcuAccessRegWord(sc, 0xF86E, 0xC60A);
2203         MP_WriteMcuAccessRegWord(sc, 0xF870, 0xC50E);
2204         MP_WriteMcuAccessRegWord(sc, 0xF872, 0x9DC0);
2205         MP_WriteMcuAccessRegWord(sc, 0xF874, 0xB005);
2206         MP_WriteMcuAccessRegWord(sc, 0xF876, 0xC607);
2207         MP_WriteMcuAccessRegWord(sc, 0xF878, 0x9DC0);
2208         MP_WriteMcuAccessRegWord(sc, 0xF87A, 0xB007);
2209         MP_WriteMcuAccessRegWord(sc, 0xF87C, 0xC602);
2210         MP_WriteMcuAccessRegWord(sc, 0xF87E, 0xBE00);
2211         MP_WriteMcuAccessRegWord(sc, 0xF880, 0x1A06);
2212         MP_WriteMcuAccessRegWord(sc, 0xF882, 0xB400);
2213         MP_WriteMcuAccessRegWord(sc, 0xF884, 0xE86C);
2214         MP_WriteMcuAccessRegWord(sc, 0xF886, 0xA000);
2215         MP_WriteMcuAccessRegWord(sc, 0xF888, 0x01E1);
2216         MP_WriteMcuAccessRegWord(sc, 0xF88A, 0x0200);
2217         MP_WriteMcuAccessRegWord(sc, 0xF88C, 0x9200);
2218         MP_WriteMcuAccessRegWord(sc, 0xF88E, 0xE84C);
2219         MP_WriteMcuAccessRegWord(sc, 0xF890, 0xE004);
2220         MP_WriteMcuAccessRegWord(sc, 0xF892, 0xE908);
2221         MP_WriteMcuAccessRegWord(sc, 0xF894, 0xC502);
2222         MP_WriteMcuAccessRegWord(sc, 0xF896, 0xBD00);
2223         MP_WriteMcuAccessRegWord(sc, 0xF898, 0x0B58);
2224         MP_WriteMcuAccessRegWord(sc, 0xF89A, 0xB407);
2225         MP_WriteMcuAccessRegWord(sc, 0xF89C, 0xB404);
2226         MP_WriteMcuAccessRegWord(sc, 0xF89E, 0x2195);
2227         MP_WriteMcuAccessRegWord(sc, 0xF8A0, 0x25BD);
2228         MP_WriteMcuAccessRegWord(sc, 0xF8A2, 0x9BE0);
2229         MP_WriteMcuAccessRegWord(sc, 0xF8A4, 0x1C1C);
2230         MP_WriteMcuAccessRegWord(sc, 0xF8A6, 0x484F);
2231         MP_WriteMcuAccessRegWord(sc, 0xF8A8, 0x9CE2);
2232         MP_WriteMcuAccessRegWord(sc, 0xF8AA, 0x72E2);
2233         MP_WriteMcuAccessRegWord(sc, 0xF8AC, 0x49AE);
2234         MP_WriteMcuAccessRegWord(sc, 0xF8AE, 0xF1FE);
2235         MP_WriteMcuAccessRegWord(sc, 0xF8B0, 0x0B00);
2236         MP_WriteMcuAccessRegWord(sc, 0xF8B2, 0xF116);
2237         MP_WriteMcuAccessRegWord(sc, 0xF8B4, 0xC71C);
2238         MP_WriteMcuAccessRegWord(sc, 0xF8B6, 0xC419);
2239         MP_WriteMcuAccessRegWord(sc, 0xF8B8, 0x9CE0);
2240         MP_WriteMcuAccessRegWord(sc, 0xF8BA, 0x1C13);
2241         MP_WriteMcuAccessRegWord(sc, 0xF8BC, 0x484F);
2242         MP_WriteMcuAccessRegWord(sc, 0xF8BE, 0x9CE2);
2243         MP_WriteMcuAccessRegWord(sc, 0xF8C0, 0x74E2);
2244         MP_WriteMcuAccessRegWord(sc, 0xF8C2, 0x49CE);
2245         MP_WriteMcuAccessRegWord(sc, 0xF8C4, 0xF1FE);
2246         MP_WriteMcuAccessRegWord(sc, 0xF8C6, 0xC412);
2247         MP_WriteMcuAccessRegWord(sc, 0xF8C8, 0x9CE0);
2248         MP_WriteMcuAccessRegWord(sc, 0xF8CA, 0x1C13);
2249         MP_WriteMcuAccessRegWord(sc, 0xF8CC, 0x484F);
2250         MP_WriteMcuAccessRegWord(sc, 0xF8CE, 0x9CE2);
2251         MP_WriteMcuAccessRegWord(sc, 0xF8D0, 0x74E2);
2252         MP_WriteMcuAccessRegWord(sc, 0xF8D2, 0x49CE);
2253         MP_WriteMcuAccessRegWord(sc, 0xF8D4, 0xF1FE);
2254         MP_WriteMcuAccessRegWord(sc, 0xF8D6, 0xC70C);
2255         MP_WriteMcuAccessRegWord(sc, 0xF8D8, 0x74F8);
2256         MP_WriteMcuAccessRegWord(sc, 0xF8DA, 0x48C3);
2257         MP_WriteMcuAccessRegWord(sc, 0xF8DC, 0x8CF8);
2258         MP_WriteMcuAccessRegWord(sc, 0xF8DE, 0xB004);
2259         MP_WriteMcuAccessRegWord(sc, 0xF8E0, 0xB007);
2260         MP_WriteMcuAccessRegWord(sc, 0xF8E2, 0xC502);
2261         MP_WriteMcuAccessRegWord(sc, 0xF8E4, 0xBD00);
2262         MP_WriteMcuAccessRegWord(sc, 0xF8E6, 0x0F24);
2263         MP_WriteMcuAccessRegWord(sc, 0xF8E8, 0x0481);
2264         MP_WriteMcuAccessRegWord(sc, 0xF8EA, 0x0C81);
2265         MP_WriteMcuAccessRegWord(sc, 0xF8EC, 0xDE24);
2266         MP_WriteMcuAccessRegWord(sc, 0xF8EE, 0xE000);
2267         MP_WriteMcuAccessRegWord(sc, 0xF8F0, 0xC602);
2268         MP_WriteMcuAccessRegWord(sc, 0xF8F2, 0xBE00);
2269         MP_WriteMcuAccessRegWord(sc, 0xF8F4, 0x0CA4);
2270         MP_WriteMcuAccessRegWord(sc, 0xF8F6, 0xC502);
2271         MP_WriteMcuAccessRegWord(sc, 0xF8F8, 0xBD00);
2272         MP_WriteMcuAccessRegWord(sc, 0xF8FA, 0x0000);
2273         MP_WriteMcuAccessRegWord(sc, 0xF8FC, 0xC602);
2274         MP_WriteMcuAccessRegWord(sc, 0xF8FE, 0xBE00);
2275         MP_WriteMcuAccessRegWord(sc, 0xF900, 0x0000);
2276
2277         MP_WriteMcuAccessRegWord(sc, 0xFC26, 0x8000);
2278
2279         MP_WriteMcuAccessRegWord(sc, 0xFC28, 0x00E2);
2280         MP_WriteMcuAccessRegWord(sc, 0xFC2A, 0x0210);
2281         MP_WriteMcuAccessRegWord(sc, 0xFC2C, 0x1A04);
2282         MP_WriteMcuAccessRegWord(sc, 0xFC2E, 0x0B26);
2283         MP_WriteMcuAccessRegWord(sc, 0xFC30, 0x0F02);
2284         MP_WriteMcuAccessRegWord(sc, 0xFC32, 0x0CA0);
2285
2286         if (sc->re_device_id == RT_DEVICEID_8136)
2287                 MP_WriteMcuAccessRegWord(sc, 0xFC38, 0x0033);
2288         else
2289                 MP_WriteMcuAccessRegWord(sc, 0xFC38, 0x003F);
2290 }
2291
2292 static void re_set_mac_mcu_8168fp_1(struct re_softc *sc)
2293 {
2294         DisableMcuBPs(sc);
2295
2296         MP_WriteMcuAccessRegWord(sc, 0xF800, 0xE00A);
2297         MP_WriteMcuAccessRegWord(sc, 0xF802, 0xE0C1);
2298         MP_WriteMcuAccessRegWord(sc, 0xF804, 0xE104);
2299         MP_WriteMcuAccessRegWord(sc, 0xF806, 0xE108);
2300         MP_WriteMcuAccessRegWord(sc, 0xF808, 0xE10D);
2301         MP_WriteMcuAccessRegWord(sc, 0xF80A, 0xE112);
2302         MP_WriteMcuAccessRegWord(sc, 0xF80C, 0xE11C);
2303         MP_WriteMcuAccessRegWord(sc, 0xF80E, 0xE121);
2304         MP_WriteMcuAccessRegWord(sc, 0xF810, 0xE000);
2305         MP_WriteMcuAccessRegWord(sc, 0xF812, 0xE0C8);
2306         MP_WriteMcuAccessRegWord(sc, 0xF814, 0xB400);
2307         MP_WriteMcuAccessRegWord(sc, 0xF816, 0xC1FE);
2308         MP_WriteMcuAccessRegWord(sc, 0xF818, 0x49E2);
2309         MP_WriteMcuAccessRegWord(sc, 0xF81A, 0xF04C);
2310         MP_WriteMcuAccessRegWord(sc, 0xF81C, 0x49EA);
2311         MP_WriteMcuAccessRegWord(sc, 0xF81E, 0xF04A);
2312         MP_WriteMcuAccessRegWord(sc, 0xF820, 0x74E6);
2313         MP_WriteMcuAccessRegWord(sc, 0xF822, 0xC246);
2314         MP_WriteMcuAccessRegWord(sc, 0xF824, 0x7542);
2315         MP_WriteMcuAccessRegWord(sc, 0xF826, 0x73EC);
2316         MP_WriteMcuAccessRegWord(sc, 0xF828, 0x1800);
2317         MP_WriteMcuAccessRegWord(sc, 0xF82A, 0x49C0);
2318         MP_WriteMcuAccessRegWord(sc, 0xF82C, 0xF10D);
2319         MP_WriteMcuAccessRegWord(sc, 0xF82E, 0x49C1);
2320         MP_WriteMcuAccessRegWord(sc, 0xF830, 0xF10B);
2321         MP_WriteMcuAccessRegWord(sc, 0xF832, 0x49C2);
2322         MP_WriteMcuAccessRegWord(sc, 0xF834, 0xF109);
2323         MP_WriteMcuAccessRegWord(sc, 0xF836, 0x49B0);
2324         MP_WriteMcuAccessRegWord(sc, 0xF838, 0xF107);
2325         MP_WriteMcuAccessRegWord(sc, 0xF83A, 0x49B1);
2326         MP_WriteMcuAccessRegWord(sc, 0xF83C, 0xF105);
2327         MP_WriteMcuAccessRegWord(sc, 0xF83E, 0x7220);
2328         MP_WriteMcuAccessRegWord(sc, 0xF840, 0x49A2);
2329         MP_WriteMcuAccessRegWord(sc, 0xF842, 0xF102);
2330         MP_WriteMcuAccessRegWord(sc, 0xF844, 0xE002);
2331         MP_WriteMcuAccessRegWord(sc, 0xF846, 0x4800);
2332         MP_WriteMcuAccessRegWord(sc, 0xF848, 0x49D0);
2333         MP_WriteMcuAccessRegWord(sc, 0xF84A, 0xF10A);
2334         MP_WriteMcuAccessRegWord(sc, 0xF84C, 0x49D1);
2335         MP_WriteMcuAccessRegWord(sc, 0xF84E, 0xF108);
2336         MP_WriteMcuAccessRegWord(sc, 0xF850, 0x49D2);
2337         MP_WriteMcuAccessRegWord(sc, 0xF852, 0xF106);
2338         MP_WriteMcuAccessRegWord(sc, 0xF854, 0x49D3);
2339         MP_WriteMcuAccessRegWord(sc, 0xF856, 0xF104);
2340         MP_WriteMcuAccessRegWord(sc, 0xF858, 0x49DF);
2341         MP_WriteMcuAccessRegWord(sc, 0xF85A, 0xF102);
2342         MP_WriteMcuAccessRegWord(sc, 0xF85C, 0xE00C);
2343         MP_WriteMcuAccessRegWord(sc, 0xF85E, 0x4801);
2344         MP_WriteMcuAccessRegWord(sc, 0xF860, 0x72E4);
2345         MP_WriteMcuAccessRegWord(sc, 0xF862, 0x49AD);
2346         MP_WriteMcuAccessRegWord(sc, 0xF864, 0xF108);
2347         MP_WriteMcuAccessRegWord(sc, 0xF866, 0xC225);
2348         MP_WriteMcuAccessRegWord(sc, 0xF868, 0x6741);
2349         MP_WriteMcuAccessRegWord(sc, 0xF86A, 0x48F0);
2350         MP_WriteMcuAccessRegWord(sc, 0xF86C, 0x8F41);
2351         MP_WriteMcuAccessRegWord(sc, 0xF86E, 0x4870);
2352         MP_WriteMcuAccessRegWord(sc, 0xF870, 0x8F41);
2353         MP_WriteMcuAccessRegWord(sc, 0xF872, 0xC7CF);
2354         MP_WriteMcuAccessRegWord(sc, 0xF874, 0x49B5);
2355         MP_WriteMcuAccessRegWord(sc, 0xF876, 0xF01F);
2356         MP_WriteMcuAccessRegWord(sc, 0xF878, 0x49B2);
2357         MP_WriteMcuAccessRegWord(sc, 0xF87A, 0xF00B);
2358         MP_WriteMcuAccessRegWord(sc, 0xF87C, 0x4980);
2359         MP_WriteMcuAccessRegWord(sc, 0xF87E, 0xF003);
2360         MP_WriteMcuAccessRegWord(sc, 0xF880, 0x484E);
2361         MP_WriteMcuAccessRegWord(sc, 0xF882, 0x94E7);
2362         MP_WriteMcuAccessRegWord(sc, 0xF884, 0x4981);
2363         MP_WriteMcuAccessRegWord(sc, 0xF886, 0xF004);
2364         MP_WriteMcuAccessRegWord(sc, 0xF888, 0x485E);
2365         MP_WriteMcuAccessRegWord(sc, 0xF88A, 0xC212);
2366         MP_WriteMcuAccessRegWord(sc, 0xF88C, 0x9543);
2367         MP_WriteMcuAccessRegWord(sc, 0xF88E, 0xE071);
2368         MP_WriteMcuAccessRegWord(sc, 0xF890, 0x49B6);
2369         MP_WriteMcuAccessRegWord(sc, 0xF892, 0xF003);
2370         MP_WriteMcuAccessRegWord(sc, 0xF894, 0x49B3);
2371         MP_WriteMcuAccessRegWord(sc, 0xF896, 0xF10F);
2372         MP_WriteMcuAccessRegWord(sc, 0xF898, 0x4980);
2373         MP_WriteMcuAccessRegWord(sc, 0xF89A, 0xF003);
2374         MP_WriteMcuAccessRegWord(sc, 0xF89C, 0x484E);
2375         MP_WriteMcuAccessRegWord(sc, 0xF89E, 0x94E7);
2376         MP_WriteMcuAccessRegWord(sc, 0xF8A0, 0x4981);
2377         MP_WriteMcuAccessRegWord(sc, 0xF8A2, 0xF004);
2378         MP_WriteMcuAccessRegWord(sc, 0xF8A4, 0x485E);
2379         MP_WriteMcuAccessRegWord(sc, 0xF8A6, 0xC204);
2380         MP_WriteMcuAccessRegWord(sc, 0xF8A8, 0x9543);
2381         MP_WriteMcuAccessRegWord(sc, 0xF8AA, 0xE005);
2382         MP_WriteMcuAccessRegWord(sc, 0xF8AC, 0xE000);
2383         MP_WriteMcuAccessRegWord(sc, 0xF8AE, 0xE0FC);
2384         MP_WriteMcuAccessRegWord(sc, 0xF8B0, 0xE0FA);
2385         MP_WriteMcuAccessRegWord(sc, 0xF8B2, 0xE065);
2386         MP_WriteMcuAccessRegWord(sc, 0xF8B4, 0x49B7);
2387         MP_WriteMcuAccessRegWord(sc, 0xF8B6, 0xF007);
2388         MP_WriteMcuAccessRegWord(sc, 0xF8B8, 0x4980);
2389         MP_WriteMcuAccessRegWord(sc, 0xF8BA, 0xF005);
2390         MP_WriteMcuAccessRegWord(sc, 0xF8BC, 0x1A38);
2391         MP_WriteMcuAccessRegWord(sc, 0xF8BE, 0x46D4);
2392         MP_WriteMcuAccessRegWord(sc, 0xF8C0, 0x1200);
2393         MP_WriteMcuAccessRegWord(sc, 0xF8C2, 0xF109);
2394         MP_WriteMcuAccessRegWord(sc, 0xF8C4, 0x4981);
2395         MP_WriteMcuAccessRegWord(sc, 0xF8C6, 0xF055);
2396         MP_WriteMcuAccessRegWord(sc, 0xF8C8, 0x49C3);
2397         MP_WriteMcuAccessRegWord(sc, 0xF8CA, 0xF105);
2398         MP_WriteMcuAccessRegWord(sc, 0xF8CC, 0x1A30);
2399         MP_WriteMcuAccessRegWord(sc, 0xF8CE, 0x46D5);
2400         MP_WriteMcuAccessRegWord(sc, 0xF8D0, 0x1200);
2401         MP_WriteMcuAccessRegWord(sc, 0xF8D2, 0xF04F);
2402         MP_WriteMcuAccessRegWord(sc, 0xF8D4, 0x7220);
2403         MP_WriteMcuAccessRegWord(sc, 0xF8D6, 0x49A2);
2404         MP_WriteMcuAccessRegWord(sc, 0xF8D8, 0xF130);
2405         MP_WriteMcuAccessRegWord(sc, 0xF8DA, 0x49C1);
2406         MP_WriteMcuAccessRegWord(sc, 0xF8DC, 0xF12E);
2407         MP_WriteMcuAccessRegWord(sc, 0xF8DE, 0x49B0);
2408         MP_WriteMcuAccessRegWord(sc, 0xF8E0, 0xF12C);
2409         MP_WriteMcuAccessRegWord(sc, 0xF8E2, 0xC2E6);
2410         MP_WriteMcuAccessRegWord(sc, 0xF8E4, 0x7240);
2411         MP_WriteMcuAccessRegWord(sc, 0xF8E6, 0x49A8);
2412         MP_WriteMcuAccessRegWord(sc, 0xF8E8, 0xF003);
2413         MP_WriteMcuAccessRegWord(sc, 0xF8EA, 0x49D0);
2414         MP_WriteMcuAccessRegWord(sc, 0xF8EC, 0xF126);
2415         MP_WriteMcuAccessRegWord(sc, 0xF8EE, 0x49A9);
2416         MP_WriteMcuAccessRegWord(sc, 0xF8F0, 0xF003);
2417         MP_WriteMcuAccessRegWord(sc, 0xF8F2, 0x49D1);
2418         MP_WriteMcuAccessRegWord(sc, 0xF8F4, 0xF122);
2419         MP_WriteMcuAccessRegWord(sc, 0xF8F6, 0x49AA);
2420         MP_WriteMcuAccessRegWord(sc, 0xF8F8, 0xF003);
2421         MP_WriteMcuAccessRegWord(sc, 0xF8FA, 0x49D2);
2422         MP_WriteMcuAccessRegWord(sc, 0xF8FC, 0xF11E);
2423         MP_WriteMcuAccessRegWord(sc, 0xF8FE, 0x49AB);
2424         MP_WriteMcuAccessRegWord(sc, 0xF900, 0xF003);
2425         MP_WriteMcuAccessRegWord(sc, 0xF902, 0x49DF);
2426         MP_WriteMcuAccessRegWord(sc, 0xF904, 0xF11A);
2427         MP_WriteMcuAccessRegWord(sc, 0xF906, 0x49AC);
2428         MP_WriteMcuAccessRegWord(sc, 0xF908, 0xF003);
2429         MP_WriteMcuAccessRegWord(sc, 0xF90A, 0x49D3);
2430         MP_WriteMcuAccessRegWord(sc, 0xF90C, 0xF116);
2431         MP_WriteMcuAccessRegWord(sc, 0xF90E, 0x4980);
2432         MP_WriteMcuAccessRegWord(sc, 0xF910, 0xF003);
2433         MP_WriteMcuAccessRegWord(sc, 0xF912, 0x49C7);
2434         MP_WriteMcuAccessRegWord(sc, 0xF914, 0xF105);
2435         MP_WriteMcuAccessRegWord(sc, 0xF916, 0x4981);
2436         MP_WriteMcuAccessRegWord(sc, 0xF918, 0xF02C);
2437         MP_WriteMcuAccessRegWord(sc, 0xF91A, 0x49D7);
2438         MP_WriteMcuAccessRegWord(sc, 0xF91C, 0xF02A);
2439         MP_WriteMcuAccessRegWord(sc, 0xF91E, 0x49C0);
2440         MP_WriteMcuAccessRegWord(sc, 0xF920, 0xF00C);
2441         MP_WriteMcuAccessRegWord(sc, 0xF922, 0xC721);
2442         MP_WriteMcuAccessRegWord(sc, 0xF924, 0x62F4);
2443         MP_WriteMcuAccessRegWord(sc, 0xF926, 0x49A0);
2444         MP_WriteMcuAccessRegWord(sc, 0xF928, 0xF008);
2445         MP_WriteMcuAccessRegWord(sc, 0xF92A, 0x49A4);
2446         MP_WriteMcuAccessRegWord(sc, 0xF92C, 0xF106);
2447         MP_WriteMcuAccessRegWord(sc, 0xF92E, 0x4824);
2448         MP_WriteMcuAccessRegWord(sc, 0xF930, 0x8AF4);
2449         MP_WriteMcuAccessRegWord(sc, 0xF932, 0xC71A);
2450         MP_WriteMcuAccessRegWord(sc, 0xF934, 0x1A40);
2451         MP_WriteMcuAccessRegWord(sc, 0xF936, 0x9AE0);
2452         MP_WriteMcuAccessRegWord(sc, 0xF938, 0x49B6);
2453         MP_WriteMcuAccessRegWord(sc, 0xF93A, 0xF017);
2454         MP_WriteMcuAccessRegWord(sc, 0xF93C, 0x200E);
2455         MP_WriteMcuAccessRegWord(sc, 0xF93E, 0xC7B8);
2456         MP_WriteMcuAccessRegWord(sc, 0xF940, 0x72E0);
2457         MP_WriteMcuAccessRegWord(sc, 0xF942, 0x4710);
2458         MP_WriteMcuAccessRegWord(sc, 0xF944, 0x92E1);
2459         MP_WriteMcuAccessRegWord(sc, 0xF946, 0xC70E);
2460         MP_WriteMcuAccessRegWord(sc, 0xF948, 0x77E0);
2461         MP_WriteMcuAccessRegWord(sc, 0xF94A, 0x49F0);
2462         MP_WriteMcuAccessRegWord(sc, 0xF94C, 0xF112);
2463         MP_WriteMcuAccessRegWord(sc, 0xF94E, 0xC70B);
2464         MP_WriteMcuAccessRegWord(sc, 0xF950, 0x77E0);
2465         MP_WriteMcuAccessRegWord(sc, 0xF952, 0x27FE);
2466         MP_WriteMcuAccessRegWord(sc, 0xF954, 0x1AFA);
2467         MP_WriteMcuAccessRegWord(sc, 0xF956, 0x4317);
2468         MP_WriteMcuAccessRegWord(sc, 0xF958, 0xC705);
2469         MP_WriteMcuAccessRegWord(sc, 0xF95A, 0x9AE2);
2470         MP_WriteMcuAccessRegWord(sc, 0xF95C, 0x1A11);
2471         MP_WriteMcuAccessRegWord(sc, 0xF95E, 0x8AE0);
2472         MP_WriteMcuAccessRegWord(sc, 0xF960, 0xE008);
2473         MP_WriteMcuAccessRegWord(sc, 0xF962, 0xE41C);
2474         MP_WriteMcuAccessRegWord(sc, 0xF964, 0xC0AE);
2475         MP_WriteMcuAccessRegWord(sc, 0xF966, 0xD23A);
2476         MP_WriteMcuAccessRegWord(sc, 0xF968, 0xC7A2);
2477         MP_WriteMcuAccessRegWord(sc, 0xF96A, 0x74E6);
2478         MP_WriteMcuAccessRegWord(sc, 0xF96C, 0x484F);
2479         MP_WriteMcuAccessRegWord(sc, 0xF96E, 0x94E7);
2480         MP_WriteMcuAccessRegWord(sc, 0xF970, 0xC79E);
2481         MP_WriteMcuAccessRegWord(sc, 0xF972, 0x8CE6);
2482         MP_WriteMcuAccessRegWord(sc, 0xF974, 0x8BEC);
2483         MP_WriteMcuAccessRegWord(sc, 0xF976, 0xC29C);
2484         MP_WriteMcuAccessRegWord(sc, 0xF978, 0x8D42);
2485         MP_WriteMcuAccessRegWord(sc, 0xF97A, 0x7220);
2486         MP_WriteMcuAccessRegWord(sc, 0xF97C, 0xB000);
2487         MP_WriteMcuAccessRegWord(sc, 0xF97E, 0xC502);
2488         MP_WriteMcuAccessRegWord(sc, 0xF980, 0xBD00);
2489         MP_WriteMcuAccessRegWord(sc, 0xF982, 0x0932);
2490         MP_WriteMcuAccessRegWord(sc, 0xF984, 0xB400);
2491         MP_WriteMcuAccessRegWord(sc, 0xF986, 0xC240);
2492         MP_WriteMcuAccessRegWord(sc, 0xF988, 0xC340);
2493         MP_WriteMcuAccessRegWord(sc, 0xF98A, 0x7060);
2494         MP_WriteMcuAccessRegWord(sc, 0xF98C, 0x498F);
2495         MP_WriteMcuAccessRegWord(sc, 0xF98E, 0xF014);
2496         MP_WriteMcuAccessRegWord(sc, 0xF990, 0x488F);
2497         MP_WriteMcuAccessRegWord(sc, 0xF992, 0x9061);
2498         MP_WriteMcuAccessRegWord(sc, 0xF994, 0x744C);
2499         MP_WriteMcuAccessRegWord(sc, 0xF996, 0x49C3);
2500         MP_WriteMcuAccessRegWord(sc, 0xF998, 0xF004);
2501         MP_WriteMcuAccessRegWord(sc, 0xF99A, 0x7562);
2502         MP_WriteMcuAccessRegWord(sc, 0xF99C, 0x485E);
2503         MP_WriteMcuAccessRegWord(sc, 0xF99E, 0x9563);
2504         MP_WriteMcuAccessRegWord(sc, 0xF9A0, 0x7446);
2505         MP_WriteMcuAccessRegWord(sc, 0xF9A2, 0x49C3);
2506         MP_WriteMcuAccessRegWord(sc, 0xF9A4, 0xF106);
2507         MP_WriteMcuAccessRegWord(sc, 0xF9A6, 0x7562);
2508         MP_WriteMcuAccessRegWord(sc, 0xF9A8, 0x1C30);
2509         MP_WriteMcuAccessRegWord(sc, 0xF9AA, 0x46E5);
2510         MP_WriteMcuAccessRegWord(sc, 0xF9AC, 0x1200);
2511         MP_WriteMcuAccessRegWord(sc, 0xF9AE, 0xF004);
2512         MP_WriteMcuAccessRegWord(sc, 0xF9B0, 0x7446);
2513         MP_WriteMcuAccessRegWord(sc, 0xF9B2, 0x484F);
2514         MP_WriteMcuAccessRegWord(sc, 0xF9B4, 0x9447);
2515         MP_WriteMcuAccessRegWord(sc, 0xF9B6, 0xC32A);
2516         MP_WriteMcuAccessRegWord(sc, 0xF9B8, 0x7466);
2517         MP_WriteMcuAccessRegWord(sc, 0xF9BA, 0x49C0);
2518         MP_WriteMcuAccessRegWord(sc, 0xF9BC, 0xF00F);
2519         MP_WriteMcuAccessRegWord(sc, 0xF9BE, 0x48C0);
2520         MP_WriteMcuAccessRegWord(sc, 0xF9C0, 0x9C66);
2521         MP_WriteMcuAccessRegWord(sc, 0xF9C2, 0x7446);
2522         MP_WriteMcuAccessRegWord(sc, 0xF9C4, 0x4840);
2523         MP_WriteMcuAccessRegWord(sc, 0xF9C6, 0x4841);
2524         MP_WriteMcuAccessRegWord(sc, 0xF9C8, 0x4842);
2525         MP_WriteMcuAccessRegWord(sc, 0xF9CA, 0x9C46);
2526         MP_WriteMcuAccessRegWord(sc, 0xF9CC, 0x744C);
2527         MP_WriteMcuAccessRegWord(sc, 0xF9CE, 0x4840);
2528         MP_WriteMcuAccessRegWord(sc, 0xF9D0, 0x9C4C);
2529         MP_WriteMcuAccessRegWord(sc, 0xF9D2, 0x744A);
2530         MP_WriteMcuAccessRegWord(sc, 0xF9D4, 0x484A);
2531         MP_WriteMcuAccessRegWord(sc, 0xF9D6, 0x9C4A);
2532         MP_WriteMcuAccessRegWord(sc, 0xF9D8, 0xE013);
2533         MP_WriteMcuAccessRegWord(sc, 0xF9DA, 0x498E);
2534         MP_WriteMcuAccessRegWord(sc, 0xF9DC, 0xF011);
2535         MP_WriteMcuAccessRegWord(sc, 0xF9DE, 0x488E);
2536         MP_WriteMcuAccessRegWord(sc, 0xF9E0, 0x9061);
2537         MP_WriteMcuAccessRegWord(sc, 0xF9E2, 0x744C);
2538         MP_WriteMcuAccessRegWord(sc, 0xF9E4, 0x49C3);
2539         MP_WriteMcuAccessRegWord(sc, 0xF9E6, 0xF004);
2540         MP_WriteMcuAccessRegWord(sc, 0xF9E8, 0x7446);
2541         MP_WriteMcuAccessRegWord(sc, 0xF9EA, 0x484E);
2542         MP_WriteMcuAccessRegWord(sc, 0xF9EC, 0x9447);
2543         MP_WriteMcuAccessRegWord(sc, 0xF9EE, 0x7446);
2544         MP_WriteMcuAccessRegWord(sc, 0xF9F0, 0x1D38);
2545         MP_WriteMcuAccessRegWord(sc, 0xF9F2, 0x46EC);
2546         MP_WriteMcuAccessRegWord(sc, 0xF9F4, 0x1500);
2547         MP_WriteMcuAccessRegWord(sc, 0xF9F6, 0xF004);
2548         MP_WriteMcuAccessRegWord(sc, 0xF9F8, 0x7446);
2549         MP_WriteMcuAccessRegWord(sc, 0xF9FA, 0x484F);
2550         MP_WriteMcuAccessRegWord(sc, 0xF9FC, 0x9447);
2551         MP_WriteMcuAccessRegWord(sc, 0xF9FE, 0xB000);
2552         MP_WriteMcuAccessRegWord(sc, 0xFA00, 0xC502);
2553         MP_WriteMcuAccessRegWord(sc, 0xFA02, 0xBD00);
2554         MP_WriteMcuAccessRegWord(sc, 0xFA04, 0x074C);
2555         MP_WriteMcuAccessRegWord(sc, 0xFA06, 0xE000);
2556         MP_WriteMcuAccessRegWord(sc, 0xFA08, 0xE0FC);
2557         MP_WriteMcuAccessRegWord(sc, 0xFA0A, 0xE0C0);
2558         MP_WriteMcuAccessRegWord(sc, 0xFA0C, 0x4830);
2559         MP_WriteMcuAccessRegWord(sc, 0xFA0E, 0x4837);
2560         MP_WriteMcuAccessRegWord(sc, 0xFA10, 0xC502);
2561         MP_WriteMcuAccessRegWord(sc, 0xFA12, 0xBD00);
2562         MP_WriteMcuAccessRegWord(sc, 0xFA14, 0x0978);
2563         MP_WriteMcuAccessRegWord(sc, 0xFA16, 0x63E2);
2564         MP_WriteMcuAccessRegWord(sc, 0xFA18, 0x4830);
2565         MP_WriteMcuAccessRegWord(sc, 0xFA1A, 0x4837);
2566         MP_WriteMcuAccessRegWord(sc, 0xFA1C, 0xC502);
2567         MP_WriteMcuAccessRegWord(sc, 0xFA1E, 0xBD00);
2568         MP_WriteMcuAccessRegWord(sc, 0xFA20, 0x09FE);
2569         MP_WriteMcuAccessRegWord(sc, 0xFA22, 0x73E2);
2570         MP_WriteMcuAccessRegWord(sc, 0xFA24, 0x4830);
2571         MP_WriteMcuAccessRegWord(sc, 0xFA26, 0x8BE2);
2572         MP_WriteMcuAccessRegWord(sc, 0xFA28, 0xC302);
2573         MP_WriteMcuAccessRegWord(sc, 0xFA2A, 0xBB00);
2574         MP_WriteMcuAccessRegWord(sc, 0xFA2C, 0x0A12);
2575         MP_WriteMcuAccessRegWord(sc, 0xFA2E, 0x73E2);
2576         MP_WriteMcuAccessRegWord(sc, 0xFA30, 0x48B0);
2577         MP_WriteMcuAccessRegWord(sc, 0xFA32, 0x48B3);
2578         MP_WriteMcuAccessRegWord(sc, 0xFA34, 0x48B4);
2579         MP_WriteMcuAccessRegWord(sc, 0xFA36, 0x48B5);
2580         MP_WriteMcuAccessRegWord(sc, 0xFA38, 0x48B6);
2581         MP_WriteMcuAccessRegWord(sc, 0xFA3A, 0x48B7);
2582         MP_WriteMcuAccessRegWord(sc, 0xFA3C, 0x8BE2);
2583         MP_WriteMcuAccessRegWord(sc, 0xFA3E, 0xC302);
2584         MP_WriteMcuAccessRegWord(sc, 0xFA40, 0xBB00);
2585         MP_WriteMcuAccessRegWord(sc, 0xFA42, 0x0A5A);
2586         MP_WriteMcuAccessRegWord(sc, 0xFA44, 0x73E2);
2587         MP_WriteMcuAccessRegWord(sc, 0xFA46, 0x4830);
2588         MP_WriteMcuAccessRegWord(sc, 0xFA48, 0x8BE2);
2589         MP_WriteMcuAccessRegWord(sc, 0xFA4A, 0xC302);
2590         MP_WriteMcuAccessRegWord(sc, 0xFA4C, 0xBB00);
2591         MP_WriteMcuAccessRegWord(sc, 0xFA4E, 0x0A6C);
2592         MP_WriteMcuAccessRegWord(sc, 0xFA50, 0x73E2);
2593         MP_WriteMcuAccessRegWord(sc, 0xFA52, 0x4830);
2594         MP_WriteMcuAccessRegWord(sc, 0xFA54, 0x4837);
2595         MP_WriteMcuAccessRegWord(sc, 0xFA56, 0xC502);
2596         MP_WriteMcuAccessRegWord(sc, 0xFA58, 0xBD00);
2597         MP_WriteMcuAccessRegWord(sc, 0xFA5A, 0x0A86);
2598
2599         MP_WriteMcuAccessRegWord(sc, 0xFC26, 0x8000);
2600
2601         MP_WriteMcuAccessRegWord(sc, 0xFC28, 0x0890);
2602         MP_WriteMcuAccessRegWord(sc, 0xFC2A, 0x0712);
2603         MP_WriteMcuAccessRegWord(sc, 0xFC2C, 0x0974);
2604         MP_WriteMcuAccessRegWord(sc, 0xFC2E, 0x09FC);
2605         MP_WriteMcuAccessRegWord(sc, 0xFC30, 0x0A0E);
2606         MP_WriteMcuAccessRegWord(sc, 0xFC32, 0x0A56);
2607         MP_WriteMcuAccessRegWord(sc, 0xFC34, 0x0A68);
2608         MP_WriteMcuAccessRegWord(sc, 0xFC36, 0x0A84);
2609
2610         if (sc->HwPkgDet == 0x0)
2611                 MP_WriteMcuAccessRegWord(sc, 0xFC38, 0x00FC);
2612         else if(sc->HwPkgDet == 0xF)
2613                 MP_WriteMcuAccessRegWord(sc, 0xFC38, 0x00FF);
2614 }
2615
2616 static void re_set_mac_mcu_8168fp_2(struct re_softc *sc)
2617 {
2618         DisableMcuBPs(sc);
2619
2620         MP_WriteMcuAccessRegWord(sc, 0xF800, 0xE008);
2621         MP_WriteMcuAccessRegWord(sc, 0xF802, 0xE00A);
2622         MP_WriteMcuAccessRegWord(sc, 0xF804, 0xE031);
2623         MP_WriteMcuAccessRegWord(sc, 0xF806, 0xE033);
2624         MP_WriteMcuAccessRegWord(sc, 0xF808, 0xE035);
2625         MP_WriteMcuAccessRegWord(sc, 0xF80A, 0xE144);
2626         MP_WriteMcuAccessRegWord(sc, 0xF80C, 0xE166);
2627         MP_WriteMcuAccessRegWord(sc, 0xF80E, 0xE168);
2628         MP_WriteMcuAccessRegWord(sc, 0xF810, 0xC502);
2629         MP_WriteMcuAccessRegWord(sc, 0xF812, 0xBD00);
2630         MP_WriteMcuAccessRegWord(sc, 0xF814, 0x0000);
2631         MP_WriteMcuAccessRegWord(sc, 0xF816, 0xC725);
2632         MP_WriteMcuAccessRegWord(sc, 0xF818, 0x75E0);
2633         MP_WriteMcuAccessRegWord(sc, 0xF81A, 0x48D0);
2634         MP_WriteMcuAccessRegWord(sc, 0xF81C, 0x9DE0);
2635         MP_WriteMcuAccessRegWord(sc, 0xF81E, 0xC722);
2636         MP_WriteMcuAccessRegWord(sc, 0xF820, 0x75E0);
2637         MP_WriteMcuAccessRegWord(sc, 0xF822, 0x1C78);
2638         MP_WriteMcuAccessRegWord(sc, 0xF824, 0x416C);
2639         MP_WriteMcuAccessRegWord(sc, 0xF826, 0x1530);
2640         MP_WriteMcuAccessRegWord(sc, 0xF828, 0xF111);
2641         MP_WriteMcuAccessRegWord(sc, 0xF82A, 0xC71D);
2642         MP_WriteMcuAccessRegWord(sc, 0xF82C, 0x75F6);
2643         MP_WriteMcuAccessRegWord(sc, 0xF82E, 0x49D1);
2644         MP_WriteMcuAccessRegWord(sc, 0xF830, 0xF00D);
2645         MP_WriteMcuAccessRegWord(sc, 0xF832, 0x75E0);
2646         MP_WriteMcuAccessRegWord(sc, 0xF834, 0x1C1F);
2647         MP_WriteMcuAccessRegWord(sc, 0xF836, 0x416C);
2648         MP_WriteMcuAccessRegWord(sc, 0xF838, 0x1502);
2649         MP_WriteMcuAccessRegWord(sc, 0xF83A, 0xF108);
2650         MP_WriteMcuAccessRegWord(sc, 0xF83C, 0x75FA);
2651         MP_WriteMcuAccessRegWord(sc, 0xF83E, 0x49D3);
2652         MP_WriteMcuAccessRegWord(sc, 0xF840, 0xF005);
2653         MP_WriteMcuAccessRegWord(sc, 0xF842, 0x75EC);
2654         MP_WriteMcuAccessRegWord(sc, 0xF844, 0x9DE4);
2655         MP_WriteMcuAccessRegWord(sc, 0xF846, 0x4853);
2656         MP_WriteMcuAccessRegWord(sc, 0xF848, 0x9DFA);
2657         MP_WriteMcuAccessRegWord(sc, 0xF84A, 0xC70B);
2658         MP_WriteMcuAccessRegWord(sc, 0xF84C, 0x75E0);
2659         MP_WriteMcuAccessRegWord(sc, 0xF84E, 0x4852);
2660         MP_WriteMcuAccessRegWord(sc, 0xF850, 0x4850);
2661         MP_WriteMcuAccessRegWord(sc, 0xF852, 0x9DE0);
2662         MP_WriteMcuAccessRegWord(sc, 0xF854, 0xC602);
2663         MP_WriteMcuAccessRegWord(sc, 0xF856, 0xBE00);
2664         MP_WriteMcuAccessRegWord(sc, 0xF858, 0x04B8);
2665         MP_WriteMcuAccessRegWord(sc, 0xF85A, 0xE420);
2666         MP_WriteMcuAccessRegWord(sc, 0xF85C, 0xE000);
2667         MP_WriteMcuAccessRegWord(sc, 0xF85E, 0xE0FC);
2668         MP_WriteMcuAccessRegWord(sc, 0xF860, 0xE43C);
2669         MP_WriteMcuAccessRegWord(sc, 0xF862, 0xDC00);
2670         MP_WriteMcuAccessRegWord(sc, 0xF864, 0xEB00);
2671         MP_WriteMcuAccessRegWord(sc, 0xF866, 0xC202);
2672         MP_WriteMcuAccessRegWord(sc, 0xF868, 0xBA00);
2673         MP_WriteMcuAccessRegWord(sc, 0xF86A, 0x0000);
2674         MP_WriteMcuAccessRegWord(sc, 0xF86C, 0xC002);
2675         MP_WriteMcuAccessRegWord(sc, 0xF86E, 0xB800);
2676         MP_WriteMcuAccessRegWord(sc, 0xF870, 0x0000);
2677         MP_WriteMcuAccessRegWord(sc, 0xF872, 0xB401);
2678         MP_WriteMcuAccessRegWord(sc, 0xF874, 0xB402);
2679         MP_WriteMcuAccessRegWord(sc, 0xF876, 0xB403);
2680         MP_WriteMcuAccessRegWord(sc, 0xF878, 0xB404);
2681         MP_WriteMcuAccessRegWord(sc, 0xF87A, 0xB405);
2682         MP_WriteMcuAccessRegWord(sc, 0xF87C, 0xB406);
2683         MP_WriteMcuAccessRegWord(sc, 0xF87E, 0xC44D);
2684         MP_WriteMcuAccessRegWord(sc, 0xF880, 0xC54D);
2685         MP_WriteMcuAccessRegWord(sc, 0xF882, 0x1867);
2686         MP_WriteMcuAccessRegWord(sc, 0xF884, 0xE8A2);
2687         MP_WriteMcuAccessRegWord(sc, 0xF886, 0x2318);
2688         MP_WriteMcuAccessRegWord(sc, 0xF888, 0x276E);
2689         MP_WriteMcuAccessRegWord(sc, 0xF88A, 0x1601);
2690         MP_WriteMcuAccessRegWord(sc, 0xF88C, 0xF106);
2691         MP_WriteMcuAccessRegWord(sc, 0xF88E, 0x1A07);
2692         MP_WriteMcuAccessRegWord(sc, 0xF890, 0xE861);
2693         MP_WriteMcuAccessRegWord(sc, 0xF892, 0xE86B);
2694         MP_WriteMcuAccessRegWord(sc, 0xF894, 0xE873);
2695         MP_WriteMcuAccessRegWord(sc, 0xF896, 0xE037);
2696         MP_WriteMcuAccessRegWord(sc, 0xF898, 0x231E);
2697         MP_WriteMcuAccessRegWord(sc, 0xF89A, 0x276E);
2698         MP_WriteMcuAccessRegWord(sc, 0xF89C, 0x1602);
2699         MP_WriteMcuAccessRegWord(sc, 0xF89E, 0xF10B);
2700         MP_WriteMcuAccessRegWord(sc, 0xF8A0, 0x1A07);
2701         MP_WriteMcuAccessRegWord(sc, 0xF8A2, 0xE858);
2702         MP_WriteMcuAccessRegWord(sc, 0xF8A4, 0xE862);
2703         MP_WriteMcuAccessRegWord(sc, 0xF8A6, 0xC247);
2704         MP_WriteMcuAccessRegWord(sc, 0xF8A8, 0xC344);
2705         MP_WriteMcuAccessRegWord(sc, 0xF8AA, 0xE8E3);
2706         MP_WriteMcuAccessRegWord(sc, 0xF8AC, 0xC73B);
2707         MP_WriteMcuAccessRegWord(sc, 0xF8AE, 0x66E0);
2708         MP_WriteMcuAccessRegWord(sc, 0xF8B0, 0xE8B5);
2709         MP_WriteMcuAccessRegWord(sc, 0xF8B2, 0xE029);
2710         MP_WriteMcuAccessRegWord(sc, 0xF8B4, 0x231A);
2711         MP_WriteMcuAccessRegWord(sc, 0xF8B6, 0x276C);
2712         MP_WriteMcuAccessRegWord(sc, 0xF8B8, 0xC733);
2713         MP_WriteMcuAccessRegWord(sc, 0xF8BA, 0x9EE0);
2714         MP_WriteMcuAccessRegWord(sc, 0xF8BC, 0x1866);
2715         MP_WriteMcuAccessRegWord(sc, 0xF8BE, 0xE885);
2716         MP_WriteMcuAccessRegWord(sc, 0xF8C0, 0x251C);
2717         MP_WriteMcuAccessRegWord(sc, 0xF8C2, 0x120F);
2718         MP_WriteMcuAccessRegWord(sc, 0xF8C4, 0xF011);
2719         MP_WriteMcuAccessRegWord(sc, 0xF8C6, 0x1209);
2720         MP_WriteMcuAccessRegWord(sc, 0xF8C8, 0xF011);
2721         MP_WriteMcuAccessRegWord(sc, 0xF8CA, 0x2014);
2722         MP_WriteMcuAccessRegWord(sc, 0xF8CC, 0x240E);
2723         MP_WriteMcuAccessRegWord(sc, 0xF8CE, 0x1000);
2724         MP_WriteMcuAccessRegWord(sc, 0xF8D0, 0xF007);
2725         MP_WriteMcuAccessRegWord(sc, 0xF8D2, 0x120C);
2726         MP_WriteMcuAccessRegWord(sc, 0xF8D4, 0xF00D);
2727         MP_WriteMcuAccessRegWord(sc, 0xF8D6, 0x1203);
2728         MP_WriteMcuAccessRegWord(sc, 0xF8D8, 0xF00D);
2729         MP_WriteMcuAccessRegWord(sc, 0xF8DA, 0x1200);
2730         MP_WriteMcuAccessRegWord(sc, 0xF8DC, 0xF00D);
2731         MP_WriteMcuAccessRegWord(sc, 0xF8DE, 0x120C);
2732         MP_WriteMcuAccessRegWord(sc, 0xF8E0, 0xF00D);
2733         MP_WriteMcuAccessRegWord(sc, 0xF8E2, 0x1203);
2734         MP_WriteMcuAccessRegWord(sc, 0xF8E4, 0xF00D);
2735         MP_WriteMcuAccessRegWord(sc, 0xF8E6, 0x1A03);
2736         MP_WriteMcuAccessRegWord(sc, 0xF8E8, 0xE00C);
2737         MP_WriteMcuAccessRegWord(sc, 0xF8EA, 0x1A07);
2738         MP_WriteMcuAccessRegWord(sc, 0xF8EC, 0xE00A);
2739         MP_WriteMcuAccessRegWord(sc, 0xF8EE, 0x1A00);
2740         MP_WriteMcuAccessRegWord(sc, 0xF8F0, 0xE008);
2741         MP_WriteMcuAccessRegWord(sc, 0xF8F2, 0x1A01);
2742         MP_WriteMcuAccessRegWord(sc, 0xF8F4, 0xE006);
2743         MP_WriteMcuAccessRegWord(sc, 0xF8F6, 0x1A02);
2744         MP_WriteMcuAccessRegWord(sc, 0xF8F8, 0xE004);
2745         MP_WriteMcuAccessRegWord(sc, 0xF8FA, 0x1A04);
2746         MP_WriteMcuAccessRegWord(sc, 0xF8FC, 0xE002);
2747         MP_WriteMcuAccessRegWord(sc, 0xF8FE, 0x1A05);
2748         MP_WriteMcuAccessRegWord(sc, 0xF900, 0xE829);
2749         MP_WriteMcuAccessRegWord(sc, 0xF902, 0xE833);
2750         MP_WriteMcuAccessRegWord(sc, 0xF904, 0xB006);
2751         MP_WriteMcuAccessRegWord(sc, 0xF906, 0xB005);
2752         MP_WriteMcuAccessRegWord(sc, 0xF908, 0xB004);
2753         MP_WriteMcuAccessRegWord(sc, 0xF90A, 0xB003);
2754         MP_WriteMcuAccessRegWord(sc, 0xF90C, 0xB002);
2755         MP_WriteMcuAccessRegWord(sc, 0xF90E, 0xB001);
2756         MP_WriteMcuAccessRegWord(sc, 0xF910, 0x60C4);
2757         MP_WriteMcuAccessRegWord(sc, 0xF912, 0xC702);
2758         MP_WriteMcuAccessRegWord(sc, 0xF914, 0xBF00);
2759         MP_WriteMcuAccessRegWord(sc, 0xF916, 0x2786);
2760         MP_WriteMcuAccessRegWord(sc, 0xF918, 0xDD00);
2761         MP_WriteMcuAccessRegWord(sc, 0xF91A, 0xD030);
2762         MP_WriteMcuAccessRegWord(sc, 0xF91C, 0xE0C4);
2763         MP_WriteMcuAccessRegWord(sc, 0xF91E, 0xE0F8);
2764         MP_WriteMcuAccessRegWord(sc, 0xF920, 0xDC42);
2765         MP_WriteMcuAccessRegWord(sc, 0xF922, 0xD3F0);
2766         MP_WriteMcuAccessRegWord(sc, 0xF924, 0x0000);
2767         MP_WriteMcuAccessRegWord(sc, 0xF926, 0x0004);
2768         MP_WriteMcuAccessRegWord(sc, 0xF928, 0x0007);
2769         MP_WriteMcuAccessRegWord(sc, 0xF92A, 0x0014);
2770         MP_WriteMcuAccessRegWord(sc, 0xF92C, 0x0090);
2771         MP_WriteMcuAccessRegWord(sc, 0xF92E, 0x1000);
2772         MP_WriteMcuAccessRegWord(sc, 0xF930, 0x0F00);
2773         MP_WriteMcuAccessRegWord(sc, 0xF932, 0x1004);
2774         MP_WriteMcuAccessRegWord(sc, 0xF934, 0x1008);
2775         MP_WriteMcuAccessRegWord(sc, 0xF936, 0x3000);
2776         MP_WriteMcuAccessRegWord(sc, 0xF938, 0x3004);
2777         MP_WriteMcuAccessRegWord(sc, 0xF93A, 0x3008);
2778         MP_WriteMcuAccessRegWord(sc, 0xF93C, 0x4000);
2779         MP_WriteMcuAccessRegWord(sc, 0xF93E, 0x7777);
2780         MP_WriteMcuAccessRegWord(sc, 0xF940, 0x8000);
2781         MP_WriteMcuAccessRegWord(sc, 0xF942, 0x8001);
2782         MP_WriteMcuAccessRegWord(sc, 0xF944, 0x8008);
2783         MP_WriteMcuAccessRegWord(sc, 0xF946, 0x8003);
2784         MP_WriteMcuAccessRegWord(sc, 0xF948, 0x8004);
2785         MP_WriteMcuAccessRegWord(sc, 0xF94A, 0xC000);
2786         MP_WriteMcuAccessRegWord(sc, 0xF94C, 0xC004);
2787         MP_WriteMcuAccessRegWord(sc, 0xF94E, 0xF004);
2788         MP_WriteMcuAccessRegWord(sc, 0xF950, 0xFFFF);
2789         MP_WriteMcuAccessRegWord(sc, 0xF952, 0xB406);
2790         MP_WriteMcuAccessRegWord(sc, 0xF954, 0xB407);
2791         MP_WriteMcuAccessRegWord(sc, 0xF956, 0xC6E5);
2792         MP_WriteMcuAccessRegWord(sc, 0xF958, 0x77C0);
2793         MP_WriteMcuAccessRegWord(sc, 0xF95A, 0x27F3);
2794         MP_WriteMcuAccessRegWord(sc, 0xF95C, 0x23F3);
2795         MP_WriteMcuAccessRegWord(sc, 0xF95E, 0x47FA);
2796         MP_WriteMcuAccessRegWord(sc, 0xF960, 0x9FC0);
2797         MP_WriteMcuAccessRegWord(sc, 0xF962, 0xB007);
2798         MP_WriteMcuAccessRegWord(sc, 0xF964, 0xB006);
2799         MP_WriteMcuAccessRegWord(sc, 0xF966, 0xFF80);
2800         MP_WriteMcuAccessRegWord(sc, 0xF968, 0xB405);
2801         MP_WriteMcuAccessRegWord(sc, 0xF96A, 0xB407);
2802         MP_WriteMcuAccessRegWord(sc, 0xF96C, 0xC7D8);
2803         MP_WriteMcuAccessRegWord(sc, 0xF96E, 0x75E0);
2804         MP_WriteMcuAccessRegWord(sc, 0xF970, 0x48D0);
2805         MP_WriteMcuAccessRegWord(sc, 0xF972, 0x9DE0);
2806         MP_WriteMcuAccessRegWord(sc, 0xF974, 0xB007);
2807         MP_WriteMcuAccessRegWord(sc, 0xF976, 0xB005);
2808         MP_WriteMcuAccessRegWord(sc, 0xF978, 0xFF80);
2809         MP_WriteMcuAccessRegWord(sc, 0xF97A, 0xB401);
2810         MP_WriteMcuAccessRegWord(sc, 0xF97C, 0xC0EA);
2811         MP_WriteMcuAccessRegWord(sc, 0xF97E, 0xC2DC);
2812         MP_WriteMcuAccessRegWord(sc, 0xF980, 0xC3D8);
2813         MP_WriteMcuAccessRegWord(sc, 0xF982, 0xE865);
2814         MP_WriteMcuAccessRegWord(sc, 0xF984, 0xC0D3);
2815         MP_WriteMcuAccessRegWord(sc, 0xF986, 0xC1E0);
2816         MP_WriteMcuAccessRegWord(sc, 0xF988, 0xC2E3);
2817         MP_WriteMcuAccessRegWord(sc, 0xF98A, 0xE861);
2818         MP_WriteMcuAccessRegWord(sc, 0xF98C, 0xE817);
2819         MP_WriteMcuAccessRegWord(sc, 0xF98E, 0xC0CD);
2820         MP_WriteMcuAccessRegWord(sc, 0xF990, 0xC2CF);
2821         MP_WriteMcuAccessRegWord(sc, 0xF992, 0xE85D);
2822         MP_WriteMcuAccessRegWord(sc, 0xF994, 0xC0C9);
2823         MP_WriteMcuAccessRegWord(sc, 0xF996, 0xC1D6);
2824         MP_WriteMcuAccessRegWord(sc, 0xF998, 0xC2DB);
2825         MP_WriteMcuAccessRegWord(sc, 0xF99A, 0xE859);
2826         MP_WriteMcuAccessRegWord(sc, 0xF99C, 0xE80F);
2827         MP_WriteMcuAccessRegWord(sc, 0xF99E, 0xC1C7);
2828         MP_WriteMcuAccessRegWord(sc, 0xF9A0, 0xC2CE);
2829         MP_WriteMcuAccessRegWord(sc, 0xF9A2, 0xE855);
2830         MP_WriteMcuAccessRegWord(sc, 0xF9A4, 0xC0C0);
2831         MP_WriteMcuAccessRegWord(sc, 0xF9A6, 0xC1D1);
2832         MP_WriteMcuAccessRegWord(sc, 0xF9A8, 0xC2D3);
2833         MP_WriteMcuAccessRegWord(sc, 0xF9AA, 0xE851);
2834         MP_WriteMcuAccessRegWord(sc, 0xF9AC, 0xE807);
2835         MP_WriteMcuAccessRegWord(sc, 0xF9AE, 0xC0BE);
2836         MP_WriteMcuAccessRegWord(sc, 0xF9B0, 0xC2C2);
2837         MP_WriteMcuAccessRegWord(sc, 0xF9B2, 0xE84D);
2838         MP_WriteMcuAccessRegWord(sc, 0xF9B4, 0xE803);
2839         MP_WriteMcuAccessRegWord(sc, 0xF9B6, 0xB001);
2840         MP_WriteMcuAccessRegWord(sc, 0xF9B8, 0xFF80);
2841         MP_WriteMcuAccessRegWord(sc, 0xF9BA, 0xB402);
2842         MP_WriteMcuAccessRegWord(sc, 0xF9BC, 0xC2C6);
2843         MP_WriteMcuAccessRegWord(sc, 0xF9BE, 0xE859);
2844         MP_WriteMcuAccessRegWord(sc, 0xF9C0, 0x499F);
2845         MP_WriteMcuAccessRegWord(sc, 0xF9C2, 0xF1FE);
2846         MP_WriteMcuAccessRegWord(sc, 0xF9C4, 0xB002);
2847         MP_WriteMcuAccessRegWord(sc, 0xF9C6, 0xFF80);
2848         MP_WriteMcuAccessRegWord(sc, 0xF9C8, 0xB402);
2849         MP_WriteMcuAccessRegWord(sc, 0xF9CA, 0xB403);
2850         MP_WriteMcuAccessRegWord(sc, 0xF9CC, 0xB407);
2851         MP_WriteMcuAccessRegWord(sc, 0xF9CE, 0xE821);
2852         MP_WriteMcuAccessRegWord(sc, 0xF9D0, 0x8882);
2853         MP_WriteMcuAccessRegWord(sc, 0xF9D2, 0x1980);
2854         MP_WriteMcuAccessRegWord(sc, 0xF9D4, 0x8983);
2855         MP_WriteMcuAccessRegWord(sc, 0xF9D6, 0xE81D);
2856         MP_WriteMcuAccessRegWord(sc, 0xF9D8, 0x7180);
2857         MP_WriteMcuAccessRegWord(sc, 0xF9DA, 0x218B);
2858         MP_WriteMcuAccessRegWord(sc, 0xF9DC, 0x25BB);
2859         MP_WriteMcuAccessRegWord(sc, 0xF9DE, 0x1310);
2860         MP_WriteMcuAccessRegWord(sc, 0xF9E0, 0xF014);
2861         MP_WriteMcuAccessRegWord(sc, 0xF9E2, 0x1310);
2862         MP_WriteMcuAccessRegWord(sc, 0xF9E4, 0xFB03);
2863         MP_WriteMcuAccessRegWord(sc, 0xF9E6, 0x1F20);
2864         MP_WriteMcuAccessRegWord(sc, 0xF9E8, 0x38FB);
2865         MP_WriteMcuAccessRegWord(sc, 0xF9EA, 0x3288);
2866         MP_WriteMcuAccessRegWord(sc, 0xF9EC, 0x434B);
2867         MP_WriteMcuAccessRegWord(sc, 0xF9EE, 0x2491);
2868         MP_WriteMcuAccessRegWord(sc, 0xF9F0, 0x430B);
2869         MP_WriteMcuAccessRegWord(sc, 0xF9F2, 0x1F0F);
2870         MP_WriteMcuAccessRegWord(sc, 0xF9F4, 0x38FB);
2871         MP_WriteMcuAccessRegWord(sc, 0xF9F6, 0x4313);
2872         MP_WriteMcuAccessRegWord(sc, 0xF9F8, 0x2121);
2873         MP_WriteMcuAccessRegWord(sc, 0xF9FA, 0x4353);
2874         MP_WriteMcuAccessRegWord(sc, 0xF9FC, 0x2521);
2875         MP_WriteMcuAccessRegWord(sc, 0xF9FE, 0x418A);
2876         MP_WriteMcuAccessRegWord(sc, 0xFA00, 0x6282);
2877         MP_WriteMcuAccessRegWord(sc, 0xFA02, 0x2527);
2878         MP_WriteMcuAccessRegWord(sc, 0xFA04, 0x212F);
2879         MP_WriteMcuAccessRegWord(sc, 0xFA06, 0x418A);
2880         MP_WriteMcuAccessRegWord(sc, 0xFA08, 0xB007);
2881         MP_WriteMcuAccessRegWord(sc, 0xFA0A, 0xB003);
2882         MP_WriteMcuAccessRegWord(sc, 0xFA0C, 0xB002);
2883         MP_WriteMcuAccessRegWord(sc, 0xFA0E, 0xFF80);
2884         MP_WriteMcuAccessRegWord(sc, 0xFA10, 0x6183);
2885         MP_WriteMcuAccessRegWord(sc, 0xFA12, 0x2496);
2886         MP_WriteMcuAccessRegWord(sc, 0xFA14, 0x1100);
2887         MP_WriteMcuAccessRegWord(sc, 0xFA16, 0xF1FD);
2888         MP_WriteMcuAccessRegWord(sc, 0xFA18, 0xFF80);
2889         MP_WriteMcuAccessRegWord(sc, 0xFA1A, 0x4800);
2890         MP_WriteMcuAccessRegWord(sc, 0xFA1C, 0x4801);
2891         MP_WriteMcuAccessRegWord(sc, 0xFA1E, 0xC213);
2892         MP_WriteMcuAccessRegWord(sc, 0xFA20, 0xC313);
2893         MP_WriteMcuAccessRegWord(sc, 0xFA22, 0xE815);
2894         MP_WriteMcuAccessRegWord(sc, 0xFA24, 0x4860);
2895         MP_WriteMcuAccessRegWord(sc, 0xFA26, 0x8EE0);
2896         MP_WriteMcuAccessRegWord(sc, 0xFA28, 0xC210);
2897         MP_WriteMcuAccessRegWord(sc, 0xFA2A, 0xC310);
2898         MP_WriteMcuAccessRegWord(sc, 0xFA2C, 0xE822);
2899         MP_WriteMcuAccessRegWord(sc, 0xFA2E, 0x481E);
2900         MP_WriteMcuAccessRegWord(sc, 0xFA30, 0xC20C);
2901         MP_WriteMcuAccessRegWord(sc, 0xFA32, 0xC30C);
2902         MP_WriteMcuAccessRegWord(sc, 0xFA34, 0xE80C);
2903         MP_WriteMcuAccessRegWord(sc, 0xFA36, 0xC206);
2904         MP_WriteMcuAccessRegWord(sc, 0xFA38, 0x7358);
2905         MP_WriteMcuAccessRegWord(sc, 0xFA3A, 0x483A);
2906         MP_WriteMcuAccessRegWord(sc, 0xFA3C, 0x9B58);
2907         MP_WriteMcuAccessRegWord(sc, 0xFA3E, 0xFF80);
2908         MP_WriteMcuAccessRegWord(sc, 0xFA40, 0xE8E0);
2909         MP_WriteMcuAccessRegWord(sc, 0xFA42, 0xE000);
2910         MP_WriteMcuAccessRegWord(sc, 0xFA44, 0x1008);
2911         MP_WriteMcuAccessRegWord(sc, 0xFA46, 0x0F00);
2912         MP_WriteMcuAccessRegWord(sc, 0xFA48, 0x800C);
2913         MP_WriteMcuAccessRegWord(sc, 0xFA4A, 0x0F00);
2914         MP_WriteMcuAccessRegWord(sc, 0xFA4C, 0xB407);
2915         MP_WriteMcuAccessRegWord(sc, 0xFA4E, 0xB406);
2916         MP_WriteMcuAccessRegWord(sc, 0xFA50, 0xB403);
2917         MP_WriteMcuAccessRegWord(sc, 0xFA52, 0xC7F7);
2918         MP_WriteMcuAccessRegWord(sc, 0xFA54, 0x98E0);
2919         MP_WriteMcuAccessRegWord(sc, 0xFA56, 0x99E2);
2920         MP_WriteMcuAccessRegWord(sc, 0xFA58, 0x9AE4);
2921         MP_WriteMcuAccessRegWord(sc, 0xFA5A, 0x21B2);
2922         MP_WriteMcuAccessRegWord(sc, 0xFA5C, 0x4831);
2923         MP_WriteMcuAccessRegWord(sc, 0xFA5E, 0x483F);
2924         MP_WriteMcuAccessRegWord(sc, 0xFA60, 0x9BE6);
2925         MP_WriteMcuAccessRegWord(sc, 0xFA62, 0x66E7);
2926         MP_WriteMcuAccessRegWord(sc, 0xFA64, 0x49E6);
2927         MP_WriteMcuAccessRegWord(sc, 0xFA66, 0xF1FE);
2928         MP_WriteMcuAccessRegWord(sc, 0xFA68, 0xB003);
2929         MP_WriteMcuAccessRegWord(sc, 0xFA6A, 0xB006);
2930         MP_WriteMcuAccessRegWord(sc, 0xFA6C, 0xB007);
2931         MP_WriteMcuAccessRegWord(sc, 0xFA6E, 0xFF80);
2932         MP_WriteMcuAccessRegWord(sc, 0xFA70, 0xB407);
2933         MP_WriteMcuAccessRegWord(sc, 0xFA72, 0xB406);
2934         MP_WriteMcuAccessRegWord(sc, 0xFA74, 0xB403);
2935         MP_WriteMcuAccessRegWord(sc, 0xFA76, 0xC7E5);
2936         MP_WriteMcuAccessRegWord(sc, 0xFA78, 0x9AE4);
2937         MP_WriteMcuAccessRegWord(sc, 0xFA7A, 0x21B2);
2938         MP_WriteMcuAccessRegWord(sc, 0xFA7C, 0x4831);
2939         MP_WriteMcuAccessRegWord(sc, 0xFA7E, 0x9BE6);
2940         MP_WriteMcuAccessRegWord(sc, 0xFA80, 0x66E7);
2941         MP_WriteMcuAccessRegWord(sc, 0xFA82, 0x49E6);
2942         MP_WriteMcuAccessRegWord(sc, 0xFA84, 0xF1FE);
2943         MP_WriteMcuAccessRegWord(sc, 0xFA86, 0x70E0);
2944         MP_WriteMcuAccessRegWord(sc, 0xFA88, 0x71E2);
2945         MP_WriteMcuAccessRegWord(sc, 0xFA8A, 0xB003);
2946         MP_WriteMcuAccessRegWord(sc, 0xFA8C, 0xB006);
2947         MP_WriteMcuAccessRegWord(sc, 0xFA8E, 0xB007);
2948         MP_WriteMcuAccessRegWord(sc, 0xFA90, 0xFF80);
2949         MP_WriteMcuAccessRegWord(sc, 0xFA92, 0x4882);
2950         MP_WriteMcuAccessRegWord(sc, 0xFA94, 0xB406);
2951         MP_WriteMcuAccessRegWord(sc, 0xFA96, 0xB405);
2952         MP_WriteMcuAccessRegWord(sc, 0xFA98, 0xC71E);
2953         MP_WriteMcuAccessRegWord(sc, 0xFA9A, 0x76E0);
2954         MP_WriteMcuAccessRegWord(sc, 0xFA9C, 0x1D78);
2955         MP_WriteMcuAccessRegWord(sc, 0xFA9E, 0x4175);
2956         MP_WriteMcuAccessRegWord(sc, 0xFAA0, 0x1630);
2957         MP_WriteMcuAccessRegWord(sc, 0xFAA2, 0xF10C);
2958         MP_WriteMcuAccessRegWord(sc, 0xFAA4, 0xC715);
2959         MP_WriteMcuAccessRegWord(sc, 0xFAA6, 0x76E0);
2960         MP_WriteMcuAccessRegWord(sc, 0xFAA8, 0x4861);
2961         MP_WriteMcuAccessRegWord(sc, 0xFAAA, 0x9EE0);
2962         MP_WriteMcuAccessRegWord(sc, 0xFAAC, 0xC713);
2963         MP_WriteMcuAccessRegWord(sc, 0xFAAE, 0x1EFF);
2964         MP_WriteMcuAccessRegWord(sc, 0xFAB0, 0x9EE2);
2965         MP_WriteMcuAccessRegWord(sc, 0xFAB2, 0x75E0);
2966         MP_WriteMcuAccessRegWord(sc, 0xFAB4, 0x4850);
2967         MP_WriteMcuAccessRegWord(sc, 0xFAB6, 0x9DE0);
2968         MP_WriteMcuAccessRegWord(sc, 0xFAB8, 0xE005);
2969         MP_WriteMcuAccessRegWord(sc, 0xFABA, 0xC70B);
2970         MP_WriteMcuAccessRegWord(sc, 0xFABC, 0x76E0);
2971         MP_WriteMcuAccessRegWord(sc, 0xFABE, 0x4865);
2972         MP_WriteMcuAccessRegWord(sc, 0xFAC0, 0x9EE0);
2973         MP_WriteMcuAccessRegWord(sc, 0xFAC2, 0xB005);
2974         MP_WriteMcuAccessRegWord(sc, 0xFAC4, 0xB006);
2975         MP_WriteMcuAccessRegWord(sc, 0xFAC6, 0xC708);
2976         MP_WriteMcuAccessRegWord(sc, 0xFAC8, 0xC102);
2977         MP_WriteMcuAccessRegWord(sc, 0xFACA, 0xB900);
2978         MP_WriteMcuAccessRegWord(sc, 0xFACC, 0x279E);
2979         MP_WriteMcuAccessRegWord(sc, 0xFACE, 0xEB16);
2980         MP_WriteMcuAccessRegWord(sc, 0xFAD0, 0xEB00);
2981         MP_WriteMcuAccessRegWord(sc, 0xFAD2, 0xE43C);
2982         MP_WriteMcuAccessRegWord(sc, 0xFAD4, 0xDC00);
2983         MP_WriteMcuAccessRegWord(sc, 0xFAD6, 0xD3EC);
2984         MP_WriteMcuAccessRegWord(sc, 0xFAD8, 0xC602);
2985         MP_WriteMcuAccessRegWord(sc, 0xFADA, 0xBE00);
2986         MP_WriteMcuAccessRegWord(sc, 0xFADC, 0x0000);
2987         MP_WriteMcuAccessRegWord(sc, 0xFADE, 0xC602);
2988         MP_WriteMcuAccessRegWord(sc, 0xFAE0, 0xBE00);
2989         MP_WriteMcuAccessRegWord(sc, 0xFAE2, 0x0000);
2990
2991         MP_WriteMcuAccessRegWord(sc, 0xFC26, 0x8000);
2992
2993         MP_WriteMcuAccessRegWord(sc, 0xFC28, 0x0000);
2994         MP_WriteMcuAccessRegWord(sc, 0xFC2A, 0x04B4);
2995         MP_WriteMcuAccessRegWord(sc, 0xFC2C, 0x0000);
2996         MP_WriteMcuAccessRegWord(sc, 0xFC2E, 0x0000);
2997         MP_WriteMcuAccessRegWord(sc, 0xFC30, 0x0000);
2998         MP_WriteMcuAccessRegWord(sc, 0xFC32, 0x279C);
2999         MP_WriteMcuAccessRegWord(sc, 0xFC34, 0x0000);
3000         MP_WriteMcuAccessRegWord(sc, 0xFC36, 0x0000);
3001
3002         MP_WriteMcuAccessRegWord(sc, 0xFC38, 0x0022);
3003 }
3004
3005 static void re_hw_mac_mcu_config(struct re_softc *sc)
3006 {
3007         switch(sc->re_type) {
3008         case MACFG_56:
3009                 re_set_mac_mcu_8168g_1(sc);
3010                 break;
3011         case MACFG_58:
3012                 re_set_mac_mcu_8168gu_1(sc);
3013                 break;
3014         case MACFG_59:
3015                 re_set_mac_mcu_8168gu_2(sc);
3016                 break;
3017         case MACFG_60:
3018                 re_set_mac_mcu_8411b_1(sc);
3019                 break;
3020         case MACFG_62:
3021                 re_set_mac_mcu_8168ep_1(sc);
3022                 break;
3023         case MACFG_67:
3024                 re_set_mac_mcu_8168ep_2(sc);
3025                 break;
3026         case MACFG_68:
3027         case MACFG_69:
3028                 re_set_mac_mcu_8168h_1(sc);
3029                 break;
3030         case MACFG_70:
3031                 if (sc->HwPkgDet == 0x00 || sc->HwPkgDet == 0x0F)
3032                         re_set_mac_mcu_8168fp_1(sc);
3033                 else if (sc->HwPkgDet == 0x06)
3034                         re_set_mac_mcu_8168fp_2(sc);
3035                 break;
3036         case MACFG_71:
3037                 DisableMcuBPs(sc);
3038                 break;
3039         }
3040 }
3041
3042 #define ISRIMR_DASH_TYPE2_TX_DISABLE_IDLE BIT_5
3043 static void Dash2DisableTx(struct re_softc *sc)
3044 {
3045         //if (!sc->re_dash) return;
3046
3047         if (HW_DASH_SUPPORT_TYPE_2(sc) || HW_DASH_SUPPORT_TYPE_3(sc)) {
3048                 u_int16_t WaitCnt;
3049                 u_int8_t TmpUchar;
3050
3051                 //Disable oob Tx
3052                 RE_CMAC_WRITE_1(sc, RE_CMAC_IBCR2, RE_CMAC_READ_1(sc, RE_CMAC_IBCR2) & ~(BIT_0));
3053                 WaitCnt = 0;
3054
3055                 //wait oob tx disable
3056                 do {
3057                         TmpUchar = RE_CMAC_READ_1(sc, RE_CMAC_IBISR0);
3058
3059                         if (TmpUchar & ISRIMR_DASH_TYPE2_TX_DISABLE_IDLE) {
3060                                 break;
3061                         }
3062
3063                         DELAY(50);
3064                         WaitCnt++;
3065                 } while(WaitCnt < 2000);
3066
3067                 //Clear ISRIMR_DASH_TYPE2_TX_DISABLE_IDLE
3068                 RE_CMAC_WRITE_1(sc, RE_CMAC_IBISR0, RE_CMAC_READ_1(sc, RE_CMAC_IBISR0) | ISRIMR_DASH_TYPE2_TX_DISABLE_IDLE);
3069         }
3070 }
3071
3072 static void Dash2DisableRx(struct re_softc *sc)
3073 {
3074         //if (!sc->re_dash) return;
3075
3076         if (HW_DASH_SUPPORT_TYPE_2(sc) || HW_DASH_SUPPORT_TYPE_3(sc)) {
3077                 RE_CMAC_WRITE_1(sc, RE_CMAC_IBCR0, RE_CMAC_READ_1(sc, RE_CMAC_IBCR0) & ~(BIT_0));
3078         }
3079 }
3080
3081 static void Dash2DisableTxRx(struct re_softc *sc)
3082 {
3083         if (HW_DASH_SUPPORT_TYPE_2(sc) || HW_DASH_SUPPORT_TYPE_3(sc)) {
3084                 Dash2DisableTx(sc);
3085                 Dash2DisableRx(sc);
3086         }
3087 }
3088
3089 static inline bool
3090 is_zero_ether_addr(const u_int8_t * addr)
3091 {
3092         return ((addr[0] + addr[1] + addr[2] + addr[3] + addr[4] + addr[5]) == 0x00);
3093 }
3094
3095 static inline bool
3096 is_multicast_ether_addr(const u_int8_t * addr)
3097 {
3098         return (0x01 & addr[0]);
3099 }
3100
3101 /*
3102 static inline bool
3103 is_broadcast_ether_addr(const u_int8_t * addr)
3104 {
3105         return ((addr[0] + addr[1] + addr[2] + addr[3] + addr[4] + addr[5]) == (6 * 0xff));
3106 }
3107 */
3108
3109 static inline bool
3110 is_valid_ether_addr(const u_int8_t * addr)
3111 {
3112         return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr);
3113 }
3114
3115 static inline void
3116 random_ether_addr(u_int8_t * dst)
3117 {
3118 #ifndef __DragonFly__
3119         if (read_random(dst, 6) == 0)
3120                 arc4rand(dst, 6, 0);
3121 #else
3122         karc4rand(dst, 6);
3123 #endif
3124
3125         dst[0] &= 0xfe;
3126         dst[0] |= 0x02;
3127 }
3128
3129 static void re_disable_now_is_oob(struct re_softc *sc)
3130 {
3131         if (sc->re_hw_supp_now_is_oob_ver == 1)
3132                 CSR_WRITE_1(sc, RE_MCU_CMD, CSR_READ_1(sc, RE_MCU_CMD) & ~RE_NOW_IS_OOB);
3133 }
3134
3135 static void re_exit_oob(struct re_softc *sc)
3136 {
3137         u_int16_t data16;
3138         int i;
3139
3140         re_disable_cfg9346_write(sc);
3141
3142         switch(sc->re_type) {
3143         case MACFG_61:
3144         case MACFG_62:
3145         case MACFG_67:
3146         case MACFG_70:
3147         case MACFG_71:
3148                 Dash2DisableTxRx(sc);
3149                 break;
3150         }
3151
3152         if (sc->re_dash)
3153                 re_driver_start(sc);
3154
3155         switch(sc->re_type) {
3156         case MACFG_56:
3157         case MACFG_57:
3158         case MACFG_58:
3159         case MACFG_59:
3160         case MACFG_60:
3161         case MACFG_61:
3162         case MACFG_62:
3163         case MACFG_67:
3164         case MACFG_68:
3165         case MACFG_69:
3166         case MACFG_70:
3167         case MACFG_71:
3168                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) | BIT_3);
3169                 DELAY(2000);
3170
3171                 for (i = 0; i < 10; i++) {
3172                         DELAY(100);
3173                         if (CSR_READ_4(sc, RE_TXCFG) & BIT_11)
3174                                 break;
3175                 }
3176
3177                 if (CSR_READ_1(sc, RE_COMMAND) & (RE_CMD_TX_ENB | RE_CMD_RX_ENB)) {
3178                         DELAY(100);
3179                         CSR_WRITE_1(sc, RE_COMMAND, CSR_READ_1(sc, RE_COMMAND) & ~(RE_CMD_TX_ENB | RE_CMD_RX_ENB));
3180                 }
3181
3182                 for (i = 0; i < 10; i++) {
3183                         DELAY(100);
3184                         if ((CSR_READ_1(sc, RE_MCU_CMD) & (RE_TXFIFO_EMPTY | RE_RXFIFO_EMPTY)) == (RE_TXFIFO_EMPTY | RE_RXFIFO_EMPTY))
3185                                 break;
3186
3187                 }
3188                 break;
3189         }
3190
3191         //Disable realwow function
3192         switch (sc->re_type) {
3193         case MACFG_50:
3194         case MACFG_51:
3195                 CSR_WRITE_4(sc, RE_MCUACCESS, 0xE5A90000);
3196                 CSR_WRITE_4(sc, RE_MCUACCESS, 0xF2100010);
3197                 break;
3198         case MACFG_52:
3199                 CSR_WRITE_4(sc, RE_MCUACCESS, 0xE5A90000);
3200                 CSR_WRITE_4(sc, RE_MCUACCESS, 0xE4640000);
3201                 CSR_WRITE_4(sc, RE_MCUACCESS, 0xF2100010);
3202                 break;
3203         case MACFG_56:
3204         case MACFG_57:
3205                 CSR_WRITE_4(sc, RE_MCUACCESS, 0x605E0000);
3206                 CSR_WRITE_4(sc, RE_MCUACCESS, (0xE05E << 16) | (CSR_READ_4(sc, RE_MCUACCESS) & 0xFFFE));
3207                 CSR_WRITE_4(sc, RE_MCUACCESS, 0xE9720000);
3208                 CSR_WRITE_4(sc, RE_MCUACCESS, 0xF2140010);
3209                 break;
3210         case MACFG_60:
3211                 CSR_WRITE_4(sc, RE_MCUACCESS, 0xE05E00FF);
3212                 CSR_WRITE_4(sc, RE_MCUACCESS, 0xE9720000);
3213                 MP_WriteMcuAccessRegWord(sc, 0xE428, 0x0010);
3214                 break;
3215         }
3216
3217         if (sc->re_hw_supp_now_is_oob_ver >0)
3218                 re_disable_now_is_oob(sc);
3219
3220         switch(sc->re_type) {
3221         case MACFG_52:
3222                 for (i = 0; i < 10; i++) {
3223                         DELAY(100);
3224                         if (CSR_READ_2(sc, 0xD2) & BIT_9)
3225                                 break;
3226                 }
3227
3228                 data16 = MP_ReadMcuAccessRegWord(sc, 0xD4DE) | BIT_15;
3229                 MP_WriteMcuAccessRegWord(sc, 0xD4DE, data16);
3230
3231                 for (i = 0; i < 10; i++) {
3232                         DELAY(100);
3233                         if (CSR_READ_2(sc, 0xD2) & BIT_9)
3234                                 break;
3235                 }
3236                 break;
3237         case MACFG_56:
3238         case MACFG_57:
3239         case MACFG_58:
3240         case MACFG_59:
3241         case MACFG_60:
3242         case MACFG_61:
3243         case MACFG_62:
3244         case MACFG_67:
3245         case MACFG_68:
3246         case MACFG_69:
3247         case MACFG_70:
3248         case MACFG_71:
3249                 data16 = MP_ReadMcuAccessRegWord(sc, 0xE8DE) & ~BIT_14;
3250                 MP_WriteMcuAccessRegWord(sc, 0xE8DE, data16);
3251                 for (i = 0; i < 10; i++) {
3252                         DELAY(100);
3253                         if (CSR_READ_2(sc, 0xD2) & BIT_9)
3254                                 break;
3255                 }
3256
3257                 data16 = MP_ReadMcuAccessRegWord(sc, 0xE8DE) | BIT_15;
3258                 MP_WriteMcuAccessRegWord(sc, 0xE8DE, data16);
3259
3260                 for (i = 0; i < 10; i++) {
3261                         DELAY(100);
3262                         if (CSR_READ_2(sc, 0xD2) & BIT_9)
3263                                 break;
3264                 }
3265                 break;
3266         }
3267
3268         //wait ups resume (phy state 2)
3269         switch(sc->re_type) {
3270         case MACFG_68:
3271         case MACFG_69:
3272         case MACFG_70:
3273         case MACFG_71:
3274                 if (re_is_ups_resume(sc)) {
3275                         re_wait_phy_ups_resume(sc, 2);
3276                         re_clear_ups_resume_bit(sc);
3277                 }
3278                 break;
3279         };
3280
3281         /*
3282         * Config MAC MCU
3283         */
3284         re_hw_mac_mcu_config(sc);
3285 }
3286
3287 static void re_hw_init(struct re_softc *sc)
3288 {
3289         /*
3290         * disable EDT.
3291         */
3292         switch(sc->re_type) {
3293         case MACFG_16:
3294         case MACFG_17:
3295         case MACFG_18:
3296         case MACFG_19:
3297         case MACFG_41:
3298                 CSR_WRITE_1(sc, 0xF4, CSR_READ_1(sc, 0xF4) & ~(BIT_0|BIT_1));
3299                 break;
3300         case MACFG_36:
3301         case MACFG_37:
3302         case MACFG_38:
3303         case MACFG_39:
3304         case MACFG_42:
3305         case MACFG_43:
3306         case MACFG_50:
3307         case MACFG_51:
3308         case MACFG_54:
3309         case MACFG_55:
3310                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) & ~(BIT_0|BIT_1|BIT_2));
3311                 break;
3312         }
3313
3314         switch(sc->re_type) {
3315         case MACFG_5:
3316                 if (CSR_READ_1(sc, RE_CFG2) & 1) {
3317                         CSR_WRITE_4(sc, 0x7C, 0x000FFFFF);
3318                 } else {
3319                         CSR_WRITE_4(sc, 0x7C, 0x000FFF00);
3320                 }
3321                 break;
3322         case MACFG_6:
3323                 if (CSR_READ_1(sc, RE_CFG2) & 1) {
3324                         CSR_WRITE_4(sc, 0x7C, 0x003FFFFF);
3325                 } else {
3326                         CSR_WRITE_4(sc, 0x7C, 0x003FFF00);
3327                 }
3328                 break;
3329         }
3330
3331         switch(sc->re_type) {
3332         case MACFG_33:
3333         case MACFG_36:
3334         case MACFG_37:
3335                 CSR_WRITE_1(sc, 0xF3, CSR_READ_1(sc, 0xF3) | BIT_2);
3336                 break;
3337         }
3338
3339         switch(sc->re_type) {
3340         case MACFG_36:
3341         case MACFG_37:
3342         case MACFG_38:
3343         case MACFG_39:
3344         case MACFG_42:
3345         case MACFG_43:
3346         case MACFG_50:
3347         case MACFG_51:
3348         case MACFG_52:
3349         case MACFG_53:
3350         case MACFG_54:
3351         case MACFG_55:
3352         case MACFG_56:
3353         case MACFG_57:
3354         case MACFG_58:
3355         case MACFG_59:
3356         case MACFG_60:
3357         case MACFG_61:
3358         case MACFG_62:
3359         case MACFG_67:
3360         case MACFG_68:
3361         case MACFG_69:
3362         case MACFG_70:
3363         case MACFG_71:
3364                 re_enable_cfg9346_write(sc);
3365                 CSR_WRITE_1(sc, RE_CFG5, CSR_READ_1(sc, RE_CFG5) & ~BIT_0);
3366                 CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) & ~BIT_7);
3367                 CSR_WRITE_1(sc, 0xF1, CSR_READ_1(sc, 0xF1) & ~ BIT_7);
3368                 CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) | BIT_5);
3369                 re_disable_cfg9346_write(sc);
3370                 break;
3371         }
3372
3373         if (sc->re_if_flags & RL_FLAG_PCIE) {
3374                 uint32_t Data32;
3375                 //Set PCIE uncorrectable error status mask pcie 0x108
3376                 Data32 = MP_ReadPciEConfigSpace(sc, 0xF108);
3377                 Data32 |= BIT_20;
3378                 MP_WritePciEConfigSpace(sc, 0xF108, Data32);
3379         }
3380 }
3381
3382 static void re_rar_set(struct re_softc *sc, u_int8_t *eaddr)
3383 {
3384         re_enable_cfg9346_write(sc);
3385
3386         CSR_WRITE_4(sc, RE_IDR0,
3387                     htole32(*(u_int32_t *)(&eaddr[0])));
3388         CSR_WRITE_2(sc, RE_IDR4,
3389                     htole16(*(u_int32_t *)(&eaddr[4])));
3390
3391         switch (sc->re_type) {
3392         case MACFG_36:
3393         case MACFG_37:
3394         case MACFG_42:
3395         case MACFG_43:
3396         case MACFG_54:
3397         case MACFG_55:
3398                 CSR_WRITE_4(sc, RE_SecMAC0,
3399                             htole32(*(u_int32_t *)(&eaddr[0])));
3400                 CSR_WRITE_2(sc, RE_SecMAC4,
3401                             htole16(*(u_int16_t *)(&eaddr[4])));
3402                 break;
3403         }
3404
3405         switch (sc->re_type) {
3406         case MACFG_38:
3407         case MACFG_39:
3408                 re_eri_write(sc, 0xF0, 4, *(u_int16_t *)(&eaddr[0])<<16, ERIAR_ExGMAC);
3409                 re_eri_write(sc, 0xF4, 4, *(u_int32_t *)(&eaddr[2]), ERIAR_ExGMAC);
3410                 break;
3411         }
3412
3413         re_disable_cfg9346_write(sc);
3414 }
3415
3416 static void re_get_hw_mac_address(struct re_softc *sc, u_int8_t *eaddr)
3417 {
3418         device_t dev = sc->dev;
3419         u_int16_t re_eeid = 0;
3420         int i;
3421
3422         for (i = 0; i < ETHER_ADDR_LEN; i++)
3423                 eaddr[i] = CSR_READ_1(sc, RE_IDR0 + i);
3424
3425         switch(sc->re_type) {
3426         case MACFG_50:
3427         case MACFG_51:
3428         case MACFG_52:
3429         case MACFG_53:
3430         case MACFG_56:
3431         case MACFG_57:
3432         case MACFG_58:
3433         case MACFG_59:
3434         case MACFG_60:
3435         case MACFG_61:
3436         case MACFG_62:
3437         case MACFG_67:
3438         case MACFG_68:
3439         case MACFG_69:
3440         case MACFG_70:
3441         case MACFG_71:
3442                 *(u_int32_t *)&eaddr[0] = re_eri_read(sc, 0xE0, 4, ERIAR_ExGMAC);
3443                 *(u_int16_t *)&eaddr[4] = (u_int16_t)re_eri_read(sc, 0xE4, 4, ERIAR_ExGMAC);
3444                 break;
3445         case MACFG_63:
3446         case MACFG_64:
3447         case MACFG_65:
3448         case MACFG_66:
3449                 break;
3450         default:
3451                 re_read_eeprom(sc, (caddr_t)&re_eeid, RE_EE_ID, 1, 0);
3452                 if (re_eeid == 0x8129)
3453                         re_read_eeprom(sc, (caddr_t)&eaddr[0], RE_EE_EADDR, 3, 0);
3454                 break;
3455         }
3456
3457         if (!is_valid_ether_addr(eaddr)) {
3458 #ifndef __DragonFly__
3459                 device_printf(dev,"Invalid ether addr: %6D\n", eaddr, ":");
3460 #else
3461                 device_printf(dev, "Invalid ether addr: "
3462                     "%02x:%02x:%02x:%02x:%02x:%02x\n",
3463                     eaddr[0], eaddr[1], eaddr[2], eaddr[3], eaddr[4], eaddr[5]);
3464 #endif
3465                 random_ether_addr(eaddr);
3466 #ifndef __DragonFly__
3467                 device_printf(dev,"Random ether addr: %6D\n", eaddr, ":");
3468 #else
3469                 device_printf(dev, "Random ether addr: "
3470                     "%02x:%02x:%02x:%02x:%02x:%02x\n",
3471                     eaddr[0], eaddr[1], eaddr[2], eaddr[3], eaddr[4], eaddr[5]);
3472 #endif
3473         }
3474
3475         re_rar_set(sc, eaddr);
3476 }
3477
3478 static int re_check_mac_version(struct re_softc *sc)
3479 {
3480         device_t dev = sc->dev;
3481         int error = 0;
3482
3483         switch(CSR_READ_4(sc, RE_TXCFG) & 0xFCF00000) {
3484         case 0x00800000:
3485         case 0x04000000:
3486                 sc->re_type = MACFG_3;
3487                 sc->max_jumbo_frame_size = Jumbo_Frame_7k;
3488                 CSR_WRITE_4(sc, RE_RXCFG, 0xFF00);
3489                 break;
3490         case 0x10000000:
3491                 sc->re_type = MACFG_4;
3492                 sc->max_jumbo_frame_size = Jumbo_Frame_7k;
3493                 CSR_WRITE_4(sc, RE_RXCFG, 0xFF00);
3494                 break;
3495         case 0x18000000:
3496                 sc->re_type = MACFG_5;
3497                 sc->max_jumbo_frame_size = Jumbo_Frame_7k;
3498                 CSR_WRITE_4(sc, RE_RXCFG, 0xFF00);
3499                 break;
3500         case 0x98000000:
3501                 sc->re_type = MACFG_6;
3502                 sc->max_jumbo_frame_size = Jumbo_Frame_7k;
3503                 CSR_WRITE_4(sc, RE_RXCFG, 0xFF00);
3504                 break;
3505         case 0x34000000:
3506         case 0xB4000000:
3507                 sc->re_type = MACFG_11;
3508                 sc->max_jumbo_frame_size = ETHERMTU;
3509                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
3510                 break;
3511         case 0x34200000:
3512         case 0xB4200000:
3513                 sc->re_type = MACFG_12;
3514                 sc->max_jumbo_frame_size = ETHERMTU;
3515                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
3516                 break;
3517         case 0x34300000:
3518         case 0xB4300000:
3519                 sc->re_type = MACFG_13;
3520                 sc->max_jumbo_frame_size = ETHERMTU;
3521                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
3522                 break;
3523         case 0x34900000:
3524         case 0x24900000:
3525                 sc->re_type = MACFG_14;
3526                 sc->max_jumbo_frame_size = ETHERMTU;
3527                 sc->re_if_flags |= RL_FLAG_DESCV2;
3528                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
3529                 break;
3530         case 0x34A00000:
3531         case 0x24A00000:
3532                 sc->re_type = MACFG_15;
3533                 sc->max_jumbo_frame_size = ETHERMTU;
3534                 sc->re_if_flags |= RL_FLAG_DESCV2;
3535                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
3536                 break;
3537         case 0x34B00000:
3538         case 0x24B00000:
3539                 sc->re_type = MACFG_16;
3540                 sc->max_jumbo_frame_size = ETHERMTU;
3541                 sc->re_if_flags |= RL_FLAG_DESCV2;
3542                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
3543                 break;
3544         case 0x34C00000:
3545         case 0x24C00000:
3546                 sc->re_type = MACFG_17;
3547                 sc->max_jumbo_frame_size = ETHERMTU;
3548                 sc->re_if_flags |= RL_FLAG_DESCV2;
3549                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
3550                 break;
3551         case 0x34D00000:
3552         case 0x24D00000:
3553                 sc->re_type = MACFG_18;
3554                 sc->max_jumbo_frame_size = ETHERMTU;
3555                 sc->re_if_flags |= RL_FLAG_DESCV2;
3556                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
3557                 break;
3558         case 0x34E00000:
3559         case 0x24E00000:
3560                 sc->re_type = MACFG_19;
3561                 sc->max_jumbo_frame_size = ETHERMTU;
3562                 sc->re_if_flags |= RL_FLAG_DESCV2;
3563                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
3564                 break;
3565         case 0x30000000:
3566                 sc->re_type = MACFG_21;
3567                 sc->max_jumbo_frame_size = Jumbo_Frame_4k;
3568                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
3569                 break;
3570         case 0x38000000:
3571                 sc->re_type = MACFG_22;
3572                 sc->max_jumbo_frame_size = Jumbo_Frame_4k;
3573                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
3574                 break;
3575         case 0x38500000:
3576         case 0xB8500000:
3577         case 0x38700000:
3578         case 0xB8700000:
3579                 sc->re_type = MACFG_23;
3580                 sc->max_jumbo_frame_size = Jumbo_Frame_4k;
3581                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
3582                 break;
3583         case 0x3C000000:
3584                 sc->re_type = MACFG_24;
3585                 sc->max_jumbo_frame_size = Jumbo_Frame_6k;
3586                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
3587                 CSR_WRITE_4(sc, RE_RXCFG, 0xC700);
3588                 break;
3589         case 0x3C200000:
3590                 sc->re_type = MACFG_25;
3591                 sc->max_jumbo_frame_size = Jumbo_Frame_6k;
3592                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
3593                 CSR_WRITE_4(sc, RE_RXCFG, 0xC700);
3594                 break;
3595         case 0x3C400000:
3596                 sc->re_type = MACFG_26;
3597                 sc->max_jumbo_frame_size = Jumbo_Frame_6k;
3598                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
3599                 CSR_WRITE_4(sc, RE_RXCFG, 0xC700);
3600                 break;
3601         case 0x3C900000:
3602                 sc->re_type = MACFG_27;
3603                 sc->max_jumbo_frame_size = Jumbo_Frame_6k;
3604                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
3605                 CSR_WRITE_4(sc, RE_RXCFG, 0xC700);
3606                 break;
3607         case 0x3CB00000:
3608                 sc->re_type = MACFG_28;
3609                 sc->max_jumbo_frame_size = Jumbo_Frame_6k;
3610                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
3611                 CSR_WRITE_4(sc, RE_RXCFG, 0xC700);
3612                 break;
3613         case 0x28100000:
3614                 sc->re_type = MACFG_31;
3615                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3616                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
3617                 CSR_WRITE_4(sc, RE_RXCFG, 0x8700);
3618                 break;
3619         case 0x28200000:
3620                 sc->re_type = MACFG_32;
3621                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3622                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
3623                 CSR_WRITE_4(sc, RE_RXCFG, 0x8700);
3624                 break;
3625         case 0x28300000:
3626                 sc->re_type = MACFG_33;
3627                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3628                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
3629                 CSR_WRITE_4(sc, RE_RXCFG, 0x8700);
3630                 break;
3631         case 0x2C100000:
3632                 sc->re_type = MACFG_36;
3633                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3634                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
3635                 CSR_WRITE_4(sc, RE_RXCFG, 0x8700);
3636                 break;
3637         case 0x2C200000:
3638                 sc->re_type = MACFG_37;
3639                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3640                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
3641                 CSR_WRITE_4(sc, RE_RXCFG, 0x8700);
3642                 break;
3643         case 0x2C800000:
3644                 sc->re_type = MACFG_38;
3645                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3646                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
3647                 CSR_WRITE_4(sc, RE_RXCFG, 0xBF00);
3648                 break;
3649         case 0x2C900000:
3650                 sc->re_type = MACFG_39;
3651                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3652                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
3653                 CSR_WRITE_4(sc, RE_RXCFG, 0xBF00);
3654                 break;
3655         case 0x24000000:
3656                 sc->re_type = MACFG_41;
3657                 sc->max_jumbo_frame_size = ETHERMTU;
3658                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
3659                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
3660                 break;
3661         case 0x40900000:
3662                 sc->re_type = MACFG_42;
3663                 sc->max_jumbo_frame_size = ETHERMTU;
3664                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
3665                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
3666                 break;
3667         case 0x40A00000:
3668         case 0x40B00000:
3669         case 0x40C00000:
3670                 sc->re_type = MACFG_43;
3671                 sc->max_jumbo_frame_size = ETHERMTU;
3672                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
3673                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
3674                 break;
3675         case 0x48000000:
3676                 sc->re_type = MACFG_50;
3677                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3678                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
3679                 CSR_WRITE_4(sc, RE_RXCFG, 0xBF00);
3680                 break;
3681         case 0x48100000:
3682                 sc->re_type = MACFG_51;
3683                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3684                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
3685                 CSR_WRITE_4(sc, RE_RXCFG, 0xBF00);
3686                 break;
3687         case 0x48800000:
3688                 sc->re_type = MACFG_52;
3689                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3690                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
3691                 CSR_WRITE_4(sc, RE_RXCFG, 0xBF00);
3692                 break;
3693         case 0x44000000:
3694                 sc->re_type = MACFG_53;
3695                 sc->max_jumbo_frame_size = ETHERMTU;
3696                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
3697                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
3698                 break;
3699         case 0x44800000:
3700                 sc->re_type = MACFG_54;
3701                 sc->max_jumbo_frame_size = ETHERMTU;
3702                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
3703                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
3704                 break;
3705         case 0x44900000:
3706                 sc->re_type = MACFG_55;
3707                 sc->max_jumbo_frame_size = ETHERMTU;
3708                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
3709                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
3710                 break;
3711         case 0x4C000000:
3712                 sc->re_type = MACFG_56;
3713                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3714                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
3715                 CSR_WRITE_4(sc, RE_RXCFG, 0xCF00);
3716                 break;
3717         case 0x4C100000:
3718                 sc->re_type = MACFG_57;
3719                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3720                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
3721                 CSR_WRITE_4(sc, RE_RXCFG, 0xCF00);
3722                 break;
3723         case 0x50800000:
3724                 sc->re_type = MACFG_58;
3725                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3726                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
3727                 CSR_WRITE_4(sc, RE_RXCFG, 0xCF00);
3728                 break;
3729         case 0x50900000:
3730                 sc->re_type = MACFG_59;
3731                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3732                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
3733                 CSR_WRITE_4(sc, RE_RXCFG, 0xCF00);
3734                 break;
3735         case 0x5C800000:
3736                 sc->re_type = MACFG_60;
3737                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3738                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
3739                 CSR_WRITE_4(sc, RE_RXCFG, 0xCF00);
3740                 break;
3741         case 0x50000000:
3742                 sc->re_type = MACFG_61;
3743                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3744                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
3745                 CSR_WRITE_4(sc, RE_RXCFG, 0xCF00);
3746                 break;
3747         case 0x50100000:
3748                 sc->re_type = MACFG_62;
3749                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3750                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
3751                 CSR_WRITE_4(sc, RE_RXCFG, 0xCF00);
3752                 break;
3753         case 0x50200000:
3754                 sc->re_type = MACFG_67;
3755                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3756                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
3757                 CSR_WRITE_4(sc, RE_RXCFG, 0xCF00);
3758                 break;
3759         case 0x28800000:
3760                 sc->re_type = MACFG_63;
3761                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3762                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
3763                 CSR_WRITE_4(sc, RE_RXCFG, 0x8700);
3764                 break;
3765         case 0x28900000:
3766                 sc->re_type = MACFG_64;
3767                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3768                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
3769                 CSR_WRITE_4(sc, RE_RXCFG, 0x8700);
3770                 break;
3771         case 0x28A00000:
3772                 sc->re_type = MACFG_65;
3773                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3774                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
3775                 CSR_WRITE_4(sc, RE_RXCFG, 0x8700);
3776                 break;
3777         case 0x28B00000:
3778                 sc->re_type = MACFG_66;
3779                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3780                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
3781                 CSR_WRITE_4(sc, RE_RXCFG, 0x8700);
3782                 break;
3783         case 0x54000000:
3784                 sc->re_type = MACFG_68;
3785                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3786                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
3787                 CSR_WRITE_4(sc, RE_RXCFG, 0xCF00);
3788                 break;
3789         case 0x54100000:
3790                 sc->re_type = MACFG_69;
3791                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3792                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
3793                 CSR_WRITE_4(sc, RE_RXCFG, 0xCF00);
3794                 break;
3795         case 0x54900000:
3796                 sc->re_type = MACFG_70;
3797                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3798                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
3799                 CSR_WRITE_4(sc, RE_RXCFG, 0xCF00);
3800                 break;
3801         case 0x54A00000:
3802                 sc->re_type = MACFG_71;
3803                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
3804                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
3805                 CSR_WRITE_4(sc, RE_RXCFG, 0xCF00);
3806                 break;
3807         default:
3808                 device_printf(dev,"unknown device\n");
3809                 sc->re_type = MACFG_FF;
3810                 error = ENXIO;
3811                 break;
3812         }
3813
3814         switch(sc->re_device_id) {
3815         case RT_DEVICEID_8169:
3816         case RT_DEVICEID_8169SC:
3817         case RT_DEVICEID_8168:
3818         case RT_DEVICEID_8161:
3819                 //do nothing
3820                 break;
3821         default:
3822                 sc->max_jumbo_frame_size = ETHERMTU;
3823                 break;
3824         }
3825
3826         return error;
3827 }
3828
3829 static void re_init_software_variable(struct re_softc *sc)
3830 {
3831         switch(sc->re_device_id) {
3832         case RT_DEVICEID_8168:
3833         case RT_DEVICEID_8161:
3834         case RT_DEVICEID_8136:
3835                 sc->re_if_flags |= RL_FLAG_PCIE;
3836                 break;
3837         }
3838
3839         sc->re_rx_mbuf_sz = sc->max_jumbo_frame_size + ETHER_VLAN_ENCAP_LEN + ETHER_HDR_LEN + ETHER_CRC_LEN + RE_ETHER_ALIGN + 1;
3840
3841         if (sc->re_rx_mbuf_sz > MJUM9BYTES) {
3842                 sc->max_jumbo_frame_size -= (sc->re_rx_mbuf_sz - MJUM9BYTES);
3843                 sc->re_rx_mbuf_sz = MJUM9BYTES;
3844         }
3845
3846         switch(sc->re_type) {
3847         case MACFG_63:
3848         case MACFG_64:
3849         case MACFG_65:
3850         case MACFG_66:
3851                 sc->HwSuppDashVer = 1;
3852                 break;
3853         case MACFG_61:
3854         case MACFG_62:
3855         case MACFG_67:
3856                 sc->HwSuppDashVer = 2;
3857                 break;
3858         case MACFG_70:
3859         case MACFG_71:
3860                 sc->HwSuppDashVer = 3;
3861                 break;
3862         default:
3863                 sc->HwSuppDashVer = 0;
3864                 break;
3865         }
3866
3867         switch(sc->re_type) {
3868         case MACFG_70:
3869         case MACFG_71:
3870                 sc->HwPkgDet = MP_ReadMcuAccessRegWord(sc, 0xDC00);
3871                 sc->HwPkgDet = (sc->HwPkgDet >> 3) & 0x0F;
3872                 //printf("Realtek PCIe GBE Family Controller HwPkgDet = 0x%02X\n",
3873                 //       sc->HwPkgDet);
3874                 break;
3875         }
3876
3877         if (HW_DASH_SUPPORT_TYPE_3(sc) && sc->HwPkgDet == 0x06)
3878                 eee_enable = 0;
3879
3880         if (HW_DASH_SUPPORT_DASH(sc))
3881                 sc->re_dash = re_check_dash(sc);
3882
3883         if (sc->re_dash) {
3884                 if (HW_DASH_SUPPORT_TYPE_3(sc)) {
3885                         u_int64_t CmacMemPhysAddress;
3886                         bus_space_handle_t cmac_ioaddr;
3887
3888                         CmacMemPhysAddress = MP_ReadOtherFunPciEConfigSpace(sc, 0, 0xf018);
3889                         if (!(CmacMemPhysAddress & BIT_0)) {
3890                                 if (CmacMemPhysAddress & BIT_2)
3891                                         CmacMemPhysAddress |=  MP_ReadOtherFunPciEConfigSpace(sc, 0, 0xf01c) << 16;
3892
3893                                 CmacMemPhysAddress &=  0xFFFFFFF0;
3894                                 /* ioremap MMIO region */
3895 #ifndef __DragonFly__
3896                                 sc->re_mapped_cmac_tag = X86_BUS_SPACE_MEM;
3897 #else
3898                                 sc->re_mapped_cmac_tag = X86_64_BUS_SPACE_MEM;
3899 #endif
3900                                 if (bus_space_map(sc->re_mapped_cmac_tag, CmacMemPhysAddress, RE_REGS_SIZE, 0,
3901                                                   &cmac_ioaddr))
3902                                         sc->re_dash = 0;
3903                                 else
3904                                         sc->re_mapped_cmac_handle = cmac_ioaddr;
3905                         }
3906                 }
3907         }
3908
3909         switch(sc->re_type) {
3910         case MACFG_61:
3911         case MACFG_62:
3912         case MACFG_67:
3913                 sc->re_cmac_handle = sc->re_bhandle;
3914                 sc->re_cmac_tag = sc->re_btag;
3915                 break;
3916         case MACFG_70:
3917         case MACFG_71:
3918                 sc->re_cmac_handle = sc->re_mapped_cmac_handle;
3919                 sc->re_cmac_tag = sc->re_mapped_cmac_tag;
3920                 break;
3921         }
3922
3923         switch(sc->re_type) {
3924         case MACFG_14:
3925         case MACFG_15:
3926         case MACFG_16:
3927         case MACFG_17:
3928         case MACFG_18:
3929         case MACFG_19:
3930         case MACFG_31:
3931         case MACFG_32:
3932         case MACFG_33:
3933         case MACFG_41:
3934         case MACFG_63:
3935         case MACFG_64:
3936         case MACFG_65:
3937         case MACFG_66:
3938                 sc->re_efuse_ver = EFUSE_SUPPORT_V1;
3939                 break;
3940         case MACFG_36:
3941         case MACFG_37:
3942         case MACFG_42:
3943         case MACFG_43:
3944         case MACFG_54:
3945         case MACFG_55:
3946                 sc->re_efuse_ver = EFUSE_SUPPORT_V2;
3947                 break;
3948         case MACFG_38:
3949         case MACFG_39:
3950         case MACFG_50:
3951         case MACFG_51:
3952         case MACFG_52:
3953         case MACFG_53:
3954         case MACFG_56:
3955         case MACFG_57:
3956         case MACFG_58:
3957         case MACFG_59:
3958         case MACFG_60:
3959         case MACFG_61:
3960         case MACFG_62:
3961         case MACFG_67:
3962         case MACFG_68:
3963         case MACFG_69:
3964         case MACFG_70:
3965         case MACFG_71:
3966                 sc->re_efuse_ver = EFUSE_SUPPORT_V3;
3967                 break;
3968         default:
3969                 sc->re_efuse_ver = EFUSE_NOT_SUPPORT;
3970                 break;
3971         }
3972
3973         switch(sc->re_type) {
3974         case MACFG_69: {
3975                 u_int16_t ioffset_p3, ioffset_p2, ioffset_p1, ioffset_p0;
3976                 u_int16_t TmpUshort;
3977
3978                 MP_WriteMcuAccessRegWord(sc, 0xDD02, 0x807D);
3979
3980                 TmpUshort = MP_ReadMcuAccessRegWord(sc, 0xDD02);
3981                 ioffset_p3 = ((TmpUshort & BIT_7) >>7);
3982                 ioffset_p3 <<= 3;
3983                 TmpUshort = MP_ReadMcuAccessRegWord(sc, 0xDD00);
3984
3985                 ioffset_p3 |= ((TmpUshort & (BIT_15 | BIT_14 | BIT_13))>>13);
3986
3987                 ioffset_p2 = ((TmpUshort & (BIT_12|BIT_11|BIT_10|BIT_9))>>9);
3988                 ioffset_p1 = ((TmpUshort & (BIT_8|BIT_7|BIT_6|BIT_5))>>5);
3989
3990                 ioffset_p0 = ((TmpUshort & BIT_4) >>4);
3991                 ioffset_p0 <<= 3;
3992                 ioffset_p0 |= (TmpUshort & (BIT_2| BIT_1 | BIT_0));
3993
3994                 if ((ioffset_p3 == 0x0F) && (ioffset_p2 == 0x0F) && (ioffset_p1 == 0x0F) && (ioffset_p0 == 0x0F)) {
3995                         sc->RequireAdcBiasPatch = FALSE;
3996                 } else {
3997                         sc->RequireAdcBiasPatch = TRUE;
3998                         sc->AdcBiasPatchIoffset = (ioffset_p3<<12)|(ioffset_p2<<8)|(ioffset_p1<<4)|(ioffset_p0);
3999                 }
4000         }
4001         break;
4002         }
4003
4004         switch(sc->re_type) {
4005         case MACFG_68:
4006         case MACFG_69:
4007         case MACFG_70:
4008         case MACFG_71: {
4009                 u_int16_t rg_saw_cnt;
4010
4011                 MP_WritePhyUshort(sc, 0x1F, 0x0C42);
4012                 rg_saw_cnt = MP_ReadPhyUshort(sc, 0x13);
4013                 rg_saw_cnt &= ~(BIT_15|BIT_14);
4014                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
4015
4016                 if (rg_saw_cnt > 0) {
4017                         sc->SwrCnt1msIni = 16000000/rg_saw_cnt;
4018                         sc->SwrCnt1msIni &= 0x0FFF;
4019
4020                         sc->RequireAdjustUpsTxLinkPulseTiming = TRUE;
4021                 }
4022         }
4023         break;
4024         }
4025
4026         switch(sc->re_type) {
4027         case MACFG_31:
4028         case MACFG_32:
4029         case MACFG_33:
4030         case MACFG_36:
4031         case MACFG_37:
4032         case MACFG_38:
4033         case MACFG_39:
4034         case MACFG_42:
4035         case MACFG_43:
4036         case MACFG_50:
4037         case MACFG_51:
4038         case MACFG_52:
4039         case MACFG_53:
4040         case MACFG_54:
4041         case MACFG_55:
4042         case MACFG_56:
4043         case MACFG_57:
4044         case MACFG_58:
4045         case MACFG_59:
4046         case MACFG_60:
4047         case MACFG_61:
4048         case MACFG_62:
4049         case MACFG_63:
4050         case MACFG_64:
4051         case MACFG_65:
4052         case MACFG_66:
4053         case MACFG_67:
4054         case MACFG_68:
4055         case MACFG_69:
4056         case MACFG_70:
4057         case MACFG_71:
4058                 sc->re_hw_enable_msi_msix = TRUE;
4059                 break;
4060         }
4061
4062         switch(sc->re_type) {
4063         case MACFG_3:
4064         case MACFG_4:
4065         case MACFG_5:
4066         case MACFG_6:
4067         case MACFG_11:
4068         case MACFG_12:
4069         case MACFG_13:
4070         case MACFG_21:
4071         case MACFG_22:
4072         case MACFG_23:
4073         case MACFG_24:
4074         case MACFG_25:
4075         case MACFG_26:
4076         case MACFG_27:
4077         case MACFG_28:
4078         case MACFG_41:
4079         case MACFG_42:
4080         case MACFG_43:
4081 #ifdef __DragonFly__
4082         case MACFG_50:
4083 #endif
4084         case MACFG_54:
4085         case MACFG_55:
4086                 sc->re_coalesce_tx_pkt = TRUE;
4087 #ifdef __DragonFly__
4088                 if (sc->re_type != MACFG_50)
4089                         sc->re_pad_runt = TRUE;
4090 #endif
4091                 break;
4092         }
4093
4094         switch(sc->re_type) {
4095         case MACFG_36:
4096         case MACFG_37:
4097         case MACFG_38:
4098         case MACFG_39:
4099         case MACFG_42:
4100         case MACFG_43:
4101         case MACFG_50:
4102         case MACFG_51:
4103         case MACFG_52:
4104         case MACFG_53:
4105         case MACFG_54:
4106         case MACFG_55:
4107         case MACFG_56:
4108         case MACFG_57:
4109         case MACFG_58:
4110         case MACFG_59:
4111         case MACFG_60:
4112         case MACFG_61:
4113         case MACFG_62:
4114         case MACFG_67:
4115         case MACFG_68:
4116         case MACFG_69:
4117         case MACFG_70:
4118         case MACFG_71:
4119                 sc->re_hw_supp_now_is_oob_ver = 1;
4120                 break;
4121         }
4122
4123         switch (sc->re_type) {
4124         case MACFG_36:
4125         case MACFG_37:
4126                 sc->re_sw_ram_code_ver = NIC_RAMCODE_VERSION_8168E;
4127                 break;
4128         case MACFG_38:
4129         case MACFG_39:
4130                 sc->re_sw_ram_code_ver = NIC_RAMCODE_VERSION_8168EVL;
4131                 break;
4132         case MACFG_50:
4133         case MACFG_51:
4134                 sc->re_sw_ram_code_ver = NIC_RAMCODE_VERSION_8168F;
4135                 break;
4136         case MACFG_52:
4137                 sc->re_sw_ram_code_ver = NIC_RAMCODE_VERSION_8411;
4138                 break;
4139         case MACFG_56:
4140         case MACFG_57:
4141                 sc->re_sw_ram_code_ver = NIC_RAMCODE_VERSION_8168G;
4142                 break;
4143         case MACFG_58:
4144         case MACFG_59:
4145                 sc->re_sw_ram_code_ver = NIC_RAMCODE_VERSION_8168GU;
4146                 break;
4147         case MACFG_60:
4148                 sc->re_sw_ram_code_ver = NIC_RAMCODE_VERSION_8411B;
4149                 break;
4150         case MACFG_61:
4151         case MACFG_62:
4152         case MACFG_67:
4153                 sc->re_sw_ram_code_ver = NIC_RAMCODE_VERSION_8168EP;
4154                 break;
4155         case MACFG_68:
4156         case MACFG_69:
4157                 sc->re_sw_ram_code_ver = NIC_RAMCODE_VERSION_8168H;
4158                 break;
4159         case MACFG_70:
4160         case MACFG_71:
4161                 sc->re_sw_ram_code_ver = NIC_RAMCODE_VERSION_8168FP;
4162                 break;
4163         }
4164
4165         sc->re_8169_MacVersion=(CSR_READ_4(sc, RE_TXCFG)&0x7c800000)>>25;               /* Get bit 26~30        */
4166         sc->re_8169_MacVersion|=((CSR_READ_4(sc, RE_TXCFG)&0x00800000)!=0 ? 1:0);       /* Get bit 23           */
4167         DBGPRINT1(sc->re_unit,"8169 Mac Version %d",sc->re_8169_MacVersion);
4168
4169         /* Rtl8169s single chip detected */
4170         if (sc->re_type == MACFG_3) {
4171                 RE_LOCK(sc);
4172                 sc->re_8169_PhyVersion=(MP_ReadPhyUshort(sc, 0x03)&0x000f);
4173                 DBGPRINT1(sc->re_unit,"8169 Phy Version %d",sc->re_8169_PhyVersion);
4174                 RE_UNLOCK(sc);
4175         }
4176
4177 #ifndef __DragonFly__
4178         sc->link_state = LINK_STATE_UNKNOWN;
4179 #endif
4180 }
4181
4182 static void re_hw_d3_para(struct re_softc *sc)
4183 {
4184         if (sc->re_type == MACFG_59 || sc->re_type == MACFG_60 ||
4185             sc->re_type == MACFG_62 || sc->re_type == MACFG_67 ||
4186             sc->re_type == MACFG_68 || sc->re_type == MACFG_69 ||
4187             sc->re_type == MACFG_70 || sc->re_type == MACFG_71) {
4188                 MP_WritePhyOcpRegWord(sc, 0x0C41, 0x13, 0x0000);
4189                 MP_WritePhyOcpRegWord(sc, 0x0C41, 0x13, 0x0500);
4190         }
4191 }
4192
4193 #ifndef __DragonFly__
4194 /*
4195 * Attach the interface. Allocate softc structures, do ifmedia
4196 * setup and ethernet/BPF attach.
4197 */
4198 static int re_attach(device_t dev)
4199 {
4200         /*int                   s;*/
4201         u_char                  eaddr[ETHER_ADDR_LEN];
4202         u_int32_t               command;
4203         struct re_softc         *sc;
4204         struct ifnet            *ifp;
4205         int                     unit, error = 0, rid, i;
4206 //      int                     mac_version;
4207 //      int                     mode;
4208 //      u_int8_t                data8;
4209         int     reg;
4210         int             msic=0, msixc=0;
4211
4212         /*s = splimp();*/
4213
4214         sc = device_get_softc(dev);
4215         unit = device_get_unit(dev);
4216         bzero(sc, sizeof(struct re_softc));
4217         RE_LOCK_INIT(sc,device_get_nameunit(dev));
4218         sc->dev = dev;
4219
4220         sc->driver_detach = 0;
4221
4222         sc->re_device_id = pci_get_device(dev);
4223         sc->re_revid = pci_get_revid(dev);
4224         pci_enable_busmaster(dev);
4225
4226         /*
4227          * Map control/status registers.
4228          */
4229         command = pci_read_config(dev, PCIR_COMMAND, 4);
4230         command |= (PCIM_CMD_PORTEN|PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN);
4231         pci_write_config(dev, PCIR_COMMAND, command, 4);
4232         command = pci_read_config(dev, PCIR_COMMAND, 4);
4233
4234         if (prefer_iomap == 0) {
4235                 sc->re_res_id = PCIR_BAR(1);
4236                 sc->re_res_type = SYS_RES_MEMORY;
4237                 /* PCIE NIC use different BARs. */
4238                 if (sc->re_device_id == RT_DEVICEID_8168 || sc->re_device_id == RT_DEVICEID_8161 ||
4239                     sc->re_device_id == RT_DEVICEID_8136)
4240                         sc->re_res_id = PCIR_BAR(2);
4241         } else {
4242                 sc->re_res_id = PCIR_BAR(0);
4243                 sc->re_res_type = SYS_RES_IOPORT;
4244         }
4245         sc->re_res = bus_alloc_resource(dev, sc->re_res_type, &sc->re_res_id,
4246                                         0, ~0, 1, RF_ACTIVE);
4247         if (sc->re_res == NULL && prefer_iomap == 0) {
4248                 sc->re_res_id = PCIR_BAR(0);
4249                 sc->re_res_type = SYS_RES_IOPORT;
4250                 sc->re_res = bus_alloc_resource(dev, sc->re_res_type, &sc->re_res_id,
4251                                                 0, ~0, 1, RF_ACTIVE);
4252         }
4253
4254         if (sc->re_res == NULL) {
4255                 device_printf(dev,"couldn't map ports/memory\n");
4256                 error = ENXIO;
4257                 goto fail;
4258         }
4259
4260         if (sc->re_res_type == SYS_RES_IOPORT)
4261                 device_printf(dev, "Using I/O Ports\n");
4262         else
4263                 device_printf(dev, "Using Memory Mapping!\n");
4264
4265         sc->re_btag = rman_get_bustag(sc->re_res);
4266         sc->re_bhandle = rman_get_bushandle(sc->re_res);
4267
4268         error = re_check_mac_version(sc);
4269
4270         if (error) {
4271                 goto fail;
4272         }
4273
4274         re_init_software_variable(sc);
4275
4276 #if OS_VER >= VERSION(7,0)
4277         msic = pci_msi_count(dev);
4278         msixc = pci_msix_count(dev);
4279         if (pci_find_cap(dev, PCIY_EXPRESS, &reg) == 0) {
4280                 sc->re_if_flags |= RL_FLAG_PCIE;
4281                 sc->re_expcap = reg;
4282         } else {
4283                 sc->re_if_flags &= ~RL_FLAG_PCIE;
4284                 sc->re_expcap = 0;
4285         }
4286
4287         //device_printf(dev, "MSI count : %d\n", msic);
4288         //device_printf(dev, "MSI-X count : %d\n", msixc);
4289         if (sc->re_hw_enable_msi_msix == FALSE) {
4290                 msixc = 0;
4291                 msic = 0;
4292         }
4293         if (msix_disable > 0)
4294                 msixc = 0;
4295         if (msi_disable > 0)
4296                 msic = 0;
4297
4298         /* Prefer MSI-X to MSI. */
4299         if (msixc > 0) {
4300                 rid = PCIR_BAR(4);
4301                 msixc = RL_MSI_MESSAGES;
4302                 sc->re_res_pba = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
4303                                                         &rid, RF_ACTIVE);
4304                 if (sc->re_res_pba == NULL) {
4305                         device_printf(dev,
4306                                       "could not allocate MSI-X PBA resource\n");
4307                 }
4308                 if (sc->re_res_pba != NULL &&
4309                     pci_alloc_msix(dev, &msixc) == 0) {
4310                         if (msixc == RL_MSI_MESSAGES) {
4311                                 device_printf(dev, "Using %d MSI-X message\n",
4312                                               msixc);
4313                                 sc->re_if_flags |= RL_FLAG_MSIX;
4314                         } else
4315                                 pci_release_msi(dev);
4316                 }
4317                 if ((sc->re_if_flags & RL_FLAG_MSIX) == 0) {
4318                         if (sc->re_res_pba != NULL)
4319                                 bus_release_resource(dev, SYS_RES_MEMORY, rid,
4320                                                      sc->re_res_pba);
4321                         sc->re_res_pba = NULL;
4322                         msixc = 0;
4323                 }
4324         }
4325
4326         /* Prefer MSI to INTx. */
4327         if (msixc == 0 && msic > 0) {
4328                 msic = RL_MSI_MESSAGES;
4329                 if (pci_alloc_msi(dev, &msic) == 0) {
4330                         if (msic == RL_MSI_MESSAGES) {
4331                                 device_printf(dev, "Using %d MSI message\n",
4332                                               msic);
4333                                 sc->re_if_flags |= RL_FLAG_MSI;
4334                         } else
4335                                 pci_release_msi(dev);
4336                 }
4337                 if ((sc->re_if_flags & RL_FLAG_MSI) == 0)
4338                         msic = 0;
4339         }
4340 #endif //OS_VER >= VERSION(7,0)
4341
4342         if ((sc->re_if_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) {
4343                 rid = 0;
4344                 sc->re_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1,
4345                                                 RF_SHAREABLE | RF_ACTIVE);
4346
4347                 if (sc->re_irq == NULL) {
4348                         device_printf(dev,"couldn't map interrupt\n");
4349                         error = ENXIO;
4350                         goto fail;
4351                 }
4352                 device_printf(dev, "Using line-based interrupt\n");
4353         } else {
4354                 rid = 1;
4355                 sc->re_irq = bus_alloc_resource_any(dev,
4356                                                     SYS_RES_IRQ, &rid, RF_ACTIVE);
4357                 if (sc->re_irq == NULL) {
4358                         device_printf(dev,
4359                                       "couldn't allocate IRQ resources for "
4360                                       "message %d\n", rid);
4361                         error = ENXIO;
4362                         goto fail;
4363                 }
4364         }
4365
4366 #if OS_VER >= VERSION(7,3)
4367         /* Disable ASPM L0S/L1 and Clock Request. */
4368         if (sc->re_expcap != 0) {
4369                 u_int32_t               cap, ctl;
4370                 cap = pci_read_config(dev, sc->re_expcap +
4371                                       RE_PCIER_LINK_CAP, 2);
4372                 if ((cap & RE_PCIEM_LINK_CAP_ASPM) != 0) {
4373                         ctl = pci_read_config(dev, sc->re_expcap +
4374                                               RE_PCIER_LINK_CTL, 2);
4375                         if ((ctl & 0x0103) != 0) {
4376                                 ctl &= ~0x0103;
4377                                 pci_write_config(dev, sc->re_expcap +
4378                                                  RE_PCIER_LINK_CTL, ctl, 2);
4379                                 device_printf(dev, "ASPM disabled\n");
4380                         }
4381                 } else
4382                         device_printf(dev, "no ASPM capability\n");
4383         }
4384 #endif //OS_VER >= VERSION(7,3)
4385
4386         re_init_timer(sc);
4387
4388         RE_LOCK(sc);
4389         re_exit_oob(sc);
4390         re_hw_init(sc);
4391         RE_UNLOCK(sc);
4392
4393         /*
4394          * Reset the adapter. Only take the lock here as it's needed in
4395          * order to call re_reset().
4396          */
4397         RE_LOCK(sc);
4398         re_reset(sc);
4399         RE_UNLOCK(sc);
4400
4401         /* Get station address. */
4402         RE_LOCK(sc);
4403         re_get_hw_mac_address(sc, eaddr);
4404         RE_UNLOCK(sc);
4405
4406         /*
4407          * A RealTek chip was detected. Inform the world.
4408          */
4409         device_printf(dev,"version:1.94.01\n");
4410         device_printf(dev,"Ethernet address: %6D\n", eaddr, ":");
4411         printf("\nThis product is covered by one or more of the following patents: \
4412            \nUS6,570,884, US6,115,776, and US6,327,625.\n");
4413
4414         sc->re_unit = unit;
4415
4416 #if OS_VER < VERSION(6,0)
4417         bcopy(eaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
4418 #endif
4419
4420         if (sc->re_type == MACFG_3) {   /* Change PCI Latency time*/
4421                 pci_write_config(dev, RE_PCI_LATENCY_TIMER, 0x40, 1);
4422         }
4423
4424         error = bus_dma_tag_create(
4425 #if OS_VER < VERSION(7,0)
4426                         NULL,
4427 #else
4428                         bus_get_dma_tag(dev),           /* parent */
4429 #endif
4430                         1, 0,           /* alignment, boundary */
4431                         BUS_SPACE_MAXADDR,              /* lowaddr */
4432                         BUS_SPACE_MAXADDR,              /* highaddr */
4433                         NULL, NULL,                     /* filter, filterarg */
4434                         BUS_SPACE_MAXSIZE_32BIT,        /* maxsize */
4435                         0,                              /* nsegments */
4436                         BUS_SPACE_MAXSIZE_32BIT,        /* maxsegsize */
4437                         0,                              /* flags */
4438                         NULL, NULL,                     /* lockfunc, lockarg */
4439                         &sc->re_parent_tag);
4440
4441         i = roundup2(sizeof(union RxDesc)*RE_RX_BUF_NUM, RE_DESC_ALIGN);
4442         error = bus_dma_tag_create(
4443                         sc->re_parent_tag,
4444                         RE_DESC_ALIGN, 0,               /* alignment, boundary */
4445                         BUS_SPACE_MAXADDR,              /* lowaddr */
4446                         BUS_SPACE_MAXADDR,              /* highaddr */
4447                         NULL, NULL,                     /* filter, filterarg */
4448                         i,                              /* maxsize */
4449                         1,                              /* nsegments */
4450                         i,                              /* maxsegsize */
4451                         0,                              /* flags */
4452                         NULL, NULL,                     /* lockfunc, lockarg */
4453                         &sc->re_desc.rx_desc_tag);
4454         if (error) {
4455                 device_printf(dev,"bus_dma_tag_create fail\n");
4456                 goto fail;
4457         }
4458
4459         error = bus_dmamem_alloc(sc->re_desc.rx_desc_tag,
4460                                  (void**) &sc->re_desc.rx_desc,
4461                                  BUS_DMA_WAITOK|BUS_DMA_COHERENT|BUS_DMA_ZERO,
4462                                  &sc->re_desc.rx_desc_dmamap);
4463         if (error) {
4464                 device_printf(dev,"bus_dmamem_alloc fail\n");
4465                 goto fail;
4466         }
4467
4468         i = roundup2(sizeof(union TxDesc)*RE_TX_BUF_NUM, RE_DESC_ALIGN);
4469         error = bus_dma_tag_create(
4470                         sc->re_parent_tag,
4471                         RE_DESC_ALIGN, 0,               /* alignment, boundary */
4472                         BUS_SPACE_MAXADDR,              /* lowaddr */
4473                         BUS_SPACE_MAXADDR,              /* highaddr */
4474                         NULL, NULL,                     /* filter, filterarg */
4475                         i,                              /* maxsize */
4476                         1,                              /* nsegments */
4477                         i,                              /* maxsegsize */
4478                         0,                              /* flags */
4479                         NULL, NULL,                     /* lockfunc, lockarg */
4480                         &sc->re_desc.tx_desc_tag);
4481         if (error) {
4482                 device_printf(dev,"bus_dma_tag_create fail\n");
4483                 goto fail;
4484         }
4485
4486         error = bus_dmamem_alloc(sc->re_desc.tx_desc_tag,
4487                                  (void**) &sc->re_desc.tx_desc,
4488                                  BUS_DMA_WAITOK|BUS_DMA_COHERENT|BUS_DMA_ZERO,
4489                                  &sc->re_desc.tx_desc_dmamap);
4490
4491         if (error) {
4492                 device_printf(dev,"bus_dmamem_alloc fail\n");
4493                 goto fail;
4494         }
4495
4496         RE_LOCK(sc);
4497         re_phy_power_up(dev);
4498         re_hw_phy_config(sc);
4499         re_clrwol(sc);
4500         RE_UNLOCK(sc);
4501
4502         sc->re_tx_cstag =1;
4503         sc->re_rx_cstag =1;
4504
4505 #if OS_VER < VERSION(6,0)
4506         ifp = &sc->arpcom.ac_if;
4507 #else
4508         ifp = sc->re_ifp = if_alloc(IFT_ETHER);
4509         if (ifp == NULL) {
4510                 device_printf(dev, "can not if_alloc()\n");
4511                 error = ENOSPC;
4512                 goto fail;
4513         }
4514 #endif
4515         ifp->if_softc = sc;
4516 #if OS_VER < VERSION(5,3)
4517         ifp->if_unit = unit;
4518         ifp->if_name = "re";
4519 #else
4520         if_initname(ifp, device_get_name(dev), device_get_unit(dev));
4521 #endif
4522         ifp->if_mtu = ETHERMTU;
4523         ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
4524         ifp->if_ioctl = re_ioctl;
4525         ifp->if_output = ether_output;
4526         ifp->if_start = re_start;
4527 #if OS_VER < VERSION(7,0)
4528         ifp->if_watchdog = re_watchdog;
4529 #endif
4530         if ((sc->re_type == MACFG_24) || (sc->re_type == MACFG_25) || (sc->re_type == MACFG_26))
4531                 ifp->if_hwassist |= CSUM_TCP | CSUM_UDP;
4532         else
4533                 ifp->if_hwassist |= RE_CSUM_FEATURES;
4534
4535         ifp->if_capabilities = IFCAP_HWCSUM;
4536         ifp->if_capenable = ifp->if_capabilities;
4537         CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) |RL_RxChkSum);
4538         ifp->if_init = re_init;
4539         /* VLAN capability setup */
4540         ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING;
4541         ifp->if_capenable = ifp->if_capabilities;
4542
4543         /* Enable WOL if PM is supported. */
4544         if (pci_find_cap(sc->dev, PCIY_PMG, &reg) == 0)
4545                 ifp->if_capabilities |= IFCAP_WOL;
4546         ifp->if_capenable = ifp->if_capabilities;
4547         ifp->if_capenable &= ~(IFCAP_WOL_UCAST | IFCAP_WOL_MCAST);
4548
4549         RE_LOCK(sc);
4550         set_rxbufsize(sc);
4551         error =re_alloc_buf(sc);
4552
4553         if (error) {
4554                 RE_UNLOCK(sc);
4555                 goto fail;
4556         }
4557         /* Init descriptors. */
4558         re_var_init(sc);
4559
4560         RE_UNLOCK(sc);
4561
4562         switch(sc->re_device_id) {
4563         case RT_DEVICEID_8169:
4564         case RT_DEVICEID_8169SC:
4565         case RT_DEVICEID_8168:
4566         case RT_DEVICEID_8161:
4567                 ifp->if_baudrate = 1000000000;
4568                 break;
4569
4570         default:
4571                 ifp->if_baudrate = 100000000;
4572                 break;
4573         }
4574         IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
4575         ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN;
4576         IFQ_SET_READY(&ifp->if_snd);
4577
4578 #if OS_VER>=VERSION(7,0)
4579         TASK_INIT(&sc->re_inttask, 0, re_int_task, sc);
4580 #endif
4581
4582         /*
4583          * Call MI attach routine.
4584          */
4585         /*#if OS_VER < VERSION(5, 1)*/
4586 #if OS_VER < VERSION(4,9)
4587         ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
4588 #else
4589         ether_ifattach(ifp, eaddr);
4590 #endif
4591
4592 #if OS_VER < VERSION(7,0)
4593         error = bus_setup_intr(dev, sc->re_irq, INTR_TYPE_NET,
4594                                re_intr, sc, &sc->re_intrhand);
4595 #else
4596         error = bus_setup_intr(dev, sc->re_irq, INTR_TYPE_NET|INTR_MPSAFE,
4597                                re_intr, NULL, sc, &sc->re_intrhand);
4598 #endif
4599
4600         if (error) {
4601 #if OS_VER < VERSION(4,9)
4602                 ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
4603 #else
4604                 ether_ifdetach(ifp);
4605 #endif
4606                 device_printf(dev,"couldn't set up irq\n");
4607                 goto fail;
4608         }
4609
4610         /*
4611          * Specify the media types supported by this adapter and register
4612          * callbacks to update media and link information
4613          */
4614         ifmedia_init(&sc->media, IFM_IMASK, re_ifmedia_upd, re_ifmedia_sts);
4615         ifmedia_add(&sc->media, IFM_ETHER | IFM_10_T, 0, NULL);
4616         ifmedia_add(&sc->media, IFM_ETHER | IFM_10_T | IFM_FDX, 0, NULL);
4617         ifmedia_add(&sc->media, IFM_ETHER | IFM_100_TX, 0, NULL);
4618         ifmedia_add(&sc->media, IFM_ETHER | IFM_100_TX | IFM_FDX, 0, NULL);
4619         switch(sc->re_device_id) {
4620         case RT_DEVICEID_8169:
4621         case RT_DEVICEID_8169SC:
4622         case RT_DEVICEID_8168:
4623         case RT_DEVICEID_8161:
4624                 ifmedia_add(&sc->media, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL);
4625                 ifmedia_add(&sc->media, IFM_ETHER | IFM_1000_T, 0, NULL);
4626                 break;
4627
4628         default:
4629                 break;
4630         }
4631         ifmedia_add(&sc->media, IFM_ETHER | IFM_AUTO, 0, NULL);
4632         ifmedia_set(&sc->media, IFM_ETHER | IFM_AUTO);
4633         sc->media.ifm_media = IFM_ETHER | IFM_AUTO;
4634         re_ifmedia_upd(ifp);
4635
4636 fail:
4637         if (error)
4638                 re_detach(dev);
4639
4640         return(error);
4641 }
4642
4643 static int re_detach(device_t dev)
4644 {
4645         struct re_softc         *sc;
4646         struct ifnet            *ifp;
4647         /*int                   s;*/
4648         int                     i;
4649         int                     rid;
4650
4651         /*s = splimp();*/
4652
4653         sc = device_get_softc(dev);
4654
4655         ifp = RE_GET_IFNET(sc);
4656
4657         /* These should only be active if attach succeeded */
4658         if (device_is_attached(dev)) {
4659                 RE_LOCK(sc);
4660                 re_stop(sc);
4661                 RE_UNLOCK(sc);
4662 #if OS_VER>=VERSION(7,0)
4663                 taskqueue_drain(taskqueue_fast, &sc->re_inttask);
4664 #endif
4665 #if OS_VER < VERSION(4,9)
4666                 ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
4667 #else
4668                 ether_ifdetach(ifp);
4669 #endif
4670         }
4671
4672         bus_generic_detach(dev);
4673
4674         sc->driver_detach = 1;
4675
4676         if (sc->re_intrhand)
4677                 bus_teardown_intr(dev, sc->re_irq, sc->re_intrhand);
4678
4679 #if OS_VER>=VERSION(6,0)
4680         if (ifp)
4681                 if_free(ifp);
4682 #endif
4683
4684         if ((sc->re_if_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0)
4685                 rid = 0;
4686         else
4687                 rid = 1;
4688         if (sc->re_irq) {
4689                 bus_release_resource(dev, SYS_RES_IRQ, rid, sc->re_irq);
4690                 sc->re_irq = NULL;
4691         }
4692         if ((sc->re_if_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) != 0)
4693                 pci_release_msi(dev);
4694         if (sc->re_res_pba) {
4695                 rid = PCIR_BAR(4);
4696                 bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->re_res_pba);
4697         }
4698         if (sc->re_res)
4699                 bus_release_resource(dev, sc->re_res_type, sc->re_res_id, sc->re_res);
4700
4701         if (HW_DASH_SUPPORT_TYPE_3(sc) && sc->re_dash)
4702                 bus_space_unmap(sc->re_cmac_tag, sc->re_mapped_cmac_handle, RE_REGS_SIZE);
4703
4704         if (sc->re_desc.re_rx_mtag) {
4705                 for (i = 0; i < RE_RX_BUF_NUM; i++) {
4706                         if (sc->re_desc.rx_buf[i]!=NULL) {
4707                                 bus_dmamap_sync(sc->re_desc.re_rx_mtag,
4708                                                 sc->re_desc.re_rx_dmamap[i],
4709                                                 BUS_DMASYNC_POSTREAD);
4710                                 bus_dmamap_unload(sc->re_desc.re_rx_mtag,
4711                                                   sc->re_desc.re_rx_dmamap[i]);
4712                                 bus_dmamap_destroy(sc->re_desc.re_rx_mtag,
4713                                                    sc->re_desc.re_rx_dmamap[i]);
4714                                 m_freem(sc->re_desc.rx_buf[i]);
4715                                 sc->re_desc.rx_buf[i] =NULL;
4716                         }
4717                 }
4718                 bus_dma_tag_destroy(sc->re_desc.re_rx_mtag);
4719                 sc->re_desc.re_rx_mtag =0;
4720         }
4721
4722         if (sc->re_desc.re_tx_mtag) {
4723                 for (i = 0; i < RE_TX_BUF_NUM; i++) {
4724                         bus_dmamap_destroy(sc->re_desc.re_tx_mtag,
4725                                            sc->re_desc.re_tx_dmamap[i]);
4726                 }
4727                 bus_dma_tag_destroy(sc->re_desc.re_tx_mtag);
4728                 sc->re_desc.re_tx_mtag =0;
4729         }
4730
4731         if (sc->re_desc.rx_desc_tag) {
4732                 bus_dmamap_sync(sc->re_desc.rx_desc_tag,
4733                                 sc->re_desc.rx_desc_dmamap,
4734                                 BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
4735                 bus_dmamap_unload(sc->re_desc.rx_desc_tag,
4736                                   sc->re_desc.rx_desc_dmamap);
4737                 bus_dmamem_free(sc->re_desc.rx_desc_tag,
4738                                 sc->re_desc.rx_desc,
4739                                 sc->re_desc.rx_desc_dmamap);
4740                 bus_dma_tag_destroy(sc->re_desc.rx_desc_tag);
4741         }
4742
4743         if (sc->re_desc.tx_desc_tag) {
4744                 bus_dmamap_sync(sc->re_desc.tx_desc_tag,
4745                                 sc->re_desc.tx_desc_dmamap,
4746                                 BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
4747                 bus_dmamap_unload(sc->re_desc.tx_desc_tag,
4748                                   sc->re_desc.tx_desc_dmamap);
4749                 bus_dmamem_free(sc->re_desc.tx_desc_tag,
4750                                 sc->re_desc.tx_desc,
4751                                 sc->re_desc.tx_desc_dmamap);
4752                 bus_dma_tag_destroy(sc->re_desc.tx_desc_tag);
4753         }
4754
4755         if (sc->re_parent_tag) {
4756                 bus_dma_tag_destroy(sc->re_parent_tag);
4757         }
4758
4759         /*splx(s);*/
4760         RE_LOCK_DESTROY(sc);
4761
4762         return(0);
4763 }
4764 #endif  /* !__DragonFly__ */
4765
4766 #ifndef __DragonFly__
4767 static void
4768 re_link_state_change(struct ifnet *ifp, int link_state)
4769 {
4770 #if OS_VER>=VERSION(6,0)
4771         if_link_state_change(ifp, link_state);
4772 #else
4773         ifp->if_link_state = link_state
4774 #endif
4775 }
4776
4777 /*
4778   * Device suspend routine.  Stop the interface and save some PCI
4779   * settings in case the BIOS doesn't restore them properly on
4780   * resume.
4781   */
4782 static int
4783 re_suspend(device_t dev)
4784 {
4785         struct re_softc         *sc;
4786         struct ifnet            *ifp;
4787
4788         sc = device_get_softc(dev);
4789         RE_LOCK(sc);
4790         ifp = RE_GET_IFNET(sc);
4791         sc->re_link_chg_det = 0;
4792         re_stop(sc);
4793         re_hw_d3_para(sc);
4794         re_setwol(sc);
4795         sc->suspended = 1;
4796         sc->link_state = LINK_STATE_UNKNOWN;
4797         re_link_state_change(ifp, sc->link_state);
4798         sc->prohibit_access_reg = 1;
4799         RE_UNLOCK(sc);
4800
4801         return (0);
4802 }
4803
4804 /*
4805  * Device resume routine.  Restore some PCI settings in case the BIOS
4806  * doesn't, re-enable busmastering, and restart the interface if
4807  * appropriate.
4808  */
4809 static int
4810 re_resume(device_t dev)
4811 {
4812         struct re_softc         *sc;
4813         struct ifnet            *ifp;
4814
4815         sc = device_get_softc(dev);
4816
4817         RE_LOCK(sc);
4818
4819         ifp = RE_GET_IFNET(sc);
4820
4821         sc->prohibit_access_reg = 0;
4822
4823         re_exit_oob(sc);
4824
4825         re_hw_init(sc);
4826
4827         re_reset(sc);
4828
4829         re_phy_power_up(dev);
4830
4831         re_hw_phy_config(sc);
4832
4833         /*
4834          * Clear WOL matching such that normal Rx filtering
4835          * wouldn't interfere with WOL patterns.
4836          */
4837         re_clrwol(sc);
4838
4839         RE_UNLOCK(sc);
4840
4841         RE_LOCK(sc);
4842         re_ifmedia_upd(ifp);
4843         sc->suspended = 0;
4844         if (ifp->if_flags & IFF_UP) {
4845                 sc->re_link_chg_det = 1;
4846                 re_start_timer(sc);
4847         }
4848         RE_UNLOCK(sc);
4849
4850         return (0);
4851 }
4852 #endif  /* !__DragonFly__ */
4853
4854
4855 static void
4856 ClearAndSetPCIePhyBit(
4857         struct re_softc *sc,
4858         u_int8_t   addr,
4859         u_int16_t   clearmask,
4860         u_int16_t   setmask
4861 )
4862 {
4863         u_int16_t EphyValue;
4864
4865         EphyValue = MP_ReadEPhyUshort(sc, addr);
4866         EphyValue &= ~clearmask;
4867         EphyValue |= setmask;
4868         MP_WriteEPhyUshort(sc, addr, EphyValue);
4869 }
4870
4871 static void
4872 ClearPCIePhyBit(
4873         struct re_softc *sc,
4874         u_int8_t   addr,
4875         u_int16_t   mask
4876 )
4877 {
4878         ClearAndSetPCIePhyBit(sc,
4879                               addr,
4880                               mask,
4881                               0
4882                              );
4883 }
4884
4885 static void
4886 SetPCIePhyBit(
4887         struct re_softc *sc,
4888         u_int8_t   addr,
4889         u_int16_t   mask
4890 )
4891 {
4892         ClearAndSetPCIePhyBit(sc,
4893                               addr,
4894                               0,
4895                               mask
4896                              );
4897 }
4898
4899 #ifndef __DragonFly__
4900 /*
4901  * Stop all chip I/O so that the kernel's probe routines don't
4902  * get confused by errant DMAs when rebooting.
4903  */
4904 static int re_shutdown(dev)     /* The same with re_stop(sc) */
4905 device_t                dev;
4906 {
4907         struct re_softc         *sc;
4908
4909         sc = device_get_softc(dev);
4910
4911         if (sc->re_dash)
4912                 re_driver_stop(sc);
4913
4914         RE_LOCK(sc);
4915         sc->re_link_chg_det = 0;
4916         re_stop(sc);
4917         RE_UNLOCK(sc);
4918
4919         RE_LOCK(sc);
4920         re_hw_d3_para(sc);
4921         re_phy_power_down(dev);
4922         RE_UNLOCK(sc);
4923
4924         return 0;
4925 }
4926 #endif  /* !__DragonFly__ */
4927
4928 static void re_hw_start_unlock(struct re_softc *sc)
4929 {
4930         struct ifnet            *ifp;
4931         u_int32_t               macver;
4932         u_int8_t                data8;
4933         u_int16_t               data16 = 0;
4934         u_int32_t               Data32;
4935
4936         ifp = RE_GET_IFNET(sc);
4937
4938 #ifndef __DragonFly__
4939         /* Init descriptors. */
4940         re_var_init(sc);
4941 #endif
4942
4943         re_enable_cfg9346_write(sc);
4944
4945         switch(sc->re_type) {
4946         case MACFG_36:
4947         case MACFG_37:
4948         case MACFG_38:
4949         case MACFG_39:
4950         case MACFG_42:
4951         case MACFG_43:
4952         case MACFG_50:
4953         case MACFG_51:
4954         case MACFG_52:
4955         case MACFG_53:
4956         case MACFG_54:
4957         case MACFG_55:
4958         case MACFG_56:
4959         case MACFG_57:
4960         case MACFG_58:
4961         case MACFG_59:
4962         case MACFG_60:
4963         case MACFG_61:
4964         case MACFG_62:
4965         case MACFG_67:
4966         case MACFG_68:
4967         case MACFG_69:
4968         case MACFG_70:
4969         case MACFG_71:
4970                 CSR_WRITE_1(sc, RE_CFG5, CSR_READ_1(sc, RE_CFG5) & ~BIT_0);
4971                 CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) & ~BIT_7);
4972                 CSR_WRITE_1(sc, 0xF1, CSR_READ_1(sc, 0xF1) & ~ BIT_7);
4973                 break;
4974         }
4975
4976         /*disable Link Down Power Saving(non-LDPS)*/
4977         /*CSR_WRITE_1(sc, RE_LDPS, 0x05);*/
4978         /*ldps= CSR_READ_1(sc, RE_LDPS);*/
4979
4980         CSR_WRITE_2(sc, RE_CPCR, 0x2060);
4981
4982         CSR_WRITE_2(sc, RE_IM, 0x5151);
4983
4984         CSR_WRITE_1(sc, RE_MTPS, 0x3f);
4985
4986         if (sc->re_device_id == RT_DEVICEID_8169 || sc->re_device_id == RT_DEVICEID_8169SC) {
4987                 //do nothing
4988         } else {
4989                 /* Set the initial TX configuration.*/
4990                 CSR_WRITE_4(sc, RE_TXCFG, RE_TXCFG_CONFIG);
4991         }
4992
4993         macver = CSR_READ_4(sc, RE_TXCFG) & 0xFC800000;
4994         if (macver == 0x00800000 || macver == 0x04000000 || macver == 0x10000000) {
4995                 CSR_WRITE_2(sc, RE_CPlusCmd, 0x0063| ((sc->re_type == MACFG_3 && sc->re_8169_MacVersion==1) ? 0x4008:0));
4996         } else if (macver == 0x18000000 || macver == 0x98000000) {
4997                 CSR_WRITE_2(sc, RE_CPlusCmd, 0x0068);
4998                 CSR_WRITE_2(sc, 0xe2, 0x0000);
4999         } else if (macver == 0x30000000) {
5000                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
5001                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
5002
5003                 if (ifp->if_mtu > ETHERMTU) {
5004                         data8 = pci_read_config(sc->dev, 0x69, 1);
5005                         data8 &= ~0x70;
5006                         data8 |= 0x28;
5007                         pci_write_config(sc->dev, 0x69, data8, 1);
5008                 } else {
5009                         data8 = pci_read_config(sc->dev, 0x69, 1);
5010                         data8 &= ~0x70;
5011                         data8 |= 0x58;
5012                         pci_write_config(sc->dev, 0x69, data8, 1);
5013                 }
5014         } else if (macver == 0x38000000) {
5015                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
5016                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
5017
5018                 if (ifp->if_mtu > ETHERMTU) {
5019                         data8 = pci_read_config(sc->dev, 0x69, 1);
5020                         data8 &= ~0x70;
5021                         data8 |= 0x28;
5022                         pci_write_config(sc->dev, 0x69, data8, 1);
5023                         CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) | BIT_0);
5024                 } else {
5025                         data8 = pci_read_config(sc->dev, 0x69, 1);
5026                         data8 &= ~0x70;
5027                         data8 |= 0x58;
5028                         pci_write_config(sc->dev, 0x69, data8, 1);
5029                         CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) & ~ BIT_0);
5030                 }
5031         } else if (macver == 0x34000000 || macver == 0xB4000000) {
5032                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
5033         } else if (macver == 0x34800000 || macver == 0x24800000) {
5034                 if (pci_read_config(sc->dev, 0x81, 1) == 1) {
5035                         CSR_WRITE_1(sc, RE_DBG_reg, 0x98);
5036                         CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) | 0x80);
5037                         CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) | 0x04);
5038                         pci_write_config(sc->dev, 0x81, 1, 1);
5039                 }
5040
5041                 data8 = pci_read_config(sc->dev, 0x79, 1);
5042                 data8 &= ~0x70;
5043                 data8 |= 0x50;
5044                 pci_write_config(sc->dev, 0x79, data8, 1);
5045
5046                 /*set configuration space offset 0x70f to 0x3f*/
5047                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
5048                 Data32 &=0xC0FFFFFF;
5049                 Data32 |= (0x3F << 24);
5050                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
5051
5052                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
5053
5054                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
5055                 if (sc->re_type == MACFG_14) {
5056                         CSR_WRITE_1(sc,RE_CFG1, 0x0f);
5057
5058                         MP_WriteEPhyUshort(sc, 0x03, 0xC2F9);
5059                 } else if (sc->re_type == MACFG_15) {
5060                         CSR_WRITE_1(sc,RE_CFG1, 0x0f);
5061
5062                         MP_WriteEPhyUshort(sc, 0x01, 0x6FE5);
5063                         MP_WriteEPhyUshort(sc, 0x03, 0x07D9);
5064                 } else if (sc->re_type == MACFG_17) {
5065                         MP_WriteEPhyUshort(sc, 0x06, 0xAF35);
5066                 } else if (sc->re_type == MACFG_18) {
5067                         CSR_WRITE_1(sc, 0xF5, CSR_READ_1(sc, 0xF5)|0x04);
5068                         MP_WriteEPhyUshort(sc, 0x19, 0xEC90);
5069                         MP_WriteEPhyUshort(sc, 0x01, 0x6FE5);
5070                         MP_WriteEPhyUshort(sc, 0x03, 0x05D9);
5071                         MP_WriteEPhyUshort(sc, 0x06, 0xAF35);
5072                 } else if (sc->re_type == MACFG_19) {
5073                         if (pci_read_config(sc->dev, 0x80, 1)&3) {
5074                                 MP_WriteEPhyUshort(sc, 0x02, 0x011F);
5075                         }
5076                         CSR_WRITE_1(sc, 0xF4, CSR_READ_1(sc, 0xF4)|0x08);
5077                         CSR_WRITE_1(sc, 0xF5, CSR_READ_1(sc, 0xF5)|0x04);
5078                         MP_WriteEPhyUshort(sc, 0x19, 0xEC90);
5079                         MP_WriteEPhyUshort(sc, 0x01, 0x6FE5);
5080                         MP_WriteEPhyUshort(sc, 0x03, 0x05D9);
5081                         MP_WriteEPhyUshort(sc, 0x06, 0xAF35);
5082                 }
5083         } else if (macver == 0x3C000000) {
5084                 //disable clock request.
5085                 pci_write_config(sc->dev, 0x81, 0, 1);
5086
5087                 /*set configuration space offset 0x70f to 0x27*/
5088                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
5089                 Data32 &=0xC0FFFFFF;
5090                 Data32 |= (0x27 << 24);
5091                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
5092
5093                 CSR_WRITE_1(sc, RE_CFG1, CSR_READ_1(sc, RE_CFG1)|0x10);
5094                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
5095
5096                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
5097                 if (sc->re_type == MACFG_24) {
5098                         /*set mac register offset 0xd1 to 0xf8*/
5099                         CSR_WRITE_1(sc, RE_DBG_reg, 0xF8);
5100
5101                         data16 = MP_ReadEPhyUshort(sc, 0x02) & ~0x1800;
5102                         data16 |= 0x1000;
5103                         MP_WriteEPhyUshort(sc, 0x02, data16);
5104
5105                         data16 = MP_ReadEPhyUshort(sc, 0x03) | 0x0002;
5106                         MP_WriteEPhyUshort(sc, 0x03, data16);
5107
5108                         data16 = MP_ReadEPhyUshort(sc, 0x06) & ~0x0080;
5109                         MP_WriteEPhyUshort(sc, 0x06, data16);
5110
5111                         if (ifp->if_mtu > ETHERMTU) {
5112                                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) | BIT_2); //Jumbo_en0
5113                                 CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) | (1 << 1)); //Jumbo_en1
5114
5115                                 data8 = pci_read_config(sc->dev, 0x79, 1);
5116                                 data8 &= ~0x70;
5117                                 data8 |= 0x20;
5118                                 pci_write_config(sc->dev, 0x79, data8, 1);
5119                                 ifp->if_capenable &= ~IFCAP_HWCSUM;
5120                                 CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) & ~RL_RxChkSum);
5121                                 ifp->if_hwassist &= ~RE_CSUM_FEATURES;
5122
5123                         } else {
5124                                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_2); //Jumbo_en0
5125                                 CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) & ~(1 << 1)); //Jumbo_en1
5126                                 data8 = pci_read_config(sc->dev, 0x79, 1);
5127                                 data8 &= ~0x70;
5128                                 data8 |= 0x50;
5129                                 pci_write_config(sc->dev, 0x79, data8, 1);
5130                                 if (sc->re_tx_cstag) {
5131                                         ifp->if_capenable |= IFCAP_TXCSUM;
5132                                         if ((sc->re_type == MACFG_24) || (sc->re_type == MACFG_25) || (sc->re_type == MACFG_26))
5133                                                 ifp->if_hwassist |= CSUM_TCP | CSUM_UDP;
5134                                         else
5135                                                 ifp->if_hwassist |= RE_CSUM_FEATURES;
5136                                 }
5137                                 if (sc->re_rx_cstag) {
5138                                         ifp->if_capenable |= IFCAP_RXCSUM;
5139                                         CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) |RL_RxChkSum);
5140                                 }
5141                         }
5142                 } else if (sc->re_type == MACFG_25) {
5143                         data16 = MP_ReadEPhyUshort(sc, 0x01) | 0x0001;
5144                         MP_WriteEPhyUshort(sc, 0x01, data16);
5145
5146                         data16 = MP_ReadEPhyUshort(sc, 0x03) & ~0x0620;
5147                         data16 |= 0x0220;
5148                         MP_WriteEPhyUshort(sc, 0x03, data16);
5149
5150                         if (ifp->if_mtu > ETHERMTU) {
5151                                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) | BIT_2); //Jumbo_en0
5152                                 CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) | (1<<1)); //Jumbo_en1
5153
5154                                 data8 = pci_read_config(sc->dev, 0x79, 1);
5155                                 data8 &= ~0x70;
5156                                 data8 |= 0x20;
5157                                 pci_write_config(sc->dev, 0x79, data8, 1);
5158                                 ifp->if_capenable &= ~IFCAP_HWCSUM;
5159                                 CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) & ~RL_RxChkSum);
5160                                 ifp->if_hwassist &= ~RE_CSUM_FEATURES;
5161
5162                         } else {
5163                                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_2); //Jumbo_en0
5164                                 CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) & ~(1<<1)); //Jumbo_en1
5165                                 data8 = pci_read_config(sc->dev, 0x79, 1);
5166                                 data8 &= ~0x70;
5167                                 data8 |= 0x50;
5168                                 pci_write_config(sc->dev, 0x79, data8, 1);
5169                                 if (sc->re_tx_cstag) {
5170                                         ifp->if_capenable |= IFCAP_TXCSUM;
5171                                         if ((sc->re_type == MACFG_24) || (sc->re_type == MACFG_25) || (sc->re_type == MACFG_26))
5172                                                 ifp->if_hwassist |= CSUM_TCP | CSUM_UDP;
5173                                         else
5174                                                 ifp->if_hwassist |= RE_CSUM_FEATURES;
5175                                 }
5176                                 if (sc->re_rx_cstag) {
5177                                         ifp->if_capenable |= IFCAP_RXCSUM;
5178                                         CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) |RL_RxChkSum);
5179                                 }
5180
5181
5182                         }
5183                 } else if (sc->re_type == MACFG_26) {
5184                         if (ifp->if_mtu > ETHERMTU) {
5185                                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) | BIT_2); //Jumbo_en0
5186                                 CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) | (1<<1)); //Jumbo_en1
5187
5188                                 data8 = pci_read_config(sc->dev, 0x79, 1);
5189                                 data8 &= ~0x70;
5190                                 data8 |= 0x20;
5191                                 pci_write_config(sc->dev, 0x79, data8, 1);
5192                                 ifp->if_capenable &= ~IFCAP_HWCSUM;
5193                                 CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) & ~RL_RxChkSum);
5194                                 ifp->if_hwassist &= ~RE_CSUM_FEATURES;
5195                         } else {
5196                                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_2); //Jumbo_en0
5197                                 CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) & ~(1<<1)); //Jumbo_en1
5198                                 data8 = pci_read_config(sc->dev, 0x79, 1);
5199                                 data8 &= ~0x70;
5200                                 data8 |= 0x50;
5201                                 pci_write_config(sc->dev, 0x79, data8, 1);
5202                                 if (sc->re_tx_cstag) {
5203                                         ifp->if_capenable |= IFCAP_TXCSUM;
5204                                         if ((sc->re_type == MACFG_24) || (sc->re_type == MACFG_25) || (sc->re_type == MACFG_26))
5205                                                 ifp->if_hwassist |= CSUM_TCP | CSUM_UDP;
5206                                         else
5207                                                 ifp->if_hwassist |= RE_CSUM_FEATURES;
5208                                 }
5209                                 if (sc->re_rx_cstag) {
5210                                         ifp->if_capenable |= IFCAP_RXCSUM;
5211                                         CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) |RL_RxChkSum);
5212                                 }
5213                         }
5214                 }
5215         } else if (macver == 0x3C800000) {
5216                 //disable clock request.
5217                 pci_write_config(sc->dev, 0x81, 0x00, 1);
5218
5219                 /*set configuration space offset 0x70f to 0x27*/
5220                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
5221                 Data32 &=0xC0FFFFFF;
5222                 Data32 |= (0x27 << 24);
5223                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
5224
5225                 re_eri_write(sc, 0x1EC, 1, 0x07, ERIAR_ASF);
5226
5227                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
5228                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
5229                 if (sc->re_type == MACFG_28)
5230                         CSR_WRITE_1(sc, 0xD1, 0x20);
5231
5232                 if (ifp->if_mtu > ETHERMTU) {
5233                         CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) | BIT_2); //Jumbo_en0
5234                         CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) | (1<<1)); //Jumbo_en1
5235
5236                         data8 = pci_read_config(sc->dev, 0x79, 1);
5237                         data8 &= ~0x70;
5238                         data8 |= 0x20;
5239                         pci_write_config(sc->dev, 0x79, data8, 1);
5240                         ifp->if_capenable &= ~IFCAP_HWCSUM;
5241                         CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) & ~RL_RxChkSum);
5242                         ifp->if_hwassist &= ~RE_CSUM_FEATURES;
5243                 } else {
5244                         CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_2); //Jumbo_en0
5245                         CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) & ~(1<<1)); //Jumbo_en1
5246                         data8 = pci_read_config(sc->dev, 0x79, 1);
5247                         data8 &= ~0x70;
5248                         data8 |= 0x50;
5249                         pci_write_config(sc->dev, 0x79, data8, 1);
5250                         if (sc->re_tx_cstag) {
5251                                 ifp->if_capenable |= IFCAP_TXCSUM;
5252                                 ifp->if_hwassist |= RE_CSUM_FEATURES;
5253                         }
5254                         if (sc->re_rx_cstag) {
5255                                 ifp->if_capenable |= IFCAP_RXCSUM;
5256                                 CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) |RL_RxChkSum);
5257                         }
5258                 }
5259         } else if (macver == 0x28000000) {
5260                 //disable clock request.
5261                 pci_write_config(sc->dev, 0x81, 0x00, 1);
5262
5263                 /*set configuration space offset 0x70f to 0x13*/
5264                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
5265                 Data32 &=0xC0FFFFFF;
5266                 Data32 |= (0x27 << 24);
5267                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
5268
5269                 CSR_WRITE_1(sc, RE_TDFNR, 0x8);
5270
5271                 CSR_WRITE_1(sc, 0xD1, CSR_READ_1(sc, 0xD1) | 0x02);
5272
5273                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
5274                 CSR_WRITE_1(sc, RE_DBG_reg, CSR_READ_1(sc, RE_DBG_reg)|0x82);
5275
5276                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
5277
5278                 if (ifp->if_mtu > ETHERMTU) {
5279                         CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) | BIT_2); //Jumbo_en0
5280                         CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) | (1<<1)); //Jumbo_en1
5281
5282                         data8 = pci_read_config(sc->dev, 0x79, 1);
5283                         data8 &= ~0x70;
5284                         data8 |= 0x20;
5285                         pci_write_config(sc->dev, 0x79, data8, 1);
5286                         ifp->if_capenable &= ~IFCAP_HWCSUM;
5287                         CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) & ~RL_RxChkSum);
5288                         ifp->if_hwassist &= ~RE_CSUM_FEATURES;
5289
5290                 } else {
5291                         CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_2); //Jumbo_en0
5292                         CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) & ~(1<<1)); //Jumbo_en1
5293                         data8 = pci_read_config(sc->dev, 0x79, 1);
5294                         data8 &= ~0x70;
5295                         data8 |= 0x50;
5296                         pci_write_config(sc->dev, 0x79, data8, 1);
5297                         if (sc->re_tx_cstag) {
5298                                 ifp->if_capenable |= IFCAP_TXCSUM;
5299                                 ifp->if_hwassist |= RE_CSUM_FEATURES;
5300                         }
5301                         if (sc->re_rx_cstag) {
5302                                 ifp->if_capenable |= IFCAP_RXCSUM;
5303                                 CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) |RL_RxChkSum);
5304                         }
5305                 }
5306
5307                 if (sc->re_type == MACFG_31) {
5308                         CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~(1<<4));
5309
5310                         MP_WriteEPhyUshort(sc, 0x01, 0x7C7F);
5311                         MP_WriteEPhyUshort(sc, 0x02, 0x011F);
5312                         MP_WriteEPhyUshort(sc, 0x06, 0xB271);
5313                         MP_WriteEPhyUshort(sc, 0x07, 0xCE00);
5314                 } else if (sc->re_type == MACFG_32) {
5315                         MP_WriteEPhyUshort(sc, 0x01, 0x7C7D);
5316                         MP_WriteEPhyUshort(sc, 0x02, 0x091F);
5317                         MP_WriteEPhyUshort(sc, 0x03, 0xC5BA);
5318                         MP_WriteEPhyUshort(sc, 0x06, 0xB279);
5319                         MP_WriteEPhyUshort(sc, 0x07, 0xAF00);
5320                         MP_WriteEPhyUshort(sc, 0x1E, 0xB8EB);
5321                 } else if (sc->re_type == MACFG_33) {
5322                         CSR_WRITE_1(sc, RE_CFG1, CSR_READ_1(sc, RE_CFG1)|0x10);
5323
5324                         MP_WriteEPhyUshort(sc, 0x01, 0x6C7F);
5325                         MP_WriteEPhyUshort(sc, 0x02, 0x011F);
5326                         ClearAndSetPCIePhyBit(sc,
5327                                               0x03,
5328                                               0xFFF0,
5329                                               0x01B0
5330                                              );
5331                         MP_WriteEPhyUshort(sc, 0x1A, 0x0546);
5332                         MP_WriteEPhyUshort(sc, 0x1C, 0x80C4);
5333                         MP_WriteEPhyUshort(sc, 0x1D, 0x78E5);
5334                         MP_WriteEPhyUshort(sc, 0x0A, 0x8100);
5335                 }
5336         } else if (macver == 0x28800000) {
5337                 /* disable clock request. */
5338                 pci_write_config(sc->dev, 0x81, 0x00, 1);
5339
5340                 /*set configuration space offset 0x70f to 0x17*/
5341                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
5342                 Data32 &=0xC0FFFFFF;
5343                 Data32 |= (0x27 << 24);
5344                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
5345
5346                 CSR_WRITE_1(sc, RE_TDFNR, 0x8);
5347                 if (sc->re_dash &&
5348                     (sc->re_type == MACFG_63 || sc->re_type == MACFG_64))
5349                         CSR_WRITE_1(sc, RE_TDFNR, 0x1);
5350
5351                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
5352                 CSR_WRITE_1(sc, RE_DBG_reg, CSR_READ_1(sc, RE_DBG_reg)|0x82);
5353
5354                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
5355
5356                 if (ifp->if_mtu > ETHERMTU) {
5357                         CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) | BIT_2); //Jumbo_en0
5358                         CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) | (1<<1)); //Jumbo_en1
5359
5360                         data8 = pci_read_config(sc->dev, 0x79, 1);
5361                         data8 &= ~0x70;
5362                         data8 |= 0x20;
5363                         pci_write_config(sc->dev, 0x79, data8, 1);
5364                         ifp->if_capenable &= ~IFCAP_HWCSUM;
5365                         CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) & ~RL_RxChkSum);
5366                         ifp->if_hwassist &= ~RE_CSUM_FEATURES;
5367
5368                 } else {
5369                         CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_2); //Jumbo_en0
5370                         CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) & ~(1<<1)); //Jumbo_en1
5371                         data8 = pci_read_config(sc->dev, 0x79, 1);
5372                         data8 &= ~0x70;
5373                         data8 |= 0x50;
5374                         pci_write_config(sc->dev, 0x79, data8, 1);
5375                         if (sc->re_tx_cstag) {
5376                                 ifp->if_capenable |= IFCAP_TXCSUM;
5377                                 ifp->if_hwassist |= RE_CSUM_FEATURES;
5378                         }
5379                         if (sc->re_rx_cstag) {
5380                                 ifp->if_capenable |= IFCAP_RXCSUM;
5381                                 CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) |RL_RxChkSum);
5382                         }
5383                 }
5384
5385                 if (sc->re_type == MACFG_65 || sc->re_type == MACFG_66) {
5386                         SetPCIePhyBit(sc, 0x0B, (BIT_3 | BIT_6));
5387
5388                         ClearAndSetPCIePhyBit(sc,
5389                                               0x19,
5390                                               BIT_5,
5391                                               (BIT_4 | BIT_6)
5392                                              );
5393
5394                         ClearAndSetPCIePhyBit(sc,
5395                                               0x0C,
5396                                               BIT_8,
5397                                               BIT_5
5398                                              );
5399
5400                         ClearPCIePhyBit(sc, 0x10, (BIT_2));
5401                 }
5402         } else if (macver == 0x2C000000) {
5403                 /* disable clock request. */
5404                 pci_write_config(sc->dev, 0x81, 0x00, 1);
5405
5406                 /*set configuration space offset 0x70f to 0x20*/
5407                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
5408                 Data32 &=0xC0FFFFFF;
5409                 Data32 |= (0x27 << 24);
5410                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
5411
5412                 CSR_WRITE_1(sc, 0xF3, CSR_READ_1(sc, 0xF3)|0x20);
5413                 CSR_WRITE_1(sc, 0xF3, CSR_READ_1(sc, 0xF3)& ~0x20);
5414
5415                 CSR_WRITE_1(sc, 0xD0, CSR_READ_1(sc, 0xD0)|0xC0);
5416                 CSR_WRITE_1(sc, 0xF1, CSR_READ_1(sc, 0xF1)|0x73);
5417                 CSR_WRITE_1(sc, RE_CFG5, (CSR_READ_1(sc, RE_CFG5)& ~0x08));
5418                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
5419
5420                 CSR_WRITE_1(sc, RE_TDFNR, 0x8);
5421
5422                 if (sc->re_type == MACFG_36 || sc->re_type == MACFG_37) {
5423                         /* set EPHY registers */
5424                         data16 = MP_ReadEPhyUshort(sc, 0x00) & ~0x0200;
5425                         data16 |= 0x0100;
5426                         MP_WriteEPhyUshort(sc, 0x00, data16);
5427
5428                         data16 = MP_ReadEPhyUshort(sc, 0x00);
5429                         data16 |= 0x0004;
5430                         MP_WriteEPhyUshort(sc, 0x00, data16);
5431
5432                         data16 = MP_ReadEPhyUshort(sc, 0x06) & ~0x0002;
5433                         data16 |= 0x0001;
5434                         MP_WriteEPhyUshort(sc, 0x06, data16);
5435
5436                         data16 = MP_ReadEPhyUshort(sc, 0x06);
5437                         data16 |= 0x0030;
5438                         MP_WriteEPhyUshort(sc, 0x06, data16);
5439
5440                         data16 = MP_ReadEPhyUshort(sc, 0x07);
5441                         data16 |= 0x2000;
5442                         MP_WriteEPhyUshort(sc, 0x07, data16);
5443
5444                         data16 = MP_ReadEPhyUshort(sc, 0x00);
5445                         data16 |= 0x0020;
5446                         MP_WriteEPhyUshort(sc, 0x00, data16);
5447
5448                         data16 = MP_ReadEPhyUshort(sc, 0x03) & ~0x5800;
5449                         data16 |= 0x2000;
5450                         MP_WriteEPhyUshort(sc, 0x03, data16);
5451
5452                         data16 = MP_ReadEPhyUshort(sc, 0x03);
5453                         data16 |= 0x0001;
5454                         MP_WriteEPhyUshort(sc, 0x03, data16);
5455
5456                         data16 = MP_ReadEPhyUshort(sc, 0x01) & ~0x0800;
5457                         data16 |= 0x1000;
5458                         MP_WriteEPhyUshort(sc, 0x01, data16);
5459
5460                         data16 = MP_ReadEPhyUshort(sc, 0x07);
5461                         data16 |= 0x4000;
5462                         MP_WriteEPhyUshort(sc, 0x07, data16);
5463
5464                         data16 = MP_ReadEPhyUshort(sc, 0x1E);
5465                         data16 |= 0x2000;
5466                         MP_WriteEPhyUshort(sc, 0x1E, data16);
5467
5468                         MP_WriteEPhyUshort(sc, 0x19, 0xFE6C);
5469
5470                         data16 = MP_ReadEPhyUshort(sc, 0x0A);
5471                         data16 |= 0x0040;
5472                         MP_WriteEPhyUshort(sc, 0x0A, data16);
5473
5474                         if (ifp->if_mtu > ETHERMTU) {
5475                                 CSR_WRITE_1 (sc, RE_MTPS, 0x24);
5476                                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) | BIT_2);
5477                                 CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) |0x01);
5478                                 data8 = pci_read_config(sc->dev, 0x79, 1);
5479                                 data8 &= ~0x70;
5480                                 data8 |= 0x20;
5481                                 pci_write_config(sc->dev, 0x79, data8, 1);
5482                                 ifp->if_capenable &= ~IFCAP_HWCSUM;
5483                                 CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) & ~RL_RxChkSum);
5484                                 ifp->if_hwassist &= ~RE_CSUM_FEATURES;
5485                         } else {
5486                                 CSR_WRITE_1 (sc, RE_MTPS, 0x0c);
5487                                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_2);
5488                                 CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) & ~0x01);
5489                                 data8 = pci_read_config(sc->dev, 0x79, 1);
5490                                 data8 &= ~0x70;
5491                                 data8 |= 0x50;
5492                                 pci_write_config(sc->dev, 0x79, data8, 1);
5493
5494                                 if (sc->re_tx_cstag) {
5495                                         ifp->if_capenable |= IFCAP_TXCSUM;
5496                                         ifp->if_hwassist |= RE_CSUM_FEATURES;
5497                                 }
5498                                 if (sc->re_rx_cstag) {
5499                                         ifp->if_capenable |= IFCAP_RXCSUM;
5500                                         CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) |RL_RxChkSum);
5501                                 }
5502                         }
5503                 }
5504         } else if (macver == 0x2C800000) {
5505                 /* disable clock request. */
5506                 pci_write_config(sc->dev, 0x81, 0x00, 1);
5507
5508                 /*set configuration space offset 0x70f to 0x27*/
5509                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
5510                 Data32 &=0xC0FFFFFF;
5511                 Data32 |= (0x27 << 24);
5512                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
5513
5514                 data8 = pci_read_config(sc->dev, 0x79, 1);
5515                 data8 &= ~0x70;
5516                 data8 |= 0x50;
5517                 pci_write_config(sc->dev, 0x79, data8, 1);
5518
5519                 CSR_WRITE_1(sc, RE_TDFNR, 0x8);
5520
5521                 re_eri_write(sc, 0xC0, 2, 0x0000, ERIAR_ExGMAC);
5522                 re_eri_write(sc, 0xB8, 4, 0x00000000, ERIAR_ExGMAC);
5523                 re_eri_write(sc, 0xC8, 4, 0x00100002, ERIAR_ExGMAC);
5524                 re_eri_write(sc, 0xE8, 4, 0x00100006, ERIAR_ExGMAC);
5525                 Data32 = re_eri_read(sc, 0xdc, 4, ERIAR_ExGMAC);
5526                 Data32 &= ~BIT_0;
5527                 re_eri_write(sc, 0xdc, 1, Data32, ERIAR_ExGMAC);
5528                 Data32 |= BIT_0;
5529                 re_eri_write(sc, 0xdc, 1, Data32, ERIAR_ExGMAC);
5530
5531                 Data32 = re_eri_read(sc, 0xD4, 4, ERIAR_ExGMAC);
5532                 Data32 |= BIT_11 | BIT_10;
5533                 re_eri_write(sc, 0xD4, 4, Data32, ERIAR_ExGMAC);
5534                 if (sc ->re_type == MACFG_39) {
5535                         Data32 = re_eri_read(sc, 0x1B0, 4, ERIAR_ExGMAC);
5536                         Data32 |= BIT_4;
5537                         re_eri_write(sc, 0x1B0, 4, Data32, ERIAR_ExGMAC);
5538                         re_eri_write(sc, 0xCC, 4, 0x00000050, ERIAR_ExGMAC);
5539                         re_eri_write(sc, 0xD0, 4, 0x07ff0060, ERIAR_ExGMAC);
5540                 }
5541
5542                 CSR_WRITE_4(sc, RE_TXCFG, CSR_READ_4(sc, RE_TXCFG) |BIT_7);
5543                 CSR_WRITE_1(sc, 0xD3, CSR_READ_1(sc, 0xD3) & ~BIT_7);
5544                 CSR_WRITE_1(sc, 0x1B, CSR_READ_1(sc, 0x1B) & ~0x07);
5545
5546                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
5547
5548                 if (sc ->re_type == MACFG_38) {
5549                         CSR_WRITE_4(sc, 0xB0, 0xEE480010);
5550                         CSR_WRITE_1(sc, 0x1A, CSR_READ_1(sc, 0x1A) & ~(BIT_2 |BIT_3));
5551                         re_eri_write(sc, 0x1DC, 1, 0x64, ERIAR_ExGMAC);
5552
5553                         MP_WriteEPhyUshort(sc, 0x06, 0xF020);
5554                         MP_WriteEPhyUshort(sc, 0x07, 0x01FF);
5555                         MP_WriteEPhyUshort(sc, 0x00, 0x5027);
5556                         MP_WriteEPhyUshort(sc, 0x01, 0x0003);
5557                         MP_WriteEPhyUshort(sc, 0x02, 0x2D16);
5558                         MP_WriteEPhyUshort(sc, 0x03, 0x6D49);
5559                         MP_WriteEPhyUshort(sc, 0x08, 0x0006);
5560                         MP_WriteEPhyUshort(sc, 0x0A, 0x00C8);
5561                 }
5562
5563                 data16 = MP_ReadEPhyUshort(sc, 0x09);
5564                 data16 |= BIT_7;
5565                 MP_WriteEPhyUshort(sc, 0x09, data16);
5566
5567                 data16 = MP_ReadEPhyUshort(sc, 0x19);
5568                 data16 |= (BIT_2 | BIT_5 | BIT_9);
5569                 MP_WriteEPhyUshort(sc, 0x19, data16);
5570
5571                 SetPCIePhyBit(sc, 0x00, BIT_3);
5572                 ClearAndSetPCIePhyBit(sc,
5573                                       0x0C,
5574                                       (BIT_13|BIT_12|BIT_11|BIT_10|BIT_8|BIT_7|BIT_6|BIT_5|BIT_4),
5575                                       BIT_9
5576                                      );
5577
5578                 CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) | BIT_5);
5579                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
5580
5581                 CSR_WRITE_1(sc, 0xD0, CSR_READ_1(sc, 0xD0) | BIT_6);
5582                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) | BIT_6);
5583
5584                 CSR_WRITE_1 (sc, RE_MTPS, 0x27);
5585                 ifp->if_capenable &= ~IFCAP_HWCSUM;
5586                 ifp->if_hwassist &= ~RE_CSUM_FEATURES;
5587         } else if (macver == 0x24000000) {
5588                 if (pci_read_config(sc->dev, 0x81, 1)==1) {
5589                         CSR_WRITE_1(sc, RE_DBG_reg, 0x98);
5590                         CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) | 0x80);
5591                         CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) | 0x04);
5592                         pci_write_config(sc->dev, 0x81, 1, 1);
5593                 }
5594                 data8 = pci_read_config(sc->dev, 0x79, 1);
5595                 data8 &= ~0x70;
5596                 data8 |= 0x50;
5597                 pci_write_config(sc->dev, 0x79, data8, 1);
5598
5599                 /*set configuration space offset 0x70f to 0x3F*/
5600                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
5601                 Data32 &=0xC0FFFFFF;
5602                 Data32 |= (0x3F << 24);
5603                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
5604
5605                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
5606
5607                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
5608
5609                 MP_WriteEPhyUshort(sc, 0x06, 0xAF25);
5610                 MP_WriteEPhyUshort(sc, 0x07, 0x8E68);
5611         } else if (macver == 0x40800000) {
5612                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) | 0x80);
5613                 CSR_WRITE_1(sc, 0xF1, CSR_READ_1(sc, 0xF1) | 0x28);
5614                 CSR_WRITE_1(sc, 0xD3, CSR_READ_1(sc, 0xD3) | 0x0C);
5615                 CSR_WRITE_1(sc, 0xD3, CSR_READ_1(sc, 0xD3) & ~BIT_7);
5616                 CSR_WRITE_1(sc, 0xD0, CSR_READ_1(sc, 0xD0) | 0x40);
5617                 CSR_WRITE_2(sc, 0xE0, CSR_READ_2(sc, 0xE0) & ~0xDF9C);
5618                 CSR_WRITE_1(sc, 0xD1, CSR_READ_1(sc, 0xD1) | 0x02);
5619
5620                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
5621
5622                 if (sc->re_type == MACFG_42) {
5623                         /* set EPHY registers */
5624                         SetPCIePhyBit(sc, 0x07, BIT_14);
5625                         SetPCIePhyBit(sc, 0x19, BIT_9);
5626                         SetPCIePhyBit(sc, 0x19, BIT_5);
5627                         SetPCIePhyBit(sc, 0x1E, BIT_13);
5628                         SetPCIePhyBit(sc, 0x03, BIT_0);
5629                         SetPCIePhyBit(sc, 0x19, BIT_8);
5630                         SetPCIePhyBit(sc, 0x19, BIT_2);
5631                         SetPCIePhyBit(sc, 0x0A, BIT_5);
5632                         SetPCIePhyBit(sc, 0x05, BIT_13);
5633                 }
5634                 if (sc->re_type == MACFG_43) {
5635                         SetPCIePhyBit(sc, 0x07, BIT_14);
5636                         SetPCIePhyBit(sc, 0x19, BIT_9);
5637                         SetPCIePhyBit(sc, 0x19, BIT_5);
5638                         SetPCIePhyBit(sc, 0x1E, BIT_13);
5639                         SetPCIePhyBit(sc, 0x03, BIT_0);
5640                         SetPCIePhyBit(sc, 0x19, BIT_8);
5641                         SetPCIePhyBit(sc, 0x19, BIT_2);
5642                         SetPCIePhyBit(sc, 0x0A, BIT_5);
5643                         SetPCIePhyBit(sc, 0x1E, BIT_15);
5644                         SetPCIePhyBit(sc, 0x05, BIT_13);
5645                 }
5646         } else if (macver == 0x44000000) {
5647
5648                 CSR_WRITE_2(sc, 0xE0, CSR_READ_2(sc, 0xE0) & ~0xDF9C);
5649
5650                 re_eri_write(sc, 0xC8, 4, 0x00000002, ERIAR_ExGMAC);
5651                 re_eri_write(sc, 0xE8, 4, 0x00000006, ERIAR_ExGMAC);
5652
5653                 Data32 = re_eri_read(sc, 0xD4, 4, ERIAR_ExGMAC);
5654                 Data32 |= BIT_11 | BIT_10;
5655                 re_eri_write(sc, 0xD4, 4, Data32, ERIAR_ExGMAC);
5656
5657                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
5658
5659                 /* set EPHY registers */
5660                 MP_WriteEPhyUshort(sc, 0x19, 0xFF64);
5661
5662                 CSR_WRITE_1 (sc, RE_MTPS, 0x27);
5663         } else if (macver == 0x48000000) {
5664                 /*set configuration space offset 0x70f to 0x27*/
5665                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
5666                 Data32 &=0xC0FFFFFF;
5667                 Data32 |= (0x27 << 24);
5668                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
5669
5670                 data8 = pci_read_config(sc->dev, 0x79, 1);
5671                 data8 &= ~0x70;
5672                 data8 |= 0x50;
5673                 pci_write_config(sc->dev, 0x79, data8, 1);
5674
5675                 CSR_WRITE_1(sc, RE_TDFNR, 0x8);
5676
5677                 Data32 = re_eri_read(sc, 0xD4, 4, ERIAR_ExGMAC);
5678                 Data32 |= BIT_11 | BIT_10;
5679                 re_eri_write(sc, 0xD4, 4, Data32, ERIAR_ExGMAC);
5680                 re_eri_write(sc, 0xC0, 2, 0x0000, ERIAR_ExGMAC);
5681                 re_eri_write(sc, 0xB8, 4, 0x00000000, ERIAR_ExGMAC);
5682                 re_eri_write(sc, 0xC8, 4, 0x00100002, ERIAR_ExGMAC);
5683                 re_eri_write(sc, 0xE8, 4, 0x00100006, ERIAR_ExGMAC);
5684                 Data32 = re_eri_read(sc, 0xdc, 4, ERIAR_ExGMAC);
5685                 Data32 &= ~BIT_0;
5686                 re_eri_write(sc, 0xdc, 1, Data32, ERIAR_ExGMAC);
5687                 Data32 |= BIT_0;
5688                 re_eri_write(sc, 0xdc, 1, Data32, ERIAR_ExGMAC);
5689                 Data32 = re_eri_read(sc, 0x1B0, 4, ERIAR_ExGMAC);
5690                 Data32 |= BIT_4;
5691                 re_eri_write(sc, 0x1B0, 4, Data32, ERIAR_ExGMAC);
5692                 re_eri_write(sc, 0xCC, 4, 0x00000050, ERIAR_ExGMAC);
5693                 re_eri_write(sc, 0xD0, 4, 0x00000060, ERIAR_ExGMAC);
5694                 Data32 = re_eri_read(sc, 0x1D0, 4, ERIAR_ExGMAC);
5695                 Data32 |= BIT_4;
5696                 re_eri_write(sc, 0x1D0, 4, Data32, ERIAR_ExGMAC);
5697
5698                 CSR_WRITE_4(sc, RE_TXCFG, CSR_READ_4(sc, RE_TXCFG) | BIT_7);
5699                 CSR_WRITE_1(sc, 0xD3, CSR_READ_1(sc, 0xD3) & ~BIT_7);
5700                 CSR_WRITE_1(sc, 0x1B, CSR_READ_1(sc, 0x1B) & ~0x07);
5701
5702                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
5703
5704                 if (sc->re_type == MACFG_50) {
5705                         data16 = MP_ReadEPhyUshort(sc, 0x06);
5706                         data16 &= ~(BIT_7 | BIT_6);
5707                         data16 |= BIT_5;
5708                         MP_WriteEPhyUshort(sc, 0x06, data16);
5709
5710                         data16 = MP_ReadEPhyUshort(sc, 0x08);
5711                         data16 &= ~BIT_0;
5712                         data16 |= BIT_1;
5713                         MP_WriteEPhyUshort(sc, 0x08, data16);
5714                 }
5715
5716                 data16 = MP_ReadEPhyUshort(sc, 0x09);
5717                 data16 |= BIT_7;
5718                 MP_WriteEPhyUshort(sc, 0x09, data16);
5719
5720                 data16 = MP_ReadEPhyUshort(sc, 0x19);
5721                 data16 |= (BIT_2 | BIT_5 | BIT_9);
5722                 MP_WriteEPhyUshort(sc, 0x19, data16);
5723
5724                 SetPCIePhyBit(sc, 0x00, BIT_3);
5725                 ClearAndSetPCIePhyBit(sc,
5726                                       0x0C,
5727                                       (BIT_13|BIT_12|BIT_11|BIT_10|BIT_8|BIT_7|BIT_6|BIT_5|BIT_4),
5728                                       BIT_9
5729                                      );
5730
5731                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
5732
5733                 CSR_WRITE_1(sc, 0xD0, CSR_READ_1(sc, 0xD0) | BIT_6);
5734                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) | BIT_6);
5735
5736                 CSR_WRITE_1 (sc, RE_MTPS, 0x27);
5737
5738                 if (ifp->if_mtu > ETHERMTU) {
5739                         ifp->if_capenable &= ~IFCAP_HWCSUM;
5740                         ifp->if_hwassist &= ~RE_CSUM_FEATURES;
5741                 } else {
5742                         if (sc->re_tx_cstag) {
5743                                 ifp->if_capenable |= IFCAP_TXCSUM;
5744                                 ifp->if_hwassist |= RE_CSUM_FEATURES;
5745                         }
5746                         if (sc->re_rx_cstag) {
5747                                 ifp->if_capenable |= IFCAP_RXCSUM;
5748                         }
5749                 }
5750         } else if (macver == 0x48800000) {
5751                 /*set configuration space offset 0x70f to 0x27*/
5752                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
5753                 Data32 &=0xC0FFFFFF;
5754                 Data32 |= (0x27 << 24);
5755                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
5756
5757                 data8 = pci_read_config(sc->dev, 0x79, 1);
5758                 data8 &= ~0x70;
5759                 data8 |= 0x50;
5760                 pci_write_config(sc->dev, 0x79, data8, 1);
5761
5762                 CSR_WRITE_1(sc, RE_TDFNR, 0x8);
5763
5764                 Data32 = re_eri_read(sc, 0xD4, 4, ERIAR_ExGMAC);
5765                 Data32 |= BIT_11 | BIT_10;
5766                 re_eri_write(sc, 0xD4, 4, Data32, ERIAR_ExGMAC);
5767                 re_eri_write(sc, 0xC0, 2, 0x0000, ERIAR_ExGMAC);
5768                 re_eri_write(sc, 0xB8, 4, 0x00000000, ERIAR_ExGMAC);
5769                 re_eri_write(sc, 0xC8, 4, 0x00100002, ERIAR_ExGMAC);
5770                 re_eri_write(sc, 0xE8, 4, 0x00100006, ERIAR_ExGMAC);
5771                 Data32 = re_eri_read(sc, 0xdc, 4, ERIAR_ExGMAC);
5772                 Data32 &= ~BIT_0;
5773                 re_eri_write(sc, 0xdc, 1, Data32, ERIAR_ExGMAC);
5774                 Data32 |= BIT_0;
5775                 re_eri_write(sc, 0xdc, 1, Data32, ERIAR_ExGMAC);
5776                 Data32 = re_eri_read(sc, 0x1B0, 4, ERIAR_ExGMAC);
5777                 Data32 |= BIT_4;
5778                 re_eri_write(sc, 0x1B0, 4, Data32, ERIAR_ExGMAC);
5779                 re_eri_write(sc, 0xCC, 4, 0x00000050, ERIAR_ExGMAC);
5780                 re_eri_write(sc, 0xD0, 4, 0x00000060, ERIAR_ExGMAC);
5781                 Data32 = re_eri_read(sc, 0x1D0, 4, ERIAR_ExGMAC);
5782                 Data32 |= BIT_4;
5783                 re_eri_write(sc, 0x1D0, 4, Data32, ERIAR_ExGMAC);
5784
5785                 CSR_WRITE_4(sc, RE_TXCFG, CSR_READ_4(sc, RE_TXCFG) | BIT_7);
5786                 CSR_WRITE_1(sc, 0xD3, CSR_READ_1(sc, 0xD3) & ~BIT_7);
5787 //              CSR_WRITE_1(sc, 0x1B, CSR_READ_1(sc, 0x1B) & ~0x07);
5788
5789                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
5790
5791                 data16 = MP_ReadEPhyUshort(sc, 0x06);
5792                 data16 &= ~(BIT_7 | BIT_6);
5793                 data16 |= BIT_5;
5794                 MP_WriteEPhyUshort(sc, 0x06, data16);
5795
5796                 MP_WriteEPhyUshort(sc, 0x0f, 0x5200);
5797
5798                 data16 = MP_ReadEPhyUshort(sc, 0x1e);
5799                 data16 |= BIT_14;
5800                 MP_WriteEPhyUshort(sc, 0x1e, data16);
5801
5802                 data16 = MP_ReadEPhyUshort(sc, 0x19);
5803                 data16 |= (BIT_2 | BIT_5 | BIT_9);
5804                 MP_WriteEPhyUshort(sc, 0x19, data16);
5805
5806                 SetPCIePhyBit(sc, 0x00, BIT_3);
5807                 ClearAndSetPCIePhyBit(sc,
5808                                       0x0C,
5809                                       (BIT_13|BIT_12|BIT_11|BIT_10|BIT_8|BIT_7|BIT_6|BIT_5|BIT_4),
5810                                       BIT_9
5811                                      );
5812
5813                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
5814
5815                 CSR_WRITE_1(sc, 0xD0, CSR_READ_1(sc, 0xD0) | BIT_6);
5816                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) | BIT_6);
5817
5818                 CSR_WRITE_1 (sc, RE_MTPS, 0x27);
5819
5820                 if (ifp->if_mtu > ETHERMTU) {
5821                         ifp->if_capenable &= ~IFCAP_HWCSUM;
5822                         ifp->if_hwassist &= ~RE_CSUM_FEATURES;
5823                 } else {
5824                         if (sc->re_tx_cstag) {
5825                                 ifp->if_capenable |= IFCAP_TXCSUM;
5826                                 ifp->if_hwassist |= RE_CSUM_FEATURES;
5827                         }
5828                         if (sc->re_rx_cstag) {
5829                                 ifp->if_capenable |= IFCAP_RXCSUM;
5830                         }
5831                 }
5832         } else if (macver == 0x44800000) {
5833                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) | 0x80);
5834                 CSR_WRITE_1(sc, 0xF1, CSR_READ_1(sc, 0xF1) | 0x28);
5835                 CSR_WRITE_1(sc, 0xD3, CSR_READ_1(sc, 0xD3) | 0x0C);
5836                 CSR_WRITE_1(sc, 0xD3, CSR_READ_1(sc, 0xD3) & ~BIT_7);
5837                 CSR_WRITE_1(sc, 0xD0, CSR_READ_1(sc, 0xD0) | 0x40);
5838                 CSR_WRITE_2(sc, 0xE0, CSR_READ_2(sc, 0xE0) & ~0xDF9C);
5839
5840                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
5841         } else if (macver == 0x4C000000 || macver == 0x50800000 ||
5842                    macver == 0x5C800000 || macver == 0x54000000) {
5843                 CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) | BIT_5);
5844
5845                 if (sc->re_type == MACFG_59) {
5846                         MP_WriteMcuAccessRegWord(sc, 0xD3C0, 0x03F8);
5847                         MP_WriteMcuAccessRegWord(sc, 0xD3C2, 0x0000);
5848                 }
5849
5850                 if (sc->re_type == MACFG_68 || sc->re_type == MACFG_69) {
5851                         MP_WriteMcuAccessRegWord(sc, 0xD400, MP_ReadMcuAccessRegWord(sc, 0xD400) & ~(BIT_0));
5852
5853                         data16 = MP_ReadMcuAccessRegWord(sc, 0xE63E);
5854                         data16 &= ~(BIT_3 | BIT_2 | BIT_1);
5855                         MP_WriteMcuAccessRegWord(sc, 0xE63E, data16);
5856                         data16 |= (BIT_0);
5857                         MP_WriteMcuAccessRegWord(sc, 0xE63E, data16);
5858                         data16 &= ~(BIT_0);
5859                         MP_WriteMcuAccessRegWord(sc, 0xE63E, data16);
5860                         MP_WriteMcuAccessRegWord(sc, 0xC094, 0x0);
5861                         MP_WriteMcuAccessRegWord(sc, 0xC09E, 0x0);
5862
5863                         MP_WriteMcuAccessRegWord(sc, 0xE098, 0x0AA2);
5864                 }
5865
5866                 /*set configuration space offset 0x70f to 0x17*/
5867                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
5868                 Data32 &=0xC0FFFFFF;
5869                 Data32 |= (0x27 << 24);
5870                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
5871
5872                 data8 = pci_read_config(sc->dev, 0x79, 1);
5873                 data8 &= ~0x70;
5874                 data8 |= 0x50;
5875                 pci_write_config(sc->dev, 0x79, data8, 1);
5876
5877                 CSR_WRITE_1(sc, RE_TDFNR, 0x4);
5878
5879                 if (sc->re_type == MACFG_56 || sc->re_type == MACFG_57) {
5880                         Data32 = MP_ReadPciEConfigSpace(sc, 0x2710);
5881                         Data32 &=0xFFFF0FFF;
5882                         Data32 |= (0x04 << 12);
5883                         MP_WritePciEConfigSpace(sc, 0x2710, Data32);
5884                 }
5885
5886                 if (sc->re_type == MACFG_68 || sc->re_type == MACFG_69) {
5887                         Data32 = re_eri_read(sc, 0xD4, 4, ERIAR_ExGMAC);
5888                         Data32 |= (BIT_8 | BIT_9 | BIT_10 | BIT_11 | BIT_12);
5889                         re_eri_write(sc, 0xD4, 4, Data32, ERIAR_ExGMAC);
5890
5891                         Data32 = re_eri_read(sc, 0xDC, 4, ERIAR_ExGMAC);
5892                         Data32 |= (BIT_2| BIT_3 | BIT_4);
5893                         re_eri_write(sc, 0xDC, 4, Data32, ERIAR_ExGMAC);
5894                 } else {
5895                         Data32 = re_eri_read(sc, 0xD4, 4, ERIAR_ExGMAC);
5896                         Data32 |= (BIT_7 | BIT_8 | BIT_9 | BIT_10 | BIT_11 | BIT_12);
5897                         re_eri_write(sc, 0xD4, 4, Data32, ERIAR_ExGMAC);
5898                 }
5899
5900                 re_eri_write(sc, 0xC8, 4, 0x00080002, ERIAR_ExGMAC);
5901                 re_eri_write(sc, 0xCC, 1, 0x38, ERIAR_ExGMAC);
5902                 re_eri_write(sc, 0xD0, 1, 0x48, ERIAR_ExGMAC);
5903                 re_eri_write(sc, 0xE8, 4, 0x00100006, ERIAR_ExGMAC);
5904
5905                 if (sc->re_type == MACFG_68 || sc->re_type == MACFG_69)
5906                         MP_WriteMcuAccessRegWord(sc, 0xE054, 0xFC01);
5907
5908                 re_eri_write(sc, 0x5F0, 4, 0x4F87, ERIAR_ExGMAC);
5909
5910                 Data32 = re_eri_read(sc, 0xdc, 4, ERIAR_ExGMAC);
5911                 Data32 &= ~BIT_0;
5912                 re_eri_write(sc, 0xdc, 1, Data32, ERIAR_ExGMAC);
5913                 Data32 |= BIT_0;
5914                 re_eri_write(sc, 0xdc, 1, Data32, ERIAR_ExGMAC);
5915
5916                 Data32 = re_eri_read(sc, 0x2FC, 4, ERIAR_ExGMAC);
5917                 Data32 &= ~(BIT_0 | BIT_1 | BIT_2);
5918                 Data32 |= (BIT_0);
5919                 re_eri_write(sc, 0x2FC, 4, Data32, ERIAR_ExGMAC);
5920
5921                 Data32 = re_eri_read(sc, 0x1B0, 4, ERIAR_ExGMAC);
5922                 Data32 &= ~BIT_12;
5923                 re_eri_write(sc, 0x1B0, 4, Data32, ERIAR_ExGMAC);
5924
5925                 CSR_WRITE_4(sc, RE_TXCFG, CSR_READ_4(sc, RE_TXCFG) | BIT_7);
5926                 CSR_WRITE_1(sc, 0xD3, CSR_READ_1(sc, 0xD3) & ~BIT_7);
5927                 CSR_WRITE_1(sc, 0x1B, CSR_READ_1(sc, 0x1B) & ~0x07);
5928
5929                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
5930
5931                 if (sc->re_type == MACFG_56 || sc->re_type == MACFG_57) {
5932                         ClearPCIePhyBit(sc, 0x00, BIT_3);
5933                         ClearAndSetPCIePhyBit(sc,
5934                                               0x0C,
5935                                               (BIT_13|BIT_12|BIT_10|BIT_9|BIT_8|BIT_7|BIT_6|BIT_4),
5936                                               (BIT_11|BIT_5)
5937                                              );
5938                         SetPCIePhyBit(sc, 0x1E, BIT_0);
5939                         ClearPCIePhyBit(sc, 0x19, BIT_15);
5940                 }  else if (sc->re_type == MACFG_58) {
5941                         SetPCIePhyBit(sc, 0x00, (BIT_3));
5942                         ClearAndSetPCIePhyBit(sc,
5943                                               0x0C,
5944                                               (BIT_13 | BIT_12 | BIT_11 | BIT_10 | BIT_8 | BIT_7 | BIT_6 | BIT_5 | BIT_4),
5945                                               BIT_9
5946                                              );
5947                 }  else if (sc->re_type == MACFG_59) {
5948                         ClearPCIePhyBit(sc, 0x00, BIT_3);
5949                         ClearAndSetPCIePhyBit(sc,
5950                                               0x0C,
5951                                               (BIT_13 | BIT_12 | BIT_10 | BIT_9 | BIT_8 | BIT_7 | BIT_6 | BIT_4),
5952                                               (BIT_5 | BIT_11)
5953                                              );
5954
5955                         SetPCIePhyBit(sc, 0x1E, BIT_0);
5956                         ClearPCIePhyBit(sc, 0x19, BIT_15);
5957                         MP_WriteEPhyUshort(sc, 0x19, 0x7C00);
5958                         MP_WriteEPhyUshort(sc, 0x1E, 0x20EB);
5959                         MP_WriteEPhyUshort(sc, 0x0D, 0x1666);
5960                         MP_WriteEPhyUshort(sc, 0x00, 0x10A3);
5961
5962                         MP_WriteEPhyUshort(sc, 0x06, 0xF050);
5963
5964                         SetPCIePhyBit(sc, 0x04, BIT_4);
5965                         ClearPCIePhyBit(sc, 0x1D, BIT_14);
5966                 } else if (sc->re_type == MACFG_60) {
5967                         ClearPCIePhyBit(sc, 0x00, BIT_3);
5968                         ClearAndSetPCIePhyBit(sc,
5969                                               0x0C,
5970                                               (BIT_13 | BIT_12 | BIT_10 | BIT_9 | BIT_8 | BIT_7 | BIT_6 | BIT_4),
5971                                               (BIT_5 | BIT_11)
5972                                              );
5973                         SetPCIePhyBit(sc, 0x1E, BIT_0);
5974                         ClearPCIePhyBit(sc, 0x19, BIT_15);
5975
5976                         ClearPCIePhyBit(sc, 0x19, (BIT_5 | BIT_0));
5977
5978                         SetPCIePhyBit(sc, 0x1E, BIT_13);
5979                         ClearPCIePhyBit(sc, 0x0D, BIT_8);
5980                         SetPCIePhyBit(sc, 0x0D, BIT_9);
5981                         SetPCIePhyBit(sc, 0x00, BIT_7);
5982
5983                         SetPCIePhyBit(sc, 0x06, BIT_4);
5984
5985                         SetPCIePhyBit(sc, 0x04, BIT_4);
5986                         SetPCIePhyBit(sc, 0x1D, BIT_14);
5987                 } else if (sc->re_type == MACFG_68 || sc->re_type == MACFG_69) {
5988                         ClearPCIePhyBit(sc, 0x1E, BIT_11);
5989
5990                         SetPCIePhyBit(sc, 0x1E, BIT_0);
5991                         SetPCIePhyBit(sc, 0x1D, BIT_11);
5992
5993                         MP_WriteEPhyUshort(sc, 0x05, 0x2089);
5994                         MP_WriteEPhyUshort(sc, 0x06, 0x5881);
5995
5996                         MP_WriteEPhyUshort(sc, 0x04, 0x854A);
5997                         MP_WriteEPhyUshort(sc, 0x01, 0x068B);
5998                 }
5999
6000                 if (sc->re_type == MACFG_60) {
6001                         data16 = MP_ReadMcuAccessRegWord(sc, 0xD3C0);
6002                         data16 &= 0xF000;
6003                         data16 |= 0x3A9;
6004                         MP_WriteMcuAccessRegWord(sc, 0xD3C0, data16);
6005
6006                         data16 = MP_ReadMcuAccessRegWord(sc, 0xD3C2);
6007                         data16 &= 0xFF00;
6008                         MP_WriteMcuAccessRegWord(sc, 0xD3C2, data16);
6009
6010                         data16 = MP_ReadMcuAccessRegWord(sc, 0xD3C4);
6011                         data16 |= (BIT_0);
6012                         MP_WriteMcuAccessRegWord(sc, 0xD3C4, data16);
6013                 } else if (sc->re_type == MACFG_68 || sc->re_type == MACFG_69) {
6014                         if (sc->RequireAdjustUpsTxLinkPulseTiming) {
6015                                 data16 = MP_ReadMcuAccessRegWord(sc, 0xD412);
6016                                 data16 &= ~(0x0FFF);
6017                                 data16 |= sc->SwrCnt1msIni;
6018                                 MP_WriteMcuAccessRegWord(sc, 0xD412, data16);
6019                         }
6020
6021                         data16 = MP_ReadMcuAccessRegWord(sc, 0xE056);
6022                         data16 &= ~(BIT_7 | BIT_6 | BIT_5 | BIT_4);
6023                         data16 |= (BIT_6 | BIT_5 | BIT_4);
6024                         MP_WriteMcuAccessRegWord(sc, 0xE056, data16);
6025
6026                         data16 = MP_ReadMcuAccessRegWord(sc, 0xE052);
6027                         data16 &= ~(BIT_14 | BIT_13);
6028                         data16 |= BIT_15;
6029                         data16 |= BIT_3;
6030                         MP_WriteMcuAccessRegWord(sc, 0xE052, data16);
6031
6032                         data16 = MP_ReadMcuAccessRegWord(sc, 0xD420);
6033                         data16 &= ~(BIT_11 | BIT_10 | BIT_9 | BIT_8 | BIT_7 | BIT_6 | BIT_5 | BIT_4 | BIT_3 | BIT_2 | BIT_1 | BIT_0);
6034                         data16 |= 0x47F;
6035                         MP_WriteMcuAccessRegWord(sc, 0xD420, data16);
6036
6037                         data16 = MP_ReadMcuAccessRegWord(sc, 0xE0D6);
6038                         data16 &= ~(BIT_8 | BIT_7 | BIT_6 | BIT_5 | BIT_4 | BIT_3 | BIT_2 | BIT_1 | BIT_0);
6039                         data16 |= 0x17F;
6040                         MP_WriteMcuAccessRegWord(sc, 0xE0D6, data16);
6041                 }
6042
6043                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
6044
6045                 CSR_WRITE_1(sc, 0xD0, CSR_READ_1(sc, 0xD0) | BIT_6);
6046                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) | BIT_6);
6047
6048                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) & ~BIT_3);
6049
6050                 CSR_WRITE_1 (sc, RE_MTPS, 0x27);
6051
6052                 if (sc->re_type == MACFG_56 || sc->re_type == MACFG_57 ||
6053                     sc->re_type == MACFG_58 || sc->re_type == MACFG_59) {
6054                         MP_WriteMcuAccessRegWord(sc, 0xC140, 0xFFFF);
6055                 } else if (sc->re_type == MACFG_68 || sc->re_type == MACFG_69) {
6056                         MP_WriteMcuAccessRegWord(sc, 0xC140, 0xFFFF);
6057                         MP_WriteMcuAccessRegWord(sc, 0xC142, 0xFFFF);
6058                 }
6059
6060                 if (ifp->if_mtu > ETHERMTU) {
6061                         ifp->if_capenable &= ~IFCAP_HWCSUM;
6062                         ifp->if_hwassist &= ~RE_CSUM_FEATURES;
6063                 } else {
6064                         if (sc->re_tx_cstag) {
6065                                 ifp->if_capenable |= IFCAP_TXCSUM;
6066                                 ifp->if_hwassist |= RE_CSUM_FEATURES;
6067                         }
6068                         if (sc->re_rx_cstag) {
6069                                 ifp->if_capenable |= IFCAP_RXCSUM;
6070                         }
6071                 }
6072         } else if (macver == 0x50000000) {
6073                 /*set configuration space offset 0x70f to 0x17*/
6074                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
6075                 Data32 &=0xC0FFFFFF;
6076                 Data32 |= (0x27 << 24);
6077                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
6078
6079                 data8 = pci_read_config(sc->dev, 0x79, 1);
6080                 data8 &= ~0x70;
6081                 data8 |= 0x50;
6082                 pci_write_config(sc->dev, 0x79, data8, 1);
6083
6084                 Data32 = re_eri_read(sc, 0xD4, 4, ERIAR_ExGMAC);
6085                 Data32 |= BIT_7 | BIT_8 | BIT_9 | BIT_10 | BIT_11 | BIT_12;
6086                 re_eri_write(sc, 0xD4, 4, Data32, ERIAR_ExGMAC);
6087
6088                 re_eri_write(sc, 0xC8, 4, 0x00080002, ERIAR_ExGMAC);
6089                 re_eri_write(sc, 0xCC, 1, 0x2F, ERIAR_ExGMAC);
6090                 re_eri_write(sc, 0xD0, 1, 0x5F, ERIAR_ExGMAC);
6091                 re_eri_write(sc, 0xE8, 4, 0x00100006, ERIAR_ExGMAC);
6092
6093                 if (sc->re_type == MACFG_62 || sc->re_type == MACFG_67) {
6094                         OOB_mutex_lock(sc);
6095                         re_eri_write(sc, 0x5F0, 4, 0x4F87, ERIAR_ExGMAC);
6096                         OOB_mutex_unlock(sc);
6097                 }
6098
6099                 Data32 = re_eri_read(sc, 0xdc, 4, ERIAR_ExGMAC);
6100                 Data32 &= ~BIT_0;
6101                 re_eri_write(sc, 0xdc, 1, Data32, ERIAR_ExGMAC);
6102                 Data32 |= BIT_0;
6103                 re_eri_write(sc, 0xdc, 1, Data32, ERIAR_ExGMAC);
6104
6105                 Data32 = re_eri_read(sc, 0x2FC, 4, ERIAR_ExGMAC);
6106                 Data32 &= ~(BIT_0 | BIT_1 | BIT_2);
6107                 Data32 |= (BIT_0);
6108                 re_eri_write(sc, 0x2FC, 4, Data32, ERIAR_ExGMAC);
6109
6110                 Data32 = re_eri_read(sc, 0x1B0, 4, ERIAR_ExGMAC);
6111                 Data32 &= ~BIT_12;
6112                 re_eri_write(sc, 0x1B0, 4, Data32, ERIAR_ExGMAC);
6113
6114                 CSR_WRITE_4(sc, RE_TXCFG, CSR_READ_4(sc, RE_TXCFG) | BIT_7);
6115                 CSR_WRITE_1(sc, 0xD3, CSR_READ_1(sc, 0xD3) & ~BIT_7);
6116                 CSR_WRITE_1(sc, 0x1B, CSR_READ_1(sc, 0x1B) & ~0x07);
6117
6118                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
6119
6120                 if (sc->re_type == MACFG_61) {
6121                         MP_WriteEPhyUshort(sc, 0x00, 0x10AB);
6122                         MP_WriteEPhyUshort(sc, 0x06, 0xF030);
6123                         MP_WriteEPhyUshort(sc, 0x08, 0x2006);
6124                         MP_WriteEPhyUshort(sc, 0x0D, 0x1666);
6125                         ClearPCIePhyBit(sc, 0x0C, (BIT_13 | BIT_12 | BIT_11 | BIT_10 | BIT_9 | BIT_8 | BIT_7 | BIT_6 | BIT_5 | BIT_4));
6126                 }  else if (sc->re_type == MACFG_62) {
6127                         MP_WriteEPhyUshort(sc, 0x00, 0x10A3);
6128                         MP_WriteEPhyUshort(sc, 0x19, 0xFC00);
6129                         MP_WriteEPhyUshort(sc, 0x1E, 0x20EA);
6130                 } else if (sc->re_type == MACFG_67) {
6131                         SetPCIePhyBit(sc, 0x00, BIT_7);
6132                         ClearAndSetPCIePhyBit(sc,
6133                                               0x0D,
6134                                               BIT_8,
6135                                               BIT_9
6136                                              );
6137                         ClearPCIePhyBit(sc, 0x19, (BIT_15 | BIT_5 | BIT_0));
6138                         SetPCIePhyBit(sc, 0x1E, BIT_13);
6139                 }
6140
6141                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
6142
6143                 CSR_WRITE_1(sc, 0xD0, CSR_READ_1(sc, 0xD0) | BIT_6);
6144                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) | BIT_6);
6145
6146                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) & ~BIT_3);
6147
6148                 CSR_WRITE_1 (sc, RE_MTPS, 0x27);
6149
6150                 if (sc->re_type == MACFG_67) {
6151                         data16 = MP_ReadMcuAccessRegWord(sc, 0xD3E2);
6152                         data16 &= 0xF000;
6153                         data16 |= 0x3A9;
6154                         MP_WriteMcuAccessRegWord(sc, 0xD3E2, data16);
6155
6156                         data16 = MP_ReadMcuAccessRegWord(sc, 0xD3E4);
6157                         data16 &= 0xFF00;
6158                         MP_WriteMcuAccessRegWord(sc, 0xD3E4, data16);
6159
6160                         data16 = MP_ReadMcuAccessRegWord(sc, 0xE860);
6161                         data16 |= BIT_7;
6162                         MP_WriteMcuAccessRegWord(sc, 0xE860, data16);
6163                 }
6164
6165                 MP_WriteMcuAccessRegWord(sc, 0xC140, 0xFFFF);
6166                 MP_WriteMcuAccessRegWord(sc, 0xC142, 0xFFFF);
6167
6168                 if (ifp->if_mtu > ETHERMTU) {
6169                         ifp->if_capenable &= ~IFCAP_HWCSUM;
6170                         ifp->if_hwassist &= ~RE_CSUM_FEATURES;
6171                 } else {
6172                         if (sc->re_tx_cstag) {
6173                                 ifp->if_capenable |= IFCAP_TXCSUM;
6174                                 ifp->if_hwassist |= RE_CSUM_FEATURES;
6175                         }
6176                         if (sc->re_rx_cstag) {
6177                                 ifp->if_capenable |= IFCAP_RXCSUM;
6178                         }
6179                 }
6180         } else if (macver == 0x54800000) {
6181                 MP_WriteMcuAccessRegWord(sc, 0xD400, MP_ReadMcuAccessRegWord(sc, 0xD400) & ~(BIT_0));
6182
6183                 if (sc->RequireAdjustUpsTxLinkPulseTiming) {
6184                         data16 = MP_ReadMcuAccessRegWord(sc, 0xD412);
6185                         data16 &= ~(0x0FFF);
6186                         data16 |= sc->SwrCnt1msIni;
6187                         MP_WriteMcuAccessRegWord(sc, 0xD412, data16);
6188                 }
6189
6190                 data16 = MP_ReadMcuAccessRegWord(sc, 0xE056);
6191                 data16 &= ~(BIT_7 | BIT_6 | BIT_5 | BIT_4);
6192                 data16 |= (BIT_6 | BIT_5 | BIT_4);
6193                 MP_WriteMcuAccessRegWord(sc, 0xE056, data16);
6194
6195                 OOB_mutex_lock(sc);
6196                 data16 = MP_ReadMcuAccessRegWord(sc, 0xE052);
6197                 if (sc->re_type == MACFG_71)
6198                         data16 |= BIT_3;
6199                 else
6200                         data16 &= ~BIT_3;
6201                 MP_WriteMcuAccessRegWord(sc, 0xE052, data16);
6202                 OOB_mutex_unlock(sc);
6203
6204                 data16 = MP_ReadMcuAccessRegWord(sc, 0xD420);
6205                 data16 &= ~(BIT_11 | BIT_10 | BIT_9 | BIT_8 | BIT_7 | BIT_6 | BIT_5 | BIT_4 | BIT_3 | BIT_2 | BIT_1 | BIT_0);
6206                 data16 |= 0x47F;
6207                 MP_WriteMcuAccessRegWord(sc, 0xD420, data16);
6208
6209                 CSR_WRITE_1(sc, RE_TDFNR, 0x4);
6210
6211                 data16 = MP_ReadMcuAccessRegWord(sc, 0xE63E);
6212                 data16 &= ~(BIT_3 | BIT_2 | BIT_1);
6213                 MP_WriteMcuAccessRegWord(sc, 0xE63E, data16);
6214                 data16 |= (BIT_0);
6215                 MP_WriteMcuAccessRegWord(sc, 0xE63E, data16);
6216                 data16 &= ~(BIT_0);
6217                 MP_WriteMcuAccessRegWord(sc, 0xE63E, data16);
6218                 MP_WriteMcuAccessRegWord(sc, 0xC094, 0x0);
6219                 MP_WriteMcuAccessRegWord(sc, 0xC09E, 0x0);
6220
6221                 /*set configuration space offset 0x70f to 0x27*/
6222                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
6223                 Data32 &=0xC0FFFFFF;
6224                 Data32 |= (0x27 << 24);
6225                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
6226
6227                 data8 = pci_read_config(sc->dev, 0x79, 1);
6228                 data8 &= ~0x70;
6229                 data8 |= 0x50;
6230                 pci_write_config(sc->dev, 0x79, data8, 1);
6231
6232                 Data32 = re_eri_read(sc, 0xD4, 4, ERIAR_ExGMAC);
6233                 Data32 |= BIT_7 | BIT_8 | BIT_9 | BIT_10 | BIT_11 | BIT_12;
6234                 re_eri_write(sc, 0xD4, 4, Data32, ERIAR_ExGMAC);
6235
6236                 re_eri_write(sc, 0xC8, 4, 0x00080002, ERIAR_ExGMAC);
6237                 re_eri_write(sc, 0xCC, 1, 0x2F, ERIAR_ExGMAC);
6238                 re_eri_write(sc, 0xD0, 1, 0x5F, ERIAR_ExGMAC);
6239                 re_eri_write(sc, 0xE8, 4, 0x00100006, ERIAR_ExGMAC);
6240
6241                 MP_WriteMcuAccessRegWord(sc, 0xE054, 0xFC01);
6242
6243                 OOB_mutex_lock(sc);
6244                 Data32 = re_eri_read(sc, 0x5F0, 4, ERIAR_ExGMAC);
6245                 Data32 |= (BIT_8 | BIT_9 | BIT_10 | BIT_11);
6246                 re_eri_write(sc, 0x5F0, 4, Data32, ERIAR_ExGMAC);
6247                 OOB_mutex_unlock(sc);
6248
6249                 Data32 = re_eri_read(sc, 0xdc, 4, ERIAR_ExGMAC);
6250                 Data32 &= ~BIT_0;
6251                 re_eri_write(sc, 0xdc, 1, Data32, ERIAR_ExGMAC);
6252                 Data32 |= BIT_0;
6253                 re_eri_write(sc, 0xdc, 1, Data32, ERIAR_ExGMAC);
6254
6255                 Data32 = re_eri_read(sc, 0x2FC, 4, ERIAR_ExGMAC);
6256                 Data32 &= ~(BIT_0 | BIT_1 | BIT_2);
6257                 Data32 |= (BIT_0);
6258                 re_eri_write(sc, 0x2FC, 4, Data32, ERIAR_ExGMAC);
6259
6260                 Data32 = re_eri_read(sc, 0x1B0, 4, ERIAR_ExGMAC);
6261                 Data32 &= ~BIT_12;
6262                 re_eri_write(sc, 0x1B0, 4, Data32, ERIAR_ExGMAC);
6263
6264                 Data32 = re_eri_read(sc, 0x1D0, 1, ERIAR_ExGMAC);
6265                 Data32 &= ~BIT_1;
6266                 re_eri_write(sc, 0x1D0, 1, Data32, ERIAR_ExGMAC);
6267
6268                 re_eri_write(sc, 0xC0, 2, 0x0000, ERIAR_ExGMAC);
6269                 re_eri_write(sc, 0xB8, 4, 0x00000000, ERIAR_ExGMAC);
6270
6271                 CSR_WRITE_4(sc, RE_TXCFG, CSR_READ_4(sc, RE_TXCFG) | BIT_7);
6272                 CSR_WRITE_1(sc, 0xD3, CSR_READ_1(sc, 0xD3) & ~BIT_7);
6273                 CSR_WRITE_1(sc, 0x1B, CSR_READ_1(sc, 0x1B) & ~0x07);
6274
6275                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
6276
6277                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
6278
6279                 CSR_WRITE_1(sc, 0xD0, CSR_READ_1(sc, 0xD0) | BIT_6);
6280                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) | BIT_6);
6281
6282                 CSR_WRITE_1(sc, 0xD0, CSR_READ_1(sc, 0xD0) | BIT_7);
6283
6284                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) & ~BIT_3);
6285
6286                 if (ifp->if_mtu > ETHERMTU)
6287                         CSR_WRITE_1 (sc, RE_MTPS, 0x27);
6288
6289                 data16 = MP_ReadMcuAccessRegWord(sc, 0xD3E2);
6290                 data16 &= 0xF000;
6291                 data16 |= 0x3A9;
6292                 MP_WriteMcuAccessRegWord(sc, 0xD3E2, data16);
6293
6294                 data16 = MP_ReadMcuAccessRegWord(sc, 0xD3E4);
6295                 data16 &= 0xFF00;
6296                 MP_WriteMcuAccessRegWord(sc, 0xD3E4, data16);
6297
6298                 data16 = MP_ReadMcuAccessRegWord(sc, 0xE860);
6299                 data16 |= BIT_7;
6300                 MP_WriteMcuAccessRegWord(sc, 0xE860, data16);
6301
6302                 MP_WriteMcuAccessRegWord(sc, 0xC140, 0xFFFF);
6303                 MP_WriteMcuAccessRegWord(sc, 0xC142, 0xFFFF);
6304
6305                 if (ifp->if_mtu > ETHERMTU) {
6306                         ifp->if_capenable &= ~IFCAP_HWCSUM;
6307                         ifp->if_hwassist &= ~RE_CSUM_FEATURES;
6308                 } else {
6309                         if (sc->re_tx_cstag) {
6310                                 ifp->if_capenable |= IFCAP_TXCSUM;
6311                                 ifp->if_hwassist |= RE_CSUM_FEATURES;
6312                         }
6313                         if (sc->re_rx_cstag) {
6314                                 ifp->if_capenable |= IFCAP_RXCSUM;
6315                         }
6316                 }
6317         }
6318
6319         //clear io_rdy_l23
6320         switch (sc->re_type) {
6321         case MACFG_42:
6322         case MACFG_43:
6323         case MACFG_52:
6324         case MACFG_53:
6325         case MACFG_54:
6326         case MACFG_55:
6327         case MACFG_56:
6328         case MACFG_57:
6329         case MACFG_58:
6330         case MACFG_59:
6331         case MACFG_60:
6332         case MACFG_61:
6333         case MACFG_62:
6334         case MACFG_67:
6335         case MACFG_68:
6336         case MACFG_69:
6337         case MACFG_70:
6338         case MACFG_71:
6339                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_1);
6340                 break;
6341         }
6342
6343         switch(sc->re_type) {
6344         case MACFG_36:
6345         case MACFG_37:
6346         case MACFG_38:
6347         case MACFG_39:
6348         case MACFG_42:
6349         case MACFG_43:
6350         case MACFG_50:
6351         case MACFG_51:
6352         case MACFG_52:
6353         case MACFG_53:
6354         case MACFG_54:
6355         case MACFG_55:
6356         case MACFG_56:
6357         case MACFG_57:
6358         case MACFG_58:
6359         case MACFG_59:
6360         case MACFG_60:
6361         case MACFG_61:
6362         case MACFG_62:
6363         case MACFG_67:
6364         case MACFG_68:
6365         case MACFG_69:
6366         case MACFG_70:
6367         case MACFG_71:
6368                 CSR_WRITE_1(sc, RE_CFG5, CSR_READ_1(sc, RE_CFG5) | BIT_0);
6369                 CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) | BIT_7);
6370                 CSR_WRITE_1(sc, 0xF1, CSR_READ_1(sc, 0xF1) | BIT_7);
6371                 break;
6372         }
6373
6374         //clear wol
6375         re_clrwol(sc);
6376
6377         data16 = CSR_READ_2(sc, RE_CPlusCmd);
6378         if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0)
6379                 data16 |= RL_CPLUSCMD_VLANSTRIP;
6380         else
6381                 data16 &= ~RL_CPLUSCMD_VLANSTRIP;
6382
6383         if ((ifp->if_capenable & IFCAP_RXCSUM) != 0)
6384                 data16 |= RL_RxChkSum;
6385         else
6386                 data16 &= ~RL_RxChkSum;
6387         CSR_WRITE_2 (sc, RE_CPlusCmd, data16);
6388
6389         re_disable_cfg9346_write(sc);
6390         //CSR_WRITE_1(sc, 0xec, 0x3f);
6391
6392         if (sc->re_device_id == RT_DEVICEID_8169 || sc->re_device_id == RT_DEVICEID_8169SC) {
6393                 /* Enable transmit and receive.*/
6394                 CSR_WRITE_1(sc, RE_COMMAND, RE_CMD_TX_ENB | RE_CMD_RX_ENB);
6395
6396                 /* Set the initial TX configuration.*/
6397                 CSR_WRITE_4(sc, RE_TXCFG, RE_TXCFG_CONFIG);
6398
6399                 /* Set the initial RX configuration.*/
6400                 /*
6401                  * Program the multicast filter, if necessary.
6402                  */
6403                 re_set_rx_packet_filter(sc);
6404         } else {
6405                 /* Set the initial RX configuration.*/
6406                 /*
6407                  * Program the multicast filter, if necessary.
6408                  */
6409                 re_set_rx_packet_filter(sc);
6410
6411                 /* Enable transmit and receive.*/
6412                 CSR_WRITE_1(sc, RE_COMMAND, RE_CMD_TX_ENB | RE_CMD_RX_ENB);
6413         }
6414
6415 #ifndef __DragonFly__
6416         ifp->if_drv_flags |= IFF_DRV_RUNNING;
6417         ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
6418
6419         /*
6420         * Enable interrupts.
6421         */
6422         CSR_WRITE_2(sc, RE_IMR, RE_INTRS);
6423 #endif
6424 }
6425
6426 static void re_init_unlock(void *xsc)   /* Software & Hardware Initialize */
6427 {
6428         struct re_softc         *sc = xsc;
6429         struct ifnet            *ifp;
6430 #ifndef __DragonFly__
6431 #if OS_VER < VERSION(6,0)
6432         int                     i;
6433 #endif
6434 #endif  /* !__DragonFly__ */
6435         union {
6436                 uint32_t align_dummy;
6437                 u_char eaddr[ETHER_ADDR_LEN];
6438         } eaddr;
6439
6440         ifp = RE_GET_IFNET(sc);
6441
6442 #ifndef __DragonFly__
6443         /*
6444          * Cancel pending I/O and free all RX/TX buffers.
6445          */
6446         re_stop(sc);
6447 #endif  /* !__DragonFly__ */
6448
6449         /* Copy MAC address on stack to align. */
6450 #ifndef __DragonFly__
6451 #if OS_VER < VERSION(6,0)
6452         bcopy((char *)&sc->arpcom.ac_enaddr, eaddr.eaddr, ETHER_ADDR_LEN);
6453 #elif OS_VER < VERSION(7,0)
6454         bcopy(IFP2ENADDR(ifp), eaddr.eaddr, ETHER_ADDR_LEN);
6455 #else
6456         bcopy(IF_LLADDR(ifp), eaddr.eaddr, ETHER_ADDR_LEN);
6457 #endif
6458 #else   /* __DragonFly__ */
6459         bcopy(IF_LLADDR(ifp), eaddr.eaddr, ETHER_ADDR_LEN);
6460 #endif  /* !__DragonFly__ */
6461
6462         /* Init our MAC address */
6463         re_rar_set(sc, eaddr.eaddr);
6464
6465 #ifndef __DragonFly__
6466         re_hw_start_unlock(sc);
6467 #endif
6468
6469         return;
6470 }
6471
6472 #ifndef __DragonFly__
6473 static void re_init(void *xsc)          /* Software & Hardware Initialize */
6474 {
6475         struct re_softc         *sc = xsc;
6476         struct ifnet            *ifp;
6477
6478         RE_LOCK(sc);
6479         ifp = RE_GET_IFNET(sc);
6480
6481         if (re_link_ok(sc)) {
6482                 sc->link_state = LINK_STATE_UP;
6483                 re_link_state_change(ifp, sc->link_state);
6484                 re_link_on_patch(sc);
6485         }
6486
6487         sc->re_link_chg_det = 1;
6488         re_start_timer(sc);
6489
6490         RE_UNLOCK(sc);
6491 }
6492
6493 /*
6494  * Initialize the transmit descriptors.
6495  */
6496 static int re_var_init(struct re_softc *sc)
6497 {
6498         int                     i;
6499         union RxDesc *rxptr;
6500         union TxDesc *txptr;
6501
6502         sc->re_desc.rx_cur_index = 0;
6503         sc->re_desc.rx_last_index = 0;
6504         rxptr = sc->re_desc.rx_desc;
6505         for (i = 0; i < RE_RX_BUF_NUM; i++) {
6506                 memset(&rxptr[i], 0, sizeof(union RxDesc));
6507
6508                 /* Init the RX buffer pointer register. */
6509                 bus_dmamap_load(sc->re_desc.re_rx_mtag,
6510                                 sc->re_desc.re_rx_dmamap[i],
6511                                 sc->re_desc.rx_buf[i]->m_data, sc->re_rx_desc_buf_sz,
6512                                 re_rx_dma_map_buf,
6513                                 &rxptr[i],
6514                                 0);
6515                 bus_dmamap_sync(sc->re_desc.re_rx_mtag,
6516                                 sc->re_desc.re_rx_dmamap[i],
6517                                 BUS_DMASYNC_PREREAD);
6518
6519                 rxptr[i].ul[0] = htole32(sc->re_rx_desc_buf_sz);
6520                 if (i == (RE_RX_BUF_NUM - 1))
6521                         rxptr[i].ul[0] |= htole32(RL_RDESC_CMD_EOR);
6522                 rxptr[i].ul[0] |= htole32(RL_RDESC_CMD_OWN);
6523         }
6524
6525         bus_dmamap_load(sc->re_desc.rx_desc_tag,
6526                         sc->re_desc.rx_desc_dmamap,
6527                         sc->re_desc.rx_desc,
6528                         sizeof(union RxDesc)*RE_RX_BUF_NUM,
6529                         re_dma_map_rxdesc,
6530                         sc,
6531                         0);
6532         bus_dmamap_sync(sc->re_desc.rx_desc_tag,
6533                         sc->re_desc.rx_desc_dmamap,
6534                         BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
6535
6536         sc->re_desc.tx_cur_index = 0;
6537         sc->re_desc.tx_last_index = 0;
6538         txptr = sc->re_desc.tx_desc;
6539         for (i = 0; i < RE_TX_BUF_NUM; i++) {
6540                 memset(&txptr[i], 0, sizeof(union TxDesc));
6541                 if (i == (RE_TX_BUF_NUM - 1))
6542                         txptr[i].ul[0] = htole32(RL_TDESC_CMD_EOR);
6543         }
6544
6545         bus_dmamap_load(sc->re_desc.tx_desc_tag,
6546                         sc->re_desc.tx_desc_dmamap,
6547                         sc->re_desc.tx_desc,
6548                         sizeof(union RxDesc) * RE_TX_BUF_NUM,
6549                         re_dma_map_txdesc,
6550                         sc,
6551                         0);
6552         bus_dmamap_sync(sc->re_desc.tx_desc_tag,
6553                         sc->re_desc.tx_desc_dmamap,
6554                         BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
6555
6556         return 0;
6557 }
6558 #endif  /* !__DragonFly__ */
6559
6560 static void re_reset(struct re_softc *sc)
6561 {
6562         register int            i;
6563
6564         CSR_WRITE_4(sc, RE_RXCFG, CSR_READ_4(sc, RE_RXCFG)& ~0x3F);
6565
6566         switch (sc->re_type) {
6567         case MACFG_3:
6568         case MACFG_4:
6569         case MACFG_5:
6570         case MACFG_6:
6571                 DELAY(10000);
6572                 break;
6573         case MACFG_11:
6574         case MACFG_12:
6575         case MACFG_13:
6576         case MACFG_14:
6577         case MACFG_15:
6578         case MACFG_16:
6579         case MACFG_17:
6580         case MACFG_18:
6581         case MACFG_19:
6582         case MACFG_21:
6583         case MACFG_22:
6584         case MACFG_23:
6585         case MACFG_24:
6586         case MACFG_25:
6587         case MACFG_26:
6588         case MACFG_27:
6589         case MACFG_28:
6590         case MACFG_31:
6591         case MACFG_32:
6592         case MACFG_33:
6593         case MACFG_36:
6594         case MACFG_37:
6595         case MACFG_41:
6596         case MACFG_42:
6597         case MACFG_43:
6598         case MACFG_54:
6599         case MACFG_55:
6600         case MACFG_63:
6601         case MACFG_64:
6602         case MACFG_65:
6603         case MACFG_66:
6604                 CSR_WRITE_1(sc, RE_COMMAND, 0x8C);
6605                 break;
6606         case MACFG_38:
6607         case MACFG_39:
6608         case MACFG_50:
6609         case MACFG_51:
6610         case MACFG_52:
6611         case MACFG_53:
6612                 CSR_WRITE_1(sc, RE_COMMAND, 0x8C);
6613                 while (!(CSR_READ_4(sc,RE_TXCFG) & BIT_11)) DELAY(100);
6614                 break;
6615         case MACFG_56:
6616         case MACFG_57:
6617         case MACFG_58:
6618         case MACFG_59:
6619         case MACFG_60:
6620         case MACFG_61:
6621         case MACFG_62:
6622         case MACFG_67:
6623         case MACFG_68:
6624         case MACFG_69:
6625         case MACFG_70:
6626         case MACFG_71:
6627                 DELAY(2000);
6628                 break;
6629         default:
6630                 DELAY(10000);
6631                 break;
6632         }
6633         DELAY(200);
6634         CSR_WRITE_1(sc, RE_COMMAND, RE_CMD_RESET);
6635
6636         for (i = 0; i < RE_TIMEOUT; i++) {
6637                 DELAY(10);
6638                 if (!(CSR_READ_1(sc, RE_COMMAND) & RE_CMD_RESET))
6639                         break;
6640         }
6641
6642         if (i == RE_TIMEOUT)
6643                 device_printf(sc->dev,"reset never completed!\n");
6644
6645         return;
6646 }
6647
6648 static u_int8_t re_link_ok(struct re_softc *sc)
6649 {
6650         u_int8_t        retval;
6651
6652         retval = (CSR_READ_1(sc, RE_PHY_STATUS) & RL_PHY_STATUS_LINK_STS) ? 1 : 0;
6653
6654         return retval;
6655 }
6656
6657 static void
6658 re_set_wol_linkspeed(struct re_softc *sc)
6659 {
6660         u_int8_t wol_link_speed;
6661         u_int16_t anar;
6662
6663         MP_WritePhyUshort(sc, 0x1F, 0x0000);
6664
6665         wol_link_speed = RE_WOL_LINK_SPEED_100M_FIRST;
6666         if (!sc->re_dash) {
6667                 if (re_link_ok(sc)) {
6668                         u_int16_t anlpar;
6669
6670                         anlpar = MP_ReadPhyUshort(sc,MII_ANLPAR);
6671                         if ((anlpar & ANLPAR_10_FD) || (anlpar & ANLPAR_10)) {
6672                                 wol_link_speed = RE_WOL_LINK_SPEED_10M_FIRST;
6673                         } else {
6674                                 wol_link_speed = RE_WOL_LINK_SPEED_100M_FIRST;
6675                         }
6676                 }
6677         }
6678
6679         anar = MP_ReadPhyUshort(sc,MII_ANAR);
6680
6681         if (wol_link_speed == RE_WOL_LINK_SPEED_10M_FIRST)
6682                 anar &= ~(ANAR_TX_FD | ANAR_TX);
6683
6684         if (sc->re_device_id==RT_DEVICEID_8169 || sc->re_device_id==RT_DEVICEID_8169SC ||
6685             sc->re_device_id==RT_DEVICEID_8168 || sc->re_device_id==RT_DEVICEID_8161) {
6686                 u_int16_t gbcr;
6687
6688                 gbcr = MP_ReadPhyUshort(sc,MII_100T2CR);
6689                 gbcr &= ~(GTCR_ADV_1000TFDX|GTCR_ADV_1000THDX);
6690                 MP_WritePhyUshort(sc, MII_100T2CR, gbcr);
6691                 MP_WritePhyUshort(sc, MII_ANAR, anar);
6692                 MP_WritePhyUshort(sc, MII_BMCR, BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG);
6693         } else if (sc->re_type == MACFG_36) {
6694                 MP_WritePhyUshort(sc, MII_ANAR, anar);
6695                 MP_WritePhyUshort(sc, MII_BMCR, BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG);
6696         } else {
6697                 MP_WritePhyUshort(sc, MII_ANAR, anar);
6698                 MP_WritePhyUshort(sc, MII_BMCR, BMCR_AUTOEN | BMCR_STARTNEG);
6699         }
6700 }
6701
6702 #ifndef __DragonFly__
6703 static void
6704 re_setwol(struct re_softc *sc)
6705 {
6706         struct ifnet            *ifp;
6707         int                     pmc;
6708         uint16_t                pmstat;
6709         uint8_t                 v;
6710
6711         RE_LOCK_ASSERT(sc);
6712
6713         ifp = RE_GET_IFNET(sc);
6714
6715         if ((ifp->if_capenable & IFCAP_WOL) == 0) {
6716                 re_phy_power_down(sc->dev);
6717                 return;
6718         }
6719
6720         if (pci_find_cap(sc->dev, PCIY_PMG, &pmc) != 0)
6721                 return;
6722
6723         /* Enable config register write. */
6724         re_enable_cfg9346_write(sc);
6725
6726         /* Enable PME. */
6727         if (sc->re_device_id==RT_DEVICEID_8169 || sc->re_device_id==RT_DEVICEID_8169SC) {
6728                 v = CSR_READ_1(sc, RE_CFG1);
6729                 v &= ~RE_CFG1_PME;
6730                 if ((ifp->if_capenable & IFCAP_WOL) != 0)
6731                         v |= RE_CFG1_PME;
6732                 CSR_WRITE_1(sc, RE_CFG1, v);
6733         }
6734
6735         if (sc->re_if_flags & RL_FLAG_MAGIC_PACKET_V2) {
6736                 uint32_t                Data32;
6737
6738                 Data32 = re_eri_read(sc, 0xDC, 4, ERIAR_ExGMAC);
6739                 Data32 &= ~(BIT_16);
6740                 if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0)
6741                         Data32 |= BIT_16;
6742                 re_eri_write(sc, 0xDC, 4, Data32, ERIAR_ExGMAC);
6743         } else {
6744                 v = CSR_READ_1(sc, RE_CFG3);
6745                 v &= ~(RL_CFG3_WOL_MAGIC);
6746                 if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0)
6747                         v |= RL_CFG3_WOL_MAGIC;
6748                 CSR_WRITE_1(sc, RE_CFG3, v);
6749         }
6750
6751         v = CSR_READ_1(sc, RE_CFG5);
6752         v &= ~(RL_CFG5_WOL_BCAST | RL_CFG5_WOL_MCAST | RL_CFG5_WOL_UCAST |
6753                RL_CFG5_WOL_LANWAKE);
6754
6755         if ((ifp->if_capenable & IFCAP_WOL_UCAST) != 0)
6756                 v |= RL_CFG5_WOL_UCAST;
6757         if ((ifp->if_capenable & IFCAP_WOL_MCAST) != 0)
6758                 v |= RL_CFG5_WOL_MCAST | RL_CFG5_WOL_BCAST;
6759         if ((ifp->if_capenable & IFCAP_WOL) != 0)
6760                 v |= RL_CFG5_WOL_LANWAKE;
6761         CSR_WRITE_1(sc, RE_CFG5, v);
6762
6763         /* Config register write done. */
6764         re_disable_cfg9346_write(sc);
6765
6766         /*
6767          * It seems that hardware resets its link speed to 100Mbps in
6768          * power down mode so switching to 100Mbps in driver is not
6769          * needed.
6770          */
6771
6772         /* Request PME if WOL is requested. */
6773         pmstat = pci_read_config(sc->dev, pmc + PCIR_POWER_STATUS, 2);
6774         pmstat &= ~(PCIM_PSTAT_PMEENABLE);
6775         if ((ifp->if_capenable & IFCAP_WOL) != 0)
6776                 pmstat |= PCIM_PSTAT_PMEENABLE;
6777         pci_write_config(sc->dev, pmc + PCIR_POWER_STATUS, pmstat, 2);
6778
6779         /* Put controller into sleep mode. */
6780         if ((ifp->if_capenable & IFCAP_WOL) != 0) {
6781                 re_set_rx_packet_filter_in_sleep_state(sc);
6782                 re_set_wol_linkspeed(sc);
6783                 if (sc->re_type == MACFG_21 || sc->re_type == MACFG_22)
6784                         CSR_WRITE_1(sc, RE_COMMAND, RE_CMD_RX_ENB);
6785         }
6786 }
6787 #endif  /* !__DragonFly__ */
6788
6789 static void
6790 re_clrwol(struct re_softc *sc)
6791 {
6792         int                     pmc;
6793         uint16_t                pmstat;
6794         uint8_t                 v;
6795
6796         RE_LOCK_ASSERT(sc);
6797
6798 #ifndef __DragonFly__
6799         if (pci_find_cap(sc->dev, PCIY_PMG, &pmc) != 0)
6800                 return;
6801 #else
6802         if (pci_find_extcap(sc->dev, PCIY_PMG, &pmc) != 0)
6803                 return;
6804 #endif
6805
6806         /* Disable PME and clear PME status. */
6807         pmstat = pci_read_config(sc->dev, pmc + PCIR_POWER_STATUS, 2);
6808         pmstat &= ~PCIM_PSTAT_PMEENABLE;
6809         pci_write_config(sc->dev, pmc + PCIR_POWER_STATUS, pmstat, 2);
6810
6811         /* Enable config register write. */
6812         re_enable_cfg9346_write(sc);
6813
6814         if (sc->re_device_id==RT_DEVICEID_8169 || sc->re_device_id==RT_DEVICEID_8169SC) {
6815                 v = CSR_READ_1(sc, RE_CFG1);
6816                 v &= ~RE_CFG1_PME;
6817                 CSR_WRITE_1(sc, RE_CFG1, v);
6818         }
6819
6820         v = CSR_READ_1(sc, RE_CFG3);
6821         v &= ~(RL_CFG3_WOL_LINK);
6822         CSR_WRITE_1(sc, RE_CFG3, v);
6823
6824         if (sc->re_if_flags & RL_FLAG_MAGIC_PACKET_V2) {
6825                 uint32_t                Data32;
6826
6827                 Data32 = re_eri_read(sc, 0xDC, 4, ERIAR_ExGMAC);
6828                 Data32 &= ~(BIT_16);
6829                 re_eri_write(sc, 0xDC, 4, Data32, ERIAR_ExGMAC);
6830         } else {
6831                 v = CSR_READ_1(sc, RE_CFG3);
6832                 v &= ~(RL_CFG3_WOL_MAGIC);
6833                 CSR_WRITE_1(sc, RE_CFG3, v);
6834         }
6835
6836         v = CSR_READ_1(sc, RE_CFG5);
6837         v &= ~(RL_CFG5_WOL_BCAST | RL_CFG5_WOL_MCAST | RL_CFG5_WOL_UCAST);
6838         v &= ~RL_CFG5_WOL_LANWAKE;
6839         CSR_WRITE_1(sc, RE_CFG5, v);
6840
6841         /* Config register write done. */
6842         re_disable_cfg9346_write(sc);
6843 }
6844
6845 /*
6846  * Stop the adapter and free any mbufs allocated to the
6847  * RX and TX lists.
6848  */
6849 #ifndef __DragonFly__
6850 static void re_stop(struct re_softc *sc)        /* Stop Driver */
6851 #else   /* __DragonFly__ */
6852 static void
6853 re_stop_rtl(struct re_softc *sc)
6854 #endif  /* !__DragonFly__ */
6855 {
6856 #ifndef __DragonFly__
6857         struct ifnet            *ifp;
6858
6859         /*      RE_LOCK_ASSERT(sc);*/
6860
6861         ifp = RE_GET_IFNET(sc);
6862 #if OS_VER < VERSION(9,0)
6863         ifp->if_timer = 0;
6864 #endif
6865
6866         re_stop_timer(sc);
6867 #endif  /* !__DragonFly__ */
6868
6869         /*
6870          * Disable accepting frames to put RX MAC into idle state.
6871          * Otherwise it's possible to get frames while stop command
6872          * execution is in progress and controller can DMA the frame
6873          * to already freed RX buffer during that period.
6874          */
6875         CSR_WRITE_4(sc, RE_RXCFG, CSR_READ_4(sc, RE_RXCFG) &
6876                     ~(RE_RXCFG_RX_ALLPHYS | RE_RXCFG_RX_INDIV | RE_RXCFG_RX_MULTI |
6877                       RE_RXCFG_RX_BROAD | RE_RXCFG_RX_RUNT | RE_RXCFG_RX_ERRPKT));
6878
6879         CSR_WRITE_2(sc, RE_IMR, 0x0000);
6880         CSR_WRITE_2(sc, RE_ISR, 0xffff);
6881         if (sc->re_type == MACFG_50 || sc->re_type == MACFG_51 || sc->re_type == MACFG_52) {
6882                 re_eri_write(sc, 0x1bc, 4, 0x0000001f, ERIAR_ExGMAC);
6883                 re_eri_write(sc, 0x1dc, 4, 0x0000002d, ERIAR_ExGMAC);
6884         } else if (sc->re_type == MACFG_38) {
6885                 re_eri_write(sc, 0x1bc, 4, 0x0000001f, ERIAR_ExGMAC);
6886                 re_eri_write(sc, 0x1dc, 4, 0x0000003f, ERIAR_ExGMAC);
6887         }
6888         re_reset(sc);
6889
6890 #ifndef __DragonFly__
6891         /*
6892          * Free the TX list buffers.
6893          */
6894         while (sc->re_desc.tx_last_index!=sc->re_desc.tx_cur_index) {
6895                 if (sc->re_desc.re_tx_mtag) {
6896                         bus_dmamap_sync(sc->re_desc.re_tx_mtag,
6897                                         sc->re_desc.re_tx_dmamap[sc->re_desc.tx_last_index],
6898                                         BUS_DMASYNC_POSTWRITE);
6899                         bus_dmamap_unload(sc->re_desc.re_tx_mtag,
6900                                           sc->re_desc.re_tx_dmamap[sc->re_desc.tx_last_index]);
6901                 }
6902
6903                 if (sc->re_desc.tx_buf[sc->re_desc.tx_last_index]!=NULL) {
6904                         m_freem(sc->re_desc.tx_buf[sc->re_desc.tx_last_index]);
6905                         sc->re_desc.tx_buf[sc->re_desc.tx_last_index] = NULL;
6906                 }
6907                 sc->re_desc.tx_last_index = (sc->re_desc.tx_last_index+1)%RE_TX_BUF_NUM;
6908         }
6909
6910         ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
6911
6912         return;
6913 #endif  /* !__DragonFly__ */
6914 }
6915
6916 #ifndef __DragonFly__
6917 /*
6918  * Main transmit routine.
6919  */
6920 static void re_start(struct ifnet *ifp)         /* Transmit Packet*/
6921 {
6922         struct re_softc         *sc;
6923         struct mbuf             *m_head = NULL;
6924
6925         sc = ifp->if_softc;     /* Paste to ifp in function re_attach(dev) */
6926
6927         RE_LOCK(sc);
6928
6929         /*      RE_LOCK_ASSERT(sc);*/
6930
6931         if ((sc->driver_detach == 1) || (sc->rx_fifo_overflow != 0)) {
6932                 RE_UNLOCK(sc);
6933                 return;
6934         }
6935
6936         while (1) {
6937                 int fs = 1, ls = 0, TxLen = 0, PktLen;
6938                 struct mbuf *ptr;
6939                 uint32_t  opts1 =0;
6940                 uint32_t  opts2 =0;
6941                 IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);  /* Remove(get) data from system transmit queue */
6942                 if (m_head == NULL) {
6943                         break;
6944                 }
6945
6946                 if (sc->re_coalesce_tx_pkt) {
6947                         if (re_encap(sc, m_head)) {
6948                                 IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
6949                                 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
6950                                 break;
6951                         }
6952
6953                         m_head = sc->re_desc.tx_buf[sc->re_desc.tx_cur_index];
6954                 }
6955
6956                 if (CountMbufNum(m_head) > CountFreeTxDescNum(sc->re_desc)) {   /* No enough descriptor */
6957                         IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
6958                         ifp->if_drv_flags |= IFF_DRV_OACTIVE;
6959                         break;
6960                 }
6961
6962                 if (ifp->if_bpf) {              /* If there's a BPF listener, bounce a copy of this frame to him. */
6963                         //printf("If there's a BPF listener, bounce a copy of this frame to him. \n");
6964
6965                         /*#if OS_VER < VERSION(5, 1)*/
6966 #if OS_VER < VERSION(4,9)
6967                         bpf_mtap(ifp, m_head);
6968 #else
6969                         bpf_mtap(ifp->if_bpf, m_head);
6970 #endif
6971                 }
6972
6973                 //hw checksum
6974                 if (ifp->if_capenable & IFCAP_TXCSUM) {
6975                         if ((m_head->m_pkthdr.csum_flags & RE_CSUM_FEATURES) !=0)       {
6976                                 if (!(sc->re_if_flags & RL_FLAG_DESCV2)) {
6977                                         opts1 |= RL_IPV4CS1;
6978                                         if ((m_head->m_pkthdr.csum_flags & CSUM_TCP)!=0)
6979                                                 opts1 |=RL_TCPCS1;
6980                                         if ((m_head->m_pkthdr.csum_flags & CSUM_UDP)!=0)
6981                                                 opts1 |=RL_UDPCS1;
6982                                 } else {
6983                                         opts2 |=  RL_IPV4CS;
6984                                         if ((m_head->m_pkthdr.csum_flags & CSUM_TCP)!=0)
6985                                                 opts2 |= RL_TCPCS;
6986                                         else if ((m_head->m_pkthdr.csum_flags & CSUM_UDP)!=0)
6987                                                 opts2 |= RL_UDPCS;
6988                                 }
6989                         }
6990                 }
6991
6992                 //vlan
6993                 if (m_head->m_flags & M_VLANTAG)
6994                         opts2 |= bswap16(m_head->m_pkthdr.ether_vtag) | RL_TDESC_VLANCTL_TAG;
6995                 ptr = m_head;
6996                 PktLen = ptr->m_pkthdr.len;
6997 #ifdef _DEBUG_
6998                 printf("PktLen=%d",PktLen);
6999 #endif
7000                 while (ptr!=NULL) {
7001                         if (ptr->m_len >0) {
7002 #ifdef _DEBUG_
7003                                 printf(", len=%d T=%d F=%d",ptr->m_len,ptr->m_type,ptr->m_flags);
7004 #endif
7005                                 TxLen += ptr->m_len;
7006                                 if (TxLen >= PktLen) {
7007                                         ls=1;
7008                                         sc->re_desc.tx_buf[sc->re_desc.tx_cur_index] = m_head;
7009                                 } else
7010                                         sc->re_desc.tx_buf[sc->re_desc.tx_cur_index] = NULL;
7011
7012                                 //vlan
7013                                 WritePacket(sc,ptr->m_data,ptr->m_len,fs,ls,opts2,opts1);
7014
7015                                 fs=0;
7016                         }
7017                         ptr = ptr->m_next;
7018                 }
7019 #ifdef _DEBUG_
7020                 printf("\n");
7021 #endif
7022         }
7023 #if OS_VER < VERSION(9,0)
7024         ifp->if_timer = 5;
7025 #endif
7026
7027         RE_UNLOCK(sc);
7028
7029         return;
7030 }
7031
7032 /*
7033  * Encapsulate an mbuf chain in a descriptor by coupling the mbuf data
7034  * pointers to the fragment pointers.
7035  */
7036 static int re_encap(struct re_softc *sc,struct mbuf *m_head)
7037 {
7038         struct mbuf             *m_new = NULL;
7039
7040         m_new = m_defrag(m_head, M_DONTWAIT);
7041
7042         if (m_new == NULL) {
7043                 printf("re%d: no memory for tx list", sc->re_unit);
7044                 return (1);
7045         }
7046         m_head = m_new;
7047
7048         /* Pad frames to at least 60 bytes. */
7049         if (m_head->m_pkthdr.len < RE_MIN_FRAMELEN) {   /* Case length < 60 bytes */
7050                 /*
7051                  * Make security concious people happy: zero out the
7052                  * bytes in the pad area, since we don't know what
7053                  * this mbuf cluster buffer's previous user might
7054                  * have left in it.
7055                  */
7056                 bzero(mtod(m_head, char *) + m_head->m_pkthdr.len,
7057                       RE_MIN_FRAMELEN - m_head->m_pkthdr.len);
7058                 m_head->m_pkthdr.len = RE_MIN_FRAMELEN;
7059                 m_head->m_len = m_head->m_pkthdr.len;
7060         }
7061
7062         sc->re_desc.tx_buf[sc->re_desc.tx_cur_index] = m_head;
7063
7064         return(0);
7065 }
7066
7067 static void WritePacket(struct re_softc *sc, caddr_t addr, int len,int fs_flag,int ls_flag, uint32_t opts2,uint32_t opts1)
7068 {
7069         union TxDesc *txptr;
7070
7071         txptr=&(sc->re_desc.tx_desc[sc->re_desc.tx_cur_index]);
7072
7073         txptr->ul[0] &= htole32(0x40000000);
7074         txptr->ul[0] |= htole32(opts1);
7075         txptr->ul[1] = htole32(opts2);
7076
7077         if (fs_flag)
7078                 txptr->ul[0] |= htole32(RL_TDESC_CMD_SOF);
7079         if (ls_flag)
7080                 txptr->ul[0] |= htole32(RL_TDESC_CMD_EOF);
7081         txptr->ul[0] |= htole32(len);
7082         bus_dmamap_load(sc->re_desc.re_tx_mtag,
7083                         sc->re_desc.re_tx_dmamap[sc->re_desc.tx_cur_index],
7084                         addr,
7085                         len,
7086                         re_tx_dma_map_buf, txptr,
7087                         0);
7088         bus_dmamap_sync(sc->re_desc.re_tx_mtag,
7089                         sc->re_desc.re_tx_dmamap[sc->re_desc.tx_cur_index],
7090                         BUS_DMASYNC_PREWRITE);
7091         txptr->ul[0] |= htole32(RL_TDESC_CMD_OWN);
7092
7093         bus_dmamap_sync(sc->re_desc.tx_desc_tag,
7094                         sc->re_desc.tx_desc_dmamap,
7095                         BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
7096
7097         if (ls_flag) {
7098                 CSR_WRITE_1(sc, RE_TPPOLL, RE_NPQ);
7099                 CSR_WRITE_1(sc, RE_TPPOLL, RE_NPQ);
7100         }
7101
7102         sc->re_desc.tx_cur_index = (sc->re_desc.tx_cur_index+1)%RE_TX_BUF_NUM;
7103 }
7104
7105 static int CountFreeTxDescNum(struct re_descriptor desc)
7106 {
7107         int ret=desc.tx_last_index-desc.tx_cur_index;
7108         if (ret<=0)
7109                 ret+=RE_TX_BUF_NUM;
7110         ret--;
7111         return ret;
7112 }
7113
7114 static int CountMbufNum(struct mbuf *m_head)
7115 {
7116         int ret=0;
7117         struct mbuf *ptr = m_head;
7118
7119         while (ptr!=NULL) {
7120                 if (ptr->m_len >0)
7121                         ret++;
7122                 ptr=ptr->m_next;
7123         }
7124
7125         return ret;
7126 }
7127
7128 #ifdef RE_FIXUP_RX
7129 static __inline void re_fixup_rx(struct mbuf *m)
7130 {
7131         int                     i;
7132         uint16_t                *src, *dst;
7133
7134         src = mtod(m, uint16_t *);
7135         dst = src - (RE_ETHER_ALIGN - ETHER_ALIGN) / sizeof *src;
7136
7137         for (i = 0; i < (m->m_len / sizeof(uint16_t) + 1); i++)
7138                 *dst++ = *src++;
7139
7140         m->m_data -= RE_ETHER_ALIGN - ETHER_ALIGN;
7141 }
7142 #endif
7143
7144 /*
7145  * A frame was downloaded to the chip. It's safe for us to clean up
7146  * the list buffers.
7147  */
7148 static void re_txeof(struct re_softc *sc)       /* Transmit OK/ERR handler */
7149 {
7150         union TxDesc *txptr;
7151         struct ifnet            *ifp;
7152         u_int32_t           txstat;
7153
7154         /*      printf("X");*/
7155
7156         ifp = RE_GET_IFNET(sc);
7157
7158 #if OS_VER < VERSION(9,0)
7159         /* Clear the timeout timer. */
7160         ifp->if_timer = 0;
7161 #endif
7162
7163         bus_dmamap_sync(sc->re_desc.tx_desc_tag,
7164                         sc->re_desc.tx_desc_dmamap,
7165                         BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
7166
7167         while (sc->re_desc.tx_last_index!=sc->re_desc.tx_cur_index) {
7168                 txptr=&(sc->re_desc.tx_desc[sc->re_desc.tx_last_index]);
7169                 txstat = le32toh(txptr->ul[0]);
7170                 if (txstat & RL_TDESC_STAT_OWN)
7171                         break;
7172 #ifdef _DEBUG_
7173                 printf("**** Tx OK  ****\n");
7174 #endif
7175                 bus_dmamap_sync(sc->re_desc.re_tx_mtag,
7176                                 sc->re_desc.re_tx_dmamap[sc->re_desc.tx_last_index],
7177                                 BUS_DMASYNC_POSTWRITE);
7178                 bus_dmamap_unload(sc->re_desc.re_tx_mtag,
7179                                   sc->re_desc.re_tx_dmamap[sc->re_desc.tx_last_index]);
7180
7181                 if (sc->re_desc.tx_buf[sc->re_desc.tx_last_index]!=NULL) {
7182                         m_freem(sc->re_desc.tx_buf[sc->re_desc.tx_last_index]); /* Free Current MBuf in a Mbuf list*/
7183                         sc->re_desc.tx_buf[sc->re_desc.tx_last_index] = NULL;
7184                 }
7185
7186                 sc->re_desc.tx_last_index = (sc->re_desc.tx_last_index+1)%RE_TX_BUF_NUM;
7187 #if OS_VER < VERSION(11,0)
7188                 if (txstat & (RL_TDESC_STAT_EXCESSCOL|
7189                               RL_TDESC_STAT_COLCNT))
7190                         ifp->if_collisions++;
7191                 if (txstat & RL_TDESC_STAT_TXERRSUM)
7192                         ifp->if_oerrors++;
7193                 else
7194                         ifp->if_opackets++;
7195 #else
7196                 if (txstat & (RL_TDESC_STAT_EXCESSCOL|
7197                               RL_TDESC_STAT_COLCNT))
7198                         if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1);
7199                 if (txstat & RL_TDESC_STAT_TXERRSUM)
7200                         if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
7201                 else
7202                         if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
7203 #endif
7204                 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
7205         }
7206
7207         return;
7208 }
7209
7210 /*
7211  * A frame has been uploaded: pass the resulting mbuf chain up to
7212  * the higher level protocols.
7213  *
7214  * You know there's something wrong with a PCI bus-master chip design
7215  * when you have to use m_devget().
7216  *
7217  * The receive operation is badly documented in the datasheet, so I'll
7218  * attempt to document it here. The driver provides a buffer area and
7219  * places its base address in the RX buffer start address register.
7220  * The chip then begins copying frames into the RX buffer. Each frame
7221  * is preceeded by a 32-bit RX status word which specifies the length
7222  * of the frame and certain other status bits. Each frame (starting with
7223  * the status word) is also 32-bit aligned. The frame length is in the
7224  * first 16 bits of the status word; the lower 15 bits correspond with
7225  * the 'rx status register' mentioned in the datasheet.
7226  *
7227  * Note: to make the Alpha happy, the frame payload needs to be aligned
7228  * on a 32-bit boundary. To achieve this, we cheat a bit by copying from
7229  * the ring buffer starting at an address two bytes before the actual
7230  * data location. We can then shave off the first two bytes using m_adj().
7231  * The reason we do this is because m_devget() doesn't let us specify an
7232  * offset into the mbuf storage space, so we have to artificially create
7233  * one. The ring is allocated in such a way that there are a few unused
7234  * bytes of space preceecing it so that it will be safe for us to do the
7235  * 2-byte backstep even if reading from the ring at offset 0.
7236  */
7237 static void re_rxeof(sc)        /* Receive Data OK/ERR handler */
7238 struct re_softc         *sc;
7239 {
7240         struct ether_header     *eh;
7241         struct mbuf             *m;
7242         struct ifnet            *ifp;
7243         union RxDesc *rxptr;
7244         int bError;
7245         struct mbuf *buf;
7246         int size;
7247         int maxpkt = RE_RX_BUF_NUM;
7248
7249         u_int32_t opts2,opts1;
7250
7251         /*              RE_LOCK_ASSERT(sc);*/
7252
7253         ifp = RE_GET_IFNET(sc);
7254
7255         bus_dmamap_sync(sc->re_desc.rx_desc_tag,
7256                         sc->re_desc.rx_desc_dmamap,
7257                         BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
7258
7259         rxptr=&(sc->re_desc.rx_desc[sc->re_desc.rx_cur_index]);
7260         while ((rxptr->ul[0]&htole32(RL_RDESC_STAT_OWN))==0) {  /* Receive OK */
7261                 bError = 0;
7262
7263                 opts1 = le32toh(rxptr->ul[0]);
7264
7265                 /* Check if this packet is received correctly*/
7266                 if (opts1&0x200000) {   /*Check RES bit*/
7267                         bError=1;
7268 #if OS_VER < VERSION(11,0)
7269                         ifp->if_ierrors++;
7270 #else
7271                         if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
7272 #endif
7273                         goto update_desc;
7274                 }
7275                 opts2 = le32toh(rxptr->ul[1]);
7276
7277                 //buf = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); /* Alloc a new mbuf */
7278
7279                 if (sc->re_rx_mbuf_sz <= MCLBYTES)
7280                         size = MCLBYTES;
7281                 else if (sc->re_rx_mbuf_sz <= MJUMPAGESIZE)
7282                         size = MJUMPAGESIZE;
7283                 else
7284                         size = MJUM9BYTES;
7285
7286                 buf = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, size);
7287                 if (buf==NULL) {
7288                         bError=1;
7289 #if OS_VER < VERSION(11,0)
7290                         ifp->if_iqdrops++;
7291 #else
7292                         if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
7293 #endif
7294                         goto update_desc;
7295                 }
7296
7297                 buf->m_len = buf->m_pkthdr.len = size;
7298 #ifdef RE_FIXUP_RX
7299                 /*
7300                  * This is part of an evil trick to deal with non-x86 platforms.
7301                  * The RealTek chip requires RX buffers to be aligned on 64-bit
7302                  * boundaries, but that will hose non-x86 machines. To get around
7303                  * this, we leave some empty space at the start of each buffer
7304                  * and for non-x86 hosts, we copy the buffer back six bytes
7305                  * to achieve word alignment. This is slightly more efficient
7306                  * than allocating a new buffer, copying the contents, and
7307                  * discarding the old buffer.
7308                  */
7309                 m_adj(buf, RE_ETHER_ALIGN);
7310 #endif
7311
7312                 bus_dmamap_sync(sc->re_desc.re_rx_mtag,
7313                                 sc->re_desc.re_rx_dmamap[sc->re_desc.rx_cur_index],
7314                                 BUS_DMASYNC_POSTREAD);
7315                 bus_dmamap_unload(sc->re_desc.re_rx_mtag,
7316                                   sc->re_desc.re_rx_dmamap[sc->re_desc.rx_cur_index]);
7317
7318                 m = sc->re_desc.rx_buf[sc->re_desc.rx_cur_index];
7319                 sc->re_desc.rx_buf[sc->re_desc.rx_cur_index] = buf;
7320                 m->m_pkthdr.len = m->m_len = (opts1&RL_RDESC_STAT_GFRAGLEN)-ETHER_CRC_LEN;
7321                 m->m_pkthdr.rcvif = ifp;
7322
7323 #ifdef RE_FIXUP_RX
7324                 re_fixup_rx(m);
7325 #endif
7326
7327                 //vlan
7328                 if (opts2 & RL_RDESC_VLANCTL_TAG) {
7329                         m->m_pkthdr.ether_vtag =
7330                                 bswap16((opts2 & RL_RDESC_VLANCTL_DATA));
7331                         m->m_flags |= M_VLANTAG;
7332                 }
7333                 if (ifp->if_capenable & IFCAP_RXCSUM) {
7334                         if (!(sc->re_if_flags & RL_FLAG_DESCV2)) {
7335                                 if (opts1 & RL_ProtoIP)
7336                                         m->m_pkthdr.csum_flags |=  CSUM_IP_CHECKED;
7337                                 if (!(opts1 & RL_IPF))
7338                                         m->m_pkthdr.csum_flags |= CSUM_IP_VALID;
7339                                 if ((((opts1 & RL_ProtoIP)==(1<<17)) && !(opts1 & RL_TCPF))   || (((opts1 & RL_ProtoIP)==(1<<18)) && !(opts1 & RL_UDPF))) {
7340                                         m->m_pkthdr.csum_flags |= CSUM_DATA_VALID|CSUM_PSEUDO_HDR;
7341                                         m->m_pkthdr.csum_data = 0xffff;
7342                                 }
7343                         } else {
7344                                 if ((opts1 & RL_ProtoIP) && (opts2 & RL_V4F))
7345                                         m->m_pkthdr.csum_flags |=  CSUM_IP_CHECKED;
7346                                 if (!(opts1 & RL_IPF) && (opts2 & RL_V4F))
7347                                         m->m_pkthdr.csum_flags |= CSUM_IP_VALID;
7348                                 if (((opts1 & RL_TCPT) && !(opts2 & RL_TCPF)) || ((opts1 & RL_UDPT) && !(opts2 & RL_UDPF))) {
7349                                         m->m_pkthdr.csum_flags |= CSUM_DATA_VALID|CSUM_PSEUDO_HDR;
7350                                         m->m_pkthdr.csum_data = 0xffff;
7351                                 }
7352                         }
7353                 }
7354
7355                 eh = mtod(m, struct ether_header *);
7356 #if OS_VER < VERSION(11,0)
7357                 ifp->if_ipackets++;
7358 #else
7359                 if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
7360 #endif
7361 #ifdef _DEBUG_
7362                 printf("Rcv Packet, Len=%d \n", m->m_len);
7363 #endif
7364
7365                 RE_UNLOCK(sc);
7366
7367                 /*#if OS_VER < VERSION(5, 1)*/
7368 #if OS_VER < VERSION(4,9)
7369                 /* Remove header from mbuf and pass it on. */
7370                 m_adj(m, sizeof(struct ether_header));
7371                 ether_input(ifp, eh, m);
7372 #else
7373                 (*ifp->if_input)(ifp, m);
7374 #endif
7375                 RE_LOCK(sc);
7376
7377 update_desc:
7378                 rxptr->ul[0]&=htole32(0x40000000);      /* keep EOR bit */
7379                 rxptr->ul[1]=0;
7380
7381                 rxptr->ul[0] |= htole32(sc->re_rx_desc_buf_sz);
7382                 if (!bError) {
7383                         bus_dmamap_load(sc->re_desc.re_rx_mtag,
7384                                         sc->re_desc.re_rx_dmamap[sc->re_desc.rx_cur_index],
7385                                         sc->re_desc.rx_buf[sc->re_desc.rx_cur_index]->m_data,
7386                                         sc->re_rx_desc_buf_sz,
7387                                         re_rx_dma_map_buf, rxptr,
7388                                         0);
7389                         bus_dmamap_sync(sc->re_desc.re_rx_mtag,
7390                                         sc->re_desc.re_rx_dmamap[sc->re_desc.rx_cur_index],
7391                                         BUS_DMASYNC_PREREAD);
7392                 }
7393                 rxptr->ul[0] |= htole32(RL_RDESC_CMD_OWN);
7394                 sc->re_desc.rx_cur_index = (sc->re_desc.rx_cur_index+1)%RE_RX_BUF_NUM;
7395                 rxptr=&sc->re_desc.rx_desc[sc->re_desc.rx_cur_index];
7396
7397                 maxpkt--;
7398                 if (maxpkt==0)
7399                         break;
7400         }
7401
7402         bus_dmamap_sync(sc->re_desc.rx_desc_tag,
7403                         sc->re_desc.rx_desc_dmamap,
7404                         BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
7405
7406         return;
7407 }
7408
7409 #if OS_VER < VERSION(7,0)
7410 static void re_intr(void *arg)          /* Interrupt Handler */
7411 #else
7412 static int re_intr(void *arg)   /* Interrupt Handler */
7413 #endif //OS_VER < VERSION(7,0)
7414 {
7415         struct re_softc         *sc;
7416
7417         sc = arg;
7418
7419         if ((sc->re_if_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) {
7420                 if ((CSR_READ_2(sc, RE_ISR) & RE_INTRS) == 0) {
7421 #if OS_VER < VERSION(7,0)
7422                         return;
7423 #else
7424                         return (FILTER_STRAY);
7425 #endif
7426                 }
7427         }
7428
7429         /* Disable interrupts. */
7430         CSR_WRITE_2(sc, RE_IMR, 0x0000);
7431
7432 #if OS_VER < VERSION(7,0)
7433         re_int_task(arg, 0);
7434 #else //OS_VER < VERSION(7,0)
7435 #if OS_VER < VERSION(11,0)
7436         taskqueue_enqueue_fast(taskqueue_fast, &sc->re_inttask);
7437 #else ////OS_VER < VERSION(11,0)
7438         taskqueue_enqueue(taskqueue_fast, &sc->re_inttask);
7439 #endif //OS_VER < VERSION(11,0)
7440         return (FILTER_HANDLED);
7441 #endif //OS_VER < VERSION(7,0)
7442 }
7443
7444 static void re_int_task(void *arg, int npending)
7445 {
7446         struct re_softc         *sc;
7447         struct ifnet            *ifp;
7448         u_int16_t               status;
7449
7450         sc = arg;
7451
7452         RE_LOCK(sc);
7453
7454         ifp = RE_GET_IFNET(sc);
7455
7456         status = CSR_READ_2(sc, RE_ISR);
7457
7458         if (status) {
7459                 CSR_WRITE_2(sc, RE_ISR, status & 0xffbf);
7460         }
7461
7462         if (sc->suspended ||
7463             (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
7464                 RE_UNLOCK(sc);
7465                 return;
7466         }
7467
7468         re_rxeof(sc);
7469
7470         if (sc->re_type == MACFG_21) {
7471                 if (status & RE_ISR_FIFO_OFLOW) {
7472                         sc->rx_fifo_overflow = 1;
7473                         CSR_WRITE_2(sc, 0x00e2, 0x0000);
7474                         CSR_WRITE_4(sc, 0x0048, 0x4000);
7475                         CSR_WRITE_4(sc, 0x0058, 0x4000);
7476                 } else {
7477                         sc->rx_fifo_overflow = 0;
7478                         CSR_WRITE_4(sc,RE_CPCR, 0x51512082);
7479                 }
7480
7481                 if (status & RE_ISR_PCS_TIMEOUT) {
7482                         if ((status & RE_ISR_FIFO_OFLOW) &&
7483                             (!(status & (RE_ISR_RX_OK | RE_ISR_TX_OK | RE_ISR_RX_OVERRUN)))) {
7484                                 re_reset(sc);
7485                                 re_init(sc);
7486                                 sc->rx_fifo_overflow = 0;
7487                                 CSR_WRITE_2(sc, RE_ISR, RE_ISR_FIFO_OFLOW);
7488                         }
7489                 }
7490         }
7491
7492         re_txeof(sc);
7493
7494         if (status & RE_ISR_SYSTEM_ERR) {
7495                 re_reset(sc);
7496                 re_init(sc);
7497         }
7498
7499         switch(sc->re_type) {
7500         case MACFG_21:
7501         case MACFG_22:
7502         case MACFG_23:
7503         case MACFG_24:
7504                 CSR_WRITE_1(sc, RE_TPPOLL, RE_NPQ);
7505                 break;
7506
7507         default:
7508                 break;
7509         }
7510
7511         RE_UNLOCK(sc);
7512
7513         if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
7514                 re_start(ifp);
7515
7516 #if OS_VER>=VERSION(7,0)
7517         if (CSR_READ_2(sc, RE_ISR) & RE_INTRS) {
7518 #if OS_VER < VERSION(11,0)
7519                 taskqueue_enqueue_fast(taskqueue_fast, &sc->re_inttask);
7520 #else ////OS_VER < VERSION(11,0)
7521                 taskqueue_enqueue(taskqueue_fast, &sc->re_inttask);
7522 #endif //OS_VER < VERSION(11,0)
7523                 return;
7524         }
7525 #endif //OS_VER>=VERSION(7,0)
7526
7527         /* Re-enable interrupts. */
7528         CSR_WRITE_2(sc, RE_IMR, RE_INTRS);
7529 }
7530 #endif  /* !__DragonFly__ */
7531
7532 static void re_set_multicast_reg(struct re_softc *sc, u_int32_t mask0, u_int32_t mask4)
7533 {
7534         u_int8_t  enable_cfg_reg_write = 0;
7535
7536         if (sc->re_type == MACFG_5 || sc->re_type == MACFG_6)
7537                 enable_cfg_reg_write = 1;
7538
7539         if (enable_cfg_reg_write)
7540                 re_enable_cfg9346_write(sc);
7541         CSR_WRITE_4(sc, RE_MAR0, mask0);
7542         CSR_WRITE_4(sc, RE_MAR4, mask4);
7543         if (enable_cfg_reg_write)
7544                 re_disable_cfg9346_write(sc);
7545
7546         return;
7547 }
7548
7549 #ifndef __DragonFly__
7550 static void re_set_rx_packet_filter_in_sleep_state(struct re_softc *sc)
7551 {
7552         struct ifnet            *ifp;
7553         u_int32_t               rxfilt;
7554
7555         ifp = RE_GET_IFNET(sc);
7556
7557         rxfilt = CSR_READ_4(sc, RE_RXCFG);
7558
7559         rxfilt &= ~(RE_RXCFG_RX_ALLPHYS | RE_RXCFG_RX_INDIV | RE_RXCFG_RX_MULTI | RE_RXCFG_RX_BROAD | RE_RXCFG_RX_RUNT | RE_RXCFG_RX_ERRPKT);
7560         rxfilt |= (RE_RXCFG_RX_INDIV | RE_RXCFG_RX_MULTI | RE_RXCFG_RX_BROAD);
7561
7562         CSR_WRITE_4(sc, RE_RXCFG, rxfilt);
7563
7564         re_set_multicast_reg(sc, 0xFFFFFFFF, 0xFFFFFFFF);
7565
7566         return;
7567 }
7568 #endif  /* !__DragonFly__ */
7569
7570 static void re_set_rx_packet_filter(struct re_softc *sc)
7571 {
7572         struct ifnet            *ifp;
7573         u_int32_t               rxfilt;
7574
7575         ifp = RE_GET_IFNET(sc);
7576
7577         rxfilt = CSR_READ_4(sc, RE_RXCFG);
7578
7579         rxfilt |= RE_RXCFG_RX_INDIV;
7580
7581         if (ifp->if_flags & (IFF_MULTICAST | IFF_ALLMULTI | IFF_PROMISC)) {
7582                 rxfilt |= (RE_RXCFG_RX_ALLPHYS | RE_RXCFG_RX_MULTI);
7583         } else {
7584                 rxfilt &= ~(RE_RXCFG_RX_MULTI);
7585         }
7586
7587         if (ifp->if_flags & IFF_PROMISC) {
7588                 rxfilt |= (RE_RXCFG_RX_ALLPHYS | RE_RXCFG_RX_RUNT | RE_RXCFG_RX_ERRPKT);
7589         } else {
7590                 rxfilt &= ~(RE_RXCFG_RX_ALLPHYS | RE_RXCFG_RX_RUNT | RE_RXCFG_RX_ERRPKT);
7591         }
7592
7593         if (ifp->if_flags & (IFF_BROADCAST | IFF_PROMISC)) {
7594                 rxfilt |= RE_RXCFG_RX_BROAD;
7595         } else {
7596                 rxfilt &= ~RE_RXCFG_RX_BROAD;
7597         }
7598
7599         CSR_WRITE_4(sc, RE_RXCFG, rxfilt);
7600
7601         re_setmulti(sc);
7602
7603         return;
7604 }
7605
7606 /*
7607  * Program the 64-bit multicast hash filter.
7608  */
7609 static void re_setmulti(struct re_softc *sc)
7610 {
7611         struct ifnet            *ifp;
7612         int                     h = 0;
7613         u_int32_t               hashes[2] = { 0, 0 };
7614         struct ifmultiaddr      *ifma;
7615         u_int32_t               rxfilt;
7616         int                     mcnt = 0;
7617
7618         ifp = RE_GET_IFNET(sc);
7619
7620         rxfilt = CSR_READ_4(sc, RE_RXCFG);
7621
7622         if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
7623                 rxfilt |= RE_RXCFG_RX_MULTI;
7624                 CSR_WRITE_4(sc, RE_RXCFG, rxfilt);
7625                 re_set_multicast_reg(sc, 0xFFFFFFFF, 0xFFFFFFFF);
7626
7627                 return;
7628         }
7629
7630 #ifndef __DragonFly__
7631         /* now program new ones */
7632 #if OS_VER > VERSION(6,0)
7633         IF_ADDR_LOCK(ifp);
7634 #endif
7635 #if OS_VER < VERSION(4,9)
7636         for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL;
7637              ifma = ifma->ifma_link.le_next)
7638 #else
7639         TAILQ_FOREACH(ifma,&ifp->if_multiaddrs,ifma_link)
7640 #endif
7641 #else   /* __DragonFly__ */
7642         TAILQ_FOREACH(ifma,&ifp->if_multiaddrs,ifma_link)
7643 #endif  /* !__DragonFly__ */
7644         {
7645                 if (ifma->ifma_addr->sa_family != AF_LINK)
7646                         continue;
7647                 h = ether_crc32_be(LLADDR((struct sockaddr_dl *)
7648                                           ifma->ifma_addr), ETHER_ADDR_LEN) >> 26;
7649                 if (h < 32)
7650                         hashes[0] |= (1 << h);
7651                 else
7652                         hashes[1] |= (1 << (h - 32));
7653                 mcnt++;
7654         }
7655 #ifndef __DragonFly__
7656 #if OS_VER > VERSION(6,0)
7657         IF_ADDR_UNLOCK(ifp);
7658 #endif
7659 #endif  /* !__DragonFly__ */
7660
7661         if (mcnt) {
7662                 if ((sc->re_if_flags & RL_FLAG_PCIE) != 0) {
7663                         h = bswap32(hashes[0]);
7664                         hashes[0] = bswap32(hashes[1]);
7665                         hashes[1] = h;
7666                 }
7667                 rxfilt |= RE_RXCFG_RX_MULTI;
7668         } else
7669                 rxfilt &= ~RE_RXCFG_RX_MULTI;
7670
7671         CSR_WRITE_4(sc, RE_RXCFG, rxfilt);
7672         re_set_multicast_reg(sc, hashes[0], hashes[1]);
7673
7674         return;
7675 }
7676
7677 #ifndef __DragonFly__
7678 static int re_ioctl(ifp, command, data)
7679 struct ifnet            *ifp;
7680 u_long                  command;
7681 caddr_t                 data;
7682 {
7683         struct re_softc         *sc = ifp->if_softc;
7684         struct ifreq            *ifr = (struct ifreq *) data;
7685         /*int                   s;*/
7686         int                     error = 0;
7687         int mask, reinit;
7688         /*s = splimp();*/
7689
7690         switch(command) {
7691         case SIOCSIFADDR:
7692         case SIOCGIFADDR:
7693                 error = ether_ioctl(ifp, command, data);
7694
7695                 break;
7696         case SIOCSIFMTU:
7697
7698                 //printf("before mtu =%d\n",(int)ifp->if_mtu);
7699                 if (ifr->ifr_mtu > sc->max_jumbo_frame_size)
7700                         error = EINVAL;
7701                 else {
7702                         ifp->if_mtu = ifr->ifr_mtu;
7703
7704                         //if running
7705                         if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
7706                                 //printf("set mtu when running\n");
7707
7708                                 RE_LOCK(sc);
7709                                 re_stop(sc);
7710
7711                                 re_release_buf(sc);
7712                                 set_rxbufsize(sc);
7713                                 error =re_alloc_buf(sc);
7714
7715                                 if (error == 0) {
7716                                         re_init(sc);
7717                                 }
7718                                 RE_UNLOCK(sc);
7719
7720                         } else {
7721                                 //if not running
7722                                 RE_LOCK(sc);
7723                                 re_release_buf(sc);
7724                                 set_rxbufsize(sc);
7725                                 error =re_alloc_buf(sc);
7726                                 if (error == 0) {
7727                                         /* Init descriptors. */
7728                                         re_var_init(sc);
7729                                 }
7730                                 RE_UNLOCK(sc);
7731                         }
7732
7733                 }
7734                 //      printf("after mtu =%d\n",(int)ifp->if_mtu);
7735                 break;
7736         case SIOCSIFFLAGS:
7737                 RE_LOCK(sc);
7738                 if (ifp->if_flags & IFF_UP) {
7739                         re_init(sc);
7740                 } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
7741                         re_stop(sc);
7742                 }
7743                 error = 0;
7744                 RE_UNLOCK(sc);
7745                 break;
7746         case SIOCADDMULTI:
7747         case SIOCDELMULTI:
7748                 RE_LOCK(sc);
7749                 re_set_rx_packet_filter(sc);
7750                 RE_UNLOCK(sc);
7751                 error = 0;
7752                 break;
7753         case SIOCGIFMEDIA:
7754         case SIOCSIFMEDIA:
7755                 error = ifmedia_ioctl(ifp, ifr, &sc->media, command);
7756                 break;
7757         case SIOCSIFCAP:
7758
7759
7760                 mask = ifr->ifr_reqcap ^ ifp->if_capenable;
7761                 reinit = 0;
7762
7763                 if ((mask & IFCAP_TXCSUM) != 0 && (ifp->if_capabilities & IFCAP_TXCSUM) != 0) {
7764                         ifp->if_capenable ^= IFCAP_TXCSUM;
7765                         if ((ifp->if_capenable & IFCAP_TXCSUM) != 0)  {
7766                                 if ((sc->re_type == MACFG_24) || (sc->re_type == MACFG_24) || (sc->re_type == MACFG_26))
7767                                         ifp->if_hwassist |= CSUM_TCP | CSUM_UDP;
7768                                 else
7769                                         ifp->if_hwassist |= RE_CSUM_FEATURES;
7770                         } else
7771                                 ifp->if_hwassist &= ~RE_CSUM_FEATURES;
7772                         reinit = 1;
7773                 }
7774
7775                 if ((mask & IFCAP_RXCSUM) != 0 &&
7776                     (ifp->if_capabilities & IFCAP_RXCSUM) != 0) {
7777                         ifp->if_capenable ^= IFCAP_RXCSUM;
7778                         reinit = 1;
7779                 }
7780
7781                 if ((ifp->if_mtu <= ETHERMTU) || ((sc->re_type>= MACFG_3) &&(sc->re_type <=MACFG_6)) || ((sc->re_type>= MACFG_21) && (sc->re_type <=MACFG_23))) {
7782                         if (ifp->if_capenable & IFCAP_TXCSUM)
7783                                 sc->re_tx_cstag = 1;
7784                         else
7785                                 sc->re_tx_cstag = 0;
7786
7787                         if (ifp->if_capenable & IFCAP_RXCSUM)
7788                                 sc->re_rx_cstag = 1;
7789                         else
7790                                 sc->re_rx_cstag = 0;
7791                 }
7792                 if ((mask & IFCAP_VLAN_HWTAGGING) != 0 &&
7793                     (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) {
7794                         ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
7795                         /* TSO over VLAN requires VLAN hardware tagging. */
7796                         //if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0)
7797                         //      ifp->if_capenable &= ~IFCAP_VLAN_HWTSO;
7798                         reinit = 1;
7799                 }
7800
7801                 if ((mask & IFCAP_WOL) != 0 &&
7802                     (ifp->if_capabilities & IFCAP_WOL) != 0) {
7803                         if ((mask & IFCAP_WOL_UCAST) != 0)
7804                                 ifp->if_capenable ^= IFCAP_WOL_UCAST;
7805                         if ((mask & IFCAP_WOL_MCAST) != 0)
7806                                 ifp->if_capenable ^= IFCAP_WOL_MCAST;
7807                         if ((mask & IFCAP_WOL_MAGIC) != 0)
7808                                 ifp->if_capenable ^= IFCAP_WOL_MAGIC;
7809                 }
7810                 if (reinit && ifp->if_drv_flags & IFF_DRV_RUNNING) {
7811                         ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
7812                         re_init(sc);
7813                 }
7814                 VLAN_CAPABILITIES(ifp);
7815                 break;
7816         default:
7817                 error = EINVAL;
7818                 break;
7819         }
7820
7821         /*(void)splx(s);*/
7822
7823         return(error);
7824 }
7825 #endif  /* !__DragonFly__ */
7826
7827 static void re_link_on_patch(struct re_softc *sc)
7828 {
7829         struct ifnet            *ifp;
7830
7831         ifp = RE_GET_IFNET(sc);
7832
7833         if (sc->re_type == MACFG_50 || sc->re_type == MACFG_51 || sc->re_type == MACFG_52) {
7834                 if (CSR_READ_1(sc, RE_PHY_STATUS) & RL_PHY_STATUS_1000MF) {
7835                         re_eri_write(sc, 0x1bc, 4, 0x00000011, ERIAR_ExGMAC);
7836                         re_eri_write(sc, 0x1dc, 4, 0x0000001f, ERIAR_ExGMAC);
7837                 } else if (CSR_READ_1(sc, RE_PHY_STATUS) & RL_PHY_STATUS_100M) {
7838                         re_eri_write(sc, 0x1bc, 4, 0x0000001f, ERIAR_ExGMAC);
7839                         re_eri_write(sc, 0x1dc, 4, 0x0000001f, ERIAR_ExGMAC);
7840                 } else {
7841                         re_eri_write(sc, 0x1bc, 4, 0x0000001f, ERIAR_ExGMAC);
7842                         re_eri_write(sc, 0x1dc, 4, 0x0000002d, ERIAR_ExGMAC);
7843                 }
7844         } else if ((sc->re_type == MACFG_38 || sc->re_type == MACFG_39) && (ifp->if_flags & IFF_UP)) {
7845                 if (sc->re_type == MACFG_38 && (CSR_READ_1(sc, RE_PHY_STATUS) & RL_PHY_STATUS_10M)) {
7846                         CSR_WRITE_4(sc, RE_RXCFG, CSR_READ_4(sc, RE_RXCFG) | RE_RXCFG_RX_ALLPHYS);
7847                 } else if (sc->re_type == MACFG_39) {
7848                         if (CSR_READ_1(sc, RE_PHY_STATUS) & RL_PHY_STATUS_1000MF) {
7849                                 re_eri_write(sc, 0x1bc, 4, 0x00000011, ERIAR_ExGMAC);
7850                                 re_eri_write(sc, 0x1dc, 4, 0x00000005, ERIAR_ExGMAC);
7851                         } else if (CSR_READ_1(sc, RE_PHY_STATUS) & RL_PHY_STATUS_100M) {
7852                                 re_eri_write(sc, 0x1bc, 4, 0x0000001f, ERIAR_ExGMAC);
7853                                 re_eri_write(sc, 0x1dc, 4, 0x00000005, ERIAR_ExGMAC);
7854                         } else {
7855                                 re_eri_write(sc, 0x1bc, 4, 0x0000001f, ERIAR_ExGMAC);
7856                                 re_eri_write(sc, 0x1dc, 4, 0x0000003f, ERIAR_ExGMAC);
7857                         }
7858                 }
7859         } else if ((sc->re_type == MACFG_36 || sc->re_type == MACFG_37) && eee_enable ==1) {
7860                 /*Full -Duplex  mode*/
7861                 if (CSR_READ_1(sc, RE_PHY_STATUS) & RL_PHY_STATUS_FULL_DUP) {
7862                         MP_WritePhyUshort(sc, 0x1F, 0x0006);
7863                         MP_WritePhyUshort(sc, 0x00, 0x5a30);
7864                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
7865                         if (CSR_READ_1(sc, RE_PHY_STATUS) & (RL_PHY_STATUS_10M | RL_PHY_STATUS_100M))
7866                                 CSR_WRITE_4(sc, RE_TXCFG, (CSR_READ_4(sc, RE_TXCFG) & ~BIT_19) | BIT_25);
7867
7868                 } else {
7869                         MP_WritePhyUshort(sc, 0x1F, 0x0006);
7870                         MP_WritePhyUshort(sc, 0x00, 0x5a00);
7871                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
7872                         if (CSR_READ_1(sc, RE_PHY_STATUS) & (RL_PHY_STATUS_10M | RL_PHY_STATUS_100M))
7873                                 CSR_WRITE_4(sc, RE_TXCFG, (CSR_READ_4(sc, RE_TXCFG) & ~BIT_19) | RE_TXCFG_IFG);
7874                 }
7875         } else if ((sc->re_type == MACFG_56 || sc->re_type == MACFG_57 ||
7876                     sc->re_type == MACFG_58 || sc->re_type == MACFG_59 ||
7877                     sc->re_type == MACFG_60 || sc->re_type == MACFG_61 ||
7878                     sc->re_type == MACFG_62 || sc->re_type == MACFG_67 ||
7879                     sc->re_type == MACFG_68 || sc->re_type == MACFG_69 ||
7880                     sc->re_type == MACFG_70 || sc->re_type == MACFG_71) &&
7881                    (ifp->if_flags & IFF_UP)) {
7882                 if (CSR_READ_1(sc, RE_PHY_STATUS) & RL_PHY_STATUS_FULL_DUP)
7883                         CSR_WRITE_4(sc, RE_TXCFG, (CSR_READ_4(sc, RE_TXCFG) | (BIT_24 | BIT_25)) & ~BIT_19);
7884                 else
7885                         CSR_WRITE_4(sc, RE_TXCFG, (CSR_READ_4(sc, RE_TXCFG) | BIT_25) & ~(BIT_19 | BIT_24));
7886         }
7887
7888         if (sc->re_type == MACFG_56 || sc->re_type == MACFG_57 ||
7889             sc->re_type == MACFG_61 || sc->re_type == MACFG_62) {
7890                 /*half mode*/
7891                 if (!(CSR_READ_1(sc, RE_PHY_STATUS) & RL_PHY_STATUS_FULL_DUP)) {
7892                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
7893                         MP_WritePhyUshort(sc, MII_ANAR, MP_ReadPhyUshort(sc, MII_ANAR)&~(ANAR_PAUSE_SYM |ANAR_PAUSE_ASYM));
7894                 }
7895         }
7896
7897         if ((sc->re_type == MACFG_70 || sc->re_type == MACFG_71) &&
7898             (CSR_READ_1(sc, RE_PHY_STATUS) & RL_PHY_STATUS_10M)) {
7899                 uint32_t Data32;
7900
7901                 Data32 = re_eri_read(sc, 0x1D0, 1, ERIAR_ExGMAC);
7902                 Data32 |= BIT_1;
7903                 re_eri_write(sc, 0x1D0, 1, Data32, ERIAR_ExGMAC);
7904         }
7905
7906 #ifndef __DragonFly__
7907         re_init_unlock(sc);
7908 #endif
7909 }
7910
7911 #ifndef __DragonFly__
7912 static void re_link_down_patch(struct re_softc *sc)
7913 {
7914         struct ifnet            *ifp;
7915
7916         ifp = RE_GET_IFNET(sc);
7917
7918         re_txeof(sc);
7919         re_rxeof(sc);
7920         re_stop(sc);
7921
7922         re_ifmedia_upd(ifp);
7923 }
7924
7925 /*
7926  * Check Link Status.
7927  */
7928 static void re_check_link_status(struct re_softc *sc)
7929 {
7930         u_int8_t        link_state;
7931         struct ifnet            *ifp;
7932
7933         ifp = RE_GET_IFNET(sc);
7934
7935         if (re_link_ok(sc)) {
7936                 link_state = LINK_STATE_UP;
7937         } else {
7938                 link_state = LINK_STATE_DOWN;
7939         }
7940
7941         if (link_state != sc->link_state) {
7942                 sc->link_state = link_state;
7943                 if (link_state == LINK_STATE_UP) {
7944                         re_link_on_patch(sc);
7945                         re_link_state_change(ifp, LINK_STATE_UP);
7946                 } else {
7947                         re_link_state_change(ifp, LINK_STATE_DOWN);
7948                         re_link_down_patch(sc);
7949                 }
7950         }
7951 }
7952
7953 static void re_init_timer(struct re_softc *sc)
7954 {
7955 #ifdef RE_USE_NEW_CALLOUT_FUN
7956         callout_init(&sc->re_stat_ch, CALLOUT_MPSAFE);
7957 #else
7958         callout_handle_init(&sc->re_stat_ch);
7959 #endif
7960 }
7961
7962 static void re_stop_timer(struct re_softc *sc)
7963 {
7964 #ifdef RE_USE_NEW_CALLOUT_FUN
7965         callout_stop(&sc->re_stat_ch);
7966 #else
7967         untimeout(re_tick, sc, sc->re_stat_ch);
7968 #endif
7969 }
7970
7971 static void re_start_timer(struct re_softc *sc)
7972 {
7973 #ifdef RE_USE_NEW_CALLOUT_FUN
7974         callout_reset(&sc->re_stat_ch, hz, re_tick, sc);
7975 #else
7976         re_stop_timer(sc);
7977         sc->re_stat_ch = timeout(re_tick, sc, hz);
7978 #endif
7979 }
7980
7981 static void re_tick(xsc)
7982 void                    *xsc;
7983 {
7984         /*called per second*/
7985         struct re_softc         *sc;
7986         int                     s;
7987
7988         s = splimp();
7989
7990         sc = xsc;
7991         /*mii = device_get_softc(sc->re_miibus);
7992
7993         mii_tick(mii);*/
7994
7995         splx(s);
7996
7997         RE_LOCK(sc);
7998
7999         if (sc->re_link_chg_det == 1) {
8000                 re_check_link_status(sc);
8001                 re_start_timer(sc);
8002         }
8003
8004         RE_UNLOCK(sc);
8005
8006         return;
8007 }
8008
8009 #if OS_VER < VERSION(7,0)
8010 static void re_watchdog(ifp)
8011 struct ifnet            *ifp;
8012 {
8013         struct re_softc         *sc;
8014
8015         sc = ifp->if_softc;
8016
8017         printf("re%d: watchdog timeout\n", sc->re_unit);
8018 #if OS_VER < VERSION(11,0)
8019         ifp->if_oerrors++;
8020 #else
8021         if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
8022 #endif
8023
8024         re_txeof(sc);
8025         re_rxeof(sc);
8026         re_init(sc);
8027
8028         return;
8029 }
8030 #endif
8031 #endif  /* !__DragonFly__ */
8032
8033 /*
8034  * Set media options.
8035  */
8036 static int re_ifmedia_upd(struct ifnet *ifp)
8037 {
8038         struct re_softc *sc = ifp->if_softc;
8039         struct ifmedia  *ifm = &sc->media;
8040         int anar;
8041         int gbcr;
8042
8043         if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
8044                 return(EINVAL);
8045
8046         if (sc->re_type == MACFG_68 || sc->re_type == MACFG_69 ||
8047             sc->re_type == MACFG_70 || sc->re_type == MACFG_71) {
8048                 //Disable Giga Lite
8049                 MP_WritePhyUshort(sc, 0x1F, 0x0A42);
8050                 ClearEthPhyBit(sc, 0x14, BIT_9);
8051                 MP_WritePhyUshort(sc, 0x1F, 0x0A40);
8052                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8053         }
8054
8055
8056         switch (IFM_SUBTYPE(ifm->ifm_media)) {
8057         case IFM_AUTO:
8058                 anar = ANAR_TX_FD |
8059                        ANAR_TX |
8060                        ANAR_10_FD |
8061                        ANAR_10;
8062                 gbcr = GTCR_ADV_1000TFDX |
8063                        GTCR_ADV_1000THDX;
8064                 break;
8065         case IFM_1000_SX:
8066 #ifndef __DragonFly__
8067 #if OS_VER < 500000
8068         case IFM_1000_TX:
8069 #else
8070         case IFM_1000_T:
8071 #endif
8072 #else   /* __DragonFly__ */
8073         case IFM_1000_T:
8074 #endif  /* !__DragonFly__ */
8075                 anar = ANAR_TX_FD |
8076                        ANAR_TX |
8077                        ANAR_10_FD |
8078                        ANAR_10;
8079                 gbcr = GTCR_ADV_1000TFDX |
8080                        GTCR_ADV_1000THDX;
8081                 break;
8082         case IFM_100_TX:
8083                 gbcr = MP_ReadPhyUshort(sc, MII_100T2CR) &
8084                        ~(GTCR_ADV_1000TFDX | GTCR_ADV_1000THDX);
8085                 if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX) {
8086                         anar = ANAR_TX_FD |
8087                                ANAR_TX |
8088                                ANAR_10_FD |
8089                                ANAR_10;
8090                 } else {
8091                         anar = ANAR_TX |
8092                                ANAR_10_FD |
8093                                ANAR_10;
8094                 }
8095                 break;
8096         case IFM_10_T:
8097                 gbcr = MP_ReadPhyUshort(sc, MII_100T2CR) &
8098                        ~(GTCR_ADV_1000TFDX | GTCR_ADV_1000THDX);
8099                 if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX) {
8100                         anar = ANAR_10_FD |
8101                                ANAR_10;
8102                 } else {
8103                         anar = ANAR_10;
8104                 }
8105
8106                 if (sc->re_type == MACFG_13) {
8107                         MP_WritePhyUshort(sc, MII_BMCR, 0x8000);
8108                 }
8109
8110                 break;
8111         default:
8112 #ifndef __DragonFly__
8113                 printf("re%d: Unsupported media type\n", sc->re_unit);
8114                 return(0);
8115 #else
8116                 if_printf(ifp, "Unsupported media type\n");
8117                 return (EOPNOTSUPP);
8118 #endif
8119         }
8120
8121         MP_WritePhyUshort(sc, 0x1F, 0x0000);
8122         if (sc->re_device_id==RT_DEVICEID_8169 || sc->re_device_id==RT_DEVICEID_8169SC ||
8123             sc->re_device_id==RT_DEVICEID_8168 || sc->re_device_id==RT_DEVICEID_8161) {
8124                 MP_WritePhyUshort(sc, MII_ANAR, anar | 0x0800 | ANAR_FC);
8125                 MP_WritePhyUshort(sc, MII_100T2CR, gbcr);
8126                 MP_WritePhyUshort(sc, MII_BMCR, BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG);
8127         } else if (sc->re_type == MACFG_36) {
8128                 MP_WritePhyUshort(sc, MII_ANAR, anar | 0x0800 | ANAR_FC);
8129                 MP_WritePhyUshort(sc, MII_BMCR, BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG);
8130         } else {
8131                 MP_WritePhyUshort(sc, MII_ANAR, anar | 1);
8132                 MP_WritePhyUshort(sc, MII_BMCR, BMCR_AUTOEN | BMCR_STARTNEG);
8133         }
8134
8135         return(0);
8136 }
8137
8138 /*
8139  * Report current media status.
8140  */
8141 static void re_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
8142 {
8143         struct re_softc         *sc;
8144
8145         sc = ifp->if_softc;
8146
8147         RE_LOCK(sc);
8148
8149         ifmr->ifm_status = IFM_AVALID;
8150         ifmr->ifm_active = IFM_ETHER;
8151
8152         if (re_link_ok(sc)) {
8153                 unsigned char msr;
8154
8155                 ifmr->ifm_status |= IFM_ACTIVE;
8156
8157                 msr = CSR_READ_1(sc, RE_PHY_STATUS);
8158                 if (msr & RL_PHY_STATUS_FULL_DUP)
8159                         ifmr->ifm_active |= IFM_FDX;
8160                 else
8161                         ifmr->ifm_active |= IFM_HDX;
8162
8163                 if (msr & RL_PHY_STATUS_10M)
8164                         ifmr->ifm_active |= IFM_10_T;
8165                 else if (msr & RL_PHY_STATUS_100M)
8166                         ifmr->ifm_active |= IFM_100_TX;
8167                 else if (msr & RL_PHY_STATUS_1000MF)
8168                         ifmr->ifm_active |= IFM_1000_T;
8169 #ifdef __DragonFly__
8170         } else {
8171                 if (IFM_SUBTYPE(sc->media.ifm_media) == IFM_AUTO)
8172                         ifmr->ifm_active |= IFM_NONE;
8173                 else
8174                         ifmr->ifm_active |= sc->media.ifm_media;
8175 #endif
8176         }
8177
8178         RE_UNLOCK(sc);
8179
8180         return;
8181 }
8182
8183 static int re_enable_EEE(struct re_softc *sc)
8184 {
8185         int ret;
8186         u_int16_t data;
8187         u_int16_t PhyRegValue;
8188         u_int32_t WaitCnt;
8189
8190         ret = 0;
8191         switch (sc->re_type) {
8192         case MACFG_42:
8193         case MACFG_43:
8194                 re_eri_write(sc, 0x1B0, 2, 0xED03, ERIAR_ExGMAC);
8195                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
8196                 if (CSR_READ_1(sc, 0xEF) & 0x02) {
8197                         MP_WritePhyUshort(sc, 0x10, 0x731F);
8198                         MP_WritePhyUshort(sc, 0x19, 0x7630);
8199                 } else {
8200                         MP_WritePhyUshort(sc, 0x10, 0x711F);
8201                         MP_WritePhyUshort(sc, 0x19, 0x7030);
8202                 }
8203                 MP_WritePhyUshort(sc, 0x1A, 0x1506);
8204                 MP_WritePhyUshort(sc, 0x1B, 0x0551);
8205                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8206                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
8207                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
8208                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
8209                 MP_WritePhyUshort(sc, 0x0E, 0x0002);
8210                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
8211
8212                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8213                 MP_WritePhyUshort(sc, 0x0D, 0x0003);
8214                 MP_WritePhyUshort(sc, 0x0E, 0x0015);
8215                 MP_WritePhyUshort(sc, 0x0D, 0x4003);
8216                 MP_WritePhyUshort(sc, 0x0E, 0x0002);
8217                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
8218
8219                 MP_WritePhyUshort(sc, MII_BMCR, BMCR_AUTOEN | BMCR_STARTNEG);
8220                 break;
8221
8222         case MACFG_53:
8223         case MACFG_54:
8224         case MACFG_55:
8225                 re_eri_write(sc, 0x1B0, 2, 0xED03, ERIAR_ExGMAC);
8226                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
8227                 MP_WritePhyUshort(sc, 0x10, 0x731F);
8228                 MP_WritePhyUshort(sc, 0x19, 0x7630);
8229                 MP_WritePhyUshort(sc, 0x1A, 0x1506);
8230                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8231                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
8232                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
8233                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
8234                 MP_WritePhyUshort(sc, 0x0E, 0x0002);
8235                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
8236
8237                 MP_WritePhyUshort(sc, MII_BMCR, BMCR_AUTOEN | BMCR_STARTNEG);
8238                 break;
8239
8240         case MACFG_36:
8241         case MACFG_37:
8242                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
8243                 MP_WritePhyUshort(sc, 0x1E, 0x0020);
8244                 data = MP_ReadPhyUshort(sc, 0x15) | 0x0100;
8245                 MP_WritePhyUshort(sc, 0x15, data);
8246                 MP_WritePhyUshort(sc, 0x1F, 0x0006);
8247                 MP_WritePhyUshort(sc, 0x00, 0x5A30);
8248                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8249                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
8250                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
8251                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
8252                 MP_WritePhyUshort(sc, 0x0E, 0x0006);
8253                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
8254                 if ((CSR_READ_1(sc, RE_CFG4)&RL_CFG4_CUSTOMIZED_LED) && (CSR_READ_1(sc, RE_MACDBG) & BIT_7)) {
8255                         MP_WritePhyUshort(sc, 0x1F, 0x0005);
8256                         MP_WritePhyUshort(sc, 0x05, 0x8AC8);
8257                         MP_WritePhyUshort(sc, 0x06, CSR_READ_1(sc, RE_CUSTOM_LED));
8258                         MP_WritePhyUshort(sc, 0x05, 0x8B82);
8259                         data = MP_ReadPhyUshort(sc, 0x06) | 0x0010;
8260                         MP_WritePhyUshort(sc, 0x05, 0x8B82);
8261                         MP_WritePhyUshort(sc, 0x06, data);
8262                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
8263                 }
8264                 break;
8265
8266         case MACFG_50:
8267         case MACFG_51:
8268         case MACFG_52:
8269                 data = re_eri_read(sc, 0x1B0, 4, ERIAR_ExGMAC) | 0x0003;
8270                 re_eri_write(sc, 0x1B0, 4, data, ERIAR_ExGMAC);
8271                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
8272                 MP_WritePhyUshort(sc, 0x1E, 0x0020);
8273                 data = MP_ReadPhyUshort(sc, 0x15)|0x0100;
8274                 MP_WritePhyUshort(sc, 0x15, data);
8275                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
8276                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
8277                 data = MP_ReadPhyUshort(sc, 0x06)|0x2000;
8278                 MP_WritePhyUshort(sc, 0x06, data);
8279                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8280                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
8281                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
8282                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
8283                 MP_WritePhyUshort(sc, 0x0E, 0x0006);
8284                 MP_WritePhyUshort(sc, 0x1D, 0x0000);
8285                 break;
8286
8287         case MACFG_38:
8288         case MACFG_39:
8289                 data = re_eri_read(sc, 0x1B0, 4, ERIAR_ExGMAC);
8290                 data |= BIT_1 | BIT_0;
8291                 re_eri_write(sc, 0x1B0, 4, data, ERIAR_ExGMAC);
8292                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
8293                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
8294                 MP_WritePhyUshort(sc, 0x1e, 0x0020);
8295                 data = MP_ReadPhyUshort(sc, 0x15);
8296                 data |= BIT_8;
8297                 MP_WritePhyUshort(sc, 0x15, data);
8298                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
8299                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
8300                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
8301                 data = MP_ReadPhyUshort(sc, 0x06);
8302                 data |= BIT_13;
8303                 MP_WritePhyUshort(sc, 0x06, data);
8304                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8305                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
8306                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
8307                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
8308                 MP_WritePhyUshort(sc, 0x0E, 0x0006);
8309                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
8310                 break;
8311
8312         case MACFG_56:
8313         case MACFG_57:
8314         case MACFG_58:
8315         case MACFG_59:
8316         case MACFG_60:
8317         case MACFG_61:
8318         case MACFG_62:
8319         case MACFG_67:
8320         case MACFG_68:
8321         case MACFG_69:
8322         case MACFG_70:
8323         case MACFG_71:
8324                 data = re_eri_read(sc, 0x1B0, 4, ERIAR_ExGMAC);
8325                 data |= BIT_1 | BIT_0;
8326                 re_eri_write(sc, 0x1B0, 4, data, ERIAR_ExGMAC);
8327                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
8328                 data = MP_ReadPhyUshort(sc, 0x11);
8329                 MP_WritePhyUshort(sc, 0x11, data | BIT_4);
8330                 MP_WritePhyUshort(sc, 0x1F, 0x0A5D);
8331                 MP_WritePhyUshort(sc, 0x10, 0x0006);
8332                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8333                 break;
8334
8335         default:
8336                 ret = -EOPNOTSUPP;
8337                 break;
8338         }
8339
8340         switch (sc->re_type) {
8341         case MACFG_68:
8342         case MACFG_69:
8343                 MP_WritePhyUshort(sc, 0x1F, 0x0A4A);
8344                 SetEthPhyBit(sc, 0x11, BIT_9);
8345                 MP_WritePhyUshort(sc, 0x1F, 0x0A42);
8346                 SetEthPhyBit(sc, 0x14, BIT_7);
8347                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8348                 break;
8349         }
8350
8351         /*Advanced EEE*/
8352         switch (sc->re_type) {
8353         case MACFG_58:
8354         case MACFG_59:
8355         case MACFG_60:
8356         case MACFG_68:
8357         case MACFG_69:
8358                 MP_WritePhyUshort(sc, 0x1F, 0x0B82);
8359                 SetEthPhyBit(sc, 0x10, BIT_4);
8360                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8361
8362                 MP_WritePhyUshort(sc, 0x1F, 0x0B80);
8363                 WaitCnt = 0;
8364                 do {
8365                         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
8366                         PhyRegValue &= 0x0040;
8367                         DELAY(50);
8368                         DELAY(50);
8369                         WaitCnt++;
8370                 } while(PhyRegValue != 0x0040 && WaitCnt <1000);
8371
8372                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8373                 break;
8374         }
8375
8376         switch (sc->re_type) {
8377         case MACFG_59:
8378                 re_eri_write(sc, 0x1EA, 1, 0xFA, ERIAR_ExGMAC);
8379
8380                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
8381                 data = MP_ReadPhyUshort(sc, 0x10);
8382                 if (data & BIT_10) {
8383                         MP_WritePhyUshort(sc, 0x1F, 0x0A42);
8384                         data = MP_ReadPhyUshort(sc, 0x16);
8385                         data &= ~(BIT_1);
8386                         MP_WritePhyUshort(sc, 0x16, data);
8387                 } else {
8388                         MP_WritePhyUshort(sc, 0x1F, 0x0A42);
8389                         data = MP_ReadPhyUshort(sc, 0x16);
8390                         data |= BIT_1;
8391                         MP_WritePhyUshort(sc, 0x16, data);
8392                 }
8393                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8394                 break;
8395         case MACFG_60:
8396                 data = MP_ReadMcuAccessRegWord(sc, 0xE052);
8397                 data |= BIT_0;
8398                 MP_WriteMcuAccessRegWord(sc, 0xE052, data);
8399                 data = MP_ReadMcuAccessRegWord(sc, 0xE056);
8400                 data &= 0xFF0F;
8401                 data |= (BIT_4 | BIT_5 | BIT_6);
8402                 MP_WriteMcuAccessRegWord(sc, 0xE056, data);
8403
8404                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
8405                 data = MP_ReadPhyUshort(sc, 0x10);
8406                 if (data & BIT_10) {
8407                         MP_WritePhyUshort(sc, 0x1F, 0x0A42);
8408                         data = MP_ReadPhyUshort(sc, 0x16);
8409                         data &= ~(BIT_1);
8410                         MP_WritePhyUshort(sc, 0x16, data);
8411                 } else {
8412                         MP_WritePhyUshort(sc, 0x1F, 0x0A42);
8413                         data = MP_ReadPhyUshort(sc, 0x16);
8414                         data |= BIT_1;
8415                         MP_WritePhyUshort(sc, 0x16, data);
8416                 }
8417                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8418                 break;
8419         case MACFG_61:
8420         case MACFG_62:
8421         case MACFG_67:
8422                 OOB_mutex_lock(sc);
8423                 data = MP_ReadMcuAccessRegWord(sc, 0xE052);
8424                 data &= ~BIT_0;
8425                 MP_WriteMcuAccessRegWord(sc, 0xE052, data);
8426                 OOB_mutex_unlock(sc);
8427                 data = MP_ReadMcuAccessRegWord(sc, 0xE056);
8428                 data &= 0xFF0F;
8429                 data |= (BIT_4 | BIT_5 | BIT_6);
8430                 MP_WriteMcuAccessRegWord(sc, 0xE056, data);
8431                 break;
8432         case MACFG_70:
8433         case MACFG_71:
8434                 OOB_mutex_lock(sc);
8435                 data = MP_ReadMcuAccessRegWord(sc, 0xE052);
8436                 data &= ~BIT_0;
8437                 MP_WriteMcuAccessRegWord(sc, 0xE052, data);
8438                 OOB_mutex_unlock(sc);
8439                 data = MP_ReadMcuAccessRegWord(sc, 0xE056);
8440                 data &= 0xFF0F;
8441                 data |= (BIT_4 | BIT_5 | BIT_6);
8442                 MP_WriteMcuAccessRegWord(sc, 0xE056, data);
8443                 MP_WriteMcuAccessRegWord(sc, 0xEA80, 0x0003);
8444                 break;
8445         case MACFG_68:
8446         case MACFG_69:
8447                 data = MP_ReadMcuAccessRegWord(sc, 0xE052);
8448                 data |= BIT_0;
8449                 MP_WriteMcuAccessRegWord(sc, 0xE052, data);
8450
8451                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
8452                 data = MP_ReadPhyUshort(sc, 0x10) | BIT_15;
8453                 MP_WritePhyUshort(sc, 0x10, data);
8454
8455                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
8456                 data = MP_ReadPhyUshort(sc, 0x11) | BIT_13 | BIT_14;
8457                 data &= ~(BIT_12);
8458                 MP_WritePhyUshort(sc, 0x11, data);
8459                 break;
8460         }
8461
8462         switch (sc->re_type) {
8463         case MACFG_58:
8464         case MACFG_59:
8465         case MACFG_60:
8466         case MACFG_68:
8467         case MACFG_69:
8468                 MP_WritePhyUshort(sc, 0x1F, 0x0B82);
8469                 ClearEthPhyBit(sc, 0x10, BIT_4);
8470                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8471                 break;
8472         }
8473
8474         return ret;
8475 }
8476
8477 static int re_disable_EEE(struct re_softc *sc)
8478 {
8479         int ret;
8480         u_int16_t data;
8481         u_int16_t PhyRegValue;
8482         u_int32_t WaitCnt;
8483
8484         ret = 0;
8485         switch (sc->re_type) {
8486         case MACFG_42:
8487         case MACFG_43:
8488                 re_eri_write(sc, 0x1B0, 2, 0, ERIAR_ExGMAC);
8489                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
8490                 MP_WritePhyUshort(sc, 0x10, 0x401F);
8491                 MP_WritePhyUshort(sc, 0x19, 0x7030);
8492
8493                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8494                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
8495                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
8496                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
8497                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
8498                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
8499
8500                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8501                 MP_WritePhyUshort(sc, 0x0D, 0x0003);
8502                 MP_WritePhyUshort(sc, 0x0E, 0x0015);
8503                 MP_WritePhyUshort(sc, 0x0D, 0x4003);
8504                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
8505                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
8506
8507                 MP_WritePhyUshort(sc, MII_BMCR, BMCR_AUTOEN | BMCR_STARTNEG);
8508                 break;
8509
8510         case MACFG_53:
8511                 re_eri_write(sc, 0x1B0, 2, 0, ERIAR_ExGMAC);
8512                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
8513                 MP_WritePhyUshort(sc, 0x10, 0x401F);
8514                 MP_WritePhyUshort(sc, 0x19, 0x7030);
8515
8516                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8517                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
8518                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
8519                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
8520                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
8521                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
8522
8523                 MP_WritePhyUshort(sc, MII_BMCR, BMCR_AUTOEN | BMCR_STARTNEG);
8524                 break;
8525
8526         case MACFG_54:
8527         case MACFG_55:
8528                 re_eri_write(sc, 0x1B0, 2, 0, ERIAR_ExGMAC);
8529                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
8530                 MP_WritePhyUshort(sc, 0x10, 0xC07F);
8531                 MP_WritePhyUshort(sc, 0x19, 0x7030);
8532                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8533
8534                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8535                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
8536                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
8537                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
8538                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
8539                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
8540
8541                 MP_WritePhyUshort(sc, MII_BMCR, BMCR_AUTOEN | BMCR_STARTNEG);
8542                 break;
8543
8544         case MACFG_36:
8545         case MACFG_37:
8546                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
8547                 MP_WritePhyUshort(sc, 0x1E, 0x0020);
8548                 data = MP_ReadPhyUshort(sc, 0x15) & ~0x0100;
8549                 MP_WritePhyUshort(sc, 0x15, data);
8550                 MP_WritePhyUshort(sc, 0x1F, 0x0006);
8551                 MP_WritePhyUshort(sc, 0x00, 0x5A00);
8552                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8553                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
8554                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
8555                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
8556                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
8557                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
8558                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8559                 if (CSR_READ_1(sc, RE_CFG4) & RL_CFG4_CUSTOMIZED_LED) {
8560                         MP_WritePhyUshort(sc, 0x1F, 0x0005);
8561                         MP_WritePhyUshort(sc, 0x05, 0x8B82);
8562                         data = MP_ReadPhyUshort(sc, 0x06) & ~0x0010;
8563                         MP_WritePhyUshort(sc, 0x05, 0x8B82);
8564                         MP_WritePhyUshort(sc, 0x06, data);
8565                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
8566                 }
8567                 break;
8568
8569         case MACFG_50:
8570         case MACFG_51:
8571         case MACFG_52:
8572                 data = re_eri_read(sc, 0x1B0, 4, ERIAR_ExGMAC)& ~0x0003;
8573                 re_eri_write(sc, 0x1B0, 4, data, ERIAR_ExGMAC);
8574                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
8575                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
8576                 data = MP_ReadPhyUshort(sc, 0x06) & ~0x2000;
8577                 MP_WritePhyUshort(sc, 0x06, data);
8578                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
8579                 MP_WritePhyUshort(sc, 0x1E, 0x0020);
8580                 data = MP_ReadPhyUshort(sc, 0x15) & ~0x0100;
8581                 MP_WritePhyUshort(sc, 0x15, data);
8582                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8583                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
8584                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
8585                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
8586                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
8587                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
8588                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8589                 break;
8590
8591         case MACFG_38:
8592         case MACFG_39:
8593                 data = re_eri_read(sc, 0x1B0, 4, ERIAR_ExGMAC);
8594                 data &= ~(BIT_1 | BIT_0);
8595                 re_eri_write(sc, 0x1B0, 4, data, ERIAR_ExGMAC);
8596                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
8597                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
8598                 data = MP_ReadPhyUshort(sc, 0x06);
8599                 data &= ~BIT_13;
8600                 MP_WritePhyUshort(sc, 0x06, data);
8601                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
8602                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
8603                 MP_WritePhyUshort(sc, 0x1e, 0x0020);
8604                 data = MP_ReadPhyUshort(sc, 0x15);
8605                 data &= ~BIT_8;
8606                 MP_WritePhyUshort(sc, 0x15, data);
8607                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
8608                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8609                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
8610                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
8611                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
8612                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
8613                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
8614                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8615                 break;
8616
8617         case MACFG_56:
8618         case MACFG_57:
8619         case MACFG_58:
8620         case MACFG_59:
8621         case MACFG_60:
8622         case MACFG_61:
8623         case MACFG_62:
8624         case MACFG_67:
8625         case MACFG_68:
8626         case MACFG_69:
8627         case MACFG_70:
8628         case MACFG_71:
8629                 data = re_eri_read(sc, 0x1B0, 4, ERIAR_ExGMAC);
8630                 data &= ~(BIT_1 | BIT_0);
8631                 re_eri_write(sc, 0x1B0, 4, data, ERIAR_ExGMAC);
8632                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
8633                 data = MP_ReadPhyUshort(sc, 0x11);
8634                 MP_WritePhyUshort(sc, 0x11, data & ~BIT_4);
8635                 MP_WritePhyUshort(sc, 0x1F, 0x0A5D);
8636                 MP_WritePhyUshort(sc, 0x10, 0x0000);
8637                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8638                 break;
8639
8640         default:
8641                 ret = -EOPNOTSUPP;
8642                 break;
8643         }
8644
8645         switch (sc->re_type) {
8646         case MACFG_68:
8647         case MACFG_69:
8648                 MP_WritePhyUshort(sc, 0x1F, 0x0A42);
8649                 ClearEthPhyBit(sc, 0x14, BIT_7);
8650                 MP_WritePhyUshort(sc, 0x1F, 0x0A4A);
8651                 ClearEthPhyBit(sc, 0x11, BIT_9);
8652                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8653                 break;
8654         }
8655
8656         /*Advanced EEE*/
8657         switch (sc->re_type) {
8658         case MACFG_58:
8659         case MACFG_59:
8660         case MACFG_60:
8661         case MACFG_68:
8662         case MACFG_69:
8663                 MP_WritePhyUshort(sc, 0x1F, 0x0B82);
8664                 SetEthPhyBit(sc, 0x10, BIT_4);
8665                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8666
8667                 MP_WritePhyUshort(sc, 0x1F, 0x0B80);
8668                 WaitCnt = 0;
8669                 do {
8670                         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
8671                         PhyRegValue &= 0x0040;
8672                         DELAY(50);
8673                         DELAY(50);
8674                         WaitCnt++;
8675                 } while(PhyRegValue != 0x0040 && WaitCnt <1000);
8676
8677                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8678                 break;
8679         }
8680
8681         switch (sc->re_type) {
8682         case MACFG_59:
8683                 re_eri_write(sc, 0x1EA, 1, 0x00, ERIAR_ExGMAC);
8684
8685                 MP_WritePhyUshort(sc, 0x1F, 0x0A42);
8686                 data = MP_ReadPhyUshort(sc, 0x16);
8687                 data &= ~(BIT_1);
8688                 MP_WritePhyUshort(sc, 0x16, data);
8689                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8690                 break;
8691         case MACFG_60:
8692                 data = MP_ReadMcuAccessRegWord(sc, 0xE052);
8693                 data &= ~(BIT_0);
8694                 MP_WriteMcuAccessRegWord(sc, 0xE052, data);
8695
8696                 MP_WritePhyUshort(sc, 0x1F, 0x0A42);
8697                 data = MP_ReadPhyUshort(sc, 0x16);
8698                 data &= ~(BIT_1);
8699                 MP_WritePhyUshort(sc, 0x16, data);
8700                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8701                 break;
8702         case MACFG_61:
8703         case MACFG_62:
8704         case MACFG_67:
8705         case MACFG_70:
8706         case MACFG_71:
8707                 data = MP_ReadMcuAccessRegWord(sc, 0xE052);
8708                 data &= ~(BIT_0);
8709                 MP_WriteMcuAccessRegWord(sc, 0xE052, data);
8710                 break;
8711         case MACFG_68:
8712         case MACFG_69:
8713                 data = MP_ReadMcuAccessRegWord(sc, 0xE052);
8714                 data &= ~(BIT_0);
8715                 MP_WriteMcuAccessRegWord(sc, 0xE052, data);
8716
8717                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
8718                 data = MP_ReadPhyUshort(sc, 0x10) & ~(BIT_15);
8719                 MP_WritePhyUshort(sc, 0x10, data);
8720
8721                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
8722                 data = MP_ReadPhyUshort(sc, 0x11) & ~(BIT_12 | BIT_13 | BIT_14);
8723                 MP_WritePhyUshort(sc, 0x11, data);
8724                 break;
8725         }
8726
8727         switch (sc->re_type) {
8728         case MACFG_58:
8729         case MACFG_59:
8730         case MACFG_60:
8731         case MACFG_68:
8732         case MACFG_69:
8733                 MP_WritePhyUshort(sc, 0x1F, 0x0B82);
8734                 ClearEthPhyBit(sc, 0x10, BIT_4);
8735                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8736                 break;
8737         }
8738
8739         return ret;
8740 }
8741
8742 static int re_phy_ram_code_check(struct re_softc *sc)
8743 {
8744         u_int16_t PhyRegValue;
8745         u_int32_t WaitCnt;
8746         int retval = TRUE;
8747
8748         switch(sc->re_type) {
8749         case MACFG_56:
8750                 MP_WritePhyUshort(sc, 0x1f, 0x0A40);
8751                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
8752                 PhyRegValue &= ~(BIT_11);
8753                 MP_WritePhyUshort(sc, 0x10, PhyRegValue);
8754
8755
8756                 MP_WritePhyUshort(sc, 0x1f, 0x0A00);
8757                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
8758                 PhyRegValue &= ~(BIT_12 | BIT_13 | BIT_14 | BIT_15);
8759                 MP_WritePhyUshort(sc, 0x10, PhyRegValue);
8760
8761                 MP_WritePhyUshort(sc, 0x1f, 0x0A43);
8762                 MP_WritePhyUshort(sc, 0x13, 0x8010);
8763                 PhyRegValue = MP_ReadPhyUshort(sc, 0x14);
8764                 PhyRegValue &= ~(BIT_11);
8765                 MP_WritePhyUshort(sc, 0x14, PhyRegValue);
8766
8767                 MP_WritePhyUshort(sc, 0x1f, 0x0B82);
8768                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
8769                 PhyRegValue |= BIT_4;
8770                 MP_WritePhyUshort(sc, 0x10, PhyRegValue);
8771
8772                 MP_WritePhyUshort(sc, 0x1f, 0x0B80);
8773                 WaitCnt = 0;
8774                 do {
8775                         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
8776                         PhyRegValue &= 0x0040;
8777                         DELAY(50);
8778                         DELAY(50);
8779                         WaitCnt++;
8780                 } while(PhyRegValue != 0x0040 && WaitCnt <1000);
8781
8782                 if (WaitCnt == 1000) {
8783                         retval = FALSE;
8784                 }
8785
8786                 MP_WritePhyUshort(sc, 0x1f, 0x0A40);
8787                 MP_WritePhyUshort(sc, 0x10, 0x0140);
8788
8789                 MP_WritePhyUshort(sc, 0x1f, 0x0A4A);
8790                 PhyRegValue = MP_ReadPhyUshort(sc, 0x13);
8791                 PhyRegValue &= ~(BIT_6);
8792                 PhyRegValue |= (BIT_7);
8793                 MP_WritePhyUshort(sc, 0x13, PhyRegValue);
8794
8795                 MP_WritePhyUshort(sc, 0x1f, 0x0A44);
8796                 PhyRegValue = MP_ReadPhyUshort(sc, 0x14);
8797                 PhyRegValue |= (BIT_2);
8798                 MP_WritePhyUshort(sc, 0x14, PhyRegValue);
8799
8800                 MP_WritePhyUshort(sc, 0x1f, 0x0A50);
8801                 PhyRegValue = MP_ReadPhyUshort(sc, 0x11);
8802                 PhyRegValue |= (BIT_11|BIT_12);
8803                 MP_WritePhyUshort(sc, 0x11, PhyRegValue);
8804
8805                 MP_WritePhyUshort(sc, 0x1f, 0x0B82);
8806                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
8807                 PhyRegValue &= ~(BIT_4);
8808                 MP_WritePhyUshort(sc, 0x10, PhyRegValue);
8809
8810                 MP_WritePhyUshort(sc, 0x1f, 0x0A22);
8811                 WaitCnt = 0;
8812                 do {
8813                         PhyRegValue = MP_ReadPhyUshort(sc, 0x12);
8814                         PhyRegValue &= 0x0010;
8815                         DELAY(50);
8816                         DELAY(50);
8817                         WaitCnt++;
8818                 } while(PhyRegValue != 0x0010 && WaitCnt <1000);
8819
8820                 if (WaitCnt == 1000) {
8821                         retval = FALSE;
8822                 }
8823
8824                 MP_WritePhyUshort(sc, 0x1f, 0x0A40);
8825                 MP_WritePhyUshort(sc, 0x10, 0x1040);
8826
8827                 MP_WritePhyUshort(sc, 0x1f, 0x0A4A);
8828                 PhyRegValue = MP_ReadPhyUshort(sc, 0x13);
8829                 PhyRegValue &= ~(BIT_6|BIT_7);
8830                 MP_WritePhyUshort(sc, 0x13, PhyRegValue);
8831
8832                 MP_WritePhyUshort(sc, 0x1f, 0x0A44);
8833                 PhyRegValue = MP_ReadPhyUshort(sc, 0x14);
8834                 PhyRegValue &= ~(BIT_2);
8835                 MP_WritePhyUshort(sc, 0x14, PhyRegValue);
8836
8837                 MP_WritePhyUshort(sc, 0x1f, 0x0A50);
8838                 PhyRegValue = MP_ReadPhyUshort(sc, 0x11);
8839                 PhyRegValue &= ~(BIT_11|BIT_12);
8840                 MP_WritePhyUshort(sc, 0x11, PhyRegValue);
8841
8842                 MP_WritePhyUshort(sc, 0x1f, 0x0A43);
8843                 MP_WritePhyUshort(sc, 0x13, 0x8010);
8844                 PhyRegValue = MP_ReadPhyUshort(sc, 0x14);
8845                 PhyRegValue |= (BIT_11);
8846                 MP_WritePhyUshort(sc, 0x14, PhyRegValue);
8847
8848                 MP_WritePhyUshort(sc, 0x1f, 0x0B82);
8849                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
8850                 PhyRegValue |= BIT_4;
8851                 MP_WritePhyUshort(sc, 0x10, PhyRegValue);
8852
8853                 MP_WritePhyUshort(sc, 0x1f, 0x0B80);
8854                 WaitCnt = 0;
8855                 do {
8856                         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
8857                         PhyRegValue &= 0x0040;
8858                         DELAY(50);
8859                         DELAY(50);
8860                         WaitCnt++;
8861                 } while(PhyRegValue != 0x0040 && WaitCnt <1000);
8862
8863                 if (WaitCnt == 1000) {
8864                         retval = FALSE;
8865                 }
8866
8867                 MP_WritePhyUshort(sc, 0x1f, 0x0A20);
8868                 PhyRegValue = MP_ReadPhyUshort(sc, 0x13);
8869                 if (PhyRegValue & BIT_11) {
8870                         if (PhyRegValue & BIT_10) {
8871                                 retval = FALSE;
8872                         }
8873                 }
8874
8875                 MP_WritePhyUshort(sc, 0x1f, 0x0B82);
8876                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
8877                 PhyRegValue &= ~(BIT_4);
8878                 MP_WritePhyUshort(sc, 0x10, PhyRegValue);
8879
8880                 //delay 2ms
8881                 DELAY(2000);
8882                 break;
8883         default:
8884                 break;
8885         }
8886
8887         MP_WritePhyUshort(sc, 0x1F, 0x0000);
8888
8889         return retval;
8890 }
8891
8892 static void re_set_phy_ram_code_check_fail_flag(struct re_softc *sc)
8893 {
8894         u_int16_t TmpUshort;
8895
8896         switch(sc->re_type) {
8897         case MACFG_56:
8898                 TmpUshort = MP_ReadMcuAccessRegWord(sc, 0xD3C0);
8899                 TmpUshort |= BIT_0;
8900                 MP_WriteMcuAccessRegWord(sc, 0xD3C0, TmpUshort);
8901                 break;
8902         }
8903 }
8904
8905 static int re_hw_phy_mcu_code_ver_matched(struct re_softc *sc)
8906 {
8907         int ram_code_ver_match = 0;
8908
8909         switch (sc->re_type) {
8910         case MACFG_36:
8911         case MACFG_37:
8912                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
8913                 MP_WritePhyUshort(sc, 0x05, 0x8B60);
8914                 sc->re_hw_ram_code_ver = MP_ReadPhyUshort(sc, 0x06);
8915                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8916                 break;
8917         case MACFG_38:
8918         case MACFG_39:
8919         case MACFG_50:
8920         case MACFG_51:
8921         case MACFG_52:
8922                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
8923                 MP_WritePhyUshort(sc, 0x05, 0x8B30);
8924                 sc->re_hw_ram_code_ver = MP_ReadPhyUshort(sc, 0x06);
8925                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8926                 break;
8927         case MACFG_56:
8928         case MACFG_57:
8929         case MACFG_58:
8930         case MACFG_59:
8931         case MACFG_60:
8932         case MACFG_61:
8933         case MACFG_62:
8934         case MACFG_67:
8935         case MACFG_68:
8936         case MACFG_69:
8937         case MACFG_70:
8938         case MACFG_71:
8939                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
8940                 MP_WritePhyUshort(sc, 0x13, 0x801E);
8941                 sc->re_hw_ram_code_ver = MP_ReadPhyUshort(sc, 0x14);
8942                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8943                 break;
8944         default:
8945                 sc->re_hw_ram_code_ver = ~0;
8946                 break;
8947         }
8948
8949         if (sc->re_hw_ram_code_ver == sc->re_sw_ram_code_ver)
8950                 ram_code_ver_match = 1;
8951
8952         return ram_code_ver_match;
8953 }
8954
8955 static void re_write_hw_phy_mcu_code_ver(struct re_softc *sc)
8956 {
8957         switch (sc->re_type) {
8958         case MACFG_36:
8959         case MACFG_37:
8960                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
8961                 MP_WritePhyUshort(sc, 0x05, 0x8B60);
8962                 MP_WritePhyUshort(sc, 0x06, sc->re_sw_ram_code_ver);
8963                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8964                 sc->re_hw_ram_code_ver = sc->re_sw_ram_code_ver;
8965                 break;
8966         case MACFG_38:
8967         case MACFG_39:
8968         case MACFG_50:
8969         case MACFG_51:
8970         case MACFG_52:
8971                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
8972                 MP_WritePhyUshort(sc, 0x05, 0x8B30);
8973                 MP_WritePhyUshort(sc, 0x06, sc->re_sw_ram_code_ver);
8974                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8975                 sc->re_hw_ram_code_ver = sc->re_sw_ram_code_ver;
8976                 break;
8977         case MACFG_56:
8978         case MACFG_57:
8979         case MACFG_58:
8980         case MACFG_59:
8981         case MACFG_60:
8982         case MACFG_61:
8983         case MACFG_62:
8984         case MACFG_67:
8985         case MACFG_68:
8986         case MACFG_69:
8987         case MACFG_70:
8988         case MACFG_71:
8989                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
8990                 MP_WritePhyUshort(sc, 0x13, 0x801E);
8991                 MP_WritePhyUshort(sc, 0x14, sc->re_sw_ram_code_ver);
8992                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8993                 sc->re_hw_ram_code_ver = sc->re_sw_ram_code_ver;
8994                 break;
8995         }
8996 }
8997
8998 static void re_set_phy_mcu_8168e_1(struct re_softc *sc)
8999 {
9000         u_int16_t PhyRegValue;
9001         int i;
9002
9003         MP_WritePhyUshort(sc, 0x1f, 0x0000);
9004         MP_WritePhyUshort(sc, 0x00, 0x1800);
9005         MP_WritePhyUshort(sc, 0x1f, 0x0007);
9006         MP_WritePhyUshort(sc, 0x1e, 0x0023);
9007         MP_WritePhyUshort(sc, 0x17, 0x0117);
9008         MP_WritePhyUshort(sc, 0x1f, 0x0007);
9009         MP_WritePhyUshort(sc, 0x1E, 0x002C);
9010         MP_WritePhyUshort(sc, 0x1B, 0x5000);
9011         MP_WritePhyUshort(sc, 0x1f, 0x0000);
9012         MP_WritePhyUshort(sc, 0x16, 0x4104);
9013         for (i=0; i<200; i++) {
9014                 DELAY(100);
9015                 PhyRegValue = MP_ReadPhyUshort(sc, 0x1E);
9016                 PhyRegValue &= 0x03FF;
9017                 if (PhyRegValue== 0x000C)
9018                         break;
9019         }
9020         MP_WritePhyUshort(sc, 0x1f, 0x0005);
9021         for (i=0; i<200; i++) {
9022                 DELAY(100);
9023                 PhyRegValue = MP_ReadPhyUshort(sc, 0x07);
9024                 if ((PhyRegValue&0x0020)==0)
9025                         break;
9026         }
9027         PhyRegValue = MP_ReadPhyUshort(sc, 0x07);
9028         if (PhyRegValue & 0x0020) {
9029                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
9030                 MP_WritePhyUshort(sc, 0x1e, 0x00a1);
9031                 MP_WritePhyUshort(sc, 0x17, 0x1000);
9032                 MP_WritePhyUshort(sc, 0x17, 0x0000);
9033                 MP_WritePhyUshort(sc, 0x17, 0x2000);
9034                 MP_WritePhyUshort(sc, 0x1e, 0x002f);
9035                 MP_WritePhyUshort(sc, 0x18, 0x9bfb);
9036                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
9037                 MP_WritePhyUshort(sc, 0x07, 0x0000);
9038                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
9039         }
9040
9041         MP_WritePhyUshort(sc, 0x1f, 0x0005);
9042         MP_WritePhyUshort(sc, 0x05, 0xfff6);
9043         MP_WritePhyUshort(sc, 0x06, 0x0080);
9044         PhyRegValue = MP_ReadPhyUshort(sc, 0x00);
9045         PhyRegValue &= ~(BIT_7);
9046         MP_WritePhyUshort(sc, 0x00, PhyRegValue);
9047         MP_WritePhyUshort(sc, 0x1f, 0x0002);
9048         PhyRegValue = MP_ReadPhyUshort(sc, 0x08);
9049         PhyRegValue &= ~(BIT_7);
9050         MP_WritePhyUshort(sc, 0x08, PhyRegValue);
9051         MP_WritePhyUshort(sc, 0x1f, 0x0000);
9052         MP_WritePhyUshort(sc, 0x1f, 0x0007);
9053         MP_WritePhyUshort(sc, 0x1e, 0x0023);
9054         MP_WritePhyUshort(sc, 0x16, 0x0306);
9055         MP_WritePhyUshort(sc, 0x16, 0x0307);
9056         MP_WritePhyUshort(sc, 0x15, 0x000e);
9057         MP_WritePhyUshort(sc, 0x19, 0x000a);
9058         MP_WritePhyUshort(sc, 0x15, 0x0010);
9059         MP_WritePhyUshort(sc, 0x19, 0x0008);
9060         MP_WritePhyUshort(sc, 0x15, 0x0018);
9061         MP_WritePhyUshort(sc, 0x19, 0x4801);
9062         MP_WritePhyUshort(sc, 0x15, 0x0019);
9063         MP_WritePhyUshort(sc, 0x19, 0x6801);
9064         MP_WritePhyUshort(sc, 0x15, 0x001a);
9065         MP_WritePhyUshort(sc, 0x19, 0x66a1);
9066         MP_WritePhyUshort(sc, 0x15, 0x001f);
9067         MP_WritePhyUshort(sc, 0x19, 0x0000);
9068         MP_WritePhyUshort(sc, 0x15, 0x0020);
9069         MP_WritePhyUshort(sc, 0x19, 0x0000);
9070         MP_WritePhyUshort(sc, 0x15, 0x0021);
9071         MP_WritePhyUshort(sc, 0x19, 0x0000);
9072         MP_WritePhyUshort(sc, 0x15, 0x0022);
9073         MP_WritePhyUshort(sc, 0x19, 0x0000);
9074         MP_WritePhyUshort(sc, 0x15, 0x0023);
9075         MP_WritePhyUshort(sc, 0x19, 0x0000);
9076         MP_WritePhyUshort(sc, 0x15, 0x0024);
9077         MP_WritePhyUshort(sc, 0x19, 0x0000);
9078         MP_WritePhyUshort(sc, 0x15, 0x0025);
9079         MP_WritePhyUshort(sc, 0x19, 0x64a1);
9080         MP_WritePhyUshort(sc, 0x15, 0x0026);
9081         MP_WritePhyUshort(sc, 0x19, 0x40ea);
9082         MP_WritePhyUshort(sc, 0x15, 0x0027);
9083         MP_WritePhyUshort(sc, 0x19, 0x4503);
9084         MP_WritePhyUshort(sc, 0x15, 0x0028);
9085         MP_WritePhyUshort(sc, 0x19, 0x9f00);
9086         MP_WritePhyUshort(sc, 0x15, 0x0029);
9087         MP_WritePhyUshort(sc, 0x19, 0xa631);
9088         MP_WritePhyUshort(sc, 0x15, 0x002a);
9089         MP_WritePhyUshort(sc, 0x19, 0x9717);
9090         MP_WritePhyUshort(sc, 0x15, 0x002b);
9091         MP_WritePhyUshort(sc, 0x19, 0x302c);
9092         MP_WritePhyUshort(sc, 0x15, 0x002c);
9093         MP_WritePhyUshort(sc, 0x19, 0x4802);
9094         MP_WritePhyUshort(sc, 0x15, 0x002d);
9095         MP_WritePhyUshort(sc, 0x19, 0x58da);
9096         MP_WritePhyUshort(sc, 0x15, 0x002e);
9097         MP_WritePhyUshort(sc, 0x19, 0x400d);
9098         MP_WritePhyUshort(sc, 0x15, 0x002f);
9099         MP_WritePhyUshort(sc, 0x19, 0x4488);
9100         MP_WritePhyUshort(sc, 0x15, 0x0030);
9101         MP_WritePhyUshort(sc, 0x19, 0x9e00);
9102         MP_WritePhyUshort(sc, 0x15, 0x0031);
9103         MP_WritePhyUshort(sc, 0x19, 0x63c8);
9104         MP_WritePhyUshort(sc, 0x15, 0x0032);
9105         MP_WritePhyUshort(sc, 0x19, 0x6481);
9106         MP_WritePhyUshort(sc, 0x15, 0x0033);
9107         MP_WritePhyUshort(sc, 0x19, 0x0000);
9108         MP_WritePhyUshort(sc, 0x15, 0x0034);
9109         MP_WritePhyUshort(sc, 0x19, 0x0000);
9110         MP_WritePhyUshort(sc, 0x15, 0x0035);
9111         MP_WritePhyUshort(sc, 0x19, 0x0000);
9112         MP_WritePhyUshort(sc, 0x15, 0x0036);
9113         MP_WritePhyUshort(sc, 0x19, 0x0000);
9114         MP_WritePhyUshort(sc, 0x15, 0x0037);
9115         MP_WritePhyUshort(sc, 0x19, 0x0000);
9116         MP_WritePhyUshort(sc, 0x15, 0x0038);
9117         MP_WritePhyUshort(sc, 0x19, 0x0000);
9118         MP_WritePhyUshort(sc, 0x15, 0x0039);
9119         MP_WritePhyUshort(sc, 0x19, 0x0000);
9120         MP_WritePhyUshort(sc, 0x15, 0x003a);
9121         MP_WritePhyUshort(sc, 0x19, 0x0000);
9122         MP_WritePhyUshort(sc, 0x15, 0x003b);
9123         MP_WritePhyUshort(sc, 0x19, 0x63e8);
9124         MP_WritePhyUshort(sc, 0x15, 0x003c);
9125         MP_WritePhyUshort(sc, 0x19, 0x7d00);
9126         MP_WritePhyUshort(sc, 0x15, 0x003d);
9127         MP_WritePhyUshort(sc, 0x19, 0x59d4);
9128         MP_WritePhyUshort(sc, 0x15, 0x003e);
9129         MP_WritePhyUshort(sc, 0x19, 0x63f8);
9130         MP_WritePhyUshort(sc, 0x15, 0x0040);
9131         MP_WritePhyUshort(sc, 0x19, 0x64a1);
9132         MP_WritePhyUshort(sc, 0x15, 0x0041);
9133         MP_WritePhyUshort(sc, 0x19, 0x30de);
9134         MP_WritePhyUshort(sc, 0x15, 0x0044);
9135         MP_WritePhyUshort(sc, 0x19, 0x480f);
9136         MP_WritePhyUshort(sc, 0x15, 0x0045);
9137         MP_WritePhyUshort(sc, 0x19, 0x6800);
9138         MP_WritePhyUshort(sc, 0x15, 0x0046);
9139         MP_WritePhyUshort(sc, 0x19, 0x6680);
9140         MP_WritePhyUshort(sc, 0x15, 0x0047);
9141         MP_WritePhyUshort(sc, 0x19, 0x7c10);
9142         MP_WritePhyUshort(sc, 0x15, 0x0048);
9143         MP_WritePhyUshort(sc, 0x19, 0x63c8);
9144         MP_WritePhyUshort(sc, 0x15, 0x0049);
9145         MP_WritePhyUshort(sc, 0x19, 0x0000);
9146         MP_WritePhyUshort(sc, 0x15, 0x004a);
9147         MP_WritePhyUshort(sc, 0x19, 0x0000);
9148         MP_WritePhyUshort(sc, 0x15, 0x004b);
9149         MP_WritePhyUshort(sc, 0x19, 0x0000);
9150         MP_WritePhyUshort(sc, 0x15, 0x004c);
9151         MP_WritePhyUshort(sc, 0x19, 0x0000);
9152         MP_WritePhyUshort(sc, 0x15, 0x004d);
9153         MP_WritePhyUshort(sc, 0x19, 0x0000);
9154         MP_WritePhyUshort(sc, 0x15, 0x004e);
9155         MP_WritePhyUshort(sc, 0x19, 0x0000);
9156         MP_WritePhyUshort(sc, 0x15, 0x004f);
9157         MP_WritePhyUshort(sc, 0x19, 0x40ea);
9158         MP_WritePhyUshort(sc, 0x15, 0x0050);
9159         MP_WritePhyUshort(sc, 0x19, 0x4503);
9160         MP_WritePhyUshort(sc, 0x15, 0x0051);
9161         MP_WritePhyUshort(sc, 0x19, 0x58ca);
9162         MP_WritePhyUshort(sc, 0x15, 0x0052);
9163         MP_WritePhyUshort(sc, 0x19, 0x63c8);
9164         MP_WritePhyUshort(sc, 0x15, 0x0053);
9165         MP_WritePhyUshort(sc, 0x19, 0x63d8);
9166         MP_WritePhyUshort(sc, 0x15, 0x0054);
9167         MP_WritePhyUshort(sc, 0x19, 0x66a0);
9168         MP_WritePhyUshort(sc, 0x15, 0x0055);
9169         MP_WritePhyUshort(sc, 0x19, 0x9f00);
9170         MP_WritePhyUshort(sc, 0x15, 0x0056);
9171         MP_WritePhyUshort(sc, 0x19, 0x3000);
9172         MP_WritePhyUshort(sc, 0x15, 0x006E);
9173         MP_WritePhyUshort(sc, 0x19, 0x9afa);
9174         MP_WritePhyUshort(sc, 0x15, 0x00a1);
9175         MP_WritePhyUshort(sc, 0x19, 0x3044);
9176         MP_WritePhyUshort(sc, 0x15, 0x00ab);
9177         MP_WritePhyUshort(sc, 0x19, 0x5820);
9178         MP_WritePhyUshort(sc, 0x15, 0x00ac);
9179         MP_WritePhyUshort(sc, 0x19, 0x5e04);
9180         MP_WritePhyUshort(sc, 0x15, 0x00ad);
9181         MP_WritePhyUshort(sc, 0x19, 0xb60c);
9182         MP_WritePhyUshort(sc, 0x15, 0x00af);
9183         MP_WritePhyUshort(sc, 0x19, 0x000a);
9184         MP_WritePhyUshort(sc, 0x15, 0x00b2);
9185         MP_WritePhyUshort(sc, 0x19, 0x30b9);
9186         MP_WritePhyUshort(sc, 0x15, 0x00b9);
9187         MP_WritePhyUshort(sc, 0x19, 0x4408);
9188         MP_WritePhyUshort(sc, 0x15, 0x00ba);
9189         MP_WritePhyUshort(sc, 0x19, 0x480b);
9190         MP_WritePhyUshort(sc, 0x15, 0x00bb);
9191         MP_WritePhyUshort(sc, 0x19, 0x5e00);
9192         MP_WritePhyUshort(sc, 0x15, 0x00bc);
9193         MP_WritePhyUshort(sc, 0x19, 0x405f);
9194         MP_WritePhyUshort(sc, 0x15, 0x00bd);
9195         MP_WritePhyUshort(sc, 0x19, 0x4448);
9196         MP_WritePhyUshort(sc, 0x15, 0x00be);
9197         MP_WritePhyUshort(sc, 0x19, 0x4020);
9198         MP_WritePhyUshort(sc, 0x15, 0x00bf);
9199         MP_WritePhyUshort(sc, 0x19, 0x4468);
9200         MP_WritePhyUshort(sc, 0x15, 0x00c0);
9201         MP_WritePhyUshort(sc, 0x19, 0x9c02);
9202         MP_WritePhyUshort(sc, 0x15, 0x00c1);
9203         MP_WritePhyUshort(sc, 0x19, 0x58a0);
9204         MP_WritePhyUshort(sc, 0x15, 0x00c2);
9205         MP_WritePhyUshort(sc, 0x19, 0xb605);
9206         MP_WritePhyUshort(sc, 0x15, 0x00c3);
9207         MP_WritePhyUshort(sc, 0x19, 0xc0d3);
9208         MP_WritePhyUshort(sc, 0x15, 0x00c4);
9209         MP_WritePhyUshort(sc, 0x19, 0x00e6);
9210         MP_WritePhyUshort(sc, 0x15, 0x00c5);
9211         MP_WritePhyUshort(sc, 0x19, 0xdaec);
9212         MP_WritePhyUshort(sc, 0x15, 0x00c6);
9213         MP_WritePhyUshort(sc, 0x19, 0x00fa);
9214         MP_WritePhyUshort(sc, 0x15, 0x00c7);
9215         MP_WritePhyUshort(sc, 0x19, 0x9df9);
9216         MP_WritePhyUshort(sc, 0x15, 0x00c8);
9217         MP_WritePhyUshort(sc, 0x19, 0x307a);
9218         MP_WritePhyUshort(sc, 0x15, 0x0112);
9219         MP_WritePhyUshort(sc, 0x19, 0x6421);
9220         MP_WritePhyUshort(sc, 0x15, 0x0113);
9221         MP_WritePhyUshort(sc, 0x19, 0x7c08);
9222         MP_WritePhyUshort(sc, 0x15, 0x0114);
9223         MP_WritePhyUshort(sc, 0x19, 0x63f0);
9224         MP_WritePhyUshort(sc, 0x15, 0x0115);
9225         MP_WritePhyUshort(sc, 0x19, 0x4003);
9226         MP_WritePhyUshort(sc, 0x15, 0x0116);
9227         MP_WritePhyUshort(sc, 0x19, 0x4418);
9228         MP_WritePhyUshort(sc, 0x15, 0x0117);
9229         MP_WritePhyUshort(sc, 0x19, 0x9b00);
9230         MP_WritePhyUshort(sc, 0x15, 0x0118);
9231         MP_WritePhyUshort(sc, 0x19, 0x6461);
9232         MP_WritePhyUshort(sc, 0x15, 0x0119);
9233         MP_WritePhyUshort(sc, 0x19, 0x64e1);
9234         MP_WritePhyUshort(sc, 0x15, 0x011a);
9235         MP_WritePhyUshort(sc, 0x19, 0x0000);
9236         MP_WritePhyUshort(sc, 0x15, 0x0150);
9237         MP_WritePhyUshort(sc, 0x19, 0x7c80);
9238         MP_WritePhyUshort(sc, 0x15, 0x0151);
9239         MP_WritePhyUshort(sc, 0x19, 0x6461);
9240         MP_WritePhyUshort(sc, 0x15, 0x0152);
9241         MP_WritePhyUshort(sc, 0x19, 0x4003);
9242         MP_WritePhyUshort(sc, 0x15, 0x0153);
9243         MP_WritePhyUshort(sc, 0x19, 0x4540);
9244         MP_WritePhyUshort(sc, 0x15, 0x0154);
9245         MP_WritePhyUshort(sc, 0x19, 0x9f00);
9246         MP_WritePhyUshort(sc, 0x15, 0x0155);
9247         MP_WritePhyUshort(sc, 0x19, 0x9d00);
9248         MP_WritePhyUshort(sc, 0x15, 0x0156);
9249         MP_WritePhyUshort(sc, 0x19, 0x7c40);
9250         MP_WritePhyUshort(sc, 0x15, 0x0157);
9251         MP_WritePhyUshort(sc, 0x19, 0x6421);
9252         MP_WritePhyUshort(sc, 0x15, 0x0158);
9253         MP_WritePhyUshort(sc, 0x19, 0x7c80);
9254         MP_WritePhyUshort(sc, 0x15, 0x0159);
9255         MP_WritePhyUshort(sc, 0x19, 0x64a1);
9256         MP_WritePhyUshort(sc, 0x15, 0x015a);
9257         MP_WritePhyUshort(sc, 0x19, 0x30fe);
9258         MP_WritePhyUshort(sc, 0x15, 0x021e);
9259         MP_WritePhyUshort(sc, 0x19, 0x5410);
9260         MP_WritePhyUshort(sc, 0x15, 0x0225);
9261         MP_WritePhyUshort(sc, 0x19, 0x5400);
9262         MP_WritePhyUshort(sc, 0x15, 0x023D);
9263         MP_WritePhyUshort(sc, 0x19, 0x4050);
9264         MP_WritePhyUshort(sc, 0x15, 0x0295);
9265         MP_WritePhyUshort(sc, 0x19, 0x6c08);
9266         MP_WritePhyUshort(sc, 0x15, 0x02bd);
9267         MP_WritePhyUshort(sc, 0x19, 0xa523);
9268         MP_WritePhyUshort(sc, 0x15, 0x02be);
9269         MP_WritePhyUshort(sc, 0x19, 0x32ca);
9270         MP_WritePhyUshort(sc, 0x15, 0x02ca);
9271         MP_WritePhyUshort(sc, 0x19, 0x48b3);
9272         MP_WritePhyUshort(sc, 0x15, 0x02cb);
9273         MP_WritePhyUshort(sc, 0x19, 0x4020);
9274         MP_WritePhyUshort(sc, 0x15, 0x02cc);
9275         MP_WritePhyUshort(sc, 0x19, 0x4823);
9276         MP_WritePhyUshort(sc, 0x15, 0x02cd);
9277         MP_WritePhyUshort(sc, 0x19, 0x4510);
9278         MP_WritePhyUshort(sc, 0x15, 0x02ce);
9279         MP_WritePhyUshort(sc, 0x19, 0xb63a);
9280         MP_WritePhyUshort(sc, 0x15, 0x02cf);
9281         MP_WritePhyUshort(sc, 0x19, 0x7dc8);
9282         MP_WritePhyUshort(sc, 0x15, 0x02d6);
9283         MP_WritePhyUshort(sc, 0x19, 0x9bf8);
9284         MP_WritePhyUshort(sc, 0x15, 0x02d8);
9285         MP_WritePhyUshort(sc, 0x19, 0x85f6);
9286         MP_WritePhyUshort(sc, 0x15, 0x02d9);
9287         MP_WritePhyUshort(sc, 0x19, 0x32e0);
9288         MP_WritePhyUshort(sc, 0x15, 0x02e0);
9289         MP_WritePhyUshort(sc, 0x19, 0x4834);
9290         MP_WritePhyUshort(sc, 0x15, 0x02e1);
9291         MP_WritePhyUshort(sc, 0x19, 0x6c08);
9292         MP_WritePhyUshort(sc, 0x15, 0x02e2);
9293         MP_WritePhyUshort(sc, 0x19, 0x4020);
9294         MP_WritePhyUshort(sc, 0x15, 0x02e3);
9295         MP_WritePhyUshort(sc, 0x19, 0x4824);
9296         MP_WritePhyUshort(sc, 0x15, 0x02e4);
9297         MP_WritePhyUshort(sc, 0x19, 0x4520);
9298         MP_WritePhyUshort(sc, 0x15, 0x02e5);
9299         MP_WritePhyUshort(sc, 0x19, 0x4008);
9300         MP_WritePhyUshort(sc, 0x15, 0x02e6);
9301         MP_WritePhyUshort(sc, 0x19, 0x4560);
9302         MP_WritePhyUshort(sc, 0x15, 0x02e7);
9303         MP_WritePhyUshort(sc, 0x19, 0x9d04);
9304         MP_WritePhyUshort(sc, 0x15, 0x02e8);
9305         MP_WritePhyUshort(sc, 0x19, 0x48c4);
9306         MP_WritePhyUshort(sc, 0x15, 0x02e9);
9307         MP_WritePhyUshort(sc, 0x19, 0x0000);
9308         MP_WritePhyUshort(sc, 0x15, 0x02ea);
9309         MP_WritePhyUshort(sc, 0x19, 0x4844);
9310         MP_WritePhyUshort(sc, 0x15, 0x02eb);
9311         MP_WritePhyUshort(sc, 0x19, 0x7dc8);
9312         MP_WritePhyUshort(sc, 0x15, 0x02f0);
9313         MP_WritePhyUshort(sc, 0x19, 0x9cf7);
9314         MP_WritePhyUshort(sc, 0x15, 0x02f1);
9315         MP_WritePhyUshort(sc, 0x19, 0xdf94);
9316         MP_WritePhyUshort(sc, 0x15, 0x02f2);
9317         MP_WritePhyUshort(sc, 0x19, 0x0002);
9318         MP_WritePhyUshort(sc, 0x15, 0x02f3);
9319         MP_WritePhyUshort(sc, 0x19, 0x6810);
9320         MP_WritePhyUshort(sc, 0x15, 0x02f4);
9321         MP_WritePhyUshort(sc, 0x19, 0xb614);
9322         MP_WritePhyUshort(sc, 0x15, 0x02f5);
9323         MP_WritePhyUshort(sc, 0x19, 0xc42b);
9324         MP_WritePhyUshort(sc, 0x15, 0x02f6);
9325         MP_WritePhyUshort(sc, 0x19, 0x00d4);
9326         MP_WritePhyUshort(sc, 0x15, 0x02f7);
9327         MP_WritePhyUshort(sc, 0x19, 0xc455);
9328         MP_WritePhyUshort(sc, 0x15, 0x02f8);
9329         MP_WritePhyUshort(sc, 0x19, 0x0093);
9330         MP_WritePhyUshort(sc, 0x15, 0x02f9);
9331         MP_WritePhyUshort(sc, 0x19, 0x92ee);
9332         MP_WritePhyUshort(sc, 0x15, 0x02fa);
9333         MP_WritePhyUshort(sc, 0x19, 0xefed);
9334         MP_WritePhyUshort(sc, 0x15, 0x02fb);
9335         MP_WritePhyUshort(sc, 0x19, 0x3312);
9336         MP_WritePhyUshort(sc, 0x15, 0x0312);
9337         MP_WritePhyUshort(sc, 0x19, 0x49b5);
9338         MP_WritePhyUshort(sc, 0x15, 0x0313);
9339         MP_WritePhyUshort(sc, 0x19, 0x7d00);
9340         MP_WritePhyUshort(sc, 0x15, 0x0314);
9341         MP_WritePhyUshort(sc, 0x19, 0x4d00);
9342         MP_WritePhyUshort(sc, 0x15, 0x0315);
9343         MP_WritePhyUshort(sc, 0x19, 0x6810);
9344         MP_WritePhyUshort(sc, 0x15, 0x031e);
9345         MP_WritePhyUshort(sc, 0x19, 0x404f);
9346         MP_WritePhyUshort(sc, 0x15, 0x031f);
9347         MP_WritePhyUshort(sc, 0x19, 0x44c8);
9348         MP_WritePhyUshort(sc, 0x15, 0x0320);
9349         MP_WritePhyUshort(sc, 0x19, 0xd64f);
9350         MP_WritePhyUshort(sc, 0x15, 0x0321);
9351         MP_WritePhyUshort(sc, 0x19, 0x00e7);
9352         MP_WritePhyUshort(sc, 0x15, 0x0322);
9353         MP_WritePhyUshort(sc, 0x19, 0x7c08);
9354         MP_WritePhyUshort(sc, 0x15, 0x0323);
9355         MP_WritePhyUshort(sc, 0x19, 0x8203);
9356         MP_WritePhyUshort(sc, 0x15, 0x0324);
9357         MP_WritePhyUshort(sc, 0x19, 0x4d48);
9358         MP_WritePhyUshort(sc, 0x15, 0x0325);
9359         MP_WritePhyUshort(sc, 0x19, 0x3327);
9360         MP_WritePhyUshort(sc, 0x15, 0x0326);
9361         MP_WritePhyUshort(sc, 0x19, 0x4d40);
9362         MP_WritePhyUshort(sc, 0x15, 0x0327);
9363         MP_WritePhyUshort(sc, 0x19, 0xc8d7);
9364         MP_WritePhyUshort(sc, 0x15, 0x0328);
9365         MP_WritePhyUshort(sc, 0x19, 0x0003);
9366         MP_WritePhyUshort(sc, 0x15, 0x0329);
9367         MP_WritePhyUshort(sc, 0x19, 0x7c20);
9368         MP_WritePhyUshort(sc, 0x15, 0x032a);
9369         MP_WritePhyUshort(sc, 0x19, 0x4c20);
9370         MP_WritePhyUshort(sc, 0x15, 0x032b);
9371         MP_WritePhyUshort(sc, 0x19, 0xc8ed);
9372         MP_WritePhyUshort(sc, 0x15, 0x032c);
9373         MP_WritePhyUshort(sc, 0x19, 0x00f4);
9374         MP_WritePhyUshort(sc, 0x15, 0x032d);
9375         MP_WritePhyUshort(sc, 0x19, 0x82b3);
9376         MP_WritePhyUshort(sc, 0x15, 0x032e);
9377         MP_WritePhyUshort(sc, 0x19, 0xd11d);
9378         MP_WritePhyUshort(sc, 0x15, 0x032f);
9379         MP_WritePhyUshort(sc, 0x19, 0x00b1);
9380         MP_WritePhyUshort(sc, 0x15, 0x0330);
9381         MP_WritePhyUshort(sc, 0x19, 0xde18);
9382         MP_WritePhyUshort(sc, 0x15, 0x0331);
9383         MP_WritePhyUshort(sc, 0x19, 0x0008);
9384         MP_WritePhyUshort(sc, 0x15, 0x0332);
9385         MP_WritePhyUshort(sc, 0x19, 0x91ee);
9386         MP_WritePhyUshort(sc, 0x15, 0x0333);
9387         MP_WritePhyUshort(sc, 0x19, 0x3339);
9388         MP_WritePhyUshort(sc, 0x15, 0x033a);
9389         MP_WritePhyUshort(sc, 0x19, 0x4064);
9390         MP_WritePhyUshort(sc, 0x15, 0x0340);
9391         MP_WritePhyUshort(sc, 0x19, 0x9e06);
9392         MP_WritePhyUshort(sc, 0x15, 0x0341);
9393         MP_WritePhyUshort(sc, 0x19, 0x7c08);
9394         MP_WritePhyUshort(sc, 0x15, 0x0342);
9395         MP_WritePhyUshort(sc, 0x19, 0x8203);
9396         MP_WritePhyUshort(sc, 0x15, 0x0343);
9397         MP_WritePhyUshort(sc, 0x19, 0x4d48);
9398         MP_WritePhyUshort(sc, 0x15, 0x0344);
9399         MP_WritePhyUshort(sc, 0x19, 0x3346);
9400         MP_WritePhyUshort(sc, 0x15, 0x0345);
9401         MP_WritePhyUshort(sc, 0x19, 0x4d40);
9402         MP_WritePhyUshort(sc, 0x15, 0x0346);
9403         MP_WritePhyUshort(sc, 0x19, 0xd11d);
9404         MP_WritePhyUshort(sc, 0x15, 0x0347);
9405         MP_WritePhyUshort(sc, 0x19, 0x0099);
9406         MP_WritePhyUshort(sc, 0x15, 0x0348);
9407         MP_WritePhyUshort(sc, 0x19, 0xbb17);
9408         MP_WritePhyUshort(sc, 0x15, 0x0349);
9409         MP_WritePhyUshort(sc, 0x19, 0x8102);
9410         MP_WritePhyUshort(sc, 0x15, 0x034a);
9411         MP_WritePhyUshort(sc, 0x19, 0x334d);
9412         MP_WritePhyUshort(sc, 0x15, 0x034b);
9413         MP_WritePhyUshort(sc, 0x19, 0xa22c);
9414         MP_WritePhyUshort(sc, 0x15, 0x034c);
9415         MP_WritePhyUshort(sc, 0x19, 0x3397);
9416         MP_WritePhyUshort(sc, 0x15, 0x034d);
9417         MP_WritePhyUshort(sc, 0x19, 0x91f2);
9418         MP_WritePhyUshort(sc, 0x15, 0x034e);
9419         MP_WritePhyUshort(sc, 0x19, 0xc218);
9420         MP_WritePhyUshort(sc, 0x15, 0x034f);
9421         MP_WritePhyUshort(sc, 0x19, 0x00f0);
9422         MP_WritePhyUshort(sc, 0x15, 0x0350);
9423         MP_WritePhyUshort(sc, 0x19, 0x3397);
9424         MP_WritePhyUshort(sc, 0x15, 0x0351);
9425         MP_WritePhyUshort(sc, 0x19, 0x0000);
9426         MP_WritePhyUshort(sc, 0x15, 0x0364);
9427         MP_WritePhyUshort(sc, 0x19, 0xbc05);
9428         MP_WritePhyUshort(sc, 0x15, 0x0367);
9429         MP_WritePhyUshort(sc, 0x19, 0xa1fc);
9430         MP_WritePhyUshort(sc, 0x15, 0x0368);
9431         MP_WritePhyUshort(sc, 0x19, 0x3377);
9432         MP_WritePhyUshort(sc, 0x15, 0x0369);
9433         MP_WritePhyUshort(sc, 0x19, 0x328b);
9434         MP_WritePhyUshort(sc, 0x15, 0x036a);
9435         MP_WritePhyUshort(sc, 0x19, 0x0000);
9436         MP_WritePhyUshort(sc, 0x15, 0x0377);
9437         MP_WritePhyUshort(sc, 0x19, 0x4b97);
9438         MP_WritePhyUshort(sc, 0x15, 0x0378);
9439         MP_WritePhyUshort(sc, 0x19, 0x6818);
9440         MP_WritePhyUshort(sc, 0x15, 0x0379);
9441         MP_WritePhyUshort(sc, 0x19, 0x4b07);
9442         MP_WritePhyUshort(sc, 0x15, 0x037a);
9443         MP_WritePhyUshort(sc, 0x19, 0x40ac);
9444         MP_WritePhyUshort(sc, 0x15, 0x037b);
9445         MP_WritePhyUshort(sc, 0x19, 0x4445);
9446         MP_WritePhyUshort(sc, 0x15, 0x037c);
9447         MP_WritePhyUshort(sc, 0x19, 0x404e);
9448         MP_WritePhyUshort(sc, 0x15, 0x037d);
9449         MP_WritePhyUshort(sc, 0x19, 0x4461);
9450         MP_WritePhyUshort(sc, 0x15, 0x037e);
9451         MP_WritePhyUshort(sc, 0x19, 0x9c09);
9452         MP_WritePhyUshort(sc, 0x15, 0x037f);
9453         MP_WritePhyUshort(sc, 0x19, 0x63da);
9454         MP_WritePhyUshort(sc, 0x15, 0x0380);
9455         MP_WritePhyUshort(sc, 0x19, 0x5440);
9456         MP_WritePhyUshort(sc, 0x15, 0x0381);
9457         MP_WritePhyUshort(sc, 0x19, 0x4b98);
9458         MP_WritePhyUshort(sc, 0x15, 0x0382);
9459         MP_WritePhyUshort(sc, 0x19, 0x7c60);
9460         MP_WritePhyUshort(sc, 0x15, 0x0383);
9461         MP_WritePhyUshort(sc, 0x19, 0x4c00);
9462         MP_WritePhyUshort(sc, 0x15, 0x0384);
9463         MP_WritePhyUshort(sc, 0x19, 0x4b08);
9464         MP_WritePhyUshort(sc, 0x15, 0x0385);
9465         MP_WritePhyUshort(sc, 0x19, 0x63d8);
9466         MP_WritePhyUshort(sc, 0x15, 0x0386);
9467         MP_WritePhyUshort(sc, 0x19, 0x338d);
9468         MP_WritePhyUshort(sc, 0x15, 0x0387);
9469         MP_WritePhyUshort(sc, 0x19, 0xd64f);
9470         MP_WritePhyUshort(sc, 0x15, 0x0388);
9471         MP_WritePhyUshort(sc, 0x19, 0x0080);
9472         MP_WritePhyUshort(sc, 0x15, 0x0389);
9473         MP_WritePhyUshort(sc, 0x19, 0x820c);
9474         MP_WritePhyUshort(sc, 0x15, 0x038a);
9475         MP_WritePhyUshort(sc, 0x19, 0xa10b);
9476         MP_WritePhyUshort(sc, 0x15, 0x038b);
9477         MP_WritePhyUshort(sc, 0x19, 0x9df3);
9478         MP_WritePhyUshort(sc, 0x15, 0x038c);
9479         MP_WritePhyUshort(sc, 0x19, 0x3395);
9480         MP_WritePhyUshort(sc, 0x15, 0x038d);
9481         MP_WritePhyUshort(sc, 0x19, 0xd64f);
9482         MP_WritePhyUshort(sc, 0x15, 0x038e);
9483         MP_WritePhyUshort(sc, 0x19, 0x00f9);
9484         MP_WritePhyUshort(sc, 0x15, 0x038f);
9485         MP_WritePhyUshort(sc, 0x19, 0xc017);
9486         MP_WritePhyUshort(sc, 0x15, 0x0390);
9487         MP_WritePhyUshort(sc, 0x19, 0x0005);
9488         MP_WritePhyUshort(sc, 0x15, 0x0391);
9489         MP_WritePhyUshort(sc, 0x19, 0x6c0b);
9490         MP_WritePhyUshort(sc, 0x15, 0x0392);
9491         MP_WritePhyUshort(sc, 0x19, 0xa103);
9492         MP_WritePhyUshort(sc, 0x15, 0x0393);
9493         MP_WritePhyUshort(sc, 0x19, 0x6c08);
9494         MP_WritePhyUshort(sc, 0x15, 0x0394);
9495         MP_WritePhyUshort(sc, 0x19, 0x9df9);
9496         MP_WritePhyUshort(sc, 0x15, 0x0395);
9497         MP_WritePhyUshort(sc, 0x19, 0x6c08);
9498         MP_WritePhyUshort(sc, 0x15, 0x0396);
9499         MP_WritePhyUshort(sc, 0x19, 0x3397);
9500         MP_WritePhyUshort(sc, 0x15, 0x0399);
9501         MP_WritePhyUshort(sc, 0x19, 0x6810);
9502         MP_WritePhyUshort(sc, 0x15, 0x03a4);
9503         MP_WritePhyUshort(sc, 0x19, 0x7c08);
9504         MP_WritePhyUshort(sc, 0x15, 0x03a5);
9505         MP_WritePhyUshort(sc, 0x19, 0x8203);
9506         MP_WritePhyUshort(sc, 0x15, 0x03a6);
9507         MP_WritePhyUshort(sc, 0x19, 0x4d08);
9508         MP_WritePhyUshort(sc, 0x15, 0x03a7);
9509         MP_WritePhyUshort(sc, 0x19, 0x33a9);
9510         MP_WritePhyUshort(sc, 0x15, 0x03a8);
9511         MP_WritePhyUshort(sc, 0x19, 0x4d00);
9512         MP_WritePhyUshort(sc, 0x15, 0x03a9);
9513         MP_WritePhyUshort(sc, 0x19, 0x9bfa);
9514         MP_WritePhyUshort(sc, 0x15, 0x03aa);
9515         MP_WritePhyUshort(sc, 0x19, 0x33b6);
9516         MP_WritePhyUshort(sc, 0x15, 0x03bb);
9517         MP_WritePhyUshort(sc, 0x19, 0x4056);
9518         MP_WritePhyUshort(sc, 0x15, 0x03bc);
9519         MP_WritePhyUshort(sc, 0x19, 0x44e9);
9520         MP_WritePhyUshort(sc, 0x15, 0x03bd);
9521         MP_WritePhyUshort(sc, 0x19, 0x405e);
9522         MP_WritePhyUshort(sc, 0x15, 0x03be);
9523         MP_WritePhyUshort(sc, 0x19, 0x44f8);
9524         MP_WritePhyUshort(sc, 0x15, 0x03bf);
9525         MP_WritePhyUshort(sc, 0x19, 0xd64f);
9526         MP_WritePhyUshort(sc, 0x15, 0x03c0);
9527         MP_WritePhyUshort(sc, 0x19, 0x0037);
9528         MP_WritePhyUshort(sc, 0x15, 0x03c1);
9529         MP_WritePhyUshort(sc, 0x19, 0xbd37);
9530         MP_WritePhyUshort(sc, 0x15, 0x03c2);
9531         MP_WritePhyUshort(sc, 0x19, 0x9cfd);
9532         MP_WritePhyUshort(sc, 0x15, 0x03c3);
9533         MP_WritePhyUshort(sc, 0x19, 0xc639);
9534         MP_WritePhyUshort(sc, 0x15, 0x03c4);
9535         MP_WritePhyUshort(sc, 0x19, 0x0011);
9536         MP_WritePhyUshort(sc, 0x15, 0x03c5);
9537         MP_WritePhyUshort(sc, 0x19, 0x9b03);
9538         MP_WritePhyUshort(sc, 0x15, 0x03c6);
9539         MP_WritePhyUshort(sc, 0x19, 0x7c01);
9540         MP_WritePhyUshort(sc, 0x15, 0x03c7);
9541         MP_WritePhyUshort(sc, 0x19, 0x4c01);
9542         MP_WritePhyUshort(sc, 0x15, 0x03c8);
9543         MP_WritePhyUshort(sc, 0x19, 0x9e03);
9544         MP_WritePhyUshort(sc, 0x15, 0x03c9);
9545         MP_WritePhyUshort(sc, 0x19, 0x7c20);
9546         MP_WritePhyUshort(sc, 0x15, 0x03ca);
9547         MP_WritePhyUshort(sc, 0x19, 0x4c20);
9548         MP_WritePhyUshort(sc, 0x15, 0x03cb);
9549         MP_WritePhyUshort(sc, 0x19, 0x9af4);
9550         MP_WritePhyUshort(sc, 0x15, 0x03cc);
9551         MP_WritePhyUshort(sc, 0x19, 0x7c12);
9552         MP_WritePhyUshort(sc, 0x15, 0x03cd);
9553         MP_WritePhyUshort(sc, 0x19, 0x4c52);
9554         MP_WritePhyUshort(sc, 0x15, 0x03ce);
9555         MP_WritePhyUshort(sc, 0x19, 0x4470);
9556         MP_WritePhyUshort(sc, 0x15, 0x03cf);
9557         MP_WritePhyUshort(sc, 0x19, 0x7c12);
9558         MP_WritePhyUshort(sc, 0x15, 0x03d0);
9559         MP_WritePhyUshort(sc, 0x19, 0x4c40);
9560         MP_WritePhyUshort(sc, 0x15, 0x03d1);
9561         MP_WritePhyUshort(sc, 0x19, 0x33bf);
9562         MP_WritePhyUshort(sc, 0x15, 0x03d6);
9563         MP_WritePhyUshort(sc, 0x19, 0x4047);
9564         MP_WritePhyUshort(sc, 0x15, 0x03d7);
9565         MP_WritePhyUshort(sc, 0x19, 0x4469);
9566         MP_WritePhyUshort(sc, 0x15, 0x03d8);
9567         MP_WritePhyUshort(sc, 0x19, 0x492b);
9568         MP_WritePhyUshort(sc, 0x15, 0x03d9);
9569         MP_WritePhyUshort(sc, 0x19, 0x4479);
9570         MP_WritePhyUshort(sc, 0x15, 0x03da);
9571         MP_WritePhyUshort(sc, 0x19, 0x7c09);
9572         MP_WritePhyUshort(sc, 0x15, 0x03db);
9573         MP_WritePhyUshort(sc, 0x19, 0x8203);
9574         MP_WritePhyUshort(sc, 0x15, 0x03dc);
9575         MP_WritePhyUshort(sc, 0x19, 0x4d48);
9576         MP_WritePhyUshort(sc, 0x15, 0x03dd);
9577         MP_WritePhyUshort(sc, 0x19, 0x33df);
9578         MP_WritePhyUshort(sc, 0x15, 0x03de);
9579         MP_WritePhyUshort(sc, 0x19, 0x4d40);
9580         MP_WritePhyUshort(sc, 0x15, 0x03df);
9581         MP_WritePhyUshort(sc, 0x19, 0xd64f);
9582         MP_WritePhyUshort(sc, 0x15, 0x03e0);
9583         MP_WritePhyUshort(sc, 0x19, 0x0017);
9584         MP_WritePhyUshort(sc, 0x15, 0x03e1);
9585         MP_WritePhyUshort(sc, 0x19, 0xbd17);
9586         MP_WritePhyUshort(sc, 0x15, 0x03e2);
9587         MP_WritePhyUshort(sc, 0x19, 0x9b03);
9588         MP_WritePhyUshort(sc, 0x15, 0x03e3);
9589         MP_WritePhyUshort(sc, 0x19, 0x7c20);
9590         MP_WritePhyUshort(sc, 0x15, 0x03e4);
9591         MP_WritePhyUshort(sc, 0x19, 0x4c20);
9592         MP_WritePhyUshort(sc, 0x15, 0x03e5);
9593         MP_WritePhyUshort(sc, 0x19, 0x88f5);
9594         MP_WritePhyUshort(sc, 0x15, 0x03e6);
9595         MP_WritePhyUshort(sc, 0x19, 0xc428);
9596         MP_WritePhyUshort(sc, 0x15, 0x03e7);
9597         MP_WritePhyUshort(sc, 0x19, 0x0008);
9598         MP_WritePhyUshort(sc, 0x15, 0x03e8);
9599         MP_WritePhyUshort(sc, 0x19, 0x9af2);
9600         MP_WritePhyUshort(sc, 0x15, 0x03e9);
9601         MP_WritePhyUshort(sc, 0x19, 0x7c12);
9602         MP_WritePhyUshort(sc, 0x15, 0x03ea);
9603         MP_WritePhyUshort(sc, 0x19, 0x4c52);
9604         MP_WritePhyUshort(sc, 0x15, 0x03eb);
9605         MP_WritePhyUshort(sc, 0x19, 0x4470);
9606         MP_WritePhyUshort(sc, 0x15, 0x03ec);
9607         MP_WritePhyUshort(sc, 0x19, 0x7c12);
9608         MP_WritePhyUshort(sc, 0x15, 0x03ed);
9609         MP_WritePhyUshort(sc, 0x19, 0x4c40);
9610         MP_WritePhyUshort(sc, 0x15, 0x03ee);
9611         MP_WritePhyUshort(sc, 0x19, 0x33da);
9612         MP_WritePhyUshort(sc, 0x15, 0x03ef);
9613         MP_WritePhyUshort(sc, 0x19, 0x3312);
9614         MP_WritePhyUshort(sc, 0x16, 0x0306);
9615         MP_WritePhyUshort(sc, 0x16, 0x0300);
9616         MP_WritePhyUshort(sc, 0x1f, 0x0000);
9617         MP_WritePhyUshort(sc, 0x17, 0x2179);
9618         MP_WritePhyUshort(sc, 0x1f, 0x0007);
9619         MP_WritePhyUshort(sc, 0x1e, 0x0040);
9620         MP_WritePhyUshort(sc, 0x18, 0x0645);
9621         MP_WritePhyUshort(sc, 0x19, 0xe200);
9622         MP_WritePhyUshort(sc, 0x18, 0x0655);
9623         MP_WritePhyUshort(sc, 0x19, 0x9000);
9624         MP_WritePhyUshort(sc, 0x18, 0x0d05);
9625         MP_WritePhyUshort(sc, 0x19, 0xbe00);
9626         MP_WritePhyUshort(sc, 0x18, 0x0d15);
9627         MP_WritePhyUshort(sc, 0x19, 0xd300);
9628         MP_WritePhyUshort(sc, 0x18, 0x0d25);
9629         MP_WritePhyUshort(sc, 0x19, 0xfe00);
9630         MP_WritePhyUshort(sc, 0x18, 0x0d35);
9631         MP_WritePhyUshort(sc, 0x19, 0x4000);
9632         MP_WritePhyUshort(sc, 0x18, 0x0d45);
9633         MP_WritePhyUshort(sc, 0x19, 0x7f00);
9634         MP_WritePhyUshort(sc, 0x18, 0x0d55);
9635         MP_WritePhyUshort(sc, 0x19, 0x1000);
9636         MP_WritePhyUshort(sc, 0x18, 0x0d65);
9637         MP_WritePhyUshort(sc, 0x19, 0x0000);
9638         MP_WritePhyUshort(sc, 0x18, 0x0d75);
9639         MP_WritePhyUshort(sc, 0x19, 0x8200);
9640         MP_WritePhyUshort(sc, 0x18, 0x0d85);
9641         MP_WritePhyUshort(sc, 0x19, 0x0000);
9642         MP_WritePhyUshort(sc, 0x18, 0x0d95);
9643         MP_WritePhyUshort(sc, 0x19, 0x7000);
9644         MP_WritePhyUshort(sc, 0x18, 0x0da5);
9645         MP_WritePhyUshort(sc, 0x19, 0x0f00);
9646         MP_WritePhyUshort(sc, 0x18, 0x0db5);
9647         MP_WritePhyUshort(sc, 0x19, 0x0100);
9648         MP_WritePhyUshort(sc, 0x18, 0x0dc5);
9649         MP_WritePhyUshort(sc, 0x19, 0x9b00);
9650         MP_WritePhyUshort(sc, 0x18, 0x0dd5);
9651         MP_WritePhyUshort(sc, 0x19, 0x7f00);
9652         MP_WritePhyUshort(sc, 0x18, 0x0de5);
9653         MP_WritePhyUshort(sc, 0x19, 0xe000);
9654         MP_WritePhyUshort(sc, 0x18, 0x0df5);
9655         MP_WritePhyUshort(sc, 0x19, 0xef00);
9656         MP_WritePhyUshort(sc, 0x18, 0x16d5);
9657         MP_WritePhyUshort(sc, 0x19, 0xe200);
9658         MP_WritePhyUshort(sc, 0x18, 0x16e5);
9659         MP_WritePhyUshort(sc, 0x19, 0xab00);
9660         MP_WritePhyUshort(sc, 0x18, 0x2904);
9661         MP_WritePhyUshort(sc, 0x19, 0x4000);
9662         MP_WritePhyUshort(sc, 0x18, 0x2914);
9663         MP_WritePhyUshort(sc, 0x19, 0x7f00);
9664         MP_WritePhyUshort(sc, 0x18, 0x2924);
9665         MP_WritePhyUshort(sc, 0x19, 0x0100);
9666         MP_WritePhyUshort(sc, 0x18, 0x2934);
9667         MP_WritePhyUshort(sc, 0x19, 0x2000);
9668         MP_WritePhyUshort(sc, 0x18, 0x2944);
9669         MP_WritePhyUshort(sc, 0x19, 0x0000);
9670         MP_WritePhyUshort(sc, 0x18, 0x2954);
9671         MP_WritePhyUshort(sc, 0x19, 0x4600);
9672         MP_WritePhyUshort(sc, 0x18, 0x2964);
9673         MP_WritePhyUshort(sc, 0x19, 0xfc00);
9674         MP_WritePhyUshort(sc, 0x18, 0x2974);
9675         MP_WritePhyUshort(sc, 0x19, 0x0000);
9676         MP_WritePhyUshort(sc, 0x18, 0x2984);
9677         MP_WritePhyUshort(sc, 0x19, 0x5000);
9678         MP_WritePhyUshort(sc, 0x18, 0x2994);
9679         MP_WritePhyUshort(sc, 0x19, 0x9d00);
9680         MP_WritePhyUshort(sc, 0x18, 0x29a4);
9681         MP_WritePhyUshort(sc, 0x19, 0xff00);
9682         MP_WritePhyUshort(sc, 0x18, 0x29b4);
9683         MP_WritePhyUshort(sc, 0x19, 0x4000);
9684         MP_WritePhyUshort(sc, 0x18, 0x29c4);
9685         MP_WritePhyUshort(sc, 0x19, 0x7f00);
9686         MP_WritePhyUshort(sc, 0x18, 0x29d4);
9687         MP_WritePhyUshort(sc, 0x19, 0x0000);
9688         MP_WritePhyUshort(sc, 0x18, 0x29e4);
9689         MP_WritePhyUshort(sc, 0x19, 0x2000);
9690         MP_WritePhyUshort(sc, 0x18, 0x29f4);
9691         MP_WritePhyUshort(sc, 0x19, 0x0000);
9692         MP_WritePhyUshort(sc, 0x18, 0x2a04);
9693         MP_WritePhyUshort(sc, 0x19, 0xe600);
9694         MP_WritePhyUshort(sc, 0x18, 0x2a14);
9695         MP_WritePhyUshort(sc, 0x19, 0xff00);
9696         MP_WritePhyUshort(sc, 0x18, 0x2a24);
9697         MP_WritePhyUshort(sc, 0x19, 0x0000);
9698         MP_WritePhyUshort(sc, 0x18, 0x2a34);
9699         MP_WritePhyUshort(sc, 0x19, 0x5000);
9700         MP_WritePhyUshort(sc, 0x18, 0x2a44);
9701         MP_WritePhyUshort(sc, 0x19, 0x8500);
9702         MP_WritePhyUshort(sc, 0x18, 0x2a54);
9703         MP_WritePhyUshort(sc, 0x19, 0x7f00);
9704         MP_WritePhyUshort(sc, 0x18, 0x2a64);
9705         MP_WritePhyUshort(sc, 0x19, 0xac00);
9706         MP_WritePhyUshort(sc, 0x18, 0x2a74);
9707         MP_WritePhyUshort(sc, 0x19, 0x0800);
9708         MP_WritePhyUshort(sc, 0x18, 0x2a84);
9709         MP_WritePhyUshort(sc, 0x19, 0xfc00);
9710         MP_WritePhyUshort(sc, 0x18, 0x2a94);
9711         MP_WritePhyUshort(sc, 0x19, 0xe000);
9712         MP_WritePhyUshort(sc, 0x18, 0x2aa4);
9713         MP_WritePhyUshort(sc, 0x19, 0x7400);
9714         MP_WritePhyUshort(sc, 0x18, 0x2ab4);
9715         MP_WritePhyUshort(sc, 0x19, 0x4000);
9716         MP_WritePhyUshort(sc, 0x18, 0x2ac4);
9717         MP_WritePhyUshort(sc, 0x19, 0x7f00);
9718         MP_WritePhyUshort(sc, 0x18, 0x2ad4);
9719         MP_WritePhyUshort(sc, 0x19, 0x0100);
9720         MP_WritePhyUshort(sc, 0x18, 0x2ae4);
9721         MP_WritePhyUshort(sc, 0x19, 0xff00);
9722         MP_WritePhyUshort(sc, 0x18, 0x2af4);
9723         MP_WritePhyUshort(sc, 0x19, 0x0000);
9724         MP_WritePhyUshort(sc, 0x18, 0x2b04);
9725         MP_WritePhyUshort(sc, 0x19, 0x4400);
9726         MP_WritePhyUshort(sc, 0x18, 0x2b14);
9727         MP_WritePhyUshort(sc, 0x19, 0xfc00);
9728         MP_WritePhyUshort(sc, 0x18, 0x2b24);
9729         MP_WritePhyUshort(sc, 0x19, 0x0000);
9730         MP_WritePhyUshort(sc, 0x18, 0x2b34);
9731         MP_WritePhyUshort(sc, 0x19, 0x4000);
9732         MP_WritePhyUshort(sc, 0x18, 0x2b44);
9733         MP_WritePhyUshort(sc, 0x19, 0x9d00);
9734         MP_WritePhyUshort(sc, 0x18, 0x2b54);
9735         MP_WritePhyUshort(sc, 0x19, 0xff00);
9736         MP_WritePhyUshort(sc, 0x18, 0x2b64);
9737         MP_WritePhyUshort(sc, 0x19, 0x4000);
9738         MP_WritePhyUshort(sc, 0x18, 0x2b74);
9739         MP_WritePhyUshort(sc, 0x19, 0x7f00);
9740         MP_WritePhyUshort(sc, 0x18, 0x2b84);
9741         MP_WritePhyUshort(sc, 0x19, 0x0000);
9742         MP_WritePhyUshort(sc, 0x18, 0x2b94);
9743         MP_WritePhyUshort(sc, 0x19, 0xff00);
9744         MP_WritePhyUshort(sc, 0x18, 0x2ba4);
9745         MP_WritePhyUshort(sc, 0x19, 0x0000);
9746         MP_WritePhyUshort(sc, 0x18, 0x2bb4);
9747         MP_WritePhyUshort(sc, 0x19, 0xfc00);
9748         MP_WritePhyUshort(sc, 0x18, 0x2bc4);
9749         MP_WritePhyUshort(sc, 0x19, 0xff00);
9750         MP_WritePhyUshort(sc, 0x18, 0x2bd4);
9751         MP_WritePhyUshort(sc, 0x19, 0x0000);
9752         MP_WritePhyUshort(sc, 0x18, 0x2be4);
9753         MP_WritePhyUshort(sc, 0x19, 0x4000);
9754         MP_WritePhyUshort(sc, 0x18, 0x2bf4);
9755         MP_WritePhyUshort(sc, 0x19, 0x8900);
9756         MP_WritePhyUshort(sc, 0x18, 0x2c04);
9757         MP_WritePhyUshort(sc, 0x19, 0x8300);
9758         MP_WritePhyUshort(sc, 0x18, 0x2c14);
9759         MP_WritePhyUshort(sc, 0x19, 0xe000);
9760         MP_WritePhyUshort(sc, 0x18, 0x2c24);
9761         MP_WritePhyUshort(sc, 0x19, 0x0000);
9762         MP_WritePhyUshort(sc, 0x18, 0x2c34);
9763         MP_WritePhyUshort(sc, 0x19, 0xac00);
9764         MP_WritePhyUshort(sc, 0x18, 0x2c44);
9765         MP_WritePhyUshort(sc, 0x19, 0x0800);
9766         MP_WritePhyUshort(sc, 0x18, 0x2c54);
9767         MP_WritePhyUshort(sc, 0x19, 0xfa00);
9768         MP_WritePhyUshort(sc, 0x18, 0x2c64);
9769         MP_WritePhyUshort(sc, 0x19, 0xe100);
9770         MP_WritePhyUshort(sc, 0x18, 0x2c74);
9771         MP_WritePhyUshort(sc, 0x19, 0x7f00);
9772         MP_WritePhyUshort(sc, 0x18, 0x0001);
9773         MP_WritePhyUshort(sc, 0x1f, 0x0000);
9774         MP_WritePhyUshort(sc, 0x17, 0x2100);
9775         MP_WritePhyUshort(sc, 0x1f, 0x0005);
9776         MP_WritePhyUshort(sc, 0x05, 0xfff6);
9777         MP_WritePhyUshort(sc, 0x06, 0x0080);
9778         MP_WritePhyUshort(sc, 0x05, 0x8b88);
9779         MP_WritePhyUshort(sc, 0x06, 0x0000);
9780         MP_WritePhyUshort(sc, 0x06, 0x0000);
9781         MP_WritePhyUshort(sc, 0x06, 0x0000);
9782         MP_WritePhyUshort(sc, 0x06, 0x0000);
9783         MP_WritePhyUshort(sc, 0x05, 0x8000);
9784         MP_WritePhyUshort(sc, 0x06, 0xd480);
9785         MP_WritePhyUshort(sc, 0x06, 0xc1e4);
9786         MP_WritePhyUshort(sc, 0x06, 0x8b9a);
9787         MP_WritePhyUshort(sc, 0x06, 0xe58b);
9788         MP_WritePhyUshort(sc, 0x06, 0x9bee);
9789         MP_WritePhyUshort(sc, 0x06, 0x8b83);
9790         MP_WritePhyUshort(sc, 0x06, 0x41bf);
9791         MP_WritePhyUshort(sc, 0x06, 0x8b88);
9792         MP_WritePhyUshort(sc, 0x06, 0xec00);
9793         MP_WritePhyUshort(sc, 0x06, 0x19a9);
9794         MP_WritePhyUshort(sc, 0x06, 0x8b90);
9795         MP_WritePhyUshort(sc, 0x06, 0xf9ee);
9796         MP_WritePhyUshort(sc, 0x06, 0xfff6);
9797         MP_WritePhyUshort(sc, 0x06, 0x00ee);
9798         MP_WritePhyUshort(sc, 0x06, 0xfff7);
9799         MP_WritePhyUshort(sc, 0x06, 0xffe0);
9800         MP_WritePhyUshort(sc, 0x06, 0xe140);
9801         MP_WritePhyUshort(sc, 0x06, 0xe1e1);
9802         MP_WritePhyUshort(sc, 0x06, 0x41f7);
9803         MP_WritePhyUshort(sc, 0x06, 0x2ff6);
9804         MP_WritePhyUshort(sc, 0x06, 0x28e4);
9805         MP_WritePhyUshort(sc, 0x06, 0xe140);
9806         MP_WritePhyUshort(sc, 0x06, 0xe5e1);
9807         MP_WritePhyUshort(sc, 0x06, 0x41f7);
9808         MP_WritePhyUshort(sc, 0x06, 0x0002);
9809         MP_WritePhyUshort(sc, 0x06, 0x020c);
9810         MP_WritePhyUshort(sc, 0x06, 0x0202);
9811         MP_WritePhyUshort(sc, 0x06, 0x1d02);
9812         MP_WritePhyUshort(sc, 0x06, 0x0230);
9813         MP_WritePhyUshort(sc, 0x06, 0x0202);
9814         MP_WritePhyUshort(sc, 0x06, 0x4002);
9815         MP_WritePhyUshort(sc, 0x06, 0x028b);
9816         MP_WritePhyUshort(sc, 0x06, 0x0280);
9817         MP_WritePhyUshort(sc, 0x06, 0x6c02);
9818         MP_WritePhyUshort(sc, 0x06, 0x8085);
9819         MP_WritePhyUshort(sc, 0x06, 0xe08b);
9820         MP_WritePhyUshort(sc, 0x06, 0x88e1);
9821         MP_WritePhyUshort(sc, 0x06, 0x8b89);
9822         MP_WritePhyUshort(sc, 0x06, 0x1e01);
9823         MP_WritePhyUshort(sc, 0x06, 0xe18b);
9824         MP_WritePhyUshort(sc, 0x06, 0x8a1e);
9825         MP_WritePhyUshort(sc, 0x06, 0x01e1);
9826         MP_WritePhyUshort(sc, 0x06, 0x8b8b);
9827         MP_WritePhyUshort(sc, 0x06, 0x1e01);
9828         MP_WritePhyUshort(sc, 0x06, 0xe18b);
9829         MP_WritePhyUshort(sc, 0x06, 0x8c1e);
9830         MP_WritePhyUshort(sc, 0x06, 0x01e1);
9831         MP_WritePhyUshort(sc, 0x06, 0x8b8d);
9832         MP_WritePhyUshort(sc, 0x06, 0x1e01);
9833         MP_WritePhyUshort(sc, 0x06, 0xe18b);
9834         MP_WritePhyUshort(sc, 0x06, 0x8e1e);
9835         MP_WritePhyUshort(sc, 0x06, 0x01a0);
9836         MP_WritePhyUshort(sc, 0x06, 0x00c7);
9837         MP_WritePhyUshort(sc, 0x06, 0xaec3);
9838         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
9839         MP_WritePhyUshort(sc, 0x06, 0x8b8d);
9840         MP_WritePhyUshort(sc, 0x06, 0xad20);
9841         MP_WritePhyUshort(sc, 0x06, 0x10ee);
9842         MP_WritePhyUshort(sc, 0x06, 0x8b8d);
9843         MP_WritePhyUshort(sc, 0x06, 0x0002);
9844         MP_WritePhyUshort(sc, 0x06, 0x1310);
9845         MP_WritePhyUshort(sc, 0x06, 0x021f);
9846         MP_WritePhyUshort(sc, 0x06, 0x9d02);
9847         MP_WritePhyUshort(sc, 0x06, 0x1f0c);
9848         MP_WritePhyUshort(sc, 0x06, 0x0227);
9849         MP_WritePhyUshort(sc, 0x06, 0x49fc);
9850         MP_WritePhyUshort(sc, 0x06, 0x04f8);
9851         MP_WritePhyUshort(sc, 0x06, 0xe08b);
9852         MP_WritePhyUshort(sc, 0x06, 0x8ead);
9853         MP_WritePhyUshort(sc, 0x06, 0x200b);
9854         MP_WritePhyUshort(sc, 0x06, 0xf620);
9855         MP_WritePhyUshort(sc, 0x06, 0xe48b);
9856         MP_WritePhyUshort(sc, 0x06, 0x8e02);
9857         MP_WritePhyUshort(sc, 0x06, 0x830e);
9858         MP_WritePhyUshort(sc, 0x06, 0x021b);
9859         MP_WritePhyUshort(sc, 0x06, 0x67ad);
9860         MP_WritePhyUshort(sc, 0x06, 0x2211);
9861         MP_WritePhyUshort(sc, 0x06, 0xf622);
9862         MP_WritePhyUshort(sc, 0x06, 0xe48b);
9863         MP_WritePhyUshort(sc, 0x06, 0x8e02);
9864         MP_WritePhyUshort(sc, 0x06, 0x2ba5);
9865         MP_WritePhyUshort(sc, 0x06, 0x022a);
9866         MP_WritePhyUshort(sc, 0x06, 0x2402);
9867         MP_WritePhyUshort(sc, 0x06, 0x80c6);
9868         MP_WritePhyUshort(sc, 0x06, 0x022a);
9869         MP_WritePhyUshort(sc, 0x06, 0xf0ad);
9870         MP_WritePhyUshort(sc, 0x06, 0x2511);
9871         MP_WritePhyUshort(sc, 0x06, 0xf625);
9872         MP_WritePhyUshort(sc, 0x06, 0xe48b);
9873         MP_WritePhyUshort(sc, 0x06, 0x8e02);
9874         MP_WritePhyUshort(sc, 0x06, 0x8226);
9875         MP_WritePhyUshort(sc, 0x06, 0x0204);
9876         MP_WritePhyUshort(sc, 0x06, 0x0302);
9877         MP_WritePhyUshort(sc, 0x06, 0x19cc);
9878         MP_WritePhyUshort(sc, 0x06, 0x022b);
9879         MP_WritePhyUshort(sc, 0x06, 0x5bfc);
9880         MP_WritePhyUshort(sc, 0x06, 0x04ee);
9881         MP_WritePhyUshort(sc, 0x06, 0x8b8d);
9882         MP_WritePhyUshort(sc, 0x06, 0x0105);
9883         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
9884         MP_WritePhyUshort(sc, 0x06, 0x8b83);
9885         MP_WritePhyUshort(sc, 0x06, 0xad24);
9886         MP_WritePhyUshort(sc, 0x06, 0x44e0);
9887         MP_WritePhyUshort(sc, 0x06, 0xe022);
9888         MP_WritePhyUshort(sc, 0x06, 0xe1e0);
9889         MP_WritePhyUshort(sc, 0x06, 0x23ad);
9890         MP_WritePhyUshort(sc, 0x06, 0x223b);
9891         MP_WritePhyUshort(sc, 0x06, 0xe08a);
9892         MP_WritePhyUshort(sc, 0x06, 0xbea0);
9893         MP_WritePhyUshort(sc, 0x06, 0x0005);
9894         MP_WritePhyUshort(sc, 0x06, 0x0228);
9895         MP_WritePhyUshort(sc, 0x06, 0xdeae);
9896         MP_WritePhyUshort(sc, 0x06, 0x42a0);
9897         MP_WritePhyUshort(sc, 0x06, 0x0105);
9898         MP_WritePhyUshort(sc, 0x06, 0x0228);
9899         MP_WritePhyUshort(sc, 0x06, 0xf1ae);
9900         MP_WritePhyUshort(sc, 0x06, 0x3aa0);
9901         MP_WritePhyUshort(sc, 0x06, 0x0205);
9902         MP_WritePhyUshort(sc, 0x06, 0x0281);
9903         MP_WritePhyUshort(sc, 0x06, 0x25ae);
9904         MP_WritePhyUshort(sc, 0x06, 0x32a0);
9905         MP_WritePhyUshort(sc, 0x06, 0x0305);
9906         MP_WritePhyUshort(sc, 0x06, 0x0229);
9907         MP_WritePhyUshort(sc, 0x06, 0x9aae);
9908         MP_WritePhyUshort(sc, 0x06, 0x2aa0);
9909         MP_WritePhyUshort(sc, 0x06, 0x0405);
9910         MP_WritePhyUshort(sc, 0x06, 0x0229);
9911         MP_WritePhyUshort(sc, 0x06, 0xaeae);
9912         MP_WritePhyUshort(sc, 0x06, 0x22a0);
9913         MP_WritePhyUshort(sc, 0x06, 0x0505);
9914         MP_WritePhyUshort(sc, 0x06, 0x0229);
9915         MP_WritePhyUshort(sc, 0x06, 0xd7ae);
9916         MP_WritePhyUshort(sc, 0x06, 0x1aa0);
9917         MP_WritePhyUshort(sc, 0x06, 0x0605);
9918         MP_WritePhyUshort(sc, 0x06, 0x0229);
9919         MP_WritePhyUshort(sc, 0x06, 0xfeae);
9920         MP_WritePhyUshort(sc, 0x06, 0x12ee);
9921         MP_WritePhyUshort(sc, 0x06, 0x8ac0);
9922         MP_WritePhyUshort(sc, 0x06, 0x00ee);
9923         MP_WritePhyUshort(sc, 0x06, 0x8ac1);
9924         MP_WritePhyUshort(sc, 0x06, 0x00ee);
9925         MP_WritePhyUshort(sc, 0x06, 0x8ac6);
9926         MP_WritePhyUshort(sc, 0x06, 0x00ee);
9927         MP_WritePhyUshort(sc, 0x06, 0x8abe);
9928         MP_WritePhyUshort(sc, 0x06, 0x00ae);
9929         MP_WritePhyUshort(sc, 0x06, 0x00fc);
9930         MP_WritePhyUshort(sc, 0x06, 0x04f8);
9931         MP_WritePhyUshort(sc, 0x06, 0x022a);
9932         MP_WritePhyUshort(sc, 0x06, 0x67e0);
9933         MP_WritePhyUshort(sc, 0x06, 0xe022);
9934         MP_WritePhyUshort(sc, 0x06, 0xe1e0);
9935         MP_WritePhyUshort(sc, 0x06, 0x230d);
9936         MP_WritePhyUshort(sc, 0x06, 0x0658);
9937         MP_WritePhyUshort(sc, 0x06, 0x03a0);
9938         MP_WritePhyUshort(sc, 0x06, 0x0202);
9939         MP_WritePhyUshort(sc, 0x06, 0xae2d);
9940         MP_WritePhyUshort(sc, 0x06, 0xa001);
9941         MP_WritePhyUshort(sc, 0x06, 0x02ae);
9942         MP_WritePhyUshort(sc, 0x06, 0x2da0);
9943         MP_WritePhyUshort(sc, 0x06, 0x004d);
9944         MP_WritePhyUshort(sc, 0x06, 0xe0e2);
9945         MP_WritePhyUshort(sc, 0x06, 0x00e1);
9946         MP_WritePhyUshort(sc, 0x06, 0xe201);
9947         MP_WritePhyUshort(sc, 0x06, 0xad24);
9948         MP_WritePhyUshort(sc, 0x06, 0x44e0);
9949         MP_WritePhyUshort(sc, 0x06, 0x8ac2);
9950         MP_WritePhyUshort(sc, 0x06, 0xe48a);
9951         MP_WritePhyUshort(sc, 0x06, 0xc4e0);
9952         MP_WritePhyUshort(sc, 0x06, 0x8ac3);
9953         MP_WritePhyUshort(sc, 0x06, 0xe48a);
9954         MP_WritePhyUshort(sc, 0x06, 0xc5ee);
9955         MP_WritePhyUshort(sc, 0x06, 0x8abe);
9956         MP_WritePhyUshort(sc, 0x06, 0x03e0);
9957         MP_WritePhyUshort(sc, 0x06, 0x8b83);
9958         MP_WritePhyUshort(sc, 0x06, 0xad25);
9959         MP_WritePhyUshort(sc, 0x06, 0x3aee);
9960         MP_WritePhyUshort(sc, 0x06, 0x8abe);
9961         MP_WritePhyUshort(sc, 0x06, 0x05ae);
9962         MP_WritePhyUshort(sc, 0x06, 0x34e0);
9963         MP_WritePhyUshort(sc, 0x06, 0x8ace);
9964         MP_WritePhyUshort(sc, 0x06, 0xae03);
9965         MP_WritePhyUshort(sc, 0x06, 0xe08a);
9966         MP_WritePhyUshort(sc, 0x06, 0xcfe1);
9967         MP_WritePhyUshort(sc, 0x06, 0x8ac2);
9968         MP_WritePhyUshort(sc, 0x06, 0x4905);
9969         MP_WritePhyUshort(sc, 0x06, 0xe58a);
9970         MP_WritePhyUshort(sc, 0x06, 0xc4e1);
9971         MP_WritePhyUshort(sc, 0x06, 0x8ac3);
9972         MP_WritePhyUshort(sc, 0x06, 0x4905);
9973         MP_WritePhyUshort(sc, 0x06, 0xe58a);
9974         MP_WritePhyUshort(sc, 0x06, 0xc5ee);
9975         MP_WritePhyUshort(sc, 0x06, 0x8abe);
9976         MP_WritePhyUshort(sc, 0x06, 0x0502);
9977         MP_WritePhyUshort(sc, 0x06, 0x2ab6);
9978         MP_WritePhyUshort(sc, 0x06, 0xac20);
9979         MP_WritePhyUshort(sc, 0x06, 0x1202);
9980         MP_WritePhyUshort(sc, 0x06, 0x819b);
9981         MP_WritePhyUshort(sc, 0x06, 0xac20);
9982         MP_WritePhyUshort(sc, 0x06, 0x0cee);
9983         MP_WritePhyUshort(sc, 0x06, 0x8ac1);
9984         MP_WritePhyUshort(sc, 0x06, 0x00ee);
9985         MP_WritePhyUshort(sc, 0x06, 0x8ac6);
9986         MP_WritePhyUshort(sc, 0x06, 0x00ee);
9987         MP_WritePhyUshort(sc, 0x06, 0x8abe);
9988         MP_WritePhyUshort(sc, 0x06, 0x02fc);
9989         MP_WritePhyUshort(sc, 0x06, 0x04d0);
9990         MP_WritePhyUshort(sc, 0x06, 0x0002);
9991         MP_WritePhyUshort(sc, 0x06, 0x81ad);
9992         MP_WritePhyUshort(sc, 0x06, 0x590f);
9993         MP_WritePhyUshort(sc, 0x06, 0x3902);
9994         MP_WritePhyUshort(sc, 0x06, 0xaa04);
9995         MP_WritePhyUshort(sc, 0x06, 0xd001);
9996         MP_WritePhyUshort(sc, 0x06, 0xae02);
9997         MP_WritePhyUshort(sc, 0x06, 0xd000);
9998         MP_WritePhyUshort(sc, 0x06, 0x04f9);
9999         MP_WritePhyUshort(sc, 0x06, 0xfae2);
10000         MP_WritePhyUshort(sc, 0x06, 0xe2d2);
10001         MP_WritePhyUshort(sc, 0x06, 0xe3e2);
10002         MP_WritePhyUshort(sc, 0x06, 0xd3f9);
10003         MP_WritePhyUshort(sc, 0x06, 0x5af7);
10004         MP_WritePhyUshort(sc, 0x06, 0xe6e2);
10005         MP_WritePhyUshort(sc, 0x06, 0xd2e7);
10006         MP_WritePhyUshort(sc, 0x06, 0xe2d3);
10007         MP_WritePhyUshort(sc, 0x06, 0xe2e0);
10008         MP_WritePhyUshort(sc, 0x06, 0x2ce3);
10009         MP_WritePhyUshort(sc, 0x06, 0xe02d);
10010         MP_WritePhyUshort(sc, 0x06, 0xf95b);
10011         MP_WritePhyUshort(sc, 0x06, 0xe01e);
10012         MP_WritePhyUshort(sc, 0x06, 0x30e6);
10013         MP_WritePhyUshort(sc, 0x06, 0xe02c);
10014         MP_WritePhyUshort(sc, 0x06, 0xe7e0);
10015         MP_WritePhyUshort(sc, 0x06, 0x2de2);
10016         MP_WritePhyUshort(sc, 0x06, 0xe2cc);
10017         MP_WritePhyUshort(sc, 0x06, 0xe3e2);
10018         MP_WritePhyUshort(sc, 0x06, 0xcdf9);
10019         MP_WritePhyUshort(sc, 0x06, 0x5a0f);
10020         MP_WritePhyUshort(sc, 0x06, 0x6a50);
10021         MP_WritePhyUshort(sc, 0x06, 0xe6e2);
10022         MP_WritePhyUshort(sc, 0x06, 0xcce7);
10023         MP_WritePhyUshort(sc, 0x06, 0xe2cd);
10024         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
10025         MP_WritePhyUshort(sc, 0x06, 0x3ce1);
10026         MP_WritePhyUshort(sc, 0x06, 0xe03d);
10027         MP_WritePhyUshort(sc, 0x06, 0xef64);
10028         MP_WritePhyUshort(sc, 0x06, 0xfde0);
10029         MP_WritePhyUshort(sc, 0x06, 0xe2cc);
10030         MP_WritePhyUshort(sc, 0x06, 0xe1e2);
10031         MP_WritePhyUshort(sc, 0x06, 0xcd58);
10032         MP_WritePhyUshort(sc, 0x06, 0x0f5a);
10033         MP_WritePhyUshort(sc, 0x06, 0xf01e);
10034         MP_WritePhyUshort(sc, 0x06, 0x02e4);
10035         MP_WritePhyUshort(sc, 0x06, 0xe2cc);
10036         MP_WritePhyUshort(sc, 0x06, 0xe5e2);
10037         MP_WritePhyUshort(sc, 0x06, 0xcdfd);
10038         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
10039         MP_WritePhyUshort(sc, 0x06, 0x2ce1);
10040         MP_WritePhyUshort(sc, 0x06, 0xe02d);
10041         MP_WritePhyUshort(sc, 0x06, 0x59e0);
10042         MP_WritePhyUshort(sc, 0x06, 0x5b1f);
10043         MP_WritePhyUshort(sc, 0x06, 0x1e13);
10044         MP_WritePhyUshort(sc, 0x06, 0xe4e0);
10045         MP_WritePhyUshort(sc, 0x06, 0x2ce5);
10046         MP_WritePhyUshort(sc, 0x06, 0xe02d);
10047         MP_WritePhyUshort(sc, 0x06, 0xfde0);
10048         MP_WritePhyUshort(sc, 0x06, 0xe2d2);
10049         MP_WritePhyUshort(sc, 0x06, 0xe1e2);
10050         MP_WritePhyUshort(sc, 0x06, 0xd358);
10051         MP_WritePhyUshort(sc, 0x06, 0xf75a);
10052         MP_WritePhyUshort(sc, 0x06, 0x081e);
10053         MP_WritePhyUshort(sc, 0x06, 0x02e4);
10054         MP_WritePhyUshort(sc, 0x06, 0xe2d2);
10055         MP_WritePhyUshort(sc, 0x06, 0xe5e2);
10056         MP_WritePhyUshort(sc, 0x06, 0xd3ef);
10057         MP_WritePhyUshort(sc, 0x06, 0x46fe);
10058         MP_WritePhyUshort(sc, 0x06, 0xfd04);
10059         MP_WritePhyUshort(sc, 0x06, 0xf8f9);
10060         MP_WritePhyUshort(sc, 0x06, 0xfaef);
10061         MP_WritePhyUshort(sc, 0x06, 0x69e0);
10062         MP_WritePhyUshort(sc, 0x06, 0xe022);
10063         MP_WritePhyUshort(sc, 0x06, 0xe1e0);
10064         MP_WritePhyUshort(sc, 0x06, 0x2358);
10065         MP_WritePhyUshort(sc, 0x06, 0xc4e1);
10066         MP_WritePhyUshort(sc, 0x06, 0x8b6e);
10067         MP_WritePhyUshort(sc, 0x06, 0x1f10);
10068         MP_WritePhyUshort(sc, 0x06, 0x9e58);
10069         MP_WritePhyUshort(sc, 0x06, 0xe48b);
10070         MP_WritePhyUshort(sc, 0x06, 0x6ead);
10071         MP_WritePhyUshort(sc, 0x06, 0x2222);
10072         MP_WritePhyUshort(sc, 0x06, 0xac27);
10073         MP_WritePhyUshort(sc, 0x06, 0x55ac);
10074         MP_WritePhyUshort(sc, 0x06, 0x2602);
10075         MP_WritePhyUshort(sc, 0x06, 0xae1a);
10076         MP_WritePhyUshort(sc, 0x06, 0xd106);
10077         MP_WritePhyUshort(sc, 0x06, 0xbf3b);
10078         MP_WritePhyUshort(sc, 0x06, 0xba02);
10079         MP_WritePhyUshort(sc, 0x06, 0x2dc1);
10080         MP_WritePhyUshort(sc, 0x06, 0xd107);
10081         MP_WritePhyUshort(sc, 0x06, 0xbf3b);
10082         MP_WritePhyUshort(sc, 0x06, 0xbd02);
10083         MP_WritePhyUshort(sc, 0x06, 0x2dc1);
10084         MP_WritePhyUshort(sc, 0x06, 0xd107);
10085         MP_WritePhyUshort(sc, 0x06, 0xbf3b);
10086         MP_WritePhyUshort(sc, 0x06, 0xc002);
10087         MP_WritePhyUshort(sc, 0x06, 0x2dc1);
10088         MP_WritePhyUshort(sc, 0x06, 0xae30);
10089         MP_WritePhyUshort(sc, 0x06, 0xd103);
10090         MP_WritePhyUshort(sc, 0x06, 0xbf3b);
10091         MP_WritePhyUshort(sc, 0x06, 0xc302);
10092         MP_WritePhyUshort(sc, 0x06, 0x2dc1);
10093         MP_WritePhyUshort(sc, 0x06, 0xd100);
10094         MP_WritePhyUshort(sc, 0x06, 0xbf3b);
10095         MP_WritePhyUshort(sc, 0x06, 0xc602);
10096         MP_WritePhyUshort(sc, 0x06, 0x2dc1);
10097         MP_WritePhyUshort(sc, 0x06, 0xd100);
10098         MP_WritePhyUshort(sc, 0x06, 0xbf82);
10099         MP_WritePhyUshort(sc, 0x06, 0xca02);
10100         MP_WritePhyUshort(sc, 0x06, 0x2dc1);
10101         MP_WritePhyUshort(sc, 0x06, 0xd10f);
10102         MP_WritePhyUshort(sc, 0x06, 0xbf3b);
10103         MP_WritePhyUshort(sc, 0x06, 0xba02);
10104         MP_WritePhyUshort(sc, 0x06, 0x2dc1);
10105         MP_WritePhyUshort(sc, 0x06, 0xd101);
10106         MP_WritePhyUshort(sc, 0x06, 0xbf3b);
10107         MP_WritePhyUshort(sc, 0x06, 0xbd02);
10108         MP_WritePhyUshort(sc, 0x06, 0x2dc1);
10109         MP_WritePhyUshort(sc, 0x06, 0xd101);
10110         MP_WritePhyUshort(sc, 0x06, 0xbf3b);
10111         MP_WritePhyUshort(sc, 0x06, 0xc002);
10112         MP_WritePhyUshort(sc, 0x06, 0x2dc1);
10113         MP_WritePhyUshort(sc, 0x06, 0xef96);
10114         MP_WritePhyUshort(sc, 0x06, 0xfefd);
10115         MP_WritePhyUshort(sc, 0x06, 0xfc04);
10116         MP_WritePhyUshort(sc, 0x06, 0xd100);
10117         MP_WritePhyUshort(sc, 0x06, 0xbf3b);
10118         MP_WritePhyUshort(sc, 0x06, 0xc302);
10119         MP_WritePhyUshort(sc, 0x06, 0x2dc1);
10120         MP_WritePhyUshort(sc, 0x06, 0xd011);
10121         MP_WritePhyUshort(sc, 0x06, 0x022b);
10122         MP_WritePhyUshort(sc, 0x06, 0xfb59);
10123         MP_WritePhyUshort(sc, 0x06, 0x03ef);
10124         MP_WritePhyUshort(sc, 0x06, 0x01d1);
10125         MP_WritePhyUshort(sc, 0x06, 0x00a0);
10126         MP_WritePhyUshort(sc, 0x06, 0x0002);
10127         MP_WritePhyUshort(sc, 0x06, 0xd101);
10128         MP_WritePhyUshort(sc, 0x06, 0xbf3b);
10129         MP_WritePhyUshort(sc, 0x06, 0xc602);
10130         MP_WritePhyUshort(sc, 0x06, 0x2dc1);
10131         MP_WritePhyUshort(sc, 0x06, 0xd111);
10132         MP_WritePhyUshort(sc, 0x06, 0xad20);
10133         MP_WritePhyUshort(sc, 0x06, 0x020c);
10134         MP_WritePhyUshort(sc, 0x06, 0x11ad);
10135         MP_WritePhyUshort(sc, 0x06, 0x2102);
10136         MP_WritePhyUshort(sc, 0x06, 0x0c12);
10137         MP_WritePhyUshort(sc, 0x06, 0xbf82);
10138         MP_WritePhyUshort(sc, 0x06, 0xca02);
10139         MP_WritePhyUshort(sc, 0x06, 0x2dc1);
10140         MP_WritePhyUshort(sc, 0x06, 0xaec8);
10141         MP_WritePhyUshort(sc, 0x06, 0x70e4);
10142         MP_WritePhyUshort(sc, 0x06, 0x2602);
10143         MP_WritePhyUshort(sc, 0x06, 0x82d1);
10144         MP_WritePhyUshort(sc, 0x06, 0x05f8);
10145         MP_WritePhyUshort(sc, 0x06, 0xfaef);
10146         MP_WritePhyUshort(sc, 0x06, 0x69e0);
10147         MP_WritePhyUshort(sc, 0x06, 0xe2fe);
10148         MP_WritePhyUshort(sc, 0x06, 0xe1e2);
10149         MP_WritePhyUshort(sc, 0x06, 0xffad);
10150         MP_WritePhyUshort(sc, 0x06, 0x2d1a);
10151         MP_WritePhyUshort(sc, 0x06, 0xe0e1);
10152         MP_WritePhyUshort(sc, 0x06, 0x4ee1);
10153         MP_WritePhyUshort(sc, 0x06, 0xe14f);
10154         MP_WritePhyUshort(sc, 0x06, 0xac2d);
10155         MP_WritePhyUshort(sc, 0x06, 0x22f6);
10156         MP_WritePhyUshort(sc, 0x06, 0x0302);
10157         MP_WritePhyUshort(sc, 0x06, 0x033b);
10158         MP_WritePhyUshort(sc, 0x06, 0xf703);
10159         MP_WritePhyUshort(sc, 0x06, 0xf706);
10160         MP_WritePhyUshort(sc, 0x06, 0xbf84);
10161         MP_WritePhyUshort(sc, 0x06, 0x4402);
10162         MP_WritePhyUshort(sc, 0x06, 0x2d21);
10163         MP_WritePhyUshort(sc, 0x06, 0xae11);
10164         MP_WritePhyUshort(sc, 0x06, 0xe0e1);
10165         MP_WritePhyUshort(sc, 0x06, 0x4ee1);
10166         MP_WritePhyUshort(sc, 0x06, 0xe14f);
10167         MP_WritePhyUshort(sc, 0x06, 0xad2d);
10168         MP_WritePhyUshort(sc, 0x06, 0x08bf);
10169         MP_WritePhyUshort(sc, 0x06, 0x844f);
10170         MP_WritePhyUshort(sc, 0x06, 0x022d);
10171         MP_WritePhyUshort(sc, 0x06, 0x21f6);
10172         MP_WritePhyUshort(sc, 0x06, 0x06ef);
10173         MP_WritePhyUshort(sc, 0x06, 0x96fe);
10174         MP_WritePhyUshort(sc, 0x06, 0xfc04);
10175         MP_WritePhyUshort(sc, 0x06, 0xf8fa);
10176         MP_WritePhyUshort(sc, 0x06, 0xef69);
10177         MP_WritePhyUshort(sc, 0x06, 0x0283);
10178         MP_WritePhyUshort(sc, 0x06, 0x4502);
10179         MP_WritePhyUshort(sc, 0x06, 0x83a2);
10180         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
10181         MP_WritePhyUshort(sc, 0x06, 0x00e1);
10182         MP_WritePhyUshort(sc, 0x06, 0xe001);
10183         MP_WritePhyUshort(sc, 0x06, 0xad27);
10184         MP_WritePhyUshort(sc, 0x06, 0x1fd1);
10185         MP_WritePhyUshort(sc, 0x06, 0x01bf);
10186         MP_WritePhyUshort(sc, 0x06, 0x843b);
10187         MP_WritePhyUshort(sc, 0x06, 0x022d);
10188         MP_WritePhyUshort(sc, 0x06, 0xc1e0);
10189         MP_WritePhyUshort(sc, 0x06, 0xe020);
10190         MP_WritePhyUshort(sc, 0x06, 0xe1e0);
10191         MP_WritePhyUshort(sc, 0x06, 0x21ad);
10192         MP_WritePhyUshort(sc, 0x06, 0x200e);
10193         MP_WritePhyUshort(sc, 0x06, 0xd100);
10194         MP_WritePhyUshort(sc, 0x06, 0xbf84);
10195         MP_WritePhyUshort(sc, 0x06, 0x3b02);
10196         MP_WritePhyUshort(sc, 0x06, 0x2dc1);
10197         MP_WritePhyUshort(sc, 0x06, 0xbf3b);
10198         MP_WritePhyUshort(sc, 0x06, 0x9602);
10199         MP_WritePhyUshort(sc, 0x06, 0x2d21);
10200         MP_WritePhyUshort(sc, 0x06, 0xef96);
10201         MP_WritePhyUshort(sc, 0x06, 0xfefc);
10202         MP_WritePhyUshort(sc, 0x06, 0x04f8);
10203         MP_WritePhyUshort(sc, 0x06, 0xf9fa);
10204         MP_WritePhyUshort(sc, 0x06, 0xef69);
10205         MP_WritePhyUshort(sc, 0x06, 0xe08b);
10206         MP_WritePhyUshort(sc, 0x06, 0x87ad);
10207         MP_WritePhyUshort(sc, 0x06, 0x204c);
10208         MP_WritePhyUshort(sc, 0x06, 0xd200);
10209         MP_WritePhyUshort(sc, 0x06, 0xe0e2);
10210         MP_WritePhyUshort(sc, 0x06, 0x0058);
10211         MP_WritePhyUshort(sc, 0x06, 0x010c);
10212         MP_WritePhyUshort(sc, 0x06, 0x021e);
10213         MP_WritePhyUshort(sc, 0x06, 0x20e0);
10214         MP_WritePhyUshort(sc, 0x06, 0xe000);
10215         MP_WritePhyUshort(sc, 0x06, 0x5810);
10216         MP_WritePhyUshort(sc, 0x06, 0x1e20);
10217         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
10218         MP_WritePhyUshort(sc, 0x06, 0x3658);
10219         MP_WritePhyUshort(sc, 0x06, 0x031e);
10220         MP_WritePhyUshort(sc, 0x06, 0x20e0);
10221         MP_WritePhyUshort(sc, 0x06, 0xe022);
10222         MP_WritePhyUshort(sc, 0x06, 0xe1e0);
10223         MP_WritePhyUshort(sc, 0x06, 0x2358);
10224         MP_WritePhyUshort(sc, 0x06, 0xe01e);
10225         MP_WritePhyUshort(sc, 0x06, 0x20e0);
10226         MP_WritePhyUshort(sc, 0x06, 0x8b64);
10227         MP_WritePhyUshort(sc, 0x06, 0x1f02);
10228         MP_WritePhyUshort(sc, 0x06, 0x9e22);
10229         MP_WritePhyUshort(sc, 0x06, 0xe68b);
10230         MP_WritePhyUshort(sc, 0x06, 0x64ad);
10231         MP_WritePhyUshort(sc, 0x06, 0x3214);
10232         MP_WritePhyUshort(sc, 0x06, 0xad34);
10233         MP_WritePhyUshort(sc, 0x06, 0x11ef);
10234         MP_WritePhyUshort(sc, 0x06, 0x0258);
10235         MP_WritePhyUshort(sc, 0x06, 0x039e);
10236         MP_WritePhyUshort(sc, 0x06, 0x07ad);
10237         MP_WritePhyUshort(sc, 0x06, 0x3508);
10238         MP_WritePhyUshort(sc, 0x06, 0x5ac0);
10239         MP_WritePhyUshort(sc, 0x06, 0x9f04);
10240         MP_WritePhyUshort(sc, 0x06, 0xd101);
10241         MP_WritePhyUshort(sc, 0x06, 0xae02);
10242         MP_WritePhyUshort(sc, 0x06, 0xd100);
10243         MP_WritePhyUshort(sc, 0x06, 0xbf84);
10244         MP_WritePhyUshort(sc, 0x06, 0x3e02);
10245         MP_WritePhyUshort(sc, 0x06, 0x2dc1);
10246         MP_WritePhyUshort(sc, 0x06, 0xef96);
10247         MP_WritePhyUshort(sc, 0x06, 0xfefd);
10248         MP_WritePhyUshort(sc, 0x06, 0xfc04);
10249         MP_WritePhyUshort(sc, 0x06, 0xf8f9);
10250         MP_WritePhyUshort(sc, 0x06, 0xfbe0);
10251         MP_WritePhyUshort(sc, 0x06, 0x8b85);
10252         MP_WritePhyUshort(sc, 0x06, 0xad25);
10253         MP_WritePhyUshort(sc, 0x06, 0x22e0);
10254         MP_WritePhyUshort(sc, 0x06, 0xe022);
10255         MP_WritePhyUshort(sc, 0x06, 0xe1e0);
10256         MP_WritePhyUshort(sc, 0x06, 0x23e2);
10257         MP_WritePhyUshort(sc, 0x06, 0xe036);
10258         MP_WritePhyUshort(sc, 0x06, 0xe3e0);
10259         MP_WritePhyUshort(sc, 0x06, 0x375a);
10260         MP_WritePhyUshort(sc, 0x06, 0xc40d);
10261         MP_WritePhyUshort(sc, 0x06, 0x0158);
10262         MP_WritePhyUshort(sc, 0x06, 0x021e);
10263         MP_WritePhyUshort(sc, 0x06, 0x20e3);
10264         MP_WritePhyUshort(sc, 0x06, 0x8ae7);
10265         MP_WritePhyUshort(sc, 0x06, 0xac31);
10266         MP_WritePhyUshort(sc, 0x06, 0x60ac);
10267         MP_WritePhyUshort(sc, 0x06, 0x3a08);
10268         MP_WritePhyUshort(sc, 0x06, 0xac3e);
10269         MP_WritePhyUshort(sc, 0x06, 0x26ae);
10270         MP_WritePhyUshort(sc, 0x06, 0x67af);
10271         MP_WritePhyUshort(sc, 0x06, 0x8437);
10272         MP_WritePhyUshort(sc, 0x06, 0xad37);
10273         MP_WritePhyUshort(sc, 0x06, 0x61e0);
10274         MP_WritePhyUshort(sc, 0x06, 0x8ae8);
10275         MP_WritePhyUshort(sc, 0x06, 0x10e4);
10276         MP_WritePhyUshort(sc, 0x06, 0x8ae8);
10277         MP_WritePhyUshort(sc, 0x06, 0xe18a);
10278         MP_WritePhyUshort(sc, 0x06, 0xe91b);
10279         MP_WritePhyUshort(sc, 0x06, 0x109e);
10280         MP_WritePhyUshort(sc, 0x06, 0x02ae);
10281         MP_WritePhyUshort(sc, 0x06, 0x51d1);
10282         MP_WritePhyUshort(sc, 0x06, 0x00bf);
10283         MP_WritePhyUshort(sc, 0x06, 0x8441);
10284         MP_WritePhyUshort(sc, 0x06, 0x022d);
10285         MP_WritePhyUshort(sc, 0x06, 0xc1ee);
10286         MP_WritePhyUshort(sc, 0x06, 0x8ae8);
10287         MP_WritePhyUshort(sc, 0x06, 0x00ae);
10288         MP_WritePhyUshort(sc, 0x06, 0x43ad);
10289         MP_WritePhyUshort(sc, 0x06, 0x3627);
10290         MP_WritePhyUshort(sc, 0x06, 0xe08a);
10291         MP_WritePhyUshort(sc, 0x06, 0xeee1);
10292         MP_WritePhyUshort(sc, 0x06, 0x8aef);
10293         MP_WritePhyUshort(sc, 0x06, 0xef74);
10294         MP_WritePhyUshort(sc, 0x06, 0xe08a);
10295         MP_WritePhyUshort(sc, 0x06, 0xeae1);
10296         MP_WritePhyUshort(sc, 0x06, 0x8aeb);
10297         MP_WritePhyUshort(sc, 0x06, 0x1b74);
10298         MP_WritePhyUshort(sc, 0x06, 0x9e2e);
10299         MP_WritePhyUshort(sc, 0x06, 0x14e4);
10300         MP_WritePhyUshort(sc, 0x06, 0x8aea);
10301         MP_WritePhyUshort(sc, 0x06, 0xe58a);
10302         MP_WritePhyUshort(sc, 0x06, 0xebef);
10303         MP_WritePhyUshort(sc, 0x06, 0x74e0);
10304         MP_WritePhyUshort(sc, 0x06, 0x8aee);
10305         MP_WritePhyUshort(sc, 0x06, 0xe18a);
10306         MP_WritePhyUshort(sc, 0x06, 0xef1b);
10307         MP_WritePhyUshort(sc, 0x06, 0x479e);
10308         MP_WritePhyUshort(sc, 0x06, 0x0fae);
10309         MP_WritePhyUshort(sc, 0x06, 0x19ee);
10310         MP_WritePhyUshort(sc, 0x06, 0x8aea);
10311         MP_WritePhyUshort(sc, 0x06, 0x00ee);
10312         MP_WritePhyUshort(sc, 0x06, 0x8aeb);
10313         MP_WritePhyUshort(sc, 0x06, 0x00ae);
10314         MP_WritePhyUshort(sc, 0x06, 0x0fac);
10315         MP_WritePhyUshort(sc, 0x06, 0x390c);
10316         MP_WritePhyUshort(sc, 0x06, 0xd101);
10317         MP_WritePhyUshort(sc, 0x06, 0xbf84);
10318         MP_WritePhyUshort(sc, 0x06, 0x4102);
10319         MP_WritePhyUshort(sc, 0x06, 0x2dc1);
10320         MP_WritePhyUshort(sc, 0x06, 0xee8a);
10321         MP_WritePhyUshort(sc, 0x06, 0xe800);
10322         MP_WritePhyUshort(sc, 0x06, 0xe68a);
10323         MP_WritePhyUshort(sc, 0x06, 0xe7ff);
10324         MP_WritePhyUshort(sc, 0x06, 0xfdfc);
10325         MP_WritePhyUshort(sc, 0x06, 0x0400);
10326         MP_WritePhyUshort(sc, 0x06, 0xe234);
10327         MP_WritePhyUshort(sc, 0x06, 0xcce2);
10328         MP_WritePhyUshort(sc, 0x06, 0x0088);
10329         MP_WritePhyUshort(sc, 0x06, 0xe200);
10330         MP_WritePhyUshort(sc, 0x06, 0xa725);
10331         MP_WritePhyUshort(sc, 0x06, 0xe50a);
10332         MP_WritePhyUshort(sc, 0x06, 0x1de5);
10333         MP_WritePhyUshort(sc, 0x06, 0x0a2c);
10334         MP_WritePhyUshort(sc, 0x06, 0xe50a);
10335         MP_WritePhyUshort(sc, 0x06, 0x6de5);
10336         MP_WritePhyUshort(sc, 0x06, 0x0a1d);
10337         MP_WritePhyUshort(sc, 0x06, 0xe50a);
10338         MP_WritePhyUshort(sc, 0x06, 0x1ce5);
10339         MP_WritePhyUshort(sc, 0x06, 0x0a2d);
10340         MP_WritePhyUshort(sc, 0x06, 0xa755);
10341         MP_WritePhyUshort(sc, 0x05, 0x8b64);
10342         MP_WritePhyUshort(sc, 0x06, 0x0000);
10343         MP_WritePhyUshort(sc, 0x05, 0x8b94);
10344         MP_WritePhyUshort(sc, 0x06, 0x82cd);
10345         MP_WritePhyUshort(sc, 0x05, 0x8b85);
10346         MP_WritePhyUshort(sc, 0x06, 0x2000);
10347         MP_WritePhyUshort(sc, 0x05, 0x8aee);
10348         MP_WritePhyUshort(sc, 0x06, 0x03b8);
10349         MP_WritePhyUshort(sc, 0x05, 0x8ae8);
10350         MP_WritePhyUshort(sc, 0x06, 0x0002);
10351         PhyRegValue = MP_ReadPhyUshort(sc, 0x01);
10352         PhyRegValue |= BIT_0;
10353         MP_WritePhyUshort(sc, 0x01, PhyRegValue);
10354         PhyRegValue = MP_ReadPhyUshort(sc, 0x00);
10355         PhyRegValue |= BIT_0;
10356         MP_WritePhyUshort(sc, 0x00, PhyRegValue);
10357         MP_WritePhyUshort(sc, 0x1f, 0x0);
10358         MP_WritePhyUshort(sc, 0x1f, 0x0005);
10359         for (i=0; i<200; i++) {
10360                 DELAY(100);
10361                 PhyRegValue = MP_ReadPhyUshort(sc, 0x00);
10362                 if (PhyRegValue&0x0080)
10363                         break;
10364         }
10365         MP_WritePhyUshort(sc, 0x1f, 0x0007);
10366         MP_WritePhyUshort(sc, 0x1e, 0x0023);
10367         PhyRegValue = MP_ReadPhyUshort(sc, 0x17);
10368         PhyRegValue &= ~(BIT_0);
10369         if (sc->RequiredSecLanDonglePatch)
10370                 PhyRegValue &= ~(BIT_2);
10371         MP_WritePhyUshort(sc, 0x17, PhyRegValue);
10372         MP_WritePhyUshort(sc, 0x1f, 0x0007);
10373         MP_WritePhyUshort(sc, 0x1e, 0x0028);
10374         MP_WritePhyUshort(sc, 0x15, 0x0010);
10375         MP_WritePhyUshort(sc, 0x1f, 0x0007);
10376         MP_WritePhyUshort(sc, 0x1e, 0x0041);
10377         MP_WritePhyUshort(sc, 0x15, 0x0802);
10378         MP_WritePhyUshort(sc, 0x16, 0x2185);
10379         MP_WritePhyUshort(sc, 0x1f, 0x0000);
10380 }
10381
10382 static void re_set_phy_mcu_8168e_2(struct re_softc *sc)
10383 {
10384         u_int16_t PhyRegValue;
10385         int     i;
10386
10387         if (MP_ReadEfuse(sc, 0x22) == 0x0c) {
10388                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
10389                 MP_WritePhyUshort(sc, 0x00, 0x1800);
10390                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
10391                 MP_WritePhyUshort(sc, 0x1e, 0x0023);
10392                 MP_WritePhyUshort(sc, 0x17, 0x0117);
10393                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
10394                 MP_WritePhyUshort(sc, 0x1E, 0x002C);
10395                 MP_WritePhyUshort(sc, 0x1B, 0x5000);
10396                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
10397                 MP_WritePhyUshort(sc, 0x16, 0x4104);
10398                 for (i=0; i<200; i++) {
10399                         DELAY(100);
10400                         PhyRegValue = MP_ReadPhyUshort(sc, 0x1E);
10401                         PhyRegValue &= 0x03FF;
10402                         if (PhyRegValue== 0x000C)
10403                                 break;
10404                 }
10405                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
10406                 for (i=0; i<200; i++) {
10407                         DELAY(100);
10408                         PhyRegValue = MP_ReadPhyUshort(sc, 0x07);
10409                         if ((PhyRegValue&0x0020)==0)
10410                                 break;
10411                 }
10412                 PhyRegValue = MP_ReadPhyUshort(sc, 0x07);
10413                 if (PhyRegValue & 0x0020) {
10414                         MP_WritePhyUshort(sc, 0x1f, 0x0007);
10415                         MP_WritePhyUshort(sc, 0x1e, 0x00a1);
10416                         MP_WritePhyUshort(sc, 0x17, 0x1000);
10417                         MP_WritePhyUshort(sc, 0x17, 0x0000);
10418                         MP_WritePhyUshort(sc, 0x17, 0x2000);
10419                         MP_WritePhyUshort(sc, 0x1e, 0x002f);
10420                         MP_WritePhyUshort(sc, 0x18, 0x9bfb);
10421                         MP_WritePhyUshort(sc, 0x1f, 0x0005);
10422                         MP_WritePhyUshort(sc, 0x07, 0x0000);
10423                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
10424                 }
10425                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
10426                 MP_WritePhyUshort(sc, 0x05, 0xfff6);
10427                 MP_WritePhyUshort(sc, 0x06, 0x0080);
10428                 PhyRegValue = MP_ReadPhyUshort(sc, 0x00);
10429                 PhyRegValue &= ~(BIT_7);
10430                 MP_WritePhyUshort(sc, 0x00, PhyRegValue);
10431                 MP_WritePhyUshort(sc, 0x1f, 0x0002);
10432                 PhyRegValue = MP_ReadPhyUshort(sc, 0x08);
10433                 PhyRegValue &= ~(BIT_7);
10434                 MP_WritePhyUshort(sc, 0x08, PhyRegValue);
10435                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
10436                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
10437                 MP_WritePhyUshort(sc, 0x1e, 0x0023);
10438                 MP_WritePhyUshort(sc, 0x16, 0x0306);
10439                 MP_WritePhyUshort(sc, 0x16, 0x0307);
10440                 MP_WritePhyUshort(sc, 0x15, 0x000e);
10441                 MP_WritePhyUshort(sc, 0x19, 0x000a);
10442                 MP_WritePhyUshort(sc, 0x15, 0x0010);
10443                 MP_WritePhyUshort(sc, 0x19, 0x0008);
10444                 MP_WritePhyUshort(sc, 0x15, 0x0018);
10445                 MP_WritePhyUshort(sc, 0x19, 0x4801);
10446                 MP_WritePhyUshort(sc, 0x15, 0x0019);
10447                 MP_WritePhyUshort(sc, 0x19, 0x6801);
10448                 MP_WritePhyUshort(sc, 0x15, 0x001a);
10449                 MP_WritePhyUshort(sc, 0x19, 0x66a1);
10450                 MP_WritePhyUshort(sc, 0x15, 0x001f);
10451                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10452                 MP_WritePhyUshort(sc, 0x15, 0x0020);
10453                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10454                 MP_WritePhyUshort(sc, 0x15, 0x0021);
10455                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10456                 MP_WritePhyUshort(sc, 0x15, 0x0022);
10457                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10458                 MP_WritePhyUshort(sc, 0x15, 0x0023);
10459                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10460                 MP_WritePhyUshort(sc, 0x15, 0x0024);
10461                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10462                 MP_WritePhyUshort(sc, 0x15, 0x0025);
10463                 MP_WritePhyUshort(sc, 0x19, 0x64a1);
10464                 MP_WritePhyUshort(sc, 0x15, 0x0026);
10465                 MP_WritePhyUshort(sc, 0x19, 0x40ea);
10466                 MP_WritePhyUshort(sc, 0x15, 0x0027);
10467                 MP_WritePhyUshort(sc, 0x19, 0x4503);
10468                 MP_WritePhyUshort(sc, 0x15, 0x0028);
10469                 MP_WritePhyUshort(sc, 0x19, 0x9f00);
10470                 MP_WritePhyUshort(sc, 0x15, 0x0029);
10471                 MP_WritePhyUshort(sc, 0x19, 0xa631);
10472                 MP_WritePhyUshort(sc, 0x15, 0x002a);
10473                 MP_WritePhyUshort(sc, 0x19, 0x9717);
10474                 MP_WritePhyUshort(sc, 0x15, 0x002b);
10475                 MP_WritePhyUshort(sc, 0x19, 0x302c);
10476                 MP_WritePhyUshort(sc, 0x15, 0x002c);
10477                 MP_WritePhyUshort(sc, 0x19, 0x4802);
10478                 MP_WritePhyUshort(sc, 0x15, 0x002d);
10479                 MP_WritePhyUshort(sc, 0x19, 0x58da);
10480                 MP_WritePhyUshort(sc, 0x15, 0x002e);
10481                 MP_WritePhyUshort(sc, 0x19, 0x400d);
10482                 MP_WritePhyUshort(sc, 0x15, 0x002f);
10483                 MP_WritePhyUshort(sc, 0x19, 0x4488);
10484                 MP_WritePhyUshort(sc, 0x15, 0x0030);
10485                 MP_WritePhyUshort(sc, 0x19, 0x9e00);
10486                 MP_WritePhyUshort(sc, 0x15, 0x0031);
10487                 MP_WritePhyUshort(sc, 0x19, 0x63c8);
10488                 MP_WritePhyUshort(sc, 0x15, 0x0032);
10489                 MP_WritePhyUshort(sc, 0x19, 0x6481);
10490                 MP_WritePhyUshort(sc, 0x15, 0x0033);
10491                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10492                 MP_WritePhyUshort(sc, 0x15, 0x0034);
10493                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10494                 MP_WritePhyUshort(sc, 0x15, 0x0035);
10495                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10496                 MP_WritePhyUshort(sc, 0x15, 0x0036);
10497                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10498                 MP_WritePhyUshort(sc, 0x15, 0x0037);
10499                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10500                 MP_WritePhyUshort(sc, 0x15, 0x0038);
10501                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10502                 MP_WritePhyUshort(sc, 0x15, 0x0039);
10503                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10504                 MP_WritePhyUshort(sc, 0x15, 0x003a);
10505                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10506                 MP_WritePhyUshort(sc, 0x15, 0x003b);
10507                 MP_WritePhyUshort(sc, 0x19, 0x63e8);
10508                 MP_WritePhyUshort(sc, 0x15, 0x003c);
10509                 MP_WritePhyUshort(sc, 0x19, 0x7d00);
10510                 MP_WritePhyUshort(sc, 0x15, 0x003d);
10511                 MP_WritePhyUshort(sc, 0x19, 0x59d4);
10512                 MP_WritePhyUshort(sc, 0x15, 0x003e);
10513                 MP_WritePhyUshort(sc, 0x19, 0x63f8);
10514                 MP_WritePhyUshort(sc, 0x15, 0x0040);
10515                 MP_WritePhyUshort(sc, 0x19, 0x64a1);
10516                 MP_WritePhyUshort(sc, 0x15, 0x0041);
10517                 MP_WritePhyUshort(sc, 0x19, 0x30de);
10518                 MP_WritePhyUshort(sc, 0x15, 0x0044);
10519                 MP_WritePhyUshort(sc, 0x19, 0x480f);
10520                 MP_WritePhyUshort(sc, 0x15, 0x0045);
10521                 MP_WritePhyUshort(sc, 0x19, 0x6800);
10522                 MP_WritePhyUshort(sc, 0x15, 0x0046);
10523                 MP_WritePhyUshort(sc, 0x19, 0x6680);
10524                 MP_WritePhyUshort(sc, 0x15, 0x0047);
10525                 MP_WritePhyUshort(sc, 0x19, 0x7c10);
10526                 MP_WritePhyUshort(sc, 0x15, 0x0048);
10527                 MP_WritePhyUshort(sc, 0x19, 0x63c8);
10528                 MP_WritePhyUshort(sc, 0x15, 0x0049);
10529                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10530                 MP_WritePhyUshort(sc, 0x15, 0x004a);
10531                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10532                 MP_WritePhyUshort(sc, 0x15, 0x004b);
10533                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10534                 MP_WritePhyUshort(sc, 0x15, 0x004c);
10535                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10536                 MP_WritePhyUshort(sc, 0x15, 0x004d);
10537                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10538                 MP_WritePhyUshort(sc, 0x15, 0x004e);
10539                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10540                 MP_WritePhyUshort(sc, 0x15, 0x004f);
10541                 MP_WritePhyUshort(sc, 0x19, 0x40ea);
10542                 MP_WritePhyUshort(sc, 0x15, 0x0050);
10543                 MP_WritePhyUshort(sc, 0x19, 0x4503);
10544                 MP_WritePhyUshort(sc, 0x15, 0x0051);
10545                 MP_WritePhyUshort(sc, 0x19, 0x58ca);
10546                 MP_WritePhyUshort(sc, 0x15, 0x0052);
10547                 MP_WritePhyUshort(sc, 0x19, 0x63c8);
10548                 MP_WritePhyUshort(sc, 0x15, 0x0053);
10549                 MP_WritePhyUshort(sc, 0x19, 0x63d8);
10550                 MP_WritePhyUshort(sc, 0x15, 0x0054);
10551                 MP_WritePhyUshort(sc, 0x19, 0x66a0);
10552                 MP_WritePhyUshort(sc, 0x15, 0x0055);
10553                 MP_WritePhyUshort(sc, 0x19, 0x9f00);
10554                 MP_WritePhyUshort(sc, 0x15, 0x0056);
10555                 MP_WritePhyUshort(sc, 0x19, 0x3000);
10556                 MP_WritePhyUshort(sc, 0x15, 0x00a1);
10557                 MP_WritePhyUshort(sc, 0x19, 0x3044);
10558                 MP_WritePhyUshort(sc, 0x15, 0x00ab);
10559                 MP_WritePhyUshort(sc, 0x19, 0x5820);
10560                 MP_WritePhyUshort(sc, 0x15, 0x00ac);
10561                 MP_WritePhyUshort(sc, 0x19, 0x5e04);
10562                 MP_WritePhyUshort(sc, 0x15, 0x00ad);
10563                 MP_WritePhyUshort(sc, 0x19, 0xb60c);
10564                 MP_WritePhyUshort(sc, 0x15, 0x00af);
10565                 MP_WritePhyUshort(sc, 0x19, 0x000a);
10566                 MP_WritePhyUshort(sc, 0x15, 0x00b2);
10567                 MP_WritePhyUshort(sc, 0x19, 0x30b9);
10568                 MP_WritePhyUshort(sc, 0x15, 0x00b9);
10569                 MP_WritePhyUshort(sc, 0x19, 0x4408);
10570                 MP_WritePhyUshort(sc, 0x15, 0x00ba);
10571                 MP_WritePhyUshort(sc, 0x19, 0x480b);
10572                 MP_WritePhyUshort(sc, 0x15, 0x00bb);
10573                 MP_WritePhyUshort(sc, 0x19, 0x5e00);
10574                 MP_WritePhyUshort(sc, 0x15, 0x00bc);
10575                 MP_WritePhyUshort(sc, 0x19, 0x405f);
10576                 MP_WritePhyUshort(sc, 0x15, 0x00bd);
10577                 MP_WritePhyUshort(sc, 0x19, 0x4448);
10578                 MP_WritePhyUshort(sc, 0x15, 0x00be);
10579                 MP_WritePhyUshort(sc, 0x19, 0x4020);
10580                 MP_WritePhyUshort(sc, 0x15, 0x00bf);
10581                 MP_WritePhyUshort(sc, 0x19, 0x4468);
10582                 MP_WritePhyUshort(sc, 0x15, 0x00c0);
10583                 MP_WritePhyUshort(sc, 0x19, 0x9c02);
10584                 MP_WritePhyUshort(sc, 0x15, 0x00c1);
10585                 MP_WritePhyUshort(sc, 0x19, 0x58a0);
10586                 MP_WritePhyUshort(sc, 0x15, 0x00c2);
10587                 MP_WritePhyUshort(sc, 0x19, 0xb605);
10588                 MP_WritePhyUshort(sc, 0x15, 0x00c3);
10589                 MP_WritePhyUshort(sc, 0x19, 0xc0d3);
10590                 MP_WritePhyUshort(sc, 0x15, 0x00c4);
10591                 MP_WritePhyUshort(sc, 0x19, 0x00e6);
10592                 MP_WritePhyUshort(sc, 0x15, 0x00c5);
10593                 MP_WritePhyUshort(sc, 0x19, 0xdaec);
10594                 MP_WritePhyUshort(sc, 0x15, 0x00c6);
10595                 MP_WritePhyUshort(sc, 0x19, 0x00fa);
10596                 MP_WritePhyUshort(sc, 0x15, 0x00c7);
10597                 MP_WritePhyUshort(sc, 0x19, 0x9df9);
10598                 MP_WritePhyUshort(sc, 0x15, 0x0112);
10599                 MP_WritePhyUshort(sc, 0x19, 0x6421);
10600                 MP_WritePhyUshort(sc, 0x15, 0x0113);
10601                 MP_WritePhyUshort(sc, 0x19, 0x7c08);
10602                 MP_WritePhyUshort(sc, 0x15, 0x0114);
10603                 MP_WritePhyUshort(sc, 0x19, 0x63f0);
10604                 MP_WritePhyUshort(sc, 0x15, 0x0115);
10605                 MP_WritePhyUshort(sc, 0x19, 0x4003);
10606                 MP_WritePhyUshort(sc, 0x15, 0x0116);
10607                 MP_WritePhyUshort(sc, 0x19, 0x4418);
10608                 MP_WritePhyUshort(sc, 0x15, 0x0117);
10609                 MP_WritePhyUshort(sc, 0x19, 0x9b00);
10610                 MP_WritePhyUshort(sc, 0x15, 0x0118);
10611                 MP_WritePhyUshort(sc, 0x19, 0x6461);
10612                 MP_WritePhyUshort(sc, 0x15, 0x0119);
10613                 MP_WritePhyUshort(sc, 0x19, 0x64e1);
10614                 MP_WritePhyUshort(sc, 0x15, 0x011a);
10615                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10616                 MP_WritePhyUshort(sc, 0x15, 0x0150);
10617                 MP_WritePhyUshort(sc, 0x19, 0x7c80);
10618                 MP_WritePhyUshort(sc, 0x15, 0x0151);
10619                 MP_WritePhyUshort(sc, 0x19, 0x6461);
10620                 MP_WritePhyUshort(sc, 0x15, 0x0152);
10621                 MP_WritePhyUshort(sc, 0x19, 0x4003);
10622                 MP_WritePhyUshort(sc, 0x15, 0x0153);
10623                 MP_WritePhyUshort(sc, 0x19, 0x4540);
10624                 MP_WritePhyUshort(sc, 0x15, 0x0154);
10625                 MP_WritePhyUshort(sc, 0x19, 0x9f00);
10626                 MP_WritePhyUshort(sc, 0x15, 0x0155);
10627                 MP_WritePhyUshort(sc, 0x19, 0x9d00);
10628                 MP_WritePhyUshort(sc, 0x15, 0x0156);
10629                 MP_WritePhyUshort(sc, 0x19, 0x7c40);
10630                 MP_WritePhyUshort(sc, 0x15, 0x0157);
10631                 MP_WritePhyUshort(sc, 0x19, 0x6421);
10632                 MP_WritePhyUshort(sc, 0x15, 0x0158);
10633                 MP_WritePhyUshort(sc, 0x19, 0x7c80);
10634                 MP_WritePhyUshort(sc, 0x15, 0x0159);
10635                 MP_WritePhyUshort(sc, 0x19, 0x64a1);
10636                 MP_WritePhyUshort(sc, 0x15, 0x015a);
10637                 MP_WritePhyUshort(sc, 0x19, 0x30fe);
10638                 MP_WritePhyUshort(sc, 0x15, 0x029c);
10639                 MP_WritePhyUshort(sc, 0x19, 0x0070);
10640                 MP_WritePhyUshort(sc, 0x15, 0x02b2);
10641                 MP_WritePhyUshort(sc, 0x19, 0x005a);
10642                 MP_WritePhyUshort(sc, 0x15, 0x02bd);
10643                 MP_WritePhyUshort(sc, 0x19, 0xa522);
10644                 MP_WritePhyUshort(sc, 0x15, 0x02ce);
10645                 MP_WritePhyUshort(sc, 0x19, 0xb63e);
10646                 MP_WritePhyUshort(sc, 0x15, 0x02d9);
10647                 MP_WritePhyUshort(sc, 0x19, 0x32df);
10648                 MP_WritePhyUshort(sc, 0x15, 0x02df);
10649                 MP_WritePhyUshort(sc, 0x19, 0x4500);
10650                 MP_WritePhyUshort(sc, 0x15, 0x02e7);
10651                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10652                 MP_WritePhyUshort(sc, 0x15, 0x02f4);
10653                 MP_WritePhyUshort(sc, 0x19, 0xb618);
10654                 MP_WritePhyUshort(sc, 0x15, 0x02fb);
10655                 MP_WritePhyUshort(sc, 0x19, 0xb900);
10656                 MP_WritePhyUshort(sc, 0x15, 0x02fc);
10657                 MP_WritePhyUshort(sc, 0x19, 0x49b5);
10658                 MP_WritePhyUshort(sc, 0x15, 0x02fd);
10659                 MP_WritePhyUshort(sc, 0x19, 0x6812);
10660                 MP_WritePhyUshort(sc, 0x15, 0x02fe);
10661                 MP_WritePhyUshort(sc, 0x19, 0x66a0);
10662                 MP_WritePhyUshort(sc, 0x15, 0x02ff);
10663                 MP_WritePhyUshort(sc, 0x19, 0x9900);
10664                 MP_WritePhyUshort(sc, 0x15, 0x0300);
10665                 MP_WritePhyUshort(sc, 0x19, 0x64a0);
10666                 MP_WritePhyUshort(sc, 0x15, 0x0301);
10667                 MP_WritePhyUshort(sc, 0x19, 0x3316);
10668                 MP_WritePhyUshort(sc, 0x15, 0x0308);
10669                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10670                 MP_WritePhyUshort(sc, 0x15, 0x030c);
10671                 MP_WritePhyUshort(sc, 0x19, 0x3000);
10672                 MP_WritePhyUshort(sc, 0x15, 0x0312);
10673                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10674                 MP_WritePhyUshort(sc, 0x15, 0x0313);
10675                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10676                 MP_WritePhyUshort(sc, 0x15, 0x0314);
10677                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10678                 MP_WritePhyUshort(sc, 0x15, 0x0315);
10679                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10680                 MP_WritePhyUshort(sc, 0x15, 0x0316);
10681                 MP_WritePhyUshort(sc, 0x19, 0x49b5);
10682                 MP_WritePhyUshort(sc, 0x15, 0x0317);
10683                 MP_WritePhyUshort(sc, 0x19, 0x7d00);
10684                 MP_WritePhyUshort(sc, 0x15, 0x0318);
10685                 MP_WritePhyUshort(sc, 0x19, 0x4d00);
10686                 MP_WritePhyUshort(sc, 0x15, 0x0319);
10687                 MP_WritePhyUshort(sc, 0x19, 0x6810);
10688                 MP_WritePhyUshort(sc, 0x15, 0x031a);
10689                 MP_WritePhyUshort(sc, 0x19, 0x6c08);
10690                 MP_WritePhyUshort(sc, 0x15, 0x031b);
10691                 MP_WritePhyUshort(sc, 0x19, 0x4925);
10692                 MP_WritePhyUshort(sc, 0x15, 0x031c);
10693                 MP_WritePhyUshort(sc, 0x19, 0x403b);
10694                 MP_WritePhyUshort(sc, 0x15, 0x031d);
10695                 MP_WritePhyUshort(sc, 0x19, 0xa602);
10696                 MP_WritePhyUshort(sc, 0x15, 0x031e);
10697                 MP_WritePhyUshort(sc, 0x19, 0x402f);
10698                 MP_WritePhyUshort(sc, 0x15, 0x031f);
10699                 MP_WritePhyUshort(sc, 0x19, 0x4484);
10700                 MP_WritePhyUshort(sc, 0x15, 0x0320);
10701                 MP_WritePhyUshort(sc, 0x19, 0x40c8);
10702                 MP_WritePhyUshort(sc, 0x15, 0x0321);
10703                 MP_WritePhyUshort(sc, 0x19, 0x44c4);
10704                 MP_WritePhyUshort(sc, 0x15, 0x0322);
10705                 MP_WritePhyUshort(sc, 0x19, 0x404f);
10706                 MP_WritePhyUshort(sc, 0x15, 0x0323);
10707                 MP_WritePhyUshort(sc, 0x19, 0x44c8);
10708                 MP_WritePhyUshort(sc, 0x15, 0x0324);
10709                 MP_WritePhyUshort(sc, 0x19, 0xd64f);
10710                 MP_WritePhyUshort(sc, 0x15, 0x0325);
10711                 MP_WritePhyUshort(sc, 0x19, 0x00e7);
10712                 MP_WritePhyUshort(sc, 0x15, 0x0326);
10713                 MP_WritePhyUshort(sc, 0x19, 0x7c08);
10714                 MP_WritePhyUshort(sc, 0x15, 0x0327);
10715                 MP_WritePhyUshort(sc, 0x19, 0x8203);
10716                 MP_WritePhyUshort(sc, 0x15, 0x0328);
10717                 MP_WritePhyUshort(sc, 0x19, 0x4d48);
10718                 MP_WritePhyUshort(sc, 0x15, 0x0329);
10719                 MP_WritePhyUshort(sc, 0x19, 0x332b);
10720                 MP_WritePhyUshort(sc, 0x15, 0x032a);
10721                 MP_WritePhyUshort(sc, 0x19, 0x4d40);
10722                 MP_WritePhyUshort(sc, 0x15, 0x032c);
10723                 MP_WritePhyUshort(sc, 0x19, 0x00f8);
10724                 MP_WritePhyUshort(sc, 0x15, 0x032d);
10725                 MP_WritePhyUshort(sc, 0x19, 0x82b2);
10726                 MP_WritePhyUshort(sc, 0x15, 0x032f);
10727                 MP_WritePhyUshort(sc, 0x19, 0x00b0);
10728                 MP_WritePhyUshort(sc, 0x15, 0x0332);
10729                 MP_WritePhyUshort(sc, 0x19, 0x91f2);
10730                 MP_WritePhyUshort(sc, 0x15, 0x033f);
10731                 MP_WritePhyUshort(sc, 0x19, 0xb6cd);
10732                 MP_WritePhyUshort(sc, 0x15, 0x0340);
10733                 MP_WritePhyUshort(sc, 0x19, 0x9e01);
10734                 MP_WritePhyUshort(sc, 0x15, 0x0341);
10735                 MP_WritePhyUshort(sc, 0x19, 0xd11d);
10736                 MP_WritePhyUshort(sc, 0x15, 0x0342);
10737                 MP_WritePhyUshort(sc, 0x19, 0x009d);
10738                 MP_WritePhyUshort(sc, 0x15, 0x0343);
10739                 MP_WritePhyUshort(sc, 0x19, 0xbb1c);
10740                 MP_WritePhyUshort(sc, 0x15, 0x0344);
10741                 MP_WritePhyUshort(sc, 0x19, 0x8102);
10742                 MP_WritePhyUshort(sc, 0x15, 0x0345);
10743                 MP_WritePhyUshort(sc, 0x19, 0x3348);
10744                 MP_WritePhyUshort(sc, 0x15, 0x0346);
10745                 MP_WritePhyUshort(sc, 0x19, 0xa231);
10746                 MP_WritePhyUshort(sc, 0x15, 0x0347);
10747                 MP_WritePhyUshort(sc, 0x19, 0x335b);
10748                 MP_WritePhyUshort(sc, 0x15, 0x0348);
10749                 MP_WritePhyUshort(sc, 0x19, 0x91f7);
10750                 MP_WritePhyUshort(sc, 0x15, 0x0349);
10751                 MP_WritePhyUshort(sc, 0x19, 0xc218);
10752                 MP_WritePhyUshort(sc, 0x15, 0x034a);
10753                 MP_WritePhyUshort(sc, 0x19, 0x00f5);
10754                 MP_WritePhyUshort(sc, 0x15, 0x034b);
10755                 MP_WritePhyUshort(sc, 0x19, 0x335b);
10756                 MP_WritePhyUshort(sc, 0x15, 0x034c);
10757                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10758                 MP_WritePhyUshort(sc, 0x15, 0x034d);
10759                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10760                 MP_WritePhyUshort(sc, 0x15, 0x034e);
10761                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10762                 MP_WritePhyUshort(sc, 0x15, 0x034f);
10763                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10764                 MP_WritePhyUshort(sc, 0x15, 0x0350);
10765                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10766                 MP_WritePhyUshort(sc, 0x15, 0x035b);
10767                 MP_WritePhyUshort(sc, 0x19, 0xa23c);
10768                 MP_WritePhyUshort(sc, 0x15, 0x035c);
10769                 MP_WritePhyUshort(sc, 0x19, 0x7c08);
10770                 MP_WritePhyUshort(sc, 0x15, 0x035d);
10771                 MP_WritePhyUshort(sc, 0x19, 0x4c00);
10772                 MP_WritePhyUshort(sc, 0x15, 0x035e);
10773                 MP_WritePhyUshort(sc, 0x19, 0x3397);
10774                 MP_WritePhyUshort(sc, 0x15, 0x0363);
10775                 MP_WritePhyUshort(sc, 0x19, 0xb6a9);
10776                 MP_WritePhyUshort(sc, 0x15, 0x0366);
10777                 MP_WritePhyUshort(sc, 0x19, 0x00f5);
10778                 MP_WritePhyUshort(sc, 0x15, 0x0382);
10779                 MP_WritePhyUshort(sc, 0x19, 0x7c40);
10780                 MP_WritePhyUshort(sc, 0x15, 0x0388);
10781                 MP_WritePhyUshort(sc, 0x19, 0x0084);
10782                 MP_WritePhyUshort(sc, 0x15, 0x0389);
10783                 MP_WritePhyUshort(sc, 0x19, 0xdd17);
10784                 MP_WritePhyUshort(sc, 0x15, 0x038a);
10785                 MP_WritePhyUshort(sc, 0x19, 0x000b);
10786                 MP_WritePhyUshort(sc, 0x15, 0x038b);
10787                 MP_WritePhyUshort(sc, 0x19, 0xa10a);
10788                 MP_WritePhyUshort(sc, 0x15, 0x038c);
10789                 MP_WritePhyUshort(sc, 0x19, 0x337e);
10790                 MP_WritePhyUshort(sc, 0x15, 0x038d);
10791                 MP_WritePhyUshort(sc, 0x19, 0x6c0b);
10792                 MP_WritePhyUshort(sc, 0x15, 0x038e);
10793                 MP_WritePhyUshort(sc, 0x19, 0xa107);
10794                 MP_WritePhyUshort(sc, 0x15, 0x038f);
10795                 MP_WritePhyUshort(sc, 0x19, 0x6c08);
10796                 MP_WritePhyUshort(sc, 0x15, 0x0390);
10797                 MP_WritePhyUshort(sc, 0x19, 0xc017);
10798                 MP_WritePhyUshort(sc, 0x15, 0x0391);
10799                 MP_WritePhyUshort(sc, 0x19, 0x0004);
10800                 MP_WritePhyUshort(sc, 0x15, 0x0392);
10801                 MP_WritePhyUshort(sc, 0x19, 0xd64f);
10802                 MP_WritePhyUshort(sc, 0x15, 0x0393);
10803                 MP_WritePhyUshort(sc, 0x19, 0x00f4);
10804                 MP_WritePhyUshort(sc, 0x15, 0x0397);
10805                 MP_WritePhyUshort(sc, 0x19, 0x4098);
10806                 MP_WritePhyUshort(sc, 0x15, 0x0398);
10807                 MP_WritePhyUshort(sc, 0x19, 0x4408);
10808                 MP_WritePhyUshort(sc, 0x15, 0x0399);
10809                 MP_WritePhyUshort(sc, 0x19, 0x55bf);
10810                 MP_WritePhyUshort(sc, 0x15, 0x039a);
10811                 MP_WritePhyUshort(sc, 0x19, 0x4bb9);
10812                 MP_WritePhyUshort(sc, 0x15, 0x039b);
10813                 MP_WritePhyUshort(sc, 0x19, 0x6810);
10814                 MP_WritePhyUshort(sc, 0x15, 0x039c);
10815                 MP_WritePhyUshort(sc, 0x19, 0x4b29);
10816                 MP_WritePhyUshort(sc, 0x15, 0x039d);
10817                 MP_WritePhyUshort(sc, 0x19, 0x4041);
10818                 MP_WritePhyUshort(sc, 0x15, 0x039e);
10819                 MP_WritePhyUshort(sc, 0x19, 0x442a);
10820                 MP_WritePhyUshort(sc, 0x15, 0x039f);
10821                 MP_WritePhyUshort(sc, 0x19, 0x4029);
10822                 MP_WritePhyUshort(sc, 0x15, 0x03aa);
10823                 MP_WritePhyUshort(sc, 0x19, 0x33b8);
10824                 MP_WritePhyUshort(sc, 0x15, 0x03b6);
10825                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10826                 MP_WritePhyUshort(sc, 0x15, 0x03b7);
10827                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10828                 MP_WritePhyUshort(sc, 0x15, 0x03b8);
10829                 MP_WritePhyUshort(sc, 0x19, 0x543f);
10830                 MP_WritePhyUshort(sc, 0x15, 0x03b9);
10831                 MP_WritePhyUshort(sc, 0x19, 0x499a);
10832                 MP_WritePhyUshort(sc, 0x15, 0x03ba);
10833                 MP_WritePhyUshort(sc, 0x19, 0x7c40);
10834                 MP_WritePhyUshort(sc, 0x15, 0x03bb);
10835                 MP_WritePhyUshort(sc, 0x19, 0x4c40);
10836                 MP_WritePhyUshort(sc, 0x15, 0x03bc);
10837                 MP_WritePhyUshort(sc, 0x19, 0x490a);
10838                 MP_WritePhyUshort(sc, 0x15, 0x03bd);
10839                 MP_WritePhyUshort(sc, 0x19, 0x405e);
10840                 MP_WritePhyUshort(sc, 0x15, 0x03c2);
10841                 MP_WritePhyUshort(sc, 0x19, 0x9a03);
10842                 MP_WritePhyUshort(sc, 0x15, 0x03c4);
10843                 MP_WritePhyUshort(sc, 0x19, 0x0015);
10844                 MP_WritePhyUshort(sc, 0x15, 0x03c5);
10845                 MP_WritePhyUshort(sc, 0x19, 0x9e03);
10846                 MP_WritePhyUshort(sc, 0x15, 0x03c8);
10847                 MP_WritePhyUshort(sc, 0x19, 0x9cf7);
10848                 MP_WritePhyUshort(sc, 0x15, 0x03c9);
10849                 MP_WritePhyUshort(sc, 0x19, 0x7c12);
10850                 MP_WritePhyUshort(sc, 0x15, 0x03ca);
10851                 MP_WritePhyUshort(sc, 0x19, 0x4c52);
10852                 MP_WritePhyUshort(sc, 0x15, 0x03cb);
10853                 MP_WritePhyUshort(sc, 0x19, 0x4458);
10854                 MP_WritePhyUshort(sc, 0x15, 0x03cd);
10855                 MP_WritePhyUshort(sc, 0x19, 0x4c40);
10856                 MP_WritePhyUshort(sc, 0x15, 0x03ce);
10857                 MP_WritePhyUshort(sc, 0x19, 0x33bf);
10858                 MP_WritePhyUshort(sc, 0x15, 0x03cf);
10859                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10860                 MP_WritePhyUshort(sc, 0x15, 0x03d0);
10861                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10862                 MP_WritePhyUshort(sc, 0x15, 0x03d1);
10863                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10864                 MP_WritePhyUshort(sc, 0x15, 0x03d5);
10865                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10866                 MP_WritePhyUshort(sc, 0x15, 0x03d6);
10867                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10868                 MP_WritePhyUshort(sc, 0x15, 0x03d7);
10869                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10870                 MP_WritePhyUshort(sc, 0x15, 0x03d8);
10871                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10872                 MP_WritePhyUshort(sc, 0x15, 0x03d9);
10873                 MP_WritePhyUshort(sc, 0x19, 0x49bb);
10874                 MP_WritePhyUshort(sc, 0x15, 0x03da);
10875                 MP_WritePhyUshort(sc, 0x19, 0x4478);
10876                 MP_WritePhyUshort(sc, 0x15, 0x03db);
10877                 MP_WritePhyUshort(sc, 0x19, 0x492b);
10878                 MP_WritePhyUshort(sc, 0x15, 0x03dc);
10879                 MP_WritePhyUshort(sc, 0x19, 0x7c01);
10880                 MP_WritePhyUshort(sc, 0x15, 0x03dd);
10881                 MP_WritePhyUshort(sc, 0x19, 0x4c00);
10882                 MP_WritePhyUshort(sc, 0x15, 0x03de);
10883                 MP_WritePhyUshort(sc, 0x19, 0xbd1a);
10884                 MP_WritePhyUshort(sc, 0x15, 0x03df);
10885                 MP_WritePhyUshort(sc, 0x19, 0xc428);
10886                 MP_WritePhyUshort(sc, 0x15, 0x03e0);
10887                 MP_WritePhyUshort(sc, 0x19, 0x0008);
10888                 MP_WritePhyUshort(sc, 0x15, 0x03e1);
10889                 MP_WritePhyUshort(sc, 0x19, 0x9cfd);
10890                 MP_WritePhyUshort(sc, 0x15, 0x03e2);
10891                 MP_WritePhyUshort(sc, 0x19, 0x7c12);
10892                 MP_WritePhyUshort(sc, 0x15, 0x03e3);
10893                 MP_WritePhyUshort(sc, 0x19, 0x4c52);
10894                 MP_WritePhyUshort(sc, 0x15, 0x03e4);
10895                 MP_WritePhyUshort(sc, 0x19, 0x4458);
10896                 MP_WritePhyUshort(sc, 0x15, 0x03e5);
10897                 MP_WritePhyUshort(sc, 0x19, 0x7c12);
10898                 MP_WritePhyUshort(sc, 0x15, 0x03e6);
10899                 MP_WritePhyUshort(sc, 0x19, 0x4c40);
10900                 MP_WritePhyUshort(sc, 0x15, 0x03e7);
10901                 MP_WritePhyUshort(sc, 0x19, 0x33de);
10902                 MP_WritePhyUshort(sc, 0x15, 0x03e8);
10903                 MP_WritePhyUshort(sc, 0x19, 0xc218);
10904                 MP_WritePhyUshort(sc, 0x15, 0x03e9);
10905                 MP_WritePhyUshort(sc, 0x19, 0x0002);
10906                 MP_WritePhyUshort(sc, 0x15, 0x03ea);
10907                 MP_WritePhyUshort(sc, 0x19, 0x32df);
10908                 MP_WritePhyUshort(sc, 0x15, 0x03eb);
10909                 MP_WritePhyUshort(sc, 0x19, 0x3316);
10910                 MP_WritePhyUshort(sc, 0x15, 0x03ec);
10911                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10912                 MP_WritePhyUshort(sc, 0x15, 0x03ed);
10913                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10914                 MP_WritePhyUshort(sc, 0x15, 0x03ee);
10915                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10916                 MP_WritePhyUshort(sc, 0x15, 0x03ef);
10917                 MP_WritePhyUshort(sc, 0x19, 0x0000);
10918                 MP_WritePhyUshort(sc, 0x15, 0x03f7);
10919                 MP_WritePhyUshort(sc, 0x19, 0x330c);
10920                 MP_WritePhyUshort(sc, 0x16, 0x0306);
10921                 MP_WritePhyUshort(sc, 0x16, 0x0300);
10922                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
10923                 MP_WritePhyUshort(sc, 0x05, 0xfff6);
10924                 MP_WritePhyUshort(sc, 0x06, 0x0080);
10925                 MP_WritePhyUshort(sc, 0x05, 0x8000);
10926                 MP_WritePhyUshort(sc, 0x06, 0x0280);
10927                 MP_WritePhyUshort(sc, 0x06, 0x48f7);
10928                 MP_WritePhyUshort(sc, 0x06, 0x00e0);
10929                 MP_WritePhyUshort(sc, 0x06, 0xfff7);
10930                 MP_WritePhyUshort(sc, 0x06, 0xa080);
10931                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
10932                 MP_WritePhyUshort(sc, 0x06, 0xf602);
10933                 MP_WritePhyUshort(sc, 0x06, 0x0200);
10934                 MP_WritePhyUshort(sc, 0x06, 0x0280);
10935                 MP_WritePhyUshort(sc, 0x06, 0x9002);
10936                 MP_WritePhyUshort(sc, 0x06, 0x0224);
10937                 MP_WritePhyUshort(sc, 0x06, 0x0202);
10938                 MP_WritePhyUshort(sc, 0x06, 0x3402);
10939                 MP_WritePhyUshort(sc, 0x06, 0x027f);
10940                 MP_WritePhyUshort(sc, 0x06, 0x0280);
10941                 MP_WritePhyUshort(sc, 0x06, 0xa602);
10942                 MP_WritePhyUshort(sc, 0x06, 0x80bf);
10943                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
10944                 MP_WritePhyUshort(sc, 0x06, 0x88e1);
10945                 MP_WritePhyUshort(sc, 0x06, 0x8b89);
10946                 MP_WritePhyUshort(sc, 0x06, 0x1e01);
10947                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
10948                 MP_WritePhyUshort(sc, 0x06, 0x8a1e);
10949                 MP_WritePhyUshort(sc, 0x06, 0x01e1);
10950                 MP_WritePhyUshort(sc, 0x06, 0x8b8b);
10951                 MP_WritePhyUshort(sc, 0x06, 0x1e01);
10952                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
10953                 MP_WritePhyUshort(sc, 0x06, 0x8c1e);
10954                 MP_WritePhyUshort(sc, 0x06, 0x01e1);
10955                 MP_WritePhyUshort(sc, 0x06, 0x8b8d);
10956                 MP_WritePhyUshort(sc, 0x06, 0x1e01);
10957                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
10958                 MP_WritePhyUshort(sc, 0x06, 0x8e1e);
10959                 MP_WritePhyUshort(sc, 0x06, 0x01a0);
10960                 MP_WritePhyUshort(sc, 0x06, 0x00c7);
10961                 MP_WritePhyUshort(sc, 0x06, 0xaebb);
10962                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
10963                 MP_WritePhyUshort(sc, 0x06, 0xe600);
10964                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
10965                 MP_WritePhyUshort(sc, 0x06, 0xee03);
10966                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
10967                 MP_WritePhyUshort(sc, 0x06, 0xefb8);
10968                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
10969                 MP_WritePhyUshort(sc, 0x06, 0xe902);
10970                 MP_WritePhyUshort(sc, 0x06, 0xee8b);
10971                 MP_WritePhyUshort(sc, 0x06, 0x8285);
10972                 MP_WritePhyUshort(sc, 0x06, 0xee8b);
10973                 MP_WritePhyUshort(sc, 0x06, 0x8520);
10974                 MP_WritePhyUshort(sc, 0x06, 0xee8b);
10975                 MP_WritePhyUshort(sc, 0x06, 0x8701);
10976                 MP_WritePhyUshort(sc, 0x06, 0xd481);
10977                 MP_WritePhyUshort(sc, 0x06, 0x35e4);
10978                 MP_WritePhyUshort(sc, 0x06, 0x8b94);
10979                 MP_WritePhyUshort(sc, 0x06, 0xe58b);
10980                 MP_WritePhyUshort(sc, 0x06, 0x95bf);
10981                 MP_WritePhyUshort(sc, 0x06, 0x8b88);
10982                 MP_WritePhyUshort(sc, 0x06, 0xec00);
10983                 MP_WritePhyUshort(sc, 0x06, 0x19a9);
10984                 MP_WritePhyUshort(sc, 0x06, 0x8b90);
10985                 MP_WritePhyUshort(sc, 0x06, 0xf9ee);
10986                 MP_WritePhyUshort(sc, 0x06, 0xfff6);
10987                 MP_WritePhyUshort(sc, 0x06, 0x00ee);
10988                 MP_WritePhyUshort(sc, 0x06, 0xfff7);
10989                 MP_WritePhyUshort(sc, 0x06, 0xffe0);
10990                 MP_WritePhyUshort(sc, 0x06, 0xe140);
10991                 MP_WritePhyUshort(sc, 0x06, 0xe1e1);
10992                 MP_WritePhyUshort(sc, 0x06, 0x41f7);
10993                 MP_WritePhyUshort(sc, 0x06, 0x2ff6);
10994                 MP_WritePhyUshort(sc, 0x06, 0x28e4);
10995                 MP_WritePhyUshort(sc, 0x06, 0xe140);
10996                 MP_WritePhyUshort(sc, 0x06, 0xe5e1);
10997                 MP_WritePhyUshort(sc, 0x06, 0x4104);
10998                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
10999                 MP_WritePhyUshort(sc, 0x06, 0x8b89);
11000                 MP_WritePhyUshort(sc, 0x06, 0xad20);
11001                 MP_WritePhyUshort(sc, 0x06, 0x0dee);
11002                 MP_WritePhyUshort(sc, 0x06, 0x8b89);
11003                 MP_WritePhyUshort(sc, 0x06, 0x0002);
11004                 MP_WritePhyUshort(sc, 0x06, 0x82f4);
11005                 MP_WritePhyUshort(sc, 0x06, 0x021f);
11006                 MP_WritePhyUshort(sc, 0x06, 0x4102);
11007                 MP_WritePhyUshort(sc, 0x06, 0x2812);
11008                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
11009                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
11010                 MP_WritePhyUshort(sc, 0x06, 0x8b8d);
11011                 MP_WritePhyUshort(sc, 0x06, 0xad20);
11012                 MP_WritePhyUshort(sc, 0x06, 0x10ee);
11013                 MP_WritePhyUshort(sc, 0x06, 0x8b8d);
11014                 MP_WritePhyUshort(sc, 0x06, 0x0002);
11015                 MP_WritePhyUshort(sc, 0x06, 0x139d);
11016                 MP_WritePhyUshort(sc, 0x06, 0x0281);
11017                 MP_WritePhyUshort(sc, 0x06, 0xd602);
11018                 MP_WritePhyUshort(sc, 0x06, 0x1f99);
11019                 MP_WritePhyUshort(sc, 0x06, 0x0227);
11020                 MP_WritePhyUshort(sc, 0x06, 0xeafc);
11021                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
11022                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
11023                 MP_WritePhyUshort(sc, 0x06, 0x8ead);
11024                 MP_WritePhyUshort(sc, 0x06, 0x2014);
11025                 MP_WritePhyUshort(sc, 0x06, 0xf620);
11026                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
11027                 MP_WritePhyUshort(sc, 0x06, 0x8e02);
11028                 MP_WritePhyUshort(sc, 0x06, 0x8104);
11029                 MP_WritePhyUshort(sc, 0x06, 0x021b);
11030                 MP_WritePhyUshort(sc, 0x06, 0xf402);
11031                 MP_WritePhyUshort(sc, 0x06, 0x2c9c);
11032                 MP_WritePhyUshort(sc, 0x06, 0x0281);
11033                 MP_WritePhyUshort(sc, 0x06, 0x7902);
11034                 MP_WritePhyUshort(sc, 0x06, 0x8443);
11035                 MP_WritePhyUshort(sc, 0x06, 0xad22);
11036                 MP_WritePhyUshort(sc, 0x06, 0x11f6);
11037                 MP_WritePhyUshort(sc, 0x06, 0x22e4);
11038                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
11039                 MP_WritePhyUshort(sc, 0x06, 0x022c);
11040                 MP_WritePhyUshort(sc, 0x06, 0x4602);
11041                 MP_WritePhyUshort(sc, 0x06, 0x2ac5);
11042                 MP_WritePhyUshort(sc, 0x06, 0x0229);
11043                 MP_WritePhyUshort(sc, 0x06, 0x2002);
11044                 MP_WritePhyUshort(sc, 0x06, 0x2b91);
11045                 MP_WritePhyUshort(sc, 0x06, 0xad25);
11046                 MP_WritePhyUshort(sc, 0x06, 0x11f6);
11047                 MP_WritePhyUshort(sc, 0x06, 0x25e4);
11048                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
11049                 MP_WritePhyUshort(sc, 0x06, 0x0284);
11050                 MP_WritePhyUshort(sc, 0x06, 0xe202);
11051                 MP_WritePhyUshort(sc, 0x06, 0x043a);
11052                 MP_WritePhyUshort(sc, 0x06, 0x021a);
11053                 MP_WritePhyUshort(sc, 0x06, 0x5902);
11054                 MP_WritePhyUshort(sc, 0x06, 0x2bfc);
11055                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
11056                 MP_WritePhyUshort(sc, 0x06, 0xf8fa);
11057                 MP_WritePhyUshort(sc, 0x06, 0xef69);
11058                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
11059                 MP_WritePhyUshort(sc, 0x06, 0x00e1);
11060                 MP_WritePhyUshort(sc, 0x06, 0xe001);
11061                 MP_WritePhyUshort(sc, 0x06, 0xad27);
11062                 MP_WritePhyUshort(sc, 0x06, 0x1fd1);
11063                 MP_WritePhyUshort(sc, 0x06, 0x01bf);
11064                 MP_WritePhyUshort(sc, 0x06, 0x8638);
11065                 MP_WritePhyUshort(sc, 0x06, 0x022f);
11066                 MP_WritePhyUshort(sc, 0x06, 0x50e0);
11067                 MP_WritePhyUshort(sc, 0x06, 0xe020);
11068                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
11069                 MP_WritePhyUshort(sc, 0x06, 0x21ad);
11070                 MP_WritePhyUshort(sc, 0x06, 0x200e);
11071                 MP_WritePhyUshort(sc, 0x06, 0xd100);
11072                 MP_WritePhyUshort(sc, 0x06, 0xbf86);
11073                 MP_WritePhyUshort(sc, 0x06, 0x3802);
11074                 MP_WritePhyUshort(sc, 0x06, 0x2f50);
11075                 MP_WritePhyUshort(sc, 0x06, 0xbf3d);
11076                 MP_WritePhyUshort(sc, 0x06, 0x3902);
11077                 MP_WritePhyUshort(sc, 0x06, 0x2eb0);
11078                 MP_WritePhyUshort(sc, 0x06, 0xef96);
11079                 MP_WritePhyUshort(sc, 0x06, 0xfefc);
11080                 MP_WritePhyUshort(sc, 0x06, 0x0402);
11081                 MP_WritePhyUshort(sc, 0x06, 0x8591);
11082                 MP_WritePhyUshort(sc, 0x06, 0x0281);
11083                 MP_WritePhyUshort(sc, 0x06, 0x3c05);
11084                 MP_WritePhyUshort(sc, 0x06, 0xf8fa);
11085                 MP_WritePhyUshort(sc, 0x06, 0xef69);
11086                 MP_WritePhyUshort(sc, 0x06, 0xe0e2);
11087                 MP_WritePhyUshort(sc, 0x06, 0xfee1);
11088                 MP_WritePhyUshort(sc, 0x06, 0xe2ff);
11089                 MP_WritePhyUshort(sc, 0x06, 0xad2d);
11090                 MP_WritePhyUshort(sc, 0x06, 0x1ae0);
11091                 MP_WritePhyUshort(sc, 0x06, 0xe14e);
11092                 MP_WritePhyUshort(sc, 0x06, 0xe1e1);
11093                 MP_WritePhyUshort(sc, 0x06, 0x4fac);
11094                 MP_WritePhyUshort(sc, 0x06, 0x2d22);
11095                 MP_WritePhyUshort(sc, 0x06, 0xf603);
11096                 MP_WritePhyUshort(sc, 0x06, 0x0203);
11097                 MP_WritePhyUshort(sc, 0x06, 0x36f7);
11098                 MP_WritePhyUshort(sc, 0x06, 0x03f7);
11099                 MP_WritePhyUshort(sc, 0x06, 0x06bf);
11100                 MP_WritePhyUshort(sc, 0x06, 0x8622);
11101                 MP_WritePhyUshort(sc, 0x06, 0x022e);
11102                 MP_WritePhyUshort(sc, 0x06, 0xb0ae);
11103                 MP_WritePhyUshort(sc, 0x06, 0x11e0);
11104                 MP_WritePhyUshort(sc, 0x06, 0xe14e);
11105                 MP_WritePhyUshort(sc, 0x06, 0xe1e1);
11106                 MP_WritePhyUshort(sc, 0x06, 0x4fad);
11107                 MP_WritePhyUshort(sc, 0x06, 0x2d08);
11108                 MP_WritePhyUshort(sc, 0x06, 0xbf86);
11109                 MP_WritePhyUshort(sc, 0x06, 0x2d02);
11110                 MP_WritePhyUshort(sc, 0x06, 0x2eb0);
11111                 MP_WritePhyUshort(sc, 0x06, 0xf606);
11112                 MP_WritePhyUshort(sc, 0x06, 0xef96);
11113                 MP_WritePhyUshort(sc, 0x06, 0xfefc);
11114                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
11115                 MP_WritePhyUshort(sc, 0x06, 0xf9fa);
11116                 MP_WritePhyUshort(sc, 0x06, 0xef69);
11117                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
11118                 MP_WritePhyUshort(sc, 0x06, 0x87ad);
11119                 MP_WritePhyUshort(sc, 0x06, 0x204c);
11120                 MP_WritePhyUshort(sc, 0x06, 0xd200);
11121                 MP_WritePhyUshort(sc, 0x06, 0xe0e2);
11122                 MP_WritePhyUshort(sc, 0x06, 0x0058);
11123                 MP_WritePhyUshort(sc, 0x06, 0x010c);
11124                 MP_WritePhyUshort(sc, 0x06, 0x021e);
11125                 MP_WritePhyUshort(sc, 0x06, 0x20e0);
11126                 MP_WritePhyUshort(sc, 0x06, 0xe000);
11127                 MP_WritePhyUshort(sc, 0x06, 0x5810);
11128                 MP_WritePhyUshort(sc, 0x06, 0x1e20);
11129                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
11130                 MP_WritePhyUshort(sc, 0x06, 0x3658);
11131                 MP_WritePhyUshort(sc, 0x06, 0x031e);
11132                 MP_WritePhyUshort(sc, 0x06, 0x20e0);
11133                 MP_WritePhyUshort(sc, 0x06, 0xe022);
11134                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
11135                 MP_WritePhyUshort(sc, 0x06, 0x2358);
11136                 MP_WritePhyUshort(sc, 0x06, 0xe01e);
11137                 MP_WritePhyUshort(sc, 0x06, 0x20e0);
11138                 MP_WritePhyUshort(sc, 0x06, 0x8ae6);
11139                 MP_WritePhyUshort(sc, 0x06, 0x1f02);
11140                 MP_WritePhyUshort(sc, 0x06, 0x9e22);
11141                 MP_WritePhyUshort(sc, 0x06, 0xe68a);
11142                 MP_WritePhyUshort(sc, 0x06, 0xe6ad);
11143                 MP_WritePhyUshort(sc, 0x06, 0x3214);
11144                 MP_WritePhyUshort(sc, 0x06, 0xad34);
11145                 MP_WritePhyUshort(sc, 0x06, 0x11ef);
11146                 MP_WritePhyUshort(sc, 0x06, 0x0258);
11147                 MP_WritePhyUshort(sc, 0x06, 0x039e);
11148                 MP_WritePhyUshort(sc, 0x06, 0x07ad);
11149                 MP_WritePhyUshort(sc, 0x06, 0x3508);
11150                 MP_WritePhyUshort(sc, 0x06, 0x5ac0);
11151                 MP_WritePhyUshort(sc, 0x06, 0x9f04);
11152                 MP_WritePhyUshort(sc, 0x06, 0xd101);
11153                 MP_WritePhyUshort(sc, 0x06, 0xae02);
11154                 MP_WritePhyUshort(sc, 0x06, 0xd100);
11155                 MP_WritePhyUshort(sc, 0x06, 0xbf86);
11156                 MP_WritePhyUshort(sc, 0x06, 0x3e02);
11157                 MP_WritePhyUshort(sc, 0x06, 0x2f50);
11158                 MP_WritePhyUshort(sc, 0x06, 0xef96);
11159                 MP_WritePhyUshort(sc, 0x06, 0xfefd);
11160                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
11161                 MP_WritePhyUshort(sc, 0x06, 0xf8f9);
11162                 MP_WritePhyUshort(sc, 0x06, 0xfae0);
11163                 MP_WritePhyUshort(sc, 0x06, 0x8b81);
11164                 MP_WritePhyUshort(sc, 0x06, 0xac26);
11165                 MP_WritePhyUshort(sc, 0x06, 0x0ee0);
11166                 MP_WritePhyUshort(sc, 0x06, 0x8b81);
11167                 MP_WritePhyUshort(sc, 0x06, 0xac21);
11168                 MP_WritePhyUshort(sc, 0x06, 0x08e0);
11169                 MP_WritePhyUshort(sc, 0x06, 0x8b87);
11170                 MP_WritePhyUshort(sc, 0x06, 0xac24);
11171                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
11172                 MP_WritePhyUshort(sc, 0x06, 0x6bee);
11173                 MP_WritePhyUshort(sc, 0x06, 0xe0ea);
11174                 MP_WritePhyUshort(sc, 0x06, 0x00ee);
11175                 MP_WritePhyUshort(sc, 0x06, 0xe0eb);
11176                 MP_WritePhyUshort(sc, 0x06, 0x00e2);
11177                 MP_WritePhyUshort(sc, 0x06, 0xe07c);
11178                 MP_WritePhyUshort(sc, 0x06, 0xe3e0);
11179                 MP_WritePhyUshort(sc, 0x06, 0x7da5);
11180                 MP_WritePhyUshort(sc, 0x06, 0x1111);
11181                 MP_WritePhyUshort(sc, 0x06, 0x15d2);
11182                 MP_WritePhyUshort(sc, 0x06, 0x60d6);
11183                 MP_WritePhyUshort(sc, 0x06, 0x6666);
11184                 MP_WritePhyUshort(sc, 0x06, 0x0207);
11185                 MP_WritePhyUshort(sc, 0x06, 0xf9d2);
11186                 MP_WritePhyUshort(sc, 0x06, 0xa0d6);
11187                 MP_WritePhyUshort(sc, 0x06, 0xaaaa);
11188                 MP_WritePhyUshort(sc, 0x06, 0x0207);
11189                 MP_WritePhyUshort(sc, 0x06, 0xf902);
11190                 MP_WritePhyUshort(sc, 0x06, 0x825c);
11191                 MP_WritePhyUshort(sc, 0x06, 0xae44);
11192                 MP_WritePhyUshort(sc, 0x06, 0xa566);
11193                 MP_WritePhyUshort(sc, 0x06, 0x6602);
11194                 MP_WritePhyUshort(sc, 0x06, 0xae38);
11195                 MP_WritePhyUshort(sc, 0x06, 0xa5aa);
11196                 MP_WritePhyUshort(sc, 0x06, 0xaa02);
11197                 MP_WritePhyUshort(sc, 0x06, 0xae32);
11198                 MP_WritePhyUshort(sc, 0x06, 0xeee0);
11199                 MP_WritePhyUshort(sc, 0x06, 0xea04);
11200                 MP_WritePhyUshort(sc, 0x06, 0xeee0);
11201                 MP_WritePhyUshort(sc, 0x06, 0xeb06);
11202                 MP_WritePhyUshort(sc, 0x06, 0xe2e0);
11203                 MP_WritePhyUshort(sc, 0x06, 0x7ce3);
11204                 MP_WritePhyUshort(sc, 0x06, 0xe07d);
11205                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
11206                 MP_WritePhyUshort(sc, 0x06, 0x38e1);
11207                 MP_WritePhyUshort(sc, 0x06, 0xe039);
11208                 MP_WritePhyUshort(sc, 0x06, 0xad2e);
11209                 MP_WritePhyUshort(sc, 0x06, 0x21ad);
11210                 MP_WritePhyUshort(sc, 0x06, 0x3f13);
11211                 MP_WritePhyUshort(sc, 0x06, 0xe0e4);
11212                 MP_WritePhyUshort(sc, 0x06, 0x14e1);
11213                 MP_WritePhyUshort(sc, 0x06, 0xe415);
11214                 MP_WritePhyUshort(sc, 0x06, 0x6880);
11215                 MP_WritePhyUshort(sc, 0x06, 0xe4e4);
11216                 MP_WritePhyUshort(sc, 0x06, 0x14e5);
11217                 MP_WritePhyUshort(sc, 0x06, 0xe415);
11218                 MP_WritePhyUshort(sc, 0x06, 0x0282);
11219                 MP_WritePhyUshort(sc, 0x06, 0x5cae);
11220                 MP_WritePhyUshort(sc, 0x06, 0x0bac);
11221                 MP_WritePhyUshort(sc, 0x06, 0x3e02);
11222                 MP_WritePhyUshort(sc, 0x06, 0xae06);
11223                 MP_WritePhyUshort(sc, 0x06, 0x0282);
11224                 MP_WritePhyUshort(sc, 0x06, 0x8602);
11225                 MP_WritePhyUshort(sc, 0x06, 0x82b0);
11226                 MP_WritePhyUshort(sc, 0x06, 0xfefd);
11227                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
11228                 MP_WritePhyUshort(sc, 0x06, 0xf8e1);
11229                 MP_WritePhyUshort(sc, 0x06, 0x8b2e);
11230                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
11231                 MP_WritePhyUshort(sc, 0x06, 0x81ad);
11232                 MP_WritePhyUshort(sc, 0x06, 0x2605);
11233                 MP_WritePhyUshort(sc, 0x06, 0x0221);
11234                 MP_WritePhyUshort(sc, 0x06, 0xf3f7);
11235                 MP_WritePhyUshort(sc, 0x06, 0x28e0);
11236                 MP_WritePhyUshort(sc, 0x06, 0x8b81);
11237                 MP_WritePhyUshort(sc, 0x06, 0xad21);
11238                 MP_WritePhyUshort(sc, 0x06, 0x0502);
11239                 MP_WritePhyUshort(sc, 0x06, 0x22f8);
11240                 MP_WritePhyUshort(sc, 0x06, 0xf729);
11241                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
11242                 MP_WritePhyUshort(sc, 0x06, 0x87ad);
11243                 MP_WritePhyUshort(sc, 0x06, 0x2405);
11244                 MP_WritePhyUshort(sc, 0x06, 0x0282);
11245                 MP_WritePhyUshort(sc, 0x06, 0xebf7);
11246                 MP_WritePhyUshort(sc, 0x06, 0x2ae5);
11247                 MP_WritePhyUshort(sc, 0x06, 0x8b2e);
11248                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
11249                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
11250                 MP_WritePhyUshort(sc, 0x06, 0x8b81);
11251                 MP_WritePhyUshort(sc, 0x06, 0xad26);
11252                 MP_WritePhyUshort(sc, 0x06, 0x0302);
11253                 MP_WritePhyUshort(sc, 0x06, 0x2134);
11254                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
11255                 MP_WritePhyUshort(sc, 0x06, 0x81ad);
11256                 MP_WritePhyUshort(sc, 0x06, 0x2109);
11257                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
11258                 MP_WritePhyUshort(sc, 0x06, 0x2eac);
11259                 MP_WritePhyUshort(sc, 0x06, 0x2003);
11260                 MP_WritePhyUshort(sc, 0x06, 0x0283);
11261                 MP_WritePhyUshort(sc, 0x06, 0x52e0);
11262                 MP_WritePhyUshort(sc, 0x06, 0x8b87);
11263                 MP_WritePhyUshort(sc, 0x06, 0xad24);
11264                 MP_WritePhyUshort(sc, 0x06, 0x09e0);
11265                 MP_WritePhyUshort(sc, 0x06, 0x8b2e);
11266                 MP_WritePhyUshort(sc, 0x06, 0xac21);
11267                 MP_WritePhyUshort(sc, 0x06, 0x0302);
11268                 MP_WritePhyUshort(sc, 0x06, 0x8337);
11269                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
11270                 MP_WritePhyUshort(sc, 0x06, 0xf8e1);
11271                 MP_WritePhyUshort(sc, 0x06, 0x8b2e);
11272                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
11273                 MP_WritePhyUshort(sc, 0x06, 0x81ad);
11274                 MP_WritePhyUshort(sc, 0x06, 0x2608);
11275                 MP_WritePhyUshort(sc, 0x06, 0xe085);
11276                 MP_WritePhyUshort(sc, 0x06, 0xd2ad);
11277                 MP_WritePhyUshort(sc, 0x06, 0x2502);
11278                 MP_WritePhyUshort(sc, 0x06, 0xf628);
11279                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
11280                 MP_WritePhyUshort(sc, 0x06, 0x81ad);
11281                 MP_WritePhyUshort(sc, 0x06, 0x210a);
11282                 MP_WritePhyUshort(sc, 0x06, 0xe086);
11283                 MP_WritePhyUshort(sc, 0x06, 0x0af6);
11284                 MP_WritePhyUshort(sc, 0x06, 0x27a0);
11285                 MP_WritePhyUshort(sc, 0x06, 0x0502);
11286                 MP_WritePhyUshort(sc, 0x06, 0xf629);
11287                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
11288                 MP_WritePhyUshort(sc, 0x06, 0x87ad);
11289                 MP_WritePhyUshort(sc, 0x06, 0x2408);
11290                 MP_WritePhyUshort(sc, 0x06, 0xe08a);
11291                 MP_WritePhyUshort(sc, 0x06, 0xedad);
11292                 MP_WritePhyUshort(sc, 0x06, 0x2002);
11293                 MP_WritePhyUshort(sc, 0x06, 0xf62a);
11294                 MP_WritePhyUshort(sc, 0x06, 0xe58b);
11295                 MP_WritePhyUshort(sc, 0x06, 0x2ea1);
11296                 MP_WritePhyUshort(sc, 0x06, 0x0003);
11297                 MP_WritePhyUshort(sc, 0x06, 0x0221);
11298                 MP_WritePhyUshort(sc, 0x06, 0x11fc);
11299                 MP_WritePhyUshort(sc, 0x06, 0x04ee);
11300                 MP_WritePhyUshort(sc, 0x06, 0x8aed);
11301                 MP_WritePhyUshort(sc, 0x06, 0x00ee);
11302                 MP_WritePhyUshort(sc, 0x06, 0x8aec);
11303                 MP_WritePhyUshort(sc, 0x06, 0x0004);
11304                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
11305                 MP_WritePhyUshort(sc, 0x06, 0x8b87);
11306                 MP_WritePhyUshort(sc, 0x06, 0xad24);
11307                 MP_WritePhyUshort(sc, 0x06, 0x3ae0);
11308                 MP_WritePhyUshort(sc, 0x06, 0xe0ea);
11309                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
11310                 MP_WritePhyUshort(sc, 0x06, 0xeb58);
11311                 MP_WritePhyUshort(sc, 0x06, 0xf8d1);
11312                 MP_WritePhyUshort(sc, 0x06, 0x01e4);
11313                 MP_WritePhyUshort(sc, 0x06, 0xe0ea);
11314                 MP_WritePhyUshort(sc, 0x06, 0xe5e0);
11315                 MP_WritePhyUshort(sc, 0x06, 0xebe0);
11316                 MP_WritePhyUshort(sc, 0x06, 0xe07c);
11317                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
11318                 MP_WritePhyUshort(sc, 0x06, 0x7d5c);
11319                 MP_WritePhyUshort(sc, 0x06, 0x00ff);
11320                 MP_WritePhyUshort(sc, 0x06, 0x3c00);
11321                 MP_WritePhyUshort(sc, 0x06, 0x1eab);
11322                 MP_WritePhyUshort(sc, 0x06, 0x1ce0);
11323                 MP_WritePhyUshort(sc, 0x06, 0xe04c);
11324                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
11325                 MP_WritePhyUshort(sc, 0x06, 0x4d58);
11326                 MP_WritePhyUshort(sc, 0x06, 0xc1e4);
11327                 MP_WritePhyUshort(sc, 0x06, 0xe04c);
11328                 MP_WritePhyUshort(sc, 0x06, 0xe5e0);
11329                 MP_WritePhyUshort(sc, 0x06, 0x4de0);
11330                 MP_WritePhyUshort(sc, 0x06, 0xe0ee);
11331                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
11332                 MP_WritePhyUshort(sc, 0x06, 0xef69);
11333                 MP_WritePhyUshort(sc, 0x06, 0x3ce4);
11334                 MP_WritePhyUshort(sc, 0x06, 0xe0ee);
11335                 MP_WritePhyUshort(sc, 0x06, 0xe5e0);
11336                 MP_WritePhyUshort(sc, 0x06, 0xeffc);
11337                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
11338                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
11339                 MP_WritePhyUshort(sc, 0x06, 0x87ad);
11340                 MP_WritePhyUshort(sc, 0x06, 0x2412);
11341                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
11342                 MP_WritePhyUshort(sc, 0x06, 0xeee1);
11343                 MP_WritePhyUshort(sc, 0x06, 0xe0ef);
11344                 MP_WritePhyUshort(sc, 0x06, 0x59c3);
11345                 MP_WritePhyUshort(sc, 0x06, 0xe4e0);
11346                 MP_WritePhyUshort(sc, 0x06, 0xeee5);
11347                 MP_WritePhyUshort(sc, 0x06, 0xe0ef);
11348                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
11349                 MP_WritePhyUshort(sc, 0x06, 0xed01);
11350                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
11351                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
11352                 MP_WritePhyUshort(sc, 0x06, 0x8b81);
11353                 MP_WritePhyUshort(sc, 0x06, 0xac25);
11354                 MP_WritePhyUshort(sc, 0x06, 0x0502);
11355                 MP_WritePhyUshort(sc, 0x06, 0x8363);
11356                 MP_WritePhyUshort(sc, 0x06, 0xae03);
11357                 MP_WritePhyUshort(sc, 0x06, 0x0225);
11358                 MP_WritePhyUshort(sc, 0x06, 0x16fc);
11359                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
11360                 MP_WritePhyUshort(sc, 0x06, 0xf9fa);
11361                 MP_WritePhyUshort(sc, 0x06, 0xef69);
11362                 MP_WritePhyUshort(sc, 0x06, 0xfae0);
11363                 MP_WritePhyUshort(sc, 0x06, 0x860a);
11364                 MP_WritePhyUshort(sc, 0x06, 0xa000);
11365                 MP_WritePhyUshort(sc, 0x06, 0x19e0);
11366                 MP_WritePhyUshort(sc, 0x06, 0x860b);
11367                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
11368                 MP_WritePhyUshort(sc, 0x06, 0x331b);
11369                 MP_WritePhyUshort(sc, 0x06, 0x109e);
11370                 MP_WritePhyUshort(sc, 0x06, 0x04aa);
11371                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
11372                 MP_WritePhyUshort(sc, 0x06, 0x06ee);
11373                 MP_WritePhyUshort(sc, 0x06, 0x860a);
11374                 MP_WritePhyUshort(sc, 0x06, 0x01ae);
11375                 MP_WritePhyUshort(sc, 0x06, 0xe602);
11376                 MP_WritePhyUshort(sc, 0x06, 0x241e);
11377                 MP_WritePhyUshort(sc, 0x06, 0xae14);
11378                 MP_WritePhyUshort(sc, 0x06, 0xa001);
11379                 MP_WritePhyUshort(sc, 0x06, 0x1402);
11380                 MP_WritePhyUshort(sc, 0x06, 0x2426);
11381                 MP_WritePhyUshort(sc, 0x06, 0xbf26);
11382                 MP_WritePhyUshort(sc, 0x06, 0x6d02);
11383                 MP_WritePhyUshort(sc, 0x06, 0x2eb0);
11384                 MP_WritePhyUshort(sc, 0x06, 0xee86);
11385                 MP_WritePhyUshort(sc, 0x06, 0x0b00);
11386                 MP_WritePhyUshort(sc, 0x06, 0xee86);
11387                 MP_WritePhyUshort(sc, 0x06, 0x0a02);
11388                 MP_WritePhyUshort(sc, 0x06, 0xaf84);
11389                 MP_WritePhyUshort(sc, 0x06, 0x3ca0);
11390                 MP_WritePhyUshort(sc, 0x06, 0x0252);
11391                 MP_WritePhyUshort(sc, 0x06, 0xee86);
11392                 MP_WritePhyUshort(sc, 0x06, 0x0400);
11393                 MP_WritePhyUshort(sc, 0x06, 0xee86);
11394                 MP_WritePhyUshort(sc, 0x06, 0x0500);
11395                 MP_WritePhyUshort(sc, 0x06, 0xe086);
11396                 MP_WritePhyUshort(sc, 0x06, 0x0be1);
11397                 MP_WritePhyUshort(sc, 0x06, 0x8b32);
11398                 MP_WritePhyUshort(sc, 0x06, 0x1b10);
11399                 MP_WritePhyUshort(sc, 0x06, 0x9e04);
11400                 MP_WritePhyUshort(sc, 0x06, 0xaa02);
11401                 MP_WritePhyUshort(sc, 0x06, 0xaecb);
11402                 MP_WritePhyUshort(sc, 0x06, 0xee86);
11403                 MP_WritePhyUshort(sc, 0x06, 0x0b00);
11404                 MP_WritePhyUshort(sc, 0x06, 0x0224);
11405                 MP_WritePhyUshort(sc, 0x06, 0x3ae2);
11406                 MP_WritePhyUshort(sc, 0x06, 0x8604);
11407                 MP_WritePhyUshort(sc, 0x06, 0xe386);
11408                 MP_WritePhyUshort(sc, 0x06, 0x05ef);
11409                 MP_WritePhyUshort(sc, 0x06, 0x65e2);
11410                 MP_WritePhyUshort(sc, 0x06, 0x8606);
11411                 MP_WritePhyUshort(sc, 0x06, 0xe386);
11412                 MP_WritePhyUshort(sc, 0x06, 0x071b);
11413                 MP_WritePhyUshort(sc, 0x06, 0x56aa);
11414                 MP_WritePhyUshort(sc, 0x06, 0x0eef);
11415                 MP_WritePhyUshort(sc, 0x06, 0x56e6);
11416                 MP_WritePhyUshort(sc, 0x06, 0x8606);
11417                 MP_WritePhyUshort(sc, 0x06, 0xe786);
11418                 MP_WritePhyUshort(sc, 0x06, 0x07e2);
11419                 MP_WritePhyUshort(sc, 0x06, 0x8609);
11420                 MP_WritePhyUshort(sc, 0x06, 0xe686);
11421                 MP_WritePhyUshort(sc, 0x06, 0x08e0);
11422                 MP_WritePhyUshort(sc, 0x06, 0x8609);
11423                 MP_WritePhyUshort(sc, 0x06, 0xa000);
11424                 MP_WritePhyUshort(sc, 0x06, 0x07ee);
11425                 MP_WritePhyUshort(sc, 0x06, 0x860a);
11426                 MP_WritePhyUshort(sc, 0x06, 0x03af);
11427                 MP_WritePhyUshort(sc, 0x06, 0x8369);
11428                 MP_WritePhyUshort(sc, 0x06, 0x0224);
11429                 MP_WritePhyUshort(sc, 0x06, 0x8e02);
11430                 MP_WritePhyUshort(sc, 0x06, 0x2426);
11431                 MP_WritePhyUshort(sc, 0x06, 0xae48);
11432                 MP_WritePhyUshort(sc, 0x06, 0xa003);
11433                 MP_WritePhyUshort(sc, 0x06, 0x21e0);
11434                 MP_WritePhyUshort(sc, 0x06, 0x8608);
11435                 MP_WritePhyUshort(sc, 0x06, 0xe186);
11436                 MP_WritePhyUshort(sc, 0x06, 0x091b);
11437                 MP_WritePhyUshort(sc, 0x06, 0x019e);
11438                 MP_WritePhyUshort(sc, 0x06, 0x0caa);
11439                 MP_WritePhyUshort(sc, 0x06, 0x0502);
11440                 MP_WritePhyUshort(sc, 0x06, 0x249d);
11441                 MP_WritePhyUshort(sc, 0x06, 0xaee7);
11442                 MP_WritePhyUshort(sc, 0x06, 0x0224);
11443                 MP_WritePhyUshort(sc, 0x06, 0x8eae);
11444                 MP_WritePhyUshort(sc, 0x06, 0xe2ee);
11445                 MP_WritePhyUshort(sc, 0x06, 0x860a);
11446                 MP_WritePhyUshort(sc, 0x06, 0x04ee);
11447                 MP_WritePhyUshort(sc, 0x06, 0x860b);
11448                 MP_WritePhyUshort(sc, 0x06, 0x00af);
11449                 MP_WritePhyUshort(sc, 0x06, 0x8369);
11450                 MP_WritePhyUshort(sc, 0x06, 0xa004);
11451                 MP_WritePhyUshort(sc, 0x06, 0x15e0);
11452                 MP_WritePhyUshort(sc, 0x06, 0x860b);
11453                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
11454                 MP_WritePhyUshort(sc, 0x06, 0x341b);
11455                 MP_WritePhyUshort(sc, 0x06, 0x109e);
11456                 MP_WritePhyUshort(sc, 0x06, 0x05aa);
11457                 MP_WritePhyUshort(sc, 0x06, 0x03af);
11458                 MP_WritePhyUshort(sc, 0x06, 0x8383);
11459                 MP_WritePhyUshort(sc, 0x06, 0xee86);
11460                 MP_WritePhyUshort(sc, 0x06, 0x0a05);
11461                 MP_WritePhyUshort(sc, 0x06, 0xae0c);
11462                 MP_WritePhyUshort(sc, 0x06, 0xa005);
11463                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
11464                 MP_WritePhyUshort(sc, 0x06, 0x0702);
11465                 MP_WritePhyUshort(sc, 0x06, 0x2309);
11466                 MP_WritePhyUshort(sc, 0x06, 0xee86);
11467                 MP_WritePhyUshort(sc, 0x06, 0x0a00);
11468                 MP_WritePhyUshort(sc, 0x06, 0xfeef);
11469                 MP_WritePhyUshort(sc, 0x06, 0x96fe);
11470                 MP_WritePhyUshort(sc, 0x06, 0xfdfc);
11471                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
11472                 MP_WritePhyUshort(sc, 0x06, 0xf9fa);
11473                 MP_WritePhyUshort(sc, 0x06, 0xef69);
11474                 MP_WritePhyUshort(sc, 0x06, 0xfbe0);
11475                 MP_WritePhyUshort(sc, 0x06, 0x8b85);
11476                 MP_WritePhyUshort(sc, 0x06, 0xad25);
11477                 MP_WritePhyUshort(sc, 0x06, 0x22e0);
11478                 MP_WritePhyUshort(sc, 0x06, 0xe022);
11479                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
11480                 MP_WritePhyUshort(sc, 0x06, 0x23e2);
11481                 MP_WritePhyUshort(sc, 0x06, 0xe036);
11482                 MP_WritePhyUshort(sc, 0x06, 0xe3e0);
11483                 MP_WritePhyUshort(sc, 0x06, 0x375a);
11484                 MP_WritePhyUshort(sc, 0x06, 0xc40d);
11485                 MP_WritePhyUshort(sc, 0x06, 0x0158);
11486                 MP_WritePhyUshort(sc, 0x06, 0x021e);
11487                 MP_WritePhyUshort(sc, 0x06, 0x20e3);
11488                 MP_WritePhyUshort(sc, 0x06, 0x8ae7);
11489                 MP_WritePhyUshort(sc, 0x06, 0xac31);
11490                 MP_WritePhyUshort(sc, 0x06, 0x60ac);
11491                 MP_WritePhyUshort(sc, 0x06, 0x3a08);
11492                 MP_WritePhyUshort(sc, 0x06, 0xac3e);
11493                 MP_WritePhyUshort(sc, 0x06, 0x26ae);
11494                 MP_WritePhyUshort(sc, 0x06, 0x67af);
11495                 MP_WritePhyUshort(sc, 0x06, 0x84db);
11496                 MP_WritePhyUshort(sc, 0x06, 0xad37);
11497                 MP_WritePhyUshort(sc, 0x06, 0x61e0);
11498                 MP_WritePhyUshort(sc, 0x06, 0x8ae8);
11499                 MP_WritePhyUshort(sc, 0x06, 0x10e4);
11500                 MP_WritePhyUshort(sc, 0x06, 0x8ae8);
11501                 MP_WritePhyUshort(sc, 0x06, 0xe18a);
11502                 MP_WritePhyUshort(sc, 0x06, 0xe91b);
11503                 MP_WritePhyUshort(sc, 0x06, 0x109e);
11504                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
11505                 MP_WritePhyUshort(sc, 0x06, 0x51d1);
11506                 MP_WritePhyUshort(sc, 0x06, 0x00bf);
11507                 MP_WritePhyUshort(sc, 0x06, 0x863b);
11508                 MP_WritePhyUshort(sc, 0x06, 0x022f);
11509                 MP_WritePhyUshort(sc, 0x06, 0x50ee);
11510                 MP_WritePhyUshort(sc, 0x06, 0x8ae8);
11511                 MP_WritePhyUshort(sc, 0x06, 0x00ae);
11512                 MP_WritePhyUshort(sc, 0x06, 0x43ad);
11513                 MP_WritePhyUshort(sc, 0x06, 0x3627);
11514                 MP_WritePhyUshort(sc, 0x06, 0xe08a);
11515                 MP_WritePhyUshort(sc, 0x06, 0xeee1);
11516                 MP_WritePhyUshort(sc, 0x06, 0x8aef);
11517                 MP_WritePhyUshort(sc, 0x06, 0xef74);
11518                 MP_WritePhyUshort(sc, 0x06, 0xe08a);
11519                 MP_WritePhyUshort(sc, 0x06, 0xeae1);
11520                 MP_WritePhyUshort(sc, 0x06, 0x8aeb);
11521                 MP_WritePhyUshort(sc, 0x06, 0x1b74);
11522                 MP_WritePhyUshort(sc, 0x06, 0x9e2e);
11523                 MP_WritePhyUshort(sc, 0x06, 0x14e4);
11524                 MP_WritePhyUshort(sc, 0x06, 0x8aea);
11525                 MP_WritePhyUshort(sc, 0x06, 0xe58a);
11526                 MP_WritePhyUshort(sc, 0x06, 0xebef);
11527                 MP_WritePhyUshort(sc, 0x06, 0x74e0);
11528                 MP_WritePhyUshort(sc, 0x06, 0x8aee);
11529                 MP_WritePhyUshort(sc, 0x06, 0xe18a);
11530                 MP_WritePhyUshort(sc, 0x06, 0xef1b);
11531                 MP_WritePhyUshort(sc, 0x06, 0x479e);
11532                 MP_WritePhyUshort(sc, 0x06, 0x0fae);
11533                 MP_WritePhyUshort(sc, 0x06, 0x19ee);
11534                 MP_WritePhyUshort(sc, 0x06, 0x8aea);
11535                 MP_WritePhyUshort(sc, 0x06, 0x00ee);
11536                 MP_WritePhyUshort(sc, 0x06, 0x8aeb);
11537                 MP_WritePhyUshort(sc, 0x06, 0x00ae);
11538                 MP_WritePhyUshort(sc, 0x06, 0x0fac);
11539                 MP_WritePhyUshort(sc, 0x06, 0x390c);
11540                 MP_WritePhyUshort(sc, 0x06, 0xd101);
11541                 MP_WritePhyUshort(sc, 0x06, 0xbf86);
11542                 MP_WritePhyUshort(sc, 0x06, 0x3b02);
11543                 MP_WritePhyUshort(sc, 0x06, 0x2f50);
11544                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
11545                 MP_WritePhyUshort(sc, 0x06, 0xe800);
11546                 MP_WritePhyUshort(sc, 0x06, 0xe68a);
11547                 MP_WritePhyUshort(sc, 0x06, 0xe7ff);
11548                 MP_WritePhyUshort(sc, 0x06, 0xef96);
11549                 MP_WritePhyUshort(sc, 0x06, 0xfefd);
11550                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
11551                 MP_WritePhyUshort(sc, 0x06, 0xf8f9);
11552                 MP_WritePhyUshort(sc, 0x06, 0xfaef);
11553                 MP_WritePhyUshort(sc, 0x06, 0x69e0);
11554                 MP_WritePhyUshort(sc, 0x06, 0xe022);
11555                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
11556                 MP_WritePhyUshort(sc, 0x06, 0x2358);
11557                 MP_WritePhyUshort(sc, 0x06, 0xc4e1);
11558                 MP_WritePhyUshort(sc, 0x06, 0x8b6e);
11559                 MP_WritePhyUshort(sc, 0x06, 0x1f10);
11560                 MP_WritePhyUshort(sc, 0x06, 0x9e24);
11561                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
11562                 MP_WritePhyUshort(sc, 0x06, 0x6ead);
11563                 MP_WritePhyUshort(sc, 0x06, 0x2218);
11564                 MP_WritePhyUshort(sc, 0x06, 0xac27);
11565                 MP_WritePhyUshort(sc, 0x06, 0x0dac);
11566                 MP_WritePhyUshort(sc, 0x06, 0x2605);
11567                 MP_WritePhyUshort(sc, 0x06, 0x0203);
11568                 MP_WritePhyUshort(sc, 0x06, 0x8fae);
11569                 MP_WritePhyUshort(sc, 0x06, 0x1302);
11570                 MP_WritePhyUshort(sc, 0x06, 0x03c8);
11571                 MP_WritePhyUshort(sc, 0x06, 0xae0e);
11572                 MP_WritePhyUshort(sc, 0x06, 0x0203);
11573                 MP_WritePhyUshort(sc, 0x06, 0xe102);
11574                 MP_WritePhyUshort(sc, 0x06, 0x8520);
11575                 MP_WritePhyUshort(sc, 0x06, 0xae06);
11576                 MP_WritePhyUshort(sc, 0x06, 0x0203);
11577                 MP_WritePhyUshort(sc, 0x06, 0x8f02);
11578                 MP_WritePhyUshort(sc, 0x06, 0x8566);
11579                 MP_WritePhyUshort(sc, 0x06, 0xef96);
11580                 MP_WritePhyUshort(sc, 0x06, 0xfefd);
11581                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
11582                 MP_WritePhyUshort(sc, 0x06, 0xf8fa);
11583                 MP_WritePhyUshort(sc, 0x06, 0xef69);
11584                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
11585                 MP_WritePhyUshort(sc, 0x06, 0x82ad);
11586                 MP_WritePhyUshort(sc, 0x06, 0x2737);
11587                 MP_WritePhyUshort(sc, 0x06, 0xbf86);
11588                 MP_WritePhyUshort(sc, 0x06, 0x4402);
11589                 MP_WritePhyUshort(sc, 0x06, 0x2f23);
11590                 MP_WritePhyUshort(sc, 0x06, 0xac28);
11591                 MP_WritePhyUshort(sc, 0x06, 0x2ed1);
11592                 MP_WritePhyUshort(sc, 0x06, 0x01bf);
11593                 MP_WritePhyUshort(sc, 0x06, 0x8647);
11594                 MP_WritePhyUshort(sc, 0x06, 0x022f);
11595                 MP_WritePhyUshort(sc, 0x06, 0x50bf);
11596                 MP_WritePhyUshort(sc, 0x06, 0x8641);
11597                 MP_WritePhyUshort(sc, 0x06, 0x022f);
11598                 MP_WritePhyUshort(sc, 0x06, 0x23e5);
11599                 MP_WritePhyUshort(sc, 0x06, 0x8af0);
11600                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
11601                 MP_WritePhyUshort(sc, 0x06, 0x22e1);
11602                 MP_WritePhyUshort(sc, 0x06, 0xe023);
11603                 MP_WritePhyUshort(sc, 0x06, 0xac2e);
11604                 MP_WritePhyUshort(sc, 0x06, 0x04d1);
11605                 MP_WritePhyUshort(sc, 0x06, 0x01ae);
11606                 MP_WritePhyUshort(sc, 0x06, 0x02d1);
11607                 MP_WritePhyUshort(sc, 0x06, 0x00bf);
11608                 MP_WritePhyUshort(sc, 0x06, 0x8641);
11609                 MP_WritePhyUshort(sc, 0x06, 0x022f);
11610                 MP_WritePhyUshort(sc, 0x06, 0x50d1);
11611                 MP_WritePhyUshort(sc, 0x06, 0x01bf);
11612                 MP_WritePhyUshort(sc, 0x06, 0x8644);
11613                 MP_WritePhyUshort(sc, 0x06, 0x022f);
11614                 MP_WritePhyUshort(sc, 0x06, 0x50ef);
11615                 MP_WritePhyUshort(sc, 0x06, 0x96fe);
11616                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
11617                 MP_WritePhyUshort(sc, 0x06, 0xf8fa);
11618                 MP_WritePhyUshort(sc, 0x06, 0xef69);
11619                 MP_WritePhyUshort(sc, 0x06, 0xbf86);
11620                 MP_WritePhyUshort(sc, 0x06, 0x4702);
11621                 MP_WritePhyUshort(sc, 0x06, 0x2f23);
11622                 MP_WritePhyUshort(sc, 0x06, 0xad28);
11623                 MP_WritePhyUshort(sc, 0x06, 0x19d1);
11624                 MP_WritePhyUshort(sc, 0x06, 0x00bf);
11625                 MP_WritePhyUshort(sc, 0x06, 0x8644);
11626                 MP_WritePhyUshort(sc, 0x06, 0x022f);
11627                 MP_WritePhyUshort(sc, 0x06, 0x50e1);
11628                 MP_WritePhyUshort(sc, 0x06, 0x8af0);
11629                 MP_WritePhyUshort(sc, 0x06, 0xbf86);
11630                 MP_WritePhyUshort(sc, 0x06, 0x4102);
11631                 MP_WritePhyUshort(sc, 0x06, 0x2f50);
11632                 MP_WritePhyUshort(sc, 0x06, 0xd100);
11633                 MP_WritePhyUshort(sc, 0x06, 0xbf86);
11634                 MP_WritePhyUshort(sc, 0x06, 0x4702);
11635                 MP_WritePhyUshort(sc, 0x06, 0x2f50);
11636                 MP_WritePhyUshort(sc, 0x06, 0xef96);
11637                 MP_WritePhyUshort(sc, 0x06, 0xfefc);
11638                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
11639                 MP_WritePhyUshort(sc, 0x06, 0xe0e2);
11640                 MP_WritePhyUshort(sc, 0x06, 0xfee1);
11641                 MP_WritePhyUshort(sc, 0x06, 0xe2ff);
11642                 MP_WritePhyUshort(sc, 0x06, 0xad2e);
11643                 MP_WritePhyUshort(sc, 0x06, 0x63e0);
11644                 MP_WritePhyUshort(sc, 0x06, 0xe038);
11645                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
11646                 MP_WritePhyUshort(sc, 0x06, 0x39ad);
11647                 MP_WritePhyUshort(sc, 0x06, 0x2f10);
11648                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
11649                 MP_WritePhyUshort(sc, 0x06, 0x34e1);
11650                 MP_WritePhyUshort(sc, 0x06, 0xe035);
11651                 MP_WritePhyUshort(sc, 0x06, 0xf726);
11652                 MP_WritePhyUshort(sc, 0x06, 0xe4e0);
11653                 MP_WritePhyUshort(sc, 0x06, 0x34e5);
11654                 MP_WritePhyUshort(sc, 0x06, 0xe035);
11655                 MP_WritePhyUshort(sc, 0x06, 0xae0e);
11656                 MP_WritePhyUshort(sc, 0x06, 0xe0e2);
11657                 MP_WritePhyUshort(sc, 0x06, 0xd6e1);
11658                 MP_WritePhyUshort(sc, 0x06, 0xe2d7);
11659                 MP_WritePhyUshort(sc, 0x06, 0xf728);
11660                 MP_WritePhyUshort(sc, 0x06, 0xe4e2);
11661                 MP_WritePhyUshort(sc, 0x06, 0xd6e5);
11662                 MP_WritePhyUshort(sc, 0x06, 0xe2d7);
11663                 MP_WritePhyUshort(sc, 0x06, 0xe0e2);
11664                 MP_WritePhyUshort(sc, 0x06, 0x34e1);
11665                 MP_WritePhyUshort(sc, 0x06, 0xe235);
11666                 MP_WritePhyUshort(sc, 0x06, 0xf72b);
11667                 MP_WritePhyUshort(sc, 0x06, 0xe4e2);
11668                 MP_WritePhyUshort(sc, 0x06, 0x34e5);
11669                 MP_WritePhyUshort(sc, 0x06, 0xe235);
11670                 MP_WritePhyUshort(sc, 0x06, 0xd07d);
11671                 MP_WritePhyUshort(sc, 0x06, 0xb0fe);
11672                 MP_WritePhyUshort(sc, 0x06, 0xe0e2);
11673                 MP_WritePhyUshort(sc, 0x06, 0x34e1);
11674                 MP_WritePhyUshort(sc, 0x06, 0xe235);
11675                 MP_WritePhyUshort(sc, 0x06, 0xf62b);
11676                 MP_WritePhyUshort(sc, 0x06, 0xe4e2);
11677                 MP_WritePhyUshort(sc, 0x06, 0x34e5);
11678                 MP_WritePhyUshort(sc, 0x06, 0xe235);
11679                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
11680                 MP_WritePhyUshort(sc, 0x06, 0x34e1);
11681                 MP_WritePhyUshort(sc, 0x06, 0xe035);
11682                 MP_WritePhyUshort(sc, 0x06, 0xf626);
11683                 MP_WritePhyUshort(sc, 0x06, 0xe4e0);
11684                 MP_WritePhyUshort(sc, 0x06, 0x34e5);
11685                 MP_WritePhyUshort(sc, 0x06, 0xe035);
11686                 MP_WritePhyUshort(sc, 0x06, 0xe0e2);
11687                 MP_WritePhyUshort(sc, 0x06, 0xd6e1);
11688                 MP_WritePhyUshort(sc, 0x06, 0xe2d7);
11689                 MP_WritePhyUshort(sc, 0x06, 0xf628);
11690                 MP_WritePhyUshort(sc, 0x06, 0xe4e2);
11691                 MP_WritePhyUshort(sc, 0x06, 0xd6e5);
11692                 MP_WritePhyUshort(sc, 0x06, 0xe2d7);
11693                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
11694                 MP_WritePhyUshort(sc, 0x06, 0xae20);
11695                 MP_WritePhyUshort(sc, 0x06, 0x0000);
11696                 MP_WritePhyUshort(sc, 0x06, 0x0000);
11697                 MP_WritePhyUshort(sc, 0x06, 0x0000);
11698                 MP_WritePhyUshort(sc, 0x06, 0x0000);
11699                 MP_WritePhyUshort(sc, 0x06, 0x0000);
11700                 MP_WritePhyUshort(sc, 0x06, 0x0000);
11701                 MP_WritePhyUshort(sc, 0x06, 0x0000);
11702                 MP_WritePhyUshort(sc, 0x06, 0x0000);
11703                 MP_WritePhyUshort(sc, 0x06, 0x0000);
11704                 MP_WritePhyUshort(sc, 0x06, 0x0000);
11705                 MP_WritePhyUshort(sc, 0x06, 0x0000);
11706                 MP_WritePhyUshort(sc, 0x06, 0x0000);
11707                 MP_WritePhyUshort(sc, 0x06, 0x0000);
11708                 MP_WritePhyUshort(sc, 0x06, 0x0000);
11709                 MP_WritePhyUshort(sc, 0x06, 0x0000);
11710                 MP_WritePhyUshort(sc, 0x06, 0x0000);
11711                 MP_WritePhyUshort(sc, 0x06, 0xa725);
11712                 MP_WritePhyUshort(sc, 0x06, 0xe50a);
11713                 MP_WritePhyUshort(sc, 0x06, 0x1de5);
11714                 MP_WritePhyUshort(sc, 0x06, 0x0a2c);
11715                 MP_WritePhyUshort(sc, 0x06, 0xe50a);
11716                 MP_WritePhyUshort(sc, 0x06, 0x6de5);
11717                 MP_WritePhyUshort(sc, 0x06, 0x0a1d);
11718                 MP_WritePhyUshort(sc, 0x06, 0xe50a);
11719                 MP_WritePhyUshort(sc, 0x06, 0x1ce5);
11720                 MP_WritePhyUshort(sc, 0x06, 0x0a2d);
11721                 MP_WritePhyUshort(sc, 0x06, 0xa755);
11722                 MP_WritePhyUshort(sc, 0x06, 0x00e2);
11723                 MP_WritePhyUshort(sc, 0x06, 0x3488);
11724                 MP_WritePhyUshort(sc, 0x06, 0xe200);
11725                 MP_WritePhyUshort(sc, 0x06, 0xcce2);
11726                 MP_WritePhyUshort(sc, 0x06, 0x0055);
11727                 MP_WritePhyUshort(sc, 0x06, 0xe020);
11728                 MP_WritePhyUshort(sc, 0x06, 0x55e2);
11729                 MP_WritePhyUshort(sc, 0x06, 0xd600);
11730                 MP_WritePhyUshort(sc, 0x06, 0xe24a);
11731                 PhyRegValue = MP_ReadPhyUshort(sc, 0x01);
11732                 PhyRegValue |= BIT_0;
11733                 MP_WritePhyUshort(sc, 0x01, PhyRegValue);
11734                 PhyRegValue = MP_ReadPhyUshort(sc, 0x00);
11735                 PhyRegValue |= BIT_0;
11736                 MP_WritePhyUshort(sc, 0x00, PhyRegValue);
11737                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
11738                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
11739                 MP_WritePhyUshort(sc, 0x17, 0x2179);
11740                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
11741                 MP_WritePhyUshort(sc, 0x10, 0xf274);
11742                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
11743                 MP_WritePhyUshort(sc, 0x1e, 0x0042);
11744                 MP_WritePhyUshort(sc, 0x15, 0x0f00);
11745                 MP_WritePhyUshort(sc, 0x15, 0x0f00);
11746                 MP_WritePhyUshort(sc, 0x16, 0x7408);
11747                 MP_WritePhyUshort(sc, 0x15, 0x0e00);
11748                 MP_WritePhyUshort(sc, 0x15, 0x0f00);
11749                 MP_WritePhyUshort(sc, 0x15, 0x0f01);
11750                 MP_WritePhyUshort(sc, 0x16, 0x4000);
11751                 MP_WritePhyUshort(sc, 0x15, 0x0e01);
11752                 MP_WritePhyUshort(sc, 0x15, 0x0f01);
11753                 MP_WritePhyUshort(sc, 0x15, 0x0f02);
11754                 MP_WritePhyUshort(sc, 0x16, 0x9400);
11755                 MP_WritePhyUshort(sc, 0x15, 0x0e02);
11756                 MP_WritePhyUshort(sc, 0x15, 0x0f02);
11757                 MP_WritePhyUshort(sc, 0x15, 0x0f03);
11758                 MP_WritePhyUshort(sc, 0x16, 0x7408);
11759                 MP_WritePhyUshort(sc, 0x15, 0x0e03);
11760                 MP_WritePhyUshort(sc, 0x15, 0x0f03);
11761                 MP_WritePhyUshort(sc, 0x15, 0x0f04);
11762                 MP_WritePhyUshort(sc, 0x16, 0x4008);
11763                 MP_WritePhyUshort(sc, 0x15, 0x0e04);
11764                 MP_WritePhyUshort(sc, 0x15, 0x0f04);
11765                 MP_WritePhyUshort(sc, 0x15, 0x0f05);
11766                 MP_WritePhyUshort(sc, 0x16, 0x9400);
11767                 MP_WritePhyUshort(sc, 0x15, 0x0e05);
11768                 MP_WritePhyUshort(sc, 0x15, 0x0f05);
11769                 MP_WritePhyUshort(sc, 0x15, 0x0f06);
11770                 MP_WritePhyUshort(sc, 0x16, 0x0803);
11771                 MP_WritePhyUshort(sc, 0x15, 0x0e06);
11772                 MP_WritePhyUshort(sc, 0x15, 0x0f06);
11773                 MP_WritePhyUshort(sc, 0x15, 0x0d00);
11774                 MP_WritePhyUshort(sc, 0x15, 0x0100);
11775                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
11776                 MP_WritePhyUshort(sc, 0x10, 0xf074);
11777                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
11778                 MP_WritePhyUshort(sc, 0x17, 0x2149);
11779                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
11780                 for (i=0; i<200; i++) {
11781                         DELAY(100);
11782                         PhyRegValue = MP_ReadPhyUshort(sc, 0x00);
11783                         if (PhyRegValue&0x0080)
11784                                 break;
11785                 }
11786                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
11787                 MP_WritePhyUshort(sc, 0x1e, 0x0023);
11788                 PhyRegValue = MP_ReadPhyUshort(sc, 0x17);
11789                 PhyRegValue &= ~(BIT_0);
11790                 if (sc->RequiredSecLanDonglePatch)
11791                         PhyRegValue &= ~(BIT_2);
11792                 MP_WritePhyUshort(sc, 0x17, PhyRegValue);
11793                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
11794                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
11795                 MP_WritePhyUshort(sc, 0x1e, 0x0023);
11796                 PhyRegValue = MP_ReadPhyUshort(sc, 0x17);
11797                 PhyRegValue |= BIT_14;
11798                 MP_WritePhyUshort(sc, 0x17, PhyRegValue);
11799                 MP_WritePhyUshort(sc, 0x1e, 0x0020);
11800                 PhyRegValue = MP_ReadPhyUshort(sc, 0x1b);
11801                 PhyRegValue |= BIT_7;
11802                 MP_WritePhyUshort(sc, 0x1b, PhyRegValue);
11803                 MP_WritePhyUshort(sc, 0x1e, 0x0041);
11804                 MP_WritePhyUshort(sc, 0x15, 0x0e02);
11805                 MP_WritePhyUshort(sc, 0x1e, 0x0028);
11806                 PhyRegValue = MP_ReadPhyUshort(sc, 0x19);
11807                 PhyRegValue |= BIT_15;
11808                 MP_WritePhyUshort(sc, 0x19, PhyRegValue);
11809                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
11810         } else {
11811                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
11812                 MP_WritePhyUshort(sc, 0x00, 0x1800);
11813                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
11814                 MP_WritePhyUshort(sc, 0x1e, 0x0023);
11815                 MP_WritePhyUshort(sc, 0x17, 0x0117);
11816                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
11817                 MP_WritePhyUshort(sc, 0x1E, 0x002C);
11818                 MP_WritePhyUshort(sc, 0x1B, 0x5000);
11819                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
11820                 MP_WritePhyUshort(sc, 0x16, 0x4104);
11821                 for (i = 0; i < 200; i++) {
11822                         DELAY(100);
11823                         PhyRegValue = MP_ReadPhyUshort(sc, 0x1E);
11824                         PhyRegValue &= 0x03FF;
11825                         if (PhyRegValue==0x000C)
11826                                 break;
11827                 }
11828                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
11829                 for (i = 0; i < 200; i++) {
11830                         DELAY(100);
11831                         PhyRegValue = MP_ReadPhyUshort(sc, 0x07);
11832                         if ((PhyRegValue & BIT_5) == 0)
11833                                 break;
11834                 }
11835                 PhyRegValue = MP_ReadPhyUshort(sc, 0x07);
11836                 if (PhyRegValue & BIT_5) {
11837                         MP_WritePhyUshort(sc, 0x1f, 0x0007);
11838                         MP_WritePhyUshort(sc, 0x1e, 0x00a1);
11839                         MP_WritePhyUshort(sc, 0x17, 0x1000);
11840                         MP_WritePhyUshort(sc, 0x17, 0x0000);
11841                         MP_WritePhyUshort(sc, 0x17, 0x2000);
11842                         MP_WritePhyUshort(sc, 0x1e, 0x002f);
11843                         MP_WritePhyUshort(sc, 0x18, 0x9bfb);
11844                         MP_WritePhyUshort(sc, 0x1f, 0x0005);
11845                         MP_WritePhyUshort(sc, 0x07, 0x0000);
11846                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
11847                 }
11848                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
11849                 MP_WritePhyUshort(sc, 0x05, 0xfff6);
11850                 MP_WritePhyUshort(sc, 0x06, 0x0080);
11851                 PhyRegValue = MP_ReadPhyUshort(sc, 0x00);
11852                 PhyRegValue &= ~(BIT_7);
11853                 MP_WritePhyUshort(sc, 0x00, PhyRegValue);
11854                 MP_WritePhyUshort(sc, 0x1f, 0x0002);
11855                 PhyRegValue = MP_ReadPhyUshort(sc, 0x08);
11856                 PhyRegValue &= ~(BIT_7);
11857                 MP_WritePhyUshort(sc, 0x08, PhyRegValue);
11858                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
11859
11860                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
11861                 MP_WritePhyUshort(sc, 0x1e, 0x0023);
11862                 MP_WritePhyUshort(sc, 0x16, 0x0306);
11863                 MP_WritePhyUshort(sc, 0x16, 0x0307);
11864                 MP_WritePhyUshort(sc, 0x15, 0x000e);
11865                 MP_WritePhyUshort(sc, 0x19, 0x000a);
11866                 MP_WritePhyUshort(sc, 0x15, 0x0010);
11867                 MP_WritePhyUshort(sc, 0x19, 0x0008);
11868                 MP_WritePhyUshort(sc, 0x15, 0x0018);
11869                 MP_WritePhyUshort(sc, 0x19, 0x4801);
11870                 MP_WritePhyUshort(sc, 0x15, 0x0019);
11871                 MP_WritePhyUshort(sc, 0x19, 0x6801);
11872                 MP_WritePhyUshort(sc, 0x15, 0x001a);
11873                 MP_WritePhyUshort(sc, 0x19, 0x66a1);
11874                 MP_WritePhyUshort(sc, 0x15, 0x001f);
11875                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11876                 MP_WritePhyUshort(sc, 0x15, 0x0020);
11877                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11878                 MP_WritePhyUshort(sc, 0x15, 0x0021);
11879                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11880                 MP_WritePhyUshort(sc, 0x15, 0x0022);
11881                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11882                 MP_WritePhyUshort(sc, 0x15, 0x0023);
11883                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11884                 MP_WritePhyUshort(sc, 0x15, 0x0024);
11885                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11886                 MP_WritePhyUshort(sc, 0x15, 0x0025);
11887                 MP_WritePhyUshort(sc, 0x19, 0x64a1);
11888                 MP_WritePhyUshort(sc, 0x15, 0x0026);
11889                 MP_WritePhyUshort(sc, 0x19, 0x40ea);
11890                 MP_WritePhyUshort(sc, 0x15, 0x0027);
11891                 MP_WritePhyUshort(sc, 0x19, 0x4503);
11892                 MP_WritePhyUshort(sc, 0x15, 0x0028);
11893                 MP_WritePhyUshort(sc, 0x19, 0x9f00);
11894                 MP_WritePhyUshort(sc, 0x15, 0x0029);
11895                 MP_WritePhyUshort(sc, 0x19, 0xa631);
11896                 MP_WritePhyUshort(sc, 0x15, 0x002a);
11897                 MP_WritePhyUshort(sc, 0x19, 0x9717);
11898                 MP_WritePhyUshort(sc, 0x15, 0x002b);
11899                 MP_WritePhyUshort(sc, 0x19, 0x302c);
11900                 MP_WritePhyUshort(sc, 0x15, 0x002c);
11901                 MP_WritePhyUshort(sc, 0x19, 0x4802);
11902                 MP_WritePhyUshort(sc, 0x15, 0x002d);
11903                 MP_WritePhyUshort(sc, 0x19, 0x58da);
11904                 MP_WritePhyUshort(sc, 0x15, 0x002e);
11905                 MP_WritePhyUshort(sc, 0x19, 0x400d);
11906                 MP_WritePhyUshort(sc, 0x15, 0x002f);
11907                 MP_WritePhyUshort(sc, 0x19, 0x4488);
11908                 MP_WritePhyUshort(sc, 0x15, 0x0030);
11909                 MP_WritePhyUshort(sc, 0x19, 0x9e00);
11910                 MP_WritePhyUshort(sc, 0x15, 0x0031);
11911                 MP_WritePhyUshort(sc, 0x19, 0x63c8);
11912                 MP_WritePhyUshort(sc, 0x15, 0x0032);
11913                 MP_WritePhyUshort(sc, 0x19, 0x6481);
11914                 MP_WritePhyUshort(sc, 0x15, 0x0033);
11915                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11916                 MP_WritePhyUshort(sc, 0x15, 0x0034);
11917                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11918                 MP_WritePhyUshort(sc, 0x15, 0x0035);
11919                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11920                 MP_WritePhyUshort(sc, 0x15, 0x0036);
11921                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11922                 MP_WritePhyUshort(sc, 0x15, 0x0037);
11923                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11924                 MP_WritePhyUshort(sc, 0x15, 0x0038);
11925                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11926                 MP_WritePhyUshort(sc, 0x15, 0x0039);
11927                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11928                 MP_WritePhyUshort(sc, 0x15, 0x003a);
11929                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11930                 MP_WritePhyUshort(sc, 0x15, 0x003b);
11931                 MP_WritePhyUshort(sc, 0x19, 0x63e8);
11932                 MP_WritePhyUshort(sc, 0x15, 0x003c);
11933                 MP_WritePhyUshort(sc, 0x19, 0x7d00);
11934                 MP_WritePhyUshort(sc, 0x15, 0x003d);
11935                 MP_WritePhyUshort(sc, 0x19, 0x59d4);
11936                 MP_WritePhyUshort(sc, 0x15, 0x003e);
11937                 MP_WritePhyUshort(sc, 0x19, 0x63f8);
11938                 MP_WritePhyUshort(sc, 0x15, 0x0040);
11939                 MP_WritePhyUshort(sc, 0x19, 0x64a1);
11940                 MP_WritePhyUshort(sc, 0x15, 0x0041);
11941                 MP_WritePhyUshort(sc, 0x19, 0x30de);
11942                 MP_WritePhyUshort(sc, 0x15, 0x0044);
11943                 MP_WritePhyUshort(sc, 0x19, 0x480f);
11944                 MP_WritePhyUshort(sc, 0x15, 0x0045);
11945                 MP_WritePhyUshort(sc, 0x19, 0x6800);
11946                 MP_WritePhyUshort(sc, 0x15, 0x0046);
11947                 MP_WritePhyUshort(sc, 0x19, 0x6680);
11948                 MP_WritePhyUshort(sc, 0x15, 0x0047);
11949                 MP_WritePhyUshort(sc, 0x19, 0x7c10);
11950                 MP_WritePhyUshort(sc, 0x15, 0x0048);
11951                 MP_WritePhyUshort(sc, 0x19, 0x63c8);
11952                 MP_WritePhyUshort(sc, 0x15, 0x0049);
11953                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11954                 MP_WritePhyUshort(sc, 0x15, 0x004a);
11955                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11956                 MP_WritePhyUshort(sc, 0x15, 0x004b);
11957                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11958                 MP_WritePhyUshort(sc, 0x15, 0x004c);
11959                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11960                 MP_WritePhyUshort(sc, 0x15, 0x004d);
11961                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11962                 MP_WritePhyUshort(sc, 0x15, 0x004e);
11963                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11964                 MP_WritePhyUshort(sc, 0x15, 0x004f);
11965                 MP_WritePhyUshort(sc, 0x19, 0x40ea);
11966                 MP_WritePhyUshort(sc, 0x15, 0x0050);
11967                 MP_WritePhyUshort(sc, 0x19, 0x4503);
11968                 MP_WritePhyUshort(sc, 0x15, 0x0051);
11969                 MP_WritePhyUshort(sc, 0x19, 0x58ca);
11970                 MP_WritePhyUshort(sc, 0x15, 0x0052);
11971                 MP_WritePhyUshort(sc, 0x19, 0x63c8);
11972                 MP_WritePhyUshort(sc, 0x15, 0x0053);
11973                 MP_WritePhyUshort(sc, 0x19, 0x63d8);
11974                 MP_WritePhyUshort(sc, 0x15, 0x0054);
11975                 MP_WritePhyUshort(sc, 0x19, 0x66a0);
11976                 MP_WritePhyUshort(sc, 0x15, 0x0055);
11977                 MP_WritePhyUshort(sc, 0x19, 0x9f00);
11978                 MP_WritePhyUshort(sc, 0x15, 0x0056);
11979                 MP_WritePhyUshort(sc, 0x19, 0x3000);
11980                 MP_WritePhyUshort(sc, 0x15, 0x00a1);
11981                 MP_WritePhyUshort(sc, 0x19, 0x3044);
11982                 MP_WritePhyUshort(sc, 0x15, 0x00ab);
11983                 MP_WritePhyUshort(sc, 0x19, 0x5820);
11984                 MP_WritePhyUshort(sc, 0x15, 0x00ac);
11985                 MP_WritePhyUshort(sc, 0x19, 0x5e04);
11986                 MP_WritePhyUshort(sc, 0x15, 0x00ad);
11987                 MP_WritePhyUshort(sc, 0x19, 0xb60c);
11988                 MP_WritePhyUshort(sc, 0x15, 0x00af);
11989                 MP_WritePhyUshort(sc, 0x19, 0x000a);
11990                 MP_WritePhyUshort(sc, 0x15, 0x00b2);
11991                 MP_WritePhyUshort(sc, 0x19, 0x30b9);
11992                 MP_WritePhyUshort(sc, 0x15, 0x00b9);
11993                 MP_WritePhyUshort(sc, 0x19, 0x4408);
11994                 MP_WritePhyUshort(sc, 0x15, 0x00ba);
11995                 MP_WritePhyUshort(sc, 0x19, 0x480b);
11996                 MP_WritePhyUshort(sc, 0x15, 0x00bb);
11997                 MP_WritePhyUshort(sc, 0x19, 0x5e00);
11998                 MP_WritePhyUshort(sc, 0x15, 0x00bc);
11999                 MP_WritePhyUshort(sc, 0x19, 0x405f);
12000                 MP_WritePhyUshort(sc, 0x15, 0x00bd);
12001                 MP_WritePhyUshort(sc, 0x19, 0x4448);
12002                 MP_WritePhyUshort(sc, 0x15, 0x00be);
12003                 MP_WritePhyUshort(sc, 0x19, 0x4020);
12004                 MP_WritePhyUshort(sc, 0x15, 0x00bf);
12005                 MP_WritePhyUshort(sc, 0x19, 0x4468);
12006                 MP_WritePhyUshort(sc, 0x15, 0x00c0);
12007                 MP_WritePhyUshort(sc, 0x19, 0x9c02);
12008                 MP_WritePhyUshort(sc, 0x15, 0x00c1);
12009                 MP_WritePhyUshort(sc, 0x19, 0x58a0);
12010                 MP_WritePhyUshort(sc, 0x15, 0x00c2);
12011                 MP_WritePhyUshort(sc, 0x19, 0xb605);
12012                 MP_WritePhyUshort(sc, 0x15, 0x00c3);
12013                 MP_WritePhyUshort(sc, 0x19, 0xc0d3);
12014                 MP_WritePhyUshort(sc, 0x15, 0x00c4);
12015                 MP_WritePhyUshort(sc, 0x19, 0x00e6);
12016                 MP_WritePhyUshort(sc, 0x15, 0x00c5);
12017                 MP_WritePhyUshort(sc, 0x19, 0xdaec);
12018                 MP_WritePhyUshort(sc, 0x15, 0x00c6);
12019                 MP_WritePhyUshort(sc, 0x19, 0x00fa);
12020                 MP_WritePhyUshort(sc, 0x15, 0x00c7);
12021                 MP_WritePhyUshort(sc, 0x19, 0x9df9);
12022                 MP_WritePhyUshort(sc, 0x15, 0x0112);
12023                 MP_WritePhyUshort(sc, 0x19, 0x6421);
12024                 MP_WritePhyUshort(sc, 0x15, 0x0113);
12025                 MP_WritePhyUshort(sc, 0x19, 0x7c08);
12026                 MP_WritePhyUshort(sc, 0x15, 0x0114);
12027                 MP_WritePhyUshort(sc, 0x19, 0x63f0);
12028                 MP_WritePhyUshort(sc, 0x15, 0x0115);
12029                 MP_WritePhyUshort(sc, 0x19, 0x4003);
12030                 MP_WritePhyUshort(sc, 0x15, 0x0116);
12031                 MP_WritePhyUshort(sc, 0x19, 0x4418);
12032                 MP_WritePhyUshort(sc, 0x15, 0x0117);
12033                 MP_WritePhyUshort(sc, 0x19, 0x9b00);
12034                 MP_WritePhyUshort(sc, 0x15, 0x0118);
12035                 MP_WritePhyUshort(sc, 0x19, 0x6461);
12036                 MP_WritePhyUshort(sc, 0x15, 0x0119);
12037                 MP_WritePhyUshort(sc, 0x19, 0x64e1);
12038                 MP_WritePhyUshort(sc, 0x15, 0x011a);
12039                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12040                 MP_WritePhyUshort(sc, 0x15, 0x0150);
12041                 MP_WritePhyUshort(sc, 0x19, 0x7c80);
12042                 MP_WritePhyUshort(sc, 0x15, 0x0151);
12043                 MP_WritePhyUshort(sc, 0x19, 0x6461);
12044                 MP_WritePhyUshort(sc, 0x15, 0x0152);
12045                 MP_WritePhyUshort(sc, 0x19, 0x4003);
12046                 MP_WritePhyUshort(sc, 0x15, 0x0153);
12047                 MP_WritePhyUshort(sc, 0x19, 0x4540);
12048                 MP_WritePhyUshort(sc, 0x15, 0x0154);
12049                 MP_WritePhyUshort(sc, 0x19, 0x9f00);
12050                 MP_WritePhyUshort(sc, 0x15, 0x0155);
12051                 MP_WritePhyUshort(sc, 0x19, 0x9d00);
12052                 MP_WritePhyUshort(sc, 0x15, 0x0156);
12053                 MP_WritePhyUshort(sc, 0x19, 0x7c40);
12054                 MP_WritePhyUshort(sc, 0x15, 0x0157);
12055                 MP_WritePhyUshort(sc, 0x19, 0x6421);
12056                 MP_WritePhyUshort(sc, 0x15, 0x0158);
12057                 MP_WritePhyUshort(sc, 0x19, 0x7c80);
12058                 MP_WritePhyUshort(sc, 0x15, 0x0159);
12059                 MP_WritePhyUshort(sc, 0x19, 0x64a1);
12060                 MP_WritePhyUshort(sc, 0x15, 0x015a);
12061                 MP_WritePhyUshort(sc, 0x19, 0x30fe);
12062                 MP_WritePhyUshort(sc, 0x15, 0x029c);
12063                 MP_WritePhyUshort(sc, 0x19, 0x0070);
12064                 MP_WritePhyUshort(sc, 0x15, 0x02b2);
12065                 MP_WritePhyUshort(sc, 0x19, 0x005a);
12066                 MP_WritePhyUshort(sc, 0x15, 0x02bd);
12067                 MP_WritePhyUshort(sc, 0x19, 0xa522);
12068                 MP_WritePhyUshort(sc, 0x15, 0x02ce);
12069                 MP_WritePhyUshort(sc, 0x19, 0xb63e);
12070                 MP_WritePhyUshort(sc, 0x15, 0x02d9);
12071                 MP_WritePhyUshort(sc, 0x19, 0x32df);
12072                 MP_WritePhyUshort(sc, 0x15, 0x02df);
12073                 MP_WritePhyUshort(sc, 0x19, 0x4500);
12074                 MP_WritePhyUshort(sc, 0x15, 0x02f4);
12075                 MP_WritePhyUshort(sc, 0x19, 0xb618);
12076                 MP_WritePhyUshort(sc, 0x15, 0x02fb);
12077                 MP_WritePhyUshort(sc, 0x19, 0xb900);
12078                 MP_WritePhyUshort(sc, 0x15, 0x02fc);
12079                 MP_WritePhyUshort(sc, 0x19, 0x49b5);
12080                 MP_WritePhyUshort(sc, 0x15, 0x02fd);
12081                 MP_WritePhyUshort(sc, 0x19, 0x6812);
12082                 MP_WritePhyUshort(sc, 0x15, 0x02fe);
12083                 MP_WritePhyUshort(sc, 0x19, 0x66a0);
12084                 MP_WritePhyUshort(sc, 0x15, 0x02ff);
12085                 MP_WritePhyUshort(sc, 0x19, 0x9900);
12086                 MP_WritePhyUshort(sc, 0x15, 0x0300);
12087                 MP_WritePhyUshort(sc, 0x19, 0x64a0);
12088                 MP_WritePhyUshort(sc, 0x15, 0x0301);
12089                 MP_WritePhyUshort(sc, 0x19, 0x3316);
12090                 MP_WritePhyUshort(sc, 0x15, 0x0308);
12091                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12092                 MP_WritePhyUshort(sc, 0x15, 0x030c);
12093                 MP_WritePhyUshort(sc, 0x19, 0x3000);
12094                 MP_WritePhyUshort(sc, 0x15, 0x0312);
12095                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12096                 MP_WritePhyUshort(sc, 0x15, 0x0313);
12097                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12098                 MP_WritePhyUshort(sc, 0x15, 0x0314);
12099                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12100                 MP_WritePhyUshort(sc, 0x15, 0x0315);
12101                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12102                 MP_WritePhyUshort(sc, 0x15, 0x0316);
12103                 MP_WritePhyUshort(sc, 0x19, 0x49b5);
12104                 MP_WritePhyUshort(sc, 0x15, 0x0317);
12105                 MP_WritePhyUshort(sc, 0x19, 0x7d00);
12106                 MP_WritePhyUshort(sc, 0x15, 0x0318);
12107                 MP_WritePhyUshort(sc, 0x19, 0x4d00);
12108                 MP_WritePhyUshort(sc, 0x15, 0x0319);
12109                 MP_WritePhyUshort(sc, 0x19, 0x6810);
12110                 MP_WritePhyUshort(sc, 0x15, 0x031a);
12111                 MP_WritePhyUshort(sc, 0x19, 0x6c08);
12112                 MP_WritePhyUshort(sc, 0x15, 0x031b);
12113                 MP_WritePhyUshort(sc, 0x19, 0x4925);
12114                 MP_WritePhyUshort(sc, 0x15, 0x031c);
12115                 MP_WritePhyUshort(sc, 0x19, 0x403b);
12116                 MP_WritePhyUshort(sc, 0x15, 0x031d);
12117                 MP_WritePhyUshort(sc, 0x19, 0xa602);
12118                 MP_WritePhyUshort(sc, 0x15, 0x031e);
12119                 MP_WritePhyUshort(sc, 0x19, 0x402f);
12120                 MP_WritePhyUshort(sc, 0x15, 0x031f);
12121                 MP_WritePhyUshort(sc, 0x19, 0x4484);
12122                 MP_WritePhyUshort(sc, 0x15, 0x0320);
12123                 MP_WritePhyUshort(sc, 0x19, 0x40c8);
12124                 MP_WritePhyUshort(sc, 0x15, 0x0321);
12125                 MP_WritePhyUshort(sc, 0x19, 0x44c4);
12126                 MP_WritePhyUshort(sc, 0x15, 0x0322);
12127                 MP_WritePhyUshort(sc, 0x19, 0x404f);
12128                 MP_WritePhyUshort(sc, 0x15, 0x0323);
12129                 MP_WritePhyUshort(sc, 0x19, 0x44c8);
12130                 MP_WritePhyUshort(sc, 0x15, 0x0324);
12131                 MP_WritePhyUshort(sc, 0x19, 0xd64f);
12132                 MP_WritePhyUshort(sc, 0x15, 0x0325);
12133                 MP_WritePhyUshort(sc, 0x19, 0x00e7);
12134                 MP_WritePhyUshort(sc, 0x15, 0x0326);
12135                 MP_WritePhyUshort(sc, 0x19, 0x7c08);
12136                 MP_WritePhyUshort(sc, 0x15, 0x0327);
12137                 MP_WritePhyUshort(sc, 0x19, 0x8203);
12138                 MP_WritePhyUshort(sc, 0x15, 0x0328);
12139                 MP_WritePhyUshort(sc, 0x19, 0x4d48);
12140                 MP_WritePhyUshort(sc, 0x15, 0x0329);
12141                 MP_WritePhyUshort(sc, 0x19, 0x332b);
12142                 MP_WritePhyUshort(sc, 0x15, 0x032a);
12143                 MP_WritePhyUshort(sc, 0x19, 0x4d40);
12144                 MP_WritePhyUshort(sc, 0x15, 0x032c);
12145                 MP_WritePhyUshort(sc, 0x19, 0x00f8);
12146                 MP_WritePhyUshort(sc, 0x15, 0x032d);
12147                 MP_WritePhyUshort(sc, 0x19, 0x82b2);
12148                 MP_WritePhyUshort(sc, 0x15, 0x032f);
12149                 MP_WritePhyUshort(sc, 0x19, 0x00b0);
12150                 MP_WritePhyUshort(sc, 0x15, 0x0332);
12151                 MP_WritePhyUshort(sc, 0x19, 0x91f2);
12152                 MP_WritePhyUshort(sc, 0x15, 0x033f);
12153                 MP_WritePhyUshort(sc, 0x19, 0xb6cd);
12154                 MP_WritePhyUshort(sc, 0x15, 0x0340);
12155                 MP_WritePhyUshort(sc, 0x19, 0x9e01);
12156                 MP_WritePhyUshort(sc, 0x15, 0x0341);
12157                 MP_WritePhyUshort(sc, 0x19, 0xd11d);
12158                 MP_WritePhyUshort(sc, 0x15, 0x0342);
12159                 MP_WritePhyUshort(sc, 0x19, 0x009d);
12160                 MP_WritePhyUshort(sc, 0x15, 0x0343);
12161                 MP_WritePhyUshort(sc, 0x19, 0xbb1c);
12162                 MP_WritePhyUshort(sc, 0x15, 0x0344);
12163                 MP_WritePhyUshort(sc, 0x19, 0x8102);
12164                 MP_WritePhyUshort(sc, 0x15, 0x0345);
12165                 MP_WritePhyUshort(sc, 0x19, 0x3348);
12166                 MP_WritePhyUshort(sc, 0x15, 0x0346);
12167                 MP_WritePhyUshort(sc, 0x19, 0xa231);
12168                 MP_WritePhyUshort(sc, 0x15, 0x0347);
12169                 MP_WritePhyUshort(sc, 0x19, 0x335b);
12170                 MP_WritePhyUshort(sc, 0x15, 0x0348);
12171                 MP_WritePhyUshort(sc, 0x19, 0x91f7);
12172                 MP_WritePhyUshort(sc, 0x15, 0x0349);
12173                 MP_WritePhyUshort(sc, 0x19, 0xc218);
12174                 MP_WritePhyUshort(sc, 0x15, 0x034a);
12175                 MP_WritePhyUshort(sc, 0x19, 0x00f5);
12176                 MP_WritePhyUshort(sc, 0x15, 0x034b);
12177                 MP_WritePhyUshort(sc, 0x19, 0x335b);
12178                 MP_WritePhyUshort(sc, 0x15, 0x034c);
12179                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12180                 MP_WritePhyUshort(sc, 0x15, 0x034d);
12181                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12182                 MP_WritePhyUshort(sc, 0x15, 0x034e);
12183                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12184                 MP_WritePhyUshort(sc, 0x15, 0x034f);
12185                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12186                 MP_WritePhyUshort(sc, 0x15, 0x0350);
12187                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12188                 MP_WritePhyUshort(sc, 0x15, 0x035b);
12189                 MP_WritePhyUshort(sc, 0x19, 0xa23c);
12190                 MP_WritePhyUshort(sc, 0x15, 0x035c);
12191                 MP_WritePhyUshort(sc, 0x19, 0x7c08);
12192                 MP_WritePhyUshort(sc, 0x15, 0x035d);
12193                 MP_WritePhyUshort(sc, 0x19, 0x4c00);
12194                 MP_WritePhyUshort(sc, 0x15, 0x035e);
12195                 MP_WritePhyUshort(sc, 0x19, 0x3397);
12196                 MP_WritePhyUshort(sc, 0x15, 0x0363);
12197                 MP_WritePhyUshort(sc, 0x19, 0xb6a9);
12198                 MP_WritePhyUshort(sc, 0x15, 0x0366);
12199                 MP_WritePhyUshort(sc, 0x19, 0x00f5);
12200                 MP_WritePhyUshort(sc, 0x15, 0x0382);
12201                 MP_WritePhyUshort(sc, 0x19, 0x7c40);
12202                 MP_WritePhyUshort(sc, 0x15, 0x0388);
12203                 MP_WritePhyUshort(sc, 0x19, 0x0084);
12204                 MP_WritePhyUshort(sc, 0x15, 0x0389);
12205                 MP_WritePhyUshort(sc, 0x19, 0xdd17);
12206                 MP_WritePhyUshort(sc, 0x15, 0x038a);
12207                 MP_WritePhyUshort(sc, 0x19, 0x000b);
12208                 MP_WritePhyUshort(sc, 0x15, 0x038b);
12209                 MP_WritePhyUshort(sc, 0x19, 0xa10a);
12210                 MP_WritePhyUshort(sc, 0x15, 0x038c);
12211                 MP_WritePhyUshort(sc, 0x19, 0x337e);
12212                 MP_WritePhyUshort(sc, 0x15, 0x038d);
12213                 MP_WritePhyUshort(sc, 0x19, 0x6c0b);
12214                 MP_WritePhyUshort(sc, 0x15, 0x038e);
12215                 MP_WritePhyUshort(sc, 0x19, 0xa107);
12216                 MP_WritePhyUshort(sc, 0x15, 0x038f);
12217                 MP_WritePhyUshort(sc, 0x19, 0x6c08);
12218                 MP_WritePhyUshort(sc, 0x15, 0x0390);
12219                 MP_WritePhyUshort(sc, 0x19, 0xc017);
12220                 MP_WritePhyUshort(sc, 0x15, 0x0391);
12221                 MP_WritePhyUshort(sc, 0x19, 0x0004);
12222                 MP_WritePhyUshort(sc, 0x15, 0x0392);
12223                 MP_WritePhyUshort(sc, 0x19, 0xd64f);
12224                 MP_WritePhyUshort(sc, 0x15, 0x0393);
12225                 MP_WritePhyUshort(sc, 0x19, 0x00f4);
12226                 MP_WritePhyUshort(sc, 0x15, 0x0397);
12227                 MP_WritePhyUshort(sc, 0x19, 0x4098);
12228                 MP_WritePhyUshort(sc, 0x15, 0x0398);
12229                 MP_WritePhyUshort(sc, 0x19, 0x4408);
12230                 MP_WritePhyUshort(sc, 0x15, 0x0399);
12231                 MP_WritePhyUshort(sc, 0x19, 0x55bf);
12232                 MP_WritePhyUshort(sc, 0x15, 0x039a);
12233                 MP_WritePhyUshort(sc, 0x19, 0x4bb9);
12234                 MP_WritePhyUshort(sc, 0x15, 0x039b);
12235                 MP_WritePhyUshort(sc, 0x19, 0x6810);
12236                 MP_WritePhyUshort(sc, 0x15, 0x039c);
12237                 MP_WritePhyUshort(sc, 0x19, 0x4b29);
12238                 MP_WritePhyUshort(sc, 0x15, 0x039d);
12239                 MP_WritePhyUshort(sc, 0x19, 0x4041);
12240                 MP_WritePhyUshort(sc, 0x15, 0x039e);
12241                 MP_WritePhyUshort(sc, 0x19, 0x442a);
12242                 MP_WritePhyUshort(sc, 0x15, 0x039f);
12243                 MP_WritePhyUshort(sc, 0x19, 0x4029);
12244                 MP_WritePhyUshort(sc, 0x15, 0x03aa);
12245                 MP_WritePhyUshort(sc, 0x19, 0x33b8);
12246                 MP_WritePhyUshort(sc, 0x15, 0x03b6);
12247                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12248                 MP_WritePhyUshort(sc, 0x15, 0x03b7);
12249                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12250                 MP_WritePhyUshort(sc, 0x15, 0x03b8);
12251                 MP_WritePhyUshort(sc, 0x19, 0x543f);
12252                 MP_WritePhyUshort(sc, 0x15, 0x03b9);
12253                 MP_WritePhyUshort(sc, 0x19, 0x499a);
12254                 MP_WritePhyUshort(sc, 0x15, 0x03ba);
12255                 MP_WritePhyUshort(sc, 0x19, 0x7c40);
12256                 MP_WritePhyUshort(sc, 0x15, 0x03bb);
12257                 MP_WritePhyUshort(sc, 0x19, 0x4c40);
12258                 MP_WritePhyUshort(sc, 0x15, 0x03bc);
12259                 MP_WritePhyUshort(sc, 0x19, 0x490a);
12260                 MP_WritePhyUshort(sc, 0x15, 0x03bd);
12261                 MP_WritePhyUshort(sc, 0x19, 0x405e);
12262                 MP_WritePhyUshort(sc, 0x15, 0x03c2);
12263                 MP_WritePhyUshort(sc, 0x19, 0x9a03);
12264                 MP_WritePhyUshort(sc, 0x15, 0x03c4);
12265                 MP_WritePhyUshort(sc, 0x19, 0x0015);
12266                 MP_WritePhyUshort(sc, 0x15, 0x03c5);
12267                 MP_WritePhyUshort(sc, 0x19, 0x9e03);
12268                 MP_WritePhyUshort(sc, 0x15, 0x03c8);
12269                 MP_WritePhyUshort(sc, 0x19, 0x9cf7);
12270                 MP_WritePhyUshort(sc, 0x15, 0x03c9);
12271                 MP_WritePhyUshort(sc, 0x19, 0x7c12);
12272                 MP_WritePhyUshort(sc, 0x15, 0x03ca);
12273                 MP_WritePhyUshort(sc, 0x19, 0x4c52);
12274                 MP_WritePhyUshort(sc, 0x15, 0x03cb);
12275                 MP_WritePhyUshort(sc, 0x19, 0x4458);
12276                 MP_WritePhyUshort(sc, 0x15, 0x03cd);
12277                 MP_WritePhyUshort(sc, 0x19, 0x4c40);
12278                 MP_WritePhyUshort(sc, 0x15, 0x03ce);
12279                 MP_WritePhyUshort(sc, 0x19, 0x33bf);
12280                 MP_WritePhyUshort(sc, 0x15, 0x03cf);
12281                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12282                 MP_WritePhyUshort(sc, 0x15, 0x03d0);
12283                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12284                 MP_WritePhyUshort(sc, 0x15, 0x03d1);
12285                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12286                 MP_WritePhyUshort(sc, 0x15, 0x03d5);
12287                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12288                 MP_WritePhyUshort(sc, 0x15, 0x03d6);
12289                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12290                 MP_WritePhyUshort(sc, 0x15, 0x03d7);
12291                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12292                 MP_WritePhyUshort(sc, 0x15, 0x03d8);
12293                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12294                 MP_WritePhyUshort(sc, 0x15, 0x03d9);
12295                 MP_WritePhyUshort(sc, 0x19, 0x49bb);
12296                 MP_WritePhyUshort(sc, 0x15, 0x03da);
12297                 MP_WritePhyUshort(sc, 0x19, 0x4478);
12298                 MP_WritePhyUshort(sc, 0x15, 0x03db);
12299                 MP_WritePhyUshort(sc, 0x19, 0x492b);
12300                 MP_WritePhyUshort(sc, 0x15, 0x03dc);
12301                 MP_WritePhyUshort(sc, 0x19, 0x7c01);
12302                 MP_WritePhyUshort(sc, 0x15, 0x03dd);
12303                 MP_WritePhyUshort(sc, 0x19, 0x4c00);
12304                 MP_WritePhyUshort(sc, 0x15, 0x03de);
12305                 MP_WritePhyUshort(sc, 0x19, 0xbd1a);
12306                 MP_WritePhyUshort(sc, 0x15, 0x03df);
12307                 MP_WritePhyUshort(sc, 0x19, 0xc428);
12308                 MP_WritePhyUshort(sc, 0x15, 0x03e0);
12309                 MP_WritePhyUshort(sc, 0x19, 0x0008);
12310                 MP_WritePhyUshort(sc, 0x15, 0x03e1);
12311                 MP_WritePhyUshort(sc, 0x19, 0x9cfd);
12312                 MP_WritePhyUshort(sc, 0x15, 0x03e2);
12313                 MP_WritePhyUshort(sc, 0x19, 0x7c12);
12314                 MP_WritePhyUshort(sc, 0x15, 0x03e3);
12315                 MP_WritePhyUshort(sc, 0x19, 0x4c52);
12316                 MP_WritePhyUshort(sc, 0x15, 0x03e4);
12317                 MP_WritePhyUshort(sc, 0x19, 0x4458);
12318                 MP_WritePhyUshort(sc, 0x15, 0x03e5);
12319                 MP_WritePhyUshort(sc, 0x19, 0x7c12);
12320                 MP_WritePhyUshort(sc, 0x15, 0x03e6);
12321                 MP_WritePhyUshort(sc, 0x19, 0x4c40);
12322                 MP_WritePhyUshort(sc, 0x15, 0x03e7);
12323                 MP_WritePhyUshort(sc, 0x19, 0x33de);
12324                 MP_WritePhyUshort(sc, 0x15, 0x03e8);
12325                 MP_WritePhyUshort(sc, 0x19, 0xc218);
12326                 MP_WritePhyUshort(sc, 0x15, 0x03e9);
12327                 MP_WritePhyUshort(sc, 0x19, 0x0002);
12328                 MP_WritePhyUshort(sc, 0x15, 0x03ea);
12329                 MP_WritePhyUshort(sc, 0x19, 0x32df);
12330                 MP_WritePhyUshort(sc, 0x15, 0x03eb);
12331                 MP_WritePhyUshort(sc, 0x19, 0x3316);
12332                 MP_WritePhyUshort(sc, 0x15, 0x03ec);
12333                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12334                 MP_WritePhyUshort(sc, 0x15, 0x03ed);
12335                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12336                 MP_WritePhyUshort(sc, 0x15, 0x03ee);
12337                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12338                 MP_WritePhyUshort(sc, 0x15, 0x03ef);
12339                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12340                 MP_WritePhyUshort(sc, 0x15, 0x03f7);
12341                 MP_WritePhyUshort(sc, 0x19, 0x330c);
12342                 MP_WritePhyUshort(sc, 0x16, 0x0306);
12343                 MP_WritePhyUshort(sc, 0x16, 0x0300);
12344
12345                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
12346                 MP_WritePhyUshort(sc, 0x05, 0xfff6);
12347                 MP_WritePhyUshort(sc, 0x06, 0x0080);
12348                 MP_WritePhyUshort(sc, 0x05, 0x8000);
12349                 MP_WritePhyUshort(sc, 0x06, 0x0280);
12350                 MP_WritePhyUshort(sc, 0x06, 0x48f7);
12351                 MP_WritePhyUshort(sc, 0x06, 0x00e0);
12352                 MP_WritePhyUshort(sc, 0x06, 0xfff7);
12353                 MP_WritePhyUshort(sc, 0x06, 0xa080);
12354                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
12355                 MP_WritePhyUshort(sc, 0x06, 0xf602);
12356                 MP_WritePhyUshort(sc, 0x06, 0x0200);
12357                 MP_WritePhyUshort(sc, 0x06, 0x0280);
12358                 MP_WritePhyUshort(sc, 0x06, 0x9002);
12359                 MP_WritePhyUshort(sc, 0x06, 0x0224);
12360                 MP_WritePhyUshort(sc, 0x06, 0x0202);
12361                 MP_WritePhyUshort(sc, 0x06, 0x3402);
12362                 MP_WritePhyUshort(sc, 0x06, 0x027f);
12363                 MP_WritePhyUshort(sc, 0x06, 0x0280);
12364                 MP_WritePhyUshort(sc, 0x06, 0xa602);
12365                 MP_WritePhyUshort(sc, 0x06, 0x80bf);
12366                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
12367                 MP_WritePhyUshort(sc, 0x06, 0x88e1);
12368                 MP_WritePhyUshort(sc, 0x06, 0x8b89);
12369                 MP_WritePhyUshort(sc, 0x06, 0x1e01);
12370                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
12371                 MP_WritePhyUshort(sc, 0x06, 0x8a1e);
12372                 MP_WritePhyUshort(sc, 0x06, 0x01e1);
12373                 MP_WritePhyUshort(sc, 0x06, 0x8b8b);
12374                 MP_WritePhyUshort(sc, 0x06, 0x1e01);
12375                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
12376                 MP_WritePhyUshort(sc, 0x06, 0x8c1e);
12377                 MP_WritePhyUshort(sc, 0x06, 0x01e1);
12378                 MP_WritePhyUshort(sc, 0x06, 0x8b8d);
12379                 MP_WritePhyUshort(sc, 0x06, 0x1e01);
12380                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
12381                 MP_WritePhyUshort(sc, 0x06, 0x8e1e);
12382                 MP_WritePhyUshort(sc, 0x06, 0x01a0);
12383                 MP_WritePhyUshort(sc, 0x06, 0x00c7);
12384                 MP_WritePhyUshort(sc, 0x06, 0xaebb);
12385                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
12386                 MP_WritePhyUshort(sc, 0x06, 0xe600);
12387                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
12388                 MP_WritePhyUshort(sc, 0x06, 0xee03);
12389                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
12390                 MP_WritePhyUshort(sc, 0x06, 0xefb8);
12391                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
12392                 MP_WritePhyUshort(sc, 0x06, 0xe902);
12393                 MP_WritePhyUshort(sc, 0x06, 0xee8b);
12394                 MP_WritePhyUshort(sc, 0x06, 0x8285);
12395                 MP_WritePhyUshort(sc, 0x06, 0xee8b);
12396                 MP_WritePhyUshort(sc, 0x06, 0x8520);
12397                 MP_WritePhyUshort(sc, 0x06, 0xee8b);
12398                 MP_WritePhyUshort(sc, 0x06, 0x8701);
12399                 MP_WritePhyUshort(sc, 0x06, 0xd481);
12400                 MP_WritePhyUshort(sc, 0x06, 0x35e4);
12401                 MP_WritePhyUshort(sc, 0x06, 0x8b94);
12402                 MP_WritePhyUshort(sc, 0x06, 0xe58b);
12403                 MP_WritePhyUshort(sc, 0x06, 0x95bf);
12404                 MP_WritePhyUshort(sc, 0x06, 0x8b88);
12405                 MP_WritePhyUshort(sc, 0x06, 0xec00);
12406                 MP_WritePhyUshort(sc, 0x06, 0x19a9);
12407                 MP_WritePhyUshort(sc, 0x06, 0x8b90);
12408                 MP_WritePhyUshort(sc, 0x06, 0xf9ee);
12409                 MP_WritePhyUshort(sc, 0x06, 0xfff6);
12410                 MP_WritePhyUshort(sc, 0x06, 0x00ee);
12411                 MP_WritePhyUshort(sc, 0x06, 0xfff7);
12412                 MP_WritePhyUshort(sc, 0x06, 0xffe0);
12413                 MP_WritePhyUshort(sc, 0x06, 0xe140);
12414                 MP_WritePhyUshort(sc, 0x06, 0xe1e1);
12415                 MP_WritePhyUshort(sc, 0x06, 0x41f7);
12416                 MP_WritePhyUshort(sc, 0x06, 0x2ff6);
12417                 MP_WritePhyUshort(sc, 0x06, 0x28e4);
12418                 MP_WritePhyUshort(sc, 0x06, 0xe140);
12419                 MP_WritePhyUshort(sc, 0x06, 0xe5e1);
12420                 MP_WritePhyUshort(sc, 0x06, 0x4104);
12421                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
12422                 MP_WritePhyUshort(sc, 0x06, 0x8b89);
12423                 MP_WritePhyUshort(sc, 0x06, 0xad20);
12424                 MP_WritePhyUshort(sc, 0x06, 0x0dee);
12425                 MP_WritePhyUshort(sc, 0x06, 0x8b89);
12426                 MP_WritePhyUshort(sc, 0x06, 0x0002);
12427                 MP_WritePhyUshort(sc, 0x06, 0x82f4);
12428                 MP_WritePhyUshort(sc, 0x06, 0x021f);
12429                 MP_WritePhyUshort(sc, 0x06, 0x4102);
12430                 MP_WritePhyUshort(sc, 0x06, 0x2812);
12431                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
12432                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
12433                 MP_WritePhyUshort(sc, 0x06, 0x8b8d);
12434                 MP_WritePhyUshort(sc, 0x06, 0xad20);
12435                 MP_WritePhyUshort(sc, 0x06, 0x10ee);
12436                 MP_WritePhyUshort(sc, 0x06, 0x8b8d);
12437                 MP_WritePhyUshort(sc, 0x06, 0x0002);
12438                 MP_WritePhyUshort(sc, 0x06, 0x139d);
12439                 MP_WritePhyUshort(sc, 0x06, 0x0281);
12440                 MP_WritePhyUshort(sc, 0x06, 0xd602);
12441                 MP_WritePhyUshort(sc, 0x06, 0x1f99);
12442                 MP_WritePhyUshort(sc, 0x06, 0x0227);
12443                 MP_WritePhyUshort(sc, 0x06, 0xeafc);
12444                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
12445                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
12446                 MP_WritePhyUshort(sc, 0x06, 0x8ead);
12447                 MP_WritePhyUshort(sc, 0x06, 0x2014);
12448                 MP_WritePhyUshort(sc, 0x06, 0xf620);
12449                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
12450                 MP_WritePhyUshort(sc, 0x06, 0x8e02);
12451                 MP_WritePhyUshort(sc, 0x06, 0x8104);
12452                 MP_WritePhyUshort(sc, 0x06, 0x021b);
12453                 MP_WritePhyUshort(sc, 0x06, 0xf402);
12454                 MP_WritePhyUshort(sc, 0x06, 0x2c9c);
12455                 MP_WritePhyUshort(sc, 0x06, 0x0281);
12456                 MP_WritePhyUshort(sc, 0x06, 0x7902);
12457                 MP_WritePhyUshort(sc, 0x06, 0x8443);
12458                 MP_WritePhyUshort(sc, 0x06, 0xad22);
12459                 MP_WritePhyUshort(sc, 0x06, 0x11f6);
12460                 MP_WritePhyUshort(sc, 0x06, 0x22e4);
12461                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
12462                 MP_WritePhyUshort(sc, 0x06, 0x022c);
12463                 MP_WritePhyUshort(sc, 0x06, 0x4602);
12464                 MP_WritePhyUshort(sc, 0x06, 0x2ac5);
12465                 MP_WritePhyUshort(sc, 0x06, 0x0229);
12466                 MP_WritePhyUshort(sc, 0x06, 0x2002);
12467                 MP_WritePhyUshort(sc, 0x06, 0x2b91);
12468                 MP_WritePhyUshort(sc, 0x06, 0xad25);
12469                 MP_WritePhyUshort(sc, 0x06, 0x11f6);
12470                 MP_WritePhyUshort(sc, 0x06, 0x25e4);
12471                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
12472                 MP_WritePhyUshort(sc, 0x06, 0x0284);
12473                 MP_WritePhyUshort(sc, 0x06, 0xe202);
12474                 MP_WritePhyUshort(sc, 0x06, 0x043a);
12475                 MP_WritePhyUshort(sc, 0x06, 0x021a);
12476                 MP_WritePhyUshort(sc, 0x06, 0x5902);
12477                 MP_WritePhyUshort(sc, 0x06, 0x2bfc);
12478                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
12479                 MP_WritePhyUshort(sc, 0x06, 0xf8fa);
12480                 MP_WritePhyUshort(sc, 0x06, 0xef69);
12481                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
12482                 MP_WritePhyUshort(sc, 0x06, 0x00e1);
12483                 MP_WritePhyUshort(sc, 0x06, 0xe001);
12484                 MP_WritePhyUshort(sc, 0x06, 0xad27);
12485                 MP_WritePhyUshort(sc, 0x06, 0x1fd1);
12486                 MP_WritePhyUshort(sc, 0x06, 0x01bf);
12487                 MP_WritePhyUshort(sc, 0x06, 0x8638);
12488                 MP_WritePhyUshort(sc, 0x06, 0x022f);
12489                 MP_WritePhyUshort(sc, 0x06, 0x50e0);
12490                 MP_WritePhyUshort(sc, 0x06, 0xe020);
12491                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
12492                 MP_WritePhyUshort(sc, 0x06, 0x21ad);
12493                 MP_WritePhyUshort(sc, 0x06, 0x200e);
12494                 MP_WritePhyUshort(sc, 0x06, 0xd100);
12495                 MP_WritePhyUshort(sc, 0x06, 0xbf86);
12496                 MP_WritePhyUshort(sc, 0x06, 0x3802);
12497                 MP_WritePhyUshort(sc, 0x06, 0x2f50);
12498                 MP_WritePhyUshort(sc, 0x06, 0xbf3d);
12499                 MP_WritePhyUshort(sc, 0x06, 0x3902);
12500                 MP_WritePhyUshort(sc, 0x06, 0x2eb0);
12501                 MP_WritePhyUshort(sc, 0x06, 0xef96);
12502                 MP_WritePhyUshort(sc, 0x06, 0xfefc);
12503                 MP_WritePhyUshort(sc, 0x06, 0x0402);
12504                 MP_WritePhyUshort(sc, 0x06, 0x8591);
12505                 MP_WritePhyUshort(sc, 0x06, 0x0281);
12506                 MP_WritePhyUshort(sc, 0x06, 0x3c05);
12507                 MP_WritePhyUshort(sc, 0x06, 0xf8fa);
12508                 MP_WritePhyUshort(sc, 0x06, 0xef69);
12509                 MP_WritePhyUshort(sc, 0x06, 0xe0e2);
12510                 MP_WritePhyUshort(sc, 0x06, 0xfee1);
12511                 MP_WritePhyUshort(sc, 0x06, 0xe2ff);
12512                 MP_WritePhyUshort(sc, 0x06, 0xad2d);
12513                 MP_WritePhyUshort(sc, 0x06, 0x1ae0);
12514                 MP_WritePhyUshort(sc, 0x06, 0xe14e);
12515                 MP_WritePhyUshort(sc, 0x06, 0xe1e1);
12516                 MP_WritePhyUshort(sc, 0x06, 0x4fac);
12517                 MP_WritePhyUshort(sc, 0x06, 0x2d22);
12518                 MP_WritePhyUshort(sc, 0x06, 0xf603);
12519                 MP_WritePhyUshort(sc, 0x06, 0x0203);
12520                 MP_WritePhyUshort(sc, 0x06, 0x36f7);
12521                 MP_WritePhyUshort(sc, 0x06, 0x03f7);
12522                 MP_WritePhyUshort(sc, 0x06, 0x06bf);
12523                 MP_WritePhyUshort(sc, 0x06, 0x8622);
12524                 MP_WritePhyUshort(sc, 0x06, 0x022e);
12525                 MP_WritePhyUshort(sc, 0x06, 0xb0ae);
12526                 MP_WritePhyUshort(sc, 0x06, 0x11e0);
12527                 MP_WritePhyUshort(sc, 0x06, 0xe14e);
12528                 MP_WritePhyUshort(sc, 0x06, 0xe1e1);
12529                 MP_WritePhyUshort(sc, 0x06, 0x4fad);
12530                 MP_WritePhyUshort(sc, 0x06, 0x2d08);
12531                 MP_WritePhyUshort(sc, 0x06, 0xbf86);
12532                 MP_WritePhyUshort(sc, 0x06, 0x2d02);
12533                 MP_WritePhyUshort(sc, 0x06, 0x2eb0);
12534                 MP_WritePhyUshort(sc, 0x06, 0xf606);
12535                 MP_WritePhyUshort(sc, 0x06, 0xef96);
12536                 MP_WritePhyUshort(sc, 0x06, 0xfefc);
12537                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
12538                 MP_WritePhyUshort(sc, 0x06, 0xf9fa);
12539                 MP_WritePhyUshort(sc, 0x06, 0xef69);
12540                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
12541                 MP_WritePhyUshort(sc, 0x06, 0x87ad);
12542                 MP_WritePhyUshort(sc, 0x06, 0x204c);
12543                 MP_WritePhyUshort(sc, 0x06, 0xd200);
12544                 MP_WritePhyUshort(sc, 0x06, 0xe0e2);
12545                 MP_WritePhyUshort(sc, 0x06, 0x0058);
12546                 MP_WritePhyUshort(sc, 0x06, 0x010c);
12547                 MP_WritePhyUshort(sc, 0x06, 0x021e);
12548                 MP_WritePhyUshort(sc, 0x06, 0x20e0);
12549                 MP_WritePhyUshort(sc, 0x06, 0xe000);
12550                 MP_WritePhyUshort(sc, 0x06, 0x5810);
12551                 MP_WritePhyUshort(sc, 0x06, 0x1e20);
12552                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
12553                 MP_WritePhyUshort(sc, 0x06, 0x3658);
12554                 MP_WritePhyUshort(sc, 0x06, 0x031e);
12555                 MP_WritePhyUshort(sc, 0x06, 0x20e0);
12556                 MP_WritePhyUshort(sc, 0x06, 0xe022);
12557                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
12558                 MP_WritePhyUshort(sc, 0x06, 0x2358);
12559                 MP_WritePhyUshort(sc, 0x06, 0xe01e);
12560                 MP_WritePhyUshort(sc, 0x06, 0x20e0);
12561                 MP_WritePhyUshort(sc, 0x06, 0x8ae6);
12562                 MP_WritePhyUshort(sc, 0x06, 0x1f02);
12563                 MP_WritePhyUshort(sc, 0x06, 0x9e22);
12564                 MP_WritePhyUshort(sc, 0x06, 0xe68a);
12565                 MP_WritePhyUshort(sc, 0x06, 0xe6ad);
12566                 MP_WritePhyUshort(sc, 0x06, 0x3214);
12567                 MP_WritePhyUshort(sc, 0x06, 0xad34);
12568                 MP_WritePhyUshort(sc, 0x06, 0x11ef);
12569                 MP_WritePhyUshort(sc, 0x06, 0x0258);
12570                 MP_WritePhyUshort(sc, 0x06, 0x039e);
12571                 MP_WritePhyUshort(sc, 0x06, 0x07ad);
12572                 MP_WritePhyUshort(sc, 0x06, 0x3508);
12573                 MP_WritePhyUshort(sc, 0x06, 0x5ac0);
12574                 MP_WritePhyUshort(sc, 0x06, 0x9f04);
12575                 MP_WritePhyUshort(sc, 0x06, 0xd101);
12576                 MP_WritePhyUshort(sc, 0x06, 0xae02);
12577                 MP_WritePhyUshort(sc, 0x06, 0xd100);
12578                 MP_WritePhyUshort(sc, 0x06, 0xbf86);
12579                 MP_WritePhyUshort(sc, 0x06, 0x3e02);
12580                 MP_WritePhyUshort(sc, 0x06, 0x2f50);
12581                 MP_WritePhyUshort(sc, 0x06, 0xef96);
12582                 MP_WritePhyUshort(sc, 0x06, 0xfefd);
12583                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
12584                 MP_WritePhyUshort(sc, 0x06, 0xf8f9);
12585                 MP_WritePhyUshort(sc, 0x06, 0xfae0);
12586                 MP_WritePhyUshort(sc, 0x06, 0x8b81);
12587                 MP_WritePhyUshort(sc, 0x06, 0xac26);
12588                 MP_WritePhyUshort(sc, 0x06, 0x0ee0);
12589                 MP_WritePhyUshort(sc, 0x06, 0x8b81);
12590                 MP_WritePhyUshort(sc, 0x06, 0xac21);
12591                 MP_WritePhyUshort(sc, 0x06, 0x08e0);
12592                 MP_WritePhyUshort(sc, 0x06, 0x8b87);
12593                 MP_WritePhyUshort(sc, 0x06, 0xac24);
12594                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
12595                 MP_WritePhyUshort(sc, 0x06, 0x6bee);
12596                 MP_WritePhyUshort(sc, 0x06, 0xe0ea);
12597                 MP_WritePhyUshort(sc, 0x06, 0x00ee);
12598                 MP_WritePhyUshort(sc, 0x06, 0xe0eb);
12599                 MP_WritePhyUshort(sc, 0x06, 0x00e2);
12600                 MP_WritePhyUshort(sc, 0x06, 0xe07c);
12601                 MP_WritePhyUshort(sc, 0x06, 0xe3e0);
12602                 MP_WritePhyUshort(sc, 0x06, 0x7da5);
12603                 MP_WritePhyUshort(sc, 0x06, 0x1111);
12604                 MP_WritePhyUshort(sc, 0x06, 0x15d2);
12605                 MP_WritePhyUshort(sc, 0x06, 0x60d6);
12606                 MP_WritePhyUshort(sc, 0x06, 0x6666);
12607                 MP_WritePhyUshort(sc, 0x06, 0x0207);
12608                 MP_WritePhyUshort(sc, 0x06, 0xf9d2);
12609                 MP_WritePhyUshort(sc, 0x06, 0xa0d6);
12610                 MP_WritePhyUshort(sc, 0x06, 0xaaaa);
12611                 MP_WritePhyUshort(sc, 0x06, 0x0207);
12612                 MP_WritePhyUshort(sc, 0x06, 0xf902);
12613                 MP_WritePhyUshort(sc, 0x06, 0x825c);
12614                 MP_WritePhyUshort(sc, 0x06, 0xae44);
12615                 MP_WritePhyUshort(sc, 0x06, 0xa566);
12616                 MP_WritePhyUshort(sc, 0x06, 0x6602);
12617                 MP_WritePhyUshort(sc, 0x06, 0xae38);
12618                 MP_WritePhyUshort(sc, 0x06, 0xa5aa);
12619                 MP_WritePhyUshort(sc, 0x06, 0xaa02);
12620                 MP_WritePhyUshort(sc, 0x06, 0xae32);
12621                 MP_WritePhyUshort(sc, 0x06, 0xeee0);
12622                 MP_WritePhyUshort(sc, 0x06, 0xea04);
12623                 MP_WritePhyUshort(sc, 0x06, 0xeee0);
12624                 MP_WritePhyUshort(sc, 0x06, 0xeb06);
12625                 MP_WritePhyUshort(sc, 0x06, 0xe2e0);
12626                 MP_WritePhyUshort(sc, 0x06, 0x7ce3);
12627                 MP_WritePhyUshort(sc, 0x06, 0xe07d);
12628                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
12629                 MP_WritePhyUshort(sc, 0x06, 0x38e1);
12630                 MP_WritePhyUshort(sc, 0x06, 0xe039);
12631                 MP_WritePhyUshort(sc, 0x06, 0xad2e);
12632                 MP_WritePhyUshort(sc, 0x06, 0x21ad);
12633                 MP_WritePhyUshort(sc, 0x06, 0x3f13);
12634                 MP_WritePhyUshort(sc, 0x06, 0xe0e4);
12635                 MP_WritePhyUshort(sc, 0x06, 0x14e1);
12636                 MP_WritePhyUshort(sc, 0x06, 0xe415);
12637                 MP_WritePhyUshort(sc, 0x06, 0x6880);
12638                 MP_WritePhyUshort(sc, 0x06, 0xe4e4);
12639                 MP_WritePhyUshort(sc, 0x06, 0x14e5);
12640                 MP_WritePhyUshort(sc, 0x06, 0xe415);
12641                 MP_WritePhyUshort(sc, 0x06, 0x0282);
12642                 MP_WritePhyUshort(sc, 0x06, 0x5cae);
12643                 MP_WritePhyUshort(sc, 0x06, 0x0bac);
12644                 MP_WritePhyUshort(sc, 0x06, 0x3e02);
12645                 MP_WritePhyUshort(sc, 0x06, 0xae06);
12646                 MP_WritePhyUshort(sc, 0x06, 0x0282);
12647                 MP_WritePhyUshort(sc, 0x06, 0x8602);
12648                 MP_WritePhyUshort(sc, 0x06, 0x82b0);
12649                 MP_WritePhyUshort(sc, 0x06, 0xfefd);
12650                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
12651                 MP_WritePhyUshort(sc, 0x06, 0xf8e1);
12652                 MP_WritePhyUshort(sc, 0x06, 0x8b2e);
12653                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
12654                 MP_WritePhyUshort(sc, 0x06, 0x81ad);
12655                 MP_WritePhyUshort(sc, 0x06, 0x2605);
12656                 MP_WritePhyUshort(sc, 0x06, 0x0221);
12657                 MP_WritePhyUshort(sc, 0x06, 0xf3f7);
12658                 MP_WritePhyUshort(sc, 0x06, 0x28e0);
12659                 MP_WritePhyUshort(sc, 0x06, 0x8b81);
12660                 MP_WritePhyUshort(sc, 0x06, 0xad21);
12661                 MP_WritePhyUshort(sc, 0x06, 0x0502);
12662                 MP_WritePhyUshort(sc, 0x06, 0x22f8);
12663                 MP_WritePhyUshort(sc, 0x06, 0xf729);
12664                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
12665                 MP_WritePhyUshort(sc, 0x06, 0x87ad);
12666                 MP_WritePhyUshort(sc, 0x06, 0x2405);
12667                 MP_WritePhyUshort(sc, 0x06, 0x0282);
12668                 MP_WritePhyUshort(sc, 0x06, 0xebf7);
12669                 MP_WritePhyUshort(sc, 0x06, 0x2ae5);
12670                 MP_WritePhyUshort(sc, 0x06, 0x8b2e);
12671                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
12672                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
12673                 MP_WritePhyUshort(sc, 0x06, 0x8b81);
12674                 MP_WritePhyUshort(sc, 0x06, 0xad26);
12675                 MP_WritePhyUshort(sc, 0x06, 0x0302);
12676                 MP_WritePhyUshort(sc, 0x06, 0x2134);
12677                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
12678                 MP_WritePhyUshort(sc, 0x06, 0x81ad);
12679                 MP_WritePhyUshort(sc, 0x06, 0x2109);
12680                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
12681                 MP_WritePhyUshort(sc, 0x06, 0x2eac);
12682                 MP_WritePhyUshort(sc, 0x06, 0x2003);
12683                 MP_WritePhyUshort(sc, 0x06, 0x0283);
12684                 MP_WritePhyUshort(sc, 0x06, 0x52e0);
12685                 MP_WritePhyUshort(sc, 0x06, 0x8b87);
12686                 MP_WritePhyUshort(sc, 0x06, 0xad24);
12687                 MP_WritePhyUshort(sc, 0x06, 0x09e0);
12688                 MP_WritePhyUshort(sc, 0x06, 0x8b2e);
12689                 MP_WritePhyUshort(sc, 0x06, 0xac21);
12690                 MP_WritePhyUshort(sc, 0x06, 0x0302);
12691                 MP_WritePhyUshort(sc, 0x06, 0x8337);
12692                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
12693                 MP_WritePhyUshort(sc, 0x06, 0xf8e1);
12694                 MP_WritePhyUshort(sc, 0x06, 0x8b2e);
12695                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
12696                 MP_WritePhyUshort(sc, 0x06, 0x81ad);
12697                 MP_WritePhyUshort(sc, 0x06, 0x2608);
12698                 MP_WritePhyUshort(sc, 0x06, 0xe085);
12699                 MP_WritePhyUshort(sc, 0x06, 0xd2ad);
12700                 MP_WritePhyUshort(sc, 0x06, 0x2502);
12701                 MP_WritePhyUshort(sc, 0x06, 0xf628);
12702                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
12703                 MP_WritePhyUshort(sc, 0x06, 0x81ad);
12704                 MP_WritePhyUshort(sc, 0x06, 0x210a);
12705                 MP_WritePhyUshort(sc, 0x06, 0xe086);
12706                 MP_WritePhyUshort(sc, 0x06, 0x0af6);
12707                 MP_WritePhyUshort(sc, 0x06, 0x27a0);
12708                 MP_WritePhyUshort(sc, 0x06, 0x0502);
12709                 MP_WritePhyUshort(sc, 0x06, 0xf629);
12710                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
12711                 MP_WritePhyUshort(sc, 0x06, 0x87ad);
12712                 MP_WritePhyUshort(sc, 0x06, 0x2408);
12713                 MP_WritePhyUshort(sc, 0x06, 0xe08a);
12714                 MP_WritePhyUshort(sc, 0x06, 0xedad);
12715                 MP_WritePhyUshort(sc, 0x06, 0x2002);
12716                 MP_WritePhyUshort(sc, 0x06, 0xf62a);
12717                 MP_WritePhyUshort(sc, 0x06, 0xe58b);
12718                 MP_WritePhyUshort(sc, 0x06, 0x2ea1);
12719                 MP_WritePhyUshort(sc, 0x06, 0x0003);
12720                 MP_WritePhyUshort(sc, 0x06, 0x0221);
12721                 MP_WritePhyUshort(sc, 0x06, 0x11fc);
12722                 MP_WritePhyUshort(sc, 0x06, 0x04ee);
12723                 MP_WritePhyUshort(sc, 0x06, 0x8aed);
12724                 MP_WritePhyUshort(sc, 0x06, 0x00ee);
12725                 MP_WritePhyUshort(sc, 0x06, 0x8aec);
12726                 MP_WritePhyUshort(sc, 0x06, 0x0004);
12727                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
12728                 MP_WritePhyUshort(sc, 0x06, 0x8b87);
12729                 MP_WritePhyUshort(sc, 0x06, 0xad24);
12730                 MP_WritePhyUshort(sc, 0x06, 0x3ae0);
12731                 MP_WritePhyUshort(sc, 0x06, 0xe0ea);
12732                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
12733                 MP_WritePhyUshort(sc, 0x06, 0xeb58);
12734                 MP_WritePhyUshort(sc, 0x06, 0xf8d1);
12735                 MP_WritePhyUshort(sc, 0x06, 0x01e4);
12736                 MP_WritePhyUshort(sc, 0x06, 0xe0ea);
12737                 MP_WritePhyUshort(sc, 0x06, 0xe5e0);
12738                 MP_WritePhyUshort(sc, 0x06, 0xebe0);
12739                 MP_WritePhyUshort(sc, 0x06, 0xe07c);
12740                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
12741                 MP_WritePhyUshort(sc, 0x06, 0x7d5c);
12742                 MP_WritePhyUshort(sc, 0x06, 0x00ff);
12743                 MP_WritePhyUshort(sc, 0x06, 0x3c00);
12744                 MP_WritePhyUshort(sc, 0x06, 0x1eab);
12745                 MP_WritePhyUshort(sc, 0x06, 0x1ce0);
12746                 MP_WritePhyUshort(sc, 0x06, 0xe04c);
12747                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
12748                 MP_WritePhyUshort(sc, 0x06, 0x4d58);
12749                 MP_WritePhyUshort(sc, 0x06, 0xc1e4);
12750                 MP_WritePhyUshort(sc, 0x06, 0xe04c);
12751                 MP_WritePhyUshort(sc, 0x06, 0xe5e0);
12752                 MP_WritePhyUshort(sc, 0x06, 0x4de0);
12753                 MP_WritePhyUshort(sc, 0x06, 0xe0ee);
12754                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
12755                 MP_WritePhyUshort(sc, 0x06, 0xef69);
12756                 MP_WritePhyUshort(sc, 0x06, 0x3ce4);
12757                 MP_WritePhyUshort(sc, 0x06, 0xe0ee);
12758                 MP_WritePhyUshort(sc, 0x06, 0xe5e0);
12759                 MP_WritePhyUshort(sc, 0x06, 0xeffc);
12760                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
12761                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
12762                 MP_WritePhyUshort(sc, 0x06, 0x87ad);
12763                 MP_WritePhyUshort(sc, 0x06, 0x2412);
12764                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
12765                 MP_WritePhyUshort(sc, 0x06, 0xeee1);
12766                 MP_WritePhyUshort(sc, 0x06, 0xe0ef);
12767                 MP_WritePhyUshort(sc, 0x06, 0x59c3);
12768                 MP_WritePhyUshort(sc, 0x06, 0xe4e0);
12769                 MP_WritePhyUshort(sc, 0x06, 0xeee5);
12770                 MP_WritePhyUshort(sc, 0x06, 0xe0ef);
12771                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
12772                 MP_WritePhyUshort(sc, 0x06, 0xed01);
12773                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
12774                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
12775                 MP_WritePhyUshort(sc, 0x06, 0x8b81);
12776                 MP_WritePhyUshort(sc, 0x06, 0xac25);
12777                 MP_WritePhyUshort(sc, 0x06, 0x0502);
12778                 MP_WritePhyUshort(sc, 0x06, 0x8363);
12779                 MP_WritePhyUshort(sc, 0x06, 0xae03);
12780                 MP_WritePhyUshort(sc, 0x06, 0x0225);
12781                 MP_WritePhyUshort(sc, 0x06, 0x16fc);
12782                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
12783                 MP_WritePhyUshort(sc, 0x06, 0xf9fa);
12784                 MP_WritePhyUshort(sc, 0x06, 0xef69);
12785                 MP_WritePhyUshort(sc, 0x06, 0xfae0);
12786                 MP_WritePhyUshort(sc, 0x06, 0x860a);
12787                 MP_WritePhyUshort(sc, 0x06, 0xa000);
12788                 MP_WritePhyUshort(sc, 0x06, 0x19e0);
12789                 MP_WritePhyUshort(sc, 0x06, 0x860b);
12790                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
12791                 MP_WritePhyUshort(sc, 0x06, 0x331b);
12792                 MP_WritePhyUshort(sc, 0x06, 0x109e);
12793                 MP_WritePhyUshort(sc, 0x06, 0x04aa);
12794                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
12795                 MP_WritePhyUshort(sc, 0x06, 0x06ee);
12796                 MP_WritePhyUshort(sc, 0x06, 0x860a);
12797                 MP_WritePhyUshort(sc, 0x06, 0x01ae);
12798                 MP_WritePhyUshort(sc, 0x06, 0xe602);
12799                 MP_WritePhyUshort(sc, 0x06, 0x241e);
12800                 MP_WritePhyUshort(sc, 0x06, 0xae14);
12801                 MP_WritePhyUshort(sc, 0x06, 0xa001);
12802                 MP_WritePhyUshort(sc, 0x06, 0x1402);
12803                 MP_WritePhyUshort(sc, 0x06, 0x2426);
12804                 MP_WritePhyUshort(sc, 0x06, 0xbf26);
12805                 MP_WritePhyUshort(sc, 0x06, 0x6d02);
12806                 MP_WritePhyUshort(sc, 0x06, 0x2eb0);
12807                 MP_WritePhyUshort(sc, 0x06, 0xee86);
12808                 MP_WritePhyUshort(sc, 0x06, 0x0b00);
12809                 MP_WritePhyUshort(sc, 0x06, 0xee86);
12810                 MP_WritePhyUshort(sc, 0x06, 0x0a02);
12811                 MP_WritePhyUshort(sc, 0x06, 0xaf84);
12812                 MP_WritePhyUshort(sc, 0x06, 0x3ca0);
12813                 MP_WritePhyUshort(sc, 0x06, 0x0252);
12814                 MP_WritePhyUshort(sc, 0x06, 0xee86);
12815                 MP_WritePhyUshort(sc, 0x06, 0x0400);
12816                 MP_WritePhyUshort(sc, 0x06, 0xee86);
12817                 MP_WritePhyUshort(sc, 0x06, 0x0500);
12818                 MP_WritePhyUshort(sc, 0x06, 0xe086);
12819                 MP_WritePhyUshort(sc, 0x06, 0x0be1);
12820                 MP_WritePhyUshort(sc, 0x06, 0x8b32);
12821                 MP_WritePhyUshort(sc, 0x06, 0x1b10);
12822                 MP_WritePhyUshort(sc, 0x06, 0x9e04);
12823                 MP_WritePhyUshort(sc, 0x06, 0xaa02);
12824                 MP_WritePhyUshort(sc, 0x06, 0xaecb);
12825                 MP_WritePhyUshort(sc, 0x06, 0xee86);
12826                 MP_WritePhyUshort(sc, 0x06, 0x0b00);
12827                 MP_WritePhyUshort(sc, 0x06, 0x0224);
12828                 MP_WritePhyUshort(sc, 0x06, 0x3ae2);
12829                 MP_WritePhyUshort(sc, 0x06, 0x8604);
12830                 MP_WritePhyUshort(sc, 0x06, 0xe386);
12831                 MP_WritePhyUshort(sc, 0x06, 0x05ef);
12832                 MP_WritePhyUshort(sc, 0x06, 0x65e2);
12833                 MP_WritePhyUshort(sc, 0x06, 0x8606);
12834                 MP_WritePhyUshort(sc, 0x06, 0xe386);
12835                 MP_WritePhyUshort(sc, 0x06, 0x071b);
12836                 MP_WritePhyUshort(sc, 0x06, 0x56aa);
12837                 MP_WritePhyUshort(sc, 0x06, 0x0eef);
12838                 MP_WritePhyUshort(sc, 0x06, 0x56e6);
12839                 MP_WritePhyUshort(sc, 0x06, 0x8606);
12840                 MP_WritePhyUshort(sc, 0x06, 0xe786);
12841                 MP_WritePhyUshort(sc, 0x06, 0x07e2);
12842                 MP_WritePhyUshort(sc, 0x06, 0x8609);
12843                 MP_WritePhyUshort(sc, 0x06, 0xe686);
12844                 MP_WritePhyUshort(sc, 0x06, 0x08e0);
12845                 MP_WritePhyUshort(sc, 0x06, 0x8609);
12846                 MP_WritePhyUshort(sc, 0x06, 0xa000);
12847                 MP_WritePhyUshort(sc, 0x06, 0x07ee);
12848                 MP_WritePhyUshort(sc, 0x06, 0x860a);
12849                 MP_WritePhyUshort(sc, 0x06, 0x03af);
12850                 MP_WritePhyUshort(sc, 0x06, 0x8369);
12851                 MP_WritePhyUshort(sc, 0x06, 0x0224);
12852                 MP_WritePhyUshort(sc, 0x06, 0x8e02);
12853                 MP_WritePhyUshort(sc, 0x06, 0x2426);
12854                 MP_WritePhyUshort(sc, 0x06, 0xae48);
12855                 MP_WritePhyUshort(sc, 0x06, 0xa003);
12856                 MP_WritePhyUshort(sc, 0x06, 0x21e0);
12857                 MP_WritePhyUshort(sc, 0x06, 0x8608);
12858                 MP_WritePhyUshort(sc, 0x06, 0xe186);
12859                 MP_WritePhyUshort(sc, 0x06, 0x091b);
12860                 MP_WritePhyUshort(sc, 0x06, 0x019e);
12861                 MP_WritePhyUshort(sc, 0x06, 0x0caa);
12862                 MP_WritePhyUshort(sc, 0x06, 0x0502);
12863                 MP_WritePhyUshort(sc, 0x06, 0x249d);
12864                 MP_WritePhyUshort(sc, 0x06, 0xaee7);
12865                 MP_WritePhyUshort(sc, 0x06, 0x0224);
12866                 MP_WritePhyUshort(sc, 0x06, 0x8eae);
12867                 MP_WritePhyUshort(sc, 0x06, 0xe2ee);
12868                 MP_WritePhyUshort(sc, 0x06, 0x860a);
12869                 MP_WritePhyUshort(sc, 0x06, 0x04ee);
12870                 MP_WritePhyUshort(sc, 0x06, 0x860b);
12871                 MP_WritePhyUshort(sc, 0x06, 0x00af);
12872                 MP_WritePhyUshort(sc, 0x06, 0x8369);
12873                 MP_WritePhyUshort(sc, 0x06, 0xa004);
12874                 MP_WritePhyUshort(sc, 0x06, 0x15e0);
12875                 MP_WritePhyUshort(sc, 0x06, 0x860b);
12876                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
12877                 MP_WritePhyUshort(sc, 0x06, 0x341b);
12878                 MP_WritePhyUshort(sc, 0x06, 0x109e);
12879                 MP_WritePhyUshort(sc, 0x06, 0x05aa);
12880                 MP_WritePhyUshort(sc, 0x06, 0x03af);
12881                 MP_WritePhyUshort(sc, 0x06, 0x8383);
12882                 MP_WritePhyUshort(sc, 0x06, 0xee86);
12883                 MP_WritePhyUshort(sc, 0x06, 0x0a05);
12884                 MP_WritePhyUshort(sc, 0x06, 0xae0c);
12885                 MP_WritePhyUshort(sc, 0x06, 0xa005);
12886                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
12887                 MP_WritePhyUshort(sc, 0x06, 0x0702);
12888                 MP_WritePhyUshort(sc, 0x06, 0x2309);
12889                 MP_WritePhyUshort(sc, 0x06, 0xee86);
12890                 MP_WritePhyUshort(sc, 0x06, 0x0a00);
12891                 MP_WritePhyUshort(sc, 0x06, 0xfeef);
12892                 MP_WritePhyUshort(sc, 0x06, 0x96fe);
12893                 MP_WritePhyUshort(sc, 0x06, 0xfdfc);
12894                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
12895                 MP_WritePhyUshort(sc, 0x06, 0xf9fa);
12896                 MP_WritePhyUshort(sc, 0x06, 0xef69);
12897                 MP_WritePhyUshort(sc, 0x06, 0xfbe0);
12898                 MP_WritePhyUshort(sc, 0x06, 0x8b85);
12899                 MP_WritePhyUshort(sc, 0x06, 0xad25);
12900                 MP_WritePhyUshort(sc, 0x06, 0x22e0);
12901                 MP_WritePhyUshort(sc, 0x06, 0xe022);
12902                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
12903                 MP_WritePhyUshort(sc, 0x06, 0x23e2);
12904                 MP_WritePhyUshort(sc, 0x06, 0xe036);
12905                 MP_WritePhyUshort(sc, 0x06, 0xe3e0);
12906                 MP_WritePhyUshort(sc, 0x06, 0x375a);
12907                 MP_WritePhyUshort(sc, 0x06, 0xc40d);
12908                 MP_WritePhyUshort(sc, 0x06, 0x0158);
12909                 MP_WritePhyUshort(sc, 0x06, 0x021e);
12910                 MP_WritePhyUshort(sc, 0x06, 0x20e3);
12911                 MP_WritePhyUshort(sc, 0x06, 0x8ae7);
12912                 MP_WritePhyUshort(sc, 0x06, 0xac31);
12913                 MP_WritePhyUshort(sc, 0x06, 0x60ac);
12914                 MP_WritePhyUshort(sc, 0x06, 0x3a08);
12915                 MP_WritePhyUshort(sc, 0x06, 0xac3e);
12916                 MP_WritePhyUshort(sc, 0x06, 0x26ae);
12917                 MP_WritePhyUshort(sc, 0x06, 0x67af);
12918                 MP_WritePhyUshort(sc, 0x06, 0x84db);
12919                 MP_WritePhyUshort(sc, 0x06, 0xad37);
12920                 MP_WritePhyUshort(sc, 0x06, 0x61e0);
12921                 MP_WritePhyUshort(sc, 0x06, 0x8ae8);
12922                 MP_WritePhyUshort(sc, 0x06, 0x10e4);
12923                 MP_WritePhyUshort(sc, 0x06, 0x8ae8);
12924                 MP_WritePhyUshort(sc, 0x06, 0xe18a);
12925                 MP_WritePhyUshort(sc, 0x06, 0xe91b);
12926                 MP_WritePhyUshort(sc, 0x06, 0x109e);
12927                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
12928                 MP_WritePhyUshort(sc, 0x06, 0x51d1);
12929                 MP_WritePhyUshort(sc, 0x06, 0x00bf);
12930                 MP_WritePhyUshort(sc, 0x06, 0x863b);
12931                 MP_WritePhyUshort(sc, 0x06, 0x022f);
12932                 MP_WritePhyUshort(sc, 0x06, 0x50ee);
12933                 MP_WritePhyUshort(sc, 0x06, 0x8ae8);
12934                 MP_WritePhyUshort(sc, 0x06, 0x00ae);
12935                 MP_WritePhyUshort(sc, 0x06, 0x43ad);
12936                 MP_WritePhyUshort(sc, 0x06, 0x3627);
12937                 MP_WritePhyUshort(sc, 0x06, 0xe08a);
12938                 MP_WritePhyUshort(sc, 0x06, 0xeee1);
12939                 MP_WritePhyUshort(sc, 0x06, 0x8aef);
12940                 MP_WritePhyUshort(sc, 0x06, 0xef74);
12941                 MP_WritePhyUshort(sc, 0x06, 0xe08a);
12942                 MP_WritePhyUshort(sc, 0x06, 0xeae1);
12943                 MP_WritePhyUshort(sc, 0x06, 0x8aeb);
12944                 MP_WritePhyUshort(sc, 0x06, 0x1b74);
12945                 MP_WritePhyUshort(sc, 0x06, 0x9e2e);
12946                 MP_WritePhyUshort(sc, 0x06, 0x14e4);
12947                 MP_WritePhyUshort(sc, 0x06, 0x8aea);
12948                 MP_WritePhyUshort(sc, 0x06, 0xe58a);
12949                 MP_WritePhyUshort(sc, 0x06, 0xebef);
12950                 MP_WritePhyUshort(sc, 0x06, 0x74e0);
12951                 MP_WritePhyUshort(sc, 0x06, 0x8aee);
12952                 MP_WritePhyUshort(sc, 0x06, 0xe18a);
12953                 MP_WritePhyUshort(sc, 0x06, 0xef1b);
12954                 MP_WritePhyUshort(sc, 0x06, 0x479e);
12955                 MP_WritePhyUshort(sc, 0x06, 0x0fae);
12956                 MP_WritePhyUshort(sc, 0x06, 0x19ee);
12957                 MP_WritePhyUshort(sc, 0x06, 0x8aea);
12958                 MP_WritePhyUshort(sc, 0x06, 0x00ee);
12959                 MP_WritePhyUshort(sc, 0x06, 0x8aeb);
12960                 MP_WritePhyUshort(sc, 0x06, 0x00ae);
12961                 MP_WritePhyUshort(sc, 0x06, 0x0fac);
12962                 MP_WritePhyUshort(sc, 0x06, 0x390c);
12963                 MP_WritePhyUshort(sc, 0x06, 0xd101);
12964                 MP_WritePhyUshort(sc, 0x06, 0xbf86);
12965                 MP_WritePhyUshort(sc, 0x06, 0x3b02);
12966                 MP_WritePhyUshort(sc, 0x06, 0x2f50);
12967                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
12968                 MP_WritePhyUshort(sc, 0x06, 0xe800);
12969                 MP_WritePhyUshort(sc, 0x06, 0xe68a);
12970                 MP_WritePhyUshort(sc, 0x06, 0xe7ff);
12971                 MP_WritePhyUshort(sc, 0x06, 0xef96);
12972                 MP_WritePhyUshort(sc, 0x06, 0xfefd);
12973                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
12974                 MP_WritePhyUshort(sc, 0x06, 0xf8f9);
12975                 MP_WritePhyUshort(sc, 0x06, 0xfaef);
12976                 MP_WritePhyUshort(sc, 0x06, 0x69e0);
12977                 MP_WritePhyUshort(sc, 0x06, 0xe022);
12978                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
12979                 MP_WritePhyUshort(sc, 0x06, 0x2358);
12980                 MP_WritePhyUshort(sc, 0x06, 0xc4e1);
12981                 MP_WritePhyUshort(sc, 0x06, 0x8b6e);
12982                 MP_WritePhyUshort(sc, 0x06, 0x1f10);
12983                 MP_WritePhyUshort(sc, 0x06, 0x9e24);
12984                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
12985                 MP_WritePhyUshort(sc, 0x06, 0x6ead);
12986                 MP_WritePhyUshort(sc, 0x06, 0x2218);
12987                 MP_WritePhyUshort(sc, 0x06, 0xac27);
12988                 MP_WritePhyUshort(sc, 0x06, 0x0dac);
12989                 MP_WritePhyUshort(sc, 0x06, 0x2605);
12990                 MP_WritePhyUshort(sc, 0x06, 0x0203);
12991                 MP_WritePhyUshort(sc, 0x06, 0x8fae);
12992                 MP_WritePhyUshort(sc, 0x06, 0x1302);
12993                 MP_WritePhyUshort(sc, 0x06, 0x03c8);
12994                 MP_WritePhyUshort(sc, 0x06, 0xae0e);
12995                 MP_WritePhyUshort(sc, 0x06, 0x0203);
12996                 MP_WritePhyUshort(sc, 0x06, 0xe102);
12997                 MP_WritePhyUshort(sc, 0x06, 0x8520);
12998                 MP_WritePhyUshort(sc, 0x06, 0xae06);
12999                 MP_WritePhyUshort(sc, 0x06, 0x0203);
13000                 MP_WritePhyUshort(sc, 0x06, 0x8f02);
13001                 MP_WritePhyUshort(sc, 0x06, 0x8566);
13002                 MP_WritePhyUshort(sc, 0x06, 0xef96);
13003                 MP_WritePhyUshort(sc, 0x06, 0xfefd);
13004                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
13005                 MP_WritePhyUshort(sc, 0x06, 0xf8fa);
13006                 MP_WritePhyUshort(sc, 0x06, 0xef69);
13007                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
13008                 MP_WritePhyUshort(sc, 0x06, 0x82ad);
13009                 MP_WritePhyUshort(sc, 0x06, 0x2737);
13010                 MP_WritePhyUshort(sc, 0x06, 0xbf86);
13011                 MP_WritePhyUshort(sc, 0x06, 0x4402);
13012                 MP_WritePhyUshort(sc, 0x06, 0x2f23);
13013                 MP_WritePhyUshort(sc, 0x06, 0xac28);
13014                 MP_WritePhyUshort(sc, 0x06, 0x2ed1);
13015                 MP_WritePhyUshort(sc, 0x06, 0x01bf);
13016                 MP_WritePhyUshort(sc, 0x06, 0x8647);
13017                 MP_WritePhyUshort(sc, 0x06, 0x022f);
13018                 MP_WritePhyUshort(sc, 0x06, 0x50bf);
13019                 MP_WritePhyUshort(sc, 0x06, 0x8641);
13020                 MP_WritePhyUshort(sc, 0x06, 0x022f);
13021                 MP_WritePhyUshort(sc, 0x06, 0x23e5);
13022                 MP_WritePhyUshort(sc, 0x06, 0x8af0);
13023                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
13024                 MP_WritePhyUshort(sc, 0x06, 0x22e1);
13025                 MP_WritePhyUshort(sc, 0x06, 0xe023);
13026                 MP_WritePhyUshort(sc, 0x06, 0xac2e);
13027                 MP_WritePhyUshort(sc, 0x06, 0x04d1);
13028                 MP_WritePhyUshort(sc, 0x06, 0x01ae);
13029                 MP_WritePhyUshort(sc, 0x06, 0x02d1);
13030                 MP_WritePhyUshort(sc, 0x06, 0x00bf);
13031                 MP_WritePhyUshort(sc, 0x06, 0x8641);
13032                 MP_WritePhyUshort(sc, 0x06, 0x022f);
13033                 MP_WritePhyUshort(sc, 0x06, 0x50d1);
13034                 MP_WritePhyUshort(sc, 0x06, 0x01bf);
13035                 MP_WritePhyUshort(sc, 0x06, 0x8644);
13036                 MP_WritePhyUshort(sc, 0x06, 0x022f);
13037                 MP_WritePhyUshort(sc, 0x06, 0x50ef);
13038                 MP_WritePhyUshort(sc, 0x06, 0x96fe);
13039                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
13040                 MP_WritePhyUshort(sc, 0x06, 0xf8fa);
13041                 MP_WritePhyUshort(sc, 0x06, 0xef69);
13042                 MP_WritePhyUshort(sc, 0x06, 0xbf86);
13043                 MP_WritePhyUshort(sc, 0x06, 0x4702);
13044                 MP_WritePhyUshort(sc, 0x06, 0x2f23);
13045                 MP_WritePhyUshort(sc, 0x06, 0xad28);
13046                 MP_WritePhyUshort(sc, 0x06, 0x19d1);
13047                 MP_WritePhyUshort(sc, 0x06, 0x00bf);
13048                 MP_WritePhyUshort(sc, 0x06, 0x8644);
13049                 MP_WritePhyUshort(sc, 0x06, 0x022f);
13050                 MP_WritePhyUshort(sc, 0x06, 0x50e1);
13051                 MP_WritePhyUshort(sc, 0x06, 0x8af0);
13052                 MP_WritePhyUshort(sc, 0x06, 0xbf86);
13053                 MP_WritePhyUshort(sc, 0x06, 0x4102);
13054                 MP_WritePhyUshort(sc, 0x06, 0x2f50);
13055                 MP_WritePhyUshort(sc, 0x06, 0xd100);
13056                 MP_WritePhyUshort(sc, 0x06, 0xbf86);
13057                 MP_WritePhyUshort(sc, 0x06, 0x4702);
13058                 MP_WritePhyUshort(sc, 0x06, 0x2f50);
13059                 MP_WritePhyUshort(sc, 0x06, 0xef96);
13060                 MP_WritePhyUshort(sc, 0x06, 0xfefc);
13061                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
13062                 MP_WritePhyUshort(sc, 0x06, 0xe0e2);
13063                 MP_WritePhyUshort(sc, 0x06, 0xfee1);
13064                 MP_WritePhyUshort(sc, 0x06, 0xe2ff);
13065                 MP_WritePhyUshort(sc, 0x06, 0xad2e);
13066                 MP_WritePhyUshort(sc, 0x06, 0x63e0);
13067                 MP_WritePhyUshort(sc, 0x06, 0xe038);
13068                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
13069                 MP_WritePhyUshort(sc, 0x06, 0x39ad);
13070                 MP_WritePhyUshort(sc, 0x06, 0x2f10);
13071                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
13072                 MP_WritePhyUshort(sc, 0x06, 0x34e1);
13073                 MP_WritePhyUshort(sc, 0x06, 0xe035);
13074                 MP_WritePhyUshort(sc, 0x06, 0xf726);
13075                 MP_WritePhyUshort(sc, 0x06, 0xe4e0);
13076                 MP_WritePhyUshort(sc, 0x06, 0x34e5);
13077                 MP_WritePhyUshort(sc, 0x06, 0xe035);
13078                 MP_WritePhyUshort(sc, 0x06, 0xae0e);
13079                 MP_WritePhyUshort(sc, 0x06, 0xe0e2);
13080                 MP_WritePhyUshort(sc, 0x06, 0xd6e1);
13081                 MP_WritePhyUshort(sc, 0x06, 0xe2d7);
13082                 MP_WritePhyUshort(sc, 0x06, 0xf728);
13083                 MP_WritePhyUshort(sc, 0x06, 0xe4e2);
13084                 MP_WritePhyUshort(sc, 0x06, 0xd6e5);
13085                 MP_WritePhyUshort(sc, 0x06, 0xe2d7);
13086                 MP_WritePhyUshort(sc, 0x06, 0xe0e2);
13087                 MP_WritePhyUshort(sc, 0x06, 0x34e1);
13088                 MP_WritePhyUshort(sc, 0x06, 0xe235);
13089                 MP_WritePhyUshort(sc, 0x06, 0xf72b);
13090                 MP_WritePhyUshort(sc, 0x06, 0xe4e2);
13091                 MP_WritePhyUshort(sc, 0x06, 0x34e5);
13092                 MP_WritePhyUshort(sc, 0x06, 0xe235);
13093                 MP_WritePhyUshort(sc, 0x06, 0xd07d);
13094                 MP_WritePhyUshort(sc, 0x06, 0xb0fe);
13095                 MP_WritePhyUshort(sc, 0x06, 0xe0e2);
13096                 MP_WritePhyUshort(sc, 0x06, 0x34e1);
13097                 MP_WritePhyUshort(sc, 0x06, 0xe235);
13098                 MP_WritePhyUshort(sc, 0x06, 0xf62b);
13099                 MP_WritePhyUshort(sc, 0x06, 0xe4e2);
13100                 MP_WritePhyUshort(sc, 0x06, 0x34e5);
13101                 MP_WritePhyUshort(sc, 0x06, 0xe235);
13102                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
13103                 MP_WritePhyUshort(sc, 0x06, 0x34e1);
13104                 MP_WritePhyUshort(sc, 0x06, 0xe035);
13105                 MP_WritePhyUshort(sc, 0x06, 0xf626);
13106                 MP_WritePhyUshort(sc, 0x06, 0xe4e0);
13107                 MP_WritePhyUshort(sc, 0x06, 0x34e5);
13108                 MP_WritePhyUshort(sc, 0x06, 0xe035);
13109                 MP_WritePhyUshort(sc, 0x06, 0xe0e2);
13110                 MP_WritePhyUshort(sc, 0x06, 0xd6e1);
13111                 MP_WritePhyUshort(sc, 0x06, 0xe2d7);
13112                 MP_WritePhyUshort(sc, 0x06, 0xf628);
13113                 MP_WritePhyUshort(sc, 0x06, 0xe4e2);
13114                 MP_WritePhyUshort(sc, 0x06, 0xd6e5);
13115                 MP_WritePhyUshort(sc, 0x06, 0xe2d7);
13116                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
13117                 MP_WritePhyUshort(sc, 0x06, 0xae20);
13118                 MP_WritePhyUshort(sc, 0x06, 0x0000);
13119                 MP_WritePhyUshort(sc, 0x06, 0x0000);
13120                 MP_WritePhyUshort(sc, 0x06, 0x0000);
13121                 MP_WritePhyUshort(sc, 0x06, 0x0000);
13122                 MP_WritePhyUshort(sc, 0x06, 0x0000);
13123                 MP_WritePhyUshort(sc, 0x06, 0x0000);
13124                 MP_WritePhyUshort(sc, 0x06, 0x0000);
13125                 MP_WritePhyUshort(sc, 0x06, 0x0000);
13126                 MP_WritePhyUshort(sc, 0x06, 0x0000);
13127                 MP_WritePhyUshort(sc, 0x06, 0x0000);
13128                 MP_WritePhyUshort(sc, 0x06, 0x0000);
13129                 MP_WritePhyUshort(sc, 0x06, 0x0000);
13130                 MP_WritePhyUshort(sc, 0x06, 0x0000);
13131                 MP_WritePhyUshort(sc, 0x06, 0x0000);
13132                 MP_WritePhyUshort(sc, 0x06, 0x0000);
13133                 MP_WritePhyUshort(sc, 0x06, 0x0000);
13134                 MP_WritePhyUshort(sc, 0x06, 0xa725);
13135                 MP_WritePhyUshort(sc, 0x06, 0xe50a);
13136                 MP_WritePhyUshort(sc, 0x06, 0x1de5);
13137                 MP_WritePhyUshort(sc, 0x06, 0x0a2c);
13138                 MP_WritePhyUshort(sc, 0x06, 0xe50a);
13139                 MP_WritePhyUshort(sc, 0x06, 0x6de5);
13140                 MP_WritePhyUshort(sc, 0x06, 0x0a1d);
13141                 MP_WritePhyUshort(sc, 0x06, 0xe50a);
13142                 MP_WritePhyUshort(sc, 0x06, 0x1ce5);
13143                 MP_WritePhyUshort(sc, 0x06, 0x0a2d);
13144                 MP_WritePhyUshort(sc, 0x06, 0xa755);
13145                 MP_WritePhyUshort(sc, 0x06, 0x00e2);
13146                 MP_WritePhyUshort(sc, 0x06, 0x3488);
13147                 MP_WritePhyUshort(sc, 0x06, 0xe200);
13148                 MP_WritePhyUshort(sc, 0x06, 0xcce2);
13149                 MP_WritePhyUshort(sc, 0x06, 0x0055);
13150                 MP_WritePhyUshort(sc, 0x06, 0xe020);
13151                 MP_WritePhyUshort(sc, 0x06, 0x55e2);
13152                 MP_WritePhyUshort(sc, 0x06, 0xd600);
13153                 MP_WritePhyUshort(sc, 0x06, 0xe24a);
13154                 PhyRegValue = MP_ReadPhyUshort(sc, 0x01);
13155                 PhyRegValue |= BIT_0;
13156                 MP_WritePhyUshort(sc, 0x01, PhyRegValue);
13157                 PhyRegValue = MP_ReadPhyUshort(sc, 0x00);
13158                 PhyRegValue |= BIT_0;
13159                 MP_WritePhyUshort(sc, 0x00, PhyRegValue);
13160                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
13161
13162                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
13163                 for (i = 0; i < 200; i++) {
13164                         DELAY(100);
13165                         PhyRegValue = MP_ReadPhyUshort(sc, 0x00);
13166                         if (PhyRegValue & BIT_7)
13167                                 break;
13168                 }
13169                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
13170                 MP_WritePhyUshort(sc, 0x1e, 0x0023);
13171                 PhyRegValue = MP_ReadPhyUshort(sc, 0x17);
13172                 PhyRegValue &= ~(BIT_0);
13173                 if (sc->RequiredSecLanDonglePatch)
13174                         PhyRegValue &= ~(BIT_2);
13175                 MP_WritePhyUshort(sc, 0x17, PhyRegValue);
13176                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
13177         }
13178 }
13179
13180 static void re_set_phy_mcu_8168evl_1(struct re_softc *sc)
13181 {
13182         u_int16_t PhyRegValue;
13183         int i;
13184
13185         MP_WritePhyUshort(sc, 0x1f, 0x0000);
13186         MP_WritePhyUshort(sc, 0x00, 0x1800);
13187         PhyRegValue= MP_ReadPhyUshort(sc, 0x15);
13188         PhyRegValue &= ~BIT_12;
13189         MP_WritePhyUshort(sc, 0x15, PhyRegValue);
13190         DELAY(200);
13191         DELAY(200);
13192         MP_WritePhyUshort(sc, 0x1f, 0x0004);
13193         MP_WritePhyUshort(sc, 0x1f, 0x0007);
13194         MP_WritePhyUshort(sc, 0x1e, 0x0023);
13195         PhyRegValue = MP_ReadPhyUshort(sc, 0x17);
13196         if ((PhyRegValue & BIT_11) == 0x0000) {
13197                 PhyRegValue |= BIT_0;
13198                 MP_WritePhyUshort(sc, 0x17, PhyRegValue);
13199                 for (i = 0; i < 200; i++) {
13200                         DELAY(100);
13201                         PhyRegValue = MP_ReadPhyUshort(sc, 0x17);
13202                         if (PhyRegValue & BIT_11)
13203                                 break;
13204                 }
13205         }
13206         PhyRegValue = MP_ReadPhyUshort(sc, 0x17);
13207         PhyRegValue |= BIT_11;
13208         MP_WritePhyUshort(sc, 0x17,PhyRegValue);
13209         MP_WritePhyUshort(sc, 0x1f, 0x0004);
13210         MP_WritePhyUshort(sc, 0x1f, 0x0007);
13211         MP_WritePhyUshort(sc, 0x1E, 0x002C);
13212         MP_WritePhyUshort(sc, 0x1B, 0x5000);
13213         MP_WritePhyUshort(sc, 0x1E, 0x002d);
13214         MP_WritePhyUshort(sc, 0x19, 0x0004);
13215         MP_WritePhyUshort(sc, 0x1f, 0x0002);
13216         MP_WritePhyUshort(sc, 0x1f, 0x0000);
13217         for (i = 0; i < 200; i++) {
13218                 DELAY(100);
13219                 PhyRegValue= MP_ReadPhyUshort(sc, 0x1E);
13220                 if ((PhyRegValue& 0x03FF) == 0x0014)
13221                         break;
13222         }
13223         MP_WritePhyUshort(sc, 0x1f, 0x0005);
13224         for (i = 0; i < 200; i++) {
13225                 DELAY(100);
13226                 PhyRegValue= MP_ReadPhyUshort(sc, 0x07);
13227                 if ((PhyRegValue& BIT_5) == 0)
13228                         break;
13229         }
13230         PhyRegValue = MP_ReadPhyUshort(sc, 0x07);
13231         if (PhyRegValue & BIT_5) {
13232                 MP_WritePhyUshort(sc, 0x1f, 0x0004);
13233                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
13234                 MP_WritePhyUshort(sc, 0x1e, 0x00a1);
13235                 MP_WritePhyUshort(sc, 0x17, 0x1000);
13236                 MP_WritePhyUshort(sc, 0x17, 0x0000);
13237                 MP_WritePhyUshort(sc, 0x17, 0x2000);
13238                 MP_WritePhyUshort(sc, 0x1e, 0x002f);
13239                 MP_WritePhyUshort(sc, 0x18, 0x9bfb);
13240                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
13241                 MP_WritePhyUshort(sc, 0x07, 0x0000);
13242                 MP_WritePhyUshort(sc, 0x1f, 0x0002);
13243                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
13244         }
13245         MP_WritePhyUshort(sc, 0x1f, 0x0005);
13246         MP_WritePhyUshort(sc, 0x05, 0xfff6);
13247         MP_WritePhyUshort(sc, 0x06, 0x0080);
13248         PhyRegValue = MP_ReadPhyUshort(sc, 0x00);
13249         PhyRegValue &= ~BIT_7;
13250         MP_WritePhyUshort(sc, 0x00, PhyRegValue);
13251         MP_WritePhyUshort(sc, 0x1f, 0x0004);
13252         MP_WritePhyUshort(sc, 0x1f, 0x0007);
13253         MP_WritePhyUshort(sc, 0x1e, 0x0023);
13254         MP_WritePhyUshort(sc, 0x16, 0x0306);
13255         MP_WritePhyUshort(sc, 0x16, 0x0307);
13256         MP_WritePhyUshort(sc, 0x15, 0x0000);
13257         MP_WritePhyUshort(sc, 0x19, 0x407d);
13258         MP_WritePhyUshort(sc, 0x15, 0x0001);
13259         MP_WritePhyUshort(sc, 0x19, 0x440f);
13260         MP_WritePhyUshort(sc, 0x15, 0x0002);
13261         MP_WritePhyUshort(sc, 0x19, 0x7c03);
13262         MP_WritePhyUshort(sc, 0x15, 0x0003);
13263         MP_WritePhyUshort(sc, 0x19, 0x6c03);
13264         MP_WritePhyUshort(sc, 0x15, 0x0004);
13265         MP_WritePhyUshort(sc, 0x19, 0xc4d5);
13266         MP_WritePhyUshort(sc, 0x15, 0x0005);
13267         MP_WritePhyUshort(sc, 0x19, 0x00ff);
13268         MP_WritePhyUshort(sc, 0x15, 0x0006);
13269         MP_WritePhyUshort(sc, 0x19, 0x74f0);
13270         MP_WritePhyUshort(sc, 0x15, 0x0007);
13271         MP_WritePhyUshort(sc, 0x19, 0x4880);
13272         MP_WritePhyUshort(sc, 0x15, 0x0008);
13273         MP_WritePhyUshort(sc, 0x19, 0x4c00);
13274         MP_WritePhyUshort(sc, 0x15, 0x0009);
13275         MP_WritePhyUshort(sc, 0x19, 0x4800);
13276         MP_WritePhyUshort(sc, 0x15, 0x000a);
13277         MP_WritePhyUshort(sc, 0x19, 0x5000);
13278         MP_WritePhyUshort(sc, 0x15, 0x000b);
13279         MP_WritePhyUshort(sc, 0x19, 0x4400);
13280         MP_WritePhyUshort(sc, 0x15, 0x000c);
13281         MP_WritePhyUshort(sc, 0x19, 0x7801);
13282         MP_WritePhyUshort(sc, 0x15, 0x000d);
13283         MP_WritePhyUshort(sc, 0x19, 0x4000);
13284         MP_WritePhyUshort(sc, 0x15, 0x000e);
13285         MP_WritePhyUshort(sc, 0x19, 0x7800);
13286         MP_WritePhyUshort(sc, 0x15, 0x000f);
13287         MP_WritePhyUshort(sc, 0x19, 0x7010);
13288         MP_WritePhyUshort(sc, 0x15, 0x0010);
13289         MP_WritePhyUshort(sc, 0x19, 0x6804);
13290         MP_WritePhyUshort(sc, 0x15, 0x0011);
13291         MP_WritePhyUshort(sc, 0x19, 0x64a0);
13292         MP_WritePhyUshort(sc, 0x15, 0x0012);
13293         MP_WritePhyUshort(sc, 0x19, 0x63da);
13294         MP_WritePhyUshort(sc, 0x15, 0x0013);
13295         MP_WritePhyUshort(sc, 0x19, 0x63d8);
13296         MP_WritePhyUshort(sc, 0x15, 0x0014);
13297         MP_WritePhyUshort(sc, 0x19, 0x6f05);
13298         MP_WritePhyUshort(sc, 0x15, 0x0015);
13299         MP_WritePhyUshort(sc, 0x19, 0x5420);
13300         MP_WritePhyUshort(sc, 0x15, 0x0016);
13301         MP_WritePhyUshort(sc, 0x19, 0x58ce);
13302         MP_WritePhyUshort(sc, 0x15, 0x0017);
13303         MP_WritePhyUshort(sc, 0x19, 0x5cf3);
13304         MP_WritePhyUshort(sc, 0x15, 0x0018);
13305         MP_WritePhyUshort(sc, 0x19, 0xb600);
13306         MP_WritePhyUshort(sc, 0x15, 0x0019);
13307         MP_WritePhyUshort(sc, 0x19, 0xc659);
13308         MP_WritePhyUshort(sc, 0x15, 0x001a);
13309         MP_WritePhyUshort(sc, 0x19, 0x0018);
13310         MP_WritePhyUshort(sc, 0x15, 0x001b);
13311         MP_WritePhyUshort(sc, 0x19, 0xc403);
13312         MP_WritePhyUshort(sc, 0x15, 0x001c);
13313         MP_WritePhyUshort(sc, 0x19, 0x0016);
13314         MP_WritePhyUshort(sc, 0x15, 0x001d);
13315         MP_WritePhyUshort(sc, 0x19, 0xaa05);
13316         MP_WritePhyUshort(sc, 0x15, 0x001e);
13317         MP_WritePhyUshort(sc, 0x19, 0xc503);
13318         MP_WritePhyUshort(sc, 0x15, 0x001f);
13319         MP_WritePhyUshort(sc, 0x19, 0x0003);
13320         MP_WritePhyUshort(sc, 0x15, 0x0020);
13321         MP_WritePhyUshort(sc, 0x19, 0x89f8);
13322         MP_WritePhyUshort(sc, 0x15, 0x0021);
13323         MP_WritePhyUshort(sc, 0x19, 0x32ae);
13324         MP_WritePhyUshort(sc, 0x15, 0x0022);
13325         MP_WritePhyUshort(sc, 0x19, 0x7c03);
13326         MP_WritePhyUshort(sc, 0x15, 0x0023);
13327         MP_WritePhyUshort(sc, 0x19, 0x6c03);
13328         MP_WritePhyUshort(sc, 0x15, 0x0024);
13329         MP_WritePhyUshort(sc, 0x19, 0x7c03);
13330         MP_WritePhyUshort(sc, 0x15, 0x0025);
13331         MP_WritePhyUshort(sc, 0x19, 0x6801);
13332         MP_WritePhyUshort(sc, 0x15, 0x0026);
13333         MP_WritePhyUshort(sc, 0x19, 0x66a0);
13334         MP_WritePhyUshort(sc, 0x15, 0x0027);
13335         MP_WritePhyUshort(sc, 0x19, 0xa300);
13336         MP_WritePhyUshort(sc, 0x15, 0x0028);
13337         MP_WritePhyUshort(sc, 0x19, 0x64a0);
13338         MP_WritePhyUshort(sc, 0x15, 0x0029);
13339         MP_WritePhyUshort(sc, 0x19, 0x76f0);
13340         MP_WritePhyUshort(sc, 0x15, 0x002a);
13341         MP_WritePhyUshort(sc, 0x19, 0x7670);
13342         MP_WritePhyUshort(sc, 0x15, 0x002b);
13343         MP_WritePhyUshort(sc, 0x19, 0x7630);
13344         MP_WritePhyUshort(sc, 0x15, 0x002c);
13345         MP_WritePhyUshort(sc, 0x19, 0x31a6);
13346         MP_WritePhyUshort(sc, 0x15, 0x002d);
13347         MP_WritePhyUshort(sc, 0x19, 0x0000);
13348         MP_WritePhyUshort(sc, 0x15, 0x002e);
13349         MP_WritePhyUshort(sc, 0x19, 0x0000);
13350         MP_WritePhyUshort(sc, 0x15, 0x002f);
13351         MP_WritePhyUshort(sc, 0x19, 0x0000);
13352         MP_WritePhyUshort(sc, 0x15, 0x0030);
13353         MP_WritePhyUshort(sc, 0x19, 0x0000);
13354         MP_WritePhyUshort(sc, 0x15, 0x0031);
13355         MP_WritePhyUshort(sc, 0x19, 0x0000);
13356         MP_WritePhyUshort(sc, 0x15, 0x0032);
13357         MP_WritePhyUshort(sc, 0x19, 0x4801);
13358         MP_WritePhyUshort(sc, 0x15, 0x0033);
13359         MP_WritePhyUshort(sc, 0x19, 0x6803);
13360         MP_WritePhyUshort(sc, 0x15, 0x0034);
13361         MP_WritePhyUshort(sc, 0x19, 0x66a1);
13362         MP_WritePhyUshort(sc, 0x15, 0x0035);
13363         MP_WritePhyUshort(sc, 0x19, 0x7c03);
13364         MP_WritePhyUshort(sc, 0x15, 0x0036);
13365         MP_WritePhyUshort(sc, 0x19, 0x6c03);
13366         MP_WritePhyUshort(sc, 0x15, 0x0037);
13367         MP_WritePhyUshort(sc, 0x19, 0xa300);
13368         MP_WritePhyUshort(sc, 0x15, 0x0038);
13369         MP_WritePhyUshort(sc, 0x19, 0x64a1);
13370         MP_WritePhyUshort(sc, 0x15, 0x0039);
13371         MP_WritePhyUshort(sc, 0x19, 0x7c08);
13372         MP_WritePhyUshort(sc, 0x15, 0x003a);
13373         MP_WritePhyUshort(sc, 0x19, 0x74f8);
13374         MP_WritePhyUshort(sc, 0x15, 0x003b);
13375         MP_WritePhyUshort(sc, 0x19, 0x63d0);
13376         MP_WritePhyUshort(sc, 0x15, 0x003c);
13377         MP_WritePhyUshort(sc, 0x19, 0x7ff0);
13378         MP_WritePhyUshort(sc, 0x15, 0x003d);
13379         MP_WritePhyUshort(sc, 0x19, 0x77f0);
13380         MP_WritePhyUshort(sc, 0x15, 0x003e);
13381         MP_WritePhyUshort(sc, 0x19, 0x7ff0);
13382         MP_WritePhyUshort(sc, 0x15, 0x003f);
13383         MP_WritePhyUshort(sc, 0x19, 0x7750);
13384         MP_WritePhyUshort(sc, 0x15, 0x0040);
13385         MP_WritePhyUshort(sc, 0x19, 0x63d8);
13386         MP_WritePhyUshort(sc, 0x15, 0x0041);
13387         MP_WritePhyUshort(sc, 0x19, 0x7cf0);
13388         MP_WritePhyUshort(sc, 0x15, 0x0042);
13389         MP_WritePhyUshort(sc, 0x19, 0x7708);
13390         MP_WritePhyUshort(sc, 0x15, 0x0043);
13391         MP_WritePhyUshort(sc, 0x19, 0xa654);
13392         MP_WritePhyUshort(sc, 0x15, 0x0044);
13393         MP_WritePhyUshort(sc, 0x19, 0x304a);
13394         MP_WritePhyUshort(sc, 0x15, 0x0045);
13395         MP_WritePhyUshort(sc, 0x19, 0x0000);
13396         MP_WritePhyUshort(sc, 0x15, 0x0046);
13397         MP_WritePhyUshort(sc, 0x19, 0x0000);
13398         MP_WritePhyUshort(sc, 0x15, 0x0047);
13399         MP_WritePhyUshort(sc, 0x19, 0x0000);
13400         MP_WritePhyUshort(sc, 0x15, 0x0048);
13401         MP_WritePhyUshort(sc, 0x19, 0x0000);
13402         MP_WritePhyUshort(sc, 0x15, 0x0049);
13403         MP_WritePhyUshort(sc, 0x19, 0x0000);
13404         MP_WritePhyUshort(sc, 0x15, 0x004a);
13405         MP_WritePhyUshort(sc, 0x19, 0x4802);
13406         MP_WritePhyUshort(sc, 0x15, 0x004b);
13407         MP_WritePhyUshort(sc, 0x19, 0x4003);
13408         MP_WritePhyUshort(sc, 0x15, 0x004c);
13409         MP_WritePhyUshort(sc, 0x19, 0x4440);
13410         MP_WritePhyUshort(sc, 0x15, 0x004d);
13411         MP_WritePhyUshort(sc, 0x19, 0x63c8);
13412         MP_WritePhyUshort(sc, 0x15, 0x004e);
13413         MP_WritePhyUshort(sc, 0x19, 0x6481);
13414         MP_WritePhyUshort(sc, 0x15, 0x004f);
13415         MP_WritePhyUshort(sc, 0x19, 0x9d00);
13416         MP_WritePhyUshort(sc, 0x15, 0x0050);
13417         MP_WritePhyUshort(sc, 0x19, 0x63e8);
13418         MP_WritePhyUshort(sc, 0x15, 0x0051);
13419         MP_WritePhyUshort(sc, 0x19, 0x7d00);
13420         MP_WritePhyUshort(sc, 0x15, 0x0052);
13421         MP_WritePhyUshort(sc, 0x19, 0x5900);
13422         MP_WritePhyUshort(sc, 0x15, 0x0053);
13423         MP_WritePhyUshort(sc, 0x19, 0x63f8);
13424         MP_WritePhyUshort(sc, 0x15, 0x0054);
13425         MP_WritePhyUshort(sc, 0x19, 0x64a1);
13426         MP_WritePhyUshort(sc, 0x15, 0x0055);
13427         MP_WritePhyUshort(sc, 0x19, 0x3116);
13428         MP_WritePhyUshort(sc, 0x15, 0x0056);
13429         MP_WritePhyUshort(sc, 0x19, 0x0000);
13430         MP_WritePhyUshort(sc, 0x15, 0x0057);
13431         MP_WritePhyUshort(sc, 0x19, 0x0000);
13432         MP_WritePhyUshort(sc, 0x15, 0x0058);
13433         MP_WritePhyUshort(sc, 0x19, 0x0000);
13434         MP_WritePhyUshort(sc, 0x15, 0x0059);
13435         MP_WritePhyUshort(sc, 0x19, 0x0000);
13436         MP_WritePhyUshort(sc, 0x15, 0x005a);
13437         MP_WritePhyUshort(sc, 0x19, 0x7c03);
13438         MP_WritePhyUshort(sc, 0x15, 0x005b);
13439         MP_WritePhyUshort(sc, 0x19, 0x6c03);
13440         MP_WritePhyUshort(sc, 0x15, 0x005c);
13441         MP_WritePhyUshort(sc, 0x19, 0x7c08);
13442         MP_WritePhyUshort(sc, 0x15, 0x005d);
13443         MP_WritePhyUshort(sc, 0x19, 0x6000);
13444         MP_WritePhyUshort(sc, 0x15, 0x005e);
13445         MP_WritePhyUshort(sc, 0x19, 0x59ce);
13446         MP_WritePhyUshort(sc, 0x15, 0x005f);
13447         MP_WritePhyUshort(sc, 0x19, 0x4400);
13448         MP_WritePhyUshort(sc, 0x15, 0x0060);
13449         MP_WritePhyUshort(sc, 0x19, 0x7d00);
13450         MP_WritePhyUshort(sc, 0x15, 0x0061);
13451         MP_WritePhyUshort(sc, 0x19, 0x72b0);
13452         MP_WritePhyUshort(sc, 0x15, 0x0062);
13453         MP_WritePhyUshort(sc, 0x19, 0x400e);
13454         MP_WritePhyUshort(sc, 0x15, 0x0063);
13455         MP_WritePhyUshort(sc, 0x19, 0x4440);
13456         MP_WritePhyUshort(sc, 0x15, 0x0064);
13457         MP_WritePhyUshort(sc, 0x19, 0x9d00);
13458         MP_WritePhyUshort(sc, 0x15, 0x0065);
13459         MP_WritePhyUshort(sc, 0x19, 0x7f00);
13460         MP_WritePhyUshort(sc, 0x15, 0x0066);
13461         MP_WritePhyUshort(sc, 0x19, 0x70b0);
13462         MP_WritePhyUshort(sc, 0x15, 0x0067);
13463         MP_WritePhyUshort(sc, 0x19, 0x7c08);
13464         MP_WritePhyUshort(sc, 0x15, 0x0068);
13465         MP_WritePhyUshort(sc, 0x19, 0x6008);
13466         MP_WritePhyUshort(sc, 0x15, 0x0069);
13467         MP_WritePhyUshort(sc, 0x19, 0x7cf0);
13468         MP_WritePhyUshort(sc, 0x15, 0x006a);
13469         MP_WritePhyUshort(sc, 0x19, 0x7750);
13470         MP_WritePhyUshort(sc, 0x15, 0x006b);
13471         MP_WritePhyUshort(sc, 0x19, 0x4007);
13472         MP_WritePhyUshort(sc, 0x15, 0x006c);
13473         MP_WritePhyUshort(sc, 0x19, 0x4500);
13474         MP_WritePhyUshort(sc, 0x15, 0x006d);
13475         MP_WritePhyUshort(sc, 0x19, 0x4023);
13476         MP_WritePhyUshort(sc, 0x15, 0x006e);
13477         MP_WritePhyUshort(sc, 0x19, 0x4580);
13478         MP_WritePhyUshort(sc, 0x15, 0x006f);
13479         MP_WritePhyUshort(sc, 0x19, 0x9f00);
13480         MP_WritePhyUshort(sc, 0x15, 0x0070);
13481         MP_WritePhyUshort(sc, 0x19, 0xcd78);
13482         MP_WritePhyUshort(sc, 0x15, 0x0071);
13483         MP_WritePhyUshort(sc, 0x19, 0x0003);
13484         MP_WritePhyUshort(sc, 0x15, 0x0072);
13485         MP_WritePhyUshort(sc, 0x19, 0xbe02);
13486         MP_WritePhyUshort(sc, 0x15, 0x0073);
13487         MP_WritePhyUshort(sc, 0x19, 0x3070);
13488         MP_WritePhyUshort(sc, 0x15, 0x0074);
13489         MP_WritePhyUshort(sc, 0x19, 0x7cf0);
13490         MP_WritePhyUshort(sc, 0x15, 0x0075);
13491         MP_WritePhyUshort(sc, 0x19, 0x77f0);
13492         MP_WritePhyUshort(sc, 0x15, 0x0076);
13493         MP_WritePhyUshort(sc, 0x19, 0x4400);
13494         MP_WritePhyUshort(sc, 0x15, 0x0077);
13495         MP_WritePhyUshort(sc, 0x19, 0x4007);
13496         MP_WritePhyUshort(sc, 0x15, 0x0078);
13497         MP_WritePhyUshort(sc, 0x19, 0x4500);
13498         MP_WritePhyUshort(sc, 0x15, 0x0079);
13499         MP_WritePhyUshort(sc, 0x19, 0x4023);
13500         MP_WritePhyUshort(sc, 0x15, 0x007a);
13501         MP_WritePhyUshort(sc, 0x19, 0x4580);
13502         MP_WritePhyUshort(sc, 0x15, 0x007b);
13503         MP_WritePhyUshort(sc, 0x19, 0x9f00);
13504         MP_WritePhyUshort(sc, 0x15, 0x007c);
13505         MP_WritePhyUshort(sc, 0x19, 0xce80);
13506         MP_WritePhyUshort(sc, 0x15, 0x007d);
13507         MP_WritePhyUshort(sc, 0x19, 0x0004);
13508         MP_WritePhyUshort(sc, 0x15, 0x007e);
13509         MP_WritePhyUshort(sc, 0x19, 0xce80);
13510         MP_WritePhyUshort(sc, 0x15, 0x007f);
13511         MP_WritePhyUshort(sc, 0x19, 0x0002);
13512         MP_WritePhyUshort(sc, 0x15, 0x0080);
13513         MP_WritePhyUshort(sc, 0x19, 0x307c);
13514         MP_WritePhyUshort(sc, 0x15, 0x0081);
13515         MP_WritePhyUshort(sc, 0x19, 0x4400);
13516         MP_WritePhyUshort(sc, 0x15, 0x0082);
13517         MP_WritePhyUshort(sc, 0x19, 0x480f);
13518         MP_WritePhyUshort(sc, 0x15, 0x0083);
13519         MP_WritePhyUshort(sc, 0x19, 0x6802);
13520         MP_WritePhyUshort(sc, 0x15, 0x0084);
13521         MP_WritePhyUshort(sc, 0x19, 0x6680);
13522         MP_WritePhyUshort(sc, 0x15, 0x0085);
13523         MP_WritePhyUshort(sc, 0x19, 0x7c10);
13524         MP_WritePhyUshort(sc, 0x15, 0x0086);
13525         MP_WritePhyUshort(sc, 0x19, 0x6010);
13526         MP_WritePhyUshort(sc, 0x15, 0x0087);
13527         MP_WritePhyUshort(sc, 0x19, 0x400a);
13528         MP_WritePhyUshort(sc, 0x15, 0x0088);
13529         MP_WritePhyUshort(sc, 0x19, 0x4580);
13530         MP_WritePhyUshort(sc, 0x15, 0x0089);
13531         MP_WritePhyUshort(sc, 0x19, 0x9e00);
13532         MP_WritePhyUshort(sc, 0x15, 0x008a);
13533         MP_WritePhyUshort(sc, 0x19, 0x7d00);
13534         MP_WritePhyUshort(sc, 0x15, 0x008b);
13535         MP_WritePhyUshort(sc, 0x19, 0x5800);
13536         MP_WritePhyUshort(sc, 0x15, 0x008c);
13537         MP_WritePhyUshort(sc, 0x19, 0x63c8);
13538         MP_WritePhyUshort(sc, 0x15, 0x008d);
13539         MP_WritePhyUshort(sc, 0x19, 0x63d8);
13540         MP_WritePhyUshort(sc, 0x15, 0x008e);
13541         MP_WritePhyUshort(sc, 0x19, 0x66a0);
13542         MP_WritePhyUshort(sc, 0x15, 0x008f);
13543         MP_WritePhyUshort(sc, 0x19, 0x8300);
13544         MP_WritePhyUshort(sc, 0x15, 0x0090);
13545         MP_WritePhyUshort(sc, 0x19, 0x7ff0);
13546         MP_WritePhyUshort(sc, 0x15, 0x0091);
13547         MP_WritePhyUshort(sc, 0x19, 0x74f0);
13548         MP_WritePhyUshort(sc, 0x15, 0x0092);
13549         MP_WritePhyUshort(sc, 0x19, 0x3006);
13550         MP_WritePhyUshort(sc, 0x15, 0x0093);
13551         MP_WritePhyUshort(sc, 0x19, 0x0000);
13552         MP_WritePhyUshort(sc, 0x15, 0x0094);
13553         MP_WritePhyUshort(sc, 0x19, 0x0000);
13554         MP_WritePhyUshort(sc, 0x15, 0x0095);
13555         MP_WritePhyUshort(sc, 0x19, 0x0000);
13556         MP_WritePhyUshort(sc, 0x15, 0x0096);
13557         MP_WritePhyUshort(sc, 0x19, 0x0000);
13558         MP_WritePhyUshort(sc, 0x15, 0x0097);
13559         MP_WritePhyUshort(sc, 0x19, 0x4803);
13560         MP_WritePhyUshort(sc, 0x15, 0x0098);
13561         MP_WritePhyUshort(sc, 0x19, 0x7c03);
13562         MP_WritePhyUshort(sc, 0x15, 0x0099);
13563         MP_WritePhyUshort(sc, 0x19, 0x6c03);
13564         MP_WritePhyUshort(sc, 0x15, 0x009a);
13565         MP_WritePhyUshort(sc, 0x19, 0xa203);
13566         MP_WritePhyUshort(sc, 0x15, 0x009b);
13567         MP_WritePhyUshort(sc, 0x19, 0x64b1);
13568         MP_WritePhyUshort(sc, 0x15, 0x009c);
13569         MP_WritePhyUshort(sc, 0x19, 0x309e);
13570         MP_WritePhyUshort(sc, 0x15, 0x009d);
13571         MP_WritePhyUshort(sc, 0x19, 0x64b3);
13572         MP_WritePhyUshort(sc, 0x15, 0x009e);
13573         MP_WritePhyUshort(sc, 0x19, 0x4030);
13574         MP_WritePhyUshort(sc, 0x15, 0x009f);
13575         MP_WritePhyUshort(sc, 0x19, 0x440e);
13576         MP_WritePhyUshort(sc, 0x15, 0x00a0);
13577         MP_WritePhyUshort(sc, 0x19, 0x4020);
13578         MP_WritePhyUshort(sc, 0x15, 0x00a1);
13579         MP_WritePhyUshort(sc, 0x19, 0x4419);
13580         MP_WritePhyUshort(sc, 0x15, 0x00a2);
13581         MP_WritePhyUshort(sc, 0x19, 0x7801);
13582         MP_WritePhyUshort(sc, 0x15, 0x00a3);
13583         MP_WritePhyUshort(sc, 0x19, 0xc520);
13584         MP_WritePhyUshort(sc, 0x15, 0x00a4);
13585         MP_WritePhyUshort(sc, 0x19, 0x000b);
13586         MP_WritePhyUshort(sc, 0x15, 0x00a5);
13587         MP_WritePhyUshort(sc, 0x19, 0x4020);
13588         MP_WritePhyUshort(sc, 0x15, 0x00a6);
13589         MP_WritePhyUshort(sc, 0x19, 0x7800);
13590         MP_WritePhyUshort(sc, 0x15, 0x00a7);
13591         MP_WritePhyUshort(sc, 0x19, 0x58a4);
13592         MP_WritePhyUshort(sc, 0x15, 0x00a8);
13593         MP_WritePhyUshort(sc, 0x19, 0x63da);
13594         MP_WritePhyUshort(sc, 0x15, 0x00a9);
13595         MP_WritePhyUshort(sc, 0x19, 0x5cb0);
13596         MP_WritePhyUshort(sc, 0x15, 0x00aa);
13597         MP_WritePhyUshort(sc, 0x19, 0x7d00);
13598         MP_WritePhyUshort(sc, 0x15, 0x00ab);
13599         MP_WritePhyUshort(sc, 0x19, 0x72b0);
13600         MP_WritePhyUshort(sc, 0x15, 0x00ac);
13601         MP_WritePhyUshort(sc, 0x19, 0x7f00);
13602         MP_WritePhyUshort(sc, 0x15, 0x00ad);
13603         MP_WritePhyUshort(sc, 0x19, 0x70b0);
13604         MP_WritePhyUshort(sc, 0x15, 0x00ae);
13605         MP_WritePhyUshort(sc, 0x19, 0x30b8);
13606         MP_WritePhyUshort(sc, 0x15, 0x00AF);
13607         MP_WritePhyUshort(sc, 0x19, 0x4060);
13608         MP_WritePhyUshort(sc, 0x15, 0x00B0);
13609         MP_WritePhyUshort(sc, 0x19, 0x7800);
13610         MP_WritePhyUshort(sc, 0x15, 0x00B1);
13611         MP_WritePhyUshort(sc, 0x19, 0x7e00);
13612         MP_WritePhyUshort(sc, 0x15, 0x00B2);
13613         MP_WritePhyUshort(sc, 0x19, 0x72B0);
13614         MP_WritePhyUshort(sc, 0x15, 0x00B3);
13615         MP_WritePhyUshort(sc, 0x19, 0x7F00);
13616         MP_WritePhyUshort(sc, 0x15, 0x00B4);
13617         MP_WritePhyUshort(sc, 0x19, 0x73B0);
13618         MP_WritePhyUshort(sc, 0x15, 0x00b5);
13619         MP_WritePhyUshort(sc, 0x19, 0x58a0);
13620         MP_WritePhyUshort(sc, 0x15, 0x00b6);
13621         MP_WritePhyUshort(sc, 0x19, 0x63d2);
13622         MP_WritePhyUshort(sc, 0x15, 0x00b7);
13623         MP_WritePhyUshort(sc, 0x19, 0x5c00);
13624         MP_WritePhyUshort(sc, 0x15, 0x00b8);
13625         MP_WritePhyUshort(sc, 0x19, 0x5780);
13626         MP_WritePhyUshort(sc, 0x15, 0x00b9);
13627         MP_WritePhyUshort(sc, 0x19, 0xb60d);
13628         MP_WritePhyUshort(sc, 0x15, 0x00ba);
13629         MP_WritePhyUshort(sc, 0x19, 0x9bff);
13630         MP_WritePhyUshort(sc, 0x15, 0x00bb);
13631         MP_WritePhyUshort(sc, 0x19, 0x7c03);
13632         MP_WritePhyUshort(sc, 0x15, 0x00bc);
13633         MP_WritePhyUshort(sc, 0x19, 0x6001);
13634         MP_WritePhyUshort(sc, 0x15, 0x00bd);
13635         MP_WritePhyUshort(sc, 0x19, 0xc020);
13636         MP_WritePhyUshort(sc, 0x15, 0x00be);
13637         MP_WritePhyUshort(sc, 0x19, 0x002b);
13638         MP_WritePhyUshort(sc, 0x15, 0x00bf);
13639         MP_WritePhyUshort(sc, 0x19, 0xc137);
13640         MP_WritePhyUshort(sc, 0x15, 0x00c0);
13641         MP_WritePhyUshort(sc, 0x19, 0x0006);
13642         MP_WritePhyUshort(sc, 0x15, 0x00c1);
13643         MP_WritePhyUshort(sc, 0x19, 0x9af8);
13644         MP_WritePhyUshort(sc, 0x15, 0x00c2);
13645         MP_WritePhyUshort(sc, 0x19, 0x30c6);
13646         MP_WritePhyUshort(sc, 0x15, 0x00c3);
13647         MP_WritePhyUshort(sc, 0x19, 0x0000);
13648         MP_WritePhyUshort(sc, 0x15, 0x00c4);
13649         MP_WritePhyUshort(sc, 0x19, 0x0000);
13650         MP_WritePhyUshort(sc, 0x15, 0x00c5);
13651         MP_WritePhyUshort(sc, 0x19, 0x0000);
13652         MP_WritePhyUshort(sc, 0x15, 0x00c6);
13653         MP_WritePhyUshort(sc, 0x19, 0x7d00);
13654         MP_WritePhyUshort(sc, 0x15, 0x00c7);
13655         MP_WritePhyUshort(sc, 0x19, 0x70b0);
13656         MP_WritePhyUshort(sc, 0x15, 0x00c8);
13657         MP_WritePhyUshort(sc, 0x19, 0x4400);
13658         MP_WritePhyUshort(sc, 0x15, 0x00c9);
13659         MP_WritePhyUshort(sc, 0x19, 0x4804);
13660         MP_WritePhyUshort(sc, 0x15, 0x00ca);
13661         MP_WritePhyUshort(sc, 0x19, 0x7c80);
13662         MP_WritePhyUshort(sc, 0x15, 0x00cb);
13663         MP_WritePhyUshort(sc, 0x19, 0x5c80);
13664         MP_WritePhyUshort(sc, 0x15, 0x00cc);
13665         MP_WritePhyUshort(sc, 0x19, 0x4010);
13666         MP_WritePhyUshort(sc, 0x15, 0x00cd);
13667         MP_WritePhyUshort(sc, 0x19, 0x4415);
13668         MP_WritePhyUshort(sc, 0x15, 0x00ce);
13669         MP_WritePhyUshort(sc, 0x19, 0x9b00);
13670         MP_WritePhyUshort(sc, 0x15, 0x00cf);
13671         MP_WritePhyUshort(sc, 0x19, 0x7f00);
13672         MP_WritePhyUshort(sc, 0x15, 0x00d0);
13673         MP_WritePhyUshort(sc, 0x19, 0x70b0);
13674         MP_WritePhyUshort(sc, 0x15, 0x00d1);
13675         MP_WritePhyUshort(sc, 0x19, 0x3177);
13676         MP_WritePhyUshort(sc, 0x15, 0x00d2);
13677         MP_WritePhyUshort(sc, 0x19, 0x0000);
13678         MP_WritePhyUshort(sc, 0x15, 0x00d3);
13679         MP_WritePhyUshort(sc, 0x19, 0x0000);
13680         MP_WritePhyUshort(sc, 0x15, 0x00d4);
13681         MP_WritePhyUshort(sc, 0x19, 0x0000);
13682         MP_WritePhyUshort(sc, 0x15, 0x00d5);
13683         MP_WritePhyUshort(sc, 0x19, 0x4808);
13684         MP_WritePhyUshort(sc, 0x15, 0x00d6);
13685         MP_WritePhyUshort(sc, 0x19, 0x4007);
13686         MP_WritePhyUshort(sc, 0x15, 0x00d7);
13687         MP_WritePhyUshort(sc, 0x19, 0x4420);
13688         MP_WritePhyUshort(sc, 0x15, 0x00d8);
13689         MP_WritePhyUshort(sc, 0x19, 0x63d8);
13690         MP_WritePhyUshort(sc, 0x15, 0x00d9);
13691         MP_WritePhyUshort(sc, 0x19, 0xb608);
13692         MP_WritePhyUshort(sc, 0x15, 0x00da);
13693         MP_WritePhyUshort(sc, 0x19, 0xbcbd);
13694         MP_WritePhyUshort(sc, 0x15, 0x00db);
13695         MP_WritePhyUshort(sc, 0x19, 0xc60b);
13696         MP_WritePhyUshort(sc, 0x15, 0x00dc);
13697         MP_WritePhyUshort(sc, 0x19, 0x00fd);
13698         MP_WritePhyUshort(sc, 0x15, 0x00dd);
13699         MP_WritePhyUshort(sc, 0x19, 0x30e1);
13700         MP_WritePhyUshort(sc, 0x15, 0x00de);
13701         MP_WritePhyUshort(sc, 0x19, 0x0000);
13702         MP_WritePhyUshort(sc, 0x15, 0x00df);
13703         MP_WritePhyUshort(sc, 0x19, 0x0000);
13704         MP_WritePhyUshort(sc, 0x15, 0x00e0);
13705         MP_WritePhyUshort(sc, 0x19, 0x0000);
13706         MP_WritePhyUshort(sc, 0x15, 0x00e1);
13707         MP_WritePhyUshort(sc, 0x19, 0x4809);
13708         MP_WritePhyUshort(sc, 0x15, 0x00e2);
13709         MP_WritePhyUshort(sc, 0x19, 0x7e40);
13710         MP_WritePhyUshort(sc, 0x15, 0x00e3);
13711         MP_WritePhyUshort(sc, 0x19, 0x5a40);
13712         MP_WritePhyUshort(sc, 0x15, 0x00e4);
13713         MP_WritePhyUshort(sc, 0x19, 0x305a);
13714         MP_WritePhyUshort(sc, 0x15, 0x00e5);
13715         MP_WritePhyUshort(sc, 0x19, 0x0000);
13716         MP_WritePhyUshort(sc, 0x15, 0x00e6);
13717         MP_WritePhyUshort(sc, 0x19, 0x0000);
13718         MP_WritePhyUshort(sc, 0x15, 0x00e7);
13719         MP_WritePhyUshort(sc, 0x19, 0x0000);
13720         MP_WritePhyUshort(sc, 0x15, 0x00e8);
13721         MP_WritePhyUshort(sc, 0x19, 0x0000);
13722         MP_WritePhyUshort(sc, 0x15, 0x00e9);
13723         MP_WritePhyUshort(sc, 0x19, 0x480a);
13724         MP_WritePhyUshort(sc, 0x15, 0x00ea);
13725         MP_WritePhyUshort(sc, 0x19, 0x5820);
13726         MP_WritePhyUshort(sc, 0x15, 0x00eb);
13727         MP_WritePhyUshort(sc, 0x19, 0x6c03);
13728         MP_WritePhyUshort(sc, 0x15, 0x00ec);
13729         MP_WritePhyUshort(sc, 0x19, 0xb60a);
13730         MP_WritePhyUshort(sc, 0x15, 0x00ed);
13731         MP_WritePhyUshort(sc, 0x19, 0xda07);
13732         MP_WritePhyUshort(sc, 0x15, 0x00ee);
13733         MP_WritePhyUshort(sc, 0x19, 0x0008);
13734         MP_WritePhyUshort(sc, 0x15, 0x00ef);
13735         MP_WritePhyUshort(sc, 0x19, 0xc60b);
13736         MP_WritePhyUshort(sc, 0x15, 0x00f0);
13737         MP_WritePhyUshort(sc, 0x19, 0x00fc);
13738         MP_WritePhyUshort(sc, 0x15, 0x00f1);
13739         MP_WritePhyUshort(sc, 0x19, 0x30f6);
13740         MP_WritePhyUshort(sc, 0x15, 0x00f2);
13741         MP_WritePhyUshort(sc, 0x19, 0x0000);
13742         MP_WritePhyUshort(sc, 0x15, 0x00f3);
13743         MP_WritePhyUshort(sc, 0x19, 0x0000);
13744         MP_WritePhyUshort(sc, 0x15, 0x00f4);
13745         MP_WritePhyUshort(sc, 0x19, 0x0000);
13746         MP_WritePhyUshort(sc, 0x15, 0x00f5);
13747         MP_WritePhyUshort(sc, 0x19, 0x0000);
13748         MP_WritePhyUshort(sc, 0x15, 0x00f6);
13749         MP_WritePhyUshort(sc, 0x19, 0x4408);
13750         MP_WritePhyUshort(sc, 0x15, 0x00f7);
13751         MP_WritePhyUshort(sc, 0x19, 0x480b);
13752         MP_WritePhyUshort(sc, 0x15, 0x00f8);
13753         MP_WritePhyUshort(sc, 0x19, 0x6f03);
13754         MP_WritePhyUshort(sc, 0x15, 0x00f9);
13755         MP_WritePhyUshort(sc, 0x19, 0x405f);
13756         MP_WritePhyUshort(sc, 0x15, 0x00fa);
13757         MP_WritePhyUshort(sc, 0x19, 0x4448);
13758         MP_WritePhyUshort(sc, 0x15, 0x00fb);
13759         MP_WritePhyUshort(sc, 0x19, 0x4020);
13760         MP_WritePhyUshort(sc, 0x15, 0x00fc);
13761         MP_WritePhyUshort(sc, 0x19, 0x4468);
13762         MP_WritePhyUshort(sc, 0x15, 0x00fd);
13763         MP_WritePhyUshort(sc, 0x19, 0x9c03);
13764         MP_WritePhyUshort(sc, 0x15, 0x00fe);
13765         MP_WritePhyUshort(sc, 0x19, 0x6f07);
13766         MP_WritePhyUshort(sc, 0x15, 0x00ff);
13767         MP_WritePhyUshort(sc, 0x19, 0x58a0);
13768         MP_WritePhyUshort(sc, 0x15, 0x0100);
13769         MP_WritePhyUshort(sc, 0x19, 0xd6d1);
13770         MP_WritePhyUshort(sc, 0x15, 0x0101);
13771         MP_WritePhyUshort(sc, 0x19, 0x0004);
13772         MP_WritePhyUshort(sc, 0x15, 0x0102);
13773         MP_WritePhyUshort(sc, 0x19, 0xc137);
13774         MP_WritePhyUshort(sc, 0x15, 0x0103);
13775         MP_WritePhyUshort(sc, 0x19, 0x0002);
13776         MP_WritePhyUshort(sc, 0x15, 0x0104);
13777         MP_WritePhyUshort(sc, 0x19, 0xa0e5);
13778         MP_WritePhyUshort(sc, 0x15, 0x0105);
13779         MP_WritePhyUshort(sc, 0x19, 0x9df8);
13780         MP_WritePhyUshort(sc, 0x15, 0x0106);
13781         MP_WritePhyUshort(sc, 0x19, 0x30c6);
13782         MP_WritePhyUshort(sc, 0x15, 0x0107);
13783         MP_WritePhyUshort(sc, 0x19, 0x0000);
13784         MP_WritePhyUshort(sc, 0x15, 0x0108);
13785         MP_WritePhyUshort(sc, 0x19, 0x0000);
13786         MP_WritePhyUshort(sc, 0x15, 0x0109);
13787         MP_WritePhyUshort(sc, 0x19, 0x0000);
13788         MP_WritePhyUshort(sc, 0x15, 0x010a);
13789         MP_WritePhyUshort(sc, 0x19, 0x0000);
13790         MP_WritePhyUshort(sc, 0x15, 0x010b);
13791         MP_WritePhyUshort(sc, 0x19, 0x4808);
13792         MP_WritePhyUshort(sc, 0x15, 0x010c);
13793         MP_WritePhyUshort(sc, 0x19, 0xc32d);
13794         MP_WritePhyUshort(sc, 0x15, 0x010d);
13795         MP_WritePhyUshort(sc, 0x19, 0x0003);
13796         MP_WritePhyUshort(sc, 0x15, 0x010e);
13797         MP_WritePhyUshort(sc, 0x19, 0xc8b3);
13798         MP_WritePhyUshort(sc, 0x15, 0x010f);
13799         MP_WritePhyUshort(sc, 0x19, 0x00fc);
13800         MP_WritePhyUshort(sc, 0x15, 0x0110);
13801         MP_WritePhyUshort(sc, 0x19, 0x4400);
13802         MP_WritePhyUshort(sc, 0x15, 0x0111);
13803         MP_WritePhyUshort(sc, 0x19, 0x3116);
13804         MP_WritePhyUshort(sc, 0x15, 0x0112);
13805         MP_WritePhyUshort(sc, 0x19, 0x0000);
13806         MP_WritePhyUshort(sc, 0x15, 0x0113);
13807         MP_WritePhyUshort(sc, 0x19, 0x0000);
13808         MP_WritePhyUshort(sc, 0x15, 0x0114);
13809         MP_WritePhyUshort(sc, 0x19, 0x0000);
13810         MP_WritePhyUshort(sc, 0x15, 0x0115);
13811         MP_WritePhyUshort(sc, 0x19, 0x0000);
13812         MP_WritePhyUshort(sc, 0x15, 0x0116);
13813         MP_WritePhyUshort(sc, 0x19, 0x4803);
13814         MP_WritePhyUshort(sc, 0x15, 0x0117);
13815         MP_WritePhyUshort(sc, 0x19, 0x7c03);
13816         MP_WritePhyUshort(sc, 0x15, 0x0118);
13817         MP_WritePhyUshort(sc, 0x19, 0x6c02);
13818         MP_WritePhyUshort(sc, 0x15, 0x0119);
13819         MP_WritePhyUshort(sc, 0x19, 0x7c04);
13820         MP_WritePhyUshort(sc, 0x15, 0x011a);
13821         MP_WritePhyUshort(sc, 0x19, 0x6000);
13822         MP_WritePhyUshort(sc, 0x15, 0x011b);
13823         MP_WritePhyUshort(sc, 0x19, 0x5cf7);
13824         MP_WritePhyUshort(sc, 0x15, 0x011c);
13825         MP_WritePhyUshort(sc, 0x19, 0x7c2a);
13826         MP_WritePhyUshort(sc, 0x15, 0x011d);
13827         MP_WritePhyUshort(sc, 0x19, 0x5800);
13828         MP_WritePhyUshort(sc, 0x15, 0x011e);
13829         MP_WritePhyUshort(sc, 0x19, 0x5400);
13830         MP_WritePhyUshort(sc, 0x15, 0x011f);
13831         MP_WritePhyUshort(sc, 0x19, 0x7c08);
13832         MP_WritePhyUshort(sc, 0x15, 0x0120);
13833         MP_WritePhyUshort(sc, 0x19, 0x74f0);
13834         MP_WritePhyUshort(sc, 0x15, 0x0121);
13835         MP_WritePhyUshort(sc, 0x19, 0x4019);
13836         MP_WritePhyUshort(sc, 0x15, 0x0122);
13837         MP_WritePhyUshort(sc, 0x19, 0x440d);
13838         MP_WritePhyUshort(sc, 0x15, 0x0123);
13839         MP_WritePhyUshort(sc, 0x19, 0xb6c1);
13840         MP_WritePhyUshort(sc, 0x15, 0x0124);
13841         MP_WritePhyUshort(sc, 0x19, 0xc05b);
13842         MP_WritePhyUshort(sc, 0x15, 0x0125);
13843         MP_WritePhyUshort(sc, 0x19, 0x00bf);
13844         MP_WritePhyUshort(sc, 0x15, 0x0126);
13845         MP_WritePhyUshort(sc, 0x19, 0xc025);
13846         MP_WritePhyUshort(sc, 0x15, 0x0127);
13847         MP_WritePhyUshort(sc, 0x19, 0x00bd);
13848         MP_WritePhyUshort(sc, 0x15, 0x0128);
13849         MP_WritePhyUshort(sc, 0x19, 0xc603);
13850         MP_WritePhyUshort(sc, 0x15, 0x0129);
13851         MP_WritePhyUshort(sc, 0x19, 0x00bb);
13852         MP_WritePhyUshort(sc, 0x15, 0x012a);
13853         MP_WritePhyUshort(sc, 0x19, 0x8805);
13854         MP_WritePhyUshort(sc, 0x15, 0x012b);
13855         MP_WritePhyUshort(sc, 0x19, 0x7801);
13856         MP_WritePhyUshort(sc, 0x15, 0x012c);
13857         MP_WritePhyUshort(sc, 0x19, 0x4001);
13858         MP_WritePhyUshort(sc, 0x15, 0x012d);
13859         MP_WritePhyUshort(sc, 0x19, 0x7800);
13860         MP_WritePhyUshort(sc, 0x15, 0x012e);
13861         MP_WritePhyUshort(sc, 0x19, 0xa3dd);
13862         MP_WritePhyUshort(sc, 0x15, 0x012f);
13863         MP_WritePhyUshort(sc, 0x19, 0x7c03);
13864         MP_WritePhyUshort(sc, 0x15, 0x0130);
13865         MP_WritePhyUshort(sc, 0x19, 0x6c03);
13866         MP_WritePhyUshort(sc, 0x15, 0x0131);
13867         MP_WritePhyUshort(sc, 0x19, 0x8407);
13868         MP_WritePhyUshort(sc, 0x15, 0x0132);
13869         MP_WritePhyUshort(sc, 0x19, 0x7c03);
13870         MP_WritePhyUshort(sc, 0x15, 0x0133);
13871         MP_WritePhyUshort(sc, 0x19, 0x6c02);
13872         MP_WritePhyUshort(sc, 0x15, 0x0134);
13873         MP_WritePhyUshort(sc, 0x19, 0xd9b8);
13874         MP_WritePhyUshort(sc, 0x15, 0x0135);
13875         MP_WritePhyUshort(sc, 0x19, 0x0003);
13876         MP_WritePhyUshort(sc, 0x15, 0x0136);
13877         MP_WritePhyUshort(sc, 0x19, 0xc240);
13878         MP_WritePhyUshort(sc, 0x15, 0x0137);
13879         MP_WritePhyUshort(sc, 0x19, 0x0015);
13880         MP_WritePhyUshort(sc, 0x15, 0x0138);
13881         MP_WritePhyUshort(sc, 0x19, 0x7c03);
13882         MP_WritePhyUshort(sc, 0x15, 0x0139);
13883         MP_WritePhyUshort(sc, 0x19, 0x6c02);
13884         MP_WritePhyUshort(sc, 0x15, 0x013a);
13885         MP_WritePhyUshort(sc, 0x19, 0x9ae9);
13886         MP_WritePhyUshort(sc, 0x15, 0x013b);
13887         MP_WritePhyUshort(sc, 0x19, 0x3140);
13888         MP_WritePhyUshort(sc, 0x15, 0x013c);
13889         MP_WritePhyUshort(sc, 0x19, 0x0000);
13890         MP_WritePhyUshort(sc, 0x15, 0x013d);
13891         MP_WritePhyUshort(sc, 0x19, 0x0000);
13892         MP_WritePhyUshort(sc, 0x15, 0x013e);
13893         MP_WritePhyUshort(sc, 0x19, 0x0000);
13894         MP_WritePhyUshort(sc, 0x15, 0x013f);
13895         MP_WritePhyUshort(sc, 0x19, 0x0000);
13896         MP_WritePhyUshort(sc, 0x15, 0x0140);
13897         MP_WritePhyUshort(sc, 0x19, 0x4807);
13898         MP_WritePhyUshort(sc, 0x15, 0x0141);
13899         MP_WritePhyUshort(sc, 0x19, 0x4004);
13900         MP_WritePhyUshort(sc, 0x15, 0x0142);
13901         MP_WritePhyUshort(sc, 0x19, 0x4410);
13902         MP_WritePhyUshort(sc, 0x15, 0x0143);
13903         MP_WritePhyUshort(sc, 0x19, 0x7c0c);
13904         MP_WritePhyUshort(sc, 0x15, 0x0144);
13905         MP_WritePhyUshort(sc, 0x19, 0x600c);
13906         MP_WritePhyUshort(sc, 0x15, 0x0145);
13907         MP_WritePhyUshort(sc, 0x19, 0x9b00);
13908         MP_WritePhyUshort(sc, 0x15, 0x0146);
13909         MP_WritePhyUshort(sc, 0x19, 0xa68f);
13910         MP_WritePhyUshort(sc, 0x15, 0x0147);
13911         MP_WritePhyUshort(sc, 0x19, 0x3116);
13912         MP_WritePhyUshort(sc, 0x15, 0x0148);
13913         MP_WritePhyUshort(sc, 0x19, 0x0000);
13914         MP_WritePhyUshort(sc, 0x15, 0x0149);
13915         MP_WritePhyUshort(sc, 0x19, 0x0000);
13916         MP_WritePhyUshort(sc, 0x15, 0x014a);
13917         MP_WritePhyUshort(sc, 0x19, 0x0000);
13918         MP_WritePhyUshort(sc, 0x15, 0x014b);
13919         MP_WritePhyUshort(sc, 0x19, 0x0000);
13920         MP_WritePhyUshort(sc, 0x15, 0x014c);
13921         MP_WritePhyUshort(sc, 0x19, 0x4804);
13922         MP_WritePhyUshort(sc, 0x15, 0x014d);
13923         MP_WritePhyUshort(sc, 0x19, 0x54c0);
13924         MP_WritePhyUshort(sc, 0x15, 0x014e);
13925         MP_WritePhyUshort(sc, 0x19, 0xb703);
13926         MP_WritePhyUshort(sc, 0x15, 0x014f);
13927         MP_WritePhyUshort(sc, 0x19, 0x5cff);
13928         MP_WritePhyUshort(sc, 0x15, 0x0150);
13929         MP_WritePhyUshort(sc, 0x19, 0x315f);
13930         MP_WritePhyUshort(sc, 0x15, 0x0151);
13931         MP_WritePhyUshort(sc, 0x19, 0x7c08);
13932         MP_WritePhyUshort(sc, 0x15, 0x0152);
13933         MP_WritePhyUshort(sc, 0x19, 0x74f8);
13934         MP_WritePhyUshort(sc, 0x15, 0x0153);
13935         MP_WritePhyUshort(sc, 0x19, 0x6421);
13936         MP_WritePhyUshort(sc, 0x15, 0x0154);
13937         MP_WritePhyUshort(sc, 0x19, 0x7c08);
13938         MP_WritePhyUshort(sc, 0x15, 0x0155);
13939         MP_WritePhyUshort(sc, 0x19, 0x6000);
13940         MP_WritePhyUshort(sc, 0x15, 0x0156);
13941         MP_WritePhyUshort(sc, 0x19, 0x4003);
13942         MP_WritePhyUshort(sc, 0x15, 0x0157);
13943         MP_WritePhyUshort(sc, 0x19, 0x4418);
13944         MP_WritePhyUshort(sc, 0x15, 0x0158);
13945         MP_WritePhyUshort(sc, 0x19, 0x9b00);
13946         MP_WritePhyUshort(sc, 0x15, 0x0159);
13947         MP_WritePhyUshort(sc, 0x19, 0x6461);
13948         MP_WritePhyUshort(sc, 0x15, 0x015a);
13949         MP_WritePhyUshort(sc, 0x19, 0x64e1);
13950         MP_WritePhyUshort(sc, 0x15, 0x015b);
13951         MP_WritePhyUshort(sc, 0x19, 0x7c20);
13952         MP_WritePhyUshort(sc, 0x15, 0x015c);
13953         MP_WritePhyUshort(sc, 0x19, 0x5820);
13954         MP_WritePhyUshort(sc, 0x15, 0x015d);
13955         MP_WritePhyUshort(sc, 0x19, 0x5ccf);
13956         MP_WritePhyUshort(sc, 0x15, 0x015e);
13957         MP_WritePhyUshort(sc, 0x19, 0x7050);
13958         MP_WritePhyUshort(sc, 0x15, 0x015f);
13959         MP_WritePhyUshort(sc, 0x19, 0xd9b8);
13960         MP_WritePhyUshort(sc, 0x15, 0x0160);
13961         MP_WritePhyUshort(sc, 0x19, 0x0008);
13962         MP_WritePhyUshort(sc, 0x15, 0x0161);
13963         MP_WritePhyUshort(sc, 0x19, 0xdab1);
13964         MP_WritePhyUshort(sc, 0x15, 0x0162);
13965         MP_WritePhyUshort(sc, 0x19, 0x0015);
13966         MP_WritePhyUshort(sc, 0x15, 0x0163);
13967         MP_WritePhyUshort(sc, 0x19, 0xc244);
13968         MP_WritePhyUshort(sc, 0x15, 0x0164);
13969         MP_WritePhyUshort(sc, 0x19, 0x0013);
13970         MP_WritePhyUshort(sc, 0x15, 0x0165);
13971         MP_WritePhyUshort(sc, 0x19, 0xc021);
13972         MP_WritePhyUshort(sc, 0x15, 0x0166);
13973         MP_WritePhyUshort(sc, 0x19, 0x00f9);
13974         MP_WritePhyUshort(sc, 0x15, 0x0167);
13975         MP_WritePhyUshort(sc, 0x19, 0x3177);
13976         MP_WritePhyUshort(sc, 0x15, 0x0168);
13977         MP_WritePhyUshort(sc, 0x19, 0x5cf7);
13978         MP_WritePhyUshort(sc, 0x15, 0x0169);
13979         MP_WritePhyUshort(sc, 0x19, 0x4010);
13980         MP_WritePhyUshort(sc, 0x15, 0x016a);
13981         MP_WritePhyUshort(sc, 0x19, 0x4428);
13982         MP_WritePhyUshort(sc, 0x15, 0x016b);
13983         MP_WritePhyUshort(sc, 0x19, 0x9c00);
13984         MP_WritePhyUshort(sc, 0x15, 0x016c);
13985         MP_WritePhyUshort(sc, 0x19, 0x7c08);
13986         MP_WritePhyUshort(sc, 0x15, 0x016d);
13987         MP_WritePhyUshort(sc, 0x19, 0x6008);
13988         MP_WritePhyUshort(sc, 0x15, 0x016e);
13989         MP_WritePhyUshort(sc, 0x19, 0x7c08);
13990         MP_WritePhyUshort(sc, 0x15, 0x016f);
13991         MP_WritePhyUshort(sc, 0x19, 0x74f0);
13992         MP_WritePhyUshort(sc, 0x15, 0x0170);
13993         MP_WritePhyUshort(sc, 0x19, 0x6461);
13994         MP_WritePhyUshort(sc, 0x15, 0x0171);
13995         MP_WritePhyUshort(sc, 0x19, 0x6421);
13996         MP_WritePhyUshort(sc, 0x15, 0x0172);
13997         MP_WritePhyUshort(sc, 0x19, 0x64a1);
13998         MP_WritePhyUshort(sc, 0x15, 0x0173);
13999         MP_WritePhyUshort(sc, 0x19, 0x3116);
14000         MP_WritePhyUshort(sc, 0x15, 0x0174);
14001         MP_WritePhyUshort(sc, 0x19, 0x0000);
14002         MP_WritePhyUshort(sc, 0x15, 0x0175);
14003         MP_WritePhyUshort(sc, 0x19, 0x0000);
14004         MP_WritePhyUshort(sc, 0x15, 0x0176);
14005         MP_WritePhyUshort(sc, 0x19, 0x0000);
14006         MP_WritePhyUshort(sc, 0x15, 0x0177);
14007         MP_WritePhyUshort(sc, 0x19, 0x4805);
14008         MP_WritePhyUshort(sc, 0x15, 0x0178);
14009         MP_WritePhyUshort(sc, 0x19, 0xa103);
14010         MP_WritePhyUshort(sc, 0x15, 0x0179);
14011         MP_WritePhyUshort(sc, 0x19, 0x7c02);
14012         MP_WritePhyUshort(sc, 0x15, 0x017a);
14013         MP_WritePhyUshort(sc, 0x19, 0x6002);
14014         MP_WritePhyUshort(sc, 0x15, 0x017b);
14015         MP_WritePhyUshort(sc, 0x19, 0x7e00);
14016         MP_WritePhyUshort(sc, 0x15, 0x017c);
14017         MP_WritePhyUshort(sc, 0x19, 0x5400);
14018         MP_WritePhyUshort(sc, 0x15, 0x017d);
14019         MP_WritePhyUshort(sc, 0x19, 0x7c6b);
14020         MP_WritePhyUshort(sc, 0x15, 0x017e);
14021         MP_WritePhyUshort(sc, 0x19, 0x5c63);
14022         MP_WritePhyUshort(sc, 0x15, 0x017f);
14023         MP_WritePhyUshort(sc, 0x19, 0x407d);
14024         MP_WritePhyUshort(sc, 0x15, 0x0180);
14025         MP_WritePhyUshort(sc, 0x19, 0xa602);
14026         MP_WritePhyUshort(sc, 0x15, 0x0181);
14027         MP_WritePhyUshort(sc, 0x19, 0x4001);
14028         MP_WritePhyUshort(sc, 0x15, 0x0182);
14029         MP_WritePhyUshort(sc, 0x19, 0x4420);
14030         MP_WritePhyUshort(sc, 0x15, 0x0183);
14031         MP_WritePhyUshort(sc, 0x19, 0x4020);
14032         MP_WritePhyUshort(sc, 0x15, 0x0184);
14033         MP_WritePhyUshort(sc, 0x19, 0x44a1);
14034         MP_WritePhyUshort(sc, 0x15, 0x0185);
14035         MP_WritePhyUshort(sc, 0x19, 0xd6e0);
14036         MP_WritePhyUshort(sc, 0x15, 0x0186);
14037         MP_WritePhyUshort(sc, 0x19, 0x0009);
14038         MP_WritePhyUshort(sc, 0x15, 0x0187);
14039         MP_WritePhyUshort(sc, 0x19, 0x9efe);
14040         MP_WritePhyUshort(sc, 0x15, 0x0188);
14041         MP_WritePhyUshort(sc, 0x19, 0x7c02);
14042         MP_WritePhyUshort(sc, 0x15, 0x0189);
14043         MP_WritePhyUshort(sc, 0x19, 0x6000);
14044         MP_WritePhyUshort(sc, 0x15, 0x018a);
14045         MP_WritePhyUshort(sc, 0x19, 0x9c00);
14046         MP_WritePhyUshort(sc, 0x15, 0x018b);
14047         MP_WritePhyUshort(sc, 0x19, 0x318f);
14048         MP_WritePhyUshort(sc, 0x15, 0x018c);
14049         MP_WritePhyUshort(sc, 0x19, 0x0000);
14050         MP_WritePhyUshort(sc, 0x15, 0x018d);
14051         MP_WritePhyUshort(sc, 0x19, 0x0000);
14052         MP_WritePhyUshort(sc, 0x15, 0x018e);
14053         MP_WritePhyUshort(sc, 0x19, 0x0000);
14054         MP_WritePhyUshort(sc, 0x15, 0x018f);
14055         MP_WritePhyUshort(sc, 0x19, 0x4806);
14056         MP_WritePhyUshort(sc, 0x15, 0x0190);
14057         MP_WritePhyUshort(sc, 0x19, 0x7c10);
14058         MP_WritePhyUshort(sc, 0x15, 0x0191);
14059         MP_WritePhyUshort(sc, 0x19, 0x5c10);
14060         MP_WritePhyUshort(sc, 0x15, 0x0192);
14061         MP_WritePhyUshort(sc, 0x19, 0x40fa);
14062         MP_WritePhyUshort(sc, 0x15, 0x0193);
14063         MP_WritePhyUshort(sc, 0x19, 0xa602);
14064         MP_WritePhyUshort(sc, 0x15, 0x0194);
14065         MP_WritePhyUshort(sc, 0x19, 0x4010);
14066         MP_WritePhyUshort(sc, 0x15, 0x0195);
14067         MP_WritePhyUshort(sc, 0x19, 0x4440);
14068         MP_WritePhyUshort(sc, 0x15, 0x0196);
14069         MP_WritePhyUshort(sc, 0x19, 0x9d00);
14070         MP_WritePhyUshort(sc, 0x15, 0x0197);
14071         MP_WritePhyUshort(sc, 0x19, 0x7c80);
14072         MP_WritePhyUshort(sc, 0x15, 0x0198);
14073         MP_WritePhyUshort(sc, 0x19, 0x6400);
14074         MP_WritePhyUshort(sc, 0x15, 0x0199);
14075         MP_WritePhyUshort(sc, 0x19, 0x4003);
14076         MP_WritePhyUshort(sc, 0x15, 0x019a);
14077         MP_WritePhyUshort(sc, 0x19, 0x4540);
14078         MP_WritePhyUshort(sc, 0x15, 0x019b);
14079         MP_WritePhyUshort(sc, 0x19, 0x7c08);
14080         MP_WritePhyUshort(sc, 0x15, 0x019c);
14081         MP_WritePhyUshort(sc, 0x19, 0x6008);
14082         MP_WritePhyUshort(sc, 0x15, 0x019d);
14083         MP_WritePhyUshort(sc, 0x19, 0x9f00);
14084         MP_WritePhyUshort(sc, 0x15, 0x019e);
14085         MP_WritePhyUshort(sc, 0x19, 0x7c40);
14086         MP_WritePhyUshort(sc, 0x15, 0x019f);
14087         MP_WritePhyUshort(sc, 0x19, 0x6400);
14088         MP_WritePhyUshort(sc, 0x15, 0x01a0);
14089         MP_WritePhyUshort(sc, 0x19, 0x7c80);
14090         MP_WritePhyUshort(sc, 0x15, 0x01a1);
14091         MP_WritePhyUshort(sc, 0x19, 0x6480);
14092         MP_WritePhyUshort(sc, 0x15, 0x01a2);
14093         MP_WritePhyUshort(sc, 0x19, 0x3140);
14094         MP_WritePhyUshort(sc, 0x15, 0x01a3);
14095         MP_WritePhyUshort(sc, 0x19, 0x0000);
14096         MP_WritePhyUshort(sc, 0x15, 0x01a4);
14097         MP_WritePhyUshort(sc, 0x19, 0x0000);
14098         MP_WritePhyUshort(sc, 0x15, 0x01a5);
14099         MP_WritePhyUshort(sc, 0x19, 0x0000);
14100         MP_WritePhyUshort(sc, 0x15, 0x01a6);
14101         MP_WritePhyUshort(sc, 0x19, 0x4400);
14102         MP_WritePhyUshort(sc, 0x15, 0x01a7);
14103         MP_WritePhyUshort(sc, 0x19, 0x7c0b);
14104         MP_WritePhyUshort(sc, 0x15, 0x01a8);
14105         MP_WritePhyUshort(sc, 0x19, 0x6c01);
14106         MP_WritePhyUshort(sc, 0x15, 0x01a9);
14107         MP_WritePhyUshort(sc, 0x19, 0x64a8);
14108         MP_WritePhyUshort(sc, 0x15, 0x01aa);
14109         MP_WritePhyUshort(sc, 0x19, 0x6800);
14110         MP_WritePhyUshort(sc, 0x15, 0x01ab);
14111         MP_WritePhyUshort(sc, 0x19, 0x5cf0);
14112         MP_WritePhyUshort(sc, 0x15, 0x01ac);
14113         MP_WritePhyUshort(sc, 0x19, 0x588f);
14114         MP_WritePhyUshort(sc, 0x15, 0x01ad);
14115         MP_WritePhyUshort(sc, 0x19, 0xb628);
14116         MP_WritePhyUshort(sc, 0x15, 0x01ae);
14117         MP_WritePhyUshort(sc, 0x19, 0xc053);
14118         MP_WritePhyUshort(sc, 0x15, 0x01af);
14119         MP_WritePhyUshort(sc, 0x19, 0x0026);
14120         MP_WritePhyUshort(sc, 0x15, 0x01b0);
14121         MP_WritePhyUshort(sc, 0x19, 0xc02d);
14122         MP_WritePhyUshort(sc, 0x15, 0x01b1);
14123         MP_WritePhyUshort(sc, 0x19, 0x0024);
14124         MP_WritePhyUshort(sc, 0x15, 0x01b2);
14125         MP_WritePhyUshort(sc, 0x19, 0xc603);
14126         MP_WritePhyUshort(sc, 0x15, 0x01b3);
14127         MP_WritePhyUshort(sc, 0x19, 0x0022);
14128         MP_WritePhyUshort(sc, 0x15, 0x01b4);
14129         MP_WritePhyUshort(sc, 0x19, 0x8cf9);
14130         MP_WritePhyUshort(sc, 0x15, 0x01b5);
14131         MP_WritePhyUshort(sc, 0x19, 0x31ba);
14132         MP_WritePhyUshort(sc, 0x15, 0x01b6);
14133         MP_WritePhyUshort(sc, 0x19, 0x0000);
14134         MP_WritePhyUshort(sc, 0x15, 0x01b7);
14135         MP_WritePhyUshort(sc, 0x19, 0x0000);
14136         MP_WritePhyUshort(sc, 0x15, 0x01b8);
14137         MP_WritePhyUshort(sc, 0x19, 0x0000);
14138         MP_WritePhyUshort(sc, 0x15, 0x01b9);
14139         MP_WritePhyUshort(sc, 0x19, 0x0000);
14140         MP_WritePhyUshort(sc, 0x15, 0x01ba);
14141         MP_WritePhyUshort(sc, 0x19, 0x4400);
14142         MP_WritePhyUshort(sc, 0x15, 0x01bb);
14143         MP_WritePhyUshort(sc, 0x19, 0x5420);
14144         MP_WritePhyUshort(sc, 0x15, 0x01bc);
14145         MP_WritePhyUshort(sc, 0x19, 0x4811);
14146         MP_WritePhyUshort(sc, 0x15, 0x01bd);
14147         MP_WritePhyUshort(sc, 0x19, 0x5000);
14148         MP_WritePhyUshort(sc, 0x15, 0x01be);
14149         MP_WritePhyUshort(sc, 0x19, 0x4801);
14150         MP_WritePhyUshort(sc, 0x15, 0x01bf);
14151         MP_WritePhyUshort(sc, 0x19, 0x6800);
14152         MP_WritePhyUshort(sc, 0x15, 0x01c0);
14153         MP_WritePhyUshort(sc, 0x19, 0x31f5);
14154         MP_WritePhyUshort(sc, 0x15, 0x01c1);
14155         MP_WritePhyUshort(sc, 0x19, 0xb614);
14156         MP_WritePhyUshort(sc, 0x15, 0x01c2);
14157         MP_WritePhyUshort(sc, 0x19, 0x8ce4);
14158         MP_WritePhyUshort(sc, 0x15, 0x01c3);
14159         MP_WritePhyUshort(sc, 0x19, 0xb30c);
14160         MP_WritePhyUshort(sc, 0x15, 0x01c4);
14161         MP_WritePhyUshort(sc, 0x19, 0x7c03);
14162         MP_WritePhyUshort(sc, 0x15, 0x01c5);
14163         MP_WritePhyUshort(sc, 0x19, 0x6c02);
14164         MP_WritePhyUshort(sc, 0x15, 0x01c6);
14165         MP_WritePhyUshort(sc, 0x19, 0x8206);
14166         MP_WritePhyUshort(sc, 0x15, 0x01c7);
14167         MP_WritePhyUshort(sc, 0x19, 0x7c03);
14168         MP_WritePhyUshort(sc, 0x15, 0x01c8);
14169         MP_WritePhyUshort(sc, 0x19, 0x6c00);
14170         MP_WritePhyUshort(sc, 0x15, 0x01c9);
14171         MP_WritePhyUshort(sc, 0x19, 0x7c04);
14172         MP_WritePhyUshort(sc, 0x15, 0x01ca);
14173         MP_WritePhyUshort(sc, 0x19, 0x7404);
14174         MP_WritePhyUshort(sc, 0x15, 0x01cb);
14175         MP_WritePhyUshort(sc, 0x19, 0x31c0);
14176         MP_WritePhyUshort(sc, 0x15, 0x01cc);
14177         MP_WritePhyUshort(sc, 0x19, 0x7c04);
14178         MP_WritePhyUshort(sc, 0x15, 0x01cd);
14179         MP_WritePhyUshort(sc, 0x19, 0x7400);
14180         MP_WritePhyUshort(sc, 0x15, 0x01ce);
14181         MP_WritePhyUshort(sc, 0x19, 0x31c0);
14182         MP_WritePhyUshort(sc, 0x15, 0x01cf);
14183         MP_WritePhyUshort(sc, 0x19, 0x8df1);
14184         MP_WritePhyUshort(sc, 0x15, 0x01d0);
14185         MP_WritePhyUshort(sc, 0x19, 0x3248);
14186         MP_WritePhyUshort(sc, 0x15, 0x01d1);
14187         MP_WritePhyUshort(sc, 0x19, 0x0000);
14188         MP_WritePhyUshort(sc, 0x15, 0x01d2);
14189         MP_WritePhyUshort(sc, 0x19, 0x0000);
14190         MP_WritePhyUshort(sc, 0x15, 0x01d3);
14191         MP_WritePhyUshort(sc, 0x19, 0x0000);
14192         MP_WritePhyUshort(sc, 0x15, 0x01d4);
14193         MP_WritePhyUshort(sc, 0x19, 0x0000);
14194         MP_WritePhyUshort(sc, 0x15, 0x01d5);
14195         MP_WritePhyUshort(sc, 0x19, 0x4400);
14196         MP_WritePhyUshort(sc, 0x15, 0x01d6);
14197         MP_WritePhyUshort(sc, 0x19, 0x7c03);
14198         MP_WritePhyUshort(sc, 0x15, 0x01d7);
14199         MP_WritePhyUshort(sc, 0x19, 0x6c03);
14200         MP_WritePhyUshort(sc, 0x15, 0x01d8);
14201         MP_WritePhyUshort(sc, 0x19, 0x7670);
14202         MP_WritePhyUshort(sc, 0x15, 0x01d9);
14203         MP_WritePhyUshort(sc, 0x19, 0x4023);
14204         MP_WritePhyUshort(sc, 0x15, 0x01da);
14205         MP_WritePhyUshort(sc, 0x19, 0x4500);
14206         MP_WritePhyUshort(sc, 0x15, 0x01db);
14207         MP_WritePhyUshort(sc, 0x19, 0x4069);
14208         MP_WritePhyUshort(sc, 0x15, 0x01dc);
14209         MP_WritePhyUshort(sc, 0x19, 0x4580);
14210         MP_WritePhyUshort(sc, 0x15, 0x01dd);
14211         MP_WritePhyUshort(sc, 0x19, 0x9f00);
14212         MP_WritePhyUshort(sc, 0x15, 0x01de);
14213         MP_WritePhyUshort(sc, 0x19, 0xcff5);
14214         MP_WritePhyUshort(sc, 0x15, 0x01df);
14215         MP_WritePhyUshort(sc, 0x19, 0x00ff);
14216         MP_WritePhyUshort(sc, 0x15, 0x01e0);
14217         MP_WritePhyUshort(sc, 0x19, 0x76f0);
14218         MP_WritePhyUshort(sc, 0x15, 0x01e1);
14219         MP_WritePhyUshort(sc, 0x19, 0x4400);
14220         MP_WritePhyUshort(sc, 0x15, 0x01e2);
14221         MP_WritePhyUshort(sc, 0x19, 0x4023);
14222         MP_WritePhyUshort(sc, 0x15, 0x01e3);
14223         MP_WritePhyUshort(sc, 0x19, 0x4500);
14224         MP_WritePhyUshort(sc, 0x15, 0x01e4);
14225         MP_WritePhyUshort(sc, 0x19, 0x4069);
14226         MP_WritePhyUshort(sc, 0x15, 0x01e5);
14227         MP_WritePhyUshort(sc, 0x19, 0x4580);
14228         MP_WritePhyUshort(sc, 0x15, 0x01e6);
14229         MP_WritePhyUshort(sc, 0x19, 0x9f00);
14230         MP_WritePhyUshort(sc, 0x15, 0x01e7);
14231         MP_WritePhyUshort(sc, 0x19, 0xd0f5);
14232         MP_WritePhyUshort(sc, 0x15, 0x01e8);
14233         MP_WritePhyUshort(sc, 0x19, 0x00ff);
14234         MP_WritePhyUshort(sc, 0x15, 0x01e9);
14235         MP_WritePhyUshort(sc, 0x19, 0x4400);
14236         MP_WritePhyUshort(sc, 0x15, 0x01ea);
14237         MP_WritePhyUshort(sc, 0x19, 0x7c03);
14238         MP_WritePhyUshort(sc, 0x15, 0x01eb);
14239         MP_WritePhyUshort(sc, 0x19, 0x6800);
14240         MP_WritePhyUshort(sc, 0x15, 0x01ec);
14241         MP_WritePhyUshort(sc, 0x19, 0x66a0);
14242         MP_WritePhyUshort(sc, 0x15, 0x01ed);
14243         MP_WritePhyUshort(sc, 0x19, 0x8300);
14244         MP_WritePhyUshort(sc, 0x15, 0x01ee);
14245         MP_WritePhyUshort(sc, 0x19, 0x74f0);
14246         MP_WritePhyUshort(sc, 0x15, 0x01ef);
14247         MP_WritePhyUshort(sc, 0x19, 0x3006);
14248         MP_WritePhyUshort(sc, 0x15, 0x01f0);
14249         MP_WritePhyUshort(sc, 0x19, 0x0000);
14250         MP_WritePhyUshort(sc, 0x15, 0x01f1);
14251         MP_WritePhyUshort(sc, 0x19, 0x0000);
14252         MP_WritePhyUshort(sc, 0x15, 0x01f2);
14253         MP_WritePhyUshort(sc, 0x19, 0x0000);
14254         MP_WritePhyUshort(sc, 0x15, 0x01f3);
14255         MP_WritePhyUshort(sc, 0x19, 0x0000);
14256         MP_WritePhyUshort(sc, 0x15, 0x01f4);
14257         MP_WritePhyUshort(sc, 0x19, 0x0000);
14258         MP_WritePhyUshort(sc, 0x15, 0x01f5);
14259         MP_WritePhyUshort(sc, 0x19, 0x7c03);
14260         MP_WritePhyUshort(sc, 0x15, 0x01f6);
14261         MP_WritePhyUshort(sc, 0x19, 0x6c02);
14262         MP_WritePhyUshort(sc, 0x15, 0x01f7);
14263         MP_WritePhyUshort(sc, 0x19, 0x409d);
14264         MP_WritePhyUshort(sc, 0x15, 0x01f8);
14265         MP_WritePhyUshort(sc, 0x19, 0x7c87);
14266         MP_WritePhyUshort(sc, 0x15, 0x01f9);
14267         MP_WritePhyUshort(sc, 0x19, 0xae14);
14268         MP_WritePhyUshort(sc, 0x15, 0x01fa);
14269         MP_WritePhyUshort(sc, 0x19, 0x4400);
14270         MP_WritePhyUshort(sc, 0x15, 0x01fb);
14271         MP_WritePhyUshort(sc, 0x19, 0x7c40);
14272         MP_WritePhyUshort(sc, 0x15, 0x01fc);
14273         MP_WritePhyUshort(sc, 0x19, 0x6800);
14274         MP_WritePhyUshort(sc, 0x15, 0x01fd);
14275         MP_WritePhyUshort(sc, 0x19, 0x7801);
14276         MP_WritePhyUshort(sc, 0x15, 0x01fe);
14277         MP_WritePhyUshort(sc, 0x19, 0x980e);
14278         MP_WritePhyUshort(sc, 0x15, 0x01ff);
14279         MP_WritePhyUshort(sc, 0x19, 0x930c);
14280         MP_WritePhyUshort(sc, 0x15, 0x0200);
14281         MP_WritePhyUshort(sc, 0x19, 0x9206);
14282         MP_WritePhyUshort(sc, 0x15, 0x0201);
14283         MP_WritePhyUshort(sc, 0x19, 0x4002);
14284         MP_WritePhyUshort(sc, 0x15, 0x0202);
14285         MP_WritePhyUshort(sc, 0x19, 0x7800);
14286         MP_WritePhyUshort(sc, 0x15, 0x0203);
14287         MP_WritePhyUshort(sc, 0x19, 0x588f);
14288         MP_WritePhyUshort(sc, 0x15, 0x0204);
14289         MP_WritePhyUshort(sc, 0x19, 0x5520);
14290         MP_WritePhyUshort(sc, 0x15, 0x0205);
14291         MP_WritePhyUshort(sc, 0x19, 0x320c);
14292         MP_WritePhyUshort(sc, 0x15, 0x0206);
14293         MP_WritePhyUshort(sc, 0x19, 0x4000);
14294         MP_WritePhyUshort(sc, 0x15, 0x0207);
14295         MP_WritePhyUshort(sc, 0x19, 0x7800);
14296         MP_WritePhyUshort(sc, 0x15, 0x0208);
14297         MP_WritePhyUshort(sc, 0x19, 0x588d);
14298         MP_WritePhyUshort(sc, 0x15, 0x0209);
14299         MP_WritePhyUshort(sc, 0x19, 0x5500);
14300         MP_WritePhyUshort(sc, 0x15, 0x020a);
14301         MP_WritePhyUshort(sc, 0x19, 0x320c);
14302         MP_WritePhyUshort(sc, 0x15, 0x020b);
14303         MP_WritePhyUshort(sc, 0x19, 0x4002);
14304         MP_WritePhyUshort(sc, 0x15, 0x020c);
14305         MP_WritePhyUshort(sc, 0x19, 0x3220);
14306         MP_WritePhyUshort(sc, 0x15, 0x020d);
14307         MP_WritePhyUshort(sc, 0x19, 0x4480);
14308         MP_WritePhyUshort(sc, 0x15, 0x020e);
14309         MP_WritePhyUshort(sc, 0x19, 0x9e03);
14310         MP_WritePhyUshort(sc, 0x15, 0x020f);
14311         MP_WritePhyUshort(sc, 0x19, 0x7c40);
14312         MP_WritePhyUshort(sc, 0x15, 0x0210);
14313         MP_WritePhyUshort(sc, 0x19, 0x6840);
14314         MP_WritePhyUshort(sc, 0x15, 0x0211);
14315         MP_WritePhyUshort(sc, 0x19, 0x7801);
14316         MP_WritePhyUshort(sc, 0x15, 0x0212);
14317         MP_WritePhyUshort(sc, 0x19, 0x980e);
14318         MP_WritePhyUshort(sc, 0x15, 0x0213);
14319         MP_WritePhyUshort(sc, 0x19, 0x930c);
14320         MP_WritePhyUshort(sc, 0x15, 0x0214);
14321         MP_WritePhyUshort(sc, 0x19, 0x9206);
14322         MP_WritePhyUshort(sc, 0x15, 0x0215);
14323         MP_WritePhyUshort(sc, 0x19, 0x4000);
14324         MP_WritePhyUshort(sc, 0x15, 0x0216);
14325         MP_WritePhyUshort(sc, 0x19, 0x7800);
14326         MP_WritePhyUshort(sc, 0x15, 0x0217);
14327         MP_WritePhyUshort(sc, 0x19, 0x588f);
14328         MP_WritePhyUshort(sc, 0x15, 0x0218);
14329         MP_WritePhyUshort(sc, 0x19, 0x5520);
14330         MP_WritePhyUshort(sc, 0x15, 0x0219);
14331         MP_WritePhyUshort(sc, 0x19, 0x3220);
14332         MP_WritePhyUshort(sc, 0x15, 0x021a);
14333         MP_WritePhyUshort(sc, 0x19, 0x4002);
14334         MP_WritePhyUshort(sc, 0x15, 0x021b);
14335         MP_WritePhyUshort(sc, 0x19, 0x7800);
14336         MP_WritePhyUshort(sc, 0x15, 0x021c);
14337         MP_WritePhyUshort(sc, 0x19, 0x588d);
14338         MP_WritePhyUshort(sc, 0x15, 0x021d);
14339         MP_WritePhyUshort(sc, 0x19, 0x5540);
14340         MP_WritePhyUshort(sc, 0x15, 0x021e);
14341         MP_WritePhyUshort(sc, 0x19, 0x3220);
14342         MP_WritePhyUshort(sc, 0x15, 0x021f);
14343         MP_WritePhyUshort(sc, 0x19, 0x4000);
14344         MP_WritePhyUshort(sc, 0x15, 0x0220);
14345         MP_WritePhyUshort(sc, 0x19, 0x7800);
14346         MP_WritePhyUshort(sc, 0x15, 0x0221);
14347         MP_WritePhyUshort(sc, 0x19, 0x7c03);
14348         MP_WritePhyUshort(sc, 0x15, 0x0222);
14349         MP_WritePhyUshort(sc, 0x19, 0x6c00);
14350         MP_WritePhyUshort(sc, 0x15, 0x0223);
14351         MP_WritePhyUshort(sc, 0x19, 0x3231);
14352         MP_WritePhyUshort(sc, 0x15, 0x0224);
14353         MP_WritePhyUshort(sc, 0x19, 0xab06);
14354         MP_WritePhyUshort(sc, 0x15, 0x0225);
14355         MP_WritePhyUshort(sc, 0x19, 0xbf08);
14356         MP_WritePhyUshort(sc, 0x15, 0x0226);
14357         MP_WritePhyUshort(sc, 0x19, 0x4076);
14358         MP_WritePhyUshort(sc, 0x15, 0x0227);
14359         MP_WritePhyUshort(sc, 0x19, 0x7d07);
14360         MP_WritePhyUshort(sc, 0x15, 0x0228);
14361         MP_WritePhyUshort(sc, 0x19, 0x4502);
14362         MP_WritePhyUshort(sc, 0x15, 0x0229);
14363         MP_WritePhyUshort(sc, 0x19, 0x3231);
14364         MP_WritePhyUshort(sc, 0x15, 0x022a);
14365         MP_WritePhyUshort(sc, 0x19, 0x7d80);
14366         MP_WritePhyUshort(sc, 0x15, 0x022b);
14367         MP_WritePhyUshort(sc, 0x19, 0x5180);
14368         MP_WritePhyUshort(sc, 0x15, 0x022c);
14369         MP_WritePhyUshort(sc, 0x19, 0x322f);
14370         MP_WritePhyUshort(sc, 0x15, 0x022d);
14371         MP_WritePhyUshort(sc, 0x19, 0x7d80);
14372         MP_WritePhyUshort(sc, 0x15, 0x022e);
14373         MP_WritePhyUshort(sc, 0x19, 0x5000);
14374         MP_WritePhyUshort(sc, 0x15, 0x022f);
14375         MP_WritePhyUshort(sc, 0x19, 0x7d07);
14376         MP_WritePhyUshort(sc, 0x15, 0x0230);
14377         MP_WritePhyUshort(sc, 0x19, 0x4402);
14378         MP_WritePhyUshort(sc, 0x15, 0x0231);
14379         MP_WritePhyUshort(sc, 0x19, 0x7c03);
14380         MP_WritePhyUshort(sc, 0x15, 0x0232);
14381         MP_WritePhyUshort(sc, 0x19, 0x6c02);
14382         MP_WritePhyUshort(sc, 0x15, 0x0233);
14383         MP_WritePhyUshort(sc, 0x19, 0x7c03);
14384         MP_WritePhyUshort(sc, 0x15, 0x0234);
14385         MP_WritePhyUshort(sc, 0x19, 0xb309);
14386         MP_WritePhyUshort(sc, 0x15, 0x0235);
14387         MP_WritePhyUshort(sc, 0x19, 0xb204);
14388         MP_WritePhyUshort(sc, 0x15, 0x0236);
14389         MP_WritePhyUshort(sc, 0x19, 0xb105);
14390         MP_WritePhyUshort(sc, 0x15, 0x0237);
14391         MP_WritePhyUshort(sc, 0x19, 0x6c00);
14392         MP_WritePhyUshort(sc, 0x15, 0x0238);
14393         MP_WritePhyUshort(sc, 0x19, 0x31c1);
14394         MP_WritePhyUshort(sc, 0x15, 0x0239);
14395         MP_WritePhyUshort(sc, 0x19, 0x6c00);
14396         MP_WritePhyUshort(sc, 0x15, 0x023a);
14397         MP_WritePhyUshort(sc, 0x19, 0x3261);
14398         MP_WritePhyUshort(sc, 0x15, 0x023b);
14399         MP_WritePhyUshort(sc, 0x19, 0x6c00);
14400         MP_WritePhyUshort(sc, 0x15, 0x023c);
14401         MP_WritePhyUshort(sc, 0x19, 0x3250);
14402         MP_WritePhyUshort(sc, 0x15, 0x023d);
14403         MP_WritePhyUshort(sc, 0x19, 0xb203);
14404         MP_WritePhyUshort(sc, 0x15, 0x023e);
14405         MP_WritePhyUshort(sc, 0x19, 0x6c00);
14406         MP_WritePhyUshort(sc, 0x15, 0x023f);
14407         MP_WritePhyUshort(sc, 0x19, 0x327a);
14408         MP_WritePhyUshort(sc, 0x15, 0x0240);
14409         MP_WritePhyUshort(sc, 0x19, 0x6c00);
14410         MP_WritePhyUshort(sc, 0x15, 0x0241);
14411         MP_WritePhyUshort(sc, 0x19, 0x3293);
14412         MP_WritePhyUshort(sc, 0x15, 0x0242);
14413         MP_WritePhyUshort(sc, 0x19, 0x0000);
14414         MP_WritePhyUshort(sc, 0x15, 0x0243);
14415         MP_WritePhyUshort(sc, 0x19, 0x0000);
14416         MP_WritePhyUshort(sc, 0x15, 0x0244);
14417         MP_WritePhyUshort(sc, 0x19, 0x0000);
14418         MP_WritePhyUshort(sc, 0x15, 0x0245);
14419         MP_WritePhyUshort(sc, 0x19, 0x0000);
14420         MP_WritePhyUshort(sc, 0x15, 0x0246);
14421         MP_WritePhyUshort(sc, 0x19, 0x0000);
14422         MP_WritePhyUshort(sc, 0x15, 0x0247);
14423         MP_WritePhyUshort(sc, 0x19, 0x32a3);
14424         MP_WritePhyUshort(sc, 0x15, 0x0248);
14425         MP_WritePhyUshort(sc, 0x19, 0x5520);
14426         MP_WritePhyUshort(sc, 0x15, 0x0249);
14427         MP_WritePhyUshort(sc, 0x19, 0x403d);
14428         MP_WritePhyUshort(sc, 0x15, 0x024a);
14429         MP_WritePhyUshort(sc, 0x19, 0x440c);
14430         MP_WritePhyUshort(sc, 0x15, 0x024b);
14431         MP_WritePhyUshort(sc, 0x19, 0x4812);
14432         MP_WritePhyUshort(sc, 0x15, 0x024c);
14433         MP_WritePhyUshort(sc, 0x19, 0x5001);
14434         MP_WritePhyUshort(sc, 0x15, 0x024d);
14435         MP_WritePhyUshort(sc, 0x19, 0x4802);
14436         MP_WritePhyUshort(sc, 0x15, 0x024e);
14437         MP_WritePhyUshort(sc, 0x19, 0x6880);
14438         MP_WritePhyUshort(sc, 0x15, 0x024f);
14439         MP_WritePhyUshort(sc, 0x19, 0x31f5);
14440         MP_WritePhyUshort(sc, 0x15, 0x0250);
14441         MP_WritePhyUshort(sc, 0x19, 0xb685);
14442         MP_WritePhyUshort(sc, 0x15, 0x0251);
14443         MP_WritePhyUshort(sc, 0x19, 0x801c);
14444         MP_WritePhyUshort(sc, 0x15, 0x0252);
14445         MP_WritePhyUshort(sc, 0x19, 0xbaf5);
14446         MP_WritePhyUshort(sc, 0x15, 0x0253);
14447         MP_WritePhyUshort(sc, 0x19, 0xc07c);
14448         MP_WritePhyUshort(sc, 0x15, 0x0254);
14449         MP_WritePhyUshort(sc, 0x19, 0x00fb);
14450         MP_WritePhyUshort(sc, 0x15, 0x0255);
14451         MP_WritePhyUshort(sc, 0x19, 0x325a);
14452         MP_WritePhyUshort(sc, 0x15, 0x0256);
14453         MP_WritePhyUshort(sc, 0x19, 0x0000);
14454         MP_WritePhyUshort(sc, 0x15, 0x0257);
14455         MP_WritePhyUshort(sc, 0x19, 0x0000);
14456         MP_WritePhyUshort(sc, 0x15, 0x0258);
14457         MP_WritePhyUshort(sc, 0x19, 0x0000);
14458         MP_WritePhyUshort(sc, 0x15, 0x0259);
14459         MP_WritePhyUshort(sc, 0x19, 0x0000);
14460         MP_WritePhyUshort(sc, 0x15, 0x025a);
14461         MP_WritePhyUshort(sc, 0x19, 0x481a);
14462         MP_WritePhyUshort(sc, 0x15, 0x025b);
14463         MP_WritePhyUshort(sc, 0x19, 0x5001);
14464         MP_WritePhyUshort(sc, 0x15, 0x025c);
14465         MP_WritePhyUshort(sc, 0x19, 0x401b);
14466         MP_WritePhyUshort(sc, 0x15, 0x025d);
14467         MP_WritePhyUshort(sc, 0x19, 0x480a);
14468         MP_WritePhyUshort(sc, 0x15, 0x025e);
14469         MP_WritePhyUshort(sc, 0x19, 0x4418);
14470         MP_WritePhyUshort(sc, 0x15, 0x025f);
14471         MP_WritePhyUshort(sc, 0x19, 0x6900);
14472         MP_WritePhyUshort(sc, 0x15, 0x0260);
14473         MP_WritePhyUshort(sc, 0x19, 0x31f5);
14474         MP_WritePhyUshort(sc, 0x15, 0x0261);
14475         MP_WritePhyUshort(sc, 0x19, 0xb64b);
14476         MP_WritePhyUshort(sc, 0x15, 0x0262);
14477         MP_WritePhyUshort(sc, 0x19, 0xdb00);
14478         MP_WritePhyUshort(sc, 0x15, 0x0263);
14479         MP_WritePhyUshort(sc, 0x19, 0x0048);
14480         MP_WritePhyUshort(sc, 0x15, 0x0264);
14481         MP_WritePhyUshort(sc, 0x19, 0xdb7d);
14482         MP_WritePhyUshort(sc, 0x15, 0x0265);
14483         MP_WritePhyUshort(sc, 0x19, 0x0002);
14484         MP_WritePhyUshort(sc, 0x15, 0x0266);
14485         MP_WritePhyUshort(sc, 0x19, 0xa0fa);
14486         MP_WritePhyUshort(sc, 0x15, 0x0267);
14487         MP_WritePhyUshort(sc, 0x19, 0x4408);
14488         MP_WritePhyUshort(sc, 0x15, 0x0268);
14489         MP_WritePhyUshort(sc, 0x19, 0x3248);
14490         MP_WritePhyUshort(sc, 0x15, 0x0269);
14491         MP_WritePhyUshort(sc, 0x19, 0x0000);
14492         MP_WritePhyUshort(sc, 0x15, 0x026a);
14493         MP_WritePhyUshort(sc, 0x19, 0x0000);
14494         MP_WritePhyUshort(sc, 0x15, 0x026b);
14495         MP_WritePhyUshort(sc, 0x19, 0x0000);
14496         MP_WritePhyUshort(sc, 0x15, 0x026c);
14497         MP_WritePhyUshort(sc, 0x19, 0x0000);
14498         MP_WritePhyUshort(sc, 0x15, 0x026d);
14499         MP_WritePhyUshort(sc, 0x19, 0xb806);
14500         MP_WritePhyUshort(sc, 0x15, 0x026e);
14501         MP_WritePhyUshort(sc, 0x19, 0x588d);
14502         MP_WritePhyUshort(sc, 0x15, 0x026f);
14503         MP_WritePhyUshort(sc, 0x19, 0x5500);
14504         MP_WritePhyUshort(sc, 0x15, 0x0270);
14505         MP_WritePhyUshort(sc, 0x19, 0x7801);
14506         MP_WritePhyUshort(sc, 0x15, 0x0271);
14507         MP_WritePhyUshort(sc, 0x19, 0x4002);
14508         MP_WritePhyUshort(sc, 0x15, 0x0272);
14509         MP_WritePhyUshort(sc, 0x19, 0x7800);
14510         MP_WritePhyUshort(sc, 0x15, 0x0273);
14511         MP_WritePhyUshort(sc, 0x19, 0x4814);
14512         MP_WritePhyUshort(sc, 0x15, 0x0274);
14513         MP_WritePhyUshort(sc, 0x19, 0x500b);
14514         MP_WritePhyUshort(sc, 0x15, 0x0275);
14515         MP_WritePhyUshort(sc, 0x19, 0x4804);
14516         MP_WritePhyUshort(sc, 0x15, 0x0276);
14517         MP_WritePhyUshort(sc, 0x19, 0x40c4);
14518         MP_WritePhyUshort(sc, 0x15, 0x0277);
14519         MP_WritePhyUshort(sc, 0x19, 0x4425);
14520         MP_WritePhyUshort(sc, 0x15, 0x0278);
14521         MP_WritePhyUshort(sc, 0x19, 0x6a00);
14522         MP_WritePhyUshort(sc, 0x15, 0x0279);
14523         MP_WritePhyUshort(sc, 0x19, 0x31f5);
14524         MP_WritePhyUshort(sc, 0x15, 0x027a);
14525         MP_WritePhyUshort(sc, 0x19, 0xb632);
14526         MP_WritePhyUshort(sc, 0x15, 0x027b);
14527         MP_WritePhyUshort(sc, 0x19, 0xdc03);
14528         MP_WritePhyUshort(sc, 0x15, 0x027c);
14529         MP_WritePhyUshort(sc, 0x19, 0x0027);
14530         MP_WritePhyUshort(sc, 0x15, 0x027d);
14531         MP_WritePhyUshort(sc, 0x19, 0x80fc);
14532         MP_WritePhyUshort(sc, 0x15, 0x027e);
14533         MP_WritePhyUshort(sc, 0x19, 0x3283);
14534         MP_WritePhyUshort(sc, 0x15, 0x027f);
14535         MP_WritePhyUshort(sc, 0x19, 0x0000);
14536         MP_WritePhyUshort(sc, 0x15, 0x0280);
14537         MP_WritePhyUshort(sc, 0x19, 0x0000);
14538         MP_WritePhyUshort(sc, 0x15, 0x0281);
14539         MP_WritePhyUshort(sc, 0x19, 0x0000);
14540         MP_WritePhyUshort(sc, 0x15, 0x0282);
14541         MP_WritePhyUshort(sc, 0x19, 0x0000);
14542         MP_WritePhyUshort(sc, 0x15, 0x0283);
14543         MP_WritePhyUshort(sc, 0x19, 0xb806);
14544         MP_WritePhyUshort(sc, 0x15, 0x0284);
14545         MP_WritePhyUshort(sc, 0x19, 0x588f);
14546         MP_WritePhyUshort(sc, 0x15, 0x0285);
14547         MP_WritePhyUshort(sc, 0x19, 0x5520);
14548         MP_WritePhyUshort(sc, 0x15, 0x0286);
14549         MP_WritePhyUshort(sc, 0x19, 0x7801);
14550         MP_WritePhyUshort(sc, 0x15, 0x0287);
14551         MP_WritePhyUshort(sc, 0x19, 0x4000);
14552         MP_WritePhyUshort(sc, 0x15, 0x0288);
14553         MP_WritePhyUshort(sc, 0x19, 0x7800);
14554         MP_WritePhyUshort(sc, 0x15, 0x0289);
14555         MP_WritePhyUshort(sc, 0x19, 0x4818);
14556         MP_WritePhyUshort(sc, 0x15, 0x028a);
14557         MP_WritePhyUshort(sc, 0x19, 0x5051);
14558         MP_WritePhyUshort(sc, 0x15, 0x028b);
14559         MP_WritePhyUshort(sc, 0x19, 0x4808);
14560         MP_WritePhyUshort(sc, 0x15, 0x028c);
14561         MP_WritePhyUshort(sc, 0x19, 0x4050);
14562         MP_WritePhyUshort(sc, 0x15, 0x028d);
14563         MP_WritePhyUshort(sc, 0x19, 0x4462);
14564         MP_WritePhyUshort(sc, 0x15, 0x028e);
14565         MP_WritePhyUshort(sc, 0x19, 0x40c4);
14566         MP_WritePhyUshort(sc, 0x15, 0x028f);
14567         MP_WritePhyUshort(sc, 0x19, 0x4473);
14568         MP_WritePhyUshort(sc, 0x15, 0x0290);
14569         MP_WritePhyUshort(sc, 0x19, 0x5041);
14570         MP_WritePhyUshort(sc, 0x15, 0x0291);
14571         MP_WritePhyUshort(sc, 0x19, 0x6b00);
14572         MP_WritePhyUshort(sc, 0x15, 0x0292);
14573         MP_WritePhyUshort(sc, 0x19, 0x31f5);
14574         MP_WritePhyUshort(sc, 0x15, 0x0293);
14575         MP_WritePhyUshort(sc, 0x19, 0xb619);
14576         MP_WritePhyUshort(sc, 0x15, 0x0294);
14577         MP_WritePhyUshort(sc, 0x19, 0x80d9);
14578         MP_WritePhyUshort(sc, 0x15, 0x0295);
14579         MP_WritePhyUshort(sc, 0x19, 0xbd06);
14580         MP_WritePhyUshort(sc, 0x15, 0x0296);
14581         MP_WritePhyUshort(sc, 0x19, 0xbb0d);
14582         MP_WritePhyUshort(sc, 0x15, 0x0297);
14583         MP_WritePhyUshort(sc, 0x19, 0xaf14);
14584         MP_WritePhyUshort(sc, 0x15, 0x0298);
14585         MP_WritePhyUshort(sc, 0x19, 0x8efa);
14586         MP_WritePhyUshort(sc, 0x15, 0x0299);
14587         MP_WritePhyUshort(sc, 0x19, 0x5049);
14588         MP_WritePhyUshort(sc, 0x15, 0x029a);
14589         MP_WritePhyUshort(sc, 0x19, 0x3248);
14590         MP_WritePhyUshort(sc, 0x15, 0x029b);
14591         MP_WritePhyUshort(sc, 0x19, 0x4c10);
14592         MP_WritePhyUshort(sc, 0x15, 0x029c);
14593         MP_WritePhyUshort(sc, 0x19, 0x44b0);
14594         MP_WritePhyUshort(sc, 0x15, 0x029d);
14595         MP_WritePhyUshort(sc, 0x19, 0x4c00);
14596         MP_WritePhyUshort(sc, 0x15, 0x029e);
14597         MP_WritePhyUshort(sc, 0x19, 0x3292);
14598         MP_WritePhyUshort(sc, 0x15, 0x029f);
14599         MP_WritePhyUshort(sc, 0x19, 0x0000);
14600         MP_WritePhyUshort(sc, 0x15, 0x02a0);
14601         MP_WritePhyUshort(sc, 0x19, 0x0000);
14602         MP_WritePhyUshort(sc, 0x15, 0x02a1);
14603         MP_WritePhyUshort(sc, 0x19, 0x0000);
14604         MP_WritePhyUshort(sc, 0x15, 0x02a2);
14605         MP_WritePhyUshort(sc, 0x19, 0x0000);
14606         MP_WritePhyUshort(sc, 0x15, 0x02a3);
14607         MP_WritePhyUshort(sc, 0x19, 0x481f);
14608         MP_WritePhyUshort(sc, 0x15, 0x02a4);
14609         MP_WritePhyUshort(sc, 0x19, 0x5005);
14610         MP_WritePhyUshort(sc, 0x15, 0x02a5);
14611         MP_WritePhyUshort(sc, 0x19, 0x480f);
14612         MP_WritePhyUshort(sc, 0x15, 0x02a6);
14613         MP_WritePhyUshort(sc, 0x19, 0xac00);
14614         MP_WritePhyUshort(sc, 0x15, 0x02a7);
14615         MP_WritePhyUshort(sc, 0x19, 0x31a6);
14616         MP_WritePhyUshort(sc, 0x15, 0x02a8);
14617         MP_WritePhyUshort(sc, 0x19, 0x0000);
14618         MP_WritePhyUshort(sc, 0x15, 0x02a9);
14619         MP_WritePhyUshort(sc, 0x19, 0x0000);
14620         MP_WritePhyUshort(sc, 0x15, 0x02aa);
14621         MP_WritePhyUshort(sc, 0x19, 0x0000);
14622         MP_WritePhyUshort(sc, 0x15, 0x02ab);
14623         MP_WritePhyUshort(sc, 0x19, 0x31ba);
14624         MP_WritePhyUshort(sc, 0x15, 0x02ac);
14625         MP_WritePhyUshort(sc, 0x19, 0x31d5);
14626         MP_WritePhyUshort(sc, 0x15, 0x02ad);
14627         MP_WritePhyUshort(sc, 0x19, 0x0000);
14628         MP_WritePhyUshort(sc, 0x15, 0x02ae);
14629         MP_WritePhyUshort(sc, 0x19, 0x5cf0);
14630         MP_WritePhyUshort(sc, 0x15, 0x02af);
14631         MP_WritePhyUshort(sc, 0x19, 0x588c);
14632         MP_WritePhyUshort(sc, 0x15, 0x02b0);
14633         MP_WritePhyUshort(sc, 0x19, 0x542f);
14634         MP_WritePhyUshort(sc, 0x15, 0x02b1);
14635         MP_WritePhyUshort(sc, 0x19, 0x7ffb);
14636         MP_WritePhyUshort(sc, 0x15, 0x02b2);
14637         MP_WritePhyUshort(sc, 0x19, 0x6ff8);
14638         MP_WritePhyUshort(sc, 0x15, 0x02b3);
14639         MP_WritePhyUshort(sc, 0x19, 0x64a4);
14640         MP_WritePhyUshort(sc, 0x15, 0x02b4);
14641         MP_WritePhyUshort(sc, 0x19, 0x64a0);
14642         MP_WritePhyUshort(sc, 0x15, 0x02b5);
14643         MP_WritePhyUshort(sc, 0x19, 0x6800);
14644         MP_WritePhyUshort(sc, 0x15, 0x02b6);
14645         MP_WritePhyUshort(sc, 0x19, 0x4400);
14646         MP_WritePhyUshort(sc, 0x15, 0x02b7);
14647         MP_WritePhyUshort(sc, 0x19, 0x4020);
14648         MP_WritePhyUshort(sc, 0x15, 0x02b8);
14649         MP_WritePhyUshort(sc, 0x19, 0x4480);
14650         MP_WritePhyUshort(sc, 0x15, 0x02b9);
14651         MP_WritePhyUshort(sc, 0x19, 0x9e00);
14652         MP_WritePhyUshort(sc, 0x15, 0x02ba);
14653         MP_WritePhyUshort(sc, 0x19, 0x4891);
14654         MP_WritePhyUshort(sc, 0x15, 0x02bb);
14655         MP_WritePhyUshort(sc, 0x19, 0x4cc0);
14656         MP_WritePhyUshort(sc, 0x15, 0x02bc);
14657         MP_WritePhyUshort(sc, 0x19, 0x4801);
14658         MP_WritePhyUshort(sc, 0x15, 0x02bd);
14659         MP_WritePhyUshort(sc, 0x19, 0xa609);
14660         MP_WritePhyUshort(sc, 0x15, 0x02be);
14661         MP_WritePhyUshort(sc, 0x19, 0xd64f);
14662         MP_WritePhyUshort(sc, 0x15, 0x02bf);
14663         MP_WritePhyUshort(sc, 0x19, 0x004e);
14664         MP_WritePhyUshort(sc, 0x15, 0x02c0);
14665         MP_WritePhyUshort(sc, 0x19, 0x87fe);
14666         MP_WritePhyUshort(sc, 0x15, 0x02c1);
14667         MP_WritePhyUshort(sc, 0x19, 0x32c6);
14668         MP_WritePhyUshort(sc, 0x15, 0x02c2);
14669         MP_WritePhyUshort(sc, 0x19, 0x0000);
14670         MP_WritePhyUshort(sc, 0x15, 0x02c3);
14671         MP_WritePhyUshort(sc, 0x19, 0x0000);
14672         MP_WritePhyUshort(sc, 0x15, 0x02c4);
14673         MP_WritePhyUshort(sc, 0x19, 0x0000);
14674         MP_WritePhyUshort(sc, 0x15, 0x02c5);
14675         MP_WritePhyUshort(sc, 0x19, 0x0000);
14676         MP_WritePhyUshort(sc, 0x15, 0x02c6);
14677         MP_WritePhyUshort(sc, 0x19, 0x48b2);
14678         MP_WritePhyUshort(sc, 0x15, 0x02c7);
14679         MP_WritePhyUshort(sc, 0x19, 0x4020);
14680         MP_WritePhyUshort(sc, 0x15, 0x02c8);
14681         MP_WritePhyUshort(sc, 0x19, 0x4822);
14682         MP_WritePhyUshort(sc, 0x15, 0x02c9);
14683         MP_WritePhyUshort(sc, 0x19, 0x4488);
14684         MP_WritePhyUshort(sc, 0x15, 0x02ca);
14685         MP_WritePhyUshort(sc, 0x19, 0xd64f);
14686         MP_WritePhyUshort(sc, 0x15, 0x02cb);
14687         MP_WritePhyUshort(sc, 0x19, 0x0042);
14688         MP_WritePhyUshort(sc, 0x15, 0x02cc);
14689         MP_WritePhyUshort(sc, 0x19, 0x8203);
14690         MP_WritePhyUshort(sc, 0x15, 0x02cd);
14691         MP_WritePhyUshort(sc, 0x19, 0x4cc8);
14692         MP_WritePhyUshort(sc, 0x15, 0x02ce);
14693         MP_WritePhyUshort(sc, 0x19, 0x32d0);
14694         MP_WritePhyUshort(sc, 0x15, 0x02cf);
14695         MP_WritePhyUshort(sc, 0x19, 0x4cc0);
14696         MP_WritePhyUshort(sc, 0x15, 0x02d0);
14697         MP_WritePhyUshort(sc, 0x19, 0xc4d4);
14698         MP_WritePhyUshort(sc, 0x15, 0x02d1);
14699         MP_WritePhyUshort(sc, 0x19, 0x00f9);
14700         MP_WritePhyUshort(sc, 0x15, 0x02d2);
14701         MP_WritePhyUshort(sc, 0x19, 0xa51a);
14702         MP_WritePhyUshort(sc, 0x15, 0x02d3);
14703         MP_WritePhyUshort(sc, 0x19, 0x32d9);
14704         MP_WritePhyUshort(sc, 0x15, 0x02d4);
14705         MP_WritePhyUshort(sc, 0x19, 0x0000);
14706         MP_WritePhyUshort(sc, 0x15, 0x02d5);
14707         MP_WritePhyUshort(sc, 0x19, 0x0000);
14708         MP_WritePhyUshort(sc, 0x15, 0x02d6);
14709         MP_WritePhyUshort(sc, 0x19, 0x0000);
14710         MP_WritePhyUshort(sc, 0x15, 0x02d7);
14711         MP_WritePhyUshort(sc, 0x19, 0x0000);
14712         MP_WritePhyUshort(sc, 0x15, 0x02d8);
14713         MP_WritePhyUshort(sc, 0x19, 0x0000);
14714         MP_WritePhyUshort(sc, 0x15, 0x02d9);
14715         MP_WritePhyUshort(sc, 0x19, 0x48b3);
14716         MP_WritePhyUshort(sc, 0x15, 0x02da);
14717         MP_WritePhyUshort(sc, 0x19, 0x4020);
14718         MP_WritePhyUshort(sc, 0x15, 0x02db);
14719         MP_WritePhyUshort(sc, 0x19, 0x4823);
14720         MP_WritePhyUshort(sc, 0x15, 0x02dc);
14721         MP_WritePhyUshort(sc, 0x19, 0x4410);
14722         MP_WritePhyUshort(sc, 0x15, 0x02dd);
14723         MP_WritePhyUshort(sc, 0x19, 0xb630);
14724         MP_WritePhyUshort(sc, 0x15, 0x02de);
14725         MP_WritePhyUshort(sc, 0x19, 0x7dc8);
14726         MP_WritePhyUshort(sc, 0x15, 0x02df);
14727         MP_WritePhyUshort(sc, 0x19, 0x8203);
14728         MP_WritePhyUshort(sc, 0x15, 0x02e0);
14729         MP_WritePhyUshort(sc, 0x19, 0x4c48);
14730         MP_WritePhyUshort(sc, 0x15, 0x02e1);
14731         MP_WritePhyUshort(sc, 0x19, 0x32e3);
14732         MP_WritePhyUshort(sc, 0x15, 0x02e2);
14733         MP_WritePhyUshort(sc, 0x19, 0x4c40);
14734         MP_WritePhyUshort(sc, 0x15, 0x02e3);
14735         MP_WritePhyUshort(sc, 0x19, 0x9bfa);
14736         MP_WritePhyUshort(sc, 0x15, 0x02e4);
14737         MP_WritePhyUshort(sc, 0x19, 0x84ca);
14738         MP_WritePhyUshort(sc, 0x15, 0x02e5);
14739         MP_WritePhyUshort(sc, 0x19, 0x85f8);
14740         MP_WritePhyUshort(sc, 0x15, 0x02e6);
14741         MP_WritePhyUshort(sc, 0x19, 0x32ec);
14742         MP_WritePhyUshort(sc, 0x15, 0x02e7);
14743         MP_WritePhyUshort(sc, 0x19, 0x0000);
14744         MP_WritePhyUshort(sc, 0x15, 0x02e8);
14745         MP_WritePhyUshort(sc, 0x19, 0x0000);
14746         MP_WritePhyUshort(sc, 0x15, 0x02e9);
14747         MP_WritePhyUshort(sc, 0x19, 0x0000);
14748         MP_WritePhyUshort(sc, 0x15, 0x02ea);
14749         MP_WritePhyUshort(sc, 0x19, 0x0000);
14750         MP_WritePhyUshort(sc, 0x15, 0x02eb);
14751         MP_WritePhyUshort(sc, 0x19, 0x0000);
14752         MP_WritePhyUshort(sc, 0x15, 0x02ec);
14753         MP_WritePhyUshort(sc, 0x19, 0x48d4);
14754         MP_WritePhyUshort(sc, 0x15, 0x02ed);
14755         MP_WritePhyUshort(sc, 0x19, 0x4020);
14756         MP_WritePhyUshort(sc, 0x15, 0x02ee);
14757         MP_WritePhyUshort(sc, 0x19, 0x4844);
14758         MP_WritePhyUshort(sc, 0x15, 0x02ef);
14759         MP_WritePhyUshort(sc, 0x19, 0x4420);
14760         MP_WritePhyUshort(sc, 0x15, 0x02f0);
14761         MP_WritePhyUshort(sc, 0x19, 0x6800);
14762         MP_WritePhyUshort(sc, 0x15, 0x02f1);
14763         MP_WritePhyUshort(sc, 0x19, 0x7dc0);
14764         MP_WritePhyUshort(sc, 0x15, 0x02f2);
14765         MP_WritePhyUshort(sc, 0x19, 0x4c40);
14766         MP_WritePhyUshort(sc, 0x15, 0x02f3);
14767         MP_WritePhyUshort(sc, 0x19, 0x7c0b);
14768         MP_WritePhyUshort(sc, 0x15, 0x02f4);
14769         MP_WritePhyUshort(sc, 0x19, 0x6c08);
14770         MP_WritePhyUshort(sc, 0x15, 0x02f5);
14771         MP_WritePhyUshort(sc, 0x19, 0x3311);
14772         MP_WritePhyUshort(sc, 0x15, 0x02f6);
14773         MP_WritePhyUshort(sc, 0x19, 0x9cfd);
14774         MP_WritePhyUshort(sc, 0x15, 0x02f7);
14775         MP_WritePhyUshort(sc, 0x19, 0xb616);
14776         MP_WritePhyUshort(sc, 0x15, 0x02f8);
14777         MP_WritePhyUshort(sc, 0x19, 0xc42b);
14778         MP_WritePhyUshort(sc, 0x15, 0x02f9);
14779         MP_WritePhyUshort(sc, 0x19, 0x00e0);
14780         MP_WritePhyUshort(sc, 0x15, 0x02fa);
14781         MP_WritePhyUshort(sc, 0x19, 0xc455);
14782         MP_WritePhyUshort(sc, 0x15, 0x02fb);
14783         MP_WritePhyUshort(sc, 0x19, 0x00b3);
14784         MP_WritePhyUshort(sc, 0x15, 0x02fc);
14785         MP_WritePhyUshort(sc, 0x19, 0xb20a);
14786         MP_WritePhyUshort(sc, 0x15, 0x02fd);
14787         MP_WritePhyUshort(sc, 0x19, 0x7c03);
14788         MP_WritePhyUshort(sc, 0x15, 0x02fe);
14789         MP_WritePhyUshort(sc, 0x19, 0x6c02);
14790         MP_WritePhyUshort(sc, 0x15, 0x02ff);
14791         MP_WritePhyUshort(sc, 0x19, 0x8204);
14792         MP_WritePhyUshort(sc, 0x15, 0x0300);
14793         MP_WritePhyUshort(sc, 0x19, 0x7c04);
14794         MP_WritePhyUshort(sc, 0x15, 0x0301);
14795         MP_WritePhyUshort(sc, 0x19, 0x7404);
14796         MP_WritePhyUshort(sc, 0x15, 0x0302);
14797         MP_WritePhyUshort(sc, 0x19, 0x32f3);
14798         MP_WritePhyUshort(sc, 0x15, 0x0303);
14799         MP_WritePhyUshort(sc, 0x19, 0x7c04);
14800         MP_WritePhyUshort(sc, 0x15, 0x0304);
14801         MP_WritePhyUshort(sc, 0x19, 0x7400);
14802         MP_WritePhyUshort(sc, 0x15, 0x0305);
14803         MP_WritePhyUshort(sc, 0x19, 0x32f3);
14804         MP_WritePhyUshort(sc, 0x15, 0x0306);
14805         MP_WritePhyUshort(sc, 0x19, 0xefed);
14806         MP_WritePhyUshort(sc, 0x15, 0x0307);
14807         MP_WritePhyUshort(sc, 0x19, 0x3342);
14808         MP_WritePhyUshort(sc, 0x15, 0x0308);
14809         MP_WritePhyUshort(sc, 0x19, 0x0000);
14810         MP_WritePhyUshort(sc, 0x15, 0x0309);
14811         MP_WritePhyUshort(sc, 0x19, 0x0000);
14812         MP_WritePhyUshort(sc, 0x15, 0x030a);
14813         MP_WritePhyUshort(sc, 0x19, 0x0000);
14814         MP_WritePhyUshort(sc, 0x15, 0x030b);
14815         MP_WritePhyUshort(sc, 0x19, 0x0000);
14816         MP_WritePhyUshort(sc, 0x15, 0x030c);
14817         MP_WritePhyUshort(sc, 0x19, 0x0000);
14818         MP_WritePhyUshort(sc, 0x15, 0x030d);
14819         MP_WritePhyUshort(sc, 0x19, 0x3006);
14820         MP_WritePhyUshort(sc, 0x15, 0x030e);
14821         MP_WritePhyUshort(sc, 0x19, 0x0000);
14822         MP_WritePhyUshort(sc, 0x15, 0x030f);
14823         MP_WritePhyUshort(sc, 0x19, 0x0000);
14824         MP_WritePhyUshort(sc, 0x15, 0x0310);
14825         MP_WritePhyUshort(sc, 0x19, 0x0000);
14826         MP_WritePhyUshort(sc, 0x15, 0x0311);
14827         MP_WritePhyUshort(sc, 0x19, 0x7c08);
14828         MP_WritePhyUshort(sc, 0x15, 0x0312);
14829         MP_WritePhyUshort(sc, 0x19, 0xa207);
14830         MP_WritePhyUshort(sc, 0x15, 0x0313);
14831         MP_WritePhyUshort(sc, 0x19, 0x4c00);
14832         MP_WritePhyUshort(sc, 0x15, 0x0314);
14833         MP_WritePhyUshort(sc, 0x19, 0x3322);
14834         MP_WritePhyUshort(sc, 0x15, 0x0315);
14835         MP_WritePhyUshort(sc, 0x19, 0x4041);
14836         MP_WritePhyUshort(sc, 0x15, 0x0316);
14837         MP_WritePhyUshort(sc, 0x19, 0x7d07);
14838         MP_WritePhyUshort(sc, 0x15, 0x0317);
14839         MP_WritePhyUshort(sc, 0x19, 0x4502);
14840         MP_WritePhyUshort(sc, 0x15, 0x0318);
14841         MP_WritePhyUshort(sc, 0x19, 0x3322);
14842         MP_WritePhyUshort(sc, 0x15, 0x0319);
14843         MP_WritePhyUshort(sc, 0x19, 0x4c08);
14844         MP_WritePhyUshort(sc, 0x15, 0x031a);
14845         MP_WritePhyUshort(sc, 0x19, 0x3322);
14846         MP_WritePhyUshort(sc, 0x15, 0x031b);
14847         MP_WritePhyUshort(sc, 0x19, 0x7d80);
14848         MP_WritePhyUshort(sc, 0x15, 0x031c);
14849         MP_WritePhyUshort(sc, 0x19, 0x5180);
14850         MP_WritePhyUshort(sc, 0x15, 0x031d);
14851         MP_WritePhyUshort(sc, 0x19, 0x3320);
14852         MP_WritePhyUshort(sc, 0x15, 0x031e);
14853         MP_WritePhyUshort(sc, 0x19, 0x7d80);
14854         MP_WritePhyUshort(sc, 0x15, 0x031f);
14855         MP_WritePhyUshort(sc, 0x19, 0x5000);
14856         MP_WritePhyUshort(sc, 0x15, 0x0320);
14857         MP_WritePhyUshort(sc, 0x19, 0x7d07);
14858         MP_WritePhyUshort(sc, 0x15, 0x0321);
14859         MP_WritePhyUshort(sc, 0x19, 0x4402);
14860         MP_WritePhyUshort(sc, 0x15, 0x0322);
14861         MP_WritePhyUshort(sc, 0x19, 0x7c03);
14862         MP_WritePhyUshort(sc, 0x15, 0x0323);
14863         MP_WritePhyUshort(sc, 0x19, 0x6c02);
14864         MP_WritePhyUshort(sc, 0x15, 0x0324);
14865         MP_WritePhyUshort(sc, 0x19, 0x7c03);
14866         MP_WritePhyUshort(sc, 0x15, 0x0325);
14867         MP_WritePhyUshort(sc, 0x19, 0xb30c);
14868         MP_WritePhyUshort(sc, 0x15, 0x0326);
14869         MP_WritePhyUshort(sc, 0x19, 0xb206);
14870         MP_WritePhyUshort(sc, 0x15, 0x0327);
14871         MP_WritePhyUshort(sc, 0x19, 0xb103);
14872         MP_WritePhyUshort(sc, 0x15, 0x0328);
14873         MP_WritePhyUshort(sc, 0x19, 0x6c00);
14874         MP_WritePhyUshort(sc, 0x15, 0x0329);
14875         MP_WritePhyUshort(sc, 0x19, 0x32f6);
14876         MP_WritePhyUshort(sc, 0x15, 0x032a);
14877         MP_WritePhyUshort(sc, 0x19, 0x6c00);
14878         MP_WritePhyUshort(sc, 0x15, 0x032b);
14879         MP_WritePhyUshort(sc, 0x19, 0x3352);
14880         MP_WritePhyUshort(sc, 0x15, 0x032c);
14881         MP_WritePhyUshort(sc, 0x19, 0xb103);
14882         MP_WritePhyUshort(sc, 0x15, 0x032d);
14883         MP_WritePhyUshort(sc, 0x19, 0x6c00);
14884         MP_WritePhyUshort(sc, 0x15, 0x032e);
14885         MP_WritePhyUshort(sc, 0x19, 0x336a);
14886         MP_WritePhyUshort(sc, 0x15, 0x032f);
14887         MP_WritePhyUshort(sc, 0x19, 0x6c00);
14888         MP_WritePhyUshort(sc, 0x15, 0x0330);
14889         MP_WritePhyUshort(sc, 0x19, 0x3382);
14890         MP_WritePhyUshort(sc, 0x15, 0x0331);
14891         MP_WritePhyUshort(sc, 0x19, 0xb206);
14892         MP_WritePhyUshort(sc, 0x15, 0x0332);
14893         MP_WritePhyUshort(sc, 0x19, 0xb103);
14894         MP_WritePhyUshort(sc, 0x15, 0x0333);
14895         MP_WritePhyUshort(sc, 0x19, 0x6c00);
14896         MP_WritePhyUshort(sc, 0x15, 0x0334);
14897         MP_WritePhyUshort(sc, 0x19, 0x3395);
14898         MP_WritePhyUshort(sc, 0x15, 0x0335);
14899         MP_WritePhyUshort(sc, 0x19, 0x6c00);
14900         MP_WritePhyUshort(sc, 0x15, 0x0336);
14901         MP_WritePhyUshort(sc, 0x19, 0x33c6);
14902         MP_WritePhyUshort(sc, 0x15, 0x0337);
14903         MP_WritePhyUshort(sc, 0x19, 0xb103);
14904         MP_WritePhyUshort(sc, 0x15, 0x0338);
14905         MP_WritePhyUshort(sc, 0x19, 0x6c00);
14906         MP_WritePhyUshort(sc, 0x15, 0x0339);
14907         MP_WritePhyUshort(sc, 0x19, 0x33d7);
14908         MP_WritePhyUshort(sc, 0x15, 0x033a);
14909         MP_WritePhyUshort(sc, 0x19, 0x6c00);
14910         MP_WritePhyUshort(sc, 0x15, 0x033b);
14911         MP_WritePhyUshort(sc, 0x19, 0x33f2);
14912         MP_WritePhyUshort(sc, 0x15, 0x033c);
14913         MP_WritePhyUshort(sc, 0x19, 0x0000);
14914         MP_WritePhyUshort(sc, 0x15, 0x033d);
14915         MP_WritePhyUshort(sc, 0x19, 0x0000);
14916         MP_WritePhyUshort(sc, 0x15, 0x033e);
14917         MP_WritePhyUshort(sc, 0x19, 0x0000);
14918         MP_WritePhyUshort(sc, 0x15, 0x033f);
14919         MP_WritePhyUshort(sc, 0x19, 0x0000);
14920         MP_WritePhyUshort(sc, 0x15, 0x0340);
14921         MP_WritePhyUshort(sc, 0x19, 0x0000);
14922         MP_WritePhyUshort(sc, 0x15, 0x0341);
14923         MP_WritePhyUshort(sc, 0x19, 0x0000);
14924         MP_WritePhyUshort(sc, 0x15, 0x0342);
14925         MP_WritePhyUshort(sc, 0x19, 0x49b5);
14926         MP_WritePhyUshort(sc, 0x15, 0x0343);
14927         MP_WritePhyUshort(sc, 0x19, 0x7d00);
14928         MP_WritePhyUshort(sc, 0x15, 0x0344);
14929         MP_WritePhyUshort(sc, 0x19, 0x4d00);
14930         MP_WritePhyUshort(sc, 0x15, 0x0345);
14931         MP_WritePhyUshort(sc, 0x19, 0x6880);
14932         MP_WritePhyUshort(sc, 0x15, 0x0346);
14933         MP_WritePhyUshort(sc, 0x19, 0x7c08);
14934         MP_WritePhyUshort(sc, 0x15, 0x0347);
14935         MP_WritePhyUshort(sc, 0x19, 0x6c08);
14936         MP_WritePhyUshort(sc, 0x15, 0x0348);
14937         MP_WritePhyUshort(sc, 0x19, 0x4925);
14938         MP_WritePhyUshort(sc, 0x15, 0x0349);
14939         MP_WritePhyUshort(sc, 0x19, 0x403b);
14940         MP_WritePhyUshort(sc, 0x15, 0x034a);
14941         MP_WritePhyUshort(sc, 0x19, 0xa602);
14942         MP_WritePhyUshort(sc, 0x15, 0x034b);
14943         MP_WritePhyUshort(sc, 0x19, 0x402f);
14944         MP_WritePhyUshort(sc, 0x15, 0x034c);
14945         MP_WritePhyUshort(sc, 0x19, 0x4484);
14946         MP_WritePhyUshort(sc, 0x15, 0x034d);
14947         MP_WritePhyUshort(sc, 0x19, 0x40c8);
14948         MP_WritePhyUshort(sc, 0x15, 0x034e);
14949         MP_WritePhyUshort(sc, 0x19, 0x44c4);
14950         MP_WritePhyUshort(sc, 0x15, 0x034f);
14951         MP_WritePhyUshort(sc, 0x19, 0xd64f);
14952         MP_WritePhyUshort(sc, 0x15, 0x0350);
14953         MP_WritePhyUshort(sc, 0x19, 0x00bd);
14954         MP_WritePhyUshort(sc, 0x15, 0x0351);
14955         MP_WritePhyUshort(sc, 0x19, 0x3311);
14956         MP_WritePhyUshort(sc, 0x15, 0x0352);
14957         MP_WritePhyUshort(sc, 0x19, 0xc8ed);
14958         MP_WritePhyUshort(sc, 0x15, 0x0353);
14959         MP_WritePhyUshort(sc, 0x19, 0x00fc);
14960         MP_WritePhyUshort(sc, 0x15, 0x0354);
14961         MP_WritePhyUshort(sc, 0x19, 0x8221);
14962         MP_WritePhyUshort(sc, 0x15, 0x0355);
14963         MP_WritePhyUshort(sc, 0x19, 0xd11d);
14964         MP_WritePhyUshort(sc, 0x15, 0x0356);
14965         MP_WritePhyUshort(sc, 0x19, 0x001f);
14966         MP_WritePhyUshort(sc, 0x15, 0x0357);
14967         MP_WritePhyUshort(sc, 0x19, 0xde18);
14968         MP_WritePhyUshort(sc, 0x15, 0x0358);
14969         MP_WritePhyUshort(sc, 0x19, 0x0008);
14970         MP_WritePhyUshort(sc, 0x15, 0x0359);
14971         MP_WritePhyUshort(sc, 0x19, 0x91f6);
14972         MP_WritePhyUshort(sc, 0x15, 0x035a);
14973         MP_WritePhyUshort(sc, 0x19, 0x3360);
14974         MP_WritePhyUshort(sc, 0x15, 0x035b);
14975         MP_WritePhyUshort(sc, 0x19, 0x0000);
14976         MP_WritePhyUshort(sc, 0x15, 0x035c);
14977         MP_WritePhyUshort(sc, 0x19, 0x0000);
14978         MP_WritePhyUshort(sc, 0x15, 0x035d);
14979         MP_WritePhyUshort(sc, 0x19, 0x0000);
14980         MP_WritePhyUshort(sc, 0x15, 0x035e);
14981         MP_WritePhyUshort(sc, 0x19, 0x0000);
14982         MP_WritePhyUshort(sc, 0x15, 0x035f);
14983         MP_WritePhyUshort(sc, 0x19, 0x0000);
14984         MP_WritePhyUshort(sc, 0x15, 0x0360);
14985         MP_WritePhyUshort(sc, 0x19, 0x4bb6);
14986         MP_WritePhyUshort(sc, 0x15, 0x0361);
14987         MP_WritePhyUshort(sc, 0x19, 0x4064);
14988         MP_WritePhyUshort(sc, 0x15, 0x0362);
14989         MP_WritePhyUshort(sc, 0x19, 0x4b26);
14990         MP_WritePhyUshort(sc, 0x15, 0x0363);
14991         MP_WritePhyUshort(sc, 0x19, 0x4410);
14992         MP_WritePhyUshort(sc, 0x15, 0x0364);
14993         MP_WritePhyUshort(sc, 0x19, 0x4006);
14994         MP_WritePhyUshort(sc, 0x15, 0x0365);
14995         MP_WritePhyUshort(sc, 0x19, 0x4490);
14996         MP_WritePhyUshort(sc, 0x15, 0x0366);
14997         MP_WritePhyUshort(sc, 0x19, 0x6900);
14998         MP_WritePhyUshort(sc, 0x15, 0x0367);
14999         MP_WritePhyUshort(sc, 0x19, 0xb6a6);
15000         MP_WritePhyUshort(sc, 0x15, 0x0368);
15001         MP_WritePhyUshort(sc, 0x19, 0x9e02);
15002         MP_WritePhyUshort(sc, 0x15, 0x0369);
15003         MP_WritePhyUshort(sc, 0x19, 0x3311);
15004         MP_WritePhyUshort(sc, 0x15, 0x036a);
15005         MP_WritePhyUshort(sc, 0x19, 0xd11d);
15006         MP_WritePhyUshort(sc, 0x15, 0x036b);
15007         MP_WritePhyUshort(sc, 0x19, 0x000a);
15008         MP_WritePhyUshort(sc, 0x15, 0x036c);
15009         MP_WritePhyUshort(sc, 0x19, 0xbb0f);
15010         MP_WritePhyUshort(sc, 0x15, 0x036d);
15011         MP_WritePhyUshort(sc, 0x19, 0x8102);
15012         MP_WritePhyUshort(sc, 0x15, 0x036e);
15013         MP_WritePhyUshort(sc, 0x19, 0x3371);
15014         MP_WritePhyUshort(sc, 0x15, 0x036f);
15015         MP_WritePhyUshort(sc, 0x19, 0xa21e);
15016         MP_WritePhyUshort(sc, 0x15, 0x0370);
15017         MP_WritePhyUshort(sc, 0x19, 0x33b6);
15018         MP_WritePhyUshort(sc, 0x15, 0x0371);
15019         MP_WritePhyUshort(sc, 0x19, 0x91f6);
15020         MP_WritePhyUshort(sc, 0x15, 0x0372);
15021         MP_WritePhyUshort(sc, 0x19, 0xc218);
15022         MP_WritePhyUshort(sc, 0x15, 0x0373);
15023         MP_WritePhyUshort(sc, 0x19, 0x00f4);
15024         MP_WritePhyUshort(sc, 0x15, 0x0374);
15025         MP_WritePhyUshort(sc, 0x19, 0x33b6);
15026         MP_WritePhyUshort(sc, 0x15, 0x0375);
15027         MP_WritePhyUshort(sc, 0x19, 0x32ec);
15028         MP_WritePhyUshort(sc, 0x15, 0x0376);
15029         MP_WritePhyUshort(sc, 0x19, 0x0000);
15030         MP_WritePhyUshort(sc, 0x15, 0x0377);
15031         MP_WritePhyUshort(sc, 0x19, 0x0000);
15032         MP_WritePhyUshort(sc, 0x15, 0x0378);
15033         MP_WritePhyUshort(sc, 0x19, 0x0000);
15034         MP_WritePhyUshort(sc, 0x15, 0x0379);
15035         MP_WritePhyUshort(sc, 0x19, 0x0000);
15036         MP_WritePhyUshort(sc, 0x15, 0x037a);
15037         MP_WritePhyUshort(sc, 0x19, 0x0000);
15038         MP_WritePhyUshort(sc, 0x15, 0x037b);
15039         MP_WritePhyUshort(sc, 0x19, 0x4b97);
15040         MP_WritePhyUshort(sc, 0x15, 0x037c);
15041         MP_WritePhyUshort(sc, 0x19, 0x402b);
15042         MP_WritePhyUshort(sc, 0x15, 0x037d);
15043         MP_WritePhyUshort(sc, 0x19, 0x4b07);
15044         MP_WritePhyUshort(sc, 0x15, 0x037e);
15045         MP_WritePhyUshort(sc, 0x19, 0x4422);
15046         MP_WritePhyUshort(sc, 0x15, 0x037f);
15047         MP_WritePhyUshort(sc, 0x19, 0x6980);
15048         MP_WritePhyUshort(sc, 0x15, 0x0380);
15049         MP_WritePhyUshort(sc, 0x19, 0xb608);
15050         MP_WritePhyUshort(sc, 0x15, 0x0381);
15051         MP_WritePhyUshort(sc, 0x19, 0x3311);
15052         MP_WritePhyUshort(sc, 0x15, 0x0382);
15053         MP_WritePhyUshort(sc, 0x19, 0xbc05);
15054         MP_WritePhyUshort(sc, 0x15, 0x0383);
15055         MP_WritePhyUshort(sc, 0x19, 0xc21c);
15056         MP_WritePhyUshort(sc, 0x15, 0x0384);
15057         MP_WritePhyUshort(sc, 0x19, 0x0032);
15058         MP_WritePhyUshort(sc, 0x15, 0x0385);
15059         MP_WritePhyUshort(sc, 0x19, 0xa1fb);
15060         MP_WritePhyUshort(sc, 0x15, 0x0386);
15061         MP_WritePhyUshort(sc, 0x19, 0x338d);
15062         MP_WritePhyUshort(sc, 0x15, 0x0387);
15063         MP_WritePhyUshort(sc, 0x19, 0x32ae);
15064         MP_WritePhyUshort(sc, 0x15, 0x0388);
15065         MP_WritePhyUshort(sc, 0x19, 0x330d);
15066         MP_WritePhyUshort(sc, 0x15, 0x0389);
15067         MP_WritePhyUshort(sc, 0x19, 0x0000);
15068         MP_WritePhyUshort(sc, 0x15, 0x038a);
15069         MP_WritePhyUshort(sc, 0x19, 0x0000);
15070         MP_WritePhyUshort(sc, 0x15, 0x038b);
15071         MP_WritePhyUshort(sc, 0x19, 0x0000);
15072         MP_WritePhyUshort(sc, 0x15, 0x038c);
15073         MP_WritePhyUshort(sc, 0x19, 0x0000);
15074         MP_WritePhyUshort(sc, 0x15, 0x038d);
15075         MP_WritePhyUshort(sc, 0x19, 0x4b97);
15076         MP_WritePhyUshort(sc, 0x15, 0x038e);
15077         MP_WritePhyUshort(sc, 0x19, 0x6a08);
15078         MP_WritePhyUshort(sc, 0x15, 0x038f);
15079         MP_WritePhyUshort(sc, 0x19, 0x4b07);
15080         MP_WritePhyUshort(sc, 0x15, 0x0390);
15081         MP_WritePhyUshort(sc, 0x19, 0x40ac);
15082         MP_WritePhyUshort(sc, 0x15, 0x0391);
15083         MP_WritePhyUshort(sc, 0x19, 0x4445);
15084         MP_WritePhyUshort(sc, 0x15, 0x0392);
15085         MP_WritePhyUshort(sc, 0x19, 0x404e);
15086         MP_WritePhyUshort(sc, 0x15, 0x0393);
15087         MP_WritePhyUshort(sc, 0x19, 0x4461);
15088         MP_WritePhyUshort(sc, 0x15, 0x0394);
15089         MP_WritePhyUshort(sc, 0x19, 0x3311);
15090         MP_WritePhyUshort(sc, 0x15, 0x0395);
15091         MP_WritePhyUshort(sc, 0x19, 0x9c0a);
15092         MP_WritePhyUshort(sc, 0x15, 0x0396);
15093         MP_WritePhyUshort(sc, 0x19, 0x63da);
15094         MP_WritePhyUshort(sc, 0x15, 0x0397);
15095         MP_WritePhyUshort(sc, 0x19, 0x6f0c);
15096         MP_WritePhyUshort(sc, 0x15, 0x0398);
15097         MP_WritePhyUshort(sc, 0x19, 0x5440);
15098         MP_WritePhyUshort(sc, 0x15, 0x0399);
15099         MP_WritePhyUshort(sc, 0x19, 0x4b98);
15100         MP_WritePhyUshort(sc, 0x15, 0x039a);
15101         MP_WritePhyUshort(sc, 0x19, 0x7c40);
15102         MP_WritePhyUshort(sc, 0x15, 0x039b);
15103         MP_WritePhyUshort(sc, 0x19, 0x4c00);
15104         MP_WritePhyUshort(sc, 0x15, 0x039c);
15105         MP_WritePhyUshort(sc, 0x19, 0x4b08);
15106         MP_WritePhyUshort(sc, 0x15, 0x039d);
15107         MP_WritePhyUshort(sc, 0x19, 0x63d8);
15108         MP_WritePhyUshort(sc, 0x15, 0x039e);
15109         MP_WritePhyUshort(sc, 0x19, 0x33a5);
15110         MP_WritePhyUshort(sc, 0x15, 0x039f);
15111         MP_WritePhyUshort(sc, 0x19, 0xd64f);
15112         MP_WritePhyUshort(sc, 0x15, 0x03a0);
15113         MP_WritePhyUshort(sc, 0x19, 0x00e8);
15114         MP_WritePhyUshort(sc, 0x15, 0x03a1);
15115         MP_WritePhyUshort(sc, 0x19, 0x820e);
15116         MP_WritePhyUshort(sc, 0x15, 0x03a2);
15117         MP_WritePhyUshort(sc, 0x19, 0xa10d);
15118         MP_WritePhyUshort(sc, 0x15, 0x03a3);
15119         MP_WritePhyUshort(sc, 0x19, 0x9df1);
15120         MP_WritePhyUshort(sc, 0x15, 0x03a4);
15121         MP_WritePhyUshort(sc, 0x19, 0x33af);
15122         MP_WritePhyUshort(sc, 0x15, 0x03a5);
15123         MP_WritePhyUshort(sc, 0x19, 0xd64f);
15124         MP_WritePhyUshort(sc, 0x15, 0x03a6);
15125         MP_WritePhyUshort(sc, 0x19, 0x00f9);
15126         MP_WritePhyUshort(sc, 0x15, 0x03a7);
15127         MP_WritePhyUshort(sc, 0x19, 0xc017);
15128         MP_WritePhyUshort(sc, 0x15, 0x03a8);
15129         MP_WritePhyUshort(sc, 0x19, 0x0007);
15130         MP_WritePhyUshort(sc, 0x15, 0x03a9);
15131         MP_WritePhyUshort(sc, 0x19, 0x7c03);
15132         MP_WritePhyUshort(sc, 0x15, 0x03aa);
15133         MP_WritePhyUshort(sc, 0x19, 0x6c03);
15134         MP_WritePhyUshort(sc, 0x15, 0x03ab);
15135         MP_WritePhyUshort(sc, 0x19, 0xa104);
15136         MP_WritePhyUshort(sc, 0x15, 0x03ac);
15137         MP_WritePhyUshort(sc, 0x19, 0x7c03);
15138         MP_WritePhyUshort(sc, 0x15, 0x03ad);
15139         MP_WritePhyUshort(sc, 0x19, 0x6c00);
15140         MP_WritePhyUshort(sc, 0x15, 0x03ae);
15141         MP_WritePhyUshort(sc, 0x19, 0x9df7);
15142         MP_WritePhyUshort(sc, 0x15, 0x03af);
15143         MP_WritePhyUshort(sc, 0x19, 0x7c03);
15144         MP_WritePhyUshort(sc, 0x15, 0x03b0);
15145         MP_WritePhyUshort(sc, 0x19, 0x6c08);
15146         MP_WritePhyUshort(sc, 0x15, 0x03b1);
15147         MP_WritePhyUshort(sc, 0x19, 0x33b6);
15148         MP_WritePhyUshort(sc, 0x15, 0x03b2);
15149         MP_WritePhyUshort(sc, 0x19, 0x0000);
15150         MP_WritePhyUshort(sc, 0x15, 0x03b3);
15151         MP_WritePhyUshort(sc, 0x19, 0x0000);
15152         MP_WritePhyUshort(sc, 0x15, 0x03b4);
15153         MP_WritePhyUshort(sc, 0x19, 0x0000);
15154         MP_WritePhyUshort(sc, 0x15, 0x03b5);
15155         MP_WritePhyUshort(sc, 0x19, 0x0000);
15156         MP_WritePhyUshort(sc, 0x15, 0x03b6);
15157         MP_WritePhyUshort(sc, 0x19, 0x55af);
15158         MP_WritePhyUshort(sc, 0x15, 0x03b7);
15159         MP_WritePhyUshort(sc, 0x19, 0x7ff0);
15160         MP_WritePhyUshort(sc, 0x15, 0x03b8);
15161         MP_WritePhyUshort(sc, 0x19, 0x6ff0);
15162         MP_WritePhyUshort(sc, 0x15, 0x03b9);
15163         MP_WritePhyUshort(sc, 0x19, 0x4bb9);
15164         MP_WritePhyUshort(sc, 0x15, 0x03ba);
15165         MP_WritePhyUshort(sc, 0x19, 0x6a80);
15166         MP_WritePhyUshort(sc, 0x15, 0x03bb);
15167         MP_WritePhyUshort(sc, 0x19, 0x4b29);
15168         MP_WritePhyUshort(sc, 0x15, 0x03bc);
15169         MP_WritePhyUshort(sc, 0x19, 0x4041);
15170         MP_WritePhyUshort(sc, 0x15, 0x03bd);
15171         MP_WritePhyUshort(sc, 0x19, 0x440a);
15172         MP_WritePhyUshort(sc, 0x15, 0x03be);
15173         MP_WritePhyUshort(sc, 0x19, 0x4029);
15174         MP_WritePhyUshort(sc, 0x15, 0x03bf);
15175         MP_WritePhyUshort(sc, 0x19, 0x4418);
15176         MP_WritePhyUshort(sc, 0x15, 0x03c0);
15177         MP_WritePhyUshort(sc, 0x19, 0x4090);
15178         MP_WritePhyUshort(sc, 0x15, 0x03c1);
15179         MP_WritePhyUshort(sc, 0x19, 0x4438);
15180         MP_WritePhyUshort(sc, 0x15, 0x03c2);
15181         MP_WritePhyUshort(sc, 0x19, 0x40c4);
15182         MP_WritePhyUshort(sc, 0x15, 0x03c3);
15183         MP_WritePhyUshort(sc, 0x19, 0x447b);
15184         MP_WritePhyUshort(sc, 0x15, 0x03c4);
15185         MP_WritePhyUshort(sc, 0x19, 0xb6c4);
15186         MP_WritePhyUshort(sc, 0x15, 0x03c5);
15187         MP_WritePhyUshort(sc, 0x19, 0x3311);
15188         MP_WritePhyUshort(sc, 0x15, 0x03c6);
15189         MP_WritePhyUshort(sc, 0x19, 0x9bfe);
15190         MP_WritePhyUshort(sc, 0x15, 0x03c7);
15191         MP_WritePhyUshort(sc, 0x19, 0x33cc);
15192         MP_WritePhyUshort(sc, 0x15, 0x03c8);
15193         MP_WritePhyUshort(sc, 0x19, 0x0000);
15194         MP_WritePhyUshort(sc, 0x15, 0x03c9);
15195         MP_WritePhyUshort(sc, 0x19, 0x0000);
15196         MP_WritePhyUshort(sc, 0x15, 0x03ca);
15197         MP_WritePhyUshort(sc, 0x19, 0x0000);
15198         MP_WritePhyUshort(sc, 0x15, 0x03cb);
15199         MP_WritePhyUshort(sc, 0x19, 0x0000);
15200         MP_WritePhyUshort(sc, 0x15, 0x03cc);
15201         MP_WritePhyUshort(sc, 0x19, 0x542f);
15202         MP_WritePhyUshort(sc, 0x15, 0x03cd);
15203         MP_WritePhyUshort(sc, 0x19, 0x499a);
15204         MP_WritePhyUshort(sc, 0x15, 0x03ce);
15205         MP_WritePhyUshort(sc, 0x19, 0x7c40);
15206         MP_WritePhyUshort(sc, 0x15, 0x03cf);
15207         MP_WritePhyUshort(sc, 0x19, 0x4c40);
15208         MP_WritePhyUshort(sc, 0x15, 0x03d0);
15209         MP_WritePhyUshort(sc, 0x19, 0x490a);
15210         MP_WritePhyUshort(sc, 0x15, 0x03d1);
15211         MP_WritePhyUshort(sc, 0x19, 0x405e);
15212         MP_WritePhyUshort(sc, 0x15, 0x03d2);
15213         MP_WritePhyUshort(sc, 0x19, 0x44f8);
15214         MP_WritePhyUshort(sc, 0x15, 0x03d3);
15215         MP_WritePhyUshort(sc, 0x19, 0x6b00);
15216         MP_WritePhyUshort(sc, 0x15, 0x03d4);
15217         MP_WritePhyUshort(sc, 0x19, 0xd64f);
15218         MP_WritePhyUshort(sc, 0x15, 0x03d5);
15219         MP_WritePhyUshort(sc, 0x19, 0x0028);
15220         MP_WritePhyUshort(sc, 0x15, 0x03d6);
15221         MP_WritePhyUshort(sc, 0x19, 0x3311);
15222         MP_WritePhyUshort(sc, 0x15, 0x03d7);
15223         MP_WritePhyUshort(sc, 0x19, 0xbd27);
15224         MP_WritePhyUshort(sc, 0x15, 0x03d8);
15225         MP_WritePhyUshort(sc, 0x19, 0x9cfc);
15226         MP_WritePhyUshort(sc, 0x15, 0x03d9);
15227         MP_WritePhyUshort(sc, 0x19, 0xc639);
15228         MP_WritePhyUshort(sc, 0x15, 0x03da);
15229         MP_WritePhyUshort(sc, 0x19, 0x000f);
15230         MP_WritePhyUshort(sc, 0x15, 0x03db);
15231         MP_WritePhyUshort(sc, 0x19, 0x9e03);
15232         MP_WritePhyUshort(sc, 0x15, 0x03dc);
15233         MP_WritePhyUshort(sc, 0x19, 0x7c01);
15234         MP_WritePhyUshort(sc, 0x15, 0x03dd);
15235         MP_WritePhyUshort(sc, 0x19, 0x4c01);
15236         MP_WritePhyUshort(sc, 0x15, 0x03de);
15237         MP_WritePhyUshort(sc, 0x19, 0x9af6);
15238         MP_WritePhyUshort(sc, 0x15, 0x03df);
15239         MP_WritePhyUshort(sc, 0x19, 0x7c12);
15240         MP_WritePhyUshort(sc, 0x15, 0x03e0);
15241         MP_WritePhyUshort(sc, 0x19, 0x4c52);
15242         MP_WritePhyUshort(sc, 0x15, 0x03e1);
15243         MP_WritePhyUshort(sc, 0x19, 0x4470);
15244         MP_WritePhyUshort(sc, 0x15, 0x03e2);
15245         MP_WritePhyUshort(sc, 0x19, 0x7c12);
15246         MP_WritePhyUshort(sc, 0x15, 0x03e3);
15247         MP_WritePhyUshort(sc, 0x19, 0x4c40);
15248         MP_WritePhyUshort(sc, 0x15, 0x03e4);
15249         MP_WritePhyUshort(sc, 0x19, 0x33d4);
15250         MP_WritePhyUshort(sc, 0x15, 0x03e5);
15251         MP_WritePhyUshort(sc, 0x19, 0x0000);
15252         MP_WritePhyUshort(sc, 0x15, 0x03e6);
15253         MP_WritePhyUshort(sc, 0x19, 0x0000);
15254         MP_WritePhyUshort(sc, 0x15, 0x03e7);
15255         MP_WritePhyUshort(sc, 0x19, 0x0000);
15256         MP_WritePhyUshort(sc, 0x15, 0x03e8);
15257         MP_WritePhyUshort(sc, 0x19, 0x0000);
15258         MP_WritePhyUshort(sc, 0x15, 0x03e9);
15259         MP_WritePhyUshort(sc, 0x19, 0x49bb);
15260         MP_WritePhyUshort(sc, 0x15, 0x03ea);
15261         MP_WritePhyUshort(sc, 0x19, 0x4478);
15262         MP_WritePhyUshort(sc, 0x15, 0x03eb);
15263         MP_WritePhyUshort(sc, 0x19, 0x492b);
15264         MP_WritePhyUshort(sc, 0x15, 0x03ec);
15265         MP_WritePhyUshort(sc, 0x19, 0x6b80);
15266         MP_WritePhyUshort(sc, 0x15, 0x03ed);
15267         MP_WritePhyUshort(sc, 0x19, 0x7c01);
15268         MP_WritePhyUshort(sc, 0x15, 0x03ee);
15269         MP_WritePhyUshort(sc, 0x19, 0x4c00);
15270         MP_WritePhyUshort(sc, 0x15, 0x03ef);
15271         MP_WritePhyUshort(sc, 0x19, 0xd64f);
15272         MP_WritePhyUshort(sc, 0x15, 0x03f0);
15273         MP_WritePhyUshort(sc, 0x19, 0x000d);
15274         MP_WritePhyUshort(sc, 0x15, 0x03f1);
15275         MP_WritePhyUshort(sc, 0x19, 0x3311);
15276         MP_WritePhyUshort(sc, 0x15, 0x03f2);
15277         MP_WritePhyUshort(sc, 0x19, 0xbd0c);
15278         MP_WritePhyUshort(sc, 0x15, 0x03f3);
15279         MP_WritePhyUshort(sc, 0x19, 0xc428);
15280         MP_WritePhyUshort(sc, 0x15, 0x03f4);
15281         MP_WritePhyUshort(sc, 0x19, 0x0008);
15282         MP_WritePhyUshort(sc, 0x15, 0x03f5);
15283         MP_WritePhyUshort(sc, 0x19, 0x9afa);
15284         MP_WritePhyUshort(sc, 0x15, 0x03f6);
15285         MP_WritePhyUshort(sc, 0x19, 0x7c12);
15286         MP_WritePhyUshort(sc, 0x15, 0x03f7);
15287         MP_WritePhyUshort(sc, 0x19, 0x4c52);
15288         MP_WritePhyUshort(sc, 0x15, 0x03f8);
15289         MP_WritePhyUshort(sc, 0x19, 0x4470);
15290         MP_WritePhyUshort(sc, 0x15, 0x03f9);
15291         MP_WritePhyUshort(sc, 0x19, 0x7c12);
15292         MP_WritePhyUshort(sc, 0x15, 0x03fa);
15293         MP_WritePhyUshort(sc, 0x19, 0x4c40);
15294         MP_WritePhyUshort(sc, 0x15, 0x03fb);
15295         MP_WritePhyUshort(sc, 0x19, 0x33ef);
15296         MP_WritePhyUshort(sc, 0x15, 0x03fc);
15297         MP_WritePhyUshort(sc, 0x19, 0x3342);
15298         MP_WritePhyUshort(sc, 0x15, 0x03fd);
15299         MP_WritePhyUshort(sc, 0x19, 0x330d);
15300         MP_WritePhyUshort(sc, 0x15, 0x03fe);
15301         MP_WritePhyUshort(sc, 0x19, 0x32ae);
15302         MP_WritePhyUshort(sc, 0x15, 0x0000);
15303         MP_WritePhyUshort(sc, 0x16, 0x0306);
15304         MP_WritePhyUshort(sc, 0x16, 0x0300);
15305         MP_WritePhyUshort(sc, 0x1f, 0x0002);
15306         MP_WritePhyUshort(sc, 0x1f, 0x0000);
15307         MP_WritePhyUshort(sc, 0x1f, 0x0005);
15308         MP_WritePhyUshort(sc, 0x05, 0xfff6);
15309         MP_WritePhyUshort(sc, 0x06, 0x0080);
15310         MP_WritePhyUshort(sc, 0x05, 0x8000);
15311         MP_WritePhyUshort(sc, 0x06, 0x0280);
15312         MP_WritePhyUshort(sc, 0x06, 0x48f7);
15313         MP_WritePhyUshort(sc, 0x06, 0x00e0);
15314         MP_WritePhyUshort(sc, 0x06, 0xfff7);
15315         MP_WritePhyUshort(sc, 0x06, 0xa080);
15316         MP_WritePhyUshort(sc, 0x06, 0x02ae);
15317         MP_WritePhyUshort(sc, 0x06, 0xf602);
15318         MP_WritePhyUshort(sc, 0x06, 0x0112);
15319         MP_WritePhyUshort(sc, 0x06, 0x0201);
15320         MP_WritePhyUshort(sc, 0x06, 0x1f02);
15321         MP_WritePhyUshort(sc, 0x06, 0x012c);
15322         MP_WritePhyUshort(sc, 0x06, 0x0201);
15323         MP_WritePhyUshort(sc, 0x06, 0x3c02);
15324         MP_WritePhyUshort(sc, 0x06, 0x0156);
15325         MP_WritePhyUshort(sc, 0x06, 0x0201);
15326         MP_WritePhyUshort(sc, 0x06, 0x6d02);
15327         MP_WritePhyUshort(sc, 0x06, 0x809d);
15328         MP_WritePhyUshort(sc, 0x06, 0xe08b);
15329         MP_WritePhyUshort(sc, 0x06, 0x88e1);
15330         MP_WritePhyUshort(sc, 0x06, 0x8b89);
15331         MP_WritePhyUshort(sc, 0x06, 0x1e01);
15332         MP_WritePhyUshort(sc, 0x06, 0xe18b);
15333         MP_WritePhyUshort(sc, 0x06, 0x8a1e);
15334         MP_WritePhyUshort(sc, 0x06, 0x01e1);
15335         MP_WritePhyUshort(sc, 0x06, 0x8b8b);
15336         MP_WritePhyUshort(sc, 0x06, 0x1e01);
15337         MP_WritePhyUshort(sc, 0x06, 0xe18b);
15338         MP_WritePhyUshort(sc, 0x06, 0x8c1e);
15339         MP_WritePhyUshort(sc, 0x06, 0x01e1);
15340         MP_WritePhyUshort(sc, 0x06, 0x8b8d);
15341         MP_WritePhyUshort(sc, 0x06, 0x1e01);
15342         MP_WritePhyUshort(sc, 0x06, 0xe18b);
15343         MP_WritePhyUshort(sc, 0x06, 0x8e1e);
15344         MP_WritePhyUshort(sc, 0x06, 0x01a0);
15345         MP_WritePhyUshort(sc, 0x06, 0x00c7);
15346         MP_WritePhyUshort(sc, 0x06, 0xaebb);
15347         MP_WritePhyUshort(sc, 0x06, 0xd100);
15348         MP_WritePhyUshort(sc, 0x06, 0xbf82);
15349         MP_WritePhyUshort(sc, 0x06, 0xc702);
15350         MP_WritePhyUshort(sc, 0x06, 0x320a);
15351         MP_WritePhyUshort(sc, 0x06, 0xd105);
15352         MP_WritePhyUshort(sc, 0x06, 0xbf82);
15353         MP_WritePhyUshort(sc, 0x06, 0xcd02);
15354         MP_WritePhyUshort(sc, 0x06, 0x320a);
15355         MP_WritePhyUshort(sc, 0x06, 0xd100);
15356         MP_WritePhyUshort(sc, 0x06, 0xbf82);
15357         MP_WritePhyUshort(sc, 0x06, 0xca02);
15358         MP_WritePhyUshort(sc, 0x06, 0x320a);
15359         MP_WritePhyUshort(sc, 0x06, 0xd105);
15360         MP_WritePhyUshort(sc, 0x06, 0xbf82);
15361         MP_WritePhyUshort(sc, 0x06, 0xd002);
15362         MP_WritePhyUshort(sc, 0x06, 0x320a);
15363         MP_WritePhyUshort(sc, 0x06, 0xd481);
15364         MP_WritePhyUshort(sc, 0x06, 0xc9e4);
15365         MP_WritePhyUshort(sc, 0x06, 0x8b90);
15366         MP_WritePhyUshort(sc, 0x06, 0xe58b);
15367         MP_WritePhyUshort(sc, 0x06, 0x91d4);
15368         MP_WritePhyUshort(sc, 0x06, 0x81b8);
15369         MP_WritePhyUshort(sc, 0x06, 0xe48b);
15370         MP_WritePhyUshort(sc, 0x06, 0x92e5);
15371         MP_WritePhyUshort(sc, 0x06, 0x8b93);
15372         MP_WritePhyUshort(sc, 0x06, 0xbf8b);
15373         MP_WritePhyUshort(sc, 0x06, 0x88ec);
15374         MP_WritePhyUshort(sc, 0x06, 0x0019);
15375         MP_WritePhyUshort(sc, 0x06, 0xa98b);
15376         MP_WritePhyUshort(sc, 0x06, 0x90f9);
15377         MP_WritePhyUshort(sc, 0x06, 0xeeff);
15378         MP_WritePhyUshort(sc, 0x06, 0xf600);
15379         MP_WritePhyUshort(sc, 0x06, 0xeeff);
15380         MP_WritePhyUshort(sc, 0x06, 0xf7fc);
15381         MP_WritePhyUshort(sc, 0x06, 0xd100);
15382         MP_WritePhyUshort(sc, 0x06, 0xbf82);
15383         MP_WritePhyUshort(sc, 0x06, 0xc102);
15384         MP_WritePhyUshort(sc, 0x06, 0x320a);
15385         MP_WritePhyUshort(sc, 0x06, 0xd101);
15386         MP_WritePhyUshort(sc, 0x06, 0xbf82);
15387         MP_WritePhyUshort(sc, 0x06, 0xc402);
15388         MP_WritePhyUshort(sc, 0x06, 0x320a);
15389         MP_WritePhyUshort(sc, 0x06, 0x04f8);
15390         MP_WritePhyUshort(sc, 0x06, 0xe08b);
15391         MP_WritePhyUshort(sc, 0x06, 0x8ead);
15392         MP_WritePhyUshort(sc, 0x06, 0x201a);
15393         MP_WritePhyUshort(sc, 0x06, 0xf620);
15394         MP_WritePhyUshort(sc, 0x06, 0xe48b);
15395         MP_WritePhyUshort(sc, 0x06, 0x8e02);
15396         MP_WritePhyUshort(sc, 0x06, 0x824b);
15397         MP_WritePhyUshort(sc, 0x06, 0x0281);
15398         MP_WritePhyUshort(sc, 0x06, 0x1902);
15399         MP_WritePhyUshort(sc, 0x06, 0x2c9d);
15400         MP_WritePhyUshort(sc, 0x06, 0x0203);
15401         MP_WritePhyUshort(sc, 0x06, 0x9602);
15402         MP_WritePhyUshort(sc, 0x06, 0x0473);
15403         MP_WritePhyUshort(sc, 0x06, 0x022e);
15404         MP_WritePhyUshort(sc, 0x06, 0x3902);
15405         MP_WritePhyUshort(sc, 0x06, 0x044d);
15406         MP_WritePhyUshort(sc, 0x06, 0xe08b);
15407         MP_WritePhyUshort(sc, 0x06, 0x8ead);
15408         MP_WritePhyUshort(sc, 0x06, 0x210b);
15409         MP_WritePhyUshort(sc, 0x06, 0xf621);
15410         MP_WritePhyUshort(sc, 0x06, 0xe48b);
15411         MP_WritePhyUshort(sc, 0x06, 0x8e02);
15412         MP_WritePhyUshort(sc, 0x06, 0x0416);
15413         MP_WritePhyUshort(sc, 0x06, 0x021b);
15414         MP_WritePhyUshort(sc, 0x06, 0xa4e0);
15415         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
15416         MP_WritePhyUshort(sc, 0x06, 0xad22);
15417         MP_WritePhyUshort(sc, 0x06, 0x05f6);
15418         MP_WritePhyUshort(sc, 0x06, 0x22e4);
15419         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
15420         MP_WritePhyUshort(sc, 0x06, 0xe08b);
15421         MP_WritePhyUshort(sc, 0x06, 0x8ead);
15422         MP_WritePhyUshort(sc, 0x06, 0x2305);
15423         MP_WritePhyUshort(sc, 0x06, 0xf623);
15424         MP_WritePhyUshort(sc, 0x06, 0xe48b);
15425         MP_WritePhyUshort(sc, 0x06, 0x8ee0);
15426         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
15427         MP_WritePhyUshort(sc, 0x06, 0xad24);
15428         MP_WritePhyUshort(sc, 0x06, 0x05f6);
15429         MP_WritePhyUshort(sc, 0x06, 0x24e4);
15430         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
15431         MP_WritePhyUshort(sc, 0x06, 0xe08b);
15432         MP_WritePhyUshort(sc, 0x06, 0x8ead);
15433         MP_WritePhyUshort(sc, 0x06, 0x2505);
15434         MP_WritePhyUshort(sc, 0x06, 0xf625);
15435         MP_WritePhyUshort(sc, 0x06, 0xe48b);
15436         MP_WritePhyUshort(sc, 0x06, 0x8ee0);
15437         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
15438         MP_WritePhyUshort(sc, 0x06, 0xad26);
15439         MP_WritePhyUshort(sc, 0x06, 0x08f6);
15440         MP_WritePhyUshort(sc, 0x06, 0x26e4);
15441         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
15442         MP_WritePhyUshort(sc, 0x06, 0x0281);
15443         MP_WritePhyUshort(sc, 0x06, 0xdae0);
15444         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
15445         MP_WritePhyUshort(sc, 0x06, 0xad27);
15446         MP_WritePhyUshort(sc, 0x06, 0x05f6);
15447         MP_WritePhyUshort(sc, 0x06, 0x27e4);
15448         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
15449         MP_WritePhyUshort(sc, 0x06, 0x0203);
15450         MP_WritePhyUshort(sc, 0x06, 0x5cfc);
15451         MP_WritePhyUshort(sc, 0x06, 0x04f8);
15452         MP_WritePhyUshort(sc, 0x06, 0xfaef);
15453         MP_WritePhyUshort(sc, 0x06, 0x69e0);
15454         MP_WritePhyUshort(sc, 0x06, 0x8b85);
15455         MP_WritePhyUshort(sc, 0x06, 0xad21);
15456         MP_WritePhyUshort(sc, 0x06, 0x57e0);
15457         MP_WritePhyUshort(sc, 0x06, 0xe022);
15458         MP_WritePhyUshort(sc, 0x06, 0xe1e0);
15459         MP_WritePhyUshort(sc, 0x06, 0x2358);
15460         MP_WritePhyUshort(sc, 0x06, 0xc059);
15461         MP_WritePhyUshort(sc, 0x06, 0x021e);
15462         MP_WritePhyUshort(sc, 0x06, 0x01e1);
15463         MP_WritePhyUshort(sc, 0x06, 0x8b3c);
15464         MP_WritePhyUshort(sc, 0x06, 0x1f10);
15465         MP_WritePhyUshort(sc, 0x06, 0x9e44);
15466         MP_WritePhyUshort(sc, 0x06, 0xe48b);
15467         MP_WritePhyUshort(sc, 0x06, 0x3cad);
15468         MP_WritePhyUshort(sc, 0x06, 0x211d);
15469         MP_WritePhyUshort(sc, 0x06, 0xe18b);
15470         MP_WritePhyUshort(sc, 0x06, 0x84f7);
15471         MP_WritePhyUshort(sc, 0x06, 0x29e5);
15472         MP_WritePhyUshort(sc, 0x06, 0x8b84);
15473         MP_WritePhyUshort(sc, 0x06, 0xac27);
15474         MP_WritePhyUshort(sc, 0x06, 0x0dac);
15475         MP_WritePhyUshort(sc, 0x06, 0x2605);
15476         MP_WritePhyUshort(sc, 0x06, 0x0281);
15477         MP_WritePhyUshort(sc, 0x06, 0x7fae);
15478         MP_WritePhyUshort(sc, 0x06, 0x2b02);
15479         MP_WritePhyUshort(sc, 0x06, 0x2c23);
15480         MP_WritePhyUshort(sc, 0x06, 0xae26);
15481         MP_WritePhyUshort(sc, 0x06, 0x022c);
15482         MP_WritePhyUshort(sc, 0x06, 0x41ae);
15483         MP_WritePhyUshort(sc, 0x06, 0x21e0);
15484         MP_WritePhyUshort(sc, 0x06, 0x8b87);
15485         MP_WritePhyUshort(sc, 0x06, 0xad22);
15486         MP_WritePhyUshort(sc, 0x06, 0x18e0);
15487         MP_WritePhyUshort(sc, 0x06, 0xfff7);
15488         MP_WritePhyUshort(sc, 0x06, 0x58fc);
15489         MP_WritePhyUshort(sc, 0x06, 0xe4ff);
15490         MP_WritePhyUshort(sc, 0x06, 0xf7d1);
15491         MP_WritePhyUshort(sc, 0x06, 0x00bf);
15492         MP_WritePhyUshort(sc, 0x06, 0x2eee);
15493         MP_WritePhyUshort(sc, 0x06, 0x0232);
15494         MP_WritePhyUshort(sc, 0x06, 0x0ad1);
15495         MP_WritePhyUshort(sc, 0x06, 0x00bf);
15496         MP_WritePhyUshort(sc, 0x06, 0x82e8);
15497         MP_WritePhyUshort(sc, 0x06, 0x0232);
15498         MP_WritePhyUshort(sc, 0x06, 0x0a02);
15499         MP_WritePhyUshort(sc, 0x06, 0x2bdf);
15500         MP_WritePhyUshort(sc, 0x06, 0xef96);
15501         MP_WritePhyUshort(sc, 0x06, 0xfefc);
15502         MP_WritePhyUshort(sc, 0x06, 0x04d0);
15503         MP_WritePhyUshort(sc, 0x06, 0x0202);
15504         MP_WritePhyUshort(sc, 0x06, 0x1e97);
15505         MP_WritePhyUshort(sc, 0x06, 0xe08b);
15506         MP_WritePhyUshort(sc, 0x06, 0x87ad);
15507         MP_WritePhyUshort(sc, 0x06, 0x2228);
15508         MP_WritePhyUshort(sc, 0x06, 0xd100);
15509         MP_WritePhyUshort(sc, 0x06, 0xbf82);
15510         MP_WritePhyUshort(sc, 0x06, 0xd302);
15511         MP_WritePhyUshort(sc, 0x06, 0x320a);
15512         MP_WritePhyUshort(sc, 0x06, 0xd10c);
15513         MP_WritePhyUshort(sc, 0x06, 0xbf82);
15514         MP_WritePhyUshort(sc, 0x06, 0xd602);
15515         MP_WritePhyUshort(sc, 0x06, 0x320a);
15516         MP_WritePhyUshort(sc, 0x06, 0xd104);
15517         MP_WritePhyUshort(sc, 0x06, 0xbf82);
15518         MP_WritePhyUshort(sc, 0x06, 0xd902);
15519         MP_WritePhyUshort(sc, 0x06, 0x320a);
15520         MP_WritePhyUshort(sc, 0x06, 0xd101);
15521         MP_WritePhyUshort(sc, 0x06, 0xbf82);
15522         MP_WritePhyUshort(sc, 0x06, 0xe802);
15523         MP_WritePhyUshort(sc, 0x06, 0x320a);
15524         MP_WritePhyUshort(sc, 0x06, 0xe0ff);
15525         MP_WritePhyUshort(sc, 0x06, 0xf768);
15526         MP_WritePhyUshort(sc, 0x06, 0x03e4);
15527         MP_WritePhyUshort(sc, 0x06, 0xfff7);
15528         MP_WritePhyUshort(sc, 0x06, 0xd004);
15529         MP_WritePhyUshort(sc, 0x06, 0x0228);
15530         MP_WritePhyUshort(sc, 0x06, 0x7a04);
15531         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
15532         MP_WritePhyUshort(sc, 0x06, 0xe234);
15533         MP_WritePhyUshort(sc, 0x06, 0xe1e2);
15534         MP_WritePhyUshort(sc, 0x06, 0x35f6);
15535         MP_WritePhyUshort(sc, 0x06, 0x2be4);
15536         MP_WritePhyUshort(sc, 0x06, 0xe234);
15537         MP_WritePhyUshort(sc, 0x06, 0xe5e2);
15538         MP_WritePhyUshort(sc, 0x06, 0x35fc);
15539         MP_WritePhyUshort(sc, 0x06, 0x05f8);
15540         MP_WritePhyUshort(sc, 0x06, 0xe0e2);
15541         MP_WritePhyUshort(sc, 0x06, 0x34e1);
15542         MP_WritePhyUshort(sc, 0x06, 0xe235);
15543         MP_WritePhyUshort(sc, 0x06, 0xf72b);
15544         MP_WritePhyUshort(sc, 0x06, 0xe4e2);
15545         MP_WritePhyUshort(sc, 0x06, 0x34e5);
15546         MP_WritePhyUshort(sc, 0x06, 0xe235);
15547         MP_WritePhyUshort(sc, 0x06, 0xfc05);
15548         MP_WritePhyUshort(sc, 0x06, 0xf8f9);
15549         MP_WritePhyUshort(sc, 0x06, 0xfaef);
15550         MP_WritePhyUshort(sc, 0x06, 0x69ac);
15551         MP_WritePhyUshort(sc, 0x06, 0x1b4c);
15552         MP_WritePhyUshort(sc, 0x06, 0xbf2e);
15553         MP_WritePhyUshort(sc, 0x06, 0x3002);
15554         MP_WritePhyUshort(sc, 0x06, 0x31dd);
15555         MP_WritePhyUshort(sc, 0x06, 0xef01);
15556         MP_WritePhyUshort(sc, 0x06, 0xe28a);
15557         MP_WritePhyUshort(sc, 0x06, 0x76e4);
15558         MP_WritePhyUshort(sc, 0x06, 0x8a76);
15559         MP_WritePhyUshort(sc, 0x06, 0x1f12);
15560         MP_WritePhyUshort(sc, 0x06, 0x9e3a);
15561         MP_WritePhyUshort(sc, 0x06, 0xef12);
15562         MP_WritePhyUshort(sc, 0x06, 0x5907);
15563         MP_WritePhyUshort(sc, 0x06, 0x9f12);
15564         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
15565         MP_WritePhyUshort(sc, 0x06, 0x8b40);
15566         MP_WritePhyUshort(sc, 0x06, 0xf721);
15567         MP_WritePhyUshort(sc, 0x06, 0xe48b);
15568         MP_WritePhyUshort(sc, 0x06, 0x40d0);
15569         MP_WritePhyUshort(sc, 0x06, 0x0302);
15570         MP_WritePhyUshort(sc, 0x06, 0x287a);
15571         MP_WritePhyUshort(sc, 0x06, 0x0282);
15572         MP_WritePhyUshort(sc, 0x06, 0x34fc);
15573         MP_WritePhyUshort(sc, 0x06, 0xa000);
15574         MP_WritePhyUshort(sc, 0x06, 0x1002);
15575         MP_WritePhyUshort(sc, 0x06, 0x2dc3);
15576         MP_WritePhyUshort(sc, 0x06, 0x022e);
15577         MP_WritePhyUshort(sc, 0x06, 0x21e0);
15578         MP_WritePhyUshort(sc, 0x06, 0x8b40);
15579         MP_WritePhyUshort(sc, 0x06, 0xf621);
15580         MP_WritePhyUshort(sc, 0x06, 0xe48b);
15581         MP_WritePhyUshort(sc, 0x06, 0x40ae);
15582         MP_WritePhyUshort(sc, 0x06, 0x0fbf);
15583         MP_WritePhyUshort(sc, 0x06, 0x3fa5);
15584         MP_WritePhyUshort(sc, 0x06, 0x0231);
15585         MP_WritePhyUshort(sc, 0x06, 0x6cbf);
15586         MP_WritePhyUshort(sc, 0x06, 0x3fa2);
15587         MP_WritePhyUshort(sc, 0x06, 0x0231);
15588         MP_WritePhyUshort(sc, 0x06, 0x6c02);
15589         MP_WritePhyUshort(sc, 0x06, 0x2dc3);
15590         MP_WritePhyUshort(sc, 0x06, 0xef96);
15591         MP_WritePhyUshort(sc, 0x06, 0xfefd);
15592         MP_WritePhyUshort(sc, 0x06, 0xfc04);
15593         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
15594         MP_WritePhyUshort(sc, 0x06, 0xe2f4);
15595         MP_WritePhyUshort(sc, 0x06, 0xe1e2);
15596         MP_WritePhyUshort(sc, 0x06, 0xf5e4);
15597         MP_WritePhyUshort(sc, 0x06, 0x8a78);
15598         MP_WritePhyUshort(sc, 0x06, 0xe58a);
15599         MP_WritePhyUshort(sc, 0x06, 0x79ee);
15600         MP_WritePhyUshort(sc, 0x06, 0xe2f4);
15601         MP_WritePhyUshort(sc, 0x06, 0xd8ee);
15602         MP_WritePhyUshort(sc, 0x06, 0xe2f5);
15603         MP_WritePhyUshort(sc, 0x06, 0x20fc);
15604         MP_WritePhyUshort(sc, 0x06, 0x04f8);
15605         MP_WritePhyUshort(sc, 0x06, 0xf9fa);
15606         MP_WritePhyUshort(sc, 0x06, 0xef69);
15607         MP_WritePhyUshort(sc, 0x06, 0xe08b);
15608         MP_WritePhyUshort(sc, 0x06, 0x87ad);
15609         MP_WritePhyUshort(sc, 0x06, 0x2065);
15610         MP_WritePhyUshort(sc, 0x06, 0xd200);
15611         MP_WritePhyUshort(sc, 0x06, 0xbf2e);
15612         MP_WritePhyUshort(sc, 0x06, 0xe802);
15613         MP_WritePhyUshort(sc, 0x06, 0x31dd);
15614         MP_WritePhyUshort(sc, 0x06, 0x1e21);
15615         MP_WritePhyUshort(sc, 0x06, 0xbf82);
15616         MP_WritePhyUshort(sc, 0x06, 0xdf02);
15617         MP_WritePhyUshort(sc, 0x06, 0x31dd);
15618         MP_WritePhyUshort(sc, 0x06, 0x0c11);
15619         MP_WritePhyUshort(sc, 0x06, 0x1e21);
15620         MP_WritePhyUshort(sc, 0x06, 0xbf82);
15621         MP_WritePhyUshort(sc, 0x06, 0xe202);
15622         MP_WritePhyUshort(sc, 0x06, 0x31dd);
15623         MP_WritePhyUshort(sc, 0x06, 0x0c12);
15624         MP_WritePhyUshort(sc, 0x06, 0x1e21);
15625         MP_WritePhyUshort(sc, 0x06, 0xbf82);
15626         MP_WritePhyUshort(sc, 0x06, 0xe502);
15627         MP_WritePhyUshort(sc, 0x06, 0x31dd);
15628         MP_WritePhyUshort(sc, 0x06, 0x0c13);
15629         MP_WritePhyUshort(sc, 0x06, 0x1e21);
15630         MP_WritePhyUshort(sc, 0x06, 0xbf1f);
15631         MP_WritePhyUshort(sc, 0x06, 0x5302);
15632         MP_WritePhyUshort(sc, 0x06, 0x31dd);
15633         MP_WritePhyUshort(sc, 0x06, 0x0c14);
15634         MP_WritePhyUshort(sc, 0x06, 0x1e21);
15635         MP_WritePhyUshort(sc, 0x06, 0xbf82);
15636         MP_WritePhyUshort(sc, 0x06, 0xeb02);
15637         MP_WritePhyUshort(sc, 0x06, 0x31dd);
15638         MP_WritePhyUshort(sc, 0x06, 0x0c16);
15639         MP_WritePhyUshort(sc, 0x06, 0x1e21);
15640         MP_WritePhyUshort(sc, 0x06, 0xe083);
15641         MP_WritePhyUshort(sc, 0x06, 0xe01f);
15642         MP_WritePhyUshort(sc, 0x06, 0x029e);
15643         MP_WritePhyUshort(sc, 0x06, 0x22e6);
15644         MP_WritePhyUshort(sc, 0x06, 0x83e0);
15645         MP_WritePhyUshort(sc, 0x06, 0xad31);
15646         MP_WritePhyUshort(sc, 0x06, 0x14ad);
15647         MP_WritePhyUshort(sc, 0x06, 0x3011);
15648         MP_WritePhyUshort(sc, 0x06, 0xef02);
15649         MP_WritePhyUshort(sc, 0x06, 0x580c);
15650         MP_WritePhyUshort(sc, 0x06, 0x9e07);
15651         MP_WritePhyUshort(sc, 0x06, 0xad36);
15652         MP_WritePhyUshort(sc, 0x06, 0x085a);
15653         MP_WritePhyUshort(sc, 0x06, 0x309f);
15654         MP_WritePhyUshort(sc, 0x06, 0x04d1);
15655         MP_WritePhyUshort(sc, 0x06, 0x01ae);
15656         MP_WritePhyUshort(sc, 0x06, 0x02d1);
15657         MP_WritePhyUshort(sc, 0x06, 0x00bf);
15658         MP_WritePhyUshort(sc, 0x06, 0x82dc);
15659         MP_WritePhyUshort(sc, 0x06, 0x0232);
15660         MP_WritePhyUshort(sc, 0x06, 0x0aef);
15661         MP_WritePhyUshort(sc, 0x06, 0x96fe);
15662         MP_WritePhyUshort(sc, 0x06, 0xfdfc);
15663         MP_WritePhyUshort(sc, 0x06, 0x0400);
15664         MP_WritePhyUshort(sc, 0x06, 0xe140);
15665         MP_WritePhyUshort(sc, 0x06, 0x77e1);
15666         MP_WritePhyUshort(sc, 0x06, 0x4010);
15667         MP_WritePhyUshort(sc, 0x06, 0xe150);
15668         MP_WritePhyUshort(sc, 0x06, 0x32e1);
15669         MP_WritePhyUshort(sc, 0x06, 0x5030);
15670         MP_WritePhyUshort(sc, 0x06, 0xe144);
15671         MP_WritePhyUshort(sc, 0x06, 0x74e1);
15672         MP_WritePhyUshort(sc, 0x06, 0x44bb);
15673         MP_WritePhyUshort(sc, 0x06, 0xe2d2);
15674         MP_WritePhyUshort(sc, 0x06, 0x40e0);
15675         MP_WritePhyUshort(sc, 0x06, 0x2cfc);
15676         MP_WritePhyUshort(sc, 0x06, 0xe2cc);
15677         MP_WritePhyUshort(sc, 0x06, 0xcce2);
15678         MP_WritePhyUshort(sc, 0x06, 0x00cc);
15679         MP_WritePhyUshort(sc, 0x06, 0xe000);
15680         MP_WritePhyUshort(sc, 0x06, 0x99e0);
15681         MP_WritePhyUshort(sc, 0x06, 0x3688);
15682         MP_WritePhyUshort(sc, 0x06, 0xe036);
15683         MP_WritePhyUshort(sc, 0x06, 0x99e1);
15684         MP_WritePhyUshort(sc, 0x06, 0x40dd);
15685         MP_WritePhyUshort(sc, 0x06, 0xe022);
15686         MP_WritePhyUshort(sc, 0x05, 0xe142);
15687         PhyRegValue = MP_ReadPhyUshort(sc, 0x06);
15688         PhyRegValue |= BIT_0;
15689         MP_WritePhyUshort(sc, 0x06, PhyRegValue);
15690         MP_WritePhyUshort(sc, 0x05, 0xe140);
15691         PhyRegValue = MP_ReadPhyUshort(sc, 0x06);
15692         PhyRegValue |= BIT_0;
15693         MP_WritePhyUshort(sc, 0x06, PhyRegValue);
15694         MP_WritePhyUshort(sc, 0x1f, 0x0000);
15695         MP_WritePhyUshort(sc, 0x1f, 0x0005);
15696         for (i = 0; i < 200; i++) {
15697                 DELAY(100);
15698                 PhyRegValue = MP_ReadPhyUshort(sc, 0x00);
15699                 if (PhyRegValue & BIT_7)
15700                         break;
15701         }
15702
15703         MP_WritePhyUshort(sc, 0x1F, 0x0001);
15704         MP_WritePhyUshort(sc, 0x0B, 0x6C14);
15705         MP_WritePhyUshort(sc, 0x14, 0x7F3D);
15706         MP_WritePhyUshort(sc, 0x1C, 0xFAFE);
15707         MP_WritePhyUshort(sc, 0x08, 0x07C5);
15708         MP_WritePhyUshort(sc, 0x10, 0xF090);
15709         MP_WritePhyUshort(sc, 0x1F, 0x0003);
15710         MP_WritePhyUshort(sc, 0x14, 0x641A);
15711         MP_WritePhyUshort(sc, 0x1A, 0x0606);
15712         MP_WritePhyUshort(sc, 0x12, 0xF480);
15713         MP_WritePhyUshort(sc, 0x13, 0x0747);
15714         MP_WritePhyUshort(sc, 0x1F, 0x0000);
15715
15716         MP_WritePhyUshort(sc, 0x1F, 0x0003);
15717         MP_WritePhyUshort(sc, 0x0D, 0x0207);
15718         MP_WritePhyUshort(sc, 0x02, 0x5FD0);
15719         MP_WritePhyUshort(sc, 0x1F, 0x0000);
15720
15721         MP_WritePhyUshort(sc, 0x1F, 0x0003);
15722         MP_WritePhyUshort(sc, 0x09, 0xA20F);
15723         MP_WritePhyUshort(sc, 0x1F, 0x0000);
15724
15725         MP_WritePhyUshort(sc, 0x1f, 0x0003);
15726         PhyRegValue = MP_ReadPhyUshort(sc, 0x19);
15727         PhyRegValue &= ~BIT_0;
15728         MP_WritePhyUshort(sc, 0x19, PhyRegValue);
15729         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
15730         PhyRegValue &= ~BIT_10;
15731         MP_WritePhyUshort(sc, 0x10, PhyRegValue);
15732         MP_WritePhyUshort(sc, 0x1f, 0x0000);
15733
15734         MP_WritePhyUshort(sc, 0x1f, 0x0004);
15735         MP_WritePhyUshort(sc, 0x1f, 0x0007);
15736         MP_WritePhyUshort(sc, 0x1e, 0x0023);
15737         PhyRegValue = MP_ReadPhyUshort(sc, 0x17);
15738         PhyRegValue &= ~BIT_0;
15739         PhyRegValue |= BIT_2;
15740         MP_WritePhyUshort(sc, 0x17, PhyRegValue);
15741         MP_WritePhyUshort(sc, 0x1f, 0x0002);
15742         MP_WritePhyUshort(sc, 0x1f, 0x0000);
15743 }
15744
15745 static void re_set_phy_mcu_8168evl_2(struct re_softc *sc)
15746 {
15747         u_int16_t PhyRegValue;
15748         int i;
15749
15750         MP_WritePhyUshort(sc, 0x1f, 0x0000);
15751         MP_WritePhyUshort(sc, 0x00, 0x1800);
15752         PhyRegValue = MP_ReadPhyUshort(sc, 0x15);
15753         PhyRegValue &= ~(BIT_12);
15754         MP_WritePhyUshort(sc, 0x15, PhyRegValue);
15755         MP_WritePhyUshort(sc, 0x00, 0x4800);
15756         MP_WritePhyUshort(sc, 0x1f, 0x0007);
15757         MP_WritePhyUshort(sc, 0x1e, 0x002f);
15758         for (i = 0; i < 1000; i++) {
15759                 if (MP_ReadPhyUshort(sc, 0x1c) & BIT_7)
15760                         break;
15761                 DELAY(100);
15762         }
15763         MP_WritePhyUshort(sc, 0x1f, 0x0000);
15764         MP_WritePhyUshort(sc, 0x00, 0x1800);
15765         MP_WritePhyUshort(sc, 0x1f, 0x0007);
15766         MP_WritePhyUshort(sc, 0x1e, 0x0023);
15767         for (i = 0; i < 200; i++) {
15768                 if ((MP_ReadPhyUshort(sc, 0x17) & BIT_0) == 0)
15769                         break;
15770                 DELAY(100);
15771         }
15772         MP_WritePhyUshort(sc, 0x1f, 0x0005);
15773         MP_WritePhyUshort(sc, 0x05, 0xfff6);
15774         MP_WritePhyUshort(sc, 0x06, 0x0080);
15775         MP_WritePhyUshort(sc, 0x1f, 0x0007);
15776         MP_WritePhyUshort(sc, 0x1e, 0x0023);
15777         MP_WritePhyUshort(sc, 0x16, 0x0306);
15778         MP_WritePhyUshort(sc, 0x16, 0x0307);
15779         MP_WritePhyUshort(sc, 0x15, 0x00AF);
15780         MP_WritePhyUshort(sc, 0x19, 0x4060);
15781         MP_WritePhyUshort(sc, 0x15, 0x00B0);
15782         MP_WritePhyUshort(sc, 0x19, 0x7800);
15783         MP_WritePhyUshort(sc, 0x15, 0x00B1);
15784         MP_WritePhyUshort(sc, 0x19, 0x7e00);
15785         MP_WritePhyUshort(sc, 0x15, 0x00B2);
15786         MP_WritePhyUshort(sc, 0x19, 0x72B0);
15787         MP_WritePhyUshort(sc, 0x15, 0x00B3);
15788         MP_WritePhyUshort(sc, 0x19, 0x7F00);
15789         MP_WritePhyUshort(sc, 0x15, 0x00B4);
15790         MP_WritePhyUshort(sc, 0x19, 0x73B0);
15791         MP_WritePhyUshort(sc, 0x15, 0x0101);
15792         MP_WritePhyUshort(sc, 0x19, 0x0005);
15793         MP_WritePhyUshort(sc, 0x15, 0x0103);
15794         MP_WritePhyUshort(sc, 0x19, 0x0003);
15795         MP_WritePhyUshort(sc, 0x15, 0x0105);
15796         MP_WritePhyUshort(sc, 0x19, 0x30FD);
15797         MP_WritePhyUshort(sc, 0x15, 0x0106);
15798         MP_WritePhyUshort(sc, 0x19, 0x9DF7);
15799         MP_WritePhyUshort(sc, 0x15, 0x0107);
15800         MP_WritePhyUshort(sc, 0x19, 0x30C6);
15801         MP_WritePhyUshort(sc, 0x15, 0x0098);
15802         MP_WritePhyUshort(sc, 0x19, 0x7c0b);
15803         MP_WritePhyUshort(sc, 0x15, 0x0099);
15804         MP_WritePhyUshort(sc, 0x19, 0x6c0b);
15805         MP_WritePhyUshort(sc, 0x15, 0x00eb);
15806         MP_WritePhyUshort(sc, 0x19, 0x6c0b);
15807         MP_WritePhyUshort(sc, 0x15, 0x00f8);
15808         MP_WritePhyUshort(sc, 0x19, 0x6f0b);
15809         MP_WritePhyUshort(sc, 0x15, 0x00fe);
15810         MP_WritePhyUshort(sc, 0x19, 0x6f0f);
15811         MP_WritePhyUshort(sc, 0x15, 0x00db);
15812         MP_WritePhyUshort(sc, 0x19, 0x6f09);
15813         MP_WritePhyUshort(sc, 0x15, 0x00dc);
15814         MP_WritePhyUshort(sc, 0x19, 0xaefd);
15815         MP_WritePhyUshort(sc, 0x15, 0x00dd);
15816         MP_WritePhyUshort(sc, 0x19, 0x6f0b);
15817         MP_WritePhyUshort(sc, 0x15, 0x00de);
15818         MP_WritePhyUshort(sc, 0x19, 0xc60b);
15819         MP_WritePhyUshort(sc, 0x15, 0x00df);
15820         MP_WritePhyUshort(sc, 0x19, 0x00fa);
15821         MP_WritePhyUshort(sc, 0x15, 0x00e0);
15822         MP_WritePhyUshort(sc, 0x19, 0x30e1);
15823         MP_WritePhyUshort(sc, 0x15, 0x020c);
15824         MP_WritePhyUshort(sc, 0x19, 0x3224);
15825         MP_WritePhyUshort(sc, 0x15, 0x020e);
15826         MP_WritePhyUshort(sc, 0x19, 0x9813);
15827         MP_WritePhyUshort(sc, 0x15, 0x020f);
15828         MP_WritePhyUshort(sc, 0x19, 0x7801);
15829         MP_WritePhyUshort(sc, 0x15, 0x0210);
15830         MP_WritePhyUshort(sc, 0x19, 0x930f);
15831         MP_WritePhyUshort(sc, 0x15, 0x0211);
15832         MP_WritePhyUshort(sc, 0x19, 0x9206);
15833         MP_WritePhyUshort(sc, 0x15, 0x0212);
15834         MP_WritePhyUshort(sc, 0x19, 0x4002);
15835         MP_WritePhyUshort(sc, 0x15, 0x0213);
15836         MP_WritePhyUshort(sc, 0x19, 0x7800);
15837         MP_WritePhyUshort(sc, 0x15, 0x0214);
15838         MP_WritePhyUshort(sc, 0x19, 0x588f);
15839         MP_WritePhyUshort(sc, 0x15, 0x0215);
15840         MP_WritePhyUshort(sc, 0x19, 0x5520);
15841         MP_WritePhyUshort(sc, 0x15, 0x0216);
15842         MP_WritePhyUshort(sc, 0x19, 0x3224);
15843         MP_WritePhyUshort(sc, 0x15, 0x0217);
15844         MP_WritePhyUshort(sc, 0x19, 0x4002);
15845         MP_WritePhyUshort(sc, 0x15, 0x0218);
15846         MP_WritePhyUshort(sc, 0x19, 0x7800);
15847         MP_WritePhyUshort(sc, 0x15, 0x0219);
15848         MP_WritePhyUshort(sc, 0x19, 0x588d);
15849         MP_WritePhyUshort(sc, 0x15, 0x021a);
15850         MP_WritePhyUshort(sc, 0x19, 0x5540);
15851         MP_WritePhyUshort(sc, 0x15, 0x021b);
15852         MP_WritePhyUshort(sc, 0x19, 0x9e03);
15853         MP_WritePhyUshort(sc, 0x15, 0x021c);
15854         MP_WritePhyUshort(sc, 0x19, 0x7c40);
15855         MP_WritePhyUshort(sc, 0x15, 0x021d);
15856         MP_WritePhyUshort(sc, 0x19, 0x6840);
15857         MP_WritePhyUshort(sc, 0x15, 0x021e);
15858         MP_WritePhyUshort(sc, 0x19, 0x3224);
15859         MP_WritePhyUshort(sc, 0x15, 0x021f);
15860         MP_WritePhyUshort(sc, 0x19, 0x4002);
15861         MP_WritePhyUshort(sc, 0x15, 0x0220);
15862         MP_WritePhyUshort(sc, 0x19, 0x3224);
15863         MP_WritePhyUshort(sc, 0x15, 0x0221);
15864         MP_WritePhyUshort(sc, 0x19, 0x9e03);
15865         MP_WritePhyUshort(sc, 0x15, 0x0222);
15866         MP_WritePhyUshort(sc, 0x19, 0x7c40);
15867         MP_WritePhyUshort(sc, 0x15, 0x0223);
15868         MP_WritePhyUshort(sc, 0x19, 0x6840);
15869         MP_WritePhyUshort(sc, 0x15, 0x0224);
15870         MP_WritePhyUshort(sc, 0x19, 0x7800);
15871         MP_WritePhyUshort(sc, 0x15, 0x0225);
15872         MP_WritePhyUshort(sc, 0x19, 0x3231);
15873         MP_WritePhyUshort(sc, 0x15, 0x0000);
15874         MP_WritePhyUshort(sc, 0x16, 0x0306);
15875         MP_WritePhyUshort(sc, 0x16, 0x0300);
15876         MP_WritePhyUshort(sc, 0x1f, 0x0002);
15877         MP_WritePhyUshort(sc, 0x1f, 0x0000);
15878         MP_WritePhyUshort(sc, 0x1f, 0x0000);
15879         MP_WritePhyUshort(sc, 0x17, 0x2160);
15880         MP_WritePhyUshort(sc, 0x1f, 0x0007);
15881         MP_WritePhyUshort(sc, 0x1e, 0x0040);
15882         MP_WritePhyUshort(sc, 0x18, 0x0004);
15883         MP_WritePhyUshort(sc, 0x18, 0x09d4);
15884         MP_WritePhyUshort(sc, 0x19, 0x4000);
15885         MP_WritePhyUshort(sc, 0x18, 0x09e4);
15886         MP_WritePhyUshort(sc, 0x19, 0x0800);
15887         MP_WritePhyUshort(sc, 0x18, 0x09f4);
15888         MP_WritePhyUshort(sc, 0x19, 0xff00);
15889         MP_WritePhyUshort(sc, 0x18, 0x0a04);
15890         MP_WritePhyUshort(sc, 0x19, 0x4000);
15891         MP_WritePhyUshort(sc, 0x18, 0x0a14);
15892         MP_WritePhyUshort(sc, 0x19, 0x0c00);
15893         MP_WritePhyUshort(sc, 0x18, 0x0a24);
15894         MP_WritePhyUshort(sc, 0x19, 0xff00);
15895         MP_WritePhyUshort(sc, 0x18, 0x0a74);
15896         MP_WritePhyUshort(sc, 0x19, 0xf600);
15897         MP_WritePhyUshort(sc, 0x18, 0x1a24);
15898         MP_WritePhyUshort(sc, 0x19, 0x7d00);
15899         MP_WritePhyUshort(sc, 0x18, 0x1a64);
15900         MP_WritePhyUshort(sc, 0x19, 0x0500);
15901         MP_WritePhyUshort(sc, 0x18, 0x1a74);
15902         MP_WritePhyUshort(sc, 0x19, 0x9500);
15903         MP_WritePhyUshort(sc, 0x18, 0x1a84);
15904         MP_WritePhyUshort(sc, 0x19, 0x8000);
15905         MP_WritePhyUshort(sc, 0x18, 0x1a94);
15906         MP_WritePhyUshort(sc, 0x19, 0x7d00);
15907         MP_WritePhyUshort(sc, 0x18, 0x1aa4);
15908         MP_WritePhyUshort(sc, 0x19, 0x9600);
15909         MP_WritePhyUshort(sc, 0x18, 0x1ac4);
15910         MP_WritePhyUshort(sc, 0x19, 0x4000);
15911         MP_WritePhyUshort(sc, 0x18, 0x1ad4);
15912         MP_WritePhyUshort(sc, 0x19, 0x0800);
15913         MP_WritePhyUshort(sc, 0x18, 0x1af4);
15914         MP_WritePhyUshort(sc, 0x19, 0xc400);
15915         MP_WritePhyUshort(sc, 0x18, 0x1b04);
15916         MP_WritePhyUshort(sc, 0x19, 0x4000);
15917         MP_WritePhyUshort(sc, 0x18, 0x1b14);
15918         MP_WritePhyUshort(sc, 0x19, 0x0800);
15919         MP_WritePhyUshort(sc, 0x18, 0x1b24);
15920         MP_WritePhyUshort(sc, 0x19, 0xfd00);
15921         MP_WritePhyUshort(sc, 0x18, 0x1b34);
15922         MP_WritePhyUshort(sc, 0x19, 0x4000);
15923         MP_WritePhyUshort(sc, 0x18, 0x1b44);
15924         MP_WritePhyUshort(sc, 0x19, 0x0400);
15925         MP_WritePhyUshort(sc, 0x18, 0x1b94);
15926         MP_WritePhyUshort(sc, 0x19, 0xf100);
15927         MP_WritePhyUshort(sc, 0x1f, 0x0000);
15928         MP_WritePhyUshort(sc, 0x17, 0x2100);
15929         MP_WritePhyUshort(sc, 0x1f, 0x0007);
15930         MP_WritePhyUshort(sc, 0x1e, 0x0040);
15931         MP_WritePhyUshort(sc, 0x18, 0x0000);
15932         MP_WritePhyUshort(sc, 0x1f, 0x0000);
15933         MP_WritePhyUshort(sc, 0x1f, 0x0005);
15934         MP_WritePhyUshort(sc, 0x05, 0xfff6);
15935         MP_WritePhyUshort(sc, 0x06, 0x0080);
15936         MP_WritePhyUshort(sc, 0x05, 0x8000);
15937         MP_WritePhyUshort(sc, 0x06, 0x0280);
15938         MP_WritePhyUshort(sc, 0x06, 0x48f7);
15939         MP_WritePhyUshort(sc, 0x06, 0x00e0);
15940         MP_WritePhyUshort(sc, 0x06, 0xfff7);
15941         MP_WritePhyUshort(sc, 0x06, 0xa080);
15942         MP_WritePhyUshort(sc, 0x06, 0x02ae);
15943         MP_WritePhyUshort(sc, 0x06, 0xf602);
15944         MP_WritePhyUshort(sc, 0x06, 0x0115);
15945         MP_WritePhyUshort(sc, 0x06, 0x0201);
15946         MP_WritePhyUshort(sc, 0x06, 0x2202);
15947         MP_WritePhyUshort(sc, 0x06, 0x80a0);
15948         MP_WritePhyUshort(sc, 0x06, 0x0201);
15949         MP_WritePhyUshort(sc, 0x06, 0x3f02);
15950         MP_WritePhyUshort(sc, 0x06, 0x0159);
15951         MP_WritePhyUshort(sc, 0x06, 0x0280);
15952         MP_WritePhyUshort(sc, 0x06, 0xbd02);
15953         MP_WritePhyUshort(sc, 0x06, 0x80da);
15954         MP_WritePhyUshort(sc, 0x06, 0xe08b);
15955         MP_WritePhyUshort(sc, 0x06, 0x88e1);
15956         MP_WritePhyUshort(sc, 0x06, 0x8b89);
15957         MP_WritePhyUshort(sc, 0x06, 0x1e01);
15958         MP_WritePhyUshort(sc, 0x06, 0xe18b);
15959         MP_WritePhyUshort(sc, 0x06, 0x8a1e);
15960         MP_WritePhyUshort(sc, 0x06, 0x01e1);
15961         MP_WritePhyUshort(sc, 0x06, 0x8b8b);
15962         MP_WritePhyUshort(sc, 0x06, 0x1e01);
15963         MP_WritePhyUshort(sc, 0x06, 0xe18b);
15964         MP_WritePhyUshort(sc, 0x06, 0x8c1e);
15965         MP_WritePhyUshort(sc, 0x06, 0x01e1);
15966         MP_WritePhyUshort(sc, 0x06, 0x8b8d);
15967         MP_WritePhyUshort(sc, 0x06, 0x1e01);
15968         MP_WritePhyUshort(sc, 0x06, 0xe18b);
15969         MP_WritePhyUshort(sc, 0x06, 0x8e1e);
15970         MP_WritePhyUshort(sc, 0x06, 0x01a0);
15971         MP_WritePhyUshort(sc, 0x06, 0x00c7);
15972         MP_WritePhyUshort(sc, 0x06, 0xaebb);
15973         MP_WritePhyUshort(sc, 0x06, 0xd481);
15974         MP_WritePhyUshort(sc, 0x06, 0xd2e4);
15975         MP_WritePhyUshort(sc, 0x06, 0x8b92);
15976         MP_WritePhyUshort(sc, 0x06, 0xe58b);
15977         MP_WritePhyUshort(sc, 0x06, 0x93d1);
15978         MP_WritePhyUshort(sc, 0x06, 0x03bf);
15979         MP_WritePhyUshort(sc, 0x06, 0x859e);
15980         MP_WritePhyUshort(sc, 0x06, 0x0237);
15981         MP_WritePhyUshort(sc, 0x06, 0x23d1);
15982         MP_WritePhyUshort(sc, 0x06, 0x02bf);
15983         MP_WritePhyUshort(sc, 0x06, 0x85a1);
15984         MP_WritePhyUshort(sc, 0x06, 0x0237);
15985         MP_WritePhyUshort(sc, 0x06, 0x23ee);
15986         MP_WritePhyUshort(sc, 0x06, 0x8608);
15987         MP_WritePhyUshort(sc, 0x06, 0x03ee);
15988         MP_WritePhyUshort(sc, 0x06, 0x860a);
15989         MP_WritePhyUshort(sc, 0x06, 0x60ee);
15990         MP_WritePhyUshort(sc, 0x06, 0x8610);
15991         MP_WritePhyUshort(sc, 0x06, 0x00ee);
15992         MP_WritePhyUshort(sc, 0x06, 0x8611);
15993         MP_WritePhyUshort(sc, 0x06, 0x00ee);
15994         MP_WritePhyUshort(sc, 0x06, 0x8abe);
15995         MP_WritePhyUshort(sc, 0x06, 0x07ee);
15996         MP_WritePhyUshort(sc, 0x06, 0x8abf);
15997         MP_WritePhyUshort(sc, 0x06, 0x73ee);
15998         MP_WritePhyUshort(sc, 0x06, 0x8a95);
15999         MP_WritePhyUshort(sc, 0x06, 0x02bf);
16000         MP_WritePhyUshort(sc, 0x06, 0x8b88);
16001         MP_WritePhyUshort(sc, 0x06, 0xec00);
16002         MP_WritePhyUshort(sc, 0x06, 0x19a9);
16003         MP_WritePhyUshort(sc, 0x06, 0x8b90);
16004         MP_WritePhyUshort(sc, 0x06, 0xf9ee);
16005         MP_WritePhyUshort(sc, 0x06, 0xfff6);
16006         MP_WritePhyUshort(sc, 0x06, 0x00ee);
16007         MP_WritePhyUshort(sc, 0x06, 0xfff7);
16008         MP_WritePhyUshort(sc, 0x06, 0xfed1);
16009         MP_WritePhyUshort(sc, 0x06, 0x00bf);
16010         MP_WritePhyUshort(sc, 0x06, 0x8595);
16011         MP_WritePhyUshort(sc, 0x06, 0x0237);
16012         MP_WritePhyUshort(sc, 0x06, 0x23d1);
16013         MP_WritePhyUshort(sc, 0x06, 0x01bf);
16014         MP_WritePhyUshort(sc, 0x06, 0x8598);
16015         MP_WritePhyUshort(sc, 0x06, 0x0237);
16016         MP_WritePhyUshort(sc, 0x06, 0x2304);
16017         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
16018         MP_WritePhyUshort(sc, 0x06, 0x8b8a);
16019         MP_WritePhyUshort(sc, 0x06, 0xad20);
16020         MP_WritePhyUshort(sc, 0x06, 0x14ee);
16021         MP_WritePhyUshort(sc, 0x06, 0x8b8a);
16022         MP_WritePhyUshort(sc, 0x06, 0x0002);
16023         MP_WritePhyUshort(sc, 0x06, 0x1f9a);
16024         MP_WritePhyUshort(sc, 0x06, 0xe0e4);
16025         MP_WritePhyUshort(sc, 0x06, 0x26e1);
16026         MP_WritePhyUshort(sc, 0x06, 0xe427);
16027         MP_WritePhyUshort(sc, 0x06, 0xeee4);
16028         MP_WritePhyUshort(sc, 0x06, 0x2623);
16029         MP_WritePhyUshort(sc, 0x06, 0xe5e4);
16030         MP_WritePhyUshort(sc, 0x06, 0x27fc);
16031         MP_WritePhyUshort(sc, 0x06, 0x04f8);
16032         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16033         MP_WritePhyUshort(sc, 0x06, 0x8dad);
16034         MP_WritePhyUshort(sc, 0x06, 0x2014);
16035         MP_WritePhyUshort(sc, 0x06, 0xee8b);
16036         MP_WritePhyUshort(sc, 0x06, 0x8d00);
16037         MP_WritePhyUshort(sc, 0x06, 0xe08a);
16038         MP_WritePhyUshort(sc, 0x06, 0x5a78);
16039         MP_WritePhyUshort(sc, 0x06, 0x039e);
16040         MP_WritePhyUshort(sc, 0x06, 0x0902);
16041         MP_WritePhyUshort(sc, 0x06, 0x05db);
16042         MP_WritePhyUshort(sc, 0x06, 0x0282);
16043         MP_WritePhyUshort(sc, 0x06, 0x7b02);
16044         MP_WritePhyUshort(sc, 0x06, 0x3231);
16045         MP_WritePhyUshort(sc, 0x06, 0xfc04);
16046         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
16047         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16048         MP_WritePhyUshort(sc, 0x06, 0xad20);
16049         MP_WritePhyUshort(sc, 0x06, 0x1df6);
16050         MP_WritePhyUshort(sc, 0x06, 0x20e4);
16051         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16052         MP_WritePhyUshort(sc, 0x06, 0x0281);
16053         MP_WritePhyUshort(sc, 0x06, 0x5c02);
16054         MP_WritePhyUshort(sc, 0x06, 0x2bcb);
16055         MP_WritePhyUshort(sc, 0x06, 0x022d);
16056         MP_WritePhyUshort(sc, 0x06, 0x2902);
16057         MP_WritePhyUshort(sc, 0x06, 0x03b4);
16058         MP_WritePhyUshort(sc, 0x06, 0x0285);
16059         MP_WritePhyUshort(sc, 0x06, 0x6402);
16060         MP_WritePhyUshort(sc, 0x06, 0x2eca);
16061         MP_WritePhyUshort(sc, 0x06, 0x0284);
16062         MP_WritePhyUshort(sc, 0x06, 0xcd02);
16063         MP_WritePhyUshort(sc, 0x06, 0x046f);
16064         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16065         MP_WritePhyUshort(sc, 0x06, 0x8ead);
16066         MP_WritePhyUshort(sc, 0x06, 0x210b);
16067         MP_WritePhyUshort(sc, 0x06, 0xf621);
16068         MP_WritePhyUshort(sc, 0x06, 0xe48b);
16069         MP_WritePhyUshort(sc, 0x06, 0x8e02);
16070         MP_WritePhyUshort(sc, 0x06, 0x8520);
16071         MP_WritePhyUshort(sc, 0x06, 0x021b);
16072         MP_WritePhyUshort(sc, 0x06, 0xe8e0);
16073         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16074         MP_WritePhyUshort(sc, 0x06, 0xad22);
16075         MP_WritePhyUshort(sc, 0x06, 0x05f6);
16076         MP_WritePhyUshort(sc, 0x06, 0x22e4);
16077         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16078         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16079         MP_WritePhyUshort(sc, 0x06, 0x8ead);
16080         MP_WritePhyUshort(sc, 0x06, 0x2308);
16081         MP_WritePhyUshort(sc, 0x06, 0xf623);
16082         MP_WritePhyUshort(sc, 0x06, 0xe48b);
16083         MP_WritePhyUshort(sc, 0x06, 0x8e02);
16084         MP_WritePhyUshort(sc, 0x06, 0x311c);
16085         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16086         MP_WritePhyUshort(sc, 0x06, 0x8ead);
16087         MP_WritePhyUshort(sc, 0x06, 0x2405);
16088         MP_WritePhyUshort(sc, 0x06, 0xf624);
16089         MP_WritePhyUshort(sc, 0x06, 0xe48b);
16090         MP_WritePhyUshort(sc, 0x06, 0x8ee0);
16091         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16092         MP_WritePhyUshort(sc, 0x06, 0xad25);
16093         MP_WritePhyUshort(sc, 0x06, 0x05f6);
16094         MP_WritePhyUshort(sc, 0x06, 0x25e4);
16095         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16096         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16097         MP_WritePhyUshort(sc, 0x06, 0x8ead);
16098         MP_WritePhyUshort(sc, 0x06, 0x2608);
16099         MP_WritePhyUshort(sc, 0x06, 0xf626);
16100         MP_WritePhyUshort(sc, 0x06, 0xe48b);
16101         MP_WritePhyUshort(sc, 0x06, 0x8e02);
16102         MP_WritePhyUshort(sc, 0x06, 0x2df5);
16103         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16104         MP_WritePhyUshort(sc, 0x06, 0x8ead);
16105         MP_WritePhyUshort(sc, 0x06, 0x2705);
16106         MP_WritePhyUshort(sc, 0x06, 0xf627);
16107         MP_WritePhyUshort(sc, 0x06, 0xe48b);
16108         MP_WritePhyUshort(sc, 0x06, 0x8e02);
16109         MP_WritePhyUshort(sc, 0x06, 0x037a);
16110         MP_WritePhyUshort(sc, 0x06, 0xfc04);
16111         MP_WritePhyUshort(sc, 0x06, 0xf8f9);
16112         MP_WritePhyUshort(sc, 0x06, 0xfaef);
16113         MP_WritePhyUshort(sc, 0x06, 0x69e0);
16114         MP_WritePhyUshort(sc, 0x06, 0x8b87);
16115         MP_WritePhyUshort(sc, 0x06, 0xad20);
16116         MP_WritePhyUshort(sc, 0x06, 0x65d2);
16117         MP_WritePhyUshort(sc, 0x06, 0x00bf);
16118         MP_WritePhyUshort(sc, 0x06, 0x2fe9);
16119         MP_WritePhyUshort(sc, 0x06, 0x0236);
16120         MP_WritePhyUshort(sc, 0x06, 0xf61e);
16121         MP_WritePhyUshort(sc, 0x06, 0x21bf);
16122         MP_WritePhyUshort(sc, 0x06, 0x2ff5);
16123         MP_WritePhyUshort(sc, 0x06, 0x0236);
16124         MP_WritePhyUshort(sc, 0x06, 0xf60c);
16125         MP_WritePhyUshort(sc, 0x06, 0x111e);
16126         MP_WritePhyUshort(sc, 0x06, 0x21bf);
16127         MP_WritePhyUshort(sc, 0x06, 0x2ff8);
16128         MP_WritePhyUshort(sc, 0x06, 0x0236);
16129         MP_WritePhyUshort(sc, 0x06, 0xf60c);
16130         MP_WritePhyUshort(sc, 0x06, 0x121e);
16131         MP_WritePhyUshort(sc, 0x06, 0x21bf);
16132         MP_WritePhyUshort(sc, 0x06, 0x2ffb);
16133         MP_WritePhyUshort(sc, 0x06, 0x0236);
16134         MP_WritePhyUshort(sc, 0x06, 0xf60c);
16135         MP_WritePhyUshort(sc, 0x06, 0x131e);
16136         MP_WritePhyUshort(sc, 0x06, 0x21bf);
16137         MP_WritePhyUshort(sc, 0x06, 0x1f97);
16138         MP_WritePhyUshort(sc, 0x06, 0x0236);
16139         MP_WritePhyUshort(sc, 0x06, 0xf60c);
16140         MP_WritePhyUshort(sc, 0x06, 0x141e);
16141         MP_WritePhyUshort(sc, 0x06, 0x21bf);
16142         MP_WritePhyUshort(sc, 0x06, 0x859b);
16143         MP_WritePhyUshort(sc, 0x06, 0x0236);
16144         MP_WritePhyUshort(sc, 0x06, 0xf60c);
16145         MP_WritePhyUshort(sc, 0x06, 0x161e);
16146         MP_WritePhyUshort(sc, 0x06, 0x21e0);
16147         MP_WritePhyUshort(sc, 0x06, 0x8a8c);
16148         MP_WritePhyUshort(sc, 0x06, 0x1f02);
16149         MP_WritePhyUshort(sc, 0x06, 0x9e22);
16150         MP_WritePhyUshort(sc, 0x06, 0xe68a);
16151         MP_WritePhyUshort(sc, 0x06, 0x8cad);
16152         MP_WritePhyUshort(sc, 0x06, 0x3114);
16153         MP_WritePhyUshort(sc, 0x06, 0xad30);
16154         MP_WritePhyUshort(sc, 0x06, 0x11ef);
16155         MP_WritePhyUshort(sc, 0x06, 0x0258);
16156         MP_WritePhyUshort(sc, 0x06, 0x0c9e);
16157         MP_WritePhyUshort(sc, 0x06, 0x07ad);
16158         MP_WritePhyUshort(sc, 0x06, 0x3608);
16159         MP_WritePhyUshort(sc, 0x06, 0x5a30);
16160         MP_WritePhyUshort(sc, 0x06, 0x9f04);
16161         MP_WritePhyUshort(sc, 0x06, 0xd101);
16162         MP_WritePhyUshort(sc, 0x06, 0xae02);
16163         MP_WritePhyUshort(sc, 0x06, 0xd100);
16164         MP_WritePhyUshort(sc, 0x06, 0xbf2f);
16165         MP_WritePhyUshort(sc, 0x06, 0xf202);
16166         MP_WritePhyUshort(sc, 0x06, 0x3723);
16167         MP_WritePhyUshort(sc, 0x06, 0xef96);
16168         MP_WritePhyUshort(sc, 0x06, 0xfefd);
16169         MP_WritePhyUshort(sc, 0x06, 0xfc04);
16170         MP_WritePhyUshort(sc, 0x06, 0xf8f9);
16171         MP_WritePhyUshort(sc, 0x06, 0xface);
16172         MP_WritePhyUshort(sc, 0x06, 0xfaef);
16173         MP_WritePhyUshort(sc, 0x06, 0x69fa);
16174         MP_WritePhyUshort(sc, 0x06, 0xd401);
16175         MP_WritePhyUshort(sc, 0x06, 0x55b4);
16176         MP_WritePhyUshort(sc, 0x06, 0xfebf);
16177         MP_WritePhyUshort(sc, 0x06, 0x85a7);
16178         MP_WritePhyUshort(sc, 0x06, 0x0236);
16179         MP_WritePhyUshort(sc, 0x06, 0xf6ac);
16180         MP_WritePhyUshort(sc, 0x06, 0x280b);
16181         MP_WritePhyUshort(sc, 0x06, 0xbf85);
16182         MP_WritePhyUshort(sc, 0x06, 0xa402);
16183         MP_WritePhyUshort(sc, 0x06, 0x36f6);
16184         MP_WritePhyUshort(sc, 0x06, 0xac28);
16185         MP_WritePhyUshort(sc, 0x06, 0x49ae);
16186         MP_WritePhyUshort(sc, 0x06, 0x64bf);
16187         MP_WritePhyUshort(sc, 0x06, 0x85a4);
16188         MP_WritePhyUshort(sc, 0x06, 0x0236);
16189         MP_WritePhyUshort(sc, 0x06, 0xf6ac);
16190         MP_WritePhyUshort(sc, 0x06, 0x285b);
16191         MP_WritePhyUshort(sc, 0x06, 0xd000);
16192         MP_WritePhyUshort(sc, 0x06, 0x0282);
16193         MP_WritePhyUshort(sc, 0x06, 0x60ac);
16194         MP_WritePhyUshort(sc, 0x06, 0x2105);
16195         MP_WritePhyUshort(sc, 0x06, 0xac22);
16196         MP_WritePhyUshort(sc, 0x06, 0x02ae);
16197         MP_WritePhyUshort(sc, 0x06, 0x4ebf);
16198         MP_WritePhyUshort(sc, 0x06, 0xe0c4);
16199         MP_WritePhyUshort(sc, 0x06, 0xbe86);
16200         MP_WritePhyUshort(sc, 0x06, 0x14d2);
16201         MP_WritePhyUshort(sc, 0x06, 0x04d8);
16202         MP_WritePhyUshort(sc, 0x06, 0x19d9);
16203         MP_WritePhyUshort(sc, 0x06, 0x1907);
16204         MP_WritePhyUshort(sc, 0x06, 0xdc19);
16205         MP_WritePhyUshort(sc, 0x06, 0xdd19);
16206         MP_WritePhyUshort(sc, 0x06, 0x0789);
16207         MP_WritePhyUshort(sc, 0x06, 0x89ef);
16208         MP_WritePhyUshort(sc, 0x06, 0x645e);
16209         MP_WritePhyUshort(sc, 0x06, 0x07ff);
16210         MP_WritePhyUshort(sc, 0x06, 0x0d65);
16211         MP_WritePhyUshort(sc, 0x06, 0x5cf8);
16212         MP_WritePhyUshort(sc, 0x06, 0x001e);
16213         MP_WritePhyUshort(sc, 0x06, 0x46dc);
16214         MP_WritePhyUshort(sc, 0x06, 0x19dd);
16215         MP_WritePhyUshort(sc, 0x06, 0x19b2);
16216         MP_WritePhyUshort(sc, 0x06, 0xe2d4);
16217         MP_WritePhyUshort(sc, 0x06, 0x0001);
16218         MP_WritePhyUshort(sc, 0x06, 0xbf85);
16219         MP_WritePhyUshort(sc, 0x06, 0xa402);
16220         MP_WritePhyUshort(sc, 0x06, 0x3723);
16221         MP_WritePhyUshort(sc, 0x06, 0xae1d);
16222         MP_WritePhyUshort(sc, 0x06, 0xbee0);
16223         MP_WritePhyUshort(sc, 0x06, 0xc4bf);
16224         MP_WritePhyUshort(sc, 0x06, 0x8614);
16225         MP_WritePhyUshort(sc, 0x06, 0xd204);
16226         MP_WritePhyUshort(sc, 0x06, 0xd819);
16227         MP_WritePhyUshort(sc, 0x06, 0xd919);
16228         MP_WritePhyUshort(sc, 0x06, 0x07dc);
16229         MP_WritePhyUshort(sc, 0x06, 0x19dd);
16230         MP_WritePhyUshort(sc, 0x06, 0x1907);
16231         MP_WritePhyUshort(sc, 0x06, 0xb2f4);
16232         MP_WritePhyUshort(sc, 0x06, 0xd400);
16233         MP_WritePhyUshort(sc, 0x06, 0x00bf);
16234         MP_WritePhyUshort(sc, 0x06, 0x85a4);
16235         MP_WritePhyUshort(sc, 0x06, 0x0237);
16236         MP_WritePhyUshort(sc, 0x06, 0x23fe);
16237         MP_WritePhyUshort(sc, 0x06, 0xef96);
16238         MP_WritePhyUshort(sc, 0x06, 0xfec6);
16239         MP_WritePhyUshort(sc, 0x06, 0xfefd);
16240         MP_WritePhyUshort(sc, 0x06, 0xfc05);
16241         MP_WritePhyUshort(sc, 0x06, 0xf9e2);
16242         MP_WritePhyUshort(sc, 0x06, 0xe0ea);
16243         MP_WritePhyUshort(sc, 0x06, 0xe3e0);
16244         MP_WritePhyUshort(sc, 0x06, 0xeb5a);
16245         MP_WritePhyUshort(sc, 0x06, 0x070c);
16246         MP_WritePhyUshort(sc, 0x06, 0x031e);
16247         MP_WritePhyUshort(sc, 0x06, 0x20e6);
16248         MP_WritePhyUshort(sc, 0x06, 0xe0ea);
16249         MP_WritePhyUshort(sc, 0x06, 0xe7e0);
16250         MP_WritePhyUshort(sc, 0x06, 0xebe0);
16251         MP_WritePhyUshort(sc, 0x06, 0xe0fc);
16252         MP_WritePhyUshort(sc, 0x06, 0xe1e0);
16253         MP_WritePhyUshort(sc, 0x06, 0xfdfd);
16254         MP_WritePhyUshort(sc, 0x06, 0x04f8);
16255         MP_WritePhyUshort(sc, 0x06, 0xf9e0);
16256         MP_WritePhyUshort(sc, 0x06, 0x8b81);
16257         MP_WritePhyUshort(sc, 0x06, 0xac26);
16258         MP_WritePhyUshort(sc, 0x06, 0x1ae0);
16259         MP_WritePhyUshort(sc, 0x06, 0x8b81);
16260         MP_WritePhyUshort(sc, 0x06, 0xac21);
16261         MP_WritePhyUshort(sc, 0x06, 0x14e0);
16262         MP_WritePhyUshort(sc, 0x06, 0x8b85);
16263         MP_WritePhyUshort(sc, 0x06, 0xac20);
16264         MP_WritePhyUshort(sc, 0x06, 0x0ee0);
16265         MP_WritePhyUshort(sc, 0x06, 0x8b85);
16266         MP_WritePhyUshort(sc, 0x06, 0xac23);
16267         MP_WritePhyUshort(sc, 0x06, 0x08e0);
16268         MP_WritePhyUshort(sc, 0x06, 0x8b87);
16269         MP_WritePhyUshort(sc, 0x06, 0xac24);
16270         MP_WritePhyUshort(sc, 0x06, 0x02ae);
16271         MP_WritePhyUshort(sc, 0x06, 0x3802);
16272         MP_WritePhyUshort(sc, 0x06, 0x1ab5);
16273         MP_WritePhyUshort(sc, 0x06, 0xeee4);
16274         MP_WritePhyUshort(sc, 0x06, 0x1c04);
16275         MP_WritePhyUshort(sc, 0x06, 0xeee4);
16276         MP_WritePhyUshort(sc, 0x06, 0x1d04);
16277         MP_WritePhyUshort(sc, 0x06, 0xe2e0);
16278         MP_WritePhyUshort(sc, 0x06, 0x7ce3);
16279         MP_WritePhyUshort(sc, 0x06, 0xe07d);
16280         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
16281         MP_WritePhyUshort(sc, 0x06, 0x38e1);
16282         MP_WritePhyUshort(sc, 0x06, 0xe039);
16283         MP_WritePhyUshort(sc, 0x06, 0xad2e);
16284         MP_WritePhyUshort(sc, 0x06, 0x1bad);
16285         MP_WritePhyUshort(sc, 0x06, 0x390d);
16286         MP_WritePhyUshort(sc, 0x06, 0xd101);
16287         MP_WritePhyUshort(sc, 0x06, 0xbf21);
16288         MP_WritePhyUshort(sc, 0x06, 0xd502);
16289         MP_WritePhyUshort(sc, 0x06, 0x3723);
16290         MP_WritePhyUshort(sc, 0x06, 0x0282);
16291         MP_WritePhyUshort(sc, 0x06, 0xd8ae);
16292         MP_WritePhyUshort(sc, 0x06, 0x0bac);
16293         MP_WritePhyUshort(sc, 0x06, 0x3802);
16294         MP_WritePhyUshort(sc, 0x06, 0xae06);
16295         MP_WritePhyUshort(sc, 0x06, 0x0283);
16296         MP_WritePhyUshort(sc, 0x06, 0x1802);
16297         MP_WritePhyUshort(sc, 0x06, 0x8360);
16298         MP_WritePhyUshort(sc, 0x06, 0x021a);
16299         MP_WritePhyUshort(sc, 0x06, 0xc6fd);
16300         MP_WritePhyUshort(sc, 0x06, 0xfc04);
16301         MP_WritePhyUshort(sc, 0x06, 0xf8e1);
16302         MP_WritePhyUshort(sc, 0x06, 0x8af4);
16303         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16304         MP_WritePhyUshort(sc, 0x06, 0x81ad);
16305         MP_WritePhyUshort(sc, 0x06, 0x2605);
16306         MP_WritePhyUshort(sc, 0x06, 0x0222);
16307         MP_WritePhyUshort(sc, 0x06, 0xa4f7);
16308         MP_WritePhyUshort(sc, 0x06, 0x28e0);
16309         MP_WritePhyUshort(sc, 0x06, 0x8b81);
16310         MP_WritePhyUshort(sc, 0x06, 0xad21);
16311         MP_WritePhyUshort(sc, 0x06, 0x0502);
16312         MP_WritePhyUshort(sc, 0x06, 0x23a9);
16313         MP_WritePhyUshort(sc, 0x06, 0xf729);
16314         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16315         MP_WritePhyUshort(sc, 0x06, 0x85ad);
16316         MP_WritePhyUshort(sc, 0x06, 0x2005);
16317         MP_WritePhyUshort(sc, 0x06, 0x0214);
16318         MP_WritePhyUshort(sc, 0x06, 0xabf7);
16319         MP_WritePhyUshort(sc, 0x06, 0x2ae0);
16320         MP_WritePhyUshort(sc, 0x06, 0x8b85);
16321         MP_WritePhyUshort(sc, 0x06, 0xad23);
16322         MP_WritePhyUshort(sc, 0x06, 0x0502);
16323         MP_WritePhyUshort(sc, 0x06, 0x12e7);
16324         MP_WritePhyUshort(sc, 0x06, 0xf72b);
16325         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16326         MP_WritePhyUshort(sc, 0x06, 0x87ad);
16327         MP_WritePhyUshort(sc, 0x06, 0x2405);
16328         MP_WritePhyUshort(sc, 0x06, 0x0283);
16329         MP_WritePhyUshort(sc, 0x06, 0xbcf7);
16330         MP_WritePhyUshort(sc, 0x06, 0x2ce5);
16331         MP_WritePhyUshort(sc, 0x06, 0x8af4);
16332         MP_WritePhyUshort(sc, 0x06, 0xfc04);
16333         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
16334         MP_WritePhyUshort(sc, 0x06, 0x8b81);
16335         MP_WritePhyUshort(sc, 0x06, 0xad26);
16336         MP_WritePhyUshort(sc, 0x06, 0x0302);
16337         MP_WritePhyUshort(sc, 0x06, 0x21e5);
16338         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16339         MP_WritePhyUshort(sc, 0x06, 0x81ad);
16340         MP_WritePhyUshort(sc, 0x06, 0x2109);
16341         MP_WritePhyUshort(sc, 0x06, 0xe08a);
16342         MP_WritePhyUshort(sc, 0x06, 0xf4ac);
16343         MP_WritePhyUshort(sc, 0x06, 0x2003);
16344         MP_WritePhyUshort(sc, 0x06, 0x0223);
16345         MP_WritePhyUshort(sc, 0x06, 0x98e0);
16346         MP_WritePhyUshort(sc, 0x06, 0x8b85);
16347         MP_WritePhyUshort(sc, 0x06, 0xad20);
16348         MP_WritePhyUshort(sc, 0x06, 0x09e0);
16349         MP_WritePhyUshort(sc, 0x06, 0x8af4);
16350         MP_WritePhyUshort(sc, 0x06, 0xac21);
16351         MP_WritePhyUshort(sc, 0x06, 0x0302);
16352         MP_WritePhyUshort(sc, 0x06, 0x13fb);
16353         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16354         MP_WritePhyUshort(sc, 0x06, 0x85ad);
16355         MP_WritePhyUshort(sc, 0x06, 0x2309);
16356         MP_WritePhyUshort(sc, 0x06, 0xe08a);
16357         MP_WritePhyUshort(sc, 0x06, 0xf4ac);
16358         MP_WritePhyUshort(sc, 0x06, 0x2203);
16359         MP_WritePhyUshort(sc, 0x06, 0x0212);
16360         MP_WritePhyUshort(sc, 0x06, 0xfae0);
16361         MP_WritePhyUshort(sc, 0x06, 0x8b87);
16362         MP_WritePhyUshort(sc, 0x06, 0xad24);
16363         MP_WritePhyUshort(sc, 0x06, 0x09e0);
16364         MP_WritePhyUshort(sc, 0x06, 0x8af4);
16365         MP_WritePhyUshort(sc, 0x06, 0xac23);
16366         MP_WritePhyUshort(sc, 0x06, 0x0302);
16367         MP_WritePhyUshort(sc, 0x06, 0x83c1);
16368         MP_WritePhyUshort(sc, 0x06, 0xfc04);
16369         MP_WritePhyUshort(sc, 0x06, 0xf8e1);
16370         MP_WritePhyUshort(sc, 0x06, 0x8af4);
16371         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16372         MP_WritePhyUshort(sc, 0x06, 0x81ad);
16373         MP_WritePhyUshort(sc, 0x06, 0x2608);
16374         MP_WritePhyUshort(sc, 0x06, 0xe083);
16375         MP_WritePhyUshort(sc, 0x06, 0xd2ad);
16376         MP_WritePhyUshort(sc, 0x06, 0x2502);
16377         MP_WritePhyUshort(sc, 0x06, 0xf628);
16378         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16379         MP_WritePhyUshort(sc, 0x06, 0x81ad);
16380         MP_WritePhyUshort(sc, 0x06, 0x210a);
16381         MP_WritePhyUshort(sc, 0x06, 0xe084);
16382         MP_WritePhyUshort(sc, 0x06, 0x0af6);
16383         MP_WritePhyUshort(sc, 0x06, 0x27a0);
16384         MP_WritePhyUshort(sc, 0x06, 0x0502);
16385         MP_WritePhyUshort(sc, 0x06, 0xf629);
16386         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16387         MP_WritePhyUshort(sc, 0x06, 0x85ad);
16388         MP_WritePhyUshort(sc, 0x06, 0x2008);
16389         MP_WritePhyUshort(sc, 0x06, 0xe08a);
16390         MP_WritePhyUshort(sc, 0x06, 0xe8ad);
16391         MP_WritePhyUshort(sc, 0x06, 0x2102);
16392         MP_WritePhyUshort(sc, 0x06, 0xf62a);
16393         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16394         MP_WritePhyUshort(sc, 0x06, 0x85ad);
16395         MP_WritePhyUshort(sc, 0x06, 0x2308);
16396         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16397         MP_WritePhyUshort(sc, 0x06, 0x20a0);
16398         MP_WritePhyUshort(sc, 0x06, 0x0302);
16399         MP_WritePhyUshort(sc, 0x06, 0xf62b);
16400         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16401         MP_WritePhyUshort(sc, 0x06, 0x87ad);
16402         MP_WritePhyUshort(sc, 0x06, 0x2408);
16403         MP_WritePhyUshort(sc, 0x06, 0xe086);
16404         MP_WritePhyUshort(sc, 0x06, 0x02a0);
16405         MP_WritePhyUshort(sc, 0x06, 0x0302);
16406         MP_WritePhyUshort(sc, 0x06, 0xf62c);
16407         MP_WritePhyUshort(sc, 0x06, 0xe58a);
16408         MP_WritePhyUshort(sc, 0x06, 0xf4a1);
16409         MP_WritePhyUshort(sc, 0x06, 0x0008);
16410         MP_WritePhyUshort(sc, 0x06, 0xd100);
16411         MP_WritePhyUshort(sc, 0x06, 0xbf21);
16412         MP_WritePhyUshort(sc, 0x06, 0xd502);
16413         MP_WritePhyUshort(sc, 0x06, 0x3723);
16414         MP_WritePhyUshort(sc, 0x06, 0xfc04);
16415         MP_WritePhyUshort(sc, 0x06, 0xee86);
16416         MP_WritePhyUshort(sc, 0x06, 0x0200);
16417         MP_WritePhyUshort(sc, 0x06, 0x04f8);
16418         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16419         MP_WritePhyUshort(sc, 0x06, 0x87ad);
16420         MP_WritePhyUshort(sc, 0x06, 0x241e);
16421         MP_WritePhyUshort(sc, 0x06, 0xe086);
16422         MP_WritePhyUshort(sc, 0x06, 0x02a0);
16423         MP_WritePhyUshort(sc, 0x06, 0x0005);
16424         MP_WritePhyUshort(sc, 0x06, 0x0283);
16425         MP_WritePhyUshort(sc, 0x06, 0xe8ae);
16426         MP_WritePhyUshort(sc, 0x06, 0xf5a0);
16427         MP_WritePhyUshort(sc, 0x06, 0x0105);
16428         MP_WritePhyUshort(sc, 0x06, 0x0283);
16429         MP_WritePhyUshort(sc, 0x06, 0xf8ae);
16430         MP_WritePhyUshort(sc, 0x06, 0x0ba0);
16431         MP_WritePhyUshort(sc, 0x06, 0x0205);
16432         MP_WritePhyUshort(sc, 0x06, 0x0284);
16433         MP_WritePhyUshort(sc, 0x06, 0x14ae);
16434         MP_WritePhyUshort(sc, 0x06, 0x03a0);
16435         MP_WritePhyUshort(sc, 0x06, 0x0300);
16436         MP_WritePhyUshort(sc, 0x06, 0xfc04);
16437         MP_WritePhyUshort(sc, 0x06, 0xf8fa);
16438         MP_WritePhyUshort(sc, 0x06, 0xef69);
16439         MP_WritePhyUshort(sc, 0x06, 0x0284);
16440         MP_WritePhyUshort(sc, 0x06, 0x2bee);
16441         MP_WritePhyUshort(sc, 0x06, 0x8602);
16442         MP_WritePhyUshort(sc, 0x06, 0x01ef);
16443         MP_WritePhyUshort(sc, 0x06, 0x96fe);
16444         MP_WritePhyUshort(sc, 0x06, 0xfc04);
16445         MP_WritePhyUshort(sc, 0x06, 0xf8ee);
16446         MP_WritePhyUshort(sc, 0x06, 0x8609);
16447         MP_WritePhyUshort(sc, 0x06, 0x0002);
16448         MP_WritePhyUshort(sc, 0x06, 0x8461);
16449         MP_WritePhyUshort(sc, 0x06, 0xfc04);
16450         MP_WritePhyUshort(sc, 0x06, 0xae10);
16451         MP_WritePhyUshort(sc, 0x06, 0x0000);
16452         MP_WritePhyUshort(sc, 0x06, 0x0000);
16453         MP_WritePhyUshort(sc, 0x06, 0x0000);
16454         MP_WritePhyUshort(sc, 0x06, 0x0000);
16455         MP_WritePhyUshort(sc, 0x06, 0x0000);
16456         MP_WritePhyUshort(sc, 0x06, 0x0000);
16457         MP_WritePhyUshort(sc, 0x06, 0x0000);
16458         MP_WritePhyUshort(sc, 0x06, 0x0000);
16459         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
16460         MP_WritePhyUshort(sc, 0x06, 0x8608);
16461         MP_WritePhyUshort(sc, 0x06, 0xe186);
16462         MP_WritePhyUshort(sc, 0x06, 0x091f);
16463         MP_WritePhyUshort(sc, 0x06, 0x019e);
16464         MP_WritePhyUshort(sc, 0x06, 0x0611);
16465         MP_WritePhyUshort(sc, 0x06, 0xe586);
16466         MP_WritePhyUshort(sc, 0x06, 0x09ae);
16467         MP_WritePhyUshort(sc, 0x06, 0x04ee);
16468         MP_WritePhyUshort(sc, 0x06, 0x8602);
16469         MP_WritePhyUshort(sc, 0x06, 0x01fc);
16470         MP_WritePhyUshort(sc, 0x06, 0x04f8);
16471         MP_WritePhyUshort(sc, 0x06, 0xf9fa);
16472         MP_WritePhyUshort(sc, 0x06, 0xef69);
16473         MP_WritePhyUshort(sc, 0x06, 0xfbbf);
16474         MP_WritePhyUshort(sc, 0x06, 0x8604);
16475         MP_WritePhyUshort(sc, 0x06, 0xef79);
16476         MP_WritePhyUshort(sc, 0x06, 0xd200);
16477         MP_WritePhyUshort(sc, 0x06, 0xd400);
16478         MP_WritePhyUshort(sc, 0x06, 0x221e);
16479         MP_WritePhyUshort(sc, 0x06, 0x02bf);
16480         MP_WritePhyUshort(sc, 0x06, 0x2fec);
16481         MP_WritePhyUshort(sc, 0x06, 0x0237);
16482         MP_WritePhyUshort(sc, 0x06, 0x23bf);
16483         MP_WritePhyUshort(sc, 0x06, 0x13f2);
16484         MP_WritePhyUshort(sc, 0x06, 0x0236);
16485         MP_WritePhyUshort(sc, 0x06, 0xf60d);
16486         MP_WritePhyUshort(sc, 0x06, 0x4559);
16487         MP_WritePhyUshort(sc, 0x06, 0x1fef);
16488         MP_WritePhyUshort(sc, 0x06, 0x97dd);
16489         MP_WritePhyUshort(sc, 0x06, 0xd308);
16490         MP_WritePhyUshort(sc, 0x06, 0x1a93);
16491         MP_WritePhyUshort(sc, 0x06, 0xdd12);
16492         MP_WritePhyUshort(sc, 0x06, 0x17a2);
16493         MP_WritePhyUshort(sc, 0x06, 0x04de);
16494         MP_WritePhyUshort(sc, 0x06, 0xffef);
16495         MP_WritePhyUshort(sc, 0x06, 0x96fe);
16496         MP_WritePhyUshort(sc, 0x06, 0xfdfc);
16497         MP_WritePhyUshort(sc, 0x06, 0x04f8);
16498         MP_WritePhyUshort(sc, 0x06, 0xf9fa);
16499         MP_WritePhyUshort(sc, 0x06, 0xef69);
16500         MP_WritePhyUshort(sc, 0x06, 0xfbee);
16501         MP_WritePhyUshort(sc, 0x06, 0x8602);
16502         MP_WritePhyUshort(sc, 0x06, 0x03d5);
16503         MP_WritePhyUshort(sc, 0x06, 0x0080);
16504         MP_WritePhyUshort(sc, 0x06, 0xbf86);
16505         MP_WritePhyUshort(sc, 0x06, 0x04ef);
16506         MP_WritePhyUshort(sc, 0x06, 0x79ef);
16507         MP_WritePhyUshort(sc, 0x06, 0x45bf);
16508         MP_WritePhyUshort(sc, 0x06, 0x2fec);
16509         MP_WritePhyUshort(sc, 0x06, 0x0237);
16510         MP_WritePhyUshort(sc, 0x06, 0x23bf);
16511         MP_WritePhyUshort(sc, 0x06, 0x13f2);
16512         MP_WritePhyUshort(sc, 0x06, 0x0236);
16513         MP_WritePhyUshort(sc, 0x06, 0xf6ad);
16514         MP_WritePhyUshort(sc, 0x06, 0x2702);
16515         MP_WritePhyUshort(sc, 0x06, 0x78ff);
16516         MP_WritePhyUshort(sc, 0x06, 0xe186);
16517         MP_WritePhyUshort(sc, 0x06, 0x0a1b);
16518         MP_WritePhyUshort(sc, 0x06, 0x01aa);
16519         MP_WritePhyUshort(sc, 0x06, 0x2eef);
16520         MP_WritePhyUshort(sc, 0x06, 0x97d9);
16521         MP_WritePhyUshort(sc, 0x06, 0x7900);
16522         MP_WritePhyUshort(sc, 0x06, 0x9e2b);
16523         MP_WritePhyUshort(sc, 0x06, 0x81dd);
16524         MP_WritePhyUshort(sc, 0x06, 0xbf85);
16525         MP_WritePhyUshort(sc, 0x06, 0xad02);
16526         MP_WritePhyUshort(sc, 0x06, 0x3723);
16527         MP_WritePhyUshort(sc, 0x06, 0xd101);
16528         MP_WritePhyUshort(sc, 0x06, 0xef02);
16529         MP_WritePhyUshort(sc, 0x06, 0x100c);
16530         MP_WritePhyUshort(sc, 0x06, 0x11b0);
16531         MP_WritePhyUshort(sc, 0x06, 0xfc0d);
16532         MP_WritePhyUshort(sc, 0x06, 0x11bf);
16533         MP_WritePhyUshort(sc, 0x06, 0x85aa);
16534         MP_WritePhyUshort(sc, 0x06, 0x0237);
16535         MP_WritePhyUshort(sc, 0x06, 0x23d1);
16536         MP_WritePhyUshort(sc, 0x06, 0x00bf);
16537         MP_WritePhyUshort(sc, 0x06, 0x85aa);
16538         MP_WritePhyUshort(sc, 0x06, 0x0237);
16539         MP_WritePhyUshort(sc, 0x06, 0x23ee);
16540         MP_WritePhyUshort(sc, 0x06, 0x8602);
16541         MP_WritePhyUshort(sc, 0x06, 0x02ae);
16542         MP_WritePhyUshort(sc, 0x06, 0x0413);
16543         MP_WritePhyUshort(sc, 0x06, 0xa38b);
16544         MP_WritePhyUshort(sc, 0x06, 0xb4d3);
16545         MP_WritePhyUshort(sc, 0x06, 0x8012);
16546         MP_WritePhyUshort(sc, 0x06, 0x17a2);
16547         MP_WritePhyUshort(sc, 0x06, 0x04ad);
16548         MP_WritePhyUshort(sc, 0x06, 0xffef);
16549         MP_WritePhyUshort(sc, 0x06, 0x96fe);
16550         MP_WritePhyUshort(sc, 0x06, 0xfdfc);
16551         MP_WritePhyUshort(sc, 0x06, 0x04f8);
16552         MP_WritePhyUshort(sc, 0x06, 0xf9e0);
16553         MP_WritePhyUshort(sc, 0x06, 0x8b85);
16554         MP_WritePhyUshort(sc, 0x06, 0xad25);
16555         MP_WritePhyUshort(sc, 0x06, 0x48e0);
16556         MP_WritePhyUshort(sc, 0x06, 0x8a96);
16557         MP_WritePhyUshort(sc, 0x06, 0xe18a);
16558         MP_WritePhyUshort(sc, 0x06, 0x977c);
16559         MP_WritePhyUshort(sc, 0x06, 0x0000);
16560         MP_WritePhyUshort(sc, 0x06, 0x9e35);
16561         MP_WritePhyUshort(sc, 0x06, 0xee8a);
16562         MP_WritePhyUshort(sc, 0x06, 0x9600);
16563         MP_WritePhyUshort(sc, 0x06, 0xee8a);
16564         MP_WritePhyUshort(sc, 0x06, 0x9700);
16565         MP_WritePhyUshort(sc, 0x06, 0xe08a);
16566         MP_WritePhyUshort(sc, 0x06, 0xbee1);
16567         MP_WritePhyUshort(sc, 0x06, 0x8abf);
16568         MP_WritePhyUshort(sc, 0x06, 0xe286);
16569         MP_WritePhyUshort(sc, 0x06, 0x10e3);
16570         MP_WritePhyUshort(sc, 0x06, 0x8611);
16571         MP_WritePhyUshort(sc, 0x06, 0x0236);
16572         MP_WritePhyUshort(sc, 0x06, 0x1aad);
16573         MP_WritePhyUshort(sc, 0x06, 0x2012);
16574         MP_WritePhyUshort(sc, 0x06, 0xee8a);
16575         MP_WritePhyUshort(sc, 0x06, 0x9603);
16576         MP_WritePhyUshort(sc, 0x06, 0xee8a);
16577         MP_WritePhyUshort(sc, 0x06, 0x97b7);
16578         MP_WritePhyUshort(sc, 0x06, 0xee86);
16579         MP_WritePhyUshort(sc, 0x06, 0x1000);
16580         MP_WritePhyUshort(sc, 0x06, 0xee86);
16581         MP_WritePhyUshort(sc, 0x06, 0x1100);
16582         MP_WritePhyUshort(sc, 0x06, 0xae11);
16583         MP_WritePhyUshort(sc, 0x06, 0x15e6);
16584         MP_WritePhyUshort(sc, 0x06, 0x8610);
16585         MP_WritePhyUshort(sc, 0x06, 0xe786);
16586         MP_WritePhyUshort(sc, 0x06, 0x11ae);
16587         MP_WritePhyUshort(sc, 0x06, 0x08ee);
16588         MP_WritePhyUshort(sc, 0x06, 0x8610);
16589         MP_WritePhyUshort(sc, 0x06, 0x00ee);
16590         MP_WritePhyUshort(sc, 0x06, 0x8611);
16591         MP_WritePhyUshort(sc, 0x06, 0x00fd);
16592         MP_WritePhyUshort(sc, 0x06, 0xfc04);
16593         MP_WritePhyUshort(sc, 0x06, 0xf8fa);
16594         MP_WritePhyUshort(sc, 0x06, 0xef69);
16595         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
16596         MP_WritePhyUshort(sc, 0x06, 0x00e1);
16597         MP_WritePhyUshort(sc, 0x06, 0xe001);
16598         MP_WritePhyUshort(sc, 0x06, 0xad27);
16599         MP_WritePhyUshort(sc, 0x06, 0x32e0);
16600         MP_WritePhyUshort(sc, 0x06, 0x8b40);
16601         MP_WritePhyUshort(sc, 0x06, 0xf720);
16602         MP_WritePhyUshort(sc, 0x06, 0xe48b);
16603         MP_WritePhyUshort(sc, 0x06, 0x40bf);
16604         MP_WritePhyUshort(sc, 0x06, 0x31f5);
16605         MP_WritePhyUshort(sc, 0x06, 0x0236);
16606         MP_WritePhyUshort(sc, 0x06, 0xf6ad);
16607         MP_WritePhyUshort(sc, 0x06, 0x2821);
16608         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
16609         MP_WritePhyUshort(sc, 0x06, 0x20e1);
16610         MP_WritePhyUshort(sc, 0x06, 0xe021);
16611         MP_WritePhyUshort(sc, 0x06, 0xad20);
16612         MP_WritePhyUshort(sc, 0x06, 0x18e0);
16613         MP_WritePhyUshort(sc, 0x06, 0x8b40);
16614         MP_WritePhyUshort(sc, 0x06, 0xf620);
16615         MP_WritePhyUshort(sc, 0x06, 0xe48b);
16616         MP_WritePhyUshort(sc, 0x06, 0x40ee);
16617         MP_WritePhyUshort(sc, 0x06, 0x8b3b);
16618         MP_WritePhyUshort(sc, 0x06, 0xffe0);
16619         MP_WritePhyUshort(sc, 0x06, 0x8a8a);
16620         MP_WritePhyUshort(sc, 0x06, 0xe18a);
16621         MP_WritePhyUshort(sc, 0x06, 0x8be4);
16622         MP_WritePhyUshort(sc, 0x06, 0xe000);
16623         MP_WritePhyUshort(sc, 0x06, 0xe5e0);
16624         MP_WritePhyUshort(sc, 0x06, 0x01ef);
16625         MP_WritePhyUshort(sc, 0x06, 0x96fe);
16626         MP_WritePhyUshort(sc, 0x06, 0xfc04);
16627         MP_WritePhyUshort(sc, 0x06, 0xf8fa);
16628         MP_WritePhyUshort(sc, 0x06, 0xef69);
16629         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16630         MP_WritePhyUshort(sc, 0x06, 0x80ad);
16631         MP_WritePhyUshort(sc, 0x06, 0x2722);
16632         MP_WritePhyUshort(sc, 0x06, 0xbf44);
16633         MP_WritePhyUshort(sc, 0x06, 0xfc02);
16634         MP_WritePhyUshort(sc, 0x06, 0x36f6);
16635         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16636         MP_WritePhyUshort(sc, 0x06, 0x441f);
16637         MP_WritePhyUshort(sc, 0x06, 0x019e);
16638         MP_WritePhyUshort(sc, 0x06, 0x15e5);
16639         MP_WritePhyUshort(sc, 0x06, 0x8b44);
16640         MP_WritePhyUshort(sc, 0x06, 0xad29);
16641         MP_WritePhyUshort(sc, 0x06, 0x07ac);
16642         MP_WritePhyUshort(sc, 0x06, 0x2804);
16643         MP_WritePhyUshort(sc, 0x06, 0xd101);
16644         MP_WritePhyUshort(sc, 0x06, 0xae02);
16645         MP_WritePhyUshort(sc, 0x06, 0xd100);
16646         MP_WritePhyUshort(sc, 0x06, 0xbf85);
16647         MP_WritePhyUshort(sc, 0x06, 0xb002);
16648         MP_WritePhyUshort(sc, 0x06, 0x3723);
16649         MP_WritePhyUshort(sc, 0x06, 0xef96);
16650         MP_WritePhyUshort(sc, 0x06, 0xfefc);
16651         MP_WritePhyUshort(sc, 0x06, 0x0400);
16652         MP_WritePhyUshort(sc, 0x06, 0xe140);
16653         MP_WritePhyUshort(sc, 0x06, 0x77e1);
16654         MP_WritePhyUshort(sc, 0x06, 0x40dd);
16655         MP_WritePhyUshort(sc, 0x06, 0xe022);
16656         MP_WritePhyUshort(sc, 0x06, 0x32e1);
16657         MP_WritePhyUshort(sc, 0x06, 0x5074);
16658         MP_WritePhyUshort(sc, 0x06, 0xe144);
16659         MP_WritePhyUshort(sc, 0x06, 0xffe0);
16660         MP_WritePhyUshort(sc, 0x06, 0xdaff);
16661         MP_WritePhyUshort(sc, 0x06, 0xe0c0);
16662         MP_WritePhyUshort(sc, 0x06, 0x52e0);
16663         MP_WritePhyUshort(sc, 0x06, 0xeed9);
16664         MP_WritePhyUshort(sc, 0x06, 0xe04c);
16665         MP_WritePhyUshort(sc, 0x06, 0xbbe0);
16666         MP_WritePhyUshort(sc, 0x06, 0x2a00);
16667         MP_WritePhyUshort(sc, 0x05, 0xe142);
16668         PhyRegValue = MP_ReadPhyUshort(sc, 0x06);
16669         PhyRegValue |= BIT_0;
16670         MP_WritePhyUshort(sc, 0x06, PhyRegValue);
16671         MP_WritePhyUshort(sc, 0x05, 0xe140);
16672         PhyRegValue = MP_ReadPhyUshort(sc, 0x06);
16673         PhyRegValue |= BIT_0;
16674         MP_WritePhyUshort(sc, 0x06, PhyRegValue);
16675         MP_WritePhyUshort(sc, 0x1f, 0x0000);
16676         MP_WritePhyUshort(sc, 0x1f, 0x0005);
16677         for (i = 0; i < 200; i++) {
16678                 DELAY(100);
16679                 PhyRegValue = MP_ReadPhyUshort(sc, 0x00);
16680                 if (PhyRegValue & BIT_7)
16681                         break;
16682         }
16683
16684         MP_WritePhyUshort(sc, 0x1F, 0x0003);
16685         MP_WritePhyUshort(sc, 0x09, 0xA20F);
16686         MP_WritePhyUshort(sc, 0x1F, 0x0000);
16687
16688         MP_WritePhyUshort(sc, 0x1f, 0x0003);
16689         PhyRegValue = MP_ReadPhyUshort(sc, 0x19);
16690         PhyRegValue &= ~BIT_0;
16691         MP_WritePhyUshort(sc, 0x19, PhyRegValue);
16692         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
16693         PhyRegValue &= ~BIT_10;
16694         MP_WritePhyUshort(sc, 0x10, PhyRegValue);
16695         MP_WritePhyUshort(sc, 0x1f, 0x0000);
16696
16697         MP_WritePhyUshort(sc, 0x1f, 0x0007);
16698         MP_WritePhyUshort(sc, 0x1e, 0x0042);
16699         MP_WritePhyUshort(sc, 0x18, 0x2300);
16700         MP_WritePhyUshort(sc, 0x1f, 0x0000);
16701         MP_WritePhyUshort(sc, 0x1f, 0x0007);
16702         MP_WritePhyUshort(sc, 0x1e, 0x0023);
16703         PhyRegValue = MP_ReadPhyUshort(sc, 0x17);
16704         if (sc->RequiredSecLanDonglePatch)
16705                 PhyRegValue &= ~(BIT_2);
16706         MP_WritePhyUshort(sc, 0x17, PhyRegValue);
16707         MP_WritePhyUshort(sc, 0x1f, 0x0000);
16708         MP_WritePhyUshort(sc, 0x00, 0x9200);
16709 }
16710
16711 static void re_set_phy_mcu_8168f_1(struct re_softc *sc)
16712 {
16713         u_int16_t PhyRegValue;
16714         int i;
16715
16716         MP_WritePhyUshort(sc, 0x1f, 0x0000);
16717         MP_WritePhyUshort(sc, 0x00, 0x1800);
16718         PhyRegValue = MP_ReadPhyUshort(sc, 0x15);
16719         PhyRegValue &= ~(BIT_12);
16720         MP_WritePhyUshort(sc, 0x15, PhyRegValue);
16721         MP_WritePhyUshort(sc, 0x00, 0x4800);
16722         MP_WritePhyUshort(sc, 0x1f, 0x0007);
16723         MP_WritePhyUshort(sc, 0x1e, 0x002f);
16724         for (i = 0; i < 1000; i++) {
16725                 DELAY(100);
16726                 PhyRegValue = MP_ReadPhyUshort(sc, 0x1c);
16727                 if (PhyRegValue & BIT_7)
16728                         break;
16729         }
16730         MP_WritePhyUshort(sc, 0x1f, 0x0000);
16731         MP_WritePhyUshort(sc, 0x00, 0x1800);
16732         MP_WritePhyUshort(sc, 0x1f, 0x0007);
16733         MP_WritePhyUshort(sc, 0x1e, 0x0023);
16734         for (i = 0; i < 200; i++) {
16735                 DELAY(100);
16736                 PhyRegValue = MP_ReadPhyUshort(sc, 0x18);
16737                 if (!(PhyRegValue & BIT_0))
16738                         break;
16739         }
16740         MP_WritePhyUshort(sc, 0x1f, 0x0005);
16741         MP_WritePhyUshort(sc, 0x05, 0xfff6);
16742         MP_WritePhyUshort(sc, 0x06, 0x0080);
16743         MP_WritePhyUshort(sc, 0x1f, 0x0007);
16744         MP_WritePhyUshort(sc, 0x1e, 0x0023);
16745         MP_WritePhyUshort(sc, 0x16, 0x0306);
16746         MP_WritePhyUshort(sc, 0x16, 0x0307);
16747         MP_WritePhyUshort(sc, 0x15, 0x0194);
16748         MP_WritePhyUshort(sc, 0x19, 0x407D);
16749         MP_WritePhyUshort(sc, 0x15, 0x0098);
16750         MP_WritePhyUshort(sc, 0x19, 0x7c0b);
16751         MP_WritePhyUshort(sc, 0x15, 0x0099);
16752         MP_WritePhyUshort(sc, 0x19, 0x6c0b);
16753         MP_WritePhyUshort(sc, 0x15, 0x00eb);
16754         MP_WritePhyUshort(sc, 0x19, 0x6c0b);
16755         MP_WritePhyUshort(sc, 0x15, 0x00f8);
16756         MP_WritePhyUshort(sc, 0x19, 0x6f0b);
16757         MP_WritePhyUshort(sc, 0x15, 0x00fe);
16758         MP_WritePhyUshort(sc, 0x19, 0x6f0f);
16759         MP_WritePhyUshort(sc, 0x15, 0x00db);
16760         MP_WritePhyUshort(sc, 0x19, 0x6f09);
16761         MP_WritePhyUshort(sc, 0x15, 0x00dc);
16762         MP_WritePhyUshort(sc, 0x19, 0xaefd);
16763         MP_WritePhyUshort(sc, 0x15, 0x00dd);
16764         MP_WritePhyUshort(sc, 0x19, 0x6f0b);
16765         MP_WritePhyUshort(sc, 0x15, 0x00de);
16766         MP_WritePhyUshort(sc, 0x19, 0xc60b);
16767         MP_WritePhyUshort(sc, 0x15, 0x00df);
16768         MP_WritePhyUshort(sc, 0x19, 0x00fa);
16769         MP_WritePhyUshort(sc, 0x15, 0x00e0);
16770         MP_WritePhyUshort(sc, 0x19, 0x30e1);
16771         MP_WritePhyUshort(sc, 0x15, 0x020c);
16772         MP_WritePhyUshort(sc, 0x19, 0x3224);
16773         MP_WritePhyUshort(sc, 0x15, 0x020e);
16774         MP_WritePhyUshort(sc, 0x19, 0x9813);
16775         MP_WritePhyUshort(sc, 0x15, 0x020f);
16776         MP_WritePhyUshort(sc, 0x19, 0x7801);
16777         MP_WritePhyUshort(sc, 0x15, 0x0210);
16778         MP_WritePhyUshort(sc, 0x19, 0x930f);
16779         MP_WritePhyUshort(sc, 0x15, 0x0211);
16780         MP_WritePhyUshort(sc, 0x19, 0x9206);
16781         MP_WritePhyUshort(sc, 0x15, 0x0212);
16782         MP_WritePhyUshort(sc, 0x19, 0x4002);
16783         MP_WritePhyUshort(sc, 0x15, 0x0213);
16784         MP_WritePhyUshort(sc, 0x19, 0x7800);
16785         MP_WritePhyUshort(sc, 0x15, 0x0214);
16786         MP_WritePhyUshort(sc, 0x19, 0x588f);
16787         MP_WritePhyUshort(sc, 0x15, 0x0215);
16788         MP_WritePhyUshort(sc, 0x19, 0x5520);
16789         MP_WritePhyUshort(sc, 0x15, 0x0216);
16790         MP_WritePhyUshort(sc, 0x19, 0x3224);
16791         MP_WritePhyUshort(sc, 0x15, 0x0217);
16792         MP_WritePhyUshort(sc, 0x19, 0x4002);
16793         MP_WritePhyUshort(sc, 0x15, 0x0218);
16794         MP_WritePhyUshort(sc, 0x19, 0x7800);
16795         MP_WritePhyUshort(sc, 0x15, 0x0219);
16796         MP_WritePhyUshort(sc, 0x19, 0x588d);
16797         MP_WritePhyUshort(sc, 0x15, 0x021a);
16798         MP_WritePhyUshort(sc, 0x19, 0x5540);
16799         MP_WritePhyUshort(sc, 0x15, 0x021b);
16800         MP_WritePhyUshort(sc, 0x19, 0x9e03);
16801         MP_WritePhyUshort(sc, 0x15, 0x021c);
16802         MP_WritePhyUshort(sc, 0x19, 0x7c40);
16803         MP_WritePhyUshort(sc, 0x15, 0x021d);
16804         MP_WritePhyUshort(sc, 0x19, 0x6840);
16805         MP_WritePhyUshort(sc, 0x15, 0x021e);
16806         MP_WritePhyUshort(sc, 0x19, 0x3224);
16807         MP_WritePhyUshort(sc, 0x15, 0x021f);
16808         MP_WritePhyUshort(sc, 0x19, 0x4002);
16809         MP_WritePhyUshort(sc, 0x15, 0x0220);
16810         MP_WritePhyUshort(sc, 0x19, 0x3224);
16811         MP_WritePhyUshort(sc, 0x15, 0x0221);
16812         MP_WritePhyUshort(sc, 0x19, 0x9e03);
16813         MP_WritePhyUshort(sc, 0x15, 0x0222);
16814         MP_WritePhyUshort(sc, 0x19, 0x7c40);
16815         MP_WritePhyUshort(sc, 0x15, 0x0223);
16816         MP_WritePhyUshort(sc, 0x19, 0x6840);
16817         MP_WritePhyUshort(sc, 0x15, 0x0224);
16818         MP_WritePhyUshort(sc, 0x19, 0x7800);
16819         MP_WritePhyUshort(sc, 0x15, 0x0225);
16820         MP_WritePhyUshort(sc, 0x19, 0x3231);
16821         MP_WritePhyUshort(sc, 0x15, 0x0000);
16822         MP_WritePhyUshort(sc, 0x16, 0x0306);
16823         MP_WritePhyUshort(sc, 0x16, 0x0300);
16824         MP_WritePhyUshort(sc, 0x1f, 0x0000);
16825         MP_WritePhyUshort(sc, 0x1f, 0x0005);
16826         MP_WritePhyUshort(sc, 0x05, 0xfff6);
16827         MP_WritePhyUshort(sc, 0x06, 0x0080);
16828         MP_WritePhyUshort(sc, 0x05, 0x8000);
16829         MP_WritePhyUshort(sc, 0x06, 0x0280);
16830         MP_WritePhyUshort(sc, 0x06, 0x48f7);
16831         MP_WritePhyUshort(sc, 0x06, 0x00e0);
16832         MP_WritePhyUshort(sc, 0x06, 0xfff7);
16833         MP_WritePhyUshort(sc, 0x06, 0xa080);
16834         MP_WritePhyUshort(sc, 0x06, 0x02ae);
16835         MP_WritePhyUshort(sc, 0x06, 0xf602);
16836         MP_WritePhyUshort(sc, 0x06, 0x0118);
16837         MP_WritePhyUshort(sc, 0x06, 0x0201);
16838         MP_WritePhyUshort(sc, 0x06, 0x2502);
16839         MP_WritePhyUshort(sc, 0x06, 0x8090);
16840         MP_WritePhyUshort(sc, 0x06, 0x0201);
16841         MP_WritePhyUshort(sc, 0x06, 0x4202);
16842         MP_WritePhyUshort(sc, 0x06, 0x015c);
16843         MP_WritePhyUshort(sc, 0x06, 0x0280);
16844         MP_WritePhyUshort(sc, 0x06, 0xad02);
16845         MP_WritePhyUshort(sc, 0x06, 0x80ca);
16846         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16847         MP_WritePhyUshort(sc, 0x06, 0x88e1);
16848         MP_WritePhyUshort(sc, 0x06, 0x8b89);
16849         MP_WritePhyUshort(sc, 0x06, 0x1e01);
16850         MP_WritePhyUshort(sc, 0x06, 0xe18b);
16851         MP_WritePhyUshort(sc, 0x06, 0x8a1e);
16852         MP_WritePhyUshort(sc, 0x06, 0x01e1);
16853         MP_WritePhyUshort(sc, 0x06, 0x8b8b);
16854         MP_WritePhyUshort(sc, 0x06, 0x1e01);
16855         MP_WritePhyUshort(sc, 0x06, 0xe18b);
16856         MP_WritePhyUshort(sc, 0x06, 0x8c1e);
16857         MP_WritePhyUshort(sc, 0x06, 0x01e1);
16858         MP_WritePhyUshort(sc, 0x06, 0x8b8d);
16859         MP_WritePhyUshort(sc, 0x06, 0x1e01);
16860         MP_WritePhyUshort(sc, 0x06, 0xe18b);
16861         MP_WritePhyUshort(sc, 0x06, 0x8e1e);
16862         MP_WritePhyUshort(sc, 0x06, 0x01a0);
16863         MP_WritePhyUshort(sc, 0x06, 0x00c7);
16864         MP_WritePhyUshort(sc, 0x06, 0xaebb);
16865         MP_WritePhyUshort(sc, 0x06, 0xd484);
16866         MP_WritePhyUshort(sc, 0x06, 0x3ce4);
16867         MP_WritePhyUshort(sc, 0x06, 0x8b92);
16868         MP_WritePhyUshort(sc, 0x06, 0xe58b);
16869         MP_WritePhyUshort(sc, 0x06, 0x93ee);
16870         MP_WritePhyUshort(sc, 0x06, 0x8ac8);
16871         MP_WritePhyUshort(sc, 0x06, 0x03ee);
16872         MP_WritePhyUshort(sc, 0x06, 0x8aca);
16873         MP_WritePhyUshort(sc, 0x06, 0x60ee);
16874         MP_WritePhyUshort(sc, 0x06, 0x8ac0);
16875         MP_WritePhyUshort(sc, 0x06, 0x00ee);
16876         MP_WritePhyUshort(sc, 0x06, 0x8ac1);
16877         MP_WritePhyUshort(sc, 0x06, 0x00ee);
16878         MP_WritePhyUshort(sc, 0x06, 0x8abe);
16879         MP_WritePhyUshort(sc, 0x06, 0x07ee);
16880         MP_WritePhyUshort(sc, 0x06, 0x8abf);
16881         MP_WritePhyUshort(sc, 0x06, 0x73ee);
16882         MP_WritePhyUshort(sc, 0x06, 0x8a95);
16883         MP_WritePhyUshort(sc, 0x06, 0x02bf);
16884         MP_WritePhyUshort(sc, 0x06, 0x8b88);
16885         MP_WritePhyUshort(sc, 0x06, 0xec00);
16886         MP_WritePhyUshort(sc, 0x06, 0x19a9);
16887         MP_WritePhyUshort(sc, 0x06, 0x8b90);
16888         MP_WritePhyUshort(sc, 0x06, 0xf9ee);
16889         MP_WritePhyUshort(sc, 0x06, 0xfff6);
16890         MP_WritePhyUshort(sc, 0x06, 0x00ee);
16891         MP_WritePhyUshort(sc, 0x06, 0xfff7);
16892         MP_WritePhyUshort(sc, 0x06, 0xfed1);
16893         MP_WritePhyUshort(sc, 0x06, 0x00bf);
16894         MP_WritePhyUshort(sc, 0x06, 0x85a4);
16895         MP_WritePhyUshort(sc, 0x06, 0x0238);
16896         MP_WritePhyUshort(sc, 0x06, 0x7dd1);
16897         MP_WritePhyUshort(sc, 0x06, 0x01bf);
16898         MP_WritePhyUshort(sc, 0x06, 0x85a7);
16899         MP_WritePhyUshort(sc, 0x06, 0x0238);
16900         MP_WritePhyUshort(sc, 0x06, 0x7d04);
16901         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
16902         MP_WritePhyUshort(sc, 0x06, 0x8b8a);
16903         MP_WritePhyUshort(sc, 0x06, 0xad20);
16904         MP_WritePhyUshort(sc, 0x06, 0x14ee);
16905         MP_WritePhyUshort(sc, 0x06, 0x8b8a);
16906         MP_WritePhyUshort(sc, 0x06, 0x0002);
16907         MP_WritePhyUshort(sc, 0x06, 0x204b);
16908         MP_WritePhyUshort(sc, 0x06, 0xe0e4);
16909         MP_WritePhyUshort(sc, 0x06, 0x26e1);
16910         MP_WritePhyUshort(sc, 0x06, 0xe427);
16911         MP_WritePhyUshort(sc, 0x06, 0xeee4);
16912         MP_WritePhyUshort(sc, 0x06, 0x2623);
16913         MP_WritePhyUshort(sc, 0x06, 0xe5e4);
16914         MP_WritePhyUshort(sc, 0x06, 0x27fc);
16915         MP_WritePhyUshort(sc, 0x06, 0x04f8);
16916         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16917         MP_WritePhyUshort(sc, 0x06, 0x8dad);
16918         MP_WritePhyUshort(sc, 0x06, 0x2014);
16919         MP_WritePhyUshort(sc, 0x06, 0xee8b);
16920         MP_WritePhyUshort(sc, 0x06, 0x8d00);
16921         MP_WritePhyUshort(sc, 0x06, 0xe08a);
16922         MP_WritePhyUshort(sc, 0x06, 0x5a78);
16923         MP_WritePhyUshort(sc, 0x06, 0x039e);
16924         MP_WritePhyUshort(sc, 0x06, 0x0902);
16925         MP_WritePhyUshort(sc, 0x06, 0x05e8);
16926         MP_WritePhyUshort(sc, 0x06, 0x0281);
16927         MP_WritePhyUshort(sc, 0x06, 0x4f02);
16928         MP_WritePhyUshort(sc, 0x06, 0x326c);
16929         MP_WritePhyUshort(sc, 0x06, 0xfc04);
16930         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
16931         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16932         MP_WritePhyUshort(sc, 0x06, 0xad20);
16933         MP_WritePhyUshort(sc, 0x06, 0x1df6);
16934         MP_WritePhyUshort(sc, 0x06, 0x20e4);
16935         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16936         MP_WritePhyUshort(sc, 0x06, 0x022f);
16937         MP_WritePhyUshort(sc, 0x06, 0x0902);
16938         MP_WritePhyUshort(sc, 0x06, 0x2ab0);
16939         MP_WritePhyUshort(sc, 0x06, 0x0285);
16940         MP_WritePhyUshort(sc, 0x06, 0x1602);
16941         MP_WritePhyUshort(sc, 0x06, 0x03ba);
16942         MP_WritePhyUshort(sc, 0x06, 0x0284);
16943         MP_WritePhyUshort(sc, 0x06, 0xe502);
16944         MP_WritePhyUshort(sc, 0x06, 0x2df1);
16945         MP_WritePhyUshort(sc, 0x06, 0x0283);
16946         MP_WritePhyUshort(sc, 0x06, 0x8302);
16947         MP_WritePhyUshort(sc, 0x06, 0x0475);
16948         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16949         MP_WritePhyUshort(sc, 0x06, 0x8ead);
16950         MP_WritePhyUshort(sc, 0x06, 0x210b);
16951         MP_WritePhyUshort(sc, 0x06, 0xf621);
16952         MP_WritePhyUshort(sc, 0x06, 0xe48b);
16953         MP_WritePhyUshort(sc, 0x06, 0x8e02);
16954         MP_WritePhyUshort(sc, 0x06, 0x83f8);
16955         MP_WritePhyUshort(sc, 0x06, 0x021c);
16956         MP_WritePhyUshort(sc, 0x06, 0x99e0);
16957         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16958         MP_WritePhyUshort(sc, 0x06, 0xad22);
16959         MP_WritePhyUshort(sc, 0x06, 0x08f6);
16960         MP_WritePhyUshort(sc, 0x06, 0x22e4);
16961         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16962         MP_WritePhyUshort(sc, 0x06, 0x0235);
16963         MP_WritePhyUshort(sc, 0x06, 0x63e0);
16964         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16965         MP_WritePhyUshort(sc, 0x06, 0xad23);
16966         MP_WritePhyUshort(sc, 0x06, 0x08f6);
16967         MP_WritePhyUshort(sc, 0x06, 0x23e4);
16968         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16969         MP_WritePhyUshort(sc, 0x06, 0x0231);
16970         MP_WritePhyUshort(sc, 0x06, 0x57e0);
16971         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16972         MP_WritePhyUshort(sc, 0x06, 0xad24);
16973         MP_WritePhyUshort(sc, 0x06, 0x05f6);
16974         MP_WritePhyUshort(sc, 0x06, 0x24e4);
16975         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16976         MP_WritePhyUshort(sc, 0x06, 0xe08b);
16977         MP_WritePhyUshort(sc, 0x06, 0x8ead);
16978         MP_WritePhyUshort(sc, 0x06, 0x2505);
16979         MP_WritePhyUshort(sc, 0x06, 0xf625);
16980         MP_WritePhyUshort(sc, 0x06, 0xe48b);
16981         MP_WritePhyUshort(sc, 0x06, 0x8ee0);
16982         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16983         MP_WritePhyUshort(sc, 0x06, 0xad26);
16984         MP_WritePhyUshort(sc, 0x06, 0x08f6);
16985         MP_WritePhyUshort(sc, 0x06, 0x26e4);
16986         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16987         MP_WritePhyUshort(sc, 0x06, 0x022d);
16988         MP_WritePhyUshort(sc, 0x06, 0x1ce0);
16989         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16990         MP_WritePhyUshort(sc, 0x06, 0xad27);
16991         MP_WritePhyUshort(sc, 0x06, 0x05f6);
16992         MP_WritePhyUshort(sc, 0x06, 0x27e4);
16993         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16994         MP_WritePhyUshort(sc, 0x06, 0x0203);
16995         MP_WritePhyUshort(sc, 0x06, 0x80fc);
16996         MP_WritePhyUshort(sc, 0x06, 0x04f8);
16997         MP_WritePhyUshort(sc, 0x06, 0xf9e0);
16998         MP_WritePhyUshort(sc, 0x06, 0x8b81);
16999         MP_WritePhyUshort(sc, 0x06, 0xac26);
17000         MP_WritePhyUshort(sc, 0x06, 0x1ae0);
17001         MP_WritePhyUshort(sc, 0x06, 0x8b81);
17002         MP_WritePhyUshort(sc, 0x06, 0xac21);
17003         MP_WritePhyUshort(sc, 0x06, 0x14e0);
17004         MP_WritePhyUshort(sc, 0x06, 0x8b85);
17005         MP_WritePhyUshort(sc, 0x06, 0xac20);
17006         MP_WritePhyUshort(sc, 0x06, 0x0ee0);
17007         MP_WritePhyUshort(sc, 0x06, 0x8b85);
17008         MP_WritePhyUshort(sc, 0x06, 0xac23);
17009         MP_WritePhyUshort(sc, 0x06, 0x08e0);
17010         MP_WritePhyUshort(sc, 0x06, 0x8b87);
17011         MP_WritePhyUshort(sc, 0x06, 0xac24);
17012         MP_WritePhyUshort(sc, 0x06, 0x02ae);
17013         MP_WritePhyUshort(sc, 0x06, 0x3802);
17014         MP_WritePhyUshort(sc, 0x06, 0x1ac2);
17015         MP_WritePhyUshort(sc, 0x06, 0xeee4);
17016         MP_WritePhyUshort(sc, 0x06, 0x1c04);
17017         MP_WritePhyUshort(sc, 0x06, 0xeee4);
17018         MP_WritePhyUshort(sc, 0x06, 0x1d04);
17019         MP_WritePhyUshort(sc, 0x06, 0xe2e0);
17020         MP_WritePhyUshort(sc, 0x06, 0x7ce3);
17021         MP_WritePhyUshort(sc, 0x06, 0xe07d);
17022         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
17023         MP_WritePhyUshort(sc, 0x06, 0x38e1);
17024         MP_WritePhyUshort(sc, 0x06, 0xe039);
17025         MP_WritePhyUshort(sc, 0x06, 0xad2e);
17026         MP_WritePhyUshort(sc, 0x06, 0x1bad);
17027         MP_WritePhyUshort(sc, 0x06, 0x390d);
17028         MP_WritePhyUshort(sc, 0x06, 0xd101);
17029         MP_WritePhyUshort(sc, 0x06, 0xbf22);
17030         MP_WritePhyUshort(sc, 0x06, 0x7a02);
17031         MP_WritePhyUshort(sc, 0x06, 0x387d);
17032         MP_WritePhyUshort(sc, 0x06, 0x0281);
17033         MP_WritePhyUshort(sc, 0x06, 0xacae);
17034         MP_WritePhyUshort(sc, 0x06, 0x0bac);
17035         MP_WritePhyUshort(sc, 0x06, 0x3802);
17036         MP_WritePhyUshort(sc, 0x06, 0xae06);
17037         MP_WritePhyUshort(sc, 0x06, 0x0281);
17038         MP_WritePhyUshort(sc, 0x06, 0xe902);
17039         MP_WritePhyUshort(sc, 0x06, 0x822e);
17040         MP_WritePhyUshort(sc, 0x06, 0x021a);
17041         MP_WritePhyUshort(sc, 0x06, 0xd3fd);
17042         MP_WritePhyUshort(sc, 0x06, 0xfc04);
17043         MP_WritePhyUshort(sc, 0x06, 0xf8e1);
17044         MP_WritePhyUshort(sc, 0x06, 0x8af4);
17045         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17046         MP_WritePhyUshort(sc, 0x06, 0x81ad);
17047         MP_WritePhyUshort(sc, 0x06, 0x2602);
17048         MP_WritePhyUshort(sc, 0x06, 0xf728);
17049         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17050         MP_WritePhyUshort(sc, 0x06, 0x81ad);
17051         MP_WritePhyUshort(sc, 0x06, 0x2105);
17052         MP_WritePhyUshort(sc, 0x06, 0x0222);
17053         MP_WritePhyUshort(sc, 0x06, 0x8ef7);
17054         MP_WritePhyUshort(sc, 0x06, 0x29e0);
17055         MP_WritePhyUshort(sc, 0x06, 0x8b85);
17056         MP_WritePhyUshort(sc, 0x06, 0xad20);
17057         MP_WritePhyUshort(sc, 0x06, 0x0502);
17058         MP_WritePhyUshort(sc, 0x06, 0x14b8);
17059         MP_WritePhyUshort(sc, 0x06, 0xf72a);
17060         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17061         MP_WritePhyUshort(sc, 0x06, 0x85ad);
17062         MP_WritePhyUshort(sc, 0x06, 0x2305);
17063         MP_WritePhyUshort(sc, 0x06, 0x0212);
17064         MP_WritePhyUshort(sc, 0x06, 0xf4f7);
17065         MP_WritePhyUshort(sc, 0x06, 0x2be0);
17066         MP_WritePhyUshort(sc, 0x06, 0x8b87);
17067         MP_WritePhyUshort(sc, 0x06, 0xad24);
17068         MP_WritePhyUshort(sc, 0x06, 0x0502);
17069         MP_WritePhyUshort(sc, 0x06, 0x8284);
17070         MP_WritePhyUshort(sc, 0x06, 0xf72c);
17071         MP_WritePhyUshort(sc, 0x06, 0xe58a);
17072         MP_WritePhyUshort(sc, 0x06, 0xf4fc);
17073         MP_WritePhyUshort(sc, 0x06, 0x04f8);
17074         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17075         MP_WritePhyUshort(sc, 0x06, 0x81ad);
17076         MP_WritePhyUshort(sc, 0x06, 0x2600);
17077         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17078         MP_WritePhyUshort(sc, 0x06, 0x81ad);
17079         MP_WritePhyUshort(sc, 0x06, 0x2109);
17080         MP_WritePhyUshort(sc, 0x06, 0xe08a);
17081         MP_WritePhyUshort(sc, 0x06, 0xf4ac);
17082         MP_WritePhyUshort(sc, 0x06, 0x2003);
17083         MP_WritePhyUshort(sc, 0x06, 0x0222);
17084         MP_WritePhyUshort(sc, 0x06, 0x7de0);
17085         MP_WritePhyUshort(sc, 0x06, 0x8b85);
17086         MP_WritePhyUshort(sc, 0x06, 0xad20);
17087         MP_WritePhyUshort(sc, 0x06, 0x09e0);
17088         MP_WritePhyUshort(sc, 0x06, 0x8af4);
17089         MP_WritePhyUshort(sc, 0x06, 0xac21);
17090         MP_WritePhyUshort(sc, 0x06, 0x0302);
17091         MP_WritePhyUshort(sc, 0x06, 0x1408);
17092         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17093         MP_WritePhyUshort(sc, 0x06, 0x85ad);
17094         MP_WritePhyUshort(sc, 0x06, 0x2309);
17095         MP_WritePhyUshort(sc, 0x06, 0xe08a);
17096         MP_WritePhyUshort(sc, 0x06, 0xf4ac);
17097         MP_WritePhyUshort(sc, 0x06, 0x2203);
17098         MP_WritePhyUshort(sc, 0x06, 0x0213);
17099         MP_WritePhyUshort(sc, 0x06, 0x07e0);
17100         MP_WritePhyUshort(sc, 0x06, 0x8b87);
17101         MP_WritePhyUshort(sc, 0x06, 0xad24);
17102         MP_WritePhyUshort(sc, 0x06, 0x09e0);
17103         MP_WritePhyUshort(sc, 0x06, 0x8af4);
17104         MP_WritePhyUshort(sc, 0x06, 0xac23);
17105         MP_WritePhyUshort(sc, 0x06, 0x0302);
17106         MP_WritePhyUshort(sc, 0x06, 0x8289);
17107         MP_WritePhyUshort(sc, 0x06, 0xfc04);
17108         MP_WritePhyUshort(sc, 0x06, 0xf8e1);
17109         MP_WritePhyUshort(sc, 0x06, 0x8af4);
17110         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17111         MP_WritePhyUshort(sc, 0x06, 0x81ad);
17112         MP_WritePhyUshort(sc, 0x06, 0x2602);
17113         MP_WritePhyUshort(sc, 0x06, 0xf628);
17114         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17115         MP_WritePhyUshort(sc, 0x06, 0x81ad);
17116         MP_WritePhyUshort(sc, 0x06, 0x210a);
17117         MP_WritePhyUshort(sc, 0x06, 0xe083);
17118         MP_WritePhyUshort(sc, 0x06, 0xecf6);
17119         MP_WritePhyUshort(sc, 0x06, 0x27a0);
17120         MP_WritePhyUshort(sc, 0x06, 0x0502);
17121         MP_WritePhyUshort(sc, 0x06, 0xf629);
17122         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17123         MP_WritePhyUshort(sc, 0x06, 0x85ad);
17124         MP_WritePhyUshort(sc, 0x06, 0x2008);
17125         MP_WritePhyUshort(sc, 0x06, 0xe08a);
17126         MP_WritePhyUshort(sc, 0x06, 0xe8ad);
17127         MP_WritePhyUshort(sc, 0x06, 0x2102);
17128         MP_WritePhyUshort(sc, 0x06, 0xf62a);
17129         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17130         MP_WritePhyUshort(sc, 0x06, 0x85ad);
17131         MP_WritePhyUshort(sc, 0x06, 0x2308);
17132         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17133         MP_WritePhyUshort(sc, 0x06, 0x20a0);
17134         MP_WritePhyUshort(sc, 0x06, 0x0302);
17135         MP_WritePhyUshort(sc, 0x06, 0xf62b);
17136         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17137         MP_WritePhyUshort(sc, 0x06, 0x87ad);
17138         MP_WritePhyUshort(sc, 0x06, 0x2408);
17139         MP_WritePhyUshort(sc, 0x06, 0xe08a);
17140         MP_WritePhyUshort(sc, 0x06, 0xc2a0);
17141         MP_WritePhyUshort(sc, 0x06, 0x0302);
17142         MP_WritePhyUshort(sc, 0x06, 0xf62c);
17143         MP_WritePhyUshort(sc, 0x06, 0xe58a);
17144         MP_WritePhyUshort(sc, 0x06, 0xf4a1);
17145         MP_WritePhyUshort(sc, 0x06, 0x0008);
17146         MP_WritePhyUshort(sc, 0x06, 0xd100);
17147         MP_WritePhyUshort(sc, 0x06, 0xbf22);
17148         MP_WritePhyUshort(sc, 0x06, 0x7a02);
17149         MP_WritePhyUshort(sc, 0x06, 0x387d);
17150         MP_WritePhyUshort(sc, 0x06, 0xfc04);
17151         MP_WritePhyUshort(sc, 0x06, 0xee8a);
17152         MP_WritePhyUshort(sc, 0x06, 0xc200);
17153         MP_WritePhyUshort(sc, 0x06, 0x04f8);
17154         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17155         MP_WritePhyUshort(sc, 0x06, 0x87ad);
17156         MP_WritePhyUshort(sc, 0x06, 0x241e);
17157         MP_WritePhyUshort(sc, 0x06, 0xe08a);
17158         MP_WritePhyUshort(sc, 0x06, 0xc2a0);
17159         MP_WritePhyUshort(sc, 0x06, 0x0005);
17160         MP_WritePhyUshort(sc, 0x06, 0x0282);
17161         MP_WritePhyUshort(sc, 0x06, 0xb0ae);
17162         MP_WritePhyUshort(sc, 0x06, 0xf5a0);
17163         MP_WritePhyUshort(sc, 0x06, 0x0105);
17164         MP_WritePhyUshort(sc, 0x06, 0x0282);
17165         MP_WritePhyUshort(sc, 0x06, 0xc0ae);
17166         MP_WritePhyUshort(sc, 0x06, 0x0ba0);
17167         MP_WritePhyUshort(sc, 0x06, 0x0205);
17168         MP_WritePhyUshort(sc, 0x06, 0x0282);
17169         MP_WritePhyUshort(sc, 0x06, 0xcaae);
17170         MP_WritePhyUshort(sc, 0x06, 0x03a0);
17171         MP_WritePhyUshort(sc, 0x06, 0x0300);
17172         MP_WritePhyUshort(sc, 0x06, 0xfc04);
17173         MP_WritePhyUshort(sc, 0x06, 0xf8fa);
17174         MP_WritePhyUshort(sc, 0x06, 0xef69);
17175         MP_WritePhyUshort(sc, 0x06, 0x0282);
17176         MP_WritePhyUshort(sc, 0x06, 0xe1ee);
17177         MP_WritePhyUshort(sc, 0x06, 0x8ac2);
17178         MP_WritePhyUshort(sc, 0x06, 0x01ef);
17179         MP_WritePhyUshort(sc, 0x06, 0x96fe);
17180         MP_WritePhyUshort(sc, 0x06, 0xfc04);
17181         MP_WritePhyUshort(sc, 0x06, 0xf8ee);
17182         MP_WritePhyUshort(sc, 0x06, 0x8ac9);
17183         MP_WritePhyUshort(sc, 0x06, 0x0002);
17184         MP_WritePhyUshort(sc, 0x06, 0x8317);
17185         MP_WritePhyUshort(sc, 0x06, 0xfc04);
17186         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
17187         MP_WritePhyUshort(sc, 0x06, 0x8ac8);
17188         MP_WritePhyUshort(sc, 0x06, 0xe18a);
17189         MP_WritePhyUshort(sc, 0x06, 0xc91f);
17190         MP_WritePhyUshort(sc, 0x06, 0x019e);
17191         MP_WritePhyUshort(sc, 0x06, 0x0611);
17192         MP_WritePhyUshort(sc, 0x06, 0xe58a);
17193         MP_WritePhyUshort(sc, 0x06, 0xc9ae);
17194         MP_WritePhyUshort(sc, 0x06, 0x04ee);
17195         MP_WritePhyUshort(sc, 0x06, 0x8ac2);
17196         MP_WritePhyUshort(sc, 0x06, 0x01fc);
17197         MP_WritePhyUshort(sc, 0x06, 0x04f8);
17198         MP_WritePhyUshort(sc, 0x06, 0xf9fa);
17199         MP_WritePhyUshort(sc, 0x06, 0xef69);
17200         MP_WritePhyUshort(sc, 0x06, 0xfbbf);
17201         MP_WritePhyUshort(sc, 0x06, 0x8ac4);
17202         MP_WritePhyUshort(sc, 0x06, 0xef79);
17203         MP_WritePhyUshort(sc, 0x06, 0xd200);
17204         MP_WritePhyUshort(sc, 0x06, 0xd400);
17205         MP_WritePhyUshort(sc, 0x06, 0x221e);
17206         MP_WritePhyUshort(sc, 0x06, 0x02bf);
17207         MP_WritePhyUshort(sc, 0x06, 0x3024);
17208         MP_WritePhyUshort(sc, 0x06, 0x0238);
17209         MP_WritePhyUshort(sc, 0x06, 0x7dbf);
17210         MP_WritePhyUshort(sc, 0x06, 0x13ff);
17211         MP_WritePhyUshort(sc, 0x06, 0x0238);
17212         MP_WritePhyUshort(sc, 0x06, 0x500d);
17213         MP_WritePhyUshort(sc, 0x06, 0x4559);
17214         MP_WritePhyUshort(sc, 0x06, 0x1fef);
17215         MP_WritePhyUshort(sc, 0x06, 0x97dd);
17216         MP_WritePhyUshort(sc, 0x06, 0xd308);
17217         MP_WritePhyUshort(sc, 0x06, 0x1a93);
17218         MP_WritePhyUshort(sc, 0x06, 0xdd12);
17219         MP_WritePhyUshort(sc, 0x06, 0x17a2);
17220         MP_WritePhyUshort(sc, 0x06, 0x04de);
17221         MP_WritePhyUshort(sc, 0x06, 0xffef);
17222         MP_WritePhyUshort(sc, 0x06, 0x96fe);
17223         MP_WritePhyUshort(sc, 0x06, 0xfdfc);
17224         MP_WritePhyUshort(sc, 0x06, 0x04f8);
17225         MP_WritePhyUshort(sc, 0x06, 0xf9fa);
17226         MP_WritePhyUshort(sc, 0x06, 0xef69);
17227         MP_WritePhyUshort(sc, 0x06, 0xfbee);
17228         MP_WritePhyUshort(sc, 0x06, 0x8ac2);
17229         MP_WritePhyUshort(sc, 0x06, 0x03d5);
17230         MP_WritePhyUshort(sc, 0x06, 0x0080);
17231         MP_WritePhyUshort(sc, 0x06, 0xbf8a);
17232         MP_WritePhyUshort(sc, 0x06, 0xc4ef);
17233         MP_WritePhyUshort(sc, 0x06, 0x79ef);
17234         MP_WritePhyUshort(sc, 0x06, 0x45bf);
17235         MP_WritePhyUshort(sc, 0x06, 0x3024);
17236         MP_WritePhyUshort(sc, 0x06, 0x0238);
17237         MP_WritePhyUshort(sc, 0x06, 0x7dbf);
17238         MP_WritePhyUshort(sc, 0x06, 0x13ff);
17239         MP_WritePhyUshort(sc, 0x06, 0x0238);
17240         MP_WritePhyUshort(sc, 0x06, 0x50ad);
17241         MP_WritePhyUshort(sc, 0x06, 0x2702);
17242         MP_WritePhyUshort(sc, 0x06, 0x78ff);
17243         MP_WritePhyUshort(sc, 0x06, 0xe18a);
17244         MP_WritePhyUshort(sc, 0x06, 0xca1b);
17245         MP_WritePhyUshort(sc, 0x06, 0x01aa);
17246         MP_WritePhyUshort(sc, 0x06, 0x2eef);
17247         MP_WritePhyUshort(sc, 0x06, 0x97d9);
17248         MP_WritePhyUshort(sc, 0x06, 0x7900);
17249         MP_WritePhyUshort(sc, 0x06, 0x9e2b);
17250         MP_WritePhyUshort(sc, 0x06, 0x81dd);
17251         MP_WritePhyUshort(sc, 0x06, 0xbf85);
17252         MP_WritePhyUshort(sc, 0x06, 0xad02);
17253         MP_WritePhyUshort(sc, 0x06, 0x387d);
17254         MP_WritePhyUshort(sc, 0x06, 0xd101);
17255         MP_WritePhyUshort(sc, 0x06, 0xef02);
17256         MP_WritePhyUshort(sc, 0x06, 0x100c);
17257         MP_WritePhyUshort(sc, 0x06, 0x11b0);
17258         MP_WritePhyUshort(sc, 0x06, 0xfc0d);
17259         MP_WritePhyUshort(sc, 0x06, 0x11bf);
17260         MP_WritePhyUshort(sc, 0x06, 0x85aa);
17261         MP_WritePhyUshort(sc, 0x06, 0x0238);
17262         MP_WritePhyUshort(sc, 0x06, 0x7dd1);
17263         MP_WritePhyUshort(sc, 0x06, 0x00bf);
17264         MP_WritePhyUshort(sc, 0x06, 0x85aa);
17265         MP_WritePhyUshort(sc, 0x06, 0x0238);
17266         MP_WritePhyUshort(sc, 0x06, 0x7dee);
17267         MP_WritePhyUshort(sc, 0x06, 0x8ac2);
17268         MP_WritePhyUshort(sc, 0x06, 0x02ae);
17269         MP_WritePhyUshort(sc, 0x06, 0x0413);
17270         MP_WritePhyUshort(sc, 0x06, 0xa38b);
17271         MP_WritePhyUshort(sc, 0x06, 0xb4d3);
17272         MP_WritePhyUshort(sc, 0x06, 0x8012);
17273         MP_WritePhyUshort(sc, 0x06, 0x17a2);
17274         MP_WritePhyUshort(sc, 0x06, 0x04ad);
17275         MP_WritePhyUshort(sc, 0x06, 0xffef);
17276         MP_WritePhyUshort(sc, 0x06, 0x96fe);
17277         MP_WritePhyUshort(sc, 0x06, 0xfdfc);
17278         MP_WritePhyUshort(sc, 0x06, 0x04f8);
17279         MP_WritePhyUshort(sc, 0x06, 0xf9e0);
17280         MP_WritePhyUshort(sc, 0x06, 0x8b85);
17281         MP_WritePhyUshort(sc, 0x06, 0xad25);
17282         MP_WritePhyUshort(sc, 0x06, 0x48e0);
17283         MP_WritePhyUshort(sc, 0x06, 0x8a96);
17284         MP_WritePhyUshort(sc, 0x06, 0xe18a);
17285         MP_WritePhyUshort(sc, 0x06, 0x977c);
17286         MP_WritePhyUshort(sc, 0x06, 0x0000);
17287         MP_WritePhyUshort(sc, 0x06, 0x9e35);
17288         MP_WritePhyUshort(sc, 0x06, 0xee8a);
17289         MP_WritePhyUshort(sc, 0x06, 0x9600);
17290         MP_WritePhyUshort(sc, 0x06, 0xee8a);
17291         MP_WritePhyUshort(sc, 0x06, 0x9700);
17292         MP_WritePhyUshort(sc, 0x06, 0xe08a);
17293         MP_WritePhyUshort(sc, 0x06, 0xbee1);
17294         MP_WritePhyUshort(sc, 0x06, 0x8abf);
17295         MP_WritePhyUshort(sc, 0x06, 0xe28a);
17296         MP_WritePhyUshort(sc, 0x06, 0xc0e3);
17297         MP_WritePhyUshort(sc, 0x06, 0x8ac1);
17298         MP_WritePhyUshort(sc, 0x06, 0x0237);
17299         MP_WritePhyUshort(sc, 0x06, 0x74ad);
17300         MP_WritePhyUshort(sc, 0x06, 0x2012);
17301         MP_WritePhyUshort(sc, 0x06, 0xee8a);
17302         MP_WritePhyUshort(sc, 0x06, 0x9603);
17303         MP_WritePhyUshort(sc, 0x06, 0xee8a);
17304         MP_WritePhyUshort(sc, 0x06, 0x97b7);
17305         MP_WritePhyUshort(sc, 0x06, 0xee8a);
17306         MP_WritePhyUshort(sc, 0x06, 0xc000);
17307         MP_WritePhyUshort(sc, 0x06, 0xee8a);
17308         MP_WritePhyUshort(sc, 0x06, 0xc100);
17309         MP_WritePhyUshort(sc, 0x06, 0xae11);
17310         MP_WritePhyUshort(sc, 0x06, 0x15e6);
17311         MP_WritePhyUshort(sc, 0x06, 0x8ac0);
17312         MP_WritePhyUshort(sc, 0x06, 0xe78a);
17313         MP_WritePhyUshort(sc, 0x06, 0xc1ae);
17314         MP_WritePhyUshort(sc, 0x06, 0x08ee);
17315         MP_WritePhyUshort(sc, 0x06, 0x8ac0);
17316         MP_WritePhyUshort(sc, 0x06, 0x00ee);
17317         MP_WritePhyUshort(sc, 0x06, 0x8ac1);
17318         MP_WritePhyUshort(sc, 0x06, 0x00fd);
17319         MP_WritePhyUshort(sc, 0x06, 0xfc04);
17320         MP_WritePhyUshort(sc, 0x06, 0xae20);
17321         MP_WritePhyUshort(sc, 0x06, 0x0000);
17322         MP_WritePhyUshort(sc, 0x06, 0x0000);
17323         MP_WritePhyUshort(sc, 0x06, 0x0000);
17324         MP_WritePhyUshort(sc, 0x06, 0x0000);
17325         MP_WritePhyUshort(sc, 0x06, 0x0000);
17326         MP_WritePhyUshort(sc, 0x06, 0x0000);
17327         MP_WritePhyUshort(sc, 0x06, 0x0000);
17328         MP_WritePhyUshort(sc, 0x06, 0x0000);
17329         MP_WritePhyUshort(sc, 0x06, 0x0000);
17330         MP_WritePhyUshort(sc, 0x06, 0x0000);
17331         MP_WritePhyUshort(sc, 0x06, 0x0000);
17332         MP_WritePhyUshort(sc, 0x06, 0x0000);
17333         MP_WritePhyUshort(sc, 0x06, 0x0000);
17334         MP_WritePhyUshort(sc, 0x06, 0x0000);
17335         MP_WritePhyUshort(sc, 0x06, 0x0000);
17336         MP_WritePhyUshort(sc, 0x06, 0x0000);
17337         MP_WritePhyUshort(sc, 0x06, 0xf8fa);
17338         MP_WritePhyUshort(sc, 0x06, 0xef69);
17339         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
17340         MP_WritePhyUshort(sc, 0x06, 0x00e1);
17341         MP_WritePhyUshort(sc, 0x06, 0xe001);
17342         MP_WritePhyUshort(sc, 0x06, 0xad27);
17343         MP_WritePhyUshort(sc, 0x06, 0x32e0);
17344         MP_WritePhyUshort(sc, 0x06, 0x8b40);
17345         MP_WritePhyUshort(sc, 0x06, 0xf720);
17346         MP_WritePhyUshort(sc, 0x06, 0xe48b);
17347         MP_WritePhyUshort(sc, 0x06, 0x40bf);
17348         MP_WritePhyUshort(sc, 0x06, 0x3230);
17349         MP_WritePhyUshort(sc, 0x06, 0x0238);
17350         MP_WritePhyUshort(sc, 0x06, 0x50ad);
17351         MP_WritePhyUshort(sc, 0x06, 0x2821);
17352         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
17353         MP_WritePhyUshort(sc, 0x06, 0x20e1);
17354         MP_WritePhyUshort(sc, 0x06, 0xe021);
17355         MP_WritePhyUshort(sc, 0x06, 0xad20);
17356         MP_WritePhyUshort(sc, 0x06, 0x18e0);
17357         MP_WritePhyUshort(sc, 0x06, 0x8b40);
17358         MP_WritePhyUshort(sc, 0x06, 0xf620);
17359         MP_WritePhyUshort(sc, 0x06, 0xe48b);
17360         MP_WritePhyUshort(sc, 0x06, 0x40ee);
17361         MP_WritePhyUshort(sc, 0x06, 0x8b3b);
17362         MP_WritePhyUshort(sc, 0x06, 0xffe0);
17363         MP_WritePhyUshort(sc, 0x06, 0x8a8a);
17364         MP_WritePhyUshort(sc, 0x06, 0xe18a);
17365         MP_WritePhyUshort(sc, 0x06, 0x8be4);
17366         MP_WritePhyUshort(sc, 0x06, 0xe000);
17367         MP_WritePhyUshort(sc, 0x06, 0xe5e0);
17368         MP_WritePhyUshort(sc, 0x06, 0x01ef);
17369         MP_WritePhyUshort(sc, 0x06, 0x96fe);
17370         MP_WritePhyUshort(sc, 0x06, 0xfc04);
17371         MP_WritePhyUshort(sc, 0x06, 0xf8f9);
17372         MP_WritePhyUshort(sc, 0x06, 0xface);
17373         MP_WritePhyUshort(sc, 0x06, 0xfaef);
17374         MP_WritePhyUshort(sc, 0x06, 0x69fa);
17375         MP_WritePhyUshort(sc, 0x06, 0xd401);
17376         MP_WritePhyUshort(sc, 0x06, 0x55b4);
17377         MP_WritePhyUshort(sc, 0x06, 0xfebf);
17378         MP_WritePhyUshort(sc, 0x06, 0x1c1e);
17379         MP_WritePhyUshort(sc, 0x06, 0x0238);
17380         MP_WritePhyUshort(sc, 0x06, 0x50ac);
17381         MP_WritePhyUshort(sc, 0x06, 0x280b);
17382         MP_WritePhyUshort(sc, 0x06, 0xbf1c);
17383         MP_WritePhyUshort(sc, 0x06, 0x1b02);
17384         MP_WritePhyUshort(sc, 0x06, 0x3850);
17385         MP_WritePhyUshort(sc, 0x06, 0xac28);
17386         MP_WritePhyUshort(sc, 0x06, 0x49ae);
17387         MP_WritePhyUshort(sc, 0x06, 0x64bf);
17388         MP_WritePhyUshort(sc, 0x06, 0x1c1b);
17389         MP_WritePhyUshort(sc, 0x06, 0x0238);
17390         MP_WritePhyUshort(sc, 0x06, 0x50ac);
17391         MP_WritePhyUshort(sc, 0x06, 0x285b);
17392         MP_WritePhyUshort(sc, 0x06, 0xd000);
17393         MP_WritePhyUshort(sc, 0x06, 0x0284);
17394         MP_WritePhyUshort(sc, 0x06, 0xcaac);
17395         MP_WritePhyUshort(sc, 0x06, 0x2105);
17396         MP_WritePhyUshort(sc, 0x06, 0xac22);
17397         MP_WritePhyUshort(sc, 0x06, 0x02ae);
17398         MP_WritePhyUshort(sc, 0x06, 0x4ebf);
17399         MP_WritePhyUshort(sc, 0x06, 0xe0c4);
17400         MP_WritePhyUshort(sc, 0x06, 0xbe85);
17401         MP_WritePhyUshort(sc, 0x06, 0xf6d2);
17402         MP_WritePhyUshort(sc, 0x06, 0x04d8);
17403         MP_WritePhyUshort(sc, 0x06, 0x19d9);
17404         MP_WritePhyUshort(sc, 0x06, 0x1907);
17405         MP_WritePhyUshort(sc, 0x06, 0xdc19);
17406         MP_WritePhyUshort(sc, 0x06, 0xdd19);
17407         MP_WritePhyUshort(sc, 0x06, 0x0789);
17408         MP_WritePhyUshort(sc, 0x06, 0x89ef);
17409         MP_WritePhyUshort(sc, 0x06, 0x645e);
17410         MP_WritePhyUshort(sc, 0x06, 0x07ff);
17411         MP_WritePhyUshort(sc, 0x06, 0x0d65);
17412         MP_WritePhyUshort(sc, 0x06, 0x5cf8);
17413         MP_WritePhyUshort(sc, 0x06, 0x001e);
17414         MP_WritePhyUshort(sc, 0x06, 0x46dc);
17415         MP_WritePhyUshort(sc, 0x06, 0x19dd);
17416         MP_WritePhyUshort(sc, 0x06, 0x19b2);
17417         MP_WritePhyUshort(sc, 0x06, 0xe2d4);
17418         MP_WritePhyUshort(sc, 0x06, 0x0001);
17419         MP_WritePhyUshort(sc, 0x06, 0xbf1c);
17420         MP_WritePhyUshort(sc, 0x06, 0x1b02);
17421         MP_WritePhyUshort(sc, 0x06, 0x387d);
17422         MP_WritePhyUshort(sc, 0x06, 0xae1d);
17423         MP_WritePhyUshort(sc, 0x06, 0xbee0);
17424         MP_WritePhyUshort(sc, 0x06, 0xc4bf);
17425         MP_WritePhyUshort(sc, 0x06, 0x85f6);
17426         MP_WritePhyUshort(sc, 0x06, 0xd204);
17427         MP_WritePhyUshort(sc, 0x06, 0xd819);
17428         MP_WritePhyUshort(sc, 0x06, 0xd919);
17429         MP_WritePhyUshort(sc, 0x06, 0x07dc);
17430         MP_WritePhyUshort(sc, 0x06, 0x19dd);
17431         MP_WritePhyUshort(sc, 0x06, 0x1907);
17432         MP_WritePhyUshort(sc, 0x06, 0xb2f4);
17433         MP_WritePhyUshort(sc, 0x06, 0xd400);
17434         MP_WritePhyUshort(sc, 0x06, 0x00bf);
17435         MP_WritePhyUshort(sc, 0x06, 0x1c1b);
17436         MP_WritePhyUshort(sc, 0x06, 0x0238);
17437         MP_WritePhyUshort(sc, 0x06, 0x7dfe);
17438         MP_WritePhyUshort(sc, 0x06, 0xef96);
17439         MP_WritePhyUshort(sc, 0x06, 0xfec6);
17440         MP_WritePhyUshort(sc, 0x06, 0xfefd);
17441         MP_WritePhyUshort(sc, 0x06, 0xfc05);
17442         MP_WritePhyUshort(sc, 0x06, 0xf9e2);
17443         MP_WritePhyUshort(sc, 0x06, 0xe0ea);
17444         MP_WritePhyUshort(sc, 0x06, 0xe3e0);
17445         MP_WritePhyUshort(sc, 0x06, 0xeb5a);
17446         MP_WritePhyUshort(sc, 0x06, 0x070c);
17447         MP_WritePhyUshort(sc, 0x06, 0x031e);
17448         MP_WritePhyUshort(sc, 0x06, 0x20e6);
17449         MP_WritePhyUshort(sc, 0x06, 0xe0ea);
17450         MP_WritePhyUshort(sc, 0x06, 0xe7e0);
17451         MP_WritePhyUshort(sc, 0x06, 0xebe0);
17452         MP_WritePhyUshort(sc, 0x06, 0xe0fc);
17453         MP_WritePhyUshort(sc, 0x06, 0xe1e0);
17454         MP_WritePhyUshort(sc, 0x06, 0xfdfd);
17455         MP_WritePhyUshort(sc, 0x06, 0x04f8);
17456         MP_WritePhyUshort(sc, 0x06, 0xfaef);
17457         MP_WritePhyUshort(sc, 0x06, 0x69e0);
17458         MP_WritePhyUshort(sc, 0x06, 0x8b80);
17459         MP_WritePhyUshort(sc, 0x06, 0xad27);
17460         MP_WritePhyUshort(sc, 0x06, 0x22bf);
17461         MP_WritePhyUshort(sc, 0x06, 0x4616);
17462         MP_WritePhyUshort(sc, 0x06, 0x0238);
17463         MP_WritePhyUshort(sc, 0x06, 0x50e0);
17464         MP_WritePhyUshort(sc, 0x06, 0x8b44);
17465         MP_WritePhyUshort(sc, 0x06, 0x1f01);
17466         MP_WritePhyUshort(sc, 0x06, 0x9e15);
17467         MP_WritePhyUshort(sc, 0x06, 0xe58b);
17468         MP_WritePhyUshort(sc, 0x06, 0x44ad);
17469         MP_WritePhyUshort(sc, 0x06, 0x2907);
17470         MP_WritePhyUshort(sc, 0x06, 0xac28);
17471         MP_WritePhyUshort(sc, 0x06, 0x04d1);
17472         MP_WritePhyUshort(sc, 0x06, 0x01ae);
17473         MP_WritePhyUshort(sc, 0x06, 0x02d1);
17474         MP_WritePhyUshort(sc, 0x06, 0x00bf);
17475         MP_WritePhyUshort(sc, 0x06, 0x85b0);
17476         MP_WritePhyUshort(sc, 0x06, 0x0238);
17477         MP_WritePhyUshort(sc, 0x06, 0x7def);
17478         MP_WritePhyUshort(sc, 0x06, 0x96fe);
17479         MP_WritePhyUshort(sc, 0x06, 0xfc04);
17480         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
17481         MP_WritePhyUshort(sc, 0x06, 0x8b85);
17482         MP_WritePhyUshort(sc, 0x06, 0xad26);
17483         MP_WritePhyUshort(sc, 0x06, 0x30e0);
17484         MP_WritePhyUshort(sc, 0x06, 0xe036);
17485         MP_WritePhyUshort(sc, 0x06, 0xe1e0);
17486         MP_WritePhyUshort(sc, 0x06, 0x37e1);
17487         MP_WritePhyUshort(sc, 0x06, 0x8b3f);
17488         MP_WritePhyUshort(sc, 0x06, 0x1f10);
17489         MP_WritePhyUshort(sc, 0x06, 0x9e23);
17490         MP_WritePhyUshort(sc, 0x06, 0xe48b);
17491         MP_WritePhyUshort(sc, 0x06, 0x3fac);
17492         MP_WritePhyUshort(sc, 0x06, 0x200b);
17493         MP_WritePhyUshort(sc, 0x06, 0xac21);
17494         MP_WritePhyUshort(sc, 0x06, 0x0dac);
17495         MP_WritePhyUshort(sc, 0x06, 0x250f);
17496         MP_WritePhyUshort(sc, 0x06, 0xac27);
17497         MP_WritePhyUshort(sc, 0x06, 0x11ae);
17498         MP_WritePhyUshort(sc, 0x06, 0x1202);
17499         MP_WritePhyUshort(sc, 0x06, 0x2c47);
17500         MP_WritePhyUshort(sc, 0x06, 0xae0d);
17501         MP_WritePhyUshort(sc, 0x06, 0x0285);
17502         MP_WritePhyUshort(sc, 0x06, 0x4fae);
17503         MP_WritePhyUshort(sc, 0x06, 0x0802);
17504         MP_WritePhyUshort(sc, 0x06, 0x2c69);
17505         MP_WritePhyUshort(sc, 0x06, 0xae03);
17506         MP_WritePhyUshort(sc, 0x06, 0x022c);
17507         MP_WritePhyUshort(sc, 0x06, 0x7cfc);
17508         MP_WritePhyUshort(sc, 0x06, 0x04f8);
17509         MP_WritePhyUshort(sc, 0x06, 0xfaef);
17510         MP_WritePhyUshort(sc, 0x06, 0x6902);
17511         MP_WritePhyUshort(sc, 0x06, 0x856c);
17512         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
17513         MP_WritePhyUshort(sc, 0x06, 0x14e1);
17514         MP_WritePhyUshort(sc, 0x06, 0xe015);
17515         MP_WritePhyUshort(sc, 0x06, 0xad26);
17516         MP_WritePhyUshort(sc, 0x06, 0x08d1);
17517         MP_WritePhyUshort(sc, 0x06, 0x1ebf);
17518         MP_WritePhyUshort(sc, 0x06, 0x2cd9);
17519         MP_WritePhyUshort(sc, 0x06, 0x0238);
17520         MP_WritePhyUshort(sc, 0x06, 0x7def);
17521         MP_WritePhyUshort(sc, 0x06, 0x96fe);
17522         MP_WritePhyUshort(sc, 0x06, 0xfc04);
17523         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
17524         MP_WritePhyUshort(sc, 0x06, 0x8b85);
17525         MP_WritePhyUshort(sc, 0x06, 0xad27);
17526         MP_WritePhyUshort(sc, 0x06, 0x2fd0);
17527         MP_WritePhyUshort(sc, 0x06, 0x0b02);
17528         MP_WritePhyUshort(sc, 0x06, 0x3682);
17529         MP_WritePhyUshort(sc, 0x06, 0x5882);
17530         MP_WritePhyUshort(sc, 0x06, 0x7882);
17531         MP_WritePhyUshort(sc, 0x06, 0x9f24);
17532         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17533         MP_WritePhyUshort(sc, 0x06, 0x32e1);
17534         MP_WritePhyUshort(sc, 0x06, 0x8b33);
17535         MP_WritePhyUshort(sc, 0x06, 0x1f10);
17536         MP_WritePhyUshort(sc, 0x06, 0x9e1a);
17537         MP_WritePhyUshort(sc, 0x06, 0x10e4);
17538         MP_WritePhyUshort(sc, 0x06, 0x8b32);
17539         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
17540         MP_WritePhyUshort(sc, 0x06, 0x28e1);
17541         MP_WritePhyUshort(sc, 0x06, 0xe029);
17542         MP_WritePhyUshort(sc, 0x06, 0xf72c);
17543         MP_WritePhyUshort(sc, 0x06, 0xe4e0);
17544         MP_WritePhyUshort(sc, 0x06, 0x28e5);
17545         MP_WritePhyUshort(sc, 0x06, 0xe029);
17546         MP_WritePhyUshort(sc, 0x06, 0xf62c);
17547         MP_WritePhyUshort(sc, 0x06, 0xe4e0);
17548         MP_WritePhyUshort(sc, 0x06, 0x28e5);
17549         MP_WritePhyUshort(sc, 0x06, 0xe029);
17550         MP_WritePhyUshort(sc, 0x06, 0xfc04);
17551         MP_WritePhyUshort(sc, 0x06, 0x00e1);
17552         MP_WritePhyUshort(sc, 0x06, 0x4077);
17553         MP_WritePhyUshort(sc, 0x06, 0xe140);
17554         MP_WritePhyUshort(sc, 0x06, 0x52e0);
17555         MP_WritePhyUshort(sc, 0x06, 0xeed9);
17556         MP_WritePhyUshort(sc, 0x06, 0xe04c);
17557         MP_WritePhyUshort(sc, 0x06, 0xbbe0);
17558         MP_WritePhyUshort(sc, 0x06, 0x2a00);
17559         MP_WritePhyUshort(sc, 0x05, 0xe142);
17560         PhyRegValue = MP_ReadPhyUshort(sc, 0x06);
17561         PhyRegValue |= BIT_0;
17562         MP_WritePhyUshort(sc, 0x06, PhyRegValue);
17563         MP_WritePhyUshort(sc, 0x05, 0xe140);
17564         PhyRegValue = MP_ReadPhyUshort(sc, 0x06);
17565         PhyRegValue |= BIT_0;
17566         MP_WritePhyUshort(sc, 0x06, PhyRegValue);
17567         MP_WritePhyUshort(sc, 0x1f, 0x0000);
17568         MP_WritePhyUshort(sc, 0x1f, 0x0005);
17569         for (i = 0; i < 200; i++) {
17570                 DELAY(100);
17571                 PhyRegValue = MP_ReadPhyUshort(sc, 0x00);
17572                 if (PhyRegValue & BIT_7)
17573                         break;
17574         }
17575
17576         MP_WritePhyUshort(sc, 0x1f, 0x0007);
17577         MP_WritePhyUshort(sc, 0x1e, 0x0023);
17578         PhyRegValue = MP_ReadPhyUshort(sc, 0x17);
17579         PhyRegValue |= BIT_1;
17580         if (sc->RequiredSecLanDonglePatch)
17581                 PhyRegValue &= ~(BIT_2);
17582         MP_WritePhyUshort(sc, 0x17, PhyRegValue);
17583         MP_WritePhyUshort(sc, 0x1f, 0x0000);
17584
17585         MP_WritePhyUshort(sc, 0x1f, 0x0003);
17586         MP_WritePhyUshort(sc, 0x09, 0xA20F);
17587         MP_WritePhyUshort(sc, 0x1f, 0x0000);
17588
17589         MP_WritePhyUshort(sc, 0x1f, 0x0003);
17590         MP_WritePhyUshort(sc, 0x01, 0x328A);
17591         MP_WritePhyUshort(sc, 0x1f, 0x0000);
17592
17593         MP_WritePhyUshort(sc, 0x1f, 0x0003);
17594         PhyRegValue = MP_ReadPhyUshort(sc, 0x19);
17595         PhyRegValue &= ~BIT_0;
17596         MP_WritePhyUshort(sc, 0x19, PhyRegValue);
17597         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
17598         PhyRegValue &= ~BIT_10;
17599         MP_WritePhyUshort(sc, 0x10, PhyRegValue);
17600         MP_WritePhyUshort(sc, 0x1f, 0x0000);
17601
17602
17603         MP_WritePhyUshort(sc, 0x1f, 0x0000);
17604         MP_WritePhyUshort(sc, 0x00, 0x9200);
17605 }
17606
17607 static void re_set_phy_mcu_8168f_2(struct re_softc *sc)
17608 {
17609         u_int16_t PhyRegValue;
17610         int i;
17611
17612         MP_WritePhyUshort(sc, 0x1f, 0x0000);
17613         MP_WritePhyUshort(sc, 0x00, 0x1800);
17614         PhyRegValue = MP_ReadPhyUshort(sc, 0x15);
17615         PhyRegValue &= ~(BIT_12);
17616         MP_WritePhyUshort(sc, 0x15, PhyRegValue);
17617         MP_WritePhyUshort(sc, 0x00, 0x9800);
17618         MP_WritePhyUshort(sc, 0x1f, 0x0007);
17619         MP_WritePhyUshort(sc, 0x1e, 0x002f);
17620         for (i = 0; i < 1000; i++) {
17621                 DELAY(100);
17622                 PhyRegValue = MP_ReadPhyUshort(sc, 0x1c);
17623                 if (PhyRegValue & BIT_7)
17624                         break;
17625         }
17626         MP_WritePhyUshort(sc, 0x1f, 0x0007);
17627         MP_WritePhyUshort(sc, 0x1e, 0x0023);
17628         MP_WritePhyUshort(sc, 0x16, 0x0306);
17629         MP_WritePhyUshort(sc, 0x16, 0x0307);
17630         MP_WritePhyUshort(sc, 0x15, 0x0098);
17631         MP_WritePhyUshort(sc, 0x19, 0x7c0b);
17632         MP_WritePhyUshort(sc, 0x15, 0x0099);
17633         MP_WritePhyUshort(sc, 0x19, 0x6c0b);
17634         MP_WritePhyUshort(sc, 0x15, 0x00eb);
17635         MP_WritePhyUshort(sc, 0x19, 0x6c0b);
17636         MP_WritePhyUshort(sc, 0x15, 0x00f8);
17637         MP_WritePhyUshort(sc, 0x19, 0x6f0b);
17638         MP_WritePhyUshort(sc, 0x15, 0x00fe);
17639         MP_WritePhyUshort(sc, 0x19, 0x6f0f);
17640         MP_WritePhyUshort(sc, 0x15, 0x00db);
17641         MP_WritePhyUshort(sc, 0x19, 0x6f09);
17642         MP_WritePhyUshort(sc, 0x15, 0x00dc);
17643         MP_WritePhyUshort(sc, 0x19, 0xaefd);
17644         MP_WritePhyUshort(sc, 0x15, 0x00dd);
17645         MP_WritePhyUshort(sc, 0x19, 0x6f0b);
17646         MP_WritePhyUshort(sc, 0x15, 0x00de);
17647         MP_WritePhyUshort(sc, 0x19, 0xc60b);
17648         MP_WritePhyUshort(sc, 0x15, 0x00df);
17649         MP_WritePhyUshort(sc, 0x19, 0x00fa);
17650         MP_WritePhyUshort(sc, 0x15, 0x00e0);
17651         MP_WritePhyUshort(sc, 0x19, 0x30e1);
17652         MP_WritePhyUshort(sc, 0x15, 0x020c);
17653         MP_WritePhyUshort(sc, 0x19, 0x3224);
17654         MP_WritePhyUshort(sc, 0x15, 0x020e);
17655         MP_WritePhyUshort(sc, 0x19, 0x9813);
17656         MP_WritePhyUshort(sc, 0x15, 0x020f);
17657         MP_WritePhyUshort(sc, 0x19, 0x7801);
17658         MP_WritePhyUshort(sc, 0x15, 0x0210);
17659         MP_WritePhyUshort(sc, 0x19, 0x930f);
17660         MP_WritePhyUshort(sc, 0x15, 0x0211);
17661         MP_WritePhyUshort(sc, 0x19, 0x9206);
17662         MP_WritePhyUshort(sc, 0x15, 0x0212);
17663         MP_WritePhyUshort(sc, 0x19, 0x4002);
17664         MP_WritePhyUshort(sc, 0x15, 0x0213);
17665         MP_WritePhyUshort(sc, 0x19, 0x7800);
17666         MP_WritePhyUshort(sc, 0x15, 0x0214);
17667         MP_WritePhyUshort(sc, 0x19, 0x588f);
17668         MP_WritePhyUshort(sc, 0x15, 0x0215);
17669         MP_WritePhyUshort(sc, 0x19, 0x5520);
17670         MP_WritePhyUshort(sc, 0x15, 0x0216);
17671         MP_WritePhyUshort(sc, 0x19, 0x3224);
17672         MP_WritePhyUshort(sc, 0x15, 0x0217);
17673         MP_WritePhyUshort(sc, 0x19, 0x4002);
17674         MP_WritePhyUshort(sc, 0x15, 0x0218);
17675         MP_WritePhyUshort(sc, 0x19, 0x7800);
17676         MP_WritePhyUshort(sc, 0x15, 0x0219);
17677         MP_WritePhyUshort(sc, 0x19, 0x588d);
17678         MP_WritePhyUshort(sc, 0x15, 0x021a);
17679         MP_WritePhyUshort(sc, 0x19, 0x5540);
17680         MP_WritePhyUshort(sc, 0x15, 0x021b);
17681         MP_WritePhyUshort(sc, 0x19, 0x9e03);
17682         MP_WritePhyUshort(sc, 0x15, 0x021c);
17683         MP_WritePhyUshort(sc, 0x19, 0x7c40);
17684         MP_WritePhyUshort(sc, 0x15, 0x021d);
17685         MP_WritePhyUshort(sc, 0x19, 0x6840);
17686         MP_WritePhyUshort(sc, 0x15, 0x021e);
17687         MP_WritePhyUshort(sc, 0x19, 0x3224);
17688         MP_WritePhyUshort(sc, 0x15, 0x021f);
17689         MP_WritePhyUshort(sc, 0x19, 0x4002);
17690         MP_WritePhyUshort(sc, 0x15, 0x0220);
17691         MP_WritePhyUshort(sc, 0x19, 0x3224);
17692         MP_WritePhyUshort(sc, 0x15, 0x0221);
17693         MP_WritePhyUshort(sc, 0x19, 0x9e03);
17694         MP_WritePhyUshort(sc, 0x15, 0x0222);
17695         MP_WritePhyUshort(sc, 0x19, 0x7c40);
17696         MP_WritePhyUshort(sc, 0x15, 0x0223);
17697         MP_WritePhyUshort(sc, 0x19, 0x6840);
17698         MP_WritePhyUshort(sc, 0x15, 0x0224);
17699         MP_WritePhyUshort(sc, 0x19, 0x7800);
17700         MP_WritePhyUshort(sc, 0x15, 0x0225);
17701         MP_WritePhyUshort(sc, 0x19, 0x3231);
17702         MP_WritePhyUshort(sc, 0x15, 0x0000);
17703         MP_WritePhyUshort(sc, 0x16, 0x0306);
17704         MP_WritePhyUshort(sc, 0x16, 0x0300);
17705         MP_WritePhyUshort(sc, 0x1f, 0x0000);
17706         MP_WritePhyUshort(sc, 0x1f, 0x0005);
17707         MP_WritePhyUshort(sc, 0x05, 0xfff6);
17708         MP_WritePhyUshort(sc, 0x06, 0x0080);
17709         MP_WritePhyUshort(sc, 0x05, 0x8000);
17710         MP_WritePhyUshort(sc, 0x06, 0x0280);
17711         MP_WritePhyUshort(sc, 0x06, 0x48f7);
17712         MP_WritePhyUshort(sc, 0x06, 0x00e0);
17713         MP_WritePhyUshort(sc, 0x06, 0xfff7);
17714         MP_WritePhyUshort(sc, 0x06, 0xa080);
17715         MP_WritePhyUshort(sc, 0x06, 0x02ae);
17716         MP_WritePhyUshort(sc, 0x06, 0xf602);
17717         MP_WritePhyUshort(sc, 0x06, 0x011b);
17718         MP_WritePhyUshort(sc, 0x06, 0x0201);
17719         MP_WritePhyUshort(sc, 0x06, 0x2802);
17720         MP_WritePhyUshort(sc, 0x06, 0x0135);
17721         MP_WritePhyUshort(sc, 0x06, 0x0201);
17722         MP_WritePhyUshort(sc, 0x06, 0x4502);
17723         MP_WritePhyUshort(sc, 0x06, 0x015f);
17724         MP_WritePhyUshort(sc, 0x06, 0x0280);
17725         MP_WritePhyUshort(sc, 0x06, 0x6b02);
17726         MP_WritePhyUshort(sc, 0x06, 0x80e5);
17727         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17728         MP_WritePhyUshort(sc, 0x06, 0x88e1);
17729         MP_WritePhyUshort(sc, 0x06, 0x8b89);
17730         MP_WritePhyUshort(sc, 0x06, 0x1e01);
17731         MP_WritePhyUshort(sc, 0x06, 0xe18b);
17732         MP_WritePhyUshort(sc, 0x06, 0x8a1e);
17733         MP_WritePhyUshort(sc, 0x06, 0x01e1);
17734         MP_WritePhyUshort(sc, 0x06, 0x8b8b);
17735         MP_WritePhyUshort(sc, 0x06, 0x1e01);
17736         MP_WritePhyUshort(sc, 0x06, 0xe18b);
17737         MP_WritePhyUshort(sc, 0x06, 0x8c1e);
17738         MP_WritePhyUshort(sc, 0x06, 0x01e1);
17739         MP_WritePhyUshort(sc, 0x06, 0x8b8d);
17740         MP_WritePhyUshort(sc, 0x06, 0x1e01);
17741         MP_WritePhyUshort(sc, 0x06, 0xe18b);
17742         MP_WritePhyUshort(sc, 0x06, 0x8e1e);
17743         MP_WritePhyUshort(sc, 0x06, 0x01a0);
17744         MP_WritePhyUshort(sc, 0x06, 0x00c7);
17745         MP_WritePhyUshort(sc, 0x06, 0xaebb);
17746         MP_WritePhyUshort(sc, 0x06, 0xbf8b);
17747         MP_WritePhyUshort(sc, 0x06, 0x88ec);
17748         MP_WritePhyUshort(sc, 0x06, 0x0019);
17749         MP_WritePhyUshort(sc, 0x06, 0xa98b);
17750         MP_WritePhyUshort(sc, 0x06, 0x90f9);
17751         MP_WritePhyUshort(sc, 0x06, 0xeeff);
17752         MP_WritePhyUshort(sc, 0x06, 0xf600);
17753         MP_WritePhyUshort(sc, 0x06, 0xeeff);
17754         MP_WritePhyUshort(sc, 0x06, 0xf7fe);
17755         MP_WritePhyUshort(sc, 0x06, 0xd100);
17756         MP_WritePhyUshort(sc, 0x06, 0xbf81);
17757         MP_WritePhyUshort(sc, 0x06, 0x9802);
17758         MP_WritePhyUshort(sc, 0x06, 0x39f3);
17759         MP_WritePhyUshort(sc, 0x06, 0xd101);
17760         MP_WritePhyUshort(sc, 0x06, 0xbf81);
17761         MP_WritePhyUshort(sc, 0x06, 0x9b02);
17762         MP_WritePhyUshort(sc, 0x06, 0x39f3);
17763         MP_WritePhyUshort(sc, 0x06, 0x04f8);
17764         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17765         MP_WritePhyUshort(sc, 0x06, 0x8dad);
17766         MP_WritePhyUshort(sc, 0x06, 0x2014);
17767         MP_WritePhyUshort(sc, 0x06, 0xee8b);
17768         MP_WritePhyUshort(sc, 0x06, 0x8d00);
17769         MP_WritePhyUshort(sc, 0x06, 0xe08a);
17770         MP_WritePhyUshort(sc, 0x06, 0x5a78);
17771         MP_WritePhyUshort(sc, 0x06, 0x039e);
17772         MP_WritePhyUshort(sc, 0x06, 0x0902);
17773         MP_WritePhyUshort(sc, 0x06, 0x05fc);
17774         MP_WritePhyUshort(sc, 0x06, 0x0280);
17775         MP_WritePhyUshort(sc, 0x06, 0x8802);
17776         MP_WritePhyUshort(sc, 0x06, 0x32dd);
17777         MP_WritePhyUshort(sc, 0x06, 0xfc04);
17778         MP_WritePhyUshort(sc, 0x06, 0xf8f9);
17779         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17780         MP_WritePhyUshort(sc, 0x06, 0x81ac);
17781         MP_WritePhyUshort(sc, 0x06, 0x261a);
17782         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17783         MP_WritePhyUshort(sc, 0x06, 0x81ac);
17784         MP_WritePhyUshort(sc, 0x06, 0x2114);
17785         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17786         MP_WritePhyUshort(sc, 0x06, 0x85ac);
17787         MP_WritePhyUshort(sc, 0x06, 0x200e);
17788         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17789         MP_WritePhyUshort(sc, 0x06, 0x85ac);
17790         MP_WritePhyUshort(sc, 0x06, 0x2308);
17791         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17792         MP_WritePhyUshort(sc, 0x06, 0x87ac);
17793         MP_WritePhyUshort(sc, 0x06, 0x2402);
17794         MP_WritePhyUshort(sc, 0x06, 0xae38);
17795         MP_WritePhyUshort(sc, 0x06, 0x021a);
17796         MP_WritePhyUshort(sc, 0x06, 0xd6ee);
17797         MP_WritePhyUshort(sc, 0x06, 0xe41c);
17798         MP_WritePhyUshort(sc, 0x06, 0x04ee);
17799         MP_WritePhyUshort(sc, 0x06, 0xe41d);
17800         MP_WritePhyUshort(sc, 0x06, 0x04e2);
17801         MP_WritePhyUshort(sc, 0x06, 0xe07c);
17802         MP_WritePhyUshort(sc, 0x06, 0xe3e0);
17803         MP_WritePhyUshort(sc, 0x06, 0x7de0);
17804         MP_WritePhyUshort(sc, 0x06, 0xe038);
17805         MP_WritePhyUshort(sc, 0x06, 0xe1e0);
17806         MP_WritePhyUshort(sc, 0x06, 0x39ad);
17807         MP_WritePhyUshort(sc, 0x06, 0x2e1b);
17808         MP_WritePhyUshort(sc, 0x06, 0xad39);
17809         MP_WritePhyUshort(sc, 0x06, 0x0dd1);
17810         MP_WritePhyUshort(sc, 0x06, 0x01bf);
17811         MP_WritePhyUshort(sc, 0x06, 0x22c8);
17812         MP_WritePhyUshort(sc, 0x06, 0x0239);
17813         MP_WritePhyUshort(sc, 0x06, 0xf302);
17814         MP_WritePhyUshort(sc, 0x06, 0x21f0);
17815         MP_WritePhyUshort(sc, 0x06, 0xae0b);
17816         MP_WritePhyUshort(sc, 0x06, 0xac38);
17817         MP_WritePhyUshort(sc, 0x06, 0x02ae);
17818         MP_WritePhyUshort(sc, 0x06, 0x0602);
17819         MP_WritePhyUshort(sc, 0x06, 0x222d);
17820         MP_WritePhyUshort(sc, 0x06, 0x0222);
17821         MP_WritePhyUshort(sc, 0x06, 0x7202);
17822         MP_WritePhyUshort(sc, 0x06, 0x1ae7);
17823         MP_WritePhyUshort(sc, 0x06, 0xfdfc);
17824         MP_WritePhyUshort(sc, 0x06, 0x04f8);
17825         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17826         MP_WritePhyUshort(sc, 0x06, 0x8ead);
17827         MP_WritePhyUshort(sc, 0x06, 0x201a);
17828         MP_WritePhyUshort(sc, 0x06, 0xf620);
17829         MP_WritePhyUshort(sc, 0x06, 0xe48b);
17830         MP_WritePhyUshort(sc, 0x06, 0x8e02);
17831         MP_WritePhyUshort(sc, 0x06, 0x2afe);
17832         MP_WritePhyUshort(sc, 0x06, 0x022c);
17833         MP_WritePhyUshort(sc, 0x06, 0x5c02);
17834         MP_WritePhyUshort(sc, 0x06, 0x03c5);
17835         MP_WritePhyUshort(sc, 0x06, 0x0281);
17836         MP_WritePhyUshort(sc, 0x06, 0x6702);
17837         MP_WritePhyUshort(sc, 0x06, 0x2e4f);
17838         MP_WritePhyUshort(sc, 0x06, 0x0204);
17839         MP_WritePhyUshort(sc, 0x06, 0x8902);
17840         MP_WritePhyUshort(sc, 0x06, 0x2f7a);
17841         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17842         MP_WritePhyUshort(sc, 0x06, 0x8ead);
17843         MP_WritePhyUshort(sc, 0x06, 0x210b);
17844         MP_WritePhyUshort(sc, 0x06, 0xf621);
17845         MP_WritePhyUshort(sc, 0x06, 0xe48b);
17846         MP_WritePhyUshort(sc, 0x06, 0x8e02);
17847         MP_WritePhyUshort(sc, 0x06, 0x0445);
17848         MP_WritePhyUshort(sc, 0x06, 0x021c);
17849         MP_WritePhyUshort(sc, 0x06, 0xb8e0);
17850         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
17851         MP_WritePhyUshort(sc, 0x06, 0xad22);
17852         MP_WritePhyUshort(sc, 0x06, 0x08f6);
17853         MP_WritePhyUshort(sc, 0x06, 0x22e4);
17854         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
17855         MP_WritePhyUshort(sc, 0x06, 0x0235);
17856         MP_WritePhyUshort(sc, 0x06, 0xd4e0);
17857         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
17858         MP_WritePhyUshort(sc, 0x06, 0xad23);
17859         MP_WritePhyUshort(sc, 0x06, 0x08f6);
17860         MP_WritePhyUshort(sc, 0x06, 0x23e4);
17861         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
17862         MP_WritePhyUshort(sc, 0x06, 0x0231);
17863         MP_WritePhyUshort(sc, 0x06, 0xc8e0);
17864         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
17865         MP_WritePhyUshort(sc, 0x06, 0xad24);
17866         MP_WritePhyUshort(sc, 0x06, 0x05f6);
17867         MP_WritePhyUshort(sc, 0x06, 0x24e4);
17868         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
17869         MP_WritePhyUshort(sc, 0x06, 0xe08b);
17870         MP_WritePhyUshort(sc, 0x06, 0x8ead);
17871         MP_WritePhyUshort(sc, 0x06, 0x2505);
17872         MP_WritePhyUshort(sc, 0x06, 0xf625);
17873         MP_WritePhyUshort(sc, 0x06, 0xe48b);
17874         MP_WritePhyUshort(sc, 0x06, 0x8ee0);
17875         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
17876         MP_WritePhyUshort(sc, 0x06, 0xad26);
17877         MP_WritePhyUshort(sc, 0x06, 0x08f6);
17878         MP_WritePhyUshort(sc, 0x06, 0x26e4);
17879         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
17880         MP_WritePhyUshort(sc, 0x06, 0x022d);
17881         MP_WritePhyUshort(sc, 0x06, 0x6ae0);
17882         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
17883         MP_WritePhyUshort(sc, 0x06, 0xad27);
17884         MP_WritePhyUshort(sc, 0x06, 0x05f6);
17885         MP_WritePhyUshort(sc, 0x06, 0x27e4);
17886         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
17887         MP_WritePhyUshort(sc, 0x06, 0x0203);
17888         MP_WritePhyUshort(sc, 0x06, 0x8bfc);
17889         MP_WritePhyUshort(sc, 0x06, 0x04f8);
17890         MP_WritePhyUshort(sc, 0x06, 0xfaef);
17891         MP_WritePhyUshort(sc, 0x06, 0x69e0);
17892         MP_WritePhyUshort(sc, 0x06, 0x8b80);
17893         MP_WritePhyUshort(sc, 0x06, 0xad27);
17894         MP_WritePhyUshort(sc, 0x06, 0x22bf);
17895         MP_WritePhyUshort(sc, 0x06, 0x479a);
17896         MP_WritePhyUshort(sc, 0x06, 0x0239);
17897         MP_WritePhyUshort(sc, 0x06, 0xc6e0);
17898         MP_WritePhyUshort(sc, 0x06, 0x8b44);
17899         MP_WritePhyUshort(sc, 0x06, 0x1f01);
17900         MP_WritePhyUshort(sc, 0x06, 0x9e15);
17901         MP_WritePhyUshort(sc, 0x06, 0xe58b);
17902         MP_WritePhyUshort(sc, 0x06, 0x44ad);
17903         MP_WritePhyUshort(sc, 0x06, 0x2907);
17904         MP_WritePhyUshort(sc, 0x06, 0xac28);
17905         MP_WritePhyUshort(sc, 0x06, 0x04d1);
17906         MP_WritePhyUshort(sc, 0x06, 0x01ae);
17907         MP_WritePhyUshort(sc, 0x06, 0x02d1);
17908         MP_WritePhyUshort(sc, 0x06, 0x00bf);
17909         MP_WritePhyUshort(sc, 0x06, 0x819e);
17910         MP_WritePhyUshort(sc, 0x06, 0x0239);
17911         MP_WritePhyUshort(sc, 0x06, 0xf3ef);
17912         MP_WritePhyUshort(sc, 0x06, 0x96fe);
17913         MP_WritePhyUshort(sc, 0x06, 0xfc04);
17914         MP_WritePhyUshort(sc, 0x06, 0x00e1);
17915         MP_WritePhyUshort(sc, 0x06, 0x4077);
17916         MP_WritePhyUshort(sc, 0x06, 0xe140);
17917         MP_WritePhyUshort(sc, 0x06, 0xbbe0);
17918         MP_WritePhyUshort(sc, 0x06, 0x2a00);
17919         MP_WritePhyUshort(sc, 0x05, 0xe142);
17920         PhyRegValue = MP_ReadPhyUshort(sc, 0x06);
17921         PhyRegValue |= BIT_0;
17922         MP_WritePhyUshort(sc, 0x06, PhyRegValue);
17923         MP_WritePhyUshort(sc, 0x05, 0xe140);
17924         PhyRegValue = MP_ReadPhyUshort(sc, 0x06);
17925         PhyRegValue |= BIT_0;
17926         MP_WritePhyUshort(sc, 0x06, PhyRegValue);
17927         MP_WritePhyUshort(sc, 0x1f, 0x0000);
17928         MP_WritePhyUshort(sc, 0x1f, 0x0007);
17929         MP_WritePhyUshort(sc, 0x1e, 0x0023);
17930         PhyRegValue = MP_ReadPhyUshort(sc, 0x17);
17931         PhyRegValue |= BIT_1;
17932         if (sc->RequiredSecLanDonglePatch)
17933                 PhyRegValue &= ~(BIT_2);
17934         MP_WritePhyUshort(sc, 0x17, PhyRegValue);
17935         MP_WritePhyUshort(sc, 0x1f, 0x0000);
17936
17937         MP_WritePhyUshort(sc, 0x1f, 0x0003);
17938         PhyRegValue = MP_ReadPhyUshort(sc, 0x19);
17939         PhyRegValue &= ~BIT_0;
17940         MP_WritePhyUshort(sc, 0x19, PhyRegValue);
17941         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
17942         PhyRegValue &= ~BIT_10;
17943         MP_WritePhyUshort(sc, 0x10, PhyRegValue);
17944
17945         MP_WritePhyUshort(sc, 0x1f, 0x0000);
17946         MP_WritePhyUshort(sc, 0x00, 0x9200);
17947 }
17948
17949 static void re_set_phy_mcu_8411_1(struct re_softc *sc)
17950 {
17951         u_int16_t PhyRegValue;
17952         int i;
17953
17954         MP_WritePhyUshort(sc, 0x1f, 0x0000);
17955         MP_WritePhyUshort(sc, 0x00, 0x1800);
17956         PhyRegValue = MP_ReadPhyUshort(sc, 0x15);
17957         PhyRegValue &= ~(BIT_12);
17958         MP_WritePhyUshort(sc, 0x15, PhyRegValue);
17959         MP_WritePhyUshort(sc, 0x00, 0x4800);
17960         MP_WritePhyUshort(sc, 0x1f, 0x0007);
17961         MP_WritePhyUshort(sc, 0x1e, 0x002f);
17962         for (i = 0; i < 1000; i++) {
17963                 DELAY(100);
17964                 PhyRegValue = MP_ReadPhyUshort(sc, 0x1c);
17965                 if (PhyRegValue & BIT_7)
17966                         break;
17967         }
17968         MP_WritePhyUshort(sc, 0x1f, 0x0000);
17969         MP_WritePhyUshort(sc, 0x00, 0x1800);
17970         MP_WritePhyUshort(sc, 0x1f, 0x0007);
17971         MP_WritePhyUshort(sc, 0x1e, 0x0023);
17972         for (i = 0; i < 200; i++) {
17973                 DELAY(100);
17974                 PhyRegValue = MP_ReadPhyUshort(sc, 0x18);
17975                 if (!(PhyRegValue & BIT_0))
17976                         break;
17977         }
17978         MP_WritePhyUshort(sc, 0x1f, 0x0005);
17979         MP_WritePhyUshort(sc, 0x05, 0xfff6);
17980         MP_WritePhyUshort(sc, 0x06, 0x0080);
17981         MP_WritePhyUshort(sc, 0x1f, 0x0007);
17982         MP_WritePhyUshort(sc, 0x1e, 0x0023);
17983         MP_WritePhyUshort(sc, 0x16, 0x0306);
17984         MP_WritePhyUshort(sc, 0x16, 0x0307);
17985         MP_WritePhyUshort(sc, 0x15, 0x0098);
17986         MP_WritePhyUshort(sc, 0x19, 0x7c0b);
17987         MP_WritePhyUshort(sc, 0x15, 0x0099);
17988         MP_WritePhyUshort(sc, 0x19, 0x6c0b);
17989         MP_WritePhyUshort(sc, 0x15, 0x00eb);
17990         MP_WritePhyUshort(sc, 0x19, 0x6c0b);
17991         MP_WritePhyUshort(sc, 0x15, 0x00f8);
17992         MP_WritePhyUshort(sc, 0x19, 0x6f0b);
17993         MP_WritePhyUshort(sc, 0x15, 0x00fe);
17994         MP_WritePhyUshort(sc, 0x19, 0x6f0f);
17995         MP_WritePhyUshort(sc, 0x15, 0x00db);
17996         MP_WritePhyUshort(sc, 0x19, 0x6f09);
17997         MP_WritePhyUshort(sc, 0x15, 0x00dc);
17998         MP_WritePhyUshort(sc, 0x19, 0xaefd);
17999         MP_WritePhyUshort(sc, 0x15, 0x00dd);
18000         MP_WritePhyUshort(sc, 0x19, 0x6f0b);
18001         MP_WritePhyUshort(sc, 0x15, 0x00de);
18002         MP_WritePhyUshort(sc, 0x19, 0xc60b);
18003         MP_WritePhyUshort(sc, 0x15, 0x00df);
18004         MP_WritePhyUshort(sc, 0x19, 0x00fa);
18005         MP_WritePhyUshort(sc, 0x15, 0x00e0);
18006         MP_WritePhyUshort(sc, 0x19, 0x30e1);
18007         MP_WritePhyUshort(sc, 0x15, 0x020c);
18008         MP_WritePhyUshort(sc, 0x19, 0x3224);
18009         MP_WritePhyUshort(sc, 0x15, 0x020e);
18010         MP_WritePhyUshort(sc, 0x19, 0x9813);
18011         MP_WritePhyUshort(sc, 0x15, 0x020f);
18012         MP_WritePhyUshort(sc, 0x19, 0x7801);
18013         MP_WritePhyUshort(sc, 0x15, 0x0210);
18014         MP_WritePhyUshort(sc, 0x19, 0x930f);
18015         MP_WritePhyUshort(sc, 0x15, 0x0211);
18016         MP_WritePhyUshort(sc, 0x19, 0x9206);
18017         MP_WritePhyUshort(sc, 0x15, 0x0212);
18018         MP_WritePhyUshort(sc, 0x19, 0x4002);
18019         MP_WritePhyUshort(sc, 0x15, 0x0213);
18020         MP_WritePhyUshort(sc, 0x19, 0x7800);
18021         MP_WritePhyUshort(sc, 0x15, 0x0214);
18022         MP_WritePhyUshort(sc, 0x19, 0x588f);
18023         MP_WritePhyUshort(sc, 0x15, 0x0215);
18024         MP_WritePhyUshort(sc, 0x19, 0x5520);
18025         MP_WritePhyUshort(sc, 0x15, 0x0216);
18026         MP_WritePhyUshort(sc, 0x19, 0x3224);
18027         MP_WritePhyUshort(sc, 0x15, 0x0217);
18028         MP_WritePhyUshort(sc, 0x19, 0x4002);
18029         MP_WritePhyUshort(sc, 0x15, 0x0218);
18030         MP_WritePhyUshort(sc, 0x19, 0x7800);
18031         MP_WritePhyUshort(sc, 0x15, 0x0219);
18032         MP_WritePhyUshort(sc, 0x19, 0x588d);
18033         MP_WritePhyUshort(sc, 0x15, 0x021a);
18034         MP_WritePhyUshort(sc, 0x19, 0x5540);
18035         MP_WritePhyUshort(sc, 0x15, 0x021b);
18036         MP_WritePhyUshort(sc, 0x19, 0x9e03);
18037         MP_WritePhyUshort(sc, 0x15, 0x021c);
18038         MP_WritePhyUshort(sc, 0x19, 0x7c40);
18039         MP_WritePhyUshort(sc, 0x15, 0x021d);
18040         MP_WritePhyUshort(sc, 0x19, 0x6840);
18041         MP_WritePhyUshort(sc, 0x15, 0x021e);
18042         MP_WritePhyUshort(sc, 0x19, 0x3224);
18043         MP_WritePhyUshort(sc, 0x15, 0x021f);
18044         MP_WritePhyUshort(sc, 0x19, 0x4002);
18045         MP_WritePhyUshort(sc, 0x15, 0x0220);
18046         MP_WritePhyUshort(sc, 0x19, 0x3224);
18047         MP_WritePhyUshort(sc, 0x15, 0x0221);
18048         MP_WritePhyUshort(sc, 0x19, 0x9e03);
18049         MP_WritePhyUshort(sc, 0x15, 0x0222);
18050         MP_WritePhyUshort(sc, 0x19, 0x7c40);
18051         MP_WritePhyUshort(sc, 0x15, 0x0223);
18052         MP_WritePhyUshort(sc, 0x19, 0x6840);
18053         MP_WritePhyUshort(sc, 0x15, 0x0224);
18054         MP_WritePhyUshort(sc, 0x19, 0x7800);
18055         MP_WritePhyUshort(sc, 0x15, 0x0225);
18056         MP_WritePhyUshort(sc, 0x19, 0x3231);
18057         MP_WritePhyUshort(sc, 0x15, 0x0000);
18058         MP_WritePhyUshort(sc, 0x16, 0x0306);
18059         MP_WritePhyUshort(sc, 0x16, 0x0300);
18060         MP_WritePhyUshort(sc, 0x1f, 0x0000);
18061         MP_WritePhyUshort(sc, 0x1f, 0x0005);
18062         MP_WritePhyUshort(sc, 0x05, 0xfff6);
18063         MP_WritePhyUshort(sc, 0x06, 0x0080);
18064         MP_WritePhyUshort(sc, 0x05, 0x8000);
18065         MP_WritePhyUshort(sc, 0x06, 0x0280);
18066         MP_WritePhyUshort(sc, 0x06, 0x48f7);
18067         MP_WritePhyUshort(sc, 0x06, 0x00e0);
18068         MP_WritePhyUshort(sc, 0x06, 0xfff7);
18069         MP_WritePhyUshort(sc, 0x06, 0xa080);
18070         MP_WritePhyUshort(sc, 0x06, 0x02ae);
18071         MP_WritePhyUshort(sc, 0x06, 0xf602);
18072         MP_WritePhyUshort(sc, 0x06, 0x011e);
18073         MP_WritePhyUshort(sc, 0x06, 0x0201);
18074         MP_WritePhyUshort(sc, 0x06, 0x2b02);
18075         MP_WritePhyUshort(sc, 0x06, 0x8077);
18076         MP_WritePhyUshort(sc, 0x06, 0x0201);
18077         MP_WritePhyUshort(sc, 0x06, 0x4802);
18078         MP_WritePhyUshort(sc, 0x06, 0x0162);
18079         MP_WritePhyUshort(sc, 0x06, 0x0280);
18080         MP_WritePhyUshort(sc, 0x06, 0x9402);
18081         MP_WritePhyUshort(sc, 0x06, 0x810e);
18082         MP_WritePhyUshort(sc, 0x06, 0xe08b);
18083         MP_WritePhyUshort(sc, 0x06, 0x88e1);
18084         MP_WritePhyUshort(sc, 0x06, 0x8b89);
18085         MP_WritePhyUshort(sc, 0x06, 0x1e01);
18086         MP_WritePhyUshort(sc, 0x06, 0xe18b);
18087         MP_WritePhyUshort(sc, 0x06, 0x8a1e);
18088         MP_WritePhyUshort(sc, 0x06, 0x01e1);
18089         MP_WritePhyUshort(sc, 0x06, 0x8b8b);
18090         MP_WritePhyUshort(sc, 0x06, 0x1e01);
18091         MP_WritePhyUshort(sc, 0x06, 0xe18b);
18092         MP_WritePhyUshort(sc, 0x06, 0x8c1e);
18093         MP_WritePhyUshort(sc, 0x06, 0x01e1);
18094         MP_WritePhyUshort(sc, 0x06, 0x8b8d);
18095         MP_WritePhyUshort(sc, 0x06, 0x1e01);
18096         MP_WritePhyUshort(sc, 0x06, 0xe18b);
18097         MP_WritePhyUshort(sc, 0x06, 0x8e1e);
18098         MP_WritePhyUshort(sc, 0x06, 0x01a0);
18099         MP_WritePhyUshort(sc, 0x06, 0x00c7);
18100         MP_WritePhyUshort(sc, 0x06, 0xaebb);
18101         MP_WritePhyUshort(sc, 0x06, 0xd481);
18102         MP_WritePhyUshort(sc, 0x06, 0xd4e4);
18103         MP_WritePhyUshort(sc, 0x06, 0x8b92);
18104         MP_WritePhyUshort(sc, 0x06, 0xe58b);
18105         MP_WritePhyUshort(sc, 0x06, 0x9302);
18106         MP_WritePhyUshort(sc, 0x06, 0x2e5a);
18107         MP_WritePhyUshort(sc, 0x06, 0xbf8b);
18108         MP_WritePhyUshort(sc, 0x06, 0x88ec);
18109         MP_WritePhyUshort(sc, 0x06, 0x0019);
18110         MP_WritePhyUshort(sc, 0x06, 0xa98b);
18111         MP_WritePhyUshort(sc, 0x06, 0x90f9);
18112         MP_WritePhyUshort(sc, 0x06, 0xeeff);
18113         MP_WritePhyUshort(sc, 0x06, 0xf600);
18114         MP_WritePhyUshort(sc, 0x06, 0xeeff);
18115         MP_WritePhyUshort(sc, 0x06, 0xf7fc);
18116         MP_WritePhyUshort(sc, 0x06, 0xd100);
18117         MP_WritePhyUshort(sc, 0x06, 0xbf83);
18118         MP_WritePhyUshort(sc, 0x06, 0x3c02);
18119         MP_WritePhyUshort(sc, 0x06, 0x3a21);
18120         MP_WritePhyUshort(sc, 0x06, 0xd101);
18121         MP_WritePhyUshort(sc, 0x06, 0xbf83);
18122         MP_WritePhyUshort(sc, 0x06, 0x3f02);
18123         MP_WritePhyUshort(sc, 0x06, 0x3a21);
18124         MP_WritePhyUshort(sc, 0x06, 0x04f8);
18125         MP_WritePhyUshort(sc, 0x06, 0xe08b);
18126         MP_WritePhyUshort(sc, 0x06, 0x8aad);
18127         MP_WritePhyUshort(sc, 0x06, 0x2014);
18128         MP_WritePhyUshort(sc, 0x06, 0xee8b);
18129         MP_WritePhyUshort(sc, 0x06, 0x8a00);
18130         MP_WritePhyUshort(sc, 0x06, 0x0220);
18131         MP_WritePhyUshort(sc, 0x06, 0x8be0);
18132         MP_WritePhyUshort(sc, 0x06, 0xe426);
18133         MP_WritePhyUshort(sc, 0x06, 0xe1e4);
18134         MP_WritePhyUshort(sc, 0x06, 0x27ee);
18135         MP_WritePhyUshort(sc, 0x06, 0xe426);
18136         MP_WritePhyUshort(sc, 0x06, 0x23e5);
18137         MP_WritePhyUshort(sc, 0x06, 0xe427);
18138         MP_WritePhyUshort(sc, 0x06, 0xfc04);
18139         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
18140         MP_WritePhyUshort(sc, 0x06, 0x8b8d);
18141         MP_WritePhyUshort(sc, 0x06, 0xad20);
18142         MP_WritePhyUshort(sc, 0x06, 0x14ee);
18143         MP_WritePhyUshort(sc, 0x06, 0x8b8d);
18144         MP_WritePhyUshort(sc, 0x06, 0x00e0);
18145         MP_WritePhyUshort(sc, 0x06, 0x8a5a);
18146         MP_WritePhyUshort(sc, 0x06, 0x7803);
18147         MP_WritePhyUshort(sc, 0x06, 0x9e09);
18148         MP_WritePhyUshort(sc, 0x06, 0x0206);
18149         MP_WritePhyUshort(sc, 0x06, 0x2802);
18150         MP_WritePhyUshort(sc, 0x06, 0x80b1);
18151         MP_WritePhyUshort(sc, 0x06, 0x0232);
18152         MP_WritePhyUshort(sc, 0x06, 0xfdfc);
18153         MP_WritePhyUshort(sc, 0x06, 0x04f8);
18154         MP_WritePhyUshort(sc, 0x06, 0xf9e0);
18155         MP_WritePhyUshort(sc, 0x06, 0x8b81);
18156         MP_WritePhyUshort(sc, 0x06, 0xac26);
18157         MP_WritePhyUshort(sc, 0x06, 0x1ae0);
18158         MP_WritePhyUshort(sc, 0x06, 0x8b81);
18159         MP_WritePhyUshort(sc, 0x06, 0xac21);
18160         MP_WritePhyUshort(sc, 0x06, 0x14e0);
18161         MP_WritePhyUshort(sc, 0x06, 0x8b85);
18162         MP_WritePhyUshort(sc, 0x06, 0xac20);
18163         MP_WritePhyUshort(sc, 0x06, 0x0ee0);
18164         MP_WritePhyUshort(sc, 0x06, 0x8b85);
18165         MP_WritePhyUshort(sc, 0x06, 0xac23);
18166         MP_WritePhyUshort(sc, 0x06, 0x08e0);
18167         MP_WritePhyUshort(sc, 0x06, 0x8b87);
18168         MP_WritePhyUshort(sc, 0x06, 0xac24);
18169         MP_WritePhyUshort(sc, 0x06, 0x02ae);
18170         MP_WritePhyUshort(sc, 0x06, 0x3802);
18171         MP_WritePhyUshort(sc, 0x06, 0x1b02);
18172         MP_WritePhyUshort(sc, 0x06, 0xeee4);
18173         MP_WritePhyUshort(sc, 0x06, 0x1c04);
18174         MP_WritePhyUshort(sc, 0x06, 0xeee4);
18175         MP_WritePhyUshort(sc, 0x06, 0x1d04);
18176         MP_WritePhyUshort(sc, 0x06, 0xe2e0);
18177         MP_WritePhyUshort(sc, 0x06, 0x7ce3);
18178         MP_WritePhyUshort(sc, 0x06, 0xe07d);
18179         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
18180         MP_WritePhyUshort(sc, 0x06, 0x38e1);
18181         MP_WritePhyUshort(sc, 0x06, 0xe039);
18182         MP_WritePhyUshort(sc, 0x06, 0xad2e);
18183         MP_WritePhyUshort(sc, 0x06, 0x1bad);
18184         MP_WritePhyUshort(sc, 0x06, 0x390d);
18185         MP_WritePhyUshort(sc, 0x06, 0xd101);
18186         MP_WritePhyUshort(sc, 0x06, 0xbf22);
18187         MP_WritePhyUshort(sc, 0x06, 0xe802);
18188         MP_WritePhyUshort(sc, 0x06, 0x3a21);
18189         MP_WritePhyUshort(sc, 0x06, 0x0222);
18190         MP_WritePhyUshort(sc, 0x06, 0x10ae);
18191         MP_WritePhyUshort(sc, 0x06, 0x0bac);
18192         MP_WritePhyUshort(sc, 0x06, 0x3802);
18193         MP_WritePhyUshort(sc, 0x06, 0xae06);
18194         MP_WritePhyUshort(sc, 0x06, 0x0222);
18195         MP_WritePhyUshort(sc, 0x06, 0x4d02);
18196         MP_WritePhyUshort(sc, 0x06, 0x2292);
18197         MP_WritePhyUshort(sc, 0x06, 0x021b);
18198         MP_WritePhyUshort(sc, 0x06, 0x13fd);
18199         MP_WritePhyUshort(sc, 0x06, 0xfc04);
18200         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
18201         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
18202         MP_WritePhyUshort(sc, 0x06, 0xad20);
18203         MP_WritePhyUshort(sc, 0x06, 0x1af6);
18204         MP_WritePhyUshort(sc, 0x06, 0x20e4);
18205         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
18206         MP_WritePhyUshort(sc, 0x06, 0x022b);
18207         MP_WritePhyUshort(sc, 0x06, 0x1e02);
18208         MP_WritePhyUshort(sc, 0x06, 0x82ae);
18209         MP_WritePhyUshort(sc, 0x06, 0x0203);
18210         MP_WritePhyUshort(sc, 0x06, 0xc002);
18211         MP_WritePhyUshort(sc, 0x06, 0x827d);
18212         MP_WritePhyUshort(sc, 0x06, 0x022e);
18213         MP_WritePhyUshort(sc, 0x06, 0x6f02);
18214         MP_WritePhyUshort(sc, 0x06, 0x047b);
18215         MP_WritePhyUshort(sc, 0x06, 0x022f);
18216         MP_WritePhyUshort(sc, 0x06, 0x9ae0);
18217         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
18218         MP_WritePhyUshort(sc, 0x06, 0xad21);
18219         MP_WritePhyUshort(sc, 0x06, 0x0bf6);
18220         MP_WritePhyUshort(sc, 0x06, 0x21e4);
18221         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
18222         MP_WritePhyUshort(sc, 0x06, 0x0281);
18223         MP_WritePhyUshort(sc, 0x06, 0x9002);
18224         MP_WritePhyUshort(sc, 0x06, 0x1cd9);
18225         MP_WritePhyUshort(sc, 0x06, 0xe08b);
18226         MP_WritePhyUshort(sc, 0x06, 0x8ead);
18227         MP_WritePhyUshort(sc, 0x06, 0x2208);
18228         MP_WritePhyUshort(sc, 0x06, 0xf622);
18229         MP_WritePhyUshort(sc, 0x06, 0xe48b);
18230         MP_WritePhyUshort(sc, 0x06, 0x8e02);
18231         MP_WritePhyUshort(sc, 0x06, 0x35f4);
18232         MP_WritePhyUshort(sc, 0x06, 0xe08b);
18233         MP_WritePhyUshort(sc, 0x06, 0x8ead);
18234         MP_WritePhyUshort(sc, 0x06, 0x2308);
18235         MP_WritePhyUshort(sc, 0x06, 0xf623);
18236         MP_WritePhyUshort(sc, 0x06, 0xe48b);
18237         MP_WritePhyUshort(sc, 0x06, 0x8e02);
18238         MP_WritePhyUshort(sc, 0x06, 0x31e8);
18239         MP_WritePhyUshort(sc, 0x06, 0xe08b);
18240         MP_WritePhyUshort(sc, 0x06, 0x8ead);
18241         MP_WritePhyUshort(sc, 0x06, 0x2405);
18242         MP_WritePhyUshort(sc, 0x06, 0xf624);
18243         MP_WritePhyUshort(sc, 0x06, 0xe48b);
18244         MP_WritePhyUshort(sc, 0x06, 0x8ee0);
18245         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
18246         MP_WritePhyUshort(sc, 0x06, 0xad25);
18247         MP_WritePhyUshort(sc, 0x06, 0x05f6);
18248         MP_WritePhyUshort(sc, 0x06, 0x25e4);
18249         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
18250         MP_WritePhyUshort(sc, 0x06, 0xe08b);
18251         MP_WritePhyUshort(sc, 0x06, 0x8ead);
18252         MP_WritePhyUshort(sc, 0x06, 0x2608);
18253         MP_WritePhyUshort(sc, 0x06, 0xf626);
18254         MP_WritePhyUshort(sc, 0x06, 0xe48b);
18255         MP_WritePhyUshort(sc, 0x06, 0x8e02);
18256         MP_WritePhyUshort(sc, 0x06, 0x2d8a);
18257         MP_WritePhyUshort(sc, 0x06, 0xe08b);
18258         MP_WritePhyUshort(sc, 0x06, 0x8ead);
18259         MP_WritePhyUshort(sc, 0x06, 0x2705);
18260         MP_WritePhyUshort(sc, 0x06, 0xf627);
18261         MP_WritePhyUshort(sc, 0x06, 0xe48b);
18262         MP_WritePhyUshort(sc, 0x06, 0x8e02);
18263         MP_WritePhyUshort(sc, 0x06, 0x0386);
18264         MP_WritePhyUshort(sc, 0x06, 0xfc04);
18265         MP_WritePhyUshort(sc, 0x06, 0xf8fa);
18266         MP_WritePhyUshort(sc, 0x06, 0xef69);
18267         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
18268         MP_WritePhyUshort(sc, 0x06, 0x00e1);
18269         MP_WritePhyUshort(sc, 0x06, 0xe001);
18270         MP_WritePhyUshort(sc, 0x06, 0xad27);
18271         MP_WritePhyUshort(sc, 0x06, 0x32e0);
18272         MP_WritePhyUshort(sc, 0x06, 0x8b40);
18273         MP_WritePhyUshort(sc, 0x06, 0xf720);
18274         MP_WritePhyUshort(sc, 0x06, 0xe48b);
18275         MP_WritePhyUshort(sc, 0x06, 0x40bf);
18276         MP_WritePhyUshort(sc, 0x06, 0x32c1);
18277         MP_WritePhyUshort(sc, 0x06, 0x0239);
18278         MP_WritePhyUshort(sc, 0x06, 0xf4ad);
18279         MP_WritePhyUshort(sc, 0x06, 0x2821);
18280         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
18281         MP_WritePhyUshort(sc, 0x06, 0x20e1);
18282         MP_WritePhyUshort(sc, 0x06, 0xe021);
18283         MP_WritePhyUshort(sc, 0x06, 0xad20);
18284         MP_WritePhyUshort(sc, 0x06, 0x18e0);
18285         MP_WritePhyUshort(sc, 0x06, 0x8b40);
18286         MP_WritePhyUshort(sc, 0x06, 0xf620);
18287         MP_WritePhyUshort(sc, 0x06, 0xe48b);
18288         MP_WritePhyUshort(sc, 0x06, 0x40ee);
18289         MP_WritePhyUshort(sc, 0x06, 0x8b3b);
18290         MP_WritePhyUshort(sc, 0x06, 0xffe0);
18291         MP_WritePhyUshort(sc, 0x06, 0x8a8a);
18292         MP_WritePhyUshort(sc, 0x06, 0xe18a);
18293         MP_WritePhyUshort(sc, 0x06, 0x8be4);
18294         MP_WritePhyUshort(sc, 0x06, 0xe000);
18295         MP_WritePhyUshort(sc, 0x06, 0xe5e0);
18296         MP_WritePhyUshort(sc, 0x06, 0x01ef);
18297         MP_WritePhyUshort(sc, 0x06, 0x96fe);
18298         MP_WritePhyUshort(sc, 0x06, 0xfc04);
18299         MP_WritePhyUshort(sc, 0x06, 0xf8f9);
18300         MP_WritePhyUshort(sc, 0x06, 0xface);
18301         MP_WritePhyUshort(sc, 0x06, 0xfaef);
18302         MP_WritePhyUshort(sc, 0x06, 0x69fa);
18303         MP_WritePhyUshort(sc, 0x06, 0xd401);
18304         MP_WritePhyUshort(sc, 0x06, 0x55b4);
18305         MP_WritePhyUshort(sc, 0x06, 0xfebf);
18306         MP_WritePhyUshort(sc, 0x06, 0x1c5e);
18307         MP_WritePhyUshort(sc, 0x06, 0x0239);
18308         MP_WritePhyUshort(sc, 0x06, 0xf4ac);
18309         MP_WritePhyUshort(sc, 0x06, 0x280b);
18310         MP_WritePhyUshort(sc, 0x06, 0xbf1c);
18311         MP_WritePhyUshort(sc, 0x06, 0x5b02);
18312         MP_WritePhyUshort(sc, 0x06, 0x39f4);
18313         MP_WritePhyUshort(sc, 0x06, 0xac28);
18314         MP_WritePhyUshort(sc, 0x06, 0x49ae);
18315         MP_WritePhyUshort(sc, 0x06, 0x64bf);
18316         MP_WritePhyUshort(sc, 0x06, 0x1c5b);
18317         MP_WritePhyUshort(sc, 0x06, 0x0239);
18318         MP_WritePhyUshort(sc, 0x06, 0xf4ac);
18319         MP_WritePhyUshort(sc, 0x06, 0x285b);
18320         MP_WritePhyUshort(sc, 0x06, 0xd000);
18321         MP_WritePhyUshort(sc, 0x06, 0x0282);
18322         MP_WritePhyUshort(sc, 0x06, 0x62ac);
18323         MP_WritePhyUshort(sc, 0x06, 0x2105);
18324         MP_WritePhyUshort(sc, 0x06, 0xac22);
18325         MP_WritePhyUshort(sc, 0x06, 0x02ae);
18326         MP_WritePhyUshort(sc, 0x06, 0x4ebf);
18327         MP_WritePhyUshort(sc, 0x06, 0xe0c4);
18328         MP_WritePhyUshort(sc, 0x06, 0xbe85);
18329         MP_WritePhyUshort(sc, 0x06, 0xecd2);
18330         MP_WritePhyUshort(sc, 0x06, 0x04d8);
18331         MP_WritePhyUshort(sc, 0x06, 0x19d9);
18332         MP_WritePhyUshort(sc, 0x06, 0x1907);
18333         MP_WritePhyUshort(sc, 0x06, 0xdc19);
18334         MP_WritePhyUshort(sc, 0x06, 0xdd19);
18335         MP_WritePhyUshort(sc, 0x06, 0x0789);
18336         MP_WritePhyUshort(sc, 0x06, 0x89ef);
18337         MP_WritePhyUshort(sc, 0x06, 0x645e);
18338         MP_WritePhyUshort(sc, 0x06, 0x07ff);
18339         MP_WritePhyUshort(sc, 0x06, 0x0d65);
18340         MP_WritePhyUshort(sc, 0x06, 0x5cf8);
18341         MP_WritePhyUshort(sc, 0x06, 0x001e);
18342         MP_WritePhyUshort(sc, 0x06, 0x46dc);
18343         MP_WritePhyUshort(sc, 0x06, 0x19dd);
18344         MP_WritePhyUshort(sc, 0x06, 0x19b2);
18345         MP_WritePhyUshort(sc, 0x06, 0xe2d4);
18346         MP_WritePhyUshort(sc, 0x06, 0x0001);
18347         MP_WritePhyUshort(sc, 0x06, 0xbf1c);
18348         MP_WritePhyUshort(sc, 0x06, 0x5b02);
18349         MP_WritePhyUshort(sc, 0x06, 0x3a21);
18350         MP_WritePhyUshort(sc, 0x06, 0xae1d);
18351         MP_WritePhyUshort(sc, 0x06, 0xbee0);
18352         MP_WritePhyUshort(sc, 0x06, 0xc4bf);
18353         MP_WritePhyUshort(sc, 0x06, 0x85ec);
18354         MP_WritePhyUshort(sc, 0x06, 0xd204);
18355         MP_WritePhyUshort(sc, 0x06, 0xd819);
18356         MP_WritePhyUshort(sc, 0x06, 0xd919);
18357         MP_WritePhyUshort(sc, 0x06, 0x07dc);
18358         MP_WritePhyUshort(sc, 0x06, 0x19dd);
18359         MP_WritePhyUshort(sc, 0x06, 0x1907);
18360         MP_WritePhyUshort(sc, 0x06, 0xb2f4);
18361         MP_WritePhyUshort(sc, 0x06, 0xd400);
18362         MP_WritePhyUshort(sc, 0x06, 0x00bf);
18363         MP_WritePhyUshort(sc, 0x06, 0x1c5b);
18364         MP_WritePhyUshort(sc, 0x06, 0x023a);
18365         MP_WritePhyUshort(sc, 0x06, 0x21fe);
18366         MP_WritePhyUshort(sc, 0x06, 0xef96);
18367         MP_WritePhyUshort(sc, 0x06, 0xfec6);
18368         MP_WritePhyUshort(sc, 0x06, 0xfefd);
18369         MP_WritePhyUshort(sc, 0x06, 0xfc05);
18370         MP_WritePhyUshort(sc, 0x06, 0xf9e2);
18371         MP_WritePhyUshort(sc, 0x06, 0xe0ea);
18372         MP_WritePhyUshort(sc, 0x06, 0xe3e0);
18373         MP_WritePhyUshort(sc, 0x06, 0xeb5a);
18374         MP_WritePhyUshort(sc, 0x06, 0x070c);
18375         MP_WritePhyUshort(sc, 0x06, 0x031e);
18376         MP_WritePhyUshort(sc, 0x06, 0x20e6);
18377         MP_WritePhyUshort(sc, 0x06, 0xe0ea);
18378         MP_WritePhyUshort(sc, 0x06, 0xe7e0);
18379         MP_WritePhyUshort(sc, 0x06, 0xebe0);
18380         MP_WritePhyUshort(sc, 0x06, 0xe0fc);
18381         MP_WritePhyUshort(sc, 0x06, 0xe1e0);
18382         MP_WritePhyUshort(sc, 0x06, 0xfdfd);
18383         MP_WritePhyUshort(sc, 0x06, 0x04f8);
18384         MP_WritePhyUshort(sc, 0x06, 0xfaef);
18385         MP_WritePhyUshort(sc, 0x06, 0x69e0);
18386         MP_WritePhyUshort(sc, 0x06, 0x8b80);
18387         MP_WritePhyUshort(sc, 0x06, 0xad27);
18388         MP_WritePhyUshort(sc, 0x06, 0x22bf);
18389         MP_WritePhyUshort(sc, 0x06, 0x47ba);
18390         MP_WritePhyUshort(sc, 0x06, 0x0239);
18391         MP_WritePhyUshort(sc, 0x06, 0xf4e0);
18392         MP_WritePhyUshort(sc, 0x06, 0x8b44);
18393         MP_WritePhyUshort(sc, 0x06, 0x1f01);
18394         MP_WritePhyUshort(sc, 0x06, 0x9e15);
18395         MP_WritePhyUshort(sc, 0x06, 0xe58b);
18396         MP_WritePhyUshort(sc, 0x06, 0x44ad);
18397         MP_WritePhyUshort(sc, 0x06, 0x2907);
18398         MP_WritePhyUshort(sc, 0x06, 0xac28);
18399         MP_WritePhyUshort(sc, 0x06, 0x04d1);
18400         MP_WritePhyUshort(sc, 0x06, 0x01ae);
18401         MP_WritePhyUshort(sc, 0x06, 0x02d1);
18402         MP_WritePhyUshort(sc, 0x06, 0x00bf);
18403         MP_WritePhyUshort(sc, 0x06, 0x8342);
18404         MP_WritePhyUshort(sc, 0x06, 0x023a);
18405         MP_WritePhyUshort(sc, 0x06, 0x21ef);
18406         MP_WritePhyUshort(sc, 0x06, 0x96fe);
18407         MP_WritePhyUshort(sc, 0x06, 0xfc04);
18408         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
18409         MP_WritePhyUshort(sc, 0x06, 0x8b85);
18410         MP_WritePhyUshort(sc, 0x06, 0xad26);
18411         MP_WritePhyUshort(sc, 0x06, 0x30e0);
18412         MP_WritePhyUshort(sc, 0x06, 0xe036);
18413         MP_WritePhyUshort(sc, 0x06, 0xe1e0);
18414         MP_WritePhyUshort(sc, 0x06, 0x37e1);
18415         MP_WritePhyUshort(sc, 0x06, 0x8b3f);
18416         MP_WritePhyUshort(sc, 0x06, 0x1f10);
18417         MP_WritePhyUshort(sc, 0x06, 0x9e23);
18418         MP_WritePhyUshort(sc, 0x06, 0xe48b);
18419         MP_WritePhyUshort(sc, 0x06, 0x3fac);
18420         MP_WritePhyUshort(sc, 0x06, 0x200b);
18421         MP_WritePhyUshort(sc, 0x06, 0xac21);
18422         MP_WritePhyUshort(sc, 0x06, 0x0dac);
18423         MP_WritePhyUshort(sc, 0x06, 0x250f);
18424         MP_WritePhyUshort(sc, 0x06, 0xac27);
18425         MP_WritePhyUshort(sc, 0x06, 0x11ae);
18426         MP_WritePhyUshort(sc, 0x06, 0x1202);
18427         MP_WritePhyUshort(sc, 0x06, 0x2cb5);
18428         MP_WritePhyUshort(sc, 0x06, 0xae0d);
18429         MP_WritePhyUshort(sc, 0x06, 0x0282);
18430         MP_WritePhyUshort(sc, 0x06, 0xe7ae);
18431         MP_WritePhyUshort(sc, 0x06, 0x0802);
18432         MP_WritePhyUshort(sc, 0x06, 0x2cd7);
18433         MP_WritePhyUshort(sc, 0x06, 0xae03);
18434         MP_WritePhyUshort(sc, 0x06, 0x022c);
18435         MP_WritePhyUshort(sc, 0x06, 0xeafc);
18436         MP_WritePhyUshort(sc, 0x06, 0x04f8);
18437         MP_WritePhyUshort(sc, 0x06, 0xfaef);
18438         MP_WritePhyUshort(sc, 0x06, 0x6902);
18439         MP_WritePhyUshort(sc, 0x06, 0x8304);
18440         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
18441         MP_WritePhyUshort(sc, 0x06, 0x14e1);
18442         MP_WritePhyUshort(sc, 0x06, 0xe015);
18443         MP_WritePhyUshort(sc, 0x06, 0xad26);
18444         MP_WritePhyUshort(sc, 0x06, 0x08d1);
18445         MP_WritePhyUshort(sc, 0x06, 0x1ebf);
18446         MP_WritePhyUshort(sc, 0x06, 0x2d47);
18447         MP_WritePhyUshort(sc, 0x06, 0x023a);
18448         MP_WritePhyUshort(sc, 0x06, 0x21ef);
18449         MP_WritePhyUshort(sc, 0x06, 0x96fe);
18450         MP_WritePhyUshort(sc, 0x06, 0xfc04);
18451         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
18452         MP_WritePhyUshort(sc, 0x06, 0x8b85);
18453         MP_WritePhyUshort(sc, 0x06, 0xad27);
18454         MP_WritePhyUshort(sc, 0x06, 0x2fd0);
18455         MP_WritePhyUshort(sc, 0x06, 0x0b02);
18456         MP_WritePhyUshort(sc, 0x06, 0x3826);
18457         MP_WritePhyUshort(sc, 0x06, 0x5882);
18458         MP_WritePhyUshort(sc, 0x06, 0x7882);
18459         MP_WritePhyUshort(sc, 0x06, 0x9f24);
18460         MP_WritePhyUshort(sc, 0x06, 0xe08b);
18461         MP_WritePhyUshort(sc, 0x06, 0x32e1);
18462         MP_WritePhyUshort(sc, 0x06, 0x8b33);
18463         MP_WritePhyUshort(sc, 0x06, 0x1f10);
18464         MP_WritePhyUshort(sc, 0x06, 0x9e1a);
18465         MP_WritePhyUshort(sc, 0x06, 0x10e4);
18466         MP_WritePhyUshort(sc, 0x06, 0x8b32);
18467         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
18468         MP_WritePhyUshort(sc, 0x06, 0x28e1);
18469         MP_WritePhyUshort(sc, 0x06, 0xe029);
18470         MP_WritePhyUshort(sc, 0x06, 0xf72c);
18471         MP_WritePhyUshort(sc, 0x06, 0xe4e0);
18472         MP_WritePhyUshort(sc, 0x06, 0x28e5);
18473         MP_WritePhyUshort(sc, 0x06, 0xe029);
18474         MP_WritePhyUshort(sc, 0x06, 0xf62c);
18475         MP_WritePhyUshort(sc, 0x06, 0xe4e0);
18476         MP_WritePhyUshort(sc, 0x06, 0x28e5);
18477         MP_WritePhyUshort(sc, 0x06, 0xe029);
18478         MP_WritePhyUshort(sc, 0x06, 0xfc04);
18479         MP_WritePhyUshort(sc, 0x06, 0x00e1);
18480         MP_WritePhyUshort(sc, 0x06, 0x4077);
18481         MP_WritePhyUshort(sc, 0x06, 0xe140);
18482         MP_WritePhyUshort(sc, 0x06, 0xbbe0);
18483         MP_WritePhyUshort(sc, 0x06, 0x2a00);
18484         MP_WritePhyUshort(sc, 0x05, 0xe142);
18485         PhyRegValue = MP_ReadPhyUshort(sc, 0x06);
18486         PhyRegValue |= BIT_0;
18487         MP_WritePhyUshort(sc, 0x06,PhyRegValue);
18488         MP_WritePhyUshort(sc, 0x05, 0xe140);
18489         PhyRegValue = MP_ReadPhyUshort(sc, 0x06);
18490         PhyRegValue |= BIT_0;
18491         MP_WritePhyUshort(sc, 0x06, PhyRegValue);
18492         MP_WritePhyUshort(sc, 0x1f, 0x0000);
18493         MP_WritePhyUshort(sc, 0x1f, 0x0005);
18494         for (i = 0; i < 200; i++) {
18495                 DELAY(100);
18496                 PhyRegValue = MP_ReadPhyUshort(sc, 0x00);
18497                 if (PhyRegValue & BIT_7)
18498                         break;
18499         }
18500         MP_WritePhyUshort(sc, 0x1f, 0x0007);
18501         MP_WritePhyUshort(sc, 0x1e, 0x0023);
18502         PhyRegValue = MP_ReadPhyUshort(sc, 0x17);
18503         PhyRegValue |= BIT_1;
18504         if (sc->RequiredSecLanDonglePatch)
18505                 PhyRegValue &= ~(BIT_2);
18506         MP_WritePhyUshort(sc, 0x17, PhyRegValue);
18507         MP_WritePhyUshort(sc, 0x1f, 0x0000);
18508         MP_WritePhyUshort(sc, 0x1f, 0x0003);
18509         MP_WritePhyUshort(sc, 0x09, 0xA20F);
18510         MP_WritePhyUshort(sc, 0x1f, 0x0000);
18511         MP_WritePhyUshort(sc, 0x1f, 0x0003);
18512         MP_WritePhyUshort(sc, 0x01, 0x328A);
18513         MP_WritePhyUshort(sc, 0x1f, 0x0000);
18514         MP_WritePhyUshort(sc, 0x1f, 0x0003);
18515         PhyRegValue = MP_ReadPhyUshort(sc, 0x19);
18516         PhyRegValue &= ~BIT_0;
18517         MP_WritePhyUshort(sc, 0x19, PhyRegValue);
18518         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
18519         PhyRegValue &= ~BIT_10;
18520         MP_WritePhyUshort(sc, 0x10, PhyRegValue);
18521         MP_WritePhyUshort(sc, 0x1f, 0x0000);
18522         MP_WritePhyUshort(sc, 0x00, 0x9200);
18523 }
18524
18525 static void re_set_phy_mcu_8168g_1(struct re_softc *sc)
18526 {
18527         u_int16_t PhyRegValue;
18528         u_int32_t WaitCnt;
18529
18530         MP_WritePhyUshort(sc, 0x1f, 0x0B82);
18531         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
18532         PhyRegValue |= BIT_4;
18533         MP_WritePhyUshort(sc, 0x10, PhyRegValue);
18534
18535         MP_WritePhyUshort(sc, 0x1f, 0x0B80);
18536         WaitCnt = 0;
18537         do {
18538                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
18539                 PhyRegValue &= 0x0040;
18540                 DELAY(50);
18541                 DELAY(50);
18542                 WaitCnt++;
18543         } while(PhyRegValue != 0x0040 && WaitCnt <1000);
18544
18545         MP_WritePhyUshort(sc, 0x1f, 0x0A43);
18546         MP_WritePhyUshort(sc, 0x13, 0x8146);
18547         MP_WritePhyUshort(sc, 0x14, 0x2300);
18548         MP_WritePhyUshort(sc, 0x13, 0xB820);
18549         MP_WritePhyUshort(sc, 0x14, 0x0210);
18550
18551         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
18552         MP_WritePhyUshort(sc, 0x13, 0xB820);
18553         MP_WritePhyUshort(sc, 0x14, 0x0290);
18554         MP_WritePhyUshort(sc, 0x13, 0xA012);
18555         MP_WritePhyUshort(sc, 0x14, 0x0000);
18556         MP_WritePhyUshort(sc, 0x13, 0xA014);
18557         MP_WritePhyUshort(sc, 0x14, 0x2c04);
18558         MP_WritePhyUshort(sc, 0x14, 0x2c0c);
18559         MP_WritePhyUshort(sc, 0x14, 0x2c6c);
18560         MP_WritePhyUshort(sc, 0x14, 0x2d0d);
18561         MP_WritePhyUshort(sc, 0x14, 0x31ce);
18562         MP_WritePhyUshort(sc, 0x14, 0x506d);
18563         MP_WritePhyUshort(sc, 0x14, 0xd708);
18564         MP_WritePhyUshort(sc, 0x14, 0x3108);
18565         MP_WritePhyUshort(sc, 0x14, 0x106d);
18566         MP_WritePhyUshort(sc, 0x14, 0x1560);
18567         MP_WritePhyUshort(sc, 0x14, 0x15a9);
18568         MP_WritePhyUshort(sc, 0x14, 0x206e);
18569         MP_WritePhyUshort(sc, 0x14, 0x175b);
18570         MP_WritePhyUshort(sc, 0x14, 0x6062);
18571         MP_WritePhyUshort(sc, 0x14, 0xd700);
18572         MP_WritePhyUshort(sc, 0x14, 0x5fae);
18573         MP_WritePhyUshort(sc, 0x14, 0xd708);
18574         MP_WritePhyUshort(sc, 0x14, 0x3107);
18575         MP_WritePhyUshort(sc, 0x14, 0x4c1e);
18576         MP_WritePhyUshort(sc, 0x14, 0x4169);
18577         MP_WritePhyUshort(sc, 0x14, 0x316a);
18578         MP_WritePhyUshort(sc, 0x14, 0x0c19);
18579         MP_WritePhyUshort(sc, 0x14, 0x31aa);
18580         MP_WritePhyUshort(sc, 0x14, 0x0c19);
18581         MP_WritePhyUshort(sc, 0x14, 0x2c1b);
18582         MP_WritePhyUshort(sc, 0x14, 0x5e62);
18583         MP_WritePhyUshort(sc, 0x14, 0x26b5);
18584         MP_WritePhyUshort(sc, 0x14, 0x31ab);
18585         MP_WritePhyUshort(sc, 0x14, 0x5c1e);
18586         MP_WritePhyUshort(sc, 0x14, 0x2c0c);
18587         MP_WritePhyUshort(sc, 0x14, 0xc040);
18588         MP_WritePhyUshort(sc, 0x14, 0x8808);
18589         MP_WritePhyUshort(sc, 0x14, 0xc520);
18590         MP_WritePhyUshort(sc, 0x14, 0xc421);
18591         MP_WritePhyUshort(sc, 0x14, 0xd05a);
18592         MP_WritePhyUshort(sc, 0x14, 0xd19a);
18593         MP_WritePhyUshort(sc, 0x14, 0xd709);
18594         MP_WritePhyUshort(sc, 0x14, 0x608f);
18595         MP_WritePhyUshort(sc, 0x14, 0xd06b);
18596         MP_WritePhyUshort(sc, 0x14, 0xd18a);
18597         MP_WritePhyUshort(sc, 0x14, 0x2c2c);
18598         MP_WritePhyUshort(sc, 0x14, 0xd0be);
18599         MP_WritePhyUshort(sc, 0x14, 0xd188);
18600         MP_WritePhyUshort(sc, 0x14, 0x2c2c);
18601         MP_WritePhyUshort(sc, 0x14, 0xd708);
18602         MP_WritePhyUshort(sc, 0x14, 0x4072);
18603         MP_WritePhyUshort(sc, 0x14, 0xc104);
18604         MP_WritePhyUshort(sc, 0x14, 0x2c3e);
18605         MP_WritePhyUshort(sc, 0x14, 0x4076);
18606         MP_WritePhyUshort(sc, 0x14, 0xc110);
18607         MP_WritePhyUshort(sc, 0x14, 0x2c3e);
18608         MP_WritePhyUshort(sc, 0x14, 0x4071);
18609         MP_WritePhyUshort(sc, 0x14, 0xc102);
18610         MP_WritePhyUshort(sc, 0x14, 0x2c3e);
18611         MP_WritePhyUshort(sc, 0x14, 0x4070);
18612         MP_WritePhyUshort(sc, 0x14, 0xc101);
18613         MP_WritePhyUshort(sc, 0x14, 0x2c3e);
18614         MP_WritePhyUshort(sc, 0x14, 0x175b);
18615         MP_WritePhyUshort(sc, 0x14, 0xd709);
18616         MP_WritePhyUshort(sc, 0x14, 0x3390);
18617         MP_WritePhyUshort(sc, 0x14, 0x5c39);
18618         MP_WritePhyUshort(sc, 0x14, 0x2c4e);
18619         MP_WritePhyUshort(sc, 0x14, 0x175b);
18620         MP_WritePhyUshort(sc, 0x14, 0xd708);
18621         MP_WritePhyUshort(sc, 0x14, 0x6193);
18622         MP_WritePhyUshort(sc, 0x14, 0xd709);
18623         MP_WritePhyUshort(sc, 0x14, 0x5f9d);
18624         MP_WritePhyUshort(sc, 0x14, 0x408b);
18625         MP_WritePhyUshort(sc, 0x14, 0xd71e);
18626         MP_WritePhyUshort(sc, 0x14, 0x6042);
18627         MP_WritePhyUshort(sc, 0x14, 0xb401);
18628         MP_WritePhyUshort(sc, 0x14, 0x175b);
18629         MP_WritePhyUshort(sc, 0x14, 0xd708);
18630         MP_WritePhyUshort(sc, 0x14, 0x6073);
18631         MP_WritePhyUshort(sc, 0x14, 0x5fbc);
18632         MP_WritePhyUshort(sc, 0x14, 0x2c4d);
18633         MP_WritePhyUshort(sc, 0x14, 0x26ed);
18634         MP_WritePhyUshort(sc, 0x14, 0xb280);
18635         MP_WritePhyUshort(sc, 0x14, 0xa841);
18636         MP_WritePhyUshort(sc, 0x14, 0x9420);
18637         MP_WritePhyUshort(sc, 0x14, 0x8710);
18638         MP_WritePhyUshort(sc, 0x14, 0xd709);
18639         MP_WritePhyUshort(sc, 0x14, 0x42ec);
18640         MP_WritePhyUshort(sc, 0x14, 0x606d);
18641         MP_WritePhyUshort(sc, 0x14, 0xd207);
18642         MP_WritePhyUshort(sc, 0x14, 0x2c57);
18643         MP_WritePhyUshort(sc, 0x14, 0xd203);
18644         MP_WritePhyUshort(sc, 0x14, 0x33ff);
18645         MP_WritePhyUshort(sc, 0x14, 0x563b);
18646         MP_WritePhyUshort(sc, 0x14, 0x3275);
18647         MP_WritePhyUshort(sc, 0x14, 0x7c5e);
18648         MP_WritePhyUshort(sc, 0x14, 0xb240);
18649         MP_WritePhyUshort(sc, 0x14, 0xb402);
18650         MP_WritePhyUshort(sc, 0x14, 0x263b);
18651         MP_WritePhyUshort(sc, 0x14, 0x6096);
18652         MP_WritePhyUshort(sc, 0x14, 0xb240);
18653         MP_WritePhyUshort(sc, 0x14, 0xb406);
18654         MP_WritePhyUshort(sc, 0x14, 0x263b);
18655         MP_WritePhyUshort(sc, 0x14, 0x31d7);
18656         MP_WritePhyUshort(sc, 0x14, 0x7c67);
18657         MP_WritePhyUshort(sc, 0x14, 0xb240);
18658         MP_WritePhyUshort(sc, 0x14, 0xb40e);
18659         MP_WritePhyUshort(sc, 0x14, 0x263b);
18660         MP_WritePhyUshort(sc, 0x14, 0xb410);
18661         MP_WritePhyUshort(sc, 0x14, 0x8802);
18662         MP_WritePhyUshort(sc, 0x14, 0xb240);
18663         MP_WritePhyUshort(sc, 0x14, 0x940e);
18664         MP_WritePhyUshort(sc, 0x14, 0x263b);
18665         MP_WritePhyUshort(sc, 0x14, 0xba04);
18666         MP_WritePhyUshort(sc, 0x14, 0x1cd6);
18667         MP_WritePhyUshort(sc, 0x14, 0xa902);
18668         MP_WritePhyUshort(sc, 0x14, 0xd711);
18669         MP_WritePhyUshort(sc, 0x14, 0x4045);
18670         MP_WritePhyUshort(sc, 0x14, 0xa980);
18671         MP_WritePhyUshort(sc, 0x14, 0x3003);
18672         MP_WritePhyUshort(sc, 0x14, 0x59b1);
18673         MP_WritePhyUshort(sc, 0x14, 0xa540);
18674         MP_WritePhyUshort(sc, 0x14, 0xa601);
18675         MP_WritePhyUshort(sc, 0x14, 0xd710);
18676         MP_WritePhyUshort(sc, 0x14, 0x4043);
18677         MP_WritePhyUshort(sc, 0x14, 0xa910);
18678         MP_WritePhyUshort(sc, 0x14, 0xd711);
18679         MP_WritePhyUshort(sc, 0x14, 0x60a0);
18680         MP_WritePhyUshort(sc, 0x14, 0xca33);
18681         MP_WritePhyUshort(sc, 0x14, 0xcb33);
18682         MP_WritePhyUshort(sc, 0x14, 0xa941);
18683         MP_WritePhyUshort(sc, 0x14, 0x2c82);
18684         MP_WritePhyUshort(sc, 0x14, 0xcaff);
18685         MP_WritePhyUshort(sc, 0x14, 0xcbff);
18686         MP_WritePhyUshort(sc, 0x14, 0xa921);
18687         MP_WritePhyUshort(sc, 0x14, 0xce02);
18688         MP_WritePhyUshort(sc, 0x14, 0xe070);
18689         MP_WritePhyUshort(sc, 0x14, 0x0f10);
18690         MP_WritePhyUshort(sc, 0x14, 0xaf01);
18691         MP_WritePhyUshort(sc, 0x14, 0x8f01);
18692         MP_WritePhyUshort(sc, 0x14, 0x1766);
18693         MP_WritePhyUshort(sc, 0x14, 0x8e02);
18694         MP_WritePhyUshort(sc, 0x14, 0x1787);
18695         MP_WritePhyUshort(sc, 0x14, 0xd710);
18696         MP_WritePhyUshort(sc, 0x14, 0x609c);
18697         MP_WritePhyUshort(sc, 0x14, 0xd71e);
18698         MP_WritePhyUshort(sc, 0x14, 0x7fa4);
18699         MP_WritePhyUshort(sc, 0x14, 0x2cd4);
18700         MP_WritePhyUshort(sc, 0x14, 0x1ce9);
18701         MP_WritePhyUshort(sc, 0x14, 0xce04);
18702         MP_WritePhyUshort(sc, 0x14, 0xe070);
18703         MP_WritePhyUshort(sc, 0x14, 0x0f20);
18704         MP_WritePhyUshort(sc, 0x14, 0xaf01);
18705         MP_WritePhyUshort(sc, 0x14, 0x8f01);
18706         MP_WritePhyUshort(sc, 0x14, 0x1766);
18707         MP_WritePhyUshort(sc, 0x14, 0x8e04);
18708         MP_WritePhyUshort(sc, 0x14, 0x6044);
18709         MP_WritePhyUshort(sc, 0x14, 0x2cd4);
18710         MP_WritePhyUshort(sc, 0x14, 0xa520);
18711         MP_WritePhyUshort(sc, 0x14, 0xd710);
18712         MP_WritePhyUshort(sc, 0x14, 0x4043);
18713         MP_WritePhyUshort(sc, 0x14, 0x2cc1);
18714         MP_WritePhyUshort(sc, 0x14, 0xe00f);
18715         MP_WritePhyUshort(sc, 0x14, 0x0501);
18716         MP_WritePhyUshort(sc, 0x14, 0x1cef);
18717         MP_WritePhyUshort(sc, 0x14, 0xb801);
18718         MP_WritePhyUshort(sc, 0x14, 0xd71e);
18719         MP_WritePhyUshort(sc, 0x14, 0x4060);
18720         MP_WritePhyUshort(sc, 0x14, 0x7fc4);
18721         MP_WritePhyUshort(sc, 0x14, 0x2cd4);
18722         MP_WritePhyUshort(sc, 0x14, 0x1cf5);
18723         MP_WritePhyUshort(sc, 0x14, 0xe00f);
18724         MP_WritePhyUshort(sc, 0x14, 0x0502);
18725         MP_WritePhyUshort(sc, 0x14, 0x1cef);
18726         MP_WritePhyUshort(sc, 0x14, 0xb802);
18727         MP_WritePhyUshort(sc, 0x14, 0xd71e);
18728         MP_WritePhyUshort(sc, 0x14, 0x4061);
18729         MP_WritePhyUshort(sc, 0x14, 0x7fc4);
18730         MP_WritePhyUshort(sc, 0x14, 0x2cd4);
18731         MP_WritePhyUshort(sc, 0x14, 0x1cf5);
18732         MP_WritePhyUshort(sc, 0x14, 0xe00f);
18733         MP_WritePhyUshort(sc, 0x14, 0x0504);
18734         MP_WritePhyUshort(sc, 0x14, 0xd710);
18735         MP_WritePhyUshort(sc, 0x14, 0x6099);
18736         MP_WritePhyUshort(sc, 0x14, 0xd71e);
18737         MP_WritePhyUshort(sc, 0x14, 0x7fa4);
18738         MP_WritePhyUshort(sc, 0x14, 0x2cd4);
18739         MP_WritePhyUshort(sc, 0x14, 0xc17f);
18740         MP_WritePhyUshort(sc, 0x14, 0xc200);
18741         MP_WritePhyUshort(sc, 0x14, 0xc43f);
18742         MP_WritePhyUshort(sc, 0x14, 0xcc03);
18743         MP_WritePhyUshort(sc, 0x14, 0xa701);
18744         MP_WritePhyUshort(sc, 0x14, 0xa510);
18745         MP_WritePhyUshort(sc, 0x14, 0xd710);
18746         MP_WritePhyUshort(sc, 0x14, 0x4018);
18747         MP_WritePhyUshort(sc, 0x14, 0x9910);
18748         MP_WritePhyUshort(sc, 0x14, 0x8510);
18749         MP_WritePhyUshort(sc, 0x14, 0x2860);
18750         MP_WritePhyUshort(sc, 0x14, 0xe00f);
18751         MP_WritePhyUshort(sc, 0x14, 0x0504);
18752         MP_WritePhyUshort(sc, 0x14, 0xd710);
18753         MP_WritePhyUshort(sc, 0x14, 0x6099);
18754         MP_WritePhyUshort(sc, 0x14, 0xd71e);
18755         MP_WritePhyUshort(sc, 0x14, 0x7fa4);
18756         MP_WritePhyUshort(sc, 0x14, 0x2cd4);
18757         MP_WritePhyUshort(sc, 0x14, 0xa608);
18758         MP_WritePhyUshort(sc, 0x14, 0xc17d);
18759         MP_WritePhyUshort(sc, 0x14, 0xc200);
18760         MP_WritePhyUshort(sc, 0x14, 0xc43f);
18761         MP_WritePhyUshort(sc, 0x14, 0xcc03);
18762         MP_WritePhyUshort(sc, 0x14, 0xa701);
18763         MP_WritePhyUshort(sc, 0x14, 0xa510);
18764         MP_WritePhyUshort(sc, 0x14, 0xd710);
18765         MP_WritePhyUshort(sc, 0x14, 0x4018);
18766         MP_WritePhyUshort(sc, 0x14, 0x9910);
18767         MP_WritePhyUshort(sc, 0x14, 0x8510);
18768         MP_WritePhyUshort(sc, 0x14, 0x2926);
18769         MP_WritePhyUshort(sc, 0x14, 0x1792);
18770         MP_WritePhyUshort(sc, 0x14, 0x27db);
18771         MP_WritePhyUshort(sc, 0x14, 0xc000);
18772         MP_WritePhyUshort(sc, 0x14, 0xc100);
18773         MP_WritePhyUshort(sc, 0x14, 0xc200);
18774         MP_WritePhyUshort(sc, 0x14, 0xc300);
18775         MP_WritePhyUshort(sc, 0x14, 0xc400);
18776         MP_WritePhyUshort(sc, 0x14, 0xc500);
18777         MP_WritePhyUshort(sc, 0x14, 0xc600);
18778         MP_WritePhyUshort(sc, 0x14, 0xc7c1);
18779         MP_WritePhyUshort(sc, 0x14, 0xc800);
18780         MP_WritePhyUshort(sc, 0x14, 0xcc00);
18781         MP_WritePhyUshort(sc, 0x14, 0x0800);
18782         MP_WritePhyUshort(sc, 0x14, 0xca0f);
18783         MP_WritePhyUshort(sc, 0x14, 0xcbff);
18784         MP_WritePhyUshort(sc, 0x14, 0xa901);
18785         MP_WritePhyUshort(sc, 0x14, 0x8902);
18786         MP_WritePhyUshort(sc, 0x14, 0xc900);
18787         MP_WritePhyUshort(sc, 0x14, 0xca00);
18788         MP_WritePhyUshort(sc, 0x14, 0xcb00);
18789         MP_WritePhyUshort(sc, 0x14, 0x0800);
18790         MP_WritePhyUshort(sc, 0x14, 0xb804);
18791         MP_WritePhyUshort(sc, 0x14, 0x0800);
18792         MP_WritePhyUshort(sc, 0x14, 0xd71e);
18793         MP_WritePhyUshort(sc, 0x14, 0x6044);
18794         MP_WritePhyUshort(sc, 0x14, 0x9804);
18795         MP_WritePhyUshort(sc, 0x14, 0x0800);
18796         MP_WritePhyUshort(sc, 0x14, 0xd710);
18797         MP_WritePhyUshort(sc, 0x14, 0x6099);
18798         MP_WritePhyUshort(sc, 0x14, 0xd71e);
18799         MP_WritePhyUshort(sc, 0x14, 0x7fa4);
18800         MP_WritePhyUshort(sc, 0x14, 0x2cd4);
18801         MP_WritePhyUshort(sc, 0x14, 0x0800);
18802         MP_WritePhyUshort(sc, 0x14, 0xa510);
18803         MP_WritePhyUshort(sc, 0x14, 0xd710);
18804         MP_WritePhyUshort(sc, 0x14, 0x6098);
18805         MP_WritePhyUshort(sc, 0x14, 0xd71e);
18806         MP_WritePhyUshort(sc, 0x14, 0x7fa4);
18807         MP_WritePhyUshort(sc, 0x14, 0x2cd4);
18808         MP_WritePhyUshort(sc, 0x14, 0x8510);
18809         MP_WritePhyUshort(sc, 0x14, 0x0800);
18810         MP_WritePhyUshort(sc, 0x14, 0xd711);
18811         MP_WritePhyUshort(sc, 0x14, 0x3003);
18812         MP_WritePhyUshort(sc, 0x14, 0x1d01);
18813         MP_WritePhyUshort(sc, 0x14, 0x2d0b);
18814         MP_WritePhyUshort(sc, 0x14, 0xd710);
18815         MP_WritePhyUshort(sc, 0x14, 0x60be);
18816         MP_WritePhyUshort(sc, 0x14, 0xe060);
18817         MP_WritePhyUshort(sc, 0x14, 0x0920);
18818         MP_WritePhyUshort(sc, 0x14, 0x1cd6);
18819         MP_WritePhyUshort(sc, 0x14, 0x2c89);
18820         MP_WritePhyUshort(sc, 0x14, 0xd71e);
18821         MP_WritePhyUshort(sc, 0x14, 0x3063);
18822         MP_WritePhyUshort(sc, 0x14, 0x1948);
18823         MP_WritePhyUshort(sc, 0x14, 0x288a);
18824         MP_WritePhyUshort(sc, 0x14, 0x1cd6);
18825         MP_WritePhyUshort(sc, 0x14, 0x29bd);
18826         MP_WritePhyUshort(sc, 0x14, 0xa802);
18827         MP_WritePhyUshort(sc, 0x14, 0xa303);
18828         MP_WritePhyUshort(sc, 0x14, 0x843f);
18829         MP_WritePhyUshort(sc, 0x14, 0x81ff);
18830         MP_WritePhyUshort(sc, 0x14, 0x8208);
18831         MP_WritePhyUshort(sc, 0x14, 0xa201);
18832         MP_WritePhyUshort(sc, 0x14, 0xc001);
18833         MP_WritePhyUshort(sc, 0x14, 0xd710);
18834         MP_WritePhyUshort(sc, 0x14, 0x30a0);
18835         MP_WritePhyUshort(sc, 0x14, 0x0d1c);
18836         MP_WritePhyUshort(sc, 0x14, 0x30a0);
18837         MP_WritePhyUshort(sc, 0x14, 0x3d13);
18838         MP_WritePhyUshort(sc, 0x14, 0xd71e);
18839         MP_WritePhyUshort(sc, 0x14, 0x7f4c);
18840         MP_WritePhyUshort(sc, 0x14, 0x2ab6);
18841         MP_WritePhyUshort(sc, 0x14, 0xe003);
18842         MP_WritePhyUshort(sc, 0x14, 0x0202);
18843         MP_WritePhyUshort(sc, 0x14, 0xd710);
18844         MP_WritePhyUshort(sc, 0x14, 0x6090);
18845         MP_WritePhyUshort(sc, 0x14, 0xd71e);
18846         MP_WritePhyUshort(sc, 0x14, 0x7fac);
18847         MP_WritePhyUshort(sc, 0x14, 0x2ab6);
18848         MP_WritePhyUshort(sc, 0x14, 0xa20c);
18849         MP_WritePhyUshort(sc, 0x14, 0xd710);
18850         MP_WritePhyUshort(sc, 0x14, 0x6091);
18851         MP_WritePhyUshort(sc, 0x14, 0xd71e);
18852         MP_WritePhyUshort(sc, 0x14, 0x7fac);
18853         MP_WritePhyUshort(sc, 0x14, 0x2ab6);
18854         MP_WritePhyUshort(sc, 0x14, 0x820e);
18855         MP_WritePhyUshort(sc, 0x14, 0xa3e0);
18856         MP_WritePhyUshort(sc, 0x14, 0xa520);
18857         MP_WritePhyUshort(sc, 0x14, 0xd710);
18858         MP_WritePhyUshort(sc, 0x14, 0x609d);
18859         MP_WritePhyUshort(sc, 0x14, 0xd71e);
18860         MP_WritePhyUshort(sc, 0x14, 0x7fac);
18861         MP_WritePhyUshort(sc, 0x14, 0x2ab6);
18862         MP_WritePhyUshort(sc, 0x14, 0x8520);
18863         MP_WritePhyUshort(sc, 0x14, 0x6703);
18864         MP_WritePhyUshort(sc, 0x14, 0x2d34);
18865         MP_WritePhyUshort(sc, 0x14, 0xa13e);
18866         MP_WritePhyUshort(sc, 0x14, 0xc001);
18867         MP_WritePhyUshort(sc, 0x14, 0xd710);
18868         MP_WritePhyUshort(sc, 0x14, 0x4000);
18869         MP_WritePhyUshort(sc, 0x14, 0x6046);
18870         MP_WritePhyUshort(sc, 0x14, 0x2d0d);
18871         MP_WritePhyUshort(sc, 0x14, 0xa43f);
18872         MP_WritePhyUshort(sc, 0x14, 0xa101);
18873         MP_WritePhyUshort(sc, 0x14, 0xc020);
18874         MP_WritePhyUshort(sc, 0x14, 0xd710);
18875         MP_WritePhyUshort(sc, 0x14, 0x3121);
18876         MP_WritePhyUshort(sc, 0x14, 0x0d45);
18877         MP_WritePhyUshort(sc, 0x14, 0x30c0);
18878         MP_WritePhyUshort(sc, 0x14, 0x3d0d);
18879         MP_WritePhyUshort(sc, 0x14, 0xd71e);
18880         MP_WritePhyUshort(sc, 0x14, 0x7f4c);
18881         MP_WritePhyUshort(sc, 0x14, 0x2ab6);
18882         MP_WritePhyUshort(sc, 0x14, 0xa540);
18883         MP_WritePhyUshort(sc, 0x14, 0xc001);
18884         MP_WritePhyUshort(sc, 0x14, 0xd710);
18885         MP_WritePhyUshort(sc, 0x14, 0x4001);
18886         MP_WritePhyUshort(sc, 0x14, 0xe00f);
18887         MP_WritePhyUshort(sc, 0x14, 0x0501);
18888         MP_WritePhyUshort(sc, 0x14, 0x1dac);
18889         MP_WritePhyUshort(sc, 0x14, 0xc1c4);
18890         MP_WritePhyUshort(sc, 0x14, 0xa268);
18891         MP_WritePhyUshort(sc, 0x14, 0xa303);
18892         MP_WritePhyUshort(sc, 0x14, 0x8420);
18893         MP_WritePhyUshort(sc, 0x14, 0xe00f);
18894         MP_WritePhyUshort(sc, 0x14, 0x0502);
18895         MP_WritePhyUshort(sc, 0x14, 0x1dac);
18896         MP_WritePhyUshort(sc, 0x14, 0xc002);
18897         MP_WritePhyUshort(sc, 0x14, 0xd710);
18898         MP_WritePhyUshort(sc, 0x14, 0x4000);
18899         MP_WritePhyUshort(sc, 0x14, 0x8208);
18900         MP_WritePhyUshort(sc, 0x14, 0x8410);
18901         MP_WritePhyUshort(sc, 0x14, 0xa121);
18902         MP_WritePhyUshort(sc, 0x14, 0xc002);
18903         MP_WritePhyUshort(sc, 0x14, 0xd710);
18904         MP_WritePhyUshort(sc, 0x14, 0x4000);
18905         MP_WritePhyUshort(sc, 0x14, 0x8120);
18906         MP_WritePhyUshort(sc, 0x14, 0x8180);
18907         MP_WritePhyUshort(sc, 0x14, 0x1d97);
18908         MP_WritePhyUshort(sc, 0x14, 0xa180);
18909         MP_WritePhyUshort(sc, 0x14, 0xa13a);
18910         MP_WritePhyUshort(sc, 0x14, 0x8240);
18911         MP_WritePhyUshort(sc, 0x14, 0xa430);
18912         MP_WritePhyUshort(sc, 0x14, 0xc010);
18913         MP_WritePhyUshort(sc, 0x14, 0xd710);
18914         MP_WritePhyUshort(sc, 0x14, 0x30e1);
18915         MP_WritePhyUshort(sc, 0x14, 0x0abc);
18916         MP_WritePhyUshort(sc, 0x14, 0xd71e);
18917         MP_WritePhyUshort(sc, 0x14, 0x7f8c);
18918         MP_WritePhyUshort(sc, 0x14, 0x2ab6);
18919         MP_WritePhyUshort(sc, 0x14, 0xa480);
18920         MP_WritePhyUshort(sc, 0x14, 0xa230);
18921         MP_WritePhyUshort(sc, 0x14, 0xa303);
18922         MP_WritePhyUshort(sc, 0x14, 0xc001);
18923         MP_WritePhyUshort(sc, 0x14, 0xd70c);
18924         MP_WritePhyUshort(sc, 0x14, 0x4124);
18925         MP_WritePhyUshort(sc, 0x14, 0xd710);
18926         MP_WritePhyUshort(sc, 0x14, 0x6120);
18927         MP_WritePhyUshort(sc, 0x14, 0xd711);
18928         MP_WritePhyUshort(sc, 0x14, 0x3128);
18929         MP_WritePhyUshort(sc, 0x14, 0x3d76);
18930         MP_WritePhyUshort(sc, 0x14, 0x2d70);
18931         MP_WritePhyUshort(sc, 0x14, 0xa801);
18932         MP_WritePhyUshort(sc, 0x14, 0x2d6c);
18933         MP_WritePhyUshort(sc, 0x14, 0xd710);
18934         MP_WritePhyUshort(sc, 0x14, 0x4000);
18935         MP_WritePhyUshort(sc, 0x14, 0xe018);
18936         MP_WritePhyUshort(sc, 0x14, 0x0208);
18937         MP_WritePhyUshort(sc, 0x14, 0xa1f8);
18938         MP_WritePhyUshort(sc, 0x14, 0x8480);
18939         MP_WritePhyUshort(sc, 0x14, 0xc004);
18940         MP_WritePhyUshort(sc, 0x14, 0xd710);
18941         MP_WritePhyUshort(sc, 0x14, 0x4000);
18942         MP_WritePhyUshort(sc, 0x14, 0x6046);
18943         MP_WritePhyUshort(sc, 0x14, 0x2d0d);
18944         MP_WritePhyUshort(sc, 0x14, 0xa43f);
18945         MP_WritePhyUshort(sc, 0x14, 0xa105);
18946         MP_WritePhyUshort(sc, 0x14, 0x8228);
18947         MP_WritePhyUshort(sc, 0x14, 0xc004);
18948         MP_WritePhyUshort(sc, 0x14, 0xd710);
18949         MP_WritePhyUshort(sc, 0x14, 0x4000);
18950         MP_WritePhyUshort(sc, 0x14, 0x81bc);
18951         MP_WritePhyUshort(sc, 0x14, 0xa220);
18952         MP_WritePhyUshort(sc, 0x14, 0x1d97);
18953         MP_WritePhyUshort(sc, 0x14, 0x8220);
18954         MP_WritePhyUshort(sc, 0x14, 0xa1bc);
18955         MP_WritePhyUshort(sc, 0x14, 0xc040);
18956         MP_WritePhyUshort(sc, 0x14, 0xd710);
18957         MP_WritePhyUshort(sc, 0x14, 0x30e1);
18958         MP_WritePhyUshort(sc, 0x14, 0x0abc);
18959         MP_WritePhyUshort(sc, 0x14, 0x30e1);
18960         MP_WritePhyUshort(sc, 0x14, 0x3d0d);
18961         MP_WritePhyUshort(sc, 0x14, 0xd71e);
18962         MP_WritePhyUshort(sc, 0x14, 0x7f4c);
18963         MP_WritePhyUshort(sc, 0x14, 0x2ab6);
18964         MP_WritePhyUshort(sc, 0x14, 0xa802);
18965         MP_WritePhyUshort(sc, 0x14, 0xd70c);
18966         MP_WritePhyUshort(sc, 0x14, 0x4244);
18967         MP_WritePhyUshort(sc, 0x14, 0xa301);
18968         MP_WritePhyUshort(sc, 0x14, 0xc004);
18969         MP_WritePhyUshort(sc, 0x14, 0xd711);
18970         MP_WritePhyUshort(sc, 0x14, 0x3128);
18971         MP_WritePhyUshort(sc, 0x14, 0x3da5);
18972         MP_WritePhyUshort(sc, 0x14, 0xd710);
18973         MP_WritePhyUshort(sc, 0x14, 0x5f80);
18974         MP_WritePhyUshort(sc, 0x14, 0xd711);
18975         MP_WritePhyUshort(sc, 0x14, 0x3109);
18976         MP_WritePhyUshort(sc, 0x14, 0x3da7);
18977         MP_WritePhyUshort(sc, 0x14, 0x2dab);
18978         MP_WritePhyUshort(sc, 0x14, 0xa801);
18979         MP_WritePhyUshort(sc, 0x14, 0x2d9a);
18980         MP_WritePhyUshort(sc, 0x14, 0xa802);
18981         MP_WritePhyUshort(sc, 0x14, 0xc004);
18982         MP_WritePhyUshort(sc, 0x14, 0xd710);
18983         MP_WritePhyUshort(sc, 0x14, 0x4000);
18984         MP_WritePhyUshort(sc, 0x14, 0x0800);
18985         MP_WritePhyUshort(sc, 0x14, 0xa510);
18986         MP_WritePhyUshort(sc, 0x14, 0xd710);
18987         MP_WritePhyUshort(sc, 0x14, 0x609a);
18988         MP_WritePhyUshort(sc, 0x14, 0xd71e);
18989         MP_WritePhyUshort(sc, 0x14, 0x7fac);
18990         MP_WritePhyUshort(sc, 0x14, 0x2ab6);
18991         MP_WritePhyUshort(sc, 0x14, 0x8510);
18992         MP_WritePhyUshort(sc, 0x14, 0x0800);
18993         MP_WritePhyUshort(sc, 0x13, 0xA01A);
18994         MP_WritePhyUshort(sc, 0x14, 0x0000);
18995         MP_WritePhyUshort(sc, 0x13, 0xA006);
18996         MP_WritePhyUshort(sc, 0x14, 0x0ad6);
18997         MP_WritePhyUshort(sc, 0x13, 0xA004);
18998         MP_WritePhyUshort(sc, 0x14, 0x07f5);
18999         MP_WritePhyUshort(sc, 0x13, 0xA002);
19000         MP_WritePhyUshort(sc, 0x14, 0x06a9);
19001         MP_WritePhyUshort(sc, 0x13, 0xA000);
19002         MP_WritePhyUshort(sc, 0x14, 0xf069);
19003         MP_WritePhyUshort(sc, 0x13, 0xB820);
19004         MP_WritePhyUshort(sc, 0x14, 0x0210);
19005
19006         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19007         MP_WritePhyUshort(sc, 0x13, 0x83a0);
19008         MP_WritePhyUshort(sc, 0x14, 0xaf83);
19009         MP_WritePhyUshort(sc, 0x14, 0xacaf);
19010         MP_WritePhyUshort(sc, 0x14, 0x83b8);
19011         MP_WritePhyUshort(sc, 0x14, 0xaf83);
19012         MP_WritePhyUshort(sc, 0x14, 0xcdaf);
19013         MP_WritePhyUshort(sc, 0x14, 0x83d3);
19014         MP_WritePhyUshort(sc, 0x14, 0x0204);
19015         MP_WritePhyUshort(sc, 0x14, 0x9a02);
19016         MP_WritePhyUshort(sc, 0x14, 0x09a9);
19017         MP_WritePhyUshort(sc, 0x14, 0x0284);
19018         MP_WritePhyUshort(sc, 0x14, 0x61af);
19019         MP_WritePhyUshort(sc, 0x14, 0x02fc);
19020         MP_WritePhyUshort(sc, 0x14, 0xad20);
19021         MP_WritePhyUshort(sc, 0x14, 0x0302);
19022         MP_WritePhyUshort(sc, 0x14, 0x867c);
19023         MP_WritePhyUshort(sc, 0x14, 0xad21);
19024         MP_WritePhyUshort(sc, 0x14, 0x0302);
19025         MP_WritePhyUshort(sc, 0x14, 0x85c9);
19026         MP_WritePhyUshort(sc, 0x14, 0xad22);
19027         MP_WritePhyUshort(sc, 0x14, 0x0302);
19028         MP_WritePhyUshort(sc, 0x14, 0x1bc0);
19029         MP_WritePhyUshort(sc, 0x14, 0xaf17);
19030         MP_WritePhyUshort(sc, 0x14, 0xe302);
19031         MP_WritePhyUshort(sc, 0x14, 0x8703);
19032         MP_WritePhyUshort(sc, 0x14, 0xaf18);
19033         MP_WritePhyUshort(sc, 0x14, 0x6201);
19034         MP_WritePhyUshort(sc, 0x14, 0x06e0);
19035         MP_WritePhyUshort(sc, 0x14, 0x8148);
19036         MP_WritePhyUshort(sc, 0x14, 0xaf3c);
19037         MP_WritePhyUshort(sc, 0x14, 0x69f8);
19038         MP_WritePhyUshort(sc, 0x14, 0xf9fa);
19039         MP_WritePhyUshort(sc, 0x14, 0xef69);
19040         MP_WritePhyUshort(sc, 0x14, 0xee80);
19041         MP_WritePhyUshort(sc, 0x14, 0x10f7);
19042         MP_WritePhyUshort(sc, 0x14, 0xee80);
19043         MP_WritePhyUshort(sc, 0x14, 0x131f);
19044         MP_WritePhyUshort(sc, 0x14, 0xd104);
19045         MP_WritePhyUshort(sc, 0x14, 0xbf87);
19046         MP_WritePhyUshort(sc, 0x14, 0xf302);
19047         MP_WritePhyUshort(sc, 0x14, 0x4259);
19048         MP_WritePhyUshort(sc, 0x14, 0x0287);
19049         MP_WritePhyUshort(sc, 0x14, 0x88bf);
19050         MP_WritePhyUshort(sc, 0x14, 0x87cf);
19051         MP_WritePhyUshort(sc, 0x14, 0xd7b8);
19052         MP_WritePhyUshort(sc, 0x14, 0x22d0);
19053         MP_WritePhyUshort(sc, 0x14, 0x0c02);
19054         MP_WritePhyUshort(sc, 0x14, 0x4252);
19055         MP_WritePhyUshort(sc, 0x14, 0xee80);
19056         MP_WritePhyUshort(sc, 0x14, 0xcda0);
19057         MP_WritePhyUshort(sc, 0x14, 0xee80);
19058         MP_WritePhyUshort(sc, 0x14, 0xce8b);
19059         MP_WritePhyUshort(sc, 0x14, 0xee80);
19060         MP_WritePhyUshort(sc, 0x14, 0xd1f5);
19061         MP_WritePhyUshort(sc, 0x14, 0xee80);
19062         MP_WritePhyUshort(sc, 0x14, 0xd2a9);
19063         MP_WritePhyUshort(sc, 0x14, 0xee80);
19064         MP_WritePhyUshort(sc, 0x14, 0xd30a);
19065         MP_WritePhyUshort(sc, 0x14, 0xee80);
19066         MP_WritePhyUshort(sc, 0x14, 0xf010);
19067         MP_WritePhyUshort(sc, 0x14, 0xee80);
19068         MP_WritePhyUshort(sc, 0x14, 0xf38f);
19069         MP_WritePhyUshort(sc, 0x14, 0xee81);
19070         MP_WritePhyUshort(sc, 0x14, 0x011e);
19071         MP_WritePhyUshort(sc, 0x14, 0xee81);
19072         MP_WritePhyUshort(sc, 0x14, 0x0b4a);
19073         MP_WritePhyUshort(sc, 0x14, 0xee81);
19074         MP_WritePhyUshort(sc, 0x14, 0x0c7c);
19075         MP_WritePhyUshort(sc, 0x14, 0xee81);
19076         MP_WritePhyUshort(sc, 0x14, 0x127f);
19077         MP_WritePhyUshort(sc, 0x14, 0xd100);
19078         MP_WritePhyUshort(sc, 0x14, 0x0210);
19079         MP_WritePhyUshort(sc, 0x14, 0xb5ee);
19080         MP_WritePhyUshort(sc, 0x14, 0x8088);
19081         MP_WritePhyUshort(sc, 0x14, 0xa4ee);
19082         MP_WritePhyUshort(sc, 0x14, 0x8089);
19083         MP_WritePhyUshort(sc, 0x14, 0x44ee);
19084         MP_WritePhyUshort(sc, 0x14, 0x809a);
19085         MP_WritePhyUshort(sc, 0x14, 0xa4ee);
19086         MP_WritePhyUshort(sc, 0x14, 0x809b);
19087         MP_WritePhyUshort(sc, 0x14, 0x44ee);
19088         MP_WritePhyUshort(sc, 0x14, 0x809c);
19089         MP_WritePhyUshort(sc, 0x14, 0xa7ee);
19090         MP_WritePhyUshort(sc, 0x14, 0x80a5);
19091         MP_WritePhyUshort(sc, 0x14, 0xa7d2);
19092         MP_WritePhyUshort(sc, 0x14, 0x0002);
19093         MP_WritePhyUshort(sc, 0x14, 0x0e66);
19094         MP_WritePhyUshort(sc, 0x14, 0x0285);
19095         MP_WritePhyUshort(sc, 0x14, 0xc0ee);
19096         MP_WritePhyUshort(sc, 0x14, 0x87fc);
19097         MP_WritePhyUshort(sc, 0x14, 0x00e0);
19098         MP_WritePhyUshort(sc, 0x14, 0x8245);
19099         MP_WritePhyUshort(sc, 0x14, 0xf622);
19100         MP_WritePhyUshort(sc, 0x14, 0xe482);
19101         MP_WritePhyUshort(sc, 0x14, 0x45ef);
19102         MP_WritePhyUshort(sc, 0x14, 0x96fe);
19103         MP_WritePhyUshort(sc, 0x14, 0xfdfc);
19104         MP_WritePhyUshort(sc, 0x14, 0x0402);
19105         MP_WritePhyUshort(sc, 0x14, 0x847a);
19106         MP_WritePhyUshort(sc, 0x14, 0x0284);
19107         MP_WritePhyUshort(sc, 0x14, 0xb302);
19108         MP_WritePhyUshort(sc, 0x14, 0x0cab);
19109         MP_WritePhyUshort(sc, 0x14, 0x020c);
19110         MP_WritePhyUshort(sc, 0x14, 0xc402);
19111         MP_WritePhyUshort(sc, 0x14, 0x0cef);
19112         MP_WritePhyUshort(sc, 0x14, 0x020d);
19113         MP_WritePhyUshort(sc, 0x14, 0x0802);
19114         MP_WritePhyUshort(sc, 0x14, 0x0d33);
19115         MP_WritePhyUshort(sc, 0x14, 0x020c);
19116         MP_WritePhyUshort(sc, 0x14, 0x3d04);
19117         MP_WritePhyUshort(sc, 0x14, 0xf8fa);
19118         MP_WritePhyUshort(sc, 0x14, 0xef69);
19119         MP_WritePhyUshort(sc, 0x14, 0xe182);
19120         MP_WritePhyUshort(sc, 0x14, 0x2fac);
19121         MP_WritePhyUshort(sc, 0x14, 0x291a);
19122         MP_WritePhyUshort(sc, 0x14, 0xe082);
19123         MP_WritePhyUshort(sc, 0x14, 0x24ac);
19124         MP_WritePhyUshort(sc, 0x14, 0x2102);
19125         MP_WritePhyUshort(sc, 0x14, 0xae22);
19126         MP_WritePhyUshort(sc, 0x14, 0x0210);
19127         MP_WritePhyUshort(sc, 0x14, 0x57f6);
19128         MP_WritePhyUshort(sc, 0x14, 0x21e4);
19129         MP_WritePhyUshort(sc, 0x14, 0x8224);
19130         MP_WritePhyUshort(sc, 0x14, 0xd101);
19131         MP_WritePhyUshort(sc, 0x14, 0xbf44);
19132         MP_WritePhyUshort(sc, 0x14, 0xd202);
19133         MP_WritePhyUshort(sc, 0x14, 0x4259);
19134         MP_WritePhyUshort(sc, 0x14, 0xae10);
19135         MP_WritePhyUshort(sc, 0x14, 0x0212);
19136         MP_WritePhyUshort(sc, 0x14, 0x4cf6);
19137         MP_WritePhyUshort(sc, 0x14, 0x29e5);
19138         MP_WritePhyUshort(sc, 0x14, 0x822f);
19139         MP_WritePhyUshort(sc, 0x14, 0xe082);
19140         MP_WritePhyUshort(sc, 0x14, 0x24f6);
19141         MP_WritePhyUshort(sc, 0x14, 0x21e4);
19142         MP_WritePhyUshort(sc, 0x14, 0x8224);
19143         MP_WritePhyUshort(sc, 0x14, 0xef96);
19144         MP_WritePhyUshort(sc, 0x14, 0xfefc);
19145         MP_WritePhyUshort(sc, 0x14, 0x04f8);
19146         MP_WritePhyUshort(sc, 0x14, 0xe182);
19147         MP_WritePhyUshort(sc, 0x14, 0x2fac);
19148         MP_WritePhyUshort(sc, 0x14, 0x2a18);
19149         MP_WritePhyUshort(sc, 0x14, 0xe082);
19150         MP_WritePhyUshort(sc, 0x14, 0x24ac);
19151         MP_WritePhyUshort(sc, 0x14, 0x2202);
19152         MP_WritePhyUshort(sc, 0x14, 0xae26);
19153         MP_WritePhyUshort(sc, 0x14, 0x0284);
19154         MP_WritePhyUshort(sc, 0x14, 0xf802);
19155         MP_WritePhyUshort(sc, 0x14, 0x8565);
19156         MP_WritePhyUshort(sc, 0x14, 0xd101);
19157         MP_WritePhyUshort(sc, 0x14, 0xbf44);
19158         MP_WritePhyUshort(sc, 0x14, 0xd502);
19159         MP_WritePhyUshort(sc, 0x14, 0x4259);
19160         MP_WritePhyUshort(sc, 0x14, 0xae0e);
19161         MP_WritePhyUshort(sc, 0x14, 0x0284);
19162         MP_WritePhyUshort(sc, 0x14, 0xea02);
19163         MP_WritePhyUshort(sc, 0x14, 0x85a9);
19164         MP_WritePhyUshort(sc, 0x14, 0xe182);
19165         MP_WritePhyUshort(sc, 0x14, 0x2ff6);
19166         MP_WritePhyUshort(sc, 0x14, 0x2ae5);
19167         MP_WritePhyUshort(sc, 0x14, 0x822f);
19168         MP_WritePhyUshort(sc, 0x14, 0xe082);
19169         MP_WritePhyUshort(sc, 0x14, 0x24f6);
19170         MP_WritePhyUshort(sc, 0x14, 0x22e4);
19171         MP_WritePhyUshort(sc, 0x14, 0x8224);
19172         MP_WritePhyUshort(sc, 0x14, 0xfc04);
19173         MP_WritePhyUshort(sc, 0x14, 0xf9e2);
19174         MP_WritePhyUshort(sc, 0x14, 0x8011);
19175         MP_WritePhyUshort(sc, 0x14, 0xad31);
19176         MP_WritePhyUshort(sc, 0x14, 0x05d2);
19177         MP_WritePhyUshort(sc, 0x14, 0x0002);
19178         MP_WritePhyUshort(sc, 0x14, 0x0e66);
19179         MP_WritePhyUshort(sc, 0x14, 0xfd04);
19180         MP_WritePhyUshort(sc, 0x14, 0xf8f9);
19181         MP_WritePhyUshort(sc, 0x14, 0xfaef);
19182         MP_WritePhyUshort(sc, 0x14, 0x69e0);
19183         MP_WritePhyUshort(sc, 0x14, 0x8011);
19184         MP_WritePhyUshort(sc, 0x14, 0xad21);
19185         MP_WritePhyUshort(sc, 0x14, 0x5cbf);
19186         MP_WritePhyUshort(sc, 0x14, 0x43be);
19187         MP_WritePhyUshort(sc, 0x14, 0x0242);
19188         MP_WritePhyUshort(sc, 0x14, 0x97ac);
19189         MP_WritePhyUshort(sc, 0x14, 0x281b);
19190         MP_WritePhyUshort(sc, 0x14, 0xbf43);
19191         MP_WritePhyUshort(sc, 0x14, 0xc102);
19192         MP_WritePhyUshort(sc, 0x14, 0x4297);
19193         MP_WritePhyUshort(sc, 0x14, 0xac28);
19194         MP_WritePhyUshort(sc, 0x14, 0x12bf);
19195         MP_WritePhyUshort(sc, 0x14, 0x43c7);
19196         MP_WritePhyUshort(sc, 0x14, 0x0242);
19197         MP_WritePhyUshort(sc, 0x14, 0x97ac);
19198         MP_WritePhyUshort(sc, 0x14, 0x2804);
19199         MP_WritePhyUshort(sc, 0x14, 0xd300);
19200         MP_WritePhyUshort(sc, 0x14, 0xae07);
19201         MP_WritePhyUshort(sc, 0x14, 0xd306);
19202         MP_WritePhyUshort(sc, 0x14, 0xaf85);
19203         MP_WritePhyUshort(sc, 0x14, 0x56d3);
19204         MP_WritePhyUshort(sc, 0x14, 0x03e0);
19205         MP_WritePhyUshort(sc, 0x14, 0x8011);
19206         MP_WritePhyUshort(sc, 0x14, 0xad26);
19207         MP_WritePhyUshort(sc, 0x14, 0x25bf);
19208         MP_WritePhyUshort(sc, 0x14, 0x4559);
19209         MP_WritePhyUshort(sc, 0x14, 0x0242);
19210         MP_WritePhyUshort(sc, 0x14, 0x97e2);
19211         MP_WritePhyUshort(sc, 0x14, 0x8073);
19212         MP_WritePhyUshort(sc, 0x14, 0x0d21);
19213         MP_WritePhyUshort(sc, 0x14, 0xf637);
19214         MP_WritePhyUshort(sc, 0x14, 0x0d11);
19215         MP_WritePhyUshort(sc, 0x14, 0xf62f);
19216         MP_WritePhyUshort(sc, 0x14, 0x1b21);
19217         MP_WritePhyUshort(sc, 0x14, 0xaa02);
19218         MP_WritePhyUshort(sc, 0x14, 0xae10);
19219         MP_WritePhyUshort(sc, 0x14, 0xe280);
19220         MP_WritePhyUshort(sc, 0x14, 0x740d);
19221         MP_WritePhyUshort(sc, 0x14, 0x21f6);
19222         MP_WritePhyUshort(sc, 0x14, 0x371b);
19223         MP_WritePhyUshort(sc, 0x14, 0x21aa);
19224         MP_WritePhyUshort(sc, 0x14, 0x0313);
19225         MP_WritePhyUshort(sc, 0x14, 0xae02);
19226         MP_WritePhyUshort(sc, 0x14, 0x2b02);
19227         MP_WritePhyUshort(sc, 0x14, 0x020e);
19228         MP_WritePhyUshort(sc, 0x14, 0x5102);
19229         MP_WritePhyUshort(sc, 0x14, 0x0e66);
19230         MP_WritePhyUshort(sc, 0x14, 0x020f);
19231         MP_WritePhyUshort(sc, 0x14, 0xa3ef);
19232         MP_WritePhyUshort(sc, 0x14, 0x96fe);
19233         MP_WritePhyUshort(sc, 0x14, 0xfdfc);
19234         MP_WritePhyUshort(sc, 0x14, 0x04f8);
19235         MP_WritePhyUshort(sc, 0x14, 0xf9fa);
19236         MP_WritePhyUshort(sc, 0x14, 0xef69);
19237         MP_WritePhyUshort(sc, 0x14, 0xe080);
19238         MP_WritePhyUshort(sc, 0x14, 0x12ad);
19239         MP_WritePhyUshort(sc, 0x14, 0x2733);
19240         MP_WritePhyUshort(sc, 0x14, 0xbf43);
19241         MP_WritePhyUshort(sc, 0x14, 0xbe02);
19242         MP_WritePhyUshort(sc, 0x14, 0x4297);
19243         MP_WritePhyUshort(sc, 0x14, 0xac28);
19244         MP_WritePhyUshort(sc, 0x14, 0x09bf);
19245         MP_WritePhyUshort(sc, 0x14, 0x43c1);
19246         MP_WritePhyUshort(sc, 0x14, 0x0242);
19247         MP_WritePhyUshort(sc, 0x14, 0x97ad);
19248         MP_WritePhyUshort(sc, 0x14, 0x2821);
19249         MP_WritePhyUshort(sc, 0x14, 0xbf45);
19250         MP_WritePhyUshort(sc, 0x14, 0x5902);
19251         MP_WritePhyUshort(sc, 0x14, 0x4297);
19252         MP_WritePhyUshort(sc, 0x14, 0xe387);
19253         MP_WritePhyUshort(sc, 0x14, 0xffd2);
19254         MP_WritePhyUshort(sc, 0x14, 0x001b);
19255         MP_WritePhyUshort(sc, 0x14, 0x45ac);
19256         MP_WritePhyUshort(sc, 0x14, 0x2711);
19257         MP_WritePhyUshort(sc, 0x14, 0xe187);
19258         MP_WritePhyUshort(sc, 0x14, 0xfebf);
19259         MP_WritePhyUshort(sc, 0x14, 0x87e4);
19260         MP_WritePhyUshort(sc, 0x14, 0x0242);
19261         MP_WritePhyUshort(sc, 0x14, 0x590d);
19262         MP_WritePhyUshort(sc, 0x14, 0x11bf);
19263         MP_WritePhyUshort(sc, 0x14, 0x87e7);
19264         MP_WritePhyUshort(sc, 0x14, 0x0242);
19265         MP_WritePhyUshort(sc, 0x14, 0x59ef);
19266         MP_WritePhyUshort(sc, 0x14, 0x96fe);
19267         MP_WritePhyUshort(sc, 0x14, 0xfdfc);
19268         MP_WritePhyUshort(sc, 0x14, 0x04f8);
19269         MP_WritePhyUshort(sc, 0x14, 0xfaef);
19270         MP_WritePhyUshort(sc, 0x14, 0x69d1);
19271         MP_WritePhyUshort(sc, 0x14, 0x00bf);
19272         MP_WritePhyUshort(sc, 0x14, 0x87e4);
19273         MP_WritePhyUshort(sc, 0x14, 0x0242);
19274         MP_WritePhyUshort(sc, 0x14, 0x59bf);
19275         MP_WritePhyUshort(sc, 0x14, 0x87e7);
19276         MP_WritePhyUshort(sc, 0x14, 0x0242);
19277         MP_WritePhyUshort(sc, 0x14, 0x59ef);
19278         MP_WritePhyUshort(sc, 0x14, 0x96fe);
19279         MP_WritePhyUshort(sc, 0x14, 0xfc04);
19280         MP_WritePhyUshort(sc, 0x14, 0xee87);
19281         MP_WritePhyUshort(sc, 0x14, 0xff46);
19282         MP_WritePhyUshort(sc, 0x14, 0xee87);
19283         MP_WritePhyUshort(sc, 0x14, 0xfe01);
19284         MP_WritePhyUshort(sc, 0x14, 0x04f8);
19285         MP_WritePhyUshort(sc, 0x14, 0xfaef);
19286         MP_WritePhyUshort(sc, 0x14, 0x69e0);
19287         MP_WritePhyUshort(sc, 0x14, 0x8241);
19288         MP_WritePhyUshort(sc, 0x14, 0xa000);
19289         MP_WritePhyUshort(sc, 0x14, 0x0502);
19290         MP_WritePhyUshort(sc, 0x14, 0x85eb);
19291         MP_WritePhyUshort(sc, 0x14, 0xae0e);
19292         MP_WritePhyUshort(sc, 0x14, 0xa001);
19293         MP_WritePhyUshort(sc, 0x14, 0x0502);
19294         MP_WritePhyUshort(sc, 0x14, 0x1a5a);
19295         MP_WritePhyUshort(sc, 0x14, 0xae06);
19296         MP_WritePhyUshort(sc, 0x14, 0xa002);
19297         MP_WritePhyUshort(sc, 0x14, 0x0302);
19298         MP_WritePhyUshort(sc, 0x14, 0x1ae6);
19299         MP_WritePhyUshort(sc, 0x14, 0xef96);
19300         MP_WritePhyUshort(sc, 0x14, 0xfefc);
19301         MP_WritePhyUshort(sc, 0x14, 0x04f8);
19302         MP_WritePhyUshort(sc, 0x14, 0xf9fa);
19303         MP_WritePhyUshort(sc, 0x14, 0xef69);
19304         MP_WritePhyUshort(sc, 0x14, 0xe082);
19305         MP_WritePhyUshort(sc, 0x14, 0x29f6);
19306         MP_WritePhyUshort(sc, 0x14, 0x21e4);
19307         MP_WritePhyUshort(sc, 0x14, 0x8229);
19308         MP_WritePhyUshort(sc, 0x14, 0xe080);
19309         MP_WritePhyUshort(sc, 0x14, 0x10ac);
19310         MP_WritePhyUshort(sc, 0x14, 0x2202);
19311         MP_WritePhyUshort(sc, 0x14, 0xae76);
19312         MP_WritePhyUshort(sc, 0x14, 0xe082);
19313         MP_WritePhyUshort(sc, 0x14, 0x27f7);
19314         MP_WritePhyUshort(sc, 0x14, 0x21e4);
19315         MP_WritePhyUshort(sc, 0x14, 0x8227);
19316         MP_WritePhyUshort(sc, 0x14, 0xbf43);
19317         MP_WritePhyUshort(sc, 0x14, 0x1302);
19318         MP_WritePhyUshort(sc, 0x14, 0x4297);
19319         MP_WritePhyUshort(sc, 0x14, 0xef21);
19320         MP_WritePhyUshort(sc, 0x14, 0xbf43);
19321         MP_WritePhyUshort(sc, 0x14, 0x1602);
19322         MP_WritePhyUshort(sc, 0x14, 0x4297);
19323         MP_WritePhyUshort(sc, 0x14, 0x0c11);
19324         MP_WritePhyUshort(sc, 0x14, 0x1e21);
19325         MP_WritePhyUshort(sc, 0x14, 0xbf43);
19326         MP_WritePhyUshort(sc, 0x14, 0x1902);
19327         MP_WritePhyUshort(sc, 0x14, 0x4297);
19328         MP_WritePhyUshort(sc, 0x14, 0x0c12);
19329         MP_WritePhyUshort(sc, 0x14, 0x1e21);
19330         MP_WritePhyUshort(sc, 0x14, 0xe682);
19331         MP_WritePhyUshort(sc, 0x14, 0x43a2);
19332         MP_WritePhyUshort(sc, 0x14, 0x000a);
19333         MP_WritePhyUshort(sc, 0x14, 0xe182);
19334         MP_WritePhyUshort(sc, 0x14, 0x27f6);
19335         MP_WritePhyUshort(sc, 0x14, 0x29e5);
19336         MP_WritePhyUshort(sc, 0x14, 0x8227);
19337         MP_WritePhyUshort(sc, 0x14, 0xae42);
19338         MP_WritePhyUshort(sc, 0x14, 0xe082);
19339         MP_WritePhyUshort(sc, 0x14, 0x44f7);
19340         MP_WritePhyUshort(sc, 0x14, 0x21e4);
19341         MP_WritePhyUshort(sc, 0x14, 0x8244);
19342         MP_WritePhyUshort(sc, 0x14, 0x0246);
19343         MP_WritePhyUshort(sc, 0x14, 0xaebf);
19344         MP_WritePhyUshort(sc, 0x14, 0x4325);
19345         MP_WritePhyUshort(sc, 0x14, 0x0242);
19346         MP_WritePhyUshort(sc, 0x14, 0x97ef);
19347         MP_WritePhyUshort(sc, 0x14, 0x21bf);
19348         MP_WritePhyUshort(sc, 0x14, 0x431c);
19349         MP_WritePhyUshort(sc, 0x14, 0x0242);
19350         MP_WritePhyUshort(sc, 0x14, 0x970c);
19351         MP_WritePhyUshort(sc, 0x14, 0x121e);
19352         MP_WritePhyUshort(sc, 0x14, 0x21bf);
19353         MP_WritePhyUshort(sc, 0x14, 0x431f);
19354         MP_WritePhyUshort(sc, 0x14, 0x0242);
19355         MP_WritePhyUshort(sc, 0x14, 0x970c);
19356         MP_WritePhyUshort(sc, 0x14, 0x131e);
19357         MP_WritePhyUshort(sc, 0x14, 0x21bf);
19358         MP_WritePhyUshort(sc, 0x14, 0x4328);
19359         MP_WritePhyUshort(sc, 0x14, 0x0242);
19360         MP_WritePhyUshort(sc, 0x14, 0x970c);
19361         MP_WritePhyUshort(sc, 0x14, 0x141e);
19362         MP_WritePhyUshort(sc, 0x14, 0x21bf);
19363         MP_WritePhyUshort(sc, 0x14, 0x44b1);
19364         MP_WritePhyUshort(sc, 0x14, 0x0242);
19365         MP_WritePhyUshort(sc, 0x14, 0x970c);
19366         MP_WritePhyUshort(sc, 0x14, 0x161e);
19367         MP_WritePhyUshort(sc, 0x14, 0x21e6);
19368         MP_WritePhyUshort(sc, 0x14, 0x8242);
19369         MP_WritePhyUshort(sc, 0x14, 0xee82);
19370         MP_WritePhyUshort(sc, 0x14, 0x4101);
19371         MP_WritePhyUshort(sc, 0x14, 0xef96);
19372         MP_WritePhyUshort(sc, 0x14, 0xfefd);
19373         MP_WritePhyUshort(sc, 0x14, 0xfc04);
19374         MP_WritePhyUshort(sc, 0x14, 0xf8fa);
19375         MP_WritePhyUshort(sc, 0x14, 0xef69);
19376         MP_WritePhyUshort(sc, 0x14, 0xe082);
19377         MP_WritePhyUshort(sc, 0x14, 0x46a0);
19378         MP_WritePhyUshort(sc, 0x14, 0x0005);
19379         MP_WritePhyUshort(sc, 0x14, 0x0286);
19380         MP_WritePhyUshort(sc, 0x14, 0x96ae);
19381         MP_WritePhyUshort(sc, 0x14, 0x06a0);
19382         MP_WritePhyUshort(sc, 0x14, 0x0103);
19383         MP_WritePhyUshort(sc, 0x14, 0x0219);
19384         MP_WritePhyUshort(sc, 0x14, 0x19ef);
19385         MP_WritePhyUshort(sc, 0x14, 0x96fe);
19386         MP_WritePhyUshort(sc, 0x14, 0xfc04);
19387         MP_WritePhyUshort(sc, 0x14, 0xf8fa);
19388         MP_WritePhyUshort(sc, 0x14, 0xef69);
19389         MP_WritePhyUshort(sc, 0x14, 0xe082);
19390         MP_WritePhyUshort(sc, 0x14, 0x29f6);
19391         MP_WritePhyUshort(sc, 0x14, 0x20e4);
19392         MP_WritePhyUshort(sc, 0x14, 0x8229);
19393         MP_WritePhyUshort(sc, 0x14, 0xe080);
19394         MP_WritePhyUshort(sc, 0x14, 0x10ac);
19395         MP_WritePhyUshort(sc, 0x14, 0x2102);
19396         MP_WritePhyUshort(sc, 0x14, 0xae54);
19397         MP_WritePhyUshort(sc, 0x14, 0xe082);
19398         MP_WritePhyUshort(sc, 0x14, 0x27f7);
19399         MP_WritePhyUshort(sc, 0x14, 0x20e4);
19400         MP_WritePhyUshort(sc, 0x14, 0x8227);
19401         MP_WritePhyUshort(sc, 0x14, 0xbf42);
19402         MP_WritePhyUshort(sc, 0x14, 0xe602);
19403         MP_WritePhyUshort(sc, 0x14, 0x4297);
19404         MP_WritePhyUshort(sc, 0x14, 0xac28);
19405         MP_WritePhyUshort(sc, 0x14, 0x22bf);
19406         MP_WritePhyUshort(sc, 0x14, 0x430d);
19407         MP_WritePhyUshort(sc, 0x14, 0x0242);
19408         MP_WritePhyUshort(sc, 0x14, 0x97e5);
19409         MP_WritePhyUshort(sc, 0x14, 0x8247);
19410         MP_WritePhyUshort(sc, 0x14, 0xac28);
19411         MP_WritePhyUshort(sc, 0x14, 0x20d1);
19412         MP_WritePhyUshort(sc, 0x14, 0x03bf);
19413         MP_WritePhyUshort(sc, 0x14, 0x4307);
19414         MP_WritePhyUshort(sc, 0x14, 0x0242);
19415         MP_WritePhyUshort(sc, 0x14, 0x59ee);
19416         MP_WritePhyUshort(sc, 0x14, 0x8246);
19417         MP_WritePhyUshort(sc, 0x14, 0x00e1);
19418         MP_WritePhyUshort(sc, 0x14, 0x8227);
19419         MP_WritePhyUshort(sc, 0x14, 0xf628);
19420         MP_WritePhyUshort(sc, 0x14, 0xe582);
19421         MP_WritePhyUshort(sc, 0x14, 0x27ae);
19422         MP_WritePhyUshort(sc, 0x14, 0x21d1);
19423         MP_WritePhyUshort(sc, 0x14, 0x04bf);
19424         MP_WritePhyUshort(sc, 0x14, 0x4307);
19425         MP_WritePhyUshort(sc, 0x14, 0x0242);
19426         MP_WritePhyUshort(sc, 0x14, 0x59ae);
19427         MP_WritePhyUshort(sc, 0x14, 0x08d1);
19428         MP_WritePhyUshort(sc, 0x14, 0x05bf);
19429         MP_WritePhyUshort(sc, 0x14, 0x4307);
19430         MP_WritePhyUshort(sc, 0x14, 0x0242);
19431         MP_WritePhyUshort(sc, 0x14, 0x59e0);
19432         MP_WritePhyUshort(sc, 0x14, 0x8244);
19433         MP_WritePhyUshort(sc, 0x14, 0xf720);
19434         MP_WritePhyUshort(sc, 0x14, 0xe482);
19435         MP_WritePhyUshort(sc, 0x14, 0x4402);
19436         MP_WritePhyUshort(sc, 0x14, 0x46ae);
19437         MP_WritePhyUshort(sc, 0x14, 0xee82);
19438         MP_WritePhyUshort(sc, 0x14, 0x4601);
19439         MP_WritePhyUshort(sc, 0x14, 0xef96);
19440         MP_WritePhyUshort(sc, 0x14, 0xfefc);
19441         MP_WritePhyUshort(sc, 0x14, 0x04f8);
19442         MP_WritePhyUshort(sc, 0x14, 0xfaef);
19443         MP_WritePhyUshort(sc, 0x14, 0x69e0);
19444         MP_WritePhyUshort(sc, 0x14, 0x8013);
19445         MP_WritePhyUshort(sc, 0x14, 0xad24);
19446         MP_WritePhyUshort(sc, 0x14, 0x1cbf);
19447         MP_WritePhyUshort(sc, 0x14, 0x87f0);
19448         MP_WritePhyUshort(sc, 0x14, 0x0242);
19449         MP_WritePhyUshort(sc, 0x14, 0x97ad);
19450         MP_WritePhyUshort(sc, 0x14, 0x2813);
19451         MP_WritePhyUshort(sc, 0x14, 0xe087);
19452         MP_WritePhyUshort(sc, 0x14, 0xfca0);
19453         MP_WritePhyUshort(sc, 0x14, 0x0005);
19454         MP_WritePhyUshort(sc, 0x14, 0x0287);
19455         MP_WritePhyUshort(sc, 0x14, 0x36ae);
19456         MP_WritePhyUshort(sc, 0x14, 0x10a0);
19457         MP_WritePhyUshort(sc, 0x14, 0x0105);
19458         MP_WritePhyUshort(sc, 0x14, 0x0287);
19459         MP_WritePhyUshort(sc, 0x14, 0x48ae);
19460         MP_WritePhyUshort(sc, 0x14, 0x08e0);
19461         MP_WritePhyUshort(sc, 0x14, 0x8230);
19462         MP_WritePhyUshort(sc, 0x14, 0xf626);
19463         MP_WritePhyUshort(sc, 0x14, 0xe482);
19464         MP_WritePhyUshort(sc, 0x14, 0x30ef);
19465         MP_WritePhyUshort(sc, 0x14, 0x96fe);
19466         MP_WritePhyUshort(sc, 0x14, 0xfc04);
19467         MP_WritePhyUshort(sc, 0x14, 0xf8e0);
19468         MP_WritePhyUshort(sc, 0x14, 0x8245);
19469         MP_WritePhyUshort(sc, 0x14, 0xf722);
19470         MP_WritePhyUshort(sc, 0x14, 0xe482);
19471         MP_WritePhyUshort(sc, 0x14, 0x4502);
19472         MP_WritePhyUshort(sc, 0x14, 0x46ae);
19473         MP_WritePhyUshort(sc, 0x14, 0xee87);
19474         MP_WritePhyUshort(sc, 0x14, 0xfc01);
19475         MP_WritePhyUshort(sc, 0x14, 0xfc04);
19476         MP_WritePhyUshort(sc, 0x14, 0xf8fa);
19477         MP_WritePhyUshort(sc, 0x14, 0xef69);
19478         MP_WritePhyUshort(sc, 0x14, 0xfb02);
19479         MP_WritePhyUshort(sc, 0x14, 0x46d3);
19480         MP_WritePhyUshort(sc, 0x14, 0xad50);
19481         MP_WritePhyUshort(sc, 0x14, 0x2fbf);
19482         MP_WritePhyUshort(sc, 0x14, 0x87ed);
19483         MP_WritePhyUshort(sc, 0x14, 0xd101);
19484         MP_WritePhyUshort(sc, 0x14, 0x0242);
19485         MP_WritePhyUshort(sc, 0x14, 0x59bf);
19486         MP_WritePhyUshort(sc, 0x14, 0x87ed);
19487         MP_WritePhyUshort(sc, 0x14, 0xd100);
19488         MP_WritePhyUshort(sc, 0x14, 0x0242);
19489         MP_WritePhyUshort(sc, 0x14, 0x59e0);
19490         MP_WritePhyUshort(sc, 0x14, 0x8245);
19491         MP_WritePhyUshort(sc, 0x14, 0xf622);
19492         MP_WritePhyUshort(sc, 0x14, 0xe482);
19493         MP_WritePhyUshort(sc, 0x14, 0x4502);
19494         MP_WritePhyUshort(sc, 0x14, 0x46ae);
19495         MP_WritePhyUshort(sc, 0x14, 0xd100);
19496         MP_WritePhyUshort(sc, 0x14, 0xbf87);
19497         MP_WritePhyUshort(sc, 0x14, 0xf002);
19498         MP_WritePhyUshort(sc, 0x14, 0x4259);
19499         MP_WritePhyUshort(sc, 0x14, 0xee87);
19500         MP_WritePhyUshort(sc, 0x14, 0xfc00);
19501         MP_WritePhyUshort(sc, 0x14, 0xe082);
19502         MP_WritePhyUshort(sc, 0x14, 0x30f6);
19503         MP_WritePhyUshort(sc, 0x14, 0x26e4);
19504         MP_WritePhyUshort(sc, 0x14, 0x8230);
19505         MP_WritePhyUshort(sc, 0x14, 0xffef);
19506         MP_WritePhyUshort(sc, 0x14, 0x96fe);
19507         MP_WritePhyUshort(sc, 0x14, 0xfc04);
19508         MP_WritePhyUshort(sc, 0x14, 0xf8f9);
19509         MP_WritePhyUshort(sc, 0x14, 0xface);
19510         MP_WritePhyUshort(sc, 0x14, 0xfaef);
19511         MP_WritePhyUshort(sc, 0x14, 0x69fb);
19512         MP_WritePhyUshort(sc, 0x14, 0xbf87);
19513         MP_WritePhyUshort(sc, 0x14, 0xb3d7);
19514         MP_WritePhyUshort(sc, 0x14, 0x001c);
19515         MP_WritePhyUshort(sc, 0x14, 0xd819);
19516         MP_WritePhyUshort(sc, 0x14, 0xd919);
19517         MP_WritePhyUshort(sc, 0x14, 0xda19);
19518         MP_WritePhyUshort(sc, 0x14, 0xdb19);
19519         MP_WritePhyUshort(sc, 0x14, 0x07ef);
19520         MP_WritePhyUshort(sc, 0x14, 0x9502);
19521         MP_WritePhyUshort(sc, 0x14, 0x4259);
19522         MP_WritePhyUshort(sc, 0x14, 0x073f);
19523         MP_WritePhyUshort(sc, 0x14, 0x0004);
19524         MP_WritePhyUshort(sc, 0x14, 0x9fec);
19525         MP_WritePhyUshort(sc, 0x14, 0xffef);
19526         MP_WritePhyUshort(sc, 0x14, 0x96fe);
19527         MP_WritePhyUshort(sc, 0x14, 0xc6fe);
19528         MP_WritePhyUshort(sc, 0x14, 0xfdfc);
19529         MP_WritePhyUshort(sc, 0x14, 0x0400);
19530         MP_WritePhyUshort(sc, 0x14, 0x0145);
19531         MP_WritePhyUshort(sc, 0x14, 0x7d00);
19532         MP_WritePhyUshort(sc, 0x14, 0x0345);
19533         MP_WritePhyUshort(sc, 0x14, 0x5c00);
19534         MP_WritePhyUshort(sc, 0x14, 0x0143);
19535         MP_WritePhyUshort(sc, 0x14, 0x4f00);
19536         MP_WritePhyUshort(sc, 0x14, 0x0387);
19537         MP_WritePhyUshort(sc, 0x14, 0xdb00);
19538         MP_WritePhyUshort(sc, 0x14, 0x0987);
19539         MP_WritePhyUshort(sc, 0x14, 0xde00);
19540         MP_WritePhyUshort(sc, 0x14, 0x0987);
19541         MP_WritePhyUshort(sc, 0x14, 0xe100);
19542         MP_WritePhyUshort(sc, 0x14, 0x0087);
19543         MP_WritePhyUshort(sc, 0x14, 0xeaa4);
19544         MP_WritePhyUshort(sc, 0x14, 0x00b8);
19545         MP_WritePhyUshort(sc, 0x14, 0x20c4);
19546         MP_WritePhyUshort(sc, 0x14, 0x1600);
19547         MP_WritePhyUshort(sc, 0x14, 0x000f);
19548         MP_WritePhyUshort(sc, 0x14, 0xf800);
19549         MP_WritePhyUshort(sc, 0x14, 0x7098);
19550         MP_WritePhyUshort(sc, 0x14, 0xa58a);
19551         MP_WritePhyUshort(sc, 0x14, 0xb6a8);
19552         MP_WritePhyUshort(sc, 0x14, 0x3e50);
19553         MP_WritePhyUshort(sc, 0x14, 0xa83e);
19554         MP_WritePhyUshort(sc, 0x14, 0x33bc);
19555         MP_WritePhyUshort(sc, 0x14, 0xc622);
19556         MP_WritePhyUshort(sc, 0x14, 0xbcc6);
19557         MP_WritePhyUshort(sc, 0x14, 0xaaa4);
19558         MP_WritePhyUshort(sc, 0x14, 0x42ff);
19559         MP_WritePhyUshort(sc, 0x14, 0xc408);
19560         MP_WritePhyUshort(sc, 0x14, 0x00c4);
19561         MP_WritePhyUshort(sc, 0x14, 0x16a8);
19562         MP_WritePhyUshort(sc, 0x14, 0xbcc0);
19563         MP_WritePhyUshort(sc, 0x13, 0xb818);
19564         MP_WritePhyUshort(sc, 0x14, 0x02f3);
19565         MP_WritePhyUshort(sc, 0x13, 0xb81a);
19566         MP_WritePhyUshort(sc, 0x14, 0x17d1);
19567         MP_WritePhyUshort(sc, 0x13, 0xb81c);
19568         MP_WritePhyUshort(sc, 0x14, 0x185a);
19569         MP_WritePhyUshort(sc, 0x13, 0xb81e);
19570         MP_WritePhyUshort(sc, 0x14, 0x3c66);
19571         MP_WritePhyUshort(sc, 0x13, 0xb820);
19572         MP_WritePhyUshort(sc, 0x14, 0x021f);
19573         MP_WritePhyUshort(sc, 0x13, 0xc416);
19574         MP_WritePhyUshort(sc, 0x14, 0x0500);
19575         MP_WritePhyUshort(sc, 0x13, 0xb82e);
19576         MP_WritePhyUshort(sc, 0x14, 0xfffc);
19577
19578         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19579         MP_WritePhyUshort(sc, 0x13, 0x0000);
19580         MP_WritePhyUshort(sc, 0x14, 0x0000);
19581         MP_WritePhyUshort(sc, 0x1f, 0x0B82);
19582         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19583         PhyRegValue &= ~(BIT_9);
19584         MP_WritePhyUshort(sc, 0x10, PhyRegValue);
19585         MP_WritePhyUshort(sc, 0x1f, 0x0A43);
19586         MP_WritePhyUshort(sc, 0x13, 0x8146);
19587         MP_WritePhyUshort(sc, 0x14, 0x0000);
19588
19589         MP_WritePhyUshort(sc, 0x1f, 0x0B82);
19590         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19591         PhyRegValue &= ~(BIT_4);
19592         MP_WritePhyUshort(sc, 0x10, PhyRegValue);
19593         if (sc->RequiredSecLanDonglePatch) {
19594                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19595                 PhyRegValue = MP_ReadPhyUshort(sc, 0x11);
19596                 PhyRegValue &= ~(BIT_6);
19597                 MP_WritePhyUshort(sc, 0x11, PhyRegValue);
19598         }
19599 }
19600
19601 static void re_set_phy_mcu_8168gu_2(struct re_softc *sc)
19602 {
19603         u_int16_t PhyRegValue;
19604         u_int32_t WaitCnt;
19605
19606         MP_WritePhyUshort(sc, 0x1f, 0x0B82);
19607         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19608         PhyRegValue |= BIT_4;
19609         MP_WritePhyUshort(sc, 0x10, PhyRegValue);
19610
19611         MP_WritePhyUshort(sc, 0x1f, 0x0B80);
19612         WaitCnt = 0;
19613         do {
19614                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19615                 PhyRegValue &= 0x0040;
19616                 DELAY(50);
19617                 DELAY(50);
19618                 WaitCnt++;
19619         } while(PhyRegValue != 0x0040 && WaitCnt <1000);
19620
19621         MP_WritePhyUshort(sc, 0x1f, 0x0A43);
19622         MP_WritePhyUshort(sc, 0x13, 0x8146);
19623         MP_WritePhyUshort(sc, 0x14, 0x0300);
19624         MP_WritePhyUshort(sc, 0x13, 0xB82E);
19625         MP_WritePhyUshort(sc, 0x14, 0x0001);
19626
19627         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19628         MP_WritePhyUshort(sc, 0x13, 0xb820);
19629         MP_WritePhyUshort(sc, 0x14, 0x0290);
19630         MP_WritePhyUshort(sc, 0x13, 0xa012);
19631         MP_WritePhyUshort(sc, 0x14, 0x0000);
19632         MP_WritePhyUshort(sc, 0x13, 0xa014);
19633         MP_WritePhyUshort(sc, 0x14, 0x2c04);
19634         MP_WritePhyUshort(sc, 0x14, 0x2c07);
19635         MP_WritePhyUshort(sc, 0x14, 0x2c07);
19636         MP_WritePhyUshort(sc, 0x14, 0x2c07);
19637         MP_WritePhyUshort(sc, 0x14, 0xa304);
19638         MP_WritePhyUshort(sc, 0x14, 0xa301);
19639         MP_WritePhyUshort(sc, 0x14, 0x207e);
19640         MP_WritePhyUshort(sc, 0x13, 0xa01a);
19641         MP_WritePhyUshort(sc, 0x14, 0x0000);
19642         MP_WritePhyUshort(sc, 0x13, 0xa006);
19643         MP_WritePhyUshort(sc, 0x14, 0x0fff);
19644         MP_WritePhyUshort(sc, 0x13, 0xa004);
19645         MP_WritePhyUshort(sc, 0x14, 0x0fff);
19646         MP_WritePhyUshort(sc, 0x13, 0xa002);
19647         MP_WritePhyUshort(sc, 0x14, 0x0fff);
19648         MP_WritePhyUshort(sc, 0x13, 0xa000);
19649         MP_WritePhyUshort(sc, 0x14, 0x107c);
19650         MP_WritePhyUshort(sc, 0x13, 0xb820);
19651         MP_WritePhyUshort(sc, 0x14, 0x0210);
19652
19653         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19654         MP_WritePhyUshort(sc, 0x13, 0x0000);
19655         MP_WritePhyUshort(sc, 0x14, 0x0000);
19656         MP_WritePhyUshort(sc, 0x1f, 0x0B82);
19657         PhyRegValue = MP_ReadPhyUshort(sc, 0x17);
19658         PhyRegValue &= ~(BIT_0);
19659         MP_WritePhyUshort(sc, 0x17, PhyRegValue);
19660         MP_WritePhyUshort(sc, 0x1f, 0x0A43);
19661         MP_WritePhyUshort(sc, 0x13, 0x8146);
19662         MP_WritePhyUshort(sc, 0x14, 0x0000);
19663
19664         MP_WritePhyUshort(sc, 0x1f, 0x0B82);
19665         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19666         PhyRegValue &= ~(BIT_4);
19667         MP_WritePhyUshort(sc, 0x10, PhyRegValue);
19668         if (sc->RequiredSecLanDonglePatch) {
19669                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19670                 PhyRegValue = MP_ReadPhyUshort(sc, 0x11);
19671                 PhyRegValue &= ~(BIT_6);
19672                 MP_WritePhyUshort(sc, 0x11, PhyRegValue);
19673         }
19674 }
19675
19676 static void re_set_phy_mcu_8411b_1(struct re_softc *sc)
19677 {
19678         u_int16_t PhyRegValue;
19679         u_int32_t WaitCnt;
19680
19681         MP_WritePhyUshort(sc, 0x1f, 0x0B82);
19682         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19683         PhyRegValue |= BIT_4;
19684         MP_WritePhyUshort(sc, 0x10, PhyRegValue);
19685
19686         MP_WritePhyUshort(sc, 0x1f, 0x0B80);
19687         WaitCnt = 0;
19688         do {
19689                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19690                 PhyRegValue &= 0x0040;
19691                 DELAY(50);
19692                 DELAY(50);
19693                 WaitCnt++;
19694         } while(PhyRegValue != 0x0040 && WaitCnt <1000);
19695
19696         MP_WritePhyUshort(sc, 0x1f, 0x0A43);
19697         MP_WritePhyUshort(sc, 0x13, 0x8146);
19698         MP_WritePhyUshort(sc, 0x14, 0x0100);
19699         MP_WritePhyUshort(sc, 0x13, 0xB82E);
19700         MP_WritePhyUshort(sc, 0x14, 0x0001);
19701
19702         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19703         MP_WritePhyUshort(sc, 0x13, 0xb820);
19704         MP_WritePhyUshort(sc, 0x14, 0x0290);
19705         MP_WritePhyUshort(sc, 0x13, 0xa012);
19706         MP_WritePhyUshort(sc, 0x14, 0x0000);
19707         MP_WritePhyUshort(sc, 0x13, 0xa014);
19708         MP_WritePhyUshort(sc, 0x14, 0x2c04);
19709         MP_WritePhyUshort(sc, 0x14, 0x2c07);
19710         MP_WritePhyUshort(sc, 0x14, 0x2c07);
19711         MP_WritePhyUshort(sc, 0x14, 0x2c07);
19712         MP_WritePhyUshort(sc, 0x14, 0xa304);
19713         MP_WritePhyUshort(sc, 0x14, 0xa301);
19714         MP_WritePhyUshort(sc, 0x14, 0x207e);
19715         MP_WritePhyUshort(sc, 0x13, 0xa01a);
19716         MP_WritePhyUshort(sc, 0x14, 0x0000);
19717         MP_WritePhyUshort(sc, 0x13, 0xa006);
19718         MP_WritePhyUshort(sc, 0x14, 0x0fff);
19719         MP_WritePhyUshort(sc, 0x13, 0xa004);
19720         MP_WritePhyUshort(sc, 0x14, 0x0fff);
19721         MP_WritePhyUshort(sc, 0x13, 0xa002);
19722         MP_WritePhyUshort(sc, 0x14, 0x0fff);
19723         MP_WritePhyUshort(sc, 0x13, 0xa000);
19724         MP_WritePhyUshort(sc, 0x14, 0x107c);
19725         MP_WritePhyUshort(sc, 0x13, 0xb820);
19726         MP_WritePhyUshort(sc, 0x14, 0x0210);
19727
19728         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19729         MP_WritePhyUshort(sc, 0x13, 0x0000);
19730         MP_WritePhyUshort(sc, 0x14, 0x0000);
19731         MP_WritePhyUshort(sc, 0x1f, 0x0B82);
19732         PhyRegValue = MP_ReadPhyUshort(sc, 0x17);
19733         PhyRegValue &= ~(BIT_0);
19734         MP_WritePhyUshort(sc, 0x17, PhyRegValue);
19735         MP_WritePhyUshort(sc, 0x1f, 0x0A43);
19736         MP_WritePhyUshort(sc, 0x13, 0x8146);
19737         MP_WritePhyUshort(sc, 0x14, 0x0000);
19738
19739         MP_WritePhyUshort(sc, 0x1f, 0x0B82);
19740         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19741         PhyRegValue &= ~(BIT_4);
19742         MP_WritePhyUshort(sc, 0x10, PhyRegValue);
19743         if (sc->RequiredSecLanDonglePatch) {
19744                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19745                 PhyRegValue = MP_ReadPhyUshort(sc, 0x11);
19746                 PhyRegValue &= ~(BIT_6);
19747                 MP_WritePhyUshort(sc, 0x11, PhyRegValue);
19748         }
19749 }
19750
19751 static void re_set_phy_mcu_8168h_1(struct re_softc *sc)
19752 {
19753         u_int16_t PhyRegValue;
19754         u_int32_t WaitCnt;
19755
19756         MP_WritePhyUshort(sc, 0x1f, 0x0B82);
19757         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19758         PhyRegValue |= BIT_4;
19759         MP_WritePhyUshort(sc, 0x10, PhyRegValue);
19760
19761         MP_WritePhyUshort(sc, 0x1f, 0x0B80);
19762         WaitCnt = 0;
19763         do {
19764                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19765                 PhyRegValue &= 0x0040;
19766                 DELAY(50);
19767                 DELAY(50);
19768                 WaitCnt++;
19769         } while(PhyRegValue != 0x0040 && WaitCnt <1000);
19770
19771         MP_WritePhyUshort(sc, 0x1f, 0x0A43);
19772         MP_WritePhyUshort(sc, 0x13, 0x8028);
19773         MP_WritePhyUshort(sc, 0x14, 0x6200);
19774         MP_WritePhyUshort(sc, 0x13, 0xB82E);
19775         MP_WritePhyUshort(sc, 0x14, 0x0001);
19776
19777         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19778         MP_WritePhyUshort(sc, 0x13, 0xB820);
19779         MP_WritePhyUshort(sc, 0x14, 0x0290);
19780         MP_WritePhyUshort(sc, 0x13, 0xA012);
19781         MP_WritePhyUshort(sc, 0x14, 0x0000);
19782         MP_WritePhyUshort(sc, 0x13, 0xA014);
19783         MP_WritePhyUshort(sc, 0x14, 0x2c04);
19784         MP_WritePhyUshort(sc, 0x14, 0x2c10);
19785         MP_WritePhyUshort(sc, 0x14, 0x2c10);
19786         MP_WritePhyUshort(sc, 0x14, 0x2c10);
19787         MP_WritePhyUshort(sc, 0x14, 0xa210);
19788         MP_WritePhyUshort(sc, 0x14, 0xa101);
19789         MP_WritePhyUshort(sc, 0x14, 0xce10);
19790         MP_WritePhyUshort(sc, 0x14, 0xe070);
19791         MP_WritePhyUshort(sc, 0x14, 0x0f40);
19792         MP_WritePhyUshort(sc, 0x14, 0xaf01);
19793         MP_WritePhyUshort(sc, 0x14, 0x8f01);
19794         MP_WritePhyUshort(sc, 0x14, 0x183e);
19795         MP_WritePhyUshort(sc, 0x14, 0x8e10);
19796         MP_WritePhyUshort(sc, 0x14, 0x8101);
19797         MP_WritePhyUshort(sc, 0x14, 0x8210);
19798         MP_WritePhyUshort(sc, 0x14, 0x28da);
19799         MP_WritePhyUshort(sc, 0x13, 0xA01A);
19800         MP_WritePhyUshort(sc, 0x14, 0x0000);
19801         MP_WritePhyUshort(sc, 0x13, 0xA006);
19802         MP_WritePhyUshort(sc, 0x14, 0x0017);
19803         MP_WritePhyUshort(sc, 0x13, 0xA004);
19804         MP_WritePhyUshort(sc, 0x14, 0x0015);
19805         MP_WritePhyUshort(sc, 0x13, 0xA002);
19806         MP_WritePhyUshort(sc, 0x14, 0x0013);
19807         MP_WritePhyUshort(sc, 0x13, 0xA000);
19808         MP_WritePhyUshort(sc, 0x14, 0x18d1);
19809         MP_WritePhyUshort(sc, 0x13, 0xB820);
19810         MP_WritePhyUshort(sc, 0x14, 0x0210);
19811
19812         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19813         MP_WritePhyUshort(sc, 0x13, 0x0000);
19814         MP_WritePhyUshort(sc, 0x14, 0x0000);
19815         MP_WritePhyUshort(sc, 0x1f, 0x0B82);
19816         PhyRegValue = MP_ReadPhyUshort(sc, 0x17);
19817         PhyRegValue &= ~(BIT_0);
19818         MP_WritePhyUshort(sc, 0x17, PhyRegValue);
19819         MP_WritePhyUshort(sc, 0x1f, 0x0A43);
19820         MP_WritePhyUshort(sc, 0x13, 0x8028);
19821         MP_WritePhyUshort(sc, 0x14, 0x0000);
19822
19823         MP_WritePhyUshort(sc, 0x1f, 0x0B82);
19824         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19825         PhyRegValue &= ~(BIT_4);
19826         MP_WritePhyUshort(sc, 0x10, PhyRegValue);
19827         if (sc->RequiredSecLanDonglePatch) {
19828                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19829                 PhyRegValue = MP_ReadPhyUshort(sc, 0x11);
19830                 PhyRegValue &= ~(BIT_6);
19831                 MP_WritePhyUshort(sc, 0x11, PhyRegValue);
19832         }
19833 }
19834
19835 static void re_set_phy_mcu_8168h_2(struct re_softc *sc)
19836 {
19837         u_int16_t PhyRegValue;
19838         u_int32_t WaitCnt;
19839
19840         MP_WritePhyUshort(sc, 0x1f, 0x0B82);
19841         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19842         PhyRegValue |= BIT_4;
19843         MP_WritePhyUshort(sc, 0x10, PhyRegValue);
19844
19845         MP_WritePhyUshort(sc, 0x1f, 0x0B80);
19846         WaitCnt = 0;
19847         do {
19848                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19849                 PhyRegValue &= 0x0040;
19850                 DELAY(50);
19851                 DELAY(50);
19852                 WaitCnt++;
19853         } while(PhyRegValue != 0x0040 && WaitCnt <1000);
19854
19855         MP_WritePhyUshort(sc, 0x1f, 0x0A43);
19856         MP_WritePhyUshort(sc, 0x13, 0x8028);
19857         MP_WritePhyUshort(sc, 0x14, 0x6201);
19858         MP_WritePhyUshort(sc, 0x13, 0xB82E);
19859         MP_WritePhyUshort(sc, 0x14, 0x0001);
19860
19861         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19862         MP_WritePhyUshort(sc, 0x13, 0xB820);
19863         MP_WritePhyUshort(sc, 0x14, 0x0290);
19864         MP_WritePhyUshort(sc, 0x13, 0xA012);
19865         MP_WritePhyUshort(sc, 0x14, 0x0000);
19866         MP_WritePhyUshort(sc, 0x13, 0xA014);
19867         MP_WritePhyUshort(sc, 0x14, 0x2c04);
19868         MP_WritePhyUshort(sc, 0x14, 0x2c09);
19869         MP_WritePhyUshort(sc, 0x14, 0x2c09);
19870         MP_WritePhyUshort(sc, 0x14, 0x2c09);
19871         MP_WritePhyUshort(sc, 0x14, 0xad01);
19872         MP_WritePhyUshort(sc, 0x14, 0xad01);
19873         MP_WritePhyUshort(sc, 0x14, 0xad01);
19874         MP_WritePhyUshort(sc, 0x14, 0xad01);
19875         MP_WritePhyUshort(sc, 0x14, 0x236c);
19876         MP_WritePhyUshort(sc, 0x13, 0xA01A);
19877         MP_WritePhyUshort(sc, 0x14, 0x0000);
19878         MP_WritePhyUshort(sc, 0x13, 0xA006);
19879         MP_WritePhyUshort(sc, 0x14, 0x0fff);
19880         MP_WritePhyUshort(sc, 0x13, 0xA004);
19881         MP_WritePhyUshort(sc, 0x14, 0x0fff);
19882         MP_WritePhyUshort(sc, 0x13, 0xA002);
19883         MP_WritePhyUshort(sc, 0x14, 0x0fff);
19884         MP_WritePhyUshort(sc, 0x13, 0xA000);
19885         MP_WritePhyUshort(sc, 0x14, 0x136b);
19886         MP_WritePhyUshort(sc, 0x13, 0xB820);
19887         MP_WritePhyUshort(sc, 0x14, 0x0210);
19888
19889         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19890         MP_WritePhyUshort(sc, 0x13, 0x0000);
19891         MP_WritePhyUshort(sc, 0x14, 0x0000);
19892         MP_WritePhyUshort(sc, 0x1f, 0x0B82);
19893         PhyRegValue = MP_ReadPhyUshort(sc, 0x17);
19894         PhyRegValue &= ~(BIT_0);
19895         MP_WritePhyUshort(sc, 0x17, PhyRegValue);
19896         MP_WritePhyUshort(sc, 0x1f, 0x0A43);
19897         MP_WritePhyUshort(sc, 0x13, 0x8028);
19898         MP_WritePhyUshort(sc, 0x14, 0x0000);
19899
19900         MP_WritePhyUshort(sc, 0x1f, 0x0B82);
19901         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19902         PhyRegValue &= ~(BIT_4);
19903         MP_WritePhyUshort(sc, 0x10, PhyRegValue);
19904         if (sc->RequiredSecLanDonglePatch) {
19905                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19906                 PhyRegValue = MP_ReadPhyUshort(sc, 0x11);
19907                 PhyRegValue &= ~(BIT_6);
19908                 MP_WritePhyUshort(sc, 0x11, PhyRegValue);
19909         }
19910 }
19911
19912 static void re_set_phy_mcu_8168ep_1(struct re_softc *sc)
19913 {
19914         u_int16_t PhyRegValue;
19915         u_int32_t WaitCnt;
19916
19917         MP_WritePhyUshort(sc, 0x1f, 0x0B82);
19918         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19919         PhyRegValue |= BIT_4;
19920         MP_WritePhyUshort(sc, 0x10, PhyRegValue);
19921
19922         MP_WritePhyUshort(sc, 0x1f, 0x0B80);
19923         WaitCnt = 0;
19924         do {
19925                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19926                 PhyRegValue &= 0x0040;
19927                 DELAY(50);
19928                 DELAY(50);
19929                 WaitCnt++;
19930         } while(PhyRegValue != 0x0040 && WaitCnt <1000);
19931
19932         MP_WritePhyUshort(sc, 0x1f, 0x0A43);
19933         MP_WritePhyUshort(sc, 0x13, 0x8146);
19934         MP_WritePhyUshort(sc, 0x14, 0x2700);
19935         MP_WritePhyUshort(sc, 0x13, 0xB82E);
19936         MP_WritePhyUshort(sc, 0x14, 0x0001);
19937
19938         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19939         MP_WritePhyUshort(sc, 0x13, 0xb820);
19940         MP_WritePhyUshort(sc, 0x14, 0x0090);
19941         MP_WritePhyUshort(sc, 0x13, 0xa012);
19942         MP_WritePhyUshort(sc, 0x14, 0x0000);
19943         MP_WritePhyUshort(sc, 0x13, 0xa014);
19944         MP_WritePhyUshort(sc, 0x14, 0x2c04);
19945         MP_WritePhyUshort(sc, 0x14, 0x2c1b);
19946         MP_WritePhyUshort(sc, 0x14, 0x2c65);
19947         MP_WritePhyUshort(sc, 0x14, 0x2d14);
19948         MP_WritePhyUshort(sc, 0x14, 0xd71e);
19949         MP_WritePhyUshort(sc, 0x14, 0x4092);
19950         MP_WritePhyUshort(sc, 0x14, 0xba04);
19951         MP_WritePhyUshort(sc, 0x14, 0x3084);
19952         MP_WritePhyUshort(sc, 0x14, 0x1d04);
19953         MP_WritePhyUshort(sc, 0x14, 0x1cdd);
19954         MP_WritePhyUshort(sc, 0x14, 0x1ce8);
19955         MP_WritePhyUshort(sc, 0x14, 0xaeff);
19956         MP_WritePhyUshort(sc, 0x14, 0xaf02);
19957         MP_WritePhyUshort(sc, 0x14, 0x8f02);
19958         MP_WritePhyUshort(sc, 0x14, 0x8eff);
19959         MP_WritePhyUshort(sc, 0x14, 0xce01);
19960         MP_WritePhyUshort(sc, 0x14, 0xe070);
19961         MP_WritePhyUshort(sc, 0x14, 0x0f00);
19962         MP_WritePhyUshort(sc, 0x14, 0xaf01);
19963         MP_WritePhyUshort(sc, 0x14, 0x8f01);
19964         MP_WritePhyUshort(sc, 0x14, 0xd712);
19965         MP_WritePhyUshort(sc, 0x14, 0x5fe8);
19966         MP_WritePhyUshort(sc, 0x14, 0xaf02);
19967         MP_WritePhyUshort(sc, 0x14, 0x8f02);
19968         MP_WritePhyUshort(sc, 0x14, 0x8e01);
19969         MP_WritePhyUshort(sc, 0x14, 0x1cf2);
19970         MP_WritePhyUshort(sc, 0x14, 0x2825);
19971         MP_WritePhyUshort(sc, 0x14, 0xd05a);
19972         MP_WritePhyUshort(sc, 0x14, 0xd19a);
19973         MP_WritePhyUshort(sc, 0x14, 0xd709);
19974         MP_WritePhyUshort(sc, 0x14, 0x608f);
19975         MP_WritePhyUshort(sc, 0x14, 0xd06b);
19976         MP_WritePhyUshort(sc, 0x14, 0xd18a);
19977         MP_WritePhyUshort(sc, 0x14, 0x2c25);
19978         MP_WritePhyUshort(sc, 0x14, 0xd0be);
19979         MP_WritePhyUshort(sc, 0x14, 0xd188);
19980         MP_WritePhyUshort(sc, 0x14, 0x2c25);
19981         MP_WritePhyUshort(sc, 0x14, 0xd708);
19982         MP_WritePhyUshort(sc, 0x14, 0x4072);
19983         MP_WritePhyUshort(sc, 0x14, 0xc104);
19984         MP_WritePhyUshort(sc, 0x14, 0x2c37);
19985         MP_WritePhyUshort(sc, 0x14, 0x4076);
19986         MP_WritePhyUshort(sc, 0x14, 0xc110);
19987         MP_WritePhyUshort(sc, 0x14, 0x2c37);
19988         MP_WritePhyUshort(sc, 0x14, 0x4071);
19989         MP_WritePhyUshort(sc, 0x14, 0xc102);
19990         MP_WritePhyUshort(sc, 0x14, 0x2c37);
19991         MP_WritePhyUshort(sc, 0x14, 0x4070);
19992         MP_WritePhyUshort(sc, 0x14, 0xc101);
19993         MP_WritePhyUshort(sc, 0x14, 0x2c37);
19994         MP_WritePhyUshort(sc, 0x14, 0x1786);
19995         MP_WritePhyUshort(sc, 0x14, 0xd709);
19996         MP_WritePhyUshort(sc, 0x14, 0x3390);
19997         MP_WritePhyUshort(sc, 0x14, 0x5c32);
19998         MP_WritePhyUshort(sc, 0x14, 0x2c47);
19999         MP_WritePhyUshort(sc, 0x14, 0x1786);
20000         MP_WritePhyUshort(sc, 0x14, 0xd708);
20001         MP_WritePhyUshort(sc, 0x14, 0x6193);
20002         MP_WritePhyUshort(sc, 0x14, 0xd709);
20003         MP_WritePhyUshort(sc, 0x14, 0x5f9d);
20004         MP_WritePhyUshort(sc, 0x14, 0x408b);
20005         MP_WritePhyUshort(sc, 0x14, 0xd71e);
20006         MP_WritePhyUshort(sc, 0x14, 0x6042);
20007         MP_WritePhyUshort(sc, 0x14, 0xb401);
20008         MP_WritePhyUshort(sc, 0x14, 0x1786);
20009         MP_WritePhyUshort(sc, 0x14, 0xd708);
20010         MP_WritePhyUshort(sc, 0x14, 0x6073);
20011         MP_WritePhyUshort(sc, 0x14, 0x5fbc);
20012         MP_WritePhyUshort(sc, 0x14, 0x2c46);
20013         MP_WritePhyUshort(sc, 0x14, 0x26fe);
20014         MP_WritePhyUshort(sc, 0x14, 0xb280);
20015         MP_WritePhyUshort(sc, 0x14, 0xa841);
20016         MP_WritePhyUshort(sc, 0x14, 0x94e0);
20017         MP_WritePhyUshort(sc, 0x14, 0x8710);
20018         MP_WritePhyUshort(sc, 0x14, 0xd709);
20019         MP_WritePhyUshort(sc, 0x14, 0x42ec);
20020         MP_WritePhyUshort(sc, 0x14, 0x606d);
20021         MP_WritePhyUshort(sc, 0x14, 0xd207);
20022         MP_WritePhyUshort(sc, 0x14, 0x2c50);
20023         MP_WritePhyUshort(sc, 0x14, 0xd203);
20024         MP_WritePhyUshort(sc, 0x14, 0x33ff);
20025         MP_WritePhyUshort(sc, 0x14, 0x5647);
20026         MP_WritePhyUshort(sc, 0x14, 0x3275);
20027         MP_WritePhyUshort(sc, 0x14, 0x7c57);
20028         MP_WritePhyUshort(sc, 0x14, 0xb240);
20029         MP_WritePhyUshort(sc, 0x14, 0xb402);
20030         MP_WritePhyUshort(sc, 0x14, 0x2647);
20031         MP_WritePhyUshort(sc, 0x14, 0x6096);
20032         MP_WritePhyUshort(sc, 0x14, 0xb240);
20033         MP_WritePhyUshort(sc, 0x14, 0xb406);
20034         MP_WritePhyUshort(sc, 0x14, 0x2647);
20035         MP_WritePhyUshort(sc, 0x14, 0x31d7);
20036         MP_WritePhyUshort(sc, 0x14, 0x7c60);
20037         MP_WritePhyUshort(sc, 0x14, 0xb240);
20038         MP_WritePhyUshort(sc, 0x14, 0xb40e);
20039         MP_WritePhyUshort(sc, 0x14, 0x2647);
20040         MP_WritePhyUshort(sc, 0x14, 0xb410);
20041         MP_WritePhyUshort(sc, 0x14, 0x8802);
20042         MP_WritePhyUshort(sc, 0x14, 0xb240);
20043         MP_WritePhyUshort(sc, 0x14, 0x940e);
20044         MP_WritePhyUshort(sc, 0x14, 0x2647);
20045         MP_WritePhyUshort(sc, 0x14, 0xba04);
20046         MP_WritePhyUshort(sc, 0x14, 0x1cdd);
20047         MP_WritePhyUshort(sc, 0x14, 0xa902);
20048         MP_WritePhyUshort(sc, 0x14, 0xd711);
20049         MP_WritePhyUshort(sc, 0x14, 0x4045);
20050         MP_WritePhyUshort(sc, 0x14, 0xa980);
20051         MP_WritePhyUshort(sc, 0x14, 0x3003);
20052         MP_WritePhyUshort(sc, 0x14, 0x5a19);
20053         MP_WritePhyUshort(sc, 0x14, 0xa540);
20054         MP_WritePhyUshort(sc, 0x14, 0xa601);
20055         MP_WritePhyUshort(sc, 0x14, 0xd710);
20056         MP_WritePhyUshort(sc, 0x14, 0x4043);
20057         MP_WritePhyUshort(sc, 0x14, 0xa910);
20058         MP_WritePhyUshort(sc, 0x14, 0xd711);
20059         MP_WritePhyUshort(sc, 0x14, 0x60a0);
20060         MP_WritePhyUshort(sc, 0x14, 0xca33);
20061         MP_WritePhyUshort(sc, 0x14, 0xcb33);
20062         MP_WritePhyUshort(sc, 0x14, 0xa941);
20063         MP_WritePhyUshort(sc, 0x14, 0x2c7b);
20064         MP_WritePhyUshort(sc, 0x14, 0xcaff);
20065         MP_WritePhyUshort(sc, 0x14, 0xcbff);
20066         MP_WritePhyUshort(sc, 0x14, 0xa921);
20067         MP_WritePhyUshort(sc, 0x14, 0xce02);
20068         MP_WritePhyUshort(sc, 0x14, 0xe070);
20069         MP_WritePhyUshort(sc, 0x14, 0x0f10);
20070         MP_WritePhyUshort(sc, 0x14, 0xaf01);
20071         MP_WritePhyUshort(sc, 0x14, 0x8f01);
20072         MP_WritePhyUshort(sc, 0x14, 0x1791);
20073         MP_WritePhyUshort(sc, 0x14, 0x8e02);
20074         MP_WritePhyUshort(sc, 0x14, 0xd710);
20075         MP_WritePhyUshort(sc, 0x14, 0x41a3);
20076         MP_WritePhyUshort(sc, 0x14, 0xa140);
20077         MP_WritePhyUshort(sc, 0x14, 0xa220);
20078         MP_WritePhyUshort(sc, 0x14, 0xce10);
20079         MP_WritePhyUshort(sc, 0x14, 0xe070);
20080         MP_WritePhyUshort(sc, 0x14, 0x0f40);
20081         MP_WritePhyUshort(sc, 0x14, 0xaf01);
20082         MP_WritePhyUshort(sc, 0x14, 0x8f01);
20083         MP_WritePhyUshort(sc, 0x14, 0x1791);
20084         MP_WritePhyUshort(sc, 0x14, 0x8e10);
20085         MP_WritePhyUshort(sc, 0x14, 0x8140);
20086         MP_WritePhyUshort(sc, 0x14, 0x8220);
20087         MP_WritePhyUshort(sc, 0x14, 0xa301);
20088         MP_WritePhyUshort(sc, 0x14, 0x17b2);
20089         MP_WritePhyUshort(sc, 0x14, 0xd710);
20090         MP_WritePhyUshort(sc, 0x14, 0x609c);
20091         MP_WritePhyUshort(sc, 0x14, 0xd71e);
20092         MP_WritePhyUshort(sc, 0x14, 0x7fa4);
20093         MP_WritePhyUshort(sc, 0x14, 0x2cdb);
20094         MP_WritePhyUshort(sc, 0x14, 0x1cf0);
20095         MP_WritePhyUshort(sc, 0x14, 0xce04);
20096         MP_WritePhyUshort(sc, 0x14, 0xe070);
20097         MP_WritePhyUshort(sc, 0x14, 0x0f20);
20098         MP_WritePhyUshort(sc, 0x14, 0xaf01);
20099         MP_WritePhyUshort(sc, 0x14, 0x8f01);
20100         MP_WritePhyUshort(sc, 0x14, 0x1791);
20101         MP_WritePhyUshort(sc, 0x14, 0x8e04);
20102         MP_WritePhyUshort(sc, 0x14, 0x6044);
20103         MP_WritePhyUshort(sc, 0x14, 0x2cdb);
20104         MP_WritePhyUshort(sc, 0x14, 0xa520);
20105         MP_WritePhyUshort(sc, 0x14, 0xd710);
20106         MP_WritePhyUshort(sc, 0x14, 0x4043);
20107         MP_WritePhyUshort(sc, 0x14, 0x2cc8);
20108         MP_WritePhyUshort(sc, 0x14, 0xe00f);
20109         MP_WritePhyUshort(sc, 0x14, 0x0501);
20110         MP_WritePhyUshort(sc, 0x14, 0x1cf6);
20111         MP_WritePhyUshort(sc, 0x14, 0xb801);
20112         MP_WritePhyUshort(sc, 0x14, 0xd71e);
20113         MP_WritePhyUshort(sc, 0x14, 0x4060);
20114         MP_WritePhyUshort(sc, 0x14, 0x7fc4);
20115         MP_WritePhyUshort(sc, 0x14, 0x2cdb);
20116         MP_WritePhyUshort(sc, 0x14, 0x1cfc);
20117         MP_WritePhyUshort(sc, 0x14, 0xe00f);
20118         MP_WritePhyUshort(sc, 0x14, 0x0502);
20119         MP_WritePhyUshort(sc, 0x14, 0x1cf6);
20120         MP_WritePhyUshort(sc, 0x14, 0xb802);
20121         MP_WritePhyUshort(sc, 0x14, 0xd71e);
20122         MP_WritePhyUshort(sc, 0x14, 0x4061);
20123         MP_WritePhyUshort(sc, 0x14, 0x7fc4);
20124         MP_WritePhyUshort(sc, 0x14, 0x2cdb);
20125         MP_WritePhyUshort(sc, 0x14, 0x1cfc);
20126         MP_WritePhyUshort(sc, 0x14, 0xe00f);
20127         MP_WritePhyUshort(sc, 0x14, 0x0504);
20128         MP_WritePhyUshort(sc, 0x14, 0xd710);
20129         MP_WritePhyUshort(sc, 0x14, 0x6099);
20130         MP_WritePhyUshort(sc, 0x14, 0xd71e);
20131         MP_WritePhyUshort(sc, 0x14, 0x7fa4);
20132         MP_WritePhyUshort(sc, 0x14, 0x2cdb);
20133         MP_WritePhyUshort(sc, 0x14, 0xc17f);
20134         MP_WritePhyUshort(sc, 0x14, 0xc200);
20135         MP_WritePhyUshort(sc, 0x14, 0xc43f);
20136         MP_WritePhyUshort(sc, 0x14, 0xcc03);
20137         MP_WritePhyUshort(sc, 0x14, 0xa701);
20138         MP_WritePhyUshort(sc, 0x14, 0xa510);
20139         MP_WritePhyUshort(sc, 0x14, 0xd710);
20140         MP_WritePhyUshort(sc, 0x14, 0x4018);
20141         MP_WritePhyUshort(sc, 0x14, 0x9910);
20142         MP_WritePhyUshort(sc, 0x14, 0x8510);
20143         MP_WritePhyUshort(sc, 0x14, 0x28a1);
20144         MP_WritePhyUshort(sc, 0x14, 0xe00f);
20145         MP_WritePhyUshort(sc, 0x14, 0x0504);
20146         MP_WritePhyUshort(sc, 0x14, 0xd710);
20147         MP_WritePhyUshort(sc, 0x14, 0x6099);
20148         MP_WritePhyUshort(sc, 0x14, 0xd71e);
20149         MP_WritePhyUshort(sc, 0x14, 0x7fa4);
20150         MP_WritePhyUshort(sc, 0x14, 0x2cdb);
20151         MP_WritePhyUshort(sc, 0x14, 0xa608);
20152         MP_WritePhyUshort(sc, 0x14, 0xc17d);
20153         MP_WritePhyUshort(sc, 0x14, 0xc200);
20154         MP_WritePhyUshort(sc, 0x14, 0xc43f);
20155         MP_WritePhyUshort(sc, 0x14, 0xcc03);
20156         MP_WritePhyUshort(sc, 0x14, 0xa701);
20157         MP_WritePhyUshort(sc, 0x14, 0xa510);
20158         MP_WritePhyUshort(sc, 0x14, 0xd710);
20159         MP_WritePhyUshort(sc, 0x14, 0x4018);
20160         MP_WritePhyUshort(sc, 0x14, 0x9910);
20161         MP_WritePhyUshort(sc, 0x14, 0x8510);
20162         MP_WritePhyUshort(sc, 0x14, 0x298e);
20163         MP_WritePhyUshort(sc, 0x14, 0x17bd);
20164         MP_WritePhyUshort(sc, 0x14, 0x2815);
20165         MP_WritePhyUshort(sc, 0x14, 0xc000);
20166         MP_WritePhyUshort(sc, 0x14, 0xc100);
20167         MP_WritePhyUshort(sc, 0x14, 0xc200);
20168         MP_WritePhyUshort(sc, 0x14, 0xc300);
20169         MP_WritePhyUshort(sc, 0x14, 0xc400);
20170         MP_WritePhyUshort(sc, 0x14, 0xc500);
20171         MP_WritePhyUshort(sc, 0x14, 0xc600);
20172         MP_WritePhyUshort(sc, 0x14, 0xc7c1);
20173         MP_WritePhyUshort(sc, 0x14, 0xc800);
20174         MP_WritePhyUshort(sc, 0x14, 0xcc00);
20175         MP_WritePhyUshort(sc, 0x14, 0x0800);
20176         MP_WritePhyUshort(sc, 0x14, 0xca0f);
20177         MP_WritePhyUshort(sc, 0x14, 0xcbff);
20178         MP_WritePhyUshort(sc, 0x14, 0xa901);
20179         MP_WritePhyUshort(sc, 0x14, 0x8902);
20180         MP_WritePhyUshort(sc, 0x14, 0xc900);
20181         MP_WritePhyUshort(sc, 0x14, 0xca00);
20182         MP_WritePhyUshort(sc, 0x14, 0xcb00);
20183         MP_WritePhyUshort(sc, 0x14, 0x0800);
20184         MP_WritePhyUshort(sc, 0x14, 0xb804);
20185         MP_WritePhyUshort(sc, 0x14, 0x0800);
20186         MP_WritePhyUshort(sc, 0x14, 0xd71e);
20187         MP_WritePhyUshort(sc, 0x14, 0x6044);
20188         MP_WritePhyUshort(sc, 0x14, 0x9804);
20189         MP_WritePhyUshort(sc, 0x14, 0x0800);
20190         MP_WritePhyUshort(sc, 0x14, 0xd710);
20191         MP_WritePhyUshort(sc, 0x14, 0x6099);
20192         MP_WritePhyUshort(sc, 0x14, 0xd71e);
20193         MP_WritePhyUshort(sc, 0x14, 0x7fa4);
20194         MP_WritePhyUshort(sc, 0x14, 0x2cdb);
20195         MP_WritePhyUshort(sc, 0x14, 0x0800);
20196         MP_WritePhyUshort(sc, 0x14, 0xa510);
20197         MP_WritePhyUshort(sc, 0x14, 0xd710);
20198         MP_WritePhyUshort(sc, 0x14, 0x6098);
20199         MP_WritePhyUshort(sc, 0x14, 0xd71e);
20200         MP_WritePhyUshort(sc, 0x14, 0x7fa4);
20201         MP_WritePhyUshort(sc, 0x14, 0x2cdb);
20202         MP_WritePhyUshort(sc, 0x14, 0x8510);
20203         MP_WritePhyUshort(sc, 0x14, 0x0800);
20204         MP_WritePhyUshort(sc, 0x14, 0xd711);
20205         MP_WritePhyUshort(sc, 0x14, 0x3003);
20206         MP_WritePhyUshort(sc, 0x14, 0x1d08);
20207         MP_WritePhyUshort(sc, 0x14, 0x2d12);
20208         MP_WritePhyUshort(sc, 0x14, 0xd710);
20209         MP_WritePhyUshort(sc, 0x14, 0x60be);
20210         MP_WritePhyUshort(sc, 0x14, 0xe060);
20211         MP_WritePhyUshort(sc, 0x14, 0x0920);
20212         MP_WritePhyUshort(sc, 0x14, 0x1cdd);
20213         MP_WritePhyUshort(sc, 0x14, 0x2c90);
20214         MP_WritePhyUshort(sc, 0x14, 0xd71e);
20215         MP_WritePhyUshort(sc, 0x14, 0x3063);
20216         MP_WritePhyUshort(sc, 0x14, 0x19b0);
20217         MP_WritePhyUshort(sc, 0x14, 0x28d5);
20218         MP_WritePhyUshort(sc, 0x14, 0x1cdd);
20219         MP_WritePhyUshort(sc, 0x14, 0x2a25);
20220         MP_WritePhyUshort(sc, 0x14, 0xa802);
20221         MP_WritePhyUshort(sc, 0x14, 0xa303);
20222         MP_WritePhyUshort(sc, 0x14, 0x843f);
20223         MP_WritePhyUshort(sc, 0x14, 0x81ff);
20224         MP_WritePhyUshort(sc, 0x14, 0x8208);
20225         MP_WritePhyUshort(sc, 0x14, 0xa201);
20226         MP_WritePhyUshort(sc, 0x14, 0xc001);
20227         MP_WritePhyUshort(sc, 0x14, 0xd710);
20228         MP_WritePhyUshort(sc, 0x14, 0x30a0);
20229         MP_WritePhyUshort(sc, 0x14, 0x0d23);
20230         MP_WritePhyUshort(sc, 0x14, 0x30a0);
20231         MP_WritePhyUshort(sc, 0x14, 0x3d1a);
20232         MP_WritePhyUshort(sc, 0x14, 0xd71e);
20233         MP_WritePhyUshort(sc, 0x14, 0x7f4c);
20234         MP_WritePhyUshort(sc, 0x14, 0x2b1e);
20235         MP_WritePhyUshort(sc, 0x14, 0xe003);
20236         MP_WritePhyUshort(sc, 0x14, 0x0202);
20237         MP_WritePhyUshort(sc, 0x14, 0xd710);
20238         MP_WritePhyUshort(sc, 0x14, 0x6090);
20239         MP_WritePhyUshort(sc, 0x14, 0xd71e);
20240         MP_WritePhyUshort(sc, 0x14, 0x7fac);
20241         MP_WritePhyUshort(sc, 0x14, 0x2b1e);
20242         MP_WritePhyUshort(sc, 0x14, 0xa20c);
20243         MP_WritePhyUshort(sc, 0x14, 0xd710);
20244         MP_WritePhyUshort(sc, 0x14, 0x6091);
20245         MP_WritePhyUshort(sc, 0x14, 0xd71e);
20246         MP_WritePhyUshort(sc, 0x14, 0x7fac);
20247         MP_WritePhyUshort(sc, 0x14, 0x2b1e);
20248         MP_WritePhyUshort(sc, 0x14, 0x820e);
20249         MP_WritePhyUshort(sc, 0x14, 0xa3e0);
20250         MP_WritePhyUshort(sc, 0x14, 0xa520);
20251         MP_WritePhyUshort(sc, 0x14, 0xd710);
20252         MP_WritePhyUshort(sc, 0x14, 0x609d);
20253         MP_WritePhyUshort(sc, 0x14, 0xd71e);
20254         MP_WritePhyUshort(sc, 0x14, 0x7fac);
20255         MP_WritePhyUshort(sc, 0x14, 0x2b1e);
20256         MP_WritePhyUshort(sc, 0x14, 0x8520);
20257         MP_WritePhyUshort(sc, 0x14, 0x6703);
20258         MP_WritePhyUshort(sc, 0x14, 0x2d3b);
20259         MP_WritePhyUshort(sc, 0x14, 0xa13e);
20260         MP_WritePhyUshort(sc, 0x14, 0xc001);
20261         MP_WritePhyUshort(sc, 0x14, 0xd710);
20262         MP_WritePhyUshort(sc, 0x14, 0x4000);
20263         MP_WritePhyUshort(sc, 0x14, 0x6046);
20264         MP_WritePhyUshort(sc, 0x14, 0x2d14);
20265         MP_WritePhyUshort(sc, 0x14, 0xa43f);
20266         MP_WritePhyUshort(sc, 0x14, 0xa101);
20267         MP_WritePhyUshort(sc, 0x14, 0xc020);
20268         MP_WritePhyUshort(sc, 0x14, 0xd710);
20269         MP_WritePhyUshort(sc, 0x14, 0x3121);
20270         MP_WritePhyUshort(sc, 0x14, 0x0d4c);
20271         MP_WritePhyUshort(sc, 0x14, 0x30c0);
20272         MP_WritePhyUshort(sc, 0x14, 0x3d14);
20273         MP_WritePhyUshort(sc, 0x14, 0xd71e);
20274         MP_WritePhyUshort(sc, 0x14, 0x7f4c);
20275         MP_WritePhyUshort(sc, 0x14, 0x2b1e);
20276         MP_WritePhyUshort(sc, 0x14, 0xa540);
20277         MP_WritePhyUshort(sc, 0x14, 0xc001);
20278         MP_WritePhyUshort(sc, 0x14, 0xd710);
20279         MP_WritePhyUshort(sc, 0x14, 0x4001);
20280         MP_WritePhyUshort(sc, 0x14, 0xe00f);
20281         MP_WritePhyUshort(sc, 0x14, 0x0501);
20282         MP_WritePhyUshort(sc, 0x14, 0x1db3);
20283         MP_WritePhyUshort(sc, 0x14, 0xc1c4);
20284         MP_WritePhyUshort(sc, 0x14, 0xa268);
20285         MP_WritePhyUshort(sc, 0x14, 0xa303);
20286         MP_WritePhyUshort(sc, 0x14, 0x8420);
20287         MP_WritePhyUshort(sc, 0x14, 0xe00f);
20288         MP_WritePhyUshort(sc, 0x14, 0x0502);
20289         MP_WritePhyUshort(sc, 0x14, 0x1db3);
20290         MP_WritePhyUshort(sc, 0x14, 0xc002);
20291         MP_WritePhyUshort(sc, 0x14, 0xd710);
20292         MP_WritePhyUshort(sc, 0x14, 0x4000);
20293         MP_WritePhyUshort(sc, 0x14, 0x8208);
20294         MP_WritePhyUshort(sc, 0x14, 0x8410);
20295         MP_WritePhyUshort(sc, 0x14, 0xa121);
20296         MP_WritePhyUshort(sc, 0x14, 0xc002);
20297         MP_WritePhyUshort(sc, 0x14, 0xd710);
20298         MP_WritePhyUshort(sc, 0x14, 0x4000);
20299         MP_WritePhyUshort(sc, 0x14, 0x8120);
20300         MP_WritePhyUshort(sc, 0x14, 0x8180);
20301         MP_WritePhyUshort(sc, 0x14, 0x1d9e);
20302         MP_WritePhyUshort(sc, 0x14, 0xa180);
20303         MP_WritePhyUshort(sc, 0x14, 0xa13a);
20304         MP_WritePhyUshort(sc, 0x14, 0x8240);
20305         MP_WritePhyUshort(sc, 0x14, 0xa430);
20306         MP_WritePhyUshort(sc, 0x14, 0xc010);
20307         MP_WritePhyUshort(sc, 0x14, 0xd710);
20308         MP_WritePhyUshort(sc, 0x14, 0x30e1);
20309         MP_WritePhyUshort(sc, 0x14, 0x0b24);
20310         MP_WritePhyUshort(sc, 0x14, 0xd71e);
20311         MP_WritePhyUshort(sc, 0x14, 0x7f8c);
20312         MP_WritePhyUshort(sc, 0x14, 0x2b1e);
20313         MP_WritePhyUshort(sc, 0x14, 0xa480);
20314         MP_WritePhyUshort(sc, 0x14, 0xa230);
20315         MP_WritePhyUshort(sc, 0x14, 0xa303);
20316         MP_WritePhyUshort(sc, 0x14, 0xc001);
20317         MP_WritePhyUshort(sc, 0x14, 0xd70c);
20318         MP_WritePhyUshort(sc, 0x14, 0x4124);
20319         MP_WritePhyUshort(sc, 0x14, 0xd710);
20320         MP_WritePhyUshort(sc, 0x14, 0x6120);
20321         MP_WritePhyUshort(sc, 0x14, 0xd711);
20322         MP_WritePhyUshort(sc, 0x14, 0x3128);
20323         MP_WritePhyUshort(sc, 0x14, 0x3d7d);
20324         MP_WritePhyUshort(sc, 0x14, 0x2d77);
20325         MP_WritePhyUshort(sc, 0x14, 0xa801);
20326         MP_WritePhyUshort(sc, 0x14, 0x2d73);
20327         MP_WritePhyUshort(sc, 0x14, 0xd710);
20328         MP_WritePhyUshort(sc, 0x14, 0x4000);
20329         MP_WritePhyUshort(sc, 0x14, 0xe018);
20330         MP_WritePhyUshort(sc, 0x14, 0x0208);
20331         MP_WritePhyUshort(sc, 0x14, 0xa1f8);
20332         MP_WritePhyUshort(sc, 0x14, 0x8480);
20333         MP_WritePhyUshort(sc, 0x14, 0xc004);
20334         MP_WritePhyUshort(sc, 0x14, 0xd710);
20335         MP_WritePhyUshort(sc, 0x14, 0x4000);
20336         MP_WritePhyUshort(sc, 0x14, 0x6046);
20337         MP_WritePhyUshort(sc, 0x14, 0x2d14);
20338         MP_WritePhyUshort(sc, 0x14, 0xa43f);
20339         MP_WritePhyUshort(sc, 0x14, 0xa105);
20340         MP_WritePhyUshort(sc, 0x14, 0x8228);
20341         MP_WritePhyUshort(sc, 0x14, 0xc004);
20342         MP_WritePhyUshort(sc, 0x14, 0xd710);
20343         MP_WritePhyUshort(sc, 0x14, 0x4000);
20344         MP_WritePhyUshort(sc, 0x14, 0x81bc);
20345         MP_WritePhyUshort(sc, 0x14, 0xa220);
20346         MP_WritePhyUshort(sc, 0x14, 0x1d9e);
20347         MP_WritePhyUshort(sc, 0x14, 0x8220);
20348         MP_WritePhyUshort(sc, 0x14, 0xa1bc);
20349         MP_WritePhyUshort(sc, 0x14, 0xc040);
20350         MP_WritePhyUshort(sc, 0x14, 0xd710);
20351         MP_WritePhyUshort(sc, 0x14, 0x30e1);
20352         MP_WritePhyUshort(sc, 0x14, 0x0b24);
20353         MP_WritePhyUshort(sc, 0x14, 0x30e1);
20354         MP_WritePhyUshort(sc, 0x14, 0x3d14);
20355         MP_WritePhyUshort(sc, 0x14, 0xd71e);
20356         MP_WritePhyUshort(sc, 0x14, 0x7f4c);
20357         MP_WritePhyUshort(sc, 0x14, 0x2b1e);
20358         MP_WritePhyUshort(sc, 0x14, 0xa802);
20359         MP_WritePhyUshort(sc, 0x14, 0xd70c);
20360         MP_WritePhyUshort(sc, 0x14, 0x4244);
20361         MP_WritePhyUshort(sc, 0x14, 0xa301);
20362         MP_WritePhyUshort(sc, 0x14, 0xc004);
20363         MP_WritePhyUshort(sc, 0x14, 0xd711);
20364         MP_WritePhyUshort(sc, 0x14, 0x3128);
20365         MP_WritePhyUshort(sc, 0x14, 0x3dac);
20366         MP_WritePhyUshort(sc, 0x14, 0xd710);
20367         MP_WritePhyUshort(sc, 0x14, 0x5f80);
20368         MP_WritePhyUshort(sc, 0x14, 0xd711);
20369         MP_WritePhyUshort(sc, 0x14, 0x3109);
20370         MP_WritePhyUshort(sc, 0x14, 0x3dae);
20371         MP_WritePhyUshort(sc, 0x14, 0x2db2);
20372         MP_WritePhyUshort(sc, 0x14, 0xa801);
20373         MP_WritePhyUshort(sc, 0x14, 0x2da1);
20374         MP_WritePhyUshort(sc, 0x14, 0xa802);
20375         MP_WritePhyUshort(sc, 0x14, 0xc004);
20376         MP_WritePhyUshort(sc, 0x14, 0xd710);
20377         MP_WritePhyUshort(sc, 0x14, 0x4000);
20378         MP_WritePhyUshort(sc, 0x14, 0x0800);
20379         MP_WritePhyUshort(sc, 0x14, 0xa510);
20380         MP_WritePhyUshort(sc, 0x14, 0xd710);
20381         MP_WritePhyUshort(sc, 0x14, 0x609a);
20382         MP_WritePhyUshort(sc, 0x14, 0xd71e);
20383         MP_WritePhyUshort(sc, 0x14, 0x7fac);
20384         MP_WritePhyUshort(sc, 0x14, 0x2b1e);
20385         MP_WritePhyUshort(sc, 0x14, 0x8510);
20386         MP_WritePhyUshort(sc, 0x14, 0x0800);
20387         MP_WritePhyUshort(sc, 0x13, 0xa01a);
20388         MP_WritePhyUshort(sc, 0x14, 0x0000);
20389         MP_WritePhyUshort(sc, 0x13, 0xa006);
20390         MP_WritePhyUshort(sc, 0x14, 0x0b3e);
20391         MP_WritePhyUshort(sc, 0x13, 0xa004);
20392         MP_WritePhyUshort(sc, 0x14, 0x0828);
20393         MP_WritePhyUshort(sc, 0x13, 0xa002);
20394         MP_WritePhyUshort(sc, 0x14, 0x06dd);
20395         MP_WritePhyUshort(sc, 0x13, 0xa000);
20396         MP_WritePhyUshort(sc, 0x14, 0xf815);
20397         MP_WritePhyUshort(sc, 0x13, 0xb820);
20398         MP_WritePhyUshort(sc, 0x14, 0x0010);
20399
20400         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
20401         MP_WritePhyUshort(sc, 0x13, 0x83b0);
20402         MP_WritePhyUshort(sc, 0x14, 0xaf83);
20403         MP_WritePhyUshort(sc, 0x14, 0xbcaf);
20404         MP_WritePhyUshort(sc, 0x14, 0x83c8);
20405         MP_WritePhyUshort(sc, 0x14, 0xaf83);
20406         MP_WritePhyUshort(sc, 0x14, 0xddaf);
20407         MP_WritePhyUshort(sc, 0x14, 0x83e0);
20408         MP_WritePhyUshort(sc, 0x14, 0x0204);
20409         MP_WritePhyUshort(sc, 0x14, 0xa102);
20410         MP_WritePhyUshort(sc, 0x14, 0x09b4);
20411         MP_WritePhyUshort(sc, 0x14, 0x0284);
20412         MP_WritePhyUshort(sc, 0x14, 0x62af);
20413         MP_WritePhyUshort(sc, 0x14, 0x02ec);
20414         MP_WritePhyUshort(sc, 0x14, 0xad20);
20415         MP_WritePhyUshort(sc, 0x14, 0x0302);
20416         MP_WritePhyUshort(sc, 0x14, 0x867d);
20417         MP_WritePhyUshort(sc, 0x14, 0xad21);
20418         MP_WritePhyUshort(sc, 0x14, 0x0302);
20419         MP_WritePhyUshort(sc, 0x14, 0x85ca);
20420         MP_WritePhyUshort(sc, 0x14, 0xad22);
20421         MP_WritePhyUshort(sc, 0x14, 0x0302);
20422         MP_WritePhyUshort(sc, 0x14, 0x1bce);
20423         MP_WritePhyUshort(sc, 0x14, 0xaf18);
20424         MP_WritePhyUshort(sc, 0x14, 0x11af);
20425         MP_WritePhyUshort(sc, 0x14, 0x1811);
20426         MP_WritePhyUshort(sc, 0x14, 0x0106);
20427         MP_WritePhyUshort(sc, 0x14, 0xe081);
20428         MP_WritePhyUshort(sc, 0x14, 0x48af);
20429         MP_WritePhyUshort(sc, 0x14, 0x3b1f);
20430         MP_WritePhyUshort(sc, 0x14, 0xf8f9);
20431         MP_WritePhyUshort(sc, 0x14, 0xfaef);
20432         MP_WritePhyUshort(sc, 0x14, 0x69ee);
20433         MP_WritePhyUshort(sc, 0x14, 0x8010);
20434         MP_WritePhyUshort(sc, 0x14, 0xf7d1);
20435         MP_WritePhyUshort(sc, 0x14, 0x04bf);
20436         MP_WritePhyUshort(sc, 0x14, 0x8776);
20437         MP_WritePhyUshort(sc, 0x14, 0x0241);
20438         MP_WritePhyUshort(sc, 0x14, 0x0a02);
20439         MP_WritePhyUshort(sc, 0x14, 0x8704);
20440         MP_WritePhyUshort(sc, 0x14, 0xbf87);
20441         MP_WritePhyUshort(sc, 0x14, 0x4fd7);
20442         MP_WritePhyUshort(sc, 0x14, 0xb822);
20443         MP_WritePhyUshort(sc, 0x14, 0xd00c);
20444         MP_WritePhyUshort(sc, 0x14, 0x0241);
20445         MP_WritePhyUshort(sc, 0x14, 0x03ee);
20446         MP_WritePhyUshort(sc, 0x14, 0x80cd);
20447         MP_WritePhyUshort(sc, 0x14, 0xa0ee);
20448         MP_WritePhyUshort(sc, 0x14, 0x80ce);
20449         MP_WritePhyUshort(sc, 0x14, 0x8bee);
20450         MP_WritePhyUshort(sc, 0x14, 0x80d1);
20451         MP_WritePhyUshort(sc, 0x14, 0xf5ee);
20452         MP_WritePhyUshort(sc, 0x14, 0x80d2);
20453         MP_WritePhyUshort(sc, 0x14, 0xa9ee);
20454         MP_WritePhyUshort(sc, 0x14, 0x80d3);
20455         MP_WritePhyUshort(sc, 0x14, 0x0aee);
20456         MP_WritePhyUshort(sc, 0x14, 0x80f0);
20457         MP_WritePhyUshort(sc, 0x14, 0x10ee);
20458         MP_WritePhyUshort(sc, 0x14, 0x80f3);
20459         MP_WritePhyUshort(sc, 0x14, 0x8fee);
20460         MP_WritePhyUshort(sc, 0x14, 0x8101);
20461         MP_WritePhyUshort(sc, 0x14, 0x1eee);
20462         MP_WritePhyUshort(sc, 0x14, 0x810b);
20463         MP_WritePhyUshort(sc, 0x14, 0x4aee);
20464         MP_WritePhyUshort(sc, 0x14, 0x810c);
20465         MP_WritePhyUshort(sc, 0x14, 0x7cee);
20466         MP_WritePhyUshort(sc, 0x14, 0x8112);
20467         MP_WritePhyUshort(sc, 0x14, 0x7fd1);
20468         MP_WritePhyUshort(sc, 0x14, 0x0002);
20469         MP_WritePhyUshort(sc, 0x14, 0x10e3);
20470         MP_WritePhyUshort(sc, 0x14, 0xee80);
20471         MP_WritePhyUshort(sc, 0x14, 0x8892);
20472         MP_WritePhyUshort(sc, 0x14, 0xee80);
20473         MP_WritePhyUshort(sc, 0x14, 0x8922);
20474         MP_WritePhyUshort(sc, 0x14, 0xee80);
20475         MP_WritePhyUshort(sc, 0x14, 0x9a80);
20476         MP_WritePhyUshort(sc, 0x14, 0xee80);
20477         MP_WritePhyUshort(sc, 0x14, 0x9b22);
20478         MP_WritePhyUshort(sc, 0x14, 0xee80);
20479         MP_WritePhyUshort(sc, 0x14, 0x9ca7);
20480         MP_WritePhyUshort(sc, 0x14, 0xee80);
20481         MP_WritePhyUshort(sc, 0x14, 0xa010);
20482         MP_WritePhyUshort(sc, 0x14, 0xee80);
20483         MP_WritePhyUshort(sc, 0x14, 0xa5a7);
20484         MP_WritePhyUshort(sc, 0x14, 0xd200);
20485         MP_WritePhyUshort(sc, 0x14, 0x020e);
20486         MP_WritePhyUshort(sc, 0x14, 0x4b02);
20487         MP_WritePhyUshort(sc, 0x14, 0x85c1);
20488         MP_WritePhyUshort(sc, 0x14, 0xef96);
20489         MP_WritePhyUshort(sc, 0x14, 0xfefd);
20490         MP_WritePhyUshort(sc, 0x14, 0xfc04);
20491         MP_WritePhyUshort(sc, 0x14, 0x0284);
20492         MP_WritePhyUshort(sc, 0x14, 0x7b02);
20493         MP_WritePhyUshort(sc, 0x14, 0x84b4);
20494         MP_WritePhyUshort(sc, 0x14, 0x020c);
20495         MP_WritePhyUshort(sc, 0x14, 0x9202);
20496         MP_WritePhyUshort(sc, 0x14, 0x0cab);
20497         MP_WritePhyUshort(sc, 0x14, 0x020c);
20498         MP_WritePhyUshort(sc, 0x14, 0xd602);
20499         MP_WritePhyUshort(sc, 0x14, 0x0cef);
20500         MP_WritePhyUshort(sc, 0x14, 0x020d);
20501         MP_WritePhyUshort(sc, 0x14, 0x1a02);
20502         MP_WritePhyUshort(sc, 0x14, 0x0c24);
20503         MP_WritePhyUshort(sc, 0x14, 0x04f8);
20504         MP_WritePhyUshort(sc, 0x14, 0xfaef);
20505         MP_WritePhyUshort(sc, 0x14, 0x69e1);
20506         MP_WritePhyUshort(sc, 0x14, 0x8234);
20507         MP_WritePhyUshort(sc, 0x14, 0xac29);
20508         MP_WritePhyUshort(sc, 0x14, 0x1ae0);
20509         MP_WritePhyUshort(sc, 0x14, 0x8229);
20510         MP_WritePhyUshort(sc, 0x14, 0xac21);
20511         MP_WritePhyUshort(sc, 0x14, 0x02ae);
20512         MP_WritePhyUshort(sc, 0x14, 0x2202);
20513         MP_WritePhyUshort(sc, 0x14, 0x1085);
20514         MP_WritePhyUshort(sc, 0x14, 0xf621);
20515         MP_WritePhyUshort(sc, 0x14, 0xe482);
20516         MP_WritePhyUshort(sc, 0x14, 0x29d1);
20517         MP_WritePhyUshort(sc, 0x14, 0x01bf);
20518         MP_WritePhyUshort(sc, 0x14, 0x4364);
20519         MP_WritePhyUshort(sc, 0x14, 0x0241);
20520         MP_WritePhyUshort(sc, 0x14, 0x0aae);
20521         MP_WritePhyUshort(sc, 0x14, 0x1002);
20522         MP_WritePhyUshort(sc, 0x14, 0x127a);
20523         MP_WritePhyUshort(sc, 0x14, 0xf629);
20524         MP_WritePhyUshort(sc, 0x14, 0xe582);
20525         MP_WritePhyUshort(sc, 0x14, 0x34e0);
20526         MP_WritePhyUshort(sc, 0x14, 0x8229);
20527         MP_WritePhyUshort(sc, 0x14, 0xf621);
20528         MP_WritePhyUshort(sc, 0x14, 0xe482);
20529         MP_WritePhyUshort(sc, 0x14, 0x29ef);
20530         MP_WritePhyUshort(sc, 0x14, 0x96fe);
20531         MP_WritePhyUshort(sc, 0x14, 0xfc04);
20532         MP_WritePhyUshort(sc, 0x14, 0xf8e1);
20533         MP_WritePhyUshort(sc, 0x14, 0x8234);
20534         MP_WritePhyUshort(sc, 0x14, 0xac2a);
20535         MP_WritePhyUshort(sc, 0x14, 0x18e0);
20536         MP_WritePhyUshort(sc, 0x14, 0x8229);
20537         MP_WritePhyUshort(sc, 0x14, 0xac22);
20538         MP_WritePhyUshort(sc, 0x14, 0x02ae);
20539         MP_WritePhyUshort(sc, 0x14, 0x2602);
20540         MP_WritePhyUshort(sc, 0x14, 0x84f9);
20541         MP_WritePhyUshort(sc, 0x14, 0x0285);
20542         MP_WritePhyUshort(sc, 0x14, 0x66d1);
20543         MP_WritePhyUshort(sc, 0x14, 0x01bf);
20544         MP_WritePhyUshort(sc, 0x14, 0x4367);
20545         MP_WritePhyUshort(sc, 0x14, 0x0241);
20546         MP_WritePhyUshort(sc, 0x14, 0x0aae);
20547         MP_WritePhyUshort(sc, 0x14, 0x0e02);
20548         MP_WritePhyUshort(sc, 0x14, 0x84eb);
20549         MP_WritePhyUshort(sc, 0x14, 0x0285);
20550         MP_WritePhyUshort(sc, 0x14, 0xaae1);
20551         MP_WritePhyUshort(sc, 0x14, 0x8234);
20552         MP_WritePhyUshort(sc, 0x14, 0xf62a);
20553         MP_WritePhyUshort(sc, 0x14, 0xe582);
20554         MP_WritePhyUshort(sc, 0x14, 0x34e0);
20555         MP_WritePhyUshort(sc, 0x14, 0x8229);
20556         MP_WritePhyUshort(sc, 0x14, 0xf622);
20557         MP_WritePhyUshort(sc, 0x14, 0xe482);
20558         MP_WritePhyUshort(sc, 0x14, 0x29fc);
20559         MP_WritePhyUshort(sc, 0x14, 0x04f9);
20560         MP_WritePhyUshort(sc, 0x14, 0xe280);
20561         MP_WritePhyUshort(sc, 0x14, 0x11ad);
20562         MP_WritePhyUshort(sc, 0x14, 0x3105);
20563         MP_WritePhyUshort(sc, 0x14, 0xd200);
20564         MP_WritePhyUshort(sc, 0x14, 0x020e);
20565         MP_WritePhyUshort(sc, 0x14, 0x4bfd);
20566         MP_WritePhyUshort(sc, 0x14, 0x04f8);
20567         MP_WritePhyUshort(sc, 0x14, 0xf9fa);
20568         MP_WritePhyUshort(sc, 0x14, 0xef69);
20569         MP_WritePhyUshort(sc, 0x14, 0xe080);
20570         MP_WritePhyUshort(sc, 0x14, 0x11ad);
20571         MP_WritePhyUshort(sc, 0x14, 0x215c);
20572         MP_WritePhyUshort(sc, 0x14, 0xbf42);
20573         MP_WritePhyUshort(sc, 0x14, 0x5002);
20574         MP_WritePhyUshort(sc, 0x14, 0x4148);
20575         MP_WritePhyUshort(sc, 0x14, 0xac28);
20576         MP_WritePhyUshort(sc, 0x14, 0x1bbf);
20577         MP_WritePhyUshort(sc, 0x14, 0x4253);
20578         MP_WritePhyUshort(sc, 0x14, 0x0241);
20579         MP_WritePhyUshort(sc, 0x14, 0x48ac);
20580         MP_WritePhyUshort(sc, 0x14, 0x2812);
20581         MP_WritePhyUshort(sc, 0x14, 0xbf42);
20582         MP_WritePhyUshort(sc, 0x14, 0x5902);
20583         MP_WritePhyUshort(sc, 0x14, 0x4148);
20584         MP_WritePhyUshort(sc, 0x14, 0xac28);
20585         MP_WritePhyUshort(sc, 0x14, 0x04d3);
20586         MP_WritePhyUshort(sc, 0x14, 0x00ae);
20587         MP_WritePhyUshort(sc, 0x14, 0x07d3);
20588         MP_WritePhyUshort(sc, 0x14, 0x06af);
20589         MP_WritePhyUshort(sc, 0x14, 0x8557);
20590         MP_WritePhyUshort(sc, 0x14, 0xd303);
20591         MP_WritePhyUshort(sc, 0x14, 0xe080);
20592         MP_WritePhyUshort(sc, 0x14, 0x11ad);
20593         MP_WritePhyUshort(sc, 0x14, 0x2625);
20594         MP_WritePhyUshort(sc, 0x14, 0xbf43);
20595         MP_WritePhyUshort(sc, 0x14, 0xeb02);
20596         MP_WritePhyUshort(sc, 0x14, 0x4148);
20597         MP_WritePhyUshort(sc, 0x14, 0xe280);
20598         MP_WritePhyUshort(sc, 0x14, 0x730d);
20599         MP_WritePhyUshort(sc, 0x14, 0x21f6);
20600         MP_WritePhyUshort(sc, 0x14, 0x370d);
20601         MP_WritePhyUshort(sc, 0x14, 0x11f6);
20602         MP_WritePhyUshort(sc, 0x14, 0x2f1b);
20603         MP_WritePhyUshort(sc, 0x14, 0x21aa);
20604         MP_WritePhyUshort(sc, 0x14, 0x02ae);
20605         MP_WritePhyUshort(sc, 0x14, 0x10e2);
20606         MP_WritePhyUshort(sc, 0x14, 0x8074);
20607         MP_WritePhyUshort(sc, 0x14, 0x0d21);
20608         MP_WritePhyUshort(sc, 0x14, 0xf637);
20609         MP_WritePhyUshort(sc, 0x14, 0x1b21);
20610         MP_WritePhyUshort(sc, 0x14, 0xaa03);
20611         MP_WritePhyUshort(sc, 0x14, 0x13ae);
20612         MP_WritePhyUshort(sc, 0x14, 0x022b);
20613         MP_WritePhyUshort(sc, 0x14, 0x0202);
20614         MP_WritePhyUshort(sc, 0x14, 0x0e36);
20615         MP_WritePhyUshort(sc, 0x14, 0x020e);
20616         MP_WritePhyUshort(sc, 0x14, 0x4b02);
20617         MP_WritePhyUshort(sc, 0x14, 0x0f91);
20618         MP_WritePhyUshort(sc, 0x14, 0xef96);
20619         MP_WritePhyUshort(sc, 0x14, 0xfefd);
20620         MP_WritePhyUshort(sc, 0x14, 0xfc04);
20621         MP_WritePhyUshort(sc, 0x14, 0xf8f9);
20622         MP_WritePhyUshort(sc, 0x14, 0xfaef);
20623         MP_WritePhyUshort(sc, 0x14, 0x69e0);
20624         MP_WritePhyUshort(sc, 0x14, 0x8012);
20625         MP_WritePhyUshort(sc, 0x14, 0xad27);
20626         MP_WritePhyUshort(sc, 0x14, 0x33bf);
20627         MP_WritePhyUshort(sc, 0x14, 0x4250);
20628         MP_WritePhyUshort(sc, 0x14, 0x0241);
20629         MP_WritePhyUshort(sc, 0x14, 0x48ac);
20630         MP_WritePhyUshort(sc, 0x14, 0x2809);
20631         MP_WritePhyUshort(sc, 0x14, 0xbf42);
20632         MP_WritePhyUshort(sc, 0x14, 0x5302);
20633         MP_WritePhyUshort(sc, 0x14, 0x4148);
20634         MP_WritePhyUshort(sc, 0x14, 0xad28);
20635         MP_WritePhyUshort(sc, 0x14, 0x21bf);
20636         MP_WritePhyUshort(sc, 0x14, 0x43eb);
20637         MP_WritePhyUshort(sc, 0x14, 0x0241);
20638         MP_WritePhyUshort(sc, 0x14, 0x48e3);
20639         MP_WritePhyUshort(sc, 0x14, 0x87ff);
20640         MP_WritePhyUshort(sc, 0x14, 0xd200);
20641         MP_WritePhyUshort(sc, 0x14, 0x1b45);
20642         MP_WritePhyUshort(sc, 0x14, 0xac27);
20643         MP_WritePhyUshort(sc, 0x14, 0x11e1);
20644         MP_WritePhyUshort(sc, 0x14, 0x87fe);
20645         MP_WritePhyUshort(sc, 0x14, 0xbf87);
20646         MP_WritePhyUshort(sc, 0x14, 0x6702);
20647         MP_WritePhyUshort(sc, 0x14, 0x410a);
20648         MP_WritePhyUshort(sc, 0x14, 0x0d11);
20649         MP_WritePhyUshort(sc, 0x14, 0xbf87);
20650         MP_WritePhyUshort(sc, 0x14, 0x6a02);
20651         MP_WritePhyUshort(sc, 0x14, 0x410a);
20652         MP_WritePhyUshort(sc, 0x14, 0xef96);
20653         MP_WritePhyUshort(sc, 0x14, 0xfefd);
20654         MP_WritePhyUshort(sc, 0x14, 0xfc04);
20655         MP_WritePhyUshort(sc, 0x14, 0xf8fa);
20656         MP_WritePhyUshort(sc, 0x14, 0xef69);
20657         MP_WritePhyUshort(sc, 0x14, 0xd100);
20658         MP_WritePhyUshort(sc, 0x14, 0xbf87);
20659         MP_WritePhyUshort(sc, 0x14, 0x6702);
20660         MP_WritePhyUshort(sc, 0x14, 0x410a);
20661         MP_WritePhyUshort(sc, 0x14, 0xbf87);
20662         MP_WritePhyUshort(sc, 0x14, 0x6a02);
20663         MP_WritePhyUshort(sc, 0x14, 0x410a);
20664         MP_WritePhyUshort(sc, 0x14, 0xef96);
20665         MP_WritePhyUshort(sc, 0x14, 0xfefc);
20666         MP_WritePhyUshort(sc, 0x14, 0x04ee);
20667         MP_WritePhyUshort(sc, 0x14, 0x87ff);
20668         MP_WritePhyUshort(sc, 0x14, 0x46ee);
20669         MP_WritePhyUshort(sc, 0x14, 0x87fe);
20670         MP_WritePhyUshort(sc, 0x14, 0x0104);
20671         MP_WritePhyUshort(sc, 0x14, 0xf8fa);
20672         MP_WritePhyUshort(sc, 0x14, 0xef69);
20673         MP_WritePhyUshort(sc, 0x14, 0xe082);
20674         MP_WritePhyUshort(sc, 0x14, 0x46a0);
20675         MP_WritePhyUshort(sc, 0x14, 0x0005);
20676         MP_WritePhyUshort(sc, 0x14, 0x0285);
20677         MP_WritePhyUshort(sc, 0x14, 0xecae);
20678         MP_WritePhyUshort(sc, 0x14, 0x0ea0);
20679         MP_WritePhyUshort(sc, 0x14, 0x0105);
20680         MP_WritePhyUshort(sc, 0x14, 0x021a);
20681         MP_WritePhyUshort(sc, 0x14, 0x68ae);
20682         MP_WritePhyUshort(sc, 0x14, 0x06a0);
20683         MP_WritePhyUshort(sc, 0x14, 0x0203);
20684         MP_WritePhyUshort(sc, 0x14, 0x021a);
20685         MP_WritePhyUshort(sc, 0x14, 0xf4ef);
20686         MP_WritePhyUshort(sc, 0x14, 0x96fe);
20687         MP_WritePhyUshort(sc, 0x14, 0xfc04);
20688         MP_WritePhyUshort(sc, 0x14, 0xf8f9);
20689         MP_WritePhyUshort(sc, 0x14, 0xfaef);
20690         MP_WritePhyUshort(sc, 0x14, 0x69e0);
20691         MP_WritePhyUshort(sc, 0x14, 0x822e);
20692         MP_WritePhyUshort(sc, 0x14, 0xf621);
20693         MP_WritePhyUshort(sc, 0x14, 0xe482);
20694         MP_WritePhyUshort(sc, 0x14, 0x2ee0);
20695         MP_WritePhyUshort(sc, 0x14, 0x8010);
20696         MP_WritePhyUshort(sc, 0x14, 0xac22);
20697         MP_WritePhyUshort(sc, 0x14, 0x02ae);
20698         MP_WritePhyUshort(sc, 0x14, 0x76e0);
20699         MP_WritePhyUshort(sc, 0x14, 0x822c);
20700         MP_WritePhyUshort(sc, 0x14, 0xf721);
20701         MP_WritePhyUshort(sc, 0x14, 0xe482);
20702         MP_WritePhyUshort(sc, 0x14, 0x2cbf);
20703         MP_WritePhyUshort(sc, 0x14, 0x41a5);
20704         MP_WritePhyUshort(sc, 0x14, 0x0241);
20705         MP_WritePhyUshort(sc, 0x14, 0x48ef);
20706         MP_WritePhyUshort(sc, 0x14, 0x21bf);
20707         MP_WritePhyUshort(sc, 0x14, 0x41a8);
20708         MP_WritePhyUshort(sc, 0x14, 0x0241);
20709         MP_WritePhyUshort(sc, 0x14, 0x480c);
20710         MP_WritePhyUshort(sc, 0x14, 0x111e);
20711         MP_WritePhyUshort(sc, 0x14, 0x21bf);
20712         MP_WritePhyUshort(sc, 0x14, 0x41ab);
20713         MP_WritePhyUshort(sc, 0x14, 0x0241);
20714         MP_WritePhyUshort(sc, 0x14, 0x480c);
20715         MP_WritePhyUshort(sc, 0x14, 0x121e);
20716         MP_WritePhyUshort(sc, 0x14, 0x21e6);
20717         MP_WritePhyUshort(sc, 0x14, 0x8248);
20718         MP_WritePhyUshort(sc, 0x14, 0xa200);
20719         MP_WritePhyUshort(sc, 0x14, 0x0ae1);
20720         MP_WritePhyUshort(sc, 0x14, 0x822c);
20721         MP_WritePhyUshort(sc, 0x14, 0xf629);
20722         MP_WritePhyUshort(sc, 0x14, 0xe582);
20723         MP_WritePhyUshort(sc, 0x14, 0x2cae);
20724         MP_WritePhyUshort(sc, 0x14, 0x42e0);
20725         MP_WritePhyUshort(sc, 0x14, 0x8249);
20726         MP_WritePhyUshort(sc, 0x14, 0xf721);
20727         MP_WritePhyUshort(sc, 0x14, 0xe482);
20728         MP_WritePhyUshort(sc, 0x14, 0x4902);
20729         MP_WritePhyUshort(sc, 0x14, 0x4520);
20730         MP_WritePhyUshort(sc, 0x14, 0xbf41);
20731         MP_WritePhyUshort(sc, 0x14, 0xb702);
20732         MP_WritePhyUshort(sc, 0x14, 0x4148);
20733         MP_WritePhyUshort(sc, 0x14, 0xef21);
20734         MP_WritePhyUshort(sc, 0x14, 0xbf41);
20735         MP_WritePhyUshort(sc, 0x14, 0xae02);
20736         MP_WritePhyUshort(sc, 0x14, 0x4148);
20737         MP_WritePhyUshort(sc, 0x14, 0x0c12);
20738         MP_WritePhyUshort(sc, 0x14, 0x1e21);
20739         MP_WritePhyUshort(sc, 0x14, 0xbf41);
20740         MP_WritePhyUshort(sc, 0x14, 0xb102);
20741         MP_WritePhyUshort(sc, 0x14, 0x4148);
20742         MP_WritePhyUshort(sc, 0x14, 0x0c13);
20743         MP_WritePhyUshort(sc, 0x14, 0x1e21);
20744         MP_WritePhyUshort(sc, 0x14, 0xbf41);
20745         MP_WritePhyUshort(sc, 0x14, 0xba02);
20746         MP_WritePhyUshort(sc, 0x14, 0x4148);
20747         MP_WritePhyUshort(sc, 0x14, 0x0c14);
20748         MP_WritePhyUshort(sc, 0x14, 0x1e21);
20749         MP_WritePhyUshort(sc, 0x14, 0xbf43);
20750         MP_WritePhyUshort(sc, 0x14, 0x4602);
20751         MP_WritePhyUshort(sc, 0x14, 0x4148);
20752         MP_WritePhyUshort(sc, 0x14, 0x0c16);
20753         MP_WritePhyUshort(sc, 0x14, 0x1e21);
20754         MP_WritePhyUshort(sc, 0x14, 0xe682);
20755         MP_WritePhyUshort(sc, 0x14, 0x47ee);
20756         MP_WritePhyUshort(sc, 0x14, 0x8246);
20757         MP_WritePhyUshort(sc, 0x14, 0x01ef);
20758         MP_WritePhyUshort(sc, 0x14, 0x96fe);
20759         MP_WritePhyUshort(sc, 0x14, 0xfdfc);
20760         MP_WritePhyUshort(sc, 0x14, 0x04f8);
20761         MP_WritePhyUshort(sc, 0x14, 0xfaef);
20762         MP_WritePhyUshort(sc, 0x14, 0x69e0);
20763         MP_WritePhyUshort(sc, 0x14, 0x824b);
20764         MP_WritePhyUshort(sc, 0x14, 0xa000);
20765         MP_WritePhyUshort(sc, 0x14, 0x0502);
20766         MP_WritePhyUshort(sc, 0x14, 0x8697);
20767         MP_WritePhyUshort(sc, 0x14, 0xae06);
20768         MP_WritePhyUshort(sc, 0x14, 0xa001);
20769         MP_WritePhyUshort(sc, 0x14, 0x0302);
20770         MP_WritePhyUshort(sc, 0x14, 0x1937);
20771         MP_WritePhyUshort(sc, 0x14, 0xef96);
20772         MP_WritePhyUshort(sc, 0x14, 0xfefc);
20773         MP_WritePhyUshort(sc, 0x14, 0x04f8);
20774         MP_WritePhyUshort(sc, 0x14, 0xfaef);
20775         MP_WritePhyUshort(sc, 0x14, 0x69e0);
20776         MP_WritePhyUshort(sc, 0x14, 0x822e);
20777         MP_WritePhyUshort(sc, 0x14, 0xf620);
20778         MP_WritePhyUshort(sc, 0x14, 0xe482);
20779         MP_WritePhyUshort(sc, 0x14, 0x2ee0);
20780         MP_WritePhyUshort(sc, 0x14, 0x8010);
20781         MP_WritePhyUshort(sc, 0x14, 0xac21);
20782         MP_WritePhyUshort(sc, 0x14, 0x02ae);
20783         MP_WritePhyUshort(sc, 0x14, 0x54e0);
20784         MP_WritePhyUshort(sc, 0x14, 0x822c);
20785         MP_WritePhyUshort(sc, 0x14, 0xf720);
20786         MP_WritePhyUshort(sc, 0x14, 0xe482);
20787         MP_WritePhyUshort(sc, 0x14, 0x2cbf);
20788         MP_WritePhyUshort(sc, 0x14, 0x4175);
20789         MP_WritePhyUshort(sc, 0x14, 0x0241);
20790         MP_WritePhyUshort(sc, 0x14, 0x48ac);
20791         MP_WritePhyUshort(sc, 0x14, 0x2822);
20792         MP_WritePhyUshort(sc, 0x14, 0xbf41);
20793         MP_WritePhyUshort(sc, 0x14, 0x9f02);
20794         MP_WritePhyUshort(sc, 0x14, 0x4148);
20795         MP_WritePhyUshort(sc, 0x14, 0xe582);
20796         MP_WritePhyUshort(sc, 0x14, 0x4cac);
20797         MP_WritePhyUshort(sc, 0x14, 0x2820);
20798         MP_WritePhyUshort(sc, 0x14, 0xd103);
20799         MP_WritePhyUshort(sc, 0x14, 0xbf41);
20800         MP_WritePhyUshort(sc, 0x14, 0x9902);
20801         MP_WritePhyUshort(sc, 0x14, 0x410a);
20802         MP_WritePhyUshort(sc, 0x14, 0xee82);
20803         MP_WritePhyUshort(sc, 0x14, 0x4b00);
20804         MP_WritePhyUshort(sc, 0x14, 0xe182);
20805         MP_WritePhyUshort(sc, 0x14, 0x2cf6);
20806         MP_WritePhyUshort(sc, 0x14, 0x28e5);
20807         MP_WritePhyUshort(sc, 0x14, 0x822c);
20808         MP_WritePhyUshort(sc, 0x14, 0xae21);
20809         MP_WritePhyUshort(sc, 0x14, 0xd104);
20810         MP_WritePhyUshort(sc, 0x14, 0xbf41);
20811         MP_WritePhyUshort(sc, 0x14, 0x9902);
20812         MP_WritePhyUshort(sc, 0x14, 0x410a);
20813         MP_WritePhyUshort(sc, 0x14, 0xae08);
20814         MP_WritePhyUshort(sc, 0x14, 0xd105);
20815         MP_WritePhyUshort(sc, 0x14, 0xbf41);
20816         MP_WritePhyUshort(sc, 0x14, 0x9902);
20817         MP_WritePhyUshort(sc, 0x14, 0x410a);
20818         MP_WritePhyUshort(sc, 0x14, 0xe082);
20819         MP_WritePhyUshort(sc, 0x14, 0x49f7);
20820         MP_WritePhyUshort(sc, 0x14, 0x20e4);
20821         MP_WritePhyUshort(sc, 0x14, 0x8249);
20822         MP_WritePhyUshort(sc, 0x14, 0x0245);
20823         MP_WritePhyUshort(sc, 0x14, 0x20ee);
20824         MP_WritePhyUshort(sc, 0x14, 0x824b);
20825         MP_WritePhyUshort(sc, 0x14, 0x01ef);
20826         MP_WritePhyUshort(sc, 0x14, 0x96fe);
20827         MP_WritePhyUshort(sc, 0x14, 0xfc04);
20828         MP_WritePhyUshort(sc, 0x14, 0xf8f9);
20829         MP_WritePhyUshort(sc, 0x14, 0xface);
20830         MP_WritePhyUshort(sc, 0x14, 0xfaef);
20831         MP_WritePhyUshort(sc, 0x14, 0x69fb);
20832         MP_WritePhyUshort(sc, 0x14, 0xbf87);
20833         MP_WritePhyUshort(sc, 0x14, 0x2fd7);
20834         MP_WritePhyUshort(sc, 0x14, 0x0020);
20835         MP_WritePhyUshort(sc, 0x14, 0xd819);
20836         MP_WritePhyUshort(sc, 0x14, 0xd919);
20837         MP_WritePhyUshort(sc, 0x14, 0xda19);
20838         MP_WritePhyUshort(sc, 0x14, 0xdb19);
20839         MP_WritePhyUshort(sc, 0x14, 0x07ef);
20840         MP_WritePhyUshort(sc, 0x14, 0x9502);
20841         MP_WritePhyUshort(sc, 0x14, 0x410a);
20842         MP_WritePhyUshort(sc, 0x14, 0x073f);
20843         MP_WritePhyUshort(sc, 0x14, 0x0004);
20844         MP_WritePhyUshort(sc, 0x14, 0x9fec);
20845         MP_WritePhyUshort(sc, 0x14, 0xffef);
20846         MP_WritePhyUshort(sc, 0x14, 0x96fe);
20847         MP_WritePhyUshort(sc, 0x14, 0xc6fe);
20848         MP_WritePhyUshort(sc, 0x14, 0xfdfc);
20849         MP_WritePhyUshort(sc, 0x14, 0x0400);
20850         MP_WritePhyUshort(sc, 0x14, 0x0144);
20851         MP_WritePhyUshort(sc, 0x14, 0x0000);
20852         MP_WritePhyUshort(sc, 0x14, 0x0343);
20853         MP_WritePhyUshort(sc, 0x14, 0xee00);
20854         MP_WritePhyUshort(sc, 0x14, 0x0087);
20855         MP_WritePhyUshort(sc, 0x14, 0x5b00);
20856         MP_WritePhyUshort(sc, 0x14, 0x0141);
20857         MP_WritePhyUshort(sc, 0x14, 0xe100);
20858         MP_WritePhyUshort(sc, 0x14, 0x0387);
20859         MP_WritePhyUshort(sc, 0x14, 0x5e00);
20860         MP_WritePhyUshort(sc, 0x14, 0x0987);
20861         MP_WritePhyUshort(sc, 0x14, 0x6100);
20862         MP_WritePhyUshort(sc, 0x14, 0x0987);
20863         MP_WritePhyUshort(sc, 0x14, 0x6400);
20864         MP_WritePhyUshort(sc, 0x14, 0x0087);
20865         MP_WritePhyUshort(sc, 0x14, 0x6da4);
20866         MP_WritePhyUshort(sc, 0x14, 0x00b8);
20867         MP_WritePhyUshort(sc, 0x14, 0x20c4);
20868         MP_WritePhyUshort(sc, 0x14, 0x1600);
20869         MP_WritePhyUshort(sc, 0x14, 0x000f);
20870         MP_WritePhyUshort(sc, 0x14, 0xf800);
20871         MP_WritePhyUshort(sc, 0x14, 0x7000);
20872         MP_WritePhyUshort(sc, 0x14, 0xb82e);
20873         MP_WritePhyUshort(sc, 0x14, 0x98a5);
20874         MP_WritePhyUshort(sc, 0x14, 0x8ab6);
20875         MP_WritePhyUshort(sc, 0x14, 0xa83e);
20876         MP_WritePhyUshort(sc, 0x14, 0x50a8);
20877         MP_WritePhyUshort(sc, 0x14, 0x3e33);
20878         MP_WritePhyUshort(sc, 0x14, 0xbcc6);
20879         MP_WritePhyUshort(sc, 0x14, 0x22bc);
20880         MP_WritePhyUshort(sc, 0x14, 0xc6aa);
20881         MP_WritePhyUshort(sc, 0x14, 0xa442);
20882         MP_WritePhyUshort(sc, 0x14, 0xffc4);
20883         MP_WritePhyUshort(sc, 0x14, 0x0800);
20884         MP_WritePhyUshort(sc, 0x14, 0xc416);
20885         MP_WritePhyUshort(sc, 0x14, 0xa8bc);
20886         MP_WritePhyUshort(sc, 0x14, 0xc000);
20887         MP_WritePhyUshort(sc, 0x13, 0xb818);
20888         MP_WritePhyUshort(sc, 0x14, 0x02e3);
20889         MP_WritePhyUshort(sc, 0x13, 0xb81a);
20890         MP_WritePhyUshort(sc, 0x14, 0x17ff);
20891         MP_WritePhyUshort(sc, 0x13, 0xb81e);
20892         MP_WritePhyUshort(sc, 0x14, 0x3b1c);
20893         MP_WritePhyUshort(sc, 0x13, 0xb820);
20894         MP_WritePhyUshort(sc, 0x14, 0x021b);
20895         MP_WritePhyUshort(sc, 0x1f, 0x0000);
20896
20897         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
20898         MP_WritePhyUshort(sc, 0x13, 0x0000);
20899         MP_WritePhyUshort(sc, 0x14, 0x0000);
20900         MP_WritePhyUshort(sc, 0x1f, 0x0B82);
20901         PhyRegValue = MP_ReadPhyUshort(sc, 0x17);
20902         PhyRegValue &= ~(BIT_0);
20903         MP_WritePhyUshort(sc, 0x17, PhyRegValue);
20904         if (sc->RequiredSecLanDonglePatch)
20905                 PhyRegValue &= ~(BIT_2);
20906         MP_WritePhyUshort(sc,0x1f, 0x0000);
20907
20908         MP_WritePhyUshort(sc, 0x1F, 0x0003);
20909         MP_WritePhyUshort(sc, 0x09, 0xA20F);
20910         MP_WritePhyUshort(sc, 0x1F, 0x0000);
20911         MP_WritePhyUshort(sc, 0x1F, 0x0003);
20912         MP_WritePhyUshort(sc, 0x01, 0x328A);
20913         MP_WritePhyUshort(sc, 0x1F, 0x0000);
20914         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
20915         MP_WritePhyUshort(sc, 0x13, 0x8011);
20916         ClearEthPhyBit(sc, 0x14, BIT_14);
20917         MP_WritePhyUshort(sc, 0x1F, 0x0A40);
20918         MP_WritePhyUshort(sc, 0x1F, 0x0000);
20919         MP_WritePhyUshort(sc,0x1f, 0x0000);
20920         MP_WritePhyUshort(sc,0x00, 0x9200);
20921 }
20922
20923 static void re_init_hw_phy_mcu(struct re_softc *sc)
20924 {
20925         if (re_hw_phy_mcu_code_ver_matched(sc)) return;
20926
20927         switch (sc->re_type) {
20928         case MACFG_36:
20929                 re_set_phy_mcu_8168e_1(sc);
20930                 break;
20931         case MACFG_37:
20932                 re_set_phy_mcu_8168e_2(sc);
20933                 break;
20934         case MACFG_38:
20935                 re_set_phy_mcu_8168evl_1(sc);
20936                 break;
20937         case MACFG_39:
20938                 re_set_phy_mcu_8168evl_2(sc);
20939                 break;
20940         case MACFG_50:
20941                 re_set_phy_mcu_8168f_1(sc);
20942                 break;
20943         case MACFG_51:
20944                 re_set_phy_mcu_8168f_2(sc);
20945                 break;
20946         case MACFG_52:
20947                 re_set_phy_mcu_8411_1(sc);
20948                 break;
20949         case MACFG_56:
20950                 re_set_phy_mcu_8168g_1(sc);
20951                 break;
20952         case MACFG_59:
20953                 re_set_phy_mcu_8168gu_2(sc);
20954                 break;
20955         case MACFG_60:
20956                 re_set_phy_mcu_8411b_1(sc);
20957                 break;
20958         case MACFG_61:
20959                 re_set_phy_mcu_8168ep_1(sc);
20960                 break;
20961         case MACFG_68:
20962                 re_set_phy_mcu_8168h_1(sc);
20963                 break;
20964         case MACFG_69:
20965                 re_set_phy_mcu_8168h_2(sc);
20966                 break;
20967         }
20968
20969         re_write_hw_phy_mcu_code_ver(sc);
20970
20971         MP_WritePhyUshort(sc, 0x1F, 0x0000);
20972 }
20973
20974 static void re_hw_phy_config(struct re_softc *sc)
20975 {
20976         u_int16_t Data, PhyRegValue, TmpUshort;
20977         u_int32_t Data_u32;
20978         u_int16_t dout_tapbin;
20979         int     i;
20980
20981         if (sc->re_type == MACFG_59 || sc->re_type == MACFG_60 ||
20982             sc->re_type == MACFG_62 || sc->re_type == MACFG_67 ||
20983             sc->re_type == MACFG_68 || sc->re_type == MACFG_69 ||
20984             sc->re_type == MACFG_70 || sc->re_type == MACFG_71) {
20985                 MP_WritePhyOcpRegWord(sc, 0x0C41, 0x13, 0x0000);
20986                 MP_WritePhyOcpRegWord(sc, 0x0C41, 0x13, 0x0500);
20987         }
20988
20989         if (HW_DASH_SUPPORT_TYPE_3(sc) && sc->HwPkgDet == 0x06) return;
20990
20991         if (FALSE == re_phy_ram_code_check(sc)) {
20992                 re_set_phy_ram_code_check_fail_flag(sc);
20993                 return;
20994         }
20995
20996         re_init_hw_phy_mcu(sc);
20997
20998         MP_WritePhyUshort(sc, 0x1F, 0x0000);
20999
21000         if (sc->re_type == MACFG_3) {
21001                 CSR_WRITE_1(sc, 0x82, CSR_READ_1(sc, 0x82)|BIT_0);
21002                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21003                 MP_WritePhyUshort(sc, 0x0b, 0x0000);
21004
21005                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
21006                 MP_WritePhyUshort(sc, 0x06, 0x006e);
21007                 MP_WritePhyUshort(sc, 0x08, 0x0708);
21008                 MP_WritePhyUshort(sc, 0x15, 0x4000);
21009                 MP_WritePhyUshort(sc, 0x18, 0x65c7);
21010
21011                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
21012                 MP_WritePhyUshort(sc, 0x03, 0x00a1);
21013                 MP_WritePhyUshort(sc, 0x02, 0x0008);
21014                 MP_WritePhyUshort(sc, 0x01, 0x0120);
21015                 MP_WritePhyUshort(sc, 0x00, 0x1000);
21016                 MP_WritePhyUshort(sc, 0x04, 0x0800);
21017                 MP_WritePhyUshort(sc, 0x04, 0x0000);
21018
21019                 MP_WritePhyUshort(sc, 0x03, 0xff41);
21020                 MP_WritePhyUshort(sc, 0x02, 0xdf60);
21021                 MP_WritePhyUshort(sc, 0x01, 0x0140);
21022                 MP_WritePhyUshort(sc, 0x00, 0x0077);
21023                 MP_WritePhyUshort(sc, 0x04, 0x7800);
21024                 MP_WritePhyUshort(sc, 0x04, 0x7000);
21025
21026                 MP_WritePhyUshort(sc, 0x03, 0x802f);
21027                 MP_WritePhyUshort(sc, 0x02, 0x4f02);
21028                 MP_WritePhyUshort(sc, 0x01, 0x0409);
21029                 MP_WritePhyUshort(sc, 0x00, 0xf0f9);
21030                 MP_WritePhyUshort(sc, 0x04, 0x9800);
21031                 MP_WritePhyUshort(sc, 0x04, 0x9000);
21032
21033                 MP_WritePhyUshort(sc, 0x03, 0xdf01);
21034                 MP_WritePhyUshort(sc, 0x02, 0xdf20);
21035                 MP_WritePhyUshort(sc, 0x01, 0xff95);
21036                 MP_WritePhyUshort(sc, 0x00, 0xba00);
21037                 MP_WritePhyUshort(sc, 0x04, 0xa800);
21038                 MP_WritePhyUshort(sc, 0x04, 0xa000);
21039
21040                 MP_WritePhyUshort(sc, 0x03, 0xff41);
21041                 MP_WritePhyUshort(sc, 0x02, 0xdf20);
21042                 MP_WritePhyUshort(sc, 0x01, 0x0140);
21043                 MP_WritePhyUshort(sc, 0x00, 0x00bb);
21044                 MP_WritePhyUshort(sc, 0x04, 0xb800);
21045                 MP_WritePhyUshort(sc, 0x04, 0xb000);
21046
21047                 MP_WritePhyUshort(sc, 0x03, 0xdf41);
21048                 MP_WritePhyUshort(sc, 0x02, 0xdc60);
21049                 MP_WritePhyUshort(sc, 0x01, 0x6340);
21050                 MP_WritePhyUshort(sc, 0x00, 0x007d);
21051                 MP_WritePhyUshort(sc, 0x04, 0xd800);
21052                 MP_WritePhyUshort(sc, 0x04, 0xd000);
21053
21054                 MP_WritePhyUshort(sc, 0x03, 0xdf01);
21055                 MP_WritePhyUshort(sc, 0x02, 0xdf20);
21056                 MP_WritePhyUshort(sc, 0x01, 0x100a);
21057                 MP_WritePhyUshort(sc, 0x00, 0xa0ff);
21058                 MP_WritePhyUshort(sc, 0x04, 0xf800);
21059                 MP_WritePhyUshort(sc, 0x04, 0xf000);
21060
21061                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
21062                 MP_WritePhyUshort(sc, 0x0b, 0x0000);
21063                 MP_WritePhyUshort(sc, 0x00, 0x9200);
21064
21065                 CSR_WRITE_1(sc, 0x82, 0x0d);
21066         } else if (sc->re_type == MACFG_4) {
21067                 MP_WritePhyUshort(sc, 0x1f, 0x0002);
21068                 MP_WritePhyUshort(sc, 0x01, 0x90D0);
21069                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
21070                 // MP_WritePhyUshort(sc, 0x1e, 0x8c00); /* PHY link down with some Giga switch */
21071         } else if (sc->re_type == MACFG_5) {
21072                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
21073                 MP_WritePhyUshort(sc, 0x04, 0x0000);
21074                 MP_WritePhyUshort(sc, 0x03, 0x00a1);
21075                 MP_WritePhyUshort(sc, 0x02, 0x0008);
21076                 MP_WritePhyUshort(sc, 0x01, 0x0120);
21077                 MP_WritePhyUshort(sc, 0x00, 0x1000);
21078                 MP_WritePhyUshort(sc, 0x04, 0x0800);
21079
21080                 MP_WritePhyUshort(sc, 0x04, 0x9000);
21081                 MP_WritePhyUshort(sc, 0x03, 0x802f);
21082                 MP_WritePhyUshort(sc, 0x02, 0x4f02);
21083                 MP_WritePhyUshort(sc, 0x01, 0x0409);
21084                 MP_WritePhyUshort(sc, 0x00, 0xf099);
21085                 MP_WritePhyUshort(sc, 0x04, 0x9800);
21086
21087                 MP_WritePhyUshort(sc, 0x04, 0xa000);
21088                 MP_WritePhyUshort(sc, 0x03, 0xdf01);
21089                 MP_WritePhyUshort(sc, 0x02, 0xdf20);
21090                 MP_WritePhyUshort(sc, 0x01, 0xff95);
21091                 MP_WritePhyUshort(sc, 0x00, 0xba00);
21092                 MP_WritePhyUshort(sc, 0x04, 0xa800);
21093
21094                 MP_WritePhyUshort(sc, 0x04, 0xf000);
21095                 MP_WritePhyUshort(sc, 0x03, 0xdf01);
21096                 MP_WritePhyUshort(sc, 0x02, 0xdf20);
21097                 MP_WritePhyUshort(sc, 0x01, 0x101a);
21098                 MP_WritePhyUshort(sc, 0x00, 0xa0ff);
21099                 MP_WritePhyUshort(sc, 0x04, 0xf800);
21100                 MP_WritePhyUshort(sc, 0x04, 0x0000);
21101                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
21102
21103                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
21104                 MP_WritePhyUshort(sc, 0x10, 0xf41b);
21105                 MP_WritePhyUshort(sc, 0x14, 0xfb54);
21106                 MP_WritePhyUshort(sc, 0x18, 0xf5c7);
21107                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
21108
21109                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
21110                 MP_WritePhyUshort(sc, 0x17, 0x0CC0);
21111                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
21112
21113                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
21114                 MP_WritePhyUshort(sc, 0x10, 0xf01b);
21115
21116         } else if (sc->re_type == MACFG_6) {
21117                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
21118                 MP_WritePhyUshort(sc, 0x04, 0x0000);
21119                 MP_WritePhyUshort(sc, 0x03, 0x00a1);
21120                 MP_WritePhyUshort(sc, 0x02, 0x0008);
21121                 MP_WritePhyUshort(sc, 0x01, 0x0120);
21122                 MP_WritePhyUshort(sc, 0x00, 0x1000);
21123                 MP_WritePhyUshort(sc, 0x04, 0x0800);
21124
21125                 MP_WritePhyUshort(sc, 0x04, 0x9000);
21126                 MP_WritePhyUshort(sc, 0x03, 0x802f);
21127                 MP_WritePhyUshort(sc, 0x02, 0x4f02);
21128                 MP_WritePhyUshort(sc, 0x01, 0x0409);
21129                 MP_WritePhyUshort(sc, 0x00, 0xf099);
21130                 MP_WritePhyUshort(sc, 0x04, 0x9800);
21131
21132                 MP_WritePhyUshort(sc, 0x04, 0xa000);
21133                 MP_WritePhyUshort(sc, 0x03, 0xdf01);
21134                 MP_WritePhyUshort(sc, 0x02, 0xdf20);
21135                 MP_WritePhyUshort(sc, 0x01, 0xff95);
21136                 MP_WritePhyUshort(sc, 0x00, 0xba00);
21137                 MP_WritePhyUshort(sc, 0x04, 0xa800);
21138
21139                 MP_WritePhyUshort(sc, 0x04, 0xf000);
21140                 MP_WritePhyUshort(sc, 0x03, 0xdf01);
21141                 MP_WritePhyUshort(sc, 0x02, 0xdf20);
21142                 MP_WritePhyUshort(sc, 0x01, 0x101a);
21143                 MP_WritePhyUshort(sc, 0x00, 0xa0ff);
21144                 MP_WritePhyUshort(sc, 0x04, 0xf800);
21145                 MP_WritePhyUshort(sc, 0x04, 0x0000);
21146                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
21147
21148                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
21149                 MP_WritePhyUshort(sc, 0x0b, 0x8480);
21150                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
21151
21152                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
21153                 MP_WritePhyUshort(sc, 0x18, 0x67c7);
21154                 MP_WritePhyUshort(sc, 0x04, 0x2000);
21155                 MP_WritePhyUshort(sc, 0x03, 0x002f);
21156                 MP_WritePhyUshort(sc, 0x02, 0x4360);
21157                 MP_WritePhyUshort(sc, 0x01, 0x0109);
21158                 MP_WritePhyUshort(sc, 0x00, 0x3022);
21159                 MP_WritePhyUshort(sc, 0x04, 0x2800);
21160                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
21161
21162                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
21163                 MP_WritePhyUshort(sc, 0x17, 0x0CC0);
21164         } else if (sc->re_type == MACFG_14) {
21165                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
21166                 MP_WritePhyUshort(sc, 0x11, MP_ReadPhyUshort(sc, 0x11) | 0x1000);
21167                 MP_WritePhyUshort(sc, 0x19, MP_ReadPhyUshort(sc, 0x19) | 0x2000);
21168                 MP_WritePhyUshort(sc, 0x10, MP_ReadPhyUshort(sc, 0x10) | 0x8000);
21169
21170                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
21171                 MP_WritePhyUshort(sc, 0x08, 0x441D);
21172                 MP_WritePhyUshort(sc, 0x01, 0x9100);
21173         } else if (sc->re_type == MACFG_15) {
21174                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
21175                 MP_WritePhyUshort(sc, 0x11, MP_ReadPhyUshort(sc, 0x11) | 0x1000);
21176                 MP_WritePhyUshort(sc, 0x19, MP_ReadPhyUshort(sc, 0x19) | 0x2000);
21177                 MP_WritePhyUshort(sc, 0x10, MP_ReadPhyUshort(sc, 0x10) | 0x8000);
21178
21179                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
21180                 MP_WritePhyUshort(sc, 0x08, 0x441D);
21181                 MP_WritePhyUshort(sc, 0x01, 0x9100);
21182         } else if (sc->re_type == MACFG_17) {
21183                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
21184                 MP_WritePhyUshort(sc, 0x11, MP_ReadPhyUshort(sc, 0x11) | 0x1000);
21185                 MP_WritePhyUshort(sc, 0x19, MP_ReadPhyUshort(sc, 0x19) | 0x2000);
21186                 MP_WritePhyUshort(sc, 0x10, MP_ReadPhyUshort(sc, 0x10) | 0x8000);
21187
21188                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
21189                 MP_WritePhyUshort(sc, 0x08, 0x441D);
21190
21191                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
21192         } else if (sc->re_type == MACFG_21) {
21193                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
21194                 MP_WritePhyUshort(sc, 0x0B, 0x94B0);
21195
21196                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
21197                 MP_WritePhyUshort(sc, 0x12, 0x6096);
21198                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21199         } else if (sc->re_type == MACFG_22) {
21200                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
21201                 MP_WritePhyUshort(sc, 0x0B, 0x94B0);
21202
21203                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
21204                 MP_WritePhyUshort(sc, 0x12, 0x6096);
21205         } else if (sc->re_type == MACFG_23) {
21206                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
21207                 MP_WritePhyUshort(sc, 0x0B, 0x94B0);
21208
21209                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
21210                 MP_WritePhyUshort(sc, 0x12, 0x6096);
21211         } else if (sc->re_type == MACFG_24) {
21212                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
21213                 MP_WritePhyUshort(sc, 0x12, 0x2300);
21214                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21215                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
21216                 MP_WritePhyUshort(sc, 0x16, 0x000A);
21217                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21218
21219                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
21220                 MP_WritePhyUshort(sc, 0x12, 0xC096);
21221                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21222
21223                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21224                 MP_WritePhyUshort(sc, 0x00, 0x88DE);
21225                 MP_WritePhyUshort(sc, 0x01, 0x82B1);
21226                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21227
21228                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21229                 MP_WritePhyUshort(sc, 0x08, 0x9E30);
21230                 MP_WritePhyUshort(sc, 0x09, 0x01F0);
21231                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21232
21233                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21234                 MP_WritePhyUshort(sc, 0x0A, 0x5500);
21235                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21236
21237                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21238                 MP_WritePhyUshort(sc, 0x03, 0x7002);
21239                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21240
21241                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21242                 MP_WritePhyUshort(sc, 0x14, MP_ReadPhyUshort(sc, 0x14) | BIT_5);
21243                 MP_WritePhyUshort(sc, 0x0d, MP_ReadPhyUshort(sc, 0x0d) | BIT_5);
21244         } else if (sc->re_type == MACFG_25) {
21245                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
21246                 MP_WritePhyUshort(sc, 0x12, 0x2300);
21247                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
21248                 MP_WritePhyUshort(sc, 0x16, 0x0F0A);
21249                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21250
21251                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21252                 MP_WritePhyUshort(sc, 0x00, 0x88DE);
21253                 MP_WritePhyUshort(sc, 0x01, 0x82B1);
21254                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21255
21256                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21257                 MP_WritePhyUshort(sc, 0x0C, 0x7EB8);
21258                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21259
21260                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21261                 MP_WritePhyUshort(sc, 0x06, 0x0761);
21262                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21263
21264                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
21265                 MP_WritePhyUshort(sc, 0x03, 0x802F);
21266                 MP_WritePhyUshort(sc, 0x02, 0x4F02);
21267                 MP_WritePhyUshort(sc, 0x01, 0x0409);
21268                 MP_WritePhyUshort(sc, 0x00, 0xF099);
21269                 MP_WritePhyUshort(sc, 0x04, 0x9800);
21270                 MP_WritePhyUshort(sc, 0x04, 0x9000);
21271                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21272
21273                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21274                 MP_WritePhyUshort(sc, 0x16, MP_ReadPhyUshort(sc, 0x16) | BIT_0);
21275
21276                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21277                 MP_WritePhyUshort(sc, 0x14, MP_ReadPhyUshort(sc, 0x14) | BIT_5);
21278                 MP_WritePhyUshort(sc, 0x0D, MP_ReadPhyUshort(sc, 0x0D) & ~BIT_5);
21279
21280                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
21281                 MP_WritePhyUshort(sc, 0x1D, 0x3D98);
21282                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21283
21284                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
21285                 MP_WritePhyUshort(sc, 0x17, 0x0CC0);
21286                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21287         } else if (sc->re_type == MACFG_26) {
21288                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
21289                 MP_WritePhyUshort(sc, 0x12, 0x2300);
21290                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
21291                 MP_WritePhyUshort(sc, 0x16, 0x0F0A);
21292                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21293
21294                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21295                 MP_WritePhyUshort(sc, 0x00, 0x88DE);
21296                 MP_WritePhyUshort(sc, 0x01, 0x82B1);
21297                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21298
21299                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21300                 MP_WritePhyUshort(sc, 0x0C, 0x7EB8);
21301                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21302
21303                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21304                 MP_WritePhyUshort(sc, 0x06, 0x5461);
21305                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21306
21307                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21308                 MP_WritePhyUshort(sc, 0x06, 0x5461);
21309                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21310
21311                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21312                 MP_WritePhyUshort(sc, 0x16, MP_ReadPhyUshort(sc, 0x16) | BIT_0);
21313
21314                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21315                 MP_WritePhyUshort(sc, 0x14, MP_ReadPhyUshort(sc, 0x14) | BIT_5);
21316                 MP_WritePhyUshort(sc, 0x0D, MP_ReadPhyUshort(sc, 0x0D) & ~BIT_5);
21317
21318                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
21319                 MP_WritePhyUshort(sc, 0x1D, 0x3D98);
21320                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21321
21322                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
21323                 MP_WritePhyUshort(sc, 0x17, 0x0CC0);
21324                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21325         } else if (sc->re_type == MACFG_27) {
21326                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21327                 MP_WritePhyUshort(sc, 0x0d, MP_ReadPhyUshort(sc, 0x0d) | BIT_5);
21328                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21329
21330                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
21331                 MP_WritePhyUshort(sc, 0x1D, 0x3D98);
21332                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21333
21334                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
21335                 MP_WritePhyUshort(sc, 0x14, 0xCAA3);
21336                 MP_WritePhyUshort(sc, 0x1C, 0x000A);
21337                 MP_WritePhyUshort(sc, 0x18, 0x65D0);
21338
21339                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
21340                 MP_WritePhyUshort(sc, 0x17, 0xB580);
21341                 MP_WritePhyUshort(sc, 0x18, 0xFF54);
21342                 MP_WritePhyUshort(sc, 0x19, 0x3954);
21343
21344                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21345                 MP_WritePhyUshort(sc, 0x0D, 0x310C);
21346                 MP_WritePhyUshort(sc, 0x0E, 0x310C);
21347                 MP_WritePhyUshort(sc, 0x0F, 0x311C);
21348                 MP_WritePhyUshort(sc, 0x06, 0x0761);
21349
21350                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
21351                 MP_WritePhyUshort(sc, 0x18, 0xFF55);
21352                 MP_WritePhyUshort(sc, 0x19, 0x3955);
21353                 MP_WritePhyUshort(sc, 0x18, 0xFF54);
21354                 MP_WritePhyUshort(sc, 0x19, 0x3954);
21355
21356                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
21357                 MP_WritePhyUshort(sc, 0x17, 0x0CC0);
21358         } else if (sc->re_type == MACFG_28) {
21359                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21360                 MP_WritePhyUshort(sc, 0x14, MP_ReadPhyUshort(sc, 0x14) | BIT_5);
21361                 MP_WritePhyUshort(sc, 0x0d, MP_ReadPhyUshort(sc, 0x0d) | BIT_5);
21362
21363                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
21364                 MP_WritePhyUshort(sc, 0x14, 0xCAA3);
21365                 MP_WritePhyUshort(sc, 0x1C, 0x000A);
21366                 MP_WritePhyUshort(sc, 0x18, 0x65D0);
21367
21368                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
21369                 MP_WritePhyUshort(sc, 0x17, 0xB580);
21370                 MP_WritePhyUshort(sc, 0x18, 0xFF54);
21371                 MP_WritePhyUshort(sc, 0x19, 0x3954);
21372
21373                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21374                 MP_WritePhyUshort(sc, 0x0D, 0x310C);
21375                 MP_WritePhyUshort(sc, 0x0E, 0x310C);
21376                 MP_WritePhyUshort(sc, 0x0F, 0x311C);
21377                 MP_WritePhyUshort(sc, 0x06, 0x0761);
21378
21379                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
21380                 MP_WritePhyUshort(sc, 0x18, 0xFF55);
21381                 MP_WritePhyUshort(sc, 0x19, 0x3955);
21382                 MP_WritePhyUshort(sc, 0x18, 0xFF54);
21383                 MP_WritePhyUshort(sc, 0x19, 0x3954);
21384
21385                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
21386                 MP_WritePhyUshort(sc, 0x17, 0x0CC0);
21387
21388                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21389                 MP_WritePhyUshort(sc, 0x16, MP_ReadPhyUshort(sc, 0x16) | BIT_0);
21390                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21391         } else if (sc->re_type == MACFG_31) {
21392                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
21393                 MP_WritePhyUshort(sc, 0x06, 0x4064);
21394                 MP_WritePhyUshort(sc, 0x07, 0x2863);
21395                 MP_WritePhyUshort(sc, 0x08, 0x059C);
21396                 MP_WritePhyUshort(sc, 0x09, 0x26B4);
21397                 MP_WritePhyUshort(sc, 0x0A, 0x6A19);
21398                 MP_WritePhyUshort(sc, 0x0B, 0xDCC8);
21399                 MP_WritePhyUshort(sc, 0x10, 0xF06D);
21400                 MP_WritePhyUshort(sc, 0x14, 0x7F68);
21401                 MP_WritePhyUshort(sc, 0x18, 0x7FD9);
21402                 MP_WritePhyUshort(sc, 0x1C, 0xF0FF);
21403                 MP_WritePhyUshort(sc, 0x1D, 0x3D9C);
21404                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
21405                 MP_WritePhyUshort(sc, 0x12, 0xF49F);
21406                 MP_WritePhyUshort(sc, 0x13, 0x070B);
21407                 MP_WritePhyUshort(sc, 0x1A, 0x05AD);
21408                 MP_WritePhyUshort(sc, 0x14, 0x94C0);
21409
21410                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21411                 Data = MP_ReadPhyUshort(sc, 0x0B) & 0xFF00;
21412                 Data |= 0x10;
21413                 MP_WritePhyUshort(sc, 0x0B, Data);
21414                 Data = MP_ReadPhyUshort(sc, 0x0C) & 0x00FF;
21415                 Data |= 0xA200;
21416                 MP_WritePhyUshort(sc, 0x0C, Data);
21417
21418                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21419                 MP_WritePhyUshort(sc, 0x06, 0x5561);
21420                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
21421                 MP_WritePhyUshort(sc, 0x05, 0x8332);
21422                 MP_WritePhyUshort(sc, 0x06, 0x5561);
21423
21424                 if (MP_ReadEfuse(sc, 0x01) == 0xb1) {
21425                         MP_WritePhyUshort(sc, 0x1F, 0x0002);
21426                         MP_WritePhyUshort(sc, 0x05, 0x669A);
21427                         MP_WritePhyUshort(sc, 0x1F, 0x0005);
21428                         MP_WritePhyUshort(sc, 0x05, 0x8330);
21429                         MP_WritePhyUshort(sc, 0x06, 0x669A);
21430
21431                         MP_WritePhyUshort(sc, 0x1F, 0x0002);
21432                         Data = MP_ReadPhyUshort(sc, 0x0D);
21433                         if ((Data & 0x00FF) != 0x006C) {
21434                                 Data &= 0xFF00;
21435                                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21436                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x0065);
21437                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x0066);
21438                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x0067);
21439                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x0068);
21440                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x0069);
21441                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x006A);
21442                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x006B);
21443                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x006C);
21444                         }
21445                 } else {
21446                         MP_WritePhyUshort(sc, 0x1F, 0x0002);
21447                         MP_WritePhyUshort(sc, 0x05, 0x6662);
21448                         MP_WritePhyUshort(sc, 0x1F, 0x0005);
21449                         MP_WritePhyUshort(sc, 0x05, 0x8330);
21450                         MP_WritePhyUshort(sc, 0x06, 0x6662);
21451                 }
21452
21453                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21454                 Data = MP_ReadPhyUshort(sc, 0x0D);
21455                 Data |= 0x300;
21456                 MP_WritePhyUshort(sc, 0x0D, Data);
21457                 Data = MP_ReadPhyUshort(sc, 0x0F);
21458                 Data |= 0x10;
21459                 MP_WritePhyUshort(sc, 0x0F, Data);
21460
21461                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21462                 Data = MP_ReadPhyUshort(sc, 0x02);
21463                 Data &= ~0x600;
21464                 Data |= 0x100;
21465                 MP_WritePhyUshort(sc, 0x02, Data);
21466                 Data = MP_ReadPhyUshort(sc, 0x03);
21467                 Data &= ~0xE000;
21468                 MP_WritePhyUshort(sc, 0x03, Data);
21469
21470                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
21471                 MP_WritePhyUshort(sc, 0x17, 0x0CC0);
21472
21473                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
21474                 MP_WritePhyUshort(sc, 0x05, 0x001B);
21475                 if (MP_ReadPhyUshort(sc, 0x06) == 0xBF00) {
21476                         MP_WritePhyUshort(sc, 0x1f, 0x0005);
21477                         MP_WritePhyUshort(sc, 0x05, 0xfff6);
21478                         MP_WritePhyUshort(sc, 0x06, 0x0080);
21479                         MP_WritePhyUshort(sc, 0x05, 0x8000);
21480                         MP_WritePhyUshort(sc, 0x06, 0xf8f9);
21481                         MP_WritePhyUshort(sc, 0x06, 0xfaef);
21482                         MP_WritePhyUshort(sc, 0x06, 0x59ee);
21483                         MP_WritePhyUshort(sc, 0x06, 0xf8ea);
21484                         MP_WritePhyUshort(sc, 0x06, 0x00ee);
21485                         MP_WritePhyUshort(sc, 0x06, 0xf8eb);
21486                         MP_WritePhyUshort(sc, 0x06, 0x00e0);
21487                         MP_WritePhyUshort(sc, 0x06, 0xf87c);
21488                         MP_WritePhyUshort(sc, 0x06, 0xe1f8);
21489                         MP_WritePhyUshort(sc, 0x06, 0x7d59);
21490                         MP_WritePhyUshort(sc, 0x06, 0x0fef);
21491                         MP_WritePhyUshort(sc, 0x06, 0x0139);
21492                         MP_WritePhyUshort(sc, 0x06, 0x029e);
21493                         MP_WritePhyUshort(sc, 0x06, 0x06ef);
21494                         MP_WritePhyUshort(sc, 0x06, 0x1039);
21495                         MP_WritePhyUshort(sc, 0x06, 0x089f);
21496                         MP_WritePhyUshort(sc, 0x06, 0x2aee);
21497                         MP_WritePhyUshort(sc, 0x06, 0xf8ea);
21498                         MP_WritePhyUshort(sc, 0x06, 0x00ee);
21499                         MP_WritePhyUshort(sc, 0x06, 0xf8eb);
21500                         MP_WritePhyUshort(sc, 0x06, 0x01e0);
21501                         MP_WritePhyUshort(sc, 0x06, 0xf87c);
21502                         MP_WritePhyUshort(sc, 0x06, 0xe1f8);
21503                         MP_WritePhyUshort(sc, 0x06, 0x7d58);
21504                         MP_WritePhyUshort(sc, 0x06, 0x409e);
21505                         MP_WritePhyUshort(sc, 0x06, 0x0f39);
21506                         MP_WritePhyUshort(sc, 0x06, 0x46aa);
21507                         MP_WritePhyUshort(sc, 0x06, 0x0bbf);
21508                         MP_WritePhyUshort(sc, 0x06, 0x8290);
21509                         MP_WritePhyUshort(sc, 0x06, 0xd682);
21510                         MP_WritePhyUshort(sc, 0x06, 0x9802);
21511                         MP_WritePhyUshort(sc, 0x06, 0x014f);
21512                         MP_WritePhyUshort(sc, 0x06, 0xae09);
21513                         MP_WritePhyUshort(sc, 0x06, 0xbf82);
21514                         MP_WritePhyUshort(sc, 0x06, 0x98d6);
21515                         MP_WritePhyUshort(sc, 0x06, 0x82a0);
21516                         MP_WritePhyUshort(sc, 0x06, 0x0201);
21517                         MP_WritePhyUshort(sc, 0x06, 0x4fef);
21518                         MP_WritePhyUshort(sc, 0x06, 0x95fe);
21519                         MP_WritePhyUshort(sc, 0x06, 0xfdfc);
21520                         MP_WritePhyUshort(sc, 0x06, 0x05f8);
21521                         MP_WritePhyUshort(sc, 0x06, 0xf9fa);
21522                         MP_WritePhyUshort(sc, 0x06, 0xeef8);
21523                         MP_WritePhyUshort(sc, 0x06, 0xea00);
21524                         MP_WritePhyUshort(sc, 0x06, 0xeef8);
21525                         MP_WritePhyUshort(sc, 0x06, 0xeb00);
21526                         MP_WritePhyUshort(sc, 0x06, 0xe2f8);
21527                         MP_WritePhyUshort(sc, 0x06, 0x7ce3);
21528                         MP_WritePhyUshort(sc, 0x06, 0xf87d);
21529                         MP_WritePhyUshort(sc, 0x06, 0xa511);
21530                         MP_WritePhyUshort(sc, 0x06, 0x1112);
21531                         MP_WritePhyUshort(sc, 0x06, 0xd240);
21532                         MP_WritePhyUshort(sc, 0x06, 0xd644);
21533                         MP_WritePhyUshort(sc, 0x06, 0x4402);
21534                         MP_WritePhyUshort(sc, 0x06, 0x8217);
21535                         MP_WritePhyUshort(sc, 0x06, 0xd2a0);
21536                         MP_WritePhyUshort(sc, 0x06, 0xd6aa);
21537                         MP_WritePhyUshort(sc, 0x06, 0xaa02);
21538                         MP_WritePhyUshort(sc, 0x06, 0x8217);
21539                         MP_WritePhyUshort(sc, 0x06, 0xae0f);
21540                         MP_WritePhyUshort(sc, 0x06, 0xa544);
21541                         MP_WritePhyUshort(sc, 0x06, 0x4402);
21542                         MP_WritePhyUshort(sc, 0x06, 0xae4d);
21543                         MP_WritePhyUshort(sc, 0x06, 0xa5aa);
21544                         MP_WritePhyUshort(sc, 0x06, 0xaa02);
21545                         MP_WritePhyUshort(sc, 0x06, 0xae47);
21546                         MP_WritePhyUshort(sc, 0x06, 0xaf82);
21547                         MP_WritePhyUshort(sc, 0x06, 0x13ee);
21548                         MP_WritePhyUshort(sc, 0x06, 0x834e);
21549                         MP_WritePhyUshort(sc, 0x06, 0x00ee);
21550                         MP_WritePhyUshort(sc, 0x06, 0x834d);
21551                         MP_WritePhyUshort(sc, 0x06, 0x0fee);
21552                         MP_WritePhyUshort(sc, 0x06, 0x834c);
21553                         MP_WritePhyUshort(sc, 0x06, 0x0fee);
21554                         MP_WritePhyUshort(sc, 0x06, 0x834f);
21555                         MP_WritePhyUshort(sc, 0x06, 0x00ee);
21556                         MP_WritePhyUshort(sc, 0x06, 0x8351);
21557                         MP_WritePhyUshort(sc, 0x06, 0x00ee);
21558                         MP_WritePhyUshort(sc, 0x06, 0x834a);
21559                         MP_WritePhyUshort(sc, 0x06, 0xffee);
21560                         MP_WritePhyUshort(sc, 0x06, 0x834b);
21561                         MP_WritePhyUshort(sc, 0x06, 0xffe0);
21562                         MP_WritePhyUshort(sc, 0x06, 0x8330);
21563                         MP_WritePhyUshort(sc, 0x06, 0xe183);
21564                         MP_WritePhyUshort(sc, 0x06, 0x3158);
21565                         MP_WritePhyUshort(sc, 0x06, 0xfee4);
21566                         MP_WritePhyUshort(sc, 0x06, 0xf88a);
21567                         MP_WritePhyUshort(sc, 0x06, 0xe5f8);
21568                         MP_WritePhyUshort(sc, 0x06, 0x8be0);
21569                         MP_WritePhyUshort(sc, 0x06, 0x8332);
21570                         MP_WritePhyUshort(sc, 0x06, 0xe183);
21571                         MP_WritePhyUshort(sc, 0x06, 0x3359);
21572                         MP_WritePhyUshort(sc, 0x06, 0x0fe2);
21573                         MP_WritePhyUshort(sc, 0x06, 0x834d);
21574                         MP_WritePhyUshort(sc, 0x06, 0x0c24);
21575                         MP_WritePhyUshort(sc, 0x06, 0x5af0);
21576                         MP_WritePhyUshort(sc, 0x06, 0x1e12);
21577                         MP_WritePhyUshort(sc, 0x06, 0xe4f8);
21578                         MP_WritePhyUshort(sc, 0x06, 0x8ce5);
21579                         MP_WritePhyUshort(sc, 0x06, 0xf88d);
21580                         MP_WritePhyUshort(sc, 0x06, 0xaf82);
21581                         MP_WritePhyUshort(sc, 0x06, 0x13e0);
21582                         MP_WritePhyUshort(sc, 0x06, 0x834f);
21583                         MP_WritePhyUshort(sc, 0x06, 0x10e4);
21584                         MP_WritePhyUshort(sc, 0x06, 0x834f);
21585                         MP_WritePhyUshort(sc, 0x06, 0xe083);
21586                         MP_WritePhyUshort(sc, 0x06, 0x4e78);
21587                         MP_WritePhyUshort(sc, 0x06, 0x009f);
21588                         MP_WritePhyUshort(sc, 0x06, 0x0ae0);
21589                         MP_WritePhyUshort(sc, 0x06, 0x834f);
21590                         MP_WritePhyUshort(sc, 0x06, 0xa010);
21591                         MP_WritePhyUshort(sc, 0x06, 0xa5ee);
21592                         MP_WritePhyUshort(sc, 0x06, 0x834e);
21593                         MP_WritePhyUshort(sc, 0x06, 0x01e0);
21594                         MP_WritePhyUshort(sc, 0x06, 0x834e);
21595                         MP_WritePhyUshort(sc, 0x06, 0x7805);
21596                         MP_WritePhyUshort(sc, 0x06, 0x9e9a);
21597                         MP_WritePhyUshort(sc, 0x06, 0xe083);
21598                         MP_WritePhyUshort(sc, 0x06, 0x4e78);
21599                         MP_WritePhyUshort(sc, 0x06, 0x049e);
21600                         MP_WritePhyUshort(sc, 0x06, 0x10e0);
21601                         MP_WritePhyUshort(sc, 0x06, 0x834e);
21602                         MP_WritePhyUshort(sc, 0x06, 0x7803);
21603                         MP_WritePhyUshort(sc, 0x06, 0x9e0f);
21604                         MP_WritePhyUshort(sc, 0x06, 0xe083);
21605                         MP_WritePhyUshort(sc, 0x06, 0x4e78);
21606                         MP_WritePhyUshort(sc, 0x06, 0x019e);
21607                         MP_WritePhyUshort(sc, 0x06, 0x05ae);
21608                         MP_WritePhyUshort(sc, 0x06, 0x0caf);
21609                         MP_WritePhyUshort(sc, 0x06, 0x81f8);
21610                         MP_WritePhyUshort(sc, 0x06, 0xaf81);
21611                         MP_WritePhyUshort(sc, 0x06, 0xa3af);
21612                         MP_WritePhyUshort(sc, 0x06, 0x81dc);
21613                         MP_WritePhyUshort(sc, 0x06, 0xaf82);
21614                         MP_WritePhyUshort(sc, 0x06, 0x13ee);
21615                         MP_WritePhyUshort(sc, 0x06, 0x8348);
21616                         MP_WritePhyUshort(sc, 0x06, 0x00ee);
21617                         MP_WritePhyUshort(sc, 0x06, 0x8349);
21618                         MP_WritePhyUshort(sc, 0x06, 0x00e0);
21619                         MP_WritePhyUshort(sc, 0x06, 0x8351);
21620                         MP_WritePhyUshort(sc, 0x06, 0x10e4);
21621                         MP_WritePhyUshort(sc, 0x06, 0x8351);
21622                         MP_WritePhyUshort(sc, 0x06, 0x5801);
21623                         MP_WritePhyUshort(sc, 0x06, 0x9fea);
21624                         MP_WritePhyUshort(sc, 0x06, 0xd000);
21625                         MP_WritePhyUshort(sc, 0x06, 0xd180);
21626                         MP_WritePhyUshort(sc, 0x06, 0x1f66);
21627                         MP_WritePhyUshort(sc, 0x06, 0xe2f8);
21628                         MP_WritePhyUshort(sc, 0x06, 0xeae3);
21629                         MP_WritePhyUshort(sc, 0x06, 0xf8eb);
21630                         MP_WritePhyUshort(sc, 0x06, 0x5af8);
21631                         MP_WritePhyUshort(sc, 0x06, 0x1e20);
21632                         MP_WritePhyUshort(sc, 0x06, 0xe6f8);
21633                         MP_WritePhyUshort(sc, 0x06, 0xeae5);
21634                         MP_WritePhyUshort(sc, 0x06, 0xf8eb);
21635                         MP_WritePhyUshort(sc, 0x06, 0xd302);
21636                         MP_WritePhyUshort(sc, 0x06, 0xb3fe);
21637                         MP_WritePhyUshort(sc, 0x06, 0xe2f8);
21638                         MP_WritePhyUshort(sc, 0x06, 0x7cef);
21639                         MP_WritePhyUshort(sc, 0x06, 0x325b);
21640                         MP_WritePhyUshort(sc, 0x06, 0x80e3);
21641                         MP_WritePhyUshort(sc, 0x06, 0xf87d);
21642                         MP_WritePhyUshort(sc, 0x06, 0x9e03);
21643                         MP_WritePhyUshort(sc, 0x06, 0x7dff);
21644                         MP_WritePhyUshort(sc, 0x06, 0xff0d);
21645                         MP_WritePhyUshort(sc, 0x06, 0x581c);
21646                         MP_WritePhyUshort(sc, 0x06, 0x551a);
21647                         MP_WritePhyUshort(sc, 0x06, 0x6511);
21648                         MP_WritePhyUshort(sc, 0x06, 0xa190);
21649                         MP_WritePhyUshort(sc, 0x06, 0xd3e2);
21650                         MP_WritePhyUshort(sc, 0x06, 0x8348);
21651                         MP_WritePhyUshort(sc, 0x06, 0xe383);
21652                         MP_WritePhyUshort(sc, 0x06, 0x491b);
21653                         MP_WritePhyUshort(sc, 0x06, 0x56ab);
21654                         MP_WritePhyUshort(sc, 0x06, 0x08ef);
21655                         MP_WritePhyUshort(sc, 0x06, 0x56e6);
21656                         MP_WritePhyUshort(sc, 0x06, 0x8348);
21657                         MP_WritePhyUshort(sc, 0x06, 0xe783);
21658                         MP_WritePhyUshort(sc, 0x06, 0x4910);
21659                         MP_WritePhyUshort(sc, 0x06, 0xd180);
21660                         MP_WritePhyUshort(sc, 0x06, 0x1f66);
21661                         MP_WritePhyUshort(sc, 0x06, 0xa004);
21662                         MP_WritePhyUshort(sc, 0x06, 0xb9e2);
21663                         MP_WritePhyUshort(sc, 0x06, 0x8348);
21664                         MP_WritePhyUshort(sc, 0x06, 0xe383);
21665                         MP_WritePhyUshort(sc, 0x06, 0x49ef);
21666                         MP_WritePhyUshort(sc, 0x06, 0x65e2);
21667                         MP_WritePhyUshort(sc, 0x06, 0x834a);
21668                         MP_WritePhyUshort(sc, 0x06, 0xe383);
21669                         MP_WritePhyUshort(sc, 0x06, 0x4b1b);
21670                         MP_WritePhyUshort(sc, 0x06, 0x56aa);
21671                         MP_WritePhyUshort(sc, 0x06, 0x0eef);
21672                         MP_WritePhyUshort(sc, 0x06, 0x56e6);
21673                         MP_WritePhyUshort(sc, 0x06, 0x834a);
21674                         MP_WritePhyUshort(sc, 0x06, 0xe783);
21675                         MP_WritePhyUshort(sc, 0x06, 0x4be2);
21676                         MP_WritePhyUshort(sc, 0x06, 0x834d);
21677                         MP_WritePhyUshort(sc, 0x06, 0xe683);
21678                         MP_WritePhyUshort(sc, 0x06, 0x4ce0);
21679                         MP_WritePhyUshort(sc, 0x06, 0x834d);
21680                         MP_WritePhyUshort(sc, 0x06, 0xa000);
21681                         MP_WritePhyUshort(sc, 0x06, 0x0caf);
21682                         MP_WritePhyUshort(sc, 0x06, 0x81dc);
21683                         MP_WritePhyUshort(sc, 0x06, 0xe083);
21684                         MP_WritePhyUshort(sc, 0x06, 0x4d10);
21685                         MP_WritePhyUshort(sc, 0x06, 0xe483);
21686                         MP_WritePhyUshort(sc, 0x06, 0x4dae);
21687                         MP_WritePhyUshort(sc, 0x06, 0x0480);
21688                         MP_WritePhyUshort(sc, 0x06, 0xe483);
21689                         MP_WritePhyUshort(sc, 0x06, 0x4de0);
21690                         MP_WritePhyUshort(sc, 0x06, 0x834e);
21691                         MP_WritePhyUshort(sc, 0x06, 0x7803);
21692                         MP_WritePhyUshort(sc, 0x06, 0x9e0b);
21693                         MP_WritePhyUshort(sc, 0x06, 0xe083);
21694                         MP_WritePhyUshort(sc, 0x06, 0x4e78);
21695                         MP_WritePhyUshort(sc, 0x06, 0x049e);
21696                         MP_WritePhyUshort(sc, 0x06, 0x04ee);
21697                         MP_WritePhyUshort(sc, 0x06, 0x834e);
21698                         MP_WritePhyUshort(sc, 0x06, 0x02e0);
21699                         MP_WritePhyUshort(sc, 0x06, 0x8332);
21700                         MP_WritePhyUshort(sc, 0x06, 0xe183);
21701                         MP_WritePhyUshort(sc, 0x06, 0x3359);
21702                         MP_WritePhyUshort(sc, 0x06, 0x0fe2);
21703                         MP_WritePhyUshort(sc, 0x06, 0x834d);
21704                         MP_WritePhyUshort(sc, 0x06, 0x0c24);
21705                         MP_WritePhyUshort(sc, 0x06, 0x5af0);
21706                         MP_WritePhyUshort(sc, 0x06, 0x1e12);
21707                         MP_WritePhyUshort(sc, 0x06, 0xe4f8);
21708                         MP_WritePhyUshort(sc, 0x06, 0x8ce5);
21709                         MP_WritePhyUshort(sc, 0x06, 0xf88d);
21710                         MP_WritePhyUshort(sc, 0x06, 0xe083);
21711                         MP_WritePhyUshort(sc, 0x06, 0x30e1);
21712                         MP_WritePhyUshort(sc, 0x06, 0x8331);
21713                         MP_WritePhyUshort(sc, 0x06, 0x6801);
21714                         MP_WritePhyUshort(sc, 0x06, 0xe4f8);
21715                         MP_WritePhyUshort(sc, 0x06, 0x8ae5);
21716                         MP_WritePhyUshort(sc, 0x06, 0xf88b);
21717                         MP_WritePhyUshort(sc, 0x06, 0xae37);
21718                         MP_WritePhyUshort(sc, 0x06, 0xee83);
21719                         MP_WritePhyUshort(sc, 0x06, 0x4e03);
21720                         MP_WritePhyUshort(sc, 0x06, 0xe083);
21721                         MP_WritePhyUshort(sc, 0x06, 0x4ce1);
21722                         MP_WritePhyUshort(sc, 0x06, 0x834d);
21723                         MP_WritePhyUshort(sc, 0x06, 0x1b01);
21724                         MP_WritePhyUshort(sc, 0x06, 0x9e04);
21725                         MP_WritePhyUshort(sc, 0x06, 0xaaa1);
21726                         MP_WritePhyUshort(sc, 0x06, 0xaea8);
21727                         MP_WritePhyUshort(sc, 0x06, 0xee83);
21728                         MP_WritePhyUshort(sc, 0x06, 0x4e04);
21729                         MP_WritePhyUshort(sc, 0x06, 0xee83);
21730                         MP_WritePhyUshort(sc, 0x06, 0x4f00);
21731                         MP_WritePhyUshort(sc, 0x06, 0xaeab);
21732                         MP_WritePhyUshort(sc, 0x06, 0xe083);
21733                         MP_WritePhyUshort(sc, 0x06, 0x4f78);
21734                         MP_WritePhyUshort(sc, 0x06, 0x039f);
21735                         MP_WritePhyUshort(sc, 0x06, 0x14ee);
21736                         MP_WritePhyUshort(sc, 0x06, 0x834e);
21737                         MP_WritePhyUshort(sc, 0x06, 0x05d2);
21738                         MP_WritePhyUshort(sc, 0x06, 0x40d6);
21739                         MP_WritePhyUshort(sc, 0x06, 0x5554);
21740                         MP_WritePhyUshort(sc, 0x06, 0x0282);
21741                         MP_WritePhyUshort(sc, 0x06, 0x17d2);
21742                         MP_WritePhyUshort(sc, 0x06, 0xa0d6);
21743                         MP_WritePhyUshort(sc, 0x06, 0xba00);
21744                         MP_WritePhyUshort(sc, 0x06, 0x0282);
21745                         MP_WritePhyUshort(sc, 0x06, 0x17fe);
21746                         MP_WritePhyUshort(sc, 0x06, 0xfdfc);
21747                         MP_WritePhyUshort(sc, 0x06, 0x05f8);
21748                         MP_WritePhyUshort(sc, 0x06, 0xe0f8);
21749                         MP_WritePhyUshort(sc, 0x06, 0x60e1);
21750                         MP_WritePhyUshort(sc, 0x06, 0xf861);
21751                         MP_WritePhyUshort(sc, 0x06, 0x6802);
21752                         MP_WritePhyUshort(sc, 0x06, 0xe4f8);
21753                         MP_WritePhyUshort(sc, 0x06, 0x60e5);
21754                         MP_WritePhyUshort(sc, 0x06, 0xf861);
21755                         MP_WritePhyUshort(sc, 0x06, 0xe0f8);
21756                         MP_WritePhyUshort(sc, 0x06, 0x48e1);
21757                         MP_WritePhyUshort(sc, 0x06, 0xf849);
21758                         MP_WritePhyUshort(sc, 0x06, 0x580f);
21759                         MP_WritePhyUshort(sc, 0x06, 0x1e02);
21760                         MP_WritePhyUshort(sc, 0x06, 0xe4f8);
21761                         MP_WritePhyUshort(sc, 0x06, 0x48e5);
21762                         MP_WritePhyUshort(sc, 0x06, 0xf849);
21763                         MP_WritePhyUshort(sc, 0x06, 0xd000);
21764                         MP_WritePhyUshort(sc, 0x06, 0x0282);
21765                         MP_WritePhyUshort(sc, 0x06, 0x5bbf);
21766                         MP_WritePhyUshort(sc, 0x06, 0x8350);
21767                         MP_WritePhyUshort(sc, 0x06, 0xef46);
21768                         MP_WritePhyUshort(sc, 0x06, 0xdc19);
21769                         MP_WritePhyUshort(sc, 0x06, 0xddd0);
21770                         MP_WritePhyUshort(sc, 0x06, 0x0102);
21771                         MP_WritePhyUshort(sc, 0x06, 0x825b);
21772                         MP_WritePhyUshort(sc, 0x06, 0x0282);
21773                         MP_WritePhyUshort(sc, 0x06, 0x77e0);
21774                         MP_WritePhyUshort(sc, 0x06, 0xf860);
21775                         MP_WritePhyUshort(sc, 0x06, 0xe1f8);
21776                         MP_WritePhyUshort(sc, 0x06, 0x6158);
21777                         MP_WritePhyUshort(sc, 0x06, 0xfde4);
21778                         MP_WritePhyUshort(sc, 0x06, 0xf860);
21779                         MP_WritePhyUshort(sc, 0x06, 0xe5f8);
21780                         MP_WritePhyUshort(sc, 0x06, 0x61fc);
21781                         MP_WritePhyUshort(sc, 0x06, 0x04f9);
21782                         MP_WritePhyUshort(sc, 0x06, 0xfafb);
21783                         MP_WritePhyUshort(sc, 0x06, 0xc6bf);
21784                         MP_WritePhyUshort(sc, 0x06, 0xf840);
21785                         MP_WritePhyUshort(sc, 0x06, 0xbe83);
21786                         MP_WritePhyUshort(sc, 0x06, 0x50a0);
21787                         MP_WritePhyUshort(sc, 0x06, 0x0101);
21788                         MP_WritePhyUshort(sc, 0x06, 0x071b);
21789                         MP_WritePhyUshort(sc, 0x06, 0x89cf);
21790                         MP_WritePhyUshort(sc, 0x06, 0xd208);
21791                         MP_WritePhyUshort(sc, 0x06, 0xebdb);
21792                         MP_WritePhyUshort(sc, 0x06, 0x19b2);
21793                         MP_WritePhyUshort(sc, 0x06, 0xfbff);
21794                         MP_WritePhyUshort(sc, 0x06, 0xfefd);
21795                         MP_WritePhyUshort(sc, 0x06, 0x04f8);
21796                         MP_WritePhyUshort(sc, 0x06, 0xe0f8);
21797                         MP_WritePhyUshort(sc, 0x06, 0x48e1);
21798                         MP_WritePhyUshort(sc, 0x06, 0xf849);
21799                         MP_WritePhyUshort(sc, 0x06, 0x6808);
21800                         MP_WritePhyUshort(sc, 0x06, 0xe4f8);
21801                         MP_WritePhyUshort(sc, 0x06, 0x48e5);
21802                         MP_WritePhyUshort(sc, 0x06, 0xf849);
21803                         MP_WritePhyUshort(sc, 0x06, 0x58f7);
21804                         MP_WritePhyUshort(sc, 0x06, 0xe4f8);
21805                         MP_WritePhyUshort(sc, 0x06, 0x48e5);
21806                         MP_WritePhyUshort(sc, 0x06, 0xf849);
21807                         MP_WritePhyUshort(sc, 0x06, 0xfc04);
21808                         MP_WritePhyUshort(sc, 0x06, 0x4d20);
21809                         MP_WritePhyUshort(sc, 0x06, 0x0002);
21810                         MP_WritePhyUshort(sc, 0x06, 0x4e22);
21811                         MP_WritePhyUshort(sc, 0x06, 0x0002);
21812                         MP_WritePhyUshort(sc, 0x06, 0x4ddf);
21813                         MP_WritePhyUshort(sc, 0x06, 0xff01);
21814                         MP_WritePhyUshort(sc, 0x06, 0x4edd);
21815                         MP_WritePhyUshort(sc, 0x06, 0xff01);
21816                         MP_WritePhyUshort(sc, 0x06, 0xf8fa);
21817                         MP_WritePhyUshort(sc, 0x06, 0xfbef);
21818                         MP_WritePhyUshort(sc, 0x06, 0x79bf);
21819                         MP_WritePhyUshort(sc, 0x06, 0xf822);
21820                         MP_WritePhyUshort(sc, 0x06, 0xd819);
21821                         MP_WritePhyUshort(sc, 0x06, 0xd958);
21822                         MP_WritePhyUshort(sc, 0x06, 0x849f);
21823                         MP_WritePhyUshort(sc, 0x06, 0x09bf);
21824                         MP_WritePhyUshort(sc, 0x06, 0x82be);
21825                         MP_WritePhyUshort(sc, 0x06, 0xd682);
21826                         MP_WritePhyUshort(sc, 0x06, 0xc602);
21827                         MP_WritePhyUshort(sc, 0x06, 0x014f);
21828                         MP_WritePhyUshort(sc, 0x06, 0xef97);
21829                         MP_WritePhyUshort(sc, 0x06, 0xfffe);
21830                         MP_WritePhyUshort(sc, 0x06, 0xfc05);
21831                         MP_WritePhyUshort(sc, 0x06, 0x17ff);
21832                         MP_WritePhyUshort(sc, 0x06, 0xfe01);
21833                         MP_WritePhyUshort(sc, 0x06, 0x1700);
21834                         MP_WritePhyUshort(sc, 0x06, 0x0102);
21835                         MP_WritePhyUshort(sc, 0x05, 0x83d8);
21836                         MP_WritePhyUshort(sc, 0x06, 0x8051);
21837                         MP_WritePhyUshort(sc, 0x05, 0x83d6);
21838                         MP_WritePhyUshort(sc, 0x06, 0x82a0);
21839                         MP_WritePhyUshort(sc, 0x05, 0x83d4);
21840                         MP_WritePhyUshort(sc, 0x06, 0x8000);
21841                         MP_WritePhyUshort(sc, 0x02, 0x2010);
21842                         MP_WritePhyUshort(sc, 0x03, 0xdc00);
21843                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
21844                         MP_WritePhyUshort(sc, 0x0b, 0x0600);
21845                         MP_WritePhyUshort(sc, 0x1f, 0x0005);
21846                         MP_WritePhyUshort(sc, 0x05, 0xfff6);
21847                         MP_WritePhyUshort(sc, 0x06, 0x00fc);
21848                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
21849                 }
21850
21851                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21852                 MP_WritePhyUshort(sc, 0x0D, 0xF880);
21853                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21854         } else if (sc->re_type == MACFG_32) {
21855                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
21856                 MP_WritePhyUshort(sc, 0x06, 0x4064);
21857                 MP_WritePhyUshort(sc, 0x07, 0x2863);
21858                 MP_WritePhyUshort(sc, 0x08, 0x059C);
21859                 MP_WritePhyUshort(sc, 0x09, 0x26B4);
21860                 MP_WritePhyUshort(sc, 0x0A, 0x6A19);
21861                 MP_WritePhyUshort(sc, 0x0B, 0xBCC0);
21862                 MP_WritePhyUshort(sc, 0x10, 0xF06D);
21863                 MP_WritePhyUshort(sc, 0x14, 0x7F68);
21864                 MP_WritePhyUshort(sc, 0x18, 0x7FD9);
21865                 MP_WritePhyUshort(sc, 0x1C, 0xF0FF);
21866                 MP_WritePhyUshort(sc, 0x1D, 0x3D9C);
21867                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
21868                 MP_WritePhyUshort(sc, 0x12, 0xF49F);
21869                 MP_WritePhyUshort(sc, 0x13, 0x070B);
21870                 MP_WritePhyUshort(sc, 0x1A, 0x05AD);
21871                 MP_WritePhyUshort(sc, 0x14, 0x94C0);
21872
21873                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21874                 MP_WritePhyUshort(sc, 0x06, 0x5571);
21875
21876                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21877                 MP_WritePhyUshort(sc, 0x05, 0x2642);
21878
21879                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21880                 MP_WritePhyUshort(sc, 0x02, 0xC107);
21881                 MP_WritePhyUshort(sc, 0x03, 0x1002);
21882
21883                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
21884                 MP_WritePhyUshort(sc, 0x16, 0x0CC0);
21885
21886                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21887                 MP_WritePhyUshort(sc, 0x0F, 0x0017);
21888
21889                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
21890                 MP_WritePhyUshort(sc, 0x05, 0x8200);
21891                 MP_WritePhyUshort(sc, 0x06, 0xF8F9);
21892                 MP_WritePhyUshort(sc, 0x06, 0xFAEF);
21893                 MP_WritePhyUshort(sc, 0x06, 0x59EE);
21894                 MP_WritePhyUshort(sc, 0x06, 0xF8EA);
21895                 MP_WritePhyUshort(sc, 0x06, 0x00EE);
21896                 MP_WritePhyUshort(sc, 0x06, 0xF8EB);
21897                 MP_WritePhyUshort(sc, 0x06, 0x00E0);
21898                 MP_WritePhyUshort(sc, 0x06, 0xF87C);
21899                 MP_WritePhyUshort(sc, 0x06, 0xE1F8);
21900                 MP_WritePhyUshort(sc, 0x06, 0x7D59);
21901                 MP_WritePhyUshort(sc, 0x06, 0x0FEF);
21902                 MP_WritePhyUshort(sc, 0x06, 0x0139);
21903                 MP_WritePhyUshort(sc, 0x06, 0x029E);
21904                 MP_WritePhyUshort(sc, 0x06, 0x06EF);
21905                 MP_WritePhyUshort(sc, 0x06, 0x1039);
21906                 MP_WritePhyUshort(sc, 0x06, 0x089F);
21907                 MP_WritePhyUshort(sc, 0x06, 0x2AEE);
21908                 MP_WritePhyUshort(sc, 0x06, 0xF8EA);
21909                 MP_WritePhyUshort(sc, 0x06, 0x00EE);
21910                 MP_WritePhyUshort(sc, 0x06, 0xF8EB);
21911                 MP_WritePhyUshort(sc, 0x06, 0x01E0);
21912                 MP_WritePhyUshort(sc, 0x06, 0xF87C);
21913                 MP_WritePhyUshort(sc, 0x06, 0xE1F8);
21914                 MP_WritePhyUshort(sc, 0x06, 0x7D58);
21915                 MP_WritePhyUshort(sc, 0x06, 0x409E);
21916                 MP_WritePhyUshort(sc, 0x06, 0x0F39);
21917                 MP_WritePhyUshort(sc, 0x06, 0x46AA);
21918                 MP_WritePhyUshort(sc, 0x06, 0x0BBF);
21919                 MP_WritePhyUshort(sc, 0x06, 0x8251);
21920                 MP_WritePhyUshort(sc, 0x06, 0xD682);
21921                 MP_WritePhyUshort(sc, 0x06, 0x5902);
21922                 MP_WritePhyUshort(sc, 0x06, 0x014F);
21923                 MP_WritePhyUshort(sc, 0x06, 0xAE09);
21924                 MP_WritePhyUshort(sc, 0x06, 0xBF82);
21925                 MP_WritePhyUshort(sc, 0x06, 0x59D6);
21926                 MP_WritePhyUshort(sc, 0x06, 0x8261);
21927                 MP_WritePhyUshort(sc, 0x06, 0x0201);
21928                 MP_WritePhyUshort(sc, 0x06, 0x4FEF);
21929                 MP_WritePhyUshort(sc, 0x06, 0x95FE);
21930                 MP_WritePhyUshort(sc, 0x06, 0xFDFC);
21931                 MP_WritePhyUshort(sc, 0x06, 0x054D);
21932                 MP_WritePhyUshort(sc, 0x06, 0x2000);
21933                 MP_WritePhyUshort(sc, 0x06, 0x024E);
21934                 MP_WritePhyUshort(sc, 0x06, 0x2200);
21935                 MP_WritePhyUshort(sc, 0x06, 0x024D);
21936                 MP_WritePhyUshort(sc, 0x06, 0xDFFF);
21937                 MP_WritePhyUshort(sc, 0x06, 0x014E);
21938                 MP_WritePhyUshort(sc, 0x06, 0xDDFF);
21939                 MP_WritePhyUshort(sc, 0x06, 0x0100);
21940                 MP_WritePhyUshort(sc, 0x02, 0x6010);
21941                 MP_WritePhyUshort(sc, 0x05, 0xFFF6);
21942                 MP_WritePhyUshort(sc, 0x06, 0x00EC);
21943                 MP_WritePhyUshort(sc, 0x05, 0x83D4);
21944                 MP_WritePhyUshort(sc, 0x06, 0x8200);
21945
21946         } else if (sc->re_type == MACFG_33) {
21947                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
21948                 MP_WritePhyUshort(sc, 0x06, 0x4064);
21949                 MP_WritePhyUshort(sc, 0x07, 0x2863);
21950                 MP_WritePhyUshort(sc, 0x08, 0x059C);
21951                 MP_WritePhyUshort(sc, 0x09, 0x26B4);
21952                 MP_WritePhyUshort(sc, 0x0A, 0x6A19);
21953                 MP_WritePhyUshort(sc, 0x0B, 0xDCC8);
21954                 MP_WritePhyUshort(sc, 0x10, 0xF06D);
21955                 MP_WritePhyUshort(sc, 0x14, 0x7F68);
21956                 MP_WritePhyUshort(sc, 0x18, 0x7FD9);
21957                 MP_WritePhyUshort(sc, 0x1C, 0xF0FF);
21958                 MP_WritePhyUshort(sc, 0x1D, 0x3D9C);
21959                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
21960                 MP_WritePhyUshort(sc, 0x12, 0xF49F);
21961                 MP_WritePhyUshort(sc, 0x13, 0x070B);
21962                 MP_WritePhyUshort(sc, 0x1A, 0x05AD);
21963                 MP_WritePhyUshort(sc, 0x14, 0x94C0);
21964
21965                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21966                 MP_WritePhyUshort(sc, 0x06, 0x5561);
21967                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
21968                 MP_WritePhyUshort(sc, 0x05, 0x8332);
21969                 MP_WritePhyUshort(sc, 0x06, 0x5561);
21970
21971                 if (MP_ReadEfuse(sc, 0x01) == 0xb1) {
21972                         MP_WritePhyUshort(sc, 0x1F, 0x0002);
21973                         MP_WritePhyUshort(sc, 0x05, 0x669A);
21974                         MP_WritePhyUshort(sc, 0x1F, 0x0005);
21975                         MP_WritePhyUshort(sc, 0x05, 0x8330);
21976                         MP_WritePhyUshort(sc, 0x06, 0x669A);
21977
21978                         MP_WritePhyUshort(sc, 0x1F, 0x0002);
21979                         Data = MP_ReadPhyUshort(sc, 0x0D);
21980                         if ((Data & 0x00FF) != 0x006C) {
21981                                 Data &= 0xFF00;
21982                                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21983                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x0065);
21984                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x0066);
21985                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x0067);
21986                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x0068);
21987                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x0069);
21988                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x006A);
21989                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x006B);
21990                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x006C);
21991                         }
21992                 } else {
21993                         MP_WritePhyUshort(sc, 0x1F, 0x0002);
21994                         MP_WritePhyUshort(sc, 0x05, 0x2642);
21995                         MP_WritePhyUshort(sc, 0x1F, 0x0005);
21996                         MP_WritePhyUshort(sc, 0x05, 0x8330);
21997                         MP_WritePhyUshort(sc, 0x06, 0x2642);
21998                 }
21999
22000                 if (MP_ReadEfuse(sc, 0x30) == 0x98) {
22001                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
22002                         MP_WritePhyUshort(sc, 0x11, MP_ReadPhyUshort(sc, 0x11) & ~0x02);
22003                         MP_WritePhyUshort(sc, 0x1F, 0x0005);
22004                         MP_WritePhyUshort(sc, 0x01, MP_ReadPhyUshort(sc, 0x01) | 0x200);
22005                 } else if (MP_ReadEfuse(sc, 0x30) == 0x90) {
22006                         MP_WritePhyUshort(sc, 0x1F, 0x0005);
22007                         MP_WritePhyUshort(sc, 0x01, MP_ReadPhyUshort(sc, 0x01) & ~0x200);
22008                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
22009                         MP_WritePhyUshort(sc, 0x16, 0x5101);
22010                 }
22011
22012                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
22013                 Data = MP_ReadPhyUshort(sc, 0x02);
22014                 Data &= ~0x600;
22015                 Data |= 0x100;
22016                 MP_WritePhyUshort(sc, 0x02, Data);
22017                 Data = MP_ReadPhyUshort(sc, 0x03);
22018                 Data &= ~0xE000;
22019                 MP_WritePhyUshort(sc, 0x03, Data);
22020
22021                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
22022                 MP_WritePhyUshort(sc, 0x17, 0x0CC0);
22023
22024                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
22025                 Data = MP_ReadPhyUshort(sc, 0x0F);
22026                 Data |= 0x17;
22027                 MP_WritePhyUshort(sc, 0x0F, Data);
22028
22029                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
22030                 MP_WritePhyUshort(sc, 0x05, 0x001B);
22031                 if (MP_ReadPhyUshort(sc, 0x06) == 0xB300) {
22032                         MP_WritePhyUshort(sc, 0x1f, 0x0005);
22033                         MP_WritePhyUshort(sc, 0x05, 0xfff6);
22034                         MP_WritePhyUshort(sc, 0x06, 0x0080);
22035                         MP_WritePhyUshort(sc, 0x05, 0x8000);
22036                         MP_WritePhyUshort(sc, 0x06, 0xf8f9);
22037                         MP_WritePhyUshort(sc, 0x06, 0xfaee);
22038                         MP_WritePhyUshort(sc, 0x06, 0xf8ea);
22039                         MP_WritePhyUshort(sc, 0x06, 0x00ee);
22040                         MP_WritePhyUshort(sc, 0x06, 0xf8eb);
22041                         MP_WritePhyUshort(sc, 0x06, 0x00e2);
22042                         MP_WritePhyUshort(sc, 0x06, 0xf87c);
22043                         MP_WritePhyUshort(sc, 0x06, 0xe3f8);
22044                         MP_WritePhyUshort(sc, 0x06, 0x7da5);
22045                         MP_WritePhyUshort(sc, 0x06, 0x1111);
22046                         MP_WritePhyUshort(sc, 0x06, 0x12d2);
22047                         MP_WritePhyUshort(sc, 0x06, 0x40d6);
22048                         MP_WritePhyUshort(sc, 0x06, 0x4444);
22049                         MP_WritePhyUshort(sc, 0x06, 0x0281);
22050                         MP_WritePhyUshort(sc, 0x06, 0xc6d2);
22051                         MP_WritePhyUshort(sc, 0x06, 0xa0d6);
22052                         MP_WritePhyUshort(sc, 0x06, 0xaaaa);
22053                         MP_WritePhyUshort(sc, 0x06, 0x0281);
22054                         MP_WritePhyUshort(sc, 0x06, 0xc6ae);
22055                         MP_WritePhyUshort(sc, 0x06, 0x0fa5);
22056                         MP_WritePhyUshort(sc, 0x06, 0x4444);
22057                         MP_WritePhyUshort(sc, 0x06, 0x02ae);
22058                         MP_WritePhyUshort(sc, 0x06, 0x4da5);
22059                         MP_WritePhyUshort(sc, 0x06, 0xaaaa);
22060                         MP_WritePhyUshort(sc, 0x06, 0x02ae);
22061                         MP_WritePhyUshort(sc, 0x06, 0x47af);
22062                         MP_WritePhyUshort(sc, 0x06, 0x81c2);
22063                         MP_WritePhyUshort(sc, 0x06, 0xee83);
22064                         MP_WritePhyUshort(sc, 0x06, 0x4e00);
22065                         MP_WritePhyUshort(sc, 0x06, 0xee83);
22066                         MP_WritePhyUshort(sc, 0x06, 0x4d0f);
22067                         MP_WritePhyUshort(sc, 0x06, 0xee83);
22068                         MP_WritePhyUshort(sc, 0x06, 0x4c0f);
22069                         MP_WritePhyUshort(sc, 0x06, 0xee83);
22070                         MP_WritePhyUshort(sc, 0x06, 0x4f00);
22071                         MP_WritePhyUshort(sc, 0x06, 0xee83);
22072                         MP_WritePhyUshort(sc, 0x06, 0x5100);
22073                         MP_WritePhyUshort(sc, 0x06, 0xee83);
22074                         MP_WritePhyUshort(sc, 0x06, 0x4aff);
22075                         MP_WritePhyUshort(sc, 0x06, 0xee83);
22076                         MP_WritePhyUshort(sc, 0x06, 0x4bff);
22077                         MP_WritePhyUshort(sc, 0x06, 0xe083);
22078                         MP_WritePhyUshort(sc, 0x06, 0x30e1);
22079                         MP_WritePhyUshort(sc, 0x06, 0x8331);
22080                         MP_WritePhyUshort(sc, 0x06, 0x58fe);
22081                         MP_WritePhyUshort(sc, 0x06, 0xe4f8);
22082                         MP_WritePhyUshort(sc, 0x06, 0x8ae5);
22083                         MP_WritePhyUshort(sc, 0x06, 0xf88b);
22084                         MP_WritePhyUshort(sc, 0x06, 0xe083);
22085                         MP_WritePhyUshort(sc, 0x06, 0x32e1);
22086                         MP_WritePhyUshort(sc, 0x06, 0x8333);
22087                         MP_WritePhyUshort(sc, 0x06, 0x590f);
22088                         MP_WritePhyUshort(sc, 0x06, 0xe283);
22089                         MP_WritePhyUshort(sc, 0x06, 0x4d0c);
22090                         MP_WritePhyUshort(sc, 0x06, 0x245a);
22091                         MP_WritePhyUshort(sc, 0x06, 0xf01e);
22092                         MP_WritePhyUshort(sc, 0x06, 0x12e4);
22093                         MP_WritePhyUshort(sc, 0x06, 0xf88c);
22094                         MP_WritePhyUshort(sc, 0x06, 0xe5f8);
22095                         MP_WritePhyUshort(sc, 0x06, 0x8daf);
22096                         MP_WritePhyUshort(sc, 0x06, 0x81c2);
22097                         MP_WritePhyUshort(sc, 0x06, 0xe083);
22098                         MP_WritePhyUshort(sc, 0x06, 0x4f10);
22099                         MP_WritePhyUshort(sc, 0x06, 0xe483);
22100                         MP_WritePhyUshort(sc, 0x06, 0x4fe0);
22101                         MP_WritePhyUshort(sc, 0x06, 0x834e);
22102                         MP_WritePhyUshort(sc, 0x06, 0x7800);
22103                         MP_WritePhyUshort(sc, 0x06, 0x9f0a);
22104                         MP_WritePhyUshort(sc, 0x06, 0xe083);
22105                         MP_WritePhyUshort(sc, 0x06, 0x4fa0);
22106                         MP_WritePhyUshort(sc, 0x06, 0x10a5);
22107                         MP_WritePhyUshort(sc, 0x06, 0xee83);
22108                         MP_WritePhyUshort(sc, 0x06, 0x4e01);
22109                         MP_WritePhyUshort(sc, 0x06, 0xe083);
22110                         MP_WritePhyUshort(sc, 0x06, 0x4e78);
22111                         MP_WritePhyUshort(sc, 0x06, 0x059e);
22112                         MP_WritePhyUshort(sc, 0x06, 0x9ae0);
22113                         MP_WritePhyUshort(sc, 0x06, 0x834e);
22114                         MP_WritePhyUshort(sc, 0x06, 0x7804);
22115                         MP_WritePhyUshort(sc, 0x06, 0x9e10);
22116                         MP_WritePhyUshort(sc, 0x06, 0xe083);
22117                         MP_WritePhyUshort(sc, 0x06, 0x4e78);
22118                         MP_WritePhyUshort(sc, 0x06, 0x039e);
22119                         MP_WritePhyUshort(sc, 0x06, 0x0fe0);
22120                         MP_WritePhyUshort(sc, 0x06, 0x834e);
22121                         MP_WritePhyUshort(sc, 0x06, 0x7801);
22122                         MP_WritePhyUshort(sc, 0x06, 0x9e05);
22123                         MP_WritePhyUshort(sc, 0x06, 0xae0c);
22124                         MP_WritePhyUshort(sc, 0x06, 0xaf81);
22125                         MP_WritePhyUshort(sc, 0x06, 0xa7af);
22126                         MP_WritePhyUshort(sc, 0x06, 0x8152);
22127                         MP_WritePhyUshort(sc, 0x06, 0xaf81);
22128                         MP_WritePhyUshort(sc, 0x06, 0x8baf);
22129                         MP_WritePhyUshort(sc, 0x06, 0x81c2);
22130                         MP_WritePhyUshort(sc, 0x06, 0xee83);
22131                         MP_WritePhyUshort(sc, 0x06, 0x4800);
22132                         MP_WritePhyUshort(sc, 0x06, 0xee83);
22133                         MP_WritePhyUshort(sc, 0x06, 0x4900);
22134                         MP_WritePhyUshort(sc, 0x06, 0xe083);
22135                         MP_WritePhyUshort(sc, 0x06, 0x5110);
22136                         MP_WritePhyUshort(sc, 0x06, 0xe483);
22137                         MP_WritePhyUshort(sc, 0x06, 0x5158);
22138                         MP_WritePhyUshort(sc, 0x06, 0x019f);
22139                         MP_WritePhyUshort(sc, 0x06, 0xead0);
22140                         MP_WritePhyUshort(sc, 0x06, 0x00d1);
22141                         MP_WritePhyUshort(sc, 0x06, 0x801f);
22142                         MP_WritePhyUshort(sc, 0x06, 0x66e2);
22143                         MP_WritePhyUshort(sc, 0x06, 0xf8ea);
22144                         MP_WritePhyUshort(sc, 0x06, 0xe3f8);
22145                         MP_WritePhyUshort(sc, 0x06, 0xeb5a);
22146                         MP_WritePhyUshort(sc, 0x06, 0xf81e);
22147                         MP_WritePhyUshort(sc, 0x06, 0x20e6);
22148                         MP_WritePhyUshort(sc, 0x06, 0xf8ea);
22149                         MP_WritePhyUshort(sc, 0x06, 0xe5f8);
22150                         MP_WritePhyUshort(sc, 0x06, 0xebd3);
22151                         MP_WritePhyUshort(sc, 0x06, 0x02b3);
22152                         MP_WritePhyUshort(sc, 0x06, 0xfee2);
22153                         MP_WritePhyUshort(sc, 0x06, 0xf87c);
22154                         MP_WritePhyUshort(sc, 0x06, 0xef32);
22155                         MP_WritePhyUshort(sc, 0x06, 0x5b80);
22156                         MP_WritePhyUshort(sc, 0x06, 0xe3f8);
22157                         MP_WritePhyUshort(sc, 0x06, 0x7d9e);
22158                         MP_WritePhyUshort(sc, 0x06, 0x037d);
22159                         MP_WritePhyUshort(sc, 0x06, 0xffff);
22160                         MP_WritePhyUshort(sc, 0x06, 0x0d58);
22161                         MP_WritePhyUshort(sc, 0x06, 0x1c55);
22162                         MP_WritePhyUshort(sc, 0x06, 0x1a65);
22163                         MP_WritePhyUshort(sc, 0x06, 0x11a1);
22164                         MP_WritePhyUshort(sc, 0x06, 0x90d3);
22165                         MP_WritePhyUshort(sc, 0x06, 0xe283);
22166                         MP_WritePhyUshort(sc, 0x06, 0x48e3);
22167                         MP_WritePhyUshort(sc, 0x06, 0x8349);
22168                         MP_WritePhyUshort(sc, 0x06, 0x1b56);
22169                         MP_WritePhyUshort(sc, 0x06, 0xab08);
22170                         MP_WritePhyUshort(sc, 0x06, 0xef56);
22171                         MP_WritePhyUshort(sc, 0x06, 0xe683);
22172                         MP_WritePhyUshort(sc, 0x06, 0x48e7);
22173                         MP_WritePhyUshort(sc, 0x06, 0x8349);
22174                         MP_WritePhyUshort(sc, 0x06, 0x10d1);
22175                         MP_WritePhyUshort(sc, 0x06, 0x801f);
22176                         MP_WritePhyUshort(sc, 0x06, 0x66a0);
22177                         MP_WritePhyUshort(sc, 0x06, 0x04b9);
22178                         MP_WritePhyUshort(sc, 0x06, 0xe283);
22179                         MP_WritePhyUshort(sc, 0x06, 0x48e3);
22180                         MP_WritePhyUshort(sc, 0x06, 0x8349);
22181                         MP_WritePhyUshort(sc, 0x06, 0xef65);
22182                         MP_WritePhyUshort(sc, 0x06, 0xe283);
22183                         MP_WritePhyUshort(sc, 0x06, 0x4ae3);
22184                         MP_WritePhyUshort(sc, 0x06, 0x834b);
22185                         MP_WritePhyUshort(sc, 0x06, 0x1b56);
22186                         MP_WritePhyUshort(sc, 0x06, 0xaa0e);
22187                         MP_WritePhyUshort(sc, 0x06, 0xef56);
22188                         MP_WritePhyUshort(sc, 0x06, 0xe683);
22189                         MP_WritePhyUshort(sc, 0x06, 0x4ae7);
22190                         MP_WritePhyUshort(sc, 0x06, 0x834b);
22191                         MP_WritePhyUshort(sc, 0x06, 0xe283);
22192                         MP_WritePhyUshort(sc, 0x06, 0x4de6);
22193                         MP_WritePhyUshort(sc, 0x06, 0x834c);
22194                         MP_WritePhyUshort(sc, 0x06, 0xe083);
22195                         MP_WritePhyUshort(sc, 0x06, 0x4da0);
22196                         MP_WritePhyUshort(sc, 0x06, 0x000c);
22197                         MP_WritePhyUshort(sc, 0x06, 0xaf81);
22198                         MP_WritePhyUshort(sc, 0x06, 0x8be0);
22199                         MP_WritePhyUshort(sc, 0x06, 0x834d);
22200                         MP_WritePhyUshort(sc, 0x06, 0x10e4);
22201                         MP_WritePhyUshort(sc, 0x06, 0x834d);
22202                         MP_WritePhyUshort(sc, 0x06, 0xae04);
22203                         MP_WritePhyUshort(sc, 0x06, 0x80e4);
22204                         MP_WritePhyUshort(sc, 0x06, 0x834d);
22205                         MP_WritePhyUshort(sc, 0x06, 0xe083);
22206                         MP_WritePhyUshort(sc, 0x06, 0x4e78);
22207                         MP_WritePhyUshort(sc, 0x06, 0x039e);
22208                         MP_WritePhyUshort(sc, 0x06, 0x0be0);
22209                         MP_WritePhyUshort(sc, 0x06, 0x834e);
22210                         MP_WritePhyUshort(sc, 0x06, 0x7804);
22211                         MP_WritePhyUshort(sc, 0x06, 0x9e04);
22212                         MP_WritePhyUshort(sc, 0x06, 0xee83);
22213                         MP_WritePhyUshort(sc, 0x06, 0x4e02);
22214                         MP_WritePhyUshort(sc, 0x06, 0xe083);
22215                         MP_WritePhyUshort(sc, 0x06, 0x32e1);
22216                         MP_WritePhyUshort(sc, 0x06, 0x8333);
22217                         MP_WritePhyUshort(sc, 0x06, 0x590f);
22218                         MP_WritePhyUshort(sc, 0x06, 0xe283);
22219                         MP_WritePhyUshort(sc, 0x06, 0x4d0c);
22220                         MP_WritePhyUshort(sc, 0x06, 0x245a);
22221                         MP_WritePhyUshort(sc, 0x06, 0xf01e);
22222                         MP_WritePhyUshort(sc, 0x06, 0x12e4);
22223                         MP_WritePhyUshort(sc, 0x06, 0xf88c);
22224                         MP_WritePhyUshort(sc, 0x06, 0xe5f8);
22225                         MP_WritePhyUshort(sc, 0x06, 0x8de0);
22226                         MP_WritePhyUshort(sc, 0x06, 0x8330);
22227                         MP_WritePhyUshort(sc, 0x06, 0xe183);
22228                         MP_WritePhyUshort(sc, 0x06, 0x3168);
22229                         MP_WritePhyUshort(sc, 0x06, 0x01e4);
22230                         MP_WritePhyUshort(sc, 0x06, 0xf88a);
22231                         MP_WritePhyUshort(sc, 0x06, 0xe5f8);
22232                         MP_WritePhyUshort(sc, 0x06, 0x8bae);
22233                         MP_WritePhyUshort(sc, 0x06, 0x37ee);
22234                         MP_WritePhyUshort(sc, 0x06, 0x834e);
22235                         MP_WritePhyUshort(sc, 0x06, 0x03e0);
22236                         MP_WritePhyUshort(sc, 0x06, 0x834c);
22237                         MP_WritePhyUshort(sc, 0x06, 0xe183);
22238                         MP_WritePhyUshort(sc, 0x06, 0x4d1b);
22239                         MP_WritePhyUshort(sc, 0x06, 0x019e);
22240                         MP_WritePhyUshort(sc, 0x06, 0x04aa);
22241                         MP_WritePhyUshort(sc, 0x06, 0xa1ae);
22242                         MP_WritePhyUshort(sc, 0x06, 0xa8ee);
22243                         MP_WritePhyUshort(sc, 0x06, 0x834e);
22244                         MP_WritePhyUshort(sc, 0x06, 0x04ee);
22245                         MP_WritePhyUshort(sc, 0x06, 0x834f);
22246                         MP_WritePhyUshort(sc, 0x06, 0x00ae);
22247                         MP_WritePhyUshort(sc, 0x06, 0xabe0);
22248                         MP_WritePhyUshort(sc, 0x06, 0x834f);
22249                         MP_WritePhyUshort(sc, 0x06, 0x7803);
22250                         MP_WritePhyUshort(sc, 0x06, 0x9f14);
22251                         MP_WritePhyUshort(sc, 0x06, 0xee83);
22252                         MP_WritePhyUshort(sc, 0x06, 0x4e05);
22253                         MP_WritePhyUshort(sc, 0x06, 0xd240);
22254                         MP_WritePhyUshort(sc, 0x06, 0xd655);
22255                         MP_WritePhyUshort(sc, 0x06, 0x5402);
22256                         MP_WritePhyUshort(sc, 0x06, 0x81c6);
22257                         MP_WritePhyUshort(sc, 0x06, 0xd2a0);
22258                         MP_WritePhyUshort(sc, 0x06, 0xd6ba);
22259                         MP_WritePhyUshort(sc, 0x06, 0x0002);
22260                         MP_WritePhyUshort(sc, 0x06, 0x81c6);
22261                         MP_WritePhyUshort(sc, 0x06, 0xfefd);
22262                         MP_WritePhyUshort(sc, 0x06, 0xfc05);
22263                         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
22264                         MP_WritePhyUshort(sc, 0x06, 0xf860);
22265                         MP_WritePhyUshort(sc, 0x06, 0xe1f8);
22266                         MP_WritePhyUshort(sc, 0x06, 0x6168);
22267                         MP_WritePhyUshort(sc, 0x06, 0x02e4);
22268                         MP_WritePhyUshort(sc, 0x06, 0xf860);
22269                         MP_WritePhyUshort(sc, 0x06, 0xe5f8);
22270                         MP_WritePhyUshort(sc, 0x06, 0x61e0);
22271                         MP_WritePhyUshort(sc, 0x06, 0xf848);
22272                         MP_WritePhyUshort(sc, 0x06, 0xe1f8);
22273                         MP_WritePhyUshort(sc, 0x06, 0x4958);
22274                         MP_WritePhyUshort(sc, 0x06, 0x0f1e);
22275                         MP_WritePhyUshort(sc, 0x06, 0x02e4);
22276                         MP_WritePhyUshort(sc, 0x06, 0xf848);
22277                         MP_WritePhyUshort(sc, 0x06, 0xe5f8);
22278                         MP_WritePhyUshort(sc, 0x06, 0x49d0);
22279                         MP_WritePhyUshort(sc, 0x06, 0x0002);
22280                         MP_WritePhyUshort(sc, 0x06, 0x820a);
22281                         MP_WritePhyUshort(sc, 0x06, 0xbf83);
22282                         MP_WritePhyUshort(sc, 0x06, 0x50ef);
22283                         MP_WritePhyUshort(sc, 0x06, 0x46dc);
22284                         MP_WritePhyUshort(sc, 0x06, 0x19dd);
22285                         MP_WritePhyUshort(sc, 0x06, 0xd001);
22286                         MP_WritePhyUshort(sc, 0x06, 0x0282);
22287                         MP_WritePhyUshort(sc, 0x06, 0x0a02);
22288                         MP_WritePhyUshort(sc, 0x06, 0x8226);
22289                         MP_WritePhyUshort(sc, 0x06, 0xe0f8);
22290                         MP_WritePhyUshort(sc, 0x06, 0x60e1);
22291                         MP_WritePhyUshort(sc, 0x06, 0xf861);
22292                         MP_WritePhyUshort(sc, 0x06, 0x58fd);
22293                         MP_WritePhyUshort(sc, 0x06, 0xe4f8);
22294                         MP_WritePhyUshort(sc, 0x06, 0x60e5);
22295                         MP_WritePhyUshort(sc, 0x06, 0xf861);
22296                         MP_WritePhyUshort(sc, 0x06, 0xfc04);
22297                         MP_WritePhyUshort(sc, 0x06, 0xf9fa);
22298                         MP_WritePhyUshort(sc, 0x06, 0xfbc6);
22299                         MP_WritePhyUshort(sc, 0x06, 0xbff8);
22300                         MP_WritePhyUshort(sc, 0x06, 0x40be);
22301                         MP_WritePhyUshort(sc, 0x06, 0x8350);
22302                         MP_WritePhyUshort(sc, 0x06, 0xa001);
22303                         MP_WritePhyUshort(sc, 0x06, 0x0107);
22304                         MP_WritePhyUshort(sc, 0x06, 0x1b89);
22305                         MP_WritePhyUshort(sc, 0x06, 0xcfd2);
22306                         MP_WritePhyUshort(sc, 0x06, 0x08eb);
22307                         MP_WritePhyUshort(sc, 0x06, 0xdb19);
22308                         MP_WritePhyUshort(sc, 0x06, 0xb2fb);
22309                         MP_WritePhyUshort(sc, 0x06, 0xfffe);
22310                         MP_WritePhyUshort(sc, 0x06, 0xfd04);
22311                         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
22312                         MP_WritePhyUshort(sc, 0x06, 0xf848);
22313                         MP_WritePhyUshort(sc, 0x06, 0xe1f8);
22314                         MP_WritePhyUshort(sc, 0x06, 0x4968);
22315                         MP_WritePhyUshort(sc, 0x06, 0x08e4);
22316                         MP_WritePhyUshort(sc, 0x06, 0xf848);
22317                         MP_WritePhyUshort(sc, 0x06, 0xe5f8);
22318                         MP_WritePhyUshort(sc, 0x06, 0x4958);
22319                         MP_WritePhyUshort(sc, 0x06, 0xf7e4);
22320                         MP_WritePhyUshort(sc, 0x06, 0xf848);
22321                         MP_WritePhyUshort(sc, 0x06, 0xe5f8);
22322                         MP_WritePhyUshort(sc, 0x06, 0x49fc);
22323                         MP_WritePhyUshort(sc, 0x06, 0x044d);
22324                         MP_WritePhyUshort(sc, 0x06, 0x2000);
22325                         MP_WritePhyUshort(sc, 0x06, 0x024e);
22326                         MP_WritePhyUshort(sc, 0x06, 0x2200);
22327                         MP_WritePhyUshort(sc, 0x06, 0x024d);
22328                         MP_WritePhyUshort(sc, 0x06, 0xdfff);
22329                         MP_WritePhyUshort(sc, 0x06, 0x014e);
22330                         MP_WritePhyUshort(sc, 0x06, 0xddff);
22331                         MP_WritePhyUshort(sc, 0x06, 0x01f8);
22332                         MP_WritePhyUshort(sc, 0x06, 0xfafb);
22333                         MP_WritePhyUshort(sc, 0x06, 0xef79);
22334                         MP_WritePhyUshort(sc, 0x06, 0xbff8);
22335                         MP_WritePhyUshort(sc, 0x06, 0x22d8);
22336                         MP_WritePhyUshort(sc, 0x06, 0x19d9);
22337                         MP_WritePhyUshort(sc, 0x06, 0x5884);
22338                         MP_WritePhyUshort(sc, 0x06, 0x9f09);
22339                         MP_WritePhyUshort(sc, 0x06, 0xbf82);
22340                         MP_WritePhyUshort(sc, 0x06, 0x6dd6);
22341                         MP_WritePhyUshort(sc, 0x06, 0x8275);
22342                         MP_WritePhyUshort(sc, 0x06, 0x0201);
22343                         MP_WritePhyUshort(sc, 0x06, 0x4fef);
22344                         MP_WritePhyUshort(sc, 0x06, 0x97ff);
22345                         MP_WritePhyUshort(sc, 0x06, 0xfefc);
22346                         MP_WritePhyUshort(sc, 0x06, 0x0517);
22347                         MP_WritePhyUshort(sc, 0x06, 0xfffe);
22348                         MP_WritePhyUshort(sc, 0x06, 0x0117);
22349                         MP_WritePhyUshort(sc, 0x06, 0x0001);
22350                         MP_WritePhyUshort(sc, 0x06, 0x0200);
22351                         MP_WritePhyUshort(sc, 0x05, 0x83d8);
22352                         MP_WritePhyUshort(sc, 0x06, 0x8000);
22353                         MP_WritePhyUshort(sc, 0x05, 0x83d6);
22354                         MP_WritePhyUshort(sc, 0x06, 0x824f);
22355                         MP_WritePhyUshort(sc, 0x02, 0x2010);
22356                         MP_WritePhyUshort(sc, 0x03, 0xdc00);
22357                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
22358                         MP_WritePhyUshort(sc, 0x0b, 0x0600);
22359                         MP_WritePhyUshort(sc, 0x1f, 0x0005);
22360                         MP_WritePhyUshort(sc, 0x05, 0xfff6);
22361                         MP_WritePhyUshort(sc, 0x06, 0x00fc);
22362                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
22363                 }
22364
22365                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22366                 MP_WritePhyUshort(sc, 0x0D, 0xF880);
22367                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22368         } else if (sc->re_type == MACFG_36 || sc->re_type == MACFG_37) {
22369                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
22370                 MP_WritePhyUshort(sc, 0x1E, 0x0023);
22371                 Data = MP_ReadPhyUshort(sc, 0x17) | 0x0006;
22372                 if (sc->RequiredSecLanDonglePatch)
22373                         Data &= ~(BIT_2);
22374                 else
22375                         Data |= (BIT_2);
22376                 MP_WritePhyUshort(sc, 0x17, Data);
22377                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22378
22379                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
22380                 MP_WritePhyUshort(sc, 0x05, 0x8b80);
22381                 MP_WritePhyUshort(sc, 0x06, 0xc896);
22382                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
22383
22384                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
22385                 MP_WritePhyUshort(sc, 0x0B, 0x6C20);
22386                 MP_WritePhyUshort(sc, 0x07, 0x2872);
22387                 MP_WritePhyUshort(sc, 0x1C, 0xEFFF);
22388                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
22389                 MP_WritePhyUshort(sc, 0x14, 0x6420);
22390                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22391
22392                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
22393                 Data = MP_ReadPhyUshort(sc, 0x08) & 0x00FF;
22394                 MP_WritePhyUshort(sc, 0x08, Data | 0x8000);
22395
22396                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
22397                 MP_WritePhyUshort(sc, 0x1E, 0x002D);
22398                 Data = MP_ReadPhyUshort(sc, 0x18);
22399                 MP_WritePhyUshort(sc, 0x18, Data | 0x0050);
22400                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22401                 Data = MP_ReadPhyUshort(sc, 0x14);
22402                 MP_WritePhyUshort(sc, 0x14, Data | 0x8000);
22403
22404                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
22405                 MP_WritePhyUshort(sc, 0x00, 0x080B);
22406                 MP_WritePhyUshort(sc, 0x0B, 0x09D7);
22407                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
22408                 MP_WritePhyUshort(sc, 0x15, 0x1006);
22409
22410                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
22411                 MP_WritePhyUshort(sc, 0x1E, 0x002F);
22412                 MP_WritePhyUshort(sc, 0x15, 0x1919);
22413                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22414
22415                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
22416                 MP_WritePhyUshort(sc, 0x19, 0x7F46);
22417                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
22418                 MP_WritePhyUshort(sc, 0x05, 0x8AD2);
22419                 MP_WritePhyUshort(sc, 0x06, 0x6810);
22420                 MP_WritePhyUshort(sc, 0x05, 0x8AD4);
22421                 MP_WritePhyUshort(sc, 0x06, 0x8002);
22422                 MP_WritePhyUshort(sc, 0x05, 0x8ADE);
22423                 MP_WritePhyUshort(sc, 0x06, 0x8025);
22424                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22425         } else if (sc->re_type == MACFG_38) {
22426                 CSR_WRITE_1(sc, 0x6E, CSR_READ_1(sc, 0x6E)| (1<<6));
22427
22428                 Data_u32 = re_eri_read(sc, 0x1D0, 4, ERIAR_ExGMAC);
22429                 Data_u32 &= ~BIT_1;
22430                 re_eri_write(sc, 0x1D0, 4, Data_u32, ERIAR_ExGMAC);
22431
22432                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
22433                 MP_WritePhyUshort(sc, 0x05, 0x8B80);
22434                 Data = MP_ReadPhyUshort(sc, 0x06);
22435                 Data |= BIT_2 | BIT_1;
22436                 MP_WritePhyUshort(sc, 0x06, Data);
22437                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
22438
22439                 MP_WritePhyUshort(sc, 0x1f, 0x0004);
22440                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
22441                 MP_WritePhyUshort(sc, 0x1e, 0x002D);
22442                 Data = MP_ReadPhyUshort(sc, 0x18);
22443                 Data |= BIT_4;
22444                 MP_WritePhyUshort(sc, 0x18, Data);
22445                 MP_WritePhyUshort(sc, 0x1f, 0x0002);
22446                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
22447                 Data = MP_ReadPhyUshort(sc, 0x14);
22448                 Data |= BIT_15;
22449                 MP_WritePhyUshort(sc, 0x14, Data);
22450
22451                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
22452                 MP_WritePhyUshort(sc, 0x05, 0x8B86);
22453                 Data = MP_ReadPhyUshort(sc, 0x06);
22454                 Data |= BIT_0;
22455                 MP_WritePhyUshort(sc, 0x06, Data);
22456                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22457
22458                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
22459                 MP_WritePhyUshort(sc, 0x0B, 0x6C14);
22460                 MP_WritePhyUshort(sc, 0x14, 0x7F3D);
22461                 MP_WritePhyUshort(sc, 0x1C, 0xFAFE);
22462                 MP_WritePhyUshort(sc, 0x08, 0x07C5);
22463                 MP_WritePhyUshort(sc, 0x10, 0xF090);
22464                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
22465                 MP_WritePhyUshort(sc, 0x14, 0x641A);
22466                 MP_WritePhyUshort(sc, 0x1A, 0x0606);
22467                 MP_WritePhyUshort(sc, 0x12, 0xF480);
22468                 MP_WritePhyUshort(sc, 0x13, 0x0747);
22469                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22470
22471                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
22472                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
22473                 MP_WritePhyUshort(sc, 0x1E, 0x0078);
22474                 MP_WritePhyUshort(sc, 0x15, 0xA408);
22475                 MP_WritePhyUshort(sc, 0x17, 0x5100);
22476                 MP_WritePhyUshort(sc, 0x19, 0x0008);
22477                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
22478                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22479
22480                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
22481                 MP_WritePhyUshort(sc, 0x0D, 0x0207);
22482                 MP_WritePhyUshort(sc, 0x02, 0x5FD0);
22483                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22484
22485                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
22486                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
22487                 MP_WritePhyUshort(sc, 0x1E, 0x00A1);
22488                 Data = MP_ReadPhyUshort(sc, 0x1A);
22489                 Data &= ~BIT_2;
22490                 MP_WritePhyUshort(sc, 0x1A, Data);
22491                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
22492                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22493
22494                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
22495                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
22496                 MP_WritePhyUshort(sc, 0x1E, 0x002D);
22497                 Data = MP_ReadPhyUshort(sc, 0x16);
22498                 Data |= BIT_5;
22499                 MP_WritePhyUshort(sc, 0x16, Data);
22500                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
22501                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22502
22503                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
22504                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
22505                 MP_WritePhyUshort(sc, 0x1E, 0x00AC);
22506                 MP_WritePhyUshort(sc, 0x18, 0x0006);
22507                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
22508                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22509
22510                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
22511                 MP_WritePhyUshort(sc, 0x09, 0xA20F);
22512                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22513
22514                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
22515                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
22516                 Data = MP_ReadPhyUshort(sc, 0x06);
22517                 Data |= BIT_14;
22518                 MP_WritePhyUshort(sc, 0x06, Data);
22519                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22520
22521                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
22522                 MP_WritePhyUshort(sc, 0x05, 0x8B54);
22523                 Data = MP_ReadPhyUshort(sc, 0x06);
22524                 Data &= ~BIT_11;
22525                 MP_WritePhyUshort(sc, 0x06, Data);
22526                 MP_WritePhyUshort(sc, 0x05, 0x8B5D);
22527                 Data = MP_ReadPhyUshort(sc, 0x06);
22528                 Data &= ~BIT_11;
22529                 MP_WritePhyUshort(sc, 0x06, Data);
22530                 MP_WritePhyUshort(sc, 0x05, 0x8A7C);
22531                 Data = MP_ReadPhyUshort(sc, 0x06);
22532                 Data &= ~BIT_8;
22533                 MP_WritePhyUshort(sc, 0x06, Data);
22534                 MP_WritePhyUshort(sc, 0x05, 0x8A7F);
22535                 Data = MP_ReadPhyUshort(sc, 0x06);
22536                 Data |= BIT_8;
22537                 MP_WritePhyUshort(sc, 0x06, Data);
22538                 MP_WritePhyUshort(sc, 0x05, 0x8A82);
22539                 Data = MP_ReadPhyUshort(sc, 0x06);
22540                 Data &= ~BIT_8;
22541                 MP_WritePhyUshort(sc, 0x06, Data);
22542                 MP_WritePhyUshort(sc, 0x05, 0x8A85);
22543                 Data = MP_ReadPhyUshort(sc, 0x06);
22544                 Data &= ~BIT_8;
22545                 MP_WritePhyUshort(sc, 0x06, Data);
22546                 MP_WritePhyUshort(sc, 0x05, 0x8A88);
22547                 Data = MP_ReadPhyUshort(sc, 0x06);
22548                 Data &= ~BIT_8;
22549                 MP_WritePhyUshort(sc, 0x06, Data);
22550                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22551
22552                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
22553                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
22554                 Data = MP_ReadPhyUshort(sc, 0x06);
22555                 Data |= BIT_15;
22556                 MP_WritePhyUshort(sc, 0x06, Data);
22557                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
22558
22559                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
22560                 Data = MP_ReadPhyUshort(sc, 0x19);
22561                 Data &= ~BIT_0;
22562                 MP_WritePhyUshort(sc, 0x19, Data);
22563                 Data = MP_ReadPhyUshort(sc, 0x10);
22564                 Data &= ~BIT_10;
22565                 MP_WritePhyUshort(sc, 0x10, Data);
22566                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
22567         } else if (sc->re_type == MACFG_39) {
22568                 Data_u32 = re_eri_read(sc, 0x1D0, 4, ERIAR_ExGMAC);
22569                 Data_u32 &= ~BIT_1;
22570                 re_eri_write(sc, 0x1D0, 4, Data_u32, ERIAR_ExGMAC);
22571
22572                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
22573                 MP_WritePhyUshort(sc, 0x05, 0x8B80);
22574                 Data = MP_ReadPhyUshort(sc, 0x06);
22575                 Data |= BIT_2 | BIT_1;
22576                 MP_WritePhyUshort(sc, 0x06, Data);
22577                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
22578
22579                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
22580                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
22581                 Data = MP_ReadPhyUshort(sc, 0x06);
22582                 Data |= BIT_15;
22583                 MP_WritePhyUshort(sc, 0x06, Data);
22584                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
22585
22586                 MP_WritePhyUshort(sc, 0x1f, 0x0004);
22587                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
22588                 MP_WritePhyUshort(sc, 0x1e, 0x002D);
22589                 Data = MP_ReadPhyUshort(sc, 0x18);
22590                 Data |= BIT_4;
22591                 MP_WritePhyUshort(sc, 0x18, Data);
22592                 MP_WritePhyUshort(sc, 0x1f, 0x0002);
22593                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
22594                 Data = MP_ReadPhyUshort(sc, 0x14);
22595                 Data |= BIT_15;
22596                 MP_WritePhyUshort(sc, 0x14, Data);
22597
22598                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
22599                 MP_WritePhyUshort(sc, 0x05, 0x8B86);
22600                 Data = MP_ReadPhyUshort(sc, 0x06);
22601                 Data |= BIT_0;
22602                 MP_WritePhyUshort(sc, 0x06, Data);
22603                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
22604
22605                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
22606                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
22607                 MP_WritePhyUshort(sc, 0x1E, 0x00AC);
22608                 MP_WritePhyUshort(sc, 0x18, 0x0006);
22609                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
22610                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22611
22612                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
22613                 MP_WritePhyUshort(sc, 0x09, 0xA20F);
22614                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22615
22616                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
22617                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
22618                 Data = MP_ReadPhyUshort(sc, 0x06);
22619                 Data |= BIT_14;
22620                 MP_WritePhyUshort(sc, 0x06, Data);
22621                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
22622
22623                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
22624                 MP_WritePhyUshort(sc, 0x05, 0x8B54);
22625                 Data = MP_ReadPhyUshort(sc, 0x06);
22626                 Data &= ~BIT_11;
22627                 MP_WritePhyUshort(sc, 0x06, Data);
22628                 MP_WritePhyUshort(sc, 0x05, 0x8B5D);
22629                 Data = MP_ReadPhyUshort(sc, 0x06);
22630                 Data &= ~BIT_11;
22631                 MP_WritePhyUshort(sc, 0x06, Data);
22632                 MP_WritePhyUshort(sc, 0x05, 0x8A7C);
22633                 Data = MP_ReadPhyUshort(sc, 0x06);
22634                 Data &= ~BIT_8;
22635                 MP_WritePhyUshort(sc, 0x06, Data);
22636                 MP_WritePhyUshort(sc, 0x05, 0x8A7F);
22637                 Data = MP_ReadPhyUshort(sc, 0x06);
22638                 Data |= BIT_8;
22639                 MP_WritePhyUshort(sc, 0x06, Data);
22640                 MP_WritePhyUshort(sc, 0x05, 0x8A82);
22641                 Data = MP_ReadPhyUshort(sc, 0x06);
22642                 Data &= ~BIT_8;
22643                 MP_WritePhyUshort(sc, 0x06, Data);
22644                 MP_WritePhyUshort(sc, 0x05, 0x8A85);
22645                 Data = MP_ReadPhyUshort(sc, 0x06);
22646                 Data &= ~BIT_8;
22647                 MP_WritePhyUshort(sc, 0x06, Data);
22648                 MP_WritePhyUshort(sc, 0x05, 0x8A88);
22649                 Data = MP_ReadPhyUshort(sc, 0x06);
22650                 Data &= ~BIT_8;
22651                 MP_WritePhyUshort(sc, 0x06, Data);
22652                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22653
22654                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
22655                 Data = MP_ReadPhyUshort(sc, 0x19);
22656                 Data &= ~BIT_0;
22657                 MP_WritePhyUshort(sc, 0x19, Data);
22658                 Data = MP_ReadPhyUshort(sc, 0x10);
22659                 Data &= ~BIT_10;
22660                 MP_WritePhyUshort(sc, 0x10, Data);
22661                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
22662         } else if (sc->re_type == MACFG_41) {
22663                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22664                 MP_WritePhyUshort(sc, 0x11, MP_ReadPhyUshort(sc, 0x11) | 0x1000);
22665                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
22666                 MP_WritePhyUshort(sc, 0x0F, MP_ReadPhyUshort(sc, 0x0F) | 0x0003);
22667                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22668
22669                 for (Data_u32=0x800E0068; Data_u32<0x800E006D; Data_u32++) {
22670                         CSR_WRITE_4(sc, 0xF8, Data_u32);
22671                         for (i=0; i<10; i++) {
22672                                 DELAY(400);
22673                                 if ((CSR_READ_4(sc, 0xF8)&0x80000000)==0)
22674                                         break;
22675                         }
22676                 }
22677         } else if (sc->re_type == MACFG_42 || sc->re_type == MACFG_43) {
22678                 Data_u32 = re_eri_read(sc, 0x1D0, 4, ERIAR_ExGMAC);
22679                 Data_u32 &= 0xFFFF0000;
22680                 re_eri_write(sc, 0x1D0, 4, Data_u32, ERIAR_ExGMAC);
22681
22682                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22683                 MP_WritePhyUshort(sc, 0x18, 0x0310);
22684                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
22685
22686                 MP_WritePhyUshort(sc, 0x1f, 0x0004);
22687                 MP_WritePhyUshort(sc, 0x1f, 0x0004);
22688                 MP_WritePhyUshort(sc, 0x19, 0x7070);
22689                 MP_WritePhyUshort(sc, 0x1c, 0x0600);
22690                 MP_WritePhyUshort(sc, 0x1d, 0x9700);
22691                 MP_WritePhyUshort(sc, 0x1d, 0x7d00);
22692                 MP_WritePhyUshort(sc, 0x1d, 0x6900);
22693                 MP_WritePhyUshort(sc, 0x1d, 0x7d00);
22694                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
22695                 MP_WritePhyUshort(sc, 0x1d, 0x4899);
22696                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
22697                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
22698                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
22699                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
22700                 MP_WritePhyUshort(sc, 0x1d, 0x8000);
22701                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
22702                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
22703                 MP_WritePhyUshort(sc, 0x1d, 0x4007);
22704                 MP_WritePhyUshort(sc, 0x1d, 0x4400);
22705                 MP_WritePhyUshort(sc, 0x1d, 0x4800);
22706                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
22707                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
22708                 MP_WritePhyUshort(sc, 0x1d, 0x5310);
22709                 MP_WritePhyUshort(sc, 0x1d, 0x6000);
22710                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
22711                 MP_WritePhyUshort(sc, 0x1d, 0x6736);
22712                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22713                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22714                 MP_WritePhyUshort(sc, 0x1d, 0x571f);
22715                 MP_WritePhyUshort(sc, 0x1d, 0x5ffb);
22716                 MP_WritePhyUshort(sc, 0x1d, 0xaa03);
22717                 MP_WritePhyUshort(sc, 0x1d, 0x5b58);
22718                 MP_WritePhyUshort(sc, 0x1d, 0x301e);
22719                 MP_WritePhyUshort(sc, 0x1d, 0x5b64);
22720                 MP_WritePhyUshort(sc, 0x1d, 0xa6fc);
22721                 MP_WritePhyUshort(sc, 0x1d, 0xdcdb);
22722                 MP_WritePhyUshort(sc, 0x1d, 0x0014);
22723                 MP_WritePhyUshort(sc, 0x1d, 0xd9a9);
22724                 MP_WritePhyUshort(sc, 0x1d, 0x0013);
22725                 MP_WritePhyUshort(sc, 0x1d, 0xd16b);
22726                 MP_WritePhyUshort(sc, 0x1d, 0x0011);
22727                 MP_WritePhyUshort(sc, 0x1d, 0xb40e);
22728                 MP_WritePhyUshort(sc, 0x1d, 0xd06b);
22729                 MP_WritePhyUshort(sc, 0x1d, 0x000c);
22730                 MP_WritePhyUshort(sc, 0x1d, 0xb206);
22731                 MP_WritePhyUshort(sc, 0x1d, 0x7c01);
22732                 MP_WritePhyUshort(sc, 0x1d, 0x5800);
22733                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
22734                 MP_WritePhyUshort(sc, 0x1d, 0x5c00);
22735                 MP_WritePhyUshort(sc, 0x1d, 0x301a);
22736                 MP_WritePhyUshort(sc, 0x1d, 0x7c01);
22737                 MP_WritePhyUshort(sc, 0x1d, 0x5801);
22738                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
22739                 MP_WritePhyUshort(sc, 0x1d, 0x5c04);
22740                 MP_WritePhyUshort(sc, 0x1d, 0x301e);
22741                 MP_WritePhyUshort(sc, 0x1d, 0x314d);
22742                 MP_WritePhyUshort(sc, 0x1d, 0x31f0);
22743                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
22744                 MP_WritePhyUshort(sc, 0x1d, 0x4c20);
22745                 MP_WritePhyUshort(sc, 0x1d, 0x6004);
22746                 MP_WritePhyUshort(sc, 0x1d, 0x5310);
22747                 MP_WritePhyUshort(sc, 0x1d, 0x4833);
22748                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
22749                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
22750                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
22751                 MP_WritePhyUshort(sc, 0x1d, 0x4c08);
22752                 MP_WritePhyUshort(sc, 0x1d, 0x8300);
22753                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
22754                 MP_WritePhyUshort(sc, 0x1d, 0x6600);
22755                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22756                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22757                 MP_WritePhyUshort(sc, 0x1d, 0xb90c);
22758                 MP_WritePhyUshort(sc, 0x1d, 0x30d3);
22759                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
22760                 MP_WritePhyUshort(sc, 0x1d, 0x4de0);
22761                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
22762                 MP_WritePhyUshort(sc, 0x1d, 0x6000);
22763                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
22764                 MP_WritePhyUshort(sc, 0x1d, 0x6736);
22765                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22766                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22767                 MP_WritePhyUshort(sc, 0x1d, 0x5310);
22768                 MP_WritePhyUshort(sc, 0x1d, 0x300b);
22769                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
22770                 MP_WritePhyUshort(sc, 0x1d, 0x4c60);
22771                 MP_WritePhyUshort(sc, 0x1d, 0x6803);
22772                 MP_WritePhyUshort(sc, 0x1d, 0x6520);
22773                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22774                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22775                 MP_WritePhyUshort(sc, 0x1d, 0xaf03);
22776                 MP_WritePhyUshort(sc, 0x1d, 0x6015);
22777                 MP_WritePhyUshort(sc, 0x1d, 0x3059);
22778                 MP_WritePhyUshort(sc, 0x1d, 0x6017);
22779                 MP_WritePhyUshort(sc, 0x1d, 0x57e0);
22780                 MP_WritePhyUshort(sc, 0x1d, 0x580c);
22781                 MP_WritePhyUshort(sc, 0x1d, 0x588c);
22782                 MP_WritePhyUshort(sc, 0x1d, 0x7ffc);
22783                 MP_WritePhyUshort(sc, 0x1d, 0x5fa3);
22784                 MP_WritePhyUshort(sc, 0x1d, 0x4827);
22785                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
22786                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
22787                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
22788                 MP_WritePhyUshort(sc, 0x1d, 0x4c10);
22789                 MP_WritePhyUshort(sc, 0x1d, 0x8400);
22790                 MP_WritePhyUshort(sc, 0x1d, 0x7c30);
22791                 MP_WritePhyUshort(sc, 0x1d, 0x6020);
22792                 MP_WritePhyUshort(sc, 0x1d, 0x48bf);
22793                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
22794                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
22795                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
22796                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
22797                 MP_WritePhyUshort(sc, 0x1d, 0xad09);
22798                 MP_WritePhyUshort(sc, 0x1d, 0x7c03);
22799                 MP_WritePhyUshort(sc, 0x1d, 0x5c03);
22800                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22801                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22802                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22803                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22804                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22805                 MP_WritePhyUshort(sc, 0x1d, 0x4400);
22806                 MP_WritePhyUshort(sc, 0x1d, 0xad2c);
22807                 MP_WritePhyUshort(sc, 0x1d, 0xd6cf);
22808                 MP_WritePhyUshort(sc, 0x1d, 0x0002);
22809                 MP_WritePhyUshort(sc, 0x1d, 0x80f4);
22810                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
22811                 MP_WritePhyUshort(sc, 0x1d, 0x4c80);
22812                 MP_WritePhyUshort(sc, 0x1d, 0x7c20);
22813                 MP_WritePhyUshort(sc, 0x1d, 0x5c20);
22814                 MP_WritePhyUshort(sc, 0x1d, 0x481e);
22815                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
22816                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
22817                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
22818                 MP_WritePhyUshort(sc, 0x1d, 0x4c02);
22819                 MP_WritePhyUshort(sc, 0x1d, 0xad0a);
22820                 MP_WritePhyUshort(sc, 0x1d, 0x7c03);
22821                 MP_WritePhyUshort(sc, 0x1d, 0x5c03);
22822                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22823                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22824                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22825                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22826                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22827                 MP_WritePhyUshort(sc, 0x1d, 0x4400);
22828                 MP_WritePhyUshort(sc, 0x1d, 0x5310);
22829                 MP_WritePhyUshort(sc, 0x1d, 0x8d02);
22830                 MP_WritePhyUshort(sc, 0x1d, 0x4401);
22831                 MP_WritePhyUshort(sc, 0x1d, 0x81f4);
22832                 MP_WritePhyUshort(sc, 0x1d, 0x3114);
22833                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
22834                 MP_WritePhyUshort(sc, 0x1d, 0x4d00);
22835                 MP_WritePhyUshort(sc, 0x1d, 0x4832);
22836                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
22837                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
22838                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
22839                 MP_WritePhyUshort(sc, 0x1d, 0x4c10);
22840                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
22841                 MP_WritePhyUshort(sc, 0x1d, 0x6000);
22842                 MP_WritePhyUshort(sc, 0x1d, 0xa4b7);
22843                 MP_WritePhyUshort(sc, 0x1d, 0xd9b3);
22844                 MP_WritePhyUshort(sc, 0x1d, 0xfffe);
22845                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
22846                 MP_WritePhyUshort(sc, 0x1d, 0x4d20);
22847                 MP_WritePhyUshort(sc, 0x1d, 0x7e00);
22848                 MP_WritePhyUshort(sc, 0x1d, 0x6200);
22849                 MP_WritePhyUshort(sc, 0x1d, 0x3045);
22850                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
22851                 MP_WritePhyUshort(sc, 0x1d, 0x4d40);
22852                 MP_WritePhyUshort(sc, 0x1d, 0x7c40);
22853                 MP_WritePhyUshort(sc, 0x1d, 0x6000);
22854                 MP_WritePhyUshort(sc, 0x1d, 0x4401);
22855                 MP_WritePhyUshort(sc, 0x1d, 0x5210);
22856                 MP_WritePhyUshort(sc, 0x1d, 0x4833);
22857                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
22858                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
22859                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
22860                 MP_WritePhyUshort(sc, 0x1d, 0x4c08);
22861                 MP_WritePhyUshort(sc, 0x1d, 0x8300);
22862                 MP_WritePhyUshort(sc, 0x1d, 0x5f80);
22863                 MP_WritePhyUshort(sc, 0x1d, 0x55e0);
22864                 MP_WritePhyUshort(sc, 0x1d, 0xc06f);
22865                 MP_WritePhyUshort(sc, 0x1d, 0x0005);
22866                 MP_WritePhyUshort(sc, 0x1d, 0xd9b3);
22867                 MP_WritePhyUshort(sc, 0x1d, 0xfffd);
22868                 MP_WritePhyUshort(sc, 0x1d, 0x7c40);
22869                 MP_WritePhyUshort(sc, 0x1d, 0x6040);
22870                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
22871                 MP_WritePhyUshort(sc, 0x1d, 0x4d60);
22872                 MP_WritePhyUshort(sc, 0x1d, 0x57e0);
22873                 MP_WritePhyUshort(sc, 0x1d, 0x4814);
22874                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
22875                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
22876                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
22877                 MP_WritePhyUshort(sc, 0x1d, 0x4c04);
22878                 MP_WritePhyUshort(sc, 0x1d, 0x8200);
22879                 MP_WritePhyUshort(sc, 0x1d, 0x7c03);
22880                 MP_WritePhyUshort(sc, 0x1d, 0x5c03);
22881                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22882                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22883                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22884                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22885                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22886                 MP_WritePhyUshort(sc, 0x1d, 0xad02);
22887                 MP_WritePhyUshort(sc, 0x1d, 0x4400);
22888                 MP_WritePhyUshort(sc, 0x1d, 0xc0e9);
22889                 MP_WritePhyUshort(sc, 0x1d, 0x0003);
22890                 MP_WritePhyUshort(sc, 0x1d, 0xadd8);
22891                 MP_WritePhyUshort(sc, 0x1d, 0x30c6);
22892                 MP_WritePhyUshort(sc, 0x1d, 0x3078);
22893                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
22894                 MP_WritePhyUshort(sc, 0x1d, 0x4dc0);
22895                 MP_WritePhyUshort(sc, 0x1d, 0x6730);
22896                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22897                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22898                 MP_WritePhyUshort(sc, 0x1d, 0xd09d);
22899                 MP_WritePhyUshort(sc, 0x1d, 0x0002);
22900                 MP_WritePhyUshort(sc, 0x1d, 0xb4fe);
22901                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
22902                 MP_WritePhyUshort(sc, 0x1d, 0x4d80);
22903                 MP_WritePhyUshort(sc, 0x1d, 0x6802);
22904                 MP_WritePhyUshort(sc, 0x1d, 0x6600);
22905                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22906                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22907                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
22908                 MP_WritePhyUshort(sc, 0x1d, 0x6000);
22909                 MP_WritePhyUshort(sc, 0x1d, 0x486c);
22910                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
22911                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
22912                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
22913                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
22914                 MP_WritePhyUshort(sc, 0x1d, 0x9503);
22915                 MP_WritePhyUshort(sc, 0x1d, 0x7e00);
22916                 MP_WritePhyUshort(sc, 0x1d, 0x6200);
22917                 MP_WritePhyUshort(sc, 0x1d, 0x571f);
22918                 MP_WritePhyUshort(sc, 0x1d, 0x5fbb);
22919                 MP_WritePhyUshort(sc, 0x1d, 0xaa03);
22920                 MP_WritePhyUshort(sc, 0x1d, 0x5b58);
22921                 MP_WritePhyUshort(sc, 0x1d, 0x30e9);
22922                 MP_WritePhyUshort(sc, 0x1d, 0x5b64);
22923                 MP_WritePhyUshort(sc, 0x1d, 0xcdab);
22924                 MP_WritePhyUshort(sc, 0x1d, 0xff5b);
22925                 MP_WritePhyUshort(sc, 0x1d, 0xcd8d);
22926                 MP_WritePhyUshort(sc, 0x1d, 0xff59);
22927                 MP_WritePhyUshort(sc, 0x1d, 0xd96b);
22928                 MP_WritePhyUshort(sc, 0x1d, 0xff57);
22929                 MP_WritePhyUshort(sc, 0x1d, 0xd0a0);
22930                 MP_WritePhyUshort(sc, 0x1d, 0xffdb);
22931                 MP_WritePhyUshort(sc, 0x1d, 0xcba0);
22932                 MP_WritePhyUshort(sc, 0x1d, 0x0003);
22933                 MP_WritePhyUshort(sc, 0x1d, 0x80f0);
22934                 MP_WritePhyUshort(sc, 0x1d, 0x30f6);
22935                 MP_WritePhyUshort(sc, 0x1d, 0x3109);
22936                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
22937                 MP_WritePhyUshort(sc, 0x1d, 0x4ce0);
22938                 MP_WritePhyUshort(sc, 0x1d, 0x7d30);
22939                 MP_WritePhyUshort(sc, 0x1d, 0x6530);
22940                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22941                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22942                 MP_WritePhyUshort(sc, 0x1d, 0x7ce0);
22943                 MP_WritePhyUshort(sc, 0x1d, 0x5400);
22944                 MP_WritePhyUshort(sc, 0x1d, 0x4832);
22945                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
22946                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
22947                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
22948                 MP_WritePhyUshort(sc, 0x1d, 0x4c08);
22949                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
22950                 MP_WritePhyUshort(sc, 0x1d, 0x6008);
22951                 MP_WritePhyUshort(sc, 0x1d, 0x8300);
22952                 MP_WritePhyUshort(sc, 0x1d, 0xb902);
22953                 MP_WritePhyUshort(sc, 0x1d, 0x30d3);
22954                 MP_WritePhyUshort(sc, 0x1d, 0x308f);
22955                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
22956                 MP_WritePhyUshort(sc, 0x1d, 0x4da0);
22957                 MP_WritePhyUshort(sc, 0x1d, 0x57a0);
22958                 MP_WritePhyUshort(sc, 0x1d, 0x590c);
22959                 MP_WritePhyUshort(sc, 0x1d, 0x5fa2);
22960                 MP_WritePhyUshort(sc, 0x1d, 0xcba4);
22961                 MP_WritePhyUshort(sc, 0x1d, 0x0005);
22962                 MP_WritePhyUshort(sc, 0x1d, 0xcd8d);
22963                 MP_WritePhyUshort(sc, 0x1d, 0x0003);
22964                 MP_WritePhyUshort(sc, 0x1d, 0x80fc);
22965                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
22966                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
22967                 MP_WritePhyUshort(sc, 0x1d, 0x4ca0);
22968                 MP_WritePhyUshort(sc, 0x1d, 0xb603);
22969                 MP_WritePhyUshort(sc, 0x1d, 0x7c10);
22970                 MP_WritePhyUshort(sc, 0x1d, 0x6010);
22971                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
22972                 MP_WritePhyUshort(sc, 0x1d, 0x541f);
22973                 MP_WritePhyUshort(sc, 0x1d, 0x7ffc);
22974                 MP_WritePhyUshort(sc, 0x1d, 0x5fb3);
22975                 MP_WritePhyUshort(sc, 0x1d, 0x9403);
22976                 MP_WritePhyUshort(sc, 0x1d, 0x7c03);
22977                 MP_WritePhyUshort(sc, 0x1d, 0x5c03);
22978                 MP_WritePhyUshort(sc, 0x1d, 0xaa05);
22979                 MP_WritePhyUshort(sc, 0x1d, 0x7c80);
22980                 MP_WritePhyUshort(sc, 0x1d, 0x5800);
22981                 MP_WritePhyUshort(sc, 0x1d, 0x5b58);
22982                 MP_WritePhyUshort(sc, 0x1d, 0x3128);
22983                 MP_WritePhyUshort(sc, 0x1d, 0x7c80);
22984                 MP_WritePhyUshort(sc, 0x1d, 0x5800);
22985                 MP_WritePhyUshort(sc, 0x1d, 0x5b64);
22986                 MP_WritePhyUshort(sc, 0x1d, 0x4827);
22987                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
22988                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
22989                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
22990                 MP_WritePhyUshort(sc, 0x1d, 0x4c10);
22991                 MP_WritePhyUshort(sc, 0x1d, 0x8400);
22992                 MP_WritePhyUshort(sc, 0x1d, 0x7c10);
22993                 MP_WritePhyUshort(sc, 0x1d, 0x6000);
22994                 MP_WritePhyUshort(sc, 0x1d, 0x4824);
22995                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
22996                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
22997                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
22998                 MP_WritePhyUshort(sc, 0x1d, 0x4c04);
22999                 MP_WritePhyUshort(sc, 0x1d, 0x8200);
23000                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23001                 MP_WritePhyUshort(sc, 0x1d, 0x4cc0);
23002                 MP_WritePhyUshort(sc, 0x1d, 0x7d00);
23003                 MP_WritePhyUshort(sc, 0x1d, 0x6400);
23004                 MP_WritePhyUshort(sc, 0x1d, 0x7ffc);
23005                 MP_WritePhyUshort(sc, 0x1d, 0x5fbb);
23006                 MP_WritePhyUshort(sc, 0x1d, 0x4824);
23007                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23008                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
23009                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23010                 MP_WritePhyUshort(sc, 0x1d, 0x4c04);
23011                 MP_WritePhyUshort(sc, 0x1d, 0x8200);
23012                 MP_WritePhyUshort(sc, 0x1d, 0x7e00);
23013                 MP_WritePhyUshort(sc, 0x1d, 0x6a00);
23014                 MP_WritePhyUshort(sc, 0x1d, 0x4824);
23015                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23016                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
23017                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23018                 MP_WritePhyUshort(sc, 0x1d, 0x4c04);
23019                 MP_WritePhyUshort(sc, 0x1d, 0x8200);
23020                 MP_WritePhyUshort(sc, 0x1d, 0x7e00);
23021                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
23022                 MP_WritePhyUshort(sc, 0x1d, 0x30f6);
23023                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23024                 MP_WritePhyUshort(sc, 0x1d, 0x4e00);
23025                 MP_WritePhyUshort(sc, 0x1d, 0x4007);
23026                 MP_WritePhyUshort(sc, 0x1d, 0x4400);
23027                 MP_WritePhyUshort(sc, 0x1d, 0x5310);
23028                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
23029                 MP_WritePhyUshort(sc, 0x1d, 0x6736);
23030                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23031                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23032                 MP_WritePhyUshort(sc, 0x1d, 0x570f);
23033                 MP_WritePhyUshort(sc, 0x1d, 0x5fff);
23034                 MP_WritePhyUshort(sc, 0x1d, 0xaa03);
23035                 MP_WritePhyUshort(sc, 0x1d, 0x585b);
23036                 MP_WritePhyUshort(sc, 0x1d, 0x315c);
23037                 MP_WritePhyUshort(sc, 0x1d, 0x5867);
23038                 MP_WritePhyUshort(sc, 0x1d, 0x9402);
23039                 MP_WritePhyUshort(sc, 0x1d, 0x6200);
23040                 MP_WritePhyUshort(sc, 0x1d, 0xcda3);
23041                 MP_WritePhyUshort(sc, 0x1d, 0x009d);
23042                 MP_WritePhyUshort(sc, 0x1d, 0xcd85);
23043                 MP_WritePhyUshort(sc, 0x1d, 0x009b);
23044                 MP_WritePhyUshort(sc, 0x1d, 0xd96b);
23045                 MP_WritePhyUshort(sc, 0x1d, 0x0099);
23046                 MP_WritePhyUshort(sc, 0x1d, 0x96e9);
23047                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
23048                 MP_WritePhyUshort(sc, 0x1d, 0x6736);
23049                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23050                 MP_WritePhyUshort(sc, 0x1d, 0x4e20);
23051                 MP_WritePhyUshort(sc, 0x1d, 0x96e4);
23052                 MP_WritePhyUshort(sc, 0x1d, 0x8b04);
23053                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
23054                 MP_WritePhyUshort(sc, 0x1d, 0x5008);
23055                 MP_WritePhyUshort(sc, 0x1d, 0xab03);
23056                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
23057                 MP_WritePhyUshort(sc, 0x1d, 0x5000);
23058                 MP_WritePhyUshort(sc, 0x1d, 0x6801);
23059                 MP_WritePhyUshort(sc, 0x1d, 0x6776);
23060                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23061                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23062                 MP_WritePhyUshort(sc, 0x1d, 0xdb7c);
23063                 MP_WritePhyUshort(sc, 0x1d, 0xfff0);
23064                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23065                 MP_WritePhyUshort(sc, 0x1d, 0x7fe1);
23066                 MP_WritePhyUshort(sc, 0x1d, 0x4e40);
23067                 MP_WritePhyUshort(sc, 0x1d, 0x4837);
23068                 MP_WritePhyUshort(sc, 0x1d, 0x4418);
23069                 MP_WritePhyUshort(sc, 0x1d, 0x41c7);
23070                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23071                 MP_WritePhyUshort(sc, 0x1d, 0x4e40);
23072                 MP_WritePhyUshort(sc, 0x1d, 0x7c40);
23073                 MP_WritePhyUshort(sc, 0x1d, 0x5400);
23074                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23075                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
23076                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23077                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
23078                 MP_WritePhyUshort(sc, 0x1d, 0x8fc9);
23079                 MP_WritePhyUshort(sc, 0x1d, 0xd2a0);
23080                 MP_WritePhyUshort(sc, 0x1d, 0x004a);
23081                 MP_WritePhyUshort(sc, 0x1d, 0x9203);
23082                 MP_WritePhyUshort(sc, 0x1d, 0xa041);
23083                 MP_WritePhyUshort(sc, 0x1d, 0x3184);
23084                 MP_WritePhyUshort(sc, 0x1d, 0x7fe1);
23085                 MP_WritePhyUshort(sc, 0x1d, 0x4e60);
23086                 MP_WritePhyUshort(sc, 0x1d, 0x489c);
23087                 MP_WritePhyUshort(sc, 0x1d, 0x4628);
23088                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23089                 MP_WritePhyUshort(sc, 0x1d, 0x4e60);
23090                 MP_WritePhyUshort(sc, 0x1d, 0x7e28);
23091                 MP_WritePhyUshort(sc, 0x1d, 0x4628);
23092                 MP_WritePhyUshort(sc, 0x1d, 0x7c40);
23093                 MP_WritePhyUshort(sc, 0x1d, 0x5400);
23094                 MP_WritePhyUshort(sc, 0x1d, 0x7c01);
23095                 MP_WritePhyUshort(sc, 0x1d, 0x5800);
23096                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
23097                 MP_WritePhyUshort(sc, 0x1d, 0x5c00);
23098                 MP_WritePhyUshort(sc, 0x1d, 0x41e8);
23099                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23100                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
23101                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23102                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
23103                 MP_WritePhyUshort(sc, 0x1d, 0x8fb0);
23104                 MP_WritePhyUshort(sc, 0x1d, 0xb241);
23105                 MP_WritePhyUshort(sc, 0x1d, 0xa02a);
23106                 MP_WritePhyUshort(sc, 0x1d, 0x319d);
23107                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23108                 MP_WritePhyUshort(sc, 0x1d, 0x4ea0);
23109                 MP_WritePhyUshort(sc, 0x1d, 0x7c02);
23110                 MP_WritePhyUshort(sc, 0x1d, 0x4402);
23111                 MP_WritePhyUshort(sc, 0x1d, 0x4448);
23112                 MP_WritePhyUshort(sc, 0x1d, 0x4894);
23113                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23114                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
23115                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23116                 MP_WritePhyUshort(sc, 0x1d, 0x4c03);
23117                 MP_WritePhyUshort(sc, 0x1d, 0x4824);
23118                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23119                 MP_WritePhyUshort(sc, 0x1d, 0x4c07);
23120                 MP_WritePhyUshort(sc, 0x1d, 0x41ef);
23121                 MP_WritePhyUshort(sc, 0x1d, 0x41ff);
23122                 MP_WritePhyUshort(sc, 0x1d, 0x4891);
23123                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23124                 MP_WritePhyUshort(sc, 0x1d, 0x4c07);
23125                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23126                 MP_WritePhyUshort(sc, 0x1d, 0x4c17);
23127                 MP_WritePhyUshort(sc, 0x1d, 0x8400);
23128                 MP_WritePhyUshort(sc, 0x1d, 0x8ef8);
23129                 MP_WritePhyUshort(sc, 0x1d, 0x41c7);
23130                 MP_WritePhyUshort(sc, 0x1d, 0x8f95);
23131                 MP_WritePhyUshort(sc, 0x1d, 0x92d5);
23132                 MP_WritePhyUshort(sc, 0x1d, 0xa10f);
23133                 MP_WritePhyUshort(sc, 0x1d, 0xd480);
23134                 MP_WritePhyUshort(sc, 0x1d, 0x0008);
23135                 MP_WritePhyUshort(sc, 0x1d, 0xd580);
23136                 MP_WritePhyUshort(sc, 0x1d, 0xffb9);
23137                 MP_WritePhyUshort(sc, 0x1d, 0xa202);
23138                 MP_WritePhyUshort(sc, 0x1d, 0x31b8);
23139                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
23140                 MP_WritePhyUshort(sc, 0x1d, 0x4404);
23141                 MP_WritePhyUshort(sc, 0x1d, 0x31b8);
23142                 MP_WritePhyUshort(sc, 0x1d, 0xd484);
23143                 MP_WritePhyUshort(sc, 0x1d, 0xfff3);
23144                 MP_WritePhyUshort(sc, 0x1d, 0xd484);
23145                 MP_WritePhyUshort(sc, 0x1d, 0xfff1);
23146                 MP_WritePhyUshort(sc, 0x1d, 0x314d);
23147                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23148                 MP_WritePhyUshort(sc, 0x1d, 0x4ee0);
23149                 MP_WritePhyUshort(sc, 0x1d, 0x7c40);
23150                 MP_WritePhyUshort(sc, 0x1d, 0x5400);
23151                 MP_WritePhyUshort(sc, 0x1d, 0x4488);
23152                 MP_WritePhyUshort(sc, 0x1d, 0x41cf);
23153                 MP_WritePhyUshort(sc, 0x1d, 0x314d);
23154                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23155                 MP_WritePhyUshort(sc, 0x1d, 0x4ec0);
23156                 MP_WritePhyUshort(sc, 0x1d, 0x48f3);
23157                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23158                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
23159                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23160                 MP_WritePhyUshort(sc, 0x1d, 0x4c09);
23161                 MP_WritePhyUshort(sc, 0x1d, 0x4508);
23162                 MP_WritePhyUshort(sc, 0x1d, 0x41c7);
23163                 MP_WritePhyUshort(sc, 0x1d, 0x8f24);
23164                 MP_WritePhyUshort(sc, 0x1d, 0xd218);
23165                 MP_WritePhyUshort(sc, 0x1d, 0x0022);
23166                 MP_WritePhyUshort(sc, 0x1d, 0xd2a4);
23167                 MP_WritePhyUshort(sc, 0x1d, 0xff9f);
23168                 MP_WritePhyUshort(sc, 0x1d, 0x31d9);
23169                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23170                 MP_WritePhyUshort(sc, 0x1d, 0x4e80);
23171                 MP_WritePhyUshort(sc, 0x1d, 0x4832);
23172                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23173                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
23174                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23175                 MP_WritePhyUshort(sc, 0x1d, 0x4c11);
23176                 MP_WritePhyUshort(sc, 0x1d, 0x4428);
23177                 MP_WritePhyUshort(sc, 0x1d, 0x7c40);
23178                 MP_WritePhyUshort(sc, 0x1d, 0x5440);
23179                 MP_WritePhyUshort(sc, 0x1d, 0x7c01);
23180                 MP_WritePhyUshort(sc, 0x1d, 0x5801);
23181                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
23182                 MP_WritePhyUshort(sc, 0x1d, 0x5c04);
23183                 MP_WritePhyUshort(sc, 0x1d, 0x41e8);
23184                 MP_WritePhyUshort(sc, 0x1d, 0xa4b3);
23185                 MP_WritePhyUshort(sc, 0x1d, 0x31ee);
23186                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
23187                 MP_WritePhyUshort(sc, 0x1d, 0x6736);
23188                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23189                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23190                 MP_WritePhyUshort(sc, 0x1d, 0x570f);
23191                 MP_WritePhyUshort(sc, 0x1d, 0x5fff);
23192                 MP_WritePhyUshort(sc, 0x1d, 0xaa03);
23193                 MP_WritePhyUshort(sc, 0x1d, 0x585b);
23194                 MP_WritePhyUshort(sc, 0x1d, 0x31fa);
23195                 MP_WritePhyUshort(sc, 0x1d, 0x5867);
23196                 MP_WritePhyUshort(sc, 0x1d, 0xbcf6);
23197                 MP_WritePhyUshort(sc, 0x1d, 0x300b);
23198                 MP_WritePhyUshort(sc, 0x1d, 0x300b);
23199                 MP_WritePhyUshort(sc, 0x1d, 0x314d);
23200                 MP_WritePhyUshort(sc, 0x1f, 0x0004);
23201                 MP_WritePhyUshort(sc, 0x1c, 0x0200);
23202                 MP_WritePhyUshort(sc, 0x19, 0x7030);
23203                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23204
23205                 if (CSR_READ_1(sc, 0xEF)&0x08) {
23206                         MP_WritePhyUshort(sc, 0x1F, 0x0005);
23207                         MP_WritePhyUshort(sc, 0x1A, 0x0004);
23208                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
23209                 } else {
23210                         MP_WritePhyUshort(sc, 0x1F, 0x0005);
23211                         MP_WritePhyUshort(sc, 0x1A, 0x0000);
23212                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
23213                 }
23214
23215                 if (CSR_READ_1(sc, 0xEF)&0x10) {
23216                         MP_WritePhyUshort(sc, 0x1F, 0x0004);
23217                         MP_WritePhyUshort(sc, 0x1C, 0x0000);
23218                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
23219                 } else {
23220                         MP_WritePhyUshort(sc, 0x1F, 0x0004);
23221                         MP_WritePhyUshort(sc, 0x1C, 0x0200);
23222                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
23223                 }
23224
23225                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
23226                 MP_WritePhyUshort(sc, 0x15, 0x7701);
23227                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
23228
23229                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
23230                 ClearEthPhyBit(sc, 0x1A, BIT_14);
23231
23232                 if (phy_power_saving == 1) {
23233                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
23234                         MP_WritePhyUshort(sc, 0x18, 0x8310);
23235                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
23236                 } else {
23237                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
23238                         MP_WritePhyUshort(sc, 0x18, 0x0310);
23239                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
23240                         DELAY(20000);
23241                 }
23242
23243                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
23244                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
23245                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
23246                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
23247                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
23248                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
23249                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
23250                 MP_WritePhyUshort(sc, 0x0D, 0x0003);
23251                 MP_WritePhyUshort(sc, 0x0E, 0x0015);
23252                 MP_WritePhyUshort(sc, 0x0D, 0x4003);
23253                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
23254                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
23255
23256         } else if (sc->re_type == MACFG_50) {
23257                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
23258                 MP_WritePhyUshort(sc, 0x05, 0x8B80);
23259                 Data = MP_ReadPhyUshort(sc, 0x06);
23260                 Data |= BIT_2 | BIT_1;
23261                 MP_WritePhyUshort(sc, 0x06, Data);
23262                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23263
23264                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
23265                 MP_WritePhyUshort(sc, 0x1E, 0x002D);
23266                 Data = MP_ReadPhyUshort(sc, 0x18);
23267                 Data |= BIT_4;
23268                 MP_WritePhyUshort(sc, 0x18, Data);
23269                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23270                 Data = MP_ReadPhyUshort(sc, 0x14);
23271                 Data |= BIT_15;
23272                 MP_WritePhyUshort(sc, 0x14, Data);
23273
23274                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
23275                 MP_WritePhyUshort(sc, 0x05, 0x8B86);
23276                 Data = MP_ReadPhyUshort(sc, 0x06);
23277                 Data |= BIT_0;
23278                 MP_WritePhyUshort(sc, 0x06, Data);
23279                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23280
23281                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
23282                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
23283                 Data = MP_ReadPhyUshort(sc, 0x06);
23284                 Data |= BIT_14;
23285                 MP_WritePhyUshort(sc, 0x06, Data);
23286                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23287
23288                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
23289                 MP_WritePhyUshort(sc, 0x09, 0xA20F);
23290                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
23291
23292                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
23293                 MP_WritePhyUshort(sc, 0x05, 0x8B55);
23294                 MP_WritePhyUshort(sc, 0x06, 0x0000);
23295                 MP_WritePhyUshort(sc, 0x05, 0x8B5E);
23296                 MP_WritePhyUshort(sc, 0x06, 0x0000);
23297                 MP_WritePhyUshort(sc, 0x05, 0x8B67);
23298                 MP_WritePhyUshort(sc, 0x06, 0x0000);
23299                 MP_WritePhyUshort(sc, 0x05, 0x8B70);
23300                 MP_WritePhyUshort(sc, 0x06, 0x0000);
23301                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23302                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
23303                 MP_WritePhyUshort(sc, 0x1E, 0x0078);
23304                 MP_WritePhyUshort(sc, 0x17, 0x0000);
23305                 MP_WritePhyUshort(sc, 0x19, 0x00FB);
23306                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23307
23308                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
23309                 MP_WritePhyUshort(sc, 0x05, 0x8B79);
23310                 MP_WritePhyUshort(sc, 0x06, 0xAA00);
23311                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23312
23313                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
23314                 MP_WritePhyUshort(sc, 0x01, 0x328A);
23315                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
23316
23317                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
23318                 MP_WritePhyUshort(sc, 0x05, 0x8B54);
23319                 Data = MP_ReadPhyUshort(sc, 0x06);
23320                 Data &= ~BIT_11;
23321                 MP_WritePhyUshort(sc, 0x06, Data);
23322                 MP_WritePhyUshort(sc, 0x05, 0x8B5D);
23323                 Data = MP_ReadPhyUshort(sc, 0x06);
23324                 Data &= ~BIT_11;
23325                 MP_WritePhyUshort(sc, 0x06, Data);
23326                 MP_WritePhyUshort(sc, 0x05, 0x8A7C);
23327                 Data = MP_ReadPhyUshort(sc, 0x06);
23328                 Data &= ~BIT_8;
23329                 MP_WritePhyUshort(sc, 0x06, Data);
23330                 MP_WritePhyUshort(sc, 0x05, 0x8A7F);
23331                 Data = MP_ReadPhyUshort(sc, 0x06);
23332                 Data |= BIT_8;
23333                 MP_WritePhyUshort(sc, 0x06, Data);
23334                 MP_WritePhyUshort(sc, 0x05, 0x8A82);
23335                 Data = MP_ReadPhyUshort(sc, 0x06);
23336                 Data &= ~BIT_8;
23337                 MP_WritePhyUshort(sc, 0x06, Data);
23338                 MP_WritePhyUshort(sc, 0x05, 0x8A85);
23339                 Data = MP_ReadPhyUshort(sc, 0x06);
23340                 Data &= ~BIT_8;
23341                 MP_WritePhyUshort(sc, 0x06, Data);
23342                 MP_WritePhyUshort(sc, 0x05, 0x8A88);
23343                 Data = MP_ReadPhyUshort(sc, 0x06);
23344                 Data &= ~BIT_8;
23345                 MP_WritePhyUshort(sc, 0x06, Data);
23346                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
23347
23348                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
23349                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
23350                 Data = MP_ReadPhyUshort(sc, 0x06);
23351                 Data |= BIT_15;
23352                 MP_WritePhyUshort(sc, 0x06, Data);
23353                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23354
23355                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
23356                 Data = MP_ReadPhyUshort(sc, 0x19);
23357                 Data &= ~BIT_0;
23358                 MP_WritePhyUshort(sc, 0x19, Data);
23359                 Data = MP_ReadPhyUshort(sc, 0x10);
23360                 Data &= ~BIT_10;
23361                 MP_WritePhyUshort(sc, 0x10, Data);
23362                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23363         } else if (sc->re_type == MACFG_51) {
23364                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
23365                 MP_WritePhyUshort(sc, 0x05, 0x8B80);
23366                 Data = MP_ReadPhyUshort(sc, 0x06);
23367                 Data |= BIT_2 | BIT_1;
23368                 MP_WritePhyUshort(sc, 0x06, Data);
23369                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23370
23371                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
23372                 MP_WritePhyUshort(sc, 0x1E, 0x002D);
23373                 Data = MP_ReadPhyUshort(sc, 0x18);
23374                 Data |= BIT_4;
23375                 MP_WritePhyUshort(sc, 0x18, Data);
23376                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23377                 Data = MP_ReadPhyUshort(sc, 0x14);
23378                 Data |= BIT_15;
23379                 MP_WritePhyUshort(sc, 0x14, Data);
23380
23381                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
23382                 MP_WritePhyUshort(sc, 0x05, 0x8B86);
23383                 Data = MP_ReadPhyUshort(sc, 0x06);
23384                 Data |= BIT_0;
23385                 MP_WritePhyUshort(sc, 0x06, Data);
23386                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23387
23388                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
23389                 MP_WritePhyUshort(sc, 0x05, 0x8B54);
23390                 Data = MP_ReadPhyUshort(sc, 0x06);
23391                 Data &= ~BIT_11;
23392                 MP_WritePhyUshort(sc, 0x06, Data);
23393                 MP_WritePhyUshort(sc, 0x05, 0x8B5D);
23394                 Data = MP_ReadPhyUshort(sc, 0x06);
23395                 Data &= ~BIT_11;
23396                 MP_WritePhyUshort(sc, 0x06, Data);
23397                 MP_WritePhyUshort(sc, 0x05, 0x8A7C);
23398                 Data = MP_ReadPhyUshort(sc, 0x06);
23399                 Data &= ~BIT_8;
23400                 MP_WritePhyUshort(sc, 0x06, Data);
23401                 MP_WritePhyUshort(sc, 0x05, 0x8A7F);
23402                 Data = MP_ReadPhyUshort(sc, 0x06);
23403                 Data |= BIT_8;
23404                 MP_WritePhyUshort(sc, 0x06, Data);
23405                 MP_WritePhyUshort(sc, 0x05, 0x8A82);
23406                 Data = MP_ReadPhyUshort(sc, 0x06);
23407                 Data &= ~BIT_8;
23408                 MP_WritePhyUshort(sc, 0x06, Data);
23409                 MP_WritePhyUshort(sc, 0x05, 0x8A85);
23410                 Data = MP_ReadPhyUshort(sc, 0x06);
23411                 Data &= ~BIT_8;
23412                 MP_WritePhyUshort(sc, 0x06, Data);
23413                 MP_WritePhyUshort(sc, 0x05, 0x8A88);
23414                 Data = MP_ReadPhyUshort(sc, 0x06);
23415                 Data &= ~BIT_8;
23416                 MP_WritePhyUshort(sc, 0x06, Data);
23417                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
23418
23419                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
23420                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
23421                 Data = MP_ReadPhyUshort(sc, 0x06);
23422                 Data |= BIT_15;
23423                 MP_WritePhyUshort(sc, 0x06, Data);
23424                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23425
23426                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
23427                 Data = MP_ReadPhyUshort(sc, 0x19);
23428                 Data &= ~BIT_0;
23429                 MP_WritePhyUshort(sc, 0x19, Data);
23430                 Data = MP_ReadPhyUshort(sc, 0x10);
23431                 Data &= ~BIT_10;
23432                 MP_WritePhyUshort(sc, 0x10, Data);
23433                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23434         } else if (sc->re_type == MACFG_52) {
23435                 Data_u32 = re_eri_read(sc, 0x1D0, 4, ERIAR_ExGMAC);
23436                 Data_u32 &= ~BIT_1;
23437                 re_eri_write(sc, 0x1D0, 4, Data_u32, ERIAR_ExGMAC);
23438
23439                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
23440                 MP_WritePhyUshort(sc, 0x05, 0x8B80);
23441                 Data = MP_ReadPhyUshort(sc, 0x06);
23442                 Data |= BIT_2 | BIT_1;
23443                 MP_WritePhyUshort(sc, 0x06, Data);
23444                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23445
23446                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
23447                 MP_WritePhyUshort(sc, 0x1E, 0x002D);
23448                 Data = MP_ReadPhyUshort(sc, 0x18);
23449                 Data |= BIT_4;
23450                 MP_WritePhyUshort(sc, 0x18, Data);
23451                 MP_WritePhyUshort(sc, 0x1f, 0x0002);
23452                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23453                 Data = MP_ReadPhyUshort(sc, 0x14);
23454                 Data |= BIT_15;
23455                 MP_WritePhyUshort(sc, 0x14, Data);
23456
23457                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
23458                 MP_WritePhyUshort(sc, 0x05, 0x8B86);
23459                 Data = MP_ReadPhyUshort(sc, 0x06);
23460                 Data |= BIT_0;
23461                 MP_WritePhyUshort(sc, 0x06, Data);
23462                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23463
23464                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
23465                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
23466                 Data = MP_ReadPhyUshort(sc, 0x06);
23467                 Data |= BIT_14;
23468                 MP_WritePhyUshort(sc, 0x06, Data);
23469                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23470
23471                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
23472                 MP_WritePhyUshort(sc, 0x09, 0xA20F);
23473                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
23474
23475                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
23476                 MP_WritePhyUshort(sc, 0x05, 0x8B55);
23477                 MP_WritePhyUshort(sc, 0x06, 0x0000);
23478                 MP_WritePhyUshort(sc, 0x05, 0x8B5E);
23479                 MP_WritePhyUshort(sc, 0x06, 0x0000);
23480                 MP_WritePhyUshort(sc, 0x05, 0x8B67);
23481                 MP_WritePhyUshort(sc, 0x06, 0x0000);
23482                 MP_WritePhyUshort(sc, 0x05, 0x8B70);
23483                 MP_WritePhyUshort(sc, 0x06, 0x0000);
23484                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23485                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
23486                 MP_WritePhyUshort(sc, 0x1E, 0x0078);
23487                 MP_WritePhyUshort(sc, 0x17, 0x0000);
23488                 MP_WritePhyUshort(sc, 0x19, 0x00FB);
23489                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23490
23491                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
23492                 MP_WritePhyUshort(sc, 0x05, 0x8B79);
23493                 MP_WritePhyUshort(sc, 0x06, 0xAA00);
23494                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23495
23496                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
23497                 MP_WritePhyUshort(sc, 0x01, 0x328A);
23498                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
23499
23500                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
23501                 MP_WritePhyUshort(sc, 0x05, 0x8B54);
23502                 Data = MP_ReadPhyUshort(sc, 0x06);
23503                 Data &= ~BIT_11;
23504                 MP_WritePhyUshort(sc, 0x06, Data);
23505                 MP_WritePhyUshort(sc, 0x05, 0x8B5D);
23506                 Data = MP_ReadPhyUshort(sc, 0x06);
23507                 Data &= ~BIT_11;
23508                 MP_WritePhyUshort(sc, 0x06, Data);
23509                 MP_WritePhyUshort(sc, 0x05, 0x8A7C);
23510                 Data = MP_ReadPhyUshort(sc, 0x06);
23511                 Data &= ~BIT_8;
23512                 MP_WritePhyUshort(sc, 0x06, Data);
23513                 MP_WritePhyUshort(sc, 0x05, 0x8A7F);
23514                 Data = MP_ReadPhyUshort(sc, 0x06);
23515                 Data |= BIT_8;
23516                 MP_WritePhyUshort(sc, 0x06, Data);
23517                 MP_WritePhyUshort(sc, 0x05, 0x8A82);
23518                 Data = MP_ReadPhyUshort(sc, 0x06);
23519                 Data &= ~BIT_8;
23520                 MP_WritePhyUshort(sc, 0x06, Data);
23521                 MP_WritePhyUshort(sc, 0x05, 0x8A85);
23522                 Data = MP_ReadPhyUshort(sc, 0x06);
23523                 Data &= ~BIT_8;
23524                 MP_WritePhyUshort(sc, 0x06, Data);
23525                 MP_WritePhyUshort(sc, 0x05, 0x8A88);
23526                 Data = MP_ReadPhyUshort(sc, 0x06);
23527                 Data &= ~BIT_8;
23528                 MP_WritePhyUshort(sc, 0x06, Data);
23529                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
23530
23531                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
23532                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
23533                 Data = MP_ReadPhyUshort(sc, 0x06);
23534                 Data |= BIT_15;
23535                 MP_WritePhyUshort(sc, 0x06, Data);
23536                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23537
23538                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
23539                 Data = MP_ReadPhyUshort(sc, 0x19);
23540                 Data &= ~BIT_0;
23541                 MP_WritePhyUshort(sc, 0x19, Data);
23542                 Data = MP_ReadPhyUshort(sc, 0x10);
23543                 Data &= ~BIT_10;
23544                 MP_WritePhyUshort(sc, 0x10, Data);
23545                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23546         } else if (sc->re_type == MACFG_53) {
23547                 Data_u32 = re_eri_read(sc, 0x1D0, 4, ERIAR_ExGMAC);
23548                 Data_u32 &= 0xFFFF0000;
23549                 re_eri_write(sc, 0x1D0, 4, Data_u32, ERIAR_ExGMAC);
23550
23551                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
23552                 MP_WritePhyUshort(sc, 0x18, 0x0310);
23553                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
23554
23555                 MP_WritePhyUshort(sc, 0x1f, 0x0004);
23556                 MP_WritePhyUshort(sc, 0x1f, 0x0004);
23557                 MP_WritePhyUshort(sc, 0x19, 0x7070);
23558                 MP_WritePhyUshort(sc, 0x1c, 0x0600);
23559                 MP_WritePhyUshort(sc, 0x1d, 0x9700);
23560                 MP_WritePhyUshort(sc, 0x1d, 0x7d00);
23561                 MP_WritePhyUshort(sc, 0x1d, 0x6900);
23562                 MP_WritePhyUshort(sc, 0x1d, 0x7d00);
23563                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
23564                 MP_WritePhyUshort(sc, 0x1d, 0x4899);
23565                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23566                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
23567                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23568                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
23569                 MP_WritePhyUshort(sc, 0x1d, 0x8000);
23570                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23571                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
23572                 MP_WritePhyUshort(sc, 0x1d, 0x4007);
23573                 MP_WritePhyUshort(sc, 0x1d, 0x4400);
23574                 MP_WritePhyUshort(sc, 0x1d, 0x4800);
23575                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23576                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
23577                 MP_WritePhyUshort(sc, 0x1d, 0x5310);
23578                 MP_WritePhyUshort(sc, 0x1d, 0x6000);
23579                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
23580                 MP_WritePhyUshort(sc, 0x1d, 0x6736);
23581                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23582                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23583                 MP_WritePhyUshort(sc, 0x1d, 0x571f);
23584                 MP_WritePhyUshort(sc, 0x1d, 0x5ffb);
23585                 MP_WritePhyUshort(sc, 0x1d, 0xaa03);
23586                 MP_WritePhyUshort(sc, 0x1d, 0x5b58);
23587                 MP_WritePhyUshort(sc, 0x1d, 0x301e);
23588                 MP_WritePhyUshort(sc, 0x1d, 0x5b64);
23589                 MP_WritePhyUshort(sc, 0x1d, 0xa6fc);
23590                 MP_WritePhyUshort(sc, 0x1d, 0xdcdb);
23591                 MP_WritePhyUshort(sc, 0x1d, 0x0015);
23592                 MP_WritePhyUshort(sc, 0x1d, 0xb915);
23593                 MP_WritePhyUshort(sc, 0x1d, 0xb511);
23594                 MP_WritePhyUshort(sc, 0x1d, 0xd16b);
23595                 MP_WritePhyUshort(sc, 0x1d, 0x000f);
23596                 MP_WritePhyUshort(sc, 0x1d, 0xb40f);
23597                 MP_WritePhyUshort(sc, 0x1d, 0xd06b);
23598                 MP_WritePhyUshort(sc, 0x1d, 0x000d);
23599                 MP_WritePhyUshort(sc, 0x1d, 0xb206);
23600                 MP_WritePhyUshort(sc, 0x1d, 0x7c01);
23601                 MP_WritePhyUshort(sc, 0x1d, 0x5800);
23602                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
23603                 MP_WritePhyUshort(sc, 0x1d, 0x5c00);
23604                 MP_WritePhyUshort(sc, 0x1d, 0x301a);
23605                 MP_WritePhyUshort(sc, 0x1d, 0x7c01);
23606                 MP_WritePhyUshort(sc, 0x1d, 0x5801);
23607                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
23608                 MP_WritePhyUshort(sc, 0x1d, 0x5c04);
23609                 MP_WritePhyUshort(sc, 0x1d, 0x301e);
23610                 MP_WritePhyUshort(sc, 0x1d, 0x3079);
23611                 MP_WritePhyUshort(sc, 0x1d, 0x30f1);
23612                 MP_WritePhyUshort(sc, 0x1d, 0x3199);
23613                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23614                 MP_WritePhyUshort(sc, 0x1d, 0x4c60);
23615                 MP_WritePhyUshort(sc, 0x1d, 0x6803);
23616                 MP_WritePhyUshort(sc, 0x1d, 0x6420);
23617                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23618                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23619                 MP_WritePhyUshort(sc, 0x1d, 0xaf03);
23620                 MP_WritePhyUshort(sc, 0x1d, 0x6015);
23621                 MP_WritePhyUshort(sc, 0x1d, 0x3040);
23622                 MP_WritePhyUshort(sc, 0x1d, 0x6017);
23623                 MP_WritePhyUshort(sc, 0x1d, 0x57e0);
23624                 MP_WritePhyUshort(sc, 0x1d, 0x580c);
23625                 MP_WritePhyUshort(sc, 0x1d, 0x588c);
23626                 MP_WritePhyUshort(sc, 0x1d, 0x5fa3);
23627                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23628                 MP_WritePhyUshort(sc, 0x1d, 0x4827);
23629                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23630                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
23631                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23632                 MP_WritePhyUshort(sc, 0x1d, 0x4c10);
23633                 MP_WritePhyUshort(sc, 0x1d, 0x8400);
23634                 MP_WritePhyUshort(sc, 0x1d, 0x7c30);
23635                 MP_WritePhyUshort(sc, 0x1d, 0x6020);
23636                 MP_WritePhyUshort(sc, 0x1d, 0x48bf);
23637                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23638                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
23639                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23640                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
23641                 MP_WritePhyUshort(sc, 0x1d, 0xd6cf);
23642                 MP_WritePhyUshort(sc, 0x1d, 0x0002);
23643                 MP_WritePhyUshort(sc, 0x1d, 0x80fe);
23644                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23645                 MP_WritePhyUshort(sc, 0x1d, 0x4c80);
23646                 MP_WritePhyUshort(sc, 0x1d, 0x7c20);
23647                 MP_WritePhyUshort(sc, 0x1d, 0x5c20);
23648                 MP_WritePhyUshort(sc, 0x1d, 0x481e);
23649                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23650                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
23651                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23652                 MP_WritePhyUshort(sc, 0x1d, 0x4c02);
23653                 MP_WritePhyUshort(sc, 0x1d, 0x5310);
23654                 MP_WritePhyUshort(sc, 0x1d, 0x81ff);
23655                 MP_WritePhyUshort(sc, 0x1d, 0x30ba);
23656                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23657                 MP_WritePhyUshort(sc, 0x1d, 0x4d00);
23658                 MP_WritePhyUshort(sc, 0x1d, 0x4832);
23659                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23660                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
23661                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23662                 MP_WritePhyUshort(sc, 0x1d, 0x4c10);
23663                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
23664                 MP_WritePhyUshort(sc, 0x1d, 0x6000);
23665                 MP_WritePhyUshort(sc, 0x1d, 0xa4cc);
23666                 MP_WritePhyUshort(sc, 0x1d, 0xd9b3);
23667                 MP_WritePhyUshort(sc, 0x1d, 0xfffe);
23668                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23669                 MP_WritePhyUshort(sc, 0x1d, 0x4d20);
23670                 MP_WritePhyUshort(sc, 0x1d, 0x7e00);
23671                 MP_WritePhyUshort(sc, 0x1d, 0x6200);
23672                 MP_WritePhyUshort(sc, 0x1d, 0x300b);
23673                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23674                 MP_WritePhyUshort(sc, 0x1d, 0x4dc0);
23675                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23676                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23677                 MP_WritePhyUshort(sc, 0x1d, 0xd09d);
23678                 MP_WritePhyUshort(sc, 0x1d, 0x0002);
23679                 MP_WritePhyUshort(sc, 0x1d, 0xb4fe);
23680                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23681                 MP_WritePhyUshort(sc, 0x1d, 0x4d80);
23682                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
23683                 MP_WritePhyUshort(sc, 0x1d, 0x6004);
23684                 MP_WritePhyUshort(sc, 0x1d, 0x5310);
23685                 MP_WritePhyUshort(sc, 0x1d, 0x6802);
23686                 MP_WritePhyUshort(sc, 0x1d, 0x6720);
23687                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23688                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23689                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
23690                 MP_WritePhyUshort(sc, 0x1d, 0x6000);
23691                 MP_WritePhyUshort(sc, 0x1d, 0x486c);
23692                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23693                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
23694                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23695                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
23696                 MP_WritePhyUshort(sc, 0x1d, 0x9503);
23697                 MP_WritePhyUshort(sc, 0x1d, 0x7e00);
23698                 MP_WritePhyUshort(sc, 0x1d, 0x6200);
23699                 MP_WritePhyUshort(sc, 0x1d, 0x571f);
23700                 MP_WritePhyUshort(sc, 0x1d, 0x5fbb);
23701                 MP_WritePhyUshort(sc, 0x1d, 0xaa03);
23702                 MP_WritePhyUshort(sc, 0x1d, 0x5b58);
23703                 MP_WritePhyUshort(sc, 0x1d, 0x3092);
23704                 MP_WritePhyUshort(sc, 0x1d, 0x5b64);
23705                 MP_WritePhyUshort(sc, 0x1d, 0xcdab);
23706                 MP_WritePhyUshort(sc, 0x1d, 0xff78);
23707                 MP_WritePhyUshort(sc, 0x1d, 0xcd8d);
23708                 MP_WritePhyUshort(sc, 0x1d, 0xff76);
23709                 MP_WritePhyUshort(sc, 0x1d, 0xd96b);
23710                 MP_WritePhyUshort(sc, 0x1d, 0xff74);
23711                 MP_WritePhyUshort(sc, 0x1d, 0xd0a0);
23712                 MP_WritePhyUshort(sc, 0x1d, 0xffd9);
23713                 MP_WritePhyUshort(sc, 0x1d, 0xcba0);
23714                 MP_WritePhyUshort(sc, 0x1d, 0x0003);
23715                 MP_WritePhyUshort(sc, 0x1d, 0x80f0);
23716                 MP_WritePhyUshort(sc, 0x1d, 0x309f);
23717                 MP_WritePhyUshort(sc, 0x1d, 0x30ac);
23718                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23719                 MP_WritePhyUshort(sc, 0x1d, 0x4ce0);
23720                 MP_WritePhyUshort(sc, 0x1d, 0x4832);
23721                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23722                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
23723                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23724                 MP_WritePhyUshort(sc, 0x1d, 0x4c08);
23725                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
23726                 MP_WritePhyUshort(sc, 0x1d, 0x6008);
23727                 MP_WritePhyUshort(sc, 0x1d, 0x8300);
23728                 MP_WritePhyUshort(sc, 0x1d, 0xb902);
23729                 MP_WritePhyUshort(sc, 0x1d, 0x3079);
23730                 MP_WritePhyUshort(sc, 0x1d, 0x3061);
23731                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23732                 MP_WritePhyUshort(sc, 0x1d, 0x4da0);
23733                 MP_WritePhyUshort(sc, 0x1d, 0x6400);
23734                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23735                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23736                 MP_WritePhyUshort(sc, 0x1d, 0x57a0);
23737                 MP_WritePhyUshort(sc, 0x1d, 0x590c);
23738                 MP_WritePhyUshort(sc, 0x1d, 0x5fa3);
23739                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23740                 MP_WritePhyUshort(sc, 0x1d, 0xcba4);
23741                 MP_WritePhyUshort(sc, 0x1d, 0x0004);
23742                 MP_WritePhyUshort(sc, 0x1d, 0xcd8d);
23743                 MP_WritePhyUshort(sc, 0x1d, 0x0002);
23744                 MP_WritePhyUshort(sc, 0x1d, 0x80fc);
23745                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23746                 MP_WritePhyUshort(sc, 0x1d, 0x4ca0);
23747                 MP_WritePhyUshort(sc, 0x1d, 0xb603);
23748                 MP_WritePhyUshort(sc, 0x1d, 0x7c10);
23749                 MP_WritePhyUshort(sc, 0x1d, 0x6010);
23750                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23751                 MP_WritePhyUshort(sc, 0x1d, 0x541f);
23752                 MP_WritePhyUshort(sc, 0x1d, 0x5fb3);
23753                 MP_WritePhyUshort(sc, 0x1d, 0xaa05);
23754                 MP_WritePhyUshort(sc, 0x1d, 0x7c80);
23755                 MP_WritePhyUshort(sc, 0x1d, 0x5800);
23756                 MP_WritePhyUshort(sc, 0x1d, 0x5b58);
23757                 MP_WritePhyUshort(sc, 0x1d, 0x30ca);
23758                 MP_WritePhyUshort(sc, 0x1d, 0x7c80);
23759                 MP_WritePhyUshort(sc, 0x1d, 0x5800);
23760                 MP_WritePhyUshort(sc, 0x1d, 0x5b64);
23761                 MP_WritePhyUshort(sc, 0x1d, 0x4824);
23762                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23763                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
23764                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23765                 MP_WritePhyUshort(sc, 0x1d, 0x4c04);
23766                 MP_WritePhyUshort(sc, 0x1d, 0x8200);
23767                 MP_WritePhyUshort(sc, 0x1d, 0x4827);
23768                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23769                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
23770                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23771                 MP_WritePhyUshort(sc, 0x1d, 0x4c10);
23772                 MP_WritePhyUshort(sc, 0x1d, 0x8400);
23773                 MP_WritePhyUshort(sc, 0x1d, 0x7c10);
23774                 MP_WritePhyUshort(sc, 0x1d, 0x6000);
23775                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23776                 MP_WritePhyUshort(sc, 0x1d, 0x4cc0);
23777                 MP_WritePhyUshort(sc, 0x1d, 0x5fbb);
23778                 MP_WritePhyUshort(sc, 0x1d, 0x4824);
23779                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23780                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
23781                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23782                 MP_WritePhyUshort(sc, 0x1d, 0x4c04);
23783                 MP_WritePhyUshort(sc, 0x1d, 0x8200);
23784                 MP_WritePhyUshort(sc, 0x1d, 0x7ce0);
23785                 MP_WritePhyUshort(sc, 0x1d, 0x5400);
23786                 MP_WritePhyUshort(sc, 0x1d, 0x6720);
23787                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23788                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23789                 MP_WritePhyUshort(sc, 0x1d, 0x7e00);
23790                 MP_WritePhyUshort(sc, 0x1d, 0x6a00);
23791                 MP_WritePhyUshort(sc, 0x1d, 0x4824);
23792                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23793                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
23794                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23795                 MP_WritePhyUshort(sc, 0x1d, 0x4c04);
23796                 MP_WritePhyUshort(sc, 0x1d, 0x8200);
23797                 MP_WritePhyUshort(sc, 0x1d, 0x7e00);
23798                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
23799                 MP_WritePhyUshort(sc, 0x1d, 0x309f);
23800                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23801                 MP_WritePhyUshort(sc, 0x1d, 0x4e00);
23802                 MP_WritePhyUshort(sc, 0x1d, 0x4007);
23803                 MP_WritePhyUshort(sc, 0x1d, 0x4400);
23804                 MP_WritePhyUshort(sc, 0x1d, 0x5310);
23805                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
23806                 MP_WritePhyUshort(sc, 0x1d, 0x6736);
23807                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23808                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23809                 MP_WritePhyUshort(sc, 0x1d, 0x570f);
23810                 MP_WritePhyUshort(sc, 0x1d, 0x5fff);
23811                 MP_WritePhyUshort(sc, 0x1d, 0xaa03);
23812                 MP_WritePhyUshort(sc, 0x1d, 0x585b);
23813                 MP_WritePhyUshort(sc, 0x1d, 0x3100);
23814                 MP_WritePhyUshort(sc, 0x1d, 0x5867);
23815                 MP_WritePhyUshort(sc, 0x1d, 0x9403);
23816                 MP_WritePhyUshort(sc, 0x1d, 0x7e00);
23817                 MP_WritePhyUshort(sc, 0x1d, 0x6200);
23818                 MP_WritePhyUshort(sc, 0x1d, 0xcda3);
23819                 MP_WritePhyUshort(sc, 0x1d, 0x002d);
23820                 MP_WritePhyUshort(sc, 0x1d, 0xcd85);
23821                 MP_WritePhyUshort(sc, 0x1d, 0x002b);
23822                 MP_WritePhyUshort(sc, 0x1d, 0xd96b);
23823                 MP_WritePhyUshort(sc, 0x1d, 0x0029);
23824                 MP_WritePhyUshort(sc, 0x1d, 0x9629);
23825                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
23826                 MP_WritePhyUshort(sc, 0x1d, 0x6736);
23827                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23828                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23829                 MP_WritePhyUshort(sc, 0x1d, 0x9624);
23830                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23831                 MP_WritePhyUshort(sc, 0x1d, 0x4e20);
23832                 MP_WritePhyUshort(sc, 0x1d, 0x8b04);
23833                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
23834                 MP_WritePhyUshort(sc, 0x1d, 0x5008);
23835                 MP_WritePhyUshort(sc, 0x1d, 0xab03);
23836                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
23837                 MP_WritePhyUshort(sc, 0x1d, 0x5000);
23838                 MP_WritePhyUshort(sc, 0x1d, 0x6801);
23839                 MP_WritePhyUshort(sc, 0x1d, 0x6776);
23840                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23841                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23842                 MP_WritePhyUshort(sc, 0x1d, 0xdb7c);
23843                 MP_WritePhyUshort(sc, 0x1d, 0xffee);
23844                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23845                 MP_WritePhyUshort(sc, 0x1d, 0x7fe1);
23846                 MP_WritePhyUshort(sc, 0x1d, 0x4e40);
23847                 MP_WritePhyUshort(sc, 0x1d, 0x4837);
23848                 MP_WritePhyUshort(sc, 0x1d, 0x4418);
23849                 MP_WritePhyUshort(sc, 0x1d, 0x41c7);
23850                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23851                 MP_WritePhyUshort(sc, 0x1d, 0x4e40);
23852                 MP_WritePhyUshort(sc, 0x1d, 0x7c40);
23853                 MP_WritePhyUshort(sc, 0x1d, 0x5400);
23854                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23855                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
23856                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23857                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
23858                 MP_WritePhyUshort(sc, 0x1d, 0x8f07);
23859                 MP_WritePhyUshort(sc, 0x1d, 0xd2a0);
23860                 MP_WritePhyUshort(sc, 0x1d, 0x004c);
23861                 MP_WritePhyUshort(sc, 0x1d, 0x9205);
23862                 MP_WritePhyUshort(sc, 0x1d, 0xa043);
23863                 MP_WritePhyUshort(sc, 0x1d, 0x312b);
23864                 MP_WritePhyUshort(sc, 0x1d, 0x300b);
23865                 MP_WritePhyUshort(sc, 0x1d, 0x30f1);
23866                 MP_WritePhyUshort(sc, 0x1d, 0x7fe1);
23867                 MP_WritePhyUshort(sc, 0x1d, 0x4e60);
23868                 MP_WritePhyUshort(sc, 0x1d, 0x489c);
23869                 MP_WritePhyUshort(sc, 0x1d, 0x4628);
23870                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23871                 MP_WritePhyUshort(sc, 0x1d, 0x4e60);
23872                 MP_WritePhyUshort(sc, 0x1d, 0x7e28);
23873                 MP_WritePhyUshort(sc, 0x1d, 0x4628);
23874                 MP_WritePhyUshort(sc, 0x1d, 0x7c40);
23875                 MP_WritePhyUshort(sc, 0x1d, 0x5400);
23876                 MP_WritePhyUshort(sc, 0x1d, 0x7c01);
23877                 MP_WritePhyUshort(sc, 0x1d, 0x5800);
23878                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
23879                 MP_WritePhyUshort(sc, 0x1d, 0x5c00);
23880                 MP_WritePhyUshort(sc, 0x1d, 0x41e8);
23881                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23882                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
23883                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23884                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
23885                 MP_WritePhyUshort(sc, 0x1d, 0x8fec);
23886                 MP_WritePhyUshort(sc, 0x1d, 0xb241);
23887                 MP_WritePhyUshort(sc, 0x1d, 0xa02a);
23888                 MP_WritePhyUshort(sc, 0x1d, 0x3146);
23889                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23890                 MP_WritePhyUshort(sc, 0x1d, 0x4ea0);
23891                 MP_WritePhyUshort(sc, 0x1d, 0x7c02);
23892                 MP_WritePhyUshort(sc, 0x1d, 0x4402);
23893                 MP_WritePhyUshort(sc, 0x1d, 0x4448);
23894                 MP_WritePhyUshort(sc, 0x1d, 0x4894);
23895                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23896                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
23897                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23898                 MP_WritePhyUshort(sc, 0x1d, 0x4c03);
23899                 MP_WritePhyUshort(sc, 0x1d, 0x4824);
23900                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23901                 MP_WritePhyUshort(sc, 0x1d, 0x4c07);
23902                 MP_WritePhyUshort(sc, 0x1d, 0x41ef);
23903                 MP_WritePhyUshort(sc, 0x1d, 0x41ff);
23904                 MP_WritePhyUshort(sc, 0x1d, 0x4891);
23905                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23906                 MP_WritePhyUshort(sc, 0x1d, 0x4c07);
23907                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23908                 MP_WritePhyUshort(sc, 0x1d, 0x4c17);
23909                 MP_WritePhyUshort(sc, 0x1d, 0x8400);
23910                 MP_WritePhyUshort(sc, 0x1d, 0x8ef8);
23911                 MP_WritePhyUshort(sc, 0x1d, 0x41c7);
23912                 MP_WritePhyUshort(sc, 0x1d, 0x8fd1);
23913                 MP_WritePhyUshort(sc, 0x1d, 0x92d5);
23914                 MP_WritePhyUshort(sc, 0x1d, 0xa10f);
23915                 MP_WritePhyUshort(sc, 0x1d, 0xd480);
23916                 MP_WritePhyUshort(sc, 0x1d, 0x0008);
23917                 MP_WritePhyUshort(sc, 0x1d, 0xd580);
23918                 MP_WritePhyUshort(sc, 0x1d, 0xffb7);
23919                 MP_WritePhyUshort(sc, 0x1d, 0xa202);
23920                 MP_WritePhyUshort(sc, 0x1d, 0x3161);
23921                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
23922                 MP_WritePhyUshort(sc, 0x1d, 0x4404);
23923                 MP_WritePhyUshort(sc, 0x1d, 0x3161);
23924                 MP_WritePhyUshort(sc, 0x1d, 0xd484);
23925                 MP_WritePhyUshort(sc, 0x1d, 0xfff3);
23926                 MP_WritePhyUshort(sc, 0x1d, 0xd484);
23927                 MP_WritePhyUshort(sc, 0x1d, 0xfff1);
23928                 MP_WritePhyUshort(sc, 0x1d, 0x30f1);
23929                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23930                 MP_WritePhyUshort(sc, 0x1d, 0x4ee0);
23931                 MP_WritePhyUshort(sc, 0x1d, 0x7c40);
23932                 MP_WritePhyUshort(sc, 0x1d, 0x5400);
23933                 MP_WritePhyUshort(sc, 0x1d, 0x4488);
23934                 MP_WritePhyUshort(sc, 0x1d, 0x41cf);
23935                 MP_WritePhyUshort(sc, 0x1d, 0x30f1);
23936                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23937                 MP_WritePhyUshort(sc, 0x1d, 0x4ec0);
23938                 MP_WritePhyUshort(sc, 0x1d, 0x48f3);
23939                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23940                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
23941                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23942                 MP_WritePhyUshort(sc, 0x1d, 0x4c09);
23943                 MP_WritePhyUshort(sc, 0x1d, 0x4508);
23944                 MP_WritePhyUshort(sc, 0x1d, 0x41c7);
23945                 MP_WritePhyUshort(sc, 0x1d, 0x8fb0);
23946                 MP_WritePhyUshort(sc, 0x1d, 0xd218);
23947                 MP_WritePhyUshort(sc, 0x1d, 0xffae);
23948                 MP_WritePhyUshort(sc, 0x1d, 0xd2a4);
23949                 MP_WritePhyUshort(sc, 0x1d, 0xff9d);
23950                 MP_WritePhyUshort(sc, 0x1d, 0x3182);
23951                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23952                 MP_WritePhyUshort(sc, 0x1d, 0x4e80);
23953                 MP_WritePhyUshort(sc, 0x1d, 0x4832);
23954                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23955                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
23956                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
23957                 MP_WritePhyUshort(sc, 0x1d, 0x4c11);
23958                 MP_WritePhyUshort(sc, 0x1d, 0x4428);
23959                 MP_WritePhyUshort(sc, 0x1d, 0x7c40);
23960                 MP_WritePhyUshort(sc, 0x1d, 0x5440);
23961                 MP_WritePhyUshort(sc, 0x1d, 0x7c01);
23962                 MP_WritePhyUshort(sc, 0x1d, 0x5801);
23963                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
23964                 MP_WritePhyUshort(sc, 0x1d, 0x5c04);
23965                 MP_WritePhyUshort(sc, 0x1d, 0x41e8);
23966                 MP_WritePhyUshort(sc, 0x1d, 0xa4b3);
23967                 MP_WritePhyUshort(sc, 0x1d, 0x3197);
23968                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
23969                 MP_WritePhyUshort(sc, 0x1d, 0x4f20);
23970                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
23971                 MP_WritePhyUshort(sc, 0x1d, 0x6736);
23972                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23973                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
23974                 MP_WritePhyUshort(sc, 0x1d, 0x570f);
23975                 MP_WritePhyUshort(sc, 0x1d, 0x5fff);
23976                 MP_WritePhyUshort(sc, 0x1d, 0xaa03);
23977                 MP_WritePhyUshort(sc, 0x1d, 0x585b);
23978                 MP_WritePhyUshort(sc, 0x1d, 0x31a5);
23979                 MP_WritePhyUshort(sc, 0x1d, 0x5867);
23980                 MP_WritePhyUshort(sc, 0x1d, 0xbcf4);
23981                 MP_WritePhyUshort(sc, 0x1d, 0x300b);
23982                 MP_WritePhyUshort(sc, 0x1f, 0x0004);
23983                 MP_WritePhyUshort(sc, 0x1c, 0x0200);
23984                 MP_WritePhyUshort(sc, 0x19, 0x7030);
23985                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
23986
23987                 if (phy_power_saving == 1) {
23988                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
23989                         MP_WritePhyUshort(sc, 0x18, 0x8310);
23990                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
23991                 } else {
23992                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
23993                         MP_WritePhyUshort(sc, 0x18, 0x0310);
23994                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
23995                         DELAY(20000);
23996                 }
23997
23998                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
23999                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
24000                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
24001                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
24002                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
24003                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
24004         } else if (sc->re_type == MACFG_54 || sc->re_type == MACFG_55) {
24005                 Data_u32 = re_eri_read(sc, 0x1D0, 4, ERIAR_ExGMAC);
24006                 Data_u32 &= 0xFFFF0000;
24007                 re_eri_write(sc, 0x1D0, 4, Data_u32, ERIAR_ExGMAC);
24008
24009                 if (sc->re_type == MACFG_55) {
24010                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
24011                         MP_WritePhyUshort(sc, 0x18, 0x0310);
24012                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
24013
24014                         MP_WritePhyUshort(sc, 0x1f, 0x0004);
24015                         MP_WritePhyUshort(sc, 0x1f, 0x0004);
24016                         MP_WritePhyUshort(sc, 0x19, 0x7070);
24017                         MP_WritePhyUshort(sc, 0x1c, 0x0600);
24018                         MP_WritePhyUshort(sc, 0x1d, 0x9700);
24019                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
24020                         MP_WritePhyUshort(sc, 0x1d, 0x4c00);
24021                         MP_WritePhyUshort(sc, 0x1d, 0x4007);
24022                         MP_WritePhyUshort(sc, 0x1d, 0x4400);
24023                         MP_WritePhyUshort(sc, 0x1d, 0x4800);
24024                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24025                         MP_WritePhyUshort(sc, 0x1d, 0x4c00);
24026                         MP_WritePhyUshort(sc, 0x1d, 0x5310);
24027                         MP_WritePhyUshort(sc, 0x1d, 0x6000);
24028                         MP_WritePhyUshort(sc, 0x1d, 0x6800);
24029                         MP_WritePhyUshort(sc, 0x1d, 0x673e);
24030                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24031                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24032                         MP_WritePhyUshort(sc, 0x1d, 0x571f);
24033                         MP_WritePhyUshort(sc, 0x1d, 0x5ffb);
24034                         MP_WritePhyUshort(sc, 0x1d, 0xaa04);
24035                         MP_WritePhyUshort(sc, 0x1d, 0x5b58);
24036                         MP_WritePhyUshort(sc, 0x1d, 0x6100);
24037                         MP_WritePhyUshort(sc, 0x1d, 0x3016);
24038                         MP_WritePhyUshort(sc, 0x1d, 0x5b64);
24039                         MP_WritePhyUshort(sc, 0x1d, 0x6080);
24040                         MP_WritePhyUshort(sc, 0x1d, 0xa6fa);
24041                         MP_WritePhyUshort(sc, 0x1d, 0xdcdb);
24042                         MP_WritePhyUshort(sc, 0x1d, 0x0015);
24043                         MP_WritePhyUshort(sc, 0x1d, 0xb915);
24044                         MP_WritePhyUshort(sc, 0x1d, 0xb511);
24045                         MP_WritePhyUshort(sc, 0x1d, 0xd16b);
24046                         MP_WritePhyUshort(sc, 0x1d, 0x000f);
24047                         MP_WritePhyUshort(sc, 0x1d, 0xb40f);
24048                         MP_WritePhyUshort(sc, 0x1d, 0xd06b);
24049                         MP_WritePhyUshort(sc, 0x1d, 0x000d);
24050                         MP_WritePhyUshort(sc, 0x1d, 0xb206);
24051                         MP_WritePhyUshort(sc, 0x1d, 0x7c01);
24052                         MP_WritePhyUshort(sc, 0x1d, 0x5800);
24053                         MP_WritePhyUshort(sc, 0x1d, 0x7c04);
24054                         MP_WritePhyUshort(sc, 0x1d, 0x5c00);
24055                         MP_WritePhyUshort(sc, 0x1d, 0x3010);
24056                         MP_WritePhyUshort(sc, 0x1d, 0x7c01);
24057                         MP_WritePhyUshort(sc, 0x1d, 0x5801);
24058                         MP_WritePhyUshort(sc, 0x1d, 0x7c04);
24059                         MP_WritePhyUshort(sc, 0x1d, 0x5c04);
24060                         MP_WritePhyUshort(sc, 0x1d, 0x3016);
24061                         MP_WritePhyUshort(sc, 0x1d, 0x307e);
24062                         MP_WritePhyUshort(sc, 0x1d, 0x30f4);
24063                         MP_WritePhyUshort(sc, 0x1d, 0x319f);
24064                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
24065                         MP_WritePhyUshort(sc, 0x1d, 0x4c60);
24066                         MP_WritePhyUshort(sc, 0x1d, 0x6803);
24067                         MP_WritePhyUshort(sc, 0x1d, 0x7d00);
24068                         MP_WritePhyUshort(sc, 0x1d, 0x6900);
24069                         MP_WritePhyUshort(sc, 0x1d, 0x6520);
24070                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24071                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24072                         MP_WritePhyUshort(sc, 0x1d, 0xaf03);
24073                         MP_WritePhyUshort(sc, 0x1d, 0x6115);
24074                         MP_WritePhyUshort(sc, 0x1d, 0x303a);
24075                         MP_WritePhyUshort(sc, 0x1d, 0x6097);
24076                         MP_WritePhyUshort(sc, 0x1d, 0x57e0);
24077                         MP_WritePhyUshort(sc, 0x1d, 0x580c);
24078                         MP_WritePhyUshort(sc, 0x1d, 0x588c);
24079                         MP_WritePhyUshort(sc, 0x1d, 0x5f80);
24080                         MP_WritePhyUshort(sc, 0x1d, 0x4827);
24081                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24082                         MP_WritePhyUshort(sc, 0x1d, 0x4c00);
24083                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24084                         MP_WritePhyUshort(sc, 0x1d, 0x4c10);
24085                         MP_WritePhyUshort(sc, 0x1d, 0x8400);
24086                         MP_WritePhyUshort(sc, 0x1d, 0x7c30);
24087                         MP_WritePhyUshort(sc, 0x1d, 0x6020);
24088                         MP_WritePhyUshort(sc, 0x1d, 0x48bf);
24089                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24090                         MP_WritePhyUshort(sc, 0x1d, 0x4c00);
24091                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24092                         MP_WritePhyUshort(sc, 0x1d, 0x4c01);
24093                         MP_WritePhyUshort(sc, 0x1d, 0xb802);
24094                         MP_WritePhyUshort(sc, 0x1d, 0x3053);
24095                         MP_WritePhyUshort(sc, 0x1d, 0x7c08);
24096                         MP_WritePhyUshort(sc, 0x1d, 0x6808);
24097                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24098                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24099                         MP_WritePhyUshort(sc, 0x1d, 0x7c10);
24100                         MP_WritePhyUshort(sc, 0x1d, 0x6810);
24101                         MP_WritePhyUshort(sc, 0x1d, 0xd6cf);
24102                         MP_WritePhyUshort(sc, 0x1d, 0x0002);
24103                         MP_WritePhyUshort(sc, 0x1d, 0x80fe);
24104                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
24105                         MP_WritePhyUshort(sc, 0x1d, 0x4c80);
24106                         MP_WritePhyUshort(sc, 0x1d, 0x7c10);
24107                         MP_WritePhyUshort(sc, 0x1d, 0x6800);
24108                         MP_WritePhyUshort(sc, 0x1d, 0x7c08);
24109                         MP_WritePhyUshort(sc, 0x1d, 0x6800);
24110                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24111                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24112                         MP_WritePhyUshort(sc, 0x1d, 0x7c23);
24113                         MP_WritePhyUshort(sc, 0x1d, 0x5c23);
24114                         MP_WritePhyUshort(sc, 0x1d, 0x481e);
24115                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24116                         MP_WritePhyUshort(sc, 0x1d, 0x4c00);
24117                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24118                         MP_WritePhyUshort(sc, 0x1d, 0x4c02);
24119                         MP_WritePhyUshort(sc, 0x1d, 0x5310);
24120                         MP_WritePhyUshort(sc, 0x1d, 0x81ff);
24121                         MP_WritePhyUshort(sc, 0x1d, 0x30c1);
24122                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
24123                         MP_WritePhyUshort(sc, 0x1d, 0x4d00);
24124                         MP_WritePhyUshort(sc, 0x1d, 0x4832);
24125                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24126                         MP_WritePhyUshort(sc, 0x1d, 0x4c00);
24127                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24128                         MP_WritePhyUshort(sc, 0x1d, 0x4c10);
24129                         MP_WritePhyUshort(sc, 0x1d, 0x7c08);
24130                         MP_WritePhyUshort(sc, 0x1d, 0x6000);
24131                         MP_WritePhyUshort(sc, 0x1d, 0xa4bd);
24132                         MP_WritePhyUshort(sc, 0x1d, 0xd9b3);
24133                         MP_WritePhyUshort(sc, 0x1d, 0x00fe);
24134                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
24135                         MP_WritePhyUshort(sc, 0x1d, 0x4d20);
24136                         MP_WritePhyUshort(sc, 0x1d, 0x7e00);
24137                         MP_WritePhyUshort(sc, 0x1d, 0x6200);
24138                         MP_WritePhyUshort(sc, 0x1d, 0x3001);
24139                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
24140                         MP_WritePhyUshort(sc, 0x1d, 0x4dc0);
24141                         MP_WritePhyUshort(sc, 0x1d, 0xd09d);
24142                         MP_WritePhyUshort(sc, 0x1d, 0x0002);
24143                         MP_WritePhyUshort(sc, 0x1d, 0xb4fe);
24144                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
24145                         MP_WritePhyUshort(sc, 0x1d, 0x4d80);
24146                         MP_WritePhyUshort(sc, 0x1d, 0x7c04);
24147                         MP_WritePhyUshort(sc, 0x1d, 0x6004);
24148                         MP_WritePhyUshort(sc, 0x1d, 0x6802);
24149                         MP_WritePhyUshort(sc, 0x1d, 0x6728);
24150                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24151                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24152                         MP_WritePhyUshort(sc, 0x1d, 0x7c08);
24153                         MP_WritePhyUshort(sc, 0x1d, 0x6000);
24154                         MP_WritePhyUshort(sc, 0x1d, 0x486c);
24155                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24156                         MP_WritePhyUshort(sc, 0x1d, 0x4c00);
24157                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24158                         MP_WritePhyUshort(sc, 0x1d, 0x4c01);
24159                         MP_WritePhyUshort(sc, 0x1d, 0x9503);
24160                         MP_WritePhyUshort(sc, 0x1d, 0x7e00);
24161                         MP_WritePhyUshort(sc, 0x1d, 0x6200);
24162                         MP_WritePhyUshort(sc, 0x1d, 0x571f);
24163                         MP_WritePhyUshort(sc, 0x1d, 0x5fbb);
24164                         MP_WritePhyUshort(sc, 0x1d, 0xaa05);
24165                         MP_WritePhyUshort(sc, 0x1d, 0x5b58);
24166                         MP_WritePhyUshort(sc, 0x1d, 0x7d80);
24167                         MP_WritePhyUshort(sc, 0x1d, 0x6100);
24168                         MP_WritePhyUshort(sc, 0x1d, 0x309a);
24169                         MP_WritePhyUshort(sc, 0x1d, 0x5b64);
24170                         MP_WritePhyUshort(sc, 0x1d, 0x7d80);
24171                         MP_WritePhyUshort(sc, 0x1d, 0x6080);
24172                         MP_WritePhyUshort(sc, 0x1d, 0xcdab);
24173                         MP_WritePhyUshort(sc, 0x1d, 0x0058);
24174                         MP_WritePhyUshort(sc, 0x1d, 0xcd8d);
24175                         MP_WritePhyUshort(sc, 0x1d, 0x0056);
24176                         MP_WritePhyUshort(sc, 0x1d, 0xd96b);
24177                         MP_WritePhyUshort(sc, 0x1d, 0x0054);
24178                         MP_WritePhyUshort(sc, 0x1d, 0xd0a0);
24179                         MP_WritePhyUshort(sc, 0x1d, 0x00d8);
24180                         MP_WritePhyUshort(sc, 0x1d, 0xcba0);
24181                         MP_WritePhyUshort(sc, 0x1d, 0x0003);
24182                         MP_WritePhyUshort(sc, 0x1d, 0x80ec);
24183                         MP_WritePhyUshort(sc, 0x1d, 0x30a7);
24184                         MP_WritePhyUshort(sc, 0x1d, 0x30b4);
24185                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
24186                         MP_WritePhyUshort(sc, 0x1d, 0x4ce0);
24187                         MP_WritePhyUshort(sc, 0x1d, 0x4832);
24188                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24189                         MP_WritePhyUshort(sc, 0x1d, 0x4c00);
24190                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24191                         MP_WritePhyUshort(sc, 0x1d, 0x4c08);
24192                         MP_WritePhyUshort(sc, 0x1d, 0x7c08);
24193                         MP_WritePhyUshort(sc, 0x1d, 0x6008);
24194                         MP_WritePhyUshort(sc, 0x1d, 0x8300);
24195                         MP_WritePhyUshort(sc, 0x1d, 0xb902);
24196                         MP_WritePhyUshort(sc, 0x1d, 0x307e);
24197                         MP_WritePhyUshort(sc, 0x1d, 0x3068);
24198                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
24199                         MP_WritePhyUshort(sc, 0x1d, 0x4da0);
24200                         MP_WritePhyUshort(sc, 0x1d, 0x6608);
24201                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24202                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24203                         MP_WritePhyUshort(sc, 0x1d, 0x56a0);
24204                         MP_WritePhyUshort(sc, 0x1d, 0x590c);
24205                         MP_WritePhyUshort(sc, 0x1d, 0x5fa0);
24206                         MP_WritePhyUshort(sc, 0x1d, 0xcba4);
24207                         MP_WritePhyUshort(sc, 0x1d, 0x0004);
24208                         MP_WritePhyUshort(sc, 0x1d, 0xcd8d);
24209                         MP_WritePhyUshort(sc, 0x1d, 0x0002);
24210                         MP_WritePhyUshort(sc, 0x1d, 0x80fc);
24211                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
24212                         MP_WritePhyUshort(sc, 0x1d, 0x4ca0);
24213                         MP_WritePhyUshort(sc, 0x1d, 0x7c08);
24214                         MP_WritePhyUshort(sc, 0x1d, 0x6408);
24215                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24216                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24217                         MP_WritePhyUshort(sc, 0x1d, 0x7d00);
24218                         MP_WritePhyUshort(sc, 0x1d, 0x6800);
24219                         MP_WritePhyUshort(sc, 0x1d, 0xb603);
24220                         MP_WritePhyUshort(sc, 0x1d, 0x7c10);
24221                         MP_WritePhyUshort(sc, 0x1d, 0x6010);
24222                         MP_WritePhyUshort(sc, 0x1d, 0x7d1f);
24223                         MP_WritePhyUshort(sc, 0x1d, 0x551f);
24224                         MP_WritePhyUshort(sc, 0x1d, 0x5fb3);
24225                         MP_WritePhyUshort(sc, 0x1d, 0xaa05);
24226                         MP_WritePhyUshort(sc, 0x1d, 0x7c80);
24227                         MP_WritePhyUshort(sc, 0x1d, 0x5800);
24228                         MP_WritePhyUshort(sc, 0x1d, 0x5b58);
24229                         MP_WritePhyUshort(sc, 0x1d, 0x30d7);
24230                         MP_WritePhyUshort(sc, 0x1d, 0x7c80);
24231                         MP_WritePhyUshort(sc, 0x1d, 0x5800);
24232                         MP_WritePhyUshort(sc, 0x1d, 0x5b64);
24233                         MP_WritePhyUshort(sc, 0x1d, 0x4827);
24234                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24235                         MP_WritePhyUshort(sc, 0x1d, 0x4c00);
24236                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24237                         MP_WritePhyUshort(sc, 0x1d, 0x4c10);
24238                         MP_WritePhyUshort(sc, 0x1d, 0x8400);
24239                         MP_WritePhyUshort(sc, 0x1d, 0x7c10);
24240                         MP_WritePhyUshort(sc, 0x1d, 0x6000);
24241                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
24242                         MP_WritePhyUshort(sc, 0x1d, 0x4cc0);
24243                         MP_WritePhyUshort(sc, 0x1d, 0x7d00);
24244                         MP_WritePhyUshort(sc, 0x1d, 0x6400);
24245                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24246                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24247                         MP_WritePhyUshort(sc, 0x1d, 0x5fbb);
24248                         MP_WritePhyUshort(sc, 0x1d, 0x4824);
24249                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24250                         MP_WritePhyUshort(sc, 0x1d, 0x4c00);
24251                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24252                         MP_WritePhyUshort(sc, 0x1d, 0x4c04);
24253                         MP_WritePhyUshort(sc, 0x1d, 0x8200);
24254                         MP_WritePhyUshort(sc, 0x1d, 0x7ce0);
24255                         MP_WritePhyUshort(sc, 0x1d, 0x5400);
24256                         MP_WritePhyUshort(sc, 0x1d, 0x7d00);
24257                         MP_WritePhyUshort(sc, 0x1d, 0x6500);
24258                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24259                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24260                         MP_WritePhyUshort(sc, 0x1d, 0x30a7);
24261                         MP_WritePhyUshort(sc, 0x1d, 0x3001);
24262                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
24263                         MP_WritePhyUshort(sc, 0x1d, 0x4e00);
24264                         MP_WritePhyUshort(sc, 0x1d, 0x4007);
24265                         MP_WritePhyUshort(sc, 0x1d, 0x4400);
24266                         MP_WritePhyUshort(sc, 0x1d, 0x5310);
24267                         MP_WritePhyUshort(sc, 0x1d, 0x6800);
24268                         MP_WritePhyUshort(sc, 0x1d, 0x673e);
24269                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24270                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24271                         MP_WritePhyUshort(sc, 0x1d, 0x570f);
24272                         MP_WritePhyUshort(sc, 0x1d, 0x5fff);
24273                         MP_WritePhyUshort(sc, 0x1d, 0xaa05);
24274                         MP_WritePhyUshort(sc, 0x1d, 0x585b);
24275                         MP_WritePhyUshort(sc, 0x1d, 0x7d80);
24276                         MP_WritePhyUshort(sc, 0x1d, 0x6100);
24277                         MP_WritePhyUshort(sc, 0x1d, 0x3107);
24278                         MP_WritePhyUshort(sc, 0x1d, 0x5867);
24279                         MP_WritePhyUshort(sc, 0x1d, 0x7d80);
24280                         MP_WritePhyUshort(sc, 0x1d, 0x6080);
24281                         MP_WritePhyUshort(sc, 0x1d, 0x9403);
24282                         MP_WritePhyUshort(sc, 0x1d, 0x7e00);
24283                         MP_WritePhyUshort(sc, 0x1d, 0x6200);
24284                         MP_WritePhyUshort(sc, 0x1d, 0xcda3);
24285                         MP_WritePhyUshort(sc, 0x1d, 0x00e8);
24286                         MP_WritePhyUshort(sc, 0x1d, 0xcd85);
24287                         MP_WritePhyUshort(sc, 0x1d, 0x00e6);
24288                         MP_WritePhyUshort(sc, 0x1d, 0xd96b);
24289                         MP_WritePhyUshort(sc, 0x1d, 0x00e4);
24290                         MP_WritePhyUshort(sc, 0x1d, 0x96e4);
24291                         MP_WritePhyUshort(sc, 0x1d, 0x6800);
24292                         MP_WritePhyUshort(sc, 0x1d, 0x673e);
24293                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24294                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24295                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
24296                         MP_WritePhyUshort(sc, 0x1d, 0x4e20);
24297                         MP_WritePhyUshort(sc, 0x1d, 0x96dd);
24298                         MP_WritePhyUshort(sc, 0x1d, 0x8b04);
24299                         MP_WritePhyUshort(sc, 0x1d, 0x7c08);
24300                         MP_WritePhyUshort(sc, 0x1d, 0x5008);
24301                         MP_WritePhyUshort(sc, 0x1d, 0xab03);
24302                         MP_WritePhyUshort(sc, 0x1d, 0x7c08);
24303                         MP_WritePhyUshort(sc, 0x1d, 0x5000);
24304                         MP_WritePhyUshort(sc, 0x1d, 0x6801);
24305                         MP_WritePhyUshort(sc, 0x1d, 0x677e);
24306                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24307                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24308                         MP_WritePhyUshort(sc, 0x1d, 0xdb7c);
24309                         MP_WritePhyUshort(sc, 0x1d, 0x00ee);
24310                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24311                         MP_WritePhyUshort(sc, 0x1d, 0x7fe1);
24312                         MP_WritePhyUshort(sc, 0x1d, 0x4e40);
24313                         MP_WritePhyUshort(sc, 0x1d, 0x4837);
24314                         MP_WritePhyUshort(sc, 0x1d, 0x4418);
24315                         MP_WritePhyUshort(sc, 0x1d, 0x41c7);
24316                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
24317                         MP_WritePhyUshort(sc, 0x1d, 0x4e40);
24318                         MP_WritePhyUshort(sc, 0x1d, 0x7c40);
24319                         MP_WritePhyUshort(sc, 0x1d, 0x5400);
24320                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24321                         MP_WritePhyUshort(sc, 0x1d, 0x4c01);
24322                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24323                         MP_WritePhyUshort(sc, 0x1d, 0x4c01);
24324                         MP_WritePhyUshort(sc, 0x1d, 0x8fc2);
24325                         MP_WritePhyUshort(sc, 0x1d, 0xd2a0);
24326                         MP_WritePhyUshort(sc, 0x1d, 0x004b);
24327                         MP_WritePhyUshort(sc, 0x1d, 0x9204);
24328                         MP_WritePhyUshort(sc, 0x1d, 0xa042);
24329                         MP_WritePhyUshort(sc, 0x1d, 0x3132);
24330                         MP_WritePhyUshort(sc, 0x1d, 0x30f4);
24331                         MP_WritePhyUshort(sc, 0x1d, 0x7fe1);
24332                         MP_WritePhyUshort(sc, 0x1d, 0x4e60);
24333                         MP_WritePhyUshort(sc, 0x1d, 0x489c);
24334                         MP_WritePhyUshort(sc, 0x1d, 0x4628);
24335                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
24336                         MP_WritePhyUshort(sc, 0x1d, 0x4e60);
24337                         MP_WritePhyUshort(sc, 0x1d, 0x7e28);
24338                         MP_WritePhyUshort(sc, 0x1d, 0x4628);
24339                         MP_WritePhyUshort(sc, 0x1d, 0x7c40);
24340                         MP_WritePhyUshort(sc, 0x1d, 0x5400);
24341                         MP_WritePhyUshort(sc, 0x1d, 0x7c01);
24342                         MP_WritePhyUshort(sc, 0x1d, 0x5800);
24343                         MP_WritePhyUshort(sc, 0x1d, 0x7c04);
24344                         MP_WritePhyUshort(sc, 0x1d, 0x5c00);
24345                         MP_WritePhyUshort(sc, 0x1d, 0x41e8);
24346                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24347                         MP_WritePhyUshort(sc, 0x1d, 0x4c01);
24348                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24349                         MP_WritePhyUshort(sc, 0x1d, 0x4c01);
24350                         MP_WritePhyUshort(sc, 0x1d, 0x8fa8);
24351                         MP_WritePhyUshort(sc, 0x1d, 0xb241);
24352                         MP_WritePhyUshort(sc, 0x1d, 0xa02a);
24353                         MP_WritePhyUshort(sc, 0x1d, 0x314c);
24354                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
24355                         MP_WritePhyUshort(sc, 0x1d, 0x4ea0);
24356                         MP_WritePhyUshort(sc, 0x1d, 0x7c02);
24357                         MP_WritePhyUshort(sc, 0x1d, 0x4402);
24358                         MP_WritePhyUshort(sc, 0x1d, 0x4448);
24359                         MP_WritePhyUshort(sc, 0x1d, 0x4894);
24360                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24361                         MP_WritePhyUshort(sc, 0x1d, 0x4c01);
24362                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24363                         MP_WritePhyUshort(sc, 0x1d, 0x4c03);
24364                         MP_WritePhyUshort(sc, 0x1d, 0x4824);
24365                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24366                         MP_WritePhyUshort(sc, 0x1d, 0x4c07);
24367                         MP_WritePhyUshort(sc, 0x1d, 0x41ef);
24368                         MP_WritePhyUshort(sc, 0x1d, 0x41ff);
24369                         MP_WritePhyUshort(sc, 0x1d, 0x4891);
24370                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24371                         MP_WritePhyUshort(sc, 0x1d, 0x4c07);
24372                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24373                         MP_WritePhyUshort(sc, 0x1d, 0x4c17);
24374                         MP_WritePhyUshort(sc, 0x1d, 0x8400);
24375                         MP_WritePhyUshort(sc, 0x1d, 0x8ef8);
24376                         MP_WritePhyUshort(sc, 0x1d, 0x41c7);
24377                         MP_WritePhyUshort(sc, 0x1d, 0x8f8d);
24378                         MP_WritePhyUshort(sc, 0x1d, 0x92d5);
24379                         MP_WritePhyUshort(sc, 0x1d, 0xa10f);
24380                         MP_WritePhyUshort(sc, 0x1d, 0xd480);
24381                         MP_WritePhyUshort(sc, 0x1d, 0x0008);
24382                         MP_WritePhyUshort(sc, 0x1d, 0xd580);
24383                         MP_WritePhyUshort(sc, 0x1d, 0x00b8);
24384                         MP_WritePhyUshort(sc, 0x1d, 0xa202);
24385                         MP_WritePhyUshort(sc, 0x1d, 0x3167);
24386                         MP_WritePhyUshort(sc, 0x1d, 0x7c04);
24387                         MP_WritePhyUshort(sc, 0x1d, 0x4404);
24388                         MP_WritePhyUshort(sc, 0x1d, 0x3167);
24389                         MP_WritePhyUshort(sc, 0x1d, 0xd484);
24390                         MP_WritePhyUshort(sc, 0x1d, 0x00f3);
24391                         MP_WritePhyUshort(sc, 0x1d, 0xd484);
24392                         MP_WritePhyUshort(sc, 0x1d, 0x00f1);
24393                         MP_WritePhyUshort(sc, 0x1d, 0x30f4);
24394                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
24395                         MP_WritePhyUshort(sc, 0x1d, 0x4ee0);
24396                         MP_WritePhyUshort(sc, 0x1d, 0x7c40);
24397                         MP_WritePhyUshort(sc, 0x1d, 0x5400);
24398                         MP_WritePhyUshort(sc, 0x1d, 0x4488);
24399                         MP_WritePhyUshort(sc, 0x1d, 0x41cf);
24400                         MP_WritePhyUshort(sc, 0x1d, 0x30f4);
24401                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
24402                         MP_WritePhyUshort(sc, 0x1d, 0x4ec0);
24403                         MP_WritePhyUshort(sc, 0x1d, 0x48f3);
24404                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24405                         MP_WritePhyUshort(sc, 0x1d, 0x4c01);
24406                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24407                         MP_WritePhyUshort(sc, 0x1d, 0x4c09);
24408                         MP_WritePhyUshort(sc, 0x1d, 0x4508);
24409                         MP_WritePhyUshort(sc, 0x1d, 0x41c7);
24410                         MP_WritePhyUshort(sc, 0x1d, 0x8fb0);
24411                         MP_WritePhyUshort(sc, 0x1d, 0xd218);
24412                         MP_WritePhyUshort(sc, 0x1d, 0x00ae);
24413                         MP_WritePhyUshort(sc, 0x1d, 0xd2a4);
24414                         MP_WritePhyUshort(sc, 0x1d, 0x009e);
24415                         MP_WritePhyUshort(sc, 0x1d, 0x3188);
24416                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
24417                         MP_WritePhyUshort(sc, 0x1d, 0x4e80);
24418                         MP_WritePhyUshort(sc, 0x1d, 0x4832);
24419                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24420                         MP_WritePhyUshort(sc, 0x1d, 0x4c01);
24421                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
24422                         MP_WritePhyUshort(sc, 0x1d, 0x4c11);
24423                         MP_WritePhyUshort(sc, 0x1d, 0x4428);
24424                         MP_WritePhyUshort(sc, 0x1d, 0x7c40);
24425                         MP_WritePhyUshort(sc, 0x1d, 0x5440);
24426                         MP_WritePhyUshort(sc, 0x1d, 0x7c01);
24427                         MP_WritePhyUshort(sc, 0x1d, 0x5801);
24428                         MP_WritePhyUshort(sc, 0x1d, 0x7c04);
24429                         MP_WritePhyUshort(sc, 0x1d, 0x5c04);
24430                         MP_WritePhyUshort(sc, 0x1d, 0x41e8);
24431                         MP_WritePhyUshort(sc, 0x1d, 0xa4b3);
24432                         MP_WritePhyUshort(sc, 0x1d, 0x319d);
24433                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
24434                         MP_WritePhyUshort(sc, 0x1d, 0x4f20);
24435                         MP_WritePhyUshort(sc, 0x1d, 0x6800);
24436                         MP_WritePhyUshort(sc, 0x1d, 0x673e);
24437                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24438                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
24439                         MP_WritePhyUshort(sc, 0x1d, 0x570f);
24440                         MP_WritePhyUshort(sc, 0x1d, 0x5fff);
24441                         MP_WritePhyUshort(sc, 0x1d, 0xaa04);
24442                         MP_WritePhyUshort(sc, 0x1d, 0x585b);
24443                         MP_WritePhyUshort(sc, 0x1d, 0x6100);
24444                         MP_WritePhyUshort(sc, 0x1d, 0x31ad);
24445                         MP_WritePhyUshort(sc, 0x1d, 0x5867);
24446                         MP_WritePhyUshort(sc, 0x1d, 0x6080);
24447                         MP_WritePhyUshort(sc, 0x1d, 0xbcf2);
24448                         MP_WritePhyUshort(sc, 0x1d, 0x3001);
24449                         MP_WritePhyUshort(sc, 0x1f, 0x0004);
24450                         MP_WritePhyUshort(sc, 0x1c, 0x0200);
24451                         MP_WritePhyUshort(sc, 0x19, 0x7030);
24452                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
24453                 }
24454
24455                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
24456                 MP_WritePhyUshort(sc, 0x11, 0x83BA);
24457                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24458
24459                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
24460                 ClearEthPhyBit(sc, 0x1A, BIT_2);
24461                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24462
24463                 if (phy_power_saving == 1) {
24464                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
24465                         MP_WritePhyUshort(sc, 0x18, 0x8310);
24466                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
24467                 } else {
24468                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
24469                         MP_WritePhyUshort(sc, 0x18, 0x0310);
24470                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
24471                         DELAY(20000);
24472                 }
24473
24474                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24475                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
24476                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
24477                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
24478                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
24479                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
24480                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24481                 MP_WritePhyUshort(sc, 0x0D, 0x0003);
24482                 MP_WritePhyUshort(sc, 0x0E, 0x0015);
24483                 MP_WritePhyUshort(sc, 0x0D, 0x4003);
24484                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
24485                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
24486         } else if (sc->re_type == MACFG_56) {
24487                 MP_WritePhyUshort(sc, 0x1F, 0x0A46);
24488                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
24489                 TmpUshort = (PhyRegValue & BIT_8) ? 0 : BIT_15;
24490
24491                 MP_WritePhyUshort(sc, 0x1F, 0x0BCC);
24492                 ClearEthPhyBit(sc, 0x12, BIT_15);
24493                 SetEthPhyBit(sc, 0x12, TmpUshort);
24494
24495
24496                 MP_WritePhyUshort(sc, 0x1F, 0x0A46);
24497                 PhyRegValue = MP_ReadPhyUshort(sc, 0x13);
24498                 TmpUshort = (PhyRegValue & BIT_8) ? BIT_1 : 0;
24499
24500                 MP_WritePhyUshort(sc, 0x1F, 0x0C41);
24501                 ClearEthPhyBit(sc, 0x15, BIT_1);
24502                 SetEthPhyBit(sc, 0x15, TmpUshort);
24503
24504                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
24505                 SetEthPhyBit(sc, 0x11, (BIT_3 | BIT_2));
24506                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24507
24508
24509                 MP_WritePhyUshort(sc, 0x1F, 0x0BCC);
24510                 ClearEthPhyBit(sc, 0x14, BIT_8);
24511                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
24512                 SetEthPhyBit(sc, 0x11, BIT_7);
24513                 SetEthPhyBit(sc, 0x11, BIT_6);
24514                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24515                 MP_WritePhyUshort(sc, 0x13, 0x8084);
24516                 ClearEthPhyBit(sc, 0x14, (BIT_14 | BIT_13));
24517                 SetEthPhyBit(sc, 0x10, BIT_12);
24518                 SetEthPhyBit(sc, 0x10, BIT_1);
24519                 SetEthPhyBit(sc, 0x10, BIT_0);
24520                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24521
24522
24523                 MP_WritePhyUshort(sc, 0x1F, 0x0A4B);
24524                 SetEthPhyBit(sc, 0x11, BIT_2);
24525                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24526
24527
24528
24529                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24530                 MP_WritePhyUshort(sc, 0x13, 0x8012);
24531                 SetEthPhyBit(sc, 0x14, BIT_15);
24532                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24533
24534
24535
24536                 MP_WritePhyUshort(sc, 0x1F, 0x0C42);
24537                 ClearAndSetEthPhyBit(sc,
24538                                      0x11,
24539                                      BIT_13,
24540                                      BIT_14
24541                                     );
24542                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24543
24544                 if (phy_power_saving == 1) {
24545                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24546                         SetEthPhyBit(sc, 0x10, BIT_2);
24547                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
24548                 } else {
24549                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24550                         ClearEthPhyBit(sc, 0x10, BIT_2);
24551                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
24552                         DELAY(20000);
24553                 }
24554
24555                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24556                 MP_WritePhyUshort(sc, 0x13, 0x809A);
24557                 MP_WritePhyUshort(sc, 0x14, 0x8022);
24558                 MP_WritePhyUshort(sc, 0x13, 0x80A0);
24559                 ClearAndSetEthPhyBit(sc,
24560                                      0x14,
24561                                      0xFF00,
24562                                      0x1000
24563                                     );
24564                 MP_WritePhyUshort(sc, 0x13, 0x8088);
24565                 MP_WritePhyUshort(sc, 0x14, 0x9222);
24566                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24567
24568                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24569                 MP_WritePhyUshort(sc, 0x13, 0x8011);
24570                 ClearEthPhyBit(sc, 0x14, BIT_14);
24571                 MP_WritePhyUshort(sc, 0x1F, 0x0A40);
24572                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24573                 MP_WritePhyUshort(sc, 0x00, 0x9200);
24574         } else if (sc->re_type == MACFG_58) {
24575                 MP_WritePhyUshort(sc, 0x1F, 0x0BCC);
24576                 ClearEthPhyBit(sc, 0x14, BIT_8);
24577                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
24578                 SetEthPhyBit(sc, 0x11, BIT_7);
24579                 SetEthPhyBit(sc, 0x11, BIT_6);
24580                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24581                 MP_WritePhyUshort(sc, 0x13, 0x8084);
24582                 ClearEthPhyBit(sc, 0x14, (BIT_14 | BIT_13));
24583                 SetEthPhyBit(sc, 0x10, BIT_12);
24584                 SetEthPhyBit(sc, 0x10, BIT_1);
24585                 SetEthPhyBit(sc, 0x10, BIT_0);
24586                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24587
24588                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24589                 MP_WritePhyUshort(sc, 0x13, 0x8012);
24590                 SetEthPhyBit(sc, 0x14, BIT_15);
24591                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24592
24593                 MP_WritePhyUshort(sc, 0x1F, 0x0C42);
24594                 ClearAndSetEthPhyBit(sc,
24595                                      0x11,
24596                                      BIT_13,
24597                                      BIT_14
24598                                     );
24599                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24600
24601                 if (phy_power_saving == 1) {
24602                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24603                         SetEthPhyBit(sc, 0x10, BIT_2);
24604                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
24605                 } else {
24606                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24607                         ClearEthPhyBit(sc, 0x10, BIT_2);
24608                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
24609                         DELAY(20000);
24610                 }
24611
24612                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24613                 MP_WritePhyUshort(sc, 0x13, 0x8011);
24614                 ClearEthPhyBit(sc, 0x14, BIT_14);
24615                 MP_WritePhyUshort(sc, 0x1F, 0x0A40);
24616                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24617                 MP_WritePhyUshort(sc, 0x00, 0x9200);
24618         } else if (sc->re_type == MACFG_59) {
24619                 MP_WritePhyUshort(sc, 0x1F, 0x0BCC);
24620                 ClearEthPhyBit(sc, 0x14, BIT_8);
24621                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
24622                 SetEthPhyBit(sc, 0x11, BIT_7);
24623                 SetEthPhyBit(sc, 0x11, BIT_6);
24624                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24625                 MP_WritePhyUshort(sc, 0x13, 0x8084);
24626                 ClearEthPhyBit(sc, 0x14, (BIT_14 | BIT_13));
24627                 SetEthPhyBit(sc, 0x10, BIT_12);
24628                 SetEthPhyBit(sc, 0x10, BIT_1);
24629                 SetEthPhyBit(sc, 0x10, BIT_0);
24630
24631
24632                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24633                 MP_WritePhyUshort(sc, 0x13, 0x8012);
24634                 SetEthPhyBit(sc, 0x14, BIT_15);
24635                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24636
24637                 MP_WritePhyUshort(sc, 0x1F, 0x0BCE);
24638                 MP_WritePhyUshort(sc, 0x12, 0x8860);
24639                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24640
24641                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24642                 MP_WritePhyUshort(sc, 0x13, 0x80F3);
24643                 ClearAndSetEthPhyBit(sc,
24644                                      0x14,
24645                                      0xFF00,
24646                                      0x8B00
24647                                     );
24648                 MP_WritePhyUshort(sc, 0x13, 0x80F0);
24649                 ClearAndSetEthPhyBit(sc,
24650                                      0x14,
24651                                      0xFF00,
24652                                      0x3A00
24653                                     );
24654                 MP_WritePhyUshort(sc, 0x13, 0x80EF);
24655                 ClearAndSetEthPhyBit(sc,
24656                                      0x14,
24657                                      0xFF00,
24658                                      0x0500
24659                                     );
24660                 MP_WritePhyUshort(sc, 0x13, 0x80F6);
24661                 ClearAndSetEthPhyBit(sc,
24662                                      0x14,
24663                                      0xFF00,
24664                                      0x6E00
24665                                     );
24666                 MP_WritePhyUshort(sc, 0x13, 0x80EC);
24667                 ClearAndSetEthPhyBit(sc,
24668                                      0x14,
24669                                      0xFF00,
24670                                      0x6800
24671                                     );
24672                 MP_WritePhyUshort(sc, 0x13, 0x80ED);
24673                 ClearAndSetEthPhyBit(sc,
24674                                      0x14,
24675                                      0xFF00,
24676                                      0x7C00
24677                                     );
24678                 MP_WritePhyUshort(sc, 0x13, 0x80F2);
24679                 ClearAndSetEthPhyBit(sc,
24680                                      0x14,
24681                                      0xFF00,
24682                                      0xF400
24683                                     );
24684                 MP_WritePhyUshort(sc, 0x13, 0x80F4);
24685                 ClearAndSetEthPhyBit(sc,
24686                                      0x14,
24687                                      0xFF00,
24688                                      0x8500
24689                                     );
24690
24691                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24692                 MP_WritePhyUshort(sc, 0x13, 0x8110);
24693                 ClearAndSetEthPhyBit(sc,
24694                                      0x14,
24695                                      0xFF00,
24696                                      0xA800
24697                                     );
24698                 MP_WritePhyUshort(sc, 0x13, 0x810F);
24699                 ClearAndSetEthPhyBit(sc,
24700                                      0x14,
24701                                      0xFF00,
24702                                      0x1D00
24703                                     );
24704                 MP_WritePhyUshort(sc, 0x13, 0x8111);
24705                 ClearAndSetEthPhyBit(sc,
24706                                      0x14,
24707                                      0xFF00,
24708                                      0xF500
24709                                     );
24710                 MP_WritePhyUshort(sc, 0x13, 0x8113);
24711                 ClearAndSetEthPhyBit(sc,
24712                                      0x14,
24713                                      0xFF00,
24714                                      0x6100
24715                                     );
24716                 MP_WritePhyUshort(sc, 0x13, 0x8115);
24717                 ClearAndSetEthPhyBit(sc,
24718                                      0x14,
24719                                      0xFF00,
24720                                      0x9200
24721                                     );
24722                 MP_WritePhyUshort(sc, 0x13, 0x810E);
24723                 ClearAndSetEthPhyBit(sc,
24724                                      0x14,
24725                                      0xFF00,
24726                                      0x0400
24727                                     );
24728                 MP_WritePhyUshort(sc, 0x13, 0x810C);
24729                 ClearAndSetEthPhyBit(sc,
24730                                      0x14,
24731                                      0xFF00,
24732                                      0x7C00
24733                                     );
24734                 MP_WritePhyUshort(sc, 0x13, 0x810B);
24735                 ClearAndSetEthPhyBit(sc,
24736                                      0x14,
24737                                      0xFF00,
24738                                      0x5A00
24739                                     );
24740
24741                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24742                 MP_WritePhyUshort(sc, 0x13, 0x80D1);
24743                 ClearAndSetEthPhyBit(sc,
24744                                      0x14,
24745                                      0xFF00,
24746                                      0xFF00
24747                                     );
24748                 MP_WritePhyUshort(sc, 0x13, 0x80CD);
24749                 ClearAndSetEthPhyBit(sc,
24750                                      0x14,
24751                                      0xFF00,
24752                                      0x9E00
24753                                     );
24754                 MP_WritePhyUshort(sc, 0x13, 0x80D3);
24755                 ClearAndSetEthPhyBit(sc,
24756                                      0x14,
24757                                      0xFF00,
24758                                      0x0E00
24759                                     );
24760                 MP_WritePhyUshort(sc, 0x13, 0x80D5);
24761                 ClearAndSetEthPhyBit(sc,
24762                                      0x14,
24763                                      0xFF00,
24764                                      0xCA00
24765                                     );
24766                 MP_WritePhyUshort(sc, 0x13, 0x80D7);
24767                 ClearAndSetEthPhyBit(sc,
24768                                      0x14,
24769                                      0xFF00,
24770                                      0x8400
24771                                     );
24772
24773                 if (phy_power_saving == 1) {
24774                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24775                         SetEthPhyBit(sc, 0x10, BIT_2);
24776                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
24777                 } else {
24778                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24779                         ClearEthPhyBit(sc, 0x10, BIT_2);
24780                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
24781                         DELAY(20000);
24782                 }
24783
24784                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24785                 MP_WritePhyUshort(sc, 0x13, 0x8011);
24786                 ClearEthPhyBit(sc, 0x14, BIT_14);
24787                 MP_WritePhyUshort(sc, 0x1F, 0x0A40);
24788                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24789                 MP_WritePhyUshort(sc, 0x00, 0x9200);
24790         } else if (sc->re_type == MACFG_60) {
24791                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24792                 MP_WritePhyUshort(sc, 0x13, 0x8012);
24793                 SetEthPhyBit(sc, 0x14, BIT_15);
24794                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24795
24796                 MP_WritePhyUshort(sc, 0x1F, 0x0BCE);
24797                 MP_WritePhyUshort(sc, 0x12, 0x8860);
24798                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24799
24800                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24801                 MP_WritePhyUshort(sc, 0x13, 0x80F3);
24802                 ClearAndSetEthPhyBit(sc,
24803                                      0x14,
24804                                      0xFF00,
24805                                      0x8B00
24806                                     );
24807                 MP_WritePhyUshort(sc, 0x13, 0x80F0);
24808                 ClearAndSetEthPhyBit(sc,
24809                                      0x14,
24810                                      0xFF00,
24811                                      0x3A00
24812                                     );
24813                 MP_WritePhyUshort(sc, 0x13, 0x80EF);
24814                 ClearAndSetEthPhyBit(sc,
24815                                      0x14,
24816                                      0xFF00,
24817                                      0x0500
24818                                     );
24819                 MP_WritePhyUshort(sc, 0x13, 0x80F6);
24820                 ClearAndSetEthPhyBit(sc,
24821                                      0x14,
24822                                      0xFF00,
24823                                      0x6E00
24824                                     );
24825                 MP_WritePhyUshort(sc, 0x13, 0x80EC);
24826                 ClearAndSetEthPhyBit(sc,
24827                                      0x14,
24828                                      0xFF00,
24829                                      0x6800
24830                                     );
24831                 MP_WritePhyUshort(sc, 0x13, 0x80ED);
24832                 ClearAndSetEthPhyBit(sc,
24833                                      0x14,
24834                                      0xFF00,
24835                                      0x7C00
24836                                     );
24837                 MP_WritePhyUshort(sc, 0x13, 0x80F2);
24838                 ClearAndSetEthPhyBit(sc,
24839                                      0x14,
24840                                      0xFF00,
24841                                      0xF400
24842                                     );
24843                 MP_WritePhyUshort(sc, 0x13, 0x80F4);
24844                 ClearAndSetEthPhyBit(sc,
24845                                      0x14,
24846                                      0xFF00,
24847                                      0x8500
24848                                     );
24849
24850                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24851                 MP_WritePhyUshort(sc, 0x13, 0x8110);
24852                 ClearAndSetEthPhyBit(sc,
24853                                      0x14,
24854                                      0xFF00,
24855                                      0xA800
24856                                     );
24857                 MP_WritePhyUshort(sc, 0x13, 0x810F);
24858                 ClearAndSetEthPhyBit(sc,
24859                                      0x14,
24860                                      0xFF00,
24861                                      0x1D00
24862                                     );
24863                 MP_WritePhyUshort(sc, 0x13, 0x8111);
24864                 ClearAndSetEthPhyBit(sc,
24865                                      0x14,
24866                                      0xFF00,
24867                                      0xF500
24868                                     );
24869                 MP_WritePhyUshort(sc, 0x13, 0x8113);
24870                 ClearAndSetEthPhyBit(sc,
24871                                      0x14,
24872                                      0xFF00,
24873                                      0x6100
24874                                     );
24875                 MP_WritePhyUshort(sc, 0x13, 0x8115);
24876                 ClearAndSetEthPhyBit(sc,
24877                                      0x14,
24878                                      0xFF00,
24879                                      0x9200
24880                                     );
24881                 MP_WritePhyUshort(sc, 0x13, 0x810E);
24882                 ClearAndSetEthPhyBit(sc,
24883                                      0x14,
24884                                      0xFF00,
24885                                      0x0400
24886                                     );
24887                 MP_WritePhyUshort(sc, 0x13, 0x810C);
24888                 ClearAndSetEthPhyBit(sc,
24889                                      0x14,
24890                                      0xFF00,
24891                                      0x7C00
24892                                     );
24893                 MP_WritePhyUshort(sc, 0x13, 0x810B);
24894                 ClearAndSetEthPhyBit(sc,
24895                                      0x14,
24896                                      0xFF00,
24897                                      0x5A00
24898                                     );
24899
24900                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24901                 MP_WritePhyUshort(sc, 0x13, 0x80D1);
24902                 ClearAndSetEthPhyBit(sc,
24903                                      0x14,
24904                                      0xFF00,
24905                                      0xFF00
24906                                     );
24907                 MP_WritePhyUshort(sc, 0x13, 0x80CD);
24908                 ClearAndSetEthPhyBit(sc,
24909                                      0x14,
24910                                      0xFF00,
24911                                      0x9E00
24912                                     );
24913                 MP_WritePhyUshort(sc, 0x13, 0x80D3);
24914                 ClearAndSetEthPhyBit(sc,
24915                                      0x14,
24916                                      0xFF00,
24917                                      0x0E00
24918                                     );
24919                 MP_WritePhyUshort(sc, 0x13, 0x80D5);
24920                 ClearAndSetEthPhyBit(sc,
24921                                      0x14,
24922                                      0xFF00,
24923                                      0xCA00
24924                                     );
24925                 MP_WritePhyUshort(sc, 0x13, 0x80D7);
24926                 ClearAndSetEthPhyBit(sc,
24927                                      0x14,
24928                                      0xFF00,
24929                                      0x8400
24930                                     );
24931
24932                 if (phy_power_saving == 1) {
24933                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24934                         SetEthPhyBit(sc, 0x10, BIT_2);
24935                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
24936                 } else {
24937                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24938                         ClearEthPhyBit(sc, 0x10, BIT_2);
24939                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
24940                         DELAY(20000);
24941                 }
24942
24943                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24944                 MP_WritePhyUshort(sc, 0x13, 0x8011);
24945                 ClearEthPhyBit(sc, 0x14, BIT_14);
24946                 MP_WritePhyUshort(sc, 0x1F, 0x0A40);
24947                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24948                 MP_WritePhyUshort(sc, 0x00, 0x9200);
24949         } else if (sc->re_type == MACFG_61) {
24950                 MP_WritePhyUshort(sc, 0x1f, 0x0A43);
24951                 MP_WritePhyUshort(sc, 0x13, 0x8146);
24952                 MP_WritePhyUshort(sc, 0x14, 0x0000);
24953
24954                 MP_WritePhyUshort(sc, 0x1f, 0x0B82);
24955                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
24956                 PhyRegValue &= ~(BIT_4);
24957                 MP_WritePhyUshort(sc, 0x10, PhyRegValue);
24958
24959                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
24960                 SetEthPhyBit(sc, 0x11, (BIT_3 | BIT_2));
24961                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24962
24963
24964                 MP_WritePhyUshort(sc, 0x1F, 0x0BCC);
24965                 ClearEthPhyBit(sc, 0x14, BIT_8);
24966                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
24967                 SetEthPhyBit(sc, 0x11, BIT_7);
24968                 SetEthPhyBit(sc, 0x11, BIT_6);
24969                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24970                 MP_WritePhyUshort(sc, 0x13, 0x8084);
24971                 ClearEthPhyBit(sc, 0x14, (BIT_14 | BIT_13));
24972                 SetEthPhyBit(sc, 0x10, BIT_12);
24973                 SetEthPhyBit(sc, 0x10, BIT_1);
24974                 SetEthPhyBit(sc, 0x10, BIT_0);
24975                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24976
24977                 MP_WritePhyUshort(sc, 0x1F, 0x0A4B);
24978                 SetEthPhyBit(sc, 0x11, BIT_2);
24979                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24980
24981                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24982                 MP_WritePhyUshort(sc, 0x13, 0x8012);
24983                 SetEthPhyBit(sc, 0x14, BIT_15);
24984                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24985
24986                 MP_WritePhyUshort(sc, 0x1F, 0x0C42);
24987                 ClearAndSetEthPhyBit(sc,
24988                                      0x11,
24989                                      BIT_13,
24990                                      BIT_14
24991                                     );
24992                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
24993
24994                 if (phy_power_saving == 1) {
24995                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
24996                         SetEthPhyBit(sc, 0x10, BIT_2);
24997                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
24998                 } else {
24999                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25000                         ClearEthPhyBit(sc, 0x10, BIT_2);
25001                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
25002                         DELAY(20000);
25003                 }
25004
25005                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25006                 MP_WritePhyUshort(sc, 0x13, 0x8011);
25007                 ClearEthPhyBit(sc, 0x14, BIT_14);
25008                 MP_WritePhyUshort(sc, 0x1F, 0x0A40);
25009                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25010                 MP_WritePhyUshort(sc, 0x00, 0x9200);
25011         } else if (sc->re_type == MACFG_62 || sc->re_type == MACFG_67) {
25012                 MP_WritePhyUshort(sc, 0x1F, 0x0BCC);
25013                 ClearEthPhyBit(sc, 0x14, BIT_8);
25014                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
25015                 SetEthPhyBit(sc, 0x11, BIT_7);
25016                 SetEthPhyBit(sc, 0x11, BIT_6);
25017                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25018                 MP_WritePhyUshort(sc, 0x13, 0x8084);
25019                 ClearEthPhyBit(sc, 0x14, (BIT_14 | BIT_13));
25020                 SetEthPhyBit(sc, 0x10, BIT_12);
25021                 SetEthPhyBit(sc, 0x10, BIT_1);
25022                 SetEthPhyBit(sc, 0x10, BIT_0);
25023                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25024
25025                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25026                 MP_WritePhyUshort(sc, 0x13, 0x8012);
25027                 SetEthPhyBit(sc, 0x14, BIT_15);
25028                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25029
25030                 MP_WritePhyUshort(sc, 0x1F, 0x0C42);
25031                 ClearAndSetEthPhyBit(sc,
25032                                      0x11,
25033                                      BIT_13,
25034                                      BIT_14
25035                                     );
25036                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25037
25038                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25039                 MP_WritePhyUshort(sc, 0x13, 0x80F3);
25040                 ClearAndSetEthPhyBit(sc,
25041                                      0x14,
25042                                      0xFF00,
25043                                      0x8B00
25044                                     );
25045                 MP_WritePhyUshort(sc, 0x13, 0x80F0);
25046                 ClearAndSetEthPhyBit(sc,
25047                                      0x14,
25048                                      0xFF00,
25049                                      0x3A00
25050                                     );
25051                 MP_WritePhyUshort(sc, 0x13, 0x80EF);
25052                 ClearAndSetEthPhyBit(sc,
25053                                      0x14,
25054                                      0xFF00,
25055                                      0x0500
25056                                     );
25057                 MP_WritePhyUshort(sc, 0x13, 0x80F6);
25058                 ClearAndSetEthPhyBit(sc,
25059                                      0x14,
25060                                      0xFF00,
25061                                      0x6E00
25062                                     );
25063                 MP_WritePhyUshort(sc, 0x13, 0x80EC);
25064                 ClearAndSetEthPhyBit(sc,
25065                                      0x14,
25066                                      0xFF00,
25067                                      0x6800
25068                                     );
25069                 MP_WritePhyUshort(sc, 0x13, 0x80ED);
25070                 ClearAndSetEthPhyBit(sc,
25071                                      0x14,
25072                                      0xFF00,
25073                                      0x7C00
25074                                     );
25075                 MP_WritePhyUshort(sc, 0x13, 0x80F2);
25076                 ClearAndSetEthPhyBit(sc,
25077                                      0x14,
25078                                      0xFF00,
25079                                      0xF400
25080                                     );
25081                 MP_WritePhyUshort(sc, 0x13, 0x80F4);
25082                 ClearAndSetEthPhyBit(sc,
25083                                      0x14,
25084                                      0xFF00,
25085                                      0x8500
25086                                     );
25087
25088                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25089                 MP_WritePhyUshort(sc, 0x13, 0x8110);
25090                 ClearAndSetEthPhyBit(sc,
25091                                      0x14,
25092                                      0xFF00,
25093                                      0xA800
25094                                     );
25095                 MP_WritePhyUshort(sc, 0x13, 0x810F);
25096                 ClearAndSetEthPhyBit(sc,
25097                                      0x14,
25098                                      0xFF00,
25099                                      0x1D00
25100                                     );
25101                 MP_WritePhyUshort(sc, 0x13, 0x8111);
25102                 ClearAndSetEthPhyBit(sc,
25103                                      0x14,
25104                                      0xFF00,
25105                                      0xF500
25106                                     );
25107                 MP_WritePhyUshort(sc, 0x13, 0x8113);
25108                 ClearAndSetEthPhyBit(sc,
25109                                      0x14,
25110                                      0xFF00,
25111                                      0x6100
25112                                     );
25113                 MP_WritePhyUshort(sc, 0x13, 0x8115);
25114                 ClearAndSetEthPhyBit(sc,
25115                                      0x14,
25116                                      0xFF00,
25117                                      0x9200
25118                                     );
25119                 MP_WritePhyUshort(sc, 0x13, 0x810E);
25120                 ClearAndSetEthPhyBit(sc,
25121                                      0x14,
25122                                      0xFF00,
25123                                      0x0400
25124                                     );
25125                 MP_WritePhyUshort(sc, 0x13, 0x810C);
25126                 ClearAndSetEthPhyBit(sc,
25127                                      0x14,
25128                                      0xFF00,
25129                                      0x7C00
25130                                     );
25131                 MP_WritePhyUshort(sc, 0x13, 0x810B);
25132                 ClearAndSetEthPhyBit(sc,
25133                                      0x14,
25134                                      0xFF00,
25135                                      0x5A00
25136                                     );
25137
25138                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25139                 MP_WritePhyUshort(sc, 0x13, 0x80D1);
25140                 ClearAndSetEthPhyBit(sc,
25141                                      0x14,
25142                                      0xFF00,
25143                                      0xFF00
25144                                     );
25145                 MP_WritePhyUshort(sc, 0x13, 0x80CD);
25146                 ClearAndSetEthPhyBit(sc,
25147                                      0x14,
25148                                      0xFF00,
25149                                      0x9E00
25150                                     );
25151                 MP_WritePhyUshort(sc, 0x13, 0x80D3);
25152                 ClearAndSetEthPhyBit(sc,
25153                                      0x14,
25154                                      0xFF00,
25155                                      0x0E00
25156                                     );
25157                 MP_WritePhyUshort(sc, 0x13, 0x80D5);
25158                 ClearAndSetEthPhyBit(sc,
25159                                      0x14,
25160                                      0xFF00,
25161                                      0xCA00
25162                                     );
25163                 MP_WritePhyUshort(sc, 0x13, 0x80D7);
25164                 ClearAndSetEthPhyBit(sc,
25165                                      0x14,
25166                                      0xFF00,
25167                                      0x8400
25168                                     );
25169
25170                 if (phy_power_saving == 1) {
25171                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25172                         SetEthPhyBit(sc, 0x10, BIT_2);
25173                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
25174                 } else {
25175                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25176                         ClearEthPhyBit(sc, 0x10, BIT_2);
25177                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
25178                         DELAY(20000);
25179                 }
25180
25181                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25182                 MP_WritePhyUshort(sc, 0x13, 0x8011);
25183                 ClearEthPhyBit(sc, 0x14, BIT_14);
25184                 MP_WritePhyUshort(sc, 0x1F, 0x0A40);
25185                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25186                 MP_WritePhyUshort(sc, 0x00, 0x9200);
25187         } else if (sc->re_type == MACFG_63) {
25188                 MP_WritePhyUshort(sc, 0x1f, 0x0002);
25189                 MP_WritePhyUshort(sc, 0x10, 0x0008);
25190                 MP_WritePhyUshort(sc, 0x0d, 0x006c);
25191                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
25192
25193                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
25194                 MP_WritePhyUshort(sc, 0x17, 0x0cc0);
25195                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
25196
25197                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
25198                 MP_WritePhyUshort(sc, 0x0B, 0xA4D8);
25199                 MP_WritePhyUshort(sc, 0x09, 0x281C);
25200                 MP_WritePhyUshort(sc, 0x07, 0x2883);
25201                 MP_WritePhyUshort(sc, 0x0A, 0x6B35);
25202                 MP_WritePhyUshort(sc, 0x1D, 0x3DA4);
25203                 MP_WritePhyUshort(sc, 0x1C, 0xEFFD);
25204                 MP_WritePhyUshort(sc, 0x14, 0x7F52);
25205                 MP_WritePhyUshort(sc, 0x18, 0x7FC6);
25206                 MP_WritePhyUshort(sc, 0x08, 0x0601);
25207                 MP_WritePhyUshort(sc, 0x06, 0x4063);
25208                 MP_WritePhyUshort(sc, 0x10, 0xF074);
25209                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
25210                 MP_WritePhyUshort(sc, 0x13, 0x0789);
25211                 MP_WritePhyUshort(sc, 0x12, 0xF4BD);
25212                 MP_WritePhyUshort(sc, 0x1A, 0x04FD);
25213                 MP_WritePhyUshort(sc, 0x14, 0x84B0);
25214                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25215
25216                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
25217                 MP_WritePhyUshort(sc, 0x01, 0x0340);
25218                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
25219                 MP_WritePhyUshort(sc, 0x04, 0x4000);
25220                 MP_WritePhyUshort(sc, 0x03, 0x1D21);
25221                 MP_WritePhyUshort(sc, 0x02, 0x0C32);
25222                 MP_WritePhyUshort(sc, 0x01, 0x0200);
25223                 MP_WritePhyUshort(sc, 0x00, 0x5554);
25224                 MP_WritePhyUshort(sc, 0x04, 0x4800);
25225                 MP_WritePhyUshort(sc, 0x04, 0x4000);
25226                 MP_WritePhyUshort(sc, 0x04, 0xF000);
25227                 MP_WritePhyUshort(sc, 0x03, 0xDF01);
25228                 MP_WritePhyUshort(sc, 0x02, 0xDF20);
25229                 MP_WritePhyUshort(sc, 0x01, 0x101A);
25230                 MP_WritePhyUshort(sc, 0x00, 0xA0FF);
25231                 MP_WritePhyUshort(sc, 0x04, 0xF800);
25232                 MP_WritePhyUshort(sc, 0x04, 0xF000);
25233                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25234
25235                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
25236                 MP_WritePhyUshort(sc, 0x1E, 0x0023);
25237                 MP_WritePhyUshort(sc, 0x16, 0x0000);
25238                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25239
25240                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25241                 PhyRegValue = MP_ReadPhyUshort(sc, 0x0D);
25242                 PhyRegValue |= (BIT_5);
25243                 MP_WritePhyUshort(sc, 0x0D, PhyRegValue);
25244
25245                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
25246                 PhyRegValue = MP_ReadPhyUshort(sc, 0x0C);
25247                 PhyRegValue |= (BIT_10);
25248                 MP_WritePhyUshort(sc, 0x0C, PhyRegValue);
25249                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25250         } else if (sc->re_type == MACFG_64) {
25251                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
25252                 MP_WritePhyUshort(sc, 0x17, 0x0cc0);
25253                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
25254
25255                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
25256                 MP_WritePhyUshort(sc, 0x01, 0x0340);
25257                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
25258                 MP_WritePhyUshort(sc, 0x04, 0x4000);
25259                 MP_WritePhyUshort(sc, 0x03, 0x1D21);
25260                 MP_WritePhyUshort(sc, 0x02, 0x0C32);
25261                 MP_WritePhyUshort(sc, 0x01, 0x0200);
25262                 MP_WritePhyUshort(sc, 0x00, 0x5554);
25263                 MP_WritePhyUshort(sc, 0x04, 0x4800);
25264                 MP_WritePhyUshort(sc, 0x04, 0x4000);
25265                 MP_WritePhyUshort(sc, 0x04, 0xF000);
25266                 MP_WritePhyUshort(sc, 0x03, 0xDF01);
25267                 MP_WritePhyUshort(sc, 0x02, 0xDF20);
25268                 MP_WritePhyUshort(sc, 0x01, 0x101A);
25269                 MP_WritePhyUshort(sc, 0x00, 0xA0FF);
25270                 MP_WritePhyUshort(sc, 0x04, 0xF800);
25271                 MP_WritePhyUshort(sc, 0x04, 0xF000);
25272                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25273
25274                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
25275                 MP_WritePhyUshort(sc, 0x1E, 0x0023);
25276                 MP_WritePhyUshort(sc, 0x16, 0x0000);
25277                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25278
25279                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25280                 PhyRegValue = MP_ReadPhyUshort(sc, 0x0D);
25281                 PhyRegValue |= (BIT_5);
25282                 MP_WritePhyUshort(sc, 0x0D, PhyRegValue);
25283
25284                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
25285                 PhyRegValue = MP_ReadPhyUshort(sc, 0x0C);
25286                 PhyRegValue |= (BIT_10);
25287                 MP_WritePhyUshort(sc, 0x0C, PhyRegValue);
25288                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25289         } else if (sc->re_type == MACFG_65) {
25290                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
25291                 MP_WritePhyUshort(sc, 0x17, 0x0cc0);
25292                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
25293
25294                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25295                 PhyRegValue = MP_ReadPhyUshort(sc, 0x0D);
25296                 PhyRegValue |= (BIT_5);
25297                 MP_WritePhyUshort(sc, 0x0D, PhyRegValue);
25298
25299                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
25300                 PhyRegValue = MP_ReadPhyUshort(sc, 0x0C);
25301                 PhyRegValue |= (BIT_10);
25302                 MP_WritePhyUshort(sc, 0x0C, PhyRegValue);
25303                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25304
25305                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
25306                 MP_WritePhyUshort(sc, 0x1E, 0x002C);
25307                 MP_WritePhyUshort(sc, 0x15, 0x035D);
25308                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
25309                 MP_WritePhyUshort(sc, 0x01, 0x0300);
25310                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25311         } else if (sc->re_type == MACFG_66) {
25312                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25313                 PhyRegValue = MP_ReadPhyUshort(sc, 0x0D);
25314                 PhyRegValue |= (BIT_5);
25315                 MP_WritePhyUshort(sc, 0x0D, PhyRegValue);
25316
25317                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
25318                 PhyRegValue = MP_ReadPhyUshort(sc, 0x0C);
25319                 PhyRegValue |= (BIT_10);
25320                 MP_WritePhyUshort(sc, 0x0C, PhyRegValue);
25321                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25322         } else if (sc->re_type == MACFG_68) {
25323                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25324                 MP_WritePhyUshort(sc, 0x13, 0x809b);
25325                 ClearAndSetEthPhyBit(sc,
25326                                      0x14,
25327                                      0xF800,
25328                                      0x8000
25329                                     );
25330                 MP_WritePhyUshort(sc, 0x13, 0x80A2);
25331                 ClearAndSetEthPhyBit(sc,
25332                                      0x14,
25333                                      0xFF00,
25334                                      0x8000
25335                                     );
25336                 MP_WritePhyUshort(sc, 0x13, 0x80A4);
25337                 ClearAndSetEthPhyBit(sc,
25338                                      0x14,
25339                                      0xFF00,
25340                                      0x8500
25341                                     );
25342                 MP_WritePhyUshort(sc, 0x13, 0x809C);
25343                 ClearAndSetEthPhyBit(sc,
25344                                      0x14,
25345                                      0xFF00,
25346                                      0xbd00
25347                                     );
25348                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25349
25350                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25351                 MP_WritePhyUshort(sc, 0x13, 0x80AD);
25352                 ClearAndSetEthPhyBit(sc,
25353                                      0x14,
25354                                      0xF800,
25355                                      0x7000
25356                                     );
25357                 MP_WritePhyUshort(sc, 0x13, 0x80B4);
25358                 ClearAndSetEthPhyBit(sc,
25359                                      0x14,
25360                                      0xFF00,
25361                                      0x5000
25362                                     );
25363                 MP_WritePhyUshort(sc, 0x13, 0x80AC);
25364                 ClearAndSetEthPhyBit(sc,
25365                                      0x14,
25366                                      0xFF00,
25367                                      0x4000
25368                                     );
25369                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25370
25371                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25372                 MP_WritePhyUshort(sc, 0x13, 0x808E);
25373                 ClearAndSetEthPhyBit(sc,
25374                                      0x14,
25375                                      0xFF00,
25376                                      0x1200
25377                                     );
25378                 MP_WritePhyUshort(sc, 0x13, 0x8090);
25379                 ClearAndSetEthPhyBit(sc,
25380                                      0x14,
25381                                      0xFF00,
25382                                      0xE500
25383                                     );
25384                 MP_WritePhyUshort(sc, 0x13, 0x8092);
25385                 ClearAndSetEthPhyBit(sc,
25386                                      0x14,
25387                                      0xFF00,
25388                                      0x9F00
25389                                     );
25390                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25391
25392                 dout_tapbin = 0x0000;
25393                 MP_WritePhyUshort(sc, 0x1F, 0x0A46);
25394                 TmpUshort = MP_ReadPhyUshort(sc, 0x13);
25395                 TmpUshort &= (BIT_1|BIT_0);
25396                 TmpUshort <<= 2;
25397                 dout_tapbin |= TmpUshort;
25398
25399                 TmpUshort = MP_ReadPhyUshort(sc, 0x12);
25400                 TmpUshort &= (BIT_15|BIT_14);
25401                 TmpUshort >>= 14;
25402                 dout_tapbin |= TmpUshort;
25403
25404                 dout_tapbin = ~(dout_tapbin^BIT_3);
25405                 dout_tapbin <<= 12;
25406                 dout_tapbin &= 0xF000;
25407
25408                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25409
25410                 MP_WritePhyUshort(sc, 0x13, 0x827A);
25411                 ClearAndSetEthPhyBit(sc,
25412                                      0x14,
25413                                      BIT_15|BIT_14|BIT_13|BIT_12,
25414                                      dout_tapbin
25415                                     );
25416
25417
25418                 MP_WritePhyUshort(sc, 0x13, 0x827B);
25419                 ClearAndSetEthPhyBit(sc,
25420                                      0x14,
25421                                      BIT_15|BIT_14|BIT_13|BIT_12,
25422                                      dout_tapbin
25423                                     );
25424
25425
25426                 MP_WritePhyUshort(sc, 0x13, 0x827C);
25427                 ClearAndSetEthPhyBit(sc,
25428                                      0x14,
25429                                      BIT_15|BIT_14|BIT_13|BIT_12,
25430                                      dout_tapbin
25431                                     );
25432
25433
25434                 MP_WritePhyUshort(sc, 0x13, 0x827D);
25435                 ClearAndSetEthPhyBit(sc,
25436                                      0x14,
25437                                      BIT_15|BIT_14|BIT_13|BIT_12,
25438                                      dout_tapbin
25439                                     );
25440
25441                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25442                 MP_WritePhyUshort(sc, 0x13, 0x8011);
25443                 SetEthPhyBit(sc, 0x14, BIT_11);
25444                 MP_WritePhyUshort(sc, 0x1F, 0x0A42);
25445                 SetEthPhyBit(sc, 0x16, BIT_1);
25446
25447                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
25448                 SetEthPhyBit(sc, 0x11, BIT_11);
25449                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25450
25451                 MP_WritePhyUshort(sc, 0x1F, 0x0BCA);
25452                 ClearAndSetEthPhyBit(sc,
25453                                      0x17,
25454                                      (BIT_13 | BIT_12),
25455                                      BIT_14
25456                                     );
25457                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25458
25459                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25460                 MP_WritePhyUshort(sc, 0x13, 0x803F);
25461                 ClearEthPhyBit(sc, 0x14, (BIT_13 | BIT_12));
25462                 MP_WritePhyUshort(sc, 0x13, 0x8047);
25463                 ClearEthPhyBit(sc, 0x14, (BIT_13 | BIT_12));
25464                 MP_WritePhyUshort(sc, 0x13, 0x804F);
25465                 ClearEthPhyBit(sc, 0x14, (BIT_13 | BIT_12));
25466                 MP_WritePhyUshort(sc, 0x13, 0x8057);
25467                 ClearEthPhyBit(sc, 0x14, (BIT_13 | BIT_12));
25468                 MP_WritePhyUshort(sc, 0x13, 0x805F);
25469                 ClearEthPhyBit(sc, 0x14, (BIT_13 | BIT_12));
25470                 MP_WritePhyUshort(sc, 0x13, 0x8067);
25471                 ClearEthPhyBit(sc, 0x14, (BIT_13 | BIT_12));
25472                 MP_WritePhyUshort(sc, 0x13, 0x806F);
25473                 ClearEthPhyBit(sc, 0x14, (BIT_13 | BIT_12));
25474                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25475
25476                 if (phy_power_saving == 1) {
25477                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25478                         SetEthPhyBit(sc, 0x10, BIT_2);
25479                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
25480                 } else {
25481                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25482                         ClearEthPhyBit(sc, 0x10, BIT_2);
25483                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
25484                         DELAY(20000);
25485                 }
25486
25487                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25488                 MP_WritePhyUshort(sc, 0x13, 0x8045);
25489                 MP_WritePhyUshort(sc, 0x14, 0x2444);
25490                 MP_WritePhyUshort(sc, 0x13, 0x804d);
25491                 MP_WritePhyUshort(sc, 0x14, 0x2444);
25492                 MP_WritePhyUshort(sc, 0x13, 0x805d);
25493                 MP_WritePhyUshort(sc, 0x14, 0x2444);
25494                 MP_WritePhyUshort(sc, 0x13, 0x8011);
25495                 SetEthPhyBit(sc, 0x14, BIT_15);
25496                 MP_WritePhyUshort(sc, 0x1F, 0x0A40);
25497                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25498                 MP_WritePhyUshort(sc, 0x00, 0x9200);
25499         } else if (sc->re_type == MACFG_69) {
25500                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25501                 MP_WritePhyUshort(sc, 0x13, 0x808A);
25502                 ClearAndSetEthPhyBit(sc,
25503                                      0x14,
25504                                      BIT_5 | BIT_4 | BIT_3 | BIT_2 | BIT_1 | BIT_0,
25505                                      0x0A);
25506
25507                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25508                 MP_WritePhyUshort(sc, 0x13, 0x8011);
25509                 SetEthPhyBit(sc, 0x14, BIT_11);
25510                 MP_WritePhyUshort(sc, 0x1F, 0x0A42);
25511                 SetEthPhyBit(sc, 0x16, BIT_1);
25512
25513                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
25514                 SetEthPhyBit(sc, 0x11, BIT_11);
25515                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25516
25517                 if (sc->RequireAdcBiasPatch) {
25518                         MP_WritePhyUshort(sc, 0x1F, 0x0BCF);
25519                         MP_WritePhyUshort(sc, 0x16, sc->AdcBiasPatchIoffset);
25520                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
25521                 }
25522
25523                 {
25524                         u_int16_t rlen;
25525
25526                         MP_WritePhyUshort(sc, 0x1F, 0x0BCD);
25527                         PhyRegValue = MP_ReadPhyUshort(sc, 0x16);
25528                         PhyRegValue &= 0x000F;
25529
25530                         if (PhyRegValue > 3) {
25531                                 rlen = PhyRegValue - 3;
25532                         } else {
25533                                 rlen = 0;
25534                         }
25535
25536                         PhyRegValue = rlen | (rlen<<4) | (rlen<<8) | (rlen<<12);
25537
25538                         MP_WritePhyUshort(sc, 0x1F, 0x0BCD);
25539                         MP_WritePhyUshort(sc, 0x17, PhyRegValue);
25540                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
25541                 }
25542
25543                 if (phy_power_saving == 1) {
25544                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25545                         SetEthPhyBit(sc, 0x10, BIT_2);
25546                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
25547                 } else {
25548                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25549                         ClearEthPhyBit(sc, 0x10, BIT_2);
25550                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
25551                         DELAY(20000);
25552                 }
25553
25554                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25555                 MP_WritePhyUshort(sc, 0x13, 0x8045);
25556                 MP_WritePhyUshort(sc, 0x14, 0x2444);
25557                 MP_WritePhyUshort(sc, 0x13, 0x804d);
25558                 MP_WritePhyUshort(sc, 0x14, 0x2444);
25559                 MP_WritePhyUshort(sc, 0x13, 0x805d);
25560                 MP_WritePhyUshort(sc, 0x14, 0x2444);
25561                 MP_WritePhyUshort(sc, 0x13, 0x8011);
25562                 SetEthPhyBit(sc, 0x14, BIT_15);
25563                 MP_WritePhyUshort(sc, 0x1F, 0x0A40);
25564                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25565                 MP_WritePhyUshort(sc, 0x00, 0x9200);
25566         }  else if (sc->re_type == MACFG_70 || sc->re_type == MACFG_71) {
25567                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25568                 MP_WritePhyUshort(sc, 0x13, 0x808E);
25569                 ClearAndSetEthPhyBit( sc,
25570                                       0x14,
25571                                       0xFF00,
25572                                       0x4000
25573                                     );
25574                 MP_WritePhyUshort(sc, 0x13, 0x8090);
25575                 ClearAndSetEthPhyBit( sc,
25576                                       0x14,
25577                                       0xFF00,
25578                                       0xCC00
25579                                     );
25580                 MP_WritePhyUshort(sc, 0x13, 0x8092);
25581                 ClearAndSetEthPhyBit( sc,
25582                                       0x14,
25583                                       0xFF00,
25584                                       0xB000
25585                                     );
25586                 MP_WritePhyUshort(sc, 0x13, 0x8088);
25587                 ClearAndSetEthPhyBit( sc,
25588                                       0x14,
25589                                       0xFF00,
25590                                       0x8000
25591                                     );
25592                 MP_WritePhyUshort(sc, 0x13, 0x808B);
25593                 ClearAndSetEthPhyBit( sc,
25594                                       0x14,
25595                                       0x3F00,
25596                                       0x0B00
25597                                     );
25598                 MP_WritePhyUshort(sc, 0x13, 0x808D);
25599                 ClearAndSetEthPhyBit( sc,
25600                                       0x14,
25601                                       0x1F00,
25602                                       0x0600
25603                                     );
25604                 MP_WritePhyUshort(sc, 0x13, 0x808C);
25605                 ClearAndSetEthPhyBit( sc,
25606                                       0x14,
25607                                       0xFF00,
25608                                       0xB000
25609                                     );
25610
25611                 MP_WritePhyUshort(sc, 0x13, 0x80A0);
25612                 ClearAndSetEthPhyBit( sc,
25613                                       0x14,
25614                                       0xFF00,
25615                                       0x2000
25616                                     );
25617                 MP_WritePhyUshort(sc, 0x13, 0x80A2);
25618                 ClearAndSetEthPhyBit( sc,
25619                                       0x14,
25620                                       0xFF00,
25621                                       0x5000
25622                                     );
25623                 MP_WritePhyUshort(sc, 0x13, 0x809B);
25624                 ClearAndSetEthPhyBit( sc,
25625                                       0x14,
25626                                       0xF800,
25627                                       0xB000
25628                                     );
25629                 MP_WritePhyUshort(sc, 0x13, 0x809A);
25630                 ClearAndSetEthPhyBit( sc,
25631                                       0x14,
25632                                       0xFF00,
25633                                       0x4B00
25634                                     );
25635                 MP_WritePhyUshort(sc, 0x13, 0x809D);
25636                 ClearAndSetEthPhyBit( sc,
25637                                       0x14,
25638                                       0x3F00,
25639                                       0x0800
25640                                     );
25641                 MP_WritePhyUshort(sc, 0x13, 0x80A1);
25642                 ClearAndSetEthPhyBit( sc,
25643                                       0x14,
25644                                       0xFF00,
25645                                       0x7000
25646                                     );
25647                 MP_WritePhyUshort(sc, 0x13, 0x809F);
25648                 ClearAndSetEthPhyBit( sc,
25649                                       0x14,
25650                                       0x1F00,
25651                                       0x0300
25652                                     );
25653                 MP_WritePhyUshort(sc, 0x13, 0x809E);
25654                 ClearAndSetEthPhyBit( sc,
25655                                       0x14,
25656                                       0xFF00,
25657                                       0x8800
25658                                     );
25659
25660                 MP_WritePhyUshort(sc, 0x13, 0x80B2);
25661                 ClearAndSetEthPhyBit( sc,
25662                                       0x14,
25663                                       0xFF00,
25664                                       0x2200
25665                                     );
25666                 MP_WritePhyUshort(sc, 0x13, 0x80AD);
25667                 ClearAndSetEthPhyBit( sc,
25668                                       0x14,
25669                                       0xF800,
25670                                       0x9800
25671                                     );
25672                 MP_WritePhyUshort(sc, 0x13, 0x80AF);
25673                 ClearAndSetEthPhyBit( sc,
25674                                       0x14,
25675                                       0x3F00,
25676                                       0x0800
25677                                     );
25678                 MP_WritePhyUshort(sc, 0x13, 0x80B3);
25679                 ClearAndSetEthPhyBit( sc,
25680                                       0x14,
25681                                       0xFF00,
25682                                       0x6F00
25683                                     );
25684                 MP_WritePhyUshort(sc, 0x13, 0x80B1);
25685                 ClearAndSetEthPhyBit( sc,
25686                                       0x14,
25687                                       0x1F00,
25688                                       0x0300
25689                                     );
25690                 MP_WritePhyUshort(sc, 0x13, 0x80B0);
25691                 ClearAndSetEthPhyBit( sc,
25692                                       0x14,
25693                                       0xFF00,
25694                                       0x9300
25695                                     );
25696                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25697
25698                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25699                 MP_WritePhyUshort(sc, 0x13, 0x8011);
25700                 SetEthPhyBit(sc, 0x14, BIT_11);
25701                 MP_WritePhyUshort(sc, 0x1F, 0x0A42);
25702                 SetEthPhyBit(sc, 0x16, BIT_1);
25703
25704                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
25705                 SetEthPhyBit( sc, 0x11, BIT_11 );
25706                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25707
25708                 if (phy_power_saving == 1) {
25709                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25710                         SetEthPhyBit(sc, 0x10, BIT_2);
25711                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
25712                 } else {
25713                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25714                         ClearEthPhyBit(sc, 0x10, BIT_2);
25715                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
25716                         DELAY(20000);
25717                 }
25718
25719                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25720                 MP_WritePhyUshort(sc, 0x13, 0x8045);
25721                 MP_WritePhyUshort(sc, 0x14, 0x2444);
25722                 MP_WritePhyUshort(sc, 0x13, 0x804d);
25723                 MP_WritePhyUshort(sc, 0x14, 0x2444);
25724                 MP_WritePhyUshort(sc, 0x13, 0x805d);
25725                 MP_WritePhyUshort(sc, 0x14, 0x2444);
25726                 MP_WritePhyUshort(sc, 0x13, 0x8011);
25727                 SetEthPhyBit(sc, 0x14, BIT_15);
25728                 MP_WritePhyUshort(sc, 0x1F, 0x0A40);
25729                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25730                 MP_WritePhyUshort(sc, 0x00, 0x9200);
25731         }
25732         //EthPhyPPSW
25733         if (sc->re_type == MACFG_56 || sc->re_type == MACFG_56 ||
25734             sc->re_type == MACFG_58 || sc->re_type == MACFG_58 ||
25735             sc->re_type == MACFG_60) {
25736                 //disable EthPhyPPSW
25737                 MP_WritePhyUshort(sc, 0x1F, 0x0BCD);
25738                 MP_WritePhyUshort(sc, 0x14, 0x5065);
25739                 MP_WritePhyUshort(sc, 0x14, 0xD065);
25740                 MP_WritePhyUshort(sc, 0x1F, 0x0BC8);
25741                 MP_WritePhyUshort(sc, 0x12, 0x00ED);
25742                 MP_WritePhyUshort(sc, 0x1F, 0x0BCD);
25743                 MP_WritePhyUshort(sc, 0x14, 0x1065);
25744                 MP_WritePhyUshort(sc, 0x14, 0x9065);
25745                 MP_WritePhyUshort(sc, 0x14, 0x1065);
25746                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25747         } else if (sc->re_type == MACFG_68 || sc->re_type == MACFG_69) {
25748                 //enable EthPhyPPSW
25749                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
25750                 SetEthPhyBit(sc, 0x11, BIT_7);
25751                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
25752         }
25753
25754         switch(sc->re_type) {
25755         case MACFG_56:
25756         case MACFG_57:
25757         case MACFG_58:
25758         case MACFG_59:
25759         case MACFG_60:
25760         case MACFG_61:
25761         case MACFG_62:
25762         case MACFG_67:
25763         case MACFG_68:
25764         case MACFG_69:
25765         case MACFG_70:
25766         case MACFG_71:
25767                 if (phy_mdix_mode == RE_ETH_PHY_FORCE_MDI) {
25768                         //Force MDI
25769                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25770                         SetEthPhyBit(sc, 0x10, BIT_8 | BIT_9);
25771                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
25772                 } else if (phy_mdix_mode == RE_ETH_PHY_FORCE_MDIX) {
25773                         //Force MDIX
25774                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25775                         ClearEthPhyBit(sc, 0x10, BIT_8);
25776                         SetEthPhyBit(sc, 0x10, BIT_9);
25777                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
25778                 } else {
25779                         //Auto MDI/MDIX
25780                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
25781                         ClearEthPhyBit(sc, 0x10, BIT_8 | BIT_9);
25782                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
25783                 }
25784
25785                 break;
25786         }
25787
25788         if (phy_power_saving == 1) {
25789                 if (sc->re_type == MACFG_59 || sc->re_type == MACFG_60 ||
25790                     sc->re_type == MACFG_62 || sc->re_type == MACFG_67 ||
25791                     sc->re_type == MACFG_68 || sc->re_type == MACFG_69 ||
25792                     sc->re_type == MACFG_70 || sc->re_type == MACFG_71) {
25793                         MP_WritePhyOcpRegWord(sc, 0x0C41, 0x13, 0x0000);
25794                         MP_WritePhyOcpRegWord(sc, 0x0C41, 0x13, 0x0050);
25795                 }
25796         }
25797
25798         if (eee_enable == 1)
25799                 re_enable_EEE(sc);
25800         else
25801                 re_disable_EEE(sc);
25802
25803         MP_WritePhyUshort(sc, 0x1F, 0x0000);
25804 }
25805
25806 void MP_WritePhyUshort(struct re_softc *sc,u_int8_t RegAddr,u_int16_t RegData)
25807 {
25808         u_int32_t               TmpUlong=0x80000000;
25809         u_int32_t               Timeout=0;
25810
25811         if (RegAddr == 0x1F) {
25812                 sc->cur_page = RegData;
25813         }
25814
25815         if (sc->re_type == MACFG_63) {
25816                 int i;
25817                 CSR_WRITE_4(sc, RE_OCPDR, OCPDR_Write |
25818                             (RegAddr & OCPDR_Reg_Mask) << OCPDR_GPHY_Reg_shift |
25819                             (RegData & OCPDR_Data_Mask));
25820                 CSR_WRITE_4(sc, RE_OCPAR, OCPAR_GPHY_Write);
25821                 CSR_WRITE_4(sc, RE_EPHY_RXER_NUM, 0);
25822
25823                 for (i = 0; i < 100; i++) {
25824                         DELAY(1000);
25825                         if (!(CSR_READ_4(sc, RE_OCPAR) & OCPAR_Flag))
25826                                 break;
25827                 }
25828         } else if (sc->re_type == MACFG_56 || sc->re_type == MACFG_57 ||
25829                    sc->re_type == MACFG_58 || sc->re_type == MACFG_59 ||
25830                    sc->re_type == MACFG_60 || sc->re_type == MACFG_61 ||
25831                    sc->re_type == MACFG_62 || sc->re_type == MACFG_67 ||
25832                    sc->re_type == MACFG_69 || sc->re_type == MACFG_69 ||
25833                    sc->re_type == MACFG_70 || sc->re_type == MACFG_71) {
25834                 if (RegAddr == 0x1F) {
25835                         return;
25836                 }
25837
25838                 MP_WritePhyOcpRegWord(sc, sc->cur_page, RegAddr, RegData);
25839         } else {
25840                 if (sc->re_type == MACFG_65 || sc->re_type == MACFG_66)
25841                         CSR_WRITE_4(sc, 0xD0, CSR_READ_4(sc, 0xD0) & ~0x00020000);
25842
25843                 TmpUlong |= (((u_int32_t)RegAddr)<<16 | (u_int32_t)RegData);
25844
25845                 CSR_WRITE_4(sc, RE_PHYAR, TmpUlong);
25846
25847                 /* Wait for writing to Phy ok */
25848                 for (Timeout=0; Timeout<5; Timeout++) {
25849                         DELAY(1000);
25850                         if ((CSR_READ_4(sc, RE_PHYAR)&PHYAR_Flag)==0)
25851                                 break;
25852                 }
25853
25854                 if (sc->re_type == MACFG_65 || sc->re_type == MACFG_66)
25855                         CSR_WRITE_4(sc, 0xD0, CSR_READ_4(sc, 0xD0) | 0x00020000);
25856         }
25857 }
25858
25859 u_int16_t MP_ReadPhyUshort(struct re_softc *sc,u_int8_t RegAddr)
25860 {
25861         u_int16_t               RegData;
25862         u_int32_t               TmpUlong;
25863         u_int32_t               Timeout=0;
25864
25865         if (sc->re_type == MACFG_63) {
25866                 int i;
25867                 CSR_WRITE_4(sc, RE_OCPDR, OCPDR_Read |
25868                             (RegAddr & OCPDR_Reg_Mask) << OCPDR_GPHY_Reg_shift);
25869                 CSR_WRITE_4(sc, RE_OCPAR, OCPAR_GPHY_Write);
25870                 CSR_WRITE_4(sc, RE_EPHY_RXER_NUM, 0);
25871
25872                 for (i = 0; i < 100; i++) {
25873                         DELAY(1000);
25874                         if (!(CSR_READ_4(sc, RE_OCPAR) & OCPAR_Flag))
25875                                 break;
25876                 }
25877
25878                 DELAY(1000);
25879                 CSR_WRITE_4(sc, RE_OCPAR, OCPAR_GPHY_Read);
25880                 CSR_WRITE_4(sc, RE_EPHY_RXER_NUM, 0);
25881
25882                 for (i = 0; i < 100; i++) {
25883                         DELAY(1000);
25884                         if (CSR_READ_4(sc, RE_OCPAR) & OCPAR_Flag)
25885                                 break;
25886                 }
25887
25888                 RegData = CSR_READ_4(sc, RE_OCPDR) & OCPDR_Data_Mask;
25889         } else if (sc->re_type == MACFG_56 || sc->re_type == MACFG_57 ||
25890                    sc->re_type == MACFG_58 || sc->re_type == MACFG_59 ||
25891                    sc->re_type == MACFG_60 || sc->re_type == MACFG_61 ||
25892                    sc->re_type == MACFG_62 || sc->re_type == MACFG_67 ||
25893                    sc->re_type == MACFG_69 || sc->re_type == MACFG_69 ||
25894                    sc->re_type == MACFG_70 || sc->re_type == MACFG_71) {
25895                 RegData= MP_ReadPhyOcpRegWord(sc, sc->cur_page, RegAddr);
25896
25897         } else {
25898                 if (sc->re_type == MACFG_65 || sc->re_type == MACFG_66)
25899                         CSR_WRITE_4(sc, 0xD0, CSR_READ_4(sc, 0xD0) & ~0x00020000);
25900
25901                 TmpUlong = ((u_int32_t)RegAddr << 16);
25902                 CSR_WRITE_4(sc, RE_PHYAR, TmpUlong);
25903
25904                 /* Wait for writing to Phy ok */
25905                 for (Timeout=0; Timeout<5; Timeout++) {
25906                         DELAY(1000);
25907                         TmpUlong = CSR_READ_4(sc, RE_PHYAR);
25908                         if ((TmpUlong&PHYAR_Flag)!=0)
25909                                 break;
25910                 }
25911
25912                 RegData = (u_int16_t)(TmpUlong & 0x0000ffff);
25913
25914                 if (sc->re_type == MACFG_65 || sc->re_type == MACFG_66)
25915                         CSR_WRITE_4(sc, 0xD0, CSR_READ_4(sc, 0xD0) | 0x00020000);
25916         }
25917
25918         return RegData;
25919 }
25920
25921 void MP_WriteEPhyUshort(struct re_softc *sc, u_int8_t RegAddr, u_int16_t RegData)
25922 {
25923         u_int32_t               TmpUlong=0x80000000;
25924         u_int32_t               Timeout=0;
25925
25926         TmpUlong |= (((u_int32_t)RegAddr<<16) | (u_int32_t)RegData);
25927
25928         CSR_WRITE_4(sc, RE_EPHYAR, TmpUlong);
25929
25930         /* Wait for writing to Phy ok */
25931         for (Timeout=0; Timeout<5; Timeout++) {
25932                 DELAY(1000);
25933                 if ((CSR_READ_4(sc, RE_EPHYAR)&PHYAR_Flag)==0)
25934                         break;
25935         }
25936 }
25937
25938 u_int16_t MP_ReadEPhyUshort(struct re_softc *sc, u_int8_t RegAddr)
25939 {
25940         u_int16_t               RegData;
25941         u_int32_t               TmpUlong;
25942         u_int32_t               Timeout=0;
25943
25944         TmpUlong = ((u_int32_t)RegAddr << 16);
25945         CSR_WRITE_4(sc, RE_EPHYAR, TmpUlong);
25946
25947         /* Wait for writing to Phy ok */
25948         for (Timeout=0; Timeout<5; Timeout++) {
25949                 DELAY(1000);
25950                 TmpUlong = CSR_READ_4(sc, RE_EPHYAR);
25951                 if ((TmpUlong&PHYAR_Flag)!=0)
25952                         break;
25953         }
25954
25955         RegData = (u_int16_t)(TmpUlong & 0x0000ffff);
25956
25957         return RegData;
25958 }
25959
25960 static u_int8_t re_calc_efuse_dummy_bit(u_int16_t reg)
25961 {
25962         int s,a,b;
25963         u_int8_t dummyBitPos = 0;
25964
25965
25966         s=reg% 32;
25967         a=s % 16;
25968         b=s/16;
25969
25970         if (s/16) {
25971                 dummyBitPos = (u_int8_t)(16-a);
25972         } else {
25973                 dummyBitPos = (u_int8_t)a;
25974         }
25975
25976         return dummyBitPos;
25977 }
25978
25979 static u_int32_t re_decode_efuse_cmd(struct re_softc *sc, u_int32_t DwCmd)
25980 {
25981         u_int16_t reg = (u_int16_t)((DwCmd & 0x00FE0000) >> 17);
25982         u_int32_t DummyPos = re_calc_efuse_dummy_bit(reg);
25983         u_int32_t DeCodeDwCmd = DwCmd;
25984         u_int32_t Dw17BitData;
25985
25986
25987         if (sc->re_efuse_ver < 3) {
25988                 DeCodeDwCmd = (DwCmd>>(DummyPos+1))<<DummyPos;
25989                 if (DummyPos > 0) {
25990                         DeCodeDwCmd |= ((DwCmd<<(32-DummyPos))>>(32-DummyPos));
25991                 }
25992         } else {
25993                 reg = (u_int16_t)((DwCmd & 0x007F0000) >> 16);
25994                 DummyPos = re_calc_efuse_dummy_bit(reg);
25995                 Dw17BitData = ((DwCmd & BIT_23) >> 23);
25996                 Dw17BitData <<= 16;
25997                 Dw17BitData |= (DwCmd & 0x0000FFFF);
25998                 DeCodeDwCmd = (Dw17BitData>>(DummyPos+1))<<DummyPos;
25999                 if (DummyPos > 0) {
26000                         DeCodeDwCmd |= ((Dw17BitData<<(32-DummyPos))>>(32-DummyPos));
26001                 }
26002         }
26003
26004         return DeCodeDwCmd;
26005 }
26006
26007 #define EFUSE_WRITE 0x80000000
26008 #define EFUSE_WRITE_OK  0x00000000
26009 #define EFUSE_READ  0x00000000
26010 #define EFUSE_READ_OK  0x80000000
26011 #define EFUSE_Reg_Mask 0x03FF
26012 #define EFUSE_Reg_Shift 8
26013 #define EFUSE_Check_Cnt 300
26014 #define EFUSE_READ_FAIL 0xFF
26015 #define EFUSE_Data_Mask 0x000000FF
26016
26017 u_int8_t MP_ReadEfuse(struct re_softc *sc, u_int16_t reg)
26018 {
26019         u_int8_t efuse_data = 0;
26020         u_int32_t temp;
26021         u_int32_t cnt;
26022
26023         if (sc->re_efuse_ver == EFUSE_NOT_SUPPORT)
26024                 return EFUSE_READ_FAIL;
26025
26026         if (sc->re_efuse_ver == EFUSE_SUPPORT_V1) {
26027                 temp = EFUSE_READ | ((reg & EFUSE_Reg_Mask) << EFUSE_Reg_Shift);
26028                 CSR_WRITE_4(sc, RE_EFUSEAR, temp);
26029
26030                 cnt = 0;
26031                 do {
26032                         DELAY(100);
26033                         temp = CSR_READ_4(sc, RE_EFUSEAR);
26034                         cnt++;
26035                 } while (!(temp & EFUSE_READ_OK) && (cnt < EFUSE_Check_Cnt));
26036
26037                 if (cnt == EFUSE_Check_Cnt)
26038                         efuse_data = EFUSE_READ_FAIL;
26039                 else
26040                         efuse_data = (u_int8_t)(CSR_READ_4(sc, RE_EFUSEAR) & EFUSE_Data_Mask);
26041         } else  if (sc->re_efuse_ver == EFUSE_SUPPORT_V2) {
26042                 temp = (reg/2) & 0x03ff;
26043                 temp <<= 17;
26044                 temp |= EFUSE_READ;
26045                 CSR_WRITE_4(sc, RE_EFUSEAR, temp);
26046
26047                 cnt = 0;
26048                 do {
26049                         DELAY(100);
26050                         temp = CSR_READ_4(sc, RE_EFUSEAR);
26051                         cnt++;
26052                 } while (!(temp & EFUSE_READ_OK) && (cnt < EFUSE_Check_Cnt));
26053
26054                 if (cnt == EFUSE_Check_Cnt) {
26055                         efuse_data = EFUSE_READ_FAIL;
26056                 } else {
26057                         temp = CSR_READ_4(sc, RE_EFUSEAR);
26058                         temp = re_decode_efuse_cmd(sc, temp);
26059
26060                         if (reg%2) {
26061                                 temp >>= 8;
26062                                 efuse_data = (u_int8_t)temp;
26063                         } else {
26064                                 efuse_data = (u_int8_t)temp;
26065                         }
26066                 }
26067         } else  if (sc->re_efuse_ver == EFUSE_SUPPORT_V3) {
26068                 temp = (reg/2) & 0x03ff;
26069                 temp <<= 16;
26070                 temp |= EFUSE_READ;
26071                 CSR_WRITE_4(sc, RE_EFUSEAR, temp);
26072
26073                 cnt = 0;
26074                 do {
26075                         DELAY(100);
26076                         temp = CSR_READ_4(sc, RE_EFUSEAR);
26077                         cnt++;
26078                 } while (!(temp & EFUSE_READ_OK) && (cnt < EFUSE_Check_Cnt));
26079
26080                 if (cnt == EFUSE_Check_Cnt) {
26081                         efuse_data = EFUSE_READ_FAIL;
26082                 } else {
26083                         temp = CSR_READ_4(sc, RE_EFUSEAR);
26084                         temp = re_decode_efuse_cmd(sc, temp);
26085
26086                         if (reg%2) {
26087                                 temp >>= 8;
26088                                 efuse_data = (u_int8_t)temp;
26089                         } else {
26090                                 efuse_data = (u_int8_t)temp;
26091                         }
26092                 }
26093         }
26094
26095         DELAY(20);
26096
26097         return efuse_data;
26098 }
26099
26100 void MP_WriteOtherFunPciEConfigSpace(
26101         struct re_softc *sc,
26102         u_int8_t MultiFunSelBit,
26103         u_int16_t ByteEnAndAddr,
26104         u_int32_t RegData)
26105 {
26106         u_int32_t Timeout = 0, WaitCount = 10;
26107         u_int32_t TmpUlong = 0x80000000;
26108         u_int32_t WriteDone;
26109
26110         if (MultiFunSelBit > 7) {
26111                 return;
26112         }
26113
26114         TmpUlong |= MultiFunSelBit << 16;
26115
26116         CSR_WRITE_4(sc, RE_CSIDR, RegData);
26117         TmpUlong |= (u_int32_t) ByteEnAndAddr;
26118         CSR_WRITE_4(sc, RE_CSIAR, TmpUlong);
26119
26120         do {
26121                 DELAY(100);
26122
26123                 WriteDone = CSR_READ_4(sc, RE_CSIAR);
26124                 Timeout++;
26125         } while (((WriteDone & 0x80000000) != 0) && (Timeout < WaitCount));
26126
26127
26128         DELAY(50);
26129 }
26130
26131 u_int32_t MP_ReadOtherFunPciEConfigSpace(
26132         struct re_softc *sc,
26133         u_int8_t MultiFunSelBit,
26134         u_int16_t ByteEnAndAddr)
26135 {
26136         u_int32_t Timeout = 0, WaitCount = 10;
26137         u_int32_t TmpUlong = 0x00000000;
26138         u_int32_t ReadDone;
26139         u_int32_t RetVal = 0xffffffff;
26140
26141         if (MultiFunSelBit > 7) {
26142                 return 0xffffffff;
26143         }
26144
26145         TmpUlong |= MultiFunSelBit << 16;
26146
26147         TmpUlong |= (u_int32_t) ByteEnAndAddr;
26148         CSR_WRITE_4(sc, RE_CSIAR, TmpUlong);
26149
26150         do {
26151                 DELAY(100);
26152
26153                 ReadDone = CSR_READ_4(sc, RE_CSIAR);
26154                 Timeout++;
26155         } while (((ReadDone & 0x80000000) == 0)&& (Timeout < WaitCount));
26156
26157         DELAY(50);
26158
26159         return RetVal;
26160 }
26161
26162 void MP_WritePciEConfigSpace(
26163         struct re_softc *sc,
26164         u_int16_t ByteEnAndAddr,
26165         u_int32_t RegData)
26166 {
26167         u_int8_t MultiFunSelBit;
26168
26169         if (sc->re_type == MACFG_52 || sc->re_type == MACFG_53) {
26170                 MultiFunSelBit = 2;
26171         } else if (sc->re_type == MACFG_60) {
26172                 MultiFunSelBit = 1;
26173         } else {
26174                 MultiFunSelBit = 0;
26175         }
26176
26177         MP_WriteOtherFunPciEConfigSpace(sc, MultiFunSelBit, ByteEnAndAddr, RegData);
26178
26179 }
26180
26181 u_int32_t MP_ReadPciEConfigSpace(
26182         struct re_softc *sc,
26183         u_int16_t ByteEnAndAddr)
26184 {
26185         u_int8_t MultiFunSelBit;
26186
26187         if (sc->re_type == MACFG_52 || sc->re_type == MACFG_53) {
26188                 MultiFunSelBit = 2;
26189         } else if (sc->re_type == MACFG_60) {
26190                 MultiFunSelBit = 1;
26191         } else {
26192                 MultiFunSelBit = 0;
26193         }
26194
26195         return MP_ReadOtherFunPciEConfigSpace(sc, MultiFunSelBit, ByteEnAndAddr);
26196 }
26197
26198 static u_int16_t MappingPhyOcpAddress(
26199         struct re_softc *sc,
26200         u_int16_t   PageNum,
26201         u_int8_t  RegNum)
26202 {
26203         u_int16_t OcpPageNum = 0;
26204         u_int8_t OcpRegNum = 0;
26205         u_int16_t OcpPhyAddress = 0;
26206
26207         if (PageNum == 0) {
26208                 OcpPageNum = 0x0A40 + (RegNum / 8);
26209                 OcpRegNum = 0x10 + (RegNum % 8);
26210         } else {
26211                 OcpPageNum = PageNum;
26212                 OcpRegNum = RegNum;
26213         }
26214
26215         OcpPageNum <<= 4;
26216
26217         if (OcpRegNum < 16) {
26218                 OcpPhyAddress = 0;
26219         } else {
26220                 OcpRegNum -= 16;
26221                 OcpRegNum <<= 1;
26222
26223                 OcpPhyAddress = OcpPageNum + OcpRegNum;
26224         }
26225
26226         return OcpPhyAddress;
26227 }
26228
26229 static u_int16_t MP_RealReadPhyOcpRegWord(
26230         struct re_softc *sc,
26231         u_int16_t OcpRegAddr)
26232 {
26233         u_int32_t Timeout = 0, WaitCount = 100;
26234         u_int32_t TmpUlong;
26235         u_int16_t RetVal = 0xffff;
26236
26237         TmpUlong = OcpRegAddr / 2;
26238         TmpUlong <<= 16;
26239
26240         CSR_WRITE_4(sc, RE_PHYOCPACCESS, TmpUlong);
26241
26242         do {
26243                 DELAY(1);
26244
26245                 TmpUlong = CSR_READ_4(sc, RE_PHYOCPACCESS);
26246
26247                 Timeout++;
26248         } while ((!(TmpUlong & PHYAR_Flag)) && (Timeout < WaitCount));
26249
26250         RetVal = (u_int16_t)TmpUlong;
26251
26252         return RetVal;
26253 }
26254
26255 u_int16_t MP_ReadPhyOcpRegWord(
26256         struct re_softc *sc,
26257         u_int16_t PhyPage,
26258         u_int8_t PhyRegNum)
26259 {
26260         u_int16_t OcpRegAddr;
26261         u_int16_t RetVal = 0xffff;
26262
26263         OcpRegAddr = MappingPhyOcpAddress(sc, PhyPage, PhyRegNum);
26264
26265         if (OcpRegAddr % 2) {
26266                 u_int16_t tmpUshort;
26267
26268                 tmpUshort = MP_RealReadPhyOcpRegWord(sc, OcpRegAddr);
26269                 tmpUshort &= 0xFF00;
26270                 tmpUshort >>= 8;
26271                 RetVal = tmpUshort;
26272
26273
26274                 tmpUshort = MP_RealReadPhyOcpRegWord(sc, OcpRegAddr + 1);
26275                 tmpUshort &= 0x00FF;
26276                 tmpUshort <<= 8;
26277                 RetVal |= tmpUshort;
26278         } else {
26279                 RetVal = MP_RealReadPhyOcpRegWord(sc, OcpRegAddr);
26280         }
26281
26282         return RetVal;
26283 }
26284
26285 static void MP_RealWritePhyOcpRegWord(
26286         struct re_softc *sc,
26287         u_int16_t OcpRegAddr,
26288         u_int16_t RegData)
26289 {
26290         u_int32_t Timeout = 0, WaitCount = 100;
26291         u_int32_t TmpUlong;
26292
26293         TmpUlong = OcpRegAddr / 2;
26294         TmpUlong <<= 16;
26295         TmpUlong += RegData;
26296         TmpUlong |= BIT_31;
26297
26298         CSR_WRITE_4(sc, RE_PHYOCPACCESS, TmpUlong);
26299
26300         do {
26301                 DELAY(1);
26302
26303                 TmpUlong = CSR_READ_4(sc, RE_PHYOCPACCESS);
26304
26305                 Timeout++;
26306         } while ((TmpUlong & PHYAR_Flag) && (Timeout < WaitCount));
26307 }
26308
26309 void MP_WritePhyOcpRegWord(
26310         struct re_softc *sc,
26311         u_int16_t PhyPage,
26312         u_int8_t PhyRegNum,
26313         u_int16_t RegData)
26314 {
26315         u_int16_t OcpRegAddr;
26316
26317         OcpRegAddr = MappingPhyOcpAddress(sc, PhyPage, PhyRegNum);
26318
26319         if (OcpRegAddr % 2) {
26320                 u_int16_t tmpUshort;
26321
26322                 tmpUshort = MP_RealReadPhyOcpRegWord(sc, OcpRegAddr);
26323                 tmpUshort &= 0x00FF;
26324                 tmpUshort |= (RegData <<  8);
26325                 MP_RealWritePhyOcpRegWord(sc, OcpRegAddr, tmpUshort);
26326                 tmpUshort = MP_RealReadPhyOcpRegWord(sc, OcpRegAddr + 1);
26327                 tmpUshort &= 0xFF00;
26328                 tmpUshort |= (RegData >> 8);
26329                 MP_RealWritePhyOcpRegWord(sc, OcpRegAddr + 1, tmpUshort);
26330         } else {
26331                 MP_RealWritePhyOcpRegWord(sc, OcpRegAddr, RegData);
26332         }
26333 }
26334
26335 void MP_WriteMcuAccessRegWord(
26336         struct re_softc *sc,
26337         u_int16_t ExtRegAddr,
26338         u_int16_t RegData)
26339 {
26340         u_int32_t TmpUlong;
26341
26342         TmpUlong = ExtRegAddr / 2;
26343         TmpUlong <<= 16;
26344         TmpUlong += RegData;
26345         TmpUlong |= BIT_31;
26346
26347         CSR_WRITE_4(sc, RE_MCUACCESS, TmpUlong);
26348 }
26349
26350 u_int16_t MP_ReadMcuAccessRegWord(
26351         struct re_softc *sc,
26352         u_int16_t ExtRegAddr)
26353 {
26354         u_int32_t TmpUlong;
26355         u_int16_t RetVal = 0xffff;
26356
26357         TmpUlong = ExtRegAddr / 2;
26358         TmpUlong <<= 16;
26359
26360         CSR_WRITE_4(sc, RE_MCUACCESS, TmpUlong);
26361         TmpUlong = CSR_READ_4(sc, RE_MCUACCESS);
26362         RetVal = (u_int16_t)TmpUlong;
26363
26364         return RetVal;
26365 }
26366
26367 static u_int32_t real_ocp_read(struct re_softc *sc, u_int16_t addr, u_int8_t len)
26368 {
26369         int i, val_shift, shift = 0;
26370         u_int32_t value1 = 0, value2 = 0, mask;
26371
26372         if (len > 4 || len <= 0)
26373                 return -1;
26374
26375         while (len > 0) {
26376                 val_shift = addr % 4;
26377                 addr = addr & ~0x3;
26378
26379                 CSR_WRITE_4(sc, RE_OCPAR, (0x0F<<12) | (addr&0xFFF));
26380
26381                 for (i = 0; i < 20; i++) {
26382                         DELAY(100);
26383                         if (CSR_READ_4(sc, RE_OCPAR) & OCPAR_Flag)
26384                                 break;
26385                 }
26386
26387                 if (len == 1)       mask = (0xFF << (val_shift * 8)) & 0xFFFFFFFF;
26388                 else if (len == 2)  mask = (0xFFFF << (val_shift * 8)) & 0xFFFFFFFF;
26389                 else if (len == 3)  mask = (0xFFFFFF << (val_shift * 8)) & 0xFFFFFFFF;
26390                 else            mask = (0xFFFFFFFF << (val_shift * 8)) & 0xFFFFFFFF;
26391
26392                 value1 = CSR_READ_4(sc, RE_OCPDR) & mask;
26393                 value2 |= (value1 >> val_shift * 8) << shift * 8;
26394
26395                 if (len <= 4 - val_shift) {
26396                         len = 0;
26397                 } else {
26398                         len -= (4 - val_shift);
26399                         shift = 4 - val_shift;
26400                         addr += 4;
26401                 }
26402         }
26403
26404         DELAY(20);
26405
26406         return value2;
26407 }
26408
26409 static u_int32_t OCP_read_with_oob_base_address(struct re_softc *sc, u_int16_t addr, u_int8_t len, const u_int32_t base_address)
26410 {
26411         return re_eri_read_with_oob_base_address(sc, addr, len, ERIAR_OOB, base_address);
26412 }
26413
26414 static u_int32_t OCP_read(struct re_softc *sc, u_int16_t addr, u_int8_t len)
26415 {
26416         u_int32_t value = 0;
26417
26418         if (HW_DASH_SUPPORT_TYPE_2(sc))
26419                 value = re_eri_read(sc, addr, len, ERIAR_OOB);
26420         else if (HW_DASH_SUPPORT_TYPE_3(sc))
26421                 value = OCP_read_with_oob_base_address(sc, addr, len, RTL8168FP_OOBMAC_BASE);
26422         else
26423                 value = real_ocp_read(sc, addr, len);
26424
26425         return value;
26426 }
26427
26428 static int real_ocp_write(struct re_softc *sc, u_int16_t addr, u_int8_t len, u_int32_t value)
26429 {
26430         int i, val_shift, shift = 0;
26431         u_int32_t value1 = 0, mask;
26432
26433         if (len > 4 || len <= 0)
26434                 return -1;
26435
26436         while (len > 0) {
26437                 val_shift = addr % 4;
26438                 addr = addr & ~0x3;
26439
26440                 if (len == 1)       mask = (0xFF << (val_shift * 8)) & 0xFFFFFFFF;
26441                 else if (len == 2)  mask = (0xFFFF << (val_shift * 8)) & 0xFFFFFFFF;
26442                 else if (len == 3)  mask = (0xFFFFFF << (val_shift * 8)) & 0xFFFFFFFF;
26443                 else            mask = (0xFFFFFFFF << (val_shift * 8)) & 0xFFFFFFFF;
26444
26445                 value1 = OCP_read(sc, addr, 4) & ~mask;
26446                 value1 |= ((value << val_shift * 8) >> shift * 8);
26447
26448                 CSR_WRITE_4(sc, RE_OCPDR, value1);
26449                 CSR_WRITE_4(sc, RE_OCPAR, OCPAR_Flag | (0x0F<<12) | (addr&0xFFF));
26450
26451                 for (i = 0; i < 10; i++) {
26452                         DELAY(100);
26453
26454                         /* Check if the RTL8168 has completed ERI write */
26455                         if (!(CSR_READ_4(sc, RE_OCPAR) & OCPAR_Flag))
26456                                 break;
26457                 }
26458
26459                 if (len <= 4 - val_shift) {
26460                         len = 0;
26461                 } else {
26462                         len -= (4 - val_shift);
26463                         shift = 4 - val_shift;
26464                         addr += 4;
26465                 }
26466         }
26467
26468         DELAY(20);
26469
26470         return 0;
26471 }
26472
26473 static int OCP_write_with_oob_base_address(struct re_softc *sc, u_int16_t addr, u_int8_t len, u_int32_t value, const u_int32_t base_address)
26474 {
26475         return re_eri_write_with_oob_base_address(sc, addr, len, value, ERIAR_OOB, base_address);
26476 }
26477
26478 static void OCP_write(struct re_softc *sc, u_int16_t addr, u_int8_t len, u_int32_t value)
26479 {
26480         if (HW_DASH_SUPPORT_TYPE_2(sc))
26481                 re_eri_write(sc, addr, len, value, ERIAR_OOB);
26482         else if (HW_DASH_SUPPORT_TYPE_3(sc))
26483                 OCP_write_with_oob_base_address(sc, addr, len, value, RTL8168FP_OOBMAC_BASE);
26484         else
26485                 real_ocp_write(sc, addr, len, value);
26486 }
26487
26488 static void OOB_mutex_lock(struct re_softc *sc)
26489 {
26490         u_int8_t reg_16, reg_a0;
26491         u_int32_t wait_cnt_0, wait_Cnt_1;
26492         u_int16_t ocp_reg_mutex_ib;
26493         u_int16_t ocp_reg_mutex_oob;
26494         u_int16_t ocp_reg_mutex_prio;
26495
26496         switch (sc->re_type) {
26497         case MACFG_63:
26498         case MACFG_64:
26499         case MACFG_65:
26500                 ocp_reg_mutex_oob = 0x16;
26501                 ocp_reg_mutex_ib = 0x17;
26502                 ocp_reg_mutex_prio = 0x9C;
26503                 break;
26504         case MACFG_66:
26505                 ocp_reg_mutex_oob = 0x06;
26506                 ocp_reg_mutex_ib = 0x07;
26507                 ocp_reg_mutex_prio = 0x9C;
26508                 break;
26509         case MACFG_61:
26510         case MACFG_62:
26511         case MACFG_67:
26512         case MACFG_70:
26513         case MACFG_71:
26514         default:
26515                 ocp_reg_mutex_oob = 0x110;
26516                 ocp_reg_mutex_ib = 0x114;
26517                 ocp_reg_mutex_prio = 0x11C;
26518                 break;
26519         }
26520
26521         OCP_write(sc, ocp_reg_mutex_ib, 1, BIT_0);
26522         reg_16 = OCP_read(sc, ocp_reg_mutex_oob, 1);
26523         wait_cnt_0 = 0;
26524         while(reg_16) {
26525                 reg_a0 = OCP_read(sc, ocp_reg_mutex_prio, 1);
26526                 if (reg_a0) {
26527                         OCP_write(sc, ocp_reg_mutex_ib, 1, 0x00);
26528                         reg_a0 = OCP_read(sc, ocp_reg_mutex_prio, 1);
26529                         wait_Cnt_1 = 0;
26530                         while(reg_a0) {
26531                                 reg_a0 = OCP_read(sc, ocp_reg_mutex_prio, 1);
26532
26533                                 wait_Cnt_1++;
26534
26535                                 if (wait_Cnt_1 > 2000)
26536                                         break;
26537                         };
26538                         OCP_write(sc, ocp_reg_mutex_ib, 1, BIT_0);
26539
26540                 }
26541                 reg_16 = OCP_read(sc, ocp_reg_mutex_oob, 1);
26542
26543                 wait_cnt_0++;
26544
26545                 if (wait_cnt_0 > 2000)
26546                         break;
26547         };
26548 }
26549
26550 static void OOB_mutex_unlock(struct re_softc *sc)
26551 {
26552         u_int16_t ocp_reg_mutex_ib;
26553         u_int16_t ocp_reg_mutex_oob;
26554         u_int16_t ocp_reg_mutex_prio;
26555
26556         switch (sc->re_type) {
26557         case MACFG_63:
26558         case MACFG_64:
26559         case MACFG_65:
26560                 ocp_reg_mutex_oob = 0x16;
26561                 ocp_reg_mutex_ib = 0x17;
26562                 ocp_reg_mutex_prio = 0x9C;
26563                 break;
26564         case MACFG_66:
26565                 ocp_reg_mutex_oob = 0x06;
26566                 ocp_reg_mutex_ib = 0x07;
26567                 ocp_reg_mutex_prio = 0x9C;
26568                 break;
26569         case MACFG_61:
26570         case MACFG_62:
26571         case MACFG_67:
26572         case MACFG_70:
26573         case MACFG_71:
26574         default:
26575                 ocp_reg_mutex_oob = 0x110;
26576                 ocp_reg_mutex_ib = 0x114;
26577                 ocp_reg_mutex_prio = 0x11C;
26578                 break;
26579         }
26580
26581         OCP_write(sc, ocp_reg_mutex_prio, 1, BIT_0);
26582         OCP_write(sc, ocp_reg_mutex_ib, 1, 0x00);
26583 }
26584
26585 static int re_check_dash(struct re_softc *sc)
26586 {
26587         switch(sc->re_type) {
26588         case MACFG_61:
26589         case MACFG_62:
26590         case MACFG_67:
26591         case MACFG_63:
26592         case MACFG_64:
26593         case MACFG_65:
26594         case MACFG_66:
26595         case MACFG_70:
26596         case MACFG_71:
26597                 if (HW_DASH_SUPPORT_TYPE_2(sc) || HW_DASH_SUPPORT_TYPE_3(sc)) {
26598                         if (OCP_read(sc, 0x128, 1) & BIT_0)
26599                                 return 1;
26600                         else
26601                                 return 0;
26602                 } else {
26603                         u_int32_t reg;
26604
26605                         if (sc->re_type == MACFG_66)
26606                                 reg = 0xb8;
26607                         else
26608                                 reg = 0x10;
26609
26610                         if (OCP_read(sc, reg, 2) & 0x00008000)
26611                                 return 1;
26612                         else
26613                                 return 0;
26614                 }
26615                 break;
26616         default:
26617                 return 0;
26618         }
26619 }
26620
26621 static void OOB_notify(struct re_softc *sc, u_int8_t cmd)
26622 {
26623         int i;
26624
26625         CSR_WRITE_1(sc, RE_ERIDR, cmd);
26626         CSR_WRITE_4(sc, RE_ERIAR, 0x800010E8);
26627         DELAY(2000);
26628         for (i = 0; i < 5; i++) {
26629                 DELAY(100);
26630                 if (!(CSR_READ_4(sc, RE_ERIAR) & ERIAR_Flag))
26631                         break;
26632         }
26633
26634         OCP_write(sc, 0x30, 1, 0x01);
26635 }
26636
26637 void re_driver_start(struct re_softc *sc)
26638 {
26639         if (HW_DASH_SUPPORT_TYPE_2(sc) || HW_DASH_SUPPORT_TYPE_3(sc)) {
26640                 u_int32_t tmp_value;
26641
26642                 if (!sc->re_dash)
26643                         return;
26644
26645                 OCP_write(sc, 0x180, 1, OOB_CMD_DRIVER_START);
26646                 tmp_value = OCP_read(sc, 0x30, 1);
26647                 tmp_value |= BIT_0;
26648                 OCP_write(sc, 0x30, 1, tmp_value);
26649         } else {
26650                 int timeout;
26651                 u_int32_t reg;
26652
26653                 if (sc->re_type == MACFG_66) {
26654                         CSR_WRITE_1(sc, RE_TwiCmdReg, CSR_READ_1(sc, RE_TwiCmdReg) | (BIT_7));
26655                 }
26656
26657                 OOB_notify(sc, OOB_CMD_DRIVER_START);
26658
26659                 if (sc->re_type == MACFG_66)
26660                         reg = 0xB8;
26661                 else
26662                         reg = 0x10;
26663
26664                 for (timeout = 0; timeout < 10; timeout++) {
26665                         DELAY(10000);
26666                         if (OCP_read(sc, reg, 2) & BIT_11)
26667                                 break;
26668                 }
26669         }
26670 }
26671
26672 void re_driver_stop(struct re_softc *sc)
26673 {
26674         if (HW_DASH_SUPPORT_TYPE_2(sc) || HW_DASH_SUPPORT_TYPE_3(sc)) {
26675                 u_int32_t tmp_value;
26676
26677                 if (!sc->re_dash)
26678                         return;
26679
26680                 Dash2DisableTxRx(sc);
26681
26682                 OCP_write(sc, 0x180, 1, OOB_CMD_DRIVER_STOP);
26683                 tmp_value = OCP_read(sc, 0x30, 1);
26684                 tmp_value |= BIT_0;
26685                 OCP_write(sc, 0x30, 1, tmp_value);
26686         } else {
26687                 int timeout;
26688                 u_int32_t reg;
26689
26690                 OOB_notify(sc, OOB_CMD_DRIVER_STOP);
26691
26692                 if (sc->re_type == MACFG_66)
26693                         reg = 0xB8;
26694                 else
26695                         reg = 0x10;
26696
26697                 for (timeout = 0; timeout < 10; timeout++) {
26698                         DELAY(10000);
26699                         if ((OCP_read(sc, reg, 4) & BIT_11) == 0)
26700                                 break;
26701                 }
26702
26703                 if (sc->re_type == MACFG_66) {
26704                         CSR_WRITE_1(sc, RE_TwiCmdReg, CSR_READ_1(sc, RE_TwiCmdReg) & ~(BIT_7));
26705                 }
26706         }
26707 }
26708
26709 /*----------------------------------------------------------------------------*/
26710 /*      8139 (CR9346) 9346 command register bits (offset 0x50, 1 byte)*/
26711 /*----------------------------------------------------------------------------*/
26712 #define CR9346_EEDO                             0x01                    /* 9346 data out*/
26713 #define CR9346_EEDI                             0x02                    /* 9346 data in*/
26714 #define CR9346_EESK                             0x04                    /* 9346 serial clock*/
26715 #define CR9346_EECS                             0x08                    /* 9346 chip select*/
26716 #define CR9346_EEM0                             0x40                    /* select 8139 operating mode*/
26717 #define CR9346_EEM1                             0x80                    /* 00: normal*/
26718 #define CR9346_CFGRW                    0xC0                    /* Config register write*/
26719 #define CR9346_NORM                     0x00
26720
26721 /*----------------------------------------------------------------------------*/
26722 /*      EEPROM bit definitions(EEPROM control register bits)*/
26723 /*----------------------------------------------------------------------------*/
26724 #define EN_TRNF                                 0x10                    /* Enable turnoff*/
26725 #define EEDO                                            CR9346_EEDO     /* EEPROM data out*/
26726 #define EEDI                                            CR9346_EEDI             /* EEPROM data in (set for writing data)*/
26727 #define EECS                                            CR9346_EECS             /* EEPROM chip select (1=high, 0=low)*/
26728 #define EESK                                            CR9346_EESK             /* EEPROM shift clock (1=high, 0=low)*/
26729
26730 /*----------------------------------------------------------------------------*/
26731 /*      EEPROM opcodes*/
26732 /*----------------------------------------------------------------------------*/
26733 #define EEPROM_READ_OPCODE      06
26734 #define EEPROM_WRITE_OPCODE     05
26735 #define EEPROM_ERASE_OPCODE     07
26736 #define EEPROM_EWEN_OPCODE      19                              /* Erase/write enable*/
26737 #define EEPROM_EWDS_OPCODE      16                              /* Erase/write disable*/
26738
26739 #define CLOCK_RATE                              50                              /* us*/
26740
26741 #define RaiseClock(_sc,_x)                              \
26742         (_x) = (_x) | EESK;                                     \
26743         CSR_WRITE_1((_sc), RE_EECMD, (_x));     \
26744         DELAY(CLOCK_RATE);
26745
26746 #define LowerClock(_sc,_x)                              \
26747         (_x) = (_x) & ~EESK;                                    \
26748         CSR_WRITE_1((_sc), RE_EECMD, (_x));     \
26749         DELAY(CLOCK_RATE);
26750
26751 /*
26752  * Shift out bit(s) to the EEPROM.
26753  */
26754 static void re_eeprom_ShiftOutBits(struct re_softc *sc, int data, int count)
26755 {
26756         u_int16_t x, mask;
26757
26758         mask = 0x01 << (count - 1);
26759         x = CSR_READ_1(sc, RE_EECMD);
26760
26761         x &= ~(EEDO | EEDI);
26762
26763         do {
26764                 x &= ~EEDI;
26765                 if (data & mask)
26766                         x |= EEDI;
26767
26768                 CSR_WRITE_1(sc, RE_EECMD, x);
26769                 DELAY(CLOCK_RATE);
26770                 RaiseClock(sc,x);
26771                 LowerClock(sc,x);
26772                 mask = mask >> 1;
26773         } while (mask);
26774
26775         x &= ~EEDI;
26776         CSR_WRITE_1(sc, RE_EECMD, x);
26777 }
26778
26779 /*
26780  * Shift in bit(s) from the EEPROM.
26781  */
26782 static u_int16_t re_eeprom_ShiftInBits(struct re_softc *sc)
26783 {
26784         u_int16_t x,d,i;
26785         x = CSR_READ_1(sc, RE_EECMD);
26786
26787         x &= ~(EEDO | EEDI);
26788         d = 0;
26789
26790         for (i=0; i<16; i++) {
26791                 d = d << 1;
26792                 RaiseClock(sc, x);
26793
26794                 x = CSR_READ_1(sc, RE_EECMD);
26795
26796                 x &= ~(EEDI);
26797                 if (x & EEDO)
26798                         d |= 1;
26799
26800                 LowerClock(sc, x);
26801         }
26802
26803         return d;
26804 }
26805
26806 /*
26807  * Clean up EEprom read/write setting
26808  */
26809 static void re_eeprom_EEpromCleanup(struct re_softc *sc)
26810 {
26811         u_int16_t x;
26812         x = CSR_READ_1(sc, RE_EECMD);
26813
26814         x &= ~(EECS | EEDI);
26815         CSR_WRITE_1(sc, RE_EECMD, x);
26816
26817         RaiseClock(sc, x);
26818         LowerClock(sc, x);
26819 }
26820
26821 /*
26822  * Read a word of data stored in the EEPROM at address 'addr.'
26823  */
26824 static void re_eeprom_getword(struct re_softc *sc, int addr, u_int16_t *dest)
26825 {
26826         u_int16_t x;
26827
26828         /* select EEPROM, reset bits, set EECS*/
26829         x = CSR_READ_1(sc, RE_EECMD);
26830
26831         x &= ~(EEDI | EEDO | EESK | CR9346_EEM0);
26832         x |= CR9346_EEM1 | EECS;
26833         CSR_WRITE_1(sc, RE_EECMD, x);
26834
26835         /* write the read opcode and register number in that order*/
26836         /* The opcode is 3bits in length, reg is 6 bits long*/
26837         re_eeprom_ShiftOutBits(sc, EEPROM_READ_OPCODE, 3);
26838
26839         if (CSR_READ_4(sc, RE_RXCFG) & RE_RXCFG_RX_9356SEL)
26840                 re_eeprom_ShiftOutBits(sc, addr,8);     /*93c56=8*/
26841         else
26842                 re_eeprom_ShiftOutBits(sc, addr,6);     /*93c46=6*/
26843
26844         /* Now read the data (16 bits) in from the selected EEPROM word*/
26845         *dest=re_eeprom_ShiftInBits(sc);
26846
26847         re_eeprom_EEpromCleanup(sc);
26848         return;
26849 }
26850
26851 /*
26852  * Read a sequence of words from the EEPROM.
26853  */
26854 static void re_read_eeprom(struct re_softc *sc, caddr_t dest, int off, int cnt, int swap)
26855 {
26856         int                     i;
26857         u_int16_t               word = 0, *ptr;
26858
26859         for (i = 0; i < cnt; i++) {
26860                 re_eeprom_getword(sc, off + i, &word);
26861                 ptr = (u_int16_t *)(dest + (i * 2));
26862                 if (swap)
26863                         *ptr = ntohs(word);
26864                 else
26865                         *ptr = word;
26866         }
26867
26868         return;
26869 }
26870
26871 #ifdef __DragonFly__
26872
26873 int
26874 rtl_check_mac_version(struct re_softc *sc)
26875 {
26876
26877         return (re_check_mac_version(sc));
26878 }
26879
26880 void
26881 rtl_init_software_variable(struct re_softc *sc)
26882 {
26883
26884         re_init_software_variable(sc);
26885 }
26886
26887 void
26888 rtl_exit_oob(struct re_softc *sc)
26889 {
26890
26891         re_exit_oob(sc);
26892 }
26893
26894 void
26895 rtl_hw_init(struct re_softc *sc)
26896 {
26897
26898         re_hw_init(sc);
26899 }
26900
26901 void
26902 rtl_reset(struct re_softc *sc)
26903 {
26904
26905         re_reset(sc);
26906 }
26907
26908 void
26909 rtl_get_hw_mac_address(struct re_softc *sc, u_int8_t *eaddr)
26910 {
26911
26912         re_get_hw_mac_address(sc, eaddr);
26913 }
26914
26915 void
26916 rtl_phy_power_up(struct re_softc *sc)
26917 {
26918
26919         re_phy_power_up(sc->dev);
26920 }
26921
26922 void
26923 rtl_hw_phy_config(struct re_softc *sc)
26924 {
26925
26926         re_hw_phy_config(sc);
26927 }
26928
26929 void
26930 rtl_clrwol(struct re_softc *sc)
26931 {
26932
26933         re_clrwol(sc);
26934 }
26935
26936 int
26937 rtl_ifmedia_upd(struct ifnet *ifp)
26938 {
26939
26940         return (re_ifmedia_upd(ifp));
26941 }
26942
26943 void
26944 rtl_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
26945 {
26946
26947         re_ifmedia_sts(ifp, ifmr);
26948 }
26949
26950 void
26951 rtl_stop(struct re_softc *sc)
26952 {
26953
26954         re_stop_rtl(sc);
26955 }
26956
26957 u_int8_t
26958 rtl_link_ok(struct re_softc *sc)
26959 {
26960
26961         return (re_link_ok(sc));
26962 }
26963
26964 void
26965 rtl_link_on_patch(struct re_softc *sc)
26966 {
26967
26968         re_link_on_patch(sc);
26969 }
26970
26971 void
26972 rtl_set_eaddr(struct re_softc *sc)
26973 {
26974
26975         re_init_unlock(sc);
26976 }
26977
26978 void
26979 rtl_hw_start(struct re_softc *sc)
26980 {
26981
26982         re_hw_start_unlock(sc);
26983 }
26984
26985 void
26986 rtl_set_rx_packet_filter(struct re_softc *sc)
26987 {
26988
26989         re_set_rx_packet_filter(sc);
26990 }
26991
26992 void
26993 rtl_hw_d3_para(struct re_softc *sc)
26994 {
26995
26996         re_hw_d3_para(sc);
26997 }
26998
26999 void
27000 rtl_phy_power_down(struct re_softc *sc)
27001 {
27002
27003         re_phy_power_down(sc->dev);
27004 }
27005
27006 void
27007 rtl_cmac_unmap(struct re_softc *sc)
27008 {
27009
27010         if (HW_DASH_SUPPORT_TYPE_3(sc) && sc->re_dash &&
27011             sc->re_mapped_cmac_handle != 0) {
27012                 bus_space_unmap(sc->re_cmac_tag, sc->re_mapped_cmac_handle,
27013                     RE_REGS_SIZE);
27014         }
27015 }
27016
27017 #endif  /* __DragonFly__ */