kernel/if_re: Adjust permissions.
[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.92 " __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
60 #include <net/if.h>
61 #include <net/if_arp.h>
62 #include <net/ethernet.h>
63 #include <net/if_dl.h>
64 #include <net/if_media.h>
65
66 #include <net/bpf.h>
67
68 #include <vm/vm.h>              /* for vtophys */
69 #include <vm/pmap.h>            /* for vtophys */
70 #include <machine/clock.h>      /* for DELAY */
71
72 #include <machine/bus.h>
73 #include <machine/resource.h>
74 #include <sys/bus.h>
75 #include <sys/rman.h>
76 #include <sys/endian.h>
77
78 #include <dev/mii/mii.h>
79 #include <dev/re/if_rereg.h>
80
81 #if OS_VER < VERSION(5,3)
82 #include <pci/pcireg.h>
83 #include <pci/pcivar.h>
84 #include <machine/bus_pio.h>
85 #include <machine/bus_memio.h>
86 #else
87 #include <dev/pci/pcireg.h>
88 #include <dev/pci/pcivar.h>
89 #include <sys/module.h>
90 #endif
91
92 #if OS_VER > VERSION(5,9)
93 #include <sys/cdefs.h>
94 #include <sys/endian.h>
95 #include <net/if_types.h>
96 #include <net/if_vlan_var.h>
97 #endif
98 #else   /* __DragonFly__ */
99
100 #include <sys/param.h>
101 #include <sys/bus.h>
102 #include <sys/endian.h>
103 #include <sys/kernel.h>
104 #include <sys/systm.h>
105
106 #include <net/ethernet.h>
107 #include <net/if.h>
108 #include <net/if_arp.h>
109 #include <net/if_dl.h>
110 #include <net/if_media.h>
111 #include <net/if_poll.h>
112 #include <net/vlan/if_vlan_var.h>
113
114 #include <bus/pci/pcireg.h>
115 #include <bus/pci/pcivar.h>
116
117 #include <dev/netif/mii_layer/mii.h>
118 #include <dev/netif/re/if_revar.h>
119 #include <dev/netif/re/re.h>
120 #include <dev/netif/re/re_dragonfly.h>
121
122 #define RE_LOCK(sc)
123 #define RE_UNLOCK(sc)
124 #define RE_LOCK_ASSERT(sc)
125
126 #define RE_GET_IFNET(sc)        &(sc)->arpcom.ac_if
127
128 #endif  /* !__DragonFly__ */
129
130 #define EE_SET(x)                                       \
131         CSR_WRITE_1(sc, RE_EECMD,                       \
132                 CSR_READ_1(sc, RE_EECMD) | x)
133
134 #define EE_CLR(x)                                       \
135         CSR_WRITE_1(sc, RE_EECMD,                       \
136                 CSR_READ_1(sc, RE_EECMD) & ~x)
137
138 #ifndef __DragonFly__
139 /*
140  * Various supported device vendors/types and their names.
141  */
142 static struct re_type re_devs[] = {
143         {
144                 RT_VENDORID, RT_DEVICEID_8169,
145                 "Realtek PCI GBE Family Controller"
146         },
147         {
148                 RT_VENDORID, RT_DEVICEID_8169SC,
149                 "Realtek PCI GBE Family Controller"
150         },
151         {
152                 RT_VENDORID, RT_DEVICEID_8168,
153                 "Realtek PCIe GBE Family Controller"
154         },
155         {
156                 RT_VENDORID, RT_DEVICEID_8161,
157                 "Realtek PCIe GBE Family Controller"
158         },
159         {
160                 RT_VENDORID, RT_DEVICEID_8136,
161                 "Realtek PCIe FE Family Controller"
162         },
163         {
164                 DLINK_VENDORID, 0x4300,
165                 "Realtek PCI GBE Family Controller"
166         },
167         { 0, 0, NULL }
168 };
169
170 static int      re_probe                        __P((device_t));
171 static int      re_attach                       __P((device_t));
172 static int      re_detach                       __P((device_t));
173 static int      re_suspend                      __P((device_t));
174 static int      re_resume                       __P((device_t));
175 static int      re_shutdown                     __P((device_t));
176
177 static void MP_WritePhyUshort                   __P((struct re_softc*, u_int8_t, u_int16_t));
178 static u_int16_t MP_ReadPhyUshort               __P((struct re_softc*, u_int8_t));
179 static void MP_WriteEPhyUshort                  __P((struct re_softc*, u_int8_t, u_int16_t));
180 static u_int16_t MP_ReadEPhyUshort              __P((struct re_softc*, u_int8_t));
181 static u_int8_t MP_ReadEfuse                    __P((struct re_softc*, u_int16_t));
182 static void MP_WritePhyOcpRegWord       __P((struct re_softc*, u_int16_t, u_int8_t, u_int16_t));
183 static u_int16_t MP_ReadPhyOcpRegWord   __P((struct re_softc*, u_int16_t, u_int8_t));
184 static void MP_WriteMcuAccessRegWord    __P((struct re_softc*, u_int16_t, u_int16_t));
185 static u_int16_t MP_ReadMcuAccessRegWord  __P((struct re_softc*, u_int16_t));
186 static void MP_WritePciEConfigSpace     __P((struct re_softc*, u_int16_t, u_int32_t));
187 static u_int32_t MP_ReadPciEConfigSpace __P((struct re_softc*, u_int16_t));
188
189 static int re_check_dash  __P((struct re_softc *));
190
191 static void re_driver_start             __P((struct re_softc*));
192 static void re_driver_stop              __P((struct re_softc*));
193
194 static void re_hw_phy_config            __P((struct re_softc *));
195 static void re_init                     __P((void *));
196 static int  re_var_init                 __P((struct re_softc *));
197 static void re_reset                    __P((struct re_softc *));
198 static void re_stop                     __P((struct re_softc *));
199 static void re_setwol                   __P((struct re_softc *));
200 #endif  /* !__DragonFly__ */
201 static void re_clrwol                   __P((struct re_softc *));
202 #ifndef __DragonFly__
203 static void re_set_wol_linkspeed        __P((struct re_softc *));
204
205 static void re_start                            __P((struct ifnet *));
206 static int re_encap                             __P((struct re_softc *, struct mbuf *));
207 static void WritePacket                         __P((struct re_softc *, caddr_t, int, int, int, uint32_t, uint32_t));
208 static int CountFreeTxDescNum                   __P((struct re_descriptor));
209 static int CountMbufNum                         __P((struct mbuf *));
210 #ifdef RE_FIXUP_RX
211 static __inline void re_fixup_rx                __P((struct mbuf *));
212 #endif
213 static void re_txeof                            __P((struct re_softc *));
214
215 static void re_rxeof                            __P((struct re_softc *));
216
217 #if OS_VER < VERSION(7,0)
218 static void re_intr                             __P((void *));
219 #else
220 static int re_intr                              __P((void *));
221 #endif //OS_VER < VERSION(7,0)
222 #endif  /* !__DragonFly__ */
223 static void re_set_multicast_reg        __P((struct re_softc *, u_int32_t, u_int32_t));
224 #ifndef __DragonFly__
225 static void re_set_rx_packet_filter_in_sleep_state      __P((struct re_softc *));
226 #endif
227 static void re_set_rx_packet_filter     __P((struct re_softc *));
228 static void re_setmulti                 __P((struct re_softc *));
229 #ifndef __DragonFly__
230 static int  re_ioctl                    __P((struct ifnet *, u_long, caddr_t));
231 #endif
232 static u_int8_t re_link_ok      __P((struct re_softc *));
233 static void re_link_on_patch    __P((struct re_softc *));
234 #ifndef __DragonFly__
235 static void re_link_down_patch  __P((struct re_softc *));
236 static void re_init_timer       __P((struct re_softc *));
237 static void re_stop_timer       __P((struct re_softc *));
238 static void re_start_timer      __P((struct re_softc *));
239 static void re_tick                             __P((void *));
240 #if OS_VER < VERSION(7,0)
241 static void re_watchdog                         __P((struct ifnet *));
242 #endif
243 #endif  /* !__DragonFly__ */
244
245 static int  re_ifmedia_upd                      __P((struct ifnet *));
246 static void re_ifmedia_sts                      __P((struct ifnet *, struct ifmediareq *));
247
248 static void re_eeprom_ShiftOutBits              __P((struct re_softc *, int, int));
249 static u_int16_t re_eeprom_ShiftInBits          __P((struct re_softc *));
250 static void re_eeprom_EEpromCleanup             __P((struct re_softc *));
251 static void re_eeprom_getword                   __P((struct re_softc *, int, u_int16_t *));
252 static void re_read_eeprom                      __P((struct re_softc *, caddr_t, int, int, int));
253 #ifndef __DragonFly__
254 static void re_int_task                         (void *, int);
255 #endif  /* !__DragonFly__ */
256
257 static void re_phy_power_up(device_t dev);
258 static void re_phy_power_down(device_t dev);
259 #ifndef __DragonFly__
260 static int re_alloc_buf(struct re_softc *);
261 static void re_release_buf(struct re_softc *);
262 static void set_rxbufsize(struct re_softc*);
263 static void re_release_rx_buf(struct re_softc *);
264 static void re_release_tx_buf(struct re_softc *);
265 #endif  /* !__DragonFly__ */
266 static u_int32_t re_eri_read(struct re_softc *, int , int , int);
267 static int re_eri_write(struct re_softc *, int , int , u_int32_t, int);
268 static void OOB_mutex_lock(struct re_softc *);
269 static void OOB_mutex_unlock(struct re_softc *);
270
271 #ifdef __DragonFly__
272 u_int16_t MP_ReadMcuAccessRegWord(struct re_softc *, u_int16_t);
273 void MP_WriteMcuAccessRegWord(struct re_softc *, u_int16_t, u_int16_t);
274
275 u_int16_t MP_ReadPhyOcpRegWord(struct re_softc *, u_int16_t, u_int8_t);
276 void MP_WritePhyOcpRegWord(struct re_softc *, u_int16_t, u_int8_t, u_int16_t);
277
278 void MP_WritePhyUshort(struct re_softc *, u_int8_t, u_int16_t);
279 u_int16_t MP_ReadPhyUshort(struct re_softc *, u_int8_t);
280
281 u_int32_t MP_ReadPciEConfigSpace(struct re_softc *, u_int16_t);
282 void MP_WritePciEConfigSpace(struct re_softc *, u_int16_t, u_int32_t);
283
284 u_int16_t MP_ReadEPhyUshort(struct re_softc *, u_int8_t);
285 void MP_WriteEPhyUshort(struct re_softc *, u_int8_t, u_int16_t);
286
287 u_int8_t MP_ReadEfuse(struct re_softc *, u_int16_t);
288
289 void re_driver_start(struct re_softc *);
290 void re_driver_stop(struct re_softc *);
291 #endif  /* __DragonFly__ */
292
293 /* Tunables. */
294 static int msi_disable = 1;
295 TUNABLE_INT("hw.re.msi_disable", &msi_disable);
296 static int msix_disable = 0;
297 TUNABLE_INT("hw.re.msix_disable", &msix_disable);
298 static int prefer_iomap = 0;
299 TUNABLE_INT("hw.re.prefer_iomap", &prefer_iomap);
300 static int eee_enable = 0;
301 TUNABLE_INT("hw.re.eee_enable", &eee_enable);
302 static int phy_power_saving = 1;
303 TUNABLE_INT("hw.re.phy_power_saving", &phy_power_saving);
304 static int phy_mdix_mode = RE_ETH_PHY_AUTO_MDI_MDIX;
305 TUNABLE_INT("hw.re.phy_mdix_mode", &phy_power_saving);
306
307 #define RE_CSUM_FEATURES    (CSUM_IP | CSUM_TCP | CSUM_UDP)
308
309 #ifndef __DragonFly__
310 static device_method_t re_methods[] = {
311         /* Device interface */
312         DEVMETHOD(device_probe,         re_probe),
313         DEVMETHOD(device_attach,        re_attach),
314         DEVMETHOD(device_detach,        re_detach),
315         DEVMETHOD(device_suspend,   re_suspend),
316         DEVMETHOD(device_resume,    re_resume),
317         DEVMETHOD(device_shutdown,      re_shutdown),
318         { 0, 0 }
319 };
320
321 static driver_t re_driver = {
322         "re",
323         re_methods,
324         sizeof(struct re_softc)
325 };
326
327 static devclass_t re_devclass;
328
329 DRIVER_MODULE(if_re, pci, re_driver, re_devclass, 0, 0);
330 #endif  /* !__DragonFly__ */
331
332 static int re_is_ups_resume(struct re_softc *sc)
333 {
334         return (MP_ReadMcuAccessRegWord(sc, 0xD408) & BIT_0);
335 }
336
337 static void re_clear_ups_resume_bit(struct re_softc *sc)
338 {
339         MP_WriteMcuAccessRegWord(sc, 0xD408, MP_ReadMcuAccessRegWord(sc, 0xD408) & ~(BIT_0));
340 }
341
342 static void re_wait_phy_ups_resume(struct re_softc *sc, u_int16_t PhyState)
343 {
344         u_int16_t TmpPhyState;
345         int i=0;
346
347         do {
348                 TmpPhyState = MP_ReadPhyOcpRegWord(sc, 0x0A42, 0x10);
349                 TmpPhyState &= 0x7;
350                 DELAY(1000);
351                 i++;
352         } while ((i < 100) && (TmpPhyState != 2));
353 }
354
355 static void re_phy_power_up(device_t dev)
356 {
357         struct re_softc         *sc;
358         u_int8_t Data8;
359
360         sc = device_get_softc(dev);
361
362         if ((sc->re_if_flags & RL_FLAG_PHYWAKE_PM) != 0)
363                 CSR_WRITE_1(sc, RE_PMCH, CSR_READ_1(sc, RE_PMCH) | (BIT_6|BIT_7));
364
365         MP_WritePhyUshort(sc, 0x1F, 0x0000);
366
367         switch (sc->re_type) {
368         case MACFG_4:
369         case MACFG_5:
370         case MACFG_6:
371         case MACFG_21:
372         case MACFG_22:
373         case MACFG_23:
374         case MACFG_24:
375         case MACFG_25:
376         case MACFG_26:
377         case MACFG_27:
378         case MACFG_28:
379         case MACFG_31:
380         case MACFG_32:
381         case MACFG_33:
382         case MACFG_63:
383         case MACFG_64:
384         case MACFG_65:
385         case MACFG_66:
386                 MP_WritePhyUshort(sc, 0x0e, 0x0000);
387                 break;
388         case MACFG_56:
389         case MACFG_57:
390         case MACFG_58:
391         case MACFG_61:
392                 Data8 = re_eri_read(sc, 0x1AB, 1, ERIAR_ExGMAC);
393                 Data8 |= (BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
394                 re_eri_write(sc, 0x1AB, 1, Data8, ERIAR_ExGMAC);
395                 break;
396         default:
397                 break;
398         };
399
400
401         MP_WritePhyUshort(sc, MII_BMCR, BMCR_AUTOEN);
402
403         //wait mdc/mdio ready
404         switch(sc->re_type) {
405         case MACFG_61:
406         case MACFG_62:
407         case MACFG_67:
408                 DELAY(10000);
409                 break;
410         }
411
412         //wait ups resume (phy state 3)
413         switch(sc->re_type) {
414         case MACFG_68:
415         case MACFG_69:
416                 re_wait_phy_ups_resume(sc, 3);
417                 break;
418         };
419 }
420
421 static void re_phy_power_down(device_t dev)
422 {
423         struct re_softc         *sc;
424         u_int8_t Data8;
425
426         sc = device_get_softc(dev);
427
428         MP_WritePhyUshort(sc, 0x1F, 0x0000);
429
430         switch (sc->re_type) {
431         case MACFG_21:
432         case MACFG_22:
433         case MACFG_23:
434         case MACFG_24:
435         case MACFG_25:
436         case MACFG_26:
437         case MACFG_27:
438         case MACFG_28:
439         case MACFG_31:
440         case MACFG_32:
441         case MACFG_33:
442         case MACFG_63:
443         case MACFG_64:
444         case MACFG_65:
445         case MACFG_66:
446                 MP_WritePhyUshort(sc, 0x0e, 0x0200);
447                 MP_WritePhyUshort(sc, MII_BMCR, (BMCR_AUTOEN|BMCR_PDOWN));
448                 break;
449         case MACFG_56:
450         case MACFG_57:
451         case MACFG_58:
452         case MACFG_61:
453                 Data8 = re_eri_read(sc, 0x1AB, 1, ERIAR_ExGMAC);
454                 Data8 &= ~(BIT_2 | BIT_3 | BIT_4 | BIT_5 | BIT_6 | BIT_7);
455                 re_eri_write(sc, 0x1AB, 1, Data8, ERIAR_ExGMAC);
456
457                 MP_WritePhyUshort(sc, MII_BMCR, (BMCR_AUTOEN|BMCR_PDOWN));
458                 break;
459         default:
460                 MP_WritePhyUshort(sc, MII_BMCR, (BMCR_AUTOEN|BMCR_PDOWN));
461                 break;
462         }
463
464         switch (sc->re_type) {
465         case MACFG_56:
466         case MACFG_57:
467                 CSR_WRITE_1(sc, 0xD0, CSR_READ_1(sc, 0xD0) & ~BIT_6);
468                 break;
469         }
470
471         switch (sc->re_type) {
472         case MACFG_68:
473         case MACFG_69:
474                 CSR_WRITE_1(sc, 0xD0, CSR_READ_1(sc, 0xD0) & ~BIT_6);
475                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) & ~BIT_6);
476                 break;
477         }
478
479         if ((sc->re_if_flags & RL_FLAG_PHYWAKE_PM) != 0)
480                 CSR_WRITE_1(sc, RE_PMCH, CSR_READ_1(sc, RE_PMCH) & ~(BIT_6|BIT_7));
481 }
482
483 #ifndef __DragonFly__
484 static void re_tx_dma_map_buf(void *arg, bus_dma_segment_t *segs, int nseg, int error)
485 {
486         union TxDesc *txptr = arg;
487
488         if (error) {
489                 txptr->ul[0] &= ~htole32(RL_TDESC_CMD_BUFLEN);
490                 txptr->so1.TxBuffL = 0;
491                 txptr->so1.TxBuffH = 0;
492                 return;
493         }
494
495         txptr->so1.TxBuffL = htole32(RL_ADDR_LO(segs->ds_addr));
496         txptr->so1.TxBuffH = htole32(RL_ADDR_HI(segs->ds_addr));
497 }
498
499 static void re_rx_dma_map_buf(void *arg, bus_dma_segment_t *segs, int nseg, int error)
500 {
501         union RxDesc *rxptr = arg;
502
503         if (error) {
504                 rxptr->ul[0] &= ~htole32(RL_RDESC_CMD_BUFLEN);
505                 rxptr->so0.RxBuffL = 0;
506                 rxptr->so0.RxBuffH = 0;
507                 return;
508         }
509
510         rxptr->so0.RxBuffL = htole32(RL_ADDR_LO(segs->ds_addr));
511         rxptr->so0.RxBuffH = htole32(RL_ADDR_HI(segs->ds_addr));
512 }
513
514 static void re_dma_map_rxdesc(void *arg, bus_dma_segment_t *segs, int nseg, int error)
515 {
516         struct re_softc *sc = arg;
517
518
519         if (error)
520                 return;
521
522         CSR_WRITE_4(sc, 0xe4, RL_ADDR_LO(segs->ds_addr));
523         CSR_WRITE_4(sc, 0xe8, RL_ADDR_HI(segs->ds_addr));
524 }
525
526 static void re_dma_map_txdesc(void *arg, bus_dma_segment_t *segs, int nseg, int error)
527 {
528         struct re_softc *sc = arg;
529
530
531         if (error)
532                 return;
533
534         CSR_WRITE_4(sc, 0x20, RL_ADDR_LO(segs->ds_addr));
535         CSR_WRITE_4(sc, 0x24, RL_ADDR_HI(segs->ds_addr));
536 }
537
538 /*
539  * Probe for a RealTek 8129/8139 chip. Check the PCI vendor and device
540  * IDs against our list and return a device name if we find a match.
541  */
542 static int re_probe(dev)        /* Search for Realtek NIC chip */
543 device_t                dev;
544 {
545         struct re_type          *t;
546         t = re_devs;
547         while (t->re_name != NULL) {
548                 if ((pci_get_vendor(dev) == t->re_vid) &&
549                     (pci_get_device(dev) == t->re_did)) {
550                         device_set_desc(dev, t->re_name);
551                         return(0);
552                 }
553                 t++;
554         }
555
556         return(ENXIO);
557 }
558 #endif  /* !__DragonFly__ */
559
560
561 static u_int32_t re_eri_read(struct re_softc *sc, int addr, int len, int type)
562 {
563         int i, val_shift, shift = 0;
564         u_int32_t value1 = 0, value2 = 0, mask;
565
566         if (len > 4 || len <= 0)
567                 return -1;
568
569         while (len > 0) {
570                 val_shift = addr % ERIAR_Addr_Align;
571                 addr = addr & ~0x3;
572
573                 CSR_WRITE_4(sc,RE_ERIAR,
574                             ERIAR_Read |
575                             type << ERIAR_Type_shift |
576                             ERIAR_ByteEn << ERIAR_ByteEn_shift |
577                             addr);
578
579                 for (i = 0; i < 10; i++) {
580                         DELAY(100);
581
582                         /* Check if the RTL8168 has completed ERI read */
583                         if (CSR_READ_4(sc,RE_ERIAR) & ERIAR_Flag)
584                                 break;
585                 }
586
587                 if (len == 1)           mask = (0xFF << (val_shift * 8)) & 0xFFFFFFFF;
588                 else if (len == 2)      mask = (0xFFFF << (val_shift * 8)) & 0xFFFFFFFF;
589                 else if (len == 3)      mask = (0xFFFFFF << (val_shift * 8)) & 0xFFFFFFFF;
590                 else                    mask = (0xFFFFFFFF << (val_shift * 8)) & 0xFFFFFFFF;
591
592                 value1 = CSR_READ_4(sc,RE_ERIDR) & mask;
593                 value2 |= (value1 >> val_shift * 8) << shift * 8;
594
595                 if (len <= 4 - val_shift)
596                         len = 0;
597                 else {
598                         len -= (4 - val_shift);
599                         shift = 4 - val_shift;
600                         addr += 4;
601                 }
602         }
603
604         return value2;
605 }
606
607 static int re_eri_write(struct re_softc *sc, int addr, int len, u_int32_t value, int type)
608 {
609
610         int i, val_shift, shift = 0;
611         u_int32_t value1 = 0, mask;
612
613         if (len > 4 || len <= 0)
614                 return -1;
615
616         while (len > 0) {
617                 val_shift = addr % ERIAR_Addr_Align;
618                 addr = addr & ~0x3;
619
620                 if (len == 1)           mask = (0xFF << (val_shift * 8)) & 0xFFFFFFFF;
621                 else if (len == 2)      mask = (0xFFFF << (val_shift * 8)) & 0xFFFFFFFF;
622                 else if (len == 3)      mask = (0xFFFFFF << (val_shift * 8)) & 0xFFFFFFFF;
623                 else                    mask = (0xFFFFFFFF << (val_shift * 8)) & 0xFFFFFFFF;
624
625                 value1 = re_eri_read(sc, addr, 4, type) & ~mask;
626                 value1 |= ((value << val_shift * 8) >> shift * 8);
627
628                 CSR_WRITE_4(sc,RE_ERIDR, value1);
629                 CSR_WRITE_4(sc,RE_ERIAR,
630                             ERIAR_Write |
631                             type << ERIAR_Type_shift |
632                             ERIAR_ByteEn << ERIAR_ByteEn_shift |
633                             addr);
634
635                 for (i = 0; i < 10; i++) {
636                         DELAY(100);
637
638                         /* Check if the RTL8168 has completed ERI write */
639                         if (!(CSR_READ_4(sc,RE_ERIAR) & ERIAR_Flag))
640                                 break;
641                 }
642
643                 if (len <= 4 - val_shift)
644                         len = 0;
645                 else {
646                         len -= (4 - val_shift);
647                         shift = 4 - val_shift;
648                         addr += 4;
649                 }
650         }
651
652         return 0;
653 }
654
655 static void
656 ClearAndSetEthPhyBit(
657         struct re_softc *sc,
658         u_int8_t   addr,
659         u_int16_t   clearmask,
660         u_int16_t   setmask
661 )
662 {
663         u_int16_t PhyRegValue;
664
665
666         PhyRegValue = MP_ReadPhyUshort(sc, addr);
667         PhyRegValue &= ~clearmask;
668         PhyRegValue |= setmask;
669         MP_WritePhyUshort(sc, addr, PhyRegValue);
670 }
671
672 static void
673 ClearEthPhyBit(
674         struct re_softc *sc,
675         u_int8_t   addr,
676         u_int16_t   mask
677 )
678 {
679         ClearAndSetEthPhyBit(sc,
680                              addr,
681                              mask,
682                              0
683                             );
684 }
685
686 static void
687 SetEthPhyBit(
688         struct re_softc *sc,
689         u_int8_t   addr,
690         u_int16_t   mask
691 )
692 {
693         ClearAndSetEthPhyBit(sc,
694                              addr,
695                              0,
696                              mask
697                             );
698 }
699
700 #ifndef __DragonFly__
701 static void re_release_rx_buf(struct re_softc *sc)
702 {
703         struct ifnet            *ifp;
704         int i;
705         ifp = RE_GET_IFNET(sc);
706
707         if (sc->re_desc.re_rx_mtag) {
708                 for (i = 0; i < RE_RX_BUF_NUM; i++) {
709                         if (sc->re_desc.rx_buf[i]!=NULL) {
710                                 bus_dmamap_sync(sc->re_desc.re_rx_mtag,
711                                                 sc->re_desc.re_rx_dmamap[i],
712                                                 BUS_DMASYNC_POSTREAD);
713                                 bus_dmamap_unload(sc->re_desc.re_rx_mtag,
714                                                   sc->re_desc.re_rx_dmamap[i]);
715                                 bus_dmamap_destroy(sc->re_desc.re_rx_mtag,
716                                                    sc->re_desc.re_rx_dmamap[i]);
717                                 m_freem(sc->re_desc.rx_buf[i]);
718                                 sc->re_desc.rx_buf[i] =NULL;
719                         }
720                 }
721                 bus_dma_tag_destroy(sc->re_desc.re_rx_mtag);
722                 sc->re_desc.re_rx_mtag =0;
723         }
724
725 }
726 static void re_release_tx_buf(struct re_softc *sc)
727 {
728         struct ifnet            *ifp;
729         int i;
730         ifp = RE_GET_IFNET(sc);
731
732         if (sc->re_desc.re_tx_mtag) {
733                 for (i = 0; i < RE_TX_BUF_NUM; i++) {
734
735                         bus_dmamap_destroy(sc->re_desc.re_tx_mtag,
736                                            sc->re_desc.re_tx_dmamap[i]);
737                         m_freem(sc->re_desc.tx_buf[i]);
738
739                 }
740                 bus_dma_tag_destroy(sc->re_desc.re_tx_mtag);
741                 sc->re_desc.re_tx_mtag = 0;
742         }
743
744
745 }
746 static void re_release_buf(struct re_softc *sc)
747 {
748         re_release_rx_buf(sc);
749         re_release_tx_buf(sc);
750 }
751
752
753
754 static int re_alloc_buf(struct re_softc *sc)
755 {
756         int error =0;
757         int i,size;
758
759         error = bus_dma_tag_create(sc->re_parent_tag, 1, 0,
760                                    BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL,
761                                    NULL, MCLBYTES* RE_NTXSEGS, RE_NTXSEGS, 4096, 0,
762                                    NULL, NULL, &sc->re_desc.re_tx_mtag);
763
764         if (error) {
765                 //device_printf(dev,"re_tx_mtag fail\n");
766                 //goto fail;
767                 return error;
768         }
769
770         error = bus_dma_tag_create(
771                         sc->re_parent_tag,
772                         RE_RX_BUFFER_ALIGN, 0,          /* alignment, boundary */
773                         BUS_SPACE_MAXADDR,              /* lowaddr */
774                         BUS_SPACE_MAXADDR,              /* highaddr */
775                         NULL, NULL,                     /* filter, filterarg */
776                         sc->re_rx_desc_buf_sz, 1,                       /* maxsize,nsegments */
777                         sc->re_rx_desc_buf_sz,                  /* maxsegsize */
778                         0,                              /* flags */
779                         NULL, NULL,                     /* lockfunc, lockarg */
780                         &sc->re_desc.re_rx_mtag);
781         if (error) {
782                 //device_printf(dev,"re_rx_mtag fail\n");
783                 //goto fail;
784                 return error;
785         }
786
787         if (sc->re_rx_mbuf_sz <= MCLBYTES)
788                 size = MCLBYTES;
789         else if (sc->re_rx_mbuf_sz <=  MJUMPAGESIZE)
790                 size = MJUMPAGESIZE;
791         else
792                 size =MJUM9BYTES;
793         for (i = 0; i < RE_RX_BUF_NUM; i++) {
794                 sc->re_desc.rx_buf[i] = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, size);
795                 if (!sc->re_desc.rx_buf[i]) {
796                         //device_printf(dev, "m_getcl fail!!!\n");
797                         error = ENXIO;
798                         //goto fail;
799                         return error;
800                 }
801
802                 sc->re_desc.rx_buf[i]->m_len = sc->re_desc.rx_buf[i]->m_pkthdr.len = size;
803 #ifdef RE_FIXUP_RX
804                 /*
805                  * This is part of an evil trick to deal with non-x86 platforms.
806                  * The RealTek chip requires RX buffers to be aligned on 64-bit
807                  * boundaries, but that will hose non-x86 machines. To get around
808                  * this, we leave some empty space at the start of each buffer
809                  * and for non-x86 hosts, we copy the buffer back six bytes
810                  * to achieve word alignment. This is slightly more efficient
811                  * than allocating a new buffer, copying the contents, and
812                  * discarding the old buffer.
813                  */
814                 m_adj(sc->re_desc.rx_buf[i], RE_ETHER_ALIGN);
815 #endif
816
817                 error = bus_dmamap_create(sc->re_desc.re_rx_mtag, BUS_DMA_NOWAIT, &sc->re_desc.re_rx_dmamap[i]);
818                 if (error) {
819                         //device_printf(dev, "bus_dmamap_create fail!!!\n");
820                         //goto fail;
821                         return error;
822                 }
823         }
824
825         for (i = 0; i < RE_TX_BUF_NUM; i++) {
826                 error = bus_dmamap_create(sc->re_desc.re_tx_mtag, BUS_DMA_NOWAIT, &sc->re_desc.re_tx_dmamap[i]);
827                 if (error) {
828                         //device_printf(dev, "bus_dmamap_create fail!!!\n");
829                         //goto fail;
830                         return error;
831                 }
832         }
833
834         return 0;
835 }
836
837 static void set_rxbufsize(struct re_softc *sc)
838 {
839
840         //printf("set size\n");
841
842         struct ifnet            *ifp;
843         ifp = RE_GET_IFNET(sc);
844         sc->re_rx_desc_buf_sz = (ifp->if_mtu > ETHERMTU) ? ifp->if_mtu: ETHERMTU;
845         sc->re_rx_desc_buf_sz += (ETHER_VLAN_ENCAP_LEN + ETHER_HDR_LEN + ETHER_CRC_LEN + 1);
846         CSR_WRITE_2(sc, RE_RxMaxSize, sc->re_rx_desc_buf_sz);
847 }
848 #endif  /* !__DragonFly__ */
849
850 static void DisableMcuBPs(struct re_softc *sc)
851 {
852         switch(sc->re_type) {
853         case MACFG_56:
854         case MACFG_57:
855         case MACFG_58:
856         case MACFG_59:
857         case MACFG_60:
858         case MACFG_61:
859         case MACFG_62:
860         case MACFG_67:
861         case MACFG_68:
862         case MACFG_69:
863
864                 MP_WriteMcuAccessRegWord(sc, 0xFC28, 0x0000);
865                 MP_WriteMcuAccessRegWord(sc, 0xFC2A, 0x0000);
866                 MP_WriteMcuAccessRegWord(sc, 0xFC2C, 0x0000);
867                 MP_WriteMcuAccessRegWord(sc, 0xFC2E, 0x0000);
868                 MP_WriteMcuAccessRegWord(sc, 0xFC30, 0x0000);
869                 MP_WriteMcuAccessRegWord(sc, 0xFC32, 0x0000);
870                 MP_WriteMcuAccessRegWord(sc, 0xFC34, 0x0000);
871                 MP_WriteMcuAccessRegWord(sc, 0xFC36, 0x0000);
872
873                 DELAY(3000);
874
875                 MP_WriteMcuAccessRegWord(sc, 0xFC26, 0x0000);
876                 break;
877         }
878
879
880 }
881
882 static void re_hw_mac_mcu_config(struct re_softc *sc)
883 {
884         switch(sc->re_type) {
885         case MACFG_56:
886                 MP_WriteMcuAccessRegWord(sc, 0xE43C, 0x0000);
887                 MP_WriteMcuAccessRegWord(sc, 0xE43E, 0x0000);
888
889                 MP_WriteMcuAccessRegWord(sc, 0xE434, 0x0004);
890                 MP_WriteMcuAccessRegWord(sc, 0xE43C, 0x0004);
891
892                 DisableMcuBPs(sc);
893
894                 MP_WriteMcuAccessRegWord(sc, 0xF800, 0xE008);
895                 MP_WriteMcuAccessRegWord(sc, 0xF802, 0xE01B);
896                 MP_WriteMcuAccessRegWord(sc, 0xF804, 0xE022);
897                 MP_WriteMcuAccessRegWord(sc, 0xF806, 0xE094);
898                 MP_WriteMcuAccessRegWord(sc, 0xF808, 0xE097);
899                 MP_WriteMcuAccessRegWord(sc, 0xF80A, 0xE09A);
900                 MP_WriteMcuAccessRegWord(sc, 0xF80C, 0xE0B3);
901                 MP_WriteMcuAccessRegWord(sc, 0xF80E, 0xE0BA);
902                 MP_WriteMcuAccessRegWord(sc, 0xF810, 0x49D2);
903                 MP_WriteMcuAccessRegWord(sc, 0xF812, 0xF10D);
904                 MP_WriteMcuAccessRegWord(sc, 0xF814, 0x766C);
905                 MP_WriteMcuAccessRegWord(sc, 0xF816, 0x49E2);
906                 MP_WriteMcuAccessRegWord(sc, 0xF818, 0xF00A);
907                 MP_WriteMcuAccessRegWord(sc, 0xF81A, 0x1EC0);
908                 MP_WriteMcuAccessRegWord(sc, 0xF81C, 0x8EE1);
909                 MP_WriteMcuAccessRegWord(sc, 0xF81E, 0xC60A);
910                 MP_WriteMcuAccessRegWord(sc, 0xF820, 0x77C0);
911                 MP_WriteMcuAccessRegWord(sc, 0xF822, 0x4870);
912                 MP_WriteMcuAccessRegWord(sc, 0xF824, 0x9FC0);
913                 MP_WriteMcuAccessRegWord(sc, 0xF826, 0x1EA0);
914                 MP_WriteMcuAccessRegWord(sc, 0xF828, 0xC707);
915                 MP_WriteMcuAccessRegWord(sc, 0xF82A, 0x8EE1);
916                 MP_WriteMcuAccessRegWord(sc, 0xF82C, 0x9D6C);
917                 MP_WriteMcuAccessRegWord(sc, 0xF82E, 0xC603);
918                 MP_WriteMcuAccessRegWord(sc, 0xF830, 0xBE00);
919                 MP_WriteMcuAccessRegWord(sc, 0xF832, 0xB416);
920                 MP_WriteMcuAccessRegWord(sc, 0xF834, 0x0076);
921                 MP_WriteMcuAccessRegWord(sc, 0xF836, 0xE86C);
922                 MP_WriteMcuAccessRegWord(sc, 0xF838, 0xC406);
923                 MP_WriteMcuAccessRegWord(sc, 0xF83A, 0x7580);
924                 MP_WriteMcuAccessRegWord(sc, 0xF83C, 0x4852);
925                 MP_WriteMcuAccessRegWord(sc, 0xF83E, 0x8D80);
926                 MP_WriteMcuAccessRegWord(sc, 0xF840, 0xC403);
927                 MP_WriteMcuAccessRegWord(sc, 0xF842, 0xBC00);
928                 MP_WriteMcuAccessRegWord(sc, 0xF844, 0xD3E0);
929                 MP_WriteMcuAccessRegWord(sc, 0xF846, 0x02C8);
930                 MP_WriteMcuAccessRegWord(sc, 0xF848, 0x8918);
931                 MP_WriteMcuAccessRegWord(sc, 0xF84A, 0xE815);
932                 MP_WriteMcuAccessRegWord(sc, 0xF84C, 0x1100);
933                 MP_WriteMcuAccessRegWord(sc, 0xF84E, 0xF011);
934                 MP_WriteMcuAccessRegWord(sc, 0xF850, 0xE812);
935                 MP_WriteMcuAccessRegWord(sc, 0xF852, 0x4990);
936                 MP_WriteMcuAccessRegWord(sc, 0xF854, 0xF002);
937                 MP_WriteMcuAccessRegWord(sc, 0xF856, 0xE817);
938                 MP_WriteMcuAccessRegWord(sc, 0xF858, 0xE80E);
939                 MP_WriteMcuAccessRegWord(sc, 0xF85A, 0x4992);
940                 MP_WriteMcuAccessRegWord(sc, 0xF85C, 0xF002);
941                 MP_WriteMcuAccessRegWord(sc, 0xF85E, 0xE80E);
942                 MP_WriteMcuAccessRegWord(sc, 0xF860, 0xE80A);
943                 MP_WriteMcuAccessRegWord(sc, 0xF862, 0x4993);
944                 MP_WriteMcuAccessRegWord(sc, 0xF864, 0xF002);
945                 MP_WriteMcuAccessRegWord(sc, 0xF866, 0xE818);
946                 MP_WriteMcuAccessRegWord(sc, 0xF868, 0xE806);
947                 MP_WriteMcuAccessRegWord(sc, 0xF86A, 0x4991);
948                 MP_WriteMcuAccessRegWord(sc, 0xF86C, 0xF002);
949                 MP_WriteMcuAccessRegWord(sc, 0xF86E, 0xE838);
950                 MP_WriteMcuAccessRegWord(sc, 0xF870, 0xC25E);
951                 MP_WriteMcuAccessRegWord(sc, 0xF872, 0xBA00);
952                 MP_WriteMcuAccessRegWord(sc, 0xF874, 0xC056);
953                 MP_WriteMcuAccessRegWord(sc, 0xF876, 0x7100);
954                 MP_WriteMcuAccessRegWord(sc, 0xF878, 0xFF80);
955                 MP_WriteMcuAccessRegWord(sc, 0xF87A, 0x7100);
956                 MP_WriteMcuAccessRegWord(sc, 0xF87C, 0x4892);
957                 MP_WriteMcuAccessRegWord(sc, 0xF87E, 0x4813);
958                 MP_WriteMcuAccessRegWord(sc, 0xF880, 0x8900);
959                 MP_WriteMcuAccessRegWord(sc, 0xF882, 0xE00A);
960                 MP_WriteMcuAccessRegWord(sc, 0xF884, 0x7100);
961                 MP_WriteMcuAccessRegWord(sc, 0xF886, 0x4890);
962                 MP_WriteMcuAccessRegWord(sc, 0xF888, 0x4813);
963                 MP_WriteMcuAccessRegWord(sc, 0xF88A, 0x8900);
964                 MP_WriteMcuAccessRegWord(sc, 0xF88C, 0xC74B);
965                 MP_WriteMcuAccessRegWord(sc, 0xF88E, 0x74F8);
966                 MP_WriteMcuAccessRegWord(sc, 0xF890, 0x48C2);
967                 MP_WriteMcuAccessRegWord(sc, 0xF892, 0x4841);
968                 MP_WriteMcuAccessRegWord(sc, 0xF894, 0x8CF8);
969                 MP_WriteMcuAccessRegWord(sc, 0xF896, 0xC746);
970                 MP_WriteMcuAccessRegWord(sc, 0xF898, 0x74FC);
971                 MP_WriteMcuAccessRegWord(sc, 0xF89A, 0x49C0);
972                 MP_WriteMcuAccessRegWord(sc, 0xF89C, 0xF120);
973                 MP_WriteMcuAccessRegWord(sc, 0xF89E, 0x49C1);
974                 MP_WriteMcuAccessRegWord(sc, 0xF8A0, 0xF11E);
975                 MP_WriteMcuAccessRegWord(sc, 0xF8A2, 0x74F8);
976                 MP_WriteMcuAccessRegWord(sc, 0xF8A4, 0x49C0);
977                 MP_WriteMcuAccessRegWord(sc, 0xF8A6, 0xF01B);
978                 MP_WriteMcuAccessRegWord(sc, 0xF8A8, 0x49C6);
979                 MP_WriteMcuAccessRegWord(sc, 0xF8AA, 0xF119);
980                 MP_WriteMcuAccessRegWord(sc, 0xF8AC, 0x74F8);
981                 MP_WriteMcuAccessRegWord(sc, 0xF8AE, 0x49C4);
982                 MP_WriteMcuAccessRegWord(sc, 0xF8B0, 0xF013);
983                 MP_WriteMcuAccessRegWord(sc, 0xF8B2, 0xC536);
984                 MP_WriteMcuAccessRegWord(sc, 0xF8B4, 0x74B0);
985                 MP_WriteMcuAccessRegWord(sc, 0xF8B6, 0x49C1);
986                 MP_WriteMcuAccessRegWord(sc, 0xF8B8, 0xF1FD);
987                 MP_WriteMcuAccessRegWord(sc, 0xF8BA, 0xC537);
988                 MP_WriteMcuAccessRegWord(sc, 0xF8BC, 0xC434);
989                 MP_WriteMcuAccessRegWord(sc, 0xF8BE, 0x9CA0);
990                 MP_WriteMcuAccessRegWord(sc, 0xF8C0, 0xC435);
991                 MP_WriteMcuAccessRegWord(sc, 0xF8C2, 0x1C13);
992                 MP_WriteMcuAccessRegWord(sc, 0xF8C4, 0x484F);
993                 MP_WriteMcuAccessRegWord(sc, 0xF8C6, 0x9CA2);
994                 MP_WriteMcuAccessRegWord(sc, 0xF8C8, 0xC52B);
995                 MP_WriteMcuAccessRegWord(sc, 0xF8CA, 0x74B0);
996                 MP_WriteMcuAccessRegWord(sc, 0xF8CC, 0x49C1);
997                 MP_WriteMcuAccessRegWord(sc, 0xF8CE, 0xF1FD);
998                 MP_WriteMcuAccessRegWord(sc, 0xF8D0, 0x74F8);
999                 MP_WriteMcuAccessRegWord(sc, 0xF8D2, 0x48C4);
1000                 MP_WriteMcuAccessRegWord(sc, 0xF8D4, 0x8CF8);
1001                 MP_WriteMcuAccessRegWord(sc, 0xF8D6, 0x7100);
1002                 MP_WriteMcuAccessRegWord(sc, 0xF8D8, 0x4893);
1003                 MP_WriteMcuAccessRegWord(sc, 0xF8DA, 0x8900);
1004                 MP_WriteMcuAccessRegWord(sc, 0xF8DC, 0xFF80);
1005                 MP_WriteMcuAccessRegWord(sc, 0xF8DE, 0xC520);
1006                 MP_WriteMcuAccessRegWord(sc, 0xF8E0, 0x74B0);
1007                 MP_WriteMcuAccessRegWord(sc, 0xF8E2, 0x49C1);
1008                 MP_WriteMcuAccessRegWord(sc, 0xF8E4, 0xF11C);
1009                 MP_WriteMcuAccessRegWord(sc, 0xF8E6, 0xC71E);
1010                 MP_WriteMcuAccessRegWord(sc, 0xF8E8, 0x74FC);
1011                 MP_WriteMcuAccessRegWord(sc, 0xF8EA, 0x49C1);
1012                 MP_WriteMcuAccessRegWord(sc, 0xF8EC, 0xF118);
1013                 MP_WriteMcuAccessRegWord(sc, 0xF8EE, 0x49C0);
1014                 MP_WriteMcuAccessRegWord(sc, 0xF8F0, 0xF116);
1015                 MP_WriteMcuAccessRegWord(sc, 0xF8F2, 0x74F8);
1016                 MP_WriteMcuAccessRegWord(sc, 0xF8F4, 0x49C0);
1017                 MP_WriteMcuAccessRegWord(sc, 0xF8F6, 0xF013);
1018                 MP_WriteMcuAccessRegWord(sc, 0xF8F8, 0x48C3);
1019                 MP_WriteMcuAccessRegWord(sc, 0xF8FA, 0x8CF8);
1020                 MP_WriteMcuAccessRegWord(sc, 0xF8FC, 0xC516);
1021                 MP_WriteMcuAccessRegWord(sc, 0xF8FE, 0x74A2);
1022                 MP_WriteMcuAccessRegWord(sc, 0xF900, 0x49CE);
1023                 MP_WriteMcuAccessRegWord(sc, 0xF902, 0xF1FE);
1024                 MP_WriteMcuAccessRegWord(sc, 0xF904, 0xC411);
1025                 MP_WriteMcuAccessRegWord(sc, 0xF906, 0x9CA0);
1026                 MP_WriteMcuAccessRegWord(sc, 0xF908, 0xC411);
1027                 MP_WriteMcuAccessRegWord(sc, 0xF90A, 0x1C13);
1028                 MP_WriteMcuAccessRegWord(sc, 0xF90C, 0x484F);
1029                 MP_WriteMcuAccessRegWord(sc, 0xF90E, 0x9CA2);
1030                 MP_WriteMcuAccessRegWord(sc, 0xF910, 0x74A2);
1031                 MP_WriteMcuAccessRegWord(sc, 0xF912, 0x49CF);
1032                 MP_WriteMcuAccessRegWord(sc, 0xF914, 0xF1FE);
1033                 MP_WriteMcuAccessRegWord(sc, 0xF916, 0x7100);
1034                 MP_WriteMcuAccessRegWord(sc, 0xF918, 0x4891);
1035                 MP_WriteMcuAccessRegWord(sc, 0xF91A, 0x8900);
1036                 MP_WriteMcuAccessRegWord(sc, 0xF91C, 0xFF80);
1037                 MP_WriteMcuAccessRegWord(sc, 0xF91E, 0xE400);
1038                 MP_WriteMcuAccessRegWord(sc, 0xF920, 0xD3E0);
1039                 MP_WriteMcuAccessRegWord(sc, 0xF922, 0xE000);
1040                 MP_WriteMcuAccessRegWord(sc, 0xF924, 0x0481);
1041                 MP_WriteMcuAccessRegWord(sc, 0xF926, 0x0C81);
1042                 MP_WriteMcuAccessRegWord(sc, 0xF928, 0xDE20);
1043                 MP_WriteMcuAccessRegWord(sc, 0xF92A, 0x0000);
1044                 MP_WriteMcuAccessRegWord(sc, 0xF92C, 0x0992);
1045                 MP_WriteMcuAccessRegWord(sc, 0xF92E, 0x1B76);
1046                 MP_WriteMcuAccessRegWord(sc, 0xF930, 0xC602);
1047                 MP_WriteMcuAccessRegWord(sc, 0xF932, 0xBE00);
1048                 MP_WriteMcuAccessRegWord(sc, 0xF934, 0x059C);
1049                 MP_WriteMcuAccessRegWord(sc, 0xF936, 0x1B76);
1050                 MP_WriteMcuAccessRegWord(sc, 0xF938, 0xC602);
1051                 MP_WriteMcuAccessRegWord(sc, 0xF93A, 0xBE00);
1052                 MP_WriteMcuAccessRegWord(sc, 0xF93C, 0x065A);
1053                 MP_WriteMcuAccessRegWord(sc, 0xF93E, 0xB400);
1054                 MP_WriteMcuAccessRegWord(sc, 0xF940, 0x18DE);
1055                 MP_WriteMcuAccessRegWord(sc, 0xF942, 0x2008);
1056                 MP_WriteMcuAccessRegWord(sc, 0xF944, 0x4001);
1057                 MP_WriteMcuAccessRegWord(sc, 0xF946, 0xF10F);
1058                 MP_WriteMcuAccessRegWord(sc, 0xF948, 0x7342);
1059                 MP_WriteMcuAccessRegWord(sc, 0xF94A, 0x1880);
1060                 MP_WriteMcuAccessRegWord(sc, 0xF94C, 0x2008);
1061                 MP_WriteMcuAccessRegWord(sc, 0xF94E, 0x0009);
1062                 MP_WriteMcuAccessRegWord(sc, 0xF950, 0x4018);
1063                 MP_WriteMcuAccessRegWord(sc, 0xF952, 0xF109);
1064                 MP_WriteMcuAccessRegWord(sc, 0xF954, 0x7340);
1065                 MP_WriteMcuAccessRegWord(sc, 0xF956, 0x25BC);
1066                 MP_WriteMcuAccessRegWord(sc, 0xF958, 0x130F);
1067                 MP_WriteMcuAccessRegWord(sc, 0xF95A, 0xF105);
1068                 MP_WriteMcuAccessRegWord(sc, 0xF95C, 0xC00A);
1069                 MP_WriteMcuAccessRegWord(sc, 0xF95E, 0x7300);
1070                 MP_WriteMcuAccessRegWord(sc, 0xF960, 0x4831);
1071                 MP_WriteMcuAccessRegWord(sc, 0xF962, 0x9B00);
1072                 MP_WriteMcuAccessRegWord(sc, 0xF964, 0xB000);
1073                 MP_WriteMcuAccessRegWord(sc, 0xF966, 0x7340);
1074                 MP_WriteMcuAccessRegWord(sc, 0xF968, 0x8320);
1075                 MP_WriteMcuAccessRegWord(sc, 0xF96A, 0xC302);
1076                 MP_WriteMcuAccessRegWord(sc, 0xF96C, 0xBB00);
1077                 MP_WriteMcuAccessRegWord(sc, 0xF96E, 0x0C12);
1078                 MP_WriteMcuAccessRegWord(sc, 0xF970, 0xE860);
1079                 MP_WriteMcuAccessRegWord(sc, 0xF972, 0xC406);
1080                 MP_WriteMcuAccessRegWord(sc, 0xF974, 0x7580);
1081                 MP_WriteMcuAccessRegWord(sc, 0xF976, 0x4851);
1082                 MP_WriteMcuAccessRegWord(sc, 0xF978, 0x8D80);
1083                 MP_WriteMcuAccessRegWord(sc, 0xF97A, 0xC403);
1084                 MP_WriteMcuAccessRegWord(sc, 0xF97C, 0xBC00);
1085                 MP_WriteMcuAccessRegWord(sc, 0xF97E, 0xD3E0);
1086                 MP_WriteMcuAccessRegWord(sc, 0xF980, 0x02C8);
1087                 MP_WriteMcuAccessRegWord(sc, 0xF982, 0xC406);
1088                 MP_WriteMcuAccessRegWord(sc, 0xF984, 0x7580);
1089                 MP_WriteMcuAccessRegWord(sc, 0xF986, 0x4850);
1090                 MP_WriteMcuAccessRegWord(sc, 0xF988, 0x8D80);
1091                 MP_WriteMcuAccessRegWord(sc, 0xF98A, 0xC403);
1092                 MP_WriteMcuAccessRegWord(sc, 0xF98C, 0xBC00);
1093                 MP_WriteMcuAccessRegWord(sc, 0xF98E, 0xD3E0);
1094                 MP_WriteMcuAccessRegWord(sc, 0xF990, 0x0298);
1095
1096                 MP_WriteMcuAccessRegWord(sc, 0xDE30, 0x0080);
1097
1098                 MP_WriteMcuAccessRegWord(sc, 0xFC26, 0x8000);
1099
1100                 MP_WriteMcuAccessRegWord(sc, 0xFC28, 0x0075);
1101                 MP_WriteMcuAccessRegWord(sc, 0xFC2A, 0x02B1);
1102                 MP_WriteMcuAccessRegWord(sc, 0xFC2C, 0x0991);
1103                 MP_WriteMcuAccessRegWord(sc, 0xFC2E, 0x059B);
1104                 MP_WriteMcuAccessRegWord(sc, 0xFC30, 0x0659);
1105                 MP_WriteMcuAccessRegWord(sc, 0xFC32, 0x0000);
1106                 MP_WriteMcuAccessRegWord(sc, 0xFC34, 0x02BB);
1107                 MP_WriteMcuAccessRegWord(sc, 0xFC36, 0x0279);
1108                 break;
1109         case MACFG_58:
1110                 DisableMcuBPs(sc);
1111
1112                 MP_WriteMcuAccessRegWord(sc, 0xF800, 0xE008);
1113                 MP_WriteMcuAccessRegWord(sc, 0xF802, 0xE011);
1114                 MP_WriteMcuAccessRegWord(sc, 0xF804, 0xE015);
1115                 MP_WriteMcuAccessRegWord(sc, 0xF806, 0xE018);
1116                 MP_WriteMcuAccessRegWord(sc, 0xF808, 0xE01B);
1117                 MP_WriteMcuAccessRegWord(sc, 0xF80A, 0xE027);
1118                 MP_WriteMcuAccessRegWord(sc, 0xF80C, 0xE043);
1119                 MP_WriteMcuAccessRegWord(sc, 0xF80E, 0xE065);
1120                 MP_WriteMcuAccessRegWord(sc, 0xF810, 0x49E2);
1121                 MP_WriteMcuAccessRegWord(sc, 0xF812, 0xF005);
1122                 MP_WriteMcuAccessRegWord(sc, 0xF814, 0x49EA);
1123                 MP_WriteMcuAccessRegWord(sc, 0xF816, 0xF003);
1124                 MP_WriteMcuAccessRegWord(sc, 0xF818, 0xC404);
1125                 MP_WriteMcuAccessRegWord(sc, 0xF81A, 0xBC00);
1126                 MP_WriteMcuAccessRegWord(sc, 0xF81C, 0xC403);
1127                 MP_WriteMcuAccessRegWord(sc, 0xF81E, 0xBC00);
1128                 MP_WriteMcuAccessRegWord(sc, 0xF820, 0x0496);
1129                 MP_WriteMcuAccessRegWord(sc, 0xF822, 0x051A);
1130                 MP_WriteMcuAccessRegWord(sc, 0xF824, 0x1D01);
1131                 MP_WriteMcuAccessRegWord(sc, 0xF826, 0x8DE8);
1132                 MP_WriteMcuAccessRegWord(sc, 0xF828, 0xC602);
1133                 MP_WriteMcuAccessRegWord(sc, 0xF82A, 0xBE00);
1134                 MP_WriteMcuAccessRegWord(sc, 0xF82C, 0x0206);
1135                 MP_WriteMcuAccessRegWord(sc, 0xF82E, 0x1B76);
1136                 MP_WriteMcuAccessRegWord(sc, 0xF830, 0xC202);
1137                 MP_WriteMcuAccessRegWord(sc, 0xF832, 0xBA00);
1138                 MP_WriteMcuAccessRegWord(sc, 0xF834, 0x058A);
1139                 MP_WriteMcuAccessRegWord(sc, 0xF836, 0x1B76);
1140                 MP_WriteMcuAccessRegWord(sc, 0xF838, 0xC602);
1141                 MP_WriteMcuAccessRegWord(sc, 0xF83A, 0xBE00);
1142                 MP_WriteMcuAccessRegWord(sc, 0xF83C, 0x0648);
1143                 MP_WriteMcuAccessRegWord(sc, 0xF83E, 0x74E6);
1144                 MP_WriteMcuAccessRegWord(sc, 0xF840, 0x1B78);
1145                 MP_WriteMcuAccessRegWord(sc, 0xF842, 0x46DC);
1146                 MP_WriteMcuAccessRegWord(sc, 0xF844, 0x1300);
1147                 MP_WriteMcuAccessRegWord(sc, 0xF846, 0xF005);
1148                 MP_WriteMcuAccessRegWord(sc, 0xF848, 0x74F8);
1149                 MP_WriteMcuAccessRegWord(sc, 0xF84A, 0x48C3);
1150                 MP_WriteMcuAccessRegWord(sc, 0xF84C, 0x48C4);
1151                 MP_WriteMcuAccessRegWord(sc, 0xF84E, 0x8CF8);
1152                 MP_WriteMcuAccessRegWord(sc, 0xF850, 0x64E7);
1153                 MP_WriteMcuAccessRegWord(sc, 0xF852, 0xC302);
1154                 MP_WriteMcuAccessRegWord(sc, 0xF854, 0xBB00);
1155                 MP_WriteMcuAccessRegWord(sc, 0xF856, 0x068E);
1156                 MP_WriteMcuAccessRegWord(sc, 0xF858, 0x74E4);
1157                 MP_WriteMcuAccessRegWord(sc, 0xF85A, 0x49C5);
1158                 MP_WriteMcuAccessRegWord(sc, 0xF85C, 0xF106);
1159                 MP_WriteMcuAccessRegWord(sc, 0xF85E, 0x49C6);
1160                 MP_WriteMcuAccessRegWord(sc, 0xF860, 0xF107);
1161                 MP_WriteMcuAccessRegWord(sc, 0xF862, 0x48C8);
1162                 MP_WriteMcuAccessRegWord(sc, 0xF864, 0x48C9);
1163                 MP_WriteMcuAccessRegWord(sc, 0xF866, 0xE011);
1164                 MP_WriteMcuAccessRegWord(sc, 0xF868, 0x48C9);
1165                 MP_WriteMcuAccessRegWord(sc, 0xF86A, 0x4848);
1166                 MP_WriteMcuAccessRegWord(sc, 0xF86C, 0xE00E);
1167                 MP_WriteMcuAccessRegWord(sc, 0xF86E, 0x4848);
1168                 MP_WriteMcuAccessRegWord(sc, 0xF870, 0x49C7);
1169                 MP_WriteMcuAccessRegWord(sc, 0xF872, 0xF00A);
1170                 MP_WriteMcuAccessRegWord(sc, 0xF874, 0x48C9);
1171                 MP_WriteMcuAccessRegWord(sc, 0xF876, 0xC60D);
1172                 MP_WriteMcuAccessRegWord(sc, 0xF878, 0x1D1F);
1173                 MP_WriteMcuAccessRegWord(sc, 0xF87A, 0x8DC2);
1174                 MP_WriteMcuAccessRegWord(sc, 0xF87C, 0x1D00);
1175                 MP_WriteMcuAccessRegWord(sc, 0xF87E, 0x8DC3);
1176                 MP_WriteMcuAccessRegWord(sc, 0xF880, 0x1D11);
1177                 MP_WriteMcuAccessRegWord(sc, 0xF882, 0x8DC0);
1178                 MP_WriteMcuAccessRegWord(sc, 0xF884, 0xE002);
1179                 MP_WriteMcuAccessRegWord(sc, 0xF886, 0x4849);
1180                 MP_WriteMcuAccessRegWord(sc, 0xF888, 0x94E5);
1181                 MP_WriteMcuAccessRegWord(sc, 0xF88A, 0xC602);
1182                 MP_WriteMcuAccessRegWord(sc, 0xF88C, 0xBE00);
1183                 MP_WriteMcuAccessRegWord(sc, 0xF88E, 0x0238);
1184                 MP_WriteMcuAccessRegWord(sc, 0xF890, 0xE434);
1185                 MP_WriteMcuAccessRegWord(sc, 0xF892, 0x49D9);
1186                 MP_WriteMcuAccessRegWord(sc, 0xF894, 0xF01B);
1187                 MP_WriteMcuAccessRegWord(sc, 0xF896, 0xC31E);
1188                 MP_WriteMcuAccessRegWord(sc, 0xF898, 0x7464);
1189                 MP_WriteMcuAccessRegWord(sc, 0xF89A, 0x49C4);
1190                 MP_WriteMcuAccessRegWord(sc, 0xF89C, 0xF114);
1191                 MP_WriteMcuAccessRegWord(sc, 0xF89E, 0xC31B);
1192                 MP_WriteMcuAccessRegWord(sc, 0xF8A0, 0x6460);
1193                 MP_WriteMcuAccessRegWord(sc, 0xF8A2, 0x14FA);
1194                 MP_WriteMcuAccessRegWord(sc, 0xF8A4, 0xFA02);
1195                 MP_WriteMcuAccessRegWord(sc, 0xF8A6, 0xE00F);
1196                 MP_WriteMcuAccessRegWord(sc, 0xF8A8, 0xC317);
1197                 MP_WriteMcuAccessRegWord(sc, 0xF8AA, 0x7460);
1198                 MP_WriteMcuAccessRegWord(sc, 0xF8AC, 0x49C0);
1199                 MP_WriteMcuAccessRegWord(sc, 0xF8AE, 0xF10B);
1200                 MP_WriteMcuAccessRegWord(sc, 0xF8B0, 0xC311);
1201                 MP_WriteMcuAccessRegWord(sc, 0xF8B2, 0x7462);
1202                 MP_WriteMcuAccessRegWord(sc, 0xF8B4, 0x48C1);
1203                 MP_WriteMcuAccessRegWord(sc, 0xF8B6, 0x9C62);
1204                 MP_WriteMcuAccessRegWord(sc, 0xF8B8, 0x4841);
1205                 MP_WriteMcuAccessRegWord(sc, 0xF8BA, 0x9C62);
1206                 MP_WriteMcuAccessRegWord(sc, 0xF8BC, 0xC30A);
1207                 MP_WriteMcuAccessRegWord(sc, 0xF8BE, 0x1C04);
1208                 MP_WriteMcuAccessRegWord(sc, 0xF8C0, 0x8C60);
1209                 MP_WriteMcuAccessRegWord(sc, 0xF8C2, 0xE004);
1210                 MP_WriteMcuAccessRegWord(sc, 0xF8C4, 0x1C15);
1211                 MP_WriteMcuAccessRegWord(sc, 0xF8C6, 0xC305);
1212                 MP_WriteMcuAccessRegWord(sc, 0xF8C8, 0x8C60);
1213                 MP_WriteMcuAccessRegWord(sc, 0xF8CA, 0xC602);
1214                 MP_WriteMcuAccessRegWord(sc, 0xF8CC, 0xBE00);
1215                 MP_WriteMcuAccessRegWord(sc, 0xF8CE, 0x0374);
1216                 MP_WriteMcuAccessRegWord(sc, 0xF8D0, 0xE434);
1217                 MP_WriteMcuAccessRegWord(sc, 0xF8D2, 0xE030);
1218                 MP_WriteMcuAccessRegWord(sc, 0xF8D4, 0xE61C);
1219                 MP_WriteMcuAccessRegWord(sc, 0xF8D6, 0xE906);
1220                 MP_WriteMcuAccessRegWord(sc, 0xF8D8, 0xC602);
1221                 MP_WriteMcuAccessRegWord(sc, 0xF8DA, 0xBE00);
1222                 MP_WriteMcuAccessRegWord(sc, 0xF8DC, 0x0000);
1223
1224                 MP_WriteMcuAccessRegWord(sc, 0xFC26, 0x8000);
1225
1226                 MP_WriteMcuAccessRegWord(sc, 0xFC28, 0x0493);
1227                 MP_WriteMcuAccessRegWord(sc, 0xFC2A, 0x0205);
1228                 MP_WriteMcuAccessRegWord(sc, 0xFC2C, 0x0589);
1229                 MP_WriteMcuAccessRegWord(sc, 0xFC2E, 0x0647);
1230                 MP_WriteMcuAccessRegWord(sc, 0xFC30, 0x0000);
1231                 MP_WriteMcuAccessRegWord(sc, 0xFC32, 0x0215);
1232                 MP_WriteMcuAccessRegWord(sc, 0xFC34, 0x0285);
1233                 break;
1234         case MACFG_59:
1235                 DisableMcuBPs(sc);
1236
1237                 MP_WriteMcuAccessRegWord(sc, 0xF800, 0xE008);
1238                 MP_WriteMcuAccessRegWord(sc, 0xF802, 0xE00A);
1239                 MP_WriteMcuAccessRegWord(sc, 0xF804, 0xE01B);
1240                 MP_WriteMcuAccessRegWord(sc, 0xF806, 0xE03D);
1241                 MP_WriteMcuAccessRegWord(sc, 0xF808, 0xE04C);
1242                 MP_WriteMcuAccessRegWord(sc, 0xF80A, 0xE053);
1243                 MP_WriteMcuAccessRegWord(sc, 0xF80C, 0xE055);
1244                 MP_WriteMcuAccessRegWord(sc, 0xF80E, 0xE079);
1245                 MP_WriteMcuAccessRegWord(sc, 0xF810, 0xC602);
1246                 MP_WriteMcuAccessRegWord(sc, 0xF812, 0xBE00);
1247                 MP_WriteMcuAccessRegWord(sc, 0xF814, 0x0000);
1248                 MP_WriteMcuAccessRegWord(sc, 0xF816, 0xC511);
1249                 MP_WriteMcuAccessRegWord(sc, 0xF818, 0x74A2);
1250                 MP_WriteMcuAccessRegWord(sc, 0xF81A, 0x8CA5);
1251                 MP_WriteMcuAccessRegWord(sc, 0xF81C, 0x74A0);
1252                 MP_WriteMcuAccessRegWord(sc, 0xF81E, 0xC50B);
1253                 MP_WriteMcuAccessRegWord(sc, 0xF820, 0x9CA2);
1254                 MP_WriteMcuAccessRegWord(sc, 0xF822, 0x1C11);
1255                 MP_WriteMcuAccessRegWord(sc, 0xF824, 0x9CA0);
1256                 MP_WriteMcuAccessRegWord(sc, 0xF826, 0xC506);
1257                 MP_WriteMcuAccessRegWord(sc, 0xF828, 0xBD00);
1258                 MP_WriteMcuAccessRegWord(sc, 0xF82A, 0x7444);
1259                 MP_WriteMcuAccessRegWord(sc, 0xF82C, 0xC502);
1260                 MP_WriteMcuAccessRegWord(sc, 0xF82E, 0xBD00);
1261                 MP_WriteMcuAccessRegWord(sc, 0xF830, 0x0A30);
1262                 MP_WriteMcuAccessRegWord(sc, 0xF832, 0x0A46);
1263                 MP_WriteMcuAccessRegWord(sc, 0xF834, 0xE434);
1264                 MP_WriteMcuAccessRegWord(sc, 0xF836, 0xE096);
1265                 MP_WriteMcuAccessRegWord(sc, 0xF838, 0xD3C0);
1266                 MP_WriteMcuAccessRegWord(sc, 0xF83A, 0x49D9);
1267                 MP_WriteMcuAccessRegWord(sc, 0xF83C, 0xF019);
1268                 MP_WriteMcuAccessRegWord(sc, 0xF83E, 0xC520);
1269                 MP_WriteMcuAccessRegWord(sc, 0xF840, 0x64A5);
1270                 MP_WriteMcuAccessRegWord(sc, 0xF842, 0x1400);
1271                 MP_WriteMcuAccessRegWord(sc, 0xF844, 0xF007);
1272                 MP_WriteMcuAccessRegWord(sc, 0xF846, 0x0C01);
1273                 MP_WriteMcuAccessRegWord(sc, 0xF848, 0x8CA5);
1274                 MP_WriteMcuAccessRegWord(sc, 0xF84A, 0x1C15);
1275                 MP_WriteMcuAccessRegWord(sc, 0xF84C, 0xC515);
1276                 MP_WriteMcuAccessRegWord(sc, 0xF84E, 0x9CA0);
1277                 MP_WriteMcuAccessRegWord(sc, 0xF850, 0xE00F);
1278                 MP_WriteMcuAccessRegWord(sc, 0xF852, 0xC513);
1279                 MP_WriteMcuAccessRegWord(sc, 0xF854, 0x74A0);
1280                 MP_WriteMcuAccessRegWord(sc, 0xF856, 0x48C8);
1281                 MP_WriteMcuAccessRegWord(sc, 0xF858, 0x48CA);
1282                 MP_WriteMcuAccessRegWord(sc, 0xF85A, 0x9CA0);
1283                 MP_WriteMcuAccessRegWord(sc, 0xF85C, 0xC510);
1284                 MP_WriteMcuAccessRegWord(sc, 0xF85E, 0x1B00);
1285                 MP_WriteMcuAccessRegWord(sc, 0xF860, 0x9BA0);
1286                 MP_WriteMcuAccessRegWord(sc, 0xF862, 0x1B1C);
1287                 MP_WriteMcuAccessRegWord(sc, 0xF864, 0x483F);
1288                 MP_WriteMcuAccessRegWord(sc, 0xF866, 0x9BA2);
1289                 MP_WriteMcuAccessRegWord(sc, 0xF868, 0x1B04);
1290                 MP_WriteMcuAccessRegWord(sc, 0xF86A, 0xC506);
1291                 MP_WriteMcuAccessRegWord(sc, 0xF86C, 0x9BA0);
1292                 MP_WriteMcuAccessRegWord(sc, 0xF86E, 0xC603);
1293                 MP_WriteMcuAccessRegWord(sc, 0xF870, 0xBE00);
1294                 MP_WriteMcuAccessRegWord(sc, 0xF872, 0x0298);
1295                 MP_WriteMcuAccessRegWord(sc, 0xF874, 0x03DE);
1296                 MP_WriteMcuAccessRegWord(sc, 0xF876, 0xE434);
1297                 MP_WriteMcuAccessRegWord(sc, 0xF878, 0xE096);
1298                 MP_WriteMcuAccessRegWord(sc, 0xF87A, 0xE860);
1299                 MP_WriteMcuAccessRegWord(sc, 0xF87C, 0xDE20);
1300                 MP_WriteMcuAccessRegWord(sc, 0xF87E, 0xD3C0);
1301                 MP_WriteMcuAccessRegWord(sc, 0xF880, 0xC50F);
1302                 MP_WriteMcuAccessRegWord(sc, 0xF882, 0x76A4);
1303                 MP_WriteMcuAccessRegWord(sc, 0xF884, 0x49E3);
1304                 MP_WriteMcuAccessRegWord(sc, 0xF886, 0xF007);
1305                 MP_WriteMcuAccessRegWord(sc, 0xF888, 0x49C0);
1306                 MP_WriteMcuAccessRegWord(sc, 0xF88A, 0xF103);
1307                 MP_WriteMcuAccessRegWord(sc, 0xF88C, 0xC607);
1308                 MP_WriteMcuAccessRegWord(sc, 0xF88E, 0xBE00);
1309                 MP_WriteMcuAccessRegWord(sc, 0xF890, 0xC606);
1310                 MP_WriteMcuAccessRegWord(sc, 0xF892, 0xBE00);
1311                 MP_WriteMcuAccessRegWord(sc, 0xF894, 0xC602);
1312                 MP_WriteMcuAccessRegWord(sc, 0xF896, 0xBE00);
1313                 MP_WriteMcuAccessRegWord(sc, 0xF898, 0x0A88);
1314                 MP_WriteMcuAccessRegWord(sc, 0xF89A, 0x0A64);
1315                 MP_WriteMcuAccessRegWord(sc, 0xF89C, 0x0A68);
1316                 MP_WriteMcuAccessRegWord(sc, 0xF89E, 0xDC00);
1317                 MP_WriteMcuAccessRegWord(sc, 0xF8A0, 0xC707);
1318                 MP_WriteMcuAccessRegWord(sc, 0xF8A2, 0x1D00);
1319                 MP_WriteMcuAccessRegWord(sc, 0xF8A4, 0x8DE2);
1320                 MP_WriteMcuAccessRegWord(sc, 0xF8A6, 0x48C1);
1321                 MP_WriteMcuAccessRegWord(sc, 0xF8A8, 0xC502);
1322                 MP_WriteMcuAccessRegWord(sc, 0xF8AA, 0xBD00);
1323                 MP_WriteMcuAccessRegWord(sc, 0xF8AC, 0x00AA);
1324                 MP_WriteMcuAccessRegWord(sc, 0xF8AE, 0xE0C0);
1325                 MP_WriteMcuAccessRegWord(sc, 0xF8B0, 0xC502);
1326                 MP_WriteMcuAccessRegWord(sc, 0xF8B2, 0xBD00);
1327                 MP_WriteMcuAccessRegWord(sc, 0xF8B4, 0x0132);
1328                 MP_WriteMcuAccessRegWord(sc, 0xF8B6, 0xC523);
1329                 MP_WriteMcuAccessRegWord(sc, 0xF8B8, 0x9EA0);
1330                 MP_WriteMcuAccessRegWord(sc, 0xF8BA, 0x1C1C);
1331                 MP_WriteMcuAccessRegWord(sc, 0xF8BC, 0x484F);
1332                 MP_WriteMcuAccessRegWord(sc, 0xF8BE, 0x9CA2);
1333                 MP_WriteMcuAccessRegWord(sc, 0xF8C0, 0x74A2);
1334                 MP_WriteMcuAccessRegWord(sc, 0xF8C2, 0x49CF);
1335                 MP_WriteMcuAccessRegWord(sc, 0xF8C4, 0xF1FE);
1336                 MP_WriteMcuAccessRegWord(sc, 0xF8C6, 0x1600);
1337                 MP_WriteMcuAccessRegWord(sc, 0xF8C8, 0xF115);
1338                 MP_WriteMcuAccessRegWord(sc, 0xF8CA, 0xC417);
1339                 MP_WriteMcuAccessRegWord(sc, 0xF8CC, 0x9CA0);
1340                 MP_WriteMcuAccessRegWord(sc, 0xF8CE, 0x1C13);
1341                 MP_WriteMcuAccessRegWord(sc, 0xF8D0, 0x484F);
1342                 MP_WriteMcuAccessRegWord(sc, 0xF8D2, 0x9CA2);
1343                 MP_WriteMcuAccessRegWord(sc, 0xF8D4, 0x74A2);
1344                 MP_WriteMcuAccessRegWord(sc, 0xF8D6, 0x49CF);
1345                 MP_WriteMcuAccessRegWord(sc, 0xF8D8, 0xF1FE);
1346                 MP_WriteMcuAccessRegWord(sc, 0xF8DA, 0xC410);
1347                 MP_WriteMcuAccessRegWord(sc, 0xF8DC, 0x9CA0);
1348                 MP_WriteMcuAccessRegWord(sc, 0xF8DE, 0x1C13);
1349                 MP_WriteMcuAccessRegWord(sc, 0xF8E0, 0x484F);
1350                 MP_WriteMcuAccessRegWord(sc, 0xF8E2, 0x9CA2);
1351                 MP_WriteMcuAccessRegWord(sc, 0xF8E4, 0x74A2);
1352                 MP_WriteMcuAccessRegWord(sc, 0xF8E6, 0x49CF);
1353                 MP_WriteMcuAccessRegWord(sc, 0xF8E8, 0xF1FE);
1354                 MP_WriteMcuAccessRegWord(sc, 0xF8EA, 0xC50A);
1355                 MP_WriteMcuAccessRegWord(sc, 0xF8EC, 0x74B8);
1356                 MP_WriteMcuAccessRegWord(sc, 0xF8EE, 0x48C3);
1357                 MP_WriteMcuAccessRegWord(sc, 0xF8F0, 0x8CB8);
1358                 MP_WriteMcuAccessRegWord(sc, 0xF8F2, 0xC502);
1359                 MP_WriteMcuAccessRegWord(sc, 0xF8F4, 0xBD00);
1360                 MP_WriteMcuAccessRegWord(sc, 0xF8F6, 0x0A46);
1361                 MP_WriteMcuAccessRegWord(sc, 0xF8F8, 0x0481);
1362                 MP_WriteMcuAccessRegWord(sc, 0xF8FA, 0x0C81);
1363                 MP_WriteMcuAccessRegWord(sc, 0xF8FC, 0xDE20);
1364                 MP_WriteMcuAccessRegWord(sc, 0xF8FE, 0xE000);
1365                 MP_WriteMcuAccessRegWord(sc, 0xF900, 0xC602);
1366                 MP_WriteMcuAccessRegWord(sc, 0xF902, 0xBE00);
1367                 MP_WriteMcuAccessRegWord(sc, 0xF904, 0x0000);
1368
1369                 MP_WriteMcuAccessRegWord(sc, 0xFC26, 0x8000);
1370
1371                 MP_WriteMcuAccessRegWord(sc, 0xFC2A, 0x0A2F);
1372                 MP_WriteMcuAccessRegWord(sc, 0xFC2C, 0x0297);
1373                 MP_WriteMcuAccessRegWord(sc, 0xFC2E, 0x0A61);
1374                 MP_WriteMcuAccessRegWord(sc, 0xFC30, 0x00A9);
1375                 MP_WriteMcuAccessRegWord(sc, 0xFC32, 0x012D);
1376                 break;
1377         case MACFG_60:
1378                 DisableMcuBPs(sc);
1379
1380                 MP_WriteMcuAccessRegWord(sc, 0xF800, 0xE008);
1381                 MP_WriteMcuAccessRegWord(sc, 0xF802, 0xE00A);
1382                 MP_WriteMcuAccessRegWord(sc, 0xF804, 0xE00C);
1383                 MP_WriteMcuAccessRegWord(sc, 0xF806, 0xE00E);
1384                 MP_WriteMcuAccessRegWord(sc, 0xF808, 0xE027);
1385                 MP_WriteMcuAccessRegWord(sc, 0xF80A, 0xE04F);
1386                 MP_WriteMcuAccessRegWord(sc, 0xF80C, 0xE05E);
1387                 MP_WriteMcuAccessRegWord(sc, 0xF80E, 0xE065);
1388                 MP_WriteMcuAccessRegWord(sc, 0xF810, 0xC602);
1389                 MP_WriteMcuAccessRegWord(sc, 0xF812, 0xBE00);
1390                 MP_WriteMcuAccessRegWord(sc, 0xF814, 0x0000);
1391                 MP_WriteMcuAccessRegWord(sc, 0xF816, 0xC502);
1392                 MP_WriteMcuAccessRegWord(sc, 0xF818, 0xBD00);
1393                 MP_WriteMcuAccessRegWord(sc, 0xF81A, 0x074C);
1394                 MP_WriteMcuAccessRegWord(sc, 0xF81C, 0xC302);
1395                 MP_WriteMcuAccessRegWord(sc, 0xF81E, 0xBB00);
1396                 MP_WriteMcuAccessRegWord(sc, 0xF820, 0x080A);
1397                 MP_WriteMcuAccessRegWord(sc, 0xF822, 0x6420);
1398                 MP_WriteMcuAccessRegWord(sc, 0xF824, 0x48C2);
1399                 MP_WriteMcuAccessRegWord(sc, 0xF826, 0x8C20);
1400                 MP_WriteMcuAccessRegWord(sc, 0xF828, 0xC516);
1401                 MP_WriteMcuAccessRegWord(sc, 0xF82A, 0x64A4);
1402                 MP_WriteMcuAccessRegWord(sc, 0xF82C, 0x49C0);
1403                 MP_WriteMcuAccessRegWord(sc, 0xF82E, 0xF009);
1404                 MP_WriteMcuAccessRegWord(sc, 0xF830, 0x74A2);
1405                 MP_WriteMcuAccessRegWord(sc, 0xF832, 0x8CA5);
1406                 MP_WriteMcuAccessRegWord(sc, 0xF834, 0x74A0);
1407                 MP_WriteMcuAccessRegWord(sc, 0xF836, 0xC50E);
1408                 MP_WriteMcuAccessRegWord(sc, 0xF838, 0x9CA2);
1409                 MP_WriteMcuAccessRegWord(sc, 0xF83A, 0x1C11);
1410                 MP_WriteMcuAccessRegWord(sc, 0xF83C, 0x9CA0);
1411                 MP_WriteMcuAccessRegWord(sc, 0xF83E, 0xE006);
1412                 MP_WriteMcuAccessRegWord(sc, 0xF840, 0x74F8);
1413                 MP_WriteMcuAccessRegWord(sc, 0xF842, 0x48C4);
1414                 MP_WriteMcuAccessRegWord(sc, 0xF844, 0x8CF8);
1415                 MP_WriteMcuAccessRegWord(sc, 0xF846, 0xC404);
1416                 MP_WriteMcuAccessRegWord(sc, 0xF848, 0xBC00);
1417                 MP_WriteMcuAccessRegWord(sc, 0xF84A, 0xC403);
1418                 MP_WriteMcuAccessRegWord(sc, 0xF84C, 0xBC00);
1419                 MP_WriteMcuAccessRegWord(sc, 0xF84E, 0x0BF2);
1420                 MP_WriteMcuAccessRegWord(sc, 0xF850, 0x0C0A);
1421                 MP_WriteMcuAccessRegWord(sc, 0xF852, 0xE434);
1422                 MP_WriteMcuAccessRegWord(sc, 0xF854, 0xD3C0);
1423                 MP_WriteMcuAccessRegWord(sc, 0xF856, 0x49D9);
1424                 MP_WriteMcuAccessRegWord(sc, 0xF858, 0xF01F);
1425                 MP_WriteMcuAccessRegWord(sc, 0xF85A, 0xC526);
1426                 MP_WriteMcuAccessRegWord(sc, 0xF85C, 0x64A5);
1427                 MP_WriteMcuAccessRegWord(sc, 0xF85E, 0x1400);
1428                 MP_WriteMcuAccessRegWord(sc, 0xF860, 0xF007);
1429                 MP_WriteMcuAccessRegWord(sc, 0xF862, 0x0C01);
1430                 MP_WriteMcuAccessRegWord(sc, 0xF864, 0x8CA5);
1431                 MP_WriteMcuAccessRegWord(sc, 0xF866, 0x1C15);
1432                 MP_WriteMcuAccessRegWord(sc, 0xF868, 0xC51B);
1433                 MP_WriteMcuAccessRegWord(sc, 0xF86A, 0x9CA0);
1434                 MP_WriteMcuAccessRegWord(sc, 0xF86C, 0xE013);
1435                 MP_WriteMcuAccessRegWord(sc, 0xF86E, 0xC519);
1436                 MP_WriteMcuAccessRegWord(sc, 0xF870, 0x74A0);
1437                 MP_WriteMcuAccessRegWord(sc, 0xF872, 0x48C4);
1438                 MP_WriteMcuAccessRegWord(sc, 0xF874, 0x8CA0);
1439                 MP_WriteMcuAccessRegWord(sc, 0xF876, 0xC516);
1440                 MP_WriteMcuAccessRegWord(sc, 0xF878, 0x74A4);
1441                 MP_WriteMcuAccessRegWord(sc, 0xF87A, 0x48C8);
1442                 MP_WriteMcuAccessRegWord(sc, 0xF87C, 0x48CA);
1443                 MP_WriteMcuAccessRegWord(sc, 0xF87E, 0x9CA4);
1444                 MP_WriteMcuAccessRegWord(sc, 0xF880, 0xC512);
1445                 MP_WriteMcuAccessRegWord(sc, 0xF882, 0x1B00);
1446                 MP_WriteMcuAccessRegWord(sc, 0xF884, 0x9BA0);
1447                 MP_WriteMcuAccessRegWord(sc, 0xF886, 0x1B1C);
1448                 MP_WriteMcuAccessRegWord(sc, 0xF888, 0x483F);
1449                 MP_WriteMcuAccessRegWord(sc, 0xF88A, 0x9BA2);
1450                 MP_WriteMcuAccessRegWord(sc, 0xF88C, 0x1B04);
1451                 MP_WriteMcuAccessRegWord(sc, 0xF88E, 0xC508);
1452                 MP_WriteMcuAccessRegWord(sc, 0xF890, 0x9BA0);
1453                 MP_WriteMcuAccessRegWord(sc, 0xF892, 0xC505);
1454                 MP_WriteMcuAccessRegWord(sc, 0xF894, 0xBD00);
1455                 MP_WriteMcuAccessRegWord(sc, 0xF896, 0xC502);
1456                 MP_WriteMcuAccessRegWord(sc, 0xF898, 0xBD00);
1457                 MP_WriteMcuAccessRegWord(sc, 0xF89A, 0x0300);
1458                 MP_WriteMcuAccessRegWord(sc, 0xF89C, 0x051E);
1459                 MP_WriteMcuAccessRegWord(sc, 0xF89E, 0xE434);
1460                 MP_WriteMcuAccessRegWord(sc, 0xF8A0, 0xE018);
1461                 MP_WriteMcuAccessRegWord(sc, 0xF8A2, 0xE092);
1462                 MP_WriteMcuAccessRegWord(sc, 0xF8A4, 0xDE20);
1463                 MP_WriteMcuAccessRegWord(sc, 0xF8A6, 0xD3C0);
1464                 MP_WriteMcuAccessRegWord(sc, 0xF8A8, 0xC50F);
1465                 MP_WriteMcuAccessRegWord(sc, 0xF8AA, 0x76A4);
1466                 MP_WriteMcuAccessRegWord(sc, 0xF8AC, 0x49E3);
1467                 MP_WriteMcuAccessRegWord(sc, 0xF8AE, 0xF007);
1468                 MP_WriteMcuAccessRegWord(sc, 0xF8B0, 0x49C0);
1469                 MP_WriteMcuAccessRegWord(sc, 0xF8B2, 0xF103);
1470                 MP_WriteMcuAccessRegWord(sc, 0xF8B4, 0xC607);
1471                 MP_WriteMcuAccessRegWord(sc, 0xF8B6, 0xBE00);
1472                 MP_WriteMcuAccessRegWord(sc, 0xF8B8, 0xC606);
1473                 MP_WriteMcuAccessRegWord(sc, 0xF8BA, 0xBE00);
1474                 MP_WriteMcuAccessRegWord(sc, 0xF8BC, 0xC602);
1475                 MP_WriteMcuAccessRegWord(sc, 0xF8BE, 0xBE00);
1476                 MP_WriteMcuAccessRegWord(sc, 0xF8C0, 0x0C4C);
1477                 MP_WriteMcuAccessRegWord(sc, 0xF8C2, 0x0C28);
1478                 MP_WriteMcuAccessRegWord(sc, 0xF8C4, 0x0C2C);
1479                 MP_WriteMcuAccessRegWord(sc, 0xF8C6, 0xDC00);
1480                 MP_WriteMcuAccessRegWord(sc, 0xF8C8, 0xC707);
1481                 MP_WriteMcuAccessRegWord(sc, 0xF8CA, 0x1D00);
1482                 MP_WriteMcuAccessRegWord(sc, 0xF8CC, 0x8DE2);
1483                 MP_WriteMcuAccessRegWord(sc, 0xF8CE, 0x48C1);
1484                 MP_WriteMcuAccessRegWord(sc, 0xF8D0, 0xC502);
1485                 MP_WriteMcuAccessRegWord(sc, 0xF8D2, 0xBD00);
1486                 MP_WriteMcuAccessRegWord(sc, 0xF8D4, 0x00AA);
1487                 MP_WriteMcuAccessRegWord(sc, 0xF8D6, 0xE0C0);
1488                 MP_WriteMcuAccessRegWord(sc, 0xF8D8, 0xC502);
1489                 MP_WriteMcuAccessRegWord(sc, 0xF8DA, 0xBD00);
1490                 MP_WriteMcuAccessRegWord(sc, 0xF8DC, 0x0132);
1491
1492                 MP_WriteMcuAccessRegWord(sc, 0xFC26, 0x8000);
1493
1494                 MP_WriteMcuAccessRegWord(sc, 0xFC2A, 0x0743);
1495                 MP_WriteMcuAccessRegWord(sc, 0xFC2C, 0x0801);
1496                 MP_WriteMcuAccessRegWord(sc, 0xFC2E, 0x0BE9);
1497                 MP_WriteMcuAccessRegWord(sc, 0xFC30, 0x02FD);
1498                 MP_WriteMcuAccessRegWord(sc, 0xFC32, 0x0C25);
1499                 MP_WriteMcuAccessRegWord(sc, 0xFC34, 0x00A9);
1500                 MP_WriteMcuAccessRegWord(sc, 0xFC36, 0x012D);
1501                 break;
1502         case MACFG_62:
1503                 DisableMcuBPs(sc);
1504
1505                 MP_WriteMcuAccessRegWord(sc, 0xF800, 0xE008);
1506                 MP_WriteMcuAccessRegWord(sc, 0xF802, 0xE0D3);
1507                 MP_WriteMcuAccessRegWord(sc, 0xF804, 0xE0D6);
1508                 MP_WriteMcuAccessRegWord(sc, 0xF806, 0xE0D9);
1509                 MP_WriteMcuAccessRegWord(sc, 0xF808, 0xE0DB);
1510                 MP_WriteMcuAccessRegWord(sc, 0xF80A, 0xE0DD);
1511                 MP_WriteMcuAccessRegWord(sc, 0xF80C, 0xE0DF);
1512                 MP_WriteMcuAccessRegWord(sc, 0xF80E, 0xE0E1);
1513                 MP_WriteMcuAccessRegWord(sc, 0xF810, 0xC251);
1514                 MP_WriteMcuAccessRegWord(sc, 0xF812, 0x7340);
1515                 MP_WriteMcuAccessRegWord(sc, 0xF814, 0x49B1);
1516                 MP_WriteMcuAccessRegWord(sc, 0xF816, 0xF010);
1517                 MP_WriteMcuAccessRegWord(sc, 0xF818, 0x1D02);
1518                 MP_WriteMcuAccessRegWord(sc, 0xF81A, 0x8D40);
1519                 MP_WriteMcuAccessRegWord(sc, 0xF81C, 0xC202);
1520                 MP_WriteMcuAccessRegWord(sc, 0xF81E, 0xBA00);
1521                 MP_WriteMcuAccessRegWord(sc, 0xF820, 0x2C3A);
1522                 MP_WriteMcuAccessRegWord(sc, 0xF822, 0xC0F0);
1523                 MP_WriteMcuAccessRegWord(sc, 0xF824, 0xE8DE);
1524                 MP_WriteMcuAccessRegWord(sc, 0xF826, 0x2000);
1525                 MP_WriteMcuAccessRegWord(sc, 0xF828, 0x8000);
1526                 MP_WriteMcuAccessRegWord(sc, 0xF82A, 0xC0B6);
1527                 MP_WriteMcuAccessRegWord(sc, 0xF82C, 0x268C);
1528                 MP_WriteMcuAccessRegWord(sc, 0xF82E, 0x752C);
1529                 MP_WriteMcuAccessRegWord(sc, 0xF830, 0x49D4);
1530                 MP_WriteMcuAccessRegWord(sc, 0xF832, 0xF112);
1531                 MP_WriteMcuAccessRegWord(sc, 0xF834, 0xE025);
1532                 MP_WriteMcuAccessRegWord(sc, 0xF836, 0xC2F6);
1533                 MP_WriteMcuAccessRegWord(sc, 0xF838, 0x7146);
1534                 MP_WriteMcuAccessRegWord(sc, 0xF83A, 0xC2F5);
1535                 MP_WriteMcuAccessRegWord(sc, 0xF83C, 0x7340);
1536                 MP_WriteMcuAccessRegWord(sc, 0xF83E, 0x49BE);
1537                 MP_WriteMcuAccessRegWord(sc, 0xF840, 0xF103);
1538                 MP_WriteMcuAccessRegWord(sc, 0xF842, 0xC7F2);
1539                 MP_WriteMcuAccessRegWord(sc, 0xF844, 0xE002);
1540                 MP_WriteMcuAccessRegWord(sc, 0xF846, 0xC7F1);
1541                 MP_WriteMcuAccessRegWord(sc, 0xF848, 0x304F);
1542                 MP_WriteMcuAccessRegWord(sc, 0xF84A, 0x6226);
1543                 MP_WriteMcuAccessRegWord(sc, 0xF84C, 0x49A1);
1544                 MP_WriteMcuAccessRegWord(sc, 0xF84E, 0xF1F0);
1545                 MP_WriteMcuAccessRegWord(sc, 0xF850, 0x7222);
1546                 MP_WriteMcuAccessRegWord(sc, 0xF852, 0x49A0);
1547                 MP_WriteMcuAccessRegWord(sc, 0xF854, 0xF1ED);
1548                 MP_WriteMcuAccessRegWord(sc, 0xF856, 0x2525);
1549                 MP_WriteMcuAccessRegWord(sc, 0xF858, 0x1F28);
1550                 MP_WriteMcuAccessRegWord(sc, 0xF85A, 0x3097);
1551                 MP_WriteMcuAccessRegWord(sc, 0xF85C, 0x3091);
1552                 MP_WriteMcuAccessRegWord(sc, 0xF85E, 0x9A36);
1553                 MP_WriteMcuAccessRegWord(sc, 0xF860, 0x752C);
1554                 MP_WriteMcuAccessRegWord(sc, 0xF862, 0x21DC);
1555                 MP_WriteMcuAccessRegWord(sc, 0xF864, 0x25BC);
1556                 MP_WriteMcuAccessRegWord(sc, 0xF866, 0xC6E2);
1557                 MP_WriteMcuAccessRegWord(sc, 0xF868, 0x77C0);
1558                 MP_WriteMcuAccessRegWord(sc, 0xF86A, 0x1304);
1559                 MP_WriteMcuAccessRegWord(sc, 0xF86C, 0xF014);
1560                 MP_WriteMcuAccessRegWord(sc, 0xF86E, 0x1303);
1561                 MP_WriteMcuAccessRegWord(sc, 0xF870, 0xF014);
1562                 MP_WriteMcuAccessRegWord(sc, 0xF872, 0x1302);
1563                 MP_WriteMcuAccessRegWord(sc, 0xF874, 0xF014);
1564                 MP_WriteMcuAccessRegWord(sc, 0xF876, 0x1301);
1565                 MP_WriteMcuAccessRegWord(sc, 0xF878, 0xF014);
1566                 MP_WriteMcuAccessRegWord(sc, 0xF87A, 0x49D4);
1567                 MP_WriteMcuAccessRegWord(sc, 0xF87C, 0xF103);
1568                 MP_WriteMcuAccessRegWord(sc, 0xF87E, 0xC3D7);
1569                 MP_WriteMcuAccessRegWord(sc, 0xF880, 0xBB00);
1570                 MP_WriteMcuAccessRegWord(sc, 0xF882, 0xC618);
1571                 MP_WriteMcuAccessRegWord(sc, 0xF884, 0x67C6);
1572                 MP_WriteMcuAccessRegWord(sc, 0xF886, 0x752E);
1573                 MP_WriteMcuAccessRegWord(sc, 0xF888, 0x22D7);
1574                 MP_WriteMcuAccessRegWord(sc, 0xF88A, 0x26DD);
1575                 MP_WriteMcuAccessRegWord(sc, 0xF88C, 0x1505);
1576                 MP_WriteMcuAccessRegWord(sc, 0xF88E, 0xF013);
1577                 MP_WriteMcuAccessRegWord(sc, 0xF890, 0xC60A);
1578                 MP_WriteMcuAccessRegWord(sc, 0xF892, 0xBE00);
1579                 MP_WriteMcuAccessRegWord(sc, 0xF894, 0xC309);
1580                 MP_WriteMcuAccessRegWord(sc, 0xF896, 0xBB00);
1581                 MP_WriteMcuAccessRegWord(sc, 0xF898, 0xC308);
1582                 MP_WriteMcuAccessRegWord(sc, 0xF89A, 0xBB00);
1583                 MP_WriteMcuAccessRegWord(sc, 0xF89C, 0xC307);
1584                 MP_WriteMcuAccessRegWord(sc, 0xF89E, 0xBB00);
1585                 MP_WriteMcuAccessRegWord(sc, 0xF8A0, 0xC306);
1586                 MP_WriteMcuAccessRegWord(sc, 0xF8A2, 0xBB00);
1587                 MP_WriteMcuAccessRegWord(sc, 0xF8A4, 0x25C8);
1588                 MP_WriteMcuAccessRegWord(sc, 0xF8A6, 0x25A6);
1589                 MP_WriteMcuAccessRegWord(sc, 0xF8A8, 0x25AC);
1590                 MP_WriteMcuAccessRegWord(sc, 0xF8AA, 0x25B2);
1591                 MP_WriteMcuAccessRegWord(sc, 0xF8AC, 0x25B8);
1592                 MP_WriteMcuAccessRegWord(sc, 0xF8AE, 0xCD08);
1593                 MP_WriteMcuAccessRegWord(sc, 0xF8B0, 0x0000);
1594                 MP_WriteMcuAccessRegWord(sc, 0xF8B2, 0xC0BC);
1595                 MP_WriteMcuAccessRegWord(sc, 0xF8B4, 0xC2FF);
1596                 MP_WriteMcuAccessRegWord(sc, 0xF8B6, 0x7340);
1597                 MP_WriteMcuAccessRegWord(sc, 0xF8B8, 0x49B0);
1598                 MP_WriteMcuAccessRegWord(sc, 0xF8BA, 0xF04E);
1599                 MP_WriteMcuAccessRegWord(sc, 0xF8BC, 0x1F46);
1600                 MP_WriteMcuAccessRegWord(sc, 0xF8BE, 0x308F);
1601                 MP_WriteMcuAccessRegWord(sc, 0xF8C0, 0xC3F7);
1602                 MP_WriteMcuAccessRegWord(sc, 0xF8C2, 0x1C04);
1603                 MP_WriteMcuAccessRegWord(sc, 0xF8C4, 0xE84D);
1604                 MP_WriteMcuAccessRegWord(sc, 0xF8C6, 0x1401);
1605                 MP_WriteMcuAccessRegWord(sc, 0xF8C8, 0xF147);
1606                 MP_WriteMcuAccessRegWord(sc, 0xF8CA, 0x7226);
1607                 MP_WriteMcuAccessRegWord(sc, 0xF8CC, 0x49A7);
1608                 MP_WriteMcuAccessRegWord(sc, 0xF8CE, 0xF044);
1609                 MP_WriteMcuAccessRegWord(sc, 0xF8D0, 0x7222);
1610                 MP_WriteMcuAccessRegWord(sc, 0xF8D2, 0x2525);
1611                 MP_WriteMcuAccessRegWord(sc, 0xF8D4, 0x1F30);
1612                 MP_WriteMcuAccessRegWord(sc, 0xF8D6, 0x3097);
1613                 MP_WriteMcuAccessRegWord(sc, 0xF8D8, 0x3091);
1614                 MP_WriteMcuAccessRegWord(sc, 0xF8DA, 0x7340);
1615                 MP_WriteMcuAccessRegWord(sc, 0xF8DC, 0xC4EA);
1616                 MP_WriteMcuAccessRegWord(sc, 0xF8DE, 0x401C);
1617                 MP_WriteMcuAccessRegWord(sc, 0xF8E0, 0xF006);
1618                 MP_WriteMcuAccessRegWord(sc, 0xF8E2, 0xC6E8);
1619                 MP_WriteMcuAccessRegWord(sc, 0xF8E4, 0x75C0);
1620                 MP_WriteMcuAccessRegWord(sc, 0xF8E6, 0x49D7);
1621                 MP_WriteMcuAccessRegWord(sc, 0xF8E8, 0xF105);
1622                 MP_WriteMcuAccessRegWord(sc, 0xF8EA, 0xE036);
1623                 MP_WriteMcuAccessRegWord(sc, 0xF8EC, 0x1D08);
1624                 MP_WriteMcuAccessRegWord(sc, 0xF8EE, 0x8DC1);
1625                 MP_WriteMcuAccessRegWord(sc, 0xF8F0, 0x0208);
1626                 MP_WriteMcuAccessRegWord(sc, 0xF8F2, 0x6640);
1627                 MP_WriteMcuAccessRegWord(sc, 0xF8F4, 0x2764);
1628                 MP_WriteMcuAccessRegWord(sc, 0xF8F6, 0x1606);
1629                 MP_WriteMcuAccessRegWord(sc, 0xF8F8, 0xF12F);
1630                 MP_WriteMcuAccessRegWord(sc, 0xF8FA, 0x6346);
1631                 MP_WriteMcuAccessRegWord(sc, 0xF8FC, 0x133B);
1632                 MP_WriteMcuAccessRegWord(sc, 0xF8FE, 0xF12C);
1633                 MP_WriteMcuAccessRegWord(sc, 0xF900, 0x9B34);
1634                 MP_WriteMcuAccessRegWord(sc, 0xF902, 0x1B18);
1635                 MP_WriteMcuAccessRegWord(sc, 0xF904, 0x3093);
1636                 MP_WriteMcuAccessRegWord(sc, 0xF906, 0xC32A);
1637                 MP_WriteMcuAccessRegWord(sc, 0xF908, 0x1C10);
1638                 MP_WriteMcuAccessRegWord(sc, 0xF90A, 0xE82A);
1639                 MP_WriteMcuAccessRegWord(sc, 0xF90C, 0x1401);
1640                 MP_WriteMcuAccessRegWord(sc, 0xF90E, 0xF124);
1641                 MP_WriteMcuAccessRegWord(sc, 0xF910, 0x1A36);
1642                 MP_WriteMcuAccessRegWord(sc, 0xF912, 0x308A);
1643                 MP_WriteMcuAccessRegWord(sc, 0xF914, 0x7322);
1644                 MP_WriteMcuAccessRegWord(sc, 0xF916, 0x25B5);
1645                 MP_WriteMcuAccessRegWord(sc, 0xF918, 0x0B0E);
1646                 MP_WriteMcuAccessRegWord(sc, 0xF91A, 0x1C00);
1647                 MP_WriteMcuAccessRegWord(sc, 0xF91C, 0xE82C);
1648                 MP_WriteMcuAccessRegWord(sc, 0xF91E, 0xC71F);
1649                 MP_WriteMcuAccessRegWord(sc, 0xF920, 0x4027);
1650                 MP_WriteMcuAccessRegWord(sc, 0xF922, 0xF11A);
1651                 MP_WriteMcuAccessRegWord(sc, 0xF924, 0xE838);
1652                 MP_WriteMcuAccessRegWord(sc, 0xF926, 0x1F42);
1653                 MP_WriteMcuAccessRegWord(sc, 0xF928, 0x308F);
1654                 MP_WriteMcuAccessRegWord(sc, 0xF92A, 0x1B08);
1655                 MP_WriteMcuAccessRegWord(sc, 0xF92C, 0xE824);
1656                 MP_WriteMcuAccessRegWord(sc, 0xF92E, 0x7236);
1657                 MP_WriteMcuAccessRegWord(sc, 0xF930, 0x7746);
1658                 MP_WriteMcuAccessRegWord(sc, 0xF932, 0x1700);
1659                 MP_WriteMcuAccessRegWord(sc, 0xF934, 0xF00D);
1660                 MP_WriteMcuAccessRegWord(sc, 0xF936, 0xC313);
1661                 MP_WriteMcuAccessRegWord(sc, 0xF938, 0x401F);
1662                 MP_WriteMcuAccessRegWord(sc, 0xF93A, 0xF103);
1663                 MP_WriteMcuAccessRegWord(sc, 0xF93C, 0x1F00);
1664                 MP_WriteMcuAccessRegWord(sc, 0xF93E, 0x9F46);
1665                 MP_WriteMcuAccessRegWord(sc, 0xF940, 0x7744);
1666                 MP_WriteMcuAccessRegWord(sc, 0xF942, 0x449F);
1667                 MP_WriteMcuAccessRegWord(sc, 0xF944, 0x445F);
1668                 MP_WriteMcuAccessRegWord(sc, 0xF946, 0xE817);
1669                 MP_WriteMcuAccessRegWord(sc, 0xF948, 0xC70A);
1670                 MP_WriteMcuAccessRegWord(sc, 0xF94A, 0x4027);
1671                 MP_WriteMcuAccessRegWord(sc, 0xF94C, 0xF105);
1672                 MP_WriteMcuAccessRegWord(sc, 0xF94E, 0xC302);
1673                 MP_WriteMcuAccessRegWord(sc, 0xF950, 0xBB00);
1674                 MP_WriteMcuAccessRegWord(sc, 0xF952, 0x2E08);
1675                 MP_WriteMcuAccessRegWord(sc, 0xF954, 0x2DC2);
1676                 MP_WriteMcuAccessRegWord(sc, 0xF956, 0xC7FF);
1677                 MP_WriteMcuAccessRegWord(sc, 0xF958, 0xBF00);
1678                 MP_WriteMcuAccessRegWord(sc, 0xF95A, 0xCDB8);
1679                 MP_WriteMcuAccessRegWord(sc, 0xF95C, 0xFFFF);
1680                 MP_WriteMcuAccessRegWord(sc, 0xF95E, 0x0C02);
1681                 MP_WriteMcuAccessRegWord(sc, 0xF960, 0xA554);
1682                 MP_WriteMcuAccessRegWord(sc, 0xF962, 0xA5DC);
1683                 MP_WriteMcuAccessRegWord(sc, 0xF964, 0x402F);
1684                 MP_WriteMcuAccessRegWord(sc, 0xF966, 0xF105);
1685                 MP_WriteMcuAccessRegWord(sc, 0xF968, 0x1400);
1686                 MP_WriteMcuAccessRegWord(sc, 0xF96A, 0xF1FA);
1687                 MP_WriteMcuAccessRegWord(sc, 0xF96C, 0x1C01);
1688                 MP_WriteMcuAccessRegWord(sc, 0xF96E, 0xE002);
1689                 MP_WriteMcuAccessRegWord(sc, 0xF970, 0x1C00);
1690                 MP_WriteMcuAccessRegWord(sc, 0xF972, 0xFF80);
1691                 MP_WriteMcuAccessRegWord(sc, 0xF974, 0x49B0);
1692                 MP_WriteMcuAccessRegWord(sc, 0xF976, 0xF004);
1693                 MP_WriteMcuAccessRegWord(sc, 0xF978, 0x0B01);
1694                 MP_WriteMcuAccessRegWord(sc, 0xF97A, 0xA1D3);
1695                 MP_WriteMcuAccessRegWord(sc, 0xF97C, 0xE003);
1696                 MP_WriteMcuAccessRegWord(sc, 0xF97E, 0x0B02);
1697                 MP_WriteMcuAccessRegWord(sc, 0xF980, 0xA5D3);
1698                 MP_WriteMcuAccessRegWord(sc, 0xF982, 0x3127);
1699                 MP_WriteMcuAccessRegWord(sc, 0xF984, 0x3720);
1700                 MP_WriteMcuAccessRegWord(sc, 0xF986, 0x0B02);
1701                 MP_WriteMcuAccessRegWord(sc, 0xF988, 0xA5D3);
1702                 MP_WriteMcuAccessRegWord(sc, 0xF98A, 0x3127);
1703                 MP_WriteMcuAccessRegWord(sc, 0xF98C, 0x3720);
1704                 MP_WriteMcuAccessRegWord(sc, 0xF98E, 0x1300);
1705                 MP_WriteMcuAccessRegWord(sc, 0xF990, 0xF1FB);
1706                 MP_WriteMcuAccessRegWord(sc, 0xF992, 0xFF80);
1707                 MP_WriteMcuAccessRegWord(sc, 0xF994, 0x7322);
1708                 MP_WriteMcuAccessRegWord(sc, 0xF996, 0x25B5);
1709                 MP_WriteMcuAccessRegWord(sc, 0xF998, 0x1E28);
1710                 MP_WriteMcuAccessRegWord(sc, 0xF99A, 0x30DE);
1711                 MP_WriteMcuAccessRegWord(sc, 0xF99C, 0x30D9);
1712                 MP_WriteMcuAccessRegWord(sc, 0xF99E, 0x7264);
1713                 MP_WriteMcuAccessRegWord(sc, 0xF9A0, 0x1E11);
1714                 MP_WriteMcuAccessRegWord(sc, 0xF9A2, 0x2368);
1715                 MP_WriteMcuAccessRegWord(sc, 0xF9A4, 0x3116);
1716                 MP_WriteMcuAccessRegWord(sc, 0xF9A6, 0xFF80);
1717                 MP_WriteMcuAccessRegWord(sc, 0xF9A8, 0x1B7E);
1718                 MP_WriteMcuAccessRegWord(sc, 0xF9AA, 0xC602);
1719                 MP_WriteMcuAccessRegWord(sc, 0xF9AC, 0xBE00);
1720                 MP_WriteMcuAccessRegWord(sc, 0xF9AE, 0x06A6);
1721                 MP_WriteMcuAccessRegWord(sc, 0xF9B0, 0x1B7E);
1722                 MP_WriteMcuAccessRegWord(sc, 0xF9B2, 0xC602);
1723                 MP_WriteMcuAccessRegWord(sc, 0xF9B4, 0xBE00);
1724                 MP_WriteMcuAccessRegWord(sc, 0xF9B6, 0x0764);
1725                 MP_WriteMcuAccessRegWord(sc, 0xF9B8, 0xC602);
1726                 MP_WriteMcuAccessRegWord(sc, 0xF9BA, 0xBE00);
1727                 MP_WriteMcuAccessRegWord(sc, 0xF9BC, 0x0000);
1728                 MP_WriteMcuAccessRegWord(sc, 0xF9BE, 0xC602);
1729                 MP_WriteMcuAccessRegWord(sc, 0xF9C0, 0xBE00);
1730                 MP_WriteMcuAccessRegWord(sc, 0xF9C2, 0x0000);
1731                 MP_WriteMcuAccessRegWord(sc, 0xF9C4, 0xC602);
1732                 MP_WriteMcuAccessRegWord(sc, 0xF9C6, 0xBE00);
1733                 MP_WriteMcuAccessRegWord(sc, 0xF9C8, 0x0000);
1734                 MP_WriteMcuAccessRegWord(sc, 0xF9CA, 0xC602);
1735                 MP_WriteMcuAccessRegWord(sc, 0xF9CC, 0xBE00);
1736                 MP_WriteMcuAccessRegWord(sc, 0xF9CE, 0x0000);
1737                 MP_WriteMcuAccessRegWord(sc, 0xF9D0, 0xC602);
1738                 MP_WriteMcuAccessRegWord(sc, 0xF9D2, 0xBE00);
1739                 MP_WriteMcuAccessRegWord(sc, 0xF9D4, 0x0000);
1740
1741                 MP_WriteMcuAccessRegWord(sc, 0xFC26, 0x8000);
1742
1743                 MP_WriteMcuAccessRegWord(sc, 0xFC28, 0x2549);
1744                 MP_WriteMcuAccessRegWord(sc, 0xFC2A, 0x06A5);
1745                 MP_WriteMcuAccessRegWord(sc, 0xFC2C, 0x0763);
1746                 break;
1747         case MACFG_67:
1748                 DisableMcuBPs(sc);
1749
1750                 MP_WriteMcuAccessRegWord(sc, 0xF800, 0xE008);
1751                 MP_WriteMcuAccessRegWord(sc, 0xF802, 0xE017);
1752                 MP_WriteMcuAccessRegWord(sc, 0xF804, 0xE019);
1753                 MP_WriteMcuAccessRegWord(sc, 0xF806, 0xE01B);
1754                 MP_WriteMcuAccessRegWord(sc, 0xF808, 0xE01D);
1755                 MP_WriteMcuAccessRegWord(sc, 0xF80A, 0xE01F);
1756                 MP_WriteMcuAccessRegWord(sc, 0xF80C, 0xE021);
1757                 MP_WriteMcuAccessRegWord(sc, 0xF80E, 0xE023);
1758                 MP_WriteMcuAccessRegWord(sc, 0xF810, 0xC50F);
1759                 MP_WriteMcuAccessRegWord(sc, 0xF812, 0x76A4);
1760                 MP_WriteMcuAccessRegWord(sc, 0xF814, 0x49E3);
1761                 MP_WriteMcuAccessRegWord(sc, 0xF816, 0xF007);
1762                 MP_WriteMcuAccessRegWord(sc, 0xF818, 0x49C0);
1763                 MP_WriteMcuAccessRegWord(sc, 0xF81A, 0xF103);
1764                 MP_WriteMcuAccessRegWord(sc, 0xF81C, 0xC607);
1765                 MP_WriteMcuAccessRegWord(sc, 0xF81E, 0xBE00);
1766                 MP_WriteMcuAccessRegWord(sc, 0xF820, 0xC606);
1767                 MP_WriteMcuAccessRegWord(sc, 0xF822, 0xBE00);
1768                 MP_WriteMcuAccessRegWord(sc, 0xF824, 0xC602);
1769                 MP_WriteMcuAccessRegWord(sc, 0xF826, 0xBE00);
1770                 MP_WriteMcuAccessRegWord(sc, 0xF828, 0x0BDA);
1771                 MP_WriteMcuAccessRegWord(sc, 0xF82A, 0x0BB0);
1772                 MP_WriteMcuAccessRegWord(sc, 0xF82C, 0x0BBA);
1773                 MP_WriteMcuAccessRegWord(sc, 0xF82E, 0xDC00);
1774                 MP_WriteMcuAccessRegWord(sc, 0xF830, 0xC602);
1775                 MP_WriteMcuAccessRegWord(sc, 0xF832, 0xBE00);
1776                 MP_WriteMcuAccessRegWord(sc, 0xF834, 0x0000);
1777                 MP_WriteMcuAccessRegWord(sc, 0xF836, 0xC602);
1778                 MP_WriteMcuAccessRegWord(sc, 0xF838, 0xBE00);
1779                 MP_WriteMcuAccessRegWord(sc, 0xF83A, 0x0000);
1780                 MP_WriteMcuAccessRegWord(sc, 0xF83C, 0xC602);
1781                 MP_WriteMcuAccessRegWord(sc, 0xF83E, 0xBE00);
1782                 MP_WriteMcuAccessRegWord(sc, 0xF840, 0x0000);
1783                 MP_WriteMcuAccessRegWord(sc, 0xF842, 0xC602);
1784                 MP_WriteMcuAccessRegWord(sc, 0xF844, 0xBE00);
1785                 MP_WriteMcuAccessRegWord(sc, 0xF846, 0x0000);
1786                 MP_WriteMcuAccessRegWord(sc, 0xF848, 0xC602);
1787                 MP_WriteMcuAccessRegWord(sc, 0xF84A, 0xBE00);
1788                 MP_WriteMcuAccessRegWord(sc, 0xF84C, 0x0000);
1789                 MP_WriteMcuAccessRegWord(sc, 0xF84E, 0xC602);
1790                 MP_WriteMcuAccessRegWord(sc, 0xF850, 0xBE00);
1791                 MP_WriteMcuAccessRegWord(sc, 0xF852, 0x0000);
1792                 MP_WriteMcuAccessRegWord(sc, 0xF854, 0xC602);
1793                 MP_WriteMcuAccessRegWord(sc, 0xF856, 0xBE00);
1794                 MP_WriteMcuAccessRegWord(sc, 0xF858, 0x0000);
1795
1796                 MP_WriteMcuAccessRegWord(sc, 0xFC26, 0x8000);
1797
1798                 MP_WriteMcuAccessRegWord(sc, 0xFC28, 0x0BB3);
1799                 break;
1800         case MACFG_68:
1801         case MACFG_69:
1802                 DisableMcuBPs(sc);
1803
1804                 MP_WriteMcuAccessRegWord(sc, 0xF800, 0xE008);
1805                 MP_WriteMcuAccessRegWord(sc, 0xF802, 0xE00F);
1806                 MP_WriteMcuAccessRegWord(sc, 0xF804, 0xE011);
1807                 MP_WriteMcuAccessRegWord(sc, 0xF806, 0xE047);
1808                 MP_WriteMcuAccessRegWord(sc, 0xF808, 0xE049);
1809                 MP_WriteMcuAccessRegWord(sc, 0xF80A, 0xE073);
1810                 MP_WriteMcuAccessRegWord(sc, 0xF80C, 0xE075);
1811                 MP_WriteMcuAccessRegWord(sc, 0xF80E, 0xE077);
1812                 MP_WriteMcuAccessRegWord(sc, 0xF810, 0xC707);
1813                 MP_WriteMcuAccessRegWord(sc, 0xF812, 0x1D00);
1814                 MP_WriteMcuAccessRegWord(sc, 0xF814, 0x8DE2);
1815                 MP_WriteMcuAccessRegWord(sc, 0xF816, 0x48C1);
1816                 MP_WriteMcuAccessRegWord(sc, 0xF818, 0xC502);
1817                 MP_WriteMcuAccessRegWord(sc, 0xF81A, 0xBD00);
1818                 MP_WriteMcuAccessRegWord(sc, 0xF81C, 0x00E4);
1819                 MP_WriteMcuAccessRegWord(sc, 0xF81E, 0xE0C0);
1820                 MP_WriteMcuAccessRegWord(sc, 0xF820, 0xC502);
1821                 MP_WriteMcuAccessRegWord(sc, 0xF822, 0xBD00);
1822                 MP_WriteMcuAccessRegWord(sc, 0xF824, 0x0216);
1823                 MP_WriteMcuAccessRegWord(sc, 0xF826, 0xC634);
1824                 MP_WriteMcuAccessRegWord(sc, 0xF828, 0x75C0);
1825                 MP_WriteMcuAccessRegWord(sc, 0xF82A, 0x49D3);
1826                 MP_WriteMcuAccessRegWord(sc, 0xF82C, 0xF027);
1827                 MP_WriteMcuAccessRegWord(sc, 0xF82E, 0xC631);
1828                 MP_WriteMcuAccessRegWord(sc, 0xF830, 0x75C0);
1829                 MP_WriteMcuAccessRegWord(sc, 0xF832, 0x49D3);
1830                 MP_WriteMcuAccessRegWord(sc, 0xF834, 0xF123);
1831                 MP_WriteMcuAccessRegWord(sc, 0xF836, 0xC627);
1832                 MP_WriteMcuAccessRegWord(sc, 0xF838, 0x75C0);
1833                 MP_WriteMcuAccessRegWord(sc, 0xF83A, 0xB405);
1834                 MP_WriteMcuAccessRegWord(sc, 0xF83C, 0xC525);
1835                 MP_WriteMcuAccessRegWord(sc, 0xF83E, 0x9DC0);
1836                 MP_WriteMcuAccessRegWord(sc, 0xF840, 0xC621);
1837                 MP_WriteMcuAccessRegWord(sc, 0xF842, 0x75C8);
1838                 MP_WriteMcuAccessRegWord(sc, 0xF844, 0x49D5);
1839                 MP_WriteMcuAccessRegWord(sc, 0xF846, 0xF00A);
1840                 MP_WriteMcuAccessRegWord(sc, 0xF848, 0x49D6);
1841                 MP_WriteMcuAccessRegWord(sc, 0xF84A, 0xF008);
1842                 MP_WriteMcuAccessRegWord(sc, 0xF84C, 0x49D7);
1843                 MP_WriteMcuAccessRegWord(sc, 0xF84E, 0xF006);
1844                 MP_WriteMcuAccessRegWord(sc, 0xF850, 0x49D8);
1845                 MP_WriteMcuAccessRegWord(sc, 0xF852, 0xF004);
1846                 MP_WriteMcuAccessRegWord(sc, 0xF854, 0x75D2);
1847                 MP_WriteMcuAccessRegWord(sc, 0xF856, 0x49D9);
1848                 MP_WriteMcuAccessRegWord(sc, 0xF858, 0xF111);
1849                 MP_WriteMcuAccessRegWord(sc, 0xF85A, 0xC517);
1850                 MP_WriteMcuAccessRegWord(sc, 0xF85C, 0x9DC8);
1851                 MP_WriteMcuAccessRegWord(sc, 0xF85E, 0xC516);
1852                 MP_WriteMcuAccessRegWord(sc, 0xF860, 0x9DD2);
1853                 MP_WriteMcuAccessRegWord(sc, 0xF862, 0xC618);
1854                 MP_WriteMcuAccessRegWord(sc, 0xF864, 0x75C0);
1855                 MP_WriteMcuAccessRegWord(sc, 0xF866, 0x49D4);
1856                 MP_WriteMcuAccessRegWord(sc, 0xF868, 0xF003);
1857                 MP_WriteMcuAccessRegWord(sc, 0xF86A, 0x49D0);
1858                 MP_WriteMcuAccessRegWord(sc, 0xF86C, 0xF104);
1859                 MP_WriteMcuAccessRegWord(sc, 0xF86E, 0xC60A);
1860                 MP_WriteMcuAccessRegWord(sc, 0xF870, 0xC50E);
1861                 MP_WriteMcuAccessRegWord(sc, 0xF872, 0x9DC0);
1862                 MP_WriteMcuAccessRegWord(sc, 0xF874, 0xB005);
1863                 MP_WriteMcuAccessRegWord(sc, 0xF876, 0xC607);
1864                 MP_WriteMcuAccessRegWord(sc, 0xF878, 0x9DC0);
1865                 MP_WriteMcuAccessRegWord(sc, 0xF87A, 0xB007);
1866                 MP_WriteMcuAccessRegWord(sc, 0xF87C, 0xC602);
1867                 MP_WriteMcuAccessRegWord(sc, 0xF87E, 0xBE00);
1868                 MP_WriteMcuAccessRegWord(sc, 0xF880, 0x1A06);
1869                 MP_WriteMcuAccessRegWord(sc, 0xF882, 0xB400);
1870                 MP_WriteMcuAccessRegWord(sc, 0xF884, 0xE86C);
1871                 MP_WriteMcuAccessRegWord(sc, 0xF886, 0xA000);
1872                 MP_WriteMcuAccessRegWord(sc, 0xF888, 0x01E1);
1873                 MP_WriteMcuAccessRegWord(sc, 0xF88A, 0x0200);
1874                 MP_WriteMcuAccessRegWord(sc, 0xF88C, 0x9200);
1875                 MP_WriteMcuAccessRegWord(sc, 0xF88E, 0xE84C);
1876                 MP_WriteMcuAccessRegWord(sc, 0xF890, 0xE004);
1877                 MP_WriteMcuAccessRegWord(sc, 0xF892, 0xE908);
1878                 MP_WriteMcuAccessRegWord(sc, 0xF894, 0xC502);
1879                 MP_WriteMcuAccessRegWord(sc, 0xF896, 0xBD00);
1880                 MP_WriteMcuAccessRegWord(sc, 0xF898, 0x0B58);
1881                 MP_WriteMcuAccessRegWord(sc, 0xF89A, 0xB407);
1882                 MP_WriteMcuAccessRegWord(sc, 0xF89C, 0xB404);
1883                 MP_WriteMcuAccessRegWord(sc, 0xF89E, 0x2195);
1884                 MP_WriteMcuAccessRegWord(sc, 0xF8A0, 0x25BD);
1885                 MP_WriteMcuAccessRegWord(sc, 0xF8A2, 0x9BE0);
1886                 MP_WriteMcuAccessRegWord(sc, 0xF8A4, 0x1C1C);
1887                 MP_WriteMcuAccessRegWord(sc, 0xF8A6, 0x484F);
1888                 MP_WriteMcuAccessRegWord(sc, 0xF8A8, 0x9CE2);
1889                 MP_WriteMcuAccessRegWord(sc, 0xF8AA, 0x72E2);
1890                 MP_WriteMcuAccessRegWord(sc, 0xF8AC, 0x49AE);
1891                 MP_WriteMcuAccessRegWord(sc, 0xF8AE, 0xF1FE);
1892                 MP_WriteMcuAccessRegWord(sc, 0xF8B0, 0x0B00);
1893                 MP_WriteMcuAccessRegWord(sc, 0xF8B2, 0xF116);
1894                 MP_WriteMcuAccessRegWord(sc, 0xF8B4, 0xC71C);
1895                 MP_WriteMcuAccessRegWord(sc, 0xF8B6, 0xC419);
1896                 MP_WriteMcuAccessRegWord(sc, 0xF8B8, 0x9CE0);
1897                 MP_WriteMcuAccessRegWord(sc, 0xF8BA, 0x1C13);
1898                 MP_WriteMcuAccessRegWord(sc, 0xF8BC, 0x484F);
1899                 MP_WriteMcuAccessRegWord(sc, 0xF8BE, 0x9CE2);
1900                 MP_WriteMcuAccessRegWord(sc, 0xF8C0, 0x74E2);
1901                 MP_WriteMcuAccessRegWord(sc, 0xF8C2, 0x49CE);
1902                 MP_WriteMcuAccessRegWord(sc, 0xF8C4, 0xF1FE);
1903                 MP_WriteMcuAccessRegWord(sc, 0xF8C6, 0xC412);
1904                 MP_WriteMcuAccessRegWord(sc, 0xF8C8, 0x9CE0);
1905                 MP_WriteMcuAccessRegWord(sc, 0xF8CA, 0x1C13);
1906                 MP_WriteMcuAccessRegWord(sc, 0xF8CC, 0x484F);
1907                 MP_WriteMcuAccessRegWord(sc, 0xF8CE, 0x9CE2);
1908                 MP_WriteMcuAccessRegWord(sc, 0xF8D0, 0x74E2);
1909                 MP_WriteMcuAccessRegWord(sc, 0xF8D2, 0x49CE);
1910                 MP_WriteMcuAccessRegWord(sc, 0xF8D4, 0xF1FE);
1911                 MP_WriteMcuAccessRegWord(sc, 0xF8D6, 0xC70C);
1912                 MP_WriteMcuAccessRegWord(sc, 0xF8D8, 0x74F8);
1913                 MP_WriteMcuAccessRegWord(sc, 0xF8DA, 0x48C3);
1914                 MP_WriteMcuAccessRegWord(sc, 0xF8DC, 0x8CF8);
1915                 MP_WriteMcuAccessRegWord(sc, 0xF8DE, 0xB004);
1916                 MP_WriteMcuAccessRegWord(sc, 0xF8E0, 0xB007);
1917                 MP_WriteMcuAccessRegWord(sc, 0xF8E2, 0xC502);
1918                 MP_WriteMcuAccessRegWord(sc, 0xF8E4, 0xBD00);
1919                 MP_WriteMcuAccessRegWord(sc, 0xF8E6, 0x0F24);
1920                 MP_WriteMcuAccessRegWord(sc, 0xF8E8, 0x0481);
1921                 MP_WriteMcuAccessRegWord(sc, 0xF8EA, 0x0C81);
1922                 MP_WriteMcuAccessRegWord(sc, 0xF8EC, 0xDE24);
1923                 MP_WriteMcuAccessRegWord(sc, 0xF8EE, 0xE000);
1924                 MP_WriteMcuAccessRegWord(sc, 0xF8F0, 0xC602);
1925                 MP_WriteMcuAccessRegWord(sc, 0xF8F2, 0xBE00);
1926                 MP_WriteMcuAccessRegWord(sc, 0xF8F4, 0x0CA4);
1927                 MP_WriteMcuAccessRegWord(sc, 0xF8F6, 0xC502);
1928                 MP_WriteMcuAccessRegWord(sc, 0xF8F8, 0xBD00);
1929                 MP_WriteMcuAccessRegWord(sc, 0xF8FA, 0x0000);
1930                 MP_WriteMcuAccessRegWord(sc, 0xF8FC, 0xC602);
1931                 MP_WriteMcuAccessRegWord(sc, 0xF8FE, 0xBE00);
1932                 MP_WriteMcuAccessRegWord(sc, 0xF900, 0x0000);
1933
1934                 MP_WriteMcuAccessRegWord(sc, 0xFC26, 0x8000);
1935
1936                 MP_WriteMcuAccessRegWord(sc, 0xFC28, 0x00E2);
1937                 MP_WriteMcuAccessRegWord(sc, 0xFC2A, 0x0210);
1938                 MP_WriteMcuAccessRegWord(sc, 0xFC2C, 0x1A04);
1939                 MP_WriteMcuAccessRegWord(sc, 0xFC2E, 0x0B26);
1940                 MP_WriteMcuAccessRegWord(sc, 0xFC30, 0x0F02);
1941                 MP_WriteMcuAccessRegWord(sc, 0xFC32, 0x0CA0);
1942
1943                 if (sc->re_device_id == RT_DEVICEID_8136)
1944                         MP_WriteMcuAccessRegWord(sc, 0xFC38, 0x0033);
1945                 else
1946                         MP_WriteMcuAccessRegWord(sc, 0xFC38, 0x003F);
1947
1948                 break;
1949         }
1950 }
1951
1952 #define ISRIMR_DASH_TYPE2_TX_DISABLE_IDLE BIT_5
1953 static void Dash2DisableTx(struct re_softc *sc)
1954 {
1955         //if (!re_check_dash(sc)) return;
1956
1957         if (sc->re_type == MACFG_61 || sc->re_type == MACFG_62 ||
1958             sc->re_type == MACFG_67) {
1959                 u_int16_t WaitCnt;
1960                 u_int8_t TmpUchar;
1961
1962                 //Disable oob Tx
1963                 CSR_WRITE_1(sc, RE_IBCR2, CSR_READ_1(sc, RE_IBCR2) & ~(BIT_0));
1964                 WaitCnt = 0;
1965
1966                 //wait oob tx disable
1967                 do {
1968                         TmpUchar = CSR_READ_1(sc, RE_IBISR0);
1969
1970                         if (TmpUchar & ISRIMR_DASH_TYPE2_TX_DISABLE_IDLE) {
1971                                 break;
1972                         }
1973
1974                         DELAY(50);
1975                         WaitCnt++;
1976                 } while(WaitCnt < 2000);
1977
1978                 //Clear ISRIMR_DASH_TYPE2_TX_DISABLE_IDLE
1979                 CSR_WRITE_1(sc, RE_IBISR0, CSR_READ_1(sc, RE_IBISR0) | ISRIMR_DASH_TYPE2_TX_DISABLE_IDLE);
1980         }
1981 }
1982
1983 static void Dash2DisableRx(struct re_softc *sc)
1984 {
1985         //if (!re_check_dash(sc)) return;
1986
1987         if (sc->re_type == MACFG_61 || sc->re_type == MACFG_62 ||
1988             sc->re_type == MACFG_67)
1989                 CSR_WRITE_1(sc, RE_IBCR0, CSR_READ_1(sc, RE_IBCR0) & ~(BIT_0));
1990 }
1991
1992 static void Dash2DisableTxRx(struct re_softc *sc)
1993 {
1994         if (sc->re_type == MACFG_61 || sc->re_type == MACFG_62 ||
1995             sc->re_type == MACFG_67) {
1996                 Dash2DisableTx(sc);
1997                 Dash2DisableRx(sc);
1998         }
1999 }
2000
2001 static void re_disable_now_is_oob(struct re_softc *sc)
2002 {
2003         if (sc->re_hw_supp_now_is_oob_ver == 1)
2004                 CSR_WRITE_1(sc, RE_MCU_CMD, CSR_READ_1(sc, RE_MCU_CMD) & ~RE_NOW_IS_OOB);
2005 }
2006
2007 static void re_exit_oob(struct re_softc *sc)
2008 {
2009         u_int16_t data16;
2010         int i;
2011
2012         CSR_WRITE_1(sc, RE_EECMD, RE_EEMODE_OFF);
2013
2014         switch(sc->re_type) {
2015         case MACFG_61:
2016         case MACFG_62:
2017         case MACFG_67:
2018                 Dash2DisableTxRx(sc);
2019                 break;
2020         }
2021
2022         switch(sc->re_type) {
2023         case MACFG_61:
2024         case MACFG_62:
2025         case MACFG_67:
2026         case MACFG_63:
2027         case MACFG_64:
2028         case MACFG_65:
2029         case MACFG_66:
2030                 re_driver_start(sc);
2031                 break;
2032         }
2033
2034         switch(sc->re_type) {
2035         case MACFG_56:
2036         case MACFG_57:
2037         case MACFG_58:
2038         case MACFG_59:
2039         case MACFG_60:
2040         case MACFG_61:
2041         case MACFG_62:
2042         case MACFG_67:
2043         case MACFG_68:
2044         case MACFG_69:
2045                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) | BIT_3);
2046                 DELAY(2000);
2047
2048                 for (i = 0; i < 10; i++) {
2049                         DELAY(100);
2050                         if (CSR_READ_4(sc, RE_TXCFG) & BIT_11)
2051                                 break;
2052                 }
2053
2054                 if (CSR_READ_1(sc, RE_COMMAND) & (RE_CMD_TX_ENB | RE_CMD_RX_ENB)) {
2055                         DELAY(100);
2056                         CSR_WRITE_1(sc, RE_COMMAND, CSR_READ_1(sc, RE_COMMAND) & ~(RE_CMD_TX_ENB | RE_CMD_RX_ENB));
2057                 }
2058
2059                 for (i = 0; i < 10; i++) {
2060                         DELAY(100);
2061                         if ((CSR_READ_1(sc, RE_MCU_CMD) & (RE_TXFIFO_EMPTY | RE_RXFIFO_EMPTY)) == (RE_TXFIFO_EMPTY | RE_RXFIFO_EMPTY))
2062                                 break;
2063
2064                 }
2065                 break;
2066         }
2067
2068         //Disable realwow function
2069         switch (sc->re_type) {
2070         case MACFG_50:
2071         case MACFG_51:
2072                 CSR_WRITE_4(sc, RE_MCUACCESS, 0xE5A90000);
2073                 CSR_WRITE_4(sc, RE_MCUACCESS, 0xF2100010);
2074                 break;
2075         case MACFG_52:
2076                 CSR_WRITE_4(sc, RE_MCUACCESS, 0xE5A90000);
2077                 CSR_WRITE_4(sc, RE_MCUACCESS, 0xE4640000);
2078                 CSR_WRITE_4(sc, RE_MCUACCESS, 0xF2100010);
2079                 break;
2080         case MACFG_56:
2081         case MACFG_57:
2082                 CSR_WRITE_4(sc, RE_MCUACCESS, 0x605E0000);
2083                 CSR_WRITE_4(sc, RE_MCUACCESS, (0xE05E << 16) | (CSR_READ_4(sc, RE_MCUACCESS) & 0xFFFE));
2084                 CSR_WRITE_4(sc, RE_MCUACCESS, 0xE9720000);
2085                 CSR_WRITE_4(sc, RE_MCUACCESS, 0xF2140010);
2086                 break;
2087         case MACFG_60:
2088                 CSR_WRITE_4(sc, RE_MCUACCESS, 0xE05E00FF);
2089                 CSR_WRITE_4(sc, RE_MCUACCESS, 0xE9720000);
2090                 MP_WriteMcuAccessRegWord(sc, 0xE428, 0x0010);
2091                 break;
2092         }
2093
2094         if (sc->re_hw_supp_now_is_oob_ver >0)
2095                 re_disable_now_is_oob(sc);
2096
2097         switch(sc->re_type) {
2098         case MACFG_52:
2099                 for (i = 0; i < 10; i++) {
2100                         DELAY(100);
2101                         if (CSR_READ_2(sc, 0xD2) & BIT_9)
2102                                 break;
2103                 }
2104
2105                 data16 = MP_ReadMcuAccessRegWord(sc, 0xD4DE) | BIT_15;
2106                 MP_WriteMcuAccessRegWord(sc, 0xD4DE, data16);
2107
2108                 for (i = 0; i < 10; i++) {
2109                         DELAY(100);
2110                         if (CSR_READ_2(sc, 0xD2) & BIT_9)
2111                                 break;
2112                 }
2113                 break;
2114         case MACFG_56:
2115         case MACFG_57:
2116         case MACFG_58:
2117         case MACFG_59:
2118         case MACFG_60:
2119         case MACFG_61:
2120         case MACFG_62:
2121         case MACFG_67:
2122         case MACFG_68:
2123         case MACFG_69:
2124                 data16 = MP_ReadMcuAccessRegWord(sc, 0xE8DE) & ~BIT_14;
2125                 MP_WriteMcuAccessRegWord(sc, 0xE8DE, data16);
2126                 for (i = 0; i < 10; i++) {
2127                         DELAY(100);
2128                         if (CSR_READ_2(sc, 0xD2) & BIT_9)
2129                                 break;
2130                 }
2131
2132                 data16 = MP_ReadMcuAccessRegWord(sc, 0xE8DE) | BIT_15;
2133                 MP_WriteMcuAccessRegWord(sc, 0xE8DE, data16);
2134
2135                 for (i = 0; i < 10; i++) {
2136                         DELAY(100);
2137                         if (CSR_READ_2(sc, 0xD2) & BIT_9)
2138                                 break;
2139                 }
2140                 break;
2141         }
2142
2143         //wait ups resume (phy state 2)
2144         switch(sc->re_type) {
2145         case MACFG_68:
2146         case MACFG_69:
2147                 if (re_is_ups_resume(sc)) {
2148                         re_wait_phy_ups_resume(sc, 2);
2149                         re_clear_ups_resume_bit(sc);
2150                 }
2151                 break;
2152         };
2153
2154         /*
2155         * Config MAC MCU
2156         */
2157         re_hw_mac_mcu_config(sc);
2158 }
2159
2160 static void re_hw_init(struct re_softc *sc)
2161 {
2162         /*
2163         * disable EDT.
2164         */
2165         switch(sc->re_type) {
2166         case MACFG_16:
2167         case MACFG_17:
2168         case MACFG_18:
2169         case MACFG_19:
2170         case MACFG_41:
2171                 CSR_WRITE_1(sc, 0xF4, CSR_READ_1(sc, 0xF4) & ~(BIT_0|BIT_1));
2172                 break;
2173         case MACFG_36:
2174         case MACFG_37:
2175         case MACFG_38:
2176         case MACFG_39:
2177         case MACFG_42:
2178         case MACFG_43:
2179         case MACFG_50:
2180         case MACFG_51:
2181         case MACFG_54:
2182         case MACFG_55:
2183                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) & ~(BIT_0|BIT_1|BIT_2));
2184                 break;
2185         }
2186
2187         switch(sc->re_type) {
2188         case MACFG_5:
2189                 if (CSR_READ_1(sc, RE_CFG2) & 1) {
2190                         CSR_WRITE_4(sc, 0x7C, 0x000FFFFF);
2191                 } else {
2192                         CSR_WRITE_4(sc, 0x7C, 0x000FFF00);
2193                 }
2194                 break;
2195         case MACFG_6:
2196                 if (CSR_READ_1(sc, RE_CFG2) & 1) {
2197                         CSR_WRITE_4(sc, 0x7C, 0x003FFFFF);
2198                 } else {
2199                         CSR_WRITE_4(sc, 0x7C, 0x003FFF00);
2200                 }
2201                 break;
2202         }
2203
2204         switch(sc->re_type) {
2205         case MACFG_33:
2206         case MACFG_36:
2207         case MACFG_37:
2208                 CSR_WRITE_1(sc, 0xF3, CSR_READ_1(sc, 0xF3) | BIT_2);
2209                 break;
2210         }
2211
2212         switch(sc->re_type) {
2213         case MACFG_36:
2214         case MACFG_37:
2215         case MACFG_38:
2216         case MACFG_39:
2217         case MACFG_42:
2218         case MACFG_43:
2219         case MACFG_50:
2220         case MACFG_51:
2221         case MACFG_52:
2222         case MACFG_53:
2223         case MACFG_54:
2224         case MACFG_55:
2225         case MACFG_56:
2226         case MACFG_57:
2227         case MACFG_58:
2228         case MACFG_59:
2229         case MACFG_60:
2230         case MACFG_61:
2231         case MACFG_62:
2232         case MACFG_67:
2233         case MACFG_68:
2234         case MACFG_69:
2235                 CSR_WRITE_1(sc, RE_EECMD, RE_EEMODE_WRITECFG);
2236                 CSR_WRITE_1(sc, RE_CFG5, CSR_READ_1(sc, RE_CFG5) & ~BIT_0);
2237                 CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) & ~BIT_7);
2238                 CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) | BIT_5);
2239                 CSR_WRITE_1(sc, RE_EECMD, RE_EEMODE_OFF);
2240                 break;
2241         }
2242
2243         if (sc->re_if_flags & RL_FLAG_PCIE) {
2244                 uint32_t Data32;
2245                 //Set PCIE uncorrectable error status mask pcie 0x108
2246                 Data32 = MP_ReadPciEConfigSpace(sc, 0xF108);
2247                 Data32 |= BIT_20;
2248                 MP_WritePciEConfigSpace(sc, 0xF108, Data32);
2249         }
2250 }
2251
2252 static void re_get_hw_mac_address(struct re_softc *sc, u_int8_t *eaddr)
2253 {
2254         u_int16_t re_eeid = 0;
2255         u_int8_t read_from_macio = 0;
2256         int i;
2257
2258         switch(sc->re_type) {
2259         case MACFG_50:
2260         case MACFG_51:
2261         case MACFG_52:
2262         case MACFG_53:
2263         case MACFG_56:
2264         case MACFG_57:
2265         case MACFG_58:
2266         case MACFG_59:
2267         case MACFG_60:
2268         case MACFG_61:
2269         case MACFG_62:
2270         case MACFG_67:
2271         case MACFG_68:
2272         case MACFG_69:
2273                 *(u_int32_t *)&eaddr[0]= re_eri_read(sc, 0xE0, 4, ERIAR_ExGMAC);
2274                 *(u_int16_t *)&eaddr[4] = (u_int16_t)re_eri_read(sc, 0xE4, 4, ERIAR_ExGMAC);
2275                 break;
2276         case MACFG_63:
2277         case MACFG_64:
2278         case MACFG_65:
2279         case MACFG_66:
2280                 read_from_macio = 1;
2281                 break;
2282         default:
2283                 re_read_eeprom(sc, (caddr_t)&re_eeid, RE_EE_ID, 1, 0);
2284                 if (re_eeid == 0x8129)
2285                         re_read_eeprom(sc, (caddr_t)&eaddr[0], RE_EE_EADDR, 3, 0);
2286                 else
2287                         read_from_macio = 1;
2288                 break;
2289         }
2290
2291         if (eaddr[0] == 0x00 &&
2292             eaddr[1] == 0x00 &&
2293             eaddr[2] == 0x00 &&
2294             eaddr[3] == 0x00 &&
2295             eaddr[4] == 0x00 &&
2296             eaddr[5] == 0x00) {
2297                 read_from_macio = 1;
2298         }
2299
2300         if (eaddr[0] == 0xFF &&
2301             eaddr[1] == 0xFF &&
2302             eaddr[2] == 0xFF &&
2303             eaddr[3] == 0xFF &&
2304             eaddr[4] == 0xFF &&
2305             eaddr[5] == 0xFF) {
2306                 read_from_macio = 1;
2307         }
2308
2309         if (read_from_macio) {
2310                 for (i = 0; i < ETHER_ADDR_LEN; i++)
2311                         eaddr[i] = CSR_READ_1(sc, RE_IDR0 + i);
2312         }
2313
2314         switch (sc->re_type) {
2315         case MACFG_36:
2316         case MACFG_37:
2317         case MACFG_42:
2318         case MACFG_43:
2319         case MACFG_54:
2320         case MACFG_55:
2321                 for (i = 0; i < ETHER_ADDR_LEN; i++)
2322                         CSR_WRITE_1(sc, RE_SecMAC0 + i, eaddr[i]);
2323                 break;
2324         }
2325 }
2326
2327 static int re_check_mac_version(struct re_softc *sc)
2328 {
2329         device_t dev = sc->dev;
2330         int error = 0;
2331
2332         switch(CSR_READ_4(sc, RE_TXCFG) & 0xFCF00000) {
2333         case 0x00800000:
2334         case 0x04000000:
2335                 sc->re_type = MACFG_3;
2336                 sc->max_jumbo_frame_size = Jumbo_Frame_7k;
2337                 CSR_WRITE_4(sc, RE_RXCFG, 0xFF00);
2338                 break;
2339         case 0x10000000:
2340                 sc->re_type = MACFG_4;
2341                 sc->max_jumbo_frame_size = Jumbo_Frame_7k;
2342                 CSR_WRITE_4(sc, RE_RXCFG, 0xFF00);
2343                 break;
2344         case 0x18000000:
2345                 sc->re_type = MACFG_5;
2346                 sc->max_jumbo_frame_size = Jumbo_Frame_7k;
2347                 CSR_WRITE_4(sc, RE_RXCFG, 0xFF00);
2348                 break;
2349         case 0x98000000:
2350                 sc->re_type = MACFG_6;
2351                 sc->max_jumbo_frame_size = Jumbo_Frame_7k;
2352                 CSR_WRITE_4(sc, RE_RXCFG, 0xFF00);
2353                 break;
2354         case 0x34000000:
2355         case 0xB4000000:
2356                 sc->re_type = MACFG_11;
2357                 sc->max_jumbo_frame_size = ETHERMTU;
2358                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
2359                 break;
2360         case 0x34200000:
2361         case 0xB4200000:
2362                 sc->re_type = MACFG_12;
2363                 sc->max_jumbo_frame_size = ETHERMTU;
2364                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
2365                 break;
2366         case 0x34300000:
2367         case 0xB4300000:
2368                 sc->re_type = MACFG_13;
2369                 sc->max_jumbo_frame_size = ETHERMTU;
2370                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
2371                 break;
2372         case 0x34900000:
2373         case 0x24900000:
2374                 sc->re_type = MACFG_14;
2375                 sc->max_jumbo_frame_size = ETHERMTU;
2376                 sc->re_if_flags |= RL_FLAG_DESCV2;
2377                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
2378                 break;
2379         case 0x34A00000:
2380         case 0x24A00000:
2381                 sc->re_type = MACFG_15;
2382                 sc->max_jumbo_frame_size = ETHERMTU;
2383                 sc->re_if_flags |= RL_FLAG_DESCV2;
2384                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
2385                 break;
2386         case 0x34B00000:
2387         case 0x24B00000:
2388                 sc->re_type = MACFG_16;
2389                 sc->max_jumbo_frame_size = ETHERMTU;
2390                 sc->re_if_flags |= RL_FLAG_DESCV2;
2391                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
2392                 break;
2393         case 0x34C00000:
2394         case 0x24C00000:
2395                 sc->re_type = MACFG_17;
2396                 sc->max_jumbo_frame_size = ETHERMTU;
2397                 sc->re_if_flags |= RL_FLAG_DESCV2;
2398                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
2399                 break;
2400         case 0x34D00000:
2401         case 0x24D00000:
2402                 sc->re_type = MACFG_18;
2403                 sc->max_jumbo_frame_size = ETHERMTU;
2404                 sc->re_if_flags |= RL_FLAG_DESCV2;
2405                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
2406                 break;
2407         case 0x34E00000:
2408         case 0x24E00000:
2409                 sc->re_type = MACFG_19;
2410                 sc->max_jumbo_frame_size = ETHERMTU;
2411                 sc->re_if_flags |= RL_FLAG_DESCV2;
2412                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
2413                 break;
2414         case 0x30000000:
2415                 sc->re_type = MACFG_21;
2416                 sc->max_jumbo_frame_size = Jumbo_Frame_4k;
2417                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
2418                 break;
2419         case 0x38000000:
2420                 sc->re_type = MACFG_22;
2421                 sc->max_jumbo_frame_size = Jumbo_Frame_4k;
2422                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
2423                 break;
2424         case 0x38500000:
2425         case 0xB8500000:
2426         case 0x38700000:
2427         case 0xB8700000:
2428                 sc->re_type = MACFG_23;
2429                 sc->max_jumbo_frame_size = Jumbo_Frame_4k;
2430                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
2431                 break;
2432         case 0x3C000000:
2433                 sc->re_type = MACFG_24;
2434                 sc->max_jumbo_frame_size = Jumbo_Frame_6k;
2435                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
2436                 CSR_WRITE_4(sc, RE_RXCFG, 0xC700);
2437                 break;
2438         case 0x3C200000:
2439                 sc->re_type = MACFG_25;
2440                 sc->max_jumbo_frame_size = Jumbo_Frame_6k;
2441                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
2442                 CSR_WRITE_4(sc, RE_RXCFG, 0xC700);
2443                 break;
2444         case 0x3C400000:
2445                 sc->re_type = MACFG_26;
2446                 sc->max_jumbo_frame_size = Jumbo_Frame_6k;
2447                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
2448                 CSR_WRITE_4(sc, RE_RXCFG, 0xC700);
2449                 break;
2450         case 0x3C900000:
2451                 sc->re_type = MACFG_27;
2452                 sc->max_jumbo_frame_size = Jumbo_Frame_6k;
2453                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
2454                 CSR_WRITE_4(sc, RE_RXCFG, 0xC700);
2455                 break;
2456         case 0x3CB00000:
2457                 sc->re_type = MACFG_28;
2458                 sc->max_jumbo_frame_size = Jumbo_Frame_6k;
2459                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
2460                 CSR_WRITE_4(sc, RE_RXCFG, 0xC700);
2461                 break;
2462         case 0x28100000:
2463                 sc->re_type = MACFG_31;
2464                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2465                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
2466                 CSR_WRITE_4(sc, RE_RXCFG, 0x8700);
2467                 break;
2468         case 0x28200000:
2469                 sc->re_type = MACFG_32;
2470                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2471                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
2472                 CSR_WRITE_4(sc, RE_RXCFG, 0x8700);
2473                 break;
2474         case 0x28300000:
2475                 sc->re_type = MACFG_33;
2476                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2477                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
2478                 CSR_WRITE_4(sc, RE_RXCFG, 0x8700);
2479                 break;
2480         case 0x2C100000:
2481                 sc->re_type = MACFG_36;
2482                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2483                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
2484                 CSR_WRITE_4(sc, RE_RXCFG, 0x8700);
2485                 break;
2486         case 0x2C200000:
2487                 sc->re_type = MACFG_37;
2488                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2489                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
2490                 CSR_WRITE_4(sc, RE_RXCFG, 0x8700);
2491                 break;
2492         case 0x2C800000:
2493                 sc->re_type = MACFG_38;
2494                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2495                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
2496                 CSR_WRITE_4(sc, RE_RXCFG, 0xBF00);
2497                 break;
2498         case 0x2C900000:
2499                 sc->re_type = MACFG_39;
2500                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2501                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
2502                 CSR_WRITE_4(sc, RE_RXCFG, 0xBF00);
2503                 break;
2504         case 0x24000000:
2505                 sc->re_type = MACFG_41;
2506                 sc->max_jumbo_frame_size = ETHERMTU;
2507                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM ;
2508                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
2509                 break;
2510         case 0x40900000:
2511                 sc->re_type = MACFG_42;
2512                 sc->max_jumbo_frame_size = ETHERMTU;
2513                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM ;
2514                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
2515                 break;
2516         case 0x40A00000:
2517         case 0x40B00000:
2518         case 0x40C00000:
2519                 sc->re_type = MACFG_43;
2520                 sc->max_jumbo_frame_size = ETHERMTU;
2521                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM ;
2522                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
2523                 break;
2524         case 0x48000000:
2525                 sc->re_type = MACFG_50;
2526                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2527                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
2528                 CSR_WRITE_4(sc, RE_RXCFG, 0xBF00);
2529                 break;
2530         case 0x48100000:
2531                 sc->re_type = MACFG_51;
2532                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2533                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
2534                 CSR_WRITE_4(sc, RE_RXCFG, 0xBF00);
2535                 break;
2536         case 0x48800000:
2537                 sc->re_type = MACFG_52;
2538                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2539                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
2540                 CSR_WRITE_4(sc, RE_RXCFG, 0xBF00);
2541                 break;
2542         case 0x44000000:
2543                 sc->re_type = MACFG_53;
2544                 sc->max_jumbo_frame_size = ETHERMTU;
2545                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
2546                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
2547                 break;
2548         case 0x44800000:
2549                 sc->re_type = MACFG_54;
2550                 sc->max_jumbo_frame_size = ETHERMTU;
2551                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
2552                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
2553                 break;
2554         case 0x44900000:
2555                 sc->re_type = MACFG_55;
2556                 sc->max_jumbo_frame_size = ETHERMTU;
2557                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
2558                 CSR_WRITE_4(sc, RE_RXCFG, 0xE700);
2559                 break;
2560         case 0x4C000000:
2561                 sc->re_type = MACFG_56;
2562                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2563                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
2564                 CSR_WRITE_4(sc, RE_RXCFG, 0xCF00);
2565                 break;
2566         case 0x4C100000:
2567                 sc->re_type = MACFG_57;
2568                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2569                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
2570                 CSR_WRITE_4(sc, RE_RXCFG, 0xCF00);
2571                 break;
2572         case 0x50800000:
2573                 sc->re_type = MACFG_58;
2574                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2575                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
2576                 CSR_WRITE_4(sc, RE_RXCFG, 0xCF00);
2577                 break;
2578         case 0x50900000:
2579                 sc->re_type = MACFG_59;
2580                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2581                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
2582                 CSR_WRITE_4(sc, RE_RXCFG, 0xCF00);
2583                 break;
2584         case 0x5C800000:
2585                 sc->re_type = MACFG_60;
2586                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2587                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
2588                 CSR_WRITE_4(sc, RE_RXCFG, 0xCF00);
2589                 break;
2590         case 0x50000000:
2591                 sc->re_type = MACFG_61;
2592                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2593                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
2594                 CSR_WRITE_4(sc, RE_RXCFG, 0xCF00);
2595                 break;
2596         case 0x50100000:
2597                 sc->re_type = MACFG_62;
2598                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2599                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
2600                 CSR_WRITE_4(sc, RE_RXCFG, 0xCF00);
2601                 break;
2602         case 0x50200000:
2603                 sc->re_type = MACFG_67;
2604                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2605                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
2606                 CSR_WRITE_4(sc, RE_RXCFG, 0xCF00);
2607                 break;
2608         case 0x28800000:
2609                 sc->re_type = MACFG_63;
2610                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2611                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
2612                 CSR_WRITE_4(sc, RE_RXCFG, 0x8700);
2613                 break;
2614         case 0x28900000:
2615                 sc->re_type = MACFG_64;
2616                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2617                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
2618                 CSR_WRITE_4(sc, RE_RXCFG, 0x8700);
2619                 break;
2620         case 0x28A00000:
2621                 sc->re_type = MACFG_65;
2622                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2623                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
2624                 CSR_WRITE_4(sc, RE_RXCFG, 0x8700);
2625                 break;
2626         case 0x28B00000:
2627                 sc->re_type = MACFG_66;
2628                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2629                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM;
2630                 CSR_WRITE_4(sc, RE_RXCFG, 0x8700);
2631                 break;
2632         case 0x54000000:
2633                 sc->re_type = MACFG_68;
2634                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2635                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
2636                 CSR_WRITE_4(sc, RE_RXCFG, 0xCF00);
2637                 break;
2638         case 0x54100000:
2639                 sc->re_type = MACFG_69;
2640                 sc->max_jumbo_frame_size = Jumbo_Frame_9k;
2641                 sc->re_if_flags |= RL_FLAG_DESCV2 | RL_FLAG_PHYWAKE_PM | RL_FLAG_MAGIC_PACKET_V2;
2642                 CSR_WRITE_4(sc, RE_RXCFG, 0xCF00);
2643                 break;
2644         default:
2645                 device_printf(dev,"unknown device\n");
2646                 sc->re_type = MACFG_FF;
2647                 error = ENXIO;
2648                 break;
2649         }
2650
2651         switch(sc->re_device_id) {
2652         case RT_DEVICEID_8169:
2653         case RT_DEVICEID_8169SC:
2654         case RT_DEVICEID_8168:
2655         case RT_DEVICEID_8161:
2656                 //do nothing
2657                 break;
2658         default:
2659                 sc->max_jumbo_frame_size = ETHERMTU;
2660                 break;
2661         }
2662
2663         return error;
2664 }
2665
2666 static void re_init_software_variable(struct re_softc *sc)
2667 {
2668         switch(sc->re_device_id) {
2669         case RT_DEVICEID_8168:
2670         case RT_DEVICEID_8161:
2671         case RT_DEVICEID_8136:
2672                 sc->re_if_flags |= RL_FLAG_PCIE;
2673                 break;
2674         }
2675
2676         sc->re_rx_mbuf_sz = sc->max_jumbo_frame_size + ETHER_VLAN_ENCAP_LEN + ETHER_HDR_LEN + ETHER_CRC_LEN + RE_ETHER_ALIGN + 1;
2677
2678         if (sc->re_rx_mbuf_sz > MJUM9BYTES) {
2679                 sc->max_jumbo_frame_size -= (sc->re_rx_mbuf_sz - MJUM9BYTES);
2680                 sc->re_rx_mbuf_sz = MJUM9BYTES;
2681         }
2682
2683         switch(sc->re_type) {
2684         case MACFG_69: {
2685                 u_int16_t ioffset_p3, ioffset_p2, ioffset_p1, ioffset_p0;
2686                 u_int16_t TmpUshort;
2687
2688                 MP_WriteMcuAccessRegWord(sc, 0xDD02, 0x807D);
2689
2690                 TmpUshort = MP_ReadMcuAccessRegWord(sc, 0xDD02);
2691                 ioffset_p3 = ((TmpUshort & BIT_7) >>7);
2692                 ioffset_p3 <<= 3;
2693                 TmpUshort = MP_ReadMcuAccessRegWord(sc, 0xDD00);
2694
2695                 ioffset_p3 |= ((TmpUshort & (BIT_15 | BIT_14 | BIT_13))>>13);
2696
2697                 ioffset_p2 = ((TmpUshort & (BIT_12|BIT_11|BIT_10|BIT_9))>>9);
2698                 ioffset_p1 = ((TmpUshort & (BIT_8|BIT_7|BIT_6|BIT_5))>>5);
2699
2700                 ioffset_p0 = ((TmpUshort & BIT_4) >>4);
2701                 ioffset_p0 <<= 3;
2702                 ioffset_p0 |= (TmpUshort & (BIT_2| BIT_1 | BIT_0));
2703
2704                 if ((ioffset_p3 == 0x0F) && (ioffset_p2 == 0x0F) && (ioffset_p1 == 0x0F) && (ioffset_p0 == 0x0F)) {
2705                         sc->RequireAdcBiasPatch = FALSE;
2706                 } else {
2707                         sc->RequireAdcBiasPatch = TRUE;
2708                         sc->AdcBiasPatchIoffset = (ioffset_p3<<12)|(ioffset_p2<<8)|(ioffset_p1<<4)|(ioffset_p0);
2709                 }
2710         }
2711         break;
2712         }
2713
2714         switch(sc->re_type) {
2715         case MACFG_68:
2716         case MACFG_69: {
2717                 u_int16_t rg_saw_cnt;
2718
2719                 MP_WritePhyUshort(sc, 0x1F, 0x0C42);
2720                 rg_saw_cnt = MP_ReadPhyUshort(sc, 0x13);
2721                 rg_saw_cnt &= ~(BIT_15|BIT_14);
2722                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
2723
2724                 if (rg_saw_cnt > 0) {
2725                         sc->SwrCnt1msIni = 16000000/rg_saw_cnt;
2726                         sc->SwrCnt1msIni &= 0x0FFF;
2727
2728                         sc->RequireAdjustUpsTxLinkPulseTiming = TRUE;
2729                 }
2730         }
2731         break;
2732         }
2733
2734         switch(sc->re_type) {
2735         case MACFG_31:
2736         case MACFG_32:
2737         case MACFG_33:
2738         case MACFG_36:
2739         case MACFG_37:
2740         case MACFG_38:
2741         case MACFG_39:
2742         case MACFG_42:
2743         case MACFG_43:
2744         case MACFG_50:
2745         case MACFG_51:
2746         case MACFG_52:
2747         case MACFG_53:
2748         case MACFG_54:
2749         case MACFG_55:
2750         case MACFG_56:
2751         case MACFG_57:
2752         case MACFG_58:
2753         case MACFG_59:
2754         case MACFG_60:
2755         case MACFG_61:
2756         case MACFG_62:
2757         case MACFG_63:
2758         case MACFG_64:
2759         case MACFG_65:
2760         case MACFG_66:
2761         case MACFG_67:
2762         case MACFG_68:
2763         case MACFG_69:
2764                 sc->re_hw_enable_msi_msix = TRUE;
2765                 break;
2766         }
2767
2768         switch(sc->re_type) {
2769         case MACFG_3:
2770         case MACFG_4:
2771         case MACFG_5:
2772         case MACFG_6:
2773         case MACFG_11:
2774         case MACFG_12:
2775         case MACFG_13:
2776         case MACFG_21:
2777         case MACFG_22:
2778         case MACFG_23:
2779         case MACFG_24:
2780         case MACFG_25:
2781         case MACFG_26:
2782         case MACFG_27:
2783         case MACFG_28:
2784         case MACFG_41:
2785         case MACFG_42:
2786         case MACFG_43:
2787         case MACFG_54:
2788         case MACFG_55:
2789                 sc->re_coalesce_tx_pkt = TRUE;
2790                 break;
2791         }
2792
2793         switch(sc->re_type) {
2794         case MACFG_36:
2795         case MACFG_37:
2796         case MACFG_38:
2797         case MACFG_39:
2798         case MACFG_42:
2799         case MACFG_43:
2800         case MACFG_50:
2801         case MACFG_51:
2802         case MACFG_52:
2803         case MACFG_53:
2804         case MACFG_54:
2805         case MACFG_55:
2806         case MACFG_56:
2807         case MACFG_57:
2808         case MACFG_58:
2809         case MACFG_59:
2810         case MACFG_60:
2811         case MACFG_61:
2812         case MACFG_62:
2813         case MACFG_67:
2814         case MACFG_68:
2815         case MACFG_69:
2816                 sc->re_hw_supp_now_is_oob_ver = 1;
2817                 break;
2818         }
2819
2820         sc->re_8169_MacVersion=(CSR_READ_4(sc, RE_TXCFG)&0x7c800000)>>25;               /* Get bit 26~30        */
2821         sc->re_8169_MacVersion|=((CSR_READ_4(sc, RE_TXCFG)&0x00800000)!=0 ? 1:0);       /* Get bit 23           */
2822         DBGPRINT1(sc->re_unit,"8169 Mac Version %d",sc->re_8169_MacVersion);
2823
2824         /* Rtl8169s single chip detected */
2825         if (sc->re_type == MACFG_3) {
2826                 RE_LOCK(sc);
2827                 sc->re_8169_PhyVersion=(MP_ReadPhyUshort(sc, 0x03)&0x000f);
2828                 DBGPRINT1(sc->re_unit,"8169 Phy Version %d",sc->re_8169_PhyVersion);
2829                 RE_UNLOCK(sc);
2830         }
2831
2832 #ifndef __DragonFly__
2833         sc->link_state = LINK_STATE_UNKNOWN;
2834 #endif
2835 }
2836
2837 static void re_hw_d3_para(struct re_softc *sc)
2838 {
2839         if (sc->re_type == MACFG_59 || sc->re_type == MACFG_60 ||
2840             sc->re_type == MACFG_62 || sc->re_type == MACFG_67 ||
2841             sc->re_type == MACFG_68 || sc->re_type == MACFG_69) {
2842                 MP_WritePhyOcpRegWord(sc, 0x0C41, 0x13, 0x0000);
2843                 MP_WritePhyOcpRegWord(sc, 0x0C41, 0x13, 0x0500);
2844         }
2845 }
2846
2847 #ifndef __DragonFly__
2848 /*
2849 * Attach the interface. Allocate softc structures, do ifmedia
2850 * setup and ethernet/BPF attach.
2851 */
2852 static int re_attach(device_t dev)
2853 {
2854         /*int                   s;*/
2855         u_char                  eaddr[ETHER_ADDR_LEN];
2856         u_int32_t               command;
2857         struct re_softc         *sc;
2858         struct ifnet            *ifp;
2859         int                     unit, error = 0, rid, i;
2860 //      int                     mac_version;
2861 //      int                     mode;
2862 //      u_int8_t                data8;
2863         int     reg;
2864         int             msic=0, msixc=0;
2865
2866         /*s = splimp();*/
2867
2868         sc = device_get_softc(dev);
2869         unit = device_get_unit(dev);
2870         bzero(sc, sizeof(struct re_softc));
2871         RE_LOCK_INIT(sc,device_get_nameunit(dev));
2872         sc->dev = dev;
2873
2874         sc->driver_detach = 0;
2875
2876         sc->re_device_id = pci_get_device(dev);
2877         sc->re_revid = pci_get_revid(dev);
2878         pci_enable_busmaster(dev);
2879
2880         /*
2881          * Map control/status registers.
2882          */
2883         command = pci_read_config(dev, PCIR_COMMAND, 4);
2884         command |= (PCIM_CMD_PORTEN|PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN);
2885         pci_write_config(dev, PCIR_COMMAND, command, 4);
2886         command = pci_read_config(dev, PCIR_COMMAND, 4);
2887
2888         if (prefer_iomap == 0) {
2889                 sc->re_res_id = PCIR_BAR(1);
2890                 sc->re_res_type = SYS_RES_MEMORY;
2891                 /* PCIE NIC use different BARs. */
2892                 if (sc->re_device_id == RT_DEVICEID_8168 || sc->re_device_id == RT_DEVICEID_8161 ||
2893                     sc->re_device_id == RT_DEVICEID_8136)
2894                         sc->re_res_id = PCIR_BAR(2);
2895         } else {
2896                 sc->re_res_id = PCIR_BAR(0);
2897                 sc->re_res_type = SYS_RES_IOPORT;
2898         }
2899         sc->re_res = bus_alloc_resource(dev, sc->re_res_type, &sc->re_res_id,
2900                                         0, ~0, 1, RF_ACTIVE);
2901         if (sc->re_res == NULL && prefer_iomap == 0) {
2902                 sc->re_res_id = PCIR_BAR(0);
2903                 sc->re_res_type = SYS_RES_IOPORT;
2904                 sc->re_res = bus_alloc_resource(dev, sc->re_res_type, &sc->re_res_id,
2905                                                 0, ~0, 1, RF_ACTIVE);
2906         }
2907
2908         if (sc->re_res == NULL) {
2909                 device_printf(dev,"couldn't map ports/memory\n");
2910                 error = ENXIO;
2911                 goto fail;
2912         }
2913
2914         if (sc->re_res_type == SYS_RES_IOPORT)
2915                 device_printf(dev, "Using I/O Ports\n");
2916         else
2917                 device_printf(dev, "Using Memory Mapping!\n");
2918
2919         sc->re_btag = rman_get_bustag(sc->re_res);
2920         sc->re_bhandle = rman_get_bushandle(sc->re_res);
2921
2922         error = re_check_mac_version(sc);
2923
2924         if (error) {
2925                 goto fail;
2926         }
2927
2928         re_init_software_variable(sc);
2929
2930 #if OS_VER >= VERSION(7,0)
2931         msic = pci_msi_count(dev);
2932         msixc = pci_msix_count(dev);
2933         if (pci_find_cap(dev, PCIY_EXPRESS, &reg) == 0) {
2934                 sc->re_if_flags |= RL_FLAG_PCIE;
2935                 sc->re_expcap = reg;
2936         } else {
2937                 sc->re_if_flags &= ~RL_FLAG_PCIE;
2938                 sc->re_expcap = 0;
2939         }
2940
2941         //device_printf(dev, "MSI count : %d\n", msic);
2942         //device_printf(dev, "MSI-X count : %d\n", msixc);
2943         if (sc->re_hw_enable_msi_msix == FALSE) {
2944                 msixc = 0;
2945                 msic = 0;
2946         }
2947         if (msix_disable > 0)
2948                 msixc = 0;
2949         if (msi_disable > 0)
2950                 msic = 0;
2951
2952         /* Prefer MSI-X to MSI. */
2953         if (msixc > 0) {
2954                 rid = PCIR_BAR(4);
2955                 msixc = RL_MSI_MESSAGES;
2956                 sc->re_res_pba = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
2957                                                         &rid, RF_ACTIVE);
2958                 if (sc->re_res_pba == NULL) {
2959                         device_printf(dev,
2960                                       "could not allocate MSI-X PBA resource\n");
2961                 }
2962                 if (sc->re_res_pba != NULL &&
2963                     pci_alloc_msix(dev, &msixc) == 0) {
2964                         if (msixc == RL_MSI_MESSAGES) {
2965                                 device_printf(dev, "Using %d MSI-X message\n",
2966                                               msixc);
2967                                 sc->re_if_flags |= RL_FLAG_MSIX;
2968                         } else
2969                                 pci_release_msi(dev);
2970                 }
2971                 if ((sc->re_if_flags & RL_FLAG_MSIX) == 0) {
2972                         if (sc->re_res_pba != NULL)
2973                                 bus_release_resource(dev, SYS_RES_MEMORY, rid,
2974                                                      sc->re_res_pba);
2975                         sc->re_res_pba = NULL;
2976                         msixc = 0;
2977                 }
2978         }
2979
2980         /* Prefer MSI to INTx. */
2981         if (msixc == 0 && msic > 0) {
2982                 msic = RL_MSI_MESSAGES;
2983                 if (pci_alloc_msi(dev, &msic) == 0) {
2984                         if (msic == RL_MSI_MESSAGES) {
2985                                 device_printf(dev, "Using %d MSI message\n",
2986                                               msic);
2987                                 sc->re_if_flags |= RL_FLAG_MSI;
2988                         } else
2989                                 pci_release_msi(dev);
2990                 }
2991                 if ((sc->re_if_flags & RL_FLAG_MSI) == 0)
2992                         msic = 0;
2993         }
2994 #endif //OS_VER >= VERSION(7,0)
2995
2996         if ((sc->re_if_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) {
2997                 rid = 0;
2998                 sc->re_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1,
2999                                                 RF_SHAREABLE | RF_ACTIVE);
3000
3001                 if (sc->re_irq == NULL) {
3002                         device_printf(dev,"couldn't map interrupt\n");
3003                         error = ENXIO;
3004                         goto fail;
3005                 }
3006                 device_printf(dev, "Using line-based interrupt\n");
3007         } else {
3008                 rid = 1;
3009                 sc->re_irq = bus_alloc_resource_any(dev,
3010                                                     SYS_RES_IRQ, &rid, RF_ACTIVE);
3011                 if (sc->re_irq == NULL) {
3012                         device_printf(dev,
3013                                       "couldn't allocate IRQ resources for "
3014                                       "message %d\n", rid);
3015                         error = ENXIO;
3016                         goto fail;
3017                 }
3018         }
3019
3020 #if OS_VER >= VERSION(7,3)
3021         /* Disable ASPM L0S/L1 and Clock Request. */
3022         if (sc->re_expcap != 0) {
3023                 u_int32_t               cap, ctl;
3024                 cap = pci_read_config(dev, sc->re_expcap +
3025                                       RE_PCIER_LINK_CAP, 2);
3026                 if ((cap & RE_PCIEM_LINK_CAP_ASPM) != 0) {
3027                         ctl = pci_read_config(dev, sc->re_expcap +
3028                                               RE_PCIER_LINK_CTL, 2);
3029                         if ((ctl & 0x0103) != 0) {
3030                                 ctl &= ~0x0103;
3031                                 pci_write_config(dev, sc->re_expcap +
3032                                                  RE_PCIER_LINK_CTL, ctl, 2);
3033                                 device_printf(dev, "ASPM disabled\n");
3034                         }
3035                 } else
3036                         device_printf(dev, "no ASPM capability\n");
3037         }
3038 #endif //OS_VER >= VERSION(7,3)
3039
3040         re_init_timer(sc);
3041
3042         RE_LOCK(sc);
3043         re_exit_oob(sc);
3044         re_hw_init(sc);
3045         RE_UNLOCK(sc);
3046
3047         /*
3048          * Reset the adapter. Only take the lock here as it's needed in
3049          * order to call re_reset().
3050          */
3051         RE_LOCK(sc);
3052         re_reset(sc);
3053         RE_UNLOCK(sc);
3054
3055         /* Get station address. */
3056         re_get_hw_mac_address(sc, eaddr);
3057
3058         /*
3059          * A RealTek chip was detected. Inform the world.
3060          */
3061         device_printf(dev,"version:1.92\n");
3062         device_printf(dev,"Ethernet address: %6D\n", eaddr, ":");
3063         printf("\nThis product is covered by one or more of the following patents: \
3064            \nUS6,570,884, US6,115,776, and US6,327,625.\n");
3065
3066         sc->re_unit = unit;
3067
3068 #if OS_VER < VERSION(6,0)
3069         bcopy(eaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
3070 #endif
3071
3072         if (sc->re_type == MACFG_3) {   /* Change PCI Latency time*/
3073                 pci_write_config(dev, RE_PCI_LATENCY_TIMER, 0x40, 1);
3074         }
3075
3076         error = bus_dma_tag_create(
3077 #if OS_VER < VERSION(7,0)
3078                         NULL,
3079 #else
3080                         bus_get_dma_tag(dev),           /* parent */
3081 #endif
3082                         1, 0,           /* alignment, boundary */
3083                         BUS_SPACE_MAXADDR,              /* lowaddr */
3084                         BUS_SPACE_MAXADDR,              /* highaddr */
3085                         NULL, NULL,                     /* filter, filterarg */
3086                         BUS_SPACE_MAXSIZE_32BIT,        /* maxsize */
3087                         0,                              /* nsegments */
3088                         BUS_SPACE_MAXSIZE_32BIT,        /* maxsegsize */
3089                         0,                              /* flags */
3090                         NULL, NULL,                     /* lockfunc, lockarg */
3091                         &sc->re_parent_tag);
3092
3093         i = roundup2(sizeof(union RxDesc)*RE_RX_BUF_NUM, RE_DESC_ALIGN);
3094         error = bus_dma_tag_create(
3095                         sc->re_parent_tag,
3096                         RE_DESC_ALIGN, 0,               /* alignment, boundary */
3097                         BUS_SPACE_MAXADDR,              /* lowaddr */
3098                         BUS_SPACE_MAXADDR,              /* highaddr */
3099                         NULL, NULL,                     /* filter, filterarg */
3100                         i,                              /* maxsize */
3101                         1,                              /* nsegments */
3102                         i,                              /* maxsegsize */
3103                         0,                              /* flags */
3104                         NULL, NULL,                     /* lockfunc, lockarg */
3105                         &sc->re_desc.rx_desc_tag);
3106         if (error) {
3107                 device_printf(dev,"bus_dma_tag_create fail\n");
3108                 goto fail;
3109         }
3110
3111         error = bus_dmamem_alloc(sc->re_desc.rx_desc_tag,
3112                                  (void**) &sc->re_desc.rx_desc,
3113                                  BUS_DMA_WAITOK|BUS_DMA_COHERENT|BUS_DMA_ZERO,
3114                                  &sc->re_desc.rx_desc_dmamap);
3115         if (error) {
3116                 device_printf(dev,"bus_dmamem_alloc fail\n");
3117                 goto fail;
3118         }
3119
3120         i = roundup2(sizeof(union TxDesc)*RE_TX_BUF_NUM, RE_DESC_ALIGN);
3121         error = bus_dma_tag_create(
3122                         sc->re_parent_tag,
3123                         RE_DESC_ALIGN, 0,               /* alignment, boundary */
3124                         BUS_SPACE_MAXADDR,              /* lowaddr */
3125                         BUS_SPACE_MAXADDR,              /* highaddr */
3126                         NULL, NULL,                     /* filter, filterarg */
3127                         i,                              /* maxsize */
3128                         1,                              /* nsegments */
3129                         i,                              /* maxsegsize */
3130                         0,                              /* flags */
3131                         NULL, NULL,                     /* lockfunc, lockarg */
3132                         &sc->re_desc.tx_desc_tag);
3133         if (error) {
3134                 device_printf(dev,"bus_dma_tag_create fail\n");
3135                 goto fail;
3136         }
3137
3138         error = bus_dmamem_alloc(sc->re_desc.tx_desc_tag,
3139                                  (void**) &sc->re_desc.tx_desc,
3140                                  BUS_DMA_WAITOK|BUS_DMA_COHERENT|BUS_DMA_ZERO,
3141                                  &sc->re_desc.tx_desc_dmamap);
3142
3143         if (error) {
3144                 device_printf(dev,"bus_dmamem_alloc fail\n");
3145                 goto fail;
3146         }
3147
3148         RE_LOCK(sc);
3149         re_phy_power_up(dev);
3150         re_hw_phy_config(sc);
3151         re_clrwol(sc);
3152         RE_UNLOCK(sc);
3153
3154         sc->re_tx_cstag =1;
3155         sc->re_rx_cstag =1;
3156
3157 #if OS_VER < VERSION(6,0)
3158         ifp = &sc->arpcom.ac_if;
3159 #else
3160         ifp = sc->re_ifp = if_alloc(IFT_ETHER);
3161         if (ifp == NULL) {
3162                 device_printf(dev, "can not if_alloc()\n");
3163                 error = ENOSPC;
3164                 goto fail;
3165         }
3166 #endif
3167         ifp->if_softc = sc;
3168 #if OS_VER < VERSION(5,3)
3169         ifp->if_unit = unit;
3170         ifp->if_name = "re";
3171 #else
3172         if_initname(ifp, device_get_name(dev), device_get_unit(dev));
3173 #endif
3174         ifp->if_mtu = ETHERMTU;
3175         ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
3176         ifp->if_ioctl = re_ioctl;
3177         ifp->if_output = ether_output;
3178         ifp->if_start = re_start;
3179 #if OS_VER < VERSION(7,0)
3180         ifp->if_watchdog = re_watchdog;
3181 #endif
3182         if ((sc->re_type == MACFG_24) || (sc->re_type == MACFG_25) || (sc->re_type == MACFG_26))
3183                 ifp->if_hwassist |= CSUM_TCP | CSUM_UDP;
3184         else
3185                 ifp->if_hwassist |= RE_CSUM_FEATURES;
3186
3187         ifp->if_capabilities = IFCAP_HWCSUM;
3188         ifp->if_capenable = ifp->if_capabilities;
3189         CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) |RL_RxChkSum);
3190         ifp->if_init = re_init;
3191         /* VLAN capability setup */
3192         ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING;
3193         ifp->if_capenable = ifp->if_capabilities;
3194
3195         /* Enable WOL if PM is supported. */
3196         if (pci_find_cap(sc->dev, PCIY_PMG, &reg) == 0)
3197                 ifp->if_capabilities |= IFCAP_WOL;
3198         ifp->if_capenable = ifp->if_capabilities;
3199         ifp->if_capenable &= ~(IFCAP_WOL_UCAST | IFCAP_WOL_MCAST);
3200
3201         RE_LOCK(sc);
3202         set_rxbufsize(sc);
3203         error =re_alloc_buf(sc);
3204
3205         if (error) {
3206                 RE_UNLOCK(sc);
3207                 goto fail;
3208         }
3209         /* Init descriptors. */
3210         re_var_init(sc);
3211
3212         RE_UNLOCK(sc);
3213
3214         switch(sc->re_device_id) {
3215         case RT_DEVICEID_8169:
3216         case RT_DEVICEID_8169SC:
3217         case RT_DEVICEID_8168:
3218         case RT_DEVICEID_8161:
3219                 ifp->if_baudrate = 1000000000;
3220                 break;
3221
3222         default:
3223                 ifp->if_baudrate = 100000000;
3224                 break;
3225         }
3226         IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
3227         ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN;
3228         IFQ_SET_READY(&ifp->if_snd);
3229
3230 #if OS_VER>=VERSION(7,0)
3231         TASK_INIT(&sc->re_inttask, 0, re_int_task, sc);
3232 #endif
3233
3234         /*
3235          * Call MI attach routine.
3236          */
3237         /*#if OS_VER < VERSION(5, 1)*/
3238 #if OS_VER < VERSION(4,9)
3239         ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
3240 #else
3241         ether_ifattach(ifp, eaddr);
3242 #endif
3243
3244 #if OS_VER < VERSION(7,0)
3245         error = bus_setup_intr(dev, sc->re_irq, INTR_TYPE_NET,
3246                                re_intr, sc, &sc->re_intrhand);
3247 #else
3248         error = bus_setup_intr(dev, sc->re_irq, INTR_TYPE_NET|INTR_MPSAFE,
3249                                re_intr, NULL, sc, &sc->re_intrhand);
3250 #endif
3251
3252         if (error) {
3253 #if OS_VER < VERSION(4,9)
3254                 ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
3255 #else
3256                 ether_ifdetach(ifp);
3257 #endif
3258                 device_printf(dev,"couldn't set up irq\n");
3259                 goto fail;
3260         }
3261
3262         /*
3263          * Specify the media types supported by this adapter and register
3264          * callbacks to update media and link information
3265          */
3266         ifmedia_init(&sc->media, IFM_IMASK, re_ifmedia_upd, re_ifmedia_sts);
3267         ifmedia_add(&sc->media, IFM_ETHER | IFM_10_T, 0, NULL);
3268         ifmedia_add(&sc->media, IFM_ETHER | IFM_10_T | IFM_FDX, 0, NULL);
3269         ifmedia_add(&sc->media, IFM_ETHER | IFM_100_TX, 0, NULL);
3270         ifmedia_add(&sc->media, IFM_ETHER | IFM_100_TX | IFM_FDX, 0, NULL);
3271         switch(sc->re_device_id) {
3272         case RT_DEVICEID_8169:
3273         case RT_DEVICEID_8169SC:
3274         case RT_DEVICEID_8168:
3275         case RT_DEVICEID_8161:
3276                 ifmedia_add(&sc->media, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL);
3277                 ifmedia_add(&sc->media, IFM_ETHER | IFM_1000_T, 0, NULL);
3278                 break;
3279
3280         default:
3281                 break;
3282         }
3283         ifmedia_add(&sc->media, IFM_ETHER | IFM_AUTO, 0, NULL);
3284         ifmedia_set(&sc->media, IFM_ETHER | IFM_AUTO);
3285         sc->media.ifm_media = IFM_ETHER | IFM_AUTO;
3286         re_ifmedia_upd(ifp);
3287
3288 fail:
3289         if (error)
3290                 re_detach(dev);
3291
3292         return(error);
3293 }
3294
3295 static int re_detach(device_t dev)
3296 {
3297         struct re_softc         *sc;
3298         struct ifnet            *ifp;
3299         /*int                   s;*/
3300         int                     i;
3301         int                     rid;
3302
3303         /*s = splimp();*/
3304
3305         sc = device_get_softc(dev);
3306
3307         ifp = RE_GET_IFNET(sc);
3308
3309         /* These should only be active if attach succeeded */
3310         if (device_is_attached(dev)) {
3311                 RE_LOCK(sc);
3312                 re_stop(sc);
3313                 RE_UNLOCK(sc);
3314 #if OS_VER>=VERSION(7,0)
3315                 taskqueue_drain(taskqueue_fast, &sc->re_inttask);
3316 #endif
3317 #if OS_VER < VERSION(4,9)
3318                 ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
3319 #else
3320                 ether_ifdetach(ifp);
3321 #endif
3322         }
3323
3324         bus_generic_detach(dev);
3325
3326         sc->driver_detach = 1;
3327
3328         if (sc->re_intrhand)
3329                 bus_teardown_intr(dev, sc->re_irq, sc->re_intrhand);
3330
3331 #if OS_VER>=VERSION(6,0)
3332         if (ifp)
3333                 if_free(ifp);
3334 #endif
3335
3336         if ((sc->re_if_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0)
3337                 rid = 0;
3338         else
3339                 rid = 1;
3340         if (sc->re_irq) {
3341                 bus_release_resource(dev, SYS_RES_IRQ, rid, sc->re_irq);
3342                 sc->re_irq = NULL;
3343         }
3344         if ((sc->re_if_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) != 0)
3345                 pci_release_msi(dev);
3346         if (sc->re_res_pba) {
3347                 rid = PCIR_BAR(4);
3348                 bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->re_res_pba);
3349         }
3350         if (sc->re_res)
3351                 bus_release_resource(dev, sc->re_res_type, sc->re_res_id, sc->re_res);
3352
3353         if (sc->re_desc.re_rx_mtag) {
3354                 for (i = 0; i < RE_RX_BUF_NUM; i++) {
3355                         if (sc->re_desc.rx_buf[i]!=NULL) {
3356                                 bus_dmamap_sync(sc->re_desc.re_rx_mtag,
3357                                                 sc->re_desc.re_rx_dmamap[i],
3358                                                 BUS_DMASYNC_POSTREAD);
3359                                 bus_dmamap_unload(sc->re_desc.re_rx_mtag,
3360                                                   sc->re_desc.re_rx_dmamap[i]);
3361                                 bus_dmamap_destroy(sc->re_desc.re_rx_mtag,
3362                                                    sc->re_desc.re_rx_dmamap[i]);
3363                                 m_freem(sc->re_desc.rx_buf[i]);
3364                                 sc->re_desc.rx_buf[i] =NULL;
3365                         }
3366                 }
3367                 bus_dma_tag_destroy(sc->re_desc.re_rx_mtag);
3368                 sc->re_desc.re_rx_mtag =0;
3369         }
3370
3371         if (sc->re_desc.re_tx_mtag) {
3372                 for (i = 0; i < RE_TX_BUF_NUM; i++) {
3373                         bus_dmamap_destroy(sc->re_desc.re_tx_mtag,
3374                                            sc->re_desc.re_tx_dmamap[i]);
3375                 }
3376                 bus_dma_tag_destroy(sc->re_desc.re_tx_mtag);
3377                 sc->re_desc.re_tx_mtag =0;
3378         }
3379
3380         if (sc->re_desc.rx_desc_tag) {
3381                 bus_dmamap_sync(sc->re_desc.rx_desc_tag,
3382                                 sc->re_desc.rx_desc_dmamap,
3383                                 BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
3384                 bus_dmamap_unload(sc->re_desc.rx_desc_tag,
3385                                   sc->re_desc.rx_desc_dmamap);
3386                 bus_dmamem_free(sc->re_desc.rx_desc_tag,
3387                                 sc->re_desc.rx_desc,
3388                                 sc->re_desc.rx_desc_dmamap);
3389                 bus_dma_tag_destroy(sc->re_desc.rx_desc_tag);
3390         }
3391
3392         if (sc->re_desc.tx_desc_tag) {
3393                 bus_dmamap_sync(sc->re_desc.tx_desc_tag,
3394                                 sc->re_desc.tx_desc_dmamap,
3395                                 BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
3396                 bus_dmamap_unload(sc->re_desc.tx_desc_tag,
3397                                   sc->re_desc.tx_desc_dmamap);
3398                 bus_dmamem_free(sc->re_desc.tx_desc_tag,
3399                                 sc->re_desc.tx_desc,
3400                                 sc->re_desc.tx_desc_dmamap);
3401                 bus_dma_tag_destroy(sc->re_desc.tx_desc_tag);
3402         }
3403
3404         if (sc->re_parent_tag) {
3405                 bus_dma_tag_destroy(sc->re_parent_tag);
3406         }
3407
3408         /*splx(s);*/
3409         RE_LOCK_DESTROY(sc);
3410
3411         return(0);
3412 }
3413 #endif  /* !__DragonFly__ */
3414
3415 #ifndef __DragonFly__
3416 static void
3417 re_link_state_change(struct ifnet *ifp, int link_state)
3418 {
3419 #if OS_VER>=VERSION(6,0)
3420         if_link_state_change(ifp, link_state);
3421 #else
3422         ifp->if_link_state = link_state
3423 #endif
3424 }
3425
3426 /*
3427   * Device suspend routine.  Stop the interface and save some PCI
3428   * settings in case the BIOS doesn't restore them properly on
3429   * resume.
3430   */
3431 static int
3432 re_suspend(device_t dev)
3433 {
3434         struct re_softc         *sc;
3435         struct ifnet            *ifp;
3436
3437         sc = device_get_softc(dev);
3438         RE_LOCK(sc);
3439         ifp = RE_GET_IFNET(sc);
3440         sc->re_link_chg_det = 0;
3441         re_stop(sc);
3442         re_hw_d3_para(sc);
3443         re_setwol(sc);
3444         sc->suspended = 1;
3445         sc->link_state = LINK_STATE_UNKNOWN;
3446         re_link_state_change(ifp, sc->link_state);
3447         sc->prohibit_access_reg = 1;
3448         RE_UNLOCK(sc);
3449
3450         return (0);
3451 }
3452
3453 /*
3454  * Device resume routine.  Restore some PCI settings in case the BIOS
3455  * doesn't, re-enable busmastering, and restart the interface if
3456  * appropriate.
3457  */
3458 static int
3459 re_resume(device_t dev)
3460 {
3461         struct re_softc         *sc;
3462         struct ifnet            *ifp;
3463
3464         sc = device_get_softc(dev);
3465
3466         RE_LOCK(sc);
3467
3468         ifp = RE_GET_IFNET(sc);
3469
3470         sc->prohibit_access_reg = 0;
3471
3472         re_exit_oob(sc);
3473
3474         re_hw_init(sc);
3475
3476         re_reset(sc);
3477
3478         re_phy_power_up(dev);
3479
3480         re_hw_phy_config(sc);
3481
3482         /*
3483          * Clear WOL matching such that normal Rx filtering
3484          * wouldn't interfere with WOL patterns.
3485          */
3486         re_clrwol(sc);
3487
3488         RE_UNLOCK(sc);
3489
3490         RE_LOCK(sc);
3491         re_ifmedia_upd(ifp);
3492         sc->suspended = 0;
3493         if (ifp->if_flags & IFF_UP) {
3494                 sc->re_link_chg_det = 1;
3495                 re_start_timer(sc);
3496         }
3497         RE_UNLOCK(sc);
3498
3499         return (0);
3500 }
3501 #endif  /* !__DragonFly__ */
3502
3503
3504 static void
3505 ClearAndSetPCIePhyBit(
3506         struct re_softc *sc,
3507         u_int8_t   addr,
3508         u_int16_t   clearmask,
3509         u_int16_t   setmask
3510 )
3511 {
3512         u_int16_t EphyValue;
3513
3514         EphyValue = MP_ReadEPhyUshort(sc, addr);
3515         EphyValue &= ~clearmask;
3516         EphyValue |= setmask;
3517         MP_WriteEPhyUshort(sc, addr, EphyValue);
3518 }
3519
3520 static void
3521 ClearPCIePhyBit(
3522         struct re_softc *sc,
3523         u_int8_t   addr,
3524         u_int16_t   mask
3525 )
3526 {
3527         ClearAndSetPCIePhyBit(sc,
3528                               addr,
3529                               mask,
3530                               0
3531                              );
3532 }
3533
3534 static void
3535 SetPCIePhyBit(
3536         struct re_softc *sc,
3537         u_int8_t   addr,
3538         u_int16_t   mask
3539 )
3540 {
3541         ClearAndSetPCIePhyBit(sc,
3542                               addr,
3543                               0,
3544                               mask
3545                              );
3546 }
3547
3548 #ifndef __DragonFly__
3549 /*
3550  * Stop all chip I/O so that the kernel's probe routines don't
3551  * get confused by errant DMAs when rebooting.
3552  */
3553 static int re_shutdown(dev)     /* The same with re_stop(sc) */
3554 device_t                dev;
3555 {
3556         struct re_softc         *sc;
3557
3558         sc = device_get_softc(dev);
3559
3560         switch(sc->re_type) {
3561         case MACFG_61:
3562         case MACFG_62:
3563         case MACFG_67:
3564         case MACFG_63:
3565         case MACFG_64:
3566         case MACFG_65:
3567         case MACFG_66:
3568                 re_driver_stop(sc);
3569                 break;
3570         }
3571
3572         RE_LOCK(sc);
3573         sc->re_link_chg_det = 0;
3574         re_stop(sc);
3575         RE_UNLOCK(sc);
3576
3577         RE_LOCK(sc);
3578         re_hw_d3_para(sc);
3579         re_phy_power_down(dev);
3580         RE_UNLOCK(sc);
3581
3582         return 0;
3583 }
3584 #endif  /* !__DragonFly__ */
3585
3586 static void re_hw_start_unlock(struct re_softc *sc)
3587 {
3588         struct ifnet            *ifp;
3589         u_int32_t               macver;
3590         u_int8_t                data8;
3591         u_int16_t               data16 = 0;
3592         u_int32_t               Data32;
3593
3594         ifp = RE_GET_IFNET(sc);
3595
3596 #ifndef __DragonFly__
3597         /* Init descriptors. */
3598         re_var_init(sc);
3599 #endif
3600
3601         CSR_WRITE_1(sc, RE_EECMD, RE_EEMODE_WRITECFG);
3602
3603         /*disable Link Down Power Saving(non-LDPS)*/
3604         /*CSR_WRITE_1(sc, RE_LDPS, 0x05);*/
3605         /*ldps= CSR_READ_1(sc, RE_LDPS);*/
3606
3607         CSR_WRITE_2(sc, RE_CPCR, 0x2060);
3608
3609         CSR_WRITE_2(sc, RE_IM, 0x5151);
3610
3611         CSR_WRITE_1(sc, RE_MTPS, 0x3f);
3612
3613         if (sc->re_device_id == RT_DEVICEID_8169 || sc->re_device_id == RT_DEVICEID_8169SC) {
3614                 //do nothing
3615         } else {
3616                 /* Set the initial TX configuration.*/
3617                 CSR_WRITE_4(sc, RE_TXCFG, RE_TXCFG_CONFIG);
3618         }
3619
3620         macver = CSR_READ_4(sc, RE_TXCFG) & 0xFC800000;
3621         if (macver == 0x00800000 || macver == 0x04000000 || macver == 0x10000000) {
3622                 CSR_WRITE_2(sc, RE_CPlusCmd, 0x0063| ((sc->re_type == MACFG_3 && sc->re_8169_MacVersion==1) ? 0x4008:0));
3623         } else if (macver == 0x18000000 || macver == 0x98000000) {
3624                 CSR_WRITE_2(sc, RE_CPlusCmd, 0x0068);
3625                 CSR_WRITE_2(sc, 0xe2, 0x0000);
3626         } else if (macver == 0x30000000) {
3627                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
3628                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
3629
3630                 if (ifp->if_mtu > ETHERMTU) {
3631                         data8 = pci_read_config(sc->dev, 0x69, 1);
3632                         data8 &= ~0x70;
3633                         data8 |= 0x28;
3634                         pci_write_config(sc->dev, 0x69, data8, 1);
3635                 } else {
3636                         data8 = pci_read_config(sc->dev, 0x69, 1);
3637                         data8 &= ~0x70;
3638                         data8 |= 0x58;
3639                         pci_write_config(sc->dev, 0x69, data8, 1);
3640                 }
3641         } else if (macver == 0x38000000) {
3642                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
3643                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
3644
3645                 if (ifp->if_mtu > ETHERMTU) {
3646                         data8 = pci_read_config(sc->dev, 0x69, 1);
3647                         data8 &= ~0x70;
3648                         data8 |= 0x28;
3649                         pci_write_config(sc->dev, 0x69, data8, 1);
3650                         CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) | BIT_0);
3651                 } else {
3652                         data8 = pci_read_config(sc->dev, 0x69, 1);
3653                         data8 &= ~0x70;
3654                         data8 |= 0x58;
3655                         pci_write_config(sc->dev, 0x69, data8, 1);
3656                         CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) & ~ BIT_0);
3657                 }
3658         } else if (macver == 0x34000000 || macver == 0xB4000000) {
3659                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
3660         } else if (macver == 0x34800000 || macver == 0x24800000) {
3661                 if (pci_read_config(sc->dev, 0x81, 1) == 1) {
3662                         CSR_WRITE_1(sc, RE_DBG_reg, 0x98);
3663                         CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) | 0x80);
3664                         CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) | 0x04);
3665                         pci_write_config(sc->dev, 0x81, 1, 1);
3666                 }
3667
3668                 data8 = pci_read_config(sc->dev, 0x79, 1);
3669                 data8 &= ~0x70;
3670                 data8 |= 0x50;
3671                 pci_write_config(sc->dev, 0x79, data8, 1);
3672
3673                 /*set configuration space offset 0x70f to 0x3f*/
3674                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
3675                 Data32 &=0xC0FFFFFF;
3676                 Data32 |= (0x3F << 24);
3677                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
3678
3679                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
3680
3681                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
3682                 if (sc->re_type == MACFG_14) {
3683                         CSR_WRITE_1(sc,RE_CFG1, 0x0f);
3684
3685                         MP_WriteEPhyUshort(sc, 0x03, 0xC2F9);
3686                 } else if (sc->re_type == MACFG_15) {
3687                         CSR_WRITE_1(sc,RE_CFG1, 0x0f);
3688
3689                         MP_WriteEPhyUshort(sc, 0x01, 0x6FE5);
3690                         MP_WriteEPhyUshort(sc, 0x03, 0x07D9);
3691                 } else if (sc->re_type == MACFG_17) {
3692                         MP_WriteEPhyUshort(sc, 0x06, 0xAF35);
3693                 } else if (sc->re_type == MACFG_18) {
3694                         CSR_WRITE_1(sc, 0xF5, CSR_READ_1(sc, 0xF5)|0x04);
3695                         MP_WriteEPhyUshort(sc, 0x19, 0xEC90);
3696                         MP_WriteEPhyUshort(sc, 0x01, 0x6FE5);
3697                         MP_WriteEPhyUshort(sc, 0x03, 0x05D9);
3698                         MP_WriteEPhyUshort(sc, 0x06, 0xAF35);
3699                 } else if (sc->re_type == MACFG_19) {
3700                         if (pci_read_config(sc->dev, 0x80, 1)&3) {
3701                                 MP_WriteEPhyUshort(sc, 0x02, 0x011F);
3702                         }
3703                         CSR_WRITE_1(sc, 0xF4, CSR_READ_1(sc, 0xF4)|0x08);
3704                         CSR_WRITE_1(sc, 0xF5, CSR_READ_1(sc, 0xF5)|0x04);
3705                         MP_WriteEPhyUshort(sc, 0x19, 0xEC90);
3706                         MP_WriteEPhyUshort(sc, 0x01, 0x6FE5);
3707                         MP_WriteEPhyUshort(sc, 0x03, 0x05D9);
3708                         MP_WriteEPhyUshort(sc, 0x06, 0xAF35);
3709                 }
3710         } else if (macver == 0x3C000000) {
3711                 /*set configuration space offset 0x70f to 0x27*/
3712                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
3713                 Data32 &=0xC0FFFFFF;
3714                 Data32 |= (0x27 << 24);
3715                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
3716
3717                 CSR_WRITE_1(sc, RE_CFG1, CSR_READ_1(sc, RE_CFG1)|0x10);
3718                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
3719
3720                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
3721                 if (sc->re_type == MACFG_24) {
3722                         /*set mac register offset 0xd1 to 0xf8*/
3723                         CSR_WRITE_1(sc, RE_DBG_reg, 0xF8);
3724
3725                         data16 = MP_ReadEPhyUshort(sc, 0x02) & ~0x1800;
3726                         data16 |= 0x1000;
3727                         MP_WriteEPhyUshort(sc, 0x02, data16);
3728
3729                         data16 = MP_ReadEPhyUshort(sc, 0x03) | 0x0002;
3730                         MP_WriteEPhyUshort(sc, 0x03, data16);
3731
3732                         data16 = MP_ReadEPhyUshort(sc, 0x06) & ~0x0080;
3733                         MP_WriteEPhyUshort(sc, 0x06, data16);
3734
3735                         //disable clock request.
3736                         pci_write_config(sc->dev, 0x81, 0, 1);
3737
3738                         if (ifp->if_mtu > ETHERMTU) {
3739                                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) | BIT_2); //Jumbo_en0
3740                                 CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) | (1 << 1)); //Jumbo_en1
3741
3742                                 data8 = pci_read_config(sc->dev, 0x79, 1);
3743                                 data8 &= ~0x70;
3744                                 data8 |= 0x20;
3745                                 pci_write_config(sc->dev, 0x79, data8, 1);
3746                                 ifp->if_capenable &= ~IFCAP_HWCSUM;
3747                                 CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) & ~RL_RxChkSum);
3748                                 ifp->if_hwassist &= ~RE_CSUM_FEATURES;
3749
3750                         } else {
3751                                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_2); //Jumbo_en0
3752                                 CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) & ~(1 << 1)); //Jumbo_en1
3753                                 data8 = pci_read_config(sc->dev, 0x79, 1);
3754                                 data8 &= ~0x70;
3755                                 data8 |= 0x50;
3756                                 pci_write_config(sc->dev, 0x79, data8, 1);
3757                                 if (sc->re_tx_cstag) {
3758                                         ifp->if_capenable |= IFCAP_TXCSUM;
3759                                         if ((sc->re_type == MACFG_24) || (sc->re_type == MACFG_25) || (sc->re_type == MACFG_26))
3760                                                 ifp->if_hwassist |= CSUM_TCP | CSUM_UDP;
3761                                         else
3762                                                 ifp->if_hwassist |= RE_CSUM_FEATURES;
3763                                 }
3764                                 if (sc->re_rx_cstag) {
3765                                         ifp->if_capenable |= IFCAP_RXCSUM;
3766                                         CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) |RL_RxChkSum);
3767                                 }
3768                         }
3769
3770
3771                 } else if (sc->re_type == MACFG_25) {
3772                         data16 = MP_ReadEPhyUshort(sc, 0x01) | 0x0001;
3773                         MP_WriteEPhyUshort(sc, 0x01, data16);
3774
3775                         data16 = MP_ReadEPhyUshort(sc, 0x03) & ~0x0620;
3776                         data16 |= 0x0220;
3777                         MP_WriteEPhyUshort(sc, 0x03, data16);
3778
3779                         //disable clock request.
3780                         pci_write_config(sc->dev, 0x81, 0, 1);
3781
3782                         if (ifp->if_mtu > ETHERMTU) {
3783                                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) | BIT_2); //Jumbo_en0
3784                                 CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) | (1<<1)); //Jumbo_en1
3785
3786                                 data8 = pci_read_config(sc->dev, 0x79, 1);
3787                                 data8 &= ~0x70;
3788                                 data8 |= 0x20;
3789                                 pci_write_config(sc->dev, 0x79, data8, 1);
3790                                 ifp->if_capenable &= ~IFCAP_HWCSUM;
3791                                 CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) & ~RL_RxChkSum);
3792                                 ifp->if_hwassist &= ~RE_CSUM_FEATURES;
3793
3794                         } else {
3795                                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_2); //Jumbo_en0
3796                                 CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) & ~(1<<1)); //Jumbo_en1
3797                                 data8 = pci_read_config(sc->dev, 0x79, 1);
3798                                 data8 &= ~0x70;
3799                                 data8 |= 0x50;
3800                                 pci_write_config(sc->dev, 0x79, data8, 1);
3801                                 if (sc->re_tx_cstag) {
3802                                         ifp->if_capenable |= IFCAP_TXCSUM;
3803                                         if ((sc->re_type == MACFG_24) || (sc->re_type == MACFG_25) || (sc->re_type == MACFG_26))
3804                                                 ifp->if_hwassist |= CSUM_TCP | CSUM_UDP;
3805                                         else
3806                                                 ifp->if_hwassist |= RE_CSUM_FEATURES;
3807                                 }
3808                                 if (sc->re_rx_cstag) {
3809                                         ifp->if_capenable |= IFCAP_RXCSUM;
3810                                         CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) |RL_RxChkSum);
3811                                 }
3812
3813
3814                         }
3815
3816                 } else if (sc->re_type == MACFG_26) {
3817                         //disable clock request.
3818                         pci_write_config(sc->dev, 0x81, 0, 1);
3819
3820                         if (ifp->if_mtu > ETHERMTU) {
3821                                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) | BIT_2); //Jumbo_en0
3822                                 CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) | (1<<1)); //Jumbo_en1
3823
3824                                 data8 = pci_read_config(sc->dev, 0x79, 1);
3825                                 data8 &= ~0x70;
3826                                 data8 |= 0x20;
3827                                 pci_write_config(sc->dev, 0x79, data8, 1);
3828                                 ifp->if_capenable &= ~IFCAP_HWCSUM;
3829                                 CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) & ~RL_RxChkSum);
3830                                 ifp->if_hwassist &= ~RE_CSUM_FEATURES;
3831                         } else {
3832                                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_2); //Jumbo_en0
3833                                 CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) & ~(1<<1)); //Jumbo_en1
3834                                 data8 = pci_read_config(sc->dev, 0x79, 1);
3835                                 data8 &= ~0x70;
3836                                 data8 |= 0x50;
3837                                 pci_write_config(sc->dev, 0x79, data8, 1);
3838                                 if (sc->re_tx_cstag) {
3839                                         ifp->if_capenable |= IFCAP_TXCSUM;
3840                                         if ((sc->re_type == MACFG_24) || (sc->re_type == MACFG_25) || (sc->re_type == MACFG_26))
3841                                                 ifp->if_hwassist |= CSUM_TCP | CSUM_UDP;
3842                                         else
3843                                                 ifp->if_hwassist |= RE_CSUM_FEATURES;
3844                                 }
3845                                 if (sc->re_rx_cstag) {
3846                                         ifp->if_capenable |= IFCAP_RXCSUM;
3847                                         CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) |RL_RxChkSum);
3848                                 }
3849                         }
3850                 }
3851         } else if (macver == 0x3C800000) {
3852                 /*set configuration space offset 0x70f to 0x27*/
3853                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
3854                 Data32 &=0xC0FFFFFF;
3855                 Data32 |= (0x27 << 24);
3856                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
3857
3858                 re_eri_write(sc, 0x1EC, 1, 0x07, ERIAR_ASF);
3859
3860                 //disable clock request.
3861                 pci_write_config(sc->dev, 0x81, 0x00, 1);
3862
3863                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
3864                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
3865                 if (sc->re_type == MACFG_28)
3866                         CSR_WRITE_1(sc, 0xD1, 0x20);
3867
3868                 if (ifp->if_mtu > ETHERMTU) {
3869                         CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) | BIT_2); //Jumbo_en0
3870                         CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) | (1<<1)); //Jumbo_en1
3871
3872                         data8 = pci_read_config(sc->dev, 0x79, 1);
3873                         data8 &= ~0x70;
3874                         data8 |= 0x20;
3875                         pci_write_config(sc->dev, 0x79, data8, 1);
3876                         ifp->if_capenable &= ~IFCAP_HWCSUM;
3877                         CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) & ~RL_RxChkSum);
3878                         ifp->if_hwassist &= ~RE_CSUM_FEATURES;
3879                 } else {
3880                         CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_2); //Jumbo_en0
3881                         CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) & ~(1<<1)); //Jumbo_en1
3882                         data8 = pci_read_config(sc->dev, 0x79, 1);
3883                         data8 &= ~0x70;
3884                         data8 |= 0x50;
3885                         pci_write_config(sc->dev, 0x79, data8, 1);
3886                         if (sc->re_tx_cstag) {
3887                                 ifp->if_capenable |= IFCAP_TXCSUM;
3888                                 ifp->if_hwassist |= RE_CSUM_FEATURES;
3889                         }
3890                         if (sc->re_rx_cstag) {
3891                                 ifp->if_capenable |= IFCAP_RXCSUM;
3892                                 CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) |RL_RxChkSum);
3893                         }
3894                 }
3895
3896
3897         } else if (macver == 0x28000000) {
3898                 /*set configuration space offset 0x70f to 0x13*/
3899                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
3900                 Data32 &=0xC0FFFFFF;
3901                 Data32 |= (0x13 << 24);
3902                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
3903
3904                 /* disable clock request. */
3905                 pci_write_config(sc->dev, 0x81, 0x00, 1);
3906
3907                 CSR_WRITE_1(sc, 0xD1, CSR_READ_1(sc, 0xD1) | 0x02);
3908
3909                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
3910                 CSR_WRITE_1(sc, RE_DBG_reg, CSR_READ_1(sc, RE_DBG_reg)|0x82);
3911
3912                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
3913
3914                 if (ifp->if_mtu > ETHERMTU) {
3915                         CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) | BIT_2); //Jumbo_en0
3916                         CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) | (1<<1)); //Jumbo_en1
3917
3918                         data8 = pci_read_config(sc->dev, 0x79, 1);
3919                         data8 &= ~0x70;
3920                         data8 |= 0x20;
3921                         pci_write_config(sc->dev, 0x79, data8, 1);
3922                         ifp->if_capenable &= ~IFCAP_HWCSUM;
3923                         CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) & ~RL_RxChkSum);
3924                         ifp->if_hwassist &= ~RE_CSUM_FEATURES;
3925
3926                 } else {
3927                         CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_2); //Jumbo_en0
3928                         CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) & ~(1<<1)); //Jumbo_en1
3929                         data8 = pci_read_config(sc->dev, 0x79, 1);
3930                         data8 &= ~0x70;
3931                         data8 |= 0x50;
3932                         pci_write_config(sc->dev, 0x79, data8, 1);
3933                         if (sc->re_tx_cstag) {
3934                                 ifp->if_capenable |= IFCAP_TXCSUM;
3935                                 ifp->if_hwassist |= RE_CSUM_FEATURES;
3936                         }
3937                         if (sc->re_rx_cstag) {
3938                                 ifp->if_capenable |= IFCAP_RXCSUM;
3939                                 CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) |RL_RxChkSum);
3940                         }
3941                 }
3942
3943                 if (sc->re_type == MACFG_31) {
3944                         CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~(1<<4));
3945
3946                         MP_WriteEPhyUshort(sc, 0x01, 0x7C7F);
3947                         MP_WriteEPhyUshort(sc, 0x02, 0x011F);
3948                         MP_WriteEPhyUshort(sc, 0x06, 0xB271);
3949                         MP_WriteEPhyUshort(sc, 0x07, 0xCE00);
3950                 } else if (sc->re_type == MACFG_32) {
3951                         MP_WriteEPhyUshort(sc, 0x01, 0x7C7D);
3952                         MP_WriteEPhyUshort(sc, 0x02, 0x091F);
3953                         MP_WriteEPhyUshort(sc, 0x03, 0xC5BA);
3954                         MP_WriteEPhyUshort(sc, 0x06, 0xB279);
3955                         MP_WriteEPhyUshort(sc, 0x07, 0xAF00);
3956                         MP_WriteEPhyUshort(sc, 0x1E, 0xB8EB);
3957                 } else if (sc->re_type == MACFG_33) {
3958                         CSR_WRITE_1(sc, RE_CFG1, CSR_READ_1(sc, RE_CFG1)|0x10);
3959
3960                         MP_WriteEPhyUshort(sc, 0x01, 0x6C7F);
3961                         MP_WriteEPhyUshort(sc, 0x02, 0x011F);
3962                         ClearAndSetPCIePhyBit(sc,
3963                                               0x03,
3964                                               0xFFF0,
3965                                               0x01B0
3966                                              );
3967                         MP_WriteEPhyUshort(sc, 0x1A, 0x0546);
3968                         MP_WriteEPhyUshort(sc, 0x1C, 0x80C4);
3969                         MP_WriteEPhyUshort(sc, 0x1D, 0x78E5);
3970                         MP_WriteEPhyUshort(sc, 0x0A, 0x8100);
3971                 }
3972         } else if (macver == 0x28800000) {
3973                 /*set configuration space offset 0x70f to 0x17*/
3974                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
3975                 Data32 &=0xC0FFFFFF;
3976                 Data32 |= (0x17 << 24);
3977                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
3978
3979                 /* disable clock request. */
3980                 pci_write_config(sc->dev, 0x81, 0x00, 1);
3981
3982                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
3983                 CSR_WRITE_1(sc, RE_DBG_reg, CSR_READ_1(sc, RE_DBG_reg)|0x82);
3984
3985                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
3986
3987                 if (ifp->if_mtu > ETHERMTU) {
3988                         CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) | BIT_2); //Jumbo_en0
3989                         CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) | (1<<1)); //Jumbo_en1
3990
3991                         data8 = pci_read_config(sc->dev, 0x79, 1);
3992                         data8 &= ~0x70;
3993                         data8 |= 0x20;
3994                         pci_write_config(sc->dev, 0x79, data8, 1);
3995                         ifp->if_capenable &= ~IFCAP_HWCSUM;
3996                         CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) & ~RL_RxChkSum);
3997                         ifp->if_hwassist &= ~RE_CSUM_FEATURES;
3998
3999                 } else {
4000                         CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_2); //Jumbo_en0
4001                         CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) & ~(1<<1)); //Jumbo_en1
4002                         data8 = pci_read_config(sc->dev, 0x79, 1);
4003                         data8 &= ~0x70;
4004                         data8 |= 0x50;
4005                         pci_write_config(sc->dev, 0x79, data8, 1);
4006                         if (sc->re_tx_cstag) {
4007                                 ifp->if_capenable |= IFCAP_TXCSUM;
4008                                 ifp->if_hwassist |= RE_CSUM_FEATURES;
4009                         }
4010                         if (sc->re_rx_cstag) {
4011                                 ifp->if_capenable |= IFCAP_RXCSUM;
4012                                 CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) |RL_RxChkSum);
4013                         }
4014                 }
4015
4016                 if (sc->re_type == MACFG_65 || sc->re_type == MACFG_66) {
4017                         SetPCIePhyBit(sc, 0x0B, (BIT_3 | BIT_6));
4018
4019                         ClearAndSetPCIePhyBit(sc,
4020                                               0x19,
4021                                               BIT_5,
4022                                               (BIT_4 | BIT_6)
4023                                              );
4024
4025                         ClearAndSetPCIePhyBit(sc,
4026                                               0x0C,
4027                                               BIT_8,
4028                                               BIT_5
4029                                              );
4030
4031                         ClearPCIePhyBit(sc, 0x10, (BIT_2));
4032                 }
4033         } else if (macver == 0x2C000000) {
4034                 /*set configuration space offset 0x70f to 0x20*/
4035                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
4036                 Data32 &=0xC0FFFFFF;
4037                 Data32 |= (0x20 << 24);
4038                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
4039
4040                 CSR_WRITE_1(sc, 0xF3, CSR_READ_1(sc, 0xF3)|0x20);
4041                 CSR_WRITE_1(sc, 0xF3, CSR_READ_1(sc, 0xF3)& ~0x20);
4042
4043                 CSR_WRITE_1(sc, 0xD0, CSR_READ_1(sc, 0xD0)|0xC0);
4044                 CSR_WRITE_1(sc, 0xF1, CSR_READ_1(sc, 0xF1)|0xF3);
4045                 CSR_WRITE_1(sc, RE_CFG5, (CSR_READ_1(sc, RE_CFG5)& ~0x08)|0x01);
4046                 CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2)|0x80);
4047                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
4048
4049                 if (sc->re_type == MACFG_36 || sc->re_type == MACFG_37) {
4050                         /* set EPHY registers */
4051                         data16 = MP_ReadEPhyUshort(sc, 0x00) & ~0x0200;
4052                         data16 |= 0x0100;
4053                         MP_WriteEPhyUshort(sc, 0x00, data16);
4054
4055                         data16 = MP_ReadEPhyUshort(sc, 0x00);
4056                         data16 |= 0x0004;
4057                         MP_WriteEPhyUshort(sc, 0x00, data16);
4058
4059                         data16 = MP_ReadEPhyUshort(sc, 0x06) & ~0x0002;
4060                         data16 |= 0x0001;
4061                         MP_WriteEPhyUshort(sc, 0x06, data16);
4062
4063                         data16 = MP_ReadEPhyUshort(sc, 0x06);
4064                         data16 |= 0x0030;
4065                         MP_WriteEPhyUshort(sc, 0x06, data16);
4066
4067                         data16 = MP_ReadEPhyUshort(sc, 0x07);
4068                         data16 |= 0x2000;
4069                         MP_WriteEPhyUshort(sc, 0x07, data16);
4070
4071                         data16 = MP_ReadEPhyUshort(sc, 0x00);
4072                         data16 |= 0x0020;
4073                         MP_WriteEPhyUshort(sc, 0x00, data16);
4074
4075                         data16 = MP_ReadEPhyUshort(sc, 0x03) & ~0x5800;
4076                         data16 |= 0x2000;
4077                         MP_WriteEPhyUshort(sc, 0x03, data16);
4078
4079                         data16 = MP_ReadEPhyUshort(sc, 0x03);
4080                         data16 |= 0x0001;
4081                         MP_WriteEPhyUshort(sc, 0x03, data16);
4082
4083                         data16 = MP_ReadEPhyUshort(sc, 0x01) & ~0x0800;
4084                         data16 |= 0x1000;
4085                         MP_WriteEPhyUshort(sc, 0x01, data16);
4086
4087                         data16 = MP_ReadEPhyUshort(sc, 0x07);
4088                         data16 |= 0x4000;
4089                         MP_WriteEPhyUshort(sc, 0x07, data16);
4090
4091                         data16 = MP_ReadEPhyUshort(sc, 0x1E);
4092                         data16 |= 0x2000;
4093                         MP_WriteEPhyUshort(sc, 0x1E, data16);
4094
4095                         MP_WriteEPhyUshort(sc, 0x19, 0xFE6C);
4096
4097                         data16 = MP_ReadEPhyUshort(sc, 0x0A);
4098                         data16 |= 0x0040;
4099                         MP_WriteEPhyUshort(sc, 0x0A, data16);
4100
4101                         if (ifp->if_mtu > ETHERMTU) {
4102                                 CSR_WRITE_1 (sc, RE_MTPS, 0x24);
4103                                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) | BIT_2);
4104                                 CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) |0x01);
4105                                 data8 = pci_read_config(sc->dev, 0x79, 1);
4106                                 data8 &= ~0x70;
4107                                 data8 |= 0x20;
4108                                 pci_write_config(sc->dev, 0x79, data8, 1);
4109                                 ifp->if_capenable &= ~IFCAP_HWCSUM;
4110                                 CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) & ~RL_RxChkSum);
4111                                 ifp->if_hwassist &= ~RE_CSUM_FEATURES;
4112                         } else {
4113                                 CSR_WRITE_1 (sc, RE_MTPS, 0x0c);
4114                                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_2);
4115                                 CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) & ~0x01);
4116                                 data8 = pci_read_config(sc->dev, 0x79, 1);
4117                                 data8 &= ~0x70;
4118                                 data8 |= 0x50;
4119                                 pci_write_config(sc->dev, 0x79, data8, 1);
4120
4121                                 if (sc->re_tx_cstag) {
4122                                         ifp->if_capenable |= IFCAP_TXCSUM;
4123                                         ifp->if_hwassist |= RE_CSUM_FEATURES;
4124                                 }
4125                                 if (sc->re_rx_cstag) {
4126                                         ifp->if_capenable |= IFCAP_RXCSUM;
4127                                         CSR_WRITE_2 (sc, RE_CPlusCmd,CSR_READ_2(sc, RE_CPlusCmd) |RL_RxChkSum);
4128                                 }
4129                         }
4130
4131                         //disable clock request.
4132                         pci_write_config(sc->dev, 0x81, 1, 1);
4133                 }
4134         } else if (macver == 0x2C800000) {
4135                 /*set configuration space offset 0x70f to 0x27*/
4136                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
4137                 Data32 &=0xC0FFFFFF;
4138                 Data32 |= (0x27 << 24);
4139                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
4140
4141                 data8 = pci_read_config(sc->dev, 0x79, 1);
4142                 data8 &= ~0x70;
4143                 data8 |= 0x50;
4144                 pci_write_config(sc->dev, 0x79, data8, 1);
4145
4146                 Data32 = CSR_READ_2(sc, RE_IDR0);
4147                 Data32 <<= 16;
4148                 Data32 &= 0xFFFF0000;
4149                 re_eri_write(sc, 0xF0, 4, Data32, ERIAR_ExGMAC);
4150                 Data32 = CSR_READ_2(sc, RE_IDR4);
4151                 Data32 <<= 16;
4152                 Data32 += CSR_READ_2(sc, RE_IDR2);
4153                 re_eri_write(sc, 0xF4, 4, Data32, ERIAR_ExGMAC);
4154
4155                 re_eri_write(sc, 0xC0, 2, 0x0000, ERIAR_ExGMAC);
4156                 re_eri_write(sc, 0xB8, 4, 0x00000000, ERIAR_ExGMAC);
4157                 re_eri_write(sc, 0xC8, 4, 0x00100002, ERIAR_ExGMAC);
4158                 re_eri_write(sc, 0xE8, 4, 0x00100006, ERIAR_ExGMAC);
4159                 Data32 = re_eri_read(sc, 0xdc, 4, ERIAR_ExGMAC);
4160                 Data32 &= ~BIT_0;
4161                 re_eri_write(sc, 0xdc, 1, Data32, ERIAR_ExGMAC);
4162                 Data32 |= BIT_0;
4163                 re_eri_write(sc, 0xdc, 1, Data32, ERIAR_ExGMAC);
4164
4165                 Data32 = re_eri_read(sc, 0xD4, 4, ERIAR_ExGMAC);
4166                 Data32 |= BIT_11 | BIT_10;
4167                 re_eri_write(sc, 0xD4, 4, Data32, ERIAR_ExGMAC);
4168                 if (sc ->re_type == MACFG_39) {
4169                         Data32 = re_eri_read(sc, 0x1B0, 4, ERIAR_ExGMAC);
4170                         Data32 |= BIT_4;
4171                         re_eri_write(sc, 0x1B0, 4, Data32, ERIAR_ExGMAC);
4172                         re_eri_write(sc, 0xCC, 4, 0x00000050, ERIAR_ExGMAC);
4173                         re_eri_write(sc, 0xD0, 4, 0x07ff0060, ERIAR_ExGMAC);
4174                 }
4175
4176                 CSR_WRITE_4(sc, RE_TXCFG, CSR_READ_4(sc, RE_TXCFG) |BIT_7);
4177                 CSR_WRITE_1(sc, 0xD3, CSR_READ_1(sc, 0xD3) & ~BIT_7);
4178                 CSR_WRITE_1(sc, 0x1B, CSR_READ_1(sc, 0x1B) & ~0x07);
4179                 CSR_WRITE_1(sc, 0xF1,CSR_READ_1(sc, 0xF1) & ~ BIT_7);
4180
4181                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
4182
4183                 if (sc ->re_type == MACFG_38) {
4184                         CSR_WRITE_4(sc, 0xB0, 0xEE480010);
4185                         CSR_WRITE_1(sc, 0x1A, CSR_READ_1(sc, 0x1A) & ~(BIT_2 |BIT_3));
4186                         re_eri_write(sc, 0x1DC, 1, 0x64, ERIAR_ExGMAC);
4187
4188                         MP_WriteEPhyUshort(sc, 0x06, 0xF020);
4189                         MP_WriteEPhyUshort(sc, 0x07, 0x01FF);
4190                         MP_WriteEPhyUshort(sc, 0x00, 0x5027);
4191                         MP_WriteEPhyUshort(sc, 0x01, 0x0003);
4192                         MP_WriteEPhyUshort(sc, 0x02, 0x2D16);
4193                         MP_WriteEPhyUshort(sc, 0x03, 0x6D49);
4194                         MP_WriteEPhyUshort(sc, 0x08, 0x0006);
4195                         MP_WriteEPhyUshort(sc, 0x0A, 0x00C8);
4196                 }
4197
4198                 data16 = MP_ReadEPhyUshort(sc, 0x09);
4199                 data16 |= BIT_7;
4200                 MP_WriteEPhyUshort(sc, 0x09, data16);
4201
4202                 data16 = MP_ReadEPhyUshort(sc, 0x19);
4203                 data16 |= (BIT_2 | BIT_5 | BIT_9);
4204                 MP_WriteEPhyUshort(sc, 0x19, data16);
4205
4206                 SetPCIePhyBit(sc, 0x00, BIT_3);
4207                 ClearAndSetPCIePhyBit(sc,
4208                                       0x0C,
4209                                       (BIT_13|BIT_12|BIT_11|BIT_10|BIT_8|BIT_7|BIT_6|BIT_5|BIT_4),
4210                                       BIT_9
4211                                      );
4212
4213                 CSR_WRITE_1(sc, RE_CFG5, CSR_READ_1(sc, RE_CFG5) | BIT_0);
4214                 CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) | BIT_5 |BIT_7);
4215                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
4216
4217                 CSR_WRITE_1(sc, 0xD0, CSR_READ_1(sc, 0xD0) | BIT_6);
4218                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) | BIT_6);
4219
4220                 CSR_WRITE_1 (sc, RE_MTPS, 0x27);
4221                 ifp->if_capenable &= ~IFCAP_HWCSUM ;
4222                 ifp->if_hwassist &= ~RE_CSUM_FEATURES;
4223
4224                 /* disable clock request. */
4225                 pci_write_config(sc->dev, 0x81, 0x00, 1);
4226         } else if (macver == 0x24000000) {
4227                 if (pci_read_config(sc->dev, 0x81, 1)==1) {
4228                         CSR_WRITE_1(sc, RE_DBG_reg, 0x98);
4229                         CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) | 0x80);
4230                         CSR_WRITE_1(sc, RE_CFG4, CSR_READ_1(sc, RE_CFG4) | 0x04);
4231                         pci_write_config(sc->dev, 0x81, 1, 1);
4232                 }
4233                 data8 = pci_read_config(sc->dev, 0x79, 1);
4234                 data8 &= ~0x70;
4235                 data8 |= 0x50;
4236                 pci_write_config(sc->dev, 0x79, data8, 1);
4237
4238                 /*set configuration space offset 0x70f to 0x3F*/
4239                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
4240                 Data32 &=0xC0FFFFFF;
4241                 Data32 |= (0x3F << 24);
4242                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
4243
4244                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
4245
4246                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
4247
4248                 MP_WriteEPhyUshort(sc, 0x06, 0xAF25);
4249                 MP_WriteEPhyUshort(sc, 0x07, 0x8E68);
4250         } else if (macver == 0x40800000) {
4251                 if (pci_read_config(sc->dev, 0x80, 1) & 0x03) {
4252                         CSR_WRITE_1(sc, RE_CFG5, CSR_READ_1(sc, RE_CFG5) | 1);
4253                         CSR_WRITE_1(sc, 0xF1, CSR_READ_1(sc, 0xF1) | 0x80);
4254                         CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) | 0x80);
4255                         CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) | 0x80);
4256                 }
4257                 CSR_WRITE_1(sc, 0xF1, CSR_READ_1(sc, 0xF1) | 0x28);
4258                 CSR_WRITE_1(sc, 0xD3, CSR_READ_1(sc, 0xD3) | 0x0C);
4259                 CSR_WRITE_1(sc, 0xD3, CSR_READ_1(sc, 0xD3) & ~BIT_7);
4260                 CSR_WRITE_1(sc, 0xD0, CSR_READ_1(sc, 0xD0) | 0x40);
4261                 CSR_WRITE_2(sc, 0xE0, CSR_READ_2(sc, 0xE0) & ~0xDF9C);
4262                 CSR_WRITE_1(sc, 0xD1, CSR_READ_1(sc, 0xD1) | 0x02);
4263
4264                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
4265
4266                 if (sc->re_type == MACFG_42) {
4267                         /* set EPHY registers */
4268                         SetPCIePhyBit(sc, 0x07, BIT_14);
4269                         SetPCIePhyBit(sc, 0x19, BIT_9);
4270                         SetPCIePhyBit(sc, 0x19, BIT_5);
4271                         SetPCIePhyBit(sc, 0x1E, BIT_13);
4272                         SetPCIePhyBit(sc, 0x03, BIT_0);
4273                         SetPCIePhyBit(sc, 0x19, BIT_8);
4274                         SetPCIePhyBit(sc, 0x19, BIT_2);
4275                         SetPCIePhyBit(sc, 0x0A, BIT_5);
4276                         SetPCIePhyBit(sc, 0x05, BIT_13);
4277                 }
4278                 if (sc->re_type == MACFG_43) {
4279                         SetPCIePhyBit(sc, 0x07, BIT_14);
4280                         SetPCIePhyBit(sc, 0x19, BIT_9);
4281                         SetPCIePhyBit(sc, 0x19, BIT_5);
4282                         SetPCIePhyBit(sc, 0x1E, BIT_13);
4283                         SetPCIePhyBit(sc, 0x03, BIT_0);
4284                         SetPCIePhyBit(sc, 0x19, BIT_8);
4285                         SetPCIePhyBit(sc, 0x19, BIT_2);
4286                         SetPCIePhyBit(sc, 0x0A, BIT_5);
4287                         SetPCIePhyBit(sc, 0x1E, BIT_15);
4288                         SetPCIePhyBit(sc, 0x05, BIT_13);
4289                 }
4290         } else if (macver == 0x44000000) {
4291
4292                 CSR_WRITE_2(sc, 0xE0, CSR_READ_2(sc, 0xE0) & ~0xDF9C);
4293
4294                 re_eri_write(sc, 0xC8, 4, 0x00000002, ERIAR_ExGMAC);
4295                 re_eri_write(sc, 0xE8, 4, 0x00000006, ERIAR_ExGMAC);
4296
4297                 Data32 = re_eri_read(sc, 0xD4, 4, ERIAR_ExGMAC);
4298                 Data32 |= BIT_11 | BIT_10;
4299                 re_eri_write(sc, 0xD4, 4, Data32, ERIAR_ExGMAC);
4300
4301                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
4302
4303                 /* set EPHY registers */
4304                 MP_WriteEPhyUshort(sc, 0x19, 0xFF64);
4305
4306                 CSR_WRITE_1 (sc, RE_MTPS, 0x27);
4307         } else if (macver == 0x48000000) {
4308                 /*set configuration space offset 0x70f to 0x27*/
4309                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
4310                 Data32 &=0xC0FFFFFF;
4311                 Data32 |= (0x27 << 24);
4312                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
4313
4314                 data8 = pci_read_config(sc->dev, 0x79, 1);
4315                 data8 &= ~0x70;
4316                 data8 |= 0x50;
4317                 pci_write_config(sc->dev, 0x79, data8, 1);
4318
4319                 Data32 = re_eri_read(sc, 0xD4, 4, ERIAR_ExGMAC);
4320                 Data32 |= BIT_11 | BIT_10;
4321                 re_eri_write(sc, 0xD4, 4, Data32, ERIAR_ExGMAC);
4322                 re_eri_write(sc, 0xC0, 2, 0x0000, ERIAR_ExGMAC);
4323                 re_eri_write(sc, 0xB8, 4, 0x00000000, ERIAR_ExGMAC);
4324                 re_eri_write(sc, 0xC8, 4, 0x00100002, ERIAR_ExGMAC);
4325                 re_eri_write(sc, 0xE8, 4, 0x00100006, ERIAR_ExGMAC);
4326                 Data32 = re_eri_read(sc, 0xdc, 4, ERIAR_ExGMAC);
4327                 Data32 &= ~BIT_0;
4328                 re_eri_write(sc, 0xdc, 1, Data32, ERIAR_ExGMAC);
4329                 Data32 |= BIT_0;
4330                 re_eri_write(sc, 0xdc, 1, Data32, ERIAR_ExGMAC);
4331                 Data32 = re_eri_read(sc, 0x1B0, 4, ERIAR_ExGMAC);
4332                 Data32 |= BIT_4;
4333                 re_eri_write(sc, 0x1B0, 4, Data32, ERIAR_ExGMAC);
4334                 re_eri_write(sc, 0xCC, 4, 0x00000050, ERIAR_ExGMAC);
4335                 re_eri_write(sc, 0xD0, 4, 0x00000060, ERIAR_ExGMAC);
4336                 Data32 = re_eri_read(sc, 0x1D0, 4, ERIAR_ExGMAC);
4337                 Data32 |= BIT_4;
4338                 re_eri_write(sc, 0x1D0, 4, Data32, ERIAR_ExGMAC);
4339
4340                 CSR_WRITE_4(sc, RE_TXCFG, CSR_READ_4(sc, RE_TXCFG) | BIT_7);
4341                 CSR_WRITE_1(sc, 0xD3, CSR_READ_1(sc, 0xD3) & ~BIT_7);
4342                 CSR_WRITE_1(sc, 0x1B, CSR_READ_1(sc, 0x1B) & ~0x07);
4343
4344                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
4345
4346                 if (sc->re_type == MACFG_50) {
4347                         data16 = MP_ReadEPhyUshort(sc, 0x06);
4348                         data16 &= ~(BIT_7 | BIT_6);
4349                         data16 |= BIT_5;
4350                         MP_WriteEPhyUshort(sc, 0x06, data16);
4351
4352                         data16 = MP_ReadEPhyUshort(sc, 0x08);
4353                         data16 &= ~BIT_0;
4354                         data16 |= BIT_1;
4355                         MP_WriteEPhyUshort(sc, 0x08, data16);
4356                 }
4357
4358                 data16 = MP_ReadEPhyUshort(sc, 0x09);
4359                 data16 |= BIT_7;
4360                 MP_WriteEPhyUshort(sc, 0x09, data16);
4361
4362                 data16 = MP_ReadEPhyUshort(sc, 0x19);
4363                 data16 |= (BIT_2 | BIT_5 | BIT_9);
4364                 MP_WriteEPhyUshort(sc, 0x19, data16);
4365
4366                 SetPCIePhyBit(sc, 0x00, BIT_3);
4367                 ClearAndSetPCIePhyBit(sc,
4368                                       0x0C,
4369                                       (BIT_13|BIT_12|BIT_11|BIT_10|BIT_8|BIT_7|BIT_6|BIT_5|BIT_4),
4370                                       BIT_9
4371                                      );
4372
4373                 CSR_WRITE_1(sc, RE_CFG5, CSR_READ_1(sc, RE_CFG5) | BIT_0);
4374                 CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) | BIT_7);
4375                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
4376
4377                 CSR_WRITE_1(sc, 0xD0, CSR_READ_1(sc, 0xD0) | BIT_6);
4378                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) | BIT_6);
4379
4380                 CSR_WRITE_1 (sc, RE_MTPS, 0x27);
4381
4382                 if (ifp->if_mtu > ETHERMTU) {
4383                         ifp->if_capenable &= ~IFCAP_HWCSUM ;
4384                         ifp->if_hwassist &= ~RE_CSUM_FEATURES;
4385                 } else {
4386                         if (sc->re_tx_cstag) {
4387                                 ifp->if_capenable |= IFCAP_TXCSUM;
4388                                 ifp->if_hwassist |= RE_CSUM_FEATURES;
4389                         }
4390                         if (sc->re_rx_cstag) {
4391                                 ifp->if_capenable |= IFCAP_RXCSUM;
4392                         }
4393                 }
4394
4395                 /* disable clock request. */
4396                 pci_write_config(sc->dev, 0x81, 0x00, 1);
4397         } else if (macver == 0x48800000) {
4398                 /*set configuration space offset 0x70f to 0x27*/
4399                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
4400                 Data32 &=0xC0FFFFFF;
4401                 Data32 |= (0x27 << 24);
4402                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
4403
4404                 data8 = pci_read_config(sc->dev, 0x79, 1);
4405                 data8 &= ~0x70;
4406                 data8 |= 0x50;
4407                 pci_write_config(sc->dev, 0x79, data8, 1);
4408
4409                 Data32 = re_eri_read(sc, 0xD4, 4, ERIAR_ExGMAC);
4410                 Data32 |= BIT_11 | BIT_10;
4411                 re_eri_write(sc, 0xD4, 4, Data32, ERIAR_ExGMAC);
4412                 re_eri_write(sc, 0xC0, 2, 0x0000, ERIAR_ExGMAC);
4413                 re_eri_write(sc, 0xB8, 4, 0x00000000, ERIAR_ExGMAC);
4414                 re_eri_write(sc, 0xC8, 4, 0x00100002, ERIAR_ExGMAC);
4415                 re_eri_write(sc, 0xE8, 4, 0x00100006, ERIAR_ExGMAC);
4416                 Data32 = re_eri_read(sc, 0xdc, 4, ERIAR_ExGMAC);
4417                 Data32 &= ~BIT_0;
4418                 re_eri_write(sc, 0xdc, 1, Data32, ERIAR_ExGMAC);
4419                 Data32 |= BIT_0;
4420                 re_eri_write(sc, 0xdc, 1, Data32, ERIAR_ExGMAC);
4421                 Data32 = re_eri_read(sc, 0x1B0, 4, ERIAR_ExGMAC);
4422                 Data32 |= BIT_4;
4423                 re_eri_write(sc, 0x1B0, 4, Data32, ERIAR_ExGMAC);
4424                 re_eri_write(sc, 0xCC, 4, 0x00000050, ERIAR_ExGMAC);
4425                 re_eri_write(sc, 0xD0, 4, 0x00000060, ERIAR_ExGMAC);
4426                 Data32 = re_eri_read(sc, 0x1D0, 4, ERIAR_ExGMAC);
4427                 Data32 |= BIT_4;
4428                 re_eri_write(sc, 0x1D0, 4, Data32, ERIAR_ExGMAC);
4429
4430                 CSR_WRITE_4(sc, RE_TXCFG, CSR_READ_4(sc, RE_TXCFG) | BIT_7);
4431                 CSR_WRITE_1(sc, 0xD3, CSR_READ_1(sc, 0xD3) & ~BIT_7);
4432 //              CSR_WRITE_1(sc, 0x1B, CSR_READ_1(sc, 0x1B) & ~0x07);
4433
4434                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
4435
4436                 data16 = MP_ReadEPhyUshort(sc, 0x06);
4437                 data16 &= ~(BIT_7 | BIT_6);
4438                 data16 |= BIT_5;
4439                 MP_WriteEPhyUshort(sc, 0x06, data16);
4440
4441                 MP_WriteEPhyUshort(sc, 0x0f, 0x5200);
4442
4443                 data16 = MP_ReadEPhyUshort(sc, 0x1e);
4444                 data16 |= BIT_14;
4445                 MP_WriteEPhyUshort(sc, 0x1e, data16);
4446
4447                 data16 = MP_ReadEPhyUshort(sc, 0x19);
4448                 data16 |= (BIT_2 | BIT_5 | BIT_9);
4449                 MP_WriteEPhyUshort(sc, 0x19, data16);
4450
4451                 SetPCIePhyBit(sc, 0x00, BIT_3);
4452                 ClearAndSetPCIePhyBit(sc,
4453                                       0x0C,
4454                                       (BIT_13|BIT_12|BIT_11|BIT_10|BIT_8|BIT_7|BIT_6|BIT_5|BIT_4),
4455                                       BIT_9
4456                                      );
4457
4458                 CSR_WRITE_1(sc, RE_CFG5, CSR_READ_1(sc, RE_CFG5) | BIT_0);
4459                 CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) | BIT_7);
4460                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
4461
4462                 CSR_WRITE_1(sc, 0xD0, CSR_READ_1(sc, 0xD0) | BIT_6);
4463                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) | BIT_6);
4464
4465                 CSR_WRITE_1 (sc, RE_MTPS, 0x27);
4466
4467                 if (ifp->if_mtu > ETHERMTU) {
4468                         ifp->if_capenable &= ~IFCAP_HWCSUM ;
4469                         ifp->if_hwassist &= ~RE_CSUM_FEATURES;
4470                 } else {
4471                         if (sc->re_tx_cstag) {
4472                                 ifp->if_capenable |= IFCAP_TXCSUM;
4473                                 ifp->if_hwassist |= RE_CSUM_FEATURES;
4474                         }
4475                         if (sc->re_rx_cstag) {
4476                                 ifp->if_capenable |= IFCAP_RXCSUM;
4477                         }
4478                 }
4479
4480                 /* disable clock request. */
4481                 pci_write_config(sc->dev, 0x81, 0x00, 1);
4482         } else if (macver == 0x44800000) {
4483                 if (pci_read_config(sc->dev, 0x80, 1) & 0x03) {
4484                         CSR_WRITE_1(sc, RE_CFG5, CSR_READ_1(sc, RE_CFG5) | 1);
4485                         CSR_WRITE_1(sc, 0xF1, CSR_READ_1(sc, 0xF1) | 0x80);
4486                         CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) | 0x80);
4487                         CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) | 0x80);
4488                 }
4489                 CSR_WRITE_1(sc, 0xF1, CSR_READ_1(sc, 0xF1) | 0x28);
4490                 CSR_WRITE_1(sc, 0xD3, CSR_READ_1(sc, 0xD3) | 0x0C);
4491                 CSR_WRITE_1(sc, 0xD3, CSR_READ_1(sc, 0xD3) & ~BIT_7);
4492                 CSR_WRITE_1(sc, 0xD0, CSR_READ_1(sc, 0xD0) | 0x40);
4493                 CSR_WRITE_2(sc, 0xE0, CSR_READ_2(sc, 0xE0) & ~0xDF9C);
4494
4495                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
4496         } else if (macver == 0x4C000000 || macver == 0x50800000 ||
4497                    macver == 0x5C800000 || macver == 0x54000000) {
4498                 CSR_WRITE_1(sc, RE_CFG5, CSR_READ_1(sc, RE_CFG5) & ~BIT_0);
4499                 CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) & ~BIT_7);
4500                 CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) | BIT_5);
4501
4502                 if (sc->re_type == MACFG_59) {
4503                         MP_WriteMcuAccessRegWord(sc, 0xD3C0, 0x03F8);
4504                         MP_WriteMcuAccessRegWord(sc, 0xD3C2, 0x0000);
4505                 }
4506
4507                 if (sc->re_type == MACFG_68 || sc->re_type == MACFG_69) {
4508                         MP_WriteMcuAccessRegWord(sc, 0xD400, MP_ReadMcuAccessRegWord(sc, 0xD400) & ~(BIT_0));
4509
4510                         data16 = MP_ReadMcuAccessRegWord(sc, 0xE63E);
4511                         data16 &= ~(BIT_3 | BIT_2 | BIT_1);
4512                         MP_WriteMcuAccessRegWord(sc, 0xE63E, data16);
4513                         data16 |= (BIT_0);
4514                         MP_WriteMcuAccessRegWord(sc, 0xE63E, data16);
4515                         data16 &= ~(BIT_0);
4516                         MP_WriteMcuAccessRegWord(sc, 0xE63E, data16);
4517                         MP_WriteMcuAccessRegWord(sc, 0xC094, 0x0);
4518                         MP_WriteMcuAccessRegWord(sc, 0xC09E, 0x0);
4519
4520                         MP_WriteMcuAccessRegWord(sc, 0xE098, 0x0AA2);
4521                 }
4522
4523                 /*set configuration space offset 0x70f to 0x17*/
4524                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
4525                 Data32 &=0xC0FFFFFF;
4526                 Data32 |= (0x17 << 24);
4527                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
4528
4529                 data8 = pci_read_config(sc->dev, 0x79, 1);
4530                 data8 &= ~0x70;
4531                 data8 |= 0x50;
4532                 pci_write_config(sc->dev, 0x79, data8, 1);
4533
4534                 if (sc->re_type == MACFG_56 || sc->re_type == MACFG_57) {
4535                         Data32 = MP_ReadPciEConfigSpace(sc, 0x2710);
4536                         Data32 &=0xFFFF0FFF;
4537                         Data32 |= (0x04 << 12);
4538                         MP_WritePciEConfigSpace(sc, 0x2710, Data32);
4539                 }
4540
4541                 if (sc->re_type == MACFG_68 || sc->re_type == MACFG_69) {
4542                         Data32 = re_eri_read(sc, 0xD4, 4, ERIAR_ExGMAC);
4543                         Data32 |= (BIT_8 | BIT_9 | BIT_10 | BIT_11 | BIT_12);
4544                         re_eri_write(sc, 0xD4, 4, Data32, ERIAR_ExGMAC);
4545
4546                         Data32 = re_eri_read(sc, 0xDC, 4, ERIAR_ExGMAC);
4547                         Data32 |= (BIT_2| BIT_3 | BIT_4);
4548                         re_eri_write(sc, 0xDC, 4, Data32, ERIAR_ExGMAC);
4549                 } else {
4550                         Data32 = re_eri_read(sc, 0xD4, 4, ERIAR_ExGMAC);
4551                         Data32 |= (BIT_7 | BIT_8 | BIT_9 | BIT_10 | BIT_11 | BIT_12);
4552                         re_eri_write(sc, 0xD4, 4, Data32, ERIAR_ExGMAC);
4553                 }
4554
4555                 re_eri_write(sc, 0xC8, 4, 0x00080002, ERIAR_ExGMAC);
4556                 re_eri_write(sc, 0xCC, 1, 0x38, ERIAR_ExGMAC);
4557                 re_eri_write(sc, 0xD0, 1, 0x48, ERIAR_ExGMAC);
4558                 re_eri_write(sc, 0xE8, 4, 0x00100006, ERIAR_ExGMAC);
4559
4560                 re_eri_write(sc, 0x5F0, 4, 0x4F87, ERIAR_ExGMAC);
4561
4562                 Data32 = re_eri_read(sc, 0xdc, 4, ERIAR_ExGMAC);
4563                 Data32 &= ~BIT_0;
4564                 re_eri_write(sc, 0xdc, 1, Data32, ERIAR_ExGMAC);
4565                 Data32 |= BIT_0;
4566                 re_eri_write(sc, 0xdc, 1, Data32, ERIAR_ExGMAC);
4567
4568                 Data32 = re_eri_read(sc, 0x2FC, 4, ERIAR_ExGMAC);
4569                 Data32 &= ~(BIT_0 | BIT_1 | BIT_2);
4570                 Data32 |= (BIT_0);
4571                 re_eri_write(sc, 0x2FC, 4, Data32, ERIAR_ExGMAC);
4572
4573                 Data32 = re_eri_read(sc, 0x1B0, 4, ERIAR_ExGMAC);
4574                 Data32 &= ~BIT_12;
4575                 re_eri_write(sc, 0x1B0, 4, Data32, ERIAR_ExGMAC);
4576
4577                 CSR_WRITE_4(sc, RE_TXCFG, CSR_READ_4(sc, RE_TXCFG) | BIT_7);
4578                 CSR_WRITE_1(sc, 0xD3, CSR_READ_1(sc, 0xD3) & ~BIT_7);
4579                 CSR_WRITE_1(sc, 0x1B, CSR_READ_1(sc, 0x1B) & ~0x07);
4580
4581                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
4582
4583                 if (sc->re_type == MACFG_56 || sc->re_type == MACFG_57) {
4584                         ClearPCIePhyBit(sc, 0x00, BIT_3);
4585                         ClearAndSetPCIePhyBit(sc,
4586                                               0x0C,
4587                                               (BIT_13|BIT_12|BIT_10|BIT_9|BIT_8|BIT_7|BIT_6|BIT_4),
4588                                               (BIT_11|BIT_5)
4589                                              );
4590                         SetPCIePhyBit(sc, 0x1E, BIT_0);
4591                         ClearPCIePhyBit(sc, 0x19, BIT_15);
4592                 }  else if (sc->re_type == MACFG_58) {
4593                         SetPCIePhyBit(sc, 0x00, (BIT_3));
4594                         ClearAndSetPCIePhyBit(sc,
4595                                               0x0C,
4596                                               (BIT_13 | BIT_12 | BIT_11 | BIT_10 | BIT_8 | BIT_7 | BIT_6 | BIT_5 | BIT_4),
4597                                               BIT_9
4598                                              );
4599                 }  else if (sc->re_type == MACFG_59) {
4600                         ClearPCIePhyBit(sc, 0x00, BIT_3);
4601                         ClearAndSetPCIePhyBit(sc,
4602                                               0x0C,
4603                                               (BIT_13 | BIT_12 | BIT_10 | BIT_9 | BIT_8 | BIT_7 | BIT_6 | BIT_4),
4604                                               (BIT_5 | BIT_11)
4605                                              );
4606
4607                         SetPCIePhyBit(sc, 0x1E, BIT_0);
4608                         ClearPCIePhyBit(sc, 0x19, BIT_15);
4609                         MP_WriteEPhyUshort(sc, 0x19, 0x7C00);
4610                         MP_WriteEPhyUshort(sc, 0x1E, 0x20EB);
4611                         MP_WriteEPhyUshort(sc, 0x0D, 0x1666);
4612                         MP_WriteEPhyUshort(sc, 0x00, 0x10A3);
4613
4614                         MP_WriteEPhyUshort(sc, 0x06, 0xF050);
4615                 } else if (sc->re_type == MACFG_60) {
4616                         ClearPCIePhyBit(sc, 0x00, BIT_3);
4617                         ClearAndSetPCIePhyBit(sc,
4618                                               0x0C,
4619                                               (BIT_13 | BIT_12 | BIT_10 | BIT_9 | BIT_8 | BIT_7 | BIT_6 | BIT_4),
4620                                               (BIT_5 | BIT_11)
4621                                              );
4622                         SetPCIePhyBit(sc, 0x1E, BIT_0);
4623                         ClearPCIePhyBit(sc, 0x19, BIT_15);
4624
4625                         ClearPCIePhyBit(sc, 0x19, (BIT_5 | BIT_0));
4626
4627                         SetPCIePhyBit(sc, 0x1E, BIT_13);
4628                         ClearPCIePhyBit(sc, 0x0D, BIT_8);
4629                         SetPCIePhyBit(sc, 0x0D, BIT_9);
4630                         SetPCIePhyBit(sc, 0x00, BIT_7);
4631
4632                         SetPCIePhyBit(sc, 0x06, BIT_4);
4633                 } else if (sc->re_type == MACFG_68 || sc->re_type == MACFG_69) {
4634                         ClearPCIePhyBit(sc, 0x1E, BIT_11);
4635
4636                         SetPCIePhyBit(sc, 0x1E, BIT_0);
4637                         SetPCIePhyBit(sc, 0x1D, BIT_11);
4638
4639                         MP_WriteEPhyUshort(sc, 0x05, 0x2089);
4640                         MP_WriteEPhyUshort(sc, 0x06, 0x5881);
4641
4642                         MP_WriteEPhyUshort(sc, 0x04, 0x154A);
4643                         MP_WriteEPhyUshort(sc, 0x01, 0x068B);
4644                 }
4645
4646                 if (sc->re_type == MACFG_60) {
4647                         data16 = MP_ReadMcuAccessRegWord(sc, 0xD3C0);
4648                         data16 &= 0xF000;
4649                         data16 |= 0x3A9;
4650                         MP_WriteMcuAccessRegWord(sc, 0xD3C0, data16);
4651
4652                         data16 = MP_ReadMcuAccessRegWord(sc, 0xD3C2);
4653                         data16 &= 0xFF00;
4654                         MP_WriteMcuAccessRegWord(sc, 0xD3C2, data16);
4655
4656                         data16 = MP_ReadMcuAccessRegWord(sc, 0xD3C4);
4657                         data16 |= (BIT_0);
4658                         MP_WriteMcuAccessRegWord(sc, 0xD3C4, data16);
4659                 } else if (sc->re_type == MACFG_68 || sc->re_type == MACFG_69) {
4660                         if (sc->RequireAdjustUpsTxLinkPulseTiming) {
4661                                 data16 = MP_ReadMcuAccessRegWord(sc, 0xD412);
4662                                 data16 &= ~(0x0FFF);
4663                                 data16 |= sc->SwrCnt1msIni ;
4664                                 MP_WriteMcuAccessRegWord(sc, 0xD412, data16);
4665                         }
4666
4667                         data16 = MP_ReadMcuAccessRegWord(sc, 0xE056);
4668                         data16 &= ~(BIT_7 | BIT_6 | BIT_5 | BIT_4);
4669                         data16 |= (BIT_6 | BIT_5 | BIT_4);
4670                         MP_WriteMcuAccessRegWord(sc, 0xE056, data16);
4671
4672                         data16 = MP_ReadMcuAccessRegWord(sc, 0xE052);
4673                         data16 &= ~(BIT_14 | BIT_13);
4674                         data16 |= BIT_15;
4675                         data16 |= BIT_3;
4676                         MP_WriteMcuAccessRegWord(sc, 0xE052, data16);
4677
4678                         data16 = MP_ReadMcuAccessRegWord(sc, 0xD420);
4679                         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);
4680                         data16 |= 0x47F;
4681                         MP_WriteMcuAccessRegWord(sc, 0xD420, data16);
4682
4683                         data16 = MP_ReadMcuAccessRegWord(sc, 0xE0D6);
4684                         data16 &= ~(BIT_8 | BIT_7 | BIT_6 | BIT_5 | BIT_4 | BIT_3 | BIT_2 | BIT_1 | BIT_0);
4685                         data16 |= 0x17F;
4686                         MP_WriteMcuAccessRegWord(sc, 0xE0D6, data16);
4687                 }
4688
4689
4690                 CSR_WRITE_1(sc, RE_CFG5, CSR_READ_1(sc, RE_CFG5) | BIT_0);
4691                 CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) | BIT_7);
4692                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
4693
4694                 CSR_WRITE_1(sc, 0xD0, CSR_READ_1(sc, 0xD0) | BIT_6);
4695                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) | BIT_6);
4696
4697                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) & ~BIT_3);
4698
4699                 CSR_WRITE_1 (sc, RE_MTPS, 0x27);
4700
4701                 if (sc->re_type == MACFG_56 || sc->re_type == MACFG_57 ||
4702                     sc->re_type == MACFG_58 || sc->re_type == MACFG_59) {
4703                         MP_WriteMcuAccessRegWord(sc, 0xC140, 0xFFFF);
4704                 } else if (sc->re_type == MACFG_68 || sc->re_type == MACFG_69) {
4705                         MP_WriteMcuAccessRegWord(sc, 0xC140, 0xFFFF);
4706                         MP_WriteMcuAccessRegWord(sc, 0xC142, 0xFFFF);
4707                 }
4708
4709                 if (ifp->if_mtu > ETHERMTU) {
4710                         ifp->if_capenable &= ~IFCAP_HWCSUM ;
4711                         ifp->if_hwassist &= ~RE_CSUM_FEATURES;
4712                 } else {
4713                         if (sc->re_tx_cstag) {
4714                                 ifp->if_capenable |= IFCAP_TXCSUM;
4715                                 ifp->if_hwassist |= RE_CSUM_FEATURES;
4716                         }
4717                         if (sc->re_rx_cstag) {
4718                                 ifp->if_capenable |= IFCAP_RXCSUM;
4719                         }
4720                 }
4721
4722                 /* disable clock request. */
4723                 pci_write_config(sc->dev, 0x81, 0x00, 1);
4724         } else if (macver == 0x50000000) {
4725
4726                 CSR_WRITE_1(sc, RE_CFG5, CSR_READ_1(sc, RE_CFG5) & ~BIT_0);
4727                 CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) & ~BIT_7);
4728
4729                 /*set configuration space offset 0x70f to 0x17*/
4730                 Data32 = MP_ReadPciEConfigSpace(sc, 0x870c);
4731                 Data32 &=0xC0FFFFFF;
4732                 Data32 |= (0x17 << 24);
4733                 MP_WritePciEConfigSpace(sc, 0x870c, Data32);
4734
4735                 data8 = pci_read_config(sc->dev, 0x79, 1);
4736                 data8 &= ~0x70;
4737                 data8 |= 0x50;
4738                 pci_write_config(sc->dev, 0x79, data8, 1);
4739
4740                 Data32 = re_eri_read(sc, 0xD4, 4, ERIAR_ExGMAC);
4741                 Data32 |= BIT_7 | BIT_8 | BIT_9 | BIT_10 | BIT_11 | BIT_12;
4742                 re_eri_write(sc, 0xD4, 4, Data32, ERIAR_ExGMAC);
4743
4744                 re_eri_write(sc, 0xC8, 4, 0x00080002, ERIAR_ExGMAC);
4745                 re_eri_write(sc, 0xCC, 1, 0x2F, ERIAR_ExGMAC);
4746                 re_eri_write(sc, 0xD0, 1, 0x5F, ERIAR_ExGMAC);
4747                 re_eri_write(sc, 0xE8, 4, 0x00100006, ERIAR_ExGMAC);
4748
4749                 if (sc->re_type == MACFG_62 || sc->re_type == MACFG_67) {
4750                         OOB_mutex_lock(sc);
4751                         re_eri_write(sc, 0x5F0, 4, 0x4F87, ERIAR_ExGMAC);
4752                         OOB_mutex_unlock(sc);
4753                 }
4754
4755                 Data32 = re_eri_read(sc, 0xdc, 4, ERIAR_ExGMAC);
4756                 Data32 &= ~BIT_0;
4757                 re_eri_write(sc, 0xdc, 1, Data32, ERIAR_ExGMAC);
4758                 Data32 |= BIT_0;
4759                 re_eri_write(sc, 0xdc, 1, Data32, ERIAR_ExGMAC);
4760
4761                 Data32 = re_eri_read(sc, 0x2FC, 4, ERIAR_ExGMAC);
4762                 Data32 &= ~(BIT_0 | BIT_1 | BIT_2);
4763                 Data32 |= (BIT_0);
4764                 re_eri_write(sc, 0x2FC, 4, Data32, ERIAR_ExGMAC);
4765
4766                 Data32 = re_eri_read(sc, 0x1B0, 4, ERIAR_ExGMAC);
4767                 Data32 &= ~BIT_12;
4768                 re_eri_write(sc, 0x1B0, 4, Data32, ERIAR_ExGMAC);
4769
4770                 CSR_WRITE_4(sc, RE_TXCFG, CSR_READ_4(sc, RE_TXCFG) | BIT_7);
4771                 CSR_WRITE_1(sc, 0xD3, CSR_READ_1(sc, 0xD3) & ~BIT_7);
4772                 CSR_WRITE_1(sc, 0x1B, CSR_READ_1(sc, 0x1B) & ~0x07);
4773
4774                 CSR_WRITE_2 (sc, RE_CPlusCmd, 0x2060);
4775
4776                 if (sc->re_type == MACFG_61) {
4777                         MP_WriteEPhyUshort(sc, 0x00, 0x10AB);
4778                         MP_WriteEPhyUshort(sc, 0x06, 0xF030);
4779                         MP_WriteEPhyUshort(sc, 0x08, 0x2006);
4780                         MP_WriteEPhyUshort(sc, 0x0D, 0x1666);
4781                         ClearPCIePhyBit(sc, 0x0C, (BIT_13 | BIT_12 | BIT_11 | BIT_10 | BIT_9 | BIT_8 | BIT_7 | BIT_6 | BIT_5 | BIT_4));
4782                 }  else if (sc->re_type == MACFG_62) {
4783                         MP_WriteEPhyUshort(sc, 0x00, 0x10A3);
4784                         MP_WriteEPhyUshort(sc, 0x19, 0xFC00);
4785                         MP_WriteEPhyUshort(sc, 0x1E, 0x20EA);
4786                 } else if (sc->re_type == MACFG_67) {
4787                         SetPCIePhyBit(sc, 0x00, BIT_7);
4788                         ClearAndSetPCIePhyBit(sc,
4789                                               0x0D,
4790                                               BIT_8,
4791                                               BIT_9
4792                                              );
4793                         ClearPCIePhyBit(sc, 0x19, (BIT_15 | BIT_5 | BIT_0));
4794                         SetPCIePhyBit(sc, 0x1E, BIT_13);
4795                 }
4796
4797
4798                 CSR_WRITE_1(sc, RE_CFG5, CSR_READ_1(sc, RE_CFG5) | BIT_0);
4799                 CSR_WRITE_1(sc, RE_CFG2, CSR_READ_1(sc, RE_CFG2) | BIT_7);
4800                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_0);
4801
4802                 CSR_WRITE_1(sc, 0xD0, CSR_READ_1(sc, 0xD0) | BIT_6);
4803                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) | BIT_6);
4804
4805                 CSR_WRITE_1(sc, 0xF2, CSR_READ_1(sc, 0xF2) & ~BIT_3);
4806
4807                 CSR_WRITE_1 (sc, RE_MTPS, 0x27);
4808
4809                 if (sc->re_type == MACFG_67) {
4810                         data16 = MP_ReadMcuAccessRegWord(sc, 0xD3E2);
4811                         data16 &= 0xF000;
4812                         data16 |= 0x3A9;
4813                         MP_WriteMcuAccessRegWord(sc, 0xD3E2, data16);
4814
4815                         data16 = MP_ReadMcuAccessRegWord(sc, 0xD3E4);
4816                         data16 &= 0xFF00;
4817                         MP_WriteMcuAccessRegWord(sc, 0xD3E4, data16);
4818
4819                         data16 = MP_ReadMcuAccessRegWord(sc, 0xE860);
4820                         data16 |= BIT_7;
4821                         MP_WriteMcuAccessRegWord(sc, 0xE860, data16);
4822                 }
4823
4824                 MP_WriteMcuAccessRegWord(sc, 0xC140, 0xFFFF);
4825                 MP_WriteMcuAccessRegWord(sc, 0xC142, 0xFFFF);
4826
4827                 if (ifp->if_mtu > ETHERMTU) {
4828                         ifp->if_capenable &= ~IFCAP_HWCSUM ;
4829                         ifp->if_hwassist &= ~RE_CSUM_FEATURES;
4830                 } else {
4831                         if (sc->re_tx_cstag) {
4832                                 ifp->if_capenable |= IFCAP_TXCSUM;
4833                                 ifp->if_hwassist |= RE_CSUM_FEATURES;
4834                         }
4835                         if (sc->re_rx_cstag) {
4836                                 ifp->if_capenable |= IFCAP_RXCSUM;
4837                         }
4838                 }
4839
4840                 /* disable clock request. */
4841                 pci_write_config(sc->dev, 0x81, 0x00, 1);
4842         }
4843
4844         //clear io_rdy_l23
4845         switch (sc->re_type) {
4846         case MACFG_42:
4847         case MACFG_43:
4848         case MACFG_52:
4849         case MACFG_53:
4850         case MACFG_54:
4851         case MACFG_55:
4852         case MACFG_56:
4853         case MACFG_57:
4854         case MACFG_58:
4855         case MACFG_59:
4856         case MACFG_60:
4857         case MACFG_61:
4858         case MACFG_62:
4859         case MACFG_67:
4860         case MACFG_68:
4861         case MACFG_69:
4862                 CSR_WRITE_1(sc, RE_CFG3, CSR_READ_1(sc, RE_CFG3) & ~BIT_1);
4863                 break;
4864         }
4865
4866         //clear wol
4867         re_clrwol(sc);
4868
4869         data16 = CSR_READ_2(sc, RE_CPlusCmd);
4870         if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0)
4871                 data16 |= RL_CPLUSCMD_VLANSTRIP;
4872         else
4873                 data16 &= ~RL_CPLUSCMD_VLANSTRIP;
4874
4875         if ((ifp->if_capenable & IFCAP_RXCSUM) != 0)
4876                 data16 |= RL_RxChkSum;
4877         else
4878                 data16 &= ~RL_RxChkSum;
4879         CSR_WRITE_2 (sc, RE_CPlusCmd, data16);
4880
4881         CSR_WRITE_1(sc, RE_EECMD, RE_EEMODE_OFF);
4882         //CSR_WRITE_1(sc, 0xec, 0x3f);
4883
4884         if (sc->re_device_id == RT_DEVICEID_8169 || sc->re_device_id == RT_DEVICEID_8169SC) {
4885                 /* Enable transmit and receive.*/
4886                 CSR_WRITE_1(sc, RE_COMMAND, RE_CMD_TX_ENB | RE_CMD_RX_ENB);
4887
4888                 /* Set the initial TX configuration.*/
4889                 CSR_WRITE_4(sc, RE_TXCFG, RE_TXCFG_CONFIG);
4890
4891                 /* Set the initial RX configuration.*/
4892                 /*
4893                  * Program the multicast filter, if necessary.
4894                  */
4895                 re_set_rx_packet_filter(sc);
4896         } else {
4897                 /* Set the initial RX configuration.*/
4898                 /*
4899                  * Program the multicast filter, if necessary.
4900                  */
4901                 re_set_rx_packet_filter(sc);
4902
4903                 /* Enable transmit and receive.*/
4904                 CSR_WRITE_1(sc, RE_COMMAND, RE_CMD_TX_ENB | RE_CMD_RX_ENB);
4905         }
4906
4907 #ifndef __DragonFly__
4908         ifp->if_drv_flags |= IFF_DRV_RUNNING;
4909         ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
4910
4911         /*
4912         * Enable interrupts.
4913         */
4914         CSR_WRITE_2(sc, RE_IMR, RE_INTRS);
4915 #endif
4916 }
4917
4918 static void re_init_unlock(void *xsc)   /* Software & Hardware Initialize */
4919 {
4920         struct re_softc         *sc = xsc;
4921         struct ifnet            *ifp;
4922 #ifndef __DragonFly__
4923 #if OS_VER < VERSION(6,0)
4924         int                     i;
4925 #endif
4926 #endif  /* !__DragonFly__ */
4927         union {
4928                 uint32_t align_dummy;
4929                 u_char eaddr[ETHER_ADDR_LEN];
4930         } eaddr;
4931
4932         ifp = RE_GET_IFNET(sc);
4933
4934 #ifndef __DragonFly__
4935         /*
4936          * Cancel pending I/O and free all RX/TX buffers.
4937          */
4938         re_stop(sc);
4939 #endif  /* !__DragonFly__ */
4940
4941         /* Copy MAC address on stack to align. */
4942 #ifndef __DragonFly__
4943 #if OS_VER < VERSION(6,0)
4944         bcopy((char *)&sc->arpcom.ac_enaddr, eaddr.eaddr, ETHER_ADDR_LEN);
4945 #elif OS_VER < VERSION(7,0)
4946         bcopy(IFP2ENADDR(ifp), eaddr.eaddr, ETHER_ADDR_LEN);
4947 #else
4948         bcopy(IF_LLADDR(ifp), eaddr.eaddr, ETHER_ADDR_LEN);
4949 #endif
4950 #else   /* __DragonFly__ */
4951         bcopy(IF_LLADDR(ifp), eaddr.eaddr, ETHER_ADDR_LEN);
4952 #endif  /* !__DragonFly__ */
4953
4954         /* Init our MAC address */
4955         CSR_WRITE_1(sc, RE_EECMD, RE_EEMODE_WRITECFG);
4956         CSR_WRITE_4(sc, RE_IDR0,
4957                     htole32(*(u_int32_t *)(&eaddr.eaddr[0])));
4958         CSR_WRITE_4(sc, RE_IDR4,
4959                     htole32(*(u_int32_t *)(&eaddr.eaddr[4])));
4960
4961         switch (sc->re_type) {
4962         case MACFG_36:
4963         case MACFG_37:
4964         case MACFG_54:
4965         case MACFG_55:
4966                 CSR_WRITE_4(sc, RE_SecMAC0,
4967                             htole32(*(u_int32_t *)(&eaddr.eaddr[0])));
4968                 CSR_WRITE_2(sc, RE_SecMAC4,
4969                             htole16(*(u_int16_t *)(&eaddr.eaddr[4])));
4970                 break;
4971         }
4972
4973         CSR_WRITE_1(sc, RE_EECMD, RE_EEMODE_OFF);
4974
4975 #ifndef __DragonFly__
4976         re_hw_start_unlock(sc);
4977 #endif
4978
4979         return;
4980 }
4981
4982 #ifndef __DragonFly__
4983 static void re_init(void *xsc)          /* Software & Hardware Initialize */
4984 {
4985         struct re_softc         *sc = xsc;
4986         struct ifnet            *ifp;
4987
4988         RE_LOCK(sc);
4989         ifp = RE_GET_IFNET(sc);
4990
4991         if (re_link_ok(sc)) {
4992                 sc->link_state = LINK_STATE_UP;
4993                 re_link_state_change(ifp, sc->link_state);
4994                 re_link_on_patch(sc);
4995         }
4996
4997         sc->re_link_chg_det = 1;
4998         re_start_timer(sc);
4999
5000         RE_UNLOCK(sc);
5001 }
5002
5003 /*
5004  * Initialize the transmit descriptors.
5005  */
5006 static int re_var_init(struct re_softc *sc)
5007 {
5008         int                     i;
5009         union RxDesc *rxptr;
5010         union TxDesc *txptr;
5011
5012         sc->re_desc.rx_cur_index = 0;
5013         sc->re_desc.rx_last_index = 0;
5014         rxptr = sc->re_desc.rx_desc;
5015         for (i = 0; i < RE_RX_BUF_NUM; i++) {
5016                 memset(&rxptr[i], 0, sizeof(union RxDesc));
5017
5018                 /* Init the RX buffer pointer register. */
5019                 bus_dmamap_load(sc->re_desc.re_rx_mtag,
5020                                 sc->re_desc.re_rx_dmamap[i],
5021                                 sc->re_desc.rx_buf[i]->m_data, sc->re_rx_desc_buf_sz,
5022                                 re_rx_dma_map_buf,
5023                                 &rxptr[i],
5024                                 0);
5025                 bus_dmamap_sync(sc->re_desc.re_rx_mtag,
5026                                 sc->re_desc.re_rx_dmamap[i],
5027                                 BUS_DMASYNC_PREREAD);
5028
5029                 rxptr[i].ul[0] = htole32(sc->re_rx_desc_buf_sz);
5030                 if (i == (RE_RX_BUF_NUM - 1))
5031                         rxptr[i].ul[0] |= htole32(RL_RDESC_CMD_EOR);
5032                 rxptr[i].ul[0] |= htole32(RL_RDESC_CMD_OWN);
5033         }
5034
5035         bus_dmamap_load(sc->re_desc.rx_desc_tag,
5036                         sc->re_desc.rx_desc_dmamap,
5037                         sc->re_desc.rx_desc,
5038                         sizeof(union RxDesc)*RE_RX_BUF_NUM,
5039                         re_dma_map_rxdesc,
5040                         sc,
5041                         0);
5042         bus_dmamap_sync(sc->re_desc.rx_desc_tag,
5043                         sc->re_desc.rx_desc_dmamap,
5044                         BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
5045
5046         sc->re_desc.tx_cur_index = 0;
5047         sc->re_desc.tx_last_index = 0;
5048         txptr = sc->re_desc.tx_desc;
5049         for (i = 0; i < RE_TX_BUF_NUM; i++) {
5050                 memset(&txptr[i], 0, sizeof(union TxDesc));
5051                 if (i == (RE_TX_BUF_NUM - 1))
5052                         txptr[i].ul[0] = htole32(RL_TDESC_CMD_EOR);
5053         }
5054
5055         bus_dmamap_load(sc->re_desc.tx_desc_tag,
5056                         sc->re_desc.tx_desc_dmamap,
5057                         sc->re_desc.tx_desc,
5058                         sizeof(union RxDesc) * RE_TX_BUF_NUM,
5059                         re_dma_map_txdesc,
5060                         sc,
5061                         0);
5062         bus_dmamap_sync(sc->re_desc.tx_desc_tag,
5063                         sc->re_desc.tx_desc_dmamap,
5064                         BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
5065
5066         return 0;
5067 }
5068 #endif  /* !__DragonFly__ */
5069
5070 static void re_reset(struct re_softc *sc)
5071 {
5072         register int            i;
5073
5074         CSR_WRITE_4(sc, RE_RXCFG, CSR_READ_4(sc, RE_RXCFG)& ~0x3F);
5075
5076         switch (sc->re_type) {
5077         case MACFG_3:
5078         case MACFG_4:
5079         case MACFG_5:
5080         case MACFG_6:
5081                 DELAY(10000);
5082                 break;
5083         case MACFG_11:
5084         case MACFG_12:
5085         case MACFG_13:
5086         case MACFG_14:
5087         case MACFG_15:
5088         case MACFG_16:
5089         case MACFG_17:
5090         case MACFG_18:
5091         case MACFG_19:
5092         case MACFG_21:
5093         case MACFG_22:
5094         case MACFG_23:
5095         case MACFG_24:
5096         case MACFG_25:
5097         case MACFG_26:
5098         case MACFG_27:
5099         case MACFG_28:
5100         case MACFG_31:
5101         case MACFG_32:
5102         case MACFG_33:
5103         case MACFG_36:
5104         case MACFG_37:
5105         case MACFG_41:
5106         case MACFG_42:
5107         case MACFG_43:
5108         case MACFG_54:
5109         case MACFG_55:
5110         case MACFG_63:
5111         case MACFG_64:
5112         case MACFG_65:
5113         case MACFG_66:
5114                 CSR_WRITE_1(sc, RE_COMMAND, 0x8C);
5115                 break;
5116         case MACFG_38:
5117         case MACFG_39:
5118         case MACFG_50:
5119         case MACFG_51:
5120         case MACFG_52:
5121         case MACFG_53:
5122                 CSR_WRITE_1(sc, RE_COMMAND, 0x8C);
5123                 while (!(CSR_READ_4(sc,RE_TXCFG) & BIT_11)) DELAY(100);
5124                 break;
5125         case MACFG_56:
5126         case MACFG_57:
5127         case MACFG_58:
5128         case MACFG_59:
5129         case MACFG_60:
5130         case MACFG_61:
5131         case MACFG_62:
5132         case MACFG_67:
5133         case MACFG_68:
5134         case MACFG_69:
5135                 DELAY(2000);
5136                 break;
5137         default:
5138                 DELAY(10000);
5139                 break;
5140         }
5141         DELAY(200);
5142         CSR_WRITE_1(sc, RE_COMMAND, RE_CMD_RESET);
5143
5144         for (i = 0; i < RE_TIMEOUT; i++) {
5145                 DELAY(10);
5146                 if (!(CSR_READ_1(sc, RE_COMMAND) & RE_CMD_RESET))
5147                         break;
5148         }
5149
5150         if (i == RE_TIMEOUT)
5151                 device_printf(sc->dev,"reset never completed!\n");
5152
5153         return;
5154 }
5155
5156 static u_int8_t re_link_ok(struct re_softc *sc)
5157 {
5158         u_int8_t        retval;
5159
5160         retval = (CSR_READ_1(sc, RE_PHY_STATUS) & RL_PHY_STATUS_LINK_STS) ? 1 : 0;
5161
5162         return retval;
5163 }
5164
5165 #ifndef __DragonFly__
5166 static void
5167 re_set_wol_linkspeed(struct re_softc *sc)
5168 {
5169         u_int8_t wol_link_speed;
5170         u_int16_t anar;
5171
5172         MP_WritePhyUshort(sc, 0x1F, 0x0000);
5173
5174         wol_link_speed = RE_WOL_LINK_SPEED_100M_FIRST;
5175         if (!re_check_dash(sc)) {
5176                 if (re_link_ok(sc)) {
5177                         u_int16_t anlpar;
5178
5179                         anlpar = MP_ReadPhyUshort(sc,MII_ANLPAR);
5180                         if ((anlpar & ANLPAR_10_FD) || (anlpar & ANLPAR_10)) {
5181                                 wol_link_speed = RE_WOL_LINK_SPEED_10M_FIRST;
5182                         } else {
5183                                 wol_link_speed = RE_WOL_LINK_SPEED_100M_FIRST;
5184                         }
5185                 }
5186         }
5187
5188         anar = MP_ReadPhyUshort(sc,MII_ANAR);
5189
5190         if (wol_link_speed == RE_WOL_LINK_SPEED_10M_FIRST)
5191                 anar &= ~(ANAR_TX_FD | ANAR_TX);
5192
5193         if (sc->re_device_id==RT_DEVICEID_8169 || sc->re_device_id==RT_DEVICEID_8169SC ||
5194             sc->re_device_id==RT_DEVICEID_8168 || sc->re_device_id==RT_DEVICEID_8161) {
5195                 u_int16_t gbcr;
5196
5197                 gbcr = MP_ReadPhyUshort(sc,MII_100T2CR);
5198                 gbcr &= ~(GTCR_ADV_1000TFDX|GTCR_ADV_1000THDX);
5199                 MP_WritePhyUshort(sc, MII_100T2CR, gbcr);
5200                 MP_WritePhyUshort(sc, MII_ANAR, anar);
5201                 MP_WritePhyUshort(sc, MII_BMCR, BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG);
5202         } else if (sc->re_type == MACFG_36) {
5203                 MP_WritePhyUshort(sc, MII_ANAR, anar);
5204                 MP_WritePhyUshort(sc, MII_BMCR, BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG);
5205         } else {
5206                 MP_WritePhyUshort(sc, MII_ANAR, anar);
5207                 MP_WritePhyUshort(sc, MII_BMCR, BMCR_AUTOEN | BMCR_STARTNEG);
5208         }
5209 }
5210
5211 static void
5212 re_setwol(struct re_softc *sc)
5213 {
5214         struct ifnet            *ifp;
5215         int                     pmc;
5216         uint16_t                pmstat;
5217         uint8_t                 v;
5218
5219         RE_LOCK_ASSERT(sc);
5220
5221         ifp = RE_GET_IFNET(sc);
5222
5223         if ((ifp->if_capenable & IFCAP_WOL) == 0) {
5224                 re_phy_power_down(sc->dev);
5225                 return;
5226         }
5227
5228         if (pci_find_cap(sc->dev, PCIY_PMG, &pmc) != 0)
5229                 return;
5230
5231         /* Enable config register write. */
5232         CSR_WRITE_1(sc, RE_EECMD, RE_EEMODE_WRITECFG);
5233
5234         /* Enable PME. */
5235         if (sc->re_device_id==RT_DEVICEID_8169 || sc->re_device_id==RT_DEVICEID_8169SC) {
5236                 v = CSR_READ_1(sc, RE_CFG1);
5237                 v &= ~RE_CFG1_PME;
5238                 if ((ifp->if_capenable & IFCAP_WOL) != 0)
5239                         v |= RE_CFG1_PME;
5240                 CSR_WRITE_1(sc, RE_CFG1, v);
5241         }
5242
5243         if (sc->re_if_flags & RL_FLAG_MAGIC_PACKET_V2) {
5244                 uint32_t                Data32;
5245
5246                 Data32 = re_eri_read(sc, 0xDC, 4, ERIAR_ExGMAC);
5247                 Data32 &= ~(BIT_16);
5248                 if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0)
5249                         Data32 |= BIT_16;
5250                 re_eri_write(sc, 0xDC, 4, Data32, ERIAR_ExGMAC);
5251         } else {
5252                 v = CSR_READ_1(sc, RE_CFG3);
5253                 v &= ~(RL_CFG3_WOL_MAGIC);
5254                 if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0)
5255                         v |= RL_CFG3_WOL_MAGIC;
5256                 CSR_WRITE_1(sc, RE_CFG3, v);
5257         }
5258
5259         v = CSR_READ_1(sc, RE_CFG5);
5260         v &= ~(RL_CFG5_WOL_BCAST | RL_CFG5_WOL_MCAST | RL_CFG5_WOL_UCAST |
5261                RL_CFG5_WOL_LANWAKE);
5262
5263         if ((ifp->if_capenable & IFCAP_WOL_UCAST) != 0)
5264                 v |= RL_CFG5_WOL_UCAST;
5265         if ((ifp->if_capenable & IFCAP_WOL_MCAST) != 0)
5266                 v |= RL_CFG5_WOL_MCAST | RL_CFG5_WOL_BCAST;
5267         if ((ifp->if_capenable & IFCAP_WOL) != 0)
5268                 v |= RL_CFG5_WOL_LANWAKE;
5269         CSR_WRITE_1(sc, RE_CFG5, v);
5270
5271         /* Config register write done. */
5272         CSR_WRITE_1(sc, RE_EECMD, RE_EEMODE_OFF);
5273
5274         /*
5275          * It seems that hardware resets its link speed to 100Mbps in
5276          * power down mode so switching to 100Mbps in driver is not
5277          * needed.
5278          */
5279
5280         /* Request PME if WOL is requested. */
5281         pmstat = pci_read_config(sc->dev, pmc + PCIR_POWER_STATUS, 2);
5282         pmstat &= ~(PCIM_PSTAT_PMEENABLE);
5283         if ((ifp->if_capenable & IFCAP_WOL) != 0)
5284                 pmstat |= PCIM_PSTAT_PMEENABLE;
5285         pci_write_config(sc->dev, pmc + PCIR_POWER_STATUS, pmstat, 2);
5286
5287         /* Put controller into sleep mode. */
5288         if ((ifp->if_capenable & IFCAP_WOL) != 0) {
5289                 re_set_rx_packet_filter_in_sleep_state(sc);
5290                 re_set_wol_linkspeed(sc);
5291                 if (sc->re_type == MACFG_21 || sc->re_type == MACFG_22)
5292                         CSR_WRITE_1(sc, RE_COMMAND, RE_CMD_RX_ENB);
5293         }
5294 }
5295 #endif  /* !__DragonFly__ */
5296
5297 static void
5298 re_clrwol(struct re_softc *sc)
5299 {
5300         int                     pmc;
5301         uint16_t                pmstat;
5302         uint8_t                 v;
5303
5304         RE_LOCK_ASSERT(sc);
5305
5306 #ifndef __DragonFly__
5307         if (pci_find_cap(sc->dev, PCIY_PMG, &pmc) != 0)
5308                 return;
5309 #else
5310         if (pci_find_extcap(sc->dev, PCIY_PMG, &pmc) != 0)
5311                 return;
5312 #endif
5313
5314         /* Disable PME and clear PME status. */
5315         pmstat = pci_read_config(sc->dev, pmc + PCIR_POWER_STATUS, 2);
5316         pmstat &= ~PCIM_PSTAT_PMEENABLE;
5317         pci_write_config(sc->dev, pmc + PCIR_POWER_STATUS, pmstat, 2);
5318
5319         /* Enable config register write. */
5320         CSR_WRITE_1(sc, RE_EECMD, RE_EEMODE_WRITECFG);
5321
5322         if (sc->re_device_id==RT_DEVICEID_8169 || sc->re_device_id==RT_DEVICEID_8169SC) {
5323                 v = CSR_READ_1(sc, RE_CFG1);
5324                 v &= ~RE_CFG1_PME;
5325                 CSR_WRITE_1(sc, RE_CFG1, v);
5326         }
5327
5328         v = CSR_READ_1(sc, RE_CFG3);
5329         v &= ~(RL_CFG3_WOL_LINK);
5330         CSR_WRITE_1(sc, RE_CFG3, v);
5331
5332         if (sc->re_if_flags & RL_FLAG_MAGIC_PACKET_V2) {
5333                 uint32_t                Data32;
5334
5335                 Data32 = re_eri_read(sc, 0xDC, 4, ERIAR_ExGMAC);
5336                 Data32 &= ~(BIT_16);
5337                 re_eri_write(sc, 0xDC, 4, Data32, ERIAR_ExGMAC);
5338         } else {
5339                 v = CSR_READ_1(sc, RE_CFG3);
5340                 v &= ~(RL_CFG3_WOL_MAGIC);
5341                 CSR_WRITE_1(sc, RE_CFG3, v);
5342         }
5343
5344         v = CSR_READ_1(sc, RE_CFG5);
5345         v &= ~(RL_CFG5_WOL_BCAST | RL_CFG5_WOL_MCAST | RL_CFG5_WOL_UCAST);
5346         v &= ~RL_CFG5_WOL_LANWAKE;
5347         CSR_WRITE_1(sc, RE_CFG5, v);
5348
5349         /* Config register write done. */
5350         CSR_WRITE_1(sc, RE_EECMD, RE_EEMODE_OFF);
5351 }
5352
5353 /*
5354  * Stop the adapter and free any mbufs allocated to the
5355  * RX and TX lists.
5356  */
5357 #ifndef __DragonFly__
5358 static void re_stop(struct re_softc *sc)        /* Stop Driver */
5359 #else   /* __DragonFly__ */
5360 static void
5361 re_stop_rtl(struct re_softc *sc)
5362 #endif  /* !__DragonFly__ */
5363 {
5364 #ifndef __DragonFly__
5365         struct ifnet            *ifp;
5366
5367         /*      RE_LOCK_ASSERT(sc);*/
5368
5369         ifp = RE_GET_IFNET(sc);
5370 #if OS_VER < VERSION(9,0)
5371         ifp->if_timer = 0;
5372 #endif
5373
5374         re_stop_timer(sc);
5375 #endif  /* !__DragonFly__ */
5376
5377         /*
5378          * Disable accepting frames to put RX MAC into idle state.
5379          * Otherwise it's possible to get frames while stop command
5380          * execution is in progress and controller can DMA the frame
5381          * to already freed RX buffer during that period.
5382          */
5383         CSR_WRITE_4(sc, RE_RXCFG, CSR_READ_4(sc, RE_RXCFG) &
5384                     ~(RE_RXCFG_RX_ALLPHYS | RE_RXCFG_RX_INDIV | RE_RXCFG_RX_MULTI |
5385                       RE_RXCFG_RX_BROAD | RE_RXCFG_RX_RUNT | RE_RXCFG_RX_ERRPKT));
5386
5387         CSR_WRITE_2(sc, RE_IMR, 0x0000);
5388         CSR_WRITE_2(sc, RE_ISR, 0xffff);
5389         if (sc->re_type == MACFG_50 || sc->re_type == MACFG_51 || sc->re_type == MACFG_52) {
5390                 re_eri_write(sc, 0x1bc, 4, 0x0000001f, ERIAR_ExGMAC);
5391                 re_eri_write(sc, 0x1dc, 4, 0x0000002d, ERIAR_ExGMAC);
5392         } else if (sc->re_type == MACFG_38) {
5393                 re_eri_write(sc, 0x1bc, 4, 0x0000001f, ERIAR_ExGMAC);
5394                 re_eri_write(sc, 0x1dc, 4, 0x0000003f, ERIAR_ExGMAC);
5395         }
5396         re_reset(sc);
5397
5398 #ifndef __DragonFly__
5399         /*
5400          * Free the TX list buffers.
5401          */
5402         while (sc->re_desc.tx_last_index!=sc->re_desc.tx_cur_index) {
5403                 if (sc->re_desc.re_tx_mtag) {
5404                         bus_dmamap_sync(sc->re_desc.re_tx_mtag,
5405                                         sc->re_desc.re_tx_dmamap[sc->re_desc.tx_last_index],
5406                                         BUS_DMASYNC_POSTWRITE);
5407                         bus_dmamap_unload(sc->re_desc.re_tx_mtag,
5408                                           sc->re_desc.re_tx_dmamap[sc->re_desc.tx_last_index]);
5409                 }
5410
5411                 if (sc->re_desc.tx_buf[sc->re_desc.tx_last_index]!=NULL) {
5412                         m_freem(sc->re_desc.tx_buf[sc->re_desc.tx_last_index]);
5413                         sc->re_desc.tx_buf[sc->re_desc.tx_last_index] = NULL;
5414                 }
5415                 sc->re_desc.tx_last_index = (sc->re_desc.tx_last_index+1)%RE_TX_BUF_NUM;
5416         }
5417
5418         ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
5419
5420         return;
5421 #endif  /* !__DragonFly__ */
5422 }
5423
5424 #ifndef __DragonFly__
5425 /*
5426  * Main transmit routine.
5427  */
5428 static void re_start(struct ifnet *ifp)         /* Transmit Packet*/
5429 {
5430         struct re_softc         *sc;
5431         struct mbuf             *m_head = NULL;
5432
5433         sc = ifp->if_softc;     /* Paste to ifp in function re_attach(dev) */
5434
5435         RE_LOCK(sc);
5436
5437         /*      RE_LOCK_ASSERT(sc);*/
5438
5439         if ((sc->driver_detach == 1) || (sc->rx_fifo_overflow != 0)) {
5440                 RE_UNLOCK(sc);
5441                 return;
5442         }
5443
5444         while (1) {
5445                 int fs = 1, ls = 0, TxLen = 0, PktLen;
5446                 struct mbuf *ptr;
5447                 uint32_t  opts1 =0;
5448                 uint32_t  opts2 =0;
5449                 IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);  /* Remove(get) data from system transmit queue */
5450                 if (m_head == NULL) {
5451                         break;
5452                 }
5453
5454                 if (sc->re_coalesce_tx_pkt) {
5455                         if (re_encap(sc, m_head)) {
5456                                 IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
5457                                 ifp->if_drv_flags |= IFF_DRV_OACTIVE;
5458                                 break;
5459                         }
5460
5461                         m_head = sc->re_desc.tx_buf[sc->re_desc.tx_cur_index];
5462                 }
5463
5464                 if (CountMbufNum(m_head) > CountFreeTxDescNum(sc->re_desc)) {   /* No enough descriptor */
5465                         IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
5466                         ifp->if_drv_flags |= IFF_DRV_OACTIVE;
5467                         break;
5468                 }
5469
5470                 if (ifp->if_bpf) {              /* If there's a BPF listener, bounce a copy of this frame to him. */
5471                         //printf("If there's a BPF listener, bounce a copy of this frame to him. \n");
5472
5473                         /*#if OS_VER < VERSION(5, 1)*/
5474 #if OS_VER < VERSION(4,9)
5475                         bpf_mtap(ifp, m_head);
5476 #else
5477                         bpf_mtap(ifp->if_bpf, m_head);
5478 #endif
5479                 }
5480
5481                 //hw checksum
5482                 if (ifp->if_capenable & IFCAP_TXCSUM) {
5483                         if ((m_head->m_pkthdr.csum_flags & RE_CSUM_FEATURES) !=0)       {
5484                                 if (!(sc->re_if_flags & RL_FLAG_DESCV2)) {
5485                                         opts1 |= RL_IPV4CS1;
5486                                         if ((m_head->m_pkthdr.csum_flags & CSUM_TCP)!=0)
5487                                                 opts1 |=RL_TCPCS1;
5488                                         if ((m_head->m_pkthdr.csum_flags & CSUM_UDP)!=0)
5489                                                 opts1 |=RL_UDPCS1;
5490                                 } else {
5491                                         opts2 |=  RL_IPV4CS;
5492                                         if ((m_head->m_pkthdr.csum_flags & CSUM_TCP)!=0)
5493                                                 opts2 |= RL_TCPCS;
5494                                         else if ((m_head->m_pkthdr.csum_flags & CSUM_UDP)!=0)
5495                                                 opts2 |= RL_UDPCS;
5496                                 }
5497                         }
5498                 }
5499
5500                 //vlan
5501                 if (m_head->m_flags & M_VLANTAG)
5502                         opts2 |= bswap16(m_head->m_pkthdr.ether_vtag) | RL_TDESC_VLANCTL_TAG ;
5503                 ptr = m_head;
5504                 PktLen = ptr->m_pkthdr.len;
5505 #ifdef _DEBUG_
5506                 printf("PktLen=%d",PktLen);
5507 #endif
5508                 while (ptr!=NULL) {
5509                         if (ptr->m_len >0) {
5510 #ifdef _DEBUG_
5511                                 printf(", len=%d T=%d F=%d",ptr->m_len,ptr->m_type,ptr->m_flags);
5512 #endif
5513                                 TxLen += ptr->m_len;
5514                                 if (TxLen >= PktLen) {
5515                                         ls=1;
5516                                         sc->re_desc.tx_buf[sc->re_desc.tx_cur_index] = m_head;
5517                                 } else
5518                                         sc->re_desc.tx_buf[sc->re_desc.tx_cur_index] = NULL;
5519
5520                                 //vlan
5521                                 WritePacket(sc,ptr->m_data,ptr->m_len,fs,ls,opts2,opts1);
5522
5523                                 fs=0;
5524                         }
5525                         ptr = ptr->m_next;
5526                 }
5527 #ifdef _DEBUG_
5528                 printf("\n");
5529 #endif
5530         }
5531 #if OS_VER < VERSION(9,0)
5532         ifp->if_timer = 5;
5533 #endif
5534
5535         RE_UNLOCK(sc);
5536
5537         return;
5538 }
5539
5540 /*
5541  * Encapsulate an mbuf chain in a descriptor by coupling the mbuf data
5542  * pointers to the fragment pointers.
5543  */
5544 static int re_encap(struct re_softc *sc,struct mbuf *m_head)
5545 {
5546         struct mbuf             *m_new = NULL;
5547
5548         m_new = m_defrag(m_head, M_DONTWAIT);
5549
5550         if (m_new == NULL) {
5551                 printf("re%d: no memory for tx list", sc->re_unit);
5552                 return (1);
5553         }
5554         m_head = m_new;
5555
5556         /* Pad frames to at least 60 bytes. */
5557         if (m_head->m_pkthdr.len < RE_MIN_FRAMELEN) {   /* Case length < 60 bytes */
5558                 /*
5559                  * Make security concious people happy: zero out the
5560                  * bytes in the pad area, since we don't know what
5561                  * this mbuf cluster buffer's previous user might
5562                  * have left in it.
5563                  */
5564                 bzero(mtod(m_head, char *) + m_head->m_pkthdr.len,
5565                       RE_MIN_FRAMELEN - m_head->m_pkthdr.len);
5566                 m_head->m_pkthdr.len = RE_MIN_FRAMELEN;
5567                 m_head->m_len = m_head->m_pkthdr.len;
5568         }
5569
5570         sc->re_desc.tx_buf[sc->re_desc.tx_cur_index] = m_head;
5571
5572         return(0);
5573 }
5574
5575 static void WritePacket(struct re_softc *sc, caddr_t addr, int len,int fs_flag,int ls_flag, uint32_t opts2,uint32_t opts1)
5576 {
5577         union TxDesc *txptr;
5578
5579         txptr=&(sc->re_desc.tx_desc[sc->re_desc.tx_cur_index]);
5580
5581         txptr->ul[0] &= htole32(0x40000000);
5582         txptr->ul[0] |= htole32(opts1);
5583         txptr->ul[1] = htole32(opts2);
5584
5585         if (fs_flag)
5586                 txptr->ul[0] |= htole32(RL_TDESC_CMD_SOF);
5587         if (ls_flag)
5588                 txptr->ul[0] |= htole32(RL_TDESC_CMD_EOF);
5589         txptr->ul[0] |= htole32(len);
5590         bus_dmamap_load(sc->re_desc.re_tx_mtag,
5591                         sc->re_desc.re_tx_dmamap[sc->re_desc.tx_cur_index],
5592                         addr,
5593                         len,
5594                         re_tx_dma_map_buf, txptr,
5595                         0);
5596         bus_dmamap_sync(sc->re_desc.re_tx_mtag,
5597                         sc->re_desc.re_tx_dmamap[sc->re_desc.tx_cur_index],
5598                         BUS_DMASYNC_PREWRITE);
5599         txptr->ul[0] |= htole32(RL_TDESC_CMD_OWN);
5600
5601         bus_dmamap_sync(sc->re_desc.tx_desc_tag,
5602                         sc->re_desc.tx_desc_dmamap,
5603                         BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
5604
5605         if (ls_flag) {
5606                 CSR_WRITE_1(sc, RE_TPPOLL, RE_NPQ);
5607                 CSR_WRITE_1(sc, RE_TPPOLL, RE_NPQ);
5608         }
5609
5610         sc->re_desc.tx_cur_index = (sc->re_desc.tx_cur_index+1)%RE_TX_BUF_NUM;
5611 }
5612
5613 static int CountFreeTxDescNum(struct re_descriptor desc)
5614 {
5615         int ret=desc.tx_last_index-desc.tx_cur_index;
5616         if (ret<=0)
5617                 ret+=RE_TX_BUF_NUM;
5618         ret--;
5619         return ret;
5620 }
5621
5622 static int CountMbufNum(struct mbuf *m_head)
5623 {
5624         int ret=0;
5625         struct mbuf *ptr = m_head;
5626
5627         while (ptr!=NULL) {
5628                 if (ptr->m_len >0)
5629                         ret++;
5630                 ptr=ptr->m_next;
5631         }
5632
5633         return ret;
5634 }
5635
5636 #ifdef RE_FIXUP_RX
5637 static __inline void re_fixup_rx(struct mbuf *m)
5638 {
5639         int                     i;
5640         uint16_t                *src, *dst;
5641
5642         src = mtod(m, uint16_t *);
5643         dst = src - (RE_ETHER_ALIGN - ETHER_ALIGN) / sizeof *src;
5644
5645         for (i = 0; i < (m->m_len / sizeof(uint16_t) + 1); i++)
5646                 *dst++ = *src++;
5647
5648         m->m_data -= RE_ETHER_ALIGN - ETHER_ALIGN;
5649 }
5650 #endif
5651
5652 /*
5653  * A frame was downloaded to the chip. It's safe for us to clean up
5654  * the list buffers.
5655  */
5656 static void re_txeof(struct re_softc *sc)       /* Transmit OK/ERR handler */
5657 {
5658         union TxDesc *txptr;
5659         struct ifnet            *ifp;
5660
5661         /*      printf("X");*/
5662
5663         ifp = RE_GET_IFNET(sc);
5664
5665 #if OS_VER < VERSION(9,0)
5666         /* Clear the timeout timer. */
5667         ifp->if_timer = 0;
5668 #endif
5669
5670         bus_dmamap_sync(sc->re_desc.tx_desc_tag,
5671                         sc->re_desc.tx_desc_dmamap,
5672                         BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
5673
5674         txptr=&(sc->re_desc.tx_desc[sc->re_desc.tx_last_index]);
5675         while ((txptr->ul[0]&htole32(RL_TDESC_STAT_OWN))==0 && sc->re_desc.tx_last_index!=sc->re_desc.tx_cur_index) {
5676 #ifdef _DEBUG_
5677                 printf("**** Tx OK  ****\n");
5678 #endif
5679                 bus_dmamap_sync(sc->re_desc.re_tx_mtag,
5680                                 sc->re_desc.re_tx_dmamap[sc->re_desc.tx_last_index],
5681                                 BUS_DMASYNC_POSTWRITE);
5682                 bus_dmamap_unload(sc->re_desc.re_tx_mtag,
5683                                   sc->re_desc.re_tx_dmamap[sc->re_desc.tx_last_index]);
5684
5685                 if (sc->re_desc.tx_buf[sc->re_desc.tx_last_index]!=NULL) {
5686                         m_freem(sc->re_desc.tx_buf[sc->re_desc.tx_last_index]); /* Free Current MBuf in a Mbuf list*/
5687                         sc->re_desc.tx_buf[sc->re_desc.tx_last_index] = NULL;
5688                 }
5689
5690                 sc->re_desc.tx_last_index = (sc->re_desc.tx_last_index+1)%RE_TX_BUF_NUM;
5691                 txptr=&sc->re_desc.tx_desc[sc->re_desc.tx_last_index];
5692                 ifp->if_opackets++;
5693                 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
5694         }
5695
5696         return;
5697 }
5698
5699 /*
5700  * A frame has been uploaded: pass the resulting mbuf chain up to
5701  * the higher level protocols.
5702  *
5703  * You know there's something wrong with a PCI bus-master chip design
5704  * when you have to use m_devget().
5705  *
5706  * The receive operation is badly documented in the datasheet, so I'll
5707  * attempt to document it here. The driver provides a buffer area and
5708  * places its base address in the RX buffer start address register.
5709  * The chip then begins copying frames into the RX buffer. Each frame
5710  * is preceeded by a 32-bit RX status word which specifies the length
5711  * of the frame and certain other status bits. Each frame (starting with
5712  * the status word) is also 32-bit aligned. The frame length is in the
5713  * first 16 bits of the status word; the lower 15 bits correspond with
5714  * the 'rx status register' mentioned in the datasheet.
5715  *
5716  * Note: to make the Alpha happy, the frame payload needs to be aligned
5717  * on a 32-bit boundary. To achieve this, we cheat a bit by copying from
5718  * the ring buffer starting at an address two bytes before the actual
5719  * data location. We can then shave off the first two bytes using m_adj().
5720  * The reason we do this is because m_devget() doesn't let us specify an
5721  * offset into the mbuf storage space, so we have to artificially create
5722  * one. The ring is allocated in such a way that there are a few unused
5723  * bytes of space preceecing it so that it will be safe for us to do the
5724  * 2-byte backstep even if reading from the ring at offset 0.
5725  */
5726 static void re_rxeof(sc)        /* Receive Data OK/ERR handler */
5727 struct re_softc         *sc;
5728 {
5729         struct ether_header     *eh;
5730         struct mbuf             *m;
5731         struct ifnet            *ifp;
5732         union RxDesc *rxptr;
5733         int bError;
5734         struct mbuf *buf;
5735         int size;
5736         int maxpkt = RE_RX_BUF_NUM;
5737
5738         u_int32_t opts2,opts1;
5739
5740         /*              RE_LOCK_ASSERT(sc);*/
5741
5742         ifp = RE_GET_IFNET(sc);
5743
5744         bus_dmamap_sync(sc->re_desc.rx_desc_tag,
5745                         sc->re_desc.rx_desc_dmamap,
5746                         BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
5747
5748         rxptr=&(sc->re_desc.rx_desc[sc->re_desc.rx_cur_index]);
5749         while ((rxptr->ul[0]&htole32(RL_RDESC_STAT_OWN))==0) {  /* Receive OK */
5750                 bError = 0;
5751
5752                 opts1 = le32toh(rxptr->ul[0]);
5753
5754                 /* Check if this packet is received correctly*/
5755                 if (opts1&0x200000) {   /*Check RES bit*/
5756                         bError=1;
5757                         goto update_desc;
5758                 }
5759                 opts2 = le32toh(rxptr->ul[1]);
5760
5761                 //buf = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); /* Alloc a new mbuf */
5762
5763                 if (sc->re_rx_mbuf_sz <= MCLBYTES)
5764                         size = MCLBYTES;
5765                 else if (sc->re_rx_mbuf_sz <= MJUMPAGESIZE)
5766                         size = MJUMPAGESIZE;
5767                 else
5768                         size = MJUM9BYTES;
5769
5770                 buf = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, size);
5771                 if (buf==NULL) {
5772                         bError=1;
5773                         goto update_desc;
5774                 }
5775
5776                 buf->m_len = buf->m_pkthdr.len = size;
5777 #ifdef RE_FIXUP_RX
5778                 /*
5779                  * This is part of an evil trick to deal with non-x86 platforms.
5780                  * The RealTek chip requires RX buffers to be aligned on 64-bit
5781                  * boundaries, but that will hose non-x86 machines. To get around
5782                  * this, we leave some empty space at the start of each buffer
5783                  * and for non-x86 hosts, we copy the buffer back six bytes
5784                  * to achieve word alignment. This is slightly more efficient
5785                  * than allocating a new buffer, copying the contents, and
5786                  * discarding the old buffer.
5787                  */
5788                 m_adj(buf, RE_ETHER_ALIGN);
5789 #endif
5790
5791                 bus_dmamap_sync(sc->re_desc.re_rx_mtag,
5792                                 sc->re_desc.re_rx_dmamap[sc->re_desc.rx_cur_index],
5793                                 BUS_DMASYNC_POSTREAD);
5794                 bus_dmamap_unload(sc->re_desc.re_rx_mtag,
5795                                   sc->re_desc.re_rx_dmamap[sc->re_desc.rx_cur_index]);
5796
5797                 m = sc->re_desc.rx_buf[sc->re_desc.rx_cur_index];
5798                 sc->re_desc.rx_buf[sc->re_desc.rx_cur_index] = buf;
5799                 m->m_pkthdr.len = m->m_len = (opts1&RL_RDESC_STAT_GFRAGLEN)-ETHER_CRC_LEN;
5800                 m->m_pkthdr.rcvif = ifp;
5801
5802 #ifdef RE_FIXUP_RX
5803                 re_fixup_rx(m);
5804 #endif
5805
5806                 //vlan
5807                 if (opts2 & RL_RDESC_VLANCTL_TAG) {
5808                         m->m_pkthdr.ether_vtag =
5809                                 bswap16((opts2 & RL_RDESC_VLANCTL_DATA));
5810                         m->m_flags |= M_VLANTAG;
5811                 }
5812                 if (ifp->if_capenable & IFCAP_RXCSUM) {
5813                         if (!(sc->re_if_flags & RL_FLAG_DESCV2)) {
5814                                 if (opts1 & RL_ProtoIP)
5815                                         m->m_pkthdr.csum_flags |=  CSUM_IP_CHECKED;
5816                                 if (!(opts1 & RL_IPF))
5817                                         m->m_pkthdr.csum_flags |= CSUM_IP_VALID;
5818                                 if ((((opts1 & RL_ProtoIP)==(1<<17)) && !(opts1 & RL_TCPF))   || (((opts1 & RL_ProtoIP)==(1<<18)) && !(opts1 & RL_UDPF))) {
5819                                         m->m_pkthdr.csum_flags |= CSUM_DATA_VALID|CSUM_PSEUDO_HDR;
5820                                         m->m_pkthdr.csum_data = 0xffff;
5821                                 }
5822                         } else {
5823                                 if ((opts1 & RL_ProtoIP) && (opts2 & RL_V4F))
5824                                         m->m_pkthdr.csum_flags |=  CSUM_IP_CHECKED;
5825                                 if (!(opts1 & RL_IPF) && (opts2 & RL_V4F))
5826                                         m->m_pkthdr.csum_flags |= CSUM_IP_VALID;
5827                                 if (((opts1 & RL_TCPT) && !(opts2 & RL_TCPF)) || ((opts1 & RL_UDPT) && !(opts2 & RL_UDPF))) {
5828                                         m->m_pkthdr.csum_flags |= CSUM_DATA_VALID|CSUM_PSEUDO_HDR;
5829                                         m->m_pkthdr.csum_data = 0xffff;
5830                                 }
5831                         }
5832                 }
5833
5834                 eh = mtod(m, struct ether_header *);
5835                 ifp->if_ipackets++;
5836 #ifdef _DEBUG_
5837                 printf("Rcv Packet, Len=%d \n", m->m_len);
5838 #endif
5839
5840                 RE_UNLOCK(sc);
5841
5842                 /*#if OS_VER < VERSION(5, 1)*/
5843 #if OS_VER < VERSION(4,9)
5844                 /* Remove header from mbuf and pass it on. */
5845                 m_adj(m, sizeof(struct ether_header));
5846                 ether_input(ifp, eh, m);
5847 #else
5848                 (*ifp->if_input)(ifp, m);
5849 #endif
5850                 RE_LOCK(sc);
5851
5852 update_desc:
5853                 rxptr->ul[0]&=htole32(0x40000000);      /* keep EOR bit */
5854                 rxptr->ul[1]=0;
5855
5856                 rxptr->ul[0] |= htole32(sc->re_rx_desc_buf_sz);
5857                 if (!bError) {
5858                         bus_dmamap_load(sc->re_desc.re_rx_mtag,
5859                                         sc->re_desc.re_rx_dmamap[sc->re_desc.rx_cur_index],
5860                                         sc->re_desc.rx_buf[sc->re_desc.rx_cur_index]->m_data,
5861                                         sc->re_rx_desc_buf_sz,
5862                                         re_rx_dma_map_buf, rxptr,
5863                                         0);
5864                         bus_dmamap_sync(sc->re_desc.re_rx_mtag,
5865                                         sc->re_desc.re_rx_dmamap[sc->re_desc.rx_cur_index],
5866                                         BUS_DMASYNC_PREREAD);
5867                 }
5868                 rxptr->ul[0] |= htole32(RL_RDESC_CMD_OWN);
5869                 sc->re_desc.rx_cur_index = (sc->re_desc.rx_cur_index+1)%RE_RX_BUF_NUM;
5870                 rxptr=&sc->re_desc.rx_desc[sc->re_desc.rx_cur_index];
5871
5872                 maxpkt--;
5873                 if (maxpkt==0)
5874                         break;
5875         }
5876
5877         bus_dmamap_sync(sc->re_desc.rx_desc_tag,
5878                         sc->re_desc.rx_desc_dmamap,
5879                         BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
5880
5881         return;
5882 }
5883
5884 #if OS_VER < VERSION(7,0)
5885 static void re_intr(void *arg)          /* Interrupt Handler */
5886 #else
5887 static int re_intr(void *arg)   /* Interrupt Handler */
5888 #endif //OS_VER < VERSION(7,0)
5889 {
5890         struct re_softc         *sc;
5891
5892         sc = arg;
5893
5894         if ((sc->re_if_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) {
5895                 if ((CSR_READ_2(sc, RE_ISR) & RE_INTRS) == 0) {
5896 #if OS_VER < VERSION(7,0)
5897                         return;
5898 #else
5899                         return (FILTER_STRAY);
5900 #endif
5901                 }
5902         }
5903
5904         /* Disable interrupts. */
5905         CSR_WRITE_2(sc, RE_IMR, 0x0000);
5906
5907 #if OS_VER < VERSION(7,0)
5908         re_int_task(arg, 0);
5909 #else
5910         taskqueue_enqueue_fast(taskqueue_fast, &sc->re_inttask);
5911
5912         return (FILTER_HANDLED);
5913 #endif
5914 }
5915
5916 static void re_int_task(void *arg, int npending)
5917 {
5918         struct re_softc         *sc;
5919         struct ifnet            *ifp;
5920         u_int16_t               status;
5921
5922         sc = arg;
5923
5924         RE_LOCK(sc);
5925
5926         ifp = RE_GET_IFNET(sc);
5927
5928         status = CSR_READ_2(sc, RE_ISR);
5929
5930         if (status) {
5931                 CSR_WRITE_2(sc, RE_ISR, status & 0xffbf);
5932         }
5933
5934         if (sc->suspended ||
5935             (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
5936                 RE_UNLOCK(sc);
5937                 return;
5938         }
5939
5940         re_rxeof(sc);
5941
5942         if (sc->re_type == MACFG_21) {
5943                 if (status & RE_ISR_FIFO_OFLOW) {
5944                         sc->rx_fifo_overflow = 1;
5945                         CSR_WRITE_2(sc, 0x00e2, 0x0000);
5946                         CSR_WRITE_4(sc, 0x0048, 0x4000);
5947                         CSR_WRITE_4(sc, 0x0058, 0x4000);
5948                 } else {
5949                         sc->rx_fifo_overflow = 0;
5950                         CSR_WRITE_4(sc,RE_CPCR, 0x51512082);
5951                 }
5952
5953                 if (status & RE_ISR_PCS_TIMEOUT) {
5954                         if ((status & RE_ISR_FIFO_OFLOW) &&
5955                             (!(status & (RE_ISR_RX_OK | RE_ISR_TX_OK | RE_ISR_RX_OVERRUN)))) {
5956                                 re_reset(sc);
5957                                 re_init(sc);
5958                                 sc->rx_fifo_overflow = 0;
5959                                 CSR_WRITE_2(sc, RE_ISR, RE_ISR_FIFO_OFLOW);
5960                         }
5961                 }
5962         }
5963
5964         re_txeof(sc);
5965
5966         if (status & RE_ISR_SYSTEM_ERR) {
5967                 re_reset(sc);
5968                 re_init(sc);
5969         }
5970
5971         switch(sc->re_type) {
5972         case MACFG_21:
5973         case MACFG_22:
5974         case MACFG_23:
5975         case MACFG_24:
5976                 CSR_WRITE_1(sc, RE_TPPOLL, RE_NPQ);
5977                 break;
5978
5979         default:
5980                 break;
5981         }
5982
5983         RE_UNLOCK(sc);
5984
5985         if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
5986                 re_start(ifp);
5987
5988 #if OS_VER>=VERSION(7,0)
5989         if (CSR_READ_2(sc, RE_ISR) & RE_INTRS) {
5990                 taskqueue_enqueue_fast(taskqueue_fast, &sc->re_inttask);
5991                 return;
5992         }
5993 #endif
5994
5995         /* Re-enable interrupts. */
5996         CSR_WRITE_2(sc, RE_IMR, RE_INTRS);
5997 }
5998 #endif  /* !__DragonFly__ */
5999
6000 static void re_set_multicast_reg(struct re_softc *sc, u_int32_t mask0, u_int32_t mask4)
6001 {
6002         u_int8_t  enable_cfg_reg_write = 0;
6003
6004         if (sc->re_type == MACFG_5 || sc->re_type == MACFG_6)
6005                 enable_cfg_reg_write = 1;
6006
6007         if (enable_cfg_reg_write)
6008                 CSR_WRITE_1(sc, RE_EECMD, RE_EEMODE_WRITECFG);
6009         CSR_WRITE_4(sc, RE_MAR0, mask0);
6010         CSR_WRITE_4(sc, RE_MAR4, mask4);
6011         if (enable_cfg_reg_write)
6012                 CSR_WRITE_1(sc, RE_EECMD, RE_EEMODE_OFF);
6013
6014         return;
6015 }
6016
6017 #ifndef __DragonFly__
6018 static void re_set_rx_packet_filter_in_sleep_state(struct re_softc *sc)
6019 {
6020         struct ifnet            *ifp;
6021         u_int32_t               rxfilt;
6022
6023         ifp = RE_GET_IFNET(sc);
6024
6025         rxfilt = CSR_READ_4(sc, RE_RXCFG);
6026
6027         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);
6028         rxfilt |= (RE_RXCFG_RX_INDIV | RE_RXCFG_RX_MULTI | RE_RXCFG_RX_BROAD);
6029
6030         CSR_WRITE_4(sc, RE_RXCFG, rxfilt);
6031
6032         re_set_multicast_reg(sc, 0xFFFFFFFF, 0xFFFFFFFF);
6033
6034         return;
6035 }
6036 #endif  /* !__DragonFly__ */
6037
6038 static void re_set_rx_packet_filter(struct re_softc *sc)
6039 {
6040         struct ifnet            *ifp;
6041         u_int32_t               rxfilt;
6042
6043         ifp = RE_GET_IFNET(sc);
6044
6045         rxfilt = CSR_READ_4(sc, RE_RXCFG);
6046
6047         rxfilt |= RE_RXCFG_RX_INDIV;
6048
6049         if (ifp->if_flags & (IFF_MULTICAST | IFF_ALLMULTI | IFF_PROMISC)) {
6050                 rxfilt |= (RE_RXCFG_RX_ALLPHYS | RE_RXCFG_RX_MULTI);
6051         } else {
6052                 rxfilt &= ~(RE_RXCFG_RX_MULTI);
6053         }
6054
6055         if (ifp->if_flags & IFF_PROMISC) {
6056                 rxfilt |= (RE_RXCFG_RX_ALLPHYS | RE_RXCFG_RX_RUNT | RE_RXCFG_RX_ERRPKT);
6057         } else {
6058                 rxfilt &= ~(RE_RXCFG_RX_ALLPHYS | RE_RXCFG_RX_RUNT | RE_RXCFG_RX_ERRPKT);
6059         }
6060
6061         if (ifp->if_flags & (IFF_BROADCAST | IFF_PROMISC)) {
6062                 rxfilt |= RE_RXCFG_RX_BROAD;
6063         } else {
6064                 rxfilt &= ~RE_RXCFG_RX_BROAD;
6065         }
6066
6067         CSR_WRITE_4(sc, RE_RXCFG, rxfilt);
6068
6069         re_setmulti(sc);
6070
6071         return;
6072 }
6073
6074 /*
6075  * Program the 64-bit multicast hash filter.
6076  */
6077 static void re_setmulti(struct re_softc *sc)
6078 {
6079         struct ifnet            *ifp;
6080         int                     h = 0;
6081         u_int32_t               hashes[2] = { 0, 0 };
6082         struct ifmultiaddr      *ifma;
6083         u_int32_t               rxfilt;
6084         int                     mcnt = 0;
6085
6086         ifp = RE_GET_IFNET(sc);
6087
6088         rxfilt = CSR_READ_4(sc, RE_RXCFG);
6089
6090         if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
6091                 rxfilt |= RE_RXCFG_RX_MULTI;
6092                 CSR_WRITE_4(sc, RE_RXCFG, rxfilt);
6093                 re_set_multicast_reg(sc, 0xFFFFFFFF, 0xFFFFFFFF);
6094
6095                 return;
6096         }
6097
6098 #ifndef __DragonFly__
6099         /* now program new ones */
6100 #if OS_VER > VERSION(6,0)
6101         IF_ADDR_LOCK(ifp);
6102 #endif
6103 #if OS_VER < VERSION(4,9)
6104         for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL;
6105              ifma = ifma->ifma_link.le_next)
6106 #else
6107         TAILQ_FOREACH(ifma,&ifp->if_multiaddrs,ifma_link)
6108 #endif
6109 #else   /* __DragonFly__ */
6110         TAILQ_FOREACH(ifma,&ifp->if_multiaddrs,ifma_link)
6111 #endif  /* !__DragonFly__ */
6112         {
6113                 if (ifma->ifma_addr->sa_family != AF_LINK)
6114                         continue;
6115                 h = ether_crc32_be(LLADDR((struct sockaddr_dl *)
6116                                           ifma->ifma_addr), ETHER_ADDR_LEN) >> 26;
6117                 if (h < 32)
6118                         hashes[0] |= (1 << h);
6119                 else
6120                         hashes[1] |= (1 << (h - 32));
6121                 mcnt++;
6122         }
6123 #ifndef __DragonFly__
6124 #if OS_VER > VERSION(6,0)
6125         IF_ADDR_UNLOCK(ifp);
6126 #endif
6127 #endif  /* !__DragonFly__ */
6128
6129         if (mcnt) {
6130                 if ((sc->re_if_flags & RL_FLAG_PCIE) != 0) {
6131                         h = bswap32(hashes[0]);
6132                         hashes[0] = bswap32(hashes[1]);
6133                         hashes[1] = h;
6134                 }
6135                 rxfilt |= RE_RXCFG_RX_MULTI;
6136         } else
6137                 rxfilt &= ~RE_RXCFG_RX_MULTI;
6138
6139         CSR_WRITE_4(sc, RE_RXCFG, rxfilt);
6140         re_set_multicast_reg(sc, hashes[0], hashes[1]);
6141
6142         return;
6143 }
6144
6145 #ifndef __DragonFly__
6146 static int re_ioctl(ifp, command, data)
6147 struct ifnet            *ifp;
6148 u_long                  command;
6149 caddr_t                 data;
6150 {
6151         struct re_softc         *sc = ifp->if_softc;
6152         struct ifreq            *ifr = (struct ifreq *) data;
6153         /*int                   s;*/
6154         int                     error = 0;
6155         int mask, reinit;
6156         /*s = splimp();*/
6157
6158         switch(command) {
6159         case SIOCSIFADDR:
6160         case SIOCGIFADDR:
6161                 error = ether_ioctl(ifp, command, data);
6162
6163                 break;
6164         case SIOCSIFMTU:
6165
6166                 //printf("before mtu =%d\n",(int)ifp->if_mtu);
6167                 if (ifr->ifr_mtu > sc->max_jumbo_frame_size)
6168                         error = EINVAL;
6169                 else {
6170                         ifp->if_mtu = ifr->ifr_mtu;
6171
6172                         //if running
6173                         if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
6174                                 //printf("set mtu when running\n");
6175
6176                                 RE_LOCK(sc);
6177                                 re_stop(sc);
6178
6179                                 re_release_buf(sc);
6180                                 set_rxbufsize(sc);
6181                                 error =re_alloc_buf(sc);
6182
6183                                 if (error == 0) {
6184                                         re_init(sc);
6185                                 }
6186                                 RE_UNLOCK(sc);
6187
6188                         } else {
6189                                 //if not running
6190                                 RE_LOCK(sc);
6191                                 re_release_buf(sc);
6192                                 set_rxbufsize(sc);
6193                                 error =re_alloc_buf(sc);
6194                                 if (error == 0) {
6195                                         /* Init descriptors. */
6196                                         re_var_init(sc);
6197                                 }
6198                                 RE_UNLOCK(sc);
6199                         }
6200
6201                 }
6202                 //      printf("after mtu =%d\n",(int)ifp->if_mtu);
6203                 break;
6204         case SIOCSIFFLAGS:
6205                 RE_LOCK(sc);
6206                 if (ifp->if_flags & IFF_UP) {
6207                         re_init(sc);
6208                 } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
6209                         re_stop(sc);
6210                 }
6211                 error = 0;
6212                 RE_UNLOCK(sc);
6213                 break;
6214         case SIOCADDMULTI:
6215         case SIOCDELMULTI:
6216                 RE_LOCK(sc);
6217                 re_set_rx_packet_filter(sc);
6218                 RE_UNLOCK(sc);
6219                 error = 0;
6220                 break;
6221         case SIOCGIFMEDIA:
6222         case SIOCSIFMEDIA:
6223                 error = ifmedia_ioctl(ifp, ifr, &sc->media, command);
6224                 break;
6225         case SIOCSIFCAP:
6226
6227
6228                 mask = ifr->ifr_reqcap ^ ifp->if_capenable;
6229                 reinit = 0;
6230
6231                 if ((mask & IFCAP_TXCSUM) != 0 && (ifp->if_capabilities & IFCAP_TXCSUM) != 0) {
6232                         ifp->if_capenable ^= IFCAP_TXCSUM;
6233                         if ((ifp->if_capenable & IFCAP_TXCSUM) != 0)  {
6234                                 if ((sc->re_type == MACFG_24) || (sc->re_type == MACFG_24) || (sc->re_type == MACFG_26))
6235                                         ifp->if_hwassist |= CSUM_TCP | CSUM_UDP;
6236                                 else
6237                                         ifp->if_hwassist |= RE_CSUM_FEATURES;
6238                         } else
6239                                 ifp->if_hwassist &= ~RE_CSUM_FEATURES;
6240                         reinit = 1;
6241                 }
6242
6243                 if ((mask & IFCAP_RXCSUM) != 0 &&
6244                     (ifp->if_capabilities & IFCAP_RXCSUM) != 0) {
6245                         ifp->if_capenable ^= IFCAP_RXCSUM;
6246                         reinit = 1;
6247                 }
6248
6249                 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))) {
6250                         if (ifp->if_capenable & IFCAP_TXCSUM)
6251                                 sc->re_tx_cstag = 1;
6252                         else
6253                                 sc->re_tx_cstag = 0;
6254
6255                         if (ifp->if_capenable & IFCAP_RXCSUM)
6256                                 sc->re_rx_cstag = 1;
6257                         else
6258                                 sc->re_rx_cstag = 0;
6259                 }
6260                 if ((mask & IFCAP_VLAN_HWTAGGING) != 0 &&
6261                     (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) {
6262                         ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
6263                         /* TSO over VLAN requires VLAN hardware tagging. */
6264                         //if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0)
6265                         //      ifp->if_capenable &= ~IFCAP_VLAN_HWTSO;
6266                         reinit = 1;
6267                 }
6268
6269                 if ((mask & IFCAP_WOL) != 0 &&
6270                     (ifp->if_capabilities & IFCAP_WOL) != 0) {
6271                         if ((mask & IFCAP_WOL_UCAST) != 0)
6272                                 ifp->if_capenable ^= IFCAP_WOL_UCAST;
6273                         if ((mask & IFCAP_WOL_MCAST) != 0)
6274                                 ifp->if_capenable ^= IFCAP_WOL_MCAST;
6275                         if ((mask & IFCAP_WOL_MAGIC) != 0)
6276                                 ifp->if_capenable ^= IFCAP_WOL_MAGIC;
6277                 }
6278                 if (reinit && ifp->if_drv_flags & IFF_DRV_RUNNING) {
6279                         ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
6280                         re_init(sc);
6281                 }
6282                 VLAN_CAPABILITIES(ifp);
6283                 break;
6284         default:
6285                 error = EINVAL;
6286                 break;
6287         }
6288
6289         /*(void)splx(s);*/
6290
6291         return(error);
6292 }
6293 #endif  /* !__DragonFly__ */
6294
6295 static void re_link_on_patch(struct re_softc *sc)
6296 {
6297         struct ifnet            *ifp;
6298
6299         ifp = RE_GET_IFNET(sc);
6300
6301         if (sc->re_type == MACFG_50 || sc->re_type == MACFG_51 || sc->re_type == MACFG_52) {
6302                 if (CSR_READ_1(sc, RE_PHY_STATUS) & RL_PHY_STATUS_1000MF) {
6303                         re_eri_write(sc, 0x1bc, 4, 0x00000011, ERIAR_ExGMAC);
6304                         re_eri_write(sc, 0x1dc, 4, 0x0000001f, ERIAR_ExGMAC);
6305                 } else if (CSR_READ_1(sc, RE_PHY_STATUS) & RL_PHY_STATUS_100M) {
6306                         re_eri_write(sc, 0x1bc, 4, 0x0000001f, ERIAR_ExGMAC);
6307                         re_eri_write(sc, 0x1dc, 4, 0x0000001f, ERIAR_ExGMAC);
6308                 } else {
6309                         re_eri_write(sc, 0x1bc, 4, 0x0000001f, ERIAR_ExGMAC);
6310                         re_eri_write(sc, 0x1dc, 4, 0x0000002d, ERIAR_ExGMAC);
6311                 }
6312         } else if ((sc->re_type == MACFG_38 || sc->re_type == MACFG_39) && (ifp->if_flags & IFF_UP)) {
6313                 if (sc->re_type == MACFG_38 && (CSR_READ_1(sc, RE_PHY_STATUS) & RL_PHY_STATUS_10M)) {
6314                         CSR_WRITE_4(sc, RE_RXCFG, CSR_READ_4(sc, RE_RXCFG) | RE_RXCFG_RX_ALLPHYS);
6315                 } else if (sc->re_type == MACFG_39) {
6316                         if (CSR_READ_1(sc, RE_PHY_STATUS) & RL_PHY_STATUS_1000MF) {
6317                                 re_eri_write(sc, 0x1bc, 4, 0x00000011, ERIAR_ExGMAC);
6318                                 re_eri_write(sc, 0x1dc, 4, 0x00000005, ERIAR_ExGMAC);
6319                         } else if (CSR_READ_1(sc, RE_PHY_STATUS) & RL_PHY_STATUS_100M) {
6320                                 re_eri_write(sc, 0x1bc, 4, 0x0000001f, ERIAR_ExGMAC);
6321                                 re_eri_write(sc, 0x1dc, 4, 0x00000005, ERIAR_ExGMAC);
6322                         } else {
6323                                 re_eri_write(sc, 0x1bc, 4, 0x0000001f, ERIAR_ExGMAC);
6324                                 re_eri_write(sc, 0x1dc, 4, 0x0000003f, ERIAR_ExGMAC);
6325                         }
6326                 }
6327         } else if ((sc->re_type == MACFG_36 || sc->re_type == MACFG_37) && eee_enable ==1) {
6328                 /*Full -Duplex  mode*/
6329                 if (CSR_READ_1(sc, RE_PHY_STATUS) & RL_PHY_STATUS_FULL_DUP) {
6330                         MP_WritePhyUshort(sc, 0x1F, 0x0006);
6331                         MP_WritePhyUshort(sc, 0x00, 0x5a30);
6332                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
6333                         if (CSR_READ_1(sc, RE_PHY_STATUS) & (RL_PHY_STATUS_10M | RL_PHY_STATUS_100M))
6334                                 CSR_WRITE_4(sc, RE_TXCFG, (CSR_READ_4(sc, RE_TXCFG) & ~BIT_19) | BIT_25);
6335
6336                 } else {
6337                         MP_WritePhyUshort(sc, 0x1F, 0x0006);
6338                         MP_WritePhyUshort(sc, 0x00, 0x5a00);
6339                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
6340                         if (CSR_READ_1(sc, RE_PHY_STATUS) & (RL_PHY_STATUS_10M | RL_PHY_STATUS_100M))
6341                                 CSR_WRITE_4(sc, RE_TXCFG, (CSR_READ_4(sc, RE_TXCFG) & ~BIT_19) | RE_TXCFG_IFG);
6342                 }
6343         } else if ((sc->re_type == MACFG_56 || sc->re_type == MACFG_57 ||
6344                     sc->re_type == MACFG_58 || sc->re_type == MACFG_59 ||
6345                     sc->re_type == MACFG_60 || sc->re_type == MACFG_61 ||
6346                     sc->re_type == MACFG_62 || sc->re_type == MACFG_67 ||
6347                     sc->re_type == MACFG_68 || sc->re_type == MACFG_69) &&
6348                    (ifp->if_flags & IFF_UP)) {
6349                 if (CSR_READ_1(sc, RE_PHY_STATUS) & RL_PHY_STATUS_FULL_DUP)
6350                         CSR_WRITE_4(sc, RE_TXCFG, (CSR_READ_4(sc, RE_TXCFG) | (BIT_24 | BIT_25)) & ~BIT_19);
6351                 else
6352                         CSR_WRITE_4(sc, RE_TXCFG, (CSR_READ_4(sc, RE_TXCFG) | BIT_25) & ~(BIT_19 | BIT_24));
6353         }
6354
6355         if (sc->re_type == MACFG_56 || sc->re_type == MACFG_57 ||
6356             sc->re_type == MACFG_61 || sc->re_type == MACFG_62) {
6357                 /*half mode*/
6358                 if (!(CSR_READ_1(sc, RE_PHY_STATUS) & RL_PHY_STATUS_FULL_DUP)) {
6359                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
6360                         MP_WritePhyUshort(sc, MII_ANAR, MP_ReadPhyUshort(sc, MII_ANAR)&~(ANAR_PAUSE_SYM |ANAR_PAUSE_ASYM));
6361                 }
6362         }
6363
6364 #ifndef __DragonFly__
6365         re_init_unlock(sc);
6366 #endif
6367 }
6368
6369 #ifndef __DragonFly__
6370 static void re_link_down_patch(struct re_softc *sc)
6371 {
6372         struct ifnet            *ifp;
6373
6374         ifp = RE_GET_IFNET(sc);
6375
6376         re_txeof(sc);
6377         re_rxeof(sc);
6378         re_stop(sc);
6379
6380         re_ifmedia_upd(ifp);
6381 }
6382
6383 /*
6384  * Check Link Status.
6385  */
6386 static void re_check_link_status(struct re_softc *sc)
6387 {
6388         u_int8_t        link_state;
6389         struct ifnet            *ifp;
6390
6391         ifp = RE_GET_IFNET(sc);
6392
6393         if (re_link_ok(sc)) {
6394                 link_state = LINK_STATE_UP;
6395         } else {
6396                 link_state = LINK_STATE_DOWN;
6397         }
6398
6399         if (link_state != sc->link_state) {
6400                 sc->link_state = link_state;
6401                 if (link_state == LINK_STATE_UP) {
6402                         re_link_on_patch(sc);
6403                         re_link_state_change(ifp, LINK_STATE_UP);
6404                 } else {
6405                         re_link_state_change(ifp, LINK_STATE_DOWN);
6406                         re_link_down_patch(sc);
6407                 }
6408         }
6409 }
6410
6411 static void re_init_timer(struct re_softc *sc)
6412 {
6413 #ifdef RE_USE_NEW_CALLOUT_FUN
6414         callout_init(&sc->re_stat_ch, CALLOUT_MPSAFE);
6415 #else
6416         callout_handle_init(&sc->re_stat_ch);
6417 #endif
6418 }
6419
6420 static void re_stop_timer(struct re_softc *sc)
6421 {
6422 #ifdef RE_USE_NEW_CALLOUT_FUN
6423         callout_stop(&sc->re_stat_ch);
6424 #else
6425         untimeout(re_tick, sc, sc->re_stat_ch);
6426 #endif
6427 }
6428
6429 static void re_start_timer(struct re_softc *sc)
6430 {
6431 #ifdef RE_USE_NEW_CALLOUT_FUN
6432         callout_reset(&sc->re_stat_ch, hz, re_tick, sc);
6433 #else
6434         re_stop_timer(sc);
6435         sc->re_stat_ch = timeout(re_tick, sc, hz);
6436 #endif
6437 }
6438
6439 static void re_tick(xsc)
6440 void                    *xsc;
6441 {
6442         /*called per second*/
6443         struct re_softc         *sc;
6444         int                     s;
6445
6446         s = splimp();
6447
6448         sc = xsc;
6449         /*mii = device_get_softc(sc->re_miibus);
6450
6451         mii_tick(mii);*/
6452
6453         splx(s);
6454
6455         RE_LOCK(sc);
6456
6457         if (sc->re_link_chg_det == 1) {
6458                 re_check_link_status(sc);
6459                 re_start_timer(sc);
6460         }
6461
6462         RE_UNLOCK(sc);
6463
6464         return;
6465 }
6466
6467 #if OS_VER < VERSION(7,0)
6468 static void re_watchdog(ifp)
6469 struct ifnet            *ifp;
6470 {
6471         struct re_softc         *sc;
6472
6473         sc = ifp->if_softc;
6474
6475         printf("re%d: watchdog timeout\n", sc->re_unit);
6476         ifp->if_oerrors++;
6477
6478         re_txeof(sc);
6479         re_rxeof(sc);
6480         re_init(sc);
6481
6482         return;
6483 }
6484 #endif
6485 #endif  /* !__DragonFly__ */
6486
6487 /*
6488  * Set media options.
6489  */
6490 static int re_ifmedia_upd(struct ifnet *ifp)
6491 {
6492         struct re_softc *sc = ifp->if_softc;
6493         struct ifmedia  *ifm = &sc->media;
6494         int anar;
6495         int gbcr;
6496
6497         if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
6498                 return(EINVAL);
6499
6500         if (sc->re_type == MACFG_68 || sc->re_type == MACFG_69) {
6501                 //Disable Giga Lite
6502                 MP_WritePhyUshort(sc, 0x1F, 0x0A42);
6503                 ClearEthPhyBit(sc, 0x14, BIT_9);
6504                 MP_WritePhyUshort(sc, 0x1F, 0x0A40);
6505                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
6506         }
6507
6508
6509         switch (IFM_SUBTYPE(ifm->ifm_media)) {
6510         case IFM_AUTO:
6511                 anar = ANAR_TX_FD |
6512                        ANAR_TX |
6513                        ANAR_10_FD |
6514                        ANAR_10;
6515                 gbcr = GTCR_ADV_1000TFDX |
6516                        GTCR_ADV_1000THDX;
6517                 break;
6518         case IFM_1000_SX:
6519 #ifndef __DragonFly__
6520 #if OS_VER < 500000
6521         case IFM_1000_TX:
6522 #else
6523         case IFM_1000_T:
6524 #endif
6525 #else   /* __DragonFly__ */
6526         case IFM_1000_T:
6527 #endif  /* !__DragonFly__ */
6528                 anar = ANAR_TX_FD |
6529                        ANAR_TX |
6530                        ANAR_10_FD |
6531                        ANAR_10;
6532                 gbcr = GTCR_ADV_1000TFDX |
6533                        GTCR_ADV_1000THDX;
6534                 break;
6535         case IFM_100_TX:
6536                 gbcr = MP_ReadPhyUshort(sc, MII_100T2CR) &
6537                        ~(GTCR_ADV_1000TFDX | GTCR_ADV_1000THDX);
6538                 if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX) {
6539                         anar = ANAR_TX_FD |
6540                                ANAR_TX |
6541                                ANAR_10_FD |
6542                                ANAR_10;
6543                 } else {
6544                         anar = ANAR_TX |
6545                                ANAR_10_FD |
6546                                ANAR_10;
6547                 }
6548                 break;
6549         case IFM_10_T:
6550                 gbcr = MP_ReadPhyUshort(sc, MII_100T2CR) &
6551                        ~(GTCR_ADV_1000TFDX | GTCR_ADV_1000THDX);
6552                 if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX) {
6553                         anar = ANAR_10_FD |
6554                                ANAR_10;
6555                 } else {
6556                         anar = ANAR_10;
6557                 }
6558
6559                 if (sc->re_type == MACFG_13) {
6560                         MP_WritePhyUshort(sc, MII_BMCR, 0x8000);
6561                 }
6562
6563                 break;
6564         default:
6565 #ifndef __DragonFly__
6566                 printf("re%d: Unsupported media type\n", sc->re_unit);
6567                 return(0);
6568 #else
6569                 if_printf(ifp, "Unsupported media type\n");
6570                 return (EOPNOTSUPP);
6571 #endif
6572         }
6573
6574         MP_WritePhyUshort(sc, 0x1F, 0x0000);
6575         if (sc->re_device_id==RT_DEVICEID_8169 || sc->re_device_id==RT_DEVICEID_8169SC ||
6576             sc->re_device_id==RT_DEVICEID_8168 || sc->re_device_id==RT_DEVICEID_8161) {
6577                 MP_WritePhyUshort(sc, MII_ANAR, anar | 0x0800 | ANAR_FC);
6578                 MP_WritePhyUshort(sc, MII_100T2CR, gbcr);
6579                 MP_WritePhyUshort(sc, MII_BMCR, BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG);
6580         } else if (sc->re_type == MACFG_36) {
6581                 MP_WritePhyUshort(sc, MII_ANAR, anar | 0x0800 | ANAR_FC);
6582                 MP_WritePhyUshort(sc, MII_BMCR, BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG);
6583         } else {
6584                 MP_WritePhyUshort(sc, MII_ANAR, anar | 1);
6585                 MP_WritePhyUshort(sc, MII_BMCR, BMCR_AUTOEN | BMCR_STARTNEG);
6586         }
6587
6588         return(0);
6589 }
6590
6591 /*
6592  * Report current media status.
6593  */
6594 static void re_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
6595 {
6596         struct re_softc         *sc;
6597
6598         sc = ifp->if_softc;
6599
6600         RE_LOCK(sc);
6601
6602         ifmr->ifm_status = IFM_AVALID;
6603         ifmr->ifm_active = IFM_ETHER;
6604
6605         if (re_link_ok(sc)) {
6606                 unsigned char msr;
6607
6608                 ifmr->ifm_status |= IFM_ACTIVE;
6609
6610                 msr = CSR_READ_1(sc, RE_PHY_STATUS);
6611                 if (msr & RL_PHY_STATUS_FULL_DUP)
6612                         ifmr->ifm_active |= IFM_FDX;
6613                 else
6614                         ifmr->ifm_active |= IFM_HDX;
6615
6616                 if (msr & RL_PHY_STATUS_10M)
6617                         ifmr->ifm_active |= IFM_10_T;
6618                 else if (msr & RL_PHY_STATUS_100M)
6619                         ifmr->ifm_active |= IFM_100_TX;
6620                 else if (msr & RL_PHY_STATUS_1000MF)
6621                         ifmr->ifm_active |= IFM_1000_T;
6622 #ifdef __DragonFly__
6623         } else {
6624                 if (IFM_SUBTYPE(sc->media.ifm_media) == IFM_AUTO)
6625                         ifmr->ifm_active |= IFM_NONE;
6626                 else
6627                         ifmr->ifm_active |= sc->media.ifm_media;
6628 #endif
6629         }
6630
6631         RE_UNLOCK(sc);
6632
6633         return;
6634 }
6635
6636 static int re_enable_EEE(struct re_softc *sc)
6637 {
6638         int ret;
6639         u_int16_t data;
6640         u_int16_t PhyRegValue;
6641         u_int32_t WaitCnt;
6642
6643         ret = 0;
6644         switch (sc->re_type) {
6645         case MACFG_42:
6646         case MACFG_43:
6647                 re_eri_write(sc, 0x1B0, 2, 0xED03, ERIAR_ExGMAC);
6648                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
6649                 if (CSR_READ_1(sc,0xEF) & 0x02) {
6650                         MP_WritePhyUshort(sc, 0x10, 0x731F);
6651                         MP_WritePhyUshort(sc, 0x19, 0x7630);
6652                 } else {
6653                         MP_WritePhyUshort(sc, 0x10, 0x711F);
6654                         MP_WritePhyUshort(sc, 0x19, 0x7030);
6655                 }
6656                 MP_WritePhyUshort(sc, 0x1A, 0x1506);
6657                 MP_WritePhyUshort(sc, 0x1B, 0x0551);
6658                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
6659                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
6660                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
6661                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
6662                 MP_WritePhyUshort(sc, 0x0E, 0x0002);
6663                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
6664
6665                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
6666                 MP_WritePhyUshort(sc, 0x0D, 0x0003);
6667                 MP_WritePhyUshort(sc, 0x0E, 0x0015);
6668                 MP_WritePhyUshort(sc, 0x0D, 0x4003);
6669                 MP_WritePhyUshort(sc, 0x0E, 0x0002);
6670                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
6671
6672                 MP_WritePhyUshort(sc, MII_BMCR, BMCR_AUTOEN | BMCR_STARTNEG);
6673                 break;
6674
6675         case MACFG_53:
6676         case MACFG_54:
6677         case MACFG_55:
6678                 re_eri_write(sc, 0x1B0, 2, 0xED03, ERIAR_ExGMAC);
6679                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
6680                 MP_WritePhyUshort(sc, 0x10, 0x731F);
6681                 MP_WritePhyUshort(sc, 0x19, 0x7630);
6682                 MP_WritePhyUshort(sc, 0x1A, 0x1506);
6683                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
6684                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
6685                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
6686                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
6687                 MP_WritePhyUshort(sc, 0x0E, 0x0002);
6688                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
6689
6690                 MP_WritePhyUshort(sc, MII_BMCR, BMCR_AUTOEN | BMCR_STARTNEG);
6691                 break;
6692
6693         case MACFG_36:
6694         case MACFG_37:
6695                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
6696                 MP_WritePhyUshort(sc, 0x1E, 0x0020);
6697                 data = MP_ReadPhyUshort(sc, 0x15) | 0x0100;
6698                 MP_WritePhyUshort(sc, 0x15, data);
6699                 MP_WritePhyUshort(sc, 0x1F, 0x0006);
6700                 MP_WritePhyUshort(sc, 0x00, 0x5A30);
6701                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
6702                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
6703                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
6704                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
6705                 MP_WritePhyUshort(sc, 0x0E, 0x0006);
6706                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
6707                 if ((CSR_READ_1(sc, RE_CFG4)&RL_CFG4_CUSTOMIZED_LED) && (CSR_READ_1(sc, RE_MACDBG) & BIT_7)) {
6708                         MP_WritePhyUshort(sc, 0x1F, 0x0005);
6709                         MP_WritePhyUshort(sc, 0x05, 0x8AC8);
6710                         MP_WritePhyUshort(sc, 0x06, CSR_READ_1(sc, RE_CUSTOM_LED));
6711                         MP_WritePhyUshort(sc, 0x05, 0x8B82);
6712                         data = MP_ReadPhyUshort(sc, 0x06) | 0x0010;
6713                         MP_WritePhyUshort(sc, 0x05, 0x8B82);
6714                         MP_WritePhyUshort(sc, 0x06, data);
6715                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
6716                 }
6717                 break;
6718
6719         case MACFG_50:
6720         case MACFG_51:
6721         case MACFG_52:
6722                 data = re_eri_read(sc, 0x1B0 ,4,ERIAR_ExGMAC) | 0x0003;
6723                 re_eri_write(sc, 0x1B0, 4, data, ERIAR_ExGMAC);
6724                 MP_WritePhyUshort(sc,0x1F , 0x0007);
6725                 MP_WritePhyUshort(sc,0x1E , 0x0020);
6726                 data = MP_ReadPhyUshort(sc, 0x15)|0x0100;
6727                 MP_WritePhyUshort(sc,0x15 , data);
6728                 MP_WritePhyUshort(sc,0x1F , 0x0005);
6729                 MP_WritePhyUshort(sc,0x05 , 0x8B85);
6730                 data = MP_ReadPhyUshort(sc, 0x06)|0x2000;
6731                 MP_WritePhyUshort(sc,0x06 , data);
6732                 MP_WritePhyUshort(sc,0x1F , 0x0000);
6733                 MP_WritePhyUshort(sc,0x0D , 0x0007);
6734                 MP_WritePhyUshort(sc,0x0E , 0x003C);
6735                 MP_WritePhyUshort(sc,0x0D , 0x4007);
6736                 MP_WritePhyUshort(sc,0x0E , 0x0006);
6737                 MP_WritePhyUshort(sc,0x1D , 0x0000);
6738                 break;
6739
6740         case MACFG_38:
6741         case MACFG_39:
6742                 data = re_eri_read(sc, 0x1B0 ,4,ERIAR_ExGMAC);
6743                 data |= BIT_1 | BIT_0;
6744                 re_eri_write(sc, 0x1B0, 4, data, ERIAR_ExGMAC);
6745                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
6746                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
6747                 MP_WritePhyUshort(sc, 0x1e, 0x0020);
6748                 data = MP_ReadPhyUshort(sc, 0x15);
6749                 data |= BIT_8;
6750                 MP_WritePhyUshort(sc, 0x15, data);
6751                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
6752                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
6753                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
6754                 data = MP_ReadPhyUshort(sc, 0x06);
6755                 data |= BIT_13;
6756                 MP_WritePhyUshort(sc, 0x06, data);
6757                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
6758                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
6759                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
6760                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
6761                 MP_WritePhyUshort(sc, 0x0E, 0x0006);
6762                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
6763                 break;
6764
6765         case MACFG_56:
6766         case MACFG_57:
6767         case MACFG_58:
6768         case MACFG_59:
6769         case MACFG_60:
6770         case MACFG_61:
6771         case MACFG_62:
6772         case MACFG_67:
6773         case MACFG_68:
6774         case MACFG_69:
6775                 data = re_eri_read(sc, 0x1B0, 4, ERIAR_ExGMAC);
6776                 data |= BIT_1 | BIT_0;
6777                 re_eri_write(sc, 0x1B0, 4, data, ERIAR_ExGMAC);
6778                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
6779                 data = MP_ReadPhyUshort(sc, 0x11);
6780                 MP_WritePhyUshort(sc, 0x11, data | BIT_4);
6781                 MP_WritePhyUshort(sc, 0x1F, 0x0A5D);
6782                 MP_WritePhyUshort(sc, 0x10, 0x0006);
6783                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
6784                 break;
6785
6786         default:
6787                 ret = -EOPNOTSUPP;
6788                 break;
6789         }
6790
6791         switch (sc->re_type) {
6792         case MACFG_68:
6793         case MACFG_69:
6794                 MP_WritePhyUshort(sc, 0x1F, 0x0A4A);
6795                 SetEthPhyBit(sc, 0x11, BIT_9);
6796                 MP_WritePhyUshort(sc, 0x1F, 0x0A42);
6797                 SetEthPhyBit(sc, 0x14, BIT_7);
6798                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
6799                 break;
6800         }
6801
6802         /*Advanced EEE*/
6803         switch (sc->re_type) {
6804         case MACFG_58:
6805         case MACFG_59:
6806         case MACFG_60:
6807         case MACFG_68:
6808         case MACFG_69:
6809                 MP_WritePhyUshort(sc, 0x1F, 0x0B82);
6810                 SetEthPhyBit(sc, 0x10, BIT_4);
6811                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
6812
6813                 MP_WritePhyUshort(sc,0x1F, 0x0B80);
6814                 WaitCnt = 0;
6815                 do {
6816                         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
6817                         PhyRegValue &= 0x0040;
6818                         DELAY(50);
6819                         DELAY(50);
6820                         WaitCnt++;
6821                 } while(PhyRegValue != 0x0040 && WaitCnt <1000);
6822
6823                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
6824                 break;
6825         }
6826
6827         switch (sc->re_type) {
6828         case MACFG_59:
6829                 re_eri_write(sc, 0x1EA, 1, 0xFA, ERIAR_ExGMAC);
6830
6831                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
6832                 data = MP_ReadPhyUshort(sc, 0x10);
6833                 if (data & BIT_10) {
6834                         MP_WritePhyUshort(sc, 0x1F, 0x0A42);
6835                         data = MP_ReadPhyUshort(sc, 0x16);
6836                         data &= ~(BIT_1);
6837                         MP_WritePhyUshort(sc, 0x16, data);
6838                 } else {
6839                         MP_WritePhyUshort(sc, 0x1F, 0x0A42);
6840                         data = MP_ReadPhyUshort(sc, 0x16);
6841                         data |= BIT_1;
6842                         MP_WritePhyUshort(sc, 0x16, data);
6843                 }
6844                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
6845                 break;
6846         case MACFG_60:
6847                 data = MP_ReadMcuAccessRegWord(sc, 0xE052);
6848                 data |= BIT_0;
6849                 MP_WriteMcuAccessRegWord(sc, 0xE052, data);
6850                 data = MP_ReadMcuAccessRegWord(sc, 0xE056);
6851                 data &= 0xFF0F;
6852                 data |= (BIT_4 | BIT_5 | BIT_6);
6853                 MP_WriteMcuAccessRegWord(sc, 0xE056, data);
6854
6855                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
6856                 data = MP_ReadPhyUshort(sc, 0x10);
6857                 if (data & BIT_10) {
6858                         MP_WritePhyUshort(sc, 0x1F, 0x0A42);
6859                         data = MP_ReadPhyUshort(sc, 0x16);
6860                         data &= ~(BIT_1);
6861                         MP_WritePhyUshort(sc, 0x16, data);
6862                 } else {
6863                         MP_WritePhyUshort(sc, 0x1F, 0x0A42);
6864                         data = MP_ReadPhyUshort(sc, 0x16);
6865                         data |= BIT_1;
6866                         MP_WritePhyUshort(sc, 0x16, data);
6867                 }
6868                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
6869                 break;
6870         case MACFG_61:
6871         case MACFG_62:
6872         case MACFG_67:
6873                 OOB_mutex_lock(sc);
6874                 data = MP_ReadMcuAccessRegWord(sc, 0xE052);
6875                 data &= ~BIT_0;
6876                 MP_WriteMcuAccessRegWord(sc, 0xE052, data);
6877                 OOB_mutex_unlock(sc);
6878                 data = MP_ReadMcuAccessRegWord(sc, 0xE056);
6879                 data &= 0xFF0F;
6880                 data |= (BIT_4 | BIT_5 | BIT_6);
6881                 MP_WriteMcuAccessRegWord(sc, 0xE056, data);
6882                 break;
6883         case MACFG_68:
6884         case MACFG_69:
6885                 data = MP_ReadMcuAccessRegWord(sc, 0xE052);
6886                 data |= BIT_0;
6887                 MP_WriteMcuAccessRegWord(sc, 0xE052, data);
6888
6889                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
6890                 data = MP_ReadPhyUshort(sc, 0x10) | BIT_15;
6891                 MP_WritePhyUshort(sc, 0x10, data);
6892
6893                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
6894                 data = MP_ReadPhyUshort(sc, 0x11) | BIT_13 | BIT_14;
6895                 data &= ~(BIT_12);
6896                 MP_WritePhyUshort(sc, 0x11, data);
6897                 break;
6898         }
6899
6900         switch (sc->re_type) {
6901         case MACFG_58:
6902         case MACFG_59:
6903         case MACFG_60:
6904         case MACFG_68:
6905         case MACFG_69:
6906                 MP_WritePhyUshort(sc,0x1F, 0x0B82);
6907                 ClearEthPhyBit(sc, 0x10, BIT_4);
6908                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
6909                 break;
6910         }
6911
6912         return ret;
6913 }
6914
6915 static int re_disable_EEE(struct re_softc *sc)
6916 {
6917         int ret;
6918         u_int16_t data;
6919         u_int16_t PhyRegValue;
6920         u_int32_t WaitCnt;
6921
6922         ret = 0;
6923         switch (sc->re_type) {
6924         case MACFG_42:
6925         case MACFG_43:
6926                 re_eri_write(sc, 0x1B0, 2, 0, ERIAR_ExGMAC);
6927                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
6928                 MP_WritePhyUshort(sc, 0x10, 0x401F);
6929                 MP_WritePhyUshort(sc, 0x19, 0x7030);
6930
6931                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
6932                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
6933                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
6934                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
6935                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
6936                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
6937
6938                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
6939                 MP_WritePhyUshort(sc, 0x0D, 0x0003);
6940                 MP_WritePhyUshort(sc, 0x0E, 0x0015);
6941                 MP_WritePhyUshort(sc, 0x0D, 0x4003);
6942                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
6943                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
6944
6945                 MP_WritePhyUshort(sc, MII_BMCR, BMCR_AUTOEN | BMCR_STARTNEG);
6946                 break;
6947
6948         case MACFG_53:
6949                 re_eri_write(sc, 0x1B0, 2, 0, ERIAR_ExGMAC);
6950                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
6951                 MP_WritePhyUshort(sc, 0x10, 0x401F);
6952                 MP_WritePhyUshort(sc, 0x19, 0x7030);
6953
6954                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
6955                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
6956                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
6957                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
6958                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
6959                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
6960
6961                 MP_WritePhyUshort(sc, MII_BMCR, BMCR_AUTOEN | BMCR_STARTNEG);
6962                 break;
6963
6964         case MACFG_54:
6965         case MACFG_55:
6966                 re_eri_write(sc, 0x1B0, 2, 0, ERIAR_ExGMAC);
6967                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
6968                 MP_WritePhyUshort(sc, 0x10, 0xC07F);
6969                 MP_WritePhyUshort(sc, 0x19, 0x7030);
6970                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
6971
6972                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
6973                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
6974                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
6975                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
6976                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
6977                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
6978
6979                 MP_WritePhyUshort(sc, MII_BMCR, BMCR_AUTOEN | BMCR_STARTNEG);
6980                 break;
6981
6982         case MACFG_36:
6983         case MACFG_37:
6984                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
6985                 MP_WritePhyUshort(sc, 0x1E, 0x0020);
6986                 data = MP_ReadPhyUshort(sc, 0x15) & ~0x0100;
6987                 MP_WritePhyUshort(sc, 0x15, data);
6988                 MP_WritePhyUshort(sc, 0x1F, 0x0006);
6989                 MP_WritePhyUshort(sc, 0x00, 0x5A00);
6990                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
6991                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
6992                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
6993                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
6994                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
6995                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
6996                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
6997                 if (CSR_READ_1(sc, RE_CFG4) & RL_CFG4_CUSTOMIZED_LED) {
6998                         MP_WritePhyUshort(sc, 0x1F, 0x0005);
6999                         MP_WritePhyUshort(sc, 0x05, 0x8B82);
7000                         data = MP_ReadPhyUshort(sc, 0x06) & ~0x0010;
7001                         MP_WritePhyUshort(sc, 0x05, 0x8B82);
7002                         MP_WritePhyUshort(sc, 0x06, data);
7003                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
7004                 }
7005                 break;
7006
7007         case MACFG_50:
7008         case MACFG_51:
7009         case MACFG_52:
7010                 data = re_eri_read(sc,0x1B0 ,4,ERIAR_ExGMAC)& ~0x0003;
7011                 re_eri_write(sc, 0x1B0, 4, data, ERIAR_ExGMAC);
7012                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
7013                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
7014                 data = MP_ReadPhyUshort(sc, 0x06) & ~0x2000;
7015                 MP_WritePhyUshort(sc, 0x06, data);
7016                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
7017                 MP_WritePhyUshort(sc, 0x1E, 0x0020);
7018                 data = MP_ReadPhyUshort(sc, 0x15) & ~0x0100;
7019                 MP_WritePhyUshort(sc,0x15 , data);
7020                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7021                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
7022                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
7023                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
7024                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
7025                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
7026                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7027                 break;
7028
7029         case MACFG_38:
7030         case MACFG_39:
7031                 data = re_eri_read(sc,0x1B0 ,4,ERIAR_ExGMAC);
7032                 data &= ~(BIT_1 | BIT_0);
7033                 re_eri_write(sc, 0x1B0, 4, data, ERIAR_ExGMAC);
7034                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
7035                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
7036                 data = MP_ReadPhyUshort(sc, 0x06);
7037                 data &= ~BIT_13;
7038                 MP_WritePhyUshort(sc, 0x06, data);
7039                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
7040                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
7041                 MP_WritePhyUshort(sc, 0x1e, 0x0020);
7042                 data = MP_ReadPhyUshort(sc, 0x15);
7043                 data &= ~BIT_8;
7044                 MP_WritePhyUshort(sc, 0x15, data);
7045                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
7046                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7047                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
7048                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
7049                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
7050                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
7051                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
7052                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7053                 break;
7054
7055         case MACFG_56:
7056         case MACFG_57:
7057         case MACFG_58:
7058         case MACFG_59:
7059         case MACFG_60:
7060         case MACFG_61:
7061         case MACFG_62:
7062         case MACFG_67:
7063         case MACFG_68:
7064         case MACFG_69:
7065                 data = re_eri_read(sc, 0x1B0, 4, ERIAR_ExGMAC);
7066                 data &= ~(BIT_1 | BIT_0);
7067                 re_eri_write(sc, 0x1B0, 4, data, ERIAR_ExGMAC);
7068                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
7069                 data = MP_ReadPhyUshort(sc, 0x11);
7070                 MP_WritePhyUshort(sc, 0x11, data & ~BIT_4);
7071                 MP_WritePhyUshort(sc, 0x1F, 0x0A5D);
7072                 MP_WritePhyUshort(sc, 0x10, 0x0000);
7073                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7074                 break;
7075
7076         default:
7077                 ret = -EOPNOTSUPP;
7078                 break;
7079         }
7080
7081         switch (sc->re_type) {
7082         case MACFG_68:
7083         case MACFG_69:
7084                 MP_WritePhyUshort(sc, 0x1F, 0x0A42);
7085                 ClearEthPhyBit(sc, 0x14, BIT_7);
7086                 MP_WritePhyUshort(sc, 0x1F, 0x0A4A);
7087                 ClearEthPhyBit(sc, 0x11, BIT_9);
7088                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7089                 break;
7090         }
7091
7092         /*Advanced EEE*/
7093         switch (sc->re_type) {
7094         case MACFG_58:
7095         case MACFG_59:
7096         case MACFG_60:
7097         case MACFG_68:
7098         case MACFG_69:
7099                 MP_WritePhyUshort(sc, 0x1F, 0x0B82);
7100                 SetEthPhyBit(sc, 0x10, BIT_4);
7101                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7102
7103                 MP_WritePhyUshort(sc,0x1F, 0x0B80);
7104                 WaitCnt = 0;
7105                 do {
7106                         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
7107                         PhyRegValue &= 0x0040;
7108                         DELAY(50);
7109                         DELAY(50);
7110                         WaitCnt++;
7111                 } while(PhyRegValue != 0x0040 && WaitCnt <1000);
7112
7113                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7114                 break;
7115         }
7116
7117         switch (sc->re_type) {
7118         case MACFG_59:
7119                 re_eri_write(sc, 0x1EA, 1, 0x00, ERIAR_ExGMAC);
7120
7121                 MP_WritePhyUshort(sc, 0x1F, 0x0A42);
7122                 data = MP_ReadPhyUshort(sc, 0x16);
7123                 data &= ~(BIT_1);
7124                 MP_WritePhyUshort(sc, 0x16, data);
7125                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7126                 break;
7127         case MACFG_60:
7128                 data = MP_ReadMcuAccessRegWord(sc, 0xE052);
7129                 data &= ~(BIT_0);
7130                 MP_WriteMcuAccessRegWord(sc, 0xE052, data);
7131
7132                 MP_WritePhyUshort(sc, 0x1F, 0x0A42);
7133                 data = MP_ReadPhyUshort(sc, 0x16);
7134                 data &= ~(BIT_1);
7135                 MP_WritePhyUshort(sc, 0x16, data);
7136                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7137                 break;
7138         case MACFG_61:
7139         case MACFG_62:
7140         case MACFG_67:
7141                 data = MP_ReadMcuAccessRegWord(sc, 0xE052);
7142                 data &= ~(BIT_0);
7143                 MP_WriteMcuAccessRegWord(sc, 0xE052, data);
7144                 break;
7145         case MACFG_68:
7146         case MACFG_69:
7147                 data = MP_ReadMcuAccessRegWord(sc, 0xE052);
7148                 data &= ~(BIT_0);
7149                 MP_WriteMcuAccessRegWord(sc, 0xE052, data);
7150
7151                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
7152                 data = MP_ReadPhyUshort(sc, 0x10) & ~(BIT_15);
7153                 MP_WritePhyUshort(sc, 0x10, data);
7154
7155                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
7156                 data = MP_ReadPhyUshort(sc, 0x11) & ~(BIT_12 | BIT_13 | BIT_14);
7157                 MP_WritePhyUshort(sc, 0x11, data);
7158                 break;
7159         }
7160
7161         switch (sc->re_type) {
7162         case MACFG_58:
7163         case MACFG_59:
7164         case MACFG_60:
7165         case MACFG_68:
7166         case MACFG_69:
7167                 MP_WritePhyUshort(sc,0x1F, 0x0B82);
7168                 ClearEthPhyBit(sc, 0x10, BIT_4);
7169                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7170                 break;
7171         }
7172
7173         return ret;
7174 }
7175
7176 static int re_phy_ram_code_check(struct re_softc *sc)
7177 {
7178         u_int16_t PhyRegValue;
7179         u_int32_t WaitCnt;
7180         int retval = TRUE;
7181
7182         switch(sc->re_type) {
7183         case MACFG_56:
7184                 MP_WritePhyUshort(sc, 0x1f, 0x0A40);
7185                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
7186                 PhyRegValue &= ~(BIT_11);
7187                 MP_WritePhyUshort(sc, 0x10, PhyRegValue);
7188
7189
7190                 MP_WritePhyUshort(sc, 0x1f, 0x0A00);
7191                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
7192                 PhyRegValue &= ~(BIT_12 | BIT_13 | BIT_14 | BIT_15);
7193                 MP_WritePhyUshort(sc, 0x10, PhyRegValue);
7194
7195                 MP_WritePhyUshort(sc, 0x1f, 0x0A43);
7196                 MP_WritePhyUshort(sc, 0x13, 0x8010);
7197                 PhyRegValue = MP_ReadPhyUshort(sc, 0x14);
7198                 PhyRegValue &= ~(BIT_11);
7199                 MP_WritePhyUshort(sc, 0x14, PhyRegValue);
7200
7201                 MP_WritePhyUshort(sc,0x1f, 0x0B82);
7202                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
7203                 PhyRegValue |= BIT_4;
7204                 MP_WritePhyUshort(sc,0x10, PhyRegValue);
7205
7206                 MP_WritePhyUshort(sc,0x1f, 0x0B80);
7207                 WaitCnt = 0;
7208                 do {
7209                         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
7210                         PhyRegValue &= 0x0040;
7211                         DELAY(50);
7212                         DELAY(50);
7213                         WaitCnt++;
7214                 } while(PhyRegValue != 0x0040 && WaitCnt <1000);
7215
7216                 if (WaitCnt == 1000) {
7217                         retval = FALSE ;
7218                 }
7219
7220                 MP_WritePhyUshort(sc, 0x1f, 0x0A40);
7221                 MP_WritePhyUshort(sc, 0x10, 0x0140);
7222
7223                 MP_WritePhyUshort(sc, 0x1f, 0x0A4A);
7224                 PhyRegValue = MP_ReadPhyUshort(sc, 0x13);
7225                 PhyRegValue &= ~(BIT_6);
7226                 PhyRegValue |= (BIT_7);
7227                 MP_WritePhyUshort(sc, 0x13, PhyRegValue);
7228
7229                 MP_WritePhyUshort(sc, 0x1f, 0x0A44);
7230                 PhyRegValue = MP_ReadPhyUshort(sc, 0x14);
7231                 PhyRegValue |= (BIT_2);
7232                 MP_WritePhyUshort(sc, 0x14, PhyRegValue);
7233
7234                 MP_WritePhyUshort(sc, 0x1f, 0x0A50);
7235                 PhyRegValue = MP_ReadPhyUshort(sc, 0x11);
7236                 PhyRegValue |= (BIT_11|BIT_12);
7237                 MP_WritePhyUshort(sc, 0x11, PhyRegValue);
7238
7239                 MP_WritePhyUshort(sc, 0x1f, 0x0B82);
7240                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
7241                 PhyRegValue &= ~(BIT_4);
7242                 MP_WritePhyUshort(sc, 0x10, PhyRegValue);
7243
7244                 MP_WritePhyUshort(sc,0x1f, 0x0A22);
7245                 WaitCnt = 0;
7246                 do {
7247                         PhyRegValue = MP_ReadPhyUshort(sc, 0x12);
7248                         PhyRegValue &= 0x0010;
7249                         DELAY(50);
7250                         DELAY(50);
7251                         WaitCnt++;
7252                 } while(PhyRegValue != 0x0010 && WaitCnt <1000);
7253
7254                 if (WaitCnt == 1000) {
7255                         retval = FALSE;
7256                 }
7257
7258                 MP_WritePhyUshort(sc, 0x1f, 0x0A40);
7259                 MP_WritePhyUshort(sc, 0x10, 0x1040);
7260
7261                 MP_WritePhyUshort(sc, 0x1f, 0x0A4A);
7262                 PhyRegValue = MP_ReadPhyUshort(sc, 0x13);
7263                 PhyRegValue &= ~(BIT_6|BIT_7);
7264                 MP_WritePhyUshort(sc, 0x13, PhyRegValue);
7265
7266                 MP_WritePhyUshort(sc, 0x1f, 0x0A44);
7267                 PhyRegValue = MP_ReadPhyUshort(sc, 0x14);
7268                 PhyRegValue &= ~(BIT_2);
7269                 MP_WritePhyUshort(sc, 0x14, PhyRegValue);
7270
7271                 MP_WritePhyUshort(sc, 0x1f, 0x0A50);
7272                 PhyRegValue = MP_ReadPhyUshort(sc, 0x11);
7273                 PhyRegValue &= ~(BIT_11|BIT_12);
7274                 MP_WritePhyUshort(sc, 0x11, PhyRegValue);
7275
7276                 MP_WritePhyUshort(sc, 0x1f, 0x0A43);
7277                 MP_WritePhyUshort(sc, 0x13, 0x8010);
7278                 PhyRegValue = MP_ReadPhyUshort(sc, 0x14);
7279                 PhyRegValue |= (BIT_11);
7280                 MP_WritePhyUshort(sc, 0x14, PhyRegValue);
7281
7282                 MP_WritePhyUshort(sc,0x1f, 0x0B82);
7283                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
7284                 PhyRegValue |= BIT_4;
7285                 MP_WritePhyUshort(sc,0x10, PhyRegValue);
7286
7287                 MP_WritePhyUshort(sc,0x1f, 0x0B80);
7288                 WaitCnt = 0;
7289                 do {
7290                         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
7291                         PhyRegValue &= 0x0040;
7292                         DELAY(50);
7293                         DELAY(50);
7294                         WaitCnt++;
7295                 } while(PhyRegValue != 0x0040 && WaitCnt <1000);
7296
7297                 if (WaitCnt == 1000) {
7298                         retval = FALSE;
7299                 }
7300
7301                 MP_WritePhyUshort(sc, 0x1f, 0x0A20);
7302                 PhyRegValue = MP_ReadPhyUshort(sc, 0x13);
7303                 if (PhyRegValue & BIT_11) {
7304                         if (PhyRegValue & BIT_10) {
7305                                 retval = FALSE;
7306                         }
7307                 }
7308
7309                 MP_WritePhyUshort(sc, 0x1f, 0x0B82);
7310                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
7311                 PhyRegValue &= ~(BIT_4);
7312                 MP_WritePhyUshort(sc, 0x10, PhyRegValue);
7313
7314                 //delay 2ms
7315                 DELAY(2000);
7316                 break;
7317         default:
7318                 break;
7319         }
7320
7321         MP_WritePhyUshort(sc, 0x1F, 0x0000);
7322
7323         return retval;
7324 }
7325
7326 static void re_set_phy_ram_code_check_fail_flag(struct re_softc *sc)
7327 {
7328         u_int16_t TmpUshort;
7329
7330         switch(sc->re_type) {
7331         case MACFG_56:
7332                 TmpUshort = MP_ReadMcuAccessRegWord(sc, 0xD3C0);
7333                 TmpUshort |= BIT_0;
7334                 MP_WriteMcuAccessRegWord(sc, 0xD3C0, TmpUshort);
7335                 break;
7336         }
7337 }
7338
7339 static void re_hw_phy_config(struct re_softc *sc)
7340 {
7341         u_int16_t Data, PhyRegValue, TmpUshort;
7342         u_int32_t Data_u32;
7343         u_int16_t dout_tapbin;
7344         int     i;
7345         u_int32_t WaitCnt;
7346
7347         if (sc->re_type == MACFG_59 || sc->re_type == MACFG_60 ||
7348             sc->re_type == MACFG_62 || sc->re_type == MACFG_67 ||
7349             sc->re_type == MACFG_68 || sc->re_type == MACFG_69) {
7350                 MP_WritePhyOcpRegWord(sc, 0x0C41, 0x13, 0x0000);
7351                 MP_WritePhyOcpRegWord(sc, 0x0C41, 0x13, 0x0500);
7352         }
7353
7354         if (FALSE == re_phy_ram_code_check(sc)) {
7355                 re_set_phy_ram_code_check_fail_flag(sc);
7356                 return;
7357         }
7358
7359         MP_WritePhyUshort(sc, 0x1F, 0x0000);
7360
7361         if (sc->re_type == MACFG_3) {
7362                 CSR_WRITE_1(sc, 0x82, CSR_READ_1(sc, 0x82)|BIT_0);
7363                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7364                 MP_WritePhyUshort(sc, 0x0b, 0x0000);
7365
7366                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
7367                 MP_WritePhyUshort(sc, 0x06, 0x006e);
7368                 MP_WritePhyUshort(sc, 0x08, 0x0708);
7369                 MP_WritePhyUshort(sc, 0x15, 0x4000);
7370                 MP_WritePhyUshort(sc, 0x18, 0x65c7);
7371
7372                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
7373                 MP_WritePhyUshort(sc, 0x03, 0x00a1);
7374                 MP_WritePhyUshort(sc, 0x02, 0x0008);
7375                 MP_WritePhyUshort(sc, 0x01, 0x0120);
7376                 MP_WritePhyUshort(sc, 0x00, 0x1000);
7377                 MP_WritePhyUshort(sc, 0x04, 0x0800);
7378                 MP_WritePhyUshort(sc, 0x04, 0x0000);
7379
7380                 MP_WritePhyUshort(sc, 0x03, 0xff41);
7381                 MP_WritePhyUshort(sc, 0x02, 0xdf60);
7382                 MP_WritePhyUshort(sc, 0x01, 0x0140);
7383                 MP_WritePhyUshort(sc, 0x00, 0x0077);
7384                 MP_WritePhyUshort(sc, 0x04, 0x7800);
7385                 MP_WritePhyUshort(sc, 0x04, 0x7000);
7386
7387                 MP_WritePhyUshort(sc, 0x03, 0x802f);
7388                 MP_WritePhyUshort(sc, 0x02, 0x4f02);
7389                 MP_WritePhyUshort(sc, 0x01, 0x0409);
7390                 MP_WritePhyUshort(sc, 0x00, 0xf0f9);
7391                 MP_WritePhyUshort(sc, 0x04, 0x9800);
7392                 MP_WritePhyUshort(sc, 0x04, 0x9000);
7393
7394                 MP_WritePhyUshort(sc, 0x03, 0xdf01);
7395                 MP_WritePhyUshort(sc, 0x02, 0xdf20);
7396                 MP_WritePhyUshort(sc, 0x01, 0xff95);
7397                 MP_WritePhyUshort(sc, 0x00, 0xba00);
7398                 MP_WritePhyUshort(sc, 0x04, 0xa800);
7399                 MP_WritePhyUshort(sc, 0x04, 0xa000);
7400
7401                 MP_WritePhyUshort(sc, 0x03, 0xff41);
7402                 MP_WritePhyUshort(sc, 0x02, 0xdf20);
7403                 MP_WritePhyUshort(sc, 0x01, 0x0140);
7404                 MP_WritePhyUshort(sc, 0x00, 0x00bb);
7405                 MP_WritePhyUshort(sc, 0x04, 0xb800);
7406                 MP_WritePhyUshort(sc, 0x04, 0xb000);
7407
7408                 MP_WritePhyUshort(sc, 0x03, 0xdf41);
7409                 MP_WritePhyUshort(sc, 0x02, 0xdc60);
7410                 MP_WritePhyUshort(sc, 0x01, 0x6340);
7411                 MP_WritePhyUshort(sc, 0x00, 0x007d);
7412                 MP_WritePhyUshort(sc, 0x04, 0xd800);
7413                 MP_WritePhyUshort(sc, 0x04, 0xd000);
7414
7415                 MP_WritePhyUshort(sc, 0x03, 0xdf01);
7416                 MP_WritePhyUshort(sc, 0x02, 0xdf20);
7417                 MP_WritePhyUshort(sc, 0x01, 0x100a);
7418                 MP_WritePhyUshort(sc, 0x00, 0xa0ff);
7419                 MP_WritePhyUshort(sc, 0x04, 0xf800);
7420                 MP_WritePhyUshort(sc, 0x04, 0xf000);
7421
7422                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
7423                 MP_WritePhyUshort(sc, 0x0b, 0x0000);
7424                 MP_WritePhyUshort(sc, 0x00, 0x9200);
7425
7426                 CSR_WRITE_1(sc, 0x82, 0x0d);
7427         } else if (sc->re_type == MACFG_4) {
7428                 MP_WritePhyUshort(sc, 0x1f, 0x0002);
7429                 MP_WritePhyUshort(sc, 0x01, 0x90D0);
7430                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
7431                 // MP_WritePhyUshort(sc, 0x1e, 0x8c00); /* PHY link down with some Giga switch */
7432         } else if (sc->re_type == MACFG_5) {
7433                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
7434                 MP_WritePhyUshort(sc, 0x04, 0x0000);
7435                 MP_WritePhyUshort(sc, 0x03, 0x00a1);
7436                 MP_WritePhyUshort(sc, 0x02, 0x0008);
7437                 MP_WritePhyUshort(sc, 0x01, 0x0120);
7438                 MP_WritePhyUshort(sc, 0x00, 0x1000);
7439                 MP_WritePhyUshort(sc, 0x04, 0x0800);
7440
7441                 MP_WritePhyUshort(sc, 0x04, 0x9000);
7442                 MP_WritePhyUshort(sc, 0x03, 0x802f);
7443                 MP_WritePhyUshort(sc, 0x02, 0x4f02);
7444                 MP_WritePhyUshort(sc, 0x01, 0x0409);
7445                 MP_WritePhyUshort(sc, 0x00, 0xf099);
7446                 MP_WritePhyUshort(sc, 0x04, 0x9800);
7447
7448                 MP_WritePhyUshort(sc, 0x04, 0xa000);
7449                 MP_WritePhyUshort(sc, 0x03, 0xdf01);
7450                 MP_WritePhyUshort(sc, 0x02, 0xdf20);
7451                 MP_WritePhyUshort(sc, 0x01, 0xff95);
7452                 MP_WritePhyUshort(sc, 0x00, 0xba00);
7453                 MP_WritePhyUshort(sc, 0x04, 0xa800);
7454
7455                 MP_WritePhyUshort(sc, 0x04, 0xf000);
7456                 MP_WritePhyUshort(sc, 0x03, 0xdf01);
7457                 MP_WritePhyUshort(sc, 0x02, 0xdf20);
7458                 MP_WritePhyUshort(sc, 0x01, 0x101a);
7459                 MP_WritePhyUshort(sc, 0x00, 0xa0ff);
7460                 MP_WritePhyUshort(sc, 0x04, 0xf800);
7461                 MP_WritePhyUshort(sc, 0x04, 0x0000);
7462                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
7463
7464                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
7465                 MP_WritePhyUshort(sc, 0x10, 0xf41b);
7466                 MP_WritePhyUshort(sc, 0x14, 0xfb54);
7467                 MP_WritePhyUshort(sc, 0x18, 0xf5c7);
7468                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
7469
7470                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
7471                 MP_WritePhyUshort(sc, 0x17, 0x0CC0);
7472                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
7473
7474                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
7475                 MP_WritePhyUshort(sc, 0x10, 0xf01b);
7476
7477         } else if (sc->re_type == MACFG_6) {
7478                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
7479                 MP_WritePhyUshort(sc, 0x04, 0x0000);
7480                 MP_WritePhyUshort(sc, 0x03, 0x00a1);
7481                 MP_WritePhyUshort(sc, 0x02, 0x0008);
7482                 MP_WritePhyUshort(sc, 0x01, 0x0120);
7483                 MP_WritePhyUshort(sc, 0x00, 0x1000);
7484                 MP_WritePhyUshort(sc, 0x04, 0x0800);
7485
7486                 MP_WritePhyUshort(sc, 0x04, 0x9000);
7487                 MP_WritePhyUshort(sc, 0x03, 0x802f);
7488                 MP_WritePhyUshort(sc, 0x02, 0x4f02);
7489                 MP_WritePhyUshort(sc, 0x01, 0x0409);
7490                 MP_WritePhyUshort(sc, 0x00, 0xf099);
7491                 MP_WritePhyUshort(sc, 0x04, 0x9800);
7492
7493                 MP_WritePhyUshort(sc, 0x04, 0xa000);
7494                 MP_WritePhyUshort(sc, 0x03, 0xdf01);
7495                 MP_WritePhyUshort(sc, 0x02, 0xdf20);
7496                 MP_WritePhyUshort(sc, 0x01, 0xff95);
7497                 MP_WritePhyUshort(sc, 0x00, 0xba00);
7498                 MP_WritePhyUshort(sc, 0x04, 0xa800);
7499
7500                 MP_WritePhyUshort(sc, 0x04, 0xf000);
7501                 MP_WritePhyUshort(sc, 0x03, 0xdf01);
7502                 MP_WritePhyUshort(sc, 0x02, 0xdf20);
7503                 MP_WritePhyUshort(sc, 0x01, 0x101a);
7504                 MP_WritePhyUshort(sc, 0x00, 0xa0ff);
7505                 MP_WritePhyUshort(sc, 0x04, 0xf800);
7506                 MP_WritePhyUshort(sc, 0x04, 0x0000);
7507                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
7508
7509                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
7510                 MP_WritePhyUshort(sc, 0x0b, 0x8480);
7511                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
7512
7513                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
7514                 MP_WritePhyUshort(sc, 0x18, 0x67c7);
7515                 MP_WritePhyUshort(sc, 0x04, 0x2000);
7516                 MP_WritePhyUshort(sc, 0x03, 0x002f);
7517                 MP_WritePhyUshort(sc, 0x02, 0x4360);
7518                 MP_WritePhyUshort(sc, 0x01, 0x0109);
7519                 MP_WritePhyUshort(sc, 0x00, 0x3022);
7520                 MP_WritePhyUshort(sc, 0x04, 0x2800);
7521                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
7522
7523                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
7524                 MP_WritePhyUshort(sc, 0x17, 0x0CC0);
7525         } else if (sc->re_type == MACFG_14) {
7526                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
7527                 MP_WritePhyUshort(sc, 0x11, MP_ReadPhyUshort(sc, 0x11) | 0x1000);
7528                 MP_WritePhyUshort(sc, 0x19, MP_ReadPhyUshort(sc, 0x19) | 0x2000);
7529                 MP_WritePhyUshort(sc, 0x10, MP_ReadPhyUshort(sc, 0x10) | 0x8000);
7530
7531                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
7532                 MP_WritePhyUshort(sc, 0x08, 0x441D);
7533                 MP_WritePhyUshort(sc, 0x01, 0x9100);
7534         } else if (sc->re_type == MACFG_15) {
7535                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
7536                 MP_WritePhyUshort(sc, 0x11, MP_ReadPhyUshort(sc, 0x11) | 0x1000);
7537                 MP_WritePhyUshort(sc, 0x19, MP_ReadPhyUshort(sc, 0x19) | 0x2000);
7538                 MP_WritePhyUshort(sc, 0x10, MP_ReadPhyUshort(sc, 0x10) | 0x8000);
7539
7540                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
7541                 MP_WritePhyUshort(sc, 0x08, 0x441D);
7542                 MP_WritePhyUshort(sc, 0x01, 0x9100);
7543         } else if (sc->re_type == MACFG_17) {
7544                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
7545                 MP_WritePhyUshort(sc, 0x11, MP_ReadPhyUshort(sc, 0x11) | 0x1000);
7546                 MP_WritePhyUshort(sc, 0x19, MP_ReadPhyUshort(sc, 0x19) | 0x2000);
7547                 MP_WritePhyUshort(sc, 0x10, MP_ReadPhyUshort(sc, 0x10) | 0x8000);
7548
7549                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
7550                 MP_WritePhyUshort(sc, 0x08, 0x441D);
7551
7552                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
7553         } else if (sc->re_type == MACFG_21) {
7554                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
7555                 MP_WritePhyUshort(sc, 0x0B, 0x94B0);
7556
7557                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
7558                 MP_WritePhyUshort(sc, 0x12, 0x6096);
7559                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7560         } else if (sc->re_type == MACFG_22) {
7561                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
7562                 MP_WritePhyUshort(sc, 0x0B, 0x94B0);
7563
7564                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
7565                 MP_WritePhyUshort(sc, 0x12, 0x6096);
7566         } else if (sc->re_type == MACFG_23) {
7567                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
7568                 MP_WritePhyUshort(sc, 0x0B, 0x94B0);
7569
7570                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
7571                 MP_WritePhyUshort(sc, 0x12, 0x6096);
7572         } else if (sc->re_type == MACFG_24) {
7573                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
7574                 MP_WritePhyUshort(sc, 0x12, 0x2300);
7575                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7576                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
7577                 MP_WritePhyUshort(sc, 0x16, 0x000A);
7578                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7579
7580                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
7581                 MP_WritePhyUshort(sc, 0x12, 0xC096);
7582                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7583
7584                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
7585                 MP_WritePhyUshort(sc, 0x00, 0x88DE);
7586                 MP_WritePhyUshort(sc, 0x01, 0x82B1);
7587                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7588
7589                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
7590                 MP_WritePhyUshort(sc, 0x08, 0x9E30);
7591                 MP_WritePhyUshort(sc, 0x09, 0x01F0);
7592                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7593
7594                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
7595                 MP_WritePhyUshort(sc, 0x0A, 0x5500);
7596                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7597
7598                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
7599                 MP_WritePhyUshort(sc, 0x03, 0x7002);
7600                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7601
7602                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7603                 MP_WritePhyUshort(sc, 0x14, MP_ReadPhyUshort(sc, 0x14) | BIT_5);
7604                 MP_WritePhyUshort(sc, 0x0d, MP_ReadPhyUshort(sc, 0x0d) | BIT_5);
7605         } else if (sc->re_type == MACFG_25) {
7606                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
7607                 MP_WritePhyUshort(sc, 0x12, 0x2300);
7608                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
7609                 MP_WritePhyUshort(sc, 0x16, 0x0F0A);
7610                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7611
7612                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
7613                 MP_WritePhyUshort(sc, 0x00, 0x88DE);
7614                 MP_WritePhyUshort(sc, 0x01, 0x82B1);
7615                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7616
7617                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
7618                 MP_WritePhyUshort(sc, 0x0C, 0x7EB8);
7619                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7620
7621                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
7622                 MP_WritePhyUshort(sc, 0x06, 0x0761);
7623                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7624
7625                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
7626                 MP_WritePhyUshort(sc, 0x03, 0x802F);
7627                 MP_WritePhyUshort(sc, 0x02, 0x4F02);
7628                 MP_WritePhyUshort(sc, 0x01, 0x0409);
7629                 MP_WritePhyUshort(sc, 0x00, 0xF099);
7630                 MP_WritePhyUshort(sc, 0x04, 0x9800);
7631                 MP_WritePhyUshort(sc, 0x04, 0x9000);
7632                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7633
7634                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7635                 MP_WritePhyUshort(sc, 0x16, MP_ReadPhyUshort(sc , 0x16) | BIT_0);
7636
7637                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7638                 MP_WritePhyUshort(sc, 0x14, MP_ReadPhyUshort(sc , 0x14) | BIT_5);
7639                 MP_WritePhyUshort(sc, 0x0D, MP_ReadPhyUshort(sc , 0x0D) & ~BIT_5);
7640
7641                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
7642                 MP_WritePhyUshort(sc, 0x1D, 0x3D98);
7643                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7644
7645                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
7646                 MP_WritePhyUshort(sc, 0x17, 0x0CC0);
7647                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7648         } else if (sc->re_type == MACFG_26) {
7649                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
7650                 MP_WritePhyUshort(sc, 0x12, 0x2300);
7651                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
7652                 MP_WritePhyUshort(sc, 0x16, 0x0F0A);
7653                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7654
7655                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
7656                 MP_WritePhyUshort(sc, 0x00, 0x88DE);
7657                 MP_WritePhyUshort(sc, 0x01, 0x82B1);
7658                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7659
7660                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
7661                 MP_WritePhyUshort(sc, 0x0C, 0x7EB8);
7662                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7663
7664                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
7665                 MP_WritePhyUshort(sc, 0x06, 0x5461);
7666                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7667
7668                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
7669                 MP_WritePhyUshort(sc, 0x06, 0x5461);
7670                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7671
7672                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7673                 MP_WritePhyUshort(sc, 0x16, MP_ReadPhyUshort(sc, 0x16) | BIT_0);
7674
7675                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7676                 MP_WritePhyUshort(sc, 0x14, MP_ReadPhyUshort(sc, 0x14) | BIT_5);
7677                 MP_WritePhyUshort(sc, 0x0D, MP_ReadPhyUshort(sc, 0x0D) & ~BIT_5);
7678
7679                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
7680                 MP_WritePhyUshort(sc, 0x1D, 0x3D98);
7681                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7682
7683                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
7684                 MP_WritePhyUshort(sc, 0x17, 0x0CC0);
7685                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7686         } else if (sc->re_type == MACFG_27) {
7687                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7688                 MP_WritePhyUshort(sc, 0x0d, MP_ReadPhyUshort(sc, 0x0d) | BIT_5);
7689                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7690
7691                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
7692                 MP_WritePhyUshort(sc, 0x1D, 0x3D98);
7693                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7694
7695                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
7696                 MP_WritePhyUshort(sc, 0x14, 0xCAA3);
7697                 MP_WritePhyUshort(sc, 0x1C, 0x000A);
7698                 MP_WritePhyUshort(sc, 0x18, 0x65D0);
7699
7700                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
7701                 MP_WritePhyUshort(sc, 0x17, 0xB580);
7702                 MP_WritePhyUshort(sc, 0x18, 0xFF54);
7703                 MP_WritePhyUshort(sc, 0x19, 0x3954);
7704
7705                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
7706                 MP_WritePhyUshort(sc, 0x0D, 0x310C);
7707                 MP_WritePhyUshort(sc, 0x0E, 0x310C);
7708                 MP_WritePhyUshort(sc, 0x0F, 0x311C);
7709                 MP_WritePhyUshort(sc, 0x06, 0x0761);
7710
7711                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
7712                 MP_WritePhyUshort(sc, 0x18, 0xFF55);
7713                 MP_WritePhyUshort(sc, 0x19, 0x3955);
7714                 MP_WritePhyUshort(sc, 0x18, 0xFF54);
7715                 MP_WritePhyUshort(sc, 0x19, 0x3954);
7716
7717                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
7718                 MP_WritePhyUshort(sc, 0x17, 0x0CC0);
7719         } else if (sc->re_type == MACFG_28) {
7720                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7721                 MP_WritePhyUshort(sc, 0x14, MP_ReadPhyUshort(sc, 0x14) | BIT_5);
7722                 MP_WritePhyUshort(sc, 0x0d, MP_ReadPhyUshort(sc, 0x0d) | BIT_5);
7723
7724                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
7725                 MP_WritePhyUshort(sc, 0x14, 0xCAA3);
7726                 MP_WritePhyUshort(sc, 0x1C, 0x000A);
7727                 MP_WritePhyUshort(sc, 0x18, 0x65D0);
7728
7729                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
7730                 MP_WritePhyUshort(sc, 0x17, 0xB580);
7731                 MP_WritePhyUshort(sc, 0x18, 0xFF54);
7732                 MP_WritePhyUshort(sc, 0x19, 0x3954);
7733
7734                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
7735                 MP_WritePhyUshort(sc, 0x0D, 0x310C);
7736                 MP_WritePhyUshort(sc, 0x0E, 0x310C);
7737                 MP_WritePhyUshort(sc, 0x0F, 0x311C);
7738                 MP_WritePhyUshort(sc, 0x06, 0x0761);
7739
7740                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
7741                 MP_WritePhyUshort(sc, 0x18, 0xFF55);
7742                 MP_WritePhyUshort(sc, 0x19, 0x3955);
7743                 MP_WritePhyUshort(sc, 0x18, 0xFF54);
7744                 MP_WritePhyUshort(sc, 0x19, 0x3954);
7745
7746                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
7747                 MP_WritePhyUshort(sc, 0x17, 0x0CC0);
7748
7749                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7750                 MP_WritePhyUshort(sc, 0x16, MP_ReadPhyUshort(sc, 0x16) | BIT_0);
7751                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
7752         } else if (sc->re_type == MACFG_31) {
7753                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
7754                 MP_WritePhyUshort(sc, 0x06, 0x4064);
7755                 MP_WritePhyUshort(sc, 0x07, 0x2863);
7756                 MP_WritePhyUshort(sc, 0x08, 0x059C);
7757                 MP_WritePhyUshort(sc, 0x09, 0x26B4);
7758                 MP_WritePhyUshort(sc, 0x0A, 0x6A19);
7759                 MP_WritePhyUshort(sc, 0x0B, 0xDCC8);
7760                 MP_WritePhyUshort(sc, 0x10, 0xF06D);
7761                 MP_WritePhyUshort(sc, 0x14, 0x7F68);
7762                 MP_WritePhyUshort(sc, 0x18, 0x7FD9);
7763                 MP_WritePhyUshort(sc, 0x1C, 0xF0FF);
7764                 MP_WritePhyUshort(sc, 0x1D, 0x3D9C);
7765                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
7766                 MP_WritePhyUshort(sc, 0x12, 0xF49F);
7767                 MP_WritePhyUshort(sc, 0x13, 0x070B);
7768                 MP_WritePhyUshort(sc, 0x1A, 0x05AD);
7769                 MP_WritePhyUshort(sc, 0x14, 0x94C0);
7770
7771                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
7772                 Data = MP_ReadPhyUshort(sc, 0x0B) & 0xFF00;
7773                 Data |= 0x10;
7774                 MP_WritePhyUshort(sc, 0x0B, Data);
7775                 Data = MP_ReadPhyUshort(sc, 0x0C) & 0x00FF;
7776                 Data |= 0xA200;
7777                 MP_WritePhyUshort(sc, 0x0C, Data);
7778
7779                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
7780                 MP_WritePhyUshort(sc, 0x06, 0x5561);
7781                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
7782                 MP_WritePhyUshort(sc, 0x05, 0x8332);
7783                 MP_WritePhyUshort(sc, 0x06, 0x5561);
7784
7785                 if (MP_ReadEfuse(sc, 0x01) == 0xb1) {
7786                         MP_WritePhyUshort(sc, 0x1F, 0x0002);
7787                         MP_WritePhyUshort(sc, 0x05, 0x669A);
7788                         MP_WritePhyUshort(sc, 0x1F, 0x0005);
7789                         MP_WritePhyUshort(sc, 0x05, 0x8330);
7790                         MP_WritePhyUshort(sc, 0x06, 0x669A);
7791
7792                         MP_WritePhyUshort(sc, 0x1F, 0x0002);
7793                         Data = MP_ReadPhyUshort(sc, 0x0D);
7794                         if ((Data & 0x00FF) != 0x006C) {
7795                                 Data &= 0xFF00;
7796                                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
7797                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x0065);
7798                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x0066);
7799                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x0067);
7800                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x0068);
7801                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x0069);
7802                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x006A);
7803                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x006B);
7804                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x006C);
7805                         }
7806                 } else {
7807                         MP_WritePhyUshort(sc, 0x1F, 0x0002);
7808                         MP_WritePhyUshort(sc, 0x05, 0x6662);
7809                         MP_WritePhyUshort(sc, 0x1F, 0x0005);
7810                         MP_WritePhyUshort(sc, 0x05, 0x8330);
7811                         MP_WritePhyUshort(sc, 0x06, 0x6662);
7812                 }
7813
7814                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
7815                 Data = MP_ReadPhyUshort(sc, 0x0D);
7816                 Data |= 0x300;
7817                 MP_WritePhyUshort(sc, 0x0D, Data);
7818                 Data = MP_ReadPhyUshort(sc, 0x0F);
7819                 Data |= 0x10;
7820                 MP_WritePhyUshort(sc, 0x0F, Data);
7821
7822                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
7823                 Data = MP_ReadPhyUshort(sc, 0x02);
7824                 Data &= ~0x600;
7825                 Data |= 0x100;
7826                 MP_WritePhyUshort(sc, 0x02, Data);
7827                 Data = MP_ReadPhyUshort(sc, 0x03);
7828                 Data &= ~0xE000;
7829                 MP_WritePhyUshort(sc, 0x03, Data);
7830
7831                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
7832                 MP_WritePhyUshort(sc, 0x17, 0x0CC0);
7833
7834                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
7835                 MP_WritePhyUshort(sc, 0x05, 0x001B);
7836                 if (MP_ReadPhyUshort(sc, 0x06) == 0xBF00) {
7837                         MP_WritePhyUshort(sc, 0x1f, 0x0005);
7838                         MP_WritePhyUshort(sc, 0x05, 0xfff6);
7839                         MP_WritePhyUshort(sc, 0x06, 0x0080);
7840                         MP_WritePhyUshort(sc, 0x05, 0x8000);
7841                         MP_WritePhyUshort(sc, 0x06, 0xf8f9);
7842                         MP_WritePhyUshort(sc, 0x06, 0xfaef);
7843                         MP_WritePhyUshort(sc, 0x06, 0x59ee);
7844                         MP_WritePhyUshort(sc, 0x06, 0xf8ea);
7845                         MP_WritePhyUshort(sc, 0x06, 0x00ee);
7846                         MP_WritePhyUshort(sc, 0x06, 0xf8eb);
7847                         MP_WritePhyUshort(sc, 0x06, 0x00e0);
7848                         MP_WritePhyUshort(sc, 0x06, 0xf87c);
7849                         MP_WritePhyUshort(sc, 0x06, 0xe1f8);
7850                         MP_WritePhyUshort(sc, 0x06, 0x7d59);
7851                         MP_WritePhyUshort(sc, 0x06, 0x0fef);
7852                         MP_WritePhyUshort(sc, 0x06, 0x0139);
7853                         MP_WritePhyUshort(sc, 0x06, 0x029e);
7854                         MP_WritePhyUshort(sc, 0x06, 0x06ef);
7855                         MP_WritePhyUshort(sc, 0x06, 0x1039);
7856                         MP_WritePhyUshort(sc, 0x06, 0x089f);
7857                         MP_WritePhyUshort(sc, 0x06, 0x2aee);
7858                         MP_WritePhyUshort(sc, 0x06, 0xf8ea);
7859                         MP_WritePhyUshort(sc, 0x06, 0x00ee);
7860                         MP_WritePhyUshort(sc, 0x06, 0xf8eb);
7861                         MP_WritePhyUshort(sc, 0x06, 0x01e0);
7862                         MP_WritePhyUshort(sc, 0x06, 0xf87c);
7863                         MP_WritePhyUshort(sc, 0x06, 0xe1f8);
7864                         MP_WritePhyUshort(sc, 0x06, 0x7d58);
7865                         MP_WritePhyUshort(sc, 0x06, 0x409e);
7866                         MP_WritePhyUshort(sc, 0x06, 0x0f39);
7867                         MP_WritePhyUshort(sc, 0x06, 0x46aa);
7868                         MP_WritePhyUshort(sc, 0x06, 0x0bbf);
7869                         MP_WritePhyUshort(sc, 0x06, 0x8290);
7870                         MP_WritePhyUshort(sc, 0x06, 0xd682);
7871                         MP_WritePhyUshort(sc, 0x06, 0x9802);
7872                         MP_WritePhyUshort(sc, 0x06, 0x014f);
7873                         MP_WritePhyUshort(sc, 0x06, 0xae09);
7874                         MP_WritePhyUshort(sc, 0x06, 0xbf82);
7875                         MP_WritePhyUshort(sc, 0x06, 0x98d6);
7876                         MP_WritePhyUshort(sc, 0x06, 0x82a0);
7877                         MP_WritePhyUshort(sc, 0x06, 0x0201);
7878                         MP_WritePhyUshort(sc, 0x06, 0x4fef);
7879                         MP_WritePhyUshort(sc, 0x06, 0x95fe);
7880                         MP_WritePhyUshort(sc, 0x06, 0xfdfc);
7881                         MP_WritePhyUshort(sc, 0x06, 0x05f8);
7882                         MP_WritePhyUshort(sc, 0x06, 0xf9fa);
7883                         MP_WritePhyUshort(sc, 0x06, 0xeef8);
7884                         MP_WritePhyUshort(sc, 0x06, 0xea00);
7885                         MP_WritePhyUshort(sc, 0x06, 0xeef8);
7886                         MP_WritePhyUshort(sc, 0x06, 0xeb00);
7887                         MP_WritePhyUshort(sc, 0x06, 0xe2f8);
7888                         MP_WritePhyUshort(sc, 0x06, 0x7ce3);
7889                         MP_WritePhyUshort(sc, 0x06, 0xf87d);
7890                         MP_WritePhyUshort(sc, 0x06, 0xa511);
7891                         MP_WritePhyUshort(sc, 0x06, 0x1112);
7892                         MP_WritePhyUshort(sc, 0x06, 0xd240);
7893                         MP_WritePhyUshort(sc, 0x06, 0xd644);
7894                         MP_WritePhyUshort(sc, 0x06, 0x4402);
7895                         MP_WritePhyUshort(sc, 0x06, 0x8217);
7896                         MP_WritePhyUshort(sc, 0x06, 0xd2a0);
7897                         MP_WritePhyUshort(sc, 0x06, 0xd6aa);
7898                         MP_WritePhyUshort(sc, 0x06, 0xaa02);
7899                         MP_WritePhyUshort(sc, 0x06, 0x8217);
7900                         MP_WritePhyUshort(sc, 0x06, 0xae0f);
7901                         MP_WritePhyUshort(sc, 0x06, 0xa544);
7902                         MP_WritePhyUshort(sc, 0x06, 0x4402);
7903                         MP_WritePhyUshort(sc, 0x06, 0xae4d);
7904                         MP_WritePhyUshort(sc, 0x06, 0xa5aa);
7905                         MP_WritePhyUshort(sc, 0x06, 0xaa02);
7906                         MP_WritePhyUshort(sc, 0x06, 0xae47);
7907                         MP_WritePhyUshort(sc, 0x06, 0xaf82);
7908                         MP_WritePhyUshort(sc, 0x06, 0x13ee);
7909                         MP_WritePhyUshort(sc, 0x06, 0x834e);
7910                         MP_WritePhyUshort(sc, 0x06, 0x00ee);
7911                         MP_WritePhyUshort(sc, 0x06, 0x834d);
7912                         MP_WritePhyUshort(sc, 0x06, 0x0fee);
7913                         MP_WritePhyUshort(sc, 0x06, 0x834c);
7914                         MP_WritePhyUshort(sc, 0x06, 0x0fee);
7915                         MP_WritePhyUshort(sc, 0x06, 0x834f);
7916                         MP_WritePhyUshort(sc, 0x06, 0x00ee);
7917                         MP_WritePhyUshort(sc, 0x06, 0x8351);
7918                         MP_WritePhyUshort(sc, 0x06, 0x00ee);
7919                         MP_WritePhyUshort(sc, 0x06, 0x834a);
7920                         MP_WritePhyUshort(sc, 0x06, 0xffee);
7921                         MP_WritePhyUshort(sc, 0x06, 0x834b);
7922                         MP_WritePhyUshort(sc, 0x06, 0xffe0);
7923                         MP_WritePhyUshort(sc, 0x06, 0x8330);
7924                         MP_WritePhyUshort(sc, 0x06, 0xe183);
7925                         MP_WritePhyUshort(sc, 0x06, 0x3158);
7926                         MP_WritePhyUshort(sc, 0x06, 0xfee4);
7927                         MP_WritePhyUshort(sc, 0x06, 0xf88a);
7928                         MP_WritePhyUshort(sc, 0x06, 0xe5f8);
7929                         MP_WritePhyUshort(sc, 0x06, 0x8be0);
7930                         MP_WritePhyUshort(sc, 0x06, 0x8332);
7931                         MP_WritePhyUshort(sc, 0x06, 0xe183);
7932                         MP_WritePhyUshort(sc, 0x06, 0x3359);
7933                         MP_WritePhyUshort(sc, 0x06, 0x0fe2);
7934                         MP_WritePhyUshort(sc, 0x06, 0x834d);
7935                         MP_WritePhyUshort(sc, 0x06, 0x0c24);
7936                         MP_WritePhyUshort(sc, 0x06, 0x5af0);
7937                         MP_WritePhyUshort(sc, 0x06, 0x1e12);
7938                         MP_WritePhyUshort(sc, 0x06, 0xe4f8);
7939                         MP_WritePhyUshort(sc, 0x06, 0x8ce5);
7940                         MP_WritePhyUshort(sc, 0x06, 0xf88d);
7941                         MP_WritePhyUshort(sc, 0x06, 0xaf82);
7942                         MP_WritePhyUshort(sc, 0x06, 0x13e0);
7943                         MP_WritePhyUshort(sc, 0x06, 0x834f);
7944                         MP_WritePhyUshort(sc, 0x06, 0x10e4);
7945                         MP_WritePhyUshort(sc, 0x06, 0x834f);
7946                         MP_WritePhyUshort(sc, 0x06, 0xe083);
7947                         MP_WritePhyUshort(sc, 0x06, 0x4e78);
7948                         MP_WritePhyUshort(sc, 0x06, 0x009f);
7949                         MP_WritePhyUshort(sc, 0x06, 0x0ae0);
7950                         MP_WritePhyUshort(sc, 0x06, 0x834f);
7951                         MP_WritePhyUshort(sc, 0x06, 0xa010);
7952                         MP_WritePhyUshort(sc, 0x06, 0xa5ee);
7953                         MP_WritePhyUshort(sc, 0x06, 0x834e);
7954                         MP_WritePhyUshort(sc, 0x06, 0x01e0);
7955                         MP_WritePhyUshort(sc, 0x06, 0x834e);
7956                         MP_WritePhyUshort(sc, 0x06, 0x7805);
7957                         MP_WritePhyUshort(sc, 0x06, 0x9e9a);
7958                         MP_WritePhyUshort(sc, 0x06, 0xe083);
7959                         MP_WritePhyUshort(sc, 0x06, 0x4e78);
7960                         MP_WritePhyUshort(sc, 0x06, 0x049e);
7961                         MP_WritePhyUshort(sc, 0x06, 0x10e0);
7962                         MP_WritePhyUshort(sc, 0x06, 0x834e);
7963                         MP_WritePhyUshort(sc, 0x06, 0x7803);
7964                         MP_WritePhyUshort(sc, 0x06, 0x9e0f);
7965                         MP_WritePhyUshort(sc, 0x06, 0xe083);
7966                         MP_WritePhyUshort(sc, 0x06, 0x4e78);
7967                         MP_WritePhyUshort(sc, 0x06, 0x019e);
7968                         MP_WritePhyUshort(sc, 0x06, 0x05ae);
7969                         MP_WritePhyUshort(sc, 0x06, 0x0caf);
7970                         MP_WritePhyUshort(sc, 0x06, 0x81f8);
7971                         MP_WritePhyUshort(sc, 0x06, 0xaf81);
7972                         MP_WritePhyUshort(sc, 0x06, 0xa3af);
7973                         MP_WritePhyUshort(sc, 0x06, 0x81dc);
7974                         MP_WritePhyUshort(sc, 0x06, 0xaf82);
7975                         MP_WritePhyUshort(sc, 0x06, 0x13ee);
7976                         MP_WritePhyUshort(sc, 0x06, 0x8348);
7977                         MP_WritePhyUshort(sc, 0x06, 0x00ee);
7978                         MP_WritePhyUshort(sc, 0x06, 0x8349);
7979                         MP_WritePhyUshort(sc, 0x06, 0x00e0);
7980                         MP_WritePhyUshort(sc, 0x06, 0x8351);
7981                         MP_WritePhyUshort(sc, 0x06, 0x10e4);
7982                         MP_WritePhyUshort(sc, 0x06, 0x8351);
7983                         MP_WritePhyUshort(sc, 0x06, 0x5801);
7984                         MP_WritePhyUshort(sc, 0x06, 0x9fea);
7985                         MP_WritePhyUshort(sc, 0x06, 0xd000);
7986                         MP_WritePhyUshort(sc, 0x06, 0xd180);
7987                         MP_WritePhyUshort(sc, 0x06, 0x1f66);
7988                         MP_WritePhyUshort(sc, 0x06, 0xe2f8);
7989                         MP_WritePhyUshort(sc, 0x06, 0xeae3);
7990                         MP_WritePhyUshort(sc, 0x06, 0xf8eb);
7991                         MP_WritePhyUshort(sc, 0x06, 0x5af8);
7992                         MP_WritePhyUshort(sc, 0x06, 0x1e20);
7993                         MP_WritePhyUshort(sc, 0x06, 0xe6f8);
7994                         MP_WritePhyUshort(sc, 0x06, 0xeae5);
7995                         MP_WritePhyUshort(sc, 0x06, 0xf8eb);
7996                         MP_WritePhyUshort(sc, 0x06, 0xd302);
7997                         MP_WritePhyUshort(sc, 0x06, 0xb3fe);
7998                         MP_WritePhyUshort(sc, 0x06, 0xe2f8);
7999                         MP_WritePhyUshort(sc, 0x06, 0x7cef);
8000                         MP_WritePhyUshort(sc, 0x06, 0x325b);
8001                         MP_WritePhyUshort(sc, 0x06, 0x80e3);
8002                         MP_WritePhyUshort(sc, 0x06, 0xf87d);
8003                         MP_WritePhyUshort(sc, 0x06, 0x9e03);
8004                         MP_WritePhyUshort(sc, 0x06, 0x7dff);
8005                         MP_WritePhyUshort(sc, 0x06, 0xff0d);
8006                         MP_WritePhyUshort(sc, 0x06, 0x581c);
8007                         MP_WritePhyUshort(sc, 0x06, 0x551a);
8008                         MP_WritePhyUshort(sc, 0x06, 0x6511);
8009                         MP_WritePhyUshort(sc, 0x06, 0xa190);
8010                         MP_WritePhyUshort(sc, 0x06, 0xd3e2);
8011                         MP_WritePhyUshort(sc, 0x06, 0x8348);
8012                         MP_WritePhyUshort(sc, 0x06, 0xe383);
8013                         MP_WritePhyUshort(sc, 0x06, 0x491b);
8014                         MP_WritePhyUshort(sc, 0x06, 0x56ab);
8015                         MP_WritePhyUshort(sc, 0x06, 0x08ef);
8016                         MP_WritePhyUshort(sc, 0x06, 0x56e6);
8017                         MP_WritePhyUshort(sc, 0x06, 0x8348);
8018                         MP_WritePhyUshort(sc, 0x06, 0xe783);
8019                         MP_WritePhyUshort(sc, 0x06, 0x4910);
8020                         MP_WritePhyUshort(sc, 0x06, 0xd180);
8021                         MP_WritePhyUshort(sc, 0x06, 0x1f66);
8022                         MP_WritePhyUshort(sc, 0x06, 0xa004);
8023                         MP_WritePhyUshort(sc, 0x06, 0xb9e2);
8024                         MP_WritePhyUshort(sc, 0x06, 0x8348);
8025                         MP_WritePhyUshort(sc, 0x06, 0xe383);
8026                         MP_WritePhyUshort(sc, 0x06, 0x49ef);
8027                         MP_WritePhyUshort(sc, 0x06, 0x65e2);
8028                         MP_WritePhyUshort(sc, 0x06, 0x834a);
8029                         MP_WritePhyUshort(sc, 0x06, 0xe383);
8030                         MP_WritePhyUshort(sc, 0x06, 0x4b1b);
8031                         MP_WritePhyUshort(sc, 0x06, 0x56aa);
8032                         MP_WritePhyUshort(sc, 0x06, 0x0eef);
8033                         MP_WritePhyUshort(sc, 0x06, 0x56e6);
8034                         MP_WritePhyUshort(sc, 0x06, 0x834a);
8035                         MP_WritePhyUshort(sc, 0x06, 0xe783);
8036                         MP_WritePhyUshort(sc, 0x06, 0x4be2);
8037                         MP_WritePhyUshort(sc, 0x06, 0x834d);
8038                         MP_WritePhyUshort(sc, 0x06, 0xe683);
8039                         MP_WritePhyUshort(sc, 0x06, 0x4ce0);
8040                         MP_WritePhyUshort(sc, 0x06, 0x834d);
8041                         MP_WritePhyUshort(sc, 0x06, 0xa000);
8042                         MP_WritePhyUshort(sc, 0x06, 0x0caf);
8043                         MP_WritePhyUshort(sc, 0x06, 0x81dc);
8044                         MP_WritePhyUshort(sc, 0x06, 0xe083);
8045                         MP_WritePhyUshort(sc, 0x06, 0x4d10);
8046                         MP_WritePhyUshort(sc, 0x06, 0xe483);
8047                         MP_WritePhyUshort(sc, 0x06, 0x4dae);
8048                         MP_WritePhyUshort(sc, 0x06, 0x0480);
8049                         MP_WritePhyUshort(sc, 0x06, 0xe483);
8050                         MP_WritePhyUshort(sc, 0x06, 0x4de0);
8051                         MP_WritePhyUshort(sc, 0x06, 0x834e);
8052                         MP_WritePhyUshort(sc, 0x06, 0x7803);
8053                         MP_WritePhyUshort(sc, 0x06, 0x9e0b);
8054                         MP_WritePhyUshort(sc, 0x06, 0xe083);
8055                         MP_WritePhyUshort(sc, 0x06, 0x4e78);
8056                         MP_WritePhyUshort(sc, 0x06, 0x049e);
8057                         MP_WritePhyUshort(sc, 0x06, 0x04ee);
8058                         MP_WritePhyUshort(sc, 0x06, 0x834e);
8059                         MP_WritePhyUshort(sc, 0x06, 0x02e0);
8060                         MP_WritePhyUshort(sc, 0x06, 0x8332);
8061                         MP_WritePhyUshort(sc, 0x06, 0xe183);
8062                         MP_WritePhyUshort(sc, 0x06, 0x3359);
8063                         MP_WritePhyUshort(sc, 0x06, 0x0fe2);
8064                         MP_WritePhyUshort(sc, 0x06, 0x834d);
8065                         MP_WritePhyUshort(sc, 0x06, 0x0c24);
8066                         MP_WritePhyUshort(sc, 0x06, 0x5af0);
8067                         MP_WritePhyUshort(sc, 0x06, 0x1e12);
8068                         MP_WritePhyUshort(sc, 0x06, 0xe4f8);
8069                         MP_WritePhyUshort(sc, 0x06, 0x8ce5);
8070                         MP_WritePhyUshort(sc, 0x06, 0xf88d);
8071                         MP_WritePhyUshort(sc, 0x06, 0xe083);
8072                         MP_WritePhyUshort(sc, 0x06, 0x30e1);
8073                         MP_WritePhyUshort(sc, 0x06, 0x8331);
8074                         MP_WritePhyUshort(sc, 0x06, 0x6801);
8075                         MP_WritePhyUshort(sc, 0x06, 0xe4f8);
8076                         MP_WritePhyUshort(sc, 0x06, 0x8ae5);
8077                         MP_WritePhyUshort(sc, 0x06, 0xf88b);
8078                         MP_WritePhyUshort(sc, 0x06, 0xae37);
8079                         MP_WritePhyUshort(sc, 0x06, 0xee83);
8080                         MP_WritePhyUshort(sc, 0x06, 0x4e03);
8081                         MP_WritePhyUshort(sc, 0x06, 0xe083);
8082                         MP_WritePhyUshort(sc, 0x06, 0x4ce1);
8083                         MP_WritePhyUshort(sc, 0x06, 0x834d);
8084                         MP_WritePhyUshort(sc, 0x06, 0x1b01);
8085                         MP_WritePhyUshort(sc, 0x06, 0x9e04);
8086                         MP_WritePhyUshort(sc, 0x06, 0xaaa1);
8087                         MP_WritePhyUshort(sc, 0x06, 0xaea8);
8088                         MP_WritePhyUshort(sc, 0x06, 0xee83);
8089                         MP_WritePhyUshort(sc, 0x06, 0x4e04);
8090                         MP_WritePhyUshort(sc, 0x06, 0xee83);
8091                         MP_WritePhyUshort(sc, 0x06, 0x4f00);
8092                         MP_WritePhyUshort(sc, 0x06, 0xaeab);
8093                         MP_WritePhyUshort(sc, 0x06, 0xe083);
8094                         MP_WritePhyUshort(sc, 0x06, 0x4f78);
8095                         MP_WritePhyUshort(sc, 0x06, 0x039f);
8096                         MP_WritePhyUshort(sc, 0x06, 0x14ee);
8097                         MP_WritePhyUshort(sc, 0x06, 0x834e);
8098                         MP_WritePhyUshort(sc, 0x06, 0x05d2);
8099                         MP_WritePhyUshort(sc, 0x06, 0x40d6);
8100                         MP_WritePhyUshort(sc, 0x06, 0x5554);
8101                         MP_WritePhyUshort(sc, 0x06, 0x0282);
8102                         MP_WritePhyUshort(sc, 0x06, 0x17d2);
8103                         MP_WritePhyUshort(sc, 0x06, 0xa0d6);
8104                         MP_WritePhyUshort(sc, 0x06, 0xba00);
8105                         MP_WritePhyUshort(sc, 0x06, 0x0282);
8106                         MP_WritePhyUshort(sc, 0x06, 0x17fe);
8107                         MP_WritePhyUshort(sc, 0x06, 0xfdfc);
8108                         MP_WritePhyUshort(sc, 0x06, 0x05f8);
8109                         MP_WritePhyUshort(sc, 0x06, 0xe0f8);
8110                         MP_WritePhyUshort(sc, 0x06, 0x60e1);
8111                         MP_WritePhyUshort(sc, 0x06, 0xf861);
8112                         MP_WritePhyUshort(sc, 0x06, 0x6802);
8113                         MP_WritePhyUshort(sc, 0x06, 0xe4f8);
8114                         MP_WritePhyUshort(sc, 0x06, 0x60e5);
8115                         MP_WritePhyUshort(sc, 0x06, 0xf861);
8116                         MP_WritePhyUshort(sc, 0x06, 0xe0f8);
8117                         MP_WritePhyUshort(sc, 0x06, 0x48e1);
8118                         MP_WritePhyUshort(sc, 0x06, 0xf849);
8119                         MP_WritePhyUshort(sc, 0x06, 0x580f);
8120                         MP_WritePhyUshort(sc, 0x06, 0x1e02);
8121                         MP_WritePhyUshort(sc, 0x06, 0xe4f8);
8122                         MP_WritePhyUshort(sc, 0x06, 0x48e5);
8123                         MP_WritePhyUshort(sc, 0x06, 0xf849);
8124                         MP_WritePhyUshort(sc, 0x06, 0xd000);
8125                         MP_WritePhyUshort(sc, 0x06, 0x0282);
8126                         MP_WritePhyUshort(sc, 0x06, 0x5bbf);
8127                         MP_WritePhyUshort(sc, 0x06, 0x8350);
8128                         MP_WritePhyUshort(sc, 0x06, 0xef46);
8129                         MP_WritePhyUshort(sc, 0x06, 0xdc19);
8130                         MP_WritePhyUshort(sc, 0x06, 0xddd0);
8131                         MP_WritePhyUshort(sc, 0x06, 0x0102);
8132                         MP_WritePhyUshort(sc, 0x06, 0x825b);
8133                         MP_WritePhyUshort(sc, 0x06, 0x0282);
8134                         MP_WritePhyUshort(sc, 0x06, 0x77e0);
8135                         MP_WritePhyUshort(sc, 0x06, 0xf860);
8136                         MP_WritePhyUshort(sc, 0x06, 0xe1f8);
8137                         MP_WritePhyUshort(sc, 0x06, 0x6158);
8138                         MP_WritePhyUshort(sc, 0x06, 0xfde4);
8139                         MP_WritePhyUshort(sc, 0x06, 0xf860);
8140                         MP_WritePhyUshort(sc, 0x06, 0xe5f8);
8141                         MP_WritePhyUshort(sc, 0x06, 0x61fc);
8142                         MP_WritePhyUshort(sc, 0x06, 0x04f9);
8143                         MP_WritePhyUshort(sc, 0x06, 0xfafb);
8144                         MP_WritePhyUshort(sc, 0x06, 0xc6bf);
8145                         MP_WritePhyUshort(sc, 0x06, 0xf840);
8146                         MP_WritePhyUshort(sc, 0x06, 0xbe83);
8147                         MP_WritePhyUshort(sc, 0x06, 0x50a0);
8148                         MP_WritePhyUshort(sc, 0x06, 0x0101);
8149                         MP_WritePhyUshort(sc, 0x06, 0x071b);
8150                         MP_WritePhyUshort(sc, 0x06, 0x89cf);
8151                         MP_WritePhyUshort(sc, 0x06, 0xd208);
8152                         MP_WritePhyUshort(sc, 0x06, 0xebdb);
8153                         MP_WritePhyUshort(sc, 0x06, 0x19b2);
8154                         MP_WritePhyUshort(sc, 0x06, 0xfbff);
8155                         MP_WritePhyUshort(sc, 0x06, 0xfefd);
8156                         MP_WritePhyUshort(sc, 0x06, 0x04f8);
8157                         MP_WritePhyUshort(sc, 0x06, 0xe0f8);
8158                         MP_WritePhyUshort(sc, 0x06, 0x48e1);
8159                         MP_WritePhyUshort(sc, 0x06, 0xf849);
8160                         MP_WritePhyUshort(sc, 0x06, 0x6808);
8161                         MP_WritePhyUshort(sc, 0x06, 0xe4f8);
8162                         MP_WritePhyUshort(sc, 0x06, 0x48e5);
8163                         MP_WritePhyUshort(sc, 0x06, 0xf849);
8164                         MP_WritePhyUshort(sc, 0x06, 0x58f7);
8165                         MP_WritePhyUshort(sc, 0x06, 0xe4f8);
8166                         MP_WritePhyUshort(sc, 0x06, 0x48e5);
8167                         MP_WritePhyUshort(sc, 0x06, 0xf849);
8168                         MP_WritePhyUshort(sc, 0x06, 0xfc04);
8169                         MP_WritePhyUshort(sc, 0x06, 0x4d20);
8170                         MP_WritePhyUshort(sc, 0x06, 0x0002);
8171                         MP_WritePhyUshort(sc, 0x06, 0x4e22);
8172                         MP_WritePhyUshort(sc, 0x06, 0x0002);
8173                         MP_WritePhyUshort(sc, 0x06, 0x4ddf);
8174                         MP_WritePhyUshort(sc, 0x06, 0xff01);
8175                         MP_WritePhyUshort(sc, 0x06, 0x4edd);
8176                         MP_WritePhyUshort(sc, 0x06, 0xff01);
8177                         MP_WritePhyUshort(sc, 0x06, 0xf8fa);
8178                         MP_WritePhyUshort(sc, 0x06, 0xfbef);
8179                         MP_WritePhyUshort(sc, 0x06, 0x79bf);
8180                         MP_WritePhyUshort(sc, 0x06, 0xf822);
8181                         MP_WritePhyUshort(sc, 0x06, 0xd819);
8182                         MP_WritePhyUshort(sc, 0x06, 0xd958);
8183                         MP_WritePhyUshort(sc, 0x06, 0x849f);
8184                         MP_WritePhyUshort(sc, 0x06, 0x09bf);
8185                         MP_WritePhyUshort(sc, 0x06, 0x82be);
8186                         MP_WritePhyUshort(sc, 0x06, 0xd682);
8187                         MP_WritePhyUshort(sc, 0x06, 0xc602);
8188                         MP_WritePhyUshort(sc, 0x06, 0x014f);
8189                         MP_WritePhyUshort(sc, 0x06, 0xef97);
8190                         MP_WritePhyUshort(sc, 0x06, 0xfffe);
8191                         MP_WritePhyUshort(sc, 0x06, 0xfc05);
8192                         MP_WritePhyUshort(sc, 0x06, 0x17ff);
8193                         MP_WritePhyUshort(sc, 0x06, 0xfe01);
8194                         MP_WritePhyUshort(sc, 0x06, 0x1700);
8195                         MP_WritePhyUshort(sc, 0x06, 0x0102);
8196                         MP_WritePhyUshort(sc, 0x05, 0x83d8);
8197                         MP_WritePhyUshort(sc, 0x06, 0x8051);
8198                         MP_WritePhyUshort(sc, 0x05, 0x83d6);
8199                         MP_WritePhyUshort(sc, 0x06, 0x82a0);
8200                         MP_WritePhyUshort(sc, 0x05, 0x83d4);
8201                         MP_WritePhyUshort(sc, 0x06, 0x8000);
8202                         MP_WritePhyUshort(sc, 0x02, 0x2010);
8203                         MP_WritePhyUshort(sc, 0x03, 0xdc00);
8204                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
8205                         MP_WritePhyUshort(sc, 0x0b, 0x0600);
8206                         MP_WritePhyUshort(sc, 0x1f, 0x0005);
8207                         MP_WritePhyUshort(sc, 0x05, 0xfff6);
8208                         MP_WritePhyUshort(sc, 0x06, 0x00fc);
8209                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
8210                 }
8211
8212                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8213                 MP_WritePhyUshort(sc, 0x0D, 0xF880);
8214                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8215         } else if (sc->re_type == MACFG_32) {
8216                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
8217                 MP_WritePhyUshort(sc, 0x06, 0x4064);
8218                 MP_WritePhyUshort(sc, 0x07, 0x2863);
8219                 MP_WritePhyUshort(sc, 0x08, 0x059C);
8220                 MP_WritePhyUshort(sc, 0x09, 0x26B4);
8221                 MP_WritePhyUshort(sc, 0x0A, 0x6A19);
8222                 MP_WritePhyUshort(sc, 0x0B, 0xBCC0);
8223                 MP_WritePhyUshort(sc, 0x10, 0xF06D);
8224                 MP_WritePhyUshort(sc, 0x14, 0x7F68);
8225                 MP_WritePhyUshort(sc, 0x18, 0x7FD9);
8226                 MP_WritePhyUshort(sc, 0x1C, 0xF0FF);
8227                 MP_WritePhyUshort(sc, 0x1D, 0x3D9C);
8228                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
8229                 MP_WritePhyUshort(sc, 0x12, 0xF49F);
8230                 MP_WritePhyUshort(sc, 0x13, 0x070B);
8231                 MP_WritePhyUshort(sc, 0x1A, 0x05AD);
8232                 MP_WritePhyUshort(sc, 0x14, 0x94C0);
8233
8234                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
8235                 MP_WritePhyUshort(sc, 0x06, 0x5571);
8236
8237                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
8238                 MP_WritePhyUshort(sc, 0x05, 0x2642);
8239
8240                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
8241                 MP_WritePhyUshort(sc, 0x02, 0xC107);
8242                 MP_WritePhyUshort(sc, 0x03, 0x1002);
8243
8244                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
8245                 MP_WritePhyUshort(sc, 0x16, 0x0CC0);
8246
8247                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
8248                 MP_WritePhyUshort(sc, 0x0F, 0x0017);
8249
8250                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
8251                 MP_WritePhyUshort(sc, 0x05, 0x8200);
8252                 MP_WritePhyUshort(sc, 0x06, 0xF8F9);
8253                 MP_WritePhyUshort(sc, 0x06, 0xFAEF);
8254                 MP_WritePhyUshort(sc, 0x06, 0x59EE);
8255                 MP_WritePhyUshort(sc, 0x06, 0xF8EA);
8256                 MP_WritePhyUshort(sc, 0x06, 0x00EE);
8257                 MP_WritePhyUshort(sc, 0x06, 0xF8EB);
8258                 MP_WritePhyUshort(sc, 0x06, 0x00E0);
8259                 MP_WritePhyUshort(sc, 0x06, 0xF87C);
8260                 MP_WritePhyUshort(sc, 0x06, 0xE1F8);
8261                 MP_WritePhyUshort(sc, 0x06, 0x7D59);
8262                 MP_WritePhyUshort(sc, 0x06, 0x0FEF);
8263                 MP_WritePhyUshort(sc, 0x06, 0x0139);
8264                 MP_WritePhyUshort(sc, 0x06, 0x029E);
8265                 MP_WritePhyUshort(sc, 0x06, 0x06EF);
8266                 MP_WritePhyUshort(sc, 0x06, 0x1039);
8267                 MP_WritePhyUshort(sc, 0x06, 0x089F);
8268                 MP_WritePhyUshort(sc, 0x06, 0x2AEE);
8269                 MP_WritePhyUshort(sc, 0x06, 0xF8EA);
8270                 MP_WritePhyUshort(sc, 0x06, 0x00EE);
8271                 MP_WritePhyUshort(sc, 0x06, 0xF8EB);
8272                 MP_WritePhyUshort(sc, 0x06, 0x01E0);
8273                 MP_WritePhyUshort(sc, 0x06, 0xF87C);
8274                 MP_WritePhyUshort(sc, 0x06, 0xE1F8);
8275                 MP_WritePhyUshort(sc, 0x06, 0x7D58);
8276                 MP_WritePhyUshort(sc, 0x06, 0x409E);
8277                 MP_WritePhyUshort(sc, 0x06, 0x0F39);
8278                 MP_WritePhyUshort(sc, 0x06, 0x46AA);
8279                 MP_WritePhyUshort(sc, 0x06, 0x0BBF);
8280                 MP_WritePhyUshort(sc, 0x06, 0x8251);
8281                 MP_WritePhyUshort(sc, 0x06, 0xD682);
8282                 MP_WritePhyUshort(sc, 0x06, 0x5902);
8283                 MP_WritePhyUshort(sc, 0x06, 0x014F);
8284                 MP_WritePhyUshort(sc, 0x06, 0xAE09);
8285                 MP_WritePhyUshort(sc, 0x06, 0xBF82);
8286                 MP_WritePhyUshort(sc, 0x06, 0x59D6);
8287                 MP_WritePhyUshort(sc, 0x06, 0x8261);
8288                 MP_WritePhyUshort(sc, 0x06, 0x0201);
8289                 MP_WritePhyUshort(sc, 0x06, 0x4FEF);
8290                 MP_WritePhyUshort(sc, 0x06, 0x95FE);
8291                 MP_WritePhyUshort(sc, 0x06, 0xFDFC);
8292                 MP_WritePhyUshort(sc, 0x06, 0x054D);
8293                 MP_WritePhyUshort(sc, 0x06, 0x2000);
8294                 MP_WritePhyUshort(sc, 0x06, 0x024E);
8295                 MP_WritePhyUshort(sc, 0x06, 0x2200);
8296                 MP_WritePhyUshort(sc, 0x06, 0x024D);
8297                 MP_WritePhyUshort(sc, 0x06, 0xDFFF);
8298                 MP_WritePhyUshort(sc, 0x06, 0x014E);
8299                 MP_WritePhyUshort(sc, 0x06, 0xDDFF);
8300                 MP_WritePhyUshort(sc, 0x06, 0x0100);
8301                 MP_WritePhyUshort(sc, 0x02, 0x6010);
8302                 MP_WritePhyUshort(sc, 0x05, 0xFFF6);
8303                 MP_WritePhyUshort(sc, 0x06, 0x00EC);
8304                 MP_WritePhyUshort(sc, 0x05, 0x83D4);
8305                 MP_WritePhyUshort(sc, 0x06, 0x8200);
8306
8307         } else if (sc->re_type == MACFG_33) {
8308                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
8309                 MP_WritePhyUshort(sc, 0x06, 0x4064);
8310                 MP_WritePhyUshort(sc, 0x07, 0x2863);
8311                 MP_WritePhyUshort(sc, 0x08, 0x059C);
8312                 MP_WritePhyUshort(sc, 0x09, 0x26B4);
8313                 MP_WritePhyUshort(sc, 0x0A, 0x6A19);
8314                 MP_WritePhyUshort(sc, 0x0B, 0xDCC8);
8315                 MP_WritePhyUshort(sc, 0x10, 0xF06D);
8316                 MP_WritePhyUshort(sc, 0x14, 0x7F68);
8317                 MP_WritePhyUshort(sc, 0x18, 0x7FD9);
8318                 MP_WritePhyUshort(sc, 0x1C, 0xF0FF);
8319                 MP_WritePhyUshort(sc, 0x1D, 0x3D9C);
8320                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
8321                 MP_WritePhyUshort(sc, 0x12, 0xF49F);
8322                 MP_WritePhyUshort(sc, 0x13, 0x070B);
8323                 MP_WritePhyUshort(sc, 0x1A, 0x05AD);
8324                 MP_WritePhyUshort(sc, 0x14, 0x94C0);
8325
8326                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
8327                 MP_WritePhyUshort(sc, 0x06, 0x5561);
8328                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
8329                 MP_WritePhyUshort(sc, 0x05, 0x8332);
8330                 MP_WritePhyUshort(sc, 0x06, 0x5561);
8331
8332                 if (MP_ReadEfuse(sc, 0x01) == 0xb1) {
8333                         MP_WritePhyUshort(sc, 0x1F, 0x0002);
8334                         MP_WritePhyUshort(sc, 0x05, 0x669A);
8335                         MP_WritePhyUshort(sc, 0x1F, 0x0005);
8336                         MP_WritePhyUshort(sc, 0x05, 0x8330);
8337                         MP_WritePhyUshort(sc, 0x06, 0x669A);
8338
8339                         MP_WritePhyUshort(sc, 0x1F, 0x0002);
8340                         Data = MP_ReadPhyUshort(sc, 0x0D);
8341                         if ((Data & 0x00FF) != 0x006C) {
8342                                 Data &= 0xFF00;
8343                                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
8344                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x0065);
8345                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x0066);
8346                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x0067);
8347                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x0068);
8348                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x0069);
8349                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x006A);
8350                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x006B);
8351                                 MP_WritePhyUshort(sc, 0x0D, Data | 0x006C);
8352                         }
8353                 } else {
8354                         MP_WritePhyUshort(sc, 0x1F, 0x0002);
8355                         MP_WritePhyUshort(sc, 0x05, 0x2642);
8356                         MP_WritePhyUshort(sc, 0x1F, 0x0005);
8357                         MP_WritePhyUshort(sc, 0x05, 0x8330);
8358                         MP_WritePhyUshort(sc, 0x06, 0x2642);
8359                 }
8360
8361                 if (MP_ReadEfuse(sc, 0x30) == 0x98) {
8362                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
8363                         MP_WritePhyUshort(sc, 0x11, MP_ReadPhyUshort(sc, 0x11) & ~0x02);
8364                         MP_WritePhyUshort(sc, 0x1F, 0x0005);
8365                         MP_WritePhyUshort(sc, 0x01, MP_ReadPhyUshort(sc, 0x01) | 0x200);
8366                 } else if (MP_ReadEfuse(sc, 0x30) == 0x90) {
8367                         MP_WritePhyUshort(sc, 0x1F, 0x0005);
8368                         MP_WritePhyUshort(sc, 0x01, MP_ReadPhyUshort(sc, 0x01) & ~0x200);
8369                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
8370                         MP_WritePhyUshort(sc, 0x16, 0x5101);
8371                 }
8372
8373                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
8374                 Data = MP_ReadPhyUshort(sc, 0x02);
8375                 Data &= ~0x600;
8376                 Data |= 0x100;
8377                 MP_WritePhyUshort(sc, 0x02, Data);
8378                 Data = MP_ReadPhyUshort(sc, 0x03);
8379                 Data &= ~0xE000;
8380                 MP_WritePhyUshort(sc, 0x03, Data);
8381
8382                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
8383                 MP_WritePhyUshort(sc, 0x17, 0x0CC0);
8384
8385                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
8386                 Data = MP_ReadPhyUshort(sc, 0x0F);
8387                 Data |= 0x17;
8388                 MP_WritePhyUshort(sc, 0x0F, Data);
8389
8390                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
8391                 MP_WritePhyUshort(sc, 0x05, 0x001B);
8392                 if (MP_ReadPhyUshort(sc, 0x06) == 0xB300) {
8393                         MP_WritePhyUshort(sc, 0x1f, 0x0005);
8394                         MP_WritePhyUshort(sc, 0x05, 0xfff6);
8395                         MP_WritePhyUshort(sc, 0x06, 0x0080);
8396                         MP_WritePhyUshort(sc, 0x05, 0x8000);
8397                         MP_WritePhyUshort(sc, 0x06, 0xf8f9);
8398                         MP_WritePhyUshort(sc, 0x06, 0xfaee);
8399                         MP_WritePhyUshort(sc, 0x06, 0xf8ea);
8400                         MP_WritePhyUshort(sc, 0x06, 0x00ee);
8401                         MP_WritePhyUshort(sc, 0x06, 0xf8eb);
8402                         MP_WritePhyUshort(sc, 0x06, 0x00e2);
8403                         MP_WritePhyUshort(sc, 0x06, 0xf87c);
8404                         MP_WritePhyUshort(sc, 0x06, 0xe3f8);
8405                         MP_WritePhyUshort(sc, 0x06, 0x7da5);
8406                         MP_WritePhyUshort(sc, 0x06, 0x1111);
8407                         MP_WritePhyUshort(sc, 0x06, 0x12d2);
8408                         MP_WritePhyUshort(sc, 0x06, 0x40d6);
8409                         MP_WritePhyUshort(sc, 0x06, 0x4444);
8410                         MP_WritePhyUshort(sc, 0x06, 0x0281);
8411                         MP_WritePhyUshort(sc, 0x06, 0xc6d2);
8412                         MP_WritePhyUshort(sc, 0x06, 0xa0d6);
8413                         MP_WritePhyUshort(sc, 0x06, 0xaaaa);
8414                         MP_WritePhyUshort(sc, 0x06, 0x0281);
8415                         MP_WritePhyUshort(sc, 0x06, 0xc6ae);
8416                         MP_WritePhyUshort(sc, 0x06, 0x0fa5);
8417                         MP_WritePhyUshort(sc, 0x06, 0x4444);
8418                         MP_WritePhyUshort(sc, 0x06, 0x02ae);
8419                         MP_WritePhyUshort(sc, 0x06, 0x4da5);
8420                         MP_WritePhyUshort(sc, 0x06, 0xaaaa);
8421                         MP_WritePhyUshort(sc, 0x06, 0x02ae);
8422                         MP_WritePhyUshort(sc, 0x06, 0x47af);
8423                         MP_WritePhyUshort(sc, 0x06, 0x81c2);
8424                         MP_WritePhyUshort(sc, 0x06, 0xee83);
8425                         MP_WritePhyUshort(sc, 0x06, 0x4e00);
8426                         MP_WritePhyUshort(sc, 0x06, 0xee83);
8427                         MP_WritePhyUshort(sc, 0x06, 0x4d0f);
8428                         MP_WritePhyUshort(sc, 0x06, 0xee83);
8429                         MP_WritePhyUshort(sc, 0x06, 0x4c0f);
8430                         MP_WritePhyUshort(sc, 0x06, 0xee83);
8431                         MP_WritePhyUshort(sc, 0x06, 0x4f00);
8432                         MP_WritePhyUshort(sc, 0x06, 0xee83);
8433                         MP_WritePhyUshort(sc, 0x06, 0x5100);
8434                         MP_WritePhyUshort(sc, 0x06, 0xee83);
8435                         MP_WritePhyUshort(sc, 0x06, 0x4aff);
8436                         MP_WritePhyUshort(sc, 0x06, 0xee83);
8437                         MP_WritePhyUshort(sc, 0x06, 0x4bff);
8438                         MP_WritePhyUshort(sc, 0x06, 0xe083);
8439                         MP_WritePhyUshort(sc, 0x06, 0x30e1);
8440                         MP_WritePhyUshort(sc, 0x06, 0x8331);
8441                         MP_WritePhyUshort(sc, 0x06, 0x58fe);
8442                         MP_WritePhyUshort(sc, 0x06, 0xe4f8);
8443                         MP_WritePhyUshort(sc, 0x06, 0x8ae5);
8444                         MP_WritePhyUshort(sc, 0x06, 0xf88b);
8445                         MP_WritePhyUshort(sc, 0x06, 0xe083);
8446                         MP_WritePhyUshort(sc, 0x06, 0x32e1);
8447                         MP_WritePhyUshort(sc, 0x06, 0x8333);
8448                         MP_WritePhyUshort(sc, 0x06, 0x590f);
8449                         MP_WritePhyUshort(sc, 0x06, 0xe283);
8450                         MP_WritePhyUshort(sc, 0x06, 0x4d0c);
8451                         MP_WritePhyUshort(sc, 0x06, 0x245a);
8452                         MP_WritePhyUshort(sc, 0x06, 0xf01e);
8453                         MP_WritePhyUshort(sc, 0x06, 0x12e4);
8454                         MP_WritePhyUshort(sc, 0x06, 0xf88c);
8455                         MP_WritePhyUshort(sc, 0x06, 0xe5f8);
8456                         MP_WritePhyUshort(sc, 0x06, 0x8daf);
8457                         MP_WritePhyUshort(sc, 0x06, 0x81c2);
8458                         MP_WritePhyUshort(sc, 0x06, 0xe083);
8459                         MP_WritePhyUshort(sc, 0x06, 0x4f10);
8460                         MP_WritePhyUshort(sc, 0x06, 0xe483);
8461                         MP_WritePhyUshort(sc, 0x06, 0x4fe0);
8462                         MP_WritePhyUshort(sc, 0x06, 0x834e);
8463                         MP_WritePhyUshort(sc, 0x06, 0x7800);
8464                         MP_WritePhyUshort(sc, 0x06, 0x9f0a);
8465                         MP_WritePhyUshort(sc, 0x06, 0xe083);
8466                         MP_WritePhyUshort(sc, 0x06, 0x4fa0);
8467                         MP_WritePhyUshort(sc, 0x06, 0x10a5);
8468                         MP_WritePhyUshort(sc, 0x06, 0xee83);
8469                         MP_WritePhyUshort(sc, 0x06, 0x4e01);
8470                         MP_WritePhyUshort(sc, 0x06, 0xe083);
8471                         MP_WritePhyUshort(sc, 0x06, 0x4e78);
8472                         MP_WritePhyUshort(sc, 0x06, 0x059e);
8473                         MP_WritePhyUshort(sc, 0x06, 0x9ae0);
8474                         MP_WritePhyUshort(sc, 0x06, 0x834e);
8475                         MP_WritePhyUshort(sc, 0x06, 0x7804);
8476                         MP_WritePhyUshort(sc, 0x06, 0x9e10);
8477                         MP_WritePhyUshort(sc, 0x06, 0xe083);
8478                         MP_WritePhyUshort(sc, 0x06, 0x4e78);
8479                         MP_WritePhyUshort(sc, 0x06, 0x039e);
8480                         MP_WritePhyUshort(sc, 0x06, 0x0fe0);
8481                         MP_WritePhyUshort(sc, 0x06, 0x834e);
8482                         MP_WritePhyUshort(sc, 0x06, 0x7801);
8483                         MP_WritePhyUshort(sc, 0x06, 0x9e05);
8484                         MP_WritePhyUshort(sc, 0x06, 0xae0c);
8485                         MP_WritePhyUshort(sc, 0x06, 0xaf81);
8486                         MP_WritePhyUshort(sc, 0x06, 0xa7af);
8487                         MP_WritePhyUshort(sc, 0x06, 0x8152);
8488                         MP_WritePhyUshort(sc, 0x06, 0xaf81);
8489                         MP_WritePhyUshort(sc, 0x06, 0x8baf);
8490                         MP_WritePhyUshort(sc, 0x06, 0x81c2);
8491                         MP_WritePhyUshort(sc, 0x06, 0xee83);
8492                         MP_WritePhyUshort(sc, 0x06, 0x4800);
8493                         MP_WritePhyUshort(sc, 0x06, 0xee83);
8494                         MP_WritePhyUshort(sc, 0x06, 0x4900);
8495                         MP_WritePhyUshort(sc, 0x06, 0xe083);
8496                         MP_WritePhyUshort(sc, 0x06, 0x5110);
8497                         MP_WritePhyUshort(sc, 0x06, 0xe483);
8498                         MP_WritePhyUshort(sc, 0x06, 0x5158);
8499                         MP_WritePhyUshort(sc, 0x06, 0x019f);
8500                         MP_WritePhyUshort(sc, 0x06, 0xead0);
8501                         MP_WritePhyUshort(sc, 0x06, 0x00d1);
8502                         MP_WritePhyUshort(sc, 0x06, 0x801f);
8503                         MP_WritePhyUshort(sc, 0x06, 0x66e2);
8504                         MP_WritePhyUshort(sc, 0x06, 0xf8ea);
8505                         MP_WritePhyUshort(sc, 0x06, 0xe3f8);
8506                         MP_WritePhyUshort(sc, 0x06, 0xeb5a);
8507                         MP_WritePhyUshort(sc, 0x06, 0xf81e);
8508                         MP_WritePhyUshort(sc, 0x06, 0x20e6);
8509                         MP_WritePhyUshort(sc, 0x06, 0xf8ea);
8510                         MP_WritePhyUshort(sc, 0x06, 0xe5f8);
8511                         MP_WritePhyUshort(sc, 0x06, 0xebd3);
8512                         MP_WritePhyUshort(sc, 0x06, 0x02b3);
8513                         MP_WritePhyUshort(sc, 0x06, 0xfee2);
8514                         MP_WritePhyUshort(sc, 0x06, 0xf87c);
8515                         MP_WritePhyUshort(sc, 0x06, 0xef32);
8516                         MP_WritePhyUshort(sc, 0x06, 0x5b80);
8517                         MP_WritePhyUshort(sc, 0x06, 0xe3f8);
8518                         MP_WritePhyUshort(sc, 0x06, 0x7d9e);
8519                         MP_WritePhyUshort(sc, 0x06, 0x037d);
8520                         MP_WritePhyUshort(sc, 0x06, 0xffff);
8521                         MP_WritePhyUshort(sc, 0x06, 0x0d58);
8522                         MP_WritePhyUshort(sc, 0x06, 0x1c55);
8523                         MP_WritePhyUshort(sc, 0x06, 0x1a65);
8524                         MP_WritePhyUshort(sc, 0x06, 0x11a1);
8525                         MP_WritePhyUshort(sc, 0x06, 0x90d3);
8526                         MP_WritePhyUshort(sc, 0x06, 0xe283);
8527                         MP_WritePhyUshort(sc, 0x06, 0x48e3);
8528                         MP_WritePhyUshort(sc, 0x06, 0x8349);
8529                         MP_WritePhyUshort(sc, 0x06, 0x1b56);
8530                         MP_WritePhyUshort(sc, 0x06, 0xab08);
8531                         MP_WritePhyUshort(sc, 0x06, 0xef56);
8532                         MP_WritePhyUshort(sc, 0x06, 0xe683);
8533                         MP_WritePhyUshort(sc, 0x06, 0x48e7);
8534                         MP_WritePhyUshort(sc, 0x06, 0x8349);
8535                         MP_WritePhyUshort(sc, 0x06, 0x10d1);
8536                         MP_WritePhyUshort(sc, 0x06, 0x801f);
8537                         MP_WritePhyUshort(sc, 0x06, 0x66a0);
8538                         MP_WritePhyUshort(sc, 0x06, 0x04b9);
8539                         MP_WritePhyUshort(sc, 0x06, 0xe283);
8540                         MP_WritePhyUshort(sc, 0x06, 0x48e3);
8541                         MP_WritePhyUshort(sc, 0x06, 0x8349);
8542                         MP_WritePhyUshort(sc, 0x06, 0xef65);
8543                         MP_WritePhyUshort(sc, 0x06, 0xe283);
8544                         MP_WritePhyUshort(sc, 0x06, 0x4ae3);
8545                         MP_WritePhyUshort(sc, 0x06, 0x834b);
8546                         MP_WritePhyUshort(sc, 0x06, 0x1b56);
8547                         MP_WritePhyUshort(sc, 0x06, 0xaa0e);
8548                         MP_WritePhyUshort(sc, 0x06, 0xef56);
8549                         MP_WritePhyUshort(sc, 0x06, 0xe683);
8550                         MP_WritePhyUshort(sc, 0x06, 0x4ae7);
8551                         MP_WritePhyUshort(sc, 0x06, 0x834b);
8552                         MP_WritePhyUshort(sc, 0x06, 0xe283);
8553                         MP_WritePhyUshort(sc, 0x06, 0x4de6);
8554                         MP_WritePhyUshort(sc, 0x06, 0x834c);
8555                         MP_WritePhyUshort(sc, 0x06, 0xe083);
8556                         MP_WritePhyUshort(sc, 0x06, 0x4da0);
8557                         MP_WritePhyUshort(sc, 0x06, 0x000c);
8558                         MP_WritePhyUshort(sc, 0x06, 0xaf81);
8559                         MP_WritePhyUshort(sc, 0x06, 0x8be0);
8560                         MP_WritePhyUshort(sc, 0x06, 0x834d);
8561                         MP_WritePhyUshort(sc, 0x06, 0x10e4);
8562                         MP_WritePhyUshort(sc, 0x06, 0x834d);
8563                         MP_WritePhyUshort(sc, 0x06, 0xae04);
8564                         MP_WritePhyUshort(sc, 0x06, 0x80e4);
8565                         MP_WritePhyUshort(sc, 0x06, 0x834d);
8566                         MP_WritePhyUshort(sc, 0x06, 0xe083);
8567                         MP_WritePhyUshort(sc, 0x06, 0x4e78);
8568                         MP_WritePhyUshort(sc, 0x06, 0x039e);
8569                         MP_WritePhyUshort(sc, 0x06, 0x0be0);
8570                         MP_WritePhyUshort(sc, 0x06, 0x834e);
8571                         MP_WritePhyUshort(sc, 0x06, 0x7804);
8572                         MP_WritePhyUshort(sc, 0x06, 0x9e04);
8573                         MP_WritePhyUshort(sc, 0x06, 0xee83);
8574                         MP_WritePhyUshort(sc, 0x06, 0x4e02);
8575                         MP_WritePhyUshort(sc, 0x06, 0xe083);
8576                         MP_WritePhyUshort(sc, 0x06, 0x32e1);
8577                         MP_WritePhyUshort(sc, 0x06, 0x8333);
8578                         MP_WritePhyUshort(sc, 0x06, 0x590f);
8579                         MP_WritePhyUshort(sc, 0x06, 0xe283);
8580                         MP_WritePhyUshort(sc, 0x06, 0x4d0c);
8581                         MP_WritePhyUshort(sc, 0x06, 0x245a);
8582                         MP_WritePhyUshort(sc, 0x06, 0xf01e);
8583                         MP_WritePhyUshort(sc, 0x06, 0x12e4);
8584                         MP_WritePhyUshort(sc, 0x06, 0xf88c);
8585                         MP_WritePhyUshort(sc, 0x06, 0xe5f8);
8586                         MP_WritePhyUshort(sc, 0x06, 0x8de0);
8587                         MP_WritePhyUshort(sc, 0x06, 0x8330);
8588                         MP_WritePhyUshort(sc, 0x06, 0xe183);
8589                         MP_WritePhyUshort(sc, 0x06, 0x3168);
8590                         MP_WritePhyUshort(sc, 0x06, 0x01e4);
8591                         MP_WritePhyUshort(sc, 0x06, 0xf88a);
8592                         MP_WritePhyUshort(sc, 0x06, 0xe5f8);
8593                         MP_WritePhyUshort(sc, 0x06, 0x8bae);
8594                         MP_WritePhyUshort(sc, 0x06, 0x37ee);
8595                         MP_WritePhyUshort(sc, 0x06, 0x834e);
8596                         MP_WritePhyUshort(sc, 0x06, 0x03e0);
8597                         MP_WritePhyUshort(sc, 0x06, 0x834c);
8598                         MP_WritePhyUshort(sc, 0x06, 0xe183);
8599                         MP_WritePhyUshort(sc, 0x06, 0x4d1b);
8600                         MP_WritePhyUshort(sc, 0x06, 0x019e);
8601                         MP_WritePhyUshort(sc, 0x06, 0x04aa);
8602                         MP_WritePhyUshort(sc, 0x06, 0xa1ae);
8603                         MP_WritePhyUshort(sc, 0x06, 0xa8ee);
8604                         MP_WritePhyUshort(sc, 0x06, 0x834e);
8605                         MP_WritePhyUshort(sc, 0x06, 0x04ee);
8606                         MP_WritePhyUshort(sc, 0x06, 0x834f);
8607                         MP_WritePhyUshort(sc, 0x06, 0x00ae);
8608                         MP_WritePhyUshort(sc, 0x06, 0xabe0);
8609                         MP_WritePhyUshort(sc, 0x06, 0x834f);
8610                         MP_WritePhyUshort(sc, 0x06, 0x7803);
8611                         MP_WritePhyUshort(sc, 0x06, 0x9f14);
8612                         MP_WritePhyUshort(sc, 0x06, 0xee83);
8613                         MP_WritePhyUshort(sc, 0x06, 0x4e05);
8614                         MP_WritePhyUshort(sc, 0x06, 0xd240);
8615                         MP_WritePhyUshort(sc, 0x06, 0xd655);
8616                         MP_WritePhyUshort(sc, 0x06, 0x5402);
8617                         MP_WritePhyUshort(sc, 0x06, 0x81c6);
8618                         MP_WritePhyUshort(sc, 0x06, 0xd2a0);
8619                         MP_WritePhyUshort(sc, 0x06, 0xd6ba);
8620                         MP_WritePhyUshort(sc, 0x06, 0x0002);
8621                         MP_WritePhyUshort(sc, 0x06, 0x81c6);
8622                         MP_WritePhyUshort(sc, 0x06, 0xfefd);
8623                         MP_WritePhyUshort(sc, 0x06, 0xfc05);
8624                         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
8625                         MP_WritePhyUshort(sc, 0x06, 0xf860);
8626                         MP_WritePhyUshort(sc, 0x06, 0xe1f8);
8627                         MP_WritePhyUshort(sc, 0x06, 0x6168);
8628                         MP_WritePhyUshort(sc, 0x06, 0x02e4);
8629                         MP_WritePhyUshort(sc, 0x06, 0xf860);
8630                         MP_WritePhyUshort(sc, 0x06, 0xe5f8);
8631                         MP_WritePhyUshort(sc, 0x06, 0x61e0);
8632                         MP_WritePhyUshort(sc, 0x06, 0xf848);
8633                         MP_WritePhyUshort(sc, 0x06, 0xe1f8);
8634                         MP_WritePhyUshort(sc, 0x06, 0x4958);
8635                         MP_WritePhyUshort(sc, 0x06, 0x0f1e);
8636                         MP_WritePhyUshort(sc, 0x06, 0x02e4);
8637                         MP_WritePhyUshort(sc, 0x06, 0xf848);
8638                         MP_WritePhyUshort(sc, 0x06, 0xe5f8);
8639                         MP_WritePhyUshort(sc, 0x06, 0x49d0);
8640                         MP_WritePhyUshort(sc, 0x06, 0x0002);
8641                         MP_WritePhyUshort(sc, 0x06, 0x820a);
8642                         MP_WritePhyUshort(sc, 0x06, 0xbf83);
8643                         MP_WritePhyUshort(sc, 0x06, 0x50ef);
8644                         MP_WritePhyUshort(sc, 0x06, 0x46dc);
8645                         MP_WritePhyUshort(sc, 0x06, 0x19dd);
8646                         MP_WritePhyUshort(sc, 0x06, 0xd001);
8647                         MP_WritePhyUshort(sc, 0x06, 0x0282);
8648                         MP_WritePhyUshort(sc, 0x06, 0x0a02);
8649                         MP_WritePhyUshort(sc, 0x06, 0x8226);
8650                         MP_WritePhyUshort(sc, 0x06, 0xe0f8);
8651                         MP_WritePhyUshort(sc, 0x06, 0x60e1);
8652                         MP_WritePhyUshort(sc, 0x06, 0xf861);
8653                         MP_WritePhyUshort(sc, 0x06, 0x58fd);
8654                         MP_WritePhyUshort(sc, 0x06, 0xe4f8);
8655                         MP_WritePhyUshort(sc, 0x06, 0x60e5);
8656                         MP_WritePhyUshort(sc, 0x06, 0xf861);
8657                         MP_WritePhyUshort(sc, 0x06, 0xfc04);
8658                         MP_WritePhyUshort(sc, 0x06, 0xf9fa);
8659                         MP_WritePhyUshort(sc, 0x06, 0xfbc6);
8660                         MP_WritePhyUshort(sc, 0x06, 0xbff8);
8661                         MP_WritePhyUshort(sc, 0x06, 0x40be);
8662                         MP_WritePhyUshort(sc, 0x06, 0x8350);
8663                         MP_WritePhyUshort(sc, 0x06, 0xa001);
8664                         MP_WritePhyUshort(sc, 0x06, 0x0107);
8665                         MP_WritePhyUshort(sc, 0x06, 0x1b89);
8666                         MP_WritePhyUshort(sc, 0x06, 0xcfd2);
8667                         MP_WritePhyUshort(sc, 0x06, 0x08eb);
8668                         MP_WritePhyUshort(sc, 0x06, 0xdb19);
8669                         MP_WritePhyUshort(sc, 0x06, 0xb2fb);
8670                         MP_WritePhyUshort(sc, 0x06, 0xfffe);
8671                         MP_WritePhyUshort(sc, 0x06, 0xfd04);
8672                         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
8673                         MP_WritePhyUshort(sc, 0x06, 0xf848);
8674                         MP_WritePhyUshort(sc, 0x06, 0xe1f8);
8675                         MP_WritePhyUshort(sc, 0x06, 0x4968);
8676                         MP_WritePhyUshort(sc, 0x06, 0x08e4);
8677                         MP_WritePhyUshort(sc, 0x06, 0xf848);
8678                         MP_WritePhyUshort(sc, 0x06, 0xe5f8);
8679                         MP_WritePhyUshort(sc, 0x06, 0x4958);
8680                         MP_WritePhyUshort(sc, 0x06, 0xf7e4);
8681                         MP_WritePhyUshort(sc, 0x06, 0xf848);
8682                         MP_WritePhyUshort(sc, 0x06, 0xe5f8);
8683                         MP_WritePhyUshort(sc, 0x06, 0x49fc);
8684                         MP_WritePhyUshort(sc, 0x06, 0x044d);
8685                         MP_WritePhyUshort(sc, 0x06, 0x2000);
8686                         MP_WritePhyUshort(sc, 0x06, 0x024e);
8687                         MP_WritePhyUshort(sc, 0x06, 0x2200);
8688                         MP_WritePhyUshort(sc, 0x06, 0x024d);
8689                         MP_WritePhyUshort(sc, 0x06, 0xdfff);
8690                         MP_WritePhyUshort(sc, 0x06, 0x014e);
8691                         MP_WritePhyUshort(sc, 0x06, 0xddff);
8692                         MP_WritePhyUshort(sc, 0x06, 0x01f8);
8693                         MP_WritePhyUshort(sc, 0x06, 0xfafb);
8694                         MP_WritePhyUshort(sc, 0x06, 0xef79);
8695                         MP_WritePhyUshort(sc, 0x06, 0xbff8);
8696                         MP_WritePhyUshort(sc, 0x06, 0x22d8);
8697                         MP_WritePhyUshort(sc, 0x06, 0x19d9);
8698                         MP_WritePhyUshort(sc, 0x06, 0x5884);
8699                         MP_WritePhyUshort(sc, 0x06, 0x9f09);
8700                         MP_WritePhyUshort(sc, 0x06, 0xbf82);
8701                         MP_WritePhyUshort(sc, 0x06, 0x6dd6);
8702                         MP_WritePhyUshort(sc, 0x06, 0x8275);
8703                         MP_WritePhyUshort(sc, 0x06, 0x0201);
8704                         MP_WritePhyUshort(sc, 0x06, 0x4fef);
8705                         MP_WritePhyUshort(sc, 0x06, 0x97ff);
8706                         MP_WritePhyUshort(sc, 0x06, 0xfefc);
8707                         MP_WritePhyUshort(sc, 0x06, 0x0517);
8708                         MP_WritePhyUshort(sc, 0x06, 0xfffe);
8709                         MP_WritePhyUshort(sc, 0x06, 0x0117);
8710                         MP_WritePhyUshort(sc, 0x06, 0x0001);
8711                         MP_WritePhyUshort(sc, 0x06, 0x0200);
8712                         MP_WritePhyUshort(sc, 0x05, 0x83d8);
8713                         MP_WritePhyUshort(sc, 0x06, 0x8000);
8714                         MP_WritePhyUshort(sc, 0x05, 0x83d6);
8715                         MP_WritePhyUshort(sc, 0x06, 0x824f);
8716                         MP_WritePhyUshort(sc, 0x02, 0x2010);
8717                         MP_WritePhyUshort(sc, 0x03, 0xdc00);
8718                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
8719                         MP_WritePhyUshort(sc, 0x0b, 0x0600);
8720                         MP_WritePhyUshort(sc, 0x1f, 0x0005);
8721                         MP_WritePhyUshort(sc, 0x05, 0xfff6);
8722                         MP_WritePhyUshort(sc, 0x06, 0x00fc);
8723                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
8724                 }
8725
8726                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8727                 MP_WritePhyUshort(sc, 0x0D, 0xF880);
8728                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
8729         } else if (sc->re_type == MACFG_36 || sc->re_type == MACFG_37) {
8730                 if (sc->re_type == MACFG_36) {
8731                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
8732                         MP_WritePhyUshort(sc, 0x00, 0x1800);
8733                         MP_WritePhyUshort(sc, 0x1f, 0x0007);
8734                         MP_WritePhyUshort(sc, 0x1e, 0x0023);
8735                         MP_WritePhyUshort(sc, 0x17, 0x0117);
8736                         MP_WritePhyUshort(sc, 0x1f, 0x0007);
8737                         MP_WritePhyUshort(sc, 0x1E, 0x002C);
8738                         MP_WritePhyUshort(sc, 0x1B, 0x5000);
8739                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
8740                         MP_WritePhyUshort(sc, 0x16, 0x4104);
8741                         for (i = 0; i < 200; i++) {
8742                                 DELAY(100);
8743                                 Data = MP_ReadPhyUshort(sc, 0x1E);
8744                                 Data &= 0x03FF;
8745                                 if (Data== 0x000C)
8746                                         break;
8747                         }
8748                         MP_WritePhyUshort(sc, 0x1f, 0x0005);
8749                         for (i = 0; i < 200; i++) {
8750                                 DELAY(100);
8751                                 Data = MP_ReadPhyUshort(sc, 0x07);
8752                                 if ((Data & 0x0020)==0)
8753                                         break;
8754                         }
8755                         Data = MP_ReadPhyUshort(sc, 0x07);
8756                         if (Data & 0x0020) {
8757                                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
8758                                 MP_WritePhyUshort(sc, 0x1e, 0x00a1);
8759                                 MP_WritePhyUshort(sc, 0x17, 0x1000);
8760                                 MP_WritePhyUshort(sc, 0x17, 0x0000);
8761                                 MP_WritePhyUshort(sc, 0x17, 0x2000);
8762                                 MP_WritePhyUshort(sc, 0x1e, 0x002f);
8763                                 MP_WritePhyUshort(sc, 0x18, 0x9bfb);
8764                                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
8765                                 MP_WritePhyUshort(sc, 0x07, 0x0000);
8766                                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
8767                         }
8768                         MP_WritePhyUshort(sc, 0x1f, 0x0005);
8769                         MP_WritePhyUshort(sc, 0x05, 0xfff6);
8770                         MP_WritePhyUshort(sc, 0x06, 0x0080);
8771                         Data = MP_ReadPhyUshort(sc, 0x00);
8772                         Data &= ~(0x0080);
8773                         MP_WritePhyUshort(sc, 0x00, Data);
8774                         MP_WritePhyUshort(sc, 0x1f, 0x0002);
8775                         Data = MP_ReadPhyUshort(sc, 0x08);
8776                         Data &= ~(0x0080);
8777                         MP_WritePhyUshort(sc, 0x08, Data);
8778                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
8779                         MP_WritePhyUshort(sc, 0x1f, 0x0007);
8780                         MP_WritePhyUshort(sc, 0x1e, 0x0023);
8781                         MP_WritePhyUshort(sc, 0x16, 0x0306);
8782                         MP_WritePhyUshort(sc, 0x16, 0x0307);
8783                         MP_WritePhyUshort(sc, 0x15, 0x000e);
8784                         MP_WritePhyUshort(sc, 0x19, 0x000a);
8785                         MP_WritePhyUshort(sc, 0x15, 0x0010);
8786                         MP_WritePhyUshort(sc, 0x19, 0x0008);
8787                         MP_WritePhyUshort(sc, 0x15, 0x0018);
8788                         MP_WritePhyUshort(sc, 0x19, 0x4801);
8789                         MP_WritePhyUshort(sc, 0x15, 0x0019);
8790                         MP_WritePhyUshort(sc, 0x19, 0x6801);
8791                         MP_WritePhyUshort(sc, 0x15, 0x001a);
8792                         MP_WritePhyUshort(sc, 0x19, 0x66a1);
8793                         MP_WritePhyUshort(sc, 0x15, 0x001f);
8794                         MP_WritePhyUshort(sc, 0x19, 0x0000);
8795                         MP_WritePhyUshort(sc, 0x15, 0x0020);
8796                         MP_WritePhyUshort(sc, 0x19, 0x0000);
8797                         MP_WritePhyUshort(sc, 0x15, 0x0021);
8798                         MP_WritePhyUshort(sc, 0x19, 0x0000);
8799                         MP_WritePhyUshort(sc, 0x15, 0x0022);
8800                         MP_WritePhyUshort(sc, 0x19, 0x0000);
8801                         MP_WritePhyUshort(sc, 0x15, 0x0023);
8802                         MP_WritePhyUshort(sc, 0x19, 0x0000);
8803                         MP_WritePhyUshort(sc, 0x15, 0x0024);
8804                         MP_WritePhyUshort(sc, 0x19, 0x0000);
8805                         MP_WritePhyUshort(sc, 0x15, 0x0025);
8806                         MP_WritePhyUshort(sc, 0x19, 0x64a1);
8807                         MP_WritePhyUshort(sc, 0x15, 0x0026);
8808                         MP_WritePhyUshort(sc, 0x19, 0x40ea);
8809                         MP_WritePhyUshort(sc, 0x15, 0x0027);
8810                         MP_WritePhyUshort(sc, 0x19, 0x4503);
8811                         MP_WritePhyUshort(sc, 0x15, 0x0028);
8812                         MP_WritePhyUshort(sc, 0x19, 0x9f00);
8813                         MP_WritePhyUshort(sc, 0x15, 0x0029);
8814                         MP_WritePhyUshort(sc, 0x19, 0xa631);
8815                         MP_WritePhyUshort(sc, 0x15, 0x002a);
8816                         MP_WritePhyUshort(sc, 0x19, 0x9717);
8817                         MP_WritePhyUshort(sc, 0x15, 0x002b);
8818                         MP_WritePhyUshort(sc, 0x19, 0x302c);
8819                         MP_WritePhyUshort(sc, 0x15, 0x002c);
8820                         MP_WritePhyUshort(sc, 0x19, 0x4802);
8821                         MP_WritePhyUshort(sc, 0x15, 0x002d);
8822                         MP_WritePhyUshort(sc, 0x19, 0x58da);
8823                         MP_WritePhyUshort(sc, 0x15, 0x002e);
8824                         MP_WritePhyUshort(sc, 0x19, 0x400d);
8825                         MP_WritePhyUshort(sc, 0x15, 0x002f);
8826                         MP_WritePhyUshort(sc, 0x19, 0x4488);
8827                         MP_WritePhyUshort(sc, 0x15, 0x0030);
8828                         MP_WritePhyUshort(sc, 0x19, 0x9e00);
8829                         MP_WritePhyUshort(sc, 0x15, 0x0031);
8830                         MP_WritePhyUshort(sc, 0x19, 0x63c8);
8831                         MP_WritePhyUshort(sc, 0x15, 0x0032);
8832                         MP_WritePhyUshort(sc, 0x19, 0x6481);
8833                         MP_WritePhyUshort(sc, 0x15, 0x0033);
8834                         MP_WritePhyUshort(sc, 0x19, 0x0000);
8835                         MP_WritePhyUshort(sc, 0x15, 0x0034);
8836                         MP_WritePhyUshort(sc, 0x19, 0x0000);
8837                         MP_WritePhyUshort(sc, 0x15, 0x0035);
8838                         MP_WritePhyUshort(sc, 0x19, 0x0000);
8839                         MP_WritePhyUshort(sc, 0x15, 0x0036);
8840                         MP_WritePhyUshort(sc, 0x19, 0x0000);
8841                         MP_WritePhyUshort(sc, 0x15, 0x0037);
8842                         MP_WritePhyUshort(sc, 0x19, 0x0000);
8843                         MP_WritePhyUshort(sc, 0x15, 0x0038);
8844                         MP_WritePhyUshort(sc, 0x19, 0x0000);
8845                         MP_WritePhyUshort(sc, 0x15, 0x0039);
8846                         MP_WritePhyUshort(sc, 0x19, 0x0000);
8847                         MP_WritePhyUshort(sc, 0x15, 0x003a);
8848                         MP_WritePhyUshort(sc, 0x19, 0x0000);
8849                         MP_WritePhyUshort(sc, 0x15, 0x003b);
8850                         MP_WritePhyUshort(sc, 0x19, 0x63e8);
8851                         MP_WritePhyUshort(sc, 0x15, 0x003c);
8852                         MP_WritePhyUshort(sc, 0x19, 0x7d00);
8853                         MP_WritePhyUshort(sc, 0x15, 0x003d);
8854                         MP_WritePhyUshort(sc, 0x19, 0x59d4);
8855                         MP_WritePhyUshort(sc, 0x15, 0x003e);
8856                         MP_WritePhyUshort(sc, 0x19, 0x63f8);
8857                         MP_WritePhyUshort(sc, 0x15, 0x0040);
8858                         MP_WritePhyUshort(sc, 0x19, 0x64a1);
8859                         MP_WritePhyUshort(sc, 0x15, 0x0041);
8860                         MP_WritePhyUshort(sc, 0x19, 0x30de);
8861                         MP_WritePhyUshort(sc, 0x15, 0x0044);
8862                         MP_WritePhyUshort(sc, 0x19, 0x480f);
8863                         MP_WritePhyUshort(sc, 0x15, 0x0045);
8864                         MP_WritePhyUshort(sc, 0x19, 0x6800);
8865                         MP_WritePhyUshort(sc, 0x15, 0x0046);
8866                         MP_WritePhyUshort(sc, 0x19, 0x6680);
8867                         MP_WritePhyUshort(sc, 0x15, 0x0047);
8868                         MP_WritePhyUshort(sc, 0x19, 0x7c10);
8869                         MP_WritePhyUshort(sc, 0x15, 0x0048);
8870                         MP_WritePhyUshort(sc, 0x19, 0x63c8);
8871                         MP_WritePhyUshort(sc, 0x15, 0x0049);
8872                         MP_WritePhyUshort(sc, 0x19, 0x0000);
8873                         MP_WritePhyUshort(sc, 0x15, 0x004a);
8874                         MP_WritePhyUshort(sc, 0x19, 0x0000);
8875                         MP_WritePhyUshort(sc, 0x15, 0x004b);
8876                         MP_WritePhyUshort(sc, 0x19, 0x0000);
8877                         MP_WritePhyUshort(sc, 0x15, 0x004c);
8878                         MP_WritePhyUshort(sc, 0x19, 0x0000);
8879                         MP_WritePhyUshort(sc, 0x15, 0x004d);
8880                         MP_WritePhyUshort(sc, 0x19, 0x0000);
8881                         MP_WritePhyUshort(sc, 0x15, 0x004e);
8882                         MP_WritePhyUshort(sc, 0x19, 0x0000);
8883                         MP_WritePhyUshort(sc, 0x15, 0x004f);
8884                         MP_WritePhyUshort(sc, 0x19, 0x40ea);
8885                         MP_WritePhyUshort(sc, 0x15, 0x0050);
8886                         MP_WritePhyUshort(sc, 0x19, 0x4503);
8887                         MP_WritePhyUshort(sc, 0x15, 0x0051);
8888                         MP_WritePhyUshort(sc, 0x19, 0x58ca);
8889                         MP_WritePhyUshort(sc, 0x15, 0x0052);
8890                         MP_WritePhyUshort(sc, 0x19, 0x63c8);
8891                         MP_WritePhyUshort(sc, 0x15, 0x0053);
8892                         MP_WritePhyUshort(sc, 0x19, 0x63d8);
8893                         MP_WritePhyUshort(sc, 0x15, 0x0054);
8894                         MP_WritePhyUshort(sc, 0x19, 0x66a0);
8895                         MP_WritePhyUshort(sc, 0x15, 0x0055);
8896                         MP_WritePhyUshort(sc, 0x19, 0x9f00);
8897                         MP_WritePhyUshort(sc, 0x15, 0x0056);
8898                         MP_WritePhyUshort(sc, 0x19, 0x3000);
8899                         MP_WritePhyUshort(sc, 0x15, 0x006E);
8900                         MP_WritePhyUshort(sc, 0x19, 0x9afa);
8901                         MP_WritePhyUshort(sc, 0x15, 0x00a1);
8902                         MP_WritePhyUshort(sc, 0x19, 0x3044);
8903                         MP_WritePhyUshort(sc, 0x15, 0x00ab);
8904                         MP_WritePhyUshort(sc, 0x19, 0x5820);
8905                         MP_WritePhyUshort(sc, 0x15, 0x00ac);
8906                         MP_WritePhyUshort(sc, 0x19, 0x5e04);
8907                         MP_WritePhyUshort(sc, 0x15, 0x00ad);
8908                         MP_WritePhyUshort(sc, 0x19, 0xb60c);
8909                         MP_WritePhyUshort(sc, 0x15, 0x00af);
8910                         MP_WritePhyUshort(sc, 0x19, 0x000a);
8911                         MP_WritePhyUshort(sc, 0x15, 0x00b2);
8912                         MP_WritePhyUshort(sc, 0x19, 0x30b9);
8913                         MP_WritePhyUshort(sc, 0x15, 0x00b9);
8914                         MP_WritePhyUshort(sc, 0x19, 0x4408);
8915                         MP_WritePhyUshort(sc, 0x15, 0x00ba);
8916                         MP_WritePhyUshort(sc, 0x19, 0x480b);
8917                         MP_WritePhyUshort(sc, 0x15, 0x00bb);
8918                         MP_WritePhyUshort(sc, 0x19, 0x5e00);
8919                         MP_WritePhyUshort(sc, 0x15, 0x00bc);
8920                         MP_WritePhyUshort(sc, 0x19, 0x405f);
8921                         MP_WritePhyUshort(sc, 0x15, 0x00bd);
8922                         MP_WritePhyUshort(sc, 0x19, 0x4448);
8923                         MP_WritePhyUshort(sc, 0x15, 0x00be);
8924                         MP_WritePhyUshort(sc, 0x19, 0x4020);
8925                         MP_WritePhyUshort(sc, 0x15, 0x00bf);
8926                         MP_WritePhyUshort(sc, 0x19, 0x4468);
8927                         MP_WritePhyUshort(sc, 0x15, 0x00c0);
8928                         MP_WritePhyUshort(sc, 0x19, 0x9c02);
8929                         MP_WritePhyUshort(sc, 0x15, 0x00c1);
8930                         MP_WritePhyUshort(sc, 0x19, 0x58a0);
8931                         MP_WritePhyUshort(sc, 0x15, 0x00c2);
8932                         MP_WritePhyUshort(sc, 0x19, 0xb605);
8933                         MP_WritePhyUshort(sc, 0x15, 0x00c3);
8934                         MP_WritePhyUshort(sc, 0x19, 0xc0d3);
8935                         MP_WritePhyUshort(sc, 0x15, 0x00c4);
8936                         MP_WritePhyUshort(sc, 0x19, 0x00e6);
8937                         MP_WritePhyUshort(sc, 0x15, 0x00c5);
8938                         MP_WritePhyUshort(sc, 0x19, 0xdaec);
8939                         MP_WritePhyUshort(sc, 0x15, 0x00c6);
8940                         MP_WritePhyUshort(sc, 0x19, 0x00fa);
8941                         MP_WritePhyUshort(sc, 0x15, 0x00c7);
8942                         MP_WritePhyUshort(sc, 0x19, 0x9df9);
8943                         MP_WritePhyUshort(sc, 0x15, 0x00c8);
8944                         MP_WritePhyUshort(sc, 0x19, 0x307a);
8945                         MP_WritePhyUshort(sc, 0x15, 0x0112);
8946                         MP_WritePhyUshort(sc, 0x19, 0x6421);
8947                         MP_WritePhyUshort(sc, 0x15, 0x0113);
8948                         MP_WritePhyUshort(sc, 0x19, 0x7c08);
8949                         MP_WritePhyUshort(sc, 0x15, 0x0114);
8950                         MP_WritePhyUshort(sc, 0x19, 0x63f0);
8951                         MP_WritePhyUshort(sc, 0x15, 0x0115);
8952                         MP_WritePhyUshort(sc, 0x19, 0x4003);
8953                         MP_WritePhyUshort(sc, 0x15, 0x0116);
8954                         MP_WritePhyUshort(sc, 0x19, 0x4418);
8955                         MP_WritePhyUshort(sc, 0x15, 0x0117);
8956                         MP_WritePhyUshort(sc, 0x19, 0x9b00);
8957                         MP_WritePhyUshort(sc, 0x15, 0x0118);
8958                         MP_WritePhyUshort(sc, 0x19, 0x6461);
8959                         MP_WritePhyUshort(sc, 0x15, 0x0119);
8960                         MP_WritePhyUshort(sc, 0x19, 0x64e1);
8961                         MP_WritePhyUshort(sc, 0x15, 0x011a);
8962                         MP_WritePhyUshort(sc, 0x19, 0x0000);
8963                         MP_WritePhyUshort(sc, 0x15, 0x0150);
8964                         MP_WritePhyUshort(sc, 0x19, 0x7c80);
8965                         MP_WritePhyUshort(sc, 0x15, 0x0151);
8966                         MP_WritePhyUshort(sc, 0x19, 0x6461);
8967                         MP_WritePhyUshort(sc, 0x15, 0x0152);
8968                         MP_WritePhyUshort(sc, 0x19, 0x4003);
8969                         MP_WritePhyUshort(sc, 0x15, 0x0153);
8970                         MP_WritePhyUshort(sc, 0x19, 0x4540);
8971                         MP_WritePhyUshort(sc, 0x15, 0x0154);
8972                         MP_WritePhyUshort(sc, 0x19, 0x9f00);
8973                         MP_WritePhyUshort(sc, 0x15, 0x0155);
8974                         MP_WritePhyUshort(sc, 0x19, 0x9d00);
8975                         MP_WritePhyUshort(sc, 0x15, 0x0156);
8976                         MP_WritePhyUshort(sc, 0x19, 0x7c40);
8977                         MP_WritePhyUshort(sc, 0x15, 0x0157);
8978                         MP_WritePhyUshort(sc, 0x19, 0x6421);
8979                         MP_WritePhyUshort(sc, 0x15, 0x0158);
8980                         MP_WritePhyUshort(sc, 0x19, 0x7c80);
8981                         MP_WritePhyUshort(sc, 0x15, 0x0159);
8982                         MP_WritePhyUshort(sc, 0x19, 0x64a1);
8983                         MP_WritePhyUshort(sc, 0x15, 0x015a);
8984                         MP_WritePhyUshort(sc, 0x19, 0x30fe);
8985                         MP_WritePhyUshort(sc, 0x15, 0x021e);
8986                         MP_WritePhyUshort(sc, 0x19, 0x5410);
8987                         MP_WritePhyUshort(sc, 0x15, 0x0225);
8988                         MP_WritePhyUshort(sc, 0x19, 0x5400);
8989                         MP_WritePhyUshort(sc, 0x15, 0x023D);
8990                         MP_WritePhyUshort(sc, 0x19, 0x4050);
8991                         MP_WritePhyUshort(sc, 0x15, 0x0295);
8992                         MP_WritePhyUshort(sc, 0x19, 0x6c08);
8993                         MP_WritePhyUshort(sc, 0x15, 0x02bd);
8994                         MP_WritePhyUshort(sc, 0x19, 0xa523);
8995                         MP_WritePhyUshort(sc, 0x15, 0x02be);
8996                         MP_WritePhyUshort(sc, 0x19, 0x32ca);
8997                         MP_WritePhyUshort(sc, 0x15, 0x02ca);
8998                         MP_WritePhyUshort(sc, 0x19, 0x48b3);
8999                         MP_WritePhyUshort(sc, 0x15, 0x02cb);
9000                         MP_WritePhyUshort(sc, 0x19, 0x4020);
9001                         MP_WritePhyUshort(sc, 0x15, 0x02cc);
9002                         MP_WritePhyUshort(sc, 0x19, 0x4823);
9003                         MP_WritePhyUshort(sc, 0x15, 0x02cd);
9004                         MP_WritePhyUshort(sc, 0x19, 0x4510);
9005                         MP_WritePhyUshort(sc, 0x15, 0x02ce);
9006                         MP_WritePhyUshort(sc, 0x19, 0xb63a);
9007                         MP_WritePhyUshort(sc, 0x15, 0x02cf);
9008                         MP_WritePhyUshort(sc, 0x19, 0x7dc8);
9009                         MP_WritePhyUshort(sc, 0x15, 0x02d6);
9010                         MP_WritePhyUshort(sc, 0x19, 0x9bf8);
9011                         MP_WritePhyUshort(sc, 0x15, 0x02d8);
9012                         MP_WritePhyUshort(sc, 0x19, 0x85f6);
9013                         MP_WritePhyUshort(sc, 0x15, 0x02d9);
9014                         MP_WritePhyUshort(sc, 0x19, 0x32e0);
9015                         MP_WritePhyUshort(sc, 0x15, 0x02e0);
9016                         MP_WritePhyUshort(sc, 0x19, 0x4834);
9017                         MP_WritePhyUshort(sc, 0x15, 0x02e1);
9018                         MP_WritePhyUshort(sc, 0x19, 0x6c08);
9019                         MP_WritePhyUshort(sc, 0x15, 0x02e2);
9020                         MP_WritePhyUshort(sc, 0x19, 0x4020);
9021                         MP_WritePhyUshort(sc, 0x15, 0x02e3);
9022                         MP_WritePhyUshort(sc, 0x19, 0x4824);
9023                         MP_WritePhyUshort(sc, 0x15, 0x02e4);
9024                         MP_WritePhyUshort(sc, 0x19, 0x4520);
9025                         MP_WritePhyUshort(sc, 0x15, 0x02e5);
9026                         MP_WritePhyUshort(sc, 0x19, 0x4008);
9027                         MP_WritePhyUshort(sc, 0x15, 0x02e6);
9028                         MP_WritePhyUshort(sc, 0x19, 0x4560);
9029                         MP_WritePhyUshort(sc, 0x15, 0x02e7);
9030                         MP_WritePhyUshort(sc, 0x19, 0x9d04);
9031                         MP_WritePhyUshort(sc, 0x15, 0x02e8);
9032                         MP_WritePhyUshort(sc, 0x19, 0x48c4);
9033                         MP_WritePhyUshort(sc, 0x15, 0x02e9);
9034                         MP_WritePhyUshort(sc, 0x19, 0x0000);
9035                         MP_WritePhyUshort(sc, 0x15, 0x02ea);
9036                         MP_WritePhyUshort(sc, 0x19, 0x4844);
9037                         MP_WritePhyUshort(sc, 0x15, 0x02eb);
9038                         MP_WritePhyUshort(sc, 0x19, 0x7dc8);
9039                         MP_WritePhyUshort(sc, 0x15, 0x02f0);
9040                         MP_WritePhyUshort(sc, 0x19, 0x9cf7);
9041                         MP_WritePhyUshort(sc, 0x15, 0x02f1);
9042                         MP_WritePhyUshort(sc, 0x19, 0xdf94);
9043                         MP_WritePhyUshort(sc, 0x15, 0x02f2);
9044                         MP_WritePhyUshort(sc, 0x19, 0x0002);
9045                         MP_WritePhyUshort(sc, 0x15, 0x02f3);
9046                         MP_WritePhyUshort(sc, 0x19, 0x6810);
9047                         MP_WritePhyUshort(sc, 0x15, 0x02f4);
9048                         MP_WritePhyUshort(sc, 0x19, 0xb614);
9049                         MP_WritePhyUshort(sc, 0x15, 0x02f5);
9050                         MP_WritePhyUshort(sc, 0x19, 0xc42b);
9051                         MP_WritePhyUshort(sc, 0x15, 0x02f6);
9052                         MP_WritePhyUshort(sc, 0x19, 0x00d4);
9053                         MP_WritePhyUshort(sc, 0x15, 0x02f7);
9054                         MP_WritePhyUshort(sc, 0x19, 0xc455);
9055                         MP_WritePhyUshort(sc, 0x15, 0x02f8);
9056                         MP_WritePhyUshort(sc, 0x19, 0x0093);
9057                         MP_WritePhyUshort(sc, 0x15, 0x02f9);
9058                         MP_WritePhyUshort(sc, 0x19, 0x92ee);
9059                         MP_WritePhyUshort(sc, 0x15, 0x02fa);
9060                         MP_WritePhyUshort(sc, 0x19, 0xefed);
9061                         MP_WritePhyUshort(sc, 0x15, 0x02fb);
9062                         MP_WritePhyUshort(sc, 0x19, 0x3312);
9063                         MP_WritePhyUshort(sc, 0x15, 0x0312);
9064                         MP_WritePhyUshort(sc, 0x19, 0x49b5);
9065                         MP_WritePhyUshort(sc, 0x15, 0x0313);
9066                         MP_WritePhyUshort(sc, 0x19, 0x7d00);
9067                         MP_WritePhyUshort(sc, 0x15, 0x0314);
9068                         MP_WritePhyUshort(sc, 0x19, 0x4d00);
9069                         MP_WritePhyUshort(sc, 0x15, 0x0315);
9070                         MP_WritePhyUshort(sc, 0x19, 0x6810);
9071                         MP_WritePhyUshort(sc, 0x15, 0x031e);
9072                         MP_WritePhyUshort(sc, 0x19, 0x404f);
9073                         MP_WritePhyUshort(sc, 0x15, 0x031f);
9074                         MP_WritePhyUshort(sc, 0x19, 0x44c8);
9075                         MP_WritePhyUshort(sc, 0x15, 0x0320);
9076                         MP_WritePhyUshort(sc, 0x19, 0xd64f);
9077                         MP_WritePhyUshort(sc, 0x15, 0x0321);
9078                         MP_WritePhyUshort(sc, 0x19, 0x00e7);
9079                         MP_WritePhyUshort(sc, 0x15, 0x0322);
9080                         MP_WritePhyUshort(sc, 0x19, 0x7c08);
9081                         MP_WritePhyUshort(sc, 0x15, 0x0323);
9082                         MP_WritePhyUshort(sc, 0x19, 0x8203);
9083                         MP_WritePhyUshort(sc, 0x15, 0x0324);
9084                         MP_WritePhyUshort(sc, 0x19, 0x4d48);
9085                         MP_WritePhyUshort(sc, 0x15, 0x0325);
9086                         MP_WritePhyUshort(sc, 0x19, 0x3327);
9087                         MP_WritePhyUshort(sc, 0x15, 0x0326);
9088                         MP_WritePhyUshort(sc, 0x19, 0x4d40);
9089                         MP_WritePhyUshort(sc, 0x15, 0x0327);
9090                         MP_WritePhyUshort(sc, 0x19, 0xc8d7);
9091                         MP_WritePhyUshort(sc, 0x15, 0x0328);
9092                         MP_WritePhyUshort(sc, 0x19, 0x0003);
9093                         MP_WritePhyUshort(sc, 0x15, 0x0329);
9094                         MP_WritePhyUshort(sc, 0x19, 0x7c20);
9095                         MP_WritePhyUshort(sc, 0x15, 0x032a);
9096                         MP_WritePhyUshort(sc, 0x19, 0x4c20);
9097                         MP_WritePhyUshort(sc, 0x15, 0x032b);
9098                         MP_WritePhyUshort(sc, 0x19, 0xc8ed);
9099                         MP_WritePhyUshort(sc, 0x15, 0x032c);
9100                         MP_WritePhyUshort(sc, 0x19, 0x00f4);
9101                         MP_WritePhyUshort(sc, 0x15, 0x032d);
9102                         MP_WritePhyUshort(sc, 0x19, 0x82b3);
9103                         MP_WritePhyUshort(sc, 0x15, 0x032e);
9104                         MP_WritePhyUshort(sc, 0x19, 0xd11d);
9105                         MP_WritePhyUshort(sc, 0x15, 0x032f);
9106                         MP_WritePhyUshort(sc, 0x19, 0x00b1);
9107                         MP_WritePhyUshort(sc, 0x15, 0x0330);
9108                         MP_WritePhyUshort(sc, 0x19, 0xde18);
9109                         MP_WritePhyUshort(sc, 0x15, 0x0331);
9110                         MP_WritePhyUshort(sc, 0x19, 0x0008);
9111                         MP_WritePhyUshort(sc, 0x15, 0x0332);
9112                         MP_WritePhyUshort(sc, 0x19, 0x91ee);
9113                         MP_WritePhyUshort(sc, 0x15, 0x0333);
9114                         MP_WritePhyUshort(sc, 0x19, 0x3339);
9115                         MP_WritePhyUshort(sc, 0x15, 0x033a);
9116                         MP_WritePhyUshort(sc, 0x19, 0x4064);
9117                         MP_WritePhyUshort(sc, 0x15, 0x0340);
9118                         MP_WritePhyUshort(sc, 0x19, 0x9e06);
9119                         MP_WritePhyUshort(sc, 0x15, 0x0341);
9120                         MP_WritePhyUshort(sc, 0x19, 0x7c08);
9121                         MP_WritePhyUshort(sc, 0x15, 0x0342);
9122                         MP_WritePhyUshort(sc, 0x19, 0x8203);
9123                         MP_WritePhyUshort(sc, 0x15, 0x0343);
9124                         MP_WritePhyUshort(sc, 0x19, 0x4d48);
9125                         MP_WritePhyUshort(sc, 0x15, 0x0344);
9126                         MP_WritePhyUshort(sc, 0x19, 0x3346);
9127                         MP_WritePhyUshort(sc, 0x15, 0x0345);
9128                         MP_WritePhyUshort(sc, 0x19, 0x4d40);
9129                         MP_WritePhyUshort(sc, 0x15, 0x0346);
9130                         MP_WritePhyUshort(sc, 0x19, 0xd11d);
9131                         MP_WritePhyUshort(sc, 0x15, 0x0347);
9132                         MP_WritePhyUshort(sc, 0x19, 0x0099);
9133                         MP_WritePhyUshort(sc, 0x15, 0x0348);
9134                         MP_WritePhyUshort(sc, 0x19, 0xbb17);
9135                         MP_WritePhyUshort(sc, 0x15, 0x0349);
9136                         MP_WritePhyUshort(sc, 0x19, 0x8102);
9137                         MP_WritePhyUshort(sc, 0x15, 0x034a);
9138                         MP_WritePhyUshort(sc, 0x19, 0x334d);
9139                         MP_WritePhyUshort(sc, 0x15, 0x034b);
9140                         MP_WritePhyUshort(sc, 0x19, 0xa22c);
9141                         MP_WritePhyUshort(sc, 0x15, 0x034c);
9142                         MP_WritePhyUshort(sc, 0x19, 0x3397);
9143                         MP_WritePhyUshort(sc, 0x15, 0x034d);
9144                         MP_WritePhyUshort(sc, 0x19, 0x91f2);
9145                         MP_WritePhyUshort(sc, 0x15, 0x034e);
9146                         MP_WritePhyUshort(sc, 0x19, 0xc218);
9147                         MP_WritePhyUshort(sc, 0x15, 0x034f);
9148                         MP_WritePhyUshort(sc, 0x19, 0x00f0);
9149                         MP_WritePhyUshort(sc, 0x15, 0x0350);
9150                         MP_WritePhyUshort(sc, 0x19, 0x3397);
9151                         MP_WritePhyUshort(sc, 0x15, 0x0351);
9152                         MP_WritePhyUshort(sc, 0x19, 0x0000);
9153                         MP_WritePhyUshort(sc, 0x15, 0x0364);
9154                         MP_WritePhyUshort(sc, 0x19, 0xbc05);
9155                         MP_WritePhyUshort(sc, 0x15, 0x0367);
9156                         MP_WritePhyUshort(sc, 0x19, 0xa1fc);
9157                         MP_WritePhyUshort(sc, 0x15, 0x0368);
9158                         MP_WritePhyUshort(sc, 0x19, 0x3377);
9159                         MP_WritePhyUshort(sc, 0x15, 0x0369);
9160                         MP_WritePhyUshort(sc, 0x19, 0x328b);
9161                         MP_WritePhyUshort(sc, 0x15, 0x036a);
9162                         MP_WritePhyUshort(sc, 0x19, 0x0000);
9163                         MP_WritePhyUshort(sc, 0x15, 0x0377);
9164                         MP_WritePhyUshort(sc, 0x19, 0x4b97);
9165                         MP_WritePhyUshort(sc, 0x15, 0x0378);
9166                         MP_WritePhyUshort(sc, 0x19, 0x6818);
9167                         MP_WritePhyUshort(sc, 0x15, 0x0379);
9168                         MP_WritePhyUshort(sc, 0x19, 0x4b07);
9169                         MP_WritePhyUshort(sc, 0x15, 0x037a);
9170                         MP_WritePhyUshort(sc, 0x19, 0x40ac);
9171                         MP_WritePhyUshort(sc, 0x15, 0x037b);
9172                         MP_WritePhyUshort(sc, 0x19, 0x4445);
9173                         MP_WritePhyUshort(sc, 0x15, 0x037c);
9174                         MP_WritePhyUshort(sc, 0x19, 0x404e);
9175                         MP_WritePhyUshort(sc, 0x15, 0x037d);
9176                         MP_WritePhyUshort(sc, 0x19, 0x4461);
9177                         MP_WritePhyUshort(sc, 0x15, 0x037e);
9178                         MP_WritePhyUshort(sc, 0x19, 0x9c09);
9179                         MP_WritePhyUshort(sc, 0x15, 0x037f);
9180                         MP_WritePhyUshort(sc, 0x19, 0x63da);
9181                         MP_WritePhyUshort(sc, 0x15, 0x0380);
9182                         MP_WritePhyUshort(sc, 0x19, 0x5440);
9183                         MP_WritePhyUshort(sc, 0x15, 0x0381);
9184                         MP_WritePhyUshort(sc, 0x19, 0x4b98);
9185                         MP_WritePhyUshort(sc, 0x15, 0x0382);
9186                         MP_WritePhyUshort(sc, 0x19, 0x7c60);
9187                         MP_WritePhyUshort(sc, 0x15, 0x0383);
9188                         MP_WritePhyUshort(sc, 0x19, 0x4c00);
9189                         MP_WritePhyUshort(sc, 0x15, 0x0384);
9190                         MP_WritePhyUshort(sc, 0x19, 0x4b08);
9191                         MP_WritePhyUshort(sc, 0x15, 0x0385);
9192                         MP_WritePhyUshort(sc, 0x19, 0x63d8);
9193                         MP_WritePhyUshort(sc, 0x15, 0x0386);
9194                         MP_WritePhyUshort(sc, 0x19, 0x338d);
9195                         MP_WritePhyUshort(sc, 0x15, 0x0387);
9196                         MP_WritePhyUshort(sc, 0x19, 0xd64f);
9197                         MP_WritePhyUshort(sc, 0x15, 0x0388);
9198                         MP_WritePhyUshort(sc, 0x19, 0x0080);
9199                         MP_WritePhyUshort(sc, 0x15, 0x0389);
9200                         MP_WritePhyUshort(sc, 0x19, 0x820c);
9201                         MP_WritePhyUshort(sc, 0x15, 0x038a);
9202                         MP_WritePhyUshort(sc, 0x19, 0xa10b);
9203                         MP_WritePhyUshort(sc, 0x15, 0x038b);
9204                         MP_WritePhyUshort(sc, 0x19, 0x9df3);
9205                         MP_WritePhyUshort(sc, 0x15, 0x038c);
9206                         MP_WritePhyUshort(sc, 0x19, 0x3395);
9207                         MP_WritePhyUshort(sc, 0x15, 0x038d);
9208                         MP_WritePhyUshort(sc, 0x19, 0xd64f);
9209                         MP_WritePhyUshort(sc, 0x15, 0x038e);
9210                         MP_WritePhyUshort(sc, 0x19, 0x00f9);
9211                         MP_WritePhyUshort(sc, 0x15, 0x038f);
9212                         MP_WritePhyUshort(sc, 0x19, 0xc017);
9213                         MP_WritePhyUshort(sc, 0x15, 0x0390);
9214                         MP_WritePhyUshort(sc, 0x19, 0x0005);
9215                         MP_WritePhyUshort(sc, 0x15, 0x0391);
9216                         MP_WritePhyUshort(sc, 0x19, 0x6c0b);
9217                         MP_WritePhyUshort(sc, 0x15, 0x0392);
9218                         MP_WritePhyUshort(sc, 0x19, 0xa103);
9219                         MP_WritePhyUshort(sc, 0x15, 0x0393);
9220                         MP_WritePhyUshort(sc, 0x19, 0x6c08);
9221                         MP_WritePhyUshort(sc, 0x15, 0x0394);
9222                         MP_WritePhyUshort(sc, 0x19, 0x9df9);
9223                         MP_WritePhyUshort(sc, 0x15, 0x0395);
9224                         MP_WritePhyUshort(sc, 0x19, 0x6c08);
9225                         MP_WritePhyUshort(sc, 0x15, 0x0396);
9226                         MP_WritePhyUshort(sc, 0x19, 0x3397);
9227                         MP_WritePhyUshort(sc, 0x15, 0x0399);
9228                         MP_WritePhyUshort(sc, 0x19, 0x6810);
9229                         MP_WritePhyUshort(sc, 0x15, 0x03a4);
9230                         MP_WritePhyUshort(sc, 0x19, 0x7c08);
9231                         MP_WritePhyUshort(sc, 0x15, 0x03a5);
9232                         MP_WritePhyUshort(sc, 0x19, 0x8203);
9233                         MP_WritePhyUshort(sc, 0x15, 0x03a6);
9234                         MP_WritePhyUshort(sc, 0x19, 0x4d08);
9235                         MP_WritePhyUshort(sc, 0x15, 0x03a7);
9236                         MP_WritePhyUshort(sc, 0x19, 0x33a9);
9237                         MP_WritePhyUshort(sc, 0x15, 0x03a8);
9238                         MP_WritePhyUshort(sc, 0x19, 0x4d00);
9239                         MP_WritePhyUshort(sc, 0x15, 0x03a9);
9240                         MP_WritePhyUshort(sc, 0x19, 0x9bfa);
9241                         MP_WritePhyUshort(sc, 0x15, 0x03aa);
9242                         MP_WritePhyUshort(sc, 0x19, 0x33b6);
9243                         MP_WritePhyUshort(sc, 0x15, 0x03bb);
9244                         MP_WritePhyUshort(sc, 0x19, 0x4056);
9245                         MP_WritePhyUshort(sc, 0x15, 0x03bc);
9246                         MP_WritePhyUshort(sc, 0x19, 0x44e9);
9247                         MP_WritePhyUshort(sc, 0x15, 0x03bd);
9248                         MP_WritePhyUshort(sc, 0x19, 0x405e);
9249                         MP_WritePhyUshort(sc, 0x15, 0x03be);
9250                         MP_WritePhyUshort(sc, 0x19, 0x44f8);
9251                         MP_WritePhyUshort(sc, 0x15, 0x03bf);
9252                         MP_WritePhyUshort(sc, 0x19, 0xd64f);
9253                         MP_WritePhyUshort(sc, 0x15, 0x03c0);
9254                         MP_WritePhyUshort(sc, 0x19, 0x0037);
9255                         MP_WritePhyUshort(sc, 0x15, 0x03c1);
9256                         MP_WritePhyUshort(sc, 0x19, 0xbd37);
9257                         MP_WritePhyUshort(sc, 0x15, 0x03c2);
9258                         MP_WritePhyUshort(sc, 0x19, 0x9cfd);
9259                         MP_WritePhyUshort(sc, 0x15, 0x03c3);
9260                         MP_WritePhyUshort(sc, 0x19, 0xc639);
9261                         MP_WritePhyUshort(sc, 0x15, 0x03c4);
9262                         MP_WritePhyUshort(sc, 0x19, 0x0011);
9263                         MP_WritePhyUshort(sc, 0x15, 0x03c5);
9264                         MP_WritePhyUshort(sc, 0x19, 0x9b03);
9265                         MP_WritePhyUshort(sc, 0x15, 0x03c6);
9266                         MP_WritePhyUshort(sc, 0x19, 0x7c01);
9267                         MP_WritePhyUshort(sc, 0x15, 0x03c7);
9268                         MP_WritePhyUshort(sc, 0x19, 0x4c01);
9269                         MP_WritePhyUshort(sc, 0x15, 0x03c8);
9270                         MP_WritePhyUshort(sc, 0x19, 0x9e03);
9271                         MP_WritePhyUshort(sc, 0x15, 0x03c9);
9272                         MP_WritePhyUshort(sc, 0x19, 0x7c20);
9273                         MP_WritePhyUshort(sc, 0x15, 0x03ca);
9274                         MP_WritePhyUshort(sc, 0x19, 0x4c20);
9275                         MP_WritePhyUshort(sc, 0x15, 0x03cb);
9276                         MP_WritePhyUshort(sc, 0x19, 0x9af4);
9277                         MP_WritePhyUshort(sc, 0x15, 0x03cc);
9278                         MP_WritePhyUshort(sc, 0x19, 0x7c12);
9279                         MP_WritePhyUshort(sc, 0x15, 0x03cd);
9280                         MP_WritePhyUshort(sc, 0x19, 0x4c52);
9281                         MP_WritePhyUshort(sc, 0x15, 0x03ce);
9282                         MP_WritePhyUshort(sc, 0x19, 0x4470);
9283                         MP_WritePhyUshort(sc, 0x15, 0x03cf);
9284                         MP_WritePhyUshort(sc, 0x19, 0x7c12);
9285                         MP_WritePhyUshort(sc, 0x15, 0x03d0);
9286                         MP_WritePhyUshort(sc, 0x19, 0x4c40);
9287                         MP_WritePhyUshort(sc, 0x15, 0x03d1);
9288                         MP_WritePhyUshort(sc, 0x19, 0x33bf);
9289                         MP_WritePhyUshort(sc, 0x15, 0x03d6);
9290                         MP_WritePhyUshort(sc, 0x19, 0x4047);
9291                         MP_WritePhyUshort(sc, 0x15, 0x03d7);
9292                         MP_WritePhyUshort(sc, 0x19, 0x4469);
9293                         MP_WritePhyUshort(sc, 0x15, 0x03d8);
9294                         MP_WritePhyUshort(sc, 0x19, 0x492b);
9295                         MP_WritePhyUshort(sc, 0x15, 0x03d9);
9296                         MP_WritePhyUshort(sc, 0x19, 0x4479);
9297                         MP_WritePhyUshort(sc, 0x15, 0x03da);
9298                         MP_WritePhyUshort(sc, 0x19, 0x7c09);
9299                         MP_WritePhyUshort(sc, 0x15, 0x03db);
9300                         MP_WritePhyUshort(sc, 0x19, 0x8203);
9301                         MP_WritePhyUshort(sc, 0x15, 0x03dc);
9302                         MP_WritePhyUshort(sc, 0x19, 0x4d48);
9303                         MP_WritePhyUshort(sc, 0x15, 0x03dd);
9304                         MP_WritePhyUshort(sc, 0x19, 0x33df);
9305                         MP_WritePhyUshort(sc, 0x15, 0x03de);
9306                         MP_WritePhyUshort(sc, 0x19, 0x4d40);
9307                         MP_WritePhyUshort(sc, 0x15, 0x03df);
9308                         MP_WritePhyUshort(sc, 0x19, 0xd64f);
9309                         MP_WritePhyUshort(sc, 0x15, 0x03e0);
9310                         MP_WritePhyUshort(sc, 0x19, 0x0017);
9311                         MP_WritePhyUshort(sc, 0x15, 0x03e1);
9312                         MP_WritePhyUshort(sc, 0x19, 0xbd17);
9313                         MP_WritePhyUshort(sc, 0x15, 0x03e2);
9314                         MP_WritePhyUshort(sc, 0x19, 0x9b03);
9315                         MP_WritePhyUshort(sc, 0x15, 0x03e3);
9316                         MP_WritePhyUshort(sc, 0x19, 0x7c20);
9317                         MP_WritePhyUshort(sc, 0x15, 0x03e4);
9318                         MP_WritePhyUshort(sc, 0x19, 0x4c20);
9319                         MP_WritePhyUshort(sc, 0x15, 0x03e5);
9320                         MP_WritePhyUshort(sc, 0x19, 0x88f5);
9321                         MP_WritePhyUshort(sc, 0x15, 0x03e6);
9322                         MP_WritePhyUshort(sc, 0x19, 0xc428);
9323                         MP_WritePhyUshort(sc, 0x15, 0x03e7);
9324                         MP_WritePhyUshort(sc, 0x19, 0x0008);
9325                         MP_WritePhyUshort(sc, 0x15, 0x03e8);
9326                         MP_WritePhyUshort(sc, 0x19, 0x9af2);
9327                         MP_WritePhyUshort(sc, 0x15, 0x03e9);
9328                         MP_WritePhyUshort(sc, 0x19, 0x7c12);
9329                         MP_WritePhyUshort(sc, 0x15, 0x03ea);
9330                         MP_WritePhyUshort(sc, 0x19, 0x4c52);
9331                         MP_WritePhyUshort(sc, 0x15, 0x03eb);
9332                         MP_WritePhyUshort(sc, 0x19, 0x4470);
9333                         MP_WritePhyUshort(sc, 0x15, 0x03ec);
9334                         MP_WritePhyUshort(sc, 0x19, 0x7c12);
9335                         MP_WritePhyUshort(sc, 0x15, 0x03ed);
9336                         MP_WritePhyUshort(sc, 0x19, 0x4c40);
9337                         MP_WritePhyUshort(sc, 0x15, 0x03ee);
9338                         MP_WritePhyUshort(sc, 0x19, 0x33da);
9339                         MP_WritePhyUshort(sc, 0x15, 0x03ef);
9340                         MP_WritePhyUshort(sc, 0x19, 0x3312);
9341                         MP_WritePhyUshort(sc, 0x16, 0x0306);
9342                         MP_WritePhyUshort(sc, 0x16, 0x0300);
9343                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
9344                         MP_WritePhyUshort(sc, 0x17, 0x2179);
9345                         MP_WritePhyUshort(sc, 0x1f, 0x0007);
9346                         MP_WritePhyUshort(sc, 0x1e, 0x0040);
9347                         MP_WritePhyUshort(sc, 0x18, 0x0645);
9348                         MP_WritePhyUshort(sc, 0x19, 0xe200);
9349                         MP_WritePhyUshort(sc, 0x18, 0x0655);
9350                         MP_WritePhyUshort(sc, 0x19, 0x9000);
9351                         MP_WritePhyUshort(sc, 0x18, 0x0d05);
9352                         MP_WritePhyUshort(sc, 0x19, 0xbe00);
9353                         MP_WritePhyUshort(sc, 0x18, 0x0d15);
9354                         MP_WritePhyUshort(sc, 0x19, 0xd300);
9355                         MP_WritePhyUshort(sc, 0x18, 0x0d25);
9356                         MP_WritePhyUshort(sc, 0x19, 0xfe00);
9357                         MP_WritePhyUshort(sc, 0x18, 0x0d35);
9358                         MP_WritePhyUshort(sc, 0x19, 0x4000);
9359                         MP_WritePhyUshort(sc, 0x18, 0x0d45);
9360                         MP_WritePhyUshort(sc, 0x19, 0x7f00);
9361                         MP_WritePhyUshort(sc, 0x18, 0x0d55);
9362                         MP_WritePhyUshort(sc, 0x19, 0x1000);
9363                         MP_WritePhyUshort(sc, 0x18, 0x0d65);
9364                         MP_WritePhyUshort(sc, 0x19, 0x0000);
9365                         MP_WritePhyUshort(sc, 0x18, 0x0d75);
9366                         MP_WritePhyUshort(sc, 0x19, 0x8200);
9367                         MP_WritePhyUshort(sc, 0x18, 0x0d85);
9368                         MP_WritePhyUshort(sc, 0x19, 0x0000);
9369                         MP_WritePhyUshort(sc, 0x18, 0x0d95);
9370                         MP_WritePhyUshort(sc, 0x19, 0x7000);
9371                         MP_WritePhyUshort(sc, 0x18, 0x0da5);
9372                         MP_WritePhyUshort(sc, 0x19, 0x0f00);
9373                         MP_WritePhyUshort(sc, 0x18, 0x0db5);
9374                         MP_WritePhyUshort(sc, 0x19, 0x0100);
9375                         MP_WritePhyUshort(sc, 0x18, 0x0dc5);
9376                         MP_WritePhyUshort(sc, 0x19, 0x9b00);
9377                         MP_WritePhyUshort(sc, 0x18, 0x0dd5);
9378                         MP_WritePhyUshort(sc, 0x19, 0x7f00);
9379                         MP_WritePhyUshort(sc, 0x18, 0x0de5);
9380                         MP_WritePhyUshort(sc, 0x19, 0xe000);
9381                         MP_WritePhyUshort(sc, 0x18, 0x0df5);
9382                         MP_WritePhyUshort(sc, 0x19, 0xef00);
9383                         MP_WritePhyUshort(sc, 0x18, 0x16d5);
9384                         MP_WritePhyUshort(sc, 0x19, 0xe200);
9385                         MP_WritePhyUshort(sc, 0x18, 0x16e5);
9386                         MP_WritePhyUshort(sc, 0x19, 0xab00);
9387                         MP_WritePhyUshort(sc, 0x18, 0x2904);
9388                         MP_WritePhyUshort(sc, 0x19, 0x4000);
9389                         MP_WritePhyUshort(sc, 0x18, 0x2914);
9390                         MP_WritePhyUshort(sc, 0x19, 0x7f00);
9391                         MP_WritePhyUshort(sc, 0x18, 0x2924);
9392                         MP_WritePhyUshort(sc, 0x19, 0x0100);
9393                         MP_WritePhyUshort(sc, 0x18, 0x2934);
9394                         MP_WritePhyUshort(sc, 0x19, 0x2000);
9395                         MP_WritePhyUshort(sc, 0x18, 0x2944);
9396                         MP_WritePhyUshort(sc, 0x19, 0x0000);
9397                         MP_WritePhyUshort(sc, 0x18, 0x2954);
9398                         MP_WritePhyUshort(sc, 0x19, 0x4600);
9399                         MP_WritePhyUshort(sc, 0x18, 0x2964);
9400                         MP_WritePhyUshort(sc, 0x19, 0xfc00);
9401                         MP_WritePhyUshort(sc, 0x18, 0x2974);
9402                         MP_WritePhyUshort(sc, 0x19, 0x0000);
9403                         MP_WritePhyUshort(sc, 0x18, 0x2984);
9404                         MP_WritePhyUshort(sc, 0x19, 0x5000);
9405                         MP_WritePhyUshort(sc, 0x18, 0x2994);
9406                         MP_WritePhyUshort(sc, 0x19, 0x9d00);
9407                         MP_WritePhyUshort(sc, 0x18, 0x29a4);
9408                         MP_WritePhyUshort(sc, 0x19, 0xff00);
9409                         MP_WritePhyUshort(sc, 0x18, 0x29b4);
9410                         MP_WritePhyUshort(sc, 0x19, 0x4000);
9411                         MP_WritePhyUshort(sc, 0x18, 0x29c4);
9412                         MP_WritePhyUshort(sc, 0x19, 0x7f00);
9413                         MP_WritePhyUshort(sc, 0x18, 0x29d4);
9414                         MP_WritePhyUshort(sc, 0x19, 0x0000);
9415                         MP_WritePhyUshort(sc, 0x18, 0x29e4);
9416                         MP_WritePhyUshort(sc, 0x19, 0x2000);
9417                         MP_WritePhyUshort(sc, 0x18, 0x29f4);
9418                         MP_WritePhyUshort(sc, 0x19, 0x0000);
9419                         MP_WritePhyUshort(sc, 0x18, 0x2a04);
9420                         MP_WritePhyUshort(sc, 0x19, 0xe600);
9421                         MP_WritePhyUshort(sc, 0x18, 0x2a14);
9422                         MP_WritePhyUshort(sc, 0x19, 0xff00);
9423                         MP_WritePhyUshort(sc, 0x18, 0x2a24);
9424                         MP_WritePhyUshort(sc, 0x19, 0x0000);
9425                         MP_WritePhyUshort(sc, 0x18, 0x2a34);
9426                         MP_WritePhyUshort(sc, 0x19, 0x5000);
9427                         MP_WritePhyUshort(sc, 0x18, 0x2a44);
9428                         MP_WritePhyUshort(sc, 0x19, 0x8500);
9429                         MP_WritePhyUshort(sc, 0x18, 0x2a54);
9430                         MP_WritePhyUshort(sc, 0x19, 0x7f00);
9431                         MP_WritePhyUshort(sc, 0x18, 0x2a64);
9432                         MP_WritePhyUshort(sc, 0x19, 0xac00);
9433                         MP_WritePhyUshort(sc, 0x18, 0x2a74);
9434                         MP_WritePhyUshort(sc, 0x19, 0x0800);
9435                         MP_WritePhyUshort(sc, 0x18, 0x2a84);
9436                         MP_WritePhyUshort(sc, 0x19, 0xfc00);
9437                         MP_WritePhyUshort(sc, 0x18, 0x2a94);
9438                         MP_WritePhyUshort(sc, 0x19, 0xe000);
9439                         MP_WritePhyUshort(sc, 0x18, 0x2aa4);
9440                         MP_WritePhyUshort(sc, 0x19, 0x7400);
9441                         MP_WritePhyUshort(sc, 0x18, 0x2ab4);
9442                         MP_WritePhyUshort(sc, 0x19, 0x4000);
9443                         MP_WritePhyUshort(sc, 0x18, 0x2ac4);
9444                         MP_WritePhyUshort(sc, 0x19, 0x7f00);
9445                         MP_WritePhyUshort(sc, 0x18, 0x2ad4);
9446                         MP_WritePhyUshort(sc, 0x19, 0x0100);
9447                         MP_WritePhyUshort(sc, 0x18, 0x2ae4);
9448                         MP_WritePhyUshort(sc, 0x19, 0xff00);
9449                         MP_WritePhyUshort(sc, 0x18, 0x2af4);
9450                         MP_WritePhyUshort(sc, 0x19, 0x0000);
9451                         MP_WritePhyUshort(sc, 0x18, 0x2b04);
9452                         MP_WritePhyUshort(sc, 0x19, 0x4400);
9453                         MP_WritePhyUshort(sc, 0x18, 0x2b14);
9454                         MP_WritePhyUshort(sc, 0x19, 0xfc00);
9455                         MP_WritePhyUshort(sc, 0x18, 0x2b24);
9456                         MP_WritePhyUshort(sc, 0x19, 0x0000);
9457                         MP_WritePhyUshort(sc, 0x18, 0x2b34);
9458                         MP_WritePhyUshort(sc, 0x19, 0x4000);
9459                         MP_WritePhyUshort(sc, 0x18, 0x2b44);
9460                         MP_WritePhyUshort(sc, 0x19, 0x9d00);
9461                         MP_WritePhyUshort(sc, 0x18, 0x2b54);
9462                         MP_WritePhyUshort(sc, 0x19, 0xff00);
9463                         MP_WritePhyUshort(sc, 0x18, 0x2b64);
9464                         MP_WritePhyUshort(sc, 0x19, 0x4000);
9465                         MP_WritePhyUshort(sc, 0x18, 0x2b74);
9466                         MP_WritePhyUshort(sc, 0x19, 0x7f00);
9467                         MP_WritePhyUshort(sc, 0x18, 0x2b84);
9468                         MP_WritePhyUshort(sc, 0x19, 0x0000);
9469                         MP_WritePhyUshort(sc, 0x18, 0x2b94);
9470                         MP_WritePhyUshort(sc, 0x19, 0xff00);
9471                         MP_WritePhyUshort(sc, 0x18, 0x2ba4);
9472                         MP_WritePhyUshort(sc, 0x19, 0x0000);
9473                         MP_WritePhyUshort(sc, 0x18, 0x2bb4);
9474                         MP_WritePhyUshort(sc, 0x19, 0xfc00);
9475                         MP_WritePhyUshort(sc, 0x18, 0x2bc4);
9476                         MP_WritePhyUshort(sc, 0x19, 0xff00);
9477                         MP_WritePhyUshort(sc, 0x18, 0x2bd4);
9478                         MP_WritePhyUshort(sc, 0x19, 0x0000);
9479                         MP_WritePhyUshort(sc, 0x18, 0x2be4);
9480                         MP_WritePhyUshort(sc, 0x19, 0x4000);
9481                         MP_WritePhyUshort(sc, 0x18, 0x2bf4);
9482                         MP_WritePhyUshort(sc, 0x19, 0x8900);
9483                         MP_WritePhyUshort(sc, 0x18, 0x2c04);
9484                         MP_WritePhyUshort(sc, 0x19, 0x8300);
9485                         MP_WritePhyUshort(sc, 0x18, 0x2c14);
9486                         MP_WritePhyUshort(sc, 0x19, 0xe000);
9487                         MP_WritePhyUshort(sc, 0x18, 0x2c24);
9488                         MP_WritePhyUshort(sc, 0x19, 0x0000);
9489                         MP_WritePhyUshort(sc, 0x18, 0x2c34);
9490                         MP_WritePhyUshort(sc, 0x19, 0xac00);
9491                         MP_WritePhyUshort(sc, 0x18, 0x2c44);
9492                         MP_WritePhyUshort(sc, 0x19, 0x0800);
9493                         MP_WritePhyUshort(sc, 0x18, 0x2c54);
9494                         MP_WritePhyUshort(sc, 0x19, 0xfa00);
9495                         MP_WritePhyUshort(sc, 0x18, 0x2c64);
9496                         MP_WritePhyUshort(sc, 0x19, 0xe100);
9497                         MP_WritePhyUshort(sc, 0x18, 0x2c74);
9498                         MP_WritePhyUshort(sc, 0x19, 0x7f00);
9499                         MP_WritePhyUshort(sc, 0x18, 0x0001);
9500                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
9501                         MP_WritePhyUshort(sc, 0x17, 0x2100);
9502                         MP_WritePhyUshort(sc, 0x1f, 0x0005);
9503                         MP_WritePhyUshort(sc, 0x05, 0xfff6);
9504                         MP_WritePhyUshort(sc, 0x06, 0x0080);
9505                         MP_WritePhyUshort(sc, 0x05, 0x8b88);
9506                         MP_WritePhyUshort(sc, 0x06, 0x0000);
9507                         MP_WritePhyUshort(sc, 0x06, 0x0000);
9508                         MP_WritePhyUshort(sc, 0x06, 0x0000);
9509                         MP_WritePhyUshort(sc, 0x06, 0x0000);
9510                         MP_WritePhyUshort(sc, 0x05, 0x8000);
9511                         MP_WritePhyUshort(sc, 0x06, 0xd480);
9512                         MP_WritePhyUshort(sc, 0x06, 0xc1e4);
9513                         MP_WritePhyUshort(sc, 0x06, 0x8b9a);
9514                         MP_WritePhyUshort(sc, 0x06, 0xe58b);
9515                         MP_WritePhyUshort(sc, 0x06, 0x9bee);
9516                         MP_WritePhyUshort(sc, 0x06, 0x8b83);
9517                         MP_WritePhyUshort(sc, 0x06, 0x41bf);
9518                         MP_WritePhyUshort(sc, 0x06, 0x8b88);
9519                         MP_WritePhyUshort(sc, 0x06, 0xec00);
9520                         MP_WritePhyUshort(sc, 0x06, 0x19a9);
9521                         MP_WritePhyUshort(sc, 0x06, 0x8b90);
9522                         MP_WritePhyUshort(sc, 0x06, 0xf9ee);
9523                         MP_WritePhyUshort(sc, 0x06, 0xfff6);
9524                         MP_WritePhyUshort(sc, 0x06, 0x00ee);
9525                         MP_WritePhyUshort(sc, 0x06, 0xfff7);
9526                         MP_WritePhyUshort(sc, 0x06, 0xffe0);
9527                         MP_WritePhyUshort(sc, 0x06, 0xe140);
9528                         MP_WritePhyUshort(sc, 0x06, 0xe1e1);
9529                         MP_WritePhyUshort(sc, 0x06, 0x41f7);
9530                         MP_WritePhyUshort(sc, 0x06, 0x2ff6);
9531                         MP_WritePhyUshort(sc, 0x06, 0x28e4);
9532                         MP_WritePhyUshort(sc, 0x06, 0xe140);
9533                         MP_WritePhyUshort(sc, 0x06, 0xe5e1);
9534                         MP_WritePhyUshort(sc, 0x06, 0x41f7);
9535                         MP_WritePhyUshort(sc, 0x06, 0x0002);
9536                         MP_WritePhyUshort(sc, 0x06, 0x020c);
9537                         MP_WritePhyUshort(sc, 0x06, 0x0202);
9538                         MP_WritePhyUshort(sc, 0x06, 0x1d02);
9539                         MP_WritePhyUshort(sc, 0x06, 0x0230);
9540                         MP_WritePhyUshort(sc, 0x06, 0x0202);
9541                         MP_WritePhyUshort(sc, 0x06, 0x4002);
9542                         MP_WritePhyUshort(sc, 0x06, 0x028b);
9543                         MP_WritePhyUshort(sc, 0x06, 0x0280);
9544                         MP_WritePhyUshort(sc, 0x06, 0x6c02);
9545                         MP_WritePhyUshort(sc, 0x06, 0x8085);
9546                         MP_WritePhyUshort(sc, 0x06, 0xe08b);
9547                         MP_WritePhyUshort(sc, 0x06, 0x88e1);
9548                         MP_WritePhyUshort(sc, 0x06, 0x8b89);
9549                         MP_WritePhyUshort(sc, 0x06, 0x1e01);
9550                         MP_WritePhyUshort(sc, 0x06, 0xe18b);
9551                         MP_WritePhyUshort(sc, 0x06, 0x8a1e);
9552                         MP_WritePhyUshort(sc, 0x06, 0x01e1);
9553                         MP_WritePhyUshort(sc, 0x06, 0x8b8b);
9554                         MP_WritePhyUshort(sc, 0x06, 0x1e01);
9555                         MP_WritePhyUshort(sc, 0x06, 0xe18b);
9556                         MP_WritePhyUshort(sc, 0x06, 0x8c1e);
9557                         MP_WritePhyUshort(sc, 0x06, 0x01e1);
9558                         MP_WritePhyUshort(sc, 0x06, 0x8b8d);
9559                         MP_WritePhyUshort(sc, 0x06, 0x1e01);
9560                         MP_WritePhyUshort(sc, 0x06, 0xe18b);
9561                         MP_WritePhyUshort(sc, 0x06, 0x8e1e);
9562                         MP_WritePhyUshort(sc, 0x06, 0x01a0);
9563                         MP_WritePhyUshort(sc, 0x06, 0x00c7);
9564                         MP_WritePhyUshort(sc, 0x06, 0xaec3);
9565                         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
9566                         MP_WritePhyUshort(sc, 0x06, 0x8b8d);
9567                         MP_WritePhyUshort(sc, 0x06, 0xad20);
9568                         MP_WritePhyUshort(sc, 0x06, 0x10ee);
9569                         MP_WritePhyUshort(sc, 0x06, 0x8b8d);
9570                         MP_WritePhyUshort(sc, 0x06, 0x0002);
9571                         MP_WritePhyUshort(sc, 0x06, 0x1310);
9572                         MP_WritePhyUshort(sc, 0x06, 0x0280);
9573                         MP_WritePhyUshort(sc, 0x06, 0xc602);
9574                         MP_WritePhyUshort(sc, 0x06, 0x1f0c);
9575                         MP_WritePhyUshort(sc, 0x06, 0x0227);
9576                         MP_WritePhyUshort(sc, 0x06, 0x49fc);
9577                         MP_WritePhyUshort(sc, 0x06, 0x04f8);
9578                         MP_WritePhyUshort(sc, 0x06, 0xe08b);
9579                         MP_WritePhyUshort(sc, 0x06, 0x8ead);
9580                         MP_WritePhyUshort(sc, 0x06, 0x200b);
9581                         MP_WritePhyUshort(sc, 0x06, 0xf620);
9582                         MP_WritePhyUshort(sc, 0x06, 0xe48b);
9583                         MP_WritePhyUshort(sc, 0x06, 0x8e02);
9584                         MP_WritePhyUshort(sc, 0x06, 0x852d);
9585                         MP_WritePhyUshort(sc, 0x06, 0x021b);
9586                         MP_WritePhyUshort(sc, 0x06, 0x67ad);
9587                         MP_WritePhyUshort(sc, 0x06, 0x2211);
9588                         MP_WritePhyUshort(sc, 0x06, 0xf622);
9589                         MP_WritePhyUshort(sc, 0x06, 0xe48b);
9590                         MP_WritePhyUshort(sc, 0x06, 0x8e02);
9591                         MP_WritePhyUshort(sc, 0x06, 0x2ba5);
9592                         MP_WritePhyUshort(sc, 0x06, 0x022a);
9593                         MP_WritePhyUshort(sc, 0x06, 0x2402);
9594                         MP_WritePhyUshort(sc, 0x06, 0x82e5);
9595                         MP_WritePhyUshort(sc, 0x06, 0x022a);
9596                         MP_WritePhyUshort(sc, 0x06, 0xf0ad);
9597                         MP_WritePhyUshort(sc, 0x06, 0x2511);
9598                         MP_WritePhyUshort(sc, 0x06, 0xf625);
9599                         MP_WritePhyUshort(sc, 0x06, 0xe48b);
9600                         MP_WritePhyUshort(sc, 0x06, 0x8e02);
9601                         MP_WritePhyUshort(sc, 0x06, 0x8445);
9602                         MP_WritePhyUshort(sc, 0x06, 0x0204);
9603                         MP_WritePhyUshort(sc, 0x06, 0x0302);
9604                         MP_WritePhyUshort(sc, 0x06, 0x19cc);
9605                         MP_WritePhyUshort(sc, 0x06, 0x022b);
9606                         MP_WritePhyUshort(sc, 0x06, 0x5bfc);
9607                         MP_WritePhyUshort(sc, 0x06, 0x04ee);
9608                         MP_WritePhyUshort(sc, 0x06, 0x8b8d);
9609                         MP_WritePhyUshort(sc, 0x06, 0x0105);
9610                         MP_WritePhyUshort(sc, 0x06, 0xf8f9);
9611                         MP_WritePhyUshort(sc, 0x06, 0xfae0);
9612                         MP_WritePhyUshort(sc, 0x06, 0x8b81);
9613                         MP_WritePhyUshort(sc, 0x06, 0xac26);
9614                         MP_WritePhyUshort(sc, 0x06, 0x08e0);
9615                         MP_WritePhyUshort(sc, 0x06, 0x8b81);
9616                         MP_WritePhyUshort(sc, 0x06, 0xac21);
9617                         MP_WritePhyUshort(sc, 0x06, 0x02ae);
9618                         MP_WritePhyUshort(sc, 0x06, 0x6bee);
9619                         MP_WritePhyUshort(sc, 0x06, 0xe0ea);
9620                         MP_WritePhyUshort(sc, 0x06, 0x00ee);
9621                         MP_WritePhyUshort(sc, 0x06, 0xe0eb);
9622                         MP_WritePhyUshort(sc, 0x06, 0x00e2);
9623                         MP_WritePhyUshort(sc, 0x06, 0xe07c);
9624                         MP_WritePhyUshort(sc, 0x06, 0xe3e0);
9625                         MP_WritePhyUshort(sc, 0x06, 0x7da5);
9626                         MP_WritePhyUshort(sc, 0x06, 0x1111);
9627                         MP_WritePhyUshort(sc, 0x06, 0x15d2);
9628                         MP_WritePhyUshort(sc, 0x06, 0x60d6);
9629                         MP_WritePhyUshort(sc, 0x06, 0x6666);
9630                         MP_WritePhyUshort(sc, 0x06, 0x0207);
9631                         MP_WritePhyUshort(sc, 0x06, 0x6cd2);
9632                         MP_WritePhyUshort(sc, 0x06, 0xa0d6);
9633                         MP_WritePhyUshort(sc, 0x06, 0xaaaa);
9634                         MP_WritePhyUshort(sc, 0x06, 0x0207);
9635                         MP_WritePhyUshort(sc, 0x06, 0x6c02);
9636                         MP_WritePhyUshort(sc, 0x06, 0x201d);
9637                         MP_WritePhyUshort(sc, 0x06, 0xae44);
9638                         MP_WritePhyUshort(sc, 0x06, 0xa566);
9639                         MP_WritePhyUshort(sc, 0x06, 0x6602);
9640                         MP_WritePhyUshort(sc, 0x06, 0xae38);
9641                         MP_WritePhyUshort(sc, 0x06, 0xa5aa);
9642                         MP_WritePhyUshort(sc, 0x06, 0xaa02);
9643                         MP_WritePhyUshort(sc, 0x06, 0xae32);
9644                         MP_WritePhyUshort(sc, 0x06, 0xeee0);
9645                         MP_WritePhyUshort(sc, 0x06, 0xea04);
9646                         MP_WritePhyUshort(sc, 0x06, 0xeee0);
9647                         MP_WritePhyUshort(sc, 0x06, 0xeb06);
9648                         MP_WritePhyUshort(sc, 0x06, 0xe2e0);
9649                         MP_WritePhyUshort(sc, 0x06, 0x7ce3);
9650                         MP_WritePhyUshort(sc, 0x06, 0xe07d);
9651                         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
9652                         MP_WritePhyUshort(sc, 0x06, 0x38e1);
9653                         MP_WritePhyUshort(sc, 0x06, 0xe039);
9654                         MP_WritePhyUshort(sc, 0x06, 0xad2e);
9655                         MP_WritePhyUshort(sc, 0x06, 0x21ad);
9656                         MP_WritePhyUshort(sc, 0x06, 0x3f13);
9657                         MP_WritePhyUshort(sc, 0x06, 0xe0e4);
9658                         MP_WritePhyUshort(sc, 0x06, 0x14e1);
9659                         MP_WritePhyUshort(sc, 0x06, 0xe415);
9660                         MP_WritePhyUshort(sc, 0x06, 0x6880);
9661                         MP_WritePhyUshort(sc, 0x06, 0xe4e4);
9662                         MP_WritePhyUshort(sc, 0x06, 0x14e5);
9663                         MP_WritePhyUshort(sc, 0x06, 0xe415);
9664                         MP_WritePhyUshort(sc, 0x06, 0x0220);
9665                         MP_WritePhyUshort(sc, 0x06, 0x1dae);
9666                         MP_WritePhyUshort(sc, 0x06, 0x0bac);
9667                         MP_WritePhyUshort(sc, 0x06, 0x3e02);
9668                         MP_WritePhyUshort(sc, 0x06, 0xae06);
9669                         MP_WritePhyUshort(sc, 0x06, 0x0281);
9670                         MP_WritePhyUshort(sc, 0x06, 0x4602);
9671                         MP_WritePhyUshort(sc, 0x06, 0x2057);
9672                         MP_WritePhyUshort(sc, 0x06, 0xfefd);
9673                         MP_WritePhyUshort(sc, 0x06, 0xfc04);
9674                         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
9675                         MP_WritePhyUshort(sc, 0x06, 0x8b81);
9676                         MP_WritePhyUshort(sc, 0x06, 0xad26);
9677                         MP_WritePhyUshort(sc, 0x06, 0x0302);
9678                         MP_WritePhyUshort(sc, 0x06, 0x20a7);
9679                         MP_WritePhyUshort(sc, 0x06, 0xe08b);
9680                         MP_WritePhyUshort(sc, 0x06, 0x81ad);
9681                         MP_WritePhyUshort(sc, 0x06, 0x2109);
9682                         MP_WritePhyUshort(sc, 0x06, 0xe08b);
9683                         MP_WritePhyUshort(sc, 0x06, 0x2eac);
9684                         MP_WritePhyUshort(sc, 0x06, 0x2003);
9685                         MP_WritePhyUshort(sc, 0x06, 0x0281);
9686                         MP_WritePhyUshort(sc, 0x06, 0x61fc);
9687                         MP_WritePhyUshort(sc, 0x06, 0x04f8);
9688                         MP_WritePhyUshort(sc, 0x06, 0xe08b);
9689                         MP_WritePhyUshort(sc, 0x06, 0x81ac);
9690                         MP_WritePhyUshort(sc, 0x06, 0x2505);
9691                         MP_WritePhyUshort(sc, 0x06, 0x0222);
9692                         MP_WritePhyUshort(sc, 0x06, 0xaeae);
9693                         MP_WritePhyUshort(sc, 0x06, 0x0302);
9694                         MP_WritePhyUshort(sc, 0x06, 0x8172);
9695                         MP_WritePhyUshort(sc, 0x06, 0xfc04);
9696                         MP_WritePhyUshort(sc, 0x06, 0xf8f9);
9697                         MP_WritePhyUshort(sc, 0x06, 0xfaef);
9698                         MP_WritePhyUshort(sc, 0x06, 0x69fa);
9699                         MP_WritePhyUshort(sc, 0x06, 0xe086);
9700                         MP_WritePhyUshort(sc, 0x06, 0x20a0);
9701                         MP_WritePhyUshort(sc, 0x06, 0x8016);
9702                         MP_WritePhyUshort(sc, 0x06, 0xe086);
9703                         MP_WritePhyUshort(sc, 0x06, 0x21e1);
9704                         MP_WritePhyUshort(sc, 0x06, 0x8b33);
9705                         MP_WritePhyUshort(sc, 0x06, 0x1b10);
9706                         MP_WritePhyUshort(sc, 0x06, 0x9e06);
9707                         MP_WritePhyUshort(sc, 0x06, 0x0223);
9708                         MP_WritePhyUshort(sc, 0x06, 0x91af);
9709                         MP_WritePhyUshort(sc, 0x06, 0x8252);
9710                         MP_WritePhyUshort(sc, 0x06, 0xee86);
9711                         MP_WritePhyUshort(sc, 0x06, 0x2081);
9712                         MP_WritePhyUshort(sc, 0x06, 0xaee4);
9713                         MP_WritePhyUshort(sc, 0x06, 0xa081);
9714                         MP_WritePhyUshort(sc, 0x06, 0x1402);
9715                         MP_WritePhyUshort(sc, 0x06, 0x2399);
9716                         MP_WritePhyUshort(sc, 0x06, 0xbf25);
9717                         MP_WritePhyUshort(sc, 0x06, 0xcc02);
9718                         MP_WritePhyUshort(sc, 0x06, 0x2d21);
9719                         MP_WritePhyUshort(sc, 0x06, 0xee86);
9720                         MP_WritePhyUshort(sc, 0x06, 0x2100);
9721                         MP_WritePhyUshort(sc, 0x06, 0xee86);
9722                         MP_WritePhyUshort(sc, 0x06, 0x2082);
9723                         MP_WritePhyUshort(sc, 0x06, 0xaf82);
9724                         MP_WritePhyUshort(sc, 0x06, 0x52a0);
9725                         MP_WritePhyUshort(sc, 0x06, 0x8232);
9726                         MP_WritePhyUshort(sc, 0x06, 0xe086);
9727                         MP_WritePhyUshort(sc, 0x06, 0x21e1);
9728                         MP_WritePhyUshort(sc, 0x06, 0x8b32);
9729                         MP_WritePhyUshort(sc, 0x06, 0x1b10);
9730                         MP_WritePhyUshort(sc, 0x06, 0x9e06);
9731                         MP_WritePhyUshort(sc, 0x06, 0x0223);
9732                         MP_WritePhyUshort(sc, 0x06, 0x91af);
9733                         MP_WritePhyUshort(sc, 0x06, 0x8252);
9734                         MP_WritePhyUshort(sc, 0x06, 0xee86);
9735                         MP_WritePhyUshort(sc, 0x06, 0x2100);
9736                         MP_WritePhyUshort(sc, 0x06, 0xd000);
9737                         MP_WritePhyUshort(sc, 0x06, 0x0282);
9738                         MP_WritePhyUshort(sc, 0x06, 0x5910);
9739                         MP_WritePhyUshort(sc, 0x06, 0xa004);
9740                         MP_WritePhyUshort(sc, 0x06, 0xf9e0);
9741                         MP_WritePhyUshort(sc, 0x06, 0x861f);
9742                         MP_WritePhyUshort(sc, 0x06, 0xa000);
9743                         MP_WritePhyUshort(sc, 0x06, 0x07ee);
9744                         MP_WritePhyUshort(sc, 0x06, 0x8620);
9745                         MP_WritePhyUshort(sc, 0x06, 0x83af);
9746                         MP_WritePhyUshort(sc, 0x06, 0x8178);
9747                         MP_WritePhyUshort(sc, 0x06, 0x0224);
9748                         MP_WritePhyUshort(sc, 0x06, 0x0102);
9749                         MP_WritePhyUshort(sc, 0x06, 0x2399);
9750                         MP_WritePhyUshort(sc, 0x06, 0xae72);
9751                         MP_WritePhyUshort(sc, 0x06, 0xa083);
9752                         MP_WritePhyUshort(sc, 0x06, 0x4b1f);
9753                         MP_WritePhyUshort(sc, 0x06, 0x55d0);
9754                         MP_WritePhyUshort(sc, 0x06, 0x04bf);
9755                         MP_WritePhyUshort(sc, 0x06, 0x8615);
9756                         MP_WritePhyUshort(sc, 0x06, 0x1a90);
9757                         MP_WritePhyUshort(sc, 0x06, 0x0c54);
9758                         MP_WritePhyUshort(sc, 0x06, 0xd91e);
9759                         MP_WritePhyUshort(sc, 0x06, 0x31b0);
9760                         MP_WritePhyUshort(sc, 0x06, 0xf4e0);
9761                         MP_WritePhyUshort(sc, 0x06, 0xe022);
9762                         MP_WritePhyUshort(sc, 0x06, 0xe1e0);
9763                         MP_WritePhyUshort(sc, 0x06, 0x23ad);
9764                         MP_WritePhyUshort(sc, 0x06, 0x2e0c);
9765                         MP_WritePhyUshort(sc, 0x06, 0xef02);
9766                         MP_WritePhyUshort(sc, 0x06, 0xef12);
9767                         MP_WritePhyUshort(sc, 0x06, 0x0e44);
9768                         MP_WritePhyUshort(sc, 0x06, 0xef23);
9769                         MP_WritePhyUshort(sc, 0x06, 0x0e54);
9770                         MP_WritePhyUshort(sc, 0x06, 0xef21);
9771                         MP_WritePhyUshort(sc, 0x06, 0xe6e4);
9772                         MP_WritePhyUshort(sc, 0x06, 0x2ae7);
9773                         MP_WritePhyUshort(sc, 0x06, 0xe42b);
9774                         MP_WritePhyUshort(sc, 0x06, 0xe2e4);
9775                         MP_WritePhyUshort(sc, 0x06, 0x28e3);
9776                         MP_WritePhyUshort(sc, 0x06, 0xe429);
9777                         MP_WritePhyUshort(sc, 0x06, 0x6d20);
9778                         MP_WritePhyUshort(sc, 0x06, 0x00e6);
9779                         MP_WritePhyUshort(sc, 0x06, 0xe428);
9780                         MP_WritePhyUshort(sc, 0x06, 0xe7e4);
9781                         MP_WritePhyUshort(sc, 0x06, 0x29bf);
9782                         MP_WritePhyUshort(sc, 0x06, 0x25ca);
9783                         MP_WritePhyUshort(sc, 0x06, 0x022d);
9784                         MP_WritePhyUshort(sc, 0x06, 0x21ee);
9785                         MP_WritePhyUshort(sc, 0x06, 0x8620);
9786                         MP_WritePhyUshort(sc, 0x06, 0x84ee);
9787                         MP_WritePhyUshort(sc, 0x06, 0x8621);
9788                         MP_WritePhyUshort(sc, 0x06, 0x00af);
9789                         MP_WritePhyUshort(sc, 0x06, 0x8178);
9790                         MP_WritePhyUshort(sc, 0x06, 0xa084);
9791                         MP_WritePhyUshort(sc, 0x06, 0x19e0);
9792                         MP_WritePhyUshort(sc, 0x06, 0x8621);
9793                         MP_WritePhyUshort(sc, 0x06, 0xe18b);
9794                         MP_WritePhyUshort(sc, 0x06, 0x341b);
9795                         MP_WritePhyUshort(sc, 0x06, 0x109e);
9796                         MP_WritePhyUshort(sc, 0x06, 0x0602);
9797                         MP_WritePhyUshort(sc, 0x06, 0x2391);
9798                         MP_WritePhyUshort(sc, 0x06, 0xaf82);
9799                         MP_WritePhyUshort(sc, 0x06, 0x5202);
9800                         MP_WritePhyUshort(sc, 0x06, 0x241f);
9801                         MP_WritePhyUshort(sc, 0x06, 0xee86);
9802                         MP_WritePhyUshort(sc, 0x06, 0x2085);
9803                         MP_WritePhyUshort(sc, 0x06, 0xae08);
9804                         MP_WritePhyUshort(sc, 0x06, 0xa085);
9805                         MP_WritePhyUshort(sc, 0x06, 0x02ae);
9806                         MP_WritePhyUshort(sc, 0x06, 0x0302);
9807                         MP_WritePhyUshort(sc, 0x06, 0x2442);
9808                         MP_WritePhyUshort(sc, 0x06, 0xfeef);
9809                         MP_WritePhyUshort(sc, 0x06, 0x96fe);
9810                         MP_WritePhyUshort(sc, 0x06, 0xfdfc);
9811                         MP_WritePhyUshort(sc, 0x06, 0x04f8);
9812                         MP_WritePhyUshort(sc, 0x06, 0xf9fa);
9813                         MP_WritePhyUshort(sc, 0x06, 0xef69);
9814                         MP_WritePhyUshort(sc, 0x06, 0xfad1);
9815                         MP_WritePhyUshort(sc, 0x06, 0x801f);
9816                         MP_WritePhyUshort(sc, 0x06, 0x66e2);
9817                         MP_WritePhyUshort(sc, 0x06, 0xe0ea);
9818                         MP_WritePhyUshort(sc, 0x06, 0xe3e0);
9819                         MP_WritePhyUshort(sc, 0x06, 0xeb5a);
9820                         MP_WritePhyUshort(sc, 0x06, 0xf81e);
9821                         MP_WritePhyUshort(sc, 0x06, 0x20e6);
9822                         MP_WritePhyUshort(sc, 0x06, 0xe0ea);
9823                         MP_WritePhyUshort(sc, 0x06, 0xe5e0);
9824                         MP_WritePhyUshort(sc, 0x06, 0xebd3);
9825                         MP_WritePhyUshort(sc, 0x06, 0x05b3);
9826                         MP_WritePhyUshort(sc, 0x06, 0xfee2);
9827                         MP_WritePhyUshort(sc, 0x06, 0xe07c);
9828                         MP_WritePhyUshort(sc, 0x06, 0xe3e0);
9829                         MP_WritePhyUshort(sc, 0x06, 0x7dad);
9830                         MP_WritePhyUshort(sc, 0x06, 0x3703);
9831                         MP_WritePhyUshort(sc, 0x06, 0x7dff);
9832                         MP_WritePhyUshort(sc, 0x06, 0xff0d);
9833                         MP_WritePhyUshort(sc, 0x06, 0x581c);
9834                         MP_WritePhyUshort(sc, 0x06, 0x55f8);
9835                         MP_WritePhyUshort(sc, 0x06, 0xef46);
9836                         MP_WritePhyUshort(sc, 0x06, 0x0282);
9837                         MP_WritePhyUshort(sc, 0x06, 0xc7ef);
9838                         MP_WritePhyUshort(sc, 0x06, 0x65ef);
9839                         MP_WritePhyUshort(sc, 0x06, 0x54fc);
9840                         MP_WritePhyUshort(sc, 0x06, 0xac30);
9841                         MP_WritePhyUshort(sc, 0x06, 0x2b11);
9842                         MP_WritePhyUshort(sc, 0x06, 0xa188);
9843                         MP_WritePhyUshort(sc, 0x06, 0xcabf);
9844                         MP_WritePhyUshort(sc, 0x06, 0x860e);
9845                         MP_WritePhyUshort(sc, 0x06, 0xef10);
9846                         MP_WritePhyUshort(sc, 0x06, 0x0c11);
9847                         MP_WritePhyUshort(sc, 0x06, 0x1a91);
9848                         MP_WritePhyUshort(sc, 0x06, 0xda19);
9849                         MP_WritePhyUshort(sc, 0x06, 0xdbf8);
9850                         MP_WritePhyUshort(sc, 0x06, 0xef46);
9851                         MP_WritePhyUshort(sc, 0x06, 0x021e);
9852                         MP_WritePhyUshort(sc, 0x06, 0x17ef);
9853                         MP_WritePhyUshort(sc, 0x06, 0x54fc);
9854                         MP_WritePhyUshort(sc, 0x06, 0xad30);
9855                         MP_WritePhyUshort(sc, 0x06, 0x0fef);
9856                         MP_WritePhyUshort(sc, 0x06, 0x5689);
9857                         MP_WritePhyUshort(sc, 0x06, 0xde19);
9858                         MP_WritePhyUshort(sc, 0x06, 0xdfe2);
9859                         MP_WritePhyUshort(sc, 0x06, 0x861f);
9860                         MP_WritePhyUshort(sc, 0x06, 0xbf86);
9861                         MP_WritePhyUshort(sc, 0x06, 0x161a);
9862                         MP_WritePhyUshort(sc, 0x06, 0x90de);
9863                         MP_WritePhyUshort(sc, 0x06, 0xfeef);
9864                         MP_WritePhyUshort(sc, 0x06, 0x96fe);
9865                         MP_WritePhyUshort(sc, 0x06, 0xfdfc);
9866                         MP_WritePhyUshort(sc, 0x06, 0x04ac);
9867                         MP_WritePhyUshort(sc, 0x06, 0x2707);
9868                         MP_WritePhyUshort(sc, 0x06, 0xac37);
9869                         MP_WritePhyUshort(sc, 0x06, 0x071a);
9870                         MP_WritePhyUshort(sc, 0x06, 0x54ae);
9871                         MP_WritePhyUshort(sc, 0x06, 0x11ac);
9872                         MP_WritePhyUshort(sc, 0x06, 0x3707);
9873                         MP_WritePhyUshort(sc, 0x06, 0xae00);
9874                         MP_WritePhyUshort(sc, 0x06, 0x1a54);
9875                         MP_WritePhyUshort(sc, 0x06, 0xac37);
9876                         MP_WritePhyUshort(sc, 0x06, 0x07d0);
9877                         MP_WritePhyUshort(sc, 0x06, 0x01d5);
9878                         MP_WritePhyUshort(sc, 0x06, 0xffff);
9879                         MP_WritePhyUshort(sc, 0x06, 0xae02);
9880                         MP_WritePhyUshort(sc, 0x06, 0xd000);
9881                         MP_WritePhyUshort(sc, 0x06, 0x04f8);
9882                         MP_WritePhyUshort(sc, 0x06, 0xe08b);
9883                         MP_WritePhyUshort(sc, 0x06, 0x83ad);
9884                         MP_WritePhyUshort(sc, 0x06, 0x2444);
9885                         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
9886                         MP_WritePhyUshort(sc, 0x06, 0x22e1);
9887                         MP_WritePhyUshort(sc, 0x06, 0xe023);
9888                         MP_WritePhyUshort(sc, 0x06, 0xad22);
9889                         MP_WritePhyUshort(sc, 0x06, 0x3be0);
9890                         MP_WritePhyUshort(sc, 0x06, 0x8abe);
9891                         MP_WritePhyUshort(sc, 0x06, 0xa000);
9892                         MP_WritePhyUshort(sc, 0x06, 0x0502);
9893                         MP_WritePhyUshort(sc, 0x06, 0x28de);
9894                         MP_WritePhyUshort(sc, 0x06, 0xae42);
9895                         MP_WritePhyUshort(sc, 0x06, 0xa001);
9896                         MP_WritePhyUshort(sc, 0x06, 0x0502);
9897                         MP_WritePhyUshort(sc, 0x06, 0x28f1);
9898                         MP_WritePhyUshort(sc, 0x06, 0xae3a);
9899                         MP_WritePhyUshort(sc, 0x06, 0xa002);
9900                         MP_WritePhyUshort(sc, 0x06, 0x0502);
9901                         MP_WritePhyUshort(sc, 0x06, 0x8344);
9902                         MP_WritePhyUshort(sc, 0x06, 0xae32);
9903                         MP_WritePhyUshort(sc, 0x06, 0xa003);
9904                         MP_WritePhyUshort(sc, 0x06, 0x0502);
9905                         MP_WritePhyUshort(sc, 0x06, 0x299a);
9906                         MP_WritePhyUshort(sc, 0x06, 0xae2a);
9907                         MP_WritePhyUshort(sc, 0x06, 0xa004);
9908                         MP_WritePhyUshort(sc, 0x06, 0x0502);
9909                         MP_WritePhyUshort(sc, 0x06, 0x29ae);
9910                         MP_WritePhyUshort(sc, 0x06, 0xae22);
9911                         MP_WritePhyUshort(sc, 0x06, 0xa005);
9912                         MP_WritePhyUshort(sc, 0x06, 0x0502);
9913                         MP_WritePhyUshort(sc, 0x06, 0x29d7);
9914                         MP_WritePhyUshort(sc, 0x06, 0xae1a);
9915                         MP_WritePhyUshort(sc, 0x06, 0xa006);
9916                         MP_WritePhyUshort(sc, 0x06, 0x0502);
9917                         MP_WritePhyUshort(sc, 0x06, 0x29fe);
9918                         MP_WritePhyUshort(sc, 0x06, 0xae12);
9919                         MP_WritePhyUshort(sc, 0x06, 0xee8a);
9920                         MP_WritePhyUshort(sc, 0x06, 0xc000);
9921                         MP_WritePhyUshort(sc, 0x06, 0xee8a);
9922                         MP_WritePhyUshort(sc, 0x06, 0xc100);
9923                         MP_WritePhyUshort(sc, 0x06, 0xee8a);
9924                         MP_WritePhyUshort(sc, 0x06, 0xc600);
9925                         MP_WritePhyUshort(sc, 0x06, 0xee8a);
9926                         MP_WritePhyUshort(sc, 0x06, 0xbe00);
9927                         MP_WritePhyUshort(sc, 0x06, 0xae00);
9928                         MP_WritePhyUshort(sc, 0x06, 0xfc04);
9929                         MP_WritePhyUshort(sc, 0x06, 0xf802);
9930                         MP_WritePhyUshort(sc, 0x06, 0x2a67);
9931                         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
9932                         MP_WritePhyUshort(sc, 0x06, 0x22e1);
9933                         MP_WritePhyUshort(sc, 0x06, 0xe023);
9934                         MP_WritePhyUshort(sc, 0x06, 0x0d06);
9935                         MP_WritePhyUshort(sc, 0x06, 0x5803);
9936                         MP_WritePhyUshort(sc, 0x06, 0xa002);
9937                         MP_WritePhyUshort(sc, 0x06, 0x02ae);
9938                         MP_WritePhyUshort(sc, 0x06, 0x2da0);
9939                         MP_WritePhyUshort(sc, 0x06, 0x0102);
9940                         MP_WritePhyUshort(sc, 0x06, 0xae2d);
9941                         MP_WritePhyUshort(sc, 0x06, 0xa000);
9942                         MP_WritePhyUshort(sc, 0x06, 0x4de0);
9943                         MP_WritePhyUshort(sc, 0x06, 0xe200);
9944                         MP_WritePhyUshort(sc, 0x06, 0xe1e2);
9945                         MP_WritePhyUshort(sc, 0x06, 0x01ad);
9946                         MP_WritePhyUshort(sc, 0x06, 0x2444);
9947                         MP_WritePhyUshort(sc, 0x06, 0xe08a);
9948                         MP_WritePhyUshort(sc, 0x06, 0xc2e4);
9949                         MP_WritePhyUshort(sc, 0x06, 0x8ac4);
9950                         MP_WritePhyUshort(sc, 0x06, 0xe08a);
9951                         MP_WritePhyUshort(sc, 0x06, 0xc3e4);
9952                         MP_WritePhyUshort(sc, 0x06, 0x8ac5);
9953                         MP_WritePhyUshort(sc, 0x06, 0xee8a);
9954                         MP_WritePhyUshort(sc, 0x06, 0xbe03);
9955                         MP_WritePhyUshort(sc, 0x06, 0xe08b);
9956                         MP_WritePhyUshort(sc, 0x06, 0x83ad);
9957                         MP_WritePhyUshort(sc, 0x06, 0x253a);
9958                         MP_WritePhyUshort(sc, 0x06, 0xee8a);
9959                         MP_WritePhyUshort(sc, 0x06, 0xbe05);
9960                         MP_WritePhyUshort(sc, 0x06, 0xae34);
9961                         MP_WritePhyUshort(sc, 0x06, 0xe08a);
9962                         MP_WritePhyUshort(sc, 0x06, 0xceae);
9963                         MP_WritePhyUshort(sc, 0x06, 0x03e0);
9964                         MP_WritePhyUshort(sc, 0x06, 0x8acf);
9965                         MP_WritePhyUshort(sc, 0x06, 0xe18a);
9966                         MP_WritePhyUshort(sc, 0x06, 0xc249);
9967                         MP_WritePhyUshort(sc, 0x06, 0x05e5);
9968                         MP_WritePhyUshort(sc, 0x06, 0x8ac4);
9969                         MP_WritePhyUshort(sc, 0x06, 0xe18a);
9970                         MP_WritePhyUshort(sc, 0x06, 0xc349);
9971                         MP_WritePhyUshort(sc, 0x06, 0x05e5);
9972                         MP_WritePhyUshort(sc, 0x06, 0x8ac5);
9973                         MP_WritePhyUshort(sc, 0x06, 0xee8a);
9974                         MP_WritePhyUshort(sc, 0x06, 0xbe05);
9975                         MP_WritePhyUshort(sc, 0x06, 0x022a);
9976                         MP_WritePhyUshort(sc, 0x06, 0xb6ac);
9977                         MP_WritePhyUshort(sc, 0x06, 0x2012);
9978                         MP_WritePhyUshort(sc, 0x06, 0x0283);
9979                         MP_WritePhyUshort(sc, 0x06, 0xbaac);
9980                         MP_WritePhyUshort(sc, 0x06, 0x200c);
9981                         MP_WritePhyUshort(sc, 0x06, 0xee8a);
9982                         MP_WritePhyUshort(sc, 0x06, 0xc100);
9983                         MP_WritePhyUshort(sc, 0x06, 0xee8a);
9984                         MP_WritePhyUshort(sc, 0x06, 0xc600);
9985                         MP_WritePhyUshort(sc, 0x06, 0xee8a);
9986                         MP_WritePhyUshort(sc, 0x06, 0xbe02);
9987                         MP_WritePhyUshort(sc, 0x06, 0xfc04);
9988                         MP_WritePhyUshort(sc, 0x06, 0xd000);
9989                         MP_WritePhyUshort(sc, 0x06, 0x0283);
9990                         MP_WritePhyUshort(sc, 0x06, 0xcc59);
9991                         MP_WritePhyUshort(sc, 0x06, 0x0f39);
9992                         MP_WritePhyUshort(sc, 0x06, 0x02aa);
9993                         MP_WritePhyUshort(sc, 0x06, 0x04d0);
9994                         MP_WritePhyUshort(sc, 0x06, 0x01ae);
9995                         MP_WritePhyUshort(sc, 0x06, 0x02d0);
9996                         MP_WritePhyUshort(sc, 0x06, 0x0004);
9997                         MP_WritePhyUshort(sc, 0x06, 0xf9fa);
9998                         MP_WritePhyUshort(sc, 0x06, 0xe2e2);
9999                         MP_WritePhyUshort(sc, 0x06, 0xd2e3);
10000                         MP_WritePhyUshort(sc, 0x06, 0xe2d3);
10001                         MP_WritePhyUshort(sc, 0x06, 0xf95a);
10002                         MP_WritePhyUshort(sc, 0x06, 0xf7e6);
10003                         MP_WritePhyUshort(sc, 0x06, 0xe2d2);
10004                         MP_WritePhyUshort(sc, 0x06, 0xe7e2);
10005                         MP_WritePhyUshort(sc, 0x06, 0xd3e2);
10006                         MP_WritePhyUshort(sc, 0x06, 0xe02c);
10007                         MP_WritePhyUshort(sc, 0x06, 0xe3e0);
10008                         MP_WritePhyUshort(sc, 0x06, 0x2df9);
10009                         MP_WritePhyUshort(sc, 0x06, 0x5be0);
10010                         MP_WritePhyUshort(sc, 0x06, 0x1e30);
10011                         MP_WritePhyUshort(sc, 0x06, 0xe6e0);
10012                         MP_WritePhyUshort(sc, 0x06, 0x2ce7);
10013                         MP_WritePhyUshort(sc, 0x06, 0xe02d);
10014                         MP_WritePhyUshort(sc, 0x06, 0xe2e2);
10015                         MP_WritePhyUshort(sc, 0x06, 0xcce3);
10016                         MP_WritePhyUshort(sc, 0x06, 0xe2cd);
10017                         MP_WritePhyUshort(sc, 0x06, 0xf95a);
10018                         MP_WritePhyUshort(sc, 0x06, 0x0f6a);
10019                         MP_WritePhyUshort(sc, 0x06, 0x50e6);
10020                         MP_WritePhyUshort(sc, 0x06, 0xe2cc);
10021                         MP_WritePhyUshort(sc, 0x06, 0xe7e2);
10022                         MP_WritePhyUshort(sc, 0x06, 0xcde0);
10023                         MP_WritePhyUshort(sc, 0x06, 0xe03c);
10024                         MP_WritePhyUshort(sc, 0x06, 0xe1e0);
10025                         MP_WritePhyUshort(sc, 0x06, 0x3def);
10026                         MP_WritePhyUshort(sc, 0x06, 0x64fd);
10027                         MP_WritePhyUshort(sc, 0x06, 0xe0e2);
10028                         MP_WritePhyUshort(sc, 0x06, 0xcce1);
10029                         MP_WritePhyUshort(sc, 0x06, 0xe2cd);
10030                         MP_WritePhyUshort(sc, 0x06, 0x580f);
10031                         MP_WritePhyUshort(sc, 0x06, 0x5af0);
10032                         MP_WritePhyUshort(sc, 0x06, 0x1e02);
10033                         MP_WritePhyUshort(sc, 0x06, 0xe4e2);
10034                         MP_WritePhyUshort(sc, 0x06, 0xcce5);
10035                         MP_WritePhyUshort(sc, 0x06, 0xe2cd);
10036                         MP_WritePhyUshort(sc, 0x06, 0xfde0);
10037                         MP_WritePhyUshort(sc, 0x06, 0xe02c);
10038                         MP_WritePhyUshort(sc, 0x06, 0xe1e0);
10039                         MP_WritePhyUshort(sc, 0x06, 0x2d59);
10040                         MP_WritePhyUshort(sc, 0x06, 0xe05b);
10041                         MP_WritePhyUshort(sc, 0x06, 0x1f1e);
10042                         MP_WritePhyUshort(sc, 0x06, 0x13e4);
10043                         MP_WritePhyUshort(sc, 0x06, 0xe02c);
10044                         MP_WritePhyUshort(sc, 0x06, 0xe5e0);
10045                         MP_WritePhyUshort(sc, 0x06, 0x2dfd);
10046                         MP_WritePhyUshort(sc, 0x06, 0xe0e2);
10047                         MP_WritePhyUshort(sc, 0x06, 0xd2e1);
10048                         MP_WritePhyUshort(sc, 0x06, 0xe2d3);
10049                         MP_WritePhyUshort(sc, 0x06, 0x58f7);
10050                         MP_WritePhyUshort(sc, 0x06, 0x5a08);
10051                         MP_WritePhyUshort(sc, 0x06, 0x1e02);
10052                         MP_WritePhyUshort(sc, 0x06, 0xe4e2);
10053                         MP_WritePhyUshort(sc, 0x06, 0xd2e5);
10054                         MP_WritePhyUshort(sc, 0x06, 0xe2d3);
10055                         MP_WritePhyUshort(sc, 0x06, 0xef46);
10056                         MP_WritePhyUshort(sc, 0x06, 0xfefd);
10057                         MP_WritePhyUshort(sc, 0x06, 0x04f8);
10058                         MP_WritePhyUshort(sc, 0x06, 0xf9fa);
10059                         MP_WritePhyUshort(sc, 0x06, 0xef69);
10060                         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
10061                         MP_WritePhyUshort(sc, 0x06, 0x22e1);
10062                         MP_WritePhyUshort(sc, 0x06, 0xe023);
10063                         MP_WritePhyUshort(sc, 0x06, 0x58c4);
10064                         MP_WritePhyUshort(sc, 0x06, 0xe18b);
10065                         MP_WritePhyUshort(sc, 0x06, 0x6e1f);
10066                         MP_WritePhyUshort(sc, 0x06, 0x109e);
10067                         MP_WritePhyUshort(sc, 0x06, 0x58e4);
10068                         MP_WritePhyUshort(sc, 0x06, 0x8b6e);
10069                         MP_WritePhyUshort(sc, 0x06, 0xad22);
10070                         MP_WritePhyUshort(sc, 0x06, 0x22ac);
10071                         MP_WritePhyUshort(sc, 0x06, 0x2755);
10072                         MP_WritePhyUshort(sc, 0x06, 0xac26);
10073                         MP_WritePhyUshort(sc, 0x06, 0x02ae);
10074                         MP_WritePhyUshort(sc, 0x06, 0x1ad1);
10075                         MP_WritePhyUshort(sc, 0x06, 0x06bf);
10076                         MP_WritePhyUshort(sc, 0x06, 0x3bba);
10077                         MP_WritePhyUshort(sc, 0x06, 0x022d);
10078                         MP_WritePhyUshort(sc, 0x06, 0xc1d1);
10079                         MP_WritePhyUshort(sc, 0x06, 0x07bf);
10080                         MP_WritePhyUshort(sc, 0x06, 0x3bbd);
10081                         MP_WritePhyUshort(sc, 0x06, 0x022d);
10082                         MP_WritePhyUshort(sc, 0x06, 0xc1d1);
10083                         MP_WritePhyUshort(sc, 0x06, 0x07bf);
10084                         MP_WritePhyUshort(sc, 0x06, 0x3bc0);
10085                         MP_WritePhyUshort(sc, 0x06, 0x022d);
10086                         MP_WritePhyUshort(sc, 0x06, 0xc1ae);
10087                         MP_WritePhyUshort(sc, 0x06, 0x30d1);
10088                         MP_WritePhyUshort(sc, 0x06, 0x03bf);
10089                         MP_WritePhyUshort(sc, 0x06, 0x3bc3);
10090                         MP_WritePhyUshort(sc, 0x06, 0x022d);
10091                         MP_WritePhyUshort(sc, 0x06, 0xc1d1);
10092                         MP_WritePhyUshort(sc, 0x06, 0x00bf);
10093                         MP_WritePhyUshort(sc, 0x06, 0x3bc6);
10094                         MP_WritePhyUshort(sc, 0x06, 0x022d);
10095                         MP_WritePhyUshort(sc, 0x06, 0xc1d1);
10096                         MP_WritePhyUshort(sc, 0x06, 0x00bf);
10097                         MP_WritePhyUshort(sc, 0x06, 0x84e9);
10098                         MP_WritePhyUshort(sc, 0x06, 0x022d);
10099                         MP_WritePhyUshort(sc, 0x06, 0xc1d1);
10100                         MP_WritePhyUshort(sc, 0x06, 0x0fbf);
10101                         MP_WritePhyUshort(sc, 0x06, 0x3bba);
10102                         MP_WritePhyUshort(sc, 0x06, 0x022d);
10103                         MP_WritePhyUshort(sc, 0x06, 0xc1d1);
10104                         MP_WritePhyUshort(sc, 0x06, 0x01bf);
10105                         MP_WritePhyUshort(sc, 0x06, 0x3bbd);
10106                         MP_WritePhyUshort(sc, 0x06, 0x022d);
10107                         MP_WritePhyUshort(sc, 0x06, 0xc1d1);
10108                         MP_WritePhyUshort(sc, 0x06, 0x01bf);
10109                         MP_WritePhyUshort(sc, 0x06, 0x3bc0);
10110                         MP_WritePhyUshort(sc, 0x06, 0x022d);
10111                         MP_WritePhyUshort(sc, 0x06, 0xc1ef);
10112                         MP_WritePhyUshort(sc, 0x06, 0x96fe);
10113                         MP_WritePhyUshort(sc, 0x06, 0xfdfc);
10114                         MP_WritePhyUshort(sc, 0x06, 0x04d1);
10115                         MP_WritePhyUshort(sc, 0x06, 0x00bf);
10116                         MP_WritePhyUshort(sc, 0x06, 0x3bc3);
10117                         MP_WritePhyUshort(sc, 0x06, 0x022d);
10118                         MP_WritePhyUshort(sc, 0x06, 0xc1d0);
10119                         MP_WritePhyUshort(sc, 0x06, 0x1102);
10120                         MP_WritePhyUshort(sc, 0x06, 0x2bfb);
10121                         MP_WritePhyUshort(sc, 0x06, 0x5903);
10122                         MP_WritePhyUshort(sc, 0x06, 0xef01);
10123                         MP_WritePhyUshort(sc, 0x06, 0xd100);
10124                         MP_WritePhyUshort(sc, 0x06, 0xa000);
10125                         MP_WritePhyUshort(sc, 0x06, 0x02d1);
10126                         MP_WritePhyUshort(sc, 0x06, 0x01bf);
10127                         MP_WritePhyUshort(sc, 0x06, 0x3bc6);
10128                         MP_WritePhyUshort(sc, 0x06, 0x022d);
10129                         MP_WritePhyUshort(sc, 0x06, 0xc1d1);
10130                         MP_WritePhyUshort(sc, 0x06, 0x11ad);
10131                         MP_WritePhyUshort(sc, 0x06, 0x2002);
10132                         MP_WritePhyUshort(sc, 0x06, 0x0c11);
10133                         MP_WritePhyUshort(sc, 0x06, 0xad21);
10134                         MP_WritePhyUshort(sc, 0x06, 0x020c);
10135                         MP_WritePhyUshort(sc, 0x06, 0x12bf);
10136                         MP_WritePhyUshort(sc, 0x06, 0x84e9);
10137                         MP_WritePhyUshort(sc, 0x06, 0x022d);
10138                         MP_WritePhyUshort(sc, 0x06, 0xc1ae);
10139                         MP_WritePhyUshort(sc, 0x06, 0xc870);
10140                         MP_WritePhyUshort(sc, 0x06, 0xe426);
10141                         MP_WritePhyUshort(sc, 0x06, 0x0284);
10142                         MP_WritePhyUshort(sc, 0x06, 0xf005);
10143                         MP_WritePhyUshort(sc, 0x06, 0xf8fa);
10144                         MP_WritePhyUshort(sc, 0x06, 0xef69);
10145                         MP_WritePhyUshort(sc, 0x06, 0xe0e2);
10146                         MP_WritePhyUshort(sc, 0x06, 0xfee1);
10147                         MP_WritePhyUshort(sc, 0x06, 0xe2ff);
10148                         MP_WritePhyUshort(sc, 0x06, 0xad2d);
10149                         MP_WritePhyUshort(sc, 0x06, 0x1ae0);
10150                         MP_WritePhyUshort(sc, 0x06, 0xe14e);
10151                         MP_WritePhyUshort(sc, 0x06, 0xe1e1);
10152                         MP_WritePhyUshort(sc, 0x06, 0x4fac);
10153                         MP_WritePhyUshort(sc, 0x06, 0x2d22);
10154                         MP_WritePhyUshort(sc, 0x06, 0xf603);
10155                         MP_WritePhyUshort(sc, 0x06, 0x0203);
10156                         MP_WritePhyUshort(sc, 0x06, 0x3bf7);
10157                         MP_WritePhyUshort(sc, 0x06, 0x03f7);
10158                         MP_WritePhyUshort(sc, 0x06, 0x06bf);
10159                         MP_WritePhyUshort(sc, 0x06, 0x85c4);
10160                         MP_WritePhyUshort(sc, 0x06, 0x022d);
10161                         MP_WritePhyUshort(sc, 0x06, 0x21ae);
10162                         MP_WritePhyUshort(sc, 0x06, 0x11e0);
10163                         MP_WritePhyUshort(sc, 0x06, 0xe14e);
10164                         MP_WritePhyUshort(sc, 0x06, 0xe1e1);
10165                         MP_WritePhyUshort(sc, 0x06, 0x4fad);
10166                         MP_WritePhyUshort(sc, 0x06, 0x2d08);
10167                         MP_WritePhyUshort(sc, 0x06, 0xbf85);
10168                         MP_WritePhyUshort(sc, 0x06, 0xcf02);
10169                         MP_WritePhyUshort(sc, 0x06, 0x2d21);
10170                         MP_WritePhyUshort(sc, 0x06, 0xf606);
10171                         MP_WritePhyUshort(sc, 0x06, 0xef96);
10172                         MP_WritePhyUshort(sc, 0x06, 0xfefc);
10173                         MP_WritePhyUshort(sc, 0x06, 0x04f8);
10174                         MP_WritePhyUshort(sc, 0x06, 0xfaef);
10175                         MP_WritePhyUshort(sc, 0x06, 0x6902);
10176                         MP_WritePhyUshort(sc, 0x06, 0x8561);
10177                         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
10178                         MP_WritePhyUshort(sc, 0x06, 0x00e1);
10179                         MP_WritePhyUshort(sc, 0x06, 0xe001);
10180                         MP_WritePhyUshort(sc, 0x06, 0xad27);
10181                         MP_WritePhyUshort(sc, 0x06, 0x1fd1);
10182                         MP_WritePhyUshort(sc, 0x06, 0x01bf);
10183                         MP_WritePhyUshort(sc, 0x06, 0x85be);
10184                         MP_WritePhyUshort(sc, 0x06, 0x022d);
10185                         MP_WritePhyUshort(sc, 0x06, 0xc1e0);
10186                         MP_WritePhyUshort(sc, 0x06, 0xe020);
10187                         MP_WritePhyUshort(sc, 0x06, 0xe1e0);
10188                         MP_WritePhyUshort(sc, 0x06, 0x21ad);
10189                         MP_WritePhyUshort(sc, 0x06, 0x200e);
10190                         MP_WritePhyUshort(sc, 0x06, 0xd100);
10191                         MP_WritePhyUshort(sc, 0x06, 0xbf85);
10192                         MP_WritePhyUshort(sc, 0x06, 0xbe02);
10193                         MP_WritePhyUshort(sc, 0x06, 0x2dc1);
10194                         MP_WritePhyUshort(sc, 0x06, 0xbf3b);
10195                         MP_WritePhyUshort(sc, 0x06, 0x9602);
10196                         MP_WritePhyUshort(sc, 0x06, 0x2d21);
10197                         MP_WritePhyUshort(sc, 0x06, 0xef96);
10198                         MP_WritePhyUshort(sc, 0x06, 0xfefc);
10199                         MP_WritePhyUshort(sc, 0x06, 0x04f8);
10200                         MP_WritePhyUshort(sc, 0x06, 0xf9fa);
10201                         MP_WritePhyUshort(sc, 0x06, 0xef69);
10202                         MP_WritePhyUshort(sc, 0x06, 0xe08b);
10203                         MP_WritePhyUshort(sc, 0x06, 0x87ad);
10204                         MP_WritePhyUshort(sc, 0x06, 0x204c);
10205                         MP_WritePhyUshort(sc, 0x06, 0xd200);
10206                         MP_WritePhyUshort(sc, 0x06, 0xe0e2);
10207                         MP_WritePhyUshort(sc, 0x06, 0x0058);
10208                         MP_WritePhyUshort(sc, 0x06, 0x010c);
10209                         MP_WritePhyUshort(sc, 0x06, 0x021e);
10210                         MP_WritePhyUshort(sc, 0x06, 0x20e0);
10211                         MP_WritePhyUshort(sc, 0x06, 0xe000);
10212                         MP_WritePhyUshort(sc, 0x06, 0x5810);
10213                         MP_WritePhyUshort(sc, 0x06, 0x1e20);
10214                         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
10215                         MP_WritePhyUshort(sc, 0x06, 0x3658);
10216                         MP_WritePhyUshort(sc, 0x06, 0x031e);
10217                         MP_WritePhyUshort(sc, 0x06, 0x20e0);
10218                         MP_WritePhyUshort(sc, 0x06, 0xe022);
10219                         MP_WritePhyUshort(sc, 0x06, 0xe1e0);
10220                         MP_WritePhyUshort(sc, 0x06, 0x2358);
10221                         MP_WritePhyUshort(sc, 0x06, 0xe01e);
10222                         MP_WritePhyUshort(sc, 0x06, 0x20e0);
10223                         MP_WritePhyUshort(sc, 0x06, 0x8b64);
10224                         MP_WritePhyUshort(sc, 0x06, 0x1f02);
10225                         MP_WritePhyUshort(sc, 0x06, 0x9e22);
10226                         MP_WritePhyUshort(sc, 0x06, 0xe68b);
10227                         MP_WritePhyUshort(sc, 0x06, 0x64ad);
10228                         MP_WritePhyUshort(sc, 0x06, 0x3214);
10229                         MP_WritePhyUshort(sc, 0x06, 0xad34);
10230                         MP_WritePhyUshort(sc, 0x06, 0x11ef);
10231                         MP_WritePhyUshort(sc, 0x06, 0x0258);
10232                         MP_WritePhyUshort(sc, 0x06, 0x039e);
10233                         MP_WritePhyUshort(sc, 0x06, 0x07ad);
10234                         MP_WritePhyUshort(sc, 0x06, 0x3508);
10235                         MP_WritePhyUshort(sc, 0x06, 0x5ac0);
10236                         MP_WritePhyUshort(sc, 0x06, 0x9f04);
10237                         MP_WritePhyUshort(sc, 0x06, 0xd101);
10238                         MP_WritePhyUshort(sc, 0x06, 0xae02);
10239                         MP_WritePhyUshort(sc, 0x06, 0xd100);
10240                         MP_WritePhyUshort(sc, 0x06, 0xbf85);
10241                         MP_WritePhyUshort(sc, 0x06, 0xc102);
10242                         MP_WritePhyUshort(sc, 0x06, 0x2dc1);
10243                         MP_WritePhyUshort(sc, 0x06, 0xef96);
10244                         MP_WritePhyUshort(sc, 0x06, 0xfefd);
10245                         MP_WritePhyUshort(sc, 0x06, 0xfc04);
10246                         MP_WritePhyUshort(sc, 0x06, 0x00e2);
10247                         MP_WritePhyUshort(sc, 0x06, 0x34cc);
10248                         MP_WritePhyUshort(sc, 0x06, 0xe200);
10249                         MP_WritePhyUshort(sc, 0x06, 0xa725);
10250                         MP_WritePhyUshort(sc, 0x06, 0xe50a);
10251                         MP_WritePhyUshort(sc, 0x06, 0x1de5);
10252                         MP_WritePhyUshort(sc, 0x06, 0x0a2c);
10253                         MP_WritePhyUshort(sc, 0x06, 0xe50a);
10254                         MP_WritePhyUshort(sc, 0x06, 0x6de5);
10255                         MP_WritePhyUshort(sc, 0x06, 0x0a1d);
10256                         MP_WritePhyUshort(sc, 0x06, 0xe50a);
10257                         MP_WritePhyUshort(sc, 0x06, 0x1ce5);
10258                         MP_WritePhyUshort(sc, 0x06, 0x0a2d);
10259                         MP_WritePhyUshort(sc, 0x06, 0xa755);
10260                         MP_WritePhyUshort(sc, 0x05, 0x8b64);
10261                         MP_WritePhyUshort(sc, 0x06, 0x0000);
10262                         MP_WritePhyUshort(sc, 0x05, 0x8b94);
10263                         MP_WritePhyUshort(sc, 0x06, 0x84ec);
10264                         Data = MP_ReadPhyUshort(sc, 0x01);
10265                         Data |= 0x0001;
10266                         MP_WritePhyUshort(sc, 0x01, Data);
10267                         MP_WritePhyUshort(sc, 0x00, 0x0005);
10268                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
10269                         MP_WritePhyUshort(sc, 0x1f, 0x0005);
10270                         for (i = 0; i < 200; i++) {
10271                                 DELAY(100);
10272                                 Data = MP_ReadPhyUshort(sc, 0x00);
10273                                 if (Data & 0x0080)
10274                                         break;
10275                         }
10276                         MP_WritePhyUshort(sc, 0x1f, 0x0007);
10277                         MP_WritePhyUshort(sc, 0x1e, 0x0023);
10278                         MP_WritePhyUshort(sc, 0x17, 0x0116);
10279                         MP_WritePhyUshort(sc, 0x1f, 0x0007);
10280                         MP_WritePhyUshort(sc, 0x1e, 0x0028);
10281                         MP_WritePhyUshort(sc, 0x15, 0x0010);
10282                         MP_WritePhyUshort(sc, 0x1f, 0x0007);
10283                         //MP_WritePhyUshort(sc, 0x1e, 0x0020);
10284                         //MP_WritePhyUshort(sc, 0x15, 0x0100);
10285                         MP_WritePhyUshort(sc, 0x1f, 0x0007);
10286                         MP_WritePhyUshort(sc, 0x1e, 0x0041);
10287                         MP_WritePhyUshort(sc, 0x15, 0x0802);
10288                         MP_WritePhyUshort(sc, 0x16, 0x2185);
10289                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
10290                 } else if (sc->re_type == MACFG_37) {
10291                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
10292                         MP_WritePhyUshort(sc, 0x00, 0x1800);
10293                         MP_WritePhyUshort(sc, 0x1f, 0x0007);
10294                         MP_WritePhyUshort(sc, 0x1e, 0x0023);
10295                         MP_WritePhyUshort(sc, 0x17, 0x0117);
10296                         MP_WritePhyUshort(sc, 0x1f, 0x0007);
10297                         MP_WritePhyUshort(sc, 0x1E, 0x002C);
10298                         MP_WritePhyUshort(sc, 0x1B, 0x5000);
10299                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
10300                         MP_WritePhyUshort(sc, 0x16, 0x4104);
10301                         for (i=0; i<200; i++) {
10302                                 DELAY(100);
10303                                 Data = MP_ReadPhyUshort(sc, 0x1E);
10304                                 Data &= 0x03FF;
10305                                 if (Data== 0x000C)
10306                                         break;
10307                         }
10308                         MP_WritePhyUshort(sc, 0x1f, 0x0005);
10309                         for (i=0; i<200; i++) {
10310                                 DELAY(100);
10311                                 Data = MP_ReadPhyUshort(sc, 0x07);
10312                                 if ((Data&0x0020)==0)
10313                                         break;
10314                         }
10315                         Data = MP_ReadPhyUshort(sc, 0x07);
10316                         if (Data & 0x0020) {
10317                                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
10318                                 MP_WritePhyUshort(sc, 0x1e, 0x00a1);
10319                                 MP_WritePhyUshort(sc, 0x17, 0x1000);
10320                                 MP_WritePhyUshort(sc, 0x17, 0x0000);
10321                                 MP_WritePhyUshort(sc, 0x17, 0x2000);
10322                                 MP_WritePhyUshort(sc, 0x1e, 0x002f);
10323                                 MP_WritePhyUshort(sc, 0x18, 0x9bfb);
10324                                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
10325                                 MP_WritePhyUshort(sc, 0x07, 0x0000);
10326                                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
10327                         }
10328                         MP_WritePhyUshort(sc, 0x1f, 0x0005);
10329                         MP_WritePhyUshort(sc, 0x05, 0xfff6);
10330                         MP_WritePhyUshort(sc, 0x06, 0x0080);
10331                         Data = MP_ReadPhyUshort(sc, 0x00);
10332                         Data &= ~0x0080;
10333                         MP_WritePhyUshort(sc, 0x00, Data);
10334                         MP_WritePhyUshort(sc, 0x1f, 0x0002);
10335                         Data = MP_ReadPhyUshort(sc, 0x08);
10336                         Data &= ~0x0080;
10337                         MP_WritePhyUshort(sc, 0x08, Data);
10338                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
10339                         MP_WritePhyUshort(sc, 0x1f, 0x0007);
10340                         MP_WritePhyUshort(sc, 0x1e, 0x0023);
10341                         MP_WritePhyUshort(sc, 0x16, 0x0306);
10342                         MP_WritePhyUshort(sc, 0x16, 0x0307);
10343                         MP_WritePhyUshort(sc, 0x15, 0x000e);
10344                         MP_WritePhyUshort(sc, 0x19, 0x000a);
10345                         MP_WritePhyUshort(sc, 0x15, 0x0010);
10346                         MP_WritePhyUshort(sc, 0x19, 0x0008);
10347                         MP_WritePhyUshort(sc, 0x15, 0x0018);
10348                         MP_WritePhyUshort(sc, 0x19, 0x4801);
10349                         MP_WritePhyUshort(sc, 0x15, 0x0019);
10350                         MP_WritePhyUshort(sc, 0x19, 0x6801);
10351                         MP_WritePhyUshort(sc, 0x15, 0x001a);
10352                         MP_WritePhyUshort(sc, 0x19, 0x66a1);
10353                         MP_WritePhyUshort(sc, 0x15, 0x001f);
10354                         MP_WritePhyUshort(sc, 0x19, 0x0000);
10355                         MP_WritePhyUshort(sc, 0x15, 0x0020);
10356                         MP_WritePhyUshort(sc, 0x19, 0x0000);
10357                         MP_WritePhyUshort(sc, 0x15, 0x0021);
10358                         MP_WritePhyUshort(sc, 0x19, 0x0000);
10359                         MP_WritePhyUshort(sc, 0x15, 0x0022);
10360                         MP_WritePhyUshort(sc, 0x19, 0x0000);
10361                         MP_WritePhyUshort(sc, 0x15, 0x0023);
10362                         MP_WritePhyUshort(sc, 0x19, 0x0000);
10363                         MP_WritePhyUshort(sc, 0x15, 0x0024);
10364                         MP_WritePhyUshort(sc, 0x19, 0x0000);
10365                         MP_WritePhyUshort(sc, 0x15, 0x0025);
10366                         MP_WritePhyUshort(sc, 0x19, 0x64a1);
10367                         MP_WritePhyUshort(sc, 0x15, 0x0026);
10368                         MP_WritePhyUshort(sc, 0x19, 0x40ea);
10369                         MP_WritePhyUshort(sc, 0x15, 0x0027);
10370                         MP_WritePhyUshort(sc, 0x19, 0x4503);
10371                         MP_WritePhyUshort(sc, 0x15, 0x0028);
10372                         MP_WritePhyUshort(sc, 0x19, 0x9f00);
10373                         MP_WritePhyUshort(sc, 0x15, 0x0029);
10374                         MP_WritePhyUshort(sc, 0x19, 0xa631);
10375                         MP_WritePhyUshort(sc, 0x15, 0x002a);
10376                         MP_WritePhyUshort(sc, 0x19, 0x9717);
10377                         MP_WritePhyUshort(sc, 0x15, 0x002b);
10378                         MP_WritePhyUshort(sc, 0x19, 0x302c);
10379                         MP_WritePhyUshort(sc, 0x15, 0x002c);
10380                         MP_WritePhyUshort(sc, 0x19, 0x4802);
10381                         MP_WritePhyUshort(sc, 0x15, 0x002d);
10382                         MP_WritePhyUshort(sc, 0x19, 0x58da);
10383                         MP_WritePhyUshort(sc, 0x15, 0x002e);
10384                         MP_WritePhyUshort(sc, 0x19, 0x400d);
10385                         MP_WritePhyUshort(sc, 0x15, 0x002f);
10386                         MP_WritePhyUshort(sc, 0x19, 0x4488);
10387                         MP_WritePhyUshort(sc, 0x15, 0x0030);
10388                         MP_WritePhyUshort(sc, 0x19, 0x9e00);
10389                         MP_WritePhyUshort(sc, 0x15, 0x0031);
10390                         MP_WritePhyUshort(sc, 0x19, 0x63c8);
10391                         MP_WritePhyUshort(sc, 0x15, 0x0032);
10392                         MP_WritePhyUshort(sc, 0x19, 0x6481);
10393                         MP_WritePhyUshort(sc, 0x15, 0x0033);
10394                         MP_WritePhyUshort(sc, 0x19, 0x0000);
10395                         MP_WritePhyUshort(sc, 0x15, 0x0034);
10396                         MP_WritePhyUshort(sc, 0x19, 0x0000);
10397                         MP_WritePhyUshort(sc, 0x15, 0x0035);
10398                         MP_WritePhyUshort(sc, 0x19, 0x0000);
10399                         MP_WritePhyUshort(sc, 0x15, 0x0036);
10400                         MP_WritePhyUshort(sc, 0x19, 0x0000);
10401                         MP_WritePhyUshort(sc, 0x15, 0x0037);
10402                         MP_WritePhyUshort(sc, 0x19, 0x0000);
10403                         MP_WritePhyUshort(sc, 0x15, 0x0038);
10404                         MP_WritePhyUshort(sc, 0x19, 0x0000);
10405                         MP_WritePhyUshort(sc, 0x15, 0x0039);
10406                         MP_WritePhyUshort(sc, 0x19, 0x0000);
10407                         MP_WritePhyUshort(sc, 0x15, 0x003a);
10408                         MP_WritePhyUshort(sc, 0x19, 0x0000);
10409                         MP_WritePhyUshort(sc, 0x15, 0x003b);
10410                         MP_WritePhyUshort(sc, 0x19, 0x63e8);
10411                         MP_WritePhyUshort(sc, 0x15, 0x003c);
10412                         MP_WritePhyUshort(sc, 0x19, 0x7d00);
10413                         MP_WritePhyUshort(sc, 0x15, 0x003d);
10414                         MP_WritePhyUshort(sc, 0x19, 0x59d4);
10415                         MP_WritePhyUshort(sc, 0x15, 0x003e);
10416                         MP_WritePhyUshort(sc, 0x19, 0x63f8);
10417                         MP_WritePhyUshort(sc, 0x15, 0x0040);
10418                         MP_WritePhyUshort(sc, 0x19, 0x64a1);
10419                         MP_WritePhyUshort(sc, 0x15, 0x0041);
10420                         MP_WritePhyUshort(sc, 0x19, 0x30de);
10421                         MP_WritePhyUshort(sc, 0x15, 0x0044);
10422                         MP_WritePhyUshort(sc, 0x19, 0x480f);
10423                         MP_WritePhyUshort(sc, 0x15, 0x0045);
10424                         MP_WritePhyUshort(sc, 0x19, 0x6800);
10425                         MP_WritePhyUshort(sc, 0x15, 0x0046);
10426                         MP_WritePhyUshort(sc, 0x19, 0x6680);
10427                         MP_WritePhyUshort(sc, 0x15, 0x0047);
10428                         MP_WritePhyUshort(sc, 0x19, 0x7c10);
10429                         MP_WritePhyUshort(sc, 0x15, 0x0048);
10430                         MP_WritePhyUshort(sc, 0x19, 0x63c8);
10431                         MP_WritePhyUshort(sc, 0x15, 0x0049);
10432                         MP_WritePhyUshort(sc, 0x19, 0x0000);
10433                         MP_WritePhyUshort(sc, 0x15, 0x004a);
10434                         MP_WritePhyUshort(sc, 0x19, 0x0000);
10435                         MP_WritePhyUshort(sc, 0x15, 0x004b);
10436                         MP_WritePhyUshort(sc, 0x19, 0x0000);
10437                         MP_WritePhyUshort(sc, 0x15, 0x004c);
10438                         MP_WritePhyUshort(sc, 0x19, 0x0000);
10439                         MP_WritePhyUshort(sc, 0x15, 0x004d);
10440                         MP_WritePhyUshort(sc, 0x19, 0x0000);
10441                         MP_WritePhyUshort(sc, 0x15, 0x004e);
10442                         MP_WritePhyUshort(sc, 0x19, 0x0000);
10443                         MP_WritePhyUshort(sc, 0x15, 0x004f);
10444                         MP_WritePhyUshort(sc, 0x19, 0x40ea);
10445                         MP_WritePhyUshort(sc, 0x15, 0x0050);
10446                         MP_WritePhyUshort(sc, 0x19, 0x4503);
10447                         MP_WritePhyUshort(sc, 0x15, 0x0051);
10448                         MP_WritePhyUshort(sc, 0x19, 0x58ca);
10449                         MP_WritePhyUshort(sc, 0x15, 0x0052);
10450                         MP_WritePhyUshort(sc, 0x19, 0x63c8);
10451                         MP_WritePhyUshort(sc, 0x15, 0x0053);
10452                         MP_WritePhyUshort(sc, 0x19, 0x63d8);
10453                         MP_WritePhyUshort(sc, 0x15, 0x0054);
10454                         MP_WritePhyUshort(sc, 0x19, 0x66a0);
10455                         MP_WritePhyUshort(sc, 0x15, 0x0055);
10456                         MP_WritePhyUshort(sc, 0x19, 0x9f00);
10457                         MP_WritePhyUshort(sc, 0x15, 0x0056);
10458                         MP_WritePhyUshort(sc, 0x19, 0x3000);
10459                         MP_WritePhyUshort(sc, 0x15, 0x00a1);
10460                         MP_WritePhyUshort(sc, 0x19, 0x3044);
10461                         MP_WritePhyUshort(sc, 0x15, 0x00ab);
10462                         MP_WritePhyUshort(sc, 0x19, 0x5820);
10463                         MP_WritePhyUshort(sc, 0x15, 0x00ac);
10464                         MP_WritePhyUshort(sc, 0x19, 0x5e04);
10465                         MP_WritePhyUshort(sc, 0x15, 0x00ad);
10466                         MP_WritePhyUshort(sc, 0x19, 0xb60c);
10467                         MP_WritePhyUshort(sc, 0x15, 0x00af);
10468                         MP_WritePhyUshort(sc, 0x19, 0x000a);
10469                         MP_WritePhyUshort(sc, 0x15, 0x00b2);
10470                         MP_WritePhyUshort(sc, 0x19, 0x30b9);
10471                         MP_WritePhyUshort(sc, 0x15, 0x00b9);
10472                         MP_WritePhyUshort(sc, 0x19, 0x4408);
10473                         MP_WritePhyUshort(sc, 0x15, 0x00ba);
10474                         MP_WritePhyUshort(sc, 0x19, 0x480b);
10475                         MP_WritePhyUshort(sc, 0x15, 0x00bb);
10476                         MP_WritePhyUshort(sc, 0x19, 0x5e00);
10477                         MP_WritePhyUshort(sc, 0x15, 0x00bc);
10478                         MP_WritePhyUshort(sc, 0x19, 0x405f);
10479                         MP_WritePhyUshort(sc, 0x15, 0x00bd);
10480                         MP_WritePhyUshort(sc, 0x19, 0x4448);
10481                         MP_WritePhyUshort(sc, 0x15, 0x00be);
10482                         MP_WritePhyUshort(sc, 0x19, 0x4020);
10483                         MP_WritePhyUshort(sc, 0x15, 0x00bf);
10484                         MP_WritePhyUshort(sc, 0x19, 0x4468);
10485                         MP_WritePhyUshort(sc, 0x15, 0x00c0);
10486                         MP_WritePhyUshort(sc, 0x19, 0x9c02);
10487                         MP_WritePhyUshort(sc, 0x15, 0x00c1);
10488                         MP_WritePhyUshort(sc, 0x19, 0x58a0);
10489                         MP_WritePhyUshort(sc, 0x15, 0x00c2);
10490                         MP_WritePhyUshort(sc, 0x19, 0xb605);
10491                         MP_WritePhyUshort(sc, 0x15, 0x00c3);
10492                         MP_WritePhyUshort(sc, 0x19, 0xc0d3);
10493                         MP_WritePhyUshort(sc, 0x15, 0x00c4);
10494                         MP_WritePhyUshort(sc, 0x19, 0x00e6);
10495                         MP_WritePhyUshort(sc, 0x15, 0x00c5);
10496                         MP_WritePhyUshort(sc, 0x19, 0xdaec);
10497                         MP_WritePhyUshort(sc, 0x15, 0x00c6);
10498                         MP_WritePhyUshort(sc, 0x19, 0x00fa);
10499                         MP_WritePhyUshort(sc, 0x15, 0x00c7);
10500                         MP_WritePhyUshort(sc, 0x19, 0x9df9);
10501                         MP_WritePhyUshort(sc, 0x15, 0x0112);
10502                         MP_WritePhyUshort(sc, 0x19, 0x6421);
10503                         MP_WritePhyUshort(sc, 0x15, 0x0113);
10504                         MP_WritePhyUshort(sc, 0x19, 0x7c08);
10505                         MP_WritePhyUshort(sc, 0x15, 0x0114);
10506                         MP_WritePhyUshort(sc, 0x19, 0x63f0);
10507                         MP_WritePhyUshort(sc, 0x15, 0x0115);
10508                         MP_WritePhyUshort(sc, 0x19, 0x4003);
10509                         MP_WritePhyUshort(sc, 0x15, 0x0116);
10510                         MP_WritePhyUshort(sc, 0x19, 0x4418);
10511                         MP_WritePhyUshort(sc, 0x15, 0x0117);
10512                         MP_WritePhyUshort(sc, 0x19, 0x9b00);
10513                         MP_WritePhyUshort(sc, 0x15, 0x0118);
10514                         MP_WritePhyUshort(sc, 0x19, 0x6461);
10515                         MP_WritePhyUshort(sc, 0x15, 0x0119);
10516                         MP_WritePhyUshort(sc, 0x19, 0x64e1);
10517                         MP_WritePhyUshort(sc, 0x15, 0x011a);
10518                         MP_WritePhyUshort(sc, 0x19, 0x0000);
10519                         MP_WritePhyUshort(sc, 0x15, 0x0150);
10520                         MP_WritePhyUshort(sc, 0x19, 0x7c80);
10521                         MP_WritePhyUshort(sc, 0x15, 0x0151);
10522                         MP_WritePhyUshort(sc, 0x19, 0x6461);
10523                         MP_WritePhyUshort(sc, 0x15, 0x0152);
10524                         MP_WritePhyUshort(sc, 0x19, 0x4003);
10525                         MP_WritePhyUshort(sc, 0x15, 0x0153);
10526                         MP_WritePhyUshort(sc, 0x19, 0x4540);
10527                         MP_WritePhyUshort(sc, 0x15, 0x0154);
10528                         MP_WritePhyUshort(sc, 0x19, 0x9f00);
10529                         MP_WritePhyUshort(sc, 0x15, 0x0155);
10530                         MP_WritePhyUshort(sc, 0x19, 0x9d00);
10531                         MP_WritePhyUshort(sc, 0x15, 0x0156);
10532                         MP_WritePhyUshort(sc, 0x19, 0x7c40);
10533                         MP_WritePhyUshort(sc, 0x15, 0x0157);
10534                         MP_WritePhyUshort(sc, 0x19, 0x6421);
10535                         MP_WritePhyUshort(sc, 0x15, 0x0158);
10536                         MP_WritePhyUshort(sc, 0x19, 0x7c80);
10537                         MP_WritePhyUshort(sc, 0x15, 0x0159);
10538                         MP_WritePhyUshort(sc, 0x19, 0x64a1);
10539                         MP_WritePhyUshort(sc, 0x15, 0x015a);
10540                         MP_WritePhyUshort(sc, 0x19, 0x30fe);
10541                         MP_WritePhyUshort(sc, 0x15, 0x02e7);
10542                         MP_WritePhyUshort(sc, 0x19, 0x0000);
10543                         MP_WritePhyUshort(sc, 0x15, 0x0329);
10544                         MP_WritePhyUshort(sc, 0x19, 0x7c00);
10545                         MP_WritePhyUshort(sc, 0x15, 0x0382);
10546                         MP_WritePhyUshort(sc, 0x19, 0x7c40);
10547                         MP_WritePhyUshort(sc, 0x15, 0x03bd);
10548                         MP_WritePhyUshort(sc, 0x19, 0x405e);
10549                         MP_WritePhyUshort(sc, 0x15, 0x03c9);
10550                         MP_WritePhyUshort(sc, 0x19, 0x7c00);
10551                         MP_WritePhyUshort(sc, 0x15, 0x03e3);
10552                         MP_WritePhyUshort(sc, 0x19, 0x7c00);
10553                         MP_WritePhyUshort(sc, 0x16, 0x0306);
10554                         MP_WritePhyUshort(sc, 0x16, 0x0300);
10555                         MP_WritePhyUshort(sc, 0x1f, 0x0005);
10556                         MP_WritePhyUshort(sc, 0x05, 0xfff6);
10557                         MP_WritePhyUshort(sc, 0x06, 0x0080);
10558                         MP_WritePhyUshort(sc, 0x05, 0x8000);
10559                         MP_WritePhyUshort(sc, 0x06, 0x0280);
10560                         MP_WritePhyUshort(sc, 0x06, 0x48f7);
10561                         MP_WritePhyUshort(sc, 0x06, 0x00e0);
10562                         MP_WritePhyUshort(sc, 0x06, 0xfff7);
10563                         MP_WritePhyUshort(sc, 0x06, 0xa080);
10564                         MP_WritePhyUshort(sc, 0x06, 0x02ae);
10565                         MP_WritePhyUshort(sc, 0x06, 0xf602);
10566                         MP_WritePhyUshort(sc, 0x06, 0x0200);
10567                         MP_WritePhyUshort(sc, 0x06, 0x0202);
10568                         MP_WritePhyUshort(sc, 0x06, 0x1102);
10569                         MP_WritePhyUshort(sc, 0x06, 0x0224);
10570                         MP_WritePhyUshort(sc, 0x06, 0x0202);
10571                         MP_WritePhyUshort(sc, 0x06, 0x3402);
10572                         MP_WritePhyUshort(sc, 0x06, 0x027f);
10573                         MP_WritePhyUshort(sc, 0x06, 0x0202);
10574                         MP_WritePhyUshort(sc, 0x06, 0x9202);
10575                         MP_WritePhyUshort(sc, 0x06, 0x8078);
10576                         MP_WritePhyUshort(sc, 0x06, 0xe08b);
10577                         MP_WritePhyUshort(sc, 0x06, 0x88e1);
10578                         MP_WritePhyUshort(sc, 0x06, 0x8b89);
10579                         MP_WritePhyUshort(sc, 0x06, 0x1e01);
10580                         MP_WritePhyUshort(sc, 0x06, 0xe18b);
10581                         MP_WritePhyUshort(sc, 0x06, 0x8a1e);
10582                         MP_WritePhyUshort(sc, 0x06, 0x01e1);
10583                         MP_WritePhyUshort(sc, 0x06, 0x8b8b);
10584                         MP_WritePhyUshort(sc, 0x06, 0x1e01);
10585                         MP_WritePhyUshort(sc, 0x06, 0xe18b);
10586                         MP_WritePhyUshort(sc, 0x06, 0x8c1e);
10587                         MP_WritePhyUshort(sc, 0x06, 0x01e1);
10588                         MP_WritePhyUshort(sc, 0x06, 0x8b8d);
10589                         MP_WritePhyUshort(sc, 0x06, 0x1e01);
10590                         MP_WritePhyUshort(sc, 0x06, 0xe18b);
10591                         MP_WritePhyUshort(sc, 0x06, 0x8e1e);
10592                         MP_WritePhyUshort(sc, 0x06, 0x01a0);
10593                         MP_WritePhyUshort(sc, 0x06, 0x00c7);
10594                         MP_WritePhyUshort(sc, 0x06, 0xaebb);
10595                         MP_WritePhyUshort(sc, 0x06, 0xee85);
10596                         MP_WritePhyUshort(sc, 0x06, 0x0000);
10597                         MP_WritePhyUshort(sc, 0x06, 0xd480);
10598                         MP_WritePhyUshort(sc, 0x06, 0xebe4);
10599                         MP_WritePhyUshort(sc, 0x06, 0x8b94);
10600                         MP_WritePhyUshort(sc, 0x06, 0xe58b);
10601                         MP_WritePhyUshort(sc, 0x06, 0x95bf);
10602                         MP_WritePhyUshort(sc, 0x06, 0x8b88);
10603                         MP_WritePhyUshort(sc, 0x06, 0xec00);
10604                         MP_WritePhyUshort(sc, 0x06, 0x19a9);
10605                         MP_WritePhyUshort(sc, 0x06, 0x8b90);
10606                         MP_WritePhyUshort(sc, 0x06, 0xf9ee);
10607                         MP_WritePhyUshort(sc, 0x06, 0xfff6);
10608                         MP_WritePhyUshort(sc, 0x06, 0x00ee);
10609                         MP_WritePhyUshort(sc, 0x06, 0xfff7);
10610                         MP_WritePhyUshort(sc, 0x06, 0xffe0);
10611                         MP_WritePhyUshort(sc, 0x06, 0xe140);
10612                         MP_WritePhyUshort(sc, 0x06, 0xe1e1);
10613                         MP_WritePhyUshort(sc, 0x06, 0x41f7);
10614                         MP_WritePhyUshort(sc, 0x06, 0x2ff6);
10615                         MP_WritePhyUshort(sc, 0x06, 0x28e4);
10616                         MP_WritePhyUshort(sc, 0x06, 0xe140);
10617                         MP_WritePhyUshort(sc, 0x06, 0xe5e1);
10618                         MP_WritePhyUshort(sc, 0x06, 0x4104);
10619                         MP_WritePhyUshort(sc, 0x06, 0xf8e0);
10620                         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
10621                         MP_WritePhyUshort(sc, 0x06, 0xad20);
10622                         MP_WritePhyUshort(sc, 0x06, 0x11f6);
10623                         MP_WritePhyUshort(sc, 0x06, 0x20e4);
10624                         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
10625                         MP_WritePhyUshort(sc, 0x06, 0x0280);
10626                         MP_WritePhyUshort(sc, 0x06, 0xba02);
10627                         MP_WritePhyUshort(sc, 0x06, 0x1bf4);
10628                         MP_WritePhyUshort(sc, 0x06, 0x022c);
10629                         MP_WritePhyUshort(sc, 0x06, 0x9c02);
10630                         MP_WritePhyUshort(sc, 0x06, 0x812c);
10631                         MP_WritePhyUshort(sc, 0x06, 0xad22);
10632                         MP_WritePhyUshort(sc, 0x06, 0x11f6);
10633                         MP_WritePhyUshort(sc, 0x06, 0x22e4);
10634                         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
10635                         MP_WritePhyUshort(sc, 0x06, 0x022c);
10636                         MP_WritePhyUshort(sc, 0x06, 0x4602);
10637                         MP_WritePhyUshort(sc, 0x06, 0x2ac5);
10638                         MP_WritePhyUshort(sc, 0x06, 0x0229);
10639                         MP_WritePhyUshort(sc, 0x06, 0x2002);
10640                         MP_WritePhyUshort(sc, 0x06, 0x2b91);
10641                         MP_WritePhyUshort(sc, 0x06, 0xad25);
10642                         MP_WritePhyUshort(sc, 0x06, 0x11f6);
10643                         MP_WritePhyUshort(sc, 0x06, 0x25e4);
10644                         MP_WritePhyUshort(sc, 0x06, 0x8b8e);
10645                         MP_WritePhyUshort(sc, 0x06, 0x0203);
10646                         MP_WritePhyUshort(sc, 0x06, 0x5a02);
10647                         MP_WritePhyUshort(sc, 0x06, 0x043a);
10648                         MP_WritePhyUshort(sc, 0x06, 0x021a);
10649                         MP_WritePhyUshort(sc, 0x06, 0x5902);
10650                         MP_WritePhyUshort(sc, 0x06, 0x2bfc);
10651                         MP_WritePhyUshort(sc, 0x06, 0xfc04);
10652                         MP_WritePhyUshort(sc, 0x06, 0xf8fa);
10653                         MP_WritePhyUshort(sc, 0x06, 0xef69);
10654                         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
10655                         MP_WritePhyUshort(sc, 0x06, 0x00e1);
10656                         MP_WritePhyUshort(sc, 0x06, 0xe001);
10657                         MP_WritePhyUshort(sc, 0x06, 0xad27);
10658                         MP_WritePhyUshort(sc, 0x06, 0x1fd1);
10659                         MP_WritePhyUshort(sc, 0x06, 0x01bf);
10660                         MP_WritePhyUshort(sc, 0x06, 0x819f);
10661                         MP_WritePhyUshort(sc, 0x06, 0x022f);
10662                         MP_WritePhyUshort(sc, 0x06, 0x50e0);
10663                         MP_WritePhyUshort(sc, 0x06, 0xe020);
10664                         MP_WritePhyUshort(sc, 0x06, 0xe1e0);
10665                         MP_WritePhyUshort(sc, 0x06, 0x21ad);
10666                         MP_WritePhyUshort(sc, 0x06, 0x200e);
10667                         MP_WritePhyUshort(sc, 0x06, 0xd100);
10668                         MP_WritePhyUshort(sc, 0x06, 0xbf81);
10669                         MP_WritePhyUshort(sc, 0x06, 0x9f02);
10670                         MP_WritePhyUshort(sc, 0x06, 0x2f50);
10671                         MP_WritePhyUshort(sc, 0x06, 0xbf3d);
10672                         MP_WritePhyUshort(sc, 0x06, 0x3902);
10673                         MP_WritePhyUshort(sc, 0x06, 0x2eb0);
10674                         MP_WritePhyUshort(sc, 0x06, 0xef96);
10675                         MP_WritePhyUshort(sc, 0x06, 0xfefc);
10676                         MP_WritePhyUshort(sc, 0x06, 0x0402);
10677                         MP_WritePhyUshort(sc, 0x06, 0x80ef);
10678                         MP_WritePhyUshort(sc, 0x06, 0x05f8);
10679                         MP_WritePhyUshort(sc, 0x06, 0xfaef);
10680                         MP_WritePhyUshort(sc, 0x06, 0x69e0);
10681                         MP_WritePhyUshort(sc, 0x06, 0xe2fe);
10682                         MP_WritePhyUshort(sc, 0x06, 0xe1e2);
10683                         MP_WritePhyUshort(sc, 0x06, 0xffad);
10684                         MP_WritePhyUshort(sc, 0x06, 0x2d1a);
10685                         MP_WritePhyUshort(sc, 0x06, 0xe0e1);
10686                         MP_WritePhyUshort(sc, 0x06, 0x4ee1);
10687                         MP_WritePhyUshort(sc, 0x06, 0xe14f);
10688                         MP_WritePhyUshort(sc, 0x06, 0xac2d);
10689                         MP_WritePhyUshort(sc, 0x06, 0x22f6);
10690                         MP_WritePhyUshort(sc, 0x06, 0x0302);
10691                         MP_WritePhyUshort(sc, 0x06, 0x0336);
10692                         MP_WritePhyUshort(sc, 0x06, 0xf703);
10693                         MP_WritePhyUshort(sc, 0x06, 0xf706);
10694                         MP_WritePhyUshort(sc, 0x06, 0xbf81);
10695                         MP_WritePhyUshort(sc, 0x06, 0x8902);
10696                         MP_WritePhyUshort(sc, 0x06, 0x2eb0);
10697                         MP_WritePhyUshort(sc, 0x06, 0xae11);
10698                         MP_WritePhyUshort(sc, 0x06, 0xe0e1);
10699                         MP_WritePhyUshort(sc, 0x06, 0x4ee1);
10700                         MP_WritePhyUshort(sc, 0x06, 0xe14f);
10701                         MP_WritePhyUshort(sc, 0x06, 0xad2d);
10702                         MP_WritePhyUshort(sc, 0x06, 0x08bf);
10703                         MP_WritePhyUshort(sc, 0x06, 0x8194);
10704                         MP_WritePhyUshort(sc, 0x06, 0x022e);
10705                         MP_WritePhyUshort(sc, 0x06, 0xb0f6);
10706                         MP_WritePhyUshort(sc, 0x06, 0x06ef);
10707                         MP_WritePhyUshort(sc, 0x06, 0x96fe);
10708                         MP_WritePhyUshort(sc, 0x06, 0xfc04);
10709                         MP_WritePhyUshort(sc, 0x06, 0xf8f9);
10710                         MP_WritePhyUshort(sc, 0x06, 0xfaef);
10711                         MP_WritePhyUshort(sc, 0x06, 0x69e0);
10712                         MP_WritePhyUshort(sc, 0x06, 0x8b87);
10713                         MP_WritePhyUshort(sc, 0x06, 0xad20);
10714                         MP_WritePhyUshort(sc, 0x06, 0x4cd2);
10715                         MP_WritePhyUshort(sc, 0x06, 0x00e0);
10716                         MP_WritePhyUshort(sc, 0x06, 0xe200);
10717                         MP_WritePhyUshort(sc, 0x06, 0x5801);
10718                         MP_WritePhyUshort(sc, 0x06, 0x0c02);
10719                         MP_WritePhyUshort(sc, 0x06, 0x1e20);
10720                         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
10721                         MP_WritePhyUshort(sc, 0x06, 0x0058);
10722                         MP_WritePhyUshort(sc, 0x06, 0x101e);
10723                         MP_WritePhyUshort(sc, 0x06, 0x20e0);
10724                         MP_WritePhyUshort(sc, 0x06, 0xe036);
10725                         MP_WritePhyUshort(sc, 0x06, 0x5803);
10726                         MP_WritePhyUshort(sc, 0x06, 0x1e20);
10727                         MP_WritePhyUshort(sc, 0x06, 0xe0e0);
10728                         MP_WritePhyUshort(sc, 0x06, 0x22e1);
10729                         MP_WritePhyUshort(sc, 0x06, 0xe023);
10730                         MP_WritePhyUshort(sc, 0x06, 0x58e0);
10731                         MP_WritePhyUshort(sc, 0x06, 0x1e20);
10732                         MP_WritePhyUshort(sc, 0x06, 0xe085);
10733                         MP_WritePhyUshort(sc, 0x06, 0x001f);
10734                         MP_WritePhyUshort(sc, 0x06, 0x029e);
10735                         MP_WritePhyUshort(sc, 0x06, 0x22e6);
10736                         MP_WritePhyUshort(sc, 0x06, 0x8500);
10737                         MP_WritePhyUshort(sc, 0x06, 0xad32);
10738                         MP_WritePhyUshort(sc, 0x06, 0x14ad);
10739                         MP_WritePhyUshort(sc, 0x06, 0x3411);
10740                         MP_WritePhyUshort(sc, 0x06, 0xef02);
10741                         MP_WritePhyUshort(sc, 0x06, 0x5803);
10742                         MP_WritePhyUshort(sc, 0x06, 0x9e07);
10743                         MP_WritePhyUshort(sc, 0x06, 0xad35);
10744                         MP_WritePhyUshort(sc, 0x06, 0x085a);
10745                         MP_WritePhyUshort(sc, 0x06, 0xc09f);
10746                         MP_WritePhyUshort(sc, 0x06, 0x04d1);
10747                         MP_WritePhyUshort(sc, 0x06, 0x01ae);
10748                         MP_WritePhyUshort(sc, 0x06, 0x02d1);
10749                         MP_WritePhyUshort(sc, 0x06, 0x00bf);
10750                         MP_WritePhyUshort(sc, 0x06, 0x81a5);
10751                         MP_WritePhyUshort(sc, 0x06, 0x022f);
10752                         MP_WritePhyUshort(sc, 0x06, 0x50ef);
10753                         MP_WritePhyUshort(sc, 0x06, 0x96fe);
10754                         MP_WritePhyUshort(sc, 0x06, 0xfdfc);
10755                         MP_WritePhyUshort(sc, 0x06, 0x04a7);
10756                         MP_WritePhyUshort(sc, 0x06, 0x25e5);
10757                         MP_WritePhyUshort(sc, 0x06, 0x0a1d);
10758                         MP_WritePhyUshort(sc, 0x06, 0xe50a);
10759                         MP_WritePhyUshort(sc, 0x06, 0x2ce5);
10760                         MP_WritePhyUshort(sc, 0x06, 0x0a6d);
10761                         MP_WritePhyUshort(sc, 0x06, 0xe50a);
10762                         MP_WritePhyUshort(sc, 0x06, 0x1de5);
10763                         MP_WritePhyUshort(sc, 0x06, 0x0a1c);
10764                         MP_WritePhyUshort(sc, 0x06, 0xe50a);
10765                         MP_WritePhyUshort(sc, 0x06, 0x2da7);
10766                         MP_WritePhyUshort(sc, 0x06, 0x5500);
10767                         MP_WritePhyUshort(sc, 0x06, 0xe234);
10768                         MP_WritePhyUshort(sc, 0x06, 0x88e2);
10769                         MP_WritePhyUshort(sc, 0x06, 0x00cc);
10770                         MP_WritePhyUshort(sc, 0x06, 0xe200);
10771                         MP_WritePhyUshort(sc, 0x05, 0x8b86);
10772                         MP_WritePhyUshort(sc, 0x06, 0x0001);
10773                         Data = MP_ReadPhyUshort(sc, 0x01);
10774                         Data |= 0x0001;
10775                         MP_WritePhyUshort(sc, 0x01, Data);
10776                         MP_WritePhyUshort(sc, 0x00, 0x0005);
10777                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
10778                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
10779                         MP_WritePhyUshort(sc, 0x17, 0x2179);
10780                         MP_WritePhyUshort(sc, 0x1f, 0x0001);
10781                         MP_WritePhyUshort(sc, 0x10, 0xf274);
10782                         MP_WritePhyUshort(sc, 0x1f, 0x0007);
10783                         MP_WritePhyUshort(sc, 0x1e, 0x0042);
10784                         MP_WritePhyUshort(sc, 0x15, 0x0f00);
10785                         MP_WritePhyUshort(sc, 0x15, 0x0f00);
10786                         MP_WritePhyUshort(sc, 0x16, 0x7408);
10787                         MP_WritePhyUshort(sc, 0x15, 0x0e00);
10788                         MP_WritePhyUshort(sc, 0x15, 0x0f00);
10789                         MP_WritePhyUshort(sc, 0x15, 0x0f01);
10790                         MP_WritePhyUshort(sc, 0x16, 0x4000);
10791                         MP_WritePhyUshort(sc, 0x15, 0x0e01);
10792                         MP_WritePhyUshort(sc, 0x15, 0x0f01);
10793                         MP_WritePhyUshort(sc, 0x15, 0x0f02);
10794                         MP_WritePhyUshort(sc, 0x16, 0x9400);
10795                         MP_WritePhyUshort(sc, 0x15, 0x0e02);
10796                         MP_WritePhyUshort(sc, 0x15, 0x0f02);
10797                         MP_WritePhyUshort(sc, 0x15, 0x0f03);
10798                         MP_WritePhyUshort(sc, 0x16, 0x7408);
10799                         MP_WritePhyUshort(sc, 0x15, 0x0e03);
10800                         MP_WritePhyUshort(sc, 0x15, 0x0f03);
10801                         MP_WritePhyUshort(sc, 0x15, 0x0f04);
10802                         MP_WritePhyUshort(sc, 0x16, 0x4008);
10803                         MP_WritePhyUshort(sc, 0x15, 0x0e04);
10804                         MP_WritePhyUshort(sc, 0x15, 0x0f04);
10805                         MP_WritePhyUshort(sc, 0x15, 0x0f05);
10806                         MP_WritePhyUshort(sc, 0x16, 0x9400);
10807                         MP_WritePhyUshort(sc, 0x15, 0x0e05);
10808                         MP_WritePhyUshort(sc, 0x15, 0x0f05);
10809                         MP_WritePhyUshort(sc, 0x15, 0x0f06);
10810                         MP_WritePhyUshort(sc, 0x16, 0x0803);
10811                         MP_WritePhyUshort(sc, 0x15, 0x0e06);
10812                         MP_WritePhyUshort(sc, 0x15, 0x0f06);
10813                         MP_WritePhyUshort(sc, 0x15, 0x0d00);
10814                         MP_WritePhyUshort(sc, 0x15, 0x0100);
10815                         MP_WritePhyUshort(sc, 0x1f, 0x0001);
10816                         MP_WritePhyUshort(sc, 0x10, 0xf074);
10817                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
10818                         MP_WritePhyUshort(sc, 0x17, 0x2149);
10819                         MP_WritePhyUshort(sc, 0x1f, 0x0005);
10820                         for (i=0; i<200; i++) {
10821                                 DELAY(100);
10822                                 Data = MP_ReadPhyUshort(sc, 0x00);
10823                                 if (Data&0x0080)
10824                                         break;
10825                         }
10826                         MP_WritePhyUshort(sc, 0x1f, 0x0007);
10827                         MP_WritePhyUshort(sc, 0x1e, 0x0023);
10828                         MP_WritePhyUshort(sc, 0x17, 0x0116);
10829                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
10830                         MP_WritePhyUshort(sc, 0x1f, 0x0007);
10831                         MP_WritePhyUshort(sc, 0x1e, 0x0023);
10832                         Data = MP_ReadPhyUshort(sc, 0x17);
10833                         Data |= 0x4000;
10834                         MP_WritePhyUshort(sc, 0x17, Data);
10835                         MP_WritePhyUshort(sc, 0x1e, 0x0020);
10836                         Data = MP_ReadPhyUshort(sc, 0x1b);
10837                         Data |= 0x0080;
10838                         MP_WritePhyUshort(sc, 0x1b, Data);
10839                         MP_WritePhyUshort(sc, 0x1e, 0x0041);
10840                         MP_WritePhyUshort(sc, 0x15, 0x0e02);
10841                         MP_WritePhyUshort(sc, 0x1e, 0x0028);
10842                         Data = MP_ReadPhyUshort(sc, 0x19);
10843                         Data |= 0x8000;
10844                         MP_WritePhyUshort(sc, 0x19, Data);
10845                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
10846                 }
10847
10848                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
10849                 MP_WritePhyUshort(sc, 0x1E, 0x0023);
10850                 Data = MP_ReadPhyUshort(sc, 0x17) | 0x0006;
10851                 MP_WritePhyUshort(sc, 0x17, Data);
10852                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
10853
10854                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
10855                 MP_WritePhyUshort(sc, 0x05, 0x8b80);
10856                 MP_WritePhyUshort(sc, 0x06, 0xc896);
10857                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
10858
10859                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
10860                 MP_WritePhyUshort(sc, 0x0B, 0x6C20);
10861                 MP_WritePhyUshort(sc, 0x07, 0x2872);
10862                 MP_WritePhyUshort(sc, 0x1C, 0xEFFF);
10863                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
10864                 MP_WritePhyUshort(sc, 0x14, 0x6420);
10865                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
10866
10867                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
10868                 Data = MP_ReadPhyUshort(sc, 0x08) & 0x00FF;
10869                 MP_WritePhyUshort(sc, 0x08, Data | 0x8000);
10870
10871                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
10872                 MP_WritePhyUshort(sc, 0x1E, 0x002D);
10873                 Data = MP_ReadPhyUshort(sc, 0x18);
10874                 MP_WritePhyUshort(sc, 0x18, Data | 0x0050);
10875                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
10876                 Data = MP_ReadPhyUshort(sc, 0x14);
10877                 MP_WritePhyUshort(sc, 0x14, Data | 0x8000);
10878
10879                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
10880                 MP_WritePhyUshort(sc, 0x00, 0x080B);
10881                 MP_WritePhyUshort(sc, 0x0B, 0x09D7);
10882                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
10883                 MP_WritePhyUshort(sc, 0x15, 0x1006);
10884
10885                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
10886                 MP_WritePhyUshort(sc, 0x1E, 0x002F);
10887                 MP_WritePhyUshort(sc, 0x15, 0x1919);
10888                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
10889
10890                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
10891                 MP_WritePhyUshort(sc, 0x19, 0x7F46);
10892                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
10893                 MP_WritePhyUshort(sc, 0x05, 0x8AD2);
10894                 MP_WritePhyUshort(sc, 0x06, 0x6810);
10895                 MP_WritePhyUshort(sc, 0x05, 0x8AD4);
10896                 MP_WritePhyUshort(sc, 0x06, 0x8002);
10897                 MP_WritePhyUshort(sc, 0x05, 0x8ADE);
10898                 MP_WritePhyUshort(sc, 0x06, 0x8025);
10899                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
10900         } else if (sc->re_type == MACFG_38) {
10901                 CSR_WRITE_1(sc, 0x6E, CSR_READ_1(sc, 0x6E)| (1<<6));
10902
10903                 Data_u32 = re_eri_read(sc, 0x1D0, 4, ERIAR_ExGMAC);
10904                 Data_u32 &= ~BIT_1;
10905                 re_eri_write(sc, 0x1D0, 4, Data_u32, ERIAR_ExGMAC);
10906
10907                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
10908                 MP_WritePhyUshort(sc, 0x00, 0x1800);
10909                 Data= MP_ReadPhyUshort(sc, 0x15);
10910                 Data &= ~BIT_12;
10911                 MP_WritePhyUshort(sc, 0x15, Data);
10912                 DELAY(200);
10913                 DELAY(200);
10914                 MP_WritePhyUshort(sc, 0x1f, 0x0004);
10915                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
10916                 MP_WritePhyUshort(sc, 0x1e, 0x0023);
10917                 Data = MP_ReadPhyUshort(sc, 0x17);
10918                 if ((Data & BIT_11) == 0x0000) {
10919                         Data |= BIT_0;
10920                         MP_WritePhyUshort(sc, 0x17, Data);
10921                         for (i = 0; i < 200; i++) {
10922                                 DELAY(100);
10923                                 Data = MP_ReadPhyUshort(sc, 0x17);
10924                                 if (Data & BIT_11)
10925                                         break;
10926                         }
10927                 }
10928                 Data = MP_ReadPhyUshort(sc, 0x17);
10929                 Data |= BIT_11;
10930                 MP_WritePhyUshort(sc, 0x17,Data);
10931                 MP_WritePhyUshort(sc, 0x1f, 0x0004);
10932                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
10933                 MP_WritePhyUshort(sc, 0x1E, 0x002C);
10934                 MP_WritePhyUshort(sc, 0x1B, 0x5000);
10935                 MP_WritePhyUshort(sc, 0x1E, 0x002d);
10936                 MP_WritePhyUshort(sc, 0x19, 0x0004);
10937                 MP_WritePhyUshort(sc, 0x1f, 0x0002);
10938                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
10939                 for (i = 0; i < 200; i++) {
10940                         DELAY(100);
10941                         Data= MP_ReadPhyUshort(sc, 0x1E);
10942                         if ((Data& 0x03FF) == 0x0014)
10943                                 break;
10944                 }
10945                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
10946                 for (i = 0; i < 200; i++) {
10947                         DELAY(100);
10948                         Data= MP_ReadPhyUshort(sc, 0x07);
10949                         if ((Data& BIT_5) == 0)
10950                                 break;
10951                 }
10952                 Data = MP_ReadPhyUshort(sc, 0x07);
10953                 if (Data & BIT_5) {
10954                         MP_WritePhyUshort(sc, 0x1f, 0x0004);
10955                         MP_WritePhyUshort(sc, 0x1f, 0x0007);
10956                         MP_WritePhyUshort(sc, 0x1e, 0x00a1);
10957                         MP_WritePhyUshort(sc, 0x17, 0x1000);
10958                         MP_WritePhyUshort(sc, 0x17, 0x0000);
10959                         MP_WritePhyUshort(sc, 0x17, 0x2000);
10960                         MP_WritePhyUshort(sc, 0x1e, 0x002f);
10961                         MP_WritePhyUshort(sc, 0x18, 0x9bfb);
10962                         MP_WritePhyUshort(sc, 0x1f, 0x0005);
10963                         MP_WritePhyUshort(sc, 0x07, 0x0000);
10964                         MP_WritePhyUshort(sc, 0x1f, 0x0002);
10965                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
10966                 }
10967                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
10968                 MP_WritePhyUshort(sc, 0x05, 0xfff6);
10969                 MP_WritePhyUshort(sc, 0x06, 0x0080);
10970                 Data = MP_ReadPhyUshort(sc, 0x00);
10971                 Data &= ~BIT_7;
10972                 MP_WritePhyUshort(sc, 0x00, Data);
10973                 MP_WritePhyUshort(sc, 0x1f, 0x0004);
10974                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
10975                 MP_WritePhyUshort(sc, 0x1e, 0x0023);
10976                 MP_WritePhyUshort(sc, 0x16, 0x0306);
10977                 MP_WritePhyUshort(sc, 0x16, 0x0307);
10978                 MP_WritePhyUshort(sc, 0x15, 0x0000);
10979                 MP_WritePhyUshort(sc, 0x19, 0x407d);
10980                 MP_WritePhyUshort(sc, 0x15, 0x0001);
10981                 MP_WritePhyUshort(sc, 0x19, 0x440f);
10982                 MP_WritePhyUshort(sc, 0x15, 0x0002);
10983                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
10984                 MP_WritePhyUshort(sc, 0x15, 0x0003);
10985                 MP_WritePhyUshort(sc, 0x19, 0x6c03);
10986                 MP_WritePhyUshort(sc, 0x15, 0x0004);
10987                 MP_WritePhyUshort(sc, 0x19, 0xc4d5);
10988                 MP_WritePhyUshort(sc, 0x15, 0x0005);
10989                 MP_WritePhyUshort(sc, 0x19, 0x00ff);
10990                 MP_WritePhyUshort(sc, 0x15, 0x0006);
10991                 MP_WritePhyUshort(sc, 0x19, 0x74f0);
10992                 MP_WritePhyUshort(sc, 0x15, 0x0007);
10993                 MP_WritePhyUshort(sc, 0x19, 0x4880);
10994                 MP_WritePhyUshort(sc, 0x15, 0x0008);
10995                 MP_WritePhyUshort(sc, 0x19, 0x4c00);
10996                 MP_WritePhyUshort(sc, 0x15, 0x0009);
10997                 MP_WritePhyUshort(sc, 0x19, 0x4800);
10998                 MP_WritePhyUshort(sc, 0x15, 0x000a);
10999                 MP_WritePhyUshort(sc, 0x19, 0x5000);
11000                 MP_WritePhyUshort(sc, 0x15, 0x000b);
11001                 MP_WritePhyUshort(sc, 0x19, 0x4400);
11002                 MP_WritePhyUshort(sc, 0x15, 0x000c);
11003                 MP_WritePhyUshort(sc, 0x19, 0x7801);
11004                 MP_WritePhyUshort(sc, 0x15, 0x000d);
11005                 MP_WritePhyUshort(sc, 0x19, 0x4000);
11006                 MP_WritePhyUshort(sc, 0x15, 0x000e);
11007                 MP_WritePhyUshort(sc, 0x19, 0x7800);
11008                 MP_WritePhyUshort(sc, 0x15, 0x000f);
11009                 MP_WritePhyUshort(sc, 0x19, 0x7010);
11010                 MP_WritePhyUshort(sc, 0x15, 0x0010);
11011                 MP_WritePhyUshort(sc, 0x19, 0x6804);
11012                 MP_WritePhyUshort(sc, 0x15, 0x0011);
11013                 MP_WritePhyUshort(sc, 0x19, 0x64a0);
11014                 MP_WritePhyUshort(sc, 0x15, 0x0012);
11015                 MP_WritePhyUshort(sc, 0x19, 0x63da);
11016                 MP_WritePhyUshort(sc, 0x15, 0x0013);
11017                 MP_WritePhyUshort(sc, 0x19, 0x63d8);
11018                 MP_WritePhyUshort(sc, 0x15, 0x0014);
11019                 MP_WritePhyUshort(sc, 0x19, 0x6f05);
11020                 MP_WritePhyUshort(sc, 0x15, 0x0015);
11021                 MP_WritePhyUshort(sc, 0x19, 0x5420);
11022                 MP_WritePhyUshort(sc, 0x15, 0x0016);
11023                 MP_WritePhyUshort(sc, 0x19, 0x58ce);
11024                 MP_WritePhyUshort(sc, 0x15, 0x0017);
11025                 MP_WritePhyUshort(sc, 0x19, 0x5cf3);
11026                 MP_WritePhyUshort(sc, 0x15, 0x0018);
11027                 MP_WritePhyUshort(sc, 0x19, 0xb600);
11028                 MP_WritePhyUshort(sc, 0x15, 0x0019);
11029                 MP_WritePhyUshort(sc, 0x19, 0xc659);
11030                 MP_WritePhyUshort(sc, 0x15, 0x001a);
11031                 MP_WritePhyUshort(sc, 0x19, 0x0018);
11032                 MP_WritePhyUshort(sc, 0x15, 0x001b);
11033                 MP_WritePhyUshort(sc, 0x19, 0xc403);
11034                 MP_WritePhyUshort(sc, 0x15, 0x001c);
11035                 MP_WritePhyUshort(sc, 0x19, 0x0016);
11036                 MP_WritePhyUshort(sc, 0x15, 0x001d);
11037                 MP_WritePhyUshort(sc, 0x19, 0xaa05);
11038                 MP_WritePhyUshort(sc, 0x15, 0x001e);
11039                 MP_WritePhyUshort(sc, 0x19, 0xc503);
11040                 MP_WritePhyUshort(sc, 0x15, 0x001f);
11041                 MP_WritePhyUshort(sc, 0x19, 0x0003);
11042                 MP_WritePhyUshort(sc, 0x15, 0x0020);
11043                 MP_WritePhyUshort(sc, 0x19, 0x89f8);
11044                 MP_WritePhyUshort(sc, 0x15, 0x0021);
11045                 MP_WritePhyUshort(sc, 0x19, 0x32ae);
11046                 MP_WritePhyUshort(sc, 0x15, 0x0022);
11047                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
11048                 MP_WritePhyUshort(sc, 0x15, 0x0023);
11049                 MP_WritePhyUshort(sc, 0x19, 0x6c03);
11050                 MP_WritePhyUshort(sc, 0x15, 0x0024);
11051                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
11052                 MP_WritePhyUshort(sc, 0x15, 0x0025);
11053                 MP_WritePhyUshort(sc, 0x19, 0x6801);
11054                 MP_WritePhyUshort(sc, 0x15, 0x0026);
11055                 MP_WritePhyUshort(sc, 0x19, 0x66a0);
11056                 MP_WritePhyUshort(sc, 0x15, 0x0027);
11057                 MP_WritePhyUshort(sc, 0x19, 0xa300);
11058                 MP_WritePhyUshort(sc, 0x15, 0x0028);
11059                 MP_WritePhyUshort(sc, 0x19, 0x64a0);
11060                 MP_WritePhyUshort(sc, 0x15, 0x0029);
11061                 MP_WritePhyUshort(sc, 0x19, 0x76f0);
11062                 MP_WritePhyUshort(sc, 0x15, 0x002a);
11063                 MP_WritePhyUshort(sc, 0x19, 0x7670);
11064                 MP_WritePhyUshort(sc, 0x15, 0x002b);
11065                 MP_WritePhyUshort(sc, 0x19, 0x7630);
11066                 MP_WritePhyUshort(sc, 0x15, 0x002c);
11067                 MP_WritePhyUshort(sc, 0x19, 0x31a6);
11068                 MP_WritePhyUshort(sc, 0x15, 0x002d);
11069                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11070                 MP_WritePhyUshort(sc, 0x15, 0x002e);
11071                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11072                 MP_WritePhyUshort(sc, 0x15, 0x002f);
11073                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11074                 MP_WritePhyUshort(sc, 0x15, 0x0030);
11075                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11076                 MP_WritePhyUshort(sc, 0x15, 0x0031);
11077                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11078                 MP_WritePhyUshort(sc, 0x15, 0x0032);
11079                 MP_WritePhyUshort(sc, 0x19, 0x4801);
11080                 MP_WritePhyUshort(sc, 0x15, 0x0033);
11081                 MP_WritePhyUshort(sc, 0x19, 0x6803);
11082                 MP_WritePhyUshort(sc, 0x15, 0x0034);
11083                 MP_WritePhyUshort(sc, 0x19, 0x66a1);
11084                 MP_WritePhyUshort(sc, 0x15, 0x0035);
11085                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
11086                 MP_WritePhyUshort(sc, 0x15, 0x0036);
11087                 MP_WritePhyUshort(sc, 0x19, 0x6c03);
11088                 MP_WritePhyUshort(sc, 0x15, 0x0037);
11089                 MP_WritePhyUshort(sc, 0x19, 0xa300);
11090                 MP_WritePhyUshort(sc, 0x15, 0x0038);
11091                 MP_WritePhyUshort(sc, 0x19, 0x64a1);
11092                 MP_WritePhyUshort(sc, 0x15, 0x0039);
11093                 MP_WritePhyUshort(sc, 0x19, 0x7c08);
11094                 MP_WritePhyUshort(sc, 0x15, 0x003a);
11095                 MP_WritePhyUshort(sc, 0x19, 0x74f8);
11096                 MP_WritePhyUshort(sc, 0x15, 0x003b);
11097                 MP_WritePhyUshort(sc, 0x19, 0x63d0);
11098                 MP_WritePhyUshort(sc, 0x15, 0x003c);
11099                 MP_WritePhyUshort(sc, 0x19, 0x7ff0);
11100                 MP_WritePhyUshort(sc, 0x15, 0x003d);
11101                 MP_WritePhyUshort(sc, 0x19, 0x77f0);
11102                 MP_WritePhyUshort(sc, 0x15, 0x003e);
11103                 MP_WritePhyUshort(sc, 0x19, 0x7ff0);
11104                 MP_WritePhyUshort(sc, 0x15, 0x003f);
11105                 MP_WritePhyUshort(sc, 0x19, 0x7750);
11106                 MP_WritePhyUshort(sc, 0x15, 0x0040);
11107                 MP_WritePhyUshort(sc, 0x19, 0x63d8);
11108                 MP_WritePhyUshort(sc, 0x15, 0x0041);
11109                 MP_WritePhyUshort(sc, 0x19, 0x7cf0);
11110                 MP_WritePhyUshort(sc, 0x15, 0x0042);
11111                 MP_WritePhyUshort(sc, 0x19, 0x7708);
11112                 MP_WritePhyUshort(sc, 0x15, 0x0043);
11113                 MP_WritePhyUshort(sc, 0x19, 0xa654);
11114                 MP_WritePhyUshort(sc, 0x15, 0x0044);
11115                 MP_WritePhyUshort(sc, 0x19, 0x304a);
11116                 MP_WritePhyUshort(sc, 0x15, 0x0045);
11117                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11118                 MP_WritePhyUshort(sc, 0x15, 0x0046);
11119                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11120                 MP_WritePhyUshort(sc, 0x15, 0x0047);
11121                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11122                 MP_WritePhyUshort(sc, 0x15, 0x0048);
11123                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11124                 MP_WritePhyUshort(sc, 0x15, 0x0049);
11125                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11126                 MP_WritePhyUshort(sc, 0x15, 0x004a);
11127                 MP_WritePhyUshort(sc, 0x19, 0x4802);
11128                 MP_WritePhyUshort(sc, 0x15, 0x004b);
11129                 MP_WritePhyUshort(sc, 0x19, 0x4003);
11130                 MP_WritePhyUshort(sc, 0x15, 0x004c);
11131                 MP_WritePhyUshort(sc, 0x19, 0x4440);
11132                 MP_WritePhyUshort(sc, 0x15, 0x004d);
11133                 MP_WritePhyUshort(sc, 0x19, 0x63c8);
11134                 MP_WritePhyUshort(sc, 0x15, 0x004e);
11135                 MP_WritePhyUshort(sc, 0x19, 0x6481);
11136                 MP_WritePhyUshort(sc, 0x15, 0x004f);
11137                 MP_WritePhyUshort(sc, 0x19, 0x9d00);
11138                 MP_WritePhyUshort(sc, 0x15, 0x0050);
11139                 MP_WritePhyUshort(sc, 0x19, 0x63e8);
11140                 MP_WritePhyUshort(sc, 0x15, 0x0051);
11141                 MP_WritePhyUshort(sc, 0x19, 0x7d00);
11142                 MP_WritePhyUshort(sc, 0x15, 0x0052);
11143                 MP_WritePhyUshort(sc, 0x19, 0x5900);
11144                 MP_WritePhyUshort(sc, 0x15, 0x0053);
11145                 MP_WritePhyUshort(sc, 0x19, 0x63f8);
11146                 MP_WritePhyUshort(sc, 0x15, 0x0054);
11147                 MP_WritePhyUshort(sc, 0x19, 0x64a1);
11148                 MP_WritePhyUshort(sc, 0x15, 0x0055);
11149                 MP_WritePhyUshort(sc, 0x19, 0x3116);
11150                 MP_WritePhyUshort(sc, 0x15, 0x0056);
11151                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11152                 MP_WritePhyUshort(sc, 0x15, 0x0057);
11153                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11154                 MP_WritePhyUshort(sc, 0x15, 0x0058);
11155                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11156                 MP_WritePhyUshort(sc, 0x15, 0x0059);
11157                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11158                 MP_WritePhyUshort(sc, 0x15, 0x005a);
11159                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
11160                 MP_WritePhyUshort(sc, 0x15, 0x005b);
11161                 MP_WritePhyUshort(sc, 0x19, 0x6c03);
11162                 MP_WritePhyUshort(sc, 0x15, 0x005c);
11163                 MP_WritePhyUshort(sc, 0x19, 0x7c08);
11164                 MP_WritePhyUshort(sc, 0x15, 0x005d);
11165                 MP_WritePhyUshort(sc, 0x19, 0x6000);
11166                 MP_WritePhyUshort(sc, 0x15, 0x005e);
11167                 MP_WritePhyUshort(sc, 0x19, 0x59ce);
11168                 MP_WritePhyUshort(sc, 0x15, 0x005f);
11169                 MP_WritePhyUshort(sc, 0x19, 0x4400);
11170                 MP_WritePhyUshort(sc, 0x15, 0x0060);
11171                 MP_WritePhyUshort(sc, 0x19, 0x7d00);
11172                 MP_WritePhyUshort(sc, 0x15, 0x0061);
11173                 MP_WritePhyUshort(sc, 0x19, 0x72b0);
11174                 MP_WritePhyUshort(sc, 0x15, 0x0062);
11175                 MP_WritePhyUshort(sc, 0x19, 0x400e);
11176                 MP_WritePhyUshort(sc, 0x15, 0x0063);
11177                 MP_WritePhyUshort(sc, 0x19, 0x4440);
11178                 MP_WritePhyUshort(sc, 0x15, 0x0064);
11179                 MP_WritePhyUshort(sc, 0x19, 0x9d00);
11180                 MP_WritePhyUshort(sc, 0x15, 0x0065);
11181                 MP_WritePhyUshort(sc, 0x19, 0x7f00);
11182                 MP_WritePhyUshort(sc, 0x15, 0x0066);
11183                 MP_WritePhyUshort(sc, 0x19, 0x70b0);
11184                 MP_WritePhyUshort(sc, 0x15, 0x0067);
11185                 MP_WritePhyUshort(sc, 0x19, 0x7c08);
11186                 MP_WritePhyUshort(sc, 0x15, 0x0068);
11187                 MP_WritePhyUshort(sc, 0x19, 0x6008);
11188                 MP_WritePhyUshort(sc, 0x15, 0x0069);
11189                 MP_WritePhyUshort(sc, 0x19, 0x7cf0);
11190                 MP_WritePhyUshort(sc, 0x15, 0x006a);
11191                 MP_WritePhyUshort(sc, 0x19, 0x7750);
11192                 MP_WritePhyUshort(sc, 0x15, 0x006b);
11193                 MP_WritePhyUshort(sc, 0x19, 0x4007);
11194                 MP_WritePhyUshort(sc, 0x15, 0x006c);
11195                 MP_WritePhyUshort(sc, 0x19, 0x4500);
11196                 MP_WritePhyUshort(sc, 0x15, 0x006d);
11197                 MP_WritePhyUshort(sc, 0x19, 0x4023);
11198                 MP_WritePhyUshort(sc, 0x15, 0x006e);
11199                 MP_WritePhyUshort(sc, 0x19, 0x4580);
11200                 MP_WritePhyUshort(sc, 0x15, 0x006f);
11201                 MP_WritePhyUshort(sc, 0x19, 0x9f00);
11202                 MP_WritePhyUshort(sc, 0x15, 0x0070);
11203                 MP_WritePhyUshort(sc, 0x19, 0xcd78);
11204                 MP_WritePhyUshort(sc, 0x15, 0x0071);
11205                 MP_WritePhyUshort(sc, 0x19, 0x0003);
11206                 MP_WritePhyUshort(sc, 0x15, 0x0072);
11207                 MP_WritePhyUshort(sc, 0x19, 0xbe02);
11208                 MP_WritePhyUshort(sc, 0x15, 0x0073);
11209                 MP_WritePhyUshort(sc, 0x19, 0x3070);
11210                 MP_WritePhyUshort(sc, 0x15, 0x0074);
11211                 MP_WritePhyUshort(sc, 0x19, 0x7cf0);
11212                 MP_WritePhyUshort(sc, 0x15, 0x0075);
11213                 MP_WritePhyUshort(sc, 0x19, 0x77f0);
11214                 MP_WritePhyUshort(sc, 0x15, 0x0076);
11215                 MP_WritePhyUshort(sc, 0x19, 0x4400);
11216                 MP_WritePhyUshort(sc, 0x15, 0x0077);
11217                 MP_WritePhyUshort(sc, 0x19, 0x4007);
11218                 MP_WritePhyUshort(sc, 0x15, 0x0078);
11219                 MP_WritePhyUshort(sc, 0x19, 0x4500);
11220                 MP_WritePhyUshort(sc, 0x15, 0x0079);
11221                 MP_WritePhyUshort(sc, 0x19, 0x4023);
11222                 MP_WritePhyUshort(sc, 0x15, 0x007a);
11223                 MP_WritePhyUshort(sc, 0x19, 0x4580);
11224                 MP_WritePhyUshort(sc, 0x15, 0x007b);
11225                 MP_WritePhyUshort(sc, 0x19, 0x9f00);
11226                 MP_WritePhyUshort(sc, 0x15, 0x007c);
11227                 MP_WritePhyUshort(sc, 0x19, 0xce80);
11228                 MP_WritePhyUshort(sc, 0x15, 0x007d);
11229                 MP_WritePhyUshort(sc, 0x19, 0x0004);
11230                 MP_WritePhyUshort(sc, 0x15, 0x007e);
11231                 MP_WritePhyUshort(sc, 0x19, 0xce80);
11232                 MP_WritePhyUshort(sc, 0x15, 0x007f);
11233                 MP_WritePhyUshort(sc, 0x19, 0x0002);
11234                 MP_WritePhyUshort(sc, 0x15, 0x0080);
11235                 MP_WritePhyUshort(sc, 0x19, 0x307c);
11236                 MP_WritePhyUshort(sc, 0x15, 0x0081);
11237                 MP_WritePhyUshort(sc, 0x19, 0x4400);
11238                 MP_WritePhyUshort(sc, 0x15, 0x0082);
11239                 MP_WritePhyUshort(sc, 0x19, 0x480f);
11240                 MP_WritePhyUshort(sc, 0x15, 0x0083);
11241                 MP_WritePhyUshort(sc, 0x19, 0x6802);
11242                 MP_WritePhyUshort(sc, 0x15, 0x0084);
11243                 MP_WritePhyUshort(sc, 0x19, 0x6680);
11244                 MP_WritePhyUshort(sc, 0x15, 0x0085);
11245                 MP_WritePhyUshort(sc, 0x19, 0x7c10);
11246                 MP_WritePhyUshort(sc, 0x15, 0x0086);
11247                 MP_WritePhyUshort(sc, 0x19, 0x6010);
11248                 MP_WritePhyUshort(sc, 0x15, 0x0087);
11249                 MP_WritePhyUshort(sc, 0x19, 0x400a);
11250                 MP_WritePhyUshort(sc, 0x15, 0x0088);
11251                 MP_WritePhyUshort(sc, 0x19, 0x4580);
11252                 MP_WritePhyUshort(sc, 0x15, 0x0089);
11253                 MP_WritePhyUshort(sc, 0x19, 0x9e00);
11254                 MP_WritePhyUshort(sc, 0x15, 0x008a);
11255                 MP_WritePhyUshort(sc, 0x19, 0x7d00);
11256                 MP_WritePhyUshort(sc, 0x15, 0x008b);
11257                 MP_WritePhyUshort(sc, 0x19, 0x5800);
11258                 MP_WritePhyUshort(sc, 0x15, 0x008c);
11259                 MP_WritePhyUshort(sc, 0x19, 0x63c8);
11260                 MP_WritePhyUshort(sc, 0x15, 0x008d);
11261                 MP_WritePhyUshort(sc, 0x19, 0x63d8);
11262                 MP_WritePhyUshort(sc, 0x15, 0x008e);
11263                 MP_WritePhyUshort(sc, 0x19, 0x66a0);
11264                 MP_WritePhyUshort(sc, 0x15, 0x008f);
11265                 MP_WritePhyUshort(sc, 0x19, 0x8300);
11266                 MP_WritePhyUshort(sc, 0x15, 0x0090);
11267                 MP_WritePhyUshort(sc, 0x19, 0x7ff0);
11268                 MP_WritePhyUshort(sc, 0x15, 0x0091);
11269                 MP_WritePhyUshort(sc, 0x19, 0x74f0);
11270                 MP_WritePhyUshort(sc, 0x15, 0x0092);
11271                 MP_WritePhyUshort(sc, 0x19, 0x3006);
11272                 MP_WritePhyUshort(sc, 0x15, 0x0093);
11273                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11274                 MP_WritePhyUshort(sc, 0x15, 0x0094);
11275                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11276                 MP_WritePhyUshort(sc, 0x15, 0x0095);
11277                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11278                 MP_WritePhyUshort(sc, 0x15, 0x0096);
11279                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11280                 MP_WritePhyUshort(sc, 0x15, 0x0097);
11281                 MP_WritePhyUshort(sc, 0x19, 0x4803);
11282                 MP_WritePhyUshort(sc, 0x15, 0x0098);
11283                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
11284                 MP_WritePhyUshort(sc, 0x15, 0x0099);
11285                 MP_WritePhyUshort(sc, 0x19, 0x6c03);
11286                 MP_WritePhyUshort(sc, 0x15, 0x009a);
11287                 MP_WritePhyUshort(sc, 0x19, 0xa203);
11288                 MP_WritePhyUshort(sc, 0x15, 0x009b);
11289                 MP_WritePhyUshort(sc, 0x19, 0x64b1);
11290                 MP_WritePhyUshort(sc, 0x15, 0x009c);
11291                 MP_WritePhyUshort(sc, 0x19, 0x309e);
11292                 MP_WritePhyUshort(sc, 0x15, 0x009d);
11293                 MP_WritePhyUshort(sc, 0x19, 0x64b3);
11294                 MP_WritePhyUshort(sc, 0x15, 0x009e);
11295                 MP_WritePhyUshort(sc, 0x19, 0x4030);
11296                 MP_WritePhyUshort(sc, 0x15, 0x009f);
11297                 MP_WritePhyUshort(sc, 0x19, 0x440e);
11298                 MP_WritePhyUshort(sc, 0x15, 0x00a0);
11299                 MP_WritePhyUshort(sc, 0x19, 0x4020);
11300                 MP_WritePhyUshort(sc, 0x15, 0x00a1);
11301                 MP_WritePhyUshort(sc, 0x19, 0x4419);
11302                 MP_WritePhyUshort(sc, 0x15, 0x00a2);
11303                 MP_WritePhyUshort(sc, 0x19, 0x7801);
11304                 MP_WritePhyUshort(sc, 0x15, 0x00a3);
11305                 MP_WritePhyUshort(sc, 0x19, 0xc520);
11306                 MP_WritePhyUshort(sc, 0x15, 0x00a4);
11307                 MP_WritePhyUshort(sc, 0x19, 0x000b);
11308                 MP_WritePhyUshort(sc, 0x15, 0x00a5);
11309                 MP_WritePhyUshort(sc, 0x19, 0x4020);
11310                 MP_WritePhyUshort(sc, 0x15, 0x00a6);
11311                 MP_WritePhyUshort(sc, 0x19, 0x7800);
11312                 MP_WritePhyUshort(sc, 0x15, 0x00a7);
11313                 MP_WritePhyUshort(sc, 0x19, 0x58a4);
11314                 MP_WritePhyUshort(sc, 0x15, 0x00a8);
11315                 MP_WritePhyUshort(sc, 0x19, 0x63da);
11316                 MP_WritePhyUshort(sc, 0x15, 0x00a9);
11317                 MP_WritePhyUshort(sc, 0x19, 0x5cb0);
11318                 MP_WritePhyUshort(sc, 0x15, 0x00aa);
11319                 MP_WritePhyUshort(sc, 0x19, 0x7d00);
11320                 MP_WritePhyUshort(sc, 0x15, 0x00ab);
11321                 MP_WritePhyUshort(sc, 0x19, 0x72b0);
11322                 MP_WritePhyUshort(sc, 0x15, 0x00ac);
11323                 MP_WritePhyUshort(sc, 0x19, 0x7f00);
11324                 MP_WritePhyUshort(sc, 0x15, 0x00ad);
11325                 MP_WritePhyUshort(sc, 0x19, 0x70b0);
11326                 MP_WritePhyUshort(sc, 0x15, 0x00ae);
11327                 MP_WritePhyUshort(sc, 0x19, 0x30b8);
11328                 MP_WritePhyUshort(sc, 0x15, 0x00AF);
11329                 MP_WritePhyUshort(sc, 0x19, 0x4060);
11330                 MP_WritePhyUshort(sc, 0x15, 0x00B0);
11331                 MP_WritePhyUshort(sc, 0x19, 0x7800);
11332                 MP_WritePhyUshort(sc, 0x15, 0x00B1);
11333                 MP_WritePhyUshort(sc, 0x19, 0x7e00);
11334                 MP_WritePhyUshort(sc, 0x15, 0x00B2);
11335                 MP_WritePhyUshort(sc, 0x19, 0x72B0);
11336                 MP_WritePhyUshort(sc, 0x15, 0x00B3);
11337                 MP_WritePhyUshort(sc, 0x19, 0x7F00);
11338                 MP_WritePhyUshort(sc, 0x15, 0x00B4);
11339                 MP_WritePhyUshort(sc, 0x19, 0x73B0);
11340                 MP_WritePhyUshort(sc, 0x15, 0x00b5);
11341                 MP_WritePhyUshort(sc, 0x19, 0x58a0);
11342                 MP_WritePhyUshort(sc, 0x15, 0x00b6);
11343                 MP_WritePhyUshort(sc, 0x19, 0x63d2);
11344                 MP_WritePhyUshort(sc, 0x15, 0x00b7);
11345                 MP_WritePhyUshort(sc, 0x19, 0x5c00);
11346                 MP_WritePhyUshort(sc, 0x15, 0x00b8);
11347                 MP_WritePhyUshort(sc, 0x19, 0x5780);
11348                 MP_WritePhyUshort(sc, 0x15, 0x00b9);
11349                 MP_WritePhyUshort(sc, 0x19, 0xb60d);
11350                 MP_WritePhyUshort(sc, 0x15, 0x00ba);
11351                 MP_WritePhyUshort(sc, 0x19, 0x9bff);
11352                 MP_WritePhyUshort(sc, 0x15, 0x00bb);
11353                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
11354                 MP_WritePhyUshort(sc, 0x15, 0x00bc);
11355                 MP_WritePhyUshort(sc, 0x19, 0x6001);
11356                 MP_WritePhyUshort(sc, 0x15, 0x00bd);
11357                 MP_WritePhyUshort(sc, 0x19, 0xc020);
11358                 MP_WritePhyUshort(sc, 0x15, 0x00be);
11359                 MP_WritePhyUshort(sc, 0x19, 0x002b);
11360                 MP_WritePhyUshort(sc, 0x15, 0x00bf);
11361                 MP_WritePhyUshort(sc, 0x19, 0xc137);
11362                 MP_WritePhyUshort(sc, 0x15, 0x00c0);
11363                 MP_WritePhyUshort(sc, 0x19, 0x0006);
11364                 MP_WritePhyUshort(sc, 0x15, 0x00c1);
11365                 MP_WritePhyUshort(sc, 0x19, 0x9af8);
11366                 MP_WritePhyUshort(sc, 0x15, 0x00c2);
11367                 MP_WritePhyUshort(sc, 0x19, 0x30c6);
11368                 MP_WritePhyUshort(sc, 0x15, 0x00c3);
11369                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11370                 MP_WritePhyUshort(sc, 0x15, 0x00c4);
11371                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11372                 MP_WritePhyUshort(sc, 0x15, 0x00c5);
11373                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11374                 MP_WritePhyUshort(sc, 0x15, 0x00c6);
11375                 MP_WritePhyUshort(sc, 0x19, 0x7d00);
11376                 MP_WritePhyUshort(sc, 0x15, 0x00c7);
11377                 MP_WritePhyUshort(sc, 0x19, 0x70b0);
11378                 MP_WritePhyUshort(sc, 0x15, 0x00c8);
11379                 MP_WritePhyUshort(sc, 0x19, 0x4400);
11380                 MP_WritePhyUshort(sc, 0x15, 0x00c9);
11381                 MP_WritePhyUshort(sc, 0x19, 0x4804);
11382                 MP_WritePhyUshort(sc, 0x15, 0x00ca);
11383                 MP_WritePhyUshort(sc, 0x19, 0x7c80);
11384                 MP_WritePhyUshort(sc, 0x15, 0x00cb);
11385                 MP_WritePhyUshort(sc, 0x19, 0x5c80);
11386                 MP_WritePhyUshort(sc, 0x15, 0x00cc);
11387                 MP_WritePhyUshort(sc, 0x19, 0x4010);
11388                 MP_WritePhyUshort(sc, 0x15, 0x00cd);
11389                 MP_WritePhyUshort(sc, 0x19, 0x4415);
11390                 MP_WritePhyUshort(sc, 0x15, 0x00ce);
11391                 MP_WritePhyUshort(sc, 0x19, 0x9b00);
11392                 MP_WritePhyUshort(sc, 0x15, 0x00cf);
11393                 MP_WritePhyUshort(sc, 0x19, 0x7f00);
11394                 MP_WritePhyUshort(sc, 0x15, 0x00d0);
11395                 MP_WritePhyUshort(sc, 0x19, 0x70b0);
11396                 MP_WritePhyUshort(sc, 0x15, 0x00d1);
11397                 MP_WritePhyUshort(sc, 0x19, 0x3177);
11398                 MP_WritePhyUshort(sc, 0x15, 0x00d2);
11399                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11400                 MP_WritePhyUshort(sc, 0x15, 0x00d3);
11401                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11402                 MP_WritePhyUshort(sc, 0x15, 0x00d4);
11403                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11404                 MP_WritePhyUshort(sc, 0x15, 0x00d5);
11405                 MP_WritePhyUshort(sc, 0x19, 0x4808);
11406                 MP_WritePhyUshort(sc, 0x15, 0x00d6);
11407                 MP_WritePhyUshort(sc, 0x19, 0x4007);
11408                 MP_WritePhyUshort(sc, 0x15, 0x00d7);
11409                 MP_WritePhyUshort(sc, 0x19, 0x4420);
11410                 MP_WritePhyUshort(sc, 0x15, 0x00d8);
11411                 MP_WritePhyUshort(sc, 0x19, 0x63d8);
11412                 MP_WritePhyUshort(sc, 0x15, 0x00d9);
11413                 MP_WritePhyUshort(sc, 0x19, 0xb608);
11414                 MP_WritePhyUshort(sc, 0x15, 0x00da);
11415                 MP_WritePhyUshort(sc, 0x19, 0xbcbd);
11416                 MP_WritePhyUshort(sc, 0x15, 0x00db);
11417                 MP_WritePhyUshort(sc, 0x19, 0xc60b);
11418                 MP_WritePhyUshort(sc, 0x15, 0x00dc);
11419                 MP_WritePhyUshort(sc, 0x19, 0x00fd);
11420                 MP_WritePhyUshort(sc, 0x15, 0x00dd);
11421                 MP_WritePhyUshort(sc, 0x19, 0x30e1);
11422                 MP_WritePhyUshort(sc, 0x15, 0x00de);
11423                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11424                 MP_WritePhyUshort(sc, 0x15, 0x00df);
11425                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11426                 MP_WritePhyUshort(sc, 0x15, 0x00e0);
11427                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11428                 MP_WritePhyUshort(sc, 0x15, 0x00e1);
11429                 MP_WritePhyUshort(sc, 0x19, 0x4809);
11430                 MP_WritePhyUshort(sc, 0x15, 0x00e2);
11431                 MP_WritePhyUshort(sc, 0x19, 0x7e40);
11432                 MP_WritePhyUshort(sc, 0x15, 0x00e3);
11433                 MP_WritePhyUshort(sc, 0x19, 0x5a40);
11434                 MP_WritePhyUshort(sc, 0x15, 0x00e4);
11435                 MP_WritePhyUshort(sc, 0x19, 0x305a);
11436                 MP_WritePhyUshort(sc, 0x15, 0x00e5);
11437                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11438                 MP_WritePhyUshort(sc, 0x15, 0x00e6);
11439                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11440                 MP_WritePhyUshort(sc, 0x15, 0x00e7);
11441                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11442                 MP_WritePhyUshort(sc, 0x15, 0x00e8);
11443                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11444                 MP_WritePhyUshort(sc, 0x15, 0x00e9);
11445                 MP_WritePhyUshort(sc, 0x19, 0x480a);
11446                 MP_WritePhyUshort(sc, 0x15, 0x00ea);
11447                 MP_WritePhyUshort(sc, 0x19, 0x5820);
11448                 MP_WritePhyUshort(sc, 0x15, 0x00eb);
11449                 MP_WritePhyUshort(sc, 0x19, 0x6c03);
11450                 MP_WritePhyUshort(sc, 0x15, 0x00ec);
11451                 MP_WritePhyUshort(sc, 0x19, 0xb60a);
11452                 MP_WritePhyUshort(sc, 0x15, 0x00ed);
11453                 MP_WritePhyUshort(sc, 0x19, 0xda07);
11454                 MP_WritePhyUshort(sc, 0x15, 0x00ee);
11455                 MP_WritePhyUshort(sc, 0x19, 0x0008);
11456                 MP_WritePhyUshort(sc, 0x15, 0x00ef);
11457                 MP_WritePhyUshort(sc, 0x19, 0xc60b);
11458                 MP_WritePhyUshort(sc, 0x15, 0x00f0);
11459                 MP_WritePhyUshort(sc, 0x19, 0x00fc);
11460                 MP_WritePhyUshort(sc, 0x15, 0x00f1);
11461                 MP_WritePhyUshort(sc, 0x19, 0x30f6);
11462                 MP_WritePhyUshort(sc, 0x15, 0x00f2);
11463                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11464                 MP_WritePhyUshort(sc, 0x15, 0x00f3);
11465                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11466                 MP_WritePhyUshort(sc, 0x15, 0x00f4);
11467                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11468                 MP_WritePhyUshort(sc, 0x15, 0x00f5);
11469                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11470                 MP_WritePhyUshort(sc, 0x15, 0x00f6);
11471                 MP_WritePhyUshort(sc, 0x19, 0x4408);
11472                 MP_WritePhyUshort(sc, 0x15, 0x00f7);
11473                 MP_WritePhyUshort(sc, 0x19, 0x480b);
11474                 MP_WritePhyUshort(sc, 0x15, 0x00f8);
11475                 MP_WritePhyUshort(sc, 0x19, 0x6f03);
11476                 MP_WritePhyUshort(sc, 0x15, 0x00f9);
11477                 MP_WritePhyUshort(sc, 0x19, 0x405f);
11478                 MP_WritePhyUshort(sc, 0x15, 0x00fa);
11479                 MP_WritePhyUshort(sc, 0x19, 0x4448);
11480                 MP_WritePhyUshort(sc, 0x15, 0x00fb);
11481                 MP_WritePhyUshort(sc, 0x19, 0x4020);
11482                 MP_WritePhyUshort(sc, 0x15, 0x00fc);
11483                 MP_WritePhyUshort(sc, 0x19, 0x4468);
11484                 MP_WritePhyUshort(sc, 0x15, 0x00fd);
11485                 MP_WritePhyUshort(sc, 0x19, 0x9c03);
11486                 MP_WritePhyUshort(sc, 0x15, 0x00fe);
11487                 MP_WritePhyUshort(sc, 0x19, 0x6f07);
11488                 MP_WritePhyUshort(sc, 0x15, 0x00ff);
11489                 MP_WritePhyUshort(sc, 0x19, 0x58a0);
11490                 MP_WritePhyUshort(sc, 0x15, 0x0100);
11491                 MP_WritePhyUshort(sc, 0x19, 0xd6d1);
11492                 MP_WritePhyUshort(sc, 0x15, 0x0101);
11493                 MP_WritePhyUshort(sc, 0x19, 0x0004);
11494                 MP_WritePhyUshort(sc, 0x15, 0x0102);
11495                 MP_WritePhyUshort(sc, 0x19, 0xc137);
11496                 MP_WritePhyUshort(sc, 0x15, 0x0103);
11497                 MP_WritePhyUshort(sc, 0x19, 0x0002);
11498                 MP_WritePhyUshort(sc, 0x15, 0x0104);
11499                 MP_WritePhyUshort(sc, 0x19, 0xa0e5);
11500                 MP_WritePhyUshort(sc, 0x15, 0x0105);
11501                 MP_WritePhyUshort(sc, 0x19, 0x9df8);
11502                 MP_WritePhyUshort(sc, 0x15, 0x0106);
11503                 MP_WritePhyUshort(sc, 0x19, 0x30c6);
11504                 MP_WritePhyUshort(sc, 0x15, 0x0107);
11505                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11506                 MP_WritePhyUshort(sc, 0x15, 0x0108);
11507                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11508                 MP_WritePhyUshort(sc, 0x15, 0x0109);
11509                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11510                 MP_WritePhyUshort(sc, 0x15, 0x010a);
11511                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11512                 MP_WritePhyUshort(sc, 0x15, 0x010b);
11513                 MP_WritePhyUshort(sc, 0x19, 0x4808);
11514                 MP_WritePhyUshort(sc, 0x15, 0x010c);
11515                 MP_WritePhyUshort(sc, 0x19, 0xc32d);
11516                 MP_WritePhyUshort(sc, 0x15, 0x010d);
11517                 MP_WritePhyUshort(sc, 0x19, 0x0003);
11518                 MP_WritePhyUshort(sc, 0x15, 0x010e);
11519                 MP_WritePhyUshort(sc, 0x19, 0xc8b3);
11520                 MP_WritePhyUshort(sc, 0x15, 0x010f);
11521                 MP_WritePhyUshort(sc, 0x19, 0x00fc);
11522                 MP_WritePhyUshort(sc, 0x15, 0x0110);
11523                 MP_WritePhyUshort(sc, 0x19, 0x4400);
11524                 MP_WritePhyUshort(sc, 0x15, 0x0111);
11525                 MP_WritePhyUshort(sc, 0x19, 0x3116);
11526                 MP_WritePhyUshort(sc, 0x15, 0x0112);
11527                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11528                 MP_WritePhyUshort(sc, 0x15, 0x0113);
11529                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11530                 MP_WritePhyUshort(sc, 0x15, 0x0114);
11531                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11532                 MP_WritePhyUshort(sc, 0x15, 0x0115);
11533                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11534                 MP_WritePhyUshort(sc, 0x15, 0x0116);
11535                 MP_WritePhyUshort(sc, 0x19, 0x4803);
11536                 MP_WritePhyUshort(sc, 0x15, 0x0117);
11537                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
11538                 MP_WritePhyUshort(sc, 0x15, 0x0118);
11539                 MP_WritePhyUshort(sc, 0x19, 0x6c02);
11540                 MP_WritePhyUshort(sc, 0x15, 0x0119);
11541                 MP_WritePhyUshort(sc, 0x19, 0x7c04);
11542                 MP_WritePhyUshort(sc, 0x15, 0x011a);
11543                 MP_WritePhyUshort(sc, 0x19, 0x6000);
11544                 MP_WritePhyUshort(sc, 0x15, 0x011b);
11545                 MP_WritePhyUshort(sc, 0x19, 0x5cf7);
11546                 MP_WritePhyUshort(sc, 0x15, 0x011c);
11547                 MP_WritePhyUshort(sc, 0x19, 0x7c2a);
11548                 MP_WritePhyUshort(sc, 0x15, 0x011d);
11549                 MP_WritePhyUshort(sc, 0x19, 0x5800);
11550                 MP_WritePhyUshort(sc, 0x15, 0x011e);
11551                 MP_WritePhyUshort(sc, 0x19, 0x5400);
11552                 MP_WritePhyUshort(sc, 0x15, 0x011f);
11553                 MP_WritePhyUshort(sc, 0x19, 0x7c08);
11554                 MP_WritePhyUshort(sc, 0x15, 0x0120);
11555                 MP_WritePhyUshort(sc, 0x19, 0x74f0);
11556                 MP_WritePhyUshort(sc, 0x15, 0x0121);
11557                 MP_WritePhyUshort(sc, 0x19, 0x4019);
11558                 MP_WritePhyUshort(sc, 0x15, 0x0122);
11559                 MP_WritePhyUshort(sc, 0x19, 0x440d);
11560                 MP_WritePhyUshort(sc, 0x15, 0x0123);
11561                 MP_WritePhyUshort(sc, 0x19, 0xb6c1);
11562                 MP_WritePhyUshort(sc, 0x15, 0x0124);
11563                 MP_WritePhyUshort(sc, 0x19, 0xc05b);
11564                 MP_WritePhyUshort(sc, 0x15, 0x0125);
11565                 MP_WritePhyUshort(sc, 0x19, 0x00bf);
11566                 MP_WritePhyUshort(sc, 0x15, 0x0126);
11567                 MP_WritePhyUshort(sc, 0x19, 0xc025);
11568                 MP_WritePhyUshort(sc, 0x15, 0x0127);
11569                 MP_WritePhyUshort(sc, 0x19, 0x00bd);
11570                 MP_WritePhyUshort(sc, 0x15, 0x0128);
11571                 MP_WritePhyUshort(sc, 0x19, 0xc603);
11572                 MP_WritePhyUshort(sc, 0x15, 0x0129);
11573                 MP_WritePhyUshort(sc, 0x19, 0x00bb);
11574                 MP_WritePhyUshort(sc, 0x15, 0x012a);
11575                 MP_WritePhyUshort(sc, 0x19, 0x8805);
11576                 MP_WritePhyUshort(sc, 0x15, 0x012b);
11577                 MP_WritePhyUshort(sc, 0x19, 0x7801);
11578                 MP_WritePhyUshort(sc, 0x15, 0x012c);
11579                 MP_WritePhyUshort(sc, 0x19, 0x4001);
11580                 MP_WritePhyUshort(sc, 0x15, 0x012d);
11581                 MP_WritePhyUshort(sc, 0x19, 0x7800);
11582                 MP_WritePhyUshort(sc, 0x15, 0x012e);
11583                 MP_WritePhyUshort(sc, 0x19, 0xa3dd);
11584                 MP_WritePhyUshort(sc, 0x15, 0x012f);
11585                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
11586                 MP_WritePhyUshort(sc, 0x15, 0x0130);
11587                 MP_WritePhyUshort(sc, 0x19, 0x6c03);
11588                 MP_WritePhyUshort(sc, 0x15, 0x0131);
11589                 MP_WritePhyUshort(sc, 0x19, 0x8407);
11590                 MP_WritePhyUshort(sc, 0x15, 0x0132);
11591                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
11592                 MP_WritePhyUshort(sc, 0x15, 0x0133);
11593                 MP_WritePhyUshort(sc, 0x19, 0x6c02);
11594                 MP_WritePhyUshort(sc, 0x15, 0x0134);
11595                 MP_WritePhyUshort(sc, 0x19, 0xd9b8);
11596                 MP_WritePhyUshort(sc, 0x15, 0x0135);
11597                 MP_WritePhyUshort(sc, 0x19, 0x0003);
11598                 MP_WritePhyUshort(sc, 0x15, 0x0136);
11599                 MP_WritePhyUshort(sc, 0x19, 0xc240);
11600                 MP_WritePhyUshort(sc, 0x15, 0x0137);
11601                 MP_WritePhyUshort(sc, 0x19, 0x0015);
11602                 MP_WritePhyUshort(sc, 0x15, 0x0138);
11603                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
11604                 MP_WritePhyUshort(sc, 0x15, 0x0139);
11605                 MP_WritePhyUshort(sc, 0x19, 0x6c02);
11606                 MP_WritePhyUshort(sc, 0x15, 0x013a);
11607                 MP_WritePhyUshort(sc, 0x19, 0x9ae9);
11608                 MP_WritePhyUshort(sc, 0x15, 0x013b);
11609                 MP_WritePhyUshort(sc, 0x19, 0x3140);
11610                 MP_WritePhyUshort(sc, 0x15, 0x013c);
11611                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11612                 MP_WritePhyUshort(sc, 0x15, 0x013d);
11613                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11614                 MP_WritePhyUshort(sc, 0x15, 0x013e);
11615                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11616                 MP_WritePhyUshort(sc, 0x15, 0x013f);
11617                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11618                 MP_WritePhyUshort(sc, 0x15, 0x0140);
11619                 MP_WritePhyUshort(sc, 0x19, 0x4807);
11620                 MP_WritePhyUshort(sc, 0x15, 0x0141);
11621                 MP_WritePhyUshort(sc, 0x19, 0x4004);
11622                 MP_WritePhyUshort(sc, 0x15, 0x0142);
11623                 MP_WritePhyUshort(sc, 0x19, 0x4410);
11624                 MP_WritePhyUshort(sc, 0x15, 0x0143);
11625                 MP_WritePhyUshort(sc, 0x19, 0x7c0c);
11626                 MP_WritePhyUshort(sc, 0x15, 0x0144);
11627                 MP_WritePhyUshort(sc, 0x19, 0x600c);
11628                 MP_WritePhyUshort(sc, 0x15, 0x0145);
11629                 MP_WritePhyUshort(sc, 0x19, 0x9b00);
11630                 MP_WritePhyUshort(sc, 0x15, 0x0146);
11631                 MP_WritePhyUshort(sc, 0x19, 0xa68f);
11632                 MP_WritePhyUshort(sc, 0x15, 0x0147);
11633                 MP_WritePhyUshort(sc, 0x19, 0x3116);
11634                 MP_WritePhyUshort(sc, 0x15, 0x0148);
11635                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11636                 MP_WritePhyUshort(sc, 0x15, 0x0149);
11637                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11638                 MP_WritePhyUshort(sc, 0x15, 0x014a);
11639                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11640                 MP_WritePhyUshort(sc, 0x15, 0x014b);
11641                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11642                 MP_WritePhyUshort(sc, 0x15, 0x014c);
11643                 MP_WritePhyUshort(sc, 0x19, 0x4804);
11644                 MP_WritePhyUshort(sc, 0x15, 0x014d);
11645                 MP_WritePhyUshort(sc, 0x19, 0x54c0);
11646                 MP_WritePhyUshort(sc, 0x15, 0x014e);
11647                 MP_WritePhyUshort(sc, 0x19, 0xb703);
11648                 MP_WritePhyUshort(sc, 0x15, 0x014f);
11649                 MP_WritePhyUshort(sc, 0x19, 0x5cff);
11650                 MP_WritePhyUshort(sc, 0x15, 0x0150);
11651                 MP_WritePhyUshort(sc, 0x19, 0x315f);
11652                 MP_WritePhyUshort(sc, 0x15, 0x0151);
11653                 MP_WritePhyUshort(sc, 0x19, 0x7c08);
11654                 MP_WritePhyUshort(sc, 0x15, 0x0152);
11655                 MP_WritePhyUshort(sc, 0x19, 0x74f8);
11656                 MP_WritePhyUshort(sc, 0x15, 0x0153);
11657                 MP_WritePhyUshort(sc, 0x19, 0x6421);
11658                 MP_WritePhyUshort(sc, 0x15, 0x0154);
11659                 MP_WritePhyUshort(sc, 0x19, 0x7c08);
11660                 MP_WritePhyUshort(sc, 0x15, 0x0155);
11661                 MP_WritePhyUshort(sc, 0x19, 0x6000);
11662                 MP_WritePhyUshort(sc, 0x15, 0x0156);
11663                 MP_WritePhyUshort(sc, 0x19, 0x4003);
11664                 MP_WritePhyUshort(sc, 0x15, 0x0157);
11665                 MP_WritePhyUshort(sc, 0x19, 0x4418);
11666                 MP_WritePhyUshort(sc, 0x15, 0x0158);
11667                 MP_WritePhyUshort(sc, 0x19, 0x9b00);
11668                 MP_WritePhyUshort(sc, 0x15, 0x0159);
11669                 MP_WritePhyUshort(sc, 0x19, 0x6461);
11670                 MP_WritePhyUshort(sc, 0x15, 0x015a);
11671                 MP_WritePhyUshort(sc, 0x19, 0x64e1);
11672                 MP_WritePhyUshort(sc, 0x15, 0x015b);
11673                 MP_WritePhyUshort(sc, 0x19, 0x7c20);
11674                 MP_WritePhyUshort(sc, 0x15, 0x015c);
11675                 MP_WritePhyUshort(sc, 0x19, 0x5820);
11676                 MP_WritePhyUshort(sc, 0x15, 0x015d);
11677                 MP_WritePhyUshort(sc, 0x19, 0x5ccf);
11678                 MP_WritePhyUshort(sc, 0x15, 0x015e);
11679                 MP_WritePhyUshort(sc, 0x19, 0x7050);
11680                 MP_WritePhyUshort(sc, 0x15, 0x015f);
11681                 MP_WritePhyUshort(sc, 0x19, 0xd9b8);
11682                 MP_WritePhyUshort(sc, 0x15, 0x0160);
11683                 MP_WritePhyUshort(sc, 0x19, 0x0008);
11684                 MP_WritePhyUshort(sc, 0x15, 0x0161);
11685                 MP_WritePhyUshort(sc, 0x19, 0xdab1);
11686                 MP_WritePhyUshort(sc, 0x15, 0x0162);
11687                 MP_WritePhyUshort(sc, 0x19, 0x0015);
11688                 MP_WritePhyUshort(sc, 0x15, 0x0163);
11689                 MP_WritePhyUshort(sc, 0x19, 0xc244);
11690                 MP_WritePhyUshort(sc, 0x15, 0x0164);
11691                 MP_WritePhyUshort(sc, 0x19, 0x0013);
11692                 MP_WritePhyUshort(sc, 0x15, 0x0165);
11693                 MP_WritePhyUshort(sc, 0x19, 0xc021);
11694                 MP_WritePhyUshort(sc, 0x15, 0x0166);
11695                 MP_WritePhyUshort(sc, 0x19, 0x00f9);
11696                 MP_WritePhyUshort(sc, 0x15, 0x0167);
11697                 MP_WritePhyUshort(sc, 0x19, 0x3177);
11698                 MP_WritePhyUshort(sc, 0x15, 0x0168);
11699                 MP_WritePhyUshort(sc, 0x19, 0x5cf7);
11700                 MP_WritePhyUshort(sc, 0x15, 0x0169);
11701                 MP_WritePhyUshort(sc, 0x19, 0x4010);
11702                 MP_WritePhyUshort(sc, 0x15, 0x016a);
11703                 MP_WritePhyUshort(sc, 0x19, 0x4428);
11704                 MP_WritePhyUshort(sc, 0x15, 0x016b);
11705                 MP_WritePhyUshort(sc, 0x19, 0x9c00);
11706                 MP_WritePhyUshort(sc, 0x15, 0x016c);
11707                 MP_WritePhyUshort(sc, 0x19, 0x7c08);
11708                 MP_WritePhyUshort(sc, 0x15, 0x016d);
11709                 MP_WritePhyUshort(sc, 0x19, 0x6008);
11710                 MP_WritePhyUshort(sc, 0x15, 0x016e);
11711                 MP_WritePhyUshort(sc, 0x19, 0x7c08);
11712                 MP_WritePhyUshort(sc, 0x15, 0x016f);
11713                 MP_WritePhyUshort(sc, 0x19, 0x74f0);
11714                 MP_WritePhyUshort(sc, 0x15, 0x0170);
11715                 MP_WritePhyUshort(sc, 0x19, 0x6461);
11716                 MP_WritePhyUshort(sc, 0x15, 0x0171);
11717                 MP_WritePhyUshort(sc, 0x19, 0x6421);
11718                 MP_WritePhyUshort(sc, 0x15, 0x0172);
11719                 MP_WritePhyUshort(sc, 0x19, 0x64a1);
11720                 MP_WritePhyUshort(sc, 0x15, 0x0173);
11721                 MP_WritePhyUshort(sc, 0x19, 0x3116);
11722                 MP_WritePhyUshort(sc, 0x15, 0x0174);
11723                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11724                 MP_WritePhyUshort(sc, 0x15, 0x0175);
11725                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11726                 MP_WritePhyUshort(sc, 0x15, 0x0176);
11727                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11728                 MP_WritePhyUshort(sc, 0x15, 0x0177);
11729                 MP_WritePhyUshort(sc, 0x19, 0x4805);
11730                 MP_WritePhyUshort(sc, 0x15, 0x0178);
11731                 MP_WritePhyUshort(sc, 0x19, 0xa103);
11732                 MP_WritePhyUshort(sc, 0x15, 0x0179);
11733                 MP_WritePhyUshort(sc, 0x19, 0x7c02);
11734                 MP_WritePhyUshort(sc, 0x15, 0x017a);
11735                 MP_WritePhyUshort(sc, 0x19, 0x6002);
11736                 MP_WritePhyUshort(sc, 0x15, 0x017b);
11737                 MP_WritePhyUshort(sc, 0x19, 0x7e00);
11738                 MP_WritePhyUshort(sc, 0x15, 0x017c);
11739                 MP_WritePhyUshort(sc, 0x19, 0x5400);
11740                 MP_WritePhyUshort(sc, 0x15, 0x017d);
11741                 MP_WritePhyUshort(sc, 0x19, 0x7c6b);
11742                 MP_WritePhyUshort(sc, 0x15, 0x017e);
11743                 MP_WritePhyUshort(sc, 0x19, 0x5c63);
11744                 MP_WritePhyUshort(sc, 0x15, 0x017f);
11745                 MP_WritePhyUshort(sc, 0x19, 0x407d);
11746                 MP_WritePhyUshort(sc, 0x15, 0x0180);
11747                 MP_WritePhyUshort(sc, 0x19, 0xa602);
11748                 MP_WritePhyUshort(sc, 0x15, 0x0181);
11749                 MP_WritePhyUshort(sc, 0x19, 0x4001);
11750                 MP_WritePhyUshort(sc, 0x15, 0x0182);
11751                 MP_WritePhyUshort(sc, 0x19, 0x4420);
11752                 MP_WritePhyUshort(sc, 0x15, 0x0183);
11753                 MP_WritePhyUshort(sc, 0x19, 0x4020);
11754                 MP_WritePhyUshort(sc, 0x15, 0x0184);
11755                 MP_WritePhyUshort(sc, 0x19, 0x44a1);
11756                 MP_WritePhyUshort(sc, 0x15, 0x0185);
11757                 MP_WritePhyUshort(sc, 0x19, 0xd6e0);
11758                 MP_WritePhyUshort(sc, 0x15, 0x0186);
11759                 MP_WritePhyUshort(sc, 0x19, 0x0009);
11760                 MP_WritePhyUshort(sc, 0x15, 0x0187);
11761                 MP_WritePhyUshort(sc, 0x19, 0x9efe);
11762                 MP_WritePhyUshort(sc, 0x15, 0x0188);
11763                 MP_WritePhyUshort(sc, 0x19, 0x7c02);
11764                 MP_WritePhyUshort(sc, 0x15, 0x0189);
11765                 MP_WritePhyUshort(sc, 0x19, 0x6000);
11766                 MP_WritePhyUshort(sc, 0x15, 0x018a);
11767                 MP_WritePhyUshort(sc, 0x19, 0x9c00);
11768                 MP_WritePhyUshort(sc, 0x15, 0x018b);
11769                 MP_WritePhyUshort(sc, 0x19, 0x318f);
11770                 MP_WritePhyUshort(sc, 0x15, 0x018c);
11771                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11772                 MP_WritePhyUshort(sc, 0x15, 0x018d);
11773                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11774                 MP_WritePhyUshort(sc, 0x15, 0x018e);
11775                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11776                 MP_WritePhyUshort(sc, 0x15, 0x018f);
11777                 MP_WritePhyUshort(sc, 0x19, 0x4806);
11778                 MP_WritePhyUshort(sc, 0x15, 0x0190);
11779                 MP_WritePhyUshort(sc, 0x19, 0x7c10);
11780                 MP_WritePhyUshort(sc, 0x15, 0x0191);
11781                 MP_WritePhyUshort(sc, 0x19, 0x5c10);
11782                 MP_WritePhyUshort(sc, 0x15, 0x0192);
11783                 MP_WritePhyUshort(sc, 0x19, 0x40fa);
11784                 MP_WritePhyUshort(sc, 0x15, 0x0193);
11785                 MP_WritePhyUshort(sc, 0x19, 0xa602);
11786                 MP_WritePhyUshort(sc, 0x15, 0x0194);
11787                 MP_WritePhyUshort(sc, 0x19, 0x4010);
11788                 MP_WritePhyUshort(sc, 0x15, 0x0195);
11789                 MP_WritePhyUshort(sc, 0x19, 0x4440);
11790                 MP_WritePhyUshort(sc, 0x15, 0x0196);
11791                 MP_WritePhyUshort(sc, 0x19, 0x9d00);
11792                 MP_WritePhyUshort(sc, 0x15, 0x0197);
11793                 MP_WritePhyUshort(sc, 0x19, 0x7c80);
11794                 MP_WritePhyUshort(sc, 0x15, 0x0198);
11795                 MP_WritePhyUshort(sc, 0x19, 0x6400);
11796                 MP_WritePhyUshort(sc, 0x15, 0x0199);
11797                 MP_WritePhyUshort(sc, 0x19, 0x4003);
11798                 MP_WritePhyUshort(sc, 0x15, 0x019a);
11799                 MP_WritePhyUshort(sc, 0x19, 0x4540);
11800                 MP_WritePhyUshort(sc, 0x15, 0x019b);
11801                 MP_WritePhyUshort(sc, 0x19, 0x7c08);
11802                 MP_WritePhyUshort(sc, 0x15, 0x019c);
11803                 MP_WritePhyUshort(sc, 0x19, 0x6008);
11804                 MP_WritePhyUshort(sc, 0x15, 0x019d);
11805                 MP_WritePhyUshort(sc, 0x19, 0x9f00);
11806                 MP_WritePhyUshort(sc, 0x15, 0x019e);
11807                 MP_WritePhyUshort(sc, 0x19, 0x7c40);
11808                 MP_WritePhyUshort(sc, 0x15, 0x019f);
11809                 MP_WritePhyUshort(sc, 0x19, 0x6400);
11810                 MP_WritePhyUshort(sc, 0x15, 0x01a0);
11811                 MP_WritePhyUshort(sc, 0x19, 0x7c80);
11812                 MP_WritePhyUshort(sc, 0x15, 0x01a1);
11813                 MP_WritePhyUshort(sc, 0x19, 0x6480);
11814                 MP_WritePhyUshort(sc, 0x15, 0x01a2);
11815                 MP_WritePhyUshort(sc, 0x19, 0x3140);
11816                 MP_WritePhyUshort(sc, 0x15, 0x01a3);
11817                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11818                 MP_WritePhyUshort(sc, 0x15, 0x01a4);
11819                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11820                 MP_WritePhyUshort(sc, 0x15, 0x01a5);
11821                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11822                 MP_WritePhyUshort(sc, 0x15, 0x01a6);
11823                 MP_WritePhyUshort(sc, 0x19, 0x4400);
11824                 MP_WritePhyUshort(sc, 0x15, 0x01a7);
11825                 MP_WritePhyUshort(sc, 0x19, 0x7c0b);
11826                 MP_WritePhyUshort(sc, 0x15, 0x01a8);
11827                 MP_WritePhyUshort(sc, 0x19, 0x6c01);
11828                 MP_WritePhyUshort(sc, 0x15, 0x01a9);
11829                 MP_WritePhyUshort(sc, 0x19, 0x64a8);
11830                 MP_WritePhyUshort(sc, 0x15, 0x01aa);
11831                 MP_WritePhyUshort(sc, 0x19, 0x6800);
11832                 MP_WritePhyUshort(sc, 0x15, 0x01ab);
11833                 MP_WritePhyUshort(sc, 0x19, 0x5cf0);
11834                 MP_WritePhyUshort(sc, 0x15, 0x01ac);
11835                 MP_WritePhyUshort(sc, 0x19, 0x588f);
11836                 MP_WritePhyUshort(sc, 0x15, 0x01ad);
11837                 MP_WritePhyUshort(sc, 0x19, 0xb628);
11838                 MP_WritePhyUshort(sc, 0x15, 0x01ae);
11839                 MP_WritePhyUshort(sc, 0x19, 0xc053);
11840                 MP_WritePhyUshort(sc, 0x15, 0x01af);
11841                 MP_WritePhyUshort(sc, 0x19, 0x0026);
11842                 MP_WritePhyUshort(sc, 0x15, 0x01b0);
11843                 MP_WritePhyUshort(sc, 0x19, 0xc02d);
11844                 MP_WritePhyUshort(sc, 0x15, 0x01b1);
11845                 MP_WritePhyUshort(sc, 0x19, 0x0024);
11846                 MP_WritePhyUshort(sc, 0x15, 0x01b2);
11847                 MP_WritePhyUshort(sc, 0x19, 0xc603);
11848                 MP_WritePhyUshort(sc, 0x15, 0x01b3);
11849                 MP_WritePhyUshort(sc, 0x19, 0x0022);
11850                 MP_WritePhyUshort(sc, 0x15, 0x01b4);
11851                 MP_WritePhyUshort(sc, 0x19, 0x8cf9);
11852                 MP_WritePhyUshort(sc, 0x15, 0x01b5);
11853                 MP_WritePhyUshort(sc, 0x19, 0x31ba);
11854                 MP_WritePhyUshort(sc, 0x15, 0x01b6);
11855                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11856                 MP_WritePhyUshort(sc, 0x15, 0x01b7);
11857                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11858                 MP_WritePhyUshort(sc, 0x15, 0x01b8);
11859                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11860                 MP_WritePhyUshort(sc, 0x15, 0x01b9);
11861                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11862                 MP_WritePhyUshort(sc, 0x15, 0x01ba);
11863                 MP_WritePhyUshort(sc, 0x19, 0x4400);
11864                 MP_WritePhyUshort(sc, 0x15, 0x01bb);
11865                 MP_WritePhyUshort(sc, 0x19, 0x5420);
11866                 MP_WritePhyUshort(sc, 0x15, 0x01bc);
11867                 MP_WritePhyUshort(sc, 0x19, 0x4811);
11868                 MP_WritePhyUshort(sc, 0x15, 0x01bd);
11869                 MP_WritePhyUshort(sc, 0x19, 0x5000);
11870                 MP_WritePhyUshort(sc, 0x15, 0x01be);
11871                 MP_WritePhyUshort(sc, 0x19, 0x4801);
11872                 MP_WritePhyUshort(sc, 0x15, 0x01bf);
11873                 MP_WritePhyUshort(sc, 0x19, 0x6800);
11874                 MP_WritePhyUshort(sc, 0x15, 0x01c0);
11875                 MP_WritePhyUshort(sc, 0x19, 0x31f5);
11876                 MP_WritePhyUshort(sc, 0x15, 0x01c1);
11877                 MP_WritePhyUshort(sc, 0x19, 0xb614);
11878                 MP_WritePhyUshort(sc, 0x15, 0x01c2);
11879                 MP_WritePhyUshort(sc, 0x19, 0x8ce4);
11880                 MP_WritePhyUshort(sc, 0x15, 0x01c3);
11881                 MP_WritePhyUshort(sc, 0x19, 0xb30c);
11882                 MP_WritePhyUshort(sc, 0x15, 0x01c4);
11883                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
11884                 MP_WritePhyUshort(sc, 0x15, 0x01c5);
11885                 MP_WritePhyUshort(sc, 0x19, 0x6c02);
11886                 MP_WritePhyUshort(sc, 0x15, 0x01c6);
11887                 MP_WritePhyUshort(sc, 0x19, 0x8206);
11888                 MP_WritePhyUshort(sc, 0x15, 0x01c7);
11889                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
11890                 MP_WritePhyUshort(sc, 0x15, 0x01c8);
11891                 MP_WritePhyUshort(sc, 0x19, 0x6c00);
11892                 MP_WritePhyUshort(sc, 0x15, 0x01c9);
11893                 MP_WritePhyUshort(sc, 0x19, 0x7c04);
11894                 MP_WritePhyUshort(sc, 0x15, 0x01ca);
11895                 MP_WritePhyUshort(sc, 0x19, 0x7404);
11896                 MP_WritePhyUshort(sc, 0x15, 0x01cb);
11897                 MP_WritePhyUshort(sc, 0x19, 0x31c0);
11898                 MP_WritePhyUshort(sc, 0x15, 0x01cc);
11899                 MP_WritePhyUshort(sc, 0x19, 0x7c04);
11900                 MP_WritePhyUshort(sc, 0x15, 0x01cd);
11901                 MP_WritePhyUshort(sc, 0x19, 0x7400);
11902                 MP_WritePhyUshort(sc, 0x15, 0x01ce);
11903                 MP_WritePhyUshort(sc, 0x19, 0x31c0);
11904                 MP_WritePhyUshort(sc, 0x15, 0x01cf);
11905                 MP_WritePhyUshort(sc, 0x19, 0x8df1);
11906                 MP_WritePhyUshort(sc, 0x15, 0x01d0);
11907                 MP_WritePhyUshort(sc, 0x19, 0x3248);
11908                 MP_WritePhyUshort(sc, 0x15, 0x01d1);
11909                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11910                 MP_WritePhyUshort(sc, 0x15, 0x01d2);
11911                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11912                 MP_WritePhyUshort(sc, 0x15, 0x01d3);
11913                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11914                 MP_WritePhyUshort(sc, 0x15, 0x01d4);
11915                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11916                 MP_WritePhyUshort(sc, 0x15, 0x01d5);
11917                 MP_WritePhyUshort(sc, 0x19, 0x4400);
11918                 MP_WritePhyUshort(sc, 0x15, 0x01d6);
11919                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
11920                 MP_WritePhyUshort(sc, 0x15, 0x01d7);
11921                 MP_WritePhyUshort(sc, 0x19, 0x6c03);
11922                 MP_WritePhyUshort(sc, 0x15, 0x01d8);
11923                 MP_WritePhyUshort(sc, 0x19, 0x7670);
11924                 MP_WritePhyUshort(sc, 0x15, 0x01d9);
11925                 MP_WritePhyUshort(sc, 0x19, 0x4023);
11926                 MP_WritePhyUshort(sc, 0x15, 0x01da);
11927                 MP_WritePhyUshort(sc, 0x19, 0x4500);
11928                 MP_WritePhyUshort(sc, 0x15, 0x01db);
11929                 MP_WritePhyUshort(sc, 0x19, 0x4069);
11930                 MP_WritePhyUshort(sc, 0x15, 0x01dc);
11931                 MP_WritePhyUshort(sc, 0x19, 0x4580);
11932                 MP_WritePhyUshort(sc, 0x15, 0x01dd);
11933                 MP_WritePhyUshort(sc, 0x19, 0x9f00);
11934                 MP_WritePhyUshort(sc, 0x15, 0x01de);
11935                 MP_WritePhyUshort(sc, 0x19, 0xcff5);
11936                 MP_WritePhyUshort(sc, 0x15, 0x01df);
11937                 MP_WritePhyUshort(sc, 0x19, 0x00ff);
11938                 MP_WritePhyUshort(sc, 0x15, 0x01e0);
11939                 MP_WritePhyUshort(sc, 0x19, 0x76f0);
11940                 MP_WritePhyUshort(sc, 0x15, 0x01e1);
11941                 MP_WritePhyUshort(sc, 0x19, 0x4400);
11942                 MP_WritePhyUshort(sc, 0x15, 0x01e2);
11943                 MP_WritePhyUshort(sc, 0x19, 0x4023);
11944                 MP_WritePhyUshort(sc, 0x15, 0x01e3);
11945                 MP_WritePhyUshort(sc, 0x19, 0x4500);
11946                 MP_WritePhyUshort(sc, 0x15, 0x01e4);
11947                 MP_WritePhyUshort(sc, 0x19, 0x4069);
11948                 MP_WritePhyUshort(sc, 0x15, 0x01e5);
11949                 MP_WritePhyUshort(sc, 0x19, 0x4580);
11950                 MP_WritePhyUshort(sc, 0x15, 0x01e6);
11951                 MP_WritePhyUshort(sc, 0x19, 0x9f00);
11952                 MP_WritePhyUshort(sc, 0x15, 0x01e7);
11953                 MP_WritePhyUshort(sc, 0x19, 0xd0f5);
11954                 MP_WritePhyUshort(sc, 0x15, 0x01e8);
11955                 MP_WritePhyUshort(sc, 0x19, 0x00ff);
11956                 MP_WritePhyUshort(sc, 0x15, 0x01e9);
11957                 MP_WritePhyUshort(sc, 0x19, 0x4400);
11958                 MP_WritePhyUshort(sc, 0x15, 0x01ea);
11959                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
11960                 MP_WritePhyUshort(sc, 0x15, 0x01eb);
11961                 MP_WritePhyUshort(sc, 0x19, 0x6800);
11962                 MP_WritePhyUshort(sc, 0x15, 0x01ec);
11963                 MP_WritePhyUshort(sc, 0x19, 0x66a0);
11964                 MP_WritePhyUshort(sc, 0x15, 0x01ed);
11965                 MP_WritePhyUshort(sc, 0x19, 0x8300);
11966                 MP_WritePhyUshort(sc, 0x15, 0x01ee);
11967                 MP_WritePhyUshort(sc, 0x19, 0x74f0);
11968                 MP_WritePhyUshort(sc, 0x15, 0x01ef);
11969                 MP_WritePhyUshort(sc, 0x19, 0x3006);
11970                 MP_WritePhyUshort(sc, 0x15, 0x01f0);
11971                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11972                 MP_WritePhyUshort(sc, 0x15, 0x01f1);
11973                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11974                 MP_WritePhyUshort(sc, 0x15, 0x01f2);
11975                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11976                 MP_WritePhyUshort(sc, 0x15, 0x01f3);
11977                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11978                 MP_WritePhyUshort(sc, 0x15, 0x01f4);
11979                 MP_WritePhyUshort(sc, 0x19, 0x0000);
11980                 MP_WritePhyUshort(sc, 0x15, 0x01f5);
11981                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
11982                 MP_WritePhyUshort(sc, 0x15, 0x01f6);
11983                 MP_WritePhyUshort(sc, 0x19, 0x6c02);
11984                 MP_WritePhyUshort(sc, 0x15, 0x01f7);
11985                 MP_WritePhyUshort(sc, 0x19, 0x409d);
11986                 MP_WritePhyUshort(sc, 0x15, 0x01f8);
11987                 MP_WritePhyUshort(sc, 0x19, 0x7c87);
11988                 MP_WritePhyUshort(sc, 0x15, 0x01f9);
11989                 MP_WritePhyUshort(sc, 0x19, 0xae14);
11990                 MP_WritePhyUshort(sc, 0x15, 0x01fa);
11991                 MP_WritePhyUshort(sc, 0x19, 0x4400);
11992                 MP_WritePhyUshort(sc, 0x15, 0x01fb);
11993                 MP_WritePhyUshort(sc, 0x19, 0x7c40);
11994                 MP_WritePhyUshort(sc, 0x15, 0x01fc);
11995                 MP_WritePhyUshort(sc, 0x19, 0x6800);
11996                 MP_WritePhyUshort(sc, 0x15, 0x01fd);
11997                 MP_WritePhyUshort(sc, 0x19, 0x7801);
11998                 MP_WritePhyUshort(sc, 0x15, 0x01fe);
11999                 MP_WritePhyUshort(sc, 0x19, 0x980e);
12000                 MP_WritePhyUshort(sc, 0x15, 0x01ff);
12001                 MP_WritePhyUshort(sc, 0x19, 0x930c);
12002                 MP_WritePhyUshort(sc, 0x15, 0x0200);
12003                 MP_WritePhyUshort(sc, 0x19, 0x9206);
12004                 MP_WritePhyUshort(sc, 0x15, 0x0201);
12005                 MP_WritePhyUshort(sc, 0x19, 0x4002);
12006                 MP_WritePhyUshort(sc, 0x15, 0x0202);
12007                 MP_WritePhyUshort(sc, 0x19, 0x7800);
12008                 MP_WritePhyUshort(sc, 0x15, 0x0203);
12009                 MP_WritePhyUshort(sc, 0x19, 0x588f);
12010                 MP_WritePhyUshort(sc, 0x15, 0x0204);
12011                 MP_WritePhyUshort(sc, 0x19, 0x5520);
12012                 MP_WritePhyUshort(sc, 0x15, 0x0205);
12013                 MP_WritePhyUshort(sc, 0x19, 0x320c);
12014                 MP_WritePhyUshort(sc, 0x15, 0x0206);
12015                 MP_WritePhyUshort(sc, 0x19, 0x4000);
12016                 MP_WritePhyUshort(sc, 0x15, 0x0207);
12017                 MP_WritePhyUshort(sc, 0x19, 0x7800);
12018                 MP_WritePhyUshort(sc, 0x15, 0x0208);
12019                 MP_WritePhyUshort(sc, 0x19, 0x588d);
12020                 MP_WritePhyUshort(sc, 0x15, 0x0209);
12021                 MP_WritePhyUshort(sc, 0x19, 0x5500);
12022                 MP_WritePhyUshort(sc, 0x15, 0x020a);
12023                 MP_WritePhyUshort(sc, 0x19, 0x320c);
12024                 MP_WritePhyUshort(sc, 0x15, 0x020b);
12025                 MP_WritePhyUshort(sc, 0x19, 0x4002);
12026                 MP_WritePhyUshort(sc, 0x15, 0x020c);
12027                 MP_WritePhyUshort(sc, 0x19, 0x3220);
12028                 MP_WritePhyUshort(sc, 0x15, 0x020d);
12029                 MP_WritePhyUshort(sc, 0x19, 0x4480);
12030                 MP_WritePhyUshort(sc, 0x15, 0x020e);
12031                 MP_WritePhyUshort(sc, 0x19, 0x9e03);
12032                 MP_WritePhyUshort(sc, 0x15, 0x020f);
12033                 MP_WritePhyUshort(sc, 0x19, 0x7c40);
12034                 MP_WritePhyUshort(sc, 0x15, 0x0210);
12035                 MP_WritePhyUshort(sc, 0x19, 0x6840);
12036                 MP_WritePhyUshort(sc, 0x15, 0x0211);
12037                 MP_WritePhyUshort(sc, 0x19, 0x7801);
12038                 MP_WritePhyUshort(sc, 0x15, 0x0212);
12039                 MP_WritePhyUshort(sc, 0x19, 0x980e);
12040                 MP_WritePhyUshort(sc, 0x15, 0x0213);
12041                 MP_WritePhyUshort(sc, 0x19, 0x930c);
12042                 MP_WritePhyUshort(sc, 0x15, 0x0214);
12043                 MP_WritePhyUshort(sc, 0x19, 0x9206);
12044                 MP_WritePhyUshort(sc, 0x15, 0x0215);
12045                 MP_WritePhyUshort(sc, 0x19, 0x4000);
12046                 MP_WritePhyUshort(sc, 0x15, 0x0216);
12047                 MP_WritePhyUshort(sc, 0x19, 0x7800);
12048                 MP_WritePhyUshort(sc, 0x15, 0x0217);
12049                 MP_WritePhyUshort(sc, 0x19, 0x588f);
12050                 MP_WritePhyUshort(sc, 0x15, 0x0218);
12051                 MP_WritePhyUshort(sc, 0x19, 0x5520);
12052                 MP_WritePhyUshort(sc, 0x15, 0x0219);
12053                 MP_WritePhyUshort(sc, 0x19, 0x3220);
12054                 MP_WritePhyUshort(sc, 0x15, 0x021a);
12055                 MP_WritePhyUshort(sc, 0x19, 0x4002);
12056                 MP_WritePhyUshort(sc, 0x15, 0x021b);
12057                 MP_WritePhyUshort(sc, 0x19, 0x7800);
12058                 MP_WritePhyUshort(sc, 0x15, 0x021c);
12059                 MP_WritePhyUshort(sc, 0x19, 0x588d);
12060                 MP_WritePhyUshort(sc, 0x15, 0x021d);
12061                 MP_WritePhyUshort(sc, 0x19, 0x5540);
12062                 MP_WritePhyUshort(sc, 0x15, 0x021e);
12063                 MP_WritePhyUshort(sc, 0x19, 0x3220);
12064                 MP_WritePhyUshort(sc, 0x15, 0x021f);
12065                 MP_WritePhyUshort(sc, 0x19, 0x4000);
12066                 MP_WritePhyUshort(sc, 0x15, 0x0220);
12067                 MP_WritePhyUshort(sc, 0x19, 0x7800);
12068                 MP_WritePhyUshort(sc, 0x15, 0x0221);
12069                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
12070                 MP_WritePhyUshort(sc, 0x15, 0x0222);
12071                 MP_WritePhyUshort(sc, 0x19, 0x6c00);
12072                 MP_WritePhyUshort(sc, 0x15, 0x0223);
12073                 MP_WritePhyUshort(sc, 0x19, 0x3231);
12074                 MP_WritePhyUshort(sc, 0x15, 0x0224);
12075                 MP_WritePhyUshort(sc, 0x19, 0xab06);
12076                 MP_WritePhyUshort(sc, 0x15, 0x0225);
12077                 MP_WritePhyUshort(sc, 0x19, 0xbf08);
12078                 MP_WritePhyUshort(sc, 0x15, 0x0226);
12079                 MP_WritePhyUshort(sc, 0x19, 0x4076);
12080                 MP_WritePhyUshort(sc, 0x15, 0x0227);
12081                 MP_WritePhyUshort(sc, 0x19, 0x7d07);
12082                 MP_WritePhyUshort(sc, 0x15, 0x0228);
12083                 MP_WritePhyUshort(sc, 0x19, 0x4502);
12084                 MP_WritePhyUshort(sc, 0x15, 0x0229);
12085                 MP_WritePhyUshort(sc, 0x19, 0x3231);
12086                 MP_WritePhyUshort(sc, 0x15, 0x022a);
12087                 MP_WritePhyUshort(sc, 0x19, 0x7d80);
12088                 MP_WritePhyUshort(sc, 0x15, 0x022b);
12089                 MP_WritePhyUshort(sc, 0x19, 0x5180);
12090                 MP_WritePhyUshort(sc, 0x15, 0x022c);
12091                 MP_WritePhyUshort(sc, 0x19, 0x322f);
12092                 MP_WritePhyUshort(sc, 0x15, 0x022d);
12093                 MP_WritePhyUshort(sc, 0x19, 0x7d80);
12094                 MP_WritePhyUshort(sc, 0x15, 0x022e);
12095                 MP_WritePhyUshort(sc, 0x19, 0x5000);
12096                 MP_WritePhyUshort(sc, 0x15, 0x022f);
12097                 MP_WritePhyUshort(sc, 0x19, 0x7d07);
12098                 MP_WritePhyUshort(sc, 0x15, 0x0230);
12099                 MP_WritePhyUshort(sc, 0x19, 0x4402);
12100                 MP_WritePhyUshort(sc, 0x15, 0x0231);
12101                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
12102                 MP_WritePhyUshort(sc, 0x15, 0x0232);
12103                 MP_WritePhyUshort(sc, 0x19, 0x6c02);
12104                 MP_WritePhyUshort(sc, 0x15, 0x0233);
12105                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
12106                 MP_WritePhyUshort(sc, 0x15, 0x0234);
12107                 MP_WritePhyUshort(sc, 0x19, 0xb309);
12108                 MP_WritePhyUshort(sc, 0x15, 0x0235);
12109                 MP_WritePhyUshort(sc, 0x19, 0xb204);
12110                 MP_WritePhyUshort(sc, 0x15, 0x0236);
12111                 MP_WritePhyUshort(sc, 0x19, 0xb105);
12112                 MP_WritePhyUshort(sc, 0x15, 0x0237);
12113                 MP_WritePhyUshort(sc, 0x19, 0x6c00);
12114                 MP_WritePhyUshort(sc, 0x15, 0x0238);
12115                 MP_WritePhyUshort(sc, 0x19, 0x31c1);
12116                 MP_WritePhyUshort(sc, 0x15, 0x0239);
12117                 MP_WritePhyUshort(sc, 0x19, 0x6c00);
12118                 MP_WritePhyUshort(sc, 0x15, 0x023a);
12119                 MP_WritePhyUshort(sc, 0x19, 0x3261);
12120                 MP_WritePhyUshort(sc, 0x15, 0x023b);
12121                 MP_WritePhyUshort(sc, 0x19, 0x6c00);
12122                 MP_WritePhyUshort(sc, 0x15, 0x023c);
12123                 MP_WritePhyUshort(sc, 0x19, 0x3250);
12124                 MP_WritePhyUshort(sc, 0x15, 0x023d);
12125                 MP_WritePhyUshort(sc, 0x19, 0xb203);
12126                 MP_WritePhyUshort(sc, 0x15, 0x023e);
12127                 MP_WritePhyUshort(sc, 0x19, 0x6c00);
12128                 MP_WritePhyUshort(sc, 0x15, 0x023f);
12129                 MP_WritePhyUshort(sc, 0x19, 0x327a);
12130                 MP_WritePhyUshort(sc, 0x15, 0x0240);
12131                 MP_WritePhyUshort(sc, 0x19, 0x6c00);
12132                 MP_WritePhyUshort(sc, 0x15, 0x0241);
12133                 MP_WritePhyUshort(sc, 0x19, 0x3293);
12134                 MP_WritePhyUshort(sc, 0x15, 0x0242);
12135                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12136                 MP_WritePhyUshort(sc, 0x15, 0x0243);
12137                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12138                 MP_WritePhyUshort(sc, 0x15, 0x0244);
12139                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12140                 MP_WritePhyUshort(sc, 0x15, 0x0245);
12141                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12142                 MP_WritePhyUshort(sc, 0x15, 0x0246);
12143                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12144                 MP_WritePhyUshort(sc, 0x15, 0x0247);
12145                 MP_WritePhyUshort(sc, 0x19, 0x32a3);
12146                 MP_WritePhyUshort(sc, 0x15, 0x0248);
12147                 MP_WritePhyUshort(sc, 0x19, 0x5520);
12148                 MP_WritePhyUshort(sc, 0x15, 0x0249);
12149                 MP_WritePhyUshort(sc, 0x19, 0x403d);
12150                 MP_WritePhyUshort(sc, 0x15, 0x024a);
12151                 MP_WritePhyUshort(sc, 0x19, 0x440c);
12152                 MP_WritePhyUshort(sc, 0x15, 0x024b);
12153                 MP_WritePhyUshort(sc, 0x19, 0x4812);
12154                 MP_WritePhyUshort(sc, 0x15, 0x024c);
12155                 MP_WritePhyUshort(sc, 0x19, 0x5001);
12156                 MP_WritePhyUshort(sc, 0x15, 0x024d);
12157                 MP_WritePhyUshort(sc, 0x19, 0x4802);
12158                 MP_WritePhyUshort(sc, 0x15, 0x024e);
12159                 MP_WritePhyUshort(sc, 0x19, 0x6880);
12160                 MP_WritePhyUshort(sc, 0x15, 0x024f);
12161                 MP_WritePhyUshort(sc, 0x19, 0x31f5);
12162                 MP_WritePhyUshort(sc, 0x15, 0x0250);
12163                 MP_WritePhyUshort(sc, 0x19, 0xb685);
12164                 MP_WritePhyUshort(sc, 0x15, 0x0251);
12165                 MP_WritePhyUshort(sc, 0x19, 0x801c);
12166                 MP_WritePhyUshort(sc, 0x15, 0x0252);
12167                 MP_WritePhyUshort(sc, 0x19, 0xbaf5);
12168                 MP_WritePhyUshort(sc, 0x15, 0x0253);
12169                 MP_WritePhyUshort(sc, 0x19, 0xc07c);
12170                 MP_WritePhyUshort(sc, 0x15, 0x0254);
12171                 MP_WritePhyUshort(sc, 0x19, 0x00fb);
12172                 MP_WritePhyUshort(sc, 0x15, 0x0255);
12173                 MP_WritePhyUshort(sc, 0x19, 0x325a);
12174                 MP_WritePhyUshort(sc, 0x15, 0x0256);
12175                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12176                 MP_WritePhyUshort(sc, 0x15, 0x0257);
12177                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12178                 MP_WritePhyUshort(sc, 0x15, 0x0258);
12179                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12180                 MP_WritePhyUshort(sc, 0x15, 0x0259);
12181                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12182                 MP_WritePhyUshort(sc, 0x15, 0x025a);
12183                 MP_WritePhyUshort(sc, 0x19, 0x481a);
12184                 MP_WritePhyUshort(sc, 0x15, 0x025b);
12185                 MP_WritePhyUshort(sc, 0x19, 0x5001);
12186                 MP_WritePhyUshort(sc, 0x15, 0x025c);
12187                 MP_WritePhyUshort(sc, 0x19, 0x401b);
12188                 MP_WritePhyUshort(sc, 0x15, 0x025d);
12189                 MP_WritePhyUshort(sc, 0x19, 0x480a);
12190                 MP_WritePhyUshort(sc, 0x15, 0x025e);
12191                 MP_WritePhyUshort(sc, 0x19, 0x4418);
12192                 MP_WritePhyUshort(sc, 0x15, 0x025f);
12193                 MP_WritePhyUshort(sc, 0x19, 0x6900);
12194                 MP_WritePhyUshort(sc, 0x15, 0x0260);
12195                 MP_WritePhyUshort(sc, 0x19, 0x31f5);
12196                 MP_WritePhyUshort(sc, 0x15, 0x0261);
12197                 MP_WritePhyUshort(sc, 0x19, 0xb64b);
12198                 MP_WritePhyUshort(sc, 0x15, 0x0262);
12199                 MP_WritePhyUshort(sc, 0x19, 0xdb00);
12200                 MP_WritePhyUshort(sc, 0x15, 0x0263);
12201                 MP_WritePhyUshort(sc, 0x19, 0x0048);
12202                 MP_WritePhyUshort(sc, 0x15, 0x0264);
12203                 MP_WritePhyUshort(sc, 0x19, 0xdb7d);
12204                 MP_WritePhyUshort(sc, 0x15, 0x0265);
12205                 MP_WritePhyUshort(sc, 0x19, 0x0002);
12206                 MP_WritePhyUshort(sc, 0x15, 0x0266);
12207                 MP_WritePhyUshort(sc, 0x19, 0xa0fa);
12208                 MP_WritePhyUshort(sc, 0x15, 0x0267);
12209                 MP_WritePhyUshort(sc, 0x19, 0x4408);
12210                 MP_WritePhyUshort(sc, 0x15, 0x0268);
12211                 MP_WritePhyUshort(sc, 0x19, 0x3248);
12212                 MP_WritePhyUshort(sc, 0x15, 0x0269);
12213                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12214                 MP_WritePhyUshort(sc, 0x15, 0x026a);
12215                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12216                 MP_WritePhyUshort(sc, 0x15, 0x026b);
12217                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12218                 MP_WritePhyUshort(sc, 0x15, 0x026c);
12219                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12220                 MP_WritePhyUshort(sc, 0x15, 0x026d);
12221                 MP_WritePhyUshort(sc, 0x19, 0xb806);
12222                 MP_WritePhyUshort(sc, 0x15, 0x026e);
12223                 MP_WritePhyUshort(sc, 0x19, 0x588d);
12224                 MP_WritePhyUshort(sc, 0x15, 0x026f);
12225                 MP_WritePhyUshort(sc, 0x19, 0x5500);
12226                 MP_WritePhyUshort(sc, 0x15, 0x0270);
12227                 MP_WritePhyUshort(sc, 0x19, 0x7801);
12228                 MP_WritePhyUshort(sc, 0x15, 0x0271);
12229                 MP_WritePhyUshort(sc, 0x19, 0x4002);
12230                 MP_WritePhyUshort(sc, 0x15, 0x0272);
12231                 MP_WritePhyUshort(sc, 0x19, 0x7800);
12232                 MP_WritePhyUshort(sc, 0x15, 0x0273);
12233                 MP_WritePhyUshort(sc, 0x19, 0x4814);
12234                 MP_WritePhyUshort(sc, 0x15, 0x0274);
12235                 MP_WritePhyUshort(sc, 0x19, 0x500b);
12236                 MP_WritePhyUshort(sc, 0x15, 0x0275);
12237                 MP_WritePhyUshort(sc, 0x19, 0x4804);
12238                 MP_WritePhyUshort(sc, 0x15, 0x0276);
12239                 MP_WritePhyUshort(sc, 0x19, 0x40c4);
12240                 MP_WritePhyUshort(sc, 0x15, 0x0277);
12241                 MP_WritePhyUshort(sc, 0x19, 0x4425);
12242                 MP_WritePhyUshort(sc, 0x15, 0x0278);
12243                 MP_WritePhyUshort(sc, 0x19, 0x6a00);
12244                 MP_WritePhyUshort(sc, 0x15, 0x0279);
12245                 MP_WritePhyUshort(sc, 0x19, 0x31f5);
12246                 MP_WritePhyUshort(sc, 0x15, 0x027a);
12247                 MP_WritePhyUshort(sc, 0x19, 0xb632);
12248                 MP_WritePhyUshort(sc, 0x15, 0x027b);
12249                 MP_WritePhyUshort(sc, 0x19, 0xdc03);
12250                 MP_WritePhyUshort(sc, 0x15, 0x027c);
12251                 MP_WritePhyUshort(sc, 0x19, 0x0027);
12252                 MP_WritePhyUshort(sc, 0x15, 0x027d);
12253                 MP_WritePhyUshort(sc, 0x19, 0x80fc);
12254                 MP_WritePhyUshort(sc, 0x15, 0x027e);
12255                 MP_WritePhyUshort(sc, 0x19, 0x3283);
12256                 MP_WritePhyUshort(sc, 0x15, 0x027f);
12257                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12258                 MP_WritePhyUshort(sc, 0x15, 0x0280);
12259                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12260                 MP_WritePhyUshort(sc, 0x15, 0x0281);
12261                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12262                 MP_WritePhyUshort(sc, 0x15, 0x0282);
12263                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12264                 MP_WritePhyUshort(sc, 0x15, 0x0283);
12265                 MP_WritePhyUshort(sc, 0x19, 0xb806);
12266                 MP_WritePhyUshort(sc, 0x15, 0x0284);
12267                 MP_WritePhyUshort(sc, 0x19, 0x588f);
12268                 MP_WritePhyUshort(sc, 0x15, 0x0285);
12269                 MP_WritePhyUshort(sc, 0x19, 0x5520);
12270                 MP_WritePhyUshort(sc, 0x15, 0x0286);
12271                 MP_WritePhyUshort(sc, 0x19, 0x7801);
12272                 MP_WritePhyUshort(sc, 0x15, 0x0287);
12273                 MP_WritePhyUshort(sc, 0x19, 0x4000);
12274                 MP_WritePhyUshort(sc, 0x15, 0x0288);
12275                 MP_WritePhyUshort(sc, 0x19, 0x7800);
12276                 MP_WritePhyUshort(sc, 0x15, 0x0289);
12277                 MP_WritePhyUshort(sc, 0x19, 0x4818);
12278                 MP_WritePhyUshort(sc, 0x15, 0x028a);
12279                 MP_WritePhyUshort(sc, 0x19, 0x5051);
12280                 MP_WritePhyUshort(sc, 0x15, 0x028b);
12281                 MP_WritePhyUshort(sc, 0x19, 0x4808);
12282                 MP_WritePhyUshort(sc, 0x15, 0x028c);
12283                 MP_WritePhyUshort(sc, 0x19, 0x4050);
12284                 MP_WritePhyUshort(sc, 0x15, 0x028d);
12285                 MP_WritePhyUshort(sc, 0x19, 0x4462);
12286                 MP_WritePhyUshort(sc, 0x15, 0x028e);
12287                 MP_WritePhyUshort(sc, 0x19, 0x40c4);
12288                 MP_WritePhyUshort(sc, 0x15, 0x028f);
12289                 MP_WritePhyUshort(sc, 0x19, 0x4473);
12290                 MP_WritePhyUshort(sc, 0x15, 0x0290);
12291                 MP_WritePhyUshort(sc, 0x19, 0x5041);
12292                 MP_WritePhyUshort(sc, 0x15, 0x0291);
12293                 MP_WritePhyUshort(sc, 0x19, 0x6b00);
12294                 MP_WritePhyUshort(sc, 0x15, 0x0292);
12295                 MP_WritePhyUshort(sc, 0x19, 0x31f5);
12296                 MP_WritePhyUshort(sc, 0x15, 0x0293);
12297                 MP_WritePhyUshort(sc, 0x19, 0xb619);
12298                 MP_WritePhyUshort(sc, 0x15, 0x0294);
12299                 MP_WritePhyUshort(sc, 0x19, 0x80d9);
12300                 MP_WritePhyUshort(sc, 0x15, 0x0295);
12301                 MP_WritePhyUshort(sc, 0x19, 0xbd06);
12302                 MP_WritePhyUshort(sc, 0x15, 0x0296);
12303                 MP_WritePhyUshort(sc, 0x19, 0xbb0d);
12304                 MP_WritePhyUshort(sc, 0x15, 0x0297);
12305                 MP_WritePhyUshort(sc, 0x19, 0xaf14);
12306                 MP_WritePhyUshort(sc, 0x15, 0x0298);
12307                 MP_WritePhyUshort(sc, 0x19, 0x8efa);
12308                 MP_WritePhyUshort(sc, 0x15, 0x0299);
12309                 MP_WritePhyUshort(sc, 0x19, 0x5049);
12310                 MP_WritePhyUshort(sc, 0x15, 0x029a);
12311                 MP_WritePhyUshort(sc, 0x19, 0x3248);
12312                 MP_WritePhyUshort(sc, 0x15, 0x029b);
12313                 MP_WritePhyUshort(sc, 0x19, 0x4c10);
12314                 MP_WritePhyUshort(sc, 0x15, 0x029c);
12315                 MP_WritePhyUshort(sc, 0x19, 0x44b0);
12316                 MP_WritePhyUshort(sc, 0x15, 0x029d);
12317                 MP_WritePhyUshort(sc, 0x19, 0x4c00);
12318                 MP_WritePhyUshort(sc, 0x15, 0x029e);
12319                 MP_WritePhyUshort(sc, 0x19, 0x3292);
12320                 MP_WritePhyUshort(sc, 0x15, 0x029f);
12321                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12322                 MP_WritePhyUshort(sc, 0x15, 0x02a0);
12323                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12324                 MP_WritePhyUshort(sc, 0x15, 0x02a1);
12325                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12326                 MP_WritePhyUshort(sc, 0x15, 0x02a2);
12327                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12328                 MP_WritePhyUshort(sc, 0x15, 0x02a3);
12329                 MP_WritePhyUshort(sc, 0x19, 0x481f);
12330                 MP_WritePhyUshort(sc, 0x15, 0x02a4);
12331                 MP_WritePhyUshort(sc, 0x19, 0x5005);
12332                 MP_WritePhyUshort(sc, 0x15, 0x02a5);
12333                 MP_WritePhyUshort(sc, 0x19, 0x480f);
12334                 MP_WritePhyUshort(sc, 0x15, 0x02a6);
12335                 MP_WritePhyUshort(sc, 0x19, 0xac00);
12336                 MP_WritePhyUshort(sc, 0x15, 0x02a7);
12337                 MP_WritePhyUshort(sc, 0x19, 0x31a6);
12338                 MP_WritePhyUshort(sc, 0x15, 0x02a8);
12339                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12340                 MP_WritePhyUshort(sc, 0x15, 0x02a9);
12341                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12342                 MP_WritePhyUshort(sc, 0x15, 0x02aa);
12343                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12344                 MP_WritePhyUshort(sc, 0x15, 0x02ab);
12345                 MP_WritePhyUshort(sc, 0x19, 0x31ba);
12346                 MP_WritePhyUshort(sc, 0x15, 0x02ac);
12347                 MP_WritePhyUshort(sc, 0x19, 0x31d5);
12348                 MP_WritePhyUshort(sc, 0x15, 0x02ad);
12349                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12350                 MP_WritePhyUshort(sc, 0x15, 0x02ae);
12351                 MP_WritePhyUshort(sc, 0x19, 0x5cf0);
12352                 MP_WritePhyUshort(sc, 0x15, 0x02af);
12353                 MP_WritePhyUshort(sc, 0x19, 0x588c);
12354                 MP_WritePhyUshort(sc, 0x15, 0x02b0);
12355                 MP_WritePhyUshort(sc, 0x19, 0x542f);
12356                 MP_WritePhyUshort(sc, 0x15, 0x02b1);
12357                 MP_WritePhyUshort(sc, 0x19, 0x7ffb);
12358                 MP_WritePhyUshort(sc, 0x15, 0x02b2);
12359                 MP_WritePhyUshort(sc, 0x19, 0x6ff8);
12360                 MP_WritePhyUshort(sc, 0x15, 0x02b3);
12361                 MP_WritePhyUshort(sc, 0x19, 0x64a4);
12362                 MP_WritePhyUshort(sc, 0x15, 0x02b4);
12363                 MP_WritePhyUshort(sc, 0x19, 0x64a0);
12364                 MP_WritePhyUshort(sc, 0x15, 0x02b5);
12365                 MP_WritePhyUshort(sc, 0x19, 0x6800);
12366                 MP_WritePhyUshort(sc, 0x15, 0x02b6);
12367                 MP_WritePhyUshort(sc, 0x19, 0x4400);
12368                 MP_WritePhyUshort(sc, 0x15, 0x02b7);
12369                 MP_WritePhyUshort(sc, 0x19, 0x4020);
12370                 MP_WritePhyUshort(sc, 0x15, 0x02b8);
12371                 MP_WritePhyUshort(sc, 0x19, 0x4480);
12372                 MP_WritePhyUshort(sc, 0x15, 0x02b9);
12373                 MP_WritePhyUshort(sc, 0x19, 0x9e00);
12374                 MP_WritePhyUshort(sc, 0x15, 0x02ba);
12375                 MP_WritePhyUshort(sc, 0x19, 0x4891);
12376                 MP_WritePhyUshort(sc, 0x15, 0x02bb);
12377                 MP_WritePhyUshort(sc, 0x19, 0x4cc0);
12378                 MP_WritePhyUshort(sc, 0x15, 0x02bc);
12379                 MP_WritePhyUshort(sc, 0x19, 0x4801);
12380                 MP_WritePhyUshort(sc, 0x15, 0x02bd);
12381                 MP_WritePhyUshort(sc, 0x19, 0xa609);
12382                 MP_WritePhyUshort(sc, 0x15, 0x02be);
12383                 MP_WritePhyUshort(sc, 0x19, 0xd64f);
12384                 MP_WritePhyUshort(sc, 0x15, 0x02bf);
12385                 MP_WritePhyUshort(sc, 0x19, 0x004e);
12386                 MP_WritePhyUshort(sc, 0x15, 0x02c0);
12387                 MP_WritePhyUshort(sc, 0x19, 0x87fe);
12388                 MP_WritePhyUshort(sc, 0x15, 0x02c1);
12389                 MP_WritePhyUshort(sc, 0x19, 0x32c6);
12390                 MP_WritePhyUshort(sc, 0x15, 0x02c2);
12391                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12392                 MP_WritePhyUshort(sc, 0x15, 0x02c3);
12393                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12394                 MP_WritePhyUshort(sc, 0x15, 0x02c4);
12395                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12396                 MP_WritePhyUshort(sc, 0x15, 0x02c5);
12397                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12398                 MP_WritePhyUshort(sc, 0x15, 0x02c6);
12399                 MP_WritePhyUshort(sc, 0x19, 0x48b2);
12400                 MP_WritePhyUshort(sc, 0x15, 0x02c7);
12401                 MP_WritePhyUshort(sc, 0x19, 0x4020);
12402                 MP_WritePhyUshort(sc, 0x15, 0x02c8);
12403                 MP_WritePhyUshort(sc, 0x19, 0x4822);
12404                 MP_WritePhyUshort(sc, 0x15, 0x02c9);
12405                 MP_WritePhyUshort(sc, 0x19, 0x4488);
12406                 MP_WritePhyUshort(sc, 0x15, 0x02ca);
12407                 MP_WritePhyUshort(sc, 0x19, 0xd64f);
12408                 MP_WritePhyUshort(sc, 0x15, 0x02cb);
12409                 MP_WritePhyUshort(sc, 0x19, 0x0042);
12410                 MP_WritePhyUshort(sc, 0x15, 0x02cc);
12411                 MP_WritePhyUshort(sc, 0x19, 0x8203);
12412                 MP_WritePhyUshort(sc, 0x15, 0x02cd);
12413                 MP_WritePhyUshort(sc, 0x19, 0x4cc8);
12414                 MP_WritePhyUshort(sc, 0x15, 0x02ce);
12415                 MP_WritePhyUshort(sc, 0x19, 0x32d0);
12416                 MP_WritePhyUshort(sc, 0x15, 0x02cf);
12417                 MP_WritePhyUshort(sc, 0x19, 0x4cc0);
12418                 MP_WritePhyUshort(sc, 0x15, 0x02d0);
12419                 MP_WritePhyUshort(sc, 0x19, 0xc4d4);
12420                 MP_WritePhyUshort(sc, 0x15, 0x02d1);
12421                 MP_WritePhyUshort(sc, 0x19, 0x00f9);
12422                 MP_WritePhyUshort(sc, 0x15, 0x02d2);
12423                 MP_WritePhyUshort(sc, 0x19, 0xa51a);
12424                 MP_WritePhyUshort(sc, 0x15, 0x02d3);
12425                 MP_WritePhyUshort(sc, 0x19, 0x32d9);
12426                 MP_WritePhyUshort(sc, 0x15, 0x02d4);
12427                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12428                 MP_WritePhyUshort(sc, 0x15, 0x02d5);
12429                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12430                 MP_WritePhyUshort(sc, 0x15, 0x02d6);
12431                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12432                 MP_WritePhyUshort(sc, 0x15, 0x02d7);
12433                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12434                 MP_WritePhyUshort(sc, 0x15, 0x02d8);
12435                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12436                 MP_WritePhyUshort(sc, 0x15, 0x02d9);
12437                 MP_WritePhyUshort(sc, 0x19, 0x48b3);
12438                 MP_WritePhyUshort(sc, 0x15, 0x02da);
12439                 MP_WritePhyUshort(sc, 0x19, 0x4020);
12440                 MP_WritePhyUshort(sc, 0x15, 0x02db);
12441                 MP_WritePhyUshort(sc, 0x19, 0x4823);
12442                 MP_WritePhyUshort(sc, 0x15, 0x02dc);
12443                 MP_WritePhyUshort(sc, 0x19, 0x4410);
12444                 MP_WritePhyUshort(sc, 0x15, 0x02dd);
12445                 MP_WritePhyUshort(sc, 0x19, 0xb630);
12446                 MP_WritePhyUshort(sc, 0x15, 0x02de);
12447                 MP_WritePhyUshort(sc, 0x19, 0x7dc8);
12448                 MP_WritePhyUshort(sc, 0x15, 0x02df);
12449                 MP_WritePhyUshort(sc, 0x19, 0x8203);
12450                 MP_WritePhyUshort(sc, 0x15, 0x02e0);
12451                 MP_WritePhyUshort(sc, 0x19, 0x4c48);
12452                 MP_WritePhyUshort(sc, 0x15, 0x02e1);
12453                 MP_WritePhyUshort(sc, 0x19, 0x32e3);
12454                 MP_WritePhyUshort(sc, 0x15, 0x02e2);
12455                 MP_WritePhyUshort(sc, 0x19, 0x4c40);
12456                 MP_WritePhyUshort(sc, 0x15, 0x02e3);
12457                 MP_WritePhyUshort(sc, 0x19, 0x9bfa);
12458                 MP_WritePhyUshort(sc, 0x15, 0x02e4);
12459                 MP_WritePhyUshort(sc, 0x19, 0x84ca);
12460                 MP_WritePhyUshort(sc, 0x15, 0x02e5);
12461                 MP_WritePhyUshort(sc, 0x19, 0x85f8);
12462                 MP_WritePhyUshort(sc, 0x15, 0x02e6);
12463                 MP_WritePhyUshort(sc, 0x19, 0x32ec);
12464                 MP_WritePhyUshort(sc, 0x15, 0x02e7);
12465                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12466                 MP_WritePhyUshort(sc, 0x15, 0x02e8);
12467                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12468                 MP_WritePhyUshort(sc, 0x15, 0x02e9);
12469                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12470                 MP_WritePhyUshort(sc, 0x15, 0x02ea);
12471                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12472                 MP_WritePhyUshort(sc, 0x15, 0x02eb);
12473                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12474                 MP_WritePhyUshort(sc, 0x15, 0x02ec);
12475                 MP_WritePhyUshort(sc, 0x19, 0x48d4);
12476                 MP_WritePhyUshort(sc, 0x15, 0x02ed);
12477                 MP_WritePhyUshort(sc, 0x19, 0x4020);
12478                 MP_WritePhyUshort(sc, 0x15, 0x02ee);
12479                 MP_WritePhyUshort(sc, 0x19, 0x4844);
12480                 MP_WritePhyUshort(sc, 0x15, 0x02ef);
12481                 MP_WritePhyUshort(sc, 0x19, 0x4420);
12482                 MP_WritePhyUshort(sc, 0x15, 0x02f0);
12483                 MP_WritePhyUshort(sc, 0x19, 0x6800);
12484                 MP_WritePhyUshort(sc, 0x15, 0x02f1);
12485                 MP_WritePhyUshort(sc, 0x19, 0x7dc0);
12486                 MP_WritePhyUshort(sc, 0x15, 0x02f2);
12487                 MP_WritePhyUshort(sc, 0x19, 0x4c40);
12488                 MP_WritePhyUshort(sc, 0x15, 0x02f3);
12489                 MP_WritePhyUshort(sc, 0x19, 0x7c0b);
12490                 MP_WritePhyUshort(sc, 0x15, 0x02f4);
12491                 MP_WritePhyUshort(sc, 0x19, 0x6c08);
12492                 MP_WritePhyUshort(sc, 0x15, 0x02f5);
12493                 MP_WritePhyUshort(sc, 0x19, 0x3311);
12494                 MP_WritePhyUshort(sc, 0x15, 0x02f6);
12495                 MP_WritePhyUshort(sc, 0x19, 0x9cfd);
12496                 MP_WritePhyUshort(sc, 0x15, 0x02f7);
12497                 MP_WritePhyUshort(sc, 0x19, 0xb616);
12498                 MP_WritePhyUshort(sc, 0x15, 0x02f8);
12499                 MP_WritePhyUshort(sc, 0x19, 0xc42b);
12500                 MP_WritePhyUshort(sc, 0x15, 0x02f9);
12501                 MP_WritePhyUshort(sc, 0x19, 0x00e0);
12502                 MP_WritePhyUshort(sc, 0x15, 0x02fa);
12503                 MP_WritePhyUshort(sc, 0x19, 0xc455);
12504                 MP_WritePhyUshort(sc, 0x15, 0x02fb);
12505                 MP_WritePhyUshort(sc, 0x19, 0x00b3);
12506                 MP_WritePhyUshort(sc, 0x15, 0x02fc);
12507                 MP_WritePhyUshort(sc, 0x19, 0xb20a);
12508                 MP_WritePhyUshort(sc, 0x15, 0x02fd);
12509                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
12510                 MP_WritePhyUshort(sc, 0x15, 0x02fe);
12511                 MP_WritePhyUshort(sc, 0x19, 0x6c02);
12512                 MP_WritePhyUshort(sc, 0x15, 0x02ff);
12513                 MP_WritePhyUshort(sc, 0x19, 0x8204);
12514                 MP_WritePhyUshort(sc, 0x15, 0x0300);
12515                 MP_WritePhyUshort(sc, 0x19, 0x7c04);
12516                 MP_WritePhyUshort(sc, 0x15, 0x0301);
12517                 MP_WritePhyUshort(sc, 0x19, 0x7404);
12518                 MP_WritePhyUshort(sc, 0x15, 0x0302);
12519                 MP_WritePhyUshort(sc, 0x19, 0x32f3);
12520                 MP_WritePhyUshort(sc, 0x15, 0x0303);
12521                 MP_WritePhyUshort(sc, 0x19, 0x7c04);
12522                 MP_WritePhyUshort(sc, 0x15, 0x0304);
12523                 MP_WritePhyUshort(sc, 0x19, 0x7400);
12524                 MP_WritePhyUshort(sc, 0x15, 0x0305);
12525                 MP_WritePhyUshort(sc, 0x19, 0x32f3);
12526                 MP_WritePhyUshort(sc, 0x15, 0x0306);
12527                 MP_WritePhyUshort(sc, 0x19, 0xefed);
12528                 MP_WritePhyUshort(sc, 0x15, 0x0307);
12529                 MP_WritePhyUshort(sc, 0x19, 0x3342);
12530                 MP_WritePhyUshort(sc, 0x15, 0x0308);
12531                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12532                 MP_WritePhyUshort(sc, 0x15, 0x0309);
12533                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12534                 MP_WritePhyUshort(sc, 0x15, 0x030a);
12535                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12536                 MP_WritePhyUshort(sc, 0x15, 0x030b);
12537                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12538                 MP_WritePhyUshort(sc, 0x15, 0x030c);
12539                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12540                 MP_WritePhyUshort(sc, 0x15, 0x030d);
12541                 MP_WritePhyUshort(sc, 0x19, 0x3006);
12542                 MP_WritePhyUshort(sc, 0x15, 0x030e);
12543                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12544                 MP_WritePhyUshort(sc, 0x15, 0x030f);
12545                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12546                 MP_WritePhyUshort(sc, 0x15, 0x0310);
12547                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12548                 MP_WritePhyUshort(sc, 0x15, 0x0311);
12549                 MP_WritePhyUshort(sc, 0x19, 0x7c08);
12550                 MP_WritePhyUshort(sc, 0x15, 0x0312);
12551                 MP_WritePhyUshort(sc, 0x19, 0xa207);
12552                 MP_WritePhyUshort(sc, 0x15, 0x0313);
12553                 MP_WritePhyUshort(sc, 0x19, 0x4c00);
12554                 MP_WritePhyUshort(sc, 0x15, 0x0314);
12555                 MP_WritePhyUshort(sc, 0x19, 0x3322);
12556                 MP_WritePhyUshort(sc, 0x15, 0x0315);
12557                 MP_WritePhyUshort(sc, 0x19, 0x4041);
12558                 MP_WritePhyUshort(sc, 0x15, 0x0316);
12559                 MP_WritePhyUshort(sc, 0x19, 0x7d07);
12560                 MP_WritePhyUshort(sc, 0x15, 0x0317);
12561                 MP_WritePhyUshort(sc, 0x19, 0x4502);
12562                 MP_WritePhyUshort(sc, 0x15, 0x0318);
12563                 MP_WritePhyUshort(sc, 0x19, 0x3322);
12564                 MP_WritePhyUshort(sc, 0x15, 0x0319);
12565                 MP_WritePhyUshort(sc, 0x19, 0x4c08);
12566                 MP_WritePhyUshort(sc, 0x15, 0x031a);
12567                 MP_WritePhyUshort(sc, 0x19, 0x3322);
12568                 MP_WritePhyUshort(sc, 0x15, 0x031b);
12569                 MP_WritePhyUshort(sc, 0x19, 0x7d80);
12570                 MP_WritePhyUshort(sc, 0x15, 0x031c);
12571                 MP_WritePhyUshort(sc, 0x19, 0x5180);
12572                 MP_WritePhyUshort(sc, 0x15, 0x031d);
12573                 MP_WritePhyUshort(sc, 0x19, 0x3320);
12574                 MP_WritePhyUshort(sc, 0x15, 0x031e);
12575                 MP_WritePhyUshort(sc, 0x19, 0x7d80);
12576                 MP_WritePhyUshort(sc, 0x15, 0x031f);
12577                 MP_WritePhyUshort(sc, 0x19, 0x5000);
12578                 MP_WritePhyUshort(sc, 0x15, 0x0320);
12579                 MP_WritePhyUshort(sc, 0x19, 0x7d07);
12580                 MP_WritePhyUshort(sc, 0x15, 0x0321);
12581                 MP_WritePhyUshort(sc, 0x19, 0x4402);
12582                 MP_WritePhyUshort(sc, 0x15, 0x0322);
12583                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
12584                 MP_WritePhyUshort(sc, 0x15, 0x0323);
12585                 MP_WritePhyUshort(sc, 0x19, 0x6c02);
12586                 MP_WritePhyUshort(sc, 0x15, 0x0324);
12587                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
12588                 MP_WritePhyUshort(sc, 0x15, 0x0325);
12589                 MP_WritePhyUshort(sc, 0x19, 0xb30c);
12590                 MP_WritePhyUshort(sc, 0x15, 0x0326);
12591                 MP_WritePhyUshort(sc, 0x19, 0xb206);
12592                 MP_WritePhyUshort(sc, 0x15, 0x0327);
12593                 MP_WritePhyUshort(sc, 0x19, 0xb103);
12594                 MP_WritePhyUshort(sc, 0x15, 0x0328);
12595                 MP_WritePhyUshort(sc, 0x19, 0x6c00);
12596                 MP_WritePhyUshort(sc, 0x15, 0x0329);
12597                 MP_WritePhyUshort(sc, 0x19, 0x32f6);
12598                 MP_WritePhyUshort(sc, 0x15, 0x032a);
12599                 MP_WritePhyUshort(sc, 0x19, 0x6c00);
12600                 MP_WritePhyUshort(sc, 0x15, 0x032b);
12601                 MP_WritePhyUshort(sc, 0x19, 0x3352);
12602                 MP_WritePhyUshort(sc, 0x15, 0x032c);
12603                 MP_WritePhyUshort(sc, 0x19, 0xb103);
12604                 MP_WritePhyUshort(sc, 0x15, 0x032d);
12605                 MP_WritePhyUshort(sc, 0x19, 0x6c00);
12606                 MP_WritePhyUshort(sc, 0x15, 0x032e);
12607                 MP_WritePhyUshort(sc, 0x19, 0x336a);
12608                 MP_WritePhyUshort(sc, 0x15, 0x032f);
12609                 MP_WritePhyUshort(sc, 0x19, 0x6c00);
12610                 MP_WritePhyUshort(sc, 0x15, 0x0330);
12611                 MP_WritePhyUshort(sc, 0x19, 0x3382);
12612                 MP_WritePhyUshort(sc, 0x15, 0x0331);
12613                 MP_WritePhyUshort(sc, 0x19, 0xb206);
12614                 MP_WritePhyUshort(sc, 0x15, 0x0332);
12615                 MP_WritePhyUshort(sc, 0x19, 0xb103);
12616                 MP_WritePhyUshort(sc, 0x15, 0x0333);
12617                 MP_WritePhyUshort(sc, 0x19, 0x6c00);
12618                 MP_WritePhyUshort(sc, 0x15, 0x0334);
12619                 MP_WritePhyUshort(sc, 0x19, 0x3395);
12620                 MP_WritePhyUshort(sc, 0x15, 0x0335);
12621                 MP_WritePhyUshort(sc, 0x19, 0x6c00);
12622                 MP_WritePhyUshort(sc, 0x15, 0x0336);
12623                 MP_WritePhyUshort(sc, 0x19, 0x33c6);
12624                 MP_WritePhyUshort(sc, 0x15, 0x0337);
12625                 MP_WritePhyUshort(sc, 0x19, 0xb103);
12626                 MP_WritePhyUshort(sc, 0x15, 0x0338);
12627                 MP_WritePhyUshort(sc, 0x19, 0x6c00);
12628                 MP_WritePhyUshort(sc, 0x15, 0x0339);
12629                 MP_WritePhyUshort(sc, 0x19, 0x33d7);
12630                 MP_WritePhyUshort(sc, 0x15, 0x033a);
12631                 MP_WritePhyUshort(sc, 0x19, 0x6c00);
12632                 MP_WritePhyUshort(sc, 0x15, 0x033b);
12633                 MP_WritePhyUshort(sc, 0x19, 0x33f2);
12634                 MP_WritePhyUshort(sc, 0x15, 0x033c);
12635                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12636                 MP_WritePhyUshort(sc, 0x15, 0x033d);
12637                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12638                 MP_WritePhyUshort(sc, 0x15, 0x033e);
12639                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12640                 MP_WritePhyUshort(sc, 0x15, 0x033f);
12641                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12642                 MP_WritePhyUshort(sc, 0x15, 0x0340);
12643                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12644                 MP_WritePhyUshort(sc, 0x15, 0x0341);
12645                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12646                 MP_WritePhyUshort(sc, 0x15, 0x0342);
12647                 MP_WritePhyUshort(sc, 0x19, 0x49b5);
12648                 MP_WritePhyUshort(sc, 0x15, 0x0343);
12649                 MP_WritePhyUshort(sc, 0x19, 0x7d00);
12650                 MP_WritePhyUshort(sc, 0x15, 0x0344);
12651                 MP_WritePhyUshort(sc, 0x19, 0x4d00);
12652                 MP_WritePhyUshort(sc, 0x15, 0x0345);
12653                 MP_WritePhyUshort(sc, 0x19, 0x6880);
12654                 MP_WritePhyUshort(sc, 0x15, 0x0346);
12655                 MP_WritePhyUshort(sc, 0x19, 0x7c08);
12656                 MP_WritePhyUshort(sc, 0x15, 0x0347);
12657                 MP_WritePhyUshort(sc, 0x19, 0x6c08);
12658                 MP_WritePhyUshort(sc, 0x15, 0x0348);
12659                 MP_WritePhyUshort(sc, 0x19, 0x4925);
12660                 MP_WritePhyUshort(sc, 0x15, 0x0349);
12661                 MP_WritePhyUshort(sc, 0x19, 0x403b);
12662                 MP_WritePhyUshort(sc, 0x15, 0x034a);
12663                 MP_WritePhyUshort(sc, 0x19, 0xa602);
12664                 MP_WritePhyUshort(sc, 0x15, 0x034b);
12665                 MP_WritePhyUshort(sc, 0x19, 0x402f);
12666                 MP_WritePhyUshort(sc, 0x15, 0x034c);
12667                 MP_WritePhyUshort(sc, 0x19, 0x4484);
12668                 MP_WritePhyUshort(sc, 0x15, 0x034d);
12669                 MP_WritePhyUshort(sc, 0x19, 0x40c8);
12670                 MP_WritePhyUshort(sc, 0x15, 0x034e);
12671                 MP_WritePhyUshort(sc, 0x19, 0x44c4);
12672                 MP_WritePhyUshort(sc, 0x15, 0x034f);
12673                 MP_WritePhyUshort(sc, 0x19, 0xd64f);
12674                 MP_WritePhyUshort(sc, 0x15, 0x0350);
12675                 MP_WritePhyUshort(sc, 0x19, 0x00bd);
12676                 MP_WritePhyUshort(sc, 0x15, 0x0351);
12677                 MP_WritePhyUshort(sc, 0x19, 0x3311);
12678                 MP_WritePhyUshort(sc, 0x15, 0x0352);
12679                 MP_WritePhyUshort(sc, 0x19, 0xc8ed);
12680                 MP_WritePhyUshort(sc, 0x15, 0x0353);
12681                 MP_WritePhyUshort(sc, 0x19, 0x00fc);
12682                 MP_WritePhyUshort(sc, 0x15, 0x0354);
12683                 MP_WritePhyUshort(sc, 0x19, 0x8221);
12684                 MP_WritePhyUshort(sc, 0x15, 0x0355);
12685                 MP_WritePhyUshort(sc, 0x19, 0xd11d);
12686                 MP_WritePhyUshort(sc, 0x15, 0x0356);
12687                 MP_WritePhyUshort(sc, 0x19, 0x001f);
12688                 MP_WritePhyUshort(sc, 0x15, 0x0357);
12689                 MP_WritePhyUshort(sc, 0x19, 0xde18);
12690                 MP_WritePhyUshort(sc, 0x15, 0x0358);
12691                 MP_WritePhyUshort(sc, 0x19, 0x0008);
12692                 MP_WritePhyUshort(sc, 0x15, 0x0359);
12693                 MP_WritePhyUshort(sc, 0x19, 0x91f6);
12694                 MP_WritePhyUshort(sc, 0x15, 0x035a);
12695                 MP_WritePhyUshort(sc, 0x19, 0x3360);
12696                 MP_WritePhyUshort(sc, 0x15, 0x035b);
12697                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12698                 MP_WritePhyUshort(sc, 0x15, 0x035c);
12699                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12700                 MP_WritePhyUshort(sc, 0x15, 0x035d);
12701                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12702                 MP_WritePhyUshort(sc, 0x15, 0x035e);
12703                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12704                 MP_WritePhyUshort(sc, 0x15, 0x035f);
12705                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12706                 MP_WritePhyUshort(sc, 0x15, 0x0360);
12707                 MP_WritePhyUshort(sc, 0x19, 0x4bb6);
12708                 MP_WritePhyUshort(sc, 0x15, 0x0361);
12709                 MP_WritePhyUshort(sc, 0x19, 0x4064);
12710                 MP_WritePhyUshort(sc, 0x15, 0x0362);
12711                 MP_WritePhyUshort(sc, 0x19, 0x4b26);
12712                 MP_WritePhyUshort(sc, 0x15, 0x0363);
12713                 MP_WritePhyUshort(sc, 0x19, 0x4410);
12714                 MP_WritePhyUshort(sc, 0x15, 0x0364);
12715                 MP_WritePhyUshort(sc, 0x19, 0x4006);
12716                 MP_WritePhyUshort(sc, 0x15, 0x0365);
12717                 MP_WritePhyUshort(sc, 0x19, 0x4490);
12718                 MP_WritePhyUshort(sc, 0x15, 0x0366);
12719                 MP_WritePhyUshort(sc, 0x19, 0x6900);
12720                 MP_WritePhyUshort(sc, 0x15, 0x0367);
12721                 MP_WritePhyUshort(sc, 0x19, 0xb6a6);
12722                 MP_WritePhyUshort(sc, 0x15, 0x0368);
12723                 MP_WritePhyUshort(sc, 0x19, 0x9e02);
12724                 MP_WritePhyUshort(sc, 0x15, 0x0369);
12725                 MP_WritePhyUshort(sc, 0x19, 0x3311);
12726                 MP_WritePhyUshort(sc, 0x15, 0x036a);
12727                 MP_WritePhyUshort(sc, 0x19, 0xd11d);
12728                 MP_WritePhyUshort(sc, 0x15, 0x036b);
12729                 MP_WritePhyUshort(sc, 0x19, 0x000a);
12730                 MP_WritePhyUshort(sc, 0x15, 0x036c);
12731                 MP_WritePhyUshort(sc, 0x19, 0xbb0f);
12732                 MP_WritePhyUshort(sc, 0x15, 0x036d);
12733                 MP_WritePhyUshort(sc, 0x19, 0x8102);
12734                 MP_WritePhyUshort(sc, 0x15, 0x036e);
12735                 MP_WritePhyUshort(sc, 0x19, 0x3371);
12736                 MP_WritePhyUshort(sc, 0x15, 0x036f);
12737                 MP_WritePhyUshort(sc, 0x19, 0xa21e);
12738                 MP_WritePhyUshort(sc, 0x15, 0x0370);
12739                 MP_WritePhyUshort(sc, 0x19, 0x33b6);
12740                 MP_WritePhyUshort(sc, 0x15, 0x0371);
12741                 MP_WritePhyUshort(sc, 0x19, 0x91f6);
12742                 MP_WritePhyUshort(sc, 0x15, 0x0372);
12743                 MP_WritePhyUshort(sc, 0x19, 0xc218);
12744                 MP_WritePhyUshort(sc, 0x15, 0x0373);
12745                 MP_WritePhyUshort(sc, 0x19, 0x00f4);
12746                 MP_WritePhyUshort(sc, 0x15, 0x0374);
12747                 MP_WritePhyUshort(sc, 0x19, 0x33b6);
12748                 MP_WritePhyUshort(sc, 0x15, 0x0375);
12749                 MP_WritePhyUshort(sc, 0x19, 0x32ec);
12750                 MP_WritePhyUshort(sc, 0x15, 0x0376);
12751                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12752                 MP_WritePhyUshort(sc, 0x15, 0x0377);
12753                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12754                 MP_WritePhyUshort(sc, 0x15, 0x0378);
12755                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12756                 MP_WritePhyUshort(sc, 0x15, 0x0379);
12757                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12758                 MP_WritePhyUshort(sc, 0x15, 0x037a);
12759                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12760                 MP_WritePhyUshort(sc, 0x15, 0x037b);
12761                 MP_WritePhyUshort(sc, 0x19, 0x4b97);
12762                 MP_WritePhyUshort(sc, 0x15, 0x037c);
12763                 MP_WritePhyUshort(sc, 0x19, 0x402b);
12764                 MP_WritePhyUshort(sc, 0x15, 0x037d);
12765                 MP_WritePhyUshort(sc, 0x19, 0x4b07);
12766                 MP_WritePhyUshort(sc, 0x15, 0x037e);
12767                 MP_WritePhyUshort(sc, 0x19, 0x4422);
12768                 MP_WritePhyUshort(sc, 0x15, 0x037f);
12769                 MP_WritePhyUshort(sc, 0x19, 0x6980);
12770                 MP_WritePhyUshort(sc, 0x15, 0x0380);
12771                 MP_WritePhyUshort(sc, 0x19, 0xb608);
12772                 MP_WritePhyUshort(sc, 0x15, 0x0381);
12773                 MP_WritePhyUshort(sc, 0x19, 0x3311);
12774                 MP_WritePhyUshort(sc, 0x15, 0x0382);
12775                 MP_WritePhyUshort(sc, 0x19, 0xbc05);
12776                 MP_WritePhyUshort(sc, 0x15, 0x0383);
12777                 MP_WritePhyUshort(sc, 0x19, 0xc21c);
12778                 MP_WritePhyUshort(sc, 0x15, 0x0384);
12779                 MP_WritePhyUshort(sc, 0x19, 0x0032);
12780                 MP_WritePhyUshort(sc, 0x15, 0x0385);
12781                 MP_WritePhyUshort(sc, 0x19, 0xa1fb);
12782                 MP_WritePhyUshort(sc, 0x15, 0x0386);
12783                 MP_WritePhyUshort(sc, 0x19, 0x338d);
12784                 MP_WritePhyUshort(sc, 0x15, 0x0387);
12785                 MP_WritePhyUshort(sc, 0x19, 0x32ae);
12786                 MP_WritePhyUshort(sc, 0x15, 0x0388);
12787                 MP_WritePhyUshort(sc, 0x19, 0x330d);
12788                 MP_WritePhyUshort(sc, 0x15, 0x0389);
12789                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12790                 MP_WritePhyUshort(sc, 0x15, 0x038a);
12791                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12792                 MP_WritePhyUshort(sc, 0x15, 0x038b);
12793                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12794                 MP_WritePhyUshort(sc, 0x15, 0x038c);
12795                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12796                 MP_WritePhyUshort(sc, 0x15, 0x038d);
12797                 MP_WritePhyUshort(sc, 0x19, 0x4b97);
12798                 MP_WritePhyUshort(sc, 0x15, 0x038e);
12799                 MP_WritePhyUshort(sc, 0x19, 0x6a08);
12800                 MP_WritePhyUshort(sc, 0x15, 0x038f);
12801                 MP_WritePhyUshort(sc, 0x19, 0x4b07);
12802                 MP_WritePhyUshort(sc, 0x15, 0x0390);
12803                 MP_WritePhyUshort(sc, 0x19, 0x40ac);
12804                 MP_WritePhyUshort(sc, 0x15, 0x0391);
12805                 MP_WritePhyUshort(sc, 0x19, 0x4445);
12806                 MP_WritePhyUshort(sc, 0x15, 0x0392);
12807                 MP_WritePhyUshort(sc, 0x19, 0x404e);
12808                 MP_WritePhyUshort(sc, 0x15, 0x0393);
12809                 MP_WritePhyUshort(sc, 0x19, 0x4461);
12810                 MP_WritePhyUshort(sc, 0x15, 0x0394);
12811                 MP_WritePhyUshort(sc, 0x19, 0x3311);
12812                 MP_WritePhyUshort(sc, 0x15, 0x0395);
12813                 MP_WritePhyUshort(sc, 0x19, 0x9c0a);
12814                 MP_WritePhyUshort(sc, 0x15, 0x0396);
12815                 MP_WritePhyUshort(sc, 0x19, 0x63da);
12816                 MP_WritePhyUshort(sc, 0x15, 0x0397);
12817                 MP_WritePhyUshort(sc, 0x19, 0x6f0c);
12818                 MP_WritePhyUshort(sc, 0x15, 0x0398);
12819                 MP_WritePhyUshort(sc, 0x19, 0x5440);
12820                 MP_WritePhyUshort(sc, 0x15, 0x0399);
12821                 MP_WritePhyUshort(sc, 0x19, 0x4b98);
12822                 MP_WritePhyUshort(sc, 0x15, 0x039a);
12823                 MP_WritePhyUshort(sc, 0x19, 0x7c40);
12824                 MP_WritePhyUshort(sc, 0x15, 0x039b);
12825                 MP_WritePhyUshort(sc, 0x19, 0x4c00);
12826                 MP_WritePhyUshort(sc, 0x15, 0x039c);
12827                 MP_WritePhyUshort(sc, 0x19, 0x4b08);
12828                 MP_WritePhyUshort(sc, 0x15, 0x039d);
12829                 MP_WritePhyUshort(sc, 0x19, 0x63d8);
12830                 MP_WritePhyUshort(sc, 0x15, 0x039e);
12831                 MP_WritePhyUshort(sc, 0x19, 0x33a5);
12832                 MP_WritePhyUshort(sc, 0x15, 0x039f);
12833                 MP_WritePhyUshort(sc, 0x19, 0xd64f);
12834                 MP_WritePhyUshort(sc, 0x15, 0x03a0);
12835                 MP_WritePhyUshort(sc, 0x19, 0x00e8);
12836                 MP_WritePhyUshort(sc, 0x15, 0x03a1);
12837                 MP_WritePhyUshort(sc, 0x19, 0x820e);
12838                 MP_WritePhyUshort(sc, 0x15, 0x03a2);
12839                 MP_WritePhyUshort(sc, 0x19, 0xa10d);
12840                 MP_WritePhyUshort(sc, 0x15, 0x03a3);
12841                 MP_WritePhyUshort(sc, 0x19, 0x9df1);
12842                 MP_WritePhyUshort(sc, 0x15, 0x03a4);
12843                 MP_WritePhyUshort(sc, 0x19, 0x33af);
12844                 MP_WritePhyUshort(sc, 0x15, 0x03a5);
12845                 MP_WritePhyUshort(sc, 0x19, 0xd64f);
12846                 MP_WritePhyUshort(sc, 0x15, 0x03a6);
12847                 MP_WritePhyUshort(sc, 0x19, 0x00f9);
12848                 MP_WritePhyUshort(sc, 0x15, 0x03a7);
12849                 MP_WritePhyUshort(sc, 0x19, 0xc017);
12850                 MP_WritePhyUshort(sc, 0x15, 0x03a8);
12851                 MP_WritePhyUshort(sc, 0x19, 0x0007);
12852                 MP_WritePhyUshort(sc, 0x15, 0x03a9);
12853                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
12854                 MP_WritePhyUshort(sc, 0x15, 0x03aa);
12855                 MP_WritePhyUshort(sc, 0x19, 0x6c03);
12856                 MP_WritePhyUshort(sc, 0x15, 0x03ab);
12857                 MP_WritePhyUshort(sc, 0x19, 0xa104);
12858                 MP_WritePhyUshort(sc, 0x15, 0x03ac);
12859                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
12860                 MP_WritePhyUshort(sc, 0x15, 0x03ad);
12861                 MP_WritePhyUshort(sc, 0x19, 0x6c00);
12862                 MP_WritePhyUshort(sc, 0x15, 0x03ae);
12863                 MP_WritePhyUshort(sc, 0x19, 0x9df7);
12864                 MP_WritePhyUshort(sc, 0x15, 0x03af);
12865                 MP_WritePhyUshort(sc, 0x19, 0x7c03);
12866                 MP_WritePhyUshort(sc, 0x15, 0x03b0);
12867                 MP_WritePhyUshort(sc, 0x19, 0x6c08);
12868                 MP_WritePhyUshort(sc, 0x15, 0x03b1);
12869                 MP_WritePhyUshort(sc, 0x19, 0x33b6);
12870                 MP_WritePhyUshort(sc, 0x15, 0x03b2);
12871                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12872                 MP_WritePhyUshort(sc, 0x15, 0x03b3);
12873                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12874                 MP_WritePhyUshort(sc, 0x15, 0x03b4);
12875                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12876                 MP_WritePhyUshort(sc, 0x15, 0x03b5);
12877                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12878                 MP_WritePhyUshort(sc, 0x15, 0x03b6);
12879                 MP_WritePhyUshort(sc, 0x19, 0x55af);
12880                 MP_WritePhyUshort(sc, 0x15, 0x03b7);
12881                 MP_WritePhyUshort(sc, 0x19, 0x7ff0);
12882                 MP_WritePhyUshort(sc, 0x15, 0x03b8);
12883                 MP_WritePhyUshort(sc, 0x19, 0x6ff0);
12884                 MP_WritePhyUshort(sc, 0x15, 0x03b9);
12885                 MP_WritePhyUshort(sc, 0x19, 0x4bb9);
12886                 MP_WritePhyUshort(sc, 0x15, 0x03ba);
12887                 MP_WritePhyUshort(sc, 0x19, 0x6a80);
12888                 MP_WritePhyUshort(sc, 0x15, 0x03bb);
12889                 MP_WritePhyUshort(sc, 0x19, 0x4b29);
12890                 MP_WritePhyUshort(sc, 0x15, 0x03bc);
12891                 MP_WritePhyUshort(sc, 0x19, 0x4041);
12892                 MP_WritePhyUshort(sc, 0x15, 0x03bd);
12893                 MP_WritePhyUshort(sc, 0x19, 0x440a);
12894                 MP_WritePhyUshort(sc, 0x15, 0x03be);
12895                 MP_WritePhyUshort(sc, 0x19, 0x4029);
12896                 MP_WritePhyUshort(sc, 0x15, 0x03bf);
12897                 MP_WritePhyUshort(sc, 0x19, 0x4418);
12898                 MP_WritePhyUshort(sc, 0x15, 0x03c0);
12899                 MP_WritePhyUshort(sc, 0x19, 0x4090);
12900                 MP_WritePhyUshort(sc, 0x15, 0x03c1);
12901                 MP_WritePhyUshort(sc, 0x19, 0x4438);
12902                 MP_WritePhyUshort(sc, 0x15, 0x03c2);
12903                 MP_WritePhyUshort(sc, 0x19, 0x40c4);
12904                 MP_WritePhyUshort(sc, 0x15, 0x03c3);
12905                 MP_WritePhyUshort(sc, 0x19, 0x447b);
12906                 MP_WritePhyUshort(sc, 0x15, 0x03c4);
12907                 MP_WritePhyUshort(sc, 0x19, 0xb6c4);
12908                 MP_WritePhyUshort(sc, 0x15, 0x03c5);
12909                 MP_WritePhyUshort(sc, 0x19, 0x3311);
12910                 MP_WritePhyUshort(sc, 0x15, 0x03c6);
12911                 MP_WritePhyUshort(sc, 0x19, 0x9bfe);
12912                 MP_WritePhyUshort(sc, 0x15, 0x03c7);
12913                 MP_WritePhyUshort(sc, 0x19, 0x33cc);
12914                 MP_WritePhyUshort(sc, 0x15, 0x03c8);
12915                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12916                 MP_WritePhyUshort(sc, 0x15, 0x03c9);
12917                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12918                 MP_WritePhyUshort(sc, 0x15, 0x03ca);
12919                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12920                 MP_WritePhyUshort(sc, 0x15, 0x03cb);
12921                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12922                 MP_WritePhyUshort(sc, 0x15, 0x03cc);
12923                 MP_WritePhyUshort(sc, 0x19, 0x542f);
12924                 MP_WritePhyUshort(sc, 0x15, 0x03cd);
12925                 MP_WritePhyUshort(sc, 0x19, 0x499a);
12926                 MP_WritePhyUshort(sc, 0x15, 0x03ce);
12927                 MP_WritePhyUshort(sc, 0x19, 0x7c40);
12928                 MP_WritePhyUshort(sc, 0x15, 0x03cf);
12929                 MP_WritePhyUshort(sc, 0x19, 0x4c40);
12930                 MP_WritePhyUshort(sc, 0x15, 0x03d0);
12931                 MP_WritePhyUshort(sc, 0x19, 0x490a);
12932                 MP_WritePhyUshort(sc, 0x15, 0x03d1);
12933                 MP_WritePhyUshort(sc, 0x19, 0x405e);
12934                 MP_WritePhyUshort(sc, 0x15, 0x03d2);
12935                 MP_WritePhyUshort(sc, 0x19, 0x44f8);
12936                 MP_WritePhyUshort(sc, 0x15, 0x03d3);
12937                 MP_WritePhyUshort(sc, 0x19, 0x6b00);
12938                 MP_WritePhyUshort(sc, 0x15, 0x03d4);
12939                 MP_WritePhyUshort(sc, 0x19, 0xd64f);
12940                 MP_WritePhyUshort(sc, 0x15, 0x03d5);
12941                 MP_WritePhyUshort(sc, 0x19, 0x0028);
12942                 MP_WritePhyUshort(sc, 0x15, 0x03d6);
12943                 MP_WritePhyUshort(sc, 0x19, 0x3311);
12944                 MP_WritePhyUshort(sc, 0x15, 0x03d7);
12945                 MP_WritePhyUshort(sc, 0x19, 0xbd27);
12946                 MP_WritePhyUshort(sc, 0x15, 0x03d8);
12947                 MP_WritePhyUshort(sc, 0x19, 0x9cfc);
12948                 MP_WritePhyUshort(sc, 0x15, 0x03d9);
12949                 MP_WritePhyUshort(sc, 0x19, 0xc639);
12950                 MP_WritePhyUshort(sc, 0x15, 0x03da);
12951                 MP_WritePhyUshort(sc, 0x19, 0x000f);
12952                 MP_WritePhyUshort(sc, 0x15, 0x03db);
12953                 MP_WritePhyUshort(sc, 0x19, 0x9e03);
12954                 MP_WritePhyUshort(sc, 0x15, 0x03dc);
12955                 MP_WritePhyUshort(sc, 0x19, 0x7c01);
12956                 MP_WritePhyUshort(sc, 0x15, 0x03dd);
12957                 MP_WritePhyUshort(sc, 0x19, 0x4c01);
12958                 MP_WritePhyUshort(sc, 0x15, 0x03de);
12959                 MP_WritePhyUshort(sc, 0x19, 0x9af6);
12960                 MP_WritePhyUshort(sc, 0x15, 0x03df);
12961                 MP_WritePhyUshort(sc, 0x19, 0x7c12);
12962                 MP_WritePhyUshort(sc, 0x15, 0x03e0);
12963                 MP_WritePhyUshort(sc, 0x19, 0x4c52);
12964                 MP_WritePhyUshort(sc, 0x15, 0x03e1);
12965                 MP_WritePhyUshort(sc, 0x19, 0x4470);
12966                 MP_WritePhyUshort(sc, 0x15, 0x03e2);
12967                 MP_WritePhyUshort(sc, 0x19, 0x7c12);
12968                 MP_WritePhyUshort(sc, 0x15, 0x03e3);
12969                 MP_WritePhyUshort(sc, 0x19, 0x4c40);
12970                 MP_WritePhyUshort(sc, 0x15, 0x03e4);
12971                 MP_WritePhyUshort(sc, 0x19, 0x33d4);
12972                 MP_WritePhyUshort(sc, 0x15, 0x03e5);
12973                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12974                 MP_WritePhyUshort(sc, 0x15, 0x03e6);
12975                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12976                 MP_WritePhyUshort(sc, 0x15, 0x03e7);
12977                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12978                 MP_WritePhyUshort(sc, 0x15, 0x03e8);
12979                 MP_WritePhyUshort(sc, 0x19, 0x0000);
12980                 MP_WritePhyUshort(sc, 0x15, 0x03e9);
12981                 MP_WritePhyUshort(sc, 0x19, 0x49bb);
12982                 MP_WritePhyUshort(sc, 0x15, 0x03ea);
12983                 MP_WritePhyUshort(sc, 0x19, 0x4478);
12984                 MP_WritePhyUshort(sc, 0x15, 0x03eb);
12985                 MP_WritePhyUshort(sc, 0x19, 0x492b);
12986                 MP_WritePhyUshort(sc, 0x15, 0x03ec);
12987                 MP_WritePhyUshort(sc, 0x19, 0x6b80);
12988                 MP_WritePhyUshort(sc, 0x15, 0x03ed);
12989                 MP_WritePhyUshort(sc, 0x19, 0x7c01);
12990                 MP_WritePhyUshort(sc, 0x15, 0x03ee);
12991                 MP_WritePhyUshort(sc, 0x19, 0x4c00);
12992                 MP_WritePhyUshort(sc, 0x15, 0x03ef);
12993                 MP_WritePhyUshort(sc, 0x19, 0xd64f);
12994                 MP_WritePhyUshort(sc, 0x15, 0x03f0);
12995                 MP_WritePhyUshort(sc, 0x19, 0x000d);
12996                 MP_WritePhyUshort(sc, 0x15, 0x03f1);
12997                 MP_WritePhyUshort(sc, 0x19, 0x3311);
12998                 MP_WritePhyUshort(sc, 0x15, 0x03f2);
12999                 MP_WritePhyUshort(sc, 0x19, 0xbd0c);
13000                 MP_WritePhyUshort(sc, 0x15, 0x03f3);
13001                 MP_WritePhyUshort(sc, 0x19, 0xc428);
13002                 MP_WritePhyUshort(sc, 0x15, 0x03f4);
13003                 MP_WritePhyUshort(sc, 0x19, 0x0008);
13004                 MP_WritePhyUshort(sc, 0x15, 0x03f5);
13005                 MP_WritePhyUshort(sc, 0x19, 0x9afa);
13006                 MP_WritePhyUshort(sc, 0x15, 0x03f6);
13007                 MP_WritePhyUshort(sc, 0x19, 0x7c12);
13008                 MP_WritePhyUshort(sc, 0x15, 0x03f7);
13009                 MP_WritePhyUshort(sc, 0x19, 0x4c52);
13010                 MP_WritePhyUshort(sc, 0x15, 0x03f8);
13011                 MP_WritePhyUshort(sc, 0x19, 0x4470);
13012                 MP_WritePhyUshort(sc, 0x15, 0x03f9);
13013                 MP_WritePhyUshort(sc, 0x19, 0x7c12);
13014                 MP_WritePhyUshort(sc, 0x15, 0x03fa);
13015                 MP_WritePhyUshort(sc, 0x19, 0x4c40);
13016                 MP_WritePhyUshort(sc, 0x15, 0x03fb);
13017                 MP_WritePhyUshort(sc, 0x19, 0x33ef);
13018                 MP_WritePhyUshort(sc, 0x15, 0x03fc);
13019                 MP_WritePhyUshort(sc, 0x19, 0x3342);
13020                 MP_WritePhyUshort(sc, 0x15, 0x03fd);
13021                 MP_WritePhyUshort(sc, 0x19, 0x330d);
13022                 MP_WritePhyUshort(sc, 0x15, 0x03fe);
13023                 MP_WritePhyUshort(sc, 0x19, 0x32ae);
13024                 MP_WritePhyUshort(sc, 0x15, 0x0000);
13025                 MP_WritePhyUshort(sc, 0x16, 0x0306);
13026                 MP_WritePhyUshort(sc, 0x16, 0x0300);
13027                 MP_WritePhyUshort(sc, 0x1f, 0x0002);
13028                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
13029                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
13030                 MP_WritePhyUshort(sc, 0x05, 0xfff6);
13031                 MP_WritePhyUshort(sc, 0x06, 0x0080);
13032                 MP_WritePhyUshort(sc, 0x05, 0x8000);
13033                 MP_WritePhyUshort(sc, 0x06, 0x0280);
13034                 MP_WritePhyUshort(sc, 0x06, 0x48f7);
13035                 MP_WritePhyUshort(sc, 0x06, 0x00e0);
13036                 MP_WritePhyUshort(sc, 0x06, 0xfff7);
13037                 MP_WritePhyUshort(sc, 0x06, 0xa080);
13038                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
13039                 MP_WritePhyUshort(sc, 0x06, 0xf602);
13040                 MP_WritePhyUshort(sc, 0x06, 0x0112);
13041                 MP_WritePhyUshort(sc, 0x06, 0x0201);
13042                 MP_WritePhyUshort(sc, 0x06, 0x1f02);
13043                 MP_WritePhyUshort(sc, 0x06, 0x012c);
13044                 MP_WritePhyUshort(sc, 0x06, 0x0201);
13045                 MP_WritePhyUshort(sc, 0x06, 0x3c02);
13046                 MP_WritePhyUshort(sc, 0x06, 0x0156);
13047                 MP_WritePhyUshort(sc, 0x06, 0x0201);
13048                 MP_WritePhyUshort(sc, 0x06, 0x6d02);
13049                 MP_WritePhyUshort(sc, 0x06, 0x809d);
13050                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
13051                 MP_WritePhyUshort(sc, 0x06, 0x88e1);
13052                 MP_WritePhyUshort(sc, 0x06, 0x8b89);
13053                 MP_WritePhyUshort(sc, 0x06, 0x1e01);
13054                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
13055                 MP_WritePhyUshort(sc, 0x06, 0x8a1e);
13056                 MP_WritePhyUshort(sc, 0x06, 0x01e1);
13057                 MP_WritePhyUshort(sc, 0x06, 0x8b8b);
13058                 MP_WritePhyUshort(sc, 0x06, 0x1e01);
13059                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
13060                 MP_WritePhyUshort(sc, 0x06, 0x8c1e);
13061                 MP_WritePhyUshort(sc, 0x06, 0x01e1);
13062                 MP_WritePhyUshort(sc, 0x06, 0x8b8d);
13063                 MP_WritePhyUshort(sc, 0x06, 0x1e01);
13064                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
13065                 MP_WritePhyUshort(sc, 0x06, 0x8e1e);
13066                 MP_WritePhyUshort(sc, 0x06, 0x01a0);
13067                 MP_WritePhyUshort(sc, 0x06, 0x00c7);
13068                 MP_WritePhyUshort(sc, 0x06, 0xaebb);
13069                 MP_WritePhyUshort(sc, 0x06, 0xd100);
13070                 MP_WritePhyUshort(sc, 0x06, 0xbf82);
13071                 MP_WritePhyUshort(sc, 0x06, 0xc702);
13072                 MP_WritePhyUshort(sc, 0x06, 0x320a);
13073                 MP_WritePhyUshort(sc, 0x06, 0xd105);
13074                 MP_WritePhyUshort(sc, 0x06, 0xbf82);
13075                 MP_WritePhyUshort(sc, 0x06, 0xcd02);
13076                 MP_WritePhyUshort(sc, 0x06, 0x320a);
13077                 MP_WritePhyUshort(sc, 0x06, 0xd100);
13078                 MP_WritePhyUshort(sc, 0x06, 0xbf82);
13079                 MP_WritePhyUshort(sc, 0x06, 0xca02);
13080                 MP_WritePhyUshort(sc, 0x06, 0x320a);
13081                 MP_WritePhyUshort(sc, 0x06, 0xd105);
13082                 MP_WritePhyUshort(sc, 0x06, 0xbf82);
13083                 MP_WritePhyUshort(sc, 0x06, 0xd002);
13084                 MP_WritePhyUshort(sc, 0x06, 0x320a);
13085                 MP_WritePhyUshort(sc, 0x06, 0xd481);
13086                 MP_WritePhyUshort(sc, 0x06, 0xc9e4);
13087                 MP_WritePhyUshort(sc, 0x06, 0x8b90);
13088                 MP_WritePhyUshort(sc, 0x06, 0xe58b);
13089                 MP_WritePhyUshort(sc, 0x06, 0x91d4);
13090                 MP_WritePhyUshort(sc, 0x06, 0x81b8);
13091                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
13092                 MP_WritePhyUshort(sc, 0x06, 0x92e5);
13093                 MP_WritePhyUshort(sc, 0x06, 0x8b93);
13094                 MP_WritePhyUshort(sc, 0x06, 0xbf8b);
13095                 MP_WritePhyUshort(sc, 0x06, 0x88ec);
13096                 MP_WritePhyUshort(sc, 0x06, 0x0019);
13097                 MP_WritePhyUshort(sc, 0x06, 0xa98b);
13098                 MP_WritePhyUshort(sc, 0x06, 0x90f9);
13099                 MP_WritePhyUshort(sc, 0x06, 0xeeff);
13100                 MP_WritePhyUshort(sc, 0x06, 0xf600);
13101                 MP_WritePhyUshort(sc, 0x06, 0xeeff);
13102                 MP_WritePhyUshort(sc, 0x06, 0xf7fc);
13103                 MP_WritePhyUshort(sc, 0x06, 0xd100);
13104                 MP_WritePhyUshort(sc, 0x06, 0xbf82);
13105                 MP_WritePhyUshort(sc, 0x06, 0xc102);
13106                 MP_WritePhyUshort(sc, 0x06, 0x320a);
13107                 MP_WritePhyUshort(sc, 0x06, 0xd101);
13108                 MP_WritePhyUshort(sc, 0x06, 0xbf82);
13109                 MP_WritePhyUshort(sc, 0x06, 0xc402);
13110                 MP_WritePhyUshort(sc, 0x06, 0x320a);
13111                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
13112                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
13113                 MP_WritePhyUshort(sc, 0x06, 0x8ead);
13114                 MP_WritePhyUshort(sc, 0x06, 0x201a);
13115                 MP_WritePhyUshort(sc, 0x06, 0xf620);
13116                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
13117                 MP_WritePhyUshort(sc, 0x06, 0x8e02);
13118                 MP_WritePhyUshort(sc, 0x06, 0x824b);
13119                 MP_WritePhyUshort(sc, 0x06, 0x0281);
13120                 MP_WritePhyUshort(sc, 0x06, 0x1902);
13121                 MP_WritePhyUshort(sc, 0x06, 0x2c9d);
13122                 MP_WritePhyUshort(sc, 0x06, 0x0203);
13123                 MP_WritePhyUshort(sc, 0x06, 0x9602);
13124                 MP_WritePhyUshort(sc, 0x06, 0x0473);
13125                 MP_WritePhyUshort(sc, 0x06, 0x022e);
13126                 MP_WritePhyUshort(sc, 0x06, 0x3902);
13127                 MP_WritePhyUshort(sc, 0x06, 0x044d);
13128                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
13129                 MP_WritePhyUshort(sc, 0x06, 0x8ead);
13130                 MP_WritePhyUshort(sc, 0x06, 0x210b);
13131                 MP_WritePhyUshort(sc, 0x06, 0xf621);
13132                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
13133                 MP_WritePhyUshort(sc, 0x06, 0x8e02);
13134                 MP_WritePhyUshort(sc, 0x06, 0x0416);
13135                 MP_WritePhyUshort(sc, 0x06, 0x021b);
13136                 MP_WritePhyUshort(sc, 0x06, 0xa4e0);
13137                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
13138                 MP_WritePhyUshort(sc, 0x06, 0xad22);
13139                 MP_WritePhyUshort(sc, 0x06, 0x05f6);
13140                 MP_WritePhyUshort(sc, 0x06, 0x22e4);
13141                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
13142                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
13143                 MP_WritePhyUshort(sc, 0x06, 0x8ead);
13144                 MP_WritePhyUshort(sc, 0x06, 0x2305);
13145                 MP_WritePhyUshort(sc, 0x06, 0xf623);
13146                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
13147                 MP_WritePhyUshort(sc, 0x06, 0x8ee0);
13148                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
13149                 MP_WritePhyUshort(sc, 0x06, 0xad24);
13150                 MP_WritePhyUshort(sc, 0x06, 0x05f6);
13151                 MP_WritePhyUshort(sc, 0x06, 0x24e4);
13152                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
13153                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
13154                 MP_WritePhyUshort(sc, 0x06, 0x8ead);
13155                 MP_WritePhyUshort(sc, 0x06, 0x2505);
13156                 MP_WritePhyUshort(sc, 0x06, 0xf625);
13157                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
13158                 MP_WritePhyUshort(sc, 0x06, 0x8ee0);
13159                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
13160                 MP_WritePhyUshort(sc, 0x06, 0xad26);
13161                 MP_WritePhyUshort(sc, 0x06, 0x08f6);
13162                 MP_WritePhyUshort(sc, 0x06, 0x26e4);
13163                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
13164                 MP_WritePhyUshort(sc, 0x06, 0x0281);
13165                 MP_WritePhyUshort(sc, 0x06, 0xdae0);
13166                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
13167                 MP_WritePhyUshort(sc, 0x06, 0xad27);
13168                 MP_WritePhyUshort(sc, 0x06, 0x05f6);
13169                 MP_WritePhyUshort(sc, 0x06, 0x27e4);
13170                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
13171                 MP_WritePhyUshort(sc, 0x06, 0x0203);
13172                 MP_WritePhyUshort(sc, 0x06, 0x5cfc);
13173                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
13174                 MP_WritePhyUshort(sc, 0x06, 0xfaef);
13175                 MP_WritePhyUshort(sc, 0x06, 0x69e0);
13176                 MP_WritePhyUshort(sc, 0x06, 0x8b85);
13177                 MP_WritePhyUshort(sc, 0x06, 0xad21);
13178                 MP_WritePhyUshort(sc, 0x06, 0x57e0);
13179                 MP_WritePhyUshort(sc, 0x06, 0xe022);
13180                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
13181                 MP_WritePhyUshort(sc, 0x06, 0x2358);
13182                 MP_WritePhyUshort(sc, 0x06, 0xc059);
13183                 MP_WritePhyUshort(sc, 0x06, 0x021e);
13184                 MP_WritePhyUshort(sc, 0x06, 0x01e1);
13185                 MP_WritePhyUshort(sc, 0x06, 0x8b3c);
13186                 MP_WritePhyUshort(sc, 0x06, 0x1f10);
13187                 MP_WritePhyUshort(sc, 0x06, 0x9e44);
13188                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
13189                 MP_WritePhyUshort(sc, 0x06, 0x3cad);
13190                 MP_WritePhyUshort(sc, 0x06, 0x211d);
13191                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
13192                 MP_WritePhyUshort(sc, 0x06, 0x84f7);
13193                 MP_WritePhyUshort(sc, 0x06, 0x29e5);
13194                 MP_WritePhyUshort(sc, 0x06, 0x8b84);
13195                 MP_WritePhyUshort(sc, 0x06, 0xac27);
13196                 MP_WritePhyUshort(sc, 0x06, 0x0dac);
13197                 MP_WritePhyUshort(sc, 0x06, 0x2605);
13198                 MP_WritePhyUshort(sc, 0x06, 0x0281);
13199                 MP_WritePhyUshort(sc, 0x06, 0x7fae);
13200                 MP_WritePhyUshort(sc, 0x06, 0x2b02);
13201                 MP_WritePhyUshort(sc, 0x06, 0x2c23);
13202                 MP_WritePhyUshort(sc, 0x06, 0xae26);
13203                 MP_WritePhyUshort(sc, 0x06, 0x022c);
13204                 MP_WritePhyUshort(sc, 0x06, 0x41ae);
13205                 MP_WritePhyUshort(sc, 0x06, 0x21e0);
13206                 MP_WritePhyUshort(sc, 0x06, 0x8b87);
13207                 MP_WritePhyUshort(sc, 0x06, 0xad22);
13208                 MP_WritePhyUshort(sc, 0x06, 0x18e0);
13209                 MP_WritePhyUshort(sc, 0x06, 0xfff7);
13210                 MP_WritePhyUshort(sc, 0x06, 0x58fc);
13211                 MP_WritePhyUshort(sc, 0x06, 0xe4ff);
13212                 MP_WritePhyUshort(sc, 0x06, 0xf7d1);
13213                 MP_WritePhyUshort(sc, 0x06, 0x00bf);
13214                 MP_WritePhyUshort(sc, 0x06, 0x2eee);
13215                 MP_WritePhyUshort(sc, 0x06, 0x0232);
13216                 MP_WritePhyUshort(sc, 0x06, 0x0ad1);
13217                 MP_WritePhyUshort(sc, 0x06, 0x00bf);
13218                 MP_WritePhyUshort(sc, 0x06, 0x82e8);
13219                 MP_WritePhyUshort(sc, 0x06, 0x0232);
13220                 MP_WritePhyUshort(sc, 0x06, 0x0a02);
13221                 MP_WritePhyUshort(sc, 0x06, 0x2bdf);
13222                 MP_WritePhyUshort(sc, 0x06, 0xef96);
13223                 MP_WritePhyUshort(sc, 0x06, 0xfefc);
13224                 MP_WritePhyUshort(sc, 0x06, 0x04d0);
13225                 MP_WritePhyUshort(sc, 0x06, 0x0202);
13226                 MP_WritePhyUshort(sc, 0x06, 0x1e97);
13227                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
13228                 MP_WritePhyUshort(sc, 0x06, 0x87ad);
13229                 MP_WritePhyUshort(sc, 0x06, 0x2228);
13230                 MP_WritePhyUshort(sc, 0x06, 0xd100);
13231                 MP_WritePhyUshort(sc, 0x06, 0xbf82);
13232                 MP_WritePhyUshort(sc, 0x06, 0xd302);
13233                 MP_WritePhyUshort(sc, 0x06, 0x320a);
13234                 MP_WritePhyUshort(sc, 0x06, 0xd10c);
13235                 MP_WritePhyUshort(sc, 0x06, 0xbf82);
13236                 MP_WritePhyUshort(sc, 0x06, 0xd602);
13237                 MP_WritePhyUshort(sc, 0x06, 0x320a);
13238                 MP_WritePhyUshort(sc, 0x06, 0xd104);
13239                 MP_WritePhyUshort(sc, 0x06, 0xbf82);
13240                 MP_WritePhyUshort(sc, 0x06, 0xd902);
13241                 MP_WritePhyUshort(sc, 0x06, 0x320a);
13242                 MP_WritePhyUshort(sc, 0x06, 0xd101);
13243                 MP_WritePhyUshort(sc, 0x06, 0xbf82);
13244                 MP_WritePhyUshort(sc, 0x06, 0xe802);
13245                 MP_WritePhyUshort(sc, 0x06, 0x320a);
13246                 MP_WritePhyUshort(sc, 0x06, 0xe0ff);
13247                 MP_WritePhyUshort(sc, 0x06, 0xf768);
13248                 MP_WritePhyUshort(sc, 0x06, 0x03e4);
13249                 MP_WritePhyUshort(sc, 0x06, 0xfff7);
13250                 MP_WritePhyUshort(sc, 0x06, 0xd004);
13251                 MP_WritePhyUshort(sc, 0x06, 0x0228);
13252                 MP_WritePhyUshort(sc, 0x06, 0x7a04);
13253                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
13254                 MP_WritePhyUshort(sc, 0x06, 0xe234);
13255                 MP_WritePhyUshort(sc, 0x06, 0xe1e2);
13256                 MP_WritePhyUshort(sc, 0x06, 0x35f6);
13257                 MP_WritePhyUshort(sc, 0x06, 0x2be4);
13258                 MP_WritePhyUshort(sc, 0x06, 0xe234);
13259                 MP_WritePhyUshort(sc, 0x06, 0xe5e2);
13260                 MP_WritePhyUshort(sc, 0x06, 0x35fc);
13261                 MP_WritePhyUshort(sc, 0x06, 0x05f8);
13262                 MP_WritePhyUshort(sc, 0x06, 0xe0e2);
13263                 MP_WritePhyUshort(sc, 0x06, 0x34e1);
13264                 MP_WritePhyUshort(sc, 0x06, 0xe235);
13265                 MP_WritePhyUshort(sc, 0x06, 0xf72b);
13266                 MP_WritePhyUshort(sc, 0x06, 0xe4e2);
13267                 MP_WritePhyUshort(sc, 0x06, 0x34e5);
13268                 MP_WritePhyUshort(sc, 0x06, 0xe235);
13269                 MP_WritePhyUshort(sc, 0x06, 0xfc05);
13270                 MP_WritePhyUshort(sc, 0x06, 0xf8f9);
13271                 MP_WritePhyUshort(sc, 0x06, 0xfaef);
13272                 MP_WritePhyUshort(sc, 0x06, 0x69ac);
13273                 MP_WritePhyUshort(sc, 0x06, 0x1b4c);
13274                 MP_WritePhyUshort(sc, 0x06, 0xbf2e);
13275                 MP_WritePhyUshort(sc, 0x06, 0x3002);
13276                 MP_WritePhyUshort(sc, 0x06, 0x31dd);
13277                 MP_WritePhyUshort(sc, 0x06, 0xef01);
13278                 MP_WritePhyUshort(sc, 0x06, 0xe28a);
13279                 MP_WritePhyUshort(sc, 0x06, 0x76e4);
13280                 MP_WritePhyUshort(sc, 0x06, 0x8a76);
13281                 MP_WritePhyUshort(sc, 0x06, 0x1f12);
13282                 MP_WritePhyUshort(sc, 0x06, 0x9e3a);
13283                 MP_WritePhyUshort(sc, 0x06, 0xef12);
13284                 MP_WritePhyUshort(sc, 0x06, 0x5907);
13285                 MP_WritePhyUshort(sc, 0x06, 0x9f12);
13286                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
13287                 MP_WritePhyUshort(sc, 0x06, 0x8b40);
13288                 MP_WritePhyUshort(sc, 0x06, 0xf721);
13289                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
13290                 MP_WritePhyUshort(sc, 0x06, 0x40d0);
13291                 MP_WritePhyUshort(sc, 0x06, 0x0302);
13292                 MP_WritePhyUshort(sc, 0x06, 0x287a);
13293                 MP_WritePhyUshort(sc, 0x06, 0x0282);
13294                 MP_WritePhyUshort(sc, 0x06, 0x34fc);
13295                 MP_WritePhyUshort(sc, 0x06, 0xa000);
13296                 MP_WritePhyUshort(sc, 0x06, 0x1002);
13297                 MP_WritePhyUshort(sc, 0x06, 0x2dc3);
13298                 MP_WritePhyUshort(sc, 0x06, 0x022e);
13299                 MP_WritePhyUshort(sc, 0x06, 0x21e0);
13300                 MP_WritePhyUshort(sc, 0x06, 0x8b40);
13301                 MP_WritePhyUshort(sc, 0x06, 0xf621);
13302                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
13303                 MP_WritePhyUshort(sc, 0x06, 0x40ae);
13304                 MP_WritePhyUshort(sc, 0x06, 0x0fbf);
13305                 MP_WritePhyUshort(sc, 0x06, 0x3fa5);
13306                 MP_WritePhyUshort(sc, 0x06, 0x0231);
13307                 MP_WritePhyUshort(sc, 0x06, 0x6cbf);
13308                 MP_WritePhyUshort(sc, 0x06, 0x3fa2);
13309                 MP_WritePhyUshort(sc, 0x06, 0x0231);
13310                 MP_WritePhyUshort(sc, 0x06, 0x6c02);
13311                 MP_WritePhyUshort(sc, 0x06, 0x2dc3);
13312                 MP_WritePhyUshort(sc, 0x06, 0xef96);
13313                 MP_WritePhyUshort(sc, 0x06, 0xfefd);
13314                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
13315                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
13316                 MP_WritePhyUshort(sc, 0x06, 0xe2f4);
13317                 MP_WritePhyUshort(sc, 0x06, 0xe1e2);
13318                 MP_WritePhyUshort(sc, 0x06, 0xf5e4);
13319                 MP_WritePhyUshort(sc, 0x06, 0x8a78);
13320                 MP_WritePhyUshort(sc, 0x06, 0xe58a);
13321                 MP_WritePhyUshort(sc, 0x06, 0x79ee);
13322                 MP_WritePhyUshort(sc, 0x06, 0xe2f4);
13323                 MP_WritePhyUshort(sc, 0x06, 0xd8ee);
13324                 MP_WritePhyUshort(sc, 0x06, 0xe2f5);
13325                 MP_WritePhyUshort(sc, 0x06, 0x20fc);
13326                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
13327                 MP_WritePhyUshort(sc, 0x06, 0xf9fa);
13328                 MP_WritePhyUshort(sc, 0x06, 0xef69);
13329                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
13330                 MP_WritePhyUshort(sc, 0x06, 0x87ad);
13331                 MP_WritePhyUshort(sc, 0x06, 0x2065);
13332                 MP_WritePhyUshort(sc, 0x06, 0xd200);
13333                 MP_WritePhyUshort(sc, 0x06, 0xbf2e);
13334                 MP_WritePhyUshort(sc, 0x06, 0xe802);
13335                 MP_WritePhyUshort(sc, 0x06, 0x31dd);
13336                 MP_WritePhyUshort(sc, 0x06, 0x1e21);
13337                 MP_WritePhyUshort(sc, 0x06, 0xbf82);
13338                 MP_WritePhyUshort(sc, 0x06, 0xdf02);
13339                 MP_WritePhyUshort(sc, 0x06, 0x31dd);
13340                 MP_WritePhyUshort(sc, 0x06, 0x0c11);
13341                 MP_WritePhyUshort(sc, 0x06, 0x1e21);
13342                 MP_WritePhyUshort(sc, 0x06, 0xbf82);
13343                 MP_WritePhyUshort(sc, 0x06, 0xe202);
13344                 MP_WritePhyUshort(sc, 0x06, 0x31dd);
13345                 MP_WritePhyUshort(sc, 0x06, 0x0c12);
13346                 MP_WritePhyUshort(sc, 0x06, 0x1e21);
13347                 MP_WritePhyUshort(sc, 0x06, 0xbf82);
13348                 MP_WritePhyUshort(sc, 0x06, 0xe502);
13349                 MP_WritePhyUshort(sc, 0x06, 0x31dd);
13350                 MP_WritePhyUshort(sc, 0x06, 0x0c13);
13351                 MP_WritePhyUshort(sc, 0x06, 0x1e21);
13352                 MP_WritePhyUshort(sc, 0x06, 0xbf1f);
13353                 MP_WritePhyUshort(sc, 0x06, 0x5302);
13354                 MP_WritePhyUshort(sc, 0x06, 0x31dd);
13355                 MP_WritePhyUshort(sc, 0x06, 0x0c14);
13356                 MP_WritePhyUshort(sc, 0x06, 0x1e21);
13357                 MP_WritePhyUshort(sc, 0x06, 0xbf82);
13358                 MP_WritePhyUshort(sc, 0x06, 0xeb02);
13359                 MP_WritePhyUshort(sc, 0x06, 0x31dd);
13360                 MP_WritePhyUshort(sc, 0x06, 0x0c16);
13361                 MP_WritePhyUshort(sc, 0x06, 0x1e21);
13362                 MP_WritePhyUshort(sc, 0x06, 0xe083);
13363                 MP_WritePhyUshort(sc, 0x06, 0xe01f);
13364                 MP_WritePhyUshort(sc, 0x06, 0x029e);
13365                 MP_WritePhyUshort(sc, 0x06, 0x22e6);
13366                 MP_WritePhyUshort(sc, 0x06, 0x83e0);
13367                 MP_WritePhyUshort(sc, 0x06, 0xad31);
13368                 MP_WritePhyUshort(sc, 0x06, 0x14ad);
13369                 MP_WritePhyUshort(sc, 0x06, 0x3011);
13370                 MP_WritePhyUshort(sc, 0x06, 0xef02);
13371                 MP_WritePhyUshort(sc, 0x06, 0x580c);
13372                 MP_WritePhyUshort(sc, 0x06, 0x9e07);
13373                 MP_WritePhyUshort(sc, 0x06, 0xad36);
13374                 MP_WritePhyUshort(sc, 0x06, 0x085a);
13375                 MP_WritePhyUshort(sc, 0x06, 0x309f);
13376                 MP_WritePhyUshort(sc, 0x06, 0x04d1);
13377                 MP_WritePhyUshort(sc, 0x06, 0x01ae);
13378                 MP_WritePhyUshort(sc, 0x06, 0x02d1);
13379                 MP_WritePhyUshort(sc, 0x06, 0x00bf);
13380                 MP_WritePhyUshort(sc, 0x06, 0x82dc);
13381                 MP_WritePhyUshort(sc, 0x06, 0x0232);
13382                 MP_WritePhyUshort(sc, 0x06, 0x0aef);
13383                 MP_WritePhyUshort(sc, 0x06, 0x96fe);
13384                 MP_WritePhyUshort(sc, 0x06, 0xfdfc);
13385                 MP_WritePhyUshort(sc, 0x06, 0x0400);
13386                 MP_WritePhyUshort(sc, 0x06, 0xe140);
13387                 MP_WritePhyUshort(sc, 0x06, 0x77e1);
13388                 MP_WritePhyUshort(sc, 0x06, 0x4010);
13389                 MP_WritePhyUshort(sc, 0x06, 0xe150);
13390                 MP_WritePhyUshort(sc, 0x06, 0x32e1);
13391                 MP_WritePhyUshort(sc, 0x06, 0x5030);
13392                 MP_WritePhyUshort(sc, 0x06, 0xe144);
13393                 MP_WritePhyUshort(sc, 0x06, 0x74e1);
13394                 MP_WritePhyUshort(sc, 0x06, 0x44bb);
13395                 MP_WritePhyUshort(sc, 0x06, 0xe2d2);
13396                 MP_WritePhyUshort(sc, 0x06, 0x40e0);
13397                 MP_WritePhyUshort(sc, 0x06, 0x2cfc);
13398                 MP_WritePhyUshort(sc, 0x06, 0xe2cc);
13399                 MP_WritePhyUshort(sc, 0x06, 0xcce2);
13400                 MP_WritePhyUshort(sc, 0x06, 0x00cc);
13401                 MP_WritePhyUshort(sc, 0x06, 0xe000);
13402                 MP_WritePhyUshort(sc, 0x06, 0x99e0);
13403                 MP_WritePhyUshort(sc, 0x06, 0x3688);
13404                 MP_WritePhyUshort(sc, 0x06, 0xe036);
13405                 MP_WritePhyUshort(sc, 0x06, 0x99e1);
13406                 MP_WritePhyUshort(sc, 0x06, 0x40dd);
13407                 MP_WritePhyUshort(sc, 0x06, 0xe022);
13408                 MP_WritePhyUshort(sc, 0x05, 0xe142);
13409                 Data = MP_ReadPhyUshort(sc, 0x06);
13410                 Data |= BIT_0;
13411                 MP_WritePhyUshort(sc, 0x06, Data);
13412                 MP_WritePhyUshort(sc, 0x05, 0xe140);
13413                 Data = MP_ReadPhyUshort(sc, 0x06);
13414                 Data |= BIT_0;
13415                 MP_WritePhyUshort(sc, 0x06, Data);
13416                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
13417                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
13418                 for (i = 0; i < 200; i++) {
13419                         DELAY(100);
13420                         Data = MP_ReadPhyUshort(sc, 0x00);
13421                         if (Data & BIT_7)
13422                                 break;
13423                 }
13424                 MP_WritePhyUshort(sc, 0x1f, 0x0004);
13425                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
13426                 MP_WritePhyUshort(sc, 0x1e, 0x0023);
13427                 Data = MP_ReadPhyUshort(sc, 0x17);
13428                 Data &= ~BIT_0;
13429                 Data |= BIT_2;
13430                 MP_WritePhyUshort(sc, 0x17, Data);
13431                 MP_WritePhyUshort(sc, 0x1f, 0x0002);
13432                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
13433                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
13434                 MP_WritePhyUshort(sc, 0x09, 0xA20F);
13435                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
13436                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
13437                 MP_WritePhyUshort(sc, 0x00, 0x9200);
13438
13439                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
13440                 MP_WritePhyUshort(sc, 0x05, 0x8B80);
13441                 Data = MP_ReadPhyUshort(sc, 0x06);
13442                 Data |= BIT_2 | BIT_1;
13443                 MP_WritePhyUshort(sc, 0x06, Data);
13444                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
13445
13446                 MP_WritePhyUshort(sc, 0x1f, 0x0004);
13447                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
13448                 MP_WritePhyUshort(sc, 0x1e, 0x002D);
13449                 Data = MP_ReadPhyUshort(sc, 0x18);
13450                 Data |= BIT_4;
13451                 MP_WritePhyUshort(sc, 0x18, Data);
13452                 MP_WritePhyUshort(sc, 0x1f, 0x0002);
13453                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
13454                 Data = MP_ReadPhyUshort(sc, 0x14);
13455                 Data |= BIT_15;
13456                 MP_WritePhyUshort(sc, 0x14, Data);
13457
13458                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
13459                 MP_WritePhyUshort(sc, 0x05, 0x8B86);
13460                 Data = MP_ReadPhyUshort(sc, 0x06);
13461                 Data |= BIT_0;
13462                 MP_WritePhyUshort(sc, 0x06, Data);
13463                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
13464
13465                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
13466                 MP_WritePhyUshort(sc, 0x0B, 0x6C14);
13467                 MP_WritePhyUshort(sc, 0x14, 0x7F3D);
13468                 MP_WritePhyUshort(sc, 0x1C, 0xFAFE);
13469                 MP_WritePhyUshort(sc, 0x08, 0x07C5);
13470                 MP_WritePhyUshort(sc, 0x10, 0xF090);
13471                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
13472                 MP_WritePhyUshort(sc, 0x14, 0x641A);
13473                 MP_WritePhyUshort(sc, 0x1A, 0x0606);
13474                 MP_WritePhyUshort(sc, 0x12, 0xF480);
13475                 MP_WritePhyUshort(sc, 0x13, 0x0747);
13476                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
13477
13478                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
13479                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
13480                 MP_WritePhyUshort(sc, 0x1E, 0x0078);
13481                 MP_WritePhyUshort(sc, 0x15, 0xA408);
13482                 MP_WritePhyUshort(sc, 0x17, 0x5100);
13483                 MP_WritePhyUshort(sc, 0x19, 0x0008);
13484                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
13485                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
13486
13487                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
13488                 MP_WritePhyUshort(sc, 0x0D, 0x0207);
13489                 MP_WritePhyUshort(sc, 0x02, 0x5FD0);
13490                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
13491
13492                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
13493                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
13494                 MP_WritePhyUshort(sc, 0x1E, 0x00A1);
13495                 Data = MP_ReadPhyUshort(sc, 0x1A);
13496                 Data &= ~BIT_2;
13497                 MP_WritePhyUshort(sc, 0x1A, Data);
13498                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
13499                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
13500
13501                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
13502                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
13503                 MP_WritePhyUshort(sc, 0x1E, 0x002D);
13504                 Data = MP_ReadPhyUshort(sc, 0x16);
13505                 Data |= BIT_5;
13506                 MP_WritePhyUshort(sc, 0x16, Data);
13507                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
13508                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
13509
13510                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
13511                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
13512                 MP_WritePhyUshort(sc, 0x1E, 0x00AC);
13513                 MP_WritePhyUshort(sc, 0x18, 0x0006);
13514                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
13515                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
13516
13517                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
13518                 MP_WritePhyUshort(sc, 0x09, 0xA20F);
13519                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
13520
13521                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
13522                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
13523                 Data = MP_ReadPhyUshort(sc, 0x06);
13524                 Data |= BIT_14;
13525                 MP_WritePhyUshort(sc, 0x06, Data);
13526                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
13527
13528                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
13529                 MP_WritePhyUshort(sc, 0x05, 0x8B54);
13530                 Data = MP_ReadPhyUshort(sc, 0x06);
13531                 Data &= ~BIT_11;
13532                 MP_WritePhyUshort(sc, 0x06, Data);
13533                 MP_WritePhyUshort(sc, 0x05, 0x8B5D);
13534                 Data = MP_ReadPhyUshort(sc, 0x06);
13535                 Data &= ~BIT_11;
13536                 MP_WritePhyUshort(sc, 0x06, Data);
13537                 MP_WritePhyUshort(sc, 0x05, 0x8A7C);
13538                 Data = MP_ReadPhyUshort(sc, 0x06);
13539                 Data &= ~BIT_8;
13540                 MP_WritePhyUshort(sc, 0x06, Data);
13541                 MP_WritePhyUshort(sc, 0x05, 0x8A7F);
13542                 Data = MP_ReadPhyUshort(sc, 0x06);
13543                 Data |= BIT_8;
13544                 MP_WritePhyUshort(sc, 0x06, Data);
13545                 MP_WritePhyUshort(sc, 0x05, 0x8A82);
13546                 Data = MP_ReadPhyUshort(sc, 0x06);
13547                 Data &= ~BIT_8;
13548                 MP_WritePhyUshort(sc, 0x06, Data);
13549                 MP_WritePhyUshort(sc, 0x05, 0x8A85);
13550                 Data = MP_ReadPhyUshort(sc, 0x06);
13551                 Data &= ~BIT_8;
13552                 MP_WritePhyUshort(sc, 0x06, Data);
13553                 MP_WritePhyUshort(sc, 0x05, 0x8A88);
13554                 Data = MP_ReadPhyUshort(sc, 0x06);
13555                 Data &= ~BIT_8;
13556                 MP_WritePhyUshort(sc, 0x06, Data);
13557                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
13558
13559                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
13560                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
13561                 Data = MP_ReadPhyUshort(sc, 0x06);
13562                 Data |= BIT_15;
13563                 MP_WritePhyUshort(sc, 0x06, Data);
13564                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
13565
13566                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
13567                 Data = MP_ReadPhyUshort(sc, 0x19);
13568                 Data &= ~BIT_0;
13569                 MP_WritePhyUshort(sc, 0x19, Data);
13570                 Data = MP_ReadPhyUshort(sc, 0x10);
13571                 Data &= ~BIT_10;
13572                 MP_WritePhyUshort(sc, 0x10, Data);
13573                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
13574         } else if (sc->re_type == MACFG_39) {
13575                 Data_u32 = re_eri_read(sc, 0x1D0, 4, ERIAR_ExGMAC);
13576                 Data_u32 &= ~BIT_1;
13577                 re_eri_write(sc, 0x1D0, 4, Data_u32, ERIAR_ExGMAC);
13578
13579                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
13580                 MP_WritePhyUshort(sc, 0x00, 0x1800);
13581                 Data = MP_ReadPhyUshort(sc, 0x15);
13582                 Data &= ~(BIT_12);
13583                 MP_WritePhyUshort(sc, 0x15, Data);
13584                 MP_WritePhyUshort(sc, 0x00, 0x4800);
13585                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
13586                 MP_WritePhyUshort(sc, 0x1e, 0x002f);
13587                 for (i = 0; i < 1000; i++) {
13588                         if (MP_ReadPhyUshort(sc, 0x1c) & BIT_7)
13589                                 break;
13590                         DELAY(100);
13591                 }
13592                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
13593                 MP_WritePhyUshort(sc, 0x00, 0x1800);
13594                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
13595                 MP_WritePhyUshort(sc, 0x1e, 0x0023);
13596                 for (i = 0; i < 200; i++) {
13597                         if ((MP_ReadPhyUshort(sc, 0x17) & BIT_0) == 0)
13598                                 break;
13599                         DELAY(100);
13600                 }
13601                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
13602                 MP_WritePhyUshort(sc, 0x05, 0xfff6);
13603                 MP_WritePhyUshort(sc, 0x06, 0x0080);
13604                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
13605                 MP_WritePhyUshort(sc, 0x1e, 0x0023);
13606                 MP_WritePhyUshort(sc, 0x16, 0x0306);
13607                 MP_WritePhyUshort(sc, 0x16, 0x0307);
13608                 MP_WritePhyUshort(sc, 0x15, 0x00AF);
13609                 MP_WritePhyUshort(sc, 0x19, 0x4060);
13610                 MP_WritePhyUshort(sc, 0x15, 0x00B0);
13611                 MP_WritePhyUshort(sc, 0x19, 0x7800);
13612                 MP_WritePhyUshort(sc, 0x15, 0x00B1);
13613                 MP_WritePhyUshort(sc, 0x19, 0x7e00);
13614                 MP_WritePhyUshort(sc, 0x15, 0x00B2);
13615                 MP_WritePhyUshort(sc, 0x19, 0x72B0);
13616                 MP_WritePhyUshort(sc, 0x15, 0x00B3);
13617                 MP_WritePhyUshort(sc, 0x19, 0x7F00);
13618                 MP_WritePhyUshort(sc, 0x15, 0x00B4);
13619                 MP_WritePhyUshort(sc, 0x19, 0x73B0);
13620                 MP_WritePhyUshort(sc, 0x15, 0x0101);
13621                 MP_WritePhyUshort(sc, 0x19, 0x0005);
13622                 MP_WritePhyUshort(sc, 0x15, 0x0103);
13623                 MP_WritePhyUshort(sc, 0x19, 0x0003);
13624                 MP_WritePhyUshort(sc, 0x15, 0x0105);
13625                 MP_WritePhyUshort(sc, 0x19, 0x30FD);
13626                 MP_WritePhyUshort(sc, 0x15, 0x0106);
13627                 MP_WritePhyUshort(sc, 0x19, 0x9DF7);
13628                 MP_WritePhyUshort(sc, 0x15, 0x0107);
13629                 MP_WritePhyUshort(sc, 0x19, 0x30C6);
13630                 MP_WritePhyUshort(sc, 0x15, 0x0098);
13631                 MP_WritePhyUshort(sc, 0x19, 0x7c0b);
13632                 MP_WritePhyUshort(sc, 0x15, 0x0099);
13633                 MP_WritePhyUshort(sc, 0x19, 0x6c0b);
13634                 MP_WritePhyUshort(sc, 0x15, 0x00eb);
13635                 MP_WritePhyUshort(sc, 0x19, 0x6c0b);
13636                 MP_WritePhyUshort(sc, 0x15, 0x00f8);
13637                 MP_WritePhyUshort(sc, 0x19, 0x6f0b);
13638                 MP_WritePhyUshort(sc, 0x15, 0x00fe);
13639                 MP_WritePhyUshort(sc, 0x19, 0x6f0f);
13640                 MP_WritePhyUshort(sc, 0x15, 0x00db);
13641                 MP_WritePhyUshort(sc, 0x19, 0x6f09);
13642                 MP_WritePhyUshort(sc, 0x15, 0x00dc);
13643                 MP_WritePhyUshort(sc, 0x19, 0xaefd);
13644                 MP_WritePhyUshort(sc, 0x15, 0x00dd);
13645                 MP_WritePhyUshort(sc, 0x19, 0x6f0b);
13646                 MP_WritePhyUshort(sc, 0x15, 0x00de);
13647                 MP_WritePhyUshort(sc, 0x19, 0xc60b);
13648                 MP_WritePhyUshort(sc, 0x15, 0x00df);
13649                 MP_WritePhyUshort(sc, 0x19, 0x00fa);
13650                 MP_WritePhyUshort(sc, 0x15, 0x00e0);
13651                 MP_WritePhyUshort(sc, 0x19, 0x30e1);
13652                 MP_WritePhyUshort(sc, 0x15, 0x020c);
13653                 MP_WritePhyUshort(sc, 0x19, 0x3224);
13654                 MP_WritePhyUshort(sc, 0x15, 0x020e);
13655                 MP_WritePhyUshort(sc, 0x19, 0x9813);
13656                 MP_WritePhyUshort(sc, 0x15, 0x020f);
13657                 MP_WritePhyUshort(sc, 0x19, 0x7801);
13658                 MP_WritePhyUshort(sc, 0x15, 0x0210);
13659                 MP_WritePhyUshort(sc, 0x19, 0x930f);
13660                 MP_WritePhyUshort(sc, 0x15, 0x0211);
13661                 MP_WritePhyUshort(sc, 0x19, 0x9206);
13662                 MP_WritePhyUshort(sc, 0x15, 0x0212);
13663                 MP_WritePhyUshort(sc, 0x19, 0x4002);
13664                 MP_WritePhyUshort(sc, 0x15, 0x0213);
13665                 MP_WritePhyUshort(sc, 0x19, 0x7800);
13666                 MP_WritePhyUshort(sc, 0x15, 0x0214);
13667                 MP_WritePhyUshort(sc, 0x19, 0x588f);
13668                 MP_WritePhyUshort(sc, 0x15, 0x0215);
13669                 MP_WritePhyUshort(sc, 0x19, 0x5520);
13670                 MP_WritePhyUshort(sc, 0x15, 0x0216);
13671                 MP_WritePhyUshort(sc, 0x19, 0x3224);
13672                 MP_WritePhyUshort(sc, 0x15, 0x0217);
13673                 MP_WritePhyUshort(sc, 0x19, 0x4002);
13674                 MP_WritePhyUshort(sc, 0x15, 0x0218);
13675                 MP_WritePhyUshort(sc, 0x19, 0x7800);
13676                 MP_WritePhyUshort(sc, 0x15, 0x0219);
13677                 MP_WritePhyUshort(sc, 0x19, 0x588d);
13678                 MP_WritePhyUshort(sc, 0x15, 0x021a);
13679                 MP_WritePhyUshort(sc, 0x19, 0x5540);
13680                 MP_WritePhyUshort(sc, 0x15, 0x021b);
13681                 MP_WritePhyUshort(sc, 0x19, 0x9e03);
13682                 MP_WritePhyUshort(sc, 0x15, 0x021c);
13683                 MP_WritePhyUshort(sc, 0x19, 0x7c40);
13684                 MP_WritePhyUshort(sc, 0x15, 0x021d);
13685                 MP_WritePhyUshort(sc, 0x19, 0x6840);
13686                 MP_WritePhyUshort(sc, 0x15, 0x021e);
13687                 MP_WritePhyUshort(sc, 0x19, 0x3224);
13688                 MP_WritePhyUshort(sc, 0x15, 0x021f);
13689                 MP_WritePhyUshort(sc, 0x19, 0x4002);
13690                 MP_WritePhyUshort(sc, 0x15, 0x0220);
13691                 MP_WritePhyUshort(sc, 0x19, 0x3224);
13692                 MP_WritePhyUshort(sc, 0x15, 0x0221);
13693                 MP_WritePhyUshort(sc, 0x19, 0x9e03);
13694                 MP_WritePhyUshort(sc, 0x15, 0x0222);
13695                 MP_WritePhyUshort(sc, 0x19, 0x7c40);
13696                 MP_WritePhyUshort(sc, 0x15, 0x0223);
13697                 MP_WritePhyUshort(sc, 0x19, 0x6840);
13698                 MP_WritePhyUshort(sc, 0x15, 0x0224);
13699                 MP_WritePhyUshort(sc, 0x19, 0x7800);
13700                 MP_WritePhyUshort(sc, 0x15, 0x0225);
13701                 MP_WritePhyUshort(sc, 0x19, 0x3231);
13702                 MP_WritePhyUshort(sc, 0x15, 0x0000);
13703                 MP_WritePhyUshort(sc, 0x16, 0x0306);
13704                 MP_WritePhyUshort(sc, 0x16, 0x0300);
13705                 MP_WritePhyUshort(sc, 0x1f, 0x0002);
13706                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
13707                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
13708                 MP_WritePhyUshort(sc, 0x17, 0x2160);
13709                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
13710                 MP_WritePhyUshort(sc, 0x1e, 0x0040);
13711                 MP_WritePhyUshort(sc, 0x18, 0x0004);
13712                 MP_WritePhyUshort(sc, 0x18, 0x09d4);
13713                 MP_WritePhyUshort(sc, 0x19, 0x4000);
13714                 MP_WritePhyUshort(sc, 0x18, 0x09e4);
13715                 MP_WritePhyUshort(sc, 0x19, 0x0800);
13716                 MP_WritePhyUshort(sc, 0x18, 0x09f4);
13717                 MP_WritePhyUshort(sc, 0x19, 0xff00);
13718                 MP_WritePhyUshort(sc, 0x18, 0x0a04);
13719                 MP_WritePhyUshort(sc, 0x19, 0x4000);
13720                 MP_WritePhyUshort(sc, 0x18, 0x0a14);
13721                 MP_WritePhyUshort(sc, 0x19, 0x0c00);
13722                 MP_WritePhyUshort(sc, 0x18, 0x0a24);
13723                 MP_WritePhyUshort(sc, 0x19, 0xff00);
13724                 MP_WritePhyUshort(sc, 0x18, 0x0a74);
13725                 MP_WritePhyUshort(sc, 0x19, 0xf600);
13726                 MP_WritePhyUshort(sc, 0x18, 0x1a24);
13727                 MP_WritePhyUshort(sc, 0x19, 0x7d00);
13728                 MP_WritePhyUshort(sc, 0x18, 0x1a64);
13729                 MP_WritePhyUshort(sc, 0x19, 0x0500);
13730                 MP_WritePhyUshort(sc, 0x18, 0x1a74);
13731                 MP_WritePhyUshort(sc, 0x19, 0x9500);
13732                 MP_WritePhyUshort(sc, 0x18, 0x1a84);
13733                 MP_WritePhyUshort(sc, 0x19, 0x8000);
13734                 MP_WritePhyUshort(sc, 0x18, 0x1a94);
13735                 MP_WritePhyUshort(sc, 0x19, 0x7d00);
13736                 MP_WritePhyUshort(sc, 0x18, 0x1aa4);
13737                 MP_WritePhyUshort(sc, 0x19, 0x9600);
13738                 MP_WritePhyUshort(sc, 0x18, 0x1ac4);
13739                 MP_WritePhyUshort(sc, 0x19, 0x4000);
13740                 MP_WritePhyUshort(sc, 0x18, 0x1ad4);
13741                 MP_WritePhyUshort(sc, 0x19, 0x0800);
13742                 MP_WritePhyUshort(sc, 0x18, 0x1af4);
13743                 MP_WritePhyUshort(sc, 0x19, 0xc400);
13744                 MP_WritePhyUshort(sc, 0x18, 0x1b04);
13745                 MP_WritePhyUshort(sc, 0x19, 0x4000);
13746                 MP_WritePhyUshort(sc, 0x18, 0x1b14);
13747                 MP_WritePhyUshort(sc, 0x19, 0x0800);
13748                 MP_WritePhyUshort(sc, 0x18, 0x1b24);
13749                 MP_WritePhyUshort(sc, 0x19, 0xfd00);
13750                 MP_WritePhyUshort(sc, 0x18, 0x1b34);
13751                 MP_WritePhyUshort(sc, 0x19, 0x4000);
13752                 MP_WritePhyUshort(sc, 0x18, 0x1b44);
13753                 MP_WritePhyUshort(sc, 0x19, 0x0400);
13754                 MP_WritePhyUshort(sc, 0x18, 0x1b94);
13755                 MP_WritePhyUshort(sc, 0x19, 0xf100);
13756                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
13757                 MP_WritePhyUshort(sc, 0x17, 0x2100);
13758                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
13759                 MP_WritePhyUshort(sc, 0x1e, 0x0040);
13760                 MP_WritePhyUshort(sc, 0x18, 0x0000);
13761                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
13762                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
13763                 MP_WritePhyUshort(sc, 0x05, 0xfff6);
13764                 MP_WritePhyUshort(sc, 0x06, 0x0080);
13765                 MP_WritePhyUshort(sc, 0x05, 0x8000);
13766                 MP_WritePhyUshort(sc, 0x06, 0x0280);
13767                 MP_WritePhyUshort(sc, 0x06, 0x48f7);
13768                 MP_WritePhyUshort(sc, 0x06, 0x00e0);
13769                 MP_WritePhyUshort(sc, 0x06, 0xfff7);
13770                 MP_WritePhyUshort(sc, 0x06, 0xa080);
13771                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
13772                 MP_WritePhyUshort(sc, 0x06, 0xf602);
13773                 MP_WritePhyUshort(sc, 0x06, 0x0115);
13774                 MP_WritePhyUshort(sc, 0x06, 0x0201);
13775                 MP_WritePhyUshort(sc, 0x06, 0x2202);
13776                 MP_WritePhyUshort(sc, 0x06, 0x80a0);
13777                 MP_WritePhyUshort(sc, 0x06, 0x0201);
13778                 MP_WritePhyUshort(sc, 0x06, 0x3f02);
13779                 MP_WritePhyUshort(sc, 0x06, 0x0159);
13780                 MP_WritePhyUshort(sc, 0x06, 0x0280);
13781                 MP_WritePhyUshort(sc, 0x06, 0xbd02);
13782                 MP_WritePhyUshort(sc, 0x06, 0x80da);
13783                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
13784                 MP_WritePhyUshort(sc, 0x06, 0x88e1);
13785                 MP_WritePhyUshort(sc, 0x06, 0x8b89);
13786                 MP_WritePhyUshort(sc, 0x06, 0x1e01);
13787                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
13788                 MP_WritePhyUshort(sc, 0x06, 0x8a1e);
13789                 MP_WritePhyUshort(sc, 0x06, 0x01e1);
13790                 MP_WritePhyUshort(sc, 0x06, 0x8b8b);
13791                 MP_WritePhyUshort(sc, 0x06, 0x1e01);
13792                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
13793                 MP_WritePhyUshort(sc, 0x06, 0x8c1e);
13794                 MP_WritePhyUshort(sc, 0x06, 0x01e1);
13795                 MP_WritePhyUshort(sc, 0x06, 0x8b8d);
13796                 MP_WritePhyUshort(sc, 0x06, 0x1e01);
13797                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
13798                 MP_WritePhyUshort(sc, 0x06, 0x8e1e);
13799                 MP_WritePhyUshort(sc, 0x06, 0x01a0);
13800                 MP_WritePhyUshort(sc, 0x06, 0x00c7);
13801                 MP_WritePhyUshort(sc, 0x06, 0xaebb);
13802                 MP_WritePhyUshort(sc, 0x06, 0xd481);
13803                 MP_WritePhyUshort(sc, 0x06, 0xd2e4);
13804                 MP_WritePhyUshort(sc, 0x06, 0x8b92);
13805                 MP_WritePhyUshort(sc, 0x06, 0xe58b);
13806                 MP_WritePhyUshort(sc, 0x06, 0x93d1);
13807                 MP_WritePhyUshort(sc, 0x06, 0x03bf);
13808                 MP_WritePhyUshort(sc, 0x06, 0x859e);
13809                 MP_WritePhyUshort(sc, 0x06, 0x0237);
13810                 MP_WritePhyUshort(sc, 0x06, 0x23d1);
13811                 MP_WritePhyUshort(sc, 0x06, 0x02bf);
13812                 MP_WritePhyUshort(sc, 0x06, 0x85a1);
13813                 MP_WritePhyUshort(sc, 0x06, 0x0237);
13814                 MP_WritePhyUshort(sc, 0x06, 0x23ee);
13815                 MP_WritePhyUshort(sc, 0x06, 0x8608);
13816                 MP_WritePhyUshort(sc, 0x06, 0x03ee);
13817                 MP_WritePhyUshort(sc, 0x06, 0x860a);
13818                 MP_WritePhyUshort(sc, 0x06, 0x60ee);
13819                 MP_WritePhyUshort(sc, 0x06, 0x8610);
13820                 MP_WritePhyUshort(sc, 0x06, 0x00ee);
13821                 MP_WritePhyUshort(sc, 0x06, 0x8611);
13822                 MP_WritePhyUshort(sc, 0x06, 0x00ee);
13823                 MP_WritePhyUshort(sc, 0x06, 0x8abe);
13824                 MP_WritePhyUshort(sc, 0x06, 0x07ee);
13825                 MP_WritePhyUshort(sc, 0x06, 0x8abf);
13826                 MP_WritePhyUshort(sc, 0x06, 0x73ee);
13827                 MP_WritePhyUshort(sc, 0x06, 0x8a95);
13828                 MP_WritePhyUshort(sc, 0x06, 0x02bf);
13829                 MP_WritePhyUshort(sc, 0x06, 0x8b88);
13830                 MP_WritePhyUshort(sc, 0x06, 0xec00);
13831                 MP_WritePhyUshort(sc, 0x06, 0x19a9);
13832                 MP_WritePhyUshort(sc, 0x06, 0x8b90);
13833                 MP_WritePhyUshort(sc, 0x06, 0xf9ee);
13834                 MP_WritePhyUshort(sc, 0x06, 0xfff6);
13835                 MP_WritePhyUshort(sc, 0x06, 0x00ee);
13836                 MP_WritePhyUshort(sc, 0x06, 0xfff7);
13837                 MP_WritePhyUshort(sc, 0x06, 0xfed1);
13838                 MP_WritePhyUshort(sc, 0x06, 0x00bf);
13839                 MP_WritePhyUshort(sc, 0x06, 0x8595);
13840                 MP_WritePhyUshort(sc, 0x06, 0x0237);
13841                 MP_WritePhyUshort(sc, 0x06, 0x23d1);
13842                 MP_WritePhyUshort(sc, 0x06, 0x01bf);
13843                 MP_WritePhyUshort(sc, 0x06, 0x8598);
13844                 MP_WritePhyUshort(sc, 0x06, 0x0237);
13845                 MP_WritePhyUshort(sc, 0x06, 0x2304);
13846                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
13847                 MP_WritePhyUshort(sc, 0x06, 0x8b8a);
13848                 MP_WritePhyUshort(sc, 0x06, 0xad20);
13849                 MP_WritePhyUshort(sc, 0x06, 0x14ee);
13850                 MP_WritePhyUshort(sc, 0x06, 0x8b8a);
13851                 MP_WritePhyUshort(sc, 0x06, 0x0002);
13852                 MP_WritePhyUshort(sc, 0x06, 0x1f9a);
13853                 MP_WritePhyUshort(sc, 0x06, 0xe0e4);
13854                 MP_WritePhyUshort(sc, 0x06, 0x26e1);
13855                 MP_WritePhyUshort(sc, 0x06, 0xe427);
13856                 MP_WritePhyUshort(sc, 0x06, 0xeee4);
13857                 MP_WritePhyUshort(sc, 0x06, 0x2623);
13858                 MP_WritePhyUshort(sc, 0x06, 0xe5e4);
13859                 MP_WritePhyUshort(sc, 0x06, 0x27fc);
13860                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
13861                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
13862                 MP_WritePhyUshort(sc, 0x06, 0x8dad);
13863                 MP_WritePhyUshort(sc, 0x06, 0x2014);
13864                 MP_WritePhyUshort(sc, 0x06, 0xee8b);
13865                 MP_WritePhyUshort(sc, 0x06, 0x8d00);
13866                 MP_WritePhyUshort(sc, 0x06, 0xe08a);
13867                 MP_WritePhyUshort(sc, 0x06, 0x5a78);
13868                 MP_WritePhyUshort(sc, 0x06, 0x039e);
13869                 MP_WritePhyUshort(sc, 0x06, 0x0902);
13870                 MP_WritePhyUshort(sc, 0x06, 0x05db);
13871                 MP_WritePhyUshort(sc, 0x06, 0x0282);
13872                 MP_WritePhyUshort(sc, 0x06, 0x7b02);
13873                 MP_WritePhyUshort(sc, 0x06, 0x3231);
13874                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
13875                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
13876                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
13877                 MP_WritePhyUshort(sc, 0x06, 0xad20);
13878                 MP_WritePhyUshort(sc, 0x06, 0x1df6);
13879                 MP_WritePhyUshort(sc, 0x06, 0x20e4);
13880                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
13881                 MP_WritePhyUshort(sc, 0x06, 0x0281);
13882                 MP_WritePhyUshort(sc, 0x06, 0x5c02);
13883                 MP_WritePhyUshort(sc, 0x06, 0x2bcb);
13884                 MP_WritePhyUshort(sc, 0x06, 0x022d);
13885                 MP_WritePhyUshort(sc, 0x06, 0x2902);
13886                 MP_WritePhyUshort(sc, 0x06, 0x03b4);
13887                 MP_WritePhyUshort(sc, 0x06, 0x0285);
13888                 MP_WritePhyUshort(sc, 0x06, 0x6402);
13889                 MP_WritePhyUshort(sc, 0x06, 0x2eca);
13890                 MP_WritePhyUshort(sc, 0x06, 0x0284);
13891                 MP_WritePhyUshort(sc, 0x06, 0xcd02);
13892                 MP_WritePhyUshort(sc, 0x06, 0x046f);
13893                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
13894                 MP_WritePhyUshort(sc, 0x06, 0x8ead);
13895                 MP_WritePhyUshort(sc, 0x06, 0x210b);
13896                 MP_WritePhyUshort(sc, 0x06, 0xf621);
13897                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
13898                 MP_WritePhyUshort(sc, 0x06, 0x8e02);
13899                 MP_WritePhyUshort(sc, 0x06, 0x8520);
13900                 MP_WritePhyUshort(sc, 0x06, 0x021b);
13901                 MP_WritePhyUshort(sc, 0x06, 0xe8e0);
13902                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
13903                 MP_WritePhyUshort(sc, 0x06, 0xad22);
13904                 MP_WritePhyUshort(sc, 0x06, 0x05f6);
13905                 MP_WritePhyUshort(sc, 0x06, 0x22e4);
13906                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
13907                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
13908                 MP_WritePhyUshort(sc, 0x06, 0x8ead);
13909                 MP_WritePhyUshort(sc, 0x06, 0x2308);
13910                 MP_WritePhyUshort(sc, 0x06, 0xf623);
13911                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
13912                 MP_WritePhyUshort(sc, 0x06, 0x8e02);
13913                 MP_WritePhyUshort(sc, 0x06, 0x311c);
13914                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
13915                 MP_WritePhyUshort(sc, 0x06, 0x8ead);
13916                 MP_WritePhyUshort(sc, 0x06, 0x2405);
13917                 MP_WritePhyUshort(sc, 0x06, 0xf624);
13918                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
13919                 MP_WritePhyUshort(sc, 0x06, 0x8ee0);
13920                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
13921                 MP_WritePhyUshort(sc, 0x06, 0xad25);
13922                 MP_WritePhyUshort(sc, 0x06, 0x05f6);
13923                 MP_WritePhyUshort(sc, 0x06, 0x25e4);
13924                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
13925                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
13926                 MP_WritePhyUshort(sc, 0x06, 0x8ead);
13927                 MP_WritePhyUshort(sc, 0x06, 0x2608);
13928                 MP_WritePhyUshort(sc, 0x06, 0xf626);
13929                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
13930                 MP_WritePhyUshort(sc, 0x06, 0x8e02);
13931                 MP_WritePhyUshort(sc, 0x06, 0x2df5);
13932                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
13933                 MP_WritePhyUshort(sc, 0x06, 0x8ead);
13934                 MP_WritePhyUshort(sc, 0x06, 0x2705);
13935                 MP_WritePhyUshort(sc, 0x06, 0xf627);
13936                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
13937                 MP_WritePhyUshort(sc, 0x06, 0x8e02);
13938                 MP_WritePhyUshort(sc, 0x06, 0x037a);
13939                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
13940                 MP_WritePhyUshort(sc, 0x06, 0xf8f9);
13941                 MP_WritePhyUshort(sc, 0x06, 0xfaef);
13942                 MP_WritePhyUshort(sc, 0x06, 0x69e0);
13943                 MP_WritePhyUshort(sc, 0x06, 0x8b87);
13944                 MP_WritePhyUshort(sc, 0x06, 0xad20);
13945                 MP_WritePhyUshort(sc, 0x06, 0x65d2);
13946                 MP_WritePhyUshort(sc, 0x06, 0x00bf);
13947                 MP_WritePhyUshort(sc, 0x06, 0x2fe9);
13948                 MP_WritePhyUshort(sc, 0x06, 0x0236);
13949                 MP_WritePhyUshort(sc, 0x06, 0xf61e);
13950                 MP_WritePhyUshort(sc, 0x06, 0x21bf);
13951                 MP_WritePhyUshort(sc, 0x06, 0x2ff5);
13952                 MP_WritePhyUshort(sc, 0x06, 0x0236);
13953                 MP_WritePhyUshort(sc, 0x06, 0xf60c);
13954                 MP_WritePhyUshort(sc, 0x06, 0x111e);
13955                 MP_WritePhyUshort(sc, 0x06, 0x21bf);
13956                 MP_WritePhyUshort(sc, 0x06, 0x2ff8);
13957                 MP_WritePhyUshort(sc, 0x06, 0x0236);
13958                 MP_WritePhyUshort(sc, 0x06, 0xf60c);
13959                 MP_WritePhyUshort(sc, 0x06, 0x121e);
13960                 MP_WritePhyUshort(sc, 0x06, 0x21bf);
13961                 MP_WritePhyUshort(sc, 0x06, 0x2ffb);
13962                 MP_WritePhyUshort(sc, 0x06, 0x0236);
13963                 MP_WritePhyUshort(sc, 0x06, 0xf60c);
13964                 MP_WritePhyUshort(sc, 0x06, 0x131e);
13965                 MP_WritePhyUshort(sc, 0x06, 0x21bf);
13966                 MP_WritePhyUshort(sc, 0x06, 0x1f97);
13967                 MP_WritePhyUshort(sc, 0x06, 0x0236);
13968                 MP_WritePhyUshort(sc, 0x06, 0xf60c);
13969                 MP_WritePhyUshort(sc, 0x06, 0x141e);
13970                 MP_WritePhyUshort(sc, 0x06, 0x21bf);
13971                 MP_WritePhyUshort(sc, 0x06, 0x859b);
13972                 MP_WritePhyUshort(sc, 0x06, 0x0236);
13973                 MP_WritePhyUshort(sc, 0x06, 0xf60c);
13974                 MP_WritePhyUshort(sc, 0x06, 0x161e);
13975                 MP_WritePhyUshort(sc, 0x06, 0x21e0);
13976                 MP_WritePhyUshort(sc, 0x06, 0x8a8c);
13977                 MP_WritePhyUshort(sc, 0x06, 0x1f02);
13978                 MP_WritePhyUshort(sc, 0x06, 0x9e22);
13979                 MP_WritePhyUshort(sc, 0x06, 0xe68a);
13980                 MP_WritePhyUshort(sc, 0x06, 0x8cad);
13981                 MP_WritePhyUshort(sc, 0x06, 0x3114);
13982                 MP_WritePhyUshort(sc, 0x06, 0xad30);
13983                 MP_WritePhyUshort(sc, 0x06, 0x11ef);
13984                 MP_WritePhyUshort(sc, 0x06, 0x0258);
13985                 MP_WritePhyUshort(sc, 0x06, 0x0c9e);
13986                 MP_WritePhyUshort(sc, 0x06, 0x07ad);
13987                 MP_WritePhyUshort(sc, 0x06, 0x3608);
13988                 MP_WritePhyUshort(sc, 0x06, 0x5a30);
13989                 MP_WritePhyUshort(sc, 0x06, 0x9f04);
13990                 MP_WritePhyUshort(sc, 0x06, 0xd101);
13991                 MP_WritePhyUshort(sc, 0x06, 0xae02);
13992                 MP_WritePhyUshort(sc, 0x06, 0xd100);
13993                 MP_WritePhyUshort(sc, 0x06, 0xbf2f);
13994                 MP_WritePhyUshort(sc, 0x06, 0xf202);
13995                 MP_WritePhyUshort(sc, 0x06, 0x3723);
13996                 MP_WritePhyUshort(sc, 0x06, 0xef96);
13997                 MP_WritePhyUshort(sc, 0x06, 0xfefd);
13998                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
13999                 MP_WritePhyUshort(sc, 0x06, 0xf8f9);
14000                 MP_WritePhyUshort(sc, 0x06, 0xface);
14001                 MP_WritePhyUshort(sc, 0x06, 0xfaef);
14002                 MP_WritePhyUshort(sc, 0x06, 0x69fa);
14003                 MP_WritePhyUshort(sc, 0x06, 0xd401);
14004                 MP_WritePhyUshort(sc, 0x06, 0x55b4);
14005                 MP_WritePhyUshort(sc, 0x06, 0xfebf);
14006                 MP_WritePhyUshort(sc, 0x06, 0x85a7);
14007                 MP_WritePhyUshort(sc, 0x06, 0x0236);
14008                 MP_WritePhyUshort(sc, 0x06, 0xf6ac);
14009                 MP_WritePhyUshort(sc, 0x06, 0x280b);
14010                 MP_WritePhyUshort(sc, 0x06, 0xbf85);
14011                 MP_WritePhyUshort(sc, 0x06, 0xa402);
14012                 MP_WritePhyUshort(sc, 0x06, 0x36f6);
14013                 MP_WritePhyUshort(sc, 0x06, 0xac28);
14014                 MP_WritePhyUshort(sc, 0x06, 0x49ae);
14015                 MP_WritePhyUshort(sc, 0x06, 0x64bf);
14016                 MP_WritePhyUshort(sc, 0x06, 0x85a4);
14017                 MP_WritePhyUshort(sc, 0x06, 0x0236);
14018                 MP_WritePhyUshort(sc, 0x06, 0xf6ac);
14019                 MP_WritePhyUshort(sc, 0x06, 0x285b);
14020                 MP_WritePhyUshort(sc, 0x06, 0xd000);
14021                 MP_WritePhyUshort(sc, 0x06, 0x0282);
14022                 MP_WritePhyUshort(sc, 0x06, 0x60ac);
14023                 MP_WritePhyUshort(sc, 0x06, 0x2105);
14024                 MP_WritePhyUshort(sc, 0x06, 0xac22);
14025                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
14026                 MP_WritePhyUshort(sc, 0x06, 0x4ebf);
14027                 MP_WritePhyUshort(sc, 0x06, 0xe0c4);
14028                 MP_WritePhyUshort(sc, 0x06, 0xbe86);
14029                 MP_WritePhyUshort(sc, 0x06, 0x14d2);
14030                 MP_WritePhyUshort(sc, 0x06, 0x04d8);
14031                 MP_WritePhyUshort(sc, 0x06, 0x19d9);
14032                 MP_WritePhyUshort(sc, 0x06, 0x1907);
14033                 MP_WritePhyUshort(sc, 0x06, 0xdc19);
14034                 MP_WritePhyUshort(sc, 0x06, 0xdd19);
14035                 MP_WritePhyUshort(sc, 0x06, 0x0789);
14036                 MP_WritePhyUshort(sc, 0x06, 0x89ef);
14037                 MP_WritePhyUshort(sc, 0x06, 0x645e);
14038                 MP_WritePhyUshort(sc, 0x06, 0x07ff);
14039                 MP_WritePhyUshort(sc, 0x06, 0x0d65);
14040                 MP_WritePhyUshort(sc, 0x06, 0x5cf8);
14041                 MP_WritePhyUshort(sc, 0x06, 0x001e);
14042                 MP_WritePhyUshort(sc, 0x06, 0x46dc);
14043                 MP_WritePhyUshort(sc, 0x06, 0x19dd);
14044                 MP_WritePhyUshort(sc, 0x06, 0x19b2);
14045                 MP_WritePhyUshort(sc, 0x06, 0xe2d4);
14046                 MP_WritePhyUshort(sc, 0x06, 0x0001);
14047                 MP_WritePhyUshort(sc, 0x06, 0xbf85);
14048                 MP_WritePhyUshort(sc, 0x06, 0xa402);
14049                 MP_WritePhyUshort(sc, 0x06, 0x3723);
14050                 MP_WritePhyUshort(sc, 0x06, 0xae1d);
14051                 MP_WritePhyUshort(sc, 0x06, 0xbee0);
14052                 MP_WritePhyUshort(sc, 0x06, 0xc4bf);
14053                 MP_WritePhyUshort(sc, 0x06, 0x8614);
14054                 MP_WritePhyUshort(sc, 0x06, 0xd204);
14055                 MP_WritePhyUshort(sc, 0x06, 0xd819);
14056                 MP_WritePhyUshort(sc, 0x06, 0xd919);
14057                 MP_WritePhyUshort(sc, 0x06, 0x07dc);
14058                 MP_WritePhyUshort(sc, 0x06, 0x19dd);
14059                 MP_WritePhyUshort(sc, 0x06, 0x1907);
14060                 MP_WritePhyUshort(sc, 0x06, 0xb2f4);
14061                 MP_WritePhyUshort(sc, 0x06, 0xd400);
14062                 MP_WritePhyUshort(sc, 0x06, 0x00bf);
14063                 MP_WritePhyUshort(sc, 0x06, 0x85a4);
14064                 MP_WritePhyUshort(sc, 0x06, 0x0237);
14065                 MP_WritePhyUshort(sc, 0x06, 0x23fe);
14066                 MP_WritePhyUshort(sc, 0x06, 0xef96);
14067                 MP_WritePhyUshort(sc, 0x06, 0xfec6);
14068                 MP_WritePhyUshort(sc, 0x06, 0xfefd);
14069                 MP_WritePhyUshort(sc, 0x06, 0xfc05);
14070                 MP_WritePhyUshort(sc, 0x06, 0xf9e2);
14071                 MP_WritePhyUshort(sc, 0x06, 0xe0ea);
14072                 MP_WritePhyUshort(sc, 0x06, 0xe3e0);
14073                 MP_WritePhyUshort(sc, 0x06, 0xeb5a);
14074                 MP_WritePhyUshort(sc, 0x06, 0x070c);
14075                 MP_WritePhyUshort(sc, 0x06, 0x031e);
14076                 MP_WritePhyUshort(sc, 0x06, 0x20e6);
14077                 MP_WritePhyUshort(sc, 0x06, 0xe0ea);
14078                 MP_WritePhyUshort(sc, 0x06, 0xe7e0);
14079                 MP_WritePhyUshort(sc, 0x06, 0xebe0);
14080                 MP_WritePhyUshort(sc, 0x06, 0xe0fc);
14081                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
14082                 MP_WritePhyUshort(sc, 0x06, 0xfdfd);
14083                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
14084                 MP_WritePhyUshort(sc, 0x06, 0xf9e0);
14085                 MP_WritePhyUshort(sc, 0x06, 0x8b81);
14086                 MP_WritePhyUshort(sc, 0x06, 0xac26);
14087                 MP_WritePhyUshort(sc, 0x06, 0x1ae0);
14088                 MP_WritePhyUshort(sc, 0x06, 0x8b81);
14089                 MP_WritePhyUshort(sc, 0x06, 0xac21);
14090                 MP_WritePhyUshort(sc, 0x06, 0x14e0);
14091                 MP_WritePhyUshort(sc, 0x06, 0x8b85);
14092                 MP_WritePhyUshort(sc, 0x06, 0xac20);
14093                 MP_WritePhyUshort(sc, 0x06, 0x0ee0);
14094                 MP_WritePhyUshort(sc, 0x06, 0x8b85);
14095                 MP_WritePhyUshort(sc, 0x06, 0xac23);
14096                 MP_WritePhyUshort(sc, 0x06, 0x08e0);
14097                 MP_WritePhyUshort(sc, 0x06, 0x8b87);
14098                 MP_WritePhyUshort(sc, 0x06, 0xac24);
14099                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
14100                 MP_WritePhyUshort(sc, 0x06, 0x3802);
14101                 MP_WritePhyUshort(sc, 0x06, 0x1ab5);
14102                 MP_WritePhyUshort(sc, 0x06, 0xeee4);
14103                 MP_WritePhyUshort(sc, 0x06, 0x1c04);
14104                 MP_WritePhyUshort(sc, 0x06, 0xeee4);
14105                 MP_WritePhyUshort(sc, 0x06, 0x1d04);
14106                 MP_WritePhyUshort(sc, 0x06, 0xe2e0);
14107                 MP_WritePhyUshort(sc, 0x06, 0x7ce3);
14108                 MP_WritePhyUshort(sc, 0x06, 0xe07d);
14109                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
14110                 MP_WritePhyUshort(sc, 0x06, 0x38e1);
14111                 MP_WritePhyUshort(sc, 0x06, 0xe039);
14112                 MP_WritePhyUshort(sc, 0x06, 0xad2e);
14113                 MP_WritePhyUshort(sc, 0x06, 0x1bad);
14114                 MP_WritePhyUshort(sc, 0x06, 0x390d);
14115                 MP_WritePhyUshort(sc, 0x06, 0xd101);
14116                 MP_WritePhyUshort(sc, 0x06, 0xbf21);
14117                 MP_WritePhyUshort(sc, 0x06, 0xd502);
14118                 MP_WritePhyUshort(sc, 0x06, 0x3723);
14119                 MP_WritePhyUshort(sc, 0x06, 0x0282);
14120                 MP_WritePhyUshort(sc, 0x06, 0xd8ae);
14121                 MP_WritePhyUshort(sc, 0x06, 0x0bac);
14122                 MP_WritePhyUshort(sc, 0x06, 0x3802);
14123                 MP_WritePhyUshort(sc, 0x06, 0xae06);
14124                 MP_WritePhyUshort(sc, 0x06, 0x0283);
14125                 MP_WritePhyUshort(sc, 0x06, 0x1802);
14126                 MP_WritePhyUshort(sc, 0x06, 0x8360);
14127                 MP_WritePhyUshort(sc, 0x06, 0x021a);
14128                 MP_WritePhyUshort(sc, 0x06, 0xc6fd);
14129                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
14130                 MP_WritePhyUshort(sc, 0x06, 0xf8e1);
14131                 MP_WritePhyUshort(sc, 0x06, 0x8af4);
14132                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
14133                 MP_WritePhyUshort(sc, 0x06, 0x81ad);
14134                 MP_WritePhyUshort(sc, 0x06, 0x2605);
14135                 MP_WritePhyUshort(sc, 0x06, 0x0222);
14136                 MP_WritePhyUshort(sc, 0x06, 0xa4f7);
14137                 MP_WritePhyUshort(sc, 0x06, 0x28e0);
14138                 MP_WritePhyUshort(sc, 0x06, 0x8b81);
14139                 MP_WritePhyUshort(sc, 0x06, 0xad21);
14140                 MP_WritePhyUshort(sc, 0x06, 0x0502);
14141                 MP_WritePhyUshort(sc, 0x06, 0x23a9);
14142                 MP_WritePhyUshort(sc, 0x06, 0xf729);
14143                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
14144                 MP_WritePhyUshort(sc, 0x06, 0x85ad);
14145                 MP_WritePhyUshort(sc, 0x06, 0x2005);
14146                 MP_WritePhyUshort(sc, 0x06, 0x0214);
14147                 MP_WritePhyUshort(sc, 0x06, 0xabf7);
14148                 MP_WritePhyUshort(sc, 0x06, 0x2ae0);
14149                 MP_WritePhyUshort(sc, 0x06, 0x8b85);
14150                 MP_WritePhyUshort(sc, 0x06, 0xad23);
14151                 MP_WritePhyUshort(sc, 0x06, 0x0502);
14152                 MP_WritePhyUshort(sc, 0x06, 0x12e7);
14153                 MP_WritePhyUshort(sc, 0x06, 0xf72b);
14154                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
14155                 MP_WritePhyUshort(sc, 0x06, 0x87ad);
14156                 MP_WritePhyUshort(sc, 0x06, 0x2405);
14157                 MP_WritePhyUshort(sc, 0x06, 0x0283);
14158                 MP_WritePhyUshort(sc, 0x06, 0xbcf7);
14159                 MP_WritePhyUshort(sc, 0x06, 0x2ce5);
14160                 MP_WritePhyUshort(sc, 0x06, 0x8af4);
14161                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
14162                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
14163                 MP_WritePhyUshort(sc, 0x06, 0x8b81);
14164                 MP_WritePhyUshort(sc, 0x06, 0xad26);
14165                 MP_WritePhyUshort(sc, 0x06, 0x0302);
14166                 MP_WritePhyUshort(sc, 0x06, 0x21e5);
14167                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
14168                 MP_WritePhyUshort(sc, 0x06, 0x81ad);
14169                 MP_WritePhyUshort(sc, 0x06, 0x2109);
14170                 MP_WritePhyUshort(sc, 0x06, 0xe08a);
14171                 MP_WritePhyUshort(sc, 0x06, 0xf4ac);
14172                 MP_WritePhyUshort(sc, 0x06, 0x2003);
14173                 MP_WritePhyUshort(sc, 0x06, 0x0223);
14174                 MP_WritePhyUshort(sc, 0x06, 0x98e0);
14175                 MP_WritePhyUshort(sc, 0x06, 0x8b85);
14176                 MP_WritePhyUshort(sc, 0x06, 0xad20);
14177                 MP_WritePhyUshort(sc, 0x06, 0x09e0);
14178                 MP_WritePhyUshort(sc, 0x06, 0x8af4);
14179                 MP_WritePhyUshort(sc, 0x06, 0xac21);
14180                 MP_WritePhyUshort(sc, 0x06, 0x0302);
14181                 MP_WritePhyUshort(sc, 0x06, 0x13fb);
14182                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
14183                 MP_WritePhyUshort(sc, 0x06, 0x85ad);
14184                 MP_WritePhyUshort(sc, 0x06, 0x2309);
14185                 MP_WritePhyUshort(sc, 0x06, 0xe08a);
14186                 MP_WritePhyUshort(sc, 0x06, 0xf4ac);
14187                 MP_WritePhyUshort(sc, 0x06, 0x2203);
14188                 MP_WritePhyUshort(sc, 0x06, 0x0212);
14189                 MP_WritePhyUshort(sc, 0x06, 0xfae0);
14190                 MP_WritePhyUshort(sc, 0x06, 0x8b87);
14191                 MP_WritePhyUshort(sc, 0x06, 0xad24);
14192                 MP_WritePhyUshort(sc, 0x06, 0x09e0);
14193                 MP_WritePhyUshort(sc, 0x06, 0x8af4);
14194                 MP_WritePhyUshort(sc, 0x06, 0xac23);
14195                 MP_WritePhyUshort(sc, 0x06, 0x0302);
14196                 MP_WritePhyUshort(sc, 0x06, 0x83c1);
14197                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
14198                 MP_WritePhyUshort(sc, 0x06, 0xf8e1);
14199                 MP_WritePhyUshort(sc, 0x06, 0x8af4);
14200                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
14201                 MP_WritePhyUshort(sc, 0x06, 0x81ad);
14202                 MP_WritePhyUshort(sc, 0x06, 0x2608);
14203                 MP_WritePhyUshort(sc, 0x06, 0xe083);
14204                 MP_WritePhyUshort(sc, 0x06, 0xd2ad);
14205                 MP_WritePhyUshort(sc, 0x06, 0x2502);
14206                 MP_WritePhyUshort(sc, 0x06, 0xf628);
14207                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
14208                 MP_WritePhyUshort(sc, 0x06, 0x81ad);
14209                 MP_WritePhyUshort(sc, 0x06, 0x210a);
14210                 MP_WritePhyUshort(sc, 0x06, 0xe084);
14211                 MP_WritePhyUshort(sc, 0x06, 0x0af6);
14212                 MP_WritePhyUshort(sc, 0x06, 0x27a0);
14213                 MP_WritePhyUshort(sc, 0x06, 0x0502);
14214                 MP_WritePhyUshort(sc, 0x06, 0xf629);
14215                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
14216                 MP_WritePhyUshort(sc, 0x06, 0x85ad);
14217                 MP_WritePhyUshort(sc, 0x06, 0x2008);
14218                 MP_WritePhyUshort(sc, 0x06, 0xe08a);
14219                 MP_WritePhyUshort(sc, 0x06, 0xe8ad);
14220                 MP_WritePhyUshort(sc, 0x06, 0x2102);
14221                 MP_WritePhyUshort(sc, 0x06, 0xf62a);
14222                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
14223                 MP_WritePhyUshort(sc, 0x06, 0x85ad);
14224                 MP_WritePhyUshort(sc, 0x06, 0x2308);
14225                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
14226                 MP_WritePhyUshort(sc, 0x06, 0x20a0);
14227                 MP_WritePhyUshort(sc, 0x06, 0x0302);
14228                 MP_WritePhyUshort(sc, 0x06, 0xf62b);
14229                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
14230                 MP_WritePhyUshort(sc, 0x06, 0x87ad);
14231                 MP_WritePhyUshort(sc, 0x06, 0x2408);
14232                 MP_WritePhyUshort(sc, 0x06, 0xe086);
14233                 MP_WritePhyUshort(sc, 0x06, 0x02a0);
14234                 MP_WritePhyUshort(sc, 0x06, 0x0302);
14235                 MP_WritePhyUshort(sc, 0x06, 0xf62c);
14236                 MP_WritePhyUshort(sc, 0x06, 0xe58a);
14237                 MP_WritePhyUshort(sc, 0x06, 0xf4a1);
14238                 MP_WritePhyUshort(sc, 0x06, 0x0008);
14239                 MP_WritePhyUshort(sc, 0x06, 0xd100);
14240                 MP_WritePhyUshort(sc, 0x06, 0xbf21);
14241                 MP_WritePhyUshort(sc, 0x06, 0xd502);
14242                 MP_WritePhyUshort(sc, 0x06, 0x3723);
14243                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
14244                 MP_WritePhyUshort(sc, 0x06, 0xee86);
14245                 MP_WritePhyUshort(sc, 0x06, 0x0200);
14246                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
14247                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
14248                 MP_WritePhyUshort(sc, 0x06, 0x87ad);
14249                 MP_WritePhyUshort(sc, 0x06, 0x241e);
14250                 MP_WritePhyUshort(sc, 0x06, 0xe086);
14251                 MP_WritePhyUshort(sc, 0x06, 0x02a0);
14252                 MP_WritePhyUshort(sc, 0x06, 0x0005);
14253                 MP_WritePhyUshort(sc, 0x06, 0x0283);
14254                 MP_WritePhyUshort(sc, 0x06, 0xe8ae);
14255                 MP_WritePhyUshort(sc, 0x06, 0xf5a0);
14256                 MP_WritePhyUshort(sc, 0x06, 0x0105);
14257                 MP_WritePhyUshort(sc, 0x06, 0x0283);
14258                 MP_WritePhyUshort(sc, 0x06, 0xf8ae);
14259                 MP_WritePhyUshort(sc, 0x06, 0x0ba0);
14260                 MP_WritePhyUshort(sc, 0x06, 0x0205);
14261                 MP_WritePhyUshort(sc, 0x06, 0x0284);
14262                 MP_WritePhyUshort(sc, 0x06, 0x14ae);
14263                 MP_WritePhyUshort(sc, 0x06, 0x03a0);
14264                 MP_WritePhyUshort(sc, 0x06, 0x0300);
14265                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
14266                 MP_WritePhyUshort(sc, 0x06, 0xf8fa);
14267                 MP_WritePhyUshort(sc, 0x06, 0xef69);
14268                 MP_WritePhyUshort(sc, 0x06, 0x0284);
14269                 MP_WritePhyUshort(sc, 0x06, 0x2bee);
14270                 MP_WritePhyUshort(sc, 0x06, 0x8602);
14271                 MP_WritePhyUshort(sc, 0x06, 0x01ef);
14272                 MP_WritePhyUshort(sc, 0x06, 0x96fe);
14273                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
14274                 MP_WritePhyUshort(sc, 0x06, 0xf8ee);
14275                 MP_WritePhyUshort(sc, 0x06, 0x8609);
14276                 MP_WritePhyUshort(sc, 0x06, 0x0002);
14277                 MP_WritePhyUshort(sc, 0x06, 0x8461);
14278                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
14279                 MP_WritePhyUshort(sc, 0x06, 0xae10);
14280                 MP_WritePhyUshort(sc, 0x06, 0x0000);
14281                 MP_WritePhyUshort(sc, 0x06, 0x0000);
14282                 MP_WritePhyUshort(sc, 0x06, 0x0000);
14283                 MP_WritePhyUshort(sc, 0x06, 0x0000);
14284                 MP_WritePhyUshort(sc, 0x06, 0x0000);
14285                 MP_WritePhyUshort(sc, 0x06, 0x0000);
14286                 MP_WritePhyUshort(sc, 0x06, 0x0000);
14287                 MP_WritePhyUshort(sc, 0x06, 0x0000);
14288                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
14289                 MP_WritePhyUshort(sc, 0x06, 0x8608);
14290                 MP_WritePhyUshort(sc, 0x06, 0xe186);
14291                 MP_WritePhyUshort(sc, 0x06, 0x091f);
14292                 MP_WritePhyUshort(sc, 0x06, 0x019e);
14293                 MP_WritePhyUshort(sc, 0x06, 0x0611);
14294                 MP_WritePhyUshort(sc, 0x06, 0xe586);
14295                 MP_WritePhyUshort(sc, 0x06, 0x09ae);
14296                 MP_WritePhyUshort(sc, 0x06, 0x04ee);
14297                 MP_WritePhyUshort(sc, 0x06, 0x8602);
14298                 MP_WritePhyUshort(sc, 0x06, 0x01fc);
14299                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
14300                 MP_WritePhyUshort(sc, 0x06, 0xf9fa);
14301                 MP_WritePhyUshort(sc, 0x06, 0xef69);
14302                 MP_WritePhyUshort(sc, 0x06, 0xfbbf);
14303                 MP_WritePhyUshort(sc, 0x06, 0x8604);
14304                 MP_WritePhyUshort(sc, 0x06, 0xef79);
14305                 MP_WritePhyUshort(sc, 0x06, 0xd200);
14306                 MP_WritePhyUshort(sc, 0x06, 0xd400);
14307                 MP_WritePhyUshort(sc, 0x06, 0x221e);
14308                 MP_WritePhyUshort(sc, 0x06, 0x02bf);
14309                 MP_WritePhyUshort(sc, 0x06, 0x2fec);
14310                 MP_WritePhyUshort(sc, 0x06, 0x0237);
14311                 MP_WritePhyUshort(sc, 0x06, 0x23bf);
14312                 MP_WritePhyUshort(sc, 0x06, 0x13f2);
14313                 MP_WritePhyUshort(sc, 0x06, 0x0236);
14314                 MP_WritePhyUshort(sc, 0x06, 0xf60d);
14315                 MP_WritePhyUshort(sc, 0x06, 0x4559);
14316                 MP_WritePhyUshort(sc, 0x06, 0x1fef);
14317                 MP_WritePhyUshort(sc, 0x06, 0x97dd);
14318                 MP_WritePhyUshort(sc, 0x06, 0xd308);
14319                 MP_WritePhyUshort(sc, 0x06, 0x1a93);
14320                 MP_WritePhyUshort(sc, 0x06, 0xdd12);
14321                 MP_WritePhyUshort(sc, 0x06, 0x17a2);
14322                 MP_WritePhyUshort(sc, 0x06, 0x04de);
14323                 MP_WritePhyUshort(sc, 0x06, 0xffef);
14324                 MP_WritePhyUshort(sc, 0x06, 0x96fe);
14325                 MP_WritePhyUshort(sc, 0x06, 0xfdfc);
14326                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
14327                 MP_WritePhyUshort(sc, 0x06, 0xf9fa);
14328                 MP_WritePhyUshort(sc, 0x06, 0xef69);
14329                 MP_WritePhyUshort(sc, 0x06, 0xfbee);
14330                 MP_WritePhyUshort(sc, 0x06, 0x8602);
14331                 MP_WritePhyUshort(sc, 0x06, 0x03d5);
14332                 MP_WritePhyUshort(sc, 0x06, 0x0080);
14333                 MP_WritePhyUshort(sc, 0x06, 0xbf86);
14334                 MP_WritePhyUshort(sc, 0x06, 0x04ef);
14335                 MP_WritePhyUshort(sc, 0x06, 0x79ef);
14336                 MP_WritePhyUshort(sc, 0x06, 0x45bf);
14337                 MP_WritePhyUshort(sc, 0x06, 0x2fec);
14338                 MP_WritePhyUshort(sc, 0x06, 0x0237);
14339                 MP_WritePhyUshort(sc, 0x06, 0x23bf);
14340                 MP_WritePhyUshort(sc, 0x06, 0x13f2);
14341                 MP_WritePhyUshort(sc, 0x06, 0x0236);
14342                 MP_WritePhyUshort(sc, 0x06, 0xf6ad);
14343                 MP_WritePhyUshort(sc, 0x06, 0x2702);
14344                 MP_WritePhyUshort(sc, 0x06, 0x78ff);
14345                 MP_WritePhyUshort(sc, 0x06, 0xe186);
14346                 MP_WritePhyUshort(sc, 0x06, 0x0a1b);
14347                 MP_WritePhyUshort(sc, 0x06, 0x01aa);
14348                 MP_WritePhyUshort(sc, 0x06, 0x2eef);
14349                 MP_WritePhyUshort(sc, 0x06, 0x97d9);
14350                 MP_WritePhyUshort(sc, 0x06, 0x7900);
14351                 MP_WritePhyUshort(sc, 0x06, 0x9e2b);
14352                 MP_WritePhyUshort(sc, 0x06, 0x81dd);
14353                 MP_WritePhyUshort(sc, 0x06, 0xbf85);
14354                 MP_WritePhyUshort(sc, 0x06, 0xad02);
14355                 MP_WritePhyUshort(sc, 0x06, 0x3723);
14356                 MP_WritePhyUshort(sc, 0x06, 0xd101);
14357                 MP_WritePhyUshort(sc, 0x06, 0xef02);
14358                 MP_WritePhyUshort(sc, 0x06, 0x100c);
14359                 MP_WritePhyUshort(sc, 0x06, 0x11b0);
14360                 MP_WritePhyUshort(sc, 0x06, 0xfc0d);
14361                 MP_WritePhyUshort(sc, 0x06, 0x11bf);
14362                 MP_WritePhyUshort(sc, 0x06, 0x85aa);
14363                 MP_WritePhyUshort(sc, 0x06, 0x0237);
14364                 MP_WritePhyUshort(sc, 0x06, 0x23d1);
14365                 MP_WritePhyUshort(sc, 0x06, 0x00bf);
14366                 MP_WritePhyUshort(sc, 0x06, 0x85aa);
14367                 MP_WritePhyUshort(sc, 0x06, 0x0237);
14368                 MP_WritePhyUshort(sc, 0x06, 0x23ee);
14369                 MP_WritePhyUshort(sc, 0x06, 0x8602);
14370                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
14371                 MP_WritePhyUshort(sc, 0x06, 0x0413);
14372                 MP_WritePhyUshort(sc, 0x06, 0xa38b);
14373                 MP_WritePhyUshort(sc, 0x06, 0xb4d3);
14374                 MP_WritePhyUshort(sc, 0x06, 0x8012);
14375                 MP_WritePhyUshort(sc, 0x06, 0x17a2);
14376                 MP_WritePhyUshort(sc, 0x06, 0x04ad);
14377                 MP_WritePhyUshort(sc, 0x06, 0xffef);
14378                 MP_WritePhyUshort(sc, 0x06, 0x96fe);
14379                 MP_WritePhyUshort(sc, 0x06, 0xfdfc);
14380                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
14381                 MP_WritePhyUshort(sc, 0x06, 0xf9e0);
14382                 MP_WritePhyUshort(sc, 0x06, 0x8b85);
14383                 MP_WritePhyUshort(sc, 0x06, 0xad25);
14384                 MP_WritePhyUshort(sc, 0x06, 0x48e0);
14385                 MP_WritePhyUshort(sc, 0x06, 0x8a96);
14386                 MP_WritePhyUshort(sc, 0x06, 0xe18a);
14387                 MP_WritePhyUshort(sc, 0x06, 0x977c);
14388                 MP_WritePhyUshort(sc, 0x06, 0x0000);
14389                 MP_WritePhyUshort(sc, 0x06, 0x9e35);
14390                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
14391                 MP_WritePhyUshort(sc, 0x06, 0x9600);
14392                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
14393                 MP_WritePhyUshort(sc, 0x06, 0x9700);
14394                 MP_WritePhyUshort(sc, 0x06, 0xe08a);
14395                 MP_WritePhyUshort(sc, 0x06, 0xbee1);
14396                 MP_WritePhyUshort(sc, 0x06, 0x8abf);
14397                 MP_WritePhyUshort(sc, 0x06, 0xe286);
14398                 MP_WritePhyUshort(sc, 0x06, 0x10e3);
14399                 MP_WritePhyUshort(sc, 0x06, 0x8611);
14400                 MP_WritePhyUshort(sc, 0x06, 0x0236);
14401                 MP_WritePhyUshort(sc, 0x06, 0x1aad);
14402                 MP_WritePhyUshort(sc, 0x06, 0x2012);
14403                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
14404                 MP_WritePhyUshort(sc, 0x06, 0x9603);
14405                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
14406                 MP_WritePhyUshort(sc, 0x06, 0x97b7);
14407                 MP_WritePhyUshort(sc, 0x06, 0xee86);
14408                 MP_WritePhyUshort(sc, 0x06, 0x1000);
14409                 MP_WritePhyUshort(sc, 0x06, 0xee86);
14410                 MP_WritePhyUshort(sc, 0x06, 0x1100);
14411                 MP_WritePhyUshort(sc, 0x06, 0xae11);
14412                 MP_WritePhyUshort(sc, 0x06, 0x15e6);
14413                 MP_WritePhyUshort(sc, 0x06, 0x8610);
14414                 MP_WritePhyUshort(sc, 0x06, 0xe786);
14415                 MP_WritePhyUshort(sc, 0x06, 0x11ae);
14416                 MP_WritePhyUshort(sc, 0x06, 0x08ee);
14417                 MP_WritePhyUshort(sc, 0x06, 0x8610);
14418                 MP_WritePhyUshort(sc, 0x06, 0x00ee);
14419                 MP_WritePhyUshort(sc, 0x06, 0x8611);
14420                 MP_WritePhyUshort(sc, 0x06, 0x00fd);
14421                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
14422                 MP_WritePhyUshort(sc, 0x06, 0xf8fa);
14423                 MP_WritePhyUshort(sc, 0x06, 0xef69);
14424                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
14425                 MP_WritePhyUshort(sc, 0x06, 0x00e1);
14426                 MP_WritePhyUshort(sc, 0x06, 0xe001);
14427                 MP_WritePhyUshort(sc, 0x06, 0xad27);
14428                 MP_WritePhyUshort(sc, 0x06, 0x32e0);
14429                 MP_WritePhyUshort(sc, 0x06, 0x8b40);
14430                 MP_WritePhyUshort(sc, 0x06, 0xf720);
14431                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
14432                 MP_WritePhyUshort(sc, 0x06, 0x40bf);
14433                 MP_WritePhyUshort(sc, 0x06, 0x31f5);
14434                 MP_WritePhyUshort(sc, 0x06, 0x0236);
14435                 MP_WritePhyUshort(sc, 0x06, 0xf6ad);
14436                 MP_WritePhyUshort(sc, 0x06, 0x2821);
14437                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
14438                 MP_WritePhyUshort(sc, 0x06, 0x20e1);
14439                 MP_WritePhyUshort(sc, 0x06, 0xe021);
14440                 MP_WritePhyUshort(sc, 0x06, 0xad20);
14441                 MP_WritePhyUshort(sc, 0x06, 0x18e0);
14442                 MP_WritePhyUshort(sc, 0x06, 0x8b40);
14443                 MP_WritePhyUshort(sc, 0x06, 0xf620);
14444                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
14445                 MP_WritePhyUshort(sc, 0x06, 0x40ee);
14446                 MP_WritePhyUshort(sc, 0x06, 0x8b3b);
14447                 MP_WritePhyUshort(sc, 0x06, 0xffe0);
14448                 MP_WritePhyUshort(sc, 0x06, 0x8a8a);
14449                 MP_WritePhyUshort(sc, 0x06, 0xe18a);
14450                 MP_WritePhyUshort(sc, 0x06, 0x8be4);
14451                 MP_WritePhyUshort(sc, 0x06, 0xe000);
14452                 MP_WritePhyUshort(sc, 0x06, 0xe5e0);
14453                 MP_WritePhyUshort(sc, 0x06, 0x01ef);
14454                 MP_WritePhyUshort(sc, 0x06, 0x96fe);
14455                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
14456                 MP_WritePhyUshort(sc, 0x06, 0xf8fa);
14457                 MP_WritePhyUshort(sc, 0x06, 0xef69);
14458                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
14459                 MP_WritePhyUshort(sc, 0x06, 0x80ad);
14460                 MP_WritePhyUshort(sc, 0x06, 0x2722);
14461                 MP_WritePhyUshort(sc, 0x06, 0xbf44);
14462                 MP_WritePhyUshort(sc, 0x06, 0xfc02);
14463                 MP_WritePhyUshort(sc, 0x06, 0x36f6);
14464                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
14465                 MP_WritePhyUshort(sc, 0x06, 0x441f);
14466                 MP_WritePhyUshort(sc, 0x06, 0x019e);
14467                 MP_WritePhyUshort(sc, 0x06, 0x15e5);
14468                 MP_WritePhyUshort(sc, 0x06, 0x8b44);
14469                 MP_WritePhyUshort(sc, 0x06, 0xad29);
14470                 MP_WritePhyUshort(sc, 0x06, 0x07ac);
14471                 MP_WritePhyUshort(sc, 0x06, 0x2804);
14472                 MP_WritePhyUshort(sc, 0x06, 0xd101);
14473                 MP_WritePhyUshort(sc, 0x06, 0xae02);
14474                 MP_WritePhyUshort(sc, 0x06, 0xd100);
14475                 MP_WritePhyUshort(sc, 0x06, 0xbf85);
14476                 MP_WritePhyUshort(sc, 0x06, 0xb002);
14477                 MP_WritePhyUshort(sc, 0x06, 0x3723);
14478                 MP_WritePhyUshort(sc, 0x06, 0xef96);
14479                 MP_WritePhyUshort(sc, 0x06, 0xfefc);
14480                 MP_WritePhyUshort(sc, 0x06, 0x0400);
14481                 MP_WritePhyUshort(sc, 0x06, 0xe140);
14482                 MP_WritePhyUshort(sc, 0x06, 0x77e1);
14483                 MP_WritePhyUshort(sc, 0x06, 0x40dd);
14484                 MP_WritePhyUshort(sc, 0x06, 0xe022);
14485                 MP_WritePhyUshort(sc, 0x06, 0x32e1);
14486                 MP_WritePhyUshort(sc, 0x06, 0x5074);
14487                 MP_WritePhyUshort(sc, 0x06, 0xe144);
14488                 MP_WritePhyUshort(sc, 0x06, 0xffe0);
14489                 MP_WritePhyUshort(sc, 0x06, 0xdaff);
14490                 MP_WritePhyUshort(sc, 0x06, 0xe0c0);
14491                 MP_WritePhyUshort(sc, 0x06, 0x52e0);
14492                 MP_WritePhyUshort(sc, 0x06, 0xeed9);
14493                 MP_WritePhyUshort(sc, 0x06, 0xe04c);
14494                 MP_WritePhyUshort(sc, 0x06, 0xbbe0);
14495                 MP_WritePhyUshort(sc, 0x06, 0x2a00);
14496                 MP_WritePhyUshort(sc, 0x05, 0xe142);
14497                 Data = MP_ReadPhyUshort(sc, 0x06);
14498                 Data |= BIT_0;
14499                 MP_WritePhyUshort(sc, 0x06, Data);
14500                 MP_WritePhyUshort(sc, 0x05, 0xe140);
14501                 Data = MP_ReadPhyUshort(sc, 0x06);
14502                 Data |= BIT_0;
14503                 MP_WritePhyUshort(sc, 0x06, Data);
14504                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
14505                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
14506                 for (i = 0; i < 200; i++) {
14507                         DELAY(100);
14508                         Data = MP_ReadPhyUshort(sc, 0x00);
14509                         if (Data & BIT_7)
14510                                 break;
14511                 }
14512                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
14513                 MP_WritePhyUshort(sc, 0x1e, 0x0042);
14514                 MP_WritePhyUshort(sc, 0x18, 0x2300);
14515                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
14516                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
14517                 MP_WritePhyUshort(sc, 0x1e, 0x0023);
14518                 Data = MP_ReadPhyUshort(sc, 0x17);
14519                 MP_WritePhyUshort(sc, 0x17, Data);
14520
14521                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
14522                 MP_WritePhyUshort(sc, 0x09, 0xA20F);
14523                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
14524                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
14525                 MP_WritePhyUshort(sc, 0x00, 0x9200);
14526
14527                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
14528                 MP_WritePhyUshort(sc, 0x05, 0x8B80);
14529                 Data = MP_ReadPhyUshort(sc, 0x06);
14530                 Data |= BIT_2 | BIT_1;
14531                 MP_WritePhyUshort(sc, 0x06, Data);
14532                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
14533
14534                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
14535                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
14536                 Data = MP_ReadPhyUshort(sc, 0x06);
14537                 Data |= BIT_15;
14538                 MP_WritePhyUshort(sc, 0x06, Data);
14539                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
14540
14541                 MP_WritePhyUshort(sc, 0x1f, 0x0004);
14542                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
14543                 MP_WritePhyUshort(sc, 0x1e, 0x002D);
14544                 Data = MP_ReadPhyUshort(sc, 0x18);
14545                 Data |= BIT_4;
14546                 MP_WritePhyUshort(sc, 0x18, Data);
14547                 MP_WritePhyUshort(sc, 0x1f, 0x0002);
14548                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
14549                 Data = MP_ReadPhyUshort(sc, 0x14);
14550                 Data |= BIT_15;
14551                 MP_WritePhyUshort(sc, 0x14, Data);
14552
14553                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
14554                 MP_WritePhyUshort(sc, 0x05, 0x8B86);
14555                 Data = MP_ReadPhyUshort(sc, 0x06);
14556                 Data |= BIT_0;
14557                 MP_WritePhyUshort(sc, 0x06, Data);
14558                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
14559
14560                 MP_WritePhyUshort(sc, 0x1F, 0x0004);
14561                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
14562                 MP_WritePhyUshort(sc, 0x1E, 0x00AC);
14563                 MP_WritePhyUshort(sc, 0x18, 0x0006);
14564                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
14565                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
14566
14567                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
14568                 MP_WritePhyUshort(sc, 0x09, 0xA20F);
14569                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
14570
14571                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
14572                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
14573                 Data = MP_ReadPhyUshort(sc, 0x06);
14574                 Data |= BIT_14;
14575                 MP_WritePhyUshort(sc, 0x06, Data);
14576                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
14577
14578                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
14579                 MP_WritePhyUshort(sc, 0x05, 0x8B54);
14580                 Data = MP_ReadPhyUshort(sc, 0x06);
14581                 Data &= ~BIT_11;
14582                 MP_WritePhyUshort(sc, 0x06, Data);
14583                 MP_WritePhyUshort(sc, 0x05, 0x8B5D);
14584                 Data = MP_ReadPhyUshort(sc, 0x06);
14585                 Data &= ~BIT_11;
14586                 MP_WritePhyUshort(sc, 0x06, Data);
14587                 MP_WritePhyUshort(sc, 0x05, 0x8A7C);
14588                 Data = MP_ReadPhyUshort(sc, 0x06);
14589                 Data &= ~BIT_8;
14590                 MP_WritePhyUshort(sc, 0x06, Data);
14591                 MP_WritePhyUshort(sc, 0x05, 0x8A7F);
14592                 Data = MP_ReadPhyUshort(sc, 0x06);
14593                 Data |= BIT_8;
14594                 MP_WritePhyUshort(sc, 0x06, Data);
14595                 MP_WritePhyUshort(sc, 0x05, 0x8A82);
14596                 Data = MP_ReadPhyUshort(sc, 0x06);
14597                 Data &= ~BIT_8;
14598                 MP_WritePhyUshort(sc, 0x06, Data);
14599                 MP_WritePhyUshort(sc, 0x05, 0x8A85);
14600                 Data = MP_ReadPhyUshort(sc, 0x06);
14601                 Data &= ~BIT_8;
14602                 MP_WritePhyUshort(sc, 0x06, Data);
14603                 MP_WritePhyUshort(sc, 0x05, 0x8A88);
14604                 Data = MP_ReadPhyUshort(sc, 0x06);
14605                 Data &= ~BIT_8;
14606                 MP_WritePhyUshort(sc, 0x06, Data);
14607                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
14608
14609                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
14610                 Data = MP_ReadPhyUshort(sc, 0x19);
14611                 Data &= ~BIT_0;
14612                 MP_WritePhyUshort(sc, 0x19, Data);
14613                 Data = MP_ReadPhyUshort(sc, 0x10);
14614                 Data &= ~BIT_10;
14615                 MP_WritePhyUshort(sc, 0x10, Data);
14616                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
14617         } else if (sc->re_type == MACFG_41) {
14618                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
14619                 MP_WritePhyUshort(sc, 0x11, MP_ReadPhyUshort(sc, 0x11) | 0x1000);
14620                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
14621                 MP_WritePhyUshort(sc, 0x0F, MP_ReadPhyUshort(sc, 0x0F) | 0x0003);
14622                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
14623
14624                 for (Data_u32=0x800E0068; Data_u32<0x800E006D; Data_u32++) {
14625                         CSR_WRITE_4(sc, 0xF8, Data_u32);
14626                         for (i=0; i<10; i++) {
14627                                 DELAY(400);
14628                                 if ((CSR_READ_4(sc, 0xF8)&0x80000000)==0)
14629                                         break;
14630                         }
14631                 }
14632         } else if (sc->re_type == MACFG_42 || sc->re_type == MACFG_43) {
14633                 Data_u32 = re_eri_read(sc, 0x1D0, 4, ERIAR_ExGMAC);
14634                 Data_u32 &= 0xFFFF0000;
14635                 re_eri_write(sc, 0x1D0, 4, Data_u32, ERIAR_ExGMAC);
14636
14637                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
14638                 MP_WritePhyUshort(sc, 0x18, 0x0310);
14639                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
14640
14641                 MP_WritePhyUshort(sc, 0x1f, 0x0004);
14642                 MP_WritePhyUshort(sc, 0x1f, 0x0004);
14643                 MP_WritePhyUshort(sc, 0x19, 0x7070);
14644                 MP_WritePhyUshort(sc, 0x1c, 0x0600);
14645                 MP_WritePhyUshort(sc, 0x1d, 0x9700);
14646                 MP_WritePhyUshort(sc, 0x1d, 0x7d00);
14647                 MP_WritePhyUshort(sc, 0x1d, 0x6900);
14648                 MP_WritePhyUshort(sc, 0x1d, 0x7d00);
14649                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
14650                 MP_WritePhyUshort(sc, 0x1d, 0x4899);
14651                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14652                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
14653                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14654                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
14655                 MP_WritePhyUshort(sc, 0x1d, 0x8000);
14656                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
14657                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
14658                 MP_WritePhyUshort(sc, 0x1d, 0x4007);
14659                 MP_WritePhyUshort(sc, 0x1d, 0x4400);
14660                 MP_WritePhyUshort(sc, 0x1d, 0x4800);
14661                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14662                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
14663                 MP_WritePhyUshort(sc, 0x1d, 0x5310);
14664                 MP_WritePhyUshort(sc, 0x1d, 0x6000);
14665                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
14666                 MP_WritePhyUshort(sc, 0x1d, 0x6736);
14667                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14668                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14669                 MP_WritePhyUshort(sc, 0x1d, 0x571f);
14670                 MP_WritePhyUshort(sc, 0x1d, 0x5ffb);
14671                 MP_WritePhyUshort(sc, 0x1d, 0xaa03);
14672                 MP_WritePhyUshort(sc, 0x1d, 0x5b58);
14673                 MP_WritePhyUshort(sc, 0x1d, 0x301e);
14674                 MP_WritePhyUshort(sc, 0x1d, 0x5b64);
14675                 MP_WritePhyUshort(sc, 0x1d, 0xa6fc);
14676                 MP_WritePhyUshort(sc, 0x1d, 0xdcdb);
14677                 MP_WritePhyUshort(sc, 0x1d, 0x0014);
14678                 MP_WritePhyUshort(sc, 0x1d, 0xd9a9);
14679                 MP_WritePhyUshort(sc, 0x1d, 0x0013);
14680                 MP_WritePhyUshort(sc, 0x1d, 0xd16b);
14681                 MP_WritePhyUshort(sc, 0x1d, 0x0011);
14682                 MP_WritePhyUshort(sc, 0x1d, 0xb40e);
14683                 MP_WritePhyUshort(sc, 0x1d, 0xd06b);
14684                 MP_WritePhyUshort(sc, 0x1d, 0x000c);
14685                 MP_WritePhyUshort(sc, 0x1d, 0xb206);
14686                 MP_WritePhyUshort(sc, 0x1d, 0x7c01);
14687                 MP_WritePhyUshort(sc, 0x1d, 0x5800);
14688                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
14689                 MP_WritePhyUshort(sc, 0x1d, 0x5c00);
14690                 MP_WritePhyUshort(sc, 0x1d, 0x301a);
14691                 MP_WritePhyUshort(sc, 0x1d, 0x7c01);
14692                 MP_WritePhyUshort(sc, 0x1d, 0x5801);
14693                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
14694                 MP_WritePhyUshort(sc, 0x1d, 0x5c04);
14695                 MP_WritePhyUshort(sc, 0x1d, 0x301e);
14696                 MP_WritePhyUshort(sc, 0x1d, 0x314d);
14697                 MP_WritePhyUshort(sc, 0x1d, 0x31f0);
14698                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
14699                 MP_WritePhyUshort(sc, 0x1d, 0x4c20);
14700                 MP_WritePhyUshort(sc, 0x1d, 0x6004);
14701                 MP_WritePhyUshort(sc, 0x1d, 0x5310);
14702                 MP_WritePhyUshort(sc, 0x1d, 0x4833);
14703                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14704                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
14705                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14706                 MP_WritePhyUshort(sc, 0x1d, 0x4c08);
14707                 MP_WritePhyUshort(sc, 0x1d, 0x8300);
14708                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
14709                 MP_WritePhyUshort(sc, 0x1d, 0x6600);
14710                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14711                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14712                 MP_WritePhyUshort(sc, 0x1d, 0xb90c);
14713                 MP_WritePhyUshort(sc, 0x1d, 0x30d3);
14714                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
14715                 MP_WritePhyUshort(sc, 0x1d, 0x4de0);
14716                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
14717                 MP_WritePhyUshort(sc, 0x1d, 0x6000);
14718                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
14719                 MP_WritePhyUshort(sc, 0x1d, 0x6736);
14720                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14721                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14722                 MP_WritePhyUshort(sc, 0x1d, 0x5310);
14723                 MP_WritePhyUshort(sc, 0x1d, 0x300b);
14724                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
14725                 MP_WritePhyUshort(sc, 0x1d, 0x4c60);
14726                 MP_WritePhyUshort(sc, 0x1d, 0x6803);
14727                 MP_WritePhyUshort(sc, 0x1d, 0x6520);
14728                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14729                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14730                 MP_WritePhyUshort(sc, 0x1d, 0xaf03);
14731                 MP_WritePhyUshort(sc, 0x1d, 0x6015);
14732                 MP_WritePhyUshort(sc, 0x1d, 0x3059);
14733                 MP_WritePhyUshort(sc, 0x1d, 0x6017);
14734                 MP_WritePhyUshort(sc, 0x1d, 0x57e0);
14735                 MP_WritePhyUshort(sc, 0x1d, 0x580c);
14736                 MP_WritePhyUshort(sc, 0x1d, 0x588c);
14737                 MP_WritePhyUshort(sc, 0x1d, 0x7ffc);
14738                 MP_WritePhyUshort(sc, 0x1d, 0x5fa3);
14739                 MP_WritePhyUshort(sc, 0x1d, 0x4827);
14740                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14741                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
14742                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14743                 MP_WritePhyUshort(sc, 0x1d, 0x4c10);
14744                 MP_WritePhyUshort(sc, 0x1d, 0x8400);
14745                 MP_WritePhyUshort(sc, 0x1d, 0x7c30);
14746                 MP_WritePhyUshort(sc, 0x1d, 0x6020);
14747                 MP_WritePhyUshort(sc, 0x1d, 0x48bf);
14748                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14749                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
14750                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14751                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
14752                 MP_WritePhyUshort(sc, 0x1d, 0xad09);
14753                 MP_WritePhyUshort(sc, 0x1d, 0x7c03);
14754                 MP_WritePhyUshort(sc, 0x1d, 0x5c03);
14755                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14756                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14757                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14758                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14759                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14760                 MP_WritePhyUshort(sc, 0x1d, 0x4400);
14761                 MP_WritePhyUshort(sc, 0x1d, 0xad2c);
14762                 MP_WritePhyUshort(sc, 0x1d, 0xd6cf);
14763                 MP_WritePhyUshort(sc, 0x1d, 0x0002);
14764                 MP_WritePhyUshort(sc, 0x1d, 0x80f4);
14765                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
14766                 MP_WritePhyUshort(sc, 0x1d, 0x4c80);
14767                 MP_WritePhyUshort(sc, 0x1d, 0x7c20);
14768                 MP_WritePhyUshort(sc, 0x1d, 0x5c20);
14769                 MP_WritePhyUshort(sc, 0x1d, 0x481e);
14770                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14771                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
14772                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14773                 MP_WritePhyUshort(sc, 0x1d, 0x4c02);
14774                 MP_WritePhyUshort(sc, 0x1d, 0xad0a);
14775                 MP_WritePhyUshort(sc, 0x1d, 0x7c03);
14776                 MP_WritePhyUshort(sc, 0x1d, 0x5c03);
14777                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14778                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14779                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14780                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14781                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14782                 MP_WritePhyUshort(sc, 0x1d, 0x4400);
14783                 MP_WritePhyUshort(sc, 0x1d, 0x5310);
14784                 MP_WritePhyUshort(sc, 0x1d, 0x8d02);
14785                 MP_WritePhyUshort(sc, 0x1d, 0x4401);
14786                 MP_WritePhyUshort(sc, 0x1d, 0x81f4);
14787                 MP_WritePhyUshort(sc, 0x1d, 0x3114);
14788                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
14789                 MP_WritePhyUshort(sc, 0x1d, 0x4d00);
14790                 MP_WritePhyUshort(sc, 0x1d, 0x4832);
14791                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14792                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
14793                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14794                 MP_WritePhyUshort(sc, 0x1d, 0x4c10);
14795                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
14796                 MP_WritePhyUshort(sc, 0x1d, 0x6000);
14797                 MP_WritePhyUshort(sc, 0x1d, 0xa4b7);
14798                 MP_WritePhyUshort(sc, 0x1d, 0xd9b3);
14799                 MP_WritePhyUshort(sc, 0x1d, 0xfffe);
14800                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
14801                 MP_WritePhyUshort(sc, 0x1d, 0x4d20);
14802                 MP_WritePhyUshort(sc, 0x1d, 0x7e00);
14803                 MP_WritePhyUshort(sc, 0x1d, 0x6200);
14804                 MP_WritePhyUshort(sc, 0x1d, 0x3045);
14805                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
14806                 MP_WritePhyUshort(sc, 0x1d, 0x4d40);
14807                 MP_WritePhyUshort(sc, 0x1d, 0x7c40);
14808                 MP_WritePhyUshort(sc, 0x1d, 0x6000);
14809                 MP_WritePhyUshort(sc, 0x1d, 0x4401);
14810                 MP_WritePhyUshort(sc, 0x1d, 0x5210);
14811                 MP_WritePhyUshort(sc, 0x1d, 0x4833);
14812                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
14813                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
14814                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
14815                 MP_WritePhyUshort(sc, 0x1d, 0x4c08);
14816                 MP_WritePhyUshort(sc, 0x1d, 0x8300);
14817                 MP_WritePhyUshort(sc, 0x1d, 0x5f80);
14818                 MP_WritePhyUshort(sc, 0x1d, 0x55e0);
14819                 MP_WritePhyUshort(sc, 0x1d, 0xc06f);
14820                 MP_WritePhyUshort(sc, 0x1d, 0x0005);
14821                 MP_WritePhyUshort(sc, 0x1d, 0xd9b3);
14822                 MP_WritePhyUshort(sc, 0x1d, 0xfffd);
14823                 MP_WritePhyUshort(sc, 0x1d, 0x7c40);
14824                 MP_WritePhyUshort(sc, 0x1d, 0x6040);
14825                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
14826                 MP_WritePhyUshort(sc, 0x1d, 0x4d60);
14827                 MP_WritePhyUshort(sc, 0x1d, 0x57e0);
14828                 MP_WritePhyUshort(sc, 0x1d, 0x4814);
14829                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
14830                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
14831                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
14832                 MP_WritePhyUshort(sc, 0x1d, 0x4c04);
14833                 MP_WritePhyUshort(sc, 0x1d, 0x8200);
14834                 MP_WritePhyUshort(sc, 0x1d, 0x7c03);
14835                 MP_WritePhyUshort(sc, 0x1d, 0x5c03);
14836                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14837                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14838                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14839                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14840                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14841                 MP_WritePhyUshort(sc, 0x1d, 0xad02);
14842                 MP_WritePhyUshort(sc, 0x1d, 0x4400);
14843                 MP_WritePhyUshort(sc, 0x1d, 0xc0e9);
14844                 MP_WritePhyUshort(sc, 0x1d, 0x0003);
14845                 MP_WritePhyUshort(sc, 0x1d, 0xadd8);
14846                 MP_WritePhyUshort(sc, 0x1d, 0x30c6);
14847                 MP_WritePhyUshort(sc, 0x1d, 0x3078);
14848                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
14849                 MP_WritePhyUshort(sc, 0x1d, 0x4dc0);
14850                 MP_WritePhyUshort(sc, 0x1d, 0x6730);
14851                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14852                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14853                 MP_WritePhyUshort(sc, 0x1d, 0xd09d);
14854                 MP_WritePhyUshort(sc, 0x1d, 0x0002);
14855                 MP_WritePhyUshort(sc, 0x1d, 0xb4fe);
14856                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
14857                 MP_WritePhyUshort(sc, 0x1d, 0x4d80);
14858                 MP_WritePhyUshort(sc, 0x1d, 0x6802);
14859                 MP_WritePhyUshort(sc, 0x1d, 0x6600);
14860                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14861                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14862                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
14863                 MP_WritePhyUshort(sc, 0x1d, 0x6000);
14864                 MP_WritePhyUshort(sc, 0x1d, 0x486c);
14865                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14866                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
14867                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14868                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
14869                 MP_WritePhyUshort(sc, 0x1d, 0x9503);
14870                 MP_WritePhyUshort(sc, 0x1d, 0x7e00);
14871                 MP_WritePhyUshort(sc, 0x1d, 0x6200);
14872                 MP_WritePhyUshort(sc, 0x1d, 0x571f);
14873                 MP_WritePhyUshort(sc, 0x1d, 0x5fbb);
14874                 MP_WritePhyUshort(sc, 0x1d, 0xaa03);
14875                 MP_WritePhyUshort(sc, 0x1d, 0x5b58);
14876                 MP_WritePhyUshort(sc, 0x1d, 0x30e9);
14877                 MP_WritePhyUshort(sc, 0x1d, 0x5b64);
14878                 MP_WritePhyUshort(sc, 0x1d, 0xcdab);
14879                 MP_WritePhyUshort(sc, 0x1d, 0xff5b);
14880                 MP_WritePhyUshort(sc, 0x1d, 0xcd8d);
14881                 MP_WritePhyUshort(sc, 0x1d, 0xff59);
14882                 MP_WritePhyUshort(sc, 0x1d, 0xd96b);
14883                 MP_WritePhyUshort(sc, 0x1d, 0xff57);
14884                 MP_WritePhyUshort(sc, 0x1d, 0xd0a0);
14885                 MP_WritePhyUshort(sc, 0x1d, 0xffdb);
14886                 MP_WritePhyUshort(sc, 0x1d, 0xcba0);
14887                 MP_WritePhyUshort(sc, 0x1d, 0x0003);
14888                 MP_WritePhyUshort(sc, 0x1d, 0x80f0);
14889                 MP_WritePhyUshort(sc, 0x1d, 0x30f6);
14890                 MP_WritePhyUshort(sc, 0x1d, 0x3109);
14891                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
14892                 MP_WritePhyUshort(sc, 0x1d, 0x4ce0);
14893                 MP_WritePhyUshort(sc, 0x1d, 0x7d30);
14894                 MP_WritePhyUshort(sc, 0x1d, 0x6530);
14895                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14896                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14897                 MP_WritePhyUshort(sc, 0x1d, 0x7ce0);
14898                 MP_WritePhyUshort(sc, 0x1d, 0x5400);
14899                 MP_WritePhyUshort(sc, 0x1d, 0x4832);
14900                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14901                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
14902                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14903                 MP_WritePhyUshort(sc, 0x1d, 0x4c08);
14904                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
14905                 MP_WritePhyUshort(sc, 0x1d, 0x6008);
14906                 MP_WritePhyUshort(sc, 0x1d, 0x8300);
14907                 MP_WritePhyUshort(sc, 0x1d, 0xb902);
14908                 MP_WritePhyUshort(sc, 0x1d, 0x30d3);
14909                 MP_WritePhyUshort(sc, 0x1d, 0x308f);
14910                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
14911                 MP_WritePhyUshort(sc, 0x1d, 0x4da0);
14912                 MP_WritePhyUshort(sc, 0x1d, 0x57a0);
14913                 MP_WritePhyUshort(sc, 0x1d, 0x590c);
14914                 MP_WritePhyUshort(sc, 0x1d, 0x5fa2);
14915                 MP_WritePhyUshort(sc, 0x1d, 0xcba4);
14916                 MP_WritePhyUshort(sc, 0x1d, 0x0005);
14917                 MP_WritePhyUshort(sc, 0x1d, 0xcd8d);
14918                 MP_WritePhyUshort(sc, 0x1d, 0x0003);
14919                 MP_WritePhyUshort(sc, 0x1d, 0x80fc);
14920                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14921                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
14922                 MP_WritePhyUshort(sc, 0x1d, 0x4ca0);
14923                 MP_WritePhyUshort(sc, 0x1d, 0xb603);
14924                 MP_WritePhyUshort(sc, 0x1d, 0x7c10);
14925                 MP_WritePhyUshort(sc, 0x1d, 0x6010);
14926                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14927                 MP_WritePhyUshort(sc, 0x1d, 0x541f);
14928                 MP_WritePhyUshort(sc, 0x1d, 0x7ffc);
14929                 MP_WritePhyUshort(sc, 0x1d, 0x5fb3);
14930                 MP_WritePhyUshort(sc, 0x1d, 0x9403);
14931                 MP_WritePhyUshort(sc, 0x1d, 0x7c03);
14932                 MP_WritePhyUshort(sc, 0x1d, 0x5c03);
14933                 MP_WritePhyUshort(sc, 0x1d, 0xaa05);
14934                 MP_WritePhyUshort(sc, 0x1d, 0x7c80);
14935                 MP_WritePhyUshort(sc, 0x1d, 0x5800);
14936                 MP_WritePhyUshort(sc, 0x1d, 0x5b58);
14937                 MP_WritePhyUshort(sc, 0x1d, 0x3128);
14938                 MP_WritePhyUshort(sc, 0x1d, 0x7c80);
14939                 MP_WritePhyUshort(sc, 0x1d, 0x5800);
14940                 MP_WritePhyUshort(sc, 0x1d, 0x5b64);
14941                 MP_WritePhyUshort(sc, 0x1d, 0x4827);
14942                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14943                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
14944                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14945                 MP_WritePhyUshort(sc, 0x1d, 0x4c10);
14946                 MP_WritePhyUshort(sc, 0x1d, 0x8400);
14947                 MP_WritePhyUshort(sc, 0x1d, 0x7c10);
14948                 MP_WritePhyUshort(sc, 0x1d, 0x6000);
14949                 MP_WritePhyUshort(sc, 0x1d, 0x4824);
14950                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14951                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
14952                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14953                 MP_WritePhyUshort(sc, 0x1d, 0x4c04);
14954                 MP_WritePhyUshort(sc, 0x1d, 0x8200);
14955                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
14956                 MP_WritePhyUshort(sc, 0x1d, 0x4cc0);
14957                 MP_WritePhyUshort(sc, 0x1d, 0x7d00);
14958                 MP_WritePhyUshort(sc, 0x1d, 0x6400);
14959                 MP_WritePhyUshort(sc, 0x1d, 0x7ffc);
14960                 MP_WritePhyUshort(sc, 0x1d, 0x5fbb);
14961                 MP_WritePhyUshort(sc, 0x1d, 0x4824);
14962                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14963                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
14964                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14965                 MP_WritePhyUshort(sc, 0x1d, 0x4c04);
14966                 MP_WritePhyUshort(sc, 0x1d, 0x8200);
14967                 MP_WritePhyUshort(sc, 0x1d, 0x7e00);
14968                 MP_WritePhyUshort(sc, 0x1d, 0x6a00);
14969                 MP_WritePhyUshort(sc, 0x1d, 0x4824);
14970                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14971                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
14972                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
14973                 MP_WritePhyUshort(sc, 0x1d, 0x4c04);
14974                 MP_WritePhyUshort(sc, 0x1d, 0x8200);
14975                 MP_WritePhyUshort(sc, 0x1d, 0x7e00);
14976                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
14977                 MP_WritePhyUshort(sc, 0x1d, 0x30f6);
14978                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
14979                 MP_WritePhyUshort(sc, 0x1d, 0x4e00);
14980                 MP_WritePhyUshort(sc, 0x1d, 0x4007);
14981                 MP_WritePhyUshort(sc, 0x1d, 0x4400);
14982                 MP_WritePhyUshort(sc, 0x1d, 0x5310);
14983                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
14984                 MP_WritePhyUshort(sc, 0x1d, 0x6736);
14985                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14986                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
14987                 MP_WritePhyUshort(sc, 0x1d, 0x570f);
14988                 MP_WritePhyUshort(sc, 0x1d, 0x5fff);
14989                 MP_WritePhyUshort(sc, 0x1d, 0xaa03);
14990                 MP_WritePhyUshort(sc, 0x1d, 0x585b);
14991                 MP_WritePhyUshort(sc, 0x1d, 0x315c);
14992                 MP_WritePhyUshort(sc, 0x1d, 0x5867);
14993                 MP_WritePhyUshort(sc, 0x1d, 0x9402);
14994                 MP_WritePhyUshort(sc, 0x1d, 0x6200);
14995                 MP_WritePhyUshort(sc, 0x1d, 0xcda3);
14996                 MP_WritePhyUshort(sc, 0x1d, 0x009d);
14997                 MP_WritePhyUshort(sc, 0x1d, 0xcd85);
14998                 MP_WritePhyUshort(sc, 0x1d, 0x009b);
14999                 MP_WritePhyUshort(sc, 0x1d, 0xd96b);
15000                 MP_WritePhyUshort(sc, 0x1d, 0x0099);
15001                 MP_WritePhyUshort(sc, 0x1d, 0x96e9);
15002                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
15003                 MP_WritePhyUshort(sc, 0x1d, 0x6736);
15004                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
15005                 MP_WritePhyUshort(sc, 0x1d, 0x4e20);
15006                 MP_WritePhyUshort(sc, 0x1d, 0x96e4);
15007                 MP_WritePhyUshort(sc, 0x1d, 0x8b04);
15008                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
15009                 MP_WritePhyUshort(sc, 0x1d, 0x5008);
15010                 MP_WritePhyUshort(sc, 0x1d, 0xab03);
15011                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
15012                 MP_WritePhyUshort(sc, 0x1d, 0x5000);
15013                 MP_WritePhyUshort(sc, 0x1d, 0x6801);
15014                 MP_WritePhyUshort(sc, 0x1d, 0x6776);
15015                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
15016                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
15017                 MP_WritePhyUshort(sc, 0x1d, 0xdb7c);
15018                 MP_WritePhyUshort(sc, 0x1d, 0xfff0);
15019                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
15020                 MP_WritePhyUshort(sc, 0x1d, 0x7fe1);
15021                 MP_WritePhyUshort(sc, 0x1d, 0x4e40);
15022                 MP_WritePhyUshort(sc, 0x1d, 0x4837);
15023                 MP_WritePhyUshort(sc, 0x1d, 0x4418);
15024                 MP_WritePhyUshort(sc, 0x1d, 0x41c7);
15025                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
15026                 MP_WritePhyUshort(sc, 0x1d, 0x4e40);
15027                 MP_WritePhyUshort(sc, 0x1d, 0x7c40);
15028                 MP_WritePhyUshort(sc, 0x1d, 0x5400);
15029                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
15030                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
15031                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
15032                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
15033                 MP_WritePhyUshort(sc, 0x1d, 0x8fc9);
15034                 MP_WritePhyUshort(sc, 0x1d, 0xd2a0);
15035                 MP_WritePhyUshort(sc, 0x1d, 0x004a);
15036                 MP_WritePhyUshort(sc, 0x1d, 0x9203);
15037                 MP_WritePhyUshort(sc, 0x1d, 0xa041);
15038                 MP_WritePhyUshort(sc, 0x1d, 0x3184);
15039                 MP_WritePhyUshort(sc, 0x1d, 0x7fe1);
15040                 MP_WritePhyUshort(sc, 0x1d, 0x4e60);
15041                 MP_WritePhyUshort(sc, 0x1d, 0x489c);
15042                 MP_WritePhyUshort(sc, 0x1d, 0x4628);
15043                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
15044                 MP_WritePhyUshort(sc, 0x1d, 0x4e60);
15045                 MP_WritePhyUshort(sc, 0x1d, 0x7e28);
15046                 MP_WritePhyUshort(sc, 0x1d, 0x4628);
15047                 MP_WritePhyUshort(sc, 0x1d, 0x7c40);
15048                 MP_WritePhyUshort(sc, 0x1d, 0x5400);
15049                 MP_WritePhyUshort(sc, 0x1d, 0x7c01);
15050                 MP_WritePhyUshort(sc, 0x1d, 0x5800);
15051                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
15052                 MP_WritePhyUshort(sc, 0x1d, 0x5c00);
15053                 MP_WritePhyUshort(sc, 0x1d, 0x41e8);
15054                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
15055                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
15056                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
15057                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
15058                 MP_WritePhyUshort(sc, 0x1d, 0x8fb0);
15059                 MP_WritePhyUshort(sc, 0x1d, 0xb241);
15060                 MP_WritePhyUshort(sc, 0x1d, 0xa02a);
15061                 MP_WritePhyUshort(sc, 0x1d, 0x319d);
15062                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
15063                 MP_WritePhyUshort(sc, 0x1d, 0x4ea0);
15064                 MP_WritePhyUshort(sc, 0x1d, 0x7c02);
15065                 MP_WritePhyUshort(sc, 0x1d, 0x4402);
15066                 MP_WritePhyUshort(sc, 0x1d, 0x4448);
15067                 MP_WritePhyUshort(sc, 0x1d, 0x4894);
15068                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
15069                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
15070                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
15071                 MP_WritePhyUshort(sc, 0x1d, 0x4c03);
15072                 MP_WritePhyUshort(sc, 0x1d, 0x4824);
15073                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
15074                 MP_WritePhyUshort(sc, 0x1d, 0x4c07);
15075                 MP_WritePhyUshort(sc, 0x1d, 0x41ef);
15076                 MP_WritePhyUshort(sc, 0x1d, 0x41ff);
15077                 MP_WritePhyUshort(sc, 0x1d, 0x4891);
15078                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
15079                 MP_WritePhyUshort(sc, 0x1d, 0x4c07);
15080                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
15081                 MP_WritePhyUshort(sc, 0x1d, 0x4c17);
15082                 MP_WritePhyUshort(sc, 0x1d, 0x8400);
15083                 MP_WritePhyUshort(sc, 0x1d, 0x8ef8);
15084                 MP_WritePhyUshort(sc, 0x1d, 0x41c7);
15085                 MP_WritePhyUshort(sc, 0x1d, 0x8f95);
15086                 MP_WritePhyUshort(sc, 0x1d, 0x92d5);
15087                 MP_WritePhyUshort(sc, 0x1d, 0xa10f);
15088                 MP_WritePhyUshort(sc, 0x1d, 0xd480);
15089                 MP_WritePhyUshort(sc, 0x1d, 0x0008);
15090                 MP_WritePhyUshort(sc, 0x1d, 0xd580);
15091                 MP_WritePhyUshort(sc, 0x1d, 0xffb9);
15092                 MP_WritePhyUshort(sc, 0x1d, 0xa202);
15093                 MP_WritePhyUshort(sc, 0x1d, 0x31b8);
15094                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
15095                 MP_WritePhyUshort(sc, 0x1d, 0x4404);
15096                 MP_WritePhyUshort(sc, 0x1d, 0x31b8);
15097                 MP_WritePhyUshort(sc, 0x1d, 0xd484);
15098                 MP_WritePhyUshort(sc, 0x1d, 0xfff3);
15099                 MP_WritePhyUshort(sc, 0x1d, 0xd484);
15100                 MP_WritePhyUshort(sc, 0x1d, 0xfff1);
15101                 MP_WritePhyUshort(sc, 0x1d, 0x314d);
15102                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
15103                 MP_WritePhyUshort(sc, 0x1d, 0x4ee0);
15104                 MP_WritePhyUshort(sc, 0x1d, 0x7c40);
15105                 MP_WritePhyUshort(sc, 0x1d, 0x5400);
15106                 MP_WritePhyUshort(sc, 0x1d, 0x4488);
15107                 MP_WritePhyUshort(sc, 0x1d, 0x41cf);
15108                 MP_WritePhyUshort(sc, 0x1d, 0x314d);
15109                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
15110                 MP_WritePhyUshort(sc, 0x1d, 0x4ec0);
15111                 MP_WritePhyUshort(sc, 0x1d, 0x48f3);
15112                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
15113                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
15114                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
15115                 MP_WritePhyUshort(sc, 0x1d, 0x4c09);
15116                 MP_WritePhyUshort(sc, 0x1d, 0x4508);
15117                 MP_WritePhyUshort(sc, 0x1d, 0x41c7);
15118                 MP_WritePhyUshort(sc, 0x1d, 0x8f24);
15119                 MP_WritePhyUshort(sc, 0x1d, 0xd218);
15120                 MP_WritePhyUshort(sc, 0x1d, 0x0022);
15121                 MP_WritePhyUshort(sc, 0x1d, 0xd2a4);
15122                 MP_WritePhyUshort(sc, 0x1d, 0xff9f);
15123                 MP_WritePhyUshort(sc, 0x1d, 0x31d9);
15124                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
15125                 MP_WritePhyUshort(sc, 0x1d, 0x4e80);
15126                 MP_WritePhyUshort(sc, 0x1d, 0x4832);
15127                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
15128                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
15129                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
15130                 MP_WritePhyUshort(sc, 0x1d, 0x4c11);
15131                 MP_WritePhyUshort(sc, 0x1d, 0x4428);
15132                 MP_WritePhyUshort(sc, 0x1d, 0x7c40);
15133                 MP_WritePhyUshort(sc, 0x1d, 0x5440);
15134                 MP_WritePhyUshort(sc, 0x1d, 0x7c01);
15135                 MP_WritePhyUshort(sc, 0x1d, 0x5801);
15136                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
15137                 MP_WritePhyUshort(sc, 0x1d, 0x5c04);
15138                 MP_WritePhyUshort(sc, 0x1d, 0x41e8);
15139                 MP_WritePhyUshort(sc, 0x1d, 0xa4b3);
15140                 MP_WritePhyUshort(sc, 0x1d, 0x31ee);
15141                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
15142                 MP_WritePhyUshort(sc, 0x1d, 0x6736);
15143                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
15144                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
15145                 MP_WritePhyUshort(sc, 0x1d, 0x570f);
15146                 MP_WritePhyUshort(sc, 0x1d, 0x5fff);
15147                 MP_WritePhyUshort(sc, 0x1d, 0xaa03);
15148                 MP_WritePhyUshort(sc, 0x1d, 0x585b);
15149                 MP_WritePhyUshort(sc, 0x1d, 0x31fa);
15150                 MP_WritePhyUshort(sc, 0x1d, 0x5867);
15151                 MP_WritePhyUshort(sc, 0x1d, 0xbcf6);
15152                 MP_WritePhyUshort(sc, 0x1d, 0x300b);
15153                 MP_WritePhyUshort(sc, 0x1d, 0x300b);
15154                 MP_WritePhyUshort(sc, 0x1d, 0x314d);
15155                 MP_WritePhyUshort(sc, 0x1f, 0x0004);
15156                 MP_WritePhyUshort(sc, 0x1c, 0x0200);
15157                 MP_WritePhyUshort(sc, 0x19, 0x7030);
15158                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
15159
15160                 if (CSR_READ_1(sc, 0xEF)&0x08) {
15161                         MP_WritePhyUshort(sc, 0x1F, 0x0005);
15162                         MP_WritePhyUshort(sc, 0x1A, 0x0004);
15163                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
15164                 } else {
15165                         MP_WritePhyUshort(sc, 0x1F, 0x0005);
15166                         MP_WritePhyUshort(sc, 0x1A, 0x0000);
15167                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
15168                 }
15169
15170                 if (CSR_READ_1(sc, 0xEF)&0x10) {
15171                         MP_WritePhyUshort(sc, 0x1F, 0x0004);
15172                         MP_WritePhyUshort(sc, 0x1C, 0x0000);
15173                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
15174                 } else {
15175                         MP_WritePhyUshort(sc, 0x1F, 0x0004);
15176                         MP_WritePhyUshort(sc, 0x1C, 0x0200);
15177                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
15178                 }
15179
15180                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
15181                 MP_WritePhyUshort(sc, 0x15, 0x7701);
15182                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
15183
15184                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
15185                 ClearEthPhyBit(sc, 0x1A, BIT_14);
15186
15187                 if (phy_power_saving == 1) {
15188                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
15189                         MP_WritePhyUshort(sc, 0x18, 0x8310);
15190                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
15191                 } else {
15192                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
15193                         MP_WritePhyUshort(sc, 0x18, 0x0310);
15194                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
15195                         DELAY(20000);
15196                 }
15197
15198                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
15199                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
15200                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
15201                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
15202                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
15203                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
15204                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
15205                 MP_WritePhyUshort(sc, 0x0D, 0x0003);
15206                 MP_WritePhyUshort(sc, 0x0E, 0x0015);
15207                 MP_WritePhyUshort(sc, 0x0D, 0x4003);
15208                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
15209                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
15210
15211         } else if (sc->re_type == MACFG_50) {
15212                 MP_WritePhyUshort(sc,0x1f, 0x0000);
15213                 MP_WritePhyUshort(sc,0x00, 0x1800);
15214                 Data = MP_ReadPhyUshort(sc, 0x15);
15215                 Data &= ~(BIT_12);
15216                 MP_WritePhyUshort(sc,0x15, Data);
15217                 MP_WritePhyUshort(sc,0x00, 0x4800);
15218                 MP_WritePhyUshort(sc,0x1f, 0x0007);
15219                 MP_WritePhyUshort(sc,0x1e, 0x002f);
15220                 for (i = 0; i < 1000; i++) {
15221                         DELAY(100);
15222                         Data = MP_ReadPhyUshort(sc, 0x1c);
15223                         if (Data & BIT_7)
15224                                 break;
15225                 }
15226                 MP_WritePhyUshort(sc,0x1f, 0x0000);
15227                 MP_WritePhyUshort(sc,0x00, 0x1800);
15228                 MP_WritePhyUshort(sc,0x1f, 0x0007);
15229                 MP_WritePhyUshort(sc,0x1e, 0x0023);
15230                 for (i = 0; i < 200; i++) {
15231                         DELAY(100);
15232                         Data = MP_ReadPhyUshort(sc, 0x18);
15233                         if (!(Data & BIT_0))
15234                                 break;
15235                 }
15236                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
15237                 MP_WritePhyUshort(sc, 0x05, 0xfff6);
15238                 MP_WritePhyUshort(sc, 0x06, 0x0080);
15239                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
15240                 MP_WritePhyUshort(sc, 0x1e, 0x0023);
15241                 MP_WritePhyUshort(sc, 0x16, 0x0306);
15242                 MP_WritePhyUshort(sc, 0x16, 0x0307);
15243                 MP_WritePhyUshort(sc, 0x15, 0x0194);
15244                 MP_WritePhyUshort(sc, 0x19, 0x407D);
15245                 MP_WritePhyUshort(sc, 0x15, 0x0098);
15246                 MP_WritePhyUshort(sc, 0x19, 0x7c0b);
15247                 MP_WritePhyUshort(sc, 0x15, 0x0099);
15248                 MP_WritePhyUshort(sc, 0x19, 0x6c0b);
15249                 MP_WritePhyUshort(sc, 0x15, 0x00eb);
15250                 MP_WritePhyUshort(sc, 0x19, 0x6c0b);
15251                 MP_WritePhyUshort(sc, 0x15, 0x00f8);
15252                 MP_WritePhyUshort(sc, 0x19, 0x6f0b);
15253                 MP_WritePhyUshort(sc, 0x15, 0x00fe);
15254                 MP_WritePhyUshort(sc, 0x19, 0x6f0f);
15255                 MP_WritePhyUshort(sc, 0x15, 0x00db);
15256                 MP_WritePhyUshort(sc, 0x19, 0x6f09);
15257                 MP_WritePhyUshort(sc, 0x15, 0x00dc);
15258                 MP_WritePhyUshort(sc, 0x19, 0xaefd);
15259                 MP_WritePhyUshort(sc, 0x15, 0x00dd);
15260                 MP_WritePhyUshort(sc, 0x19, 0x6f0b);
15261                 MP_WritePhyUshort(sc, 0x15, 0x00de);
15262                 MP_WritePhyUshort(sc, 0x19, 0xc60b);
15263                 MP_WritePhyUshort(sc, 0x15, 0x00df);
15264                 MP_WritePhyUshort(sc, 0x19, 0x00fa);
15265                 MP_WritePhyUshort(sc, 0x15, 0x00e0);
15266                 MP_WritePhyUshort(sc, 0x19, 0x30e1);
15267                 MP_WritePhyUshort(sc, 0x15, 0x020c);
15268                 MP_WritePhyUshort(sc, 0x19, 0x3224);
15269                 MP_WritePhyUshort(sc, 0x15, 0x020e);
15270                 MP_WritePhyUshort(sc, 0x19, 0x9813);
15271                 MP_WritePhyUshort(sc, 0x15, 0x020f);
15272                 MP_WritePhyUshort(sc, 0x19, 0x7801);
15273                 MP_WritePhyUshort(sc, 0x15, 0x0210);
15274                 MP_WritePhyUshort(sc, 0x19, 0x930f);
15275                 MP_WritePhyUshort(sc, 0x15, 0x0211);
15276                 MP_WritePhyUshort(sc, 0x19, 0x9206);
15277                 MP_WritePhyUshort(sc, 0x15, 0x0212);
15278                 MP_WritePhyUshort(sc, 0x19, 0x4002);
15279                 MP_WritePhyUshort(sc, 0x15, 0x0213);
15280                 MP_WritePhyUshort(sc, 0x19, 0x7800);
15281                 MP_WritePhyUshort(sc, 0x15, 0x0214);
15282                 MP_WritePhyUshort(sc, 0x19, 0x588f);
15283                 MP_WritePhyUshort(sc, 0x15, 0x0215);
15284                 MP_WritePhyUshort(sc, 0x19, 0x5520);
15285                 MP_WritePhyUshort(sc, 0x15, 0x0216);
15286                 MP_WritePhyUshort(sc, 0x19, 0x3224);
15287                 MP_WritePhyUshort(sc, 0x15, 0x0217);
15288                 MP_WritePhyUshort(sc, 0x19, 0x4002);
15289                 MP_WritePhyUshort(sc, 0x15, 0x0218);
15290                 MP_WritePhyUshort(sc, 0x19, 0x7800);
15291                 MP_WritePhyUshort(sc, 0x15, 0x0219);
15292                 MP_WritePhyUshort(sc, 0x19, 0x588d);
15293                 MP_WritePhyUshort(sc, 0x15, 0x021a);
15294                 MP_WritePhyUshort(sc, 0x19, 0x5540);
15295                 MP_WritePhyUshort(sc, 0x15, 0x021b);
15296                 MP_WritePhyUshort(sc, 0x19, 0x9e03);
15297                 MP_WritePhyUshort(sc, 0x15, 0x021c);
15298                 MP_WritePhyUshort(sc, 0x19, 0x7c40);
15299                 MP_WritePhyUshort(sc, 0x15, 0x021d);
15300                 MP_WritePhyUshort(sc, 0x19, 0x6840);
15301                 MP_WritePhyUshort(sc, 0x15, 0x021e);
15302                 MP_WritePhyUshort(sc, 0x19, 0x3224);
15303                 MP_WritePhyUshort(sc, 0x15, 0x021f);
15304                 MP_WritePhyUshort(sc, 0x19, 0x4002);
15305                 MP_WritePhyUshort(sc, 0x15, 0x0220);
15306                 MP_WritePhyUshort(sc, 0x19, 0x3224);
15307                 MP_WritePhyUshort(sc, 0x15, 0x0221);
15308                 MP_WritePhyUshort(sc, 0x19, 0x9e03);
15309                 MP_WritePhyUshort(sc, 0x15, 0x0222);
15310                 MP_WritePhyUshort(sc, 0x19, 0x7c40);
15311                 MP_WritePhyUshort(sc, 0x15, 0x0223);
15312                 MP_WritePhyUshort(sc, 0x19, 0x6840);
15313                 MP_WritePhyUshort(sc, 0x15, 0x0224);
15314                 MP_WritePhyUshort(sc, 0x19, 0x7800);
15315                 MP_WritePhyUshort(sc, 0x15, 0x0225);
15316                 MP_WritePhyUshort(sc, 0x19, 0x3231);
15317                 MP_WritePhyUshort(sc, 0x15, 0x0000);
15318                 MP_WritePhyUshort(sc, 0x16, 0x0306);
15319                 MP_WritePhyUshort(sc, 0x16, 0x0300);
15320                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
15321                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
15322                 MP_WritePhyUshort(sc, 0x05, 0xfff6);
15323                 MP_WritePhyUshort(sc, 0x06, 0x0080);
15324                 MP_WritePhyUshort(sc, 0x05, 0x8000);
15325                 MP_WritePhyUshort(sc, 0x06, 0x0280);
15326                 MP_WritePhyUshort(sc, 0x06, 0x48f7);
15327                 MP_WritePhyUshort(sc, 0x06, 0x00e0);
15328                 MP_WritePhyUshort(sc, 0x06, 0xfff7);
15329                 MP_WritePhyUshort(sc, 0x06, 0xa080);
15330                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
15331                 MP_WritePhyUshort(sc, 0x06, 0xf602);
15332                 MP_WritePhyUshort(sc, 0x06, 0x0118);
15333                 MP_WritePhyUshort(sc, 0x06, 0x0201);
15334                 MP_WritePhyUshort(sc, 0x06, 0x2502);
15335                 MP_WritePhyUshort(sc, 0x06, 0x8090);
15336                 MP_WritePhyUshort(sc, 0x06, 0x0201);
15337                 MP_WritePhyUshort(sc, 0x06, 0x4202);
15338                 MP_WritePhyUshort(sc, 0x06, 0x015c);
15339                 MP_WritePhyUshort(sc, 0x06, 0x0280);
15340                 MP_WritePhyUshort(sc, 0x06, 0xad02);
15341                 MP_WritePhyUshort(sc, 0x06, 0x80ca);
15342                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
15343                 MP_WritePhyUshort(sc, 0x06, 0x88e1);
15344                 MP_WritePhyUshort(sc, 0x06, 0x8b89);
15345                 MP_WritePhyUshort(sc, 0x06, 0x1e01);
15346                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
15347                 MP_WritePhyUshort(sc, 0x06, 0x8a1e);
15348                 MP_WritePhyUshort(sc, 0x06, 0x01e1);
15349                 MP_WritePhyUshort(sc, 0x06, 0x8b8b);
15350                 MP_WritePhyUshort(sc, 0x06, 0x1e01);
15351                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
15352                 MP_WritePhyUshort(sc, 0x06, 0x8c1e);
15353                 MP_WritePhyUshort(sc, 0x06, 0x01e1);
15354                 MP_WritePhyUshort(sc, 0x06, 0x8b8d);
15355                 MP_WritePhyUshort(sc, 0x06, 0x1e01);
15356                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
15357                 MP_WritePhyUshort(sc, 0x06, 0x8e1e);
15358                 MP_WritePhyUshort(sc, 0x06, 0x01a0);
15359                 MP_WritePhyUshort(sc, 0x06, 0x00c7);
15360                 MP_WritePhyUshort(sc, 0x06, 0xaebb);
15361                 MP_WritePhyUshort(sc, 0x06, 0xd484);
15362                 MP_WritePhyUshort(sc, 0x06, 0x3ce4);
15363                 MP_WritePhyUshort(sc, 0x06, 0x8b92);
15364                 MP_WritePhyUshort(sc, 0x06, 0xe58b);
15365                 MP_WritePhyUshort(sc, 0x06, 0x93ee);
15366                 MP_WritePhyUshort(sc, 0x06, 0x8ac8);
15367                 MP_WritePhyUshort(sc, 0x06, 0x03ee);
15368                 MP_WritePhyUshort(sc, 0x06, 0x8aca);
15369                 MP_WritePhyUshort(sc, 0x06, 0x60ee);
15370                 MP_WritePhyUshort(sc, 0x06, 0x8ac0);
15371                 MP_WritePhyUshort(sc, 0x06, 0x00ee);
15372                 MP_WritePhyUshort(sc, 0x06, 0x8ac1);
15373                 MP_WritePhyUshort(sc, 0x06, 0x00ee);
15374                 MP_WritePhyUshort(sc, 0x06, 0x8abe);
15375                 MP_WritePhyUshort(sc, 0x06, 0x07ee);
15376                 MP_WritePhyUshort(sc, 0x06, 0x8abf);
15377                 MP_WritePhyUshort(sc, 0x06, 0x73ee);
15378                 MP_WritePhyUshort(sc, 0x06, 0x8a95);
15379                 MP_WritePhyUshort(sc, 0x06, 0x02bf);
15380                 MP_WritePhyUshort(sc, 0x06, 0x8b88);
15381                 MP_WritePhyUshort(sc, 0x06, 0xec00);
15382                 MP_WritePhyUshort(sc, 0x06, 0x19a9);
15383                 MP_WritePhyUshort(sc, 0x06, 0x8b90);
15384                 MP_WritePhyUshort(sc, 0x06, 0xf9ee);
15385                 MP_WritePhyUshort(sc, 0x06, 0xfff6);
15386                 MP_WritePhyUshort(sc, 0x06, 0x00ee);
15387                 MP_WritePhyUshort(sc, 0x06, 0xfff7);
15388                 MP_WritePhyUshort(sc, 0x06, 0xfed1);
15389                 MP_WritePhyUshort(sc, 0x06, 0x00bf);
15390                 MP_WritePhyUshort(sc, 0x06, 0x85a4);
15391                 MP_WritePhyUshort(sc, 0x06, 0x0238);
15392                 MP_WritePhyUshort(sc, 0x06, 0x7dd1);
15393                 MP_WritePhyUshort(sc, 0x06, 0x01bf);
15394                 MP_WritePhyUshort(sc, 0x06, 0x85a7);
15395                 MP_WritePhyUshort(sc, 0x06, 0x0238);
15396                 MP_WritePhyUshort(sc, 0x06, 0x7d04);
15397                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
15398                 MP_WritePhyUshort(sc, 0x06, 0x8b8a);
15399                 MP_WritePhyUshort(sc, 0x06, 0xad20);
15400                 MP_WritePhyUshort(sc, 0x06, 0x14ee);
15401                 MP_WritePhyUshort(sc, 0x06, 0x8b8a);
15402                 MP_WritePhyUshort(sc, 0x06, 0x0002);
15403                 MP_WritePhyUshort(sc, 0x06, 0x204b);
15404                 MP_WritePhyUshort(sc, 0x06, 0xe0e4);
15405                 MP_WritePhyUshort(sc, 0x06, 0x26e1);
15406                 MP_WritePhyUshort(sc, 0x06, 0xe427);
15407                 MP_WritePhyUshort(sc, 0x06, 0xeee4);
15408                 MP_WritePhyUshort(sc, 0x06, 0x2623);
15409                 MP_WritePhyUshort(sc, 0x06, 0xe5e4);
15410                 MP_WritePhyUshort(sc, 0x06, 0x27fc);
15411                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
15412                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
15413                 MP_WritePhyUshort(sc, 0x06, 0x8dad);
15414                 MP_WritePhyUshort(sc, 0x06, 0x2014);
15415                 MP_WritePhyUshort(sc, 0x06, 0xee8b);
15416                 MP_WritePhyUshort(sc, 0x06, 0x8d00);
15417                 MP_WritePhyUshort(sc, 0x06, 0xe08a);
15418                 MP_WritePhyUshort(sc, 0x06, 0x5a78);
15419                 MP_WritePhyUshort(sc, 0x06, 0x039e);
15420                 MP_WritePhyUshort(sc, 0x06, 0x0902);
15421                 MP_WritePhyUshort(sc, 0x06, 0x05e8);
15422                 MP_WritePhyUshort(sc, 0x06, 0x0281);
15423                 MP_WritePhyUshort(sc, 0x06, 0x4f02);
15424                 MP_WritePhyUshort(sc, 0x06, 0x326c);
15425                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
15426                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
15427                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
15428                 MP_WritePhyUshort(sc, 0x06, 0xad20);
15429                 MP_WritePhyUshort(sc, 0x06, 0x1df6);
15430                 MP_WritePhyUshort(sc, 0x06, 0x20e4);
15431                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
15432                 MP_WritePhyUshort(sc, 0x06, 0x022f);
15433                 MP_WritePhyUshort(sc, 0x06, 0x0902);
15434                 MP_WritePhyUshort(sc, 0x06, 0x2ab0);
15435                 MP_WritePhyUshort(sc, 0x06, 0x0285);
15436                 MP_WritePhyUshort(sc, 0x06, 0x1602);
15437                 MP_WritePhyUshort(sc, 0x06, 0x03ba);
15438                 MP_WritePhyUshort(sc, 0x06, 0x0284);
15439                 MP_WritePhyUshort(sc, 0x06, 0xe502);
15440                 MP_WritePhyUshort(sc, 0x06, 0x2df1);
15441                 MP_WritePhyUshort(sc, 0x06, 0x0283);
15442                 MP_WritePhyUshort(sc, 0x06, 0x8302);
15443                 MP_WritePhyUshort(sc, 0x06, 0x0475);
15444                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
15445                 MP_WritePhyUshort(sc, 0x06, 0x8ead);
15446                 MP_WritePhyUshort(sc, 0x06, 0x210b);
15447                 MP_WritePhyUshort(sc, 0x06, 0xf621);
15448                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
15449                 MP_WritePhyUshort(sc, 0x06, 0x8e02);
15450                 MP_WritePhyUshort(sc, 0x06, 0x83f8);
15451                 MP_WritePhyUshort(sc, 0x06, 0x021c);
15452                 MP_WritePhyUshort(sc, 0x06, 0x99e0);
15453                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
15454                 MP_WritePhyUshort(sc, 0x06, 0xad22);
15455                 MP_WritePhyUshort(sc, 0x06, 0x08f6);
15456                 MP_WritePhyUshort(sc, 0x06, 0x22e4);
15457                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
15458                 MP_WritePhyUshort(sc, 0x06, 0x0235);
15459                 MP_WritePhyUshort(sc, 0x06, 0x63e0);
15460                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
15461                 MP_WritePhyUshort(sc, 0x06, 0xad23);
15462                 MP_WritePhyUshort(sc, 0x06, 0x08f6);
15463                 MP_WritePhyUshort(sc, 0x06, 0x23e4);
15464                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
15465                 MP_WritePhyUshort(sc, 0x06, 0x0231);
15466                 MP_WritePhyUshort(sc, 0x06, 0x57e0);
15467                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
15468                 MP_WritePhyUshort(sc, 0x06, 0xad24);
15469                 MP_WritePhyUshort(sc, 0x06, 0x05f6);
15470                 MP_WritePhyUshort(sc, 0x06, 0x24e4);
15471                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
15472                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
15473                 MP_WritePhyUshort(sc, 0x06, 0x8ead);
15474                 MP_WritePhyUshort(sc, 0x06, 0x2505);
15475                 MP_WritePhyUshort(sc, 0x06, 0xf625);
15476                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
15477                 MP_WritePhyUshort(sc, 0x06, 0x8ee0);
15478                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
15479                 MP_WritePhyUshort(sc, 0x06, 0xad26);
15480                 MP_WritePhyUshort(sc, 0x06, 0x08f6);
15481                 MP_WritePhyUshort(sc, 0x06, 0x26e4);
15482                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
15483                 MP_WritePhyUshort(sc, 0x06, 0x022d);
15484                 MP_WritePhyUshort(sc, 0x06, 0x1ce0);
15485                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
15486                 MP_WritePhyUshort(sc, 0x06, 0xad27);
15487                 MP_WritePhyUshort(sc, 0x06, 0x05f6);
15488                 MP_WritePhyUshort(sc, 0x06, 0x27e4);
15489                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
15490                 MP_WritePhyUshort(sc, 0x06, 0x0203);
15491                 MP_WritePhyUshort(sc, 0x06, 0x80fc);
15492                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
15493                 MP_WritePhyUshort(sc, 0x06, 0xf9e0);
15494                 MP_WritePhyUshort(sc, 0x06, 0x8b81);
15495                 MP_WritePhyUshort(sc, 0x06, 0xac26);
15496                 MP_WritePhyUshort(sc, 0x06, 0x1ae0);
15497                 MP_WritePhyUshort(sc, 0x06, 0x8b81);
15498                 MP_WritePhyUshort(sc, 0x06, 0xac21);
15499                 MP_WritePhyUshort(sc, 0x06, 0x14e0);
15500                 MP_WritePhyUshort(sc, 0x06, 0x8b85);
15501                 MP_WritePhyUshort(sc, 0x06, 0xac20);
15502                 MP_WritePhyUshort(sc, 0x06, 0x0ee0);
15503                 MP_WritePhyUshort(sc, 0x06, 0x8b85);
15504                 MP_WritePhyUshort(sc, 0x06, 0xac23);
15505                 MP_WritePhyUshort(sc, 0x06, 0x08e0);
15506                 MP_WritePhyUshort(sc, 0x06, 0x8b87);
15507                 MP_WritePhyUshort(sc, 0x06, 0xac24);
15508                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
15509                 MP_WritePhyUshort(sc, 0x06, 0x3802);
15510                 MP_WritePhyUshort(sc, 0x06, 0x1ac2);
15511                 MP_WritePhyUshort(sc, 0x06, 0xeee4);
15512                 MP_WritePhyUshort(sc, 0x06, 0x1c04);
15513                 MP_WritePhyUshort(sc, 0x06, 0xeee4);
15514                 MP_WritePhyUshort(sc, 0x06, 0x1d04);
15515                 MP_WritePhyUshort(sc, 0x06, 0xe2e0);
15516                 MP_WritePhyUshort(sc, 0x06, 0x7ce3);
15517                 MP_WritePhyUshort(sc, 0x06, 0xe07d);
15518                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
15519                 MP_WritePhyUshort(sc, 0x06, 0x38e1);
15520                 MP_WritePhyUshort(sc, 0x06, 0xe039);
15521                 MP_WritePhyUshort(sc, 0x06, 0xad2e);
15522                 MP_WritePhyUshort(sc, 0x06, 0x1bad);
15523                 MP_WritePhyUshort(sc, 0x06, 0x390d);
15524                 MP_WritePhyUshort(sc, 0x06, 0xd101);
15525                 MP_WritePhyUshort(sc, 0x06, 0xbf22);
15526                 MP_WritePhyUshort(sc, 0x06, 0x7a02);
15527                 MP_WritePhyUshort(sc, 0x06, 0x387d);
15528                 MP_WritePhyUshort(sc, 0x06, 0x0281);
15529                 MP_WritePhyUshort(sc, 0x06, 0xacae);
15530                 MP_WritePhyUshort(sc, 0x06, 0x0bac);
15531                 MP_WritePhyUshort(sc, 0x06, 0x3802);
15532                 MP_WritePhyUshort(sc, 0x06, 0xae06);
15533                 MP_WritePhyUshort(sc, 0x06, 0x0281);
15534                 MP_WritePhyUshort(sc, 0x06, 0xe902);
15535                 MP_WritePhyUshort(sc, 0x06, 0x822e);
15536                 MP_WritePhyUshort(sc, 0x06, 0x021a);
15537                 MP_WritePhyUshort(sc, 0x06, 0xd3fd);
15538                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
15539                 MP_WritePhyUshort(sc, 0x06, 0xf8e1);
15540                 MP_WritePhyUshort(sc, 0x06, 0x8af4);
15541                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
15542                 MP_WritePhyUshort(sc, 0x06, 0x81ad);
15543                 MP_WritePhyUshort(sc, 0x06, 0x2602);
15544                 MP_WritePhyUshort(sc, 0x06, 0xf728);
15545                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
15546                 MP_WritePhyUshort(sc, 0x06, 0x81ad);
15547                 MP_WritePhyUshort(sc, 0x06, 0x2105);
15548                 MP_WritePhyUshort(sc, 0x06, 0x0222);
15549                 MP_WritePhyUshort(sc, 0x06, 0x8ef7);
15550                 MP_WritePhyUshort(sc, 0x06, 0x29e0);
15551                 MP_WritePhyUshort(sc, 0x06, 0x8b85);
15552                 MP_WritePhyUshort(sc, 0x06, 0xad20);
15553                 MP_WritePhyUshort(sc, 0x06, 0x0502);
15554                 MP_WritePhyUshort(sc, 0x06, 0x14b8);
15555                 MP_WritePhyUshort(sc, 0x06, 0xf72a);
15556                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
15557                 MP_WritePhyUshort(sc, 0x06, 0x85ad);
15558                 MP_WritePhyUshort(sc, 0x06, 0x2305);
15559                 MP_WritePhyUshort(sc, 0x06, 0x0212);
15560                 MP_WritePhyUshort(sc, 0x06, 0xf4f7);
15561                 MP_WritePhyUshort(sc, 0x06, 0x2be0);
15562                 MP_WritePhyUshort(sc, 0x06, 0x8b87);
15563                 MP_WritePhyUshort(sc, 0x06, 0xad24);
15564                 MP_WritePhyUshort(sc, 0x06, 0x0502);
15565                 MP_WritePhyUshort(sc, 0x06, 0x8284);
15566                 MP_WritePhyUshort(sc, 0x06, 0xf72c);
15567                 MP_WritePhyUshort(sc, 0x06, 0xe58a);
15568                 MP_WritePhyUshort(sc, 0x06, 0xf4fc);
15569                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
15570                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
15571                 MP_WritePhyUshort(sc, 0x06, 0x81ad);
15572                 MP_WritePhyUshort(sc, 0x06, 0x2600);
15573                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
15574                 MP_WritePhyUshort(sc, 0x06, 0x81ad);
15575                 MP_WritePhyUshort(sc, 0x06, 0x2109);
15576                 MP_WritePhyUshort(sc, 0x06, 0xe08a);
15577                 MP_WritePhyUshort(sc, 0x06, 0xf4ac);
15578                 MP_WritePhyUshort(sc, 0x06, 0x2003);
15579                 MP_WritePhyUshort(sc, 0x06, 0x0222);
15580                 MP_WritePhyUshort(sc, 0x06, 0x7de0);
15581                 MP_WritePhyUshort(sc, 0x06, 0x8b85);
15582                 MP_WritePhyUshort(sc, 0x06, 0xad20);
15583                 MP_WritePhyUshort(sc, 0x06, 0x09e0);
15584                 MP_WritePhyUshort(sc, 0x06, 0x8af4);
15585                 MP_WritePhyUshort(sc, 0x06, 0xac21);
15586                 MP_WritePhyUshort(sc, 0x06, 0x0302);
15587                 MP_WritePhyUshort(sc, 0x06, 0x1408);
15588                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
15589                 MP_WritePhyUshort(sc, 0x06, 0x85ad);
15590                 MP_WritePhyUshort(sc, 0x06, 0x2309);
15591                 MP_WritePhyUshort(sc, 0x06, 0xe08a);
15592                 MP_WritePhyUshort(sc, 0x06, 0xf4ac);
15593                 MP_WritePhyUshort(sc, 0x06, 0x2203);
15594                 MP_WritePhyUshort(sc, 0x06, 0x0213);
15595                 MP_WritePhyUshort(sc, 0x06, 0x07e0);
15596                 MP_WritePhyUshort(sc, 0x06, 0x8b87);
15597                 MP_WritePhyUshort(sc, 0x06, 0xad24);
15598                 MP_WritePhyUshort(sc, 0x06, 0x09e0);
15599                 MP_WritePhyUshort(sc, 0x06, 0x8af4);
15600                 MP_WritePhyUshort(sc, 0x06, 0xac23);
15601                 MP_WritePhyUshort(sc, 0x06, 0x0302);
15602                 MP_WritePhyUshort(sc, 0x06, 0x8289);
15603                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
15604                 MP_WritePhyUshort(sc, 0x06, 0xf8e1);
15605                 MP_WritePhyUshort(sc, 0x06, 0x8af4);
15606                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
15607                 MP_WritePhyUshort(sc, 0x06, 0x81ad);
15608                 MP_WritePhyUshort(sc, 0x06, 0x2602);
15609                 MP_WritePhyUshort(sc, 0x06, 0xf628);
15610                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
15611                 MP_WritePhyUshort(sc, 0x06, 0x81ad);
15612                 MP_WritePhyUshort(sc, 0x06, 0x210a);
15613                 MP_WritePhyUshort(sc, 0x06, 0xe083);
15614                 MP_WritePhyUshort(sc, 0x06, 0xecf6);
15615                 MP_WritePhyUshort(sc, 0x06, 0x27a0);
15616                 MP_WritePhyUshort(sc, 0x06, 0x0502);
15617                 MP_WritePhyUshort(sc, 0x06, 0xf629);
15618                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
15619                 MP_WritePhyUshort(sc, 0x06, 0x85ad);
15620                 MP_WritePhyUshort(sc, 0x06, 0x2008);
15621                 MP_WritePhyUshort(sc, 0x06, 0xe08a);
15622                 MP_WritePhyUshort(sc, 0x06, 0xe8ad);
15623                 MP_WritePhyUshort(sc, 0x06, 0x2102);
15624                 MP_WritePhyUshort(sc, 0x06, 0xf62a);
15625                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
15626                 MP_WritePhyUshort(sc, 0x06, 0x85ad);
15627                 MP_WritePhyUshort(sc, 0x06, 0x2308);
15628                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
15629                 MP_WritePhyUshort(sc, 0x06, 0x20a0);
15630                 MP_WritePhyUshort(sc, 0x06, 0x0302);
15631                 MP_WritePhyUshort(sc, 0x06, 0xf62b);
15632                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
15633                 MP_WritePhyUshort(sc, 0x06, 0x87ad);
15634                 MP_WritePhyUshort(sc, 0x06, 0x2408);
15635                 MP_WritePhyUshort(sc, 0x06, 0xe08a);
15636                 MP_WritePhyUshort(sc, 0x06, 0xc2a0);
15637                 MP_WritePhyUshort(sc, 0x06, 0x0302);
15638                 MP_WritePhyUshort(sc, 0x06, 0xf62c);
15639                 MP_WritePhyUshort(sc, 0x06, 0xe58a);
15640                 MP_WritePhyUshort(sc, 0x06, 0xf4a1);
15641                 MP_WritePhyUshort(sc, 0x06, 0x0008);
15642                 MP_WritePhyUshort(sc, 0x06, 0xd100);
15643                 MP_WritePhyUshort(sc, 0x06, 0xbf22);
15644                 MP_WritePhyUshort(sc, 0x06, 0x7a02);
15645                 MP_WritePhyUshort(sc, 0x06, 0x387d);
15646                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
15647                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
15648                 MP_WritePhyUshort(sc, 0x06, 0xc200);
15649                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
15650                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
15651                 MP_WritePhyUshort(sc, 0x06, 0x87ad);
15652                 MP_WritePhyUshort(sc, 0x06, 0x241e);
15653                 MP_WritePhyUshort(sc, 0x06, 0xe08a);
15654                 MP_WritePhyUshort(sc, 0x06, 0xc2a0);
15655                 MP_WritePhyUshort(sc, 0x06, 0x0005);
15656                 MP_WritePhyUshort(sc, 0x06, 0x0282);
15657                 MP_WritePhyUshort(sc, 0x06, 0xb0ae);
15658                 MP_WritePhyUshort(sc, 0x06, 0xf5a0);
15659                 MP_WritePhyUshort(sc, 0x06, 0x0105);
15660                 MP_WritePhyUshort(sc, 0x06, 0x0282);
15661                 MP_WritePhyUshort(sc, 0x06, 0xc0ae);
15662                 MP_WritePhyUshort(sc, 0x06, 0x0ba0);
15663                 MP_WritePhyUshort(sc, 0x06, 0x0205);
15664                 MP_WritePhyUshort(sc, 0x06, 0x0282);
15665                 MP_WritePhyUshort(sc, 0x06, 0xcaae);
15666                 MP_WritePhyUshort(sc, 0x06, 0x03a0);
15667                 MP_WritePhyUshort(sc, 0x06, 0x0300);
15668                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
15669                 MP_WritePhyUshort(sc, 0x06, 0xf8fa);
15670                 MP_WritePhyUshort(sc, 0x06, 0xef69);
15671                 MP_WritePhyUshort(sc, 0x06, 0x0282);
15672                 MP_WritePhyUshort(sc, 0x06, 0xe1ee);
15673                 MP_WritePhyUshort(sc, 0x06, 0x8ac2);
15674                 MP_WritePhyUshort(sc, 0x06, 0x01ef);
15675                 MP_WritePhyUshort(sc, 0x06, 0x96fe);
15676                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
15677                 MP_WritePhyUshort(sc, 0x06, 0xf8ee);
15678                 MP_WritePhyUshort(sc, 0x06, 0x8ac9);
15679                 MP_WritePhyUshort(sc, 0x06, 0x0002);
15680                 MP_WritePhyUshort(sc, 0x06, 0x8317);
15681                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
15682                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
15683                 MP_WritePhyUshort(sc, 0x06, 0x8ac8);
15684                 MP_WritePhyUshort(sc, 0x06, 0xe18a);
15685                 MP_WritePhyUshort(sc, 0x06, 0xc91f);
15686                 MP_WritePhyUshort(sc, 0x06, 0x019e);
15687                 MP_WritePhyUshort(sc, 0x06, 0x0611);
15688                 MP_WritePhyUshort(sc, 0x06, 0xe58a);
15689                 MP_WritePhyUshort(sc, 0x06, 0xc9ae);
15690                 MP_WritePhyUshort(sc, 0x06, 0x04ee);
15691                 MP_WritePhyUshort(sc, 0x06, 0x8ac2);
15692                 MP_WritePhyUshort(sc, 0x06, 0x01fc);
15693                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
15694                 MP_WritePhyUshort(sc, 0x06, 0xf9fa);
15695                 MP_WritePhyUshort(sc, 0x06, 0xef69);
15696                 MP_WritePhyUshort(sc, 0x06, 0xfbbf);
15697                 MP_WritePhyUshort(sc, 0x06, 0x8ac4);
15698                 MP_WritePhyUshort(sc, 0x06, 0xef79);
15699                 MP_WritePhyUshort(sc, 0x06, 0xd200);
15700                 MP_WritePhyUshort(sc, 0x06, 0xd400);
15701                 MP_WritePhyUshort(sc, 0x06, 0x221e);
15702                 MP_WritePhyUshort(sc, 0x06, 0x02bf);
15703                 MP_WritePhyUshort(sc, 0x06, 0x3024);
15704                 MP_WritePhyUshort(sc, 0x06, 0x0238);
15705                 MP_WritePhyUshort(sc, 0x06, 0x7dbf);
15706                 MP_WritePhyUshort(sc, 0x06, 0x13ff);
15707                 MP_WritePhyUshort(sc, 0x06, 0x0238);
15708                 MP_WritePhyUshort(sc, 0x06, 0x500d);
15709                 MP_WritePhyUshort(sc, 0x06, 0x4559);
15710                 MP_WritePhyUshort(sc, 0x06, 0x1fef);
15711                 MP_WritePhyUshort(sc, 0x06, 0x97dd);
15712                 MP_WritePhyUshort(sc, 0x06, 0xd308);
15713                 MP_WritePhyUshort(sc, 0x06, 0x1a93);
15714                 MP_WritePhyUshort(sc, 0x06, 0xdd12);
15715                 MP_WritePhyUshort(sc, 0x06, 0x17a2);
15716                 MP_WritePhyUshort(sc, 0x06, 0x04de);
15717                 MP_WritePhyUshort(sc, 0x06, 0xffef);
15718                 MP_WritePhyUshort(sc, 0x06, 0x96fe);
15719                 MP_WritePhyUshort(sc, 0x06, 0xfdfc);
15720                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
15721                 MP_WritePhyUshort(sc, 0x06, 0xf9fa);
15722                 MP_WritePhyUshort(sc, 0x06, 0xef69);
15723                 MP_WritePhyUshort(sc, 0x06, 0xfbee);
15724                 MP_WritePhyUshort(sc, 0x06, 0x8ac2);
15725                 MP_WritePhyUshort(sc, 0x06, 0x03d5);
15726                 MP_WritePhyUshort(sc, 0x06, 0x0080);
15727                 MP_WritePhyUshort(sc, 0x06, 0xbf8a);
15728                 MP_WritePhyUshort(sc, 0x06, 0xc4ef);
15729                 MP_WritePhyUshort(sc, 0x06, 0x79ef);
15730                 MP_WritePhyUshort(sc, 0x06, 0x45bf);
15731                 MP_WritePhyUshort(sc, 0x06, 0x3024);
15732                 MP_WritePhyUshort(sc, 0x06, 0x0238);
15733                 MP_WritePhyUshort(sc, 0x06, 0x7dbf);
15734                 MP_WritePhyUshort(sc, 0x06, 0x13ff);
15735                 MP_WritePhyUshort(sc, 0x06, 0x0238);
15736                 MP_WritePhyUshort(sc, 0x06, 0x50ad);
15737                 MP_WritePhyUshort(sc, 0x06, 0x2702);
15738                 MP_WritePhyUshort(sc, 0x06, 0x78ff);
15739                 MP_WritePhyUshort(sc, 0x06, 0xe18a);
15740                 MP_WritePhyUshort(sc, 0x06, 0xca1b);
15741                 MP_WritePhyUshort(sc, 0x06, 0x01aa);
15742                 MP_WritePhyUshort(sc, 0x06, 0x2eef);
15743                 MP_WritePhyUshort(sc, 0x06, 0x97d9);
15744                 MP_WritePhyUshort(sc, 0x06, 0x7900);
15745                 MP_WritePhyUshort(sc, 0x06, 0x9e2b);
15746                 MP_WritePhyUshort(sc, 0x06, 0x81dd);
15747                 MP_WritePhyUshort(sc, 0x06, 0xbf85);
15748                 MP_WritePhyUshort(sc, 0x06, 0xad02);
15749                 MP_WritePhyUshort(sc, 0x06, 0x387d);
15750                 MP_WritePhyUshort(sc, 0x06, 0xd101);
15751                 MP_WritePhyUshort(sc, 0x06, 0xef02);
15752                 MP_WritePhyUshort(sc, 0x06, 0x100c);
15753                 MP_WritePhyUshort(sc, 0x06, 0x11b0);
15754                 MP_WritePhyUshort(sc, 0x06, 0xfc0d);
15755                 MP_WritePhyUshort(sc, 0x06, 0x11bf);
15756                 MP_WritePhyUshort(sc, 0x06, 0x85aa);
15757                 MP_WritePhyUshort(sc, 0x06, 0x0238);
15758                 MP_WritePhyUshort(sc, 0x06, 0x7dd1);
15759                 MP_WritePhyUshort(sc, 0x06, 0x00bf);
15760                 MP_WritePhyUshort(sc, 0x06, 0x85aa);
15761                 MP_WritePhyUshort(sc, 0x06, 0x0238);
15762                 MP_WritePhyUshort(sc, 0x06, 0x7dee);
15763                 MP_WritePhyUshort(sc, 0x06, 0x8ac2);
15764                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
15765                 MP_WritePhyUshort(sc, 0x06, 0x0413);
15766                 MP_WritePhyUshort(sc, 0x06, 0xa38b);
15767                 MP_WritePhyUshort(sc, 0x06, 0xb4d3);
15768                 MP_WritePhyUshort(sc, 0x06, 0x8012);
15769                 MP_WritePhyUshort(sc, 0x06, 0x17a2);
15770                 MP_WritePhyUshort(sc, 0x06, 0x04ad);
15771                 MP_WritePhyUshort(sc, 0x06, 0xffef);
15772                 MP_WritePhyUshort(sc, 0x06, 0x96fe);
15773                 MP_WritePhyUshort(sc, 0x06, 0xfdfc);
15774                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
15775                 MP_WritePhyUshort(sc, 0x06, 0xf9e0);
15776                 MP_WritePhyUshort(sc, 0x06, 0x8b85);
15777                 MP_WritePhyUshort(sc, 0x06, 0xad25);
15778                 MP_WritePhyUshort(sc, 0x06, 0x48e0);
15779                 MP_WritePhyUshort(sc, 0x06, 0x8a96);
15780                 MP_WritePhyUshort(sc, 0x06, 0xe18a);
15781                 MP_WritePhyUshort(sc, 0x06, 0x977c);
15782                 MP_WritePhyUshort(sc, 0x06, 0x0000);
15783                 MP_WritePhyUshort(sc, 0x06, 0x9e35);
15784                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
15785                 MP_WritePhyUshort(sc, 0x06, 0x9600);
15786                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
15787                 MP_WritePhyUshort(sc, 0x06, 0x9700);
15788                 MP_WritePhyUshort(sc, 0x06, 0xe08a);
15789                 MP_WritePhyUshort(sc, 0x06, 0xbee1);
15790                 MP_WritePhyUshort(sc, 0x06, 0x8abf);
15791                 MP_WritePhyUshort(sc, 0x06, 0xe28a);
15792                 MP_WritePhyUshort(sc, 0x06, 0xc0e3);
15793                 MP_WritePhyUshort(sc, 0x06, 0x8ac1);
15794                 MP_WritePhyUshort(sc, 0x06, 0x0237);
15795                 MP_WritePhyUshort(sc, 0x06, 0x74ad);
15796                 MP_WritePhyUshort(sc, 0x06, 0x2012);
15797                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
15798                 MP_WritePhyUshort(sc, 0x06, 0x9603);
15799                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
15800                 MP_WritePhyUshort(sc, 0x06, 0x97b7);
15801                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
15802                 MP_WritePhyUshort(sc, 0x06, 0xc000);
15803                 MP_WritePhyUshort(sc, 0x06, 0xee8a);
15804                 MP_WritePhyUshort(sc, 0x06, 0xc100);
15805                 MP_WritePhyUshort(sc, 0x06, 0xae11);
15806                 MP_WritePhyUshort(sc, 0x06, 0x15e6);
15807                 MP_WritePhyUshort(sc, 0x06, 0x8ac0);
15808                 MP_WritePhyUshort(sc, 0x06, 0xe78a);
15809                 MP_WritePhyUshort(sc, 0x06, 0xc1ae);
15810                 MP_WritePhyUshort(sc, 0x06, 0x08ee);
15811                 MP_WritePhyUshort(sc, 0x06, 0x8ac0);
15812                 MP_WritePhyUshort(sc, 0x06, 0x00ee);
15813                 MP_WritePhyUshort(sc, 0x06, 0x8ac1);
15814                 MP_WritePhyUshort(sc, 0x06, 0x00fd);
15815                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
15816                 MP_WritePhyUshort(sc, 0x06, 0xae20);
15817                 MP_WritePhyUshort(sc, 0x06, 0x0000);
15818                 MP_WritePhyUshort(sc, 0x06, 0x0000);
15819                 MP_WritePhyUshort(sc, 0x06, 0x0000);
15820                 MP_WritePhyUshort(sc, 0x06, 0x0000);
15821                 MP_WritePhyUshort(sc, 0x06, 0x0000);
15822                 MP_WritePhyUshort(sc, 0x06, 0x0000);
15823                 MP_WritePhyUshort(sc, 0x06, 0x0000);
15824                 MP_WritePhyUshort(sc, 0x06, 0x0000);
15825                 MP_WritePhyUshort(sc, 0x06, 0x0000);
15826                 MP_WritePhyUshort(sc, 0x06, 0x0000);
15827                 MP_WritePhyUshort(sc, 0x06, 0x0000);
15828                 MP_WritePhyUshort(sc, 0x06, 0x0000);
15829                 MP_WritePhyUshort(sc, 0x06, 0x0000);
15830                 MP_WritePhyUshort(sc, 0x06, 0x0000);
15831                 MP_WritePhyUshort(sc, 0x06, 0x0000);
15832                 MP_WritePhyUshort(sc, 0x06, 0x0000);
15833                 MP_WritePhyUshort(sc, 0x06, 0xf8fa);
15834                 MP_WritePhyUshort(sc, 0x06, 0xef69);
15835                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
15836                 MP_WritePhyUshort(sc, 0x06, 0x00e1);
15837                 MP_WritePhyUshort(sc, 0x06, 0xe001);
15838                 MP_WritePhyUshort(sc, 0x06, 0xad27);
15839                 MP_WritePhyUshort(sc, 0x06, 0x32e0);
15840                 MP_WritePhyUshort(sc, 0x06, 0x8b40);
15841                 MP_WritePhyUshort(sc, 0x06, 0xf720);
15842                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
15843                 MP_WritePhyUshort(sc, 0x06, 0x40bf);
15844                 MP_WritePhyUshort(sc, 0x06, 0x3230);
15845                 MP_WritePhyUshort(sc, 0x06, 0x0238);
15846                 MP_WritePhyUshort(sc, 0x06, 0x50ad);
15847                 MP_WritePhyUshort(sc, 0x06, 0x2821);
15848                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
15849                 MP_WritePhyUshort(sc, 0x06, 0x20e1);
15850                 MP_WritePhyUshort(sc, 0x06, 0xe021);
15851                 MP_WritePhyUshort(sc, 0x06, 0xad20);
15852                 MP_WritePhyUshort(sc, 0x06, 0x18e0);
15853                 MP_WritePhyUshort(sc, 0x06, 0x8b40);
15854                 MP_WritePhyUshort(sc, 0x06, 0xf620);
15855                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
15856                 MP_WritePhyUshort(sc, 0x06, 0x40ee);
15857                 MP_WritePhyUshort(sc, 0x06, 0x8b3b);
15858                 MP_WritePhyUshort(sc, 0x06, 0xffe0);
15859                 MP_WritePhyUshort(sc, 0x06, 0x8a8a);
15860                 MP_WritePhyUshort(sc, 0x06, 0xe18a);
15861                 MP_WritePhyUshort(sc, 0x06, 0x8be4);
15862                 MP_WritePhyUshort(sc, 0x06, 0xe000);
15863                 MP_WritePhyUshort(sc, 0x06, 0xe5e0);
15864                 MP_WritePhyUshort(sc, 0x06, 0x01ef);
15865                 MP_WritePhyUshort(sc, 0x06, 0x96fe);
15866                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
15867                 MP_WritePhyUshort(sc, 0x06, 0xf8f9);
15868                 MP_WritePhyUshort(sc, 0x06, 0xface);
15869                 MP_WritePhyUshort(sc, 0x06, 0xfaef);
15870                 MP_WritePhyUshort(sc, 0x06, 0x69fa);
15871                 MP_WritePhyUshort(sc, 0x06, 0xd401);
15872                 MP_WritePhyUshort(sc, 0x06, 0x55b4);
15873                 MP_WritePhyUshort(sc, 0x06, 0xfebf);
15874                 MP_WritePhyUshort(sc, 0x06, 0x1c1e);
15875                 MP_WritePhyUshort(sc, 0x06, 0x0238);
15876                 MP_WritePhyUshort(sc, 0x06, 0x50ac);
15877                 MP_WritePhyUshort(sc, 0x06, 0x280b);
15878                 MP_WritePhyUshort(sc, 0x06, 0xbf1c);
15879                 MP_WritePhyUshort(sc, 0x06, 0x1b02);
15880                 MP_WritePhyUshort(sc, 0x06, 0x3850);
15881                 MP_WritePhyUshort(sc, 0x06, 0xac28);
15882                 MP_WritePhyUshort(sc, 0x06, 0x49ae);
15883                 MP_WritePhyUshort(sc, 0x06, 0x64bf);
15884                 MP_WritePhyUshort(sc, 0x06, 0x1c1b);
15885                 MP_WritePhyUshort(sc, 0x06, 0x0238);
15886                 MP_WritePhyUshort(sc, 0x06, 0x50ac);
15887                 MP_WritePhyUshort(sc, 0x06, 0x285b);
15888                 MP_WritePhyUshort(sc, 0x06, 0xd000);
15889                 MP_WritePhyUshort(sc, 0x06, 0x0284);
15890                 MP_WritePhyUshort(sc, 0x06, 0xcaac);
15891                 MP_WritePhyUshort(sc, 0x06, 0x2105);
15892                 MP_WritePhyUshort(sc, 0x06, 0xac22);
15893                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
15894                 MP_WritePhyUshort(sc, 0x06, 0x4ebf);
15895                 MP_WritePhyUshort(sc, 0x06, 0xe0c4);
15896                 MP_WritePhyUshort(sc, 0x06, 0xbe85);
15897                 MP_WritePhyUshort(sc, 0x06, 0xf6d2);
15898                 MP_WritePhyUshort(sc, 0x06, 0x04d8);
15899                 MP_WritePhyUshort(sc, 0x06, 0x19d9);
15900                 MP_WritePhyUshort(sc, 0x06, 0x1907);
15901                 MP_WritePhyUshort(sc, 0x06, 0xdc19);
15902                 MP_WritePhyUshort(sc, 0x06, 0xdd19);
15903                 MP_WritePhyUshort(sc, 0x06, 0x0789);
15904                 MP_WritePhyUshort(sc, 0x06, 0x89ef);
15905                 MP_WritePhyUshort(sc, 0x06, 0x645e);
15906                 MP_WritePhyUshort(sc, 0x06, 0x07ff);
15907                 MP_WritePhyUshort(sc, 0x06, 0x0d65);
15908                 MP_WritePhyUshort(sc, 0x06, 0x5cf8);
15909                 MP_WritePhyUshort(sc, 0x06, 0x001e);
15910                 MP_WritePhyUshort(sc, 0x06, 0x46dc);
15911                 MP_WritePhyUshort(sc, 0x06, 0x19dd);
15912                 MP_WritePhyUshort(sc, 0x06, 0x19b2);
15913                 MP_WritePhyUshort(sc, 0x06, 0xe2d4);
15914                 MP_WritePhyUshort(sc, 0x06, 0x0001);
15915                 MP_WritePhyUshort(sc, 0x06, 0xbf1c);
15916                 MP_WritePhyUshort(sc, 0x06, 0x1b02);
15917                 MP_WritePhyUshort(sc, 0x06, 0x387d);
15918                 MP_WritePhyUshort(sc, 0x06, 0xae1d);
15919                 MP_WritePhyUshort(sc, 0x06, 0xbee0);
15920                 MP_WritePhyUshort(sc, 0x06, 0xc4bf);
15921                 MP_WritePhyUshort(sc, 0x06, 0x85f6);
15922                 MP_WritePhyUshort(sc, 0x06, 0xd204);
15923                 MP_WritePhyUshort(sc, 0x06, 0xd819);
15924                 MP_WritePhyUshort(sc, 0x06, 0xd919);
15925                 MP_WritePhyUshort(sc, 0x06, 0x07dc);
15926                 MP_WritePhyUshort(sc, 0x06, 0x19dd);
15927                 MP_WritePhyUshort(sc, 0x06, 0x1907);
15928                 MP_WritePhyUshort(sc, 0x06, 0xb2f4);
15929                 MP_WritePhyUshort(sc, 0x06, 0xd400);
15930                 MP_WritePhyUshort(sc, 0x06, 0x00bf);
15931                 MP_WritePhyUshort(sc, 0x06, 0x1c1b);
15932                 MP_WritePhyUshort(sc, 0x06, 0x0238);
15933                 MP_WritePhyUshort(sc, 0x06, 0x7dfe);
15934                 MP_WritePhyUshort(sc, 0x06, 0xef96);
15935                 MP_WritePhyUshort(sc, 0x06, 0xfec6);
15936                 MP_WritePhyUshort(sc, 0x06, 0xfefd);
15937                 MP_WritePhyUshort(sc, 0x06, 0xfc05);
15938                 MP_WritePhyUshort(sc, 0x06, 0xf9e2);
15939                 MP_WritePhyUshort(sc, 0x06, 0xe0ea);
15940                 MP_WritePhyUshort(sc, 0x06, 0xe3e0);
15941                 MP_WritePhyUshort(sc, 0x06, 0xeb5a);
15942                 MP_WritePhyUshort(sc, 0x06, 0x070c);
15943                 MP_WritePhyUshort(sc, 0x06, 0x031e);
15944                 MP_WritePhyUshort(sc, 0x06, 0x20e6);
15945                 MP_WritePhyUshort(sc, 0x06, 0xe0ea);
15946                 MP_WritePhyUshort(sc, 0x06, 0xe7e0);
15947                 MP_WritePhyUshort(sc, 0x06, 0xebe0);
15948                 MP_WritePhyUshort(sc, 0x06, 0xe0fc);
15949                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
15950                 MP_WritePhyUshort(sc, 0x06, 0xfdfd);
15951                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
15952                 MP_WritePhyUshort(sc, 0x06, 0xfaef);
15953                 MP_WritePhyUshort(sc, 0x06, 0x69e0);
15954                 MP_WritePhyUshort(sc, 0x06, 0x8b80);
15955                 MP_WritePhyUshort(sc, 0x06, 0xad27);
15956                 MP_WritePhyUshort(sc, 0x06, 0x22bf);
15957                 MP_WritePhyUshort(sc, 0x06, 0x4616);
15958                 MP_WritePhyUshort(sc, 0x06, 0x0238);
15959                 MP_WritePhyUshort(sc, 0x06, 0x50e0);
15960                 MP_WritePhyUshort(sc, 0x06, 0x8b44);
15961                 MP_WritePhyUshort(sc, 0x06, 0x1f01);
15962                 MP_WritePhyUshort(sc, 0x06, 0x9e15);
15963                 MP_WritePhyUshort(sc, 0x06, 0xe58b);
15964                 MP_WritePhyUshort(sc, 0x06, 0x44ad);
15965                 MP_WritePhyUshort(sc, 0x06, 0x2907);
15966                 MP_WritePhyUshort(sc, 0x06, 0xac28);
15967                 MP_WritePhyUshort(sc, 0x06, 0x04d1);
15968                 MP_WritePhyUshort(sc, 0x06, 0x01ae);
15969                 MP_WritePhyUshort(sc, 0x06, 0x02d1);
15970                 MP_WritePhyUshort(sc, 0x06, 0x00bf);
15971                 MP_WritePhyUshort(sc, 0x06, 0x85b0);
15972                 MP_WritePhyUshort(sc, 0x06, 0x0238);
15973                 MP_WritePhyUshort(sc, 0x06, 0x7def);
15974                 MP_WritePhyUshort(sc, 0x06, 0x96fe);
15975                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
15976                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
15977                 MP_WritePhyUshort(sc, 0x06, 0x8b85);
15978                 MP_WritePhyUshort(sc, 0x06, 0xad26);
15979                 MP_WritePhyUshort(sc, 0x06, 0x30e0);
15980                 MP_WritePhyUshort(sc, 0x06, 0xe036);
15981                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
15982                 MP_WritePhyUshort(sc, 0x06, 0x37e1);
15983                 MP_WritePhyUshort(sc, 0x06, 0x8b3f);
15984                 MP_WritePhyUshort(sc, 0x06, 0x1f10);
15985                 MP_WritePhyUshort(sc, 0x06, 0x9e23);
15986                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
15987                 MP_WritePhyUshort(sc, 0x06, 0x3fac);
15988                 MP_WritePhyUshort(sc, 0x06, 0x200b);
15989                 MP_WritePhyUshort(sc, 0x06, 0xac21);
15990                 MP_WritePhyUshort(sc, 0x06, 0x0dac);
15991                 MP_WritePhyUshort(sc, 0x06, 0x250f);
15992                 MP_WritePhyUshort(sc, 0x06, 0xac27);
15993                 MP_WritePhyUshort(sc, 0x06, 0x11ae);
15994                 MP_WritePhyUshort(sc, 0x06, 0x1202);
15995                 MP_WritePhyUshort(sc, 0x06, 0x2c47);
15996                 MP_WritePhyUshort(sc, 0x06, 0xae0d);
15997                 MP_WritePhyUshort(sc, 0x06, 0x0285);
15998                 MP_WritePhyUshort(sc, 0x06, 0x4fae);
15999                 MP_WritePhyUshort(sc, 0x06, 0x0802);
16000                 MP_WritePhyUshort(sc, 0x06, 0x2c69);
16001                 MP_WritePhyUshort(sc, 0x06, 0xae03);
16002                 MP_WritePhyUshort(sc, 0x06, 0x022c);
16003                 MP_WritePhyUshort(sc, 0x06, 0x7cfc);
16004                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
16005                 MP_WritePhyUshort(sc, 0x06, 0xfaef);
16006                 MP_WritePhyUshort(sc, 0x06, 0x6902);
16007                 MP_WritePhyUshort(sc, 0x06, 0x856c);
16008                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
16009                 MP_WritePhyUshort(sc, 0x06, 0x14e1);
16010                 MP_WritePhyUshort(sc, 0x06, 0xe015);
16011                 MP_WritePhyUshort(sc, 0x06, 0xad26);
16012                 MP_WritePhyUshort(sc, 0x06, 0x08d1);
16013                 MP_WritePhyUshort(sc, 0x06, 0x1ebf);
16014                 MP_WritePhyUshort(sc, 0x06, 0x2cd9);
16015                 MP_WritePhyUshort(sc, 0x06, 0x0238);
16016                 MP_WritePhyUshort(sc, 0x06, 0x7def);
16017                 MP_WritePhyUshort(sc, 0x06, 0x96fe);
16018                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
16019                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
16020                 MP_WritePhyUshort(sc, 0x06, 0x8b85);
16021                 MP_WritePhyUshort(sc, 0x06, 0xad27);
16022                 MP_WritePhyUshort(sc, 0x06, 0x2fd0);
16023                 MP_WritePhyUshort(sc, 0x06, 0x0b02);
16024                 MP_WritePhyUshort(sc, 0x06, 0x3682);
16025                 MP_WritePhyUshort(sc, 0x06, 0x5882);
16026                 MP_WritePhyUshort(sc, 0x06, 0x7882);
16027                 MP_WritePhyUshort(sc, 0x06, 0x9f24);
16028                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
16029                 MP_WritePhyUshort(sc, 0x06, 0x32e1);
16030                 MP_WritePhyUshort(sc, 0x06, 0x8b33);
16031                 MP_WritePhyUshort(sc, 0x06, 0x1f10);
16032                 MP_WritePhyUshort(sc, 0x06, 0x9e1a);
16033                 MP_WritePhyUshort(sc, 0x06, 0x10e4);
16034                 MP_WritePhyUshort(sc, 0x06, 0x8b32);
16035                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
16036                 MP_WritePhyUshort(sc, 0x06, 0x28e1);
16037                 MP_WritePhyUshort(sc, 0x06, 0xe029);
16038                 MP_WritePhyUshort(sc, 0x06, 0xf72c);
16039                 MP_WritePhyUshort(sc, 0x06, 0xe4e0);
16040                 MP_WritePhyUshort(sc, 0x06, 0x28e5);
16041                 MP_WritePhyUshort(sc, 0x06, 0xe029);
16042                 MP_WritePhyUshort(sc, 0x06, 0xf62c);
16043                 MP_WritePhyUshort(sc, 0x06, 0xe4e0);
16044                 MP_WritePhyUshort(sc, 0x06, 0x28e5);
16045                 MP_WritePhyUshort(sc, 0x06, 0xe029);
16046                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
16047                 MP_WritePhyUshort(sc, 0x06, 0x00e1);
16048                 MP_WritePhyUshort(sc, 0x06, 0x4077);
16049                 MP_WritePhyUshort(sc, 0x06, 0xe140);
16050                 MP_WritePhyUshort(sc, 0x06, 0x52e0);
16051                 MP_WritePhyUshort(sc, 0x06, 0xeed9);
16052                 MP_WritePhyUshort(sc, 0x06, 0xe04c);
16053                 MP_WritePhyUshort(sc, 0x06, 0xbbe0);
16054                 MP_WritePhyUshort(sc, 0x06, 0x2a00);
16055                 MP_WritePhyUshort(sc, 0x05, 0xe142);
16056                 Data = MP_ReadPhyUshort(sc, 0x06);
16057                 Data |= BIT_0;
16058                 MP_WritePhyUshort(sc,0x06, Data);
16059                 MP_WritePhyUshort(sc, 0x05, 0xe140);
16060                 Data = MP_ReadPhyUshort(sc, 0x06);
16061                 Data |= BIT_0;
16062                 MP_WritePhyUshort(sc,0x06, Data);
16063                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16064                 MP_WritePhyUshort(sc,0x1f, 0x0005);
16065                 for (i = 0; i < 200; i++) {
16066                         DELAY(100);
16067                         Data = MP_ReadPhyUshort(sc, 0x00);
16068                         if (Data & BIT_7)
16069                                 break;
16070                 }
16071                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
16072                 MP_WritePhyUshort(sc, 0x1e, 0x0023);
16073                 Data = MP_ReadPhyUshort(sc, 0x17);
16074                 Data |= BIT_1;
16075                 MP_WritePhyUshort(sc, 0x17, Data);
16076                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16077                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
16078                 MP_WritePhyUshort(sc, 0x09, 0xA20F);
16079                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16080                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
16081                 MP_WritePhyUshort(sc, 0x01, 0x328A);
16082                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16083                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
16084                 Data = MP_ReadPhyUshort(sc, 0x19);
16085                 Data &= ~BIT_0;
16086                 MP_WritePhyUshort(sc, 0x19, Data);
16087                 Data = MP_ReadPhyUshort(sc, 0x10);
16088                 Data &= ~BIT_10;
16089                 MP_WritePhyUshort(sc, 0x10, Data);
16090                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16091                 MP_WritePhyUshort(sc, 0x00, 0x9200);
16092
16093                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
16094                 MP_WritePhyUshort(sc, 0x05, 0x8B80);
16095                 Data = MP_ReadPhyUshort(sc, 0x06);
16096                 Data |= BIT_2 | BIT_1;
16097                 MP_WritePhyUshort(sc, 0x06, Data);
16098                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16099
16100                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
16101                 MP_WritePhyUshort(sc, 0x1E, 0x002D);
16102                 Data = MP_ReadPhyUshort(sc, 0x18);
16103                 Data |= BIT_4;
16104                 MP_WritePhyUshort(sc, 0x18, Data);
16105                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16106                 Data = MP_ReadPhyUshort(sc, 0x14);
16107                 Data |= BIT_15;
16108                 MP_WritePhyUshort(sc, 0x14, Data);
16109
16110                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
16111                 MP_WritePhyUshort(sc, 0x05, 0x8B86);
16112                 Data = MP_ReadPhyUshort(sc, 0x06);
16113                 Data |= BIT_0;
16114                 MP_WritePhyUshort(sc, 0x06, Data);
16115                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16116
16117                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
16118                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
16119                 Data = MP_ReadPhyUshort(sc, 0x06);
16120                 Data |= BIT_14;
16121                 MP_WritePhyUshort(sc, 0x06, Data);
16122                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16123
16124                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
16125                 MP_WritePhyUshort(sc, 0x09, 0xA20F);
16126                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
16127
16128                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
16129                 MP_WritePhyUshort(sc, 0x05, 0x8B55);
16130                 MP_WritePhyUshort(sc, 0x06, 0x0000);
16131                 MP_WritePhyUshort(sc, 0x05, 0x8B5E);
16132                 MP_WritePhyUshort(sc, 0x06, 0x0000);
16133                 MP_WritePhyUshort(sc, 0x05, 0x8B67);
16134                 MP_WritePhyUshort(sc, 0x06, 0x0000);
16135                 MP_WritePhyUshort(sc, 0x05, 0x8B70);
16136                 MP_WritePhyUshort(sc, 0x06, 0x0000);
16137                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16138                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
16139                 MP_WritePhyUshort(sc, 0x1E, 0x0078);
16140                 MP_WritePhyUshort(sc, 0x17, 0x0000);
16141                 MP_WritePhyUshort(sc, 0x19, 0x00FB);
16142                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16143
16144                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
16145                 MP_WritePhyUshort(sc, 0x05, 0x8B79);
16146                 MP_WritePhyUshort(sc, 0x06, 0xAA00);
16147                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16148
16149                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
16150                 MP_WritePhyUshort(sc, 0x01, 0x328A);
16151                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
16152
16153                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
16154                 MP_WritePhyUshort(sc, 0x05, 0x8B54);
16155                 Data = MP_ReadPhyUshort(sc, 0x06);
16156                 Data &= ~BIT_11;
16157                 MP_WritePhyUshort(sc, 0x06, Data);
16158                 MP_WritePhyUshort(sc, 0x05, 0x8B5D);
16159                 Data = MP_ReadPhyUshort(sc, 0x06);
16160                 Data &= ~BIT_11;
16161                 MP_WritePhyUshort(sc, 0x06, Data);
16162                 MP_WritePhyUshort(sc, 0x05, 0x8A7C);
16163                 Data = MP_ReadPhyUshort(sc, 0x06);
16164                 Data &= ~BIT_8;
16165                 MP_WritePhyUshort(sc, 0x06, Data);
16166                 MP_WritePhyUshort(sc, 0x05, 0x8A7F);
16167                 Data = MP_ReadPhyUshort(sc, 0x06);
16168                 Data |= BIT_8;
16169                 MP_WritePhyUshort(sc, 0x06, Data);
16170                 MP_WritePhyUshort(sc, 0x05, 0x8A82);
16171                 Data = MP_ReadPhyUshort(sc, 0x06);
16172                 Data &= ~BIT_8;
16173                 MP_WritePhyUshort(sc, 0x06, Data);
16174                 MP_WritePhyUshort(sc, 0x05, 0x8A85);
16175                 Data = MP_ReadPhyUshort(sc, 0x06);
16176                 Data &= ~BIT_8;
16177                 MP_WritePhyUshort(sc, 0x06, Data);
16178                 MP_WritePhyUshort(sc, 0x05, 0x8A88);
16179                 Data = MP_ReadPhyUshort(sc, 0x06);
16180                 Data &= ~BIT_8;
16181                 MP_WritePhyUshort(sc, 0x06, Data);
16182                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
16183
16184                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
16185                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
16186                 Data = MP_ReadPhyUshort(sc, 0x06);
16187                 Data |= BIT_15;
16188                 MP_WritePhyUshort(sc, 0x06, Data);
16189                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16190
16191                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
16192                 Data = MP_ReadPhyUshort(sc, 0x19);
16193                 Data &= ~BIT_0;
16194                 MP_WritePhyUshort(sc, 0x19, Data);
16195                 Data = MP_ReadPhyUshort(sc, 0x10);
16196                 Data &= ~BIT_10;
16197                 MP_WritePhyUshort(sc, 0x10, Data);
16198                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16199         } else if (sc->re_type == MACFG_51) {
16200                 MP_WritePhyUshort(sc,0x1f, 0x0000);
16201                 MP_WritePhyUshort(sc,0x00, 0x1800);
16202                 Data = MP_ReadPhyUshort(sc, 0x15);
16203                 Data &= ~(BIT_12);
16204                 MP_WritePhyUshort(sc,0x15, Data);
16205                 MP_WritePhyUshort(sc,0x00, 0x9800);
16206                 MP_WritePhyUshort(sc,0x1f, 0x0007);
16207                 MP_WritePhyUshort(sc,0x1e, 0x002f);
16208                 for (i = 0; i < 1000; i++) {
16209                         DELAY(100);
16210                         Data = MP_ReadPhyUshort(sc, 0x1c);
16211                         if (Data & BIT_7)
16212                                 break;
16213                 }
16214                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
16215                 MP_WritePhyUshort(sc, 0x1e, 0x0023);
16216                 MP_WritePhyUshort(sc, 0x16, 0x0306);
16217                 MP_WritePhyUshort(sc, 0x16, 0x0307);
16218                 MP_WritePhyUshort(sc, 0x15, 0x0098);
16219                 MP_WritePhyUshort(sc, 0x19, 0x7c0b);
16220                 MP_WritePhyUshort(sc, 0x15, 0x0099);
16221                 MP_WritePhyUshort(sc, 0x19, 0x6c0b);
16222                 MP_WritePhyUshort(sc, 0x15, 0x00eb);
16223                 MP_WritePhyUshort(sc, 0x19, 0x6c0b);
16224                 MP_WritePhyUshort(sc, 0x15, 0x00f8);
16225                 MP_WritePhyUshort(sc, 0x19, 0x6f0b);
16226                 MP_WritePhyUshort(sc, 0x15, 0x00fe);
16227                 MP_WritePhyUshort(sc, 0x19, 0x6f0f);
16228                 MP_WritePhyUshort(sc, 0x15, 0x00db);
16229                 MP_WritePhyUshort(sc, 0x19, 0x6f09);
16230                 MP_WritePhyUshort(sc, 0x15, 0x00dc);
16231                 MP_WritePhyUshort(sc, 0x19, 0xaefd);
16232                 MP_WritePhyUshort(sc, 0x15, 0x00dd);
16233                 MP_WritePhyUshort(sc, 0x19, 0x6f0b);
16234                 MP_WritePhyUshort(sc, 0x15, 0x00de);
16235                 MP_WritePhyUshort(sc, 0x19, 0xc60b);
16236                 MP_WritePhyUshort(sc, 0x15, 0x00df);
16237                 MP_WritePhyUshort(sc, 0x19, 0x00fa);
16238                 MP_WritePhyUshort(sc, 0x15, 0x00e0);
16239                 MP_WritePhyUshort(sc, 0x19, 0x30e1);
16240                 MP_WritePhyUshort(sc, 0x15, 0x020c);
16241                 MP_WritePhyUshort(sc, 0x19, 0x3224);
16242                 MP_WritePhyUshort(sc, 0x15, 0x020e);
16243                 MP_WritePhyUshort(sc, 0x19, 0x9813);
16244                 MP_WritePhyUshort(sc, 0x15, 0x020f);
16245                 MP_WritePhyUshort(sc, 0x19, 0x7801);
16246                 MP_WritePhyUshort(sc, 0x15, 0x0210);
16247                 MP_WritePhyUshort(sc, 0x19, 0x930f);
16248                 MP_WritePhyUshort(sc, 0x15, 0x0211);
16249                 MP_WritePhyUshort(sc, 0x19, 0x9206);
16250                 MP_WritePhyUshort(sc, 0x15, 0x0212);
16251                 MP_WritePhyUshort(sc, 0x19, 0x4002);
16252                 MP_WritePhyUshort(sc, 0x15, 0x0213);
16253                 MP_WritePhyUshort(sc, 0x19, 0x7800);
16254                 MP_WritePhyUshort(sc, 0x15, 0x0214);
16255                 MP_WritePhyUshort(sc, 0x19, 0x588f);
16256                 MP_WritePhyUshort(sc, 0x15, 0x0215);
16257                 MP_WritePhyUshort(sc, 0x19, 0x5520);
16258                 MP_WritePhyUshort(sc, 0x15, 0x0216);
16259                 MP_WritePhyUshort(sc, 0x19, 0x3224);
16260                 MP_WritePhyUshort(sc, 0x15, 0x0217);
16261                 MP_WritePhyUshort(sc, 0x19, 0x4002);
16262                 MP_WritePhyUshort(sc, 0x15, 0x0218);
16263                 MP_WritePhyUshort(sc, 0x19, 0x7800);
16264                 MP_WritePhyUshort(sc, 0x15, 0x0219);
16265                 MP_WritePhyUshort(sc, 0x19, 0x588d);
16266                 MP_WritePhyUshort(sc, 0x15, 0x021a);
16267                 MP_WritePhyUshort(sc, 0x19, 0x5540);
16268                 MP_WritePhyUshort(sc, 0x15, 0x021b);
16269                 MP_WritePhyUshort(sc, 0x19, 0x9e03);
16270                 MP_WritePhyUshort(sc, 0x15, 0x021c);
16271                 MP_WritePhyUshort(sc, 0x19, 0x7c40);
16272                 MP_WritePhyUshort(sc, 0x15, 0x021d);
16273                 MP_WritePhyUshort(sc, 0x19, 0x6840);
16274                 MP_WritePhyUshort(sc, 0x15, 0x021e);
16275                 MP_WritePhyUshort(sc, 0x19, 0x3224);
16276                 MP_WritePhyUshort(sc, 0x15, 0x021f);
16277                 MP_WritePhyUshort(sc, 0x19, 0x4002);
16278                 MP_WritePhyUshort(sc, 0x15, 0x0220);
16279                 MP_WritePhyUshort(sc, 0x19, 0x3224);
16280                 MP_WritePhyUshort(sc, 0x15, 0x0221);
16281                 MP_WritePhyUshort(sc, 0x19, 0x9e03);
16282                 MP_WritePhyUshort(sc, 0x15, 0x0222);
16283                 MP_WritePhyUshort(sc, 0x19, 0x7c40);
16284                 MP_WritePhyUshort(sc, 0x15, 0x0223);
16285                 MP_WritePhyUshort(sc, 0x19, 0x6840);
16286                 MP_WritePhyUshort(sc, 0x15, 0x0224);
16287                 MP_WritePhyUshort(sc, 0x19, 0x7800);
16288                 MP_WritePhyUshort(sc, 0x15, 0x0225);
16289                 MP_WritePhyUshort(sc, 0x19, 0x3231);
16290                 MP_WritePhyUshort(sc, 0x15, 0x0000);
16291                 MP_WritePhyUshort(sc, 0x16, 0x0306);
16292                 MP_WritePhyUshort(sc, 0x16, 0x0300);
16293                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16294                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
16295                 MP_WritePhyUshort(sc, 0x05, 0xfff6);
16296                 MP_WritePhyUshort(sc, 0x06, 0x0080);
16297                 MP_WritePhyUshort(sc, 0x05, 0x8000);
16298                 MP_WritePhyUshort(sc, 0x06, 0x0280);
16299                 MP_WritePhyUshort(sc, 0x06, 0x48f7);
16300                 MP_WritePhyUshort(sc, 0x06, 0x00e0);
16301                 MP_WritePhyUshort(sc, 0x06, 0xfff7);
16302                 MP_WritePhyUshort(sc, 0x06, 0xa080);
16303                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
16304                 MP_WritePhyUshort(sc, 0x06, 0xf602);
16305                 MP_WritePhyUshort(sc, 0x06, 0x011b);
16306                 MP_WritePhyUshort(sc, 0x06, 0x0201);
16307                 MP_WritePhyUshort(sc, 0x06, 0x2802);
16308                 MP_WritePhyUshort(sc, 0x06, 0x0135);
16309                 MP_WritePhyUshort(sc, 0x06, 0x0201);
16310                 MP_WritePhyUshort(sc, 0x06, 0x4502);
16311                 MP_WritePhyUshort(sc, 0x06, 0x015f);
16312                 MP_WritePhyUshort(sc, 0x06, 0x0280);
16313                 MP_WritePhyUshort(sc, 0x06, 0x6b02);
16314                 MP_WritePhyUshort(sc, 0x06, 0x80e5);
16315                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
16316                 MP_WritePhyUshort(sc, 0x06, 0x88e1);
16317                 MP_WritePhyUshort(sc, 0x06, 0x8b89);
16318                 MP_WritePhyUshort(sc, 0x06, 0x1e01);
16319                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
16320                 MP_WritePhyUshort(sc, 0x06, 0x8a1e);
16321                 MP_WritePhyUshort(sc, 0x06, 0x01e1);
16322                 MP_WritePhyUshort(sc, 0x06, 0x8b8b);
16323                 MP_WritePhyUshort(sc, 0x06, 0x1e01);
16324                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
16325                 MP_WritePhyUshort(sc, 0x06, 0x8c1e);
16326                 MP_WritePhyUshort(sc, 0x06, 0x01e1);
16327                 MP_WritePhyUshort(sc, 0x06, 0x8b8d);
16328                 MP_WritePhyUshort(sc, 0x06, 0x1e01);
16329                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
16330                 MP_WritePhyUshort(sc, 0x06, 0x8e1e);
16331                 MP_WritePhyUshort(sc, 0x06, 0x01a0);
16332                 MP_WritePhyUshort(sc, 0x06, 0x00c7);
16333                 MP_WritePhyUshort(sc, 0x06, 0xaebb);
16334                 MP_WritePhyUshort(sc, 0x06, 0xbf8b);
16335                 MP_WritePhyUshort(sc, 0x06, 0x88ec);
16336                 MP_WritePhyUshort(sc, 0x06, 0x0019);
16337                 MP_WritePhyUshort(sc, 0x06, 0xa98b);
16338                 MP_WritePhyUshort(sc, 0x06, 0x90f9);
16339                 MP_WritePhyUshort(sc, 0x06, 0xeeff);
16340                 MP_WritePhyUshort(sc, 0x06, 0xf600);
16341                 MP_WritePhyUshort(sc, 0x06, 0xeeff);
16342                 MP_WritePhyUshort(sc, 0x06, 0xf7fe);
16343                 MP_WritePhyUshort(sc, 0x06, 0xd100);
16344                 MP_WritePhyUshort(sc, 0x06, 0xbf81);
16345                 MP_WritePhyUshort(sc, 0x06, 0x9802);
16346                 MP_WritePhyUshort(sc, 0x06, 0x39f3);
16347                 MP_WritePhyUshort(sc, 0x06, 0xd101);
16348                 MP_WritePhyUshort(sc, 0x06, 0xbf81);
16349                 MP_WritePhyUshort(sc, 0x06, 0x9b02);
16350                 MP_WritePhyUshort(sc, 0x06, 0x39f3);
16351                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
16352                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
16353                 MP_WritePhyUshort(sc, 0x06, 0x8dad);
16354                 MP_WritePhyUshort(sc, 0x06, 0x2014);
16355                 MP_WritePhyUshort(sc, 0x06, 0xee8b);
16356                 MP_WritePhyUshort(sc, 0x06, 0x8d00);
16357                 MP_WritePhyUshort(sc, 0x06, 0xe08a);
16358                 MP_WritePhyUshort(sc, 0x06, 0x5a78);
16359                 MP_WritePhyUshort(sc, 0x06, 0x039e);
16360                 MP_WritePhyUshort(sc, 0x06, 0x0902);
16361                 MP_WritePhyUshort(sc, 0x06, 0x05fc);
16362                 MP_WritePhyUshort(sc, 0x06, 0x0280);
16363                 MP_WritePhyUshort(sc, 0x06, 0x8802);
16364                 MP_WritePhyUshort(sc, 0x06, 0x32dd);
16365                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
16366                 MP_WritePhyUshort(sc, 0x06, 0xf8f9);
16367                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
16368                 MP_WritePhyUshort(sc, 0x06, 0x81ac);
16369                 MP_WritePhyUshort(sc, 0x06, 0x261a);
16370                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
16371                 MP_WritePhyUshort(sc, 0x06, 0x81ac);
16372                 MP_WritePhyUshort(sc, 0x06, 0x2114);
16373                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
16374                 MP_WritePhyUshort(sc, 0x06, 0x85ac);
16375                 MP_WritePhyUshort(sc, 0x06, 0x200e);
16376                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
16377                 MP_WritePhyUshort(sc, 0x06, 0x85ac);
16378                 MP_WritePhyUshort(sc, 0x06, 0x2308);
16379                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
16380                 MP_WritePhyUshort(sc, 0x06, 0x87ac);
16381                 MP_WritePhyUshort(sc, 0x06, 0x2402);
16382                 MP_WritePhyUshort(sc, 0x06, 0xae38);
16383                 MP_WritePhyUshort(sc, 0x06, 0x021a);
16384                 MP_WritePhyUshort(sc, 0x06, 0xd6ee);
16385                 MP_WritePhyUshort(sc, 0x06, 0xe41c);
16386                 MP_WritePhyUshort(sc, 0x06, 0x04ee);
16387                 MP_WritePhyUshort(sc, 0x06, 0xe41d);
16388                 MP_WritePhyUshort(sc, 0x06, 0x04e2);
16389                 MP_WritePhyUshort(sc, 0x06, 0xe07c);
16390                 MP_WritePhyUshort(sc, 0x06, 0xe3e0);
16391                 MP_WritePhyUshort(sc, 0x06, 0x7de0);
16392                 MP_WritePhyUshort(sc, 0x06, 0xe038);
16393                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
16394                 MP_WritePhyUshort(sc, 0x06, 0x39ad);
16395                 MP_WritePhyUshort(sc, 0x06, 0x2e1b);
16396                 MP_WritePhyUshort(sc, 0x06, 0xad39);
16397                 MP_WritePhyUshort(sc, 0x06, 0x0dd1);
16398                 MP_WritePhyUshort(sc, 0x06, 0x01bf);
16399                 MP_WritePhyUshort(sc, 0x06, 0x22c8);
16400                 MP_WritePhyUshort(sc, 0x06, 0x0239);
16401                 MP_WritePhyUshort(sc, 0x06, 0xf302);
16402                 MP_WritePhyUshort(sc, 0x06, 0x21f0);
16403                 MP_WritePhyUshort(sc, 0x06, 0xae0b);
16404                 MP_WritePhyUshort(sc, 0x06, 0xac38);
16405                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
16406                 MP_WritePhyUshort(sc, 0x06, 0x0602);
16407                 MP_WritePhyUshort(sc, 0x06, 0x222d);
16408                 MP_WritePhyUshort(sc, 0x06, 0x0222);
16409                 MP_WritePhyUshort(sc, 0x06, 0x7202);
16410                 MP_WritePhyUshort(sc, 0x06, 0x1ae7);
16411                 MP_WritePhyUshort(sc, 0x06, 0xfdfc);
16412                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
16413                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
16414                 MP_WritePhyUshort(sc, 0x06, 0x8ead);
16415                 MP_WritePhyUshort(sc, 0x06, 0x201a);
16416                 MP_WritePhyUshort(sc, 0x06, 0xf620);
16417                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
16418                 MP_WritePhyUshort(sc, 0x06, 0x8e02);
16419                 MP_WritePhyUshort(sc, 0x06, 0x2afe);
16420                 MP_WritePhyUshort(sc, 0x06, 0x022c);
16421                 MP_WritePhyUshort(sc, 0x06, 0x5c02);
16422                 MP_WritePhyUshort(sc, 0x06, 0x03c5);
16423                 MP_WritePhyUshort(sc, 0x06, 0x0281);
16424                 MP_WritePhyUshort(sc, 0x06, 0x6702);
16425                 MP_WritePhyUshort(sc, 0x06, 0x2e4f);
16426                 MP_WritePhyUshort(sc, 0x06, 0x0204);
16427                 MP_WritePhyUshort(sc, 0x06, 0x8902);
16428                 MP_WritePhyUshort(sc, 0x06, 0x2f7a);
16429                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
16430                 MP_WritePhyUshort(sc, 0x06, 0x8ead);
16431                 MP_WritePhyUshort(sc, 0x06, 0x210b);
16432                 MP_WritePhyUshort(sc, 0x06, 0xf621);
16433                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
16434                 MP_WritePhyUshort(sc, 0x06, 0x8e02);
16435                 MP_WritePhyUshort(sc, 0x06, 0x0445);
16436                 MP_WritePhyUshort(sc, 0x06, 0x021c);
16437                 MP_WritePhyUshort(sc, 0x06, 0xb8e0);
16438                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16439                 MP_WritePhyUshort(sc, 0x06, 0xad22);
16440                 MP_WritePhyUshort(sc, 0x06, 0x08f6);
16441                 MP_WritePhyUshort(sc, 0x06, 0x22e4);
16442                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16443                 MP_WritePhyUshort(sc, 0x06, 0x0235);
16444                 MP_WritePhyUshort(sc, 0x06, 0xd4e0);
16445                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16446                 MP_WritePhyUshort(sc, 0x06, 0xad23);
16447                 MP_WritePhyUshort(sc, 0x06, 0x08f6);
16448                 MP_WritePhyUshort(sc, 0x06, 0x23e4);
16449                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16450                 MP_WritePhyUshort(sc, 0x06, 0x0231);
16451                 MP_WritePhyUshort(sc, 0x06, 0xc8e0);
16452                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16453                 MP_WritePhyUshort(sc, 0x06, 0xad24);
16454                 MP_WritePhyUshort(sc, 0x06, 0x05f6);
16455                 MP_WritePhyUshort(sc, 0x06, 0x24e4);
16456                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16457                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
16458                 MP_WritePhyUshort(sc, 0x06, 0x8ead);
16459                 MP_WritePhyUshort(sc, 0x06, 0x2505);
16460                 MP_WritePhyUshort(sc, 0x06, 0xf625);
16461                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
16462                 MP_WritePhyUshort(sc, 0x06, 0x8ee0);
16463                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16464                 MP_WritePhyUshort(sc, 0x06, 0xad26);
16465                 MP_WritePhyUshort(sc, 0x06, 0x08f6);
16466                 MP_WritePhyUshort(sc, 0x06, 0x26e4);
16467                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16468                 MP_WritePhyUshort(sc, 0x06, 0x022d);
16469                 MP_WritePhyUshort(sc, 0x06, 0x6ae0);
16470                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16471                 MP_WritePhyUshort(sc, 0x06, 0xad27);
16472                 MP_WritePhyUshort(sc, 0x06, 0x05f6);
16473                 MP_WritePhyUshort(sc, 0x06, 0x27e4);
16474                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16475                 MP_WritePhyUshort(sc, 0x06, 0x0203);
16476                 MP_WritePhyUshort(sc, 0x06, 0x8bfc);
16477                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
16478                 MP_WritePhyUshort(sc, 0x06, 0xfaef);
16479                 MP_WritePhyUshort(sc, 0x06, 0x69e0);
16480                 MP_WritePhyUshort(sc, 0x06, 0x8b80);
16481                 MP_WritePhyUshort(sc, 0x06, 0xad27);
16482                 MP_WritePhyUshort(sc, 0x06, 0x22bf);
16483                 MP_WritePhyUshort(sc, 0x06, 0x479a);
16484                 MP_WritePhyUshort(sc, 0x06, 0x0239);
16485                 MP_WritePhyUshort(sc, 0x06, 0xc6e0);
16486                 MP_WritePhyUshort(sc, 0x06, 0x8b44);
16487                 MP_WritePhyUshort(sc, 0x06, 0x1f01);
16488                 MP_WritePhyUshort(sc, 0x06, 0x9e15);
16489                 MP_WritePhyUshort(sc, 0x06, 0xe58b);
16490                 MP_WritePhyUshort(sc, 0x06, 0x44ad);
16491                 MP_WritePhyUshort(sc, 0x06, 0x2907);
16492                 MP_WritePhyUshort(sc, 0x06, 0xac28);
16493                 MP_WritePhyUshort(sc, 0x06, 0x04d1);
16494                 MP_WritePhyUshort(sc, 0x06, 0x01ae);
16495                 MP_WritePhyUshort(sc, 0x06, 0x02d1);
16496                 MP_WritePhyUshort(sc, 0x06, 0x00bf);
16497                 MP_WritePhyUshort(sc, 0x06, 0x819e);
16498                 MP_WritePhyUshort(sc, 0x06, 0x0239);
16499                 MP_WritePhyUshort(sc, 0x06, 0xf3ef);
16500                 MP_WritePhyUshort(sc, 0x06, 0x96fe);
16501                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
16502                 MP_WritePhyUshort(sc, 0x06, 0x00e1);
16503                 MP_WritePhyUshort(sc, 0x06, 0x4077);
16504                 MP_WritePhyUshort(sc, 0x06, 0xe140);
16505                 MP_WritePhyUshort(sc, 0x06, 0xbbe0);
16506                 MP_WritePhyUshort(sc, 0x06, 0x2a00);
16507                 MP_WritePhyUshort(sc, 0x05, 0xe142);
16508                 Data = MP_ReadPhyUshort(sc, 0x06);
16509                 Data |= BIT_0;
16510                 MP_WritePhyUshort(sc, 0x06, Data);
16511                 MP_WritePhyUshort(sc, 0x05, 0xe140);
16512                 Data = MP_ReadPhyUshort(sc, 0x06);
16513                 Data |= BIT_0;
16514                 MP_WritePhyUshort(sc, 0x06, Data);
16515                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16516                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
16517                 MP_WritePhyUshort(sc, 0x1e, 0x0023);
16518                 Data = MP_ReadPhyUshort(sc, 0x17);
16519                 Data |= BIT_1;
16520                 MP_WritePhyUshort(sc, 0x17, Data);
16521                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16522                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
16523                 Data = MP_ReadPhyUshort(sc, 0x19);
16524                 Data &= ~BIT_0;
16525                 MP_WritePhyUshort(sc, 0x19, Data);
16526                 Data = MP_ReadPhyUshort(sc, 0x10);
16527                 Data &= ~BIT_10;
16528                 MP_WritePhyUshort(sc, 0x10, Data);
16529                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16530                 MP_WritePhyUshort(sc, 0x00, 0x9200);
16531
16532                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
16533                 MP_WritePhyUshort(sc, 0x05, 0x8B80);
16534                 Data = MP_ReadPhyUshort(sc, 0x06);
16535                 Data |= BIT_2 | BIT_1;
16536                 MP_WritePhyUshort(sc, 0x06, Data);
16537                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16538
16539                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
16540                 MP_WritePhyUshort(sc, 0x1E, 0x002D);
16541                 Data = MP_ReadPhyUshort(sc, 0x18);
16542                 Data |= BIT_4;
16543                 MP_WritePhyUshort(sc, 0x18, Data);
16544                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16545                 Data = MP_ReadPhyUshort(sc, 0x14);
16546                 Data |= BIT_15;
16547                 MP_WritePhyUshort(sc, 0x14, Data);
16548
16549                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
16550                 MP_WritePhyUshort(sc, 0x05, 0x8B86);
16551                 Data = MP_ReadPhyUshort(sc, 0x06);
16552                 Data |= BIT_0;
16553                 MP_WritePhyUshort(sc, 0x06, Data);
16554                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16555
16556                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
16557                 MP_WritePhyUshort(sc, 0x05, 0x8B54);
16558                 Data = MP_ReadPhyUshort(sc, 0x06);
16559                 Data &= ~BIT_11;
16560                 MP_WritePhyUshort(sc, 0x06, Data);
16561                 MP_WritePhyUshort(sc, 0x05, 0x8B5D);
16562                 Data = MP_ReadPhyUshort(sc, 0x06);
16563                 Data &= ~BIT_11;
16564                 MP_WritePhyUshort(sc, 0x06, Data);
16565                 MP_WritePhyUshort(sc, 0x05, 0x8A7C);
16566                 Data = MP_ReadPhyUshort(sc, 0x06);
16567                 Data &= ~BIT_8;
16568                 MP_WritePhyUshort(sc, 0x06, Data);
16569                 MP_WritePhyUshort(sc, 0x05, 0x8A7F);
16570                 Data = MP_ReadPhyUshort(sc, 0x06);
16571                 Data |= BIT_8;
16572                 MP_WritePhyUshort(sc, 0x06, Data);
16573                 MP_WritePhyUshort(sc, 0x05, 0x8A82);
16574                 Data = MP_ReadPhyUshort(sc, 0x06);
16575                 Data &= ~BIT_8;
16576                 MP_WritePhyUshort(sc, 0x06, Data);
16577                 MP_WritePhyUshort(sc, 0x05, 0x8A85);
16578                 Data = MP_ReadPhyUshort(sc, 0x06);
16579                 Data &= ~BIT_8;
16580                 MP_WritePhyUshort(sc, 0x06, Data);
16581                 MP_WritePhyUshort(sc, 0x05, 0x8A88);
16582                 Data = MP_ReadPhyUshort(sc, 0x06);
16583                 Data &= ~BIT_8;
16584                 MP_WritePhyUshort(sc, 0x06, Data);
16585                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
16586
16587                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
16588                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
16589                 Data = MP_ReadPhyUshort(sc, 0x06);
16590                 Data |= BIT_15;
16591                 MP_WritePhyUshort(sc, 0x06, Data);
16592                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16593
16594                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
16595                 Data = MP_ReadPhyUshort(sc, 0x19);
16596                 Data &= ~BIT_0;
16597                 MP_WritePhyUshort(sc, 0x19, Data);
16598                 Data = MP_ReadPhyUshort(sc, 0x10);
16599                 Data &= ~BIT_10;
16600                 MP_WritePhyUshort(sc, 0x10, Data);
16601                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16602         } else if (sc->re_type == MACFG_52) {
16603                 Data_u32 = re_eri_read(sc, 0x1D0, 4, ERIAR_ExGMAC);
16604                 Data_u32 &= ~BIT_1;
16605                 re_eri_write(sc, 0x1D0, 4, Data_u32, ERIAR_ExGMAC);
16606
16607                 MP_WritePhyUshort(sc,0x1f, 0x0000);
16608                 MP_WritePhyUshort(sc,0x00, 0x1800);
16609                 Data = MP_ReadPhyUshort(sc, 0x15);
16610                 Data &= ~(BIT_12);
16611                 MP_WritePhyUshort(sc,0x15, Data);
16612                 MP_WritePhyUshort(sc,0x00, 0x4800);
16613                 MP_WritePhyUshort(sc,0x1f, 0x0007);
16614                 MP_WritePhyUshort(sc,0x1e, 0x002f);
16615                 for (i = 0; i < 1000; i++) {
16616                         DELAY(100);
16617                         Data = MP_ReadPhyUshort(sc, 0x1c);
16618                         if (Data & BIT_7)
16619                                 break;
16620                 }
16621                 MP_WritePhyUshort(sc,0x1f, 0x0000);
16622                 MP_WritePhyUshort(sc,0x00, 0x1800);
16623                 MP_WritePhyUshort(sc,0x1f, 0x0007);
16624                 MP_WritePhyUshort(sc,0x1e, 0x0023);
16625                 for (i = 0; i < 200; i++) {
16626                         DELAY(100);
16627                         Data = MP_ReadPhyUshort(sc, 0x18);
16628                         if (!(Data & BIT_0))
16629                                 break;
16630                 }
16631                 MP_WritePhyUshort(sc,0x1f, 0x0005);
16632                 MP_WritePhyUshort(sc,0x05, 0xfff6);
16633                 MP_WritePhyUshort(sc,0x06, 0x0080);
16634                 MP_WritePhyUshort(sc, 0x1f, 0x0007);
16635                 MP_WritePhyUshort(sc, 0x1e, 0x0023);
16636                 MP_WritePhyUshort(sc, 0x16, 0x0306);
16637                 MP_WritePhyUshort(sc, 0x16, 0x0307);
16638                 MP_WritePhyUshort(sc, 0x15, 0x0098);
16639                 MP_WritePhyUshort(sc, 0x19, 0x7c0b);
16640                 MP_WritePhyUshort(sc, 0x15, 0x0099);
16641                 MP_WritePhyUshort(sc, 0x19, 0x6c0b);
16642                 MP_WritePhyUshort(sc, 0x15, 0x00eb);
16643                 MP_WritePhyUshort(sc, 0x19, 0x6c0b);
16644                 MP_WritePhyUshort(sc, 0x15, 0x00f8);
16645                 MP_WritePhyUshort(sc, 0x19, 0x6f0b);
16646                 MP_WritePhyUshort(sc, 0x15, 0x00fe);
16647                 MP_WritePhyUshort(sc, 0x19, 0x6f0f);
16648                 MP_WritePhyUshort(sc, 0x15, 0x00db);
16649                 MP_WritePhyUshort(sc, 0x19, 0x6f09);
16650                 MP_WritePhyUshort(sc, 0x15, 0x00dc);
16651                 MP_WritePhyUshort(sc, 0x19, 0xaefd);
16652                 MP_WritePhyUshort(sc, 0x15, 0x00dd);
16653                 MP_WritePhyUshort(sc, 0x19, 0x6f0b);
16654                 MP_WritePhyUshort(sc, 0x15, 0x00de);
16655                 MP_WritePhyUshort(sc, 0x19, 0xc60b);
16656                 MP_WritePhyUshort(sc, 0x15, 0x00df);
16657                 MP_WritePhyUshort(sc, 0x19, 0x00fa);
16658                 MP_WritePhyUshort(sc, 0x15, 0x00e0);
16659                 MP_WritePhyUshort(sc, 0x19, 0x30e1);
16660                 MP_WritePhyUshort(sc, 0x15, 0x020c);
16661                 MP_WritePhyUshort(sc, 0x19, 0x3224);
16662                 MP_WritePhyUshort(sc, 0x15, 0x020e);
16663                 MP_WritePhyUshort(sc, 0x19, 0x9813);
16664                 MP_WritePhyUshort(sc, 0x15, 0x020f);
16665                 MP_WritePhyUshort(sc, 0x19, 0x7801);
16666                 MP_WritePhyUshort(sc, 0x15, 0x0210);
16667                 MP_WritePhyUshort(sc, 0x19, 0x930f);
16668                 MP_WritePhyUshort(sc, 0x15, 0x0211);
16669                 MP_WritePhyUshort(sc, 0x19, 0x9206);
16670                 MP_WritePhyUshort(sc, 0x15, 0x0212);
16671                 MP_WritePhyUshort(sc, 0x19, 0x4002);
16672                 MP_WritePhyUshort(sc, 0x15, 0x0213);
16673                 MP_WritePhyUshort(sc, 0x19, 0x7800);
16674                 MP_WritePhyUshort(sc, 0x15, 0x0214);
16675                 MP_WritePhyUshort(sc, 0x19, 0x588f);
16676                 MP_WritePhyUshort(sc, 0x15, 0x0215);
16677                 MP_WritePhyUshort(sc, 0x19, 0x5520);
16678                 MP_WritePhyUshort(sc, 0x15, 0x0216);
16679                 MP_WritePhyUshort(sc, 0x19, 0x3224);
16680                 MP_WritePhyUshort(sc, 0x15, 0x0217);
16681                 MP_WritePhyUshort(sc, 0x19, 0x4002);
16682                 MP_WritePhyUshort(sc, 0x15, 0x0218);
16683                 MP_WritePhyUshort(sc, 0x19, 0x7800);
16684                 MP_WritePhyUshort(sc, 0x15, 0x0219);
16685                 MP_WritePhyUshort(sc, 0x19, 0x588d);
16686                 MP_WritePhyUshort(sc, 0x15, 0x021a);
16687                 MP_WritePhyUshort(sc, 0x19, 0x5540);
16688                 MP_WritePhyUshort(sc, 0x15, 0x021b);
16689                 MP_WritePhyUshort(sc, 0x19, 0x9e03);
16690                 MP_WritePhyUshort(sc, 0x15, 0x021c);
16691                 MP_WritePhyUshort(sc, 0x19, 0x7c40);
16692                 MP_WritePhyUshort(sc, 0x15, 0x021d);
16693                 MP_WritePhyUshort(sc, 0x19, 0x6840);
16694                 MP_WritePhyUshort(sc, 0x15, 0x021e);
16695                 MP_WritePhyUshort(sc, 0x19, 0x3224);
16696                 MP_WritePhyUshort(sc, 0x15, 0x021f);
16697                 MP_WritePhyUshort(sc, 0x19, 0x4002);
16698                 MP_WritePhyUshort(sc, 0x15, 0x0220);
16699                 MP_WritePhyUshort(sc, 0x19, 0x3224);
16700                 MP_WritePhyUshort(sc, 0x15, 0x0221);
16701                 MP_WritePhyUshort(sc, 0x19, 0x9e03);
16702                 MP_WritePhyUshort(sc, 0x15, 0x0222);
16703                 MP_WritePhyUshort(sc, 0x19, 0x7c40);
16704                 MP_WritePhyUshort(sc, 0x15, 0x0223);
16705                 MP_WritePhyUshort(sc, 0x19, 0x6840);
16706                 MP_WritePhyUshort(sc, 0x15, 0x0224);
16707                 MP_WritePhyUshort(sc, 0x19, 0x7800);
16708                 MP_WritePhyUshort(sc, 0x15, 0x0225);
16709                 MP_WritePhyUshort(sc, 0x19, 0x3231);
16710                 MP_WritePhyUshort(sc, 0x15, 0x0000);
16711                 MP_WritePhyUshort(sc, 0x16, 0x0306);
16712                 MP_WritePhyUshort(sc, 0x16, 0x0300);
16713                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
16714                 MP_WritePhyUshort(sc, 0x1f, 0x0005);
16715                 MP_WritePhyUshort(sc, 0x05, 0xfff6);
16716                 MP_WritePhyUshort(sc, 0x06, 0x0080);
16717                 MP_WritePhyUshort(sc, 0x05, 0x8000);
16718                 MP_WritePhyUshort(sc, 0x06, 0x0280);
16719                 MP_WritePhyUshort(sc, 0x06, 0x48f7);
16720                 MP_WritePhyUshort(sc, 0x06, 0x00e0);
16721                 MP_WritePhyUshort(sc, 0x06, 0xfff7);
16722                 MP_WritePhyUshort(sc, 0x06, 0xa080);
16723                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
16724                 MP_WritePhyUshort(sc, 0x06, 0xf602);
16725                 MP_WritePhyUshort(sc, 0x06, 0x011e);
16726                 MP_WritePhyUshort(sc, 0x06, 0x0201);
16727                 MP_WritePhyUshort(sc, 0x06, 0x2b02);
16728                 MP_WritePhyUshort(sc, 0x06, 0x8077);
16729                 MP_WritePhyUshort(sc, 0x06, 0x0201);
16730                 MP_WritePhyUshort(sc, 0x06, 0x4802);
16731                 MP_WritePhyUshort(sc, 0x06, 0x0162);
16732                 MP_WritePhyUshort(sc, 0x06, 0x0280);
16733                 MP_WritePhyUshort(sc, 0x06, 0x9402);
16734                 MP_WritePhyUshort(sc, 0x06, 0x810e);
16735                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
16736                 MP_WritePhyUshort(sc, 0x06, 0x88e1);
16737                 MP_WritePhyUshort(sc, 0x06, 0x8b89);
16738                 MP_WritePhyUshort(sc, 0x06, 0x1e01);
16739                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
16740                 MP_WritePhyUshort(sc, 0x06, 0x8a1e);
16741                 MP_WritePhyUshort(sc, 0x06, 0x01e1);
16742                 MP_WritePhyUshort(sc, 0x06, 0x8b8b);
16743                 MP_WritePhyUshort(sc, 0x06, 0x1e01);
16744                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
16745                 MP_WritePhyUshort(sc, 0x06, 0x8c1e);
16746                 MP_WritePhyUshort(sc, 0x06, 0x01e1);
16747                 MP_WritePhyUshort(sc, 0x06, 0x8b8d);
16748                 MP_WritePhyUshort(sc, 0x06, 0x1e01);
16749                 MP_WritePhyUshort(sc, 0x06, 0xe18b);
16750                 MP_WritePhyUshort(sc, 0x06, 0x8e1e);
16751                 MP_WritePhyUshort(sc, 0x06, 0x01a0);
16752                 MP_WritePhyUshort(sc, 0x06, 0x00c7);
16753                 MP_WritePhyUshort(sc, 0x06, 0xaebb);
16754                 MP_WritePhyUshort(sc, 0x06, 0xd481);
16755                 MP_WritePhyUshort(sc, 0x06, 0xd4e4);
16756                 MP_WritePhyUshort(sc, 0x06, 0x8b92);
16757                 MP_WritePhyUshort(sc, 0x06, 0xe58b);
16758                 MP_WritePhyUshort(sc, 0x06, 0x9302);
16759                 MP_WritePhyUshort(sc, 0x06, 0x2e5a);
16760                 MP_WritePhyUshort(sc, 0x06, 0xbf8b);
16761                 MP_WritePhyUshort(sc, 0x06, 0x88ec);
16762                 MP_WritePhyUshort(sc, 0x06, 0x0019);
16763                 MP_WritePhyUshort(sc, 0x06, 0xa98b);
16764                 MP_WritePhyUshort(sc, 0x06, 0x90f9);
16765                 MP_WritePhyUshort(sc, 0x06, 0xeeff);
16766                 MP_WritePhyUshort(sc, 0x06, 0xf600);
16767                 MP_WritePhyUshort(sc, 0x06, 0xeeff);
16768                 MP_WritePhyUshort(sc, 0x06, 0xf7fc);
16769                 MP_WritePhyUshort(sc, 0x06, 0xd100);
16770                 MP_WritePhyUshort(sc, 0x06, 0xbf83);
16771                 MP_WritePhyUshort(sc, 0x06, 0x3c02);
16772                 MP_WritePhyUshort(sc, 0x06, 0x3a21);
16773                 MP_WritePhyUshort(sc, 0x06, 0xd101);
16774                 MP_WritePhyUshort(sc, 0x06, 0xbf83);
16775                 MP_WritePhyUshort(sc, 0x06, 0x3f02);
16776                 MP_WritePhyUshort(sc, 0x06, 0x3a21);
16777                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
16778                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
16779                 MP_WritePhyUshort(sc, 0x06, 0x8aad);
16780                 MP_WritePhyUshort(sc, 0x06, 0x2014);
16781                 MP_WritePhyUshort(sc, 0x06, 0xee8b);
16782                 MP_WritePhyUshort(sc, 0x06, 0x8a00);
16783                 MP_WritePhyUshort(sc, 0x06, 0x0220);
16784                 MP_WritePhyUshort(sc, 0x06, 0x8be0);
16785                 MP_WritePhyUshort(sc, 0x06, 0xe426);
16786                 MP_WritePhyUshort(sc, 0x06, 0xe1e4);
16787                 MP_WritePhyUshort(sc, 0x06, 0x27ee);
16788                 MP_WritePhyUshort(sc, 0x06, 0xe426);
16789                 MP_WritePhyUshort(sc, 0x06, 0x23e5);
16790                 MP_WritePhyUshort(sc, 0x06, 0xe427);
16791                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
16792                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
16793                 MP_WritePhyUshort(sc, 0x06, 0x8b8d);
16794                 MP_WritePhyUshort(sc, 0x06, 0xad20);
16795                 MP_WritePhyUshort(sc, 0x06, 0x14ee);
16796                 MP_WritePhyUshort(sc, 0x06, 0x8b8d);
16797                 MP_WritePhyUshort(sc, 0x06, 0x00e0);
16798                 MP_WritePhyUshort(sc, 0x06, 0x8a5a);
16799                 MP_WritePhyUshort(sc, 0x06, 0x7803);
16800                 MP_WritePhyUshort(sc, 0x06, 0x9e09);
16801                 MP_WritePhyUshort(sc, 0x06, 0x0206);
16802                 MP_WritePhyUshort(sc, 0x06, 0x2802);
16803                 MP_WritePhyUshort(sc, 0x06, 0x80b1);
16804                 MP_WritePhyUshort(sc, 0x06, 0x0232);
16805                 MP_WritePhyUshort(sc, 0x06, 0xfdfc);
16806                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
16807                 MP_WritePhyUshort(sc, 0x06, 0xf9e0);
16808                 MP_WritePhyUshort(sc, 0x06, 0x8b81);
16809                 MP_WritePhyUshort(sc, 0x06, 0xac26);
16810                 MP_WritePhyUshort(sc, 0x06, 0x1ae0);
16811                 MP_WritePhyUshort(sc, 0x06, 0x8b81);
16812                 MP_WritePhyUshort(sc, 0x06, 0xac21);
16813                 MP_WritePhyUshort(sc, 0x06, 0x14e0);
16814                 MP_WritePhyUshort(sc, 0x06, 0x8b85);
16815                 MP_WritePhyUshort(sc, 0x06, 0xac20);
16816                 MP_WritePhyUshort(sc, 0x06, 0x0ee0);
16817                 MP_WritePhyUshort(sc, 0x06, 0x8b85);
16818                 MP_WritePhyUshort(sc, 0x06, 0xac23);
16819                 MP_WritePhyUshort(sc, 0x06, 0x08e0);
16820                 MP_WritePhyUshort(sc, 0x06, 0x8b87);
16821                 MP_WritePhyUshort(sc, 0x06, 0xac24);
16822                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
16823                 MP_WritePhyUshort(sc, 0x06, 0x3802);
16824                 MP_WritePhyUshort(sc, 0x06, 0x1b02);
16825                 MP_WritePhyUshort(sc, 0x06, 0xeee4);
16826                 MP_WritePhyUshort(sc, 0x06, 0x1c04);
16827                 MP_WritePhyUshort(sc, 0x06, 0xeee4);
16828                 MP_WritePhyUshort(sc, 0x06, 0x1d04);
16829                 MP_WritePhyUshort(sc, 0x06, 0xe2e0);
16830                 MP_WritePhyUshort(sc, 0x06, 0x7ce3);
16831                 MP_WritePhyUshort(sc, 0x06, 0xe07d);
16832                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
16833                 MP_WritePhyUshort(sc, 0x06, 0x38e1);
16834                 MP_WritePhyUshort(sc, 0x06, 0xe039);
16835                 MP_WritePhyUshort(sc, 0x06, 0xad2e);
16836                 MP_WritePhyUshort(sc, 0x06, 0x1bad);
16837                 MP_WritePhyUshort(sc, 0x06, 0x390d);
16838                 MP_WritePhyUshort(sc, 0x06, 0xd101);
16839                 MP_WritePhyUshort(sc, 0x06, 0xbf22);
16840                 MP_WritePhyUshort(sc, 0x06, 0xe802);
16841                 MP_WritePhyUshort(sc, 0x06, 0x3a21);
16842                 MP_WritePhyUshort(sc, 0x06, 0x0222);
16843                 MP_WritePhyUshort(sc, 0x06, 0x10ae);
16844                 MP_WritePhyUshort(sc, 0x06, 0x0bac);
16845                 MP_WritePhyUshort(sc, 0x06, 0x3802);
16846                 MP_WritePhyUshort(sc, 0x06, 0xae06);
16847                 MP_WritePhyUshort(sc, 0x06, 0x0222);
16848                 MP_WritePhyUshort(sc, 0x06, 0x4d02);
16849                 MP_WritePhyUshort(sc, 0x06, 0x2292);
16850                 MP_WritePhyUshort(sc, 0x06, 0x021b);
16851                 MP_WritePhyUshort(sc, 0x06, 0x13fd);
16852                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
16853                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
16854                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16855                 MP_WritePhyUshort(sc, 0x06, 0xad20);
16856                 MP_WritePhyUshort(sc, 0x06, 0x1af6);
16857                 MP_WritePhyUshort(sc, 0x06, 0x20e4);
16858                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16859                 MP_WritePhyUshort(sc, 0x06, 0x022b);
16860                 MP_WritePhyUshort(sc, 0x06, 0x1e02);
16861                 MP_WritePhyUshort(sc, 0x06, 0x82ae);
16862                 MP_WritePhyUshort(sc, 0x06, 0x0203);
16863                 MP_WritePhyUshort(sc, 0x06, 0xc002);
16864                 MP_WritePhyUshort(sc, 0x06, 0x827d);
16865                 MP_WritePhyUshort(sc, 0x06, 0x022e);
16866                 MP_WritePhyUshort(sc, 0x06, 0x6f02);
16867                 MP_WritePhyUshort(sc, 0x06, 0x047b);
16868                 MP_WritePhyUshort(sc, 0x06, 0x022f);
16869                 MP_WritePhyUshort(sc, 0x06, 0x9ae0);
16870                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16871                 MP_WritePhyUshort(sc, 0x06, 0xad21);
16872                 MP_WritePhyUshort(sc, 0x06, 0x0bf6);
16873                 MP_WritePhyUshort(sc, 0x06, 0x21e4);
16874                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16875                 MP_WritePhyUshort(sc, 0x06, 0x0281);
16876                 MP_WritePhyUshort(sc, 0x06, 0x9002);
16877                 MP_WritePhyUshort(sc, 0x06, 0x1cd9);
16878                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
16879                 MP_WritePhyUshort(sc, 0x06, 0x8ead);
16880                 MP_WritePhyUshort(sc, 0x06, 0x2208);
16881                 MP_WritePhyUshort(sc, 0x06, 0xf622);
16882                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
16883                 MP_WritePhyUshort(sc, 0x06, 0x8e02);
16884                 MP_WritePhyUshort(sc, 0x06, 0x35f4);
16885                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
16886                 MP_WritePhyUshort(sc, 0x06, 0x8ead);
16887                 MP_WritePhyUshort(sc, 0x06, 0x2308);
16888                 MP_WritePhyUshort(sc, 0x06, 0xf623);
16889                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
16890                 MP_WritePhyUshort(sc, 0x06, 0x8e02);
16891                 MP_WritePhyUshort(sc, 0x06, 0x31e8);
16892                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
16893                 MP_WritePhyUshort(sc, 0x06, 0x8ead);
16894                 MP_WritePhyUshort(sc, 0x06, 0x2405);
16895                 MP_WritePhyUshort(sc, 0x06, 0xf624);
16896                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
16897                 MP_WritePhyUshort(sc, 0x06, 0x8ee0);
16898                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16899                 MP_WritePhyUshort(sc, 0x06, 0xad25);
16900                 MP_WritePhyUshort(sc, 0x06, 0x05f6);
16901                 MP_WritePhyUshort(sc, 0x06, 0x25e4);
16902                 MP_WritePhyUshort(sc, 0x06, 0x8b8e);
16903                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
16904                 MP_WritePhyUshort(sc, 0x06, 0x8ead);
16905                 MP_WritePhyUshort(sc, 0x06, 0x2608);
16906                 MP_WritePhyUshort(sc, 0x06, 0xf626);
16907                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
16908                 MP_WritePhyUshort(sc, 0x06, 0x8e02);
16909                 MP_WritePhyUshort(sc, 0x06, 0x2d8a);
16910                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
16911                 MP_WritePhyUshort(sc, 0x06, 0x8ead);
16912                 MP_WritePhyUshort(sc, 0x06, 0x2705);
16913                 MP_WritePhyUshort(sc, 0x06, 0xf627);
16914                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
16915                 MP_WritePhyUshort(sc, 0x06, 0x8e02);
16916                 MP_WritePhyUshort(sc, 0x06, 0x0386);
16917                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
16918                 MP_WritePhyUshort(sc, 0x06, 0xf8fa);
16919                 MP_WritePhyUshort(sc, 0x06, 0xef69);
16920                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
16921                 MP_WritePhyUshort(sc, 0x06, 0x00e1);
16922                 MP_WritePhyUshort(sc, 0x06, 0xe001);
16923                 MP_WritePhyUshort(sc, 0x06, 0xad27);
16924                 MP_WritePhyUshort(sc, 0x06, 0x32e0);
16925                 MP_WritePhyUshort(sc, 0x06, 0x8b40);
16926                 MP_WritePhyUshort(sc, 0x06, 0xf720);
16927                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
16928                 MP_WritePhyUshort(sc, 0x06, 0x40bf);
16929                 MP_WritePhyUshort(sc, 0x06, 0x32c1);
16930                 MP_WritePhyUshort(sc, 0x06, 0x0239);
16931                 MP_WritePhyUshort(sc, 0x06, 0xf4ad);
16932                 MP_WritePhyUshort(sc, 0x06, 0x2821);
16933                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
16934                 MP_WritePhyUshort(sc, 0x06, 0x20e1);
16935                 MP_WritePhyUshort(sc, 0x06, 0xe021);
16936                 MP_WritePhyUshort(sc, 0x06, 0xad20);
16937                 MP_WritePhyUshort(sc, 0x06, 0x18e0);
16938                 MP_WritePhyUshort(sc, 0x06, 0x8b40);
16939                 MP_WritePhyUshort(sc, 0x06, 0xf620);
16940                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
16941                 MP_WritePhyUshort(sc, 0x06, 0x40ee);
16942                 MP_WritePhyUshort(sc, 0x06, 0x8b3b);
16943                 MP_WritePhyUshort(sc, 0x06, 0xffe0);
16944                 MP_WritePhyUshort(sc, 0x06, 0x8a8a);
16945                 MP_WritePhyUshort(sc, 0x06, 0xe18a);
16946                 MP_WritePhyUshort(sc, 0x06, 0x8be4);
16947                 MP_WritePhyUshort(sc, 0x06, 0xe000);
16948                 MP_WritePhyUshort(sc, 0x06, 0xe5e0);
16949                 MP_WritePhyUshort(sc, 0x06, 0x01ef);
16950                 MP_WritePhyUshort(sc, 0x06, 0x96fe);
16951                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
16952                 MP_WritePhyUshort(sc, 0x06, 0xf8f9);
16953                 MP_WritePhyUshort(sc, 0x06, 0xface);
16954                 MP_WritePhyUshort(sc, 0x06, 0xfaef);
16955                 MP_WritePhyUshort(sc, 0x06, 0x69fa);
16956                 MP_WritePhyUshort(sc, 0x06, 0xd401);
16957                 MP_WritePhyUshort(sc, 0x06, 0x55b4);
16958                 MP_WritePhyUshort(sc, 0x06, 0xfebf);
16959                 MP_WritePhyUshort(sc, 0x06, 0x1c5e);
16960                 MP_WritePhyUshort(sc, 0x06, 0x0239);
16961                 MP_WritePhyUshort(sc, 0x06, 0xf4ac);
16962                 MP_WritePhyUshort(sc, 0x06, 0x280b);
16963                 MP_WritePhyUshort(sc, 0x06, 0xbf1c);
16964                 MP_WritePhyUshort(sc, 0x06, 0x5b02);
16965                 MP_WritePhyUshort(sc, 0x06, 0x39f4);
16966                 MP_WritePhyUshort(sc, 0x06, 0xac28);
16967                 MP_WritePhyUshort(sc, 0x06, 0x49ae);
16968                 MP_WritePhyUshort(sc, 0x06, 0x64bf);
16969                 MP_WritePhyUshort(sc, 0x06, 0x1c5b);
16970                 MP_WritePhyUshort(sc, 0x06, 0x0239);
16971                 MP_WritePhyUshort(sc, 0x06, 0xf4ac);
16972                 MP_WritePhyUshort(sc, 0x06, 0x285b);
16973                 MP_WritePhyUshort(sc, 0x06, 0xd000);
16974                 MP_WritePhyUshort(sc, 0x06, 0x0282);
16975                 MP_WritePhyUshort(sc, 0x06, 0x62ac);
16976                 MP_WritePhyUshort(sc, 0x06, 0x2105);
16977                 MP_WritePhyUshort(sc, 0x06, 0xac22);
16978                 MP_WritePhyUshort(sc, 0x06, 0x02ae);
16979                 MP_WritePhyUshort(sc, 0x06, 0x4ebf);
16980                 MP_WritePhyUshort(sc, 0x06, 0xe0c4);
16981                 MP_WritePhyUshort(sc, 0x06, 0xbe85);
16982                 MP_WritePhyUshort(sc, 0x06, 0xecd2);
16983                 MP_WritePhyUshort(sc, 0x06, 0x04d8);
16984                 MP_WritePhyUshort(sc, 0x06, 0x19d9);
16985                 MP_WritePhyUshort(sc, 0x06, 0x1907);
16986                 MP_WritePhyUshort(sc, 0x06, 0xdc19);
16987                 MP_WritePhyUshort(sc, 0x06, 0xdd19);
16988                 MP_WritePhyUshort(sc, 0x06, 0x0789);
16989                 MP_WritePhyUshort(sc, 0x06, 0x89ef);
16990                 MP_WritePhyUshort(sc, 0x06, 0x645e);
16991                 MP_WritePhyUshort(sc, 0x06, 0x07ff);
16992                 MP_WritePhyUshort(sc, 0x06, 0x0d65);
16993                 MP_WritePhyUshort(sc, 0x06, 0x5cf8);
16994                 MP_WritePhyUshort(sc, 0x06, 0x001e);
16995                 MP_WritePhyUshort(sc, 0x06, 0x46dc);
16996                 MP_WritePhyUshort(sc, 0x06, 0x19dd);
16997                 MP_WritePhyUshort(sc, 0x06, 0x19b2);
16998                 MP_WritePhyUshort(sc, 0x06, 0xe2d4);
16999                 MP_WritePhyUshort(sc, 0x06, 0x0001);
17000                 MP_WritePhyUshort(sc, 0x06, 0xbf1c);
17001                 MP_WritePhyUshort(sc, 0x06, 0x5b02);
17002                 MP_WritePhyUshort(sc, 0x06, 0x3a21);
17003                 MP_WritePhyUshort(sc, 0x06, 0xae1d);
17004                 MP_WritePhyUshort(sc, 0x06, 0xbee0);
17005                 MP_WritePhyUshort(sc, 0x06, 0xc4bf);
17006                 MP_WritePhyUshort(sc, 0x06, 0x85ec);
17007                 MP_WritePhyUshort(sc, 0x06, 0xd204);
17008                 MP_WritePhyUshort(sc, 0x06, 0xd819);
17009                 MP_WritePhyUshort(sc, 0x06, 0xd919);
17010                 MP_WritePhyUshort(sc, 0x06, 0x07dc);
17011                 MP_WritePhyUshort(sc, 0x06, 0x19dd);
17012                 MP_WritePhyUshort(sc, 0x06, 0x1907);
17013                 MP_WritePhyUshort(sc, 0x06, 0xb2f4);
17014                 MP_WritePhyUshort(sc, 0x06, 0xd400);
17015                 MP_WritePhyUshort(sc, 0x06, 0x00bf);
17016                 MP_WritePhyUshort(sc, 0x06, 0x1c5b);
17017                 MP_WritePhyUshort(sc, 0x06, 0x023a);
17018                 MP_WritePhyUshort(sc, 0x06, 0x21fe);
17019                 MP_WritePhyUshort(sc, 0x06, 0xef96);
17020                 MP_WritePhyUshort(sc, 0x06, 0xfec6);
17021                 MP_WritePhyUshort(sc, 0x06, 0xfefd);
17022                 MP_WritePhyUshort(sc, 0x06, 0xfc05);
17023                 MP_WritePhyUshort(sc, 0x06, 0xf9e2);
17024                 MP_WritePhyUshort(sc, 0x06, 0xe0ea);
17025                 MP_WritePhyUshort(sc, 0x06, 0xe3e0);
17026                 MP_WritePhyUshort(sc, 0x06, 0xeb5a);
17027                 MP_WritePhyUshort(sc, 0x06, 0x070c);
17028                 MP_WritePhyUshort(sc, 0x06, 0x031e);
17029                 MP_WritePhyUshort(sc, 0x06, 0x20e6);
17030                 MP_WritePhyUshort(sc, 0x06, 0xe0ea);
17031                 MP_WritePhyUshort(sc, 0x06, 0xe7e0);
17032                 MP_WritePhyUshort(sc, 0x06, 0xebe0);
17033                 MP_WritePhyUshort(sc, 0x06, 0xe0fc);
17034                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
17035                 MP_WritePhyUshort(sc, 0x06, 0xfdfd);
17036                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
17037                 MP_WritePhyUshort(sc, 0x06, 0xfaef);
17038                 MP_WritePhyUshort(sc, 0x06, 0x69e0);
17039                 MP_WritePhyUshort(sc, 0x06, 0x8b80);
17040                 MP_WritePhyUshort(sc, 0x06, 0xad27);
17041                 MP_WritePhyUshort(sc, 0x06, 0x22bf);
17042                 MP_WritePhyUshort(sc, 0x06, 0x47ba);
17043                 MP_WritePhyUshort(sc, 0x06, 0x0239);
17044                 MP_WritePhyUshort(sc, 0x06, 0xf4e0);
17045                 MP_WritePhyUshort(sc, 0x06, 0x8b44);
17046                 MP_WritePhyUshort(sc, 0x06, 0x1f01);
17047                 MP_WritePhyUshort(sc, 0x06, 0x9e15);
17048                 MP_WritePhyUshort(sc, 0x06, 0xe58b);
17049                 MP_WritePhyUshort(sc, 0x06, 0x44ad);
17050                 MP_WritePhyUshort(sc, 0x06, 0x2907);
17051                 MP_WritePhyUshort(sc, 0x06, 0xac28);
17052                 MP_WritePhyUshort(sc, 0x06, 0x04d1);
17053                 MP_WritePhyUshort(sc, 0x06, 0x01ae);
17054                 MP_WritePhyUshort(sc, 0x06, 0x02d1);
17055                 MP_WritePhyUshort(sc, 0x06, 0x00bf);
17056                 MP_WritePhyUshort(sc, 0x06, 0x8342);
17057                 MP_WritePhyUshort(sc, 0x06, 0x023a);
17058                 MP_WritePhyUshort(sc, 0x06, 0x21ef);
17059                 MP_WritePhyUshort(sc, 0x06, 0x96fe);
17060                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
17061                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
17062                 MP_WritePhyUshort(sc, 0x06, 0x8b85);
17063                 MP_WritePhyUshort(sc, 0x06, 0xad26);
17064                 MP_WritePhyUshort(sc, 0x06, 0x30e0);
17065                 MP_WritePhyUshort(sc, 0x06, 0xe036);
17066                 MP_WritePhyUshort(sc, 0x06, 0xe1e0);
17067                 MP_WritePhyUshort(sc, 0x06, 0x37e1);
17068                 MP_WritePhyUshort(sc, 0x06, 0x8b3f);
17069                 MP_WritePhyUshort(sc, 0x06, 0x1f10);
17070                 MP_WritePhyUshort(sc, 0x06, 0x9e23);
17071                 MP_WritePhyUshort(sc, 0x06, 0xe48b);
17072                 MP_WritePhyUshort(sc, 0x06, 0x3fac);
17073                 MP_WritePhyUshort(sc, 0x06, 0x200b);
17074                 MP_WritePhyUshort(sc, 0x06, 0xac21);
17075                 MP_WritePhyUshort(sc, 0x06, 0x0dac);
17076                 MP_WritePhyUshort(sc, 0x06, 0x250f);
17077                 MP_WritePhyUshort(sc, 0x06, 0xac27);
17078                 MP_WritePhyUshort(sc, 0x06, 0x11ae);
17079                 MP_WritePhyUshort(sc, 0x06, 0x1202);
17080                 MP_WritePhyUshort(sc, 0x06, 0x2cb5);
17081                 MP_WritePhyUshort(sc, 0x06, 0xae0d);
17082                 MP_WritePhyUshort(sc, 0x06, 0x0282);
17083                 MP_WritePhyUshort(sc, 0x06, 0xe7ae);
17084                 MP_WritePhyUshort(sc, 0x06, 0x0802);
17085                 MP_WritePhyUshort(sc, 0x06, 0x2cd7);
17086                 MP_WritePhyUshort(sc, 0x06, 0xae03);
17087                 MP_WritePhyUshort(sc, 0x06, 0x022c);
17088                 MP_WritePhyUshort(sc, 0x06, 0xeafc);
17089                 MP_WritePhyUshort(sc, 0x06, 0x04f8);
17090                 MP_WritePhyUshort(sc, 0x06, 0xfaef);
17091                 MP_WritePhyUshort(sc, 0x06, 0x6902);
17092                 MP_WritePhyUshort(sc, 0x06, 0x8304);
17093                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
17094                 MP_WritePhyUshort(sc, 0x06, 0x14e1);
17095                 MP_WritePhyUshort(sc, 0x06, 0xe015);
17096                 MP_WritePhyUshort(sc, 0x06, 0xad26);
17097                 MP_WritePhyUshort(sc, 0x06, 0x08d1);
17098                 MP_WritePhyUshort(sc, 0x06, 0x1ebf);
17099                 MP_WritePhyUshort(sc, 0x06, 0x2d47);
17100                 MP_WritePhyUshort(sc, 0x06, 0x023a);
17101                 MP_WritePhyUshort(sc, 0x06, 0x21ef);
17102                 MP_WritePhyUshort(sc, 0x06, 0x96fe);
17103                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
17104                 MP_WritePhyUshort(sc, 0x06, 0xf8e0);
17105                 MP_WritePhyUshort(sc, 0x06, 0x8b85);
17106                 MP_WritePhyUshort(sc, 0x06, 0xad27);
17107                 MP_WritePhyUshort(sc, 0x06, 0x2fd0);
17108                 MP_WritePhyUshort(sc, 0x06, 0x0b02);
17109                 MP_WritePhyUshort(sc, 0x06, 0x3826);
17110                 MP_WritePhyUshort(sc, 0x06, 0x5882);
17111                 MP_WritePhyUshort(sc, 0x06, 0x7882);
17112                 MP_WritePhyUshort(sc, 0x06, 0x9f24);
17113                 MP_WritePhyUshort(sc, 0x06, 0xe08b);
17114                 MP_WritePhyUshort(sc, 0x06, 0x32e1);
17115                 MP_WritePhyUshort(sc, 0x06, 0x8b33);
17116                 MP_WritePhyUshort(sc, 0x06, 0x1f10);
17117                 MP_WritePhyUshort(sc, 0x06, 0x9e1a);
17118                 MP_WritePhyUshort(sc, 0x06, 0x10e4);
17119                 MP_WritePhyUshort(sc, 0x06, 0x8b32);
17120                 MP_WritePhyUshort(sc, 0x06, 0xe0e0);
17121                 MP_WritePhyUshort(sc, 0x06, 0x28e1);
17122                 MP_WritePhyUshort(sc, 0x06, 0xe029);
17123                 MP_WritePhyUshort(sc, 0x06, 0xf72c);
17124                 MP_WritePhyUshort(sc, 0x06, 0xe4e0);
17125                 MP_WritePhyUshort(sc, 0x06, 0x28e5);
17126                 MP_WritePhyUshort(sc, 0x06, 0xe029);
17127                 MP_WritePhyUshort(sc, 0x06, 0xf62c);
17128                 MP_WritePhyUshort(sc, 0x06, 0xe4e0);
17129                 MP_WritePhyUshort(sc, 0x06, 0x28e5);
17130                 MP_WritePhyUshort(sc, 0x06, 0xe029);
17131                 MP_WritePhyUshort(sc, 0x06, 0xfc04);
17132                 MP_WritePhyUshort(sc, 0x06, 0x00e1);
17133                 MP_WritePhyUshort(sc, 0x06, 0x4077);
17134                 MP_WritePhyUshort(sc, 0x06, 0xe140);
17135                 MP_WritePhyUshort(sc, 0x06, 0xbbe0);
17136                 MP_WritePhyUshort(sc, 0x06, 0x2a00);
17137                 MP_WritePhyUshort(sc, 0x05, 0xe142);
17138                 Data = MP_ReadPhyUshort(sc, 0x06);
17139                 Data |= BIT_0;
17140                 MP_WritePhyUshort(sc,0x06, Data);
17141                 MP_WritePhyUshort(sc, 0x05, 0xe140);
17142                 Data = MP_ReadPhyUshort(sc, 0x06);
17143                 Data |= BIT_0;
17144                 MP_WritePhyUshort(sc,0x06, Data);
17145                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
17146                 MP_WritePhyUshort(sc,0x1f, 0x0005);
17147                 WaitCnt = 0;
17148                 for (i = 0; i < 200; i++) {
17149                         DELAY(100);
17150                         Data = MP_ReadPhyUshort(sc, 0x00);
17151                         if (Data & BIT_7)
17152                                 break;
17153                 }
17154                 MP_WritePhyUshort(sc,0x1f, 0x0007);
17155                 MP_WritePhyUshort(sc,0x1e, 0x0023);
17156                 Data = MP_ReadPhyUshort(sc, 0x17);
17157                 Data |= BIT_1;
17158                 MP_WritePhyUshort(sc, 0x17, Data);
17159                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
17160                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
17161                 MP_WritePhyUshort(sc, 0x09, 0xA20F);
17162                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
17163                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
17164                 MP_WritePhyUshort(sc, 0x01, 0x328A);
17165                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
17166                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
17167                 Data = MP_ReadPhyUshort(sc, 0x19);
17168                 Data &= ~BIT_0;
17169                 MP_WritePhyUshort(sc, 0x19, Data);
17170                 Data = MP_ReadPhyUshort(sc, 0x10);
17171                 Data &= ~BIT_10;
17172                 MP_WritePhyUshort(sc, 0x10, Data);
17173                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
17174                 MP_WritePhyUshort(sc, 0x00, 0x9200);
17175
17176                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
17177                 MP_WritePhyUshort(sc, 0x05, 0x8B80);
17178                 Data = MP_ReadPhyUshort(sc, 0x06);
17179                 Data |= BIT_2 | BIT_1;
17180                 MP_WritePhyUshort(sc, 0x06, Data);
17181                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
17182
17183                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
17184                 MP_WritePhyUshort(sc, 0x1E, 0x002D);
17185                 Data = MP_ReadPhyUshort(sc, 0x18);
17186                 Data |= BIT_4;
17187                 MP_WritePhyUshort(sc, 0x18, Data);
17188                 MP_WritePhyUshort(sc, 0x1f, 0x0002);
17189                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
17190                 Data = MP_ReadPhyUshort(sc, 0x14);
17191                 Data |= BIT_15;
17192                 MP_WritePhyUshort(sc, 0x14, Data);
17193
17194                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
17195                 MP_WritePhyUshort(sc, 0x05, 0x8B86);
17196                 Data = MP_ReadPhyUshort(sc, 0x06);
17197                 Data |= BIT_0;
17198                 MP_WritePhyUshort(sc, 0x06, Data);
17199                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
17200
17201                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
17202                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
17203                 Data = MP_ReadPhyUshort(sc, 0x06);
17204                 Data |= BIT_14;
17205                 MP_WritePhyUshort(sc, 0x06, Data);
17206                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
17207
17208                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
17209                 MP_WritePhyUshort(sc, 0x09, 0xA20F);
17210                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
17211
17212                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
17213                 MP_WritePhyUshort(sc, 0x05, 0x8B55);
17214                 MP_WritePhyUshort(sc, 0x06, 0x0000);
17215                 MP_WritePhyUshort(sc, 0x05, 0x8B5E);
17216                 MP_WritePhyUshort(sc, 0x06, 0x0000);
17217                 MP_WritePhyUshort(sc, 0x05, 0x8B67);
17218                 MP_WritePhyUshort(sc, 0x06, 0x0000);
17219                 MP_WritePhyUshort(sc, 0x05, 0x8B70);
17220                 MP_WritePhyUshort(sc, 0x06, 0x0000);
17221                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
17222                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
17223                 MP_WritePhyUshort(sc, 0x1E, 0x0078);
17224                 MP_WritePhyUshort(sc, 0x17, 0x0000);
17225                 MP_WritePhyUshort(sc, 0x19, 0x00FB);
17226                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
17227
17228                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
17229                 MP_WritePhyUshort(sc, 0x05, 0x8B79);
17230                 MP_WritePhyUshort(sc, 0x06, 0xAA00);
17231                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
17232
17233                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
17234                 MP_WritePhyUshort(sc, 0x01, 0x328A);
17235                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
17236
17237                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
17238                 MP_WritePhyUshort(sc, 0x05, 0x8B54);
17239                 Data = MP_ReadPhyUshort(sc, 0x06);
17240                 Data &= ~BIT_11;
17241                 MP_WritePhyUshort(sc, 0x06, Data);
17242                 MP_WritePhyUshort(sc, 0x05, 0x8B5D);
17243                 Data = MP_ReadPhyUshort(sc, 0x06);
17244                 Data &= ~BIT_11;
17245                 MP_WritePhyUshort(sc, 0x06, Data);
17246                 MP_WritePhyUshort(sc, 0x05, 0x8A7C);
17247                 Data = MP_ReadPhyUshort(sc, 0x06);
17248                 Data &= ~BIT_8;
17249                 MP_WritePhyUshort(sc, 0x06, Data);
17250                 MP_WritePhyUshort(sc, 0x05, 0x8A7F);
17251                 Data = MP_ReadPhyUshort(sc, 0x06);
17252                 Data |= BIT_8;
17253                 MP_WritePhyUshort(sc, 0x06, Data);
17254                 MP_WritePhyUshort(sc, 0x05, 0x8A82);
17255                 Data = MP_ReadPhyUshort(sc, 0x06);
17256                 Data &= ~BIT_8;
17257                 MP_WritePhyUshort(sc, 0x06, Data);
17258                 MP_WritePhyUshort(sc, 0x05, 0x8A85);
17259                 Data = MP_ReadPhyUshort(sc, 0x06);
17260                 Data &= ~BIT_8;
17261                 MP_WritePhyUshort(sc, 0x06, Data);
17262                 MP_WritePhyUshort(sc, 0x05, 0x8A88);
17263                 Data = MP_ReadPhyUshort(sc, 0x06);
17264                 Data &= ~BIT_8;
17265                 MP_WritePhyUshort(sc, 0x06, Data);
17266                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
17267
17268                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
17269                 MP_WritePhyUshort(sc, 0x05, 0x8B85);
17270                 Data = MP_ReadPhyUshort(sc, 0x06);
17271                 Data |= BIT_15;
17272                 MP_WritePhyUshort(sc, 0x06, Data);
17273                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
17274
17275                 MP_WritePhyUshort(sc, 0x1f, 0x0003);
17276                 Data = MP_ReadPhyUshort(sc, 0x19);
17277                 Data &= ~BIT_0;
17278                 MP_WritePhyUshort(sc, 0x19, Data);
17279                 Data = MP_ReadPhyUshort(sc, 0x10);
17280                 Data &= ~BIT_10;
17281                 MP_WritePhyUshort(sc, 0x10, Data);
17282                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
17283         } else if (sc->re_type == MACFG_53) {
17284                 Data_u32 = re_eri_read(sc, 0x1D0, 4, ERIAR_ExGMAC);
17285                 Data_u32 &= 0xFFFF0000;
17286                 re_eri_write(sc, 0x1D0, 4, Data_u32, ERIAR_ExGMAC);
17287
17288                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
17289                 MP_WritePhyUshort(sc, 0x18, 0x0310);
17290                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
17291
17292                 MP_WritePhyUshort(sc, 0x1f, 0x0004);
17293                 MP_WritePhyUshort(sc, 0x1f, 0x0004);
17294                 MP_WritePhyUshort(sc, 0x19, 0x7070);
17295                 MP_WritePhyUshort(sc, 0x1c, 0x0600);
17296                 MP_WritePhyUshort(sc, 0x1d, 0x9700);
17297                 MP_WritePhyUshort(sc, 0x1d, 0x7d00);
17298                 MP_WritePhyUshort(sc, 0x1d, 0x6900);
17299                 MP_WritePhyUshort(sc, 0x1d, 0x7d00);
17300                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
17301                 MP_WritePhyUshort(sc, 0x1d, 0x4899);
17302                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17303                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17304                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17305                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
17306                 MP_WritePhyUshort(sc, 0x1d, 0x8000);
17307                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17308                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17309                 MP_WritePhyUshort(sc, 0x1d, 0x4007);
17310                 MP_WritePhyUshort(sc, 0x1d, 0x4400);
17311                 MP_WritePhyUshort(sc, 0x1d, 0x4800);
17312                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17313                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17314                 MP_WritePhyUshort(sc, 0x1d, 0x5310);
17315                 MP_WritePhyUshort(sc, 0x1d, 0x6000);
17316                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
17317                 MP_WritePhyUshort(sc, 0x1d, 0x6736);
17318                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17319                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17320                 MP_WritePhyUshort(sc, 0x1d, 0x571f);
17321                 MP_WritePhyUshort(sc, 0x1d, 0x5ffb);
17322                 MP_WritePhyUshort(sc, 0x1d, 0xaa03);
17323                 MP_WritePhyUshort(sc, 0x1d, 0x5b58);
17324                 MP_WritePhyUshort(sc, 0x1d, 0x301e);
17325                 MP_WritePhyUshort(sc, 0x1d, 0x5b64);
17326                 MP_WritePhyUshort(sc, 0x1d, 0xa6fc);
17327                 MP_WritePhyUshort(sc, 0x1d, 0xdcdb);
17328                 MP_WritePhyUshort(sc, 0x1d, 0x0015);
17329                 MP_WritePhyUshort(sc, 0x1d, 0xb915);
17330                 MP_WritePhyUshort(sc, 0x1d, 0xb511);
17331                 MP_WritePhyUshort(sc, 0x1d, 0xd16b);
17332                 MP_WritePhyUshort(sc, 0x1d, 0x000f);
17333                 MP_WritePhyUshort(sc, 0x1d, 0xb40f);
17334                 MP_WritePhyUshort(sc, 0x1d, 0xd06b);
17335                 MP_WritePhyUshort(sc, 0x1d, 0x000d);
17336                 MP_WritePhyUshort(sc, 0x1d, 0xb206);
17337                 MP_WritePhyUshort(sc, 0x1d, 0x7c01);
17338                 MP_WritePhyUshort(sc, 0x1d, 0x5800);
17339                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
17340                 MP_WritePhyUshort(sc, 0x1d, 0x5c00);
17341                 MP_WritePhyUshort(sc, 0x1d, 0x301a);
17342                 MP_WritePhyUshort(sc, 0x1d, 0x7c01);
17343                 MP_WritePhyUshort(sc, 0x1d, 0x5801);
17344                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
17345                 MP_WritePhyUshort(sc, 0x1d, 0x5c04);
17346                 MP_WritePhyUshort(sc, 0x1d, 0x301e);
17347                 MP_WritePhyUshort(sc, 0x1d, 0x3079);
17348                 MP_WritePhyUshort(sc, 0x1d, 0x30f1);
17349                 MP_WritePhyUshort(sc, 0x1d, 0x3199);
17350                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17351                 MP_WritePhyUshort(sc, 0x1d, 0x4c60);
17352                 MP_WritePhyUshort(sc, 0x1d, 0x6803);
17353                 MP_WritePhyUshort(sc, 0x1d, 0x6420);
17354                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17355                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17356                 MP_WritePhyUshort(sc, 0x1d, 0xaf03);
17357                 MP_WritePhyUshort(sc, 0x1d, 0x6015);
17358                 MP_WritePhyUshort(sc, 0x1d, 0x3040);
17359                 MP_WritePhyUshort(sc, 0x1d, 0x6017);
17360                 MP_WritePhyUshort(sc, 0x1d, 0x57e0);
17361                 MP_WritePhyUshort(sc, 0x1d, 0x580c);
17362                 MP_WritePhyUshort(sc, 0x1d, 0x588c);
17363                 MP_WritePhyUshort(sc, 0x1d, 0x5fa3);
17364                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17365                 MP_WritePhyUshort(sc, 0x1d, 0x4827);
17366                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17367                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17368                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17369                 MP_WritePhyUshort(sc, 0x1d, 0x4c10);
17370                 MP_WritePhyUshort(sc, 0x1d, 0x8400);
17371                 MP_WritePhyUshort(sc, 0x1d, 0x7c30);
17372                 MP_WritePhyUshort(sc, 0x1d, 0x6020);
17373                 MP_WritePhyUshort(sc, 0x1d, 0x48bf);
17374                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17375                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17376                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17377                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
17378                 MP_WritePhyUshort(sc, 0x1d, 0xd6cf);
17379                 MP_WritePhyUshort(sc, 0x1d, 0x0002);
17380                 MP_WritePhyUshort(sc, 0x1d, 0x80fe);
17381                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17382                 MP_WritePhyUshort(sc, 0x1d, 0x4c80);
17383                 MP_WritePhyUshort(sc, 0x1d, 0x7c20);
17384                 MP_WritePhyUshort(sc, 0x1d, 0x5c20);
17385                 MP_WritePhyUshort(sc, 0x1d, 0x481e);
17386                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17387                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17388                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17389                 MP_WritePhyUshort(sc, 0x1d, 0x4c02);
17390                 MP_WritePhyUshort(sc, 0x1d, 0x5310);
17391                 MP_WritePhyUshort(sc, 0x1d, 0x81ff);
17392                 MP_WritePhyUshort(sc, 0x1d, 0x30ba);
17393                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17394                 MP_WritePhyUshort(sc, 0x1d, 0x4d00);
17395                 MP_WritePhyUshort(sc, 0x1d, 0x4832);
17396                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17397                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17398                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17399                 MP_WritePhyUshort(sc, 0x1d, 0x4c10);
17400                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
17401                 MP_WritePhyUshort(sc, 0x1d, 0x6000);
17402                 MP_WritePhyUshort(sc, 0x1d, 0xa4cc);
17403                 MP_WritePhyUshort(sc, 0x1d, 0xd9b3);
17404                 MP_WritePhyUshort(sc, 0x1d, 0xfffe);
17405                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17406                 MP_WritePhyUshort(sc, 0x1d, 0x4d20);
17407                 MP_WritePhyUshort(sc, 0x1d, 0x7e00);
17408                 MP_WritePhyUshort(sc, 0x1d, 0x6200);
17409                 MP_WritePhyUshort(sc, 0x1d, 0x300b);
17410                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17411                 MP_WritePhyUshort(sc, 0x1d, 0x4dc0);
17412                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17413                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17414                 MP_WritePhyUshort(sc, 0x1d, 0xd09d);
17415                 MP_WritePhyUshort(sc, 0x1d, 0x0002);
17416                 MP_WritePhyUshort(sc, 0x1d, 0xb4fe);
17417                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17418                 MP_WritePhyUshort(sc, 0x1d, 0x4d80);
17419                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
17420                 MP_WritePhyUshort(sc, 0x1d, 0x6004);
17421                 MP_WritePhyUshort(sc, 0x1d, 0x5310);
17422                 MP_WritePhyUshort(sc, 0x1d, 0x6802);
17423                 MP_WritePhyUshort(sc, 0x1d, 0x6720);
17424                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17425                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17426                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
17427                 MP_WritePhyUshort(sc, 0x1d, 0x6000);
17428                 MP_WritePhyUshort(sc, 0x1d, 0x486c);
17429                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17430                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17431                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17432                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
17433                 MP_WritePhyUshort(sc, 0x1d, 0x9503);
17434                 MP_WritePhyUshort(sc, 0x1d, 0x7e00);
17435                 MP_WritePhyUshort(sc, 0x1d, 0x6200);
17436                 MP_WritePhyUshort(sc, 0x1d, 0x571f);
17437                 MP_WritePhyUshort(sc, 0x1d, 0x5fbb);
17438                 MP_WritePhyUshort(sc, 0x1d, 0xaa03);
17439                 MP_WritePhyUshort(sc, 0x1d, 0x5b58);
17440                 MP_WritePhyUshort(sc, 0x1d, 0x3092);
17441                 MP_WritePhyUshort(sc, 0x1d, 0x5b64);
17442                 MP_WritePhyUshort(sc, 0x1d, 0xcdab);
17443                 MP_WritePhyUshort(sc, 0x1d, 0xff78);
17444                 MP_WritePhyUshort(sc, 0x1d, 0xcd8d);
17445                 MP_WritePhyUshort(sc, 0x1d, 0xff76);
17446                 MP_WritePhyUshort(sc, 0x1d, 0xd96b);
17447                 MP_WritePhyUshort(sc, 0x1d, 0xff74);
17448                 MP_WritePhyUshort(sc, 0x1d, 0xd0a0);
17449                 MP_WritePhyUshort(sc, 0x1d, 0xffd9);
17450                 MP_WritePhyUshort(sc, 0x1d, 0xcba0);
17451                 MP_WritePhyUshort(sc, 0x1d, 0x0003);
17452                 MP_WritePhyUshort(sc, 0x1d, 0x80f0);
17453                 MP_WritePhyUshort(sc, 0x1d, 0x309f);
17454                 MP_WritePhyUshort(sc, 0x1d, 0x30ac);
17455                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17456                 MP_WritePhyUshort(sc, 0x1d, 0x4ce0);
17457                 MP_WritePhyUshort(sc, 0x1d, 0x4832);
17458                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17459                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17460                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17461                 MP_WritePhyUshort(sc, 0x1d, 0x4c08);
17462                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
17463                 MP_WritePhyUshort(sc, 0x1d, 0x6008);
17464                 MP_WritePhyUshort(sc, 0x1d, 0x8300);
17465                 MP_WritePhyUshort(sc, 0x1d, 0xb902);
17466                 MP_WritePhyUshort(sc, 0x1d, 0x3079);
17467                 MP_WritePhyUshort(sc, 0x1d, 0x3061);
17468                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17469                 MP_WritePhyUshort(sc, 0x1d, 0x4da0);
17470                 MP_WritePhyUshort(sc, 0x1d, 0x6400);
17471                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17472                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17473                 MP_WritePhyUshort(sc, 0x1d, 0x57a0);
17474                 MP_WritePhyUshort(sc, 0x1d, 0x590c);
17475                 MP_WritePhyUshort(sc, 0x1d, 0x5fa3);
17476                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17477                 MP_WritePhyUshort(sc, 0x1d, 0xcba4);
17478                 MP_WritePhyUshort(sc, 0x1d, 0x0004);
17479                 MP_WritePhyUshort(sc, 0x1d, 0xcd8d);
17480                 MP_WritePhyUshort(sc, 0x1d, 0x0002);
17481                 MP_WritePhyUshort(sc, 0x1d, 0x80fc);
17482                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17483                 MP_WritePhyUshort(sc, 0x1d, 0x4ca0);
17484                 MP_WritePhyUshort(sc, 0x1d, 0xb603);
17485                 MP_WritePhyUshort(sc, 0x1d, 0x7c10);
17486                 MP_WritePhyUshort(sc, 0x1d, 0x6010);
17487                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17488                 MP_WritePhyUshort(sc, 0x1d, 0x541f);
17489                 MP_WritePhyUshort(sc, 0x1d, 0x5fb3);
17490                 MP_WritePhyUshort(sc, 0x1d, 0xaa05);
17491                 MP_WritePhyUshort(sc, 0x1d, 0x7c80);
17492                 MP_WritePhyUshort(sc, 0x1d, 0x5800);
17493                 MP_WritePhyUshort(sc, 0x1d, 0x5b58);
17494                 MP_WritePhyUshort(sc, 0x1d, 0x30ca);
17495                 MP_WritePhyUshort(sc, 0x1d, 0x7c80);
17496                 MP_WritePhyUshort(sc, 0x1d, 0x5800);
17497                 MP_WritePhyUshort(sc, 0x1d, 0x5b64);
17498                 MP_WritePhyUshort(sc, 0x1d, 0x4824);
17499                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17500                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17501                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17502                 MP_WritePhyUshort(sc, 0x1d, 0x4c04);
17503                 MP_WritePhyUshort(sc, 0x1d, 0x8200);
17504                 MP_WritePhyUshort(sc, 0x1d, 0x4827);
17505                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17506                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17507                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17508                 MP_WritePhyUshort(sc, 0x1d, 0x4c10);
17509                 MP_WritePhyUshort(sc, 0x1d, 0x8400);
17510                 MP_WritePhyUshort(sc, 0x1d, 0x7c10);
17511                 MP_WritePhyUshort(sc, 0x1d, 0x6000);
17512                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17513                 MP_WritePhyUshort(sc, 0x1d, 0x4cc0);
17514                 MP_WritePhyUshort(sc, 0x1d, 0x5fbb);
17515                 MP_WritePhyUshort(sc, 0x1d, 0x4824);
17516                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17517                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17518                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17519                 MP_WritePhyUshort(sc, 0x1d, 0x4c04);
17520                 MP_WritePhyUshort(sc, 0x1d, 0x8200);
17521                 MP_WritePhyUshort(sc, 0x1d, 0x7ce0);
17522                 MP_WritePhyUshort(sc, 0x1d, 0x5400);
17523                 MP_WritePhyUshort(sc, 0x1d, 0x6720);
17524                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17525                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17526                 MP_WritePhyUshort(sc, 0x1d, 0x7e00);
17527                 MP_WritePhyUshort(sc, 0x1d, 0x6a00);
17528                 MP_WritePhyUshort(sc, 0x1d, 0x4824);
17529                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17530                 MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17531                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17532                 MP_WritePhyUshort(sc, 0x1d, 0x4c04);
17533                 MP_WritePhyUshort(sc, 0x1d, 0x8200);
17534                 MP_WritePhyUshort(sc, 0x1d, 0x7e00);
17535                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
17536                 MP_WritePhyUshort(sc, 0x1d, 0x309f);
17537                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17538                 MP_WritePhyUshort(sc, 0x1d, 0x4e00);
17539                 MP_WritePhyUshort(sc, 0x1d, 0x4007);
17540                 MP_WritePhyUshort(sc, 0x1d, 0x4400);
17541                 MP_WritePhyUshort(sc, 0x1d, 0x5310);
17542                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
17543                 MP_WritePhyUshort(sc, 0x1d, 0x6736);
17544                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17545                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17546                 MP_WritePhyUshort(sc, 0x1d, 0x570f);
17547                 MP_WritePhyUshort(sc, 0x1d, 0x5fff);
17548                 MP_WritePhyUshort(sc, 0x1d, 0xaa03);
17549                 MP_WritePhyUshort(sc, 0x1d, 0x585b);
17550                 MP_WritePhyUshort(sc, 0x1d, 0x3100);
17551                 MP_WritePhyUshort(sc, 0x1d, 0x5867);
17552                 MP_WritePhyUshort(sc, 0x1d, 0x9403);
17553                 MP_WritePhyUshort(sc, 0x1d, 0x7e00);
17554                 MP_WritePhyUshort(sc, 0x1d, 0x6200);
17555                 MP_WritePhyUshort(sc, 0x1d, 0xcda3);
17556                 MP_WritePhyUshort(sc, 0x1d, 0x002d);
17557                 MP_WritePhyUshort(sc, 0x1d, 0xcd85);
17558                 MP_WritePhyUshort(sc, 0x1d, 0x002b);
17559                 MP_WritePhyUshort(sc, 0x1d, 0xd96b);
17560                 MP_WritePhyUshort(sc, 0x1d, 0x0029);
17561                 MP_WritePhyUshort(sc, 0x1d, 0x9629);
17562                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
17563                 MP_WritePhyUshort(sc, 0x1d, 0x6736);
17564                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17565                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17566                 MP_WritePhyUshort(sc, 0x1d, 0x9624);
17567                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17568                 MP_WritePhyUshort(sc, 0x1d, 0x4e20);
17569                 MP_WritePhyUshort(sc, 0x1d, 0x8b04);
17570                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
17571                 MP_WritePhyUshort(sc, 0x1d, 0x5008);
17572                 MP_WritePhyUshort(sc, 0x1d, 0xab03);
17573                 MP_WritePhyUshort(sc, 0x1d, 0x7c08);
17574                 MP_WritePhyUshort(sc, 0x1d, 0x5000);
17575                 MP_WritePhyUshort(sc, 0x1d, 0x6801);
17576                 MP_WritePhyUshort(sc, 0x1d, 0x6776);
17577                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17578                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17579                 MP_WritePhyUshort(sc, 0x1d, 0xdb7c);
17580                 MP_WritePhyUshort(sc, 0x1d, 0xffee);
17581                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17582                 MP_WritePhyUshort(sc, 0x1d, 0x7fe1);
17583                 MP_WritePhyUshort(sc, 0x1d, 0x4e40);
17584                 MP_WritePhyUshort(sc, 0x1d, 0x4837);
17585                 MP_WritePhyUshort(sc, 0x1d, 0x4418);
17586                 MP_WritePhyUshort(sc, 0x1d, 0x41c7);
17587                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17588                 MP_WritePhyUshort(sc, 0x1d, 0x4e40);
17589                 MP_WritePhyUshort(sc, 0x1d, 0x7c40);
17590                 MP_WritePhyUshort(sc, 0x1d, 0x5400);
17591                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17592                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
17593                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17594                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
17595                 MP_WritePhyUshort(sc, 0x1d, 0x8f07);
17596                 MP_WritePhyUshort(sc, 0x1d, 0xd2a0);
17597                 MP_WritePhyUshort(sc, 0x1d, 0x004c);
17598                 MP_WritePhyUshort(sc, 0x1d, 0x9205);
17599                 MP_WritePhyUshort(sc, 0x1d, 0xa043);
17600                 MP_WritePhyUshort(sc, 0x1d, 0x312b);
17601                 MP_WritePhyUshort(sc, 0x1d, 0x300b);
17602                 MP_WritePhyUshort(sc, 0x1d, 0x30f1);
17603                 MP_WritePhyUshort(sc, 0x1d, 0x7fe1);
17604                 MP_WritePhyUshort(sc, 0x1d, 0x4e60);
17605                 MP_WritePhyUshort(sc, 0x1d, 0x489c);
17606                 MP_WritePhyUshort(sc, 0x1d, 0x4628);
17607                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17608                 MP_WritePhyUshort(sc, 0x1d, 0x4e60);
17609                 MP_WritePhyUshort(sc, 0x1d, 0x7e28);
17610                 MP_WritePhyUshort(sc, 0x1d, 0x4628);
17611                 MP_WritePhyUshort(sc, 0x1d, 0x7c40);
17612                 MP_WritePhyUshort(sc, 0x1d, 0x5400);
17613                 MP_WritePhyUshort(sc, 0x1d, 0x7c01);
17614                 MP_WritePhyUshort(sc, 0x1d, 0x5800);
17615                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
17616                 MP_WritePhyUshort(sc, 0x1d, 0x5c00);
17617                 MP_WritePhyUshort(sc, 0x1d, 0x41e8);
17618                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17619                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
17620                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17621                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
17622                 MP_WritePhyUshort(sc, 0x1d, 0x8fec);
17623                 MP_WritePhyUshort(sc, 0x1d, 0xb241);
17624                 MP_WritePhyUshort(sc, 0x1d, 0xa02a);
17625                 MP_WritePhyUshort(sc, 0x1d, 0x3146);
17626                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17627                 MP_WritePhyUshort(sc, 0x1d, 0x4ea0);
17628                 MP_WritePhyUshort(sc, 0x1d, 0x7c02);
17629                 MP_WritePhyUshort(sc, 0x1d, 0x4402);
17630                 MP_WritePhyUshort(sc, 0x1d, 0x4448);
17631                 MP_WritePhyUshort(sc, 0x1d, 0x4894);
17632                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17633                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
17634                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17635                 MP_WritePhyUshort(sc, 0x1d, 0x4c03);
17636                 MP_WritePhyUshort(sc, 0x1d, 0x4824);
17637                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17638                 MP_WritePhyUshort(sc, 0x1d, 0x4c07);
17639                 MP_WritePhyUshort(sc, 0x1d, 0x41ef);
17640                 MP_WritePhyUshort(sc, 0x1d, 0x41ff);
17641                 MP_WritePhyUshort(sc, 0x1d, 0x4891);
17642                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17643                 MP_WritePhyUshort(sc, 0x1d, 0x4c07);
17644                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17645                 MP_WritePhyUshort(sc, 0x1d, 0x4c17);
17646                 MP_WritePhyUshort(sc, 0x1d, 0x8400);
17647                 MP_WritePhyUshort(sc, 0x1d, 0x8ef8);
17648                 MP_WritePhyUshort(sc, 0x1d, 0x41c7);
17649                 MP_WritePhyUshort(sc, 0x1d, 0x8fd1);
17650                 MP_WritePhyUshort(sc, 0x1d, 0x92d5);
17651                 MP_WritePhyUshort(sc, 0x1d, 0xa10f);
17652                 MP_WritePhyUshort(sc, 0x1d, 0xd480);
17653                 MP_WritePhyUshort(sc, 0x1d, 0x0008);
17654                 MP_WritePhyUshort(sc, 0x1d, 0xd580);
17655                 MP_WritePhyUshort(sc, 0x1d, 0xffb7);
17656                 MP_WritePhyUshort(sc, 0x1d, 0xa202);
17657                 MP_WritePhyUshort(sc, 0x1d, 0x3161);
17658                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
17659                 MP_WritePhyUshort(sc, 0x1d, 0x4404);
17660                 MP_WritePhyUshort(sc, 0x1d, 0x3161);
17661                 MP_WritePhyUshort(sc, 0x1d, 0xd484);
17662                 MP_WritePhyUshort(sc, 0x1d, 0xfff3);
17663                 MP_WritePhyUshort(sc, 0x1d, 0xd484);
17664                 MP_WritePhyUshort(sc, 0x1d, 0xfff1);
17665                 MP_WritePhyUshort(sc, 0x1d, 0x30f1);
17666                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17667                 MP_WritePhyUshort(sc, 0x1d, 0x4ee0);
17668                 MP_WritePhyUshort(sc, 0x1d, 0x7c40);
17669                 MP_WritePhyUshort(sc, 0x1d, 0x5400);
17670                 MP_WritePhyUshort(sc, 0x1d, 0x4488);
17671                 MP_WritePhyUshort(sc, 0x1d, 0x41cf);
17672                 MP_WritePhyUshort(sc, 0x1d, 0x30f1);
17673                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17674                 MP_WritePhyUshort(sc, 0x1d, 0x4ec0);
17675                 MP_WritePhyUshort(sc, 0x1d, 0x48f3);
17676                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17677                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
17678                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17679                 MP_WritePhyUshort(sc, 0x1d, 0x4c09);
17680                 MP_WritePhyUshort(sc, 0x1d, 0x4508);
17681                 MP_WritePhyUshort(sc, 0x1d, 0x41c7);
17682                 MP_WritePhyUshort(sc, 0x1d, 0x8fb0);
17683                 MP_WritePhyUshort(sc, 0x1d, 0xd218);
17684                 MP_WritePhyUshort(sc, 0x1d, 0xffae);
17685                 MP_WritePhyUshort(sc, 0x1d, 0xd2a4);
17686                 MP_WritePhyUshort(sc, 0x1d, 0xff9d);
17687                 MP_WritePhyUshort(sc, 0x1d, 0x3182);
17688                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17689                 MP_WritePhyUshort(sc, 0x1d, 0x4e80);
17690                 MP_WritePhyUshort(sc, 0x1d, 0x4832);
17691                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17692                 MP_WritePhyUshort(sc, 0x1d, 0x4c01);
17693                 MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17694                 MP_WritePhyUshort(sc, 0x1d, 0x4c11);
17695                 MP_WritePhyUshort(sc, 0x1d, 0x4428);
17696                 MP_WritePhyUshort(sc, 0x1d, 0x7c40);
17697                 MP_WritePhyUshort(sc, 0x1d, 0x5440);
17698                 MP_WritePhyUshort(sc, 0x1d, 0x7c01);
17699                 MP_WritePhyUshort(sc, 0x1d, 0x5801);
17700                 MP_WritePhyUshort(sc, 0x1d, 0x7c04);
17701                 MP_WritePhyUshort(sc, 0x1d, 0x5c04);
17702                 MP_WritePhyUshort(sc, 0x1d, 0x41e8);
17703                 MP_WritePhyUshort(sc, 0x1d, 0xa4b3);
17704                 MP_WritePhyUshort(sc, 0x1d, 0x3197);
17705                 MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17706                 MP_WritePhyUshort(sc, 0x1d, 0x4f20);
17707                 MP_WritePhyUshort(sc, 0x1d, 0x6800);
17708                 MP_WritePhyUshort(sc, 0x1d, 0x6736);
17709                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17710                 MP_WritePhyUshort(sc, 0x1d, 0x0000);
17711                 MP_WritePhyUshort(sc, 0x1d, 0x570f);
17712                 MP_WritePhyUshort(sc, 0x1d, 0x5fff);
17713                 MP_WritePhyUshort(sc, 0x1d, 0xaa03);
17714                 MP_WritePhyUshort(sc, 0x1d, 0x585b);
17715                 MP_WritePhyUshort(sc, 0x1d, 0x31a5);
17716                 MP_WritePhyUshort(sc, 0x1d, 0x5867);
17717                 MP_WritePhyUshort(sc, 0x1d, 0xbcf4);
17718                 MP_WritePhyUshort(sc, 0x1d, 0x300b);
17719                 MP_WritePhyUshort(sc, 0x1f, 0x0004);
17720                 MP_WritePhyUshort(sc, 0x1c, 0x0200);
17721                 MP_WritePhyUshort(sc, 0x19, 0x7030);
17722                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
17723
17724                 if (phy_power_saving == 1) {
17725                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
17726                         MP_WritePhyUshort(sc, 0x18, 0x8310);
17727                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
17728                 } else {
17729                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
17730                         MP_WritePhyUshort(sc, 0x18, 0x0310);
17731                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
17732                         DELAY(20000);
17733                 }
17734
17735                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
17736                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
17737                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
17738                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
17739                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
17740                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
17741         } else if (sc->re_type == MACFG_54 || sc->re_type == MACFG_55) {
17742                 Data_u32 = re_eri_read(sc, 0x1D0, 4, ERIAR_ExGMAC);
17743                 Data_u32 &= 0xFFFF0000;
17744                 re_eri_write(sc, 0x1D0, 4, Data_u32, ERIAR_ExGMAC);
17745
17746                 if (sc->re_type == MACFG_55) {
17747                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
17748                         MP_WritePhyUshort(sc, 0x18, 0x0310);
17749                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
17750
17751                         MP_WritePhyUshort(sc, 0x1f, 0x0004);
17752                         MP_WritePhyUshort(sc, 0x1f, 0x0004);
17753                         MP_WritePhyUshort(sc, 0x19, 0x7070);
17754                         MP_WritePhyUshort(sc, 0x1c, 0x0600);
17755                         MP_WritePhyUshort(sc, 0x1d, 0x9700);
17756                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17757                         MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17758                         MP_WritePhyUshort(sc, 0x1d, 0x4007);
17759                         MP_WritePhyUshort(sc, 0x1d, 0x4400);
17760                         MP_WritePhyUshort(sc, 0x1d, 0x4800);
17761                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17762                         MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17763                         MP_WritePhyUshort(sc, 0x1d, 0x5310);
17764                         MP_WritePhyUshort(sc, 0x1d, 0x6000);
17765                         MP_WritePhyUshort(sc, 0x1d, 0x6800);
17766                         MP_WritePhyUshort(sc, 0x1d, 0x673e);
17767                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
17768                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
17769                         MP_WritePhyUshort(sc, 0x1d, 0x571f);
17770                         MP_WritePhyUshort(sc, 0x1d, 0x5ffb);
17771                         MP_WritePhyUshort(sc, 0x1d, 0xaa04);
17772                         MP_WritePhyUshort(sc, 0x1d, 0x5b58);
17773                         MP_WritePhyUshort(sc, 0x1d, 0x6100);
17774                         MP_WritePhyUshort(sc, 0x1d, 0x3016);
17775                         MP_WritePhyUshort(sc, 0x1d, 0x5b64);
17776                         MP_WritePhyUshort(sc, 0x1d, 0x6080);
17777                         MP_WritePhyUshort(sc, 0x1d, 0xa6fa);
17778                         MP_WritePhyUshort(sc, 0x1d, 0xdcdb);
17779                         MP_WritePhyUshort(sc, 0x1d, 0x0015);
17780                         MP_WritePhyUshort(sc, 0x1d, 0xb915);
17781                         MP_WritePhyUshort(sc, 0x1d, 0xb511);
17782                         MP_WritePhyUshort(sc, 0x1d, 0xd16b);
17783                         MP_WritePhyUshort(sc, 0x1d, 0x000f);
17784                         MP_WritePhyUshort(sc, 0x1d, 0xb40f);
17785                         MP_WritePhyUshort(sc, 0x1d, 0xd06b);
17786                         MP_WritePhyUshort(sc, 0x1d, 0x000d);
17787                         MP_WritePhyUshort(sc, 0x1d, 0xb206);
17788                         MP_WritePhyUshort(sc, 0x1d, 0x7c01);
17789                         MP_WritePhyUshort(sc, 0x1d, 0x5800);
17790                         MP_WritePhyUshort(sc, 0x1d, 0x7c04);
17791                         MP_WritePhyUshort(sc, 0x1d, 0x5c00);
17792                         MP_WritePhyUshort(sc, 0x1d, 0x3010);
17793                         MP_WritePhyUshort(sc, 0x1d, 0x7c01);
17794                         MP_WritePhyUshort(sc, 0x1d, 0x5801);
17795                         MP_WritePhyUshort(sc, 0x1d, 0x7c04);
17796                         MP_WritePhyUshort(sc, 0x1d, 0x5c04);
17797                         MP_WritePhyUshort(sc, 0x1d, 0x3016);
17798                         MP_WritePhyUshort(sc, 0x1d, 0x307e);
17799                         MP_WritePhyUshort(sc, 0x1d, 0x30f4);
17800                         MP_WritePhyUshort(sc, 0x1d, 0x319f);
17801                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17802                         MP_WritePhyUshort(sc, 0x1d, 0x4c60);
17803                         MP_WritePhyUshort(sc, 0x1d, 0x6803);
17804                         MP_WritePhyUshort(sc, 0x1d, 0x7d00);
17805                         MP_WritePhyUshort(sc, 0x1d, 0x6900);
17806                         MP_WritePhyUshort(sc, 0x1d, 0x6520);
17807                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
17808                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
17809                         MP_WritePhyUshort(sc, 0x1d, 0xaf03);
17810                         MP_WritePhyUshort(sc, 0x1d, 0x6115);
17811                         MP_WritePhyUshort(sc, 0x1d, 0x303a);
17812                         MP_WritePhyUshort(sc, 0x1d, 0x6097);
17813                         MP_WritePhyUshort(sc, 0x1d, 0x57e0);
17814                         MP_WritePhyUshort(sc, 0x1d, 0x580c);
17815                         MP_WritePhyUshort(sc, 0x1d, 0x588c);
17816                         MP_WritePhyUshort(sc, 0x1d, 0x5f80);
17817                         MP_WritePhyUshort(sc, 0x1d, 0x4827);
17818                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17819                         MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17820                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17821                         MP_WritePhyUshort(sc, 0x1d, 0x4c10);
17822                         MP_WritePhyUshort(sc, 0x1d, 0x8400);
17823                         MP_WritePhyUshort(sc, 0x1d, 0x7c30);
17824                         MP_WritePhyUshort(sc, 0x1d, 0x6020);
17825                         MP_WritePhyUshort(sc, 0x1d, 0x48bf);
17826                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17827                         MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17828                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17829                         MP_WritePhyUshort(sc, 0x1d, 0x4c01);
17830                         MP_WritePhyUshort(sc, 0x1d, 0xb802);
17831                         MP_WritePhyUshort(sc, 0x1d, 0x3053);
17832                         MP_WritePhyUshort(sc, 0x1d, 0x7c08);
17833                         MP_WritePhyUshort(sc, 0x1d, 0x6808);
17834                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
17835                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
17836                         MP_WritePhyUshort(sc, 0x1d, 0x7c10);
17837                         MP_WritePhyUshort(sc, 0x1d, 0x6810);
17838                         MP_WritePhyUshort(sc, 0x1d, 0xd6cf);
17839                         MP_WritePhyUshort(sc, 0x1d, 0x0002);
17840                         MP_WritePhyUshort(sc, 0x1d, 0x80fe);
17841                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17842                         MP_WritePhyUshort(sc, 0x1d, 0x4c80);
17843                         MP_WritePhyUshort(sc, 0x1d, 0x7c10);
17844                         MP_WritePhyUshort(sc, 0x1d, 0x6800);
17845                         MP_WritePhyUshort(sc, 0x1d, 0x7c08);
17846                         MP_WritePhyUshort(sc, 0x1d, 0x6800);
17847                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
17848                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
17849                         MP_WritePhyUshort(sc, 0x1d, 0x7c23);
17850                         MP_WritePhyUshort(sc, 0x1d, 0x5c23);
17851                         MP_WritePhyUshort(sc, 0x1d, 0x481e);
17852                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17853                         MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17854                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17855                         MP_WritePhyUshort(sc, 0x1d, 0x4c02);
17856                         MP_WritePhyUshort(sc, 0x1d, 0x5310);
17857                         MP_WritePhyUshort(sc, 0x1d, 0x81ff);
17858                         MP_WritePhyUshort(sc, 0x1d, 0x30c1);
17859                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17860                         MP_WritePhyUshort(sc, 0x1d, 0x4d00);
17861                         MP_WritePhyUshort(sc, 0x1d, 0x4832);
17862                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17863                         MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17864                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17865                         MP_WritePhyUshort(sc, 0x1d, 0x4c10);
17866                         MP_WritePhyUshort(sc, 0x1d, 0x7c08);
17867                         MP_WritePhyUshort(sc, 0x1d, 0x6000);
17868                         MP_WritePhyUshort(sc, 0x1d, 0xa4bd);
17869                         MP_WritePhyUshort(sc, 0x1d, 0xd9b3);
17870                         MP_WritePhyUshort(sc, 0x1d, 0x00fe);
17871                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17872                         MP_WritePhyUshort(sc, 0x1d, 0x4d20);
17873                         MP_WritePhyUshort(sc, 0x1d, 0x7e00);
17874                         MP_WritePhyUshort(sc, 0x1d, 0x6200);
17875                         MP_WritePhyUshort(sc, 0x1d, 0x3001);
17876                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17877                         MP_WritePhyUshort(sc, 0x1d, 0x4dc0);
17878                         MP_WritePhyUshort(sc, 0x1d, 0xd09d);
17879                         MP_WritePhyUshort(sc, 0x1d, 0x0002);
17880                         MP_WritePhyUshort(sc, 0x1d, 0xb4fe);
17881                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17882                         MP_WritePhyUshort(sc, 0x1d, 0x4d80);
17883                         MP_WritePhyUshort(sc, 0x1d, 0x7c04);
17884                         MP_WritePhyUshort(sc, 0x1d, 0x6004);
17885                         MP_WritePhyUshort(sc, 0x1d, 0x6802);
17886                         MP_WritePhyUshort(sc, 0x1d, 0x6728);
17887                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
17888                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
17889                         MP_WritePhyUshort(sc, 0x1d, 0x7c08);
17890                         MP_WritePhyUshort(sc, 0x1d, 0x6000);
17891                         MP_WritePhyUshort(sc, 0x1d, 0x486c);
17892                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17893                         MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17894                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17895                         MP_WritePhyUshort(sc, 0x1d, 0x4c01);
17896                         MP_WritePhyUshort(sc, 0x1d, 0x9503);
17897                         MP_WritePhyUshort(sc, 0x1d, 0x7e00);
17898                         MP_WritePhyUshort(sc, 0x1d, 0x6200);
17899                         MP_WritePhyUshort(sc, 0x1d, 0x571f);
17900                         MP_WritePhyUshort(sc, 0x1d, 0x5fbb);
17901                         MP_WritePhyUshort(sc, 0x1d, 0xaa05);
17902                         MP_WritePhyUshort(sc, 0x1d, 0x5b58);
17903                         MP_WritePhyUshort(sc, 0x1d, 0x7d80);
17904                         MP_WritePhyUshort(sc, 0x1d, 0x6100);
17905                         MP_WritePhyUshort(sc, 0x1d, 0x309a);
17906                         MP_WritePhyUshort(sc, 0x1d, 0x5b64);
17907                         MP_WritePhyUshort(sc, 0x1d, 0x7d80);
17908                         MP_WritePhyUshort(sc, 0x1d, 0x6080);
17909                         MP_WritePhyUshort(sc, 0x1d, 0xcdab);
17910                         MP_WritePhyUshort(sc, 0x1d, 0x0058);
17911                         MP_WritePhyUshort(sc, 0x1d, 0xcd8d);
17912                         MP_WritePhyUshort(sc, 0x1d, 0x0056);
17913                         MP_WritePhyUshort(sc, 0x1d, 0xd96b);
17914                         MP_WritePhyUshort(sc, 0x1d, 0x0054);
17915                         MP_WritePhyUshort(sc, 0x1d, 0xd0a0);
17916                         MP_WritePhyUshort(sc, 0x1d, 0x00d8);
17917                         MP_WritePhyUshort(sc, 0x1d, 0xcba0);
17918                         MP_WritePhyUshort(sc, 0x1d, 0x0003);
17919                         MP_WritePhyUshort(sc, 0x1d, 0x80ec);
17920                         MP_WritePhyUshort(sc, 0x1d, 0x30a7);
17921                         MP_WritePhyUshort(sc, 0x1d, 0x30b4);
17922                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17923                         MP_WritePhyUshort(sc, 0x1d, 0x4ce0);
17924                         MP_WritePhyUshort(sc, 0x1d, 0x4832);
17925                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17926                         MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17927                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17928                         MP_WritePhyUshort(sc, 0x1d, 0x4c08);
17929                         MP_WritePhyUshort(sc, 0x1d, 0x7c08);
17930                         MP_WritePhyUshort(sc, 0x1d, 0x6008);
17931                         MP_WritePhyUshort(sc, 0x1d, 0x8300);
17932                         MP_WritePhyUshort(sc, 0x1d, 0xb902);
17933                         MP_WritePhyUshort(sc, 0x1d, 0x307e);
17934                         MP_WritePhyUshort(sc, 0x1d, 0x3068);
17935                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17936                         MP_WritePhyUshort(sc, 0x1d, 0x4da0);
17937                         MP_WritePhyUshort(sc, 0x1d, 0x6608);
17938                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
17939                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
17940                         MP_WritePhyUshort(sc, 0x1d, 0x56a0);
17941                         MP_WritePhyUshort(sc, 0x1d, 0x590c);
17942                         MP_WritePhyUshort(sc, 0x1d, 0x5fa0);
17943                         MP_WritePhyUshort(sc, 0x1d, 0xcba4);
17944                         MP_WritePhyUshort(sc, 0x1d, 0x0004);
17945                         MP_WritePhyUshort(sc, 0x1d, 0xcd8d);
17946                         MP_WritePhyUshort(sc, 0x1d, 0x0002);
17947                         MP_WritePhyUshort(sc, 0x1d, 0x80fc);
17948                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17949                         MP_WritePhyUshort(sc, 0x1d, 0x4ca0);
17950                         MP_WritePhyUshort(sc, 0x1d, 0x7c08);
17951                         MP_WritePhyUshort(sc, 0x1d, 0x6408);
17952                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
17953                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
17954                         MP_WritePhyUshort(sc, 0x1d, 0x7d00);
17955                         MP_WritePhyUshort(sc, 0x1d, 0x6800);
17956                         MP_WritePhyUshort(sc, 0x1d, 0xb603);
17957                         MP_WritePhyUshort(sc, 0x1d, 0x7c10);
17958                         MP_WritePhyUshort(sc, 0x1d, 0x6010);
17959                         MP_WritePhyUshort(sc, 0x1d, 0x7d1f);
17960                         MP_WritePhyUshort(sc, 0x1d, 0x551f);
17961                         MP_WritePhyUshort(sc, 0x1d, 0x5fb3);
17962                         MP_WritePhyUshort(sc, 0x1d, 0xaa05);
17963                         MP_WritePhyUshort(sc, 0x1d, 0x7c80);
17964                         MP_WritePhyUshort(sc, 0x1d, 0x5800);
17965                         MP_WritePhyUshort(sc, 0x1d, 0x5b58);
17966                         MP_WritePhyUshort(sc, 0x1d, 0x30d7);
17967                         MP_WritePhyUshort(sc, 0x1d, 0x7c80);
17968                         MP_WritePhyUshort(sc, 0x1d, 0x5800);
17969                         MP_WritePhyUshort(sc, 0x1d, 0x5b64);
17970                         MP_WritePhyUshort(sc, 0x1d, 0x4827);
17971                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17972                         MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17973                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17974                         MP_WritePhyUshort(sc, 0x1d, 0x4c10);
17975                         MP_WritePhyUshort(sc, 0x1d, 0x8400);
17976                         MP_WritePhyUshort(sc, 0x1d, 0x7c10);
17977                         MP_WritePhyUshort(sc, 0x1d, 0x6000);
17978                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
17979                         MP_WritePhyUshort(sc, 0x1d, 0x4cc0);
17980                         MP_WritePhyUshort(sc, 0x1d, 0x7d00);
17981                         MP_WritePhyUshort(sc, 0x1d, 0x6400);
17982                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
17983                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
17984                         MP_WritePhyUshort(sc, 0x1d, 0x5fbb);
17985                         MP_WritePhyUshort(sc, 0x1d, 0x4824);
17986                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17987                         MP_WritePhyUshort(sc, 0x1d, 0x4c00);
17988                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
17989                         MP_WritePhyUshort(sc, 0x1d, 0x4c04);
17990                         MP_WritePhyUshort(sc, 0x1d, 0x8200);
17991                         MP_WritePhyUshort(sc, 0x1d, 0x7ce0);
17992                         MP_WritePhyUshort(sc, 0x1d, 0x5400);
17993                         MP_WritePhyUshort(sc, 0x1d, 0x7d00);
17994                         MP_WritePhyUshort(sc, 0x1d, 0x6500);
17995                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
17996                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
17997                         MP_WritePhyUshort(sc, 0x1d, 0x30a7);
17998                         MP_WritePhyUshort(sc, 0x1d, 0x3001);
17999                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
18000                         MP_WritePhyUshort(sc, 0x1d, 0x4e00);
18001                         MP_WritePhyUshort(sc, 0x1d, 0x4007);
18002                         MP_WritePhyUshort(sc, 0x1d, 0x4400);
18003                         MP_WritePhyUshort(sc, 0x1d, 0x5310);
18004                         MP_WritePhyUshort(sc, 0x1d, 0x6800);
18005                         MP_WritePhyUshort(sc, 0x1d, 0x673e);
18006                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
18007                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
18008                         MP_WritePhyUshort(sc, 0x1d, 0x570f);
18009                         MP_WritePhyUshort(sc, 0x1d, 0x5fff);
18010                         MP_WritePhyUshort(sc, 0x1d, 0xaa05);
18011                         MP_WritePhyUshort(sc, 0x1d, 0x585b);
18012                         MP_WritePhyUshort(sc, 0x1d, 0x7d80);
18013                         MP_WritePhyUshort(sc, 0x1d, 0x6100);
18014                         MP_WritePhyUshort(sc, 0x1d, 0x3107);
18015                         MP_WritePhyUshort(sc, 0x1d, 0x5867);
18016                         MP_WritePhyUshort(sc, 0x1d, 0x7d80);
18017                         MP_WritePhyUshort(sc, 0x1d, 0x6080);
18018                         MP_WritePhyUshort(sc, 0x1d, 0x9403);
18019                         MP_WritePhyUshort(sc, 0x1d, 0x7e00);
18020                         MP_WritePhyUshort(sc, 0x1d, 0x6200);
18021                         MP_WritePhyUshort(sc, 0x1d, 0xcda3);
18022                         MP_WritePhyUshort(sc, 0x1d, 0x00e8);
18023                         MP_WritePhyUshort(sc, 0x1d, 0xcd85);
18024                         MP_WritePhyUshort(sc, 0x1d, 0x00e6);
18025                         MP_WritePhyUshort(sc, 0x1d, 0xd96b);
18026                         MP_WritePhyUshort(sc, 0x1d, 0x00e4);
18027                         MP_WritePhyUshort(sc, 0x1d, 0x96e4);
18028                         MP_WritePhyUshort(sc, 0x1d, 0x6800);
18029                         MP_WritePhyUshort(sc, 0x1d, 0x673e);
18030                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
18031                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
18032                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
18033                         MP_WritePhyUshort(sc, 0x1d, 0x4e20);
18034                         MP_WritePhyUshort(sc, 0x1d, 0x96dd);
18035                         MP_WritePhyUshort(sc, 0x1d, 0x8b04);
18036                         MP_WritePhyUshort(sc, 0x1d, 0x7c08);
18037                         MP_WritePhyUshort(sc, 0x1d, 0x5008);
18038                         MP_WritePhyUshort(sc, 0x1d, 0xab03);
18039                         MP_WritePhyUshort(sc, 0x1d, 0x7c08);
18040                         MP_WritePhyUshort(sc, 0x1d, 0x5000);
18041                         MP_WritePhyUshort(sc, 0x1d, 0x6801);
18042                         MP_WritePhyUshort(sc, 0x1d, 0x677e);
18043                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
18044                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
18045                         MP_WritePhyUshort(sc, 0x1d, 0xdb7c);
18046                         MP_WritePhyUshort(sc, 0x1d, 0x00ee);
18047                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
18048                         MP_WritePhyUshort(sc, 0x1d, 0x7fe1);
18049                         MP_WritePhyUshort(sc, 0x1d, 0x4e40);
18050                         MP_WritePhyUshort(sc, 0x1d, 0x4837);
18051                         MP_WritePhyUshort(sc, 0x1d, 0x4418);
18052                         MP_WritePhyUshort(sc, 0x1d, 0x41c7);
18053                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
18054                         MP_WritePhyUshort(sc, 0x1d, 0x4e40);
18055                         MP_WritePhyUshort(sc, 0x1d, 0x7c40);
18056                         MP_WritePhyUshort(sc, 0x1d, 0x5400);
18057                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
18058                         MP_WritePhyUshort(sc, 0x1d, 0x4c01);
18059                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
18060                         MP_WritePhyUshort(sc, 0x1d, 0x4c01);
18061                         MP_WritePhyUshort(sc, 0x1d, 0x8fc2);
18062                         MP_WritePhyUshort(sc, 0x1d, 0xd2a0);
18063                         MP_WritePhyUshort(sc, 0x1d, 0x004b);
18064                         MP_WritePhyUshort(sc, 0x1d, 0x9204);
18065                         MP_WritePhyUshort(sc, 0x1d, 0xa042);
18066                         MP_WritePhyUshort(sc, 0x1d, 0x3132);
18067                         MP_WritePhyUshort(sc, 0x1d, 0x30f4);
18068                         MP_WritePhyUshort(sc, 0x1d, 0x7fe1);
18069                         MP_WritePhyUshort(sc, 0x1d, 0x4e60);
18070                         MP_WritePhyUshort(sc, 0x1d, 0x489c);
18071                         MP_WritePhyUshort(sc, 0x1d, 0x4628);
18072                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
18073                         MP_WritePhyUshort(sc, 0x1d, 0x4e60);
18074                         MP_WritePhyUshort(sc, 0x1d, 0x7e28);
18075                         MP_WritePhyUshort(sc, 0x1d, 0x4628);
18076                         MP_WritePhyUshort(sc, 0x1d, 0x7c40);
18077                         MP_WritePhyUshort(sc, 0x1d, 0x5400);
18078                         MP_WritePhyUshort(sc, 0x1d, 0x7c01);
18079                         MP_WritePhyUshort(sc, 0x1d, 0x5800);
18080                         MP_WritePhyUshort(sc, 0x1d, 0x7c04);
18081                         MP_WritePhyUshort(sc, 0x1d, 0x5c00);
18082                         MP_WritePhyUshort(sc, 0x1d, 0x41e8);
18083                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
18084                         MP_WritePhyUshort(sc, 0x1d, 0x4c01);
18085                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
18086                         MP_WritePhyUshort(sc, 0x1d, 0x4c01);
18087                         MP_WritePhyUshort(sc, 0x1d, 0x8fa8);
18088                         MP_WritePhyUshort(sc, 0x1d, 0xb241);
18089                         MP_WritePhyUshort(sc, 0x1d, 0xa02a);
18090                         MP_WritePhyUshort(sc, 0x1d, 0x314c);
18091                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
18092                         MP_WritePhyUshort(sc, 0x1d, 0x4ea0);
18093                         MP_WritePhyUshort(sc, 0x1d, 0x7c02);
18094                         MP_WritePhyUshort(sc, 0x1d, 0x4402);
18095                         MP_WritePhyUshort(sc, 0x1d, 0x4448);
18096                         MP_WritePhyUshort(sc, 0x1d, 0x4894);
18097                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
18098                         MP_WritePhyUshort(sc, 0x1d, 0x4c01);
18099                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
18100                         MP_WritePhyUshort(sc, 0x1d, 0x4c03);
18101                         MP_WritePhyUshort(sc, 0x1d, 0x4824);
18102                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
18103                         MP_WritePhyUshort(sc, 0x1d, 0x4c07);
18104                         MP_WritePhyUshort(sc, 0x1d, 0x41ef);
18105                         MP_WritePhyUshort(sc, 0x1d, 0x41ff);
18106                         MP_WritePhyUshort(sc, 0x1d, 0x4891);
18107                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
18108                         MP_WritePhyUshort(sc, 0x1d, 0x4c07);
18109                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
18110                         MP_WritePhyUshort(sc, 0x1d, 0x4c17);
18111                         MP_WritePhyUshort(sc, 0x1d, 0x8400);
18112                         MP_WritePhyUshort(sc, 0x1d, 0x8ef8);
18113                         MP_WritePhyUshort(sc, 0x1d, 0x41c7);
18114                         MP_WritePhyUshort(sc, 0x1d, 0x8f8d);
18115                         MP_WritePhyUshort(sc, 0x1d, 0x92d5);
18116                         MP_WritePhyUshort(sc, 0x1d, 0xa10f);
18117                         MP_WritePhyUshort(sc, 0x1d, 0xd480);
18118                         MP_WritePhyUshort(sc, 0x1d, 0x0008);
18119                         MP_WritePhyUshort(sc, 0x1d, 0xd580);
18120                         MP_WritePhyUshort(sc, 0x1d, 0x00b8);
18121                         MP_WritePhyUshort(sc, 0x1d, 0xa202);
18122                         MP_WritePhyUshort(sc, 0x1d, 0x3167);
18123                         MP_WritePhyUshort(sc, 0x1d, 0x7c04);
18124                         MP_WritePhyUshort(sc, 0x1d, 0x4404);
18125                         MP_WritePhyUshort(sc, 0x1d, 0x3167);
18126                         MP_WritePhyUshort(sc, 0x1d, 0xd484);
18127                         MP_WritePhyUshort(sc, 0x1d, 0x00f3);
18128                         MP_WritePhyUshort(sc, 0x1d, 0xd484);
18129                         MP_WritePhyUshort(sc, 0x1d, 0x00f1);
18130                         MP_WritePhyUshort(sc, 0x1d, 0x30f4);
18131                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
18132                         MP_WritePhyUshort(sc, 0x1d, 0x4ee0);
18133                         MP_WritePhyUshort(sc, 0x1d, 0x7c40);
18134                         MP_WritePhyUshort(sc, 0x1d, 0x5400);
18135                         MP_WritePhyUshort(sc, 0x1d, 0x4488);
18136                         MP_WritePhyUshort(sc, 0x1d, 0x41cf);
18137                         MP_WritePhyUshort(sc, 0x1d, 0x30f4);
18138                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
18139                         MP_WritePhyUshort(sc, 0x1d, 0x4ec0);
18140                         MP_WritePhyUshort(sc, 0x1d, 0x48f3);
18141                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
18142                         MP_WritePhyUshort(sc, 0x1d, 0x4c01);
18143                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
18144                         MP_WritePhyUshort(sc, 0x1d, 0x4c09);
18145                         MP_WritePhyUshort(sc, 0x1d, 0x4508);
18146                         MP_WritePhyUshort(sc, 0x1d, 0x41c7);
18147                         MP_WritePhyUshort(sc, 0x1d, 0x8fb0);
18148                         MP_WritePhyUshort(sc, 0x1d, 0xd218);
18149                         MP_WritePhyUshort(sc, 0x1d, 0x00ae);
18150                         MP_WritePhyUshort(sc, 0x1d, 0xd2a4);
18151                         MP_WritePhyUshort(sc, 0x1d, 0x009e);
18152                         MP_WritePhyUshort(sc, 0x1d, 0x3188);
18153                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
18154                         MP_WritePhyUshort(sc, 0x1d, 0x4e80);
18155                         MP_WritePhyUshort(sc, 0x1d, 0x4832);
18156                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
18157                         MP_WritePhyUshort(sc, 0x1d, 0x4c01);
18158                         MP_WritePhyUshort(sc, 0x1d, 0x7c1f);
18159                         MP_WritePhyUshort(sc, 0x1d, 0x4c11);
18160                         MP_WritePhyUshort(sc, 0x1d, 0x4428);
18161                         MP_WritePhyUshort(sc, 0x1d, 0x7c40);
18162                         MP_WritePhyUshort(sc, 0x1d, 0x5440);
18163                         MP_WritePhyUshort(sc, 0x1d, 0x7c01);
18164                         MP_WritePhyUshort(sc, 0x1d, 0x5801);
18165                         MP_WritePhyUshort(sc, 0x1d, 0x7c04);
18166                         MP_WritePhyUshort(sc, 0x1d, 0x5c04);
18167                         MP_WritePhyUshort(sc, 0x1d, 0x41e8);
18168                         MP_WritePhyUshort(sc, 0x1d, 0xa4b3);
18169                         MP_WritePhyUshort(sc, 0x1d, 0x319d);
18170                         MP_WritePhyUshort(sc, 0x1d, 0x7fe0);
18171                         MP_WritePhyUshort(sc, 0x1d, 0x4f20);
18172                         MP_WritePhyUshort(sc, 0x1d, 0x6800);
18173                         MP_WritePhyUshort(sc, 0x1d, 0x673e);
18174                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
18175                         MP_WritePhyUshort(sc, 0x1d, 0x0000);
18176                         MP_WritePhyUshort(sc, 0x1d, 0x570f);
18177                         MP_WritePhyUshort(sc, 0x1d, 0x5fff);
18178                         MP_WritePhyUshort(sc, 0x1d, 0xaa04);
18179                         MP_WritePhyUshort(sc, 0x1d, 0x585b);
18180                         MP_WritePhyUshort(sc, 0x1d, 0x6100);
18181                         MP_WritePhyUshort(sc, 0x1d, 0x31ad);
18182                         MP_WritePhyUshort(sc, 0x1d, 0x5867);
18183                         MP_WritePhyUshort(sc, 0x1d, 0x6080);
18184                         MP_WritePhyUshort(sc, 0x1d, 0xbcf2);
18185                         MP_WritePhyUshort(sc, 0x1d, 0x3001);
18186                         MP_WritePhyUshort(sc, 0x1f, 0x0004);
18187                         MP_WritePhyUshort(sc, 0x1c, 0x0200);
18188                         MP_WritePhyUshort(sc, 0x19, 0x7030);
18189                         MP_WritePhyUshort(sc, 0x1f, 0x0000);
18190                 }
18191
18192                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
18193                 MP_WritePhyUshort(sc, 0x11, 0x83BA);
18194                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
18195
18196                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
18197                 ClearEthPhyBit(sc, 0x1A, BIT_2);
18198                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
18199
18200                 if (phy_power_saving == 1) {
18201                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
18202                         MP_WritePhyUshort(sc, 0x18, 0x8310);
18203                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
18204                 } else {
18205                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
18206                         MP_WritePhyUshort(sc, 0x18, 0x0310);
18207                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
18208                         DELAY(20000);
18209                 }
18210
18211                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
18212                 MP_WritePhyUshort(sc, 0x0D, 0x0007);
18213                 MP_WritePhyUshort(sc, 0x0E, 0x003C);
18214                 MP_WritePhyUshort(sc, 0x0D, 0x4007);
18215                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
18216                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
18217                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
18218                 MP_WritePhyUshort(sc, 0x0D, 0x0003);
18219                 MP_WritePhyUshort(sc, 0x0E, 0x0015);
18220                 MP_WritePhyUshort(sc, 0x0D, 0x4003);
18221                 MP_WritePhyUshort(sc, 0x0E, 0x0000);
18222                 MP_WritePhyUshort(sc, 0x0D, 0x0000);
18223         } else if (sc->re_type == MACFG_56) {
18224                 MP_WritePhyUshort(sc, 0x1f, 0x0B82);
18225                 PhyRegValue = MP_ReadPhyUshort(sc,  0x10);
18226                 PhyRegValue |= BIT_4;
18227                 MP_WritePhyUshort(sc, 0x10, PhyRegValue);
18228
18229                 MP_WritePhyUshort(sc, 0x1f, 0x0B80);
18230                 WaitCnt = 0;
18231                 do {
18232                         PhyRegValue = MP_ReadPhyUshort(sc,  0x10);
18233                         PhyRegValue &= 0x0040;
18234                         DELAY(50);
18235                         DELAY(50);
18236                         WaitCnt++;
18237                 } while(PhyRegValue != 0x0040 && WaitCnt <1000);
18238
18239                 MP_WritePhyUshort(sc, 0x1f, 0x0A43);
18240                 MP_WritePhyUshort(sc, 0x13, 0x8146);
18241                 MP_WritePhyUshort(sc, 0x14, 0x2300);
18242                 MP_WritePhyUshort(sc, 0x13, 0xB820);
18243                 MP_WritePhyUshort(sc, 0x14, 0x0210);
18244
18245                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
18246                 MP_WritePhyUshort(sc, 0x13, 0xB820);
18247                 MP_WritePhyUshort(sc, 0x14, 0x0290);
18248                 MP_WritePhyUshort(sc, 0x13, 0xA012);
18249                 MP_WritePhyUshort(sc, 0x14, 0x0000);
18250                 MP_WritePhyUshort(sc, 0x13, 0xA014);
18251                 MP_WritePhyUshort(sc, 0x14, 0x2c04);
18252                 MP_WritePhyUshort(sc, 0x14, 0x2c0c);
18253                 MP_WritePhyUshort(sc, 0x14, 0x2c6c);
18254                 MP_WritePhyUshort(sc, 0x14, 0x2d0d);
18255                 MP_WritePhyUshort(sc, 0x14, 0x31ce);
18256                 MP_WritePhyUshort(sc, 0x14, 0x506d);
18257                 MP_WritePhyUshort(sc, 0x14, 0xd708);
18258                 MP_WritePhyUshort(sc, 0x14, 0x3108);
18259                 MP_WritePhyUshort(sc, 0x14, 0x106d);
18260                 MP_WritePhyUshort(sc, 0x14, 0x1560);
18261                 MP_WritePhyUshort(sc, 0x14, 0x15a9);
18262                 MP_WritePhyUshort(sc, 0x14, 0x206e);
18263                 MP_WritePhyUshort(sc, 0x14, 0x175b);
18264                 MP_WritePhyUshort(sc, 0x14, 0x6062);
18265                 MP_WritePhyUshort(sc, 0x14, 0xd700);
18266                 MP_WritePhyUshort(sc, 0x14, 0x5fae);
18267                 MP_WritePhyUshort(sc, 0x14, 0xd708);
18268                 MP_WritePhyUshort(sc, 0x14, 0x3107);
18269                 MP_WritePhyUshort(sc, 0x14, 0x4c1e);
18270                 MP_WritePhyUshort(sc, 0x14, 0x4169);
18271                 MP_WritePhyUshort(sc, 0x14, 0x316a);
18272                 MP_WritePhyUshort(sc, 0x14, 0x0c19);
18273                 MP_WritePhyUshort(sc, 0x14, 0x31aa);
18274                 MP_WritePhyUshort(sc, 0x14, 0x0c19);
18275                 MP_WritePhyUshort(sc, 0x14, 0x2c1b);
18276                 MP_WritePhyUshort(sc, 0x14, 0x5e62);
18277                 MP_WritePhyUshort(sc, 0x14, 0x26b5);
18278                 MP_WritePhyUshort(sc, 0x14, 0x31ab);
18279                 MP_WritePhyUshort(sc, 0x14, 0x5c1e);
18280                 MP_WritePhyUshort(sc, 0x14, 0x2c0c);
18281                 MP_WritePhyUshort(sc, 0x14, 0xc040);
18282                 MP_WritePhyUshort(sc, 0x14, 0x8808);
18283                 MP_WritePhyUshort(sc, 0x14, 0xc520);
18284                 MP_WritePhyUshort(sc, 0x14, 0xc421);
18285                 MP_WritePhyUshort(sc, 0x14, 0xd05a);
18286                 MP_WritePhyUshort(sc, 0x14, 0xd19a);
18287                 MP_WritePhyUshort(sc, 0x14, 0xd709);
18288                 MP_WritePhyUshort(sc, 0x14, 0x608f);
18289                 MP_WritePhyUshort(sc, 0x14, 0xd06b);
18290                 MP_WritePhyUshort(sc, 0x14, 0xd18a);
18291                 MP_WritePhyUshort(sc, 0x14, 0x2c2c);
18292                 MP_WritePhyUshort(sc, 0x14, 0xd0be);
18293                 MP_WritePhyUshort(sc, 0x14, 0xd188);
18294                 MP_WritePhyUshort(sc, 0x14, 0x2c2c);
18295                 MP_WritePhyUshort(sc, 0x14, 0xd708);
18296                 MP_WritePhyUshort(sc, 0x14, 0x4072);
18297                 MP_WritePhyUshort(sc, 0x14, 0xc104);
18298                 MP_WritePhyUshort(sc, 0x14, 0x2c3e);
18299                 MP_WritePhyUshort(sc, 0x14, 0x4076);
18300                 MP_WritePhyUshort(sc, 0x14, 0xc110);
18301                 MP_WritePhyUshort(sc, 0x14, 0x2c3e);
18302                 MP_WritePhyUshort(sc, 0x14, 0x4071);
18303                 MP_WritePhyUshort(sc, 0x14, 0xc102);
18304                 MP_WritePhyUshort(sc, 0x14, 0x2c3e);
18305                 MP_WritePhyUshort(sc, 0x14, 0x4070);
18306                 MP_WritePhyUshort(sc, 0x14, 0xc101);
18307                 MP_WritePhyUshort(sc, 0x14, 0x2c3e);
18308                 MP_WritePhyUshort(sc, 0x14, 0x175b);
18309                 MP_WritePhyUshort(sc, 0x14, 0xd709);
18310                 MP_WritePhyUshort(sc, 0x14, 0x3390);
18311                 MP_WritePhyUshort(sc, 0x14, 0x5c39);
18312                 MP_WritePhyUshort(sc, 0x14, 0x2c4e);
18313                 MP_WritePhyUshort(sc, 0x14, 0x175b);
18314                 MP_WritePhyUshort(sc, 0x14, 0xd708);
18315                 MP_WritePhyUshort(sc, 0x14, 0x6193);
18316                 MP_WritePhyUshort(sc, 0x14, 0xd709);
18317                 MP_WritePhyUshort(sc, 0x14, 0x5f9d);
18318                 MP_WritePhyUshort(sc, 0x14, 0x408b);
18319                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
18320                 MP_WritePhyUshort(sc, 0x14, 0x6042);
18321                 MP_WritePhyUshort(sc, 0x14, 0xb401);
18322                 MP_WritePhyUshort(sc, 0x14, 0x175b);
18323                 MP_WritePhyUshort(sc, 0x14, 0xd708);
18324                 MP_WritePhyUshort(sc, 0x14, 0x6073);
18325                 MP_WritePhyUshort(sc, 0x14, 0x5fbc);
18326                 MP_WritePhyUshort(sc, 0x14, 0x2c4d);
18327                 MP_WritePhyUshort(sc, 0x14, 0x26ed);
18328                 MP_WritePhyUshort(sc, 0x14, 0xb280);
18329                 MP_WritePhyUshort(sc, 0x14, 0xa841);
18330                 MP_WritePhyUshort(sc, 0x14, 0x9420);
18331                 MP_WritePhyUshort(sc, 0x14, 0x8710);
18332                 MP_WritePhyUshort(sc, 0x14, 0xd709);
18333                 MP_WritePhyUshort(sc, 0x14, 0x42ec);
18334                 MP_WritePhyUshort(sc, 0x14, 0x606d);
18335                 MP_WritePhyUshort(sc, 0x14, 0xd207);
18336                 MP_WritePhyUshort(sc, 0x14, 0x2c57);
18337                 MP_WritePhyUshort(sc, 0x14, 0xd203);
18338                 MP_WritePhyUshort(sc, 0x14, 0x33ff);
18339                 MP_WritePhyUshort(sc, 0x14, 0x563b);
18340                 MP_WritePhyUshort(sc, 0x14, 0x3275);
18341                 MP_WritePhyUshort(sc, 0x14, 0x7c5e);
18342                 MP_WritePhyUshort(sc, 0x14, 0xb240);
18343                 MP_WritePhyUshort(sc, 0x14, 0xb402);
18344                 MP_WritePhyUshort(sc, 0x14, 0x263b);
18345                 MP_WritePhyUshort(sc, 0x14, 0x6096);
18346                 MP_WritePhyUshort(sc, 0x14, 0xb240);
18347                 MP_WritePhyUshort(sc, 0x14, 0xb406);
18348                 MP_WritePhyUshort(sc, 0x14, 0x263b);
18349                 MP_WritePhyUshort(sc, 0x14, 0x31d7);
18350                 MP_WritePhyUshort(sc, 0x14, 0x7c67);
18351                 MP_WritePhyUshort(sc, 0x14, 0xb240);
18352                 MP_WritePhyUshort(sc, 0x14, 0xb40e);
18353                 MP_WritePhyUshort(sc, 0x14, 0x263b);
18354                 MP_WritePhyUshort(sc, 0x14, 0xb410);
18355                 MP_WritePhyUshort(sc, 0x14, 0x8802);
18356                 MP_WritePhyUshort(sc, 0x14, 0xb240);
18357                 MP_WritePhyUshort(sc, 0x14, 0x940e);
18358                 MP_WritePhyUshort(sc, 0x14, 0x263b);
18359                 MP_WritePhyUshort(sc, 0x14, 0xba04);
18360                 MP_WritePhyUshort(sc, 0x14, 0x1cd6);
18361                 MP_WritePhyUshort(sc, 0x14, 0xa902);
18362                 MP_WritePhyUshort(sc, 0x14, 0xd711);
18363                 MP_WritePhyUshort(sc, 0x14, 0x4045);
18364                 MP_WritePhyUshort(sc, 0x14, 0xa980);
18365                 MP_WritePhyUshort(sc, 0x14, 0x3003);
18366                 MP_WritePhyUshort(sc, 0x14, 0x59b1);
18367                 MP_WritePhyUshort(sc, 0x14, 0xa540);
18368                 MP_WritePhyUshort(sc, 0x14, 0xa601);
18369                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18370                 MP_WritePhyUshort(sc, 0x14, 0x4043);
18371                 MP_WritePhyUshort(sc, 0x14, 0xa910);
18372                 MP_WritePhyUshort(sc, 0x14, 0xd711);
18373                 MP_WritePhyUshort(sc, 0x14, 0x60a0);
18374                 MP_WritePhyUshort(sc, 0x14, 0xca33);
18375                 MP_WritePhyUshort(sc, 0x14, 0xcb33);
18376                 MP_WritePhyUshort(sc, 0x14, 0xa941);
18377                 MP_WritePhyUshort(sc, 0x14, 0x2c82);
18378                 MP_WritePhyUshort(sc, 0x14, 0xcaff);
18379                 MP_WritePhyUshort(sc, 0x14, 0xcbff);
18380                 MP_WritePhyUshort(sc, 0x14, 0xa921);
18381                 MP_WritePhyUshort(sc, 0x14, 0xce02);
18382                 MP_WritePhyUshort(sc, 0x14, 0xe070);
18383                 MP_WritePhyUshort(sc, 0x14, 0x0f10);
18384                 MP_WritePhyUshort(sc, 0x14, 0xaf01);
18385                 MP_WritePhyUshort(sc, 0x14, 0x8f01);
18386                 MP_WritePhyUshort(sc, 0x14, 0x1766);
18387                 MP_WritePhyUshort(sc, 0x14, 0x8e02);
18388                 MP_WritePhyUshort(sc, 0x14, 0x1787);
18389                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18390                 MP_WritePhyUshort(sc, 0x14, 0x609c);
18391                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
18392                 MP_WritePhyUshort(sc, 0x14, 0x7fa4);
18393                 MP_WritePhyUshort(sc, 0x14, 0x2cd4);
18394                 MP_WritePhyUshort(sc, 0x14, 0x1ce9);
18395                 MP_WritePhyUshort(sc, 0x14, 0xce04);
18396                 MP_WritePhyUshort(sc, 0x14, 0xe070);
18397                 MP_WritePhyUshort(sc, 0x14, 0x0f20);
18398                 MP_WritePhyUshort(sc, 0x14, 0xaf01);
18399                 MP_WritePhyUshort(sc, 0x14, 0x8f01);
18400                 MP_WritePhyUshort(sc, 0x14, 0x1766);
18401                 MP_WritePhyUshort(sc, 0x14, 0x8e04);
18402                 MP_WritePhyUshort(sc, 0x14, 0x6044);
18403                 MP_WritePhyUshort(sc, 0x14, 0x2cd4);
18404                 MP_WritePhyUshort(sc, 0x14, 0xa520);
18405                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18406                 MP_WritePhyUshort(sc, 0x14, 0x4043);
18407                 MP_WritePhyUshort(sc, 0x14, 0x2cc1);
18408                 MP_WritePhyUshort(sc, 0x14, 0xe00f);
18409                 MP_WritePhyUshort(sc, 0x14, 0x0501);
18410                 MP_WritePhyUshort(sc, 0x14, 0x1cef);
18411                 MP_WritePhyUshort(sc, 0x14, 0xb801);
18412                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
18413                 MP_WritePhyUshort(sc, 0x14, 0x4060);
18414                 MP_WritePhyUshort(sc, 0x14, 0x7fc4);
18415                 MP_WritePhyUshort(sc, 0x14, 0x2cd4);
18416                 MP_WritePhyUshort(sc, 0x14, 0x1cf5);
18417                 MP_WritePhyUshort(sc, 0x14, 0xe00f);
18418                 MP_WritePhyUshort(sc, 0x14, 0x0502);
18419                 MP_WritePhyUshort(sc, 0x14, 0x1cef);
18420                 MP_WritePhyUshort(sc, 0x14, 0xb802);
18421                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
18422                 MP_WritePhyUshort(sc, 0x14, 0x4061);
18423                 MP_WritePhyUshort(sc, 0x14, 0x7fc4);
18424                 MP_WritePhyUshort(sc, 0x14, 0x2cd4);
18425                 MP_WritePhyUshort(sc, 0x14, 0x1cf5);
18426                 MP_WritePhyUshort(sc, 0x14, 0xe00f);
18427                 MP_WritePhyUshort(sc, 0x14, 0x0504);
18428                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18429                 MP_WritePhyUshort(sc, 0x14, 0x6099);
18430                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
18431                 MP_WritePhyUshort(sc, 0x14, 0x7fa4);
18432                 MP_WritePhyUshort(sc, 0x14, 0x2cd4);
18433                 MP_WritePhyUshort(sc, 0x14, 0xc17f);
18434                 MP_WritePhyUshort(sc, 0x14, 0xc200);
18435                 MP_WritePhyUshort(sc, 0x14, 0xc43f);
18436                 MP_WritePhyUshort(sc, 0x14, 0xcc03);
18437                 MP_WritePhyUshort(sc, 0x14, 0xa701);
18438                 MP_WritePhyUshort(sc, 0x14, 0xa510);
18439                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18440                 MP_WritePhyUshort(sc, 0x14, 0x4018);
18441                 MP_WritePhyUshort(sc, 0x14, 0x9910);
18442                 MP_WritePhyUshort(sc, 0x14, 0x8510);
18443                 MP_WritePhyUshort(sc, 0x14, 0x2860);
18444                 MP_WritePhyUshort(sc, 0x14, 0xe00f);
18445                 MP_WritePhyUshort(sc, 0x14, 0x0504);
18446                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18447                 MP_WritePhyUshort(sc, 0x14, 0x6099);
18448                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
18449                 MP_WritePhyUshort(sc, 0x14, 0x7fa4);
18450                 MP_WritePhyUshort(sc, 0x14, 0x2cd4);
18451                 MP_WritePhyUshort(sc, 0x14, 0xa608);
18452                 MP_WritePhyUshort(sc, 0x14, 0xc17d);
18453                 MP_WritePhyUshort(sc, 0x14, 0xc200);
18454                 MP_WritePhyUshort(sc, 0x14, 0xc43f);
18455                 MP_WritePhyUshort(sc, 0x14, 0xcc03);
18456                 MP_WritePhyUshort(sc, 0x14, 0xa701);
18457                 MP_WritePhyUshort(sc, 0x14, 0xa510);
18458                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18459                 MP_WritePhyUshort(sc, 0x14, 0x4018);
18460                 MP_WritePhyUshort(sc, 0x14, 0x9910);
18461                 MP_WritePhyUshort(sc, 0x14, 0x8510);
18462                 MP_WritePhyUshort(sc, 0x14, 0x2926);
18463                 MP_WritePhyUshort(sc, 0x14, 0x1792);
18464                 MP_WritePhyUshort(sc, 0x14, 0x27db);
18465                 MP_WritePhyUshort(sc, 0x14, 0xc000);
18466                 MP_WritePhyUshort(sc, 0x14, 0xc100);
18467                 MP_WritePhyUshort(sc, 0x14, 0xc200);
18468                 MP_WritePhyUshort(sc, 0x14, 0xc300);
18469                 MP_WritePhyUshort(sc, 0x14, 0xc400);
18470                 MP_WritePhyUshort(sc, 0x14, 0xc500);
18471                 MP_WritePhyUshort(sc, 0x14, 0xc600);
18472                 MP_WritePhyUshort(sc, 0x14, 0xc7c1);
18473                 MP_WritePhyUshort(sc, 0x14, 0xc800);
18474                 MP_WritePhyUshort(sc, 0x14, 0xcc00);
18475                 MP_WritePhyUshort(sc, 0x14, 0x0800);
18476                 MP_WritePhyUshort(sc, 0x14, 0xca0f);
18477                 MP_WritePhyUshort(sc, 0x14, 0xcbff);
18478                 MP_WritePhyUshort(sc, 0x14, 0xa901);
18479                 MP_WritePhyUshort(sc, 0x14, 0x8902);
18480                 MP_WritePhyUshort(sc, 0x14, 0xc900);
18481                 MP_WritePhyUshort(sc, 0x14, 0xca00);
18482                 MP_WritePhyUshort(sc, 0x14, 0xcb00);
18483                 MP_WritePhyUshort(sc, 0x14, 0x0800);
18484                 MP_WritePhyUshort(sc, 0x14, 0xb804);
18485                 MP_WritePhyUshort(sc, 0x14, 0x0800);
18486                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
18487                 MP_WritePhyUshort(sc, 0x14, 0x6044);
18488                 MP_WritePhyUshort(sc, 0x14, 0x9804);
18489                 MP_WritePhyUshort(sc, 0x14, 0x0800);
18490                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18491                 MP_WritePhyUshort(sc, 0x14, 0x6099);
18492                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
18493                 MP_WritePhyUshort(sc, 0x14, 0x7fa4);
18494                 MP_WritePhyUshort(sc, 0x14, 0x2cd4);
18495                 MP_WritePhyUshort(sc, 0x14, 0x0800);
18496                 MP_WritePhyUshort(sc, 0x14, 0xa510);
18497                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18498                 MP_WritePhyUshort(sc, 0x14, 0x6098);
18499                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
18500                 MP_WritePhyUshort(sc, 0x14, 0x7fa4);
18501                 MP_WritePhyUshort(sc, 0x14, 0x2cd4);
18502                 MP_WritePhyUshort(sc, 0x14, 0x8510);
18503                 MP_WritePhyUshort(sc, 0x14, 0x0800);
18504                 MP_WritePhyUshort(sc, 0x14, 0xd711);
18505                 MP_WritePhyUshort(sc, 0x14, 0x3003);
18506                 MP_WritePhyUshort(sc, 0x14, 0x1d01);
18507                 MP_WritePhyUshort(sc, 0x14, 0x2d0b);
18508                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18509                 MP_WritePhyUshort(sc, 0x14, 0x60be);
18510                 MP_WritePhyUshort(sc, 0x14, 0xe060);
18511                 MP_WritePhyUshort(sc, 0x14, 0x0920);
18512                 MP_WritePhyUshort(sc, 0x14, 0x1cd6);
18513                 MP_WritePhyUshort(sc, 0x14, 0x2c89);
18514                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
18515                 MP_WritePhyUshort(sc, 0x14, 0x3063);
18516                 MP_WritePhyUshort(sc, 0x14, 0x1948);
18517                 MP_WritePhyUshort(sc, 0x14, 0x288a);
18518                 MP_WritePhyUshort(sc, 0x14, 0x1cd6);
18519                 MP_WritePhyUshort(sc, 0x14, 0x29bd);
18520                 MP_WritePhyUshort(sc, 0x14, 0xa802);
18521                 MP_WritePhyUshort(sc, 0x14, 0xa303);
18522                 MP_WritePhyUshort(sc, 0x14, 0x843f);
18523                 MP_WritePhyUshort(sc, 0x14, 0x81ff);
18524                 MP_WritePhyUshort(sc, 0x14, 0x8208);
18525                 MP_WritePhyUshort(sc, 0x14, 0xa201);
18526                 MP_WritePhyUshort(sc, 0x14, 0xc001);
18527                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18528                 MP_WritePhyUshort(sc, 0x14, 0x30a0);
18529                 MP_WritePhyUshort(sc, 0x14, 0x0d1c);
18530                 MP_WritePhyUshort(sc, 0x14, 0x30a0);
18531                 MP_WritePhyUshort(sc, 0x14, 0x3d13);
18532                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
18533                 MP_WritePhyUshort(sc, 0x14, 0x7f4c);
18534                 MP_WritePhyUshort(sc, 0x14, 0x2ab6);
18535                 MP_WritePhyUshort(sc, 0x14, 0xe003);
18536                 MP_WritePhyUshort(sc, 0x14, 0x0202);
18537                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18538                 MP_WritePhyUshort(sc, 0x14, 0x6090);
18539                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
18540                 MP_WritePhyUshort(sc, 0x14, 0x7fac);
18541                 MP_WritePhyUshort(sc, 0x14, 0x2ab6);
18542                 MP_WritePhyUshort(sc, 0x14, 0xa20c);
18543                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18544                 MP_WritePhyUshort(sc, 0x14, 0x6091);
18545                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
18546                 MP_WritePhyUshort(sc, 0x14, 0x7fac);
18547                 MP_WritePhyUshort(sc, 0x14, 0x2ab6);
18548                 MP_WritePhyUshort(sc, 0x14, 0x820e);
18549                 MP_WritePhyUshort(sc, 0x14, 0xa3e0);
18550                 MP_WritePhyUshort(sc, 0x14, 0xa520);
18551                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18552                 MP_WritePhyUshort(sc, 0x14, 0x609d);
18553                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
18554                 MP_WritePhyUshort(sc, 0x14, 0x7fac);
18555                 MP_WritePhyUshort(sc, 0x14, 0x2ab6);
18556                 MP_WritePhyUshort(sc, 0x14, 0x8520);
18557                 MP_WritePhyUshort(sc, 0x14, 0x6703);
18558                 MP_WritePhyUshort(sc, 0x14, 0x2d34);
18559                 MP_WritePhyUshort(sc, 0x14, 0xa13e);
18560                 MP_WritePhyUshort(sc, 0x14, 0xc001);
18561                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18562                 MP_WritePhyUshort(sc, 0x14, 0x4000);
18563                 MP_WritePhyUshort(sc, 0x14, 0x6046);
18564                 MP_WritePhyUshort(sc, 0x14, 0x2d0d);
18565                 MP_WritePhyUshort(sc, 0x14, 0xa43f);
18566                 MP_WritePhyUshort(sc, 0x14, 0xa101);
18567                 MP_WritePhyUshort(sc, 0x14, 0xc020);
18568                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18569                 MP_WritePhyUshort(sc, 0x14, 0x3121);
18570                 MP_WritePhyUshort(sc, 0x14, 0x0d45);
18571                 MP_WritePhyUshort(sc, 0x14, 0x30c0);
18572                 MP_WritePhyUshort(sc, 0x14, 0x3d0d);
18573                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
18574                 MP_WritePhyUshort(sc, 0x14, 0x7f4c);
18575                 MP_WritePhyUshort(sc, 0x14, 0x2ab6);
18576                 MP_WritePhyUshort(sc, 0x14, 0xa540);
18577                 MP_WritePhyUshort(sc, 0x14, 0xc001);
18578                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18579                 MP_WritePhyUshort(sc, 0x14, 0x4001);
18580                 MP_WritePhyUshort(sc, 0x14, 0xe00f);
18581                 MP_WritePhyUshort(sc, 0x14, 0x0501);
18582                 MP_WritePhyUshort(sc, 0x14, 0x1dac);
18583                 MP_WritePhyUshort(sc, 0x14, 0xc1c4);
18584                 MP_WritePhyUshort(sc, 0x14, 0xa268);
18585                 MP_WritePhyUshort(sc, 0x14, 0xa303);
18586                 MP_WritePhyUshort(sc, 0x14, 0x8420);
18587                 MP_WritePhyUshort(sc, 0x14, 0xe00f);
18588                 MP_WritePhyUshort(sc, 0x14, 0x0502);
18589                 MP_WritePhyUshort(sc, 0x14, 0x1dac);
18590                 MP_WritePhyUshort(sc, 0x14, 0xc002);
18591                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18592                 MP_WritePhyUshort(sc, 0x14, 0x4000);
18593                 MP_WritePhyUshort(sc, 0x14, 0x8208);
18594                 MP_WritePhyUshort(sc, 0x14, 0x8410);
18595                 MP_WritePhyUshort(sc, 0x14, 0xa121);
18596                 MP_WritePhyUshort(sc, 0x14, 0xc002);
18597                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18598                 MP_WritePhyUshort(sc, 0x14, 0x4000);
18599                 MP_WritePhyUshort(sc, 0x14, 0x8120);
18600                 MP_WritePhyUshort(sc, 0x14, 0x8180);
18601                 MP_WritePhyUshort(sc, 0x14, 0x1d97);
18602                 MP_WritePhyUshort(sc, 0x14, 0xa180);
18603                 MP_WritePhyUshort(sc, 0x14, 0xa13a);
18604                 MP_WritePhyUshort(sc, 0x14, 0x8240);
18605                 MP_WritePhyUshort(sc, 0x14, 0xa430);
18606                 MP_WritePhyUshort(sc, 0x14, 0xc010);
18607                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18608                 MP_WritePhyUshort(sc, 0x14, 0x30e1);
18609                 MP_WritePhyUshort(sc, 0x14, 0x0abc);
18610                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
18611                 MP_WritePhyUshort(sc, 0x14, 0x7f8c);
18612                 MP_WritePhyUshort(sc, 0x14, 0x2ab6);
18613                 MP_WritePhyUshort(sc, 0x14, 0xa480);
18614                 MP_WritePhyUshort(sc, 0x14, 0xa230);
18615                 MP_WritePhyUshort(sc, 0x14, 0xa303);
18616                 MP_WritePhyUshort(sc, 0x14, 0xc001);
18617                 MP_WritePhyUshort(sc, 0x14, 0xd70c);
18618                 MP_WritePhyUshort(sc, 0x14, 0x4124);
18619                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18620                 MP_WritePhyUshort(sc, 0x14, 0x6120);
18621                 MP_WritePhyUshort(sc, 0x14, 0xd711);
18622                 MP_WritePhyUshort(sc, 0x14, 0x3128);
18623                 MP_WritePhyUshort(sc, 0x14, 0x3d76);
18624                 MP_WritePhyUshort(sc, 0x14, 0x2d70);
18625                 MP_WritePhyUshort(sc, 0x14, 0xa801);
18626                 MP_WritePhyUshort(sc, 0x14, 0x2d6c);
18627                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18628                 MP_WritePhyUshort(sc, 0x14, 0x4000);
18629                 MP_WritePhyUshort(sc, 0x14, 0xe018);
18630                 MP_WritePhyUshort(sc, 0x14, 0x0208);
18631                 MP_WritePhyUshort(sc, 0x14, 0xa1f8);
18632                 MP_WritePhyUshort(sc, 0x14, 0x8480);
18633                 MP_WritePhyUshort(sc, 0x14, 0xc004);
18634                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18635                 MP_WritePhyUshort(sc, 0x14, 0x4000);
18636                 MP_WritePhyUshort(sc, 0x14, 0x6046);
18637                 MP_WritePhyUshort(sc, 0x14, 0x2d0d);
18638                 MP_WritePhyUshort(sc, 0x14, 0xa43f);
18639                 MP_WritePhyUshort(sc, 0x14, 0xa105);
18640                 MP_WritePhyUshort(sc, 0x14, 0x8228);
18641                 MP_WritePhyUshort(sc, 0x14, 0xc004);
18642                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18643                 MP_WritePhyUshort(sc, 0x14, 0x4000);
18644                 MP_WritePhyUshort(sc, 0x14, 0x81bc);
18645                 MP_WritePhyUshort(sc, 0x14, 0xa220);
18646                 MP_WritePhyUshort(sc, 0x14, 0x1d97);
18647                 MP_WritePhyUshort(sc, 0x14, 0x8220);
18648                 MP_WritePhyUshort(sc, 0x14, 0xa1bc);
18649                 MP_WritePhyUshort(sc, 0x14, 0xc040);
18650                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18651                 MP_WritePhyUshort(sc, 0x14, 0x30e1);
18652                 MP_WritePhyUshort(sc, 0x14, 0x0abc);
18653                 MP_WritePhyUshort(sc, 0x14, 0x30e1);
18654                 MP_WritePhyUshort(sc, 0x14, 0x3d0d);
18655                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
18656                 MP_WritePhyUshort(sc, 0x14, 0x7f4c);
18657                 MP_WritePhyUshort(sc, 0x14, 0x2ab6);
18658                 MP_WritePhyUshort(sc, 0x14, 0xa802);
18659                 MP_WritePhyUshort(sc, 0x14, 0xd70c);
18660                 MP_WritePhyUshort(sc, 0x14, 0x4244);
18661                 MP_WritePhyUshort(sc, 0x14, 0xa301);
18662                 MP_WritePhyUshort(sc, 0x14, 0xc004);
18663                 MP_WritePhyUshort(sc, 0x14, 0xd711);
18664                 MP_WritePhyUshort(sc, 0x14, 0x3128);
18665                 MP_WritePhyUshort(sc, 0x14, 0x3da5);
18666                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18667                 MP_WritePhyUshort(sc, 0x14, 0x5f80);
18668                 MP_WritePhyUshort(sc, 0x14, 0xd711);
18669                 MP_WritePhyUshort(sc, 0x14, 0x3109);
18670                 MP_WritePhyUshort(sc, 0x14, 0x3da7);
18671                 MP_WritePhyUshort(sc, 0x14, 0x2dab);
18672                 MP_WritePhyUshort(sc, 0x14, 0xa801);
18673                 MP_WritePhyUshort(sc, 0x14, 0x2d9a);
18674                 MP_WritePhyUshort(sc, 0x14, 0xa802);
18675                 MP_WritePhyUshort(sc, 0x14, 0xc004);
18676                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18677                 MP_WritePhyUshort(sc, 0x14, 0x4000);
18678                 MP_WritePhyUshort(sc, 0x14, 0x0800);
18679                 MP_WritePhyUshort(sc, 0x14, 0xa510);
18680                 MP_WritePhyUshort(sc, 0x14, 0xd710);
18681                 MP_WritePhyUshort(sc, 0x14, 0x609a);
18682                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
18683                 MP_WritePhyUshort(sc, 0x14, 0x7fac);
18684                 MP_WritePhyUshort(sc, 0x14, 0x2ab6);
18685                 MP_WritePhyUshort(sc, 0x14, 0x8510);
18686                 MP_WritePhyUshort(sc, 0x14, 0x0800);
18687                 MP_WritePhyUshort(sc, 0x13, 0xA01A);
18688                 MP_WritePhyUshort(sc, 0x14, 0x0000);
18689                 MP_WritePhyUshort(sc, 0x13, 0xA006);
18690                 MP_WritePhyUshort(sc, 0x14, 0x0ad6);
18691                 MP_WritePhyUshort(sc, 0x13, 0xA004);
18692                 MP_WritePhyUshort(sc, 0x14, 0x07f5);
18693                 MP_WritePhyUshort(sc, 0x13, 0xA002);
18694                 MP_WritePhyUshort(sc, 0x14, 0x06a9);
18695                 MP_WritePhyUshort(sc, 0x13, 0xA000);
18696                 MP_WritePhyUshort(sc, 0x14, 0xf069);
18697                 MP_WritePhyUshort(sc, 0x13, 0xB820);
18698                 MP_WritePhyUshort(sc, 0x14, 0x0210);
18699
18700                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
18701                 MP_WritePhyUshort(sc, 0x13, 0x83a0);
18702                 MP_WritePhyUshort(sc, 0x14, 0xaf83);
18703                 MP_WritePhyUshort(sc, 0x14, 0xacaf);
18704                 MP_WritePhyUshort(sc, 0x14, 0x83b8);
18705                 MP_WritePhyUshort(sc, 0x14, 0xaf83);
18706                 MP_WritePhyUshort(sc, 0x14, 0xcdaf);
18707                 MP_WritePhyUshort(sc, 0x14, 0x83d3);
18708                 MP_WritePhyUshort(sc, 0x14, 0x0204);
18709                 MP_WritePhyUshort(sc, 0x14, 0x9a02);
18710                 MP_WritePhyUshort(sc, 0x14, 0x09a9);
18711                 MP_WritePhyUshort(sc, 0x14, 0x0284);
18712                 MP_WritePhyUshort(sc, 0x14, 0x61af);
18713                 MP_WritePhyUshort(sc, 0x14, 0x02fc);
18714                 MP_WritePhyUshort(sc, 0x14, 0xad20);
18715                 MP_WritePhyUshort(sc, 0x14, 0x0302);
18716                 MP_WritePhyUshort(sc, 0x14, 0x867c);
18717                 MP_WritePhyUshort(sc, 0x14, 0xad21);
18718                 MP_WritePhyUshort(sc, 0x14, 0x0302);
18719                 MP_WritePhyUshort(sc, 0x14, 0x85c9);
18720                 MP_WritePhyUshort(sc, 0x14, 0xad22);
18721                 MP_WritePhyUshort(sc, 0x14, 0x0302);
18722                 MP_WritePhyUshort(sc, 0x14, 0x1bc0);
18723                 MP_WritePhyUshort(sc, 0x14, 0xaf17);
18724                 MP_WritePhyUshort(sc, 0x14, 0xe302);
18725                 MP_WritePhyUshort(sc, 0x14, 0x8703);
18726                 MP_WritePhyUshort(sc, 0x14, 0xaf18);
18727                 MP_WritePhyUshort(sc, 0x14, 0x6201);
18728                 MP_WritePhyUshort(sc, 0x14, 0x06e0);
18729                 MP_WritePhyUshort(sc, 0x14, 0x8148);
18730                 MP_WritePhyUshort(sc, 0x14, 0xaf3c);
18731                 MP_WritePhyUshort(sc, 0x14, 0x69f8);
18732                 MP_WritePhyUshort(sc, 0x14, 0xf9fa);
18733                 MP_WritePhyUshort(sc, 0x14, 0xef69);
18734                 MP_WritePhyUshort(sc, 0x14, 0xee80);
18735                 MP_WritePhyUshort(sc, 0x14, 0x10f7);
18736                 MP_WritePhyUshort(sc, 0x14, 0xee80);
18737                 MP_WritePhyUshort(sc, 0x14, 0x131f);
18738                 MP_WritePhyUshort(sc, 0x14, 0xd104);
18739                 MP_WritePhyUshort(sc, 0x14, 0xbf87);
18740                 MP_WritePhyUshort(sc, 0x14, 0xf302);
18741                 MP_WritePhyUshort(sc, 0x14, 0x4259);
18742                 MP_WritePhyUshort(sc, 0x14, 0x0287);
18743                 MP_WritePhyUshort(sc, 0x14, 0x88bf);
18744                 MP_WritePhyUshort(sc, 0x14, 0x87cf);
18745                 MP_WritePhyUshort(sc, 0x14, 0xd7b8);
18746                 MP_WritePhyUshort(sc, 0x14, 0x22d0);
18747                 MP_WritePhyUshort(sc, 0x14, 0x0c02);
18748                 MP_WritePhyUshort(sc, 0x14, 0x4252);
18749                 MP_WritePhyUshort(sc, 0x14, 0xee80);
18750                 MP_WritePhyUshort(sc, 0x14, 0xcda0);
18751                 MP_WritePhyUshort(sc, 0x14, 0xee80);
18752                 MP_WritePhyUshort(sc, 0x14, 0xce8b);
18753                 MP_WritePhyUshort(sc, 0x14, 0xee80);
18754                 MP_WritePhyUshort(sc, 0x14, 0xd1f5);
18755                 MP_WritePhyUshort(sc, 0x14, 0xee80);
18756                 MP_WritePhyUshort(sc, 0x14, 0xd2a9);
18757                 MP_WritePhyUshort(sc, 0x14, 0xee80);
18758                 MP_WritePhyUshort(sc, 0x14, 0xd30a);
18759                 MP_WritePhyUshort(sc, 0x14, 0xee80);
18760                 MP_WritePhyUshort(sc, 0x14, 0xf010);
18761                 MP_WritePhyUshort(sc, 0x14, 0xee80);
18762                 MP_WritePhyUshort(sc, 0x14, 0xf38f);
18763                 MP_WritePhyUshort(sc, 0x14, 0xee81);
18764                 MP_WritePhyUshort(sc, 0x14, 0x011e);
18765                 MP_WritePhyUshort(sc, 0x14, 0xee81);
18766                 MP_WritePhyUshort(sc, 0x14, 0x0b4a);
18767                 MP_WritePhyUshort(sc, 0x14, 0xee81);
18768                 MP_WritePhyUshort(sc, 0x14, 0x0c7c);
18769                 MP_WritePhyUshort(sc, 0x14, 0xee81);
18770                 MP_WritePhyUshort(sc, 0x14, 0x127f);
18771                 MP_WritePhyUshort(sc, 0x14, 0xd100);
18772                 MP_WritePhyUshort(sc, 0x14, 0x0210);
18773                 MP_WritePhyUshort(sc, 0x14, 0xb5ee);
18774                 MP_WritePhyUshort(sc, 0x14, 0x8088);
18775                 MP_WritePhyUshort(sc, 0x14, 0xa4ee);
18776                 MP_WritePhyUshort(sc, 0x14, 0x8089);
18777                 MP_WritePhyUshort(sc, 0x14, 0x44ee);
18778                 MP_WritePhyUshort(sc, 0x14, 0x809a);
18779                 MP_WritePhyUshort(sc, 0x14, 0xa4ee);
18780                 MP_WritePhyUshort(sc, 0x14, 0x809b);
18781                 MP_WritePhyUshort(sc, 0x14, 0x44ee);
18782                 MP_WritePhyUshort(sc, 0x14, 0x809c);
18783                 MP_WritePhyUshort(sc, 0x14, 0xa7ee);
18784                 MP_WritePhyUshort(sc, 0x14, 0x80a5);
18785                 MP_WritePhyUshort(sc, 0x14, 0xa7d2);
18786                 MP_WritePhyUshort(sc, 0x14, 0x0002);
18787                 MP_WritePhyUshort(sc, 0x14, 0x0e66);
18788                 MP_WritePhyUshort(sc, 0x14, 0x0285);
18789                 MP_WritePhyUshort(sc, 0x14, 0xc0ee);
18790                 MP_WritePhyUshort(sc, 0x14, 0x87fc);
18791                 MP_WritePhyUshort(sc, 0x14, 0x00e0);
18792                 MP_WritePhyUshort(sc, 0x14, 0x8245);
18793                 MP_WritePhyUshort(sc, 0x14, 0xf622);
18794                 MP_WritePhyUshort(sc, 0x14, 0xe482);
18795                 MP_WritePhyUshort(sc, 0x14, 0x45ef);
18796                 MP_WritePhyUshort(sc, 0x14, 0x96fe);
18797                 MP_WritePhyUshort(sc, 0x14, 0xfdfc);
18798                 MP_WritePhyUshort(sc, 0x14, 0x0402);
18799                 MP_WritePhyUshort(sc, 0x14, 0x847a);
18800                 MP_WritePhyUshort(sc, 0x14, 0x0284);
18801                 MP_WritePhyUshort(sc, 0x14, 0xb302);
18802                 MP_WritePhyUshort(sc, 0x14, 0x0cab);
18803                 MP_WritePhyUshort(sc, 0x14, 0x020c);
18804                 MP_WritePhyUshort(sc, 0x14, 0xc402);
18805                 MP_WritePhyUshort(sc, 0x14, 0x0cef);
18806                 MP_WritePhyUshort(sc, 0x14, 0x020d);
18807                 MP_WritePhyUshort(sc, 0x14, 0x0802);
18808                 MP_WritePhyUshort(sc, 0x14, 0x0d33);
18809                 MP_WritePhyUshort(sc, 0x14, 0x020c);
18810                 MP_WritePhyUshort(sc, 0x14, 0x3d04);
18811                 MP_WritePhyUshort(sc, 0x14, 0xf8fa);
18812                 MP_WritePhyUshort(sc, 0x14, 0xef69);
18813                 MP_WritePhyUshort(sc, 0x14, 0xe182);
18814                 MP_WritePhyUshort(sc, 0x14, 0x2fac);
18815                 MP_WritePhyUshort(sc, 0x14, 0x291a);
18816                 MP_WritePhyUshort(sc, 0x14, 0xe082);
18817                 MP_WritePhyUshort(sc, 0x14, 0x24ac);
18818                 MP_WritePhyUshort(sc, 0x14, 0x2102);
18819                 MP_WritePhyUshort(sc, 0x14, 0xae22);
18820                 MP_WritePhyUshort(sc, 0x14, 0x0210);
18821                 MP_WritePhyUshort(sc, 0x14, 0x57f6);
18822                 MP_WritePhyUshort(sc, 0x14, 0x21e4);
18823                 MP_WritePhyUshort(sc, 0x14, 0x8224);
18824                 MP_WritePhyUshort(sc, 0x14, 0xd101);
18825                 MP_WritePhyUshort(sc, 0x14, 0xbf44);
18826                 MP_WritePhyUshort(sc, 0x14, 0xd202);
18827                 MP_WritePhyUshort(sc, 0x14, 0x4259);
18828                 MP_WritePhyUshort(sc, 0x14, 0xae10);
18829                 MP_WritePhyUshort(sc, 0x14, 0x0212);
18830                 MP_WritePhyUshort(sc, 0x14, 0x4cf6);
18831                 MP_WritePhyUshort(sc, 0x14, 0x29e5);
18832                 MP_WritePhyUshort(sc, 0x14, 0x822f);
18833                 MP_WritePhyUshort(sc, 0x14, 0xe082);
18834                 MP_WritePhyUshort(sc, 0x14, 0x24f6);
18835                 MP_WritePhyUshort(sc, 0x14, 0x21e4);
18836                 MP_WritePhyUshort(sc, 0x14, 0x8224);
18837                 MP_WritePhyUshort(sc, 0x14, 0xef96);
18838                 MP_WritePhyUshort(sc, 0x14, 0xfefc);
18839                 MP_WritePhyUshort(sc, 0x14, 0x04f8);
18840                 MP_WritePhyUshort(sc, 0x14, 0xe182);
18841                 MP_WritePhyUshort(sc, 0x14, 0x2fac);
18842                 MP_WritePhyUshort(sc, 0x14, 0x2a18);
18843                 MP_WritePhyUshort(sc, 0x14, 0xe082);
18844                 MP_WritePhyUshort(sc, 0x14, 0x24ac);
18845                 MP_WritePhyUshort(sc, 0x14, 0x2202);
18846                 MP_WritePhyUshort(sc, 0x14, 0xae26);
18847                 MP_WritePhyUshort(sc, 0x14, 0x0284);
18848                 MP_WritePhyUshort(sc, 0x14, 0xf802);
18849                 MP_WritePhyUshort(sc, 0x14, 0x8565);
18850                 MP_WritePhyUshort(sc, 0x14, 0xd101);
18851                 MP_WritePhyUshort(sc, 0x14, 0xbf44);
18852                 MP_WritePhyUshort(sc, 0x14, 0xd502);
18853                 MP_WritePhyUshort(sc, 0x14, 0x4259);
18854                 MP_WritePhyUshort(sc, 0x14, 0xae0e);
18855                 MP_WritePhyUshort(sc, 0x14, 0x0284);
18856                 MP_WritePhyUshort(sc, 0x14, 0xea02);
18857                 MP_WritePhyUshort(sc, 0x14, 0x85a9);
18858                 MP_WritePhyUshort(sc, 0x14, 0xe182);
18859                 MP_WritePhyUshort(sc, 0x14, 0x2ff6);
18860                 MP_WritePhyUshort(sc, 0x14, 0x2ae5);
18861                 MP_WritePhyUshort(sc, 0x14, 0x822f);
18862                 MP_WritePhyUshort(sc, 0x14, 0xe082);
18863                 MP_WritePhyUshort(sc, 0x14, 0x24f6);
18864                 MP_WritePhyUshort(sc, 0x14, 0x22e4);
18865                 MP_WritePhyUshort(sc, 0x14, 0x8224);
18866                 MP_WritePhyUshort(sc, 0x14, 0xfc04);
18867                 MP_WritePhyUshort(sc, 0x14, 0xf9e2);
18868                 MP_WritePhyUshort(sc, 0x14, 0x8011);
18869                 MP_WritePhyUshort(sc, 0x14, 0xad31);
18870                 MP_WritePhyUshort(sc, 0x14, 0x05d2);
18871                 MP_WritePhyUshort(sc, 0x14, 0x0002);
18872                 MP_WritePhyUshort(sc, 0x14, 0x0e66);
18873                 MP_WritePhyUshort(sc, 0x14, 0xfd04);
18874                 MP_WritePhyUshort(sc, 0x14, 0xf8f9);
18875                 MP_WritePhyUshort(sc, 0x14, 0xfaef);
18876                 MP_WritePhyUshort(sc, 0x14, 0x69e0);
18877                 MP_WritePhyUshort(sc, 0x14, 0x8011);
18878                 MP_WritePhyUshort(sc, 0x14, 0xad21);
18879                 MP_WritePhyUshort(sc, 0x14, 0x5cbf);
18880                 MP_WritePhyUshort(sc, 0x14, 0x43be);
18881                 MP_WritePhyUshort(sc, 0x14, 0x0242);
18882                 MP_WritePhyUshort(sc, 0x14, 0x97ac);
18883                 MP_WritePhyUshort(sc, 0x14, 0x281b);
18884                 MP_WritePhyUshort(sc, 0x14, 0xbf43);
18885                 MP_WritePhyUshort(sc, 0x14, 0xc102);
18886                 MP_WritePhyUshort(sc, 0x14, 0x4297);
18887                 MP_WritePhyUshort(sc, 0x14, 0xac28);
18888                 MP_WritePhyUshort(sc, 0x14, 0x12bf);
18889                 MP_WritePhyUshort(sc, 0x14, 0x43c7);
18890                 MP_WritePhyUshort(sc, 0x14, 0x0242);
18891                 MP_WritePhyUshort(sc, 0x14, 0x97ac);
18892                 MP_WritePhyUshort(sc, 0x14, 0x2804);
18893                 MP_WritePhyUshort(sc, 0x14, 0xd300);
18894                 MP_WritePhyUshort(sc, 0x14, 0xae07);
18895                 MP_WritePhyUshort(sc, 0x14, 0xd306);
18896                 MP_WritePhyUshort(sc, 0x14, 0xaf85);
18897                 MP_WritePhyUshort(sc, 0x14, 0x56d3);
18898                 MP_WritePhyUshort(sc, 0x14, 0x03e0);
18899                 MP_WritePhyUshort(sc, 0x14, 0x8011);
18900                 MP_WritePhyUshort(sc, 0x14, 0xad26);
18901                 MP_WritePhyUshort(sc, 0x14, 0x25bf);
18902                 MP_WritePhyUshort(sc, 0x14, 0x4559);
18903                 MP_WritePhyUshort(sc, 0x14, 0x0242);
18904                 MP_WritePhyUshort(sc, 0x14, 0x97e2);
18905                 MP_WritePhyUshort(sc, 0x14, 0x8073);
18906                 MP_WritePhyUshort(sc, 0x14, 0x0d21);
18907                 MP_WritePhyUshort(sc, 0x14, 0xf637);
18908                 MP_WritePhyUshort(sc, 0x14, 0x0d11);
18909                 MP_WritePhyUshort(sc, 0x14, 0xf62f);
18910                 MP_WritePhyUshort(sc, 0x14, 0x1b21);
18911                 MP_WritePhyUshort(sc, 0x14, 0xaa02);
18912                 MP_WritePhyUshort(sc, 0x14, 0xae10);
18913                 MP_WritePhyUshort(sc, 0x14, 0xe280);
18914                 MP_WritePhyUshort(sc, 0x14, 0x740d);
18915                 MP_WritePhyUshort(sc, 0x14, 0x21f6);
18916                 MP_WritePhyUshort(sc, 0x14, 0x371b);
18917                 MP_WritePhyUshort(sc, 0x14, 0x21aa);
18918                 MP_WritePhyUshort(sc, 0x14, 0x0313);
18919                 MP_WritePhyUshort(sc, 0x14, 0xae02);
18920                 MP_WritePhyUshort(sc, 0x14, 0x2b02);
18921                 MP_WritePhyUshort(sc, 0x14, 0x020e);
18922                 MP_WritePhyUshort(sc, 0x14, 0x5102);
18923                 MP_WritePhyUshort(sc, 0x14, 0x0e66);
18924                 MP_WritePhyUshort(sc, 0x14, 0x020f);
18925                 MP_WritePhyUshort(sc, 0x14, 0xa3ef);
18926                 MP_WritePhyUshort(sc, 0x14, 0x96fe);
18927                 MP_WritePhyUshort(sc, 0x14, 0xfdfc);
18928                 MP_WritePhyUshort(sc, 0x14, 0x04f8);
18929                 MP_WritePhyUshort(sc, 0x14, 0xf9fa);
18930                 MP_WritePhyUshort(sc, 0x14, 0xef69);
18931                 MP_WritePhyUshort(sc, 0x14, 0xe080);
18932                 MP_WritePhyUshort(sc, 0x14, 0x12ad);
18933                 MP_WritePhyUshort(sc, 0x14, 0x2733);
18934                 MP_WritePhyUshort(sc, 0x14, 0xbf43);
18935                 MP_WritePhyUshort(sc, 0x14, 0xbe02);
18936                 MP_WritePhyUshort(sc, 0x14, 0x4297);
18937                 MP_WritePhyUshort(sc, 0x14, 0xac28);
18938                 MP_WritePhyUshort(sc, 0x14, 0x09bf);
18939                 MP_WritePhyUshort(sc, 0x14, 0x43c1);
18940                 MP_WritePhyUshort(sc, 0x14, 0x0242);
18941                 MP_WritePhyUshort(sc, 0x14, 0x97ad);
18942                 MP_WritePhyUshort(sc, 0x14, 0x2821);
18943                 MP_WritePhyUshort(sc, 0x14, 0xbf45);
18944                 MP_WritePhyUshort(sc, 0x14, 0x5902);
18945                 MP_WritePhyUshort(sc, 0x14, 0x4297);
18946                 MP_WritePhyUshort(sc, 0x14, 0xe387);
18947                 MP_WritePhyUshort(sc, 0x14, 0xffd2);
18948                 MP_WritePhyUshort(sc, 0x14, 0x001b);
18949                 MP_WritePhyUshort(sc, 0x14, 0x45ac);
18950                 MP_WritePhyUshort(sc, 0x14, 0x2711);
18951                 MP_WritePhyUshort(sc, 0x14, 0xe187);
18952                 MP_WritePhyUshort(sc, 0x14, 0xfebf);
18953                 MP_WritePhyUshort(sc, 0x14, 0x87e4);
18954                 MP_WritePhyUshort(sc, 0x14, 0x0242);
18955                 MP_WritePhyUshort(sc, 0x14, 0x590d);
18956                 MP_WritePhyUshort(sc, 0x14, 0x11bf);
18957                 MP_WritePhyUshort(sc, 0x14, 0x87e7);
18958                 MP_WritePhyUshort(sc, 0x14, 0x0242);
18959                 MP_WritePhyUshort(sc, 0x14, 0x59ef);
18960                 MP_WritePhyUshort(sc, 0x14, 0x96fe);
18961                 MP_WritePhyUshort(sc, 0x14, 0xfdfc);
18962                 MP_WritePhyUshort(sc, 0x14, 0x04f8);
18963                 MP_WritePhyUshort(sc, 0x14, 0xfaef);
18964                 MP_WritePhyUshort(sc, 0x14, 0x69d1);
18965                 MP_WritePhyUshort(sc, 0x14, 0x00bf);
18966                 MP_WritePhyUshort(sc, 0x14, 0x87e4);
18967                 MP_WritePhyUshort(sc, 0x14, 0x0242);
18968                 MP_WritePhyUshort(sc, 0x14, 0x59bf);
18969                 MP_WritePhyUshort(sc, 0x14, 0x87e7);
18970                 MP_WritePhyUshort(sc, 0x14, 0x0242);
18971                 MP_WritePhyUshort(sc, 0x14, 0x59ef);
18972                 MP_WritePhyUshort(sc, 0x14, 0x96fe);
18973                 MP_WritePhyUshort(sc, 0x14, 0xfc04);
18974                 MP_WritePhyUshort(sc, 0x14, 0xee87);
18975                 MP_WritePhyUshort(sc, 0x14, 0xff46);
18976                 MP_WritePhyUshort(sc, 0x14, 0xee87);
18977                 MP_WritePhyUshort(sc, 0x14, 0xfe01);
18978                 MP_WritePhyUshort(sc, 0x14, 0x04f8);
18979                 MP_WritePhyUshort(sc, 0x14, 0xfaef);
18980                 MP_WritePhyUshort(sc, 0x14, 0x69e0);
18981                 MP_WritePhyUshort(sc, 0x14, 0x8241);
18982                 MP_WritePhyUshort(sc, 0x14, 0xa000);
18983                 MP_WritePhyUshort(sc, 0x14, 0x0502);
18984                 MP_WritePhyUshort(sc, 0x14, 0x85eb);
18985                 MP_WritePhyUshort(sc, 0x14, 0xae0e);
18986                 MP_WritePhyUshort(sc, 0x14, 0xa001);
18987                 MP_WritePhyUshort(sc, 0x14, 0x0502);
18988                 MP_WritePhyUshort(sc, 0x14, 0x1a5a);
18989                 MP_WritePhyUshort(sc, 0x14, 0xae06);
18990                 MP_WritePhyUshort(sc, 0x14, 0xa002);
18991                 MP_WritePhyUshort(sc, 0x14, 0x0302);
18992                 MP_WritePhyUshort(sc, 0x14, 0x1ae6);
18993                 MP_WritePhyUshort(sc, 0x14, 0xef96);
18994                 MP_WritePhyUshort(sc, 0x14, 0xfefc);
18995                 MP_WritePhyUshort(sc, 0x14, 0x04f8);
18996                 MP_WritePhyUshort(sc, 0x14, 0xf9fa);
18997                 MP_WritePhyUshort(sc, 0x14, 0xef69);
18998                 MP_WritePhyUshort(sc, 0x14, 0xe082);
18999                 MP_WritePhyUshort(sc, 0x14, 0x29f6);
19000                 MP_WritePhyUshort(sc, 0x14, 0x21e4);
19001                 MP_WritePhyUshort(sc, 0x14, 0x8229);
19002                 MP_WritePhyUshort(sc, 0x14, 0xe080);
19003                 MP_WritePhyUshort(sc, 0x14, 0x10ac);
19004                 MP_WritePhyUshort(sc, 0x14, 0x2202);
19005                 MP_WritePhyUshort(sc, 0x14, 0xae76);
19006                 MP_WritePhyUshort(sc, 0x14, 0xe082);
19007                 MP_WritePhyUshort(sc, 0x14, 0x27f7);
19008                 MP_WritePhyUshort(sc, 0x14, 0x21e4);
19009                 MP_WritePhyUshort(sc, 0x14, 0x8227);
19010                 MP_WritePhyUshort(sc, 0x14, 0xbf43);
19011                 MP_WritePhyUshort(sc, 0x14, 0x1302);
19012                 MP_WritePhyUshort(sc, 0x14, 0x4297);
19013                 MP_WritePhyUshort(sc, 0x14, 0xef21);
19014                 MP_WritePhyUshort(sc, 0x14, 0xbf43);
19015                 MP_WritePhyUshort(sc, 0x14, 0x1602);
19016                 MP_WritePhyUshort(sc, 0x14, 0x4297);
19017                 MP_WritePhyUshort(sc, 0x14, 0x0c11);
19018                 MP_WritePhyUshort(sc, 0x14, 0x1e21);
19019                 MP_WritePhyUshort(sc, 0x14, 0xbf43);
19020                 MP_WritePhyUshort(sc, 0x14, 0x1902);
19021                 MP_WritePhyUshort(sc, 0x14, 0x4297);
19022                 MP_WritePhyUshort(sc, 0x14, 0x0c12);
19023                 MP_WritePhyUshort(sc, 0x14, 0x1e21);
19024                 MP_WritePhyUshort(sc, 0x14, 0xe682);
19025                 MP_WritePhyUshort(sc, 0x14, 0x43a2);
19026                 MP_WritePhyUshort(sc, 0x14, 0x000a);
19027                 MP_WritePhyUshort(sc, 0x14, 0xe182);
19028                 MP_WritePhyUshort(sc, 0x14, 0x27f6);
19029                 MP_WritePhyUshort(sc, 0x14, 0x29e5);
19030                 MP_WritePhyUshort(sc, 0x14, 0x8227);
19031                 MP_WritePhyUshort(sc, 0x14, 0xae42);
19032                 MP_WritePhyUshort(sc, 0x14, 0xe082);
19033                 MP_WritePhyUshort(sc, 0x14, 0x44f7);
19034                 MP_WritePhyUshort(sc, 0x14, 0x21e4);
19035                 MP_WritePhyUshort(sc, 0x14, 0x8244);
19036                 MP_WritePhyUshort(sc, 0x14, 0x0246);
19037                 MP_WritePhyUshort(sc, 0x14, 0xaebf);
19038                 MP_WritePhyUshort(sc, 0x14, 0x4325);
19039                 MP_WritePhyUshort(sc, 0x14, 0x0242);
19040                 MP_WritePhyUshort(sc, 0x14, 0x97ef);
19041                 MP_WritePhyUshort(sc, 0x14, 0x21bf);
19042                 MP_WritePhyUshort(sc, 0x14, 0x431c);
19043                 MP_WritePhyUshort(sc, 0x14, 0x0242);
19044                 MP_WritePhyUshort(sc, 0x14, 0x970c);
19045                 MP_WritePhyUshort(sc, 0x14, 0x121e);
19046                 MP_WritePhyUshort(sc, 0x14, 0x21bf);
19047                 MP_WritePhyUshort(sc, 0x14, 0x431f);
19048                 MP_WritePhyUshort(sc, 0x14, 0x0242);
19049                 MP_WritePhyUshort(sc, 0x14, 0x970c);
19050                 MP_WritePhyUshort(sc, 0x14, 0x131e);
19051                 MP_WritePhyUshort(sc, 0x14, 0x21bf);
19052                 MP_WritePhyUshort(sc, 0x14, 0x4328);
19053                 MP_WritePhyUshort(sc, 0x14, 0x0242);
19054                 MP_WritePhyUshort(sc, 0x14, 0x970c);
19055                 MP_WritePhyUshort(sc, 0x14, 0x141e);
19056                 MP_WritePhyUshort(sc, 0x14, 0x21bf);
19057                 MP_WritePhyUshort(sc, 0x14, 0x44b1);
19058                 MP_WritePhyUshort(sc, 0x14, 0x0242);
19059                 MP_WritePhyUshort(sc, 0x14, 0x970c);
19060                 MP_WritePhyUshort(sc, 0x14, 0x161e);
19061                 MP_WritePhyUshort(sc, 0x14, 0x21e6);
19062                 MP_WritePhyUshort(sc, 0x14, 0x8242);
19063                 MP_WritePhyUshort(sc, 0x14, 0xee82);
19064                 MP_WritePhyUshort(sc, 0x14, 0x4101);
19065                 MP_WritePhyUshort(sc, 0x14, 0xef96);
19066                 MP_WritePhyUshort(sc, 0x14, 0xfefd);
19067                 MP_WritePhyUshort(sc, 0x14, 0xfc04);
19068                 MP_WritePhyUshort(sc, 0x14, 0xf8fa);
19069                 MP_WritePhyUshort(sc, 0x14, 0xef69);
19070                 MP_WritePhyUshort(sc, 0x14, 0xe082);
19071                 MP_WritePhyUshort(sc, 0x14, 0x46a0);
19072                 MP_WritePhyUshort(sc, 0x14, 0x0005);
19073                 MP_WritePhyUshort(sc, 0x14, 0x0286);
19074                 MP_WritePhyUshort(sc, 0x14, 0x96ae);
19075                 MP_WritePhyUshort(sc, 0x14, 0x06a0);
19076                 MP_WritePhyUshort(sc, 0x14, 0x0103);
19077                 MP_WritePhyUshort(sc, 0x14, 0x0219);
19078                 MP_WritePhyUshort(sc, 0x14, 0x19ef);
19079                 MP_WritePhyUshort(sc, 0x14, 0x96fe);
19080                 MP_WritePhyUshort(sc, 0x14, 0xfc04);
19081                 MP_WritePhyUshort(sc, 0x14, 0xf8fa);
19082                 MP_WritePhyUshort(sc, 0x14, 0xef69);
19083                 MP_WritePhyUshort(sc, 0x14, 0xe082);
19084                 MP_WritePhyUshort(sc, 0x14, 0x29f6);
19085                 MP_WritePhyUshort(sc, 0x14, 0x20e4);
19086                 MP_WritePhyUshort(sc, 0x14, 0x8229);
19087                 MP_WritePhyUshort(sc, 0x14, 0xe080);
19088                 MP_WritePhyUshort(sc, 0x14, 0x10ac);
19089                 MP_WritePhyUshort(sc, 0x14, 0x2102);
19090                 MP_WritePhyUshort(sc, 0x14, 0xae54);
19091                 MP_WritePhyUshort(sc, 0x14, 0xe082);
19092                 MP_WritePhyUshort(sc, 0x14, 0x27f7);
19093                 MP_WritePhyUshort(sc, 0x14, 0x20e4);
19094                 MP_WritePhyUshort(sc, 0x14, 0x8227);
19095                 MP_WritePhyUshort(sc, 0x14, 0xbf42);
19096                 MP_WritePhyUshort(sc, 0x14, 0xe602);
19097                 MP_WritePhyUshort(sc, 0x14, 0x4297);
19098                 MP_WritePhyUshort(sc, 0x14, 0xac28);
19099                 MP_WritePhyUshort(sc, 0x14, 0x22bf);
19100                 MP_WritePhyUshort(sc, 0x14, 0x430d);
19101                 MP_WritePhyUshort(sc, 0x14, 0x0242);
19102                 MP_WritePhyUshort(sc, 0x14, 0x97e5);
19103                 MP_WritePhyUshort(sc, 0x14, 0x8247);
19104                 MP_WritePhyUshort(sc, 0x14, 0xac28);
19105                 MP_WritePhyUshort(sc, 0x14, 0x20d1);
19106                 MP_WritePhyUshort(sc, 0x14, 0x03bf);
19107                 MP_WritePhyUshort(sc, 0x14, 0x4307);
19108                 MP_WritePhyUshort(sc, 0x14, 0x0242);
19109                 MP_WritePhyUshort(sc, 0x14, 0x59ee);
19110                 MP_WritePhyUshort(sc, 0x14, 0x8246);
19111                 MP_WritePhyUshort(sc, 0x14, 0x00e1);
19112                 MP_WritePhyUshort(sc, 0x14, 0x8227);
19113                 MP_WritePhyUshort(sc, 0x14, 0xf628);
19114                 MP_WritePhyUshort(sc, 0x14, 0xe582);
19115                 MP_WritePhyUshort(sc, 0x14, 0x27ae);
19116                 MP_WritePhyUshort(sc, 0x14, 0x21d1);
19117                 MP_WritePhyUshort(sc, 0x14, 0x04bf);
19118                 MP_WritePhyUshort(sc, 0x14, 0x4307);
19119                 MP_WritePhyUshort(sc, 0x14, 0x0242);
19120                 MP_WritePhyUshort(sc, 0x14, 0x59ae);
19121                 MP_WritePhyUshort(sc, 0x14, 0x08d1);
19122                 MP_WritePhyUshort(sc, 0x14, 0x05bf);
19123                 MP_WritePhyUshort(sc, 0x14, 0x4307);
19124                 MP_WritePhyUshort(sc, 0x14, 0x0242);
19125                 MP_WritePhyUshort(sc, 0x14, 0x59e0);
19126                 MP_WritePhyUshort(sc, 0x14, 0x8244);
19127                 MP_WritePhyUshort(sc, 0x14, 0xf720);
19128                 MP_WritePhyUshort(sc, 0x14, 0xe482);
19129                 MP_WritePhyUshort(sc, 0x14, 0x4402);
19130                 MP_WritePhyUshort(sc, 0x14, 0x46ae);
19131                 MP_WritePhyUshort(sc, 0x14, 0xee82);
19132                 MP_WritePhyUshort(sc, 0x14, 0x4601);
19133                 MP_WritePhyUshort(sc, 0x14, 0xef96);
19134                 MP_WritePhyUshort(sc, 0x14, 0xfefc);
19135                 MP_WritePhyUshort(sc, 0x14, 0x04f8);
19136                 MP_WritePhyUshort(sc, 0x14, 0xfaef);
19137                 MP_WritePhyUshort(sc, 0x14, 0x69e0);
19138                 MP_WritePhyUshort(sc, 0x14, 0x8013);
19139                 MP_WritePhyUshort(sc, 0x14, 0xad24);
19140                 MP_WritePhyUshort(sc, 0x14, 0x1cbf);
19141                 MP_WritePhyUshort(sc, 0x14, 0x87f0);
19142                 MP_WritePhyUshort(sc, 0x14, 0x0242);
19143                 MP_WritePhyUshort(sc, 0x14, 0x97ad);
19144                 MP_WritePhyUshort(sc, 0x14, 0x2813);
19145                 MP_WritePhyUshort(sc, 0x14, 0xe087);
19146                 MP_WritePhyUshort(sc, 0x14, 0xfca0);
19147                 MP_WritePhyUshort(sc, 0x14, 0x0005);
19148                 MP_WritePhyUshort(sc, 0x14, 0x0287);
19149                 MP_WritePhyUshort(sc, 0x14, 0x36ae);
19150                 MP_WritePhyUshort(sc, 0x14, 0x10a0);
19151                 MP_WritePhyUshort(sc, 0x14, 0x0105);
19152                 MP_WritePhyUshort(sc, 0x14, 0x0287);
19153                 MP_WritePhyUshort(sc, 0x14, 0x48ae);
19154                 MP_WritePhyUshort(sc, 0x14, 0x08e0);
19155                 MP_WritePhyUshort(sc, 0x14, 0x8230);
19156                 MP_WritePhyUshort(sc, 0x14, 0xf626);
19157                 MP_WritePhyUshort(sc, 0x14, 0xe482);
19158                 MP_WritePhyUshort(sc, 0x14, 0x30ef);
19159                 MP_WritePhyUshort(sc, 0x14, 0x96fe);
19160                 MP_WritePhyUshort(sc, 0x14, 0xfc04);
19161                 MP_WritePhyUshort(sc, 0x14, 0xf8e0);
19162                 MP_WritePhyUshort(sc, 0x14, 0x8245);
19163                 MP_WritePhyUshort(sc, 0x14, 0xf722);
19164                 MP_WritePhyUshort(sc, 0x14, 0xe482);
19165                 MP_WritePhyUshort(sc, 0x14, 0x4502);
19166                 MP_WritePhyUshort(sc, 0x14, 0x46ae);
19167                 MP_WritePhyUshort(sc, 0x14, 0xee87);
19168                 MP_WritePhyUshort(sc, 0x14, 0xfc01);
19169                 MP_WritePhyUshort(sc, 0x14, 0xfc04);
19170                 MP_WritePhyUshort(sc, 0x14, 0xf8fa);
19171                 MP_WritePhyUshort(sc, 0x14, 0xef69);
19172                 MP_WritePhyUshort(sc, 0x14, 0xfb02);
19173                 MP_WritePhyUshort(sc, 0x14, 0x46d3);
19174                 MP_WritePhyUshort(sc, 0x14, 0xad50);
19175                 MP_WritePhyUshort(sc, 0x14, 0x2fbf);
19176                 MP_WritePhyUshort(sc, 0x14, 0x87ed);
19177                 MP_WritePhyUshort(sc, 0x14, 0xd101);
19178                 MP_WritePhyUshort(sc, 0x14, 0x0242);
19179                 MP_WritePhyUshort(sc, 0x14, 0x59bf);
19180                 MP_WritePhyUshort(sc, 0x14, 0x87ed);
19181                 MP_WritePhyUshort(sc, 0x14, 0xd100);
19182                 MP_WritePhyUshort(sc, 0x14, 0x0242);
19183                 MP_WritePhyUshort(sc, 0x14, 0x59e0);
19184                 MP_WritePhyUshort(sc, 0x14, 0x8245);
19185                 MP_WritePhyUshort(sc, 0x14, 0xf622);
19186                 MP_WritePhyUshort(sc, 0x14, 0xe482);
19187                 MP_WritePhyUshort(sc, 0x14, 0x4502);
19188                 MP_WritePhyUshort(sc, 0x14, 0x46ae);
19189                 MP_WritePhyUshort(sc, 0x14, 0xd100);
19190                 MP_WritePhyUshort(sc, 0x14, 0xbf87);
19191                 MP_WritePhyUshort(sc, 0x14, 0xf002);
19192                 MP_WritePhyUshort(sc, 0x14, 0x4259);
19193                 MP_WritePhyUshort(sc, 0x14, 0xee87);
19194                 MP_WritePhyUshort(sc, 0x14, 0xfc00);
19195                 MP_WritePhyUshort(sc, 0x14, 0xe082);
19196                 MP_WritePhyUshort(sc, 0x14, 0x30f6);
19197                 MP_WritePhyUshort(sc, 0x14, 0x26e4);
19198                 MP_WritePhyUshort(sc, 0x14, 0x8230);
19199                 MP_WritePhyUshort(sc, 0x14, 0xffef);
19200                 MP_WritePhyUshort(sc, 0x14, 0x96fe);
19201                 MP_WritePhyUshort(sc, 0x14, 0xfc04);
19202                 MP_WritePhyUshort(sc, 0x14, 0xf8f9);
19203                 MP_WritePhyUshort(sc, 0x14, 0xface);
19204                 MP_WritePhyUshort(sc, 0x14, 0xfaef);
19205                 MP_WritePhyUshort(sc, 0x14, 0x69fb);
19206                 MP_WritePhyUshort(sc, 0x14, 0xbf87);
19207                 MP_WritePhyUshort(sc, 0x14, 0xb3d7);
19208                 MP_WritePhyUshort(sc, 0x14, 0x001c);
19209                 MP_WritePhyUshort(sc, 0x14, 0xd819);
19210                 MP_WritePhyUshort(sc, 0x14, 0xd919);
19211                 MP_WritePhyUshort(sc, 0x14, 0xda19);
19212                 MP_WritePhyUshort(sc, 0x14, 0xdb19);
19213                 MP_WritePhyUshort(sc, 0x14, 0x07ef);
19214                 MP_WritePhyUshort(sc, 0x14, 0x9502);
19215                 MP_WritePhyUshort(sc, 0x14, 0x4259);
19216                 MP_WritePhyUshort(sc, 0x14, 0x073f);
19217                 MP_WritePhyUshort(sc, 0x14, 0x0004);
19218                 MP_WritePhyUshort(sc, 0x14, 0x9fec);
19219                 MP_WritePhyUshort(sc, 0x14, 0xffef);
19220                 MP_WritePhyUshort(sc, 0x14, 0x96fe);
19221                 MP_WritePhyUshort(sc, 0x14, 0xc6fe);
19222                 MP_WritePhyUshort(sc, 0x14, 0xfdfc);
19223                 MP_WritePhyUshort(sc, 0x14, 0x0400);
19224                 MP_WritePhyUshort(sc, 0x14, 0x0145);
19225                 MP_WritePhyUshort(sc, 0x14, 0x7d00);
19226                 MP_WritePhyUshort(sc, 0x14, 0x0345);
19227                 MP_WritePhyUshort(sc, 0x14, 0x5c00);
19228                 MP_WritePhyUshort(sc, 0x14, 0x0143);
19229                 MP_WritePhyUshort(sc, 0x14, 0x4f00);
19230                 MP_WritePhyUshort(sc, 0x14, 0x0387);
19231                 MP_WritePhyUshort(sc, 0x14, 0xdb00);
19232                 MP_WritePhyUshort(sc, 0x14, 0x0987);
19233                 MP_WritePhyUshort(sc, 0x14, 0xde00);
19234                 MP_WritePhyUshort(sc, 0x14, 0x0987);
19235                 MP_WritePhyUshort(sc, 0x14, 0xe100);
19236                 MP_WritePhyUshort(sc, 0x14, 0x0087);
19237                 MP_WritePhyUshort(sc, 0x14, 0xeaa4);
19238                 MP_WritePhyUshort(sc, 0x14, 0x00b8);
19239                 MP_WritePhyUshort(sc, 0x14, 0x20c4);
19240                 MP_WritePhyUshort(sc, 0x14, 0x1600);
19241                 MP_WritePhyUshort(sc, 0x14, 0x000f);
19242                 MP_WritePhyUshort(sc, 0x14, 0xf800);
19243                 MP_WritePhyUshort(sc, 0x14, 0x7098);
19244                 MP_WritePhyUshort(sc, 0x14, 0xa58a);
19245                 MP_WritePhyUshort(sc, 0x14, 0xb6a8);
19246                 MP_WritePhyUshort(sc, 0x14, 0x3e50);
19247                 MP_WritePhyUshort(sc, 0x14, 0xa83e);
19248                 MP_WritePhyUshort(sc, 0x14, 0x33bc);
19249                 MP_WritePhyUshort(sc, 0x14, 0xc622);
19250                 MP_WritePhyUshort(sc, 0x14, 0xbcc6);
19251                 MP_WritePhyUshort(sc, 0x14, 0xaaa4);
19252                 MP_WritePhyUshort(sc, 0x14, 0x42ff);
19253                 MP_WritePhyUshort(sc, 0x14, 0xc408);
19254                 MP_WritePhyUshort(sc, 0x14, 0x00c4);
19255                 MP_WritePhyUshort(sc, 0x14, 0x16a8);
19256                 MP_WritePhyUshort(sc, 0x14, 0xbcc0);
19257                 MP_WritePhyUshort(sc, 0x13, 0xb818);
19258                 MP_WritePhyUshort(sc, 0x14, 0x02f3);
19259                 MP_WritePhyUshort(sc, 0x13, 0xb81a);
19260                 MP_WritePhyUshort(sc, 0x14, 0x17d1);
19261                 MP_WritePhyUshort(sc, 0x13, 0xb81c);
19262                 MP_WritePhyUshort(sc, 0x14, 0x185a);
19263                 MP_WritePhyUshort(sc, 0x13, 0xb81e);
19264                 MP_WritePhyUshort(sc, 0x14, 0x3c66);
19265                 MP_WritePhyUshort(sc, 0x13, 0xb820);
19266                 MP_WritePhyUshort(sc, 0x14, 0x021f);
19267                 MP_WritePhyUshort(sc, 0x13, 0xc416);
19268                 MP_WritePhyUshort(sc, 0x14, 0x0500);
19269                 MP_WritePhyUshort(sc, 0x13, 0xb82e);
19270                 MP_WritePhyUshort(sc, 0x14, 0xfffc);
19271
19272                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19273                 MP_WritePhyUshort(sc, 0x13, 0x0000);
19274                 MP_WritePhyUshort(sc, 0x14, 0x0000);
19275                 MP_WritePhyUshort(sc, 0x1f, 0x0B82);
19276                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19277                 PhyRegValue &= ~(BIT_9);
19278                 MP_WritePhyUshort(sc, 0x10, PhyRegValue);
19279                 MP_WritePhyUshort(sc, 0x1f, 0x0A43);
19280                 MP_WritePhyUshort(sc, 0x13, 0x8146);
19281                 MP_WritePhyUshort(sc, 0x14, 0x0000);
19282
19283                 MP_WritePhyUshort(sc, 0x1f, 0x0B82);
19284                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19285                 PhyRegValue &= ~(BIT_4);
19286                 MP_WritePhyUshort(sc, 0x10, PhyRegValue); // release patch request
19287
19288
19289                 MP_WritePhyUshort(sc, 0x1F, 0x0A46);
19290                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19291                 TmpUshort = (PhyRegValue & BIT_8) ? 0 : BIT_15;
19292
19293                 MP_WritePhyUshort(sc, 0x1F, 0x0BCC);
19294                 ClearEthPhyBit(sc, 0x12, BIT_15);
19295                 SetEthPhyBit(sc, 0x12, TmpUshort);
19296
19297
19298                 MP_WritePhyUshort(sc, 0x1F, 0x0A46);
19299                 PhyRegValue = MP_ReadPhyUshort(sc, 0x13);
19300                 TmpUshort = (PhyRegValue & BIT_8) ? BIT_1 : 0;
19301
19302                 MP_WritePhyUshort(sc, 0x1F, 0x0C41);
19303                 ClearEthPhyBit(sc, 0x15, BIT_1);
19304                 SetEthPhyBit(sc, 0x15, TmpUshort);
19305
19306                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
19307                 SetEthPhyBit(sc, 0x11, (BIT_3 | BIT_2));
19308                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
19309
19310
19311                 MP_WritePhyUshort(sc, 0x1F, 0x0BCC);
19312                 ClearEthPhyBit(sc, 0x14, BIT_8);
19313                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
19314                 SetEthPhyBit(sc, 0x11, BIT_7);
19315                 SetEthPhyBit(sc, 0x11, BIT_6);
19316                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19317                 MP_WritePhyUshort(sc, 0x13, 0x8084);
19318                 ClearEthPhyBit(sc, 0x14, (BIT_14 | BIT_13));
19319                 SetEthPhyBit(sc, 0x10, BIT_12);
19320                 SetEthPhyBit(sc, 0x10, BIT_1);
19321                 SetEthPhyBit(sc, 0x10, BIT_0);
19322                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
19323
19324
19325                 MP_WritePhyUshort(sc, 0x1F, 0x0A4B);
19326                 SetEthPhyBit(sc, 0x11, BIT_2);
19327                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
19328
19329
19330
19331                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19332                 MP_WritePhyUshort(sc, 0x13, 0x8012);
19333                 SetEthPhyBit(sc, 0x14, BIT_15);
19334                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
19335
19336
19337
19338                 MP_WritePhyUshort(sc, 0x1F, 0x0C42);
19339                 ClearAndSetEthPhyBit(sc,
19340                                      0x11,
19341                                      BIT_13 ,
19342                                      BIT_14
19343                                     );
19344                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
19345
19346                 if (phy_power_saving == 1) {
19347                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19348                         SetEthPhyBit(sc, 0x10, BIT_2);
19349                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
19350                 } else {
19351                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19352                         ClearEthPhyBit(sc, 0x10, BIT_2);
19353                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
19354                         DELAY(20000);
19355                 }
19356
19357                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19358                 MP_WritePhyUshort(sc, 0x13, 0x809A);
19359                 MP_WritePhyUshort(sc, 0x14, 0x8022);
19360                 MP_WritePhyUshort(sc, 0x13, 0x80A0);
19361                 ClearAndSetEthPhyBit(sc,
19362                                      0x14,
19363                                      0xFF00,
19364                                      0x1000
19365                                     );
19366                 MP_WritePhyUshort(sc, 0x13, 0x8088);
19367                 MP_WritePhyUshort(sc, 0x14, 0x9222);
19368                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
19369
19370                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19371                 MP_WritePhyUshort(sc, 0x13, 0x8011);
19372                 ClearEthPhyBit(sc, 0x14, BIT_14);
19373                 MP_WritePhyUshort(sc, 0x1F, 0x0A40);
19374                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
19375                 MP_WritePhyUshort(sc, 0x00, 0x9200);
19376         } else if (sc->re_type == MACFG_58) {
19377                 MP_WritePhyUshort(sc, 0x1F, 0x0BCC);
19378                 ClearEthPhyBit(sc, 0x14, BIT_8);
19379                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
19380                 SetEthPhyBit(sc, 0x11, BIT_7);
19381                 SetEthPhyBit(sc, 0x11, BIT_6);
19382                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19383                 MP_WritePhyUshort(sc, 0x13, 0x8084);
19384                 ClearEthPhyBit(sc, 0x14, (BIT_14 | BIT_13));
19385                 SetEthPhyBit(sc, 0x10, BIT_12);
19386                 SetEthPhyBit(sc, 0x10, BIT_1);
19387                 SetEthPhyBit(sc, 0x10, BIT_0);
19388                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
19389
19390                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19391                 MP_WritePhyUshort(sc, 0x13, 0x8012);
19392                 SetEthPhyBit(sc, 0x14, BIT_15);
19393                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
19394
19395                 MP_WritePhyUshort(sc, 0x1F, 0x0C42);
19396                 ClearAndSetEthPhyBit(sc,
19397                                      0x11,
19398                                      BIT_13 ,
19399                                      BIT_14
19400                                     );
19401                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
19402
19403                 if (phy_power_saving == 1) {
19404                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19405                         SetEthPhyBit(sc, 0x10, BIT_2);
19406                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
19407                 } else {
19408                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19409                         ClearEthPhyBit(sc, 0x10, BIT_2);
19410                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
19411                         DELAY(20000);
19412                 }
19413
19414                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19415                 MP_WritePhyUshort(sc, 0x13, 0x8011);
19416                 ClearEthPhyBit(sc, 0x14, BIT_14);
19417                 MP_WritePhyUshort(sc, 0x1F, 0x0A40);
19418                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
19419                 MP_WritePhyUshort(sc, 0x00, 0x9200);
19420         } else if (sc->re_type == MACFG_59) {
19421                 MP_WritePhyUshort(sc, 0x1f, 0x0B82);
19422                 PhyRegValue = MP_ReadPhyUshort(sc,  0x10);
19423                 PhyRegValue |= BIT_4;
19424                 MP_WritePhyUshort(sc, 0x10, PhyRegValue);
19425
19426                 MP_WritePhyUshort(sc, 0x1f, 0x0B80);
19427                 WaitCnt = 0;
19428                 do {
19429                         PhyRegValue = MP_ReadPhyUshort(sc,  0x10);
19430                         PhyRegValue &= 0x0040;
19431                         DELAY(50);
19432                         DELAY(50);
19433                         WaitCnt++;
19434                 } while(PhyRegValue != 0x0040 && WaitCnt <1000);
19435
19436                 MP_WritePhyUshort(sc, 0x1f, 0x0A43);
19437                 MP_WritePhyUshort(sc, 0x13, 0x8146);
19438                 MP_WritePhyUshort(sc, 0x14, 0x0300);
19439                 MP_WritePhyUshort(sc, 0x13, 0xB82E);
19440                 MP_WritePhyUshort(sc, 0x14, 0x0001);
19441
19442                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19443                 MP_WritePhyUshort(sc, 0x13, 0xb820);
19444                 MP_WritePhyUshort(sc, 0x14, 0x0290);
19445                 MP_WritePhyUshort(sc, 0x13, 0xa012);
19446                 MP_WritePhyUshort(sc, 0x14, 0x0000);
19447                 MP_WritePhyUshort(sc, 0x13, 0xa014);
19448                 MP_WritePhyUshort(sc, 0x14, 0x2c04);
19449                 MP_WritePhyUshort(sc, 0x14, 0x2c07);
19450                 MP_WritePhyUshort(sc, 0x14, 0x2c07);
19451                 MP_WritePhyUshort(sc, 0x14, 0x2c07);
19452                 MP_WritePhyUshort(sc, 0x14, 0xa304);
19453                 MP_WritePhyUshort(sc, 0x14, 0xa301);
19454                 MP_WritePhyUshort(sc, 0x14, 0x207e);
19455                 MP_WritePhyUshort(sc, 0x13, 0xa01a);
19456                 MP_WritePhyUshort(sc, 0x14, 0x0000);
19457                 MP_WritePhyUshort(sc, 0x13, 0xa006);
19458                 MP_WritePhyUshort(sc, 0x14, 0x0fff);
19459                 MP_WritePhyUshort(sc, 0x13, 0xa004);
19460                 MP_WritePhyUshort(sc, 0x14, 0x0fff);
19461                 MP_WritePhyUshort(sc, 0x13, 0xa002);
19462                 MP_WritePhyUshort(sc, 0x14, 0x0fff);
19463                 MP_WritePhyUshort(sc, 0x13, 0xa000);
19464                 MP_WritePhyUshort(sc, 0x14, 0x107c);
19465                 MP_WritePhyUshort(sc, 0x13, 0xb820);
19466                 MP_WritePhyUshort(sc, 0x14, 0x0210);
19467
19468                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19469                 MP_WritePhyUshort(sc, 0x13, 0x0000);
19470                 MP_WritePhyUshort(sc, 0x14, 0x0000);
19471                 MP_WritePhyUshort(sc, 0x1f, 0x0B82);
19472                 PhyRegValue = MP_ReadPhyUshort(sc, 0x17);
19473                 PhyRegValue &= ~(BIT_0);
19474                 MP_WritePhyUshort(sc, 0x17, PhyRegValue);
19475                 MP_WritePhyUshort(sc, 0x1f, 0x0A43);
19476                 MP_WritePhyUshort(sc, 0x13, 0x8146);
19477                 MP_WritePhyUshort(sc, 0x14, 0x0000);
19478
19479                 MP_WritePhyUshort(sc, 0x1f, 0x0B82);
19480                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19481                 PhyRegValue &= ~(BIT_4);
19482                 MP_WritePhyUshort(sc, 0x10, PhyRegValue);
19483
19484                 MP_WritePhyUshort(sc, 0x1F, 0x0BCC);
19485                 ClearEthPhyBit(sc, 0x14, BIT_8);
19486                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
19487                 SetEthPhyBit(sc, 0x11, BIT_7);
19488                 SetEthPhyBit(sc, 0x11, BIT_6);
19489                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19490                 MP_WritePhyUshort(sc, 0x13, 0x8084);
19491                 ClearEthPhyBit(sc, 0x14, (BIT_14 | BIT_13));
19492                 SetEthPhyBit(sc, 0x10, BIT_12);
19493                 SetEthPhyBit(sc, 0x10, BIT_1);
19494                 SetEthPhyBit(sc, 0x10, BIT_0);
19495
19496
19497                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19498                 MP_WritePhyUshort(sc, 0x13, 0x8012);
19499                 SetEthPhyBit(sc, 0x14, BIT_15);
19500                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
19501
19502                 MP_WritePhyUshort(sc, 0x1F, 0x0BCE);
19503                 MP_WritePhyUshort(sc, 0x12, 0x8860);
19504                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
19505
19506                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19507                 MP_WritePhyUshort(sc, 0x13, 0x80F3);
19508                 ClearAndSetEthPhyBit(sc,
19509                                      0x14,
19510                                      0xFF00 ,
19511                                      0x8B00
19512                                     );
19513                 MP_WritePhyUshort(sc, 0x13, 0x80F0);
19514                 ClearAndSetEthPhyBit(sc,
19515                                      0x14,
19516                                      0xFF00 ,
19517                                      0x3A00
19518                                     );
19519                 MP_WritePhyUshort(sc, 0x13, 0x80EF);
19520                 ClearAndSetEthPhyBit(sc,
19521                                      0x14,
19522                                      0xFF00 ,
19523                                      0x0500
19524                                     );
19525                 MP_WritePhyUshort(sc, 0x13, 0x80F6);
19526                 ClearAndSetEthPhyBit(sc,
19527                                      0x14,
19528                                      0xFF00 ,
19529                                      0x6E00
19530                                     );
19531                 MP_WritePhyUshort(sc, 0x13, 0x80EC);
19532                 ClearAndSetEthPhyBit(sc,
19533                                      0x14,
19534                                      0xFF00 ,
19535                                      0x6800
19536                                     );
19537                 MP_WritePhyUshort(sc, 0x13, 0x80ED);
19538                 ClearAndSetEthPhyBit(sc,
19539                                      0x14,
19540                                      0xFF00 ,
19541                                      0x7C00
19542                                     );
19543                 MP_WritePhyUshort(sc, 0x13, 0x80F2);
19544                 ClearAndSetEthPhyBit(sc,
19545                                      0x14,
19546                                      0xFF00 ,
19547                                      0xF400
19548                                     );
19549                 MP_WritePhyUshort(sc, 0x13, 0x80F4);
19550                 ClearAndSetEthPhyBit(sc,
19551                                      0x14,
19552                                      0xFF00 ,
19553                                      0x8500
19554                                     );
19555
19556                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19557                 MP_WritePhyUshort(sc, 0x13, 0x8110);
19558                 ClearAndSetEthPhyBit(sc,
19559                                      0x14,
19560                                      0xFF00 ,
19561                                      0xA800
19562                                     );
19563                 MP_WritePhyUshort(sc, 0x13, 0x810F);
19564                 ClearAndSetEthPhyBit(sc,
19565                                      0x14,
19566                                      0xFF00 ,
19567                                      0x1D00
19568                                     );
19569                 MP_WritePhyUshort(sc, 0x13, 0x8111);
19570                 ClearAndSetEthPhyBit(sc,
19571                                      0x14,
19572                                      0xFF00 ,
19573                                      0xF500
19574                                     );
19575                 MP_WritePhyUshort(sc, 0x13, 0x8113);
19576                 ClearAndSetEthPhyBit(sc,
19577                                      0x14,
19578                                      0xFF00 ,
19579                                      0x6100
19580                                     );
19581                 MP_WritePhyUshort(sc, 0x13, 0x8115);
19582                 ClearAndSetEthPhyBit(sc,
19583                                      0x14,
19584                                      0xFF00 ,
19585                                      0x9200
19586                                     );
19587                 MP_WritePhyUshort(sc, 0x13, 0x810E);
19588                 ClearAndSetEthPhyBit(sc,
19589                                      0x14,
19590                                      0xFF00 ,
19591                                      0x0400
19592                                     );
19593                 MP_WritePhyUshort(sc, 0x13, 0x810C);
19594                 ClearAndSetEthPhyBit(sc,
19595                                      0x14,
19596                                      0xFF00 ,
19597                                      0x7C00
19598                                     );
19599                 MP_WritePhyUshort(sc, 0x13, 0x810B);
19600                 ClearAndSetEthPhyBit(sc,
19601                                      0x14,
19602                                      0xFF00 ,
19603                                      0x5A00
19604                                     );
19605
19606                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19607                 MP_WritePhyUshort(sc, 0x13, 0x80D1);
19608                 ClearAndSetEthPhyBit(sc,
19609                                      0x14,
19610                                      0xFF00 ,
19611                                      0xFF00
19612                                     );
19613                 MP_WritePhyUshort(sc, 0x13, 0x80CD);
19614                 ClearAndSetEthPhyBit(sc,
19615                                      0x14,
19616                                      0xFF00 ,
19617                                      0x9E00
19618                                     );
19619                 MP_WritePhyUshort(sc, 0x13, 0x80D3);
19620                 ClearAndSetEthPhyBit(sc,
19621                                      0x14,
19622                                      0xFF00 ,
19623                                      0x0E00
19624                                     );
19625                 MP_WritePhyUshort(sc, 0x13, 0x80D5);
19626                 ClearAndSetEthPhyBit(sc,
19627                                      0x14,
19628                                      0xFF00 ,
19629                                      0xCA00
19630                                     );
19631                 MP_WritePhyUshort(sc, 0x13, 0x80D7);
19632                 ClearAndSetEthPhyBit(sc,
19633                                      0x14,
19634                                      0xFF00 ,
19635                                      0x8400
19636                                     );
19637
19638                 if (phy_power_saving == 1) {
19639                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19640                         SetEthPhyBit(sc, 0x10, BIT_2);
19641                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
19642                 } else {
19643                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19644                         ClearEthPhyBit(sc, 0x10, BIT_2);
19645                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
19646                         DELAY(20000);
19647                 }
19648
19649                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19650                 MP_WritePhyUshort(sc, 0x13, 0x8011);
19651                 ClearEthPhyBit(sc, 0x14, BIT_14);
19652                 MP_WritePhyUshort(sc, 0x1F, 0x0A40);
19653                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
19654                 MP_WritePhyUshort(sc, 0x00, 0x9200);
19655         } else if (sc->re_type == MACFG_60) {
19656                 MP_WritePhyUshort(sc, 0x1f, 0x0B82);
19657                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19658                 PhyRegValue |= BIT_4;
19659                 MP_WritePhyUshort(sc, 0x10, PhyRegValue);
19660
19661                 MP_WritePhyUshort(sc, 0x1f, 0x0B80);
19662                 WaitCnt = 0;
19663                 do {
19664                         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19665                         PhyRegValue &= 0x0040;
19666                         DELAY(50);
19667                         DELAY(50);
19668                         WaitCnt++;
19669                 } while(PhyRegValue != 0x0040 && WaitCnt <1000);
19670
19671                 MP_WritePhyUshort(sc, 0x1f, 0x0A43);
19672                 MP_WritePhyUshort(sc, 0x13, 0x8146);
19673                 MP_WritePhyUshort(sc, 0x14, 0x0100);
19674                 MP_WritePhyUshort(sc, 0x13, 0xB82E);
19675                 MP_WritePhyUshort(sc, 0x14, 0x0001);
19676
19677                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19678                 MP_WritePhyUshort(sc, 0x13, 0xb820);
19679                 MP_WritePhyUshort(sc, 0x14, 0x0290);
19680                 MP_WritePhyUshort(sc, 0x13, 0xa012);
19681                 MP_WritePhyUshort(sc, 0x14, 0x0000);
19682                 MP_WritePhyUshort(sc, 0x13, 0xa014);
19683                 MP_WritePhyUshort(sc, 0x14, 0x2c04);
19684                 MP_WritePhyUshort(sc, 0x14, 0x2c07);
19685                 MP_WritePhyUshort(sc, 0x14, 0x2c07);
19686                 MP_WritePhyUshort(sc, 0x14, 0x2c07);
19687                 MP_WritePhyUshort(sc, 0x14, 0xa304);
19688                 MP_WritePhyUshort(sc, 0x14, 0xa301);
19689                 MP_WritePhyUshort(sc, 0x14, 0x207e);
19690                 MP_WritePhyUshort(sc, 0x13, 0xa01a);
19691                 MP_WritePhyUshort(sc, 0x14, 0x0000);
19692                 MP_WritePhyUshort(sc, 0x13, 0xa006);
19693                 MP_WritePhyUshort(sc, 0x14, 0x0fff);
19694                 MP_WritePhyUshort(sc, 0x13, 0xa004);
19695                 MP_WritePhyUshort(sc, 0x14, 0x0fff);
19696                 MP_WritePhyUshort(sc, 0x13, 0xa002);
19697                 MP_WritePhyUshort(sc, 0x14, 0x0fff);
19698                 MP_WritePhyUshort(sc, 0x13, 0xa000);
19699                 MP_WritePhyUshort(sc, 0x14, 0x107c);
19700                 MP_WritePhyUshort(sc, 0x13, 0xb820);
19701                 MP_WritePhyUshort(sc, 0x14, 0x0210);
19702
19703                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19704                 MP_WritePhyUshort(sc, 0x13, 0x0000);
19705                 MP_WritePhyUshort(sc, 0x14, 0x0000);
19706                 MP_WritePhyUshort(sc, 0x1f, 0x0B82);
19707                 PhyRegValue = MP_ReadPhyUshort(sc, 0x17);
19708                 PhyRegValue &= ~(BIT_0);
19709                 MP_WritePhyUshort(sc, 0x17, PhyRegValue);
19710                 MP_WritePhyUshort(sc, 0x1f, 0x0A43);
19711                 MP_WritePhyUshort(sc, 0x13, 0x8146);
19712                 MP_WritePhyUshort(sc, 0x14, 0x0000);
19713
19714                 MP_WritePhyUshort(sc,0x1f, 0x0B82);
19715                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19716                 PhyRegValue &= ~(BIT_4);
19717                 MP_WritePhyUshort(sc,0x10, PhyRegValue);
19718
19719                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19720                 MP_WritePhyUshort(sc, 0x13, 0x8012);
19721                 SetEthPhyBit(sc, 0x14, BIT_15);
19722                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
19723
19724                 MP_WritePhyUshort(sc, 0x1F, 0x0BCE);
19725                 MP_WritePhyUshort(sc, 0x12, 0x8860);
19726                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
19727
19728                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19729                 MP_WritePhyUshort(sc, 0x13, 0x80F3);
19730                 ClearAndSetEthPhyBit(sc,
19731                                      0x14,
19732                                      0xFF00 ,
19733                                      0x8B00
19734                                     );
19735                 MP_WritePhyUshort(sc, 0x13, 0x80F0);
19736                 ClearAndSetEthPhyBit(sc,
19737                                      0x14,
19738                                      0xFF00 ,
19739                                      0x3A00
19740                                     );
19741                 MP_WritePhyUshort(sc, 0x13, 0x80EF);
19742                 ClearAndSetEthPhyBit(sc,
19743                                      0x14,
19744                                      0xFF00 ,
19745                                      0x0500
19746                                     );
19747                 MP_WritePhyUshort(sc, 0x13, 0x80F6);
19748                 ClearAndSetEthPhyBit(sc,
19749                                      0x14,
19750                                      0xFF00 ,
19751                                      0x6E00
19752                                     );
19753                 MP_WritePhyUshort(sc, 0x13, 0x80EC);
19754                 ClearAndSetEthPhyBit(sc,
19755                                      0x14,
19756                                      0xFF00 ,
19757                                      0x6800
19758                                     );
19759                 MP_WritePhyUshort(sc, 0x13, 0x80ED);
19760                 ClearAndSetEthPhyBit(sc,
19761                                      0x14,
19762                                      0xFF00 ,
19763                                      0x7C00
19764                                     );
19765                 MP_WritePhyUshort(sc, 0x13, 0x80F2);
19766                 ClearAndSetEthPhyBit(sc,
19767                                      0x14,
19768                                      0xFF00 ,
19769                                      0xF400
19770                                     );
19771                 MP_WritePhyUshort(sc, 0x13, 0x80F4);
19772                 ClearAndSetEthPhyBit(sc,
19773                                      0x14,
19774                                      0xFF00 ,
19775                                      0x8500
19776                                     );
19777
19778                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19779                 MP_WritePhyUshort(sc, 0x13, 0x8110);
19780                 ClearAndSetEthPhyBit(sc,
19781                                      0x14,
19782                                      0xFF00 ,
19783                                      0xA800
19784                                     );
19785                 MP_WritePhyUshort(sc, 0x13, 0x810F);
19786                 ClearAndSetEthPhyBit(sc,
19787                                      0x14,
19788                                      0xFF00 ,
19789                                      0x1D00
19790                                     );
19791                 MP_WritePhyUshort(sc, 0x13, 0x8111);
19792                 ClearAndSetEthPhyBit(sc,
19793                                      0x14,
19794                                      0xFF00 ,
19795                                      0xF500
19796                                     );
19797                 MP_WritePhyUshort(sc, 0x13, 0x8113);
19798                 ClearAndSetEthPhyBit(sc,
19799                                      0x14,
19800                                      0xFF00 ,
19801                                      0x6100
19802                                     );
19803                 MP_WritePhyUshort(sc, 0x13, 0x8115);
19804                 ClearAndSetEthPhyBit(sc,
19805                                      0x14,
19806                                      0xFF00 ,
19807                                      0x9200
19808                                     );
19809                 MP_WritePhyUshort(sc, 0x13, 0x810E);
19810                 ClearAndSetEthPhyBit(sc,
19811                                      0x14,
19812                                      0xFF00 ,
19813                                      0x0400
19814                                     );
19815                 MP_WritePhyUshort(sc, 0x13, 0x810C);
19816                 ClearAndSetEthPhyBit(sc,
19817                                      0x14,
19818                                      0xFF00 ,
19819                                      0x7C00
19820                                     );
19821                 MP_WritePhyUshort(sc, 0x13, 0x810B);
19822                 ClearAndSetEthPhyBit(sc,
19823                                      0x14,
19824                                      0xFF00 ,
19825                                      0x5A00
19826                                     );
19827
19828                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19829                 MP_WritePhyUshort(sc, 0x13, 0x80D1);
19830                 ClearAndSetEthPhyBit(sc,
19831                                      0x14,
19832                                      0xFF00 ,
19833                                      0xFF00
19834                                     );
19835                 MP_WritePhyUshort(sc, 0x13, 0x80CD);
19836                 ClearAndSetEthPhyBit(sc,
19837                                      0x14,
19838                                      0xFF00 ,
19839                                      0x9E00
19840                                     );
19841                 MP_WritePhyUshort(sc, 0x13, 0x80D3);
19842                 ClearAndSetEthPhyBit(sc,
19843                                      0x14,
19844                                      0xFF00 ,
19845                                      0x0E00
19846                                     );
19847                 MP_WritePhyUshort(sc, 0x13, 0x80D5);
19848                 ClearAndSetEthPhyBit(sc,
19849                                      0x14,
19850                                      0xFF00 ,
19851                                      0xCA00
19852                                     );
19853                 MP_WritePhyUshort(sc, 0x13, 0x80D7);
19854                 ClearAndSetEthPhyBit(sc,
19855                                      0x14,
19856                                      0xFF00 ,
19857                                      0x8400
19858                                     );
19859
19860                 if (phy_power_saving == 1) {
19861                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19862                         SetEthPhyBit(sc, 0x10, BIT_2);
19863                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
19864                 } else {
19865                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19866                         ClearEthPhyBit(sc, 0x10, BIT_2);
19867                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
19868                         DELAY(20000);
19869                 }
19870
19871                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
19872                 MP_WritePhyUshort(sc, 0x13, 0x8011);
19873                 ClearEthPhyBit(sc, 0x14, BIT_14);
19874                 MP_WritePhyUshort(sc, 0x1F, 0x0A40);
19875                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
19876                 MP_WritePhyUshort(sc, 0x00, 0x9200);
19877         } else if (sc->re_type == MACFG_61) {
19878                 MP_WritePhyUshort(sc,0x1f, 0x0B82);
19879                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19880                 PhyRegValue |= BIT_4;
19881                 MP_WritePhyUshort(sc,0x10, PhyRegValue);
19882
19883                 MP_WritePhyUshort(sc,0x1f, 0x0B80);
19884                 WaitCnt = 0;
19885                 do {
19886                         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
19887                         PhyRegValue &= 0x0040;
19888                         DELAY(50);
19889                         DELAY(50);
19890                         WaitCnt++;
19891                 } while(PhyRegValue != 0x0040 && WaitCnt <1000);
19892
19893                 MP_WritePhyUshort(sc,0x1f, 0x0A43);
19894                 MP_WritePhyUshort(sc,0x13, 0x8146);
19895                 MP_WritePhyUshort(sc,0x14, 0x2700);
19896                 MP_WritePhyUshort(sc,0x13, 0xB82E);
19897                 MP_WritePhyUshort(sc,0x14, 0x0001);
19898
19899                 MP_WritePhyUshort(sc,0x1F, 0x0A43);
19900                 MP_WritePhyUshort(sc, 0x13, 0xb820);
19901                 MP_WritePhyUshort(sc, 0x14, 0x0090);
19902                 MP_WritePhyUshort(sc, 0x13, 0xa012);
19903                 MP_WritePhyUshort(sc, 0x14, 0x0000);
19904                 MP_WritePhyUshort(sc, 0x13, 0xa014);
19905                 MP_WritePhyUshort(sc, 0x14, 0x2c04);
19906                 MP_WritePhyUshort(sc, 0x14, 0x2c1b);
19907                 MP_WritePhyUshort(sc, 0x14, 0x2c65);
19908                 MP_WritePhyUshort(sc, 0x14, 0x2d14);
19909                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
19910                 MP_WritePhyUshort(sc, 0x14, 0x4092);
19911                 MP_WritePhyUshort(sc, 0x14, 0xba04);
19912                 MP_WritePhyUshort(sc, 0x14, 0x3084);
19913                 MP_WritePhyUshort(sc, 0x14, 0x1d04);
19914                 MP_WritePhyUshort(sc, 0x14, 0x1cdd);
19915                 MP_WritePhyUshort(sc, 0x14, 0x1ce8);
19916                 MP_WritePhyUshort(sc, 0x14, 0xaeff);
19917                 MP_WritePhyUshort(sc, 0x14, 0xaf02);
19918                 MP_WritePhyUshort(sc, 0x14, 0x8f02);
19919                 MP_WritePhyUshort(sc, 0x14, 0x8eff);
19920                 MP_WritePhyUshort(sc, 0x14, 0xce01);
19921                 MP_WritePhyUshort(sc, 0x14, 0xe070);
19922                 MP_WritePhyUshort(sc, 0x14, 0x0f00);
19923                 MP_WritePhyUshort(sc, 0x14, 0xaf01);
19924                 MP_WritePhyUshort(sc, 0x14, 0x8f01);
19925                 MP_WritePhyUshort(sc, 0x14, 0xd712);
19926                 MP_WritePhyUshort(sc, 0x14, 0x5fe8);
19927                 MP_WritePhyUshort(sc, 0x14, 0xaf02);
19928                 MP_WritePhyUshort(sc, 0x14, 0x8f02);
19929                 MP_WritePhyUshort(sc, 0x14, 0x8e01);
19930                 MP_WritePhyUshort(sc, 0x14, 0x1cf2);
19931                 MP_WritePhyUshort(sc, 0x14, 0x2825);
19932                 MP_WritePhyUshort(sc, 0x14, 0xd05a);
19933                 MP_WritePhyUshort(sc, 0x14, 0xd19a);
19934                 MP_WritePhyUshort(sc, 0x14, 0xd709);
19935                 MP_WritePhyUshort(sc, 0x14, 0x608f);
19936                 MP_WritePhyUshort(sc, 0x14, 0xd06b);
19937                 MP_WritePhyUshort(sc, 0x14, 0xd18a);
19938                 MP_WritePhyUshort(sc, 0x14, 0x2c25);
19939                 MP_WritePhyUshort(sc, 0x14, 0xd0be);
19940                 MP_WritePhyUshort(sc, 0x14, 0xd188);
19941                 MP_WritePhyUshort(sc, 0x14, 0x2c25);
19942                 MP_WritePhyUshort(sc, 0x14, 0xd708);
19943                 MP_WritePhyUshort(sc, 0x14, 0x4072);
19944                 MP_WritePhyUshort(sc, 0x14, 0xc104);
19945                 MP_WritePhyUshort(sc, 0x14, 0x2c37);
19946                 MP_WritePhyUshort(sc, 0x14, 0x4076);
19947                 MP_WritePhyUshort(sc, 0x14, 0xc110);
19948                 MP_WritePhyUshort(sc, 0x14, 0x2c37);
19949                 MP_WritePhyUshort(sc, 0x14, 0x4071);
19950                 MP_WritePhyUshort(sc, 0x14, 0xc102);
19951                 MP_WritePhyUshort(sc, 0x14, 0x2c37);
19952                 MP_WritePhyUshort(sc, 0x14, 0x4070);
19953                 MP_WritePhyUshort(sc, 0x14, 0xc101);
19954                 MP_WritePhyUshort(sc, 0x14, 0x2c37);
19955                 MP_WritePhyUshort(sc, 0x14, 0x1786);
19956                 MP_WritePhyUshort(sc, 0x14, 0xd709);
19957                 MP_WritePhyUshort(sc, 0x14, 0x3390);
19958                 MP_WritePhyUshort(sc, 0x14, 0x5c32);
19959                 MP_WritePhyUshort(sc, 0x14, 0x2c47);
19960                 MP_WritePhyUshort(sc, 0x14, 0x1786);
19961                 MP_WritePhyUshort(sc, 0x14, 0xd708);
19962                 MP_WritePhyUshort(sc, 0x14, 0x6193);
19963                 MP_WritePhyUshort(sc, 0x14, 0xd709);
19964                 MP_WritePhyUshort(sc, 0x14, 0x5f9d);
19965                 MP_WritePhyUshort(sc, 0x14, 0x408b);
19966                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
19967                 MP_WritePhyUshort(sc, 0x14, 0x6042);
19968                 MP_WritePhyUshort(sc, 0x14, 0xb401);
19969                 MP_WritePhyUshort(sc, 0x14, 0x1786);
19970                 MP_WritePhyUshort(sc, 0x14, 0xd708);
19971                 MP_WritePhyUshort(sc, 0x14, 0x6073);
19972                 MP_WritePhyUshort(sc, 0x14, 0x5fbc);
19973                 MP_WritePhyUshort(sc, 0x14, 0x2c46);
19974                 MP_WritePhyUshort(sc, 0x14, 0x26fe);
19975                 MP_WritePhyUshort(sc, 0x14, 0xb280);
19976                 MP_WritePhyUshort(sc, 0x14, 0xa841);
19977                 MP_WritePhyUshort(sc, 0x14, 0x94e0);
19978                 MP_WritePhyUshort(sc, 0x14, 0x8710);
19979                 MP_WritePhyUshort(sc, 0x14, 0xd709);
19980                 MP_WritePhyUshort(sc, 0x14, 0x42ec);
19981                 MP_WritePhyUshort(sc, 0x14, 0x606d);
19982                 MP_WritePhyUshort(sc, 0x14, 0xd207);
19983                 MP_WritePhyUshort(sc, 0x14, 0x2c50);
19984                 MP_WritePhyUshort(sc, 0x14, 0xd203);
19985                 MP_WritePhyUshort(sc, 0x14, 0x33ff);
19986                 MP_WritePhyUshort(sc, 0x14, 0x5647);
19987                 MP_WritePhyUshort(sc, 0x14, 0x3275);
19988                 MP_WritePhyUshort(sc, 0x14, 0x7c57);
19989                 MP_WritePhyUshort(sc, 0x14, 0xb240);
19990                 MP_WritePhyUshort(sc, 0x14, 0xb402);
19991                 MP_WritePhyUshort(sc, 0x14, 0x2647);
19992                 MP_WritePhyUshort(sc, 0x14, 0x6096);
19993                 MP_WritePhyUshort(sc, 0x14, 0xb240);
19994                 MP_WritePhyUshort(sc, 0x14, 0xb406);
19995                 MP_WritePhyUshort(sc, 0x14, 0x2647);
19996                 MP_WritePhyUshort(sc, 0x14, 0x31d7);
19997                 MP_WritePhyUshort(sc, 0x14, 0x7c60);
19998                 MP_WritePhyUshort(sc, 0x14, 0xb240);
19999                 MP_WritePhyUshort(sc, 0x14, 0xb40e);
20000                 MP_WritePhyUshort(sc, 0x14, 0x2647);
20001                 MP_WritePhyUshort(sc, 0x14, 0xb410);
20002                 MP_WritePhyUshort(sc, 0x14, 0x8802);
20003                 MP_WritePhyUshort(sc, 0x14, 0xb240);
20004                 MP_WritePhyUshort(sc, 0x14, 0x940e);
20005                 MP_WritePhyUshort(sc, 0x14, 0x2647);
20006                 MP_WritePhyUshort(sc, 0x14, 0xba04);
20007                 MP_WritePhyUshort(sc, 0x14, 0x1cdd);
20008                 MP_WritePhyUshort(sc, 0x14, 0xa902);
20009                 MP_WritePhyUshort(sc, 0x14, 0xd711);
20010                 MP_WritePhyUshort(sc, 0x14, 0x4045);
20011                 MP_WritePhyUshort(sc, 0x14, 0xa980);
20012                 MP_WritePhyUshort(sc, 0x14, 0x3003);
20013                 MP_WritePhyUshort(sc, 0x14, 0x5a19);
20014                 MP_WritePhyUshort(sc, 0x14, 0xa540);
20015                 MP_WritePhyUshort(sc, 0x14, 0xa601);
20016                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20017                 MP_WritePhyUshort(sc, 0x14, 0x4043);
20018                 MP_WritePhyUshort(sc, 0x14, 0xa910);
20019                 MP_WritePhyUshort(sc, 0x14, 0xd711);
20020                 MP_WritePhyUshort(sc, 0x14, 0x60a0);
20021                 MP_WritePhyUshort(sc, 0x14, 0xca33);
20022                 MP_WritePhyUshort(sc, 0x14, 0xcb33);
20023                 MP_WritePhyUshort(sc, 0x14, 0xa941);
20024                 MP_WritePhyUshort(sc, 0x14, 0x2c7b);
20025                 MP_WritePhyUshort(sc, 0x14, 0xcaff);
20026                 MP_WritePhyUshort(sc, 0x14, 0xcbff);
20027                 MP_WritePhyUshort(sc, 0x14, 0xa921);
20028                 MP_WritePhyUshort(sc, 0x14, 0xce02);
20029                 MP_WritePhyUshort(sc, 0x14, 0xe070);
20030                 MP_WritePhyUshort(sc, 0x14, 0x0f10);
20031                 MP_WritePhyUshort(sc, 0x14, 0xaf01);
20032                 MP_WritePhyUshort(sc, 0x14, 0x8f01);
20033                 MP_WritePhyUshort(sc, 0x14, 0x1791);
20034                 MP_WritePhyUshort(sc, 0x14, 0x8e02);
20035                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20036                 MP_WritePhyUshort(sc, 0x14, 0x41a3);
20037                 MP_WritePhyUshort(sc, 0x14, 0xa140);
20038                 MP_WritePhyUshort(sc, 0x14, 0xa220);
20039                 MP_WritePhyUshort(sc, 0x14, 0xce10);
20040                 MP_WritePhyUshort(sc, 0x14, 0xe070);
20041                 MP_WritePhyUshort(sc, 0x14, 0x0f40);
20042                 MP_WritePhyUshort(sc, 0x14, 0xaf01);
20043                 MP_WritePhyUshort(sc, 0x14, 0x8f01);
20044                 MP_WritePhyUshort(sc, 0x14, 0x1791);
20045                 MP_WritePhyUshort(sc, 0x14, 0x8e10);
20046                 MP_WritePhyUshort(sc, 0x14, 0x8140);
20047                 MP_WritePhyUshort(sc, 0x14, 0x8220);
20048                 MP_WritePhyUshort(sc, 0x14, 0xa301);
20049                 MP_WritePhyUshort(sc, 0x14, 0x17b2);
20050                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20051                 MP_WritePhyUshort(sc, 0x14, 0x609c);
20052                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
20053                 MP_WritePhyUshort(sc, 0x14, 0x7fa4);
20054                 MP_WritePhyUshort(sc, 0x14, 0x2cdb);
20055                 MP_WritePhyUshort(sc, 0x14, 0x1cf0);
20056                 MP_WritePhyUshort(sc, 0x14, 0xce04);
20057                 MP_WritePhyUshort(sc, 0x14, 0xe070);
20058                 MP_WritePhyUshort(sc, 0x14, 0x0f20);
20059                 MP_WritePhyUshort(sc, 0x14, 0xaf01);
20060                 MP_WritePhyUshort(sc, 0x14, 0x8f01);
20061                 MP_WritePhyUshort(sc, 0x14, 0x1791);
20062                 MP_WritePhyUshort(sc, 0x14, 0x8e04);
20063                 MP_WritePhyUshort(sc, 0x14, 0x6044);
20064                 MP_WritePhyUshort(sc, 0x14, 0x2cdb);
20065                 MP_WritePhyUshort(sc, 0x14, 0xa520);
20066                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20067                 MP_WritePhyUshort(sc, 0x14, 0x4043);
20068                 MP_WritePhyUshort(sc, 0x14, 0x2cc8);
20069                 MP_WritePhyUshort(sc, 0x14, 0xe00f);
20070                 MP_WritePhyUshort(sc, 0x14, 0x0501);
20071                 MP_WritePhyUshort(sc, 0x14, 0x1cf6);
20072                 MP_WritePhyUshort(sc, 0x14, 0xb801);
20073                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
20074                 MP_WritePhyUshort(sc, 0x14, 0x4060);
20075                 MP_WritePhyUshort(sc, 0x14, 0x7fc4);
20076                 MP_WritePhyUshort(sc, 0x14, 0x2cdb);
20077                 MP_WritePhyUshort(sc, 0x14, 0x1cfc);
20078                 MP_WritePhyUshort(sc, 0x14, 0xe00f);
20079                 MP_WritePhyUshort(sc, 0x14, 0x0502);
20080                 MP_WritePhyUshort(sc, 0x14, 0x1cf6);
20081                 MP_WritePhyUshort(sc, 0x14, 0xb802);
20082                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
20083                 MP_WritePhyUshort(sc, 0x14, 0x4061);
20084                 MP_WritePhyUshort(sc, 0x14, 0x7fc4);
20085                 MP_WritePhyUshort(sc, 0x14, 0x2cdb);
20086                 MP_WritePhyUshort(sc, 0x14, 0x1cfc);
20087                 MP_WritePhyUshort(sc, 0x14, 0xe00f);
20088                 MP_WritePhyUshort(sc, 0x14, 0x0504);
20089                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20090                 MP_WritePhyUshort(sc, 0x14, 0x6099);
20091                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
20092                 MP_WritePhyUshort(sc, 0x14, 0x7fa4);
20093                 MP_WritePhyUshort(sc, 0x14, 0x2cdb);
20094                 MP_WritePhyUshort(sc, 0x14, 0xc17f);
20095                 MP_WritePhyUshort(sc, 0x14, 0xc200);
20096                 MP_WritePhyUshort(sc, 0x14, 0xc43f);
20097                 MP_WritePhyUshort(sc, 0x14, 0xcc03);
20098                 MP_WritePhyUshort(sc, 0x14, 0xa701);
20099                 MP_WritePhyUshort(sc, 0x14, 0xa510);
20100                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20101                 MP_WritePhyUshort(sc, 0x14, 0x4018);
20102                 MP_WritePhyUshort(sc, 0x14, 0x9910);
20103                 MP_WritePhyUshort(sc, 0x14, 0x8510);
20104                 MP_WritePhyUshort(sc, 0x14, 0x28a1);
20105                 MP_WritePhyUshort(sc, 0x14, 0xe00f);
20106                 MP_WritePhyUshort(sc, 0x14, 0x0504);
20107                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20108                 MP_WritePhyUshort(sc, 0x14, 0x6099);
20109                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
20110                 MP_WritePhyUshort(sc, 0x14, 0x7fa4);
20111                 MP_WritePhyUshort(sc, 0x14, 0x2cdb);
20112                 MP_WritePhyUshort(sc, 0x14, 0xa608);
20113                 MP_WritePhyUshort(sc, 0x14, 0xc17d);
20114                 MP_WritePhyUshort(sc, 0x14, 0xc200);
20115                 MP_WritePhyUshort(sc, 0x14, 0xc43f);
20116                 MP_WritePhyUshort(sc, 0x14, 0xcc03);
20117                 MP_WritePhyUshort(sc, 0x14, 0xa701);
20118                 MP_WritePhyUshort(sc, 0x14, 0xa510);
20119                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20120                 MP_WritePhyUshort(sc, 0x14, 0x4018);
20121                 MP_WritePhyUshort(sc, 0x14, 0x9910);
20122                 MP_WritePhyUshort(sc, 0x14, 0x8510);
20123                 MP_WritePhyUshort(sc, 0x14, 0x298e);
20124                 MP_WritePhyUshort(sc, 0x14, 0x17bd);
20125                 MP_WritePhyUshort(sc, 0x14, 0x2815);
20126                 MP_WritePhyUshort(sc, 0x14, 0xc000);
20127                 MP_WritePhyUshort(sc, 0x14, 0xc100);
20128                 MP_WritePhyUshort(sc, 0x14, 0xc200);
20129                 MP_WritePhyUshort(sc, 0x14, 0xc300);
20130                 MP_WritePhyUshort(sc, 0x14, 0xc400);
20131                 MP_WritePhyUshort(sc, 0x14, 0xc500);
20132                 MP_WritePhyUshort(sc, 0x14, 0xc600);
20133                 MP_WritePhyUshort(sc, 0x14, 0xc7c1);
20134                 MP_WritePhyUshort(sc, 0x14, 0xc800);
20135                 MP_WritePhyUshort(sc, 0x14, 0xcc00);
20136                 MP_WritePhyUshort(sc, 0x14, 0x0800);
20137                 MP_WritePhyUshort(sc, 0x14, 0xca0f);
20138                 MP_WritePhyUshort(sc, 0x14, 0xcbff);
20139                 MP_WritePhyUshort(sc, 0x14, 0xa901);
20140                 MP_WritePhyUshort(sc, 0x14, 0x8902);
20141                 MP_WritePhyUshort(sc, 0x14, 0xc900);
20142                 MP_WritePhyUshort(sc, 0x14, 0xca00);
20143                 MP_WritePhyUshort(sc, 0x14, 0xcb00);
20144                 MP_WritePhyUshort(sc, 0x14, 0x0800);
20145                 MP_WritePhyUshort(sc, 0x14, 0xb804);
20146                 MP_WritePhyUshort(sc, 0x14, 0x0800);
20147                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
20148                 MP_WritePhyUshort(sc, 0x14, 0x6044);
20149                 MP_WritePhyUshort(sc, 0x14, 0x9804);
20150                 MP_WritePhyUshort(sc, 0x14, 0x0800);
20151                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20152                 MP_WritePhyUshort(sc, 0x14, 0x6099);
20153                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
20154                 MP_WritePhyUshort(sc, 0x14, 0x7fa4);
20155                 MP_WritePhyUshort(sc, 0x14, 0x2cdb);
20156                 MP_WritePhyUshort(sc, 0x14, 0x0800);
20157                 MP_WritePhyUshort(sc, 0x14, 0xa510);
20158                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20159                 MP_WritePhyUshort(sc, 0x14, 0x6098);
20160                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
20161                 MP_WritePhyUshort(sc, 0x14, 0x7fa4);
20162                 MP_WritePhyUshort(sc, 0x14, 0x2cdb);
20163                 MP_WritePhyUshort(sc, 0x14, 0x8510);
20164                 MP_WritePhyUshort(sc, 0x14, 0x0800);
20165                 MP_WritePhyUshort(sc, 0x14, 0xd711);
20166                 MP_WritePhyUshort(sc, 0x14, 0x3003);
20167                 MP_WritePhyUshort(sc, 0x14, 0x1d08);
20168                 MP_WritePhyUshort(sc, 0x14, 0x2d12);
20169                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20170                 MP_WritePhyUshort(sc, 0x14, 0x60be);
20171                 MP_WritePhyUshort(sc, 0x14, 0xe060);
20172                 MP_WritePhyUshort(sc, 0x14, 0x0920);
20173                 MP_WritePhyUshort(sc, 0x14, 0x1cdd);
20174                 MP_WritePhyUshort(sc, 0x14, 0x2c90);
20175                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
20176                 MP_WritePhyUshort(sc, 0x14, 0x3063);
20177                 MP_WritePhyUshort(sc, 0x14, 0x19b0);
20178                 MP_WritePhyUshort(sc, 0x14, 0x28d5);
20179                 MP_WritePhyUshort(sc, 0x14, 0x1cdd);
20180                 MP_WritePhyUshort(sc, 0x14, 0x2a25);
20181                 MP_WritePhyUshort(sc, 0x14, 0xa802);
20182                 MP_WritePhyUshort(sc, 0x14, 0xa303);
20183                 MP_WritePhyUshort(sc, 0x14, 0x843f);
20184                 MP_WritePhyUshort(sc, 0x14, 0x81ff);
20185                 MP_WritePhyUshort(sc, 0x14, 0x8208);
20186                 MP_WritePhyUshort(sc, 0x14, 0xa201);
20187                 MP_WritePhyUshort(sc, 0x14, 0xc001);
20188                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20189                 MP_WritePhyUshort(sc, 0x14, 0x30a0);
20190                 MP_WritePhyUshort(sc, 0x14, 0x0d23);
20191                 MP_WritePhyUshort(sc, 0x14, 0x30a0);
20192                 MP_WritePhyUshort(sc, 0x14, 0x3d1a);
20193                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
20194                 MP_WritePhyUshort(sc, 0x14, 0x7f4c);
20195                 MP_WritePhyUshort(sc, 0x14, 0x2b1e);
20196                 MP_WritePhyUshort(sc, 0x14, 0xe003);
20197                 MP_WritePhyUshort(sc, 0x14, 0x0202);
20198                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20199                 MP_WritePhyUshort(sc, 0x14, 0x6090);
20200                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
20201                 MP_WritePhyUshort(sc, 0x14, 0x7fac);
20202                 MP_WritePhyUshort(sc, 0x14, 0x2b1e);
20203                 MP_WritePhyUshort(sc, 0x14, 0xa20c);
20204                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20205                 MP_WritePhyUshort(sc, 0x14, 0x6091);
20206                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
20207                 MP_WritePhyUshort(sc, 0x14, 0x7fac);
20208                 MP_WritePhyUshort(sc, 0x14, 0x2b1e);
20209                 MP_WritePhyUshort(sc, 0x14, 0x820e);
20210                 MP_WritePhyUshort(sc, 0x14, 0xa3e0);
20211                 MP_WritePhyUshort(sc, 0x14, 0xa520);
20212                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20213                 MP_WritePhyUshort(sc, 0x14, 0x609d);
20214                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
20215                 MP_WritePhyUshort(sc, 0x14, 0x7fac);
20216                 MP_WritePhyUshort(sc, 0x14, 0x2b1e);
20217                 MP_WritePhyUshort(sc, 0x14, 0x8520);
20218                 MP_WritePhyUshort(sc, 0x14, 0x6703);
20219                 MP_WritePhyUshort(sc, 0x14, 0x2d3b);
20220                 MP_WritePhyUshort(sc, 0x14, 0xa13e);
20221                 MP_WritePhyUshort(sc, 0x14, 0xc001);
20222                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20223                 MP_WritePhyUshort(sc, 0x14, 0x4000);
20224                 MP_WritePhyUshort(sc, 0x14, 0x6046);
20225                 MP_WritePhyUshort(sc, 0x14, 0x2d14);
20226                 MP_WritePhyUshort(sc, 0x14, 0xa43f);
20227                 MP_WritePhyUshort(sc, 0x14, 0xa101);
20228                 MP_WritePhyUshort(sc, 0x14, 0xc020);
20229                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20230                 MP_WritePhyUshort(sc, 0x14, 0x3121);
20231                 MP_WritePhyUshort(sc, 0x14, 0x0d4c);
20232                 MP_WritePhyUshort(sc, 0x14, 0x30c0);
20233                 MP_WritePhyUshort(sc, 0x14, 0x3d14);
20234                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
20235                 MP_WritePhyUshort(sc, 0x14, 0x7f4c);
20236                 MP_WritePhyUshort(sc, 0x14, 0x2b1e);
20237                 MP_WritePhyUshort(sc, 0x14, 0xa540);
20238                 MP_WritePhyUshort(sc, 0x14, 0xc001);
20239                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20240                 MP_WritePhyUshort(sc, 0x14, 0x4001);
20241                 MP_WritePhyUshort(sc, 0x14, 0xe00f);
20242                 MP_WritePhyUshort(sc, 0x14, 0x0501);
20243                 MP_WritePhyUshort(sc, 0x14, 0x1db3);
20244                 MP_WritePhyUshort(sc, 0x14, 0xc1c4);
20245                 MP_WritePhyUshort(sc, 0x14, 0xa268);
20246                 MP_WritePhyUshort(sc, 0x14, 0xa303);
20247                 MP_WritePhyUshort(sc, 0x14, 0x8420);
20248                 MP_WritePhyUshort(sc, 0x14, 0xe00f);
20249                 MP_WritePhyUshort(sc, 0x14, 0x0502);
20250                 MP_WritePhyUshort(sc, 0x14, 0x1db3);
20251                 MP_WritePhyUshort(sc, 0x14, 0xc002);
20252                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20253                 MP_WritePhyUshort(sc, 0x14, 0x4000);
20254                 MP_WritePhyUshort(sc, 0x14, 0x8208);
20255                 MP_WritePhyUshort(sc, 0x14, 0x8410);
20256                 MP_WritePhyUshort(sc, 0x14, 0xa121);
20257                 MP_WritePhyUshort(sc, 0x14, 0xc002);
20258                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20259                 MP_WritePhyUshort(sc, 0x14, 0x4000);
20260                 MP_WritePhyUshort(sc, 0x14, 0x8120);
20261                 MP_WritePhyUshort(sc, 0x14, 0x8180);
20262                 MP_WritePhyUshort(sc, 0x14, 0x1d9e);
20263                 MP_WritePhyUshort(sc, 0x14, 0xa180);
20264                 MP_WritePhyUshort(sc, 0x14, 0xa13a);
20265                 MP_WritePhyUshort(sc, 0x14, 0x8240);
20266                 MP_WritePhyUshort(sc, 0x14, 0xa430);
20267                 MP_WritePhyUshort(sc, 0x14, 0xc010);
20268                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20269                 MP_WritePhyUshort(sc, 0x14, 0x30e1);
20270                 MP_WritePhyUshort(sc, 0x14, 0x0b24);
20271                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
20272                 MP_WritePhyUshort(sc, 0x14, 0x7f8c);
20273                 MP_WritePhyUshort(sc, 0x14, 0x2b1e);
20274                 MP_WritePhyUshort(sc, 0x14, 0xa480);
20275                 MP_WritePhyUshort(sc, 0x14, 0xa230);
20276                 MP_WritePhyUshort(sc, 0x14, 0xa303);
20277                 MP_WritePhyUshort(sc, 0x14, 0xc001);
20278                 MP_WritePhyUshort(sc, 0x14, 0xd70c);
20279                 MP_WritePhyUshort(sc, 0x14, 0x4124);
20280                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20281                 MP_WritePhyUshort(sc, 0x14, 0x6120);
20282                 MP_WritePhyUshort(sc, 0x14, 0xd711);
20283                 MP_WritePhyUshort(sc, 0x14, 0x3128);
20284                 MP_WritePhyUshort(sc, 0x14, 0x3d7d);
20285                 MP_WritePhyUshort(sc, 0x14, 0x2d77);
20286                 MP_WritePhyUshort(sc, 0x14, 0xa801);
20287                 MP_WritePhyUshort(sc, 0x14, 0x2d73);
20288                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20289                 MP_WritePhyUshort(sc, 0x14, 0x4000);
20290                 MP_WritePhyUshort(sc, 0x14, 0xe018);
20291                 MP_WritePhyUshort(sc, 0x14, 0x0208);
20292                 MP_WritePhyUshort(sc, 0x14, 0xa1f8);
20293                 MP_WritePhyUshort(sc, 0x14, 0x8480);
20294                 MP_WritePhyUshort(sc, 0x14, 0xc004);
20295                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20296                 MP_WritePhyUshort(sc, 0x14, 0x4000);
20297                 MP_WritePhyUshort(sc, 0x14, 0x6046);
20298                 MP_WritePhyUshort(sc, 0x14, 0x2d14);
20299                 MP_WritePhyUshort(sc, 0x14, 0xa43f);
20300                 MP_WritePhyUshort(sc, 0x14, 0xa105);
20301                 MP_WritePhyUshort(sc, 0x14, 0x8228);
20302                 MP_WritePhyUshort(sc, 0x14, 0xc004);
20303                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20304                 MP_WritePhyUshort(sc, 0x14, 0x4000);
20305                 MP_WritePhyUshort(sc, 0x14, 0x81bc);
20306                 MP_WritePhyUshort(sc, 0x14, 0xa220);
20307                 MP_WritePhyUshort(sc, 0x14, 0x1d9e);
20308                 MP_WritePhyUshort(sc, 0x14, 0x8220);
20309                 MP_WritePhyUshort(sc, 0x14, 0xa1bc);
20310                 MP_WritePhyUshort(sc, 0x14, 0xc040);
20311                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20312                 MP_WritePhyUshort(sc, 0x14, 0x30e1);
20313                 MP_WritePhyUshort(sc, 0x14, 0x0b24);
20314                 MP_WritePhyUshort(sc, 0x14, 0x30e1);
20315                 MP_WritePhyUshort(sc, 0x14, 0x3d14);
20316                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
20317                 MP_WritePhyUshort(sc, 0x14, 0x7f4c);
20318                 MP_WritePhyUshort(sc, 0x14, 0x2b1e);
20319                 MP_WritePhyUshort(sc, 0x14, 0xa802);
20320                 MP_WritePhyUshort(sc, 0x14, 0xd70c);
20321                 MP_WritePhyUshort(sc, 0x14, 0x4244);
20322                 MP_WritePhyUshort(sc, 0x14, 0xa301);
20323                 MP_WritePhyUshort(sc, 0x14, 0xc004);
20324                 MP_WritePhyUshort(sc, 0x14, 0xd711);
20325                 MP_WritePhyUshort(sc, 0x14, 0x3128);
20326                 MP_WritePhyUshort(sc, 0x14, 0x3dac);
20327                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20328                 MP_WritePhyUshort(sc, 0x14, 0x5f80);
20329                 MP_WritePhyUshort(sc, 0x14, 0xd711);
20330                 MP_WritePhyUshort(sc, 0x14, 0x3109);
20331                 MP_WritePhyUshort(sc, 0x14, 0x3dae);
20332                 MP_WritePhyUshort(sc, 0x14, 0x2db2);
20333                 MP_WritePhyUshort(sc, 0x14, 0xa801);
20334                 MP_WritePhyUshort(sc, 0x14, 0x2da1);
20335                 MP_WritePhyUshort(sc, 0x14, 0xa802);
20336                 MP_WritePhyUshort(sc, 0x14, 0xc004);
20337                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20338                 MP_WritePhyUshort(sc, 0x14, 0x4000);
20339                 MP_WritePhyUshort(sc, 0x14, 0x0800);
20340                 MP_WritePhyUshort(sc, 0x14, 0xa510);
20341                 MP_WritePhyUshort(sc, 0x14, 0xd710);
20342                 MP_WritePhyUshort(sc, 0x14, 0x609a);
20343                 MP_WritePhyUshort(sc, 0x14, 0xd71e);
20344                 MP_WritePhyUshort(sc, 0x14, 0x7fac);
20345                 MP_WritePhyUshort(sc, 0x14, 0x2b1e);
20346                 MP_WritePhyUshort(sc, 0x14, 0x8510);
20347                 MP_WritePhyUshort(sc, 0x14, 0x0800);
20348                 MP_WritePhyUshort(sc, 0x13, 0xa01a);
20349                 MP_WritePhyUshort(sc, 0x14, 0x0000);
20350                 MP_WritePhyUshort(sc, 0x13, 0xa006);
20351                 MP_WritePhyUshort(sc, 0x14, 0x0b3e);
20352                 MP_WritePhyUshort(sc, 0x13, 0xa004);
20353                 MP_WritePhyUshort(sc, 0x14, 0x0828);
20354                 MP_WritePhyUshort(sc, 0x13, 0xa002);
20355                 MP_WritePhyUshort(sc, 0x14, 0x06dd);
20356                 MP_WritePhyUshort(sc, 0x13, 0xa000);
20357                 MP_WritePhyUshort(sc, 0x14, 0xf815);
20358                 MP_WritePhyUshort(sc, 0x13, 0xb820);
20359                 MP_WritePhyUshort(sc, 0x14, 0x0010);
20360
20361                 MP_WritePhyUshort(sc,0x1F, 0x0A43);
20362                 MP_WritePhyUshort(sc, 0x13, 0x83b0);
20363                 MP_WritePhyUshort(sc, 0x14, 0xaf83);
20364                 MP_WritePhyUshort(sc, 0x14, 0xbcaf);
20365                 MP_WritePhyUshort(sc, 0x14, 0x83c8);
20366                 MP_WritePhyUshort(sc, 0x14, 0xaf83);
20367                 MP_WritePhyUshort(sc, 0x14, 0xddaf);
20368                 MP_WritePhyUshort(sc, 0x14, 0x83e0);
20369                 MP_WritePhyUshort(sc, 0x14, 0x0204);
20370                 MP_WritePhyUshort(sc, 0x14, 0xa102);
20371                 MP_WritePhyUshort(sc, 0x14, 0x09b4);
20372                 MP_WritePhyUshort(sc, 0x14, 0x0284);
20373                 MP_WritePhyUshort(sc, 0x14, 0x62af);
20374                 MP_WritePhyUshort(sc, 0x14, 0x02ec);
20375                 MP_WritePhyUshort(sc, 0x14, 0xad20);
20376                 MP_WritePhyUshort(sc, 0x14, 0x0302);
20377                 MP_WritePhyUshort(sc, 0x14, 0x867d);
20378                 MP_WritePhyUshort(sc, 0x14, 0xad21);
20379                 MP_WritePhyUshort(sc, 0x14, 0x0302);
20380                 MP_WritePhyUshort(sc, 0x14, 0x85ca);
20381                 MP_WritePhyUshort(sc, 0x14, 0xad22);
20382                 MP_WritePhyUshort(sc, 0x14, 0x0302);
20383                 MP_WritePhyUshort(sc, 0x14, 0x1bce);
20384                 MP_WritePhyUshort(sc, 0x14, 0xaf18);
20385                 MP_WritePhyUshort(sc, 0x14, 0x11af);
20386                 MP_WritePhyUshort(sc, 0x14, 0x1811);
20387                 MP_WritePhyUshort(sc, 0x14, 0x0106);
20388                 MP_WritePhyUshort(sc, 0x14, 0xe081);
20389                 MP_WritePhyUshort(sc, 0x14, 0x48af);
20390                 MP_WritePhyUshort(sc, 0x14, 0x3b1f);
20391                 MP_WritePhyUshort(sc, 0x14, 0xf8f9);
20392                 MP_WritePhyUshort(sc, 0x14, 0xfaef);
20393                 MP_WritePhyUshort(sc, 0x14, 0x69ee);
20394                 MP_WritePhyUshort(sc, 0x14, 0x8010);
20395                 MP_WritePhyUshort(sc, 0x14, 0xf7d1);
20396                 MP_WritePhyUshort(sc, 0x14, 0x04bf);
20397                 MP_WritePhyUshort(sc, 0x14, 0x8776);
20398                 MP_WritePhyUshort(sc, 0x14, 0x0241);
20399                 MP_WritePhyUshort(sc, 0x14, 0x0a02);
20400                 MP_WritePhyUshort(sc, 0x14, 0x8704);
20401                 MP_WritePhyUshort(sc, 0x14, 0xbf87);
20402                 MP_WritePhyUshort(sc, 0x14, 0x4fd7);
20403                 MP_WritePhyUshort(sc, 0x14, 0xb822);
20404                 MP_WritePhyUshort(sc, 0x14, 0xd00c);
20405                 MP_WritePhyUshort(sc, 0x14, 0x0241);
20406                 MP_WritePhyUshort(sc, 0x14, 0x03ee);
20407                 MP_WritePhyUshort(sc, 0x14, 0x80cd);
20408                 MP_WritePhyUshort(sc, 0x14, 0xa0ee);
20409                 MP_WritePhyUshort(sc, 0x14, 0x80ce);
20410                 MP_WritePhyUshort(sc, 0x14, 0x8bee);
20411                 MP_WritePhyUshort(sc, 0x14, 0x80d1);
20412                 MP_WritePhyUshort(sc, 0x14, 0xf5ee);
20413                 MP_WritePhyUshort(sc, 0x14, 0x80d2);
20414                 MP_WritePhyUshort(sc, 0x14, 0xa9ee);
20415                 MP_WritePhyUshort(sc, 0x14, 0x80d3);
20416                 MP_WritePhyUshort(sc, 0x14, 0x0aee);
20417                 MP_WritePhyUshort(sc, 0x14, 0x80f0);
20418                 MP_WritePhyUshort(sc, 0x14, 0x10ee);
20419                 MP_WritePhyUshort(sc, 0x14, 0x80f3);
20420                 MP_WritePhyUshort(sc, 0x14, 0x8fee);
20421                 MP_WritePhyUshort(sc, 0x14, 0x8101);
20422                 MP_WritePhyUshort(sc, 0x14, 0x1eee);
20423                 MP_WritePhyUshort(sc, 0x14, 0x810b);
20424                 MP_WritePhyUshort(sc, 0x14, 0x4aee);
20425                 MP_WritePhyUshort(sc, 0x14, 0x810c);
20426                 MP_WritePhyUshort(sc, 0x14, 0x7cee);
20427                 MP_WritePhyUshort(sc, 0x14, 0x8112);
20428                 MP_WritePhyUshort(sc, 0x14, 0x7fd1);
20429                 MP_WritePhyUshort(sc, 0x14, 0x0002);
20430                 MP_WritePhyUshort(sc, 0x14, 0x10e3);
20431                 MP_WritePhyUshort(sc, 0x14, 0xee80);
20432                 MP_WritePhyUshort(sc, 0x14, 0x8892);
20433                 MP_WritePhyUshort(sc, 0x14, 0xee80);
20434                 MP_WritePhyUshort(sc, 0x14, 0x8922);
20435                 MP_WritePhyUshort(sc, 0x14, 0xee80);
20436                 MP_WritePhyUshort(sc, 0x14, 0x9a80);
20437                 MP_WritePhyUshort(sc, 0x14, 0xee80);
20438                 MP_WritePhyUshort(sc, 0x14, 0x9b22);
20439                 MP_WritePhyUshort(sc, 0x14, 0xee80);
20440                 MP_WritePhyUshort(sc, 0x14, 0x9ca7);
20441                 MP_WritePhyUshort(sc, 0x14, 0xee80);
20442                 MP_WritePhyUshort(sc, 0x14, 0xa010);
20443                 MP_WritePhyUshort(sc, 0x14, 0xee80);
20444                 MP_WritePhyUshort(sc, 0x14, 0xa5a7);
20445                 MP_WritePhyUshort(sc, 0x14, 0xd200);
20446                 MP_WritePhyUshort(sc, 0x14, 0x020e);
20447                 MP_WritePhyUshort(sc, 0x14, 0x4b02);
20448                 MP_WritePhyUshort(sc, 0x14, 0x85c1);
20449                 MP_WritePhyUshort(sc, 0x14, 0xef96);
20450                 MP_WritePhyUshort(sc, 0x14, 0xfefd);
20451                 MP_WritePhyUshort(sc, 0x14, 0xfc04);
20452                 MP_WritePhyUshort(sc, 0x14, 0x0284);
20453                 MP_WritePhyUshort(sc, 0x14, 0x7b02);
20454                 MP_WritePhyUshort(sc, 0x14, 0x84b4);
20455                 MP_WritePhyUshort(sc, 0x14, 0x020c);
20456                 MP_WritePhyUshort(sc, 0x14, 0x9202);
20457                 MP_WritePhyUshort(sc, 0x14, 0x0cab);
20458                 MP_WritePhyUshort(sc, 0x14, 0x020c);
20459                 MP_WritePhyUshort(sc, 0x14, 0xd602);
20460                 MP_WritePhyUshort(sc, 0x14, 0x0cef);
20461                 MP_WritePhyUshort(sc, 0x14, 0x020d);
20462                 MP_WritePhyUshort(sc, 0x14, 0x1a02);
20463                 MP_WritePhyUshort(sc, 0x14, 0x0c24);
20464                 MP_WritePhyUshort(sc, 0x14, 0x04f8);
20465                 MP_WritePhyUshort(sc, 0x14, 0xfaef);
20466                 MP_WritePhyUshort(sc, 0x14, 0x69e1);
20467                 MP_WritePhyUshort(sc, 0x14, 0x8234);
20468                 MP_WritePhyUshort(sc, 0x14, 0xac29);
20469                 MP_WritePhyUshort(sc, 0x14, 0x1ae0);
20470                 MP_WritePhyUshort(sc, 0x14, 0x8229);
20471                 MP_WritePhyUshort(sc, 0x14, 0xac21);
20472                 MP_WritePhyUshort(sc, 0x14, 0x02ae);
20473                 MP_WritePhyUshort(sc, 0x14, 0x2202);
20474                 MP_WritePhyUshort(sc, 0x14, 0x1085);
20475                 MP_WritePhyUshort(sc, 0x14, 0xf621);
20476                 MP_WritePhyUshort(sc, 0x14, 0xe482);
20477                 MP_WritePhyUshort(sc, 0x14, 0x29d1);
20478                 MP_WritePhyUshort(sc, 0x14, 0x01bf);
20479                 MP_WritePhyUshort(sc, 0x14, 0x4364);
20480                 MP_WritePhyUshort(sc, 0x14, 0x0241);
20481                 MP_WritePhyUshort(sc, 0x14, 0x0aae);
20482                 MP_WritePhyUshort(sc, 0x14, 0x1002);
20483                 MP_WritePhyUshort(sc, 0x14, 0x127a);
20484                 MP_WritePhyUshort(sc, 0x14, 0xf629);
20485                 MP_WritePhyUshort(sc, 0x14, 0xe582);
20486                 MP_WritePhyUshort(sc, 0x14, 0x34e0);
20487                 MP_WritePhyUshort(sc, 0x14, 0x8229);
20488                 MP_WritePhyUshort(sc, 0x14, 0xf621);
20489                 MP_WritePhyUshort(sc, 0x14, 0xe482);
20490                 MP_WritePhyUshort(sc, 0x14, 0x29ef);
20491                 MP_WritePhyUshort(sc, 0x14, 0x96fe);
20492                 MP_WritePhyUshort(sc, 0x14, 0xfc04);
20493                 MP_WritePhyUshort(sc, 0x14, 0xf8e1);
20494                 MP_WritePhyUshort(sc, 0x14, 0x8234);
20495                 MP_WritePhyUshort(sc, 0x14, 0xac2a);
20496                 MP_WritePhyUshort(sc, 0x14, 0x18e0);
20497                 MP_WritePhyUshort(sc, 0x14, 0x8229);
20498                 MP_WritePhyUshort(sc, 0x14, 0xac22);
20499                 MP_WritePhyUshort(sc, 0x14, 0x02ae);
20500                 MP_WritePhyUshort(sc, 0x14, 0x2602);
20501                 MP_WritePhyUshort(sc, 0x14, 0x84f9);
20502                 MP_WritePhyUshort(sc, 0x14, 0x0285);
20503                 MP_WritePhyUshort(sc, 0x14, 0x66d1);
20504                 MP_WritePhyUshort(sc, 0x14, 0x01bf);
20505                 MP_WritePhyUshort(sc, 0x14, 0x4367);
20506                 MP_WritePhyUshort(sc, 0x14, 0x0241);
20507                 MP_WritePhyUshort(sc, 0x14, 0x0aae);
20508                 MP_WritePhyUshort(sc, 0x14, 0x0e02);
20509                 MP_WritePhyUshort(sc, 0x14, 0x84eb);
20510                 MP_WritePhyUshort(sc, 0x14, 0x0285);
20511                 MP_WritePhyUshort(sc, 0x14, 0xaae1);
20512                 MP_WritePhyUshort(sc, 0x14, 0x8234);
20513                 MP_WritePhyUshort(sc, 0x14, 0xf62a);
20514                 MP_WritePhyUshort(sc, 0x14, 0xe582);
20515                 MP_WritePhyUshort(sc, 0x14, 0x34e0);
20516                 MP_WritePhyUshort(sc, 0x14, 0x8229);
20517                 MP_WritePhyUshort(sc, 0x14, 0xf622);
20518                 MP_WritePhyUshort(sc, 0x14, 0xe482);
20519                 MP_WritePhyUshort(sc, 0x14, 0x29fc);
20520                 MP_WritePhyUshort(sc, 0x14, 0x04f9);
20521                 MP_WritePhyUshort(sc, 0x14, 0xe280);
20522                 MP_WritePhyUshort(sc, 0x14, 0x11ad);
20523                 MP_WritePhyUshort(sc, 0x14, 0x3105);
20524                 MP_WritePhyUshort(sc, 0x14, 0xd200);
20525                 MP_WritePhyUshort(sc, 0x14, 0x020e);
20526                 MP_WritePhyUshort(sc, 0x14, 0x4bfd);
20527                 MP_WritePhyUshort(sc, 0x14, 0x04f8);
20528                 MP_WritePhyUshort(sc, 0x14, 0xf9fa);
20529                 MP_WritePhyUshort(sc, 0x14, 0xef69);
20530                 MP_WritePhyUshort(sc, 0x14, 0xe080);
20531                 MP_WritePhyUshort(sc, 0x14, 0x11ad);
20532                 MP_WritePhyUshort(sc, 0x14, 0x215c);
20533                 MP_WritePhyUshort(sc, 0x14, 0xbf42);
20534                 MP_WritePhyUshort(sc, 0x14, 0x5002);
20535                 MP_WritePhyUshort(sc, 0x14, 0x4148);
20536                 MP_WritePhyUshort(sc, 0x14, 0xac28);
20537                 MP_WritePhyUshort(sc, 0x14, 0x1bbf);
20538                 MP_WritePhyUshort(sc, 0x14, 0x4253);
20539                 MP_WritePhyUshort(sc, 0x14, 0x0241);
20540                 MP_WritePhyUshort(sc, 0x14, 0x48ac);
20541                 MP_WritePhyUshort(sc, 0x14, 0x2812);
20542                 MP_WritePhyUshort(sc, 0x14, 0xbf42);
20543                 MP_WritePhyUshort(sc, 0x14, 0x5902);
20544                 MP_WritePhyUshort(sc, 0x14, 0x4148);
20545                 MP_WritePhyUshort(sc, 0x14, 0xac28);
20546                 MP_WritePhyUshort(sc, 0x14, 0x04d3);
20547                 MP_WritePhyUshort(sc, 0x14, 0x00ae);
20548                 MP_WritePhyUshort(sc, 0x14, 0x07d3);
20549                 MP_WritePhyUshort(sc, 0x14, 0x06af);
20550                 MP_WritePhyUshort(sc, 0x14, 0x8557);
20551                 MP_WritePhyUshort(sc, 0x14, 0xd303);
20552                 MP_WritePhyUshort(sc, 0x14, 0xe080);
20553                 MP_WritePhyUshort(sc, 0x14, 0x11ad);
20554                 MP_WritePhyUshort(sc, 0x14, 0x2625);
20555                 MP_WritePhyUshort(sc, 0x14, 0xbf43);
20556                 MP_WritePhyUshort(sc, 0x14, 0xeb02);
20557                 MP_WritePhyUshort(sc, 0x14, 0x4148);
20558                 MP_WritePhyUshort(sc, 0x14, 0xe280);
20559                 MP_WritePhyUshort(sc, 0x14, 0x730d);
20560                 MP_WritePhyUshort(sc, 0x14, 0x21f6);
20561                 MP_WritePhyUshort(sc, 0x14, 0x370d);
20562                 MP_WritePhyUshort(sc, 0x14, 0x11f6);
20563                 MP_WritePhyUshort(sc, 0x14, 0x2f1b);
20564                 MP_WritePhyUshort(sc, 0x14, 0x21aa);
20565                 MP_WritePhyUshort(sc, 0x14, 0x02ae);
20566                 MP_WritePhyUshort(sc, 0x14, 0x10e2);
20567                 MP_WritePhyUshort(sc, 0x14, 0x8074);
20568                 MP_WritePhyUshort(sc, 0x14, 0x0d21);
20569                 MP_WritePhyUshort(sc, 0x14, 0xf637);
20570                 MP_WritePhyUshort(sc, 0x14, 0x1b21);
20571                 MP_WritePhyUshort(sc, 0x14, 0xaa03);
20572                 MP_WritePhyUshort(sc, 0x14, 0x13ae);
20573                 MP_WritePhyUshort(sc, 0x14, 0x022b);
20574                 MP_WritePhyUshort(sc, 0x14, 0x0202);
20575                 MP_WritePhyUshort(sc, 0x14, 0x0e36);
20576                 MP_WritePhyUshort(sc, 0x14, 0x020e);
20577                 MP_WritePhyUshort(sc, 0x14, 0x4b02);
20578                 MP_WritePhyUshort(sc, 0x14, 0x0f91);
20579                 MP_WritePhyUshort(sc, 0x14, 0xef96);
20580                 MP_WritePhyUshort(sc, 0x14, 0xfefd);
20581                 MP_WritePhyUshort(sc, 0x14, 0xfc04);
20582                 MP_WritePhyUshort(sc, 0x14, 0xf8f9);
20583                 MP_WritePhyUshort(sc, 0x14, 0xfaef);
20584                 MP_WritePhyUshort(sc, 0x14, 0x69e0);
20585                 MP_WritePhyUshort(sc, 0x14, 0x8012);
20586                 MP_WritePhyUshort(sc, 0x14, 0xad27);
20587                 MP_WritePhyUshort(sc, 0x14, 0x33bf);
20588                 MP_WritePhyUshort(sc, 0x14, 0x4250);
20589                 MP_WritePhyUshort(sc, 0x14, 0x0241);
20590                 MP_WritePhyUshort(sc, 0x14, 0x48ac);
20591                 MP_WritePhyUshort(sc, 0x14, 0x2809);
20592                 MP_WritePhyUshort(sc, 0x14, 0xbf42);
20593                 MP_WritePhyUshort(sc, 0x14, 0x5302);
20594                 MP_WritePhyUshort(sc, 0x14, 0x4148);
20595                 MP_WritePhyUshort(sc, 0x14, 0xad28);
20596                 MP_WritePhyUshort(sc, 0x14, 0x21bf);
20597                 MP_WritePhyUshort(sc, 0x14, 0x43eb);
20598                 MP_WritePhyUshort(sc, 0x14, 0x0241);
20599                 MP_WritePhyUshort(sc, 0x14, 0x48e3);
20600                 MP_WritePhyUshort(sc, 0x14, 0x87ff);
20601                 MP_WritePhyUshort(sc, 0x14, 0xd200);
20602                 MP_WritePhyUshort(sc, 0x14, 0x1b45);
20603                 MP_WritePhyUshort(sc, 0x14, 0xac27);
20604                 MP_WritePhyUshort(sc, 0x14, 0x11e1);
20605                 MP_WritePhyUshort(sc, 0x14, 0x87fe);
20606                 MP_WritePhyUshort(sc, 0x14, 0xbf87);
20607                 MP_WritePhyUshort(sc, 0x14, 0x6702);
20608                 MP_WritePhyUshort(sc, 0x14, 0x410a);
20609                 MP_WritePhyUshort(sc, 0x14, 0x0d11);
20610                 MP_WritePhyUshort(sc, 0x14, 0xbf87);
20611                 MP_WritePhyUshort(sc, 0x14, 0x6a02);
20612                 MP_WritePhyUshort(sc, 0x14, 0x410a);
20613                 MP_WritePhyUshort(sc, 0x14, 0xef96);
20614                 MP_WritePhyUshort(sc, 0x14, 0xfefd);
20615                 MP_WritePhyUshort(sc, 0x14, 0xfc04);
20616                 MP_WritePhyUshort(sc, 0x14, 0xf8fa);
20617                 MP_WritePhyUshort(sc, 0x14, 0xef69);
20618                 MP_WritePhyUshort(sc, 0x14, 0xd100);
20619                 MP_WritePhyUshort(sc, 0x14, 0xbf87);
20620                 MP_WritePhyUshort(sc, 0x14, 0x6702);
20621                 MP_WritePhyUshort(sc, 0x14, 0x410a);
20622                 MP_WritePhyUshort(sc, 0x14, 0xbf87);
20623                 MP_WritePhyUshort(sc, 0x14, 0x6a02);
20624                 MP_WritePhyUshort(sc, 0x14, 0x410a);
20625                 MP_WritePhyUshort(sc, 0x14, 0xef96);
20626                 MP_WritePhyUshort(sc, 0x14, 0xfefc);
20627                 MP_WritePhyUshort(sc, 0x14, 0x04ee);
20628                 MP_WritePhyUshort(sc, 0x14, 0x87ff);
20629                 MP_WritePhyUshort(sc, 0x14, 0x46ee);
20630                 MP_WritePhyUshort(sc, 0x14, 0x87fe);
20631                 MP_WritePhyUshort(sc, 0x14, 0x0104);
20632                 MP_WritePhyUshort(sc, 0x14, 0xf8fa);
20633                 MP_WritePhyUshort(sc, 0x14, 0xef69);
20634                 MP_WritePhyUshort(sc, 0x14, 0xe082);
20635                 MP_WritePhyUshort(sc, 0x14, 0x46a0);
20636                 MP_WritePhyUshort(sc, 0x14, 0x0005);
20637                 MP_WritePhyUshort(sc, 0x14, 0x0285);
20638                 MP_WritePhyUshort(sc, 0x14, 0xecae);
20639                 MP_WritePhyUshort(sc, 0x14, 0x0ea0);
20640                 MP_WritePhyUshort(sc, 0x14, 0x0105);
20641                 MP_WritePhyUshort(sc, 0x14, 0x021a);
20642                 MP_WritePhyUshort(sc, 0x14, 0x68ae);
20643                 MP_WritePhyUshort(sc, 0x14, 0x06a0);
20644                 MP_WritePhyUshort(sc, 0x14, 0x0203);
20645                 MP_WritePhyUshort(sc, 0x14, 0x021a);
20646                 MP_WritePhyUshort(sc, 0x14, 0xf4ef);
20647                 MP_WritePhyUshort(sc, 0x14, 0x96fe);
20648                 MP_WritePhyUshort(sc, 0x14, 0xfc04);
20649                 MP_WritePhyUshort(sc, 0x14, 0xf8f9);
20650                 MP_WritePhyUshort(sc, 0x14, 0xfaef);
20651                 MP_WritePhyUshort(sc, 0x14, 0x69e0);
20652                 MP_WritePhyUshort(sc, 0x14, 0x822e);
20653                 MP_WritePhyUshort(sc, 0x14, 0xf621);
20654                 MP_WritePhyUshort(sc, 0x14, 0xe482);
20655                 MP_WritePhyUshort(sc, 0x14, 0x2ee0);
20656                 MP_WritePhyUshort(sc, 0x14, 0x8010);
20657                 MP_WritePhyUshort(sc, 0x14, 0xac22);
20658                 MP_WritePhyUshort(sc, 0x14, 0x02ae);
20659                 MP_WritePhyUshort(sc, 0x14, 0x76e0);
20660                 MP_WritePhyUshort(sc, 0x14, 0x822c);
20661                 MP_WritePhyUshort(sc, 0x14, 0xf721);
20662                 MP_WritePhyUshort(sc, 0x14, 0xe482);
20663                 MP_WritePhyUshort(sc, 0x14, 0x2cbf);
20664                 MP_WritePhyUshort(sc, 0x14, 0x41a5);
20665                 MP_WritePhyUshort(sc, 0x14, 0x0241);
20666                 MP_WritePhyUshort(sc, 0x14, 0x48ef);
20667                 MP_WritePhyUshort(sc, 0x14, 0x21bf);
20668                 MP_WritePhyUshort(sc, 0x14, 0x41a8);
20669                 MP_WritePhyUshort(sc, 0x14, 0x0241);
20670                 MP_WritePhyUshort(sc, 0x14, 0x480c);
20671                 MP_WritePhyUshort(sc, 0x14, 0x111e);
20672                 MP_WritePhyUshort(sc, 0x14, 0x21bf);
20673                 MP_WritePhyUshort(sc, 0x14, 0x41ab);
20674                 MP_WritePhyUshort(sc, 0x14, 0x0241);
20675                 MP_WritePhyUshort(sc, 0x14, 0x480c);
20676                 MP_WritePhyUshort(sc, 0x14, 0x121e);
20677                 MP_WritePhyUshort(sc, 0x14, 0x21e6);
20678                 MP_WritePhyUshort(sc, 0x14, 0x8248);
20679                 MP_WritePhyUshort(sc, 0x14, 0xa200);
20680                 MP_WritePhyUshort(sc, 0x14, 0x0ae1);
20681                 MP_WritePhyUshort(sc, 0x14, 0x822c);
20682                 MP_WritePhyUshort(sc, 0x14, 0xf629);
20683                 MP_WritePhyUshort(sc, 0x14, 0xe582);
20684                 MP_WritePhyUshort(sc, 0x14, 0x2cae);
20685                 MP_WritePhyUshort(sc, 0x14, 0x42e0);
20686                 MP_WritePhyUshort(sc, 0x14, 0x8249);
20687                 MP_WritePhyUshort(sc, 0x14, 0xf721);
20688                 MP_WritePhyUshort(sc, 0x14, 0xe482);
20689                 MP_WritePhyUshort(sc, 0x14, 0x4902);
20690                 MP_WritePhyUshort(sc, 0x14, 0x4520);
20691                 MP_WritePhyUshort(sc, 0x14, 0xbf41);
20692                 MP_WritePhyUshort(sc, 0x14, 0xb702);
20693                 MP_WritePhyUshort(sc, 0x14, 0x4148);
20694                 MP_WritePhyUshort(sc, 0x14, 0xef21);
20695                 MP_WritePhyUshort(sc, 0x14, 0xbf41);
20696                 MP_WritePhyUshort(sc, 0x14, 0xae02);
20697                 MP_WritePhyUshort(sc, 0x14, 0x4148);
20698                 MP_WritePhyUshort(sc, 0x14, 0x0c12);
20699                 MP_WritePhyUshort(sc, 0x14, 0x1e21);
20700                 MP_WritePhyUshort(sc, 0x14, 0xbf41);
20701                 MP_WritePhyUshort(sc, 0x14, 0xb102);
20702                 MP_WritePhyUshort(sc, 0x14, 0x4148);
20703                 MP_WritePhyUshort(sc, 0x14, 0x0c13);
20704                 MP_WritePhyUshort(sc, 0x14, 0x1e21);
20705                 MP_WritePhyUshort(sc, 0x14, 0xbf41);
20706                 MP_WritePhyUshort(sc, 0x14, 0xba02);
20707                 MP_WritePhyUshort(sc, 0x14, 0x4148);
20708                 MP_WritePhyUshort(sc, 0x14, 0x0c14);
20709                 MP_WritePhyUshort(sc, 0x14, 0x1e21);
20710                 MP_WritePhyUshort(sc, 0x14, 0xbf43);
20711                 MP_WritePhyUshort(sc, 0x14, 0x4602);
20712                 MP_WritePhyUshort(sc, 0x14, 0x4148);
20713                 MP_WritePhyUshort(sc, 0x14, 0x0c16);
20714                 MP_WritePhyUshort(sc, 0x14, 0x1e21);
20715                 MP_WritePhyUshort(sc, 0x14, 0xe682);
20716                 MP_WritePhyUshort(sc, 0x14, 0x47ee);
20717                 MP_WritePhyUshort(sc, 0x14, 0x8246);
20718                 MP_WritePhyUshort(sc, 0x14, 0x01ef);
20719                 MP_WritePhyUshort(sc, 0x14, 0x96fe);
20720                 MP_WritePhyUshort(sc, 0x14, 0xfdfc);
20721                 MP_WritePhyUshort(sc, 0x14, 0x04f8);
20722                 MP_WritePhyUshort(sc, 0x14, 0xfaef);
20723                 MP_WritePhyUshort(sc, 0x14, 0x69e0);
20724                 MP_WritePhyUshort(sc, 0x14, 0x824b);
20725                 MP_WritePhyUshort(sc, 0x14, 0xa000);
20726                 MP_WritePhyUshort(sc, 0x14, 0x0502);
20727                 MP_WritePhyUshort(sc, 0x14, 0x8697);
20728                 MP_WritePhyUshort(sc, 0x14, 0xae06);
20729                 MP_WritePhyUshort(sc, 0x14, 0xa001);
20730                 MP_WritePhyUshort(sc, 0x14, 0x0302);
20731                 MP_WritePhyUshort(sc, 0x14, 0x1937);
20732                 MP_WritePhyUshort(sc, 0x14, 0xef96);
20733                 MP_WritePhyUshort(sc, 0x14, 0xfefc);
20734                 MP_WritePhyUshort(sc, 0x14, 0x04f8);
20735                 MP_WritePhyUshort(sc, 0x14, 0xfaef);
20736                 MP_WritePhyUshort(sc, 0x14, 0x69e0);
20737                 MP_WritePhyUshort(sc, 0x14, 0x822e);
20738                 MP_WritePhyUshort(sc, 0x14, 0xf620);
20739                 MP_WritePhyUshort(sc, 0x14, 0xe482);
20740                 MP_WritePhyUshort(sc, 0x14, 0x2ee0);
20741                 MP_WritePhyUshort(sc, 0x14, 0x8010);
20742                 MP_WritePhyUshort(sc, 0x14, 0xac21);
20743                 MP_WritePhyUshort(sc, 0x14, 0x02ae);
20744                 MP_WritePhyUshort(sc, 0x14, 0x54e0);
20745                 MP_WritePhyUshort(sc, 0x14, 0x822c);
20746                 MP_WritePhyUshort(sc, 0x14, 0xf720);
20747                 MP_WritePhyUshort(sc, 0x14, 0xe482);
20748                 MP_WritePhyUshort(sc, 0x14, 0x2cbf);
20749                 MP_WritePhyUshort(sc, 0x14, 0x4175);
20750                 MP_WritePhyUshort(sc, 0x14, 0x0241);
20751                 MP_WritePhyUshort(sc, 0x14, 0x48ac);
20752                 MP_WritePhyUshort(sc, 0x14, 0x2822);
20753                 MP_WritePhyUshort(sc, 0x14, 0xbf41);
20754                 MP_WritePhyUshort(sc, 0x14, 0x9f02);
20755                 MP_WritePhyUshort(sc, 0x14, 0x4148);
20756                 MP_WritePhyUshort(sc, 0x14, 0xe582);
20757                 MP_WritePhyUshort(sc, 0x14, 0x4cac);
20758                 MP_WritePhyUshort(sc, 0x14, 0x2820);
20759                 MP_WritePhyUshort(sc, 0x14, 0xd103);
20760                 MP_WritePhyUshort(sc, 0x14, 0xbf41);
20761                 MP_WritePhyUshort(sc, 0x14, 0x9902);
20762                 MP_WritePhyUshort(sc, 0x14, 0x410a);
20763                 MP_WritePhyUshort(sc, 0x14, 0xee82);
20764                 MP_WritePhyUshort(sc, 0x14, 0x4b00);
20765                 MP_WritePhyUshort(sc, 0x14, 0xe182);
20766                 MP_WritePhyUshort(sc, 0x14, 0x2cf6);
20767                 MP_WritePhyUshort(sc, 0x14, 0x28e5);
20768                 MP_WritePhyUshort(sc, 0x14, 0x822c);
20769                 MP_WritePhyUshort(sc, 0x14, 0xae21);
20770                 MP_WritePhyUshort(sc, 0x14, 0xd104);
20771                 MP_WritePhyUshort(sc, 0x14, 0xbf41);
20772                 MP_WritePhyUshort(sc, 0x14, 0x9902);
20773                 MP_WritePhyUshort(sc, 0x14, 0x410a);
20774                 MP_WritePhyUshort(sc, 0x14, 0xae08);
20775                 MP_WritePhyUshort(sc, 0x14, 0xd105);
20776                 MP_WritePhyUshort(sc, 0x14, 0xbf41);
20777                 MP_WritePhyUshort(sc, 0x14, 0x9902);
20778                 MP_WritePhyUshort(sc, 0x14, 0x410a);
20779                 MP_WritePhyUshort(sc, 0x14, 0xe082);
20780                 MP_WritePhyUshort(sc, 0x14, 0x49f7);
20781                 MP_WritePhyUshort(sc, 0x14, 0x20e4);
20782                 MP_WritePhyUshort(sc, 0x14, 0x8249);
20783                 MP_WritePhyUshort(sc, 0x14, 0x0245);
20784                 MP_WritePhyUshort(sc, 0x14, 0x20ee);
20785                 MP_WritePhyUshort(sc, 0x14, 0x824b);
20786                 MP_WritePhyUshort(sc, 0x14, 0x01ef);
20787                 MP_WritePhyUshort(sc, 0x14, 0x96fe);
20788                 MP_WritePhyUshort(sc, 0x14, 0xfc04);
20789                 MP_WritePhyUshort(sc, 0x14, 0xf8f9);
20790                 MP_WritePhyUshort(sc, 0x14, 0xface);
20791                 MP_WritePhyUshort(sc, 0x14, 0xfaef);
20792                 MP_WritePhyUshort(sc, 0x14, 0x69fb);
20793                 MP_WritePhyUshort(sc, 0x14, 0xbf87);
20794                 MP_WritePhyUshort(sc, 0x14, 0x2fd7);
20795                 MP_WritePhyUshort(sc, 0x14, 0x0020);
20796                 MP_WritePhyUshort(sc, 0x14, 0xd819);
20797                 MP_WritePhyUshort(sc, 0x14, 0xd919);
20798                 MP_WritePhyUshort(sc, 0x14, 0xda19);
20799                 MP_WritePhyUshort(sc, 0x14, 0xdb19);
20800                 MP_WritePhyUshort(sc, 0x14, 0x07ef);
20801                 MP_WritePhyUshort(sc, 0x14, 0x9502);
20802                 MP_WritePhyUshort(sc, 0x14, 0x410a);
20803                 MP_WritePhyUshort(sc, 0x14, 0x073f);
20804                 MP_WritePhyUshort(sc, 0x14, 0x0004);
20805                 MP_WritePhyUshort(sc, 0x14, 0x9fec);
20806                 MP_WritePhyUshort(sc, 0x14, 0xffef);
20807                 MP_WritePhyUshort(sc, 0x14, 0x96fe);
20808                 MP_WritePhyUshort(sc, 0x14, 0xc6fe);
20809                 MP_WritePhyUshort(sc, 0x14, 0xfdfc);
20810                 MP_WritePhyUshort(sc, 0x14, 0x0400);
20811                 MP_WritePhyUshort(sc, 0x14, 0x0144);
20812                 MP_WritePhyUshort(sc, 0x14, 0x0000);
20813                 MP_WritePhyUshort(sc, 0x14, 0x0343);
20814                 MP_WritePhyUshort(sc, 0x14, 0xee00);
20815                 MP_WritePhyUshort(sc, 0x14, 0x0087);
20816                 MP_WritePhyUshort(sc, 0x14, 0x5b00);
20817                 MP_WritePhyUshort(sc, 0x14, 0x0141);
20818                 MP_WritePhyUshort(sc, 0x14, 0xe100);
20819                 MP_WritePhyUshort(sc, 0x14, 0x0387);
20820                 MP_WritePhyUshort(sc, 0x14, 0x5e00);
20821                 MP_WritePhyUshort(sc, 0x14, 0x0987);
20822                 MP_WritePhyUshort(sc, 0x14, 0x6100);
20823                 MP_WritePhyUshort(sc, 0x14, 0x0987);
20824                 MP_WritePhyUshort(sc, 0x14, 0x6400);
20825                 MP_WritePhyUshort(sc, 0x14, 0x0087);
20826                 MP_WritePhyUshort(sc, 0x14, 0x6da4);
20827                 MP_WritePhyUshort(sc, 0x14, 0x00b8);
20828                 MP_WritePhyUshort(sc, 0x14, 0x20c4);
20829                 MP_WritePhyUshort(sc, 0x14, 0x1600);
20830                 MP_WritePhyUshort(sc, 0x14, 0x000f);
20831                 MP_WritePhyUshort(sc, 0x14, 0xf800);
20832                 MP_WritePhyUshort(sc, 0x14, 0x7000);
20833                 MP_WritePhyUshort(sc, 0x14, 0xb82e);
20834                 MP_WritePhyUshort(sc, 0x14, 0x98a5);
20835                 MP_WritePhyUshort(sc, 0x14, 0x8ab6);
20836                 MP_WritePhyUshort(sc, 0x14, 0xa83e);
20837                 MP_WritePhyUshort(sc, 0x14, 0x50a8);
20838                 MP_WritePhyUshort(sc, 0x14, 0x3e33);
20839                 MP_WritePhyUshort(sc, 0x14, 0xbcc6);
20840                 MP_WritePhyUshort(sc, 0x14, 0x22bc);
20841                 MP_WritePhyUshort(sc, 0x14, 0xc6aa);
20842                 MP_WritePhyUshort(sc, 0x14, 0xa442);
20843                 MP_WritePhyUshort(sc, 0x14, 0xffc4);
20844                 MP_WritePhyUshort(sc, 0x14, 0x0800);
20845                 MP_WritePhyUshort(sc, 0x14, 0xc416);
20846                 MP_WritePhyUshort(sc, 0x14, 0xa8bc);
20847                 MP_WritePhyUshort(sc, 0x14, 0xc000);
20848                 MP_WritePhyUshort(sc, 0x13, 0xb818);
20849                 MP_WritePhyUshort(sc, 0x14, 0x02e3);
20850                 MP_WritePhyUshort(sc, 0x13, 0xb81a);
20851                 MP_WritePhyUshort(sc, 0x14, 0x17ff);
20852                 MP_WritePhyUshort(sc, 0x13, 0xb81e);
20853                 MP_WritePhyUshort(sc, 0x14, 0x3b1c);
20854                 MP_WritePhyUshort(sc, 0x13, 0xb820);
20855                 MP_WritePhyUshort(sc, 0x14, 0x021b);
20856                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
20857
20858                 MP_WritePhyUshort(sc,0x1F, 0x0A43);
20859                 MP_WritePhyUshort(sc,0x13, 0x0000);
20860                 MP_WritePhyUshort(sc,0x14, 0x0000);
20861                 MP_WritePhyUshort(sc,0x1f, 0x0B82);
20862                 PhyRegValue = MP_ReadPhyUshort(sc, 0x17);
20863                 PhyRegValue &= ~(BIT_0);
20864                 MP_WritePhyUshort(sc,0x17, PhyRegValue);
20865                 MP_WritePhyUshort(sc,0x1f, 0x0A43);
20866                 MP_WritePhyUshort(sc,0x13, 0x8146);
20867                 MP_WritePhyUshort(sc,0x14, 0x0000);
20868
20869                 MP_WritePhyUshort(sc,0x1f, 0x0B82);
20870                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
20871                 PhyRegValue &= ~(BIT_4);
20872                 MP_WritePhyUshort(sc,0x10, PhyRegValue);
20873
20874                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
20875                 SetEthPhyBit(sc, 0x11, (BIT_3 | BIT_2));
20876                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
20877
20878
20879                 MP_WritePhyUshort(sc, 0x1F, 0x0BCC);
20880                 ClearEthPhyBit(sc, 0x14, BIT_8);
20881                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
20882                 SetEthPhyBit(sc, 0x11, BIT_7);
20883                 SetEthPhyBit(sc, 0x11, BIT_6);
20884                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
20885                 MP_WritePhyUshort(sc, 0x13, 0x8084);
20886                 ClearEthPhyBit(sc, 0x14, (BIT_14 | BIT_13));
20887                 SetEthPhyBit(sc, 0x10, BIT_12);
20888                 SetEthPhyBit(sc, 0x10, BIT_1);
20889                 SetEthPhyBit(sc, 0x10, BIT_0);
20890                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
20891
20892                 MP_WritePhyUshort(sc, 0x1F, 0x0A4B);
20893                 SetEthPhyBit(sc, 0x11, BIT_2);
20894                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
20895
20896                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
20897                 MP_WritePhyUshort(sc, 0x13, 0x8012);
20898                 SetEthPhyBit(sc, 0x14, BIT_15);
20899                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
20900
20901                 MP_WritePhyUshort(sc, 0x1F, 0x0C42);
20902                 ClearAndSetEthPhyBit(sc,
20903                                      0x11,
20904                                      BIT_13 ,
20905                                      BIT_14
20906                                     );
20907                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
20908
20909                 if (phy_power_saving == 1) {
20910                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
20911                         SetEthPhyBit(sc, 0x10, BIT_2);
20912                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
20913                 } else {
20914                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
20915                         ClearEthPhyBit(sc, 0x10, BIT_2);
20916                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
20917                         DELAY(20000);
20918                 }
20919
20920                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
20921                 MP_WritePhyUshort(sc, 0x13, 0x8011);
20922                 ClearEthPhyBit(sc, 0x14, BIT_14);
20923                 MP_WritePhyUshort(sc, 0x1F, 0x0A40);
20924                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
20925                 MP_WritePhyUshort(sc, 0x00, 0x9200);
20926         } else if (sc->re_type == MACFG_62 || sc->re_type == MACFG_67) {
20927                 MP_WritePhyUshort(sc, 0x1F, 0x0BCC);
20928                 ClearEthPhyBit(sc, 0x14, BIT_8);
20929                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
20930                 SetEthPhyBit(sc, 0x11, BIT_7);
20931                 SetEthPhyBit(sc, 0x11, BIT_6);
20932                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
20933                 MP_WritePhyUshort(sc, 0x13, 0x8084);
20934                 ClearEthPhyBit(sc, 0x14, (BIT_14 | BIT_13));
20935                 SetEthPhyBit(sc, 0x10, BIT_12);
20936                 SetEthPhyBit(sc, 0x10, BIT_1);
20937                 SetEthPhyBit(sc, 0x10, BIT_0);
20938                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
20939
20940                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
20941                 MP_WritePhyUshort(sc, 0x13, 0x8012);
20942                 SetEthPhyBit(sc, 0x14, BIT_15);
20943                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
20944
20945                 MP_WritePhyUshort(sc, 0x1F, 0x0C42);
20946                 ClearAndSetEthPhyBit(sc,
20947                                      0x11,
20948                                      BIT_13 ,
20949                                      BIT_14
20950                                     );
20951                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
20952
20953                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
20954                 MP_WritePhyUshort(sc, 0x13, 0x80F3);
20955                 ClearAndSetEthPhyBit(sc,
20956                                      0x14,
20957                                      0xFF00 ,
20958                                      0x8B00
20959                                     );
20960                 MP_WritePhyUshort(sc, 0x13, 0x80F0);
20961                 ClearAndSetEthPhyBit(sc,
20962                                      0x14,
20963                                      0xFF00 ,
20964                                      0x3A00
20965                                     );
20966                 MP_WritePhyUshort(sc, 0x13, 0x80EF);
20967                 ClearAndSetEthPhyBit(sc,
20968                                      0x14,
20969                                      0xFF00 ,
20970                                      0x0500
20971                                     );
20972                 MP_WritePhyUshort(sc, 0x13, 0x80F6);
20973                 ClearAndSetEthPhyBit(sc,
20974                                      0x14,
20975                                      0xFF00 ,
20976                                      0x6E00
20977                                     );
20978                 MP_WritePhyUshort(sc, 0x13, 0x80EC);
20979                 ClearAndSetEthPhyBit(sc,
20980                                      0x14,
20981                                      0xFF00 ,
20982                                      0x6800
20983                                     );
20984                 MP_WritePhyUshort(sc, 0x13, 0x80ED);
20985                 ClearAndSetEthPhyBit(sc,
20986                                      0x14,
20987                                      0xFF00 ,
20988                                      0x7C00
20989                                     );
20990                 MP_WritePhyUshort(sc, 0x13, 0x80F2);
20991                 ClearAndSetEthPhyBit(sc,
20992                                      0x14,
20993                                      0xFF00 ,
20994                                      0xF400
20995                                     );
20996                 MP_WritePhyUshort(sc, 0x13, 0x80F4);
20997                 ClearAndSetEthPhyBit(sc,
20998                                      0x14,
20999                                      0xFF00 ,
21000                                      0x8500
21001                                     );
21002
21003                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21004                 MP_WritePhyUshort(sc, 0x13, 0x8110);
21005                 ClearAndSetEthPhyBit(sc,
21006                                      0x14,
21007                                      0xFF00 ,
21008                                      0xA800
21009                                     );
21010                 MP_WritePhyUshort(sc, 0x13, 0x810F);
21011                 ClearAndSetEthPhyBit(sc,
21012                                      0x14,
21013                                      0xFF00 ,
21014                                      0x1D00
21015                                     );
21016                 MP_WritePhyUshort(sc, 0x13, 0x8111);
21017                 ClearAndSetEthPhyBit(sc,
21018                                      0x14,
21019                                      0xFF00 ,
21020                                      0xF500
21021                                     );
21022                 MP_WritePhyUshort(sc, 0x13, 0x8113);
21023                 ClearAndSetEthPhyBit(sc,
21024                                      0x14,
21025                                      0xFF00 ,
21026                                      0x6100
21027                                     );
21028                 MP_WritePhyUshort(sc, 0x13, 0x8115);
21029                 ClearAndSetEthPhyBit(sc,
21030                                      0x14,
21031                                      0xFF00 ,
21032                                      0x9200
21033                                     );
21034                 MP_WritePhyUshort(sc, 0x13, 0x810E);
21035                 ClearAndSetEthPhyBit(sc,
21036                                      0x14,
21037                                      0xFF00 ,
21038                                      0x0400
21039                                     );
21040                 MP_WritePhyUshort(sc, 0x13, 0x810C);
21041                 ClearAndSetEthPhyBit(sc,
21042                                      0x14,
21043                                      0xFF00 ,
21044                                      0x7C00
21045                                     );
21046                 MP_WritePhyUshort(sc, 0x13, 0x810B);
21047                 ClearAndSetEthPhyBit(sc,
21048                                      0x14,
21049                                      0xFF00 ,
21050                                      0x5A00
21051                                     );
21052
21053                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21054                 MP_WritePhyUshort(sc, 0x13, 0x80D1);
21055                 ClearAndSetEthPhyBit(sc,
21056                                      0x14,
21057                                      0xFF00 ,
21058                                      0xFF00
21059                                     );
21060                 MP_WritePhyUshort(sc, 0x13, 0x80CD);
21061                 ClearAndSetEthPhyBit(sc,
21062                                      0x14,
21063                                      0xFF00 ,
21064                                      0x9E00
21065                                     );
21066                 MP_WritePhyUshort(sc, 0x13, 0x80D3);
21067                 ClearAndSetEthPhyBit(sc,
21068                                      0x14,
21069                                      0xFF00 ,
21070                                      0x0E00
21071                                     );
21072                 MP_WritePhyUshort(sc, 0x13, 0x80D5);
21073                 ClearAndSetEthPhyBit(sc,
21074                                      0x14,
21075                                      0xFF00 ,
21076                                      0xCA00
21077                                     );
21078                 MP_WritePhyUshort(sc, 0x13, 0x80D7);
21079                 ClearAndSetEthPhyBit(sc,
21080                                      0x14,
21081                                      0xFF00 ,
21082                                      0x8400
21083                                     );
21084
21085                 if (phy_power_saving == 1) {
21086                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21087                         SetEthPhyBit(sc, 0x10, BIT_2);
21088                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
21089                 } else {
21090                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21091                         ClearEthPhyBit(sc, 0x10, BIT_2);
21092                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
21093                         DELAY(20000);
21094                 }
21095
21096                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21097                 MP_WritePhyUshort(sc, 0x13, 0x8011);
21098                 ClearEthPhyBit(sc, 0x14, BIT_14);
21099                 MP_WritePhyUshort(sc, 0x1F, 0x0A40);
21100                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21101                 MP_WritePhyUshort(sc, 0x00, 0x9200);
21102         } else if (sc->re_type == MACFG_63) {
21103                 MP_WritePhyUshort(sc, 0x1f, 0x0002);
21104                 MP_WritePhyUshort(sc, 0x10, 0x0008);
21105                 MP_WritePhyUshort(sc, 0x0d, 0x006c);
21106                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
21107
21108                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
21109                 MP_WritePhyUshort(sc, 0x17, 0x0cc0);
21110                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
21111
21112                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
21113                 MP_WritePhyUshort(sc, 0x0B, 0xA4D8);
21114                 MP_WritePhyUshort(sc, 0x09, 0x281C);
21115                 MP_WritePhyUshort(sc, 0x07, 0x2883);
21116                 MP_WritePhyUshort(sc, 0x0A, 0x6B35);
21117                 MP_WritePhyUshort(sc, 0x1D, 0x3DA4);
21118                 MP_WritePhyUshort(sc, 0x1C, 0xEFFD);
21119                 MP_WritePhyUshort(sc, 0x14, 0x7F52);
21120                 MP_WritePhyUshort(sc, 0x18, 0x7FC6);
21121                 MP_WritePhyUshort(sc, 0x08, 0x0601);
21122                 MP_WritePhyUshort(sc, 0x06, 0x4063);
21123                 MP_WritePhyUshort(sc, 0x10, 0xF074);
21124                 MP_WritePhyUshort(sc, 0x1F, 0x0003);
21125                 MP_WritePhyUshort(sc, 0x13, 0x0789);
21126                 MP_WritePhyUshort(sc, 0x12, 0xF4BD);
21127                 MP_WritePhyUshort(sc, 0x1A, 0x04FD);
21128                 MP_WritePhyUshort(sc, 0x14, 0x84B0);
21129                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21130
21131                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
21132                 MP_WritePhyUshort(sc, 0x01, 0x0340);
21133                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
21134                 MP_WritePhyUshort(sc, 0x04, 0x4000);
21135                 MP_WritePhyUshort(sc, 0x03, 0x1D21);
21136                 MP_WritePhyUshort(sc, 0x02, 0x0C32);
21137                 MP_WritePhyUshort(sc, 0x01, 0x0200);
21138                 MP_WritePhyUshort(sc, 0x00, 0x5554);
21139                 MP_WritePhyUshort(sc, 0x04, 0x4800);
21140                 MP_WritePhyUshort(sc, 0x04, 0x4000);
21141                 MP_WritePhyUshort(sc, 0x04, 0xF000);
21142                 MP_WritePhyUshort(sc, 0x03, 0xDF01);
21143                 MP_WritePhyUshort(sc, 0x02, 0xDF20);
21144                 MP_WritePhyUshort(sc, 0x01, 0x101A);
21145                 MP_WritePhyUshort(sc, 0x00, 0xA0FF);
21146                 MP_WritePhyUshort(sc, 0x04, 0xF800);
21147                 MP_WritePhyUshort(sc, 0x04, 0xF000);
21148                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21149
21150                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
21151                 MP_WritePhyUshort(sc, 0x1E, 0x0023);
21152                 MP_WritePhyUshort(sc, 0x16, 0x0000);
21153                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21154
21155                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21156                 PhyRegValue = MP_ReadPhyUshort(sc, 0x0D);
21157                 PhyRegValue |= (BIT_5);
21158                 MP_WritePhyUshort(sc, 0x0D, PhyRegValue);
21159
21160                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21161                 PhyRegValue = MP_ReadPhyUshort(sc, 0x0C);
21162                 PhyRegValue |= (BIT_10);
21163                 MP_WritePhyUshort(sc, 0x0C, PhyRegValue);
21164                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21165         } else if (sc->re_type == MACFG_64) {
21166                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
21167                 MP_WritePhyUshort(sc, 0x17, 0x0cc0);
21168                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
21169
21170                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
21171                 MP_WritePhyUshort(sc, 0x01, 0x0340);
21172                 MP_WritePhyUshort(sc, 0x1F, 0x0001);
21173                 MP_WritePhyUshort(sc, 0x04, 0x4000);
21174                 MP_WritePhyUshort(sc, 0x03, 0x1D21);
21175                 MP_WritePhyUshort(sc, 0x02, 0x0C32);
21176                 MP_WritePhyUshort(sc, 0x01, 0x0200);
21177                 MP_WritePhyUshort(sc, 0x00, 0x5554);
21178                 MP_WritePhyUshort(sc, 0x04, 0x4800);
21179                 MP_WritePhyUshort(sc, 0x04, 0x4000);
21180                 MP_WritePhyUshort(sc, 0x04, 0xF000);
21181                 MP_WritePhyUshort(sc, 0x03, 0xDF01);
21182                 MP_WritePhyUshort(sc, 0x02, 0xDF20);
21183                 MP_WritePhyUshort(sc, 0x01, 0x101A);
21184                 MP_WritePhyUshort(sc, 0x00, 0xA0FF);
21185                 MP_WritePhyUshort(sc, 0x04, 0xF800);
21186                 MP_WritePhyUshort(sc, 0x04, 0xF000);
21187                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21188
21189                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
21190                 MP_WritePhyUshort(sc, 0x1E, 0x0023);
21191                 MP_WritePhyUshort(sc, 0x16, 0x0000);
21192                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21193
21194                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21195                 PhyRegValue = MP_ReadPhyUshort(sc, 0x0D);
21196                 PhyRegValue |= (BIT_5);
21197                 MP_WritePhyUshort(sc, 0x0D, PhyRegValue);
21198
21199                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21200                 PhyRegValue = MP_ReadPhyUshort(sc, 0x0C);
21201                 PhyRegValue |= (BIT_10);
21202                 MP_WritePhyUshort(sc, 0x0C, PhyRegValue);
21203                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21204         } else if (sc->re_type == MACFG_65) {
21205                 MP_WritePhyUshort(sc, 0x1f, 0x0001);
21206                 MP_WritePhyUshort(sc, 0x17, 0x0cc0);
21207                 MP_WritePhyUshort(sc, 0x1f, 0x0000);
21208
21209                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21210                 PhyRegValue = MP_ReadPhyUshort(sc, 0x0D);
21211                 PhyRegValue |= (BIT_5);
21212                 MP_WritePhyUshort(sc, 0x0D, PhyRegValue);
21213
21214                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21215                 PhyRegValue = MP_ReadPhyUshort(sc, 0x0C);
21216                 PhyRegValue |= (BIT_10);
21217                 MP_WritePhyUshort(sc, 0x0C, PhyRegValue);
21218                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21219
21220                 MP_WritePhyUshort(sc, 0x1F, 0x0007);
21221                 MP_WritePhyUshort(sc, 0x1E, 0x002C);
21222                 MP_WritePhyUshort(sc, 0x15, 0x035D);
21223                 MP_WritePhyUshort(sc, 0x1F, 0x0005);
21224                 MP_WritePhyUshort(sc, 0x01, 0x0300);
21225                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21226         } else if (sc->re_type == MACFG_66) {
21227                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21228                 PhyRegValue = MP_ReadPhyUshort(sc, 0x0D);
21229                 PhyRegValue |= (BIT_5);
21230                 MP_WritePhyUshort(sc, 0x0D, PhyRegValue);
21231
21232                 MP_WritePhyUshort(sc, 0x1F, 0x0002);
21233                 PhyRegValue = MP_ReadPhyUshort(sc, 0x0C);
21234                 PhyRegValue |= (BIT_10);
21235                 MP_WritePhyUshort(sc, 0x0C, PhyRegValue);
21236                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21237         } else if (sc->re_type == MACFG_68) {
21238                 MP_WritePhyUshort(sc,0x1f, 0x0B82);
21239                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
21240                 PhyRegValue |= BIT_4;
21241                 MP_WritePhyUshort(sc,0x10, PhyRegValue);
21242
21243                 MP_WritePhyUshort(sc,0x1f, 0x0B80);
21244                 WaitCnt = 0;
21245                 do {
21246                         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
21247                         PhyRegValue &= 0x0040;
21248                         DELAY(50);
21249                         DELAY(50);
21250                         WaitCnt++;
21251                 } while(PhyRegValue != 0x0040 && WaitCnt <1000);
21252
21253                 MP_WritePhyUshort(sc,0x1f, 0x0A43);
21254                 MP_WritePhyUshort(sc,0x13, 0x8028);
21255                 MP_WritePhyUshort(sc,0x14, 0x6200);
21256                 MP_WritePhyUshort(sc,0x13, 0xB82E);
21257                 MP_WritePhyUshort(sc,0x14, 0x0001);
21258
21259                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21260                 MP_WritePhyUshort(sc, 0x13, 0xB820);
21261                 MP_WritePhyUshort(sc, 0x14, 0x0290);
21262                 MP_WritePhyUshort(sc, 0x13, 0xA012);
21263                 MP_WritePhyUshort(sc, 0x14, 0x0000);
21264                 MP_WritePhyUshort(sc, 0x13, 0xA014);
21265                 MP_WritePhyUshort(sc, 0x14, 0x2c04);
21266                 MP_WritePhyUshort(sc, 0x14, 0x2c10);
21267                 MP_WritePhyUshort(sc, 0x14, 0x2c10);
21268                 MP_WritePhyUshort(sc, 0x14, 0x2c10);
21269                 MP_WritePhyUshort(sc, 0x14, 0xa210);
21270                 MP_WritePhyUshort(sc, 0x14, 0xa101);
21271                 MP_WritePhyUshort(sc, 0x14, 0xce10);
21272                 MP_WritePhyUshort(sc, 0x14, 0xe070);
21273                 MP_WritePhyUshort(sc, 0x14, 0x0f40);
21274                 MP_WritePhyUshort(sc, 0x14, 0xaf01);
21275                 MP_WritePhyUshort(sc, 0x14, 0x8f01);
21276                 MP_WritePhyUshort(sc, 0x14, 0x183e);
21277                 MP_WritePhyUshort(sc, 0x14, 0x8e10);
21278                 MP_WritePhyUshort(sc, 0x14, 0x8101);
21279                 MP_WritePhyUshort(sc, 0x14, 0x8210);
21280                 MP_WritePhyUshort(sc, 0x14, 0x28da);
21281                 MP_WritePhyUshort(sc, 0x13, 0xA01A);
21282                 MP_WritePhyUshort(sc, 0x14, 0x0000);
21283                 MP_WritePhyUshort(sc, 0x13, 0xA006);
21284                 MP_WritePhyUshort(sc, 0x14, 0x0017);
21285                 MP_WritePhyUshort(sc, 0x13, 0xA004);
21286                 MP_WritePhyUshort(sc, 0x14, 0x0015);
21287                 MP_WritePhyUshort(sc, 0x13, 0xA002);
21288                 MP_WritePhyUshort(sc, 0x14, 0x0013);
21289                 MP_WritePhyUshort(sc, 0x13, 0xA000);
21290                 MP_WritePhyUshort(sc, 0x14, 0x18d1);
21291                 MP_WritePhyUshort(sc, 0x13, 0xB820);
21292                 MP_WritePhyUshort(sc, 0x14, 0x0210);
21293
21294                 MP_WritePhyUshort(sc,0x1F, 0x0A43);
21295                 MP_WritePhyUshort(sc,0x13, 0x0000);
21296                 MP_WritePhyUshort(sc,0x14, 0x0000);
21297                 MP_WritePhyUshort(sc,0x1f, 0x0B82);
21298                 PhyRegValue = MP_ReadPhyUshort(sc, 0x17);
21299                 PhyRegValue &= ~(BIT_0);
21300                 MP_WritePhyUshort(sc,0x17, PhyRegValue);
21301                 MP_WritePhyUshort(sc,0x1f, 0x0A43);
21302                 MP_WritePhyUshort(sc,0x13, 0x8028);
21303                 MP_WritePhyUshort(sc,0x14, 0x0000);
21304
21305                 MP_WritePhyUshort(sc,0x1f, 0x0B82);
21306                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
21307                 PhyRegValue &= ~(BIT_4);
21308                 MP_WritePhyUshort(sc,0x10, PhyRegValue);
21309
21310
21311
21312                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21313                 MP_WritePhyUshort(sc, 0x13, 0x809b);
21314                 ClearAndSetEthPhyBit(sc,
21315                                      0x14,
21316                                      0xF800 ,
21317                                      0x8000
21318                                     );
21319                 MP_WritePhyUshort(sc, 0x13, 0x80A2);
21320                 ClearAndSetEthPhyBit(sc,
21321                                      0x14,
21322                                      0xFF00 ,
21323                                      0x8000
21324                                     );
21325                 MP_WritePhyUshort(sc, 0x13, 0x80A4);
21326                 ClearAndSetEthPhyBit(sc,
21327                                      0x14,
21328                                      0xFF00 ,
21329                                      0x8500
21330                                     );
21331                 MP_WritePhyUshort(sc, 0x13, 0x809C);
21332                 ClearAndSetEthPhyBit(sc,
21333                                      0x14,
21334                                      0xFF00 ,
21335                                      0xbd00
21336                                     );
21337                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21338
21339                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21340                 MP_WritePhyUshort(sc, 0x13, 0x80AD);
21341                 ClearAndSetEthPhyBit(sc,
21342                                      0x14,
21343                                      0xF800 ,
21344                                      0x7000
21345                                     );
21346                 MP_WritePhyUshort(sc, 0x13, 0x80B4);
21347                 ClearAndSetEthPhyBit(sc,
21348                                      0x14,
21349                                      0xFF00 ,
21350                                      0x5000
21351                                     );
21352                 MP_WritePhyUshort(sc, 0x13, 0x80AC);
21353                 ClearAndSetEthPhyBit(sc,
21354                                      0x14,
21355                                      0xFF00 ,
21356                                      0x4000
21357                                     );
21358                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21359
21360                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21361                 MP_WritePhyUshort(sc, 0x13, 0x808E);
21362                 ClearAndSetEthPhyBit(sc,
21363                                      0x14,
21364                                      0xFF00 ,
21365                                      0x1200
21366                                     );
21367                 MP_WritePhyUshort(sc, 0x13, 0x8090);
21368                 ClearAndSetEthPhyBit(sc,
21369                                      0x14,
21370                                      0xFF00 ,
21371                                      0xE500
21372                                     );
21373                 MP_WritePhyUshort(sc, 0x13, 0x8092);
21374                 ClearAndSetEthPhyBit(sc,
21375                                      0x14,
21376                                      0xFF00 ,
21377                                      0x9F00
21378                                     );
21379                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21380
21381                 dout_tapbin = 0x0000;
21382                 MP_WritePhyUshort(sc, 0x1F, 0x0A46);
21383                 TmpUshort = MP_ReadPhyUshort(sc, 0x13);
21384                 TmpUshort &= (BIT_1|BIT_0);
21385                 TmpUshort <<= 2;
21386                 dout_tapbin |= TmpUshort;
21387
21388                 TmpUshort = MP_ReadPhyUshort(sc, 0x12);
21389                 TmpUshort &= (BIT_15|BIT_14);
21390                 TmpUshort >>= 14;
21391                 dout_tapbin |= TmpUshort;
21392
21393                 dout_tapbin = ~(dout_tapbin^BIT_3);
21394                 dout_tapbin <<= 12;
21395                 dout_tapbin &= 0xF000;
21396
21397                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21398
21399                 MP_WritePhyUshort(sc, 0x13, 0x827A);
21400                 ClearAndSetEthPhyBit(sc,
21401                                      0x14,
21402                                      BIT_15|BIT_14|BIT_13|BIT_12,
21403                                      dout_tapbin
21404                                     );
21405
21406
21407                 MP_WritePhyUshort(sc, 0x13, 0x827B);
21408                 ClearAndSetEthPhyBit(sc,
21409                                      0x14,
21410                                      BIT_15|BIT_14|BIT_13|BIT_12,
21411                                      dout_tapbin
21412                                     );
21413
21414
21415                 MP_WritePhyUshort(sc, 0x13, 0x827C);
21416                 ClearAndSetEthPhyBit(sc,
21417                                      0x14,
21418                                      BIT_15|BIT_14|BIT_13|BIT_12,
21419                                      dout_tapbin
21420                                     );
21421
21422
21423                 MP_WritePhyUshort(sc, 0x13, 0x827D);
21424                 ClearAndSetEthPhyBit(sc,
21425                                      0x14,
21426                                      BIT_15|BIT_14|BIT_13|BIT_12,
21427                                      dout_tapbin
21428                                     );
21429
21430                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21431                 MP_WritePhyUshort(sc, 0x13, 0x8011);
21432                 SetEthPhyBit(sc, 0x14, BIT_11);
21433                 MP_WritePhyUshort(sc, 0x1F, 0x0A42);
21434                 SetEthPhyBit(sc, 0x16, BIT_1);
21435
21436                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
21437                 SetEthPhyBit(sc, 0x11, BIT_11);
21438                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21439
21440                 MP_WritePhyUshort(sc, 0x1F, 0x0BCA);
21441                 ClearAndSetEthPhyBit(sc,
21442                                      0x17,
21443                                      (BIT_13 | BIT_12) ,
21444                                      BIT_14
21445                                     );
21446                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21447
21448                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21449                 MP_WritePhyUshort(sc, 0x13, 0x803F);
21450                 ClearEthPhyBit(sc, 0x14, (BIT_13 | BIT_12));
21451                 MP_WritePhyUshort(sc, 0x13, 0x8047);
21452                 ClearEthPhyBit(sc, 0x14, (BIT_13 | BIT_12));
21453                 MP_WritePhyUshort(sc, 0x13, 0x804F);
21454                 ClearEthPhyBit(sc, 0x14, (BIT_13 | BIT_12));
21455                 MP_WritePhyUshort(sc, 0x13, 0x8057);
21456                 ClearEthPhyBit(sc, 0x14, (BIT_13 | BIT_12));
21457                 MP_WritePhyUshort(sc, 0x13, 0x805F);
21458                 ClearEthPhyBit(sc, 0x14, (BIT_13 | BIT_12));
21459                 MP_WritePhyUshort(sc, 0x13, 0x8067);
21460                 ClearEthPhyBit(sc, 0x14, (BIT_13 | BIT_12));
21461                 MP_WritePhyUshort(sc, 0x13, 0x806F);
21462                 ClearEthPhyBit(sc, 0x14, (BIT_13 | BIT_12));
21463                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21464
21465                 if (phy_power_saving == 1) {
21466                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21467                         SetEthPhyBit(sc, 0x10, BIT_2);
21468                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
21469                 } else {
21470                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21471                         ClearEthPhyBit(sc, 0x10, BIT_2);
21472                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
21473                         DELAY(20000);
21474                 }
21475
21476                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21477                 MP_WritePhyUshort(sc, 0x13, 0x8011);
21478                 ClearEthPhyBit(sc, 0x14, BIT_15);
21479                 MP_WritePhyUshort(sc, 0x1F, 0x0A40);
21480                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21481                 MP_WritePhyUshort(sc, 0x00, 0x9200);
21482         } else if (sc->re_type == MACFG_69) {
21483                 MP_WritePhyUshort(sc,0x1f, 0x0B82);
21484                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
21485                 PhyRegValue |= BIT_4;
21486                 MP_WritePhyUshort(sc,0x10, PhyRegValue);
21487
21488                 MP_WritePhyUshort(sc,0x1f, 0x0B80);
21489                 WaitCnt = 0;
21490                 do {
21491                         PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
21492                         PhyRegValue &= 0x0040;
21493                         DELAY(50);
21494                         DELAY(50);
21495                         WaitCnt++;
21496                 } while(PhyRegValue != 0x0040 && WaitCnt <1000);
21497
21498                 MP_WritePhyUshort(sc,0x1f, 0x0A43);
21499                 MP_WritePhyUshort(sc,0x13, 0x8028);
21500                 MP_WritePhyUshort(sc,0x14, 0x6201);
21501                 MP_WritePhyUshort(sc,0x13, 0xB82E);
21502                 MP_WritePhyUshort(sc,0x14, 0x0001);
21503
21504                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21505                 MP_WritePhyUshort(sc, 0x13, 0xB820);
21506                 MP_WritePhyUshort(sc, 0x14, 0x0290);
21507                 MP_WritePhyUshort(sc, 0x13, 0xA012);
21508                 MP_WritePhyUshort(sc, 0x14, 0x0000);
21509                 MP_WritePhyUshort(sc, 0x13, 0xA014);
21510                 MP_WritePhyUshort(sc, 0x14, 0x2c04);
21511                 MP_WritePhyUshort(sc, 0x14, 0x2c09);
21512                 MP_WritePhyUshort(sc, 0x14, 0x2c09);
21513                 MP_WritePhyUshort(sc, 0x14, 0x2c09);
21514                 MP_WritePhyUshort(sc, 0x14, 0xad01);
21515                 MP_WritePhyUshort(sc, 0x14, 0xad01);
21516                 MP_WritePhyUshort(sc, 0x14, 0xad01);
21517                 MP_WritePhyUshort(sc, 0x14, 0xad01);
21518                 MP_WritePhyUshort(sc, 0x14, 0x236c);
21519                 MP_WritePhyUshort(sc, 0x13, 0xA01A);
21520                 MP_WritePhyUshort(sc, 0x14, 0x0000);
21521                 MP_WritePhyUshort(sc, 0x13, 0xA006);
21522                 MP_WritePhyUshort(sc, 0x14, 0x0fff);
21523                 MP_WritePhyUshort(sc, 0x13, 0xA004);
21524                 MP_WritePhyUshort(sc, 0x14, 0x0fff);
21525                 MP_WritePhyUshort(sc, 0x13, 0xA002);
21526                 MP_WritePhyUshort(sc, 0x14, 0x0fff);
21527                 MP_WritePhyUshort(sc, 0x13, 0xA000);
21528                 MP_WritePhyUshort(sc, 0x14, 0x136b);
21529                 MP_WritePhyUshort(sc, 0x13, 0xB820);
21530                 MP_WritePhyUshort(sc, 0x14, 0x0210);
21531
21532                 MP_WritePhyUshort(sc,0x1F, 0x0A43);
21533                 MP_WritePhyUshort(sc,0x13, 0x0000);
21534                 MP_WritePhyUshort(sc,0x14, 0x0000);
21535                 MP_WritePhyUshort(sc,0x1f, 0x0B82);
21536                 PhyRegValue = MP_ReadPhyUshort(sc, 0x17);
21537                 PhyRegValue &= ~(BIT_0);
21538                 MP_WritePhyUshort(sc,0x17, PhyRegValue);
21539                 MP_WritePhyUshort(sc,0x1f, 0x0A43);
21540                 MP_WritePhyUshort(sc,0x13, 0x8028);
21541                 MP_WritePhyUshort(sc,0x14, 0x0000);
21542
21543                 MP_WritePhyUshort(sc,0x1f, 0x0B82);
21544                 PhyRegValue = MP_ReadPhyUshort(sc, 0x10);
21545                 PhyRegValue &= ~(BIT_4);
21546                 MP_WritePhyUshort(sc,0x10, PhyRegValue);
21547
21548
21549                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21550                 MP_WritePhyUshort(sc, 0x13, 0x808A);
21551                 ClearAndSetEthPhyBit(sc,
21552                                      0x14,
21553                                      BIT_5 | BIT_4 | BIT_3 | BIT_2 | BIT_1 | BIT_0,
21554                                      0x0A);
21555
21556                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21557                 MP_WritePhyUshort(sc, 0x13, 0x8011);
21558                 SetEthPhyBit(sc, 0x14, BIT_11);
21559                 MP_WritePhyUshort(sc, 0x1F, 0x0A42);
21560                 SetEthPhyBit(sc, 0x16, BIT_1);
21561
21562                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
21563                 SetEthPhyBit(sc, 0x11, BIT_11);
21564                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21565
21566                 if (sc->RequireAdcBiasPatch) {
21567                         MP_WritePhyUshort(sc, 0x1F, 0x0BCF);
21568                         MP_WritePhyUshort(sc, 0x16, sc->AdcBiasPatchIoffset);
21569                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
21570                 }
21571
21572                 {
21573                         u_int16_t rlen;
21574
21575                         MP_WritePhyUshort(sc, 0x1F, 0x0BCD);
21576                         PhyRegValue = MP_ReadPhyUshort(sc, 0x16);
21577                         PhyRegValue &= 0x000F;
21578
21579                         if (PhyRegValue > 3) {
21580                                 rlen = PhyRegValue - 3;
21581                         } else {
21582                                 rlen = 0;
21583                         }
21584
21585                         PhyRegValue = rlen | (rlen<<4) | (rlen<<8) | (rlen<<12);
21586
21587                         MP_WritePhyUshort(sc, 0x1F, 0x0BCD);
21588                         MP_WritePhyUshort(sc, 0x17, PhyRegValue);
21589                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
21590                 }
21591
21592                 if (phy_power_saving == 1) {
21593                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21594                         SetEthPhyBit(sc, 0x10, BIT_2);
21595                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
21596                 } else {
21597                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21598                         ClearEthPhyBit(sc, 0x10, BIT_2);
21599                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
21600                         DELAY(20000);
21601                 }
21602
21603                 MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21604                 MP_WritePhyUshort(sc, 0x13, 0x8011);
21605                 ClearEthPhyBit(sc, 0x14, BIT_15);
21606                 MP_WritePhyUshort(sc, 0x1F, 0x0A40);
21607                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21608                 MP_WritePhyUshort(sc, 0x00, 0x9200);
21609         }
21610         //EthPhyPPSW
21611         if (sc->re_type == MACFG_56 || sc->re_type == MACFG_56 ||
21612             sc->re_type == MACFG_58 || sc->re_type == MACFG_58 ||
21613             sc->re_type == MACFG_60) {
21614                 //disable EthPhyPPSW
21615                 MP_WritePhyUshort(sc, 0x1F, 0x0BCD);
21616                 MP_WritePhyUshort(sc, 0x14, 0x5065);
21617                 MP_WritePhyUshort(sc, 0x14, 0xD065);
21618                 MP_WritePhyUshort(sc, 0x1F, 0x0BC8);
21619                 MP_WritePhyUshort(sc, 0x12, 0x00ED);
21620                 MP_WritePhyUshort(sc, 0x1F, 0x0BCD);
21621                 MP_WritePhyUshort(sc, 0x14, 0x1065);
21622                 MP_WritePhyUshort(sc, 0x14, 0x9065);
21623                 MP_WritePhyUshort(sc, 0x14, 0x1065);
21624                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21625         } else if (sc->re_type == MACFG_68 || sc->re_type == MACFG_69) {
21626                 //enable EthPhyPPSW
21627                 MP_WritePhyUshort(sc, 0x1F, 0x0A44);
21628                 SetEthPhyBit(sc, 0x11, BIT_7);
21629                 MP_WritePhyUshort(sc, 0x1F, 0x0000);
21630         }
21631
21632         switch(sc->re_type) {
21633         case MACFG_56:
21634         case MACFG_57:
21635         case MACFG_58:
21636         case MACFG_59:
21637         case MACFG_60:
21638         case MACFG_61:
21639         case MACFG_62:
21640         case MACFG_67:
21641         case MACFG_68:
21642         case MACFG_69:
21643                 if (phy_mdix_mode == RE_ETH_PHY_FORCE_MDI) {
21644                         //Force MDI
21645                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21646                         SetEthPhyBit(sc, 0x10, BIT_8 | BIT_9);
21647                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
21648                 } else if (phy_mdix_mode == RE_ETH_PHY_FORCE_MDIX) {
21649                         //Force MDIX
21650                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21651                         ClearEthPhyBit(sc, 0x10, BIT_8);
21652                         SetEthPhyBit(sc, 0x10, BIT_9);
21653                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
21654                 } else {
21655                         //Auto MDI/MDIX
21656                         MP_WritePhyUshort(sc, 0x1F, 0x0A43);
21657                         ClearEthPhyBit(sc, 0x10, BIT_8 | BIT_9);
21658                         MP_WritePhyUshort(sc, 0x1F, 0x0000);
21659                 }
21660
21661                 break;
21662         }
21663
21664         if (phy_power_saving == 1) {
21665                 if (sc->re_type == MACFG_59 || sc->re_type == MACFG_60 ||
21666                     sc->re_type == MACFG_62 || sc->re_type == MACFG_67 ||
21667                     sc->re_type == MACFG_68 || sc->re_type == MACFG_69) {
21668                         MP_WritePhyOcpRegWord(sc, 0x0C41, 0x13, 0x0000);
21669                         MP_WritePhyOcpRegWord(sc, 0x0C41, 0x13, 0x0050);
21670                 }
21671         }
21672
21673         if (eee_enable == 1)
21674                 re_enable_EEE(sc);
21675         else
21676                 re_disable_EEE(sc);
21677
21678         MP_WritePhyUshort(sc, 0x1F, 0x0000);
21679 }
21680
21681 void MP_WritePhyUshort(struct re_softc *sc,u_int8_t RegAddr,u_int16_t RegData)
21682 {
21683         u_int32_t               TmpUlong=0x80000000;
21684         u_int32_t               Timeout=0;
21685
21686         if (RegAddr == 0x1F) {
21687                 sc->cur_page = RegData;
21688         }
21689
21690         if (sc->re_type == MACFG_63) {
21691                 int i;
21692                 CSR_WRITE_4(sc, RE_OCPDR, OCPDR_Write |
21693                             (RegAddr & OCPDR_Reg_Mask) << OCPDR_GPHY_Reg_shift |
21694                             (RegData & OCPDR_Data_Mask));
21695                 CSR_WRITE_4(sc, RE_OCPAR, OCPAR_GPHY_Write);
21696                 CSR_WRITE_4(sc, RE_EPHY_RXER_NUM, 0);
21697
21698                 for (i = 0; i < 100; i++) {
21699                         DELAY(1000);
21700                         if (!(CSR_READ_4(sc, RE_OCPAR) & OCPAR_Flag))
21701                                 break;
21702                 }
21703         } else if (sc->re_type == MACFG_56 || sc->re_type == MACFG_57 ||
21704                    sc->re_type == MACFG_58 || sc->re_type == MACFG_59 ||
21705                    sc->re_type == MACFG_60 || sc->re_type == MACFG_61 ||
21706                    sc->re_type == MACFG_62 || sc->re_type == MACFG_67 ||
21707                    sc->re_type == MACFG_69 || sc->re_type == MACFG_69) {
21708                 if (RegAddr == 0x1F) {
21709                         return;
21710                 }
21711
21712                 MP_WritePhyOcpRegWord(sc, sc->cur_page, RegAddr, RegData);
21713         } else {
21714                 if (sc->re_type == MACFG_65 || sc->re_type == MACFG_66)
21715                         CSR_WRITE_4(sc, 0xD0, CSR_READ_4(sc,0xD0) & ~0x00020000);
21716
21717                 TmpUlong |= (((u_int32_t)RegAddr)<<16 | (u_int32_t)RegData);
21718
21719                 CSR_WRITE_4(sc, RE_PHYAR, TmpUlong);
21720
21721                 /* Wait for writing to Phy ok */
21722                 for (Timeout=0; Timeout<5; Timeout++) {
21723                         DELAY(1000);
21724                         if ((CSR_READ_4(sc, RE_PHYAR)&PHYAR_Flag)==0)
21725                                 break;
21726                 }
21727
21728                 if (sc->re_type == MACFG_65 || sc->re_type == MACFG_66)
21729                         CSR_WRITE_4(sc, 0xD0, CSR_READ_4(sc,0xD0) | 0x00020000);
21730         }
21731 }
21732
21733 u_int16_t MP_ReadPhyUshort(struct re_softc *sc,u_int8_t RegAddr)
21734 {
21735         u_int16_t               RegData;
21736         u_int32_t               TmpUlong;
21737         u_int32_t               Timeout=0;
21738
21739         if (sc->re_type == MACFG_63) {
21740                 int i;
21741                 CSR_WRITE_4(sc, RE_OCPDR, OCPDR_Read |
21742                             (RegAddr & OCPDR_Reg_Mask) << OCPDR_GPHY_Reg_shift);
21743                 CSR_WRITE_4(sc, RE_OCPAR, OCPAR_GPHY_Write);
21744                 CSR_WRITE_4(sc, RE_EPHY_RXER_NUM, 0);
21745
21746                 for (i = 0; i < 100; i++) {
21747                         DELAY(1000);
21748                         if (!(CSR_READ_4(sc, RE_OCPAR) & OCPAR_Flag))
21749                                 break;
21750                 }
21751
21752                 DELAY(1000);
21753                 CSR_WRITE_4(sc, RE_OCPAR, OCPAR_GPHY_Read);
21754                 CSR_WRITE_4(sc, RE_EPHY_RXER_NUM, 0);
21755
21756                 for (i = 0; i < 100; i++) {
21757                         DELAY(1000);
21758                         if (CSR_READ_4(sc, RE_OCPAR) & OCPAR_Flag)
21759                                 break;
21760                 }
21761
21762                 RegData = CSR_READ_4(sc, RE_OCPDR) & OCPDR_Data_Mask;
21763         } else if (sc->re_type == MACFG_56 || sc->re_type == MACFG_57 ||
21764                    sc->re_type == MACFG_58 || sc->re_type == MACFG_59 ||
21765                    sc->re_type == MACFG_60 || sc->re_type == MACFG_61 ||
21766                    sc->re_type == MACFG_62 || sc->re_type == MACFG_67 ||
21767                    sc->re_type == MACFG_69 || sc->re_type == MACFG_69) {
21768                 RegData= MP_ReadPhyOcpRegWord(sc, sc->cur_page, RegAddr);
21769
21770         } else {
21771                 if (sc->re_type == MACFG_65 || sc->re_type == MACFG_66)
21772                         CSR_WRITE_4(sc, 0xD0, CSR_READ_4(sc,0xD0) & ~0x00020000);
21773
21774                 TmpUlong = ((u_int32_t)RegAddr << 16);
21775                 CSR_WRITE_4(sc, RE_PHYAR, TmpUlong);
21776
21777                 /* Wait for writing to Phy ok */
21778                 for (Timeout=0; Timeout<5; Timeout++) {
21779                         DELAY(1000);
21780                         TmpUlong = CSR_READ_4(sc, RE_PHYAR);
21781                         if ((TmpUlong&PHYAR_Flag)!=0)
21782                                 break;
21783                 }
21784
21785                 RegData = (u_int16_t)(TmpUlong & 0x0000ffff);
21786
21787                 if (sc->re_type == MACFG_65 || sc->re_type == MACFG_66)
21788                         CSR_WRITE_4(sc, 0xD0, CSR_READ_4(sc,0xD0) | 0x00020000);
21789         }
21790
21791         return RegData;
21792 }
21793
21794 void MP_WriteEPhyUshort(struct re_softc *sc, u_int8_t RegAddr, u_int16_t RegData)
21795 {
21796         u_int32_t               TmpUlong=0x80000000;
21797         u_int32_t               Timeout=0;
21798
21799         TmpUlong |= (((u_int32_t)RegAddr<<16) | (u_int32_t)RegData);
21800
21801         CSR_WRITE_4(sc, RE_EPHYAR, TmpUlong);
21802
21803         /* Wait for writing to Phy ok */
21804         for (Timeout=0; Timeout<5; Timeout++) {
21805                 DELAY(1000);
21806                 if ((CSR_READ_4(sc, RE_EPHYAR)&PHYAR_Flag)==0)
21807                         break;
21808         }
21809 }
21810
21811 u_int16_t MP_ReadEPhyUshort(struct re_softc *sc, u_int8_t RegAddr)
21812 {
21813         u_int16_t               RegData;
21814         u_int32_t               TmpUlong;
21815         u_int32_t               Timeout=0;
21816
21817         TmpUlong = ((u_int32_t)RegAddr << 16);
21818         CSR_WRITE_4(sc, RE_EPHYAR, TmpUlong);
21819
21820         /* Wait for writing to Phy ok */
21821         for (Timeout=0; Timeout<5; Timeout++) {
21822                 DELAY(1000);
21823                 TmpUlong = CSR_READ_4(sc, RE_EPHYAR);
21824                 if ((TmpUlong&PHYAR_Flag)!=0)
21825                         break;
21826         }
21827
21828         RegData = (u_int16_t)(TmpUlong & 0x0000ffff);
21829
21830         return RegData;
21831 }
21832
21833 u_int8_t MP_ReadEfuse(struct re_softc *sc, u_int16_t RegAddr)
21834 {
21835         u_int8_t                RegData;
21836         u_int32_t               TmpUlong;
21837         u_int32_t               Timeout=0;
21838
21839         RegAddr &= 0x3FF;
21840         TmpUlong = ((u_int32_t)RegAddr << 8);
21841         CSR_WRITE_4(sc, 0xDC, TmpUlong);
21842
21843         /* Wait for writing to Phy ok */
21844         for (Timeout=0; Timeout<5; Timeout++) {
21845                 DELAY(1000);
21846                 TmpUlong = CSR_READ_4(sc, 0xDC);
21847                 if ((TmpUlong&PHYAR_Flag)!=0)
21848                         break;
21849         }
21850
21851         RegData = (u_int8_t)(TmpUlong & 0x000000ff);
21852
21853         return RegData;
21854 }
21855
21856 static void MP_WriteOtherFunPciEConfigSpace(
21857         struct re_softc *sc,
21858         u_int8_t MultiFunSelBit,
21859         u_int16_t ByteEnAndAddr,
21860         u_int32_t RegData)
21861 {
21862         u_int32_t Timeout = 0, WaitCount = 10;
21863         u_int32_t TmpUlong = 0x80000000;
21864         u_int32_t WriteDone;
21865
21866         if (MultiFunSelBit > 7) {
21867                 return;
21868         }
21869
21870         TmpUlong |= MultiFunSelBit << 16;
21871
21872         CSR_WRITE_4(sc, RE_CSIDR, RegData);
21873         TmpUlong |= (u_int32_t) ByteEnAndAddr;
21874         CSR_WRITE_4(sc, RE_CSIAR, TmpUlong);
21875
21876         do {
21877                 DELAY(100);
21878
21879                 WriteDone = CSR_READ_4(sc, RE_CSIAR);
21880                 Timeout++;
21881         } while (((WriteDone & 0x80000000) != 0) && (Timeout < WaitCount));
21882
21883
21884         DELAY(50);
21885 }
21886
21887 static u_int32_t MP_ReadOtherFunPciEConfigSpace(
21888         struct re_softc *sc,
21889         u_int8_t MultiFunSelBit,
21890         u_int16_t ByteEnAndAddr)
21891 {
21892         u_int32_t Timeout = 0, WaitCount = 10;
21893         u_int32_t TmpUlong = 0x00000000;
21894         u_int32_t ReadDone;
21895         u_int32_t RetVal = 0xffffffff;
21896
21897         if (MultiFunSelBit > 7) {
21898                 return 0xffffffff;
21899         }
21900
21901         TmpUlong |= MultiFunSelBit << 16;
21902
21903         TmpUlong |= (u_int32_t) ByteEnAndAddr;
21904         CSR_WRITE_4(sc, RE_CSIAR, TmpUlong);
21905
21906         do {
21907                 DELAY(100);
21908
21909                 ReadDone = CSR_READ_4(sc, RE_CSIAR);
21910                 Timeout++;
21911         } while (((ReadDone & 0x80000000) == 0)&& (Timeout < WaitCount));
21912
21913         DELAY(50);
21914
21915         return RetVal;
21916 }
21917
21918 void MP_WritePciEConfigSpace(
21919         struct re_softc *sc,
21920         u_int16_t ByteEnAndAddr,
21921         u_int32_t RegData)
21922 {
21923         u_int8_t MultiFunSelBit;
21924
21925         if (sc->re_type == MACFG_52 || sc->re_type == MACFG_53) {
21926                 MultiFunSelBit = 2;
21927         } else if (sc->re_type == MACFG_60) {
21928                 MultiFunSelBit = 1;
21929         } else {
21930                 MultiFunSelBit = 0;
21931         }
21932
21933         MP_WriteOtherFunPciEConfigSpace(sc, MultiFunSelBit, ByteEnAndAddr, RegData);
21934
21935 }
21936
21937 u_int32_t MP_ReadPciEConfigSpace(
21938         struct re_softc *sc,
21939         u_int16_t ByteEnAndAddr)
21940 {
21941         u_int8_t MultiFunSelBit;
21942
21943         if (sc->re_type == MACFG_52 || sc->re_type == MACFG_53) {
21944                 MultiFunSelBit = 2;
21945         } else if (sc->re_type == MACFG_60) {
21946                 MultiFunSelBit = 1;
21947         } else {
21948                 MultiFunSelBit = 0;
21949         }
21950
21951         return MP_ReadOtherFunPciEConfigSpace(sc, MultiFunSelBit, ByteEnAndAddr);
21952 }
21953
21954 static u_int16_t MappingPhyOcpAddress(
21955         struct re_softc *sc,
21956         u_int16_t   PageNum,
21957         u_int8_t  RegNum)
21958 {
21959         u_int16_t OcpPageNum = 0;
21960         u_int8_t OcpRegNum = 0;
21961         u_int16_t OcpPhyAddress = 0;
21962
21963         if (PageNum == 0) {
21964                 OcpPageNum = 0x0A40 + (RegNum / 8);
21965                 OcpRegNum = 0x10 + (RegNum % 8);
21966         } else {
21967                 OcpPageNum = PageNum;
21968                 OcpRegNum = RegNum;
21969         }
21970
21971         OcpPageNum <<= 4;
21972
21973         if (OcpRegNum < 16) {
21974                 OcpPhyAddress = 0;
21975         } else {
21976                 OcpRegNum -= 16;
21977                 OcpRegNum <<= 1;
21978
21979                 OcpPhyAddress = OcpPageNum + OcpRegNum;
21980         }
21981
21982         return OcpPhyAddress;
21983 }
21984
21985 static u_int16_t MP_RealReadPhyOcpRegWord(
21986         struct re_softc *sc,
21987         u_int16_t OcpRegAddr)
21988 {
21989         u_int32_t Timeout = 0, WaitCount = 100;
21990         u_int32_t TmpUlong;
21991         u_int16_t RetVal = 0xffff;
21992
21993         TmpUlong = OcpRegAddr / 2;
21994         TmpUlong <<= 16;
21995
21996         CSR_WRITE_4(sc, RE_PHYOCPACCESS, TmpUlong);
21997
21998         do {
21999                 DELAY(1);
22000
22001                 TmpUlong = CSR_READ_4(sc, RE_PHYOCPACCESS);
22002
22003                 Timeout++;
22004         } while ((!(TmpUlong & PHYAR_Flag)) && (Timeout < WaitCount));
22005
22006         RetVal = (u_int16_t)TmpUlong;
22007
22008         return RetVal;
22009 }
22010
22011 u_int16_t MP_ReadPhyOcpRegWord(
22012         struct re_softc *sc,
22013         u_int16_t PhyPage,
22014         u_int8_t PhyRegNum)
22015 {
22016         u_int16_t OcpRegAddr;
22017         u_int16_t RetVal = 0xffff;
22018
22019         OcpRegAddr = MappingPhyOcpAddress(sc, PhyPage, PhyRegNum);
22020
22021         if (OcpRegAddr % 2) {
22022                 u_int16_t tmpUshort;
22023
22024                 tmpUshort = MP_RealReadPhyOcpRegWord(sc, OcpRegAddr);
22025                 tmpUshort &= 0xFF00;
22026                 tmpUshort >>= 8;
22027                 RetVal = tmpUshort;
22028
22029
22030                 tmpUshort = MP_RealReadPhyOcpRegWord(sc, OcpRegAddr + 1);
22031                 tmpUshort &= 0x00FF;
22032                 tmpUshort <<= 8;
22033                 RetVal |= tmpUshort;
22034         } else {
22035                 RetVal = MP_RealReadPhyOcpRegWord(sc, OcpRegAddr);
22036         }
22037
22038         return RetVal;
22039 }
22040
22041 static void MP_RealWritePhyOcpRegWord(
22042         struct re_softc *sc,
22043         u_int16_t OcpRegAddr,
22044         u_int16_t RegData)
22045 {
22046         u_int32_t Timeout = 0, WaitCount = 100;
22047         u_int32_t TmpUlong;
22048
22049         TmpUlong = OcpRegAddr / 2;
22050         TmpUlong <<= 16;
22051         TmpUlong += RegData;
22052         TmpUlong |= BIT_31;
22053
22054         CSR_WRITE_4(sc, RE_PHYOCPACCESS, TmpUlong);
22055
22056         do {
22057                 DELAY(1);
22058
22059                 TmpUlong = CSR_READ_4(sc, RE_PHYOCPACCESS);
22060
22061                 Timeout++;
22062         } while ((TmpUlong & PHYAR_Flag) && (Timeout < WaitCount));
22063 }
22064
22065 void MP_WritePhyOcpRegWord(
22066         struct re_softc *sc,
22067         u_int16_t PhyPage,
22068         u_int8_t PhyRegNum,
22069         u_int16_t RegData)
22070 {
22071         u_int16_t OcpRegAddr;
22072
22073         OcpRegAddr = MappingPhyOcpAddress(sc, PhyPage, PhyRegNum);
22074
22075         if (OcpRegAddr % 2) {
22076                 u_int16_t tmpUshort;
22077
22078                 tmpUshort = MP_RealReadPhyOcpRegWord(sc, OcpRegAddr);
22079                 tmpUshort &= 0x00FF;
22080                 tmpUshort |= (RegData <<  8);
22081                 MP_RealWritePhyOcpRegWord(sc, OcpRegAddr, tmpUshort);
22082                 tmpUshort = MP_RealReadPhyOcpRegWord(sc, OcpRegAddr + 1);
22083                 tmpUshort &= 0xFF00;
22084                 tmpUshort |= (RegData >> 8);
22085                 MP_RealWritePhyOcpRegWord(sc, OcpRegAddr + 1, tmpUshort);
22086         } else {
22087                 MP_RealWritePhyOcpRegWord(sc, OcpRegAddr, RegData);
22088         }
22089 }
22090
22091 void MP_WriteMcuAccessRegWord(
22092         struct re_softc *sc,
22093         u_int16_t ExtRegAddr,
22094         u_int16_t RegData)
22095 {
22096         u_int32_t TmpUlong;
22097
22098         TmpUlong = ExtRegAddr / 2;
22099         TmpUlong <<= 16;
22100         TmpUlong += RegData;
22101         TmpUlong |= BIT_31;
22102
22103         CSR_WRITE_4(sc, RE_MCUACCESS, TmpUlong);
22104 }
22105
22106 u_int16_t MP_ReadMcuAccessRegWord(
22107         struct re_softc *sc,
22108         u_int16_t ExtRegAddr)
22109 {
22110         u_int32_t TmpUlong;
22111         u_int16_t RetVal = 0xffff;
22112
22113         TmpUlong = ExtRegAddr / 2;
22114         TmpUlong <<= 16;
22115
22116         CSR_WRITE_4(sc, RE_MCUACCESS, TmpUlong);
22117         TmpUlong = CSR_READ_4(sc, RE_MCUACCESS);
22118         RetVal = (u_int16_t)TmpUlong;
22119
22120         return RetVal;
22121 }
22122
22123 static u_int32_t real_ocp_read(struct re_softc *sc, u_int16_t addr, u_int8_t len)
22124 {
22125         int i, val_shift, shift = 0;
22126         u_int32_t value1 = 0, value2 = 0, mask;
22127
22128         if (len > 4 || len <= 0)
22129                 return -1;
22130
22131         while (len > 0) {
22132                 val_shift = addr % 4;
22133                 addr = addr & ~0x3;
22134
22135                 CSR_WRITE_4(sc, RE_OCPAR, (0x0F<<12) | (addr&0xFFF));
22136
22137                 for (i = 0; i < 20; i++) {
22138                         DELAY(100);
22139                         if (CSR_READ_4(sc, RE_OCPAR) & OCPAR_Flag)
22140                                 break;
22141                 }
22142
22143                 if (len == 1)       mask = (0xFF << (val_shift * 8)) & 0xFFFFFFFF;
22144                 else if (len == 2)  mask = (0xFFFF << (val_shift * 8)) & 0xFFFFFFFF;
22145                 else if (len == 3)  mask = (0xFFFFFF << (val_shift * 8)) & 0xFFFFFFFF;
22146                 else            mask = (0xFFFFFFFF << (val_shift * 8)) & 0xFFFFFFFF;
22147
22148                 value1 = CSR_READ_4(sc, RE_OCPDR) & mask;
22149                 value2 |= (value1 >> val_shift * 8) << shift * 8;
22150
22151                 if (len <= 4 - val_shift) {
22152                         len = 0;
22153                 } else {
22154                         len -= (4 - val_shift);
22155                         shift = 4 - val_shift;
22156                         addr += 4;
22157                 }
22158         }
22159
22160         DELAY(20);
22161
22162         return value2;
22163 }
22164
22165 static u_int32_t OCP_read(struct re_softc *sc, u_int16_t addr, u_int8_t len)
22166 {
22167         u_int32_t value = 0;
22168
22169         if (sc->re_type == MACFG_61 || sc->re_type == MACFG_62 ||
22170             sc->re_type == MACFG_67) {
22171                 value = re_eri_read(sc, addr, len, ERIAR_OOB);
22172         } else {
22173                 value = real_ocp_read(sc, addr, len);
22174         }
22175
22176         return value;
22177 }
22178
22179 static int real_ocp_write(struct re_softc *sc, u_int16_t addr, u_int8_t len, u_int32_t value)
22180 {
22181         int i, val_shift, shift = 0;
22182         u_int32_t value1 = 0, mask;
22183
22184         if (len > 4 || len <= 0)
22185                 return -1;
22186
22187         while (len > 0) {
22188                 val_shift = addr % 4;
22189                 addr = addr & ~0x3;
22190
22191                 if (len == 1)       mask = (0xFF << (val_shift * 8)) & 0xFFFFFFFF;
22192                 else if (len == 2)  mask = (0xFFFF << (val_shift * 8)) & 0xFFFFFFFF;
22193                 else if (len == 3)  mask = (0xFFFFFF << (val_shift * 8)) & 0xFFFFFFFF;
22194                 else            mask = (0xFFFFFFFF << (val_shift * 8)) & 0xFFFFFFFF;
22195
22196                 value1 = OCP_read(sc, addr, 4) & ~mask;
22197                 value1 |= ((value << val_shift * 8) >> shift * 8);
22198
22199                 CSR_WRITE_4(sc, RE_OCPDR, value1);
22200                 CSR_WRITE_4(sc, RE_OCPAR, OCPAR_Flag | (0x0F<<12) | (addr&0xFFF));
22201
22202                 for (i = 0; i < 10; i++) {
22203                         DELAY(100);
22204
22205                         /* Check if the RTL8168 has completed ERI write */
22206                         if (!(CSR_READ_4(sc, RE_OCPAR) & OCPAR_Flag))
22207                                 break;
22208                 }
22209
22210                 if (len <= 4 - val_shift) {
22211                         len = 0;
22212                 } else {
22213                         len -= (4 - val_shift);
22214                         shift = 4 - val_shift;
22215                         addr += 4;
22216                 }
22217         }
22218
22219         DELAY(20);
22220
22221         return 0;
22222 }
22223
22224 static void OCP_write(struct re_softc *sc, u_int16_t addr, u_int8_t len, u_int32_t value)
22225 {
22226         if (sc->re_type == MACFG_61 || sc->re_type == MACFG_62 ||
22227             sc->re_type == MACFG_67) {
22228                 re_eri_write(sc, addr, len, value, ERIAR_OOB);
22229         } else {
22230                 real_ocp_write(sc, addr, len, value);
22231         }
22232 }
22233
22234 static void OOB_mutex_lock(struct re_softc *sc)
22235 {
22236         u_int8_t reg_16, reg_a0;
22237         u_int32_t wait_cnt_0, wait_Cnt_1;
22238         u_int16_t ocp_reg_mutex_ib;
22239         u_int16_t ocp_reg_mutex_oob;
22240         u_int16_t ocp_reg_mutex_prio;
22241
22242         switch (sc->re_type) {
22243         case MACFG_63:
22244         case MACFG_64:
22245         case MACFG_65:
22246                 ocp_reg_mutex_oob = 0x16;
22247                 ocp_reg_mutex_ib = 0x17;
22248                 ocp_reg_mutex_prio = 0x9C;
22249                 break;
22250         case MACFG_66:
22251                 ocp_reg_mutex_oob = 0x06;
22252                 ocp_reg_mutex_ib = 0x07;
22253                 ocp_reg_mutex_prio = 0x9C;
22254                 break;
22255         case MACFG_61:
22256         case MACFG_62:
22257         case MACFG_67:
22258         default:
22259                 ocp_reg_mutex_oob = 0x110;
22260                 ocp_reg_mutex_ib = 0x114;
22261                 ocp_reg_mutex_prio = 0x11C;
22262                 break;
22263         }
22264
22265         OCP_write(sc, ocp_reg_mutex_ib, 1, BIT_0);
22266         reg_16 = OCP_read(sc, ocp_reg_mutex_oob, 1);
22267         wait_cnt_0 = 0;
22268         while(reg_16) {
22269                 reg_a0 = OCP_read(sc, ocp_reg_mutex_prio, 1);
22270                 if (reg_a0) {
22271                         OCP_write(sc, ocp_reg_mutex_ib, 1, 0x00);
22272                         reg_a0 = OCP_read(sc, ocp_reg_mutex_prio, 1);
22273                         wait_Cnt_1 = 0;
22274                         while(reg_a0) {
22275                                 reg_a0 = OCP_read(sc, ocp_reg_mutex_prio, 1);
22276
22277                                 wait_Cnt_1++;
22278
22279                                 if (wait_Cnt_1 > 2000)
22280                                         break;
22281                         };
22282                         OCP_write(sc, ocp_reg_mutex_ib, 1, BIT_0);
22283
22284                 }
22285                 reg_16 = OCP_read(sc, ocp_reg_mutex_oob, 1);
22286
22287                 wait_cnt_0++;
22288
22289                 if (wait_cnt_0 > 2000)
22290                         break;
22291         };
22292 }
22293
22294 static void OOB_mutex_unlock(struct re_softc *sc)
22295 {
22296         u_int16_t ocp_reg_mutex_ib;
22297         u_int16_t ocp_reg_mutex_oob;
22298         u_int16_t ocp_reg_mutex_prio;
22299
22300         switch (sc->re_type) {
22301         case MACFG_63:
22302         case MACFG_64:
22303         case MACFG_65:
22304                 ocp_reg_mutex_oob = 0x16;
22305                 ocp_reg_mutex_ib = 0x17;
22306                 ocp_reg_mutex_prio = 0x9C;
22307                 break;
22308         case MACFG_66:
22309                 ocp_reg_mutex_oob = 0x06;
22310                 ocp_reg_mutex_ib = 0x07;
22311                 ocp_reg_mutex_prio = 0x9C;
22312                 break;
22313         case MACFG_61:
22314         case MACFG_62:
22315         case MACFG_67:
22316         default:
22317                 ocp_reg_mutex_oob = 0x110;
22318                 ocp_reg_mutex_ib = 0x114;
22319                 ocp_reg_mutex_prio = 0x11C;
22320                 break;
22321         }
22322
22323         OCP_write(sc, ocp_reg_mutex_prio, 1, BIT_0);
22324         OCP_write(sc, ocp_reg_mutex_ib, 1, 0x00);
22325 }
22326
22327 static int re_check_dash(struct re_softc *sc)
22328 {
22329         if (sc->re_type == MACFG_61 || sc->re_type == MACFG_62 ||
22330             sc->re_type == MACFG_67) {
22331                 if (OCP_read(sc, 0x128, 1) & BIT_0)
22332                         return 1;
22333                 else
22334                         return 0;
22335         } else {
22336                 u_int32_t reg;
22337
22338                 if (sc->re_type == MACFG_66)
22339                         reg = 0xb8;
22340                 else
22341                         reg = 0x10;
22342
22343                 if (OCP_read(sc, reg, 2) & 0x00008000)
22344                         return 1;
22345                 else
22346                         return 0;
22347         }
22348 }
22349
22350 static void OOB_notify(struct re_softc *sc, u_int8_t cmd)
22351 {
22352         int i;
22353
22354         CSR_WRITE_1(sc, RE_ERIDR, cmd);
22355         CSR_WRITE_4(sc, RE_ERIAR, 0x800010E8);
22356         DELAY(2000);
22357         for (i = 0; i < 5; i++) {
22358                 DELAY(100);
22359                 if (!(CSR_READ_4(sc, RE_ERIAR) & ERIAR_Flag))
22360                         break;
22361         }
22362
22363         OCP_write(sc, 0x30, 1, 0x01);
22364 }
22365
22366 void re_driver_start(struct re_softc *sc)
22367 {
22368         if (sc->re_type == MACFG_61 || sc->re_type == MACFG_62 ||
22369             sc->re_type == MACFG_67) {
22370                 u_int32_t tmp_value;
22371
22372                 if (!re_check_dash(sc))
22373                         return;
22374
22375                 OCP_write(sc, 0x180, 1, OOB_CMD_DRIVER_START);
22376                 tmp_value = OCP_read(sc, 0x30, 1);
22377                 tmp_value |= BIT_0;
22378                 OCP_write(sc, 0x30, 1, tmp_value);
22379         } else {
22380                 int timeout;
22381                 u_int32_t reg;
22382
22383                 if (sc->re_type == MACFG_66) {
22384                         CSR_WRITE_1(sc, RE_TwiCmdReg, CSR_READ_1(sc, RE_TwiCmdReg) | (BIT_7));
22385                 }
22386
22387                 OOB_notify(sc, OOB_CMD_DRIVER_START);
22388
22389                 if (sc->re_type == MACFG_66)
22390                         reg = 0xB8;
22391                 else
22392                         reg = 0x10;
22393
22394                 for (timeout = 0; timeout < 10; timeout++) {
22395                         DELAY(10000);
22396                         if (OCP_read(sc, reg, 2) & BIT_11)
22397                                 break;
22398                 }
22399         }
22400 }
22401
22402 void re_driver_stop(struct re_softc *sc)
22403 {
22404         if (sc->re_type == MACFG_61 || sc->re_type == MACFG_62 ||
22405             sc->re_type == MACFG_67) {
22406                 u_int32_t tmp_value;
22407
22408                 if (!re_check_dash(sc))
22409                         return;
22410
22411                 Dash2DisableTxRx(sc);
22412
22413                 OCP_write(sc, 0x180, 1, OOB_CMD_DRIVER_STOP);
22414                 tmp_value = OCP_read(sc, 0x30, 1);
22415                 tmp_value |= BIT_0;
22416                 OCP_write(sc, 0x30, 1, tmp_value);
22417         } else {
22418                 int timeout;
22419                 u_int32_t reg;
22420
22421                 OOB_notify(sc, OOB_CMD_DRIVER_STOP);
22422
22423                 if (sc->re_type == MACFG_66)
22424                         reg = 0xB8;
22425                 else
22426                         reg = 0x10;
22427
22428                 for (timeout = 0; timeout < 10; timeout++) {
22429                         DELAY(10000);
22430                         if ((OCP_read(sc, reg, 4) & BIT_11) == 0)
22431                                 break;
22432                 }
22433
22434                 if (sc->re_type == MACFG_66) {
22435                         CSR_WRITE_1(sc, RE_TwiCmdReg, CSR_READ_1(sc, RE_TwiCmdReg) & ~(BIT_7));
22436                 }
22437         }
22438 }
22439
22440 /*----------------------------------------------------------------------------*/
22441 /*      8139 (CR9346) 9346 command register bits (offset 0x50, 1 byte)*/
22442 /*----------------------------------------------------------------------------*/
22443 #define CR9346_EEDO                             0x01                    /* 9346 data out*/
22444 #define CR9346_EEDI                             0x02                    /* 9346 data in*/
22445 #define CR9346_EESK                             0x04                    /* 9346 serial clock*/
22446 #define CR9346_EECS                             0x08                    /* 9346 chip select*/
22447 #define CR9346_EEM0                             0x40                    /* select 8139 operating mode*/
22448 #define CR9346_EEM1                             0x80                    /* 00: normal*/
22449 #define CR9346_CFGRW                    0xC0                    /* Config register write*/
22450 #define CR9346_NORM                     0x00
22451
22452 /*----------------------------------------------------------------------------*/
22453 /*      EEPROM bit definitions(EEPROM control register bits)*/
22454 /*----------------------------------------------------------------------------*/
22455 #define EN_TRNF                                 0x10                    /* Enable turnoff*/
22456 #define EEDO                                            CR9346_EEDO     /* EEPROM data out*/
22457 #define EEDI                                            CR9346_EEDI             /* EEPROM data in (set for writing data)*/
22458 #define EECS                                            CR9346_EECS             /* EEPROM chip select (1=high, 0=low)*/
22459 #define EESK                                            CR9346_EESK             /* EEPROM shift clock (1=high, 0=low)*/
22460
22461 /*----------------------------------------------------------------------------*/
22462 /*      EEPROM opcodes*/
22463 /*----------------------------------------------------------------------------*/
22464 #define EEPROM_READ_OPCODE      06
22465 #define EEPROM_WRITE_OPCODE     05
22466 #define EEPROM_ERASE_OPCODE     07
22467 #define EEPROM_EWEN_OPCODE      19                              /* Erase/write enable*/
22468 #define EEPROM_EWDS_OPCODE      16                              /* Erase/write disable*/
22469
22470 #define CLOCK_RATE                              50                              /* us*/
22471
22472 #define RaiseClock(_sc,_x)                              \
22473         (_x) = (_x) | EESK;                                     \
22474         CSR_WRITE_1((_sc), RE_EECMD, (_x));     \
22475         DELAY(CLOCK_RATE);
22476
22477 #define LowerClock(_sc,_x)                              \
22478         (_x) = (_x) & ~EESK;                                    \
22479         CSR_WRITE_1((_sc), RE_EECMD, (_x));     \
22480         DELAY(CLOCK_RATE);
22481
22482 /*
22483  * Shift out bit(s) to the EEPROM.
22484  */
22485 static void re_eeprom_ShiftOutBits(struct re_softc *sc, int data, int count)
22486 {
22487         u_int16_t x, mask;
22488
22489         mask = 0x01 << (count - 1);
22490         x = CSR_READ_1(sc, RE_EECMD);
22491
22492         x &= ~(EEDO | EEDI);
22493
22494         do {
22495                 x &= ~EEDI;
22496                 if (data & mask)
22497                         x |= EEDI;
22498
22499                 CSR_WRITE_1(sc, RE_EECMD, x);
22500                 DELAY(CLOCK_RATE);
22501                 RaiseClock(sc,x);
22502                 LowerClock(sc,x);
22503                 mask = mask >> 1;
22504         } while (mask);
22505
22506         x &= ~EEDI;
22507         CSR_WRITE_1(sc, RE_EECMD, x);
22508 }
22509
22510 /*
22511  * Shift in bit(s) from the EEPROM.
22512  */
22513 static u_int16_t re_eeprom_ShiftInBits(struct re_softc *sc)
22514 {
22515         u_int16_t x,d,i;
22516         x = CSR_READ_1(sc, RE_EECMD);
22517
22518         x &= ~(EEDO | EEDI);
22519         d = 0;
22520
22521         for (i=0; i<16; i++) {
22522                 d = d << 1;
22523                 RaiseClock(sc, x);
22524
22525                 x = CSR_READ_1(sc, RE_EECMD);
22526
22527                 x &= ~(EEDI);
22528                 if (x & EEDO)
22529                         d |= 1;
22530
22531                 LowerClock(sc, x);
22532         }
22533
22534         return d;
22535 }
22536
22537 /*
22538  * Clean up EEprom read/write setting
22539  */
22540 static void re_eeprom_EEpromCleanup(struct re_softc *sc)
22541 {
22542         u_int16_t x;
22543         x = CSR_READ_1(sc, RE_EECMD);
22544
22545         x &= ~(EECS | EEDI);
22546         CSR_WRITE_1(sc, RE_EECMD, x);
22547
22548         RaiseClock(sc, x);
22549         LowerClock(sc, x);
22550 }
22551
22552 /*
22553  * Read a word of data stored in the EEPROM at address 'addr.'
22554  */
22555 static void re_eeprom_getword(struct re_softc *sc, int addr, u_int16_t *dest)
22556 {
22557         u_int16_t x;
22558
22559         /* select EEPROM, reset bits, set EECS*/
22560         x = CSR_READ_1(sc, RE_EECMD);
22561
22562         x &= ~(EEDI | EEDO | EESK | CR9346_EEM0);
22563         x |= CR9346_EEM1 | EECS;
22564         CSR_WRITE_1(sc, RE_EECMD, x);
22565
22566         /* write the read opcode and register number in that order*/
22567         /* The opcode is 3bits in length, reg is 6 bits long*/
22568         re_eeprom_ShiftOutBits(sc, EEPROM_READ_OPCODE, 3);
22569
22570         if (CSR_READ_4(sc, RE_RXCFG) & RE_RXCFG_RX_9356SEL)
22571                 re_eeprom_ShiftOutBits(sc, addr,8);     /*93c56=8*/
22572         else
22573                 re_eeprom_ShiftOutBits(sc, addr,6);     /*93c46=6*/
22574
22575         /* Now read the data (16 bits) in from the selected EEPROM word*/
22576         *dest=re_eeprom_ShiftInBits(sc);
22577
22578         re_eeprom_EEpromCleanup(sc);
22579         return;
22580 }
22581
22582 /*
22583  * Read a sequence of words from the EEPROM.
22584  */
22585 static void re_read_eeprom(struct re_softc *sc, caddr_t dest, int off, int cnt, int swap)
22586 {
22587         int                     i;
22588         u_int16_t               word = 0, *ptr;
22589
22590         for (i = 0; i < cnt; i++) {
22591                 re_eeprom_getword(sc, off + i, &word);
22592                 ptr = (u_int16_t *)(dest + (i * 2));
22593                 if (swap)
22594                         *ptr = ntohs(word);
22595                 else
22596                         *ptr = word;
22597         }
22598
22599         return;
22600 }
22601
22602 #ifdef __DragonFly__
22603
22604 int
22605 rtl_check_mac_version(struct re_softc *sc)
22606 {
22607
22608         return (re_check_mac_version(sc));
22609 }
22610
22611 void
22612 rtl_init_software_variable(struct re_softc *sc)
22613 {
22614
22615         re_init_software_variable(sc);
22616 }
22617
22618 void
22619 rtl_exit_oob(struct re_softc *sc)
22620 {
22621
22622         re_exit_oob(sc);
22623 }
22624
22625 void
22626 rtl_hw_init(struct re_softc *sc)
22627 {
22628
22629         re_hw_init(sc);
22630 }
22631
22632 void
22633 rtl_reset(struct re_softc *sc)
22634 {
22635
22636         re_reset(sc);
22637 }
22638
22639 void
22640 rtl_get_hw_mac_address(struct re_softc *sc, u_int8_t *eaddr)
22641 {
22642
22643         re_get_hw_mac_address(sc, eaddr);
22644 }
22645
22646 void
22647 rtl_phy_power_up(struct re_softc *sc)
22648 {
22649
22650         re_phy_power_up(sc->dev);
22651 }
22652
22653 void
22654 rtl_hw_phy_config(struct re_softc *sc)
22655 {
22656
22657         re_hw_phy_config(sc);
22658 }
22659
22660 void
22661 rtl_clrwol(struct re_softc *sc)
22662 {
22663
22664         re_clrwol(sc);
22665 }
22666
22667 int
22668 rtl_ifmedia_upd(struct ifnet *ifp)
22669 {
22670
22671         return (re_ifmedia_upd(ifp));
22672 }
22673
22674 void
22675 rtl_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
22676 {
22677
22678         re_ifmedia_sts(ifp, ifmr);
22679 }
22680
22681 void
22682 rtl_stop(struct re_softc *sc)
22683 {
22684
22685         re_stop_rtl(sc);
22686 }
22687
22688 u_int8_t
22689 rtl_link_ok(struct re_softc *sc)
22690 {
22691
22692         return (re_link_ok(sc));
22693 }
22694
22695 void
22696 rtl_link_on_patch(struct re_softc *sc)
22697 {
22698
22699         re_link_on_patch(sc);
22700 }
22701
22702 void
22703 rtl_set_eaddr(struct re_softc *sc)
22704 {
22705
22706         re_init_unlock(sc);
22707 }
22708
22709 void
22710 rtl_hw_start(struct re_softc *sc)
22711 {
22712
22713         re_hw_start_unlock(sc);
22714 }
22715
22716 void
22717 rtl_set_rx_packet_filter(struct re_softc *sc)
22718 {
22719
22720         re_set_rx_packet_filter(sc);
22721 }
22722
22723 void
22724 rtl_hw_d3_para(struct re_softc *sc)
22725 {
22726
22727         re_hw_d3_para(sc);
22728 }
22729
22730 void
22731 rtl_phy_power_down(struct re_softc *sc)
22732 {
22733
22734         re_phy_power_down(sc->dev);
22735 }
22736
22737 #endif  /* __DragonFly__ */