[Midnightbsd-cvs] src: sys/pci: sync changes from FreeBSD.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Fri Sep 12 21:51:17 EDT 2008


Log Message:
-----------
sync changes from FreeBSD.

Modified Files:
--------------
    src/sys/pci:
        agp.c (r1.1.1.2 -> r1.2)
        agp_ali.c (r1.1.1.1 -> r1.2)
        agp_amd.c (r1.1.1.1 -> r1.2)
        agp_amd64.c (r1.1.1.1 -> r1.2)
        agp_ati.c (r1.1.1.1 -> r1.2)
        agp_i810.c (r1.2 -> r1.3)
        agp_intel.c (r1.1.1.1 -> r1.2)
        agp_nvidia.c (r1.1.1.1 -> r1.2)
        agp_sis.c (r1.1.1.1 -> r1.2)
        agp_via.c (r1.1.1.1 -> r1.2)
        agppriv.h (r1.1.1.1 -> r1.2)
        agpreg.h (r1.1.1.1 -> r1.2)
        agpvar.h (r1.1.1.1 -> r1.2)
        alpm.c (r1.1.1.1 -> r1.2)
        amdpm.c (r1.1.1.2 -> r1.2)
        if_mn.c (r1.1.1.1 -> r1.2)
        if_pcn.c (r1.2 -> r1.3)
        if_pcnreg.h (r1.1.1.1 -> r1.2)
        if_rl.c (r1.6 -> r1.7)
        if_rlreg.h (r1.2 -> r1.3)
        if_sf.c (r1.2 -> r1.3)
        if_sfreg.h (r1.1.1.1 -> r1.2)
        if_sis.c (r1.2 -> r1.3)
        if_sisreg.h (r1.1.1.1 -> r1.2)
        if_ste.c (r1.2 -> r1.3)
        if_stereg.h (r1.1.1.1 -> r1.2)
        if_tl.c (r1.1.1.1 -> r1.2)
        if_tlreg.h (r1.1.1.1 -> r1.2)
        if_vr.c (r1.2 -> r1.3)
        if_vrreg.h (r1.1.1.1 -> r1.2)
        if_wb.c (r1.2 -> r1.3)
        if_wbreg.h (r1.1.1.1 -> r1.2)
        if_xl.c (r1.2 -> r1.3)
        if_xlreg.h (r1.1.1.1 -> r1.2)
        intpm.c (r1.1.1.1 -> r1.2)
        intpmreg.h (r1.1.1.1 -> r1.2)
        ncr.c (r1.1.1.1 -> r1.2)
        viapm.c (r1.1.1.1 -> r1.2)

Added Files:
-----------
    src/sys/pci:
        amdsmb.c (r1.1)
        nfsmb.c (r1.1)

Removed Files:
-------------
    src/sys/pci:
        dc21040reg.h
        if_dc.c
        if_dcreg.h
        if_de.c
        if_devar.h
        if_sk.c
        if_skreg.h
        if_ti.c
        if_tireg.h
        ti_fw.h
        ti_fw2.h
        xmaciireg.h
        yukonreg.h

-------------- next part --------------
--- sys/pci/if_skreg.h
+++ /dev/null
@@ -1,1504 +0,0 @@
-/*	$OpenBSD: if_skreg.h,v 1.10 2003/08/12 05:23:06 nate Exp $	*/
-
-/*-
- * Copyright (c) 1997, 1998, 1999, 2000
- *	Bill Paul <wpaul at ctr.columbia.edu>.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/pci/if_skreg.h,v 1.29.2.1 2005/11/06 16:00:54 jhb Exp $
- */
-
-/*-
- * Copyright (c) 2003 Nathan L. Binkert <binkertn at umich.edu>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* Values to keep the different chip revisions apart (SK_CHIPVER). */
-#define SK_GENESIS		0x0A
-#define SK_YUKON		0xB0
-#define SK_YUKON_LITE		0xB1
-#define SK_YUKON_LP		0xB2
-#define SK_YUKON_FAMILY(x) ((x) & 0xB0)
-
-/* Known revisions in SK_CONFIG. */
-#define SK_YUKON_LITE_REV_A0	0x0 /* invented, see test in skc_attach. */
-#define SK_YUKON_LITE_REV_A1	0x3
-#define SK_YUKON_LITE_REV_A3	0x7
-
-/*
- * SysKonnect PCI vendor ID
- */
-#define VENDORID_SK		0x1148
-
-/*
- * Marvell PCI vendor ID
- */
-#define VENDORID_MARVELL	0x11AB
-
-/*
- * SK-NET gigabit ethernet device IDs
- */
-#define DEVICEID_SK_V1		0x4300
-#define DEVICEID_SK_V2		0x4320
-
-/*
- * Belkin F5D5005
- */
-#define DEVICEID_BELKIN_5005	0x5005
-
-/*
- * 3Com PCI vendor ID
- */
-#define VENDORID_3COM		0x10b7
-
-/*
- * 3Com gigabit ethernet device ID
- */
-#define DEVICEID_3COM_3C940	0x1700
-
-/*
- * Linksys PCI vendor ID
- */
-#define VENDORID_LINKSYS	0x1737
-
-/*
- * Linksys gigabit ethernet device ID
- */
-#define DEVICEID_LINKSYS_EG1032	0x1032
-
-/*
- * Linksys gigabit ethernet rev 2 sub-device ID
- */
-#define SUBDEVICEID_LINKSYS_EG1032_REV2	0x0015
-
-/*
- * D-Link PCI vendor ID
- */
-#define	VENDORID_DLINK		0x1186
-
-/*
- * D-Link gigabit ethernet device ID
- */
-#define DEVICEID_DLINK_DGE530T	0x4c00
-
-/*
- * GEnesis registers. The GEnesis chip has a 256-byte I/O window
- * but internally it has a 16K register space. This 16K space is
- * divided into 128-byte blocks. The first 128 bytes of the I/O
- * window represent the first block, which is permanently mapped
- * at the start of the window. The other 127 blocks can be mapped
- * to the second 128 bytes of the I/O window by setting the desired
- * block value in the RAP register in block 0. Not all of the 127
- * blocks are actually used. Most registers are 32 bits wide, but
- * there are a few 16-bit and 8-bit ones as well.
- */
-
-
-/* Start of remappable register window. */
-#define SK_WIN_BASE		0x0080
-
-/* Size of a window */
-#define SK_WIN_LEN		0x80
-
-#define SK_WIN_MASK		0x3F80
-#define SK_REG_MASK		0x7F
-
-/* Compute the window of a given register (for the RAP register) */
-#define SK_WIN(reg)		(((reg) & SK_WIN_MASK) / SK_WIN_LEN)
-
-/* Compute the relative offset of a register within the window */
-#define SK_REG(reg)		((reg) & SK_REG_MASK)
-
-#define SK_PORT_A	0
-#define SK_PORT_B	1
-
-/*
- * Compute offset of port-specific register. Since there are two
- * ports, there are two of some GEnesis modules (e.g. two sets of
- * DMA queues, two sets of FIFO control registers, etc...). Normally,
- * the block for port 0 is at offset 0x0 and the block for port 1 is
- * at offset 0x80 (i.e. the next page over). However for the transmit
- * BMUs and RAMbuffers, there are two blocks for each port: one for
- * the sync transmit queue and one for the async queue (which we don't
- * use). However instead of ordering them like this:
- * TX sync 1 / TX sync 2 / TX async 1 / TX async 2
- * SysKonnect has instead ordered them like this:
- * TX sync 1 / TX async 1 / TX sync 2 / TX async 2
- * This means that when referencing the TX BMU and RAMbuffer registers,
- * we have to double the block offset (0x80 * 2) in order to reach the
- * second queue. This prevents us from using the same formula
- * (sk_port * 0x80) to compute the offsets for all of the port-specific
- * blocks: we need an extra offset for the BMU and RAMbuffer registers.
- * The simplest thing is to provide an extra argument to these macros:
- * the 'skip' parameter. The 'skip' value is the number of extra pages
- * for skip when computing the port0/port1 offsets. For most registers,
- * the skip value is 0; for the BMU and RAMbuffer registers, it's 1.
- */
-#define SK_IF_READ_4(sc_if, skip, reg)		\
-	sk_win_read_4(sc_if->sk_softc, reg +	\
-	((sc_if->sk_port * (skip + 1)) * SK_WIN_LEN))
-#define SK_IF_READ_2(sc_if, skip, reg)		\
-	sk_win_read_2(sc_if->sk_softc, reg + 	\
-	((sc_if->sk_port * (skip + 1)) * SK_WIN_LEN))
-#define SK_IF_READ_1(sc_if, skip, reg)		\
-	sk_win_read_1(sc_if->sk_softc, reg +	\
-	((sc_if->sk_port * (skip + 1)) * SK_WIN_LEN))
-
-#define SK_IF_WRITE_4(sc_if, skip, reg, val)	\
-	sk_win_write_4(sc_if->sk_softc,		\
-	reg + ((sc_if->sk_port * (skip + 1)) * SK_WIN_LEN), val)
-#define SK_IF_WRITE_2(sc_if, skip, reg, val)	\
-	sk_win_write_2(sc_if->sk_softc,		\
-	reg + ((sc_if->sk_port * (skip + 1)) * SK_WIN_LEN), val)
-#define SK_IF_WRITE_1(sc_if, skip, reg, val)	\
-	sk_win_write_1(sc_if->sk_softc,		\
-	reg + ((sc_if->sk_port * (skip + 1)) * SK_WIN_LEN), val)
-
-/* Block 0 registers, permanently mapped at iobase. */
-#define SK_RAP		0x0000
-#define SK_CSR		0x0004
-#define SK_LED		0x0006
-#define SK_ISR		0x0008	/* interrupt source */
-#define SK_IMR		0x000C	/* interrupt mask */
-#define SK_IESR		0x0010	/* interrupt hardware error source */
-#define SK_IEMR		0x0014  /* interrupt hardware error mask */
-#define SK_ISSR		0x0018	/* special interrupt source */
-#define SK_XM_IMR0	0x0020
-#define SK_XM_ISR0	0x0028
-#define SK_XM_PHYADDR0	0x0030
-#define SK_XM_PHYDATA0	0x0034
-#define SK_XM_IMR1	0x0040
-#define SK_XM_ISR1	0x0048
-#define SK_XM_PHYADDR1	0x0050
-#define SK_XM_PHYDATA1	0x0054
-#define SK_BMU_RX_CSR0	0x0060
-#define SK_BMU_RX_CSR1	0x0064
-#define SK_BMU_TXS_CSR0	0x0068
-#define SK_BMU_TXA_CSR0	0x006C
-#define SK_BMU_TXS_CSR1	0x0070
-#define SK_BMU_TXA_CSR1	0x0074
-
-/* SK_CSR register */
-#define SK_CSR_SW_RESET			0x0001
-#define SK_CSR_SW_UNRESET		0x0002
-#define SK_CSR_MASTER_RESET		0x0004
-#define SK_CSR_MASTER_UNRESET		0x0008
-#define SK_CSR_MASTER_STOP		0x0010
-#define SK_CSR_MASTER_DONE		0x0020
-#define SK_CSR_SW_IRQ_CLEAR		0x0040
-#define SK_CSR_SW_IRQ_SET		0x0080
-#define SK_CSR_SLOTSIZE			0x0100 /* 1 == 64 bits, 0 == 32 */
-#define SK_CSR_BUSCLOCK			0x0200 /* 1 == 33/66 Mhz, = 33 */
-
-/* SK_LED register */
-#define SK_LED_GREEN_OFF		0x01
-#define SK_LED_GREEN_ON			0x02
-
-/* SK_ISR register */
-#define SK_ISR_TX2_AS_CHECK		0x00000001
-#define SK_ISR_TX2_AS_EOF		0x00000002
-#define SK_ISR_TX2_AS_EOB		0x00000004
-#define SK_ISR_TX2_S_CHECK		0x00000008
-#define SK_ISR_TX2_S_EOF		0x00000010
-#define SK_ISR_TX2_S_EOB		0x00000020
-#define SK_ISR_TX1_AS_CHECK		0x00000040
-#define SK_ISR_TX1_AS_EOF		0x00000080
-#define SK_ISR_TX1_AS_EOB		0x00000100
-#define SK_ISR_TX1_S_CHECK		0x00000200
-#define SK_ISR_TX1_S_EOF		0x00000400
-#define SK_ISR_TX1_S_EOB		0x00000800
-#define SK_ISR_RX2_CHECK		0x00001000
-#define SK_ISR_RX2_EOF			0x00002000
-#define SK_ISR_RX2_EOB			0x00004000
-#define SK_ISR_RX1_CHECK		0x00008000
-#define SK_ISR_RX1_EOF			0x00010000
-#define SK_ISR_RX1_EOB			0x00020000
-#define SK_ISR_LINK2_OFLOW		0x00040000
-#define SK_ISR_MAC2			0x00080000
-#define SK_ISR_LINK1_OFLOW		0x00100000
-#define SK_ISR_MAC1			0x00200000
-#define SK_ISR_TIMER			0x00400000
-#define SK_ISR_EXTERNAL_REG		0x00800000
-#define SK_ISR_SW			0x01000000
-#define SK_ISR_I2C_RDY			0x02000000
-#define SK_ISR_TX2_TIMEO		0x04000000
-#define SK_ISR_TX1_TIMEO		0x08000000
-#define SK_ISR_RX2_TIMEO		0x10000000
-#define SK_ISR_RX1_TIMEO		0x20000000
-#define SK_ISR_RSVD			0x40000000
-#define SK_ISR_HWERR			0x80000000
-
-/* SK_IMR register */
-#define SK_IMR_TX2_AS_CHECK		0x00000001
-#define SK_IMR_TX2_AS_EOF		0x00000002
-#define SK_IMR_TX2_AS_EOB		0x00000004
-#define SK_IMR_TX2_S_CHECK		0x00000008
-#define SK_IMR_TX2_S_EOF		0x00000010
-#define SK_IMR_TX2_S_EOB		0x00000020
-#define SK_IMR_TX1_AS_CHECK		0x00000040
-#define SK_IMR_TX1_AS_EOF		0x00000080
-#define SK_IMR_TX1_AS_EOB		0x00000100
-#define SK_IMR_TX1_S_CHECK		0x00000200
-#define SK_IMR_TX1_S_EOF		0x00000400
-#define SK_IMR_TX1_S_EOB		0x00000800
-#define SK_IMR_RX2_CHECK		0x00001000
-#define SK_IMR_RX2_EOF			0x00002000
-#define SK_IMR_RX2_EOB			0x00004000
-#define SK_IMR_RX1_CHECK		0x00008000
-#define SK_IMR_RX1_EOF			0x00010000
-#define SK_IMR_RX1_EOB			0x00020000
-#define SK_IMR_LINK2_OFLOW		0x00040000
-#define SK_IMR_MAC2			0x00080000
-#define SK_IMR_LINK1_OFLOW		0x00100000
-#define SK_IMR_MAC1			0x00200000
-#define SK_IMR_TIMER			0x00400000
-#define SK_IMR_EXTERNAL_REG		0x00800000
-#define SK_IMR_SW			0x01000000
-#define SK_IMR_I2C_RDY			0x02000000
-#define SK_IMR_TX2_TIMEO		0x04000000
-#define SK_IMR_TX1_TIMEO		0x08000000
-#define SK_IMR_RX2_TIMEO		0x10000000
-#define SK_IMR_RX1_TIMEO		0x20000000
-#define SK_IMR_RSVD			0x40000000
-#define SK_IMR_HWERR			0x80000000
-
-#define SK_INTRS1	\
-	(SK_IMR_RX1_EOF|SK_IMR_TX1_S_EOF|SK_IMR_MAC1)
-
-#define SK_INTRS2	\
-	(SK_IMR_RX2_EOF|SK_IMR_TX2_S_EOF|SK_IMR_MAC2)
-
-/* SK_IESR register */
-#define SK_IESR_PAR_RX2			0x00000001
-#define SK_IESR_PAR_RX1			0x00000002
-#define SK_IESR_PAR_MAC2		0x00000004
-#define SK_IESR_PAR_MAC1		0x00000008
-#define SK_IESR_PAR_WR_RAM		0x00000010
-#define SK_IESR_PAR_RD_RAM		0x00000020
-#define SK_IESR_NO_TSTAMP_MAC2		0x00000040
-#define SK_IESR_NO_TSTAMO_MAC1		0x00000080
-#define SK_IESR_NO_STS_MAC2		0x00000100
-#define SK_IESR_NO_STS_MAC1		0x00000200
-#define SK_IESR_IRQ_STS			0x00000400
-#define SK_IESR_MASTERERR		0x00000800
-
-/* SK_IEMR register */
-#define SK_IEMR_PAR_RX2			0x00000001
-#define SK_IEMR_PAR_RX1			0x00000002
-#define SK_IEMR_PAR_MAC2		0x00000004
-#define SK_IEMR_PAR_MAC1		0x00000008
-#define SK_IEMR_PAR_WR_RAM		0x00000010
-#define SK_IEMR_PAR_RD_RAM		0x00000020
-#define SK_IEMR_NO_TSTAMP_MAC2		0x00000040
-#define SK_IEMR_NO_TSTAMO_MAC1		0x00000080
-#define SK_IEMR_NO_STS_MAC2		0x00000100
-#define SK_IEMR_NO_STS_MAC1		0x00000200
-#define SK_IEMR_IRQ_STS			0x00000400
-#define SK_IEMR_MASTERERR		0x00000800
-
-/* Block 2 */
-#define SK_MAC0_0	0x0100
-#define SK_MAC0_1	0x0104
-#define SK_MAC1_0	0x0108
-#define SK_MAC1_1	0x010C
-#define SK_MAC2_0	0x0110
-#define SK_MAC2_1	0x0114
-#define SK_CONNTYPE	0x0118
-#define SK_PMDTYPE	0x0119
-#define SK_CONFIG	0x011A
-#define SK_CHIPVER	0x011B
-#define SK_EPROM0	0x011C
-#define SK_EPROM1	0x011D
-#define SK_EPROM2	0x011E
-#define SK_EPROM3	0x011F
-#define SK_EP_ADDR	0x0120
-#define SK_EP_DATA	0x0124
-#define SK_EP_LOADCTL	0x0128
-#define SK_EP_LOADTST	0x0129
-#define SK_TIMERINIT	0x0130
-#define SK_TIMER	0x0134
-#define SK_TIMERCTL	0x0138
-#define SK_TIMERTST	0x0139
-#define SK_IMTIMERINIT	0x0140
-#define SK_IMTIMER	0x0144
-#define SK_IMTIMERCTL	0x0148
-#define SK_IMTIMERTST	0x0149
-#define SK_IMMR		0x014C
-#define SK_IHWEMR	0x0150
-#define SK_TESTCTL1	0x0158
-#define SK_TESTCTL2	0x0159
-#define SK_GPIO		0x015C
-#define SK_I2CHWCTL	0x0160
-#define SK_I2CHWDATA	0x0164
-#define SK_I2CHWIRQ	0x0168
-#define SK_I2CSW	0x016C
-#define SK_BLNKINIT	0x0170
-#define SK_BLNKCOUNT	0x0174
-#define SK_BLNKCTL	0x0178
-#define SK_BLNKSTS	0x0179
-#define SK_BLNKTST	0x017A
-
-#define SK_IMCTL_STOP	0x02
-#define SK_IMCTL_START	0x04
-
-#define SK_IMTIMER_TICKS	54
-#define SK_IM_USECS(x)		((x) * SK_IMTIMER_TICKS)
-
-#define	SK_IM_MIN	10
-#define	SK_IM_DEFAULT	100
-#define	SK_IM_MAX	10000
-
-/*
- * The SK_EPROM0 register contains a byte that describes the
- * amount of SRAM mounted on the NIC. The value also tells if
- * the chips are 64K or 128K. This affects the RAMbuffer address
- * offset that we need to use.
- */
-#define SK_RAMSIZE_512K_64	0x1
-#define SK_RAMSIZE_1024K_128	0x2
-#define SK_RAMSIZE_1024K_64	0x3
-#define SK_RAMSIZE_2048K_128	0x4
-
-#define SK_RBOFF_0		0x0
-#define SK_RBOFF_80000		0x80000
-
-/*
- * SK_EEPROM1 contains the PHY type, which may be XMAC for
- * fiber-based cards or BCOM for 1000baseT cards with a Broadcom
- * PHY.
- */
-#define SK_PHYTYPE_XMAC		0	/* integeated XMAC II PHY */
-#define SK_PHYTYPE_BCOM		1	/* Broadcom BCM5400 */
-#define SK_PHYTYPE_LONE		2	/* Level One LXT1000 */
-#define SK_PHYTYPE_NAT		3	/* National DP83891 */
-#define SK_PHYTYPE_MARV_COPPER	4       /* Marvell 88E1011S */
-#define SK_PHYTYPE_MARV_FIBER	5       /* Marvell 88E1011S (fiber) */
-
-/*
- * PHY addresses.
- */
-#define SK_PHYADDR_XMAC		0x0
-#define SK_PHYADDR_BCOM		0x1
-#define SK_PHYADDR_LONE		0x3
-#define SK_PHYADDR_NAT		0x0
-#define SK_PHYADDR_MARV		0x0
-
-#define SK_CONFIG_SINGLEMAC	0x01
-#define SK_CONFIG_DIS_DSL_CLK	0x02
-
-#define SK_PMD_1000BASELX	0x4C
-#define SK_PMD_1000BASESX	0x53
-#define SK_PMD_1000BASECX	0x43
-#define SK_PMD_1000BASETX	0x54
-
-/* GPIO bits */
-#define SK_GPIO_DAT0		0x00000001
-#define SK_GPIO_DAT1		0x00000002
-#define SK_GPIO_DAT2		0x00000004
-#define SK_GPIO_DAT3		0x00000008
-#define SK_GPIO_DAT4		0x00000010
-#define SK_GPIO_DAT5		0x00000020
-#define SK_GPIO_DAT6		0x00000040
-#define SK_GPIO_DAT7		0x00000080
-#define SK_GPIO_DAT8		0x00000100
-#define SK_GPIO_DAT9		0x00000200
-#define SK_GPIO_DIR0		0x00010000
-#define SK_GPIO_DIR1		0x00020000
-#define SK_GPIO_DIR2		0x00040000
-#define SK_GPIO_DIR3		0x00080000
-#define SK_GPIO_DIR4		0x00100000
-#define SK_GPIO_DIR5		0x00200000
-#define SK_GPIO_DIR6		0x00400000
-#define SK_GPIO_DIR7		0x00800000
-#define SK_GPIO_DIR8		0x01000000
-#define SK_GPIO_DIR9		0x02000000
-
-/* Block 3 Ram interface and MAC arbiter registers */
-#define SK_RAMADDR	0x0180
-#define SK_RAMDATA0	0x0184
-#define SK_RAMDATA1	0x0188
-#define SK_TO0		0x0190
-#define SK_TO1		0x0191
-#define SK_TO2		0x0192
-#define SK_TO3		0x0193
-#define SK_TO4		0x0194
-#define SK_TO5		0x0195
-#define SK_TO6		0x0196
-#define SK_TO7		0x0197
-#define SK_TO8		0x0198
-#define SK_TO9		0x0199
-#define SK_TO10		0x019A
-#define SK_TO11		0x019B
-#define SK_RITIMEO_TMR	0x019C
-#define SK_RAMCTL	0x01A0
-#define SK_RITIMER_TST	0x01A2
-
-#define SK_RAMCTL_RESET		0x0001
-#define SK_RAMCTL_UNRESET	0x0002
-#define SK_RAMCTL_CLR_IRQ_WPAR	0x0100
-#define SK_RAMCTL_CLR_IRQ_RPAR	0x0200
-
-/* Mac arbiter registers */
-#define SK_MINIT_RX1	0x01B0
-#define SK_MINIT_RX2	0x01B1
-#define SK_MINIT_TX1	0x01B2
-#define SK_MINIT_TX2	0x01B3
-#define SK_MTIMEO_RX1	0x01B4
-#define SK_MTIMEO_RX2	0x01B5
-#define SK_MTIMEO_TX1	0x01B6
-#define SK_MTIEMO_TX2	0x01B7
-#define SK_MACARB_CTL	0x01B8
-#define SK_MTIMER_TST	0x01BA
-#define SK_RCINIT_RX1	0x01C0
-#define SK_RCINIT_RX2	0x01C1
-#define SK_RCINIT_TX1	0x01C2
-#define SK_RCINIT_TX2	0x01C3
-#define SK_RCTIMEO_RX1	0x01C4
-#define SK_RCTIMEO_RX2	0x01C5
-#define SK_RCTIMEO_TX1	0x01C6
-#define SK_RCTIMEO_TX2	0x01C7
-#define SK_RECOVERY_CTL	0x01C8
-#define SK_RCTIMER_TST	0x01CA
-
-/* Packet arbiter registers */
-#define SK_RXPA1_TINIT	0x01D0
-#define SK_RXPA2_TINIT	0x01D4
-#define SK_TXPA1_TINIT	0x01D8
-#define SK_TXPA2_TINIT	0x01DC
-#define SK_RXPA1_TIMEO	0x01E0
-#define SK_RXPA2_TIMEO	0x01E4
-#define SK_TXPA1_TIMEO	0x01E8
-#define SK_TXPA2_TIMEO	0x01EC
-#define SK_PKTARB_CTL	0x01F0
-#define SK_PKTATB_TST	0x01F2
-
-#define SK_PKTARB_TIMEOUT	0x2000
-
-#define SK_PKTARBCTL_RESET		0x0001
-#define SK_PKTARBCTL_UNRESET		0x0002
-#define SK_PKTARBCTL_RXTO1_OFF		0x0004
-#define SK_PKTARBCTL_RXTO1_ON		0x0008
-#define SK_PKTARBCTL_RXTO2_OFF		0x0010
-#define SK_PKTARBCTL_RXTO2_ON		0x0020
-#define SK_PKTARBCTL_TXTO1_OFF		0x0040
-#define SK_PKTARBCTL_TXTO1_ON		0x0080
-#define SK_PKTARBCTL_TXTO2_OFF		0x0100
-#define SK_PKTARBCTL_TXTO2_ON		0x0200
-#define SK_PKTARBCTL_CLR_IRQ_RXTO1	0x0400
-#define SK_PKTARBCTL_CLR_IRQ_RXTO2	0x0800
-#define SK_PKTARBCTL_CLR_IRQ_TXTO1	0x1000
-#define SK_PKTARBCTL_CLR_IRQ_TXTO2	0x2000
-
-#define SK_MINIT_XMAC_B2	54
-#define SK_MINIT_XMAC_C1	63
-
-#define SK_MACARBCTL_RESET	0x0001
-#define SK_MACARBCTL_UNRESET	0x0002
-#define SK_MACARBCTL_FASTOE_OFF	0x0004
-#define SK_MACARBCRL_FASTOE_ON	0x0008
-
-#define SK_RCINIT_XMAC_B2	54
-#define SK_RCINIT_XMAC_C1	0
-
-#define SK_RECOVERYCTL_RX1_OFF	0x0001
-#define SK_RECOVERYCTL_RX1_ON	0x0002
-#define SK_RECOVERYCTL_RX2_OFF	0x0004
-#define SK_RECOVERYCTL_RX2_ON	0x0008
-#define SK_RECOVERYCTL_TX1_OFF	0x0010
-#define SK_RECOVERYCTL_TX1_ON	0x0020
-#define SK_RECOVERYCTL_TX2_OFF	0x0040
-#define SK_RECOVERYCTL_TX2_ON	0x0080
-
-#define SK_RECOVERY_XMAC_B2				\
-	(SK_RECOVERYCTL_RX1_ON|SK_RECOVERYCTL_RX2_ON|	\
-	SK_RECOVERYCTL_TX1_ON|SK_RECOVERYCTL_TX2_ON)
-
-#define SK_RECOVERY_XMAC_C1				\
-	(SK_RECOVERYCTL_RX1_OFF|SK_RECOVERYCTL_RX2_OFF|	\
-	SK_RECOVERYCTL_TX1_OFF|SK_RECOVERYCTL_TX2_OFF)
-
-/* Block 4 -- TX Arbiter MAC 1 */
-#define SK_TXAR1_TIMERINIT	0x0200
-#define SK_TXAR1_TIMERVAL	0x0204
-#define SK_TXAR1_LIMITINIT	0x0208
-#define SK_TXAR1_LIMITCNT	0x020C
-#define SK_TXAR1_COUNTERCTL	0x0210
-#define SK_TXAR1_COUNTERTST	0x0212
-#define SK_TXAR1_COUNTERSTS	0x0212
-
-/* Block 5 -- TX Arbiter MAC 2 */
-#define SK_TXAR2_TIMERINIT	0x0280
-#define SK_TXAR2_TIMERVAL	0x0284
-#define SK_TXAR2_LIMITINIT	0x0288
-#define SK_TXAR2_LIMITCNT	0x028C
-#define SK_TXAR2_COUNTERCTL	0x0290
-#define SK_TXAR2_COUNTERTST	0x0291
-#define SK_TXAR2_COUNTERSTS	0x0292
-
-#define SK_TXARCTL_OFF		0x01
-#define SK_TXARCTL_ON		0x02
-#define SK_TXARCTL_RATECTL_OFF	0x04
-#define SK_TXARCTL_RATECTL_ON	0x08
-#define SK_TXARCTL_ALLOC_OFF	0x10
-#define SK_TXARCTL_ALLOC_ON	0x20
-#define SK_TXARCTL_FSYNC_OFF	0x40
-#define SK_TXARCTL_FSYNC_ON	0x80
-
-/* Block 6 -- External registers */
-#define SK_EXTREG_BASE	0x300
-#define SK_EXTREG_END	0x37C
-
-/* Block 7 -- PCI config registers */
-#define SK_PCI_BASE	0x0380
-#define SK_PCI_END	0x03FC
-
-/* Compute offset of mirrored PCI register */
-#define SK_PCI_REG(reg)		((reg) + SK_PCI_BASE)
-
-/* Block 8 -- RX queue 1 */
-#define SK_RXQ1_BUFCNT		0x0400
-#define SK_RXQ1_BUFCTL		0x0402
-#define SK_RXQ1_NEXTDESC	0x0404
-#define SK_RXQ1_RXBUF_LO	0x0408
-#define SK_RXQ1_RXBUF_HI	0x040C
-#define SK_RXQ1_RXSTAT		0x0410
-#define SK_RXQ1_TIMESTAMP	0x0414
-#define SK_RXQ1_CSUM1		0x0418
-#define SK_RXQ1_CSUM2		0x041A
-#define SK_RXQ1_CSUM1_START	0x041C
-#define SK_RXQ1_CSUM2_START	0x041E
-#define SK_RXQ1_CURADDR_LO	0x0420
-#define SK_RXQ1_CURADDR_HI	0x0424
-#define SK_RXQ1_CURCNT_LO	0x0428
-#define SK_RXQ1_CURCNT_HI	0x042C
-#define SK_RXQ1_CURBYTES	0x0430
-#define SK_RXQ1_BMU_CSR		0x0434
-#define SK_RXQ1_WATERMARK	0x0438
-#define SK_RXQ1_FLAG		0x043A
-#define SK_RXQ1_TEST1		0x043C
-#define SK_RXQ1_TEST2		0x0440
-#define SK_RXQ1_TEST3		0x0444
-
-/* Block 9 -- RX queue 2 */
-#define SK_RXQ2_BUFCNT		0x0480
-#define SK_RXQ2_BUFCTL		0x0482
-#define SK_RXQ2_NEXTDESC	0x0484
-#define SK_RXQ2_RXBUF_LO	0x0488
-#define SK_RXQ2_RXBUF_HI	0x048C
-#define SK_RXQ2_RXSTAT		0x0490
-#define SK_RXQ2_TIMESTAMP	0x0494
-#define SK_RXQ2_CSUM1		0x0498
-#define SK_RXQ2_CSUM2		0x049A
-#define SK_RXQ2_CSUM1_START	0x049C
-#define SK_RXQ2_CSUM2_START	0x049E
-#define SK_RXQ2_CURADDR_LO	0x04A0
-#define SK_RXQ2_CURADDR_HI	0x04A4
-#define SK_RXQ2_CURCNT_LO	0x04A8
-#define SK_RXQ2_CURCNT_HI	0x04AC
-#define SK_RXQ2_CURBYTES	0x04B0
-#define SK_RXQ2_BMU_CSR		0x04B4
-#define SK_RXQ2_WATERMARK	0x04B8
-#define SK_RXQ2_FLAG		0x04BA
-#define SK_RXQ2_TEST1		0x04BC
-#define SK_RXQ2_TEST2		0x04C0
-#define SK_RXQ2_TEST3		0x04C4
-
-#define SK_RXBMU_CLR_IRQ_ERR		0x00000001
-#define SK_RXBMU_CLR_IRQ_EOF		0x00000002
-#define SK_RXBMU_CLR_IRQ_EOB		0x00000004
-#define SK_RXBMU_CLR_IRQ_PAR		0x00000008
-#define SK_RXBMU_RX_START		0x00000010
-#define SK_RXBMU_RX_STOP		0x00000020
-#define SK_RXBMU_POLL_OFF		0x00000040
-#define SK_RXBMU_POLL_ON		0x00000080
-#define SK_RXBMU_TRANSFER_SM_RESET	0x00000100
-#define SK_RXBMU_TRANSFER_SM_UNRESET	0x00000200
-#define SK_RXBMU_DESCWR_SM_RESET	0x00000400
-#define SK_RXBMU_DESCWR_SM_UNRESET	0x00000800
-#define SK_RXBMU_DESCRD_SM_RESET	0x00001000
-#define SK_RXBMU_DESCRD_SM_UNRESET	0x00002000
-#define SK_RXBMU_SUPERVISOR_SM_RESET	0x00004000
-#define SK_RXBMU_SUPERVISOR_SM_UNRESET	0x00008000
-#define SK_RXBMU_PFI_SM_RESET		0x00010000
-#define SK_RXBMU_PFI_SM_UNRESET		0x00020000
-#define SK_RXBMU_FIFO_RESET		0x00040000
-#define SK_RXBMU_FIFO_UNRESET		0x00080000
-#define SK_RXBMU_DESC_RESET		0x00100000
-#define SK_RXBMU_DESC_UNRESET		0x00200000
-#define SK_RXBMU_SUPERVISOR_IDLE	0x01000000
-
-#define SK_RXBMU_ONLINE		\
-	(SK_RXBMU_TRANSFER_SM_UNRESET|SK_RXBMU_DESCWR_SM_UNRESET|	\
-	SK_RXBMU_DESCRD_SM_UNRESET|SK_RXBMU_SUPERVISOR_SM_UNRESET|	\
-	SK_RXBMU_PFI_SM_UNRESET|SK_RXBMU_FIFO_UNRESET|			\
-	SK_RXBMU_DESC_UNRESET)
-
-#define SK_RXBMU_OFFLINE		\
-	(SK_RXBMU_TRANSFER_SM_RESET|SK_RXBMU_DESCWR_SM_RESET|	\
-	SK_RXBMU_DESCRD_SM_RESET|SK_RXBMU_SUPERVISOR_SM_RESET|	\
-	SK_RXBMU_PFI_SM_RESET|SK_RXBMU_FIFO_RESET|		\
-	SK_RXBMU_DESC_RESET)
-
-/* Block 12 -- TX sync queue 1 */
-#define SK_TXQS1_BUFCNT		0x0600
-#define SK_TXQS1_BUFCTL		0x0602
-#define SK_TXQS1_NEXTDESC	0x0604
-#define SK_TXQS1_RXBUF_LO	0x0608
-#define SK_TXQS1_RXBUF_HI	0x060C
-#define SK_TXQS1_RXSTAT		0x0610
-#define SK_TXQS1_CSUM_STARTVAL	0x0614
-#define SK_TXQS1_CSUM_STARTPOS	0x0618
-#define SK_TXQS1_CSUM_WRITEPOS	0x061A
-#define SK_TXQS1_CURADDR_LO	0x0620
-#define SK_TXQS1_CURADDR_HI	0x0624
-#define SK_TXQS1_CURCNT_LO	0x0628
-#define SK_TXQS1_CURCNT_HI	0x062C
-#define SK_TXQS1_CURBYTES	0x0630
-#define SK_TXQS1_BMU_CSR	0x0634
-#define SK_TXQS1_WATERMARK	0x0638
-#define SK_TXQS1_FLAG		0x063A
-#define SK_TXQS1_TEST1		0x063C
-#define SK_TXQS1_TEST2		0x0640
-#define SK_TXQS1_TEST3		0x0644
-
-/* Block 13 -- TX async queue 1 */
-#define SK_TXQA1_BUFCNT		0x0680
-#define SK_TXQA1_BUFCTL		0x0682
-#define SK_TXQA1_NEXTDESC	0x0684
-#define SK_TXQA1_RXBUF_LO	0x0688
-#define SK_TXQA1_RXBUF_HI	0x068C
-#define SK_TXQA1_RXSTAT		0x0690
-#define SK_TXQA1_CSUM_STARTVAL	0x0694
-#define SK_TXQA1_CSUM_STARTPOS	0x0698
-#define SK_TXQA1_CSUM_WRITEPOS	0x069A
-#define SK_TXQA1_CURADDR_LO	0x06A0
-#define SK_TXQA1_CURADDR_HI	0x06A4
-#define SK_TXQA1_CURCNT_LO	0x06A8
-#define SK_TXQA1_CURCNT_HI	0x06AC
-#define SK_TXQA1_CURBYTES	0x06B0
-#define SK_TXQA1_BMU_CSR	0x06B4
-#define SK_TXQA1_WATERMARK	0x06B8
-#define SK_TXQA1_FLAG		0x06BA
-#define SK_TXQA1_TEST1		0x06BC
-#define SK_TXQA1_TEST2		0x06C0
-#define SK_TXQA1_TEST3		0x06C4
-
-/* Block 14 -- TX sync queue 2 */
-#define SK_TXQS2_BUFCNT		0x0700
-#define SK_TXQS2_BUFCTL		0x0702
-#define SK_TXQS2_NEXTDESC	0x0704
-#define SK_TXQS2_RXBUF_LO	0x0708
-#define SK_TXQS2_RXBUF_HI	0x070C
-#define SK_TXQS2_RXSTAT		0x0710
-#define SK_TXQS2_CSUM_STARTVAL	0x0714
-#define SK_TXQS2_CSUM_STARTPOS	0x0718
-#define SK_TXQS2_CSUM_WRITEPOS	0x071A
-#define SK_TXQS2_CURADDR_LO	0x0720
-#define SK_TXQS2_CURADDR_HI	0x0724
-#define SK_TXQS2_CURCNT_LO	0x0728
-#define SK_TXQS2_CURCNT_HI	0x072C
-#define SK_TXQS2_CURBYTES	0x0730
-#define SK_TXQS2_BMU_CSR	0x0734
-#define SK_TXQS2_WATERMARK	0x0738
-#define SK_TXQS2_FLAG		0x073A
-#define SK_TXQS2_TEST1		0x073C
-#define SK_TXQS2_TEST2		0x0740
-#define SK_TXQS2_TEST3		0x0744
-
-/* Block 15 -- TX async queue 2 */
-#define SK_TXQA2_BUFCNT		0x0780
-#define SK_TXQA2_BUFCTL		0x0782
-#define SK_TXQA2_NEXTDESC	0x0784
-#define SK_TXQA2_RXBUF_LO	0x0788
-#define SK_TXQA2_RXBUF_HI	0x078C
-#define SK_TXQA2_RXSTAT		0x0790
-#define SK_TXQA2_CSUM_STARTVAL	0x0794
-#define SK_TXQA2_CSUM_STARTPOS	0x0798
-#define SK_TXQA2_CSUM_WRITEPOS	0x079A
-#define SK_TXQA2_CURADDR_LO	0x07A0
-#define SK_TXQA2_CURADDR_HI	0x07A4
-#define SK_TXQA2_CURCNT_LO	0x07A8
-#define SK_TXQA2_CURCNT_HI	0x07AC
-#define SK_TXQA2_CURBYTES	0x07B0
-#define SK_TXQA2_BMU_CSR	0x07B4
-#define SK_TXQA2_WATERMARK	0x07B8
-#define SK_TXQA2_FLAG		0x07BA
-#define SK_TXQA2_TEST1		0x07BC
-#define SK_TXQA2_TEST2		0x07C0
-#define SK_TXQA2_TEST3		0x07C4
-
-#define SK_TXBMU_CLR_IRQ_ERR		0x00000001
-#define SK_TXBMU_CLR_IRQ_EOF		0x00000002
-#define SK_TXBMU_CLR_IRQ_EOB		0x00000004
-#define SK_TXBMU_TX_START		0x00000010
-#define SK_TXBMU_TX_STOP		0x00000020
-#define SK_TXBMU_POLL_OFF		0x00000040
-#define SK_TXBMU_POLL_ON		0x00000080
-#define SK_TXBMU_TRANSFER_SM_RESET	0x00000100
-#define SK_TXBMU_TRANSFER_SM_UNRESET	0x00000200
-#define SK_TXBMU_DESCWR_SM_RESET	0x00000400
-#define SK_TXBMU_DESCWR_SM_UNRESET	0x00000800
-#define SK_TXBMU_DESCRD_SM_RESET	0x00001000
-#define SK_TXBMU_DESCRD_SM_UNRESET	0x00002000
-#define SK_TXBMU_SUPERVISOR_SM_RESET	0x00004000
-#define SK_TXBMU_SUPERVISOR_SM_UNRESET	0x00008000
-#define SK_TXBMU_PFI_SM_RESET		0x00010000
-#define SK_TXBMU_PFI_SM_UNRESET		0x00020000
-#define SK_TXBMU_FIFO_RESET		0x00040000
-#define SK_TXBMU_FIFO_UNRESET		0x00080000
-#define SK_TXBMU_DESC_RESET		0x00100000
-#define SK_TXBMU_DESC_UNRESET		0x00200000
-#define SK_TXBMU_SUPERVISOR_IDLE	0x01000000
-
-#define SK_TXBMU_ONLINE		\
-	(SK_TXBMU_TRANSFER_SM_UNRESET|SK_TXBMU_DESCWR_SM_UNRESET|	\
-	SK_TXBMU_DESCRD_SM_UNRESET|SK_TXBMU_SUPERVISOR_SM_UNRESET|	\
-	SK_TXBMU_PFI_SM_UNRESET|SK_TXBMU_FIFO_UNRESET|			\
-	SK_TXBMU_DESC_UNRESET)
-
-#define SK_TXBMU_OFFLINE		\
-	(SK_TXBMU_TRANSFER_SM_RESET|SK_TXBMU_DESCWR_SM_RESET|	\
-	SK_TXBMU_DESCRD_SM_RESET|SK_TXBMU_SUPERVISOR_SM_RESET|	\
-	SK_TXBMU_PFI_SM_RESET|SK_TXBMU_FIFO_RESET|		\
-	SK_TXBMU_DESC_RESET)
-
-/* Block 16 -- Receive RAMbuffer 1 */
-#define SK_RXRB1_START		0x0800
-#define SK_RXRB1_END		0x0804
-#define SK_RXRB1_WR_PTR		0x0808
-#define SK_RXRB1_RD_PTR		0x080C
-#define SK_RXRB1_UTHR_PAUSE	0x0810
-#define SK_RXRB1_LTHR_PAUSE	0x0814
-#define SK_RXRB1_UTHR_HIPRIO	0x0818
-#define SK_RXRB1_UTHR_LOPRIO	0x081C
-#define SK_RXRB1_PKTCNT		0x0820
-#define SK_RXRB1_LVL		0x0824
-#define SK_RXRB1_CTLTST		0x0828
-
-/* Block 17 -- Receive RAMbuffer 2 */
-#define SK_RXRB2_START		0x0880
-#define SK_RXRB2_END		0x0884
-#define SK_RXRB2_WR_PTR		0x0888
-#define SK_RXRB2_RD_PTR		0x088C
-#define SK_RXRB2_UTHR_PAUSE	0x0890
-#define SK_RXRB2_LTHR_PAUSE	0x0894
-#define SK_RXRB2_UTHR_HIPRIO	0x0898
-#define SK_RXRB2_UTHR_LOPRIO	0x089C
-#define SK_RXRB2_PKTCNT		0x08A0
-#define SK_RXRB2_LVL		0x08A4
-#define SK_RXRB2_CTLTST		0x08A8
-
-/* Block 20 -- Sync. Transmit RAMbuffer 1 */
-#define SK_TXRBS1_START		0x0A00
-#define SK_TXRBS1_END		0x0A04
-#define SK_TXRBS1_WR_PTR	0x0A08
-#define SK_TXRBS1_RD_PTR	0x0A0C
-#define SK_TXRBS1_PKTCNT	0x0A20
-#define SK_TXRBS1_LVL		0x0A24
-#define SK_TXRBS1_CTLTST	0x0A28
-
-/* Block 21 -- Async. Transmit RAMbuffer 1 */
-#define SK_TXRBA1_START		0x0A80
-#define SK_TXRBA1_END		0x0A84
-#define SK_TXRBA1_WR_PTR	0x0A88
-#define SK_TXRBA1_RD_PTR	0x0A8C
-#define SK_TXRBA1_PKTCNT	0x0AA0
-#define SK_TXRBA1_LVL		0x0AA4
-#define SK_TXRBA1_CTLTST	0x0AA8
-
-/* Block 22 -- Sync. Transmit RAMbuffer 2 */
-#define SK_TXRBS2_START		0x0B00
-#define SK_TXRBS2_END		0x0B04
-#define SK_TXRBS2_WR_PTR	0x0B08
-#define SK_TXRBS2_RD_PTR	0x0B0C
-#define SK_TXRBS2_PKTCNT	0x0B20
-#define SK_TXRBS2_LVL		0x0B24
-#define SK_TXRBS2_CTLTST	0x0B28
-
-/* Block 23 -- Async. Transmit RAMbuffer 2 */
-#define SK_TXRBA2_START		0x0B80
-#define SK_TXRBA2_END		0x0B84
-#define SK_TXRBA2_WR_PTR	0x0B88
-#define SK_TXRBA2_RD_PTR	0x0B8C
-#define SK_TXRBA2_PKTCNT	0x0BA0
-#define SK_TXRBA2_LVL		0x0BA4
-#define SK_TXRBA2_CTLTST	0x0BA8
-
-#define SK_RBCTL_RESET		0x00000001
-#define SK_RBCTL_UNRESET	0x00000002
-#define SK_RBCTL_OFF		0x00000004
-#define SK_RBCTL_ON		0x00000008
-#define SK_RBCTL_STORENFWD_OFF	0x00000010
-#define SK_RBCTL_STORENFWD_ON	0x00000020
-
-/* Block 24 -- RX MAC FIFO 1 regisrers and LINK_SYNC counter */
-#define SK_RXF1_END		0x0C00
-#define SK_RXF1_WPTR		0x0C04
-#define SK_RXF1_RPTR		0x0C0C
-#define SK_RXF1_PKTCNT		0x0C10
-#define SK_RXF1_LVL		0x0C14
-#define SK_RXF1_MACCTL		0x0C18
-#define SK_RXF1_CTL		0x0C1C
-#define SK_RXLED1_CNTINIT	0x0C20
-#define SK_RXLED1_COUNTER	0x0C24
-#define SK_RXLED1_CTL		0x0C28
-#define SK_RXLED1_TST		0x0C29
-#define SK_LINK_SYNC1_CINIT	0x0C30
-#define SK_LINK_SYNC1_COUNTER	0x0C34
-#define SK_LINK_SYNC1_CTL	0x0C38
-#define SK_LINK_SYNC1_TST	0x0C39
-#define SK_LINKLED1_CTL		0x0C3C
-
-#define SK_FIFO_END		0x3F
-
-/* Receive MAC FIFO 1 (Yukon Only) */
-#define SK_RXMF1_END		0x0C40
-#define SK_RXMF1_THRESHOLD	0x0C44
-#define SK_RXMF1_CTRL_TEST	0x0C48
-#define SK_RXMF1_WRITE_PTR	0x0C60
-#define SK_RXMF1_WRITE_LEVEL	0x0C68
-#define SK_RXMF1_READ_PTR	0x0C70
-#define SK_RXMF1_READ_LEVEL	0x0C78
-
-#define SK_RFCTL_WR_PTR_TST_ON	0x00004000	/* Write pointer test on*/
-#define SK_RFCTL_WR_PTR_TST_OFF	0x00002000	/* Write pointer test off */
-#define SK_RFCTL_WR_PTR_STEP	0x00001000	/* Write pointer increment */
-#define SK_RFCTL_RD_PTR_TST_ON	0x00000400	/* Read pointer test on */
-#define SK_RFCTL_RD_PTR_TST_OFF	0x00000200	/* Read pointer test off */
-#define SK_RFCTL_RD_PTR_STEP	0x00000100	/* Read pointer increment */
-#define SK_RFCTL_RX_FIFO_OVER	0x00000040	/* Clear IRQ RX FIFO Overrun */
-#define SK_RFCTL_FRAME_RX_DONE	0x00000010	/* Clear IRQ Frame RX Done */
-#define SK_RFCTL_OPERATION_ON	0x00000008	/* Operational mode on */
-#define SK_RFCTL_OPERATION_OFF	0x00000004	/* Operational mode off */
-#define SK_RFCTL_RESET_CLEAR	0x00000002	/* MAC FIFO Reset Clear */
-#define SK_RFCTL_RESET_SET	0x00000001	/* MAC FIFO Reset Set */
-
-/* Block 25 -- RX MAC FIFO 2 regisrers and LINK_SYNC counter */
-#define SK_RXF2_END		0x0C80
-#define SK_RXF2_WPTR		0x0C84
-#define SK_RXF2_RPTR		0x0C8C
-#define SK_RXF2_PKTCNT		0x0C90
-#define SK_RXF2_LVL		0x0C94
-#define SK_RXF2_MACCTL		0x0C98
-#define SK_RXF2_CTL		0x0C9C
-#define SK_RXLED2_CNTINIT	0x0CA0
-#define SK_RXLED2_COUNTER	0x0CA4
-#define SK_RXLED2_CTL		0x0CA8
-#define SK_RXLED2_TST		0x0CA9
-#define SK_LINK_SYNC2_CINIT	0x0CB0
-#define SK_LINK_SYNC2_COUNTER	0x0CB4
-#define SK_LINK_SYNC2_CTL	0x0CB8
-#define SK_LINK_SYNC2_TST	0x0CB9
-#define SK_LINKLED2_CTL		0x0CBC
-
-#define SK_RXMACCTL_CLR_IRQ_NOSTS	0x00000001
-#define SK_RXMACCTL_CLR_IRQ_NOTSTAMP	0x00000002
-#define SK_RXMACCTL_TSTAMP_OFF		0x00000004
-#define SK_RXMACCTL_RSTAMP_ON		0x00000008
-#define SK_RXMACCTL_FLUSH_OFF		0x00000010
-#define SK_RXMACCTL_FLUSH_ON		0x00000020
-#define SK_RXMACCTL_PAUSE_OFF		0x00000040
-#define SK_RXMACCTL_PAUSE_ON		0x00000080
-#define SK_RXMACCTL_AFULL_OFF		0x00000100
-#define SK_RXMACCTL_AFULL_ON		0x00000200
-#define SK_RXMACCTL_VALIDTIME_PATCH_OFF	0x00000400
-#define SK_RXMACCTL_VALIDTIME_PATCH_ON	0x00000800
-#define SK_RXMACCTL_RXRDY_PATCH_OFF	0x00001000
-#define SK_RXMACCTL_RXRDY_PATCH_ON	0x00002000
-#define SK_RXMACCTL_STS_TIMEO		0x00FF0000
-#define SK_RXMACCTL_TSTAMP_TIMEO	0xFF000000
-
-#define SK_RXLEDCTL_ENABLE		0x0001
-#define SK_RXLEDCTL_COUNTER_STOP	0x0002
-#define SK_RXLEDCTL_COUNTER_START	0x0004
-
-#define SK_LINKLED_OFF			0x0001
-#define SK_LINKLED_ON			0x0002
-#define SK_LINKLED_LINKSYNC_OFF		0x0004
-#define SK_LINKLED_LINKSYNC_ON		0x0008
-#define SK_LINKLED_BLINK_OFF		0x0010
-#define SK_LINKLED_BLINK_ON		0x0020
-
-/* Block 26 -- TX MAC FIFO 1 regisrers  */
-#define SK_TXF1_END		0x0D00
-#define SK_TXF1_WPTR		0x0D04
-#define SK_TXF1_RPTR		0x0D0C
-#define SK_TXF1_PKTCNT		0x0D10
-#define SK_TXF1_LVL		0x0D14
-#define SK_TXF1_MACCTL		0x0D18
-#define SK_TXF1_CTL		0x0D1C
-#define SK_TXLED1_CNTINIT	0x0D20
-#define SK_TXLED1_COUNTER	0x0D24
-#define SK_TXLED1_CTL		0x0D28
-#define SK_TXLED1_TST		0x0D29
-
-/* Receive MAC FIFO 1 (Yukon Only) */
-#define SK_TXMF1_END		0x0D40
-#define SK_TXMF1_THRESHOLD	0x0D44
-#define SK_TXMF1_CTRL_TEST	0x0D48
-#define SK_TXMF1_WRITE_PTR	0x0D60
-#define SK_TXMF1_WRITE_SHADOW	0x0D64
-#define SK_TXMF1_WRITE_LEVEL	0x0D68
-#define SK_TXMF1_READ_PTR	0x0D70
-#define SK_TXMF1_RESTART_PTR	0x0D74
-#define SK_TXMF1_READ_LEVEL	0x0D78
-
-#define SK_TFCTL_WR_PTR_TST_ON	0x00004000	/* Write pointer test on*/
-#define SK_TFCTL_WR_PTR_TST_OFF	0x00002000	/* Write pointer test off */
-#define SK_TFCTL_WR_PTR_STEP	0x00001000	/* Write pointer increment */
-#define SK_TFCTL_RD_PTR_TST_ON	0x00000400	/* Read pointer test on */
-#define SK_TFCTL_RD_PTR_TST_OFF	0x00000200	/* Read pointer test off */
-#define SK_TFCTL_RD_PTR_STEP	0x00000100	/* Read pointer increment */
-#define SK_TFCTL_TX_FIFO_UNDER	0x00000040	/* Clear IRQ TX FIFO Under */
-#define SK_TFCTL_FRAME_TX_DONE	0x00000020	/* Clear IRQ Frame TX Done */
-#define SK_TFCTL_IRQ_PARITY_ER	0x00000010	/* Clear IRQ Parity Error */
-#define SK_TFCTL_OPERATION_ON	0x00000008	/* Operational mode on */
-#define SK_TFCTL_OPERATION_OFF	0x00000004	/* Operational mode off */
-#define SK_TFCTL_RESET_CLEAR	0x00000002	/* MAC FIFO Reset Clear */
-#define SK_TFCTL_RESET_SET	0x00000001	/* MAC FIFO Reset Set */
-
-/* Block 27 -- TX MAC FIFO 2 regisrers  */
-#define SK_TXF2_END		0x0D80
-#define SK_TXF2_WPTR		0x0D84
-#define SK_TXF2_RPTR		0x0D8C
-#define SK_TXF2_PKTCNT		0x0D90
-#define SK_TXF2_LVL		0x0D94
-#define SK_TXF2_MACCTL		0x0D98
-#define SK_TXF2_CTL		0x0D9C
-#define SK_TXLED2_CNTINIT	0x0DA0
-#define SK_TXLED2_COUNTER	0x0DA4
-#define SK_TXLED2_CTL		0x0DA8
-#define SK_TXLED2_TST		0x0DA9
-
-#define SK_TXMACCTL_XMAC_RESET		0x00000001
-#define SK_TXMACCTL_XMAC_UNRESET	0x00000002
-#define SK_TXMACCTL_LOOP_OFF		0x00000004
-#define SK_TXMACCTL_LOOP_ON		0x00000008
-#define SK_TXMACCTL_FLUSH_OFF		0x00000010
-#define SK_TXMACCTL_FLUSH_ON		0x00000020
-#define SK_TXMACCTL_WAITEMPTY_OFF	0x00000040
-#define SK_TXMACCTL_WAITEMPTY_ON	0x00000080
-#define SK_TXMACCTL_AFULL_OFF		0x00000100
-#define SK_TXMACCTL_AFULL_ON		0x00000200
-#define SK_TXMACCTL_TXRDY_PATCH_OFF	0x00000400
-#define SK_TXMACCTL_RXRDY_PATCH_ON	0x00000800
-#define SK_TXMACCTL_PKT_RECOVERY_OFF	0x00001000
-#define SK_TXMACCTL_PKT_RECOVERY_ON	0x00002000
-#define SK_TXMACCTL_CLR_IRQ_PERR	0x00008000
-#define SK_TXMACCTL_WAITAFTERFLUSH	0x00010000
-
-#define SK_TXLEDCTL_ENABLE		0x0001
-#define SK_TXLEDCTL_COUNTER_STOP	0x0002
-#define SK_TXLEDCTL_COUNTER_START	0x0004
-
-#define SK_FIFO_RESET		0x00000001
-#define SK_FIFO_UNRESET		0x00000002
-#define SK_FIFO_OFF		0x00000004
-#define SK_FIFO_ON		0x00000008
-
-/* Block 28 -- Descriptor Poll Timer */
-#define SK_DPT_INIT		0x0e00	/* Initial value 24 bits */
-#define SK_DPT_TIMER		0x0e04	/* Mul of 78.12MHz clk (24b) */
-
-#define SK_DPT_TIMER_CTRL	0x0e08	/* Timer Control 16 bits */
-#define SK_DPT_TCTL_STOP	0x0001	/* Stop Timer */
-#define SK_DPT_TCTL_START	0x0002	/* Start Timer */
-
-#define SK_DPT_TIMER_TEST	0x0e0a	/* Timer Test 16 bits */
-#define SK_DPT_TTEST_STEP	0x0001	/* Timer Decrement */
-#define SK_DPT_TTEST_OFF	0x0002	/* Test Mode Off */
-#define SK_DPT_TTEST_ON		0x0004	/* Test Mode On */
-
-/* Block 29 -- reserved */
-
-/* Block 30 -- GMAC/GPHY Control Registers (Yukon Only)*/
-#define SK_GMAC_CTRL		0x0f00	/* GMAC Control Register */
-#define SK_GPHY_CTRL		0x0f04	/* GPHY Control Register */
-#define SK_GMAC_ISR		0x0f08	/* GMAC Interrupt Source Register */
-#define SK_GMAC_IMR		0x0f08	/* GMAC Interrupt Mask Register */
-#define SK_LINK_CTRL		0x0f10	/* Link Control Register (LCR) */
-#define SK_WOL_CTRL		0x0f20	/* Wake on LAN Control Register */
-#define SK_MAC_ADDR_LOW		0x0f24	/* Mack Address Registers LOW */
-#define SK_MAC_ADDR_HIGH	0x0f28	/* Mack Address Registers HIGH */
-#define SK_PAT_READ_PTR		0x0f2c	/* Pattern Read Pointer Register */
-#define SK_PAT_LEN_REG0		0x0f30	/* Pattern Length Register 0 */
-#define SK_PAT_LEN0		0x0f30	/* Pattern Length 0 */
-#define SK_PAT_LEN1		0x0f31	/* Pattern Length 1 */
-#define SK_PAT_LEN2		0x0f32	/* Pattern Length 2 */
-#define SK_PAT_LEN3		0x0f33	/* Pattern Length 3 */
-#define SK_PAT_LEN_REG1		0x0f34	/* Pattern Length Register 1 */
-#define SK_PAT_LEN4		0x0f34	/* Pattern Length 4 */
-#define SK_PAT_LEN5		0x0f35	/* Pattern Length 5 */
-#define SK_PAT_LEN6		0x0f36	/* Pattern Length 6 */
-#define SK_PAT_LEN7		0x0f37	/* Pattern Length 7 */
-#define SK_PAT_CTR_REG0		0x0f38	/* Pattern Counter Register 0 */
-#define SK_PAT_CTR0		0x0f38	/* Pattern Counter 0 */
-#define SK_PAT_CTR1		0x0f39	/* Pattern Counter 1 */
-#define SK_PAT_CTR2		0x0f3a	/* Pattern Counter 2 */
-#define SK_PAT_CTR3		0x0f3b	/* Pattern Counter 3 */
-#define SK_PAT_CTR_REG1		0x0f3c	/* Pattern Counter Register 1 */
-#define SK_PAT_CTR4		0x0f3c	/* Pattern Counter 4 */
-#define SK_PAT_CTR5		0x0f3d	/* Pattern Counter 5 */
-#define SK_PAT_CTR6		0x0f3e	/* Pattern Counter 6 */
-#define SK_PAT_CTR7		0x0f3f	/* Pattern Counter 7 */
-
-#define SK_GMAC_LOOP_ON		0x00000020	/* Loopback mode for testing */
-#define SK_GMAC_LOOP_OFF	0x00000010	/* purposes */
-#define SK_GMAC_PAUSE_ON	0x00000008	/* enable forward of pause */
-#define SK_GMAC_PAUSE_OFF	0x00000004	/* signal to GMAC */
-#define SK_GMAC_RESET_CLEAR	0x00000002	/* Clear GMAC Reset */
-#define SK_GMAC_RESET_SET	0x00000001	/* Set GMAC Reset */
-
-#define SK_GPHY_SEL_BDT		0x10000000	/* Select Bidirectional xfer */
-#define SK_GPHY_INT_POL_HI	0x08000000	/* IRQ Polarity Active */
-#define SK_GPHY_75_OHM		0x04000000	/* Use 75 Ohm Termination */
-#define SK_GPHY_DIS_FC		0x02000000	/* Disable Auto Fiber/Copper */
-#define SK_GPHY_DIS_SLEEP	0x01000000	/* Disable Energy Detect */
-#define SK_GPHY_HWCFG_M_3	0x00800000	/* HWCFG_MODE[3] */
-#define SK_GPHY_HWCFG_M_2	0x00400000	/* HWCFG_MODE[2] */
-#define SK_GPHY_HWCFG_M_1	0x00200000	/* HWCFG_MODE[1] */
-#define SK_GPHY_HWCFG_M_0	0x00100000	/* HWCFG_MODE[0] */
-#define SK_GPHY_ANEG_0		0x00080000	/* ANEG[0] */
-#define SK_GPHY_ENA_XC		0x00040000	/* Enable MDI Crossover */
-#define SK_GPHY_DIS_125		0x00020000	/* Disable 125MHz Clock */
-#define SK_GPHY_ANEG_3		0x00010000	/* ANEG[3] */
-#define SK_GPHY_ANEG_2		0x00008000	/* ANEG[2] */
-#define SK_GPHY_ANEG_1		0x00004000	/* ANEG[1] */
-#define SK_GPHY_ENA_PAUSE	0x00002000	/* Enable Pause */
-#define SK_GPHY_PHYADDR_4	0x00001000	/* Bit 4 of Phy Addr */
-#define SK_GPHY_PHYADDR_3	0x00000800	/* Bit 3 of Phy Addr */
-#define SK_GPHY_PHYADDR_2	0x00000400	/* Bit 2 of Phy Addr */
-#define SK_GPHY_PHYADDR_1	0x00000200	/* Bit 1 of Phy Addr */
-#define SK_GPHY_PHYADDR_0	0x00000100	/* Bit 0 of Phy Addr */
-#define SK_GPHY_RESET_CLEAR	0x00000002	/* Clear GPHY Reset */
-#define SK_GPHY_RESET_SET	0x00000001	/* Set GPHY Reset */
-
-#define SK_GPHY_COPPER		(SK_GPHY_HWCFG_M_0 | SK_GPHY_HWCFG_M_1 | \
-				 SK_GPHY_HWCFG_M_2 | SK_GPHY_HWCFG_M_3 )
-#define SK_GPHY_FIBER		(SK_GPHY_HWCFG_M_0 | SK_GPHY_HWCFG_M_1 | \
-				 SK_GPHY_HWCFG_M_2 )
-#define SK_GPHY_ANEG_ALL	(SK_GPHY_ANEG_0 | SK_GPHY_ANEG_1 | \
-				 SK_GPHY_ANEG_2 | SK_GPHY_ANEG_3 )
-
-#define SK_GMAC_INT_TX_OFLOW	0x20	/* Transmit Counter Overflow */
-#define SK_GMAC_INT_RX_OFLOW	0x10	/* Receiver Overflow */
-#define SK_GMAC_INT_TX_UNDER	0x08	/* Transmit FIFO Underrun */
-#define SK_GMAC_INT_TX_DONE	0x04	/* Transmit Complete */
-#define SK_GMAC_INT_RX_OVER	0x02	/* Receive FIFO Overrun */
-#define SK_GMAC_INT_RX_DONE	0x01	/* Receive Complete */
-
-#define SK_LINK_RESET_CLEAR	0x0002	/* Link Reset Clear */
-#define SK_LINK_RESET_SET	0x0001	/* Link Reset Set */
-
-/* Block 31 -- reserved */
-
-/* Block 32-33 -- Pattern Ram */
-#define SK_WOL_PRAM		0x1000
-
-/* Block 0x22 - 0x3f -- reserved */
-
-/* Block 0x40 to 0x4F -- XMAC 1 registers */
-#define SK_XMAC1_BASE	0x2000
-
-/* Block 0x50 to 0x5F -- MARV 1 registers */
-#define SK_MARV1_BASE	0x2800
-
-/* Block 0x60 to 0x6F -- XMAC 2 registers */
-#define SK_XMAC2_BASE	0x3000
-
-/* Block 0x70 to 0x7F -- MARV 2 registers */
-#define SK_MARV2_BASE	0x3800
-
-/* Compute relative offset of an XMAC register in the XMAC window(s). */
-#define SK_XMAC_REG(sc, reg)	(((reg) * 2) + SK_XMAC1_BASE +		\
-	(((sc)->sk_port) * (SK_XMAC2_BASE - SK_XMAC1_BASE)))
-
-#if 0
-#define SK_XM_READ_4(sc, reg)						\
-	((sk_win_read_2(sc->sk_softc,					\
-	SK_XMAC_REG(sc, reg)) & 0xFFFF) |				\
-	((sk_win_read_2(sc->sk_softc,					\
-	SK_XMAC_REG(sc, reg + 2)) & 0xFFFF) << 16))
-
-#define SK_XM_WRITE_4(sc, reg, val)					\
-	sk_win_write_2(sc->sk_softc, SK_XMAC_REG(sc, reg),		\
-	((val) & 0xFFFF));						\
-	sk_win_write_2(sc->sk_softc, SK_XMAC_REG(sc, reg + 2),		\
-	((val) >> 16) & 0xFFFF)
-#else
-#define SK_XM_READ_4(sc, reg)		\
-	sk_win_read_4(sc->sk_softc, SK_XMAC_REG(sc, reg))
-
-#define SK_XM_WRITE_4(sc, reg, val)	\
-	sk_win_write_4(sc->sk_softc, SK_XMAC_REG(sc, reg), (val))
-#endif
-
-#define SK_XM_READ_2(sc, reg)		\
-	sk_win_read_2(sc->sk_softc, SK_XMAC_REG(sc, reg))
-
-#define SK_XM_WRITE_2(sc, reg, val)	\
-	sk_win_write_2(sc->sk_softc, SK_XMAC_REG(sc, reg), val)
-
-#define SK_XM_SETBIT_4(sc, reg, x)	\
-	SK_XM_WRITE_4(sc, reg, (SK_XM_READ_4(sc, reg)) | (x))
-
-#define SK_XM_CLRBIT_4(sc, reg, x)	\
-	SK_XM_WRITE_4(sc, reg, (SK_XM_READ_4(sc, reg)) & ~(x))
-
-#define SK_XM_SETBIT_2(sc, reg, x)	\
-	SK_XM_WRITE_2(sc, reg, (SK_XM_READ_2(sc, reg)) | (x))
-
-#define SK_XM_CLRBIT_2(sc, reg, x)	\
-	SK_XM_WRITE_2(sc, reg, (SK_XM_READ_2(sc, reg)) & ~(x))
-
-/* Compute relative offset of an MARV register in the MARV window(s). */
-#define SK_YU_REG(sc, reg) \
-	((reg) + SK_MARV1_BASE + \
-	(((sc)->sk_port) * (SK_MARV2_BASE - SK_MARV1_BASE)))
-
-#define SK_YU_READ_4(sc, reg)		\
-	sk_win_read_4((sc)->sk_softc, SK_YU_REG((sc), (reg)))
-
-#define SK_YU_READ_2(sc, reg)		\
-	sk_win_read_2((sc)->sk_softc, SK_YU_REG((sc), (reg)))
-
-#define SK_YU_WRITE_4(sc, reg, val)	\
-	sk_win_write_4((sc)->sk_softc, SK_YU_REG((sc), (reg)), (val))
-
-#define SK_YU_WRITE_2(sc, reg, val)	\
-	sk_win_write_2((sc)->sk_softc, SK_YU_REG((sc), (reg)), (val))
-
-#define SK_YU_SETBIT_4(sc, reg, x)	\
-	SK_YU_WRITE_4(sc, reg, (SK_YU_READ_4(sc, reg)) | (x))
-
-#define SK_YU_CLRBIT_4(sc, reg, x)	\
-	SK_YU_WRITE_4(sc, reg, (SK_YU_READ_4(sc, reg)) & ~(x))
-
-#define SK_YU_SETBIT_2(sc, reg, x)	\
-	SK_YU_WRITE_2(sc, reg, (SK_YU_READ_2(sc, reg)) | (x))
-
-#define SK_YU_CLRBIT_2(sc, reg, x)	\
-	SK_YU_WRITE_2(sc, reg, (SK_YU_READ_2(sc, reg)) & ~(x))
-
-/*
- * The default FIFO threshold on the XMAC II is 4 bytes. On
- * dual port NICs, this often leads to transmit underruns, so we
- * bump the threshold a little.
- */
-#define SK_XM_TX_FIFOTHRESH	512
-
-#define SK_PCI_VENDOR_ID	0x0000
-#define SK_PCI_DEVICE_ID	0x0002
-#define SK_PCI_COMMAND		0x0004
-#define SK_PCI_STATUS		0x0006
-#define SK_PCI_REVID		0x0008
-#define SK_PCI_CLASSCODE	0x0009
-#define SK_PCI_CACHELEN		0x000C
-#define SK_PCI_LATENCY_TIMER	0x000D
-#define SK_PCI_HEADER_TYPE	0x000E
-#define SK_PCI_LOMEM		0x0010
-#define SK_PCI_LOIO		0x0014
-#define SK_PCI_SUBVEN_ID	0x002C
-#define SK_PCI_SYBSYS_ID	0x002E
-#define SK_PCI_BIOSROM		0x0030
-#define SK_PCI_INTLINE		0x003C
-#define SK_PCI_INTPIN		0x003D
-#define SK_PCI_MINGNT		0x003E
-#define SK_PCI_MINLAT		0x003F
-
-/* device specific PCI registers */
-#define SK_PCI_OURREG1		0x0040
-#define SK_PCI_OURREG2		0x0044
-#define SK_PCI_CAPID		0x0048 /* 8 bits */
-#define SK_PCI_NEXTPTR		0x0049 /* 8 bits */
-#define SK_PCI_PWRMGMTCAP	0x004A /* 16 bits */
-#define SK_PCI_PWRMGMTCTRL	0x004C /* 16 bits */
-#define SK_PCI_PME_EVENT	0x004F
-#define SK_PCI_VPD_CAPID	0x0050
-#define SK_PCI_VPD_NEXTPTR	0x0051
-#define SK_PCI_VPD_ADDR		0x0052
-#define SK_PCI_VPD_DATA		0x0054
-
-#define SK_PSTATE_MASK		0x0003
-#define SK_PSTATE_D0		0x0000
-#define SK_PSTATE_D1		0x0001
-#define SK_PSTATE_D2		0x0002
-#define SK_PSTATE_D3		0x0003
-#define SK_PME_EN		0x0010
-#define SK_PME_STATUS		0x8000
-
-/*
- * VPD flag bit. Set to 0 to initiate a read, will become 1 when
- * read is complete. Set to 1 to initiate a write, will become 0
- * when write is finished.
- */
-#define SK_VPD_FLAG		0x8000
-
-/* VPD structures */
-struct vpd_res {
-	u_int8_t		vr_id;
-	u_int8_t		vr_len;
-	u_int8_t		vr_pad;
-};
-
-struct vpd_key {
-	char			vk_key[2];
-	u_int8_t		vk_len;
-};
-
-#define VPD_RES_ID	0x82	/* ID string */
-#define VPD_RES_READ	0x90	/* start of read only area */
-#define VPD_RES_WRITE	0x81	/* start of read/write area */
-#define VPD_RES_END	0x78	/* end tag */
-
-#define CSR_WRITE_4(sc, reg, val)	\
-	bus_space_write_4((sc)->sk_btag, (sc)->sk_bhandle, (reg), (val))
-#define CSR_WRITE_2(sc, reg, val)	\
-	bus_space_write_2((sc)->sk_btag, (sc)->sk_bhandle, (reg), (val))
-#define CSR_WRITE_1(sc, reg, val)	\
-	bus_space_write_1((sc)->sk_btag, (sc)->sk_bhandle, (reg), (val))
-
-#define CSR_READ_4(sc, reg)		\
-	bus_space_read_4((sc)->sk_btag, (sc)->sk_bhandle, (reg))
-#define CSR_READ_2(sc, reg)		\
-	bus_space_read_2((sc)->sk_btag, (sc)->sk_bhandle, (reg))
-#define CSR_READ_1(sc, reg)		\
-	bus_space_read_1((sc)->sk_btag, (sc)->sk_bhandle, (reg))
-
-struct sk_type {
-	u_int16_t		sk_vid;
-	u_int16_t		sk_did;
-	char			*sk_name;
-};
-
-/* RX queue descriptor data structure */
-struct sk_rx_desc {
-	u_int32_t		sk_ctl;
-	u_int32_t		sk_next;
-	u_int32_t		sk_data_lo;
-	u_int32_t		sk_data_hi;
-	u_int32_t		sk_xmac_rxstat;
-	u_int32_t		sk_timestamp;
-	u_int16_t		sk_csum2;
-	u_int16_t		sk_csum1;
-	u_int16_t		sk_csum2_start;
-	u_int16_t		sk_csum1_start;
-};
-
-#define SK_OPCODE_DEFAULT	0x00550000
-#define SK_OPCODE_CSUM		0x00560000
-
-#define SK_RXCTL_LEN		0x0000FFFF
-#define SK_RXCTL_OPCODE		0x00FF0000
-#define SK_RXCTL_TSTAMP_VALID	0x01000000
-#define SK_RXCTL_STATUS_VALID	0x02000000
-#define SK_RXCTL_DEV0		0x04000000
-#define SK_RXCTL_EOF_INTR	0x08000000
-#define SK_RXCTL_EOB_INTR	0x10000000
-#define SK_RXCTL_LASTFRAG	0x20000000
-#define SK_RXCTL_FIRSTFRAG	0x40000000
-#define SK_RXCTL_OWN		0x80000000
-
-#define SK_RXSTAT	\
-	(SK_OPCODE_DEFAULT|SK_RXCTL_EOF_INTR|SK_RXCTL_LASTFRAG| \
-	 SK_RXCTL_FIRSTFRAG|SK_RXCTL_OWN)
-
-struct sk_tx_desc {
-	u_int32_t		sk_ctl;
-	u_int32_t		sk_next;
-	u_int32_t		sk_data_lo;
-	u_int32_t		sk_data_hi;
-	u_int32_t		sk_xmac_txstat;
-	u_int16_t		sk_rsvd0;
-	u_int16_t		sk_csum_startval;
-	u_int16_t		sk_csum_startpos;
-	u_int16_t		sk_csum_writepos;
-	u_int32_t		sk_rsvd1;
-};
-
-#define SK_TXCTL_LEN		0x0000FFFF
-#define SK_TXCTL_OPCODE		0x00FF0000
-#define SK_TXCTL_SW		0x01000000
-#define SK_TXCTL_NOCRC		0x02000000
-#define SK_TXCTL_STORENFWD	0x04000000
-#define SK_TXCTL_EOF_INTR	0x08000000
-#define SK_TXCTL_EOB_INTR	0x10000000
-#define SK_TXCTL_LASTFRAG	0x20000000
-#define SK_TXCTL_FIRSTFRAG	0x40000000
-#define SK_TXCTL_OWN		0x80000000
-
-#define SK_TXSTAT	\
-	(SK_OPCODE_DEFAULT|SK_TXCTL_EOF_INTR|SK_TXCTL_LASTFRAG|SK_TXCTL_OWN)
-
-#define SK_RXBYTES(x)		(x) & 0x0000FFFF;
-#define SK_TXBYTES		SK_RXBYTES
-
-#define SK_TX_RING_CNT		512
-#define SK_RX_RING_CNT		256
-
-/*
- * Jumbo buffer stuff. Note that we must allocate more jumbo
- * buffers than there are descriptors in the receive ring. This
- * is because we don't know how long it will take for a packet
- * to be released after we hand it off to the upper protocol
- * layers. To be safe, we allocate 1.5 times the number of
- * receive descriptors.
- */
-#define SK_JUMBO_FRAMELEN	9018
-#define SK_JUMBO_MTU		(SK_JUMBO_FRAMELEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
-#define SK_JSLOTS		((SK_RX_RING_CNT * 3) / 2)
-
-#define SK_JRAWLEN (SK_JUMBO_FRAMELEN + ETHER_ALIGN)
-#define SK_JLEN (SK_JRAWLEN + (sizeof(u_int64_t) - \
-	(SK_JRAWLEN % sizeof(u_int64_t))))
-#define SK_JPAGESZ PAGE_SIZE
-#define SK_RESID (SK_JPAGESZ - (SK_JLEN * SK_JSLOTS) % SK_JPAGESZ)
-#define SK_JMEM ((SK_JLEN * SK_JSLOTS) + SK_RESID)
-
-struct sk_jpool_entry {
-	int                             slot;
-	SLIST_ENTRY(sk_jpool_entry)	jpool_entries;
-};
-
-struct sk_chain {
-	void			*sk_desc;
-	struct mbuf		*sk_mbuf;
-	struct sk_chain		*sk_next;
-};
-
-struct sk_chain_data {
-	struct sk_chain		sk_tx_chain[SK_TX_RING_CNT];
-	struct sk_chain		sk_rx_chain[SK_RX_RING_CNT];
-	int			sk_tx_prod;
-	int			sk_tx_cons;
-	int			sk_tx_cnt;
-	int			sk_rx_prod;
-	int			sk_rx_cons;
-	int			sk_rx_cnt;
-	/* Stick the jumbo mem management stuff here too. */
-	caddr_t			sk_jslots[SK_JSLOTS];
-	void			*sk_jumbo_buf;
-
-};
-
-struct sk_ring_data {
-	struct sk_tx_desc	sk_tx_ring[SK_TX_RING_CNT];
-	struct sk_rx_desc	sk_rx_ring[SK_RX_RING_CNT];
-};
-
-struct sk_bcom_hack {
-	int			reg;
-	int			val;
-};
-
-#define SK_INC(x, y)	(x) = (x + 1) % y
-
-/* Forward decl. */
-struct sk_if_softc;
-
-/* Softc for the GEnesis controller. */
-struct sk_softc {
-	bus_space_handle_t	sk_bhandle;	/* bus space handle */
-	bus_space_tag_t		sk_btag;	/* bus space tag */
-	void			*sk_intrhand;	/* irq handler handle */
-	struct resource		*sk_irq;	/* IRQ resource handle */
-	struct resource		*sk_res;	/* I/O or shared mem handle */
-	u_int8_t		sk_unit;	/* controller number */
-	u_int8_t		sk_type;
-	u_int8_t		sk_rev;
-	u_int8_t		spare;
-	char			*sk_vpd_prodname;
-	char			*sk_vpd_readonly;
-	uint16_t		sk_vpd_readonly_len;
-	u_int32_t		sk_rboff;	/* RAMbuffer offset */
-	u_int32_t		sk_ramsize;	/* amount of RAM on NIC */
-	u_int32_t		sk_pmd;		/* physical media type */
-	u_int32_t		sk_intrmask;
-	int			sk_int_mod;
-	struct sk_if_softc	*sk_if[2];
-	device_t		sk_devs[2];
-	struct mtx		sk_mtx;
-};
-
-#define	SK_LOCK(_sc)		mtx_lock(&(_sc)->sk_mtx)
-#define	SK_UNLOCK(_sc)		mtx_unlock(&(_sc)->sk_mtx)
-#define	SK_LOCK_ASSERT(_sc)	mtx_assert(&(_sc)->sk_mtx, MA_OWNED)
-#define	SK_IF_LOCK(_sc)		SK_LOCK((_sc)->sk_softc)
-#define	SK_IF_UNLOCK(_sc)	SK_UNLOCK((_sc)->sk_softc)
-#define	SK_IF_LOCK_ASSERT(_sc)	SK_LOCK_ASSERT((_sc)->sk_softc)
-
-/* Softc for each logical interface */
-struct sk_if_softc {
-	struct ifnet		*sk_ifp;	/* interface info */
-	device_t		sk_miibus;
-	u_int8_t		sk_unit;	/* interface number */
-	u_int8_t		sk_port;	/* port # on controller */
-	u_int8_t		sk_xmac_rev;	/* XMAC chip rev (B2 or C1) */
-	u_int32_t		sk_rx_ramstart;
-	u_int32_t		sk_rx_ramend;
-	u_int32_t		sk_tx_ramstart;
-	u_int32_t		sk_tx_ramend;
-	int			sk_phytype;
-	int			sk_phyaddr;
-	device_t		sk_dev;
-	int			sk_cnt;
-	int			sk_link;
-	struct callout_handle	sk_tick_ch;
-	struct sk_chain_data	sk_cdata;
-	struct sk_ring_data	*sk_rdata;
-	struct sk_softc		*sk_softc;	/* parent controller */
-	int			sk_tx_bmu;	/* TX BMU register */
-	int			sk_if_flags;
-	SLIST_HEAD(__sk_jfreehead, sk_jpool_entry)	sk_jfree_listhead;
-	SLIST_HEAD(__sk_jinusehead, sk_jpool_entry)	sk_jinuse_listhead;
-	struct mtx		sk_jlist_mtx;
-};
-
-#define	SK_JLIST_LOCK(_sc)	mtx_lock(&(_sc)->sk_jlist_mtx)
-#define	SK_JLIST_UNLOCK(_sc)	mtx_unlock(&(_sc)->sk_jlist_mtx)
-
-#define SK_MAXUNIT	256
-#define SK_TIMEOUT	1000
-#define ETHER_ALIGN	2
-
-#ifdef __alpha__
-#undef vtophys
-#define vtophys(va)		alpha_XXX_dmamap((vm_offset_t)va)
-#endif
Index: if_vrreg.h
===================================================================
RCS file: /home/cvs/src/sys/pci/if_vrreg.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/if_vrreg.h -L sys/pci/if_vrreg.h -u -r1.1.1.1 -r1.2
--- sys/pci/if_vrreg.h
+++ sys/pci/if_vrreg.h
@@ -29,7 +29,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/pci/if_vrreg.h,v 1.22.2.1 2005/11/08 16:05:56 jhb Exp $
+ * $FreeBSD: src/sys/pci/if_vrreg.h,v 1.34 2007/04/23 12:19:02 phk Exp $
  */
 
 /*
@@ -330,13 +330,14 @@
 struct vr_desc {
 	u_int32_t		vr_status;
 	u_int32_t		vr_ctl;
-	u_int32_t		vr_ptr1;
-	u_int32_t		vr_ptr2;
+	u_int32_t		vr_data;
+	u_int32_t		vr_nextphys;
+	struct mbuf		*vr_mbuf;
+	struct vr_desc		*vr_next;
+	u_int32_t		*vxr1;
+	u_int32_t		*vxr2;
 };
 
-#define vr_data		vr_ptr1
-#define vr_next		vr_ptr2
-
 
 #define VR_RXSTAT_RXERR		0x00000001
 #define VR_RXSTAT_CRCERR	0x00000002
@@ -364,6 +365,8 @@
 #define VR_RXCTL_BUFLEN_EXT	0x00007800
 #define VR_RXCTL_CHAIN		0x00008000
 #define VR_RXCTL_RX_INTR	0x00800000
+#define VR_RXCTL_GOODIP		0x00280000
+#define VR_RXCTL_GOODTCPUDP	0x00100000
 
 #define VR_RXCTL (VR_RXCTL_CHAIN|VR_RXCTL_RX_INTR)
 
@@ -383,52 +386,22 @@
 #define VR_TXCTL_BUFLEN		0x000007FF
 #define VR_TXCTL_BUFLEN_EXT	0x00007800
 #define VR_TXCTL_TLINK		0x00008000
+#define VR_TXCTL_NOCRC		0x00010000
+#define VR_TXCTL_INSERTTAG	0x00020000
+#define VR_TXCTL_IPCSUM		0x00040000
+#define VR_TXCTL_UDPCSUM	0x00080000
+#define VR_TXCTL_TCPCSUM	0x00100000
 #define VR_TXCTL_FIRSTFRAG	0x00200000
 #define VR_TXCTL_LASTFRAG	0x00400000
 #define VR_TXCTL_FINT		0x00800000
 
 
 #define VR_MAXFRAGS		16
-#define VR_RX_LIST_CNT		64
-#define VR_TX_LIST_CNT		128
+#define VR_RX_LIST_CNT		256
+#define VR_TX_LIST_CNT		256
 #define VR_MIN_FRAMELEN		60
 #define VR_FRAMELEN		1536
-#define VR_RXLEN		1520
-
-#define VR_TXOWN(x)		x->vr_ptr->vr_status
-
-struct vr_list_data {
-	struct vr_desc		vr_rx_list[VR_RX_LIST_CNT];
-	struct vr_desc		vr_tx_list[VR_TX_LIST_CNT];
-};
-
-struct vr_chain {
-	struct vr_desc		*vr_ptr;
-	struct mbuf		*vr_mbuf;
-	struct vr_chain		*vr_nextdesc;
-};
-
-struct vr_chain_onefrag {
-	struct vr_desc		*vr_ptr;
-	struct mbuf		*vr_mbuf;
-	struct vr_chain_onefrag	*vr_nextdesc;
-};
-
-struct vr_chain_data {
-	struct vr_chain_onefrag	vr_rx_chain[VR_RX_LIST_CNT];
-	struct vr_chain		vr_tx_chain[VR_TX_LIST_CNT];
-
-	struct vr_chain_onefrag	*vr_rx_head;
-
-	struct vr_chain		*vr_tx_cons;
-	struct vr_chain		*vr_tx_prod;
-};
-
-struct vr_type {
-	u_int16_t		vr_vid;
-	u_int16_t		vr_did;
-	char			*vr_name;
-};
+#define VR_RXLEN		1524
 
 struct vr_mii_frame {
 	u_int8_t		mii_stdelim;
@@ -451,50 +424,6 @@
 #define VR_FLAG_SCHEDDELAY	2
 #define VR_FLAG_DELAYTIMEO	3	
 
-struct vr_softc {
-	struct ifnet		*vr_ifp;	/* interface info */
-	bus_space_handle_t	vr_bhandle;	/* bus space handle */
-	bus_space_tag_t		vr_btag;	/* bus space tag */
-	struct resource		*vr_res;
-	struct resource		*vr_irq;
-	void			*vr_intrhand;
-	device_t		vr_miibus;
-	struct vr_type		*vr_info;	/* Rhine adapter info */
-	u_int8_t		vr_type;
-	u_int8_t		vr_revid;	/* Rhine chip revision */
-	u_int8_t                vr_flags;       /* See VR_F_* below */
-	struct vr_list_data	*vr_ldata;
-	struct vr_chain_data	vr_cdata;
-	struct callout		vr_stat_callout;
-	struct mtx		vr_mtx;
-	int			suspended;	/* if 1, sleeping/detaching */
-#ifdef DEVICE_POLLING
-	int			rxcycles;
-#endif
-};
-
-#define VR_F_RESTART		0x01		/* Restart unit on next tick */
-
-#define	VR_LOCK(_sc)		mtx_lock(&(_sc)->vr_mtx)
-#define	VR_UNLOCK(_sc)		mtx_unlock(&(_sc)->vr_mtx)
-#define	VR_LOCK_ASSERT(_sc)	mtx_assert(&(_sc)->vr_mtx, MA_OWNED)
-
-/*
- * register space access macros
- */
-#define CSR_WRITE_4(sc, reg, val)	\
-	bus_space_write_4(sc->vr_btag, sc->vr_bhandle, reg, val)
-#define CSR_WRITE_2(sc, reg, val)	\
-	bus_space_write_2(sc->vr_btag, sc->vr_bhandle, reg, val)
-#define CSR_WRITE_1(sc, reg, val)	\
-	bus_space_write_1(sc->vr_btag, sc->vr_bhandle, reg, val)
-
-#define CSR_READ_4(sc, reg)		\
-	bus_space_read_4(sc->vr_btag, sc->vr_bhandle, reg)
-#define CSR_READ_2(sc, reg)		\
-	bus_space_read_2(sc->vr_btag, sc->vr_bhandle, reg)
-#define CSR_READ_1(sc, reg)		\
-	bus_space_read_1(sc->vr_btag, sc->vr_bhandle, reg)
 
 #define VR_TIMEOUT		1000
 #define ETHER_ALIGN		2
@@ -589,9 +518,3 @@
 #define VR_PSTATE_D3		0x0003
 #define VR_PME_EN		0x0010
 #define VR_PME_STATUS		0x8000
-
-
-#ifdef __alpha__
-#undef vtophys
-#define vtophys(va)		alpha_XXX_dmamap((vm_offset_t)va)
-#endif
--- sys/pci/if_dc.c
+++ /dev/null
@@ -1,3862 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998, 1999
- *	Bill Paul <wpaul at ee.columbia.edu>.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/if_dc.c,v 1.160.2.7 2006/01/10 10:24:05 glebius Exp $");
-
-/*
- * DEC "tulip" clone ethernet driver. Supports the DEC/Intel 21143
- * series chips and several workalikes including the following:
- *
- * Macronix 98713/98715/98725/98727/98732 PMAC (www.macronix.com)
- * Macronix/Lite-On 82c115 PNIC II (www.macronix.com)
- * Lite-On 82c168/82c169 PNIC (www.litecom.com)
- * ASIX Electronics AX88140A (www.asix.com.tw)
- * ASIX Electronics AX88141 (www.asix.com.tw)
- * ADMtek AL981 (www.admtek.com.tw)
- * ADMtek AN985 (www.admtek.com.tw)
- * Netgear FA511 (www.netgear.com) Appears to be rebadged ADMTek AN985
- * Davicom DM9100, DM9102, DM9102A (www.davicom8.com)
- * Accton EN1217 (www.accton.com)
- * Xircom X3201 (www.xircom.com)
- * Abocom FE2500
- * Conexant LANfinity (www.conexant.com)
- * 3Com OfficeConnect 10/100B 3CSOHO100B (www.3com.com)
- *
- * Datasheets for the 21143 are available at developer.intel.com.
- * Datasheets for the clone parts can be found at their respective sites.
- * (Except for the PNIC; see www.freebsd.org/~wpaul/PNIC/pnic.ps.gz.)
- * The PNIC II is essentially a Macronix 98715A chip; the only difference
- * worth noting is that its multicast hash table is only 128 bits wide
- * instead of 512.
- *
- * Written by Bill Paul <wpaul at ee.columbia.edu>
- * Electrical Engineering Department
- * Columbia University, New York City
- */
-/*
- * The Intel 21143 is the successor to the DEC 21140. It is basically
- * the same as the 21140 but with a few new features. The 21143 supports
- * three kinds of media attachments:
- *
- * o MII port, for 10Mbps and 100Mbps support and NWAY
- *   autonegotiation provided by an external PHY.
- * o SYM port, for symbol mode 100Mbps support.
- * o 10baseT port.
- * o AUI/BNC port.
- *
- * The 100Mbps SYM port and 10baseT port can be used together in
- * combination with the internal NWAY support to create a 10/100
- * autosensing configuration.
- *
- * Note that not all tulip workalikes are handled in this driver: we only
- * deal with those which are relatively well behaved. The Winbond is
- * handled separately due to its different register offsets and the
- * special handling needed for its various bugs. The PNIC is handled
- * here, but I'm not thrilled about it.
- *
- * All of the workalike chips use some form of MII transceiver support
- * with the exception of the Macronix chips, which also have a SYM port.
- * The ASIX AX88140A is also documented to have a SYM port, but all
- * the cards I've seen use an MII transceiver, probably because the
- * AX88140A doesn't support internal NWAY.
- */
-
-#ifdef HAVE_KERNEL_OPTION_HEADERS
-#include "opt_device_polling.h"
-#endif
-
-#include <sys/param.h>
-#include <sys/endian.h>
-#include <sys/systm.h>
-#include <sys/sockio.h>
-#include <sys/mbuf.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-#include <sys/socket.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/if_arp.h>
-#include <net/ethernet.h>
-#include <net/if_dl.h>
-#include <net/if_media.h>
-#include <net/if_types.h>
-#include <net/if_vlan_var.h>
-
-#include <net/bpf.h>
-
-#include <machine/bus.h>
-#include <machine/resource.h>
-#include <sys/bus.h>
-#include <sys/rman.h>
-
-#include <dev/mii/mii.h>
-#include <dev/mii/miivar.h>
-
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcivar.h>
-
-#define DC_USEIOSPACE
-#ifdef __alpha__
-#define SRM_MEDIA
-#endif
-
-#include <pci/if_dcreg.h>
-
-#ifdef __sparc64__
-#include <dev/ofw/openfirm.h>
-#include <machine/ofw_machdep.h>
-#endif
-
-MODULE_DEPEND(dc, pci, 1, 1, 1);
-MODULE_DEPEND(dc, ether, 1, 1, 1);
-MODULE_DEPEND(dc, miibus, 1, 1, 1);
-
-/* "controller miibus0" required.  See GENERIC if you get errors here. */
-#include "miibus_if.h"
-
-/*
- * Various supported device vendors/types and their names.
- */
-static struct dc_type dc_devs[] = {
-	{ DC_VENDORID_DEC, DC_DEVICEID_21143,
-		"Intel 21143 10/100BaseTX" },
-	{ DC_VENDORID_DAVICOM, DC_DEVICEID_DM9009,
-		"Davicom DM9009 10/100BaseTX" },
-	{ DC_VENDORID_DAVICOM, DC_DEVICEID_DM9100,
-		"Davicom DM9100 10/100BaseTX" },
-	{ DC_VENDORID_DAVICOM, DC_DEVICEID_DM9102,
-		"Davicom DM9102 10/100BaseTX" },
-	{ DC_VENDORID_DAVICOM, DC_DEVICEID_DM9102,
-		"Davicom DM9102A 10/100BaseTX" },
-	{ DC_VENDORID_ADMTEK, DC_DEVICEID_AL981,
-		"ADMtek AL981 10/100BaseTX" },
-	{ DC_VENDORID_ADMTEK, DC_DEVICEID_AN985,
-		"ADMtek AN985 10/100BaseTX" },
-	{ DC_VENDORID_ADMTEK, DC_DEVICEID_ADM9511,
-		"ADMtek ADM9511 10/100BaseTX" },
-	{ DC_VENDORID_ADMTEK, DC_DEVICEID_ADM9513,
-		"ADMtek ADM9513 10/100BaseTX" },
-	{ DC_VENDORID_ADMTEK, DC_DEVICEID_FA511,
-		"Netgear FA511 10/100BaseTX" },
-	{ DC_VENDORID_ASIX, DC_DEVICEID_AX88140A,
-		"ASIX AX88140A 10/100BaseTX" },
-	{ DC_VENDORID_ASIX, DC_DEVICEID_AX88140A,
-		"ASIX AX88141 10/100BaseTX" },
-	{ DC_VENDORID_MX, DC_DEVICEID_98713,
-		"Macronix 98713 10/100BaseTX" },
-	{ DC_VENDORID_MX, DC_DEVICEID_98713,
-		"Macronix 98713A 10/100BaseTX" },
-	{ DC_VENDORID_CP, DC_DEVICEID_98713_CP,
-		"Compex RL100-TX 10/100BaseTX" },
-	{ DC_VENDORID_CP, DC_DEVICEID_98713_CP,
-		"Compex RL100-TX 10/100BaseTX" },
-	{ DC_VENDORID_MX, DC_DEVICEID_987x5,
-		"Macronix 98715/98715A 10/100BaseTX" },
-	{ DC_VENDORID_MX, DC_DEVICEID_987x5,
-		"Macronix 98715AEC-C 10/100BaseTX" },
-	{ DC_VENDORID_MX, DC_DEVICEID_987x5,
-		"Macronix 98725 10/100BaseTX" },
-	{ DC_VENDORID_MX, DC_DEVICEID_98727,
-		"Macronix 98727/98732 10/100BaseTX" },
-	{ DC_VENDORID_LO, DC_DEVICEID_82C115,
-		"LC82C115 PNIC II 10/100BaseTX" },
-	{ DC_VENDORID_LO, DC_DEVICEID_82C168,
-		"82c168 PNIC 10/100BaseTX" },
-	{ DC_VENDORID_LO, DC_DEVICEID_82C168,
-		"82c169 PNIC 10/100BaseTX" },
-	{ DC_VENDORID_ACCTON, DC_DEVICEID_EN1217,
-		"Accton EN1217 10/100BaseTX" },
-	{ DC_VENDORID_ACCTON, DC_DEVICEID_EN2242,
-		"Accton EN2242 MiniPCI 10/100BaseTX" },
-	{ DC_VENDORID_XIRCOM, DC_DEVICEID_X3201,
-	  	"Xircom X3201 10/100BaseTX" },
-	{ DC_VENDORID_DLINK, DC_DEVICEID_DRP32TXD,
- 	                 "Neteasy DRP-32TXD Cardbus 10/100" },
-	{ DC_VENDORID_ABOCOM, DC_DEVICEID_FE2500,
-		"Abocom FE2500 10/100BaseTX" },
-	{ DC_VENDORID_ABOCOM, DC_DEVICEID_FE2500MX,
-		"Abocom FE2500MX 10/100BaseTX" },
-	{ DC_VENDORID_CONEXANT, DC_DEVICEID_RS7112,
-		"Conexant LANfinity MiniPCI 10/100BaseTX" },
-	{ DC_VENDORID_HAWKING, DC_DEVICEID_HAWKING_PN672TX,
-		"Hawking CB102 CardBus 10/100" },
-	{ DC_VENDORID_PLANEX, DC_DEVICEID_FNW3602T,
-		"PlaneX FNW-3602-T CardBus 10/100" },
-	{ DC_VENDORID_3COM, DC_DEVICEID_3CSOHOB,
-		"3Com OfficeConnect 10/100B" },
-	{ DC_VENDORID_MICROSOFT, DC_DEVICEID_MSMN120,
-		"Microsoft MN-120 CardBus 10/100" },
-	{ DC_VENDORID_MICROSOFT, DC_DEVICEID_MSMN130,
-		"Microsoft MN-130 10/100" },
-	{ DC_VENDORID_MICROSOFT, DC_DEVICEID_MSMN130_FAKE,
-		"Microsoft MN-130 10/100" },
-	{ 0, 0, NULL }
-};
-
-static int dc_probe(device_t);
-static int dc_attach(device_t);
-static int dc_detach(device_t);
-static int dc_suspend(device_t);
-static int dc_resume(device_t);
-static struct dc_type *dc_devtype(device_t);
-static int dc_newbuf(struct dc_softc *, int, int);
-static int dc_encap(struct dc_softc *, struct mbuf **);
-static void dc_pnic_rx_bug_war(struct dc_softc *, int);
-static int dc_rx_resync(struct dc_softc *);
-static void dc_rxeof(struct dc_softc *);
-static void dc_txeof(struct dc_softc *);
-static void dc_tick(void *);
-static void dc_tx_underrun(struct dc_softc *);
-static void dc_intr(void *);
-static void dc_start(struct ifnet *);
-static void dc_start_locked(struct ifnet *);
-static int dc_ioctl(struct ifnet *, u_long, caddr_t);
-static void dc_init(void *);
-static void dc_init_locked(struct dc_softc *);
-static void dc_stop(struct dc_softc *);
-static void dc_watchdog(struct ifnet *);
-static void dc_shutdown(device_t);
-static int dc_ifmedia_upd(struct ifnet *);
-static void dc_ifmedia_sts(struct ifnet *, struct ifmediareq *);
-
-static void dc_delay(struct dc_softc *);
-static void dc_eeprom_idle(struct dc_softc *);
-static void dc_eeprom_putbyte(struct dc_softc *, int);
-static void dc_eeprom_getword(struct dc_softc *, int, u_int16_t *);
-static void dc_eeprom_getword_pnic(struct dc_softc *, int, u_int16_t *);
-static void dc_eeprom_getword_xircom(struct dc_softc *, int, u_int16_t *);
-static void dc_eeprom_width(struct dc_softc *);
-static void dc_read_eeprom(struct dc_softc *, caddr_t, int, int, int);
-
-static void dc_mii_writebit(struct dc_softc *, int);
-static int dc_mii_readbit(struct dc_softc *);
-static void dc_mii_sync(struct dc_softc *);
-static void dc_mii_send(struct dc_softc *, u_int32_t, int);
-static int dc_mii_readreg(struct dc_softc *, struct dc_mii_frame *);
-static int dc_mii_writereg(struct dc_softc *, struct dc_mii_frame *);
-static int dc_miibus_readreg(device_t, int, int);
-static int dc_miibus_writereg(device_t, int, int, int);
-static void dc_miibus_statchg(device_t);
-static void dc_miibus_mediainit(device_t);
-
-static void dc_setcfg(struct dc_softc *, int);
-static uint32_t dc_mchash_le(struct dc_softc *, const uint8_t *);
-static uint32_t dc_mchash_be(const uint8_t *);
-static void dc_setfilt_21143(struct dc_softc *);
-static void dc_setfilt_asix(struct dc_softc *);
-static void dc_setfilt_admtek(struct dc_softc *);
-static void dc_setfilt_xircom(struct dc_softc *);
-
-static void dc_setfilt(struct dc_softc *);
-
-static void dc_reset(struct dc_softc *);
-static int dc_list_rx_init(struct dc_softc *);
-static int dc_list_tx_init(struct dc_softc *);
-
-static void dc_read_srom(struct dc_softc *, int);
-static void dc_parse_21143_srom(struct dc_softc *);
-static void dc_decode_leaf_sia(struct dc_softc *, struct dc_eblock_sia *);
-static void dc_decode_leaf_mii(struct dc_softc *, struct dc_eblock_mii *);
-static void dc_decode_leaf_sym(struct dc_softc *, struct dc_eblock_sym *);
-static void dc_apply_fixup(struct dc_softc *, int);
-
-static void dc_dma_map_txbuf(void *, bus_dma_segment_t *, int, bus_size_t, int);
-static void dc_dma_map_rxbuf(void *, bus_dma_segment_t *, int, bus_size_t, int);
-
-#ifdef DC_USEIOSPACE
-#define DC_RES			SYS_RES_IOPORT
-#define DC_RID			DC_PCI_CFBIO
-#else
-#define DC_RES			SYS_RES_MEMORY
-#define DC_RID			DC_PCI_CFBMA
-#endif
-
-static device_method_t dc_methods[] = {
-	/* Device interface */
-	DEVMETHOD(device_probe,		dc_probe),
-	DEVMETHOD(device_attach,	dc_attach),
-	DEVMETHOD(device_detach,	dc_detach),
-	DEVMETHOD(device_suspend,	dc_suspend),
-	DEVMETHOD(device_resume,	dc_resume),
-	DEVMETHOD(device_shutdown,	dc_shutdown),
-
-	/* bus interface */
-	DEVMETHOD(bus_print_child,	bus_generic_print_child),
-	DEVMETHOD(bus_driver_added,	bus_generic_driver_added),
-
-	/* MII interface */
-	DEVMETHOD(miibus_readreg,	dc_miibus_readreg),
-	DEVMETHOD(miibus_writereg,	dc_miibus_writereg),
-	DEVMETHOD(miibus_statchg,	dc_miibus_statchg),
-	DEVMETHOD(miibus_mediainit,	dc_miibus_mediainit),
-
-	{ 0, 0 }
-};
-
-static driver_t dc_driver = {
-	"dc",
-	dc_methods,
-	sizeof(struct dc_softc)
-};
-
-static devclass_t dc_devclass;
-#ifdef __i386__
-static int dc_quick = 1;
-SYSCTL_INT(_hw, OID_AUTO, dc_quick, CTLFLAG_RW, &dc_quick, 0,
-    "do not m_devget() in dc driver");
-#endif
-
-DRIVER_MODULE(dc, cardbus, dc_driver, dc_devclass, 0, 0);
-DRIVER_MODULE(dc, pci, dc_driver, dc_devclass, 0, 0);
-DRIVER_MODULE(miibus, dc, miibus_driver, miibus_devclass, 0, 0);
-
-#define DC_SETBIT(sc, reg, x)				\
-	CSR_WRITE_4(sc, reg, CSR_READ_4(sc, reg) | (x))
-
-#define DC_CLRBIT(sc, reg, x)				\
-	CSR_WRITE_4(sc, reg, CSR_READ_4(sc, reg) & ~(x))
-
-#define SIO_SET(x)	DC_SETBIT(sc, DC_SIO, (x))
-#define SIO_CLR(x)	DC_CLRBIT(sc, DC_SIO, (x))
-
-static void
-dc_delay(struct dc_softc *sc)
-{
-	int idx;
-
-	for (idx = (300 / 33) + 1; idx > 0; idx--)
-		CSR_READ_4(sc, DC_BUSCTL);
-}
-
-static void
-dc_eeprom_width(struct dc_softc *sc)
-{
-	int i;
-
-	/* Force EEPROM to idle state. */
-	dc_eeprom_idle(sc);
-
-	/* Enter EEPROM access mode. */
-	CSR_WRITE_4(sc, DC_SIO, DC_SIO_EESEL);
-	dc_delay(sc);
-	DC_SETBIT(sc, DC_SIO, DC_SIO_ROMCTL_READ);
-	dc_delay(sc);
-	DC_CLRBIT(sc, DC_SIO, DC_SIO_EE_CLK);
-	dc_delay(sc);
-	DC_SETBIT(sc, DC_SIO, DC_SIO_EE_CS);
-	dc_delay(sc);
-
-	for (i = 3; i--;) {
-		if (6 & (1 << i))
-			DC_SETBIT(sc, DC_SIO, DC_SIO_EE_DATAIN);
-		else
-			DC_CLRBIT(sc, DC_SIO, DC_SIO_EE_DATAIN);
-		dc_delay(sc);
-		DC_SETBIT(sc, DC_SIO, DC_SIO_EE_CLK);
-		dc_delay(sc);
-		DC_CLRBIT(sc, DC_SIO, DC_SIO_EE_CLK);
-		dc_delay(sc);
-	}
-
-	for (i = 1; i <= 12; i++) {
-		DC_SETBIT(sc, DC_SIO, DC_SIO_EE_CLK);
-		dc_delay(sc);
-		if (!(CSR_READ_4(sc, DC_SIO) & DC_SIO_EE_DATAOUT)) {
-			DC_CLRBIT(sc, DC_SIO, DC_SIO_EE_CLK);
-			dc_delay(sc);
-			break;
-		}
-		DC_CLRBIT(sc, DC_SIO, DC_SIO_EE_CLK);
-		dc_delay(sc);
-	}
-
-	/* Turn off EEPROM access mode. */
-	dc_eeprom_idle(sc);
-
-	if (i < 4 || i > 12)
-		sc->dc_romwidth = 6;
-	else
-		sc->dc_romwidth = i;
-
-	/* Enter EEPROM access mode. */
-	CSR_WRITE_4(sc, DC_SIO, DC_SIO_EESEL);
-	dc_delay(sc);
-	DC_SETBIT(sc, DC_SIO, DC_SIO_ROMCTL_READ);
-	dc_delay(sc);
-	DC_CLRBIT(sc, DC_SIO, DC_SIO_EE_CLK);
-	dc_delay(sc);
-	DC_SETBIT(sc, DC_SIO, DC_SIO_EE_CS);
-	dc_delay(sc);
-
-	/* Turn off EEPROM access mode. */
-	dc_eeprom_idle(sc);
-}
-
-static void
-dc_eeprom_idle(struct dc_softc *sc)
-{
-	int i;
-
-	CSR_WRITE_4(sc, DC_SIO, DC_SIO_EESEL);
-	dc_delay(sc);
-	DC_SETBIT(sc, DC_SIO, DC_SIO_ROMCTL_READ);
-	dc_delay(sc);
-	DC_CLRBIT(sc, DC_SIO, DC_SIO_EE_CLK);
-	dc_delay(sc);
-	DC_SETBIT(sc, DC_SIO, DC_SIO_EE_CS);
-	dc_delay(sc);
-
-	for (i = 0; i < 25; i++) {
-		DC_CLRBIT(sc, DC_SIO, DC_SIO_EE_CLK);
-		dc_delay(sc);
-		DC_SETBIT(sc, DC_SIO, DC_SIO_EE_CLK);
-		dc_delay(sc);
-	}
-
-	DC_CLRBIT(sc, DC_SIO, DC_SIO_EE_CLK);
-	dc_delay(sc);
-	DC_CLRBIT(sc, DC_SIO, DC_SIO_EE_CS);
-	dc_delay(sc);
-	CSR_WRITE_4(sc, DC_SIO, 0x00000000);
-}
-
-/*
- * Send a read command and address to the EEPROM, check for ACK.
- */
-static void
-dc_eeprom_putbyte(struct dc_softc *sc, int addr)
-{
-	int d, i;
-
-	d = DC_EECMD_READ >> 6;
-	for (i = 3; i--; ) {
-		if (d & (1 << i))
-			DC_SETBIT(sc, DC_SIO, DC_SIO_EE_DATAIN);
-		else
-			DC_CLRBIT(sc, DC_SIO, DC_SIO_EE_DATAIN);
-		dc_delay(sc);
-		DC_SETBIT(sc, DC_SIO, DC_SIO_EE_CLK);
-		dc_delay(sc);
-		DC_CLRBIT(sc, DC_SIO, DC_SIO_EE_CLK);
-		dc_delay(sc);
-	}
-
-	/*
-	 * Feed in each bit and strobe the clock.
-	 */
-	for (i = sc->dc_romwidth; i--;) {
-		if (addr & (1 << i)) {
-			SIO_SET(DC_SIO_EE_DATAIN);
-		} else {
-			SIO_CLR(DC_SIO_EE_DATAIN);
-		}
-		dc_delay(sc);
-		SIO_SET(DC_SIO_EE_CLK);
-		dc_delay(sc);
-		SIO_CLR(DC_SIO_EE_CLK);
-		dc_delay(sc);
-	}
-}
-
-/*
- * Read a word of data stored in the EEPROM at address 'addr.'
- * The PNIC 82c168/82c169 has its own non-standard way to read
- * the EEPROM.
- */
-static void
-dc_eeprom_getword_pnic(struct dc_softc *sc, int addr, u_int16_t *dest)
-{
-	int i;
-	u_int32_t r;
-
-	CSR_WRITE_4(sc, DC_PN_SIOCTL, DC_PN_EEOPCODE_READ | addr);
-
-	for (i = 0; i < DC_TIMEOUT; i++) {
-		DELAY(1);
-		r = CSR_READ_4(sc, DC_SIO);
-		if (!(r & DC_PN_SIOCTL_BUSY)) {
-			*dest = (u_int16_t)(r & 0xFFFF);
-			return;
-		}
-	}
-}
-
-/*
- * Read a word of data stored in the EEPROM at address 'addr.'
- * The Xircom X3201 has its own non-standard way to read
- * the EEPROM, too.
- */
-static void
-dc_eeprom_getword_xircom(struct dc_softc *sc, int addr, u_int16_t *dest)
-{
-
-	SIO_SET(DC_SIO_ROMSEL | DC_SIO_ROMCTL_READ);
-
-	addr *= 2;
-	CSR_WRITE_4(sc, DC_ROM, addr | 0x160);
-	*dest = (u_int16_t)CSR_READ_4(sc, DC_SIO) & 0xff;
-	addr += 1;
-	CSR_WRITE_4(sc, DC_ROM, addr | 0x160);
-	*dest |= ((u_int16_t)CSR_READ_4(sc, DC_SIO) & 0xff) << 8;
-
-	SIO_CLR(DC_SIO_ROMSEL | DC_SIO_ROMCTL_READ);
-}
-
-/*
- * Read a word of data stored in the EEPROM at address 'addr.'
- */
-static void
-dc_eeprom_getword(struct dc_softc *sc, int addr, u_int16_t *dest)
-{
-	int i;
-	u_int16_t word = 0;
-
-	/* Force EEPROM to idle state. */
-	dc_eeprom_idle(sc);
-
-	/* Enter EEPROM access mode. */
-	CSR_WRITE_4(sc, DC_SIO, DC_SIO_EESEL);
-	dc_delay(sc);
-	DC_SETBIT(sc, DC_SIO,  DC_SIO_ROMCTL_READ);
-	dc_delay(sc);
-	DC_CLRBIT(sc, DC_SIO, DC_SIO_EE_CLK);
-	dc_delay(sc);
-	DC_SETBIT(sc, DC_SIO, DC_SIO_EE_CS);
-	dc_delay(sc);
-
-	/*
-	 * Send address of word we want to read.
-	 */
-	dc_eeprom_putbyte(sc, addr);
-
-	/*
-	 * Start reading bits from EEPROM.
-	 */
-	for (i = 0x8000; i; i >>= 1) {
-		SIO_SET(DC_SIO_EE_CLK);
-		dc_delay(sc);
-		if (CSR_READ_4(sc, DC_SIO) & DC_SIO_EE_DATAOUT)
-			word |= i;
-		dc_delay(sc);
-		SIO_CLR(DC_SIO_EE_CLK);
-		dc_delay(sc);
-	}
-
-	/* Turn off EEPROM access mode. */
-	dc_eeprom_idle(sc);
-
-	*dest = word;
-}
-
-/*
- * Read a sequence of words from the EEPROM.
- */
-static void
-dc_read_eeprom(struct dc_softc *sc, caddr_t dest, int off, int cnt, int be)
-{
-	int i;
-	u_int16_t word = 0, *ptr;
-
-	for (i = 0; i < cnt; i++) {
-		if (DC_IS_PNIC(sc))
-			dc_eeprom_getword_pnic(sc, off + i, &word);
-		else if (DC_IS_XIRCOM(sc))
-			dc_eeprom_getword_xircom(sc, off + i, &word);
-		else
-			dc_eeprom_getword(sc, off + i, &word);
-		ptr = (u_int16_t *)(dest + (i * 2));
-		if (be)
-			*ptr = be16toh(word);
-		else
-			*ptr = le16toh(word);
-	}
-}
-
-/*
- * The following two routines are taken from the Macronix 98713
- * Application Notes pp.19-21.
- */
-/*
- * Write a bit to the MII bus.
- */
-static void
-dc_mii_writebit(struct dc_softc *sc, int bit)
-{
-
-	if (bit)
-		CSR_WRITE_4(sc, DC_SIO,
-		    DC_SIO_ROMCTL_WRITE | DC_SIO_MII_DATAOUT);
-	else
-		CSR_WRITE_4(sc, DC_SIO, DC_SIO_ROMCTL_WRITE);
-
-	DC_SETBIT(sc, DC_SIO, DC_SIO_MII_CLK);
-	DC_CLRBIT(sc, DC_SIO, DC_SIO_MII_CLK);
-}
-
-/*
- * Read a bit from the MII bus.
- */
-static int
-dc_mii_readbit(struct dc_softc *sc)
-{
-
-	CSR_WRITE_4(sc, DC_SIO, DC_SIO_ROMCTL_READ | DC_SIO_MII_DIR);
-	CSR_READ_4(sc, DC_SIO);
-	DC_SETBIT(sc, DC_SIO, DC_SIO_MII_CLK);
-	DC_CLRBIT(sc, DC_SIO, DC_SIO_MII_CLK);
-	if (CSR_READ_4(sc, DC_SIO) & DC_SIO_MII_DATAIN)
-		return (1);
-
-	return (0);
-}
-
-/*
- * Sync the PHYs by setting data bit and strobing the clock 32 times.
- */
-static void
-dc_mii_sync(struct dc_softc *sc)
-{
-	int i;
-
-	CSR_WRITE_4(sc, DC_SIO, DC_SIO_ROMCTL_WRITE);
-
-	for (i = 0; i < 32; i++)
-		dc_mii_writebit(sc, 1);
-}
-
-/*
- * Clock a series of bits through the MII.
- */
-static void
-dc_mii_send(struct dc_softc *sc, u_int32_t bits, int cnt)
-{
-	int i;
-
-	for (i = (0x1 << (cnt - 1)); i; i >>= 1)
-		dc_mii_writebit(sc, bits & i);
-}
-
-/*
- * Read an PHY register through the MII.
- */
-static int
-dc_mii_readreg(struct dc_softc *sc, struct dc_mii_frame *frame)
-{
-	int i, ack;
-
-	/*
-	 * Set up frame for RX.
-	 */
-	frame->mii_stdelim = DC_MII_STARTDELIM;
-	frame->mii_opcode = DC_MII_READOP;
-	frame->mii_turnaround = 0;
-	frame->mii_data = 0;
-
-	/*
-	 * Sync the PHYs.
-	 */
-	dc_mii_sync(sc);
-
-	/*
-	 * Send command/address info.
-	 */
-	dc_mii_send(sc, frame->mii_stdelim, 2);
-	dc_mii_send(sc, frame->mii_opcode, 2);
-	dc_mii_send(sc, frame->mii_phyaddr, 5);
-	dc_mii_send(sc, frame->mii_regaddr, 5);
-
-#ifdef notdef
-	/* Idle bit */
-	dc_mii_writebit(sc, 1);
-	dc_mii_writebit(sc, 0);
-#endif
-
-	/* Check for ack. */
-	ack = dc_mii_readbit(sc);
-
-	/*
-	 * Now try reading data bits. If the ack failed, we still
-	 * need to clock through 16 cycles to keep the PHY(s) in sync.
-	 */
-	if (ack) {
-		for (i = 0; i < 16; i++)
-			dc_mii_readbit(sc);
-		goto fail;
-	}
-
-	for (i = 0x8000; i; i >>= 1) {
-		if (!ack) {
-			if (dc_mii_readbit(sc))
-				frame->mii_data |= i;
-		}
-	}
-
-fail:
-
-	dc_mii_writebit(sc, 0);
-	dc_mii_writebit(sc, 0);
-
-	if (ack)
-		return (1);
-	return (0);
-}
-
-/*
- * Write to a PHY register through the MII.
- */
-static int
-dc_mii_writereg(struct dc_softc *sc, struct dc_mii_frame *frame)
-{
-
-	/*
-	 * Set up frame for TX.
-	 */
-
-	frame->mii_stdelim = DC_MII_STARTDELIM;
-	frame->mii_opcode = DC_MII_WRITEOP;
-	frame->mii_turnaround = DC_MII_TURNAROUND;
-
-	/*
-	 * Sync the PHYs.
-	 */
-	dc_mii_sync(sc);
-
-	dc_mii_send(sc, frame->mii_stdelim, 2);
-	dc_mii_send(sc, frame->mii_opcode, 2);
-	dc_mii_send(sc, frame->mii_phyaddr, 5);
-	dc_mii_send(sc, frame->mii_regaddr, 5);
-	dc_mii_send(sc, frame->mii_turnaround, 2);
-	dc_mii_send(sc, frame->mii_data, 16);
-
-	/* Idle bit. */
-	dc_mii_writebit(sc, 0);
-	dc_mii_writebit(sc, 0);
-
-	return (0);
-}
-
-static int
-dc_miibus_readreg(device_t dev, int phy, int reg)
-{
-	struct dc_mii_frame frame;
-	struct dc_softc	 *sc;
-	int i, rval, phy_reg = 0;
-
-	sc = device_get_softc(dev);
-	bzero(&frame, sizeof(frame));
-
-	/*
-	 * Note: both the AL981 and AN985 have internal PHYs,
-	 * however the AL981 provides direct access to the PHY
-	 * registers while the AN985 uses a serial MII interface.
-	 * The AN985's MII interface is also buggy in that you
-	 * can read from any MII address (0 to 31), but only address 1
-	 * behaves normally. To deal with both cases, we pretend
-	 * that the PHY is at MII address 1.
-	 */
-	if (DC_IS_ADMTEK(sc) && phy != DC_ADMTEK_PHYADDR)
-		return (0);
-
-	/*
-	 * Note: the ukphy probes of the RS7112 report a PHY at
-	 * MII address 0 (possibly HomePNA?) and 1 (ethernet)
-	 * so we only respond to correct one.
-	 */
-	if (DC_IS_CONEXANT(sc) && phy != DC_CONEXANT_PHYADDR)
-		return (0);
-
-	if (sc->dc_pmode != DC_PMODE_MII) {
-		if (phy == (MII_NPHY - 1)) {
-			switch (reg) {
-			case MII_BMSR:
-			/*
-			 * Fake something to make the probe
-			 * code think there's a PHY here.
-			 */
-				return (BMSR_MEDIAMASK);
-				break;
-			case MII_PHYIDR1:
-				if (DC_IS_PNIC(sc))
-					return (DC_VENDORID_LO);
-				return (DC_VENDORID_DEC);
-				break;
-			case MII_PHYIDR2:
-				if (DC_IS_PNIC(sc))
-					return (DC_DEVICEID_82C168);
-				return (DC_DEVICEID_21143);
-				break;
-			default:
-				return (0);
-				break;
-			}
-		} else
-			return (0);
-	}
-
-	if (DC_IS_PNIC(sc)) {
-		CSR_WRITE_4(sc, DC_PN_MII, DC_PN_MIIOPCODE_READ |
-		    (phy << 23) | (reg << 18));
-		for (i = 0; i < DC_TIMEOUT; i++) {
-			DELAY(1);
-			rval = CSR_READ_4(sc, DC_PN_MII);
-			if (!(rval & DC_PN_MII_BUSY)) {
-				rval &= 0xFFFF;
-				return (rval == 0xFFFF ? 0 : rval);
-			}
-		}
-		return (0);
-	}
-
-	if (DC_IS_COMET(sc)) {
-		switch (reg) {
-		case MII_BMCR:
-			phy_reg = DC_AL_BMCR;
-			break;
-		case MII_BMSR:
-			phy_reg = DC_AL_BMSR;
-			break;
-		case MII_PHYIDR1:
-			phy_reg = DC_AL_VENID;
-			break;
-		case MII_PHYIDR2:
-			phy_reg = DC_AL_DEVID;
-			break;
-		case MII_ANAR:
-			phy_reg = DC_AL_ANAR;
-			break;
-		case MII_ANLPAR:
-			phy_reg = DC_AL_LPAR;
-			break;
-		case MII_ANER:
-			phy_reg = DC_AL_ANER;
-			break;
-		default:
-			device_printf(dev, "phy_read: bad phy register %x\n",
-			    reg);
-			return (0);
-			break;
-		}
-
-		rval = CSR_READ_4(sc, phy_reg) & 0x0000FFFF;
-
-		if (rval == 0xFFFF)
-			return (0);
-		return (rval);
-	}
-
-	frame.mii_phyaddr = phy;
-	frame.mii_regaddr = reg;
-	if (sc->dc_type == DC_TYPE_98713) {
-		phy_reg = CSR_READ_4(sc, DC_NETCFG);
-		CSR_WRITE_4(sc, DC_NETCFG, phy_reg & ~DC_NETCFG_PORTSEL);
-	}
-	dc_mii_readreg(sc, &frame);
-	if (sc->dc_type == DC_TYPE_98713)
-		CSR_WRITE_4(sc, DC_NETCFG, phy_reg);
-
-	return (frame.mii_data);
-}
-
-static int
-dc_miibus_writereg(device_t dev, int phy, int reg, int data)
-{
-	struct dc_softc *sc;
-	struct dc_mii_frame frame;
-	int i, phy_reg = 0;
-
-	sc = device_get_softc(dev);
-	bzero(&frame, sizeof(frame));
-
-	if (DC_IS_ADMTEK(sc) && phy != DC_ADMTEK_PHYADDR)
-		return (0);
-
-	if (DC_IS_CONEXANT(sc) && phy != DC_CONEXANT_PHYADDR)
-		return (0);
-
-	if (DC_IS_PNIC(sc)) {
-		CSR_WRITE_4(sc, DC_PN_MII, DC_PN_MIIOPCODE_WRITE |
-		    (phy << 23) | (reg << 10) | data);
-		for (i = 0; i < DC_TIMEOUT; i++) {
-			if (!(CSR_READ_4(sc, DC_PN_MII) & DC_PN_MII_BUSY))
-				break;
-		}
-		return (0);
-	}
-
-	if (DC_IS_COMET(sc)) {
-		switch (reg) {
-		case MII_BMCR:
-			phy_reg = DC_AL_BMCR;
-			break;
-		case MII_BMSR:
-			phy_reg = DC_AL_BMSR;
-			break;
-		case MII_PHYIDR1:
-			phy_reg = DC_AL_VENID;
-			break;
-		case MII_PHYIDR2:
-			phy_reg = DC_AL_DEVID;
-			break;
-		case MII_ANAR:
-			phy_reg = DC_AL_ANAR;
-			break;
-		case MII_ANLPAR:
-			phy_reg = DC_AL_LPAR;
-			break;
-		case MII_ANER:
-			phy_reg = DC_AL_ANER;
-			break;
-		default:
-			device_printf(dev, "phy_write: bad phy register %x\n",
-			    reg);
-			return (0);
-			break;
-		}
-
-		CSR_WRITE_4(sc, phy_reg, data);
-		return (0);
-	}
-
-	frame.mii_phyaddr = phy;
-	frame.mii_regaddr = reg;
-	frame.mii_data = data;
-
-	if (sc->dc_type == DC_TYPE_98713) {
-		phy_reg = CSR_READ_4(sc, DC_NETCFG);
-		CSR_WRITE_4(sc, DC_NETCFG, phy_reg & ~DC_NETCFG_PORTSEL);
-	}
-	dc_mii_writereg(sc, &frame);
-	if (sc->dc_type == DC_TYPE_98713)
-		CSR_WRITE_4(sc, DC_NETCFG, phy_reg);
-
-	return (0);
-}
-
-static void
-dc_miibus_statchg(device_t dev)
-{
-	struct dc_softc *sc;
-	struct mii_data *mii;
-	struct ifmedia *ifm;
-
-	sc = device_get_softc(dev);
-	if (DC_IS_ADMTEK(sc))
-		return;
-
-	mii = device_get_softc(sc->dc_miibus);
-	ifm = &mii->mii_media;
-	if (DC_IS_DAVICOM(sc) &&
-	    IFM_SUBTYPE(ifm->ifm_media) == IFM_HPNA_1) {
-		dc_setcfg(sc, ifm->ifm_media);
-		sc->dc_if_media = ifm->ifm_media;
-	} else {
-		dc_setcfg(sc, mii->mii_media_active);
-		sc->dc_if_media = mii->mii_media_active;
-	}
-}
-
-/*
- * Special support for DM9102A cards with HomePNA PHYs. Note:
- * with the Davicom DM9102A/DM9801 eval board that I have, it seems
- * to be impossible to talk to the management interface of the DM9801
- * PHY (its MDIO pin is not connected to anything). Consequently,
- * the driver has to just 'know' about the additional mode and deal
- * with it itself. *sigh*
- */
-static void
-dc_miibus_mediainit(device_t dev)
-{
-	struct dc_softc *sc;
-	struct mii_data *mii;
-	struct ifmedia *ifm;
-	int rev;
-
-	rev = pci_read_config(dev, DC_PCI_CFRV, 4) & 0xFF;
-
-	sc = device_get_softc(dev);
-	mii = device_get_softc(sc->dc_miibus);
-	ifm = &mii->mii_media;
-
-	if (DC_IS_DAVICOM(sc) && rev >= DC_REVISION_DM9102A)
-		ifmedia_add(ifm, IFM_ETHER | IFM_HPNA_1, 0, NULL);
-}
-
-#define DC_BITS_512	9
-#define DC_BITS_128	7
-#define DC_BITS_64	6
-
-static uint32_t
-dc_mchash_le(struct dc_softc *sc, const uint8_t *addr)
-{
-	uint32_t crc;
-
-	/* Compute CRC for the address value. */
-	crc = ether_crc32_le(addr, ETHER_ADDR_LEN);
-
-	/*
-	 * The hash table on the PNIC II and the MX98715AEC-C/D/E
-	 * chips is only 128 bits wide.
-	 */
-	if (sc->dc_flags & DC_128BIT_HASH)
-		return (crc & ((1 << DC_BITS_128) - 1));
-
-	/* The hash table on the MX98715BEC is only 64 bits wide. */
-	if (sc->dc_flags & DC_64BIT_HASH)
-		return (crc & ((1 << DC_BITS_64) - 1));
-
-	/* Xircom's hash filtering table is different (read: weird) */
-	/* Xircom uses the LEAST significant bits */
-	if (DC_IS_XIRCOM(sc)) {
-		if ((crc & 0x180) == 0x180)
-			return ((crc & 0x0F) + (crc & 0x70) * 3 + (14 << 4));
-		else
-			return ((crc & 0x1F) + ((crc >> 1) & 0xF0) * 3 +
-			    (12 << 4));
-	}
-
-	return (crc & ((1 << DC_BITS_512) - 1));
-}
-
-/*
- * Calculate CRC of a multicast group address, return the lower 6 bits.
- */
-static uint32_t
-dc_mchash_be(const uint8_t *addr)
-{
-	uint32_t crc;
-
-	/* Compute CRC for the address value. */
-	crc = ether_crc32_be(addr, ETHER_ADDR_LEN);
-
-	/* Return the filter bit position. */
-	return ((crc >> 26) & 0x0000003F);
-}
-
-/*
- * 21143-style RX filter setup routine. Filter programming is done by
- * downloading a special setup frame into the TX engine. 21143, Macronix,
- * PNIC, PNIC II and Davicom chips are programmed this way.
- *
- * We always program the chip using 'hash perfect' mode, i.e. one perfect
- * address (our node address) and a 512-bit hash filter for multicast
- * frames. We also sneak the broadcast address into the hash filter since
- * we need that too.
- */
-static void
-dc_setfilt_21143(struct dc_softc *sc)
-{
-	struct dc_desc *sframe;
-	u_int32_t h, *sp;
-	struct ifmultiaddr *ifma;
-	struct ifnet *ifp;
-	int i;
-
-	ifp = sc->dc_ifp;
-
-	i = sc->dc_cdata.dc_tx_prod;
-	DC_INC(sc->dc_cdata.dc_tx_prod, DC_TX_LIST_CNT);
-	sc->dc_cdata.dc_tx_cnt++;
-	sframe = &sc->dc_ldata->dc_tx_list[i];
-	sp = sc->dc_cdata.dc_sbuf;
-	bzero(sp, DC_SFRAME_LEN);
-
-	sframe->dc_data = htole32(sc->dc_saddr);
-	sframe->dc_ctl = htole32(DC_SFRAME_LEN | DC_TXCTL_SETUP |
-	    DC_TXCTL_TLINK | DC_FILTER_HASHPERF | DC_TXCTL_FINT);
-
-	sc->dc_cdata.dc_tx_chain[i] = (struct mbuf *)sc->dc_cdata.dc_sbuf;
-
-	/* If we want promiscuous mode, set the allframes bit. */
-	if (ifp->if_flags & IFF_PROMISC)
-		DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_PROMISC);
-	else
-		DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_PROMISC);
-
-	if (ifp->if_flags & IFF_ALLMULTI)
-		DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI);
-	else
-		DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI);
-
-	IF_ADDR_LOCK(ifp);
-	TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
-		if (ifma->ifma_addr->sa_family != AF_LINK)
-			continue;
-		h = dc_mchash_le(sc,
-		    LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
-		sp[h >> 4] |= htole32(1 << (h & 0xF));
-	}
-	IF_ADDR_UNLOCK(ifp);
-
-	if (ifp->if_flags & IFF_BROADCAST) {
-		h = dc_mchash_le(sc, ifp->if_broadcastaddr);
-		sp[h >> 4] |= htole32(1 << (h & 0xF));
-	}
-
-	/* Set our MAC address */
-	sp[39] = DC_SP_MAC(((u_int16_t *)IFP2ENADDR(sc->dc_ifp))[0]);
-	sp[40] = DC_SP_MAC(((u_int16_t *)IFP2ENADDR(sc->dc_ifp))[1]);
-	sp[41] = DC_SP_MAC(((u_int16_t *)IFP2ENADDR(sc->dc_ifp))[2]);
-
-	sframe->dc_status = htole32(DC_TXSTAT_OWN);
-	CSR_WRITE_4(sc, DC_TXSTART, 0xFFFFFFFF);
-
-	/*
-	 * The PNIC takes an exceedingly long time to process its
-	 * setup frame; wait 10ms after posting the setup frame
-	 * before proceeding, just so it has time to swallow its
-	 * medicine.
-	 */
-	DELAY(10000);
-
-	ifp->if_timer = 5;
-}
-
-static void
-dc_setfilt_admtek(struct dc_softc *sc)
-{
-	struct ifnet *ifp;
-	struct ifmultiaddr *ifma;
-	int h = 0;
-	u_int32_t hashes[2] = { 0, 0 };
-
-	ifp = sc->dc_ifp;
-
-	/* Init our MAC address. */
-	CSR_WRITE_4(sc, DC_AL_PAR0, *(u_int32_t *)(&IFP2ENADDR(sc->dc_ifp)[0]));
-	CSR_WRITE_4(sc, DC_AL_PAR1, *(u_int32_t *)(&IFP2ENADDR(sc->dc_ifp)[4]));
-
-	/* If we want promiscuous mode, set the allframes bit. */
-	if (ifp->if_flags & IFF_PROMISC)
-		DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_PROMISC);
-	else
-		DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_PROMISC);
-
-	if (ifp->if_flags & IFF_ALLMULTI)
-		DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI);
-	else
-		DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI);
-
-	/* First, zot all the existing hash bits. */
-	CSR_WRITE_4(sc, DC_AL_MAR0, 0);
-	CSR_WRITE_4(sc, DC_AL_MAR1, 0);
-
-	/*
-	 * If we're already in promisc or allmulti mode, we
-	 * don't have to bother programming the multicast filter.
-	 */
-	if (ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI))
-		return;
-
-	/* Now program new ones. */
-	IF_ADDR_LOCK(ifp);
-	TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
-		if (ifma->ifma_addr->sa_family != AF_LINK)
-			continue;
-		if (DC_IS_CENTAUR(sc))
-			h = dc_mchash_le(sc,
-			    LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
-		else
-			h = dc_mchash_be(
-			    LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
-		if (h < 32)
-			hashes[0] |= (1 << h);
-		else
-			hashes[1] |= (1 << (h - 32));
-	}
-	IF_ADDR_UNLOCK(ifp);
-
-	CSR_WRITE_4(sc, DC_AL_MAR0, hashes[0]);
-	CSR_WRITE_4(sc, DC_AL_MAR1, hashes[1]);
-}
-
-static void
-dc_setfilt_asix(struct dc_softc *sc)
-{
-	struct ifnet *ifp;
-	struct ifmultiaddr *ifma;
-	int h = 0;
-	u_int32_t hashes[2] = { 0, 0 };
-
-	ifp = sc->dc_ifp;
-
-	/* Init our MAC address */
-	CSR_WRITE_4(sc, DC_AX_FILTIDX, DC_AX_FILTIDX_PAR0);
-	CSR_WRITE_4(sc, DC_AX_FILTDATA,
-	    *(u_int32_t *)(&IFP2ENADDR(sc->dc_ifp)[0]));
-	CSR_WRITE_4(sc, DC_AX_FILTIDX, DC_AX_FILTIDX_PAR1);
-	CSR_WRITE_4(sc, DC_AX_FILTDATA,
-	    *(u_int32_t *)(&IFP2ENADDR(sc->dc_ifp)[4]));
-
-	/* If we want promiscuous mode, set the allframes bit. */
-	if (ifp->if_flags & IFF_PROMISC)
-		DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_PROMISC);
-	else
-		DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_PROMISC);
-
-	if (ifp->if_flags & IFF_ALLMULTI)
-		DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI);
-	else
-		DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI);
-
-	/*
-	 * The ASIX chip has a special bit to enable reception
-	 * of broadcast frames.
-	 */
-	if (ifp->if_flags & IFF_BROADCAST)
-		DC_SETBIT(sc, DC_NETCFG, DC_AX_NETCFG_RX_BROAD);
-	else
-		DC_CLRBIT(sc, DC_NETCFG, DC_AX_NETCFG_RX_BROAD);
-
-	/* first, zot all the existing hash bits */
-	CSR_WRITE_4(sc, DC_AX_FILTIDX, DC_AX_FILTIDX_MAR0);
-	CSR_WRITE_4(sc, DC_AX_FILTDATA, 0);
-	CSR_WRITE_4(sc, DC_AX_FILTIDX, DC_AX_FILTIDX_MAR1);
-	CSR_WRITE_4(sc, DC_AX_FILTDATA, 0);
-
-	/*
-	 * If we're already in promisc or allmulti mode, we
-	 * don't have to bother programming the multicast filter.
-	 */
-	if (ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI))
-		return;
-
-	/* now program new ones */
-	IF_ADDR_LOCK(ifp);
-	TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
-		if (ifma->ifma_addr->sa_family != AF_LINK)
-			continue;
-		h = dc_mchash_be(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
-		if (h < 32)
-			hashes[0] |= (1 << h);
-		else
-			hashes[1] |= (1 << (h - 32));
-	}
-	IF_ADDR_UNLOCK(ifp);
-
-	CSR_WRITE_4(sc, DC_AX_FILTIDX, DC_AX_FILTIDX_MAR0);
-	CSR_WRITE_4(sc, DC_AX_FILTDATA, hashes[0]);
-	CSR_WRITE_4(sc, DC_AX_FILTIDX, DC_AX_FILTIDX_MAR1);
-	CSR_WRITE_4(sc, DC_AX_FILTDATA, hashes[1]);
-}
-
-static void
-dc_setfilt_xircom(struct dc_softc *sc)
-{
-	struct ifnet *ifp;
-	struct ifmultiaddr *ifma;
-	struct dc_desc *sframe;
-	u_int32_t h, *sp;
-	int i;
-
-	ifp = sc->dc_ifp;
-	DC_CLRBIT(sc, DC_NETCFG, (DC_NETCFG_TX_ON | DC_NETCFG_RX_ON));
-
-	i = sc->dc_cdata.dc_tx_prod;
-	DC_INC(sc->dc_cdata.dc_tx_prod, DC_TX_LIST_CNT);
-	sc->dc_cdata.dc_tx_cnt++;
-	sframe = &sc->dc_ldata->dc_tx_list[i];
-	sp = sc->dc_cdata.dc_sbuf;
-	bzero(sp, DC_SFRAME_LEN);
-
-	sframe->dc_data = htole32(sc->dc_saddr);
-	sframe->dc_ctl = htole32(DC_SFRAME_LEN | DC_TXCTL_SETUP |
-	    DC_TXCTL_TLINK | DC_FILTER_HASHPERF | DC_TXCTL_FINT);
-
-	sc->dc_cdata.dc_tx_chain[i] = (struct mbuf *)sc->dc_cdata.dc_sbuf;
-
-	/* If we want promiscuous mode, set the allframes bit. */
-	if (ifp->if_flags & IFF_PROMISC)
-		DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_PROMISC);
-	else
-		DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_PROMISC);
-
-	if (ifp->if_flags & IFF_ALLMULTI)
-		DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI);
-	else
-		DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI);
-
-	IF_ADDR_LOCK(ifp);
-	TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
-		if (ifma->ifma_addr->sa_family != AF_LINK)
-			continue;
-		h = dc_mchash_le(sc,
-		    LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
-		sp[h >> 4] |= htole32(1 << (h & 0xF));
-	}
-	IF_ADDR_UNLOCK(ifp);
-
-	if (ifp->if_flags & IFF_BROADCAST) {
-		h = dc_mchash_le(sc, ifp->if_broadcastaddr);
-		sp[h >> 4] |= htole32(1 << (h & 0xF));
-	}
-
-	/* Set our MAC address */
-	sp[0] = DC_SP_MAC(((u_int16_t *)IFP2ENADDR(sc->dc_ifp))[0]);
-	sp[1] = DC_SP_MAC(((u_int16_t *)IFP2ENADDR(sc->dc_ifp))[1]);
-	sp[2] = DC_SP_MAC(((u_int16_t *)IFP2ENADDR(sc->dc_ifp))[2]);
-
-	DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_TX_ON);
-	DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_ON);
-	ifp->if_drv_flags |= IFF_DRV_RUNNING;
-	sframe->dc_status = htole32(DC_TXSTAT_OWN);
-	CSR_WRITE_4(sc, DC_TXSTART, 0xFFFFFFFF);
-
-	/*
-	 * Wait some time...
-	 */
-	DELAY(1000);
-
-	ifp->if_timer = 5;
-}
-
-static void
-dc_setfilt(struct dc_softc *sc)
-{
-
-	if (DC_IS_INTEL(sc) || DC_IS_MACRONIX(sc) || DC_IS_PNIC(sc) ||
-	    DC_IS_PNICII(sc) || DC_IS_DAVICOM(sc) || DC_IS_CONEXANT(sc))
-		dc_setfilt_21143(sc);
-
-	if (DC_IS_ASIX(sc))
-		dc_setfilt_asix(sc);
-
-	if (DC_IS_ADMTEK(sc))
-		dc_setfilt_admtek(sc);
-
-	if (DC_IS_XIRCOM(sc))
-		dc_setfilt_xircom(sc);
-}
-
-/*
- * In order to fiddle with the 'full-duplex' and '100Mbps' bits in
- * the netconfig register, we first have to put the transmit and/or
- * receive logic in the idle state.
- */
-static void
-dc_setcfg(struct dc_softc *sc, int media)
-{
-	int i, restart = 0, watchdogreg;
-	u_int32_t isr;
-
-	if (IFM_SUBTYPE(media) == IFM_NONE)
-		return;
-
-	if (CSR_READ_4(sc, DC_NETCFG) & (DC_NETCFG_TX_ON | DC_NETCFG_RX_ON)) {
-		restart = 1;
-		DC_CLRBIT(sc, DC_NETCFG, (DC_NETCFG_TX_ON | DC_NETCFG_RX_ON));
-
-		for (i = 0; i < DC_TIMEOUT; i++) {
-			isr = CSR_READ_4(sc, DC_ISR);
-			if (isr & DC_ISR_TX_IDLE &&
-			    ((isr & DC_ISR_RX_STATE) == DC_RXSTATE_STOPPED ||
-			    (isr & DC_ISR_RX_STATE) == DC_RXSTATE_WAIT))
-				break;
-			DELAY(10);
-		}
-
-		if (i == DC_TIMEOUT)
-			if_printf(sc->dc_ifp,
-			    "failed to force tx and rx to idle state\n");
-	}
-
-	if (IFM_SUBTYPE(media) == IFM_100_TX) {
-		DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_SPEEDSEL);
-		DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_HEARTBEAT);
-		if (sc->dc_pmode == DC_PMODE_MII) {
-			if (DC_IS_INTEL(sc)) {
-			/* There's a write enable bit here that reads as 1. */
-				watchdogreg = CSR_READ_4(sc, DC_WATCHDOG);
-				watchdogreg &= ~DC_WDOG_CTLWREN;
-				watchdogreg |= DC_WDOG_JABBERDIS;
-				CSR_WRITE_4(sc, DC_WATCHDOG, watchdogreg);
-			} else {
-				DC_SETBIT(sc, DC_WATCHDOG, DC_WDOG_JABBERDIS);
-			}
-			DC_CLRBIT(sc, DC_NETCFG, (DC_NETCFG_PCS |
-			    DC_NETCFG_PORTSEL | DC_NETCFG_SCRAMBLER));
-			if (sc->dc_type == DC_TYPE_98713)
-				DC_SETBIT(sc, DC_NETCFG, (DC_NETCFG_PCS |
-				    DC_NETCFG_SCRAMBLER));
-			if (!DC_IS_DAVICOM(sc))
-				DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_PORTSEL);
-			DC_CLRBIT(sc, DC_10BTCTRL, 0xFFFF);
-			if (DC_IS_INTEL(sc))
-				dc_apply_fixup(sc, IFM_AUTO);
-		} else {
-			if (DC_IS_PNIC(sc)) {
-				DC_PN_GPIO_SETBIT(sc, DC_PN_GPIO_SPEEDSEL);
-				DC_PN_GPIO_SETBIT(sc, DC_PN_GPIO_100TX_LOOP);
-				DC_SETBIT(sc, DC_PN_NWAY, DC_PN_NWAY_SPEEDSEL);
-			}
-			DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_PORTSEL);
-			DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_PCS);
-			DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_SCRAMBLER);
-			if (DC_IS_INTEL(sc))
-				dc_apply_fixup(sc,
-				    (media & IFM_GMASK) == IFM_FDX ?
-				    IFM_100_TX | IFM_FDX : IFM_100_TX);
-		}
-	}
-
-	if (IFM_SUBTYPE(media) == IFM_10_T) {
-		DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_SPEEDSEL);
-		DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_HEARTBEAT);
-		if (sc->dc_pmode == DC_PMODE_MII) {
-			/* There's a write enable bit here that reads as 1. */
-			if (DC_IS_INTEL(sc)) {
-				watchdogreg = CSR_READ_4(sc, DC_WATCHDOG);
-				watchdogreg &= ~DC_WDOG_CTLWREN;
-				watchdogreg |= DC_WDOG_JABBERDIS;
-				CSR_WRITE_4(sc, DC_WATCHDOG, watchdogreg);
-			} else {
-				DC_SETBIT(sc, DC_WATCHDOG, DC_WDOG_JABBERDIS);
-			}
-			DC_CLRBIT(sc, DC_NETCFG, (DC_NETCFG_PCS |
-			    DC_NETCFG_PORTSEL | DC_NETCFG_SCRAMBLER));
-			if (sc->dc_type == DC_TYPE_98713)
-				DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_PCS);
-			if (!DC_IS_DAVICOM(sc))
-				DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_PORTSEL);
-			DC_CLRBIT(sc, DC_10BTCTRL, 0xFFFF);
-			if (DC_IS_INTEL(sc))
-				dc_apply_fixup(sc, IFM_AUTO);
-		} else {
-			if (DC_IS_PNIC(sc)) {
-				DC_PN_GPIO_CLRBIT(sc, DC_PN_GPIO_SPEEDSEL);
-				DC_PN_GPIO_SETBIT(sc, DC_PN_GPIO_100TX_LOOP);
-				DC_CLRBIT(sc, DC_PN_NWAY, DC_PN_NWAY_SPEEDSEL);
-			}
-			DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_PORTSEL);
-			DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_PCS);
-			DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_SCRAMBLER);
-			if (DC_IS_INTEL(sc)) {
-				DC_CLRBIT(sc, DC_SIARESET, DC_SIA_RESET);
-				DC_CLRBIT(sc, DC_10BTCTRL, 0xFFFF);
-				if ((media & IFM_GMASK) == IFM_FDX)
-					DC_SETBIT(sc, DC_10BTCTRL, 0x7F3D);
-				else
-					DC_SETBIT(sc, DC_10BTCTRL, 0x7F3F);
-				DC_SETBIT(sc, DC_SIARESET, DC_SIA_RESET);
-				DC_CLRBIT(sc, DC_10BTCTRL,
-				    DC_TCTL_AUTONEGENBL);
-				dc_apply_fixup(sc,
-				    (media & IFM_GMASK) == IFM_FDX ?
-				    IFM_10_T | IFM_FDX : IFM_10_T);
-				DELAY(20000);
-			}
-		}
-	}
-
-	/*
-	 * If this is a Davicom DM9102A card with a DM9801 HomePNA
-	 * PHY and we want HomePNA mode, set the portsel bit to turn
-	 * on the external MII port.
-	 */
-	if (DC_IS_DAVICOM(sc)) {
-		if (IFM_SUBTYPE(media) == IFM_HPNA_1) {
-			DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_PORTSEL);
-			sc->dc_link = 1;
-		} else {
-			DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_PORTSEL);
-		}
-	}
-
-	if ((media & IFM_GMASK) == IFM_FDX) {
-		DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_FULLDUPLEX);
-		if (sc->dc_pmode == DC_PMODE_SYM && DC_IS_PNIC(sc))
-			DC_SETBIT(sc, DC_PN_NWAY, DC_PN_NWAY_DUPLEX);
-	} else {
-		DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_FULLDUPLEX);
-		if (sc->dc_pmode == DC_PMODE_SYM && DC_IS_PNIC(sc))
-			DC_CLRBIT(sc, DC_PN_NWAY, DC_PN_NWAY_DUPLEX);
-	}
-
-	if (restart)
-		DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_TX_ON | DC_NETCFG_RX_ON);
-}
-
-static void
-dc_reset(struct dc_softc *sc)
-{
-	int i;
-
-	DC_SETBIT(sc, DC_BUSCTL, DC_BUSCTL_RESET);
-
-	for (i = 0; i < DC_TIMEOUT; i++) {
-		DELAY(10);
-		if (!(CSR_READ_4(sc, DC_BUSCTL) & DC_BUSCTL_RESET))
-			break;
-	}
-
-	if (DC_IS_ASIX(sc) || DC_IS_ADMTEK(sc) || DC_IS_CONEXANT(sc) ||
-	    DC_IS_XIRCOM(sc) || DC_IS_INTEL(sc)) {
-		DELAY(10000);
-		DC_CLRBIT(sc, DC_BUSCTL, DC_BUSCTL_RESET);
-		i = 0;
-	}
-
-	if (i == DC_TIMEOUT)
-		if_printf(sc->dc_ifp, "reset never completed!\n");
-
-	/* Wait a little while for the chip to get its brains in order. */
-	DELAY(1000);
-
-	CSR_WRITE_4(sc, DC_IMR, 0x00000000);
-	CSR_WRITE_4(sc, DC_BUSCTL, 0x00000000);
-	CSR_WRITE_4(sc, DC_NETCFG, 0x00000000);
-
-	/*
-	 * Bring the SIA out of reset. In some cases, it looks
-	 * like failing to unreset the SIA soon enough gets it
-	 * into a state where it will never come out of reset
-	 * until we reset the whole chip again.
-	 */
-	if (DC_IS_INTEL(sc)) {
-		DC_SETBIT(sc, DC_SIARESET, DC_SIA_RESET);
-		CSR_WRITE_4(sc, DC_10BTCTRL, 0);
-		CSR_WRITE_4(sc, DC_WATCHDOG, 0);
-	}
-}
-
-static struct dc_type *
-dc_devtype(device_t dev)
-{
-	struct dc_type *t;
-	u_int32_t rev;
-
-	t = dc_devs;
-
-	while (t->dc_name != NULL) {
-		if ((pci_get_vendor(dev) == t->dc_vid) &&
-		    (pci_get_device(dev) == t->dc_did)) {
-			/* Check the PCI revision */
-			rev = pci_read_config(dev, DC_PCI_CFRV, 4) & 0xFF;
-			if (t->dc_did == DC_DEVICEID_98713 &&
-			    rev >= DC_REVISION_98713A)
-				t++;
-			if (t->dc_did == DC_DEVICEID_98713_CP &&
-			    rev >= DC_REVISION_98713A)
-				t++;
-			if (t->dc_did == DC_DEVICEID_987x5 &&
-			    rev >= DC_REVISION_98715AEC_C)
-				t++;
-			if (t->dc_did == DC_DEVICEID_987x5 &&
-			    rev >= DC_REVISION_98725)
-				t++;
-			if (t->dc_did == DC_DEVICEID_AX88140A &&
-			    rev >= DC_REVISION_88141)
-				t++;
-			if (t->dc_did == DC_DEVICEID_82C168 &&
-			    rev >= DC_REVISION_82C169)
-				t++;
-			if (t->dc_did == DC_DEVICEID_DM9102 &&
-			    rev >= DC_REVISION_DM9102A)
-				t++;
-			/*
-			 * The Microsoft MN-130 has a device ID of 0x0002,
-			 * which happens to be the same as the PNIC 82c168.
-			 * To keep dc_attach() from getting confused, we
-			 * pretend its ID is something different.
-			 * XXX: ideally, dc_attach() should be checking
-			 * vendorid+deviceid together to avoid such
-			 * collisions.
-			 */
-			if (t->dc_vid == DC_VENDORID_MICROSOFT &&
-			    t->dc_did == DC_DEVICEID_MSMN130)
-				t++;
-			return (t);
-		}
-		t++;
-	}
-
-	return (NULL);
-}
-
-/*
- * Probe for a 21143 or clone chip. Check the PCI vendor and device
- * IDs against our list and return a device name if we find a match.
- * We do a little bit of extra work to identify the exact type of
- * chip. The MX98713 and MX98713A have the same PCI vendor/device ID,
- * but different revision IDs. The same is true for 98715/98715A
- * chips and the 98725, as well as the ASIX and ADMtek chips. In some
- * cases, the exact chip revision affects driver behavior.
- */
-static int
-dc_probe(device_t dev)
-{
-	struct dc_type *t;
-
-	t = dc_devtype(dev);
-
-	if (t != NULL) {
-		device_set_desc(dev, t->dc_name);
-		return (BUS_PROBE_DEFAULT);
-	}
-
-	return (ENXIO);
-}
-
-static void
-dc_apply_fixup(struct dc_softc *sc, int media)
-{
-	struct dc_mediainfo *m;
-	u_int8_t *p;
-	int i;
-	u_int32_t reg;
-
-	m = sc->dc_mi;
-
-	while (m != NULL) {
-		if (m->dc_media == media)
-			break;
-		m = m->dc_next;
-	}
-
-	if (m == NULL)
-		return;
-
-	for (i = 0, p = m->dc_reset_ptr; i < m->dc_reset_len; i++, p += 2) {
-		reg = (p[0] | (p[1] << 8)) << 16;
-		CSR_WRITE_4(sc, DC_WATCHDOG, reg);
-	}
-
-	for (i = 0, p = m->dc_gp_ptr; i < m->dc_gp_len; i++, p += 2) {
-		reg = (p[0] | (p[1] << 8)) << 16;
-		CSR_WRITE_4(sc, DC_WATCHDOG, reg);
-	}
-}
-
-static void
-dc_decode_leaf_sia(struct dc_softc *sc, struct dc_eblock_sia *l)
-{
-	struct dc_mediainfo *m;
-
-	m = malloc(sizeof(struct dc_mediainfo), M_DEVBUF, M_NOWAIT | M_ZERO);
-	switch (l->dc_sia_code & ~DC_SIA_CODE_EXT) {
-	case DC_SIA_CODE_10BT:
-		m->dc_media = IFM_10_T;
-		break;
-	case DC_SIA_CODE_10BT_FDX:
-		m->dc_media = IFM_10_T | IFM_FDX;
-		break;
-	case DC_SIA_CODE_10B2:
-		m->dc_media = IFM_10_2;
-		break;
-	case DC_SIA_CODE_10B5:
-		m->dc_media = IFM_10_5;
-		break;
-	default:
-		break;
-	}
-
-	/*
-	 * We need to ignore CSR13, CSR14, CSR15 for SIA mode.
-	 * Things apparently already work for cards that do
-	 * supply Media Specific Data.
-	 */
-	if (l->dc_sia_code & DC_SIA_CODE_EXT) {
-		m->dc_gp_len = 2;
-		m->dc_gp_ptr =
-		(u_int8_t *)&l->dc_un.dc_sia_ext.dc_sia_gpio_ctl;
-	} else {
-		m->dc_gp_len = 2;
-		m->dc_gp_ptr =
-		(u_int8_t *)&l->dc_un.dc_sia_noext.dc_sia_gpio_ctl;
-	}
-
-	m->dc_next = sc->dc_mi;
-	sc->dc_mi = m;
-
-	sc->dc_pmode = DC_PMODE_SIA;
-}
-
-static void
-dc_decode_leaf_sym(struct dc_softc *sc, struct dc_eblock_sym *l)
-{
-	struct dc_mediainfo *m;
-
-	m = malloc(sizeof(struct dc_mediainfo), M_DEVBUF, M_NOWAIT | M_ZERO);
-	if (l->dc_sym_code == DC_SYM_CODE_100BT)
-		m->dc_media = IFM_100_TX;
-
-	if (l->dc_sym_code == DC_SYM_CODE_100BT_FDX)
-		m->dc_media = IFM_100_TX | IFM_FDX;
-
-	m->dc_gp_len = 2;
-	m->dc_gp_ptr = (u_int8_t *)&l->dc_sym_gpio_ctl;
-
-	m->dc_next = sc->dc_mi;
-	sc->dc_mi = m;
-
-	sc->dc_pmode = DC_PMODE_SYM;
-}
-
-static void
-dc_decode_leaf_mii(struct dc_softc *sc, struct dc_eblock_mii *l)
-{
-	struct dc_mediainfo *m;
-	u_int8_t *p;
-
-	m = malloc(sizeof(struct dc_mediainfo), M_DEVBUF, M_NOWAIT | M_ZERO);
-	/* We abuse IFM_AUTO to represent MII. */
-	m->dc_media = IFM_AUTO;
-	m->dc_gp_len = l->dc_gpr_len;
-
-	p = (u_int8_t *)l;
-	p += sizeof(struct dc_eblock_mii);
-	m->dc_gp_ptr = p;
-	p += 2 * l->dc_gpr_len;
-	m->dc_reset_len = *p;
-	p++;
-	m->dc_reset_ptr = p;
-
-	m->dc_next = sc->dc_mi;
-	sc->dc_mi = m;
-}
-
-static void
-dc_read_srom(struct dc_softc *sc, int bits)
-{
-	int size;
-
-	size = 2 << bits;
-	sc->dc_srom = malloc(size, M_DEVBUF, M_NOWAIT);
-	dc_read_eeprom(sc, (caddr_t)sc->dc_srom, 0, (size / 2), 0);
-}
-
-static void
-dc_parse_21143_srom(struct dc_softc *sc)
-{
-	struct dc_leaf_hdr *lhdr;
-	struct dc_eblock_hdr *hdr;
-	int have_mii, i, loff;
-	char *ptr;
-
-	have_mii = 0;
-	loff = sc->dc_srom[27];
-	lhdr = (struct dc_leaf_hdr *)&(sc->dc_srom[loff]);
-
-	ptr = (char *)lhdr;
-	ptr += sizeof(struct dc_leaf_hdr) - 1;
-	/*
-	 * Look if we got a MII media block.
-	 */
-	for (i = 0; i < lhdr->dc_mcnt; i++) {
-		hdr = (struct dc_eblock_hdr *)ptr;
-		if (hdr->dc_type == DC_EBLOCK_MII)
-		    have_mii++;
-
-		ptr += (hdr->dc_len & 0x7F);
-		ptr++;
-	}
-
-	/*
-	 * Do the same thing again. Only use SIA and SYM media
-	 * blocks if no MII media block is available.
-	 */
-	ptr = (char *)lhdr;
-	ptr += sizeof(struct dc_leaf_hdr) - 1;
-	for (i = 0; i < lhdr->dc_mcnt; i++) {
-		hdr = (struct dc_eblock_hdr *)ptr;
-		switch (hdr->dc_type) {
-		case DC_EBLOCK_MII:
-			dc_decode_leaf_mii(sc, (struct dc_eblock_mii *)hdr);
-			break;
-		case DC_EBLOCK_SIA:
-			if (! have_mii)
-				dc_decode_leaf_sia(sc,
-				    (struct dc_eblock_sia *)hdr);
-			break;
-		case DC_EBLOCK_SYM:
-			if (! have_mii)
-				dc_decode_leaf_sym(sc,
-				    (struct dc_eblock_sym *)hdr);
-			break;
-		default:
-			/* Don't care. Yet. */
-			break;
-		}
-		ptr += (hdr->dc_len & 0x7F);
-		ptr++;
-	}
-}
-
-static void
-dc_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nseg, int error)
-{
-	u_int32_t *paddr;
-
-	KASSERT(nseg == 1, ("wrong number of segments, should be 1"));
-	paddr = arg;
-	*paddr = segs->ds_addr;
-}
-
-/*
- * Attach the interface. Allocate softc structures, do ifmedia
- * setup and ethernet/BPF attach.
- */
-static int
-dc_attach(device_t dev)
-{
-	int tmp = 0;
-	u_char eaddr[ETHER_ADDR_LEN];
-	u_int32_t command;
-	struct dc_softc *sc;
-	struct ifnet *ifp;
-	u_int32_t revision;
-	int error = 0, rid, mac_offset;
-	int i;
-	u_int8_t *mac;
-
-	sc = device_get_softc(dev);
-
-	mtx_init(&sc->dc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
-	    MTX_DEF);
-
-	/*
-	 * Map control/status registers.
-	 */
-	pci_enable_busmaster(dev);
-
-	rid = DC_RID;
-	sc->dc_res = bus_alloc_resource_any(dev, DC_RES, &rid, RF_ACTIVE);
-
-	if (sc->dc_res == NULL) {
-		device_printf(dev, "couldn't map ports/memory\n");
-		error = ENXIO;
-		goto fail;
-	}
-
-	sc->dc_btag = rman_get_bustag(sc->dc_res);
-	sc->dc_bhandle = rman_get_bushandle(sc->dc_res);
-
-	/* Allocate interrupt. */
-	rid = 0;
-	sc->dc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
-	    RF_SHAREABLE | RF_ACTIVE);
-
-	if (sc->dc_irq == NULL) {
-		device_printf(dev, "couldn't map interrupt\n");
-		error = ENXIO;
-		goto fail;
-	}
-
-	/* Need this info to decide on a chip type. */
-	sc->dc_info = dc_devtype(dev);
-	revision = pci_read_config(dev, DC_PCI_CFRV, 4) & 0x000000FF;
-
-	/* Get the eeprom width, but PNIC and XIRCOM have diff eeprom */
-	if (sc->dc_info->dc_did != DC_DEVICEID_82C168 &&
-	   sc->dc_info->dc_did != DC_DEVICEID_X3201)
-		dc_eeprom_width(sc);
-
-	switch (sc->dc_info->dc_did) {
-	case DC_DEVICEID_21143:
-		sc->dc_type = DC_TYPE_21143;
-		sc->dc_flags |= DC_TX_POLL | DC_TX_USE_TX_INTR;
-		sc->dc_flags |= DC_REDUCED_MII_POLL;
-		/* Save EEPROM contents so we can parse them later. */
-		dc_read_srom(sc, sc->dc_romwidth);
-		break;
-	case DC_DEVICEID_DM9009:
-	case DC_DEVICEID_DM9100:
-	case DC_DEVICEID_DM9102:
-		sc->dc_type = DC_TYPE_DM9102;
-		sc->dc_flags |= DC_TX_COALESCE | DC_TX_INTR_ALWAYS;
-		sc->dc_flags |= DC_REDUCED_MII_POLL | DC_TX_STORENFWD;
-		sc->dc_flags |= DC_TX_ALIGN;
-		sc->dc_pmode = DC_PMODE_MII;
-		/* Increase the latency timer value. */
-		command = pci_read_config(dev, DC_PCI_CFLT, 4);
-		command &= 0xFFFF00FF;
-		command |= 0x00008000;
-		pci_write_config(dev, DC_PCI_CFLT, command, 4);
-		break;
-	case DC_DEVICEID_AL981:
-		sc->dc_type = DC_TYPE_AL981;
-		sc->dc_flags |= DC_TX_USE_TX_INTR;
-		sc->dc_flags |= DC_TX_ADMTEK_WAR;
-		sc->dc_pmode = DC_PMODE_MII;
-		dc_read_srom(sc, sc->dc_romwidth);
-		break;
-	case DC_DEVICEID_AN985:
-	case DC_DEVICEID_ADM9511:
-	case DC_DEVICEID_ADM9513:
-	case DC_DEVICEID_DRP32TXD:
-	case DC_DEVICEID_FA511:
-	case DC_DEVICEID_FE2500:
-	case DC_DEVICEID_EN2242:
-	case DC_DEVICEID_HAWKING_PN672TX:
-	case DC_DEVICEID_3CSOHOB:
-	case DC_DEVICEID_MSMN120:
-	case DC_DEVICEID_MSMN130_FAKE: /* XXX avoid collision with PNIC*/
-		sc->dc_type = DC_TYPE_AN985;
-		sc->dc_flags |= DC_64BIT_HASH;
-		sc->dc_flags |= DC_TX_USE_TX_INTR;
-		sc->dc_flags |= DC_TX_ADMTEK_WAR;
-		sc->dc_pmode = DC_PMODE_MII;
-		/* Don't read SROM for - auto-loaded on reset */
-		break;
-	case DC_DEVICEID_98713:
-	case DC_DEVICEID_98713_CP:
-		if (revision < DC_REVISION_98713A) {
-			sc->dc_type = DC_TYPE_98713;
-		}
-		if (revision >= DC_REVISION_98713A) {
-			sc->dc_type = DC_TYPE_98713A;
-			sc->dc_flags |= DC_21143_NWAY;
-		}
-		sc->dc_flags |= DC_REDUCED_MII_POLL;
-		sc->dc_flags |= DC_TX_POLL | DC_TX_USE_TX_INTR;
-		break;
-	case DC_DEVICEID_987x5:
-	case DC_DEVICEID_EN1217:
-		/*
-		 * Macronix MX98715AEC-C/D/E parts have only a
-		 * 128-bit hash table. We need to deal with these
-		 * in the same manner as the PNIC II so that we
-		 * get the right number of bits out of the
-		 * CRC routine.
-		 */
-		if (revision >= DC_REVISION_98715AEC_C &&
-		    revision < DC_REVISION_98725)
-			sc->dc_flags |= DC_128BIT_HASH;
-		sc->dc_type = DC_TYPE_987x5;
-		sc->dc_flags |= DC_TX_POLL | DC_TX_USE_TX_INTR;
-		sc->dc_flags |= DC_REDUCED_MII_POLL | DC_21143_NWAY;
-		break;
-	case DC_DEVICEID_98727:
-		sc->dc_type = DC_TYPE_987x5;
-		sc->dc_flags |= DC_TX_POLL | DC_TX_USE_TX_INTR;
-		sc->dc_flags |= DC_REDUCED_MII_POLL | DC_21143_NWAY;
-		break;
-	case DC_DEVICEID_82C115:
-		sc->dc_type = DC_TYPE_PNICII;
-		sc->dc_flags |= DC_TX_POLL | DC_TX_USE_TX_INTR | DC_128BIT_HASH;
-		sc->dc_flags |= DC_REDUCED_MII_POLL | DC_21143_NWAY;
-		break;
-	case DC_DEVICEID_82C168:
-		sc->dc_type = DC_TYPE_PNIC;
-		sc->dc_flags |= DC_TX_STORENFWD | DC_TX_INTR_ALWAYS;
-		sc->dc_flags |= DC_PNIC_RX_BUG_WAR;
-		sc->dc_pnic_rx_buf = malloc(DC_RXLEN * 5, M_DEVBUF, M_NOWAIT);
-		if (revision < DC_REVISION_82C169)
-			sc->dc_pmode = DC_PMODE_SYM;
-		break;
-	case DC_DEVICEID_AX88140A:
-		sc->dc_type = DC_TYPE_ASIX;
-		sc->dc_flags |= DC_TX_USE_TX_INTR | DC_TX_INTR_FIRSTFRAG;
-		sc->dc_flags |= DC_REDUCED_MII_POLL;
-		sc->dc_pmode = DC_PMODE_MII;
-		break;
-	case DC_DEVICEID_X3201:
-		sc->dc_type = DC_TYPE_XIRCOM;
-		sc->dc_flags |= DC_TX_INTR_ALWAYS | DC_TX_COALESCE |
-				DC_TX_ALIGN;
-		/*
-		 * We don't actually need to coalesce, but we're doing
-		 * it to obtain a double word aligned buffer.
-		 * The DC_TX_COALESCE flag is required.
-		 */
-		sc->dc_pmode = DC_PMODE_MII;
-		break;
-	case DC_DEVICEID_RS7112:
-		sc->dc_type = DC_TYPE_CONEXANT;
-		sc->dc_flags |= DC_TX_INTR_ALWAYS;
-		sc->dc_flags |= DC_REDUCED_MII_POLL;
-		sc->dc_pmode = DC_PMODE_MII;
-		dc_read_srom(sc, sc->dc_romwidth);
-		break;
-	default:
-		device_printf(dev, "unknown device: %x\n", sc->dc_info->dc_did);
-		break;
-	}
-
-	/* Save the cache line size. */
-	if (DC_IS_DAVICOM(sc))
-		sc->dc_cachesize = 0;
-	else
-		sc->dc_cachesize = pci_read_config(dev,
-		    DC_PCI_CFLT, 4) & 0xFF;
-
-	/* Reset the adapter. */
-	dc_reset(sc);
-
-	/* Take 21143 out of snooze mode */
-	if (DC_IS_INTEL(sc) || DC_IS_XIRCOM(sc)) {
-		command = pci_read_config(dev, DC_PCI_CFDD, 4);
-		command &= ~(DC_CFDD_SNOOZE_MODE | DC_CFDD_SLEEP_MODE);
-		pci_write_config(dev, DC_PCI_CFDD, command, 4);
-	}
-
-	/*
-	 * Try to learn something about the supported media.
-	 * We know that ASIX and ADMtek and Davicom devices
-	 * will *always* be using MII media, so that's a no-brainer.
-	 * The tricky ones are the Macronix/PNIC II and the
-	 * Intel 21143.
-	 */
-	if (DC_IS_INTEL(sc))
-		dc_parse_21143_srom(sc);
-	else if (DC_IS_MACRONIX(sc) || DC_IS_PNICII(sc)) {
-		if (sc->dc_type == DC_TYPE_98713)
-			sc->dc_pmode = DC_PMODE_MII;
-		else
-			sc->dc_pmode = DC_PMODE_SYM;
-	} else if (!sc->dc_pmode)
-		sc->dc_pmode = DC_PMODE_MII;
-
-	/*
-	 * Get station address from the EEPROM.
-	 */
-	switch(sc->dc_type) {
-	case DC_TYPE_98713:
-	case DC_TYPE_98713A:
-	case DC_TYPE_987x5:
-	case DC_TYPE_PNICII:
-		dc_read_eeprom(sc, (caddr_t)&mac_offset,
-		    (DC_EE_NODEADDR_OFFSET / 2), 1, 0);
-		dc_read_eeprom(sc, (caddr_t)&eaddr, (mac_offset / 2), 3, 0);
-		break;
-	case DC_TYPE_PNIC:
-		dc_read_eeprom(sc, (caddr_t)&eaddr, 0, 3, 1);
-		break;
-	case DC_TYPE_DM9102:
-		dc_read_eeprom(sc, (caddr_t)&eaddr, DC_EE_NODEADDR, 3, 0);
-#ifdef __sparc64__
-		/*
-		 * If this is an onboard dc(4) the station address read from
-		 * the EEPROM is all zero and we have to get it from the fcode.
-		 */
-		for (i = 0; i < ETHER_ADDR_LEN; i++)
-			if (eaddr[i] != 0x00)
-				break;
-		if (i >= ETHER_ADDR_LEN)
-			OF_getetheraddr(dev, eaddr);
-#endif
-		break;
-	case DC_TYPE_21143:
-	case DC_TYPE_ASIX:
-		dc_read_eeprom(sc, (caddr_t)&eaddr, DC_EE_NODEADDR, 3, 0);
-		break;
-	case DC_TYPE_AL981:
-	case DC_TYPE_AN985:
-		*(u_int32_t *)(&eaddr[0]) = CSR_READ_4(sc, DC_AL_PAR0);
-		*(u_int16_t *)(&eaddr[4]) = CSR_READ_4(sc, DC_AL_PAR1);
-		break;
-	case DC_TYPE_CONEXANT:
-		bcopy(sc->dc_srom + DC_CONEXANT_EE_NODEADDR, &eaddr,
-		    ETHER_ADDR_LEN);
-		break;
-	case DC_TYPE_XIRCOM:
-		/* The MAC comes from the CIS. */
-		mac = pci_get_ether(dev);
-		if (!mac) {
-			device_printf(dev, "No station address in CIS!\n");
-			error = ENXIO;
-			goto fail;
-		}
-		bcopy(mac, eaddr, ETHER_ADDR_LEN);
-		break;
-	default:
-		dc_read_eeprom(sc, (caddr_t)&eaddr, DC_EE_NODEADDR, 3, 0);
-		break;
-	}
-
-	/* Allocate a busdma tag and DMA safe memory for TX/RX descriptors. */
-	error = bus_dma_tag_create(NULL, PAGE_SIZE, 0, BUS_SPACE_MAXADDR_32BIT,
-	    BUS_SPACE_MAXADDR, NULL, NULL, sizeof(struct dc_list_data), 1,
-	    sizeof(struct dc_list_data), 0, NULL, NULL, &sc->dc_ltag);
-	if (error) {
-		device_printf(dev, "failed to allocate busdma tag\n");
-		error = ENXIO;
-		goto fail;
-	}
-	error = bus_dmamem_alloc(sc->dc_ltag, (void **)&sc->dc_ldata,
-	    BUS_DMA_NOWAIT | BUS_DMA_ZERO, &sc->dc_lmap);
-	if (error) {
-		device_printf(dev, "failed to allocate DMA safe memory\n");
-		error = ENXIO;
-		goto fail;
-	}
-	error = bus_dmamap_load(sc->dc_ltag, sc->dc_lmap, sc->dc_ldata,
-	    sizeof(struct dc_list_data), dc_dma_map_addr, &sc->dc_laddr,
-	    BUS_DMA_NOWAIT);
-	if (error) {
-		device_printf(dev, "cannot get address of the descriptors\n");
-		error = ENXIO;
-		goto fail;
-	}
-
-	/*
-	 * Allocate a busdma tag and DMA safe memory for the multicast
-	 * setup frame.
-	 */
-	error = bus_dma_tag_create(NULL, PAGE_SIZE, 0, BUS_SPACE_MAXADDR_32BIT,
-	    BUS_SPACE_MAXADDR, NULL, NULL, DC_SFRAME_LEN + DC_MIN_FRAMELEN, 1,
-	    DC_SFRAME_LEN + DC_MIN_FRAMELEN, 0, NULL, NULL, &sc->dc_stag);
-	if (error) {
-		device_printf(dev, "failed to allocate busdma tag\n");
-		error = ENXIO;
-		goto fail;
-	}
-	error = bus_dmamem_alloc(sc->dc_stag, (void **)&sc->dc_cdata.dc_sbuf,
-	    BUS_DMA_NOWAIT, &sc->dc_smap);
-	if (error) {
-		device_printf(dev, "failed to allocate DMA safe memory\n");
-		error = ENXIO;
-		goto fail;
-	}
-	error = bus_dmamap_load(sc->dc_stag, sc->dc_smap, sc->dc_cdata.dc_sbuf,
-	    DC_SFRAME_LEN, dc_dma_map_addr, &sc->dc_saddr, BUS_DMA_NOWAIT);
-	if (error) {
-		device_printf(dev, "cannot get address of the descriptors\n");
-		error = ENXIO;
-		goto fail;
-	}
-
-	/* Allocate a busdma tag for mbufs. */
-	error = bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR_32BIT,
-	    BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, DC_TX_LIST_CNT, MCLBYTES,
-	    0, NULL, NULL, &sc->dc_mtag);
-	if (error) {
-		device_printf(dev, "failed to allocate busdma tag\n");
-		error = ENXIO;
-		goto fail;
-	}
-
-	/* Create the TX/RX busdma maps. */
-	for (i = 0; i < DC_TX_LIST_CNT; i++) {
-		error = bus_dmamap_create(sc->dc_mtag, 0,
-		    &sc->dc_cdata.dc_tx_map[i]);
-		if (error) {
-			device_printf(dev, "failed to init TX ring\n");
-			error = ENXIO;
-			goto fail;
-		}
-	}
-	for (i = 0; i < DC_RX_LIST_CNT; i++) {
-		error = bus_dmamap_create(sc->dc_mtag, 0,
-		    &sc->dc_cdata.dc_rx_map[i]);
-		if (error) {
-			device_printf(dev, "failed to init RX ring\n");
-			error = ENXIO;
-			goto fail;
-		}
-	}
-	error = bus_dmamap_create(sc->dc_mtag, 0, &sc->dc_sparemap);
-	if (error) {
-		device_printf(dev, "failed to init RX ring\n");
-		error = ENXIO;
-		goto fail;
-	}
-
-	ifp = sc->dc_ifp = if_alloc(IFT_ETHER);
-	if (ifp == NULL) {
-		device_printf(dev, "can not if_alloc()\n");
-		error = ENOSPC;
-		goto fail;
-	}
-	ifp->if_softc = sc;
-	if_initname(ifp, device_get_name(dev), device_get_unit(dev));
-	/* XXX: bleah, MTU gets overwritten in ether_ifattach() */
-	ifp->if_mtu = ETHERMTU;
-	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
-	ifp->if_ioctl = dc_ioctl;
-	ifp->if_start = dc_start;
-	ifp->if_watchdog = dc_watchdog;
-	ifp->if_init = dc_init;
-	IFQ_SET_MAXLEN(&ifp->if_snd, DC_TX_LIST_CNT - 1);
-	ifp->if_snd.ifq_drv_maxlen = DC_TX_LIST_CNT - 1;
-	IFQ_SET_READY(&ifp->if_snd);
-
-	/*
-	 * Do MII setup. If this is a 21143, check for a PHY on the
-	 * MII bus after applying any necessary fixups to twiddle the
-	 * GPIO bits. If we don't end up finding a PHY, restore the
-	 * old selection (SIA only or SIA/SYM) and attach the dcphy
-	 * driver instead.
-	 */
-	if (DC_IS_INTEL(sc)) {
-		dc_apply_fixup(sc, IFM_AUTO);
-		tmp = sc->dc_pmode;
-		sc->dc_pmode = DC_PMODE_MII;
-	}
-
-	/*
-	 * Setup General Purpose port mode and data so the tulip can talk
-	 * to the MII.  This needs to be done before mii_phy_probe so that
-	 * we can actually see them.
-	 */
-	if (DC_IS_XIRCOM(sc)) {
-		CSR_WRITE_4(sc, DC_SIAGP, DC_SIAGP_WRITE_EN | DC_SIAGP_INT1_EN |
-		    DC_SIAGP_MD_GP2_OUTPUT | DC_SIAGP_MD_GP0_OUTPUT);
-		DELAY(10);
-		CSR_WRITE_4(sc, DC_SIAGP, DC_SIAGP_INT1_EN |
-		    DC_SIAGP_MD_GP2_OUTPUT | DC_SIAGP_MD_GP0_OUTPUT);
-		DELAY(10);
-	}
-
-	error = mii_phy_probe(dev, &sc->dc_miibus,
-	    dc_ifmedia_upd, dc_ifmedia_sts);
-
-	if (error && DC_IS_INTEL(sc)) {
-		sc->dc_pmode = tmp;
-		if (sc->dc_pmode != DC_PMODE_SIA)
-			sc->dc_pmode = DC_PMODE_SYM;
-		sc->dc_flags |= DC_21143_NWAY;
-		mii_phy_probe(dev, &sc->dc_miibus,
-		    dc_ifmedia_upd, dc_ifmedia_sts);
-		/*
-		 * For non-MII cards, we need to have the 21143
-		 * drive the LEDs. Except there are some systems
-		 * like the NEC VersaPro NoteBook PC which have no
-		 * LEDs, and twiddling these bits has adverse effects
-		 * on them. (I.e. you suddenly can't get a link.)
-		 */
-		if (pci_read_config(dev, DC_PCI_CSID, 4) != 0x80281033)
-			sc->dc_flags |= DC_TULIP_LEDS;
-		error = 0;
-	}
-
-	if (error) {
-		device_printf(dev, "MII without any PHY!\n");
-		goto fail;
-	}
-
-	if (DC_IS_ADMTEK(sc)) {
-		/*
-		 * Set automatic TX underrun recovery for the ADMtek chips
-		 */
-		DC_SETBIT(sc, DC_AL_CR, DC_AL_CR_ATUR);
-	}
-
-	/*
-	 * Tell the upper layer(s) we support long frames.
-	 */
-	ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
-	ifp->if_capabilities |= IFCAP_VLAN_MTU;
-	ifp->if_capenable = ifp->if_capabilities;
-#ifdef DEVICE_POLLING
-	ifp->if_capabilities |= IFCAP_POLLING;
-#endif
-
-	callout_init_mtx(&sc->dc_stat_ch, &sc->dc_mtx, 0);
-
-#ifdef SRM_MEDIA
-	sc->dc_srm_media = 0;
-
-	/* Remember the SRM console media setting */
-	if (DC_IS_INTEL(sc)) {
-		command = pci_read_config(dev, DC_PCI_CFDD, 4);
-		command &= ~(DC_CFDD_SNOOZE_MODE | DC_CFDD_SLEEP_MODE);
-		switch ((command >> 8) & 0xff) {
-		case 3:
-			sc->dc_srm_media = IFM_10_T;
-			break;
-		case 4:
-			sc->dc_srm_media = IFM_10_T | IFM_FDX;
-			break;
-		case 5:
-			sc->dc_srm_media = IFM_100_TX;
-			break;
-		case 6:
-			sc->dc_srm_media = IFM_100_TX | IFM_FDX;
-			break;
-		}
-		if (sc->dc_srm_media)
-			sc->dc_srm_media |= IFM_ACTIVE | IFM_ETHER;
-	}
-#endif
-
-	/*
-	 * Call MI attach routine.
-	 */
-	ether_ifattach(ifp, eaddr);
-
-	/* Hook interrupt last to avoid having to lock softc */
-	error = bus_setup_intr(dev, sc->dc_irq, INTR_TYPE_NET | INTR_MPSAFE,
-	    dc_intr, sc, &sc->dc_intrhand);
-
-	if (error) {
-		device_printf(dev, "couldn't set up irq\n");
-		ether_ifdetach(ifp);
-		goto fail;
-	}
-
-fail:
-	if (error)
-		dc_detach(dev);
-	return (error);
-}
-
-/*
- * Shutdown hardware and free up resources. This can be called any
- * time after the mutex has been initialized. It is called in both
- * the error case in attach and the normal detach case so it needs
- * to be careful about only freeing resources that have actually been
- * allocated.
- */
-static int
-dc_detach(device_t dev)
-{
-	struct dc_softc *sc;
-	struct ifnet *ifp;
-	struct dc_mediainfo *m;
-	int i;
-
-	sc = device_get_softc(dev);
-	KASSERT(mtx_initialized(&sc->dc_mtx), ("dc mutex not initialized"));
-
-	ifp = sc->dc_ifp;
-
-#ifdef DEVICE_POLLING
-	if (ifp->if_capenable & IFCAP_POLLING)
-		ether_poll_deregister(ifp);
-#endif
-
-	/* These should only be active if attach succeeded */
-	if (device_is_attached(dev)) {
-		DC_LOCK(sc);
-		dc_stop(sc);
-		DC_UNLOCK(sc);
-		callout_drain(&sc->dc_stat_ch);
-		ether_ifdetach(ifp);
-	}
-	if (ifp)
-		if_free(ifp);
-	if (sc->dc_miibus)
-		device_delete_child(dev, sc->dc_miibus);
-	bus_generic_detach(dev);
-
-	if (sc->dc_intrhand)
-		bus_teardown_intr(dev, sc->dc_irq, sc->dc_intrhand);
-	if (sc->dc_irq)
-		bus_release_resource(dev, SYS_RES_IRQ, 0, sc->dc_irq);
-	if (sc->dc_res)
-		bus_release_resource(dev, DC_RES, DC_RID, sc->dc_res);
-
-	if (sc->dc_cdata.dc_sbuf != NULL)
-		bus_dmamem_free(sc->dc_stag, sc->dc_cdata.dc_sbuf, sc->dc_smap);
-	if (sc->dc_ldata != NULL)
-		bus_dmamem_free(sc->dc_ltag, sc->dc_ldata, sc->dc_lmap);
-	if (sc->dc_mtag) {
-		for (i = 0; i < DC_TX_LIST_CNT; i++)
-			if (sc->dc_cdata.dc_tx_map[i] != NULL)
-				bus_dmamap_destroy(sc->dc_mtag,
-				    sc->dc_cdata.dc_tx_map[i]);
-		for (i = 0; i < DC_RX_LIST_CNT; i++)
-			if (sc->dc_cdata.dc_rx_map[i] != NULL)
-				bus_dmamap_destroy(sc->dc_mtag,
-				    sc->dc_cdata.dc_rx_map[i]);
-		bus_dmamap_destroy(sc->dc_mtag, sc->dc_sparemap);
-	}
-	if (sc->dc_stag)
-		bus_dma_tag_destroy(sc->dc_stag);
-	if (sc->dc_mtag)
-		bus_dma_tag_destroy(sc->dc_mtag);
-	if (sc->dc_ltag)
-		bus_dma_tag_destroy(sc->dc_ltag);
-
-	free(sc->dc_pnic_rx_buf, M_DEVBUF);
-
-	while (sc->dc_mi != NULL) {
-		m = sc->dc_mi->dc_next;
-		free(sc->dc_mi, M_DEVBUF);
-		sc->dc_mi = m;
-	}
-	free(sc->dc_srom, M_DEVBUF);
-
-	mtx_destroy(&sc->dc_mtx);
-
-	return (0);
-}
-
-/*
- * Initialize the transmit descriptors.
- */
-static int
-dc_list_tx_init(struct dc_softc *sc)
-{
-	struct dc_chain_data *cd;
-	struct dc_list_data *ld;
-	int i, nexti;
-
-	cd = &sc->dc_cdata;
-	ld = sc->dc_ldata;
-	for (i = 0; i < DC_TX_LIST_CNT; i++) {
-		if (i == DC_TX_LIST_CNT - 1)
-			nexti = 0;
-		else
-			nexti = i + 1;
-		ld->dc_tx_list[i].dc_next = htole32(DC_TXDESC(sc, nexti));
-		cd->dc_tx_chain[i] = NULL;
-		ld->dc_tx_list[i].dc_data = 0;
-		ld->dc_tx_list[i].dc_ctl = 0;
-	}
-
-	cd->dc_tx_prod = cd->dc_tx_cons = cd->dc_tx_cnt = 0;
-	bus_dmamap_sync(sc->dc_ltag, sc->dc_lmap,
-	    BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
-	return (0);
-}
-
-
-/*
- * Initialize the RX descriptors and allocate mbufs for them. Note that
- * we arrange the descriptors in a closed ring, so that the last descriptor
- * points back to the first.
- */
-static int
-dc_list_rx_init(struct dc_softc *sc)
-{
-	struct dc_chain_data *cd;
-	struct dc_list_data *ld;
-	int i, nexti;
-
-	cd = &sc->dc_cdata;
-	ld = sc->dc_ldata;
-
-	for (i = 0; i < DC_RX_LIST_CNT; i++) {
-		if (dc_newbuf(sc, i, 1) != 0)
-			return (ENOBUFS);
-		if (i == DC_RX_LIST_CNT - 1)
-			nexti = 0;
-		else
-			nexti = i + 1;
-		ld->dc_rx_list[i].dc_next = htole32(DC_RXDESC(sc, nexti));
-	}
-
-	cd->dc_rx_prod = 0;
-	bus_dmamap_sync(sc->dc_ltag, sc->dc_lmap,
-	    BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
-	return (0);
-}
-
-static void
-dc_dma_map_rxbuf(arg, segs, nseg, mapsize, error)
-	void *arg;
-	bus_dma_segment_t *segs;
-	int nseg;
-	bus_size_t mapsize;
-	int error;
-{
-	struct dc_softc *sc;
-	struct dc_desc *c;
-
-	sc = arg;
-	c = &sc->dc_ldata->dc_rx_list[sc->dc_cdata.dc_rx_cur];
-	if (error) {
-		sc->dc_cdata.dc_rx_err = error;
-		return;
-	}
-
-	KASSERT(nseg == 1, ("wrong number of segments, should be 1"));
-	sc->dc_cdata.dc_rx_err = 0;
-	c->dc_data = htole32(segs->ds_addr);
-}
-
-/*
- * Initialize an RX descriptor and attach an MBUF cluster.
- */
-static int
-dc_newbuf(struct dc_softc *sc, int i, int alloc)
-{
-	struct mbuf *m_new;
-	bus_dmamap_t tmp;
-	int error;
-
-	if (alloc) {
-		m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR);
-		if (m_new == NULL)
-			return (ENOBUFS);
-	} else {
-		m_new = sc->dc_cdata.dc_rx_chain[i];
-		m_new->m_data = m_new->m_ext.ext_buf;
-	}
-	m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
-	m_adj(m_new, sizeof(u_int64_t));
-
-	/*
-	 * If this is a PNIC chip, zero the buffer. This is part
-	 * of the workaround for the receive bug in the 82c168 and
-	 * 82c169 chips.
-	 */
-	if (sc->dc_flags & DC_PNIC_RX_BUG_WAR)
-		bzero(mtod(m_new, char *), m_new->m_len);
-
-	/* No need to remap the mbuf if we're reusing it. */
-	if (alloc) {
-		sc->dc_cdata.dc_rx_cur = i;
-		error = bus_dmamap_load_mbuf(sc->dc_mtag, sc->dc_sparemap,
-		    m_new, dc_dma_map_rxbuf, sc, 0);
-		if (error) {
-			m_freem(m_new);
-			return (error);
-		}
-		if (sc->dc_cdata.dc_rx_err != 0) {
-			m_freem(m_new);
-			return (sc->dc_cdata.dc_rx_err);
-		}
-		bus_dmamap_unload(sc->dc_mtag, sc->dc_cdata.dc_rx_map[i]);
-		tmp = sc->dc_cdata.dc_rx_map[i];
-		sc->dc_cdata.dc_rx_map[i] = sc->dc_sparemap;
-		sc->dc_sparemap = tmp;
-		sc->dc_cdata.dc_rx_chain[i] = m_new;
-	}
-
-	sc->dc_ldata->dc_rx_list[i].dc_ctl = htole32(DC_RXCTL_RLINK | DC_RXLEN);
-	sc->dc_ldata->dc_rx_list[i].dc_status = htole32(DC_RXSTAT_OWN);
-	bus_dmamap_sync(sc->dc_mtag, sc->dc_cdata.dc_rx_map[i],
-	    BUS_DMASYNC_PREREAD);
-	bus_dmamap_sync(sc->dc_ltag, sc->dc_lmap,
-	    BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
-	return (0);
-}
-
-/*
- * Grrrrr.
- * The PNIC chip has a terrible bug in it that manifests itself during
- * periods of heavy activity. The exact mode of failure if difficult to
- * pinpoint: sometimes it only happens in promiscuous mode, sometimes it
- * will happen on slow machines. The bug is that sometimes instead of
- * uploading one complete frame during reception, it uploads what looks
- * like the entire contents of its FIFO memory. The frame we want is at
- * the end of the whole mess, but we never know exactly how much data has
- * been uploaded, so salvaging the frame is hard.
- *
- * There is only one way to do it reliably, and it's disgusting.
- * Here's what we know:
- *
- * - We know there will always be somewhere between one and three extra
- *   descriptors uploaded.
- *
- * - We know the desired received frame will always be at the end of the
- *   total data upload.
- *
- * - We know the size of the desired received frame because it will be
- *   provided in the length field of the status word in the last descriptor.
- *
- * Here's what we do:
- *
- * - When we allocate buffers for the receive ring, we bzero() them.
- *   This means that we know that the buffer contents should be all
- *   zeros, except for data uploaded by the chip.
- *
- * - We also force the PNIC chip to upload frames that include the
- *   ethernet CRC at the end.
- *
- * - We gather all of the bogus frame data into a single buffer.
- *
- * - We then position a pointer at the end of this buffer and scan
- *   backwards until we encounter the first non-zero byte of data.
- *   This is the end of the received frame. We know we will encounter
- *   some data at the end of the frame because the CRC will always be
- *   there, so even if the sender transmits a packet of all zeros,
- *   we won't be fooled.
- *
- * - We know the size of the actual received frame, so we subtract
- *   that value from the current pointer location. This brings us
- *   to the start of the actual received packet.
- *
- * - We copy this into an mbuf and pass it on, along with the actual
- *   frame length.
- *
- * The performance hit is tremendous, but it beats dropping frames all
- * the time.
- */
-
-#define DC_WHOLEFRAME	(DC_RXSTAT_FIRSTFRAG | DC_RXSTAT_LASTFRAG)
-static void
-dc_pnic_rx_bug_war(struct dc_softc *sc, int idx)
-{
-	struct dc_desc *cur_rx;
-	struct dc_desc *c = NULL;
-	struct mbuf *m = NULL;
-	unsigned char *ptr;
-	int i, total_len;
-	u_int32_t rxstat = 0;
-
-	i = sc->dc_pnic_rx_bug_save;
-	cur_rx = &sc->dc_ldata->dc_rx_list[idx];
-	ptr = sc->dc_pnic_rx_buf;
-	bzero(ptr, DC_RXLEN * 5);
-
-	/* Copy all the bytes from the bogus buffers. */
-	while (1) {
-		c = &sc->dc_ldata->dc_rx_list[i];
-		rxstat = le32toh(c->dc_status);
-		m = sc->dc_cdata.dc_rx_chain[i];
-		bcopy(mtod(m, char *), ptr, DC_RXLEN);
-		ptr += DC_RXLEN;
-		/* If this is the last buffer, break out. */
-		if (i == idx || rxstat & DC_RXSTAT_LASTFRAG)
-			break;
-		dc_newbuf(sc, i, 0);
-		DC_INC(i, DC_RX_LIST_CNT);
-	}
-
-	/* Find the length of the actual receive frame. */
-	total_len = DC_RXBYTES(rxstat);
-
-	/* Scan backwards until we hit a non-zero byte. */
-	while (*ptr == 0x00)
-		ptr--;
-
-	/* Round off. */
-	if ((uintptr_t)(ptr) & 0x3)
-		ptr -= 1;
-
-	/* Now find the start of the frame. */
-	ptr -= total_len;
-	if (ptr < sc->dc_pnic_rx_buf)
-		ptr = sc->dc_pnic_rx_buf;
-
-	/*
-	 * Now copy the salvaged frame to the last mbuf and fake up
-	 * the status word to make it look like a successful
-	 * frame reception.
-	 */
-	dc_newbuf(sc, i, 0);
-	bcopy(ptr, mtod(m, char *), total_len);
-	cur_rx->dc_status = htole32(rxstat | DC_RXSTAT_FIRSTFRAG);
-}
-
-/*
- * This routine searches the RX ring for dirty descriptors in the
- * event that the rxeof routine falls out of sync with the chip's
- * current descriptor pointer. This may happen sometimes as a result
- * of a "no RX buffer available" condition that happens when the chip
- * consumes all of the RX buffers before the driver has a chance to
- * process the RX ring. This routine may need to be called more than
- * once to bring the driver back in sync with the chip, however we
- * should still be getting RX DONE interrupts to drive the search
- * for new packets in the RX ring, so we should catch up eventually.
- */
-static int
-dc_rx_resync(struct dc_softc *sc)
-{
-	struct dc_desc *cur_rx;
-	int i, pos;
-
-	pos = sc->dc_cdata.dc_rx_prod;
-
-	for (i = 0; i < DC_RX_LIST_CNT; i++) {
-		cur_rx = &sc->dc_ldata->dc_rx_list[pos];
-		if (!(le32toh(cur_rx->dc_status) & DC_RXSTAT_OWN))
-			break;
-		DC_INC(pos, DC_RX_LIST_CNT);
-	}
-
-	/* If the ring really is empty, then just return. */
-	if (i == DC_RX_LIST_CNT)
-		return (0);
-
-	/* We've fallen behing the chip: catch it. */
-	sc->dc_cdata.dc_rx_prod = pos;
-
-	return (EAGAIN);
-}
-
-/*
- * A frame has been uploaded: pass the resulting mbuf chain up to
- * the higher level protocols.
- */
-static void
-dc_rxeof(struct dc_softc *sc)
-{
-	struct mbuf *m;
-	struct ifnet *ifp;
-	struct dc_desc *cur_rx;
-	int i, total_len = 0;
-	u_int32_t rxstat;
-
-	DC_LOCK_ASSERT(sc);
-
-	ifp = sc->dc_ifp;
-	i = sc->dc_cdata.dc_rx_prod;
-
-	bus_dmamap_sync(sc->dc_ltag, sc->dc_lmap, BUS_DMASYNC_POSTREAD);
-	while (!(le32toh(sc->dc_ldata->dc_rx_list[i].dc_status) &
-	    DC_RXSTAT_OWN)) {
-#ifdef DEVICE_POLLING
-		if (ifp->if_capenable & IFCAP_POLLING) {
-			if (sc->rxcycles <= 0)
-				break;
-			sc->rxcycles--;
-		}
-#endif
-		cur_rx = &sc->dc_ldata->dc_rx_list[i];
-		rxstat = le32toh(cur_rx->dc_status);
-		m = sc->dc_cdata.dc_rx_chain[i];
-		bus_dmamap_sync(sc->dc_mtag, sc->dc_cdata.dc_rx_map[i],
-		    BUS_DMASYNC_POSTREAD);
-		total_len = DC_RXBYTES(rxstat);
-
-		if (sc->dc_flags & DC_PNIC_RX_BUG_WAR) {
-			if ((rxstat & DC_WHOLEFRAME) != DC_WHOLEFRAME) {
-				if (rxstat & DC_RXSTAT_FIRSTFRAG)
-					sc->dc_pnic_rx_bug_save = i;
-				if ((rxstat & DC_RXSTAT_LASTFRAG) == 0) {
-					DC_INC(i, DC_RX_LIST_CNT);
-					continue;
-				}
-				dc_pnic_rx_bug_war(sc, i);
-				rxstat = le32toh(cur_rx->dc_status);
-				total_len = DC_RXBYTES(rxstat);
-			}
-		}
-
-		/*
-		 * If an error occurs, update stats, clear the
-		 * status word and leave the mbuf cluster in place:
-		 * it should simply get re-used next time this descriptor
-		 * comes up in the ring.  However, don't report long
-		 * frames as errors since they could be vlans.
-		 */
-		if ((rxstat & DC_RXSTAT_RXERR)) {
-			if (!(rxstat & DC_RXSTAT_GIANT) ||
-			    (rxstat & (DC_RXSTAT_CRCERR | DC_RXSTAT_DRIBBLE |
-				       DC_RXSTAT_MIIERE | DC_RXSTAT_COLLSEEN |
-				       DC_RXSTAT_RUNT   | DC_RXSTAT_DE))) {
-				ifp->if_ierrors++;
-				if (rxstat & DC_RXSTAT_COLLSEEN)
-					ifp->if_collisions++;
-				dc_newbuf(sc, i, 0);
-				if (rxstat & DC_RXSTAT_CRCERR) {
-					DC_INC(i, DC_RX_LIST_CNT);
-					continue;
-				} else {
-					dc_init_locked(sc);
-					return;
-				}
-			}
-		}
-
-		/* No errors; receive the packet. */
-		total_len -= ETHER_CRC_LEN;
-#ifdef __i386__
-		/*
-		 * On the x86 we do not have alignment problems, so try to
-		 * allocate a new buffer for the receive ring, and pass up
-		 * the one where the packet is already, saving the expensive
-		 * copy done in m_devget().
-		 * If we are on an architecture with alignment problems, or
-		 * if the allocation fails, then use m_devget and leave the
-		 * existing buffer in the receive ring.
-		 */
-		if (dc_quick && dc_newbuf(sc, i, 1) == 0) {
-			m->m_pkthdr.rcvif = ifp;
-			m->m_pkthdr.len = m->m_len = total_len;
-			DC_INC(i, DC_RX_LIST_CNT);
-		} else
-#endif
-		{
-			struct mbuf *m0;
-
-			m0 = m_devget(mtod(m, char *), total_len,
-				ETHER_ALIGN, ifp, NULL);
-			dc_newbuf(sc, i, 0);
-			DC_INC(i, DC_RX_LIST_CNT);
-			if (m0 == NULL) {
-				ifp->if_ierrors++;
-				continue;
-			}
-			m = m0;
-		}
-
-		ifp->if_ipackets++;
-		DC_UNLOCK(sc);
-		(*ifp->if_input)(ifp, m);
-		DC_LOCK(sc);
-	}
-
-	sc->dc_cdata.dc_rx_prod = i;
-}
-
-/*
- * A frame was downloaded to the chip. It's safe for us to clean up
- * the list buffers.
- */
-
-static void
-dc_txeof(struct dc_softc *sc)
-{
-	struct dc_desc *cur_tx = NULL;
-	struct ifnet *ifp;
-	int idx;
-	u_int32_t ctl, txstat;
-
-	ifp = sc->dc_ifp;
-
-	/*
-	 * Go through our tx list and free mbufs for those
-	 * frames that have been transmitted.
-	 */
-	bus_dmamap_sync(sc->dc_ltag, sc->dc_lmap, BUS_DMASYNC_POSTREAD);
-	idx = sc->dc_cdata.dc_tx_cons;
-	while (idx != sc->dc_cdata.dc_tx_prod) {
-
-		cur_tx = &sc->dc_ldata->dc_tx_list[idx];
-		txstat = le32toh(cur_tx->dc_status);
-		ctl = le32toh(cur_tx->dc_ctl);
-
-		if (txstat & DC_TXSTAT_OWN)
-			break;
-
-		if (!(ctl & DC_TXCTL_LASTFRAG) || ctl & DC_TXCTL_SETUP) {
-			if (ctl & DC_TXCTL_SETUP) {
-				/*
-				 * Yes, the PNIC is so brain damaged
-				 * that it will sometimes generate a TX
-				 * underrun error while DMAing the RX
-				 * filter setup frame. If we detect this,
-				 * we have to send the setup frame again,
-				 * or else the filter won't be programmed
-				 * correctly.
-				 */
-				if (DC_IS_PNIC(sc)) {
-					if (txstat & DC_TXSTAT_ERRSUM)
-						dc_setfilt(sc);
-				}
-				sc->dc_cdata.dc_tx_chain[idx] = NULL;
-			}
-			sc->dc_cdata.dc_tx_cnt--;
-			DC_INC(idx, DC_TX_LIST_CNT);
-			continue;
-		}
-
-		if (DC_IS_XIRCOM(sc) || DC_IS_CONEXANT(sc)) {
-			/*
-			 * XXX: Why does my Xircom taunt me so?
-			 * For some reason it likes setting the CARRLOST flag
-			 * even when the carrier is there. wtf?!?
-			 * Who knows, but Conexant chips have the
-			 * same problem. Maybe they took lessons
-			 * from Xircom.
-			 */
-			if (/*sc->dc_type == DC_TYPE_21143 &&*/
-			    sc->dc_pmode == DC_PMODE_MII &&
-			    ((txstat & 0xFFFF) & ~(DC_TXSTAT_ERRSUM |
-			    DC_TXSTAT_NOCARRIER)))
-				txstat &= ~DC_TXSTAT_ERRSUM;
-		} else {
-			if (/*sc->dc_type == DC_TYPE_21143 &&*/
-			    sc->dc_pmode == DC_PMODE_MII &&
-			    ((txstat & 0xFFFF) & ~(DC_TXSTAT_ERRSUM |
-			    DC_TXSTAT_NOCARRIER | DC_TXSTAT_CARRLOST)))
-				txstat &= ~DC_TXSTAT_ERRSUM;
-		}
-
-		if (txstat & DC_TXSTAT_ERRSUM) {
-			ifp->if_oerrors++;
-			if (txstat & DC_TXSTAT_EXCESSCOLL)
-				ifp->if_collisions++;
-			if (txstat & DC_TXSTAT_LATECOLL)
-				ifp->if_collisions++;
-			if (!(txstat & DC_TXSTAT_UNDERRUN)) {
-				dc_init_locked(sc);
-				return;
-			}
-		}
-
-		ifp->if_collisions += (txstat & DC_TXSTAT_COLLCNT) >> 3;
-
-		ifp->if_opackets++;
-		if (sc->dc_cdata.dc_tx_chain[idx] != NULL) {
-			bus_dmamap_sync(sc->dc_mtag,
-			    sc->dc_cdata.dc_tx_map[idx],
-			    BUS_DMASYNC_POSTWRITE);
-			bus_dmamap_unload(sc->dc_mtag,
-			    sc->dc_cdata.dc_tx_map[idx]);
-			m_freem(sc->dc_cdata.dc_tx_chain[idx]);
-			sc->dc_cdata.dc_tx_chain[idx] = NULL;
-		}
-
-		sc->dc_cdata.dc_tx_cnt--;
-		DC_INC(idx, DC_TX_LIST_CNT);
-	}
-
-	if (idx != sc->dc_cdata.dc_tx_cons) {
-	    	/* Some buffers have been freed. */
-		sc->dc_cdata.dc_tx_cons = idx;
-		ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
-	}
-	ifp->if_timer = (sc->dc_cdata.dc_tx_cnt == 0) ? 0 : 5;
-}
-
-static void
-dc_tick(void *xsc)
-{
-	struct dc_softc *sc;
-	struct mii_data *mii;
-	struct ifnet *ifp;
-	u_int32_t r;
-
-	sc = xsc;
-	DC_LOCK_ASSERT(sc);
-	ifp = sc->dc_ifp;
-	mii = device_get_softc(sc->dc_miibus);
-
-	if (sc->dc_flags & DC_REDUCED_MII_POLL) {
-		if (sc->dc_flags & DC_21143_NWAY) {
-			r = CSR_READ_4(sc, DC_10BTSTAT);
-			if (IFM_SUBTYPE(mii->mii_media_active) ==
-			    IFM_100_TX && (r & DC_TSTAT_LS100)) {
-				sc->dc_link = 0;
-				mii_mediachg(mii);
-			}
-			if (IFM_SUBTYPE(mii->mii_media_active) ==
-			    IFM_10_T && (r & DC_TSTAT_LS10)) {
-				sc->dc_link = 0;
-				mii_mediachg(mii);
-			}
-			if (sc->dc_link == 0)
-				mii_tick(mii);
-		} else {
-			r = CSR_READ_4(sc, DC_ISR);
-			if ((r & DC_ISR_RX_STATE) == DC_RXSTATE_WAIT &&
-			    sc->dc_cdata.dc_tx_cnt == 0) {
-				mii_tick(mii);
-				if (!(mii->mii_media_status & IFM_ACTIVE))
-					sc->dc_link = 0;
-			}
-		}
-	} else
-		mii_tick(mii);
-
-	/*
-	 * When the init routine completes, we expect to be able to send
-	 * packets right away, and in fact the network code will send a
-	 * gratuitous ARP the moment the init routine marks the interface
-	 * as running. However, even though the MAC may have been initialized,
-	 * there may be a delay of a few seconds before the PHY completes
-	 * autonegotiation and the link is brought up. Any transmissions
-	 * made during that delay will be lost. Dealing with this is tricky:
-	 * we can't just pause in the init routine while waiting for the
-	 * PHY to come ready since that would bring the whole system to
-	 * a screeching halt for several seconds.
-	 *
-	 * What we do here is prevent the TX start routine from sending
-	 * any packets until a link has been established. After the
-	 * interface has been initialized, the tick routine will poll
-	 * the state of the PHY until the IFM_ACTIVE flag is set. Until
-	 * that time, packets will stay in the send queue, and once the
-	 * link comes up, they will be flushed out to the wire.
-	 */
-	if (!sc->dc_link && mii->mii_media_status & IFM_ACTIVE &&
-	    IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) {
-		sc->dc_link++;
-		if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
-			dc_start_locked(ifp);
-	}
-
-	if (sc->dc_flags & DC_21143_NWAY && !sc->dc_link)
-		callout_reset(&sc->dc_stat_ch, hz/10, dc_tick, sc);
-	else
-		callout_reset(&sc->dc_stat_ch, hz, dc_tick, sc);
-}
-
-/*
- * A transmit underrun has occurred.  Back off the transmit threshold,
- * or switch to store and forward mode if we have to.
- */
-static void
-dc_tx_underrun(struct dc_softc *sc)
-{
-	u_int32_t isr;
-	int i;
-
-	if (DC_IS_DAVICOM(sc))
-		dc_init_locked(sc);
-
-	if (DC_IS_INTEL(sc)) {
-		/*
-		 * The real 21143 requires that the transmitter be idle
-		 * in order to change the transmit threshold or store
-		 * and forward state.
-		 */
-		DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_TX_ON);
-
-		for (i = 0; i < DC_TIMEOUT; i++) {
-			isr = CSR_READ_4(sc, DC_ISR);
-			if (isr & DC_ISR_TX_IDLE)
-				break;
-			DELAY(10);
-		}
-		if (i == DC_TIMEOUT) {
-			if_printf(sc->dc_ifp,
-			    "failed to force tx to idle state\n");
-			dc_init_locked(sc);
-		}
-	}
-
-	if_printf(sc->dc_ifp, "TX underrun -- ");
-	sc->dc_txthresh += DC_TXTHRESH_INC;
-	if (sc->dc_txthresh > DC_TXTHRESH_MAX) {
-		printf("using store and forward mode\n");
-		DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_STORENFWD);
-	} else {
-		printf("increasing TX threshold\n");
-		DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_TX_THRESH);
-		DC_SETBIT(sc, DC_NETCFG, sc->dc_txthresh);
-	}
-
-	if (DC_IS_INTEL(sc))
-		DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_TX_ON);
-}
-
-#ifdef DEVICE_POLLING
-static poll_handler_t dc_poll;
-
-static void
-dc_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
-{
-	struct dc_softc *sc = ifp->if_softc;
-
-	DC_LOCK(sc);
-
-	if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
-		DC_UNLOCK(sc);
-		return;
-	}
-
-	sc->rxcycles = count;
-	dc_rxeof(sc);
-	dc_txeof(sc);
-	if (!IFQ_IS_EMPTY(&ifp->if_snd) &&
-	    !(ifp->if_drv_flags & IFF_DRV_OACTIVE))
-		dc_start_locked(ifp);
-
-	if (cmd == POLL_AND_CHECK_STATUS) { /* also check status register */
-		u_int32_t	status;
-
-		status = CSR_READ_4(sc, DC_ISR);
-		status &= (DC_ISR_RX_WATDOGTIMEO | DC_ISR_RX_NOBUF |
-			DC_ISR_TX_NOBUF | DC_ISR_TX_IDLE | DC_ISR_TX_UNDERRUN |
-			DC_ISR_BUS_ERR);
-		if (!status) {
-			DC_UNLOCK(sc);
-			return;
-		}
-		/* ack what we have */
-		CSR_WRITE_4(sc, DC_ISR, status);
-
-		if (status & (DC_ISR_RX_WATDOGTIMEO | DC_ISR_RX_NOBUF)) {
-			u_int32_t r = CSR_READ_4(sc, DC_FRAMESDISCARDED);
-			ifp->if_ierrors += (r & 0xffff) + ((r >> 17) & 0x7ff);
-
-			if (dc_rx_resync(sc))
-				dc_rxeof(sc);
-		}
-		/* restart transmit unit if necessary */
-		if (status & DC_ISR_TX_IDLE && sc->dc_cdata.dc_tx_cnt)
-			CSR_WRITE_4(sc, DC_TXSTART, 0xFFFFFFFF);
-
-		if (status & DC_ISR_TX_UNDERRUN)
-			dc_tx_underrun(sc);
-
-		if (status & DC_ISR_BUS_ERR) {
-			if_printf(ifp, "dc_poll: bus error\n");
-			dc_reset(sc);
-			dc_init_locked(sc);
-		}
-	}
-	DC_UNLOCK(sc);
-}
-#endif /* DEVICE_POLLING */
-
-static void
-dc_intr(void *arg)
-{
-	struct dc_softc *sc;
-	struct ifnet *ifp;
-	u_int32_t status;
-
-	sc = arg;
-
-	if (sc->suspended)
-		return;
-
-	if ((CSR_READ_4(sc, DC_ISR) & DC_INTRS) == 0)
-		return;
-
-	DC_LOCK(sc);
-	ifp = sc->dc_ifp;
-#ifdef DEVICE_POLLING
-	if (ifp->if_capenable & IFCAP_POLLING) {
-		DC_UNLOCK(sc);
-		return;
-	}
-#endif
-
-	/* Suppress unwanted interrupts */
-	if (!(ifp->if_flags & IFF_UP)) {
-		if (CSR_READ_4(sc, DC_ISR) & DC_INTRS)
-			dc_stop(sc);
-		DC_UNLOCK(sc);
-		return;
-	}
-
-	/* Disable interrupts. */
-	CSR_WRITE_4(sc, DC_IMR, 0x00000000);
-
-	while (((status = CSR_READ_4(sc, DC_ISR)) & DC_INTRS) &&
-	    status != 0xFFFFFFFF &&
-	    (ifp->if_drv_flags & IFF_DRV_RUNNING)) {
-
-		CSR_WRITE_4(sc, DC_ISR, status);
-
-		if (status & DC_ISR_RX_OK) {
-			int		curpkts;
-			curpkts = ifp->if_ipackets;
-			dc_rxeof(sc);
-			if (curpkts == ifp->if_ipackets) {
-				while (dc_rx_resync(sc))
-					dc_rxeof(sc);
-			}
-		}
-
-		if (status & (DC_ISR_TX_OK | DC_ISR_TX_NOBUF))
-			dc_txeof(sc);
-
-		if (status & DC_ISR_TX_IDLE) {
-			dc_txeof(sc);
-			if (sc->dc_cdata.dc_tx_cnt) {
-				DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_TX_ON);
-				CSR_WRITE_4(sc, DC_TXSTART, 0xFFFFFFFF);
-			}
-		}
-
-		if (status & DC_ISR_TX_UNDERRUN)
-			dc_tx_underrun(sc);
-
-		if ((status & DC_ISR_RX_WATDOGTIMEO)
-		    || (status & DC_ISR_RX_NOBUF)) {
-			int		curpkts;
-			curpkts = ifp->if_ipackets;
-			dc_rxeof(sc);
-			if (curpkts == ifp->if_ipackets) {
-				while (dc_rx_resync(sc))
-					dc_rxeof(sc);
-			}
-		}
-
-		if (status & DC_ISR_BUS_ERR) {
-			dc_reset(sc);
-			dc_init_locked(sc);
-		}
-	}
-
-	/* Re-enable interrupts. */
-	CSR_WRITE_4(sc, DC_IMR, DC_INTRS);
-
-	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
-		dc_start_locked(ifp);
-
-	DC_UNLOCK(sc);
-}
-
-static void
-dc_dma_map_txbuf(arg, segs, nseg, mapsize, error)
-	void *arg;
-	bus_dma_segment_t *segs;
-	int nseg;
-	bus_size_t mapsize;
-	int error;
-{
-	struct dc_softc *sc;
-	struct dc_desc *f;
-	int cur, first, frag, i;
-
-	sc = arg;
-	if (error) {
-		sc->dc_cdata.dc_tx_err = error;
-		return;
-	}
-
-	first = cur = frag = sc->dc_cdata.dc_tx_prod;
-	for (i = 0; i < nseg; i++) {
-		if ((sc->dc_flags & DC_TX_ADMTEK_WAR) &&
-		    (frag == (DC_TX_LIST_CNT - 1)) &&
-		    (first != sc->dc_cdata.dc_tx_first)) {
-			bus_dmamap_unload(sc->dc_mtag,
-			    sc->dc_cdata.dc_tx_map[first]);
-			sc->dc_cdata.dc_tx_err = ENOBUFS;
-			return;
-		}
-
-		f = &sc->dc_ldata->dc_tx_list[frag];
-		f->dc_ctl = htole32(DC_TXCTL_TLINK | segs[i].ds_len);
-		if (i == 0) {
-			f->dc_status = 0;
-			f->dc_ctl |= htole32(DC_TXCTL_FIRSTFRAG);
-		} else
-			f->dc_status = htole32(DC_TXSTAT_OWN);
-		f->dc_data = htole32(segs[i].ds_addr);
-		cur = frag;
-		DC_INC(frag, DC_TX_LIST_CNT);
-	}
-
-	sc->dc_cdata.dc_tx_err = 0;
-	sc->dc_cdata.dc_tx_prod = frag;
-	sc->dc_cdata.dc_tx_cnt += nseg;
-	sc->dc_ldata->dc_tx_list[cur].dc_ctl |= htole32(DC_TXCTL_LASTFRAG);
-	sc->dc_cdata.dc_tx_chain[cur] = sc->dc_cdata.dc_tx_mapping;
-	if (sc->dc_flags & DC_TX_INTR_FIRSTFRAG)
-		sc->dc_ldata->dc_tx_list[first].dc_ctl |=
-		    htole32(DC_TXCTL_FINT);
-	if (sc->dc_flags & DC_TX_INTR_ALWAYS)
-		sc->dc_ldata->dc_tx_list[cur].dc_ctl |= htole32(DC_TXCTL_FINT);
-	if (sc->dc_flags & DC_TX_USE_TX_INTR && sc->dc_cdata.dc_tx_cnt > 64)
-		sc->dc_ldata->dc_tx_list[cur].dc_ctl |= htole32(DC_TXCTL_FINT);
-	sc->dc_ldata->dc_tx_list[first].dc_status = htole32(DC_TXSTAT_OWN);
-}
-
-/*
- * Encapsulate an mbuf chain in a descriptor by coupling the mbuf data
- * pointers to the fragment pointers.
- */
-static int
-dc_encap(struct dc_softc *sc, struct mbuf **m_head)
-{
-	struct mbuf *m;
-	int error, idx, chainlen = 0;
-
-	/*
-	 * If there's no way we can send any packets, return now.
-	 */
-	if (DC_TX_LIST_CNT - sc->dc_cdata.dc_tx_cnt < 6)
-		return (ENOBUFS);
-
-	/*
-	 * Count the number of frags in this chain to see if
-	 * we need to m_defrag.  Since the descriptor list is shared
-	 * by all packets, we'll m_defrag long chains so that they
-	 * do not use up the entire list, even if they would fit.
-	 */
-	for (m = *m_head; m != NULL; m = m->m_next)
-		chainlen++;
-
-	if ((chainlen > DC_TX_LIST_CNT / 4) ||
-	    ((DC_TX_LIST_CNT - (chainlen + sc->dc_cdata.dc_tx_cnt)) < 6)) {
-		m = m_defrag(*m_head, M_DONTWAIT);
-		if (m == NULL)
-			return (ENOBUFS);
-		*m_head = m;
-	}
-
-	/*
-	 * Start packing the mbufs in this chain into
-	 * the fragment pointers. Stop when we run out
-	 * of fragments or hit the end of the mbuf chain.
-	 */
-	idx = sc->dc_cdata.dc_tx_prod;
-	sc->dc_cdata.dc_tx_mapping = *m_head;
-	error = bus_dmamap_load_mbuf(sc->dc_mtag, sc->dc_cdata.dc_tx_map[idx],
-	    *m_head, dc_dma_map_txbuf, sc, 0);
-	if (error)
-		return (error);
-	if (sc->dc_cdata.dc_tx_err != 0)
-		return (sc->dc_cdata.dc_tx_err);
-	bus_dmamap_sync(sc->dc_mtag, sc->dc_cdata.dc_tx_map[idx],
-	    BUS_DMASYNC_PREWRITE);
-	bus_dmamap_sync(sc->dc_ltag, sc->dc_lmap,
-	    BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
-	return (0);
-}
-
-/*
- * Main transmit routine. To avoid having to do mbuf copies, we put pointers
- * to the mbuf data regions directly in the transmit lists. We also save a
- * copy of the pointers since the transmit list fragment pointers are
- * physical addresses.
- */
-
-static void
-dc_start(struct ifnet *ifp)
-{
-	struct dc_softc *sc;
-
-	sc = ifp->if_softc;
-	DC_LOCK(sc);
-	dc_start_locked(ifp);
-	DC_UNLOCK(sc);
-}
-
-static void
-dc_start_locked(struct ifnet *ifp)
-{
-	struct dc_softc *sc;
-	struct mbuf *m_head = NULL, *m;
-	unsigned int queued = 0;
-	int idx;
-
-	sc = ifp->if_softc;
-
-	DC_LOCK_ASSERT(sc);
-
-	if (!sc->dc_link && ifp->if_snd.ifq_len < 10)
-		return;
-
-	if (ifp->if_drv_flags & IFF_DRV_OACTIVE)
-		return;
-
-	idx = sc->dc_cdata.dc_tx_first = sc->dc_cdata.dc_tx_prod;
-
-	while (sc->dc_cdata.dc_tx_chain[idx] == NULL) {
-		IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
-		if (m_head == NULL)
-			break;
-
-		if (sc->dc_flags & DC_TX_COALESCE &&
-		    (m_head->m_next != NULL ||
-		     sc->dc_flags & DC_TX_ALIGN)) {
-			m = m_defrag(m_head, M_DONTWAIT);
-			if (m == NULL) {
-				IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
-				ifp->if_drv_flags |= IFF_DRV_OACTIVE;
-				break;
-			} else {
-				m_head = m;
-			}
-		}
-
-		if (dc_encap(sc, &m_head)) {
-			IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
-			ifp->if_drv_flags |= IFF_DRV_OACTIVE;
-			break;
-		}
-		idx = sc->dc_cdata.dc_tx_prod;
-
-		queued++;
-		/*
-		 * If there's a BPF listener, bounce a copy of this frame
-		 * to him.
-		 */
-		BPF_MTAP(ifp, m_head);
-
-		if (sc->dc_flags & DC_TX_ONE) {
-			ifp->if_drv_flags |= IFF_DRV_OACTIVE;
-			break;
-		}
-	}
-
-	if (queued > 0) {
-		/* Transmit */
-		if (!(sc->dc_flags & DC_TX_POLL))
-			CSR_WRITE_4(sc, DC_TXSTART, 0xFFFFFFFF);
-
-		/*
-		 * Set a timeout in case the chip goes out to lunch.
-		 */
-		ifp->if_timer = 5;
-	}
-}
-
-static void
-dc_init(void *xsc)
-{
-	struct dc_softc *sc = xsc;
-
-	DC_LOCK(sc);
-	dc_init_locked(sc);
-#ifdef SRM_MEDIA
-	if(sc->dc_srm_media) {
-		struct ifreq ifr;
-		struct mii_data *mii;
-
-		ifr.ifr_media = sc->dc_srm_media;
-		sc->dc_srm_media = 0;
-		DC_UNLOCK(sc);
-		mii = device_get_softc(sc->dc_miibus);
-		ifmedia_ioctl(sc->dc_ifp, &ifr, &mii->mii_media, SIOCSIFMEDIA);
-	} else
-#endif
-		DC_UNLOCK(sc);
-}
-
-static void
-dc_init_locked(struct dc_softc *sc)
-{
-	struct ifnet *ifp = sc->dc_ifp;
-	struct mii_data *mii;
-
-	DC_LOCK_ASSERT(sc);
-
-	mii = device_get_softc(sc->dc_miibus);
-
-	/*
-	 * Cancel pending I/O and free all RX/TX buffers.
-	 */
-	dc_stop(sc);
-	dc_reset(sc);
-
-	/*
-	 * Set cache alignment and burst length.
-	 */
-	if (DC_IS_ASIX(sc) || DC_IS_DAVICOM(sc))
-		CSR_WRITE_4(sc, DC_BUSCTL, 0);
-	else
-		CSR_WRITE_4(sc, DC_BUSCTL, DC_BUSCTL_MRME | DC_BUSCTL_MRLE);
-	/*
-	 * Evenly share the bus between receive and transmit process.
-	 */
-	if (DC_IS_INTEL(sc))
-		DC_SETBIT(sc, DC_BUSCTL, DC_BUSCTL_ARBITRATION);
-	if (DC_IS_DAVICOM(sc) || DC_IS_INTEL(sc)) {
-		DC_SETBIT(sc, DC_BUSCTL, DC_BURSTLEN_USECA);
-	} else {
-		DC_SETBIT(sc, DC_BUSCTL, DC_BURSTLEN_16LONG);
-	}
-	if (sc->dc_flags & DC_TX_POLL)
-		DC_SETBIT(sc, DC_BUSCTL, DC_TXPOLL_1);
-	switch(sc->dc_cachesize) {
-	case 32:
-		DC_SETBIT(sc, DC_BUSCTL, DC_CACHEALIGN_32LONG);
-		break;
-	case 16:
-		DC_SETBIT(sc, DC_BUSCTL, DC_CACHEALIGN_16LONG);
-		break;
-	case 8:
-		DC_SETBIT(sc, DC_BUSCTL, DC_CACHEALIGN_8LONG);
-		break;
-	case 0:
-	default:
-		DC_SETBIT(sc, DC_BUSCTL, DC_CACHEALIGN_NONE);
-		break;
-	}
-
-	if (sc->dc_flags & DC_TX_STORENFWD)
-		DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_STORENFWD);
-	else {
-		if (sc->dc_txthresh > DC_TXTHRESH_MAX) {
-			DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_STORENFWD);
-		} else {
-			DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_STORENFWD);
-			DC_SETBIT(sc, DC_NETCFG, sc->dc_txthresh);
-		}
-	}
-
-	DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_NO_RXCRC);
-	DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_TX_BACKOFF);
-
-	if (DC_IS_MACRONIX(sc) || DC_IS_PNICII(sc)) {
-		/*
-		 * The app notes for the 98713 and 98715A say that
-		 * in order to have the chips operate properly, a magic
-		 * number must be written to CSR16. Macronix does not
-		 * document the meaning of these bits so there's no way
-		 * to know exactly what they do. The 98713 has a magic
-		 * number all its own; the rest all use a different one.
-		 */
-		DC_CLRBIT(sc, DC_MX_MAGICPACKET, 0xFFFF0000);
-		if (sc->dc_type == DC_TYPE_98713)
-			DC_SETBIT(sc, DC_MX_MAGICPACKET, DC_MX_MAGIC_98713);
-		else
-			DC_SETBIT(sc, DC_MX_MAGICPACKET, DC_MX_MAGIC_98715);
-	}
-
-	if (DC_IS_XIRCOM(sc)) {
-		/*
-		 * setup General Purpose Port mode and data so the tulip
-		 * can talk to the MII.
-		 */
-		CSR_WRITE_4(sc, DC_SIAGP, DC_SIAGP_WRITE_EN | DC_SIAGP_INT1_EN |
-			   DC_SIAGP_MD_GP2_OUTPUT | DC_SIAGP_MD_GP0_OUTPUT);
-		DELAY(10);
-		CSR_WRITE_4(sc, DC_SIAGP, DC_SIAGP_INT1_EN |
-			   DC_SIAGP_MD_GP2_OUTPUT | DC_SIAGP_MD_GP0_OUTPUT);
-		DELAY(10);
-	}
-
-	DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_TX_THRESH);
-	DC_SETBIT(sc, DC_NETCFG, DC_TXTHRESH_MIN);
-
-	/* Init circular RX list. */
-	if (dc_list_rx_init(sc) == ENOBUFS) {
-		if_printf(ifp,
-		    "initialization failed: no memory for rx buffers\n");
-		dc_stop(sc);
-		return;
-	}
-
-	/*
-	 * Init TX descriptors.
-	 */
-	dc_list_tx_init(sc);
-
-	/*
-	 * Load the address of the RX list.
-	 */
-	CSR_WRITE_4(sc, DC_RXADDR, DC_RXDESC(sc, 0));
-	CSR_WRITE_4(sc, DC_TXADDR, DC_TXDESC(sc, 0));
-
-	/*
-	 * Enable interrupts.
-	 */
-#ifdef DEVICE_POLLING
-	/*
-	 * ... but only if we are not polling, and make sure they are off in
-	 * the case of polling. Some cards (e.g. fxp) turn interrupts on
-	 * after a reset.
-	 */
-	if (ifp->if_capenable & IFCAP_POLLING)
-		CSR_WRITE_4(sc, DC_IMR, 0x00000000);
-	else
-#endif
-	CSR_WRITE_4(sc, DC_IMR, DC_INTRS);
-	CSR_WRITE_4(sc, DC_ISR, 0xFFFFFFFF);
-
-	/* Enable transmitter. */
-	DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_TX_ON);
-
-	/*
-	 * If this is an Intel 21143 and we're not using the
-	 * MII port, program the LED control pins so we get
-	 * link and activity indications.
-	 */
-	if (sc->dc_flags & DC_TULIP_LEDS) {
-		CSR_WRITE_4(sc, DC_WATCHDOG,
-		    DC_WDOG_CTLWREN | DC_WDOG_LINK | DC_WDOG_ACTIVITY);
-		CSR_WRITE_4(sc, DC_WATCHDOG, 0);
-	}
-
-	/*
-	 * Load the RX/multicast filter. We do this sort of late
-	 * because the filter programming scheme on the 21143 and
-	 * some clones requires DMAing a setup frame via the TX
-	 * engine, and we need the transmitter enabled for that.
-	 */
-	dc_setfilt(sc);
-
-	/* Enable receiver. */
-	DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_ON);
-	CSR_WRITE_4(sc, DC_RXSTART, 0xFFFFFFFF);
-
-	mii_mediachg(mii);
-	dc_setcfg(sc, sc->dc_if_media);
-
-	ifp->if_drv_flags |= IFF_DRV_RUNNING;
-	ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
-
-	/* Don't start the ticker if this is a homePNA link. */
-	if (IFM_SUBTYPE(mii->mii_media.ifm_media) == IFM_HPNA_1)
-		sc->dc_link = 1;
-	else {
-		if (sc->dc_flags & DC_21143_NWAY)
-			callout_reset(&sc->dc_stat_ch, hz/10, dc_tick, sc);
-		else
-			callout_reset(&sc->dc_stat_ch, hz, dc_tick, sc);
-	}
-}
-
-/*
- * Set media options.
- */
-static int
-dc_ifmedia_upd(struct ifnet *ifp)
-{
-	struct dc_softc *sc;
-	struct mii_data *mii;
-	struct ifmedia *ifm;
-
-	sc = ifp->if_softc;
-	mii = device_get_softc(sc->dc_miibus);
-	DC_LOCK(sc);
-	mii_mediachg(mii);
-	ifm = &mii->mii_media;
-
-	if (DC_IS_DAVICOM(sc) &&
-	    IFM_SUBTYPE(ifm->ifm_media) == IFM_HPNA_1)
-		dc_setcfg(sc, ifm->ifm_media);
-	else
-		sc->dc_link = 0;
-	DC_UNLOCK(sc);
-
-	return (0);
-}
-
-/*
- * Report current media status.
- */
-static void
-dc_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
-{
-	struct dc_softc *sc;
-	struct mii_data *mii;
-	struct ifmedia *ifm;
-
-	sc = ifp->if_softc;
-	mii = device_get_softc(sc->dc_miibus);
-	DC_LOCK(sc);
-	mii_pollstat(mii);
-	ifm = &mii->mii_media;
-	if (DC_IS_DAVICOM(sc)) {
-		if (IFM_SUBTYPE(ifm->ifm_media) == IFM_HPNA_1) {
-			ifmr->ifm_active = ifm->ifm_media;
-			ifmr->ifm_status = 0;
-			return;
-		}
-	}
-	ifmr->ifm_active = mii->mii_media_active;
-	ifmr->ifm_status = mii->mii_media_status;
-	DC_UNLOCK(sc);
-}
-
-static int
-dc_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
-{
-	struct dc_softc *sc = ifp->if_softc;
-	struct ifreq *ifr = (struct ifreq *)data;
-	struct mii_data *mii;
-	int error = 0;
-
-	switch (command) {
-	case SIOCSIFFLAGS:
-		DC_LOCK(sc);
-		if (ifp->if_flags & IFF_UP) {
-			int need_setfilt = (ifp->if_flags ^ sc->dc_if_flags) &
-				(IFF_PROMISC | IFF_ALLMULTI);
-
-			if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
-				if (need_setfilt)
-					dc_setfilt(sc);
-			} else {
-				sc->dc_txthresh = 0;
-				dc_init_locked(sc);
-			}
-		} else {
-			if (ifp->if_drv_flags & IFF_DRV_RUNNING)
-				dc_stop(sc);
-		}
-		sc->dc_if_flags = ifp->if_flags;
-		DC_UNLOCK(sc);
-		error = 0;
-		break;
-	case SIOCADDMULTI:
-	case SIOCDELMULTI:
-		DC_LOCK(sc);
-		dc_setfilt(sc);
-		DC_UNLOCK(sc);
-		error = 0;
-		break;
-	case SIOCGIFMEDIA:
-	case SIOCSIFMEDIA:
-		mii = device_get_softc(sc->dc_miibus);
-		error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
-#ifdef SRM_MEDIA
-		DC_LOCK(sc);
-		if (sc->dc_srm_media)
-			sc->dc_srm_media = 0;
-		DC_UNLOCK(sc);
-#endif
-		break;
-	case SIOCSIFCAP:
-#ifdef DEVICE_POLLING
-		if (ifr->ifr_reqcap & IFCAP_POLLING &&
-		    !(ifp->if_capenable & IFCAP_POLLING)) {
-			error = ether_poll_register(dc_poll, ifp);
-			if (error)
-				return(error);
-			DC_LOCK(sc);
-			/* Disable interrupts */
-			CSR_WRITE_4(sc, DC_IMR, 0x00000000);
-			ifp->if_capenable |= IFCAP_POLLING;
-			DC_UNLOCK(sc);
-			return (error);
-			
-		}
-		if (!(ifr->ifr_reqcap & IFCAP_POLLING) &&
-		    ifp->if_capenable & IFCAP_POLLING) {
-			error = ether_poll_deregister(ifp);
-			/* Enable interrupts. */
-			DC_LOCK(sc);
-			CSR_WRITE_4(sc, DC_IMR, DC_INTRS);
-			ifp->if_capenable &= ~IFCAP_POLLING;
-			DC_UNLOCK(sc);
-			return (error);
-		}
-#endif /* DEVICE_POLLING */
-		break;
-	default:
-		error = ether_ioctl(ifp, command, data);
-		break;
-	}
-
-	return (error);
-}
-
-static void
-dc_watchdog(struct ifnet *ifp)
-{
-	struct dc_softc *sc;
-
-	sc = ifp->if_softc;
-
-	DC_LOCK(sc);
-
-	ifp->if_oerrors++;
-	if_printf(ifp, "watchdog timeout\n");
-
-	dc_stop(sc);
-	dc_reset(sc);
-	dc_init_locked(sc);
-
-	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
-		dc_start_locked(ifp);
-
-	DC_UNLOCK(sc);
-}
-
-/*
- * Stop the adapter and free any mbufs allocated to the
- * RX and TX lists.
- */
-static void
-dc_stop(struct dc_softc *sc)
-{
-	struct ifnet *ifp;
-	struct dc_list_data *ld;
-	struct dc_chain_data *cd;
-	int i;
-	u_int32_t ctl;
-
-	DC_LOCK_ASSERT(sc);
-
-	ifp = sc->dc_ifp;
-	ifp->if_timer = 0;
-	ld = sc->dc_ldata;
-	cd = &sc->dc_cdata;
-
-	callout_stop(&sc->dc_stat_ch);
-
-	ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
-
-	DC_CLRBIT(sc, DC_NETCFG, (DC_NETCFG_RX_ON | DC_NETCFG_TX_ON));
-	CSR_WRITE_4(sc, DC_IMR, 0x00000000);
-	CSR_WRITE_4(sc, DC_TXADDR, 0x00000000);
-	CSR_WRITE_4(sc, DC_RXADDR, 0x00000000);
-	sc->dc_link = 0;
-
-	/*
-	 * Free data in the RX lists.
-	 */
-	for (i = 0; i < DC_RX_LIST_CNT; i++) {
-		if (cd->dc_rx_chain[i] != NULL) {
-			m_freem(cd->dc_rx_chain[i]);
-			cd->dc_rx_chain[i] = NULL;
-		}
-	}
-	bzero(&ld->dc_rx_list, sizeof(ld->dc_rx_list));
-
-	/*
-	 * Free the TX list buffers.
-	 */
-	for (i = 0; i < DC_TX_LIST_CNT; i++) {
-		if (cd->dc_tx_chain[i] != NULL) {
-			ctl = le32toh(ld->dc_tx_list[i].dc_ctl);
-			if ((ctl & DC_TXCTL_SETUP) ||
-			    !(ctl & DC_TXCTL_LASTFRAG)) {
-				cd->dc_tx_chain[i] = NULL;
-				continue;
-			}
-			bus_dmamap_unload(sc->dc_mtag, cd->dc_tx_map[i]);
-			m_freem(cd->dc_tx_chain[i]);
-			cd->dc_tx_chain[i] = NULL;
-		}
-	}
-	bzero(&ld->dc_tx_list, sizeof(ld->dc_tx_list));
-}
-
-/*
- * Device suspend routine.  Stop the interface and save some PCI
- * settings in case the BIOS doesn't restore them properly on
- * resume.
- */
-static int
-dc_suspend(device_t dev)
-{
-	struct dc_softc *sc;
-
-	sc = device_get_softc(dev);
-	DC_LOCK(sc);
-	dc_stop(sc);
-	sc->suspended = 1;
-	DC_UNLOCK(sc);
-
-	return (0);
-}
-
-/*
- * Device resume routine.  Restore some PCI settings in case the BIOS
- * doesn't, re-enable busmastering, and restart the interface if
- * appropriate.
- */
-static int
-dc_resume(device_t dev)
-{
-	struct dc_softc *sc;
-	struct ifnet *ifp;
-
-	sc = device_get_softc(dev);
-	ifp = sc->dc_ifp;
-
-	/* reinitialize interface if necessary */
-	DC_LOCK(sc);
-	if (ifp->if_flags & IFF_UP)
-		dc_init_locked(sc);
-
-	sc->suspended = 0;
-	DC_UNLOCK(sc);
-
-	return (0);
-}
-
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-static void
-dc_shutdown(device_t dev)
-{
-	struct dc_softc *sc;
-
-	sc = device_get_softc(dev);
-
-	DC_LOCK(sc);
-	dc_stop(sc);
-	DC_UNLOCK(sc);
-}
--- /dev/null
+++ sys/pci/amdsmb.c
@@ -0,0 +1,563 @@
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/sys/pci/amdsmb.c,v 1.4 2007/01/11 19:56:24 jhb Exp $");
+
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/lock.h>
+#include <sys/module.h>
+#include <sys/mutex.h>
+#include <sys/systm.h>
+
+#include <machine/bus.h>
+#include <machine/resource.h>
+#include <sys/rman.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+
+#include <dev/smbus/smbconf.h>
+#include "smbus_if.h"
+
+#define	AMDSMB_DEBUG(x)	if (amdsmb_debug) (x)
+
+#ifdef DEBUG
+static int amdsmb_debug = 1;
+#else
+static int amdsmb_debug = 0;
+#endif
+
+#define	AMDSMB_VENDORID_AMD		0x1022
+#define	AMDSMB_DEVICEID_AMD8111_SMB2	0x746a
+
+/*
+ * ACPI 3.0, Chapter 12, Embedded Controller Interface.
+ */
+#define	EC_DATA		0x00	/* data register */
+#define	EC_SC		0x04	/* status of controller */
+#define	EC_CMD		0x04	/* command register */
+
+#define	EC_SC_IBF	0x02	/* data ready for embedded controller */
+#define	EC_SC_OBF	0x01	/* data ready for host */
+#define	EC_CMD_WR	0x81	/* write EC */
+#define	EC_CMD_RD	0x80	/* read EC */
+
+/*
+ * ACPI 3.0, Chapter 12, SMBus Host Controller Interface.
+ */
+#define	SMB_PRTCL	0x00	/* protocol */
+#define	SMB_STS		0x01	/* status */
+#define	SMB_ADDR	0x02	/* address */
+#define	SMB_CMD		0x03	/* command */
+#define	SMB_DATA	0x04	/* 32 data registers */
+#define	SMB_BCNT	0x24	/* number of data bytes */
+#define	SMB_ALRM_A	0x25	/* alarm address */
+#define	SMB_ALRM_D	0x26	/* 2 bytes alarm data */
+
+#define	SMB_STS_DONE	0x80
+#define	SMB_STS_ALRM	0x40
+#define	SMB_STS_RES	0x20
+#define	SMB_STS_STATUS	0x1f
+#define	SMB_STS_OK	0x00	/* OK */
+#define	SMB_STS_UF	0x07	/* Unknown Failure */
+#define	SMB_STS_DANA	0x10	/* Device Address Not Acknowledged */
+#define	SMB_STS_DED	0x11	/* Device Error Detected */
+#define	SMB_STS_DCAD	0x12	/* Device Command Access Denied */
+#define	SMB_STS_UE	0x13	/* Unknown Error */
+#define	SMB_STS_DAD	0x17	/* Device Access Denied */
+#define	SMB_STS_T	0x18	/* Timeout */
+#define	SMB_STS_HUP	0x19	/* Host Unsupported Protocol */
+#define	SMB_STS_B	0x1a	/* Busy */
+#define	SMB_STS_PEC	0x1f	/* PEC (CRC-8) Error */
+
+#define	SMB_PRTCL_WRITE			0x00
+#define	SMB_PRTCL_READ			0x01
+#define	SMB_PRTCL_QUICK			0x02
+#define	SMB_PRTCL_BYTE			0x04
+#define	SMB_PRTCL_BYTE_DATA		0x06
+#define	SMB_PRTCL_WORD_DATA		0x08
+#define	SMB_PRTCL_BLOCK_DATA		0x0a
+#define	SMB_PRTCL_PROC_CALL		0x0c
+#define	SMB_PRTCL_BLOCK_PROC_CALL	0x0d
+#define	SMB_PRTCL_PEC			0x80
+
+struct amdsmb_softc {
+	int rid;
+	struct resource *res;
+	bus_space_tag_t smbst;
+	bus_space_handle_t smbsh;
+	device_t smbus;
+	struct mtx lock;
+};
+
+#define	AMDSMB_LOCK(amdsmb)		mtx_lock(&(amdsmb)->lock)
+#define	AMDSMB_UNLOCK(amdsmb)		mtx_unlock(&(amdsmb)->lock)
+#define	AMDSMB_LOCK_ASSERT(amdsmb)	mtx_assert(&(amdsmb)->lock, MA_OWNED)
+
+#define	AMDSMB_ECINB(amdsmb, register)					\
+	(bus_space_read_1(amdsmb->smbst, amdsmb->smbsh, register))
+#define	AMDSMB_ECOUTB(amdsmb, register, value) \
+	(bus_space_write_1(amdsmb->smbst, amdsmb->smbsh, register, value))
+
+static int	amdsmb_detach(device_t dev);
+
+static int
+amdsmb_probe(device_t dev)
+{
+	u_int16_t vid;
+	u_int16_t did;
+
+	vid = pci_get_vendor(dev);
+	did = pci_get_device(dev);
+
+	if (vid == AMDSMB_VENDORID_AMD) {
+		switch(did) {
+		case AMDSMB_DEVICEID_AMD8111_SMB2:
+			device_set_desc(dev, "AMD-8111 SMBus 2.0 Controller");
+			return (BUS_PROBE_DEFAULT);
+		}
+	}
+
+	return (ENXIO);
+}
+
+static int
+amdsmb_attach(device_t dev)
+{
+	struct amdsmb_softc *amdsmb_sc = device_get_softc(dev);
+
+	/* Allocate I/O space */
+	amdsmb_sc->rid = PCIR_BAR(0);
+	
+	amdsmb_sc->res = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
+		&amdsmb_sc->rid, RF_ACTIVE);
+
+	if (amdsmb_sc->res == NULL) {
+		device_printf(dev, "could not map i/o space\n");
+		return (ENXIO);
+	}
+
+	amdsmb_sc->smbst = rman_get_bustag(amdsmb_sc->res);
+	amdsmb_sc->smbsh = rman_get_bushandle(amdsmb_sc->res);
+	mtx_init(&amdsmb_sc->lock, device_get_nameunit(dev), "amdsmb", MTX_DEF);
+
+	/* Allocate a new smbus device */
+	amdsmb_sc->smbus = device_add_child(dev, "smbus", -1);
+	if (!amdsmb_sc->smbus) {
+		amdsmb_detach(dev);
+		return (EINVAL);
+	}
+
+	bus_generic_attach(dev);
+
+	return (0);
+}
+
+static int
+amdsmb_detach(device_t dev)
+{
+	struct amdsmb_softc *amdsmb_sc = device_get_softc(dev);
+
+	if (amdsmb_sc->smbus) {
+		device_delete_child(dev, amdsmb_sc->smbus);
+		amdsmb_sc->smbus = NULL;
+	}
+
+	mtx_destroy(&amdsmb_sc->lock);
+	if (amdsmb_sc->res)
+		bus_release_resource(dev, SYS_RES_IOPORT, amdsmb_sc->rid,
+		    amdsmb_sc->res);
+
+	return (0);
+}
+
+static int
+amdsmb_callback(device_t dev, int index, void *data)
+{
+	int error = 0;
+
+	switch (index) {
+	case SMB_REQUEST_BUS:
+	case SMB_RELEASE_BUS:
+		break;
+	default:
+		error = EINVAL;
+	}
+
+	return (error);
+}
+
+static int
+amdsmb_ec_wait_write(struct amdsmb_softc *sc)
+{
+	int timeout = 500;
+
+	while (timeout-- && AMDSMB_ECINB(sc, EC_SC) & EC_SC_IBF)
+		DELAY(1);
+	if (timeout == 0) {
+		device_printf(sc->smbus, "timeout waiting for IBF to clear\n");
+		return (1);
+	}
+	return (0);
+}
+
+static int
+amdsmb_ec_wait_read(struct amdsmb_softc *sc)
+{
+	int timeout = 500;
+
+	while (timeout-- && ~AMDSMB_ECINB(sc, EC_SC) & EC_SC_OBF)
+		DELAY(1);
+	if (timeout == 0) {
+		device_printf(sc->smbus, "timeout waiting for OBF to set\n");
+		return (1);
+	}
+	return (0);
+}
+
+static int
+amdsmb_ec_read(struct amdsmb_softc *sc, u_char addr, u_char *data)
+{
+
+	AMDSMB_LOCK_ASSERT(sc);
+	if (amdsmb_ec_wait_write(sc))
+		return (1);
+	AMDSMB_ECOUTB(sc, EC_CMD, EC_CMD_RD);
+
+	if (amdsmb_ec_wait_write(sc))
+		return (1);
+	AMDSMB_ECOUTB(sc, EC_DATA, addr);
+
+	if (amdsmb_ec_wait_read(sc))
+		return (1);
+	*data = AMDSMB_ECINB(sc, EC_DATA);
+
+	return (0);
+}
+
+static int
+amdsmb_ec_write(struct amdsmb_softc *sc, u_char addr, u_char data)
+{
+
+	AMDSMB_LOCK_ASSERT(sc);
+	if (amdsmb_ec_wait_write(sc))
+		return (1);
+	AMDSMB_ECOUTB(sc, EC_CMD, EC_CMD_WR);
+
+	if (amdsmb_ec_wait_write(sc))
+		return (1);
+	AMDSMB_ECOUTB(sc, EC_DATA, addr);
+
+	if (amdsmb_ec_wait_write(sc))
+		return (1);
+	AMDSMB_ECOUTB(sc, EC_DATA, data);
+
+	return (0);
+}
+
+static int
+amdsmb_wait(struct amdsmb_softc *sc)
+{
+	u_char sts, temp;
+	int error, count;
+
+	AMDSMB_LOCK_ASSERT(sc);
+	amdsmb_ec_read(sc, SMB_PRTCL, &temp);
+	if (temp != 0)
+	{
+		count = 10000;
+		do {
+			DELAY(500);
+			amdsmb_ec_read(sc, SMB_PRTCL, &temp);
+		} while (temp != 0 && count--);
+		if (count == 0)
+			return (SMB_ETIMEOUT);
+	}
+
+	amdsmb_ec_read(sc, SMB_STS, &sts);
+	sts &= SMB_STS_STATUS;
+	AMDSMB_DEBUG(printf("amdsmb: STS=0x%x\n", sts));
+
+	switch (sts) {
+	case SMB_STS_OK:
+		error = SMB_ENOERR;
+		break;
+	case SMB_STS_DANA:
+		error = SMB_ENOACK;
+		break;
+	case SMB_STS_B:
+		error = SMB_EBUSY;
+		break;
+	case SMB_STS_T:
+		error = SMB_ETIMEOUT;
+		break;
+	case SMB_STS_DCAD:
+	case SMB_STS_DAD:
+	case SMB_STS_HUP:
+		error = SMB_ENOTSUPP;
+		break;
+	default:
+		error = SMB_EBUSERR;
+		break;
+	}
+
+	return (error);
+}
+
+static int
+amdsmb_quick(device_t dev, u_char slave, int how)
+{
+	struct amdsmb_softc *sc = (struct amdsmb_softc *)device_get_softc(dev);
+	u_char protocol;
+	int error;
+
+	protocol = SMB_PRTCL_QUICK;
+
+	switch (how) {
+	case SMB_QWRITE:
+		protocol |= SMB_PRTCL_WRITE;
+		AMDSMB_DEBUG(printf("amdsmb: QWRITE to 0x%x", slave));
+		break;
+	case SMB_QREAD:
+		protocol |= SMB_PRTCL_READ;
+		AMDSMB_DEBUG(printf("amdsmb: QREAD to 0x%x", slave));
+		break;
+	default:
+		panic("%s: unknown QUICK command (%x)!", __func__, how);
+	}
+
+	AMDSMB_LOCK(sc);
+	amdsmb_ec_write(sc, SMB_ADDR, slave);
+	amdsmb_ec_write(sc, SMB_PRTCL, protocol);
+
+	error = amdsmb_wait(sc);
+
+	AMDSMB_DEBUG(printf(", error=0x%x\n", error));
+	AMDSMB_UNLOCK(sc);
+
+	return (error);
+}
+
+static int
+amdsmb_sendb(device_t dev, u_char slave, char byte)
+{
+	struct amdsmb_softc *sc = (struct amdsmb_softc *)device_get_softc(dev);
+	int error;
+
+	AMDSMB_LOCK(sc);
+	amdsmb_ec_write(sc, SMB_CMD, byte);
+	amdsmb_ec_write(sc, SMB_ADDR, slave);
+	amdsmb_ec_write(sc, SMB_PRTCL, SMB_PRTCL_WRITE | SMB_PRTCL_BYTE);
+
+	error = amdsmb_wait(sc);
+
+	AMDSMB_DEBUG(printf("amdsmb: SENDB to 0x%x, byte=0x%x, error=0x%x\n",
+	   slave, byte, error));
+	AMDSMB_UNLOCK(sc);
+
+	return (error);
+}
+
+static int
+amdsmb_recvb(device_t dev, u_char slave, char *byte)
+{
+	struct amdsmb_softc *sc = (struct amdsmb_softc *)device_get_softc(dev);
+	int error;
+
+	AMDSMB_LOCK(sc);
+	amdsmb_ec_write(sc, SMB_ADDR, slave);
+	amdsmb_ec_write(sc, SMB_PRTCL, SMB_PRTCL_READ | SMB_PRTCL_BYTE);
+
+	if ((error = amdsmb_wait(sc)) == SMB_ENOERR)
+		amdsmb_ec_read(sc, SMB_DATA, byte);
+
+	AMDSMB_DEBUG(printf("amdsmb: RECVB from 0x%x, byte=0x%x, error=0x%x\n",
+	    slave, *byte, error));
+	AMDSMB_UNLOCK(sc);
+
+	return (error);
+}
+
+static int
+amdsmb_writeb(device_t dev, u_char slave, char cmd, char byte)
+{
+	struct amdsmb_softc *sc = (struct amdsmb_softc *)device_get_softc(dev);
+	int error;
+
+	AMDSMB_LOCK(sc);
+	amdsmb_ec_write(sc, SMB_CMD, cmd);
+	amdsmb_ec_write(sc, SMB_DATA, byte);
+	amdsmb_ec_write(sc, SMB_ADDR, slave);
+	amdsmb_ec_write(sc, SMB_PRTCL, SMB_PRTCL_WRITE | SMB_PRTCL_BYTE_DATA);
+
+	error = amdsmb_wait(sc);
+
+	AMDSMB_DEBUG(printf("amdsmb: WRITEB to 0x%x, cmd=0x%x, byte=0x%x, "
+	    "error=0x%x\n", slave, cmd, byte, error));
+	AMDSMB_UNLOCK(sc);
+
+	return (error);
+}
+
+static int
+amdsmb_readb(device_t dev, u_char slave, char cmd, char *byte)
+{
+	struct amdsmb_softc *sc = (struct amdsmb_softc *)device_get_softc(dev);
+	int error;
+
+	AMDSMB_LOCK(sc);
+	amdsmb_ec_write(sc, SMB_CMD, cmd);
+	amdsmb_ec_write(sc, SMB_ADDR, slave);
+	amdsmb_ec_write(sc, SMB_PRTCL, SMB_PRTCL_READ | SMB_PRTCL_BYTE_DATA);
+
+	if ((error = amdsmb_wait(sc)) == SMB_ENOERR)
+		amdsmb_ec_read(sc, SMB_DATA, byte);
+
+	AMDSMB_DEBUG(printf("amdsmb: READB from 0x%x, cmd=0x%x, byte=0x%x, "
+	    "error=0x%x\n", slave, cmd, (unsigned char)*byte, error));
+	AMDSMB_UNLOCK(sc);
+
+	return (error);
+}
+
+static int
+amdsmb_writew(device_t dev, u_char slave, char cmd, short word)
+{
+	struct amdsmb_softc *sc = (struct amdsmb_softc *)device_get_softc(dev);
+	int error;
+
+	AMDSMB_LOCK(sc);
+	amdsmb_ec_write(sc, SMB_CMD, cmd);
+	amdsmb_ec_write(sc, SMB_DATA, word);
+	amdsmb_ec_write(sc, SMB_DATA + 1, word >> 8);
+	amdsmb_ec_write(sc, SMB_ADDR, slave);
+	amdsmb_ec_write(sc, SMB_PRTCL, SMB_PRTCL_WRITE | SMB_PRTCL_WORD_DATA);
+
+	error = amdsmb_wait(sc);
+
+	AMDSMB_DEBUG(printf("amdsmb: WRITEW to 0x%x, cmd=0x%x, word=0x%x, "
+	    "error=0x%x\n", slave, cmd, word, error));
+	AMDSMB_UNLOCK(sc);
+
+	return (error);
+}
+
+static int
+amdsmb_readw(device_t dev, u_char slave, char cmd, short *word)
+{
+	struct amdsmb_softc *sc = (struct amdsmb_softc *)device_get_softc(dev);
+	u_char temp[2];
+	int error;
+
+	AMDSMB_LOCK(sc);
+	amdsmb_ec_write(sc, SMB_CMD, cmd);
+	amdsmb_ec_write(sc, SMB_ADDR, slave);
+	amdsmb_ec_write(sc, SMB_PRTCL, SMB_PRTCL_READ | SMB_PRTCL_WORD_DATA);
+
+	if ((error = amdsmb_wait(sc)) == SMB_ENOERR) {
+		amdsmb_ec_read(sc, SMB_DATA + 0, &temp[0]);
+		amdsmb_ec_read(sc, SMB_DATA + 1, &temp[1]);
+		*word = temp[0] | (temp[1] << 8);
+	}
+
+	AMDSMB_DEBUG(printf("amdsmb: READW from 0x%x, cmd=0x%x, word=0x%x, "
+	    "error=0x%x\n", slave, cmd, (unsigned short)*word, error));
+	AMDSMB_UNLOCK(sc);
+
+	return (error);
+}
+
+static int
+amdsmb_bwrite(device_t dev, u_char slave, char cmd, u_char count, char *buf)
+{
+	struct amdsmb_softc *sc = (struct amdsmb_softc *)device_get_softc(dev);
+	u_char i;
+	int error;
+
+	if (count < 1 || count > 32)
+		return (SMB_EINVAL);
+
+	AMDSMB_LOCK(sc);
+	amdsmb_ec_write(sc, SMB_CMD, cmd);
+	amdsmb_ec_write(sc, SMB_BCNT, count);
+	for (i = 0; i < count; i++)
+		amdsmb_ec_write(sc, SMB_DATA + i, buf[i]);
+	amdsmb_ec_write(sc, SMB_ADDR, slave);
+	amdsmb_ec_write(sc, SMB_PRTCL, SMB_PRTCL_WRITE | SMB_PRTCL_BLOCK_DATA);
+
+	error = amdsmb_wait(sc);
+
+	AMDSMB_DEBUG(printf("amdsmb: WRITEBLK to 0x%x, count=0x%x, cmd=0x%x, "
+	    "error=0x%x", slave, count, cmd, error));
+	AMDSMB_UNLOCK(sc);
+
+	return (error);
+}
+
+static int
+amdsmb_bread(device_t dev, u_char slave, char cmd, u_char *count, char *buf)
+{
+	struct amdsmb_softc *sc = (struct amdsmb_softc *)device_get_softc(dev);
+	u_char data, len, i;
+	int error;
+
+	if (*count < 1 || *count > 32)
+		return (SMB_EINVAL);
+
+	AMDSMB_LOCK(sc);
+	amdsmb_ec_write(sc, SMB_CMD, cmd);
+	amdsmb_ec_write(sc, SMB_ADDR, slave);
+	amdsmb_ec_write(sc, SMB_PRTCL, SMB_PRTCL_READ | SMB_PRTCL_BLOCK_DATA);
+
+	if ((error = amdsmb_wait(sc)) == SMB_ENOERR) {
+		amdsmb_ec_read(sc, SMB_BCNT, &len);
+		for (i = 0; i < len; i++) {
+			amdsmb_ec_read(sc, SMB_DATA + i, &data);
+			if (i < *count)
+				buf[i] = data;
+		}
+		*count = len;
+	}
+
+	AMDSMB_DEBUG(printf("amdsmb: READBLK to 0x%x, count=0x%x, cmd=0x%x, "
+	    "error=0x%x", slave, *count, cmd, error));
+	AMDSMB_UNLOCK(sc);
+
+	return (error);
+}
+
+static device_method_t amdsmb_methods[] = {
+	/* Device interface */
+	DEVMETHOD(device_probe,		amdsmb_probe),
+	DEVMETHOD(device_attach,	amdsmb_attach),
+	DEVMETHOD(device_detach,	amdsmb_detach),
+
+	/* SMBus interface */
+	DEVMETHOD(smbus_callback,	amdsmb_callback),
+	DEVMETHOD(smbus_quick,		amdsmb_quick),
+	DEVMETHOD(smbus_sendb,		amdsmb_sendb),
+	DEVMETHOD(smbus_recvb,		amdsmb_recvb),
+	DEVMETHOD(smbus_writeb,		amdsmb_writeb),
+	DEVMETHOD(smbus_readb,		amdsmb_readb),
+	DEVMETHOD(smbus_writew,		amdsmb_writew),
+	DEVMETHOD(smbus_readw,		amdsmb_readw),
+	DEVMETHOD(smbus_bwrite,		amdsmb_bwrite),
+	DEVMETHOD(smbus_bread,		amdsmb_bread),
+
+	{ 0, 0 }
+};
+
+static devclass_t amdsmb_devclass;
+
+static driver_t amdsmb_driver = {
+	"amdsmb",
+	amdsmb_methods,
+	sizeof(struct amdsmb_softc),
+};
+
+DRIVER_MODULE(amdsmb, pci, amdsmb_driver, amdsmb_devclass, 0, 0);
+DRIVER_MODULE(smbus, amdsmb, smbus_driver, smbus_devclass, 0, 0);
+
+MODULE_DEPEND(amdsmb, pci, 1, 1, 1);
+MODULE_DEPEND(amdsmb, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER);
+MODULE_VERSION(amdsmb, 1);
--- sys/pci/if_tireg.h
+++ /dev/null
@@ -1,1072 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998, 1999
- *	Bill Paul <wpaul at ctr.columbia.edu>.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/pci/if_tireg.h,v 1.31 2005/06/10 16:49:23 brooks Exp $
- */
-
-/*
- * Tigon register offsets. These are memory mapped registers
- * which can be accessed with the CSR_READ_4()/CSR_WRITE_4() macros.
- * Each register must be accessed using 32 bit operations.
- *
- * All reegisters are accessed through a 16K shared memory block.
- * The first group of registers are actually copies of the PCI
- * configuration space registers.
- */
-
-#define TI_PCI_ID			0x000 /* PCI device/vendor ID */
-#define TI_PCI_CMDSTAT			0x004
-#define TI_PCI_CLASSCODE		0x008
-#define TI_PCI_BIST			0x00C
-#define TI_PCI_LOMEM			0x010 /* Shared memory base address */
-#define TI_PCI_SUBSYS			0x02C
-#define TI_PCI_ROMBASE			0x030
-#define TI_PCI_INT			0x03C
-
-#ifndef PCIM_CMD_MWIEN
-#define PCIM_CMD_MWIEN			0x0010
-#endif
-
-/*
- * Alteon AceNIC PCI vendor/device ID.
- */
-#define ALT_VENDORID			0x12AE
-#define ALT_DEVICEID_ACENIC		0x0001
-#define ALT_DEVICEID_ACENIC_COPPER	0x0002
-
-/*
- * 3Com 3c985 PCI vendor/device ID.
- */
-#define TC_VENDORID			0x10B7
-#define TC_DEVICEID_3C985		0x0001
-
-/*
- * Netgear GA620 PCI vendor/device ID.
- */
-#define NG_VENDORID			0x1385
-#define NG_DEVICEID_GA620		0x620A
-#define NG_DEVICEID_GA620T		0x630A
-
-/*
- * SGI device/vendor ID.
- */
-#define SGI_VENDORID			0x10A9
-#define SGI_DEVICEID_TIGON		0x0009
-
-/*
- * DEC vendor ID, Farallon device ID. Apparently, Farallon used
- * the DEC vendor ID in their cards by mistake.
- */
-#define DEC_VENDORID			0x1011
-#define DEC_DEVICEID_FARALLON_PN9000SX	0x001a
-
-/*
- * Tigon configuration and control registers.
- */
-#define TI_MISC_HOST_CTL		0x040
-#define TI_MISC_LOCAL_CTL		0x044
-#define TI_SEM_AB			0x048 /* Tigon 2 only */
-#define TI_MISC_CONF			0x050 /* Tigon 2 only */
-#define TI_TIMER_BITS			0x054
-#define TI_TIMERREF			0x058
-#define TI_PCI_STATE			0x05C
-#define TI_MAIN_EVENT_A			0x060
-#define TI_MAILBOX_EVENT_A		0x064
-#define TI_WINBASE			0x068
-#define TI_WINDATA			0x06C
-#define TI_MAIN_EVENT_B			0x070 /* Tigon 2 only */
-#define TI_MAILBOX_EVENT_B		0x074 /* Tigon 2 only */
-#define TI_TIMERREF_B			0x078 /* Tigon 2 only */
-#define TI_SERIAL			0x07C
-
-/*
- * Misc host control bits.
- */
-#define TI_MHC_INTSTATE			0x00000001
-#define TI_MHC_CLEARINT			0x00000002
-#define TI_MHC_RESET			0x00000008
-#define TI_MHC_BYTE_SWAP_ENB		0x00000010
-#define TI_MHC_WORD_SWAP_ENB		0x00000020
-#define TI_MHC_MASK_INTS		0x00000040
-#define TI_MHC_CHIP_REV_MASK		0xF0000000
-
-#define TI_MHC_BIGENDIAN_INIT	\
-	(TI_MHC_BYTE_SWAP_ENB|TI_MHC_WORD_SWAP_ENB|TI_MHC_CLEARINT)
-
-#define TI_MHC_LITTLEENDIAN_INIT	\
-	(TI_MHC_WORD_SWAP_ENB|TI_MHC_CLEARINT)
-
-/*
- * Tigon chip rev values. Rev 4 is the Tigon 1. Rev 6 is the Tigon 2.
- * Rev 5 is also the Tigon 2, but is a broken version which was never
- * used in any actual hardware, so we ignore it.
- */
-#define TI_REV_TIGON_I			0x40000000
-#define TI_REV_TIGON_II			0x60000000
-
-/*
- * Firmware revision that we want.
- */
-#define TI_FIRMWARE_MAJOR		0xc
-#define TI_FIRMWARE_MINOR		0x4
-#define TI_FIRMWARE_FIX			0xb
-
-/*
- * Miscelaneous Local Control register.
- */
-#define TI_MLC_EE_WRITE_ENB		0x00000010
-#define TI_MLC_SRAM_BANK_SIZE		0x00000300 /* Tigon 2 only */
-#define TI_MLC_LOCALADDR_21		0x00004000
-#define TI_MLC_LOCALADDR_22		0x00008000
-#define TI_MLC_SBUS_WRITEERR		0x00080000
-#define TI_MLC_EE_CLK			0x00100000
-#define TI_MLC_EE_TXEN			0x00200000
-#define TI_MLC_EE_DOUT			0x00400000
-#define TI_MLC_EE_DIN			0x00800000
-
-/* Possible memory sizes. */
-#define TI_MLC_SRAM_BANK_DISA           0x00000000
-#define TI_MLC_SRAM_BANK_1024K          0x00000100
-#define TI_MLC_SRAM_BANK_512K           0x00000200
-#define TI_MLC_SRAM_BANK_256K           0x00000300
-
-/*
- * Offset of MAC address inside EEPROM.
- */
-#define TI_EE_MAC_OFFSET		0x8c
-
-#define TI_DMA_ASSIST			0x11C
-#define TI_CPU_STATE			0x140
-#define TI_CPU_PROGRAM_COUNTER		0x144
-#define TI_SRAM_ADDR			0x154
-#define TI_SRAM_DATA			0x158
-#define TI_GEN_0			0x180
-#define TI_GEN_X			0x1FC
-#define TI_MAC_TX_STATE			0x200
-#define TI_MAC_RX_STATE			0x220
-#define TI_CPU_CTL_B			0x240 /* Tigon 2 only */
-#define TI_CPU_PROGRAM_COUNTER_B	0x244 /* Tigon 2 only */
-#define TI_SRAM_ADDR_B			0x254 /* Tigon 2 only */
-#define TI_SRAM_DATA_B			0x258 /* Tigon 2 only */
-#define TI_GEN_B_0			0x280 /* Tigon 2 only */
-#define TI_GEN_B_X			0x2FC /* Tigon 2 only */
-
-/*
- * Misc config register.
- */
-#define TI_MCR_SRAM_SYNCHRONOUS		0x00100000 /* Tigon 2 only */
-
-/*
- * PCI state register.
- */
-#define TI_PCISTATE_FORCE_RESET		0x00000001
-#define TI_PCISTATE_PROVIDE_LEN		0x00000002
-#define TI_PCISTATE_READ_MAXDMA		0x0000001C
-#define TI_PCISTATE_WRITE_MAXDMA	0x000000E0
-#define TI_PCISTATE_MINDMA		0x0000FF00
-#define TI_PCISTATE_FIFO_RETRY_ENB	0x00010000
-#define TI_PCISTATE_USE_MEM_RD_MULT	0x00020000
-#define TI_PCISTATE_NO_SWAP_READ_DMA	0x00040000
-#define TI_PCISTATE_NO_SWAP_WRITE_DMA	0x00080000
-#define TI_PCISTATE_66MHZ_BUS		0x00080000 /* Tigon 2 only */
-#define TI_PCISTATE_32BIT_BUS		0x00100000 /* Tigon 2 only */
-#define TI_PCISTATE_ENB_BYTE_ENABLES	0x00800000 /* Tigon 2 only */
-#define TI_PCISTATE_READ_CMD		0x0F000000
-#define TI_PCISTATE_WRITE_CMD		0xF0000000
-
-#define TI_PCI_READMAX_4		0x04
-#define TI_PCI_READMAX_16		0x08
-#define TI_PCI_READMAX_32		0x0C
-#define TI_PCI_READMAX_64		0x10
-#define TI_PCI_READMAX_128		0x14
-#define TI_PCI_READMAX_256		0x18
-#define TI_PCI_READMAX_1024		0x1C
-
-#define TI_PCI_WRITEMAX_4		0x20
-#define TI_PCI_WRITEMAX_16		0x40
-#define TI_PCI_WRITEMAX_32		0x60
-#define TI_PCI_WRITEMAX_64		0x80
-#define TI_PCI_WRITEMAX_128		0xA0
-#define TI_PCI_WRITEMAX_256		0xC0
-#define TI_PCI_WRITEMAX_1024		0xE0
-
-#define TI_PCI_READ_CMD			0x06000000
-#define TI_PCI_WRITE_CMD		0x70000000
-
-/*
- * DMA state register.
- */
-#define TI_DMASTATE_ENABLE		0x00000001
-#define TI_DMASTATE_PAUSE		0x00000002
-
-/*
- * CPU state register.
- */
-#define TI_CPUSTATE_RESET		0x00000001
-#define TI_CPUSTATE_STEP		0x00000002
-#define TI_CPUSTATE_ROMFAIL		0x00000010
-#define TI_CPUSTATE_HALT		0x00010000
-/*
- * MAC TX state register
- */
-#define TI_TXSTATE_RESET		0x00000001
-#define TI_TXSTATE_ENB			0x00000002
-#define TI_TXSTATE_STOP			0x00000004
-
-/*
- * MAC RX state register
- */
-#define TI_RXSTATE_RESET		0x00000001
-#define TI_RXSTATE_ENB			0x00000002
-#define TI_RXSTATE_STOP			0x00000004
-
-/*
- * Tigon 2 mailbox registers. The mailbox area consists of 256 bytes
- * split into 64 bit registers. Only the lower 32 bits of each mailbox
- * are used.
- */
-#define TI_MB_HOSTINTR_HI		0x500
-#define TI_MB_HOSTINTR_LO		0x504
-#define TI_MB_HOSTINTR			TI_MB_HOSTINTR_LO
-#define TI_MB_CMDPROD_IDX_HI		0x508
-#define TI_MB_CMDPROD_IDX_LO		0x50C
-#define TI_MB_CMDPROD_IDX		TI_MB_CMDPROD_IDX_LO
-#define TI_MB_SENDPROD_IDX_HI		0x510
-#define TI_MB_SENDPROD_IDX_LO		0x514
-#define TI_MB_SENDPROD_IDX		TI_MB_SENDPROD_IDX_LO
-#define TI_MB_STDRXPROD_IDX_HI		0x518 /* Tigon 2 only */
-#define TI_MB_STDRXPROD_IDX_LO		0x51C /* Tigon 2 only */
-#define TI_MB_STDRXPROD_IDX		TI_MB_STDRXPROD_IDX_LO
-#define TI_MB_JUMBORXPROD_IDX_HI	0x520 /* Tigon 2 only */
-#define TI_MB_JUMBORXPROD_IDX_LO	0x524 /* Tigon 2 only */
-#define TI_MB_JUMBORXPROD_IDX		TI_MB_JUMBORXPROD_IDX_LO
-#define TI_MB_MINIRXPROD_IDX_HI		0x528 /* Tigon 2 only */
-#define TI_MB_MINIRXPROD_IDX_LO		0x52C /* Tigon 2 only */
-#define TI_MB_MINIRXPROD_IDX		TI_MB_MINIRXPROD_IDX_LO
-#define TI_MB_RSVD			0x530
-
-/*
- * Tigon 2 general communication registers. These are 64 and 32 bit
- * registers which are only valid after the firmware has been
- * loaded and started. They actually exist in NIC memory but are
- * mapped into the host memory via the shared memory region.
- *
- * The NIC internally maps these registers starting at address 0,
- * so to determine the NIC address of any of these registers, we
- * subtract 0x600 (the address of the first register).
- */
-
-#define TI_GCR_BASE			0x600
-#define TI_GCR_MACADDR			0x600
-#define TI_GCR_PAR0			0x600
-#define TI_GCR_PAR1			0x604
-#define TI_GCR_GENINFO_HI		0x608
-#define TI_GCR_GENINFO_LO		0x60C
-#define TI_GCR_MCASTADDR		0x610 /* obsolete */
-#define TI_GCR_MAR0			0x610 /* obsolete */
-#define TI_GCR_MAR1			0x614 /* obsolete */
-#define TI_GCR_OPMODE			0x618
-#define TI_GCR_DMA_READCFG		0x61C
-#define TI_GCR_DMA_WRITECFG		0x620
-#define TI_GCR_TX_BUFFER_RATIO		0x624
-#define TI_GCR_EVENTCONS_IDX		0x628
-#define TI_GCR_CMDCONS_IDX		0x62C
-#define TI_GCR_TUNEPARMS		0x630
-#define TI_GCR_RX_COAL_TICKS		0x630
-#define TI_GCR_TX_COAL_TICKS		0x634
-#define TI_GCR_STAT_TICKS		0x638
-#define TI_GCR_TX_MAX_COAL_BD		0x63C
-#define TI_GCR_RX_MAX_COAL_BD		0x640
-#define TI_GCR_NIC_TRACING		0x644
-#define TI_GCR_GLINK			0x648
-#define TI_GCR_LINK			0x64C
-#define TI_GCR_NICTRACE_PTR		0x650
-#define TI_GCR_NICTRACE_START		0x654
-#define TI_GCR_NICTRACE_LEN		0x658
-#define TI_GCR_IFINDEX			0x65C
-#define TI_GCR_IFMTU			0x660
-#define TI_GCR_MASK_INTRS		0x664
-#define TI_GCR_GLINK_STAT		0x668
-#define TI_GCR_LINK_STAT		0x66C
-#define TI_GCR_RXRETURNCONS_IDX		0x680
-#define TI_GCR_CMDRING			0x700
-
-#define TI_GCR_NIC_ADDR(x)		(x - TI_GCR_BASE);
-
-/*
- * Local memory window. The local memory window is a 2K shared
- * memory region which can be used to access the NIC's internal
- * SRAM. The window can be mapped to a given 2K region using
- * the TI_WINDOW_BASE register.
- */
-#define TI_WINDOW			0x800
-#define TI_WINLEN			0x800
-
-#define TI_TICKS_PER_SEC		1000000
-
-/*
- * Operation mode register.
- */
-#define TI_OPMODE_BYTESWAP_BD		0x00000002
-#define TI_OPMODE_WORDSWAP_BD		0x00000004
-#define TI_OPMODE_WARN_ENB		0x00000008 /* not yet implimented */
-#define TI_OPMODE_BYTESWAP_DATA		0x00000010
-#define TI_OPMODE_1_DMA_ACTIVE		0x00000040
-#define TI_OPMODE_SBUS			0x00000100
-#define TI_OPMODE_DONT_FRAG_JUMBO	0x00000200
-#define TI_OPMODE_INCLUDE_CRC		0x00000400
-#define TI_OPMODE_RX_BADFRAMES		0x00000800
-#define TI_OPMODE_NO_EVENT_INTRS	0x00001000
-#define TI_OPMODE_NO_TX_INTRS		0x00002000
-#define TI_OPMODE_NO_RX_INTRS		0x00004000
-#define TI_OPMODE_FATAL_ENB		0x40000000 /* not yet implimented */
-#define TI_OPMODE_JUMBO_HDRSPLIT	0x00008000
-
-/*
- * DMA configuration thresholds.
- */
-#define TI_DMA_STATE_THRESH_16W		0x00000100
-#define TI_DMA_STATE_THRESH_8W		0x00000080
-#define TI_DMA_STATE_THRESH_4W		0x00000040
-#define TI_DMA_STATE_THRESH_2W		0x00000020
-#define TI_DMA_STATE_THRESH_1W		0x00000010
-
-#define TI_DMA_STATE_FORCE_32_BIT	0x00000008
-
-/*
- * Gigabit link status bits.
- */
-#define TI_GLNK_SENSE_NO_BEG		0x00002000
-#define TI_GLNK_LOOPBACK		0x00004000
-#define TI_GLNK_PREF			0x00008000
-#define TI_GLNK_1000MB			0x00040000
-#define TI_GLNK_FULL_DUPLEX		0x00080000
-#define TI_GLNK_TX_FLOWCTL_Y		0x00200000 /* Tigon 2 only */
-#define TI_GLNK_RX_FLOWCTL_Y		0x00800000
-#define TI_GLNK_AUTONEGENB		0x20000000
-#define TI_GLNK_ENB			0x40000000
-
-/*
- * Link status bits.
- */
-#define TI_LNK_LOOPBACK			0x00004000
-#define TI_LNK_PREF			0x00008000
-#define TI_LNK_10MB			0x00010000
-#define TI_LNK_100MB			0x00020000
-#define TI_LNK_1000MB			0x00040000
-#define TI_LNK_FULL_DUPLEX		0x00080000
-#define TI_LNK_HALF_DUPLEX		0x00100000
-#define TI_LNK_TX_FLOWCTL_Y		0x00200000 /* Tigon 2 only */
-#define TI_LNK_RX_FLOWCTL_Y		0x00800000
-#define TI_LNK_AUTONEGENB		0x20000000
-#define TI_LNK_ENB			0x40000000
-
-/*
- * Ring size constants.
- */
-#define TI_EVENT_RING_CNT	256
-#define TI_CMD_RING_CNT		64
-#define TI_STD_RX_RING_CNT	512
-#define TI_JUMBO_RX_RING_CNT	256
-#define TI_MINI_RX_RING_CNT	1024
-#define TI_RETURN_RING_CNT	2048
-
-/*
- * Possible TX ring sizes.
- */
-#define TI_TX_RING_CNT_128	128
-#define TI_TX_RING_BASE_128	0x3800
-
-#define TI_TX_RING_CNT_256	256
-#define TI_TX_RING_BASE_256	0x3000
-
-#define TI_TX_RING_CNT_512	512
-#define TI_TX_RING_BASE_512	0x2000
-
-#define TI_TX_RING_CNT		TI_TX_RING_CNT_512
-#define TI_TX_RING_BASE		TI_TX_RING_BASE_512
-
-/*
- * The Tigon can have up to 8MB of external SRAM, however the Tigon 1
- * is limited to 2MB total, and in general I think most adapters have
- * around 1MB. We use this value for zeroing the NIC's SRAM, so to
- * be safe we use the largest possible value (zeroing memory that
- * isn't there doesn't hurt anything).
- */
-#define TI_MEM_MAX		0x7FFFFF
-
-/*
- * Maximum register address on the Tigon.
- */
-#define	TI_REG_MAX		0x3fff
-
-/*
- * These values were taken from Alteon's tg.h.
- */
-#define TI_BEG_SRAM     0x0             /* host thinks it's here */
-#define TI_BEG_SCRATCH  0xc00000        /* beg of scratch pad area */
-#define TI_END_SRAM_II     0x800000        /* end of SRAM, for 2 MB stuffed */
-#define TI_END_SCRATCH_II  0xc04000        /* end of scratch pad CPU A (16KB) */
-#define TI_END_SCRATCH_B 0xc02000       /* end of scratch pad CPU B (8KB) */
-#define TI_BEG_SCRATCH_B_DEBUG 0xd00000 /* beg of scratch pad for ioctl */
-#define TI_END_SCRATCH_B_DEBUG 0xd02000 /* end of scratch pad for ioctl */
-#define TI_SCRATCH_DEBUG_OFF 0x100000   /* offset for ioctl usage */
-#define TI_END_SRAM_I     0x200000        /* end of SRAM, for 2 MB stuffed */
-#define TI_END_SCRATCH_I  0xc00800        /* end of scratch pad area (2KB) */
-#define TI_BEG_PROM     0x40000000      /* beg of PROM, special access */
-#define TI_BEG_FLASH    0x80000000      /* beg of EEPROM, special access */
-#define TI_END_FLASH    0x80100000      /* end of EEPROM for 1 MB stuff */
-#define TI_BEG_SER_EEPROM 0xa0000000    /* beg of Serial EEPROM (fake out) */
-#define TI_END_SER_EEPROM 0xa0002000    /* end of Serial EEPROM (fake out) */
-#define TI_BEG_REGS     0xc0000000      /* beg of register area */
-#define TI_END_REGS     0xc0000400      /* end of register area */
-#define TI_END_WRITE_REGS 0xc0000180    /* can't write GPRs currently */
-#define TI_BEG_REGS2    0xc0000200      /* beg of second writeable reg area */
-/* the EEPROM is byte addressable in a pretty odd way */
-#define EEPROM_BYTE_LOC 0xff000000      
-
-/*
- * From Alteon's tg.h.
- */
-#define TI_PROCESSOR_A          0
-#define TI_PROCESSOR_B          1
-#define TI_CPU_A                TG_PROCESSOR_A
-#define TI_CPU_B                TG_PROCESSOR_B
-
-/*
- * Following macro can be used to access to any of the CPU registers
- * It will adjust the address appropriately.
- * Parameters:
- *      reg - The register to access, e.g TI_CPU_CONTROL
- *      cpu - cpu, i.e PROCESSOR_A or PROCESSOR_B (or TI_CPU_A or TI_CPU_B)
- */
-#define CPU_REG(reg, cpu) ((reg) + (cpu) * 0x100)
-
-/*
- * Even on the alpha, pci addresses are 32-bit quantities
- */
-
-#ifdef __64_bit_pci_addressing__ 
-typedef struct {
-	u_int64_t		ti_addr;
-} ti_hostaddr;
-#define TI_HOSTADDR(x)	x.ti_addr
-#else
-typedef struct {
-	u_int32_t		ti_addr_hi;
-	u_int32_t		ti_addr_lo;
-} ti_hostaddr;
-#define TI_HOSTADDR(x)	x.ti_addr_lo
-#endif
-
-/*
- * Ring control block structure. The rules for the max_len field
- * are as follows:
- * 
- * For the send ring, max_len indicates the number of entries in the
- * ring (128, 256 or 512).
- *
- * For the standard receive ring, max_len indicates the threshold
- * used to decide when a frame should be put in the jumbo receive ring
- * instead of the standard one.
- *
- * For the mini ring, max_len indicates the size of the buffers in the
- * ring. This is the value used to decide when a frame is small enough
- * to be placed in the mini ring.
- *
- * For the return receive ring, max_len indicates the number of entries
- * in the ring. It can be one of 2048, 1024 or 0 (which is the same as
- * 2048 for backwards compatibility). The value 1024 can only be used
- * if the mini ring is disabled.
- */
-struct ti_rcb {
-	ti_hostaddr		ti_hostaddr;
-#if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_max_len;
-	u_int16_t		ti_flags;
-#else
-	u_int16_t		ti_flags;
-	u_int16_t		ti_max_len;
-#endif
-	u_int32_t		ti_unused;
-};
-
-#define TI_RCB_FLAG_TCP_UDP_CKSUM	0x00000001
-#define TI_RCB_FLAG_IP_CKSUM		0x00000002
-#define TI_RCB_FLAG_NO_PHDR_CKSUM	0x00000008
-#define TI_RCB_FLAG_VLAN_ASSIST		0x00000010
-#define TI_RCB_FLAG_COAL_UPD_ONLY	0x00000020
-#define TI_RCB_FLAG_HOST_RING		0x00000040
-#define TI_RCB_FLAG_IEEE_SNAP_CKSUM	0x00000080
-#define TI_RCB_FLAG_USE_EXT_RX_BD	0x00000100
-#define TI_RCB_FLAG_RING_DISABLED	0x00000200
-
-struct ti_producer {
-	u_int32_t		ti_idx;
-	u_int32_t		ti_unused;
-};
-
-/*
- * Tigon general information block. This resides in host memory
- * and contains the status counters, ring control blocks and
- * producer pointers.
- */
-
-struct ti_gib {
-	struct ti_stats		ti_stats;
-	struct ti_rcb		ti_ev_rcb;
-	struct ti_rcb		ti_cmd_rcb;
-	struct ti_rcb		ti_tx_rcb;
-	struct ti_rcb		ti_std_rx_rcb;
-	struct ti_rcb		ti_jumbo_rx_rcb;
-	struct ti_rcb		ti_mini_rx_rcb;
-	struct ti_rcb		ti_return_rcb;
-	ti_hostaddr		ti_ev_prodidx_ptr;
-	ti_hostaddr		ti_return_prodidx_ptr;
-	ti_hostaddr		ti_tx_considx_ptr;
-	ti_hostaddr		ti_refresh_stats_ptr;
-};
-
-/*
- * Buffer descriptor structures. There are basically three types
- * of structures: normal receive descriptors, extended receive
- * descriptors and transmit descriptors. The extended receive
- * descriptors are optionally used only for the jumbo receive ring.
- */
-
-struct ti_rx_desc {
-	ti_hostaddr		ti_addr;
-#if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_idx;
-	u_int16_t		ti_len;
-#else
-	u_int16_t		ti_len;
-	u_int16_t		ti_idx;
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_type;
-	u_int16_t		ti_flags;
-#else
-	u_int16_t		ti_flags;
-	u_int16_t		ti_type;
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_ip_cksum;
-	u_int16_t		ti_tcp_udp_cksum;
-#else
-	u_int16_t		ti_tcp_udp_cksum;
-	u_int16_t		ti_ip_cksum;
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_error_flags;
-	u_int16_t		ti_vlan_tag;
-#else
-	u_int16_t		ti_vlan_tag;
-	u_int16_t		ti_error_flags;
-#endif
-	u_int32_t		ti_rsvd;
-	u_int32_t		ti_opaque;
-};
-
-struct ti_rx_desc_ext {
-	ti_hostaddr		ti_addr1;
-	ti_hostaddr		ti_addr2;
-	ti_hostaddr		ti_addr3;
-#if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_len1;
-	u_int16_t		ti_len2;
-#else
-	u_int16_t		ti_len2;
-	u_int16_t		ti_len1;
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_len3;
-	u_int16_t		ti_rsvd0;
-#else
-	u_int16_t		ti_rsvd0;
-	u_int16_t		ti_len3;
-#endif
-	ti_hostaddr		ti_addr0;
-#if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_idx;
-	u_int16_t		ti_len0;
-#else
-	u_int16_t		ti_len0;
-	u_int16_t		ti_idx;
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_type;
-	u_int16_t		ti_flags;
-#else
-	u_int16_t		ti_flags;
-	u_int16_t		ti_type;
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_ip_cksum;
-	u_int16_t		ti_tcp_udp_cksum;
-#else
-	u_int16_t		ti_tcp_udp_cksum;
-	u_int16_t		ti_ip_cksum;
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_error_flags;
-	u_int16_t		ti_vlan_tag;
-#else
-	u_int16_t		ti_vlan_tag;
-	u_int16_t		ti_error_flags;
-#endif
-	u_int32_t		ti_rsvd1;
-	u_int32_t		ti_opaque;
-};
-
-/*
- * Transmit descriptors are, mercifully, very small.
- */
-struct ti_tx_desc {
-	ti_hostaddr		ti_addr;
-#if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_len;
-	u_int16_t		ti_flags;
-#else
-	u_int16_t		ti_flags;
-	u_int16_t		ti_len;
-#endif
-#if BYTE_ORDER == BIG_ENDIAN
-	u_int16_t		ti_rsvd;
-	u_int16_t		ti_vlan_tag;
-#else
-	u_int16_t		ti_vlan_tag;
-	u_int16_t		ti_rsvd;
-#endif
-};
-
-/*
- * NOTE!  On the Alpha, we have an alignment constraint.
- * The first thing in the packet is a 14-byte Ethernet header.
- * This means that the packet is misaligned.  To compensate,
- * we actually offset the data 2 bytes into the cluster.  This
- * alignes the packet after the Ethernet header at a 32-bit
- * boundary.
- */
-
-#define ETHER_ALIGN 2
-
-#define TI_FRAMELEN		1518
-#define TI_JUMBO_FRAMELEN	9018
-#define TI_JUMBO_MTU		(TI_JUMBO_FRAMELEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
-#define TI_PAGE_SIZE		PAGE_SIZE
-#define TI_MIN_FRAMELEN		60
-
-/*
- * Buffer descriptor error flags.
- */
-#define TI_BDERR_CRC			0x0001
-#define TI_BDERR_COLLDETECT		0x0002
-#define TI_BDERR_LINKLOST		0x0004
-#define TI_BDERR_DECODE			0x0008
-#define TI_BDERR_ODD_NIBBLES		0x0010
-#define TI_BDERR_MAC_ABRT		0x0020
-#define TI_BDERR_RUNT			0x0040
-#define TI_BDERR_TRUNC			0x0080
-#define TI_BDERR_GIANT			0x0100
-
-/*
- * Buffer descriptor flags.
- */
-#define TI_BDFLAG_TCP_UDP_CKSUM		0x0001
-#define TI_BDFLAG_IP_CKSUM		0x0002
-#define TI_BDFLAG_END			0x0004
-#define TI_BDFLAG_MORE			0x0008
-#define TI_BDFLAG_JUMBO_RING		0x0010
-#define TI_BDFLAG_UCAST_PKT		0x0020
-#define TI_BDFLAG_MCAST_PKT		0x0040
-#define TI_BDFLAG_BCAST_PKT		0x0060
-#define TI_BDFLAG_IP_FRAG		0x0080
-#define TI_BDFLAG_IP_FRAG_END		0x0100
-#define TI_BDFLAG_VLAN_TAG		0x0200
-#define TI_BDFLAG_ERROR			0x0400
-#define TI_BDFLAG_COAL_NOW		0x0800
-#define	TI_BDFLAG_MINI_RING		0x1000
-
-/*
- * Descriptor type flags. I think these only have meaning for
- * the Tigon 1. I had to extract them from the sample driver source
- * since they aren't in the manual.
- */
-#define TI_BDTYPE_TYPE_NULL			0x0000
-#define TI_BDTYPE_SEND_BD			0x0001
-#define TI_BDTYPE_RECV_BD			0x0002
-#define TI_BDTYPE_RECV_JUMBO_BD			0x0003
-#define TI_BDTYPE_RECV_BD_LAST			0x0004
-#define TI_BDTYPE_SEND_DATA			0x0005
-#define TI_BDTYPE_SEND_DATA_LAST		0x0006
-#define TI_BDTYPE_RECV_DATA			0x0007
-#define TI_BDTYPE_RECV_DATA_LAST		0x000b
-#define TI_BDTYPE_EVENT_RUPT			0x000c
-#define TI_BDTYPE_EVENT_NO_RUPT			0x000d
-#define TI_BDTYPE_ODD_START			0x000e
-#define TI_BDTYPE_UPDATE_STATS			0x000f
-#define TI_BDTYPE_SEND_DUMMY_DMA		0x0010
-#define TI_BDTYPE_EVENT_PROD			0x0011
-#define TI_BDTYPE_TX_CONS			0x0012
-#define TI_BDTYPE_RX_PROD			0x0013
-#define TI_BDTYPE_REFRESH_STATS			0x0014
-#define TI_BDTYPE_SEND_DATA_LAST_VLAN		0x0015
-#define TI_BDTYPE_SEND_DATA_COAL		0x0016
-#define TI_BDTYPE_SEND_DATA_LAST_COAL		0x0017
-#define TI_BDTYPE_SEND_DATA_LAST_VLAN_COAL	0x0018
-#define TI_BDTYPE_TX_CONS_NO_INTR		0x0019
-
-/*
- * Tigon command structure.
- */
-struct ti_cmd_desc {
-#if BYTE_ORDER == BIG_ENDIAN
-	u_int32_t		ti_cmd:8;
-	u_int32_t		ti_code:12;
-	u_int32_t		ti_idx:12;
-#else
-	u_int32_t		ti_idx:12;
-	u_int32_t		ti_code:12;
-	u_int32_t		ti_cmd:8;
-#endif
-};
-
-#define TI_CMD_HOST_STATE		0x01
-#define TI_CMD_CODE_STACK_UP		0x01
-#define TI_CMD_CODE_STACK_DOWN		0x02
-
-/*
- * This command enables software address filtering. It's a workaround
- * for a bug in the Tigon 1 and not implemented for the Tigon 2.
- */
-#define TI_CMD_FDR_FILTERING		0x02
-#define TI_CMD_CODE_FILT_ENB		0x01
-#define TI_CMD_CODE_FILT_DIS		0x02
-
-#define TI_CMD_SET_RX_PROD_IDX		0x03 /* obsolete */
-#define TI_CMD_UPDATE_GENCOM		0x04
-#define TI_CMD_RESET_JUMBO_RING		0x05
-#define TI_CMD_SET_PARTIAL_RX_CNT	0x06
-#define TI_CMD_ADD_MCAST_ADDR		0x08 /* obsolete */
-#define TI_CMD_DEL_MCAST_ADDR		0x09 /* obsolete */
-
-#define TI_CMD_SET_PROMISC_MODE		0x0A
-#define TI_CMD_CODE_PROMISC_ENB		0x01
-#define TI_CMD_CODE_PROMISC_DIS		0x02
-
-#define TI_CMD_LINK_NEGOTIATION		0x0B
-#define TI_CMD_CODE_NEGOTIATE_BOTH	0x00
-#define TI_CMD_CODE_NEGOTIATE_GIGABIT	0x01
-#define TI_CMD_CODE_NEGOTIATE_10_100	0x02
-
-#define TI_CMD_SET_MAC_ADDR		0x0C
-#define TI_CMD_CLR_PROFILE		0x0D
-
-#define TI_CMD_SET_ALLMULTI		0x0E
-#define TI_CMD_CODE_ALLMULTI_ENB	0x01
-#define TI_CMD_CODE_ALLMULTI_DIS	0x02
-
-#define TI_CMD_CLR_STATS		0x0F
-#define TI_CMD_SET_RX_JUMBO_PROD_IDX	0x10 /* obsolete */
-#define TI_CMD_RFRSH_STATS		0x11
-
-#define TI_CMD_EXT_ADD_MCAST		0x12
-#define TI_CMD_EXT_DEL_MCAST		0x13
-
-/*
- * Utility macros to make issuing commands a little simpler. Assumes
- * that 'sc' and 'cmd' are in local scope.
- */
-#define TI_DO_CMD(x, y, z)		\
-	cmd.ti_cmd = (x);		\
-	cmd.ti_code = (y);		\
-	cmd.ti_idx = (z);		\
-	ti_cmd(sc, &cmd);
-
-#define TI_DO_CMD_EXT(x, y, z, v, w)	\
-	cmd.ti_cmd = (x);		\
-	cmd.ti_code = (y);		\
-	cmd.ti_idx = (z);		\
-	ti_cmd_ext(sc, &cmd, (v), (w));
-
-/*
- * Other utility macros.
- */
-#define TI_INC(x, y)	(x) = (x + 1) % y
-
-#define TI_UPDATE_JUMBOPROD(x, y)					\
-	if (x->ti_hwrev == TI_HWREV_TIGON) {				\
-		TI_DO_CMD(TI_CMD_SET_RX_JUMBO_PROD_IDX, 0, y);	\
-	} else {							\
-		CSR_WRITE_4(x, TI_MB_JUMBORXPROD_IDX, y);		\
-	}
-
-#define TI_UPDATE_MINIPROD(x, y)					\
-		CSR_WRITE_4(x, TI_MB_MINIRXPROD_IDX, y);
-
-#define TI_UPDATE_STDPROD(x, y)						\
-	if (x->ti_hwrev == TI_HWREV_TIGON) {				\
-		TI_DO_CMD(TI_CMD_SET_RX_PROD_IDX, 0, y);		\
-	} else {							\
-		CSR_WRITE_4(x, TI_MB_STDRXPROD_IDX, y);			\
-	}
-
-
-/*
- * Tigon event structure.
- */
-struct ti_event_desc {
-#if BYTE_ORDER == BIG_ENDIAN
-	u_int32_t		ti_event:8;
-	u_int32_t		ti_code:12;
-	u_int32_t		ti_idx:12;
-#else
-	u_int32_t		ti_idx:12;
-	u_int32_t		ti_code:12;
-	u_int32_t		ti_event:8;
-#endif
-	u_int32_t		ti_rsvd;
-};
-
-/*
- * Tigon events.
- */
-#define TI_EV_FIRMWARE_UP		0x01
-#define TI_EV_STATS_UPDATED		0x04
-
-#define TI_EV_LINKSTAT_CHANGED		0x06
-#define TI_EV_CODE_GIG_LINK_UP		0x01
-#define TI_EV_CODE_LINK_DOWN		0x02
-#define TI_EV_CODE_LINK_UP		0x03
-
-#define TI_EV_ERROR			0x07
-#define TI_EV_CODE_ERR_INVAL_CMD	0x01
-#define TI_EV_CODE_ERR_UNIMP_CMD	0x02
-#define TI_EV_CODE_ERR_BADCFG		0x03
-
-#define TI_EV_MCAST_UPDATED		0x08
-#define TI_EV_CODE_MCAST_ADD		0x01
-#define TI_EV_CODE_MCAST_DEL		0x02
-
-#define TI_EV_RESET_JUMBO_RING		0x09
-/*
- * Register access macros. The Tigon always uses memory mapped register
- * accesses and all registers must be accessed with 32 bit operations.
- */
-
-#define CSR_WRITE_4(sc, reg, val)	\
-	bus_space_write_4(sc->ti_btag, sc->ti_bhandle, reg, val)
-
-#define CSR_READ_4(sc, reg)		\
-	bus_space_read_4(sc->ti_btag, sc->ti_bhandle, reg)
-
-#define TI_SETBIT(sc, reg, x)	\
-	CSR_WRITE_4(sc, reg, (CSR_READ_4(sc, reg) | x))
-#define TI_CLRBIT(sc, reg, x)	\
-	CSR_WRITE_4(sc, reg, (CSR_READ_4(sc, reg) & ~x))
-
-/*
- * Memory management stuff. Note: the SSLOTS, MSLOTS and JSLOTS
- * values are tuneable. They control the actual amount of buffers
- * allocated for the standard, mini and jumbo receive rings.
- */
-
-#define TI_SSLOTS	256
-#define TI_MSLOTS	256
-#define TI_JSLOTS	384
-
-#define TI_JRAWLEN (TI_JUMBO_FRAMELEN + ETHER_ALIGN)
-#define TI_JLEN (TI_JRAWLEN + (sizeof(u_int64_t) - \
-	(TI_JRAWLEN % sizeof(u_int64_t))))
-#define TI_JPAGESZ PAGE_SIZE
-#define TI_RESID (TI_JPAGESZ - (TI_JLEN * TI_JSLOTS) % TI_JPAGESZ)
-#define TI_JMEM ((TI_JLEN * TI_JSLOTS) + TI_RESID)
-
-/*
- * Ring structures. Most of these reside in host memory and we tell
- * the NIC where they are via the ring control blocks. The exceptions
- * are the tx and command rings, which live in NIC memory and which
- * we access via the shared memory window.
- */
-struct ti_ring_data {
-	struct ti_rx_desc	ti_rx_std_ring[TI_STD_RX_RING_CNT];
-#ifdef PRIVATE_JUMBOS
-	struct ti_rx_desc	ti_rx_jumbo_ring[TI_JUMBO_RX_RING_CNT];
-#else
-	struct ti_rx_desc_ext	ti_rx_jumbo_ring[TI_JUMBO_RX_RING_CNT];
-#endif
-	struct ti_rx_desc	ti_rx_mini_ring[TI_MINI_RX_RING_CNT];
-	struct ti_rx_desc	ti_rx_return_ring[TI_RETURN_RING_CNT];
-	struct ti_event_desc	ti_event_ring[TI_EVENT_RING_CNT];
-	struct ti_tx_desc	ti_tx_ring[TI_TX_RING_CNT];
-	/*
-	 * Make sure producer structures are aligned on 32-byte cache
-	 * line boundaries.
-	 */
-	struct ti_producer	ti_ev_prodidx_r;
-	u_int32_t		ti_pad0[6];
-	struct ti_producer	ti_return_prodidx_r;
-	u_int32_t		ti_pad1[6];
-	struct ti_producer	ti_tx_considx_r;
-	u_int32_t		ti_pad2[6];
-	struct ti_tx_desc	*ti_tx_ring_nic;/* pointer to shared mem */
-	struct ti_cmd_desc	*ti_cmd_ring;	/* pointer to shared mem */
-	struct ti_gib		ti_info;
-};
-
-/*
- * Mbuf pointers. We need these to keep track of the virtual addresses
- * of our mbuf chains since we can only convert from physical to virtual,
- * not the other way around.
- */
-struct ti_chain_data {
-	struct mbuf		*ti_tx_chain[TI_TX_RING_CNT];
-	struct mbuf		*ti_rx_std_chain[TI_STD_RX_RING_CNT];
-	struct mbuf		*ti_rx_jumbo_chain[TI_JUMBO_RX_RING_CNT];
-	struct mbuf		*ti_rx_mini_chain[TI_MINI_RX_RING_CNT];
-	/* Stick the jumbo mem management stuff here too. */
-	caddr_t			ti_jslots[TI_JSLOTS];
-	void			*ti_jumbo_buf;
-};
-
-struct ti_type {
-	u_int16_t		ti_vid;
-	u_int16_t		ti_did;
-	char			*ti_name;
-};
-
-#define TI_HWREV_TIGON		0x01
-#define TI_HWREV_TIGON_II	0x02
-#define TI_TIMEOUT		1000
-#define TI_TXCONS_UNSET		0xFFFF	/* impossible value */
-
-struct ti_mc_entry {
-	struct ether_addr		mc_addr;
-	SLIST_ENTRY(ti_mc_entry)	mc_entries;
-};
-
-struct ti_jpool_entry {
-	int                             slot;
-	SLIST_ENTRY(ti_jpool_entry)	jpool_entries;
-};
-
-typedef enum {
-	TI_FLAG_NONE		= 0x00,
-	TI_FLAG_DEBUGING	= 0x01,
-	TI_FLAG_WAIT_FOR_LINK	= 0x02
-} ti_flag_vals;
-
-struct ti_softc {
-	STAILQ_ENTRY(ti_softc)	ti_links;
-	struct ifnet		*ti_ifp;
-	bus_space_handle_t	ti_bhandle;
-	vm_offset_t		ti_vhandle;
-	bus_space_tag_t		ti_btag;
-	void			*ti_intrhand;
-	struct resource		*ti_irq;
-	struct resource		*ti_res;
-	struct ifmedia		ifmedia;	/* media info */
-	u_int8_t		ti_unit;	/* interface number */
-	u_int8_t		ti_hwrev;	/* Tigon rev (1 or 2) */
-	u_int8_t		ti_copper;	/* 1000baseTX card */
-	u_int8_t		ti_linkstat;	/* Link state */
-	int			ti_hdrsplit;	/* enable header splitting */
-	bus_dma_tag_t		ti_parent_dmat;
-	bus_dma_tag_t		ti_rdata_dmat;
-	bus_dmamap_t		ti_rdata_dmamap;
-	uint32_t		ti_rdata_phys;
-	struct ti_ring_data	*ti_rdata;	/* rings */
-	struct ti_chain_data	ti_cdata;	/* mbufs */
-#define ti_ev_prodidx		ti_rdata->ti_ev_prodidx_r
-#define ti_return_prodidx	ti_rdata->ti_return_prodidx_r
-#define ti_tx_considx		ti_rdata->ti_tx_considx_r
-	u_int16_t		ti_tx_saved_considx;
-	u_int16_t		ti_rx_saved_considx;
-	u_int16_t		ti_ev_saved_considx;
-	u_int16_t		ti_cmd_saved_prodidx;
-	u_int16_t		ti_std;		/* current std ring head */
-	u_int16_t		ti_mini;	/* current mini ring head */
-	u_int16_t		ti_jumbo;	/* current jumo ring head */
-	SLIST_HEAD(__ti_mchead, ti_mc_entry)	ti_mc_listhead;
-	SLIST_HEAD(__ti_jfreehead, ti_jpool_entry)	ti_jfree_listhead;
-	SLIST_HEAD(__ti_jinusehead, ti_jpool_entry)	ti_jinuse_listhead;
-	u_int32_t		ti_stat_ticks;
-	u_int32_t		ti_rx_coal_ticks;
-	u_int32_t		ti_tx_coal_ticks;
-	u_int32_t		ti_rx_max_coal_bds;
-	u_int32_t		ti_tx_max_coal_bds;
-	u_int32_t		ti_tx_buf_ratio;
-	int			ti_if_flags;
-	int			ti_txcnt;
-	struct mtx		ti_mtx;
-	ti_flag_vals		ti_flags;
-	struct cdev *dev;
-};
-
-#define	TI_LOCK(_sc)		mtx_lock(&(_sc)->ti_mtx)
-#define	TI_UNLOCK(_sc)		mtx_unlock(&(_sc)->ti_mtx)
-#define	TI_LOCK_ASSERT(_sc)	mtx_assert(&(_sc)->ti_mtx, MA_OWNED)
-
-/*
- * Microchip Technology 24Cxx EEPROM control bytes
- */
-#define EEPROM_CTL_READ			0xA1	/* 0101 0001 */
-#define EEPROM_CTL_WRITE		0xA0	/* 0101 0000 */
-
-/*
- * Note that EEPROM_START leaves transmission enabled.
- */
-#define EEPROM_START							\
-	TI_SETBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_CLK); /* Pull clock pin high */\
-	TI_SETBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_DOUT); /* Set DATA bit to 1 */	\
-	TI_SETBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_TXEN); /* Enable xmit to write bit */\
-	TI_CLRBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_DOUT); /* Pull DATA bit to 0 again */\
-	TI_CLRBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_CLK); /* Pull clock low again */
-
-/*
- * EEPROM_STOP ends access to the EEPROM and clears the ETXEN bit so
- * that no further data can be written to the EEPROM I/O pin.
- */
-#define EEPROM_STOP							\
-	TI_CLRBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_TXEN); /* Disable xmit */	\
-	TI_CLRBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_DOUT); /* Pull DATA to 0 */	\
-	TI_SETBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_CLK); /* Pull clock high */	\
-	TI_SETBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_TXEN); /* Enable xmit */	\
-	TI_SETBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_DOUT); /* Toggle DATA to 1 */	\
-	TI_CLRBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_TXEN); /* Disable xmit. */	\
-	TI_CLRBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_CLK); /* Pull clock low again */
-
-
-#ifdef __alpha__
-#undef vtophys
-#define vtophys(va)		alpha_XXX_dmamap((vm_offset_t)va)
-#endif
Index: alpm.c
===================================================================
RCS file: /home/cvs/src/sys/pci/alpm.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/alpm.c -L sys/pci/alpm.c -u -r1.1.1.1 -r1.2
--- sys/pci/alpm.c
+++ sys/pci/alpm.c
@@ -29,14 +29,15 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/alpm.c,v 1.24 2005/05/29 04:42:29 nyan Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/alpm.c,v 1.26 2007/01/11 19:56:24 jhb Exp $");
 
 #include <sys/param.h>
+#include <sys/bus.h>
 #include <sys/kernel.h>
-#include <sys/systm.h>
+#include <sys/lock.h>
 #include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/uio.h>
+#include <sys/mutex.h>
+#include <sys/systm.h>
 
 #include <machine/bus.h>
 #include <machine/resource.h>
@@ -45,7 +46,6 @@
 #include <dev/pci/pcivar.h>
 #include <dev/pci/pcireg.h>
 
-#include <dev/iicbus/iiconf.h>
 #include <dev/smbus/smbconf.h>
 #include "smbus_if.h"
 
@@ -59,10 +59,8 @@
 
 #define ACER_M1543_PMU_ID	0x710110b9
 
-/* Uncomment this line to force another I/O base address for SMB */
-/* #define ALPM_SMBIO_BASE_ADDR	0x3a80 */
-
-/* I/O registers offsets - the base address is programmed via the
+/*
+ * I/O registers offsets - the base address is programmed via the
  * SMBBA PCI configuration register
  */
 #define SMBSTS		0x0	/* SMBus host/slave status register */
@@ -74,6 +72,9 @@
 #define SMBHBLOCK	0x6	/* block register for host controller */
 #define SMBHCMD		0x7	/* command register for host controller */
 
+/* SMBHADDR mask. */
+#define	LSB		0x1	/* XXX: Better name: Read/Write? */
+
 /* SMBSTS masks */
 #define TERMINATE	0x80
 #define BUS_COLLI	0x40
@@ -101,7 +102,7 @@
 #define COM		0x4
 #define COM_ENABLE_IO	0x1
 
-#define SMBBA		0x14
+#define SMBBA		PCIR_BAR(1)
 
 #define ATPC		0x5b
 #define ATPC_SMBCTRL	0x04 		/* XX linux has this as 0x6 */
@@ -126,44 +127,27 @@
         bus_space_tag_t smbst;
         bus_space_handle_t smbsh;
 	device_t smbus;
+	struct mtx lock;
 };
 
+#define	ALPM_LOCK(alpm)		mtx_lock(&(alpm)->lock)
+#define	ALPM_UNLOCK(alpm)	mtx_unlock(&(alpm)->lock)
+#define	ALPM_LOCK_ASSERT(alpm)	mtx_assert(&(alpm)->lock, MA_OWNED)
+
 #define ALPM_SMBINB(alpm,register) \
 	(bus_space_read_1(alpm->smbst, alpm->smbsh, register))
 #define ALPM_SMBOUTB(alpm,register,value) \
 	(bus_space_write_1(alpm->smbst, alpm->smbsh, register, value))
 
+static int	alpm_detach(device_t dev);
+
 static int
 alpm_probe(device_t dev)
 {
-#ifdef ALPM_SMBIO_BASE_ADDR
-	u_int32_t l;
-#endif
 
 	if (pci_get_devid(dev) == ACER_M1543_PMU_ID) {
 		device_set_desc(dev, "AcerLabs M15x3 Power Management Unit");
 
-#ifdef ALPM_SMBIO_BASE_ADDR
-		if (bootverbose || alpm_debug)
-			device_printf(dev, "forcing base I/O at 0x%x\n",
-					ALPM_SMBIO_BASE_ADDR);
-
-		/* disable I/O */
-		l = pci_read_config(dev, COM, 2);
-		pci_write_config(dev, COM, l & ~COM_ENABLE_IO, 2);
-
-		/* set the I/O base address */
-		pci_write_config(dev, SMBBA, ALPM_SMBIO_BASE_ADDR | 0x1, 4);
-
-		/* enable I/O */
-		pci_write_config(dev, COM, l | COM_ENABLE_IO, 2);
-
-		if (bus_set_resource(dev, SYS_RES_IOPORT, SMBBA,
-					ALPM_SMBIO_BASE_ADDR, 256)) {
-			device_printf(dev, "could not set bus resource\n");
-			return (ENXIO);
-		}
-#endif
 		return (BUS_PROBE_DEFAULT);
 	}
 
@@ -234,9 +218,14 @@
 	}
 	alpm->smbst = rman_get_bustag(alpm->res);
 	alpm->smbsh = rman_get_bushandle(alpm->res);
+	mtx_init(&alpm->lock, device_get_nameunit(dev), "alpm", MTX_DEF);
 
 	/* attach the smbus */
 	alpm->smbus = device_add_child(dev, "smbus", -1);
+	if (alpm->smbus == NULL) {
+		alpm_detach(dev);
+		return (EINVAL);
+	}
 	bus_generic_attach(dev);
 
 	return (0);
@@ -251,6 +240,7 @@
 		device_delete_child(dev, alpm->smbus);
 		alpm->smbus = NULL;
 	}
+	mtx_destroy(&alpm->lock);
 
 	if (alpm->res)
 		bus_release_resource(dev, SYS_RES_IOPORT, SMBBA, alpm->res);
@@ -259,7 +249,7 @@
 }
 
 static int
-alpm_callback(device_t dev, int index, caddr_t *data)
+alpm_callback(device_t dev, int index, void *data)
 {
 	int error = 0;
 
@@ -317,7 +307,7 @@
 	int error;
 
 	/* wait for command to complete and SMBus controller is idle */
-	while(count--) {
+	while (count--) {
 		DELAY(10);
 		sts = ALPM_SMBINB(sc, SMBSTS);
 		if (sts & SMI_I_STS)
@@ -352,9 +342,12 @@
 	struct alpm_softc *sc = (struct alpm_softc *)device_get_softc(dev);
 	int error;
 
+	ALPM_LOCK(sc);
 	alpm_clear(sc);
-	if (!alpm_idle(sc))
+	if (!alpm_idle(sc)) {
+		ALPM_UNLOCK(sc);
 		return (EBUSY);
+	}
 
 	switch (how) {
 	case SMB_QWRITE:
@@ -375,6 +368,7 @@
 	error = alpm_wait(sc);
 
 	ALPM_DEBUG(printf(", error=0x%x\n", error));
+	ALPM_UNLOCK(sc);
 
 	return (error);
 }
@@ -385,9 +379,12 @@
 	struct alpm_softc *sc = (struct alpm_softc *)device_get_softc(dev);
 	int error;
 
+	ALPM_LOCK(sc);
 	alpm_clear(sc);
-	if (!alpm_idle(sc))
+	if (!alpm_idle(sc)) {
+		ALPM_UNLOCK(sc);
 		return (SMB_EBUSY);
+	}
 
 	ALPM_SMBOUTB(sc, SMBHADDR, slave & ~LSB);
 	ALPM_SMBOUTB(sc, SMBCMD, SMBSRBYTE);
@@ -397,6 +394,7 @@
 	error = alpm_wait(sc);
 
 	ALPM_DEBUG(printf("alpm: SENDB to 0x%x, byte=0x%x, error=0x%x\n", slave, byte, error));
+	ALPM_UNLOCK(sc);
 
 	return (error);
 }
@@ -407,9 +405,12 @@
 	struct alpm_softc *sc = (struct alpm_softc *)device_get_softc(dev);
 	int error;
 
+	ALPM_LOCK(sc);
 	alpm_clear(sc);
-	if (!alpm_idle(sc))
+	if (!alpm_idle(sc)) {
+		ALPM_UNLOCK(sc);
 		return (SMB_EBUSY);
+	}
 
 	ALPM_SMBOUTB(sc, SMBHADDR, slave | LSB);
 	ALPM_SMBOUTB(sc, SMBCMD, SMBSRBYTE);
@@ -419,6 +420,7 @@
 		*byte = ALPM_SMBINB(sc, SMBHDATA);
 
 	ALPM_DEBUG(printf("alpm: RECVB from 0x%x, byte=0x%x, error=0x%x\n", slave, *byte, error));
+	ALPM_UNLOCK(sc);
 
 	return (error);
 }
@@ -429,9 +431,12 @@
 	struct alpm_softc *sc = (struct alpm_softc *)device_get_softc(dev);
 	int error;
 
+	ALPM_LOCK(sc);
 	alpm_clear(sc);
-	if (!alpm_idle(sc))
+	if (!alpm_idle(sc)) {
+		ALPM_UNLOCK(sc);
 		return (SMB_EBUSY);
+	}
 
 	ALPM_SMBOUTB(sc, SMBHADDR, slave & ~LSB);
 	ALPM_SMBOUTB(sc, SMBCMD, SMBWRBYTE);
@@ -442,6 +447,7 @@
 	error = alpm_wait(sc);
 
 	ALPM_DEBUG(printf("alpm: WRITEB to 0x%x, cmd=0x%x, byte=0x%x, error=0x%x\n", slave, cmd, byte, error));
+	ALPM_UNLOCK(sc);
 
 	return (error);
 }
@@ -452,9 +458,12 @@
 	struct alpm_softc *sc = (struct alpm_softc *)device_get_softc(dev);
 	int error;
 
+	ALPM_LOCK(sc);
 	alpm_clear(sc);
-	if (!alpm_idle(sc))
+	if (!alpm_idle(sc)) {
+		ALPM_UNLOCK(sc);
 		return (SMB_EBUSY);
+	}
 
 	ALPM_SMBOUTB(sc, SMBHADDR, slave | LSB);
 	ALPM_SMBOUTB(sc, SMBCMD, SMBWRBYTE);
@@ -465,6 +474,7 @@
 		*byte = ALPM_SMBINB(sc, SMBHDATA);
 
 	ALPM_DEBUG(printf("alpm: READB from 0x%x, cmd=0x%x, byte=0x%x, error=0x%x\n", slave, cmd, *byte, error));
+	ALPM_UNLOCK(sc);
 
 	return (error);
 }
@@ -475,9 +485,12 @@
 	struct alpm_softc *sc = (struct alpm_softc *)device_get_softc(dev);
 	int error;
 
+	ALPM_LOCK(sc);
 	alpm_clear(sc);
-	if (!alpm_idle(sc))
+	if (!alpm_idle(sc)) {
+		ALPM_UNLOCK(sc);
 		return (SMB_EBUSY);
+	}
 
 	ALPM_SMBOUTB(sc, SMBHADDR, slave & ~LSB);
 	ALPM_SMBOUTB(sc, SMBCMD, SMBWRWORD);
@@ -489,6 +502,7 @@
 	error = alpm_wait(sc);
 
 	ALPM_DEBUG(printf("alpm: WRITEW to 0x%x, cmd=0x%x, word=0x%x, error=0x%x\n", slave, cmd, word, error));
+	ALPM_UNLOCK(sc);
 
 	return (error);
 }
@@ -500,9 +514,12 @@
 	int error;
 	u_char high, low;
 
+	ALPM_LOCK(sc);
 	alpm_clear(sc);
-	if (!alpm_idle(sc))
+	if (!alpm_idle(sc)) {
+		ALPM_UNLOCK(sc);
 		return (SMB_EBUSY);
+	}
 
 	ALPM_SMBOUTB(sc, SMBHADDR, slave | LSB);
 	ALPM_SMBOUTB(sc, SMBCMD, SMBWRWORD);
@@ -517,6 +534,7 @@
 	}
 
 	ALPM_DEBUG(printf("alpm: READW from 0x%x, cmd=0x%x, word=0x%x, error=0x%x\n", slave, cmd, *word, error));
+	ALPM_UNLOCK(sc);
 
 	return (error);
 }
@@ -525,82 +543,86 @@
 alpm_bwrite(device_t dev, u_char slave, char cmd, u_char count, char *buf)
 {
 	struct alpm_softc *sc = (struct alpm_softc *)device_get_softc(dev);
-	u_char remain, len, i;
-	int error = SMB_ENOERR;
+	u_char i;
+	int error;
+
+	if (count < 1 || count > 32)
+		return (SMB_EINVAL);
 
+	ALPM_LOCK(sc);
 	alpm_clear(sc);
-	if(!alpm_idle(sc))
+	if(!alpm_idle(sc)) {
+		ALPM_UNLOCK(sc);
 		return (SMB_EBUSY);
+	}
 
-	remain = count;
-	while (remain) {
-		len = min(remain, 32);
-
-		ALPM_SMBOUTB(sc, SMBHADDR, slave & ~LSB);
+	ALPM_SMBOUTB(sc, SMBHADDR, slave & ~LSB);
 	
-		/* set the cmd and reset the
-		 * 32-byte long internal buffer */
-		ALPM_SMBOUTB(sc, SMBCMD, SMBWRBLOCK | SMB_BLK_CLR);
-
-		ALPM_SMBOUTB(sc, SMBHDATA, len);
-
-		/* fill the 32-byte internal buffer */
-		for (i=0; i<len; i++) {
-			ALPM_SMBOUTB(sc, SMBHBLOCK, buf[count-remain+i]);
-			DELAY(2);
-		}
-		ALPM_SMBOUTB(sc, SMBHCMD, cmd);
-		ALPM_SMBOUTB(sc, SMBSTART, 0xff);
-
-		if ((error = alpm_wait(sc)) != SMB_ENOERR)
-			goto error;
-
-		remain -= len;
+	/* set the cmd and reset the
+	 * 32-byte long internal buffer */
+	ALPM_SMBOUTB(sc, SMBCMD, SMBWRBLOCK | SMB_BLK_CLR);
+
+	ALPM_SMBOUTB(sc, SMBHDATA, count);
+
+	/* fill the 32-byte internal buffer */
+	for (i = 0; i < count; i++) {
+		ALPM_SMBOUTB(sc, SMBHBLOCK, buf[i]);
+		DELAY(2);
 	}
+	ALPM_SMBOUTB(sc, SMBHCMD, cmd);
+	ALPM_SMBOUTB(sc, SMBSTART, 0xff);
+
+	error = alpm_wait(sc);
 
-error:
 	ALPM_DEBUG(printf("alpm: WRITEBLK to 0x%x, count=0x%x, cmd=0x%x, error=0x%x", slave, count, cmd, error));
+	ALPM_UNLOCK(sc);
 
 	return (error);
 }
 
 static int
-alpm_bread(device_t dev, u_char slave, char cmd, u_char count, char *buf)
+alpm_bread(device_t dev, u_char slave, char cmd, u_char *count, char *buf)
 {
 	struct alpm_softc *sc = (struct alpm_softc *)device_get_softc(dev);
-	u_char remain, len, i;
-	int error = SMB_ENOERR;
+	u_char data, len, i;
+	int error;
+
+	if (*count < 1 || *count > 32)
+		return (SMB_EINVAL);
 
+	ALPM_LOCK(sc);
 	alpm_clear(sc);
-	if (!alpm_idle(sc))
+	if (!alpm_idle(sc)) {
+		ALPM_UNLOCK(sc);
 		return (SMB_EBUSY);
+	}
 
-	remain = count;
-	while (remain) {
-		ALPM_SMBOUTB(sc, SMBHADDR, slave | LSB);
+	ALPM_SMBOUTB(sc, SMBHADDR, slave | LSB);
 	
-		/* set the cmd and reset the
-		 * 32-byte long internal buffer */
-		ALPM_SMBOUTB(sc, SMBCMD, SMBWRBLOCK | SMB_BLK_CLR);
+	/* set the cmd and reset the
+	 * 32-byte long internal buffer */
+	ALPM_SMBOUTB(sc, SMBCMD, SMBWRBLOCK | SMB_BLK_CLR);
 
-		ALPM_SMBOUTB(sc, SMBHCMD, cmd);
-		ALPM_SMBOUTB(sc, SMBSTART, 0xff);
+	ALPM_SMBOUTB(sc, SMBHCMD, cmd);
+	ALPM_SMBOUTB(sc, SMBSTART, 0xff);
 
-		if ((error = alpm_wait(sc)) != SMB_ENOERR)
+	if ((error = alpm_wait(sc)) != SMB_ENOERR)
 			goto error;
 
-		len = ALPM_SMBINB(sc, SMBHDATA);
+	len = ALPM_SMBINB(sc, SMBHDATA);
 
-		/* read the 32-byte internal buffer */
-		for (i=0; i<len; i++) {
-			buf[count-remain+i] = ALPM_SMBINB(sc, SMBHBLOCK);
-			DELAY(2);
-		}
-
-		remain -= len;
+	/* read the 32-byte internal buffer */
+	for (i = 0; i < len; i++) {
+		data = ALPM_SMBINB(sc, SMBHBLOCK);
+		if (i < *count)
+			buf[i] = data;
+		DELAY(2);
 	}
+	*count = len;
+
 error:
-	ALPM_DEBUG(printf("alpm: READBLK to 0x%x, count=0x%x, cmd=0x%x, error=0x%x", slave, count, cmd, error));
+	ALPM_DEBUG(printf("alpm: READBLK to 0x%x, count=0x%x, cmd=0x%x, error=0x%x", slave, *count, cmd, error));
+	ALPM_UNLOCK(sc);
 
 	return (error);
 }
@@ -635,6 +657,7 @@
 };
 
 DRIVER_MODULE(alpm, pci, alpm_driver, alpm_devclass, 0, 0);
+DRIVER_MODULE(smbus, alpm, smbus_driver, smbus_devclass, 0, 0);
 MODULE_DEPEND(alpm, pci, 1, 1, 1);
 MODULE_DEPEND(alpm, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER);
 MODULE_VERSION(alpm, 1);
--- sys/pci/xmaciireg.h
+++ /dev/null
@@ -1,403 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998, 1999, 2000
- *	Bill Paul <wpaul at ctr.columbia.edu>.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/pci/xmaciireg.h,v 1.4 2005/01/07 02:29:18 imp Exp $
- */
-
-/*
- * Registers and data structures for the XaQti Corporation XMAC II
- * Gigabit Ethernet MAC. Datasheet is available from http://www.xaqti.com.
- * The XMAC can be programmed for 16-bit or 32-bit register access modes.
- * The SysKonnect gigabit ethernet adapters use 16-bit mode, so that's
- * how the registers are laid out here.
- */
-
-#define XM_DEVICEID		0x00E0AE20
-#define XM_XAQTI_OUI		0x00E0AE
-
-#define XM_XMAC_REV(x)		(((x) & 0x000000E0) >> 5)
-
-#define XM_XMAC_REV_B2		0x0
-#define XM_XMAC_REV_C1		0x1
-
-#define XM_MMUCMD		0x0000
-#define XM_POFF			0x0008
-#define XM_BURST		0x000C
-#define XM_VLAN_TAGLEV1		0x0010
-#define XM_VLAN_TAGLEV2		0x0014
-#define XM_TXCMD		0x0020
-#define XM_TX_RETRYLIMIT	0x0024
-#define XM_TX_SLOTTIME		0x0028
-#define XM_TX_IPG		0x003C
-#define XM_RXCMD		0x0030
-#define XM_PHY_ADDR		0x0034
-#define XM_PHY_DATA		0x0038
-#define XM_GPIO			0x0040
-#define XM_IMR			0x0044
-#define XM_ISR			0x0048
-#define XM_HWCFG		0x004C
-#define XM_TX_LOWAT		0x0060
-#define XM_TX_HIWAT		0x0062
-#define XM_TX_REQTHRESH_LO	0x0064
-#define XM_TX_REQTHRESH_HI	0x0066
-#define XM_TX_REQTHRESH		XM_TX_REQTHRESH_LO
-#define XM_PAUSEDST0		0x0068
-#define XM_PAUSEDST1		0x006A
-#define XM_PAUSEDST2		0x006C
-#define XM_CTLPARM_LO		0x0070
-#define XM_CTLPARM_HI		0x0072
-#define XM_CTLPARM		XM_CTLPARM_LO
-#define XM_OPCODE_PAUSE_TIMER	0x0074
-#define XM_TXSTAT_LIFO		0x0078
-
-/*
- * Perfect filter registers. The XMAC has a table of 16 perfect
- * filter entries, spaced 8 bytes apart. This is in addition to
- * the station address registers, which appear below.
- */
-#define XM_RXFILT_BASE		0x0080
-#define XM_RXFILT_END		0x0107
-#define XM_RXFILT_MAX		16
-#define XM_RXFILT_ENTRY(ent)		(XM_RXFILT_BASE + ((ent * 8)))
-
-/* Primary station address. */
-#define XM_PAR0			0x0108
-#define XM_PAR1			0x010A
-#define XM_PAR2			0x010C
-
-/* 64-bit multicast hash table registers */
-#define XM_MAR0			0x0110
-#define XM_MAR1			0x0112
-#define XM_MAR2			0x0114
-#define XM_MAR3			0x0116
-#define XM_RX_LOWAT		0x0118
-#define XM_RX_HIWAT		0x011A
-#define XM_RX_REQTHRESH_LO	0x011C
-#define XM_RX_REQTHRESH_HI	0x011E
-#define XM_RX_REQTHRESH		XM_RX_REQTHRESH_LO
-#define XM_DEVID_LO		0x0120
-#define XM_DEVID_HI		0x0122
-#define XM_DEVID		XM_DEVID_LO
-#define XM_MODE_LO		0x0124
-#define XM_MODE_HI		0x0126
-#define XM_MODE			XM_MODE_LO
-#define XM_LASTSRC0		0x0128
-#define XM_LASTSRC1		0x012A
-#define XM_LASTSRC2		0x012C
-#define XM_TSTAMP_READ		0x0130
-#define XM_TSTAMP_LOAD		0x0134
-#define XM_STATS_CMD		0x0200
-#define XM_RXCNT_EVENT_LO	0x0204
-#define XM_RXCNT_EVENT_HI	0x0206
-#define XM_RXCNT_EVENT		XM_RXCNT_EVENT_LO
-#define XM_TXCNT_EVENT_LO	0x0208
-#define XM_TXCNT_EVENT_HI	0x020A
-#define XM_TXCNT_EVENT		XM_TXCNT_EVENT_LO
-#define XM_RXCNT_EVMASK_LO	0x020C
-#define XM_RXCNT_EVMASK_HI	0x020E
-#define XM_RXCNT_EVMASK		XM_RXCNT_EVMASK_LO
-#define XM_TXCNT_EVMASK_LO	0x0210
-#define XM_TXCNT_EVMASK_HI	0x0212
-#define XM_TXCNT_EVMASK		XM_TXCNT_EVMASK_LO
-
-/* Statistics command register */
-#define XM_STATCMD_CLR_TX	0x0001
-#define XM_STATCMD_CLR_RX	0x0002
-#define XM_STATCMD_COPY_TX	0x0004
-#define XM_STATCMD_COPY_RX	0x0008
-#define XM_STATCMD_SNAP_TX	0x0010
-#define XM_STATCMD_SNAP_RX	0x0020
-
-/* TX statistics registers */
-#define XM_TXSTATS_PKTSOK	0x280
-#define XM_TXSTATS_BYTESOK_HI	0x284
-#define XM_TXSTATS_BYTESOK_LO	0x288
-#define XM_TXSTATS_BCASTSOK	0x28C
-#define XM_TXSTATS_MCASTSOK	0x290
-#define XM_TXSTATS_UCASTSOK	0x294
-#define XM_TXSTATS_GIANTS	0x298
-#define XM_TXSTATS_BURSTCNT	0x29C
-#define XM_TXSTATS_PAUSEPKTS	0x2A0
-#define XM_TXSTATS_MACCTLPKTS	0x2A4
-#define XM_TXSTATS_SINGLECOLS	0x2A8
-#define XM_TXSTATS_MULTICOLS	0x2AC
-#define XM_TXSTATS_EXCESSCOLS	0x2B0
-#define XM_TXSTATS_LATECOLS	0x2B4
-#define XM_TXSTATS_DEFER	0x2B8
-#define XM_TXSTATS_EXCESSDEFER	0x2BC
-#define XM_TXSTATS_UNDERRUN	0x2C0
-#define XM_TXSTATS_CARRIERSENSE	0x2C4
-#define XM_TXSTATS_UTILIZATION	0x2C8
-#define XM_TXSTATS_64		0x2D0
-#define XM_TXSTATS_65_127	0x2D4
-#define XM_TXSTATS_128_255	0x2D8
-#define XM_TXSTATS_256_511	0x2DC
-#define XM_TXSTATS_512_1023	0x2E0
-#define XM_TXSTATS_1024_MAX	0x2E4
-
-/* RX statistics registers */
-#define XM_RXSTATS_PKTSOK	0x300
-#define XM_RXSTATS_BYTESOK_HI	0x304
-#define XM_RXSTATS_BYTESOK_LO	0x308
-#define XM_RXSTATS_BCASTSOK	0x30C
-#define XM_RXSTATS_MCASTSOK	0x310
-#define XM_RXSTATS_UCASTSOK	0x314
-#define XM_RXSTATS_PAUSEPKTS	0x318
-#define XM_RXSTATS_MACCTLPKTS	0x31C
-#define XM_RXSTATS_BADPAUSEPKTS	0x320
-#define XM_RXSTATS_BADMACCTLPKTS	0x324
-#define XM_RXSTATS_BURSTCNT	0x328
-#define XM_RXSTATS_MISSEDPKTS	0x32C
-#define XM_RXSTATS_FRAMEERRS	0x330
-#define XM_RXSTATS_OVERRUN	0x334
-#define XM_RXSTATS_JABBER	0x338
-#define XM_RXSTATS_CARRLOSS	0x33C
-#define XM_RXSTATS_INRNGLENERR	0x340
-#define XM_RXSTATS_SYMERR	0x344
-#define XM_RXSTATS_SHORTEVENT	0x348
-#define XM_RXSTATS_RUNTS	0x34C
-#define XM_RXSTATS_GIANTS	0x350
-#define XM_RXSTATS_CRCERRS	0x354
-#define XM_RXSTATS_CEXTERRS	0x35C
-#define XM_RXSTATS_UTILIZATION	0x360
-#define XM_RXSTATS_64		0x368
-#define XM_RXSTATS_65_127	0x36C
-#define XM_RXSTATS_128_255	0x370
-#define XM_RXSTATS_256_511	0x374
-#define XM_RXSTATS_512_1023	0x378
-#define XM_RXSTATS_1024_MAX	0x37C
-
-#define XM_MMUCMD_TX_ENB	0x0001
-#define XM_MMUCMD_RX_ENB	0x0002
-#define XM_MMUCMD_GMIILOOP	0x0004
-#define XM_MMUCMD_RATECTL	0x0008
-#define XM_MMUCMD_GMIIFDX	0x0010
-#define XM_MMUCMD_NO_MGMT_PRMB	0x0020
-#define XM_MMUCMD_SIMCOL	0x0040
-#define XM_MMUCMD_FORCETX	0x0080
-#define XM_MMUCMD_LOOPENB	0x0200
-#define XM_MMUCMD_IGNPAUSE	0x0400
-#define XM_MMUCMD_PHYBUSY	0x0800
-#define XM_MMUCMD_PHYDATARDY	0x1000
-
-#define XM_TXCMD_AUTOPAD	0x0001
-#define XM_TXCMD_NOCRC		0x0002
-#define XM_TXCMD_NOPREAMBLE	0x0004
-#define XM_TXCMD_NOGIGAMODE	0x0008
-#define XM_TXCMD_SAMPLELINE	0x0010
-#define XM_TXCMD_ENCBYPASS	0x0020
-#define XM_TXCMD_XMITBK2BK	0x0040
-#define XM_TXCMD_FAIRSHARE	0x0080
-
-#define XM_RXCMD_DISABLE_CEXT	0x0001
-#define XM_RXCMD_STRIPPAD	0x0002
-#define XM_RXCMD_SAMPLELINE	0x0004
-#define XM_RXCMD_SELFRX		0x0008
-#define XM_RXCMD_STRIPFCS	0x0010
-#define XM_RXCMD_TRANSPARENT	0x0020
-#define XM_RXCMD_IPGCAPTURE	0x0040
-#define XM_RXCMD_BIGPKTOK	0x0080
-#define XM_RXCMD_LENERROK	0x0100
-
-#define XM_GPIO_GP0_SET		0x0001
-#define XM_GPIO_RESETSTATS	0x0004
-#define XM_GPIO_RESETMAC	0x0008
-#define XM_GPIO_FORCEINT	0x0020
-#define XM_GPIO_ANEGINPROG	0x0040
-
-#define XM_IMR_RX_EOF		0x0001
-#define XM_IMR_TX_EOF		0x0002
-#define XM_IMR_TX_UNDERRUN	0x0004
-#define XM_IMR_RX_OVERRUN	0x0008
-#define XM_IMR_TX_STATS_OFLOW	0x0010
-#define XM_IMR_RX_STATS_OFLOW	0x0020
-#define XM_IMR_TSTAMP_OFLOW	0x0040
-#define XM_IMR_AUTONEG_DONE	0x0080
-#define XM_IMR_NEXTPAGE_RDY	0x0100
-#define XM_IMR_PAGE_RECEIVED	0x0200
-#define XM_IMR_LP_REQCFG	0x0400
-#define XM_IMR_GP0_SET		0x0800
-#define XM_IMR_FORCEINTR	0x1000
-#define XM_IMR_TX_ABORT		0x2000
-#define XM_IMR_LINKEVENT	0x4000
-
-#define XM_INTRS	\
-	(~(XM_IMR_GP0_SET|XM_IMR_AUTONEG_DONE|XM_IMR_TX_UNDERRUN))
-
-#define XM_ISR_RX_EOF		0x0001
-#define XM_ISR_TX_EOF		0x0002
-#define XM_ISR_TX_UNDERRUN	0x0004
-#define XM_ISR_RX_OVERRUN	0x0008
-#define XM_ISR_TX_STATS_OFLOW	0x0010
-#define XM_ISR_RX_STATS_OFLOW	0x0020
-#define XM_ISR_TSTAMP_OFLOW	0x0040
-#define XM_ISR_AUTONEG_DONE	0x0080
-#define XM_ISR_NEXTPAGE_RDY	0x0100
-#define XM_ISR_PAGE_RECEIVED	0x0200
-#define XM_ISR_LP_REQCFG	0x0400
-#define XM_ISR_GP0_SET		0x0800
-#define XM_ISR_FORCEINTR	0x1000
-#define XM_ISR_TX_ABORT		0x2000
-#define XM_ISR_LINKEVENT	0x4000
-
-#define XM_HWCFG_GENEOP		0x0008
-#define XM_HWCFG_SIGSTATCKH	0x0004
-#define XM_HWCFG_GMIIMODE	0x0001
-
-#define XM_MODE_FLUSH_RXFIFO	0x00000001
-#define XM_MODE_FLUSH_TXFIFO	0x00000002
-#define XM_MODE_BIGENDIAN	0x00000004
-#define XM_MODE_RX_PROMISC	0x00000008
-#define XM_MODE_RX_NOBROAD	0x00000010
-#define XM_MODE_RX_NOMULTI	0x00000020
-#define XM_MODE_RX_NOUNI	0x00000040
-#define XM_MODE_RX_BADFRAMES	0x00000080
-#define XM_MODE_RX_CRCERRS	0x00000100
-#define XM_MODE_RX_GIANTS	0x00000200
-#define XM_MODE_RX_INRANGELEN	0x00000400
-#define XM_MODE_RX_RUNTS	0x00000800
-#define XM_MODE_RX_MACCTL	0x00001000
-#define XM_MODE_RX_USE_PERFECT	0x00002000
-#define XM_MODE_RX_USE_STATION	0x00004000
-#define XM_MODE_RX_USE_HASH	0x00008000
-#define XM_MODE_RX_ADDRPAIR	0x00010000
-#define XM_MODE_PAUSEONHI	0x00020000
-#define XM_MODE_PAUSEONLO	0x00040000
-#define XM_MODE_TIMESTAMP	0x00080000
-#define XM_MODE_SENDPAUSE	0x00100000
-#define XM_MODE_SENDCONTINUOUS	0x00200000
-#define XM_MODE_LE_STATUSWORD	0x00400000
-#define XM_MODE_AUTOFIFOPAUSE	0x00800000
-#define XM_MODE_EXPAUSEGEN	0x02000000
-#define XM_MODE_RX_INVERSE	0x04000000
-
-#define XM_RXSTAT_MACCTL	0x00000001
-#define XM_RXSTAT_ERRFRAME	0x00000002
-#define XM_RXSTAT_CRCERR	0x00000004
-#define XM_RXSTAT_GIANT		0x00000008
-#define XM_RXSTAT_RUNT		0x00000010
-#define XM_RXSTAT_FRAMEERR	0x00000020
-#define XM_RXSTAT_INRANGEERR	0x00000040
-#define XM_RXSTAT_CARRIERERR	0x00000080
-#define XM_RXSTAT_COLLERR	0x00000100
-#define XM_RXSTAT_802_3		0x00000200
-#define XM_RXSTAT_CARREXTERR	0x00000400
-#define XM_RXSTAT_BURSTMODE	0x00000800
-#define XM_RXSTAT_UNICAST	0x00002000
-#define XM_RXSTAT_MULTICAST	0x00004000
-#define XM_RXSTAT_BROADCAST	0x00008000
-#define XM_RXSTAT_VLAN_LEV1	0x00010000
-#define XM_RXSTAT_VLAN_LEV2	0x00020000
-#define XM_RXSTAT_LEN		0xFFFC0000
-
-/*
- * XMAC PHY registers, indirectly accessed through
- * XM_PHY_ADDR and XM_PHY_REG.
- */
-
-#define XM_PHY_BMCR		0x0000	/* control */
-#define XM_PHY_BMSR		0x0001	/* status */
-#define XM_PHY_VENID		0x0002	/* vendor id */
-#define XM_PHY_DEVID		0x0003	/* device id */
-#define XM_PHY_ANAR		0x0004	/* autoneg advertisenemt */
-#define XM_PHY_LPAR		0x0005	/* link partner ability */
-#define XM_PHY_ANEXP		0x0006	/* autoneg expansion */
-#define XM_PHY_NEXTP		0x0007	/* nextpage */
-#define XM_PHY_LPNEXTP		0x0008	/* link partner's nextpage */
-#define XM_PHY_EXTSTS		0x000F	/* extented status */
-#define XM_PHY_RESAB		0x0010	/* resolved ability */
-
-#define XM_BMCR_DUPLEX		0x0100
-#define XM_BMCR_RENEGOTIATE	0x0200
-#define XM_BMCR_AUTONEGENBL	0x1000
-#define XM_BMCR_LOOPBACK	0x4000
-#define XM_BMCR_RESET		0x8000
-
-#define XM_BMSR_EXTCAP		0x0001
-#define XM_BMSR_LINKSTAT	0x0004
-#define XM_BMSR_AUTONEGABLE	0x0008
-#define XM_BMSR_REMFAULT	0x0010
-#define XM_BMSR_AUTONEGDONE	0x0020
-#define XM_BMSR_EXTSTAT		0x0100
-
-#define XM_VENID_XAQTI		0xD14C
-#define XM_DEVID_XMAC		0x0002
-
-#define XM_ANAR_FULLDUPLEX	0x0020
-#define XM_ANAR_HALFDUPLEX	0x0040
-#define XM_ANAR_PAUSEBITS	0x0180
-#define XM_ANAR_REMFAULTBITS	0x1800
-#define XM_ANAR_ACK		0x4000
-#define XM_ANAR_NEXTPAGE	0x8000
-
-#define XM_LPAR_FULLDUPLEX	0x0020
-#define XM_LPAR_HALFDUPLEX	0x0040
-#define XM_LPAR_PAUSEBITS	0x0180
-#define XM_LPAR_REMFAULTBITS	0x1800
-#define XM_LPAR_ACK		0x4000
-#define XM_LPAR_NEXTPAGE	0x8000
-
-#define XM_PAUSE_NOPAUSE	0x0000
-#define XM_PAUSE_SYMPAUSE	0x0080
-#define XM_PAUSE_ASYMPAUSE	0x0100
-#define XM_PAUSE_BOTH		0x0180
-
-#define XM_REMFAULT_LINKOK	0x0000
-#define XM_REMFAULT_LINKFAIL	0x0800
-#define XM_REMFAULT_OFFLINE	0x1000
-#define XM_REMFAULT_ANEGERR	0x1800
-
-#define XM_ANEXP_GOTPAGE	0x0002
-#define XM_ANEXP_NEXTPAGE_SELF	0x0004
-#define XM_ANEXP_NEXTPAGE_LP	0x0008
-
-#define XM_NEXTP_MESSAGE	0x07FF
-#define XM_NEXTP_TOGGLE		0x0800
-#define XM_NEXTP_ACK2		0x1000
-#define XM_NEXTP_MPAGE		0x2000
-#define XM_NEXTP_ACK1		0x4000
-#define XM_NEXTP_NPAGE		0x8000
-
-#define XM_LPNEXTP_MESSAGE	0x07FF
-#define XM_LPNEXTP_TOGGLE	0x0800
-#define XM_LPNEXTP_ACK2		0x1000
-#define XM_LPNEXTP_MPAGE	0x2000
-#define XM_LPNEXTP_ACK1		0x4000
-#define XM_LPNEXTP_NPAGE	0x8000
-
-#define XM_EXTSTS_HALFDUPLEX	0x4000
-#define XM_EXTSTS_FULLDUPLEX	0x8000
-
-#define XM_RESAB_PAUSEMISMATCH	0x0008
-#define XM_RESAB_ABLMISMATCH	0x0010
-#define XM_RESAB_FDMODESEL	0x0020
-#define XM_RESAB_HDMODESEL	0x0040
-#define XM_RESAB_PAUSEBITS	0x0180
Index: if_wbreg.h
===================================================================
RCS file: /home/cvs/src/sys/pci/if_wbreg.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/if_wbreg.h -L sys/pci/if_wbreg.h -u -r1.1.1.1 -r1.2
--- sys/pci/if_wbreg.h
+++ sys/pci/if_wbreg.h
@@ -29,7 +29,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/pci/if_wbreg.h,v 1.12.2.2 2005/11/15 19:59:04 jhb Exp $
+ * $FreeBSD: src/sys/pci/if_wbreg.h,v 1.17 2006/09/15 11:01:23 ru Exp $
  */
 
 /*
@@ -363,6 +363,7 @@
 
 struct wb_softc {
 	struct ifnet		*wb_ifp;	/* interface info */
+	device_t		wb_dev;
 	device_t		wb_miibus;
 	bus_space_handle_t	wb_bhandle;
 	bus_space_tag_t		wb_btag;
@@ -461,8 +462,3 @@
 #define WB_PSTATE_D3		0x0003
 #define WB_PME_EN		0x0010
 #define WB_PME_STATUS		0x8000
-
-#ifdef __alpha__
-#undef vtophys
-#define vtophys(va)		alpha_XXX_dmamap((vm_offset_t)va)
-#endif
Index: if_wb.c
===================================================================
RCS file: /home/cvs/src/sys/pci/if_wb.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -L sys/pci/if_wb.c -L sys/pci/if_wb.c -u -r1.2 -r1.3
--- sys/pci/if_wb.c
+++ sys/pci/if_wb.c
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/if_wb.c,v 1.79.2.5 2005/11/15 19:59:04 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/if_wb.c,v 1.92 2007/02/23 12:19:03 piso Exp $");
 
 /*
  * Winbond fast ethernet PCI NIC driver
@@ -83,8 +83,6 @@
  * three of my test boards seems fine.
  */
 
-#include "opt_bdg.h"
-
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/sockio.h>
@@ -117,7 +115,7 @@
 #include <dev/mii/mii.h>
 #include <dev/mii/miivar.h>
 
-/* "controller miibus0" required.  See GENERIC if you get errors here. */
+/* "device miibus" required.  See GENERIC if you get errors here. */
 #include "miibus_if.h"
 
 #define WB_USEIOSPACE
@@ -657,7 +655,7 @@
 		}
 
 		if (i == WB_TIMEOUT)
-			if_printf(sc->wb_ifp,
+			device_printf(sc->wb_dev,
 			    "failed to force tx and rx to idle state\n");
 	}
 
@@ -698,7 +696,7 @@
 			break;
 	}
 	if (i == WB_TIMEOUT)
-		if_printf(sc->wb_ifp, "reset never completed!\n");
+		device_printf(sc->wb_dev, "reset never completed!\n");
 
 	/* Wait a little while for the chip to get its brains in order. */
 	DELAY(1000);
@@ -786,6 +784,7 @@
 	int			error = 0, rid;
 
 	sc = device_get_softc(dev);
+	sc->wb_dev = dev;
 
 	mtx_init(&sc->wb_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
 	    MTX_DEF);
@@ -873,7 +872,7 @@
 
 	/* Hook interrupt last to avoid having to lock softc */
 	error = bus_setup_intr(dev, sc->wb_irq, INTR_TYPE_NET | INTR_MPSAFE,
-	    wb_intr, sc, &sc->wb_intrhand);
+	    NULL, wb_intr, sc, &sc->wb_intrhand);
 
 	if (error) {
 		device_printf(dev, "couldn't set up irq\n");
@@ -917,8 +916,6 @@
 		callout_drain(&sc->wb_stat_callout);
 		ether_ifdetach(ifp);
 	}
-	if (ifp)
-		if_free(ifp);
 	if (sc->wb_miibus)
 		device_delete_child(dev, sc->wb_miibus);
 	bus_generic_detach(dev);
@@ -930,6 +927,9 @@
 	if (sc->wb_res)
 		bus_release_resource(dev, WB_RES, WB_RID, sc->wb_res);
 
+	if (ifp)
+		if_free(ifp);
+
 	if (sc->wb_ldata) {
 		contigfree(sc->wb_ldata, sizeof(struct wb_list_data) + 8,
 		    M_DEVBUF);
@@ -1088,8 +1088,9 @@
 		    !(rxstat & WB_RXSTAT_RXCMP)) {
 			ifp->if_ierrors++;
 			wb_newbuf(sc, cur_rx, m);
-			if_printf(ifp, "receiver babbling: possible chip "
-				"bug, forcing reset\n");
+			device_printf(sc->wb_dev,
+			    "receiver babbling: possible chip bug,"
+			    " forcing reset\n");
 			wb_fixmedia(sc);
 			wb_reset(sc);
 			wb_init_locked(sc);
@@ -1598,12 +1599,12 @@
 
 	/* Init our MAC address */
 	for (i = 0; i < ETHER_ADDR_LEN; i++) {
-		CSR_WRITE_1(sc, WB_NODE0 + i, IFP2ENADDR(sc->wb_ifp)[i]);
+		CSR_WRITE_1(sc, WB_NODE0 + i, IF_LLADDR(sc->wb_ifp)[i]);
 	}
 
 	/* Init circular RX list. */
 	if (wb_list_rx_init(sc) == ENOBUFS) {
-		if_printf(ifp,
+		device_printf(sc->wb_dev,
 		    "initialization failed: no memory for rx buffers\n");
 		wb_stop(sc);
 		return;
Index: if_sisreg.h
===================================================================
RCS file: /home/cvs/src/sys/pci/if_sisreg.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/if_sisreg.h -L sys/pci/if_sisreg.h -u -r1.1.1.1 -r1.2
--- sys/pci/if_sisreg.h
+++ sys/pci/if_sisreg.h
@@ -29,7 +29,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/pci/if_sisreg.h,v 1.33.2.1 2005/09/29 18:52:21 jhb Exp $
+ * $FreeBSD: src/sys/pci/if_sisreg.h,v 1.38 2007/02/24 14:27:36 delphij Exp $
  */
 
 /*
@@ -431,12 +431,9 @@
 
 struct sis_softc {
 	struct ifnet		*sis_ifp;	/* interface info */
-	bus_space_handle_t	sis_bhandle;
-	bus_space_tag_t		sis_btag;
-	struct resource		*sis_res;
-	struct resource		*sis_irq;
+	struct resource		*sis_res[2];
 	void			*sis_intrhand;
-	device_t		sis_self;
+	device_t		sis_dev;
 	device_t		sis_miibus;
 	u_int8_t		sis_type;
 	u_int8_t		sis_rev;
@@ -457,6 +454,7 @@
 	u_int32_t		sis_rx_paddr;
 	u_int32_t		sis_tx_paddr;
 	struct callout		sis_stat_ch;
+	int			sis_watchdog_timer;
 	int			sis_stopped;
 #ifdef DEVICE_POLLING
 	int			rxcycles;
@@ -465,22 +463,6 @@
 	struct mtx		sis_mtx;
 };
 
-#define	SIS_LOCK(_sc)		mtx_lock(&(_sc)->sis_mtx)
-#define	SIS_UNLOCK(_sc)		mtx_unlock(&(_sc)->sis_mtx)
-#define	SIS_LOCK_ASSERT(_sc)	mtx_assert(&(_sc)->sis_mtx, MA_OWNED)
-
-/*
- * register space access macros
- */
-#define CSR_WRITE_4(sc, reg, val)	\
-	bus_space_write_4(sc->sis_btag, sc->sis_bhandle, reg, val)
-
-#define CSR_READ_4(sc, reg)		\
-	bus_space_read_4(sc->sis_btag, sc->sis_bhandle, reg)
-
-#define CSR_READ_2(sc, reg)		\
-	bus_space_read_2(sc->sis_btag, sc->sis_bhandle, reg)
-
 #define SIS_TIMEOUT		1000
 #define ETHER_ALIGN		2
 #define SIS_RXLEN		1536
Index: agpreg.h
===================================================================
RCS file: /home/cvs/src/sys/pci/agpreg.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/agpreg.h -L sys/pci/agpreg.h -u -r1.1.1.1 -r1.2
--- sys/pci/agpreg.h
+++ sys/pci/agpreg.h
@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$FreeBSD: src/sys/pci/agpreg.h,v 1.13.8.3 2005/12/14 00:47:25 anholt Exp $
+ *	$FreeBSD: src/sys/pci/agpreg.h,v 1.19 2007/07/13 16:28:12 anholt Exp $
  */
 
 #ifndef _PCI_AGPREG_H_
@@ -32,18 +32,12 @@
 /*
  * Offsets for various AGP configuration registers.
  */
-#define AGP_APBASE		0x10
-#define AGP_CAPPTR		0x34
+#define AGP_APBASE		PCIR_BAR(0)
 
 /*
  * Offsets from the AGP Capability pointer.
  */
 #define AGP_CAPID		0x0
-#define AGP_CAPID_GET_MAJOR(x)		(((x) & 0x00f00000U) >> 20)
-#define AGP_CAPID_GET_MINOR(x)		(((x) & 0x000f0000U) >> 16)
-#define AGP_CAPID_GET_NEXT_PTR(x)	(((x) & 0x0000ff00U) >> 8)
-#define AGP_CAPID_GET_CAP_ID(x)		(((x) & 0x000000ffU) >> 0)
-
 #define AGP_STATUS		0x4
 #define AGP_COMMAND		0x8
 #define AGP_STATUS_AGP3		0x0008
@@ -79,11 +73,11 @@
 #define AGP_INTEL_ATTBASE	0xb8
 
 /*
- * Config offsets for Intel i820/i840/i845/i850/i860/i865 AGP chipsets.
+ * Config offsets for Intel i8xx/E7xxx AGP chipsets.
  */
 #define AGP_INTEL_MCHCFG	0x50
 #define AGP_INTEL_I820_RDCR	0x51
-#define AGP_INTEL_I845_MCHCFG	0x51
+#define AGP_INTEL_I845_AGPM	0x51
 #define AGP_INTEL_I8XX_ERRSTS	0xc8
 
 /*
@@ -186,11 +180,19 @@
  * Memory mapped register offsets for i810 chipset.
  */
 #define AGP_I810_PGTBL_CTL	0x2020
+/**
+ * This field determines the actual size of the global GTT on the 965
+ * and G33
+ */
+#define AGP_I810_PGTBL_SIZE_MASK	0x0000000e
+#define AGP_I810_PGTBL_SIZE_512KB	(0 << 1)
+#define AGP_I810_PGTBL_SIZE_256KB	(1 << 1)
+#define AGP_I810_PGTBL_SIZE_128KB	(2 << 1)
 #define AGP_I810_DRT		0x3000
 #define AGP_I810_DRT_UNPOPULATED 0x00
 #define AGP_I810_DRT_POPULATED	0x01
 #define AGP_I810_GTT		0x10000
- 
+
 /*
  * Config registers for i830MG device 0
  */
@@ -198,7 +200,7 @@
 #define AGP_I830_GCC1_DEV2		0x08
 #define AGP_I830_GCC1_DEV2_ENABLED	0x00
 #define AGP_I830_GCC1_DEV2_DISABLED	0x08
-#define AGP_I830_GCC1_GMS		0x70
+#define AGP_I830_GCC1_GMS		0xf0 /* Top bit reserved pre-G33 */
 #define AGP_I830_GCC1_GMS_STOLEN_512	0x20
 #define AGP_I830_GCC1_GMS_STOLEN_1024	0x30
 #define AGP_I830_GCC1_GMS_STOLEN_8192	0x40
@@ -250,6 +252,21 @@
 #define AGP_I915_MSAC_GMASIZE_256	0x00
 
 /*
+ * G965 registers
+ */
+#define AGP_I965_GTTMMADR		0x10
+#define AGP_I965_MSAC			0x62
+#define AGP_I965_MSAC_GMASIZE_128	0x00
+#define AGP_I965_MSAC_GMASIZE_256	0x02
+#define AGP_I965_MSAC_GMASIZE_512	0x06
+
+/*
+ * G33 registers
+ */
+#define AGP_G33_GCC1_GMS_STOLEN_128M	0x80
+#define AGP_G33_GCC1_GMS_STOLEN_256M	0x90
+
+/*
  * NVIDIA nForce/nForce2 registers
  */
 #define	AGP_NVIDIA_0_APBASE		0x10
Index: agp_via.c
===================================================================
RCS file: /home/cvs/src/sys/pci/agp_via.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/agp_via.c -L sys/pci/agp_via.c -u -r1.1.1.1 -r1.2
--- sys/pci/agp_via.c
+++ sys/pci/agp_via.c
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/agp_via.c,v 1.22 2005/06/26 04:01:11 anholt Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/agp_via.c,v 1.24.2.1 2007/11/08 20:29:53 jhb Exp $");
 
 #include "opt_bus.h"
 
@@ -85,6 +85,8 @@
 		return ("VIA 3296 (P4M800) host to PCI bridge");
 	case 0x03051106:
 		return ("VIA 82C8363 (Apollo KT133x/KM133) host to PCI bridge");
+	case 0x03241106:
+		return ("VIA VT3324 (CX700) host to PCI bridge");
 	case 0x03911106:
 		return ("VIA 8371 (Apollo KX133) host to PCI bridge");
 	case 0x05011106:
@@ -143,7 +145,6 @@
 		return (ENXIO);
 	desc = agp_via_match(dev);
 	if (desc) {
-		device_verbose(dev);
 		device_set_desc(dev, desc);
 		return BUS_PROBE_DEFAULT;
 	}
@@ -167,6 +168,7 @@
 	case 0x02591106:
 	case 0x02691106:
 	case 0x02961106:
+	case 0x03241106:
 	case 0x31231106:
 	case 0x31681106:
 	case 0x31891106:
@@ -228,6 +230,9 @@
 		pci_write_config(dev, sc->regs[REG_GARTCTRL], gartctrl | (3 << 7), 4);
 	}
 
+	device_printf(dev, "aperture size is %dM\n",
+		sc->initial_aperture / 1024 / 1024);
+
 	return 0;
 }
 
@@ -235,16 +240,14 @@
 agp_via_detach(device_t dev)
 {
 	struct agp_via_softc *sc = device_get_softc(dev);
-	int error;
 
-	error = agp_generic_detach(dev);
-	if (error)
-		return error;
+	agp_free_cdev(dev);
 
 	pci_write_config(dev, sc->regs[REG_GARTCTRL], 0, 4);
 	pci_write_config(dev, sc->regs[REG_ATTBASE], 0, 4);
 	AGP_SET_APERTURE(dev, sc->initial_aperture);
 	agp_free_gatt(sc->gatt);
+	agp_free_res(dev);
 
 	return 0;
 }
@@ -255,37 +258,93 @@
 	struct agp_via_softc *sc = device_get_softc(dev);
 	u_int32_t apsize;
 
-	apsize = pci_read_config(dev, sc->regs[REG_APSIZE], 1) & 0x1f;
+	if (sc->regs == via_v2_regs) {
+		apsize = pci_read_config(dev, sc->regs[REG_APSIZE], 1) & 0x1f;
 
-	/*
-	 * The size is determined by the number of low bits of
-	 * register APBASE which are forced to zero. The low 20 bits
-	 * are always forced to zero and each zero bit in the apsize
-	 * field just read forces the corresponding bit in the 27:20
-	 * to be zero. We calculate the aperture size accordingly.
-	 */
-	return (((apsize ^ 0xff) << 20) | ((1 << 20) - 1)) + 1;
+		/*
+		 * The size is determined by the number of low bits of
+		 * register APBASE which are forced to zero. The low 20 bits
+		 * are always forced to zero and each zero bit in the apsize
+		 * field just read forces the corresponding bit in the 27:20
+		 * to be zero. We calculate the aperture size accordingly.
+		 */
+		return (((apsize ^ 0xff) << 20) | ((1 << 20) - 1)) + 1;
+	} else {
+		apsize = pci_read_config(dev, sc->regs[REG_APSIZE], 2) & 0xfff;
+		switch (apsize) {
+		case 0x800:
+			return 0x80000000;
+		case 0xc00:
+			return 0x40000000;
+		case 0xe00:
+			return 0x20000000;
+		case 0xf00:
+			return 0x10000000;
+		case 0xf20:
+			return 0x08000000;
+		case 0xf30:
+			return 0x04000000;
+		case 0xf38:
+			return 0x02000000;
+		default:
+			device_printf(dev, "Invalid aperture setting 0x%x",
+			    pci_read_config(dev, sc->regs[REG_APSIZE], 2));
+			return 0;
+		}
+	}
 }
 
 static int
 agp_via_set_aperture(device_t dev, u_int32_t aperture)
 {
 	struct agp_via_softc *sc = device_get_softc(dev);
-	u_int32_t apsize;
+	u_int32_t apsize, key, val;
 
-	/*
-	 * Reverse the magic from get_aperture.
-	 */
-	apsize = ((aperture - 1) >> 20) ^ 0xff;
-
-	/*
-	 * Double check for sanity.
-	 */
-	if ((((apsize ^ 0xff) << 20) | ((1 << 20) - 1)) + 1 != aperture)
-		return EINVAL;
+	if (sc->regs == via_v2_regs) {
+		/*
+		 * Reverse the magic from get_aperture.
+		 */
+		apsize = ((aperture - 1) >> 20) ^ 0xff;
 
-	pci_write_config(dev, sc->regs[REG_APSIZE], apsize, 1);
+		/*
+	 	 * Double check for sanity.
+	 	 */
+		if ((((apsize ^ 0xff) << 20) | ((1 << 20) - 1)) + 1 != aperture)
+			return EINVAL;
 
+		pci_write_config(dev, sc->regs[REG_APSIZE], apsize, 1);
+	} else {
+		switch (aperture) {
+		case 0x80000000:
+			key = 0x800;
+			break;
+		case 0x40000000:
+			key = 0xc00;
+			break;
+		case 0x20000000:
+			key = 0xe00;
+			break;
+		case 0x10000000:
+			key = 0xf00;
+			break;
+		case 0x08000000:
+			key = 0xf20;
+			break;
+		case 0x04000000:
+			key = 0xf30;
+			break;
+		case 0x02000000:
+			key = 0xf38;
+			break;
+		default:
+			device_printf(dev, "Invalid aperture size (%dMb)\n",
+			    aperture / 1024 / 1024);
+			return EINVAL;
+		}
+		val = pci_read_config(dev, sc->regs[REG_APSIZE], 2);
+		pci_write_config(dev, sc->regs[REG_APSIZE], 
+		    ((val & ~0xfff) | key), 2);
+	}
 	return 0;
 }
 
@@ -363,6 +422,6 @@
 
 static devclass_t agp_devclass;
 
-DRIVER_MODULE(agp_via, pci, agp_via_driver, agp_devclass, 0, 0);
+DRIVER_MODULE(agp_via, hostb, agp_via_driver, agp_devclass, 0, 0);
 MODULE_DEPEND(agp_via, agp, 1, 1, 1);
 MODULE_DEPEND(agp_via, pci, 1, 1, 1);
Index: agp_amd64.c
===================================================================
RCS file: /home/cvs/src/sys/pci/agp_amd64.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/agp_amd64.c -L sys/pci/agp_amd64.c -u -r1.1.1.1 -r1.2
--- sys/pci/agp_amd64.c
+++ sys/pci/agp_amd64.c
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/agp_amd64.c,v 1.7.2.1 2005/11/14 22:48:30 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/agp_amd64.c,v 1.14.2.1 2007/11/08 20:29:53 jhb Exp $");
 
 #include "opt_bus.h"
 
@@ -85,27 +85,27 @@
 static const char*
 agp_amd64_match(device_t dev)
 {
-	if (pci_get_class(dev) != PCIC_BRIDGE
-	    || pci_get_subclass(dev) != PCIS_BRIDGE_HOST)
-		return NULL;
-
-	if (agp_find_caps(dev) == 0)
-		return NULL;
+	if (pci_get_class(dev) != PCIC_BRIDGE ||
+	    pci_get_subclass(dev) != PCIS_BRIDGE_HOST ||
+	    agp_find_caps(dev) == 0)
+		return (NULL);
 
 	switch (pci_get_devid(dev)) {
 	case 0x74541022:
 		return ("AMD 8151 AGP graphics tunnel");
 	case 0x07551039:
 		return ("SiS 755 host to AGP bridge");
+	case 0x07601039:
+		return ("SiS 760 host to AGP bridge");
 	case 0x168910b9:
 		return ("ULi M1689 AGP Controller");
 	case 0x00d110de:
 		if (agp_amd64_nvidia_match(0x00d2))
-			return NULL;
+			return (NULL);
 		return ("NVIDIA nForce3 AGP Controller");
 	case 0x00e110de:
 		if (agp_amd64_nvidia_match(0x00e2))
-			return NULL;
+			return (NULL);
 		return ("NVIDIA nForce3-250 AGP Controller");
 	case 0x02041106:
 		return ("VIA 8380 host to PCI bridge");
@@ -117,7 +117,7 @@
 		return ("VIA 8385 host to PCI bridge");
 	};
 
-	return NULL;
+	return (NULL);
 }
 
 static int
@@ -128,9 +128,9 @@
 	    pci_cfgregread(0, 11, 0, PCIR_SUBCLASS, 1) != PCIS_BRIDGE_PCI ||
 	    pci_cfgregread(0, 11, 0, PCIR_VENDOR, 2) != 0x10de ||
 	    pci_cfgregread(0, 11, 0, PCIR_DEVICE, 2) != devid)
-		return ENXIO;
+		return (ENXIO);
 
-	return 0;
+	return (0);
 }
 
 static int
@@ -142,9 +142,9 @@
 	    pci_cfgregread(0, 1, 0, PCIR_VENDOR, 2) != 0x1106 ||
 	    pci_cfgregread(0, 1, 0, PCIR_DEVICE, 2) != 0xb188 ||
 	    (pci_cfgregread(0, 1, 0, AGP_VIA_AGPSEL, 1) & 2))
-		return 0;
+		return (0);
 
-	return 1;
+	return (1);
 }
 
 static int
@@ -153,14 +153,13 @@
 	const char *desc;
 
 	if (resource_disabled("agp", device_get_unit(dev)))
-		return ENXIO;
+		return (ENXIO);
 	if ((desc = agp_amd64_match(dev))) {
-		device_verbose(dev);
 		device_set_desc(dev, desc);
-		return BUS_PROBE_DEFAULT;
+		return (BUS_PROBE_DEFAULT);
 	}
 
-	return ENXIO;
+	return (ENXIO);
 }
 
 static int
@@ -177,21 +176,16 @@
 		}
 
 	if (n == 0)
-		return ENXIO;
+		return (ENXIO);
 
 	sc->n_mctrl = n;
 
-	if (bootverbose) {
+	if (bootverbose)
 		device_printf(dev, "%d Miscellaneous Control unit(s) found.\n",
 		    sc->n_mctrl);
-		for (i = 0; i < sc->n_mctrl; i++)
-			device_printf(dev, "Aperture Base[%d]: 0x%08x\n", i,
-			    pci_cfgregread(0, sc->mctrl[i], 3,
-			    AGP_AMD64_APBASE, 4) & AGP_AMD64_APBASE_MASK);
-	}
 
 	if ((error = agp_generic_attach(dev)))
-		return error;
+		return (error);
 
 	sc->initial_aperture = AGP_GET_APERTURE(dev);
 
@@ -206,7 +200,7 @@
 		 */
 		if (AGP_SET_APERTURE(dev, AGP_GET_APERTURE(dev) / 2)) {
 			agp_generic_detach(dev);
-			return ENOMEM;
+			return (ENOMEM);
 		}
 	}
 	sc->gatt = gatt;
@@ -215,13 +209,13 @@
 	case 0x10b9:	/* ULi */
 		agp_amd64_uli_init(dev);
 		if (agp_amd64_uli_set_aperture(dev, sc->initial_aperture))
-			return ENXIO;
+			return (ENXIO);
 		break;
 
 	case 0x10de:	/* nVidia */
 		agp_amd64_nvidia_init(dev);
 		if (agp_amd64_nvidia_set_aperture(dev, sc->initial_aperture))
-			return ENXIO;
+			return (ENXIO);
 		break;
 
 	case 0x1106:	/* VIA */
@@ -230,7 +224,7 @@
 			agp_amd64_via_init(dev);
 			if (agp_amd64_via_set_aperture(dev,
 			    sc->initial_aperture))
-				return ENXIO;
+				return (ENXIO);
 		}
 		break;
 	}
@@ -249,17 +243,16 @@
 
 	agp_flush_cache();
 
-	return 0;
+	return (0);
 }
 
 static int
 agp_amd64_detach(device_t dev)
 {
 	struct agp_amd64_softc *sc = device_get_softc(dev);
-	int i, error;
+	int i;
 
-	if ((error = agp_generic_detach(dev)))
-		return error;
+	agp_free_cdev(dev);
 
 	for (i = 0; i < sc->n_mctrl; i++)
 		pci_cfgregwrite(0, sc->mctrl[i], 3, AGP_AMD64_APCTRL,
@@ -268,8 +261,9 @@
 
 	AGP_SET_APERTURE(dev, sc->initial_aperture);
 	agp_free_gatt(sc->gatt);
+	agp_free_res(dev);
 
-	return 0;
+	return (0);
 }
 
 static uint32_t agp_amd64_table[] = {
@@ -295,7 +289,7 @@
 		AGP_AMD64_APCTRL_SIZE_MASK) >> 1;
 
 	if (i >= AGP_AMD64_TABLE_SIZE)
-		return 0;
+		return (0);
 
 	return (agp_amd64_table[i]);
 }
@@ -311,7 +305,7 @@
 		if (agp_amd64_table[i] == aperture)
 			break;
 	if (i >= AGP_AMD64_TABLE_SIZE)
-		return EINVAL;
+		return (EINVAL);
 
 	for (j = 0; j < sc->n_mctrl; j++)
 		pci_cfgregwrite(0, sc->mctrl[j], 3, AGP_AMD64_APCTRL,
@@ -333,7 +327,7 @@
 		break;
 	}
 
-	return 0;
+	return (0);
 }
 
 static int
@@ -342,10 +336,12 @@
 	struct agp_amd64_softc *sc = device_get_softc(dev);
 
 	if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
-		return EINVAL;
+		return (EINVAL);
 
-	sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical;
-	return 0;
+	sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] =
+	    (physical & 0xfffff000) | ((physical >> 28) & 0x00000ff0) | 3;
+
+	return (0);
 }
 
 static int
@@ -354,10 +350,11 @@
 	struct agp_amd64_softc *sc = device_get_softc(dev);
 
 	if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
-		return EINVAL;
+		return (EINVAL);
 
 	sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0;
-	return 0;
+
+	return (0);
 }
 
 static void
@@ -379,11 +376,11 @@
 	uint32_t apbase;
 	int i;
 
-	apbase = pci_cfgregread(0, sc->mctrl[0], 3, AGP_AMD64_APBASE, 4);
+	sc->apbase = rman_get_start(sc->agp.as_aperture);
+	apbase = (sc->apbase >> 25) & AGP_AMD64_APBASE_MASK;
 	for (i = 0; i < sc->n_mctrl; i++)
-		pci_cfgregwrite(0, sc->mctrl[i], 3, AGP_AMD64_APBASE,
-		    apbase & ~(AGP_AMD64_APBASE_MASK & ~(uint32_t)0x7f), 4);
-	sc->apbase = apbase << 25;
+		pci_cfgregwrite(0, sc->mctrl[i], 3,
+		    AGP_AMD64_APBASE, apbase, 4);
 }
 
 static void
@@ -410,13 +407,13 @@
 	case 0x10000000:	/* 256 MB */
 		break;
 	default:
-		return EINVAL;
+		return (EINVAL);
 	}
 
 	pci_write_config(dev, AGP_AMD64_ULI_ENU_SCR,
 	    sc->apbase + aperture - 1, 4);
 
-	return 0;
+	return (0);
 }
 
 static void
@@ -445,7 +442,7 @@
 	case 0x10000000:	apsize = 0x08;	break;	/* 256 MB */
 	case 0x20000000:	apsize = 0x00;	break;	/* 512 MB */
 	default:
-		return EINVAL;
+		return (EINVAL);
 	}
 
 	pci_cfgregwrite(0, 11, 0, AGP_AMD64_NVIDIA_1_APSIZE,
@@ -456,7 +453,7 @@
 	pci_cfgregwrite(0, 11, 0, AGP_AMD64_NVIDIA_1_APLIMIT2,
 	    sc->apbase + aperture - 1, 4);
 
-	return 0;
+	return (0);
 }
 
 static void
@@ -477,10 +474,10 @@
 
 	apsize = ((aperture - 1) >> 20) ^ 0xff;
 	if ((((apsize ^ 0xff) << 20) | ((1 << 20) - 1)) + 1 != aperture)
-		return EINVAL;
+		return (EINVAL);
 	pci_cfgregwrite(0, 1, 0, AGP3_VIA_APSIZE, apsize, 1);
 
-	return 0;
+	return (0);
 }
 
 static device_method_t agp_amd64_methods[] = {
@@ -515,6 +512,6 @@
 
 static devclass_t agp_devclass;
 
-DRIVER_MODULE(agp_amd64, pci, agp_amd64_driver, agp_devclass, 0, 0);
+DRIVER_MODULE(agp_amd64, hostb, agp_amd64_driver, agp_devclass, 0, 0);
 MODULE_DEPEND(agp_amd64, agp, 1, 1, 1);
 MODULE_DEPEND(agp_amd64, pci, 1, 1, 1);
Index: ncr.c
===================================================================
RCS file: /home/cvs/src/sys/pci/ncr.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/ncr.c -L sys/pci/ncr.c -u -r1.1.1.1 -r1.2
--- sys/pci/ncr.c
+++ sys/pci/ncr.c
@@ -40,7 +40,7 @@
 */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/ncr.c,v 1.188 2005/02/25 03:43:43 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/ncr.c,v 1.197 2007/06/17 05:55:53 scottl Exp $");
 
 
 #define NCR_DATE "pl30 98/1/1"
@@ -180,10 +180,11 @@
 #ifdef _KERNEL
 #include <sys/systm.h>
 #include <sys/malloc.h>
-#include <sys/kdb.h>
 #include <sys/kernel.h>
 #include <sys/module.h>
 #include <sys/sysctl.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
 #include <sys/bus.h>
 #include <machine/md_var.h>
 #include <machine/bus.h>
@@ -254,12 +255,7 @@
 
 #ifdef DIAGNOSTIC
 #define	assert(expression) {					\
-	if (!(expression)) {					\
-		(void)printf("assertion \"%s\" failed: "	\
-			     "file \"%s\", line %d\n",		\
-			     #expression, __FILE__, __LINE__);	\
-	     kdb_enter("");					\
-	}							\
+	KASSERT(expression, ("%s", #expression));		\
 }
 #else
 #define	assert(expression) {					\
@@ -278,12 +274,6 @@
 **==========================================================
 */
 
-#ifdef __alpha__
-/* XXX */
-#undef vtophys
-#define	vtophys(va)	alpha_XXX_dmamap((vm_offset_t)va)
-#endif
-
 #define	INB(r) bus_space_read_1(np->bst, np->bsh, offsetof(struct ncr_reg, r))
 #define	INW(r) bus_space_read_2(np->bst, np->bsh, offsetof(struct ncr_reg, r))
 #define	INL(r) bus_space_read_4(np->bst, np->bsh, offsetof(struct ncr_reg, r))
@@ -1538,7 +1528,7 @@
 	/*
 	**	Now there are 4 possibilities:
 	**
-	**	(1) The ncr looses arbitration.
+	**	(1) The ncr loses arbitration.
 	**	This is ok, because it will try again,
 	**	when the bus becomes idle.
 	**	(But beware of the timeout function!)
@@ -3770,7 +3760,7 @@
 			      "interruptless mode: reduced performance.\n");
 	} else {
 		bus_setup_intr(dev, np->irq_res, INTR_TYPE_CAM | INTR_ENTROPY,
-			       ncr_intr, np, &np->irq_handle);
+			       NULL, ncr_intr, np, &np->irq_handle);
 	}
 
 	/*
@@ -3787,14 +3777,14 @@
 	**	about our bus.
 	*/
 	np->sim = cam_sim_alloc(ncr_action, ncr_poll, "ncr", np, np->unit,
-				1, MAX_TAGS, devq);
+				&Giant, 1, MAX_TAGS, devq);
 	if (np->sim == NULL) {
 		cam_simq_free(devq);
 		return ENOMEM;
 	}
 
 	
-	if (xpt_bus_register(np->sim, 0) != CAM_SUCCESS) {
+	if (xpt_bus_register(np->sim, dev, 0) != CAM_SUCCESS) {
 		cam_sim_free(np->sim, /*free_devq*/ TRUE);
 		return ENOMEM;
 	}
@@ -4192,31 +4182,34 @@
 		break;
 	case XPT_SET_TRAN_SETTINGS:
 	{
-		struct	ccb_trans_settings *cts;
+		struct	ccb_trans_settings *cts = &ccb->cts;
 		tcb_p	tp;
 		u_int	update_type;
 		int	s;
+		struct ccb_trans_settings_scsi *scsi =
+		    &cts->proto_specific.scsi;
+		struct ccb_trans_settings_spi *spi =
+		    &cts->xport_specific.spi;
 
-		cts = &ccb->cts;
 		update_type = 0;
-		if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0)
+		if (cts->type == CTS_TYPE_CURRENT_SETTINGS)
 			update_type |= NCR_TRANS_GOAL;
-		if ((cts->flags & CCB_TRANS_USER_SETTINGS) != 0)
+		if (cts->type == CTS_TYPE_USER_SETTINGS)
 			update_type |= NCR_TRANS_USER;
-		
+
 		s = splcam();
 		tp = &np->target[ccb->ccb_h.target_id];
 		/* Tag and disc enables */
-		if ((cts->valid & CCB_TRANS_DISC_VALID) != 0) {
+		if ((spi->valid & CTS_SPI_VALID_DISC) != 0) {
 			if (update_type & NCR_TRANS_GOAL) {
-				if ((cts->flags & CCB_TRANS_DISC_ENB) != 0)
+				if ((spi->flags & CTS_SPI_FLAGS_DISC_ENB) != 0)
 					tp->tinfo.disc_tag |= NCR_CUR_DISCENB;
 				else
 					tp->tinfo.disc_tag &= ~NCR_CUR_DISCENB;
 			}
 
 			if (update_type & NCR_TRANS_USER) {
-				if ((cts->flags & CCB_TRANS_DISC_ENB) != 0)
+				if ((spi->flags & CTS_SPI_FLAGS_DISC_ENB) != 0)
 					tp->tinfo.disc_tag |= NCR_USR_DISCENB;
 				else
 					tp->tinfo.disc_tag &= ~NCR_USR_DISCENB;
@@ -4224,16 +4217,16 @@
 
 		}
 
-		if ((cts->valid & CCB_TRANS_TQ_VALID) != 0) {
+		if ((scsi->valid & CTS_SCSI_VALID_TQ) != 0) {
 			if (update_type & NCR_TRANS_GOAL) {
-				if ((cts->flags & CCB_TRANS_TAG_ENB) != 0)
+				if ((scsi->flags & CTS_SCSI_FLAGS_TAG_ENB) != 0)
 					tp->tinfo.disc_tag |= NCR_CUR_TAGENB;
 				else
 					tp->tinfo.disc_tag &= ~NCR_CUR_TAGENB;
 			}
 
 			if (update_type & NCR_TRANS_USER) {
-				if ((cts->flags & CCB_TRANS_TAG_ENB) != 0)
+				if ((scsi->flags & CTS_SCSI_FLAGS_TAG_ENB) != 0)
 					tp->tinfo.disc_tag |= NCR_USR_TAGENB;
 				else
 					tp->tinfo.disc_tag &= ~NCR_USR_TAGENB;
@@ -4241,42 +4234,42 @@
 		}
 
 		/* Filter bus width and sync negotiation settings */
-		if ((cts->valid & CCB_TRANS_BUS_WIDTH_VALID) != 0) {
-			if (cts->bus_width > np->maxwide)
-				cts->bus_width = np->maxwide;
+		if ((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0) {
+			if (spi->bus_width > np->maxwide)
+				spi->bus_width = np->maxwide;
 		}
 
-		if (((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0)
-		 || ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0)) {
-			if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0) {
-				if (cts->sync_period != 0
-				 && (cts->sync_period < np->minsync))
-					cts->sync_period = np->minsync;
+		if (((spi->valid & CTS_SPI_VALID_SYNC_RATE) != 0)
+		 || ((spi->valid & CTS_SPI_VALID_SYNC_OFFSET) != 0)) {
+			if ((spi->valid & CTS_SPI_VALID_SYNC_RATE) != 0) {
+				if (spi->sync_period != 0
+				 && (spi->sync_period < np->minsync))
+					spi->sync_period = np->minsync;
 			}
-			if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0) {
-				if (cts->sync_offset == 0)
-					cts->sync_period = 0;
-				if (cts->sync_offset > np->maxoffs)
-					cts->sync_offset = np->maxoffs;
+			if ((spi->valid & CTS_SPI_VALID_SYNC_OFFSET) != 0) {
+				if (spi->sync_offset == 0)
+					spi->sync_period = 0;
+				if (spi->sync_offset > np->maxoffs)
+					spi->sync_offset = np->maxoffs;
 			}
 		}
 		if ((update_type & NCR_TRANS_USER) != 0) {
-			if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0)
-				tp->tinfo.user.period = cts->sync_period;
-			if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0)
-				tp->tinfo.user.offset = cts->sync_offset;
-			if ((cts->valid & CCB_TRANS_BUS_WIDTH_VALID) != 0)
-				tp->tinfo.user.width = cts->bus_width;
+			if ((spi->valid & CTS_SPI_VALID_SYNC_RATE) != 0)
+				tp->tinfo.user.period = spi->sync_period;
+			if ((spi->valid & CTS_SPI_VALID_SYNC_OFFSET) != 0)
+				tp->tinfo.user.offset = spi->sync_offset;
+			if ((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0)
+				tp->tinfo.user.width = spi->bus_width;
 		}
 		if ((update_type & NCR_TRANS_GOAL) != 0) {
-			if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0)
-				tp->tinfo.goal.period = cts->sync_period;
+			if ((spi->valid & CTS_SPI_VALID_SYNC_RATE) != 0)
+				tp->tinfo.goal.period = spi->sync_period;
 
-			if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0)
-				tp->tinfo.goal.offset = cts->sync_offset;
+			if ((spi->valid & CTS_SPI_VALID_SYNC_OFFSET) != 0)
+				tp->tinfo.goal.offset = spi->sync_offset;
 
-			if ((cts->valid & CCB_TRANS_BUS_WIDTH_VALID) != 0)
-				tp->tinfo.goal.width = cts->bus_width;
+			if ((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0)
+				tp->tinfo.goal.width = spi->bus_width;
 		}
 		splx(s);
 		ccb->ccb_h.status = CAM_REQ_CMP;
@@ -4286,50 +4279,55 @@
 	case XPT_GET_TRAN_SETTINGS:
 	/* Get default/user set transfer settings for the target */
 	{
-		struct	ccb_trans_settings *cts;
+		struct	ccb_trans_settings *cts = &ccb->cts;
 		struct	ncr_transinfo *tinfo;
-		tcb_p	tp;		
+		tcb_p	tp = &np->target[ccb->ccb_h.target_id];
 		int	s;
+		struct ccb_trans_settings_scsi *scsi =
+		    &cts->proto_specific.scsi;
+		struct ccb_trans_settings_spi *spi =
+		    &cts->xport_specific.spi;
+
+		cts->protocol = PROTO_SCSI;
+		cts->protocol_version = SCSI_REV_2;
+		cts->transport = XPORT_SPI;
+		cts->transport_version = 2;
 
-		cts = &ccb->cts;
-		tp = &np->target[ccb->ccb_h.target_id];
-		
 		s = splcam();
-		if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0) {
+		if (cts->type == CTS_TYPE_CURRENT_SETTINGS) {
 			tinfo = &tp->tinfo.current;
 			if (tp->tinfo.disc_tag & NCR_CUR_DISCENB)
-				cts->flags |= CCB_TRANS_DISC_ENB;
+				spi->flags |= CTS_SPI_FLAGS_DISC_ENB;
 			else
-				cts->flags &= ~CCB_TRANS_DISC_ENB;
+				spi->flags &= ~CTS_SPI_FLAGS_DISC_ENB;
 
 			if (tp->tinfo.disc_tag & NCR_CUR_TAGENB)
-				cts->flags |= CCB_TRANS_TAG_ENB;
+				scsi->flags |= CTS_SCSI_FLAGS_TAG_ENB;
 			else
-				cts->flags &= ~CCB_TRANS_TAG_ENB;
+				scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB;
 		} else {
 			tinfo = &tp->tinfo.user;
 			if (tp->tinfo.disc_tag & NCR_USR_DISCENB)
-				cts->flags |= CCB_TRANS_DISC_ENB;
+				spi->flags |= CTS_SPI_FLAGS_DISC_ENB;
 			else
-				cts->flags &= ~CCB_TRANS_DISC_ENB;
+				spi->flags &= ~CTS_SPI_FLAGS_DISC_ENB;
 
 			if (tp->tinfo.disc_tag & NCR_USR_TAGENB)
-				cts->flags |= CCB_TRANS_TAG_ENB;
+				scsi->flags |= CTS_SCSI_FLAGS_TAG_ENB;
 			else
-				cts->flags &= ~CCB_TRANS_TAG_ENB;
+				scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB;
 		}
 
-		cts->sync_period = tinfo->period;
-		cts->sync_offset = tinfo->offset;
-		cts->bus_width = tinfo->width;
+		spi->sync_period = tinfo->period;
+		spi->sync_offset = tinfo->offset;
+		spi->bus_width = tinfo->width;
 
 		splx(s);
-
-		cts->valid = CCB_TRANS_SYNC_RATE_VALID
-			   | CCB_TRANS_SYNC_OFFSET_VALID
-			   | CCB_TRANS_BUS_WIDTH_VALID
-			   | CCB_TRANS_DISC_VALID
-			   | CCB_TRANS_TQ_VALID;
+		spi->valid = CTS_SPI_VALID_SYNC_RATE
+			   | CTS_SPI_VALID_SYNC_OFFSET
+			   | CTS_SPI_VALID_BUS_WIDTH
+			   | CTS_SPI_VALID_DISC;
+		scsi->valid = CTS_SCSI_VALID_TQ;
 
 		ccb->ccb_h.status = CAM_REQ_CMP;
 		xpt_done(ccb);
@@ -4378,6 +4376,10 @@
 		strncpy(cpi->hba_vid, "Symbios", HBA_IDLEN);
 		strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
 		cpi->unit_number = cam_sim_unit(sim);
+                cpi->transport = XPORT_SPI;
+                cpi->transport_version = 2;
+                cpi->protocol = PROTO_SCSI;
+                cpi->protocol_version = SCSI_REV_2;
 		cpi->ccb_h.status = CAM_REQ_CMP;
 		xpt_done(ccb);
 		break;
@@ -4952,10 +4954,15 @@
 	** Tell the SCSI layer about the
 	** new transfer parameters.
 	*/
-	neg.sync_period = period;
-	neg.sync_offset = sxfer & 0x1f;
-	neg.valid = CCB_TRANS_SYNC_RATE_VALID
-		| CCB_TRANS_SYNC_OFFSET_VALID;
+	memset(&neg, 0, sizeof (neg));
+	neg.protocol = PROTO_SCSI;
+	neg.protocol_version = SCSI_REV_2;
+	neg.transport = XPORT_SPI;
+	neg.transport_version = 2;
+	neg.xport_specific.spi.sync_period = period;
+	neg.xport_specific.spi.sync_offset = sxfer & 0x1f;
+	neg.xport_specific.spi.valid = CTS_SPI_VALID_SYNC_RATE
+		| CTS_SPI_VALID_SYNC_OFFSET;
 	xpt_setup_ccb(&neg.ccb_h, ccb->ccb_h.path,
 		      /*priority*/1);
 	xpt_async(AC_TRANSFER_NEG, ccb->ccb_h.path, &neg);
@@ -5024,15 +5031,19 @@
 	tp->tinfo.wval = scntl3;
 
 	/* Tell the SCSI layer about the new transfer params */
-	neg.bus_width = (scntl3 & EWS) ? MSG_EXT_WDTR_BUS_16_BIT
-		                       : MSG_EXT_WDTR_BUS_8_BIT;
-	neg.sync_period = 0;
-	neg.sync_offset = 0;
-	neg.valid = CCB_TRANS_BUS_WIDTH_VALID
-		  | CCB_TRANS_SYNC_RATE_VALID
-		  | CCB_TRANS_SYNC_OFFSET_VALID;
-	xpt_setup_ccb(&neg.ccb_h, ccb->ccb_h.path,
-		      /*priority*/1);
+	memset(&neg, 0, sizeof (neg));
+	neg.protocol = PROTO_SCSI;
+	neg.protocol_version = SCSI_REV_2;
+	neg.transport = XPORT_SPI;
+	neg.transport_version = 2;
+	neg.xport_specific.spi.bus_width = (scntl3 & EWS) ?
+	    MSG_EXT_WDTR_BUS_16_BIT : MSG_EXT_WDTR_BUS_8_BIT;
+	neg.xport_specific.spi.sync_period = 0;
+	neg.xport_specific.spi.sync_offset = 0;
+	neg.xport_specific.spi.valid = CTS_SPI_VALID_SYNC_RATE
+		| CTS_SPI_VALID_SYNC_OFFSET
+		| CTS_SPI_VALID_BUS_WIDTH;
+	xpt_setup_ccb(&neg.ccb_h, ccb->ccb_h.path, /*priority*/1);
 	xpt_async(AC_TRANSFER_NEG, ccb->ccb_h.path, &neg);	
 
 	/*
Index: intpm.c
===================================================================
RCS file: /home/cvs/src/sys/pci/intpm.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/intpm.c -L sys/pci/intpm.c -u -r1.1.1.1 -r1.2
--- sys/pci/intpm.c
+++ sys/pci/intpm.c
@@ -25,53 +25,48 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/intpm.c,v 1.33 2005/05/29 04:42:29 nyan Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/intpm.c,v 1.39.2.1 2007/10/27 13:27:02 jhb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
+#include <sys/bus.h>
 #include <sys/kernel.h>
-#include <machine/bus.h>
-
-#include <sys/uio.h>
+#include <sys/lock.h>
 #include <sys/module.h>
-#include <sys/bus.h>
+#include <sys/mutex.h>
 #include <sys/rman.h>
-#include <machine/resource.h>
+#include <machine/bus.h>
 #include <dev/smbus/smbconf.h>
 
 #include "smbus_if.h"
 
-/*This should be removed if force_pci_map_int supported*/
-#include <sys/interrupt.h>
-
 #include <dev/pci/pcireg.h>
 #include <dev/pci/pcivar.h>
 #include <pci/intpmreg.h>
 
 #include "opt_intpm.h"
 
-static struct _pcsid
-{
-        u_int32_t type;
-	char	*desc;
-} pci_ids[] =
-{
-	{ 0x71138086,"Intel 82371AB Power management controller"},
-	{ 0x719b8086,"Intel 82443MX Power management controller"},
-#if 0
-	/* Not a good idea yet, this stops isab0 functioning */
-	{ 0x02001166,"ServerWorks OSB4 PCI to ISA Bridge"},
-#endif
-	
-	{ 0x00000000,	NULL					}
+struct intsmb_softc {
+	device_t		dev;
+	struct resource		*io_res;
+	struct resource		*irq_res;
+	void			*irq_hand;
+	device_t		smbus;
+	int			isbusy;
+	struct mtx		lock;
 };
+
+#define	INTSMB_LOCK(sc)		mtx_lock(&(sc)->lock)
+#define	INTSMB_UNLOCK(sc)	mtx_unlock(&(sc)->lock)
+#define	INTSMB_LOCK_ASSERT(sc)	mtx_assert(&(sc)->lock, MA_OWNED)
+
 static int intsmb_probe(device_t);
 static int intsmb_attach(device_t);
-
-static int intsmb_intr(device_t dev);
-static int intsmb_slvintr(device_t dev);
-static void  intsmb_alrintr(device_t dev);
-static int intsmb_callback(device_t dev, int index, caddr_t data);
+static int intsmb_detach(device_t);
+static int intsmb_intr(struct intsmb_softc *sc);
+static int intsmb_slvintr(struct intsmb_softc *sc);
+static void intsmb_alrintr(struct intsmb_softc *sc);
+static int intsmb_callback(device_t dev, int index, void *data);
 static int intsmb_quick(device_t dev, u_char slave, int how);
 static int intsmb_sendb(device_t dev, u_char slave, char byte);
 static int intsmb_recvb(device_t dev, u_char slave, char *byte);
@@ -81,105 +76,159 @@
 static int intsmb_readw(device_t dev, u_char slave, char cmd, short *word);
 static int intsmb_pcall(device_t dev, u_char slave, char cmd, short sdata, short *rdata);
 static int intsmb_bwrite(device_t dev, u_char slave, char cmd, u_char count, char *buf);
-static int intsmb_bread(device_t dev, u_char slave, char cmd, u_char count, char *buf);
-static void intsmb_start(device_t dev,u_char cmd,int nointr);
-static int intsmb_stop(device_t dev);
-static int intsmb_stop_poll(device_t dev);
-static int intsmb_free(device_t dev);
-static int intpm_probe (device_t dev);
-static int intpm_attach (device_t dev);
-static devclass_t intsmb_devclass;
+static int intsmb_bread(device_t dev, u_char slave, char cmd, u_char *count, char *buf);
+static void intsmb_start(struct intsmb_softc *sc, u_char cmd, int nointr);
+static int intsmb_stop(struct intsmb_softc *sc);
+static int intsmb_stop_poll(struct intsmb_softc *sc);
+static int intsmb_free(struct intsmb_softc *sc);
+static void intsmb_rawintr(void *arg);
 
-static device_method_t intpm_methods[]={
-        DEVMETHOD(device_probe,intsmb_probe),
-        DEVMETHOD(device_attach,intsmb_attach),
-
-        DEVMETHOD(bus_print_child, bus_generic_print_child),
-        
-        DEVMETHOD(smbus_callback,intsmb_callback),
-        DEVMETHOD(smbus_quick,intsmb_quick),
-        DEVMETHOD(smbus_sendb,intsmb_sendb),
-        DEVMETHOD(smbus_recvb,intsmb_recvb),
-        DEVMETHOD(smbus_writeb,intsmb_writeb),
-        DEVMETHOD(smbus_writew,intsmb_writew),
-        DEVMETHOD(smbus_readb,intsmb_readb),
-        DEVMETHOD(smbus_readw,intsmb_readw),
-        DEVMETHOD(smbus_pcall,intsmb_pcall),
-        DEVMETHOD(smbus_bwrite,intsmb_bwrite),
-        DEVMETHOD(smbus_bread,intsmb_bread),
-        {0,0}
-};
+static int
+intsmb_probe(device_t dev)
+{
 
-struct intpm_pci_softc{
-        bus_space_tag_t smbst;
-        bus_space_handle_t smbsh;
-	bus_space_tag_t pmst;
-	bus_space_handle_t pmsh;
-	device_t  smbus;
-};
+	switch (pci_get_devid(dev)) {
+	case 0x71138086:	/* Intel 82371AB */
+	case 0x719b8086:	/* Intel 82443MX */
+#if 0
+	/* Not a good idea yet, this stops isab0 functioning */
+	case 0x02001166:	/* ServerWorks OSB4 */
+#endif
+		device_set_desc(dev, "Intel PIIX4 SMBUS Interface");
+		break;
+	default:
+		return (ENXIO);
+	}
 
+	return (BUS_PROBE_DEFAULT);
+}
 
-struct intsmb_softc{
-        struct intpm_pci_softc *pci_sc;
-        bus_space_tag_t st;
-        bus_space_handle_t sh;
-        device_t smbus;
-        int isbusy;
-};
+static int
+intsmb_attach(device_t dev)
+{
+	struct intsmb_softc *sc = device_get_softc(dev);
+	int error, rid, value;
+	char *str;
+
+	mtx_init(&sc->lock, device_get_nameunit(dev), "intsmb", MTX_DEF);
+
+	rid = PCI_BASE_ADDR_SMB;
+	sc->io_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid,
+	    RF_ACTIVE);
+	if (sc->io_res == NULL) {
+		device_printf(dev, "Could not allocate I/O space\n");
+		error = ENXIO;
+		goto fail;
+	}
 
-static driver_t intpm_driver = {
-        "intsmb",
-        intpm_methods,
-        sizeof(struct intsmb_softc),
-};
+#ifndef NO_CHANGE_PCICONF
+	pci_write_config(dev, PCIR_INTLINE, 0x9, 1);
+	pci_write_config(dev, PCI_HST_CFG_SMB,
+	    PCI_INTR_SMB_IRQ9 | PCI_INTR_SMB_ENABLE, 1);
+#endif
+	value = pci_read_config(dev, PCI_HST_CFG_SMB, 1);
+	switch (value & 0xe) {
+	case PCI_INTR_SMB_SMI:
+		str = "SMI";
+		break;
+	case PCI_INTR_SMB_IRQ9:
+		str = "IRQ 9";
+		break;
+	default:
+		str = "BOGUS";
+	}
+	device_printf(dev, "intr %s %s ", str,
+	    (value & 1) ? "enabled" : "disabled");
+	printf("revision %d\n", pci_read_config(dev, PCI_REVID_SMB, 1));
+
+	if ((value & 0xe) != PCI_INTR_SMB_IRQ9) {
+		device_printf(dev, "Unsupported interrupt mode\n");
+		error = ENXIO;
+		goto fail;
+	}
 
-static devclass_t intpm_devclass;
-static device_method_t intpm_pci_methods[] = {
-  DEVMETHOD(device_probe,intpm_probe),
-  DEVMETHOD(device_attach,intpm_attach),
-  {0,0}
-};
-static driver_t intpm_pci_driver = {
-  "intpm",
-  intpm_pci_methods,
-  sizeof(struct intpm_pci_softc)
-};
+	/* Force IRQ 9. */
+	rid = 0;
+	bus_set_resource(dev, SYS_RES_IRQ, rid, 9, 1);
+	sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
+	    RF_SHAREABLE | RF_ACTIVE);
+	if (sc->irq_res == NULL) {
+		device_printf(dev, "Could not allocate irq\n");
+		error = ENXIO;
+		goto fail;
+	}
 
-static int 
-intsmb_probe(device_t dev)
-{
-        struct intsmb_softc *sc =(struct intsmb_softc *) device_get_softc(dev);
-        sc->smbus=device_add_child(dev, "smbus", -1);
-        if (!sc->smbus)
-                return (EINVAL);    /* XXX don't know what to return else */
-        device_set_desc(dev,"Intel PIIX4 SMBUS Interface");
-        
-        return (BUS_PROBE_DEFAULT); /* XXX don't know what to return else */
+	error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC, NULL, 
+	    intsmb_rawintr, sc, &sc->irq_hand);
+	if (error) {
+		device_printf(dev, "Failed to map intr\n");
+		goto fail;
+	}
+
+	value = pci_read_config(dev, PCI_BASE_ADDR_PM, 4);
+	device_printf(dev, "PM %s %x\n", (value & 1) ? "I/O mapped" : "Memory",
+	    value & 0xfffe);
+
+	sc->isbusy = 0;
+	sc->smbus = device_add_child(dev, "smbus", -1);
+	if (sc->smbus == NULL) {
+		error = ENXIO;
+		goto fail;
+	}
+	error = device_probe_and_attach(sc->smbus);
+	if (error)
+		goto fail;
+
+#ifdef ENABLE_ALART
+	/* Enable Arart */
+	bus_write_1(sc->io_res, PIIX4_SMBSLVCNT, PIIX4_SMBSLVCNT_ALTEN);
+#endif
+	return (0);
+
+fail:
+	intsmb_detach(dev);
+	return (error);
 }
+
 static int
-intsmb_attach(device_t dev)
+intsmb_detach(device_t dev)
 {
-        struct intsmb_softc *sc = (struct intsmb_softc *)device_get_softc(dev);
-        sc->pci_sc=device_get_softc(device_get_parent(dev));
-        sc->isbusy=0;
-	sc->sh=sc->pci_sc->smbsh;
-	sc->st=sc->pci_sc->smbst;
-	sc->pci_sc->smbus=dev;
-        device_probe_and_attach(sc->smbus);
-#ifdef ENABLE_ALART
-	/*Enable Arart*/
-	bus_space_write_1(sc->st,sc->sh,PIIX4_SMBSLVCNT,
-			  PIIX4_SMBSLVCNT_ALTEN);
-#endif 
-        return (0);
+	struct intsmb_softc *sc = device_get_softc(dev);
+	int error;
+
+	error = bus_generic_detach(dev);
+	if (error)
+		return (error);
+
+	if (sc->smbus)
+		device_delete_child(dev, sc->smbus);
+	if (sc->irq_hand)
+		bus_teardown_intr(dev, sc->irq_res, sc->irq_hand);
+	if (sc->irq_res)
+		bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res);
+	if (sc->io_res)
+		bus_release_resource(dev, SYS_RES_IOPORT, PCI_BASE_ADDR_SMB,
+		    sc->io_res);
+	mtx_destroy(&sc->lock);
+	return (0);
 }
 
-static int 
-intsmb_callback(device_t dev, int index, caddr_t data)
+static void
+intsmb_rawintr(void *arg)
+{
+	struct intsmb_softc *sc = arg;
+
+	INTSMB_LOCK(sc);
+	intsmb_intr(sc);
+	intsmb_slvintr(sc);
+	INTSMB_UNLOCK(sc);
+}
+
+static int
+intsmb_callback(device_t dev, int index, void *data)
 {
 	int error = 0;
-	intrmask_t s;
-	s=splnet();
+
 	switch (index) {
 	case SMB_REQUEST_BUS:
 		break;
@@ -188,368 +237,404 @@
 	default:
 		error = EINVAL;
 	}
-	splx(s);
+
 	return (error);
 }
-/*counterpart of smbtx_smb_free*/
-static        int
-intsmb_free(device_t dev){
-        intrmask_t s;
-        struct intsmb_softc *sc = (struct intsmb_softc *)device_get_softc(dev);
-        if((bus_space_read_1(sc->st,sc->sh,PIIX4_SMBHSTSTS)&
-	    PIIX4_SMBHSTSTAT_BUSY)
+
+/* Counterpart of smbtx_smb_free(). */
+static int
+intsmb_free(struct intsmb_softc *sc)
+{
+
+	INTSMB_LOCK_ASSERT(sc);
+	if ((bus_read_1(sc->io_res, PIIX4_SMBHSTSTS) & PIIX4_SMBHSTSTAT_BUSY) ||
 #ifdef ENABLE_ALART
-	   ||(bus_space_read_1(sc->st,sc->sh,PIIX4_SMBSLVSTS)&
-	      PIIX4_SMBSLVSTS_BUSY)
+	    (bus_read_1(sc->io_res, PIIX4_SMBSLVSTS) & PIIX4_SMBSLVSTS_BUSY) ||
 #endif
-	   || sc->isbusy)
-                return EBUSY;
-	s=splhigh();
-        sc->isbusy=1;
-	/*Disable Intrrupt in slave part*/
+	    sc->isbusy)
+		return (SMB_EBUSY);
+
+	sc->isbusy = 1;
+	/* Disable Interrupt in slave part. */
 #ifndef ENABLE_ALART
-	bus_space_write_1(sc->st,sc->sh,PIIX4_SMBSLVCNT,0);
+	bus_write_1(sc->io_res, PIIX4_SMBSLVCNT, 0);
 #endif
-        /*Reset INTR Flag to prepare INTR*/
-	bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTSTS,
-			  (PIIX4_SMBHSTSTAT_INTR|
-			   PIIX4_SMBHSTSTAT_ERR|
-			   PIIX4_SMBHSTSTAT_BUSC|
-			   PIIX4_SMBHSTSTAT_FAIL)
-		);
-	splx(s);
-        return 0;
+	/* Reset INTR Flag to prepare INTR. */
+	bus_write_1(sc->io_res, PIIX4_SMBHSTSTS,
+	    PIIX4_SMBHSTSTAT_INTR | PIIX4_SMBHSTSTAT_ERR |
+	    PIIX4_SMBHSTSTAT_BUSC | PIIX4_SMBHSTSTAT_FAIL);
+	return (0);
 }
 
 static int
-intsmb_intr(device_t dev)
+intsmb_intr(struct intsmb_softc *sc)
 {
-	struct intsmb_softc *sc = (struct intsmb_softc *)device_get_softc(dev);
-	int status;
-	status=bus_space_read_1(sc->st,sc->sh,PIIX4_SMBHSTSTS);
-	if(status&PIIX4_SMBHSTSTAT_BUSY){
-		return 1;
-		
-	}
-	if(status&(PIIX4_SMBHSTSTAT_INTR|
-				PIIX4_SMBHSTSTAT_ERR|
-				PIIX4_SMBHSTSTAT_BUSC|
-				PIIX4_SMBHSTSTAT_FAIL)){
-		int tmp;
-		tmp=bus_space_read_1(sc->st,sc->sh,PIIX4_SMBHSTCNT);
-		bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTCNT,
-				  tmp&~PIIX4_SMBHSTCNT_INTREN);
-		if(sc->isbusy){
-		  sc->isbusy=0;
-		  wakeup(sc);
+	int status, tmp;
+
+	status = bus_read_1(sc->io_res, PIIX4_SMBHSTSTS);
+	if (status & PIIX4_SMBHSTSTAT_BUSY)
+		return (1);
+
+	if (status & (PIIX4_SMBHSTSTAT_INTR | PIIX4_SMBHSTSTAT_ERR |
+	    PIIX4_SMBHSTSTAT_BUSC | PIIX4_SMBHSTSTAT_FAIL)) {
+
+		tmp = bus_read_1(sc->io_res, PIIX4_SMBHSTCNT);
+		bus_write_1(sc->io_res, PIIX4_SMBHSTCNT,
+		    tmp & ~PIIX4_SMBHSTCNT_INTREN);
+		if (sc->isbusy) {
+			sc->isbusy = 0;
+			wakeup(sc);
 		}
-		return 0;
+		return (0);
 	}
-	return 1;/* Not Completed*/
+	return (1); /* Not Completed */
 }
+
 static int
-intsmb_slvintr(device_t dev)
+intsmb_slvintr(struct intsmb_softc *sc)
 {
-	struct intsmb_softc *sc = (struct intsmb_softc *)device_get_softc(dev);
-        int status,retval;
-	retval=1;
-        status=bus_space_read_1(sc->st,sc->sh,PIIX4_SMBSLVSTS);
-	if(status&PIIX4_SMBSLVSTS_BUSY)
-		return retval;
-	if(status&PIIX4_SMBSLVSTS_ALART){
-		intsmb_alrintr(dev);
-		retval=0;
-	}else if(status&~(PIIX4_SMBSLVSTS_ALART|PIIX4_SMBSLVSTS_SDW2
-			  |PIIX4_SMBSLVSTS_SDW1)){
-		retval=0;
+	int status;
+
+	status = bus_read_1(sc->io_res, PIIX4_SMBSLVSTS);
+	if (status & PIIX4_SMBSLVSTS_BUSY)
+		return (1);
+	if (status & PIIX4_SMBSLVSTS_ALART)
+		intsmb_alrintr(sc);
+	else if (status & ~(PIIX4_SMBSLVSTS_ALART | PIIX4_SMBSLVSTS_SDW2
+		| PIIX4_SMBSLVSTS_SDW1)) {
 	}
-	/*Reset Status Register*/
-	bus_space_write_1(sc->st,sc->sh,PIIX4_SMBSLVSTS,PIIX4_SMBSLVSTS_ALART|
-			  PIIX4_SMBSLVSTS_SDW2|PIIX4_SMBSLVSTS_SDW1|
-			  PIIX4_SMBSLVSTS_SLV);
-	return retval;
+
+	/* Reset Status Register */
+	bus_write_1(sc->io_res, PIIX4_SMBSLVSTS,
+	    PIIX4_SMBSLVSTS_ALART | PIIX4_SMBSLVSTS_SDW2 |
+	    PIIX4_SMBSLVSTS_SDW1 | PIIX4_SMBSLVSTS_SLV);
+	return (0);
 }
 
-static void intsmb_alrintr(device_t dev)
+static void
+intsmb_alrintr(struct intsmb_softc *sc)
 {
-	struct intsmb_softc *sc = (struct intsmb_softc *)device_get_softc(dev);
 	int slvcnt;
 #ifdef ENABLE_ALART
 	int error;
+	uint8_t addr;
 #endif
 
-	/*stop generating INTR from ALART*/
-	slvcnt=bus_space_read_1(sc->st,sc->sh,PIIX4_SMBSLVCNT);
+	/* Stop generating INTR from ALART. */
+	slvcnt = bus_read_1(sc->io_res, PIIX4_SMBSLVCNT);
 #ifdef ENABLE_ALART
-	bus_space_write_1(sc->st,sc->sh,PIIX4_SMBSLVCNT,
-			  slvcnt&~PIIX4_SMBSLVCNT_ALTEN) ;
+	bus_write_1(sc->io_res, PIIX4_SMBSLVCNT,
+	    slvcnt & ~PIIX4_SMBSLVCNT_ALTEN);
 #endif
 	DELAY(5);
-	/*ask bus who assert it and then ask it what's the matter. */	
+
+	/* Ask bus who asserted it and then ask it what's the matter. */
 #ifdef ENABLE_ALART
-	error=intsmb_free(dev);
-	if(!error){
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTADD,SMBALTRESP
-                                  |LSB);
-		intsmb_start(dev,PIIX4_SMBHSTCNT_PROT_BYTE,1);
-		if(!(error=intsmb_stop_poll(dev))){
-			u_int8_t addr;
-			addr=bus_space_read_1(sc->st,sc->sh,
-					      PIIX4_SMBHSTDAT0);
-			printf("ALART_RESPONSE: 0x%x\n", addr);
-		}
-	}else{
-	        printf("ERROR\n");
+	error = intsmb_free(sc);
+	if (error)
+		return;
+
+	bus_write_1(sc->io_res, PIIX4_SMBHSTADD, SMBALTRESP | LSB);
+	intsmb_start(sc, PIIX4_SMBHSTCNT_PROT_BYTE, 1);
+	error = intsmb_stop_poll(sc);
+	if (error)
+		device_printf(sc->dev, "ALART: ERROR\n");
+	else {
+		addr = bus_read_1(sc->io_res, PIIX4_SMBHSTDAT0);
+		device_printf(sc->dev, "ALART_RESPONSE: 0x%x\n", addr);
 	}
 
-	/*Re-enable INTR from ALART*/
-	bus_space_write_1(sc->st,sc->sh,PIIX4_SMBSLVCNT,
-			  slvcnt|PIIX4_SMBSLVCNT_ALTEN) ;
+	/* Re-enable INTR from ALART. */
+	bus_write_1(sc->io_res, PIIX4_SMBSLVCNT,
+	    slvcnt | PIIX4_SMBSLVCNT_ALTEN);
 	DELAY(5);
 #endif
-
-	return;
 }
+
 static void
-intsmb_start(device_t dev,unsigned char cmd,int nointr)
+intsmb_start(struct intsmb_softc *sc, unsigned char cmd, int nointr)
 {
-	struct intsmb_softc *sc = (struct intsmb_softc *)device_get_softc(dev);
 	unsigned char tmp;
-	tmp=bus_space_read_1(sc->st,sc->sh,PIIX4_SMBHSTCNT);
-	tmp&= 0xe0;
+
+	INTSMB_LOCK_ASSERT(sc);
+	tmp = bus_read_1(sc->io_res, PIIX4_SMBHSTCNT);
+	tmp &= 0xe0;
 	tmp |= cmd;
-	tmp |=PIIX4_SMBHSTCNT_START;
-	/*While not in autoconfiguration Intrrupt Enabled*/
-	if(!cold||!nointr)
-		tmp |=PIIX4_SMBHSTCNT_INTREN;
-	bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTCNT,tmp);
+	tmp |= PIIX4_SMBHSTCNT_START;
+
+	/* While not in autoconfiguration enable interrupts. */
+	if (!cold || !nointr)
+		tmp |= PIIX4_SMBHSTCNT_INTREN;
+	bus_write_1(sc->io_res, PIIX4_SMBHSTCNT, tmp);
 }
 
-/*Polling Code. Polling is not encouraged 
- * because It is required to wait for the device get busy.
- *(29063505.pdf from Intel)
- * But during boot,intrrupt cannot be used.
- * so use polling code while in autoconfiguration.
+static int
+intsmb_error(int status)
+{
+	int error = 0;
+
+	if (status & PIIX4_SMBHSTSTAT_ERR)
+		error |= SMB_EBUSERR;
+	if (status & PIIX4_SMBHSTSTAT_BUSC)
+		error |= SMB_ECOLLI;
+	if (status & PIIX4_SMBHSTSTAT_FAIL)
+		error |= SMB_ENOACK;
+	return (error);
+}
+
+/*
+ * Polling Code.
+ *
+ * Polling is not encouraged because it requires waiting for the
+ * device if it is busy.
+ * (29063505.pdf from Intel) But during boot, interrupt cannot be used, so use
+ * polling code then.
  */
+static int
+intsmb_stop_poll(struct intsmb_softc *sc)
+{
+	int error, i, status, tmp;
 
-static        int
-intsmb_stop_poll(device_t dev){
-        int error,i;
-        struct intsmb_softc *sc = (struct intsmb_softc *)device_get_softc(dev);
-	
-	/*
-	 *  In smbtx driver ,Simply waiting.
-	 *  This loops 100-200 times.
-	 */
-	for(i=0;i<0x7fff;i++){
-                if((bus_space_read_1(sc->st,sc->sh,PIIX4_SMBHSTSTS)
-		    &PIIX4_SMBHSTSTAT_BUSY)){
-                        break;
-                }
-	}
-	for(i=0;i<0x7fff;i++){
-		int status;
-		status=bus_space_read_1(sc->st,sc->sh,PIIX4_SMBHSTSTS);
-		if(!(status&PIIX4_SMBHSTSTAT_BUSY)){
-			sc->isbusy=0;
-			error=(status&PIIX4_SMBHSTSTAT_ERR)?EIO :
-				(status&PIIX4_SMBHSTSTAT_BUSC)?EBUSY:
-				(status&PIIX4_SMBHSTSTAT_FAIL)?EIO:0;
-			if(error==0&&!(status&PIIX4_SMBHSTSTAT_INTR)){
-				printf("unknown cause why?");
-			}
-			return error;
+	INTSMB_LOCK_ASSERT(sc);
+
+	/* First, wait for busy to be set. */
+	for (i = 0; i < 0x7fff; i++)
+		if (bus_read_1(sc->io_res, PIIX4_SMBHSTSTS) &
+		    PIIX4_SMBHSTSTAT_BUSY)
+			break;
+
+	/* Wait for busy to clear. */
+	for (i = 0; i < 0x7fff; i++) {
+		status = bus_read_1(sc->io_res, PIIX4_SMBHSTSTS);
+		if (!(status & PIIX4_SMBHSTSTAT_BUSY)) {
+			sc->isbusy = 0;
+			error = intsmb_error(status);
+			if (error == 0 && !(status & PIIX4_SMBHSTSTAT_INTR))
+				device_printf(sc->dev, "unknown cause why?");
+			return (error);
 		}
 	}
-	{
-	  int tmp;
-	  sc->isbusy=0;
-	  tmp=bus_space_read_1(sc->st,sc->sh,PIIX4_SMBHSTCNT);
-	  bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTCNT,
-			    tmp&~PIIX4_SMBHSTCNT_INTREN);
-	}
-	return EIO;
+
+	/* Timed out waiting for busy to clear. */
+	sc->isbusy = 0;
+	tmp = bus_read_1(sc->io_res, PIIX4_SMBHSTCNT);
+	bus_write_1(sc->io_res, PIIX4_SMBHSTCNT, tmp & ~PIIX4_SMBHSTCNT_INTREN);
+	return (SMB_ETIMEOUT);
 }
+
 /*
- *wait for completion and return result.
+ * Wait for completion and return result.
  */
-static        int
-intsmb_stop(device_t dev){
-        int error;
-	intrmask_t s;
-        struct intsmb_softc *sc = (struct intsmb_softc *)device_get_softc(dev);
-	if(cold){
-		/*So that it can use device during probing device on SMBus.*/
-		error=intsmb_stop_poll(dev);
-		return error;
-	}else{
-		if(!tsleep(sc,(PWAIT)|PCATCH,"SMBWAI",hz/8)){
-			int status;
-			status=bus_space_read_1(sc->st,sc->sh,PIIX4_SMBHSTSTS);
-			if(!(status&PIIX4_SMBHSTSTAT_BUSY)){
-				error=(status&PIIX4_SMBHSTSTAT_ERR)?EIO :
-					(status&PIIX4_SMBHSTSTAT_BUSC)?EBUSY:
-					(status&PIIX4_SMBHSTSTAT_FAIL)?EIO:0;
-				if(error==0&&!(status&PIIX4_SMBHSTSTAT_INTR)){
-					printf("intsmb%d:unknown cause why?\n",
-					       device_get_unit(dev));
-				}
+static int
+intsmb_stop(struct intsmb_softc *sc)
+{
+	int error, status;
+
+	INTSMB_LOCK_ASSERT(sc);
+
+	if (cold)
+		/* So that it can use device during device probe on SMBus. */
+		return (intsmb_stop_poll(sc));
+
+	error = msleep(sc, &sc->lock, PWAIT | PCATCH, "SMBWAI", hz / 8);
+	if (error == 0) {
+		status = bus_read_1(sc->io_res, PIIX4_SMBHSTSTS);
+		if (!(status & PIIX4_SMBHSTSTAT_BUSY)) {
+			error = intsmb_error(status);
+			if (error == 0 && !(status & PIIX4_SMBHSTSTAT_INTR))
+				device_printf(sc->dev, "unknown cause why?\n");
 #ifdef ENABLE_ALART
-				bus_space_write_1(sc->st,sc->sh,
-						  PIIX4_SMBSLVCNT,PIIX4_SMBSLVCNT_ALTEN);
+			bus_write_1(sc->io_res, PIIX4_SMBSLVCNT,
+			    PIIX4_SMBSLVCNT_ALTEN);
 #endif
-				return error;
-			}
+			return (error);
 		}
 	}
-	/*Timeout Procedure*/
-	s=splhigh();
-	sc->isbusy=0;
-	/*Re-enable supressed intrrupt from slave part*/
-	bus_space_write_1(sc->st,sc->sh,
-			  PIIX4_SMBSLVCNT,PIIX4_SMBSLVCNT_ALTEN);
-	splx(s);
-        return EIO;
+
+	/* Timeout Procedure. */
+	sc->isbusy = 0;
+
+	/* Re-enable supressed interrupt from slave part. */
+	bus_write_1(sc->io_res, PIIX4_SMBSLVCNT, PIIX4_SMBSLVCNT_ALTEN);
+	if (error == EWOULDBLOCK)
+		return (SMB_ETIMEOUT);
+	else
+		return (SMB_EABORT);
 }
 
 static int
 intsmb_quick(device_t dev, u_char slave, int how)
 {
-        int error=0;
-        u_char data;
-        struct intsmb_softc *sc = (struct intsmb_softc *)device_get_softc(dev);
-        data=slave;
-	/*Quick command is part of Address, I think*/
-        switch(how){
-        case SMB_QWRITE:
-                data&=~LSB;
+	struct intsmb_softc *sc = device_get_softc(dev);
+	int error;
+	u_char data;
+
+	data = slave;
+
+	/* Quick command is part of Address, I think. */
+	switch(how) {
+	case SMB_QWRITE:
+		data &= ~LSB;
+		break;
+	case SMB_QREAD:
+		data |= LSB;
 		break;
-        case SMB_QREAD:
-                data|=LSB;
-                break;
-        default:
-                error=EINVAL;
-        }
-        if(!error){
-	        error=intsmb_free(dev);
-                if(!error){
-                        bus_space_write_1(sc->st,sc->sh,
-					  PIIX4_SMBHSTADD,data);
-			intsmb_start(dev,PIIX4_SMBHSTCNT_PROT_QUICK,0);
-                        error=intsmb_stop(dev);
-                }
-        }
+	default:
+		return (EINVAL);
+	}
 
-        return (error);
+	INTSMB_LOCK(sc);
+	error = intsmb_free(sc);
+	if (error) {
+		INTSMB_UNLOCK(sc);
+		return (error);
+	}
+	bus_write_1(sc->io_res, PIIX4_SMBHSTADD, data);
+	intsmb_start(sc, PIIX4_SMBHSTCNT_PROT_QUICK, 0);
+	error = intsmb_stop(sc);
+	INTSMB_UNLOCK(sc);
+	return (error);
 }
 
 static int
 intsmb_sendb(device_t dev, u_char slave, char byte)
 {
-        int error;
-        struct intsmb_softc *sc = (struct intsmb_softc *)device_get_softc(dev);
-        error=intsmb_free(dev);
-        if(!error){
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTADD,slave&~LSB);
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTCMD,byte);
-		intsmb_start(dev,PIIX4_SMBHSTCNT_PROT_BYTE,0);
-                error=intsmb_stop(dev);
-        }
-        return (error);
+	struct intsmb_softc *sc = device_get_softc(dev);
+	int error;
+
+	INTSMB_LOCK(sc);
+	error = intsmb_free(sc);
+	if (error) {
+		INTSMB_UNLOCK(sc);
+		return (error);
+	}
+	bus_write_1(sc->io_res, PIIX4_SMBHSTADD, slave & ~LSB);
+	bus_write_1(sc->io_res, PIIX4_SMBHSTCMD, byte);
+	intsmb_start(sc, PIIX4_SMBHSTCNT_PROT_BYTE, 0);
+	error = intsmb_stop(sc);
+	INTSMB_UNLOCK(sc);
+	return (error);
 }
+
 static int
 intsmb_recvb(device_t dev, u_char slave, char *byte)
 {
-        int error;
-        struct intsmb_softc *sc = (struct intsmb_softc *)device_get_softc(dev);
-        error=intsmb_free(dev);
-        if(!error){
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTADD,slave
-				  |LSB);
-                intsmb_start(dev,PIIX4_SMBHSTCNT_PROT_BYTE,0);
-                if(!(error=intsmb_stop(dev))){
+	struct intsmb_softc *sc = device_get_softc(dev);
+	int error;
+
+	INTSMB_LOCK(sc);
+	error = intsmb_free(sc);
+	if (error) {
+		INTSMB_UNLOCK(sc);
+		return (error);
+	}
+	bus_write_1(sc->io_res, PIIX4_SMBHSTADD, slave | LSB);
+	intsmb_start(sc, PIIX4_SMBHSTCNT_PROT_BYTE, 0);
+	error = intsmb_stop(sc);
+	if (error == 0) {
 #ifdef RECV_IS_IN_CMD
-		        /*Linux SMBus stuff also troubles
-			  Because Intel's datasheet will not make clear.
-			 */
-                        *byte=bus_space_read_1(sc->st,sc->sh,
-					       PIIX4_SMBHSTCMD);
+		/*
+		 * Linux SMBus stuff also troubles
+		 * Because Intel's datasheet does not make clear.
+		 */
+		*byte = bus_read_1(sc->io_res, PIIX4_SMBHSTCMD);
 #else
-                        *byte=bus_space_read_1(sc->st,sc->sh,
-					       PIIX4_SMBHSTDAT0);
+		*byte = bus_read_1(sc->io_res, PIIX4_SMBHSTDAT0);
 #endif
-                }
-        }
-        return (error);
+	}
+	INTSMB_UNLOCK(sc);
+	return (error);
 }
+
 static int
 intsmb_writeb(device_t dev, u_char slave, char cmd, char byte)
 {
-        int error;
-        struct intsmb_softc *sc = (struct intsmb_softc *)device_get_softc(dev);
-        error=intsmb_free(dev);
-        if(!error){
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTADD,slave&~LSB);
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTCMD,cmd);
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTDAT0,byte);
-		intsmb_start(dev,PIIX4_SMBHSTCNT_PROT_BDATA,0);
-                error=intsmb_stop(dev);
-        }
-        return (error);
+	struct intsmb_softc *sc = device_get_softc(dev);
+	int error;
+
+	INTSMB_LOCK(sc);
+	error = intsmb_free(sc);
+	if (error) {
+		INTSMB_UNLOCK(sc);
+		return (error);
+	}
+	bus_write_1(sc->io_res, PIIX4_SMBHSTADD, slave & ~LSB);
+	bus_write_1(sc->io_res, PIIX4_SMBHSTCMD, cmd);
+	bus_write_1(sc->io_res, PIIX4_SMBHSTDAT0, byte);
+	intsmb_start(sc, PIIX4_SMBHSTCNT_PROT_BDATA, 0);
+	error = intsmb_stop(sc);
+	INTSMB_UNLOCK(sc);
+	return (error);
 }
+
 static int
 intsmb_writew(device_t dev, u_char slave, char cmd, short word)
 {
-        int error;
-        struct intsmb_softc *sc = (struct intsmb_softc *)device_get_softc(dev);
-        error=intsmb_free(dev);
-        if(!error){
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTADD,slave&~LSB);
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTCMD,cmd);
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTDAT0,
-				  word&0xff);
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTDAT1,
-				  (word>>8)&0xff);
-		intsmb_start(dev,PIIX4_SMBHSTCNT_PROT_WDATA,0);
-                error=intsmb_stop(dev);
-        }
-        return (error);
+	struct intsmb_softc *sc = device_get_softc(dev);
+	int error;
+
+	INTSMB_LOCK(sc);
+	error = intsmb_free(sc);
+	if (error) {
+		INTSMB_UNLOCK(sc);
+		return (error);
+	}
+	bus_write_1(sc->io_res, PIIX4_SMBHSTADD, slave & ~LSB);
+	bus_write_1(sc->io_res, PIIX4_SMBHSTCMD, cmd);
+	bus_write_1(sc->io_res, PIIX4_SMBHSTDAT0, word & 0xff);
+	bus_write_1(sc->io_res, PIIX4_SMBHSTDAT1, (word >> 8) & 0xff);
+	intsmb_start(sc, PIIX4_SMBHSTCNT_PROT_WDATA, 0);
+	error = intsmb_stop(sc);
+	INTSMB_UNLOCK(sc);
+	return (error);
 }
 
 static int
 intsmb_readb(device_t dev, u_char slave, char cmd, char *byte)
 {
-        int error;
-        struct intsmb_softc *sc = (struct intsmb_softc *)device_get_softc(dev);
-        error=intsmb_free(dev);
-        if(!error){
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTADD,slave|LSB);
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTCMD,cmd);
-		intsmb_start(dev,PIIX4_SMBHSTCNT_PROT_BDATA,0);
-                if(!(error=intsmb_stop(dev))){
-		        *byte=bus_space_read_1(sc->st,sc->sh,
-					       PIIX4_SMBHSTDAT0);
-                }
-        }
-        return (error);
+	struct intsmb_softc *sc = device_get_softc(dev);
+	int error;
+
+	INTSMB_LOCK(sc);
+	error = intsmb_free(sc);
+	if (error) {
+		INTSMB_UNLOCK(sc);
+		return (error);
+	}
+	bus_write_1(sc->io_res, PIIX4_SMBHSTADD, slave | LSB);
+	bus_write_1(sc->io_res, PIIX4_SMBHSTCMD, cmd);
+	intsmb_start(sc, PIIX4_SMBHSTCNT_PROT_BDATA, 0);
+	error = intsmb_stop(sc);
+	if (error == 0)
+		*byte = bus_read_1(sc->io_res, PIIX4_SMBHSTDAT0);
+	INTSMB_UNLOCK(sc);
+	return (error);
 }
+
 static int
 intsmb_readw(device_t dev, u_char slave, char cmd, short *word)
 {
-        int error;
-        struct intsmb_softc *sc = (struct intsmb_softc *)device_get_softc(dev);
-        error=intsmb_free(dev);
-        if(!error){
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTADD,slave|LSB);
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTCMD,cmd);
-		intsmb_start(dev,PIIX4_SMBHSTCNT_PROT_WDATA,0);
-                if(!(error=intsmb_stop(dev))){
-                        *word=bus_space_read_1(sc->st,sc->sh,PIIX4_SMBHSTDAT0)&0xff;
-                        *word|=(bus_space_read_1(sc->st,sc->sh,PIIX4_SMBHSTDAT1)&0xff)<<8;
-                }
-        }
-        return (error);
+	struct intsmb_softc *sc = device_get_softc(dev);
+	int error;
+
+	INTSMB_LOCK(sc);
+	error = intsmb_free(sc);
+	if (error) {
+		INTSMB_UNLOCK(sc);
+		return (error);
+	}
+	bus_write_1(sc->io_res, PIIX4_SMBHSTADD, slave | LSB);
+	bus_write_1(sc->io_res, PIIX4_SMBHSTCMD, cmd);
+	intsmb_start(sc, PIIX4_SMBHSTCNT_PROT_WDATA, 0);
+	error = intsmb_stop(sc);
+	if (error == 0) {
+		*word = bus_read_1(sc->io_res, PIIX4_SMBHSTDAT0);
+		*word |= bus_read_1(sc->io_res, PIIX4_SMBHSTDAT1) << 8;
+	}
+	INTSMB_UNLOCK(sc);
+	return (error);
 }
+
 /*
  * Data sheet claims that it implements all function, but also claims
  * that it implements 7 function and not mention PCALL. So I don't know
@@ -559,194 +644,137 @@
 intsmb_pcall(device_t dev, u_char slave, char cmd, short sdata, short *rdata)
 {
 #ifdef PROCCALL_TEST
-        int error;
-        struct intsmb_softc *sc = (struct intsmb_softc *)device_get_softc(dev);
-        error=intsmb_free(dev);
-        if(!error){
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTADD,slave&~LSB);
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTCMD,cmd);
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTDAT0,sdata&0xff);
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTDAT1,(sdata&0xff)>>8);
-                intsmb_start(dev,PIIX4_SMBHSTCNT_PROT_WDATA,0);
-        }
-        if(!(error=intsmb_stop(dev))){
-                *rdata=bus_space_read_1(sc->st,sc->sh,PIIX4_SMBHSTDAT0)&0xff;
-                *rdata|=(bus_space_read_1(sc->st,sc->sh,PIIX4_SMBHSTDAT1)&0xff)<<8;
-        }
-        return error;
+	struct intsmb_softc *sc = device_get_softc(dev);
+	int error;
+
+	INTSMB_LOCK(sc);
+	error = intsmb_free(sc);
+	if (error) {
+		INTSMB_UNLOCK(sc);
+		return (error);
+	}
+	bus_write_1(sc->io_res, PIIX4_SMBHSTADD, slave & ~LSB);
+	bus_write_1(sc->io_res, PIIX4_SMBHSTCMD, cmd);
+	bus_write_1(sc->io_res, PIIX4_SMBHSTDAT0, sdata & 0xff);
+	bus_write_1(sc->io_res, PIIX4_SMBHSTDAT1, (sdata & 0xff) >> 8);
+	intsmb_start(sc, PIIX4_SMBHSTCNT_PROT_WDATA, 0);
+	error = intsmb_stop(sc);
+	if (error == 0) {
+		*rdata = bus_read_1(sc->io_res, PIIX4_SMBHSTDAT0);
+		*rdata |= bus_read_1(sc->io_res, PIIX4_SMBHSTDAT1) << 8;
+	}
+	INTSMB_UNLOCK(sc);
+	return (error);
 #else
-	return 0;
+	return (SMB_ENOTSUPP);
 #endif
 }
+
 static int
 intsmb_bwrite(device_t dev, u_char slave, char cmd, u_char count, char *buf)
 {
-        int error,i;
-        struct intsmb_softc *sc = (struct intsmb_softc *)device_get_softc(dev);
-        error=intsmb_free(dev);
-        if(count>SMBBLOCKTRANS_MAX||count==0)
-                error=EINVAL;
-        if(!error){
-                /*Reset internal array index*/
-                bus_space_read_1(sc->st,sc->sh,PIIX4_SMBHSTCNT);
-		
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTADD,slave&~LSB);
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTCMD,cmd);
-                for(i=0;i<count;i++){
-                        bus_space_write_1(sc->st,sc->sh,PIIX4_SMBBLKDAT,buf[i]);
-                }
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTDAT0,count);
-                intsmb_start(dev,PIIX4_SMBHSTCNT_PROT_BLOCK,0);
-                error=intsmb_stop(dev);
-        }
-        return (error);
+	struct intsmb_softc *sc = device_get_softc(dev);
+	int error, i;
+
+	if (count > SMBBLOCKTRANS_MAX || count == 0)
+		return (SMB_EINVAL);
+
+	INTSMB_LOCK(sc);
+	error = intsmb_free(sc);
+	if (error) {
+		INTSMB_UNLOCK(sc);
+		return (error);
+	}
+
+	/* Reset internal array index. */
+	bus_read_1(sc->io_res, PIIX4_SMBHSTCNT);
+
+	bus_write_1(sc->io_res, PIIX4_SMBHSTADD, slave & ~LSB);
+	bus_write_1(sc->io_res, PIIX4_SMBHSTCMD, cmd);
+	for (i = 0; i < count; i++)
+		bus_write_1(sc->io_res, PIIX4_SMBBLKDAT, buf[i]);
+	bus_write_1(sc->io_res, PIIX4_SMBHSTDAT0, count);
+	intsmb_start(sc, PIIX4_SMBHSTCNT_PROT_BLOCK, 0);
+	error = intsmb_stop(sc);
+	INTSMB_UNLOCK(sc);
+	return (error);
 }
 
 static int
-intsmb_bread(device_t dev, u_char slave, char cmd, u_char count, char *buf)
-{
-        int error,i;
-        struct intsmb_softc *sc = (struct intsmb_softc *)device_get_softc(dev);
-        error=intsmb_free(dev);
-        if(count>SMBBLOCKTRANS_MAX||count==0)
-                error=EINVAL;
-        if(!error){
-                /*Reset internal array index*/
-                bus_space_read_1(sc->st,sc->sh,PIIX4_SMBHSTCNT);
-		
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTADD,slave|LSB);
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTCMD,cmd);
-                bus_space_write_1(sc->st,sc->sh,PIIX4_SMBHSTDAT0,count);
-                intsmb_start(dev,PIIX4_SMBHSTCNT_PROT_BLOCK,0);
-                error=intsmb_stop(dev);
-                if(!error){
-                        bzero(buf,count);/*Is it needed?*/
-                        count= bus_space_read_1(sc->st,sc->sh,
-						PIIX4_SMBHSTDAT0);
-                        if(count!=0&&count<=SMBBLOCKTRANS_MAX){
-			        for(i=0;i<count;i++){
-				        buf[i]=bus_space_read_1(sc->st,
-								sc->sh,
-								PIIX4_SMBBLKDAT);
-				}
+intsmb_bread(device_t dev, u_char slave, char cmd, u_char *count, char *buf)
+{
+	struct intsmb_softc *sc = device_get_softc(dev);
+	int error, i;
+	u_char data, nread;
+
+	if (*count > SMBBLOCKTRANS_MAX || *count == 0)
+		return (SMB_EINVAL);
+
+	INTSMB_LOCK(sc);
+	error = intsmb_free(sc);
+	if (error) {
+		INTSMB_UNLOCK(sc);
+		return (error);
+	}
+
+	/* Reset internal array index. */
+	bus_read_1(sc->io_res, PIIX4_SMBHSTCNT);
+
+	bus_write_1(sc->io_res, PIIX4_SMBHSTADD, slave | LSB);
+	bus_write_1(sc->io_res, PIIX4_SMBHSTCMD, cmd);
+	bus_write_1(sc->io_res, PIIX4_SMBHSTDAT0, *count);
+	intsmb_start(sc, PIIX4_SMBHSTCNT_PROT_BLOCK, 0);
+	error = intsmb_stop(sc);
+	if (error == 0) {
+		nread = bus_read_1(sc->io_res, PIIX4_SMBHSTDAT0);
+		if (nread != 0 && nread <= SMBBLOCKTRANS_MAX) {
+			for (i = 0; i < nread; i++) {
+				data = bus_read_1(sc->io_res, PIIX4_SMBBLKDAT);
+				if (i < *count)
+					buf[i] = data;
 			}
-                        else{
-				error=EIO;
-                        }
-		}
+			*count = nread;
+		} else
+			error = EIO;
 	}
-        return (error);
+	INTSMB_UNLOCK(sc);
+	return (error);
 }
 
-DRIVER_MODULE(intsmb, intpm , intpm_driver, intsmb_devclass, 0, 0);
+static devclass_t intsmb_devclass;
 
+static device_method_t intsmb_methods[] = {
+	/* Device interface */
+	DEVMETHOD(device_probe,		intsmb_probe),
+	DEVMETHOD(device_attach,	intsmb_attach),
+	DEVMETHOD(device_detach,	intsmb_detach),
+
+	/* Bus interface */
+	DEVMETHOD(bus_print_child,	bus_generic_print_child),
+
+	/* SMBus interface */
+	DEVMETHOD(smbus_callback,	intsmb_callback),
+	DEVMETHOD(smbus_quick,		intsmb_quick),
+	DEVMETHOD(smbus_sendb,		intsmb_sendb),
+	DEVMETHOD(smbus_recvb,		intsmb_recvb),
+	DEVMETHOD(smbus_writeb,		intsmb_writeb),
+	DEVMETHOD(smbus_writew,		intsmb_writew),
+	DEVMETHOD(smbus_readb,		intsmb_readb),
+	DEVMETHOD(smbus_readw,		intsmb_readw),
+	DEVMETHOD(smbus_pcall,		intsmb_pcall),
+	DEVMETHOD(smbus_bwrite,		intsmb_bwrite),
+	DEVMETHOD(smbus_bread,		intsmb_bread),
 
-static void intpm_intr(void *arg);
-static int
-intpm_attach(device_t dev)
-{
-        int value;
-        int unit=device_get_unit(dev);
-	void *ih;
-	int error;
-        char * str;
-        {
-                struct intpm_pci_softc *sciic;
-                device_t smbinterface;
-		int rid;
-		struct resource *res;
-
-                sciic=device_get_softc(dev);
-                if(sciic==NULL){
-                        return ENOMEM;
-                }
-
-		rid=PCI_BASE_ADDR_SMB;
-		res=bus_alloc_resource_any(dev,SYS_RES_IOPORT,&rid,RF_ACTIVE);
-		if(res==NULL){
-		  device_printf(dev,"Could not allocate Bus space\n");
-		  return ENXIO;
-		}
-		sciic->smbst=rman_get_bustag(res);
-		sciic->smbsh=rman_get_bushandle(res);
-		
-#ifdef __i386__
-		device_printf(dev,"%s %lx\n",
-			      (sciic->smbst==I386_BUS_SPACE_IO)?
-			      "I/O mapped":"Memory",
-			      rman_get_start(res));
-#endif
-		
+	{ 0, 0 }
+};
 
-#ifndef NO_CHANGE_PCICONF
-		pci_write_config(dev,PCIR_INTLINE,0x9,1);
-		pci_write_config(dev,PCI_HST_CFG_SMB,
-				 PCI_INTR_SMB_IRQ9|PCI_INTR_SMB_ENABLE,1);
-#endif
-                value=pci_read_config(dev,PCI_HST_CFG_SMB,1);
-                switch(value&0xe){
-                case PCI_INTR_SMB_SMI:
-		        str="SMI";
-                        break;
-                case PCI_INTR_SMB_IRQ9:
-                        str="IRQ 9";
-                        break;
-                default:
-                        str="BOGUS";
-                }
-                device_printf(dev,"intr %s %s ",str,((value&1)? "enabled":"disabled"));
-                value=pci_read_config(dev,PCI_REVID_SMB,1);
-                printf("revision %d\n",value);                
-                /*
-                 * Install intr HANDLER here
-                 */
-		rid=0;
-		res=bus_alloc_resource(dev,SYS_RES_IRQ,&rid,9,9,1,RF_SHAREABLE|RF_ACTIVE);
-		if(res==NULL){
-		  device_printf(dev,"could not allocate irq");
-		  return ENOMEM;
-		}
-		error=bus_setup_intr(dev,res,INTR_TYPE_MISC, (driver_intr_t *) intpm_intr,sciic,&ih);
-                if(error){
-                        device_printf(dev,"Failed to map intr\n");
-			return error;
-                }
-                smbinterface=device_add_child(dev,"intsmb",unit);
-		if(!smbinterface){
-		     printf("intsmb%d:could not add SMBus device\n",unit);
-		}
-                device_probe_and_attach(smbinterface);
-        }
-	      
-        value=pci_read_config(dev,PCI_BASE_ADDR_PM,4);
-        printf("intpm%d: PM %s %x \n",unit,(value&1)?"I/O mapped":"Memory",value&0xfffe);
-        return 0;
-}
-static int 
-intpm_probe(device_t dev)
-{
-    struct _pcsid *ep =pci_ids;
-    u_int32_t device_id=pci_get_devid(dev);
-
-    while (ep->type && ep->type != device_id)
-	  ++ep;
-    if(ep->desc!=NULL){
-      device_set_desc(dev,ep->desc);
-      bus_set_resource(dev,SYS_RES_IRQ,0,9,1); /* XXX setup intr resource */
-      return (BUS_PROBE_DEFAULT);
-    }else{
-      return ENXIO;
-    }
-}
-DRIVER_MODULE(intpm, pci , intpm_pci_driver, intpm_devclass, 0, 0);
-MODULE_DEPEND(intpm, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER);
-MODULE_VERSION(intpm, 1);
-
-static void intpm_intr(void *arg)
-{
-        struct intpm_pci_softc *sc;
-        sc=(struct intpm_pci_softc *)arg;
-	intsmb_intr(sc->smbus);
-	intsmb_slvintr(sc->smbus);
-	
-}
+static driver_t intsmb_driver = {
+	"intsmb",
+	intsmb_methods,
+	sizeof(struct intsmb_softc),
+};
+
+DRIVER_MODULE(intsmb, pci, intsmb_driver, intsmb_devclass, 0, 0);
+DRIVER_MODULE(smbus, intsmb, smbus_driver, smbus_devclass, 0, 0);
+MODULE_DEPEND(intsmb, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER);
+MODULE_VERSION(intsmb, 1);
Index: if_vr.c
===================================================================
RCS file: /home/cvs/src/sys/pci/if_vr.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -L sys/pci/if_vr.c -L sys/pci/if_vr.c -u -r1.2 -r1.3
--- sys/pci/if_vr.c
+++ sys/pci/if_vr.c
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/if_vr.c,v 1.104.2.5 2005/11/08 16:05:56 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/if_vr.c,v 1.126.2.1 2007/10/12 03:41:54 yongari Exp $");
 
 /*
  * VIA Rhine fast ethernet PCI NIC driver
@@ -53,7 +53,7 @@
  * multicast filter. Transmit and receive descriptors are similar
  * to the tulip.
  *
- * The Rhine has a serious flaw in its transmit DMA mechanism:
+ * Some Rhine chips has a serious flaw in its transmit DMA mechanism:
  * transmit buffers must be longword aligned. Unfortunately,
  * FreeBSD doesn't guarantee that mbufs will be filled in starting
  * at longword boundaries, so we have to do a buffer copy before
@@ -74,7 +74,6 @@
 #include <sys/socket.h>
 
 #include <net/if.h>
-#include <net/if_arp.h>
 #include <net/ethernet.h>
 #include <net/if_dl.h>
 #include <net/if_media.h>
@@ -89,7 +88,6 @@
 #include <sys/bus.h>
 #include <sys/rman.h>
 
-#include <dev/mii/mii.h>
 #include <dev/mii/miivar.h>
 
 #include <dev/pci/pcireg.h>
@@ -103,39 +101,78 @@
 MODULE_DEPEND(vr, ether, 1, 1, 1);
 MODULE_DEPEND(vr, miibus, 1, 1, 1);
 
-/* "controller miibus0" required.  See GENERIC if you get errors here. */
+/* "device miibus" required.  See GENERIC if you get errors here. */
 #include "miibus_if.h"
 
-#undef VR_USESWSHIFT
-
 /*
- * Various supported device vendors/types and their names.
+ * Various supported device vendors/types, their names & quirks
  */
-static struct vr_type vr_devs[] = {
+
+#define VR_Q_NEEDALIGN		(1<<0)
+#define VR_Q_CSUM		(1<<1)
+
+static struct vr_type {
+	u_int16_t		vr_vid;
+	u_int16_t		vr_did;
+	int			vr_quirks;
+	char			*vr_name;
+} vr_devs[] = {
 	{ VIA_VENDORID, VIA_DEVICEID_RHINE,
-		"VIA VT3043 Rhine I 10/100BaseTX" },
+	    VR_Q_NEEDALIGN,
+	    "VIA VT3043 Rhine I 10/100BaseTX" },
 	{ VIA_VENDORID, VIA_DEVICEID_RHINE_II,
-		"VIA VT86C100A Rhine II 10/100BaseTX" },
+	    VR_Q_NEEDALIGN,
+	    "VIA VT86C100A Rhine II 10/100BaseTX" },
 	{ VIA_VENDORID, VIA_DEVICEID_RHINE_II_2,
-		"VIA VT6102 Rhine II 10/100BaseTX" },
+	    0,
+	    "VIA VT6102 Rhine II 10/100BaseTX" },
 	{ VIA_VENDORID, VIA_DEVICEID_RHINE_III,
-		"VIA VT6105 Rhine III 10/100BaseTX" },
+	    0,
+	    "VIA VT6105 Rhine III 10/100BaseTX" },
 	{ VIA_VENDORID, VIA_DEVICEID_RHINE_III_M,
-		"VIA VT6105M Rhine III 10/100BaseTX" },
+	    VR_Q_CSUM,
+	    "VIA VT6105M Rhine III 10/100BaseTX" },
 	{ DELTA_VENDORID, DELTA_DEVICEID_RHINE_II,
-		"Delta Electronics Rhine II 10/100BaseTX" },
+	    VR_Q_NEEDALIGN,
+	    "Delta Electronics Rhine II 10/100BaseTX" },
 	{ ADDTRON_VENDORID, ADDTRON_DEVICEID_RHINE_II,
-		"Addtron Technology Rhine II 10/100BaseTX" },
-	{ 0, 0, NULL }
+	    VR_Q_NEEDALIGN,
+	    "Addtron Technology Rhine II 10/100BaseTX" },
+	{ 0, 0, 0, NULL }
+};
+
+struct vr_list_data {
+	struct vr_desc		vr_rx_list[VR_RX_LIST_CNT];
+	struct vr_desc		vr_tx_list[VR_TX_LIST_CNT];
+};
+
+struct vr_softc {
+	struct ifnet		*vr_ifp;	/* interface info */
+	device_t		vr_dev;
+	struct resource		*vr_res;
+	struct resource		*vr_irq;
+	void			*vr_intrhand;
+	device_t		vr_miibus;
+	u_int8_t		vr_revid;	/* Rhine chip revision */
+	u_int8_t                vr_flags;       /* See VR_F_* below */
+	struct vr_list_data	*vr_ldata;
+	struct callout		vr_stat_callout;
+	struct mtx		vr_mtx;
+	int			vr_suspended;	/* if 1, sleeping/detaching */
+	int			vr_quirks;
+	struct vr_desc		*vr_rx_head;
+	struct vr_desc		*vr_tx_cons;
+	struct vr_desc		*vr_tx_prod;
+#ifdef DEVICE_POLLING
+	int			rxcycles;
+#endif
 };
 
 static int vr_probe(device_t);
 static int vr_attach(device_t);
 static int vr_detach(device_t);
 
-static int vr_newbuf(struct vr_softc *, struct vr_chain_onefrag *,
-		struct mbuf *);
-static int vr_encap(struct vr_softc *, struct vr_chain *, struct mbuf * );
+static int vr_newbuf(struct vr_desc *, struct mbuf *);
 
 static void vr_rxeof(struct vr_softc *);
 static void vr_rxeoc(struct vr_softc *);
@@ -153,19 +190,15 @@
 static int vr_ifmedia_upd(struct ifnet *);
 static void vr_ifmedia_sts(struct ifnet *, struct ifmediareq *);
 
-#ifdef VR_USESWSHIFT
-static void vr_mii_sync(struct vr_softc *);
-static void vr_mii_send(struct vr_softc *, uint32_t, int);
-#endif
-static int vr_mii_readreg(struct vr_softc *, struct vr_mii_frame *);
-static int vr_mii_writereg(struct vr_softc *, struct vr_mii_frame *);
+static int vr_mii_readreg(const struct vr_softc *, struct vr_mii_frame *);
+static int vr_mii_writereg(const struct vr_softc *, const struct vr_mii_frame *);
 static int vr_miibus_readreg(device_t, uint16_t, uint16_t);
 static int vr_miibus_writereg(device_t, uint16_t, uint16_t, uint16_t);
 static void vr_miibus_statchg(device_t);
 
 static void vr_setcfg(struct vr_softc *, int);
 static void vr_setmulti(struct vr_softc *);
-static void vr_reset(struct vr_softc *);
+static void vr_reset(const struct vr_softc *);
 static int vr_list_rx_init(struct vr_softc *);
 static int vr_list_tx_init(struct vr_softc *);
 
@@ -206,164 +239,34 @@
 
 DRIVER_MODULE(vr, pci, vr_driver, vr_devclass, 0, 0);
 DRIVER_MODULE(miibus, vr, miibus_driver, miibus_devclass, 0, 0);
+#define VR_F_RESTART		0x01		/* Restart unit on next tick */
 
-#define VR_SETBIT(sc, reg, x)				\
-	CSR_WRITE_1(sc, reg,				\
-		CSR_READ_1(sc, reg) | (x))
+#define	VR_LOCK(_sc)		mtx_lock(&(_sc)->vr_mtx)
+#define	VR_UNLOCK(_sc)		mtx_unlock(&(_sc)->vr_mtx)
+#define	VR_LOCK_ASSERT(_sc)	mtx_assert(&(_sc)->vr_mtx, MA_OWNED)
 
-#define VR_CLRBIT(sc, reg, x)				\
-	CSR_WRITE_1(sc, reg,				\
-		CSR_READ_1(sc, reg) & ~(x))
-
-#define VR_SETBIT16(sc, reg, x)				\
-	CSR_WRITE_2(sc, reg,				\
-		CSR_READ_2(sc, reg) | (x))
-
-#define VR_CLRBIT16(sc, reg, x)				\
-	CSR_WRITE_2(sc, reg,				\
-		CSR_READ_2(sc, reg) & ~(x))
-
-#define VR_SETBIT32(sc, reg, x)				\
-	CSR_WRITE_4(sc, reg,				\
-		CSR_READ_4(sc, reg) | (x))
-
-#define VR_CLRBIT32(sc, reg, x)				\
-	CSR_WRITE_4(sc, reg,				\
-		CSR_READ_4(sc, reg) & ~(x))
-
-#define SIO_SET(x)					\
-	CSR_WRITE_1(sc, VR_MIICMD,			\
-		CSR_READ_1(sc, VR_MIICMD) | (x))
-
-#define SIO_CLR(x)					\
-	CSR_WRITE_1(sc, VR_MIICMD,			\
-		CSR_READ_1(sc, VR_MIICMD) & ~(x))
-
-#ifdef VR_USESWSHIFT
 /*
- * Sync the PHYs by setting data bit and strobing the clock 32 times.
+ * register space access macros
  */
-static void
-vr_mii_sync(struct vr_softc *sc)
-{
-	register int	i;
+#define CSR_WRITE_4(sc, reg, val)	bus_write_4(sc->vr_res, reg, val)
+#define CSR_WRITE_2(sc, reg, val)	bus_write_2(sc->vr_res, reg, val)
+#define CSR_WRITE_1(sc, reg, val)	bus_write_1(sc->vr_res, reg, val)
 
-	SIO_SET(VR_MIICMD_DIR|VR_MIICMD_DATAIN);
+#define CSR_READ_2(sc, reg)		bus_read_2(sc->vr_res, reg)
+#define CSR_READ_1(sc, reg)		bus_read_1(sc->vr_res, reg)
 
-	for (i = 0; i < 32; i++) {
-		SIO_SET(VR_MIICMD_CLK);
-		DELAY(1);
-		SIO_CLR(VR_MIICMD_CLK);
-		DELAY(1);
-	}
-}
+#define VR_SETBIT(sc, reg, x) CSR_WRITE_1(sc, reg, CSR_READ_1(sc, reg) | (x))
+#define VR_CLRBIT(sc, reg, x) CSR_WRITE_1(sc, reg, CSR_READ_1(sc, reg) & ~(x))
 
-/*
- * Clock a series of bits through the MII.
- */
-static void
-vr_mii_send(struct vr_softc *sc, uint32_t bits, int cnt)
-{
-	int	i;
+#define VR_SETBIT16(sc, reg, x) CSR_WRITE_2(sc, reg, CSR_READ_2(sc, reg) | (x))
+#define VR_CLRBIT16(sc, reg, x) CSR_WRITE_2(sc, reg, CSR_READ_2(sc, reg) & ~(x))
 
-	SIO_CLR(VR_MIICMD_CLK);
-
-	for (i = (0x1 << (cnt - 1)); i; i >>= 1) {
-		if (bits & i) {
-			SIO_SET(VR_MIICMD_DATAIN);
-		} else {
-			SIO_CLR(VR_MIICMD_DATAIN);
-		}
-		DELAY(1);
-		SIO_CLR(VR_MIICMD_CLK);
-		DELAY(1);
-		SIO_SET(VR_MIICMD_CLK);
-	}
-}
-#endif
 
 /*
  * Read an PHY register through the MII.
  */
 static int
-vr_mii_readreg(struct vr_softc *sc, struct vr_mii_frame *frame)
-#ifdef VR_USESWSHIFT
-{
-	int	i, ack;
-
-	/* Set up frame for RX. */
-	frame->mii_stdelim = VR_MII_STARTDELIM;
-	frame->mii_opcode = VR_MII_READOP;
-	frame->mii_turnaround = 0;
-	frame->mii_data = 0;
-
-	CSR_WRITE_1(sc, VR_MIICMD, 0);
-	VR_SETBIT(sc, VR_MIICMD, VR_MIICMD_DIRECTPGM);
-
-	/* Turn on data xmit. */
-	SIO_SET(VR_MIICMD_DIR);
-
-	vr_mii_sync(sc);
-
-	/* Send command/address info. */
-	vr_mii_send(sc, frame->mii_stdelim, 2);
-	vr_mii_send(sc, frame->mii_opcode, 2);
-	vr_mii_send(sc, frame->mii_phyaddr, 5);
-	vr_mii_send(sc, frame->mii_regaddr, 5);
-
-	/* Idle bit. */
-	SIO_CLR((VR_MIICMD_CLK|VR_MIICMD_DATAIN));
-	DELAY(1);
-	SIO_SET(VR_MIICMD_CLK);
-	DELAY(1);
-
-	/* Turn off xmit. */
-	SIO_CLR(VR_MIICMD_DIR);
-
-	/* Check for ack */
-	SIO_CLR(VR_MIICMD_CLK);
-	DELAY(1);
-	ack = CSR_READ_4(sc, VR_MIICMD) & VR_MIICMD_DATAOUT;
-	SIO_SET(VR_MIICMD_CLK);
-	DELAY(1);
-
-	/*
-	 * Now try reading data bits. If the ack failed, we still
-	 * need to clock through 16 cycles to keep the PHY(s) in sync.
-	 */
-	if (ack) {
-		for(i = 0; i < 16; i++) {
-			SIO_CLR(VR_MIICMD_CLK);
-			DELAY(1);
-			SIO_SET(VR_MIICMD_CLK);
-			DELAY(1);
-		}
-		goto fail;
-	}
-
-	for (i = 0x8000; i; i >>= 1) {
-		SIO_CLR(VR_MIICMD_CLK);
-		DELAY(1);
-		if (!ack) {
-			if (CSR_READ_4(sc, VR_MIICMD) & VR_MIICMD_DATAOUT)
-				frame->mii_data |= i;
-			DELAY(1);
-		}
-		SIO_SET(VR_MIICMD_CLK);
-		DELAY(1);
-	}
-
-fail:
-	SIO_CLR(VR_MIICMD_CLK);
-	DELAY(1);
-	SIO_SET(VR_MIICMD_CLK);
-	DELAY(1);
-
-	if (ack)
-		return (1);
-	return (0);
-}
-#else
+vr_mii_readreg(const struct vr_softc *sc, struct vr_mii_frame *frame)
 {
 	int	i;
 
@@ -384,48 +287,13 @@
 
 	return (0);
 }
-#endif
 
 
 /*
  * Write to a PHY register through the MII.
  */
 static int
-vr_mii_writereg(struct vr_softc *sc, struct vr_mii_frame *frame)
-#ifdef VR_USESWSHIFT
-{
-	CSR_WRITE_1(sc, VR_MIICMD, 0);
-	VR_SETBIT(sc, VR_MIICMD, VR_MIICMD_DIRECTPGM);
-
-	/* Set up frame for TX. */
-	frame->mii_stdelim = VR_MII_STARTDELIM;
-	frame->mii_opcode = VR_MII_WRITEOP;
-	frame->mii_turnaround = VR_MII_TURNAROUND;
-
-	/* Turn on data output. */
-	SIO_SET(VR_MIICMD_DIR);
-
-	vr_mii_sync(sc);
-
-	vr_mii_send(sc, frame->mii_stdelim, 2);
-	vr_mii_send(sc, frame->mii_opcode, 2);
-	vr_mii_send(sc, frame->mii_phyaddr, 5);
-	vr_mii_send(sc, frame->mii_regaddr, 5);
-	vr_mii_send(sc, frame->mii_turnaround, 2);
-	vr_mii_send(sc, frame->mii_data, 16);
-
-	/* Idle bit. */
-	SIO_SET(VR_MIICMD_CLK);
-	DELAY(1);
-	SIO_CLR(VR_MIICMD_CLK);
-	DELAY(1);
-
-	/* Turn off xmit. */
-	SIO_CLR(VR_MIICMD_DIR);
-
-	return (0);
-}
-#else
+vr_mii_writereg(const struct vr_softc *sc, const struct vr_mii_frame *frame)
 {
 	int	i;
 
@@ -447,7 +315,6 @@
 
 	return (0);
 }
-#endif
 
 static int
 vr_miibus_readreg(device_t dev, uint16_t phy, uint16_t reg)
@@ -455,22 +322,13 @@
 	struct vr_mii_frame	frame;
 	struct vr_softc		*sc = device_get_softc(dev);
 
-	switch (sc->vr_revid) {
-	case REV_ID_VT6102_APOLLO:
-		if (phy != 1) {
-			frame.mii_data = 0;
-			goto out;
-		}
-	default:
-		break;
-	}
+	if (sc->vr_revid == REV_ID_VT6102_APOLLO && phy != 1)
+		return (0);
 
 	bzero((char *)&frame, sizeof(frame));
 	frame.mii_phyaddr = phy;
 	frame.mii_regaddr = reg;
 	vr_mii_readreg(sc, &frame);
-
-out:
 	return (frame.mii_data);
 }
 
@@ -480,13 +338,8 @@
 	struct vr_mii_frame	frame;
 	struct vr_softc		*sc = device_get_softc(dev);
 
-	switch (sc->vr_revid) {
-	case REV_ID_VT6102_APOLLO:
-		if (phy != 1)
-			return (0);
-	default:
-		break;
-	}
+	if (sc->vr_revid == REV_ID_VT6102_APOLLO && phy != 1)
+		return (0);
 
 	bzero((char *)&frame, sizeof(frame));
 	frame.mii_phyaddr = phy;
@@ -588,7 +441,7 @@
 }
 
 static void
-vr_reset(struct vr_softc *sc)
+vr_reset(const struct vr_softc *sc)
 {
 	register int	i;
 
@@ -603,10 +456,10 @@
 	}
 	if (i == VR_TIMEOUT) {
 		if (sc->vr_revid < REV_ID_VT3065_A)
-			if_printf(sc->vr_ifp, "reset never completed!\n");
+			device_printf(sc->vr_dev, "reset never completed!\n");
 		else {
 			/* Use newer force reset command */
-			if_printf(sc->vr_ifp, "Using force reset command.\n");
+			device_printf(sc->vr_dev, "Using force reset command.\n");
 			VR_SETBIT(sc, VR_MISC_CR1, VR_MISCCR1_FORSRST);
 		}
 	}
@@ -617,22 +470,34 @@
 
 /*
  * Probe for a VIA Rhine chip. Check the PCI vendor and device
+ * IDs against our list and return a match or NULL
+ */
+static struct vr_type *
+vr_match(device_t dev)
+{
+	struct vr_type	*t = vr_devs;
+
+	for (t = vr_devs; t->vr_name != NULL; t++)
+		if ((pci_get_vendor(dev) == t->vr_vid) &&
+		    (pci_get_device(dev) == t->vr_did))
+			return (t);
+	return (NULL);
+}
+
+/*
+ * Probe for a VIA Rhine chip. Check the PCI vendor and device
  * IDs against our list and return a device name if we find a match.
  */
 static int
 vr_probe(device_t dev)
 {
-	struct vr_type	*t = vr_devs;
+	struct vr_type	*t;
 
-	while (t->vr_name != NULL) {
-		if ((pci_get_vendor(dev) == t->vr_vid) &&
-		    (pci_get_device(dev) == t->vr_did)) {
-			device_set_desc(dev, t->vr_name);
-			return (BUS_PROBE_DEFAULT);
-		}
-		t++;
+	t = vr_match(dev);
+	if (t != NULL) {
+		device_set_desc(dev, t->vr_name);
+		return (BUS_PROBE_DEFAULT);
 	}
-
 	return (ENXIO);
 }
 
@@ -641,17 +506,22 @@
  * setup and ethernet/BPF attach.
  */
 static int
-vr_attach(dev)
-	device_t		dev;
+vr_attach(device_t dev)
 {
 	int			i;
 	u_char			eaddr[ETHER_ADDR_LEN];
 	struct vr_softc		*sc;
 	struct ifnet		*ifp;
-	int			unit, error = 0, rid;
+	int			error = 0, rid;
+	struct vr_type		*t;
+	int			pmc;
 
 	sc = device_get_softc(dev);
-	unit = device_get_unit(dev);
+	sc->vr_dev = dev;
+	t = vr_match(dev);
+	KASSERT(t != NULL, ("Lost if_vr device match"));
+	sc->vr_quirks = t->vr_quirks;
+	device_printf(dev, "Quirks: 0x%x\n", sc->vr_quirks);
 
 	mtx_init(&sc->vr_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
 	    MTX_DEF);
@@ -672,9 +542,6 @@
 		goto fail;
 	}
 
-	sc->vr_btag = rman_get_bustag(sc->vr_res);
-	sc->vr_bhandle = rman_get_bushandle(sc->vr_res);
-
 	/* Allocate interrupt */
 	rid = 0;
 	sc->vr_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
@@ -704,7 +571,19 @@
 	IFQ_SET_MAXLEN(&ifp->if_snd, VR_TX_LIST_CNT - 1);
 	ifp->if_snd.ifq_maxlen = VR_TX_LIST_CNT - 1;
 	IFQ_SET_READY(&ifp->if_snd);
+
+	if (sc->vr_quirks & VR_Q_CSUM) {
+		ifp->if_hwassist = (CSUM_IP | CSUM_TCP | CSUM_UDP);
+		ifp->if_capabilities |= IFCAP_HWCSUM;
+	}
+
+	ifp->if_capabilities |= IFCAP_VLAN_MTU;
 	ifp->if_capenable = ifp->if_capabilities;
+	if (ifp->if_capenable & IFCAP_TXCSUM)
+		ifp->if_hwassist = (CSUM_IP | CSUM_TCP | CSUM_UDP);
+	else
+		ifp->if_hwassist = 0;
+		
 #ifdef DEVICE_POLLING
 	ifp->if_capabilities |= IFCAP_POLLING;
 #endif
@@ -714,7 +593,8 @@
 	 * shuts down. Be sure to kick it in the head to wake it
 	 * up again.
 	 */
-	VR_CLRBIT(sc, VR_STICKHW, (VR_STICKHW_DS0|VR_STICKHW_DS1));
+	if (pci_find_extcap(dev, PCIY_PMG, &pmc) == 0)
+		VR_CLRBIT(sc, VR_STICKHW, (VR_STICKHW_DS0|VR_STICKHW_DS1));
 
 	/* Reset the adapter. */
 	vr_reset(sc);
@@ -759,11 +639,11 @@
 	/* Call MI attach routine. */
 	ether_ifattach(ifp, eaddr);
 
-	sc->suspended = 0;
+	sc->vr_suspended = 0;
 
 	/* Hook interrupt last to avoid having to lock softc */
 	error = bus_setup_intr(dev, sc->vr_irq, INTR_TYPE_NET | INTR_MPSAFE,
-	    vr_intr, sc, &sc->vr_intrhand);
+	    NULL, vr_intr, sc, &sc->vr_intrhand);
 
 	if (error) {
 		device_printf(dev, "couldn't set up irq\n");
@@ -801,14 +681,12 @@
 	/* These should only be active if attach succeeded */
 	if (device_is_attached(dev)) {
 		VR_LOCK(sc);
-		sc->suspended = 1;
+		sc->vr_suspended = 1;
 		vr_stop(sc);
 		VR_UNLOCK(sc);
 		callout_drain(&sc->vr_stat_callout);
 		ether_ifdetach(ifp);
 	}
-	if (ifp)
-		if_free(ifp);
 	if (sc->vr_miibus)
 		device_delete_child(dev, sc->vr_miibus);
 	bus_generic_detach(dev);
@@ -820,6 +698,9 @@
 	if (sc->vr_res)
 		bus_release_resource(dev, VR_RES, VR_RID, sc->vr_res);
 
+	if (ifp)
+		if_free(ifp);
+
 	if (sc->vr_ldata)
 		contigfree(sc->vr_ldata, sizeof(struct vr_list_data), M_DEVBUF);
 
@@ -834,22 +715,24 @@
 static int
 vr_list_tx_init(struct vr_softc *sc)
 {
-	struct vr_chain_data	*cd;
 	struct vr_list_data	*ld;
 	int			i;
 
-	cd = &sc->vr_cdata;
 	ld = sc->vr_ldata;
 	for (i = 0; i < VR_TX_LIST_CNT; i++) {
-		cd->vr_tx_chain[i].vr_ptr = &ld->vr_tx_list[i];
-		if (i == (VR_TX_LIST_CNT - 1))
-			cd->vr_tx_chain[i].vr_nextdesc =
-				&cd->vr_tx_chain[0];
-		else
-			cd->vr_tx_chain[i].vr_nextdesc =
-				&cd->vr_tx_chain[i + 1];
+		if (i == (VR_TX_LIST_CNT - 1)) {
+			ld->vr_tx_list[i].vr_next =
+			    &ld->vr_tx_list[0];
+			ld->vr_tx_list[i].vr_nextphys =
+			    vtophys(&ld->vr_tx_list[0]);
+		} else {
+			ld->vr_tx_list[i].vr_next =
+				&ld->vr_tx_list[i + 1];
+			ld->vr_tx_list[i].vr_nextphys =
+			    vtophys(&ld->vr_tx_list[i + 1]);
+		}
 	}
-	cd->vr_tx_cons = cd->vr_tx_prod = &cd->vr_tx_chain[0];
+	sc->vr_tx_cons = sc->vr_tx_prod = &ld->vr_tx_list[0];
 
 	return (0);
 }
@@ -863,34 +746,29 @@
 static int
 vr_list_rx_init(struct vr_softc *sc)
 {
-	struct vr_chain_data	*cd;
 	struct vr_list_data	*ld;
 	int			i;
 
 	VR_LOCK_ASSERT(sc);
 
-	cd = &sc->vr_cdata;
 	ld = sc->vr_ldata;
 
 	for (i = 0; i < VR_RX_LIST_CNT; i++) {
-		cd->vr_rx_chain[i].vr_ptr =
-			(struct vr_desc *)&ld->vr_rx_list[i];
-		if (vr_newbuf(sc, &cd->vr_rx_chain[i], NULL) == ENOBUFS)
+		if (vr_newbuf(&ld->vr_rx_list[i], NULL) == ENOBUFS)
 			return (ENOBUFS);
 		if (i == (VR_RX_LIST_CNT - 1)) {
-			cd->vr_rx_chain[i].vr_nextdesc =
-					&cd->vr_rx_chain[0];
-			ld->vr_rx_list[i].vr_next =
+			ld->vr_rx_list[i].vr_next = &ld->vr_rx_list[0];
+			ld->vr_rx_list[i].vr_nextphys =
 					vtophys(&ld->vr_rx_list[0]);
 		} else {
-			cd->vr_rx_chain[i].vr_nextdesc =
-					&cd->vr_rx_chain[i + 1];
 			ld->vr_rx_list[i].vr_next =
+					&ld->vr_rx_list[i + 1];
+			ld->vr_rx_list[i].vr_nextphys =
 					vtophys(&ld->vr_rx_list[i + 1]);
 		}
 	}
 
-	cd->vr_rx_head = &cd->vr_rx_chain[0];
+	sc->vr_rx_head = &ld->vr_rx_list[0];
 
 	return (0);
 }
@@ -903,21 +781,14 @@
  * overflow the field and make a mess.
  */
 static int
-vr_newbuf(struct vr_softc *sc, struct vr_chain_onefrag *c, struct mbuf *m)
+vr_newbuf(struct vr_desc *c, struct mbuf *m)
 {
 	struct mbuf		*m_new = NULL;
 
 	if (m == NULL) {
-		MGETHDR(m_new, M_DONTWAIT, MT_DATA);
+		m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR);
 		if (m_new == NULL)
 			return (ENOBUFS);
-
-		MCLGET(m_new, M_DONTWAIT);
-		if (!(m_new->m_flags & M_EXT)) {
-			m_freem(m_new);
-			return (ENOBUFS);
-		}
-		m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
 	} else {
 		m_new = m;
 		m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
@@ -927,9 +798,9 @@
 	m_adj(m_new, sizeof(uint64_t));
 
 	c->vr_mbuf = m_new;
-	c->vr_ptr->vr_status = VR_RXSTAT;
-	c->vr_ptr->vr_data = vtophys(mtod(m_new, caddr_t));
-	c->vr_ptr->vr_ctl = VR_RXCTL | VR_RXLEN;
+	c->vr_status = VR_RXSTAT;
+	c->vr_data = vtophys(mtod(m_new, caddr_t));
+	c->vr_ctl = VR_RXCTL | VR_RXLEN;
 
 	return (0);
 }
@@ -943,14 +814,14 @@
 {
 	struct mbuf		*m, *m0;
 	struct ifnet		*ifp;
-	struct vr_chain_onefrag	*cur_rx;
+	struct vr_desc		*cur_rx;
 	int			total_len = 0;
-	uint32_t		rxstat;
+	uint32_t		rxstat, rxctl;
 
 	VR_LOCK_ASSERT(sc);
 	ifp = sc->vr_ifp;
 
-	while (!((rxstat = sc->vr_cdata.vr_rx_head->vr_ptr->vr_status) &
+	while (!((rxstat = sc->vr_rx_head->vr_status) &
 	    VR_RXSTAT_OWN)) {
 #ifdef DEVICE_POLLING
 		if (ifp->if_capenable & IFCAP_POLLING) {
@@ -960,8 +831,8 @@
 		}
 #endif
 		m0 = NULL;
-		cur_rx = sc->vr_cdata.vr_rx_head;
-		sc->vr_cdata.vr_rx_head = cur_rx->vr_nextdesc;
+		cur_rx = sc->vr_rx_head;
+		sc->vr_rx_head = cur_rx->vr_next;
 		m = cur_rx->vr_mbuf;
 
 		/*
@@ -972,7 +843,8 @@
 		 */
 		if (rxstat & VR_RXSTAT_RXERR) {
 			ifp->if_ierrors++;
-			if_printf(ifp, "rx error (%02x):", rxstat & 0x000000ff);
+			device_printf(sc->vr_dev,
+			    "rx error (%02x):", rxstat & 0x000000ff);
 			if (rxstat & VR_RXSTAT_CRCERR)
 				printf(" crc error");
 			if (rxstat & VR_RXSTAT_FRAMEALIGNERR)
@@ -988,12 +860,23 @@
 			if (rxstat & VR_RXSTAT_BUFFERR)
 				printf("rx buffer error");
 			printf("\n");
-			vr_newbuf(sc, cur_rx, m);
+			vr_newbuf(cur_rx, m);
 			continue;
 		}
 
 		/* No errors; receive the packet. */
-		total_len = VR_RXBYTES(cur_rx->vr_ptr->vr_status);
+		total_len = VR_RXBYTES(cur_rx->vr_status);
+		if (ifp->if_capenable & IFCAP_RXCSUM) {
+			rxctl = cur_rx->vr_ctl;
+			if ((rxctl & VR_RXCTL_GOODIP) == VR_RXCTL_GOODIP)
+				m->m_pkthdr.csum_flags |= 
+				    CSUM_IP_CHECKED | CSUM_IP_VALID;
+			if ((rxctl & VR_RXCTL_GOODTCPUDP)) {
+				m->m_pkthdr.csum_flags |=
+				    CSUM_DATA_VALID | CSUM_PSEUDO_HDR;
+				m->m_pkthdr.csum_data = 0xffff;
+			}
+		}
 
 		/*
 		 * XXX The VIA Rhine chip includes the CRC with every
@@ -1006,7 +889,7 @@
 
 		m0 = m_devget(mtod(m, char *), total_len, ETHER_ALIGN, ifp,
 		    NULL);
-		vr_newbuf(sc, cur_rx, m);
+		vr_newbuf(cur_rx, m);
 		if (m0 == NULL) {
 			ifp->if_ierrors++;
 			continue;
@@ -1041,14 +924,14 @@
 	}
 
 	if (!i) {
-		if_printf(ifp, "rx shutdown error!\n");
+		device_printf(sc->vr_dev, "rx shutdown error!\n");
 		sc->vr_flags |= VR_F_RESTART;
 		return;
 	}
 
 	vr_rxeof(sc);
 
-	CSR_WRITE_4(sc, VR_RXADDR, vtophys(sc->vr_cdata.vr_rx_head->vr_ptr));
+	CSR_WRITE_4(sc, VR_RXADDR, vtophys(sc->vr_rx_head));
 	VR_SETBIT16(sc, VR_COMMAND, VR_CMD_RX_ON);
 	VR_SETBIT16(sc, VR_COMMAND, VR_CMD_RX_GO);
 }
@@ -1060,7 +943,7 @@
 static void
 vr_txeof(struct vr_softc *sc)
 {
-	struct vr_chain		*cur_tx;
+	struct vr_desc		*cur_tx;
 	struct ifnet		*ifp = sc->vr_ifp;
 
 	VR_LOCK_ASSERT(sc);
@@ -1069,12 +952,12 @@
 	 * Go through our tx list and free mbufs for those
 	 * frames that have been transmitted.
 	 */
-	cur_tx = sc->vr_cdata.vr_tx_cons;
-	while (cur_tx->vr_mbuf != NULL) {
+	cur_tx = sc->vr_tx_cons;
+	while (cur_tx != sc->vr_tx_prod) {
 		uint32_t		txstat;
 		int			i;
 
-		txstat = cur_tx->vr_ptr->vr_status;
+		txstat = cur_tx->vr_status;
 
 		if ((txstat & VR_TXSTAT_ABRT) ||
 		    (txstat & VR_TXSTAT_UDF)) {
@@ -1083,12 +966,12 @@
 			     i--)
 				;	/* Wait for chip to shutdown */
 			if (!i) {
-				if_printf(ifp, "tx shutdown timeout\n");
+				device_printf(sc->vr_dev, "tx shutdown timeout\n");
 				sc->vr_flags |= VR_F_RESTART;
 				break;
 			}
-			VR_TXOWN(cur_tx) = VR_TXSTAT_OWN;
-			CSR_WRITE_4(sc, VR_TXADDR, vtophys(cur_tx->vr_ptr));
+			atomic_set_acq_32(&cur_tx->vr_status, VR_TXSTAT_OWN);
+			CSR_WRITE_4(sc, VR_TXADDR, vtophys(cur_tx));
 			break;
 		}
 
@@ -1106,13 +989,14 @@
 		ifp->if_collisions +=(txstat & VR_TXSTAT_COLLCNT) >> 3;
 
 		ifp->if_opackets++;
-		m_freem(cur_tx->vr_mbuf);
+		if (cur_tx->vr_mbuf != NULL)
+			m_freem(cur_tx->vr_mbuf);
 		cur_tx->vr_mbuf = NULL;
 		ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
 
-		cur_tx = cur_tx->vr_nextdesc;
+		cur_tx = cur_tx->vr_next;
 	}
-	sc->vr_cdata.vr_tx_cons = cur_tx;
+	sc->vr_tx_cons = cur_tx;
 	if (cur_tx->vr_mbuf == NULL)
 		ifp->if_timer = 0;
 }
@@ -1126,7 +1010,7 @@
 	VR_LOCK_ASSERT(sc);
 
 	if (sc->vr_flags & VR_F_RESTART) {
-		if_printf(sc->vr_ifp, "restarting\n");
+		device_printf(sc->vr_dev, "restarting\n");
 		vr_stop(sc);
 		vr_reset(sc);
 		vr_init_locked(sc);
@@ -1206,7 +1090,7 @@
 		    (status & VR_ISR_TX_ABRT2) ||
 		    (status & VR_ISR_TX_ABRT)) {
 			ifp->if_oerrors++;
-			if (sc->vr_cdata.vr_tx_cons->vr_mbuf != NULL) {
+			if (sc->vr_tx_cons->vr_mbuf != NULL) {
 				VR_SETBIT16(sc, VR_COMMAND, VR_CMD_TX_ON);
 				VR_SETBIT16(sc, VR_COMMAND, VR_CMD_TX_GO);
 			}
@@ -1224,7 +1108,7 @@
 
 	VR_LOCK(sc);
 
-	if (sc->suspended) {
+	if (sc->vr_suspended) {
 		/*
 		 * Forcibly disable interrupts.
 		 * XXX: Mobile VIA based platforms may need
@@ -1250,6 +1134,7 @@
 
 	for (;;) {
 		status = CSR_READ_2(sc, VR_ISR);
+
 		if (status)
 			CSR_WRITE_2(sc, VR_ISR, status);
 
@@ -1260,13 +1145,13 @@
 			vr_rxeof(sc);
 
 		if (status & VR_ISR_RX_DROPPED) {
-			if_printf(ifp, "rx packet lost\n");
+			device_printf(sc->vr_dev, "rx packet lost\n");
 			ifp->if_ierrors++;
 		}
 
 		if ((status & VR_ISR_RX_ERR) || (status & VR_ISR_RX_NOBUF) ||
 		    (status & VR_ISR_RX_NOBUF) || (status & VR_ISR_RX_OFLOW)) {
-			if_printf(ifp, "receive error (%04x)", status);
+			device_printf(sc->vr_dev, "receive error (%04x)", status);
 			if (status & VR_ISR_RX_NOBUF)
 				printf(" no buffers");
 			if (status & VR_ISR_RX_OFLOW)
@@ -1290,7 +1175,7 @@
 			    (status & VR_ISR_TX_ABRT2) ||
 			    (status & VR_ISR_TX_ABRT)) {
 				ifp->if_oerrors++;
-				if (sc->vr_cdata.vr_tx_cons->vr_mbuf != NULL) {
+				if (sc->vr_tx_cons->vr_mbuf != NULL) {
 					VR_SETBIT16(sc, VR_COMMAND,
 					    VR_CMD_TX_ON);
 					VR_SETBIT16(sc, VR_COMMAND,
@@ -1311,49 +1196,6 @@
 }
 
 /*
- * Encapsulate an mbuf chain in a descriptor by coupling the mbuf data
- * pointers to the fragment pointers.
- */
-static int
-vr_encap(struct vr_softc *sc, struct vr_chain *c, struct mbuf *m_head)
-{
-	struct vr_desc		*f = NULL;
-	struct mbuf		*m;
-
-	VR_LOCK_ASSERT(sc);
-	/*
-	 * The VIA Rhine wants packet buffers to be longword
-	 * aligned, but very often our mbufs aren't. Rather than
-	 * waste time trying to decide when to copy and when not
-	 * to copy, just do it all the time.
-	 */
-	m = m_defrag(m_head, M_DONTWAIT);
-	if (m == NULL)
-		return (1);
-
-	/*
-	 * The Rhine chip doesn't auto-pad, so we have to make
-	 * sure to pad short frames out to the minimum frame length
-	 * ourselves.
-	 */
-	if (m->m_len < VR_MIN_FRAMELEN) {
-		m->m_pkthdr.len += VR_MIN_FRAMELEN - m->m_len;
-		m->m_len = m->m_pkthdr.len;
-	}
-
-	c->vr_mbuf = m;
-	f = c->vr_ptr;
-	f->vr_data = vtophys(mtod(m, caddr_t));
-	f->vr_ctl = m->m_len;
-	f->vr_ctl |= VR_TXCTL_TLINK|VR_TXCTL_FIRSTFRAG;
-	f->vr_status = 0;
-	f->vr_ctl |= VR_TXCTL_LASTFRAG|VR_TXCTL_FINT;
-	f->vr_next = vtophys(c->vr_nextdesc->vr_ptr);
-
-	return (0);
-}
-
-/*
  * Main transmit routine. To avoid having to do mbuf copies, we put pointers
  * to the mbuf data regions directly in the transmit lists. We also save a
  * copy of the pointers since the transmit list fragment pointers are
@@ -1374,47 +1216,102 @@
 vr_start_locked(struct ifnet *ifp)
 {
 	struct vr_softc		*sc = ifp->if_softc;
-	struct mbuf		*m_head;
-	struct vr_chain		*cur_tx;
+	struct mbuf		*m, *m_head;
+	struct vr_desc		*cur_tx, *n_tx;
+	struct vr_desc		*f = NULL;
+	uint32_t		cval;
 
 	if (ifp->if_drv_flags & IFF_DRV_OACTIVE)
 		return;
 
-	cur_tx = sc->vr_cdata.vr_tx_prod;
-	while (cur_tx->vr_mbuf == NULL) {
+	for (cur_tx = sc->vr_tx_prod;
+	    cur_tx->vr_next != sc->vr_tx_cons; ) {
        	        IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
 		if (m_head == NULL)
 			break;
 
-		/* Pack the data into the descriptor. */
-		if (vr_encap(sc, cur_tx, m_head)) {
-			/* Rollback, send what we were able to encap. */
-               		IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
-			break;
-		}
-
-		VR_TXOWN(cur_tx) = VR_TXSTAT_OWN;
+		VR_LOCK_ASSERT(sc);
+		/*
+		 * Some VIA Rhine wants packet buffers to be longword
+		 * aligned, but very often our mbufs aren't. Rather than
+		 * waste time trying to decide when to copy and when not
+		 * to copy, just do it all the time.
+		 */
+		if (sc->vr_quirks & VR_Q_NEEDALIGN) {
+			m = m_defrag(m_head, M_DONTWAIT);
+			if (m == NULL) {
+				/* Rollback, send what we were able to encap. */
+				IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
+				break;
+			}
+			m_head = m;
+		} 
 
 		/*
-		 * If there's a BPF listener, bounce a copy of this frame
-		 * to him.
+		 * The Rhine chip doesn't auto-pad, so we have to make
+		 * sure to pad short frames out to the minimum frame length
+		 * ourselves.
 		 */
-		BPF_MTAP(ifp, cur_tx->vr_mbuf);
+		if (m_head->m_pkthdr.len < VR_MIN_FRAMELEN) {
+			if (m_head->m_next != NULL) 
+				m_head = m_defrag(m_head, M_DONTWAIT);
+			m_head->m_pkthdr.len += VR_MIN_FRAMELEN - m_head->m_len;
+			m_head->m_len = m_head->m_pkthdr.len;
+			/* XXX: bzero the padding bytes */
+		}
+
+		n_tx = cur_tx;
+		for (m = m_head; m != NULL; m = m->m_next) {
+			if (m->m_len == 0)
+				continue;
+			if (n_tx->vr_next == sc->vr_tx_cons) {
+				IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
+				sc->vr_tx_prod = cur_tx;
+				return;
+			}
+			KASSERT(n_tx->vr_mbuf == NULL, ("if_vr_tx overrun"));
+			
+			f = n_tx;
+			f->vr_data = vtophys(mtod(m, caddr_t));
+			cval = m->m_len;
+			cval |= VR_TXCTL_TLINK;
+
+			if ((ifp->if_capenable & IFCAP_TXCSUM) &&
+			    m_head->m_pkthdr.csum_flags) {
+				if (m_head->m_pkthdr.csum_flags & CSUM_IP)
+					cval |= VR_TXCTL_IPCSUM;
+				if (m_head->m_pkthdr.csum_flags & CSUM_TCP)
+					cval |= VR_TXCTL_TCPCSUM;
+				if (m_head->m_pkthdr.csum_flags & CSUM_UDP)
+					cval |= VR_TXCTL_UDPCSUM;
+			}
 
-		cur_tx = cur_tx->vr_nextdesc;
-	}
-	if (cur_tx != sc->vr_cdata.vr_tx_prod || cur_tx->vr_mbuf != NULL) {
-		sc->vr_cdata.vr_tx_prod = cur_tx;
+			if (m == m_head)
+				cval |= VR_TXCTL_FIRSTFRAG;
+			f->vr_ctl = cval;
+			f->vr_status = 0;
+			n_tx = n_tx->vr_next;
+		}
+
+		KASSERT(f != NULL, ("if_vr: no packet processed"));
+		f->vr_ctl |= VR_TXCTL_LASTFRAG|VR_TXCTL_FINT;
+		cur_tx->vr_mbuf = m_head;
+		atomic_set_acq_32(&cur_tx->vr_status, VR_TXSTAT_OWN);
 
 		/* Tell the chip to start transmitting. */
 		VR_SETBIT16(sc, VR_COMMAND, /*VR_CMD_TX_ON|*/ VR_CMD_TX_GO);
 
-		/* Set a timeout in case the chip goes out to lunch. */
+		ifp->if_drv_flags |= IFF_DRV_OACTIVE;
 		ifp->if_timer = 5;
 
-		if (cur_tx->vr_mbuf != NULL)
-			ifp->if_drv_flags |= IFF_DRV_OACTIVE;
+		/*
+		 * If there's a BPF listener, bounce a copy of this frame
+		 * to him.
+		 */
+		BPF_MTAP(ifp, m_head);
+		cur_tx = n_tx;
 	}
+	sc->vr_tx_prod = cur_tx;
 }
 
 static void
@@ -1444,7 +1341,7 @@
 
 	/* Set our station address. */
 	for (i = 0; i < ETHER_ADDR_LEN; i++)
-		CSR_WRITE_1(sc, VR_PAR0 + i, IFP2ENADDR(sc->vr_ifp)[i]);
+		CSR_WRITE_1(sc, VR_PAR0 + i, IF_LLADDR(sc->vr_ifp)[i]);
 
 	/* Set DMA size. */
 	VR_CLRBIT(sc, VR_BCR0, VR_BCR0_DMA_LENGTH);
@@ -1468,7 +1365,7 @@
 
 	/* Init circular RX list. */
 	if (vr_list_rx_init(sc) == ENOBUFS) {
-		if_printf(ifp,
+		device_printf(sc->vr_dev,
 		    "initialization failed: no memory for rx buffers\n");
 		vr_stop(sc);
 		return;
@@ -1497,7 +1394,7 @@
 	/*
 	 * Load the address of the RX list.
 	 */
-	CSR_WRITE_4(sc, VR_RXADDR, vtophys(sc->vr_cdata.vr_rx_head->vr_ptr));
+	CSR_WRITE_4(sc, VR_RXADDR, vtophys(sc->vr_rx_head));
 
 	/* Enable receiver and transmitter. */
 	CSR_WRITE_2(sc, VR_COMMAND, VR_CMD_TX_NOPOLL|VR_CMD_START|
@@ -1617,6 +1514,11 @@
 			return (error);
 		}
 #endif /* DEVICE_POLLING */
+		ifp->if_capenable = ifr->ifr_reqcap;
+		if (ifp->if_capenable & IFCAP_TXCSUM)
+			ifp->if_hwassist = (CSUM_IP | CSUM_TCP | CSUM_UDP);
+		else
+			ifp->if_hwassist = 0;
 		break;
 	default:
 		error = ether_ioctl(ifp, command, data);
@@ -1673,24 +1575,18 @@
 	/*
 	 * Free data in the RX lists.
 	 */
-	for (i = 0; i < VR_RX_LIST_CNT; i++) {
-		if (sc->vr_cdata.vr_rx_chain[i].vr_mbuf != NULL) {
-			m_freem(sc->vr_cdata.vr_rx_chain[i].vr_mbuf);
-			sc->vr_cdata.vr_rx_chain[i].vr_mbuf = NULL;
-		}
-	}
+	for (i = 0; i < VR_RX_LIST_CNT; i++)
+		if (sc->vr_ldata->vr_rx_list[i].vr_mbuf != NULL)
+			m_freem(sc->vr_ldata->vr_rx_list[i].vr_mbuf);
 	bzero((char *)&sc->vr_ldata->vr_rx_list,
 	    sizeof(sc->vr_ldata->vr_rx_list));
 
 	/*
 	 * Free the TX list buffers.
 	 */
-	for (i = 0; i < VR_TX_LIST_CNT; i++) {
-		if (sc->vr_cdata.vr_tx_chain[i].vr_mbuf != NULL) {
-			m_freem(sc->vr_cdata.vr_tx_chain[i].vr_mbuf);
-			sc->vr_cdata.vr_tx_chain[i].vr_mbuf = NULL;
-		}
-	}
+	for (i = 0; i < VR_TX_LIST_CNT; i++)
+		if (sc->vr_ldata->vr_tx_list[i].vr_mbuf != NULL)
+			m_freem(sc->vr_ldata->vr_tx_list[i].vr_mbuf);
 	bzero((char *)&sc->vr_ldata->vr_tx_list,
 	    sizeof(sc->vr_ldata->vr_tx_list));
 }
Index: if_stereg.h
===================================================================
RCS file: /home/cvs/src/sys/pci/if_stereg.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/if_stereg.h -L sys/pci/if_stereg.h -u -r1.1.1.1 -r1.2
--- sys/pci/if_stereg.h
+++ sys/pci/if_stereg.h
@@ -29,7 +29,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/pci/if_stereg.h,v 1.18.2.2 2005/09/15 19:16:29 jhb Exp $
+ * $FreeBSD: src/sys/pci/if_stereg.h,v 1.22 2007/03/10 03:10:34 yongari Exp $
  */
 
 /*
@@ -37,7 +37,8 @@
  * ST201 chip.
  */
 #define ST_VENDORID		0x13F0
-#define ST_DEVICEID_ST201	0x0201
+#define ST_DEVICEID_ST201_1	0x0200
+#define ST_DEVICEID_ST201_2	0x0201
 
 /*
  * D-Link PCI device/vendor ID for the DL10050[AB] chip
@@ -547,8 +548,3 @@
 #define STE_MII_READOP		0x02
 #define STE_MII_WRITEOP		0x01
 #define STE_MII_TURNAROUND	0x02
-
-#ifdef __alpha__
-#undef vtophys
-#define vtophys(va)		alpha_XXX_dmamap((vm_offset_t)va)
-#endif
Index: if_tlreg.h
===================================================================
RCS file: /home/cvs/src/sys/pci/if_tlreg.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/if_tlreg.h -L sys/pci/if_tlreg.h -u -r1.1.1.1 -r1.2
--- sys/pci/if_tlreg.h
+++ sys/pci/if_tlreg.h
@@ -29,7 +29,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/pci/if_tlreg.h,v 1.21.2.1 2005/09/26 19:36:38 jhb Exp $
+ * $FreeBSD: src/sys/pci/if_tlreg.h,v 1.25 2006/09/15 11:01:23 ru Exp $
  */
 
 
@@ -110,6 +110,7 @@
 
 struct tl_softc {
 	struct ifnet		*tl_ifp;
+	device_t		tl_dev;
 	struct ifmedia		ifmedia;	/* media info */
 	bus_space_handle_t	tl_bhandle;
 	bus_space_tag_t		tl_btag;
@@ -589,8 +590,3 @@
  */
 #define EEPROM_CTL_READ			0xA1	/* 0101 0001 */
 #define EEPROM_CTL_WRITE		0xA0	/* 0101 0000 */
-
-#ifdef __alpha__
-#undef vtophys
-#define vtophys(va)		alpha_XXX_dmamap((vm_offset_t)va)
-#endif
Index: agp_nvidia.c
===================================================================
RCS file: /home/cvs/src/sys/pci/agp_nvidia.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/agp_nvidia.c -L sys/pci/agp_nvidia.c -u -r1.1.1.1 -r1.2
--- sys/pci/agp_nvidia.c
+++ sys/pci/agp_nvidia.c
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/agp_nvidia.c,v 1.9.2.1 2005/11/14 21:10:39 anholt Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/agp_nvidia.c,v 1.11.2.1 2007/11/08 20:29:53 jhb Exp $");
 
 /*
  * Written using information gleaned from the
@@ -121,7 +121,6 @@
 		return (ENXIO);
 	desc = agp_nvidia_match(dev);
 	if (desc) {
-		device_verbose(dev);
 		device_set_desc(dev, desc);
 		return (BUS_PROBE_DEFAULT);
 	}
@@ -248,12 +247,9 @@
 agp_nvidia_detach (device_t dev)
 {
 	struct agp_nvidia_softc *sc = device_get_softc(dev);
-	int error;
 	u_int32_t temp;
 
-	error = agp_generic_detach(dev);
-	if (error)
-		return (error);
+	agp_free_cdev(dev);
 
 	/* GART Control */
 	temp = pci_read_config(sc->dev, AGP_NVIDIA_0_APSIZE, 4);
@@ -271,6 +267,7 @@
 			 sc->initial_aperture);
 
 	agp_free_gatt(sc->gatt);
+	agp_free_res(dev);
 
 	return (0);
 }
@@ -460,6 +457,6 @@
 
 static devclass_t agp_devclass;
 
-DRIVER_MODULE(agp_nvidia, pci, agp_nvidia_driver, agp_devclass, 0, 0);
+DRIVER_MODULE(agp_nvidia, hostb, agp_nvidia_driver, agp_devclass, 0, 0);
 MODULE_DEPEND(agp_nvidia, agp, 1, 1, 1);
 MODULE_DEPEND(agp_nvidia, pci, 1, 1, 1);
Index: agp_intel.c
===================================================================
RCS file: /home/cvs/src/sys/pci/agp_intel.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/agp_intel.c -L sys/pci/agp_intel.c -u -r1.1.1.1 -r1.2
--- sys/pci/agp_intel.c
+++ sys/pci/agp_intel.c
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/agp_intel.c,v 1.27.2.1 2005/12/14 00:46:23 anholt Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/agp_intel.c,v 1.34.2.1 2007/11/08 20:29:53 jhb Exp $");
 
 #include "opt_bus.h"
 
@@ -55,6 +55,7 @@
 	u_int32_t	initial_aperture; /* aperture size at startup */
 	struct agp_gatt *gatt;
 	u_int		aperture_mask;
+	u_int32_t	current_aperture; /* current aperture size */
 };
 
 static const char*
@@ -62,67 +63,53 @@
 {
 	if (pci_get_class(dev) != PCIC_BRIDGE
 	    || pci_get_subclass(dev) != PCIS_BRIDGE_HOST)
-		return NULL;
+		return (NULL);
 
 	if (agp_find_caps(dev) == 0)
-		return NULL;
+		return (NULL);
 
 	switch (pci_get_devid(dev)) {
 	/* Intel -- vendor 0x8086 */
 	case 0x71808086:
 		return ("Intel 82443LX (440 LX) host to PCI bridge");
-
 	case 0x71908086:
 		return ("Intel 82443BX (440 BX) host to PCI bridge");
-
  	case 0x71a08086:
  		return ("Intel 82443GX host to PCI bridge");
-
  	case 0x71a18086:
  		return ("Intel 82443GX host to AGP bridge");
-
 	case 0x11308086:
 		return ("Intel 82815 (i815 GMCH) host to PCI bridge");
-
 	case 0x25008086:
 	case 0x25018086:
 		return ("Intel 82820 host to AGP bridge");
-
 	case 0x35758086:
 		return ("Intel 82830 host to AGP bridge");
-
 	case 0x1a218086:
 		return ("Intel 82840 host to AGP bridge");
-
 	case 0x1a308086:
 		return ("Intel 82845 host to AGP bridge");
-
 	case 0x25308086:
 		return ("Intel 82850 host to AGP bridge");
-
 	case 0x33408086:
 		return ("Intel 82855 host to AGP bridge");
-
 	case 0x25318086:
 		return ("Intel 82860 host to AGP bridge");
-
 	case 0x25708086:
 		return ("Intel 82865 host to AGP bridge");
-
 	case 0x255d8086:
 		return ("Intel E7205 host to AGP bridge");
-
+	case 0x25508086:
+		return ("Intel E7505 host to AGP bridge");
 	case 0x25788086:
 		return ("Intel 82875P host to AGP bridge");
-
 	case 0x25608086:
 		return ("Intel 82845G host to AGP bridge");
-
 	case 0x35808086:
 		return ("Intel 82855GM host to AGP bridge");
 	};
 
-	return NULL;
+	return (NULL);
 }
 
 static int
@@ -134,53 +121,25 @@
 		return (ENXIO);
 	desc = agp_intel_match(dev);
 	if (desc) {
-		device_verbose(dev);
 		device_set_desc(dev, desc);
-		return BUS_PROBE_DEFAULT;
+		return (BUS_PROBE_DEFAULT);
 	}
 
-	return ENXIO;
+	return (ENXIO);
 }
 
-static int
-agp_intel_attach(device_t dev)
+static void
+agp_intel_commit_gatt(device_t dev)
 {
-	struct agp_intel_softc *sc = device_get_softc(dev);
-	struct agp_gatt *gatt;
-	u_int32_t type = pci_get_devid(dev);
+	struct agp_intel_softc *sc;
+	u_int32_t type;
 	u_int32_t value;
-	int error;
-
-	error = agp_generic_attach(dev);
-	if (error)
-		return error;
-
-	/* Determine maximum supported aperture size. */
-	value = pci_read_config(dev, AGP_INTEL_APSIZE, 1);
-	pci_write_config(dev, AGP_INTEL_APSIZE, MAX_APSIZE, 1);
-	sc->aperture_mask = pci_read_config(dev, AGP_INTEL_APSIZE, 1) &
-	    MAX_APSIZE;
-	pci_write_config(dev, AGP_INTEL_APSIZE, value, 1);
-	sc->initial_aperture = AGP_GET_APERTURE(dev);
-
-	for (;;) {
-		gatt = agp_alloc_gatt(dev);
-		if (gatt)
-			break;
 
-		/*
-		 * Probably contigmalloc failure. Try reducing the
-		 * aperture so that the gatt size reduces.
-		 */
-		if (AGP_SET_APERTURE(dev, AGP_GET_APERTURE(dev) / 2)) {
-			agp_generic_detach(dev);
-			return ENOMEM;
-		}
-	}
-	sc->gatt = gatt;
+	sc = device_get_softc(dev);
+	type = pci_get_devid(dev);
 
 	/* Install the gatt. */
-	pci_write_config(dev, AGP_INTEL_ATTBASE, gatt->ag_physical, 4);
+	pci_write_config(dev, AGP_INTEL_ATTBASE, sc->gatt->ag_physical, 4);
 
 	/* Enable the GLTB and setup the control register. */
 	switch (type) {
@@ -199,132 +158,174 @@
 		pci_write_config(dev, AGP_INTEL_AGPCTRL, value | 0x80, 4);
 	}
 
-	/* Enable things, clear errors etc. */
+	/* Enable aperture accesses. */
 	switch (type) {
-	case 0x1a218086: /* i840 */
-	case 0x25308086: /* i850 */
-	case 0x25318086: /* i860 */
-		pci_write_config(dev, AGP_INTEL_MCHCFG,
-				 (pci_read_config(dev, AGP_INTEL_MCHCFG, 2)
-				  | (1 << 9)), 2);
-		break;
-
 	case 0x25008086: /* i820 */
 	case 0x25018086: /* i820 */
 		pci_write_config(dev, AGP_INTEL_I820_RDCR,
 				 (pci_read_config(dev, AGP_INTEL_I820_RDCR, 1)
 				  | (1 << 1)), 1);
 		break;
-
 	case 0x1a308086: /* i845 */
+	case 0x25608086: /* i845G */
 	case 0x33408086: /* i855 */
 	case 0x35808086: /* i855GM */
-	case 0x255d8086: /* E7205 */
 	case 0x25708086: /* i865 */
 	case 0x25788086: /* i875P */
-	case 0x25608086: /* i845G */
-		pci_write_config(dev, AGP_INTEL_I845_MCHCFG,
-				 (pci_read_config(dev, AGP_INTEL_I845_MCHCFG, 1)
+		pci_write_config(dev, AGP_INTEL_I845_AGPM,
+				 (pci_read_config(dev, AGP_INTEL_I845_AGPM, 1)
 				  | (1 << 1)), 1);
 		break;
-
+	case 0x1a218086: /* i840 */
+	case 0x25308086: /* i850 */
+	case 0x25318086: /* i860 */
+	case 0x255d8086: /* E7205 */
+	case 0x25508086: /* E7505 */
+		pci_write_config(dev, AGP_INTEL_MCHCFG,
+				 (pci_read_config(dev, AGP_INTEL_MCHCFG, 2)
+				  | (1 << 9)), 2);
+		break;
 	default: /* Intel Generic (maybe) */
 		pci_write_config(dev, AGP_INTEL_NBXCFG,
 				 (pci_read_config(dev, AGP_INTEL_NBXCFG, 4)
 				  & ~(1 << 10)) | (1 << 9), 4);
 	}
 
+	/* Clear errors. */
 	switch (type) {
 	case 0x1a218086: /* i840 */
 		pci_write_config(dev, AGP_INTEL_I8XX_ERRSTS, 0xc000, 2);
 		break;
-
 	case 0x25008086: /* i820 */
 	case 0x25018086: /* i820 */
 	case 0x1a308086: /* i845 */
+	case 0x25608086: /* i845G */
 	case 0x25308086: /* i850 */
 	case 0x33408086: /* i855 */
-	case 0x255d8086: /* E7205 */
 	case 0x25318086: /* i860 */
 	case 0x25708086: /* i865 */
 	case 0x25788086: /* i875P */
-	case 0x25608086: /* i845G */
+	case 0x255d8086: /* E7205 */
+	case 0x25508086: /* E7505 */
 		pci_write_config(dev, AGP_INTEL_I8XX_ERRSTS, 0x00ff, 2);
 		break;
-
 	default: /* Intel Generic (maybe) */
 		pci_write_config(dev, AGP_INTEL_ERRSTS + 1, 7, 1);
 	}
-
-	return 0;
 }
 
 static int
-agp_intel_detach(device_t dev)
+agp_intel_attach(device_t dev)
 {
-	struct agp_intel_softc *sc = device_get_softc(dev);
-	u_int32_t type = pci_get_devid(dev);
+	struct agp_intel_softc *sc;
+	struct agp_gatt *gatt;
+	u_int32_t value;
 	int error;
 
-	error = agp_generic_detach(dev);
+	sc = device_get_softc(dev);
+
+	error = agp_generic_attach(dev);
 	if (error)
-		return error;
+		return (error);
 
-	switch (type) {
-	case 0x1a218086: /* i840 */
-	case 0x25308086: /* i850 */
-	case 0x25318086: /* i860 */
-		printf("%s: set MCHCFG to %x\n", __func__, (unsigned)
-				(pci_read_config(dev, AGP_INTEL_MCHCFG, 2)
-				& ~(1 << 9)));
-		pci_write_config(dev, AGP_INTEL_MCHCFG,
-				(pci_read_config(dev, AGP_INTEL_MCHCFG, 2)
-				& ~(1 << 9)), 2);
+	/* Determine maximum supported aperture size. */
+	value = pci_read_config(dev, AGP_INTEL_APSIZE, 1);
+	pci_write_config(dev, AGP_INTEL_APSIZE, MAX_APSIZE, 1);
+	sc->aperture_mask = pci_read_config(dev, AGP_INTEL_APSIZE, 1) &
+	    MAX_APSIZE;
+	pci_write_config(dev, AGP_INTEL_APSIZE, value, 1);
+	sc->current_aperture = sc->initial_aperture = AGP_GET_APERTURE(dev);
+
+	for (;;) {
+		gatt = agp_alloc_gatt(dev);
+		if (gatt)
+			break;
+
+		/*
+		 * Probably contigmalloc failure. Try reducing the
+		 * aperture so that the gatt size reduces.
+		 */
+		if (AGP_SET_APERTURE(dev, AGP_GET_APERTURE(dev) / 2)) {
+			agp_generic_detach(dev);
+			return (ENOMEM);
+		}
+	}
+	sc->gatt = gatt;
 
+	agp_intel_commit_gatt(dev);
+
+	return (0);
+}
+
+static int
+agp_intel_detach(device_t dev)
+{
+	struct agp_intel_softc *sc;
+	u_int32_t reg;
+
+	sc = device_get_softc(dev);
+
+	agp_free_cdev(dev);
+
+	/* Disable aperture accesses. */
+	switch (pci_get_devid(dev)) {
 	case 0x25008086: /* i820 */
 	case 0x25018086: /* i820 */
-		printf("%s: set RDCR to %x\n", __func__, (unsigned)
-				(pci_read_config(dev, AGP_INTEL_I820_RDCR, 1)
-				& ~(1 << 1)));
-		pci_write_config(dev, AGP_INTEL_I820_RDCR,
-				(pci_read_config(dev, AGP_INTEL_I820_RDCR, 1)
-				& ~(1 << 1)), 1);
-
+		reg = pci_read_config(dev, AGP_INTEL_I820_RDCR, 1) & ~(1 << 1);
+		printf("%s: set RDCR to %02x\n", __func__, reg & 0xff);
+		pci_write_config(dev, AGP_INTEL_I820_RDCR, reg, 1);
+		break;
 	case 0x1a308086: /* i845 */
 	case 0x25608086: /* i845G */
 	case 0x33408086: /* i855 */
 	case 0x35808086: /* i855GM */
-	case 0x255d8086: /* E7205 */
 	case 0x25708086: /* i865 */
 	case 0x25788086: /* i875P */
-		printf("%s: set MCHCFG to %x\n", __func__, (unsigned)
-				(pci_read_config(dev, AGP_INTEL_I845_MCHCFG, 1)
-				& ~(1 << 1)));
-		pci_write_config(dev, AGP_INTEL_MCHCFG,
-				(pci_read_config(dev, AGP_INTEL_I845_MCHCFG, 1)
-				& ~(1 << 1)), 1);
-
+		reg = pci_read_config(dev, AGP_INTEL_I845_AGPM, 1) & ~(1 << 1);
+		printf("%s: set AGPM to %02x\n", __func__, reg & 0xff);
+		pci_write_config(dev, AGP_INTEL_I845_AGPM, reg, 1);
+		break;
+	case 0x1a218086: /* i840 */
+	case 0x25308086: /* i850 */
+	case 0x25318086: /* i860 */
+	case 0x255d8086: /* E7205 */
+	case 0x25508086: /* E7505 */
+		reg = pci_read_config(dev, AGP_INTEL_MCHCFG, 2) & ~(1 << 9);
+		printf("%s: set MCHCFG to %x04\n", __func__, reg & 0xffff);
+		pci_write_config(dev, AGP_INTEL_MCHCFG, reg, 2);
+		break;
 	default: /* Intel Generic (maybe) */
-		printf("%s: set NBXCFG to %x\n", __func__,
-				 (pci_read_config(dev, AGP_INTEL_NBXCFG, 4)
-				  & ~(1 << 9)));
-		pci_write_config(dev, AGP_INTEL_NBXCFG,
-				 (pci_read_config(dev, AGP_INTEL_NBXCFG, 4)
-				  & ~(1 << 9)), 4);
+		reg = pci_read_config(dev, AGP_INTEL_NBXCFG, 4) & ~(1 << 9);
+		printf("%s: set NBXCFG to %08x\n", __func__, reg);
+		pci_write_config(dev, AGP_INTEL_NBXCFG, reg, 4);
 	}
 	pci_write_config(dev, AGP_INTEL_ATTBASE, 0, 4);
 	AGP_SET_APERTURE(dev, sc->initial_aperture);
 	agp_free_gatt(sc->gatt);
+	agp_free_res(dev);
 
-	return 0;
+	return (0);
+}
+
+static int
+agp_intel_resume(device_t dev)
+{
+	struct agp_intel_softc *sc;
+	sc = device_get_softc(dev);
+	
+	AGP_SET_APERTURE(dev, sc->current_aperture);
+	agp_intel_commit_gatt(dev);
+	return (bus_generic_resume(dev));
 }
 
 static u_int32_t
 agp_intel_get_aperture(device_t dev)
 {
-	struct agp_intel_softc *sc = device_get_softc(dev);
+	struct agp_intel_softc *sc;
 	u_int32_t apsize;
 
+	sc = device_get_softc(dev);
+
 	apsize = pci_read_config(dev, AGP_INTEL_APSIZE, 1) & sc->aperture_mask;
 
 	/*
@@ -334,15 +335,17 @@
 	 * field just read forces the corresponding bit in the 27:22
 	 * to be zero. We calculate the aperture size accordingly.
 	 */
-	return (((apsize ^ sc->aperture_mask) << 22) | ((1 << 22) - 1)) + 1;
+	return ((((apsize ^ sc->aperture_mask) << 22) | ((1 << 22) - 1)) + 1);
 }
 
 static int
 agp_intel_set_aperture(device_t dev, u_int32_t aperture)
 {
-	struct agp_intel_softc *sc = device_get_softc(dev);
+	struct agp_intel_softc *sc;
 	u_int32_t apsize;
 
+	sc = device_get_softc(dev);
+
 	/*
 	 * Reverse the magic from get_aperture.
 	 */
@@ -352,35 +355,41 @@
 	 * Double check for sanity.
 	 */
 	if ((((apsize ^ sc->aperture_mask) << 22) | ((1 << 22) - 1)) + 1 != aperture)
-		return EINVAL;
+		return (EINVAL);
+
+	sc->current_aperture = apsize;
 
 	pci_write_config(dev, AGP_INTEL_APSIZE, apsize, 1);
 
-	return 0;
+	return (0);
 }
 
 static int
 agp_intel_bind_page(device_t dev, int offset, vm_offset_t physical)
 {
-	struct agp_intel_softc *sc = device_get_softc(dev);
+	struct agp_intel_softc *sc;
+
+	sc = device_get_softc(dev);
 
 	if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
-		return EINVAL;
+		return (EINVAL);
 
 	sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical | 0x17;
-	return 0;
+	return (0);
 }
 
 static int
 agp_intel_unbind_page(device_t dev, int offset)
 {
-	struct agp_intel_softc *sc = device_get_softc(dev);
+	struct agp_intel_softc *sc;
+
+	sc = device_get_softc(dev);
 
 	if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
-		return EINVAL;
+		return (EINVAL);
 
 	sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0;
-	return 0;
+	return (0);
 }
 
 static void
@@ -400,7 +409,7 @@
 	DEVMETHOD(device_detach,	agp_intel_detach),
 	DEVMETHOD(device_shutdown,	bus_generic_shutdown),
 	DEVMETHOD(device_suspend,	bus_generic_suspend),
-	DEVMETHOD(device_resume,	bus_generic_resume),
+	DEVMETHOD(device_resume,	agp_intel_resume),
 
 	/* AGP interface */
 	DEVMETHOD(agp_get_aperture,	agp_intel_get_aperture),
@@ -425,6 +434,6 @@
 
 static devclass_t agp_devclass;
 
-DRIVER_MODULE(agp_intel, pci, agp_intel_driver, agp_devclass, 0, 0);
+DRIVER_MODULE(agp_intel, hostb, agp_intel_driver, agp_devclass, 0, 0);
 MODULE_DEPEND(agp_intel, agp, 1, 1, 1);
 MODULE_DEPEND(agp_intel, pci, 1, 1, 1);
Index: amdpm.c
===================================================================
RCS file: /home/cvs/src/sys/pci/amdpm.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -L sys/pci/amdpm.c -L sys/pci/amdpm.c -u -r1.1.1.2 -r1.2
--- sys/pci/amdpm.c
+++ sys/pci/amdpm.c
@@ -33,24 +33,23 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/amdpm.c,v 1.15.2.1 2005/12/21 11:00:53 ru Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/amdpm.c,v 1.21 2007/01/11 19:56:24 jhb Exp $");
 
 #include <sys/param.h>
+#include <sys/bus.h>
 #include <sys/kernel.h>
-#include <sys/systm.h>
+#include <sys/lock.h>
 #include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/uio.h>
+#include <sys/mutex.h>
+#include <sys/systm.h>
 
 #include <machine/bus.h>
-#include <machine/clock.h>
 #include <machine/resource.h>
 #include <sys/rman.h>
 
 #include <dev/pci/pcivar.h>
 #include <dev/pci/pcireg.h>
 
-#include <dev/iicbus/iiconf.h>
 #include <dev/smbus/smbconf.h>
 #include "smbus_if.h"
 
@@ -109,6 +108,8 @@
 #define AMDSMB_GE_CYC_PROCCALL 4
 #define AMDSMB_GE_CYC_BLOCK 5
 
+#define	LSB		0x1	/* XXX: Better name: Read/Write? */
+
 #define AMDSMB_HSTADDR  (0x04)
 #define AMDSMB_HSTDATA  (0x06)
 #define AMDSMB_HSTCMD   (0x08)
@@ -124,10 +125,14 @@
 	struct resource *res;
 	bus_space_tag_t smbst;
 	bus_space_handle_t smbsh;
-
 	device_t smbus;
+	struct mtx lock;
 };
 
+#define	AMDPM_LOCK(amdpm)		mtx_lock(&(amdpm)->lock)
+#define	AMDPM_UNLOCK(amdpm)		mtx_unlock(&(amdpm)->lock)
+#define	AMDPM_LOCK_ASSERT(amdpm)	mtx_assert(&(amdpm)->lock, MA_OWNED)
+
 #define AMDPM_SMBINB(amdpm,register) \
 	(bus_space_read_1(amdpm->smbst, amdpm->smbsh, register))
 #define AMDPM_SMBOUTB(amdpm,register,value) \
@@ -137,6 +142,8 @@
 #define AMDPM_SMBOUTW(amdpm,register,value) \
 	(bus_space_write_2(amdpm->smbst, amdpm->smbsh, register, value))
 
+static int	amdpm_detach(device_t dev);
+
 static int
 amdpm_probe(device_t dev)
 {
@@ -208,11 +215,14 @@
 
 	amdpm_sc->smbst = rman_get_bustag(amdpm_sc->res);
 	amdpm_sc->smbsh = rman_get_bushandle(amdpm_sc->res);
+	mtx_init(&amdpm_sc->lock, device_get_nameunit(dev), "amdpm", MTX_DEF);
 
 	/* Allocate a new smbus device */
 	amdpm_sc->smbus = device_add_child(dev, "smbus", -1);
-	if (!amdpm_sc->smbus)
+	if (!amdpm_sc->smbus) {
+		amdpm_detach(dev);
 		return (EINVAL);
+	}
 
 	bus_generic_attach(dev);
 
@@ -229,6 +239,7 @@
 		amdpm_sc->smbus = NULL;
 	}
 
+	mtx_destroy(&amdpm_sc->lock);
 	if (amdpm_sc->res)
 		bus_release_resource(dev, SYS_RES_IOPORT, amdpm_sc->rid,
 				     amdpm_sc->res);
@@ -237,7 +248,7 @@
 }
 
 static int
-amdpm_callback(device_t dev, int index, caddr_t *data)
+amdpm_callback(device_t dev, int index, void *data)
 {
 	int error = 0;
 
@@ -255,6 +266,8 @@
 static int
 amdpm_clear(struct amdpm_softc *sc)
 {
+
+	AMDPM_LOCK_ASSERT(sc);
 	AMDPM_SMBOUTW(sc, AMDSMB_GLOBAL_STATUS, AMDSMB_GS_CLEAR_STS);
 	DELAY(10);
 
@@ -279,6 +292,7 @@
 {
 	u_short sts;
 
+	AMDPM_LOCK_ASSERT(sc);
 	sts = AMDPM_SMBINW(sc, AMDSMB_GLOBAL_STATUS);
 
 	AMDPM_DEBUG(printf("amdpm: busy? STS=0x%x\n", sts));
@@ -296,6 +310,7 @@
 	u_short sts = 0;
 	int error;
 
+	AMDPM_LOCK_ASSERT(sc);
 	/* Wait for command to complete (SMBus controller is idle) */
 	while(count--) {
 		DELAY(10);
@@ -333,9 +348,12 @@
 	int error;
 	u_short l;
 
+	AMDPM_LOCK(sc);
 	amdpm_clear(sc);
-	if (!amdpm_idle(sc))
+	if (!amdpm_idle(sc)) {
+		AMDPM_UNLOCK(sc);
 		return (EBUSY);
+	}
 
 	switch (how) {
 	case SMB_QWRITE:
@@ -355,6 +373,7 @@
 	error = amdpm_wait(sc);
 
 	AMDPM_DEBUG(printf(", error=0x%x\n", error));
+	AMDPM_UNLOCK(sc);
 
 	return (error);
 }
@@ -366,9 +385,12 @@
 	int error;
 	u_short l;
 
+	AMDPM_LOCK(sc);
 	amdpm_clear(sc);
-	if (!amdpm_idle(sc))
+	if (!amdpm_idle(sc)) {
+		AMDPM_UNLOCK(sc);
 		return (SMB_EBUSY);
+	}
 
 	AMDPM_SMBOUTW(sc, AMDSMB_HSTADDR, slave & ~LSB);
 	AMDPM_SMBOUTW(sc, AMDSMB_HSTDATA, byte);
@@ -378,6 +400,7 @@
 	error = amdpm_wait(sc);
 
 	AMDPM_DEBUG(printf("amdpm: SENDB to 0x%x, byte=0x%x, error=0x%x\n", slave, byte, error));
+	AMDPM_UNLOCK(sc);
 
 	return (error);
 }
@@ -389,9 +412,12 @@
 	int error;
 	u_short l;
 
+	AMDPM_LOCK(sc);
 	amdpm_clear(sc);
-	if (!amdpm_idle(sc))
+	if (!amdpm_idle(sc)) {
+		AMDPM_UNLOCK(sc);
 		return (SMB_EBUSY);
+	}
 
 	AMDPM_SMBOUTW(sc, AMDSMB_HSTADDR, slave | LSB);
 	l = AMDPM_SMBINW(sc, AMDSMB_GLOBAL_ENABLE);
@@ -401,6 +427,7 @@
 		*byte = AMDPM_SMBINW(sc, AMDSMB_HSTDATA);
 
 	AMDPM_DEBUG(printf("amdpm: RECVB from 0x%x, byte=0x%x, error=0x%x\n", slave, *byte, error));
+	AMDPM_UNLOCK(sc);
 
 	return (error);
 }
@@ -412,9 +439,12 @@
 	int error;
 	u_short l;
 
+	AMDPM_LOCK(sc);
 	amdpm_clear(sc);
-	if (!amdpm_idle(sc))
+	if (!amdpm_idle(sc)) {
+		AMDPM_UNLOCK(sc);
 		return (SMB_EBUSY);
+	}
 
 	AMDPM_SMBOUTW(sc, AMDSMB_HSTADDR, slave & ~LSB);
 	AMDPM_SMBOUTW(sc, AMDSMB_HSTDATA, byte);
@@ -425,6 +455,7 @@
 	error = amdpm_wait(sc);
 
 	AMDPM_DEBUG(printf("amdpm: WRITEB to 0x%x, cmd=0x%x, byte=0x%x, error=0x%x\n", slave, cmd, byte, error));
+	AMDPM_UNLOCK(sc);
 
 	return (error);
 }
@@ -436,9 +467,12 @@
 	int error;
 	u_short l;
 
+	AMDPM_LOCK(sc);
 	amdpm_clear(sc);
-	if (!amdpm_idle(sc))
+	if (!amdpm_idle(sc)) {
+		AMDPM_UNLOCK(sc);
 		return (SMB_EBUSY);
+	}
 
 	AMDPM_SMBOUTW(sc, AMDSMB_HSTADDR, slave | LSB);
 	AMDPM_SMBOUTB(sc, AMDSMB_HSTCMD, cmd);
@@ -449,6 +483,7 @@
 		*byte = AMDPM_SMBINW(sc, AMDSMB_HSTDATA);
 
 	AMDPM_DEBUG(printf("amdpm: READB from 0x%x, cmd=0x%x, byte=0x%x, error=0x%x\n", slave, cmd, *byte, error));
+	AMDPM_UNLOCK(sc);
 
 	return (error);
 }
@@ -460,9 +495,12 @@
 	int error;
 	u_short l;
 
+	AMDPM_LOCK(sc);
 	amdpm_clear(sc);
-	if (!amdpm_idle(sc))
+	if (!amdpm_idle(sc)) {
+		AMDPM_UNLOCK(sc);
 		return (SMB_EBUSY);
+	}
 
 	AMDPM_SMBOUTW(sc, AMDSMB_HSTADDR, slave & ~LSB);
 	AMDPM_SMBOUTW(sc, AMDSMB_HSTDATA, word);
@@ -473,6 +511,7 @@
 	error = amdpm_wait(sc);
 
 	AMDPM_DEBUG(printf("amdpm: WRITEW to 0x%x, cmd=0x%x, word=0x%x, error=0x%x\n", slave, cmd, word, error));
+	AMDPM_UNLOCK(sc);
 
 	return (error);
 }
@@ -484,9 +523,12 @@
 	int error;
 	u_short l;
 
+	AMDPM_LOCK(sc);
 	amdpm_clear(sc);
-	if (!amdpm_idle(sc))
+	if (!amdpm_idle(sc)) {
+		AMDPM_UNLOCK(sc);
 		return (SMB_EBUSY);
+	}
 
 	AMDPM_SMBOUTW(sc, AMDSMB_HSTADDR, slave | LSB);
 	AMDPM_SMBOUTB(sc, AMDSMB_HSTCMD, cmd);
@@ -497,6 +539,7 @@
 		*word = AMDPM_SMBINW(sc, AMDSMB_HSTDATA);
 
 	AMDPM_DEBUG(printf("amdpm: READW from 0x%x, cmd=0x%x, word=0x%x, error=0x%x\n", slave, cmd, *word, error));
+	AMDPM_UNLOCK(sc);
 
 	return (error);
 }
@@ -505,84 +548,89 @@
 amdpm_bwrite(device_t dev, u_char slave, char cmd, u_char count, char *buf)
 {
 	struct amdpm_softc *sc = (struct amdpm_softc *)device_get_softc(dev);
-	u_char remain, len, i;
-	int error = SMB_ENOERR;
+	u_char i;
+	int error;
 	u_short l;
 
+	if (count < 1 || count > 32)
+		return (SMB_EINVAL);
+
+	AMDPM_LOCK(sc);
 	amdpm_clear(sc);
-	if(!amdpm_idle(sc))
+	if (!amdpm_idle(sc)) {
+		AMDPM_UNLOCK(sc);
 		return (SMB_EBUSY);
+	}
 
-	remain = count;
-	while (remain) {
-		len = min(remain, 32);
-
-		AMDPM_SMBOUTW(sc, AMDSMB_HSTADDR, slave & ~LSB);
+	AMDPM_SMBOUTW(sc, AMDSMB_HSTADDR, slave & ~LSB);
 	
-		/*
-		 * Do we have to reset the internal 32-byte buffer?
-		 * Can't see how to do this from the data sheet.
-		 */
-
-		AMDPM_SMBOUTW(sc, AMDSMB_HSTDATA, len);
-
-		/* Fill the 32-byte internal buffer */
-		for (i=0; i<len; i++) {
-			AMDPM_SMBOUTB(sc, AMDSMB_HSTDFIFO, buf[count-remain+i]);
-			DELAY(2);
-		}
-		AMDPM_SMBOUTB(sc, AMDSMB_HSTCMD, cmd);
-		l = AMDPM_SMBINW(sc, AMDSMB_GLOBAL_ENABLE);
-		AMDPM_SMBOUTW(sc, AMDSMB_GLOBAL_ENABLE, (l & 0xfff8) | AMDSMB_GE_CYC_BLOCK | AMDSMB_GE_HOST_STC);
-
-		if ((error = amdpm_wait(sc)) != SMB_ENOERR)
-			goto error;
-
-		remain -= len;
+	/*
+	 * Do we have to reset the internal 32-byte buffer?
+	 * Can't see how to do this from the data sheet.
+	 */
+	AMDPM_SMBOUTW(sc, AMDSMB_HSTDATA, count);
+
+	/* Fill the 32-byte internal buffer */
+	for (i = 0; i < count; i++) {
+		AMDPM_SMBOUTB(sc, AMDSMB_HSTDFIFO, buf[i]);
+		DELAY(2);
 	}
+	AMDPM_SMBOUTB(sc, AMDSMB_HSTCMD, cmd);
+	l = AMDPM_SMBINW(sc, AMDSMB_GLOBAL_ENABLE);
+	AMDPM_SMBOUTW(sc, AMDSMB_GLOBAL_ENABLE,
+	    (l & 0xfff8) | AMDSMB_GE_CYC_BLOCK | AMDSMB_GE_HOST_STC);
+
+	error = amdpm_wait(sc);
 
-error:
 	AMDPM_DEBUG(printf("amdpm: WRITEBLK to 0x%x, count=0x%x, cmd=0x%x, error=0x%x", slave, count, cmd, error));
+	AMDPM_UNLOCK(sc);
 
 	return (error);
 }
 
 static int
-amdpm_bread(device_t dev, u_char slave, char cmd, u_char count, char *buf)
+amdpm_bread(device_t dev, u_char slave, char cmd, u_char *count, char *buf)
 {
 	struct amdpm_softc *sc = (struct amdpm_softc *)device_get_softc(dev);
-	u_char remain, len, i;
-	int error = SMB_ENOERR;
+	u_char data, len, i;
+	int error;
 	u_short l;
 
+	if (*count < 1 || *count > 32)
+		return (SMB_EINVAL);
+
+	AMDPM_LOCK(sc);
 	amdpm_clear(sc);
-	if (!amdpm_idle(sc))
+	if (!amdpm_idle(sc)) {
+		AMDPM_UNLOCK(sc);
 		return (SMB_EBUSY);
+	}
 
-	remain = count;
-	while (remain) {
-		AMDPM_SMBOUTW(sc, AMDSMB_HSTADDR, slave | LSB);
+	AMDPM_SMBOUTW(sc, AMDSMB_HSTADDR, slave | LSB);
 	
-		AMDPM_SMBOUTB(sc, AMDSMB_HSTCMD, cmd);
+	AMDPM_SMBOUTB(sc, AMDSMB_HSTCMD, cmd);
 
-		l = AMDPM_SMBINW(sc, AMDSMB_GLOBAL_ENABLE);
-		AMDPM_SMBOUTW(sc, AMDSMB_GLOBAL_ENABLE, (l & 0xfff8) | AMDSMB_GE_CYC_BLOCK | AMDSMB_GE_HOST_STC);
+	l = AMDPM_SMBINW(sc, AMDSMB_GLOBAL_ENABLE);
+	AMDPM_SMBOUTW(sc, AMDSMB_GLOBAL_ENABLE,
+	    (l & 0xfff8) | AMDSMB_GE_CYC_BLOCK | AMDSMB_GE_HOST_STC);
 		
-		if ((error = amdpm_wait(sc)) != SMB_ENOERR)
-			goto error;
-
-		len = AMDPM_SMBINW(sc, AMDSMB_HSTDATA);
+	if ((error = amdpm_wait(sc)) != SMB_ENOERR)
+		goto error;
 
-		/* Read the 32-byte internal buffer */
-		for (i=0; i<len; i++) {
-			buf[count-remain+i] = AMDPM_SMBINB(sc, AMDSMB_HSTDFIFO);
-			DELAY(2);
-		}
+	len = AMDPM_SMBINW(sc, AMDSMB_HSTDATA);
 
-		remain -= len;
+	/* Read the 32-byte internal buffer */
+	for (i = 0; i < len; i++) {
+		data = AMDPM_SMBINB(sc, AMDSMB_HSTDFIFO);
+		if (i < *count)
+			buf[i] = data;
+		DELAY(2);
 	}
+	*count = len;
+
 error:
-	AMDPM_DEBUG(printf("amdpm: READBLK to 0x%x, count=0x%x, cmd=0x%x, error=0x%x", slave, count, cmd, error));
+	AMDPM_DEBUG(printf("amdpm: READBLK to 0x%x, count=0x%x, cmd=0x%x, error=0x%x", slave, *count, cmd, error));
+	AMDPM_UNLOCK(sc);
 
 	return (error);
 }
@@ -617,8 +665,8 @@
 };
 
 DRIVER_MODULE(amdpm, pci, amdpm_driver, amdpm_devclass, 0, 0);
+DRIVER_MODULE(smbus, amdpm, smbus_driver, smbus_devclass, 0, 0);
 
 MODULE_DEPEND(amdpm, pci, 1, 1, 1);
 MODULE_DEPEND(amdpm, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER);
 MODULE_VERSION(amdpm, 1);
-
--- /dev/null
+++ sys/pci/nfsmb.c
@@ -0,0 +1,622 @@
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/sys/pci/nfsmb.c,v 1.6.2.1 2007/11/14 19:40:56 remko Exp $");
+
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <sys/kernel.h>
+#include <sys/lock.h>
+#include <sys/module.h>
+#include <sys/mutex.h>
+#include <sys/systm.h>
+
+#include <machine/bus.h>
+#include <machine/resource.h>
+#include <sys/rman.h>
+
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+
+#include <dev/smbus/smbconf.h>
+#include "smbus_if.h"
+
+#define	NFSMB_DEBUG(x)	if (nfsmb_debug) (x)
+
+#ifdef DEBUG
+static int nfsmb_debug = 1;
+#else
+static int nfsmb_debug = 0;
+#endif
+
+/* NVIDIA nForce2/3/4 MCP */
+#define	NFSMB_VENDORID_NVIDIA		0x10de
+#define	NFSMB_DEVICEID_NF2_SMB		0x0064
+#define	NFSMB_DEVICEID_NF2_ULTRA_SMB	0x0084
+#define	NFSMB_DEVICEID_NF3_PRO150_SMB	0x00d4
+#define	NFSMB_DEVICEID_NF3_250GB_SMB	0x00e4
+#define	NFSMB_DEVICEID_NF4_SMB		0x0052
+#define	NFSMB_DEVICEID_NF4_04_SMB	0x0034
+#define	NFSMB_DEVICEID_NF4_51_SMB	0x0264
+#define	NFSMB_DEVICEID_NF4_55_SMB	0x0368
+#define	NFSMB_DEVICEID_NF4_61_SMB	0x03eb
+
+/* PCI Configuration space registers */
+#define	NF2PCI_SMBASE_1		PCIR_BAR(4)
+#define	NF2PCI_SMBASE_2		PCIR_BAR(5)
+
+/*
+ * ACPI 3.0, Chapter 12, SMBus Host Controller Interface.
+ */
+#define	SMB_PRTCL		0x00	/* protocol */
+#define	SMB_STS			0x01	/* status */
+#define	SMB_ADDR		0x02	/* address */
+#define	SMB_CMD			0x03	/* command */
+#define	SMB_DATA		0x04	/* 32 data registers */
+#define	SMB_BCNT		0x24	/* number of data bytes */
+#define	SMB_ALRM_A		0x25	/* alarm address */
+#define	SMB_ALRM_D		0x26	/* 2 bytes alarm data */
+
+#define	SMB_STS_DONE		0x80
+#define	SMB_STS_ALRM		0x40
+#define	SMB_STS_RES		0x20
+#define	SMB_STS_STATUS		0x1f
+#define	SMB_STS_OK		0x00	/* OK */
+#define	SMB_STS_UF		0x07	/* Unknown Failure */
+#define	SMB_STS_DANA		0x10	/* Device Address Not Acknowledged */
+#define	SMB_STS_DED		0x11	/* Device Error Detected */
+#define	SMB_STS_DCAD		0x12	/* Device Command Access Denied */
+#define	SMB_STS_UE		0x13	/* Unknown Error */
+#define	SMB_STS_DAD		0x17	/* Device Access Denied */
+#define	SMB_STS_T		0x18	/* Timeout */
+#define	SMB_STS_HUP		0x19	/* Host Unsupported Protocol */
+#define	SMB_STS_B		0x1A	/* Busy */
+#define	SMB_STS_PEC		0x1F	/* PEC (CRC-8) Error */
+
+#define	SMB_PRTCL_WRITE		0x00
+#define	SMB_PRTCL_READ		0x01
+#define	SMB_PRTCL_QUICK		0x02
+#define	SMB_PRTCL_BYTE		0x04
+#define	SMB_PRTCL_BYTE_DATA	0x06
+#define	SMB_PRTCL_WORD_DATA	0x08
+#define	SMB_PRTCL_BLOCK_DATA	0x0a
+#define	SMB_PRTCL_PROC_CALL	0x0c
+#define	SMB_PRTCL_BLOCK_PROC_CALL 0x0d
+#define	SMB_PRTCL_PEC		0x80
+
+struct nfsmb_softc {
+	int rid;
+	struct resource *res;
+	bus_space_tag_t smbst;
+	bus_space_handle_t smbsh;
+	device_t smbus;
+	device_t subdev;
+	struct mtx lock;
+};
+
+#define	NFSMB_LOCK(nfsmb)		mtx_lock(&(nfsmb)->lock)
+#define	NFSMB_UNLOCK(nfsmb)		mtx_unlock(&(nfsmb)->lock)
+#define	NFSMB_LOCK_ASSERT(nfsmb)	mtx_assert(&(nfsmb)->lock, MA_OWNED)
+
+#define	NFSMB_SMBINB(nfsmb, register)					\
+	(bus_space_read_1(nfsmb->smbst, nfsmb->smbsh, register))
+#define	NFSMB_SMBOUTB(nfsmb, register, value) \
+	(bus_space_write_1(nfsmb->smbst, nfsmb->smbsh, register, value))
+
+static int	nfsmb_detach(device_t dev);
+static int	nfsmbsub_detach(device_t dev);
+
+static int
+nfsmbsub_probe(device_t dev)
+{
+
+	device_set_desc(dev, "nForce2/3/4 MCP SMBus Controller");
+	return (BUS_PROBE_DEFAULT);
+}
+
+static int
+nfsmb_probe(device_t dev)
+{
+	u_int16_t vid;
+	u_int16_t did;
+
+	vid = pci_get_vendor(dev);
+	did = pci_get_device(dev);
+
+	if (vid == NFSMB_VENDORID_NVIDIA) {
+		switch(did) {
+		case NFSMB_DEVICEID_NF2_SMB:
+		case NFSMB_DEVICEID_NF2_ULTRA_SMB:
+		case NFSMB_DEVICEID_NF3_PRO150_SMB:
+		case NFSMB_DEVICEID_NF3_250GB_SMB:
+		case NFSMB_DEVICEID_NF4_SMB:
+		case NFSMB_DEVICEID_NF4_04_SMB:
+		case NFSMB_DEVICEID_NF4_51_SMB:
+		case NFSMB_DEVICEID_NF4_55_SMB:
+		case NFSMB_DEVICEID_NF4_61_SMB:
+			device_set_desc(dev, "nForce2/3/4 MCP SMBus Controller");
+			return (BUS_PROBE_DEFAULT);
+		}
+	}
+
+	return (ENXIO);
+}
+
+static int
+nfsmbsub_attach(device_t dev)
+{
+	device_t parent;
+	struct nfsmb_softc *nfsmbsub_sc = device_get_softc(dev);
+
+	parent = device_get_parent(dev);
+
+	nfsmbsub_sc->rid = NF2PCI_SMBASE_2;
+
+	nfsmbsub_sc->res = bus_alloc_resource_any(parent, SYS_RES_IOPORT,
+	    &nfsmbsub_sc->rid, RF_ACTIVE);
+	if (nfsmbsub_sc->res == NULL) {
+		/* Older incarnations of the device used non-standard BARs. */
+		nfsmbsub_sc->rid = 0x54;
+		nfsmbsub_sc->res = bus_alloc_resource_any(parent,
+		    SYS_RES_IOPORT, &nfsmbsub_sc->rid, RF_ACTIVE);
+		if (nfsmbsub_sc->res == NULL) {
+			device_printf(dev, "could not map i/o space\n");
+			return (ENXIO);
+		}
+	}
+	nfsmbsub_sc->smbst = rman_get_bustag(nfsmbsub_sc->res);
+	nfsmbsub_sc->smbsh = rman_get_bushandle(nfsmbsub_sc->res);
+	mtx_init(&nfsmbsub_sc->lock, device_get_nameunit(dev), "nfsmb",
+	    MTX_DEF);
+
+	nfsmbsub_sc->smbus = device_add_child(dev, "smbus", -1);
+	if (nfsmbsub_sc->smbus == NULL) {
+		nfsmbsub_detach(dev);
+		return (EINVAL);
+	}
+
+	bus_generic_attach(dev);
+
+	return (0);
+}
+
+static int
+nfsmb_attach(device_t dev)
+{
+	struct nfsmb_softc *nfsmb_sc = device_get_softc(dev);
+
+	/* Allocate I/O space */
+	nfsmb_sc->rid = NF2PCI_SMBASE_1;
+
+	nfsmb_sc->res = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
+		&nfsmb_sc->rid, RF_ACTIVE);
+
+	if (nfsmb_sc->res == NULL) {
+		/* Older incarnations of the device used non-standard BARs. */
+		nfsmb_sc->rid = 0x50;
+		nfsmb_sc->res = bus_alloc_resource_any(dev,
+		    SYS_RES_IOPORT, &nfsmb_sc->rid, RF_ACTIVE);
+		if (nfsmb_sc->res == NULL) {
+			device_printf(dev, "could not map i/o space\n");
+			return (ENXIO);
+		}
+	}
+
+	nfsmb_sc->smbst = rman_get_bustag(nfsmb_sc->res);
+	nfsmb_sc->smbsh = rman_get_bushandle(nfsmb_sc->res);
+	mtx_init(&nfsmb_sc->lock, device_get_nameunit(dev), "nfsmb", MTX_DEF);
+
+	/* Allocate a new smbus device */
+	nfsmb_sc->smbus = device_add_child(dev, "smbus", -1);
+	if (!nfsmb_sc->smbus) {
+		nfsmb_detach(dev);
+		return (EINVAL);
+	}
+
+	nfsmb_sc->subdev = NULL;
+	switch (pci_get_device(dev)) {
+	case NFSMB_DEVICEID_NF2_SMB:
+	case NFSMB_DEVICEID_NF2_ULTRA_SMB:
+	case NFSMB_DEVICEID_NF3_PRO150_SMB:
+	case NFSMB_DEVICEID_NF3_250GB_SMB:
+	case NFSMB_DEVICEID_NF4_SMB:
+	case NFSMB_DEVICEID_NF4_04_SMB:
+	case NFSMB_DEVICEID_NF4_51_SMB:
+	case NFSMB_DEVICEID_NF4_55_SMB:
+	case NFSMB_DEVICEID_NF4_61_SMB:
+		/* Trying to add secondary device as slave */
+		nfsmb_sc->subdev = device_add_child(dev, "nfsmb", -1);
+		if (!nfsmb_sc->subdev) {
+			nfsmb_detach(dev);
+			return (EINVAL);
+		}
+		break;
+	default:
+		break;
+	}
+
+	bus_generic_attach(dev);
+
+	return (0);
+}
+
+static int
+nfsmbsub_detach(device_t dev)
+{
+	device_t parent;
+	struct nfsmb_softc *nfsmbsub_sc = device_get_softc(dev);
+
+	parent = device_get_parent(dev);
+
+	if (nfsmbsub_sc->smbus) {
+		device_delete_child(dev, nfsmbsub_sc->smbus);
+		nfsmbsub_sc->smbus = NULL;
+	}
+	mtx_destroy(&nfsmbsub_sc->lock);
+	if (nfsmbsub_sc->res) {
+		bus_release_resource(parent, SYS_RES_IOPORT, nfsmbsub_sc->rid,
+		    nfsmbsub_sc->res);
+		nfsmbsub_sc->res = NULL;
+	}
+	return (0);
+}
+
+static int
+nfsmb_detach(device_t dev)
+{
+	struct nfsmb_softc *nfsmb_sc = device_get_softc(dev);
+
+	if (nfsmb_sc->subdev) {
+		device_delete_child(dev, nfsmb_sc->subdev);
+		nfsmb_sc->subdev = NULL;
+	}
+
+	if (nfsmb_sc->smbus) {
+		device_delete_child(dev, nfsmb_sc->smbus);
+		nfsmb_sc->smbus = NULL;
+	}
+
+	mtx_destroy(&nfsmb_sc->lock);
+	if (nfsmb_sc->res) {
+		bus_release_resource(dev, SYS_RES_IOPORT, nfsmb_sc->rid,
+		    nfsmb_sc->res);
+		nfsmb_sc->res = NULL;
+	}
+
+	return (0);
+}
+
+static int
+nfsmb_callback(device_t dev, int index, void *data)
+{
+	int error = 0;
+
+	switch (index) {
+	case SMB_REQUEST_BUS:
+	case SMB_RELEASE_BUS:
+		break;
+	default:
+		error = EINVAL;
+	}
+
+	return (error);
+}
+
+static int
+nfsmb_wait(struct nfsmb_softc *sc)
+{
+	u_char sts;
+	int error, count;
+
+	NFSMB_LOCK_ASSERT(sc);
+	if (NFSMB_SMBINB(sc, SMB_PRTCL) != 0)
+	{
+		count = 10000;
+		do {
+			DELAY(500);
+		} while (NFSMB_SMBINB(sc, SMB_PRTCL) != 0 && count--);
+		if (count == 0)
+			return (SMB_ETIMEOUT);
+	}
+
+	sts = NFSMB_SMBINB(sc, SMB_STS) & SMB_STS_STATUS;
+	NFSMB_DEBUG(printf("nfsmb: STS=0x%x\n", sts));
+
+	switch (sts) {
+	case SMB_STS_OK:
+		error = SMB_ENOERR;
+		break;
+	case SMB_STS_DANA:
+		error = SMB_ENOACK;
+		break;
+	case SMB_STS_B:
+		error = SMB_EBUSY;
+		break;
+	case SMB_STS_T:
+		error = SMB_ETIMEOUT;
+		break;
+	case SMB_STS_DCAD:
+	case SMB_STS_DAD:
+	case SMB_STS_HUP:
+		error = SMB_ENOTSUPP;
+		break;
+	default:
+		error = SMB_EBUSERR;
+		break;
+	}
+
+	return (error);
+}
+
+static int
+nfsmb_quick(device_t dev, u_char slave, int how)
+{
+	struct nfsmb_softc *sc = (struct nfsmb_softc *)device_get_softc(dev);
+	u_char protocol;
+	int error;
+
+	protocol = SMB_PRTCL_QUICK;
+
+	switch (how) {
+	case SMB_QWRITE:
+		protocol |= SMB_PRTCL_WRITE;
+		NFSMB_DEBUG(printf("nfsmb: QWRITE to 0x%x", slave));
+		break;
+	case SMB_QREAD:
+		protocol |= SMB_PRTCL_READ;
+		NFSMB_DEBUG(printf("nfsmb: QREAD to 0x%x", slave));
+		break;
+	default:
+		panic("%s: unknown QUICK command (%x)!", __func__, how);
+	}
+
+	NFSMB_LOCK(sc);
+	NFSMB_SMBOUTB(sc, SMB_ADDR, slave);
+	NFSMB_SMBOUTB(sc, SMB_PRTCL, protocol);
+
+	error = nfsmb_wait(sc);
+
+	NFSMB_DEBUG(printf(", error=0x%x\n", error));
+	NFSMB_UNLOCK(sc);
+
+	return (error);
+}
+
+static int
+nfsmb_sendb(device_t dev, u_char slave, char byte)
+{
+	struct nfsmb_softc *sc = (struct nfsmb_softc *)device_get_softc(dev);
+	int error;
+
+	NFSMB_LOCK(sc);
+	NFSMB_SMBOUTB(sc, SMB_CMD, byte);
+	NFSMB_SMBOUTB(sc, SMB_ADDR, slave);
+	NFSMB_SMBOUTB(sc, SMB_PRTCL, SMB_PRTCL_WRITE | SMB_PRTCL_BYTE);
+
+	error = nfsmb_wait(sc);
+
+	NFSMB_DEBUG(printf("nfsmb: SENDB to 0x%x, byte=0x%x, error=0x%x\n", slave, byte, error));
+	NFSMB_UNLOCK(sc);
+
+	return (error);
+}
+
+static int
+nfsmb_recvb(device_t dev, u_char slave, char *byte)
+{
+	struct nfsmb_softc *sc = (struct nfsmb_softc *)device_get_softc(dev);
+	int error;
+
+	NFSMB_LOCK(sc);
+	NFSMB_SMBOUTB(sc, SMB_ADDR, slave);
+	NFSMB_SMBOUTB(sc, SMB_PRTCL, SMB_PRTCL_READ | SMB_PRTCL_BYTE);
+
+	if ((error = nfsmb_wait(sc)) == SMB_ENOERR)
+		*byte = NFSMB_SMBINB(sc, SMB_DATA);
+
+	NFSMB_DEBUG(printf("nfsmb: RECVB from 0x%x, byte=0x%x, error=0x%x\n", slave, *byte, error));
+	NFSMB_UNLOCK(sc);
+
+	return (error);
+}
+
+static int
+nfsmb_writeb(device_t dev, u_char slave, char cmd, char byte)
+{
+	struct nfsmb_softc *sc = (struct nfsmb_softc *)device_get_softc(dev);
+	int error;
+
+	NFSMB_LOCK(sc);
+	NFSMB_SMBOUTB(sc, SMB_CMD, cmd);
+	NFSMB_SMBOUTB(sc, SMB_DATA, byte);
+	NFSMB_SMBOUTB(sc, SMB_ADDR, slave);
+	NFSMB_SMBOUTB(sc, SMB_PRTCL, SMB_PRTCL_WRITE | SMB_PRTCL_BYTE_DATA);
+
+	error = nfsmb_wait(sc);
+
+	NFSMB_DEBUG(printf("nfsmb: WRITEB to 0x%x, cmd=0x%x, byte=0x%x, error=0x%x\n", slave, cmd, byte, error));
+	NFSMB_UNLOCK(sc);
+
+	return (error);
+}
+
+static int
+nfsmb_readb(device_t dev, u_char slave, char cmd, char *byte)
+{
+	struct nfsmb_softc *sc = (struct nfsmb_softc *)device_get_softc(dev);
+	int error;
+
+	NFSMB_LOCK(sc);
+	NFSMB_SMBOUTB(sc, SMB_CMD, cmd);
+	NFSMB_SMBOUTB(sc, SMB_ADDR, slave);
+	NFSMB_SMBOUTB(sc, SMB_PRTCL, SMB_PRTCL_READ | SMB_PRTCL_BYTE_DATA);
+
+	if ((error = nfsmb_wait(sc)) == SMB_ENOERR)
+		*byte = NFSMB_SMBINB(sc, SMB_DATA);
+
+	NFSMB_DEBUG(printf("nfsmb: READB from 0x%x, cmd=0x%x, byte=0x%x, error=0x%x\n", slave, cmd, (unsigned char)*byte, error));
+	NFSMB_UNLOCK(sc);
+
+	return (error);
+}
+
+static int
+nfsmb_writew(device_t dev, u_char slave, char cmd, short word)
+{
+	struct nfsmb_softc *sc = (struct nfsmb_softc *)device_get_softc(dev);
+	int error;
+
+	NFSMB_LOCK(sc);
+	NFSMB_SMBOUTB(sc, SMB_CMD, cmd);
+	NFSMB_SMBOUTB(sc, SMB_DATA, word);
+	NFSMB_SMBOUTB(sc, SMB_DATA + 1, word >> 8);
+	NFSMB_SMBOUTB(sc, SMB_ADDR, slave);
+	NFSMB_SMBOUTB(sc, SMB_PRTCL, SMB_PRTCL_WRITE | SMB_PRTCL_WORD_DATA);
+
+	error = nfsmb_wait(sc);
+
+	NFSMB_DEBUG(printf("nfsmb: WRITEW to 0x%x, cmd=0x%x, word=0x%x, error=0x%x\n", slave, cmd, word, error));
+	NFSMB_UNLOCK(sc);
+
+	return (error);
+}
+
+static int
+nfsmb_readw(device_t dev, u_char slave, char cmd, short *word)
+{
+	struct nfsmb_softc *sc = (struct nfsmb_softc *)device_get_softc(dev);
+	int error;
+
+	NFSMB_LOCK(sc);
+	NFSMB_SMBOUTB(sc, SMB_CMD, cmd);
+	NFSMB_SMBOUTB(sc, SMB_ADDR, slave);
+	NFSMB_SMBOUTB(sc, SMB_PRTCL, SMB_PRTCL_READ | SMB_PRTCL_WORD_DATA);
+
+	if ((error = nfsmb_wait(sc)) == SMB_ENOERR)
+		*word = NFSMB_SMBINB(sc, SMB_DATA) |
+		    (NFSMB_SMBINB(sc, SMB_DATA + 1) << 8);
+
+	NFSMB_DEBUG(printf("nfsmb: READW from 0x%x, cmd=0x%x, word=0x%x, error=0x%x\n", slave, cmd, (unsigned short)*word, error));
+	NFSMB_UNLOCK(sc);
+
+	return (error);
+}
+
+static int
+nfsmb_bwrite(device_t dev, u_char slave, char cmd, u_char count, char *buf)
+{
+	struct nfsmb_softc *sc = (struct nfsmb_softc *)device_get_softc(dev);
+	u_char i;
+	int error;
+
+	if (count < 1 || count > 32)
+		return (SMB_EINVAL);
+
+	NFSMB_LOCK(sc);
+	NFSMB_SMBOUTB(sc, SMB_CMD, cmd);
+	NFSMB_SMBOUTB(sc, SMB_BCNT, count);
+	for (i = 0; i < count; i++)
+		NFSMB_SMBOUTB(sc, SMB_DATA + i, buf[i]);
+	NFSMB_SMBOUTB(sc, SMB_ADDR, slave);
+	NFSMB_SMBOUTB(sc, SMB_PRTCL, SMB_PRTCL_WRITE | SMB_PRTCL_BLOCK_DATA);
+
+	error = nfsmb_wait(sc);
+
+	NFSMB_DEBUG(printf("nfsmb: WRITEBLK to 0x%x, count=0x%x, cmd=0x%x, error=0x%x", slave, count, cmd, error));
+	NFSMB_UNLOCK(sc);
+
+	return (error);
+}
+
+static int
+nfsmb_bread(device_t dev, u_char slave, char cmd, u_char *count, char *buf)
+{
+	struct nfsmb_softc *sc = (struct nfsmb_softc *)device_get_softc(dev);
+	u_char data, len, i;
+	int error;
+
+	if (*count < 1 || *count > 32)
+		return (SMB_EINVAL);
+
+	NFSMB_LOCK(sc);
+	NFSMB_SMBOUTB(sc, SMB_CMD, cmd);
+	NFSMB_SMBOUTB(sc, SMB_ADDR, slave);
+	NFSMB_SMBOUTB(sc, SMB_PRTCL, SMB_PRTCL_READ | SMB_PRTCL_BLOCK_DATA);
+
+	if ((error = nfsmb_wait(sc)) == SMB_ENOERR) {
+		len = NFSMB_SMBINB(sc, SMB_BCNT);
+		for (i = 0; i < len; i++) {
+			data = NFSMB_SMBINB(sc, SMB_DATA + i);
+			if (i < *count)
+				buf[i] = data;
+		}
+		*count = len;
+	}
+
+	NFSMB_DEBUG(printf("nfsmb: READBLK to 0x%x, count=0x%x, cmd=0x%x, error=0x%x", slave, *count, cmd, error));
+	NFSMB_UNLOCK(sc);
+
+	return (error);
+}
+
+static device_method_t nfsmb_methods[] = {
+	/* Device interface */
+	DEVMETHOD(device_probe,		nfsmb_probe),
+	DEVMETHOD(device_attach,	nfsmb_attach),
+	DEVMETHOD(device_detach,	nfsmb_detach),
+
+	/* SMBus interface */
+	DEVMETHOD(smbus_callback,	nfsmb_callback),
+	DEVMETHOD(smbus_quick,		nfsmb_quick),
+	DEVMETHOD(smbus_sendb,		nfsmb_sendb),
+	DEVMETHOD(smbus_recvb,		nfsmb_recvb),
+	DEVMETHOD(smbus_writeb,		nfsmb_writeb),
+	DEVMETHOD(smbus_readb,		nfsmb_readb),
+	DEVMETHOD(smbus_writew,		nfsmb_writew),
+	DEVMETHOD(smbus_readw,		nfsmb_readw),
+	DEVMETHOD(smbus_bwrite,		nfsmb_bwrite),
+	DEVMETHOD(smbus_bread,		nfsmb_bread),
+
+	{ 0, 0 }
+};
+
+static device_method_t nfsmbsub_methods[] = {
+	/* Device interface */
+	DEVMETHOD(device_probe,		nfsmbsub_probe),
+	DEVMETHOD(device_attach,	nfsmbsub_attach),
+	DEVMETHOD(device_detach,	nfsmbsub_detach),
+
+	/* SMBus interface */
+	DEVMETHOD(smbus_callback,	nfsmb_callback),
+	DEVMETHOD(smbus_quick,		nfsmb_quick),
+	DEVMETHOD(smbus_sendb,		nfsmb_sendb),
+	DEVMETHOD(smbus_recvb,		nfsmb_recvb),
+	DEVMETHOD(smbus_writeb,		nfsmb_writeb),
+	DEVMETHOD(smbus_readb,		nfsmb_readb),
+	DEVMETHOD(smbus_writew,		nfsmb_writew),
+	DEVMETHOD(smbus_readw,		nfsmb_readw),
+	DEVMETHOD(smbus_bwrite,		nfsmb_bwrite),
+	DEVMETHOD(smbus_bread,		nfsmb_bread),
+
+	{ 0, 0 }
+};
+
+static devclass_t nfsmb_devclass;
+
+static driver_t nfsmb_driver = {
+	"nfsmb",
+	nfsmb_methods,
+	sizeof(struct nfsmb_softc),
+};
+
+static driver_t nfsmbsub_driver = {
+	"nfsmb",
+	nfsmbsub_methods,
+	sizeof(struct nfsmb_softc),
+};
+
+DRIVER_MODULE(nfsmb, pci, nfsmb_driver, nfsmb_devclass, 0, 0);
+DRIVER_MODULE(nfsmb, nfsmb, nfsmbsub_driver, nfsmb_devclass, 0, 0);
+DRIVER_MODULE(smbus, nfsmb, smbus_driver, smbus_devclass, 0, 0);
+
+MODULE_DEPEND(nfsmb, pci, 1, 1, 1);
+MODULE_DEPEND(nfsmb, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER);
+MODULE_VERSION(nfsmb, 1);
--- sys/pci/yukonreg.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/*	$OpenBSD: yukonreg.h,v 1.2 2003/08/12 05:23:06 nate Exp $ */
-/*-
- * Copyright (c) 2003 Nathan L. Binkert <binkertn at umich.edu>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * $FreeBSD: src/sys/pci/yukonreg.h,v 1.2 2005/01/07 02:29:18 imp Exp $
- */
-
-/* General Purpose Status Register (GPSR) */
-#define YUKON_GPSR		0x0000
-
-#define YU_GPSR_SPEED		0x8000	/* speed 0 - 10Mbps, 1 - 100Mbps */
-#define YU_GPSR_DUPLEX		0x4000	/* 0 - half duplex, 1 - full duplex */
-#define YU_GPSR_FCTL_TX		0x2000	/* flow control */
-#define YU_GPSR_LINK		0x1000	/* link status (down/up) */
-#define YU_GPSR_PAUSE		0x0800	/* flow control enable/disable */
-#define YU_GPSR_TX_IN_PROG	0x0400	/* transmit in progress */
-#define YU_GPSR_EXCESS_COL	0x0200	/* excessive collisions occurred */
-#define YU_GPSR_LATE_COL	0x0100	/* late collision occurred */
-#define YU_GPSR_MII_PHY_STC	0x0020	/* MII PHY status change */
-#define YU_GPSR_GIG_SPEED	0x0010	/* Gigabit Speed (0 - use speed bit) */
-#define YU_GPSR_PARTITION	0x0008	/* partition mode */
-#define YU_GPSR_FCTL_RX		0x0004	/* flow control enable/disable */
-#define YU_GPSR_PROMS_EN	0x0002	/* promiscuous mode enable/disable */
-
-/* General Purpose Control Register (GPCR) */
-#define YUKON_GPCR		0x0004
-
-#define YU_GPCR_FCTL_TX		0x2000	/* Transmit flow control 802.3x */
-#define YU_GPCR_TXEN		0x1000	/* Transmit Enable */
-#define YU_GPCR_RXEN		0x0800	/* Receive Enable */
-#define YU_GPCR_LPBK		0x0200	/* Loopback Enable */
-#define YU_GPCR_PAR		0x0100	/* Partition Enable */
-#define YU_GPCR_GIG		0x0080	/* Gigabit Speed */
-#define YU_GPCR_FLP		0x0040	/* Force Link Pass */
-#define YU_GPCR_DUPLEX		0x0020	/* Duplex Enable */
-#define YU_GPCR_FCTL_RX		0x0010	/* Receive flow control 802.3x */
-#define YU_GPCR_SPEED		0x0008	/* Port Speed */
-#define YU_GPCR_DPLX_EN		0x0004	/* Enable Auto-Update for duplex */
-#define YU_GPCR_FCTL_EN		0x0002	/* Enabel Auto-Update for 802.3x */
-#define YU_GPCR_SPEED_EN	0x0001	/* Enable Auto-Update for speed */
-
-/* Transmit Control Register (TCR) */
-#define YUKON_TCR		0x0008
-
-#define YU_TCR_FJ		0x8000	/* force jam / flow control */
-#define YU_TCR_CRCD		0x4000	/* insert CRC (0 - enable) */
-#define YU_TCR_PADD		0x2000	/* pad packets to 64b (0 - enable) */
-#define YU_TCR_COLTH		0x1c00	/* collision threshold */
-
-/* Receive Control Register (RCR) */
-#define YUKON_RCR		0x000c
-
-#define YU_RCR_UFLEN		0x8000	/* unicast filter enable */
-#define YU_RCR_MUFLEN		0x4000	/* multicast filter enable */
-#define YU_RCR_CRCR		0x2000	/* remove CRC */
-#define YU_RCR_PASSFC		0x1000	/* pass flow control packets */
-
-/* Transmit Flow Control Register (TFCR) */
-#define YUKON_TFCR		0x0010	/* Pause Time */
-
-/* Transmit Parameter Register (TPR) */
-#define YUKON_TPR		0x0014
-
-#define YU_TPR_JAM_LEN(x)	(((x) & 0x3) << 14)
-#define YU_TPR_JAM_IPG(x)	(((x) & 0x1f) << 9)
-#define YU_TPR_JAM2DATA_IPG(x)	(((x) & 0x1f) << 4)
-
-/* Serial Mode Register (SMR) */
-#define YUKON_SMR		0x0018
-
-#define YU_SMR_DATA_BLIND(x)	(((x) & 0x1f) << 11)
-#define YU_SMR_LIMIT4		0x0400	/* reset after 16 / 4 collisions */
-#define YU_SMR_MFL_JUMBO	0x0100	/* max frame length for jumbo frames */
-#define YU_SMR_MFL_VLAN		0x0200	/* max frame length + vlan tag */
-#define YU_SMR_IPG_DATA(x)	((x) & 0x1f)
-
-/* Source Address Low #1 (SAL1) */
-#define YUKON_SAL1		0x001c	/* SA1[15:0] */
-
-/* Source Address Middle #1 (SAM1) */
-#define YUKON_SAM1		0x0020	/* SA1[31:16] */
-
-/* Source Address High #1 (SAH1) */
-#define YUKON_SAH1		0x0024	/* SA1[47:32] */
-
-/* Source Address Low #2 (SAL2) */
-#define YUKON_SAL2		0x0028	/* SA2[15:0] */
-
-/* Source Address Middle #2 (SAM2) */
-#define YUKON_SAM2		0x002c	/* SA2[31:16] */
-
-/* Source Address High #2 (SAH2) */
-#define YUKON_SAH2		0x0030	/* SA2[47:32] */
-
-/* Multicatst Address Hash Register 1 (MCAH1) */
-#define YUKON_MCAH1		0x0034
-
-/* Multicatst Address Hash Register 2 (MCAH2) */
-#define YUKON_MCAH2		0x0038
-
-/* Multicatst Address Hash Register 3 (MCAH3) */
-#define YUKON_MCAH3		0x003c
-
-/* Multicatst Address Hash Register 4 (MCAH4) */
-#define YUKON_MCAH4		0x0040
-
-/* Transmit Interrupt Register (TIR) */
-#define YUKON_TIR		0x0044
-
-#define YU_TIR_OUT_UNICAST	0x0001	/* Num Unicast Packets Transmitted */
-#define YU_TIR_OUT_BROADCAST	0x0002	/* Num Broadcast Packets Transmitted */
-#define YU_TIR_OUT_PAUSE	0x0004	/* Num Pause Packets Transmitted */
-#define YU_TIR_OUT_MULTICAST	0x0008	/* Num Multicast Packets Transmitted */
-#define YU_TIR_OUT_OCTETS	0x0030	/* Num Bytes Transmitted */
-#define YU_TIR_OUT_64_OCTETS	0x0000	/* Num Packets Transmitted */
-#define YU_TIR_OUT_127_OCTETS	0x0000	/* Num Packets Transmitted */
-#define YU_TIR_OUT_255_OCTETS	0x0000	/* Num Packets Transmitted */
-#define YU_TIR_OUT_511_OCTETS	0x0000	/* Num Packets Transmitted */
-#define YU_TIR_OUT_1023_OCTETS	0x0000	/* Num Packets Transmitted */
-#define YU_TIR_OUT_1518_OCTETS	0x0000	/* Num Packets Transmitted */
-#define YU_TIR_OUT_MAX_OCTETS	0x0000	/* Num Packets Transmitted */
-#define YU_TIR_OUT_SPARE	0x0000	/* Num Packets Transmitted */
-#define YU_TIR_OUT_COLLISIONS	0x0000	/* Num Packets Transmitted */
-#define YU_TIR_OUT_LATE		0x0000	/* Num Packets Transmitted */
-
-/* Receive Interrupt Register (RIR) */
-#define YUKON_RIR		0x0048
-
-/* Transmit and Receive Interrupt Register (TRIR) */
-#define YUKON_TRIR		0x004c
-
-/* Transmit Interrupt Mask Register (TIMR) */
-#define YUKON_TIMR		0x0050
-
-/* Receive Interrupt Mask Register (RIMR) */
-#define YUKON_RIMR		0x0054
-
-/* Transmit and Receive Interrupt Mask Register (TRIMR) */
-#define YUKON_TRIMR		0x0058
-
-/* SMI Control Register (SMICR) */
-#define YUKON_SMICR		0x0080
-
-#define YU_SMICR_PHYAD(x)	(((x) & 0x1f) << 11)
-#define YU_SMICR_REGAD(x)	(((x) & 0x1f) << 6)
-#define YU_SMICR_OPCODE		0x0020	/* opcode (0 - write, 1 - read) */
-#define YU_SMICR_OP_READ	0x0020	/* opcode read */
-#define YU_SMICR_OP_WRITE	0x0000	/* opcode write */
-#define YU_SMICR_READ_VALID	0x0010	/* read valid */
-#define YU_SMICR_BUSY		0x0008	/* busy (writing) */
-
-/* SMI Data Register (SMIDR) */
-#define YUKON_SMIDR		0x0084
-
-/* PHY Addres Register (PAR) */
-#define YUKON_PAR		0x0088
-
-#define YU_PAR_MIB_CLR		0x0020	/* MIB Counters Clear Mode */
-#define YU_PAR_LOAD_TSTCNT	0x0010	/* Load count 0xfffffff0 into cntr */
Index: intpmreg.h
===================================================================
RCS file: /home/cvs/src/sys/pci/intpmreg.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/intpmreg.h -L sys/pci/intpmreg.h -u -r1.1.1.1 -r1.2
--- sys/pci/intpmreg.h
+++ sys/pci/intpmreg.h
@@ -23,55 +23,66 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/pci/intpmreg.h,v 1.2 1999/08/28 00:51:01 peter Exp $
+ * $FreeBSD: src/sys/pci/intpmreg.h,v 1.4 2007/01/11 19:56:24 jhb Exp $
  */
 
-/*Register Difinition for Intel Chipset with ACPI Support*/
-#define PCI_BASE_ADDR_SMB 0x90  /*Where to MAP IO*/
-#define PCI_BASE_ADDR_PM 0x40
-#define PCI_HST_CFG_SMB 0xd2  /*Host Configuration*/
-#define PCI_INTR_SMB_SMI 0
-#define PCI_INTR_SMB_IRQ9 8
-#define PCI_INTR_SMB_ENABLE 1
-#define PCI_SLV_CMD_SMB 0xd3 /*SLAVE COMMAND*/
-#define PCI_SLV_SDW_SMB_1 0xd4 /*SLAVE SHADOW PORT 1*/
-#define PCI_SLV_SDW_SMB_2 0xd5 /*SLAVE SHADOW PORT 2*/
-#define PCI_REVID_SMB 0xd6
-#define LSB 0x1
-#define PIIX4_SMBHSTSTS 0x00
-#define PIIX4_SMBHSTSTAT_BUSY (1<<0)
-#define PIIX4_SMBHSTSTAT_INTR (1<<1)
-#define PIIX4_SMBHSTSTAT_ERR (1<<2)
-#define PIIX4_SMBHSTSTAT_BUSC (1<<3)
-#define PIIX4_SMBHSTSTAT_FAIL (1<<4)
-#define PIIX4_SMBSLVSTS 0x01
-#define PIIX4_SMBSLVSTS_ALART (1<<5)
-#define PIIX4_SMBSLVSTS_SDW2 (1<<4)
-#define PIIX4_SMBSLVSTS_SDW1 (1<<3)
-#define PIIX4_SMBSLVSTS_SLV (1<<2)
-#define PIIX4_SMBSLVSTS_BUSY (1<<0)
-#define PIIX4_SMBHSTCNT 0x02
-#define PIIX4_SMBHSTCNT_START (1<<6)
-#define PIIX4_SMBHSTCNT_PROT_QUICK 0
-#define PIIX4_SMBHSTCNT_PROT_BYTE (1<<2)
-#define PIIX4_SMBHSTCNT_PROT_BDATA (2<<2)
-#define PIIX4_SMBHSTCNT_PROT_WDATA (3<<2)
-#define PIIX4_SMBHSTCNT_PROT_BLOCK (5<<2)
-#define SMBBLOCKTRANS_MAX 32
-#define PIIX4_SMBHSTCNT_KILL (1<<1)
-#define PIIX4_SMBHSTCNT_INTREN (1)
-#define PIIX4_SMBHSTCMD 0x03
-#define PIIX4_SMBHSTADD 0x04
-#define PIIX4_SMBHSTDAT0 0x05
-#define PIIX4_SMBHSTDAT1 0x06
-#define PIIX4_SMBBLKDAT 0x07
-#define PIIX4_SMBSLVCNT 0x08
-#define PIIX4_SMBSLVCNT_ALTEN (1<<3)
-#define PIIX4_SMBSLVCNT_SD2EN (1<<2)
-#define PIIX4_SMBSLVCNT_SD1EN (1<<1)
-#define PIIX4_SMBSLVCNT_SLVEN (1)
-#define PIIX4_SMBSLVCMD 0x09
-#define PIIX4_SMBSLVEVT 0x0a
-#define PIIX4_SMBSLVDAT 0x0c
-/*This is SMBus alart response address*/
-#define SMBALTRESP 0x18
+#ifndef __INTPMREG_H__
+#define	__INTPMREG_H__
+
+/* Register definitions for non-ICH Intel Chipset SMBUS controllers. */
+
+/* PCI Config Registers. */
+#define	PCI_BASE_ADDR_SMB	0x90	/* IO BAR. */
+#define	PCI_BASE_ADDR_PM	0x40
+#define	PCI_HST_CFG_SMB		0xd2	/* Host Configuration */
+#define	PCI_INTR_SMB_SMI	0
+#define	PCI_INTR_SMB_IRQ9	8
+#define	PCI_INTR_SMB_ENABLE	1
+#define	PCI_SLV_CMD_SMB		0xd3 /*SLAVE COMMAND*/
+#define	PCI_SLV_SDW_SMB_1	0xd4 /*SLAVE SHADOW PORT 1*/
+#define	PCI_SLV_SDW_SMB_2	0xd5 /*SLAVE SHADOW PORT 2*/
+#define	PCI_REVID_SMB		0xd6
+
+/* PIXX4 SMBus Registers in the SMB BAR. */
+#define	PIIX4_SMBHSTSTS		0x00
+#define	PIIX4_SMBHSTSTAT_BUSY	(1<<0)
+#define	PIIX4_SMBHSTSTAT_INTR	(1<<1)
+#define	PIIX4_SMBHSTSTAT_ERR	(1<<2)
+#define	PIIX4_SMBHSTSTAT_BUSC	(1<<3)
+#define	PIIX4_SMBHSTSTAT_FAIL	(1<<4)
+#define	PIIX4_SMBSLVSTS		0x01
+#define	PIIX4_SMBSLVSTS_ALART	(1<<5)
+#define	PIIX4_SMBSLVSTS_SDW2	(1<<4)
+#define	PIIX4_SMBSLVSTS_SDW1	(1<<3)
+#define	PIIX4_SMBSLVSTS_SLV	(1<<2)
+#define	PIIX4_SMBSLVSTS_BUSY	(1<<0)
+#define	PIIX4_SMBHSTCNT		0x02
+#define	PIIX4_SMBHSTCNT_START	(1<<6)
+#define	PIIX4_SMBHSTCNT_PROT_QUICK	0
+#define	PIIX4_SMBHSTCNT_PROT_BYTE	(1<<2)
+#define	PIIX4_SMBHSTCNT_PROT_BDATA	(2<<2)
+#define	PIIX4_SMBHSTCNT_PROT_WDATA	(3<<2)
+#define	PIIX4_SMBHSTCNT_PROT_BLOCK	(5<<2)
+#define	PIIX4_SMBHSTCNT_KILL	(1<<1)
+#define	PIIX4_SMBHSTCNT_INTREN	(1)
+#define	PIIX4_SMBHSTCMD		0x03
+#define	PIIX4_SMBHSTADD		0x04
+#define	LSB			0x1
+#define	PIIX4_SMBHSTDAT0	0x05
+#define	PIIX4_SMBHSTDAT1	0x06
+#define	PIIX4_SMBBLKDAT		0x07
+#define	PIIX4_SMBSLVCNT		0x08
+#define	PIIX4_SMBSLVCNT_ALTEN	(1<<3)
+#define	PIIX4_SMBSLVCNT_SD2EN	(1<<2)
+#define	PIIX4_SMBSLVCNT_SD1EN	(1<<1)
+#define	PIIX4_SMBSLVCNT_SLVEN	(1)
+#define	PIIX4_SMBSLVCMD		0x09
+#define	PIIX4_SMBSLVEVT		0x0a
+#define	PIIX4_SMBSLVDAT		0x0c
+
+/* SMBus alert response address. */
+#define	SMBALTRESP		0x18
+
+#define	SMBBLOCKTRANS_MAX	32
+
+#endif /* !__INTPMREG_H__ */
Index: if_ste.c
===================================================================
RCS file: /home/cvs/src/sys/pci/if_ste.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -L sys/pci/if_ste.c -L sys/pci/if_ste.c -u -r1.2 -r1.3
--- sys/pci/if_ste.c
+++ sys/pci/if_ste.c
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/if_ste.c,v 1.84.2.6 2005/10/09 04:11:19 delphij Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/if_ste.c,v 1.99 2007/06/15 21:45:41 thompsa Exp $");
 
 #ifdef HAVE_KERNEL_OPTION_HEADERS
 #include "opt_device_polling.h"
@@ -70,7 +70,7 @@
 #include <dev/pci/pcireg.h>
 #include <dev/pci/pcivar.h>
 
-/* "controller miibus0" required.  See GENERIC if you get errors here. */
+/* "device miibus" required.  See GENERIC if you get errors here. */
 #include "miibus_if.h"
 
 #define STE_USEIOSPACE
@@ -85,7 +85,8 @@
  * Various supported device vendors/types and their names.
  */
 static struct ste_type ste_devs[] = {
-	{ ST_VENDORID, ST_DEVICEID_ST201, "Sundance ST201 10/100BaseTX" },
+	{ ST_VENDORID, ST_DEVICEID_ST201_1, "Sundance ST201 10/100BaseTX" },
+	{ ST_VENDORID, ST_DEVICEID_ST201_2, "Sundance ST201 10/100BaseTX" },
 	{ DL_VENDORID, DL_DEVICEID_DL10050, "D-Link DL10050 10/100BaseTX" },
 	{ 0, 0, NULL }
 };
@@ -504,7 +505,7 @@
 	}
 
 	if (i == STE_TIMEOUT)
-		if_printf(sc->ste_ifp, "command never completed!\n");
+		device_printf(sc->ste_dev, "command never completed!\n");
 
 	return;
 }
@@ -529,7 +530,7 @@
 	}
 
 	if (i == 100) {
-		if_printf(sc->ste_ifp, "eeprom failed to come ready\n");
+		device_printf(sc->ste_dev, "eeprom failed to come ready\n");
 		return(1);
 	}
 
@@ -812,7 +813,7 @@
 		 * If not, something truly strange has happened.
 		 */
 		if (!(rxstat & STE_RXSTAT_DMADONE)) {
-			if_printf(ifp,
+			device_printf(sc->ste_dev,
 			    "bad receive status -- packet dropped\n");
 			ifp->if_ierrors++;
 			cur_rx->ste_ptr->ste_status = 0;
@@ -866,7 +867,8 @@
 		    txstat & STE_TXSTATUS_EXCESSCOLLS ||
 		    txstat & STE_TXSTATUS_RECLAIMERR) {
 			ifp->if_oerrors++;
-			if_printf(ifp, "transmission error: %x\n", txstat);
+			device_printf(sc->ste_dev,
+			    "transmission error: %x\n", txstat);
 
 			ste_reset(sc);
 			ste_init_locked(sc);
@@ -874,7 +876,8 @@
 			if (txstat & STE_TXSTATUS_UNDERRUN &&
 			    sc->ste_tx_thresh < STE_PACKET_SIZE) {
 				sc->ste_tx_thresh += STE_MIN_FRAMELEN;
-				if_printf(ifp, "tx underrun, increasing tx"
+				device_printf(sc->ste_dev,
+				    "tx underrun, increasing tx"
 				    " start threshold to %d bytes\n",
 				    sc->ste_tx_thresh);
 			}
@@ -1111,7 +1114,7 @@
 
 	/* Hook interrupt last to avoid having to lock softc */
 	error = bus_setup_intr(dev, sc->ste_irq, INTR_TYPE_NET | INTR_MPSAFE,
-	    ste_intr, sc, &sc->ste_intrhand);
+	    NULL, ste_intr, sc, &sc->ste_intrhand);
 
 	if (error) {
 		device_printf(dev, "couldn't set up irq\n");
@@ -1157,8 +1160,6 @@
 		callout_drain(&sc->ste_stat_callout);
 		ether_ifdetach(ifp);
 	}
-	if (ifp)
-		if_free(ifp);
 	if (sc->ste_miibus)
 		device_delete_child(dev, sc->ste_miibus);
 	bus_generic_detach(dev);
@@ -1170,6 +1171,9 @@
 	if (sc->ste_res)
 		bus_release_resource(dev, STE_RES, STE_RID, sc->ste_res);
 
+	if (ifp)
+		if_free(ifp);
+
 	if (sc->ste_ldata) {
 		contigfree(sc->ste_ldata, sizeof(struct ste_list_data),
 		    M_DEVBUF);
@@ -1302,13 +1306,15 @@
 	ste_stop(sc);
 
 	/* Init our MAC address */
-	for (i = 0; i < ETHER_ADDR_LEN; i++) {
-		CSR_WRITE_1(sc, STE_PAR0 + i, IFP2ENADDR(sc->ste_ifp)[i]);
+	for (i = 0; i < ETHER_ADDR_LEN; i += 2) {
+		CSR_WRITE_2(sc, STE_PAR0 + i,
+		    ((IF_LLADDR(sc->ste_ifp)[i] & 0xff) |
+		     IF_LLADDR(sc->ste_ifp)[i + 1] << 8));
 	}
 
 	/* Init RX list */
 	if (ste_init_rx_list(sc) == ENOBUFS) {
-		if_printf(ifp,
+		device_printf(sc->ste_dev,
 		    "initialization failed: no memory for RX buffers\n");
 		ste_stop(sc);
 		return;
@@ -1468,7 +1474,7 @@
 	}
 
 	if (i == STE_TIMEOUT)
-		if_printf(sc->ste_ifp, "global reset never completed\n");
+		device_printf(sc->ste_dev, "global reset never completed\n");
 
 	return;
 }
Index: agp.c
===================================================================
RCS file: /home/cvs/src/sys/pci/agp.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -L sys/pci/agp.c -L sys/pci/agp.c -u -r1.1.1.2 -r1.2
--- sys/pci/agp.c
+++ sys/pci/agp.c
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/agp.c,v 1.46.2.1 2005/12/28 16:52:45 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/agp.c,v 1.56.2.1 2007/11/08 20:29:53 jhb Exp $");
 
 #include "opt_bus.h"
 
@@ -90,44 +90,17 @@
 #if defined(__i386__) || defined(__amd64__)
 	wbinvd();
 #endif
-#ifdef __alpha__
-	/* FIXME: This is most likely not correct as it doesn't flush CPU 
-	 * write caches, but we don't have a facility to do that and 
-	 * this is all linux does, too */
-	alpha_mb();
-#endif
 }
 
 u_int8_t
 agp_find_caps(device_t dev)
 {
-	u_int32_t status;
-	u_int8_t ptr, next;
-
-	/*
-	 * Check the CAP_LIST bit of the PCI status register first.
-	 */
-	status = pci_read_config(dev, PCIR_STATUS, 2);
-	if (!(status & 0x10))
-		return 0;
-
-	/*
-	 * Traverse the capabilities list.
-	 */
-	for (ptr = pci_read_config(dev, AGP_CAPPTR, 1);
-	     ptr != 0;
-	     ptr = next) {
-		u_int32_t capid = pci_read_config(dev, ptr, 4);
-		next = AGP_CAPID_GET_NEXT_PTR(capid);
+	int capreg;
 
-		/*
-		 * If this capability entry ID is 2, then we are done.
-		 */
-		if (AGP_CAPID_GET_CAP_ID(capid) == 2)
-			return ptr;
-	}
 
-	return 0;
+	if (pci_find_extcap(dev, PCIY_AGP, &capreg) != 0)
+		capreg = 0;
+	return (capreg);
 }
 
 /*
@@ -207,7 +180,7 @@
 	free(gatt, M_AGP);
 }
 
-static int agp_max[][2] = {
+static u_int agp_max[][2] = {
 	{0,	0},
 	{32,	4},
 	{64,	28},
@@ -220,18 +193,36 @@
 };
 #define agp_max_size	(sizeof(agp_max) / sizeof(agp_max[0]))
 
+/**
+ * Sets the PCI resource which represents the AGP aperture.
+ *
+ * If not called, the default AGP aperture resource of AGP_APBASE will
+ * be used.  Must be called before agp_generic_attach().
+ */
+void
+agp_set_aperture_resource(device_t dev, int rid)
+{
+	struct agp_softc *sc = device_get_softc(dev);
+
+	sc->as_aperture_rid = rid;
+}
+
 int
 agp_generic_attach(device_t dev)
 {
 	struct agp_softc *sc = device_get_softc(dev);
-	int rid, memsize, i;
+	int i;
+	u_int memsize;
 
 	/*
-	 * Find and map the aperture.
+	 * Find and map the aperture, RF_SHAREABLE for DRM but not RF_ACTIVE
+	 * because the kernel doesn't need to map it.
 	 */
-	rid = AGP_APBASE;
-	sc->as_aperture = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
-						 RF_ACTIVE);
+	if (sc->as_aperture_rid == 0)
+		sc->as_aperture_rid = AGP_APBASE;
+
+	sc->as_aperture = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+	    &sc->as_aperture_rid, RF_SHAREABLE);
 	if (!sc->as_aperture)
 		return ENOMEM;
 
@@ -270,18 +261,62 @@
 	return 0;
 }
 
-int
-agp_generic_detach(device_t dev)
+void
+agp_free_cdev(device_t dev)
 {
 	struct agp_softc *sc = device_get_softc(dev);
 
 	destroy_dev(sc->as_devnode);
-	bus_release_resource(dev, SYS_RES_MEMORY, AGP_APBASE, sc->as_aperture);
+}
+
+void
+agp_free_res(device_t dev)
+{
+	struct agp_softc *sc = device_get_softc(dev);
+
+	bus_release_resource(dev, SYS_RES_MEMORY, sc->as_aperture_rid,
+	    sc->as_aperture);
 	mtx_destroy(&sc->as_lock);
 	agp_flush_cache();
+}
+
+int
+agp_generic_detach(device_t dev)
+{
+
+	agp_free_cdev(dev);
+	agp_free_res(dev);
 	return 0;
 }
 
+/**
+ * Default AGP aperture size detection which simply returns the size of
+ * the aperture's PCI resource.
+ */
+int
+agp_generic_get_aperture(device_t dev)
+{
+	struct agp_softc *sc = device_get_softc(dev);
+
+	return rman_get_size(sc->as_aperture);
+}
+
+/**
+ * Default AGP aperture size setting function, which simply doesn't allow
+ * changes to resource size.
+ */
+int
+agp_generic_set_aperture(device_t dev, u_int32_t aperture)
+{
+	u_int32_t current_aperture;
+
+	current_aperture = AGP_GET_APERTURE(dev);
+	if (current_aperture != aperture)
+		return EINVAL;
+	else
+		return 0;
+}
+
 /*
  * This does the enable logic for v3, with the same topology
  * restrictions as in place for v2 -- one bus, one device on the bus.
@@ -340,12 +375,14 @@
 	pci_write_config(dev, agp_find_caps(dev) + AGP_COMMAND, 0, 4);
 
 	/* Construct the new mode word and tell the hardware */
+	command = 0;
 	command = AGP_MODE_SET_RQ(0, rq);
 	command = AGP_MODE_SET_ARQSZ(command, arqsz);
 	command = AGP_MODE_SET_CAL(command, cal);
 	command = AGP_MODE_SET_SBA(command, sba);
 	command = AGP_MODE_SET_FW(command, fw);
 	command = AGP_MODE_SET_RATE(command, rate);
+	command = AGP_MODE_SET_MODE_3(command, 1);
 	command = AGP_MODE_SET_AGP(command, 1);
 	pci_write_config(dev, agp_find_caps(dev) + AGP_COMMAND, command, 4);
 	pci_write_config(mdev, agp_find_caps(mdev) + AGP_COMMAND, command, 4);
@@ -394,6 +431,7 @@
 		device_printf(dev, "Setting AGP v2 mode %d\n", rate);
 
 	/* Construct the new mode word and tell the hardware */
+	command = 0;
 	command = AGP_MODE_SET_RQ(0, rq);
 	command = AGP_MODE_SET_SBA(command, sba);
 	command = AGP_MODE_SET_FW(command, fw);
@@ -427,7 +465,9 @@
 	 * but should work fine for a classic single AGP slot system
 	 * with AGP v3.
 	 */
-	if (AGP_MODE_GET_MODE_3(tstatus) && AGP_MODE_GET_MODE_3(mstatus))
+	if (AGP_MODE_GET_MODE_3(mode) &&
+	    AGP_MODE_GET_MODE_3(tstatus) &&
+	    AGP_MODE_GET_MODE_3(mstatus))
 		return (agp_v3_enable(dev, mdev, mode));
 	else
 		return (agp_v2_enable(dev, mdev, mode));	    
@@ -529,10 +569,6 @@
 	/*
 	 * Bind the individual pages and flush the chipset's
 	 * TLB.
-	 *
-	 * XXX Presumably, this needs to be the pci address on alpha
-	 * (i.e. use alpha_XXX_dmamap()). I don't have access to any
-	 * alpha AGP hardware to check.
 	 */
 	VM_OBJECT_LOCK(mem->am_obj);
 	for (i = 0; i < mem->am_size; i += PAGE_SIZE) {
@@ -555,17 +591,13 @@
 				 * Bail out. Reverse all the mappings
 				 * and unwire the pages.
 				 */
-				vm_page_lock_queues();
 				vm_page_wakeup(m);
-				vm_page_unlock_queues();
 				for (k = 0; k < i + j; k += AGP_PAGE_SIZE)
 					AGP_UNBIND_PAGE(dev, offset + k);
 				goto bad;
 			}
 		}
-		vm_page_lock_queues();
 		vm_page_wakeup(m);
-		vm_page_unlock_queues();
 	}
 	VM_OBJECT_UNLOCK(mem->am_obj);
 
@@ -852,9 +884,22 @@
 device_t
 agp_find_device()
 {
+	device_t *children, child;
+	int i, count;
+
 	if (!agp_devclass)
-		return 0;
-	return devclass_get_device(agp_devclass, 0);
+		return NULL;
+	if (devclass_get_devices(agp_devclass, &children, &count) != 0)
+		return NULL;
+	child = NULL;
+	for (i = 0; i < count; i++) {
+		if (device_is_attached(children[i])) {
+			child = children[i];
+			break;
+		}
+	}
+	free(children, M_TEMP);
+	return child;
 }
 
 enum agp_acquire_state
@@ -873,7 +918,6 @@
 		pci_read_config(dev, agp_find_caps(dev) + AGP_STATUS, 4);
 	info->ai_aperture_base = rman_get_start(sc->as_aperture);
 	info->ai_aperture_size = rman_get_size(sc->as_aperture);
-	info->ai_aperture_va = (vm_offset_t) rman_get_virtual(sc->as_aperture);
 	info->ai_memory_allowed = sc->as_maxmem;
 	info->ai_memory_used = sc->as_allocated;
 }
Index: if_rlreg.h
===================================================================
RCS file: /home/cvs/src/sys/pci/if_rlreg.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -L sys/pci/if_rlreg.h -L sys/pci/if_rlreg.h -u -r1.2 -r1.3
--- sys/pci/if_rlreg.h
+++ sys/pci/if_rlreg.h
@@ -29,7 +29,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/pci/if_rlreg.h,v 1.51.2.3 2005/11/06 16:00:54 jhb Exp $
+ * $FreeBSD: src/sys/pci/if_rlreg.h,v 1.67.2.2 2007/12/15 02:57:18 yongari Exp $
  */
 
 /*
@@ -145,10 +145,18 @@
 #define RL_LOOPTEST_ON		0x00020000
 #define RL_LOOPTEST_ON_CPLUS	0x00060000
 
+/* Known revision codes. */
+
 #define RL_HWREV_8169		0x00000000
-#define RL_HWREV_8169S		0x04000000
-#define RL_HWREV_8169SB		0x10000000
 #define RL_HWREV_8110S		0x00800000
+#define RL_HWREV_8169S		0x04000000
+#define RL_HWREV_8169_8110SB	0x10000000
+#define RL_HWREV_8169_8110SC	0x18000000
+#define RL_HWREV_8168_SPIN1	0x30000000
+#define RL_HWREV_8100E		0x30800000
+#define RL_HWREV_8101E		0x34000000
+#define RL_HWREV_8168_SPIN2	0x38000000
+#define RL_HWREV_8168_SPIN3	0x38400000
 #define RL_HWREV_8139		0x60000000
 #define RL_HWREV_8139A		0x70000000
 #define RL_HWREV_8139AG		0x70800000
@@ -206,10 +214,17 @@
 	RL_ISR_RX_OVERRUN|RL_ISR_PKT_UNDERRUN|RL_ISR_FIFO_OFLOW|	\
 	RL_ISR_PCS_TIMEOUT|RL_ISR_SYSTEM_ERR)
 
+#ifdef RE_TX_MODERATION
 #define RL_INTRS_CPLUS	\
 	(RL_ISR_RX_OK|RL_ISR_RX_ERR|RL_ISR_TX_ERR|			\
 	RL_ISR_RX_OVERRUN|RL_ISR_PKT_UNDERRUN|RL_ISR_FIFO_OFLOW|	\
 	RL_ISR_PCS_TIMEOUT|RL_ISR_SYSTEM_ERR|RL_ISR_TIMEOUT_EXPIRED)
+#else
+#define RL_INTRS_CPLUS	\
+	(RL_ISR_RX_OK|RL_ISR_RX_ERR|RL_ISR_TX_ERR|RL_ISR_TX_OK|		\
+	RL_ISR_RX_OVERRUN|RL_ISR_PKT_UNDERRUN|RL_ISR_FIFO_OFLOW|	\
+	RL_ISR_PCS_TIMEOUT|RL_ISR_SYSTEM_ERR|RL_ISR_TIMEOUT_EXPIRED)
+#endif
 
 /*
  * Media status register. (8139 only)
@@ -298,6 +313,17 @@
 #define RL_EEMODE_WRITECFG	(0x80|0x40)
 
 /* 9346 EEPROM commands */
+#define RL_9346_ADDR_LEN	6	/* 93C46 1K: 128x16 */
+#define RL_9356_ADDR_LEN	8	/* 93C56 2K: 256x16 */
+
+#define RL_9346_WRITE          0x5
+#define RL_9346_READ           0x6
+#define RL_9346_ERASE          0x7
+#define RL_9346_EWEN           0x4
+#define RL_9346_EWEN_ADDR      0x30
+#define RL_9456_EWDS           0x4
+#define RL_9346_EWDS_ADDR      0x00
+
 #define RL_EECMD_WRITE		0x140
 #define RL_EECMD_READ_6BIT	0x180
 #define RL_EECMD_READ_8BIT	0x600
@@ -518,6 +544,7 @@
 #define RL_TDESC_CMD_UDPCSUM	0x00020000	/* UDP checksum enable */
 #define RL_TDESC_CMD_IPCSUM	0x00040000	/* IP header checksum enable */
 #define RL_TDESC_CMD_MSSVAL	0x07FF0000	/* Large send MSS value */
+#define RL_TDESC_CMD_MSSVAL_SHIFT	16	/* Large send MSS value shift */
 #define RL_TDESC_CMD_LGSEND	0x08000000	/* TCP large send enb */
 #define RL_TDESC_CMD_EOF	0x10000000	/* end of frame marker */
 #define RL_TDESC_CMD_SOF	0x20000000	/* start of frame marker */
@@ -614,12 +641,14 @@
  * due to the 8139C+.  We need to put the number of descriptors in the ring
  * structure and use that value instead.
  */
-#if !defined(__i386__) && !defined(__amd64__)
+#ifndef	__NO_STRICT_ALIGNMENT
 #define RE_FIXUP_RX	1
 #endif
 
 #define RL_TX_DESC_CNT		64
+#define RL_TX_DESC_THLD		4
 #define RL_RX_DESC_CNT		RL_TX_DESC_CNT
+
 #define RL_RX_LIST_SZ		(RL_RX_DESC_CNT * sizeof(struct rl_desc))
 #define RL_TX_LIST_SZ		(RL_TX_DESC_CNT * sizeof(struct rl_desc))
 #define RL_RING_ALIGN		256
@@ -636,6 +665,8 @@
 #define RE_RX_DESC_BUFLEN	MCLBYTES
 #endif
 
+#define	RL_MSI_MESSAGES	2
+
 #define RL_ADDR_LO(y)		((uint64_t) (y) & 0xFFFFFFFF)
 #define RL_ADDR_HI(y)		((uint64_t) (y) >> 32)
 
@@ -646,7 +677,6 @@
 struct rl_softc;
 
 struct rl_dmaload_arg {
-	struct rl_softc		*sc;
 	int			rl_idx;
 	int			rl_maxsegs;
 	uint32_t		rl_flags;
@@ -655,7 +685,7 @@
 
 struct rl_list_data {
 	struct mbuf		*rl_tx_mbuf[RL_TX_DESC_CNT];
-	struct mbuf		*rl_rx_mbuf[RL_TX_DESC_CNT];
+	struct mbuf		*rl_rx_mbuf[RL_RX_DESC_CNT];
 	int			rl_tx_prodidx;
 	int			rl_rx_prodidx;
 	int			rl_tx_considx;
@@ -683,28 +713,39 @@
 	bus_space_tag_t		rl_btag;	/* bus space tag */
 	device_t		rl_dev;
 	struct resource		*rl_res;
-	struct resource		*rl_irq;
-	void			*rl_intrhand;
+	struct resource		*rl_irq[RL_MSI_MESSAGES];
+	void			*rl_intrhand[RL_MSI_MESSAGES];
 	device_t		rl_miibus;
 	bus_dma_tag_t		rl_parent_tag;
 	bus_dma_tag_t		rl_tag;
 	uint8_t			rl_type;
 	int			rl_eecmd_read;
+	int			rl_eewidth;
 	uint8_t			rl_stats_no_timeout;
 	int			rl_txthresh;
 	struct rl_chain_data	rl_cdata;
 	struct rl_list_data	rl_ldata;
 	struct callout		rl_stat_callout;
+	int			rl_watchdog_timer;
 	struct mtx		rl_mtx;
 	struct mbuf		*rl_head;
 	struct mbuf		*rl_tail;
 	uint32_t		rl_hwrev;
 	uint32_t		rl_rxlenmask;
 	int			rl_testmode;
+	int			rl_if_flags;
 	int			suspended;	/* 0 = normal  1 = suspended */
 #ifdef DEVICE_POLLING
 	int			rxcycles;
 #endif
+
+	struct task		rl_txtask;
+	struct task		rl_inttask;
+
+	struct mtx		rl_intlock;
+	int			rl_txstart;
+	int			rl_link;
+	int			rl_msi;
 };
 
 #define	RL_LOCK(_sc)		mtx_lock(&(_sc)->rl_mtx)
@@ -730,6 +771,24 @@
 #define CSR_READ_1(sc, reg)		\
 	bus_space_read_1(sc->rl_btag, sc->rl_bhandle, reg)
 
+#define CSR_SETBIT_1(sc, offset, val)		\
+	CSR_WRITE_1(sc, offset, CSR_READ_1(sc, offset) | (val))
+
+#define CSR_CLRBIT_1(sc, offset, val)		\
+	CSR_WRITE_1(sc, offset, CSR_READ_1(sc, offset) & ~(val))
+
+#define CSR_SETBIT_2(sc, offset, val)		\
+	CSR_WRITE_2(sc, offset, CSR_READ_2(sc, offset) | (val))
+
+#define CSR_CLRBIT_2(sc, offset, val)		\
+	CSR_WRITE_2(sc, offset, CSR_READ_2(sc, offset) & ~(val))
+
+#define CSR_SETBIT_4(sc, offset, val)		\
+	CSR_WRITE_4(sc, offset, CSR_READ_4(sc, offset) | (val))
+
+#define CSR_CLRBIT_4(sc, offset, val)		\
+	CSR_WRITE_4(sc, offset, CSR_READ_4(sc, offset) & ~(val))
+
 #define RL_TIMEOUT		1000
 
 /*
@@ -743,8 +802,11 @@
  * RealTek chip device IDs.
  */
 #define	RT_DEVICEID_8129			0x8129
+#define RT_DEVICEID_8101E			0x8136
 #define	RT_DEVICEID_8138			0x8138
 #define	RT_DEVICEID_8139			0x8139
+#define RT_DEVICEID_8169SC			0x8167
+#define RT_DEVICEID_8168			0x8168
 #define RT_DEVICEID_8169			0x8169
 #define RT_DEVICEID_8100			0x8100
 
@@ -856,6 +918,11 @@
 #define PLANEX_VENDORID				0x14ea
 
 /*
+ * Planex FNW-3603-TX device ID
+ */
+#define PLANEX_DEVICEID_FNW3603TX		0xab06
+
+/*
  * Planex FNW-3800-TX device ID
  */
 #define PLANEX_DEVICEID_FNW3800TX		0xab07
@@ -885,6 +952,14 @@
  */
 #define EDIMAX_DEVICEID_EP4103DL		0xAB06
 
+/* US Robotics vendor ID */
+
+#define USR_VENDORID		0x16EC
+
+/* US Robotics 997902 device ID */
+
+#define USR_DEVICEID_997902	0x0116
+
 /*
  * PCI low memory base and low I/O base register, and
  * other PCI registers.
Index: if_rl.c
===================================================================
RCS file: /home/cvs/src/sys/pci/if_rl.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -L sys/pci/if_rl.c -L sys/pci/if_rl.c -u -r1.6 -r1.7
--- sys/pci/if_rl.c
+++ sys/pci/if_rl.c
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/if_rl.c,v 1.152.2.4 2005/10/07 14:00:06 glebius Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/if_rl.c,v 1.170.2.1 2007/12/02 08:38:31 remko Exp $");
 
 /*
  * RealTek 8129/8139 PCI NIC driver
@@ -121,7 +121,7 @@
 MODULE_DEPEND(rl, ether, 1, 1, 1);
 MODULE_DEPEND(rl, miibus, 1, 1, 1);
 
-/* "controller miibus0" required.  See GENERIC if you get errors here. */
+/* "device miibus" required.  See GENERIC if you get errors here. */
 #include "miibus_if.h"
 
 /*
@@ -166,6 +166,8 @@
 		"Corega FEtherII CB-TXD" },
 	{ PEPPERCON_VENDORID, PEPPERCON_DEVICEID_ROLF, RL_8139,
 		"Peppercon AG ROL-F" },
+	{ PLANEX_VENDORID, PLANEX_DEVICEID_FNW3603TX, RL_8139,
+		"Planex FNW-3603-TX" },
 	{ PLANEX_VENDORID, PLANEX_DEVICEID_FNW3800TX, RL_8139,
 		"Planex FNW-3800-TX" },
 	{ CP_VENDORID, RT_DEVICEID_8139, RL_8139,
@@ -215,7 +217,7 @@
 static int rl_suspend(device_t);
 static void rl_tick(void *);
 static void rl_txeof(struct rl_softc *);
-static void rl_watchdog(struct ifnet *);
+static void rl_watchdog(struct rl_softc *);
 
 #ifdef RL_USEIOSPACE
 #define RL_RES			SYS_RES_IOPORT
@@ -828,10 +830,10 @@
 
 	/* Allocate interrupt */
 	rid = 0;
-	sc->rl_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
+	sc->rl_irq[0] = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
 	    RF_SHAREABLE | RF_ACTIVE);
 
-	if (sc->rl_irq == NULL) {
+	if (sc->rl_irq[0] == NULL) {
 		device_printf(dev, "couldn't map interrupt\n");
 		error = ENXIO;
 		goto fail;
@@ -885,7 +887,7 @@
 	 * Allocate the parent bus DMA tag appropriate for PCI.
 	 */
 #define RL_NSEG_NEW 32
-	error = bus_dma_tag_create(NULL,	/* parent */
+	error = bus_dma_tag_create(bus_get_dma_tag(dev),	/* parent */
 			1, 0,			/* alignment, boundary */
 			BUS_SPACE_MAXADDR_32BIT,/* lowaddr */
 			BUS_SPACE_MAXADDR,	/* highaddr */
@@ -955,7 +957,6 @@
 	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
 	ifp->if_ioctl = rl_ioctl;
 	ifp->if_start = rl_start;
-	ifp->if_watchdog = rl_watchdog;
 	ifp->if_init = rl_init;
 	ifp->if_capabilities = IFCAP_VLAN_MTU;
 	ifp->if_capenable = ifp->if_capabilities;
@@ -972,8 +973,8 @@
 	ether_ifattach(ifp, eaddr);
 
 	/* Hook interrupt last to avoid having to lock softc */
-	error = bus_setup_intr(dev, sc->rl_irq, INTR_TYPE_NET | INTR_MPSAFE,
-	    rl_intr, sc, &sc->rl_intrhand);
+	error = bus_setup_intr(dev, sc->rl_irq[0], INTR_TYPE_NET | INTR_MPSAFE,
+	    NULL, rl_intr, sc, &sc->rl_intrhand[0]);
 	if (error) {
 		device_printf(sc->rl_dev, "couldn't set up irq\n");
 		ether_ifdetach(ifp);
@@ -1003,6 +1004,7 @@
 	ifp = sc->rl_ifp;
 
 	KASSERT(mtx_initialized(&sc->rl_mtx), ("rl mutex not initialized"));
+
 #ifdef DEVICE_POLLING
 	if (ifp->if_capenable & IFCAP_POLLING)
 		ether_poll_deregister(ifp);
@@ -1018,19 +1020,20 @@
 #if 0
 	sc->suspended = 1;
 #endif
-	if (ifp)
-		if_free(ifp);
 	if (sc->rl_miibus)
 		device_delete_child(dev, sc->rl_miibus);
 	bus_generic_detach(dev);
 
-	if (sc->rl_intrhand)
-		bus_teardown_intr(dev, sc->rl_irq, sc->rl_intrhand);
-	if (sc->rl_irq)
-		bus_release_resource(dev, SYS_RES_IRQ, 0, sc->rl_irq);
+	if (sc->rl_intrhand[0])
+		bus_teardown_intr(dev, sc->rl_irq[0], sc->rl_intrhand[0]);
+	if (sc->rl_irq[0])
+		bus_release_resource(dev, SYS_RES_IRQ, 0, sc->rl_irq[0]);
 	if (sc->rl_res)
 		bus_release_resource(dev, RL_RES, RL_RID, sc->rl_res);
 
+	if (ifp)
+		if_free(ifp);
+
 	if (sc->rl_tag) {
 		bus_dmamap_unload(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap);
 		bus_dmamem_free(sc->rl_tag, sc->rl_cdata.rl_rx_buf,
@@ -1263,9 +1266,9 @@
 	} while (sc->rl_cdata.last_tx != sc->rl_cdata.cur_tx);
 
 	if (RL_LAST_TXMBUF(sc) == NULL)
-		ifp->if_timer = 0;
-	else if (ifp->if_timer == 0)
-		ifp->if_timer = 5;
+		sc->rl_watchdog_timer = 0;
+	else if (sc->rl_watchdog_timer == 0)
+		sc->rl_watchdog_timer = 5;
 }
 
 static void
@@ -1278,6 +1281,8 @@
 	mii = device_get_softc(sc->rl_miibus);
 	mii_tick(mii);
 
+	rl_watchdog(sc);
+
 	callout_reset(&sc->rl_stat_callout, hz, rl_tick, sc);
 }
 
@@ -1464,7 +1469,7 @@
 		RL_INC(sc->rl_cdata.cur_tx);
 
 		/* Set a timeout in case the chip goes out to lunch. */
-		ifp->if_timer = 5;
+		sc->rl_watchdog_timer = 5;
 	}
 
 	/*
@@ -1692,20 +1697,20 @@
 }
 
 static void
-rl_watchdog(struct ifnet *ifp)
+rl_watchdog(struct rl_softc *sc)
 {
-	struct rl_softc		*sc = ifp->if_softc;
 
-	RL_LOCK(sc);
+	RL_LOCK_ASSERT(sc);
 
-	if_printf(ifp, "watchdog timeout\n");
-	ifp->if_oerrors++;
+	if (sc->rl_watchdog_timer == 0 || --sc->rl_watchdog_timer >0)
+		return;
+
+	device_printf(sc->rl_dev, "watchdog timeout\n");
+	sc->rl_ifp->if_oerrors++;
 
 	rl_txeof(sc);
 	rl_rxeof(sc);
 	rl_init_locked(sc);
-
-	RL_UNLOCK(sc);
 }
 
 /*
@@ -1720,7 +1725,7 @@
 
 	RL_LOCK_ASSERT(sc);
 
-	ifp->if_timer = 0;
+	sc->rl_watchdog_timer = 0;
 	callout_stop(&sc->rl_stat_callout);
 	ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
 
Index: agp_sis.c
===================================================================
RCS file: /home/cvs/src/sys/pci/agp_sis.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/agp_sis.c -L sys/pci/agp_sis.c -u -r1.1.1.1 -r1.2
--- sys/pci/agp_sis.c
+++ sys/pci/agp_sis.c
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/agp_sis.c,v 1.18 2005/02/24 21:32:55 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/agp_sis.c,v 1.20.2.1 2007/11/08 20:29:53 jhb Exp $");
 
 #include "opt_bus.h"
 
@@ -103,8 +103,6 @@
 		return ("SiS 745 host to AGP bridge");
 	case 0x07461039:
 		return ("SiS 746 host to AGP bridge");
-	case 0x07601039:
-		return ("SiS 760 host to AGP bridge");
 	};
 
 	return NULL;
@@ -119,7 +117,6 @@
 		return (ENXIO);
 	desc = agp_sis_match(dev);
 	if (desc) {
-		device_verbose(dev);
 		device_set_desc(dev, desc);
 		return BUS_PROBE_DEFAULT;
 	}
@@ -176,11 +173,8 @@
 agp_sis_detach(device_t dev)
 {
 	struct agp_sis_softc *sc = device_get_softc(dev);
-	int error;
 
-	error = agp_generic_detach(dev);
-	if (error)
-		return error;
+	agp_free_cdev(dev);
 
 	/* Disable the aperture.. */
 	pci_write_config(dev, AGP_SIS_WINCTRL,
@@ -193,6 +187,7 @@
 	AGP_SET_APERTURE(dev, sc->initial_aperture);
 
 	agp_free_gatt(sc->gatt);
+	agp_free_res(dev);
 	return 0;
 }
 
@@ -293,6 +288,6 @@
 
 static devclass_t agp_devclass;
 
-DRIVER_MODULE(agp_sis, pci, agp_sis_driver, agp_devclass, 0, 0);
+DRIVER_MODULE(agp_sis, hostb, agp_sis_driver, agp_devclass, 0, 0);
 MODULE_DEPEND(agp_sis, agp, 1, 1, 1);
 MODULE_DEPEND(agp_sis, pci, 1, 1, 1);
Index: viapm.c
===================================================================
RCS file: /home/cvs/src/sys/pci/viapm.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/viapm.c -L sys/pci/viapm.c -u -r1.1.1.1 -r1.2
--- sys/pci/viapm.c
+++ sys/pci/viapm.c
@@ -25,19 +25,19 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/viapm.c,v 1.10.2.2 2005/11/08 15:56:03 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/viapm.c,v 1.18 2007/08/02 04:29:19 kevlo Exp $");
 
 #include "opt_isa.h"
 
 #include <sys/param.h>
+#include <sys/bus.h>
 #include <sys/kernel.h>
-#include <sys/systm.h>
+#include <sys/lock.h>
 #include <sys/module.h>
-#include <sys/bus.h>
-#include <sys/uio.h>
+#include <sys/mutex.h>
+#include <sys/systm.h>
 
 #include <machine/bus.h>
-#include <machine/clock.h>		/* for DELAY */
 #include <machine/resource.h>
 #include <sys/rman.h>
 
@@ -49,10 +49,8 @@
 #include <dev/pci/pcireg.h>
 
 #include <dev/iicbus/iiconf.h>
-#include <dev/iicbus/iicbus.h>
 
 #include <dev/smbus/smbconf.h>
-#include <dev/smbus/smbus.h>
 
 #include "iicbb_if.h"
 #include "smbus_if.h"
@@ -72,6 +70,7 @@
 #define VIA_8233_PMU_ID		0x30741106
 #define	VIA_8233A_PMU_ID	0x31471106
 #define	VIA_8235_PMU_ID		0x31771106
+#define	VIA_CX700_PMU_ID	0x83241106
 
 #define VIAPM_INB(port) \
 	((u_char)bus_space_read_1(viapm->st, viapm->sh, port))
@@ -85,6 +84,10 @@
 #define VIAPM_TYP_686A		4
 #define VIAPM_TYP_8233		5
 
+#define	VIAPM_LOCK(sc)		mtx_lock(&(sc)->lock)
+#define	VIAPM_UNLOCK(sc)	mtx_unlock(&(sc)->lock)
+#define	VIAPM_LOCK_ASSERT(sc)	mtx_assert(&(sc)->lock, MA_OWNED)
+
 struct viapm_softc {
 	int type;
 	u_int32_t base;
@@ -95,9 +98,9 @@
 	struct resource *iores;
 	struct resource *irqres;
 	void *irqih;
-
 	device_t iicbb;
 	device_t smbus;
+	struct mtx lock;
 };
 
 static devclass_t viapm_devclass;
@@ -284,6 +287,12 @@
 		base_cfgreg = VIAPM_8233_BASE;
 		goto viapro;
 
+	case VIA_CX700_PMU_ID:
+		desc = "VIA CX700 Power Management Unit";
+		viapm->type = VIAPM_TYP_UNKNOWN;
+		base_cfgreg = VIAPM_8233_BASE;
+		goto viapro;
+
 	viapro:
 
 #ifdef VIAPM_BASE_ADDR
@@ -312,7 +321,7 @@
 			return ENXIO;
 		}
 
-		if (1 || bootverbose) {
+		if (bootverbose) {
 			device_printf(dev, "SMBus I/O base at 0x%x\n", viapm->base);
 		}
 
@@ -332,6 +341,7 @@
 	struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
 	u_int32_t l;
 
+	mtx_init(&viapm->lock, device_get_nameunit(dev), "viapm", MTX_DEF);
 	if (!(viapm->iores = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
 		&viapm->iorid, RF_ACTIVE))) {
 		device_printf(dev, "could not allocate bus space\n");
@@ -340,7 +350,7 @@
 	viapm->st = rman_get_bustag(viapm->iores);
 	viapm->sh = rman_get_bushandle(viapm->iores);
 
-#if notyet
+#ifdef notyet
 	/* force irq 9 */
 	l = pci_read_config(dev, VIAPM_PRO_SMBCTRL, 1);
 	pci_write_config(dev, VIAPM_PRO_SMBCTRL, l | 0x80, 1);
@@ -360,7 +370,7 @@
 	}
 #endif
 
-	if (1 | bootverbose) {
+	if (bootverbose) {
 		l = pci_read_config(dev, VIAPM_PRO_REVID, 1);
 		device_printf(dev, "SMBus revision code 0x%x\n", l);
 	}
@@ -377,7 +387,7 @@
 	l = pci_read_config(dev, VIAPM_PRO_SMBCTRL, 1);
 	pci_write_config(dev, VIAPM_PRO_SMBCTRL, l | 1, 1);
 
-#if notyet
+#ifdef notyet
 	/* enable interrupts */
 	VIAPM_OUTB(SMBHCTRL, VIAPM_INB(SMBHCTRL) | SMBHCTRL_ENABLE);
 #endif
@@ -393,10 +403,11 @@
 error:
 	if (viapm->iores)
 		bus_release_resource(dev, SYS_RES_IOPORT, viapm->iorid, viapm->iores);
-#if notyet
+#ifdef notyet
 	if (viapm->irqres)
 		bus_release_resource(dev, SYS_RES_IRQ, viapm->irqrid, viapm->irqres);
 #endif
+	mtx_destroy(&viapm->lock);
 
 	return ENXIO;
 }
@@ -405,11 +416,12 @@
 viapm_586b_attach(device_t dev)
 {
 	struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
-	
+
+	mtx_init(&viapm->lock, device_get_nameunit(dev), "viapm", MTX_DEF);
 	if (!(viapm->iores = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
 		&viapm->iorid, RF_ACTIVE | RF_SHAREABLE))) {
 		device_printf(dev, "could not allocate bus resource\n");
-		return ENXIO;
+		goto error;
 	}
 	viapm->st = rman_get_bustag(viapm->iores);
 	viapm->sh = rman_get_bushandle(viapm->iores);
@@ -428,6 +440,7 @@
 	if (viapm->iores)
 		bus_release_resource(dev, SYS_RES_IOPORT,
 					viapm->iorid, viapm->iores);
+	mtx_destroy(&viapm->lock);
 	return ENXIO;
 }
 
@@ -435,16 +448,16 @@
 viapm_586b_detach(device_t dev)
 {
 	struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
-	int error;
 
 	bus_generic_detach(dev);
 	if (viapm->iicbb) {
 		device_delete_child(dev, viapm->iicbb);
 	}
 
-	if (viapm->iores && (error = bus_release_resource(dev, SYS_RES_IOPORT,
-						viapm->iorid, viapm->iores)))
-		return (error);
+	if (viapm->iores)
+		bus_release_resource(dev, SYS_RES_IOPORT, viapm->iorid,
+		    viapm->iores);
+	mtx_destroy(&viapm->lock);
 
 	return 0;
 }
@@ -453,22 +466,18 @@
 viapm_pro_detach(device_t dev)
 {
 	struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
-	int error;
 
 	bus_generic_detach(dev);
 	if (viapm->smbus) {
 		device_delete_child(dev, viapm->smbus);
 	}
 
-	if ((error = bus_release_resource(dev, SYS_RES_IOPORT,
-				viapm->iorid, viapm->iores)))
-		return (error);
-
-#if notyet
-	if ((error = bus_release_resource(dev, SYS_RES_IRQ,
-					viapm->irqrid, viapm->irqres))
-		return (error);
+	bus_release_resource(dev, SYS_RES_IOPORT, viapm->iorid, viapm->iores);
+
+#ifdef notyet
+	bus_release_resource(dev, SYS_RES_IRQ, viapm->irqrid, viapm->irqres);
 #endif
+	mtx_destroy(&viapm->lock);
 
 	return 0;
 }
@@ -485,6 +494,7 @@
 	struct viapm_softc *viapm = device_get_softc(dev);
 	u_char val;
 
+	VIAPM_LOCK(viapm);
 	val = VIAPM_INB(GPIO_VAL);
 
 	if (ctrl)
@@ -493,6 +503,7 @@
 		val &= ~VIAPM_SCL;
 
 	VIAPM_OUTB(GPIO_VAL, val);
+	VIAPM_UNLOCK(viapm);
 
 	return;
 }
@@ -503,6 +514,7 @@
 	struct viapm_softc *viapm = device_get_softc(dev);
 	u_char val;
 
+	VIAPM_LOCK(viapm);
 	val = VIAPM_INB(GPIO_VAL);
 
 	if (data)
@@ -511,6 +523,7 @@
 		val &= ~VIAPM_SDA;
 
 	VIAPM_OUTB(GPIO_VAL, val);
+	VIAPM_UNLOCK(viapm);
 
 	return;
 }
@@ -529,16 +542,24 @@
 viabb_getscl(device_t dev)
 {
 	struct viapm_softc *viapm = device_get_softc(dev);
+	u_char val;
 
-	return ((VIAPM_INB(EXTSMI_VAL) & VIAPM_SCL) != 0);
+	VIAPM_LOCK(viapm);
+	val = VIAPM_INB(EXTSMI_VAL);
+	VIAPM_UNLOCK(viapm);
+	return ((val & VIAPM_SCL) != 0);
 }
 
 static int
 viabb_getsda(device_t dev)
 {
 	struct viapm_softc *viapm = device_get_softc(dev);
+	u_char val;
 
-	return ((VIAPM_INB(EXTSMI_VAL) & VIAPM_SDA) != 0);
+	VIAPM_LOCK(viapm);
+	val = VIAPM_INB(EXTSMI_VAL);
+	VIAPM_UNLOCK(viapm);
+	return ((val & VIAPM_SDA) != 0);
 }
 
 static int
@@ -582,6 +603,8 @@
 	u_char sts = 0;
 	int error;
 
+	VIAPM_LOCK_ASSERT(viapm);
+
 	/* wait for command to complete and SMBus controller is idle */
 	while(count--) {
 		DELAY(10);
@@ -639,9 +662,12 @@
 	struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
 	int error;
 
+	VIAPM_LOCK(viapm);
 	viapm_clear(viapm);
-	if (viapm_busy(viapm))
-		return (EBUSY);
+	if (viapm_busy(viapm)) {
+		VIAPM_UNLOCK(viapm);
+		return (SMB_EBUSY);
+	}
 
 	switch (how) {
 	case SMB_QWRITE:
@@ -659,6 +685,7 @@
 	VIAPM_OUTB(SMBHCTRL, SMBHCTRL_START | SMBHCTRL_QUICK);
 
 	error = viapm_wait(viapm);
+	VIAPM_UNLOCK(viapm);
 
 	return (error);
 }
@@ -669,9 +696,12 @@
 	struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
 	int error;
 
+	VIAPM_LOCK(viapm);
 	viapm_clear(viapm);
-	if (viapm_busy(viapm))
-		return (EBUSY);
+	if (viapm_busy(viapm)) {
+		VIAPM_UNLOCK(viapm);
+		return (SMB_EBUSY);
+	}
 
 	VIAPM_OUTB(SMBHADDR, slave & ~ LSB);
 	VIAPM_OUTB(SMBHCMD, byte);
@@ -681,6 +711,7 @@
 	error = viapm_wait(viapm);
 
 	VIAPM_DEBUG(printf("viapm: SENDB to 0x%x, byte=0x%x, error=0x%x\n", slave, byte, error));
+	VIAPM_UNLOCK(viapm);
 
 	return (error);
 }
@@ -691,9 +722,12 @@
 	struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
 	int error;
 
+	VIAPM_LOCK(viapm);
 	viapm_clear(viapm);
-	if (viapm_busy(viapm))
-		return (EBUSY);
+	if (viapm_busy(viapm)) {
+		VIAPM_UNLOCK(viapm);
+		return (SMB_EBUSY);
+	}
 
 	VIAPM_OUTB(SMBHADDR, slave | LSB);
 
@@ -703,6 +737,7 @@
 		*byte = VIAPM_INB(SMBHDATA0);
 
 	VIAPM_DEBUG(printf("viapm: RECVB from 0x%x, byte=0x%x, error=0x%x\n", slave, *byte, error));
+	VIAPM_UNLOCK(viapm);
 
 	return (error);
 }
@@ -713,9 +748,12 @@
 	struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
 	int error;
 
+	VIAPM_LOCK(viapm);
 	viapm_clear(viapm);
-	if (viapm_busy(viapm))
-		return (EBUSY);
+	if (viapm_busy(viapm)) {
+		VIAPM_UNLOCK(viapm);
+		return (SMB_EBUSY);
+	}
 
 	VIAPM_OUTB(SMBHADDR, slave & ~ LSB);
 	VIAPM_OUTB(SMBHCMD, cmd);
@@ -726,6 +764,7 @@
 	error = viapm_wait(viapm);
 
 	VIAPM_DEBUG(printf("viapm: WRITEB to 0x%x, cmd=0x%x, byte=0x%x, error=0x%x\n", slave, cmd, byte, error));
+	VIAPM_UNLOCK(viapm);
 
 	return (error);
 }
@@ -736,9 +775,12 @@
 	struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
 	int error;
 
+	VIAPM_LOCK(viapm);
 	viapm_clear(viapm);
-	if (viapm_busy(viapm))
-		return (EBUSY);
+	if (viapm_busy(viapm)) {
+		VIAPM_UNLOCK(viapm);
+		return (SMB_EBUSY);
+	}
 
 	VIAPM_OUTB(SMBHADDR, slave | LSB);
 	VIAPM_OUTB(SMBHCMD, cmd);
@@ -749,6 +791,7 @@
 		*byte = VIAPM_INB(SMBHDATA0);
 
 	VIAPM_DEBUG(printf("viapm: READB from 0x%x, cmd=0x%x, byte=0x%x, error=0x%x\n", slave, cmd, *byte, error));
+	VIAPM_UNLOCK(viapm);
 
 	return (error);
 }
@@ -759,9 +802,12 @@
 	struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
 	int error;
 
+	VIAPM_LOCK(viapm);
 	viapm_clear(viapm);
-	if (viapm_busy(viapm))
-		return (EBUSY);
+	if (viapm_busy(viapm)) {
+		VIAPM_UNLOCK(viapm);
+		return (SMB_EBUSY);
+	}
 
 	VIAPM_OUTB(SMBHADDR, slave & ~ LSB);
 	VIAPM_OUTB(SMBHCMD, cmd);
@@ -773,6 +819,7 @@
 	error = viapm_wait(viapm);
 
 	VIAPM_DEBUG(printf("viapm: WRITEW to 0x%x, cmd=0x%x, word=0x%x, error=0x%x\n", slave, cmd, word, error));
+	VIAPM_UNLOCK(viapm);
 
 	return (error);
 }
@@ -784,9 +831,12 @@
 	int error;
 	u_char high, low;
 
+	VIAPM_LOCK(viapm);
 	viapm_clear(viapm);
-	if (viapm_busy(viapm))
-		return (EBUSY);
+	if (viapm_busy(viapm)) {
+		VIAPM_UNLOCK(viapm);
+		return (SMB_EBUSY);
+	}
 
 	VIAPM_OUTB(SMBHADDR, slave | LSB);
 	VIAPM_OUTB(SMBHCMD, cmd);
@@ -801,6 +851,7 @@
 	}
 
 	VIAPM_DEBUG(printf("viapm: READW from 0x%x, cmd=0x%x, word=0x%x, error=0x%x\n", slave, cmd, *word, error));
+	VIAPM_UNLOCK(viapm);
 
 	return (error);
 }
@@ -809,78 +860,80 @@
 viasmb_bwrite(device_t dev, u_char slave, char cmd, u_char count, char *buf)
 {
 	struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
-	u_char remain, len, i;
-	int error = SMB_ENOERR;
-
-	viapm_clear(viapm);
-	if (viapm_busy(viapm))
-		return (EBUSY);
+	u_char i;
+	int error;
 
-	remain = count;
-	while (remain) {
-		len = min(remain, 32);
+	if (count < 1 || count > 32)
+		return (SMB_EINVAL);
 
-		VIAPM_OUTB(SMBHADDR, slave & ~LSB);
-		VIAPM_OUTB(SMBHCMD, cmd);
-		VIAPM_OUTB(SMBHDATA0, len);
-		i = VIAPM_INB(SMBHCTRL);
-
-		/* fill the 32-byte internal buffer */
-		for (i=0; i<len; i++) {
-			VIAPM_OUTB(SMBHBLOCK, buf[count-remain+i]);
-			DELAY(2);
-		}
-		VIAPM_OUTB(SMBHCMD, cmd);
-		VIAPM_OUTB(SMBHCTRL, SMBHCTRL_START | SMBHCTRL_BLOCK);
+	VIAPM_LOCK(viapm);
+	viapm_clear(viapm);
+	if (viapm_busy(viapm)) {
+		VIAPM_UNLOCK(viapm);
+		return (SMB_EBUSY);
+	}
 
-		if ((error = viapm_wait(viapm)) != SMB_ENOERR)
-			goto error;
+	VIAPM_OUTB(SMBHADDR, slave & ~LSB);
+	VIAPM_OUTB(SMBHCMD, cmd);
+	VIAPM_OUTB(SMBHDATA0, count);
+	i = VIAPM_INB(SMBHCTRL);
 
-		remain -= len;
+	/* fill the 32-byte internal buffer */
+	for (i = 0; i < count; i++) {
+		VIAPM_OUTB(SMBHBLOCK, buf[i]);
+		DELAY(2);
 	}
+	VIAPM_OUTB(SMBHCMD, cmd);
+	VIAPM_OUTB(SMBHCTRL, SMBHCTRL_START | SMBHCTRL_BLOCK);
+
+	error = viapm_wait(viapm);
 
-error:
 	VIAPM_DEBUG(printf("viapm: WRITEBLK to 0x%x, count=0x%x, cmd=0x%x, error=0x%x", slave, count, cmd, error));
+	VIAPM_UNLOCK(viapm);
 
 	return (error);
 
 }
 
 static int
-viasmb_bread(device_t dev, u_char slave, char cmd, u_char count, char *buf)
+viasmb_bread(device_t dev, u_char slave, char cmd, u_char *count, char *buf)
 {
 	struct viapm_softc *viapm = (struct viapm_softc *)device_get_softc(dev);
-	u_char remain, len, i;
-	int error = SMB_ENOERR;
-
-	viapm_clear(viapm);
-	if (viapm_busy(viapm))
-		return (EBUSY);
+	u_char data, len, i;
+	int error;
 
-	remain = count;
-	while (remain) {
-		VIAPM_OUTB(SMBHADDR, slave | LSB);
-		VIAPM_OUTB(SMBHCMD, cmd);
-		VIAPM_OUTB(SMBHCTRL, SMBHCTRL_START | SMBHCTRL_BLOCK);
+	if (*count < 1 || *count > 32)
+		return (SMB_EINVAL);
 
-		if ((error = viapm_wait(viapm)) != SMB_ENOERR)
-			goto error;
+	VIAPM_LOCK(viapm);
+	viapm_clear(viapm);
+	if (viapm_busy(viapm)) {
+		VIAPM_UNLOCK(viapm);
+		return (SMB_EBUSY);
+	}
 
-		len = VIAPM_INB(SMBHDATA0);
-		i = VIAPM_INB(SMBHCTRL); 		/* reset counter */
+	VIAPM_OUTB(SMBHADDR, slave | LSB);
+	VIAPM_OUTB(SMBHCMD, cmd);
+	VIAPM_OUTB(SMBHCTRL, SMBHCTRL_START | SMBHCTRL_BLOCK);
 
-		len = min(len, remain);
+	if ((error = viapm_wait(viapm)) != SMB_ENOERR)
+		goto error;
 
-		/* read the 32-byte internal buffer */
-		for (i=0; i<len; i++) {
-			buf[count-remain+i] = VIAPM_INB(SMBHBLOCK);
-			DELAY(2);
-		}
+	len = VIAPM_INB(SMBHDATA0);
+	i = VIAPM_INB(SMBHCTRL); 		/* reset counter */
 
-		remain -= len;
+	/* read the 32-byte internal buffer */
+	for (i = 0; i < len; i++) {
+		data = VIAPM_INB(SMBHBLOCK);
+		if (i < *count)
+			buf[i] = data;
+		DELAY(2);
 	}
+	*count = len;
+
 error:
-	VIAPM_DEBUG(printf("viapm: READBLK to 0x%x, count=0x%x, cmd=0x%x, error=0x%x", slave, count, cmd, error));
+	VIAPM_DEBUG(printf("viapm: READBLK to 0x%x, count=0x%x, cmd=0x%x, error=0x%x", slave, *count, cmd, error));
+	VIAPM_UNLOCK(viapm);
 
 	return (error);
 }
@@ -955,6 +1008,7 @@
 
 DRIVER_MODULE(viapm, pci, viapm_driver, viapm_devclass, 0, 0);
 DRIVER_MODULE(viapropm, pci, viapropm_driver, viapropm_devclass, 0, 0);
+DRIVER_MODULE(smbus, viapropm, smbus_driver, smbus_devclass, 0, 0);
 
 MODULE_DEPEND(viapm, pci, 1, 1, 1);
 MODULE_DEPEND(viapropm, pci, 1, 1, 1);
--- sys/pci/ti_fw2.h
+++ /dev/null
@@ -1,5232 +0,0 @@
-/*
- * Generated by Ken's special genfw.c
- * Built on Wed Aug  2 17:21:09 MDT 2000 by ken at roadwarrior.plutotech.com
- * OS: FreeBSD 5.0-CURRENT
- * $FreeBSD: src/sys/pci/ti_fw2.h,v 1.11 2002/06/26 03:34:52 ken Exp $
- */
-static int tigon2FwReleaseMajor = 0xc;
-static int tigon2FwReleaseMinor = 0x4;
-static int tigon2FwReleaseFix = 0xb;
-static u_int32_t tigon2FwStartAddr = 0x00004000;
-static u_int32_t tigon2FwTextAddr = 0x00004000;
-int tigon2FwTextLen = 0x132f8;
-static u_int32_t tigon2FwRodataAddr = 0x000172f8;
-int tigon2FwRodataLen = 0x10da;
-static u_int32_t tigon2FwDataAddr = 0x000185c0;
-int tigon2FwDataLen = 0x17c;
-static u_int32_t tigon2FwSbssAddr = 0x0001873c;
-int tigon2FwSbssLen = 0xcc;
-static u_int32_t tigon2FwBssAddr = 0x00018810;
-int tigon2FwBssLen = 0x20c0;
-static u_int32_t tigon2FwText[] = {
-0x0, 
-0x10000003, 0x0, 0xd, 0xd, 
-0x3c1d0002, 0x8fbd8600, 0x3a0f021, 0x3c100000, 
-0x26104000, 0xc001082, 0x0, 0xd, 
-0x3c1d0002, 0x8fbd8604, 0x3a0f021, 0x3c100000, 
-0x26104000, 0xc0018cc, 0x0, 0xd, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x2000008, 
-0x0, 0x80017d9, 0x3c0a0001, 0x80017d9, 
-0x3c0a0002, 0x80017d9, 0x0, 0x8002ec4, 
-0x0, 0x8002e4e, 0x0, 0x80017d9, 
-0x3c0a0004, 0x80035a3, 0x0, 0x8001b5a, 
-0x0, 0x8003df3, 0x0, 0x8003d81, 
-0x0, 0x80017d9, 0x3c0a0006, 0x8003e7a, 
-0x3c0a0007, 0x80017d9, 0x3c0a0008, 0x80017d9, 
-0x3c0a0009, 0x8003eeb, 0x0, 0x80030d9, 
-0x0, 0x80017d9, 0x3c0a000b, 0x80017d9, 
-0x3c0a000c, 0x80017d9, 0x3c0a000d, 0x8002af6, 
-0x0, 0x8002a8a, 0x0, 0x80017d9, 
-0x3c0a000e, 0x800219b, 0x0, 0x8001a69, 
-0x0, 0x8001b0b, 0x0, 0x80041cb, 
-0x0, 0x80041b9, 0x0, 0x80017d9, 
-0x0, 0x8001a1f, 0x0, 0x80017d9, 
-0x0, 0x80017d9, 0x3c0a0013, 0x80017d9, 
-0x3c0a0014, 0x27bdffe0, 0x3c1cc000, 0xafbf001c, 
-0xafb00018, 0x8f820140, 0x24030003, 0xaf8300ec, 
-0x34420004, 0xaf820140, 0xc002d20, 0x0, 
-0x3c0100c0, 0xac203ffc, 0xc00184f, 0x0, 
-0x401821, 0x3c020010, 0x3c010002, 0xac238758, 
-0x10620025, 0x43102b, 0x14400002, 0x3c020020, 
-0x3c020008, 0x10620020, 0x24050100, 0x3c040001, 
-0x248473ac, 0x3c060002, 0x8cc68758, 0x3821, 
-0xafa00010, 0xc002d3b, 0xafa00014, 0x3c040001, 
-0x248473b8, 0x24020256, 0xafa20010, 0xafa00014, 
-0x8f860144, 0x3c070001, 0x24e773c0, 0xc002d3b, 
-0x3405dead, 0x8f82011c, 0x34420002, 0xaf82011c, 
-0x8f820220, 0x34420004, 0xaf820220, 0x8f830140, 
-0x3c020020, 0x3c010002, 0xac228758, 0x3c020001, 
-0x621825, 0xaf830140, 0x24020008, 0x3c010002, 
-0xac228770, 0x2402001f, 0x3c010002, 0xac228780, 
-0x24020016, 0x3c010002, 0xac228754, 0x3c05fffe, 
-0x34a56f08, 0x3c020002, 0x8c428758, 0x3c030002, 
-0x2463a8d0, 0x3c040002, 0x8c8485c4, 0x431023, 
-0x14800002, 0x458021, 0x2610fa38, 0x2402f000, 
-0x2028024, 0xc001871, 0x2002021, 0x2022823, 
-0x3c040020, 0x821823, 0x651823, 0x247bb000, 
-0x3c03fffe, 0x3463bf08, 0x363b821, 0x3c0600bf, 
-0x34c6f000, 0x3c070002, 0x8ce785c0, 0x3c0300bf, 
-0x3463e000, 0x852023, 0x3c010002, 0xac248764, 
-0x822023, 0x3c010002, 0xac25874c, 0x52842, 
-0x3c010002, 0xac228740, 0x27620ffc, 0x3c010002, 
-0xac228600, 0x27621ffc, 0xdb3023, 0x7b1823, 
-0x3c010002, 0xac248744, 0x3c010002, 0xac258768, 
-0x3c010002, 0xac228604, 0xaf860150, 0xaf830250, 
-0x10e00027, 0x33620fff, 0x10400014, 0x2402028b, 
-0x3c040001, 0x248473b8, 0xafa20010, 0xafa00014, 
-0x8f860144, 0x3c070001, 0x24e773c0, 0xc002d3b, 
-0x3405dead, 0x8f82011c, 0x34420002, 0xaf82011c, 
-0x8f820220, 0x34420004, 0xaf820220, 0x8f820140, 
-0x3c030001, 0x431025, 0xaf820140, 0x3c1d0002, 
-0x8fbd85cc, 0x3a0f021, 0xc001807, 0x0, 
-0x3c020002, 0x8c4285d0, 0x3c030002, 0x8c6385d4, 
-0x2442fe00, 0x24630200, 0x3c010002, 0xac2285d0, 
-0x3c010002, 0xac2385d4, 0x10000004, 0x0, 
-0x3c1d0002, 0x8fbd8600, 0x3a0f021, 0x3c020002, 
-0x8c4285c4, 0x1040000d, 0x26fafa38, 0x3c020002, 
-0x8c4285d0, 0x3c030002, 0x8c6385d4, 0x3c1a0002, 
-0x8f5a85d4, 0x2442fa38, 0x246305c8, 0x3c010002, 
-0xac2285d0, 0x3c010002, 0xac2385d4, 0x3c020002, 
-0x8c4285c8, 0x14400003, 0x0, 0x3c010002, 
-0xac2085d0, 0xc001140, 0x0, 0x8fbf001c, 
-0x8fb00018, 0x3e00008, 0x27bd0020, 0x3c020002, 
-0x8c4285d0, 0x3c030002, 0x8c6385d4, 0x27bdff98, 
-0xafb00048, 0x3c100001, 0x8e107d5c, 0xafb20050, 
-0x3c120000, 0x26524100, 0xafbf0060, 0xafbe005c, 
-0xafb50058, 0xafb30054, 0xafb1004c, 0xafa20034, 
-0xafa30030, 0xafa00010, 0xafa00014, 0x8f860040, 
-0x3c040001, 0x248473cc, 0x24050200, 0x3c010002, 
-0xac32873c, 0xc002d3b, 0x2003821, 0x8f830040, 
-0x3c02f000, 0x621824, 0x3c026000, 0x1062001f, 
-0xa3a0003f, 0x3c040001, 0x248473d4, 0xafa00010, 
-0xafa00014, 0x8f860040, 0x24050300, 0xc002d3b, 
-0x2003821, 0x3c040001, 0x248473b8, 0x240202e1, 
-0xafa20010, 0xafa00014, 0x8f860144, 0x3c070001, 
-0x24e773c0, 0xc002d3b, 0x3405dead, 0x8f82011c, 
-0x34420002, 0xaf82011c, 0x8f820220, 0x34420004, 
-0xaf820220, 0x8f820140, 0x240e0001, 0x3c030001, 
-0xa3ae003f, 0x431025, 0xaf820140, 0x8f820240, 
-0x3c030001, 0x431025, 0xaf820240, 0xaf800048, 
-0x8f820048, 0x14400005, 0x0, 0xaf800048, 
-0x8f820048, 0x10400004, 0x0, 0xaf800048, 
-0x10000003, 0x2e02021, 0xaf80004c, 0x2e02021, 
-0x3c050001, 0xc002da8, 0x34a540f8, 0x3402021, 
-0xc002da8, 0x240505c8, 0x3c020002, 0x8c428764, 
-0x3c0d0002, 0x8dad8744, 0x3c030002, 0x8c638740, 
-0x3c080002, 0x8d08874c, 0x3c090002, 0x8d298768, 
-0x3c0a0002, 0x8d4a8770, 0x3c0b0002, 0x8d6b8780, 
-0x3c0c0002, 0x8d8c8754, 0x3c040001, 0x248473e0, 
-0x24050400, 0xaf42013c, 0x8f42013c, 0x24060001, 
-0x24070001, 0xaf400000, 0xaf4d0138, 0xaf430144, 
-0xaf480148, 0xaf49014c, 0xaf4a0150, 0xaf4b0154, 
-0xaf4c0158, 0x2442ff80, 0xaf420140, 0x24020001, 
-0xafa20010, 0xc002d3b, 0xafa00014, 0x8f420138, 
-0xafa20010, 0x8f42013c, 0xafa20014, 0x8f460144, 
-0x8f470148, 0x3c040001, 0x248473ec, 0xc002d3b, 
-0x24050500, 0xafb70010, 0xafba0014, 0x8f46014c, 
-0x8f470150, 0x3c040001, 0x248473f8, 0xc002d3b, 
-0x24050600, 0x3c020002, 0x8c428758, 0x3603821, 
-0x3c060002, 0x24c6a8d0, 0x2448ffff, 0x1061824, 
-0xe81024, 0x43102b, 0x1040001a, 0x24050900, 
-0x3c040001, 0x24847404, 0xafa80010, 0xc002d3b, 
-0xafa00014, 0x3c040001, 0x248473b8, 0x2402033a, 
-0xafa20010, 0xafa00014, 0x8f860144, 0x3c070001, 
-0x24e773c0, 0xc002d3b, 0x3405dead, 0x8f82011c, 
-0x34420002, 0xaf82011c, 0x8f820220, 0x34420004, 
-0xaf820220, 0x8f820140, 0x3c030001, 0x431025, 
-0xaf820140, 0x8f82000c, 0xafa20010, 0x8f82003c, 
-0xafa20014, 0x8f860000, 0x8f870004, 0x3c040001, 
-0x24847410, 0xc002d3b, 0x24051000, 0x8c020220, 
-0x8c030224, 0x8c060218, 0x8c07021c, 0x3c040001, 
-0x24847418, 0x24051100, 0xafa20010, 0xc002d3b, 
-0xafa30014, 0xaf800054, 0xaf80011c, 0x8c020218, 
-0x30420002, 0x10400009, 0x0, 0x8c020220, 
-0x3c030002, 0x34630004, 0x431025, 0xaf42000c, 
-0x8c02021c, 0x10000008, 0x34420004, 0x8c020220, 
-0x3c030002, 0x34630006, 0x431025, 0xaf42000c, 
-0x8c02021c, 0x34420006, 0xaf420014, 0x8c020218, 
-0x30420010, 0x1040000a, 0x0, 0x8c02021c, 
-0x34420004, 0xaf420010, 0x8c020220, 0x3c03000a, 
-0x34630004, 0x431025, 0x10000009, 0xaf420008, 
-0x8c020220, 0x3c03000a, 0x34630006, 0x431025, 
-0xaf420008, 0x8c02021c, 0x34420006, 0xaf420010, 
-0x24020001, 0xaf8200a0, 0xaf8200b0, 0x8f830054, 
-0x8f820054, 0xaf8000d0, 0xaf8000c0, 0x10000002, 
-0x24630064, 0x8f820054, 0x621023, 0x2c420065, 
-0x1440fffc, 0x0, 0x8c040208, 0x8c05020c, 
-0x26e20028, 0xaee20020, 0x24020490, 0xaee20010, 
-0xaee40008, 0xaee5000c, 0x26e40008, 0x8c820000, 
-0x8c830004, 0xaf820090, 0xaf830094, 0x8c820018, 
-0xaf8200b4, 0x9482000a, 0xaf82009c, 0x8f420014, 
-0xaf8200b0, 0x8f8200b0, 0x30420004, 0x1440fffd, 
-0x0, 0x8f8200b0, 0x3c03ef00, 0x431024, 
-0x10400021, 0x0, 0x8f8200b4, 0xafa20010, 
-0x8f820090, 0x8f830094, 0x3c040001, 0x24847420, 
-0xafa30014, 0x8f8600b0, 0x8f87009c, 0x3c050001, 
-0xc002d3b, 0x34a5200d, 0x3c040001, 0x248473b8, 
-0x240203c4, 0xafa20010, 0xafa00014, 0x8f860144, 
-0x3c070001, 0x24e773c0, 0xc002d3b, 0x3405dead, 
-0x8f82011c, 0x34420002, 0xaf82011c, 0x8f820220, 
-0x34420004, 0xaf820220, 0x8f820140, 0x3c030001, 
-0x431025, 0xaf820140, 0x96e20472, 0x96e60452, 
-0x96e70462, 0xafa20010, 0x96e20482, 0x3c040001, 
-0x2484742c, 0x24051200, 0xc002d3b, 0xafa20014, 
-0x96f00452, 0x32020001, 0x10400002, 0xb021, 
-0x24160001, 0x32020002, 0x54400001, 0x36d60002, 
-0x32020008, 0x54400001, 0x36d60004, 0x32020010, 
-0x54400001, 0x36d60008, 0x32020020, 0x54400001, 
-0x36d60010, 0x32020040, 0x54400001, 0x36d60020, 
-0x32020080, 0x54400001, 0x36d60040, 0x96e60482, 
-0x30c20200, 0x54400001, 0x36d64000, 0x96e30472, 
-0x30620200, 0x10400003, 0x30620100, 0x10000003, 
-0x36d62000, 0x54400001, 0x36d61000, 0x96f00462, 
-0x32c24000, 0x14400004, 0x3207009b, 0x30c2009b, 
-0x14e20007, 0x0, 0x32c22000, 0x14400022, 
-0x32020001, 0x3062009b, 0x10e2001f, 0x32020001, 
-0x3c040001, 0x24847438, 0x24051300, 0x2003821, 
-0xafa30010, 0xc002d3b, 0xafa00014, 0x3c040001, 
-0x248473b8, 0x24020400, 0xafa20010, 0xafa00014, 
-0x8f860144, 0x3c070001, 0x24e773c0, 0xc002d3b, 
-0x3405dead, 0x8f82011c, 0x34420002, 0xaf82011c, 
-0x8f820220, 0x34420004, 0xaf820220, 0x8f820140, 
-0x240e0001, 0x3c030001, 0xa3ae003f, 0x431025, 
-0xaf820140, 0x32020001, 0x54400001, 0x36d60080, 
-0x32020002, 0x54400001, 0x36d60100, 0x32020008, 
-0x54400001, 0x36d60200, 0x32020010, 0x54400001, 
-0x36d60400, 0x32020080, 0x54400001, 0x36d60800, 
-0x8c020218, 0x30420200, 0x10400002, 0x3c020008, 
-0x2c2b025, 0x8c020218, 0x30428000, 0x10400002, 
-0x3c021000, 0x2c2b025, 0x8c020218, 0x30420800, 
-0x10400002, 0x3c020080, 0x2c2b025, 0x8c020218, 
-0x30420400, 0x10400002, 0x3c020100, 0x2c2b025, 
-0x8c020218, 0x30420100, 0x10400002, 0x3c020200, 
-0x2c2b025, 0x8c020218, 0x30420080, 0x10400002, 
-0x3c020400, 0x2c2b025, 0x8c020218, 0x30422000, 
-0x10400002, 0x3c020010, 0x2c2b025, 0x8c020218, 
-0x30424000, 0x10400002, 0x3c020020, 0x2c2b025, 
-0x8c020218, 0x30421000, 0x10400002, 0x3c020040, 
-0x2c2b025, 0x8ee20498, 0x8ee3049c, 0xaf420160, 
-0xaf430164, 0x8ee204a0, 0x8ee304a4, 0xaf420168, 
-0xaf43016c, 0x8ee204a8, 0x8ee304ac, 0xaf420170, 
-0xaf430174, 0x8ee20428, 0x8ee3042c, 0xaf420178, 
-0xaf43017c, 0x8ee20448, 0x8ee3044c, 0xaf420180, 
-0xaf430184, 0x8ee20458, 0x8ee3045c, 0xaf420188, 
-0xaf43018c, 0x8ee20468, 0x8ee3046c, 0xaf420190, 
-0xaf430194, 0x8ee20478, 0x8ee3047c, 0xaf420198, 
-0xaf43019c, 0x8ee20488, 0x8ee3048c, 0xaf4201a0, 
-0xaf4301a4, 0x8ee204b0, 0x8ee304b4, 0x24040080, 
-0xaf4201a8, 0xaf4301ac, 0xc002da8, 0x24050080, 
-0x8c02025c, 0x27440224, 0xaf4201f0, 0x8c020260, 
-0x24050200, 0x24060008, 0xaf4201f8, 0xc002dbf, 
-0x0, 0x3c043b9a, 0x3484ca00, 0x3821, 
-0x24020006, 0x24030002, 0xaf4201f4, 0x240203e8, 
-0xaf430204, 0xaf430200, 0xaf4401fc, 0xaf420294, 
-0x24020001, 0xaf430290, 0xaf42029c, 0x3c030002, 
-0x671821, 0x906385d8, 0x3471021, 0x24e70001, 
-0xa043022c, 0x2ce2000f, 0x1440fff8, 0x3471821, 
-0x24e70001, 0x3c080001, 0x350840f8, 0x8f820040, 
-0x3c040001, 0x24847444, 0x24051400, 0x21702, 
-0x24420030, 0xa062022c, 0x3471021, 0xa040022c, 
-0x8c070218, 0x2c03021, 0x240205c8, 0xafa20010, 
-0xc002d3b, 0xafa80014, 0x3c040001, 0x24847450, 
-0x3c050000, 0x24a55f28, 0x24060010, 0x27b10030, 
-0x2203821, 0x27b30034, 0xc00188f, 0xafb30010, 
-0x3c030002, 0x8c6385c8, 0x1060000a, 0x408021, 
-0x8fa30030, 0x2405ff00, 0x8fa20034, 0x246400ff, 
-0x852024, 0x831823, 0x431023, 0xafa20034, 
-0xafa40030, 0x3c040001, 0x2484745c, 0x3c050000, 
-0x24a54100, 0x24060108, 0x2203821, 0xc00188f, 
-0xafb30010, 0x409021, 0x32c20003, 0x3c010002, 
-0xac32873c, 0x10400059, 0x2203821, 0x8f820050, 
-0x3c030010, 0x431024, 0x1040002a, 0x0, 
-0x8c020218, 0x30420040, 0x10400023, 0x24020001, 
-0x8f820050, 0x8c030218, 0x3c040001, 0x24847468, 
-0xafa20010, 0xafa30014, 0x8f870040, 0x24051500, 
-0xc002d3b, 0x2c03021, 0x3c040001, 0x248473b8, 
-0x24020474, 0xafa20010, 0xafa00014, 0x8f860144, 
-0x3c070001, 0x24e773c0, 0xc002d3b, 0x3405dead, 
-0x8f82011c, 0x34420002, 0xaf82011c, 0x8f820220, 
-0x34420004, 0xaf820220, 0x8f820140, 0x240e0001, 
-0x3c030001, 0xa3ae003f, 0x431025, 0xaf820140, 
-0x10000004, 0x0, 0x3c010001, 0x370821, 
-0xa02240f4, 0x3c040001, 0x24847474, 0x3c050001, 
-0x24a5a8fc, 0x3c060001, 0x24c6aa20, 0xc53023, 
-0x8f420010, 0x27b30030, 0x2603821, 0x27b10034, 
-0x34420a00, 0xaf420010, 0xc00188f, 0xafb10010, 
-0x3c040001, 0x24847488, 0x3c050001, 0x24a5bfd4, 
-0x3c060001, 0x24c6c35c, 0xc53023, 0x2603821, 
-0xaf420108, 0xc00188f, 0xafb10010, 0x3c040001, 
-0x248474a4, 0x3c050001, 0x24a5c7fc, 0x3c060001, 
-0x24c6d53c, 0xc53023, 0x2603821, 0x3c010002, 
-0xac2287b0, 0xc00188f, 0xafb10010, 0x3c040001, 
-0x248474bc, 0x10000024, 0x24051600, 0x3c040001, 
-0x248474c4, 0x3c050001, 0x24a5a744, 0x3c060001, 
-0x24c6a8f4, 0xc53023, 0xc00188f, 0xafb30010, 
-0x3c040001, 0x248474d4, 0x3c050001, 0x24a5bb10, 
-0x3c060001, 0x24c6bfcc, 0xc53023, 0x2203821, 
-0xaf420108, 0xc00188f, 0xafb30010, 0x3c040001, 
-0x248474e8, 0x3c050001, 0x24a5c364, 0x3c060001, 
-0x24c6c7f4, 0xc53023, 0x2203821, 0x3c010002, 
-0xac2287b0, 0xc00188f, 0xafb30010, 0x3c040001, 
-0x248474fc, 0x24051650, 0x2c03021, 0x3821, 
-0x3c010002, 0xac2287b4, 0xafa00010, 0xc002d3b, 
-0xafa00014, 0x32c20020, 0x10400021, 0x27a70030, 
-0x3c040001, 0x24847508, 0x3c050001, 0x24a5b938, 
-0x3c060001, 0x24c6bb08, 0xc53023, 0x24022000, 
-0xaf42001c, 0x27a20034, 0xc00188f, 0xafa20010, 
-0x21900, 0x31982, 0x3c040800, 0x641825, 
-0xae430028, 0x24030010, 0xaf43003c, 0x96e30450, 
-0xaf430040, 0x8f430040, 0x3c040001, 0x2484751c, 
-0xafa00014, 0xafa30010, 0x8f47001c, 0x24051660, 
-0x3c010002, 0xac2287ac, 0x10000039, 0x32c60020, 
-0x8ee20448, 0x8ee3044c, 0xaf43001c, 0x8f42001c, 
-0x2442e000, 0x2c422001, 0x1440001e, 0x24051700, 
-0x3c040001, 0x24847528, 0xafa00010, 0xafa00014, 
-0x8f46001c, 0xc002d3b, 0x3821, 0x3c040001, 
-0x248473b8, 0x240204dd, 0xafa20010, 0xafa00014, 
-0x8f860144, 0x3c070001, 0x24e773c0, 0xc002d3b, 
-0x3405dead, 0x8f82011c, 0x34420002, 0xaf82011c, 
-0x8f820220, 0x34420004, 0xaf820220, 0x8f820140, 
-0x240e0001, 0x3c030001, 0xa3ae003f, 0x431025, 
-0xaf820140, 0x3c020000, 0x24425f64, 0x21100, 
-0x21182, 0x3c030800, 0x431025, 0xae420028, 
-0x24020008, 0xaf42003c, 0x96e20450, 0xaf420040, 
-0x8f420040, 0x3c040001, 0x24847534, 0xafa00014, 
-0xafa20010, 0x8f47001c, 0x24051800, 0x32c60020, 
-0xc002d3b, 0x0, 0x3c050fff, 0x3c030002, 
-0x8c6387b0, 0x34a5ffff, 0x2403021, 0x3c020002, 
-0x8c4287b4, 0x3c040800, 0x651824, 0x31882, 
-0x641825, 0x451024, 0x21082, 0x441025, 
-0xacc20080, 0x32c20180, 0x1040007e, 0xacc30020, 
-0x8f82005c, 0x3c030080, 0x431024, 0x10400021, 
-0x0, 0x8f820050, 0xafa20010, 0x8f82005c, 
-0x3c040001, 0x24847540, 0xafa20014, 0x8f870040, 
-0x24051900, 0xc002d3b, 0x2c03021, 0x3c040001, 
-0x248473b8, 0x240204fe, 0xafa20010, 0xafa00014, 
-0x8f860144, 0x3c070001, 0x24e773c0, 0xc002d3b, 
-0x3405dead, 0x8f82011c, 0x34420002, 0xaf82011c, 
-0x8f820220, 0x34420004, 0xaf820220, 0x8f820140, 
-0x240e0001, 0x3c030001, 0xa3ae003f, 0x431025, 
-0xaf820140, 0x8f820050, 0x3c030010, 0x431024, 
-0x1040002a, 0x0, 0x8c020218, 0x30420040, 
-0x10400023, 0x24020001, 0x8f820050, 0x8c030218, 
-0x3c040001, 0x24847468, 0xafa20010, 0xafa30014, 
-0x8f870040, 0x24052000, 0xc002d3b, 0x2c03021, 
-0x3c040001, 0x248473b8, 0x2402050c, 0xafa20010, 
-0xafa00014, 0x8f860144, 0x3c070001, 0x24e773c0, 
-0xc002d3b, 0x3405dead, 0x8f82011c, 0x34420002, 
-0xaf82011c, 0x8f820220, 0x34420004, 0xaf820220, 
-0x8f820140, 0x240e0001, 0x3c030001, 0xa3ae003f, 
-0x431025, 0xaf820140, 0x10000004, 0x0, 
-0x3c010001, 0x370821, 0xa02240f4, 0x3c040001, 
-0x2484754c, 0x3c050001, 0x24a5a60c, 0x3c060001, 
-0x24c6a73c, 0xc53023, 0x8f420008, 0x27b30030, 
-0x2603821, 0x27b10034, 0x34420e00, 0xaf420008, 
-0xc00188f, 0xafb10010, 0x3c040001, 0x24847564, 
-0x3c050001, 0x24a5e844, 0x3c060001, 0x24c6f5fc, 
-0xc53023, 0x2603821, 0xaf42010c, 0xc00188f, 
-0xafb10010, 0x3c040001, 0x2484757c, 0x3c050001, 
-0x24a5fde8, 0x3c060001, 0x24c60588, 0xc53023, 
-0x2603821, 0x3c010002, 0xac2287c0, 0xc00188f, 
-0xafb10010, 0x3c040001, 0x24847594, 0x10000027, 
-0x24052100, 0x3c040001, 0x2484759c, 0x3c050001, 
-0x24a5a444, 0x3c060001, 0x24c6a604, 0xc53023, 
-0x27b10030, 0x2203821, 0x27b30034, 0xc00188f, 
-0xafb30010, 0x3c040001, 0x248475ac, 0x3c050001, 
-0x24a5d738, 0x3c060001, 0x24c6e83c, 0xc53023, 
-0x2203821, 0xaf42010c, 0xc00188f, 0xafb30010, 
-0x3c040001, 0x248475bc, 0x3c050001, 0x24a5fbac, 
-0x3c060001, 0x24c6fde0, 0xc53023, 0x2203821, 
-0x3c010002, 0xac2287c0, 0xc00188f, 0xafb30010, 
-0x3c040001, 0x248475d0, 0x24052150, 0x2c03021, 
-0x3821, 0x3c010002, 0xac2287cc, 0xafa00010, 
-0xc002d3b, 0xafa00014, 0x3c110fff, 0x3c030002, 
-0x8c6387c0, 0x3631ffff, 0x2409821, 0x3c020002, 
-0x8c4287cc, 0x3c0e0800, 0x711824, 0x31882, 
-0x6e1825, 0x511024, 0x21082, 0x4e1025, 
-0xae630038, 0xae620078, 0x8c020218, 0x30420040, 
-0x14400004, 0x24020001, 0x3c010001, 0x370821, 
-0xa02240f4, 0x3c040001, 0x248475dc, 0x3c050001, 
-0x24a5f604, 0x3c060001, 0x24c6f7c4, 0xc53023, 
-0x27be0030, 0x3c03821, 0x27b50034, 0xc00188f, 
-0xafb50010, 0x3c010002, 0xac2287b8, 0x511024, 
-0x21082, 0x3c0e0800, 0x4e1025, 0xae620050, 
-0x32c22000, 0x10400006, 0x3c03821, 0x3c020000, 
-0x24425f64, 0x2221024, 0x1000000f, 0x21082, 
-0x3c040001, 0x248475f0, 0x3c050001, 0x24a5f7cc, 
-0x3c060001, 0x24c6f9e0, 0xc53023, 0xc00188f, 
-0xafb50010, 0x3c010002, 0xac2287d0, 0x511024, 
-0x21082, 0x3c0e0800, 0x4e1025, 0xae620048, 
-0x32c24000, 0x10400005, 0x27a70030, 0x3c020000, 
-0x24425f64, 0x1000000e, 0x21100, 0x3c040001, 
-0x24847608, 0x3c050001, 0x24a5f9e8, 0x3c060001, 
-0x24c6fba4, 0xc53023, 0x27a20034, 0xc00188f, 
-0xafa20010, 0x3c010002, 0xac2287c4, 0x21100, 
-0x21182, 0x3c030800, 0x431025, 0xae420060, 
-0x3c040001, 0x24847620, 0x3c050001, 0x24a5866c, 
-0x3c060001, 0x24c68aac, 0xc53023, 0x27b10030, 
-0x2203821, 0x27b30034, 0xc00188f, 0xafb30010, 
-0x3c0e0fff, 0x35ceffff, 0x3c040001, 0x2484762c, 
-0x3c050000, 0x24a5687c, 0x3c060000, 0x24c6699c, 
-0xc53023, 0x2203821, 0x240f021, 0x3c010002, 
-0xac228798, 0x4e1024, 0x21082, 0x3c150800, 
-0x551025, 0xafae0044, 0xafc200b8, 0xc00188f, 
-0xafb30010, 0x3c040001, 0x24847638, 0x3c050000, 
-0x24a569a4, 0x3c060000, 0x24c66c24, 0x8fae0044, 
-0xc53023, 0x2203821, 0x3c010002, 0xac22878c, 
-0x4e1024, 0x21082, 0x551025, 0xafc200e8, 
-0xc00188f, 0xafb30010, 0x3c040001, 0x24847650, 
-0x3c050000, 0x24a56c2c, 0x3c060000, 0x24c66d60, 
-0x8fae0044, 0xc53023, 0x2203821, 0x3c010002, 
-0xac228784, 0x4e1024, 0x21082, 0x551025, 
-0xafc200c0, 0xc00188f, 0xafb30010, 0x3c040001, 
-0x24847668, 0x3c050001, 0x24a51034, 0x3c060001, 
-0x24c6110c, 0x8fae0044, 0xc53023, 0x2203821, 
-0x3c010002, 0xac228790, 0x4e1024, 0x21082, 
-0x551025, 0xafc200c8, 0xc00188f, 0xafb30010, 
-0x3c040001, 0x24847674, 0x3c050001, 0x24a5d570, 
-0x3c060001, 0x24c6d654, 0xc53023, 0x2203821, 
-0xaf420110, 0xc00188f, 0xafb30010, 0x3c040001, 
-0x24847684, 0x3c050001, 0x24a5d544, 0x3c060001, 
-0x24c6d568, 0xc53023, 0x2203821, 0xaf420124, 
-0xc00188f, 0xafb30010, 0x3c040001, 0x24847694, 
-0x3c050001, 0x24a5d65c, 0x3c060001, 0x24c6d684, 
-0xc53023, 0x2203821, 0xaf420120, 0xaf420114, 
-0xc00188f, 0xafb30010, 0x3c040001, 0x248476a0, 
-0x3c050001, 0x24a5072c, 0x3c060001, 0x24c60c24, 
-0xc53023, 0x2203821, 0xaf420118, 0xc00188f, 
-0xafb30010, 0x8fae0044, 0x3c010002, 0xac2287d4, 
-0x4e1024, 0x21082, 0x551025, 0xc00451b, 
-0xafc200d0, 0xc004164, 0x0, 0xc0028c7, 
-0x0, 0xac000228, 0xac00022c, 0x96e20450, 
-0x2442ffff, 0xaf420038, 0x96e20460, 0xaf420080, 
-0x32c24000, 0x14400003, 0x0, 0x96e20480, 
-0xaf420084, 0x96e70490, 0x50e00001, 0x24070800, 
-0x24e2ffff, 0xaf420088, 0xaf42007c, 0x24020800, 
-0x10e20023, 0x32c24000, 0x10400003, 0x24020400, 
-0x10e2001f, 0x0, 0x3c040001, 0x248476b0, 
-0x96e60490, 0x24052170, 0x2c03821, 0xafa00010, 
-0xc002d3b, 0xafa00014, 0x3c040001, 0x248473b8, 
-0x240205f1, 0xafa20010, 0xafa00014, 0x8f860144, 
-0x3c070001, 0x24e773c0, 0xc002d3b, 0x3405dead, 
-0x8f82011c, 0x34420002, 0xaf82011c, 0x8f820220, 
-0x34420004, 0xaf820220, 0x8f820140, 0x240e0001, 
-0x3c030001, 0xa3ae003f, 0x431025, 0xaf820140, 
-0x8f430138, 0x8f440138, 0x24020001, 0xa34205c2, 
-0xaf430094, 0xaf440098, 0xafa00010, 0xafa00014, 
-0x8f460080, 0x8f470084, 0x3c040001, 0x248476bc, 
-0xc002d3b, 0x24052200, 0xc0025c6, 0x3c110800, 
-0x3c1433d8, 0x3694cb58, 0x3c020800, 0x34420080, 
-0x3c040001, 0x248476c8, 0x3c050000, 0x24a55ff8, 
-0x3c060000, 0x24c66014, 0xc53023, 0x27a70030, 
-0xaf820060, 0x2402ffff, 0xaf820064, 0x27a20034, 
-0xc00188f, 0xafa20010, 0x3c010002, 0xac228774, 
-0x21100, 0x21182, 0x511025, 0xc0019e8, 
-0xae420000, 0x8f820240, 0x3c030001, 0x431025, 
-0xaf820240, 0x3c020000, 0x24424034, 0xaf820244, 
-0xaf800240, 0x8f820060, 0x511024, 0x14400005, 
-0x3c030800, 0x8f820060, 0x431024, 0x1040fffd, 
-0x0, 0xc004171, 0x8821, 0x3c020100, 
-0xafa20020, 0x8f530018, 0x240200ff, 0x56620001, 
-0x26710001, 0x8c020228, 0x1622000e, 0x1330c0, 
-0x8f42033c, 0x24420001, 0xaf42033c, 0x8f42033c, 
-0x8c020228, 0x3c040001, 0x2484735c, 0x3c050009, 
-0xafa00014, 0xafa20010, 0x8fa60020, 0x1000003f, 
-0x34a50100, 0xd71021, 0x8fa30020, 0x8fa40024, 
-0xac4304c0, 0xac4404c4, 0xc01821, 0x8f440178, 
-0x8f45017c, 0x1021, 0x24070004, 0xafa70010, 
-0xafb10014, 0x8f48000c, 0x24c604c0, 0x2e63021, 
-0xafa80018, 0x8f48010c, 0x24070008, 0xa32821, 
-0xa3482b, 0x822021, 0x100f809, 0x892021, 
-0x1440000b, 0x24070008, 0x8f820120, 0xafa20010, 
-0x8f820124, 0x3c040001, 0x24847364, 0x3c050009, 
-0xafa20014, 0x8fa60020, 0x1000001c, 0x34a50200, 
-0x8f440160, 0x8f450164, 0x8f43000c, 0xaf510018, 
-0x8f860120, 0x24020010, 0xafa20010, 0xafb10014, 
-0xafa30018, 0x8f42010c, 0x40f809, 0x24c6001c, 
-0x14400010, 0x0, 0x8f420340, 0x24420001, 
-0xaf420340, 0x8f420340, 0x8f820120, 0xafa20010, 
-0x8f820124, 0x3c040001, 0x2484736c, 0x3c050009, 
-0xafa20014, 0x8fa60020, 0x34a50300, 0xc002d3b, 
-0x2603821, 0x8f4202e4, 0x24420001, 0xaf4202e4, 
-0x8f4202e4, 0x93a2003f, 0x1040007d, 0x3c020700, 
-0x34423000, 0xafa20028, 0x8f530018, 0x240200ff, 
-0x12620002, 0x8821, 0x26710001, 0x8c020228, 
-0x1622000e, 0x1330c0, 0x8f42033c, 0x24420001, 
-0xaf42033c, 0x8f42033c, 0x8c020228, 0x3c040001, 
-0x2484735c, 0x3c050009, 0xafa00014, 0xafa20010, 
-0x8fa60028, 0x1000003f, 0x34a50100, 0xd71021, 
-0x8fa30028, 0x8fa4002c, 0xac4304c0, 0xac4404c4, 
-0xc01821, 0x8f440178, 0x8f45017c, 0x1021, 
-0x24070004, 0xafa70010, 0xafb10014, 0x8f48000c, 
-0x24c604c0, 0x2e63021, 0xafa80018, 0x8f48010c, 
-0x24070008, 0xa32821, 0xa3482b, 0x822021, 
-0x100f809, 0x892021, 0x1440000b, 0x24070008, 
-0x8f820120, 0xafa20010, 0x8f820124, 0x3c040001, 
-0x24847364, 0x3c050009, 0xafa20014, 0x8fa60028, 
-0x1000001c, 0x34a50200, 0x8f440160, 0x8f450164, 
-0x8f43000c, 0xaf510018, 0x8f860120, 0x24020010, 
-0xafa20010, 0xafb10014, 0xafa30018, 0x8f42010c, 
-0x40f809, 0x24c6001c, 0x14400010, 0x0, 
-0x8f420340, 0x24420001, 0xaf420340, 0x8f420340, 
-0x8f820120, 0xafa20010, 0x8f820124, 0x3c040001, 
-0x2484736c, 0x3c050009, 0xafa20014, 0x8fa60028, 
-0x34a50300, 0xc002d3b, 0x2603821, 0x8f4202f0, 
-0x24420001, 0xaf4202f0, 0x8f4202f0, 0x3c040001, 
-0x248476d8, 0xafa00010, 0xafa00014, 0x8fa60028, 
-0x24052300, 0xc002d3b, 0x3821, 0x3c040001, 
-0x248473b8, 0x24020656, 0xafa20010, 0xafa00014, 
-0x8f860144, 0x3c070001, 0x24e773c0, 0xc002d3b, 
-0x3405dead, 0x8f82011c, 0x34420002, 0xaf82011c, 
-0x8f820220, 0x34420004, 0xaf820220, 0x8f820140, 
-0x3c030001, 0x431025, 0xaf820140, 0x10000004, 
-0x0, 0x8c020264, 0x10400005, 0x0, 
-0x8f8200a0, 0x30420004, 0x1440fffa, 0x0, 
-0x8f820044, 0x34420004, 0xaf820044, 0x8f420308, 
-0x24420001, 0xaf420308, 0x8f420308, 0x8f8200d8, 
-0x8f8300d4, 0x431023, 0x2442ff80, 0xaf420090, 
-0x8f420090, 0x2842ff81, 0x10400006, 0x24020001, 
-0x8f420090, 0x8f430144, 0x431021, 0xaf420090, 
-0x24020001, 0xaf42008c, 0x32c20008, 0x10400006, 
-0x0, 0x8f820214, 0x3c038100, 0x3042ffff, 
-0x431025, 0xaf820214, 0x3c030002, 0x8c638668, 
-0x30620002, 0x10400009, 0x30620001, 0x3c040001, 
-0x248476e4, 0x3c050000, 0x24a57174, 0x3c060000, 
-0x24c675f8, 0x10000012, 0xc53023, 0x10400009, 
-0x0, 0x3c040001, 0x248476f4, 0x3c050000, 
-0x24a57600, 0x3c060000, 0x24c67aa8, 0x10000008, 
-0xc53023, 0x3c040001, 0x24847704, 0x3c050000, 
-0x24a56d68, 0x3c060000, 0x24c6716c, 0xc53023, 
-0x27a70030, 0x27a20034, 0xc00188f, 0xafa20010, 
-0x3c010002, 0xac228788, 0x3c020002, 0x8c428788, 
-0x3c030800, 0x21100, 0x21182, 0x431025, 
-0xae420040, 0x8f8200a0, 0xafa20010, 0x8f8200b0, 
-0xafa20014, 0x8f86005c, 0x8f87011c, 0x3c040001, 
-0x24847714, 0x3c010002, 0xac368760, 0x3c010002, 
-0xac208750, 0x3c010002, 0xac3c8748, 0x3c010002, 
-0xac3b8778, 0x3c010002, 0xac37877c, 0x3c010002, 
-0xac3a875c, 0xc002d3b, 0x24052400, 0x8f820200, 
-0xafa20010, 0x8f820220, 0xafa20014, 0x8f860044, 
-0x8f870050, 0x3c040001, 0x24847720, 0xc002d3b, 
-0x24052500, 0x8f830060, 0x74100b, 0x242000a, 
-0x200f821, 0x0, 0xd, 0x8fbf0060, 
-0x8fbe005c, 0x8fb50058, 0x8fb30054, 0x8fb20050, 
-0x8fb1004c, 0x8fb00048, 0x3e00008, 0x27bd0068, 
-0x27bdffe0, 0x3c040001, 0x2484772c, 0x24052600, 
-0x3021, 0x3821, 0xafbf0018, 0xafa00010, 
-0xc002d3b, 0xafa00014, 0x3c040001, 0x248473b8, 
-0x240206bb, 0xafa20010, 0xafa00014, 0x8f860144, 
-0x3c070001, 0x24e773c0, 0xc002d3b, 0x3405dead, 
-0x8f82011c, 0x34420002, 0xaf82011c, 0x8f820220, 
-0x34420004, 0xaf820220, 0x8f820140, 0x3c030001, 
-0x431025, 0xaf820140, 0x8fbf0018, 0x3e00008, 
-0x27bd0020, 0x3e00008, 0x0, 0x3e00008, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x3e00008, 0x0, 
-0x3e00008, 0x0, 0x27bdfde0, 0xafb00218, 
-0x27b00018, 0x3c0200bf, 0x3442ffff, 0x50102b, 
-0x10400015, 0xafbf021c, 0x3c040001, 0x248473b8, 
-0x240206df, 0xafa20010, 0xafa00014, 0x8f860144, 
-0x3c070001, 0x24e773c0, 0xc002d3b, 0x3405dead, 
-0x8f82011c, 0x34420002, 0xaf82011c, 0x8f820220, 
-0x34420004, 0xaf820220, 0x8f820140, 0x3c030001, 
-0x431025, 0xaf820140, 0x3c04dead, 0x3484beef, 
-0x8f820150, 0x3c03001f, 0x3463ffff, 0xafa40018, 
-0x2028023, 0x2038024, 0x8e020000, 0x1044001e, 
-0x0, 0xafb00010, 0x8e020000, 0xafa20014, 
-0x8f860150, 0x8f870250, 0x3c040001, 0x24847734, 
-0xc002d3b, 0x24052700, 0x3c040001, 0x248473b8, 
-0x240206ed, 0xafa20010, 0xafa00014, 0x8f860144, 
-0x3c070001, 0x24e773c0, 0xc002d3b, 0x3405dead, 
-0x8f82011c, 0x34420002, 0xaf82011c, 0x8f820220, 
-0x34420004, 0xaf820220, 0x8f820140, 0x3c030001, 
-0x431025, 0xaf820140, 0x8fbf021c, 0x8fb00218, 
-0x3e00008, 0x27bd0220, 0x27bdffe0, 0x3c06abba, 
-0x34c6babe, 0xafb00018, 0x3c100004, 0x3c07007f, 
-0x34e7ffff, 0xafbf001c, 0x102840, 0x8e040000, 
-0x8ca30000, 0xaca00000, 0xae060000, 0x8ca20000, 
-0xaca30000, 0x10460005, 0xae040000, 0xa08021, 
-0xf0102b, 0x1040fff5, 0x102840, 0x3c040001, 
-0x24847740, 0x24052800, 0x2003021, 0x3821, 
-0xafa00010, 0xc002d3b, 0xafa00014, 0x2001021, 
-0x8fbf001c, 0x8fb00018, 0x3e00008, 0x27bd0020, 
-0x8c020224, 0x3047003f, 0x10e00010, 0x803021, 
-0x2821, 0x24030020, 0xe31024, 0x10400002, 
-0x63042, 0xa62821, 0x31842, 0x1460fffb, 
-0xe31024, 0x2402f000, 0xa22824, 0x3402ffff, 
-0x45102b, 0x14400003, 0x3c020001, 0x10000008, 
-0x3c020001, 0x3442ffff, 0x851823, 0x43102b, 
-0x14400003, 0xa01021, 0x3c02fffe, 0x821021, 
-0x3e00008, 0x0, 0x27bdffd0, 0xafb50028, 
-0x8fb50040, 0xafb20020, 0xa09021, 0xafb1001c, 
-0x24c60003, 0xafbf002c, 0xafb30024, 0xafb00018, 
-0x8ea20000, 0x2403fffc, 0xc38024, 0x50102b, 
-0x1440001b, 0xe08821, 0x8e330000, 0xafb00010, 
-0x8ea20000, 0xafa20014, 0x8e270000, 0x24053000, 
-0xc002d3b, 0x2403021, 0x8e230000, 0x702021, 
-0x64102b, 0x10400007, 0x2402821, 0x8ca20000, 
-0xac620000, 0x24630004, 0x64102b, 0x1440fffb, 
-0x24a50004, 0x8ea20000, 0x501023, 0xaea20000, 
-0x8e220000, 0x501021, 0x1000000b, 0xae220000, 
-0x2402002d, 0xa0820000, 0xafb00010, 0x8ea20000, 
-0x2409821, 0xafa20014, 0x8e270000, 0x24053100, 
-0xc002d3b, 0x2603021, 0x2601021, 0x8fbf002c, 
-0x8fb50028, 0x8fb30024, 0x8fb20020, 0x8fb1001c, 
-0x8fb00018, 0x3e00008, 0x27bd0030, 0x27bdffe8, 
-0x3c1cc000, 0x3c05fffe, 0x3c030002, 0x8c638740, 
-0x3c040002, 0x8c84874c, 0x34a5bf08, 0x24021ffc, 
-0x3c010002, 0xac2285d0, 0x3c0200c0, 0x3c010002, 
-0xac2285d4, 0x3c020020, 0xafbf0010, 0x3c0100c0, 
-0xac201ffc, 0x431023, 0x441023, 0x245bb000, 
-0x365b821, 0x3c1d0002, 0x8fbd85cc, 0x3a0f021, 
-0x3c0400c0, 0x34840200, 0x3c1a00c0, 0x3c0300c0, 
-0x346307c8, 0x24021dfc, 0x3c010002, 0xac2285d0, 
-0x24021834, 0x3c010002, 0xac2485d4, 0x3c010002, 
-0xac2285d0, 0x3c010002, 0xac2385d4, 0xc0018f9, 
-0x375a0200, 0x8fbf0010, 0x3e00008, 0x27bd0018, 
-0x27bdffc8, 0x3c040001, 0x2484774c, 0x24053200, 
-0x3c020002, 0x8c4285d0, 0x3c030002, 0x8c6385d4, 
-0x3021, 0x3603821, 0xafbf0030, 0xafb3002c, 
-0xafb20028, 0xafb10024, 0xafb00020, 0xafa2001c, 
-0xafa30018, 0xafb70010, 0xc002d3b, 0xafba0014, 
-0xc001a1b, 0x0, 0x8f820240, 0x34420004, 
-0xaf820240, 0x24020001, 0xaf420000, 0x3c020001, 
-0x571021, 0x904240f4, 0x10400093, 0x2403fffc, 
-0x3c100001, 0x2610b47b, 0x3c120001, 0x2652b044, 
-0x2121023, 0x438024, 0x8fa3001c, 0x3c040001, 
-0x24847758, 0x70102b, 0x1440001a, 0x27b30018, 
-0x8fb10018, 0x24053000, 0x2403021, 0xafb00010, 
-0xafa30014, 0xc002d3b, 0x2203821, 0x8fa30018, 
-0x702021, 0x64102b, 0x10400007, 0x2403021, 
-0x8cc20000, 0xac620000, 0x24630004, 0x64102b, 
-0x1440fffb, 0x24c60004, 0x8fa2001c, 0x501023, 
-0xafa2001c, 0x8e620000, 0x501021, 0x1000000a, 
-0xae620000, 0x2408821, 0x24053100, 0xafb00010, 
-0xafa30014, 0x8fa70018, 0x2203021, 0x2402002d, 
-0xc002d3b, 0xa0820000, 0x24070020, 0x8fa3001c, 
-0x3c040001, 0x24847774, 0x24120020, 0x3c010002, 
-0xac31876c, 0x2c620020, 0x1440001d, 0x27b10018, 
-0x8fb00018, 0x24053000, 0x3c060002, 0x24c68810, 
-0xafa70010, 0xafa30014, 0xc002d3b, 0x2003821, 
-0x8fa30018, 0x3c040002, 0x24848810, 0x24650020, 
-0x65102b, 0x10400007, 0x0, 0x8c820000, 
-0xac620000, 0x24630004, 0x65102b, 0x1440fffb, 
-0x24840004, 0x8fa2001c, 0x521023, 0xafa2001c, 
-0x8e220000, 0x521021, 0x1000000b, 0xae220000, 
-0x3c100002, 0x26108810, 0x24053100, 0xafa70010, 
-0xafa30014, 0x8fa70018, 0x2003021, 0x2402002d, 
-0xc002d3b, 0xa0820000, 0x24070020, 0x3c040001, 
-0x24847788, 0x8fa3001c, 0x24120020, 0x3c010002, 
-0xac3087a0, 0x2c620020, 0x1440001d, 0x27b10018, 
-0x8fb00018, 0x24053000, 0x3c060002, 0x24c68830, 
-0xafa70010, 0xafa30014, 0xc002d3b, 0x2003821, 
-0x8fa30018, 0x3c040002, 0x24848830, 0x24650020, 
-0x65102b, 0x10400007, 0x0, 0x8c820000, 
-0xac620000, 0x24630004, 0x65102b, 0x1440fffb, 
-0x24840004, 0x8fa2001c, 0x521023, 0xafa2001c, 
-0x8e220000, 0x521021, 0x1000000b, 0xae220000, 
-0x3c100002, 0x26108830, 0x24053100, 0xafa70010, 
-0xafa30014, 0x8fa70018, 0x2003021, 0x2402002d, 
-0xc002d3b, 0xa0820000, 0x3c010002, 0xac30879c, 
-0x10000031, 0x0, 0x3c100001, 0x26108667, 
-0x3c120001, 0x265284d8, 0x2121023, 0x438024, 
-0x8fa3001c, 0x3c040001, 0x2484779c, 0x70102b, 
-0x1440001a, 0x27b30018, 0x8fb10018, 0x24053000, 
-0x2403021, 0xafb00010, 0xafa30014, 0xc002d3b, 
-0x2203821, 0x8fa30018, 0x702021, 0x64102b, 
-0x10400007, 0x2403021, 0x8cc20000, 0xac620000, 
-0x24630004, 0x64102b, 0x1440fffb, 0x24c60004, 
-0x8fa2001c, 0x501023, 0xafa2001c, 0x8e620000, 
-0x501021, 0x1000000a, 0xae620000, 0x2408821, 
-0x24053100, 0xafb00010, 0xafa30014, 0x8fa70018, 
-0x2203021, 0x2402002d, 0xc002d3b, 0xa0820000, 
-0x3c010002, 0xac31876c, 0x3c030002, 0x8c63876c, 
-0x24020400, 0xaf820070, 0x60f809, 0x0, 
-0x8fbf0030, 0x8fb3002c, 0x8fb20028, 0x8fb10024, 
-0x8fb00020, 0x3e00008, 0x27bd0038, 0x27bdffe0, 
-0xafbf0018, 0x8f820040, 0x3c03f000, 0x431024, 
-0x3c036000, 0x14430008, 0x240201f9, 0x8f820050, 
-0x2403ff80, 0x431024, 0x34420055, 0xaf820050, 
-0x10000014, 0x0, 0x3c040001, 0x2484785c, 
-0xafa20010, 0xafa00014, 0x8f860144, 0x3c070001, 
-0x24e7786c, 0xc002d3b, 0x3405dead, 0x8f82011c, 
-0x34420002, 0xaf82011c, 0x8f820220, 0x34420004, 
-0xaf820220, 0x8f820140, 0x3c030001, 0x431025, 
-0xaf820140, 0x8f820054, 0x244203e8, 0xaf820058, 
-0x240201f4, 0xaf4200e0, 0x24020004, 0xaf4200e8, 
-0x24020002, 0xaf4001b0, 0xaf4000e4, 0xaf4200dc, 
-0xaf4000d8, 0xaf4000d4, 0x8fbf0018, 0xaf4000d0, 
-0x3e00008, 0x27bd0020, 0x8f820054, 0x24420005, 
-0x3e00008, 0xaf820078, 0x27bdffe8, 0xafbf0010, 
-0x8f820054, 0x244203e8, 0xaf820058, 0x3c020800, 
-0x2c21024, 0x10400004, 0x3c02f7ff, 0x3442ffff, 
-0x2c2b024, 0x36940040, 0x3c020002, 0x8c42867c, 
-0x10400017, 0x3c020200, 0x3c030002, 0x8c6387d8, 
-0x10600016, 0x282a025, 0x3c020002, 0x8c428708, 
-0x14400012, 0x3c020200, 0x3c020002, 0x8c428668, 
-0x30420003, 0x1440000d, 0x3c020200, 0x8f830224, 
-0x3c020002, 0x8c42a8ac, 0x10620008, 0x3c020200, 
-0xc00430b, 0x0, 0x10000004, 0x3c020200, 
-0xc00470e, 0x0, 0x3c020200, 0x2c21024, 
-0x10400003, 0x0, 0xc002058, 0x0, 
-0x8f4200d8, 0x8f4300dc, 0x24420001, 0xaf4200d8, 
-0x43102b, 0x14400003, 0x0, 0xaf4000d8, 
-0x36940080, 0x8c030238, 0x1060000c, 0x0, 
-0x8f4201b0, 0x244203e8, 0xaf4201b0, 0x43102b, 
-0x14400006, 0x0, 0x934205c5, 0x14400003, 
-0x0, 0xc001eac, 0x0, 0x8fbf0010, 
-0x3e00008, 0x27bd0018, 0x3e00008, 0x0, 
-0x27bdffd8, 0xafbf0020, 0x8f43002c, 0x8f420038, 
-0x10620059, 0x0, 0x3c020001, 0x571021, 
-0x904240f0, 0x10400026, 0x24070008, 0x8f440170, 
-0x8f450174, 0x8f48000c, 0x8f860120, 0x24020020, 
-0xafa20010, 0xafa30014, 0xafa80018, 0x8f42010c, 
-0x40f809, 0x24c6001c, 0x14400011, 0x24020001, 
-0x3c010001, 0x370821, 0xa02240f0, 0x8f820124, 
-0xafa20010, 0x8f820128, 0x3c040001, 0x24847840, 
-0xafa20014, 0x8f46002c, 0x8f870120, 0x3c050009, 
-0xc002d3b, 0x34a50900, 0x1000005d, 0x0, 
-0x8f420300, 0x24420001, 0xaf420300, 0x8f420300, 
-0x8f42002c, 0xa34005c1, 0x10000027, 0xaf420038, 
-0x8f440170, 0x8f450174, 0x8f43002c, 0x8f48000c, 
-0x8f860120, 0x24020080, 0xafa20010, 0xafa30014, 
-0xafa80018, 0x8f42010c, 0x40f809, 0x24c6001c, 
-0x14400011, 0x24020001, 0x3c010001, 0x370821, 
-0xa02240f1, 0x8f820124, 0xafa20010, 0x8f820128, 
-0x3c040001, 0x2484784c, 0xafa20014, 0x8f46002c, 
-0x8f870120, 0x3c050009, 0xc002d3b, 0x34a51100, 
-0x10000037, 0x0, 0x8f420300, 0x8f43002c, 
-0x24420001, 0xaf420300, 0x8f420300, 0x24020001, 
-0xa34205c1, 0xaf430038, 0x3c010001, 0x370821, 
-0xa02040f1, 0x3c010001, 0x370821, 0xa02040f0, 
-0x10000027, 0xaf400034, 0x934205c1, 0x1040001e, 
-0x0, 0xa34005c1, 0x8f820040, 0x30420001, 
-0x14400008, 0x2021, 0x8c030104, 0x24020001, 
-0x50620005, 0x24040001, 0x8c020264, 0x10400003, 
-0x801021, 0x24040001, 0x801021, 0x10400007, 
-0x0, 0x8f42030c, 0x24420001, 0xaf42030c, 
-0x8f42030c, 0x10000008, 0x0, 0x8f820044, 
-0x34420004, 0xaf820044, 0x8f420308, 0x24420001, 
-0xaf420308, 0x8f420308, 0x3c010001, 0x370821, 
-0xa02040f0, 0x3c010001, 0x370821, 0xa02040f1, 
-0x8f420000, 0x10400007, 0x0, 0xaf80004c, 
-0x8f82004c, 0x1040fffd, 0x0, 0x10000005, 
-0x0, 0xaf800048, 0x8f820048, 0x1040fffd, 
-0x0, 0x8f820060, 0x3c03ff7f, 0x3463ffff, 
-0x431024, 0xaf820060, 0x8f420000, 0x10400004, 
-0x0, 0xaf80004c, 0x10000002, 0x0, 
-0xaf800048, 0x8fbf0020, 0x3e00008, 0x27bd0028, 
-0x3e00008, 0x0, 0x27bdffd8, 0xafbf0020, 
-0x8f430044, 0x8f42007c, 0x10620029, 0x24070008, 
-0x8f440168, 0x8f45016c, 0x8f48000c, 0x8f860120, 
-0x24020040, 0xafa20010, 0xafa30014, 0xafa80018, 
-0x8f42010c, 0x40f809, 0x24c6001c, 0x14400011, 
-0x24020001, 0x3c010001, 0x370821, 0xa02240f2, 
-0x8f820124, 0xafa20010, 0x8f820128, 0x3c040001, 
-0x24847854, 0xafa20014, 0x8f460044, 0x8f870120, 
-0x3c050009, 0xc002d3b, 0x34a51300, 0x1000000f, 
-0x0, 0x8f420304, 0x24420001, 0xaf420304, 
-0x8f420304, 0x8f420044, 0xaf42007c, 0x3c010001, 
-0x370821, 0xa02040f2, 0x10000004, 0xaf400078, 
-0x3c010001, 0x370821, 0xa02040f2, 0x8f420000, 
-0x10400007, 0x0, 0xaf80004c, 0x8f82004c, 
-0x1040fffd, 0x0, 0x10000005, 0x0, 
-0xaf800048, 0x8f820048, 0x1040fffd, 0x0, 
-0x8f820060, 0x3c03feff, 0x3463ffff, 0x431024, 
-0xaf820060, 0x8f420000, 0x10400004, 0x0, 
-0xaf80004c, 0x10000002, 0x0, 0xaf800048, 
-0x8fbf0020, 0x3e00008, 0x27bd0028, 0x3e00008, 
-0x0, 0x3c020002, 0x8c42867c, 0x27bdffa8, 
-0xafbf0050, 0xafbe004c, 0xafb50048, 0xafb30044, 
-0xafb20040, 0xafb1003c, 0xafb00038, 0x8f900044, 
-0x104000d5, 0x0, 0x8f4200d0, 0x24430001, 
-0x2842000b, 0x144000e4, 0xaf4300d0, 0x8f420004, 
-0x30420002, 0x1440009c, 0xaf4000d0, 0x8f420004, 
-0x3c030002, 0x8c63866c, 0x34420002, 0xaf420004, 
-0x24020001, 0x14620003, 0x3c020600, 0x10000002, 
-0x34423000, 0x34421000, 0xafa20020, 0x8f4a0018, 
-0xafaa0034, 0x27aa0020, 0xafaa002c, 0x8faa0034, 
-0x240200ff, 0x11420002, 0x1821, 0x25430001, 
-0x8c020228, 0x609821, 0x1662000e, 0x3c050009, 
-0x8f42033c, 0x24420001, 0xaf42033c, 0x8f42033c, 
-0x8c020228, 0x8fa70034, 0x3c040001, 0x24847824, 
-0xafa00014, 0xafa20010, 0x8fa60020, 0x10000070, 
-0x34a50500, 0x8faa0034, 0xa38c0, 0xf71021, 
-0x8fa30020, 0x8fa40024, 0xac4304c0, 0xac4404c4, 
-0x8f830054, 0x8f820054, 0x247103e8, 0x2221023, 
-0x2c4203e9, 0x1040001b, 0xa821, 0xe09021, 
-0x265e04c0, 0x8f440178, 0x8f45017c, 0x2401821, 
-0x240a0004, 0xafaa0010, 0xafb30014, 0x8f48000c, 
-0x1021, 0x2fe3021, 0xafa80018, 0x8f48010c, 
-0x24070008, 0xa32821, 0xa3482b, 0x822021, 
-0x100f809, 0x892021, 0x54400006, 0x24150001, 
-0x8f820054, 0x2221023, 0x2c4203e9, 0x1440ffe9, 
-0x0, 0x32a200ff, 0x54400018, 0xaf530018, 
-0x8f420378, 0x24420001, 0xaf420378, 0x8f420378, 
-0x8f820120, 0x8faa002c, 0x8fa70034, 0xafa20010, 
-0x8f820124, 0x3c040001, 0x24847830, 0xafa20014, 
-0x8d460000, 0x3c050009, 0x10000035, 0x34a50600, 
-0x8f420308, 0x24150001, 0x24420001, 0xaf420308, 
-0x8f420308, 0x1000001e, 0x32a200ff, 0x8f830054, 
-0x8f820054, 0x247103e8, 0x2221023, 0x2c4203e9, 
-0x10400016, 0xa821, 0x3c1e0020, 0x24120010, 
-0x8f42000c, 0x8f440160, 0x8f450164, 0x8f860120, 
-0xafb20010, 0xafb30014, 0x5e1025, 0xafa20018, 
-0x8f42010c, 0x24070008, 0x40f809, 0x24c6001c, 
-0x1440ffe3, 0x0, 0x8f820054, 0x2221023, 
-0x2c4203e9, 0x1440ffee, 0x0, 0x32a200ff, 
-0x14400011, 0x3c050009, 0x8f420378, 0x24420001, 
-0xaf420378, 0x8f420378, 0x8f820120, 0x8faa002c, 
-0x8fa70034, 0xafa20010, 0x8f820124, 0x3c040001, 
-0x24847838, 0xafa20014, 0x8d460000, 0x34a50700, 
-0xc002d3b, 0x0, 0x8f4202ec, 0x24420001, 
-0xaf4202ec, 0x8f4202ec, 0x8f420004, 0x30420001, 
-0x50400029, 0x36100040, 0x3c020400, 0x2c21024, 
-0x10400013, 0x2404ffdf, 0x8f420250, 0x8f430254, 
-0x8f4401b4, 0x14640006, 0x36100040, 0x8f420270, 
-0x8f430274, 0x8f4401b8, 0x10640007, 0x2402ffdf, 
-0x8f420250, 0x8f430254, 0x8f440270, 0x8f450274, 
-0x10000012, 0x3a100020, 0x1000002b, 0x2028024, 
-0x8f420250, 0x8f430254, 0x8f4501b4, 0x14650006, 
-0x2048024, 0x8f420270, 0x8f430274, 0x8f4401b8, 
-0x50640021, 0x36100040, 0x8f420250, 0x8f430254, 
-0x8f440270, 0x8f450274, 0x3a100040, 0xaf4301b4, 
-0x10000019, 0xaf4501b8, 0x8f4200d4, 0x24430001, 
-0x10000011, 0x28420033, 0x8f420004, 0x30420001, 
-0x10400009, 0x3c020400, 0x2c21024, 0x10400004, 
-0x2402ffdf, 0x2028024, 0x1000000b, 0x36100040, 
-0x10000009, 0x36100060, 0x8f4200d4, 0x36100040, 
-0x24430001, 0x284201f5, 0x14400003, 0xaf4300d4, 
-0xaf4000d4, 0x3a100020, 0xaf900044, 0x2402ff7f, 
-0x282a024, 0x8fbf0050, 0x8fbe004c, 0x8fb50048, 
-0x8fb30044, 0x8fb20040, 0x8fb1003c, 0x8fb00038, 
-0x3e00008, 0x27bd0058, 0x3e00008, 0x0, 
-0x3c020002, 0x8c42867c, 0x27bdffb0, 0xafbf0048, 
-0xafbe0044, 0xafb50040, 0xafb3003c, 0xafb20038, 
-0xafb10034, 0x104000c9, 0xafb00030, 0x8f4200d0, 
-0x24430001, 0x2842000b, 0x144000dd, 0xaf4300d0, 
-0x8f420004, 0x30420002, 0x14400097, 0xaf4000d0, 
-0x8f420004, 0x3c030002, 0x8c63866c, 0x34420002, 
-0xaf420004, 0x24020001, 0x14620003, 0x3c020600, 
-0x10000002, 0x34423000, 0x34421000, 0xafa20020, 
-0x1821, 0x8f5e0018, 0x27aa0020, 0x240200ff, 
-0x13c20002, 0xafaa002c, 0x27c30001, 0x8c020228, 
-0x609021, 0x1642000e, 0x1e38c0, 0x8f42033c, 
-0x24420001, 0xaf42033c, 0x8f42033c, 0x8c020228, 
-0x3c040001, 0x24847824, 0x3c050009, 0xafa00014, 
-0xafa20010, 0x8fa60020, 0x1000006d, 0x34a50500, 
-0xf71021, 0x8fa30020, 0x8fa40024, 0xac4304c0, 
-0xac4404c4, 0x8f830054, 0x8f820054, 0x247003e8, 
-0x2021023, 0x2c4203e9, 0x1040001b, 0x9821, 
-0xe08821, 0x263504c0, 0x8f440178, 0x8f45017c, 
-0x2201821, 0x240a0004, 0xafaa0010, 0xafb20014, 
-0x8f48000c, 0x1021, 0x2f53021, 0xafa80018, 
-0x8f48010c, 0x24070008, 0xa32821, 0xa3482b, 
-0x822021, 0x100f809, 0x892021, 0x54400006, 
-0x24130001, 0x8f820054, 0x2021023, 0x2c4203e9, 
-0x1440ffe9, 0x0, 0x326200ff, 0x54400017, 
-0xaf520018, 0x8f420378, 0x24420001, 0xaf420378, 
-0x8f420378, 0x8f820120, 0x8faa002c, 0xafa20010, 
-0x8f820124, 0x3c040001, 0x24847830, 0x3c050009, 
-0xafa20014, 0x8d460000, 0x10000035, 0x34a50600, 
-0x8f420308, 0x24130001, 0x24420001, 0xaf420308, 
-0x8f420308, 0x1000001e, 0x326200ff, 0x8f830054, 
-0x8f820054, 0x247003e8, 0x2021023, 0x2c4203e9, 
-0x10400016, 0x9821, 0x3c150020, 0x24110010, 
-0x8f42000c, 0x8f440160, 0x8f450164, 0x8f860120, 
-0xafb10010, 0xafb20014, 0x551025, 0xafa20018, 
-0x8f42010c, 0x24070008, 0x40f809, 0x24c6001c, 
-0x1440ffe3, 0x0, 0x8f820054, 0x2021023, 
-0x2c4203e9, 0x1440ffee, 0x0, 0x326200ff, 
-0x14400011, 0x0, 0x8f420378, 0x24420001, 
-0xaf420378, 0x8f420378, 0x8f820120, 0x8faa002c, 
-0xafa20010, 0x8f820124, 0x3c040001, 0x24847838, 
-0x3c050009, 0xafa20014, 0x8d460000, 0x34a50700, 
-0xc002d3b, 0x3c03821, 0x8f4202ec, 0x24420001, 
-0xaf4202ec, 0x8f4202ec, 0x8f420004, 0x30420001, 
-0x1040001a, 0x24040001, 0x8f420250, 0x8f430254, 
-0x8f4501b4, 0x3c010002, 0xa02485e9, 0x14650006, 
-0x0, 0x8f420270, 0x8f430274, 0x8f4401b8, 
-0x10640022, 0x0, 0x8f420250, 0x8f430254, 
-0x3c040002, 0x908485e8, 0x8f460270, 0x8f470274, 
-0x38840001, 0xaf4301b4, 0xaf4701b8, 0x3c010002, 
-0xa02485e8, 0x10000026, 0x0, 0x8f4200d4, 
-0x3c010002, 0xa02085e8, 0x24430001, 0x28420033, 
-0x1440001f, 0xaf4300d4, 0x3c020002, 0x904285e9, 
-0xaf4000d4, 0x10000018, 0x38420001, 0x8f420004, 
-0x30420001, 0x10400009, 0x0, 0xc005c9f, 
-0x2021, 0x3c010002, 0xa02085e9, 0x3c010002, 
-0xa02085e8, 0x1000000e, 0x0, 0x8f4200d4, 
-0x3c010002, 0xa02085e8, 0x24430001, 0x284201f5, 
-0x14400007, 0xaf4300d4, 0x3c020002, 0x904285e9, 
-0xaf4000d4, 0x421026, 0x3c010002, 0xa02285e9, 
-0x3c030002, 0x8c63866c, 0x24020002, 0x1462000c, 
-0x3c030002, 0x3c030002, 0x906385e9, 0x24020001, 
-0x5462001f, 0x2021, 0x3c020002, 0x904285e8, 
-0x1443001b, 0x24040005, 0x10000019, 0x24040006, 
-0x3c020002, 0x8c42a8b4, 0x431024, 0x1040000b, 
-0x24020001, 0x3c030002, 0x906385e9, 0x54620010, 
-0x2021, 0x3c020002, 0x904285e8, 0x1443000c, 
-0x24040003, 0x1000000a, 0x24040004, 0x3c030002, 
-0x906385e9, 0x14620006, 0x2021, 0x3c020002, 
-0x904285e8, 0x24040001, 0x50440001, 0x24040002, 
-0xc005c9f, 0x0, 0x2402ff7f, 0x282a024, 
-0x8fbf0048, 0x8fbe0044, 0x8fb50040, 0x8fb3003c, 
-0x8fb20038, 0x8fb10034, 0x8fb00030, 0x3e00008, 
-0x27bd0050, 0x3e00008, 0x0, 0x3c020002, 
-0x8c42867c, 0x27bdffb0, 0xafbf0048, 0xafbe0044, 
-0xafb50040, 0xafb3003c, 0xafb20038, 0xafb10034, 
-0x104000de, 0xafb00030, 0x8f4200d0, 0x3c040002, 
-0x8c84866c, 0x24430001, 0x2842000b, 0xaf4400e8, 
-0x144000fe, 0xaf4300d0, 0x8f420004, 0x30420002, 
-0x14400095, 0xaf4000d0, 0x8f420004, 0x34420002, 
-0xaf420004, 0x24020001, 0x14820003, 0x3c020600, 
-0x10000002, 0x34423000, 0x34421000, 0xafa20020, 
-0x1821, 0x8f5e0018, 0x27aa0020, 0x240200ff, 
-0x13c20002, 0xafaa002c, 0x27c30001, 0x8c020228, 
-0x609021, 0x1642000e, 0x1e38c0, 0x8f42033c, 
-0x24420001, 0xaf42033c, 0x8f42033c, 0x8c020228, 
-0x3c040001, 0x24847824, 0x3c050009, 0xafa00014, 
-0xafa20010, 0x8fa60020, 0x1000006d, 0x34a50500, 
-0xf71021, 0x8fa30020, 0x8fa40024, 0xac4304c0, 
-0xac4404c4, 0x8f830054, 0x8f820054, 0x247003e8, 
-0x2021023, 0x2c4203e9, 0x1040001b, 0x9821, 
-0xe08821, 0x263504c0, 0x8f440178, 0x8f45017c, 
-0x2201821, 0x240a0004, 0xafaa0010, 0xafb20014, 
-0x8f48000c, 0x1021, 0x2f53021, 0xafa80018, 
-0x8f48010c, 0x24070008, 0xa32821, 0xa3482b, 
-0x822021, 0x100f809, 0x892021, 0x54400006, 
-0x24130001, 0x8f820054, 0x2021023, 0x2c4203e9, 
-0x1440ffe9, 0x0, 0x326200ff, 0x54400017, 
-0xaf520018, 0x8f420378, 0x24420001, 0xaf420378, 
-0x8f420378, 0x8f820120, 0x8faa002c, 0xafa20010, 
-0x8f820124, 0x3c040001, 0x24847830, 0x3c050009, 
-0xafa20014, 0x8d460000, 0x10000035, 0x34a50600, 
-0x8f420308, 0x24130001, 0x24420001, 0xaf420308, 
-0x8f420308, 0x1000001e, 0x326200ff, 0x8f830054, 
-0x8f820054, 0x247003e8, 0x2021023, 0x2c4203e9, 
-0x10400016, 0x9821, 0x3c150020, 0x24110010, 
-0x8f42000c, 0x8f440160, 0x8f450164, 0x8f860120, 
-0xafb10010, 0xafb20014, 0x551025, 0xafa20018, 
-0x8f42010c, 0x24070008, 0x40f809, 0x24c6001c, 
-0x1440ffe3, 0x0, 0x8f820054, 0x2021023, 
-0x2c4203e9, 0x1440ffee, 0x0, 0x326200ff, 
-0x14400011, 0x0, 0x8f420378, 0x24420001, 
-0xaf420378, 0x8f420378, 0x8f820120, 0x8faa002c, 
-0xafa20010, 0x8f820124, 0x3c040001, 0x24847838, 
-0x3c050009, 0xafa20014, 0x8d460000, 0x34a50700, 
-0xc002d3b, 0x3c03821, 0x8f4202ec, 0x24420001, 
-0xaf4202ec, 0x8f4202ec, 0x8f420004, 0x30420001, 
-0x10400033, 0x3c020400, 0x2c21024, 0x10400017, 
-0x0, 0x934205c0, 0x8f440250, 0x8f450254, 
-0x8f4301b4, 0x34420020, 0x14a30006, 0xa34205c0, 
-0x8f420270, 0x8f430274, 0x8f4401b8, 0x10640008, 
-0x0, 0x8f420250, 0x8f430254, 0x934405c0, 
-0x8f460270, 0x8f470274, 0x10000016, 0x38840040, 
-0x934205c0, 0x10000048, 0x304200bf, 0x934205c0, 
-0x8f440250, 0x8f450254, 0x8f4301b4, 0x304200bf, 
-0x14a30006, 0xa34205c0, 0x8f420270, 0x8f430274, 
-0x8f4401b8, 0x1064000b, 0x0, 0x8f420250, 
-0x8f430254, 0x934405c0, 0x8f460270, 0x8f470274, 
-0x38840020, 0xaf4301b4, 0xaf4701b8, 0x10000033, 
-0xa34405c0, 0x934205c0, 0x1000002f, 0x34420020, 
-0x934205c0, 0x8f4300d4, 0x34420020, 0xa34205c0, 
-0x24620001, 0x10000023, 0x28630033, 0x8f4200e4, 
-0x8f4300e0, 0x24420001, 0xaf4200e4, 0x43102a, 
-0x14400006, 0x24030001, 0x8f4200e8, 0x14430002, 
-0xaf4000e4, 0x24030004, 0xaf4300e8, 0x8f420004, 
-0x30420001, 0x1040000d, 0x3c020400, 0x2c21024, 
-0x10400007, 0x0, 0x934205c0, 0x34420040, 
-0xa34205c0, 0x934205c0, 0x1000000f, 0x304200df, 
-0x934205c0, 0x1000000c, 0x34420060, 0x934205c0, 
-0x8f4300d4, 0x34420020, 0xa34205c0, 0x24620001, 
-0x286300fb, 0x14600005, 0xaf4200d4, 0x934205c0, 
-0xaf4000d4, 0x38420040, 0xa34205c0, 0x934205c0, 
-0x8f4300e8, 0x3042007f, 0xa34205c0, 0x24020001, 
-0x14620005, 0x0, 0x934405c0, 0x42102, 
-0x10000003, 0x348400f0, 0x934405c0, 0x3484000f, 
-0xc005c85, 0x0, 0x2402ff7f, 0x282a024, 
-0x8fbf0048, 0x8fbe0044, 0x8fb50040, 0x8fb3003c, 
-0x8fb20038, 0x8fb10034, 0x8fb00030, 0x3e00008, 
-0x27bd0050, 0x3e00008, 0x0, 0x27bdffb0, 
-0x274401c0, 0x26e30028, 0x24650400, 0x65102b, 
-0xafbf0048, 0xafbe0044, 0xafb50040, 0xafb3003c, 
-0xafb20038, 0xafb10034, 0x10400007, 0xafb00030, 
-0x8c820000, 0xac620000, 0x24630004, 0x65102b, 
-0x1440fffb, 0x24840004, 0x8c020080, 0xaee20044, 
-0x8c0200c0, 0xaee20040, 0x8c020084, 0xaee20030, 
-0x8c020084, 0xaee2023c, 0x8c020088, 0xaee20240, 
-0x8c02008c, 0xaee20244, 0x8c020090, 0xaee20248, 
-0x8c020094, 0xaee2024c, 0x8c020098, 0xaee20250, 
-0x8c02009c, 0xaee20254, 0x8c0200a0, 0xaee20258, 
-0x8c0200a4, 0xaee2025c, 0x8c0200a8, 0xaee20260, 
-0x8c0200ac, 0xaee20264, 0x8c0200b0, 0xaee20268, 
-0x8c0200b4, 0xaee2026c, 0x8c0200b8, 0xaee20270, 
-0x8c0200bc, 0x24040001, 0xaee20274, 0xaee00034, 
-0x41080, 0x571021, 0x8ee30034, 0x8c42023c, 
-0x24840001, 0x621821, 0x2c82000f, 0xaee30034, 
-0x1440fff8, 0x41080, 0x8c0200cc, 0xaee20048, 
-0x8c0200d0, 0xaee2004c, 0x8c0200e0, 0xaee201f8, 
-0x8c0200e4, 0xaee201fc, 0x8c0200e8, 0xaee20200, 
-0x8c0200ec, 0xaee20204, 0x8c0200f0, 0xaee20208, 
-0x8ee400c0, 0x8ee500c4, 0x8c0200fc, 0x45102b, 
-0x1040000b, 0x0, 0x8ee200c0, 0x8ee300c4, 
-0x24040001, 0x24050000, 0x651821, 0x65302b, 
-0x441021, 0x461021, 0xaee200c0, 0xaee300c4, 
-0x8c0200fc, 0x8ee400c0, 0x8ee500c4, 0x2408ffff, 
-0x24090000, 0x401821, 0x1021, 0x882024, 
-0xa92824, 0x822025, 0xa32825, 0xaee400c0, 
-0xaee500c4, 0x8ee400d0, 0x8ee500d4, 0x8c0200f4, 
-0x45102b, 0x1040000b, 0x0, 0x8ee200d0, 
-0x8ee300d4, 0x24040001, 0x24050000, 0x651821, 
-0x65302b, 0x441021, 0x461021, 0xaee200d0, 
-0xaee300d4, 0x8c0200f4, 0x8ee400d0, 0x8ee500d4, 
-0x401821, 0x1021, 0x882024, 0xa92824, 
-0x822025, 0xa32825, 0xaee400d0, 0xaee500d4, 
-0x8ee400c8, 0x8ee500cc, 0x8c0200f8, 0x45102b, 
-0x1040000b, 0x0, 0x8ee200c8, 0x8ee300cc, 
-0x24040001, 0x24050000, 0x651821, 0x65302b, 
-0x441021, 0x461021, 0xaee200c8, 0xaee300cc, 
-0x8c0200f8, 0x8ee400c8, 0x8ee500cc, 0x401821, 
-0x1021, 0x882024, 0xa92824, 0x822025, 
-0xa32825, 0x24020008, 0xaee400c8, 0xaee500cc, 
-0xafa20010, 0xafa00014, 0x8f42000c, 0x8c040208, 
-0x8c05020c, 0xafa20018, 0x8f42010c, 0x26e60028, 
-0x40f809, 0x24070400, 0x104000f1, 0x3c020400, 
-0xafa20020, 0x934205c6, 0x10400089, 0x1821, 
-0x8f5e0018, 0x27aa0020, 0x240200ff, 0x13c20002, 
-0xafaa002c, 0x27c30001, 0x8c020228, 0x609021, 
-0x1642000e, 0x1e38c0, 0x8f42033c, 0x24420001, 
-0xaf42033c, 0x8f42033c, 0x8c020228, 0x3c040001, 
-0x24847824, 0x3c050009, 0xafa00014, 0xafa20010, 
-0x8fa60020, 0x1000006b, 0x34a50500, 0xf71021, 
-0x8fa30020, 0x8fa40024, 0xac4304c0, 0xac4404c4, 
-0x8f830054, 0x8f820054, 0x247003e8, 0x2021023, 
-0x2c4203e9, 0x1040001b, 0x9821, 0xe08821, 
-0x263504c0, 0x8f440178, 0x8f45017c, 0x2201821, 
-0x240a0004, 0xafaa0010, 0xafb20014, 0x8f48000c, 
-0x1021, 0x2f53021, 0xafa80018, 0x8f48010c, 
-0x24070008, 0xa32821, 0xa3482b, 0x822021, 
-0x100f809, 0x892021, 0x54400006, 0x24130001, 
-0x8f820054, 0x2021023, 0x2c4203e9, 0x1440ffe9, 
-0x0, 0x326200ff, 0x54400017, 0xaf520018, 
-0x8f420378, 0x24420001, 0xaf420378, 0x8f420378, 
-0x8f820120, 0x8faa002c, 0xafa20010, 0x8f820124, 
-0x3c040001, 0x24847830, 0x3c050009, 0xafa20014, 
-0x8d460000, 0x10000033, 0x34a50600, 0x8f420308, 
-0x24130001, 0x24420001, 0xaf420308, 0x8f420308, 
-0x1000001c, 0x326200ff, 0x8f830054, 0x8f820054, 
-0x247003e8, 0x2021023, 0x2c4203e9, 0x10400014, 
-0x9821, 0x24110010, 0x8f42000c, 0x8f440160, 
-0x8f450164, 0x8f860120, 0xafb10010, 0xafb20014, 
-0xafa20018, 0x8f42010c, 0x24070008, 0x40f809, 
-0x24c6001c, 0x1440ffe5, 0x0, 0x8f820054, 
-0x2021023, 0x2c4203e9, 0x1440ffef, 0x0, 
-0x326200ff, 0x54400012, 0x24020001, 0x8f420378, 
-0x24420001, 0xaf420378, 0x8f420378, 0x8f820120, 
-0x8faa002c, 0xafa20010, 0x8f820124, 0x3c040001, 
-0x24847838, 0x3c050009, 0xafa20014, 0x8d460000, 
-0x34a50700, 0xc002d3b, 0x3c03821, 0x1021, 
-0x1440005b, 0x24020001, 0x10000066, 0x0, 
-0x8f510018, 0x240200ff, 0x12220002, 0x8021, 
-0x26300001, 0x8c020228, 0x1602000e, 0x1130c0, 
-0x8f42033c, 0x24420001, 0xaf42033c, 0x8f42033c, 
-0x8c020228, 0x3c040001, 0x2484780c, 0x3c050009, 
-0xafa00014, 0xafa20010, 0x8fa60020, 0x1000003f, 
-0x34a50100, 0xd71021, 0x8fa30020, 0x8fa40024, 
-0xac4304c0, 0xac4404c4, 0xc01821, 0x8f440178, 
-0x8f45017c, 0x1021, 0x24070004, 0xafa70010, 
-0xafb00014, 0x8f48000c, 0x24c604c0, 0x2e63021, 
-0xafa80018, 0x8f48010c, 0x24070008, 0xa32821, 
-0xa3482b, 0x822021, 0x100f809, 0x892021, 
-0x1440000b, 0x24070008, 0x8f820120, 0xafa20010, 
-0x8f820124, 0x3c040001, 0x24847814, 0x3c050009, 
-0xafa20014, 0x8fa60020, 0x1000001c, 0x34a50200, 
-0x8f440160, 0x8f450164, 0x8f43000c, 0xaf500018, 
-0x8f860120, 0x24020010, 0xafa20010, 0xafb00014, 
-0xafa30018, 0x8f42010c, 0x40f809, 0x24c6001c, 
-0x54400011, 0x24020001, 0x8f420340, 0x24420001, 
-0xaf420340, 0x8f420340, 0x8f820120, 0xafa20010, 
-0x8f820124, 0x3c040001, 0x2484781c, 0x3c050009, 
-0xafa20014, 0x8fa60020, 0x34a50300, 0xc002d3b, 
-0x2203821, 0x1021, 0x1040000e, 0x24020001, 
-0x8f4202e8, 0xa34005c6, 0xaf4001b0, 0x24420001, 
-0xaf4202e8, 0x8f4202e8, 0x8ee20150, 0x24420001, 
-0xaee20150, 0x8ee20150, 0x10000003, 0x0, 
-0x24020001, 0xa34205c6, 0x8fbf0048, 0x8fbe0044, 
-0x8fb50040, 0x8fb3003c, 0x8fb20038, 0x8fb10034, 
-0x8fb00030, 0x3e00008, 0x27bd0050, 0x27bdffd8, 
-0xafbf0020, 0x8f8200b0, 0x30420004, 0x10400069, 
-0x0, 0x8f430128, 0x8f820104, 0x14620005, 
-0x0, 0x8f430130, 0x8f8200b4, 0x10620006, 
-0x0, 0x8f820104, 0xaf420128, 0x8f8200b4, 
-0x1000005c, 0xaf420130, 0x8f8200b0, 0x3c030080, 
-0x431024, 0x1040000e, 0x0, 0x8f82011c, 
-0x34420002, 0xaf82011c, 0x8f8200b0, 0x2403fffb, 
-0x431024, 0xaf8200b0, 0x8f82011c, 0x2403fffd, 
-0x431024, 0xaf82011c, 0x1000004a, 0x0, 
-0x8f430128, 0x8f820104, 0x14620005, 0x0, 
-0x8f430130, 0x8f8200b4, 0x10620010, 0x0, 
-0x8f820104, 0xaf420128, 0x8f8200b4, 0x8f430128, 
-0xaf420130, 0xafa30010, 0x8f420130, 0x3c040001, 
-0x24847874, 0xafa20014, 0x8f86011c, 0x8f8700b0, 
-0x3c050005, 0x10000031, 0x34a50900, 0x8f420128, 
-0xafa20010, 0x8f420130, 0x3c040001, 0x24847880, 
-0xafa20014, 0x8f86011c, 0x8f8700b0, 0x3c050005, 
-0xc002d3b, 0x34a51000, 0x8f82011c, 0x34420002, 
-0xaf82011c, 0x8f830104, 0x8f8200b0, 0x34420001, 
-0xaf8200b0, 0x24020008, 0xaf830104, 0xafa20010, 
-0xafa00014, 0x8f42000c, 0x8c040208, 0x8c05020c, 
-0xafa20018, 0x8f42010c, 0x26e60028, 0x40f809, 
-0x24070400, 0x8f82011c, 0x2403fffd, 0x431024, 
-0xaf82011c, 0x8ee201dc, 0x24420001, 0xaee201dc, 
-0x8ee201dc, 0x8f420128, 0xafa20010, 0x8f420130, 
-0x3c040001, 0x2484788c, 0xafa20014, 0x8f86011c, 
-0x8f8700b0, 0x3c050005, 0x34a51100, 0xc002d3b, 
-0x0, 0x8f8200a0, 0x30420004, 0x1040006a, 
-0x0, 0x8f43012c, 0x8f820124, 0x14620005, 
-0x0, 0x8f430134, 0x8f8200a4, 0x10620006, 
-0x0, 0x8f820124, 0xaf42012c, 0x8f8200a4, 
-0x1000005d, 0xaf420134, 0x8f8200a0, 0x3c030080, 
-0x431024, 0x1040000e, 0x0, 0x8f82011c, 
-0x34420002, 0xaf82011c, 0x8f8200a0, 0x2403fffb, 
-0x431024, 0xaf8200a0, 0x8f82011c, 0x2403fffd, 
-0x431024, 0xaf82011c, 0x1000004b, 0x0, 
-0x8f43012c, 0x8f820124, 0x14620005, 0x0, 
-0x8f430134, 0x8f8200a4, 0x10620010, 0x0, 
-0x8f820124, 0xaf42012c, 0x8f8200a4, 0x8f43012c, 
-0xaf420134, 0xafa30010, 0x8f420134, 0x3c040001, 
-0x24847898, 0xafa20014, 0x8f86011c, 0x8f8700a0, 
-0x3c050005, 0x10000032, 0x34a51200, 0x8f42012c, 
-0xafa20010, 0x8f420134, 0x3c040001, 0x248478a4, 
-0xafa20014, 0x8f86011c, 0x8f8700a0, 0x3c050005, 
-0xc002d3b, 0x34a51300, 0x8f82011c, 0x34420002, 
-0xaf82011c, 0x8f830124, 0x8f8200a0, 0x34420001, 
-0xaf8200a0, 0x24020080, 0xaf830124, 0xafa20010, 
-0xafa00014, 0x8f420014, 0x8c040208, 0x8c05020c, 
-0xafa20018, 0x8f420108, 0x3c060002, 0x24c68794, 
-0x40f809, 0x24070004, 0x8f82011c, 0x2403fffd, 
-0x431024, 0xaf82011c, 0x8ee201dc, 0x24420001, 
-0xaee201dc, 0x8ee201dc, 0x8f42012c, 0xafa20010, 
-0x8f420134, 0x3c040001, 0x248478b0, 0xafa20014, 
-0x8f86011c, 0x8f8700a0, 0x3c050005, 0x34a51400, 
-0xc002d3b, 0x0, 0x8fbf0020, 0x3e00008, 
-0x27bd0028, 0x3c081000, 0x24070001, 0x3c060080, 
-0x3c050100, 0x8f820070, 0x481024, 0x1040fffd, 
-0x0, 0x8f820054, 0x24420005, 0xaf820078, 
-0x8c040234, 0x10800017, 0x1821, 0x3c020001, 
-0x571021, 0x8c4240e8, 0x24420005, 0x3c010001, 
-0x370821, 0xac2240e8, 0x3c020001, 0x571021, 
-0x8c4240e8, 0x44102b, 0x1440000a, 0x0, 
-0x3c030080, 0x3c010001, 0x370821, 0xac2040e8, 
-0x3c010001, 0x370821, 0xa02740f0, 0x1000000b, 
-0x0, 0x3c020001, 0x571021, 0x904240f0, 
-0x54400006, 0x661825, 0x3c020001, 0x571021, 
-0x904240f1, 0x54400001, 0x661825, 0x8c040230, 
-0x10800013, 0x0, 0x3c020001, 0x571021, 
-0x8c4240ec, 0x24420005, 0x3c010001, 0x370821, 
-0xac2240ec, 0x3c020001, 0x571021, 0x8c4240ec, 
-0x44102b, 0x14400006, 0x0, 0x3c010001, 
-0x370821, 0xac2040ec, 0x10000006, 0x651825, 
-0x3c020001, 0x571021, 0x904240f2, 0x54400001, 
-0x651825, 0x1060ffbb, 0x0, 0x8f420000, 
-0x10400007, 0x0, 0xaf80004c, 0x8f82004c, 
-0x1040fffd, 0x0, 0x10000005, 0x0, 
-0xaf800048, 0x8f820048, 0x1040fffd, 0x0, 
-0x8f820060, 0x431025, 0xaf820060, 0x8f420000, 
-0x10400004, 0x0, 0xaf80004c, 0x1000ffa5, 
-0x0, 0xaf800048, 0x1000ffa2, 0x0, 
-0x3e00008, 0x0, 0x27bdffe0, 0xafbf0018, 
-0x8f860064, 0x30c20004, 0x10400026, 0x24040004, 
-0x8c020114, 0xaf420020, 0xaf840064, 0x8f4202fc, 
-0x24420001, 0xaf4202fc, 0x8f4202fc, 0x8f820064, 
-0x30420004, 0x14400005, 0x0, 0x8c030114, 
-0x8f420020, 0x1462fff2, 0x0, 0x8f420000, 
-0x8f43003c, 0x10400007, 0x0, 0xaf80004c, 
-0x8f82004c, 0x1040fffd, 0x0, 0x10000005, 
-0x0, 0xaf800048, 0x8f820048, 0x1040fffd, 
-0x0, 0x8f820060, 0x431025, 0xaf820060, 
-0x8f420000, 0x10400074, 0x0, 0x1000006f, 
-0x0, 0x30c20008, 0x10400020, 0x24040008, 
-0x8c02011c, 0xaf420048, 0xaf840064, 0x8f4202a8, 
-0x24420001, 0xaf4202a8, 0x8f4202a8, 0x8f820064, 
-0x30420008, 0x14400005, 0x0, 0x8c03011c, 
-0x8f420048, 0x1462fff2, 0x0, 0x8f420000, 
-0x10400007, 0x0, 0xaf80004c, 0x8f82004c, 
-0x1040fffd, 0x0, 0x10000005, 0x0, 
-0xaf800048, 0x8f820048, 0x1040fffd, 0x0, 
-0x8f820060, 0x1000ffd9, 0x34420200, 0x30c20020, 
-0x10400023, 0x24040020, 0x8c02012c, 0xaf420068, 
-0xaf840064, 0x8f4202d8, 0x24420001, 0xaf4202d8, 
-0x8f4202d8, 0x8f820064, 0x30420020, 0x14400005, 
-0x32c24000, 0x8c03012c, 0x8f420068, 0x1462fff2, 
-0x32c24000, 0x14400002, 0x3c020001, 0x2c2b025, 
-0x8f420000, 0x10400007, 0x0, 0xaf80004c, 
-0x8f82004c, 0x1040fffd, 0x0, 0x10000005, 
-0x0, 0xaf800048, 0x8f820048, 0x1040fffd, 
-0x0, 0x8f820060, 0x1000ffb4, 0x34420800, 
-0x30c20010, 0x1040002b, 0x24040010, 0x8c020124, 
-0xaf420058, 0xaf840064, 0x8f4202d4, 0x24420001, 
-0xaf4202d4, 0x8f4202d4, 0x8f820064, 0x30420010, 
-0x14400005, 0x32c22000, 0x8c030124, 0x8f420058, 
-0x1462fff2, 0x32c22000, 0x50400001, 0x36d68000, 
-0x8f420000, 0x10400007, 0x0, 0xaf80004c, 
-0x8f82004c, 0x1040fffd, 0x0, 0x10000005, 
-0x0, 0xaf800048, 0x8f820048, 0x1040fffd, 
-0x0, 0x8f820060, 0x34420100, 0xaf820060, 
-0x8f420000, 0x10400004, 0x0, 0xaf80004c, 
-0x10000072, 0x0, 0xaf800048, 0x1000006f, 
-0x0, 0x30c20001, 0x10400004, 0x24020001, 
-0xaf820064, 0x10000069, 0x0, 0x30c20002, 
-0x1440000c, 0x3c050003, 0x3c040001, 0x24847974, 
-0x34a50500, 0x3821, 0xafa00010, 0xc002d3b, 
-0xafa00014, 0x2402ffc0, 0xaf820064, 0x1000005b, 
-0x0, 0x8c05022c, 0x8c02010c, 0x10a2004c, 
-0x51080, 0x8c460300, 0x24a20001, 0x3045003f, 
-0x24020003, 0xac05022c, 0x61e02, 0x10620005, 
-0x24020010, 0x1062001e, 0x30c20fff, 0x1000003d, 
-0x0, 0x8f4302a8, 0x8f440000, 0x30c20fff, 
-0xaf420048, 0x24630001, 0xaf4302a8, 0x8f4202a8, 
-0x10800007, 0x0, 0xaf80004c, 0x8f82004c, 
-0x1040fffd, 0x0, 0x10000005, 0x0, 
-0xaf800048, 0x8f820048, 0x1040fffd, 0x0, 
-0x8f820060, 0x34420200, 0xaf820060, 0x8f420000, 
-0x10400021, 0x0, 0x1000001c, 0x0, 
-0xaf420058, 0x32c22000, 0x50400001, 0x36d68000, 
-0x8f4202d4, 0x8f430000, 0x24420001, 0xaf4202d4, 
-0x8f4202d4, 0x10600007, 0x0, 0xaf80004c, 
-0x8f82004c, 0x1040fffd, 0x0, 0x10000005, 
-0x0, 0xaf800048, 0x8f820048, 0x1040fffd, 
-0x0, 0x8f820060, 0x34420100, 0xaf820060, 
-0x8f420000, 0x10400004, 0x0, 0xaf80004c, 
-0x10000007, 0x0, 0xaf800048, 0x10000004, 
-0x0, 0xc0022ad, 0xc02021, 0x402821, 
-0x8c02010c, 0x14a20002, 0x24020002, 0xaf820064, 
-0x8f820064, 0x30420002, 0x14400004, 0x0, 
-0x8c02010c, 0x14a2ffa8, 0x0, 0x8fbf0018, 
-0x3e00008, 0x27bd0020, 0x3e00008, 0x0, 
-0x27bdffa0, 0xafb00040, 0x808021, 0x101602, 
-0x2442ffff, 0x304300ff, 0x2c620013, 0xafbf0058, 
-0xafbe0054, 0xafb50050, 0xafb3004c, 0xafb20048, 
-0xafb10044, 0x104001fe, 0xafa50034, 0x31080, 
-0x3c010001, 0x220821, 0x8c2279b8, 0x400008, 
-0x0, 0x101302, 0x30440fff, 0x24020001, 
-0x10820005, 0x24020002, 0x1082000c, 0x2402fffe, 
-0x10000025, 0x3c050003, 0x8f430004, 0x3c020002, 
-0x8c4287c0, 0xaf440200, 0xaf440204, 0x3c040002, 
-0x8c84873c, 0x10000009, 0x34630001, 0x8f430004, 
-0xaf440200, 0xaf440204, 0x3c040002, 0x8c84873c, 
-0x621824, 0x3c020001, 0x2442d68c, 0x21100, 
-0x21182, 0xaf430004, 0x3c030800, 0x431025, 
-0xac820038, 0x8f840054, 0x41442, 0x41c82, 
-0x431021, 0x41cc2, 0x431023, 0x41d02, 
-0x431021, 0x41d42, 0x431023, 0xaf420208, 
-0x10000009, 0x0, 0x3c040001, 0x24847980, 
-0x34a51000, 0x2003021, 0x3821, 0xafa00010, 
-0xc002d3b, 0xafa00014, 0x8f4202a0, 0x24420001, 
-0xaf4202a0, 0x8f4202a0, 0x10000228, 0x0, 
-0x27b00028, 0x2002021, 0x24050210, 0xc002dbf, 
-0x24060008, 0xc00263a, 0x2002021, 0x1000021f, 
-0x0, 0x8faa0034, 0x27a40028, 0xa1880, 
-0x25420001, 0x3042003f, 0xafa20034, 0x8c650300, 
-0x8faa0034, 0x21080, 0x8c430300, 0x25420001, 
-0x3042003f, 0xafa20034, 0xac02022c, 0xafa50028, 
-0xc00263a, 0xafa3002c, 0x1000020c, 0x0, 
-0x27b00028, 0x2002021, 0x24050210, 0xc002dbf, 
-0x24060008, 0xc002779, 0x2002021, 0x10000203, 
-0x0, 0x8faa0034, 0x27a40028, 0xa1880, 
-0x25420001, 0x3042003f, 0xafa20034, 0x8c650300, 
-0x8faa0034, 0x21080, 0x8c430300, 0x25420001, 
-0x3042003f, 0xafa20034, 0xac02022c, 0xafa50028, 
-0xc002779, 0xafa3002c, 0x100001f0, 0x0, 
-0x101302, 0x30430fff, 0x24020001, 0x10620005, 
-0x24020002, 0x1062001e, 0x3c020002, 0x10000033, 
-0x3c050003, 0x3c030002, 0x2c31024, 0x54400037, 
-0x2c3b025, 0x8f820228, 0x3c010001, 0x370821, 
-0xac2238d8, 0x8f82022c, 0x3c010001, 0x370821, 
-0xac2238dc, 0x8f820230, 0x3c010001, 0x370821, 
-0xac2238e0, 0x8f820234, 0x3c010001, 0x370821, 
-0xac2238e4, 0x2402ffff, 0xaf820228, 0xaf82022c, 
-0xaf820230, 0xaf820234, 0x10000020, 0x2c3b025, 
-0x2c21024, 0x10400012, 0x3c02fffd, 0x3c020001, 
-0x571021, 0x8c4238d8, 0xaf820228, 0x3c020001, 
-0x571021, 0x8c4238dc, 0xaf82022c, 0x3c020001, 
-0x571021, 0x8c4238e0, 0xaf820230, 0x3c020001, 
-0x571021, 0x8c4238e4, 0xaf820234, 0x3c02fffd, 
-0x3442ffff, 0x10000009, 0x2c2b024, 0x3c040001, 
-0x2484798c, 0x34a51100, 0x2003021, 0x3821, 
-0xafa00010, 0xc002d3b, 0xafa00014, 0x8f4202cc, 
-0x24420001, 0xaf4202cc, 0x8f4202cc, 0x100001a7, 
-0x0, 0x101302, 0x30450fff, 0x24020001, 
-0x10a20005, 0x24020002, 0x10a2000e, 0x3c0408ff, 
-0x10000016, 0x3c050003, 0x3c0208ff, 0x3442ffff, 
-0x8f830220, 0x3c040004, 0x2c4b025, 0x621824, 
-0x34630008, 0xaf830220, 0xaf450298, 0x10000013, 
-0x0, 0x3484fff7, 0x3c03fffb, 0x8f820220, 
-0x3463ffff, 0x2c3b024, 0x441024, 0xaf820220, 
-0xaf450298, 0x10000009, 0x0, 0x3c040001, 
-0x24847998, 0x34a51200, 0x2003021, 0x3821, 
-0xafa00010, 0xc002d3b, 0xafa00014, 0x8f4202bc, 
-0x24420001, 0xaf4202bc, 0x8f4202bc, 0x1000017b, 
-0x0, 0x27840208, 0x24050200, 0xc002dbf, 
-0x24060008, 0x27440224, 0x24050200, 0xc002dbf, 
-0x24060008, 0x8f4202c4, 0x24420001, 0xaf4202c4, 
-0x8f4202c4, 0x1000016d, 0x0, 0x101302, 
-0x30430fff, 0x24020001, 0x10620011, 0x28620002, 
-0x50400005, 0x24020002, 0x10600007, 0x0, 
-0x10000017, 0x0, 0x1062000f, 0x0, 
-0x10000013, 0x0, 0x8c060248, 0x2021, 
-0xc005738, 0x24050004, 0x10000007, 0x0, 
-0x8c060248, 0x2021, 0xc005738, 0x24050004, 
-0x10000010, 0x0, 0x8c06024c, 0x2021, 
-0xc005738, 0x24050001, 0x1000000a, 0x0, 
-0x3c040001, 0x248479a4, 0x3c050003, 0x34a51300, 
-0x2003021, 0x3821, 0xafa00010, 0xc002d3b, 
-0xafa00014, 0x8f4202c0, 0x24420001, 0xaf4202c0, 
-0x8f4202c0, 0x1000013d, 0x0, 0xc002548, 
-0x0, 0x10000139, 0x0, 0x24020001, 
-0xa34205c5, 0x24100100, 0x8f4401a8, 0x8f4501ac, 
-0xafb00010, 0xafa00014, 0x8f420014, 0xafa20018, 
-0x8f420108, 0x26e60028, 0x40f809, 0x24070400, 
-0x1040fff5, 0x0, 0x10000128, 0x0, 
-0x3c03ffff, 0x34637fff, 0x8f420368, 0x8f440360, 
-0x2c3b024, 0x1821, 0xaf400058, 0xaf40005c, 
-0xaf400060, 0xaf400064, 0x441023, 0xaf420368, 
-0x3c020900, 0xaf400360, 0xafa20020, 0x8f5e0018, 
-0x27aa0020, 0x240200ff, 0x13c20002, 0xafaa003c, 
-0x27c30001, 0x8c020228, 0x609021, 0x1642000e, 
-0x1e38c0, 0x8f42033c, 0x24420001, 0xaf42033c, 
-0x8f42033c, 0x8c020228, 0x3c040001, 0x2484793c, 
-0x3c050009, 0xafa00014, 0xafa20010, 0x8fa60020, 
-0x1000006b, 0x34a50500, 0xf71021, 0x8fa30020, 
-0x8fa40024, 0xac4304c0, 0xac4404c4, 0x8f830054, 
-0x8f820054, 0x247003e8, 0x2021023, 0x2c4203e9, 
-0x1040001b, 0x9821, 0xe08821, 0x263504c0, 
-0x8f440178, 0x8f45017c, 0x2201821, 0x240a0004, 
-0xafaa0010, 0xafb20014, 0x8f48000c, 0x1021, 
-0x2f53021, 0xafa80018, 0x8f48010c, 0x24070008, 
-0xa32821, 0xa3482b, 0x822021, 0x100f809, 
-0x892021, 0x54400006, 0x24130001, 0x8f820054, 
-0x2021023, 0x2c4203e9, 0x1440ffe9, 0x0, 
-0x326200ff, 0x54400017, 0xaf520018, 0x8f420378, 
-0x24420001, 0xaf420378, 0x8f420378, 0x8f820120, 
-0x8faa003c, 0xafa20010, 0x8f820124, 0x3c040001, 
-0x24847948, 0x3c050009, 0xafa20014, 0x8d460000, 
-0x10000033, 0x34a50600, 0x8f420308, 0x24130001, 
-0x24420001, 0xaf420308, 0x8f420308, 0x1000001c, 
-0x326200ff, 0x8f830054, 0x8f820054, 0x247003e8, 
-0x2021023, 0x2c4203e9, 0x10400014, 0x9821, 
-0x24110010, 0x8f42000c, 0x8f440160, 0x8f450164, 
-0x8f860120, 0xafb10010, 0xafb20014, 0xafa20018, 
-0x8f42010c, 0x24070008, 0x40f809, 0x24c6001c, 
-0x1440ffe5, 0x0, 0x8f820054, 0x2021023, 
-0x2c4203e9, 0x1440ffef, 0x0, 0x326200ff, 
-0x14400011, 0x0, 0x8f420378, 0x24420001, 
-0xaf420378, 0x8f420378, 0x8f820120, 0x8faa003c, 
-0xafa20010, 0x8f820124, 0x3c040001, 0x24847950, 
-0x3c050009, 0xafa20014, 0x8d460000, 0x34a50700, 
-0xc002d3b, 0x3c03821, 0x8f4202b0, 0x24420001, 
-0xaf4202b0, 0x8f4202b0, 0x8f4202f8, 0x24420001, 
-0xaf4202f8, 0x8f4202f8, 0x1000008c, 0x0, 
-0x8c02025c, 0x27440224, 0xaf4201f0, 0x8c020260, 
-0x24050200, 0x24060008, 0xaf4201f8, 0xc002dbf, 
-0x0, 0x8f820220, 0x30420008, 0x14400002, 
-0x24020001, 0x24020002, 0xaf420298, 0x8f4202ac, 
-0x24420001, 0xaf4202ac, 0x8f4202ac, 0x10000077, 
-0x0, 0x3c0200ff, 0x3442ffff, 0x2021824, 
-0x32c20180, 0x14400006, 0x3402fffb, 0x43102b, 
-0x14400003, 0x0, 0x1000006c, 0xaf4300bc, 
-0x3c040001, 0x248479b0, 0x3c050003, 0x34a51500, 
-0x2003021, 0x3821, 0xafa00010, 0xc002d3b, 
-0xafa00014, 0x3c020700, 0x34421000, 0x101e02, 
-0x621825, 0xafa30020, 0x8f510018, 0x240200ff, 
-0x12220002, 0x8021, 0x26300001, 0x8c020228, 
-0x1602000e, 0x1130c0, 0x8f42033c, 0x24420001, 
-0xaf42033c, 0x8f42033c, 0x8c020228, 0x3c040001, 
-0x24847924, 0x3c050009, 0xafa00014, 0xafa20010, 
-0x8fa60020, 0x1000003f, 0x34a50100, 0xd71021, 
-0x8fa30020, 0x8fa40024, 0xac4304c0, 0xac4404c4, 
-0xc01821, 0x8f440178, 0x8f45017c, 0x1021, 
-0x24070004, 0xafa70010, 0xafb00014, 0x8f48000c, 
-0x24c604c0, 0x2e63021, 0xafa80018, 0x8f48010c, 
-0x24070008, 0xa32821, 0xa3482b, 0x822021, 
-0x100f809, 0x892021, 0x1440000b, 0x24070008, 
-0x8f820120, 0xafa20010, 0x8f820124, 0x3c040001, 
-0x2484792c, 0x3c050009, 0xafa20014, 0x8fa60020, 
-0x1000001c, 0x34a50200, 0x8f440160, 0x8f450164, 
-0x8f43000c, 0xaf500018, 0x8f860120, 0x24020010, 
-0xafa20010, 0xafb00014, 0xafa30018, 0x8f42010c, 
-0x40f809, 0x24c6001c, 0x14400010, 0x0, 
-0x8f420340, 0x24420001, 0xaf420340, 0x8f420340, 
-0x8f820120, 0xafa20010, 0x8f820124, 0x3c040001, 
-0x24847934, 0x3c050009, 0xafa20014, 0x8fa60020, 
-0x34a50300, 0xc002d3b, 0x2203821, 0x8f4202e0, 
-0x24420001, 0xaf4202e0, 0x8f4202e0, 0x8f4202f0, 
-0x24420001, 0xaf4202f0, 0x8f4202f0, 0x8fa20034, 
-0x8fbf0058, 0x8fbe0054, 0x8fb50050, 0x8fb3004c, 
-0x8fb20048, 0x8fb10044, 0x8fb00040, 0x3e00008, 
-0x27bd0060, 0x27bdfff8, 0x2408ffff, 0x10a00014, 
-0x4821, 0x3c0aedb8, 0x354a8320, 0x90870000, 
-0x24840001, 0x3021, 0x1071026, 0x30420001, 
-0x10400002, 0x81842, 0x6a1826, 0x604021, 
-0x24c60001, 0x2cc20008, 0x1440fff7, 0x73842, 
-0x25290001, 0x125102b, 0x1440fff0, 0x0, 
-0x1001021, 0x3e00008, 0x27bd0008, 0x27bdffb0, 
-0xafbf0048, 0xafbe0044, 0xafb50040, 0xafb3003c, 
-0xafb20038, 0xafb10034, 0xafb00030, 0x8f870220, 
-0xafa70024, 0x8f870200, 0xafa7002c, 0x8f820220, 
-0x3c0308ff, 0x3463ffff, 0x431024, 0x34420004, 
-0xaf820220, 0x8f820200, 0x3c03c0ff, 0x3463ffff, 
-0x431024, 0x34420004, 0xaf820200, 0x8f530358, 
-0x8f55035c, 0x8f5e0360, 0x8f470364, 0xafa70014, 
-0x8f470368, 0xafa7001c, 0x8f4202d0, 0x274401c0, 
-0x24420001, 0xaf4202d0, 0x8f5002d0, 0x8f510204, 
-0x8f520200, 0xc002da8, 0x24050400, 0xaf530358, 
-0xaf55035c, 0xaf5e0360, 0x8fa70014, 0xaf470364, 
-0x8fa7001c, 0xaf470368, 0xaf5002d0, 0xaf510204, 
-0xaf520200, 0x8c02025c, 0x27440224, 0xaf4201f0, 
-0x8c020260, 0x24050200, 0x24060008, 0xaf4201f8, 
-0x24020006, 0xaf4201f4, 0xc002dbf, 0x0, 
-0x3c023b9a, 0x3442ca00, 0xaf4201fc, 0x240203e8, 
-0x24040002, 0x24030001, 0xaf420294, 0xaf440290, 
-0xaf43029c, 0x8f820220, 0x30420008, 0x10400004, 
-0x0, 0xaf430298, 0x10000003, 0x3021, 
-0xaf440298, 0x3021, 0x3c030002, 0x661821, 
-0x906385ec, 0x3461021, 0x24c60001, 0xa043022c, 
-0x2cc2000f, 0x1440fff8, 0x3461821, 0x24c60001, 
-0x8f820040, 0x24040080, 0x24050080, 0x21702, 
-0x24420030, 0xa062022c, 0x3461021, 0xa040022c, 
-0xc002da8, 0x0, 0x8fa70024, 0x30e20004, 
-0x14400006, 0x0, 0x8f820220, 0x3c0308ff, 
-0x3463fffb, 0x431024, 0xaf820220, 0x8fa7002c, 
-0x30e20004, 0x14400006, 0x0, 0x8f820200, 
-0x3c03c0ff, 0x3463fffb, 0x431024, 0xaf820200, 
-0x8fbf0048, 0x8fbe0044, 0x8fb50040, 0x8fb3003c, 
-0x8fb20038, 0x8fb10034, 0x8fb00030, 0x3e00008, 
-0x27bd0050, 0xaf400104, 0x24040001, 0x410c0, 
-0x2e21821, 0x24820001, 0x3c010001, 0x230821, 
-0xa42234d0, 0x402021, 0x2c820080, 0x1440fff8, 
-0x410c0, 0x24020001, 0x3c010001, 0x370821, 
-0xa42038d0, 0xaf420100, 0xaf800228, 0xaf80022c, 
-0xaf800230, 0xaf800234, 0x3e00008, 0x0, 
-0x27bdffe8, 0xafbf0014, 0xafb00010, 0x8f420104, 
-0x28420005, 0x10400026, 0x808021, 0x3c020001, 
-0x8f430104, 0x344230d0, 0x2e23021, 0x318c0, 
-0x621821, 0x2e33821, 0xc7102b, 0x10400015, 
-0x1021, 0x96080000, 0x24c40006, 0x9482fffc, 
-0x14480009, 0x2821, 0x9483fffe, 0x96020002, 
-0x14620006, 0xa01021, 0x94820000, 0x96030004, 
-0x431026, 0x2c450001, 0xa01021, 0x1440000a, 
-0x24c60008, 0xc7102b, 0x1440fff0, 0x24840008, 
-0x1021, 0x304200ff, 0x14400030, 0x24020001, 
-0x1000002e, 0x1021, 0x1000fffa, 0x24020001, 
-0x2002021, 0xc00252e, 0x24050006, 0x3042007f, 
-0x218c0, 0x2e31021, 0x3c010001, 0x220821, 
-0x942230d0, 0x1040fff2, 0x2e31021, 0x3c060001, 
-0xc23021, 0x94c630d0, 0x10c0ffed, 0x3c080001, 
-0x350834d2, 0x96070000, 0x610c0, 0x572021, 
-0x882021, 0x94820000, 0x14470009, 0x2821, 
-0x94830002, 0x96020002, 0x14620006, 0xa01021, 
-0x94820004, 0x96030004, 0x431026, 0x2c450001, 
-0xa01021, 0x14400007, 0x610c0, 0x2e21021, 
-0x3c060001, 0xc23021, 0x94c634d0, 0x14c0ffeb, 
-0x610c0, 0x10c0ffd2, 0x24020001, 0x8fbf0014, 
-0x8fb00010, 0x3e00008, 0x27bd0018, 0x3e00008, 
-0x0, 0x27bdffb0, 0x801021, 0xafb00030, 
-0x24500002, 0x2002021, 0x24050006, 0xafb10034, 
-0x408821, 0xafbf0048, 0xafbe0044, 0xafb50040, 
-0xafb3003c, 0xc00252e, 0xafb20038, 0x3047007f, 
-0x710c0, 0x2e21021, 0x3c050001, 0xa22821, 
-0x94a530d0, 0x50a0001c, 0xa03021, 0x3c090001, 
-0x352934d2, 0x96280002, 0x510c0, 0x572021, 
-0x892021, 0x94820000, 0x14480009, 0x3021, 
-0x94830002, 0x96020002, 0x14620006, 0xc01021, 
-0x94820004, 0x96030004, 0x431026, 0x2c460001, 
-0xc01021, 0x14400007, 0x510c0, 0x2e21021, 
-0x3c050001, 0xa22821, 0x94a534d0, 0x14a0ffeb, 
-0x510c0, 0xa03021, 0x10c00014, 0x610c0, 
-0x571821, 0x3c010001, 0x230821, 0x8c2334d0, 
-0x571021, 0xafa30010, 0x3c010001, 0x220821, 
-0x8c2234d4, 0x3c040001, 0x24847ab8, 0xafa20014, 
-0x8e260000, 0x8e270004, 0x3c050004, 0xc002d3b, 
-0x34a50400, 0x10000063, 0x3c020800, 0x8f450100, 
-0x10a00006, 0x510c0, 0x2e21021, 0x3c010001, 
-0x220821, 0x942234d0, 0xaf420100, 0xa03021, 
-0x14c00011, 0x628c0, 0x710c0, 0x2e21021, 
-0xafa70010, 0x3c010001, 0x220821, 0x942230d0, 
-0x3c040001, 0x24847ac4, 0xafa20014, 0x8e260000, 
-0x8e270004, 0x3c050004, 0xc002d3b, 0x34a50500, 
-0x10000048, 0x3c020800, 0xb71821, 0x3c020001, 
-0x96040000, 0x344234d2, 0x621821, 0xa4640000, 
-0x8e020002, 0x720c0, 0xac620002, 0x2e41021, 
-0x3c030001, 0x621821, 0x946330d0, 0x2e51021, 
-0x3c010001, 0x220821, 0xa42334d0, 0x2e41021, 
-0x3c010001, 0x220821, 0xa42630d0, 0x8f420104, 
-0x24420001, 0x28420080, 0x1040000f, 0x3c020002, 
-0x8f420104, 0x3c040001, 0x348430d2, 0x96030000, 
-0x210c0, 0x571021, 0x441021, 0xa4430000, 
-0x8e030002, 0xac430002, 0x8f420104, 0x24420001, 
-0xaf420104, 0x3c020002, 0x2c21024, 0x10400011, 
-0x72142, 0x3c030001, 0x346338d8, 0x24020003, 
-0x441023, 0x21080, 0x572021, 0x832021, 
-0x571021, 0x431021, 0x30e5001f, 0x8c430000, 
-0x24020001, 0xa21004, 0x621825, 0x1000000c, 
-0xac830000, 0x24020003, 0x441023, 0x21080, 
-0x5c2821, 0x5c1021, 0x30e4001f, 0x8c430228, 
-0x24020001, 0x821004, 0x621825, 0xaca30228, 
-0x3c020800, 0x34421000, 0x1821, 0xafa20020, 
-0x8f5e0018, 0x27aa0020, 0x240200ff, 0x13c20002, 
-0xafaa002c, 0x27c30001, 0x8c020228, 0x609021, 
-0x1642000e, 0x1e38c0, 0x8f42033c, 0x24420001, 
-0xaf42033c, 0x8f42033c, 0x8c020228, 0x3c040001, 
-0x24847a80, 0x3c050009, 0xafa00014, 0xafa20010, 
-0x8fa60020, 0x1000006b, 0x34a50500, 0xf71021, 
-0x8fa30020, 0x8fa40024, 0xac4304c0, 0xac4404c4, 
-0x8f830054, 0x8f820054, 0x247003e8, 0x2021023, 
-0x2c4203e9, 0x1040001b, 0x9821, 0xe08821, 
-0x263504c0, 0x8f440178, 0x8f45017c, 0x2201821, 
-0x240a0004, 0xafaa0010, 0xafb20014, 0x8f48000c, 
-0x1021, 0x2f53021, 0xafa80018, 0x8f48010c, 
-0x24070008, 0xa32821, 0xa3482b, 0x822021, 
-0x100f809, 0x892021, 0x54400006, 0x24130001, 
-0x8f820054, 0x2021023, 0x2c4203e9, 0x1440ffe9, 
-0x0, 0x326200ff, 0x54400017, 0xaf520018, 
-0x8f420378, 0x24420001, 0xaf420378, 0x8f420378, 
-0x8f820120, 0x8faa002c, 0xafa20010, 0x8f820124, 
-0x3c040001, 0x24847a8c, 0x3c050009, 0xafa20014, 
-0x8d460000, 0x10000033, 0x34a50600, 0x8f420308, 
-0x24130001, 0x24420001, 0xaf420308, 0x8f420308, 
-0x1000001c, 0x326200ff, 0x8f830054, 0x8f820054, 
-0x247003e8, 0x2021023, 0x2c4203e9, 0x10400014, 
-0x9821, 0x24110010, 0x8f42000c, 0x8f440160, 
-0x8f450164, 0x8f860120, 0xafb10010, 0xafb20014, 
-0xafa20018, 0x8f42010c, 0x24070008, 0x40f809, 
-0x24c6001c, 0x1440ffe5, 0x0, 0x8f820054, 
-0x2021023, 0x2c4203e9, 0x1440ffef, 0x0, 
-0x326200ff, 0x14400011, 0x0, 0x8f420378, 
-0x24420001, 0xaf420378, 0x8f420378, 0x8f820120, 
-0x8faa002c, 0xafa20010, 0x8f820124, 0x3c040001, 
-0x24847a94, 0x3c050009, 0xafa20014, 0x8d460000, 
-0x34a50700, 0xc002d3b, 0x3c03821, 0x8f4202b4, 
-0x24420001, 0xaf4202b4, 0x8f4202b4, 0x8f4202f4, 
-0x24420001, 0xaf4202f4, 0x8f4202f4, 0x8fbf0048, 
-0x8fbe0044, 0x8fb50040, 0x8fb3003c, 0x8fb20038, 
-0x8fb10034, 0x8fb00030, 0x3e00008, 0x27bd0050, 
-0x27bdffa0, 0x801021, 0xafb00040, 0x24500002, 
-0x2002021, 0x24050006, 0xafb10044, 0x408821, 
-0xafbf0058, 0xafbe0054, 0xafb50050, 0xafb3004c, 
-0xc00252e, 0xafb20048, 0x3048007f, 0x810c0, 
-0x2e21021, 0x3c060001, 0xc23021, 0x94c630d0, 
-0x10c0001c, 0x3821, 0x3c0a0001, 0x354a34d2, 
-0x96290002, 0x610c0, 0x572021, 0x8a2021, 
-0x94820000, 0x14490009, 0x2821, 0x94830002, 
-0x96020002, 0x14620006, 0xa01021, 0x94820004, 
-0x96030004, 0x431026, 0x2c450001, 0xa01021, 
-0x14400008, 0x610c0, 0xc03821, 0x2e21021, 
-0x3c060001, 0xc23021, 0x94c634d0, 0x14c0ffea, 
-0x610c0, 0x14c00011, 0xafa70028, 0x810c0, 
-0x2e21021, 0xafa80010, 0x3c010001, 0x220821, 
-0x942230d0, 0x3c040001, 0x24847ad0, 0xafa20014, 
-0x8e260000, 0x8e270004, 0x3c050004, 0xc002d3b, 
-0x34a50900, 0x10000075, 0x3c020800, 0x10e0000c, 
-0x610c0, 0x2e21021, 0x3c030001, 0x621821, 
-0x946334d0, 0x710c0, 0x2e21021, 0x3c010001, 
-0x220821, 0xa42334d0, 0x1000000b, 0x3c040001, 
-0x2e21021, 0x3c030001, 0x621821, 0x946334d0, 
-0x810c0, 0x2e21021, 0x3c010001, 0x220821, 
-0xa42330d0, 0x3c040001, 0x348430d0, 0x8f430100, 
-0x610c0, 0x2e21021, 0x3c010001, 0x220821, 
-0xa42334d0, 0x8f420104, 0x2e43821, 0x2821, 
-0x18400029, 0xaf460100, 0x24e60006, 0x94c3fffc, 
-0x96020000, 0x14620009, 0x2021, 0x94c3fffe, 
-0x96020002, 0x14620006, 0x801021, 0x94c20000, 
-0x96030004, 0x431026, 0x2c440001, 0x801021, 
-0x50400014, 0x24a50001, 0x8f420104, 0x2442ffff, 
-0xa2102a, 0x1040000b, 0x24e40004, 0x94820006, 
-0x8c830008, 0xa482fffe, 0xac830000, 0x8f420104, 
-0x24a50001, 0x2442ffff, 0xa2102a, 0x1440fff7, 
-0x24840008, 0x8f420104, 0x2442ffff, 0x10000006, 
-0xaf420104, 0x8f420104, 0x24c60008, 0xa2102a, 
-0x1440ffda, 0x24e70008, 0x810c0, 0x2e21021, 
-0x3c010001, 0x220821, 0x942230d0, 0x14400023, 
-0x3c020800, 0x3c020002, 0x2c21024, 0x10400012, 
-0x82142, 0x3c030001, 0x346338d8, 0x24020003, 
-0x441023, 0x21080, 0x572021, 0x832021, 
-0x571021, 0x431021, 0x3105001f, 0x24030001, 
-0x8c420000, 0xa31804, 0x31827, 0x431024, 
-0x1000000d, 0xac820000, 0x24020003, 0x441023, 
-0x21080, 0x5c2821, 0x5c1021, 0x3104001f, 
-0x24030001, 0x8c420228, 0x831804, 0x31827, 
-0x431024, 0xaca20228, 0x3c020800, 0x34422000, 
-0x1821, 0xafa20020, 0x8f5e0018, 0x27ab0020, 
-0x240200ff, 0x13c20002, 0xafab0034, 0x27c30001, 
-0x8c020228, 0x609021, 0x1642000e, 0x1e38c0, 
-0x8f42033c, 0x24420001, 0xaf42033c, 0x8f42033c, 
-0x8c020228, 0x3c040001, 0x24847a80, 0x3c050009, 
-0xafa00014, 0xafa20010, 0x8fa60020, 0x1000006b, 
-0x34a50500, 0xf71021, 0x8fa30020, 0x8fa40024, 
-0xac4304c0, 0xac4404c4, 0x8f830054, 0x8f820054, 
-0x247003e8, 0x2021023, 0x2c4203e9, 0x1040001b, 
-0x9821, 0xe08821, 0x263504c0, 0x8f440178, 
-0x8f45017c, 0x2201821, 0x240b0004, 0xafab0010, 
-0xafb20014, 0x8f48000c, 0x1021, 0x2f53021, 
-0xafa80018, 0x8f48010c, 0x24070008, 0xa32821, 
-0xa3482b, 0x822021, 0x100f809, 0x892021, 
-0x54400006, 0x24130001, 0x8f820054, 0x2021023, 
-0x2c4203e9, 0x1440ffe9, 0x0, 0x326200ff, 
-0x54400017, 0xaf520018, 0x8f420378, 0x24420001, 
-0xaf420378, 0x8f420378, 0x8f820120, 0x8fab0034, 
-0xafa20010, 0x8f820124, 0x3c040001, 0x24847a8c, 
-0x3c050009, 0xafa20014, 0x8d660000, 0x10000033, 
-0x34a50600, 0x8f420308, 0x24130001, 0x24420001, 
-0xaf420308, 0x8f420308, 0x1000001c, 0x326200ff, 
-0x8f830054, 0x8f820054, 0x247003e8, 0x2021023, 
-0x2c4203e9, 0x10400014, 0x9821, 0x24110010, 
-0x8f42000c, 0x8f440160, 0x8f450164, 0x8f860120, 
-0xafb10010, 0xafb20014, 0xafa20018, 0x8f42010c, 
-0x24070008, 0x40f809, 0x24c6001c, 0x1440ffe5, 
-0x0, 0x8f820054, 0x2021023, 0x2c4203e9, 
-0x1440ffef, 0x0, 0x326200ff, 0x14400011, 
-0x0, 0x8f420378, 0x24420001, 0xaf420378, 
-0x8f420378, 0x8f820120, 0x8fab0034, 0xafa20010, 
-0x8f820124, 0x3c040001, 0x24847a94, 0x3c050009, 
-0xafa20014, 0x8d660000, 0x34a50700, 0xc002d3b, 
-0x3c03821, 0x8f4202b8, 0x24420001, 0xaf4202b8, 
-0x8f4202b8, 0x8f4202f4, 0x24420001, 0xaf4202f4, 
-0x8f4202f4, 0x8fbf0058, 0x8fbe0054, 0x8fb50050, 
-0x8fb3004c, 0x8fb20048, 0x8fb10044, 0x8fb00040, 
-0x3e00008, 0x27bd0060, 0x27bdffe0, 0x27644000, 
-0xafbf0018, 0xc002da8, 0x24051000, 0x3c030001, 
-0x34632cc0, 0x3c040001, 0x34842ec8, 0x24020020, 
-0xaf82011c, 0x2e31021, 0xaf800100, 0xaf800104, 
-0xaf800108, 0xaf800110, 0xaf800114, 0xaf800118, 
-0xaf800120, 0xaf800124, 0xaf800128, 0xaf800130, 
-0xaf800134, 0xaf800138, 0xaf4200ec, 0x2e31021, 
-0xaf4200f0, 0x2e41021, 0xaf4200f4, 0x2e41021, 
-0xaf4200f8, 0x3c020001, 0x571021, 0x904240f4, 
-0x1440001c, 0x3c050001, 0x8f82011c, 0x3c040001, 
-0x24847b8c, 0x3c050001, 0x34420001, 0xaf82011c, 
-0xafa00010, 0xafa00014, 0x8f86011c, 0x34a50100, 
-0xc002d3b, 0x3821, 0x8c020218, 0x30420040, 
-0x10400014, 0x0, 0x8f82011c, 0x3c040001, 
-0x24847b98, 0x3c050001, 0x34420004, 0xaf82011c, 
-0xafa00010, 0xafa00014, 0x8f86011c, 0x10000007, 
-0x34a50200, 0x3c040001, 0x24847ba0, 0xafa00010, 
-0xafa00014, 0x8f86011c, 0x34a50300, 0xc002d3b, 
-0x3821, 0x8fbf0018, 0x3e00008, 0x27bd0020, 
-0x27bdffd8, 0xafb1001c, 0x8fb10038, 0xafbf0020, 
-0xafb00018, 0x8f83012c, 0x8fa9003c, 0x8faa0040, 
-0x1060000a, 0x27624fe0, 0x14620002, 0x24680020, 
-0x27684800, 0x8f820128, 0x11020004, 0x0, 
-0x8f820124, 0x15020008, 0x0, 0x8f430334, 
-0x1021, 0x24630001, 0xaf430334, 0x8f430334, 
-0x10000052, 0x0, 0xac640000, 0xac650004, 
-0xac660008, 0xa467000e, 0xac710018, 0xac69001c, 
-0xac6a0010, 0xac620014, 0xaf880120, 0x8f4200fc, 
-0x8f5000f4, 0x2442ffff, 0xaf4200fc, 0x8e020000, 
-0x10510005, 0x3042ff8f, 0x10400019, 0x3222ff8f, 
-0x10400018, 0x3c020001, 0x8e030004, 0x2c620010, 
-0x10400013, 0x3c020001, 0x24630001, 0xae030004, 
-0x8f4300f8, 0x344230c8, 0x2e21021, 0x54620004, 
-0x24620008, 0x3c020001, 0x34422ec8, 0x2e21021, 
-0x1450002e, 0x24020001, 0x8f820128, 0x24420020, 
-0xaf820128, 0x8f820128, 0x10000028, 0x24020001, 
-0x3c020001, 0x344230c8, 0x2e21021, 0x16020004, 
-0x26030008, 0x3c020001, 0x34422ec8, 0x2e21821, 
-0x8f4200f8, 0x608021, 0x12020004, 0xaf5000f4, 
-0x8e020000, 0x10400016, 0x24020001, 0x24020170, 
-0x3c040001, 0x24847ba8, 0xafa20010, 0xafa00014, 
-0x8f860144, 0x3c070001, 0x24e77bb0, 0xc002d3b, 
-0x3405dead, 0x8f82011c, 0x34420002, 0xaf82011c, 
-0x8f820220, 0x34420004, 0xaf820220, 0x8f820140, 
-0x3c030001, 0x431025, 0xaf820140, 0x24020001, 
-0xae110000, 0xae020004, 0x24020001, 0x8fbf0020, 
-0x8fb1001c, 0x8fb00018, 0x3e00008, 0x27bd0028, 
-0x3e00008, 0x0, 0x27bdffc8, 0xafb30024, 
-0xafb20020, 0x809021, 0xa09821, 0xafb50028, 
-0xc0a821, 0xafbf0030, 0xafbe002c, 0xafb1001c, 
-0xafb00018, 0x8f900120, 0x27624fe0, 0x16020003, 
-0xe0f021, 0x10000002, 0x27714800, 0x26110020, 
-0x8f820128, 0x16220008, 0x0, 0x8f430334, 
-0x1021, 0x24630001, 0xaf430334, 0x8f430334, 
-0x10000028, 0x0, 0x8f820124, 0x16220014, 
-0x240201ab, 0x3c040001, 0x24847ba8, 0xafa20010, 
-0xafa00014, 0x8f860144, 0x3c070001, 0x24e77bb0, 
-0xc002d3b, 0x3405dead, 0x8f82011c, 0x34420002, 
-0xaf82011c, 0x8f820220, 0x34420004, 0xaf820220, 
-0x8f820140, 0x3c030001, 0x431025, 0xaf820140, 
-0xae120000, 0xae130004, 0xae150008, 0xa61e000e, 
-0x8fa80048, 0xae080018, 0x8fa8004c, 0x26020016, 
-0xae08001c, 0xae020014, 0x8fa80050, 0xae080010, 
-0xaf910120, 0x8f4300fc, 0x24020001, 0x2463ffff, 
-0xaf4300fc, 0x8fbf0030, 0x8fbe002c, 0x8fb50028, 
-0x8fb30024, 0x8fb20020, 0x8fb1001c, 0x8fb00018, 
-0x3e00008, 0x27bd0038, 0x3e00008, 0x0, 
-0x27bdffd8, 0xafb1001c, 0x8fb10038, 0xafbf0020, 
-0xafb00018, 0x8f83010c, 0x8fa9003c, 0x8faa0040, 
-0x1060000a, 0x276247e0, 0x14620002, 0x24680020, 
-0x27684000, 0x8f820108, 0x11020004, 0x0, 
-0x8f820104, 0x15020008, 0x0, 0x8f430338, 
-0x1021, 0x24630001, 0xaf430338, 0x8f430338, 
-0x1000004e, 0x0, 0xac640000, 0xac650004, 
-0xac660008, 0xa467000e, 0xac710018, 0xac69001c, 
-0xac6a0010, 0xac620014, 0xaf880100, 0x8f5000ec, 
-0x8e020000, 0x30420006, 0x10400019, 0x32220006, 
-0x10400018, 0x3c020001, 0x8e030004, 0x2c620010, 
-0x10400013, 0x3c020001, 0x24630001, 0xae030004, 
-0x8f4300f0, 0x34422ec0, 0x2e21021, 0x54620004, 
-0x24620008, 0x3c020001, 0x34422cc0, 0x2e21021, 
-0x1450002e, 0x24020001, 0x8f820108, 0x24420020, 
-0xaf820108, 0x8f820108, 0x10000028, 0x24020001, 
-0x3c020001, 0x34422ec0, 0x2e21021, 0x16020004, 
-0x26030008, 0x3c020001, 0x34422cc0, 0x2e21821, 
-0x8f4200f0, 0x608021, 0x12020004, 0xaf5000ec, 
-0x8e020000, 0x10400016, 0x24020001, 0x24020212, 
-0x3c040001, 0x24847ba8, 0xafa20010, 0xafa00014, 
-0x8f860144, 0x3c070001, 0x24e77bb0, 0xc002d3b, 
-0x3405dead, 0x8f82011c, 0x34420002, 0xaf82011c, 
-0x8f820220, 0x34420004, 0xaf820220, 0x8f820140, 
-0x3c030001, 0x431025, 0xaf820140, 0x24020001, 
-0xae110000, 0xae020004, 0x24020001, 0x8fbf0020, 
-0x8fb1001c, 0x8fb00018, 0x3e00008, 0x27bd0028, 
-0x3e00008, 0x0, 0x27bdffc8, 0xafb30024, 
-0xafb20020, 0x809021, 0xa09821, 0xafb50028, 
-0xc0a821, 0xafbf0030, 0xafbe002c, 0xafb1001c, 
-0xafb00018, 0x8f900100, 0x276247e0, 0x16020003, 
-0xe0f021, 0x10000002, 0x27714000, 0x26110020, 
-0x8f820108, 0x16220008, 0x0, 0x8f430338, 
-0x1021, 0x24630001, 0xaf430338, 0x8f430338, 
-0x10000025, 0x0, 0x8f820104, 0x16220014, 
-0x2402024d, 0x3c040001, 0x24847ba8, 0xafa20010, 
-0xafa00014, 0x8f860144, 0x3c070001, 0x24e77bb0, 
-0xc002d3b, 0x3405dead, 0x8f82011c, 0x34420002, 
-0xaf82011c, 0x8f820220, 0x34420004, 0xaf820220, 
-0x8f820140, 0x3c030001, 0x431025, 0xaf820140, 
-0xae120000, 0xae130004, 0xae150008, 0xa61e000e, 
-0x8fa80048, 0xae080018, 0x8fa8004c, 0x26030016, 
-0xae08001c, 0xae030014, 0x8fa80050, 0x24020001, 
-0xae080010, 0xaf910100, 0x8fbf0030, 0x8fbe002c, 
-0x8fb50028, 0x8fb30024, 0x8fb20020, 0x8fb1001c, 
-0x8fb00018, 0x3e00008, 0x27bd0038, 0x3e00008, 
-0x0, 0x27bdffd8, 0x3c040001, 0x24847bb8, 
-0x3c050001, 0xafbf0024, 0xafb20020, 0xafb1001c, 
-0xafb00018, 0x8f900104, 0x8f9100b0, 0x8f92011c, 
-0x34a52500, 0x8f820100, 0x2403021, 0x2203821, 
-0xafa20010, 0xc002d3b, 0xafb00014, 0x8e020008, 
-0xafa20010, 0x8e02000c, 0x3c040001, 0x24847bc4, 
-0xafa20014, 0x8e060000, 0x8e070004, 0x3c050001, 
-0xc002d3b, 0x34a52510, 0x8e020018, 0xafa20010, 
-0x8e02001c, 0x3c040001, 0x24847bd0, 0xafa20014, 
-0x8e060010, 0x8e070014, 0x3c050001, 0xc002d3b, 
-0x34a52520, 0x3c027f00, 0x2221024, 0x3c030800, 
-0x54430016, 0x3c030200, 0x8f82009c, 0x3042ffff, 
-0x14400012, 0x3c030200, 0x3c040001, 0x24847bdc, 
-0x3c050002, 0x34a5f030, 0x3021, 0x3821, 
-0x36420002, 0xaf82011c, 0x36220001, 0xaf8200b0, 
-0xaf900104, 0xaf92011c, 0xafa00010, 0xc002d3b, 
-0xafa00014, 0x10000025, 0x0, 0x2c31024, 
-0x1040000e, 0x2231024, 0x1040000c, 0x36420002, 
-0xaf82011c, 0x36220001, 0xaf8200b0, 0xaf900104, 
-0xaf92011c, 0x8f420330, 0x24420001, 0xaf420330, 
-0x8f420330, 0x10000015, 0x0, 0x3c040001, 
-0x24847ba8, 0x240202a9, 0xafa20010, 0xafa00014, 
-0x8f860144, 0x3c070001, 0x24e77bb0, 0xc002d3b, 
-0x3405dead, 0x8f82011c, 0x34420002, 0xaf82011c, 
-0x8f820220, 0x34420004, 0xaf820220, 0x8f820140, 
-0x3c030001, 0x431025, 0xaf820140, 0x8fbf0024, 
-0x8fb20020, 0x8fb1001c, 0x8fb00018, 0x3e00008, 
-0x27bd0028, 0x27bdffd8, 0x3c040001, 0x24847be4, 
-0x3c050001, 0xafbf0024, 0xafb20020, 0xafb1001c, 
-0xafb00018, 0x8f900124, 0x8f9100a0, 0x8f92011c, 
-0x34a52600, 0x8f820120, 0x2403021, 0x2203821, 
-0xafa20010, 0xc002d3b, 0xafb00014, 0x8e020008, 
-0xafa20010, 0x8e02000c, 0x3c040001, 0x24847bf0, 
-0xafa20014, 0x8e060000, 0x8e070004, 0x3c050001, 
-0xc002d3b, 0x34a52610, 0x8e020018, 0xafa20010, 
-0x8e02001c, 0x3c040001, 0x24847bfc, 0xafa20014, 
-0x8e060010, 0x8e070014, 0x3c050001, 0xc002d3b, 
-0x34a52620, 0x3c027f00, 0x2221024, 0x3c030800, 
-0x54430016, 0x3c030200, 0x8f8200ac, 0x3042ffff, 
-0x14400012, 0x3c030200, 0x3c040001, 0x24847c08, 
-0x3c050001, 0x34a5f030, 0x3021, 0x3821, 
-0x36420002, 0xaf82011c, 0x36220001, 0xaf8200a0, 
-0xaf900124, 0xaf92011c, 0xafa00010, 0xc002d3b, 
-0xafa00014, 0x10000025, 0x0, 0x2c31024, 
-0x1040000e, 0x2231024, 0x1040000c, 0x36420002, 
-0xaf82011c, 0x36220001, 0xaf8200a0, 0xaf900124, 
-0xaf92011c, 0x8f42032c, 0x24420001, 0xaf42032c, 
-0x8f42032c, 0x10000015, 0x0, 0x3c040001, 
-0x24847ba8, 0x240202e2, 0xafa20010, 0xafa00014, 
-0x8f860144, 0x3c070001, 0x24e77bb0, 0xc002d3b, 
-0x3405dead, 0x8f82011c, 0x34420002, 0xaf82011c, 
-0x8f820220, 0x34420004, 0xaf820220, 0x8f820140, 
-0x3c030001, 0x431025, 0xaf820140, 0x8fbf0024, 
-0x8fb20020, 0x8fb1001c, 0x8fb00018, 0x3e00008, 
-0x27bd0028, 0x6021, 0x5021, 0x3021, 
-0x2821, 0x6821, 0x4821, 0x7821, 
-0x7021, 0x8f880124, 0x8f870104, 0x8f8b011c, 
-0x1580002e, 0x0, 0x11a00014, 0x31620800, 
-0x8f820120, 0x10460029, 0x0, 0x3c040002, 
-0x8c8487a0, 0x8cc20000, 0x8cc30004, 0xac820000, 
-0xac830004, 0x8cc20008, 0xac820008, 0x94c2000e, 
-0xa482000e, 0x8cc20010, 0x240c0001, 0xac820010, 
-0x8cc20014, 0x10000012, 0x24c60020, 0x10400017, 
-0x0, 0x3c040002, 0x8c8487a0, 0x8d020000, 
-0x8d030004, 0xac820000, 0xac830004, 0x8d020008, 
-0xac820008, 0x9502000e, 0xa482000e, 0x8d020010, 
-0x25060020, 0xac820010, 0x8d020014, 0x240c0001, 
-0xc01821, 0xac820014, 0x27624fe0, 0x43102b, 
-0x54400001, 0x27634800, 0x603021, 0x1540002f, 
-0x31620100, 0x11200014, 0x31628000, 0x8f820100, 
-0x1045002a, 0x31620100, 0x3c040002, 0x8c84879c, 
-0x8ca20000, 0x8ca30004, 0xac820000, 0xac830004, 
-0x8ca20008, 0xac820008, 0x94a2000e, 0xa482000e, 
-0x8ca20010, 0x240a0001, 0xac820010, 0x8ca20014, 
-0x10000012, 0x24a50020, 0x10400018, 0x31620100, 
-0x3c040002, 0x8c84879c, 0x8ce20000, 0x8ce30004, 
-0xac820000, 0xac830004, 0x8ce20008, 0xac820008, 
-0x94e2000e, 0xa482000e, 0x8ce20010, 0x24e50020, 
-0xac820010, 0x8ce20014, 0x240a0001, 0xa01821, 
-0xac820014, 0x276247e0, 0x43102b, 0x54400001, 
-0x27634000, 0x602821, 0x31620100, 0x5440001d, 
-0x31621000, 0x11a00009, 0x31a20800, 0x10400004, 
-0x25020020, 0x8f8200a8, 0xa5e20000, 0x25020020, 
-0xaf820124, 0x8f880124, 0x6821, 0x11800011, 
-0x31621000, 0x3c040002, 0x8c8487a0, 0x8c820000, 
-0x8c830004, 0xaf820080, 0xaf830084, 0x8c820008, 
-0xaf8200a4, 0x9482000e, 0xaf8200ac, 0x8c820010, 
-0x6021, 0xaf8200a0, 0x8c8d0010, 0x8c8f0014, 
-0x31621000, 0x1440ff81, 0x0, 0x1120000f, 
-0x31220800, 0x10400004, 0x3c020002, 0x8f8200b8, 
-0xa5c20000, 0x3c020002, 0x1221024, 0x10400004, 
-0x24e20020, 0x8f8200b4, 0xaf8200d4, 0x24e20020, 
-0xaf820104, 0x8f870104, 0x4821, 0x1140ff6f, 
-0x0, 0x3c040002, 0x8c84879c, 0x8c820000, 
-0x8c830004, 0xaf820090, 0xaf830094, 0x8c820008, 
-0xaf8200b4, 0x9482000e, 0xaf82009c, 0x8c820010, 
-0x5021, 0xaf8200b0, 0x8c890010, 0x8c8e0014, 
-0x1000ff5e, 0x0, 0x3e00008, 0x0, 
-0x6021, 0x5821, 0x3021, 0x2821, 
-0x6821, 0x5021, 0x7821, 0x7021, 
-0x8f880124, 0x8f870104, 0x3c180100, 0x8f89011c, 
-0x1580002e, 0x0, 0x11a00014, 0x31220800, 
-0x8f820120, 0x10460029, 0x0, 0x3c040002, 
-0x8c8487a0, 0x8cc20000, 0x8cc30004, 0xac820000, 
-0xac830004, 0x8cc20008, 0xac820008, 0x94c2000e, 
-0xa482000e, 0x8cc20010, 0x240c0001, 0xac820010, 
-0x8cc20014, 0x10000012, 0x24c60020, 0x10400017, 
-0x0, 0x3c040002, 0x8c8487a0, 0x8d020000, 
-0x8d030004, 0xac820000, 0xac830004, 0x8d020008, 
-0xac820008, 0x9502000e, 0xa482000e, 0x8d020010, 
-0x25060020, 0xac820010, 0x8d020014, 0x240c0001, 
-0xc01821, 0xac820014, 0x27624fe0, 0x43102b, 
-0x54400001, 0x27634800, 0x603021, 0x1560002f, 
-0x31220100, 0x11400014, 0x31228000, 0x8f820100, 
-0x1045002a, 0x31220100, 0x3c040002, 0x8c84879c, 
-0x8ca20000, 0x8ca30004, 0xac820000, 0xac830004, 
-0x8ca20008, 0xac820008, 0x94a2000e, 0xa482000e, 
-0x8ca20010, 0x240b0001, 0xac820010, 0x8ca20014, 
-0x10000012, 0x24a50020, 0x10400018, 0x31220100, 
-0x3c040002, 0x8c84879c, 0x8ce20000, 0x8ce30004, 
-0xac820000, 0xac830004, 0x8ce20008, 0xac820008, 
-0x94e2000e, 0xa482000e, 0x8ce20010, 0x24e50020, 
-0xac820010, 0x8ce20014, 0x240b0001, 0xa01821, 
-0xac820014, 0x276247e0, 0x43102b, 0x54400001, 
-0x27634000, 0x602821, 0x31220100, 0x5440001d, 
-0x31221000, 0x11a00009, 0x31a20800, 0x10400004, 
-0x25020020, 0x8f8200a8, 0xa5e20000, 0x25020020, 
-0xaf820124, 0x8f880124, 0x6821, 0x11800011, 
-0x31221000, 0x3c040002, 0x8c8487a0, 0x8c820000, 
-0x8c830004, 0xaf820080, 0xaf830084, 0x8c820008, 
-0xaf8200a4, 0x9482000e, 0xaf8200ac, 0x8c820010, 
-0x6021, 0xaf8200a0, 0x8c8d0010, 0x8c8f0014, 
-0x31221000, 0x14400022, 0x0, 0x1140000f, 
-0x31420800, 0x10400004, 0x3c020002, 0x8f8200b8, 
-0xa5c20000, 0x3c020002, 0x1421024, 0x10400004, 
-0x24e20020, 0x8f8200b4, 0xaf8200d4, 0x24e20020, 
-0xaf820104, 0x8f870104, 0x5021, 0x11600010, 
-0x0, 0x3c040002, 0x8c84879c, 0x8c820000, 
-0x8c830004, 0xaf820090, 0xaf830094, 0x8c820008, 
-0xaf8200b4, 0x9482000e, 0xaf82009c, 0x8c820010, 
-0x5821, 0xaf8200b0, 0x8c8a0010, 0x8c8e0014, 
-0x8f820070, 0x3c031000, 0x431024, 0x1040ff5b, 
-0x0, 0x8f820054, 0x24420005, 0xaf820078, 
-0x8c040234, 0x10800017, 0x1821, 0x3c020001, 
-0x571021, 0x8c4240e8, 0x24420005, 0x3c010001, 
-0x370821, 0xac2240e8, 0x3c020001, 0x571021, 
-0x8c4240e8, 0x44102b, 0x1440000a, 0x24020001, 
-0x3c030080, 0x3c010001, 0x370821, 0xac2040e8, 
-0x3c010001, 0x370821, 0xa02240f0, 0x1000000c, 
-0x0, 0x3c020001, 0x571021, 0x904240f0, 
-0x14400006, 0x3c020080, 0x3c020001, 0x571021, 
-0x904240f1, 0x10400002, 0x3c020080, 0x621825, 
-0x8c040230, 0x10800013, 0x0, 0x3c020001, 
-0x571021, 0x8c4240ec, 0x24420005, 0x3c010001, 
-0x370821, 0xac2240ec, 0x3c020001, 0x571021, 
-0x8c4240ec, 0x44102b, 0x14400006, 0x0, 
-0x3c010001, 0x370821, 0xac2040ec, 0x10000006, 
-0x781825, 0x3c020001, 0x571021, 0x904240f2, 
-0x54400001, 0x781825, 0x1060ff18, 0x0, 
-0x8f420000, 0x10400007, 0x0, 0xaf80004c, 
-0x8f82004c, 0x1040fffd, 0x0, 0x10000005, 
-0x0, 0xaf800048, 0x8f820048, 0x1040fffd, 
-0x0, 0x8f820060, 0x431025, 0xaf820060, 
-0x8f420000, 0x10400004, 0x0, 0xaf80004c, 
-0x1000ff02, 0x0, 0xaf800048, 0x1000feff, 
-0x0, 0x3e00008, 0x0, 0x3c020002, 
-0x8c428608, 0x27bdffe8, 0xafbf0014, 0x14400012, 
-0xafb00010, 0x3c100002, 0x26108850, 0x2002021, 
-0xc002da8, 0x24052000, 0x26021fe0, 0x3c010002, 
-0xac2287a8, 0x3c010002, 0xac2287a4, 0xac020250, 
-0x24022000, 0xac100254, 0xac020258, 0x24020001, 
-0x3c010002, 0xac228608, 0x8fbf0014, 0x8fb00010, 
-0x3e00008, 0x27bd0018, 0x3c090002, 0x8d2987a8, 
-0x8c820000, 0x8fa30010, 0x8fa80014, 0xad220000, 
-0x8c820004, 0xad250008, 0xad220004, 0x8f820054, 
-0xad260010, 0xad270014, 0xad230018, 0xad28001c, 
-0xad22000c, 0x2529ffe0, 0x3c020002, 0x24428850, 
-0x122102b, 0x10400003, 0x0, 0x3c090002, 
-0x8d2987a4, 0x3c020002, 0x8c4285fc, 0xad220000, 
-0x3c020002, 0x8c4285fc, 0x3c010002, 0xac2987a8, 
-0xad220004, 0xac090250, 0x3e00008, 0x0, 
-0x27bdffd0, 0xafb00010, 0x3c100002, 0x8e1087a8, 
-0x3c020002, 0x8c4285fc, 0xafb10014, 0x808821, 
-0xafbe0024, 0x8fbe0040, 0x8fa40048, 0xafb20018, 
-0xa09021, 0xafbf0028, 0xafb50020, 0xafb3001c, 
-0xae020000, 0x3c020002, 0x8c4285fc, 0xc09821, 
-0xe0a821, 0x10800006, 0xae020004, 0x26050008, 
-0xc002db3, 0x24060018, 0x10000005, 0x2610ffe0, 
-0x26040008, 0xc002da8, 0x24050018, 0x2610ffe0, 
-0x3c030002, 0x24638850, 0x203102b, 0x10400003, 
-0x0, 0x3c100002, 0x8e1087a4, 0x8e220000, 
-0xae020000, 0x8e220004, 0xae120008, 0xae020004, 
-0x8f820054, 0xae130010, 0xae150014, 0xae1e0018, 
-0x8fa80044, 0xae08001c, 0xae02000c, 0x2610ffe0, 
-0x203102b, 0x10400003, 0x0, 0x3c100002, 
-0x8e1087a4, 0x3c020002, 0x8c4285fc, 0xae020000, 
-0x3c020002, 0x8c4285fc, 0x3c010002, 0xac3087a8, 
-0xae020004, 0xac100250, 0x8fbf0028, 0x8fbe0024, 
-0x8fb50020, 0x8fb3001c, 0x8fb20018, 0x8fb10014, 
-0x8fb00010, 0x3e00008, 0x27bd0030, 0x851821, 
-0x83102b, 0x10400006, 0x0, 0xac800000, 
-0x24840004, 0x83102b, 0x5440fffd, 0xac800000, 
-0x3e00008, 0x0, 0xa61821, 0xa3102b, 
-0x10400007, 0x0, 0x8c820000, 0xaca20000, 
-0x24a50004, 0xa3102b, 0x1440fffb, 0x24840004, 
-0x3e00008, 0x0, 0x861821, 0x83102b, 
-0x10400007, 0x0, 0x8ca20000, 0xac820000, 
-0x24840004, 0x83102b, 0x1440fffb, 0x24a50004, 
-0x3e00008, 0x0, 0x63080, 0x861821, 
-0x83102b, 0x10400006, 0x0, 0xac850000, 
-0x24840004, 0x83102b, 0x5440fffd, 0xac850000, 
-0x3e00008, 0x0, 0x26e50028, 0xa03021, 
-0x274301c0, 0x8f4d0358, 0x8f47035c, 0x8f480360, 
-0x8f490364, 0x8f4a0368, 0x8f4b0204, 0x8f4c0200, 
-0x24640400, 0x64102b, 0x10400008, 0x3c0208ff, 
-0x8cc20000, 0xac620000, 0x24630004, 0x64102b, 
-0x1440fffb, 0x24c60004, 0x3c0208ff, 0x3442ffff, 
-0x3c03c0ff, 0xaf4d0358, 0xaf47035c, 0xaf480360, 
-0xaf490364, 0xaf4a0368, 0xaf4b0204, 0xaf4c0200, 
-0x8f840220, 0x3463ffff, 0x8f860200, 0x821024, 
-0x34420004, 0xc31824, 0x34630004, 0xaf820220, 
-0xaf830200, 0x8ca20214, 0xac020084, 0x8ca20218, 
-0xac020088, 0x8ca2021c, 0xac02008c, 0x8ca20220, 
-0xac020090, 0x8ca20224, 0xac020094, 0x8ca20228, 
-0xac020098, 0x8ca2022c, 0xac02009c, 0x8ca20230, 
-0xac0200a0, 0x8ca20234, 0xac0200a4, 0x8ca20238, 
-0xac0200a8, 0x8ca2023c, 0xac0200ac, 0x8ca20240, 
-0xac0200b0, 0x8ca20244, 0xac0200b4, 0x8ca20248, 
-0xac0200b8, 0x8ca2024c, 0xac0200bc, 0x8ca2001c, 
-0xac020080, 0x8ca20018, 0xac0200c0, 0x8ca20020, 
-0xac0200cc, 0x8ca20024, 0xac0200d0, 0x8ca201d0, 
-0xac0200e0, 0x8ca201d4, 0xac0200e4, 0x8ca201d8, 
-0xac0200e8, 0x8ca201dc, 0xac0200ec, 0x8ca201e0, 
-0xac0200f0, 0x8ca20098, 0x8ca3009c, 0xac0300fc, 
-0x8ca200a8, 0x8ca300ac, 0xac0300f4, 0x8ca200a0, 
-0x8ca300a4, 0x30840004, 0xac0300f8, 0x14800007, 
-0x30c20004, 0x8f820220, 0x3c0308ff, 0x3463fffb, 
-0x431024, 0xaf820220, 0x30c20004, 0x14400006, 
-0x0, 0x8f820200, 0x3c03c0ff, 0x3463fffb, 
-0x431024, 0xaf820200, 0x8f4202dc, 0xa34005c5, 
-0x24420001, 0xaf4202dc, 0x8f4202dc, 0x3e00008, 
-0x0, 0x27bdffd0, 0xafbf0028, 0xafb10024, 
-0xafb00020, 0x8f430024, 0x8f420020, 0x1062004e, 
-0x0, 0x8f430020, 0x8f420024, 0x628823, 
-0x6210003, 0x0, 0x8f420040, 0x2228821, 
-0x8f430030, 0x8f420024, 0x43102b, 0x14400005, 
-0x0, 0x8f430040, 0x8f420024, 0x10000005, 
-0x628023, 0x8f420030, 0x8f430024, 0x431023, 
-0x2450ffff, 0x16000016, 0x2006821, 0x3c040001, 
-0x24847e74, 0x240202aa, 0xafa20010, 0xafa00014, 
-0x8f860144, 0x3c070001, 0x24e77e84, 0xc002d3b, 
-0x3405dead, 0x8f82011c, 0x34420002, 0xaf82011c, 
-0x8f820220, 0x34420004, 0xaf820220, 0x8f820140, 
-0x3c030001, 0x431025, 0xaf820140, 0x2006821, 
-0x22d102a, 0x54400001, 0x2206821, 0x8f4b0024, 
-0x8f4a0040, 0x8f490024, 0x8f440180, 0x8f450184, 
-0x8f460024, 0x8f4c001c, 0xd3900, 0x24080001, 
-0xafa80010, 0x94900, 0x1201821, 0x16d5821, 
-0x254affff, 0x16a8024, 0xafb00014, 0x8f480014, 
-0x1021, 0xa32821, 0xa3482b, 0x822021, 
-0x892021, 0xafa80018, 0x8f420108, 0x63100, 
-0x40f809, 0x1863021, 0x54400001, 0xaf500024, 
-0x8f430024, 0x8f420020, 0x14620019, 0x0, 
-0x8f420000, 0x10400007, 0x0, 0xaf80004c, 
-0x8f82004c, 0x1040fffd, 0x0, 0x10000005, 
-0x0, 0xaf800048, 0x8f820048, 0x1040fffd, 
-0x0, 0x8f820060, 0x2403ffef, 0x431024, 
-0xaf820060, 0x8f420000, 0x10400004, 0x0, 
-0xaf80004c, 0x10000002, 0x0, 0xaf800048, 
-0x8fbf0028, 0x8fb10024, 0x8fb00020, 0x3e00008, 
-0x27bd0030, 0x3e00008, 0x0, 0x27bdffc0, 
-0x32c20020, 0xafbf0038, 0xafb30034, 0xafb20030, 
-0xafb1002c, 0x10400004, 0xafb00028, 0x8f530028, 
-0x10000002, 0x0, 0x8f530020, 0x8f420030, 
-0x10530102, 0x21100, 0x8f43001c, 0x628021, 
-0x8e040000, 0x8e050004, 0x96120008, 0x8f420090, 
-0x9611000a, 0x3246ffff, 0x46102a, 0x10400018, 
-0x0, 0x8f8200d8, 0x8f430098, 0x431023, 
-0x2442dcbe, 0xaf420090, 0x8f420090, 0x2842dcbf, 
-0x10400005, 0x0, 0x8f420090, 0x8f430144, 
-0x431021, 0xaf420090, 0x8f420090, 0x46102a, 
-0x10400007, 0x0, 0x8f420348, 0x24420001, 
-0xaf420348, 0x8f420348, 0x100000f8, 0x0, 
-0x8f8200fc, 0x14400007, 0x0, 0x8f420344, 
-0x24420001, 0xaf420344, 0x8f420344, 0x100000ef, 
-0x0, 0x934205c2, 0x1040000b, 0x32c20008, 
-0x10400008, 0x32220200, 0x10400006, 0x3c034000, 
-0x9602000e, 0xaf4300ac, 0x21400, 0x10000002, 
-0xaf4200b0, 0xaf4000ac, 0x32220004, 0x10400094, 
-0x32220800, 0x10400003, 0x3247ffff, 0x10000002, 
-0x24020020, 0x24020004, 0xafa20010, 0x8f420030, 
-0xafa20014, 0x8f420010, 0x3c030002, 0x431025, 
-0xafa20018, 0x8f460098, 0x8f420108, 0x40f809, 
-0x0, 0x104000cd, 0x0, 0x8f42009c, 
-0x8f430094, 0x2421021, 0xaf42009c, 0xae03000c, 
-0x8f4200ac, 0x10400008, 0x3c034000, 0x8f420094, 
-0x431025, 0xafa20020, 0x8f42009c, 0x8f4300b0, 
-0x10000004, 0x431025, 0x8f420094, 0xafa20020, 
-0x8f42009c, 0xafa20024, 0x8f9000fc, 0x16000014, 
-0x240200e1, 0x3c040001, 0x24847e74, 0xafa20010, 
-0xafa00014, 0x8f860144, 0x3c070001, 0x24e77e7c, 
-0xc002d3b, 0x3405dead, 0x8f82011c, 0x34420002, 
-0xaf82011c, 0x8f820220, 0x34420004, 0xaf820220, 
-0x8f820140, 0x3c030001, 0x431025, 0xaf820140, 
-0x8fa20020, 0x8fa30024, 0xae020000, 0xae030004, 
-0x26020008, 0xaf8200f0, 0x8f42009c, 0x8f440270, 
-0x8f450274, 0x401821, 0x1021, 0xa32821, 
-0xa3302b, 0x822021, 0x862021, 0x32230060, 
-0x24020040, 0xaf440270, 0xaf450274, 0x10620017, 
-0x2c620041, 0x10400005, 0x24020020, 0x10620008, 
-0x24020001, 0x10000026, 0x0, 0x24020060, 
-0x10620019, 0x24020001, 0x10000021, 0x0, 
-0x8f420278, 0x8f43027c, 0x24630001, 0x2c640001, 
-0x441021, 0xaf420278, 0xaf43027c, 0x8f420278, 
-0x8f43027c, 0x10000016, 0x24020001, 0x8f420280, 
-0x8f430284, 0x24630001, 0x2c640001, 0x441021, 
-0xaf420280, 0xaf430284, 0x8f420280, 0x8f430284, 
-0x1000000b, 0x24020001, 0x8f420288, 0x8f43028c, 
-0x24630001, 0x2c640001, 0x441021, 0xaf420288, 
-0xaf43028c, 0x8f420288, 0x8f43028c, 0x24020001, 
-0xa34205c2, 0x8f420098, 0x3244ffff, 0x2406fff8, 
-0x8f45013c, 0x441021, 0x24420007, 0x461024, 
-0x24840007, 0xaf420094, 0x8f420090, 0x8f430094, 
-0x862024, 0x441023, 0x65182b, 0x14600005, 
-0xaf420090, 0x8f420094, 0x8f430144, 0x431023, 
-0xaf420094, 0x8f420094, 0x10000023, 0xaf40009c, 
-0x3247ffff, 0x50e00022, 0x32c20020, 0x14400002, 
-0x24020010, 0x24020002, 0xafa20010, 0x8f420030, 
-0xafa20014, 0x8f420010, 0xafa20018, 0x8f460098, 
-0x8f420108, 0x40f809, 0x0, 0x1040003b, 
-0x3245ffff, 0x8f420098, 0x8f430090, 0x8f46013c, 
-0x451021, 0xaf420098, 0x8f42009c, 0x8f440098, 
-0xa34005c2, 0x651823, 0xaf430090, 0x451021, 
-0x86202b, 0x14800005, 0xaf42009c, 0x8f420098, 
-0x8f430144, 0x431023, 0xaf420098, 0x32c20020, 
-0x10400005, 0x0, 0x8f420358, 0x2442ffff, 
-0xaf420358, 0x8f420358, 0x8f420030, 0x8f430040, 
-0x24420001, 0x2463ffff, 0x431024, 0xaf420030, 
-0x8f420030, 0x14530019, 0x0, 0x8f420000, 
-0x10400007, 0x0, 0xaf80004c, 0x8f82004c, 
-0x1040fffd, 0x0, 0x10000005, 0x0, 
-0xaf800048, 0x8f820048, 0x1040fffd, 0x0, 
-0x8f820060, 0x2403fff7, 0x431024, 0xaf820060, 
-0x8f420000, 0x10400004, 0x0, 0xaf80004c, 
-0x10000002, 0x0, 0xaf800048, 0x8fbf0038, 
-0x8fb30034, 0x8fb20030, 0x8fb1002c, 0x8fb00028, 
-0x3e00008, 0x27bd0040, 0x3e00008, 0x0, 
-0x27bdffd0, 0x32c20020, 0xafbf002c, 0xafb20028, 
-0xafb10024, 0x10400004, 0xafb00020, 0x8f520028, 
-0x10000002, 0x0, 0x8f520020, 0x8f420030, 
-0x105200b7, 0x21100, 0x8f43001c, 0x628021, 
-0x8e040000, 0x8e050004, 0x96110008, 0x8f420090, 
-0x9607000a, 0x3226ffff, 0x46102a, 0x10400018, 
-0x0, 0x8f8200d8, 0x8f430098, 0x431023, 
-0x2442dc46, 0xaf420090, 0x8f420090, 0x2842dc47, 
-0x10400005, 0x0, 0x8f420090, 0x8f430144, 
-0x431021, 0xaf420090, 0x8f420090, 0x46102a, 
-0x10400007, 0x0, 0x8f420348, 0x24420001, 
-0xaf420348, 0x8f420348, 0x100000ad, 0x0, 
-0x8f8600fc, 0x10c0000c, 0x0, 0x8f8200f4, 
-0x2403fff8, 0x431024, 0x461023, 0x218c3, 
-0x58600001, 0x24630100, 0x8f42008c, 0x43102b, 
-0x14400007, 0x712c2, 0x8f420344, 0x24420001, 
-0xaf420344, 0x8f420344, 0x10000099, 0x0, 
-0x934305c2, 0x1060000f, 0x30460001, 0x8f420010, 
-0x34480400, 0x32c20008, 0x10400008, 0x30e20200, 
-0x10400006, 0x3c034000, 0x9602000e, 0xaf4300ac, 
-0x21400, 0x10000004, 0xaf4200b0, 0x10000002, 
-0xaf4000ac, 0x8f480010, 0x30e20004, 0x10400045, 
-0x3227ffff, 0x8f4900ac, 0x11200005, 0x30c200ff, 
-0x14400006, 0x24020040, 0x10000004, 0x24020008, 
-0x14400002, 0x24020020, 0x24020004, 0xafa20010, 
-0x8f430030, 0x11200004, 0xafa30014, 0x8f4200b0, 
-0x621025, 0xafa20014, 0x3c020002, 0x1021025, 
-0xafa20018, 0x8f460098, 0x8f420108, 0x40f809, 
-0x0, 0x1040006a, 0x3224ffff, 0x8f42008c, 
-0x8f430094, 0x24420001, 0xaf42008c, 0x24020001, 
-0xae03000c, 0xa34205c2, 0x8f420098, 0x2406fff8, 
-0x8f45013c, 0x441021, 0x24420007, 0x461024, 
-0x24840007, 0xaf420094, 0x8f420090, 0x8f430094, 
-0x862024, 0x441023, 0x65182b, 0x14600005, 
-0xaf420090, 0x8f420094, 0x8f430144, 0x431023, 
-0xaf420094, 0x8f430094, 0x8f420140, 0x43102b, 
-0x10400009, 0x0, 0x8f43013c, 0x8f440094, 
-0x8f420090, 0x8f450138, 0x641823, 0x431023, 
-0xaf420090, 0xaf450094, 0x8f420094, 0x1000001f, 
-0xaf420098, 0x10e0001d, 0x30c200ff, 0x14400002, 
-0x24020010, 0x24020002, 0xafa20010, 0x8f420030, 
-0xafa80018, 0xafa20014, 0x8f460098, 0x8f420108, 
-0x40f809, 0x0, 0x10400031, 0x3225ffff, 
-0x8f420098, 0x8f44013c, 0x451021, 0xaf420098, 
-0x8f420090, 0x8f430098, 0xa34005c2, 0x451023, 
-0x64182b, 0x14600005, 0xaf420090, 0x8f420098, 
-0x8f430144, 0x431023, 0xaf420098, 0x8f420030, 
-0x8f430040, 0x24420001, 0x2463ffff, 0x431024, 
-0xaf420030, 0x8f420030, 0x14520019, 0x0, 
-0x8f420000, 0x10400007, 0x0, 0xaf80004c, 
-0x8f82004c, 0x1040fffd, 0x0, 0x10000005, 
-0x0, 0xaf800048, 0x8f820048, 0x1040fffd, 
-0x0, 0x8f820060, 0x2403fff7, 0x431024, 
-0xaf820060, 0x8f420000, 0x10400004, 0x0, 
-0xaf80004c, 0x10000002, 0x0, 0xaf800048, 
-0x8fbf002c, 0x8fb20028, 0x8fb10024, 0x8fb00020, 
-0x3e00008, 0x27bd0030, 0x3e00008, 0x0, 
-0x27bdffd8, 0xafbf0024, 0xafb00020, 0x8f4300f0, 
-0x8f4200ec, 0x8f900108, 0x14620017, 0x3c020001, 
-0x3c040001, 0x24847e74, 0x240204ea, 0xafa20010, 
-0xafa00014, 0x8f860144, 0x3c070001, 0x24e77e84, 
-0xc002d3b, 0x3405dead, 0x8f82011c, 0x34420002, 
-0xaf82011c, 0x8f820220, 0x34420004, 0xaf820220, 
-0x8f820140, 0x3c030001, 0x431025, 0xaf820140, 
-0x3c020001, 0x8f4300f0, 0x34422ec0, 0x2e21021, 
-0x54620004, 0x24620008, 0x3c020001, 0x34422cc0, 
-0x2e21021, 0x401821, 0xaf4300f0, 0xac600000, 
-0x8f4200ec, 0x8c660004, 0x14620005, 0x3c020001, 
-0x26020020, 0xaf820108, 0x1000000f, 0x0, 
-0x8f4300f0, 0x34422ec0, 0x2e21021, 0x54620004, 
-0x24620008, 0x3c020001, 0x34422cc0, 0x2e21021, 
-0x401821, 0x8c620004, 0x21140, 0x2021021, 
-0xaf820108, 0xac600000, 0x8e050018, 0x30a20036, 
-0x1040006d, 0x30a20001, 0x8e02001c, 0x8f430040, 
-0x8f440034, 0x24420001, 0x2463ffff, 0x431024, 
-0x862021, 0xaf42002c, 0x30a20030, 0x14400006, 
-0xaf440034, 0x8f420034, 0x8c03023c, 0x43102b, 
-0x144000cf, 0x0, 0x32c20010, 0x10400028, 
-0x24070008, 0x8f440170, 0x8f450174, 0x8f43002c, 
-0x8f48000c, 0x8f860120, 0x24020080, 0xafa20010, 
-0xafa30014, 0xafa80018, 0x8f42010c, 0x40f809, 
-0x24c6001c, 0x14400011, 0x24020001, 0x3c010001, 
-0x370821, 0xa02240f1, 0x8f820124, 0xafa20010, 
-0x8f820128, 0x3c040001, 0x24847e64, 0xafa20014, 
-0x8f46002c, 0x8f870120, 0x3c050009, 0xc002d3b, 
-0x34a51100, 0x10000036, 0x0, 0x8f420300, 
-0x8f43002c, 0x24420001, 0xaf420300, 0x8f420300, 
-0x24020001, 0xa34205c1, 0x10000026, 0xaf430038, 
-0x8f440170, 0x8f450174, 0x8f43002c, 0x8f48000c, 
-0x8f860120, 0x24020020, 0xafa20010, 0xafa30014, 
-0xafa80018, 0x8f42010c, 0x40f809, 0x24c6001c, 
-0x14400011, 0x24020001, 0x3c010001, 0x370821, 
-0xa02240f0, 0x8f820124, 0xafa20010, 0x8f820128, 
-0x3c040001, 0x24847e58, 0xafa20014, 0x8f46002c, 
-0x8f870120, 0x3c050009, 0xc002d3b, 0x34a50900, 
-0x1000000f, 0x0, 0x8f420300, 0x24420001, 
-0xaf420300, 0x8f420300, 0x8f42002c, 0xa34005c1, 
-0xaf420038, 0x3c010001, 0x370821, 0xa02040f1, 
-0x3c010001, 0x370821, 0xa02040f0, 0xaf400034, 
-0x8f420314, 0x24420001, 0xaf420314, 0x8f420314, 
-0x10000073, 0x0, 0x10400025, 0x30a27000, 
-0x8e05001c, 0x8f420028, 0xa22023, 0x4810003, 
-0x0, 0x8f420040, 0x822021, 0x8f420358, 
-0x8f430000, 0xaf450028, 0x441021, 0xaf420358, 
-0x10600007, 0x0, 0xaf80004c, 0x8f82004c, 
-0x1040fffd, 0x0, 0x10000005, 0x0, 
-0xaf800048, 0x8f820048, 0x1040fffd, 0x0, 
-0x8f820060, 0x34420008, 0xaf820060, 0x8f420000, 
-0x10400004, 0x0, 0xaf80004c, 0x10000050, 
-0x0, 0xaf800048, 0x1000004d, 0x0, 
-0x1040002f, 0x30a21000, 0x1040000c, 0x30a24000, 
-0x8e03001c, 0x8f420050, 0x622023, 0x4820001, 
-0x24840200, 0x8f42035c, 0x441021, 0xaf42035c, 
-0x8f420368, 0x1000001a, 0xaf430050, 0x1040000c, 
-0x32c28000, 0x8e03001c, 0x8f420070, 0x622023, 
-0x4820001, 0x24840400, 0x8f420364, 0x441021, 
-0xaf420364, 0x8f420368, 0x1000000d, 0xaf430070, 
-0x1040000e, 0x3c020800, 0x8e03001c, 0x8f420060, 
-0x622023, 0x4820001, 0x24840100, 0x8f420360, 
-0x441021, 0xaf420360, 0x8f420368, 0xaf430060, 
-0x441021, 0xaf420368, 0x3c020800, 0x2c21024, 
-0x5040001f, 0x36940040, 0x1000001d, 0x0, 
-0x30a20100, 0x10400005, 0x30a20080, 0xc002dd7, 
-0x0, 0x10000016, 0x0, 0x14400014, 
-0x240205dd, 0x3c040001, 0x24847e74, 0xafa20010, 
-0xafa00014, 0x8f860144, 0x3c070001, 0x24e77e84, 
-0xc002d3b, 0x3405dead, 0x8f82011c, 0x34420002, 
-0xaf82011c, 0x8f820220, 0x34420004, 0xaf820220, 
-0x8f820140, 0x3c030001, 0x431025, 0xaf820140, 
-0x8fbf0024, 0x8fb00020, 0x3e00008, 0x27bd0028, 
-0x3e00008, 0x0, 0x27bdff98, 0xafbf0060, 
-0xafbe005c, 0xafb50058, 0xafb30054, 0xafb20050, 
-0xafb1004c, 0xafb00048, 0x8f920108, 0x8f820104, 
-0x16420016, 0x26420020, 0x3c040001, 0x24847e74, 
-0x240205f8, 0xafa20010, 0xafa00014, 0x8f860144, 
-0x3c070001, 0x24e77e84, 0xc002d3b, 0x3405dead, 
-0x8f82011c, 0x34420002, 0xaf82011c, 0x8f820220, 
-0x34420004, 0xaf820220, 0x8f820140, 0x3c030001, 
-0x431025, 0xaf820140, 0x26420020, 0xaf820108, 
-0x8e530018, 0xa3a0003f, 0x32620024, 0x1040022c, 
-0xafa00034, 0x8e50001c, 0x8f42001c, 0x101900, 
-0x431021, 0x8c51000c, 0x8f430140, 0x965e0016, 
-0x9455000a, 0x71182b, 0x10600014, 0x24020634, 
-0x3c040001, 0x24847e74, 0xafa20010, 0xafa00014, 
-0x8f860144, 0x3c070001, 0x24e77e84, 0xc002d3b, 
-0x3405dead, 0x8f82011c, 0x34420002, 0xaf82011c, 
-0x8f820220, 0x34420004, 0xaf820220, 0x8f820140, 
-0x3c030001, 0x431025, 0xaf820140, 0x9624000c, 
-0x2c8305dd, 0x38828870, 0x2c420001, 0x621825, 
-0x10600015, 0x2821, 0x32c20040, 0x10400015, 
-0x24020800, 0x96230014, 0x14620012, 0x3402aaaa, 
-0x9623000e, 0x14620007, 0x2021, 0x96230010, 
-0x24020300, 0x14620004, 0x801021, 0x96220012, 
-0x2c440001, 0x801021, 0x54400006, 0x24050016, 
-0x10000004, 0x0, 0x24020800, 0x50820001, 
-0x2405000e, 0x934205c3, 0x14400008, 0x5021, 
-0x240a0001, 0x32a20180, 0xaf4500a8, 0xaf5100a0, 
-0x10400002, 0xaf5000a4, 0xa34a05c3, 0x10a00086, 
-0x2253821, 0x90e20000, 0x3021, 0x3042000f, 
-0x24880, 0x32c20002, 0x10400012, 0xe91821, 
-0x32a20002, 0x10400010, 0x32c20001, 0xe02021, 
-0x94820000, 0x24840002, 0xc23021, 0x83102b, 
-0x1440fffb, 0x30c2ffff, 0x61c02, 0x623021, 
-0x61c02, 0x30c2ffff, 0x623021, 0x61027, 
-0xa4e2000a, 0x32c20001, 0x1040006b, 0x32a20001, 
-0x10400069, 0x0, 0x8f4200a8, 0x10400066, 
-0x0, 0x8f4200a0, 0x8f4300a8, 0x431021, 
-0x904b0009, 0x316800ff, 0x39030006, 0x3182b, 
-0x39020011, 0x2102b, 0x621824, 0x1060000d, 
-0x3c050006, 0x3c040001, 0x24847e8c, 0x8f4200a4, 
-0x34a54600, 0xafa20010, 0x8f4200a0, 0x2003021, 
-0x1003821, 0xc002d3b, 0xafa20014, 0x1000004e, 
-0x0, 0x32c20004, 0x14400013, 0x2821, 
-0x314200ff, 0x14400004, 0x0, 0x94e20002, 
-0x1000000d, 0x492823, 0x94e5000c, 0x94e2000e, 
-0x94e30010, 0xa22821, 0xa32821, 0x94e30012, 
-0x90e40009, 0x94e20002, 0xa32821, 0xa42821, 
-0x491023, 0xa22821, 0x2202021, 0x94820000, 
-0x24840002, 0xc23021, 0x87102b, 0x1440fffb, 
-0x61c02, 0x30c2ffff, 0x623021, 0x61c02, 
-0x30c2ffff, 0x623021, 0x3c52821, 0x51c02, 
-0x30a2ffff, 0x622821, 0x51c02, 0x30a2ffff, 
-0x622821, 0xa62823, 0x51402, 0xa22821, 
-0x30a5ffff, 0x50a00001, 0x3405ffff, 0x314200ff, 
-0x14400008, 0x316300ff, 0x8f4300a0, 0x8f4200a8, 
-0x623821, 0x90e20000, 0x3042000f, 0x24880, 
-0x316300ff, 0x24020006, 0x14620003, 0xe91021, 
-0x10000002, 0x24440010, 0x24440006, 0x314200ff, 
-0x14400006, 0x0, 0x94820000, 0xa22821, 
-0x51c02, 0x30a2ffff, 0x622821, 0x934205c3, 
-0x10400003, 0x32a20100, 0x50400003, 0xa4850000, 
-0x52827, 0xa4850000, 0x9642000e, 0x8f43009c, 
-0x621821, 0xaf43009c, 0x93a2003f, 0x10400007, 
-0x3c024000, 0x2221025, 0xafa20020, 0x8f42009c, 
-0x8fac0034, 0x10000003, 0x4c1025, 0xafb10020, 
-0x8f42009c, 0xafa20024, 0x32a20080, 0x10400027, 
-0x32a20100, 0x8f4200b4, 0x2c420100, 0x14400014, 
-0x2402076a, 0x3c040001, 0x24847e74, 0xafa20010, 
-0xafa00014, 0x8f860144, 0x3c070001, 0x24e77e84, 
-0xc002d3b, 0x3405dead, 0x8f82011c, 0x34420002, 
-0xaf82011c, 0x8f820220, 0x34420004, 0xaf820220, 
-0x8f820140, 0x3c030001, 0x431025, 0xaf820140, 
-0x8f4200b4, 0x24430001, 0x210c0, 0x571021, 
-0xaf4300b4, 0x8fa30020, 0x8fa40024, 0x3c010001, 
-0x220821, 0xac2338e8, 0x3c010001, 0x220821, 
-0xac2438ec, 0x100000e7, 0x32c20020, 0x10400091, 
-0x0, 0x8f4200b4, 0x2c420100, 0x14400014, 
-0x24020778, 0x3c040001, 0x24847e74, 0xafa20010, 
-0xafa00014, 0x8f860144, 0x3c070001, 0x24e77e84, 
-0xc002d3b, 0x3405dead, 0x8f82011c, 0x34420002, 
-0xaf82011c, 0x8f820220, 0x34420004, 0xaf820220, 
-0x8f820140, 0x3c030001, 0x431025, 0xaf820140, 
-0x8f4200b4, 0x24430001, 0x210c0, 0x571021, 
-0xaf4300b4, 0x8fa30020, 0x8fa40024, 0x3c010001, 
-0x220821, 0xac2338e8, 0x3c010001, 0x220821, 
-0xac2438ec, 0x8f4200b4, 0x10400067, 0x8821, 
-0x1110c0, 0x571021, 0x3c030001, 0x621821, 
-0x8c6338e8, 0x3c040001, 0x822021, 0x8c8438ec, 
-0xafa30028, 0xafa4002c, 0x8f9000fc, 0x16000014, 
-0x240200f4, 0x3c040001, 0x24847e74, 0xafa20010, 
-0xafa00014, 0x8f860144, 0x3c070001, 0x24e77e7c, 
-0xc002d3b, 0x3405dead, 0x8f82011c, 0x34420002, 
-0xaf82011c, 0x8f820220, 0x34420004, 0xaf820220, 
-0x8f820140, 0x3c030001, 0x431025, 0xaf820140, 
-0x8fa20028, 0x8fa3002c, 0xae020000, 0xae030004, 
-0x26020008, 0xaf8200f0, 0x8f42008c, 0x2442ffff, 
-0xaf42008c, 0x97a2002e, 0x8f440270, 0x8f450274, 
-0x401821, 0x1021, 0xa32821, 0xa3302b, 
-0x822021, 0x862021, 0xaf440270, 0xaf450274, 
-0x8fa30028, 0x3c02001f, 0x3442ffff, 0x622024, 
-0x90820000, 0x30420001, 0x1440000c, 0x2402ffff, 
-0x8f420278, 0x8f43027c, 0x24630001, 0x2c640001, 
-0x441021, 0xaf420278, 0xaf43027c, 0x8f420278, 
-0x8f43027c, 0x1000001b, 0x0, 0x8c830000, 
-0x1462000f, 0x3402ffff, 0x94830004, 0x1462000c, 
-0x0, 0x8f420288, 0x8f43028c, 0x24630001, 
-0x2c640001, 0x441021, 0xaf420288, 0xaf43028c, 
-0x8f420288, 0x8f43028c, 0x1000000a, 0x0, 
-0x8f420280, 0x8f430284, 0x24630001, 0x2c640001, 
-0x441021, 0xaf420280, 0xaf430284, 0x8f420280, 
-0x8f430284, 0x8f4200b4, 0x26310001, 0x222102b, 
-0x1440ff9c, 0x1110c0, 0xa34005c3, 0x10000054, 
-0xaf4000b4, 0x8f9000fc, 0x16000014, 0x240200f4, 
-0x3c040001, 0x24847e74, 0xafa20010, 0xafa00014, 
-0x8f860144, 0x3c070001, 0x24e77e7c, 0xc002d3b, 
-0x3405dead, 0x8f82011c, 0x34420002, 0xaf82011c, 
-0x8f820220, 0x34420004, 0xaf820220, 0x8f820140, 
-0x3c030001, 0x431025, 0xaf820140, 0x8fa20020, 
-0x8fa30024, 0xae020000, 0xae030004, 0x26020008, 
-0xaf8200f0, 0x8f42009c, 0x8f46008c, 0x8f440270, 
-0x8f450274, 0x401821, 0x1021, 0x24c6ffff, 
-0xaf46008c, 0xa32821, 0xa3302b, 0x822021, 
-0x862021, 0xaf440270, 0xaf450274, 0x92220000, 
-0x30420001, 0x1440000c, 0x2402ffff, 0x8f420278, 
-0x8f43027c, 0x24630001, 0x2c640001, 0x441021, 
-0xaf420278, 0xaf43027c, 0x8f420278, 0x8f43027c, 
-0x1000001c, 0x32c20020, 0x8e230000, 0x1462000f, 
-0x3402ffff, 0x96230004, 0x1462000c, 0x0, 
-0x8f420288, 0x8f43028c, 0x24630001, 0x2c640001, 
-0x441021, 0xaf420288, 0xaf43028c, 0x8f420288, 
-0x8f43028c, 0x1000000b, 0x32c20020, 0x8f420280, 
-0x8f430284, 0x24630001, 0x2c640001, 0x441021, 
-0xaf420280, 0xaf430284, 0x8f420280, 0x8f430284, 
-0x32c20020, 0x10400005, 0xaf40009c, 0x8f420358, 
-0x2442ffff, 0xaf420358, 0x8f420358, 0x8e42001c, 
-0x8f430040, 0x24420001, 0x2463ffff, 0x431024, 
-0xaf42002c, 0x32620060, 0x14400008, 0x32c20010, 
-0x8f420034, 0x24420001, 0xaf420034, 0x8c03023c, 
-0x43102b, 0x1440011f, 0x32c20010, 0x10400018, 
-0x24070008, 0x8f440170, 0x8f450174, 0x8f43002c, 
-0x8f48000c, 0x8f860120, 0x24020080, 0xafa20010, 
-0xafa30014, 0xafa80018, 0x8f42010c, 0x40f809, 
-0x24c6001c, 0x10400047, 0x24020001, 0x8f420300, 
-0x8f43002c, 0x24420001, 0xaf420300, 0x8f420300, 
-0x24020001, 0xa34205c1, 0x1000007c, 0xaf430038, 
-0x8f440170, 0x8f450174, 0x8f43002c, 0x8f48000c, 
-0x8f860120, 0x24020020, 0xafa20010, 0xafa30014, 
-0xafa80018, 0x8f42010c, 0x40f809, 0x24c6001c, 
-0x10400057, 0x24020001, 0x10000065, 0x0, 
-0x32620012, 0x10400076, 0x32620001, 0x9642000e, 
-0x8f43009c, 0x621821, 0x32c20020, 0x10400005, 
-0xaf43009c, 0x8f420358, 0x2442ffff, 0xaf420358, 
-0x8f420358, 0x8e42001c, 0x8f430040, 0x24420001, 
-0x2463ffff, 0x431024, 0xaf42002c, 0x32620010, 
-0x14400008, 0x32c20010, 0x8f420034, 0x24420001, 
-0xaf420034, 0x8c03023c, 0x43102b, 0x144000d9, 
-0x32c20010, 0x10400028, 0x24070008, 0x8f440170, 
-0x8f450174, 0x8f43002c, 0x8f48000c, 0x8f860120, 
-0x24020080, 0xafa20010, 0xafa30014, 0xafa80018, 
-0x8f42010c, 0x40f809, 0x24c6001c, 0x14400011, 
-0x24020001, 0x3c010001, 0x370821, 0xa02240f1, 
-0x8f820124, 0xafa20010, 0x8f820128, 0x3c040001, 
-0x24847e64, 0xafa20014, 0x8f46002c, 0x8f870120, 
-0x3c050009, 0xc002d3b, 0x34a51100, 0x10000036, 
-0x0, 0x8f420300, 0x8f43002c, 0x24420001, 
-0xaf420300, 0x8f420300, 0x24020001, 0xa34205c1, 
-0x10000026, 0xaf430038, 0x8f440170, 0x8f450174, 
-0x8f43002c, 0x8f48000c, 0x8f860120, 0x24020020, 
-0xafa20010, 0xafa30014, 0xafa80018, 0x8f42010c, 
-0x40f809, 0x24c6001c, 0x14400011, 0x24020001, 
-0x3c010001, 0x370821, 0xa02240f0, 0x8f820124, 
-0xafa20010, 0x8f820128, 0x3c040001, 0x24847e58, 
-0xafa20014, 0x8f46002c, 0x8f870120, 0x3c050009, 
-0xc002d3b, 0x34a50900, 0x1000000f, 0x0, 
-0x8f420300, 0x24420001, 0xaf420300, 0x8f420300, 
-0x8f42002c, 0xa34005c1, 0xaf420038, 0x3c010001, 
-0x370821, 0xa02040f1, 0x3c010001, 0x370821, 
-0xa02040f0, 0xaf400034, 0x8f420314, 0x24420001, 
-0xaf420314, 0x8f420314, 0x1000007e, 0x0, 
-0x10400025, 0x32627000, 0x8e45001c, 0x8f420028, 
-0xa22023, 0x4810003, 0x0, 0x8f420040, 
-0x822021, 0x8f420358, 0x8f430000, 0xaf450028, 
-0x441021, 0xaf420358, 0x10600007, 0x0, 
-0xaf80004c, 0x8f82004c, 0x1040fffd, 0x0, 
-0x10000005, 0x0, 0xaf800048, 0x8f820048, 
-0x1040fffd, 0x0, 0x8f820060, 0x34420008, 
-0xaf820060, 0x8f420000, 0x10400004, 0x0, 
-0xaf80004c, 0x1000005b, 0x0, 0xaf800048, 
-0x10000058, 0x0, 0x1040002f, 0x32621000, 
-0x1040000c, 0x32624000, 0x8e43001c, 0x8f420050, 
-0x622023, 0x4820001, 0x24840200, 0x8f42035c, 
-0x441021, 0xaf42035c, 0x8f420368, 0x1000001a, 
-0xaf430050, 0x1040000c, 0x32c28000, 0x8e43001c, 
-0x8f420070, 0x622023, 0x4820001, 0x24840400, 
-0x8f420364, 0x441021, 0xaf420364, 0x8f420368, 
-0x1000000d, 0xaf430070, 0x1040000e, 0x3c020800, 
-0x8e43001c, 0x8f420060, 0x622023, 0x4820001, 
-0x24840100, 0x8f420360, 0x441021, 0xaf420360, 
-0x8f420368, 0xaf430060, 0x441021, 0xaf420368, 
-0x3c020800, 0x2c21024, 0x5040002a, 0x36940040, 
-0x10000028, 0x0, 0x32620048, 0x10400009, 
-0x240c0001, 0x8e42001c, 0x3c03ffff, 0xa3ac003f, 
-0x431824, 0x3042ffff, 0xafa30034, 0x1000fcfd, 
-0xae42001c, 0x32620100, 0x10400005, 0x32620080, 
-0xc002dd7, 0x0, 0x10000016, 0x0, 
-0x14400014, 0x24020896, 0x3c040001, 0x24847e74, 
-0xafa20010, 0xafa00014, 0x8f860144, 0x3c070001, 
-0x24e77e84, 0xc002d3b, 0x3405dead, 0x8f82011c, 
-0x34420002, 0xaf82011c, 0x8f820220, 0x34420004, 
-0xaf820220, 0x8f820140, 0x3c030001, 0x431025, 
-0xaf820140, 0x8fbf0060, 0x8fbe005c, 0x8fb50058, 
-0x8fb30054, 0x8fb20050, 0x8fb1004c, 0x8fb00048, 
-0x3e00008, 0x27bd0068, 0x3e00008, 0x0, 
-0x8f8300e4, 0x8f8200e0, 0x2404fff8, 0x441024, 
-0x621026, 0x2102b, 0x21023, 0x3e00008, 
-0x621024, 0x3e00008, 0x0, 0x27bdffe0, 
-0xafbf001c, 0xafb00018, 0x8f8600c4, 0x8f8400e0, 
-0x8f8500e4, 0x2402fff8, 0x821824, 0x10a30009, 
-0x27623ff8, 0x14a20002, 0x24a20008, 0x27623000, 
-0x408021, 0x16030005, 0x30820004, 0x10400004, 
-0xc02021, 0x10000022, 0x1021, 0x8e040000, 
-0x8f42011c, 0x14a20003, 0x0, 0x8f420120, 
-0xaf420114, 0x8ca30000, 0x8f420148, 0x831823, 
-0x43102b, 0x10400003, 0x0, 0x8f420148, 
-0x621821, 0x94a20006, 0x24420050, 0x62102b, 
-0x1440000f, 0xa01021, 0xafa40010, 0xafa30014, 
-0x8ca60000, 0x8ca70004, 0x3c040001, 0xc002d3b, 
-0x24847f5c, 0x8f42020c, 0x24420001, 0xaf42020c, 
-0x8f42020c, 0x1021, 0xaf9000e8, 0xaf9000e4, 
-0x8fbf001c, 0x8fb00018, 0x3e00008, 0x27bd0020, 
-0x3e00008, 0x0, 0x8f8300e4, 0x27623ff8, 
-0x14620002, 0x24620008, 0x27623000, 0x401821, 
-0xaf8300e8, 0xaf8300e4, 0x3e00008, 0x0, 
-0x3e00008, 0x0, 0x8f8400e0, 0x8f8800c4, 
-0x8f8300e8, 0x2402fff8, 0x823824, 0xe32023, 
-0x2c821000, 0x50400001, 0x24841000, 0x420c2, 
-0x801821, 0x8f440258, 0x8f45025c, 0x1021, 
-0xa32821, 0xa3302b, 0x822021, 0x862021, 
-0xaf440258, 0xaf45025c, 0x8f8300c8, 0x8f420148, 
-0x1032023, 0x82102b, 0x14400004, 0x801821, 
-0x8f420148, 0x822021, 0x801821, 0x8f440250, 
-0x8f450254, 0x1021, 0xa32821, 0xa3302b, 
-0x822021, 0x862021, 0xaf440250, 0xaf450254, 
-0xaf8800c8, 0xaf8700e4, 0xaf8700e8, 0x3e00008, 
-0x0, 0x27bdff28, 0x240a0001, 0xafbf00d0, 
-0xafbe00cc, 0xafb500c8, 0xafb300c4, 0xafb200c0, 
-0xafb100bc, 0xafb000b8, 0xa3a0009f, 0xafa0004c, 
-0xafaa0064, 0xa7a00096, 0xafa00040, 0x934205c4, 
-0x8821, 0x1040000a, 0xa7a0008e, 0x8f4b00c4, 
-0xafab006c, 0x8f4a00c0, 0xafaa0074, 0x8f4b00cc, 
-0xafab007c, 0x8f4a00c8, 0x1000019f, 0xafaa0084, 
-0x8f420114, 0x40f809, 0x0, 0x403021, 
-0x10c00418, 0x0, 0x8cc20000, 0x8cc30004, 
-0xafa20020, 0xafa30024, 0x8fab0024, 0x8faa0020, 
-0x3162ffff, 0x2442fffc, 0xafa20074, 0x3c020006, 
-0x2c21024, 0xafab0084, 0x14400015, 0xafaa006c, 
-0x91420000, 0x30420001, 0x10400011, 0x2402ffff, 
-0x8d430000, 0x14620004, 0x3402ffff, 0x95430004, 
-0x1062000b, 0x0, 0xc0025dd, 0x8fa4006c, 
-0x304200ff, 0x14400006, 0x0, 0x8f420118, 
-0x40f809, 0x0, 0x100003f6, 0x0, 
-0x8fa20024, 0x3c03ffbf, 0x3463ffff, 0x431024, 
-0x3c03ffff, 0x431824, 0x14600003, 0xafa20024, 
-0x10000040, 0x1821, 0x3c020080, 0x621024, 
-0x10400007, 0x0, 0x8f42038c, 0x24420001, 
-0xaf42038c, 0x8f42038c, 0x10000036, 0x24030001, 
-0x8f420210, 0x24420001, 0xaf420210, 0x8f420210, 
-0x3c020001, 0x621024, 0x10400006, 0x3c020002, 
-0x8f4201c4, 0x24420001, 0xaf4201c4, 0x8f4201c4, 
-0x3c020002, 0x621024, 0x10400006, 0x3c020004, 
-0x8f42037c, 0x24420001, 0xaf42037c, 0x8f42037c, 
-0x3c020004, 0x621024, 0x10400006, 0x3c020008, 
-0x8f420380, 0x24420001, 0xaf420380, 0x8f420380, 
-0x3c020008, 0x621024, 0x10400006, 0x3c020010, 
-0x8f420384, 0x24420001, 0xaf420384, 0x8f420384, 
-0x3c020010, 0x621024, 0x10400006, 0x3c020020, 
-0x8f4201c0, 0x24420001, 0xaf4201c0, 0x8f4201c0, 
-0x3c020020, 0x621024, 0x10400006, 0x24030001, 
-0x8f420388, 0x24420001, 0xaf420388, 0x8f420388, 
-0x24030001, 0x8c020260, 0x8fab0074, 0x4b102b, 
-0x10400014, 0x307000ff, 0x8f4201e8, 0x24420001, 
-0xaf4201e8, 0x8f4201e8, 0x8faa0084, 0x8f8200e0, 
-0x354a0100, 0xafaa0084, 0xafa20010, 0x8f8200e4, 
-0x24100001, 0x3c040001, 0x24847f68, 0xafa20014, 
-0x8fa60020, 0x8fa70024, 0x3c050007, 0xc002d3b, 
-0x34a50800, 0x12000011, 0x3c020080, 0x2c21024, 
-0x1440000f, 0x32c20400, 0x8fab0084, 0x3c020080, 
-0x34420100, 0x1621024, 0x10400005, 0x0, 
-0x8f42020c, 0x24420001, 0xaf42020c, 0x8f42020c, 
-0x8fa30074, 0x10000377, 0x0, 0x32c20400, 
-0x10400015, 0x34028100, 0x8faa006c, 0x9543000c, 
-0x14620012, 0x3c020100, 0x240b0200, 0xa7ab0096, 
-0x9542000e, 0x8d430008, 0x8d440004, 0x8d450000, 
-0x8faa0074, 0x8fab006c, 0x254afffc, 0xafaa0074, 
-0xa7a2008e, 0xad63000c, 0xad640008, 0xad650004, 
-0x256b0004, 0xafab006c, 0x3c020100, 0x2c21024, 
-0x10400004, 0x0, 0x8faa0074, 0x254a0004, 
-0xafaa0074, 0x16000005, 0x24020800, 0x8fab006c, 
-0x9563000c, 0x50620001, 0x2411000e, 0x8f4200bc, 
-0x5040000a, 0xafa0007c, 0x8faa0074, 0x4a102b, 
-0x50400006, 0xafa0007c, 0x8f4200bc, 0x1421023, 
-0xafa2007c, 0x8f4b00bc, 0xafab0074, 0x8f420080, 
-0x8faa0074, 0x4a102b, 0x104000c5, 0x32c28000, 
-0x104000cd, 0x32c21000, 0x10400058, 0x240b0004, 
-0x3c021000, 0x2c21024, 0x104000c7, 0xafab0064, 
-0x122000c5, 0x0, 0x8faa006c, 0x8fab0074, 
-0x1711023, 0x2c420014, 0x144000c0, 0x1512021, 
-0x24830006, 0x90820000, 0x3c05001f, 0x34a5ffff, 
-0x3042000f, 0x23080, 0xa3102b, 0x10400003, 
-0x0, 0x8f420148, 0x621823, 0x94620000, 
-0x30421fff, 0x10400003, 0x2261021, 0x100000ae, 
-0xafa20040, 0x24830009, 0xa3102b, 0x10400003, 
-0x0, 0x8f420148, 0x621823, 0x90630000, 
-0x24020006, 0x14620017, 0x24020011, 0x94820002, 
-0x2c420028, 0x144000a0, 0x861821, 0xa3102b, 
-0x50400004, 0x2463000c, 0x8f420148, 0x621823, 
-0x2463000c, 0xa3102b, 0x10400003, 0x0, 
-0x8f420148, 0x621823, 0x90630000, 0x306200f0, 
-0x21882, 0x2261021, 0x431021, 0x1000008e, 
-0xafa20040, 0x1462008c, 0x0, 0x94820002, 
-0x2c42001c, 0x14400088, 0x2263821, 0x94830002, 
-0x24e20008, 0x2c63009c, 0x14600083, 0xafa20040, 
-0x861821, 0xa3102b, 0x10400003, 0x0, 
-0x8f420148, 0x621823, 0x94620000, 0x24040801, 
-0x10440004, 0x24e20088, 0x94620002, 0x14440076, 
-0x24e20088, 0x10000074, 0xafa20040, 0x10000071, 
-0x240a0003, 0x8f420350, 0x2403ffbf, 0x283a024, 
-0x24420001, 0xaf420350, 0x8f420350, 0x100002b8, 
-0x0, 0x2c2b025, 0x2402ffbf, 0x282a024, 
-0x8f830128, 0x3c040001, 0x24847fa0, 0x26620001, 
-0xafa20014, 0xafa30010, 0x8f860120, 0x8f870124, 
-0x3c050007, 0xc002d3b, 0x34a52250, 0x100002a8, 
-0x0, 0x2c2b025, 0x2402ffbf, 0x282a024, 
-0x8f830128, 0x3c040001, 0x24847fa0, 0x24020002, 
-0xafa20014, 0xafa30010, 0x8f860120, 0x8f870124, 
-0x3c050007, 0xc002d3b, 0x34a52450, 0x10000298, 
-0x0, 0x8ea20000, 0x8ea30004, 0x3c040001, 
-0x24847fb8, 0xafb00010, 0xafbe0014, 0x8ea70018, 
-0x34a52800, 0xc002d3b, 0x603021, 0x3c040001, 
-0x24847f4c, 0x1000001f, 0x2402058d, 0xa6b1000a, 
-0x8f820124, 0x3c040001, 0x24847fc0, 0xafbe0014, 
-0xafa20010, 0x8f460044, 0x8f870120, 0x3c050007, 
-0xc002d3b, 0x34a53000, 0x3c040001, 0x24847f4c, 
-0x10000010, 0x240205c9, 0xa6b1000a, 0xa6b2000e, 
-0x8f820124, 0x3c040001, 0x24847fcc, 0xafbe0014, 
-0xafa20010, 0x8f460044, 0x8f870120, 0x3c050007, 
-0xc002d3b, 0x34a53200, 0x3c040001, 0x24847f4c, 
-0x240205fe, 0xafa20010, 0xafa00014, 0x8f860144, 
-0x3c070001, 0x24e77f98, 0xc002d3b, 0x3405dead, 
-0x8f82011c, 0x34420002, 0xaf82011c, 0x8f820220, 
-0x34420004, 0xaf820220, 0x8f820140, 0x3c030001, 
-0x431025, 0xaf820140, 0x10000259, 0x0, 
-0x8f420084, 0x8fab0074, 0x4b102b, 0x14400007, 
-0x3c020001, 0x2c21024, 0x10400004, 0x0, 
-0x240a0002, 0xafaa0064, 0x8fab0074, 0x1160026d, 
-0x27aa0020, 0xafaa00ac, 0x3c0b001f, 0x356bffff, 
-0xafab00a4, 0x8faa0064, 0x240b0001, 0x154b0022, 
-0x24020002, 0x8f430054, 0x8f420050, 0x1062000b, 
-0x274a0054, 0x8f5e0054, 0x3403ecc0, 0xafaa0054, 
-0x27c20001, 0x304201ff, 0xafa2005c, 0x1e1140, 
-0x431021, 0x10000077, 0x2e2a821, 0x8f420044, 
-0x8fab0074, 0x3c040001, 0x24847f74, 0xafab0014, 
-0xafa20010, 0x8f460054, 0x8f470050, 0x3c050007, 
-0xc002d3b, 0x34a51300, 0x8f430350, 0x2402ffbf, 
-0x282a024, 0x24630001, 0xaf430350, 0x8f420350, 
-0x10000223, 0x0, 0x1542001d, 0x0, 
-0x8f430074, 0x8f420070, 0x1062000a, 0x274b0074, 
-0x8f5e0074, 0xafab0054, 0x27c20001, 0x304203ff, 
-0xafa2005c, 0x1e1140, 0x24426cc0, 0x10000055, 
-0x2e2a821, 0x8f420044, 0x8faa0074, 0x3c040001, 
-0x24847f80, 0x3c050007, 0xafaa0014, 0xafa20010, 
-0x8f460074, 0x8f470070, 0x34a51500, 0x240b0001, 
-0xc002d3b, 0xafab0064, 0x1000ffc2, 0x0, 
-0x8f430064, 0x8f420060, 0x1062002b, 0x274a0064, 
-0x8f5e0064, 0x8fab0064, 0xafaa0054, 0x27c20001, 
-0x304200ff, 0xafa2005c, 0x24020004, 0x1562001f, 
-0x1e1140, 0x1e1180, 0x24420cc0, 0x2e21021, 
-0xafa2004c, 0x24550020, 0x3c021000, 0x2c21024, 
-0x1040000e, 0x0, 0x8faa004c, 0x8fab0074, 
-0x9542002a, 0x4b102b, 0x54400006, 0x240a0001, 
-0x8fa20040, 0x10400027, 0x0, 0x104b0025, 
-0x240a0001, 0x10000023, 0xa3aa009f, 0x8fab004c, 
-0x8faa0074, 0x9562002a, 0x4a102b, 0x1040001d, 
-0x240b0001, 0x1000001b, 0xa3ab009f, 0x24424cc0, 
-0x10000018, 0x2e2a821, 0x8f420044, 0x8faa0074, 
-0x3c040001, 0x24847f8c, 0xafaa0014, 0xafa20010, 
-0x8f460064, 0x8f470060, 0x3c050007, 0xc002d3b, 
-0x34a51800, 0x3c020008, 0x2c21024, 0x1440ff09, 
-0x0, 0x8f420370, 0x240b0001, 0xafab0064, 
-0x24420001, 0xaf420370, 0x8f420370, 0x1000ff7d, 
-0x0, 0x8faa006c, 0xaeaa0018, 0x93a2009f, 
-0x104000ae, 0x24050002, 0x8fab004c, 0x8fa40040, 
-0x25620020, 0xafa20028, 0x25620008, 0xafa20030, 
-0x25620010, 0xafab002c, 0x1080000e, 0xafa20034, 
-0x9563002a, 0x83102b, 0x54400001, 0x801821, 
-0x1000000b, 0xa7a30038, 0x27a30036, 0x131040, 
-0x621821, 0x94620000, 0x441021, 0x10000016, 
-0xa4620000, 0x8faa004c, 0x9542002a, 0xa7a20038, 
-0x8fab004c, 0x8fa40074, 0x8fa300ac, 0x95620018, 
-0xa7a2003a, 0x9562001a, 0xa7a2003c, 0x9562001c, 
-0x9821, 0xa7a2003e, 0x94620018, 0x24630002, 
-0x822023, 0x1880ffe8, 0x26730001, 0x2e620004, 
-0x1440fff9, 0x0, 0x18800014, 0x2402052b, 
-0x3c040001, 0x24847f4c, 0xafa20010, 0xafa00014, 
-0x8f860144, 0x3c070001, 0x24e77f98, 0xc002d3b, 
-0x3405dead, 0x8f82011c, 0x34420002, 0xaf82011c, 
-0x8f820220, 0x34420004, 0xaf820220, 0x8f820140, 
-0x3c030001, 0x431025, 0xaf820140, 0x8f4200fc, 
-0x26650001, 0xa2102a, 0x1440003f, 0x24030001, 
-0x8f83012c, 0x10600037, 0x0, 0x8f820124, 
-0x431023, 0x22143, 0x58800001, 0x24840040, 
-0x8f820128, 0x431023, 0x21943, 0x58600001, 
-0x24630040, 0x64102a, 0x54400001, 0x602021, 
-0xaf4400fc, 0x8f4200fc, 0xa2102a, 0x10400025, 
-0x24030001, 0x10000029, 0x306200ff, 0x8faa006c, 
-0x96070018, 0xafaa0010, 0x8e220008, 0x3c040001, 
-0x24847fac, 0x8c430004, 0x8c420000, 0x34a52400, 
-0x2403021, 0xc002d3b, 0xafa30014, 0x3c040001, 
-0x24847f4c, 0x2402054f, 0xafa20010, 0xafa00014, 
-0x8f860144, 0x3c070001, 0x24e77f98, 0xc002d3b, 
-0x3405dead, 0x8f82011c, 0x34420002, 0xaf82011c, 
-0x8f820220, 0x34420004, 0xaf820220, 0x8f820140, 
-0x3c030001, 0x431025, 0xaf820140, 0x1000002b, 
-0x0, 0x8f420334, 0x1821, 0x24420001, 
-0xaf420334, 0x8f420334, 0x306200ff, 0x5040fe7d, 
-0x3c020800, 0x12600021, 0x9021, 0x8fb100ac, 
-0x2208021, 0x8e220008, 0x96070018, 0x8fa6006c, 
-0x8c440000, 0x8c450004, 0x240b0001, 0xafab0010, 
-0xafbe0014, 0x8f420008, 0xafa20018, 0x8f42010c, 
-0x40f809, 0x0, 0x1040ffc4, 0x3c050007, 
-0x96020018, 0x8faa006c, 0x8fab00a4, 0x1425021, 
-0x16a102b, 0x10400004, 0xafaa006c, 0x8f420148, 
-0x1425023, 0xafaa006c, 0x26100002, 0x26520001, 
-0x253102b, 0x1440ffe3, 0x26310004, 0x8fb00074, 
-0x97b10038, 0x10000035, 0x0, 0x8f4200fc, 
-0xa2102a, 0x1440001b, 0x24030001, 0x8f83012c, 
-0x10600013, 0x0, 0x8f820124, 0x431023, 
-0x22143, 0x58800001, 0x24840040, 0x8f820128, 
-0x431023, 0x21943, 0x58600001, 0x24630040, 
-0x64102a, 0x54400001, 0x602021, 0xaf4400fc, 
-0x8f4200fc, 0xa2102a, 0x14400006, 0x24030001, 
-0x8f420334, 0x1821, 0x24420001, 0xaf420334, 
-0x8f420334, 0x306200ff, 0x1040fe46, 0x3c020800, 
-0x96b1000a, 0x8fb00074, 0x3223ffff, 0x70102b, 
-0x54400001, 0x608021, 0x8ea40000, 0x8ea50004, 
-0x240a0001, 0xafaa0010, 0xafbe0014, 0x8f420008, 
-0x8fa6006c, 0xafa20018, 0x8f42010c, 0x40f809, 
-0x2003821, 0x1040fe43, 0x3c050007, 0x96a4000e, 
-0x97ab0096, 0x11600007, 0x809021, 0x934205c4, 
-0x14400004, 0x0, 0x97aa008e, 0x8b2025, 
-0xa6aa0016, 0x8fab0084, 0x3c02ffff, 0x1621024, 
-0x10400003, 0xb1402, 0x34840400, 0xa6a20014, 
-0x3c021000, 0x2c21024, 0x10400006, 0x0, 
-0x8fa20040, 0x401821, 0x1021, 0xaea20000, 
-0xaea30004, 0x8faa0074, 0x560a0073, 0xa6a4000e, 
-0x34820004, 0xa6a2000e, 0x8fab007c, 0x14b1021, 
-0xa6a2000a, 0x8f430044, 0x8f4401a0, 0x8f4501a4, 
-0x34028000, 0xafa20010, 0x8f420044, 0x2a03021, 
-0x24070020, 0xafa20014, 0x8f42000c, 0x31940, 
-0x604821, 0xafa20018, 0x8f42010c, 0x4021, 
-0xa92821, 0xa9182b, 0x882021, 0x40f809, 
-0x832021, 0x5040fe19, 0xa6b2000e, 0x8f420368, 
-0xafa00074, 0xa34005c4, 0x2442ffff, 0xaf420368, 
-0x8faa0064, 0x240b0001, 0x8f420368, 0x154b0006, 
-0x24020002, 0x8f42035c, 0x2442ffff, 0xaf42035c, 
-0x1000000c, 0x8f42035c, 0x15420006, 0x0, 
-0x8f420364, 0x2442ffff, 0xaf420364, 0x10000005, 
-0x8f420364, 0x8f420360, 0x2442ffff, 0xaf420360, 
-0x8f420360, 0x8faa005c, 0x8fab0054, 0xad6a0000, 
-0x8f420044, 0x8f440088, 0x8f430078, 0x24420001, 
-0x441024, 0x24630001, 0xaf420044, 0xaf430078, 
-0x8c020240, 0x62182b, 0x14600076, 0x24070008, 
-0x8f440168, 0x8f45016c, 0x8f430044, 0x8f48000c, 
-0x8f860120, 0x24020040, 0xafa20010, 0xafa30014, 
-0xafa80018, 0x8f42010c, 0x40f809, 0x24c6001c, 
-0x14400011, 0x240b0001, 0x3c010001, 0x370821, 
-0xa02b40f2, 0x8f820124, 0xafa20010, 0x8f820128, 
-0x3c040001, 0x24847f44, 0xafa20014, 0x8f460044, 
-0x8f870120, 0x3c050009, 0xc002d3b, 0x34a51300, 
-0x1000000b, 0x0, 0x8f420304, 0x24420001, 
-0xaf420304, 0x8f420304, 0x8f420044, 0xaf42007c, 
-0x3c010001, 0x370821, 0xa02040f2, 0xaf400078, 
-0x8f420318, 0x24420001, 0xaf420318, 0x8f420318, 
-0x10000048, 0x0, 0xa6b0000a, 0x8f430044, 
-0x8f4401a0, 0x8f4501a4, 0x34028000, 0xafa20010, 
-0x8f420044, 0x2a03021, 0x24070020, 0xafa20014, 
-0x8f42000c, 0x31940, 0x604821, 0xafa20018, 
-0x8f42010c, 0x4021, 0xa92821, 0xa9182b, 
-0x882021, 0x40f809, 0x832021, 0x1040fdba, 
-0x240a0001, 0xa34a05c4, 0x8fab0074, 0x8faa006c, 
-0x1705823, 0xafab0074, 0x8fab00a4, 0x1505021, 
-0x16a102b, 0x10400004, 0xafaa006c, 0x8f420148, 
-0x1425023, 0xafaa006c, 0x8f420368, 0x2442ffff, 
-0xaf420368, 0x8faa0064, 0x240b0001, 0x8f420368, 
-0x154b0006, 0x24020002, 0x8f42035c, 0x2442ffff, 
-0xaf42035c, 0x1000000c, 0x8f42035c, 0x11420006, 
-0x0, 0x8f420360, 0x2442ffff, 0xaf420360, 
-0x10000005, 0x8f420360, 0x8f420364, 0x2442ffff, 
-0xaf420364, 0x8f420364, 0x8faa005c, 0x8fab0054, 
-0xad6a0000, 0x8f420044, 0x8f440088, 0x8f430078, 
-0x24420001, 0x441024, 0x24630001, 0xaf420044, 
-0xaf430078, 0x8fab0074, 0x1560fdba, 0x0, 
-0x8faa0074, 0x1140001f, 0x0, 0x934205c4, 
-0x10400009, 0x0, 0x8fab006c, 0xaf4b00c4, 
-0xaf4a00c0, 0x8faa0084, 0xaf4a00c8, 0x8fab007c, 
-0x1000000e, 0xaf4b00cc, 0x97aa0096, 0x1140000b, 
-0x34038100, 0x8fa20020, 0x8c46000c, 0xa443000c, 
-0x97ab008e, 0x8c440004, 0x8c450008, 0xa44b000e, 
-0xac440000, 0xac450004, 0xac460008, 0x8f42034c, 
-0x24420001, 0xaf42034c, 0x8f42034c, 0x10000011, 
-0x0, 0x8faa0084, 0x3144ffff, 0x2484fffc, 
-0x801821, 0x8f440250, 0x8f450254, 0x8f460118, 
-0x1021, 0xa32821, 0xa3382b, 0x822021, 
-0x872021, 0xaf440250, 0xaf450254, 0xc0f809, 
-0x0, 0x8fbf00d0, 0x8fbe00cc, 0x8fb500c8, 
-0x8fb300c4, 0x8fb200c0, 0x8fb100bc, 0x8fb000b8, 
-0x3e00008, 0x27bd00d8, 0x3e00008, 0x0, 
-0x27bdff30, 0x240b0001, 0xafbf00c8, 0xafbe00c4, 
-0xafb500c0, 0xafb300bc, 0xafb200b8, 0xafb100b4, 
-0xafb000b0, 0xa3a0008f, 0xafa0004c, 0xafab0064, 
-0xa7a0007e, 0xafa00040, 0x934205c4, 0x8821, 
-0x10400007, 0xa7a00086, 0x8f4c00c0, 0xafac006c, 
-0x8f4b00c8, 0x8f5e00c4, 0x10000184, 0xafab0074, 
-0x8f420114, 0x40f809, 0x0, 0x403021, 
-0x10c00348, 0x0, 0x8cc20000, 0x8cc30004, 
-0xafa20020, 0xafa30024, 0x8fac0024, 0x8fbe0020, 
-0x3182ffff, 0x2442fffc, 0xafa2006c, 0x3c020006, 
-0x2c21024, 0x14400015, 0xafac0074, 0x93c20000, 
-0x30420001, 0x10400011, 0x2402ffff, 0x8fc30000, 
-0x14620004, 0x3402ffff, 0x97c30004, 0x1062000b, 
-0x0, 0xc0025dd, 0x3c02021, 0x304200ff, 
-0x14400006, 0x0, 0x8f420118, 0x40f809, 
-0x0, 0x10000327, 0x0, 0x8fa20024, 
-0x3c03ffbf, 0x3463ffff, 0x431024, 0x3c03ffff, 
-0x431824, 0x14600003, 0xafa20024, 0x10000040, 
-0x8021, 0x3c020080, 0x621024, 0x10400007, 
-0x0, 0x8f42038c, 0x24420001, 0xaf42038c, 
-0x8f42038c, 0x10000036, 0x24100001, 0x8f420210, 
-0x24420001, 0xaf420210, 0x8f420210, 0x3c020001, 
-0x621024, 0x10400006, 0x3c020002, 0x8f4201c4, 
-0x24420001, 0xaf4201c4, 0x8f4201c4, 0x3c020002, 
-0x621024, 0x10400006, 0x3c020004, 0x8f42037c, 
-0x24420001, 0xaf42037c, 0x8f42037c, 0x3c020004, 
-0x621024, 0x10400006, 0x3c020008, 0x8f420380, 
-0x24420001, 0xaf420380, 0x8f420380, 0x3c020008, 
-0x621024, 0x10400006, 0x3c020010, 0x8f420384, 
-0x24420001, 0xaf420384, 0x8f420384, 0x3c020010, 
-0x621024, 0x10400006, 0x3c020020, 0x8f4201c0, 
-0x24420001, 0xaf4201c0, 0x8f4201c0, 0x3c020020, 
-0x621024, 0x10400006, 0x24100001, 0x8f420388, 
-0x24420001, 0xaf420388, 0x8f420388, 0x24100001, 
-0x8c020260, 0x8fab006c, 0x4b102b, 0x10400015, 
-0x320200ff, 0x8f4201e8, 0x24420001, 0xaf4201e8, 
-0x8f4201e8, 0x8fac0074, 0x8f8200e0, 0x358c0100, 
-0xafac0074, 0xafa20010, 0x8f8200e4, 0x24100001, 
-0x3c040001, 0x24847f68, 0xafa20014, 0x8fa60020, 
-0x8fa70024, 0x3c050007, 0xc002d3b, 0x34a53600, 
-0x320200ff, 0x10400011, 0x3c020080, 0x2c21024, 
-0x1440000f, 0x32c20400, 0x8fab0074, 0x3c020080, 
-0x34420100, 0x1621024, 0x10400005, 0x0, 
-0x8f42020c, 0x24420001, 0xaf42020c, 0x8f42020c, 
-0x8fa3006c, 0x100002a7, 0x0, 0x32c20400, 
-0x10400012, 0x34028100, 0x97c3000c, 0x1462000f, 
-0x0, 0x240c0200, 0xa7ac007e, 0x97c2000e, 
-0x8fc30008, 0x8fc40004, 0x8fab006c, 0x8fc50000, 
-0x256bfffc, 0xafab006c, 0xa7a20086, 0xafc3000c, 
-0xafc40008, 0xafc50004, 0x27de0004, 0x8fa7006c, 
-0x320200ff, 0x14400033, 0x3c020100, 0x97c4000c, 
-0x2c8305dd, 0x38828870, 0x2c420001, 0x621825, 
-0x10600014, 0x32c20800, 0x10400015, 0x24020800, 
-0x97c30014, 0x14620012, 0x3402aaaa, 0x97c3000e, 
-0x14620007, 0x2021, 0x97c30010, 0x24020300, 
-0x14620004, 0x801021, 0x97c20012, 0x2c440001, 
-0x801021, 0x54400006, 0x24110016, 0x10000004, 
-0x0, 0x24020800, 0x50820001, 0x2411000e, 
-0x12200013, 0x3d12021, 0x24830009, 0x3c02001f, 
-0x3442ffff, 0x43102b, 0x10400003, 0x0, 
-0x8f420148, 0x621823, 0x90620000, 0x38430006, 
-0x2c630001, 0x38420011, 0x2c420001, 0x621825, 
-0x10600004, 0x3c020100, 0x94820002, 0x513821, 
-0x3c020100, 0x2c21024, 0x5040000e, 0xafa7006c, 
-0x8fac006c, 0x10ec0008, 0x3c050007, 0x3c040001, 
-0x24847fd8, 0x8fa6006c, 0x34a54000, 0xafa00010, 
-0xc002d3b, 0xafa00014, 0x8fab006c, 0x256b0004, 
-0xafab006c, 0x8f420080, 0x8fac006c, 0x4c102b, 
-0x10400080, 0x32c28000, 0x10400088, 0x32c21000, 
-0x10400055, 0x240b0004, 0x3c021000, 0x2c21024, 
-0x10400082, 0xafab0064, 0x12200080, 0x1911023, 
-0x2c420014, 0x1440007d, 0x3d12021, 0x24830006, 
-0x90820000, 0x3c05001f, 0x34a5ffff, 0x3042000f, 
-0x23080, 0xa3102b, 0x10400003, 0x0, 
-0x8f420148, 0x621823, 0x94620000, 0x30421fff, 
-0x10400003, 0x2261021, 0x1000006c, 0xafa20040, 
-0x24830009, 0xa3102b, 0x10400003, 0x0, 
-0x8f420148, 0x621823, 0x90630000, 0x24020006, 
-0x14620017, 0x24020011, 0x94820002, 0x2c420028, 
-0x1440005e, 0x861821, 0xa3102b, 0x50400004, 
-0x2463000c, 0x8f420148, 0x621823, 0x2463000c, 
-0xa3102b, 0x10400003, 0x0, 0x8f420148, 
-0x621823, 0x90630000, 0x306200f0, 0x21882, 
-0x2261021, 0x431021, 0x1000004c, 0xafa20040, 
-0x1462004a, 0x0, 0x94820002, 0x2c42001c, 
-0x14400046, 0x2263821, 0x94830002, 0x24e20008, 
-0x2c63009c, 0x14600041, 0xafa20040, 0x861821, 
-0xa3102b, 0x10400003, 0x0, 0x8f420148, 
-0x621823, 0x94620000, 0x24040801, 0x10440004, 
-0x24e20088, 0x94620002, 0x14440034, 0x24e20088, 
-0x10000032, 0xafa20040, 0x1000002f, 0x240c0003, 
-0x8f420350, 0x2403ffbf, 0x283a024, 0x24420001, 
-0xaf420350, 0x8f420350, 0x100001c4, 0x0, 
-0x3c020800, 0x2c2b025, 0x2402ffbf, 0x282a024, 
-0x8f830128, 0x3c040001, 0x24847fa0, 0x26620001, 
-0xafa20014, 0xafa30010, 0x8f860120, 0x8f870124, 
-0x3c050007, 0xc002d3b, 0x34a55300, 0x100001b3, 
-0x0, 0x8ea20000, 0x8ea30004, 0x3c040001, 
-0x24847fb8, 0xafb00010, 0xafb10014, 0x8ea70018, 
-0x34a55900, 0xc002d3b, 0x603021, 0x100001a7, 
-0x0, 0x8f420084, 0x8fab006c, 0x4b102b, 
-0x14400007, 0x3c020001, 0x2c21024, 0x10400004, 
-0x0, 0x240c0002, 0xafac0064, 0x8fab006c, 
-0x116001b8, 0x27ac0020, 0xafac0094, 0x8fab0064, 
-0x240c0001, 0x556c0022, 0x240c0002, 0x8f430054, 
-0x8f420050, 0x1062000b, 0x274b0054, 0x8f510054, 
-0x3403ecc0, 0xafab0054, 0x26220001, 0x304201ff, 
-0xafa2005c, 0x111140, 0x431021, 0x10000077, 
-0x2e2a821, 0x8f420044, 0x8fac006c, 0x3c040001, 
-0x24847f74, 0xafac0014, 0xafa20010, 0x8f460054, 
-0x8f470050, 0x3c050007, 0xc002d3b, 0x34a54300, 
-0x8f430350, 0x2402ffbf, 0x282a024, 0x24630001, 
-0xaf430350, 0x8f420350, 0x10000174, 0x0, 
-0x156c001d, 0x0, 0x8f430074, 0x8f420070, 
-0x1062000a, 0x274b0074, 0x8f510074, 0xafab0054, 
-0x26220001, 0x304203ff, 0xafa2005c, 0x111140, 
-0x24426cc0, 0x10000055, 0x2e2a821, 0x8f420044, 
-0x8fac006c, 0x3c040001, 0x24847f80, 0x3c050007, 
-0xafac0014, 0xafa20010, 0x8f460074, 0x8f470070, 
-0x34a54500, 0x240b0001, 0xc002d3b, 0xafab0064, 
-0x1000ffc2, 0x0, 0x8f430064, 0x8f420060, 
-0x1062002b, 0x274c0064, 0x8f510064, 0x8fab0064, 
-0xafac0054, 0x26220001, 0x304200ff, 0xafa2005c, 
-0x24020004, 0x1562001f, 0x111140, 0x111180, 
-0x24420cc0, 0x2e21021, 0xafa2004c, 0x24550020, 
-0x3c021000, 0x2c21024, 0x1040000e, 0x0, 
-0x8fac004c, 0x8fab006c, 0x9582002a, 0x4b102b, 
-0x54400006, 0x240c0001, 0x8fa20040, 0x50400028, 
-0xaebe0018, 0x104b0025, 0x240c0001, 0x10000023, 
-0xa3ac008f, 0x8fab004c, 0x8fac006c, 0x9562002a, 
-0x4c102b, 0x1040001d, 0x240b0001, 0x1000001b, 
-0xa3ab008f, 0x24424cc0, 0x10000018, 0x2e2a821, 
-0x8f420044, 0x8fac006c, 0x3c040001, 0x24847f8c, 
-0xafac0014, 0xafa20010, 0x8f460064, 0x8f470060, 
-0x3c050007, 0xc002d3b, 0x34a54800, 0x3c020008, 
-0x2c21024, 0x1440ff4e, 0x0, 0x8f420370, 
-0x240b0001, 0xafab0064, 0x24420001, 0xaf420370, 
-0x8f420370, 0x1000ff7d, 0x0, 0xaebe0018, 
-0x93a2008f, 0x104000bf, 0x0, 0x8fac004c, 
-0x8fa40040, 0x25820020, 0xafa20028, 0x25820008, 
-0xafa20030, 0x25820010, 0xafac002c, 0x1080000e, 
-0xafa20034, 0x9583002a, 0x83102b, 0x54400001, 
-0x801821, 0x1000000b, 0xa7a30038, 0x27a30036, 
-0x131040, 0x621821, 0x94620000, 0x441021, 
-0x10000016, 0xa4620000, 0x8fab004c, 0x9562002a, 
-0xa7a20038, 0x8fac004c, 0x8fa4006c, 0x8fa30094, 
-0x95820018, 0xa7a2003a, 0x9582001a, 0xa7a2003c, 
-0x9582001c, 0x9821, 0xa7a2003e, 0x94620018, 
-0x24630002, 0x822023, 0x1880ffe8, 0x26730001, 
-0x2e620004, 0x1440fff9, 0x0, 0x18800014, 
-0x240207c2, 0x3c040001, 0x24847f4c, 0xafa20010, 
-0xafa00014, 0x8f860144, 0x3c070001, 0x24e77f98, 
-0xc002d3b, 0x3405dead, 0x8f82011c, 0x34420002, 
-0xaf82011c, 0x8f820220, 0x34420004, 0xaf820220, 
-0x8f820140, 0x3c030001, 0x431025, 0xaf820140, 
-0x8f4200fc, 0x262102a, 0x14400044, 0x24030001, 
-0x8f83012c, 0x1060003c, 0x0, 0x8f820124, 
-0x431023, 0x22143, 0x58800001, 0x24840040, 
-0x8f820128, 0x431023, 0x21943, 0x58600001, 
-0x24630040, 0x64102a, 0x54400001, 0x602021, 
-0xaf4400fc, 0x8f4200fc, 0x262102a, 0x1040002a, 
-0x24030001, 0x1000002e, 0x306200ff, 0x8fab0094, 
-0x101040, 0x4b1021, 0x94470018, 0x101080, 
-0x4b1021, 0xafbe0010, 0x8c420008, 0x3c040001, 
-0x24847fac, 0x3c050007, 0x8c430004, 0x8c420000, 
-0x34a55500, 0x2003021, 0xc002d3b, 0xafa30014, 
-0x3c040001, 0x24847f4c, 0x240207f4, 0xafa20010, 
-0xafa00014, 0x8f860144, 0x3c070001, 0x24e77f98, 
-0xc002d3b, 0x3405dead, 0x8f82011c, 0x34420002, 
-0xaf82011c, 0x8f820220, 0x34420004, 0xaf820220, 
-0x8f820140, 0x3c030001, 0x431025, 0xaf820140, 
-0x10000039, 0x0, 0x8f420334, 0x1821, 
-0x24420001, 0xaf420334, 0x8f420334, 0x306200ff, 
-0x1040febf, 0x8021, 0x8f430008, 0x2402fbff, 
-0x1260002d, 0x625024, 0x3c0c4000, 0x22c4025, 
-0x8fb10094, 0x2669ffff, 0x2209021, 0x8e420008, 
-0x96270018, 0x8c440000, 0x8c450004, 0x56090004, 
-0x240c0001, 0x240b0002, 0x10000002, 0xafab0010, 
-0xafac0010, 0x16000004, 0xafa80014, 0x8f420008, 
-0x10000002, 0xafa20018, 0xafaa0018, 0x8f42010c, 
-0x3c03021, 0xafa800a0, 0xafa900a4, 0x40f809, 
-0xafaa00a8, 0x8fa800a0, 0x8fa900a4, 0x8faa00a8, 
-0x1040ffae, 0x3c02001f, 0x96230018, 0x3442ffff, 
-0x3c3f021, 0x5e102b, 0x10400003, 0x26310002, 
-0x8f420148, 0x3c2f023, 0x26100001, 0x213102b, 
-0x1440ffda, 0x26520004, 0x8fb0006c, 0x1000001a, 
-0x0, 0x96a3000a, 0x8fb0006c, 0x70102b, 
-0x54400001, 0x608021, 0x8ea40000, 0x8ea50004, 
-0x8fac0064, 0x240b0002, 0xafab0010, 0x934305c4, 
-0xc1700, 0x10600003, 0x2223025, 0x3c020800, 
-0xc23025, 0xafa60014, 0x8f420008, 0xafa20018, 
-0x8f42010c, 0x3c03021, 0x40f809, 0x2003821, 
-0x1040fe84, 0x3c050007, 0x97ab007e, 0x96a3000e, 
-0x11600007, 0x0, 0x934205c4, 0x14400004, 
-0x0, 0x97ac0086, 0x6b1825, 0xa6ac0016, 
-0x8fab0074, 0x3c02ffff, 0x1621024, 0x10400003, 
-0xb1402, 0x34630400, 0xa6a20014, 0xa6b0000a, 
-0x8fac006c, 0x560c0006, 0x3d0f021, 0x34620004, 
-0xafa0006c, 0xa6a2000e, 0x1000000d, 0xa34005c4, 
-0x8fab006c, 0x3c02001f, 0x3442ffff, 0x5e102b, 
-0x1705823, 0xafab006c, 0xa6a3000e, 0x240c0001, 
-0x10400003, 0xa34c05c4, 0x8f420148, 0x3c2f023, 
-0x3c021000, 0x2c21024, 0x10400006, 0x0, 
-0x8fa20040, 0x401821, 0x1021, 0xaea20000, 
-0xaea30004, 0x8fac005c, 0x8fab0054, 0xad6c0000, 
-0x8fab006c, 0x1560fe69, 0x0, 0x8fac006c, 
-0x1180001c, 0x0, 0x934205c4, 0x10400006, 
-0x0, 0xaf5e00c4, 0xaf4c00c0, 0x8fab0074, 
-0x1000000e, 0xaf4b00c8, 0x97ac007e, 0x1180000b, 
-0x34038100, 0x8fa20020, 0x8c46000c, 0xa443000c, 
-0x97ab0086, 0x8c440004, 0x8c450008, 0xa44b000e, 
-0xac440000, 0xac450004, 0xac460008, 0x8f42034c, 
-0x24420001, 0xaf42034c, 0x8f42034c, 0x10000011, 
-0x0, 0x8fac0074, 0x3184ffff, 0x2484fffc, 
-0x801821, 0x8f440250, 0x8f450254, 0x8f460118, 
-0x1021, 0xa32821, 0xa3382b, 0x822021, 
-0x872021, 0xaf440250, 0xaf450254, 0xc0f809, 
-0x0, 0x8fbf00c8, 0x8fbe00c4, 0x8fb500c0, 
-0x8fb300bc, 0x8fb200b8, 0x8fb100b4, 0x8fb000b0, 
-0x3e00008, 0x27bd00d0, 0x3e00008, 0x0, 
-0x27bdffd0, 0xafbf0028, 0xafb10024, 0xafb00020, 
-0x8f43004c, 0x8f420048, 0x1062004a, 0x0, 
-0x8f430048, 0x8f42004c, 0x628823, 0x6220001, 
-0x26310200, 0x8f430054, 0x8f42004c, 0x43102b, 
-0x14400004, 0x24020200, 0x8f43004c, 0x10000005, 
-0x438023, 0x8f420054, 0x8f43004c, 0x431023, 
-0x2450ffff, 0x16000016, 0x2005821, 0x3c040001, 
-0x24847f4c, 0x24020888, 0xafa20010, 0xafa00014, 
-0x8f860144, 0x3c070001, 0x24e77f98, 0xc002d3b, 
-0x3405dead, 0x8f82011c, 0x34420002, 0xaf82011c, 
-0x8f820220, 0x34420004, 0xaf820220, 0x8f820140, 
-0x3c030001, 0x431025, 0xaf820140, 0x2005821, 
-0x22b102a, 0x54400001, 0x2205821, 0x8f4a004c, 
-0x8f49004c, 0x8f440188, 0x8f45018c, 0x8f46004c, 
-0xb3940, 0x24081000, 0xafa80010, 0x94940, 
-0x1201821, 0x1021, 0x14b5021, 0x315001ff, 
-0xafb00014, 0x8f480014, 0xa32821, 0xa3482b, 
-0x822021, 0x892021, 0x63140, 0x3402ecc0, 
-0xafa80018, 0x8f430108, 0xc23021, 0x60f809, 
-0x2e63021, 0x54400001, 0xaf50004c, 0x8f43004c, 
-0x8f420048, 0x14620019, 0x0, 0x8f420000, 
-0x10400007, 0x0, 0xaf80004c, 0x8f82004c, 
-0x1040fffd, 0x0, 0x10000005, 0x0, 
-0xaf800048, 0x8f820048, 0x1040fffd, 0x0, 
-0x8f820060, 0x2403fdff, 0x431024, 0xaf820060, 
-0x8f420000, 0x10400004, 0x0, 0xaf80004c, 
-0x10000002, 0x0, 0xaf800048, 0x8fbf0028, 
-0x8fb10024, 0x8fb00020, 0x3e00008, 0x27bd0030, 
-0x3e00008, 0x0, 0x27bdffd0, 0xafbf0028, 
-0xafb10024, 0xafb00020, 0x8f43005c, 0x8f420058, 
-0x1062005f, 0x0, 0x8f430058, 0x8f42005c, 
-0x628823, 0x6220001, 0x26310100, 0x8f430064, 
-0x8f42005c, 0x43102b, 0x14400004, 0x24020100, 
-0x8f43005c, 0x10000005, 0x438023, 0x8f420064, 
-0x8f43005c, 0x431023, 0x2450ffff, 0x16000016, 
-0x2003821, 0x3c040001, 0x24847f4c, 0x240208e2, 
-0xafa20010, 0xafa00014, 0x8f860144, 0x3c070001, 
-0x24e77f98, 0xc002d3b, 0x3405dead, 0x8f82011c, 
-0x34420002, 0xaf82011c, 0x8f820220, 0x34420004, 
-0xaf820220, 0x8f820140, 0x3c030001, 0x431025, 
-0xaf820140, 0x2003821, 0x227102a, 0x54400001, 
-0x2203821, 0x8f42005c, 0x471021, 0x305000ff, 
-0x32c21000, 0x10400015, 0x24082000, 0x8f49005c, 
-0x8f440190, 0x8f450194, 0x8f46005c, 0x73980, 
-0xafa80010, 0xafb00014, 0x8f480014, 0x94980, 
-0x1201821, 0x1021, 0xa32821, 0xa3482b, 
-0x822021, 0x892021, 0x63180, 0xafa80018, 
-0x8f420108, 0x10000014, 0x24c60cc0, 0x8f49005c, 
-0x8f440190, 0x8f450194, 0x8f46005c, 0x73940, 
-0xafa80010, 0xafb00014, 0x8f480014, 0x94940, 
-0x1201821, 0x1021, 0xa32821, 0xa3482b, 
-0x822021, 0x892021, 0x63140, 0xafa80018, 
-0x8f420108, 0x24c64cc0, 0x40f809, 0x2e63021, 
-0x54400001, 0xaf50005c, 0x8f43005c, 0x8f420058, 
-0x14620019, 0x0, 0x8f420000, 0x10400007, 
-0x0, 0xaf80004c, 0x8f82004c, 0x1040fffd, 
-0x0, 0x10000005, 0x0, 0xaf800048, 
-0x8f820048, 0x1040fffd, 0x0, 0x8f820060, 
-0x2403feff, 0x431024, 0xaf820060, 0x8f420000, 
-0x10400004, 0x0, 0xaf80004c, 0x10000002, 
-0x0, 0xaf800048, 0x8fbf0028, 0x8fb10024, 
-0x8fb00020, 0x3e00008, 0x27bd0030, 0x3e00008, 
-0x0, 0x27bdffd0, 0xafbf0028, 0xafb10024, 
-0xafb00020, 0x8f43006c, 0x8f420068, 0x10620049, 
-0x0, 0x8f430068, 0x8f42006c, 0x628823, 
-0x6220001, 0x26310400, 0x8f430074, 0x8f42006c, 
-0x43102b, 0x14400004, 0x24020400, 0x8f43006c, 
-0x10000005, 0x438023, 0x8f420074, 0x8f43006c, 
-0x431023, 0x2450ffff, 0x16000016, 0x2005821, 
-0x3c040001, 0x24847f4c, 0x2402094b, 0xafa20010, 
-0xafa00014, 0x8f860144, 0x3c070001, 0x24e77f98, 
-0xc002d3b, 0x3405dead, 0x8f82011c, 0x34420002, 
-0xaf82011c, 0x8f820220, 0x34420004, 0xaf820220, 
-0x8f820140, 0x3c030001, 0x431025, 0xaf820140, 
-0x2005821, 0x22b102a, 0x54400001, 0x2205821, 
-0x8f4a006c, 0x8f49006c, 0x8f440198, 0x8f45019c, 
-0x8f46006c, 0xb3940, 0x24084000, 0xafa80010, 
-0x94940, 0x1201821, 0x1021, 0x14b5021, 
-0x315003ff, 0xafb00014, 0x8f480014, 0xa32821, 
-0xa3482b, 0x822021, 0x892021, 0x63140, 
-0xafa80018, 0x8f420108, 0x24c66cc0, 0x40f809, 
-0x2e63021, 0x54400001, 0xaf50006c, 0x8f43006c, 
-0x8f420068, 0x14620019, 0x0, 0x8f420000, 
-0x10400007, 0x0, 0xaf80004c, 0x8f82004c, 
-0x1040fffd, 0x0, 0x10000005, 0x0, 
-0xaf800048, 0x8f820048, 0x1040fffd, 0x0, 
-0x8f820060, 0x2403f7ff, 0x431024, 0xaf820060, 
-0x8f420000, 0x10400004, 0x0, 0xaf80004c, 
-0x10000002, 0x0, 0xaf800048, 0x8fbf0028, 
-0x8fb10024, 0x8fb00020, 0x3e00008, 0x27bd0030, 
-0x3e00008, 0x0, 0x27bdffe0, 0xafbf001c, 
-0xafb00018, 0x8f4200fc, 0x8f4400f8, 0x8f4300f4, 
-0x24420001, 0xaf4200fc, 0x8f900128, 0x14830016, 
-0x3c020001, 0x3c040001, 0x24847f4c, 0x240209b3, 
-0xafa20010, 0xafa00014, 0x8f860144, 0x3c070001, 
-0x24e77f98, 0xc002d3b, 0x3405dead, 0x8f82011c, 
-0x34420002, 0xaf82011c, 0x8f820220, 0x34420004, 
-0xaf820220, 0x8f820140, 0x3c030001, 0x431025, 
-0xaf820140, 0x3c020001, 0x8f4300f8, 0x344230c8, 
-0x2e21021, 0x54620004, 0x24620008, 0x3c020001, 
-0x34422ec8, 0x2e21021, 0x401821, 0xaf4300f8, 
-0xac600000, 0x8f4200f4, 0x14620005, 0x3c020001, 
-0x26020020, 0xaf820128, 0x1000000f, 0x0, 
-0x8f4300f8, 0x344230c8, 0x2e21021, 0x54620004, 
-0x24620008, 0x3c020001, 0x34422ec8, 0x2e21021, 
-0x401821, 0x8c620004, 0x21140, 0x2021021, 
-0xaf820128, 0xac600000, 0x8e030018, 0x30620070, 
-0x10400030, 0x30620020, 0x10400004, 0x3c020010, 
-0x2c21024, 0x1040000d, 0x0, 0x30620040, 
-0x10400004, 0x3c020020, 0x2c21024, 0x10400007, 
-0x0, 0x30620010, 0x10400038, 0x3c020040, 
-0x2c21024, 0x14400035, 0x0, 0x8f820040, 
-0x30420001, 0x14400008, 0x2021, 0x8c030104, 
-0x24020001, 0x50620005, 0x24040001, 0x8c020264, 
-0x10400003, 0x801021, 0x24040001, 0x801021, 
-0x10400007, 0x0, 0x8f42030c, 0x24420001, 
-0xaf42030c, 0x8f42030c, 0x10000020, 0x0, 
-0x8f820044, 0x34420004, 0xaf820044, 0x8f420308, 
-0x24420001, 0xaf420308, 0x8f420308, 0x10000017, 
-0x0, 0x3062b08f, 0x14400014, 0x240209e4, 
-0x3c040001, 0x24847f4c, 0xafa20010, 0xafa00014, 
-0x8f860144, 0x3c070001, 0x24e77f98, 0xc002d3b, 
-0x3405dead, 0x8f82011c, 0x34420002, 0xaf82011c, 
-0x8f820220, 0x34420004, 0xaf820220, 0x8f820140, 
-0x3c030001, 0x431025, 0xaf820140, 0x8fbf001c, 
-0x8fb00018, 0x3e00008, 0x27bd0020, 0x3e00008, 
-0x0, 0x27bdff98, 0xafbf0060, 0xafbe005c, 
-0xafb50058, 0xafb30054, 0xafb20050, 0xafb1004c, 
-0xafb00048, 0x8f4200fc, 0x24420001, 0xaf4200fc, 
-0x8f880128, 0x25020020, 0xaf820128, 0x8d030018, 
-0x30620070, 0x10400030, 0x30620020, 0x10400004, 
-0x3c020010, 0x2c21024, 0x1040000d, 0x0, 
-0x30620040, 0x10400004, 0x3c020020, 0x2c21024, 
-0x10400007, 0x0, 0x30620010, 0x104001c0, 
-0x3c020040, 0x2c21024, 0x144001bd, 0x0, 
-0x8f820040, 0x30420001, 0x14400008, 0x2021, 
-0x8c030104, 0x24020001, 0x50620005, 0x24040001, 
-0x8c020264, 0x10400003, 0x801021, 0x24040001, 
-0x801021, 0x10400007, 0x0, 0x8f42030c, 
-0x24420001, 0xaf42030c, 0x8f42030c, 0x100001a8, 
-0x0, 0x8f820044, 0x34420004, 0xaf820044, 
-0x8f420308, 0x24420001, 0xaf420308, 0x8f420308, 
-0x1000019f, 0x0, 0x30620002, 0x10400160, 
-0x3c020800, 0x8d1e001c, 0x1e5702, 0xafaa0034, 
-0x950a0016, 0x3c22024, 0xafaa0024, 0x8faa0034, 
-0x24020001, 0x15420006, 0x33deffff, 0x1e1140, 
-0x3403ecc0, 0x431021, 0x10000010, 0x2e2a821, 
-0x24020002, 0x15420005, 0x24020003, 0x1e1140, 
-0x24426cc0, 0x10000009, 0x2e2a821, 0x15420005, 
-0x1e1180, 0x1e1140, 0x24424cc0, 0x10000003, 
-0x2e2a821, 0x571021, 0x24550ce0, 0x96a2000e, 
-0x304afffc, 0x30420400, 0x10400003, 0xafaa002c, 
-0x100000e1, 0x8821, 0x10800004, 0x8821, 
-0x97b10026, 0x100000dd, 0xa6b10012, 0x8eb30018, 
-0x966a000c, 0xa7aa003e, 0x97a5003e, 0x2ca305dd, 
-0x38a28870, 0x2c420001, 0x621825, 0x10600015, 
-0x2021, 0x32c20800, 0x10400015, 0x24020800, 
-0x96630014, 0x14620012, 0x3402aaaa, 0x9663000e, 
-0x14620007, 0x2821, 0x96630010, 0x24020300, 
-0x14620004, 0xa01021, 0x96620012, 0x2c450001, 
-0xa01021, 0x54400006, 0x24040016, 0x10000004, 
-0x0, 0x24020800, 0x50a20001, 0x2404000e, 
-0x108000b9, 0x2649021, 0x92420000, 0x3042000f, 
-0x28080, 0x32c20100, 0x10400020, 0x2501821, 
-0x3c020020, 0x43102b, 0x1440000e, 0x2402021, 
-0x2821, 0x94820000, 0x24840002, 0xa22821, 
-0x83102b, 0x1440fffb, 0x30a2ffff, 0x51c02, 
-0x622821, 0x51c02, 0x30a2ffff, 0x10000009, 
-0x622821, 0x8f470148, 0x8f420110, 0x102842, 
-0x3c060020, 0x40f809, 0xafa80040, 0x3045ffff, 
-0x8fa80040, 0x50a00001, 0x3405ffff, 0x8faa002c, 
-0x354a0002, 0x10000002, 0xafaa002c, 0x2821, 
-0x32c20080, 0x10400090, 0xa6a50010, 0x26430009, 
-0x3c02001f, 0x3442ffff, 0x43102b, 0x10400003, 
-0x0, 0x8f420148, 0x621823, 0x90660000, 
-0x30c200ff, 0x38430006, 0x2c630001, 0x38420011, 
-0x2c420001, 0x621825, 0x1060007f, 0x24020800, 
-0x8821, 0x97a3003e, 0x1462000f, 0x2602021, 
-0x96710000, 0x96620002, 0x96630004, 0x96640006, 
-0x2228821, 0x2238821, 0x2248821, 0x96620008, 
-0x9663000a, 0x9664000c, 0x2228821, 0x2238821, 
-0x10000007, 0x2248821, 0x94820000, 0x24840002, 
-0x2228821, 0x92102b, 0x1440fffb, 0x0, 
-0x111c02, 0x3222ffff, 0x628821, 0x111c02, 
-0x3222ffff, 0x628821, 0x32c20200, 0x10400003, 
-0x26440006, 0x1000003e, 0x8021, 0x3c05001f, 
-0x34a5ffff, 0xa4102b, 0x10400003, 0x0, 
-0x8f420148, 0x822023, 0x94820000, 0x30421fff, 
-0x10400004, 0x2644000c, 0x96420002, 0x10000030, 
-0x508023, 0x96420002, 0x26430014, 0x508023, 
-0x3c020020, 0x43102b, 0x1440000a, 0xd08021, 
-0x9642000c, 0x2028021, 0x9642000e, 0x96430010, 
-0x96440012, 0x2028021, 0x2038021, 0x10000020, 
-0x2048021, 0xa4102b, 0x10400003, 0x0, 
-0x8f420148, 0x822023, 0x94820000, 0x24840002, 
-0x2028021, 0xa4102b, 0x10400003, 0x0, 
-0x8f420148, 0x822023, 0x94820000, 0x24840002, 
-0x2028021, 0xa4102b, 0x10400003, 0x0, 
-0x8f420148, 0x822023, 0x94820000, 0x24840002, 
-0x2028021, 0xa4102b, 0x10400003, 0x0, 
-0x8f420148, 0x822023, 0x94820000, 0x2028021, 
-0x3c020100, 0x2c21024, 0x1040000e, 0x0, 
-0x8faa002c, 0x31420004, 0x1040000a, 0x0, 
-0x9504000e, 0x2642021, 0xc004445, 0x2484fffc, 
-0x3042ffff, 0x2228821, 0x111c02, 0x3222ffff, 
-0x628821, 0x8faa0024, 0x1518823, 0x111402, 
-0x2228821, 0x2308821, 0x111402, 0x2228821, 
-0x3231ffff, 0x52200001, 0x3411ffff, 0x8faa002c, 
-0x354a0001, 0xafaa002c, 0xa6b10012, 0x97aa002e, 
-0xa6aa000e, 0x8faa002c, 0x31420004, 0x10400002, 
-0x24091000, 0x34098000, 0x8f480044, 0x8f4401a0, 
-0x8f4501a4, 0xafa90010, 0x8f490044, 0x84140, 
-0x1001821, 0xafa90014, 0x8f48000c, 0x2a03021, 
-0x24070020, 0xafa80018, 0x8f48010c, 0x1021, 
-0xa32821, 0xa3482b, 0x822021, 0x100f809, 
-0x892021, 0x1440001f, 0x0, 0x8f820128, 
-0x3c040001, 0x24847fe4, 0xafbe0014, 0xafa20010, 
-0x8f860124, 0x8f870120, 0x3c050007, 0xc002d3b, 
-0x34a59920, 0x3c040001, 0x24847f4c, 0x24020bfa, 
-0xafa20010, 0xafa00014, 0x8f860144, 0x3c070001, 
-0x24e77f98, 0xc002d3b, 0x3405dead, 0x8f82011c, 
-0x34420002, 0xaf82011c, 0x8f820220, 0x34420004, 
-0xaf820220, 0x8f820140, 0x3c030001, 0x431025, 
-0xaf820140, 0x8f420368, 0x2442ffff, 0xaf420368, 
-0x8f420044, 0x8f430088, 0x24420001, 0x431024, 
-0xaf420044, 0x8faa0034, 0x8f440368, 0x24020001, 
-0x15420006, 0x24020002, 0x8f42035c, 0x2442ffff, 
-0xaf42035c, 0x1000004a, 0x8f42035c, 0x15420006, 
-0x0, 0x8f420364, 0x2442ffff, 0xaf420364, 
-0x10000043, 0x8f420364, 0x8f420360, 0x2442ffff, 
-0xaf420360, 0x8f420360, 0x1000003d, 0x0, 
-0x30621000, 0x10400005, 0x30628000, 0x8f420078, 
-0x24420001, 0x10000036, 0xaf420078, 0x10400034, 
-0x0, 0x8f420078, 0x24420001, 0xaf420078, 
-0x8c030240, 0x43102b, 0x1440002d, 0x24070008, 
-0x8f440168, 0x8f45016c, 0x8f430044, 0x8f48000c, 
-0x8f860120, 0x24020040, 0xafa20010, 0xafa30014, 
-0xafa80018, 0x8f42010c, 0x40f809, 0x24c6001c, 
-0x14400011, 0x24020001, 0x3c010001, 0x370821, 
-0xa02240f2, 0x8f820124, 0xafa20010, 0x8f820128, 
-0x3c040001, 0x24847f44, 0xafa20014, 0x8f460044, 
-0x8f870120, 0x3c050009, 0xc002d3b, 0x34a51300, 
-0x1000000b, 0x0, 0x8f420304, 0x24420001, 
-0xaf420304, 0x8f420304, 0x8f420044, 0xaf42007c, 
-0x3c010001, 0x370821, 0xa02040f2, 0xaf400078, 
-0x8f420318, 0x24420001, 0xaf420318, 0x8f420318, 
-0x8fbf0060, 0x8fbe005c, 0x8fb50058, 0x8fb30054, 
-0x8fb20050, 0x8fb1004c, 0x8fb00048, 0x3e00008, 
-0x27bd0068, 0x3e00008, 0x0, 0x8f42013c, 
-0xaf8200c0, 0x8f42013c, 0xaf8200c4, 0x8f42013c, 
-0xaf8200c8, 0x8f420138, 0xaf8200d0, 0x8f420138, 
-0xaf8200d4, 0x8f420138, 0x3e00008, 0xaf8200d8, 
-0x27bdffe0, 0x27840208, 0x24050200, 0xafbf0018, 
-0xc002dbf, 0x24060008, 0x8c020204, 0xaf820210, 
-0xc004586, 0x0, 0x3c020002, 0x8c428668, 
-0x30420002, 0x1040000e, 0x2021, 0x8c060248, 
-0x24020002, 0x3c010002, 0xac22866c, 0xc005738, 
-0x24050002, 0x2021, 0x8c060248, 0x24020001, 
-0x3c010002, 0xac22866c, 0x10000011, 0x24050001, 
-0x8c060248, 0x24020004, 0x3c010002, 0xac22866c, 
-0xc005738, 0x24050004, 0x3c020002, 0x8c428668, 
-0x30420001, 0x10400008, 0x24020001, 0x3c010002, 
-0xac22866c, 0x2021, 0x24050001, 0x3c06601b, 
-0xc005738, 0x0, 0x3c040002, 0x248480b0, 
-0x8f420150, 0x8f430154, 0x3c050008, 0x8f460158, 
-0x21640, 0x31940, 0x34630403, 0x431025, 
-0x633c0, 0x461025, 0xaf82021c, 0xafa00010, 
-0xafa00014, 0x8f86021c, 0x34a50200, 0xc002d3b, 
-0x3821, 0x3c010002, 0xac208664, 0x3c010002, 
-0xac20867c, 0x8fbf0018, 0x3e00008, 0x27bd0020, 
-0x27bdffe0, 0x3c050008, 0x34a50300, 0xafbf0018, 
-0xafa00010, 0xafa00014, 0x8f860200, 0x3c040002, 
-0x248480bc, 0xc002d3b, 0x3821, 0x8f420410, 
-0x24420001, 0xaf420410, 0x8f420410, 0x8fbf0018, 
-0x3e00008, 0x27bd0020, 0x27bdffd8, 0xafbf0020, 
-0xafb1001c, 0xafb00018, 0x8f4203a4, 0x24420001, 
-0xaf4203a4, 0x8f4203a4, 0x8f900220, 0x8f8200e0, 
-0xafa20010, 0x8f8200e4, 0xafa20014, 0x8f8600c4, 
-0x8f8700c8, 0x3c040002, 0x248480c8, 0xc002d3b, 
-0x2002821, 0x3c044000, 0x2041024, 0x504000bc, 
-0x3c040100, 0x8f4203bc, 0x24420001, 0xaf4203bc, 
-0x8f4203bc, 0x8f8700c4, 0x8f8300c8, 0x8f420148, 
-0x671823, 0x43102b, 0x10400003, 0x0, 
-0x8f420148, 0x621821, 0x10600005, 0x0, 
-0x8f42014c, 0x43102b, 0x1040000d, 0x0, 
-0x8f8200e0, 0x8f430124, 0xaf42011c, 0xaf430114, 
-0x8f820220, 0x3c0308ff, 0x3463fffb, 0x431024, 
-0x441025, 0xaf820220, 0x10000104, 0x0, 
-0x8f820220, 0x3c0308ff, 0x3463ffff, 0x431024, 
-0x34420004, 0xaf820220, 0x8f8200e0, 0x8f430124, 
-0xaf42011c, 0xaf430114, 0x8f8600c8, 0x8f840120, 
-0x8f830124, 0x10000005, 0x2821, 0x14620002, 
-0x24620020, 0x27624800, 0x401821, 0x1064000c, 
-0x30a200ff, 0x8c620018, 0x30420003, 0x1040fff7, 
-0x27624fe0, 0x8f4203d0, 0x24050001, 0x24420001, 
-0xaf4203d0, 0x8f4203d0, 0x8c660008, 0x30a200ff, 
-0x1440005b, 0x0, 0x934205c4, 0x14400058, 
-0x0, 0x8f8700c4, 0x8f8800e0, 0x8f8400e4, 
-0x2402fff8, 0x1024024, 0x1041023, 0x218c3, 
-0x4620001, 0x24630200, 0x10600005, 0x24020001, 
-0x1062000a, 0x0, 0x10000021, 0x0, 
-0x8f4203c0, 0xe03021, 0x24420001, 0xaf4203c0, 
-0x8f4203c0, 0x10000042, 0x0, 0x8f4203c4, 
-0x24420001, 0xaf4203c4, 0x8c860000, 0x8f420148, 
-0x8f4303c4, 0xe61823, 0x43102b, 0x10400004, 
-0x2c62233f, 0x8f420148, 0x621821, 0x2c62233f, 
-0x14400033, 0x0, 0x8f42020c, 0x24420001, 
-0xaf42020c, 0x8f42020c, 0xe03021, 0x24820008, 
-0xaf8200e4, 0xaf8200e8, 0x10000029, 0x0, 
-0x8f4203c8, 0x24420001, 0xaf4203c8, 0x8f4203c8, 
-0x8c850000, 0x8f420148, 0xa71823, 0x43102b, 
-0x10400003, 0x0, 0x8f420148, 0x621821, 
-0x8f42014c, 0x43102b, 0x5440000b, 0xa03021, 
-0x8f42020c, 0x24420001, 0xaf42020c, 0x8f42020c, 
-0x24820008, 0xaf8200e4, 0x8f8400e4, 0xaf8400e8, 
-0x1488ffeb, 0x0, 0x1488000d, 0x27623000, 
-0x14820002, 0x2482fff8, 0x27623ff8, 0x94430006, 
-0x3c02001f, 0x3442ffff, 0xc33021, 0x46102b, 
-0x10400003, 0x0, 0x8f420148, 0xc23023, 
-0xaf8600c8, 0x8f8300c4, 0x8f420148, 0xc31823, 
-0x43102b, 0x10400003, 0x0, 0x8f420148, 
-0x621821, 0x10600005, 0x0, 0x8f42014c, 
-0x43102b, 0x1040000a, 0x3c02fdff, 0x8f820220, 
-0x3c0308ff, 0x3463fffb, 0x431024, 0x3c034000, 
-0x431025, 0xaf820220, 0x10000070, 0x0, 
-0x8f4303cc, 0x3442ffff, 0x282a024, 0x24630001, 
-0xaf4303cc, 0x8f4203cc, 0x10000068, 0x0, 
-0x2041024, 0x1040000f, 0x3c110200, 0x8f4203a8, 
-0x24420001, 0xaf4203a8, 0x8f4203a8, 0x8f820220, 
-0x3c0308ff, 0x3463ffff, 0x431024, 0x441025, 
-0xaf820220, 0xc00430b, 0x0, 0x10000057, 
-0x0, 0x2111024, 0x50400009, 0x3c110400, 
-0x8f4203ac, 0x24420001, 0xaf4203ac, 0x8f4203ac, 
-0xc00430b, 0x0, 0x1000002e, 0x0, 
-0x2111024, 0x10400033, 0x3c02b800, 0x8f830224, 
-0x24021402, 0x1462001d, 0x3c050008, 0x3c040002, 
-0x248480d4, 0xafa00010, 0xafa00014, 0x8f860224, 
-0x34a50500, 0xc002d3b, 0x3821, 0x3c040002, 
-0x248480a0, 0x240203b3, 0xafa20010, 0xafa00014, 
-0x8f860144, 0x3c070002, 0x24e780e0, 0xc002d3b, 
-0x3405dead, 0x8f82011c, 0x34420002, 0xaf82011c, 
-0x8f820220, 0x34420004, 0xaf820220, 0x8f820140, 
-0x3c030001, 0x431025, 0xaf820140, 0x8f4203b0, 
-0x24420001, 0xaf4203b0, 0x8f4203b0, 0x8f820220, 
-0x2002021, 0x34420002, 0xaf820220, 0xc0054be, 
-0x0, 0x8f820220, 0x3c0308ff, 0x3463ffff, 
-0x431024, 0x511025, 0xaf820220, 0x10000017, 
-0x0, 0x2021024, 0x10400014, 0x240203c7, 
-0x3c040002, 0x248480a0, 0xafa20010, 0xafa00014, 
-0x8f860144, 0x3c070002, 0x24e780e0, 0xc002d3b, 
-0x3405dead, 0x8f82011c, 0x34420002, 0xaf82011c, 
-0x8f820220, 0x34420004, 0xaf820220, 0x8f820140, 
-0x3c030001, 0x431025, 0xaf820140, 0x8fbf0020, 
-0x8fb1001c, 0x8fb00018, 0x3e00008, 0x27bd0028, 
-0x3e00008, 0x0, 0x3c020002, 0x8c42867c, 
-0x27bdffb0, 0xafbf0048, 0xafbe0044, 0xafb50040, 
-0xafb3003c, 0xafb20038, 0xafb10034, 0x1040000f, 
-0xafb00030, 0x3c040002, 0x248480e8, 0x3c050008, 
-0xafa00010, 0xafa00014, 0x8f860220, 0x34a50600, 
-0x24020001, 0x3c010002, 0xac20867c, 0x3c010002, 
-0xac228670, 0xc002d3b, 0x3821, 0x3c037fff, 
-0x8c020268, 0x3463ffff, 0x3c04fdff, 0x431024, 
-0xac020268, 0x8f420004, 0x3484ffff, 0x30420002, 
-0x10400092, 0x284a024, 0x3c040600, 0x34842000, 
-0x8f420004, 0x2821, 0x2403fffd, 0x431024, 
-0xaf420004, 0xafa40020, 0x8f5e0018, 0x27aa0020, 
-0x240200ff, 0x13c20002, 0xafaa002c, 0x27c50001, 
-0x8c020228, 0xa09021, 0x1642000e, 0x1e38c0, 
-0x8f42033c, 0x24420001, 0xaf42033c, 0x8f42033c, 
-0x8c020228, 0x3c040002, 0x24848068, 0x3c050009, 
-0xafa00014, 0xafa20010, 0x8fa60020, 0x1000006d, 
-0x34a50500, 0xf71021, 0x8fa30020, 0x8fa40024, 
-0xac4304c0, 0xac4404c4, 0x8f830054, 0x8f820054, 
-0x247003e8, 0x2021023, 0x2c4203e9, 0x1040001b, 
-0x9821, 0xe08821, 0x263504c0, 0x8f440178, 
-0x8f45017c, 0x2201821, 0x240a0004, 0xafaa0010, 
-0xafb20014, 0x8f48000c, 0x1021, 0x2f53021, 
-0xafa80018, 0x8f48010c, 0x24070008, 0xa32821, 
-0xa3482b, 0x822021, 0x100f809, 0x892021, 
-0x54400006, 0x24130001, 0x8f820054, 0x2021023, 
-0x2c4203e9, 0x1440ffe9, 0x0, 0x326200ff, 
-0x54400017, 0xaf520018, 0x8f420378, 0x24420001, 
-0xaf420378, 0x8f420378, 0x8f820120, 0x8faa002c, 
-0xafa20010, 0x8f820124, 0x3c040002, 0x24848074, 
-0x3c050009, 0xafa20014, 0x8d460000, 0x10000035, 
-0x34a50600, 0x8f420308, 0x24130001, 0x24420001, 
-0xaf420308, 0x8f420308, 0x1000001e, 0x326200ff, 
-0x8f830054, 0x8f820054, 0x247003e8, 0x2021023, 
-0x2c4203e9, 0x10400016, 0x9821, 0x3c150020, 
-0x24110010, 0x8f42000c, 0x8f440160, 0x8f450164, 
-0x8f860120, 0xafb10010, 0xafb20014, 0x551025, 
-0xafa20018, 0x8f42010c, 0x24070008, 0x40f809, 
-0x24c6001c, 0x1440ffe3, 0x0, 0x8f820054, 
-0x2021023, 0x2c4203e9, 0x1440ffee, 0x0, 
-0x326200ff, 0x14400011, 0x0, 0x8f420378, 
-0x24420001, 0xaf420378, 0x8f420378, 0x8f820120, 
-0x8faa002c, 0xafa20010, 0x8f820124, 0x3c040002, 
-0x2484807c, 0x3c050009, 0xafa20014, 0x8d460000, 
-0x34a50700, 0xc002d3b, 0x3c03821, 0x8f4202ec, 
-0x24420001, 0xaf4202ec, 0x8f4202ec, 0x8fbf0048, 
-0x8fbe0044, 0x8fb50040, 0x8fb3003c, 0x8fb20038, 
-0x8fb10034, 0x8fb00030, 0x3e00008, 0x27bd0050, 
-0x3c020002, 0x8c42867c, 0x27bdffe0, 0x1440000d, 
-0xafbf0018, 0x3c040002, 0x248480f4, 0x3c050008, 
-0xafa00010, 0xafa00014, 0x8f860220, 0x34a50700, 
-0x24020001, 0x3c010002, 0xac22867c, 0xc002d3b, 
-0x3821, 0x3c020004, 0x2c21024, 0x10400007, 
-0x0, 0x8f820220, 0x3c0308ff, 0x3463ffff, 
-0x431024, 0x34420008, 0xaf820220, 0x3c050002, 
-0x8ca5866c, 0x24020001, 0x14a20007, 0x2021, 
-0xc0058d7, 0x24050001, 0xac02026c, 0x8c03026c, 
-0x10000006, 0x3c020007, 0xc0058d7, 0x2021, 
-0xac020268, 0x8c030268, 0x3c020007, 0x621824, 
-0x3c020002, 0x5062000d, 0x3c0205f5, 0x43102b, 
-0x14400006, 0x3c020004, 0x3c020001, 0x10620009, 
-0x3c020098, 0x1000000b, 0x0, 0x14620009, 
-0x3c023b9a, 0x10000004, 0x3442ca00, 0x10000002, 
-0x3442e100, 0x34429680, 0xaf4201fc, 0x8f4201fc, 
-0xaee20064, 0x8fbf0018, 0x3e00008, 0x27bd0020, 
-0x86102b, 0x50400001, 0x872023, 0xc41023, 
-0x24843, 0x125102b, 0x1040001b, 0x91040, 
-0x824021, 0x88102b, 0x10400007, 0x1821, 
-0x94820000, 0x24840002, 0x621821, 0x88102b, 
-0x1440fffb, 0x0, 0x602021, 0xc73023, 
-0xa91023, 0x21040, 0xc22821, 0xc5102b, 
-0x10400007, 0x1821, 0x94c20000, 0x24c60002, 
-0x621821, 0xc5102b, 0x1440fffb, 0x0, 
-0x1000000d, 0x832021, 0x51040, 0x822821, 
-0x85102b, 0x10400007, 0x1821, 0x94820000, 
-0x24840002, 0x621821, 0x85102b, 0x1440fffb, 
-0x0, 0x602021, 0x41c02, 0x3082ffff, 
-0x622021, 0x41c02, 0x3082ffff, 0x622021, 
-0x3e00008, 0x3082ffff, 0x3e00008, 0x0, 
-0x802821, 0x30a20001, 0x1040002b, 0x3c03001f, 
-0x3463ffff, 0x24a20004, 0x62102b, 0x54400007, 
-0x65102b, 0x90a20001, 0x90a40003, 0x90a30000, 
-0x90a50002, 0x1000002a, 0x441021, 0x10400003, 
-0x0, 0x8f420148, 0xa22823, 0x90a40000, 
-0x24a50001, 0x65102b, 0x10400003, 0x0, 
-0x8f420148, 0xa22823, 0x90a20000, 0x24a50001, 
-0x21200, 0x822021, 0x65102b, 0x10400003, 
-0x0, 0x8f420148, 0xa22823, 0x90a20000, 
-0x24a50001, 0x822021, 0x65102b, 0x10400003, 
-0x0, 0x8f420148, 0xa22823, 0x90a20000, 
-0x1000002d, 0x21200, 0x3463ffff, 0x24a20004, 
-0x62102b, 0x5440000a, 0x65102b, 0x90a20000, 
-0x90a40002, 0x90a30001, 0x90a50003, 0x441021, 
-0x21200, 0x651821, 0x10000020, 0x432021, 
-0x10400003, 0x0, 0x8f420148, 0xa22823, 
-0x90a20000, 0x24a50001, 0x22200, 0x65102b, 
-0x10400003, 0x0, 0x8f420148, 0xa22823, 
-0x90a20000, 0x24a50001, 0x822021, 0x65102b, 
-0x10400003, 0x0, 0x8f420148, 0xa22823, 
-0x90a20000, 0x24a50001, 0x21200, 0x822021, 
-0x65102b, 0x10400003, 0x0, 0x8f420148, 
-0xa22823, 0x90a20000, 0x822021, 0x41c02, 
-0x3082ffff, 0x622021, 0x41c02, 0x3082ffff, 
-0x622021, 0x3e00008, 0x3082ffff, 0x8f820220, 
-0x34420002, 0xaf820220, 0x3c020002, 0x8c42a8b8, 
-0x30424000, 0x10400054, 0x24040001, 0x8f820200, 
-0x24067fff, 0x8f830200, 0x30450002, 0x2402fffd, 
-0x621824, 0xaf830200, 0xaf840204, 0x8f830054, 
-0x8f820054, 0x10000002, 0x24630001, 0x8f820054, 
-0x621023, 0x2c420002, 0x1440fffc, 0x0, 
-0x8f820224, 0x1444004d, 0x42040, 0xc4102b, 
-0x1040fff1, 0x0, 0x8f820200, 0x451025, 
-0xaf820200, 0x8f820220, 0x34428000, 0xaf820220, 
-0x8f830054, 0x8f820054, 0x10000002, 0x24630001, 
-0x8f820054, 0x621023, 0x2c420002, 0x1440fffc, 
-0x0, 0x8f820220, 0x3c030004, 0x431024, 
-0x1440000f, 0x0, 0x8f820220, 0x3c03ffff, 
-0x34637fff, 0x431024, 0xaf820220, 0x8f830054, 
-0x8f820054, 0x10000002, 0x24630001, 0x8f820054, 
-0x621023, 0x2c420002, 0x1440fffc, 0x0, 
-0x8f820220, 0x3c030004, 0x431024, 0x1440000d, 
-0x0, 0x8f820220, 0x34428000, 0xaf820220, 
-0x8f830054, 0x8f820054, 0x10000002, 0x24630001, 
-0x8f820054, 0x621023, 0x2c420002, 0x1440fffc, 
-0x0, 0x8f820220, 0x3c030004, 0x431024, 
-0x1040001b, 0x1021, 0x8f830220, 0x24020001, 
-0x10000015, 0x3c04f700, 0x8f820220, 0x3c04f700, 
-0x441025, 0xaf820220, 0x8f820220, 0x2403fffd, 
-0x431024, 0xaf820220, 0x8f820220, 0x3c030300, 
-0x431024, 0x14400003, 0x0, 0x10000008, 
-0x1021, 0x8f820220, 0x34420002, 0xaf820220, 
-0x8f830220, 0x24020001, 0x641825, 0xaf830220, 
-0x3e00008, 0x0, 0x27bdffe0, 0x2021, 
-0x3c050100, 0x24020001, 0xafbf0018, 0xaf80021c, 
-0xaf820200, 0xaf820220, 0x27625000, 0xaf8200c0, 
-0x27625000, 0xaf8200c4, 0x27625000, 0xaf8200c8, 
-0x27625000, 0xaf8200d0, 0x27625000, 0xaf8200d4, 
-0x27625000, 0xaf8200d8, 0x27623000, 0xaf8200e0, 
-0x27623000, 0xaf8200e4, 0x27623000, 0xaf8200e8, 
-0x27622800, 0xaf8200f0, 0x27622800, 0xaf8200f4, 
-0x27622800, 0xaf8200f8, 0x418c0, 0x24840001, 
-0x3631021, 0xac453004, 0x3631021, 0xac403000, 
-0x28820200, 0x1440fff9, 0x418c0, 0x2021, 
-0x418c0, 0x24840001, 0x3631021, 0xac402804, 
-0x3631021, 0xac402800, 0x28820100, 0x1440fff9, 
-0x418c0, 0xaf80023c, 0x24030080, 0x24040100, 
-0xac600000, 0x24630004, 0x64102b, 0x5440fffd, 
-0xac600000, 0x8f830040, 0x3c02f000, 0x621824, 
-0x3c025000, 0x1062000c, 0x43102b, 0x14400006, 
-0x3c026000, 0x3c024000, 0x1062000c, 0x24020800, 
-0x1000000e, 0x240202a9, 0x10620008, 0x24020800, 
-0x1000000a, 0x240202a9, 0x24020700, 0x3c010002, 
-0xac228680, 0x10000018, 0x0, 0x3c010002, 
-0xac228680, 0x10000014, 0x0, 0x3c040002, 
-0x248481c0, 0xafa20010, 0xafa00014, 0x8f860144, 
-0x3c070002, 0x24e781d8, 0xc002d3b, 0x3405dead, 
-0x8f82011c, 0x34420002, 0xaf82011c, 0x8f820220, 
-0x34420004, 0xaf820220, 0x8f820140, 0x3c030001, 
-0x431025, 0xaf820140, 0x8fbf0018, 0x3e00008, 
-0x27bd0020, 0x3c020002, 0x8c428690, 0x27bdffd0, 
-0xafbf002c, 0xafb20028, 0xafb10024, 0xafb00020, 
-0x3c010002, 0xac208668, 0x10400005, 0x0, 
-0xc0053c3, 0x0, 0x3c010002, 0xac208690, 
-0x8f830054, 0x8f820054, 0x10000002, 0x24630064, 
-0x8f820054, 0x621023, 0x2c420065, 0x1440fffc, 
-0x0, 0xc0053de, 0x0, 0x24040001, 
-0x2821, 0x27a60018, 0x34028000, 0xc004bdc, 
-0xa7a20018, 0x8f830054, 0x8f820054, 0x10000002, 
-0x24630064, 0x8f820054, 0x621023, 0x2c420065, 
-0x1440fffc, 0x24040001, 0x24050001, 0xc004b9a, 
-0x27a60018, 0x8f830054, 0x8f820054, 0x10000002, 
-0x24630064, 0x8f820054, 0x621023, 0x2c420065, 
-0x1440fffc, 0x24040001, 0x24050001, 0xc004b9a, 
-0x27a60018, 0x8f830054, 0x8f820054, 0x10000002, 
-0x24630064, 0x8f820054, 0x621023, 0x2c420065, 
-0x1440fffc, 0x24040001, 0x3c060002, 0x24c687e0, 
-0xc004b9a, 0x24050002, 0x8f830054, 0x8f820054, 
-0x10000002, 0x24630064, 0x8f820054, 0x621023, 
-0x2c420065, 0x1440fffc, 0x24040001, 0x24050003, 
-0x3c100002, 0x261087e2, 0xc004b9a, 0x2003021, 
-0x97a60018, 0x3c070002, 0x94e787e0, 0x3c040002, 
-0x248481f0, 0xafa00014, 0x96020000, 0x3c05000d, 
-0x34a50100, 0xc002d3b, 0xafa20010, 0x97a20018, 
-0x10400050, 0x24036040, 0x96020000, 0x3042fff0, 
-0x1443000d, 0x24020020, 0x3c030002, 0x946387e0, 
-0x1462000c, 0x24027830, 0x24020003, 0x3c010002, 
-0xac228668, 0x24020005, 0x3c010002, 0xac2287f0, 
-0x10000041, 0x0, 0x3c030002, 0x946387e0, 
-0x24027830, 0x1462000d, 0x24030010, 0x3c020002, 
-0x944287e2, 0x3042fff0, 0x14430008, 0x24020003, 
-0x3c010002, 0xac228668, 0x24020006, 0x3c010002, 
-0xac2287f0, 0x10000030, 0x0, 0x3c020002, 
-0x8c428668, 0x3c030002, 0x946387e0, 0x34420001, 
-0x3c010002, 0xac228668, 0x24020015, 0x1462000b, 
-0x0, 0x3c020002, 0x944287e2, 0x3042fff0, 
-0x3843f420, 0x2c630001, 0x3842f430, 0x2c420001, 
-0x621825, 0x1460001c, 0x24020003, 0x3c030002, 
-0x946387e0, 0x24027810, 0x14620017, 0x24020002, 
-0x3c020002, 0x944287e2, 0x3042fff0, 0x14400012, 
-0x24020002, 0x10000010, 0x24020004, 0x3c020002, 
-0x8c428668, 0x34420008, 0x3c010002, 0xac228668, 
-0x1000005f, 0x24020004, 0x3c020002, 0x8c428668, 
-0x34420004, 0x3c010002, 0xac228668, 0x100000af, 
-0x0, 0x24020001, 0x3c010002, 0xac2287fc, 
-0x3c020002, 0x8c428668, 0x30420002, 0x144000b2, 
-0x3c09fff0, 0x24020e00, 0xaf820238, 0x8f840054, 
-0x8f820054, 0x24030008, 0x3c010002, 0xac23866c, 
-0x10000002, 0x248401f4, 0x8f820054, 0x821023, 
-0x2c4201f5, 0x1440fffc, 0x3c0200c8, 0x344201fb, 
-0xaf820238, 0x8f830054, 0x8f820054, 0x10000002, 
-0x246301f4, 0x8f820054, 0x621023, 0x2c4201f5, 
-0x1440fffc, 0x8021, 0x24120001, 0x24110009, 
-0xc004a53, 0x0, 0x3c010002, 0xac328688, 
-0xc004b1d, 0x0, 0x3c020002, 0x8c428688, 
-0x1451fffb, 0x3c0200c8, 0x344201f6, 0xaf820238, 
-0x8f830054, 0x8f820054, 0x10000002, 0x2463000a, 
-0x8f820054, 0x621023, 0x2c42000b, 0x1440fffc, 
-0x0, 0x8f820220, 0x24040001, 0x34420002, 
-0xaf820220, 0x8f830200, 0x24057fff, 0x2402fffd, 
-0x621824, 0xaf830200, 0xaf840204, 0x8f830054, 
-0x8f820054, 0x10000002, 0x24630001, 0x8f820054, 
-0x621023, 0x2c420002, 0x1440fffc, 0x0, 
-0x8f820224, 0x14440005, 0x34028000, 0x42040, 
-0xa4102b, 0x1040fff0, 0x34028000, 0x1082ff9f, 
-0x26100001, 0x2e020014, 0x1440ffcd, 0x24020004, 
-0x3c010002, 0xac22866c, 0x8021, 0x24120009, 
-0x3c11ffff, 0x36313f7f, 0xc004a53, 0x0, 
-0x24020001, 0x3c010002, 0xac228688, 0xc004b1d, 
-0x0, 0x3c020002, 0x8c428688, 0x1452fffb, 
-0x0, 0x8f820044, 0x511024, 0x34425080, 
-0xaf820044, 0x8f830054, 0x8f820054, 0x10000002, 
-0x2463000a, 0x8f820054, 0x621023, 0x2c42000b, 
-0x1440fffc, 0x0, 0x8f820044, 0x511024, 
-0x3442f080, 0xaf820044, 0x8f830054, 0x8f820054, 
-0x10000002, 0x2463000a, 0x8f820054, 0x621023, 
-0x2c42000b, 0x1440fffc, 0x0, 0x8f820220, 
-0x3c03f700, 0x431025, 0xaf820220, 0x8f830054, 
-0x8f820054, 0x10000002, 0x24630064, 0x8f820054, 
-0x621023, 0x2c420065, 0x1440fffc, 0x0, 
-0x8f820220, 0x24040001, 0x34420002, 0xaf820220, 
-0x8f830200, 0x24057fff, 0x2402fffd, 0x621824, 
-0xaf830200, 0xaf840204, 0x8f830054, 0x8f820054, 
-0x10000002, 0x24630001, 0x8f820054, 0x621023, 
-0x2c420002, 0x1440fffc, 0x0, 0x8f820224, 
-0x14440005, 0x34028000, 0x42040, 0xa4102b, 
-0x1040fff0, 0x34028000, 0x1082ff4f, 0x26100001, 
-0x2e020064, 0x1440ffb0, 0x0, 0x3c020002, 
-0x8c428668, 0x30420004, 0x14400007, 0x3c09fff0, 
-0x8f820044, 0x3c03ffff, 0x34633f7f, 0x431024, 
-0xaf820044, 0x3c09fff0, 0x3529bdc0, 0x3c060002, 
-0x8cc68668, 0x3c040002, 0x248481f0, 0x24020001, 
-0x3c010002, 0xac228670, 0x8f820054, 0x3c070002, 
-0x8ce787fc, 0x3c030002, 0x946387e0, 0x3c080002, 
-0x950887e2, 0x3c05000d, 0x34a50100, 0x3c010002, 
-0xac20866c, 0x491021, 0x3c010002, 0xac2287ec, 
-0xafa30010, 0xc002d3b, 0xafa80014, 0x8fbf002c, 
-0x8fb20028, 0x8fb10024, 0x8fb00020, 0x3e00008, 
-0x27bd0030, 0x27bdffe8, 0x3c050002, 0x8ca5866c, 
-0x24060004, 0x24020001, 0x14a20014, 0xafbf0010, 
-0x3c020002, 0x8c42a8bc, 0x30428000, 0x10400005, 
-0x3c04000f, 0x3c030002, 0x8c6387fc, 0x10000005, 
-0x34844240, 0x3c040004, 0x3c030002, 0x8c6387fc, 
-0x348493e0, 0x24020005, 0x14620016, 0x0, 
-0x3c04003d, 0x10000013, 0x34840900, 0x3c020002, 
-0x8c42a8b8, 0x30428000, 0x10400005, 0x3c04001e, 
-0x3c030002, 0x8c6387fc, 0x10000005, 0x34848480, 
-0x3c04000f, 0x3c030002, 0x8c6387fc, 0x34844240, 
-0x24020005, 0x14620003, 0x0, 0x3c04007a, 
-0x34841200, 0x3c020002, 0x8c4287ec, 0x8f830054, 
-0x441021, 0x431023, 0x44102b, 0x1440004e, 
-0x0, 0x3c020002, 0x8c428674, 0x1440004a, 
-0x0, 0x3c010002, 0xac208684, 0x10c00026, 
-0x0, 0x3c090002, 0x8d298668, 0x24070001, 
-0x3c044000, 0x3c080002, 0x2508a8bc, 0x250afffc, 
-0x52842, 0x14a00002, 0x24c6ffff, 0x24050008, 
-0xa91024, 0x10400011, 0x0, 0x14a70009, 
-0x0, 0x8d020000, 0x441024, 0x1040000b, 
-0x0, 0x3c010002, 0xac258684, 0x10000007, 
-0x0, 0x8d420000, 0x441024, 0x10400003, 
-0x0, 0x3c010002, 0xac278684, 0x3c020002, 
-0x8c428684, 0x6182b, 0x2c420001, 0x431024, 
-0x5440ffe4, 0x52842, 0x8f820054, 0x3c030002, 
-0x8c638684, 0x3c010002, 0xac2287ec, 0x1060003b, 
-0x24020005, 0x3c030002, 0x8c6387fc, 0x3c010002, 
-0xac25866c, 0x14620012, 0x24020001, 0x3c020002, 
-0x8c42a8b8, 0x3c032000, 0x34635000, 0x431024, 
-0x14400006, 0x24020001, 0x3c010002, 0xac2087d8, 
-0x3c010002, 0xac22866c, 0x24020001, 0x3c010002, 
-0xac2286f0, 0x3c010002, 0xac228678, 0x24020001, 
-0x3c010002, 0xac228670, 0x3c020002, 0x8c428684, 
-0x1040001e, 0x0, 0x3c020002, 0x8c428670, 
-0x10400008, 0x24020001, 0x3c010002, 0xac208670, 
-0xaee204b8, 0x3c010002, 0xac2086e8, 0x3c010002, 
-0xac2286a0, 0x8ee304b8, 0x24020008, 0x10620005, 
-0x24020001, 0xc0047b3, 0x0, 0x1000000b, 
-0x0, 0x3c030002, 0x8c63866c, 0x10620007, 
-0x2402000e, 0x3c030002, 0x8c63a850, 0x10620003, 
-0x0, 0xc0054be, 0x8f840220, 0x8fbf0010, 
-0x3e00008, 0x27bd0018, 0x27bdffd8, 0x3c03fdff, 
-0x3c040002, 0x8c84866c, 0x3c020002, 0x8c428694, 
-0x3463ffff, 0x283a024, 0x14820006, 0xafbf0020, 
-0x8ee304b8, 0x3c020002, 0x8c428698, 0x10620006, 
-0x0, 0x8ee204b8, 0x3c010002, 0xac248694, 
-0x3c010002, 0xac228698, 0x3c030002, 0x8c63866c, 
-0x24020002, 0x106201cc, 0x2c620003, 0x10400005, 
-0x24020001, 0x1062000a, 0x0, 0x1000027d, 
-0x0, 0x24020004, 0x106200eb, 0x24020008, 
-0x1062014e, 0x24020001, 0x10000276, 0x0, 
-0x8ee204b8, 0x2443ffff, 0x2c620008, 0x10400273, 
-0x31080, 0x3c010002, 0x220821, 0x8c228210, 
-0x400008, 0x0, 0x3c030002, 0x8c6387fc, 
-0x24020005, 0x14620012, 0x0, 0x3c020002, 
-0x8c428678, 0x10400009, 0x24020003, 0xc004a53, 
-0x0, 0x24020002, 0xaee204b8, 0x3c010002, 
-0xac208678, 0x10000002, 0x0, 0xaee204b8, 
-0x3c010002, 0xac20860c, 0x10000258, 0x0, 
-0xc004a53, 0x0, 0x3c020002, 0x8c428678, 
-0x3c010002, 0xac20860c, 0x144001a8, 0x24020002, 
-0x100001f1, 0x24020007, 0x3c030002, 0x8c6387fc, 
-0x24020005, 0x14620003, 0x24020001, 0x3c010002, 
-0xac22869c, 0xc004c1d, 0x0, 0x3c030002, 
-0x8c63869c, 0x100001a3, 0x24020011, 0x3c050002, 
-0x8ca5866c, 0x3c060002, 0x8cc6a8bc, 0xc005738, 
-0x2021, 0x24020005, 0x3c010002, 0xac208678, 
-0x10000236, 0xaee204b8, 0x3c040002, 0x248481fc, 
-0x3c05000f, 0x34a50100, 0x3021, 0x3821, 
-0xafa00010, 0xc002d3b, 0xafa00014, 0x3c040002, 
-0x248481c0, 0x240204b0, 0xafa20010, 0xafa00014, 
-0x8f860144, 0x3c070002, 0x24e781d8, 0xc002d3b, 
-0x3405dead, 0x8f82011c, 0x34420002, 0xaf82011c, 
-0x8f820220, 0x34420004, 0xaf820220, 0x8f820140, 
-0x3c030001, 0x431025, 0xaf820140, 0x10000217, 
-0x0, 0x24040001, 0x2405001a, 0x8f820220, 
-0x27a60018, 0x3c03f700, 0x431025, 0xaf820220, 
-0xc004b9a, 0x0, 0x97a60018, 0x30c20200, 
-0x104001a1, 0x3c05000c, 0x3c040002, 0x24848208, 
-0x34a50111, 0x3c020002, 0x8c42866c, 0x3c030002, 
-0x8c6387d8, 0x3821, 0xafa20010, 0xc002d3b, 
-0xafa30014, 0x2021, 0x2821, 0xc005400, 
-0x24064040, 0x1000018e, 0x24020002, 0x8f820220, 
-0x3c030004, 0x431024, 0x14400197, 0x24020007, 
-0x8f830054, 0x3c020002, 0x8c4287e4, 0x2463d8f0, 
-0x431023, 0x2c422710, 0x14400003, 0x24020001, 
-0x3c010002, 0xac228670, 0x3c020002, 0x8c42a8bc, 
-0x30425000, 0x104001e5, 0x0, 0x8f820220, 
-0x30428000, 0x1040019f, 0x0, 0x10000197, 
-0x0, 0x3c050002, 0x8ca5866c, 0xc0058d7, 
-0x2021, 0xc005b59, 0x2021, 0x3c030002, 
-0x8c63a8b4, 0x46101d3, 0x24020001, 0x3c020008, 
-0x621024, 0x10400006, 0x0, 0x8f820214, 
-0x3c03ffff, 0x431024, 0x10000005, 0x3442251f, 
-0x8f820214, 0x3c03ffff, 0x431024, 0x3442241f, 
-0xaf820214, 0x8f820220, 0x3c030200, 0x34420002, 
-0xaf820220, 0x24020008, 0xaee204b8, 0x8f820220, 
-0x283a025, 0x3c030004, 0x431024, 0x14400016, 
-0x0, 0x3c020002, 0x8c42a8bc, 0x30425000, 
-0x1040000d, 0x0, 0x8f820220, 0x30428000, 
-0x10400006, 0x0, 0x8f820220, 0x3c03ffff, 
-0x34637fff, 0x10000003, 0x431024, 0x8f820220, 
-0x34428000, 0xaf820220, 0x8f820220, 0x3c03f700, 
-0x431025, 0xaf820220, 0x3c030002, 0x8c6387fc, 
-0x24020005, 0x1462000a, 0x0, 0x3c020002, 
-0x944287e2, 0x24429fbc, 0x2c420004, 0x10400004, 
-0x24040018, 0x24050002, 0xc005400, 0x24060020, 
-0xc0043c9, 0x0, 0x3c010002, 0xac2086ec, 
-0x10000192, 0x0, 0x8ee204b8, 0x2443ffff, 
-0x2c620008, 0x1040018d, 0x31080, 0x3c010002, 
-0x220821, 0x8c228230, 0x400008, 0x0, 
-0xc00430b, 0x0, 0x3c010002, 0xac208670, 
-0xaf800204, 0x3c010002, 0xac20a8a0, 0xc004a53, 
-0x0, 0x24020001, 0x3c010002, 0xac228688, 
-0x1000010f, 0x24020002, 0xc004b1d, 0x0, 
-0x3c030002, 0x8c638688, 0x100000d6, 0x24020009, 
-0x3c020002, 0x8c42a8b8, 0x30424000, 0x10400004, 
-0x0, 0x8f820044, 0x10000006, 0x3442f080, 
-0x8f820044, 0x3c03ffff, 0x34633f7f, 0x431024, 
-0x3442a080, 0xaf820044, 0x8f830054, 0x100000fc, 
-0x24020004, 0x8f830054, 0x3c020002, 0x8c4287e4, 
-0x2463d8f0, 0x431023, 0x2c422710, 0x1440015b, 
-0x24020005, 0x100000c6, 0x0, 0x8f820220, 
-0x3c03f700, 0x431025, 0xaf820220, 0xaf800204, 
-0x3c010002, 0xac20a8a0, 0x100000e7, 0x0, 
-0x8f830054, 0x3c020002, 0x8c4287e4, 0x2463fff6, 
-0x431023, 0x2c42000a, 0x14400148, 0x24020007, 
-0x100000e9, 0x0, 0xc0044a8, 0x0, 
-0x10400140, 0x24020001, 0x8f820214, 0x3c03ffff, 
-0x3c040002, 0x8c8487d8, 0x431024, 0x3442241f, 
-0xaf820214, 0x24020008, 0x10800005, 0xaee204b8, 
-0x3c020002, 0x8c428708, 0x1040004e, 0x24020001, 
-0x8f820220, 0x3c030008, 0x431024, 0x10400054, 
-0x3c020200, 0x10000063, 0x0, 0x8ee204b8, 
-0x2443ffff, 0x2c620007, 0x10400128, 0x31080, 
-0x3c010002, 0x220821, 0x8c228250, 0x400008, 
-0x0, 0xc004b1d, 0x0, 0x3c030002, 
-0x8c638688, 0x1000007f, 0x24020009, 0x3c020002, 
-0x8c42a8b8, 0x30424000, 0x10400003, 0x3c0200c8, 
-0x10000002, 0x344201f6, 0x344201fe, 0xaf820238, 
-0x8f830054, 0x100000aa, 0x24020004, 0x8f830054, 
-0x3c020002, 0x8c4287e4, 0x2463d8f0, 0x431023, 
-0x2c422710, 0x14400109, 0x24020005, 0x10000074, 
-0x0, 0x8f830054, 0x3c020002, 0x8c4287e4, 
-0x2463fff6, 0x431023, 0x2c42000a, 0x144000ff, 
-0x24020007, 0x100000a0, 0x0, 0xc0044a8, 
-0x0, 0x104000f7, 0x24020001, 0x8f820214, 
-0x3c03ffff, 0x3c040002, 0x8c8487d8, 0x431024, 
-0x3442241f, 0xaf820214, 0x24020008, 0x1080000f, 
-0xaee204b8, 0x3c020002, 0x8c428708, 0x1440000b, 
-0x0, 0x8f820220, 0x34420002, 0xaf820220, 
-0x24020001, 0x3c010002, 0xac22a850, 0xc0054be, 
-0x8f840220, 0x10000017, 0x0, 0x8f820220, 
-0x3c030008, 0x431024, 0x14400012, 0x3c020200, 
-0x282a025, 0x2402000e, 0x3c010002, 0xac22a850, 
-0xc005b59, 0x2021, 0x8f820220, 0x34420002, 
-0xaf820220, 0xc0043c9, 0x0, 0x3c050002, 
-0x8ca5866c, 0xc0058d7, 0x2021, 0x100000cb, 
-0x0, 0x3c020002, 0x8c428708, 0x104000c7, 
-0x0, 0x3c020002, 0x8c428704, 0x2442ffff, 
-0x3c010002, 0xac228704, 0x144000c0, 0x24020002, 
-0x3c010002, 0xac208708, 0x3c010002, 0xac228704, 
-0x100000ba, 0x0, 0x8ee204b8, 0x2443ffff, 
-0x2c620007, 0x104000b5, 0x31080, 0x3c010002, 
-0x220821, 0x8c228270, 0x400008, 0x0, 
-0x3c020002, 0x8c428678, 0x10400019, 0x24020005, 
-0xc004a53, 0x0, 0x24020002, 0xaee204b8, 
-0x3c010002, 0xac208678, 0x100000a4, 0x0, 
-0xc004f82, 0x0, 0x3c030002, 0x8c6386a0, 
-0x24020006, 0x1462009d, 0x24020003, 0x1000009b, 
-0xaee204b8, 0x3c050002, 0x8ca5866c, 0x3c060002, 
-0x8cc6a8b8, 0xc005738, 0x2021, 0x24020005, 
-0x10000092, 0xaee204b8, 0x24040001, 0x2405001a, 
-0x8f820220, 0x27a60018, 0x3c03f700, 0x431025, 
-0xaf820220, 0xc004b9a, 0x0, 0x97a60018, 
-0x30c20200, 0x1040001c, 0x3c05000c, 0x3c040002, 
-0x24848208, 0x34a50112, 0x3c020002, 0x8c42866c, 
-0x3c030002, 0x8c6387d8, 0x3821, 0xafa20010, 
-0xc002d3b, 0xafa30014, 0x2021, 0x2821, 
-0xc005400, 0x24064040, 0x3c020002, 0x8c4287d8, 
-0x10400006, 0x2021, 0x2821, 0xc005400, 
-0x24061000, 0x1000006d, 0x0, 0x24020002, 
-0x1000006a, 0xaee204b8, 0x8f830054, 0x24020006, 
-0xaee204b8, 0x3c010002, 0xac2387e4, 0x10000063, 
-0x0, 0x8f820220, 0x3c030004, 0x431024, 
-0x10400003, 0x24020007, 0x1000005c, 0xaee204b8, 
-0x8f830054, 0x3c020002, 0x8c4287e4, 0x2463d8f0, 
-0x431023, 0x2c422710, 0x14400003, 0x24020001, 
-0x3c010002, 0xac228670, 0x3c020002, 0x8c42a8b8, 
-0x30425000, 0x1040004d, 0x0, 0x8f820220, 
-0x30428000, 0x10400007, 0x0, 0x8f820220, 
-0x3c03ffff, 0x34637fff, 0x431024, 0x10000043, 
-0xaf820220, 0x8f820220, 0x34428000, 0xaf820220, 
-0x1000003e, 0x0, 0x3c050002, 0x8ca5866c, 
-0xc0058d7, 0x2021, 0xc005b59, 0x2021, 
-0x3c020002, 0x8c42a8b0, 0x4410032, 0x24020001, 
-0x8f820214, 0x3c03ffff, 0x431024, 0x3442241f, 
-0xaf820214, 0x24020008, 0xaee204b8, 0x8f820220, 
-0x34420002, 0xaf820220, 0x8f820220, 0x3c030004, 
-0x431024, 0x14400016, 0x0, 0x3c020002, 
-0x8c42a8b8, 0x30425000, 0x1040000d, 0x0, 
-0x8f820220, 0x30428000, 0x10400006, 0x0, 
-0x8f820220, 0x3c03ffff, 0x34637fff, 0x10000003, 
-0x431024, 0x8f820220, 0x34428000, 0xaf820220, 
-0x8f820220, 0x3c03f700, 0x431025, 0xaf820220, 
-0x3c020002, 0x944287e2, 0x24429fbc, 0x2c420004, 
-0x10400004, 0x24040018, 0x24050002, 0xc005400, 
-0x24060020, 0xc0043c9, 0x0, 0x10000003, 
-0x0, 0x3c010002, 0xac228670, 0x8fbf0020, 
-0x3e00008, 0x27bd0028, 0x8f820200, 0x8f820220, 
-0x8f820220, 0x34420004, 0xaf820220, 0x8f820200, 
-0x3c050002, 0x8ca5866c, 0x34420004, 0xaf820200, 
-0x24020002, 0x10a2004d, 0x2ca20003, 0x10400005, 
-0x24020001, 0x10a2000a, 0x0, 0x100000b6, 
-0x0, 0x24020004, 0x10a20075, 0x24020008, 
-0x10a20089, 0x3c02f0ff, 0x100000af, 0x0, 
-0x8f830050, 0x3c02f0ff, 0x3442ffff, 0x3c040002, 
-0x8c8487fc, 0x621824, 0x3c020700, 0x621825, 
-0x24020e00, 0x2484fffb, 0x2c840002, 0xaf830050, 
-0xaf850200, 0xaf850220, 0xaf820238, 0x14800006, 
-0x0, 0x8f820044, 0x3c03ffff, 0x34633f7f, 
-0x431024, 0xaf820044, 0x3c030002, 0x8c6387fc, 
-0x24020005, 0x14620004, 0x0, 0x8f820044, 
-0x34425000, 0xaf820044, 0x3c020002, 0x8c42865c, 
-0x3c030002, 0x8c6387fc, 0x34420022, 0x2463fffc, 
-0x2c630002, 0xaf820200, 0x1460000c, 0x0, 
-0x3c020002, 0x8c428680, 0x3c030002, 0x8c638664, 
-0x3c040002, 0x8c848660, 0x34428000, 0x621825, 
-0x641825, 0x1000000a, 0x34620002, 0x3c020002, 
-0x8c428664, 0x3c030002, 0x8c638680, 0x3c040002, 
-0x8c848660, 0x431025, 0x441025, 0x34420002, 
-0xaf820220, 0x1000002f, 0x24020001, 0x24020e01, 
-0xaf820238, 0x8f830050, 0x3c02f0ff, 0x3442ffff, 
-0x3c040002, 0x8c8487d8, 0x621824, 0x3c020d00, 
-0x621825, 0x24020001, 0xaf830050, 0xaf820200, 
-0xaf820220, 0x10800005, 0x3c033f00, 0x3c020002, 
-0x8c428654, 0x10000004, 0x34630070, 0x3c020002, 
-0x8c428654, 0x34630072, 0x431025, 0xaf820200, 
-0x3c030002, 0x8c638658, 0x3c02f700, 0x621825, 
-0x3c020002, 0x8c428664, 0x3c040002, 0x8c848680, 
-0x3c050002, 0x8ca587fc, 0x431025, 0x441025, 
-0xaf820220, 0x24020005, 0x14a20006, 0x24020001, 
-0x8f820044, 0x2403afff, 0x431024, 0xaf820044, 
-0x24020001, 0xaf820238, 0x1000003f, 0x0, 
-0x8f830050, 0x3c02f0ff, 0x3442ffff, 0x3c040002, 
-0x8c8487d8, 0x621824, 0x3c020a00, 0x621825, 
-0x24020001, 0xaf830050, 0xaf820200, 0xaf820220, 
-0x1080001f, 0x0, 0x3c020002, 0x8c428708, 
-0x1440001b, 0x3c033f00, 0x3c020002, 0x8c428654, 
-0x1000001b, 0x346300e0, 0x8f830050, 0x3c040002, 
-0x8c8487d8, 0x3442ffff, 0x621824, 0xaf830050, 
-0x1080000f, 0x0, 0x3c020002, 0x8c428708, 
-0x1440000b, 0x3c043f00, 0x3c030002, 0x8c638654, 
-0x348400e0, 0x24020001, 0xaf820200, 0xaf820220, 
-0x641825, 0xaf830200, 0x10000008, 0x3c05f700, 
-0x3c020002, 0x8c428654, 0x3c033f00, 0x346300e2, 
-0x431025, 0xaf820200, 0x3c05f700, 0x34a58000, 
-0x3c030002, 0x8c638658, 0x3c020002, 0x8c428664, 
-0x3c040002, 0x8c848680, 0x651825, 0x431025, 
-0x441025, 0xaf820220, 0x3e00008, 0x0, 
-0x3c030002, 0x8c638688, 0x3c020002, 0x8c42868c, 
-0x27bdffe0, 0x10620003, 0xafbf0018, 0x3c010002, 
-0xac23868c, 0x24020002, 0x1062003c, 0x2c620003, 
-0x10400005, 0x24020001, 0x10620008, 0x24020004, 
-0x10000055, 0x0, 0x24020009, 0x1062003f, 
-0x240209e3, 0x10000050, 0x0, 0x3c030002, 
-0x8c63866c, 0x10620008, 0x24020008, 0x14620010, 
-0x240209ca, 0x3c0200c8, 0x344201fb, 0xaf820238, 
-0x1000001e, 0x0, 0x24020e01, 0xaf820238, 
-0x8f820044, 0x3c03ffff, 0x34633f7f, 0x431024, 
-0x34420080, 0xaf820044, 0x10000014, 0x0, 
-0x3c040002, 0x248481c0, 0xafa20010, 0xafa00014, 
-0x8f860144, 0x3c070002, 0x24e781d8, 0xc002d3b, 
-0x3405dead, 0x8f82011c, 0x34420002, 0xaf82011c, 
-0x8f820220, 0x34420004, 0xaf820220, 0x8f820140, 
-0x3c030001, 0x431025, 0xaf820140, 0x8f830054, 
-0x24020002, 0x3c010002, 0xac228688, 0x3c010002, 
-0xac2387e8, 0x10000034, 0x0, 0x8f830054, 
-0x3c020002, 0x8c4287e8, 0x2463d8f0, 0x431023, 
-0x2c422710, 0x1440002c, 0x24020009, 0x3c010002, 
-0xac228688, 0x10000028, 0x0, 0x3c040002, 
-0x248481c0, 0xafa20010, 0xafa00014, 0x8f860144, 
-0x3c070002, 0x24e781d8, 0xc002d3b, 0x3405dead, 
-0x8f82011c, 0x34420002, 0xaf82011c, 0x8f820220, 
-0x34420004, 0xaf820220, 0x8f820140, 0x3c030001, 
-0x431025, 0xaf820140, 0x3c040002, 0x248481c0, 
-0x240209e9, 0xafa20010, 0xafa00014, 0x8f860144, 
-0x3c070002, 0x24e781d8, 0xc002d3b, 0x3405dead, 
-0x8f82011c, 0x34420002, 0xaf82011c, 0x8f820220, 
-0x34420004, 0xaf820220, 0x8f820140, 0x3c030001, 
-0x431025, 0xaf820140, 0x8fbf0018, 0x3e00008, 
-0x27bd0020, 0x27bdffd8, 0xafb20018, 0x809021, 
-0xafb3001c, 0xa09821, 0xafb10014, 0xc08821, 
-0xafb00010, 0x8021, 0xafbf0020, 0xa6200000, 
-0xc00539d, 0x24040001, 0x26100001, 0x2e020020, 
-0x1440fffb, 0x0, 0xc00539d, 0x2021, 
-0xc00539d, 0x24040001, 0xc00539d, 0x24040001, 
-0xc00539d, 0x2021, 0x24100010, 0x2501024, 
-0x10400002, 0x2021, 0x24040001, 0xc00539d, 
-0x108042, 0x1600fffa, 0x2501024, 0x24100010, 
-0x2701024, 0x10400002, 0x2021, 0x24040001, 
-0xc00539d, 0x108042, 0x1600fffa, 0x2701024, 
-0xc0053de, 0x34108000, 0xc0053de, 0x0, 
-0xc00537d, 0x0, 0x50400005, 0x108042, 
-0x96220000, 0x501025, 0xa6220000, 0x108042, 
-0x1600fff7, 0x0, 0xc0053de, 0x0, 
-0x8fbf0020, 0x8fb3001c, 0x8fb20018, 0x8fb10014, 
-0x8fb00010, 0x3e00008, 0x27bd0028, 0x27bdffd8, 
-0xafb10014, 0x808821, 0xafb20018, 0xa09021, 
-0xafb3001c, 0xc09821, 0xafb00010, 0x8021, 
-0xafbf0020, 0xc00539d, 0x24040001, 0x26100001, 
-0x2e020020, 0x1440fffb, 0x0, 0xc00539d, 
-0x2021, 0xc00539d, 0x24040001, 0xc00539d, 
-0x2021, 0xc00539d, 0x24040001, 0x24100010, 
-0x2301024, 0x10400002, 0x2021, 0x24040001, 
-0xc00539d, 0x108042, 0x1600fffa, 0x2301024, 
-0x24100010, 0x2501024, 0x10400002, 0x2021, 
-0x24040001, 0xc00539d, 0x108042, 0x1600fffa, 
-0x2501024, 0xc00539d, 0x24040001, 0xc00539d, 
-0x2021, 0x34108000, 0x96620000, 0x501024, 
-0x10400002, 0x2021, 0x24040001, 0xc00539d, 
-0x108042, 0x1600fff8, 0x0, 0xc0053de, 
-0x0, 0x8fbf0020, 0x8fb3001c, 0x8fb20018, 
-0x8fb10014, 0x8fb00010, 0x3e00008, 0x27bd0028, 
-0x3c040002, 0x8c84869c, 0x3c020002, 0x8c4286e4, 
-0x27bdffd8, 0xafbf0020, 0xafb1001c, 0x10820003, 
-0xafb00018, 0x3c010002, 0xac2486e4, 0x3c030002, 
-0x8c6387fc, 0x24020005, 0x14620005, 0x2483ffff, 
-0xc004f82, 0x0, 0x1000034d, 0x0, 
-0x2c620013, 0x1040034a, 0x31080, 0x3c010002, 
-0x220821, 0x8c2282a8, 0x400008, 0x0, 
-0xc0053de, 0x8021, 0x34028000, 0xa7a20010, 
-0x27b10010, 0xc00539d, 0x24040001, 0x26100001, 
-0x2e020020, 0x1440fffb, 0x0, 0xc00539d, 
-0x2021, 0xc00539d, 0x24040001, 0xc00539d, 
-0x2021, 0xc00539d, 0x24040001, 0x24100010, 
-0x32020001, 0x10400002, 0x2021, 0x24040001, 
-0xc00539d, 0x108042, 0x1600fffa, 0x32020001, 
-0x24100010, 0xc00539d, 0x2021, 0x108042, 
-0x1600fffc, 0x0, 0xc00539d, 0x24040001, 
-0xc00539d, 0x2021, 0x34108000, 0x96220000, 
-0x501024, 0x10400002, 0x2021, 0x24040001, 
-0xc00539d, 0x108042, 0x1600fff8, 0x0, 
-0xc0053de, 0x0, 0x1000030f, 0x24020002, 
-0x27b10010, 0xa7a00010, 0x8021, 0xc00539d, 
-0x24040001, 0x26100001, 0x2e020020, 0x1440fffb, 
-0x0, 0xc00539d, 0x2021, 0xc00539d, 
-0x24040001, 0xc00539d, 0x24040001, 0xc00539d, 
-0x2021, 0x24100010, 0x32020001, 0x10400002, 
-0x2021, 0x24040001, 0xc00539d, 0x108042, 
-0x1600fffa, 0x32020001, 0x24100010, 0xc00539d, 
-0x2021, 0x108042, 0x1600fffc, 0x0, 
-0xc0053de, 0x34108000, 0xc0053de, 0x0, 
-0xc00537d, 0x0, 0x50400005, 0x108042, 
-0x96220000, 0x501025, 0xa6220000, 0x108042, 
-0x1600fff7, 0x0, 0xc0053de, 0x0, 
-0x97a20010, 0x30428000, 0x144002dd, 0x24020003, 
-0x100002d9, 0x0, 0x24021200, 0xa7a20010, 
-0x27b10010, 0x8021, 0xc00539d, 0x24040001, 
-0x26100001, 0x2e020020, 0x1440fffb, 0x0, 
-0xc00539d, 0x2021, 0xc00539d, 0x24040001, 
-0xc00539d, 0x2021, 0xc00539d, 0x24040001, 
-0x24100010, 0x32020001, 0x10400002, 0x2021, 
-0x24040001, 0xc00539d, 0x108042, 0x1600fffa, 
-0x32020001, 0x24100010, 0xc00539d, 0x2021, 
-0x108042, 0x1600fffc, 0x0, 0xc00539d, 
-0x24040001, 0xc00539d, 0x2021, 0x34108000, 
-0x96220000, 0x501024, 0x10400002, 0x2021, 
-0x24040001, 0xc00539d, 0x108042, 0x1600fff8, 
-0x0, 0xc0053de, 0x0, 0x8f830054, 
-0x10000296, 0x24020004, 0x8f830054, 0x3c020002, 
-0x8c4287f8, 0x2463ff9c, 0x431023, 0x2c420064, 
-0x1440029f, 0x24020002, 0x3c030002, 0x8c6387fc, 
-0x10620298, 0x2c620003, 0x14400297, 0x24020011, 
-0x24020003, 0x10620005, 0x24020004, 0x10620292, 
-0x2402000f, 0x10000290, 0x24020011, 0x1000028e, 
-0x24020005, 0x24020014, 0xa7a20010, 0x27b10010, 
-0x8021, 0xc00539d, 0x24040001, 0x26100001, 
-0x2e020020, 0x1440fffb, 0x0, 0xc00539d, 
-0x2021, 0xc00539d, 0x24040001, 0xc00539d, 
-0x2021, 0xc00539d, 0x24040001, 0x24100010, 
-0x32020001, 0x10400002, 0x2021, 0x24040001, 
-0xc00539d, 0x108042, 0x1600fffa, 0x32020001, 
-0x24100010, 0x32020012, 0x10400002, 0x2021, 
-0x24040001, 0xc00539d, 0x108042, 0x1600fffa, 
-0x32020012, 0xc00539d, 0x24040001, 0xc00539d, 
-0x2021, 0x34108000, 0x96220000, 0x501024, 
-0x10400002, 0x2021, 0x24040001, 0xc00539d, 
-0x108042, 0x1600fff8, 0x0, 0xc0053de, 
-0x0, 0x8f830054, 0x10000248, 0x24020006, 
-0x8f830054, 0x3c020002, 0x8c4287f8, 0x2463ff9c, 
-0x431023, 0x2c420064, 0x14400251, 0x24020007, 
-0x1000024d, 0x0, 0x24020006, 0xa7a20010, 
-0x27b10010, 0x8021, 0xc00539d, 0x24040001, 
-0x26100001, 0x2e020020, 0x1440fffb, 0x0, 
-0xc00539d, 0x2021, 0xc00539d, 0x24040001, 
-0xc00539d, 0x2021, 0xc00539d, 0x24040001, 
-0x24100010, 0x32020001, 0x10400002, 0x2021, 
-0x24040001, 0xc00539d, 0x108042, 0x1600fffa, 
-0x32020001, 0x24100010, 0x32020013, 0x10400002, 
-0x2021, 0x24040001, 0xc00539d, 0x108042, 
-0x1600fffa, 0x32020013, 0xc00539d, 0x24040001, 
-0xc00539d, 0x2021, 0x34108000, 0x96220000, 
-0x501024, 0x10400002, 0x2021, 0x24040001, 
-0xc00539d, 0x108042, 0x1600fff8, 0x0, 
-0xc0053de, 0x0, 0x8f830054, 0x10000207, 
-0x24020008, 0x8f830054, 0x3c020002, 0x8c4287f8, 
-0x2463ff9c, 0x431023, 0x2c420064, 0x14400210, 
-0x24020009, 0x1000020c, 0x0, 0x27b10010, 
-0xa7a00010, 0x8021, 0xc00539d, 0x24040001, 
-0x26100001, 0x2e020020, 0x1440fffb, 0x0, 
-0xc00539d, 0x2021, 0xc00539d, 0x24040001, 
-0xc00539d, 0x24040001, 0xc00539d, 0x2021, 
-0x24100010, 0x32020001, 0x10400002, 0x2021, 
-0x24040001, 0xc00539d, 0x108042, 0x1600fffa, 
-0x32020001, 0x24100010, 0x32020018, 0x10400002, 
-0x2021, 0x24040001, 0xc00539d, 0x108042, 
-0x1600fffa, 0x32020018, 0xc0053de, 0x34108000, 
-0xc0053de, 0x0, 0xc00537d, 0x0, 
-0x50400005, 0x108042, 0x96220000, 0x501025, 
-0xa6220000, 0x108042, 0x1600fff7, 0x0, 
-0xc0053de, 0x8021, 0x97a20010, 0x27b10010, 
-0x34420001, 0xa7a20010, 0xc00539d, 0x24040001, 
-0x26100001, 0x2e020020, 0x1440fffb, 0x0, 
-0xc00539d, 0x2021, 0xc00539d, 0x24040001, 
-0xc00539d, 0x2021, 0xc00539d, 0x24040001, 
-0x24100010, 0x32020001, 0x10400002, 0x2021, 
-0x24040001, 0xc00539d, 0x108042, 0x1600fffa, 
-0x32020001, 0x24100010, 0x32020018, 0x10400002, 
-0x2021, 0x24040001, 0xc00539d, 0x108042, 
-0x1600fffa, 0x32020018, 0xc00539d, 0x24040001, 
-0xc00539d, 0x2021, 0x34108000, 0x96220000, 
-0x501024, 0x10400002, 0x2021, 0x24040001, 
-0xc00539d, 0x108042, 0x1600fff8, 0x0, 
-0xc0053de, 0x0, 0x8f830054, 0x10000193, 
-0x2402000a, 0x8f830054, 0x3c020002, 0x8c4287f8, 
-0x2463ff9c, 0x431023, 0x2c420064, 0x1440019c, 
-0x2402000b, 0x10000198, 0x0, 0x27b10010, 
-0xa7a00010, 0x8021, 0xc00539d, 0x24040001, 
-0x26100001, 0x2e020020, 0x1440fffb, 0x0, 
-0xc00539d, 0x2021, 0xc00539d, 0x24040001, 
-0xc00539d, 0x24040001, 0xc00539d, 0x2021, 
-0x24100010, 0x32020001, 0x10400002, 0x2021, 
-0x24040001, 0xc00539d, 0x108042, 0x1600fffa, 
-0x32020001, 0x24100010, 0x32020017, 0x10400002, 
-0x2021, 0x24040001, 0xc00539d, 0x108042, 
-0x1600fffa, 0x32020017, 0xc0053de, 0x34108000, 
-0xc0053de, 0x0, 0xc00537d, 0x0, 
-0x50400005, 0x108042, 0x96220000, 0x501025, 
-0xa6220000, 0x108042, 0x1600fff7, 0x0, 
-0xc0053de, 0x8021, 0x97a20010, 0x27b10010, 
-0x34420700, 0xa7a20010, 0xc00539d, 0x24040001, 
-0x26100001, 0x2e020020, 0x1440fffb, 0x0, 
-0xc00539d, 0x2021, 0xc00539d, 0x24040001, 
-0xc00539d, 0x2021, 0xc00539d, 0x24040001, 
-0x24100010, 0x32020001, 0x10400002, 0x2021, 
-0x24040001, 0xc00539d, 0x108042, 0x1600fffa, 
-0x32020001, 0x24100010, 0x32020017, 0x10400002, 
-0x2021, 0x24040001, 0xc00539d, 0x108042, 
-0x1600fffa, 0x32020017, 0xc00539d, 0x24040001, 
-0xc00539d, 0x2021, 0x34108000, 0x96220000, 
-0x501024, 0x10400002, 0x2021, 0x24040001, 
-0xc00539d, 0x108042, 0x1600fff8, 0x0, 
-0xc0053de, 0x0, 0x8f830054, 0x1000011f, 
-0x2402000c, 0x8f830054, 0x3c020002, 0x8c4287f8, 
-0x2463ff9c, 0x431023, 0x2c420064, 0x14400128, 
-0x24020012, 0x10000124, 0x0, 0x27b10010, 
-0xa7a00010, 0x8021, 0xc00539d, 0x24040001, 
-0x26100001, 0x2e020020, 0x1440fffb, 0x0, 
-0xc00539d, 0x2021, 0xc00539d, 0x24040001, 
-0xc00539d, 0x24040001, 0xc00539d, 0x2021, 
-0x24100010, 0x32020001, 0x10400002, 0x2021, 
-0x24040001, 0xc00539d, 0x108042, 0x1600fffa, 
-0x32020001, 0x24100010, 0x32020014, 0x10400002, 
-0x2021, 0x24040001, 0xc00539d, 0x108042, 
-0x1600fffa, 0x32020014, 0xc0053de, 0x34108000, 
-0xc0053de, 0x0, 0xc00537d, 0x0, 
-0x50400005, 0x108042, 0x96220000, 0x501025, 
-0xa6220000, 0x108042, 0x1600fff7, 0x0, 
-0xc0053de, 0x8021, 0x97a20010, 0x27b10010, 
-0x34420010, 0xa7a20010, 0xc00539d, 0x24040001, 
-0x26100001, 0x2e020020, 0x1440fffb, 0x0, 
-0xc00539d, 0x2021, 0xc00539d, 0x24040001, 
-0xc00539d, 0x2021, 0xc00539d, 0x24040001, 
-0x24100010, 0x32020001, 0x10400002, 0x2021, 
-0x24040001, 0xc00539d, 0x108042, 0x1600fffa, 
-0x32020001, 0x24100010, 0x32020014, 0x10400002, 
-0x2021, 0x24040001, 0xc00539d, 0x108042, 
-0x1600fffa, 0x32020014, 0xc00539d, 0x24040001, 
-0xc00539d, 0x2021, 0x34108000, 0x96220000, 
-0x501024, 0x10400002, 0x2021, 0x24040001, 
-0xc00539d, 0x108042, 0x1600fff8, 0x0, 
-0xc0053de, 0x0, 0x8f830054, 0x100000ab, 
-0x24020013, 0x8f830054, 0x3c020002, 0x8c4287f8, 
-0x2463ff9c, 0x431023, 0x2c420064, 0x144000b4, 
-0x2402000d, 0x100000b0, 0x0, 0x27b10010, 
-0xa7a00010, 0x8021, 0xc00539d, 0x24040001, 
-0x26100001, 0x2e020020, 0x1440fffb, 0x0, 
-0xc00539d, 0x2021, 0xc00539d, 0x24040001, 
-0xc00539d, 0x24040001, 0xc00539d, 0x2021, 
-0x24100010, 0x32020001, 0x10400002, 0x2021, 
-0x24040001, 0xc00539d, 0x108042, 0x1600fffa, 
-0x32020001, 0x24100010, 0x32020018, 0x10400002, 
-0x2021, 0x24040001, 0xc00539d, 0x108042, 
-0x1600fffa, 0x32020018, 0xc0053de, 0x34108000, 
-0xc0053de, 0x0, 0xc00537d, 0x0, 
-0x50400005, 0x108042, 0x96220000, 0x501025, 
-0xa6220000, 0x108042, 0x1600fff7, 0x0, 
-0xc0053de, 0x8021, 0x97a20010, 0x27b10010, 
-0x3042fffe, 0xa7a20010, 0xc00539d, 0x24040001, 
-0x26100001, 0x2e020020, 0x1440fffb, 0x0, 
-0xc00539d, 0x2021, 0xc00539d, 0x24040001, 
-0xc00539d, 0x2021, 0xc00539d, 0x24040001, 
-0x24100010, 0x32020001, 0x10400002, 0x2021, 
-0x24040001, 0xc00539d, 0x108042, 0x1600fffa, 
-0x32020001, 0x24100010, 0x32020018, 0x10400002, 
-0x2021, 0x24040001, 0xc00539d, 0x108042, 
-0x1600fffa, 0x32020018, 0xc00539d, 0x24040001, 
-0xc00539d, 0x2021, 0x34108000, 0x96220000, 
-0x501024, 0x10400002, 0x2021, 0x24040001, 
-0xc00539d, 0x108042, 0x1600fff8, 0x0, 
-0xc0053de, 0x0, 0x8f830054, 0x10000037, 
-0x2402000e, 0x24020840, 0xa7a20010, 0x27b10010, 
-0x8021, 0xc00539d, 0x24040001, 0x26100001, 
-0x2e020020, 0x1440fffb, 0x0, 0xc00539d, 
-0x2021, 0xc00539d, 0x24040001, 0xc00539d, 
-0x2021, 0xc00539d, 0x24040001, 0x24100010, 
-0x32020001, 0x10400002, 0x2021, 0x24040001, 
-0xc00539d, 0x108042, 0x1600fffa, 0x32020001, 
-0x24100010, 0x32020013, 0x10400002, 0x2021, 
-0x24040001, 0xc00539d, 0x108042, 0x1600fffa, 
-0x32020013, 0xc00539d, 0x24040001, 0xc00539d, 
-0x2021, 0x34108000, 0x96220000, 0x501024, 
-0x10400002, 0x2021, 0x24040001, 0xc00539d, 
-0x108042, 0x1600fff8, 0x0, 0xc0053de, 
-0x0, 0x8f830054, 0x24020010, 0x3c010002, 
-0xac22869c, 0x3c010002, 0xac2387f8, 0x1000000c, 
-0x0, 0x8f830054, 0x3c020002, 0x8c4287f8, 
-0x2463ff9c, 0x431023, 0x2c420064, 0x14400004, 
-0x0, 0x24020011, 0x3c010002, 0xac22869c, 
-0x8fbf0020, 0x8fb1001c, 0x8fb00018, 0x3e00008, 
-0x27bd0028, 0x3c030002, 0x8c63866c, 0x27bdffc8, 
-0x24020002, 0xafbf0034, 0xafb20030, 0xafb1002c, 
-0x14620005, 0xafb00028, 0x3c120002, 0x8e52a8b8, 
-0x10000003, 0x0, 0x3c120002, 0x8e52a8bc, 
-0x3c030002, 0x8c6386a0, 0x3c020002, 0x8c4286e8, 
-0x50620004, 0x2463ffff, 0x3c010002, 0xac2386e8, 
-0x2463ffff, 0x2c620006, 0x1040037c, 0x31080, 
-0x3c010002, 0x220821, 0x8c228300, 0x400008, 
-0x0, 0x2021, 0x2821, 0xc005400, 
-0x34068000, 0x24040010, 0x24050002, 0x24060002, 
-0x24020002, 0xc005400, 0xa7a20018, 0x24020002, 
-0x3c010002, 0xac2286a0, 0x10000368, 0x0, 
-0x27b10018, 0xa7a00018, 0x8021, 0xc00539d, 
-0x24040001, 0x26100001, 0x2e020020, 0x1440fffb, 
-0x0, 0xc00539d, 0x2021, 0xc00539d, 
-0x24040001, 0xc00539d, 0x24040001, 0xc00539d, 
-0x2021, 0x24100010, 0x32020001, 0x10400002, 
-0x2021, 0x24040001, 0xc00539d, 0x108042, 
-0x1600fffa, 0x32020001, 0x24100010, 0xc00539d, 
-0x2021, 0x108042, 0x1600fffc, 0x0, 
-0xc0053de, 0x34108000, 0xc0053de, 0x0, 
-0xc00537d, 0x0, 0x50400005, 0x108042, 
-0x96220000, 0x501025, 0xa6220000, 0x108042, 
-0x1600fff7, 0x0, 0xc0053de, 0x0, 
-0x97a20018, 0x30428000, 0x14400004, 0x24020003, 
-0x3c010002, 0xac2286a0, 0x24020003, 0x3c010002, 
-0xac2286a0, 0x1000032d, 0x0, 0x24040010, 
-0x24050002, 0x24060002, 0x24020002, 0xc005400, 
-0xa7a20018, 0x3c030002, 0x8c6386ec, 0x24020001, 
-0x146201e1, 0x8021, 0x27b10018, 0xa7a00018, 
-0xc00539d, 0x24040001, 0x26100001, 0x2e020020, 
-0x1440fffb, 0x0, 0xc00539d, 0x2021, 
-0xc00539d, 0x24040001, 0xc00539d, 0x24040001, 
-0xc00539d, 0x2021, 0x24100010, 0x32020001, 
-0x10400002, 0x2021, 0x24040001, 0xc00539d, 
-0x108042, 0x1600fffa, 0x32020001, 0x24100010, 
-0x32020018, 0x10400002, 0x2021, 0x24040001, 
-0xc00539d, 0x108042, 0x1600fffa, 0x32020018, 
-0xc0053de, 0x34108000, 0xc0053de, 0x0, 
-0xc00537d, 0x0, 0x50400005, 0x108042, 
-0x96220000, 0x501025, 0xa6220000, 0x108042, 
-0x1600fff7, 0x0, 0xc0053de, 0x8021, 
-0x27b10018, 0xa7a00018, 0xc00539d, 0x24040001, 
-0x26100001, 0x2e020020, 0x1440fffb, 0x0, 
-0xc00539d, 0x2021, 0xc00539d, 0x24040001, 
-0xc00539d, 0x24040001, 0xc00539d, 0x2021, 
-0x24100010, 0x32020001, 0x10400002, 0x2021, 
-0x24040001, 0xc00539d, 0x108042, 0x1600fffa, 
-0x32020001, 0x24100010, 0x32020018, 0x10400002, 
-0x2021, 0x24040001, 0xc00539d, 0x108042, 
-0x1600fffa, 0x32020018, 0xc0053de, 0x34108000, 
-0xc0053de, 0x0, 0xc00537d, 0x0, 
-0x50400005, 0x108042, 0x96220000, 0x501025, 
-0xa6220000, 0x108042, 0x1600fff7, 0x0, 
-0xc0053de, 0x8021, 0x24040018, 0x2821, 
-0xc005400, 0x24060404, 0xa7a0001a, 0xc00539d, 
-0x24040001, 0x26100001, 0x2e020020, 0x1440fffb, 
-0x0, 0xc00539d, 0x2021, 0xc00539d, 
-0x24040001, 0xc00539d, 0x24040001, 0xc00539d, 
-0x2021, 0x24100010, 0x32020001, 0x10400002, 
-0x2021, 0x24040001, 0xc00539d, 0x108042, 
-0x1600fffa, 0x32020001, 0x24100010, 0x32020018, 
-0x10400002, 0x2021, 0x24040001, 0xc00539d, 
-0x108042, 0x1600fffa, 0x32020018, 0xc0053de, 
-0x34108000, 0xc0053de, 0x0, 0xc00537d, 
-0x0, 0x50400005, 0x108042, 0x97a2001a, 
-0x501025, 0xa7a2001a, 0x108042, 0x1600fff7, 
-0x0, 0xc0053de, 0x8021, 0xa7a0001a, 
-0xc00539d, 0x24040001, 0x26100001, 0x2e020020, 
-0x1440fffb, 0x0, 0xc00539d, 0x2021, 
-0xc00539d, 0x24040001, 0xc00539d, 0x24040001, 
-0xc00539d, 0x2021, 0x24100010, 0x32020001, 
-0x10400002, 0x2021, 0x24040001, 0xc00539d, 
-0x108042, 0x1600fffa, 0x32020001, 0x24100010, 
-0x32020018, 0x10400002, 0x2021, 0x24040001, 
-0xc00539d, 0x108042, 0x1600fffa, 0x32020018, 
-0xc0053de, 0x34108000, 0xc0053de, 0x0, 
-0xc00537d, 0x0, 0x50400005, 0x108042, 
-0x97a2001a, 0x501025, 0xa7a2001a, 0x108042, 
-0x1600fff7, 0x0, 0xc0053de, 0x8021, 
-0xa7a0001c, 0xc00539d, 0x24040001, 0x26100001, 
-0x2e020020, 0x1440fffb, 0x0, 0xc00539d, 
-0x2021, 0xc00539d, 0x24040001, 0xc00539d, 
-0x24040001, 0xc00539d, 0x2021, 0x24100010, 
-0xc00539d, 0x2021, 0x108042, 0x1600fffc, 
-0x0, 0x24100010, 0x3202001e, 0x10400002, 
-0x2021, 0x24040001, 0xc00539d, 0x108042, 
-0x1600fffa, 0x3202001e, 0xc0053de, 0x34108000, 
-0xc0053de, 0x0, 0xc00537d, 0x0, 
-0x50400005, 0x108042, 0x97a2001c, 0x501025, 
-0xa7a2001c, 0x108042, 0x1600fff7, 0x0, 
-0xc0053de, 0x8021, 0xa7a0001c, 0xc00539d, 
-0x24040001, 0x26100001, 0x2e020020, 0x1440fffb, 
-0x0, 0xc00539d, 0x2021, 0xc00539d, 
-0x24040001, 0xc00539d, 0x24040001, 0xc00539d, 
-0x2021, 0x24100010, 0xc00539d, 0x2021, 
-0x108042, 0x1600fffc, 0x0, 0x24100010, 
-0x3202001e, 0x10400002, 0x2021, 0x24040001, 
-0xc00539d, 0x108042, 0x1600fffa, 0x3202001e, 
-0xc0053de, 0x34108000, 0xc0053de, 0x0, 
-0xc00537d, 0x0, 0x50400005, 0x108042, 
-0x97a2001c, 0x501025, 0xa7a2001c, 0x108042, 
-0x1600fff7, 0x0, 0xc0053de, 0x8021, 
-0x24020002, 0xa7a2001e, 0xc00539d, 0x24040001, 
-0x26100001, 0x2e020020, 0x1440fffb, 0x0, 
-0xc00539d, 0x2021, 0xc00539d, 0x24040001, 
-0xc00539d, 0x2021, 0xc00539d, 0x24040001, 
-0x24100010, 0xc00539d, 0x2021, 0x108042, 
-0x1600fffc, 0x0, 0x24100010, 0x3202001e, 
-0x10400002, 0x2021, 0x24040001, 0xc00539d, 
-0x108042, 0x1600fffa, 0x3202001e, 0xc00539d, 
-0x24040001, 0xc00539d, 0x2021, 0x34108000, 
-0x97a2001e, 0x501024, 0x10400002, 0x2021, 
-0x24040001, 0xc00539d, 0x108042, 0x1600fff8, 
-0x0, 0xc0053de, 0x8021, 0xa7a00020, 
-0xc00539d, 0x24040001, 0x26100001, 0x2e020020, 
-0x1440fffb, 0x0, 0xc00539d, 0x2021, 
-0xc00539d, 0x24040001, 0xc00539d, 0x24040001, 
-0xc00539d, 0x2021, 0x24100010, 0xc00539d, 
-0x2021, 0x108042, 0x1600fffc, 0x0, 
-0x24100010, 0x3202001e, 0x10400002, 0x2021, 
-0x24040001, 0xc00539d, 0x108042, 0x1600fffa, 
-0x3202001e, 0xc0053de, 0x34108000, 0xc0053de, 
-0x0, 0xc00537d, 0x0, 0x50400005, 
-0x108042, 0x97a20020, 0x501025, 0xa7a20020, 
-0x108042, 0x1600fff7, 0x0, 0xc0053de, 
-0x8021, 0xa7a00020, 0xc00539d, 0x24040001, 
-0x26100001, 0x2e020020, 0x1440fffb, 0x0, 
-0xc00539d, 0x2021, 0xc00539d, 0x24040001, 
-0xc00539d, 0x24040001, 0xc00539d, 0x2021, 
-0x24100010, 0xc00539d, 0x2021, 0x108042, 
-0x1600fffc, 0x0, 0x24100010, 0x3202001e, 
-0x10400002, 0x2021, 0x24040001, 0xc00539d, 
-0x108042, 0x1600fffa, 0x3202001e, 0xc0053de, 
-0x34108000, 0xc0053de, 0x0, 0xc00537d, 
-0x0, 0x50400005, 0x108042, 0x97a20020, 
-0x501025, 0xa7a20020, 0x108042, 0x1600fff7, 
-0x0, 0xc0053de, 0x8021, 0xa7a00022, 
-0xc00539d, 0x24040001, 0x26100001, 0x2e020020, 
-0x1440fffb, 0x0, 0xc00539d, 0x2021, 
-0xc00539d, 0x24040001, 0xc00539d, 0x2021, 
-0xc00539d, 0x24040001, 0x24100010, 0xc00539d, 
-0x2021, 0x108042, 0x1600fffc, 0x0, 
-0x24100010, 0xc00539d, 0x2021, 0x108042, 
-0x1600fffc, 0x0, 0xc00539d, 0x24040001, 
-0xc00539d, 0x2021, 0x34108000, 0x97a20022, 
-0x501024, 0x10400002, 0x2021, 0x24040001, 
-0xc00539d, 0x108042, 0x1600fff8, 0x0, 
-0xc0053de, 0x0, 0x24040018, 0x24050002, 
-0xc005400, 0x24060004, 0x3c100002, 0x8e1086f0, 
-0x24020001, 0x1602011e, 0x0, 0x3c020002, 
-0x944287e2, 0x3c010002, 0xac2086f0, 0x24429fbc, 
-0x2c420004, 0x1040000c, 0x24040009, 0x24050001, 
-0xc005400, 0x24060400, 0x24040018, 0x24050001, 
-0xc005400, 0x24060020, 0x24040018, 0x24050001, 
-0xc005400, 0x24062000, 0x3c024000, 0x2421024, 
-0x10400126, 0x3c022000, 0x2421024, 0x10400005, 
-0x0, 0x3c010002, 0xac3087d8, 0x10000003, 
-0x0, 0x3c010002, 0xac2087d8, 0x3c030002, 
-0x8c6387f0, 0x24020005, 0x146200f9, 0x0, 
-0x3c020002, 0x8c4287d8, 0x10400067, 0x3c020004, 
-0x2421024, 0x10400011, 0xa7a00018, 0x3c020008, 
-0x2421024, 0x10400002, 0x24020200, 0xa7a20018, 
-0x3c020010, 0x2421024, 0x10400004, 0x0, 
-0x97a20018, 0x34420100, 0xa7a20018, 0x97a60018, 
-0x24040009, 0x10000004, 0x2821, 0x24040009, 
-0x2821, 0x3021, 0xc005400, 0x0, 
-0x24020001, 0xa7a2001a, 0x3c020008, 0x2421024, 
-0x1040000c, 0x3c020002, 0x2421024, 0x10400002, 
-0x24020101, 0xa7a2001a, 0x3c020001, 0x2421024, 
-0x10400005, 0x3c020010, 0x97a2001a, 0x34420040, 
-0xa7a2001a, 0x3c020010, 0x2421024, 0x1040000e, 
-0x3c020002, 0x2421024, 0x10400005, 0x3c020001, 
-0x97a2001a, 0x34420080, 0xa7a2001a, 0x3c020001, 
-0x2421024, 0x10400005, 0x3c0300a0, 0x97a2001a, 
-0x34420020, 0xa7a2001a, 0x3c0300a0, 0x2431024, 
-0x54430004, 0x3c020020, 0x97a2001a, 0x1000000c, 
-0x34420400, 0x2421024, 0x50400004, 0x3c020080, 
-0x97a2001a, 0x10000006, 0x34420800, 0x2421024, 
-0x10400004, 0x0, 0x97a2001a, 0x34420c00, 
-0xa7a2001a, 0x97a6001a, 0x24040004, 0xc005400, 
-0x2821, 0x3c020004, 0x2421024, 0x10400004, 
-0xa7a0001c, 0x32425000, 0x14400004, 0x0, 
-0x32424000, 0x10400005, 0x2021, 0xc00531e, 
-0x2402021, 0x10000096, 0x0, 0x97a6001c, 
-0x2821, 0x34c61200, 0xc005400, 0xa7a6001c, 
-0x1000008f, 0x0, 0x2421024, 0x10400004, 
-0xa7a00018, 0x32425000, 0x14400004, 0x0, 
-0x32424000, 0x10400005, 0x3c020010, 0xc00531e, 
-0x2402021, 0x10000019, 0xa7a0001a, 0x2421024, 
-0x10400004, 0x0, 0x97a20018, 0x10000004, 
-0xa7a20018, 0x97a20018, 0x34420100, 0xa7a20018, 
-0x3c020001, 0x2421024, 0x10400004, 0x0, 
-0x97a20018, 0x10000004, 0xa7a20018, 0x97a20018, 
-0x34422000, 0xa7a20018, 0x97a60018, 0x2021, 
-0xc005400, 0x2821, 0xa7a0001a, 0x8021, 
-0xc00539d, 0x24040001, 0x26100001, 0x2e020020, 
-0x1440fffb, 0x0, 0xc00539d, 0x2021, 
-0xc00539d, 0x24040001, 0xc00539d, 0x24040001, 
-0xc00539d, 0x2021, 0x24100010, 0x32020001, 
-0x10400002, 0x2021, 0x24040001, 0xc00539d, 
-0x108042, 0x1600fffa, 0x32020001, 0x24100010, 
-0xc00539d, 0x2021, 0x108042, 0x1600fffc, 
-0x0, 0xc0053de, 0x34108000, 0xc0053de, 
-0x0, 0xc00537d, 0x0, 0x50400005, 
-0x108042, 0x97a2001a, 0x501025, 0xa7a2001a, 
-0x108042, 0x1600fff7, 0x0, 0xc0053de, 
-0x8021, 0xa7a0001a, 0xc00539d, 0x24040001, 
-0x26100001, 0x2e020020, 0x1440fffb, 0x0, 
-0xc00539d, 0x2021, 0xc00539d, 0x24040001, 
-0xc00539d, 0x24040001, 0xc00539d, 0x2021, 
-0x24100010, 0x32020001, 0x10400002, 0x2021, 
-0x24040001, 0xc00539d, 0x108042, 0x1600fffa, 
-0x32020001, 0x24100010, 0xc00539d, 0x2021, 
-0x108042, 0x1600fffc, 0x0, 0xc0053de, 
-0x34108000, 0xc0053de, 0x0, 0xc00537d, 
-0x0, 0x50400005, 0x108042, 0x97a2001a, 
-0x501025, 0xa7a2001a, 0x108042, 0x1600fff7, 
-0x0, 0xc0053de, 0x0, 0x3c040002, 
-0x248482f4, 0x97a60018, 0x97a7001a, 0x3c020002, 
-0x8c42866c, 0x3c030002, 0x8c6387d8, 0x3c05000d, 
-0x34a50205, 0xafa20010, 0xc002d3b, 0xafa30014, 
-0x8f830054, 0x24020004, 0x3c010002, 0xac2286a0, 
-0x3c010002, 0xac2387f4, 0x10000018, 0x0, 
-0x8f830054, 0x3c020002, 0x8c4287f4, 0x2463ff9c, 
-0x431023, 0x2c420064, 0x14400010, 0x0, 
-0x8f820220, 0x24030005, 0x3c010002, 0xac2386a0, 
-0x3c03f700, 0x431025, 0xaf820220, 0x10000007, 
-0x0, 0x24020006, 0x3c010002, 0xac2286a0, 
-0x24020011, 0x3c010002, 0xac22869c, 0x8fbf0034, 
-0x8fb20030, 0x8fb1002c, 0x8fb00028, 0x3e00008, 
-0x27bd0038, 0x27bdffd8, 0xafb00018, 0x808021, 
-0xafb1001c, 0x8821, 0x32024000, 0x10400013, 
-0xafbf0020, 0x3c020010, 0x2021024, 0x2c420001, 
-0x21023, 0x30434100, 0x3c020001, 0x2021024, 
-0x14400006, 0x34714000, 0x3c020002, 0x2021024, 
-0x14400002, 0x34716000, 0x34714040, 0x2021, 
-0x2821, 0x10000036, 0x2203021, 0x32021000, 
-0x10400035, 0x2021, 0x2821, 0xc005400, 
-0x24060040, 0x24040018, 0x2821, 0xc005400, 
-0x24060c00, 0x24040017, 0x2821, 0xc005400, 
-0x24060400, 0x24040016, 0x2821, 0xc005400, 
-0x24060006, 0x24040017, 0x2821, 0xc005400, 
-0x24062500, 0x24040016, 0x2821, 0xc005400, 
-0x24060006, 0x24040017, 0x2821, 0xc005400, 
-0x24064600, 0x24040016, 0x2821, 0xc005400, 
-0x24060006, 0x24040017, 0x2821, 0xc005400, 
-0x24066700, 0x24040016, 0x2821, 0xc005400, 
-0x24060006, 0x2404001f, 0x2821, 0xc005400, 
-0x24060010, 0x24040009, 0x2821, 0xc005400, 
-0x24061500, 0x24040009, 0x2821, 0x24061d00, 
-0xc005400, 0x0, 0x3c040002, 0x24848318, 
-0x3c05000e, 0x34a50100, 0x2003021, 0x2203821, 
-0xafa00010, 0xc002d3b, 0xafa00014, 0x8fbf0020, 
-0x8fb1001c, 0x8fb00018, 0x3e00008, 0x27bd0028, 
-0x8f850044, 0x8f820044, 0x3c030001, 0x431025, 
-0x3c030008, 0xaf820044, 0x8f840054, 0x8f820054, 
-0xa32824, 0x10000002, 0x24840001, 0x8f820054, 
-0x821023, 0x2c420002, 0x1440fffc, 0x0, 
-0x8f820044, 0x3c03fffe, 0x3463ffff, 0x431024, 
-0xaf820044, 0x8f830054, 0x8f820054, 0x10000002, 
-0x24630001, 0x8f820054, 0x621023, 0x2c420002, 
-0x1440fffc, 0x0, 0x3e00008, 0xa01021, 
-0x8f830044, 0x3c02fff0, 0x3442ffff, 0x42480, 
-0x621824, 0x3c020002, 0x822025, 0x641825, 
-0xaf830044, 0x8f820044, 0x3c03fffe, 0x3463ffff, 
-0x431024, 0xaf820044, 0x8f830054, 0x8f820054, 
-0x10000002, 0x24630001, 0x8f820054, 0x621023, 
-0x2c420002, 0x1440fffc, 0x0, 0x8f820044, 
-0x3c030001, 0x431025, 0xaf820044, 0x8f830054, 
-0x8f820054, 0x10000002, 0x24630001, 0x8f820054, 
-0x621023, 0x2c420002, 0x1440fffc, 0x0, 
-0x3e00008, 0x0, 0x8f820044, 0x2403ff7f, 
-0x431024, 0xaf820044, 0x8f830054, 0x8f820054, 
-0x10000002, 0x24630001, 0x8f820054, 0x621023, 
-0x2c420002, 0x1440fffc, 0x0, 0x8f820044, 
-0x34420080, 0xaf820044, 0x8f830054, 0x8f820054, 
-0x10000002, 0x24630001, 0x8f820054, 0x621023, 
-0x2c420002, 0x1440fffc, 0x0, 0x3e00008, 
-0x0, 0x8f820044, 0x3c03fff0, 0x3463ffff, 
-0x431024, 0xaf820044, 0x8f820044, 0x3c030001, 
-0x431025, 0xaf820044, 0x8f830054, 0x8f820054, 
-0x10000002, 0x24630001, 0x8f820054, 0x621023, 
-0x2c420002, 0x1440fffc, 0x0, 0x8f820044, 
-0x3c03fffe, 0x3463ffff, 0x431024, 0xaf820044, 
-0x8f830054, 0x8f820054, 0x10000002, 0x24630001, 
-0x8f820054, 0x621023, 0x2c420002, 0x1440fffc, 
-0x0, 0x3e00008, 0x0, 0x27bdffc8, 
-0xafb30024, 0x809821, 0xafbe002c, 0xa0f021, 
-0xafb20020, 0xc09021, 0x33c2ffff, 0xafbf0030, 
-0xafb50028, 0xafb1001c, 0xafb00018, 0x14400034, 
-0xa7b20010, 0x3271ffff, 0x27b20010, 0x8021, 
-0xc00539d, 0x24040001, 0x26100001, 0x2e020020, 
-0x1440fffb, 0x0, 0xc00539d, 0x2021, 
-0xc00539d, 0x24040001, 0xc00539d, 0x2021, 
-0xc00539d, 0x24040001, 0x24100010, 0x32020001, 
-0x10400002, 0x2021, 0x24040001, 0xc00539d, 
-0x108042, 0x1600fffa, 0x32020001, 0x24100010, 
-0x2301024, 0x10400002, 0x2021, 0x24040001, 
-0xc00539d, 0x108042, 0x1600fffa, 0x2301024, 
-0xc00539d, 0x24040001, 0xc00539d, 0x2021, 
-0x34108000, 0x96420000, 0x501024, 0x10400002, 
-0x2021, 0x24040001, 0xc00539d, 0x108042, 
-0x12000075, 0x0, 0x1000fff6, 0x0, 
-0x3275ffff, 0x27b10010, 0xa7a00010, 0x8021, 
-0xc00539d, 0x24040001, 0x26100001, 0x2e020020, 
-0x1440fffb, 0x0, 0xc00539d, 0x2021, 
-0xc00539d, 0x24040001, 0xc00539d, 0x24040001, 
-0xc00539d, 0x2021, 0x24100010, 0x32020001, 
-0x10400002, 0x2021, 0x24040001, 0xc00539d, 
-0x108042, 0x1600fffa, 0x32020001, 0x24100010, 
-0x2b01024, 0x10400002, 0x2021, 0x24040001, 
-0xc00539d, 0x108042, 0x1600fffa, 0x2b01024, 
-0xc0053de, 0x34108000, 0xc0053de, 0x0, 
-0xc00537d, 0x0, 0x50400005, 0x108042, 
-0x96220000, 0x501025, 0xa6220000, 0x108042, 
-0x1600fff7, 0x0, 0xc0053de, 0x0, 
-0x33c5ffff, 0x24020001, 0x54a20004, 0x24020002, 
-0x97a20010, 0x10000006, 0x521025, 0x14a20006, 
-0x3271ffff, 0x97a20010, 0x121827, 0x431024, 
-0xa7a20010, 0x3271ffff, 0x27b20010, 0x8021, 
-0xc00539d, 0x24040001, 0x26100001, 0x2e020020, 
-0x1440fffb, 0x0, 0xc00539d, 0x2021, 
-0xc00539d, 0x24040001, 0xc00539d, 0x2021, 
-0xc00539d, 0x24040001, 0x24100010, 0x32020001, 
-0x10400002, 0x2021, 0x24040001, 0xc00539d, 
-0x108042, 0x1600fffa, 0x32020001, 0x24100010, 
-0x2301024, 0x10400002, 0x2021, 0x24040001, 
-0xc00539d, 0x108042, 0x1600fffa, 0x2301024, 
-0xc00539d, 0x24040001, 0xc00539d, 0x2021, 
-0x34108000, 0x96420000, 0x501024, 0x10400002, 
-0x2021, 0x24040001, 0xc00539d, 0x108042, 
-0x1600fff8, 0x0, 0xc0053de, 0x0, 
-0x8fbf0030, 0x8fbe002c, 0x8fb50028, 0x8fb30024, 
-0x8fb20020, 0x8fb1001c, 0x8fb00018, 0x3e00008, 
-0x27bd0038, 0x27bdffe8, 0xafbf0010, 0x8ee304b8, 
-0x24020008, 0x146201f1, 0x0, 0x3c020002, 
-0x8c4287d8, 0x14400006, 0x0, 0x8f840224, 
-0xc00430b, 0x0, 0x100001e8, 0x0, 
-0x8f820220, 0x3c030008, 0x431024, 0x10400029, 
-0x24020001, 0x8f840224, 0x8f820220, 0x3c030400, 
-0x431024, 0x10400007, 0x0, 0x3c010002, 
-0xac20a860, 0x3c010002, 0xac20a880, 0x1000000b, 
-0x0, 0x3c030002, 0x2463a860, 0x8c620000, 
-0x24420001, 0xac620000, 0x2c420002, 0x14400003, 
-0x24020001, 0x3c010002, 0xac22a880, 0x3c020002, 
-0x8c42a880, 0x10400007, 0x30820040, 0x10400005, 
-0x24020001, 0x3c010002, 0xac22a884, 0x10000003, 
-0x0, 0x3c010002, 0xac20a884, 0x3c010002, 
-0xac24a85c, 0x3c010002, 0xac20a890, 0x1000000b, 
-0x0, 0x3c010002, 0xac22a890, 0x3c010002, 
-0xac20a880, 0x3c010002, 0xac20a860, 0x3c010002, 
-0xac20a884, 0x3c010002, 0xac20a85c, 0x3c030002, 
-0x8c63a850, 0x3c020002, 0x8c42a854, 0x50620004, 
-0x2463ffff, 0x3c010002, 0xac23a854, 0x2463ffff, 
-0x2c62000e, 0x104001a1, 0x31080, 0x3c010002, 
-0x220821, 0x8c228338, 0x400008, 0x0, 
-0x24020002, 0x3c010002, 0xac20a880, 0x3c010002, 
-0xac20a860, 0x3c010002, 0xac20a85c, 0x3c010002, 
-0xac20a884, 0x3c010002, 0xac20a878, 0x3c010002, 
-0xac20a870, 0xaf800224, 0x3c010002, 0xac22a850, 
-0x3c020002, 0x8c42a890, 0x14400053, 0x3c02fdff, 
-0x3442ffff, 0xc00430b, 0x282a024, 0xaf800204, 
-0x8f820200, 0x2403fffd, 0x431024, 0xaf820200, 
-0x3c010002, 0xac20a8a0, 0x8f830054, 0x3c020002, 
-0x8c42a878, 0x24040001, 0x3c010002, 0xac24a88c, 
-0x24420001, 0x3c010002, 0xac22a878, 0x2c420004, 
-0x3c010002, 0xac23a874, 0x14400007, 0x24020003, 
-0x3c010002, 0xac248670, 0x3c010002, 0xac20a878, 
-0x1000016a, 0x0, 0x3c010002, 0xac22a850, 
-0x10000166, 0x0, 0x8f830054, 0x3c020002, 
-0x8c42a874, 0x2463d8f0, 0x431023, 0x2c422710, 
-0x14400003, 0x24020004, 0x3c010002, 0xac22a850, 
-0x3c020002, 0x8c42a890, 0x14400023, 0x3c02fdff, 
-0x3442ffff, 0x10000155, 0x282a024, 0x3c040002, 
-0x8c8487dc, 0x3c010002, 0xac20a868, 0xc0056b7, 
-0x0, 0x3c020002, 0x8c42a89c, 0xaf820204, 
-0x3c020002, 0x8c42a890, 0x14400013, 0x3c03fdff, 
-0x8f820204, 0x3463ffff, 0x30420030, 0x14400138, 
-0x283a024, 0x3c030002, 0x8c63a89c, 0x24020005, 
-0x3c010002, 0xac22a850, 0x3c010002, 0xac23a8a0, 
-0x1000013a, 0x0, 0x3c020002, 0x8c42a890, 
-0x10400011, 0x3c02fdff, 0x3c020002, 0x8c428700, 
-0x24420001, 0x3c010002, 0xac228700, 0x2c420002, 
-0x1440012e, 0x24020001, 0x3c010002, 0xac228708, 
-0x3c010002, 0xac208700, 0x3c010002, 0xac228670, 
-0x10000126, 0x0, 0x3c030002, 0x8c63a880, 
-0x3442ffff, 0x10600121, 0x282a024, 0x3c020002, 
-0x8c42a85c, 0x1040011d, 0x0, 0x3c010002, 
-0xac22a888, 0x24020003, 0x3c010002, 0xac22a860, 
-0x100000bd, 0x24020006, 0x3c010002, 0xac20a868, 
-0x8f820204, 0x34420040, 0xaf820204, 0x3c020002, 
-0x8c42a8a0, 0x24030007, 0x3c010002, 0xac23a850, 
-0x34420040, 0x3c010002, 0xac22a8a0, 0x3c020002, 
-0x8c42a880, 0x10400005, 0x0, 0x3c020002, 
-0x8c42a85c, 0x104000f7, 0x24020002, 0x3c050002, 
-0x24a5a860, 0x8ca20000, 0x2c424e21, 0x104000f1, 
-0x24020002, 0x3c020002, 0x8c42a884, 0x104000f7, 
-0x2404ffbf, 0x3c020002, 0x8c42a85c, 0x3c030002, 
-0x8c63a888, 0x441024, 0x641824, 0x10430005, 
-0x24020001, 0x3c010002, 0xac22a850, 0x100000eb, 
-0x0, 0x24020003, 0xaca20000, 0x24020008, 
-0x3c010002, 0xac22a850, 0x3c020002, 0x8c42a88c, 
-0x1040000d, 0x24020001, 0x3c040002, 0x8c84a85c, 
-0xc0056c4, 0x0, 0x3c020002, 0x8c42a8a8, 
-0x14400005, 0x24020001, 0x3c020002, 0x8c42a8a4, 
-0x10400007, 0x24020001, 0x3c010002, 0xac228670, 
-0x3c010002, 0xac20a878, 0x100000d0, 0x0, 
-0x3c020002, 0x8c42a870, 0x3c030002, 0x8c63a85c, 
-0x2c420001, 0x210c0, 0x30630008, 0x3c010002, 
-0xac22a870, 0x3c010002, 0xac23a86c, 0x8f830054, 
-0x24020009, 0x3c010002, 0xac22a850, 0x3c010002, 
-0xac23a874, 0x100000bd, 0x0, 0x8f830054, 
-0x3c020002, 0x8c42a874, 0x2463d8f0, 0x431023, 
-0x2c422710, 0x144000a2, 0x0, 0x3c020002, 
-0x8c42a880, 0x10400005, 0x0, 0x3c020002, 
-0x8c42a85c, 0x104000a3, 0x24020002, 0x3c030002, 
-0x2463a860, 0x8c620000, 0x2c424e21, 0x1040009d, 
-0x24020002, 0x3c020002, 0x8c42a88c, 0x1040000e, 
-0x0, 0x3c020002, 0x8c42a85c, 0x3c010002, 
-0xac20a88c, 0x30420080, 0x1040002f, 0x2402000c, 
-0x8f820204, 0x30420080, 0x1440000c, 0x24020003, 
-0x10000029, 0x2402000c, 0x3c020002, 0x8c42a85c, 
-0x30420080, 0x14400005, 0x24020003, 0x8f820204, 
-0x30420080, 0x1040001f, 0x24020003, 0xac620000, 
-0x2402000a, 0x3c010002, 0xac22a850, 0x3c040002, 
-0x2484a898, 0x8c820000, 0x3c030002, 0x8c63a870, 
-0x431025, 0xaf820204, 0x8c830000, 0x3c040002, 
-0x8c84a870, 0x2402000b, 0x3c010002, 0xac22a850, 
-0x641825, 0x3c010002, 0xac23a8a0, 0x3c050002, 
-0x24a5a860, 0x8ca20000, 0x2c424e21, 0x10400069, 
-0x24020002, 0x3c020002, 0x8c42a890, 0x10400006, 
-0x0, 0x2402000c, 0x3c010002, 0xac22a850, 
-0x1000006a, 0x0, 0x3c020002, 0x8c42a880, 
-0x10400066, 0x0, 0x3c040002, 0x8c84a85c, 
-0x10800057, 0x30820008, 0x3c030002, 0x8c63a86c, 
-0x1062005e, 0x24020003, 0x3c010002, 0xac24a888, 
-0xaca20000, 0x24020006, 0x3c010002, 0xac22a850, 
-0x10000056, 0x0, 0x8f820200, 0x34420002, 
-0xaf820200, 0x8f830054, 0x2402000d, 0x3c010002, 
-0xac22a850, 0x3c010002, 0xac23a874, 0x8f830054, 
-0x3c020002, 0x8c42a874, 0x2463d8f0, 0x431023, 
-0x2c422710, 0x14400032, 0x0, 0x3c020002, 
-0x8c42a890, 0x10400021, 0x2402000e, 0x3c030002, 
-0x8c63a8a4, 0x3c010002, 0xac22a850, 0x14600015, 
-0x0, 0xc0043c9, 0x0, 0x3c050002, 
-0x8ca5866c, 0xc0058d7, 0x2021, 0x3c030002, 
-0x8c63866c, 0x24020004, 0x14620005, 0x2403fffb, 
-0x3c020002, 0x8c428668, 0x10000003, 0x2403fff7, 
-0x3c020002, 0x8c428668, 0x431024, 0x3c010002, 
-0xac228668, 0x8f830224, 0x3c020200, 0x3c010002, 
-0xac23a8ac, 0x10000021, 0x282a025, 0x3c020002, 
-0x8c42a880, 0x10400005, 0x0, 0x3c020002, 
-0x8c42a85c, 0x1040000f, 0x24020002, 0x3c020002, 
-0x8c42a860, 0x2c424e21, 0x1040000a, 0x24020002, 
-0x3c020002, 0x8c42a880, 0x10400010, 0x0, 
-0x3c020002, 0x8c42a85c, 0x1440000c, 0x0, 
-0x24020002, 0x3c010002, 0xac22a850, 0x10000007, 
-0x0, 0x3c020002, 0x8c42a880, 0x10400003, 
-0x0, 0xc00430b, 0x0, 0x8f820220, 
-0x3c03f700, 0x431025, 0xaf820220, 0x8fbf0010, 
-0x3e00008, 0x27bd0018, 0x3c030002, 0x2463a8a8, 
-0x8c620000, 0x10400005, 0x34422000, 0x3c010002, 
-0xac22a89c, 0x10000003, 0xac600000, 0x3c010002, 
-0xac24a89c, 0x3e00008, 0x0, 0x27bdffe0, 
-0x30820030, 0xafbf0018, 0x3c010002, 0xac22a8a4, 
-0x1440006b, 0x3c02ffff, 0x34421f0e, 0x821024, 
-0x14400065, 0x24020030, 0x30822000, 0x10400061, 
-0x30838000, 0x31a02, 0x30820001, 0x21200, 
-0x3c040002, 0x8c8487dc, 0x621825, 0x331c2, 
-0x3c030002, 0x2463870c, 0x30828000, 0x21202, 
-0x30840001, 0x42200, 0x441025, 0x239c2, 
-0x61080, 0x431021, 0x471021, 0x90430000, 
-0x24020001, 0x10620027, 0x0, 0x10600007, 
-0x24020002, 0x10620014, 0x24020003, 0x1062002f, 
-0x3c05000f, 0x1000003b, 0x0, 0x8f820200, 
-0x2403feff, 0x431024, 0xaf820200, 0x8f820220, 
-0x3c03fffe, 0x3463ffff, 0x431024, 0xaf820220, 
-0x3c010002, 0xac20a8c4, 0x3c010002, 0xac20a8cc, 
-0x10000037, 0x0, 0x8f820200, 0x34420100, 
-0xaf820200, 0x8f820220, 0x3c03fffe, 0x3463ffff, 
-0x431024, 0xaf820220, 0x24020100, 0x3c010002, 
-0xac22a8c4, 0x3c010002, 0xac20a8cc, 0x10000028, 
-0x0, 0x8f820200, 0x2403feff, 0x431024, 
-0xaf820200, 0x8f820220, 0x3c030001, 0x431025, 
-0xaf820220, 0x3c010002, 0xac20a8c4, 0x3c010002, 
-0xac23a8cc, 0x1000001a, 0x0, 0x8f820200, 
-0x34420100, 0xaf820200, 0x8f820220, 0x3c030001, 
-0x431025, 0xaf820220, 0x24020100, 0x3c010002, 
-0xac22a8c4, 0x3c010002, 0xac23a8cc, 0x1000000c, 
-0x0, 0x34a5ffff, 0x3c040002, 0x24848370, 
-0xafa30010, 0xc002d3b, 0xafa00014, 0x10000004, 
-0x0, 0x24020030, 0x3c010002, 0xac22a8a8, 
-0x8fbf0018, 0x3e00008, 0x27bd0020, 0x27bdffc8, 
-0xafb20028, 0x809021, 0xafb3002c, 0xa09821, 
-0xafb00020, 0xc08021, 0x3c040002, 0x24848398, 
-0x3c050009, 0x3c020002, 0x8c42866c, 0x34a59001, 
-0x2403021, 0x2603821, 0xafbf0030, 0xafb10024, 
-0xa7a0001a, 0xafb00014, 0xc002d3b, 0xafa20010, 
-0x24020002, 0x12620086, 0x2e620003, 0x10400005, 
-0x24020001, 0x1262000a, 0x0, 0x1000017b, 
-0x0, 0x24020004, 0x126200fc, 0x24020008, 
-0x126200fb, 0x3c02ffec, 0x10000174, 0x0, 
-0x3c020002, 0x8c428668, 0x30420002, 0x14400004, 
-0x128940, 0x3c02fffb, 0x3442ffff, 0x2028024, 
-0x3c010002, 0x310821, 0xac30a8bc, 0x3c024000, 
-0x2021024, 0x10400050, 0x1023c2, 0x30840030, 
-0x101382, 0x3042001c, 0x3c030002, 0x246386a4, 
-0x431021, 0x823821, 0x3c020020, 0x2021024, 
-0x10400006, 0x24020100, 0x3c010002, 0x310821, 
-0xac22a8c0, 0x10000005, 0x3c020080, 0x3c010002, 
-0x310821, 0xac20a8c0, 0x3c020080, 0x2021024, 
-0x10400007, 0x121940, 0x3c020001, 0x3c010002, 
-0x230821, 0xac22a8c8, 0x10000005, 0x0, 
-0x121140, 0x3c010002, 0x220821, 0xac20a8c8, 
-0x94e40000, 0x3c030002, 0x8c6387fc, 0x24020005, 
-0x10620010, 0xa7a40018, 0x32024000, 0x10400002, 
-0x34824000, 0xa7a20018, 0x24040001, 0x94e20002, 
-0x24050004, 0x24e60002, 0x34420001, 0xc004bdc, 
-0xa4e20002, 0x24040001, 0x2821, 0xc004bdc, 
-0x27a60018, 0x3c020002, 0x8c42866c, 0x24110001, 
-0x3c010002, 0xac318678, 0x14530004, 0x32028000, 
-0xc00430b, 0x0, 0x32028000, 0x10400123, 
-0x0, 0xc00430b, 0x0, 0x3c030002, 
-0x8c6387fc, 0x24020005, 0x1062011c, 0x24020002, 
-0x3c010002, 0xac318670, 0x3c010002, 0xac22866c, 
-0x10000116, 0x0, 0x24040001, 0x24050004, 
-0x27b0001a, 0xc004bdc, 0x2003021, 0x24040001, 
-0x2821, 0xc004bdc, 0x2003021, 0x3c020002, 
-0x511021, 0x8c42a8b4, 0x3c040002, 0x8c84866c, 
-0x3c03bfff, 0x3463ffff, 0x3c010002, 0xac338678, 
-0x431024, 0x3c010002, 0x310821, 0xac22a8b4, 
-0x109300fc, 0x0, 0x100000fc, 0x0, 
-0x3c022000, 0x2021024, 0x10400005, 0x24020001, 
-0x3c010002, 0xac2287d8, 0x10000004, 0x128940, 
-0x3c010002, 0xac2087d8, 0x128940, 0x3c010002, 
-0x310821, 0xac30a8b8, 0x3c024000, 0x2021024, 
-0x14400015, 0x0, 0x3c020002, 0x8c4287d8, 
-0x10400006, 0x24040004, 0x24050001, 0xc005400, 
-0x24062000, 0x24020001, 0xaee204b8, 0x3c020002, 
-0x511021, 0x8c42a8b0, 0x3c03bfff, 0x3463ffff, 
-0x431024, 0x3c010002, 0x310821, 0xac22a8b0, 
-0x100000d4, 0x0, 0x3c020002, 0x8c4287d8, 
-0x10400028, 0x3c0300a0, 0x2031024, 0x5443000d, 
-0x3c020020, 0x3c020002, 0x8c4287dc, 0x24030100, 
-0x3c010002, 0x310821, 0xac23a8c4, 0x3c030001, 
-0x3c010002, 0x310821, 0xac23a8cc, 0x10000015, 
-0x34420400, 0x2021024, 0x10400008, 0x24030100, 
-0x3c020002, 0x8c4287dc, 0x3c010002, 0x310821, 
-0xac23a8c4, 0x1000000b, 0x34420800, 0x3c020080, 
-0x2021024, 0x1040002e, 0x3c030001, 0x3c020002, 
-0x8c4287dc, 0x3c010002, 0x310821, 0xac23a8cc, 
-0x34420c00, 0x3c010002, 0xac2287dc, 0x10000025, 
-0x24040001, 0x3c020020, 0x2021024, 0x10400006, 
-0x24020100, 0x3c010002, 0x310821, 0xac22a8c4, 
-0x10000005, 0x3c020080, 0x3c010002, 0x310821, 
-0xac20a8c4, 0x3c020080, 0x2021024, 0x10400007, 
-0x121940, 0x3c020001, 0x3c010002, 0x230821, 
-0xac22a8cc, 0x10000006, 0x24040001, 0x121140, 
-0x3c010002, 0x220821, 0xac20a8cc, 0x24040001, 
-0x2821, 0x27b0001e, 0xc004b9a, 0x2003021, 
-0x24040001, 0x2821, 0xc004b9a, 0x2003021, 
-0x24040001, 0x24050001, 0x27b0001c, 0xc004b9a, 
-0x2003021, 0x24040001, 0x24050001, 0xc004b9a, 
-0x2003021, 0x1000007b, 0x0, 0x3c02ffec, 
-0x3442ffff, 0x2028024, 0x3c020008, 0x2028025, 
-0x121140, 0x3c010002, 0x220821, 0xac30a8b8, 
-0x3c022000, 0x2021024, 0x10400009, 0x0, 
-0x3c020002, 0x8c428708, 0x14400005, 0x24020001, 
-0x3c010002, 0xac2287d8, 0x10000004, 0x3c024000, 
-0x3c010002, 0xac2087d8, 0x3c024000, 0x2021024, 
-0x1440001d, 0x24020e01, 0x3c030002, 0x8c6387d8, 
-0xaf820238, 0x3c010002, 0xac208684, 0x10600005, 
-0x24022020, 0x3c010002, 0xac2287dc, 0x24020001, 
-0xaee204b8, 0x3c04bfff, 0x121940, 0x3c020002, 
-0x431021, 0x8c42a8b0, 0x3c050002, 0x8ca5866c, 
-0x3484ffff, 0x441024, 0x3c010002, 0x230821, 
-0xac22a8b0, 0x24020001, 0x10a20048, 0x0, 
-0x10000044, 0x0, 0x3c020002, 0x8c4287d8, 
-0x1040001f, 0x24022000, 0x3c010002, 0xac2287dc, 
-0x3c0300a0, 0x2031024, 0x14430006, 0x121140, 
-0x3402a000, 0x3c010002, 0xac2287dc, 0x10000030, 
-0x0, 0x3c030002, 0x621821, 0x8c63a8b8, 
-0x3c020020, 0x621024, 0x10400005, 0x24022001, 
-0x3c010002, 0xac2287dc, 0x10000025, 0x0, 
-0x3c020080, 0x621024, 0x10400021, 0x3402a001, 
-0x3c010002, 0xac2287dc, 0x1000001d, 0x0, 
-0x3c020020, 0x2021024, 0x10400007, 0x121940, 
-0x24020100, 0x3c010002, 0x230821, 0xac22a8c4, 
-0x10000006, 0x3c020080, 0x121140, 0x3c010002, 
-0x220821, 0xac20a8c4, 0x3c020080, 0x2021024, 
-0x10400007, 0x121940, 0x3c020001, 0x3c010002, 
-0x230821, 0xac22a8cc, 0x10000005, 0x0, 
-0x121140, 0x3c010002, 0x220821, 0xac20a8cc, 
-0x3c030002, 0x8c63866c, 0x24020001, 0x10620003, 
-0x0, 0xc00430b, 0x0, 0x8fbf0030, 
-0x8fb3002c, 0x8fb20028, 0x8fb10024, 0x8fb00020, 
-0x3e00008, 0x27bd0038, 0x27bdffb0, 0xafb3003c, 
-0x9821, 0xafb50040, 0xa821, 0xafb10034, 
-0x8821, 0x24020002, 0xafbf0048, 0xafbe0044, 
-0xafb20038, 0xafb00030, 0xafa4002c, 0xa7a0001a, 
-0xa7a00018, 0xa7a00020, 0xa7a0001e, 0xa7a00022, 
-0x10a20131, 0xa7a0001c, 0x2ca20003, 0x10400005, 
-0x24020001, 0x10a2000a, 0x3c024000, 0x1000025f, 
-0x2201021, 0x24020004, 0x10a2020c, 0x24020008, 
-0x10a2020a, 0x2201021, 0x10000258, 0x0, 
-0x8fa8002c, 0x88140, 0x3c030002, 0x701821, 
-0x8c63a8bc, 0x621024, 0x14400009, 0x24040001, 
-0x3c027fff, 0x3442ffff, 0x628824, 0x3c010002, 
-0x300821, 0xac31a8b4, 0x10000248, 0x2201021, 
-0x24050001, 0xc004b9a, 0x27a60018, 0x24040001, 
-0x24050001, 0xc004b9a, 0x27a60018, 0x97a20018, 
-0x30420004, 0x104000da, 0x3c114000, 0x3c020002, 
-0x8c4287fc, 0x2443ffff, 0x2c620006, 0x104000da, 
-0x31080, 0x3c010002, 0x220821, 0x8c2283b0, 
-0x400008, 0x0, 0x24040001, 0x24050011, 
-0x27b0001a, 0xc004b9a, 0x2003021, 0x24040001, 
-0x24050011, 0xc004b9a, 0x2003021, 0x97a3001a, 
-0x30624000, 0x10400002, 0x3c150010, 0x3c150008, 
-0x30628000, 0x104000ab, 0x3c130001, 0x100000a9, 
-0x3c130002, 0x24040001, 0x24050014, 0x27b0001a, 
-0xc004b9a, 0x2003021, 0x24040001, 0x24050014, 
-0xc004b9a, 0x2003021, 0x97a3001a, 0x30621000, 
-0x10400002, 0x3c150010, 0x3c150008, 0x30620800, 
-0x10400098, 0x3c130001, 0x10000096, 0x3c130002, 
-0x24040001, 0x24050019, 0x27b0001c, 0xc004b9a, 
-0x2003021, 0x24040001, 0x24050019, 0xc004b9a, 
-0x2003021, 0x97a2001c, 0x30430700, 0x24020400, 
-0x10620027, 0x28620401, 0x1040000e, 0x24020200, 
-0x1062001f, 0x28620201, 0x10400005, 0x24020100, 
-0x5062001e, 0x3c130001, 0x1000001e, 0x24040001, 
-0x24020300, 0x50620019, 0x3c130002, 0x10000019, 
-0x24040001, 0x24020600, 0x1062000d, 0x28620601, 
-0x10400005, 0x24020500, 0x5062000b, 0x3c130002, 
-0x10000010, 0x24040001, 0x24020700, 0x1462000d, 
-0x24040001, 0x3c130004, 0x1000000a, 0x3c150008, 
-0x10000006, 0x3c130004, 0x10000005, 0x3c150008, 
-0x3c130001, 0x10000002, 0x3c150008, 0x3c150010, 
-0x24040001, 0x24050018, 0x27b0001e, 0xc004b9a, 
-0x2003021, 0x24040001, 0x24050018, 0xc004b9a, 
-0x2003021, 0x8fa8002c, 0x97a7001e, 0x81140, 
-0x3c060002, 0xc23021, 0x8cc6a8b4, 0x97a20022, 
-0x3c100002, 0x261083a4, 0x2002021, 0xafa20010, 
-0x97a2001c, 0x3c05000c, 0x34a50303, 0xc002d3b, 
-0xafa20014, 0x3c020004, 0x16620010, 0x3c020001, 
-0x8f840054, 0x24030001, 0x24020002, 0x3c010002, 
-0xac238670, 0x3c010002, 0xac22866c, 0x3c010002, 
-0xac238678, 0x3c010002, 0xac2386f0, 0x3c010002, 
-0xac2487ec, 0x10000050, 0x2b38825, 0x1662003a, 
-0x3c028000, 0x3c020002, 0x8c4286ec, 0x1440001f, 
-0x24040018, 0x2021, 0x2821, 0xc005400, 
-0x34068000, 0x8f830054, 0x8f820054, 0x2b38825, 
-0x10000002, 0x24630032, 0x8f820054, 0x621023, 
-0x2c420033, 0x1440fffc, 0x0, 0x8f830054, 
-0x24020001, 0x3c010002, 0xac2286ec, 0x3c010002, 
-0xac228670, 0x3c010002, 0xac22866c, 0x3c010002, 
-0xac228678, 0x3c010002, 0xac2286f0, 0x3c010002, 
-0xac2387ec, 0x1000002c, 0x0, 0x2821, 
-0xc005400, 0x24060404, 0x2021, 0x2405001e, 
-0x27a60018, 0x24020002, 0xc004bdc, 0xa7a20018, 
-0x2021, 0x2821, 0x27a60018, 0xc004bdc, 
-0xa7a00018, 0x24040018, 0x24050002, 0xc005400, 
-0x24060004, 0x3c028000, 0x2221025, 0x2b31825, 
-0x10000015, 0x438825, 0x2221025, 0x2751825, 
-0x438825, 0x2002021, 0x97a6001c, 0x3c070002, 
-0x8ce7866c, 0x3c05000c, 0x34a50326, 0xafb30010, 
-0xc002d3b, 0xafb10014, 0x10000007, 0x0, 
-0x3c110002, 0x2308821, 0x8e31a8bc, 0x3c027fff, 
-0x3442ffff, 0x2228824, 0x3c020002, 0x8c42867c, 
-0x1040001e, 0x0, 0x3c020002, 0x8c4287d8, 
-0x10400002, 0x3c022000, 0x2228825, 0x8fa8002c, 
-0x81140, 0x3c010002, 0x220821, 0x8c22a8c0, 
-0x10400003, 0x3c020020, 0x10000005, 0x2228825, 
-0x3c02ffdf, 0x3442ffff, 0x2228824, 0x8fa8002c, 
-0x81140, 0x3c010002, 0x220821, 0x8c22a8c8, 
-0x10400003, 0x3c020080, 0x10000004, 0x2228825, 
-0x3c02ff7f, 0x3442ffff, 0x2228824, 0x8fa8002c, 
-0x81140, 0x3c010002, 0x220821, 0xac31a8b4, 
-0x10000136, 0x2201021, 0x8fa8002c, 0x8f140, 
-0x3c030002, 0x7e1821, 0x8c63a8b8, 0x3c024000, 
-0x621024, 0x14400009, 0x24040001, 0x3c027fff, 
-0x3442ffff, 0x628824, 0x3c010002, 0x3e0821, 
-0xac31a8b0, 0x10000125, 0x2201021, 0x2821, 
-0xc004b9a, 0x27a60018, 0x24040001, 0x2821, 
-0xc004b9a, 0x27a60018, 0x24040001, 0x24050001, 
-0x27b20020, 0xc004b9a, 0x2403021, 0x24040001, 
-0x24050001, 0xc004b9a, 0x2403021, 0x24040001, 
-0x24050004, 0x27b1001e, 0xc004b9a, 0x2203021, 
-0x24040001, 0x24050004, 0xc004b9a, 0x2203021, 
-0x24040001, 0x24050005, 0x27b00022, 0xc004b9a, 
-0x2003021, 0x24040001, 0x24050005, 0xc004b9a, 
-0x2003021, 0x24040001, 0x24050010, 0xc004b9a, 
-0x27a60018, 0x24040001, 0x24050010, 0xc004b9a, 
-0x27a60018, 0x24040001, 0x2405000a, 0xc004b9a, 
-0x2403021, 0x24040001, 0x2405000a, 0xc004b9a, 
-0x2403021, 0x24040001, 0x24050018, 0xc004b9a, 
-0x2203021, 0x24040001, 0x24050018, 0xc004b9a, 
-0x2203021, 0x24040001, 0x24050001, 0xc004b9a, 
-0x27a60018, 0x24040001, 0x24050001, 0xc004b9a, 
-0x27a60018, 0x97a20018, 0x30420004, 0x10400067, 
-0x3c114000, 0x3c030002, 0x8c6387f0, 0x24020005, 
-0x14620068, 0x24040001, 0x24050019, 0x27b0001c, 
-0xc004b9a, 0x2003021, 0x24040001, 0x24050019, 
-0xc004b9a, 0x2003021, 0x97a2001c, 0x30430700, 
-0x24020400, 0x10620027, 0x28620401, 0x1040000e, 
-0x24020200, 0x1062001f, 0x28620201, 0x10400005, 
-0x24020100, 0x5062001e, 0x3c130001, 0x1000001e, 
-0x3c020004, 0x24020300, 0x50620019, 0x3c130002, 
-0x10000019, 0x3c020004, 0x24020600, 0x1062000d, 
-0x28620601, 0x10400005, 0x24020500, 0x5062000b, 
-0x3c130002, 0x10000010, 0x3c020004, 0x24020700, 
-0x1462000d, 0x3c020004, 0x3c130004, 0x1000000a, 
-0x3c150008, 0x10000006, 0x3c130004, 0x10000005, 
-0x3c150008, 0x3c130001, 0x10000002, 0x3c150008, 
-0x3c150010, 0x3c020004, 0x12620018, 0x3c028000, 
-0x8f820054, 0x24100001, 0x3c010002, 0xac308670, 
-0x3c010002, 0xac30866c, 0x3c010002, 0xac308678, 
-0x3c010002, 0xac3086f0, 0x3c010002, 0xac2287ec, 
-0x3c020001, 0x16620023, 0x2758825, 0x2021, 
-0x2821, 0xc005400, 0x34068000, 0x3c010002, 
-0xac3086ec, 0x1000001b, 0x0, 0x2221025, 
-0x2b31825, 0x438825, 0x97a6001c, 0x3c020002, 
-0x8c4287d8, 0x3c070002, 0x8ce7866c, 0x3c040002, 
-0x248483a4, 0xafa20010, 0x97a2001e, 0x3c05000c, 
-0x34a50323, 0x3c010002, 0xac2086ec, 0xc002d3b, 
-0xafa20014, 0x10000007, 0x0, 0x3c110002, 
-0x23e8821, 0x8e31a8b0, 0x3c027fff, 0x3442ffff, 
-0x2228824, 0x3c020002, 0x8c42867c, 0x10400069, 
-0x0, 0x3c020002, 0x8c4287d8, 0x10400002, 
-0x3c022000, 0x2228825, 0x8fa8002c, 0x81140, 
-0x3c010002, 0x220821, 0x8c22a8c4, 0x10400003, 
-0x3c020020, 0x10000005, 0x2228825, 0x3c02ffdf, 
-0x3442ffff, 0x2228824, 0x8fa8002c, 0x81140, 
-0x3c010002, 0x220821, 0x8c22a8cc, 0x10400003, 
-0x3c020080, 0x1000004f, 0x2228825, 0x3c02ff7f, 
-0x3442ffff, 0x1000004b, 0x2228824, 0x8fa8002c, 
-0x82940, 0x3c030002, 0x651821, 0x8c63a8b8, 
-0x3c024000, 0x621024, 0x14400008, 0x3c027fff, 
-0x3442ffff, 0x628824, 0x3c010002, 0x250821, 
-0xac31a8b0, 0x10000041, 0x2201021, 0x3c020002, 
-0x8c42867c, 0x10400034, 0x3c11c00c, 0x3c020002, 
-0x8c428708, 0x3c04c00c, 0x34842000, 0x3c030002, 
-0x8c6387d8, 0x2102b, 0x21023, 0x441024, 
-0x10600003, 0x518825, 0x3c022000, 0x2228825, 
-0x3c020002, 0x451021, 0x8c42a8c4, 0x10400003, 
-0x3c020020, 0x10000004, 0x2228825, 0x3c02ffdf, 
-0x3442ffff, 0x2228824, 0x8fa8002c, 0x81140, 
-0x3c010002, 0x220821, 0x8c22a8cc, 0x10400003, 
-0x3c020080, 0x10000004, 0x2228825, 0x3c02ff7f, 
-0x3442ffff, 0x2228824, 0x3c020002, 0x8c4286f4, 
-0x10400002, 0x3c020800, 0x2228825, 0x3c020002, 
-0x8c4286f8, 0x10400002, 0x3c020400, 0x2228825, 
-0x3c020002, 0x8c4286fc, 0x10400006, 0x3c020100, 
-0x10000004, 0x2228825, 0x3c027fff, 0x3442ffff, 
-0x628824, 0x8fa8002c, 0x81140, 0x3c010002, 
-0x220821, 0xac31a8b0, 0x2201021, 0x8fbf0048, 
-0x8fbe0044, 0x8fb50040, 0x8fb3003c, 0x8fb20038, 
-0x8fb10034, 0x8fb00030, 0x3e00008, 0x27bd0050, 
-0x27bdffd0, 0xafb20028, 0x809021, 0xafbf002c, 
-0xafb10024, 0xafb00020, 0x8f840200, 0x3c100002, 
-0x8e10866c, 0x8f860220, 0x24020002, 0x1202005e, 
-0x2e020003, 0x10400005, 0x24020001, 0x1202000a, 
-0x121940, 0x10000114, 0x0, 0x24020004, 
-0x120200c6, 0x24020008, 0x120200c5, 0x128940, 
-0x1000010d, 0x0, 0x3c050002, 0xa32821, 
-0x8ca5a8bc, 0x3c100002, 0x2038021, 0x8e10a8b4, 
-0x3c024000, 0xa21024, 0x10400038, 0x3c020008, 
-0x2021024, 0x10400020, 0x34840002, 0x3c020002, 
-0x431021, 0x8c42a8c0, 0x10400005, 0x34840020, 
-0x34840100, 0x3c020020, 0x10000006, 0x2028025, 
-0x2402feff, 0x822024, 0x3c02ffdf, 0x3442ffff, 
-0x2028024, 0x121140, 0x3c010002, 0x220821, 
-0x8c22a8c8, 0x10400005, 0x3c020001, 0xc23025, 
-0x3c020080, 0x10000016, 0x2028025, 0x3c02fffe, 
-0x3442ffff, 0xc23024, 0x3c02ff7f, 0x3442ffff, 
-0x1000000f, 0x2028024, 0x2402fedf, 0x822024, 
-0x3c02fffe, 0x3442ffff, 0xc23024, 0x3c02ff5f, 
-0x3442ffff, 0x2028024, 0x3c010002, 0x230821, 
-0xac20a8c0, 0x3c010002, 0x230821, 0xac20a8c8, 
-0xaf840200, 0xaf860220, 0x8f820220, 0x34420002, 
-0xaf820220, 0x1000000b, 0x121140, 0x3c02bfff, 
-0x3442ffff, 0x8f830200, 0x2028024, 0x2402fffd, 
-0x621824, 0xaf830200, 0xc00430b, 0x0, 
-0x121140, 0x3c010002, 0x220821, 0xac30a8b4, 
-0x100000bd, 0x0, 0x3c020002, 0x8c4287d8, 
-0x1040006e, 0x24050004, 0x24040001, 0xc004b9a, 
-0x27a60018, 0x24040001, 0x24050005, 0xc004b9a, 
-0x27a6001a, 0x97a30018, 0x97a2001a, 0x3c040002, 
-0x2484870c, 0x30630c00, 0x31a82, 0x30420c00, 
-0x21282, 0xa7a2001a, 0x21080, 0x441021, 
-0x431021, 0xa7a30018, 0x90480000, 0x24020001, 
-0x3103ffff, 0x1062002b, 0x28620002, 0x10400005, 
-0x0, 0x10600009, 0x0, 0x10000041, 
-0x0, 0x10700014, 0x24020003, 0x1062002f, 
-0x0, 0x1000003b, 0x0, 0x8f820200, 
-0x2403feff, 0x431024, 0xaf820200, 0x8f820220, 
-0x3c03fffe, 0x3463ffff, 0x431024, 0xaf820220, 
-0x3c010002, 0xac20a8c4, 0x3c010002, 0xac20a8cc, 
-0x10000035, 0x0, 0x8f820200, 0x34420100, 
-0xaf820200, 0x8f820220, 0x3c03fffe, 0x3463ffff, 
-0x431024, 0xaf820220, 0x24020100, 0x3c010002, 
-0xac22a8c4, 0x3c010002, 0xac20a8cc, 0x10000026, 
-0x0, 0x8f820200, 0x2403feff, 0x431024, 
-0xaf820200, 0x8f820220, 0x3c030001, 0x431025, 
-0xaf820220, 0x3c010002, 0xac20a8c4, 0x3c010002, 
-0xac23a8cc, 0x10000018, 0x0, 0x8f820200, 
-0x34420100, 0xaf820200, 0x8f820220, 0x3c030001, 
-0x431025, 0xaf820220, 0x24020100, 0x3c010002, 
-0xac22a8c4, 0x3c010002, 0xac23a8cc, 0x1000000a, 
-0x0, 0x3c040002, 0x248483c8, 0x97a6001a, 
-0x97a70018, 0x3c050001, 0x34a5ffff, 0xafa80010, 
-0xc002d3b, 0xafa00014, 0x8f820200, 0x34420002, 
-0xaf820200, 0x1000004c, 0x0, 0x128940, 
-0x3c050002, 0xb12821, 0x8ca5a8b8, 0x3c100002, 
-0x2118021, 0x8e10a8b0, 0x3c024000, 0xa21024, 
-0x14400011, 0x0, 0x3c020002, 0x8c4287d8, 
-0x14400005, 0x3c02bfff, 0x8f820200, 0x34420002, 
-0xaf820200, 0x3c02bfff, 0x3442ffff, 0xc00430b, 
-0x2028024, 0x3c010002, 0x310821, 0xac30a8b0, 
-0x10000031, 0x0, 0x3c020002, 0x8c4287d8, 
-0x10400005, 0x3c020020, 0x3c020002, 0x8c428708, 
-0x10400025, 0x3c020020, 0xa21024, 0x10400007, 
-0x34840020, 0x24020100, 0x3c010002, 0x310821, 
-0xac22a8c4, 0x10000006, 0x34840100, 0x3c010002, 
-0x310821, 0xac20a8c4, 0x2402feff, 0x822024, 
-0x3c020080, 0xa21024, 0x10400007, 0x121940, 
-0x3c020001, 0x3c010002, 0x230821, 0xac22a8cc, 
-0x10000008, 0xc23025, 0x121140, 0x3c010002, 
-0x220821, 0xac20a8cc, 0x3c02fffe, 0x3442ffff, 
-0xc23024, 0xaf840200, 0xaf860220, 0x8f820220, 
-0x34420002, 0xaf820220, 0x121140, 0x3c010002, 
-0x220821, 0xac30a8b0, 0x8fbf002c, 0x8fb20028, 
-0x8fb10024, 0x8fb00020, 0x3e00008, 0x27bd0030, 
-0x1821, 0x308400ff, 0x2405ffdf, 0x2406ffbf, 
-0x641007, 0x30420001, 0x10400004, 0x0, 
-0x8f820044, 0x10000003, 0x34420040, 0x8f820044, 
-0x461024, 0xaf820044, 0x8f820044, 0x34420020, 
-0xaf820044, 0x8f820044, 0x451024, 0xaf820044, 
-0x24630001, 0x28620008, 0x5440ffee, 0x641007, 
-0x3e00008, 0x0, 0x2c820008, 0x1040001b, 
-0x0, 0x2405ffdf, 0x2406ffbf, 0x41880, 
-0x3c020002, 0x2442871c, 0x621821, 0x24640004, 
-0x90620000, 0x10400004, 0x0, 0x8f820044, 
-0x10000003, 0x34420040, 0x8f820044, 0x461024, 
-0xaf820044, 0x8f820044, 0x34420020, 0xaf820044, 
-0x8f820044, 0x451024, 0xaf820044, 0x24630001, 
-0x64102b, 0x1440ffee, 0x0, 0x3e00008, 
-0x0, 0x0 };
-static u_int32_t tigon2FwRodata[] = {
-0x24486561, 
-0x6465723a, 0x202f7072, 0x6f6a6563, 0x74732f72, 
-0x63732f73, 0x772f6765, 0x2f2e2f6e, 0x69632f66, 
-0x77322f63, 0x6f6d6d6f, 0x6e2f6677, 0x6d61696e, 
-0x2e632c76, 0x20312e31, 0x2e322e34, 0x35203139, 
-0x39392f30, 0x312f3234, 0x2030303a, 0x31303a35, 
-0x35207368, 0x75616e67, 0x20457870, 0x20240000, 
-0x65767452, 0x6e674600, 0x51657674, 0x46000000, 
-0x51657674, 0x505f4600, 0x4d657674, 0x526e6746, 
-0x0, 0x4d516576, 0x74460000, 0x4d516576, 
-0x505f4600, 0x5173436f, 0x6e495f46, 0x0, 
-0x5173436f, 0x6e734600, 0x51725072, 0x6f644600, 
-0x6261644d, 0x656d537a, 0x0, 0x2a50414e, 
-0x49432a00, 0x66776d61, 0x696e2e63, 0x0, 
-0x68775665, 0x72000000, 0x62616448, 0x77566572, 
-0x0, 0x2a2a4441, 0x574e5f41, 0x0, 
-0x74785278, 0x4266537a, 0x0, 0x62664174, 
-0x6e4d726b, 0x0, 0x7265645a, 0x6f6e6531, 
-0x0, 0x70636943, 0x6f6e6600, 0x67656e43, 
-0x6f6e6600, 0x2a646d61, 0x5244666c, 0x0, 
-0x72636246, 0x6c616773, 0x0, 0x62616452, 
-0x78526362, 0x0, 0x676c6f62, 0x466c6773, 
-0x0, 0x2b5f6469, 0x73705f6c, 0x6f6f7000, 
-0x2b65765f, 0x68616e64, 0x6c657200, 0x63616e74, 
-0x31446d61, 0x0, 0x2b715f64, 0x6d615f74, 
-0x6f5f6e69, 0x635f636b, 0x73756d00, 0x2b685f73, 
-0x656e645f, 0x64617461, 0x5f726561, 0x64795f63, 
-0x6b73756d, 0x0, 0x2b685f64, 0x6d615f72, 
-0x645f6173, 0x73697374, 0x5f636b73, 0x756d0000, 
-0x74436b73, 0x6d4f6e00, 0x2b715f64, 0x6d615f74, 
-0x6f5f6e69, 0x63000000, 0x2b685f73, 0x656e645f, 
-0x64617461, 0x5f726561, 0x64790000, 0x2b685f64, 
-0x6d615f72, 0x645f6173, 0x73697374, 0x0, 
-0x74436b73, 0x6d4f6666, 0x0, 0x2b685f73, 
-0x656e645f, 0x62645f72, 0x65616479, 0x0, 
-0x68737453, 0x52696e67, 0x0, 0x62616453, 
-0x52696e67, 0x0, 0x6e696353, 0x52696e67, 
-0x0, 0x77446d61, 0x416c6c41, 0x0, 
-0x2b715f64, 0x6d615f74, 0x6f5f686f, 0x73745f63, 
-0x6b73756d, 0x0, 0x2b685f6d, 0x61635f72, 
-0x785f636f, 0x6d705f63, 0x6b73756d, 0x0, 
-0x2b685f64, 0x6d615f77, 0x725f6173, 0x73697374, 
-0x5f636b73, 0x756d0000, 0x72436b73, 0x6d4f6e00, 
-0x2b715f64, 0x6d615f74, 0x6f5f686f, 0x73740000, 
-0x2b685f6d, 0x61635f72, 0x785f636f, 0x6d700000, 
-0x2b685f64, 0x6d615f77, 0x725f6173, 0x73697374, 
-0x0, 0x72436b73, 0x6d4f6666, 0x0, 
-0x2b685f72, 0x6563765f, 0x62645f72, 0x65616479, 
-0x0, 0x2b685f72, 0x6563765f, 0x6a756d62, 
-0x6f5f6264, 0x5f726561, 0x64790000, 0x2b685f72, 
-0x6563765f, 0x6d696e69, 0x5f62645f, 0x72656164, 
-0x79000000, 0x2b6d685f, 0x636f6d6d, 0x616e6400, 
-0x2b685f74, 0x696d6572, 0x0, 0x2b685f64, 
-0x6f5f7570, 0x64617465, 0x5f74785f, 0x636f6e73, 
-0x0, 0x2b685f64, 0x6f5f7570, 0x64617465, 
-0x5f72785f, 0x70726f64, 0x0, 0x2b636b73, 
-0x756d3136, 0x0, 0x2b706565, 0x6b5f6d61, 
-0x635f7278, 0x5f776100, 0x2b706565, 0x6b5f6d61, 
-0x635f7278, 0x0, 0x2b646571, 0x5f6d6163, 
-0x5f727800, 0x2b685f6d, 0x61635f72, 0x785f6174, 
-0x746e0000, 0x62616452, 0x6574537a, 0x0, 
-0x72784264, 0x4266537a, 0x0, 0x2b6e756c, 
-0x6c5f6861, 0x6e646c65, 0x72000000, 0x66774f70, 
-0x4661696c, 0x0, 0x2b685f75, 0x70646174, 
-0x655f6c65, 0x64340000, 0x2b685f75, 0x70646174, 
-0x655f6c65, 0x64360000, 0x2b685f75, 0x70646174, 
-0x655f6c65, 0x64320000, 0x696e7453, 0x74617465, 
-0x0, 0x2a2a696e, 0x69744370, 0x0, 
-0x23736372, 0x65616d00, 0x69537461, 0x636b4572, 
-0x0, 0x70726f62, 0x654d656d, 0x0, 
-0x2a2a4441, 0x574e5f42, 0x0, 0x2b73775f, 
-0x646d615f, 0x61737369, 0x73745f70, 0x6c75735f, 
-0x74696d65, 0x72000000, 0x2b267072, 0x656c6f61, 
-0x645f7772, 0x5f646573, 0x63720000, 0x2b267072, 
-0x656c6f61, 0x645f7264, 0x5f646573, 0x63720000, 
-0x2b685f68, 0x665f7469, 0x6d657200, 0x24486561, 
-0x6465723a, 0x202f7072, 0x6f6a6563, 0x74732f72, 
-0x63732f73, 0x772f6765, 0x2f2e2f6e, 0x69632f66, 
-0x77322f63, 0x6f6d6d6f, 0x6e2f7469, 0x6d65722e, 
-0x632c7620, 0x312e312e, 0x322e3335, 0x20313939, 
-0x392f3031, 0x2f323720, 0x31393a30, 0x393a3530, 
-0x20686179, 0x65732045, 0x78702024, 0x0, 
-0x65767452, 0x6e674600, 0x51657674, 0x46000000, 
-0x51657674, 0x505f4600, 0x4d657674, 0x526e6746, 
-0x0, 0x4d516576, 0x74460000, 0x4d516576, 
-0x505f4600, 0x5173436f, 0x6e495f46, 0x0, 
-0x5173436f, 0x6e734600, 0x51725072, 0x6f644600, 
-0x2a50414e, 0x49432a00, 0x6d61632e, 0x68000000, 
-0x74696d65, 0x722e6300, 0x542d446d, 0x61526432, 
-0x0, 0x542d446d, 0x61526431, 0x0, 
-0x542d446d, 0x61526442, 0x0, 0x542d446d, 
-0x61577232, 0x0, 0x542d446d, 0x61577231, 
-0x0, 0x542d446d, 0x61577242, 0x0, 
-0x0, 0x24486561, 0x6465723a, 0x202f7072, 
-0x6f6a6563, 0x74732f72, 0x63732f73, 0x772f6765, 
-0x2f2e2f6e, 0x69632f66, 0x77322f63, 0x6f6d6d6f, 
-0x6e2f636f, 0x6d6d616e, 0x642e632c, 0x7620312e, 
-0x312e322e, 0x32382031, 0x3939392f, 0x30312f32, 
-0x30203139, 0x3a34393a, 0x34392073, 0x6875616e, 
-0x67204578, 0x70202400, 0x65767452, 0x6e674600, 
-0x51657674, 0x46000000, 0x51657674, 0x505f4600, 
-0x4d657674, 0x526e6746, 0x0, 0x4d516576, 
-0x74460000, 0x4d516576, 0x505f4600, 0x5173436f, 
-0x6e495f46, 0x0, 0x5173436f, 0x6e734600, 
-0x51725072, 0x6f644600, 0x3f48636d, 0x644d6278, 
-0x0, 0x3f636d64, 0x48737453, 0x0, 
-0x3f636d64, 0x4d634d64, 0x0, 0x3f636d64, 
-0x50726f6d, 0x0, 0x3f636d64, 0x4c696e6b, 
-0x0, 0x3f636d64, 0x45727200, 0x8b08, 
-0x92e4, 0x92e4, 0x9264, 0x8ff4, 
-0x92b8, 0x92e4, 0x8bf4, 0x8c64, 
-0x8df8, 0x8ee0, 0x8ea8, 0x92e4, 
-0x8cd4, 0x8fa0, 0x92e4, 0x8fb0, 
-0x8c18, 0x8c88, 0x24486561, 0x6465723a, 
-0x202f7072, 0x6f6a6563, 0x74732f72, 0x63732f73, 
-0x772f6765, 0x2f2e2f6e, 0x69632f66, 0x77322f63, 
-0x6f6d6d6f, 0x6e2f6d63, 0x6173742e, 0x632c7620, 
-0x312e312e, 0x322e3820, 0x31393938, 0x2f31322f, 
-0x30382030, 0x323a3336, 0x3a333620, 0x73687561, 
-0x6e672045, 0x78702024, 0x0, 0x65767452, 
-0x6e674600, 0x51657674, 0x46000000, 0x51657674, 
-0x505f4600, 0x4d657674, 0x526e6746, 0x0, 
-0x4d516576, 0x74460000, 0x4d516576, 0x505f4600, 
-0x5173436f, 0x6e495f46, 0x0, 0x5173436f, 
-0x6e734600, 0x51725072, 0x6f644600, 0x6164644d, 
-0x63447570, 0x0, 0x6164644d, 0x6346756c, 
-0x0, 0x64656c4d, 0x634e6f45, 0x0, 
-0x24486561, 0x6465723a, 0x202f7072, 0x6f6a6563, 
-0x74732f72, 0x63732f73, 0x772f6765, 0x2f2e2f6e, 
-0x69632f66, 0x77322f63, 0x6f6d6d6f, 0x6e2f646d, 
-0x612e632c, 0x7620312e, 0x312e322e, 0x32342031, 
-0x3939382f, 0x31322f32, 0x31203030, 0x3a33333a, 
-0x30392073, 0x6875616e, 0x67204578, 0x70202400, 
-0x65767452, 0x6e674600, 0x51657674, 0x46000000, 
-0x51657674, 0x505f4600, 0x4d657674, 0x526e6746, 
-0x0, 0x4d516576, 0x74460000, 0x4d516576, 
-0x505f4600, 0x5173436f, 0x6e495f46, 0x0, 
-0x5173436f, 0x6e734600, 0x51725072, 0x6f644600, 
-0x7377446d, 0x614f6666, 0x0, 0x31446d61, 
-0x4f6e0000, 0x7377446d, 0x614f6e00, 0x2a50414e, 
-0x49432a00, 0x646d612e, 0x63000000, 0x2372446d, 
-0x6141544e, 0x0, 0x72446d61, 0x41544e30, 
-0x0, 0x72446d61, 0x41544e31, 0x0, 
-0x72446d61, 0x34476200, 0x2377446d, 0x6141544e, 
-0x0, 0x77446d61, 0x41544e30, 0x0, 
-0x77446d61, 0x41544e31, 0x0, 0x77446d61, 
-0x34476200, 0x24486561, 0x6465723a, 0x202f7072, 
-0x6f6a6563, 0x74732f72, 0x63732f73, 0x772f6765, 
-0x2f2e2f6e, 0x69632f66, 0x77322f63, 0x6f6d6d6f, 
-0x6e2f7472, 0x6163652e, 0x632c7620, 0x312e312e, 
-0x322e3520, 0x31393938, 0x2f30392f, 0x33302031, 
-0x383a3530, 0x3a323820, 0x73687561, 0x6e672045, 
-0x78702024, 0x0, 0x24486561, 0x6465723a, 
-0x202f7072, 0x6f6a6563, 0x74732f72, 0x63732f73, 
-0x772f6765, 0x2f2e2f6e, 0x69632f66, 0x77322f63, 
-0x6f6d6d6f, 0x6e2f6461, 0x74612e63, 0x2c762031, 
-0x2e312e32, 0x2e313220, 0x31393939, 0x2f30312f, 
-0x32302031, 0x393a3439, 0x3a353120, 0x73687561, 
-0x6e672045, 0x78702024, 0x0, 0x46575f56, 
-0x45525349, 0x4f4e3a20, 0x58585800, 0x46575f43, 
-0x4f4d5049, 0x4c455f54, 0x494d453a, 0x20585858, 
-0x0, 0x46575f43, 0x4f4d5049, 0x4c455f42, 
-0x593a2058, 0x58580000, 0x46575f43, 0x4f4d5049, 
-0x4c455f48, 0x4f53543a, 0x20585858, 0x0, 
-0x46575f43, 0x4f4d5049, 0x4c455f44, 0x4f4d4149, 
-0x4e3a2058, 0x58580000, 0x46575f43, 0x4f4d5049, 
-0x4c45523a, 0x20585858, 0x0, 0x0, 
-0x12041100, 0x24486561, 0x6465723a, 0x202f7072, 
-0x6f6a6563, 0x74732f72, 0x63732f73, 0x772f6765, 
-0x2f2e2f6e, 0x69632f66, 0x77322f63, 0x6f6d6d6f, 
-0x6e2f6d65, 0x6d2e632c, 0x7620312e, 0x312e322e, 
-0x35203139, 0x39382f30, 0x392f3330, 0x2031383a, 
-0x35303a30, 0x38207368, 0x75616e67, 0x20457870, 
-0x20240000, 0x24486561, 0x6465723a, 0x202f7072, 
-0x6f6a6563, 0x74732f72, 0x63732f73, 0x772f6765, 
-0x2f2e2f6e, 0x69632f66, 0x77322f63, 0x6f6d6d6f, 
-0x6e2f7365, 0x6e642e63, 0x2c762031, 0x2e312e32, 
-0x2e343420, 0x31393938, 0x2f31322f, 0x32312030, 
-0x303a3333, 0x3a313820, 0x73687561, 0x6e672045, 
-0x78702024, 0x0, 0x65767452, 0x6e674600, 
-0x51657674, 0x46000000, 0x51657674, 0x505f4600, 
-0x4d657674, 0x526e6746, 0x0, 0x4d516576, 
-0x74460000, 0x4d516576, 0x505f4600, 0x5173436f, 
-0x6e495f46, 0x0, 0x5173436f, 0x6e734600, 
-0x51725072, 0x6f644600, 0x2a50414e, 0x49432a00, 
-0x6d61632e, 0x68000000, 0x73656e64, 0x2e630000, 
-0x69736e74, 0x54637055, 0x0, 0x24486561, 
-0x6465723a, 0x202f7072, 0x6f6a6563, 0x74732f72, 
-0x63732f73, 0x772f6765, 0x2f2e2f6e, 0x69632f66, 
-0x77322f63, 0x6f6d6d6f, 0x6e2f7265, 0x63762e63, 
-0x2c762031, 0x2e312e32, 0x2e353320, 0x31393939, 
-0x2f30312f, 0x31362030, 0x323a3535, 0x3a343320, 
-0x73687561, 0x6e672045, 0x78702024, 0x0, 
-0x65767452, 0x6e674600, 0x51657674, 0x46000000, 
-0x51657674, 0x505f4600, 0x4d657674, 0x526e6746, 
-0x0, 0x4d516576, 0x74460000, 0x4d516576, 
-0x505f4600, 0x5173436f, 0x6e495f46, 0x0, 
-0x5173436f, 0x6e734600, 0x51725072, 0x6f644600, 
-0x2a50414e, 0x49432a00, 0x6d61632e, 0x68000000, 
-0x724d6163, 0x43686b30, 0x0, 0x72784672, 
-0x6d324c67, 0x0, 0x72784e6f, 0x53744264, 
-0x0, 0x72784e6f, 0x4d694264, 0x0, 
-0x72784e6f, 0x4a6d4264, 0x0, 0x72656376, 
-0x2e630000, 0x7278436b, 0x446d6146, 0x0, 
-0x72785144, 0x6d457846, 0x0, 0x72785144, 
-0x6d614600, 0x72785144, 0x4c426446, 0x0, 
-0x72785144, 0x6d426446, 0x0, 0x72784372, 
-0x63506164, 0x0, 0x72536d51, 0x446d6146, 
-0x0, 0x24486561, 0x6465723a, 0x202f7072, 
-0x6f6a6563, 0x74732f72, 0x63732f73, 0x772f6765, 
-0x2f2e2f6e, 0x69632f66, 0x77322f63, 0x6f6d6d6f, 
-0x6e2f6d61, 0x632e632c, 0x7620312e, 0x312e322e, 
-0x32322031, 0x3939382f, 0x31322f30, 0x38203032, 
-0x3a33363a, 0x33302073, 0x6875616e, 0x67204578, 
-0x70202400, 0x65767452, 0x6e674600, 0x51657674, 
-0x46000000, 0x51657674, 0x505f4600, 0x4d657674, 
-0x526e6746, 0x0, 0x4d516576, 0x74460000, 
-0x4d516576, 0x505f4600, 0x5173436f, 0x6e495f46, 
-0x0, 0x5173436f, 0x6e734600, 0x51725072, 
-0x6f644600, 0x2a50414e, 0x49432a00, 0x6d61632e, 
-0x68000000, 0x6d616354, 0x68726573, 0x0, 
-0x23744d61, 0x6341544e, 0x0, 0x23724d61, 
-0x6341544e, 0x0, 0x72656d41, 0x73737274, 
-0x0, 0x6d61632e, 0x63000000, 0x6c696e6b, 
-0x444f574e, 0x0, 0x6c696e6b, 0x55500000, 
-0x24486561, 0x6465723a, 0x202f7072, 0x6f6a6563, 
-0x74732f72, 0x63732f73, 0x772f6765, 0x2f2e2f6e, 
-0x69632f66, 0x77322f63, 0x6f6d6d6f, 0x6e2f636b, 
-0x73756d2e, 0x632c7620, 0x312e312e, 0x322e3920, 
-0x31393939, 0x2f30312f, 0x31342030, 0x303a3033, 
-0x3a343820, 0x73687561, 0x6e672045, 0x78702024, 
-0x0, 0x65767452, 0x6e674600, 0x51657674, 
-0x46000000, 0x51657674, 0x505f4600, 0x4d657674, 
-0x526e6746, 0x0, 0x4d516576, 0x74460000, 
-0x4d516576, 0x505f4600, 0x5173436f, 0x6e495f46, 
-0x0, 0x5173436f, 0x6e734600, 0x51725072, 
-0x6f644600, 0x2a50414e, 0x49432a00, 0x6d61632e, 
-0x68000000, 0x2a50414e, 0x49432a00, 0x2e2e2f63, 
-0x6f6d6d6f, 0x6e2f6d61, 0x632e6800, 0x2e2e2f2e, 
-0x2e2f2e2e, 0x2f636f6d, 0x6d6f6e2f, 0x6c696e6b, 
-0x2e630000, 0x50726f62, 0x65506879, 0x0, 
-0x6c6e6b41, 0x53535254, 0x0, 0x6e6f4863, 
-0x644c6b00, 0x11f8c, 0x1200c, 0x12040, 
-0x1206c, 0x120e8, 0x12160, 0x121c8, 
-0x12940, 0x12324, 0x1235c, 0x12374, 
-0x123b8, 0x123e0, 0x12404, 0x1242c, 
-0x12940, 0x12324, 0x124b8, 0x124d0, 
-0x12500, 0x123e0, 0x12528, 0x12550, 
-0x0, 0x12684, 0x126b4, 0x126d8, 
-0x12940, 0x126fc, 0x127b8, 0x1284c, 
-0x0, 0x2a50414e, 0x49432a00, 0x2e2e2f63, 
-0x6f6d6d6f, 0x6e2f6d61, 0x632e6800, 0x130e4, 
-0x131b4, 0x1328c, 0x1335c, 0x133b8, 
-0x13494, 0x134bc, 0x13598, 0x135c0, 
-0x13768, 0x13790, 0x13938, 0x13b30, 
-0x13dc8, 0x13cd8, 0x13dc8, 0x13df4, 
-0x13960, 0x13b08, 0x7273745f, 0x676d6969, 
-0x0, 0x13e88, 0x13ec4, 0x13fb0, 
-0x14c04, 0x14c48, 0x14c60, 0x7365746c, 
-0x6f6f7000, 0x2a50414e, 0x49432a00, 0x2e2e2f63, 
-0x6f6d6d6f, 0x6e2f6d61, 0x632e6800, 0x15454, 
-0x15494, 0x1552c, 0x15570, 0x155dc, 
-0x1566c, 0x156a0, 0x1572c, 0x157d0, 
-0x158a0, 0x158e0, 0x1596c, 0x15990, 
-0x15aa8, 0x646f4261, 0x73655067, 0x0, 
-0x0, 0x2a50414e, 0x49432a00, 0x2e2e2f63, 
-0x6f6d6d6f, 0x6e2f6d61, 0x632e6800, 0x73746d61, 
-0x634c4e4b, 0x0, 0x6765746d, 0x636c6e6b, 
-0x0, 0x167cc, 0x167cc, 0x1647c, 
-0x164c8, 0x16514, 0x167cc, 0x7365746d, 
-0x61636163, 0x74000000, 0x0 };
-static u_int32_t tigon2FwData[] = {
-0x1, 
-0x1, 0x1, 0xc001fc, 0x3ffc, 
-0xc00000, 0x416c7465, 0x6f6e2041, 0x63654e49, 
-0x43205600, 0x0, 0x416c7465, 0x6f6e2041, 
-0x63654e49, 0x43205600, 0x42424242, 0x1ffffc, 
-0x1fff7c, 0x0, 0x0, 0x0, 
-0x60cf00, 0x60, 0xcf000000, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x3, 
-0x0, 0x1, 0x0, 0x0, 
-0x0, 0x1, 0x0, 0x1, 
-0x0, 0x0, 0x1, 0x1, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x1000000, 0x21000000, 0x12000140, 
-0x0, 0x0, 0x20000000, 0x120000a0, 
-0x0, 0x12000060, 0x12000180, 0x120001e0, 
-0x0, 0x0, 0x0, 0x1, 
-0x0, 0x0, 0x0, 0x0, 
-0x2, 0x0, 0x0, 0x30001, 
-0x1, 0x30201, 0x1010101, 0x1010100, 
-0x10100, 0x1010001, 0x10001, 0x1000101, 
-0x101, 0x0, 0x0 };
Index: if_tl.c
===================================================================
RCS file: /home/cvs/src/sys/pci/if_tl.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/if_tl.c -L sys/pci/if_tl.c -u -r1.1.1.1 -r1.2
--- sys/pci/if_tl.c
+++ sys/pci/if_tl.c
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/if_tl.c,v 1.99.2.4 2005/10/09 04:11:19 delphij Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/if_tl.c,v 1.111 2007/05/09 09:02:11 yar Exp $");
 
 /*
  * Texas Instruments ThunderLAN driver for FreeBSD 2.2.6 and 3.x.
@@ -221,7 +221,7 @@
 MODULE_DEPEND(tl, ether, 1, 1, 1);
 MODULE_DEPEND(tl, miibus, 1, 1, 1);
 
-/* "controller miibus0" required.  See GENERIC if you get errors here. */
+/* "device miibus" required.  See GENERIC if you get errors here. */
 #include "miibus_if.h"
 
 /*
@@ -526,7 +526,7 @@
 {
 	register int		i;
 	u_int8_t		byte = 0;
-	struct ifnet		*ifp = sc->tl_ifp;
+	device_t		tl_dev = sc->tl_dev;
 
 	tl_dio_write8(sc, TL_NETSIO, 0);
 
@@ -536,7 +536,7 @@
 	 * Send write control code to EEPROM.
 	 */
 	if (tl_eeprom_putbyte(sc, EEPROM_CTL_WRITE)) {
-		if_printf(ifp, "failed to send write command, status: %x\n",
+		device_printf(tl_dev, "failed to send write command, status: %x\n",
 		    tl_dio_read8(sc, TL_NETSIO));
 		return(1);
 	}
@@ -545,7 +545,7 @@
 	 * Send address of byte we want to read.
 	 */
 	if (tl_eeprom_putbyte(sc, addr)) {
-		if_printf(ifp, "failed to send address, status: %x\n",
+		device_printf(tl_dev, "failed to send address, status: %x\n",
 		    tl_dio_read8(sc, TL_NETSIO));
 		return(1);
 	}
@@ -556,7 +556,7 @@
 	 * Send read control code to EEPROM.
 	 */
 	if (tl_eeprom_putbyte(sc, EEPROM_CTL_READ)) {
-		if_printf(ifp, "failed to send write command, status: %x\n",
+		device_printf(tl_dev, "failed to send write command, status: %x\n",
 		    tl_dio_read8(sc, TL_NETSIO));
 		return(1);
 	}
@@ -1115,6 +1115,7 @@
 	vid = pci_get_vendor(dev);
 	did = pci_get_device(dev);
 	sc = device_get_softc(dev);
+	sc->tl_dev = dev;
 	unit = device_get_unit(dev);
 
 	t = tl_devs;
@@ -1266,6 +1267,8 @@
 	ifp->if_init = tl_init;
 	ifp->if_mtu = ETHERMTU;
 	ifp->if_snd.ifq_maxlen = TL_TX_LIST_CNT - 1;
+	ifp->if_capabilities |= IFCAP_VLAN_MTU;
+	ifp->if_capenable |= IFCAP_VLAN_MTU;
 	callout_init_mtx(&sc->tl_stat_callout, &sc->tl_mtx, 0);
 
 	/* Reset the adapter again. */
@@ -1302,7 +1305,7 @@
 
 	/* Hook interrupt last to avoid having to lock softc */
 	error = bus_setup_intr(dev, sc->tl_irq, INTR_TYPE_NET | INTR_MPSAFE,
-	    tl_intr, sc, &sc->tl_intrhand);
+	    NULL, tl_intr, sc, &sc->tl_intrhand);
 
 	if (error) {
 		device_printf(dev, "couldn't set up irq\n");
@@ -1343,8 +1346,6 @@
 		callout_drain(&sc->tl_stat_callout);
 		ether_ifdetach(ifp);
 	}
-	if (ifp)
-		if_free(ifp);
 	if (sc->tl_miibus)
 		device_delete_child(dev, sc->tl_miibus);
 	bus_generic_detach(dev);
@@ -1361,6 +1362,9 @@
 	if (sc->tl_res)
 		bus_release_resource(dev, TL_RES, TL_RID, sc->tl_res);
 
+	if (ifp)
+		if_free(ifp);
+
 	mtx_destroy(&sc->tl_mtx);
 
 	return(0);
@@ -1440,10 +1444,6 @@
 	if (m_new == NULL)
 		return(ENOBUFS);
 
-#ifdef __alpha__
-	m_new->m_data += 2;
-#endif
-
 	c->tl_mbuf = m_new;
 	c->tl_next = NULL;
 	c->tl_ptr->tlist_frsize = MCLBYTES;
@@ -1524,7 +1524,7 @@
 		 */
 		eh = mtod(m, struct ether_header *);
 		/*if (ifp->if_flags & IFF_PROMISC && */
-		if (!bcmp(eh->ether_shost, IFP2ENADDR(sc->tl_ifp),
+		if (!bcmp(eh->ether_shost, IF_LLADDR(sc->tl_ifp),
 		 					ETHER_ADDR_LEN)) {
 				m_freem(m);
 				continue;
@@ -1672,7 +1672,7 @@
 	sc = xsc;
 
 	if (type)
-		if_printf(sc->tl_ifp, "adapter check: %x\n",
+		device_printf(sc->tl_dev, "adapter check: %x\n",
 			(unsigned int)CSR_READ_4(sc, TL_CH_PARM));
 
 	tl_softreset(sc, 1);
@@ -1696,7 +1696,7 @@
 	netsts = tl_dio_read16(sc, TL_NETSTS);
 	tl_dio_write16(sc, TL_NETSTS, netsts);
 
-	if_printf(sc->tl_ifp, "network status: %x\n", netsts);
+	device_printf(sc->tl_dev, "network status: %x\n", netsts);
 
 	return(1);
 }
@@ -1727,7 +1727,7 @@
 	switch(ints) {
 	case (TL_INTR_INVALID):
 #ifdef DIAGNOSTIC
-		if_printf(ifp, "got an invalid interrupt!\n");
+		device_printf(sc->tl_dev, "got an invalid interrupt!\n");
 #endif
 		/* Re-enable interrupts but don't ack this one. */
 		CMD_PUT(sc, type);
@@ -1747,7 +1747,7 @@
 		r = tl_intvec_rxeof((void *)sc, type);
 		break;
 	case (TL_INTR_DUMMY):
-		if_printf(ifp, "got a dummy interrupt\n");
+		device_printf(sc->tl_dev, "got a dummy interrupt\n");
 		r = 1;
 		break;
 	case (TL_INTR_ADCHK):
@@ -1760,7 +1760,7 @@
 		r = tl_intvec_rxeoc((void *)sc, type);
 		break;
 	default:
-		if_printf(ifp, "bogus interrupt type\n");
+		device_printf(sc->tl_dev, "bogus interrupt type\n");
 		break;
 	}
 
@@ -1816,7 +1816,7 @@
 		if (tx_thresh != TL_AC_TXTHRESH_WHOLEPKT) {
 			tx_thresh >>= 4;
 			tx_thresh++;
-			if_printf(ifp, "tx underrun -- increasing "
+			device_printf(sc->tl_dev, "tx underrun -- increasing "
 			    "tx threshold to %d bytes\n",
 			    (64 * (tx_thresh * 4)));
 			tl_dio_clrbit(sc, TL_ACOMMIT, TL_AC_TXTHRESH);
@@ -2090,14 +2090,14 @@
 	tl_dio_write16(sc, TL_MAXRX, MCLBYTES);
 
 	/* Init our MAC address */
-	tl_setfilt(sc, (caddr_t)&IFP2ENADDR(sc->tl_ifp), 0);
+	tl_setfilt(sc, IF_LLADDR(sc->tl_ifp), 0);
 
 	/* Init multicast filter, if needed. */
 	tl_setmulti(sc);
 
 	/* Init circular RX list. */
 	if (tl_list_rx_init(sc) == ENOBUFS) {
-		if_printf(ifp,
+		device_printf(sc->tl_dev,
 		    "initialization failed: no memory for rx buffers\n");
 		tl_stop(sc);
 		return;
Index: if_pcnreg.h
===================================================================
RCS file: /home/cvs/src/sys/pci/if_pcnreg.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/if_pcnreg.h -L sys/pci/if_pcnreg.h -u -r1.1.1.1 -r1.2
--- sys/pci/if_pcnreg.h
+++ sys/pci/if_pcnreg.h
@@ -30,7 +30,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/pci/if_pcnreg.h,v 1.11.2.1 2005/08/26 14:33:05 jhb Exp $
+ * $FreeBSD: src/sys/pci/if_pcnreg.h,v 1.15 2006/11/28 01:33:17 marius Exp $
  */
 
 /*
@@ -206,7 +206,7 @@
 #define PCN_MODE_RXNOBROAD	0x4000
 #define PCN_MODE_PROMISC	0x8000
 
-/* Settings for PCN_MODE_PORTSEL when ASEL (BCR2[1] is 0 */
+/* Settings for PCN_MODE_PORTSEL when ASEL (BCR2[1]) is 0 */
 #define PCN_PORT_AUI		0x0000
 #define PCN_PORT_10BASET	0x0080
 #define PCN_PORT_GPSI		0x0100
@@ -218,12 +218,6 @@
 /* CSR88-89: Chip ID masks */
 #define AMD_MASK  0x003
 #define PART_MASK 0xffff
-#define Am79C960  0x0003
-#define Am79C961  0x2260
-#define Am79C961A 0x2261
-#define Am79C965  0x2430
-#define Am79C970  0x0242
-#define Am79C970A 0x2621
 #define Am79C971  0x2623
 #define Am79C972  0x2624
 #define Am79C973  0x2625
@@ -345,7 +339,11 @@
  * MII address register (BCR33)
  */
 #define PCN_MIIADDR_REGAD	0x001F
-#define PCN_MIIADDR_PHYADD	0x03E0
+#define PCN_MIIADDR_PHYAD	0x03E0
+
+/* addresses of internal PHYs */
+#define PCN_PHYAD_100BTX	30
+#define PCN_PHYAD_10BT		31
 
 /*
  * MII data register (BCR34)
@@ -447,7 +445,7 @@
 struct pcn_type {
 	u_int16_t		pcn_vid;
 	u_int16_t		pcn_did;
-	char			*pcn_name;
+	const char		*pcn_name;
 };
 
 struct pcn_softc {
@@ -458,9 +456,9 @@
 	struct resource		*pcn_irq;
 	void			*pcn_intrhand;
 	device_t		pcn_miibus;
-	u_int8_t		pcn_unit;
 	u_int8_t		pcn_link;
-	u_int8_t		pcn_phyaddr;
+	int8_t			pcn_extphyaddr;
+	int8_t			pcn_inst_10bt;
 	int			pcn_if_flags;
 	int			pcn_type;
 	struct pcn_list_data	*pcn_ldata;
@@ -488,7 +486,6 @@
 #define CSR_READ_2(sc, reg)		\
 	bus_space_read_2(sc->pcn_btag, sc->pcn_bhandle, reg)
 
-
 #define PCN_TIMEOUT		1000
 #define ETHER_ALIGN		2
 #define PCN_RXLEN		1536
@@ -531,8 +528,3 @@
 #define PCN_PSTATE_D3		0x0003
 #define PCN_PME_EN		0x0010
 #define PCN_PME_STATUS		0x8000
-
-#ifdef __alpha__
-#undef vtophys
-#define vtophys(va)		alpha_XXX_dmamap((vm_offset_t)va)
-#endif
Index: agp_ali.c
===================================================================
RCS file: /home/cvs/src/sys/pci/agp_ali.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/agp_ali.c -L sys/pci/agp_ali.c -u -r1.1.1.1 -r1.2
--- sys/pci/agp_ali.c
+++ sys/pci/agp_ali.c
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/agp_ali.c,v 1.17 2005/02/27 13:05:34 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/agp_ali.c,v 1.18.2.1 2007/11/08 20:29:53 jhb Exp $");
 
 #include "opt_bus.h"
 
@@ -85,7 +85,6 @@
 		return (ENXIO);
 	desc = agp_ali_match(dev);
 	if (desc) {
-		device_verbose(dev);
 		device_set_desc(dev, desc);
 		return BUS_PROBE_DEFAULT;
 	}
@@ -142,12 +141,9 @@
 agp_ali_detach(device_t dev)
 {
 	struct agp_ali_softc *sc = device_get_softc(dev);
-	int error;
 	u_int32_t attbase;
 
-	error = agp_generic_detach(dev);
-	if (error)
-		return error;
+	agp_free_cdev(dev);
 
 	/* Disable the TLB.. */
 	pci_write_config(dev, AGP_ALI_TLBCTRL, 0x90, 1);
@@ -158,6 +154,7 @@
 	pci_write_config(dev, AGP_ALI_ATTBASE, attbase & 0xfff, 4);
 
 	agp_free_gatt(sc->gatt);
+	agp_free_res(dev);
 	return 0;
 }
 
@@ -271,6 +268,6 @@
 
 static devclass_t agp_devclass;
 
-DRIVER_MODULE(agp_ali, pci, agp_ali_driver, agp_devclass, 0, 0);
+DRIVER_MODULE(agp_ali, hostb, agp_ali_driver, agp_devclass, 0, 0);
 MODULE_DEPEND(agp_ali, agp, 1, 1, 1);
 MODULE_DEPEND(agp_ali, pci, 1, 1, 1);
Index: agpvar.h
===================================================================
RCS file: /home/cvs/src/sys/pci/agpvar.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/agpvar.h -L sys/pci/agpvar.h -u -r1.1.1.1 -r1.2
--- sys/pci/agpvar.h
+++ sys/pci/agpvar.h
@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$FreeBSD: src/sys/pci/agpvar.h,v 1.2 2001/12/19 08:54:29 mdodd Exp $
+ *	$FreeBSD: src/sys/pci/agpvar.h,v 1.3 2005/12/20 20:05:21 jhb Exp $
  */
 
 #ifndef _PCI_AGPVAR_H_
@@ -47,7 +47,6 @@
 	u_int32_t	ai_mode;
 	vm_offset_t	ai_aperture_base;
 	vm_size_t	ai_aperture_size;
-	vm_offset_t	ai_aperture_va;
 	vm_size_t	ai_memory_allowed;
 	vm_size_t	ai_memory_used;
 	u_int32_t	ai_devid;
Index: if_sfreg.h
===================================================================
RCS file: /home/cvs/src/sys/pci/if_sfreg.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/if_sfreg.h -L sys/pci/if_sfreg.h -u -r1.1.1.1 -r1.2
--- sys/pci/if_sfreg.h
+++ sys/pci/if_sfreg.h
@@ -29,7 +29,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/pci/if_sfreg.h,v 1.14.2.1 2005/08/26 14:50:16 jhb Exp $
+ * $FreeBSD: src/sys/pci/if_sfreg.h,v 1.19 2006/09/15 11:01:23 ru Exp $
  */
 
 /*
@@ -1032,6 +1032,7 @@
 
 struct sf_softc {
 	struct ifnet		*sf_ifp;	/* interface info */
+	device_t		sf_dev;		/* device info */
 	bus_space_handle_t	sf_bhandle;	/* bus space handle */
 	bus_space_tag_t		sf_btag;	/* bus space tag */
 	void			*sf_intrhand;	/* interrupt handler cookie */
@@ -1056,8 +1057,3 @@
 #define	SF_LOCK_ASSERT(_sc)	mtx_assert(&(_sc)->sf_mtx, MA_OWNED)
 
 #define SF_TIMEOUT	1000
-
-#ifdef __alpha__
-#undef vtophys
-#define vtophys(va)		alpha_XXX_dmamap((vm_offset_t)va)
-#endif
Index: if_pcn.c
===================================================================
RCS file: /home/cvs/src/sys/pci/if_pcn.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -L sys/pci/if_pcn.c -L sys/pci/if_pcn.c -u -r1.2 -r1.3
--- sys/pci/if_pcn.c
+++ sys/pci/if_pcn.c
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/if_pcn.c,v 1.69.2.4 2005/10/09 04:11:19 delphij Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/if_pcn.c,v 1.83 2007/02/23 12:19:03 piso Exp $");
 
 /*
  * AMD Am79c972 fast ethernet PCI NIC driver. Datasheets are available
@@ -91,28 +91,22 @@
 MODULE_DEPEND(pcn, ether, 1, 1, 1);
 MODULE_DEPEND(pcn, miibus, 1, 1, 1);
 
-/* "controller miibus0" required.  See GENERIC if you get errors here. */
+/* "device miibus" required.  See GENERIC if you get errors here. */
 #include "miibus_if.h"
 
 /*
  * Various supported device vendors/types and their names.
  */
-static struct pcn_type pcn_devs[] = {
+static const struct pcn_type pcn_devs[] = {
 	{ PCN_VENDORID, PCN_DEVICEID_PCNET, "AMD PCnet/PCI 10/100BaseTX" },
 	{ PCN_VENDORID, PCN_DEVICEID_HOME, "AMD PCnet/Home HomePNA" },
 	{ 0, 0, NULL }
 };
 
-static struct pcn_chipid {
+static const struct pcn_chipid {
 	u_int32_t	id;
-	char *		name;
+	const char	*name;
 } pcn_chipid[] = {
-	{ Am79C960,	"Am79C960" },
-	{ Am79C961,	"Am79C961" },
-	{ Am79C961A,	"Am79C961A" },
-	{ Am79C965,	"Am79C965" },
-	{ Am79C970,	"Am79C970" },
-	{ Am79C970A,	"Am79C970A" },
 	{ Am79C971,	"Am79C971" },
 	{ Am79C972,	"Am79C972" },
 	{ Am79C973,	"Am79C973" },
@@ -122,8 +116,9 @@
 	{ 0, NULL },
 };
 
-static char * pcn_chipid_name(u_int32_t);
+static const char *pcn_chipid_name(u_int32_t);
 static u_int32_t pcn_chip_id(device_t);
+static const struct pcn_type *pcn_match(u_int16_t, u_int16_t);
 
 static u_int32_t pcn_csr_read(struct pcn_softc *, int);
 static u_int16_t pcn_csr_read16(struct pcn_softc *, int);
@@ -281,7 +276,27 @@
 
 	sc = device_get_softc(dev);
 
-	if (sc->pcn_phyaddr && phy > sc->pcn_phyaddr)
+	/*
+	 * At least Am79C971 with DP83840A wedge when isolating the
+	 * external PHY so we can't allow multiple external PHYs.
+	 * There are cards that use Am79C971 with both the internal
+	 * and an external PHY though.
+	 * For internal PHYs it doesn't really matter whether we can
+	 * isolate the remaining internal and the external ones in
+	 * the PHY drivers as the internal PHYs have to be enabled
+	 * individually in PCN_BCR_PHYSEL, PCN_CSR_MODE, etc.
+	 * With Am79C97{3,5,8} we don't support switching beetween
+	 * the internal and external PHYs, yet, so we can't allow
+	 * multiple PHYs with these either.
+	 * Am79C97{2,6} actually only support external PHYs (not
+	 * connectable internal ones respond at the usual addresses,
+	 * which don't hurt if we let them show up on the bus) and
+	 * isolating them works.
+	 */
+	if (((sc->pcn_type == Am79C971 && phy != PCN_PHYAD_10BT) ||
+	    sc->pcn_type == Am79C973 || sc->pcn_type == Am79C975 ||
+	    sc->pcn_type == Am79C978) && sc->pcn_extphyaddr != -1 &&
+	    phy != sc->pcn_extphyaddr)
 		return(0);
 
 	pcn_bcr_write(sc, PCN_BCR_MIIADDR, reg | (phy << 5));
@@ -289,7 +304,10 @@
 	if (val == 0xFFFF)
 		return(0);
 
-	sc->pcn_phyaddr = phy;
+	if (((sc->pcn_type == Am79C971 && phy != PCN_PHYAD_10BT) ||
+	    sc->pcn_type == Am79C973 || sc->pcn_type == Am79C975 ||
+	    sc->pcn_type == Am79C978) && sc->pcn_extphyaddr == -1)
+		sc->pcn_extphyaddr = phy;
 
 	return(val);
 }
@@ -397,11 +415,12 @@
         return;
 }
 
-static char *
-pcn_chipid_name	(u_int32_t id)
+static const char *
+pcn_chipid_name(u_int32_t id)
 {
-	struct pcn_chipid *p = pcn_chipid;
+	const struct pcn_chipid *p;
 
+	p = pcn_chipid;
 	while (p->name) {
 		if (id == p->id)
 			return (p->name);
@@ -411,7 +430,7 @@
 }
 
 static u_int32_t
-pcn_chip_id (device_t dev)
+pcn_chip_id(device_t dev)
 {
 	struct pcn_softc	*sc;
 	u_int32_t		chip_id;
@@ -419,14 +438,14 @@
 	sc = device_get_softc(dev);
 	/*
 	 * Note: we can *NOT* put the chip into
-	 * 32-bit mode yet. The lnc driver will only
+	 * 32-bit mode yet. The le(4) driver will only
 	 * work in 16-bit mode, and once the chip
 	 * goes into 32-bit mode, the only way to
 	 * get it out again is with a hardware reset.
 	 * So if pcn_probe() is called before the
-	 * lnc driver's probe routine, the chip will
-	 * be locked into 32-bit operation and the lnc
-	 * driver will be unable to attach to it.
+	 * le(4) driver's probe routine, the chip will
+	 * be locked into 32-bit operation and the
+	 * le(4) driver will be unable to attach to it.
 	 * Note II: if the chip happens to already
 	 * be in 32-bit mode, we still need to check
 	 * the chip ID, but first we have to detect
@@ -463,13 +482,13 @@
 	return (chip_id);
 }
 
-static struct pcn_type *
-pcn_match (u_int16_t vid, u_int16_t did)
+static const struct pcn_type *
+pcn_match(u_int16_t vid, u_int16_t did)
 {
-	struct pcn_type		*t;
-	t = pcn_devs;
+	const struct pcn_type	*t;
 
-	while(t->pcn_name != NULL) {
+	t = pcn_devs;
+	while (t->pcn_name != NULL) {
 		if ((vid == t->pcn_vid) && (did == t->pcn_did))
 			return (t);
 		t++;
@@ -485,7 +504,7 @@
 pcn_probe(dev)
 	device_t		dev;
 {
-	struct pcn_type		*t;
+	const struct pcn_type	*t;
 	struct pcn_softc	*sc;
 	int			rid;
 	u_int32_t		chip_id;
@@ -536,11 +555,12 @@
 {
 	u_int32_t		eaddr[2];
 	struct pcn_softc	*sc;
+	struct mii_data		*mii;
+	struct mii_softc	*miisc;
 	struct ifnet		*ifp;
-	int			unit, error = 0, rid;
+	int			error = 0, rid;
 
 	sc = device_get_softc(dev);
-	unit = device_get_unit(dev);
 
 	/* Initialize our mutex. */
 	mtx_init(&sc->pcn_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
@@ -559,7 +579,7 @@
 	sc->pcn_res = bus_alloc_resource_any(dev, PCN_RES, &rid, RF_ACTIVE);
 
 	if (sc->pcn_res == NULL) {
-		printf("pcn%d: couldn't map ports/memory\n", unit);
+		device_printf(dev, "couldn't map ports/memory\n");
 		error = ENXIO;
 		goto fail;
 	}
@@ -573,7 +593,7 @@
 	    RF_SHAREABLE | RF_ACTIVE);
 
 	if (sc->pcn_irq == NULL) {
-		printf("pcn%d: couldn't map interrupt\n", unit);
+		device_printf(dev, "couldn't map interrupt\n");
 		error = ENXIO;
 		goto fail;
 	}
@@ -587,14 +607,13 @@
 	eaddr[0] = CSR_READ_4(sc, PCN_IO32_APROM00);
 	eaddr[1] = CSR_READ_4(sc, PCN_IO32_APROM01);
 
-	sc->pcn_unit = unit;
 	callout_init_mtx(&sc->pcn_stat_callout, &sc->pcn_mtx, 0);
 
 	sc->pcn_ldata = contigmalloc(sizeof(struct pcn_list_data), M_DEVBUF,
 	    M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0);
 
 	if (sc->pcn_ldata == NULL) {
-		printf("pcn%d: no memory for list buffers!\n", unit);
+		device_printf(dev, "no memory for list buffers!\n");
 		error = ENXIO;
 		goto fail;
 	}
@@ -602,13 +621,12 @@
 
 	ifp = sc->pcn_ifp = if_alloc(IFT_ETHER);
 	if (ifp == NULL) {
-		printf("pcn%d: can not if_alloc()\n", unit);
+		device_printf(dev, "can not if_alloc()\n");
 		error = ENOSPC;
 		goto fail;
 	}
 	ifp->if_softc = sc;
 	if_initname(ifp, device_get_name(dev), device_get_unit(dev));
-	ifp->if_mtu = ETHERMTU;
 	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
 	ifp->if_ioctl = pcn_ioctl;
 	ifp->if_start = pcn_start;
@@ -619,12 +637,31 @@
 	/*
 	 * Do MII setup.
 	 */
+	sc->pcn_extphyaddr = -1;
 	if (mii_phy_probe(dev, &sc->pcn_miibus,
 	    pcn_ifmedia_upd, pcn_ifmedia_sts)) {
-		printf("pcn%d: MII without any PHY!\n", sc->pcn_unit);
+		device_printf(dev, "MII without any PHY!\n");
 		error = ENXIO;
 		goto fail;
 	}
+	/*
+	 * Record the media instances of internal PHYs, which map the
+	 * built-in interfaces to the MII, so we can set the active
+	 * PHY/port based on the currently selected media.
+	 */
+	sc->pcn_inst_10bt = -1;
+	mii = device_get_softc(sc->pcn_miibus);
+	LIST_FOREACH(miisc, &mii->mii_phys, mii_list) {
+		switch (miisc->mii_phy) {
+		case PCN_PHYAD_10BT:
+			sc->pcn_inst_10bt = miisc->mii_inst;
+			break;
+		/*
+		 * XXX deal with the Am79C97{3,5} internal 100baseT
+		 * and the Am79C978 internal HomePNA PHYs.
+		 */
+		}
+	}
 
 	/*
 	 * Call MI attach routine.
@@ -633,10 +670,10 @@
 
 	/* Hook interrupt last to avoid having to lock softc */
 	error = bus_setup_intr(dev, sc->pcn_irq, INTR_TYPE_NET | INTR_MPSAFE,
-	    pcn_intr, sc, &sc->pcn_intrhand);
+	    NULL, pcn_intr, sc, &sc->pcn_intrhand);
 
 	if (error) {
-		printf("pcn%d: couldn't set up irq\n", unit);
+		device_printf(dev, "couldn't set up irq\n");
 		ether_ifdetach(ifp);
 		goto fail;
 	}
@@ -676,8 +713,6 @@
 		callout_drain(&sc->pcn_stat_callout);
 		ether_ifdetach(ifp);
 	}
-	if (ifp)
-		if_free(ifp);
 	if (sc->pcn_miibus)
 		device_delete_child(dev, sc->pcn_miibus);
 	bus_generic_detach(dev);
@@ -689,6 +724,9 @@
 	if (sc->pcn_res)
 		bus_release_resource(dev, PCN_RES, PCN_RID, sc->pcn_res);
 
+	if (ifp)
+		if_free(ifp);
+
 	if (sc->pcn_ldata) {
 		contigfree(sc->pcn_ldata, sizeof(struct pcn_list_data),
 		    M_DEVBUF);
@@ -1156,6 +1194,7 @@
 {
 	struct ifnet		*ifp = sc->pcn_ifp;
 	struct mii_data		*mii = NULL;
+	struct ifmedia_entry	*ife;
 
 	PCN_LOCK_ASSERT(sc);
 
@@ -1166,19 +1205,20 @@
 	pcn_reset(sc);
 
 	mii = device_get_softc(sc->pcn_miibus);
+	ife = mii->mii_media.ifm_cur;
 
 	/* Set MAC address */
 	pcn_csr_write(sc, PCN_CSR_PAR0,
-	    ((u_int16_t *)IFP2ENADDR(sc->pcn_ifp))[0]);
+	    ((u_int16_t *)IF_LLADDR(sc->pcn_ifp))[0]);
 	pcn_csr_write(sc, PCN_CSR_PAR1,
-	    ((u_int16_t *)IFP2ENADDR(sc->pcn_ifp))[1]);
+	    ((u_int16_t *)IF_LLADDR(sc->pcn_ifp))[1]);
 	pcn_csr_write(sc, PCN_CSR_PAR2,
-	    ((u_int16_t *)IFP2ENADDR(sc->pcn_ifp))[2]);
+	    ((u_int16_t *)IF_LLADDR(sc->pcn_ifp))[2]);
 
 	/* Init circular RX list. */
 	if (pcn_list_rx_init(sc) == ENOBUFS) {
-		printf("pcn%d: initialization failed: no "
-		    "memory for rx buffers\n", sc->pcn_unit);
+		if_printf(ifp, "initialization failed: no "
+		    "memory for rx buffers\n");
 		pcn_stop(sc);
 		return;
 	}
@@ -1188,8 +1228,19 @@
 	 */
 	pcn_list_tx_init(sc);
 
-	/* Set up the mode register. */
-	pcn_csr_write(sc, PCN_CSR_MODE, PCN_PORT_MII);
+	/* Clear PCN_MISC_ASEL so we can set the port via PCN_CSR_MODE. */
+	PCN_BCR_CLRBIT(sc, PCN_BCR_MISCCFG, PCN_MISC_ASEL);
+
+	/*
+	 * Set up the port based on the currently selected media.
+	 * For Am79C978 we've to unconditionally set PCN_PORT_MII and
+	 * set the PHY in PCN_BCR_PHYSEL instead.
+	 */
+	if (sc->pcn_type != Am79C978 &&
+	    IFM_INST(ife->ifm_media) == sc->pcn_inst_10bt)
+		pcn_csr_write(sc, PCN_CSR_MODE, PCN_PORT_10BASET);
+	else
+		pcn_csr_write(sc, PCN_CSR_MODE, PCN_PORT_MII);
 
 	/* Set up RX filter. */
 	pcn_setfilt(ifp);
@@ -1239,6 +1290,7 @@
 	PCN_BCR_SETBIT(sc, PCN_BCR_MIICTL, PCN_MIICTL_DANAS);
 
 	if (sc->pcn_type == Am79C978)
+		/* XXX support other PHYs? */
 		pcn_bcr_write(sc, PCN_BCR_PHYSEL,
 		    PCN_PHYSEL_PCNET|PCN_PHY_HOMEPNA);
 
@@ -1263,19 +1315,26 @@
 	struct ifnet		*ifp;
 {
 	struct pcn_softc	*sc;
-	struct mii_data		*mii;
 
 	sc = ifp->if_softc;
-	mii = device_get_softc(sc->pcn_miibus);
 
 	PCN_LOCK(sc);
+
+	/*
+	 * At least Am79C971 with DP83840A can wedge when switching
+	 * from the internal 10baseT PHY to the external PHY without
+	 * issuing pcn_reset(). For setting the port in PCN_CSR_MODE
+	 * the PCnet chip has to be powered down or stopped anyway
+	 * and although documented otherwise it doesn't take effect
+	 * until the next initialization.
+	 */
 	sc->pcn_link = 0;
-	if (mii->mii_instance) {
-		struct mii_softc        *miisc;
-		LIST_FOREACH(miisc, &mii->mii_phys, mii_list)
-			mii_phy_reset(miisc);
-	}
-	mii_mediachg(mii);
+	pcn_stop(sc);
+	pcn_reset(sc);
+	pcn_init_locked(sc);
+	if (ifp->if_snd.ifq_head != NULL)
+		pcn_start_locked(ifp);
+
 	PCN_UNLOCK(sc);
 
 	return(0);
@@ -1380,7 +1439,7 @@
 	PCN_LOCK(sc);
 
 	ifp->if_oerrors++;
-	printf("pcn%d: watchdog timeout\n", sc->pcn_unit);
+	if_printf(ifp, "watchdog timeout\n");
 
 	pcn_stop(sc);
 	pcn_reset(sc);
Index: agp_amd.c
===================================================================
RCS file: /home/cvs/src/sys/pci/agp_amd.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/agp_amd.c -L sys/pci/agp_amd.c -u -r1.1.1.1 -r1.2
--- sys/pci/agp_amd.c
+++ sys/pci/agp_amd.c
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/agp_amd.c,v 1.22 2005/02/24 21:32:55 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/agp_amd.c,v 1.23.2.1 2007/11/08 20:29:53 jhb Exp $");
 
 #include "opt_bus.h"
 
@@ -207,7 +207,6 @@
 		return (ENXIO);
 	desc = agp_amd_match(dev);
 	if (desc) {
-		device_verbose(dev);
 		device_set_desc(dev, desc);
 		return BUS_PROBE_DEFAULT;
 	}
@@ -278,11 +277,8 @@
 agp_amd_detach(device_t dev)
 {
 	struct agp_amd_softc *sc = device_get_softc(dev);
-	int error;
 
-	error = agp_generic_detach(dev);
-	if (error)
-		return error;
+	agp_free_cdev(dev);
 
 	/* Disable the TLB.. */
 	WRITE2(AGP_AMD751_STATUS,
@@ -298,6 +294,7 @@
 	AGP_SET_APERTURE(dev, sc->initial_aperture);
 
 	agp_amd_free_gatt(sc->gatt);
+	agp_free_res(dev);
 
 	bus_release_resource(dev, SYS_RES_MEMORY,
 			     AGP_AMD751_REGISTERS, sc->regs);
@@ -415,6 +412,6 @@
 
 static devclass_t agp_devclass;
 
-DRIVER_MODULE(agp_amd, pci, agp_amd_driver, agp_devclass, 0, 0);
+DRIVER_MODULE(agp_amd, hostb, agp_amd_driver, agp_devclass, 0, 0);
 MODULE_DEPEND(agp_amd, agp, 1, 1, 1);
 MODULE_DEPEND(agp_amd, pci, 1, 1, 1);
Index: agppriv.h
===================================================================
RCS file: /home/cvs/src/sys/pci/agppriv.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/agppriv.h -L sys/pci/agppriv.h -u -r1.1.1.1 -r1.2
--- sys/pci/agppriv.h
+++ sys/pci/agppriv.h
@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$FreeBSD: src/sys/pci/agppriv.h,v 1.5 2004/06/16 09:47:20 phk Exp $
+ *	$FreeBSD: src/sys/pci/agppriv.h,v 1.6.2.1 2007/11/08 20:29:53 jhb Exp $
  */
 
 #ifndef _PCI_AGPPRIV_H_
@@ -69,6 +69,7 @@
  */
 struct agp_softc {
 	struct resource	        *as_aperture;	/* location of aperture */
+	int			as_aperture_rid;
 	u_int32_t		as_maxmem;	/* allocation upper bound */
 	u_int32_t		as_allocated;	/* amount allocated */
 	enum agp_acquire_state	as_state;
@@ -88,9 +89,15 @@
 void			agp_flush_cache(void);
 u_int8_t		agp_find_caps(device_t dev);
 struct agp_gatt	       *agp_alloc_gatt(device_t dev);
+void			agp_set_aperture_resource(device_t dev, int rid);
+void			agp_free_cdev(device_t dev);
 void		        agp_free_gatt(struct agp_gatt *gatt);
+void			agp_free_res(device_t dev);
 int			agp_generic_attach(device_t dev);
 int			agp_generic_detach(device_t dev);
+int			agp_generic_get_aperture(device_t dev);
+int			agp_generic_set_aperture(device_t dev,
+						 u_int32_t aperture);
 int			agp_generic_enable(device_t dev, u_int32_t mode);
 struct agp_memory      *agp_generic_alloc_memory(device_t dev, int type,
 						 vm_size_t size);
--- sys/pci/ti_fw.h
+++ /dev/null
@@ -1,4593 +0,0 @@
-/*
- * Firmware for Alteon Tigon 1 chip.
- * Generated by genfw.c
- *
- * $FreeBSD: src/sys/pci/ti_fw.h,v 1.10 2002/06/26 03:34:52 ken Exp $
- */
-static int tigonFwReleaseMajor = 0xc;
-static int tigonFwReleaseMinor = 0x4;
-static int tigonFwReleaseFix = 0xb;
-static u_int32_t tigonFwStartAddr = 0x00004000;
-static u_int32_t tigonFwTextAddr = 0x00004000;
-static int tigonFwTextLen = 0x11140;
-static u_int32_t tigonFwRodataAddr = 0x00015140;
-static int tigonFwRodataLen = 0xac0;
-static u_int32_t tigonFwDataAddr = 0x00015c20;
-static int tigonFwDataLen = 0x170;
-static u_int32_t tigonFwSbssAddr = 0x00015d90;
-static int tigonFwSbssLen = 0x38;
-static u_int32_t tigonFwBssAddr = 0x00015dd0;
-static int tigonFwBssLen = 0x2080;
-static u_int32_t tigonFwText[] = {
-0x10000003, 
-0x0, 0xd, 0xd, 0x3c1d0001, 
-0x8fbd5c54, 0x3a0f021, 0x3c100000, 0x26104000, 
-0xc00100c, 0x0, 0xd, 0x27bdffd8, 
-0x3c1cc000, 0x3c1b0013, 0x377bd800, 0xd021, 
-0x3c170013, 0x36f75418, 0x2e02021, 0x340583e8, 
-0xafbf0024, 0xc002488, 0xafb00020, 0xc0023e8, 
-0x0, 0x3c040001, 0x248451a4, 0x24050001, 
-0x2e03021, 0x3821, 0x3c100001, 0x26107e50, 
-0xafb00010, 0xc002403, 0xafbb0014, 0x3c02000f, 
-0x3442ffff, 0x2021024, 0x362102b, 0x10400009, 
-0x24050003, 0x3c040001, 0x248451b0, 0x2003021, 
-0x3603821, 0x3c020010, 0xafa20010, 0xc002403, 
-0xafa00014, 0x2021, 0x3405c000, 0x3c010001, 
-0x370821, 0xa02083b0, 0x3c010001, 0x370821, 
-0xa02083b2, 0x3c010001, 0x370821, 0xa02083b3, 
-0x3c010001, 0x370821, 0xac2083b4, 0xa2e004d8, 
-0x418c0, 0x24840001, 0x771021, 0xac40727c, 
-0x771021, 0xac407280, 0x2e31021, 0xa445727c, 
-0x2c820020, 0x1440fff7, 0x418c0, 0x2021, 
-0x3405c000, 0x418c0, 0x24840001, 0x771021, 
-0xac40737c, 0x771021, 0xac407380, 0x2e31021, 
-0xa445737c, 0x2c820080, 0x5440fff7, 0x418c0, 
-0xaf800054, 0xaf80011c, 0x8f820044, 0x34420040, 
-0xaf820044, 0x8f820044, 0x34420020, 0xaf820044, 
-0x8f420218, 0x30420002, 0x10400009, 0x0, 
-0x8f420220, 0x3c030002, 0x34630004, 0x431025, 
-0xaee204c4, 0x8f42021c, 0x8001074, 0x34420004, 
-0x8f420220, 0x3c030002, 0x34630006, 0x431025, 
-0xaee204c4, 0x8f42021c, 0x34420006, 0xaee204cc, 
-0x8f420218, 0x30420010, 0x1040000a, 0x0, 
-0x8f42021c, 0x34420004, 0xaee204c8, 0x8f420220, 
-0x3c03000a, 0x34630004, 0x431025, 0x800108a, 
-0xaee204c0, 0x8f420220, 0x3c03000a, 0x34630006, 
-0x431025, 0xaee204c0, 0x8f42021c, 0x34420006, 
-0xaee204c8, 0x8f420218, 0x30420200, 0x10400003, 
-0x24020001, 0x8001091, 0xa2e27248, 0xa2e07248, 
-0x24020001, 0xaf8200a0, 0xaf8200b0, 0x8f830054, 
-0x8f820054, 0x8001099, 0x24630064, 0x8f820054, 
-0x621023, 0x2c420065, 0x1440fffc, 0x0, 
-0xaf800044, 0x8f420208, 0x8f43020c, 0xaee20010, 
-0xaee30014, 0x8ee40010, 0x8ee50014, 0x26e20030, 
-0xaee20028, 0x24020490, 0xaee20018, 0xaf840090, 
-0xaf850094, 0x8ee20028, 0xaf8200b4, 0x96e2001a, 
-0xaf82009c, 0x8f8200b0, 0x8ee304cc, 0x431025, 
-0xaf8200b0, 0x8f8200b0, 0x30420004, 0x1440fffd, 
-0x0, 0x8ee20450, 0x8ee30454, 0xaee304fc, 
-0x8ee204fc, 0x2442e000, 0x2c422001, 0x1440000d, 
-0x26e40030, 0x8ee20450, 0x8ee30454, 0x3c040001, 
-0x248451bc, 0x3c050001, 0xafa00010, 0xafa00014, 
-0x8ee704fc, 0x34a5f000, 0xc002403, 0x603021, 
-0x26e40030, 0xc002488, 0x24050400, 0x27440080, 
-0xc002488, 0x24050080, 0x26e4777c, 0xc002488, 
-0x24050400, 0x8f42025c, 0x26e40094, 0xaee20060, 
-0x8f420260, 0x27450200, 0x24060008, 0xaee20068, 
-0x24020006, 0xc00249a, 0xaee20064, 0x3c023b9a, 
-0x3442ca00, 0x2021, 0x24030002, 0xaee30074, 
-0xaee30070, 0xaee2006c, 0x240203e8, 0xaee20104, 
-0x24020001, 0xaee30100, 0xaee2010c, 0x3c030001, 
-0x641821, 0x90635c20, 0x2e41021, 0x24840001, 
-0xa043009c, 0x2c82000f, 0x1440fff8, 0x0, 
-0x8f820040, 0x2e41821, 0x24840001, 0x21702, 
-0x24420030, 0xa062009c, 0x2e41021, 0xa040009c, 
-0x96e2046a, 0x30420003, 0x14400009, 0x0, 
-0x96e2047a, 0x30420003, 0x50400131, 0x3c030800, 
-0x96e2046a, 0x30420003, 0x1040002a, 0x3c020700, 
-0x96e2047a, 0x30420003, 0x10400026, 0x3c020700, 
-0x96e3047a, 0x96e2046a, 0x14620022, 0x3c020700, 
-0x8ee204c0, 0x24030001, 0xa2e34e20, 0x34420e00, 
-0xaee204c0, 0x8f420218, 0x30420100, 0x10400005, 
-0x0, 0x3c020001, 0x2442e168, 0x800111d, 
-0x21100, 0x3c020001, 0x2442d35c, 0x21100, 
-0x21182, 0x3c030800, 0x431025, 0x3c010001, 
-0xac221238, 0x3c020001, 0x2442f680, 0x21100, 
-0x21182, 0x3c030800, 0x431025, 0x3c010001, 
-0xac221278, 0x8ee20000, 0x34424000, 0x8001238, 
-0xaee20000, 0x34423000, 0xafa20018, 0x8ee20608, 
-0x8f430228, 0x24420001, 0x304900ff, 0x512300e2, 
-0xafa00010, 0x8ee20608, 0x210c0, 0x571021, 
-0x8fa30018, 0x8fa4001c, 0xac43060c, 0xac440610, 
-0x8f870120, 0x27623800, 0x24e80020, 0x102102b, 
-0x50400001, 0x27683000, 0x8f820128, 0x11020004, 
-0x0, 0x8f820124, 0x15020007, 0x1021, 
-0x8ee201a4, 0x3021, 0x24420001, 0xaee201a4, 
-0x80011a0, 0x8ee201a4, 0x8ee40608, 0x420c0, 
-0x801821, 0x8ee40430, 0x8ee50434, 0xa32821, 
-0xa3302b, 0x822021, 0x862021, 0xace40000, 
-0xace50004, 0x8ee30608, 0x24020008, 0xa4e2000e, 
-0x2402000d, 0xace20018, 0xace9001c, 0x318c0, 
-0x2463060c, 0x2e31021, 0xace20008, 0x8ee204c4, 
-0xace20010, 0xaf880120, 0x92e24e20, 0x14400037, 
-0x24060001, 0x8ee24e30, 0x210c0, 0x24425038, 
-0x2e22021, 0x8c830000, 0x24020007, 0x1462001f, 
-0x0, 0x8ee34e30, 0x8ee24e34, 0x1062001b, 
-0x24030040, 0x8c820004, 0x24420001, 0xac820004, 
-0x8ee24e34, 0x8ee54e30, 0x24420001, 0x10430007, 
-0x0, 0x8ee24e34, 0x24420001, 0x10a20005, 
-0x0, 0x800118a, 0x0, 0x14a00005, 
-0x0, 0x8f820128, 0x24420020, 0xaf820128, 
-0x8f820128, 0x8c820004, 0x2c420011, 0x50400013, 
-0xac800000, 0x80011a0, 0x0, 0x8ee24e30, 
-0x24030040, 0x24420001, 0x50430003, 0x1021, 
-0x8ee24e30, 0x24420001, 0xaee24e30, 0x8ee24e30, 
-0x210c0, 0x24425038, 0x2e22021, 0x24020007, 
-0xac820000, 0x24020001, 0xac820004, 0x54c0000c, 
-0xaee90608, 0x3c040001, 0x248451c8, 0xafa00010, 
-0xafa00014, 0x8ee60608, 0x8f470228, 0x3c050009, 
-0xc002403, 0x34a5f000, 0x8001223, 0x0, 
-0x8f830120, 0x27623800, 0x24660020, 0xc2102b, 
-0x50400001, 0x27663000, 0x8f820128, 0x10c20004, 
-0x0, 0x8f820124, 0x14c20007, 0x0, 
-0x8ee201a4, 0x3021, 0x24420001, 0xaee201a4, 
-0x8001207, 0x8ee201a4, 0x8ee20608, 0xac62001c, 
-0x8ee404a0, 0x8ee504a4, 0x2462001c, 0xac620008, 
-0x24020008, 0xa462000e, 0x24020011, 0xac620018, 
-0xac640000, 0xac650004, 0x8ee204c4, 0xac620010, 
-0xaf860120, 0x92e24e20, 0x14400037, 0x24060001, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0x8c830000, 0x24020012, 0x1462001f, 0x0, 
-0x8ee34e30, 0x8ee24e34, 0x1062001b, 0x24030040, 
-0x8c820004, 0x24420001, 0xac820004, 0x8ee24e34, 
-0x8ee54e30, 0x24420001, 0x10430007, 0x0, 
-0x8ee24e34, 0x24420001, 0x10a20005, 0x0, 
-0x80011f1, 0x0, 0x14a00005, 0x0, 
-0x8f820128, 0x24420020, 0xaf820128, 0x8f820128, 
-0x8c820004, 0x2c420011, 0x50400013, 0xac800000, 
-0x8001207, 0x0, 0x8ee24e30, 0x24030040, 
-0x24420001, 0x50430003, 0x1021, 0x8ee24e30, 
-0x24420001, 0xaee24e30, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0x24020012, 0xac820000, 
-0x24020001, 0xac820004, 0x14c0001b, 0x0, 
-0x3c040001, 0x248451d0, 0xafa00010, 0xafa00014, 
-0x8ee60608, 0x8f470228, 0x3c050009, 0xc002403, 
-0x34a5f001, 0x8ee201b0, 0x24420001, 0xaee201b0, 
-0x8001223, 0x8ee201b0, 0x3c040001, 0x248451dc, 
-0xafa00014, 0x8ee60608, 0x8f470228, 0x3c050009, 
-0xc002403, 0x34a5f005, 0x8ee201ac, 0x24420001, 
-0xaee201ac, 0x8ee201ac, 0x8ee20160, 0x3c040001, 
-0x248451e8, 0x3405f001, 0x24420001, 0xaee20160, 
-0x8ee20160, 0x3021, 0x3821, 0xafa00010, 
-0xc002403, 0xafa00014, 0x8001238, 0x0, 
-0x3c020001, 0x2442f5a8, 0x21100, 0x21182, 
-0x431025, 0x3c010001, 0xac221278, 0x96e2045a, 
-0x30420003, 0x10400025, 0x3c050fff, 0x8ee204c8, 
-0x34a5ffff, 0x34420a00, 0xaee204c8, 0x8ee304c8, 
-0x3c040001, 0x248451f4, 0x24020001, 0xa2e204ec, 
-0xa2e204ed, 0x3c020002, 0x621825, 0x3c020001, 
-0x2442a390, 0x451024, 0x21082, 0xaee304c8, 
-0x3c030800, 0x431025, 0x3c010001, 0xac221220, 
-0x3c020001, 0x2442add4, 0x451024, 0x21082, 
-0x431025, 0x3c010001, 0xac221280, 0x96e6045a, 
-0x3821, 0x24050011, 0xafa00010, 0xc002403, 
-0xafa00014, 0x8001268, 0x0, 0x3c020001, 
-0x2442a9d4, 0x21100, 0x21182, 0x3c030800, 
-0x431025, 0x3c010001, 0xac221280, 0x96e2046a, 
-0x30420010, 0x14400009, 0x0, 0x96e2047a, 
-0x30420010, 0x10400112, 0x0, 0x96e2046a, 
-0x30420010, 0x10400005, 0x3c020700, 0x96e2047a, 
-0x30420010, 0x14400102, 0x3c020700, 0x34423000, 
-0xafa20018, 0x8ee20608, 0x8f430228, 0x24420001, 
-0x304900ff, 0x512300e2, 0xafa00010, 0x8ee20608, 
-0x210c0, 0x571021, 0x8fa30018, 0x8fa4001c, 
-0xac43060c, 0xac440610, 0x8f870120, 0x27623800, 
-0x24e80020, 0x102102b, 0x50400001, 0x27683000, 
-0x8f820128, 0x11020004, 0x0, 0x8f820124, 
-0x15020007, 0x1021, 0x8ee201a4, 0x3021, 
-0x24420001, 0xaee201a4, 0x80012ea, 0x8ee201a4, 
-0x8ee40608, 0x420c0, 0x801821, 0x8ee40430, 
-0x8ee50434, 0xa32821, 0xa3302b, 0x822021, 
-0x862021, 0xace40000, 0xace50004, 0x8ee30608, 
-0x24020008, 0xa4e2000e, 0x2402000d, 0xace20018, 
-0xace9001c, 0x318c0, 0x2463060c, 0x2e31021, 
-0xace20008, 0x8ee204c4, 0xace20010, 0xaf880120, 
-0x92e24e20, 0x14400037, 0x24060001, 0x8ee24e30, 
-0x210c0, 0x24425038, 0x2e22021, 0x8c830000, 
-0x24020007, 0x1462001f, 0x0, 0x8ee34e30, 
-0x8ee24e34, 0x1062001b, 0x24030040, 0x8c820004, 
-0x24420001, 0xac820004, 0x8ee24e34, 0x8ee54e30, 
-0x24420001, 0x10430007, 0x0, 0x8ee24e34, 
-0x24420001, 0x10a20005, 0x0, 0x80012d4, 
-0x0, 0x14a00005, 0x0, 0x8f820128, 
-0x24420020, 0xaf820128, 0x8f820128, 0x8c820004, 
-0x2c420011, 0x50400013, 0xac800000, 0x80012ea, 
-0x0, 0x8ee24e30, 0x24030040, 0x24420001, 
-0x50430003, 0x1021, 0x8ee24e30, 0x24420001, 
-0xaee24e30, 0x8ee24e30, 0x210c0, 0x24425038, 
-0x2e22021, 0x24020007, 0xac820000, 0x24020001, 
-0xac820004, 0x54c0000c, 0xaee90608, 0x3c040001, 
-0x248451c8, 0xafa00010, 0xafa00014, 0x8ee60608, 
-0x8f470228, 0x3c050009, 0xc002403, 0x34a5f000, 
-0x800136d, 0x0, 0x8f830120, 0x27623800, 
-0x24660020, 0xc2102b, 0x50400001, 0x27663000, 
-0x8f820128, 0x10c20004, 0x0, 0x8f820124, 
-0x14c20007, 0x0, 0x8ee201a4, 0x3021, 
-0x24420001, 0xaee201a4, 0x8001351, 0x8ee201a4, 
-0x8ee20608, 0xac62001c, 0x8ee404a0, 0x8ee504a4, 
-0x2462001c, 0xac620008, 0x24020008, 0xa462000e, 
-0x24020011, 0xac620018, 0xac640000, 0xac650004, 
-0x8ee204c4, 0xac620010, 0xaf860120, 0x92e24e20, 
-0x14400037, 0x24060001, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0x8c830000, 0x24020012, 
-0x1462001f, 0x0, 0x8ee34e30, 0x8ee24e34, 
-0x1062001b, 0x24030040, 0x8c820004, 0x24420001, 
-0xac820004, 0x8ee24e34, 0x8ee54e30, 0x24420001, 
-0x10430007, 0x0, 0x8ee24e34, 0x24420001, 
-0x10a20005, 0x0, 0x800133b, 0x0, 
-0x14a00005, 0x0, 0x8f820128, 0x24420020, 
-0xaf820128, 0x8f820128, 0x8c820004, 0x2c420011, 
-0x50400013, 0xac800000, 0x8001351, 0x0, 
-0x8ee24e30, 0x24030040, 0x24420001, 0x50430003, 
-0x1021, 0x8ee24e30, 0x24420001, 0xaee24e30, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0x24020012, 0xac820000, 0x24020001, 0xac820004, 
-0x14c0001b, 0x0, 0x3c040001, 0x248451d0, 
-0xafa00010, 0xafa00014, 0x8ee60608, 0x8f470228, 
-0x3c050009, 0xc002403, 0x34a5f001, 0x8ee201b0, 
-0x24420001, 0xaee201b0, 0x800136d, 0x8ee201b0, 
-0x3c040001, 0x248451dc, 0xafa00014, 0x8ee60608, 
-0x8f470228, 0x3c050009, 0xc002403, 0x34a5f005, 
-0x8ee201ac, 0x24420001, 0xaee201ac, 0x8ee201ac, 
-0x8ee20160, 0x3c040001, 0x248451e8, 0x3405f002, 
-0x24420001, 0xaee20160, 0x8ee20160, 0x3021, 
-0x3821, 0xafa00010, 0xc002403, 0xafa00014, 
-0x96e6047a, 0x96e7046a, 0x3c040001, 0x24845200, 
-0x24050012, 0xafa00010, 0xc002403, 0xafa00014, 
-0xc004500, 0x0, 0xc002318, 0x0, 
-0x3c060001, 0x34c63800, 0xaee00608, 0xaf400228, 
-0xaf40022c, 0x96e30458, 0x8ee40000, 0x3c0512d8, 
-0x34a5c358, 0x27623800, 0xaee27258, 0x27623800, 
-0xaee27260, 0x27623800, 0xaee27264, 0x3661021, 
-0xaee27270, 0x2402ffff, 0xaee004d4, 0xaee004e0, 
-0xaee004e4, 0xaee004f0, 0xa2e004f4, 0xaee00e0c, 
-0xaee00e18, 0xaee00e10, 0xaee00e14, 0xaee00e1c, 
-0xaee0724c, 0xaee05244, 0xaee05240, 0xaee0523c, 
-0xaee07250, 0xaee07254, 0xaee0725c, 0xaee07268, 
-0xaee004d0, 0x2463ffff, 0x852025, 0xaee304f8, 
-0xaee40000, 0xaf800060, 0xaf820064, 0x3c020100, 
-0xafa20018, 0x8ee20608, 0x8f430228, 0x24420001, 
-0x304900ff, 0x512300e2, 0xafa00010, 0x8ee20608, 
-0x210c0, 0x571021, 0x8fa30018, 0x8fa4001c, 
-0xac43060c, 0xac440610, 0x8f870120, 0x27623800, 
-0x24e80020, 0x102102b, 0x50400001, 0x27683000, 
-0x8f820128, 0x11020004, 0x0, 0x8f820124, 
-0x15020007, 0x1021, 0x8ee201a4, 0x3021, 
-0x24420001, 0xaee201a4, 0x8001422, 0x8ee201a4, 
-0x8ee40608, 0x420c0, 0x801821, 0x8ee40430, 
-0x8ee50434, 0xa32821, 0xa3302b, 0x822021, 
-0x862021, 0xace40000, 0xace50004, 0x8ee30608, 
-0x24020008, 0xa4e2000e, 0x2402000d, 0xace20018, 
-0xace9001c, 0x318c0, 0x2463060c, 0x2e31021, 
-0xace20008, 0x8ee204c4, 0xace20010, 0xaf880120, 
-0x92e24e20, 0x14400037, 0x24060001, 0x8ee24e30, 
-0x210c0, 0x24425038, 0x2e22021, 0x8c830000, 
-0x24020007, 0x1462001f, 0x0, 0x8ee34e30, 
-0x8ee24e34, 0x1062001b, 0x24030040, 0x8c820004, 
-0x24420001, 0xac820004, 0x8ee24e34, 0x8ee54e30, 
-0x24420001, 0x10430007, 0x0, 0x8ee24e34, 
-0x24420001, 0x10a20005, 0x0, 0x800140c, 
-0x0, 0x14a00005, 0x0, 0x8f820128, 
-0x24420020, 0xaf820128, 0x8f820128, 0x8c820004, 
-0x2c420011, 0x50400013, 0xac800000, 0x8001422, 
-0x0, 0x8ee24e30, 0x24030040, 0x24420001, 
-0x50430003, 0x1021, 0x8ee24e30, 0x24420001, 
-0xaee24e30, 0x8ee24e30, 0x210c0, 0x24425038, 
-0x2e22021, 0x24020007, 0xac820000, 0x24020001, 
-0xac820004, 0x54c0000c, 0xaee90608, 0x3c040001, 
-0x248451c8, 0xafa00010, 0xafa00014, 0x8ee60608, 
-0x8f470228, 0x3c050009, 0xc002403, 0x34a5f000, 
-0x80014a5, 0x0, 0x8f830120, 0x27623800, 
-0x24660020, 0xc2102b, 0x50400001, 0x27663000, 
-0x8f820128, 0x10c20004, 0x0, 0x8f820124, 
-0x14c20007, 0x0, 0x8ee201a4, 0x3021, 
-0x24420001, 0xaee201a4, 0x8001489, 0x8ee201a4, 
-0x8ee20608, 0xac62001c, 0x8ee404a0, 0x8ee504a4, 
-0x2462001c, 0xac620008, 0x24020008, 0xa462000e, 
-0x24020011, 0xac620018, 0xac640000, 0xac650004, 
-0x8ee204c4, 0xac620010, 0xaf860120, 0x92e24e20, 
-0x14400037, 0x24060001, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0x8c830000, 0x24020012, 
-0x1462001f, 0x0, 0x8ee34e30, 0x8ee24e34, 
-0x1062001b, 0x24030040, 0x8c820004, 0x24420001, 
-0xac820004, 0x8ee24e34, 0x8ee54e30, 0x24420001, 
-0x10430007, 0x0, 0x8ee24e34, 0x24420001, 
-0x10a20005, 0x0, 0x8001473, 0x0, 
-0x14a00005, 0x0, 0x8f820128, 0x24420020, 
-0xaf820128, 0x8f820128, 0x8c820004, 0x2c420011, 
-0x50400013, 0xac800000, 0x8001489, 0x0, 
-0x8ee24e30, 0x24030040, 0x24420001, 0x50430003, 
-0x1021, 0x8ee24e30, 0x24420001, 0xaee24e30, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0x24020012, 0xac820000, 0x24020001, 0xac820004, 
-0x14c0001b, 0x0, 0x3c040001, 0x248451d0, 
-0xafa00010, 0xafa00014, 0x8ee60608, 0x8f470228, 
-0x3c050009, 0xc002403, 0x34a5f001, 0x8ee201b0, 
-0x24420001, 0xaee201b0, 0x80014a5, 0x8ee201b0, 
-0x3c040001, 0x248451dc, 0xafa00014, 0x8ee60608, 
-0x8f470228, 0x3c050009, 0xc002403, 0x34a5f005, 
-0x8ee201ac, 0x24420001, 0xaee201ac, 0x8ee201ac, 
-0x8ee20154, 0x24420001, 0xaee20154, 0xc0014dc, 
-0x8ee20154, 0x8f8200a0, 0x30420004, 0x1440fffd, 
-0x0, 0x8f820040, 0x30420001, 0x14400008, 
-0x0, 0x8f430104, 0x24020001, 0x10620004, 
-0x0, 0x8f420264, 0x10400006, 0x0, 
-0x8ee2017c, 0x24420001, 0xaee2017c, 0x80014c5, 
-0x8ee2017c, 0x8f820044, 0x34420004, 0xaf820044, 
-0x8ee20178, 0x24420001, 0xaee20178, 0x8ee20178, 
-0x8f8200d8, 0x8f8300d4, 0x431023, 0xaee2726c, 
-0x8ee2726c, 0x1c400003, 0x3c030001, 0x431021, 
-0xaee2726c, 0xc004064, 0x0, 0xc004440, 
-0xaf800228, 0x8fbf0024, 0x8fb00020, 0x3e00008, 
-0x27bd0028, 0x3e00008, 0x0, 0x3e00008, 
-0x0, 0x0, 0x0, 0x2402002c, 
-0xaf820050, 0xaee07274, 0x8f420238, 0xaee27278, 
-0x8f820054, 0x24420067, 0xaf820058, 0xaee07b88, 
-0xaee07b8c, 0xaee07b84, 0x3c010001, 0x370821, 
-0xac2083bc, 0x3c010001, 0x370821, 0x3e00008, 
-0xa02083b9, 0x27bdffd8, 0xafbf0024, 0xafb00020, 
-0x8f820054, 0x3c030001, 0x8c635cd8, 0x24420067, 
-0x1060000d, 0xaf820058, 0x3c020001, 0x571021, 
-0x904283b8, 0x10400005, 0x3c030200, 0x3c010001, 
-0x370821, 0x8001503, 0xa02083b8, 0x8ee20000, 
-0x431025, 0xaee20000, 0x8f420218, 0x30420100, 
-0x104000c6, 0x0, 0x8f8200b0, 0x30420004, 
-0x104000c2, 0x0, 0x3c030001, 0x771821, 
-0x8c6383d0, 0x8f820104, 0x146200b4, 0x0, 
-0x3c030001, 0x771821, 0x8c6383d4, 0x8f8200b4, 
-0x146200ae, 0x0, 0x8f8200b0, 0x3c030080, 
-0x431024, 0x1040000d, 0x0, 0x8f82011c, 
-0x34420002, 0xaf82011c, 0x8f8200b0, 0x2403fffb, 
-0x431024, 0xaf8200b0, 0x8f82011c, 0x2403fffd, 
-0x431024, 0x80015cc, 0xaf82011c, 0x3c030001, 
-0x771821, 0x8c6383d0, 0x8f820104, 0x14620082, 
-0x0, 0x3c030001, 0x771821, 0x8c6383d4, 
-0x8f8200b4, 0x1462007c, 0x0, 0x3c070001, 
-0xf73821, 0x8ce783d0, 0x8f8200b0, 0x3c040001, 
-0x24845270, 0xafa00014, 0xafa20010, 0x8f8600b0, 
-0x3c050005, 0xc002403, 0x34a50900, 0x8f82011c, 
-0x34420002, 0xaf82011c, 0x8f830104, 0x8f8200b0, 
-0x34420001, 0xaf8200b0, 0xaf830104, 0x8f830120, 
-0x27623800, 0x24660020, 0xc2102b, 0x50400001, 
-0x27663000, 0x8f820128, 0x10c20004, 0x0, 
-0x8f820124, 0x14c20006, 0x0, 0x8ee201a4, 
-0x24420001, 0xaee201a4, 0x80015a0, 0x8ee201a4, 
-0x8f440208, 0x8f45020c, 0x26e20030, 0xac620008, 
-0x24020400, 0xa462000e, 0x2402000f, 0xac620018, 
-0xac60001c, 0xac640000, 0xac650004, 0x8ee204c4, 
-0xac620010, 0xaf860120, 0x92e24e20, 0x14400037, 
-0x0, 0x8ee24e30, 0x210c0, 0x24425038, 
-0x2e22021, 0x8c830000, 0x24020007, 0x1462001f, 
-0x0, 0x8ee34e30, 0x8ee24e34, 0x1062001b, 
-0x24030040, 0x8c820004, 0x24420001, 0xac820004, 
-0x8ee24e34, 0x8ee54e30, 0x24420001, 0x10430007, 
-0x0, 0x8ee24e34, 0x24420001, 0x10a20005, 
-0x0, 0x800158a, 0x0, 0x14a00005, 
-0x0, 0x8f820128, 0x24420020, 0xaf820128, 
-0x8f820128, 0x8c820004, 0x2c420011, 0x50400013, 
-0xac800000, 0x80015a0, 0x0, 0x8ee24e30, 
-0x24030040, 0x24420001, 0x50430003, 0x1021, 
-0x8ee24e30, 0x24420001, 0xaee24e30, 0x8ee24e30, 
-0x210c0, 0x24425038, 0x2e22021, 0x24020007, 
-0xac820000, 0x24020001, 0xac820004, 0x8f82011c, 
-0x2403fffd, 0x431024, 0xaf82011c, 0x8ee201e4, 
-0x3c070001, 0xf73821, 0x8ce783d0, 0x24420001, 
-0xaee201e4, 0x8ee201e4, 0x3c040001, 0x2484527c, 
-0x80015bd, 0xafa00010, 0x8f820104, 0x3c010001, 
-0x370821, 0xac2283d0, 0x8f8200b4, 0x3c070001, 
-0xf73821, 0x8ce783d0, 0x3c040001, 0x24845284, 
-0x3c010001, 0x370821, 0xac2283d4, 0xafa00010, 
-0xafa00014, 0x8f8600b0, 0x3c050005, 0xc002403, 
-0x34a50900, 0x80015cc, 0x0, 0x8f820104, 
-0x3c010001, 0x370821, 0xac2283d0, 0x8f8200b4, 
-0x3c010001, 0x370821, 0xac2283d4, 0x8ee27274, 
-0x92e304f4, 0x24420067, 0x14600006, 0xaee27274, 
-0x8ee27274, 0x8f430234, 0x43102b, 0x1440007b, 
-0x0, 0x8ee304e4, 0x8ee204f8, 0x14620004, 
-0x0, 0x92e204f4, 0x50400074, 0xa2e004f4, 
-0x8f830120, 0x27623800, 0x24660020, 0xc2102b, 
-0x50400001, 0x27663000, 0x8f820128, 0x10c20004, 
-0x0, 0x8f820124, 0x14c20007, 0x0, 
-0x8ee201a4, 0x8021, 0x24420001, 0xaee201a4, 
-0x8001637, 0x8ee201a4, 0x8ee204e4, 0xac62001c, 
-0x8ee404b0, 0x8ee504b4, 0x2462001c, 0xac620008, 
-0x24020008, 0xa462000e, 0x24020011, 0xac620018, 
-0xac640000, 0xac650004, 0x8ee204c4, 0xac620010, 
-0xaf860120, 0x92e24e20, 0x14400037, 0x24100001, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0x8c830000, 0x24020012, 0x1462001f, 0x0, 
-0x8ee34e30, 0x8ee24e34, 0x1062001b, 0x24030040, 
-0x8c820004, 0x24420001, 0xac820004, 0x8ee24e34, 
-0x8ee54e30, 0x24420001, 0x10430007, 0x0, 
-0x8ee24e34, 0x24420001, 0x10a20005, 0x0, 
-0x8001621, 0x0, 0x14a00005, 0x0, 
-0x8f820128, 0x24420020, 0xaf820128, 0x8f820128, 
-0x8c820004, 0x2c420011, 0x50400013, 0xac800000, 
-0x8001637, 0x0, 0x8ee24e30, 0x24030040, 
-0x24420001, 0x50430003, 0x1021, 0x8ee24e30, 
-0x24420001, 0xaee24e30, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0x24020012, 0xac820000, 
-0x24020001, 0xac820004, 0x5600000b, 0x24100001, 
-0x8ee204e4, 0x3c040001, 0x2484528c, 0xafa00014, 
-0xafa20010, 0x8ee60608, 0x8f470228, 0x3c050009, 
-0xc002403, 0x34a5f006, 0x16000003, 0x24020001, 
-0x8001650, 0xa2e204f4, 0x8ee20170, 0x24420001, 
-0xaee20170, 0x8ee20170, 0x8ee204e4, 0xa2e004f4, 
-0xaee004f0, 0xaee07274, 0xaee204f8, 0x8ee20e1c, 
-0x1040006d, 0x0, 0x8f830120, 0x27623800, 
-0x24660020, 0xc2102b, 0x50400001, 0x27663000, 
-0x8f820128, 0x10c20004, 0x0, 0x8f820124, 
-0x14c20007, 0x0, 0x8ee201a4, 0x8021, 
-0x24420001, 0xaee201a4, 0x80016ad, 0x8ee201a4, 
-0x8ee2724c, 0xac62001c, 0x8ee404a8, 0x8ee504ac, 
-0x2462001c, 0xac620008, 0x24020008, 0xa462000e, 
-0x24020011, 0xac620018, 0xac640000, 0xac650004, 
-0x8ee204c4, 0xac620010, 0xaf860120, 0x92e24e20, 
-0x14400037, 0x24100001, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0x8c830000, 0x24020012, 
-0x1462001f, 0x0, 0x8ee34e30, 0x8ee24e34, 
-0x1062001b, 0x24030040, 0x8c820004, 0x24420001, 
-0xac820004, 0x8ee24e34, 0x8ee54e30, 0x24420001, 
-0x10430007, 0x0, 0x8ee24e34, 0x24420001, 
-0x10a20005, 0x0, 0x8001697, 0x0, 
-0x14a00005, 0x0, 0x8f820128, 0x24420020, 
-0xaf820128, 0x8f820128, 0x8c820004, 0x2c420011, 
-0x50400013, 0xac800000, 0x80016ad, 0x0, 
-0x8ee24e30, 0x24030040, 0x24420001, 0x50430003, 
-0x1021, 0x8ee24e30, 0x24420001, 0xaee24e30, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0x24020012, 0xac820000, 0x24020001, 0xac820004, 
-0x5600000b, 0x24100001, 0x8ee2724c, 0x3c040001, 
-0x24845298, 0xafa00014, 0xafa20010, 0x8ee6724c, 
-0x8f470280, 0x3c050009, 0xc002403, 0x34a5f008, 
-0x56000001, 0xaee00e1c, 0x8ee20174, 0x24420001, 
-0xaee20174, 0x8ee20174, 0x8ee24e24, 0x10400019, 
-0x0, 0xaee04e24, 0x8f820040, 0x30420001, 
-0x14400008, 0x0, 0x8f430104, 0x24020001, 
-0x10620004, 0x0, 0x8f420264, 0x10400006, 
-0x0, 0x8ee2017c, 0x24420001, 0xaee2017c, 
-0x80016da, 0x8ee2017c, 0x8f820044, 0x34420004, 
-0xaf820044, 0x8ee20178, 0x24420001, 0xaee20178, 
-0x8ee20178, 0x8ee27278, 0x2442ff99, 0xaee27278, 
-0x8ee27278, 0x1c4002ad, 0x0, 0x8f420238, 
-0x104002aa, 0x0, 0x3c020001, 0x571021, 
-0x904283e0, 0x144002a5, 0x0, 0x8f420080, 
-0xaee2004c, 0x8f4200c0, 0xaee20048, 0x8f420084, 
-0xaee20038, 0x8f420084, 0xaee20244, 0x8f420088, 
-0xaee20248, 0x8f42008c, 0xaee2024c, 0x8f420090, 
-0xaee20250, 0x8f420094, 0xaee20254, 0x8f420098, 
-0xaee20258, 0x8f42009c, 0xaee2025c, 0x8f4200a0, 
-0xaee20260, 0x8f4200a4, 0xaee20264, 0x8f4200a8, 
-0xaee20268, 0x8f4200ac, 0xaee2026c, 0x8f4200b0, 
-0xaee20270, 0x8f4200b4, 0xaee20274, 0x8f4200b8, 
-0xaee20278, 0x8f4200bc, 0x24040001, 0xaee2027c, 
-0xaee0003c, 0x41080, 0x571021, 0x8ee3003c, 
-0x8c420244, 0x24840001, 0x621821, 0x2c82000f, 
-0xaee3003c, 0x1440fff8, 0x41080, 0x8f4200cc, 
-0xaee20050, 0x8f4200d0, 0xaee20054, 0x8f830120, 
-0x27623800, 0x24660020, 0xc2102b, 0x50400001, 
-0x27663000, 0x8f820128, 0x10c20004, 0x0, 
-0x8f820124, 0x14c20007, 0x0, 0x8ee201a4, 
-0x8021, 0x24420001, 0xaee201a4, 0x8001775, 
-0x8ee201a4, 0x8f440208, 0x8f45020c, 0x26e20030, 
-0xac620008, 0x24020400, 0xa462000e, 0x2402000f, 
-0xac620018, 0xac60001c, 0xac640000, 0xac650004, 
-0x8ee204c4, 0xac620010, 0xaf860120, 0x92e24e20, 
-0x14400037, 0x24100001, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0x8c830000, 0x24020007, 
-0x1462001f, 0x0, 0x8ee34e30, 0x8ee24e34, 
-0x1062001b, 0x24030040, 0x8c820004, 0x24420001, 
-0xac820004, 0x8ee24e34, 0x8ee54e30, 0x24420001, 
-0x10430007, 0x0, 0x8ee24e34, 0x24420001, 
-0x10a20005, 0x0, 0x800175f, 0x0, 
-0x14a00005, 0x0, 0x8f820128, 0x24420020, 
-0xaf820128, 0x8f820128, 0x8c820004, 0x2c420011, 
-0x50400013, 0xac800000, 0x8001775, 0x0, 
-0x8ee24e30, 0x24030040, 0x24420001, 0x50430003, 
-0x1021, 0x8ee24e30, 0x24420001, 0xaee24e30, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0x24020007, 0xac820000, 0x24020001, 0xac820004, 
-0x12000212, 0x3c020400, 0xafa20018, 0x3c020001, 
-0x571021, 0x904283b0, 0x1040010b, 0x0, 
-0x8ee20608, 0x8f430228, 0x24420001, 0x304a00ff, 
-0x514300fd, 0xafa00010, 0x8ee20608, 0x210c0, 
-0x571021, 0x8fa30018, 0x8fa4001c, 0xac43060c, 
-0xac440610, 0x8f830054, 0x8f820054, 0x24690032, 
-0x1221023, 0x2c420033, 0x1040006a, 0x5821, 
-0x24180008, 0x240f000d, 0x240d0007, 0x240c0040, 
-0x240e0001, 0x8f870120, 0x27623800, 0x24e80020, 
-0x102102b, 0x50400001, 0x27683000, 0x8f820128, 
-0x11020004, 0x0, 0x8f820124, 0x15020007, 
-0x1021, 0x8ee201a4, 0x8021, 0x24420001, 
-0xaee201a4, 0x80017f3, 0x8ee201a4, 0x8ee40608, 
-0x420c0, 0x801821, 0x8ee40430, 0x8ee50434, 
-0xa32821, 0xa3302b, 0x822021, 0x862021, 
-0xace40000, 0xace50004, 0x8ee20608, 0xa4f8000e, 
-0xacef0018, 0xacea001c, 0x210c0, 0x2442060c, 
-0x2e21021, 0xace20008, 0x8ee204c4, 0xace20010, 
-0xaf880120, 0x92e24e20, 0x14400033, 0x24100001, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0x8c820000, 0x144d001f, 0x0, 0x8ee34e30, 
-0x8ee24e34, 0x1062001b, 0x0, 0x8c820004, 
-0x24420001, 0xac820004, 0x8ee24e34, 0x8ee34e30, 
-0x24420001, 0x104c0007, 0x0, 0x8ee24e34, 
-0x24420001, 0x10620005, 0x0, 0x80017e0, 
-0x0, 0x14600005, 0x0, 0x8f820128, 
-0x24420020, 0xaf820128, 0x8f820128, 0x8c820004, 
-0x2c420011, 0x50400010, 0xac800000, 0x80017f3, 
-0x0, 0x8ee24e30, 0x24420001, 0x504c0003, 
-0x1021, 0x8ee24e30, 0x24420001, 0xaee24e30, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0xac8d0000, 0xac8e0004, 0x56000006, 0x240b0001, 
-0x8f820054, 0x1221023, 0x2c420033, 0x1440ff9d, 
-0x0, 0x316300ff, 0x24020001, 0x14620077, 
-0x3c050009, 0xaeea0608, 0x8f830054, 0x8f820054, 
-0x24690032, 0x1221023, 0x2c420033, 0x10400061, 
-0x5821, 0x240d0008, 0x240c0011, 0x24080012, 
-0x24070040, 0x240a0001, 0x8f830120, 0x27623800, 
-0x24660020, 0xc2102b, 0x50400001, 0x27663000, 
-0x8f820128, 0x10c20004, 0x0, 0x8f820124, 
-0x14c20007, 0x0, 0x8ee201a4, 0x8021, 
-0x24420001, 0xaee201a4, 0x800185f, 0x8ee201a4, 
-0x8ee20608, 0xac62001c, 0x8ee404a0, 0x8ee504a4, 
-0x2462001c, 0xac620008, 0xa46d000e, 0xac6c0018, 
-0xac640000, 0xac650004, 0x8ee204c4, 0xac620010, 
-0xaf860120, 0x92e24e20, 0x14400033, 0x24100001, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0x8c820000, 0x1448001f, 0x0, 0x8ee34e30, 
-0x8ee24e34, 0x1062001b, 0x0, 0x8c820004, 
-0x24420001, 0xac820004, 0x8ee24e34, 0x8ee34e30, 
-0x24420001, 0x10470007, 0x0, 0x8ee24e34, 
-0x24420001, 0x10620005, 0x0, 0x800184c, 
-0x0, 0x14600005, 0x0, 0x8f820128, 
-0x24420020, 0xaf820128, 0x8f820128, 0x8c820004, 
-0x2c420011, 0x50400010, 0xac800000, 0x800185f, 
-0x0, 0x8ee24e30, 0x24420001, 0x50470003, 
-0x1021, 0x8ee24e30, 0x24420001, 0xaee24e30, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0xac880000, 0xac8a0004, 0x56000006, 0x240b0001, 
-0x8f820054, 0x1221023, 0x2c420033, 0x1440ffa6, 
-0x0, 0x316300ff, 0x24020001, 0x14620003, 
-0x3c050009, 0x800197c, 0x24100001, 0x3c040001, 
-0x248452a4, 0xafa00010, 0xafa00014, 0x8f860120, 
-0x8f870124, 0x800187b, 0x34a5f011, 0x3c040001, 
-0x248452b0, 0xafa00010, 0xafa00014, 0x8f860120, 
-0x8f870124, 0x34a5f010, 0xc002403, 0x8021, 
-0x800197c, 0x0, 0x3c040001, 0x248452bc, 
-0xafa00014, 0x8ee60608, 0x8f470228, 0x3c050009, 
-0x8001975, 0x34a5f00f, 0x8ee20608, 0x8f430228, 
-0x24420001, 0x304900ff, 0x512300e2, 0xafa00010, 
-0x8ee20608, 0x210c0, 0x571021, 0x8fa30018, 
-0x8fa4001c, 0xac43060c, 0xac440610, 0x8f870120, 
-0x27623800, 0x24e80020, 0x102102b, 0x50400001, 
-0x27683000, 0x8f820128, 0x11020004, 0x0, 
-0x8f820124, 0x15020007, 0x1021, 0x8ee201a4, 
-0x8021, 0x24420001, 0xaee201a4, 0x80018f7, 
-0x8ee201a4, 0x8ee40608, 0x420c0, 0x801821, 
-0x8ee40430, 0x8ee50434, 0xa32821, 0xa3302b, 
-0x822021, 0x862021, 0xace40000, 0xace50004, 
-0x8ee30608, 0x24020008, 0xa4e2000e, 0x2402000d, 
-0xace20018, 0xace9001c, 0x318c0, 0x2463060c, 
-0x2e31021, 0xace20008, 0x8ee204c4, 0xace20010, 
-0xaf880120, 0x92e24e20, 0x14400037, 0x24100001, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0x8c830000, 0x24020007, 0x1462001f, 0x0, 
-0x8ee34e30, 0x8ee24e34, 0x1062001b, 0x24030040, 
-0x8c820004, 0x24420001, 0xac820004, 0x8ee24e34, 
-0x8ee54e30, 0x24420001, 0x10430007, 0x0, 
-0x8ee24e34, 0x24420001, 0x10a20005, 0x0, 
-0x80018e1, 0x0, 0x14a00005, 0x0, 
-0x8f820128, 0x24420020, 0xaf820128, 0x8f820128, 
-0x8c820004, 0x2c420011, 0x50400013, 0xac800000, 
-0x80018f7, 0x0, 0x8ee24e30, 0x24030040, 
-0x24420001, 0x50430003, 0x1021, 0x8ee24e30, 
-0x24420001, 0xaee24e30, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0x24020007, 0xac820000, 
-0x24020001, 0xac820004, 0x5600000c, 0xaee90608, 
-0x3c040001, 0x248452c8, 0xafa00010, 0xafa00014, 
-0x8ee60608, 0x8f470228, 0x3c050009, 0xc002403, 
-0x34a5f000, 0x800197c, 0x0, 0x8f830120, 
-0x27623800, 0x24660020, 0xc2102b, 0x50400001, 
-0x27663000, 0x8f820128, 0x10c20004, 0x0, 
-0x8f820124, 0x14c20007, 0x0, 0x8ee201a4, 
-0x8021, 0x24420001, 0xaee201a4, 0x800195e, 
-0x8ee201a4, 0x8ee20608, 0xac62001c, 0x8ee404a0, 
-0x8ee504a4, 0x2462001c, 0xac620008, 0x24020008, 
-0xa462000e, 0x24020011, 0xac620018, 0xac640000, 
-0xac650004, 0x8ee204c4, 0xac620010, 0xaf860120, 
-0x92e24e20, 0x14400037, 0x24100001, 0x8ee24e30, 
-0x210c0, 0x24425038, 0x2e22021, 0x8c830000, 
-0x24020012, 0x1462001f, 0x0, 0x8ee34e30, 
-0x8ee24e34, 0x1062001b, 0x24030040, 0x8c820004, 
-0x24420001, 0xac820004, 0x8ee24e34, 0x8ee54e30, 
-0x24420001, 0x10430007, 0x0, 0x8ee24e34, 
-0x24420001, 0x10a20005, 0x0, 0x8001948, 
-0x0, 0x14a00005, 0x0, 0x8f820128, 
-0x24420020, 0xaf820128, 0x8f820128, 0x8c820004, 
-0x2c420011, 0x50400013, 0xac800000, 0x800195e, 
-0x0, 0x8ee24e30, 0x24030040, 0x24420001, 
-0x50430003, 0x1021, 0x8ee24e30, 0x24420001, 
-0xaee24e30, 0x8ee24e30, 0x210c0, 0x24425038, 
-0x2e22021, 0x24020012, 0xac820000, 0x24020001, 
-0xac820004, 0x5600001d, 0x24100001, 0x3c040001, 
-0x248452d0, 0xafa00010, 0xafa00014, 0x8ee60608, 
-0x8f470228, 0x3c050009, 0xc002403, 0x34a5f001, 
-0x8ee201b0, 0x24420001, 0xaee201b0, 0x800197c, 
-0x8ee201b0, 0x3c040001, 0x248452dc, 0xafa00014, 
-0x8ee60608, 0x8f470228, 0x3c050009, 0x34a5f005, 
-0xc002403, 0x0, 0x8ee201ac, 0x8021, 
-0x24420001, 0xaee201ac, 0x8ee201ac, 0x1200000c, 
-0x24020001, 0x3c010001, 0x370821, 0xa02083b0, 
-0x8f420238, 0x8ee30158, 0x24630001, 0xaee30158, 
-0x8ee30158, 0x800198c, 0xaee27278, 0x24020001, 
-0x3c010001, 0x370821, 0xa02283b0, 0x3c020001, 
-0x8c425cd8, 0x10400187, 0x0, 0x8ee27b84, 
-0x24430001, 0x284200c9, 0x144001a4, 0xaee37b84, 
-0x8ee204d4, 0x30420002, 0x14400119, 0xaee07b84, 
-0x8ee204d4, 0x3c030600, 0x34631000, 0x34420002, 
-0xaee204d4, 0xafa30018, 0x8ee20608, 0x8f430228, 
-0x24420001, 0x304a00ff, 0x514300fd, 0xafa00010, 
-0x8ee20608, 0x210c0, 0x571021, 0x8fa30018, 
-0x8fa4001c, 0xac43060c, 0xac440610, 0x8f830054, 
-0x8f820054, 0x24690032, 0x1221023, 0x2c420033, 
-0x1040006a, 0x5821, 0x24180008, 0x240f000d, 
-0x240d0007, 0x240c0040, 0x240e0001, 0x8f870120, 
-0x27623800, 0x24e80020, 0x102102b, 0x50400001, 
-0x27683000, 0x8f820128, 0x11020004, 0x0, 
-0x8f820124, 0x15020007, 0x1021, 0x8ee201a4, 
-0x8021, 0x24420001, 0xaee201a4, 0x8001a15, 
-0x8ee201a4, 0x8ee40608, 0x420c0, 0x801821, 
-0x8ee40430, 0x8ee50434, 0xa32821, 0xa3302b, 
-0x822021, 0x862021, 0xace40000, 0xace50004, 
-0x8ee20608, 0xa4f8000e, 0xacef0018, 0xacea001c, 
-0x210c0, 0x2442060c, 0x2e21021, 0xace20008, 
-0x8ee204c4, 0xace20010, 0xaf880120, 0x92e24e20, 
-0x14400033, 0x24100001, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0x8c820000, 0x144d001f, 
-0x0, 0x8ee34e30, 0x8ee24e34, 0x1062001b, 
-0x0, 0x8c820004, 0x24420001, 0xac820004, 
-0x8ee24e34, 0x8ee34e30, 0x24420001, 0x104c0007, 
-0x0, 0x8ee24e34, 0x24420001, 0x10620005, 
-0x0, 0x8001a02, 0x0, 0x14600005, 
-0x0, 0x8f820128, 0x24420020, 0xaf820128, 
-0x8f820128, 0x8c820004, 0x2c420011, 0x50400010, 
-0xac800000, 0x8001a15, 0x0, 0x8ee24e30, 
-0x24420001, 0x504c0003, 0x1021, 0x8ee24e30, 
-0x24420001, 0xaee24e30, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0xac8d0000, 0xac8e0004, 
-0x56000006, 0x240b0001, 0x8f820054, 0x1221023, 
-0x2c420033, 0x1440ff9d, 0x0, 0x316300ff, 
-0x24020001, 0x54620078, 0xafa00010, 0xaeea0608, 
-0x8f830054, 0x8f820054, 0x24690032, 0x1221023, 
-0x2c420033, 0x10400061, 0x5821, 0x240d0008, 
-0x240c0011, 0x24080012, 0x24070040, 0x240a0001, 
-0x8f830120, 0x27623800, 0x24660020, 0xc2102b, 
-0x50400001, 0x27663000, 0x8f820128, 0x10c20004, 
-0x0, 0x8f820124, 0x14c20007, 0x0, 
-0x8ee201a4, 0x8021, 0x24420001, 0xaee201a4, 
-0x8001a81, 0x8ee201a4, 0x8ee20608, 0xac62001c, 
-0x8ee404a0, 0x8ee504a4, 0x2462001c, 0xac620008, 
-0xa46d000e, 0xac6c0018, 0xac640000, 0xac650004, 
-0x8ee204c4, 0xac620010, 0xaf860120, 0x92e24e20, 
-0x14400033, 0x24100001, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0x8c820000, 0x1448001f, 
-0x0, 0x8ee34e30, 0x8ee24e34, 0x1062001b, 
-0x0, 0x8c820004, 0x24420001, 0xac820004, 
-0x8ee24e34, 0x8ee34e30, 0x24420001, 0x10470007, 
-0x0, 0x8ee24e34, 0x24420001, 0x10620005, 
-0x0, 0x8001a6e, 0x0, 0x14600005, 
-0x0, 0x8f820128, 0x24420020, 0xaf820128, 
-0x8f820128, 0x8c820004, 0x2c420011, 0x50400010, 
-0xac800000, 0x8001a81, 0x0, 0x8ee24e30, 
-0x24420001, 0x50470003, 0x1021, 0x8ee24e30, 
-0x24420001, 0xaee24e30, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0xac880000, 0xac8a0004, 
-0x56000006, 0x240b0001, 0x8f820054, 0x1221023, 
-0x2c420033, 0x1440ffa6, 0x0, 0x316300ff, 
-0x24020001, 0x10620022, 0x0, 0x3c040001, 
-0x248452a4, 0xafa00010, 0xafa00014, 0x8f860120, 
-0x8f870124, 0x3c050009, 0xc002403, 0x34a5f011, 
-0x8001aad, 0x0, 0x3c040001, 0x248452b0, 
-0xafa00014, 0x8f860120, 0x8f870124, 0x3c050009, 
-0xc002403, 0x34a5f010, 0x8001aad, 0x0, 
-0x3c040001, 0x248452bc, 0xafa00014, 0x8ee60608, 
-0x8f470228, 0x3c050009, 0xc002403, 0x34a5f00f, 
-0x8ee201ac, 0x24420001, 0xaee201ac, 0x8ee201ac, 
-0x8ee2015c, 0x24420001, 0xaee2015c, 0x8ee2015c, 
-0x8ee204d4, 0x30420001, 0x10400055, 0x0, 
-0x8f420218, 0x30420080, 0x10400029, 0x0, 
-0x8f820044, 0x34420040, 0xaf820044, 0x8ee27b7c, 
-0x402821, 0x8ee200c0, 0x8ee300c4, 0x24060000, 
-0x2407ffff, 0x2021, 0x461024, 0x1444000d, 
-0x671824, 0x1465000b, 0x0, 0x8ee27b80, 
-0x402821, 0x8ee200e0, 0x8ee300e4, 0x2021, 
-0x461024, 0x14440003, 0x671824, 0x1065000b, 
-0x0, 0x8ee200c0, 0x8ee300c4, 0x8ee400e0, 
-0x8ee500e4, 0xaee37b7c, 0xaee57b80, 0x8f820044, 
-0x38420020, 0x8001b38, 0xaf820044, 0x8f820044, 
-0x2403ffdf, 0x431024, 0x8001b38, 0xaf820044, 
-0x8f820044, 0x2403ffdf, 0x431024, 0xaf820044, 
-0x8ee27b7c, 0x402821, 0x8ee200c0, 0x8ee300c4, 
-0x24060000, 0x2407ffff, 0x2021, 0x461024, 
-0x1444000d, 0x671824, 0x1465000b, 0x0, 
-0x8ee27b80, 0x402821, 0x8ee200e0, 0x8ee300e4, 
-0x2021, 0x461024, 0x14440003, 0x671824, 
-0x1065000b, 0x0, 0x8ee200c0, 0x8ee300c4, 
-0x8ee400e0, 0x8ee500e4, 0xaee37b7c, 0xaee57b80, 
-0x8f820044, 0x38420040, 0x8001b38, 0xaf820044, 
-0x8f820044, 0x34420040, 0x8001b38, 0xaf820044, 
-0x8f820044, 0x34420040, 0xaf820044, 0x8ee27b8c, 
-0x24430001, 0x28420015, 0x14400028, 0xaee37b8c, 
-0x8f820044, 0x38420020, 0xaf820044, 0x8001b38, 
-0xaee07b8c, 0x8ee204d4, 0x30420001, 0x10400011, 
-0x0, 0x8f420218, 0x30420080, 0x10400009, 
-0x0, 0x8f820044, 0x34420020, 0xaf820044, 
-0x8f820044, 0x2403ffbf, 0x431024, 0x8001b36, 
-0xaf820044, 0x8f820044, 0x34420060, 0x8001b36, 
-0xaf820044, 0x8f820044, 0x34420040, 0xaf820044, 
-0x8ee27b88, 0x24430001, 0x28421389, 0x14400005, 
-0xaee37b88, 0x8f820044, 0x38420020, 0xaf820044, 
-0xaee07b88, 0xc004603, 0x0, 0x8fbf0024, 
-0x8fb00020, 0x3e00008, 0x27bd0028, 0x27bdffb8, 
-0xafbf0044, 0xafb60040, 0xafb5003c, 0xafb40038, 
-0xafb30034, 0xafb20030, 0xafb1002c, 0xafb00028, 
-0x8f960064, 0x32c20004, 0x1040000c, 0x24020004, 
-0xaf820064, 0x8f420114, 0xaee204e0, 0x8f820060, 
-0x34420008, 0xaf820060, 0x8ee2016c, 0x24420001, 
-0xaee2016c, 0x80022f4, 0x8ee2016c, 0x32c20001, 
-0x10400004, 0x24020001, 0xaf820064, 0x80022f4, 
-0x0, 0x32c20002, 0x1440000c, 0x3c050003, 
-0x3c040001, 0x24845354, 0x34a50001, 0x2c03021, 
-0x3821, 0xafa00010, 0xc002403, 0xafa00014, 
-0x2402fff8, 0x80022f4, 0xaf820064, 0x8f43022c, 
-0x8f42010c, 0x5062000c, 0xafa00010, 0x8f42022c, 
-0x21080, 0x5a1021, 0x8c420300, 0xafa20020, 
-0x8f42022c, 0x24070001, 0x24420001, 0x3042003f, 
-0x8001b80, 0xaf42022c, 0x3c040001, 0x24845360, 
-0xafa00014, 0x8f46022c, 0x8f47010c, 0x3c050003, 
-0xc002403, 0x34a5f01f, 0x3821, 0x14e00003, 
-0x0, 0x80022ed, 0xaf960064, 0x93a20020, 
-0x2443ffff, 0x2c620011, 0x10400658, 0x31080, 
-0x3c010001, 0x220821, 0x8c225418, 0x400008, 
-0x0, 0x8fa20020, 0x30420fff, 0xaee20e0c, 
-0x8f820060, 0x34420200, 0xaf820060, 0x8ee20118, 
-0x24420001, 0xaee20118, 0x80022e8, 0x8ee20118, 
-0x8fa20020, 0x24030001, 0x3c010001, 0x370821, 
-0xa02383b1, 0x30420fff, 0xaee25238, 0x8f820060, 
-0x34420100, 0xaf820060, 0x8ee20144, 0x24420001, 
-0xaee20144, 0x80022e8, 0x8ee20144, 0x8fa20020, 
-0x21200, 0x22502, 0x24020001, 0x10820005, 
-0x24020002, 0x10820009, 0x2402fffe, 0x8001bc9, 
-0xafa00010, 0x8ee204d4, 0xaee40070, 0xaee40074, 
-0x34420001, 0x8001bbd, 0xaee204d4, 0x8ee304d4, 
-0xaee40070, 0xaee40074, 0x621824, 0xaee304d4, 
-0x8f840054, 0x41442, 0x41c82, 0x431021, 
-0x41cc2, 0x431023, 0x41d02, 0x431021, 
-0x41d42, 0x431023, 0x8001bd0, 0xaee20078, 
-0x3c040001, 0x2484536c, 0xafa00014, 0x8fa60020, 
-0x3c050003, 0xc002403, 0x34a50004, 0x8ee20110, 
-0x24420001, 0xaee20110, 0x80022e8, 0x8ee20110, 
-0x27440212, 0xc0022fe, 0x24050006, 0x3049001f, 
-0x920c0, 0x2e41021, 0x9442727c, 0x30424000, 
-0x1040000a, 0x971021, 0x97430212, 0xa443727e, 
-0x8f430214, 0x971021, 0xac437280, 0x2e41821, 
-0x34028000, 0x8001c79, 0xa462727c, 0x9443727e, 
-0x97420212, 0x14620006, 0x2e41021, 0x971021, 
-0x8c437280, 0x8f420214, 0x1062009f, 0x2e41021, 
-0x9442727c, 0x30428000, 0x1040002a, 0x2406ffff, 
-0x2021, 0x410c0, 0x2e21021, 0x9442737c, 
-0x30424000, 0x54400005, 0x803021, 0x24840001, 
-0x2c820080, 0x1440fff8, 0x410c0, 0x4c10010, 
-0x618c0, 0x610c0, 0x571821, 0x8c63737c, 
-0x571021, 0xafa30010, 0x8c427380, 0x3c040001, 
-0x24845378, 0xafa20014, 0x8f470214, 0x3c050003, 
-0xc002403, 0x34a50013, 0x8001c90, 0x3c020800, 
-0x97440212, 0x771021, 0xa444737e, 0x8f440214, 
-0x771021, 0x2e31821, 0xac447380, 0x34028000, 
-0xa462737c, 0x910c0, 0x2e21021, 0x8001c79, 
-0xa446727c, 0x2e41021, 0x9445727c, 0x8001c2e, 
-0x510c0, 0x9443737e, 0x97420212, 0x14620006, 
-0x510c0, 0x971021, 0x8c437380, 0x8f420214, 
-0x10620065, 0x510c0, 0x2e21021, 0x9445737c, 
-0x510c0, 0x2e21021, 0x9442737c, 0x30428000, 
-0x1040fff0, 0x971021, 0x520c0, 0x971021, 
-0x9443737e, 0x97420212, 0x14620006, 0x2406ffff, 
-0x971021, 0x8c437380, 0x8f420214, 0x10620053, 
-0x3c020800, 0x2021, 0x410c0, 0x2e21021, 
-0x9442737c, 0x30424000, 0x54400005, 0x803021, 
-0x24840001, 0x2c820080, 0x1440fff8, 0x410c0, 
-0x4c10023, 0x618c0, 0x910c0, 0x571821, 
-0x8c63727c, 0x571021, 0xafa30010, 0x8c427280, 
-0x3c040001, 0x24845384, 0xafa20014, 0x8f470214, 
-0x3c050003, 0xc002403, 0x34a5f017, 0x8001c90, 
-0x3c020800, 0x8f430210, 0xb71021, 0xac43777c, 
-0x8f430214, 0xb71021, 0xac437780, 0x3c020001, 
-0x571021, 0x8c4283b4, 0x24420001, 0x3c010001, 
-0x370821, 0xac2283b4, 0x3c030001, 0x771821, 
-0x8c6383b4, 0x2e51021, 0x8001c82, 0xa443777c, 
-0x97440212, 0x771021, 0xa444737e, 0x8f440214, 
-0x771021, 0x2e31821, 0xac447380, 0x34028000, 
-0xa462737c, 0x510c0, 0x2e21021, 0xa446737c, 
-0x2021, 0x428c0, 0x2e51021, 0x9442777c, 
-0x1040ffdc, 0x24840001, 0x2c820080, 0x5440fffa, 
-0x428c0, 0x92e204d8, 0x10400006, 0x24020001, 
-0x8ee304dc, 0x1221004, 0x621825, 0x8001c8f, 
-0xaee304dc, 0x8f830228, 0x24020001, 0x1221004, 
-0x621825, 0xaf830228, 0x3c020800, 0x34421000, 
-0xafa20018, 0x8ee20608, 0x8f430228, 0x24420001, 
-0x304a00ff, 0x514300fd, 0xafa00010, 0x8ee20608, 
-0x210c0, 0x571021, 0x8fa30018, 0x8fa4001c, 
-0xac43060c, 0xac440610, 0x8f830054, 0x8f820054, 
-0x24690032, 0x1221023, 0x2c420033, 0x1040006a, 
-0x5821, 0x24100008, 0x240f000d, 0x240d0007, 
-0x240c0040, 0x240e0001, 0x8f870120, 0x27623800, 
-0x24e80020, 0x102102b, 0x50400001, 0x27683000, 
-0x8f820128, 0x11020004, 0x0, 0x8f820124, 
-0x15020007, 0x1021, 0x8ee201a4, 0x3821, 
-0x24420001, 0xaee201a4, 0x8001d08, 0x8ee201a4, 
-0x8ee40608, 0x420c0, 0x801821, 0x8ee40430, 
-0x8ee50434, 0xa32821, 0xa3302b, 0x822021, 
-0x862021, 0xace40000, 0xace50004, 0x8ee20608, 
-0xa4f0000e, 0xacef0018, 0xacea001c, 0x210c0, 
-0x2442060c, 0x2e21021, 0xace20008, 0x8ee204c4, 
-0xace20010, 0xaf880120, 0x92e24e20, 0x14400033, 
-0x24070001, 0x8ee24e30, 0x210c0, 0x24425038, 
-0x2e22021, 0x8c820000, 0x144d001f, 0x0, 
-0x8ee34e30, 0x8ee24e34, 0x1062001b, 0x0, 
-0x8c820004, 0x24420001, 0xac820004, 0x8ee24e34, 
-0x8ee34e30, 0x24420001, 0x104c0007, 0x0, 
-0x8ee24e34, 0x24420001, 0x10620005, 0x0, 
-0x8001cf5, 0x0, 0x14600005, 0x0, 
-0x8f820128, 0x24420020, 0xaf820128, 0x8f820128, 
-0x8c820004, 0x2c420011, 0x50400010, 0xac800000, 
-0x8001d08, 0x0, 0x8ee24e30, 0x24420001, 
-0x504c0003, 0x1021, 0x8ee24e30, 0x24420001, 
-0xaee24e30, 0x8ee24e30, 0x210c0, 0x24425038, 
-0x2e22021, 0xac8d0000, 0xac8e0004, 0x54e00006, 
-0x240b0001, 0x8f820054, 0x1221023, 0x2c420033, 
-0x1440ff9d, 0x0, 0x316300ff, 0x24020001, 
-0x54620078, 0xafa00010, 0xaeea0608, 0x8f830054, 
-0x8f820054, 0x24690032, 0x1221023, 0x2c420033, 
-0x10400061, 0x5821, 0x240e0008, 0x240d0011, 
-0x240a0012, 0x24080040, 0x240c0001, 0x8f830120, 
-0x27623800, 0x24660020, 0xc2102b, 0x50400001, 
-0x27663000, 0x8f820128, 0x10c20004, 0x0, 
-0x8f820124, 0x14c20007, 0x0, 0x8ee201a4, 
-0x3821, 0x24420001, 0xaee201a4, 0x8001d74, 
-0x8ee201a4, 0x8ee20608, 0xac62001c, 0x8ee404a0, 
-0x8ee504a4, 0x2462001c, 0xac620008, 0xa46e000e, 
-0xac6d0018, 0xac640000, 0xac650004, 0x8ee204c4, 
-0xac620010, 0xaf860120, 0x92e24e20, 0x14400033, 
-0x24070001, 0x8ee24e30, 0x210c0, 0x24425038, 
-0x2e22021, 0x8c820000, 0x144a001f, 0x0, 
-0x8ee34e30, 0x8ee24e34, 0x1062001b, 0x0, 
-0x8c820004, 0x24420001, 0xac820004, 0x8ee24e34, 
-0x8ee34e30, 0x24420001, 0x10480007, 0x0, 
-0x8ee24e34, 0x24420001, 0x10620005, 0x0, 
-0x8001d61, 0x0, 0x14600005, 0x0, 
-0x8f820128, 0x24420020, 0xaf820128, 0x8f820128, 
-0x8c820004, 0x2c420011, 0x50400010, 0xac800000, 
-0x8001d74, 0x0, 0x8ee24e30, 0x24420001, 
-0x50480003, 0x1021, 0x8ee24e30, 0x24420001, 
-0xaee24e30, 0x8ee24e30, 0x210c0, 0x24425038, 
-0x2e22021, 0xac8a0000, 0xac8c0004, 0x54e00006, 
-0x240b0001, 0x8f820054, 0x1221023, 0x2c420033, 
-0x1440ffa6, 0x0, 0x316300ff, 0x24020001, 
-0x10620022, 0x0, 0x3c040001, 0x24845390, 
-0xafa00010, 0xafa00014, 0x8f860120, 0x8f870124, 
-0x3c050009, 0xc002403, 0x34a5f011, 0x8001da0, 
-0x0, 0x3c040001, 0x2484539c, 0xafa00014, 
-0x8f860120, 0x8f870124, 0x3c050009, 0xc002403, 
-0x34a5f010, 0x8001da0, 0x0, 0x3c040001, 
-0x248453a8, 0xafa00014, 0x8ee60608, 0x8f470228, 
-0x3c050009, 0xc002403, 0x34a5f00f, 0x8ee201ac, 
-0x24420001, 0xaee201ac, 0x8ee201ac, 0x8ee20124, 
-0x24420001, 0xaee20124, 0x8001f97, 0x8ee20124, 
-0x27440212, 0xc0022fe, 0x24050006, 0x3049001f, 
-0x928c0, 0x2e51021, 0x9442727c, 0x30428000, 
-0x1040002f, 0x2e51021, 0x9442727c, 0x30424000, 
-0x1440001c, 0xb71021, 0x9443727e, 0x97420212, 
-0x14620018, 0xb71021, 0x8c437280, 0x8f420214, 
-0x54620016, 0xafa20010, 0x92e204d8, 0x10400007, 
-0x24020001, 0x8ee304dc, 0x1221004, 0x21027, 
-0x621824, 0x8001dc9, 0xaee304dc, 0x8f830228, 
-0x1221004, 0x21027, 0x621824, 0xaf830228, 
-0x910c0, 0x2e21821, 0x3402c000, 0x8001e4e, 
-0xa462727c, 0x8f420214, 0xafa20010, 0x910c0, 
-0x571021, 0x8c42727c, 0x3c040001, 0x248453b4, 
-0x3c050003, 0xafa20014, 0x8f470210, 0x34a5f01c, 
-0xc002403, 0x1203021, 0x8001e83, 0x3c020800, 
-0xb71021, 0x9443727e, 0x97420212, 0x14620019, 
-0x918c0, 0xb71021, 0x8c437280, 0x8f420214, 
-0x14620014, 0x918c0, 0x2e51021, 0x9447727c, 
-0x720c0, 0x971021, 0x9443737e, 0xb71021, 
-0xa443727e, 0x971021, 0x8c437380, 0xb71021, 
-0xac437280, 0x2e41021, 0x9443737c, 0x2e51021, 
-0xa443727c, 0x2e41821, 0x3402c000, 0x8001e4e, 
-0xa462737c, 0x2e31021, 0x9447727c, 0x3021, 
-0x720c0, 0x2e41021, 0x9442737c, 0x4021, 
-0x30428000, 0x14400025, 0xe02821, 0x605021, 
-0x340bc000, 0x971021, 0x9443737e, 0x97420212, 
-0x54620015, 0xe02821, 0x971021, 0x8c437380, 
-0x8f420214, 0x54620010, 0xe02821, 0x11000006, 
-0x2e41021, 0x9443737c, 0x510c0, 0x2e21021, 
-0x8001e1a, 0xa443737c, 0x9443737c, 0x2ea1021, 
-0xa443727c, 0x710c0, 0x2e21021, 0xa44b737c, 
-0x8001e28, 0x24060001, 0x510c0, 0x2e21021, 
-0x9447737c, 0x720c0, 0x2e41021, 0x9442737c, 
-0x30428000, 0x1040ffdf, 0x25080001, 0x30c200ff, 
-0x14400025, 0x2021, 0x720c0, 0x971021, 
-0x9443737e, 0x97420212, 0x1462000f, 0x910c0, 
-0x971021, 0x8c437380, 0x8f420214, 0x1462000a, 
-0x910c0, 0x2e41821, 0x3402c000, 0x15000015, 
-0xa462737c, 0x910c0, 0x2e21821, 0x34028000, 
-0x8001e4e, 0xa462727c, 0x571021, 0x8c42727c, 
-0x3c040001, 0x248453c0, 0x3c050003, 0xafa20010, 
-0x710c0, 0x571021, 0x8c42737c, 0x34a5001e, 
-0x1203021, 0xc002403, 0xafa20014, 0x8001e83, 
-0x3c020800, 0x2021, 0x428c0, 0xb71021, 
-0x9443777e, 0x97420212, 0x5462002b, 0x24840001, 
-0xb71021, 0x8c437780, 0x8f420214, 0x54620026, 
-0x24840001, 0x3c020001, 0x571021, 0x8c4283b4, 
-0x2442ffff, 0x3c010001, 0x370821, 0xac2283b4, 
-0x3c020001, 0x571021, 0x8c4283b4, 0x809021, 
-0x242102b, 0x1040000e, 0x24b1777c, 0x24b07784, 
-0x2f02021, 0x2f12821, 0xc002490, 0x24060008, 
-0x26310008, 0x3c020001, 0x571021, 0x8c4283b4, 
-0x26520001, 0x242102b, 0x1440fff5, 0x26100008, 
-0x3c040001, 0x972021, 0x8c8483b4, 0x24050008, 
-0x420c0, 0x2484777c, 0xc002488, 0x2e42021, 
-0x8001e83, 0x3c020800, 0x2c820080, 0x1440ffcf, 
-0x428c0, 0x3c020800, 0x34422000, 0xafa20018, 
-0x8ee20608, 0x8f430228, 0x24420001, 0x304a00ff, 
-0x514300fd, 0xafa00010, 0x8ee20608, 0x210c0, 
-0x571021, 0x8fa30018, 0x8fa4001c, 0xac43060c, 
-0xac440610, 0x8f830054, 0x8f820054, 0x24690032, 
-0x1221023, 0x2c420033, 0x1040006a, 0x5821, 
-0x24100008, 0x240f000d, 0x240d0007, 0x240c0040, 
-0x240e0001, 0x8f870120, 0x27623800, 0x24e80020, 
-0x102102b, 0x50400001, 0x27683000, 0x8f820128, 
-0x11020004, 0x0, 0x8f820124, 0x15020007, 
-0x1021, 0x8ee201a4, 0x3821, 0x24420001, 
-0xaee201a4, 0x8001efb, 0x8ee201a4, 0x8ee40608, 
-0x420c0, 0x801821, 0x8ee40430, 0x8ee50434, 
-0xa32821, 0xa3302b, 0x822021, 0x862021, 
-0xace40000, 0xace50004, 0x8ee20608, 0xa4f0000e, 
-0xacef0018, 0xacea001c, 0x210c0, 0x2442060c, 
-0x2e21021, 0xace20008, 0x8ee204c4, 0xace20010, 
-0xaf880120, 0x92e24e20, 0x14400033, 0x24070001, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0x8c820000, 0x144d001f, 0x0, 0x8ee34e30, 
-0x8ee24e34, 0x1062001b, 0x0, 0x8c820004, 
-0x24420001, 0xac820004, 0x8ee24e34, 0x8ee34e30, 
-0x24420001, 0x104c0007, 0x0, 0x8ee24e34, 
-0x24420001, 0x10620005, 0x0, 0x8001ee8, 
-0x0, 0x14600005, 0x0, 0x8f820128, 
-0x24420020, 0xaf820128, 0x8f820128, 0x8c820004, 
-0x2c420011, 0x50400010, 0xac800000, 0x8001efb, 
-0x0, 0x8ee24e30, 0x24420001, 0x504c0003, 
-0x1021, 0x8ee24e30, 0x24420001, 0xaee24e30, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0xac8d0000, 0xac8e0004, 0x54e00006, 0x240b0001, 
-0x8f820054, 0x1221023, 0x2c420033, 0x1440ff9d, 
-0x0, 0x316300ff, 0x24020001, 0x54620078, 
-0xafa00010, 0xaeea0608, 0x8f830054, 0x8f820054, 
-0x24690032, 0x1221023, 0x2c420033, 0x10400061, 
-0x5821, 0x240e0008, 0x240d0011, 0x240a0012, 
-0x24080040, 0x240c0001, 0x8f830120, 0x27623800, 
-0x24660020, 0xc2102b, 0x50400001, 0x27663000, 
-0x8f820128, 0x10c20004, 0x0, 0x8f820124, 
-0x14c20007, 0x0, 0x8ee201a4, 0x3821, 
-0x24420001, 0xaee201a4, 0x8001f67, 0x8ee201a4, 
-0x8ee20608, 0xac62001c, 0x8ee404a0, 0x8ee504a4, 
-0x2462001c, 0xac620008, 0xa46e000e, 0xac6d0018, 
-0xac640000, 0xac650004, 0x8ee204c4, 0xac620010, 
-0xaf860120, 0x92e24e20, 0x14400033, 0x24070001, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0x8c820000, 0x144a001f, 0x0, 0x8ee34e30, 
-0x8ee24e34, 0x1062001b, 0x0, 0x8c820004, 
-0x24420001, 0xac820004, 0x8ee24e34, 0x8ee34e30, 
-0x24420001, 0x10480007, 0x0, 0x8ee24e34, 
-0x24420001, 0x10620005, 0x0, 0x8001f54, 
-0x0, 0x14600005, 0x0, 0x8f820128, 
-0x24420020, 0xaf820128, 0x8f820128, 0x8c820004, 
-0x2c420011, 0x50400010, 0xac800000, 0x8001f67, 
-0x0, 0x8ee24e30, 0x24420001, 0x50480003, 
-0x1021, 0x8ee24e30, 0x24420001, 0xaee24e30, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0xac8a0000, 0xac8c0004, 0x54e00006, 0x240b0001, 
-0x8f820054, 0x1221023, 0x2c420033, 0x1440ffa6, 
-0x0, 0x316300ff, 0x24020001, 0x10620022, 
-0x0, 0x3c040001, 0x24845390, 0xafa00010, 
-0xafa00014, 0x8f860120, 0x8f870124, 0x3c050009, 
-0xc002403, 0x34a5f011, 0x8001f93, 0x0, 
-0x3c040001, 0x2484539c, 0xafa00014, 0x8f860120, 
-0x8f870124, 0x3c050009, 0xc002403, 0x34a5f010, 
-0x8001f93, 0x0, 0x3c040001, 0x248453a8, 
-0xafa00014, 0x8ee60608, 0x8f470228, 0x3c050009, 
-0xc002403, 0x34a5f00f, 0x8ee201ac, 0x24420001, 
-0xaee201ac, 0x8ee201ac, 0x8ee20128, 0x24420001, 
-0xaee20128, 0x8ee20128, 0x8ee20164, 0x24420001, 
-0xaee20164, 0x80022e8, 0x8ee20164, 0x8fa20020, 
-0x21200, 0x21d02, 0x24020001, 0x10620005, 
-0x24020002, 0x1062000d, 0x0, 0x8001fb7, 
-0xafa00010, 0x92e204d8, 0x14400006, 0x24020001, 
-0x8f820228, 0xaee204dc, 0x2402ffff, 0xaf820228, 
-0x24020001, 0x8001fbe, 0xa2e204d8, 0x92e204d8, 
-0x5040000c, 0xa2e004d8, 0x8ee204dc, 0xaf820228, 
-0x8001fbe, 0xa2e004d8, 0x3c040001, 0x248453c8, 
-0xafa00014, 0x8fa60020, 0x3c050003, 0xc002403, 
-0x34a5f009, 0x8ee2013c, 0x24420001, 0xaee2013c, 
-0x80022e8, 0x8ee2013c, 0x8fa20020, 0x21200, 
-0x22502, 0x24020001, 0x10820005, 0x24020002, 
-0x1082000f, 0x0, 0x8001fe3, 0xafa00010, 
-0x8f820220, 0x3c0308ff, 0x3463ffff, 0x431024, 
-0x34420008, 0xaf820220, 0x24020001, 0x3c010001, 
-0x370821, 0xa02283b2, 0x8001fea, 0xaee40108, 
-0x8f820220, 0x3c0308ff, 0x3463fff7, 0x431024, 
-0xaf820220, 0x3c010001, 0x370821, 0xa02083b2, 
-0x8001fea, 0xaee40108, 0x3c040001, 0x248453d4, 
-0xafa00014, 0x8fa60020, 0x3c050003, 0xc002403, 
-0x34a5f00a, 0x8ee2012c, 0x24420001, 0xaee2012c, 
-0x80022e8, 0x8ee2012c, 0x8fa20020, 0x21200, 
-0x21d02, 0x24020001, 0x10620005, 0x24020002, 
-0x1062000e, 0x0, 0x8002011, 0xafa00010, 
-0x8f820220, 0x3c0308ff, 0x3463ffff, 0x431024, 
-0x34420008, 0xaf820220, 0x24020001, 0x3c010001, 
-0x370821, 0x8002018, 0xa02283b3, 0x3c020001, 
-0x571021, 0x904283b2, 0x3c010001, 0x370821, 
-0x1440000e, 0xa02083b3, 0x8f820220, 0x3c0308ff, 
-0x3463fff7, 0x431024, 0x8002018, 0xaf820220, 
-0x3c040001, 0x248453e0, 0xafa00014, 0x8fa60020, 
-0x3c050003, 0xc002403, 0x34a5f00b, 0x8ee20114, 
-0x24420001, 0xaee20114, 0x80022e8, 0x8ee20114, 
-0x27840208, 0x27450200, 0xc00249a, 0x24060008, 
-0x26e40094, 0x27450200, 0xc00249a, 0x24060008, 
-0x8ee20134, 0x24420001, 0xaee20134, 0x80022e8, 
-0x8ee20134, 0x8f460248, 0x2021, 0xc005108, 
-0x24050004, 0x8ee20130, 0x24420001, 0xaee20130, 
-0x80022e8, 0x8ee20130, 0x8ef301cc, 0x8ef401d0, 
-0x8ef501d8, 0x8ee20140, 0x26e40030, 0x24420001, 
-0xaee20140, 0x8ef00140, 0x8ef10074, 0x8ef20070, 
-0xc002488, 0x24050400, 0xaef301cc, 0xaef401d0, 
-0xaef501d8, 0xaef00140, 0xaef10074, 0xaef20070, 
-0x8f42025c, 0x26e40094, 0xaee20060, 0x8f420260, 
-0x27450200, 0x24060008, 0xaee20068, 0x24020006, 
-0xc00249a, 0xaee20064, 0x3c023b9a, 0x3442ca00, 
-0xaee2006c, 0x240203e8, 0x24040002, 0x24030001, 
-0xaee20104, 0xaee40100, 0xaee3010c, 0x8f820220, 
-0x30420008, 0x10400004, 0x0, 0xaee30108, 
-0x8002061, 0x2021, 0xaee40108, 0x2021, 
-0x3c030001, 0x641821, 0x90635c30, 0x2e41021, 
-0x24840001, 0xa043009c, 0x2c82000f, 0x1440fff8, 
-0x0, 0x8f820040, 0x2e41821, 0x24840001, 
-0x21702, 0x24420030, 0xa062009c, 0x2e41021, 
-0x80022e8, 0xa040009c, 0x24020001, 0x3c010001, 
-0x370821, 0xa02283e0, 0x240b0400, 0x24080014, 
-0x240a0040, 0x24090001, 0x8f830100, 0x27623000, 
-0x24660020, 0xc2102b, 0x50400001, 0x27662800, 
-0x8f820108, 0x10c20004, 0x0, 0x8f820104, 
-0x14c20007, 0x26e20030, 0x8ee201a8, 0x3821, 
-0x24420001, 0xaee201a8, 0x80020a8, 0x8ee201a8, 
-0x8ee404b8, 0x8ee504bc, 0xac620008, 0xa46b000e, 
-0xac680018, 0xac60001c, 0xac640000, 0xac650004, 
-0x8ee204cc, 0xac620010, 0xaf860100, 0x92e204ec, 
-0x1440000e, 0x24070001, 0x8ee24e28, 0x24420001, 
-0x504a0003, 0x1021, 0x8ee24e28, 0x24420001, 
-0xaee24e28, 0x8ee24e28, 0x210c0, 0x24424e38, 
-0x2e21021, 0xac480000, 0xac490004, 0x10e0ffd2, 
-0x0, 0x80022e8, 0x0, 0x3c020900, 
-0xaee05238, 0xaee0523c, 0xaee05240, 0xaee05244, 
-0xaee001d0, 0x3c010001, 0x370821, 0xa02083b1, 
-0xafa20018, 0x8ee20608, 0x8f430228, 0x24420001, 
-0x304a00ff, 0x514300fd, 0xafa00010, 0x8ee20608, 
-0x210c0, 0x571021, 0x8fa30018, 0x8fa4001c, 
-0xac43060c, 0xac440610, 0x8f830054, 0x8f820054, 
-0x24690032, 0x1221023, 0x2c420033, 0x1040006a, 
-0x5821, 0x24100008, 0x240f000d, 0x240d0007, 
-0x240c0040, 0x240e0001, 0x8f870120, 0x27623800, 
-0x24e80020, 0x102102b, 0x50400001, 0x27683000, 
-0x8f820128, 0x11020004, 0x0, 0x8f820124, 
-0x15020007, 0x1021, 0x8ee201a4, 0x3821, 
-0x24420001, 0xaee201a4, 0x800212c, 0x8ee201a4, 
-0x8ee40608, 0x420c0, 0x801821, 0x8ee40430, 
-0x8ee50434, 0xa32821, 0xa3302b, 0x822021, 
-0x862021, 0xace40000, 0xace50004, 0x8ee20608, 
-0xa4f0000e, 0xacef0018, 0xacea001c, 0x210c0, 
-0x2442060c, 0x2e21021, 0xace20008, 0x8ee204c4, 
-0xace20010, 0xaf880120, 0x92e24e20, 0x14400033, 
-0x24070001, 0x8ee24e30, 0x210c0, 0x24425038, 
-0x2e22021, 0x8c820000, 0x144d001f, 0x0, 
-0x8ee34e30, 0x8ee24e34, 0x1062001b, 0x0, 
-0x8c820004, 0x24420001, 0xac820004, 0x8ee24e34, 
-0x8ee34e30, 0x24420001, 0x104c0007, 0x0, 
-0x8ee24e34, 0x24420001, 0x10620005, 0x0, 
-0x8002119, 0x0, 0x14600005, 0x0, 
-0x8f820128, 0x24420020, 0xaf820128, 0x8f820128, 
-0x8c820004, 0x2c420011, 0x50400010, 0xac800000, 
-0x800212c, 0x0, 0x8ee24e30, 0x24420001, 
-0x504c0003, 0x1021, 0x8ee24e30, 0x24420001, 
-0xaee24e30, 0x8ee24e30, 0x210c0, 0x24425038, 
-0x2e22021, 0xac8d0000, 0xac8e0004, 0x54e00006, 
-0x240b0001, 0x8f820054, 0x1221023, 0x2c420033, 
-0x1440ff9d, 0x0, 0x316300ff, 0x24020001, 
-0x54620078, 0xafa00010, 0xaeea0608, 0x8f830054, 
-0x8f820054, 0x24690032, 0x1221023, 0x2c420033, 
-0x10400061, 0x5821, 0x240e0008, 0x240d0011, 
-0x240a0012, 0x24080040, 0x240c0001, 0x8f830120, 
-0x27623800, 0x24660020, 0xc2102b, 0x50400001, 
-0x27663000, 0x8f820128, 0x10c20004, 0x0, 
-0x8f820124, 0x14c20007, 0x0, 0x8ee201a4, 
-0x3821, 0x24420001, 0xaee201a4, 0x8002198, 
-0x8ee201a4, 0x8ee20608, 0xac62001c, 0x8ee404a0, 
-0x8ee504a4, 0x2462001c, 0xac620008, 0xa46e000e, 
-0xac6d0018, 0xac640000, 0xac650004, 0x8ee204c4, 
-0xac620010, 0xaf860120, 0x92e24e20, 0x14400033, 
-0x24070001, 0x8ee24e30, 0x210c0, 0x24425038, 
-0x2e22021, 0x8c820000, 0x144a001f, 0x0, 
-0x8ee34e30, 0x8ee24e34, 0x1062001b, 0x0, 
-0x8c820004, 0x24420001, 0xac820004, 0x8ee24e34, 
-0x8ee34e30, 0x24420001, 0x10480007, 0x0, 
-0x8ee24e34, 0x24420001, 0x10620005, 0x0, 
-0x8002185, 0x0, 0x14600005, 0x0, 
-0x8f820128, 0x24420020, 0xaf820128, 0x8f820128, 
-0x8c820004, 0x2c420011, 0x50400010, 0xac800000, 
-0x8002198, 0x0, 0x8ee24e30, 0x24420001, 
-0x50480003, 0x1021, 0x8ee24e30, 0x24420001, 
-0xaee24e30, 0x8ee24e30, 0x210c0, 0x24425038, 
-0x2e22021, 0xac8a0000, 0xac8c0004, 0x54e00006, 
-0x240b0001, 0x8f820054, 0x1221023, 0x2c420033, 
-0x1440ffa6, 0x0, 0x316300ff, 0x24020001, 
-0x10620022, 0x0, 0x3c040001, 0x24845390, 
-0xafa00010, 0xafa00014, 0x8f860120, 0x8f870124, 
-0x3c050009, 0xc002403, 0x34a5f011, 0x80021c4, 
-0x0, 0x3c040001, 0x2484539c, 0xafa00014, 
-0x8f860120, 0x8f870124, 0x3c050009, 0xc002403, 
-0x34a5f010, 0x80021c4, 0x0, 0x3c040001, 
-0x248453a8, 0xafa00014, 0x8ee60608, 0x8f470228, 
-0x3c050009, 0xc002403, 0x34a5f00f, 0x8ee201ac, 
-0x24420001, 0xaee201ac, 0x8ee201ac, 0x8ee20120, 
-0x24420001, 0xaee20120, 0x8ee20120, 0x8ee20168, 
-0x24420001, 0xaee20168, 0x80022e8, 0x8ee20168, 
-0x8f42025c, 0x26e40094, 0xaee20060, 0x8f420260, 
-0x27450200, 0x24060008, 0xc00249a, 0xaee20068, 
-0x8f820220, 0x30420008, 0x14400002, 0x24020001, 
-0x24020002, 0xaee20108, 0x8ee2011c, 0x24420001, 
-0xaee2011c, 0x80022e8, 0x8ee2011c, 0x3c040001, 
-0x248453ec, 0xafa00010, 0xafa00014, 0x8fa60020, 
-0x3c050003, 0xc002403, 0x34a5f00f, 0x93a20020, 
-0x3c030700, 0x34631000, 0x431025, 0xafa20018, 
-0x8ee20608, 0x8f430228, 0x24420001, 0x304900ff, 
-0x512300e2, 0xafa00010, 0x8ee20608, 0x210c0, 
-0x571021, 0x8fa30018, 0x8fa4001c, 0xac43060c, 
-0xac440610, 0x8f870120, 0x27623800, 0x24e80020, 
-0x102102b, 0x50400001, 0x27683000, 0x8f820128, 
-0x11020004, 0x0, 0x8f820124, 0x15020007, 
-0x1021, 0x8ee201a4, 0x3821, 0x24420001, 
-0xaee201a4, 0x800225d, 0x8ee201a4, 0x8ee40608, 
-0x420c0, 0x801821, 0x8ee40430, 0x8ee50434, 
-0xa32821, 0xa3302b, 0x822021, 0x862021, 
-0xace40000, 0xace50004, 0x8ee30608, 0x24020008, 
-0xa4e2000e, 0x2402000d, 0xace20018, 0xace9001c, 
-0x318c0, 0x2463060c, 0x2e31021, 0xace20008, 
-0x8ee204c4, 0xace20010, 0xaf880120, 0x92e24e20, 
-0x14400037, 0x24070001, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0x8c830000, 0x24020007, 
-0x1462001f, 0x0, 0x8ee34e30, 0x8ee24e34, 
-0x1062001b, 0x24030040, 0x8c820004, 0x24420001, 
-0xac820004, 0x8ee24e34, 0x8ee54e30, 0x24420001, 
-0x10430007, 0x0, 0x8ee24e34, 0x24420001, 
-0x10a20005, 0x0, 0x8002247, 0x0, 
-0x14a00005, 0x0, 0x8f820128, 0x24420020, 
-0xaf820128, 0x8f820128, 0x8c820004, 0x2c420011, 
-0x50400013, 0xac800000, 0x800225d, 0x0, 
-0x8ee24e30, 0x24030040, 0x24420001, 0x50430003, 
-0x1021, 0x8ee24e30, 0x24420001, 0xaee24e30, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0x24020007, 0xac820000, 0x24020001, 0xac820004, 
-0x54e0000c, 0xaee90608, 0x3c040001, 0x248453f4, 
-0xafa00010, 0xafa00014, 0x8ee60608, 0x8f470228, 
-0x3c050009, 0xc002403, 0x34a5f000, 0x80022e0, 
-0x0, 0x8f830120, 0x27623800, 0x24660020, 
-0xc2102b, 0x50400001, 0x27663000, 0x8f820128, 
-0x10c20004, 0x0, 0x8f820124, 0x14c20007, 
-0x0, 0x8ee201a4, 0x3821, 0x24420001, 
-0xaee201a4, 0x80022c4, 0x8ee201a4, 0x8ee20608, 
-0xac62001c, 0x8ee404a0, 0x8ee504a4, 0x2462001c, 
-0xac620008, 0x24020008, 0xa462000e, 0x24020011, 
-0xac620018, 0xac640000, 0xac650004, 0x8ee204c4, 
-0xac620010, 0xaf860120, 0x92e24e20, 0x14400037, 
-0x24070001, 0x8ee24e30, 0x210c0, 0x24425038, 
-0x2e22021, 0x8c830000, 0x24020012, 0x1462001f, 
-0x0, 0x8ee34e30, 0x8ee24e34, 0x1062001b, 
-0x24030040, 0x8c820004, 0x24420001, 0xac820004, 
-0x8ee24e34, 0x8ee54e30, 0x24420001, 0x10430007, 
-0x0, 0x8ee24e34, 0x24420001, 0x10a20005, 
-0x0, 0x80022ae, 0x0, 0x14a00005, 
-0x0, 0x8f820128, 0x24420020, 0xaf820128, 
-0x8f820128, 0x8c820004, 0x2c420011, 0x50400013, 
-0xac800000, 0x80022c4, 0x0, 0x8ee24e30, 
-0x24030040, 0x24420001, 0x50430003, 0x1021, 
-0x8ee24e30, 0x24420001, 0xaee24e30, 0x8ee24e30, 
-0x210c0, 0x24425038, 0x2e22021, 0x24020012, 
-0xac820000, 0x24020001, 0xac820004, 0x14e0001b, 
-0x0, 0x3c040001, 0x248453fc, 0xafa00010, 
-0xafa00014, 0x8ee60608, 0x8f470228, 0x3c050009, 
-0xc002403, 0x34a5f001, 0x8ee201b0, 0x24420001, 
-0xaee201b0, 0x80022e0, 0x8ee201b0, 0x3c040001, 
-0x24845408, 0xafa00014, 0x8ee60608, 0x8f470228, 
-0x3c050009, 0xc002403, 0x34a5f005, 0x8ee201ac, 
-0x24420001, 0xaee201ac, 0x8ee201ac, 0x8ee20150, 
-0x24420001, 0xaee20150, 0x8ee20150, 0x8ee20160, 
-0x24420001, 0xaee20160, 0x8ee20160, 0x8f43022c, 
-0x8f42010c, 0x14620009, 0x24020002, 0xaf820064, 
-0x8f820064, 0x14400005, 0x0, 0x8f43022c, 
-0x8f42010c, 0x1462f875, 0x0, 0x8fbf0044, 
-0x8fb60040, 0x8fb5003c, 0x8fb40038, 0x8fb30034, 
-0x8fb20030, 0x8fb1002c, 0x8fb00028, 0x3e00008, 
-0x27bd0048, 0x27bdfff8, 0x2408ffff, 0x10a00014, 
-0x4821, 0x3c0aedb8, 0x354a8320, 0x90870000, 
-0x24840001, 0x3021, 0x1071026, 0x30420001, 
-0x10400002, 0x81842, 0x6a1826, 0x604021, 
-0x24c60001, 0x2cc20008, 0x1440fff7, 0x73842, 
-0x25290001, 0x125102b, 0x1440fff0, 0x0, 
-0x1001021, 0x3e00008, 0x27bd0008, 0x27bdffe8, 
-0x27642800, 0xafbf0010, 0xc002488, 0x24051000, 
-0x24020021, 0xaf800100, 0xaf800104, 0xaf800108, 
-0xaf800110, 0xaf800114, 0xaf800118, 0xaf800120, 
-0xaf800124, 0xaf800128, 0xaf800130, 0xaf800134, 
-0xaf800138, 0xaee04e28, 0xaee04e2c, 0xaee04e30, 
-0xaee04e34, 0xaf82011c, 0x8f420218, 0x30420040, 
-0x10400004, 0x0, 0x8f82011c, 0x34420004, 
-0xaf82011c, 0x8fbf0010, 0x3e00008, 0x27bd0018, 
-0x27bdffe0, 0xafbf0018, 0x8f820104, 0xafa20010, 
-0x8f820100, 0x3c050002, 0xafa20014, 0x8f8600b0, 
-0x8f87011c, 0x3c040001, 0x248454c0, 0xc002403, 
-0x34a5f000, 0x8f8300b0, 0x3c027f00, 0x621824, 
-0x3c020400, 0x10620029, 0x43102b, 0x14400008, 
-0x3c022000, 0x3c020100, 0x10620024, 0x3c020200, 
-0x10620011, 0x0, 0x8002374, 0x0, 
-0x10620008, 0x3c024000, 0x1462001c, 0x0, 
-0x8ee20190, 0x24420001, 0xaee20190, 0x8002374, 
-0x8ee20190, 0x8ee2018c, 0x24420001, 0xaee2018c, 
-0x8002374, 0x8ee2018c, 0x8f82011c, 0x34420002, 
-0xaf82011c, 0x8f830104, 0x8f8200b0, 0x34420001, 
-0xaf8200b0, 0xaf830104, 0x8f82011c, 0x2403fffd, 
-0x431024, 0xaf82011c, 0x8ee201a0, 0x24420001, 
-0xaee201a0, 0x8002377, 0x8ee201a0, 0x8f8200b0, 
-0x34420001, 0xaf8200b0, 0x8fbf0018, 0x3e00008, 
-0x27bd0020, 0x27bdffe0, 0xafbf001c, 0xafb00018, 
-0x8f820120, 0xafa20010, 0x8f820124, 0x3c050001, 
-0xafa20014, 0x8f8600a0, 0x8f87011c, 0x3c040001, 
-0x248454cc, 0xc002403, 0x34a5f000, 0x8f8300a0, 
-0x3c027f00, 0x621824, 0x3c020400, 0x10620053, 
-0x8021, 0x43102b, 0x14400008, 0x3c042000, 
-0x3c020100, 0x1062004d, 0x3c020200, 0x1062003a, 
-0x0, 0x80023e0, 0x0, 0x10640003, 
-0x3c024000, 0x14620045, 0x0, 0x8f8200a0, 
-0x441024, 0x10400006, 0x0, 0x8ee20194, 
-0x24420001, 0xaee20194, 0x80023a9, 0x8ee20194, 
-0x8ee20198, 0x24420001, 0xaee20198, 0x8ee20198, 
-0x8f82011c, 0x34420002, 0xaf82011c, 0x8f82011c, 
-0x30420200, 0x1040001b, 0x0, 0x8f8300a0, 
-0x8f840124, 0x8f8200ac, 0x14400007, 0x24020001, 
-0x3c020001, 0x3442f000, 0x621024, 0x50400001, 
-0x24100001, 0x24020001, 0x1200000d, 0xaf8200a0, 
-0x8f820124, 0x2442ffe0, 0xaf820124, 0x8f820124, 
-0x8f820124, 0x27633000, 0x43102b, 0x10400005, 
-0x276237e0, 0xaf820124, 0x80023ca, 0x0, 
-0xaf840124, 0x8f82011c, 0x2403fffd, 0x431024, 
-0x80023e3, 0xaf82011c, 0x8f82011c, 0x34420002, 
-0xaf82011c, 0x8f830124, 0x8f8200a0, 0x34420001, 
-0xaf8200a0, 0xaf830124, 0x8f82011c, 0x2403fffd, 
-0x431024, 0xaf82011c, 0x8ee2019c, 0x24420001, 
-0xaee2019c, 0x80023e3, 0x8ee2019c, 0x8f8200a0, 
-0x34420001, 0xaf8200a0, 0x8fbf001c, 0x8fb00018, 
-0x3e00008, 0x27bd0020, 0x0, 0x3c020001, 
-0x8c425c58, 0x27bdffe8, 0xafbf0014, 0x14400012, 
-0xafb00010, 0x3c100001, 0x26105dd0, 0x2002021, 
-0xc002488, 0x24052000, 0x26021fe0, 0x3c010001, 
-0xac225d94, 0x3c010001, 0xac225d90, 0xaf420250, 
-0x24022000, 0xaf500254, 0xaf420258, 0x24020001, 
-0x3c010001, 0xac225c58, 0x8fbf0014, 0x8fb00010, 
-0x3e00008, 0x27bd0018, 0x3c030001, 0x8c635d94, 
-0x8c820000, 0x8fa80010, 0x8fa90014, 0xac620000, 
-0x3c020001, 0x8c425d94, 0x8c830004, 0xac430004, 
-0xac450008, 0x8f840054, 0x2443ffe0, 0xac460010, 
-0xac470014, 0xac480018, 0xac49001c, 0x3c010001, 
-0xac235d94, 0xac44000c, 0x3c020001, 0x24425dd0, 
-0x62182b, 0x10600005, 0x0, 0x3c020001, 
-0x8c425d90, 0x3c010001, 0xac225d94, 0x3c030001, 
-0x8c635d94, 0x3c020001, 0x8c425c40, 0xac620000, 
-0x3c030001, 0x8c635d94, 0x3c020001, 0x8c425c40, 
-0xac620004, 0x3e00008, 0xaf430250, 0x3c030001, 
-0x8c635d94, 0x3c020001, 0x8c425c40, 0x27bdffd0, 
-0xafb40020, 0x8fb40040, 0xafb00010, 0x808021, 
-0xafb50024, 0x8fb50044, 0x8fa40048, 0xafb10014, 
-0xa08821, 0xafbf0028, 0xafb3001c, 0xafb20018, 
-0xac620000, 0x3c050001, 0x8ca55d94, 0x3c020001, 
-0x8c425c40, 0xc09021, 0xe09821, 0x10800006, 
-0xaca20004, 0x24a50008, 0xc002490, 0x24060018, 
-0x800244e, 0x0, 0x24a40008, 0xc002488, 
-0x24050018, 0x3c020001, 0x8c425d94, 0x3c050001, 
-0x24a55dd0, 0x2442ffe0, 0x3c010001, 0xac225d94, 
-0x45102b, 0x10400005, 0x0, 0x3c020001, 
-0x8c425d90, 0x3c010001, 0xac225d94, 0x3c030001, 
-0x8c635d94, 0x8e020000, 0xac620000, 0x3c030001, 
-0x8c635d94, 0x8e020004, 0xac620004, 0xac710008, 
-0x8f840054, 0x2462ffe0, 0x3c010001, 0xac225d94, 
-0x45102b, 0xac720010, 0xac730014, 0xac740018, 
-0xac75001c, 0x10400005, 0xac64000c, 0x3c020001, 
-0x8c425d90, 0x3c010001, 0xac225d94, 0x3c030001, 
-0x8c635d94, 0x3c020001, 0x8c425c40, 0xac620000, 
-0x3c030001, 0x8c635d94, 0x3c020001, 0x8c425c40, 
-0xac620004, 0xaf430250, 0x8fbf0028, 0x8fb50024, 
-0x8fb40020, 0x8fb3001c, 0x8fb20018, 0x8fb10014, 
-0x8fb00010, 0x3e00008, 0x27bd0030, 0x10a00005, 
-0x0, 0xac800000, 0x24a5fffc, 0x14a0fffd, 
-0x24840004, 0x3e00008, 0x0, 0x10c00007, 
-0x0, 0x8c820000, 0x24840004, 0x24c6fffc, 
-0xaca20000, 0x14c0fffb, 0x24a50004, 0x3e00008, 
-0x0, 0x10c00007, 0x0, 0x8ca20000, 
-0x24a50004, 0x24c6fffc, 0xac820000, 0x14c0fffb, 
-0x24840004, 0x3e00008, 0x0, 0x3e00008, 
-0x0, 0x27bdffd8, 0xafbf0020, 0x8ee304e4, 
-0x8ee204e0, 0x10620436, 0x0, 0x8ee204e4, 
-0x8ee304fc, 0x21100, 0x626021, 0x95870008, 
-0x8d8a0000, 0x8d8b0004, 0x958d000a, 0x8ee2725c, 
-0x8ee3726c, 0x30e4ffff, 0x441021, 0x62182b, 
-0x10600015, 0x31a20004, 0x8f8200d8, 0x8ee37258, 
-0x431023, 0xaee2726c, 0x8ee2726c, 0x1c400003, 
-0x3c030001, 0x431021, 0xaee2726c, 0x8ee2725c, 
-0x8ee3726c, 0x441021, 0x62182b, 0x10600006, 
-0x31a20004, 0x8ee201b8, 0x24420001, 0xaee201b8, 
-0x80028e1, 0x8ee201b8, 0x10400240, 0x31a20200, 
-0x1040014d, 0x4821, 0x96e2045a, 0x30420010, 
-0x10400149, 0x0, 0x8f840100, 0x27623000, 
-0x24850020, 0xa2102b, 0x50400001, 0x27652800, 
-0x8f820108, 0x10a20004, 0x0, 0x8f820104, 
-0x14a20006, 0x2402000c, 0x8ee201a8, 0x24420001, 
-0xaee201a8, 0x800252c, 0x8ee201a8, 0xac8a0000, 
-0xac8b0004, 0x8ee37264, 0x24060005, 0xa482000e, 
-0xac860018, 0xac830008, 0x8ee204e4, 0xac82001c, 
-0x8ee204c8, 0xac820010, 0xaf850100, 0x92e204ec, 
-0x14400036, 0x24090001, 0x8ee24e28, 0x210c0, 
-0x24424e38, 0x2e22021, 0x8c820000, 0x1446001f, 
-0x0, 0x8ee34e28, 0x8ee24e2c, 0x1062001b, 
-0x24030040, 0x8c820004, 0x24420001, 0xac820004, 
-0x8ee24e2c, 0x8ee54e28, 0x24420001, 0x10430007, 
-0x0, 0x8ee24e2c, 0x24420001, 0x10a20005, 
-0x0, 0x8002516, 0x0, 0x14a00005, 
-0x0, 0x8f820108, 0x24420020, 0xaf820108, 
-0x8f820108, 0x8c820004, 0x2c420011, 0x50400013, 
-0xac800000, 0x800252c, 0x0, 0x8ee24e28, 
-0x24030040, 0x24420001, 0x50430003, 0x1021, 
-0x8ee24e28, 0x24420001, 0xaee24e28, 0x8ee24e28, 
-0x210c0, 0x24424e38, 0x2e22021, 0x24020005, 
-0xac820000, 0x24020001, 0xac820004, 0x1520000a, 
-0x3c040001, 0xafab0010, 0x8ee27264, 0x3c040001, 
-0x24845730, 0x3c050004, 0xafa20014, 0x8ee604e4, 
-0x80028be, 0x34a5f114, 0x8ee27264, 0x34843800, 
-0x3641821, 0x24420010, 0x43102b, 0x14400073, 
-0x0, 0x8ee27264, 0x24480010, 0x3641021, 
-0x102102b, 0x14400002, 0x3c02ffff, 0x1024021, 
-0x8f850100, 0x27623000, 0x24a60020, 0xc2102b, 
-0x50400001, 0x27662800, 0x8f820108, 0x10c20004, 
-0x0, 0x8f820104, 0x14c20007, 0x2563000c, 
-0x8ee201a8, 0x4821, 0x24420001, 0xaee201a8, 
-0x80025a0, 0x8ee201a8, 0x2c64000c, 0x1441021, 
-0xaca20000, 0xaca30004, 0x24e2fff4, 0xa4a2000e, 
-0x24020006, 0xaca80008, 0xaca20018, 0x8ee204e4, 
-0xaca2001c, 0x8ee204c8, 0x3c030002, 0x431025, 
-0xaca20010, 0xaf860100, 0x92e204ec, 0x14400037, 
-0x24090001, 0x8ee24e28, 0x210c0, 0x24424e38, 
-0x2e22021, 0x8c830000, 0x24020005, 0x1462001f, 
-0x0, 0x8ee34e28, 0x8ee24e2c, 0x1062001b, 
-0x24030040, 0x8c820004, 0x24420001, 0xac820004, 
-0x8ee24e2c, 0x8ee54e28, 0x24420001, 0x10430007, 
-0x0, 0x8ee24e2c, 0x24420001, 0x10a20005, 
-0x0, 0x800258a, 0x0, 0x14a00005, 
-0x0, 0x8f820108, 0x24420020, 0xaf820108, 
-0x8f820108, 0x8c820004, 0x2c420011, 0x50400013, 
-0xac800000, 0x80025a0, 0x0, 0x8ee24e28, 
-0x24030040, 0x24420001, 0x50430003, 0x1021, 
-0x8ee24e28, 0x24420001, 0xaee24e28, 0x8ee24e28, 
-0x210c0, 0x24424e38, 0x2e22021, 0x24020005, 
-0xac820000, 0x24020001, 0xac820004, 0x1520000a, 
-0x2508fffc, 0xafab0010, 0x8ee27264, 0x3c040001, 
-0x24845730, 0x3c050004, 0xafa20014, 0x8ee604e4, 
-0x80028be, 0x34a5f125, 0x34028100, 0xa5020000, 
-0x9582000e, 0x800261d, 0xa5020002, 0x8f850100, 
-0x27623000, 0x24a60020, 0xc2102b, 0x50400001, 
-0x27662800, 0x8f820108, 0x10c20004, 0x0, 
-0x8f820104, 0x14c20007, 0x2563000c, 0x8ee201a8, 
-0x4821, 0x24420001, 0xaee201a8, 0x800260d, 
-0x8ee201a8, 0x2c64000c, 0x1441021, 0xaca20000, 
-0xaca30004, 0x8ee37264, 0x24e2fff4, 0xa4a2000e, 
-0x24020006, 0xaca20018, 0x24630010, 0xaca30008, 
-0x8ee204e4, 0xaca2001c, 0x8ee204c8, 0x3c030002, 
-0x431025, 0xaca20010, 0xaf860100, 0x92e204ec, 
-0x14400037, 0x24090001, 0x8ee24e28, 0x210c0, 
-0x24424e38, 0x2e22021, 0x8c830000, 0x24020005, 
-0x1462001f, 0x0, 0x8ee34e28, 0x8ee24e2c, 
-0x1062001b, 0x24030040, 0x8c820004, 0x24420001, 
-0xac820004, 0x8ee24e2c, 0x8ee54e28, 0x24420001, 
-0x10430007, 0x0, 0x8ee24e2c, 0x24420001, 
-0x10a20005, 0x0, 0x80025f7, 0x0, 
-0x14a00005, 0x0, 0x8f820108, 0x24420020, 
-0xaf820108, 0x8f820108, 0x8c820004, 0x2c420011, 
-0x50400013, 0xac800000, 0x800260d, 0x0, 
-0x8ee24e28, 0x24030040, 0x24420001, 0x50430003, 
-0x1021, 0x8ee24e28, 0x24420001, 0xaee24e28, 
-0x8ee24e28, 0x210c0, 0x24424e38, 0x2e22021, 
-0x24020005, 0xac820000, 0x24020001, 0xac820004, 
-0x1520000a, 0x34028100, 0xafab0010, 0x8ee27264, 
-0x3c040001, 0x24845730, 0x3c050004, 0xafa20014, 
-0x8ee604e4, 0x80028be, 0x34a5f015, 0x8ee37264, 
-0xa462000c, 0x8ee37264, 0x9582000e, 0xa462000e, 
-0x8002681, 0x24e70004, 0x8f840100, 0x27623000, 
-0x24850020, 0xa2102b, 0x50400001, 0x27652800, 
-0x8f820108, 0x10a20004, 0x0, 0x8f820104, 
-0x14a20007, 0x24020006, 0x8ee201a8, 0x4821, 
-0x24420001, 0xaee201a8, 0x8002677, 0x8ee201a8, 
-0xac8a0000, 0xac8b0004, 0x8ee37264, 0xa487000e, 
-0xac820018, 0xac830008, 0x8ee204e4, 0xac82001c, 
-0x8ee204c8, 0x3c030002, 0x431025, 0xac820010, 
-0xaf850100, 0x92e204ec, 0x14400037, 0x24090001, 
-0x8ee24e28, 0x210c0, 0x24424e38, 0x2e22021, 
-0x8c830000, 0x24020005, 0x1462001f, 0x0, 
-0x8ee34e28, 0x8ee24e2c, 0x1062001b, 0x24030040, 
-0x8c820004, 0x24420001, 0xac820004, 0x8ee24e2c, 
-0x8ee54e28, 0x24420001, 0x10430007, 0x0, 
-0x8ee24e2c, 0x24420001, 0x10a20005, 0x0, 
-0x8002661, 0x0, 0x14a00005, 0x0, 
-0x8f820108, 0x24420020, 0xaf820108, 0x8f820108, 
-0x8c820004, 0x2c420011, 0x50400013, 0xac800000, 
-0x8002677, 0x0, 0x8ee24e28, 0x24030040, 
-0x24420001, 0x50430003, 0x1021, 0x8ee24e28, 
-0x24420001, 0xaee24e28, 0x8ee24e28, 0x210c0, 
-0x24424e38, 0x2e22021, 0x24020005, 0xac820000, 
-0x24020001, 0xac820004, 0x15200009, 0x3c050004, 
-0xafab0010, 0x8ee27264, 0x3c040001, 0x24845730, 
-0xafa20014, 0x8ee604e4, 0x80028be, 0x34a5f004, 
-0x8ee2725c, 0x30e7ffff, 0x471021, 0xaee2725c, 
-0x8ee204e4, 0x8ee304fc, 0x8ee47258, 0x21100, 
-0x431021, 0xac44000c, 0x8ee27258, 0xafa20018, 
-0x8ee3725c, 0xafa3001c, 0x8ee2725c, 0x2c42003c, 
-0x10400004, 0x24620001, 0x2403fffe, 0x431024, 
-0xafa2001c, 0x8ee27264, 0x3c060001, 0x34c63800, 
-0x8ee3725c, 0x2405fff8, 0x471021, 0x24420007, 
-0x451024, 0x24630007, 0xaee27258, 0x8ee2726c, 
-0x8ee47258, 0x651824, 0x431023, 0xaee2726c, 
-0x3661021, 0x82202b, 0x14800004, 0x3c03ffff, 
-0x8ee27258, 0x431021, 0xaee27258, 0x8ee27258, 
-0xaee27264, 0x8f8200f0, 0x24470008, 0x27621800, 
-0xe2102b, 0x50400001, 0x27671000, 0x8f8200f4, 
-0x14e20007, 0x0, 0x8ee201b4, 0x4821, 
-0x24420001, 0xaee201b4, 0x80026c4, 0x8ee201b4, 
-0x8f8200f0, 0x24090001, 0x8fa30018, 0x8fa4001c, 
-0xac430000, 0xac440004, 0xaf8700f0, 0x15200012, 
-0xd1142, 0x8f8200f0, 0xafa20010, 0x8f8200f4, 
-0x3c040001, 0x2484573c, 0xafa20014, 0x8fa60018, 
-0x8fa7001c, 0x3c050004, 0xc002403, 0x34a5f005, 
-0x8ee20088, 0x24420001, 0xaee20088, 0x8ee20088, 
-0x80028d3, 0xaee0725c, 0x30430003, 0x24020002, 
-0x10620016, 0x28620003, 0x10400005, 0x24020001, 
-0x10620008, 0x0, 0x8002703, 0x0, 
-0x24020003, 0x10620017, 0x0, 0x8002703, 
-0x0, 0x8ee200e8, 0x8ee300ec, 0x24630001, 
-0x2c640001, 0x441021, 0xaee200e8, 0xaee300ec, 
-0x8ee200e8, 0x8002703, 0x8ee300ec, 0x8ee200f0, 
-0x8ee300f4, 0x24630001, 0x2c640001, 0x441021, 
-0xaee200f0, 0xaee300f4, 0x8ee200f0, 0x8002703, 
-0x8ee300f4, 0x8ee200f8, 0x8ee300fc, 0x24630001, 
-0x2c640001, 0x441021, 0xaee200f8, 0xaee300fc, 
-0x8ee200f8, 0x8ee300fc, 0x8ee2725c, 0x8ee400e0, 
-0x8ee500e4, 0x401821, 0x1021, 0xa32821, 
-0xa3302b, 0x822021, 0x862021, 0xaee400e0, 
-0xaee500e4, 0x80028d3, 0xaee0725c, 0x30e2ffff, 
-0x104001c1, 0x31a20200, 0x1040014d, 0x4821, 
-0x96e2045a, 0x30420010, 0x10400149, 0x0, 
-0x8f840100, 0x27623000, 0x24850020, 0xa2102b, 
-0x50400001, 0x27652800, 0x8f820108, 0x10a20004, 
-0x0, 0x8f820104, 0x14a20006, 0x2402000c, 
-0x8ee201a8, 0x24420001, 0xaee201a8, 0x800276e, 
-0x8ee201a8, 0xac8a0000, 0xac8b0004, 0x8ee37264, 
-0x24060005, 0xa482000e, 0xac860018, 0xac830008, 
-0x8ee204e4, 0xac82001c, 0x8ee204c8, 0xac820010, 
-0xaf850100, 0x92e204ec, 0x14400036, 0x24090001, 
-0x8ee24e28, 0x210c0, 0x24424e38, 0x2e22021, 
-0x8c820000, 0x1446001f, 0x0, 0x8ee34e28, 
-0x8ee24e2c, 0x1062001b, 0x24030040, 0x8c820004, 
-0x24420001, 0xac820004, 0x8ee24e2c, 0x8ee54e28, 
-0x24420001, 0x10430007, 0x0, 0x8ee24e2c, 
-0x24420001, 0x10a20005, 0x0, 0x8002758, 
-0x0, 0x14a00005, 0x0, 0x8f820108, 
-0x24420020, 0xaf820108, 0x8f820108, 0x8c820004, 
-0x2c420011, 0x50400013, 0xac800000, 0x800276e, 
-0x0, 0x8ee24e28, 0x24030040, 0x24420001, 
-0x50430003, 0x1021, 0x8ee24e28, 0x24420001, 
-0xaee24e28, 0x8ee24e28, 0x210c0, 0x24424e38, 
-0x2e22021, 0x24020005, 0xac820000, 0x24020001, 
-0xac820004, 0x1520000a, 0x3c040001, 0xafab0010, 
-0x8ee27264, 0x3c040001, 0x24845730, 0x3c050004, 
-0xafa20014, 0x8ee604e4, 0x80028be, 0x34a5f014, 
-0x8ee27264, 0x34843800, 0x3641821, 0x24420010, 
-0x43102b, 0x14400073, 0x0, 0x8ee27264, 
-0x24480010, 0x3641021, 0x102102b, 0x14400002, 
-0x3c02ffff, 0x1024021, 0x8f850100, 0x27623000, 
-0x24a60020, 0xc2102b, 0x50400001, 0x27662800, 
-0x8f820108, 0x10c20004, 0x0, 0x8f820104, 
-0x14c20007, 0x2563000c, 0x8ee201a8, 0x4821, 
-0x24420001, 0xaee201a8, 0x80027e2, 0x8ee201a8, 
-0x2c64000c, 0x1441021, 0xaca20000, 0xaca30004, 
-0x24e2fff4, 0xa4a2000e, 0x24020006, 0xaca80008, 
-0xaca20018, 0x8ee204e4, 0xaca2001c, 0x8ee204c8, 
-0x3c030002, 0x431025, 0xaca20010, 0xaf860100, 
-0x92e204ec, 0x14400037, 0x24090001, 0x8ee24e28, 
-0x210c0, 0x24424e38, 0x2e22021, 0x8c830000, 
-0x24020005, 0x1462001f, 0x0, 0x8ee34e28, 
-0x8ee24e2c, 0x1062001b, 0x24030040, 0x8c820004, 
-0x24420001, 0xac820004, 0x8ee24e2c, 0x8ee54e28, 
-0x24420001, 0x10430007, 0x0, 0x8ee24e2c, 
-0x24420001, 0x10a20005, 0x0, 0x80027cc, 
-0x0, 0x14a00005, 0x0, 0x8f820108, 
-0x24420020, 0xaf820108, 0x8f820108, 0x8c820004, 
-0x2c420011, 0x50400013, 0xac800000, 0x80027e2, 
-0x0, 0x8ee24e28, 0x24030040, 0x24420001, 
-0x50430003, 0x1021, 0x8ee24e28, 0x24420001, 
-0xaee24e28, 0x8ee24e28, 0x210c0, 0x24424e38, 
-0x2e22021, 0x24020005, 0xac820000, 0x24020001, 
-0xac820004, 0x1520000a, 0x2508fffc, 0xafab0010, 
-0x8ee27264, 0x3c040001, 0x24845730, 0x3c050004, 
-0xafa20014, 0x8ee604e4, 0x80028be, 0x34a5f015, 
-0x34028100, 0xa5020000, 0x9582000e, 0x800285f, 
-0xa5020002, 0x8f850100, 0x27623000, 0x24a60020, 
-0xc2102b, 0x50400001, 0x27662800, 0x8f820108, 
-0x10c20004, 0x0, 0x8f820104, 0x14c20007, 
-0x2563000c, 0x8ee201a8, 0x4821, 0x24420001, 
-0xaee201a8, 0x800284f, 0x8ee201a8, 0x2c64000c, 
-0x1441021, 0xaca20000, 0xaca30004, 0x8ee37264, 
-0x24e2fff4, 0xa4a2000e, 0x24020006, 0xaca20018, 
-0x24630010, 0xaca30008, 0x8ee204e4, 0xaca2001c, 
-0x8ee204c8, 0x3c030002, 0x431025, 0xaca20010, 
-0xaf860100, 0x92e204ec, 0x14400037, 0x24090001, 
-0x8ee24e28, 0x210c0, 0x24424e38, 0x2e22021, 
-0x8c830000, 0x24020005, 0x1462001f, 0x0, 
-0x8ee34e28, 0x8ee24e2c, 0x1062001b, 0x24030040, 
-0x8c820004, 0x24420001, 0xac820004, 0x8ee24e2c, 
-0x8ee54e28, 0x24420001, 0x10430007, 0x0, 
-0x8ee24e2c, 0x24420001, 0x10a20005, 0x0, 
-0x8002839, 0x0, 0x14a00005, 0x0, 
-0x8f820108, 0x24420020, 0xaf820108, 0x8f820108, 
-0x8c820004, 0x2c420011, 0x50400013, 0xac800000, 
-0x800284f, 0x0, 0x8ee24e28, 0x24030040, 
-0x24420001, 0x50430003, 0x1021, 0x8ee24e28, 
-0x24420001, 0xaee24e28, 0x8ee24e28, 0x210c0, 
-0x24424e38, 0x2e22021, 0x24020005, 0xac820000, 
-0x24020001, 0xac820004, 0x1520000a, 0x34028100, 
-0xafab0010, 0x8ee27264, 0x3c040001, 0x24845730, 
-0x3c050004, 0xafa20014, 0x8ee604e4, 0x80028be, 
-0x34a5f016, 0x8ee37264, 0xa462000c, 0x8ee37264, 
-0x9582000e, 0xa462000e, 0x80028c2, 0x24e70004, 
-0x8f830100, 0x27623000, 0x24640020, 0x82102b, 
-0x50400001, 0x27642800, 0x8f820108, 0x10820004, 
-0x0, 0x8f820104, 0x14820007, 0x24050005, 
-0x8ee201a8, 0x4821, 0x24420001, 0xaee201a8, 
-0x80028b6, 0x8ee201a8, 0xac6a0000, 0xac6b0004, 
-0x8ee27264, 0xa467000e, 0xac650018, 0xac620008, 
-0x8ee204e4, 0xac62001c, 0x8ee204c8, 0xac620010, 
-0xaf840100, 0x92e204ec, 0x14400036, 0x24090001, 
-0x8ee24e28, 0x210c0, 0x24424e38, 0x2e22021, 
-0x8c820000, 0x1445001f, 0x0, 0x8ee34e28, 
-0x8ee24e2c, 0x1062001b, 0x24030040, 0x8c820004, 
-0x24420001, 0xac820004, 0x8ee24e2c, 0x8ee54e28, 
-0x24420001, 0x10430007, 0x0, 0x8ee24e2c, 
-0x24420001, 0x10a20005, 0x0, 0x80028a0, 
-0x0, 0x14a00005, 0x0, 0x8f820108, 
-0x24420020, 0xaf820108, 0x8f820108, 0x8c820004, 
-0x2c420011, 0x50400013, 0xac800000, 0x80028b6, 
-0x0, 0x8ee24e28, 0x24030040, 0x24420001, 
-0x50430003, 0x1021, 0x8ee24e28, 0x24420001, 
-0xaee24e28, 0x8ee24e28, 0x210c0, 0x24424e38, 
-0x2e22021, 0x24020005, 0xac820000, 0x24020001, 
-0xac820004, 0x1520000b, 0x3c050004, 0x3c040001, 
-0x24845748, 0xafab0010, 0xafa00014, 0x8ee604e4, 
-0x34a5f017, 0xc002403, 0x30e7ffff, 0x80028e1, 
-0x0, 0x8ee27264, 0x3c050001, 0x30e4ffff, 
-0x441021, 0xaee27264, 0x8ee2725c, 0x8ee37264, 
-0x34a53800, 0x441021, 0xaee2725c, 0x3651021, 
-0x62182b, 0x14600004, 0x3c03ffff, 0x8ee27264, 
-0x431021, 0xaee27264, 0x8ee304e4, 0x96e20458, 
-0x24630001, 0x2442ffff, 0x621824, 0xaee304e4, 
-0x8ee304e4, 0x8ee204e0, 0x14620005, 0x0, 
-0x8f820060, 0x2403fff7, 0x431024, 0xaf820060, 
-0x8fbf0020, 0x3e00008, 0x27bd0028, 0x27bdffe0, 
-0xafbf0018, 0x8ee304e8, 0x8ee204e0, 0x10620189, 
-0x0, 0x8ee204e8, 0x8ee304fc, 0x21100, 
-0x621821, 0x94670008, 0x92e204ed, 0x8c680000, 
-0x8c690004, 0x10400023, 0x946a000a, 0x8ee204c8, 
-0x34460400, 0x31420200, 0x1040001f, 0x0, 
-0x96e2045a, 0x30420010, 0x1040001b, 0x3c028000, 
-0x3c010001, 0x370821, 0xac2283d8, 0x8ee27264, 
-0x9464000e, 0x3c050001, 0x34a53800, 0x24420004, 
-0xaee27264, 0x8ee37264, 0x42400, 0x3651021, 
-0x3c010001, 0x370821, 0xac2483dc, 0x62182b, 
-0x14600005, 0x24e70004, 0x8ee27264, 0x3c03ffff, 
-0x431021, 0xaee27264, 0x8ee27264, 0x8002917, 
-0xaee27258, 0x8ee604c8, 0x8ee2726c, 0x30e4ffff, 
-0x44102a, 0x10400015, 0x0, 0x8f8200d8, 
-0x8ee37258, 0x431023, 0xaee2726c, 0x8ee2726c, 
-0x1c400007, 0x44102a, 0x8ee2726c, 0x3c030001, 
-0x431021, 0xaee2726c, 0x8ee2726c, 0x44102a, 
-0x10400006, 0x0, 0x8ee201b8, 0x24420001, 
-0xaee201b8, 0x8002a72, 0x8ee201b8, 0x3c020001, 
-0x571021, 0x8c4283d8, 0x54400001, 0x24e7fffc, 
-0x31420004, 0x104000b9, 0x30e2ffff, 0x3c020001, 
-0x571021, 0x8c4283d8, 0x1040002f, 0x5021, 
-0x8f840100, 0x27623000, 0x24850020, 0xa2102b, 
-0x50400001, 0x27652800, 0x8f820108, 0x10a20032, 
-0x0, 0x8f820104, 0x10a2002f, 0x24020015, 
-0xac880000, 0xac890004, 0x8ee37264, 0xa487000e, 
-0xac820018, 0xac830008, 0x8ee204e8, 0x3c030001, 
-0x771821, 0x8c6383dc, 0xac860010, 0x431025, 
-0xac82001c, 0xaf850100, 0x92e204ec, 0x14400066, 
-0x240a0001, 0x8ee24e28, 0x24030040, 0x24420001, 
-0x50430003, 0x1021, 0x8ee24e28, 0x24420001, 
-0xaee24e28, 0x8ee24e28, 0x210c0, 0x24424e38, 
-0x2e21821, 0x24020015, 0xac620000, 0x24020001, 
-0x80029bf, 0xac620004, 0x8f840100, 0x27623000, 
-0x24850020, 0xa2102b, 0x50400001, 0x27652800, 
-0x8f820108, 0x10a20004, 0x0, 0x8f820104, 
-0x14a20006, 0x24020006, 0x8ee201a8, 0x24420001, 
-0xaee201a8, 0x80029bf, 0x8ee201a8, 0xac880000, 
-0xac890004, 0x8ee37264, 0xa487000e, 0xac820018, 
-0xac830008, 0x8ee204e8, 0xac860010, 0xac82001c, 
-0xaf850100, 0x92e204ec, 0x14400037, 0x240a0001, 
-0x8ee24e28, 0x210c0, 0x24424e38, 0x2e22021, 
-0x8c830000, 0x24020005, 0x1462001f, 0x0, 
-0x8ee34e28, 0x8ee24e2c, 0x1062001b, 0x24030040, 
-0x8c820004, 0x24420001, 0xac820004, 0x8ee24e2c, 
-0x8ee54e28, 0x24420001, 0x10430007, 0x0, 
-0x8ee24e2c, 0x24420001, 0x10a20005, 0x0, 
-0x80029a9, 0x0, 0x14a00005, 0x0, 
-0x8f820108, 0x24420020, 0xaf820108, 0x8f820108, 
-0x8c820004, 0x2c420011, 0x50400013, 0xac800000, 
-0x80029bf, 0x0, 0x8ee24e28, 0x24030040, 
-0x24420001, 0x50430003, 0x1021, 0x8ee24e28, 
-0x24420001, 0xaee24e28, 0x8ee24e28, 0x210c0, 
-0x24424e38, 0x2e22021, 0x24020005, 0xac820000, 
-0x24020001, 0xac820004, 0x1540000a, 0x24020001, 
-0xafa90010, 0x8ee27264, 0x3c040001, 0x24845730, 
-0x3c050004, 0xafa20014, 0x8ee604e4, 0x8002a4f, 
-0x34a5f204, 0xa2e204ed, 0x8ee204e8, 0x8ee304fc, 
-0x8ee47258, 0x3c060001, 0x34c63800, 0x3c010001, 
-0x370821, 0xac2083d8, 0x3c010001, 0x370821, 
-0xac2083dc, 0x21100, 0x431021, 0xac44000c, 
-0x8ee27264, 0x2405fff8, 0x30e3ffff, 0x431021, 
-0x24420007, 0x451024, 0x24630007, 0xaee27258, 
-0x8ee2726c, 0x8ee47258, 0x651824, 0x431023, 
-0xaee2726c, 0x3661021, 0x82202b, 0x14800004, 
-0x3c03ffff, 0x8ee27258, 0x431021, 0xaee27258, 
-0x8ee27258, 0x8002a64, 0xaee27264, 0x10400073, 
-0x0, 0x8f830100, 0x27623000, 0x24640020, 
-0x82102b, 0x14400002, 0x5021, 0x27642800, 
-0x8f820108, 0x10820004, 0x0, 0x8f820104, 
-0x14820006, 0x24050005, 0x8ee201a8, 0x24420001, 
-0xaee201a8, 0x8002a46, 0x8ee201a8, 0xac680000, 
-0xac690004, 0x8ee27264, 0xa467000e, 0xac650018, 
-0xac620008, 0x8ee204e8, 0xac660010, 0xac62001c, 
-0xaf840100, 0x92e204ec, 0x14400036, 0x240a0001, 
-0x8ee24e28, 0x210c0, 0x24424e38, 0x2e22021, 
-0x8c820000, 0x1445001f, 0x0, 0x8ee34e28, 
-0x8ee24e2c, 0x1062001b, 0x24030040, 0x8c820004, 
-0x24420001, 0xac820004, 0x8ee24e2c, 0x8ee54e28, 
-0x24420001, 0x10430007, 0x0, 0x8ee24e2c, 
-0x24420001, 0x10a20005, 0x0, 0x8002a30, 
-0x0, 0x14a00005, 0x0, 0x8f820108, 
-0x24420020, 0xaf820108, 0x8f820108, 0x8c820004, 
-0x2c420011, 0x50400013, 0xac800000, 0x8002a46, 
-0x0, 0x8ee24e28, 0x24030040, 0x24420001, 
-0x50430003, 0x1021, 0x8ee24e28, 0x24420001, 
-0xaee24e28, 0x8ee24e28, 0x210c0, 0x24424e38, 
-0x2e22021, 0x24020005, 0xac820000, 0x24020001, 
-0xac820004, 0x1540000c, 0x30e5ffff, 0x3c040001, 
-0x24845748, 0x3c050004, 0xafa90010, 0xafa00014, 
-0x8ee604e4, 0x34a5f237, 0xc002403, 0x30e7ffff, 
-0x8002a72, 0x0, 0x8ee27264, 0x451021, 
-0xaee27264, 0x8ee2726c, 0x8ee37264, 0x3c040001, 
-0x34843800, 0xa2e004ed, 0x451023, 0xaee2726c, 
-0x3641021, 0x62182b, 0x14600004, 0x3c03ffff, 
-0x8ee27264, 0x431021, 0xaee27264, 0x8ee304e8, 
-0x96e20458, 0x24630001, 0x2442ffff, 0x621824, 
-0xaee304e8, 0x8ee304e8, 0x8ee204e0, 0x14620005, 
-0x0, 0x8f820060, 0x2403fff7, 0x431024, 
-0xaf820060, 0x8fbf0018, 0x3e00008, 0x27bd0020, 
-0x27bdffe0, 0xafbf001c, 0xafb00018, 0x8f820100, 
-0x8ee34e2c, 0x8f820104, 0x8f850108, 0x24020040, 
-0x24630001, 0x50620003, 0x1021, 0x8ee24e2c, 
-0x24420001, 0xaee24e2c, 0x8ee24e2c, 0x8ee34e2c, 
-0x210c0, 0x24424e38, 0x2e22021, 0x8ee24e28, 
-0x8c870004, 0x14620007, 0xa03021, 0x8f820108, 
-0x24420020, 0xaf820108, 0x8f820108, 0x8002aa2, 
-0xac800000, 0x8ee24e2c, 0x24030040, 0x24420001, 
-0x50430003, 0x1021, 0x8ee24e2c, 0x24420001, 
-0x210c0, 0x24424e38, 0x2e22021, 0x8c820004, 
-0x8f830108, 0x21140, 0x621821, 0xaf830108, 
-0xac800000, 0x8cc20018, 0x2443fffe, 0x2c620013, 
-0x104000c1, 0x31080, 0x3c010001, 0x220821, 
-0x8c225770, 0x400008, 0x0, 0x8ee204f0, 
-0x471021, 0xaee204f0, 0x8ee204f0, 0x8f43023c, 
-0x43102b, 0x144000be, 0x0, 0x8ee304e4, 
-0x8ee204f8, 0x506200ba, 0xa2e004f4, 0x8f830120, 
-0x27623800, 0x24660020, 0xc2102b, 0x50400001, 
-0x27663000, 0x8f820128, 0x10c20004, 0x0, 
-0x8f820124, 0x14c20007, 0x0, 0x8ee201a4, 
-0x8021, 0x24420001, 0xaee201a4, 0x8002b12, 
-0x8ee201a4, 0x8ee204e4, 0xac62001c, 0x8ee404b0, 
-0x8ee504b4, 0x2462001c, 0xac620008, 0x24020008, 
-0xa462000e, 0x24020011, 0xac620018, 0xac640000, 
-0xac650004, 0x8ee204c4, 0xac620010, 0xaf860120, 
-0x92e24e20, 0x14400037, 0x24100001, 0x8ee24e30, 
-0x210c0, 0x24425038, 0x2e22021, 0x8c830000, 
-0x24020012, 0x1462001f, 0x0, 0x8ee34e30, 
-0x8ee24e34, 0x1062001b, 0x24030040, 0x8c820004, 
-0x24420001, 0xac820004, 0x8ee24e34, 0x8ee54e30, 
-0x24420001, 0x10430007, 0x0, 0x8ee24e34, 
-0x24420001, 0x10a20005, 0x0, 0x8002afc, 
-0x0, 0x14a00005, 0x0, 0x8f820128, 
-0x24420020, 0xaf820128, 0x8f820128, 0x8c820004, 
-0x2c420011, 0x50400013, 0xac800000, 0x8002b12, 
-0x0, 0x8ee24e30, 0x24030040, 0x24420001, 
-0x50430003, 0x1021, 0x8ee24e30, 0x24420001, 
-0xaee24e30, 0x8ee24e30, 0x210c0, 0x24425038, 
-0x2e22021, 0x24020012, 0xac820000, 0x24020001, 
-0xac820004, 0x5600000b, 0x24100001, 0x8ee204e4, 
-0x3c040001, 0x24845754, 0xafa00014, 0xafa20010, 
-0x8ee60608, 0x8f470228, 0x3c050009, 0xc002403, 
-0x34a5f006, 0x16000003, 0x24020001, 0x8002b71, 
-0xa2e204f4, 0x8ee20170, 0x24420001, 0xaee20170, 
-0x8ee20170, 0x8ee204e4, 0xa2e004f4, 0xaee004f0, 
-0xaee204f8, 0x8f42023c, 0x50400045, 0xaee07274, 
-0x8ee20184, 0x24420001, 0xaee20184, 0x8ee20184, 
-0x8002b71, 0xaee07274, 0x8ee20504, 0x24030040, 
-0x24420001, 0x50430003, 0x1021, 0x8ee20504, 
-0x24420001, 0xaee20504, 0x8ee20504, 0x8cc30018, 
-0x21080, 0x571021, 0x8c440508, 0x24020003, 
-0x1462000f, 0x0, 0x3c020001, 0x571021, 
-0x904283b1, 0x10400014, 0x0, 0x8ee201d0, 
-0x8ee35240, 0x441021, 0xaee201d0, 0x8ee201d8, 
-0x641821, 0x306300ff, 0x8002b59, 0xaee35240, 
-0x8ee201cc, 0x8ee30e10, 0x441021, 0xaee201cc, 
-0x8ee201d8, 0x641821, 0x306301ff, 0xaee30e10, 
-0x441021, 0xaee201d8, 0x8ee20000, 0x34420040, 
-0x8002b71, 0xaee20000, 0x8ee2014c, 0x3c010001, 
-0x370821, 0xa02083e0, 0x24420001, 0xaee2014c, 
-0x8002b71, 0x8ee2014c, 0x94c7000e, 0x8cc2001c, 
-0x3c040001, 0x24845760, 0xafa60014, 0xafa20010, 
-0x8cc60018, 0x3c050008, 0xc002403, 0x34a50910, 
-0x8fbf001c, 0x8fb00018, 0x3e00008, 0x27bd0020, 
-0x27bdff98, 0xafbf0060, 0xafbe005c, 0xafb60058, 
-0xafb50054, 0xafb40050, 0xafb3004c, 0xafb20048, 
-0xafb10044, 0xafb00040, 0x8f830108, 0x8f820104, 
-0xafa00024, 0x106203e7, 0xafa0002c, 0x3c1e0001, 
-0x37de3800, 0x3c0bffff, 0x8f930108, 0x8e620018, 
-0x8f830104, 0x2443fffe, 0x2c620014, 0x104003cf, 
-0x31080, 0x3c010001, 0x220821, 0x8c2257c0, 
-0x400008, 0x0, 0x9663000e, 0x8ee2725c, 
-0x8ee404f0, 0x431021, 0xaee2725c, 0x8e63001c, 
-0x96e20458, 0x24840001, 0xaee404f0, 0x24630001, 
-0x2442ffff, 0x621824, 0xaee304e4, 0x8f42023c, 
-0x82202b, 0x148003b9, 0x0, 0x8f830120, 
-0x27623800, 0x24660020, 0xc2102b, 0x50400001, 
-0x27663000, 0x8f820128, 0x10c20004, 0x0, 
-0x8f820124, 0x14c20007, 0x0, 0x8ee201a4, 
-0x8021, 0x24420001, 0xaee201a4, 0x8002bfe, 
-0x8ee201a4, 0x8ee204e4, 0xac62001c, 0x8ee404b0, 
-0x8ee504b4, 0x2462001c, 0xac620008, 0x24020008, 
-0xa462000e, 0x24020011, 0xac620018, 0xac640000, 
-0xac650004, 0x8ee204c4, 0xac620010, 0xaf860120, 
-0x92e24e20, 0x14400037, 0x24100001, 0x8ee24e30, 
-0x210c0, 0x24425038, 0x2e22021, 0x8c830000, 
-0x24020012, 0x1462001f, 0x0, 0x8ee34e30, 
-0x8ee24e34, 0x1062001b, 0x240c0040, 0x8c820004, 
-0x24420001, 0xac820004, 0x8ee24e34, 0x8ee34e30, 
-0x24420001, 0x104c0007, 0x0, 0x8ee24e34, 
-0x24420001, 0x10620005, 0x0, 0x8002be8, 
-0x0, 0x14600005, 0x0, 0x8f820128, 
-0x24420020, 0xaf820128, 0x8f820128, 0x8c820004, 
-0x2c420011, 0x50400013, 0xac800000, 0x8002bfe, 
-0x0, 0x8ee24e30, 0x240c0040, 0x24420001, 
-0x504c0003, 0x1021, 0x8ee24e30, 0x24420001, 
-0xaee24e30, 0x8ee24e30, 0x210c0, 0x24425038, 
-0x2e22021, 0x24020012, 0x240c0001, 0xac820000, 
-0xac8c0004, 0x5600000d, 0x24100001, 0x8ee204e4, 
-0x3c040001, 0x24845754, 0xafa00014, 0xafa20010, 
-0x8ee60608, 0x8f470228, 0x3c050009, 0x34a5f006, 
-0xc002403, 0xafab0038, 0x8fab0038, 0x1200030a, 
-0x240c0001, 0x8002f19, 0x0, 0x966c001c, 
-0xafac002c, 0x9662001e, 0x3c0c8000, 0xafac0024, 
-0xae62001c, 0x8e75001c, 0x8ee204fc, 0x8ee404fc, 
-0x151900, 0x621021, 0x8c52000c, 0x92e27b98, 
-0x641821, 0x9476000a, 0x14400003, 0x32c20002, 
-0xaef27ba4, 0xaef57b9c, 0x1040004b, 0x8021, 
-0x96e2045a, 0x30420002, 0x10400047, 0x0, 
-0x8e63001c, 0x8ee204fc, 0x32100, 0x821021, 
-0x8c42000c, 0x37e1821, 0x24420022, 0x43102b, 
-0x1440000a, 0x24050014, 0x8ee204fc, 0x821021, 
-0x8c44000c, 0xafab0038, 0xc002f75, 0x2484000e, 
-0x8fab0038, 0x8002c52, 0x3050ffff, 0x8ee204fc, 
-0x821021, 0x8c42000c, 0x9450000e, 0x94430010, 
-0x94440012, 0x94450014, 0x2038021, 0x2048021, 
-0x2058021, 0x94430016, 0x94440018, 0x9445001a, 
-0x2038021, 0x2048021, 0x2058021, 0x9443001c, 
-0x9444001e, 0x94420020, 0x2038021, 0x2048021, 
-0x2028021, 0x101c02, 0x3202ffff, 0x628021, 
-0x8e63001c, 0x8ee204fc, 0x102402, 0x32900, 
-0xa21021, 0x8c43000c, 0x3202ffff, 0x828021, 
-0x37e1021, 0x24630018, 0x62182b, 0x14600009, 
-0x0, 0x8ee204fc, 0xa21021, 0x8c43000c, 
-0x101027, 0x3c01ffff, 0x230821, 0x8002c6f, 
-0xa4220018, 0x8ee204fc, 0xa21021, 0x8c43000c, 
-0x101027, 0xa4620018, 0x96e2045a, 0x8821, 
-0x30420008, 0x14400063, 0xa021, 0x8e63001c, 
-0x8ee204fc, 0x33100, 0xc21021, 0x8c42000c, 
-0x37e1821, 0x24420022, 0x43102b, 0x14400035, 
-0x0, 0x8ee204fc, 0xc21021, 0x8c42000c, 
-0x24470010, 0x37e1021, 0xe2102b, 0x50400001, 
-0xeb3821, 0x8ee204fc, 0x94f10000, 0xc21021, 
-0x8c42000c, 0x24470016, 0x37e1021, 0xe2102b, 
-0x14400002, 0x2634ffec, 0xeb3821, 0x8ee204fc, 
-0x90e30001, 0xc21021, 0x8c42000c, 0x2447001a, 
-0x37e1021, 0xe2102b, 0x14400002, 0x2838821, 
-0xeb3821, 0x94e20000, 0x24e70002, 0x2228821, 
-0x37e1021, 0xe2102b, 0x50400001, 0xeb3821, 
-0x94e20000, 0x24e70002, 0x2228821, 0x37e1021, 
-0xe2102b, 0x50400001, 0xeb3821, 0x94e20000, 
-0x24e70002, 0x2228821, 0x37e1021, 0xe2102b, 
-0x50400001, 0xeb3821, 0x94e20000, 0x8002cd0, 
-0x2228821, 0x8ee204fc, 0xc21021, 0x8c43000c, 
-0x8ee204fc, 0x94710010, 0x8ee304fc, 0xc21021, 
-0x8c44000c, 0xc31821, 0x8c62000c, 0x2634ffec, 
-0x90840017, 0x8ee304fc, 0x9442001a, 0x2848821, 
-0xc31821, 0x8c65000c, 0x8ee304fc, 0x2228821, 
-0x8ee204fc, 0xc31821, 0xc21021, 0x8c44000c, 
-0x8c62000c, 0x94a3001c, 0x9484001e, 0x94420020, 
-0x2238821, 0x2248821, 0x2228821, 0x111c02, 
-0x3222ffff, 0x628821, 0x111c02, 0x3222ffff, 
-0x628821, 0x32c20001, 0x104000b2, 0x0, 
-0x96e2045a, 0x30420001, 0x104000ae, 0x32c20080, 
-0x10400008, 0x0, 0x92e27b98, 0x14400005, 
-0x0, 0x240c0001, 0xa2ec7b98, 0xaef57b9c, 
-0xaef27ba4, 0x8ee304fc, 0x151100, 0x431021, 
-0x8c47000c, 0x37e1821, 0x24e2000e, 0x43102b, 
-0x14400008, 0xe02021, 0x2405000e, 0xc002f75, 
-0xafab0038, 0x3042ffff, 0x8fab0038, 0x8002d09, 
-0x2028021, 0x94e60000, 0x24e70002, 0x94e50000, 
-0x24e70002, 0x94e30000, 0x24e70002, 0x94e20000, 
-0x24e70002, 0x94e40000, 0x24e70002, 0x2068021, 
-0x2058021, 0x2038021, 0x2028021, 0x94e20000, 
-0x94e30002, 0x2048021, 0x2028021, 0x2038021, 
-0x101c02, 0x3202ffff, 0x628021, 0x101c02, 
-0x3202ffff, 0x8ee47b9c, 0x628021, 0x14950004, 
-0x3205ffff, 0x96620016, 0x8002d17, 0x512021, 
-0x96620016, 0x542021, 0x41402, 0x3083ffff, 
-0x432021, 0x852023, 0x41402, 0x822021, 
-0x3084ffff, 0x50800001, 0x3404ffff, 0x8ee27ba4, 
-0x24430017, 0x37e1021, 0x62102b, 0x50400001, 
-0x6b1821, 0x90630000, 0x24020011, 0x14620031, 
-0x24020006, 0x8ee27ba4, 0x37e1821, 0x24420028, 
-0x43102b, 0x14400018, 0x0, 0x8ee27b9c, 
-0x12a2000a, 0x32c20100, 0x8ee27ba4, 0x3c01ffff, 
-0x220821, 0x94220028, 0x822021, 0x41c02, 
-0x3082ffff, 0x622021, 0x32c20100, 0x14400004, 
-0x41027, 0x92e27b98, 0x14400002, 0x41027, 
-0x3044ffff, 0x8ee27ba4, 0x3c01ffff, 0x220821, 
-0x8002d8a, 0xa4240028, 0x8ee27b9c, 0x12a20008, 
-0x32c20100, 0x8ee27ba4, 0x94420028, 0x822021, 
-0x41c02, 0x3082ffff, 0x622021, 0x32c20100, 
-0x14400004, 0x41027, 0x92e27b98, 0x14400002, 
-0x41027, 0x3044ffff, 0x8ee27ba4, 0x8002d8a, 
-0xa4440028, 0x1462002f, 0x37e1821, 0x8ee27ba4, 
-0x24420032, 0x43102b, 0x14400018, 0x0, 
-0x8ee27b9c, 0x12a2000a, 0x32c20100, 0x8ee27ba4, 
-0x3c01ffff, 0x220821, 0x94220032, 0x822021, 
-0x41c02, 0x3082ffff, 0x622021, 0x32c20100, 
-0x14400004, 0x41027, 0x92e27b98, 0x14400002, 
-0x41027, 0x3044ffff, 0x8ee27ba4, 0x3c01ffff, 
-0x220821, 0x8002d8a, 0xa4240032, 0x8ee27b9c, 
-0x12a20008, 0x32c20100, 0x8ee27ba4, 0x94420032, 
-0x822021, 0x41c02, 0x3082ffff, 0x622021, 
-0x32c20100, 0x14400004, 0x41027, 0x92e27b98, 
-0x14400002, 0x41027, 0x3044ffff, 0x8ee27ba4, 
-0xa4440032, 0x8fac0024, 0x1180002c, 0x37e1821, 
-0x8e420000, 0xae42fffc, 0x2642000a, 0x43102b, 
-0x1440001b, 0x34038100, 0x26430004, 0x37e1021, 
-0x62102b, 0x14400003, 0x602021, 0x6b1821, 
-0x602021, 0x8c620000, 0x24630004, 0xae420000, 
-0x37e1021, 0x62102b, 0x50400001, 0x6b1821, 
-0x8c620000, 0xac820000, 0x34028100, 0xa4620000, 
-0x24630002, 0x37e1021, 0x62102b, 0x50400001, 
-0x6b1821, 0x97ac002e, 0x8002db4, 0xa46c0000, 
-0x8e420004, 0x8e440008, 0xa6430008, 0x97ac002e, 
-0xa64c000a, 0xae420000, 0xae440004, 0x9662000e, 
-0x2652fffc, 0x24420004, 0xa662000e, 0x9662000e, 
-0x8ee3725c, 0x621821, 0xaee3725c, 0xafb20018, 
-0x8ee3725c, 0xafa3001c, 0x8ee2725c, 0x2c42003c, 
-0x10400004, 0x24620001, 0x2403fffe, 0x431024, 
-0xafa2001c, 0x32c20080, 0x1040000c, 0x32c20100, 
-0x8ee27ba8, 0x24430001, 0x210c0, 0x571021, 
-0xaee37ba8, 0x8fa30018, 0x8fa4001c, 0xac437bac, 
-0xac447bb0, 0x8002ea0, 0xaee0725c, 0x10400072, 
-0x0, 0x8ee27ba8, 0x24430001, 0x210c0, 
-0x571021, 0xaee37ba8, 0x8fa30018, 0x8fa4001c, 
-0xac437bac, 0xac447bb0, 0x8ee27ba8, 0x10400063, 
-0x4821, 0x5021, 0x8f8200f0, 0x24480008, 
-0x27621800, 0x102102b, 0x50400001, 0x27681000, 
-0x8f8200f4, 0x15020007, 0x0, 0x8ee201b4, 
-0x8021, 0x24420001, 0xaee201b4, 0x8002dfa, 
-0x8ee201b4, 0x8f8300f0, 0x24100001, 0x1571021, 
-0x8c447bac, 0x8c457bb0, 0xac640000, 0xac650004, 
-0xaf8800f0, 0x16000006, 0x2ea1021, 0x8ee20088, 
-0x24420001, 0xaee20088, 0x8002e3f, 0x8ee20088, 
-0x8c427bb0, 0x8ee400e0, 0x8ee500e4, 0x8ee67b9c, 
-0x401821, 0x1021, 0xa32821, 0xa3382b, 
-0x822021, 0x872021, 0x8ee204fc, 0xc93021, 
-0x63100, 0xaee400e0, 0xaee500e4, 0xc23021, 
-0x94c2000a, 0x240c0002, 0x21142, 0x30430003, 
-0x106c0016, 0x28620003, 0x10400005, 0x240c0001, 
-0x106c0008, 0x0, 0x8002e3f, 0x0, 
-0x240c0003, 0x106c0017, 0x0, 0x8002e3f, 
-0x0, 0x8ee200e8, 0x8ee300ec, 0x24630001, 
-0x2c640001, 0x441021, 0xaee200e8, 0xaee300ec, 
-0x8ee200e8, 0x8002e3f, 0x8ee300ec, 0x8ee200f0, 
-0x8ee300f4, 0x24630001, 0x2c640001, 0x441021, 
-0xaee200f0, 0xaee300f4, 0x8ee200f0, 0x8002e3f, 
-0x8ee300f4, 0x8ee200f8, 0x8ee300fc, 0x24630001, 
-0x2c640001, 0x441021, 0xaee200f8, 0xaee300fc, 
-0x8ee200f8, 0x8ee300fc, 0x8ee27ba8, 0x25290001, 
-0x122102b, 0x1440ffa0, 0x254a0008, 0xa2e07b98, 
-0x8002e9f, 0xaee07ba8, 0x8f8200f0, 0x24470008, 
-0x27621800, 0xe2102b, 0x50400001, 0x27671000, 
-0x8f8200f4, 0x14e20007, 0x0, 0x8ee201b4, 
-0x8021, 0x24420001, 0xaee201b4, 0x8002e5d, 
-0x8ee201b4, 0x8f8200f0, 0x24100001, 0x8fa30018, 
-0x8fa4001c, 0xac430000, 0xac440004, 0xaf8700f0, 
-0x16000007, 0x0, 0x8ee20088, 0x24420001, 
-0xaee20088, 0x8ee20088, 0x8002ea0, 0xaee0725c, 
-0x8ee2725c, 0x8ee400e0, 0x8ee500e4, 0x240c0002, 
-0x401821, 0x1021, 0xa32821, 0xa3302b, 
-0x822021, 0x862021, 0x161142, 0x30430003, 
-0xaee400e0, 0xaee500e4, 0x106c0017, 0x2c620003, 
-0x10400005, 0x240c0001, 0x106c0008, 0x0, 
-0x8002ea0, 0xaee0725c, 0x240c0003, 0x106c0019, 
-0x0, 0x8002ea0, 0xaee0725c, 0x8ee200e8, 
-0x8ee300ec, 0x24630001, 0x2c640001, 0x441021, 
-0xaee200e8, 0xaee300ec, 0x8ee200e8, 0x8ee300ec, 
-0x8002ea0, 0xaee0725c, 0x8ee200f0, 0x8ee300f4, 
-0x24630001, 0x2c640001, 0x441021, 0xaee200f0, 
-0xaee300f4, 0x8ee200f0, 0x8ee300f4, 0x8002ea0, 
-0xaee0725c, 0x8ee200f8, 0x8ee300fc, 0x24630001, 
-0x2c640001, 0x441021, 0xaee200f8, 0xaee300fc, 
-0x8ee200f8, 0x8ee300fc, 0xaee0725c, 0x8e62001c, 
-0x96e30458, 0x8ee404f0, 0x24420001, 0x2463ffff, 
-0x431024, 0x24840001, 0xaee204e4, 0xaee404f0, 
-0x8f42023c, 0x82202b, 0x148000b0, 0x0, 
-0x8f830120, 0x27623800, 0x24660020, 0xc2102b, 
-0x50400001, 0x27663000, 0x8f820128, 0x10c20004, 
-0x0, 0x8f820124, 0x14c20007, 0x0, 
-0x8ee201a4, 0x8021, 0x24420001, 0xaee201a4, 
-0x8002f07, 0x8ee201a4, 0x8ee204e4, 0xac62001c, 
-0x8ee404b0, 0x8ee504b4, 0x2462001c, 0xac620008, 
-0x24020008, 0xa462000e, 0x24020011, 0xac620018, 
-0xac640000, 0xac650004, 0x8ee204c4, 0xac620010, 
-0xaf860120, 0x92e24e20, 0x14400037, 0x24100001, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0x8c830000, 0x24020012, 0x1462001f, 0x0, 
-0x8ee34e30, 0x8ee24e34, 0x1062001b, 0x240c0040, 
-0x8c820004, 0x24420001, 0xac820004, 0x8ee24e34, 
-0x8ee34e30, 0x24420001, 0x104c0007, 0x0, 
-0x8ee24e34, 0x24420001, 0x10620005, 0x0, 
-0x8002ef1, 0x0, 0x14600005, 0x0, 
-0x8f820128, 0x24420020, 0xaf820128, 0x8f820128, 
-0x8c820004, 0x2c420011, 0x50400013, 0xac800000, 
-0x8002f07, 0x0, 0x8ee24e30, 0x240c0040, 
-0x24420001, 0x504c0003, 0x1021, 0x8ee24e30, 
-0x24420001, 0xaee24e30, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0x24020012, 0x240c0001, 
-0xac820000, 0xac8c0004, 0x5600000d, 0x24100001, 
-0x8ee204e4, 0x3c040001, 0x24845754, 0xafa00014, 
-0xafa20010, 0x8ee60608, 0x8f470228, 0x3c050009, 
-0x34a5f006, 0xc002403, 0xafab0038, 0x8fab0038, 
-0x16000003, 0x240c0001, 0x8002f5c, 0xa2ec04f4, 
-0x8ee20170, 0x24420001, 0xaee20170, 0x8ee20170, 
-0x8ee204e4, 0xa2e004f4, 0xaee004f0, 0xaee07274, 
-0xaee204f8, 0x8f42023c, 0x10400038, 0x0, 
-0x8ee20184, 0x24420001, 0xaee20184, 0x8002f5c, 
-0x8ee20184, 0x8ee20504, 0x240c0040, 0x24420001, 
-0x504c0003, 0x1021, 0x8ee20504, 0x24420001, 
-0xaee20504, 0x8ee20504, 0x8e630018, 0x240c0003, 
-0x21080, 0x571021, 0x146c000f, 0x8c440508, 
-0x3c020001, 0x571021, 0x904283b1, 0x10400014, 
-0x0, 0x8ee201d0, 0x8ee35240, 0x441021, 
-0xaee201d0, 0x8ee201d8, 0x641821, 0x306300ff, 
-0x8002f4f, 0xaee35240, 0x8ee201cc, 0x8ee30e10, 
-0x441021, 0xaee201cc, 0x8ee201d8, 0x641821, 
-0x306301ff, 0xaee30e10, 0x441021, 0xaee201d8, 
-0x8ee20000, 0x34420040, 0x8002f5c, 0xaee20000, 
-0x8ee2014c, 0x3c010001, 0x370821, 0xa02083e0, 
-0x24420001, 0xaee2014c, 0x8ee2014c, 0x8f820108, 
-0x24420020, 0xaf820108, 0x8f820108, 0x8f820108, 
-0x27633000, 0x43102b, 0x14400002, 0x27622800, 
-0xaf820108, 0x8f830108, 0x8f820104, 0x1462fc1e, 
-0x0, 0x8fbf0060, 0x8fbe005c, 0x8fb60058, 
-0x8fb50054, 0x8fb40050, 0x8fb3004c, 0x8fb20048, 
-0x8fb10044, 0x8fb00040, 0x3e00008, 0x27bd0068, 
-0x52843, 0x10a0000d, 0x3021, 0x3c030001, 
-0x34633800, 0x3c07ffff, 0x3631021, 0x82102b, 
-0x50400001, 0x872021, 0x94820000, 0x24840002, 
-0x24a5ffff, 0x14a0fff8, 0xc23021, 0x61c02, 
-0x30c2ffff, 0x623021, 0x61c02, 0x30c2ffff, 
-0x623021, 0x3e00008, 0x30c2ffff, 0x27bdff88, 
-0x240f0001, 0xafbf0070, 0xafbe006c, 0xafb60068, 
-0xafb50064, 0xafb40060, 0xafb3005c, 0xafb20058, 
-0xafb10054, 0xafb00050, 0xa3a00027, 0xafaf002c, 
-0x8ee204d4, 0x8021, 0x30420001, 0x1440002a, 
-0xa3a00037, 0x8f8700e0, 0x8f8800c4, 0x8f8200e8, 
-0xe22023, 0x2c821000, 0x50400001, 0x24841000, 
-0x420c2, 0x801821, 0x8ee400c8, 0x8ee500cc, 
-0x1021, 0xa32821, 0xa3302b, 0x822021, 
-0x862021, 0xaee400c8, 0xaee500cc, 0x8f8300c8, 
-0x3c02000a, 0x3442efff, 0x1032023, 0x44102b, 
-0x10400003, 0x3c02000a, 0x3442f000, 0x822021, 
-0x801821, 0x8ee400c0, 0x8ee500c4, 0x1021, 
-0xa32821, 0xa3302b, 0x822021, 0x862021, 
-0xaee400c0, 0xaee500c4, 0xaf8800c8, 0xaf8700e4, 
-0x80034cc, 0xaf8700e8, 0x3c020001, 0x571021, 
-0x904283c0, 0x1040000b, 0x0, 0x3c140001, 
-0x297a021, 0x8e9483c4, 0x3c130001, 0x2779821, 
-0x8e7383c8, 0x3c120001, 0x2579021, 0x8003193, 
-0x8e5283cc, 0x8f8300e0, 0x8f8200e4, 0x10430007, 
-0x8821, 0x8f8200e4, 0x24110001, 0x8c430000, 
-0x8c440004, 0xafa30018, 0xafa4001c, 0x1620000e, 
-0x3c02ffff, 0x8f8200c4, 0xafa20010, 0x8f8200c8, 
-0x3c040001, 0x24845870, 0xafa20014, 0x8f8600e0, 
-0x8f8700e4, 0x3c050006, 0xc002403, 0x34a5f000, 
-0x80034cc, 0x0, 0x8fa3001c, 0x8fb20018, 
-0x3074ffff, 0x2694fffc, 0x621024, 0x10400058, 
-0x2409821, 0x3c020080, 0x621024, 0x1040000a, 
-0x3c040040, 0x8ee2007c, 0x24420001, 0xaee2007c, 
-0x8ee2007c, 0x8ee201fc, 0x24420001, 0xaee201fc, 
-0x80034c6, 0x8ee201fc, 0x3c060004, 0x3c0b0001, 
-0x3c0a0002, 0x3c050010, 0x3c090008, 0x8ee20080, 
-0x3c080020, 0x34078000, 0x24420001, 0xaee20080, 
-0x8ee20080, 0x8fa2001c, 0x441824, 0x10660021, 
-0xc3102b, 0x14400007, 0x0, 0x106b0011, 
-0x0, 0x106a0015, 0x0, 0x8003049, 
-0x42042, 0x10650023, 0xa3102b, 0x14400005, 
-0x0, 0x10690019, 0x0, 0x8003049, 
-0x42042, 0x10680021, 0x0, 0x8003049, 
-0x42042, 0x8ee20034, 0x24420001, 0xaee20034, 
-0x8ee20034, 0x8003049, 0x42042, 0x8ee201ec, 
-0x24420001, 0xaee201ec, 0x8ee201ec, 0x8003049, 
-0x42042, 0x8ee201f0, 0x24420001, 0xaee201f0, 
-0x8ee201f0, 0x8003049, 0x42042, 0x8ee201f4, 
-0x24420001, 0xaee201f4, 0x8ee201f4, 0x8003049, 
-0x42042, 0x8ee20030, 0x24420001, 0xaee20030, 
-0x8ee20030, 0x8003049, 0x42042, 0x8ee201f8, 
-0x24420001, 0xaee201f8, 0x8ee201f8, 0x42042, 
-0x1087047c, 0x0, 0x800300e, 0x0, 
-0x3c020001, 0x571021, 0x904283b2, 0x14400084, 
-0x24020001, 0x3c030001, 0x771821, 0x906383b3, 
-0x1462007f, 0x3c020100, 0x8e430000, 0x621024, 
-0x1040006f, 0x2402ffff, 0x14620005, 0x24100001, 
-0x96430004, 0x3402ffff, 0x10620075, 0x0, 
-0x92e204d8, 0x14400072, 0x0, 0x3c020001, 
-0x571021, 0x8c4283b4, 0x28420005, 0x10400020, 
-0x3821, 0x3c020001, 0x571021, 0x8c4283b4, 
-0x18400016, 0x2821, 0x96660000, 0x520c0, 
-0x971021, 0x9442777e, 0x14460009, 0x971021, 
-0x94437780, 0x96620002, 0x14620005, 0x971021, 
-0x94437782, 0x96620004, 0x50620008, 0x24070001, 
-0x3c020001, 0x571021, 0x8c4283b4, 0x24a50001, 
-0xa2102a, 0x5440ffee, 0x520c0, 0x30e200ff, 
-0x10400440, 0x0, 0x80030d5, 0x0, 
-0x2402021, 0xc0022fe, 0x24050006, 0x3044001f, 
-0x428c0, 0x2e51021, 0x9442727c, 0x30424000, 
-0x14400434, 0xb71021, 0x9443727e, 0x96620000, 
-0x1462000b, 0x418c0, 0xb71021, 0x94437280, 
-0x96620002, 0x14620006, 0x418c0, 0xb71021, 
-0x94437282, 0x96620004, 0x10620035, 0x418c0, 
-0x2e31021, 0x9442727c, 0x30428000, 0x14400421, 
-0x2e31021, 0x944b727c, 0x96670000, 0xb28c0, 
-0xb71021, 0x9442737e, 0x80030b7, 0x3021, 
-0x420c0, 0x2e41021, 0x9443737c, 0x2e41021, 
-0x944b737c, 0x30638000, 0x14600010, 0xb28c0, 
-0xb71021, 0x9442737e, 0x1447fff5, 0x1602021, 
-0xb71021, 0x94437380, 0x96620002, 0x5462fff1, 
-0x420c0, 0xb71021, 0x94437382, 0x96620004, 
-0x5462ffec, 0x420c0, 0x24060001, 0x30c200ff, 
-0x10400400, 0x0, 0x80030d5, 0x0, 
-0x97430202, 0x96420000, 0x146203fa, 0x0, 
-0x97430204, 0x96420002, 0x146203f6, 0x0, 
-0x97430206, 0x96420004, 0x146203f2, 0x0, 
-0x92420000, 0x3a030001, 0x30420001, 0x431024, 
-0x10400074, 0x2402ffff, 0x8e630000, 0x14620004, 
-0x3402ffff, 0x96630004, 0x1062006f, 0x240f0002, 
-0x3c020001, 0x571021, 0x904283b2, 0x1440006a, 
-0x240f0003, 0x92e204d8, 0x54400068, 0xafaf002c, 
-0x3c020001, 0x571021, 0x8c4283b4, 0x28420005, 
-0x10400020, 0x3821, 0x3c020001, 0x571021, 
-0x8c4283b4, 0x18400016, 0x2821, 0x96660000, 
-0x520c0, 0x971021, 0x9442777e, 0x14460009, 
-0x971021, 0x94437780, 0x96620002, 0x14620005, 
-0x971021, 0x94437782, 0x96620004, 0x50620008, 
-0x24070001, 0x3c020001, 0x571021, 0x8c4283b4, 
-0x24a50001, 0xa2102a, 0x5440ffee, 0x520c0, 
-0x30e200ff, 0x14400044, 0x240f0003, 0x80034c6, 
-0x0, 0x2402021, 0xc0022fe, 0x24050006, 
-0x3044001f, 0x428c0, 0x2e51021, 0x9442727c, 
-0x30424000, 0x144003af, 0xb71021, 0x9443727e, 
-0x96620000, 0x1462000b, 0x418c0, 0xb71021, 
-0x94437280, 0x96620002, 0x14620006, 0x418c0, 
-0xb71021, 0x94437282, 0x96620004, 0x10620027, 
-0x418c0, 0x2e31021, 0x9442727c, 0x30428000, 
-0x1440039c, 0x2e31021, 0x944b727c, 0x96670000, 
-0xb28c0, 0xb71021, 0x9442737e, 0x800313c, 
-0x3021, 0x420c0, 0x2e41021, 0x9443737c, 
-0x2e41021, 0x944b737c, 0x30638000, 0x14600010, 
-0xb28c0, 0xb71021, 0x9442737e, 0x1447fff5, 
-0x1602021, 0xb71021, 0x94437380, 0x96620002, 
-0x5462fff1, 0x420c0, 0xb71021, 0x94437382, 
-0x96620004, 0x5462ffec, 0x420c0, 0x24060001, 
-0x30c200ff, 0x1040037b, 0x0, 0x800314f, 
-0x240f0003, 0x240f0001, 0xafaf002c, 0x8f420260, 
-0x54102b, 0x1040003a, 0x0, 0x8f8300e4, 
-0x8f8200e0, 0x10620003, 0x24630008, 0xaf8300e4, 
-0xaf8300e8, 0x8ee400c0, 0x8ee500c4, 0x2801821, 
-0x1021, 0xa32821, 0xa3302b, 0x822021, 
-0x862021, 0xaee400c0, 0xaee500c4, 0x8ee20058, 
-0x24420001, 0xaee20058, 0x8ee20058, 0x8ee2007c, 
-0x24420001, 0xaee2007c, 0x8ee2007c, 0x8f8200e0, 
-0xafa20010, 0x8f8200e4, 0x3c040001, 0x24845878, 
-0xafa20014, 0x8fa60018, 0x8fa7001c, 0x3c050006, 
-0xc002403, 0x34a5f003, 0x80034cc, 0x0, 
-0x8ee25240, 0xafa20010, 0x8ee25244, 0x3c040001, 
-0x24845884, 0xafa20014, 0x8ee60e10, 0x8ee70e18, 
-0x3c050006, 0xc002403, 0x34a5f002, 0x8ee201c0, 
-0x24420001, 0xaee201c0, 0x8ee20000, 0x8ee301c0, 
-0x2403ffbf, 0x431024, 0x8003470, 0xaee20000, 
-0x96e20468, 0x54102b, 0x10400003, 0x0, 
-0x240f0001, 0xa3af0027, 0x12800301, 0x24160007, 
-0x24150040, 0x241e0001, 0x240e0012, 0x8ee2724c, 
-0x8f430280, 0x24420001, 0x304207ff, 0x106202d3, 
-0x0, 0x93a20027, 0x10400014, 0x0, 
-0x8ee35240, 0x8ee25244, 0x10620009, 0x26ed5244, 
-0x8ee65244, 0x8ee35244, 0x21140, 0x24425248, 
-0x2e28021, 0x24630001, 0x80031bf, 0x306b00ff, 
-0x92e27248, 0x1440ffca, 0x0, 0x8ee201e0, 
-0x24420001, 0xaee201e0, 0x8ee201e0, 0x8ee30e10, 
-0x8ee20e18, 0x1062ffc2, 0x26ed0e18, 0x8ee60e18, 
-0x8ee30e18, 0x21140, 0x24420e20, 0x2e28021, 
-0x24630001, 0x306b01ff, 0x96e2046a, 0x30420010, 
-0x10400019, 0x0, 0x9642000c, 0x340f8100, 
-0x144f0015, 0x0, 0x3c020001, 0x571021, 
-0x904283c0, 0x14400010, 0x0, 0x9642000e, 
-0xa6020016, 0x8e420008, 0x8e430004, 0x8e440000, 
-0x2694fffc, 0xae42000c, 0xae430008, 0xae440004, 
-0x9602000e, 0x26730004, 0x240f0001, 0xa3af0037, 
-0x34420200, 0xa602000e, 0x8e020000, 0x8e030004, 
-0x3c040001, 0x34843800, 0x306a0007, 0x26a9823, 
-0x3641021, 0x262102b, 0x10400005, 0x28aa021, 
-0x2641023, 0x3621823, 0x3c020020, 0x439823, 
-0x26820007, 0x2404fff8, 0x9603000a, 0x446024, 
-0x6a1821, 0x6c102b, 0x10400002, 0x1803821, 
-0x603821, 0xae130018, 0x8f880120, 0x24e20007, 
-0x443824, 0x27623800, 0x25090020, 0x122102b, 
-0x50400001, 0x27693000, 0x8f820128, 0x11220004, 
-0x0, 0x8f820124, 0x15220007, 0x1401821, 
-0x8ee201a4, 0x8821, 0x24420001, 0xaee201a4, 
-0x800324c, 0x8ee201a4, 0x8e040000, 0x8e050004, 
-0x1021, 0xad130008, 0xa507000e, 0xad160018, 
-0xad06001c, 0xa3302b, 0xa32823, 0x822023, 
-0x862023, 0xad040000, 0xad050004, 0x8ee204c0, 
-0xad020010, 0xaf890120, 0x92e24e20, 0x14400033, 
-0x24110001, 0x8ee24e30, 0x210c0, 0x24425038, 
-0x2e22021, 0x8c820000, 0x1456001f, 0x0, 
-0x8ee34e30, 0x8ee24e34, 0x1062001b, 0x0, 
-0x8c820004, 0x24420001, 0xac820004, 0x8ee24e34, 
-0x8ee34e30, 0x24420001, 0x10550007, 0x0, 
-0x8ee24e34, 0x24420001, 0x10620005, 0x0, 
-0x8003239, 0x0, 0x14600005, 0x0, 
-0x8f820128, 0x24420020, 0xaf820128, 0x8f820128, 
-0x8c820004, 0x2c420011, 0x50400010, 0xac800000, 
-0x800324c, 0x0, 0x8ee24e30, 0x24420001, 
-0x50550003, 0x1021, 0x8ee24e30, 0x24420001, 
-0xaee24e30, 0x8ee24e30, 0x210c0, 0x24425038, 
-0x2e22021, 0xac960000, 0xac9e0004, 0x16200018, 
-0x3c050006, 0x8e020018, 0x3c040001, 0x24845890, 
-0xafa20010, 0x8e020000, 0x8e030004, 0x34a5f009, 
-0x2003021, 0xc002403, 0xafa30014, 0x93a20037, 
-0x10400216, 0x340f8100, 0x8e420004, 0x8e430008, 
-0x8e44000c, 0xa64f000c, 0xae420000, 0xae430004, 
-0xae440008, 0x96020016, 0x8003470, 0xa642000e, 
-0x14ec0168, 0x28a1823, 0x960c000a, 0x9603000e, 
-0x28a1023, 0xa602000a, 0x34620004, 0xa602000e, 
-0x8f880120, 0x27623800, 0x25090020, 0x122102b, 
-0x14400002, 0x306affff, 0x27693000, 0x8f820128, 
-0x11220004, 0x0, 0x8f820124, 0x15220007, 
-0x24040020, 0x8ee201a4, 0x8821, 0x24420001, 
-0xaee201a4, 0x80032ca, 0x8ee201a4, 0x8ee5724c, 
-0x8ee60490, 0x8ee70494, 0xa504000e, 0x24040004, 
-0xad100008, 0xad040018, 0x52940, 0xa01821, 
-0x1021, 0xe33821, 0xe3202b, 0xc23021, 
-0xc43021, 0xad060000, 0xad070004, 0x8ee2724c, 
-0xad02001c, 0x8ee204c4, 0xad020010, 0xaf890120, 
-0x92e24e20, 0x14400033, 0x24110001, 0x8ee24e30, 
-0x210c0, 0x24425038, 0x2e22021, 0x8c820000, 
-0x1456001f, 0x0, 0x8ee34e30, 0x8ee24e34, 
-0x1062001b, 0x0, 0x8c820004, 0x24420001, 
-0xac820004, 0x8ee24e34, 0x8ee34e30, 0x24420001, 
-0x10550007, 0x0, 0x8ee24e34, 0x24420001, 
-0x10620005, 0x0, 0x80032b7, 0x0, 
-0x14600005, 0x0, 0x8f820128, 0x24420020, 
-0xaf820128, 0x8f820128, 0x8c820004, 0x2c420011, 
-0x50400010, 0xac800000, 0x80032ca, 0x0, 
-0x8ee24e30, 0x24420001, 0x50550003, 0x1021, 
-0x8ee24e30, 0x24420001, 0xaee24e30, 0x8ee24e30, 
-0x210c0, 0x24425038, 0x2e22021, 0xac960000, 
-0xac9e0004, 0x1620000d, 0x0, 0xa60c000a, 
-0xa60a000e, 0x8f820100, 0xafa20010, 0x8f820104, 
-0x3c040001, 0x2484589c, 0x3c050006, 0xafa20014, 
-0x8ee6724c, 0x800343b, 0x34a5f00b, 0x3c010001, 
-0x370821, 0xa02083c0, 0xadab0000, 0x8ee201d8, 
-0x8ee3724c, 0x2442ffff, 0xaee201d8, 0x8ee201d8, 
-0x24630001, 0x306307ff, 0x26e25244, 0x15a20006, 
-0xaee3724c, 0x8ee201d0, 0x2442ffff, 0xaee201d0, 
-0x80032ef, 0x8ee201d0, 0x8ee201cc, 0x2442ffff, 
-0xaee201cc, 0x8ee201cc, 0x8f420240, 0x10400073, 
-0x0, 0x8ee20e1c, 0x24420001, 0xaee20e1c, 
-0x8f430240, 0x43102b, 0x14400176, 0xa021, 
-0x8f830120, 0x27623800, 0x24660020, 0xc2102b, 
-0x50400001, 0x27663000, 0x8f820128, 0x10c20004, 
-0x0, 0x8f820124, 0x14c20007, 0x0, 
-0x8ee201a4, 0x8821, 0x24420001, 0xaee201a4, 
-0x800334f, 0x8ee201a4, 0x8ee2724c, 0xac62001c, 
-0x8ee404a8, 0x8ee504ac, 0x2462001c, 0xac620008, 
-0x24020008, 0xa462000e, 0x24020011, 0xac620018, 
-0xac640000, 0xac650004, 0x8ee204c4, 0xac620010, 
-0xaf860120, 0x92e24e20, 0x14400033, 0x24110001, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0x8c820000, 0x144e001f, 0x0, 0x8ee34e30, 
-0x8ee24e34, 0x1062001b, 0x0, 0x8c820004, 
-0x24420001, 0xac820004, 0x8ee24e34, 0x8ee34e30, 
-0x24420001, 0x10550007, 0x0, 0x8ee24e34, 
-0x24420001, 0x10620005, 0x0, 0x800333c, 
-0x0, 0x14600005, 0x0, 0x8f820128, 
-0x24420020, 0xaf820128, 0x8f820128, 0x8c820004, 
-0x2c420011, 0x50400010, 0xac800000, 0x800334f, 
-0x0, 0x8ee24e30, 0x24420001, 0x50550003, 
-0x1021, 0x8ee24e30, 0x24420001, 0xaee24e30, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0xac8e0000, 0xac9e0004, 0x5620000d, 0x24110001, 
-0x8ee2724c, 0x3c040001, 0x248458a8, 0xafa00014, 
-0xafa20010, 0x8ee6724c, 0x8f470280, 0x3c050009, 
-0x34a5f008, 0xc002403, 0xafae0048, 0x8fae0048, 
-0x56200001, 0xaee00e1c, 0x8ee20188, 0x24420001, 
-0xaee20188, 0x80033c8, 0x8ee20188, 0x8f830120, 
-0x27623800, 0x24660020, 0xc2102b, 0x50400001, 
-0x27663000, 0x8f820128, 0x10c20004, 0x0, 
-0x8f820124, 0x14c20007, 0x0, 0x8ee201a4, 
-0x8821, 0x24420001, 0xaee201a4, 0x80033ba, 
-0x8ee201a4, 0x8ee2724c, 0xac62001c, 0x8ee404a8, 
-0x8ee504ac, 0x2462001c, 0xac620008, 0x24020008, 
-0xa462000e, 0x24020011, 0xac620018, 0xac640000, 
-0xac650004, 0x8ee204c4, 0xac620010, 0xaf860120, 
-0x92e24e20, 0x14400033, 0x24110001, 0x8ee24e30, 
-0x210c0, 0x24425038, 0x2e22021, 0x8c820000, 
-0x144e001f, 0x0, 0x8ee34e30, 0x8ee24e34, 
-0x1062001b, 0x0, 0x8c820004, 0x24420001, 
-0xac820004, 0x8ee24e34, 0x8ee34e30, 0x24420001, 
-0x10550007, 0x0, 0x8ee24e34, 0x24420001, 
-0x10620005, 0x0, 0x80033a7, 0x0, 
-0x14600005, 0x0, 0x8f820128, 0x24420020, 
-0xaf820128, 0x8f820128, 0x8c820004, 0x2c420011, 
-0x50400010, 0xac800000, 0x80033ba, 0x0, 
-0x8ee24e30, 0x24420001, 0x50550003, 0x1021, 
-0x8ee24e30, 0x24420001, 0xaee24e30, 0x8ee24e30, 
-0x210c0, 0x24425038, 0x2e22021, 0xac8e0000, 
-0xac9e0004, 0x1620000d, 0x0, 0x8ee2724c, 
-0x3c040001, 0x248458a8, 0xafa00014, 0xafa20010, 
-0x8ee6724c, 0x8f470280, 0x3c050009, 0x34a5f008, 
-0xc002403, 0xafae0048, 0x8fae0048, 0x8ee20174, 
-0x24420001, 0xaee20174, 0x8ee20174, 0x800346e, 
-0xa021, 0x960c000a, 0x183102b, 0x54400001, 
-0x1801821, 0xa603000a, 0x8f880120, 0x27623800, 
-0x25090020, 0x122102b, 0x50400001, 0x27693000, 
-0x8f820128, 0x11220004, 0x0, 0x8f820124, 
-0x15220007, 0x24040020, 0x8ee201a4, 0x8821, 
-0x24420001, 0xaee201a4, 0x800342f, 0x8ee201a4, 
-0x8ee5724c, 0x8ee60490, 0x8ee70494, 0xa504000e, 
-0x24040004, 0xad100008, 0xad040018, 0x52940, 
-0xa01821, 0x1021, 0xe33821, 0xe3202b, 
-0xc23021, 0xc43021, 0xad060000, 0xad070004, 
-0x8ee2724c, 0xad02001c, 0x8ee204c4, 0xad020010, 
-0xaf890120, 0x92e24e20, 0x14400033, 0x24110001, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0x8c820000, 0x1456001f, 0x0, 0x8ee34e30, 
-0x8ee24e34, 0x1062001b, 0x0, 0x8c820004, 
-0x24420001, 0xac820004, 0x8ee24e34, 0x8ee34e30, 
-0x24420001, 0x10550007, 0x0, 0x8ee24e34, 
-0x24420001, 0x10620005, 0x0, 0x800341c, 
-0x0, 0x14600005, 0x0, 0x8f820128, 
-0x24420020, 0xaf820128, 0x8f820128, 0x8c820004, 
-0x2c420011, 0x50400010, 0xac800000, 0x800342f, 
-0x0, 0x8ee24e30, 0x24420001, 0x50550003, 
-0x1021, 0x8ee24e30, 0x24420001, 0xaee24e30, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0xac960000, 0xac9e0004, 0x1620001d, 0x0, 
-0xa60c000a, 0x8f820100, 0xafa20010, 0x8f820104, 
-0x3c040001, 0x2484589c, 0x3c050006, 0xafa20014, 
-0x8ee6724c, 0x34a5f00d, 0xc002403, 0x2003821, 
-0x93a20037, 0x10400031, 0x340f8100, 0x8e420004, 
-0x8e430008, 0x8e44000c, 0xa64f000c, 0xae420000, 
-0xae430004, 0xae440008, 0x96020016, 0xa642000e, 
-0x9602000e, 0x3042fdff, 0x8003470, 0xa602000e, 
-0x8ee201d8, 0x2442ffff, 0xaee201d8, 0x8ee201d8, 
-0x8ee201cc, 0x3c04001f, 0x3c010001, 0x370821, 
-0xa03e83c0, 0x2442ffff, 0xaee201cc, 0x9603000a, 
-0x3484ffff, 0x8ee201cc, 0x6a1821, 0x2639821, 
-0x93202b, 0x10800003, 0x3c02fff5, 0x34421000, 
-0x2629821, 0xadab0000, 0x8ee2724c, 0x24420001, 
-0x304207ff, 0xaee2724c, 0x8f420240, 0x10400004, 
-0x283a023, 0x8ee20e1c, 0x24420001, 0xaee20e1c, 
-0xa3a00027, 0x1680fd29, 0x0, 0x12800024, 
-0x0, 0x3c010001, 0x370821, 0xac3483c4, 
-0x3c010001, 0x370821, 0xac3383c8, 0x3c010001, 
-0x370821, 0xac3283cc, 0x93a20037, 0x10400008, 
-0x0, 0x3c020001, 0x571021, 0x8c4283cc, 
-0x24420004, 0x3c010001, 0x370821, 0xac2283cc, 
-0x8ee2724c, 0x8f430280, 0x24420001, 0x304207ff, 
-0x14620006, 0x0, 0x8ee201c4, 0x24420001, 
-0xaee201c4, 0x80034cc, 0x8ee201c4, 0x8ee201bc, 
-0x24420001, 0xaee201bc, 0x80034cc, 0x8ee201bc, 
-0x97a4001e, 0x2484fffc, 0x801821, 0x8ee400c0, 
-0x8ee500c4, 0x1021, 0xa32821, 0xa3302b, 
-0x822021, 0x862021, 0xaee400c0, 0xaee500c4, 
-0x8faf002c, 0x24020002, 0x11e2000f, 0x29e20003, 
-0x14400017, 0x24020003, 0x15e20015, 0x0, 
-0x8ee200d0, 0x8ee300d4, 0x24630001, 0x2c640001, 
-0x441021, 0xaee200d0, 0xaee300d4, 0x8ee200d0, 
-0x80034c6, 0x8ee300d4, 0x8ee200d8, 0x8ee300dc, 
-0x24630001, 0x2c640001, 0x441021, 0xaee200d8, 
-0xaee300dc, 0x8ee200d8, 0x80034c6, 0x8ee300dc, 
-0x8ee200c8, 0x8ee300cc, 0x24630001, 0x2c640001, 
-0x441021, 0xaee200c8, 0xaee300cc, 0x8ee200c8, 
-0x8ee300cc, 0x8f8300e4, 0x8f8200e0, 0x10620003, 
-0x24630008, 0xaf8300e4, 0xaf8300e8, 0x8fbf0070, 
-0x8fbe006c, 0x8fb60068, 0x8fb50064, 0x8fb40060, 
-0x8fb3005c, 0x8fb20058, 0x8fb10054, 0x8fb00050, 
-0x3e00008, 0x27bd0078, 0x27bdffb0, 0xafb50044, 
-0xa821, 0xafb00030, 0x8021, 0xafbf004c, 
-0xafb60048, 0xafb40040, 0xafb3003c, 0xafb20038, 
-0xafb10034, 0x8ee204d4, 0x24140001, 0x30420001, 
-0x1440002a, 0xb021, 0x8f8700e0, 0x8f8800c4, 
-0x8f8200e8, 0xe22023, 0x2c821000, 0x50400001, 
-0x24841000, 0x420c2, 0x801821, 0x8ee400c8, 
-0x8ee500cc, 0x1021, 0xa32821, 0xa3302b, 
-0x822021, 0x862021, 0xaee400c8, 0xaee500cc, 
-0x8f8300c8, 0x3c02000a, 0x3442efff, 0x1032023, 
-0x44102b, 0x10400003, 0x3c02000a, 0x3442f000, 
-0x822021, 0x801821, 0x8ee400c0, 0x8ee500c4, 
-0x1021, 0xa32821, 0xa3302b, 0x822021, 
-0x862021, 0xaee400c0, 0xaee500c4, 0xaf8800c8, 
-0xaf8700e4, 0x8003850, 0xaf8700e8, 0x3c020001, 
-0x571021, 0x904283c0, 0x1040000b, 0x0, 
-0x3c130001, 0x2779821, 0x8e7383c4, 0x3c110001, 
-0x2378821, 0x8e3183c8, 0x3c120001, 0x2579021, 
-0x80036e8, 0x8e5283cc, 0x8f8300e0, 0x8f8200e4, 
-0x10430007, 0x4821, 0x8f8200e4, 0x24090001, 
-0x8c430000, 0x8c440004, 0xafa30018, 0xafa4001c, 
-0x1520000e, 0x3c02ffff, 0x8f8200c4, 0xafa20010, 
-0x8f8200c8, 0x3c040001, 0x24845870, 0xafa20014, 
-0x8f8600e0, 0x8f8700e4, 0x3c050006, 0xc002403, 
-0x34a5f000, 0x8003850, 0x0, 0x8fa3001c, 
-0x8fb20018, 0x3073ffff, 0x2673fffc, 0x621024, 
-0x10400058, 0x2408821, 0x3c020080, 0x621024, 
-0x1040000a, 0x3c040040, 0x8ee2007c, 0x24420001, 
-0xaee2007c, 0x8ee2007c, 0x8ee201fc, 0x24420001, 
-0xaee201fc, 0x800384a, 0x8ee201fc, 0x3c060004, 
-0x3c0b0001, 0x3c0a0002, 0x3c050010, 0x3c090008, 
-0x8ee20080, 0x3c080020, 0x34078000, 0x24420001, 
-0xaee20080, 0x8ee20080, 0x8fa2001c, 0x441824, 
-0x10660021, 0xc3102b, 0x14400007, 0x0, 
-0x106b0011, 0x0, 0x106a0015, 0x0, 
-0x8003592, 0x42042, 0x10650023, 0xa3102b, 
-0x14400005, 0x0, 0x10690019, 0x0, 
-0x8003592, 0x42042, 0x10680021, 0x0, 
-0x8003592, 0x42042, 0x8ee20034, 0x24420001, 
-0xaee20034, 0x8ee20034, 0x8003592, 0x42042, 
-0x8ee201ec, 0x24420001, 0xaee201ec, 0x8ee201ec, 
-0x8003592, 0x42042, 0x8ee201f0, 0x24420001, 
-0xaee201f0, 0x8ee201f0, 0x8003592, 0x42042, 
-0x8ee201f4, 0x24420001, 0xaee201f4, 0x8ee201f4, 
-0x8003592, 0x42042, 0x8ee20030, 0x24420001, 
-0xaee20030, 0x8ee20030, 0x8003592, 0x42042, 
-0x8ee201f8, 0x24420001, 0xaee201f8, 0x8ee201f8, 
-0x42042, 0x108702b7, 0x0, 0x8003557, 
-0x0, 0x3c020001, 0x571021, 0x904283b2, 
-0x14400084, 0x24020001, 0x3c030001, 0x771821, 
-0x906383b3, 0x1462007f, 0x3c020100, 0x8e430000, 
-0x621024, 0x1040006f, 0x2402ffff, 0x14620005, 
-0x24100001, 0x96430004, 0x3402ffff, 0x10620075, 
-0x0, 0x92e204d8, 0x14400072, 0x0, 
-0x3c020001, 0x571021, 0x8c4283b4, 0x28420005, 
-0x10400020, 0x3821, 0x3c020001, 0x571021, 
-0x8c4283b4, 0x18400016, 0x2821, 0x96260000, 
-0x520c0, 0x971021, 0x9442777e, 0x14460009, 
-0x971021, 0x94437780, 0x96220002, 0x14620005, 
-0x971021, 0x94437782, 0x96220004, 0x50620008, 
-0x24070001, 0x3c020001, 0x571021, 0x8c4283b4, 
-0x24a50001, 0xa2102a, 0x5440ffee, 0x520c0, 
-0x30e200ff, 0x1040027b, 0x0, 0x800361e, 
-0x0, 0x2402021, 0xc0022fe, 0x24050006, 
-0x3044001f, 0x428c0, 0x2e51021, 0x9442727c, 
-0x30424000, 0x1440026f, 0xb71021, 0x9443727e, 
-0x96220000, 0x1462000b, 0x418c0, 0xb71021, 
-0x94437280, 0x96220002, 0x14620006, 0x418c0, 
-0xb71021, 0x94437282, 0x96220004, 0x10620035, 
-0x418c0, 0x2e31021, 0x9442727c, 0x30428000, 
-0x1440025c, 0x2e31021, 0x9448727c, 0x96270000, 
-0x828c0, 0xb71021, 0x9442737e, 0x8003600, 
-0x3021, 0x420c0, 0x2e41021, 0x9443737c, 
-0x2e41021, 0x9448737c, 0x30638000, 0x14600010, 
-0x828c0, 0xb71021, 0x9442737e, 0x1447fff5, 
-0x1002021, 0xb71021, 0x94437380, 0x96220002, 
-0x5462fff1, 0x420c0, 0xb71021, 0x94437382, 
-0x96220004, 0x5462ffec, 0x420c0, 0x24060001, 
-0x30c200ff, 0x1040023b, 0x0, 0x800361e, 
-0x0, 0x97430202, 0x96420000, 0x14620235, 
-0x0, 0x97430204, 0x96420002, 0x14620231, 
-0x0, 0x97430206, 0x96420004, 0x1462022d, 
-0x0, 0x92420000, 0x3a030001, 0x30420001, 
-0x431024, 0x10400074, 0x2402ffff, 0x8e230000, 
-0x14620004, 0x3402ffff, 0x96230004, 0x1062006f, 
-0x24140002, 0x3c020001, 0x571021, 0x904283b2, 
-0x1440006a, 0x24140003, 0x92e204d8, 0x14400067, 
-0x0, 0x3c020001, 0x571021, 0x8c4283b4, 
-0x28420005, 0x10400020, 0x3821, 0x3c020001, 
-0x571021, 0x8c4283b4, 0x18400016, 0x2821, 
-0x96260000, 0x520c0, 0x971021, 0x9442777e, 
-0x14460009, 0x971021, 0x94437780, 0x96220002, 
-0x14620005, 0x971021, 0x94437782, 0x96220004, 
-0x50620008, 0x24070001, 0x3c020001, 0x571021, 
-0x8c4283b4, 0x24a50001, 0xa2102a, 0x5440ffee, 
-0x520c0, 0x30e200ff, 0x14400044, 0x24140003, 
-0x800384a, 0x0, 0x2402021, 0xc0022fe, 
-0x24050006, 0x3044001f, 0x428c0, 0x2e51021, 
-0x9442727c, 0x30424000, 0x144001ea, 0xb71021, 
-0x9443727e, 0x96220000, 0x1462000b, 0x418c0, 
-0xb71021, 0x94437280, 0x96220002, 0x14620006, 
-0x418c0, 0xb71021, 0x94437282, 0x96220004, 
-0x10620027, 0x418c0, 0x2e31021, 0x9442727c, 
-0x30428000, 0x144001d7, 0x2e31021, 0x9448727c, 
-0x96270000, 0x828c0, 0xb71021, 0x9442737e, 
-0x8003685, 0x3021, 0x420c0, 0x2e41021, 
-0x9443737c, 0x2e41021, 0x9448737c, 0x30638000, 
-0x14600010, 0x828c0, 0xb71021, 0x9442737e, 
-0x1447fff5, 0x1002021, 0xb71021, 0x94437380, 
-0x96220002, 0x5462fff1, 0x420c0, 0xb71021, 
-0x94437382, 0x96220004, 0x5462ffec, 0x420c0, 
-0x24060001, 0x30c200ff, 0x104001b6, 0x0, 
-0x8003698, 0x24140003, 0x24140001, 0x8f420260, 
-0x53102b, 0x10400049, 0x0, 0x8f8300e4, 
-0x8f8200e0, 0x10620003, 0x24630008, 0xaf8300e4, 
-0xaf8300e8, 0x8ee400c0, 0x8ee500c4, 0x2601821, 
-0x1021, 0xa32821, 0xa3302b, 0x822021, 
-0x862021, 0xaee400c0, 0xaee500c4, 0x8ee20058, 
-0x24420001, 0xaee20058, 0x8ee20058, 0x8ee2007c, 
-0x24420001, 0xaee2007c, 0x8ee2007c, 0x8f8200e0, 
-0xafa20010, 0x8f8200e4, 0x3c040001, 0x24845878, 
-0xafa20014, 0x8fa60018, 0x8fa7001c, 0x3c050006, 
-0xc002403, 0x34a5f003, 0x8003850, 0x0, 
-0x8ee25240, 0xafa20010, 0x8ee25244, 0x3c040001, 
-0x24845884, 0xafa20014, 0x8ee60e10, 0x8ee70e18, 
-0xc002403, 0x34a5f002, 0x8ee201c0, 0x24420001, 
-0xaee201c0, 0x8ee20000, 0x8ee301c0, 0x2403ffbf, 
-0x431024, 0x80037f8, 0xaee20000, 0x8ee25240, 
-0xafa20010, 0x8ee25244, 0x3c040001, 0x24845884, 
-0xafa20014, 0x8ee60e10, 0x8ee70e18, 0x3c050006, 
-0xc002403, 0x34a5f002, 0x8ee201c0, 0x24420001, 
-0xaee201c0, 0x80037f8, 0x8ee201c0, 0x96e20468, 
-0x53102b, 0x54400001, 0x3c158000, 0x12600131, 
-0x3c0c001f, 0x358cffff, 0x8ee2724c, 0x8f430280, 
-0x24420001, 0x304207ff, 0x10620108, 0x0, 
-0x12a00014, 0x0, 0x8ee35240, 0x8ee25244, 
-0x10620009, 0x26ee5244, 0x8eeb5244, 0x8ee35244, 
-0x21140, 0x24425248, 0x2e28021, 0x24630001, 
-0x8003712, 0x306800ff, 0x92e27248, 0x1440ffc0, 
-0x3c050006, 0x8ee201e0, 0x24420001, 0xaee201e0, 
-0x8ee201e0, 0x8ee30e10, 0x8ee20e18, 0x1062ffcb, 
-0x26ee0e18, 0x8eeb0e18, 0xa821, 0x8ee30e18, 
-0x21140, 0x24420e20, 0x2e28021, 0x24630001, 
-0x306801ff, 0x96e2046a, 0x30420010, 0x10400017, 
-0x34028100, 0x9643000c, 0x14620014, 0x0, 
-0x3c020001, 0x571021, 0x904283c0, 0x1440000f, 
-0x0, 0x9642000e, 0xa6020016, 0x8e420008, 
-0x8e430004, 0x8e440000, 0x2673fffc, 0xae42000c, 
-0xae430008, 0xae440004, 0x9602000e, 0x26310004, 
-0x24160001, 0x34420200, 0xa602000e, 0x9603000a, 
-0x2605021, 0x73102b, 0x10400002, 0x2606821, 
-0x605021, 0x2d42003d, 0x1040002a, 0x3821, 
-0x9623000c, 0x24020800, 0x54620027, 0xae110018, 
-0x3c020001, 0x571021, 0x904283c0, 0x54400022, 
-0xae110018, 0x26220017, 0x182102b, 0x10400013, 
-0x0, 0x3c02fff5, 0x511021, 0x90421017, 
-0x38430006, 0x2c630001, 0x38420011, 0x2c420001, 
-0x621825, 0x10600013, 0x26220010, 0x182102b, 
-0x1040000e, 0x0, 0x3c07fff5, 0xf13821, 
-0x94e71010, 0x800375e, 0x24e7000e, 0x92220017, 
-0x38430006, 0x2c630001, 0x38420011, 0x2c420001, 
-0x621825, 0x50600004, 0xae110018, 0x96270010, 
-0x24e7000e, 0xae110018, 0x3c020001, 0x571021, 
-0x904283c0, 0x2102b, 0x14e00002, 0x24ec0, 
-0x1403821, 0x8f830120, 0x27623800, 0x24660020, 
-0xc2102b, 0x50400001, 0x27663000, 0x8f820128, 
-0x10c20004, 0x0, 0x8f820124, 0x14c20007, 
-0x2402000b, 0x8ee201a4, 0x4821, 0x24420001, 
-0xaee201a4, 0x80037bf, 0x8ee201a4, 0x8e040000, 
-0x8e050004, 0xac620018, 0x1751025, 0x491025, 
-0xac710008, 0xa467000e, 0xac62001c, 0xac640000, 
-0xac650004, 0x8ee204c0, 0xac620010, 0xaf860120, 
-0x92e24e20, 0x14400038, 0x24090001, 0x8ee24e30, 
-0x210c0, 0x24425038, 0x2e22021, 0x8c830000, 
-0x24020007, 0x14620020, 0x0, 0x8ee34e30, 
-0x8ee24e34, 0x1062001c, 0x0, 0x8c820004, 
-0x24420001, 0xac820004, 0x8ee34e34, 0x8ee54e30, 
-0x24020040, 0x24630001, 0x10620007, 0x0, 
-0x8ee24e34, 0x24420001, 0x10a20005, 0x0, 
-0x80037a9, 0x0, 0x14a00005, 0x0, 
-0x8f820128, 0x24420020, 0xaf820128, 0x8f820128, 
-0x8c820004, 0x2c420011, 0x50400013, 0xac800000, 
-0x80037bf, 0x0, 0x8ee24e30, 0x24030040, 
-0x24420001, 0x50430003, 0x1021, 0x8ee24e30, 
-0x24420001, 0xaee24e30, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0x24020007, 0xac820000, 
-0x24020001, 0xac820004, 0x15200018, 0x3c050006, 
-0x8e020018, 0x3c040001, 0x24845890, 0xafa20010, 
-0x8e020000, 0x8e030004, 0x34a5f009, 0x2003021, 
-0xc002403, 0xafa30014, 0x32c200ff, 0x1040002b, 
-0x34028100, 0x8e430004, 0x8e440008, 0x8e45000c, 
-0xa642000c, 0xae430000, 0xae440004, 0xae450008, 
-0x96020016, 0x80037f8, 0xa642000e, 0x154d000a, 
-0x0, 0x9602000e, 0xa613000a, 0x34420004, 
-0xa602000e, 0x3c010001, 0x370821, 0xa02083c0, 
-0x80037f6, 0x9821, 0x9604000a, 0x93102b, 
-0x10400002, 0x2601821, 0x801821, 0x24020001, 
-0xa603000a, 0x3c010001, 0x370821, 0xa02283c0, 
-0x9604000a, 0x2248821, 0x191102b, 0x10400003, 
-0x3c02fff5, 0x34421000, 0x2228821, 0x2649823, 
-0xa821, 0x1660fef4, 0xadc80000, 0x12600021, 
-0x32c200ff, 0x3c010001, 0x370821, 0xac3383c4, 
-0x3c010001, 0x370821, 0xac3183c8, 0x3c010001, 
-0x370821, 0x10400008, 0xac3283cc, 0x3c020001, 
-0x571021, 0x8c4283cc, 0x24420004, 0x3c010001, 
-0x370821, 0xac2283cc, 0x8ee2724c, 0x8f430280, 
-0x24420001, 0x14620006, 0x0, 0x8ee201c4, 
-0x24420001, 0xaee201c4, 0x8003850, 0x8ee201c4, 
-0x8ee201bc, 0x24420001, 0xaee201bc, 0x8003850, 
-0x8ee201bc, 0x97a4001e, 0x2484fffc, 0x801821, 
-0x8ee400c0, 0x8ee500c4, 0x1021, 0xa32821, 
-0xa3302b, 0x822021, 0x862021, 0x24020002, 
-0xaee400c0, 0xaee500c4, 0x1282000f, 0x2a820003, 
-0x14400017, 0x24020003, 0x16820015, 0x0, 
-0x8ee200d0, 0x8ee300d4, 0x24630001, 0x2c640001, 
-0x441021, 0xaee200d0, 0xaee300d4, 0x8ee200d0, 
-0x800384a, 0x8ee300d4, 0x8ee200d8, 0x8ee300dc, 
-0x24630001, 0x2c640001, 0x441021, 0xaee200d8, 
-0xaee300dc, 0x8ee200d8, 0x800384a, 0x8ee300dc, 
-0x8ee200c8, 0x8ee300cc, 0x24630001, 0x2c640001, 
-0x441021, 0xaee200c8, 0xaee300cc, 0x8ee200c8, 
-0x8ee300cc, 0x8f8300e4, 0x8f8200e0, 0x10620003, 
-0x24630008, 0xaf8300e4, 0xaf8300e8, 0x8fbf004c, 
-0x8fb60048, 0x8fb50044, 0x8fb40040, 0x8fb3003c, 
-0x8fb20038, 0x8fb10034, 0x8fb00030, 0x3e00008, 
-0x27bd0050, 0x27bdff90, 0xafb60060, 0xb021, 
-0xafbf0068, 0xafbe0064, 0xafb5005c, 0xafb40058, 
-0xafb30054, 0xafb20050, 0xafb1004c, 0xafb00048, 
-0x8ee204d4, 0x8821, 0x24150001, 0x30420001, 
-0x1440002a, 0xa3a0002f, 0x8f8700e0, 0x8f8800c4, 
-0x8f8200e8, 0xe22023, 0x2c821000, 0x50400001, 
-0x24841000, 0x420c2, 0x801821, 0x8ee400c8, 
-0x8ee500cc, 0x1021, 0xa32821, 0xa3302b, 
-0x822021, 0x862021, 0xaee400c8, 0xaee500cc, 
-0x8f8300c8, 0x3c02000a, 0x3442efff, 0x1032023, 
-0x44102b, 0x10400003, 0x3c02000a, 0x3442f000, 
-0x822021, 0x801821, 0x8ee400c0, 0x8ee500c4, 
-0x1021, 0xa32821, 0xa3302b, 0x822021, 
-0x862021, 0xaee400c0, 0xaee500c4, 0xaf8800c8, 
-0xaf8700e4, 0x8003c5b, 0xaf8700e8, 0x3c020001, 
-0x571021, 0x904283c0, 0x1040000b, 0x0, 
-0x3c130001, 0x2779821, 0x8e7383c4, 0x3c100001, 
-0x2178021, 0x8e1083c8, 0x3c120001, 0x2579021, 
-0x8003a59, 0x8e5283cc, 0x8f8300e0, 0x8f8200e4, 
-0x10430007, 0x3821, 0x8f8200e4, 0x24070001, 
-0x8c430000, 0x8c440004, 0xafa30018, 0xafa4001c, 
-0x14e0000e, 0x3c02ffff, 0x8f8200c4, 0xafa20010, 
-0x8f8200c8, 0x3c040001, 0x248458b4, 0xafa20014, 
-0x8f8600e0, 0x8f8700e4, 0x3c050006, 0xc002403, 
-0x34a5f200, 0x8003c5b, 0x0, 0x8fa3001c, 
-0x8fb20018, 0x3073ffff, 0x2673fffc, 0x621024, 
-0x10400058, 0x2408021, 0x3c020080, 0x621024, 
-0x1040000a, 0x3c040040, 0x8ee2007c, 0x24420001, 
-0xaee2007c, 0x8ee2007c, 0x8ee201fc, 0x24420001, 
-0xaee201fc, 0x8003c55, 0x8ee201fc, 0x3c060004, 
-0x3c0b0001, 0x3c0a0002, 0x3c050010, 0x3c090008, 
-0x8ee20080, 0x3c080020, 0x34078000, 0x24420001, 
-0xaee20080, 0x8ee20080, 0x8fa2001c, 0x441824, 
-0x10660021, 0xc3102b, 0x14400007, 0x0, 
-0x106b0011, 0x0, 0x106a0015, 0x0, 
-0x8003916, 0x42042, 0x10650023, 0xa3102b, 
-0x14400005, 0x0, 0x10690019, 0x0, 
-0x8003916, 0x42042, 0x10680021, 0x0, 
-0x8003916, 0x42042, 0x8ee20034, 0x24420001, 
-0xaee20034, 0x8ee20034, 0x8003916, 0x42042, 
-0x8ee201ec, 0x24420001, 0xaee201ec, 0x8ee201ec, 
-0x8003916, 0x42042, 0x8ee201f0, 0x24420001, 
-0xaee201f0, 0x8ee201f0, 0x8003916, 0x42042, 
-0x8ee201f4, 0x24420001, 0xaee201f4, 0x8ee201f4, 
-0x8003916, 0x42042, 0x8ee20030, 0x24420001, 
-0xaee20030, 0x8ee20030, 0x8003916, 0x42042, 
-0x8ee201f8, 0x24420001, 0xaee201f8, 0x8ee201f8, 
-0x42042, 0x1087033e, 0x0, 0x80038db, 
-0x0, 0x3c020001, 0x571021, 0x904283b2, 
-0x14400084, 0x24020001, 0x3c030001, 0x771821, 
-0x906383b3, 0x1462007f, 0x3c020100, 0x8e430000, 
-0x621024, 0x1040006f, 0x2402ffff, 0x14620005, 
-0x24110001, 0x96430004, 0x3402ffff, 0x10620075, 
-0x0, 0x92e204d8, 0x14400072, 0x0, 
-0x3c020001, 0x571021, 0x8c4283b4, 0x28420005, 
-0x10400020, 0x3821, 0x3c020001, 0x571021, 
-0x8c4283b4, 0x18400016, 0x2821, 0x96060000, 
-0x520c0, 0x971021, 0x9442777e, 0x14460009, 
-0x971021, 0x94437780, 0x96020002, 0x14620005, 
-0x971021, 0x94437782, 0x96020004, 0x50620008, 
-0x24070001, 0x3c020001, 0x571021, 0x8c4283b4, 
-0x24a50001, 0xa2102a, 0x5440ffee, 0x520c0, 
-0x30e200ff, 0x10400302, 0x0, 0x80039a2, 
-0x0, 0x2402021, 0xc0022fe, 0x24050006, 
-0x3044001f, 0x428c0, 0x2e51021, 0x9442727c, 
-0x30424000, 0x144002f6, 0xb71021, 0x9443727e, 
-0x96020000, 0x1462000b, 0x418c0, 0xb71021, 
-0x94437280, 0x96020002, 0x14620006, 0x418c0, 
-0xb71021, 0x94437282, 0x96020004, 0x10620035, 
-0x418c0, 0x2e31021, 0x9442727c, 0x30428000, 
-0x144002e3, 0x2e31021, 0x944d727c, 0x96070000, 
-0xd28c0, 0xb71021, 0x9442737e, 0x8003984, 
-0x3021, 0x420c0, 0x2e41021, 0x9443737c, 
-0x2e41021, 0x944d737c, 0x30638000, 0x14600010, 
-0xd28c0, 0xb71021, 0x9442737e, 0x1447fff5, 
-0x1a02021, 0xb71021, 0x94437380, 0x96020002, 
-0x5462fff1, 0x420c0, 0xb71021, 0x94437382, 
-0x96020004, 0x5462ffec, 0x420c0, 0x24060001, 
-0x30c200ff, 0x104002c2, 0x0, 0x80039a2, 
-0x0, 0x97430202, 0x96420000, 0x146202bc, 
-0x0, 0x97430204, 0x96420002, 0x146202b8, 
-0x0, 0x97430206, 0x96420004, 0x146202b4, 
-0x0, 0x92420000, 0x3a230001, 0x30420001, 
-0x431024, 0x10400074, 0x2402ffff, 0x8e030000, 
-0x14620004, 0x3402ffff, 0x96030004, 0x1062006f, 
-0x24150002, 0x3c020001, 0x571021, 0x904283b2, 
-0x1440006a, 0x24150003, 0x92e204d8, 0x14400067, 
-0x0, 0x3c020001, 0x571021, 0x8c4283b4, 
-0x28420005, 0x10400020, 0x3821, 0x3c020001, 
-0x571021, 0x8c4283b4, 0x18400016, 0x2821, 
-0x96060000, 0x520c0, 0x971021, 0x9442777e, 
-0x14460009, 0x971021, 0x94437780, 0x96020002, 
-0x14620005, 0x971021, 0x94437782, 0x96020004, 
-0x50620008, 0x24070001, 0x3c020001, 0x571021, 
-0x8c4283b4, 0x24a50001, 0xa2102a, 0x5440ffee, 
-0x520c0, 0x30e200ff, 0x14400044, 0x24150003, 
-0x8003c55, 0x0, 0x2402021, 0xc0022fe, 
-0x24050006, 0x3044001f, 0x428c0, 0x2e51021, 
-0x9442727c, 0x30424000, 0x14400271, 0xb71021, 
-0x9443727e, 0x96020000, 0x1462000b, 0x418c0, 
-0xb71021, 0x94437280, 0x96020002, 0x14620006, 
-0x418c0, 0xb71021, 0x94437282, 0x96020004, 
-0x10620027, 0x418c0, 0x2e31021, 0x9442727c, 
-0x30428000, 0x1440025e, 0x2e31021, 0x944d727c, 
-0x96070000, 0xd28c0, 0xb71021, 0x9442737e, 
-0x8003a09, 0x3021, 0x420c0, 0x2e41021, 
-0x9443737c, 0x2e41021, 0x944d737c, 0x30638000, 
-0x14600010, 0xd28c0, 0xb71021, 0x9442737e, 
-0x1447fff5, 0x1a02021, 0xb71021, 0x94437380, 
-0x96020002, 0x5462fff1, 0x420c0, 0xb71021, 
-0x94437382, 0x96020004, 0x5462ffec, 0x420c0, 
-0x24060001, 0x30c200ff, 0x1040023d, 0x0, 
-0x8003a1c, 0x24150003, 0x24150001, 0x8f420260, 
-0x53102b, 0x10400036, 0x0, 0x8f8300e4, 
-0x8f8200e0, 0x10620003, 0x24630008, 0xaf8300e4, 
-0xaf8300e8, 0x8ee400c0, 0x8ee500c4, 0x2601821, 
-0x1021, 0xa32821, 0xa3302b, 0x822021, 
-0x862021, 0xaee400c0, 0xaee500c4, 0x8ee20058, 
-0x24420001, 0xaee20058, 0x8ee20058, 0x8ee2007c, 
-0x24420001, 0xaee2007c, 0x8ee2007c, 0x8f8200e0, 
-0xafa20010, 0x8f8200e4, 0x3c040001, 0x248458c0, 
-0xafa20014, 0x8fa60018, 0x8fa7001c, 0x3c050006, 
-0xc002403, 0x34a5f203, 0x8003c5b, 0x0, 
-0x8ee25240, 0xafa20010, 0x8ee25244, 0x3c040001, 
-0x248458cc, 0xafa20014, 0x8ee60e10, 0x8ee70e18, 
-0x3c050006, 0xc002403, 0x34a5f202, 0x8ee201c0, 
-0x24420001, 0xaee201c0, 0x8003c02, 0x8ee201c0, 
-0x96e20468, 0x53102b, 0x54400001, 0x3c168000, 
-0x126001cb, 0x3c0e001f, 0x35ceffff, 0x3c0ffff5, 
-0x35ef1000, 0x241e0040, 0x8ee2724c, 0x8f430280, 
-0x24420001, 0x304207ff, 0x1062019e, 0x0, 
-0x12c00012, 0x0, 0x8ee35240, 0x8ee25244, 
-0x1062000a, 0x26f85244, 0x8ef45244, 0xafb80024, 
-0x8ee35244, 0x21140, 0x24425248, 0x2e28821, 
-0x24630001, 0x8003a85, 0x306d00ff, 0x8ee201e0, 
-0x24420001, 0xaee201e0, 0x8ee201e0, 0x8ee30e10, 
-0x8ee20e18, 0x1062ffca, 0x26f80e18, 0x8ef40e18, 
-0xb021, 0xafb80024, 0x8ee30e18, 0x21140, 
-0x24420e20, 0x2e28821, 0x24630001, 0x306d01ff, 
-0x96e2046a, 0x30420010, 0x10400018, 0x34028100, 
-0x9643000c, 0x14620015, 0x0, 0x3c020001, 
-0x571021, 0x904283c0, 0x14400010, 0x0, 
-0x9642000e, 0xa6220016, 0x8e420008, 0x8e430004, 
-0x8e440000, 0x2673fffc, 0xae42000c, 0xae430008, 
-0xae440004, 0x9622000e, 0x26100004, 0x24180001, 
-0xa3b8002f, 0x34420200, 0xa622000e, 0x8e220000, 
-0x8e230004, 0x3c040001, 0x34843800, 0x2003021, 
-0x306a0007, 0x20a8023, 0x3641021, 0x202102b, 
-0x10400005, 0x26a9821, 0x2041023, 0x3621823, 
-0x3c020020, 0x438023, 0x26620007, 0x9623000a, 
-0x2418fff8, 0x58c824, 0x6a1821, 0x79102b, 
-0x10400002, 0x3206021, 0x606021, 0x1801821, 
-0x24620007, 0x2418fff8, 0x586024, 0x26c102b, 
-0x14400004, 0x1932823, 0x1832823, 0x8003ac3, 
-0xc31021, 0xd31021, 0x4a2023, 0x1c4102b, 
-0x54400001, 0x8f2021, 0x25420040, 0x4c102b, 
-0x14400035, 0x5821, 0x94c3000c, 0x24020800, 
-0x54620032, 0xae260018, 0x3c020001, 0x571021, 
-0x904283c0, 0x5440002d, 0xae260018, 0x24c20017, 
-0x1c2102b, 0x10400013, 0x0, 0x3c02fff5, 
-0x461021, 0x90421017, 0x38430006, 0x2c630001, 
-0x38420011, 0x2c420001, 0x621825, 0x10600014, 
-0x24c20010, 0x1c2102b, 0x1040000e, 0x0, 
-0x3c0bfff5, 0x1665821, 0x956b1010, 0x8003af4, 
-0x2562000e, 0x90c20017, 0x38430006, 0x2c630001, 
-0x38420011, 0x2c420001, 0x621825, 0x10600005, 
-0x1601821, 0x94cb0010, 0x2562000e, 0x4a5821, 
-0x1601821, 0x24620007, 0x2418fff8, 0x585824, 
-0xc31021, 0x4a2023, 0x1c4102b, 0x10400002, 
-0x1632823, 0x8f2021, 0xae260018, 0x3c020001, 
-0x571021, 0x904283c0, 0x2102b, 0x216c0, 
-0x15600002, 0xafa20044, 0x1805821, 0x30820001, 
-0x10400007, 0x4021, 0x90880000, 0x24840001, 
-0x1c4102b, 0x10400002, 0x24a5ffff, 0x8f2021, 
-0x50a00012, 0x81c02, 0x2ca20002, 0x54400009, 
-0x24a5ffff, 0x94820000, 0x24840002, 0x1024021, 
-0x1c4102b, 0x10400006, 0x24a5fffe, 0x8003b21, 
-0x8f2021, 0x90820000, 0x21200, 0x1024021, 
-0x14a0fff2, 0x2ca20002, 0x81c02, 0x3102ffff, 
-0x624021, 0x3108ffff, 0x1402821, 0x11400011, 
-0x2002021, 0x2ca20002, 0x54400009, 0x24a5ffff, 
-0x94820000, 0x24840002, 0x1024021, 0x1c4102b, 
-0x10400006, 0x24a5fffe, 0x8003b38, 0x8f2021, 
-0x90820000, 0x21200, 0x1024021, 0x14a0fff2, 
-0x2ca20002, 0x81c02, 0x3102ffff, 0x624021, 
-0x81c02, 0x3102ffff, 0x8f890120, 0x624021, 
-0x27623800, 0x25230020, 0x62102b, 0x14400002, 
-0x3108ffff, 0x27633000, 0x8f820128, 0x10620004, 
-0x0, 0x8f820124, 0x14620007, 0x1402821, 
-0x8ee201a4, 0x3821, 0x24420001, 0xaee201a4, 
-0x8003bc9, 0x8ee201a4, 0x8e260000, 0x8e270004, 
-0x81400, 0x3448000b, 0xad300008, 0xa52b000e, 
-0xad280018, 0x8fb80044, 0x2021, 0x2961025, 
-0x581025, 0xad22001c, 0xe5102b, 0xe53823, 
-0xc43023, 0xc23023, 0xad260000, 0xad270004, 
-0x8ee204c0, 0xad220010, 0xaf830120, 0x92e24e20, 
-0x1440005f, 0x24070001, 0x2502ffee, 0x2c420002, 
-0x14400003, 0x24020011, 0x15020024, 0x0, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0x8c830000, 0x24020012, 0x1462000f, 0x0, 
-0x8ee34e30, 0x8ee24e34, 0x1062000b, 0x0, 
-0x8c820004, 0x24420001, 0xac820004, 0x8ee24e34, 
-0x8ee34e30, 0x24420001, 0x105e002a, 0x0, 
-0x8003ba8, 0x0, 0x8ee24e30, 0x24420001, 
-0x505e0003, 0x1021, 0x8ee24e30, 0x24420001, 
-0xaee24e30, 0x8ee24e30, 0x210c0, 0x24425038, 
-0x2e22021, 0x8003bc6, 0x24020012, 0x8ee24e30, 
-0x210c0, 0x24425038, 0x2e22021, 0x8c830000, 
-0x24020007, 0x1462001f, 0x0, 0x8ee34e30, 
-0x8ee24e34, 0x1062001b, 0x0, 0x8c820004, 
-0x24420001, 0xac820004, 0x8ee24e34, 0x8ee34e30, 
-0x24420001, 0x105e0007, 0x0, 0x8ee24e34, 
-0x24420001, 0x10620005, 0x0, 0x8003bb4, 
-0x0, 0x14600005, 0x0, 0x8f820128, 
-0x24420020, 0xaf820128, 0x8f820128, 0x8c820004, 
-0x2c420011, 0x50400012, 0xac800000, 0x8003bc9, 
-0x0, 0x8ee24e30, 0x24420001, 0x505e0003, 
-0x1021, 0x8ee24e30, 0x24420001, 0xaee24e30, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0x24020007, 0xac820000, 0x24020001, 0xac820004, 
-0x14e00019, 0x3c050006, 0x3c040001, 0x24845890, 
-0x8e220018, 0x34a5f209, 0xafa20010, 0x8e220000, 
-0x8e230004, 0x2203021, 0x1603821, 0xc002403, 
-0xafa30014, 0x93a2002f, 0x1040002a, 0x34028100, 
-0x8e430004, 0x8e440008, 0x8e45000c, 0xa642000c, 
-0xae430000, 0xae440004, 0xae450008, 0x96220016, 
-0x8003c02, 0xa642000e, 0x1599000a, 0x26a1823, 
-0x9622000e, 0xa623000a, 0x34420004, 0xa622000e, 
-0x3c010001, 0x370821, 0xa02083c0, 0x8003bff, 
-0x9821, 0x9624000a, 0x83102b, 0x54400001, 
-0x801821, 0x24020001, 0xa623000a, 0x3c010001, 
-0x370821, 0xa02283c0, 0x9622000a, 0x4a1821, 
-0x2038021, 0x1d0102b, 0x54400001, 0x20f8021, 
-0x2639823, 0xb021, 0x8fb80024, 0x1660fe5e, 
-0xaf0d0000, 0x12600022, 0x0, 0x3c010001, 
-0x370821, 0xac3383c4, 0x3c010001, 0x370821, 
-0xac3083c8, 0x3c010001, 0x370821, 0xac3283cc, 
-0x93a2002f, 0x10400008, 0x0, 0x3c020001, 
-0x571021, 0x8c4283cc, 0x24420004, 0x3c010001, 
-0x370821, 0xac2283cc, 0x8f430280, 0x8ee2724c, 
-0x14620006, 0x0, 0x8ee201c4, 0x24420001, 
-0xaee201c4, 0x8003c5b, 0x8ee201c4, 0x8ee201bc, 
-0x24420001, 0xaee201bc, 0x8003c5b, 0x8ee201bc, 
-0x97a4001e, 0x2484fffc, 0x801821, 0x8ee400c0, 
-0x8ee500c4, 0x1021, 0xa32821, 0xa3302b, 
-0x822021, 0x862021, 0x24020002, 0xaee400c0, 
-0xaee500c4, 0x12a2000f, 0x2aa20003, 0x14400017, 
-0x24020003, 0x16a20015, 0x0, 0x8ee200d0, 
-0x8ee300d4, 0x24630001, 0x2c640001, 0x441021, 
-0xaee200d0, 0xaee300d4, 0x8ee200d0, 0x8003c55, 
-0x8ee300d4, 0x8ee200d8, 0x8ee300dc, 0x24630001, 
-0x2c640001, 0x441021, 0xaee200d8, 0xaee300dc, 
-0x8ee200d8, 0x8003c55, 0x8ee300dc, 0x8ee200c8, 
-0x8ee300cc, 0x24630001, 0x2c640001, 0x441021, 
-0xaee200c8, 0xaee300cc, 0x8ee200c8, 0x8ee300cc, 
-0x8f8300e4, 0x8f8200e0, 0x10620003, 0x24630008, 
-0xaf8300e4, 0xaf8300e8, 0x8fbf0068, 0x8fbe0064, 
-0x8fb60060, 0x8fb5005c, 0x8fb40058, 0x8fb30054, 
-0x8fb20050, 0x8fb1004c, 0x8fb00048, 0x3e00008, 
-0x27bd0070, 0x27bdffe0, 0xafbf0018, 0x8ee30e14, 
-0x8ee20e0c, 0x10620074, 0x0, 0x8ee30e0c, 
-0x8ee20e14, 0x622023, 0x4820001, 0x24840200, 
-0x8ee30e18, 0x8ee20e14, 0x43102b, 0x14400004, 
-0x24020200, 0x8ee30e14, 0x8003c7d, 0x431823, 
-0x8ee20e18, 0x8ee30e14, 0x431023, 0x2443ffff, 
-0x804821, 0x69102a, 0x54400001, 0x604821, 
-0x8f870100, 0x27623000, 0x24e80020, 0x102102b, 
-0x50400001, 0x27682800, 0x8f820108, 0x11020004, 
-0x0, 0x8f820104, 0x15020007, 0x1021, 
-0x8ee201a8, 0x2021, 0x24420001, 0xaee201a8, 
-0x8003cbf, 0x8ee201a8, 0x8ee40e14, 0x42140, 
-0x801821, 0x8ee40460, 0x8ee50464, 0xa32821, 
-0xa3302b, 0x822021, 0x862021, 0xace40000, 
-0xace50004, 0x8ee30e14, 0x91140, 0xa4e2000e, 
-0x24020002, 0xace20018, 0x31940, 0x24630e20, 
-0x2e31021, 0xace20008, 0x8ee20e14, 0xace2001c, 
-0x8ee204cc, 0xace20010, 0xaf880100, 0x92e204ec, 
-0x14400011, 0x24040001, 0x8ee24e28, 0x24030040, 
-0x24420001, 0x50430003, 0x1021, 0x8ee24e28, 
-0x24420001, 0xaee24e28, 0x8ee24e28, 0x210c0, 
-0x24424e38, 0x2e21821, 0x24020002, 0xac620000, 
-0x24020001, 0xac620004, 0x1480000e, 0x24030040, 
-0x8ee20e14, 0xafa20010, 0x8ee20e18, 0x3c050007, 
-0xafa20014, 0x8ee60e0c, 0x8ee70e10, 0x3c040001, 
-0x248458d4, 0xc002403, 0x34a5f001, 0x8003cdd, 
-0x0, 0x8ee20500, 0x24420001, 0x50430003, 
-0x1021, 0x8ee20500, 0x24420001, 0xaee20500, 
-0x8ee20500, 0x21080, 0x571021, 0xac490508, 
-0x8ee20e14, 0x491021, 0x304201ff, 0xaee20e14, 
-0x8ee30e14, 0x8ee20e0c, 0x14620005, 0x0, 
-0x8f820060, 0x2403fdff, 0x431024, 0xaf820060, 
-0x8fbf0018, 0x3e00008, 0x27bd0020, 0x27bdffe0, 
-0xafbf0018, 0x8ee3523c, 0x8ee25238, 0x10620074, 
-0x0, 0x8ee35238, 0x8ee2523c, 0x622023, 
-0x4820001, 0x24840100, 0x8ee35244, 0x8ee2523c, 
-0x43102b, 0x14400004, 0x24020100, 0x8ee3523c, 
-0x8003cff, 0x431823, 0x8ee25244, 0x8ee3523c, 
-0x431023, 0x2443ffff, 0x804821, 0x69102a, 
-0x54400001, 0x604821, 0x8f870100, 0x27623000, 
-0x24e80020, 0x102102b, 0x50400001, 0x27682800, 
-0x8f820108, 0x11020004, 0x0, 0x8f820104, 
-0x15020007, 0x1021, 0x8ee201a8, 0x2021, 
-0x24420001, 0xaee201a8, 0x8003d41, 0x8ee201a8, 
-0x8ee4523c, 0x42140, 0x801821, 0x8ee40470, 
-0x8ee50474, 0xa32821, 0xa3302b, 0x822021, 
-0x862021, 0xace40000, 0xace50004, 0x8ee3523c, 
-0x91140, 0xa4e2000e, 0x24020003, 0xace20018, 
-0x31940, 0x24635248, 0x2e31021, 0xace20008, 
-0x8ee2523c, 0xace2001c, 0x8ee204cc, 0xace20010, 
-0xaf880100, 0x92e204ec, 0x14400011, 0x24040001, 
-0x8ee24e28, 0x24030040, 0x24420001, 0x50430003, 
-0x1021, 0x8ee24e28, 0x24420001, 0xaee24e28, 
-0x8ee24e28, 0x210c0, 0x24424e38, 0x2e21821, 
-0x24020003, 0xac620000, 0x24020001, 0xac620004, 
-0x1480000e, 0x24030040, 0x8ee2523c, 0xafa20010, 
-0x8ee25244, 0x3c050007, 0xafa20014, 0x8ee65238, 
-0x8ee75240, 0x3c040001, 0x248458e0, 0xc002403, 
-0x34a5f010, 0x8003d5f, 0x0, 0x8ee20500, 
-0x24420001, 0x50430003, 0x1021, 0x8ee20500, 
-0x24420001, 0xaee20500, 0x8ee20500, 0x21080, 
-0x571021, 0xac490508, 0x8ee2523c, 0x491021, 
-0x304200ff, 0xaee2523c, 0x8ee3523c, 0x8ee25238, 
-0x14620005, 0x0, 0x8f820060, 0x2403feff, 
-0x431024, 0xaf820060, 0x8fbf0018, 0x3e00008, 
-0x27bd0020, 0x8f820120, 0x8ee34e34, 0x8f820124, 
-0x8f860128, 0x24020040, 0x24630001, 0x50620003, 
-0x1021, 0x8ee24e34, 0x24420001, 0xaee24e34, 
-0x8ee24e34, 0x8ee44e34, 0x8ee34e30, 0x210c0, 
-0x24425038, 0x14830007, 0x2e22821, 0x8f820128, 
-0x24420020, 0xaf820128, 0x8f820128, 0x8003d92, 
-0xaca00000, 0x8ee24e34, 0x24030040, 0x24420001, 
-0x50430003, 0x1021, 0x8ee24e34, 0x24420001, 
-0x210c0, 0x24425038, 0x2e22821, 0x8ca20004, 
-0x8f830128, 0x21140, 0x621821, 0xaf830128, 
-0xaca00000, 0x8cc20018, 0x2443fffe, 0x2c620012, 
-0x10400008, 0x31080, 0x3c010001, 0x220821, 
-0x8c2258f0, 0x400008, 0x0, 0x24020001, 
-0xaee24e24, 0x3e00008, 0x0, 0x27bdffc8, 
-0xafbf0030, 0xafb5002c, 0xafb40028, 0xafb30024, 
-0xafb20020, 0xafb1001c, 0xafb00018, 0x8f830128, 
-0x8f820124, 0x106202b0, 0x9821, 0x3c11001f, 
-0x3631ffff, 0x3c12fff5, 0x36521000, 0x24150012, 
-0x24140040, 0x8f8c0128, 0x8f820128, 0x24420020, 
-0xaf820128, 0x9182001b, 0x8f830128, 0x2443fffe, 
-0x2c620012, 0x1040029c, 0x31080, 0x3c010001, 
-0x220821, 0x8c225948, 0x400008, 0x0, 
-0x8f420218, 0x30420100, 0x10400007, 0x0, 
-0x95830016, 0x95820018, 0x621823, 0x31402, 
-0x431021, 0xa5820016, 0x8d82001c, 0x3c038000, 
-0x3044ffff, 0x436824, 0x3c030800, 0x431824, 
-0x11a00004, 0xad84001c, 0x41140, 0x8003dd8, 
-0x24425248, 0x41140, 0x24420e20, 0x2e25821, 
-0x9562000e, 0x3042fffc, 0x10600004, 0xa562000e, 
-0x95840016, 0x8003ec0, 0x0, 0x8d690018, 
-0x4021, 0x952a0000, 0x25290002, 0x95270000, 
-0x25290002, 0x95260000, 0x25290002, 0x95250000, 
-0x25290002, 0x95240000, 0x25290002, 0x95230000, 
-0x25290002, 0x95220000, 0x25290002, 0x1475021, 
-0x1465021, 0x1455021, 0x1445021, 0x1435021, 
-0x1425021, 0xa1c02, 0x3142ffff, 0x625021, 
-0xa1c02, 0x3142ffff, 0x625021, 0x96e2046a, 
-0x314effff, 0x30420002, 0x10400044, 0x5021, 
-0x25220014, 0x222102b, 0x10400014, 0x1201821, 
-0x2405000a, 0x2021, 0x223102b, 0x54400001, 
-0x721821, 0x94620000, 0x24630002, 0x24a5ffff, 
-0x14a0fff9, 0x822021, 0x41c02, 0x3082ffff, 
-0x622021, 0x41402, 0x3083ffff, 0x431021, 
-0x3042ffff, 0x8003e33, 0x1425021, 0x952a0000, 
-0x25290002, 0x95280000, 0x25290002, 0x95270000, 
-0x25290002, 0x95260000, 0x25290002, 0x95250000, 
-0x25290002, 0x95230000, 0x25290002, 0x95220000, 
-0x25290002, 0x95240000, 0x25290002, 0x1485021, 
-0x1475021, 0x1465021, 0x1455021, 0x1435021, 
-0x1425021, 0x95220000, 0x95230002, 0x1445021, 
-0x1425021, 0x1435021, 0xa1c02, 0x3142ffff, 
-0x625021, 0xa1c02, 0x3142ffff, 0x625021, 
-0x3148ffff, 0x51000001, 0x3408ffff, 0x8d620018, 
-0x9443000c, 0x24020800, 0x54620005, 0xa5680010, 
-0x9562000e, 0x34420002, 0xa562000e, 0xa5680010, 
-0x96e2046a, 0x2821, 0x30420008, 0x14400056, 
-0x3021, 0x8d630018, 0x24620024, 0x222102b, 
-0x10400034, 0x24690010, 0x229102b, 0x54400001, 
-0x1324821, 0x95250000, 0x24690014, 0x229102b, 
-0x10400002, 0x24a5ffec, 0x1324821, 0x95220000, 
-0x30420fff, 0x14400003, 0x25290002, 0x8003e60, 
-0x24130001, 0x9821, 0xa03021, 0x229102b, 
-0x54400001, 0x1324821, 0x91220001, 0x25290002, 
-0xa22821, 0x229102b, 0x54400001, 0x1324821, 
-0x25290002, 0x229102b, 0x54400001, 0x1324821, 
-0x95220000, 0x25290002, 0xa22821, 0x229102b, 
-0x54400001, 0x1324821, 0x95220000, 0x25290002, 
-0xa22821, 0x229102b, 0x54400001, 0x1324821, 
-0x95220000, 0x25290002, 0xa22821, 0x229102b, 
-0x54400001, 0x1324821, 0x95220000, 0x8003e99, 
-0xa22821, 0x94650010, 0x94620014, 0x24690016, 
-0x30420fff, 0x14400003, 0x24a5ffec, 0x8003e8c, 
-0x24130001, 0x9821, 0xa03021, 0x91230001, 
-0x25290004, 0x95220000, 0x25290002, 0x95240000, 
-0x25290002, 0xa32821, 0xa22821, 0x95220000, 
-0x95230002, 0xa42821, 0xa22821, 0xa32821, 
-0x51c02, 0x30a2ffff, 0x622821, 0x51c02, 
-0x30a2ffff, 0x622821, 0x96e2046a, 0x30420001, 
-0x1040001e, 0x2021, 0x95820016, 0x4e2023, 
-0x41402, 0x822021, 0x326200ff, 0x50400002, 
-0x862021, 0x852021, 0x41402, 0x822021, 
-0x3084ffff, 0x50800001, 0x3404ffff, 0x8d620018, 
-0x24430017, 0x223102b, 0x54400001, 0x721821, 
-0x90620000, 0x38430011, 0x2c630001, 0x38420006, 
-0x2c420001, 0x621825, 0x10600004, 0x0, 
-0x9562000e, 0x34420001, 0xa562000e, 0x9562000e, 
-0x240a0002, 0x30420004, 0x10400002, 0xa5640012, 
-0x240a0004, 0x8f880120, 0x27623800, 0x25090020, 
-0x122102b, 0x50400001, 0x27693000, 0x8f820128, 
-0x11220004, 0x0, 0x8f820124, 0x15220007, 
-0x24040020, 0x8ee201a4, 0x8021, 0x24420001, 
-0xaee201a4, 0x8003f4f, 0x8ee201a4, 0x8ee5724c, 
-0x8ee60490, 0x8ee70494, 0xad0b0008, 0xa504000e, 
-0xad0a0018, 0x52940, 0xa01821, 0x1021, 
-0xe33821, 0xe3202b, 0xc23021, 0xc43021, 
-0xad060000, 0xad070004, 0x8ee2724c, 0x4d1025, 
-0xad02001c, 0x8ee204c4, 0xad020010, 0xaf890120, 
-0x92e24e20, 0x14400060, 0x24100001, 0x2543ffee, 
-0x2c630002, 0x39420011, 0x2c420001, 0x621825, 
-0x10600024, 0x0, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0x8c820000, 0x1455000f, 
-0x0, 0x8ee34e30, 0x8ee24e34, 0x1062000b, 
-0x0, 0x8c820004, 0x24420001, 0xac820004, 
-0x8ee24e34, 0x8ee34e30, 0x24420001, 0x1054002b, 
-0x0, 0x8003f2e, 0x0, 0x8ee24e30, 
-0x24420001, 0x50540003, 0x1021, 0x8ee24e30, 
-0x24420001, 0xaee24e30, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0x24020001, 0x8003f4e, 
-0xac950000, 0x8ee24e30, 0x210c0, 0x24425038, 
-0x2e22021, 0x8c830000, 0x24020007, 0x1462001f, 
-0x0, 0x8ee34e30, 0x8ee24e34, 0x1062001b, 
-0x0, 0x8c820004, 0x24420001, 0xac820004, 
-0x8ee24e34, 0x8ee34e30, 0x24420001, 0x10540007, 
-0x0, 0x8ee24e34, 0x24420001, 0x10620005, 
-0x0, 0x8003f3a, 0x0, 0x14600005, 
-0x0, 0x8f820128, 0x24420020, 0xaf820128, 
-0x8f820128, 0x8c820004, 0x2c420011, 0x50400012, 
-0xac800000, 0x8003f4f, 0x0, 0x8ee24e30, 
-0x24420001, 0x50540003, 0x1021, 0x8ee24e30, 
-0x24420001, 0xaee24e30, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0x24020007, 0xac820000, 
-0x24020001, 0xac820004, 0x1600000d, 0x0, 
-0x8f820120, 0x3c040001, 0x24845938, 0xafa00014, 
-0xafa20010, 0x8d86001c, 0x8f870124, 0x3c050008, 
-0xc002403, 0x34a50001, 0x8004057, 0x0, 
-0x8ee2724c, 0x24420001, 0x304207ff, 0x11a00006, 
-0xaee2724c, 0x8ee201d0, 0x2442ffff, 0xaee201d0, 
-0x8003f6b, 0x8ee201d0, 0x8ee201cc, 0x2442ffff, 
-0xaee201cc, 0x8ee201cc, 0x8ee201d8, 0x2442ffff, 
-0xaee201d8, 0x8004057, 0x8ee201d8, 0x8f420240, 
-0x104000e5, 0x0, 0x8ee20e1c, 0x24420001, 
-0x8004057, 0xaee20e1c, 0x9582001e, 0xad82001c, 
-0x8f420240, 0x10400072, 0x0, 0x8ee20e1c, 
-0x24420001, 0xaee20e1c, 0x8f430240, 0x43102b, 
-0x144000d5, 0x0, 0x8f830120, 0x27623800, 
-0x24660020, 0xc2102b, 0x50400001, 0x27663000, 
-0x8f820128, 0x10c20004, 0x0, 0x8f820124, 
-0x14c20007, 0x0, 0x8ee201a4, 0x8021, 
-0x24420001, 0xaee201a4, 0x8003fda, 0x8ee201a4, 
-0x8ee2724c, 0xac62001c, 0x8ee404a8, 0x8ee504ac, 
-0x2462001c, 0xac620008, 0x24020008, 0xa462000e, 
-0x24020011, 0xac620018, 0xac640000, 0xac650004, 
-0x8ee204c4, 0xac620010, 0xaf860120, 0x92e24e20, 
-0x14400034, 0x24100001, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0x8c820000, 0x1455001f, 
-0x0, 0x8ee34e30, 0x8ee24e34, 0x1062001b, 
-0x0, 0x8c820004, 0x24420001, 0xac820004, 
-0x8ee24e34, 0x8ee34e30, 0x24420001, 0x10540007, 
-0x0, 0x8ee24e34, 0x24420001, 0x10620005, 
-0x0, 0x8003fc6, 0x0, 0x14600005, 
-0x0, 0x8f820128, 0x24420020, 0xaf820128, 
-0x8f820128, 0x8c820004, 0x2c420011, 0x50400011, 
-0xac800000, 0x8003fda, 0x0, 0x8ee24e30, 
-0x24420001, 0x50540003, 0x1021, 0x8ee24e30, 
-0x24420001, 0xaee24e30, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0x24020001, 0xac950000, 
-0xac820004, 0x5600000b, 0x24100001, 0x8ee2724c, 
-0x3c040001, 0x248458a8, 0xafa00014, 0xafa20010, 
-0x8ee6724c, 0x8f470280, 0x3c050009, 0xc002403, 
-0x34a5f008, 0x56000001, 0xaee00e1c, 0x8ee20188, 
-0x24420001, 0xaee20188, 0x8004050, 0x8ee20188, 
-0x8f830120, 0x27623800, 0x24660020, 0xc2102b, 
-0x50400001, 0x27663000, 0x8f820128, 0x10c20004, 
-0x0, 0x8f820124, 0x14c20007, 0x0, 
-0x8ee201a4, 0x8021, 0x24420001, 0xaee201a4, 
-0x8004044, 0x8ee201a4, 0x8ee2724c, 0xac62001c, 
-0x8ee404a8, 0x8ee504ac, 0x2462001c, 0xac620008, 
-0x24020008, 0xa462000e, 0x24020011, 0xac620018, 
-0xac640000, 0xac650004, 0x8ee204c4, 0xac620010, 
-0xaf860120, 0x92e24e20, 0x14400034, 0x24100001, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0x8c820000, 0x1455001f, 0x0, 0x8ee34e30, 
-0x8ee24e34, 0x1062001b, 0x0, 0x8c820004, 
-0x24420001, 0xac820004, 0x8ee24e34, 0x8ee34e30, 
-0x24420001, 0x10540007, 0x0, 0x8ee24e34, 
-0x24420001, 0x10620005, 0x0, 0x8004030, 
-0x0, 0x14600005, 0x0, 0x8f820128, 
-0x24420020, 0xaf820128, 0x8f820128, 0x8c820004, 
-0x2c420011, 0x50400011, 0xac800000, 0x8004044, 
-0x0, 0x8ee24e30, 0x24420001, 0x50540003, 
-0x1021, 0x8ee24e30, 0x24420001, 0xaee24e30, 
-0x8ee24e30, 0x210c0, 0x24425038, 0x2e22021, 
-0x24020001, 0xac950000, 0xac820004, 0x1600000b, 
-0x0, 0x8ee2724c, 0x3c040001, 0x248458a8, 
-0xafa00014, 0xafa20010, 0x8ee6724c, 0x8f470280, 
-0x3c050009, 0xc002403, 0x34a5f008, 0x8ee20174, 
-0x24420001, 0xaee20174, 0x8004057, 0x8ee20174, 
-0x24020001, 0xaee24e24, 0x8f830128, 0x8f820124, 
-0x1462fd58, 0x0, 0x8fbf0030, 0x8fb5002c, 
-0x8fb40028, 0x8fb30024, 0x8fb20020, 0x8fb1001c, 
-0x8fb00018, 0x3e00008, 0x27bd0038, 0x27bdffe8, 
-0x27840208, 0x27450200, 0x24060008, 0xafbf0014, 
-0xc00249a, 0xafb00010, 0x2021, 0x24100001, 
-0x2402241f, 0xaf900210, 0xaf900200, 0xaf800204, 
-0xaf820214, 0x8f460248, 0x24030004, 0x3c020040, 
-0x3c010001, 0xac235cc4, 0x3c010001, 0xac235cc8, 
-0x3c010001, 0xac205d9c, 0x3c010001, 0xac225cc0, 
-0x3c010001, 0xac235cc8, 0xc005108, 0x24050004, 
-0xc004822, 0x0, 0x8ee20000, 0x3c03feff, 
-0x3463fffd, 0x431024, 0xaee20000, 0x3c023c00, 
-0xaf82021c, 0x3c010001, 0x370821, 0xac3083ac, 
-0x8fbf0014, 0x8fb00010, 0x3e00008, 0x27bd0018, 
-0x27bdffe0, 0x3c050008, 0x34a50400, 0xafbf0018, 
-0xafa00010, 0xafa00014, 0x8f860200, 0x3c040001, 
-0x248459f0, 0xc002403, 0x3821, 0x8ee20280, 
-0x24420001, 0xaee20280, 0x8ee20280, 0x8f830200, 
-0x3c023f00, 0x621824, 0x8fbf0018, 0x3c020400, 
-0x3e00008, 0x27bd0020, 0x27bdffd8, 0xafbf0020, 
-0xafb1001c, 0xafb00018, 0x8f900220, 0x8ee20214, 
-0x3821, 0x24420001, 0xaee20214, 0x8ee20214, 
-0x3c020300, 0x2021024, 0x10400027, 0x3c110400, 
-0xc00429b, 0x0, 0x3c020100, 0x2021024, 
-0x10400007, 0x0, 0x8ee20218, 0x24420001, 
-0xaee20218, 0x8ee20218, 0x80040c6, 0x3c03fdff, 
-0x8ee2021c, 0x24420001, 0xaee2021c, 0x8ee2021c, 
-0x3c03fdff, 0x3463ffff, 0x3c0808ff, 0x3508ffff, 
-0x8ee20000, 0x3c040001, 0x248459fc, 0x3c050008, 
-0x2003021, 0x431024, 0xaee20000, 0x8f820220, 
-0x3821, 0x3c030300, 0x481024, 0x431025, 
-0xaf820220, 0xafa00010, 0xc002403, 0xafa00014, 
-0x8004296, 0x0, 0x2111024, 0x1040001f, 
-0x3c024000, 0x8f830224, 0x24021402, 0x1462000b, 
-0x3c03fdff, 0x3c040001, 0x24845a08, 0x3c050008, 
-0xafa00010, 0xafa00014, 0x8f860224, 0x34a5ffff, 
-0xc002403, 0x3821, 0x3c03fdff, 0x8ee20000, 
-0x3463ffff, 0x2002021, 0x431024, 0xc004e54, 
-0xaee20000, 0x8ee20220, 0x24420001, 0xaee20220, 
-0x8ee20220, 0x8f820220, 0x3c0308ff, 0x3463ffff, 
-0x431024, 0x8004295, 0x511025, 0x2021024, 
-0x10400142, 0x0, 0x8ee2022c, 0x24420001, 
-0xaee2022c, 0x8ee2022c, 0x8f820220, 0x3c0308ff, 
-0x3463ffff, 0x431024, 0x34420004, 0xaf820220, 
-0x8f830054, 0x8f820054, 0x800410e, 0x24630002, 
-0x8f820054, 0x621023, 0x2c420003, 0x1440fffc, 
-0x0, 0x8f8600e0, 0x8f8400e4, 0x30c20007, 
-0x10400012, 0x0, 0x8f8300e4, 0x2402fff8, 
-0xc21024, 0x1043000d, 0x0, 0x8f820054, 
-0x8f8300e0, 0x14c30009, 0x24440050, 0x8f820054, 
-0x821023, 0x2c420051, 0x10400004, 0x0, 
-0x8f8200e0, 0x10c2fff9, 0x0, 0x8f820220, 
-0x3c0308ff, 0x3463fffd, 0x431024, 0xaf820220, 
-0x8f8600e0, 0x30c20007, 0x10400003, 0x2402fff8, 
-0xc23024, 0xaf8600e0, 0x8f8300c4, 0x3c02001f, 
-0x3442ffff, 0x24680008, 0x48102b, 0x10400003, 
-0x3c02fff5, 0x34421000, 0x1024021, 0x8f8b00c8, 
-0x8f850120, 0x8f840124, 0x8004145, 0x6021, 
-0x27623800, 0x82102b, 0x50400001, 0x27643000, 
-0x10a40010, 0x318200ff, 0x8c820018, 0x38430007, 
-0x2c630001, 0x3842000b, 0x2c420001, 0x621825, 
-0x5060fff3, 0x24840020, 0x8ee20240, 0x240c0001, 
-0x24420001, 0xaee20240, 0x8ee20240, 0x8c8b0008, 
-0x318200ff, 0x14400065, 0x0, 0x3c020001, 
-0x571021, 0x904283c0, 0x14400060, 0x0, 
-0x8f8400e4, 0xc41023, 0x218c3, 0x4620001, 
-0x24630200, 0x8f8900c4, 0x10600005, 0x24020001, 
-0x10620009, 0x0, 0x8004187, 0x0, 
-0x8ee20230, 0x1205821, 0x24420001, 0xaee20230, 
-0x80041bc, 0x8ee20230, 0x8ee20234, 0x3c05000a, 
-0x24420001, 0xaee20234, 0x8c8b0000, 0x34a5f000, 
-0x8ee20234, 0x12b1823, 0xa3102b, 0x54400001, 
-0x651821, 0x2c62233f, 0x14400040, 0x0, 
-0x8f8200e8, 0x24420008, 0xaf8200e8, 0x8f8200e8, 
-0x8f8200e4, 0x1205821, 0x24420008, 0xaf8200e4, 
-0x80041bc, 0x8f8200e4, 0x8ee20238, 0x3c03000a, 
-0x24420001, 0xaee20238, 0x8c840000, 0x3463f000, 
-0x8ee20238, 0x883823, 0x67102b, 0x54400001, 
-0xe33821, 0x3c020003, 0x34420d40, 0x47102b, 
-0x10400003, 0x0, 0x80041bc, 0x805821, 
-0x8f8200e4, 0x24440008, 0xaf8400e4, 0x8f8400e4, 
-0x10860018, 0x3c05000a, 0x34a5f000, 0x3c0a0003, 
-0x354a0d40, 0x8ee2007c, 0x24420001, 0xaee2007c, 
-0x8c830000, 0x8ee2007c, 0x683823, 0xa7102b, 
-0x54400001, 0xe53821, 0x147102b, 0x54400007, 
-0x605821, 0x8f8200e4, 0x24440008, 0xaf8400e4, 
-0x8f8400e4, 0x1486ffef, 0x0, 0x14860005, 
-0x0, 0x1205821, 0xaf8600e4, 0x80041bc, 
-0xaf8600e8, 0xaf8400e4, 0xaf8400e8, 0x8f8200c8, 
-0x3c03000a, 0x3463f000, 0x483823, 0x67102b, 
-0x54400001, 0xe33821, 0x3c020003, 0x34420d3f, 
-0x47102b, 0x54400007, 0x6021, 0x1683823, 
-0x67102b, 0x54400003, 0xe33821, 0x80041cf, 
-0x3c020003, 0x3c020003, 0x34420d3f, 0x47102b, 
-0x14400016, 0x318200ff, 0x14400006, 0x0, 
-0x3c020001, 0x571021, 0x904283c0, 0x1040000f, 
-0x0, 0x8ee2023c, 0x3c04fdff, 0x8ee30000, 
-0x3484ffff, 0x24420001, 0xaee2023c, 0x8ee2023c, 
-0x24020001, 0x641824, 0x3c010001, 0x370821, 
-0xa02283b8, 0x800422c, 0xaee30000, 0xaf8b00c8, 
-0x8f8300c8, 0x8f8200c4, 0x3c04000a, 0x3484f000, 
-0x623823, 0x87102b, 0x54400001, 0xe43821, 
-0x3c020003, 0x34420d40, 0x47102b, 0x2ce30001, 
-0x431025, 0x10400008, 0x0, 0x8f820220, 
-0x3c0308ff, 0x3463ffff, 0x431024, 0x3c034000, 
-0x431025, 0xaf820220, 0x8f8600e0, 0x8f8400e4, 
-0x10c4002a, 0x0, 0x8ee2007c, 0x24420001, 
-0xaee2007c, 0x8ee2007c, 0x24c2fff8, 0xaf8200e0, 
-0x3c020001, 0x8c427e30, 0x3c030008, 0x8f8600e0, 
-0x431024, 0x1040001d, 0x0, 0x10c4001b, 
-0x240dfff8, 0x3c0a000a, 0x354af000, 0x3c0c0080, 
-0x24850008, 0x27622800, 0x50a20001, 0x27651800, 
-0x8c880004, 0x8c820000, 0x8ca90000, 0x3103ffff, 
-0x431021, 0x4d1024, 0x24430010, 0x6b102b, 
-0x54400001, 0x6a1821, 0x12b102b, 0x54400001, 
-0x12a4821, 0x10690002, 0x10c1025, 0xac820004, 
-0xa02021, 0x14c4ffeb, 0x24850008, 0x8f820220, 
-0x3c0308ff, 0x3463ffff, 0x431024, 0x34420002, 
-0xaf820220, 0x8f830054, 0x8f820054, 0x8004237, 
-0x24630001, 0x8f820054, 0x621023, 0x2c420002, 
-0x1440fffc, 0x0, 0x8f820220, 0x3c0308ff, 
-0x3463fffb, 0x431024, 0xaf820220, 0x6010055, 
-0x0, 0x8ee20228, 0x24420001, 0xaee20228, 
-0x8ee20228, 0x8f820220, 0x3c0308ff, 0x3463ffff, 
-0x431024, 0x34420004, 0xaf820220, 0x8f830054, 
-0x8f820054, 0x8004251, 0x24630002, 0x8f820054, 
-0x621023, 0x2c420003, 0x1440fffc, 0x0, 
-0x8f8600e0, 0x30c20007, 0x10400012, 0x0, 
-0x8f8300e4, 0x2402fff8, 0xc21024, 0x1043000d, 
-0x0, 0x8f820054, 0x8f8300e0, 0x14c30009, 
-0x24440032, 0x8f820054, 0x821023, 0x2c420033, 
-0x10400004, 0x0, 0x8f8200e0, 0x10c2fff9, 
-0x0, 0x8f820220, 0x3c0308ff, 0x3463fffd, 
-0x431024, 0xaf820220, 0x8f8600e0, 0x30c20007, 
-0x10400003, 0x2402fff8, 0xc23024, 0xaf8600e0, 
-0x240301f5, 0x8f8200e8, 0x673823, 0x718c0, 
-0x431021, 0xaf8200e8, 0x8f8200e8, 0xaf8200e4, 
-0x8ee2007c, 0x3c0408ff, 0x3484ffff, 0x471021, 
-0xaee2007c, 0x8f820220, 0x3c038000, 0x34630002, 
-0x441024, 0x431025, 0xaf820220, 0x8f830054, 
-0x8f820054, 0x800428d, 0x24630001, 0x8f820054, 
-0x621023, 0x2c420002, 0x1440fffc, 0x0, 
-0x8f820220, 0x3c0308ff, 0x3463fffb, 0x431024, 
-0xaf820220, 0x8fbf0020, 0x8fb1001c, 0x8fb00018, 
-0x3e00008, 0x27bd0028, 0x3c020001, 0x8c425cd8, 
-0x27bdffd8, 0x10400012, 0xafbf0020, 0x3c040001, 
-0x24845a14, 0x3c050008, 0x24020001, 0x3c010001, 
-0x370821, 0xac2283ac, 0xafa00010, 0xafa00014, 
-0x8f860220, 0x34a50498, 0x3c010001, 0xac205cd8, 
-0x3c010001, 0xac225ccc, 0xc002403, 0x3821, 
-0x8f420268, 0x3c037fff, 0x3463ffff, 0x431024, 
-0xaf420268, 0x8ee204d0, 0x8ee404d4, 0x2403fffe, 
-0x431024, 0x30840002, 0x1080011e, 0xaee204d0, 
-0x8ee204d4, 0x2403fffd, 0x431024, 0xaee204d4, 
-0x8f820044, 0x3c030600, 0x34632000, 0x34420020, 
-0xaf820044, 0xafa30018, 0x8ee20608, 0x8f430228, 
-0x24420001, 0x304a00ff, 0x514300fe, 0xafa00010, 
-0x8ee20608, 0x210c0, 0x571021, 0x8fa30018, 
-0x8fa4001c, 0xac43060c, 0xac440610, 0x8f830054, 
-0x8f820054, 0x24690032, 0x1221023, 0x2c420033, 
-0x1040006a, 0x5821, 0x24180008, 0x240f000d, 
-0x240d0007, 0x240c0040, 0x240e0001, 0x8f870120, 
-0x27623800, 0x24e80020, 0x102102b, 0x50400001, 
-0x27683000, 0x8f820128, 0x11020004, 0x0, 
-0x8f820124, 0x15020007, 0x1021, 0x8ee201a4, 
-0x2821, 0x24420001, 0xaee201a4, 0x800433d, 
-0x8ee201a4, 0x8ee40608, 0x420c0, 0x801821, 
-0x8ee40430, 0x8ee50434, 0xa32821, 0xa3302b, 
-0x822021, 0x862021, 0xace40000, 0xace50004, 
-0x8ee20608, 0xa4f8000e, 0xacef0018, 0xacea001c, 
-0x210c0, 0x2442060c, 0x2e21021, 0xace20008, 
-0x8ee204c4, 0xace20010, 0xaf880120, 0x92e24e20, 
-0x14400033, 0x24050001, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0x8c820000, 0x144d001f, 
-0x0, 0x8ee34e30, 0x8ee24e34, 0x1062001b, 
-0x0, 0x8c820004, 0x24420001, 0xac820004, 
-0x8ee24e34, 0x8ee34e30, 0x24420001, 0x104c0007, 
-0x0, 0x8ee24e34, 0x24420001, 0x10620005, 
-0x0, 0x800432a, 0x0, 0x14600005, 
-0x0, 0x8f820128, 0x24420020, 0xaf820128, 
-0x8f820128, 0x8c820004, 0x2c420011, 0x50400010, 
-0xac800000, 0x800433d, 0x0, 0x8ee24e30, 
-0x24420001, 0x504c0003, 0x1021, 0x8ee24e30, 
-0x24420001, 0xaee24e30, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0xac8d0000, 0xac8e0004, 
-0x54a00006, 0x240b0001, 0x8f820054, 0x1221023, 
-0x2c420033, 0x1440ff9d, 0x0, 0x316300ff, 
-0x24020001, 0x54620079, 0xafa00010, 0xaeea0608, 
-0x8f830054, 0x8f820054, 0x24690032, 0x1221023, 
-0x2c420033, 0x10400061, 0x5821, 0x240d0008, 
-0x240c0011, 0x24080012, 0x24070040, 0x240a0001, 
-0x8f830120, 0x27623800, 0x24660020, 0xc2102b, 
-0x50400001, 0x27663000, 0x8f820128, 0x10c20004, 
-0x0, 0x8f820124, 0x14c20007, 0x0, 
-0x8ee201a4, 0x2821, 0x24420001, 0xaee201a4, 
-0x80043a9, 0x8ee201a4, 0x8ee20608, 0xac62001c, 
-0x8ee404a0, 0x8ee504a4, 0x2462001c, 0xac620008, 
-0xa46d000e, 0xac6c0018, 0xac640000, 0xac650004, 
-0x8ee204c4, 0xac620010, 0xaf860120, 0x92e24e20, 
-0x14400033, 0x24050001, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0x8c820000, 0x1448001f, 
-0x0, 0x8ee34e30, 0x8ee24e34, 0x1062001b, 
-0x0, 0x8c820004, 0x24420001, 0xac820004, 
-0x8ee24e34, 0x8ee34e30, 0x24420001, 0x10470007, 
-0x0, 0x8ee24e34, 0x24420001, 0x10620005, 
-0x0, 0x8004396, 0x0, 0x14600005, 
-0x0, 0x8f820128, 0x24420020, 0xaf820128, 
-0x8f820128, 0x8c820004, 0x2c420011, 0x50400010, 
-0xac800000, 0x80043a9, 0x0, 0x8ee24e30, 
-0x24420001, 0x50470003, 0x1021, 0x8ee24e30, 
-0x24420001, 0xaee24e30, 0x8ee24e30, 0x210c0, 
-0x24425038, 0x2e22021, 0xac880000, 0xac8a0004, 
-0x54a00006, 0x240b0001, 0x8f820054, 0x1221023, 
-0x2c420033, 0x1440ffa6, 0x0, 0x316300ff, 
-0x24020001, 0x54620003, 0xafa00010, 0x80043d6, 
-0x0, 0x3c040001, 0x24845a20, 0xafa00014, 
-0x8f860120, 0x8f870124, 0x3c050009, 0xc002403, 
-0x34a5f011, 0x80043d6, 0x0, 0x3c040001, 
-0x24845a2c, 0xafa00014, 0x8f860120, 0x8f870124, 
-0x3c050009, 0xc002403, 0x34a5f010, 0x80043d6, 
-0x0, 0x3c040001, 0x24845a38, 0xafa00014, 
-0x8ee60608, 0x8f470228, 0x3c050009, 0xc002403, 
-0x34a5f00f, 0x8ee201ac, 0x24420001, 0xaee201ac, 
-0x8ee201ac, 0x8ee2015c, 0x24420001, 0xaee2015c, 
-0x8ee2015c, 0x8fbf0020, 0x3e00008, 0x27bd0028, 
-0x3c020001, 0x8c425cd8, 0x27bdffe0, 0x1440000d, 
-0xafbf0018, 0x3c040001, 0x24845a44, 0x3c050008, 
-0xafa00010, 0xafa00014, 0x8f860220, 0x34a50499, 
-0x24020001, 0x3c010001, 0xac225cd8, 0xc002403, 
-0x3821, 0x8ee204d0, 0x3c030001, 0x771821, 
-0x946383b2, 0x34420001, 0x10600007, 0xaee204d0, 
-0x8f820220, 0x3c0308ff, 0x3463ffff, 0x431024, 
-0x34420008, 0xaf820220, 0x2021, 0xc0052a2, 
-0x24050004, 0xaf420268, 0x8fbf0018, 0x3e00008, 
-0x27bd0020, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x3c120001, 
-0x26521200, 0x3c140001, 0x8e945c50, 0x3c100001, 
-0x26101120, 0x3c15c000, 0x36b50060, 0x8e8a0000, 
-0x8eb30000, 0x26a400b, 0x248000a, 0x200f821, 
-0x0, 0xd, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x80014d6, 
-0x0, 0x80014d8, 0x3c0a0001, 0x80014d8, 
-0x3c0a0002, 0x80014d8, 0x0, 0x80024a6, 
-0x0, 0x80014d8, 0x3c0a0003, 0x80014d8, 
-0x3c0a0004, 0x8002f8c, 0x0, 0x80014d8, 
-0x3c0a0005, 0x8003ce8, 0x0, 0x8003c66, 
-0x0, 0x80014d8, 0x3c0a0006, 0x80014d8, 
-0x3c0a0007, 0x80014d8, 0x0, 0x80014d8, 
-0x0, 0x80014d8, 0x0, 0x8002a75, 
-0x0, 0x80014d8, 0x3c0a000b, 0x80014d8, 
-0x3c0a000c, 0x80014d8, 0x3c0a000d, 0x800237a, 
-0x0, 0x8002339, 0x0, 0x80014d8, 
-0x3c0a000e, 0x8001b3c, 0x0, 0x80024a4, 
-0x0, 0x80014d8, 0x3c0a000f, 0x80040a7, 
-0x0, 0x8004091, 0x0, 0x80014d8, 
-0x3c0a0010, 0x80014ee, 0x0, 0x80014d8, 
-0x3c0a0011, 0x80014d8, 0x3c0a0012, 0x80014d8, 
-0x3c0a0013, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x3c030001, 
-0x34633800, 0x24050080, 0x2404001f, 0x2406ffff, 
-0x24020001, 0xaf80021c, 0xaf820200, 0xaf820220, 
-0x3631021, 0xaf8200c0, 0x3631021, 0xaf8200c4, 
-0x3631021, 0xaf8200c8, 0x27623800, 0xaf8200d0, 
-0x27623800, 0xaf8200d4, 0x27623800, 0xaf8200d8, 
-0x27621800, 0xaf8200e0, 0x27621800, 0xaf8200e4, 
-0x27621800, 0xaf8200e8, 0x27621000, 0xaf8200f0, 
-0x27621000, 0xaf8200f4, 0x27621000, 0xaf8200f8, 
-0xaca00000, 0x2484ffff, 0x1486fffd, 0x24a50004, 
-0x8f830040, 0x3c02f000, 0x621824, 0x3c025000, 
-0x1062000c, 0x43102b, 0x14400006, 0x3c026000, 
-0x3c024000, 0x10620008, 0x24020800, 0x8004539, 
-0x0, 0x10620004, 0x24020800, 0x8004539, 
-0x0, 0x24020700, 0x3c010001, 0xac225cdc, 
-0x3e00008, 0x0, 0x27bdffd8, 0xafbf0024, 
-0xafb00020, 0x8f830054, 0x8f820054, 0x3c010001, 
-0xac205cc4, 0x8004545, 0x24630064, 0x8f820054, 
-0x621023, 0x2c420065, 0x1440fffc, 0x0, 
-0xc004d71, 0x0, 0x24040001, 0x2821, 
-0x27a60018, 0x34028000, 0xc00498e, 0xa7a20018, 
-0x8f830054, 0x8f820054, 0x8004556, 0x24630064, 
-0x8f820054, 0x621023, 0x2c420065, 0x1440fffc, 
-0x24040001, 0x24050001, 0xc00494c, 0x27a60018, 
-0x8f830054, 0x8f820054, 0x8004562, 0x24630064, 
-0x8f820054, 0x621023, 0x2c420065, 0x1440fffc, 
-0x24040001, 0x24050001, 0xc00494c, 0x27a60018, 
-0x8f830054, 0x8f820054, 0x800456e, 0x24630064, 
-0x8f820054, 0x621023, 0x2c420065, 0x1440fffc, 
-0x24040001, 0x3c060001, 0x24c65da0, 0xc00494c, 
-0x24050002, 0x8f830054, 0x8f820054, 0x800457b, 
-0x24630064, 0x8f820054, 0x621023, 0x2c420065, 
-0x1440fffc, 0x24040001, 0x24050003, 0x3c100001, 
-0x26105da2, 0xc00494c, 0x2003021, 0x97a60018, 
-0x3c070001, 0x94e75da0, 0x3c040001, 0x24845ab0, 
-0xafa00014, 0x96020000, 0x3c05000d, 0x34a50100, 
-0xc002403, 0xafa20010, 0x97a20018, 0x1040004c, 
-0x24036040, 0x96020000, 0x3042fff0, 0x1443000a, 
-0x24020020, 0x3c030001, 0x94635da0, 0x54620009, 
-0x24027830, 0x24020003, 0x3c010001, 0xac225cc4, 
-0x80045ac, 0x24020005, 0x3c030001, 0x94635da0, 
-0x24027830, 0x1462000f, 0x24030010, 0x3c020001, 
-0x94425da2, 0x3042fff0, 0x1443000a, 0x24020003, 
-0x3c010001, 0xac225cc4, 0x24020006, 0x3c010001, 
-0xac225db0, 0x3c010001, 0xac225dbc, 0x80045e6, 
-0x3c09fff0, 0x3c020001, 0x8c425cc4, 0x3c030001, 
-0x94635da0, 0x34420001, 0x3c010001, 0xac225cc4, 
-0x24020015, 0x1462000f, 0x0, 0x3c020001, 
-0x94425da2, 0x3042fff0, 0x3843f420, 0x2c630001, 
-0x3842f430, 0x2c420001, 0x621825, 0x10600005, 
-0x24020003, 0x3c010001, 0xac225dbc, 0x80045e6, 
-0x3c09fff0, 0x3c030001, 0x94635da0, 0x24027810, 
-0x1462000b, 0x24020002, 0x3c020001, 0x94425da2, 
-0x3042fff0, 0x14400006, 0x24020002, 0x24020004, 
-0x3c010001, 0xac225dbc, 0x80045e6, 0x3c09fff0, 
-0x3c010001, 0xac225dbc, 0x80045e6, 0x3c09fff0, 
-0x3c020001, 0x8c425cc4, 0x24030001, 0x3c010001, 
-0xac235dbc, 0x34420004, 0x3c010001, 0xac225cc4, 
-0x3c09fff0, 0x3529bdc0, 0x3c060001, 0x8cc65cc4, 
-0x3c040001, 0x24845ab0, 0x24020001, 0x3c010001, 
-0xac225ccc, 0x8f820054, 0x3c070001, 0x8ce75dbc, 
-0x3c030001, 0x94635da0, 0x3c080001, 0x95085da2, 
-0x3c05000d, 0x34a50100, 0x3c010001, 0xac205cc8, 
-0x491021, 0x3c010001, 0xac225dac, 0xafa30010, 
-0xc002403, 0xafa80014, 0x8fbf0024, 0x8fb00020, 
-0x3e00008, 0x27bd0028, 0x27bdffe8, 0x3c050001, 
-0x8ca55cc8, 0x24060004, 0x24020001, 0x14a20014, 
-0xafbf0010, 0x3c020001, 0x8c427e3c, 0x30428000, 
-0x10400005, 0x3c04000f, 0x3c030001, 0x8c635dbc, 
-0x8004617, 0x34844240, 0x3c040004, 0x3c030001, 
-0x8c635dbc, 0x348493e0, 0x24020005, 0x14620016, 
-0x0, 0x3c04003d, 0x800462f, 0x34840900, 
-0x3c020001, 0x8c427e38, 0x30428000, 0x10400005, 
-0x3c04001e, 0x3c030001, 0x8c635dbc, 0x800462a, 
-0x34848480, 0x3c04000f, 0x3c030001, 0x8c635dbc, 
-0x34844240, 0x24020005, 0x14620003, 0x0, 
-0x3c04007a, 0x34841200, 0x3c020001, 0x8c425dac, 
-0x8f830054, 0x441021, 0x431023, 0x44102b, 
-0x14400037, 0x0, 0x3c020001, 0x8c425cd0, 
-0x14400033, 0x0, 0x3c010001, 0x10c00025, 
-0xac205ce0, 0x3c090001, 0x8d295cc4, 0x24070001, 
-0x3c044000, 0x3c080001, 0x25087e3c, 0x250afffc, 
-0x52842, 0x14a00002, 0x24c6ffff, 0x24050008, 
-0xa91024, 0x10400010, 0x0, 0x14a70008, 
-0x0, 0x8d020000, 0x441024, 0x1040000a, 
-0x0, 0x3c010001, 0x800465b, 0xac255ce0, 
-0x8d420000, 0x441024, 0x10400003, 0x0, 
-0x3c010001, 0xac275ce0, 0x3c020001, 0x8c425ce0, 
-0x6182b, 0x2c420001, 0x431024, 0x5440ffe5, 
-0x52842, 0x8f820054, 0x3c030001, 0x8c635ce0, 
-0x3c010001, 0xac225dac, 0x1060002a, 0x24020001, 
-0x3c010001, 0xac255cc8, 0x3c010001, 0xac225ccc, 
-0x3c020001, 0x8c425ce0, 0x10400022, 0x0, 
-0x3c020001, 0x8c425ccc, 0x1040000a, 0x24020001, 
-0x3c010001, 0xac205ccc, 0x3c010001, 0x370821, 
-0xac2283ac, 0x3c010001, 0xac205d4c, 0x3c010001, 
-0xac225d04, 0x3c030001, 0x771821, 0x8c6383ac, 
-0x24020008, 0x10620005, 0x24020001, 0xc004695, 
-0x0, 0x8004692, 0x0, 0x3c030001, 
-0x8c635cc8, 0x10620007, 0x2402000e, 0x3c030001, 
-0x8c637dd0, 0x10620003, 0x0, 0xc004e54, 
-0x8f840220, 0x8fbf0010, 0x3e00008, 0x27bd0018, 
-0x27bdffe0, 0x3c02fdff, 0xafbf0018, 0x8ee30000, 
-0x3c050001, 0x8ca55cc8, 0x3c040001, 0x8c845cf0, 
-0x3442ffff, 0x621824, 0x14a40008, 0xaee30000, 
-0x3c030001, 0x771821, 0x8c6383ac, 0x3c020001, 
-0x8c425cf4, 0x10620008, 0x0, 0x3c020001, 
-0x571021, 0x8c4283ac, 0x3c010001, 0xac255cf0, 
-0x3c010001, 0xac225cf4, 0x3c030001, 0x8c635cc8, 
-0x24020002, 0x10620169, 0x2c620003, 0x10400005, 
-0x24020001, 0x10620008, 0x0, 0x800481c, 
-0x0, 0x24020004, 0x106200b1, 0x24020001, 
-0x800481d, 0x0, 0x3c020001, 0x571021, 
-0x8c4283ac, 0x2443ffff, 0x2c620008, 0x1040015a, 
-0x31080, 0x3c010001, 0x220821, 0x8c225ac8, 
-0x400008, 0x0, 0x3c030001, 0x8c635dbc, 
-0x24020005, 0x14620014, 0x0, 0x3c020001, 
-0x8c425cd4, 0x1040000a, 0x24020003, 0xc004822, 
-0x0, 0x24020002, 0x3c010001, 0x370821, 
-0xac2283ac, 0x3c010001, 0x80046e0, 0xac205cd4, 
-0x3c010001, 0x370821, 0xac2283ac, 0x3c010001, 
-0x800481f, 0xac205c60, 0xc004822, 0x0, 
-0x3c020001, 0x8c425cd4, 0x3c010001, 0xac205c60, 
-0x104000dd, 0x24020002, 0x3c010001, 0x370821, 
-0xac2283ac, 0x3c010001, 0x800481f, 0xac205cd4, 
-0x3c030001, 0x8c635dbc, 0x24020005, 0x14620003, 
-0x24020001, 0x3c010001, 0xac225d00, 0xc0049cf, 
-0x0, 0x3c030001, 0x8c635d00, 0x800478e, 
-0x24020011, 0x3c050001, 0x8ca55cc8, 0x3c060001, 
-0x8cc67e3c, 0xc005108, 0x2021, 0x24020005, 
-0x3c010001, 0xac205cd4, 0x3c010001, 0x370821, 
-0x800481f, 0xac2283ac, 0x3c040001, 0x24845abc, 
-0x3c05000f, 0x34a50100, 0x3021, 0x3821, 
-0xafa00010, 0xc002403, 0xafa00014, 0x800481f, 
-0x0, 0x8f820220, 0x3c03f700, 0x431025, 
-0x80047b7, 0xaf820220, 0x8f820220, 0x3c030004, 
-0x431024, 0x144000a9, 0x24020007, 0x8f830054, 
-0x3c020001, 0x8c425da4, 0x2463d8f0, 0x431023, 
-0x2c422710, 0x144000f8, 0x24020001, 0x800481d, 
-0x0, 0x3c050001, 0x8ca55cc8, 0xc0052a2, 
-0x2021, 0xc005386, 0x2021, 0x3c030001, 
-0x8c637e34, 0x46100ea, 0x24020001, 0x3c020008, 
-0x621024, 0x10400006, 0x0, 0x8f820214, 
-0x3c03ffff, 0x431024, 0x8004741, 0x3442251f, 
-0x8f820214, 0x3c03ffff, 0x431024, 0x3442241f, 
-0xaf820214, 0x8ee20000, 0x3c030200, 0x431025, 
-0xaee20000, 0x8f820220, 0x2403fffb, 0x431024, 
-0xaf820220, 0x8f820220, 0x34420002, 0xaf820220, 
-0x24020008, 0x3c010001, 0x370821, 0xac2283ac, 
-0x8f820220, 0x3c030004, 0x431024, 0x14400005, 
-0x0, 0x8f820220, 0x3c03f700, 0x431025, 
-0xaf820220, 0x3c030001, 0x8c635dbc, 0x24020005, 
-0x1462000a, 0x0, 0x3c020001, 0x94425da2, 
-0x24429fbc, 0x2c420004, 0x10400004, 0x24040018, 
-0x24050002, 0xc004d93, 0x24060020, 0xc0043dd, 
-0x0, 0x3c010001, 0x800481f, 0xac205d50, 
-0x3c020001, 0x571021, 0x8c4283ac, 0x2443ffff, 
-0x2c620008, 0x104000ac, 0x31080, 0x3c010001, 
-0x220821, 0x8c225ae8, 0x400008, 0x0, 
-0xc00429b, 0x0, 0x3c010001, 0xac205ccc, 
-0xaf800204, 0x3c010001, 0xc004822, 0xac207e20, 
-0x24020001, 0x3c010001, 0xac225ce4, 0x24020002, 
-0x3c010001, 0x370821, 0x800481f, 0xac2283ac, 
-0xc00489f, 0x0, 0x3c030001, 0x8c635ce4, 
-0x24020009, 0x14620090, 0x24020003, 0x3c010001, 
-0x370821, 0x800481f, 0xac2283ac, 0x3c020001, 
-0x8c427e38, 0x30424000, 0x10400005, 0x0, 
-0x8f820044, 0x3c03ffff, 0x800479f, 0x34637fff, 
-0x8f820044, 0x2403ff7f, 0x431024, 0xaf820044, 
-0x8f830054, 0x80047b9, 0x24020004, 0x8f830054, 
-0x3c020001, 0x8c425da4, 0x2463d8f0, 0x431023, 
-0x2c422710, 0x14400074, 0x24020005, 0x3c010001, 
-0x370821, 0x800481f, 0xac2283ac, 0x8f820220, 
-0x3c03f700, 0x431025, 0xaf820220, 0xaf800204, 
-0x3c010001, 0xac207e20, 0x8f830054, 0x24020006, 
-0x3c010001, 0x370821, 0xac2283ac, 0x3c010001, 
-0x800481f, 0xac235da4, 0x8f830054, 0x3c020001, 
-0x8c425da4, 0x2463fff6, 0x431023, 0x2c42000a, 
-0x14400059, 0x0, 0x24020007, 0x3c010001, 
-0x370821, 0x800481f, 0xac2283ac, 0x8f820220, 
-0x3c04f700, 0x441025, 0xaf820220, 0x8f820220, 
-0x3c030300, 0x431024, 0x14400005, 0x1821, 
-0x8f820220, 0x24030001, 0x441025, 0xaf820220, 
-0x10600043, 0x24020001, 0x8f820214, 0x3c03ffff, 
-0x3c040001, 0x8c845d98, 0x431024, 0x3442251f, 
-0xaf820214, 0x24020008, 0x3c010001, 0x370821, 
-0x1080000b, 0xac2283ac, 0x3c020001, 0x8c425d74, 
-0x14400007, 0x24020001, 0x3c010001, 0xac227dd0, 
-0xc004e54, 0x8f840220, 0x800480c, 0x0, 
-0x8f820220, 0x3c030008, 0x431024, 0x14400017, 
-0x2402000e, 0x3c010001, 0xac227dd0, 0x8ee20000, 
-0x2021, 0x3c030200, 0x431025, 0xc005386, 
-0xaee20000, 0x8f820220, 0x2403fffb, 0x431024, 
-0xaf820220, 0x8f820220, 0x34420002, 0xc0043dd, 
-0xaf820220, 0x3c050001, 0x8ca55cc8, 0xc0052a2, 
-0x2021, 0x800481f, 0x0, 0x3c020001, 
-0x8c425d74, 0x10400010, 0x0, 0x3c020001, 
-0x8c425d70, 0x2442ffff, 0x3c010001, 0xac225d70, 
-0x14400009, 0x24020002, 0x3c010001, 0xac205d74, 
-0x3c010001, 0x800481f, 0xac225d70, 0x24020001, 
-0x3c010001, 0xac225ccc, 0x8fbf0018, 0x3e00008, 
-0x27bd0020, 0x8f820200, 0x8f820220, 0x8f820220, 
-0x34420004, 0xaf820220, 0x8f820200, 0x3c060001, 
-0x8cc65cc8, 0x34420004, 0xaf820200, 0x24020002, 
-0x10c2003a, 0x2cc20003, 0x10400005, 0x24020001, 
-0x10c20008, 0x0, 0x8004868, 0x0, 
-0x24020004, 0x10c20013, 0x24020001, 0x8004868, 
-0x0, 0x3c030001, 0x8c635cb8, 0x3c020001, 
-0x8c425cc0, 0x3c040001, 0x8c845cdc, 0x3c050001, 
-0x8ca55cbc, 0xaf860200, 0xaf860220, 0x34630022, 
-0x441025, 0x451025, 0x34420002, 0x8004867, 
-0xaf830200, 0x3c030001, 0x8c635d98, 0xaf820200, 
-0x10600009, 0xaf820220, 0x3c020001, 0x8c425d74, 
-0x14400005, 0x3c033f00, 0x3c020001, 0x8c425cb0, 
-0x800485b, 0x346300e0, 0x3c020001, 0x8c425cb0, 
-0x3c033f00, 0x346300e2, 0x431025, 0xaf820200, 
-0x3c030001, 0x8c635cb4, 0x3c04f700, 0x3c020001, 
-0x8c425cc0, 0x3c050001, 0x8ca55cdc, 0x641825, 
-0x431025, 0x451025, 0xaf820220, 0x3e00008, 
-0x0, 0x8f820220, 0x3c030001, 0x8c635cc8, 
-0x34420004, 0xaf820220, 0x24020001, 0x1062000f, 
-0x0, 0x8f830054, 0x8f820054, 0x24630002, 
-0x621023, 0x2c420003, 0x10400011, 0x0, 
-0x8f820054, 0x621023, 0x2c420003, 0x1040000c, 
-0x0, 0x8004879, 0x0, 0x8f830054, 
-0x8f820054, 0x8004885, 0x24630007, 0x8f820054, 
-0x621023, 0x2c420008, 0x1440fffc, 0x0, 
-0x8f8400e0, 0x30820007, 0x1040000d, 0x0, 
-0x8f820054, 0x8f8300e0, 0x14830009, 0x24450032, 
-0x8f820054, 0xa21023, 0x2c420033, 0x10400004, 
-0x0, 0x8f8200e0, 0x1082fff9, 0x0, 
-0x8f820220, 0x2403fffd, 0x431024, 0xaf820220, 
-0x3e00008, 0x0, 0x3c030001, 0x8c635ce4, 
-0x3c020001, 0x8c425ce8, 0x50620004, 0x2463ffff, 
-0x3c010001, 0xac235ce8, 0x2463ffff, 0x2c620009, 
-0x1040009d, 0x31080, 0x3c010001, 0x220821, 
-0x8c225b08, 0x400008, 0x0, 0x8f820044, 
-0x34428080, 0xaf820044, 0x8f830054, 0x8004938, 
-0x24020002, 0x8f830054, 0x3c020001, 0x8c425da8, 
-0x2463d8f0, 0x431023, 0x2c422710, 0x1440008a, 
-0x24020003, 0x8004945, 0x0, 0x8f820044, 
-0x3c03ffff, 0x34637fff, 0x431024, 0xaf820044, 
-0x8f830054, 0x8004938, 0x24020004, 0x8f830054, 
-0x3c020001, 0x8c425da8, 0x2463fff6, 0x431023, 
-0x2c42000a, 0x14400078, 0x24020005, 0x8004945, 
-0x0, 0x8f820220, 0x3c03f700, 0x431025, 
-0xaf820220, 0x8f820220, 0x2403fffb, 0x431024, 
-0xaf820220, 0x8f820220, 0x34420002, 0xaf820220, 
-0x3c023f00, 0x344200e0, 0xaf820200, 0x8f820200, 
-0x2403fffd, 0x431024, 0xaf820200, 0x24040001, 
-0x3405ffff, 0xaf840204, 0x8f830054, 0x8f820054, 
-0x80048ec, 0x24630001, 0x8f820054, 0x621023, 
-0x2c420002, 0x1440fffc, 0x0, 0x8f820224, 
-0x42040, 0xa4102b, 0x1040fff2, 0x0, 
-0x8f820220, 0x3c03f700, 0x431025, 0xaf820220, 
-0x8f820214, 0x3c03ffff, 0x431024, 0x3442251f, 
-0xaf820214, 0x8f820220, 0x2403fffb, 0x431024, 
-0xaf820220, 0x8f820220, 0x3c04f700, 0x34840008, 
-0x34420002, 0xaf820220, 0x8f820220, 0x3c033f00, 
-0x346300e2, 0x441025, 0xaf820220, 0xaf830200, 
-0x8f8400f0, 0x276217f8, 0x14820002, 0x24850008, 
-0x27651000, 0x8f8200f4, 0x10a20007, 0x3c038000, 
-0x34630040, 0x3c020001, 0x24425c70, 0xac820000, 
-0xac830004, 0xaf8500f0, 0x8f830054, 0x8004938, 
-0x24020006, 0x8f830054, 0x3c020001, 0x8c425da8, 
-0x2463fff6, 0x431023, 0x2c42000a, 0x14400022, 
-0x24020007, 0x8004945, 0x0, 0x8f8200e0, 
-0xaf8200e4, 0x8f8200e0, 0xaf8200e8, 0x8f820220, 
-0x34420004, 0xaf820220, 0x8f820220, 0x2403fff7, 
-0x431024, 0xaf820220, 0x8f820044, 0x34428080, 
-0xaf820044, 0x8f830054, 0x24020008, 0x3c010001, 
-0xac225ce4, 0x3c010001, 0x8004947, 0xac235da8, 
-0x8f830054, 0x3c020001, 0x8c425da8, 0x2463d8f0, 
-0x431023, 0x2c422710, 0x14400003, 0x24020009, 
-0x3c010001, 0xac225ce4, 0x3e00008, 0x0, 
-0x0, 0x0, 0x0, 0x27bdffd8, 
-0xafb20018, 0x809021, 0xafb3001c, 0xa09821, 
-0xafb10014, 0xc08821, 0xafb00010, 0x8021, 
-0xafbf0020, 0xa6200000, 0xc004d4b, 0x24040001, 
-0x26100001, 0x2e020020, 0x1440fffb, 0x0, 
-0xc004d4b, 0x2021, 0xc004d4b, 0x24040001, 
-0xc004d4b, 0x24040001, 0xc004d4b, 0x2021, 
-0x24100010, 0x2501024, 0x10400002, 0x2021, 
-0x24040001, 0xc004d4b, 0x108042, 0x1600fffa, 
-0x2501024, 0x24100010, 0x2701024, 0x10400002, 
-0x2021, 0x24040001, 0xc004d4b, 0x108042, 
-0x1600fffa, 0x2701024, 0xc004d71, 0x34108000, 
-0xc004d71, 0x0, 0xc004d2b, 0x0, 
-0x50400005, 0x108042, 0x96220000, 0x501025, 
-0xa6220000, 0x108042, 0x1600fff7, 0x0, 
-0xc004d71, 0x0, 0x8fbf0020, 0x8fb3001c, 
-0x8fb20018, 0x8fb10014, 0x8fb00010, 0x3e00008, 
-0x27bd0028, 0x27bdffd8, 0xafb10014, 0x808821, 
-0xafb20018, 0xa09021, 0xafb3001c, 0xc09821, 
-0xafb00010, 0x8021, 0xafbf0020, 0xc004d4b, 
-0x24040001, 0x26100001, 0x2e020020, 0x1440fffb, 
-0x0, 0xc004d4b, 0x2021, 0xc004d4b, 
-0x24040001, 0xc004d4b, 0x2021, 0xc004d4b, 
-0x24040001, 0x24100010, 0x2301024, 0x10400002, 
-0x2021, 0x24040001, 0xc004d4b, 0x108042, 
-0x1600fffa, 0x2301024, 0x24100010, 0x2501024, 
-0x10400002, 0x2021, 0x24040001, 0xc004d4b, 
-0x108042, 0x1600fffa, 0x2501024, 0xc004d4b, 
-0x24040001, 0xc004d4b, 0x2021, 0x34108000, 
-0x96620000, 0x501024, 0x10400002, 0x2021, 
-0x24040001, 0xc004d4b, 0x108042, 0x1600fff8, 
-0x0, 0xc004d71, 0x0, 0x8fbf0020, 
-0x8fb3001c, 0x8fb20018, 0x8fb10014, 0x8fb00010, 
-0x3e00008, 0x27bd0028, 0x3c030001, 0x8c635d00, 
-0x3c020001, 0x8c425d48, 0x27bdffd8, 0xafbf0020, 
-0xafb1001c, 0x10620003, 0xafb00018, 0x3c010001, 
-0xac235d48, 0x2463ffff, 0x2c620013, 0x10400349, 
-0x31080, 0x3c010001, 0x220821, 0x8c225b30, 
-0x400008, 0x0, 0xc004d71, 0x8021, 
-0x34028000, 0xa7a20010, 0x27b10010, 0xc004d4b, 
-0x24040001, 0x26100001, 0x2e020020, 0x1440fffb, 
-0x0, 0xc004d4b, 0x2021, 0xc004d4b, 
-0x24040001, 0xc004d4b, 0x2021, 0xc004d4b, 
-0x24040001, 0x24100010, 0x32020001, 0x10400002, 
-0x2021, 0x24040001, 0xc004d4b, 0x108042, 
-0x1600fffa, 0x32020001, 0x24100010, 0xc004d4b, 
-0x2021, 0x108042, 0x1600fffc, 0x0, 
-0xc004d4b, 0x24040001, 0xc004d4b, 0x2021, 
-0x34108000, 0x96220000, 0x501024, 0x10400002, 
-0x2021, 0x24040001, 0xc004d4b, 0x108042, 
-0x1600fff8, 0x0, 0xc004d71, 0x0, 
-0x8004d24, 0x24020002, 0x27b10010, 0xa7a00010, 
-0x8021, 0xc004d4b, 0x24040001, 0x26100001, 
-0x2e020020, 0x1440fffb, 0x0, 0xc004d4b, 
-0x2021, 0xc004d4b, 0x24040001, 0xc004d4b, 
-0x24040001, 0xc004d4b, 0x2021, 0x24100010, 
-0x32020001, 0x10400002, 0x2021, 0x24040001, 
-0xc004d4b, 0x108042, 0x1600fffa, 0x32020001, 
-0x24100010, 0xc004d4b, 0x2021, 0x108042, 
-0x1600fffc, 0x0, 0xc004d71, 0x34108000, 
-0xc004d71, 0x0, 0xc004d2b, 0x0, 
-0x50400005, 0x108042, 0x96220000, 0x501025, 
-0xa6220000, 0x108042, 0x1600fff7, 0x0, 
-0xc004d71, 0x0, 0x97a20010, 0x30428000, 
-0x144002dc, 0x24020003, 0x8004d24, 0x0, 
-0x24021200, 0xa7a20010, 0x27b10010, 0x8021, 
-0xc004d4b, 0x24040001, 0x26100001, 0x2e020020, 
-0x1440fffb, 0x0, 0xc004d4b, 0x2021, 
-0xc004d4b, 0x24040001, 0xc004d4b, 0x2021, 
-0xc004d4b, 0x24040001, 0x24100010, 0x32020001, 
-0x10400002, 0x2021, 0x24040001, 0xc004d4b, 
-0x108042, 0x1600fffa, 0x32020001, 0x24100010, 
-0xc004d4b, 0x2021, 0x108042, 0x1600fffc, 
-0x0, 0xc004d4b, 0x24040001, 0xc004d4b, 
-0x2021, 0x34108000, 0x96220000, 0x501024, 
-0x10400002, 0x2021, 0x24040001, 0xc004d4b, 
-0x108042, 0x1600fff8, 0x0, 0xc004d71, 
-0x0, 0x8f830054, 0x8004d16, 0x24020004, 
-0x8f830054, 0x3c020001, 0x8c425db8, 0x2463ff9c, 
-0x431023, 0x2c420064, 0x1440029e, 0x24020002, 
-0x3c030001, 0x8c635dbc, 0x10620297, 0x2c620003, 
-0x14400296, 0x24020011, 0x24020003, 0x10620005, 
-0x24020004, 0x10620291, 0x2402000f, 0x8004d24, 
-0x24020011, 0x8004d24, 0x24020005, 0x24020014, 
-0xa7a20010, 0x27b10010, 0x8021, 0xc004d4b, 
-0x24040001, 0x26100001, 0x2e020020, 0x1440fffb, 
-0x0, 0xc004d4b, 0x2021, 0xc004d4b, 
-0x24040001, 0xc004d4b, 0x2021, 0xc004d4b, 
-0x24040001, 0x24100010, 0x32020001, 0x10400002, 
-0x2021, 0x24040001, 0xc004d4b, 0x108042, 
-0x1600fffa, 0x32020001, 0x24100010, 0x32020012, 
-0x10400002, 0x2021, 0x24040001, 0xc004d4b, 
-0x108042, 0x1600fffa, 0x32020012, 0xc004d4b, 
-0x24040001, 0xc004d4b, 0x2021, 0x34108000, 
-0x96220000, 0x501024, 0x10400002, 0x2021, 
-0x24040001, 0xc004d4b, 0x108042, 0x1600fff8, 
-0x0, 0xc004d71, 0x0, 0x8f830054, 
-0x8004d16, 0x24020006, 0x8f830054, 0x3c020001, 
-0x8c425db8, 0x2463ff9c, 0x431023, 0x2c420064, 
-0x14400250, 0x24020007, 0x8004d24, 0x0, 
-0x24020006, 0xa7a20010, 0x27b10010, 0x8021, 
-0xc004d4b, 0x24040001, 0x26100001, 0x2e020020, 
-0x1440fffb, 0x0, 0xc004d4b, 0x2021, 
-0xc004d4b, 0x24040001, 0xc004d4b, 0x2021, 
-0xc004d4b, 0x24040001, 0x24100010, 0x32020001, 
-0x10400002, 0x2021, 0x24040001, 0xc004d4b, 
-0x108042, 0x1600fffa, 0x32020001, 0x24100010, 
-0x32020013, 0x10400002, 0x2021, 0x24040001, 
-0xc004d4b, 0x108042, 0x1600fffa, 0x32020013, 
-0xc004d4b, 0x24040001, 0xc004d4b, 0x2021, 
-0x34108000, 0x96220000, 0x501024, 0x10400002, 
-0x2021, 0x24040001, 0xc004d4b, 0x108042, 
-0x1600fff8, 0x0, 0xc004d71, 0x0, 
-0x8f830054, 0x8004d16, 0x24020008, 0x8f830054, 
-0x3c020001, 0x8c425db8, 0x2463ff9c, 0x431023, 
-0x2c420064, 0x1440020f, 0x24020009, 0x8004d24, 
-0x0, 0x27b10010, 0xa7a00010, 0x8021, 
-0xc004d4b, 0x24040001, 0x26100001, 0x2e020020, 
-0x1440fffb, 0x0, 0xc004d4b, 0x2021, 
-0xc004d4b, 0x24040001, 0xc004d4b, 0x24040001, 
-0xc004d4b, 0x2021, 0x24100010, 0x32020001, 
-0x10400002, 0x2021, 0x24040001, 0xc004d4b, 
-0x108042, 0x1600fffa, 0x32020001, 0x24100010, 
-0x32020018, 0x10400002, 0x2021, 0x24040001, 
-0xc004d4b, 0x108042, 0x1600fffa, 0x32020018, 
-0xc004d71, 0x34108000, 0xc004d71, 0x0, 
-0xc004d2b, 0x0, 0x50400005, 0x108042, 
-0x96220000, 0x501025, 0xa6220000, 0x108042, 
-0x1600fff7, 0x0, 0xc004d71, 0x8021, 
-0x97a20010, 0x27b10010, 0x34420001, 0xa7a20010, 
-0xc004d4b, 0x24040001, 0x26100001, 0x2e020020, 
-0x1440fffb, 0x0, 0xc004d4b, 0x2021, 
-0xc004d4b, 0x24040001, 0xc004d4b, 0x2021, 
-0xc004d4b, 0x24040001, 0x24100010, 0x32020001, 
-0x10400002, 0x2021, 0x24040001, 0xc004d4b, 
-0x108042, 0x1600fffa, 0x32020001, 0x24100010, 
-0x32020018, 0x10400002, 0x2021, 0x24040001, 
-0xc004d4b, 0x108042, 0x1600fffa, 0x32020018, 
-0xc004d4b, 0x24040001, 0xc004d4b, 0x2021, 
-0x34108000, 0x96220000, 0x501024, 0x10400002, 
-0x2021, 0x24040001, 0xc004d4b, 0x108042, 
-0x1600fff8, 0x0, 0xc004d71, 0x0, 
-0x8f830054, 0x8004d16, 0x2402000a, 0x8f830054, 
-0x3c020001, 0x8c425db8, 0x2463ff9c, 0x431023, 
-0x2c420064, 0x1440019b, 0x2402000b, 0x8004d24, 
-0x0, 0x27b10010, 0xa7a00010, 0x8021, 
-0xc004d4b, 0x24040001, 0x26100001, 0x2e020020, 
-0x1440fffb, 0x0, 0xc004d4b, 0x2021, 
-0xc004d4b, 0x24040001, 0xc004d4b, 0x24040001, 
-0xc004d4b, 0x2021, 0x24100010, 0x32020001, 
-0x10400002, 0x2021, 0x24040001, 0xc004d4b, 
-0x108042, 0x1600fffa, 0x32020001, 0x24100010, 
-0x32020017, 0x10400002, 0x2021, 0x24040001, 
-0xc004d4b, 0x108042, 0x1600fffa, 0x32020017, 
-0xc004d71, 0x34108000, 0xc004d71, 0x0, 
-0xc004d2b, 0x0, 0x50400005, 0x108042, 
-0x96220000, 0x501025, 0xa6220000, 0x108042, 
-0x1600fff7, 0x0, 0xc004d71, 0x8021, 
-0x97a20010, 0x27b10010, 0x34420700, 0xa7a20010, 
-0xc004d4b, 0x24040001, 0x26100001, 0x2e020020, 
-0x1440fffb, 0x0, 0xc004d4b, 0x2021, 
-0xc004d4b, 0x24040001, 0xc004d4b, 0x2021, 
-0xc004d4b, 0x24040001, 0x24100010, 0x32020001, 
-0x10400002, 0x2021, 0x24040001, 0xc004d4b, 
-0x108042, 0x1600fffa, 0x32020001, 0x24100010, 
-0x32020017, 0x10400002, 0x2021, 0x24040001, 
-0xc004d4b, 0x108042, 0x1600fffa, 0x32020017, 
-0xc004d4b, 0x24040001, 0xc004d4b, 0x2021, 
-0x34108000, 0x96220000, 0x501024, 0x10400002, 
-0x2021, 0x24040001, 0xc004d4b, 0x108042, 
-0x1600fff8, 0x0, 0xc004d71, 0x0, 
-0x8f830054, 0x8004d16, 0x2402000c, 0x8f830054, 
-0x3c020001, 0x8c425db8, 0x2463ff9c, 0x431023, 
-0x2c420064, 0x14400127, 0x24020012, 0x8004d24, 
-0x0, 0x27b10010, 0xa7a00010, 0x8021, 
-0xc004d4b, 0x24040001, 0x26100001, 0x2e020020, 
-0x1440fffb, 0x0, 0xc004d4b, 0x2021, 
-0xc004d4b, 0x24040001, 0xc004d4b, 0x24040001, 
-0xc004d4b, 0x2021, 0x24100010, 0x32020001, 
-0x10400002, 0x2021, 0x24040001, 0xc004d4b, 
-0x108042, 0x1600fffa, 0x32020001, 0x24100010, 
-0x32020014, 0x10400002, 0x2021, 0x24040001, 
-0xc004d4b, 0x108042, 0x1600fffa, 0x32020014, 
-0xc004d71, 0x34108000, 0xc004d71, 0x0, 
-0xc004d2b, 0x0, 0x50400005, 0x108042, 
-0x96220000, 0x501025, 0xa6220000, 0x108042, 
-0x1600fff7, 0x0, 0xc004d71, 0x8021, 
-0x97a20010, 0x27b10010, 0x34420010, 0xa7a20010, 
-0xc004d4b, 0x24040001, 0x26100001, 0x2e020020, 
-0x1440fffb, 0x0, 0xc004d4b, 0x2021, 
-0xc004d4b, 0x24040001, 0xc004d4b, 0x2021, 
-0xc004d4b, 0x24040001, 0x24100010, 0x32020001, 
-0x10400002, 0x2021, 0x24040001, 0xc004d4b, 
-0x108042, 0x1600fffa, 0x32020001, 0x24100010, 
-0x32020014, 0x10400002, 0x2021, 0x24040001, 
-0xc004d4b, 0x108042, 0x1600fffa, 0x32020014, 
-0xc004d4b, 0x24040001, 0xc004d4b, 0x2021, 
-0x34108000, 0x96220000, 0x501024, 0x10400002, 
-0x2021, 0x24040001, 0xc004d4b, 0x108042, 
-0x1600fff8, 0x0, 0xc004d71, 0x0, 
-0x8f830054, 0x8004d16, 0x24020013, 0x8f830054, 
-0x3c020001, 0x8c425db8, 0x2463ff9c, 0x431023, 
-0x2c420064, 0x144000b3, 0x2402000d, 0x8004d24, 
-0x0, 0x27b10010, 0xa7a00010, 0x8021, 
-0xc004d4b, 0x24040001, 0x26100001, 0x2e020020, 
-0x1440fffb, 0x0, 0xc004d4b, 0x2021, 
-0xc004d4b, 0x24040001, 0xc004d4b, 0x24040001, 
-0xc004d4b, 0x2021, 0x24100010, 0x32020001, 
-0x10400002, 0x2021, 0x24040001, 0xc004d4b, 
-0x108042, 0x1600fffa, 0x32020001, 0x24100010, 
-0x32020018, 0x10400002, 0x2021, 0x24040001, 
-0xc004d4b, 0x108042, 0x1600fffa, 0x32020018, 
-0xc004d71, 0x34108000, 0xc004d71, 0x0, 
-0xc004d2b, 0x0, 0x50400005, 0x108042, 
-0x96220000, 0x501025, 0xa6220000, 0x108042, 
-0x1600fff7, 0x0, 0xc004d71, 0x8021, 
-0x97a20010, 0x27b10010, 0x3042fffe, 0xa7a20010, 
-0xc004d4b, 0x24040001, 0x26100001, 0x2e020020, 
-0x1440fffb, 0x0, 0xc004d4b, 0x2021, 
-0xc004d4b, 0x24040001, 0xc004d4b, 0x2021, 
-0xc004d4b, 0x24040001, 0x24100010, 0x32020001, 
-0x10400002, 0x2021, 0x24040001, 0xc004d4b, 
-0x108042, 0x1600fffa, 0x32020001, 0x24100010, 
-0x32020018, 0x10400002, 0x2021, 0x24040001, 
-0xc004d4b, 0x108042, 0x1600fffa, 0x32020018, 
-0xc004d4b, 0x24040001, 0xc004d4b, 0x2021, 
-0x34108000, 0x96220000, 0x501024, 0x10400002, 
-0x2021, 0x24040001, 0xc004d4b, 0x108042, 
-0x1600fff8, 0x0, 0xc004d71, 0x0, 
-0x8f830054, 0x8004d16, 0x2402000e, 0x24020840, 
-0xa7a20010, 0x27b10010, 0x8021, 0xc004d4b, 
-0x24040001, 0x26100001, 0x2e020020, 0x1440fffb, 
-0x0, 0xc004d4b, 0x2021, 0xc004d4b, 
-0x24040001, 0xc004d4b, 0x2021, 0xc004d4b, 
-0x24040001, 0x24100010, 0x32020001, 0x10400002, 
-0x2021, 0x24040001, 0xc004d4b, 0x108042, 
-0x1600fffa, 0x32020001, 0x24100010, 0x32020013, 
-0x10400002, 0x2021, 0x24040001, 0xc004d4b, 
-0x108042, 0x1600fffa, 0x32020013, 0xc004d4b, 
-0x24040001, 0xc004d4b, 0x2021, 0x34108000, 
-0x96220000, 0x501024, 0x10400002, 0x2021, 
-0x24040001, 0xc004d4b, 0x108042, 0x1600fff8, 
-0x0, 0xc004d71, 0x0, 0x8f830054, 
-0x24020010, 0x3c010001, 0xac225d00, 0x3c010001, 
-0x8004d26, 0xac235db8, 0x8f830054, 0x3c020001, 
-0x8c425db8, 0x2463ff9c, 0x431023, 0x2c420064, 
-0x14400004, 0x0, 0x24020011, 0x3c010001, 
-0xac225d00, 0x8fbf0020, 0x8fb1001c, 0x8fb00018, 
-0x3e00008, 0x27bd0028, 0x8f850044, 0x8f820044, 
-0x3c030001, 0x431025, 0x3c030008, 0xaf820044, 
-0x8f840054, 0x8f820054, 0xa32824, 0x8004d37, 
-0x24840001, 0x8f820054, 0x821023, 0x2c420002, 
-0x1440fffc, 0x0, 0x8f820044, 0x3c03fffe, 
-0x3463ffff, 0x431024, 0xaf820044, 0x8f830054, 
-0x8f820054, 0x8004d45, 0x24630001, 0x8f820054, 
-0x621023, 0x2c420002, 0x1440fffc, 0x0, 
-0x3e00008, 0xa01021, 0x8f830044, 0x3c02fff0, 
-0x3442ffff, 0x42480, 0x621824, 0x3c020002, 
-0x822025, 0x641825, 0xaf830044, 0x8f820044, 
-0x3c03fffe, 0x3463ffff, 0x431024, 0xaf820044, 
-0x8f830054, 0x8f820054, 0x8004d5e, 0x24630001, 
-0x8f820054, 0x621023, 0x2c420002, 0x1440fffc, 
-0x0, 0x8f820044, 0x3c030001, 0x431025, 
-0xaf820044, 0x8f830054, 0x8f820054, 0x8004d6b, 
-0x24630001, 0x8f820054, 0x621023, 0x2c420002, 
-0x1440fffc, 0x0, 0x3e00008, 0x0, 
-0x8f820044, 0x3c03fff0, 0x3463ffff, 0x431024, 
-0xaf820044, 0x8f820044, 0x3c030001, 0x431025, 
-0xaf820044, 0x8f830054, 0x8f820054, 0x8004d7f, 
-0x24630001, 0x8f820054, 0x621023, 0x2c420002, 
-0x1440fffc, 0x0, 0x8f820044, 0x3c03fffe, 
-0x3463ffff, 0x431024, 0xaf820044, 0x8f830054, 
-0x8f820054, 0x8004d8d, 0x24630001, 0x8f820054, 
-0x621023, 0x2c420002, 0x1440fffc, 0x0, 
-0x3e00008, 0x0, 0x27bdffc8, 0xafb30024, 
-0x809821, 0xafb5002c, 0xa0a821, 0xafb20020, 
-0xc09021, 0x32a2ffff, 0xafbf0030, 0xafb40028, 
-0xafb1001c, 0xafb00018, 0x14400034, 0xa7b20010, 
-0x3271ffff, 0x27b20010, 0x8021, 0xc004d4b, 
-0x24040001, 0x26100001, 0x2e020020, 0x1440fffb, 
-0x0, 0xc004d4b, 0x2021, 0xc004d4b, 
-0x24040001, 0xc004d4b, 0x2021, 0xc004d4b, 
-0x24040001, 0x24100010, 0x32020001, 0x10400002, 
-0x2021, 0x24040001, 0xc004d4b, 0x108042, 
-0x1600fffa, 0x32020001, 0x24100010, 0x2301024, 
-0x10400002, 0x2021, 0x24040001, 0xc004d4b, 
-0x108042, 0x1600fffa, 0x2301024, 0xc004d4b, 
-0x24040001, 0xc004d4b, 0x2021, 0x34108000, 
-0x96420000, 0x501024, 0x10400002, 0x2021, 
-0x24040001, 0xc004d4b, 0x108042, 0x12000075, 
-0x0, 0x8004dc9, 0x0, 0x3274ffff, 
-0x27b10010, 0xa7a00010, 0x8021, 0xc004d4b, 
-0x24040001, 0x26100001, 0x2e020020, 0x1440fffb, 
-0x0, 0xc004d4b, 0x2021, 0xc004d4b, 
-0x24040001, 0xc004d4b, 0x24040001, 0xc004d4b, 
-0x2021, 0x24100010, 0x32020001, 0x10400002, 
-0x2021, 0x24040001, 0xc004d4b, 0x108042, 
-0x1600fffa, 0x32020001, 0x24100010, 0x2901024, 
-0x10400002, 0x2021, 0x24040001, 0xc004d4b, 
-0x108042, 0x1600fffa, 0x2901024, 0xc004d71, 
-0x34108000, 0xc004d71, 0x0, 0xc004d2b, 
-0x0, 0x50400005, 0x108042, 0x96220000, 
-0x501025, 0xa6220000, 0x108042, 0x1600fff7, 
-0x0, 0xc004d71, 0x0, 0x32a5ffff, 
-0x24020001, 0x54a20004, 0x24020002, 0x97a20010, 
-0x8004e14, 0x521025, 0x14a20006, 0x3271ffff, 
-0x97a20010, 0x121827, 0x431024, 0xa7a20010, 
-0x3271ffff, 0x27b20010, 0x8021, 0xc004d4b, 
-0x24040001, 0x26100001, 0x2e020020, 0x1440fffb, 
-0x0, 0xc004d4b, 0x2021, 0xc004d4b, 
-0x24040001, 0xc004d4b, 0x2021, 0xc004d4b, 
-0x24040001, 0x24100010, 0x32020001, 0x10400002, 
-0x2021, 0x24040001, 0xc004d4b, 0x108042, 
-0x1600fffa, 0x32020001, 0x24100010, 0x2301024, 
-0x10400002, 0x2021, 0x24040001, 0xc004d4b, 
-0x108042, 0x1600fffa, 0x2301024, 0xc004d4b, 
-0x24040001, 0xc004d4b, 0x2021, 0x34108000, 
-0x96420000, 0x501024, 0x10400002, 0x2021, 
-0x24040001, 0xc004d4b, 0x108042, 0x1600fff8, 
-0x0, 0xc004d71, 0x0, 0x8fbf0030, 
-0x8fb5002c, 0x8fb40028, 0x8fb30024, 0x8fb20020, 
-0x8fb1001c, 0x8fb00018, 0x3e00008, 0x27bd0038, 
-0x0, 0x0, 0x0, 0x27bdffe8, 
-0xafbf0010, 0x3c030001, 0x771821, 0x8c6383ac, 
-0x24020008, 0x1462022c, 0x803021, 0x3c020001, 
-0x8c425d98, 0x14400033, 0x0, 0x8f850224, 
-0x38a30020, 0x2c630001, 0x38a20010, 0x2c420001, 
-0x621825, 0x1460000d, 0x38a30030, 0x2c630001, 
-0x38a20400, 0x2c420001, 0x621825, 0x14600007, 
-0x38a30402, 0x2c630001, 0x38a20404, 0x2c420001, 
-0x621825, 0x10600005, 0x0, 0xc00429b, 
-0x0, 0x8004e8d, 0x2402000e, 0xc0043dd, 
-0x0, 0x3c050001, 0x8ca55cc8, 0xc0052a2, 
-0x2021, 0x3c030001, 0x8c635cc8, 0x24020004, 
-0x14620005, 0x2403fffb, 0x3c020001, 0x8c425cc4, 
-0x8004e89, 0x2403fff7, 0x3c020001, 0x8c425cc4, 
-0x431024, 0x3c010001, 0xac225cc4, 0x2402000e, 
-0x3c010001, 0xc00429b, 0xac227dd0, 0x8005087, 
-0x0, 0x8f820220, 0x3c030400, 0x431024, 
-0x10400027, 0x2403ffbf, 0x8f850224, 0x3c020001, 
-0x8c427ddc, 0xa32024, 0x431024, 0x1482000c, 
-0x0, 0x3c020001, 0x8c427de0, 0x24420001, 
-0x3c010001, 0xac227de0, 0x2c420002, 0x14400008, 
-0x24020001, 0x3c010001, 0x8004ead, 0xac227e00, 
-0x3c010001, 0xac207de0, 0x3c010001, 0xac207e00, 
-0x3c020001, 0x8c427e00, 0x10400006, 0x30a20040, 
-0x10400004, 0x24020001, 0x3c010001, 0x8004eb8, 
-0xac227e04, 0x3c010001, 0xac207e04, 0x3c010001, 
-0xac257ddc, 0x3c010001, 0x8004ec8, 0xac207e10, 
-0x24020001, 0x3c010001, 0xac227e10, 0x3c010001, 
-0xac207e00, 0x3c010001, 0xac207de0, 0x3c010001, 
-0xac207e04, 0x3c010001, 0xac207ddc, 0x3c030001, 
-0x8c637dd0, 0x3c020001, 0x8c427dd4, 0x10620003, 
-0x3c020200, 0x3c010001, 0xac237dd4, 0xc21024, 
-0x10400007, 0x2463ffff, 0x8f820220, 0x24030001, 
-0x3c010001, 0xac235ccc, 0x8005085, 0x3c03f700, 
-0x2c62000e, 0x104001a8, 0x31080, 0x3c010001, 
-0x220821, 0x8c225b80, 0x400008, 0x0, 
-0x3c010001, 0xac207e00, 0x3c010001, 0xac207de0, 
-0x3c010001, 0xac207ddc, 0x3c010001, 0xac207e04, 
-0x3c010001, 0xac207df8, 0x3c010001, 0xac207df0, 
-0xc00486a, 0xaf800224, 0x24020002, 0x3c010001, 
-0xac227dd0, 0x3c020001, 0x8c427e10, 0x14400056, 
-0x3c03fdff, 0x8ee20000, 0x3463ffff, 0x431024, 
-0xc00429b, 0xaee20000, 0xaf800204, 0x8f820200, 
-0x2403fffd, 0x431024, 0xaf820200, 0x3c010001, 
-0xac207e20, 0x8f830054, 0x3c020001, 0x8c427df8, 
-0x24040001, 0x3c010001, 0xac247e0c, 0x24420001, 
-0x3c010001, 0xac227df8, 0x2c420004, 0x3c010001, 
-0xac237df4, 0x14400006, 0x24020003, 0x3c010001, 
-0xac245ccc, 0x3c010001, 0x8005083, 0xac207df8, 
-0x3c010001, 0x8005083, 0xac227dd0, 0x8f830054, 
-0x3c020001, 0x8c427df4, 0x2463d8f0, 0x431023, 
-0x2c422710, 0x14400003, 0x24020004, 0x3c010001, 
-0xac227dd0, 0x3c020001, 0x8c427e10, 0x14400026, 
-0x3c03fdff, 0x8ee20000, 0x3463ffff, 0x431024, 
-0x8005083, 0xaee20000, 0x3c040001, 0x8c845d9c, 
-0x3c010001, 0xc00508a, 0xac207de8, 0x3c020001, 
-0x8c427e1c, 0xaf820204, 0x3c020001, 0x8c427e10, 
-0x14400015, 0x3c03fdff, 0x8ee20000, 0x3463ffff, 
-0x431024, 0xaee20000, 0x8f820204, 0x30420030, 
-0x1440013c, 0x24020002, 0x3c030001, 0x8c637e1c, 
-0x24020005, 0x3c010001, 0xac227dd0, 0x3c010001, 
-0x8005083, 0xac237e20, 0x3c020001, 0x8c427e10, 
-0x10400010, 0x3c03fdff, 0x3c020001, 0x8c425d6c, 
-0x24420001, 0x3c010001, 0xac225d6c, 0x2c420002, 
-0x14400131, 0x24020001, 0x3c010001, 0xac225d74, 
-0x3c010001, 0xac205d6c, 0x3c010001, 0x8005083, 
-0xac225ccc, 0x8ee20000, 0x3463ffff, 0x431024, 
-0xaee20000, 0x3c020001, 0x8c427e00, 0x10400122, 
-0x0, 0x3c020001, 0x8c427ddc, 0x1040011e, 
-0x0, 0x3c010001, 0xac227e08, 0x24020003, 
-0x3c010001, 0xac227de0, 0x8005024, 0x24020006, 
-0x3c010001, 0xac207de8, 0x8f820204, 0x34420040, 
-0xaf820204, 0x3c020001, 0x8c427e20, 0x24030007, 
-0x3c010001, 0xac237dd0, 0x34420040, 0x3c010001, 
-0xac227e20, 0x3c020001, 0x8c427e00, 0x10400005, 
-0x0, 0x3c020001, 0x8c427ddc, 0x104000f9, 
-0x24020002, 0x3c050001, 0x24a57de0, 0x8ca20000, 
-0x2c424e21, 0x104000f3, 0x24020002, 0x3c020001, 
-0x8c427e04, 0x104000f8, 0x2404ffbf, 0x3c020001, 
-0x8c427ddc, 0x3c030001, 0x8c637e08, 0x441024, 
-0x641824, 0x10430004, 0x24020001, 0x3c010001, 
-0x8005083, 0xac227dd0, 0x24020003, 0xaca20000, 
-0x24020008, 0x3c010001, 0xac227dd0, 0x3c020001, 
-0x8c427e0c, 0x1040000c, 0x24020001, 0x3c040001, 
-0xc005097, 0x8c847ddc, 0x3c020001, 0x8c427e28, 
-0x14400005, 0x24020001, 0x3c020001, 0x8c427e24, 
-0x10400006, 0x24020001, 0x3c010001, 0xac225ccc, 
-0x3c010001, 0x8005083, 0xac207df8, 0x3c020001, 
-0x8c427df0, 0x3c030001, 0x8c637ddc, 0x2c420001, 
-0x210c0, 0x30630008, 0x3c010001, 0xac227df0, 
-0x3c010001, 0xac237dec, 0x8f830054, 0x24020009, 
-0x3c010001, 0xac227dd0, 0x3c010001, 0x8005083, 
-0xac237df4, 0x8f830054, 0x3c020001, 0x8c427df4, 
-0x2463d8f0, 0x431023, 0x2c422710, 0x144000a8, 
-0x0, 0x3c020001, 0x8c427e00, 0x10400005, 
-0x0, 0x3c020001, 0x8c427ddc, 0x104000a9, 
-0x24020002, 0x3c030001, 0x24637de0, 0x8c620000, 
-0x2c424e21, 0x104000a3, 0x24020002, 0x3c020001, 
-0x8c427e0c, 0x1040000e, 0x0, 0x3c020001, 
-0x8c427ddc, 0x3c010001, 0xac207e0c, 0x30420080, 
-0x1040002f, 0x2402000c, 0x8f820204, 0x30420080, 
-0x1440000c, 0x24020003, 0x8005011, 0x2402000c, 
-0x3c020001, 0x8c427ddc, 0x30420080, 0x14400005, 
-0x24020003, 0x8f820204, 0x30420080, 0x1040001f, 
-0x24020003, 0xac620000, 0x2402000a, 0x3c010001, 
-0xac227dd0, 0x3c040001, 0x24847e18, 0x8c820000, 
-0x3c030001, 0x8c637df0, 0x431025, 0xaf820204, 
-0x8c830000, 0x3c040001, 0x8c847df0, 0x2402000b, 
-0x3c010001, 0xac227dd0, 0x641825, 0x3c010001, 
-0xac237e20, 0x3c050001, 0x24a57de0, 0x8ca20000, 
-0x2c424e21, 0x1040006f, 0x24020002, 0x3c020001, 
-0x8c427e10, 0x10400005, 0x0, 0x2402000c, 
-0x3c010001, 0x8005083, 0xac227dd0, 0x3c020001, 
-0x8c427e00, 0x1040006c, 0x0, 0x3c040001, 
-0x8c847ddc, 0x1080005e, 0x30820008, 0x3c030001, 
-0x8c637dec, 0x10620064, 0x24020003, 0x3c010001, 
-0xac247e08, 0xaca20000, 0x24020006, 0x3c010001, 
-0x8005083, 0xac227dd0, 0x8f820200, 0x34420002, 
-0xaf820200, 0x8f830054, 0x2402000d, 0x3c010001, 
-0xac227dd0, 0x3c010001, 0xac237df4, 0x8f830054, 
-0x3c020001, 0x8c427df4, 0x2463d8f0, 0x431023, 
-0x2c422710, 0x1440003a, 0x0, 0x3c020001, 
-0x8c427e10, 0x10400029, 0x2402000e, 0x3c030001, 
-0x8c637e24, 0x3c010001, 0x14600015, 0xac227dd0, 
-0xc0043dd, 0x0, 0x3c050001, 0x8ca55cc8, 
-0xc0052a2, 0x2021, 0x3c030001, 0x8c635cc8, 
-0x24020004, 0x14620005, 0x2403fffb, 0x3c020001, 
-0x8c425cc4, 0x8005052, 0x2403fff7, 0x3c020001, 
-0x8c425cc4, 0x431024, 0x3c010001, 0xac225cc4, 
-0x8ee20000, 0x3c030200, 0x431025, 0xaee20000, 
-0x8f820224, 0x3c010001, 0xac227e2c, 0x8f820220, 
-0x2403fffb, 0x431024, 0xaf820220, 0x8f820220, 
-0x34420002, 0x8005083, 0xaf820220, 0x3c020001, 
-0x8c427e00, 0x10400005, 0x0, 0x3c020001, 
-0x8c427ddc, 0x1040000f, 0x24020002, 0x3c020001, 
-0x8c427de0, 0x2c424e21, 0x1040000a, 0x24020002, 
-0x3c020001, 0x8c427e00, 0x1040000f, 0x0, 
-0x3c020001, 0x8c427ddc, 0x1440000b, 0x0, 
-0x24020002, 0x3c010001, 0x8005083, 0xac227dd0, 
-0x3c020001, 0x8c427e00, 0x10400003, 0x0, 
-0xc00429b, 0x0, 0x8f820220, 0x3c03f700, 
-0x431025, 0xaf820220, 0x8fbf0010, 0x3e00008, 
-0x27bd0018, 0x3c030001, 0x24637e28, 0x8c620000, 
-0x10400005, 0x34422000, 0x3c010001, 0xac227e1c, 
-0x8005095, 0xac600000, 0x3c010001, 0xac247e1c, 
-0x3e00008, 0x0, 0x27bdffe0, 0x30820030, 
-0xafbf0018, 0x3c010001, 0xac227e24, 0x14400067, 
-0x3c02ffff, 0x34421f0e, 0x821024, 0x14400061, 
-0x24020030, 0x30822000, 0x1040005d, 0x30838000, 
-0x31a02, 0x30820001, 0x21200, 0x3c040001, 
-0x8c845d9c, 0x621825, 0x331c2, 0x3c030001, 
-0x24635d78, 0x30828000, 0x21202, 0x30840001, 
-0x42200, 0x441025, 0x239c2, 0x61080, 
-0x431021, 0x471021, 0x90430000, 0x24020001, 
-0x10620025, 0x0, 0x10600007, 0x24020002, 
-0x10620013, 0x24020003, 0x1062002c, 0x3c05000f, 
-0x80050f9, 0x0, 0x8f820200, 0x2403feff, 
-0x431024, 0xaf820200, 0x8f820220, 0x3c03fffe, 
-0x3463ffff, 0x431024, 0xaf820220, 0x3c010001, 
-0xac207e44, 0x3c010001, 0x8005104, 0xac207e4c, 
-0x8f820200, 0x34420100, 0xaf820200, 0x8f820220, 
-0x3c03fffe, 0x3463ffff, 0x431024, 0xaf820220, 
-0x24020100, 0x3c010001, 0xac227e44, 0x3c010001, 
-0x8005104, 0xac207e4c, 0x8f820200, 0x2403feff, 
-0x431024, 0xaf820200, 0x8f820220, 0x3c030001, 
-0x431025, 0xaf820220, 0x3c010001, 0xac207e44, 
-0x3c010001, 0x8005104, 0xac237e4c, 0x8f820200, 
-0x34420100, 0xaf820200, 0x8f820220, 0x3c030001, 
-0x431025, 0xaf820220, 0x24020100, 0x3c010001, 
-0xac227e44, 0x3c010001, 0x8005104, 0xac237e4c, 
-0x34a5ffff, 0x3c040001, 0x24845bb8, 0xafa30010, 
-0xc002403, 0xafa00014, 0x8005104, 0x0, 
-0x24020030, 0x3c010001, 0xac227e28, 0x8fbf0018, 
-0x3e00008, 0x27bd0020, 0x0, 0x27bdffc8, 
-0xafb20028, 0x809021, 0xafb3002c, 0xa09821, 
-0xafb00020, 0xc08021, 0x3c040001, 0x24845bd0, 
-0x3c050009, 0x3c020001, 0x8c425cc8, 0x34a59001, 
-0x2403021, 0x2603821, 0xafbf0030, 0xafb10024, 
-0xa7a0001a, 0xafb00014, 0xc002403, 0xafa20010, 
-0x24020002, 0x12620083, 0x2e620003, 0x10400005, 
-0x24020001, 0x1262000a, 0x0, 0x800529b, 
-0x0, 0x24020004, 0x126200fa, 0x24020008, 
-0x126200f9, 0x3c02ffec, 0x800529b, 0x0, 
-0x3c020001, 0x8c425cc4, 0x30420002, 0x14400004, 
-0x128940, 0x3c02fffb, 0x3442ffff, 0x2028024, 
-0x3c010001, 0x310821, 0xac307e3c, 0x3c024000, 
-0x2021024, 0x1040004e, 0x1023c2, 0x30840030, 
-0x101382, 0x3042001c, 0x3c030001, 0x24635d08, 
-0x431021, 0x823821, 0x3c020020, 0x2021024, 
-0x10400006, 0x24020100, 0x3c010001, 0x310821, 
-0xac227e40, 0x8005150, 0x3c020080, 0x3c010001, 
-0x310821, 0xac207e40, 0x3c020080, 0x2021024, 
-0x10400006, 0x121940, 0x3c020001, 0x3c010001, 
-0x230821, 0x800515c, 0xac227e48, 0x121140, 
-0x3c010001, 0x220821, 0xac207e48, 0x94e40000, 
-0x3c030001, 0x8c635dbc, 0x24020005, 0x10620010, 
-0xa7a40018, 0x32024000, 0x10400002, 0x34824000, 
-0xa7a20018, 0x24040001, 0x94e20002, 0x24050004, 
-0x24e60002, 0x34420001, 0xc00498e, 0xa4e20002, 
-0x24040001, 0x2821, 0xc00498e, 0x27a60018, 
-0x3c020001, 0x8c425cc8, 0x24110001, 0x3c010001, 
-0xac315cd4, 0x14530004, 0x32028000, 0xc00429b, 
-0x0, 0x32028000, 0x1040011f, 0x0, 
-0xc00429b, 0x0, 0x3c030001, 0x8c635dbc, 
-0x24020005, 0x10620118, 0x24020002, 0x3c010001, 
-0xac315ccc, 0x3c010001, 0x800529b, 0xac225cc8, 
-0x24040001, 0x24050004, 0x27b0001a, 0xc00498e, 
-0x2003021, 0x24040001, 0x2821, 0xc00498e, 
-0x2003021, 0x3c020001, 0x511021, 0x8c427e34, 
-0x3c040001, 0x8c845cc8, 0x3c03bfff, 0x3463ffff, 
-0x3c010001, 0xac335cd4, 0x431024, 0x3c010001, 
-0x310821, 0x109300fa, 0xac227e34, 0x800529b, 
-0x0, 0x3c022000, 0x2021024, 0x10400005, 
-0x24020001, 0x3c010001, 0xac225d98, 0x80051ad, 
-0x128940, 0x3c010001, 0xac205d98, 0x128940, 
-0x3c010001, 0x310821, 0xac307e38, 0x3c024000, 
-0x2021024, 0x14400016, 0x0, 0x3c020001, 
-0x8c425d98, 0x10400008, 0x24040004, 0x24050001, 
-0xc004d93, 0x24062000, 0x24020001, 0x3c010001, 
-0x370821, 0xac2283ac, 0x3c020001, 0x511021, 
-0x8c427e30, 0x3c03bfff, 0x3463ffff, 0x431024, 
-0x3c010001, 0x310821, 0x8005299, 0xac227e30, 
-0x3c020001, 0x8c425d98, 0x10400028, 0x3c0300a0, 
-0x2031024, 0x5443000d, 0x3c020020, 0x3c020001, 
-0x8c425d9c, 0x24030100, 0x3c010001, 0x310821, 
-0xac237e44, 0x3c030001, 0x3c010001, 0x310821, 
-0xac237e4c, 0x80051f0, 0x34420400, 0x2021024, 
-0x10400008, 0x24030100, 0x3c020001, 0x8c425d9c, 
-0x3c010001, 0x310821, 0xac237e44, 0x80051f0, 
-0x34420800, 0x3c020080, 0x2021024, 0x1040002e, 
-0x3c030001, 0x3c020001, 0x8c425d9c, 0x3c010001, 
-0x310821, 0xac237e4c, 0x34420c00, 0x3c010001, 
-0xac225d9c, 0x8005218, 0x24040001, 0x3c020020, 
-0x2021024, 0x10400006, 0x24020100, 0x3c010001, 
-0x310821, 0xac227e44, 0x8005201, 0x3c020080, 
-0x3c010001, 0x310821, 0xac207e44, 0x3c020080, 
-0x2021024, 0x10400007, 0x121940, 0x3c020001, 
-0x3c010001, 0x230821, 0xac227e4c, 0x800520f, 
-0x24040001, 0x121140, 0x3c010001, 0x220821, 
-0xac207e4c, 0x24040001, 0x2821, 0x27b0001e, 
-0xc00494c, 0x2003021, 0x24040001, 0x2821, 
-0xc00494c, 0x2003021, 0x24040001, 0x24050001, 
-0x27b0001c, 0xc00494c, 0x2003021, 0x24040001, 
-0x24050001, 0xc00494c, 0x2003021, 0x8005299, 
-0x0, 0x3c02ffec, 0x3442ffff, 0x2028024, 
-0x3c020008, 0x2028025, 0x121140, 0x3c010001, 
-0x220821, 0xac307e38, 0x3c022000, 0x2021024, 
-0x10400009, 0x0, 0x3c020001, 0x8c425d74, 
-0x14400005, 0x24020001, 0x3c010001, 0xac225d98, 
-0x800523a, 0x3c024000, 0x3c010001, 0xac205d98, 
-0x3c024000, 0x2021024, 0x1440001e, 0x0, 
-0x3c020001, 0x8c425d98, 0x3c010001, 0xac205ce0, 
-0x10400007, 0x24022020, 0x3c010001, 0xac225d9c, 
-0x24020001, 0x3c010001, 0x370821, 0xac2283ac, 
-0x3c04bfff, 0x121940, 0x3c020001, 0x431021, 
-0x8c427e30, 0x3c050001, 0x8ca55cc8, 0x3484ffff, 
-0x441024, 0x3c010001, 0x230821, 0xac227e30, 
-0x24020001, 0x10a20044, 0x0, 0x8005299, 
-0x0, 0x3c020001, 0x8c425d98, 0x1040001c, 
-0x24022000, 0x3c010001, 0xac225d9c, 0x3c0300a0, 
-0x2031024, 0x14430005, 0x121140, 0x3402a000, 
-0x3c010001, 0x8005294, 0xac225d9c, 0x3c030001, 
-0x621821, 0x8c637e38, 0x3c020020, 0x621024, 
-0x10400004, 0x24022001, 0x3c010001, 0x8005294, 
-0xac225d9c, 0x3c020080, 0x621024, 0x1040001f, 
-0x3402a001, 0x3c010001, 0x8005294, 0xac225d9c, 
-0x3c020020, 0x2021024, 0x10400007, 0x121940, 
-0x24020100, 0x3c010001, 0x230821, 0xac227e44, 
-0x8005288, 0x3c020080, 0x121140, 0x3c010001, 
-0x220821, 0xac207e44, 0x3c020080, 0x2021024, 
-0x10400006, 0x121940, 0x3c020001, 0x3c010001, 
-0x230821, 0x8005294, 0xac227e4c, 0x121140, 
-0x3c010001, 0x220821, 0xac207e4c, 0x3c030001, 
-0x8c635cc8, 0x24020001, 0x10620003, 0x0, 
-0xc00429b, 0x0, 0x8fbf0030, 0x8fb3002c, 
-0x8fb20028, 0x8fb10024, 0x8fb00020, 0x3e00008, 
-0x27bd0038, 0x27bdffd8, 0xafb20020, 0x809021, 
-0xafb1001c, 0x8821, 0x24020002, 0xafbf0024, 
-0xafb00018, 0xa7a00012, 0x10a200d3, 0xa7a00010, 
-0x2ca20003, 0x10400005, 0x24020001, 0x10a2000a, 
-0x128140, 0x8005380, 0x2201021, 0x24020004, 
-0x10a2007d, 0x24020008, 0x10a2007c, 0x122940, 
-0x8005380, 0x2201021, 0x3c030001, 0x701821, 
-0x8c637e3c, 0x3c024000, 0x621024, 0x14400009, 
-0x24040001, 0x3c027fff, 0x3442ffff, 0x628824, 
-0x3c010001, 0x300821, 0xac317e34, 0x8005380, 
-0x2201021, 0x24050001, 0xc00494c, 0x27a60010, 
-0x24040001, 0x24050001, 0xc00494c, 0x27a60010, 
-0x97a20010, 0x30420004, 0x10400034, 0x3c114000, 
-0x3c020001, 0x8c425dbc, 0x2443ffff, 0x2c620006, 
-0x10400034, 0x31080, 0x3c010001, 0x220821, 
-0x8c225be0, 0x400008, 0x0, 0x24040001, 
-0x24050011, 0x27b00012, 0xc00494c, 0x2003021, 
-0x24040001, 0x24050011, 0xc00494c, 0x2003021, 
-0x97a50012, 0x30a24000, 0x10400002, 0x3c040010, 
-0x3c040008, 0x3c030001, 0x8005301, 0x30a28000, 
-0x24040001, 0x24050014, 0x27b00012, 0xc00494c, 
-0x2003021, 0x24040001, 0x24050014, 0xc00494c, 
-0x2003021, 0x97a50012, 0x30a21000, 0x10400002, 
-0x3c040010, 0x3c040008, 0x3c030001, 0x30a20800, 
-0x54400001, 0x3c030002, 0x3c028000, 0x2221025, 
-0x641825, 0x800530e, 0x438825, 0x3c110001, 
-0x2308821, 0x8e317e3c, 0x3c027fff, 0x3442ffff, 
-0x2228824, 0x3c020001, 0x8c425cd8, 0x1040001d, 
-0x121140, 0x3c020001, 0x8c425d98, 0x10400002, 
-0x3c022000, 0x2228825, 0x121140, 0x3c010001, 
-0x220821, 0x8c227e40, 0x10400003, 0x3c020020, 
-0x8005322, 0x2228825, 0x3c02ffdf, 0x3442ffff, 
-0x2228824, 0x121140, 0x3c010001, 0x220821, 
-0x8c227e48, 0x10400003, 0x3c020080, 0x800532d, 
-0x2228825, 0x3c02ff7f, 0x3442ffff, 0x2228824, 
-0x121140, 0x3c010001, 0x220821, 0xac317e34, 
-0x8005380, 0x2201021, 0x122940, 0x3c030001, 
-0x651821, 0x8c637e38, 0x3c024000, 0x621024, 
-0x14400008, 0x3c027fff, 0x3442ffff, 0x628824, 
-0x3c010001, 0x250821, 0xac317e30, 0x8005380, 
-0x2201021, 0x3c020001, 0x8c425cd8, 0x10400033, 
-0x3c11c00c, 0x3c020001, 0x8c425d74, 0x3c04c00c, 
-0x34842000, 0x3c030001, 0x8c635d98, 0x2102b, 
-0x21023, 0x441024, 0x10600003, 0x518825, 
-0x3c022000, 0x2228825, 0x3c020001, 0x451021, 
-0x8c427e44, 0x10400003, 0x3c020020, 0x800535d, 
-0x2228825, 0x3c02ffdf, 0x3442ffff, 0x2228824, 
-0x121140, 0x3c010001, 0x220821, 0x8c227e4c, 
-0x10400003, 0x3c020080, 0x8005368, 0x2228825, 
-0x3c02ff7f, 0x3442ffff, 0x2228824, 0x3c020001, 
-0x8c425d60, 0x10400002, 0x3c020800, 0x2228825, 
-0x3c020001, 0x8c425d64, 0x10400002, 0x3c020400, 
-0x2228825, 0x3c020001, 0x8c425d68, 0x10400006, 
-0x3c020100, 0x800537b, 0x2228825, 0x3c027fff, 
-0x3442ffff, 0x628824, 0x121140, 0x3c010001, 
-0x220821, 0xac317e30, 0x2201021, 0x8fbf0024, 
-0x8fb20020, 0x8fb1001c, 0x8fb00018, 0x3e00008, 
-0x27bd0028, 0x27bdffd8, 0xafb40020, 0x80a021, 
-0xafbf0024, 0xafb3001c, 0xafb20018, 0xafb10014, 
-0xafb00010, 0x8f900200, 0x3c030001, 0x8c635cc8, 
-0x8f930220, 0x24020002, 0x10620063, 0x2c620003, 
-0x10400005, 0x24020001, 0x1062000a, 0x141940, 
-0x8005448, 0x0, 0x24020004, 0x1062005a, 
-0x24020008, 0x10620059, 0x149140, 0x8005448, 
-0x0, 0x3c040001, 0x832021, 0x8c847e3c, 
-0x3c110001, 0x2238821, 0x8e317e34, 0x3c024000, 
-0x821024, 0x1040003e, 0x3c020008, 0x2221024, 
-0x10400020, 0x36100002, 0x3c020001, 0x431021, 
-0x8c427e40, 0x10400005, 0x36100020, 0x36100100, 
-0x3c020020, 0x80053bd, 0x2228825, 0x2402feff, 
-0x2028024, 0x3c02ffdf, 0x3442ffff, 0x2228824, 
-0x141140, 0x3c010001, 0x220821, 0x8c227e48, 
-0x10400005, 0x3c020001, 0x2629825, 0x3c020080, 
-0x80053dc, 0x2228825, 0x3c02fffe, 0x3442ffff, 
-0x2629824, 0x3c02ff7f, 0x3442ffff, 0x80053dc, 
-0x2228824, 0x2402fedf, 0x2028024, 0x3c02fffe, 
-0x3442ffff, 0x2629824, 0x3c02ff5f, 0x3442ffff, 
-0x2228824, 0x3c010001, 0x230821, 0xac207e40, 
-0x3c010001, 0x230821, 0xac207e48, 0xc00486a, 
-0x0, 0xaf900200, 0xaf930220, 0x8f820220, 
-0x2403fffb, 0x431024, 0xaf820220, 0x8f820220, 
-0x34420002, 0xaf820220, 0x80053f3, 0x141140, 
-0x8f820200, 0x2403fffd, 0x431024, 0xc00486a, 
-0xaf820200, 0x3c02bfff, 0x3442ffff, 0xc00429b, 
-0x2228824, 0x141140, 0x3c010001, 0x220821, 
-0x8005448, 0xac317e34, 0x149140, 0x3c040001, 
-0x922021, 0x8c847e38, 0x3c110001, 0x2328821, 
-0x8e317e30, 0x3c024000, 0x821024, 0x14400011, 
-0x0, 0x3c020001, 0x8c425d98, 0x14400006, 
-0x3c02bfff, 0x8f820200, 0x34420002, 0xc00486a, 
-0xaf820200, 0x3c02bfff, 0x3442ffff, 0xc00429b, 
-0x2228824, 0x3c010001, 0x320821, 0x8005448, 
-0xac317e30, 0x3c020001, 0x8c425d98, 0x10400005, 
-0x3c020020, 0x3c020001, 0x8c425d74, 0x1040002b, 
-0x3c020020, 0x821024, 0x10400007, 0x36100020, 
-0x24020100, 0x3c010001, 0x320821, 0xac227e44, 
-0x8005428, 0x36100100, 0x3c010001, 0x320821, 
-0xac207e44, 0x2402feff, 0x2028024, 0x3c020080, 
-0x821024, 0x10400007, 0x141940, 0x3c020001, 
-0x3c010001, 0x230821, 0xac227e4c, 0x8005439, 
-0x2629825, 0x141140, 0x3c010001, 0x220821, 
-0xac207e4c, 0x3c02fffe, 0x3442ffff, 0x2629824, 
-0xc00486a, 0x0, 0xaf900200, 0xaf930220, 
-0x8f820220, 0x2403fffb, 0x431024, 0xaf820220, 
-0x8f820220, 0x34420002, 0xaf820220, 0x141140, 
-0x3c010001, 0x220821, 0xac317e30, 0x8fbf0024, 
-0x8fb40020, 0x8fb3001c, 0x8fb20018, 0x8fb10014, 
-0x8fb00010, 0x3e00008, 0x27bd0028, 0x0 };
-static u_int32_t tigonFwRodata[] = {
-0x24486561, 0x6465723a, 0x202f7072, 
-0x6f6a6563, 0x74732f72, 0x63732f73, 0x772f6765, 
-0x2f2e2f6e, 0x69632f66, 0x772f636f, 0x6d6d6f6e, 
-0x2f66776d, 0x61696e2e, 0x632c7620, 0x312e312e, 
-0x322e3131, 0x20313939, 0x382f3034, 0x2f323720, 
-0x32323a31, 0x333a3432, 0x20736875, 0x616e6720, 
-0x45787020, 0x24000000, 0x7468655f, 0x4441574e, 
-0x0, 0x53544143, 0x4b5f3120, 0x0, 
-0x42616453, 0x6e64526e, 0x67000000, 0x3f456e71, 
-0x45767400, 0x3f6e6f51, 0x64457650, 0x0, 
-0x6576526e, 0x6746756c, 0x6c000000, 0x496c6c43, 
-0x6f6e6652, 0x78000000, 0x53656e64, 0x436b5375, 
-0x6d000000, 0x52656376, 0x566c616e, 0x0, 
-0x0, 0x24486561, 0x6465723a, 0x202f7072, 
-0x6f6a6563, 0x74732f72, 0x63732f73, 0x772f6765, 
-0x2f2e2f6e, 0x69632f66, 0x772f636f, 0x6d6d6f6e, 
-0x2f74696d, 0x65722e63, 0x2c762031, 0x2e312e32, 
-0x2e382031, 0x3939382f, 0x30372f33, 0x31203137, 
-0x3a35383a, 0x34352073, 0x6875616e, 0x67204578, 
-0x70202400, 0x542d446d, 0x61526431, 0x0, 
-0x542d446d, 0x61424200, 0x542d446d, 0x61320000, 
-0x3f6e6f51, 0x64547845, 0x0, 0x3f6e6f51, 
-0x64527845, 0x0, 0x656e714d, 0x45765046, 
-0x61696c00, 0x656e714d, 0x45764661, 0x696c0000, 
-0x6661696c, 0x456e454d, 0x0, 0x3f456e71, 
-0x45767400, 0x3f6e6f51, 0x64457650, 0x0, 
-0x6576526e, 0x6746756c, 0x6c000000, 0x0, 
-0x0, 0x24486561, 0x6465723a, 0x202f7072, 
-0x6f6a6563, 0x74732f72, 0x63732f73, 0x772f6765, 
-0x2f2e2f6e, 0x69632f66, 0x772f636f, 0x6d6d6f6e, 
-0x2f636f6d, 0x6d616e64, 0x2e632c76, 0x20312e31, 
-0x2e322e31, 0x30203139, 0x39382f31, 0x312f3138, 
-0x2031373a, 0x31313a31, 0x38207368, 0x75616e67, 
-0x20457870, 0x20240000, 0x3f4d626f, 0x78457674, 
-0x0, 0x4e4f636f, 0x6d616e64, 0x0, 
-0x68737465, 0x5f455252, 0x0, 0x412d4572, 
-0x72427563, 0x0, 0x4552524f, 0x522d4164, 
-0x64000000, 0x656e714d, 0x45765046, 0x61696c00, 
-0x656e714d, 0x45764661, 0x696c0000, 0x6661696c, 
-0x456e454d, 0x0, 0x442d4572, 0x724c6173, 
-0x74000000, 0x442d4572, 0x72320000, 0x6d437374, 
-0x4d644552, 0x52000000, 0x70726f6d, 0x4d644552, 
-0x52000000, 0x46696c74, 0x4d644552, 0x52000000, 
-0x636d645f, 0x45525200, 0x3f456e71, 0x45767400, 
-0x3f6e6f51, 0x64457650, 0x0, 0x6576526e, 
-0x6746756c, 0x6c000000, 0x0, 0x6ea0, 
-0x7fbc, 0x6e38, 0x8734, 0x82b0, 
-0x8780, 0x8780, 0x6f54, 0x7694, 
-0x7f0c, 0x80a8, 0x8074, 0x8780, 
-0x7e70, 0x80cc, 0x6e64, 0x81cc, 
-0x0, 0x24486561, 0x6465723a, 0x202f7072, 
-0x6f6a6563, 0x74732f72, 0x63732f73, 0x772f6765, 
-0x2f2e2f6e, 0x69632f66, 0x772f636f, 0x6d6d6f6e, 
-0x2f646d61, 0x2e632c76, 0x20312e31, 0x2e322e33, 
-0x20313939, 0x382f3034, 0x2f323720, 0x32323a31, 
-0x333a3431, 0x20736875, 0x616e6720, 0x45787020, 
-0x24000000, 0x646d6172, 0x6441544e, 0x0, 
-0x646d6177, 0x7241544e, 0x0, 0x0, 
-0x0, 0x24486561, 0x6465723a, 0x202f7072, 
-0x6f6a6563, 0x74732f72, 0x63732f73, 0x772f6765, 
-0x2f2e2f6e, 0x69632f66, 0x772f636f, 0x6d6d6f6e, 
-0x2f747261, 0x63652e63, 0x2c762031, 0x2e312e32, 
-0x2e322031, 0x3939382f, 0x30342f32, 0x37203232, 
-0x3a31333a, 0x35302073, 0x6875616e, 0x67204578, 
-0x70202400, 0x24486561, 0x6465723a, 0x202f7072, 
-0x6f6a6563, 0x74732f72, 0x63732f73, 0x772f6765, 
-0x2f2e2f6e, 0x69632f66, 0x772f636f, 0x6d6d6f6e, 
-0x2f646174, 0x612e632c, 0x7620312e, 0x312e322e, 
-0x32203139, 0x39382f30, 0x342f3237, 0x2032323a, 
-0x31333a34, 0x30207368, 0x75616e67, 0x20457870, 
-0x20240000, 0x46575f56, 0x45525349, 0x4f4e3a20, 
-0x23312046, 0x72692041, 0x70722037, 0x2031373a, 
-0x35353a34, 0x38205044, 0x54203230, 0x30300000, 
-0x46575f43, 0x4f4d5049, 0x4c455f54, 0x494d453a, 
-0x2031373a, 0x35353a34, 0x38000000, 0x46575f43, 
-0x4f4d5049, 0x4c455f42, 0x593a2064, 0x65767263, 
-0x73000000, 0x46575f43, 0x4f4d5049, 0x4c455f48, 
-0x4f53543a, 0x20636f6d, 0x70757465, 0x0, 
-0x46575f43, 0x4f4d5049, 0x4c455f44, 0x4f4d4149, 
-0x4e3a2065, 0x6e672e61, 0x6374656f, 0x6e2e636f, 
-0x6d000000, 0x46575f43, 0x4f4d5049, 0x4c45523a, 
-0x20676363, 0x20766572, 0x73696f6e, 0x20322e37, 
-0x2e320000, 0x0, 0x0, 0x0, 
-0x0, 0x24486561, 0x6465723a, 0x202f7072, 
-0x6f6a6563, 0x74732f72, 0x63732f73, 0x772f6765, 
-0x2f2e2f6e, 0x69632f66, 0x772f636f, 0x6d6d6f6e, 
-0x2f6d656d, 0x2e632c76, 0x20312e31, 0x2e322e32, 
-0x20313939, 0x382f3034, 0x2f323720, 0x32323a31, 
-0x333a3434, 0x20736875, 0x616e6720, 0x45787020, 
-0x24000000, 0x24486561, 0x6465723a, 0x202f7072, 
-0x6f6a6563, 0x74732f72, 0x63732f73, 0x772f6765, 
-0x2f2e2f6e, 0x69632f66, 0x772f636f, 0x6d6d6f6e, 
-0x2f73656e, 0x642e632c, 0x7620312e, 0x312e322e, 
-0x31312031, 0x3939382f, 0x31322f32, 0x32203137, 
-0x3a31373a, 0x35352073, 0x6875616e, 0x67204578, 
-0x70202400, 0x736e6464, 0x654e6f51, 0x20000000, 
-0x6e6f454e, 0x515f5458, 0x0, 0x736e6464, 
-0x744e6f51, 0x20000000, 0x3f6e6f51, 0x64547845, 
-0x0, 0x756e6b72, 0x64747970, 0x65000000, 
-0x0, 0xaccc, 0xaccc, 0xad9c, 
-0xaab0, 0xaab0, 0xad9c, 0xad9c, 
-0xad9c, 0xad9c, 0xad9c, 0xad9c, 
-0xad9c, 0xad9c, 0xad9c, 0xad9c, 
-0xad9c, 0xad9c, 0xad9c, 0xad7c, 
-0x0, 0xbca8, 0xbca8, 0xbd70, 
-0xae4c, 0xb058, 0xbd70, 0xbd70, 
-0xbd70, 0xbd70, 0xbd70, 0xbd70, 
-0xbd70, 0xbd70, 0xbd70, 0xbd70, 
-0xbd70, 0xbd70, 0xbd70, 0xbd54, 
-0xb040, 0x24486561, 0x6465723a, 0x202f7072, 
-0x6f6a6563, 0x74732f72, 0x63732f73, 0x772f6765, 
-0x2f2e2f6e, 0x69632f66, 0x772f636f, 0x6d6d6f6e, 
-0x2f726563, 0x762e632c, 0x7620312e, 0x312e322e, 
-0x31392031, 0x3939382f, 0x30372f32, 0x34203231, 
-0x3a33303a, 0x30352073, 0x6875616e, 0x67204578, 
-0x70202400, 0x706b5278, 0x45525200, 0x66726d32, 
-0x4c617267, 0x65000000, 0x72784e6f, 0x52784264, 
-0x0, 0x72785144, 0x6d614446, 0x0, 
-0x72785144, 0x6d614246, 0x0, 0x3f6e6f51, 
-0x64527845, 0x0, 0x706b5278, 0x45525273, 
-0x0, 0x66726d32, 0x4c726753, 0x0, 
-0x72784e6f, 0x42645300, 0x3f724264, 0x446d6146, 
-0x0, 0x3f724a42, 0x64446d46, 0x0, 
-0x0, 0xf678, 0xf678, 0xf678, 
-0xf678, 0xf678, 0xf678, 0xf678, 
-0xf678, 0xf678, 0xf678, 0xf678, 
-0xf678, 0xf678, 0xf678, 0xf678, 
-0xf670, 0xf670, 0xf670, 0x572d444d, 
-0x41456e46, 0x0, 0x0, 0xfdc0, 
-0x1015c, 0xfddc, 0x1015c, 0x1015c, 
-0x1015c, 0x1015c, 0x1015c, 0x1015c, 
-0xf704, 0x1015c, 0x1015c, 0x1015c, 
-0x1015c, 0x1015c, 0x10154, 0x10154, 
-0x10154, 0x24486561, 0x6465723a, 0x202f7072, 
-0x6f6a6563, 0x74732f72, 0x63732f73, 0x772f6765, 
-0x2f2e2f6e, 0x69632f66, 0x772f636f, 0x6d6d6f6e, 
-0x2f6d6163, 0x2e632c76, 0x20312e31, 0x2e322e31, 
-0x32203139, 0x39382f30, 0x342f3237, 0x2032323a, 
-0x31333a34, 0x32207368, 0x75616e67, 0x20457870, 
-0x20240000, 0x6d616374, 0x7841544e, 0x0, 
-0x4e745379, 0x6e264c6b, 0x0, 0x72656d61, 
-0x73737274, 0x0, 0x6c696e6b, 0x444f574e, 
-0x0, 0x656e714d, 0x45765046, 0x61696c00, 
-0x656e714d, 0x45764661, 0x696c0000, 0x6661696c, 
-0x456e454d, 0x0, 0x6c696e6b, 0x55500000, 
-0x0, 0x24486561, 0x6465723a, 0x202f7072, 
-0x6f6a6563, 0x74732f72, 0x63732f73, 0x772f6765, 
-0x2f2e2f6e, 0x69632f66, 0x772f636f, 0x6d6d6f6e, 
-0x2f636b73, 0x756d2e63, 0x2c762031, 0x2e312e32, 
-0x2e322031, 0x3939382f, 0x30342f32, 0x37203232, 
-0x3a31333a, 0x33392073, 0x6875616e, 0x67204578, 
-0x70202400, 0x50726f62, 0x65506879, 0x0, 
-0x6c6e6b41, 0x53535254, 0x0, 0x11b2c, 
-0x11bc4, 0x11bf8, 0x11c2c, 0x11c58, 
-0x11c6c, 0x11ca8, 0x1207c, 0x11de4, 
-0x11e24, 0x11e50, 0x11e90, 0x11ec0, 
-0x11efc, 0x11f30, 0x1207c, 0x122c0, 
-0x122d8, 0x12300, 0x12320, 0x12348, 
-0x12478, 0x124a0, 0x124f4, 0x1251c, 
-0x0, 0x1278c, 0x1285c, 0x12934, 
-0x12a04, 0x12a60, 0x12b3c, 0x12b64, 
-0x12c40, 0x12c68, 0x12e10, 0x12e38, 
-0x12fe0, 0x131d8, 0x1346c, 0x13380, 
-0x1346c, 0x13498, 0x13008, 0x131b0, 
-0x0, 0x13b84, 0x13bc8, 0x13c60, 
-0x13cac, 0x13d1c, 0x13db4, 0x13de8, 
-0x13e70, 0x13f08, 0x13fd8, 0x14018, 
-0x1409c, 0x140c0, 0x141f4, 0x646f4261, 
-0x73655067, 0x0, 0x0, 0x0, 
-0x0, 0x73746d61, 0x634c4e4b, 0x0, 
-0x0, 0x14c38, 0x14c38, 0x14b80, 
-0x14bc4, 0x14c38, 0x14c38, 0x0, 
-0x0, 0x0 };
-static u_int32_t tigonFwData[] = {
-0x416c7465, 
-0x6f6e2041, 0x63654e49, 0x43205600, 0x416c7465, 
-0x6f6e2041, 0x63654e49, 0x43205600, 0x42424242, 
-0x0, 0x0, 0x0, 0x135418, 
-0x13e7fc, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x60cf00, 
-0x60, 0xcf000000, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x3, 0x0, 
-0x1, 0x0, 0x0, 0x0, 
-0x1, 0x0, 0x1, 0x0, 
-0x0, 0x0, 0x0, 0x1, 
-0x1, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x1000000, 0x21000000, 
-0x12000140, 0x0, 0x0, 0x20000000, 
-0x120000a0, 0x0, 0x12000060, 0x12000180, 
-0x120001e0, 0x0, 0x0, 0x0, 
-0x1, 0x0, 0x0, 0x0, 
-0x0, 0x0, 0x0, 0x2, 
-0x0, 0x0, 0x30001, 0x1, 
-0x30201, 0x0, 0x0, 0x0 };
--- sys/pci/if_sk.c
+++ /dev/null
@@ -1,3054 +0,0 @@
-/*	$OpenBSD: if_sk.c,v 2.33 2003/08/12 05:23:06 nate Exp $	*/
-
-/*-
- * Copyright (c) 1997, 1998, 1999, 2000
- *	Bill Paul <wpaul at ctr.columbia.edu>.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-/*-
- * Copyright (c) 2003 Nathan L. Binkert <binkertn at umich.edu>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/if_sk.c,v 1.106.2.7 2006/01/27 21:37:56 bz Exp $");
-
-/*
- * SysKonnect SK-NET gigabit ethernet driver for FreeBSD. Supports
- * the SK-984x series adapters, both single port and dual port.
- * References:
- * 	The XaQti XMAC II datasheet,
- *  http://www.freebsd.org/~wpaul/SysKonnect/xmacii_datasheet_rev_c_9-29.pdf
- *	The SysKonnect GEnesis manual, http://www.syskonnect.com
- *
- * Note: XaQti has been aquired by Vitesse, and Vitesse does not have the
- * XMAC II datasheet online. I have put my copy at people.freebsd.org as a
- * convenience to others until Vitesse corrects this problem:
- *
- * http://people.freebsd.org/~wpaul/SysKonnect/xmacii_datasheet_rev_c_9-29.pdf
- *
- * Written by Bill Paul <wpaul at ee.columbia.edu>
- * Department of Electrical Engineering
- * Columbia University, New York City
- */
-/*
- * The SysKonnect gigabit ethernet adapters consist of two main
- * components: the SysKonnect GEnesis controller chip and the XaQti Corp.
- * XMAC II gigabit ethernet MAC. The XMAC provides all of the MAC
- * components and a PHY while the GEnesis controller provides a PCI
- * interface with DMA support. Each card may have between 512K and
- * 2MB of SRAM on board depending on the configuration.
- *
- * The SysKonnect GEnesis controller can have either one or two XMAC
- * chips connected to it, allowing single or dual port NIC configurations.
- * SysKonnect has the distinction of being the only vendor on the market
- * with a dual port gigabit ethernet NIC. The GEnesis provides dual FIFOs,
- * dual DMA queues, packet/MAC/transmit arbiters and direct access to the
- * XMAC registers. This driver takes advantage of these features to allow
- * both XMACs to operate as independent interfaces.
- */
- 
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/sockio.h>
-#include <sys/mbuf.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-#include <sys/socket.h>
-#include <sys/queue.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/if_arp.h>
-#include <net/ethernet.h>
-#include <net/if_dl.h>
-#include <net/if_media.h>
-#include <net/if_types.h>
-
-#include <net/bpf.h>
-
-#include <vm/vm.h>              /* for vtophys */
-#include <vm/pmap.h>            /* for vtophys */
-#include <machine/bus.h>
-#include <machine/resource.h>
-#include <sys/bus.h>
-#include <sys/rman.h>
-
-#include <dev/mii/mii.h>
-#include <dev/mii/miivar.h>
-#include <dev/mii/brgphyreg.h>
-
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcivar.h>
-
-#if 0
-#define SK_USEIOSPACE
-#endif
-
-#include <pci/if_skreg.h>
-#include <pci/xmaciireg.h>
-#include <pci/yukonreg.h>
-
-MODULE_DEPEND(sk, pci, 1, 1, 1);
-MODULE_DEPEND(sk, ether, 1, 1, 1);
-MODULE_DEPEND(sk, miibus, 1, 1, 1);
-
-/* "controller miibus0" required.  See GENERIC if you get errors here. */
-#include "miibus_if.h"
-
-#ifndef lint
-static const char rcsid[] =
-  "$FreeBSD: src/sys/pci/if_sk.c,v 1.106.2.7 2006/01/27 21:37:56 bz Exp $";
-#endif
-
-static struct sk_type sk_devs[] = {
-	{
-		VENDORID_SK,
-		DEVICEID_SK_V1,
-		"SysKonnect Gigabit Ethernet (V1.0)"
-	},
-	{
-		VENDORID_SK,
-		DEVICEID_SK_V2,
-		"SysKonnect Gigabit Ethernet (V2.0)"
-	},
-	{
-		VENDORID_MARVELL,
-		DEVICEID_SK_V2,
-		"Marvell Gigabit Ethernet"
-	},
-	{
-		VENDORID_MARVELL,
-		DEVICEID_BELKIN_5005,
-		"Belkin F5D5005 Gigabit Ethernet"
-	},
-	{
-		VENDORID_3COM,
-		DEVICEID_3COM_3C940,
-		"3Com 3C940 Gigabit Ethernet"
-	},
-	{
-		VENDORID_LINKSYS,
-		DEVICEID_LINKSYS_EG1032,
-		"Linksys EG1032 Gigabit Ethernet"
-	},
-	{
-		VENDORID_DLINK,
-		DEVICEID_DLINK_DGE530T,
-		"D-Link DGE-530T Gigabit Ethernet"
-	},
-	{ 0, 0, NULL }
-};
-
-static int skc_probe(device_t);
-static int skc_attach(device_t);
-static int skc_detach(device_t);
-static void skc_shutdown(device_t);
-static int sk_detach(device_t);
-static int sk_probe(device_t);
-static int sk_attach(device_t);
-static void sk_tick(void *);
-static void sk_intr(void *);
-static void sk_intr_xmac(struct sk_if_softc *);
-static void sk_intr_bcom(struct sk_if_softc *);
-static void sk_intr_yukon(struct sk_if_softc *);
-static void sk_rxeof(struct sk_if_softc *);
-static void sk_txeof(struct sk_if_softc *);
-static int sk_encap(struct sk_if_softc *, struct mbuf *,
-					u_int32_t *);
-static void sk_start(struct ifnet *);
-static void sk_start_locked(struct ifnet *);
-static int sk_ioctl(struct ifnet *, u_long, caddr_t);
-static void sk_init(void *);
-static void sk_init_locked(struct sk_if_softc *);
-static void sk_init_xmac(struct sk_if_softc *);
-static void sk_init_yukon(struct sk_if_softc *);
-static void sk_stop(struct sk_if_softc *);
-static void sk_watchdog(struct ifnet *);
-static int sk_ifmedia_upd(struct ifnet *);
-static void sk_ifmedia_sts(struct ifnet *, struct ifmediareq *);
-static void sk_reset(struct sk_softc *);
-static int sk_newbuf(struct sk_if_softc *,
-					struct sk_chain *, struct mbuf *);
-static int sk_alloc_jumbo_mem(struct sk_if_softc *);
-static void sk_free_jumbo_mem(struct sk_if_softc *);
-static void *sk_jalloc(struct sk_if_softc *);
-static void sk_jfree(void *, void *);
-static int sk_init_rx_ring(struct sk_if_softc *);
-static void sk_init_tx_ring(struct sk_if_softc *);
-static u_int32_t sk_win_read_4(struct sk_softc *, int);
-static u_int16_t sk_win_read_2(struct sk_softc *, int);
-static u_int8_t sk_win_read_1(struct sk_softc *, int);
-static void sk_win_write_4(struct sk_softc *, int, u_int32_t);
-static void sk_win_write_2(struct sk_softc *, int, u_int32_t);
-static void sk_win_write_1(struct sk_softc *, int, u_int32_t);
-static u_int8_t sk_vpd_readbyte(struct sk_softc *, int);
-static void sk_vpd_read_res(struct sk_softc *, struct vpd_res *, int);
-static void sk_vpd_read(struct sk_softc *);
-
-static int sk_miibus_readreg(device_t, int, int);
-static int sk_miibus_writereg(device_t, int, int, int);
-static void sk_miibus_statchg(device_t);
-
-static int sk_xmac_miibus_readreg(struct sk_if_softc *, int, int);
-static int sk_xmac_miibus_writereg(struct sk_if_softc *, int, int,
-						int);
-static void sk_xmac_miibus_statchg(struct sk_if_softc *);
-
-static int sk_marv_miibus_readreg(struct sk_if_softc *, int, int);
-static int sk_marv_miibus_writereg(struct sk_if_softc *, int, int,
-						int);
-static void sk_marv_miibus_statchg(struct sk_if_softc *);
-
-static uint32_t sk_xmchash(const uint8_t *);
-static uint32_t sk_gmchash(const uint8_t *);
-static void sk_setfilt(struct sk_if_softc *, caddr_t, int);
-static void sk_setmulti(struct sk_if_softc *);
-static void sk_setpromisc(struct sk_if_softc *);
-
-static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int low, int high);
-static int sysctl_hw_sk_int_mod(SYSCTL_HANDLER_ARGS);
-
-#ifdef SK_USEIOSPACE
-#define SK_RES		SYS_RES_IOPORT
-#define SK_RID		SK_PCI_LOIO
-#else
-#define SK_RES		SYS_RES_MEMORY
-#define SK_RID		SK_PCI_LOMEM
-#endif
-
-/*
- * Note that we have newbus methods for both the GEnesis controller
- * itself and the XMAC(s). The XMACs are children of the GEnesis, and
- * the miibus code is a child of the XMACs. We need to do it this way
- * so that the miibus drivers can access the PHY registers on the
- * right PHY. It's not quite what I had in mind, but it's the only
- * design that achieves the desired effect.
- */
-static device_method_t skc_methods[] = {
-	/* Device interface */
-	DEVMETHOD(device_probe,		skc_probe),
-	DEVMETHOD(device_attach,	skc_attach),
-	DEVMETHOD(device_detach,	skc_detach),
-	DEVMETHOD(device_shutdown,	skc_shutdown),
-
-	/* bus interface */
-	DEVMETHOD(bus_print_child,	bus_generic_print_child),
-	DEVMETHOD(bus_driver_added,	bus_generic_driver_added),
-
-	{ 0, 0 }
-};
-
-static driver_t skc_driver = {
-	"skc",
-	skc_methods,
-	sizeof(struct sk_softc)
-};
-
-static devclass_t skc_devclass;
-
-static device_method_t sk_methods[] = {
-	/* Device interface */
-	DEVMETHOD(device_probe,		sk_probe),
-	DEVMETHOD(device_attach,	sk_attach),
-	DEVMETHOD(device_detach,	sk_detach),
-	DEVMETHOD(device_shutdown,	bus_generic_shutdown),
-
-	/* bus interface */
-	DEVMETHOD(bus_print_child,	bus_generic_print_child),
-	DEVMETHOD(bus_driver_added,	bus_generic_driver_added),
-
-	/* MII interface */
-	DEVMETHOD(miibus_readreg,	sk_miibus_readreg),
-	DEVMETHOD(miibus_writereg,	sk_miibus_writereg),
-	DEVMETHOD(miibus_statchg,	sk_miibus_statchg),
-
-	{ 0, 0 }
-};
-
-static driver_t sk_driver = {
-	"sk",
-	sk_methods,
-	sizeof(struct sk_if_softc)
-};
-
-static devclass_t sk_devclass;
-
-DRIVER_MODULE(sk, pci, skc_driver, skc_devclass, 0, 0);
-DRIVER_MODULE(sk, skc, sk_driver, sk_devclass, 0, 0);
-DRIVER_MODULE(miibus, sk, miibus_driver, miibus_devclass, 0, 0);
-
-#define SK_SETBIT(sc, reg, x)		\
-	CSR_WRITE_4(sc, reg, CSR_READ_4(sc, reg) | x)
-
-#define SK_CLRBIT(sc, reg, x)		\
-	CSR_WRITE_4(sc, reg, CSR_READ_4(sc, reg) & ~x)
-
-#define SK_WIN_SETBIT_4(sc, reg, x)	\
-	sk_win_write_4(sc, reg, sk_win_read_4(sc, reg) | x)
-
-#define SK_WIN_CLRBIT_4(sc, reg, x)	\
-	sk_win_write_4(sc, reg, sk_win_read_4(sc, reg) & ~x)
-
-#define SK_WIN_SETBIT_2(sc, reg, x)	\
-	sk_win_write_2(sc, reg, sk_win_read_2(sc, reg) | x)
-
-#define SK_WIN_CLRBIT_2(sc, reg, x)	\
-	sk_win_write_2(sc, reg, sk_win_read_2(sc, reg) & ~x)
-
-static u_int32_t
-sk_win_read_4(sc, reg)
-	struct sk_softc		*sc;
-	int			reg;
-{
-#ifdef SK_USEIOSPACE
-	CSR_WRITE_4(sc, SK_RAP, SK_WIN(reg));
-	return(CSR_READ_4(sc, SK_WIN_BASE + SK_REG(reg)));
-#else
-	return(CSR_READ_4(sc, reg));
-#endif
-}
-
-static u_int16_t
-sk_win_read_2(sc, reg)
-	struct sk_softc		*sc;
-	int			reg;
-{
-#ifdef SK_USEIOSPACE
-	CSR_WRITE_4(sc, SK_RAP, SK_WIN(reg));
-	return(CSR_READ_2(sc, SK_WIN_BASE + SK_REG(reg)));
-#else
-	return(CSR_READ_2(sc, reg));
-#endif
-}
-
-static u_int8_t
-sk_win_read_1(sc, reg)
-	struct sk_softc		*sc;
-	int			reg;
-{
-#ifdef SK_USEIOSPACE
-	CSR_WRITE_4(sc, SK_RAP, SK_WIN(reg));
-	return(CSR_READ_1(sc, SK_WIN_BASE + SK_REG(reg)));
-#else
-	return(CSR_READ_1(sc, reg));
-#endif
-}
-
-static void
-sk_win_write_4(sc, reg, val)
-	struct sk_softc		*sc;
-	int			reg;
-	u_int32_t		val;
-{
-#ifdef SK_USEIOSPACE
-	CSR_WRITE_4(sc, SK_RAP, SK_WIN(reg));
-	CSR_WRITE_4(sc, SK_WIN_BASE + SK_REG(reg), val);
-#else
-	CSR_WRITE_4(sc, reg, val);
-#endif
-	return;
-}
-
-static void
-sk_win_write_2(sc, reg, val)
-	struct sk_softc		*sc;
-	int			reg;
-	u_int32_t		val;
-{
-#ifdef SK_USEIOSPACE
-	CSR_WRITE_4(sc, SK_RAP, SK_WIN(reg));
-	CSR_WRITE_2(sc, SK_WIN_BASE + SK_REG(reg), val);
-#else
-	CSR_WRITE_2(sc, reg, val);
-#endif
-	return;
-}
-
-static void
-sk_win_write_1(sc, reg, val)
-	struct sk_softc		*sc;
-	int			reg;
-	u_int32_t		val;
-{
-#ifdef SK_USEIOSPACE
-	CSR_WRITE_4(sc, SK_RAP, SK_WIN(reg));
-	CSR_WRITE_1(sc, SK_WIN_BASE + SK_REG(reg), val);
-#else
-	CSR_WRITE_1(sc, reg, val);
-#endif
-	return;
-}
-
-/*
- * The VPD EEPROM contains Vital Product Data, as suggested in
- * the PCI 2.1 specification. The VPD data is separared into areas
- * denoted by resource IDs. The SysKonnect VPD contains an ID string
- * resource (the name of the adapter), a read-only area resource
- * containing various key/data fields and a read/write area which
- * can be used to store asset management information or log messages.
- * We read the ID string and read-only into buffers attached to
- * the controller softc structure for later use. At the moment,
- * we only use the ID string during skc_attach().
- */
-static u_int8_t
-sk_vpd_readbyte(sc, addr)
-	struct sk_softc		*sc;
-	int			addr;
-{
-	int			i;
-
-	sk_win_write_2(sc, SK_PCI_REG(SK_PCI_VPD_ADDR), addr);
-	for (i = 0; i < SK_TIMEOUT; i++) {
-		DELAY(1);
-		if (sk_win_read_2(sc,
-		    SK_PCI_REG(SK_PCI_VPD_ADDR)) & SK_VPD_FLAG)
-			break;
-	}
-
-	if (i == SK_TIMEOUT)
-		return(0);
-
-	return(sk_win_read_1(sc, SK_PCI_REG(SK_PCI_VPD_DATA)));
-}
-
-static void
-sk_vpd_read_res(sc, res, addr)
-	struct sk_softc		*sc;
-	struct vpd_res		*res;
-	int			addr;
-{
-	int			i;
-	u_int8_t		*ptr;
-
-	ptr = (u_int8_t *)res;
-	for (i = 0; i < sizeof(struct vpd_res); i++)
-		ptr[i] = sk_vpd_readbyte(sc, i + addr);
-
-	return;
-}
-
-static void
-sk_vpd_read(sc)
-	struct sk_softc		*sc;
-{
-	int			pos = 0, i;
-	struct vpd_res		res;
-
-	if (sc->sk_vpd_prodname != NULL)
-		free(sc->sk_vpd_prodname, M_DEVBUF);
-	if (sc->sk_vpd_readonly != NULL)
-		free(sc->sk_vpd_readonly, M_DEVBUF);
-	sc->sk_vpd_prodname = NULL;
-	sc->sk_vpd_readonly = NULL;
-	sc->sk_vpd_readonly_len = 0;
-
-	sk_vpd_read_res(sc, &res, pos);
-
-	/*
-	 * Bail out quietly if the eeprom appears to be missing or empty.
-	 */
-	if (res.vr_id == 0xff && res.vr_len == 0xff && res.vr_pad == 0xff)
-		return;
-
-	if (res.vr_id != VPD_RES_ID) {
-		printf("skc%d: bad VPD resource id: expected %x got %x\n",
-		    sc->sk_unit, VPD_RES_ID, res.vr_id);
-		return;
-	}
-
-	pos += sizeof(res);
-	sc->sk_vpd_prodname = malloc(res.vr_len + 1, M_DEVBUF, M_NOWAIT);
-	if (sc->sk_vpd_prodname != NULL) {
-		for (i = 0; i < res.vr_len; i++)
-			sc->sk_vpd_prodname[i] = sk_vpd_readbyte(sc, i + pos);
-		sc->sk_vpd_prodname[i] = '\0';
-	}
-	pos += res.vr_len;
-
-	sk_vpd_read_res(sc, &res, pos);
-
-	if (res.vr_id != VPD_RES_READ) {
-		printf("skc%d: bad VPD resource id: expected %x got %x\n",
-		    sc->sk_unit, VPD_RES_READ, res.vr_id);
-		return;
-	}
-
-	pos += sizeof(res);
-	sc->sk_vpd_readonly = malloc(res.vr_len, M_DEVBUF, M_NOWAIT);
-	for (i = 0; i < res.vr_len; i++)
-		sc->sk_vpd_readonly[i] = sk_vpd_readbyte(sc, i + pos);
-	sc->sk_vpd_readonly_len = res.vr_len;
-
-	return;
-}
-
-static int
-sk_miibus_readreg(dev, phy, reg)
-	device_t		dev;
-	int			phy, reg;
-{
-	struct sk_if_softc	*sc_if;
-
-	sc_if = device_get_softc(dev);
-
-	switch(sc_if->sk_softc->sk_type) {
-	case SK_GENESIS:
-		return(sk_xmac_miibus_readreg(sc_if, phy, reg));
-	case SK_YUKON:
-	case SK_YUKON_LITE:
-	case SK_YUKON_LP:
-		return(sk_marv_miibus_readreg(sc_if, phy, reg));
-	}
-
-	return(0);
-}
-
-static int
-sk_miibus_writereg(dev, phy, reg, val)
-	device_t		dev;
-	int			phy, reg, val;
-{
-	struct sk_if_softc	*sc_if;
-
-	sc_if = device_get_softc(dev);
-
-	switch(sc_if->sk_softc->sk_type) {
-	case SK_GENESIS:
-		return(sk_xmac_miibus_writereg(sc_if, phy, reg, val));
-	case SK_YUKON:
-	case SK_YUKON_LITE:
-	case SK_YUKON_LP:
-		return(sk_marv_miibus_writereg(sc_if, phy, reg, val));
-	}
-
-	return(0);
-}
-
-static void
-sk_miibus_statchg(dev)
-	device_t		dev;
-{
-	struct sk_if_softc	*sc_if;
-
-	sc_if = device_get_softc(dev);
-
-	switch(sc_if->sk_softc->sk_type) {
-	case SK_GENESIS:
-		sk_xmac_miibus_statchg(sc_if);
-		break;
-	case SK_YUKON:
-	case SK_YUKON_LITE:
-	case SK_YUKON_LP:
-		sk_marv_miibus_statchg(sc_if);
-		break;
-	}
-
-	return;
-}
-
-static int
-sk_xmac_miibus_readreg(sc_if, phy, reg)
-	struct sk_if_softc	*sc_if;
-	int			phy, reg;
-{
-	int			i;
-
-	if (sc_if->sk_phytype == SK_PHYTYPE_XMAC && phy != 0)
-		return(0);
-
-	SK_IF_LOCK(sc_if);
-	SK_XM_WRITE_2(sc_if, XM_PHY_ADDR, reg|(phy << 8));
-	SK_XM_READ_2(sc_if, XM_PHY_DATA);
-	if (sc_if->sk_phytype != SK_PHYTYPE_XMAC) {
-		for (i = 0; i < SK_TIMEOUT; i++) {
-			DELAY(1);
-			if (SK_XM_READ_2(sc_if, XM_MMUCMD) &
-			    XM_MMUCMD_PHYDATARDY)
-				break;
-		}
-
-		if (i == SK_TIMEOUT) {
-			printf("sk%d: phy failed to come ready\n",
-			    sc_if->sk_unit);
-			SK_IF_UNLOCK(sc_if);
-			return(0);
-		}
-	}
-	DELAY(1);
-	i = SK_XM_READ_2(sc_if, XM_PHY_DATA);
-	SK_IF_UNLOCK(sc_if);
-	return(i);
-}
-
-static int
-sk_xmac_miibus_writereg(sc_if, phy, reg, val)
-	struct sk_if_softc	*sc_if;
-	int			phy, reg, val;
-{
-	int			i;
-
-	SK_IF_LOCK(sc_if);
-	SK_XM_WRITE_2(sc_if, XM_PHY_ADDR, reg|(phy << 8));
-	for (i = 0; i < SK_TIMEOUT; i++) {
-		if (!(SK_XM_READ_2(sc_if, XM_MMUCMD) & XM_MMUCMD_PHYBUSY))
-			break;
-	}
-
-	if (i == SK_TIMEOUT) {
-		printf("sk%d: phy failed to come ready\n", sc_if->sk_unit);
-		SK_IF_UNLOCK(sc_if);
-		return(ETIMEDOUT);
-	}
-
-	SK_XM_WRITE_2(sc_if, XM_PHY_DATA, val);
-	for (i = 0; i < SK_TIMEOUT; i++) {
-		DELAY(1);
-		if (!(SK_XM_READ_2(sc_if, XM_MMUCMD) & XM_MMUCMD_PHYBUSY))
-			break;
-	}
-	SK_IF_UNLOCK(sc_if);
-	if (i == SK_TIMEOUT)
-		printf("sk%d: phy write timed out\n", sc_if->sk_unit);
-
-	return(0);
-}
-
-static void
-sk_xmac_miibus_statchg(sc_if)
-	struct sk_if_softc	*sc_if;
-{
-	struct mii_data		*mii;
-
-	mii = device_get_softc(sc_if->sk_miibus);
-
-	SK_IF_LOCK(sc_if);
-	/*
-	 * If this is a GMII PHY, manually set the XMAC's
-	 * duplex mode accordingly.
-	 */
-	if (sc_if->sk_phytype != SK_PHYTYPE_XMAC) {
-		if ((mii->mii_media_active & IFM_GMASK) == IFM_FDX) {
-			SK_XM_SETBIT_2(sc_if, XM_MMUCMD, XM_MMUCMD_GMIIFDX);
-		} else {
-			SK_XM_CLRBIT_2(sc_if, XM_MMUCMD, XM_MMUCMD_GMIIFDX);
-		}
-	}
-	SK_IF_UNLOCK(sc_if);
-
-	return;
-}
-
-static int
-sk_marv_miibus_readreg(sc_if, phy, reg)
-	struct sk_if_softc	*sc_if;
-	int			phy, reg;
-{
-	u_int16_t		val;
-	int			i;
-
-	if (phy != 0 ||
-	    (sc_if->sk_phytype != SK_PHYTYPE_MARV_COPPER &&
-	     sc_if->sk_phytype != SK_PHYTYPE_MARV_FIBER)) {
-		return(0);
-	}
-
-	SK_IF_LOCK(sc_if);
-        SK_YU_WRITE_2(sc_if, YUKON_SMICR, YU_SMICR_PHYAD(phy) |
-		      YU_SMICR_REGAD(reg) | YU_SMICR_OP_READ);
-        
-	for (i = 0; i < SK_TIMEOUT; i++) {
-		DELAY(1);
-		val = SK_YU_READ_2(sc_if, YUKON_SMICR);
-		if (val & YU_SMICR_READ_VALID)
-			break;
-	}
-
-	if (i == SK_TIMEOUT) {
-		printf("sk%d: phy failed to come ready\n",
-		    sc_if->sk_unit);
-		SK_IF_UNLOCK(sc_if);
-		return(0);
-	}
-        
-	val = SK_YU_READ_2(sc_if, YUKON_SMIDR);
-	SK_IF_UNLOCK(sc_if);
-
-	return(val);
-}
-
-static int
-sk_marv_miibus_writereg(sc_if, phy, reg, val)
-	struct sk_if_softc	*sc_if;
-	int			phy, reg, val;
-{
-	int			i;
-
-	SK_IF_LOCK(sc_if);
-	SK_YU_WRITE_2(sc_if, YUKON_SMIDR, val);
-	SK_YU_WRITE_2(sc_if, YUKON_SMICR, YU_SMICR_PHYAD(phy) |
-		      YU_SMICR_REGAD(reg) | YU_SMICR_OP_WRITE);
-
-	for (i = 0; i < SK_TIMEOUT; i++) {
-		DELAY(1);
-		if (SK_YU_READ_2(sc_if, YUKON_SMICR) & YU_SMICR_BUSY)
-			break;
-	}
-	SK_IF_UNLOCK(sc_if);
-
-	return(0);
-}
-
-static void
-sk_marv_miibus_statchg(sc_if)
-	struct sk_if_softc	*sc_if;
-{
-	return;
-}
-
-#define HASH_BITS		6
-
-static u_int32_t
-sk_xmchash(addr)
-	const uint8_t *addr;
-{
-	uint32_t crc;
-
-	/* Compute CRC for the address value. */
-	crc = ether_crc32_le(addr, ETHER_ADDR_LEN);
-
-	return (~crc & ((1 << HASH_BITS) - 1));
-}
-
-/* gmchash is just a big endian crc */
-static u_int32_t
-sk_gmchash(addr)
-	const uint8_t *addr;
-{
-	uint32_t crc;
-
-	/* Compute CRC for the address value. */
-	crc = ether_crc32_be(addr, ETHER_ADDR_LEN);
-
-	return (crc & ((1 << HASH_BITS) - 1));
-}
-
-static void
-sk_setfilt(sc_if, addr, slot)
-	struct sk_if_softc	*sc_if;
-	caddr_t			addr;
-	int			slot;
-{
-	int			base;
-
-	base = XM_RXFILT_ENTRY(slot);
-
-	SK_XM_WRITE_2(sc_if, base, *(u_int16_t *)(&addr[0]));
-	SK_XM_WRITE_2(sc_if, base + 2, *(u_int16_t *)(&addr[2]));
-	SK_XM_WRITE_2(sc_if, base + 4, *(u_int16_t *)(&addr[4]));
-
-	return;
-}
-
-static void
-sk_setmulti(sc_if)
-	struct sk_if_softc	*sc_if;
-{
-	struct sk_softc		*sc = sc_if->sk_softc;
-	struct ifnet		*ifp = sc_if->sk_ifp;
-	u_int32_t		hashes[2] = { 0, 0 };
-	int			h = 0, i;
-	struct ifmultiaddr	*ifma;
-	u_int8_t		dummy[] = { 0, 0, 0, 0, 0 ,0 };
-
-	SK_IF_LOCK_ASSERT(sc_if);
-
-	/* First, zot all the existing filters. */
-	switch(sc->sk_type) {
-	case SK_GENESIS:
-		for (i = 1; i < XM_RXFILT_MAX; i++)
-			sk_setfilt(sc_if, (caddr_t)&dummy, i);
-
-		SK_XM_WRITE_4(sc_if, XM_MAR0, 0);
-		SK_XM_WRITE_4(sc_if, XM_MAR2, 0);
-		break;
-	case SK_YUKON:
-	case SK_YUKON_LITE:
-	case SK_YUKON_LP:
-		SK_YU_WRITE_2(sc_if, YUKON_MCAH1, 0);
-		SK_YU_WRITE_2(sc_if, YUKON_MCAH2, 0);
-		SK_YU_WRITE_2(sc_if, YUKON_MCAH3, 0);
-		SK_YU_WRITE_2(sc_if, YUKON_MCAH4, 0);
-		break;
-	}
-
-	/* Now program new ones. */
-	if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
-		hashes[0] = 0xFFFFFFFF;
-		hashes[1] = 0xFFFFFFFF;
-	} else {
-		i = 1;
-		IF_ADDR_LOCK(ifp);
-		TAILQ_FOREACH_REVERSE(ifma, &ifp->if_multiaddrs, ifmultihead, ifma_link) {
-			if (ifma->ifma_addr->sa_family != AF_LINK)
-				continue;
-			/*
-			 * Program the first XM_RXFILT_MAX multicast groups
-			 * into the perfect filter. For all others,
-			 * use the hash table.
-			 */
-			if (sc->sk_type == SK_GENESIS && i < XM_RXFILT_MAX) {
-				sk_setfilt(sc_if,
-			LLADDR((struct sockaddr_dl *)ifma->ifma_addr), i);
-				i++;
-				continue;
-			}
-
-			switch(sc->sk_type) {
-			case SK_GENESIS:
-				h = sk_xmchash(
-					LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
-				break;
-			case SK_YUKON:
-			case SK_YUKON_LITE:
-			case SK_YUKON_LP:
-				h = sk_gmchash(
-					LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
-				break;
-			}
-			if (h < 32)
-				hashes[0] |= (1 << h);
-			else
-				hashes[1] |= (1 << (h - 32));
-		}
-		IF_ADDR_UNLOCK(ifp);
-	}
-
-	switch(sc->sk_type) {
-	case SK_GENESIS:
-		SK_XM_SETBIT_4(sc_if, XM_MODE, XM_MODE_RX_USE_HASH|
-			       XM_MODE_RX_USE_PERFECT);
-		SK_XM_WRITE_4(sc_if, XM_MAR0, hashes[0]);
-		SK_XM_WRITE_4(sc_if, XM_MAR2, hashes[1]);
-		break;
-	case SK_YUKON:
-	case SK_YUKON_LITE:
-	case SK_YUKON_LP:
-		SK_YU_WRITE_2(sc_if, YUKON_MCAH1, hashes[0] & 0xffff);
-		SK_YU_WRITE_2(sc_if, YUKON_MCAH2, (hashes[0] >> 16) & 0xffff);
-		SK_YU_WRITE_2(sc_if, YUKON_MCAH3, hashes[1] & 0xffff);
-		SK_YU_WRITE_2(sc_if, YUKON_MCAH4, (hashes[1] >> 16) & 0xffff);
-		break;
-	}
-
-	return;
-}
-
-static void
-sk_setpromisc(sc_if)
-	struct sk_if_softc	*sc_if;
-{
-	struct sk_softc		*sc = sc_if->sk_softc;
-	struct ifnet		*ifp = sc_if->sk_ifp;
-
-	SK_IF_LOCK_ASSERT(sc_if);
-
-	switch(sc->sk_type) {
-	case SK_GENESIS:
-		if (ifp->if_flags & IFF_PROMISC) {
-			SK_XM_SETBIT_4(sc_if, XM_MODE, XM_MODE_RX_PROMISC);
-		} else {
-			SK_XM_CLRBIT_4(sc_if, XM_MODE, XM_MODE_RX_PROMISC);
-		}
-		break;
-	case SK_YUKON:
-	case SK_YUKON_LITE:
-	case SK_YUKON_LP:
-		if (ifp->if_flags & IFF_PROMISC) {
-			SK_YU_CLRBIT_2(sc_if, YUKON_RCR,
-			    YU_RCR_UFLEN | YU_RCR_MUFLEN);
-		} else {
-			SK_YU_SETBIT_2(sc_if, YUKON_RCR,
-			    YU_RCR_UFLEN | YU_RCR_MUFLEN);
-		}
-		break;
-	}
-
-	return;
-}
-
-static int
-sk_init_rx_ring(sc_if)
-	struct sk_if_softc	*sc_if;
-{
-	struct sk_chain_data	*cd = &sc_if->sk_cdata;
-	struct sk_ring_data	*rd = sc_if->sk_rdata;
-	int			i;
-
-	bzero((char *)rd->sk_rx_ring,
-	    sizeof(struct sk_rx_desc) * SK_RX_RING_CNT);
-
-	for (i = 0; i < SK_RX_RING_CNT; i++) {
-		cd->sk_rx_chain[i].sk_desc = &rd->sk_rx_ring[i];
-		if (sk_newbuf(sc_if, &cd->sk_rx_chain[i], NULL) == ENOBUFS)
-			return(ENOBUFS);
-		if (i == (SK_RX_RING_CNT - 1)) {
-			cd->sk_rx_chain[i].sk_next =
-			    &cd->sk_rx_chain[0];
-			rd->sk_rx_ring[i].sk_next = 
-			    vtophys(&rd->sk_rx_ring[0]);
-		} else {
-			cd->sk_rx_chain[i].sk_next =
-			    &cd->sk_rx_chain[i + 1];
-			rd->sk_rx_ring[i].sk_next = 
-			    vtophys(&rd->sk_rx_ring[i + 1]);
-		}
-	}
-
-	sc_if->sk_cdata.sk_rx_prod = 0;
-	sc_if->sk_cdata.sk_rx_cons = 0;
-
-	return(0);
-}
-
-static void
-sk_init_tx_ring(sc_if)
-	struct sk_if_softc	*sc_if;
-{
-	struct sk_chain_data	*cd = &sc_if->sk_cdata;
-	struct sk_ring_data	*rd = sc_if->sk_rdata;
-	int			i;
-
-	bzero((char *)sc_if->sk_rdata->sk_tx_ring,
-	    sizeof(struct sk_tx_desc) * SK_TX_RING_CNT);
-
-	for (i = 0; i < SK_TX_RING_CNT; i++) {
-		cd->sk_tx_chain[i].sk_desc = &rd->sk_tx_ring[i];
-		if (i == (SK_TX_RING_CNT - 1)) {
-			cd->sk_tx_chain[i].sk_next =
-			    &cd->sk_tx_chain[0];
-			rd->sk_tx_ring[i].sk_next = 
-			    vtophys(&rd->sk_tx_ring[0]);
-		} else {
-			cd->sk_tx_chain[i].sk_next =
-			    &cd->sk_tx_chain[i + 1];
-			rd->sk_tx_ring[i].sk_next = 
-			    vtophys(&rd->sk_tx_ring[i + 1]);
-		}
-	}
-
-	sc_if->sk_cdata.sk_tx_prod = 0;
-	sc_if->sk_cdata.sk_tx_cons = 0;
-	sc_if->sk_cdata.sk_tx_cnt = 0;
-
-	return;
-}
-
-static int
-sk_newbuf(sc_if, c, m)
-	struct sk_if_softc	*sc_if;
-	struct sk_chain		*c;
-	struct mbuf		*m;
-{
-	struct mbuf		*m_new = NULL;
-	struct sk_rx_desc	*r;
-
-	if (m == NULL) {
-		caddr_t			*buf = NULL;
-
-		MGETHDR(m_new, M_DONTWAIT, MT_DATA);
-		if (m_new == NULL)
-			return(ENOBUFS);
-
-		/* Allocate the jumbo buffer */
-		buf = sk_jalloc(sc_if);
-		if (buf == NULL) {
-			m_freem(m_new);
-#ifdef SK_VERBOSE
-			printf("sk%d: jumbo allocation failed "
-			    "-- packet dropped!\n", sc_if->sk_unit);
-#endif
-			return(ENOBUFS);
-		}
-
-		/* Attach the buffer to the mbuf */
-		MEXTADD(m_new, buf, SK_JLEN, sk_jfree,
-		    (struct sk_if_softc *)sc_if, 0, EXT_NET_DRV); 
-		m_new->m_data = (void *)buf;
-		m_new->m_pkthdr.len = m_new->m_len = SK_JLEN;
-	} else {
-		/*
-	 	 * We're re-using a previously allocated mbuf;
-		 * be sure to re-init pointers and lengths to
-		 * default values.
-		 */
-		m_new = m;
-		m_new->m_len = m_new->m_pkthdr.len = SK_JLEN;
-		m_new->m_data = m_new->m_ext.ext_buf;
-	}
-
-	/*
-	 * Adjust alignment so packet payload begins on a
-	 * longword boundary. Mandatory for Alpha, useful on
-	 * x86 too.
-	 */
-	m_adj(m_new, ETHER_ALIGN);
-
-	r = c->sk_desc;
-	c->sk_mbuf = m_new;
-	r->sk_data_lo = vtophys(mtod(m_new, caddr_t));
-	r->sk_ctl = m_new->m_len | SK_RXSTAT;
-
-	return(0);
-}
-
-/*
- * Allocate jumbo buffer storage. The SysKonnect adapters support
- * "jumbograms" (9K frames), although SysKonnect doesn't currently
- * use them in their drivers. In order for us to use them, we need
- * large 9K receive buffers, however standard mbuf clusters are only
- * 2048 bytes in size. Consequently, we need to allocate and manage
- * our own jumbo buffer pool. Fortunately, this does not require an
- * excessive amount of additional code.
- */
-static int
-sk_alloc_jumbo_mem(sc_if)
-	struct sk_if_softc	*sc_if;
-{
-	caddr_t			ptr;
-	register int		i;
-	struct sk_jpool_entry   *entry;
-
-	/* Grab a big chunk o' storage. */
-	sc_if->sk_cdata.sk_jumbo_buf = contigmalloc(SK_JMEM, M_DEVBUF,
-	    M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0);
-
-	if (sc_if->sk_cdata.sk_jumbo_buf == NULL) {
-		printf("sk%d: no memory for jumbo buffers!\n", sc_if->sk_unit);
-		return(ENOBUFS);
-	}
-
-	mtx_init(&sc_if->sk_jlist_mtx, "sk_jlist_mtx", NULL, MTX_DEF);
-
-	SLIST_INIT(&sc_if->sk_jfree_listhead);
-	SLIST_INIT(&sc_if->sk_jinuse_listhead);
-
-	/*
-	 * Now divide it up into 9K pieces and save the addresses
-	 * in an array.
-	 */
-	ptr = sc_if->sk_cdata.sk_jumbo_buf;
-	for (i = 0; i < SK_JSLOTS; i++) {
-		sc_if->sk_cdata.sk_jslots[i] = ptr;
-		ptr += SK_JLEN;
-		entry = malloc(sizeof(struct sk_jpool_entry), 
-		    M_DEVBUF, M_NOWAIT);
-		if (entry == NULL) {
-			sk_free_jumbo_mem(sc_if);
-			sc_if->sk_cdata.sk_jumbo_buf = NULL;
-			printf("sk%d: no memory for jumbo "
-			    "buffer queue!\n", sc_if->sk_unit);
-			return(ENOBUFS);
-		}
-		entry->slot = i;
-		SLIST_INSERT_HEAD(&sc_if->sk_jfree_listhead,
-		    entry, jpool_entries);
-	}
-
-	return(0);
-}
-
-static void
-sk_free_jumbo_mem(sc_if)
-	struct sk_if_softc	*sc_if;
-{
-	struct sk_jpool_entry	*entry;
-
-	SK_JLIST_LOCK(sc_if);
-
-	/* We cannot release external mbuf storage while in use. */
-	if (!SLIST_EMPTY(&sc_if->sk_jinuse_listhead)) {
-		printf("sk%d: will leak jumbo buffer memory!\n", sc_if->sk_unit);
-		SK_JLIST_UNLOCK(sc_if);
-		return;
-	}
-
-	while (!SLIST_EMPTY(&sc_if->sk_jfree_listhead)) {
-		entry = SLIST_FIRST(&sc_if->sk_jfree_listhead);
-		SLIST_REMOVE_HEAD(&sc_if->sk_jfree_listhead, jpool_entries);
-		free(entry, M_DEVBUF);
-	}
-
-	SK_JLIST_UNLOCK(sc_if);
-
-	mtx_destroy(&sc_if->sk_jlist_mtx);
-
-	contigfree(sc_if->sk_cdata.sk_jumbo_buf, SK_JMEM, M_DEVBUF);
-
-	return;
-}
-
-/*
- * Allocate a jumbo buffer.
- */
-static void *
-sk_jalloc(sc_if)
-	struct sk_if_softc	*sc_if;
-{
-	struct sk_jpool_entry   *entry;
-
-	SK_JLIST_LOCK(sc_if);
-
-	entry = SLIST_FIRST(&sc_if->sk_jfree_listhead);
-
-	if (entry == NULL) {
-#ifdef SK_VERBOSE
-		printf("sk%d: no free jumbo buffers\n", sc_if->sk_unit);
-#endif
-		SK_JLIST_UNLOCK(sc_if);
-		return(NULL);
-	}
-
-	SLIST_REMOVE_HEAD(&sc_if->sk_jfree_listhead, jpool_entries);
-	SLIST_INSERT_HEAD(&sc_if->sk_jinuse_listhead, entry, jpool_entries);
-
-	SK_JLIST_UNLOCK(sc_if);
-
-	return(sc_if->sk_cdata.sk_jslots[entry->slot]);
-}
-
-/*
- * Release a jumbo buffer.
- */
-static void
-sk_jfree(buf, args)
-	void			*buf;
-	void			*args;
-{
-	struct sk_if_softc	*sc_if;
-	int		        i;
-	struct sk_jpool_entry   *entry;
-
-	/* Extract the softc struct pointer. */
-	sc_if = (struct sk_if_softc *)args;
-	if (sc_if == NULL)
-		panic("sk_jfree: didn't get softc pointer!");
-
-	SK_JLIST_LOCK(sc_if);
-
-	/* calculate the slot this buffer belongs to */
-	i = ((vm_offset_t)buf
-	     - (vm_offset_t)sc_if->sk_cdata.sk_jumbo_buf) / SK_JLEN;
-
-	if ((i < 0) || (i >= SK_JSLOTS))
-		panic("sk_jfree: asked to free buffer that we don't manage!");
-
-	entry = SLIST_FIRST(&sc_if->sk_jinuse_listhead);
-	if (entry == NULL)
-		panic("sk_jfree: buffer not in use!");
-	entry->slot = i;
-	SLIST_REMOVE_HEAD(&sc_if->sk_jinuse_listhead, jpool_entries);
-	SLIST_INSERT_HEAD(&sc_if->sk_jfree_listhead, entry, jpool_entries);
-	if (SLIST_EMPTY(&sc_if->sk_jinuse_listhead))
-		wakeup(sc_if);
-
-	SK_JLIST_UNLOCK(sc_if);
-	return;
-}
-
-/*
- * Set media options.
- */
-static int
-sk_ifmedia_upd(ifp)
-	struct ifnet		*ifp;
-{
-	struct sk_if_softc	*sc_if = ifp->if_softc;
-	struct mii_data		*mii;
-
-	mii = device_get_softc(sc_if->sk_miibus);
-	sk_init(sc_if);
-	mii_mediachg(mii);
-
-	return(0);
-}
-
-/*
- * Report current media status.
- */
-static void
-sk_ifmedia_sts(ifp, ifmr)
-	struct ifnet		*ifp;
-	struct ifmediareq	*ifmr;
-{
-	struct sk_if_softc	*sc_if;
-	struct mii_data		*mii;
-
-	sc_if = ifp->if_softc;
-	mii = device_get_softc(sc_if->sk_miibus);
-
-	mii_pollstat(mii);
-	ifmr->ifm_active = mii->mii_media_active;
-	ifmr->ifm_status = mii->mii_media_status;
-
-	return;
-}
-
-static int
-sk_ioctl(ifp, command, data)
-	struct ifnet		*ifp;
-	u_long			command;
-	caddr_t			data;
-{
-	struct sk_if_softc	*sc_if = ifp->if_softc;
-	struct ifreq		*ifr = (struct ifreq *) data;
-	int			error = 0;
-	struct mii_data		*mii;
-
-	switch(command) {
-	case SIOCSIFMTU:
-		SK_IF_LOCK(sc_if);
-		if (ifr->ifr_mtu > SK_JUMBO_MTU)
-			error = EINVAL;
-		else {
-			ifp->if_mtu = ifr->ifr_mtu;
-			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
-			sk_init_locked(sc_if);
-		}
-		SK_IF_UNLOCK(sc_if);
-		break;
-	case SIOCSIFFLAGS:
-		SK_IF_LOCK(sc_if);
-		if (ifp->if_flags & IFF_UP) {
-			if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
-				if ((ifp->if_flags ^ sc_if->sk_if_flags)
-				    & IFF_PROMISC) {
-					sk_setpromisc(sc_if);
-					sk_setmulti(sc_if);
-				}
-			} else
-				sk_init_locked(sc_if);
-		} else {
-			if (ifp->if_drv_flags & IFF_DRV_RUNNING)
-				sk_stop(sc_if);
-		}
-		sc_if->sk_if_flags = ifp->if_flags;
-		SK_IF_UNLOCK(sc_if);
-		error = 0;
-		break;
-	case SIOCADDMULTI:
-	case SIOCDELMULTI:
-		SK_IF_LOCK(sc_if);
-		if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
-			sk_setmulti(sc_if);
-			error = 0;
-		}
-		SK_IF_UNLOCK(sc_if);
-		break;
-	case SIOCGIFMEDIA:
-	case SIOCSIFMEDIA:
-		mii = device_get_softc(sc_if->sk_miibus);
-		error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
-		break;
-	default:
-		error = ether_ioctl(ifp, command, data);
-		break;
-	}
-
-	return(error);
-}
-
-/*
- * Probe for a SysKonnect GEnesis chip. Check the PCI vendor and device
- * IDs against our list and return a device name if we find a match.
- */
-static int
-skc_probe(dev)
-	device_t		dev;
-{
-	struct sk_type		*t = sk_devs;
-
-	while(t->sk_name != NULL) {
-		if ((pci_get_vendor(dev) == t->sk_vid) &&
-		    (pci_get_device(dev) == t->sk_did)) {
-			/*
-			 * Only attach to rev. 2 of the Linksys EG1032 adapter.
-			 * Rev. 3 is supported by re(4).
-			 */
-			if ((t->sk_vid == VENDORID_LINKSYS) &&
-				(t->sk_did == DEVICEID_LINKSYS_EG1032) &&
-				(pci_get_subdevice(dev) !=
-				 SUBDEVICEID_LINKSYS_EG1032_REV2)) {
-				t++;
-				continue;
-			}
-			device_set_desc(dev, t->sk_name);
-			return (BUS_PROBE_DEFAULT);
-		}
-		t++;
-	}
-
-	return(ENXIO);
-}
-
-/*
- * Force the GEnesis into reset, then bring it out of reset.
- */
-static void
-sk_reset(sc)
-	struct sk_softc		*sc;
-{
-	CSR_WRITE_2(sc, SK_CSR, SK_CSR_SW_RESET);
-	CSR_WRITE_2(sc, SK_CSR, SK_CSR_MASTER_RESET);
-	if (SK_YUKON_FAMILY(sc->sk_type))
-		CSR_WRITE_2(sc, SK_LINK_CTRL, SK_LINK_RESET_SET);
-
-	DELAY(1000);
-	CSR_WRITE_2(sc, SK_CSR, SK_CSR_SW_UNRESET);
-	DELAY(2);
-	CSR_WRITE_2(sc, SK_CSR, SK_CSR_MASTER_UNRESET);
-	if (SK_YUKON_FAMILY(sc->sk_type))
-		CSR_WRITE_2(sc, SK_LINK_CTRL, SK_LINK_RESET_CLEAR);
-
-	if (sc->sk_type == SK_GENESIS) {
-		/* Configure packet arbiter */
-		sk_win_write_2(sc, SK_PKTARB_CTL, SK_PKTARBCTL_UNRESET);
-		sk_win_write_2(sc, SK_RXPA1_TINIT, SK_PKTARB_TIMEOUT);
-		sk_win_write_2(sc, SK_TXPA1_TINIT, SK_PKTARB_TIMEOUT);
-		sk_win_write_2(sc, SK_RXPA2_TINIT, SK_PKTARB_TIMEOUT);
-		sk_win_write_2(sc, SK_TXPA2_TINIT, SK_PKTARB_TIMEOUT);
-	}
-
-	/* Enable RAM interface */
-	sk_win_write_4(sc, SK_RAMCTL, SK_RAMCTL_UNRESET);
-
-	/*
-         * Configure interrupt moderation. The moderation timer
-	 * defers interrupts specified in the interrupt moderation
-	 * timer mask based on the timeout specified in the interrupt
-	 * moderation timer init register. Each bit in the timer
-	 * register represents 18.825ns, so to specify a timeout in
-	 * microseconds, we have to multiply by 54.
-	 */
-	if (bootverbose)
-		printf("skc%d: interrupt moderation is %d us\n",
-		    sc->sk_unit, sc->sk_int_mod);
-	sk_win_write_4(sc, SK_IMTIMERINIT, SK_IM_USECS(sc->sk_int_mod));
-	sk_win_write_4(sc, SK_IMMR, SK_ISR_TX1_S_EOF|SK_ISR_TX2_S_EOF|
-	    SK_ISR_RX1_EOF|SK_ISR_RX2_EOF);
-	sk_win_write_1(sc, SK_IMTIMERCTL, SK_IMCTL_START);
-
-	return;
-}
-
-static int
-sk_probe(dev)
-	device_t		dev;
-{
-	struct sk_softc		*sc;
-
-	sc = device_get_softc(device_get_parent(dev));
-
-	/*
-	 * Not much to do here. We always know there will be
-	 * at least one XMAC present, and if there are two,
-	 * skc_attach() will create a second device instance
-	 * for us.
-	 */
-	switch (sc->sk_type) {
-	case SK_GENESIS:
-		device_set_desc(dev, "XaQti Corp. XMAC II");
-		break;
-	case SK_YUKON:
-	case SK_YUKON_LITE:
-	case SK_YUKON_LP:
-		device_set_desc(dev, "Marvell Semiconductor, Inc. Yukon");
-		break;
-	}
-
-	return (BUS_PROBE_DEFAULT);
-}
-
-/*
- * Each XMAC chip is attached as a separate logical IP interface.
- * Single port cards will have only one logical interface of course.
- */
-static int
-sk_attach(dev)
-	device_t		dev;
-{
-	struct sk_softc		*sc;
-	struct sk_if_softc	*sc_if;
-	struct ifnet		*ifp;
-	int			i, port, error;
-	u_char			eaddr[6];
-
-	if (dev == NULL)
-		return(EINVAL);
-
-	error = 0;
-	sc_if = device_get_softc(dev);
-	sc = device_get_softc(device_get_parent(dev));
-	port = *(int *)device_get_ivars(dev);
-
-	sc_if->sk_dev = dev;
-	sc_if->sk_unit = device_get_unit(dev);
-	sc_if->sk_port = port;
-	sc_if->sk_softc = sc;
-	sc->sk_if[port] = sc_if;
-	if (port == SK_PORT_A)
-		sc_if->sk_tx_bmu = SK_BMU_TXS_CSR0;
-	if (port == SK_PORT_B)
-		sc_if->sk_tx_bmu = SK_BMU_TXS_CSR1;
-
-	/* Allocate the descriptor queues. */
-	sc_if->sk_rdata = contigmalloc(sizeof(struct sk_ring_data), M_DEVBUF,
-	    M_NOWAIT, M_ZERO, 0xffffffff, PAGE_SIZE, 0);
-
-	if (sc_if->sk_rdata == NULL) {
-		printf("sk%d: no memory for list buffers!\n", sc_if->sk_unit);
-		error = ENOMEM;
-		goto fail;
-	}
-
-	/* Try to allocate memory for jumbo buffers. */
-	if (sk_alloc_jumbo_mem(sc_if)) {
-		printf("sk%d: jumbo buffer allocation failed\n",
-		    sc_if->sk_unit);
-		error = ENOMEM;
-		goto fail;
-	}
-
-	ifp = sc_if->sk_ifp = if_alloc(IFT_ETHER);
-	if (ifp == NULL) {
-		printf("sk%d: can not if_alloc()\n", sc_if->sk_unit);
-		error = ENOSPC;
-		goto fail;
-	}
-	ifp->if_softc = sc_if;
-	if_initname(ifp, device_get_name(dev), device_get_unit(dev));
-	ifp->if_mtu = ETHERMTU;
-	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
-	/*
-	 * The hardware should be ready for VLAN_MTU by default:
-	 * XMAC II has 0x8100 in VLAN Tag Level 1 register initially;
-	 * YU_SMR_MFL_VLAN is set by this driver in Yukon.
-	 */
-	ifp->if_capabilities = ifp->if_capenable = IFCAP_VLAN_MTU;
-	ifp->if_ioctl = sk_ioctl;
-	ifp->if_start = sk_start;
-	ifp->if_watchdog = sk_watchdog;
-	ifp->if_init = sk_init;
-	IFQ_SET_MAXLEN(&ifp->if_snd, SK_TX_RING_CNT - 1);
-	ifp->if_snd.ifq_drv_maxlen = SK_TX_RING_CNT - 1;
-	IFQ_SET_READY(&ifp->if_snd);
-
-	callout_handle_init(&sc_if->sk_tick_ch);
-
-	/*
-	 * Get station address for this interface. Note that
-	 * dual port cards actually come with three station
-	 * addresses: one for each port, plus an extra. The
-	 * extra one is used by the SysKonnect driver software
-	 * as a 'virtual' station address for when both ports
-	 * are operating in failover mode. Currently we don't
-	 * use this extra address.
-	 */
-	SK_LOCK(sc);
-	for (i = 0; i < ETHER_ADDR_LEN; i++)
-		eaddr[i] =
-		    sk_win_read_1(sc, SK_MAC0_0 + (port * 8) + i);
-
-	/*
-	 * Set up RAM buffer addresses. The NIC will have a certain
-	 * amount of SRAM on it, somewhere between 512K and 2MB. We
-	 * need to divide this up a) between the transmitter and
- 	 * receiver and b) between the two XMACs, if this is a
-	 * dual port NIC. Our algotithm is to divide up the memory
-	 * evenly so that everyone gets a fair share.
-	 */
-	if (sk_win_read_1(sc, SK_CONFIG) & SK_CONFIG_SINGLEMAC) {
-		u_int32_t		chunk, val;
-
-		chunk = sc->sk_ramsize / 2;
-		val = sc->sk_rboff / sizeof(u_int64_t);
-		sc_if->sk_rx_ramstart = val;
-		val += (chunk / sizeof(u_int64_t));
-		sc_if->sk_rx_ramend = val - 1;
-		sc_if->sk_tx_ramstart = val;
-		val += (chunk / sizeof(u_int64_t));
-		sc_if->sk_tx_ramend = val - 1;
-	} else {
-		u_int32_t		chunk, val;
-
-		chunk = sc->sk_ramsize / 4;
-		val = (sc->sk_rboff + (chunk * 2 * sc_if->sk_port)) /
-		    sizeof(u_int64_t);
-		sc_if->sk_rx_ramstart = val;
-		val += (chunk / sizeof(u_int64_t));
-		sc_if->sk_rx_ramend = val - 1;
-		sc_if->sk_tx_ramstart = val;
-		val += (chunk / sizeof(u_int64_t));
-		sc_if->sk_tx_ramend = val - 1;
-	}
-
-	/* Read and save PHY type and set PHY address */
-	sc_if->sk_phytype = sk_win_read_1(sc, SK_EPROM1) & 0xF;
-	switch(sc_if->sk_phytype) {
-	case SK_PHYTYPE_XMAC:
-		sc_if->sk_phyaddr = SK_PHYADDR_XMAC;
-		break;
-	case SK_PHYTYPE_BCOM:
-		sc_if->sk_phyaddr = SK_PHYADDR_BCOM;
-		break;
-	case SK_PHYTYPE_MARV_COPPER:
-		sc_if->sk_phyaddr = SK_PHYADDR_MARV;
-		break;
-	default:
-		printf("skc%d: unsupported PHY type: %d\n",
-		    sc->sk_unit, sc_if->sk_phytype);
-		error = ENODEV;
-		SK_UNLOCK(sc);
-		goto fail;
-	}
-
-
-	/*
-	 * Call MI attach routine.  Can't hold locks when calling into ether_*.
-	 */
-	SK_UNLOCK(sc);
-	ether_ifattach(ifp, eaddr);
-	SK_LOCK(sc);
-
-	/*
-	 * Do miibus setup.
-	 */
-	switch (sc->sk_type) {
-	case SK_GENESIS:
-		sk_init_xmac(sc_if);
-		break;
-	case SK_YUKON:
-	case SK_YUKON_LITE:
-	case SK_YUKON_LP:
-		sk_init_yukon(sc_if);
-		break;
-	}
-
-	SK_UNLOCK(sc);
-	if (mii_phy_probe(dev, &sc_if->sk_miibus,
-	    sk_ifmedia_upd, sk_ifmedia_sts)) {
-		printf("skc%d: no PHY found!\n", sc_if->sk_unit);
-		ether_ifdetach(ifp);
-		error = ENXIO;
-		goto fail;
-	}
-
-fail:
-	if (error) {
-		/* Access should be ok even though lock has been dropped */
-		sc->sk_if[port] = NULL;
-		sk_detach(dev);
-	}
-
-	return(error);
-}
-
-/*
- * Attach the interface. Allocate softc structures, do ifmedia
- * setup and ethernet/BPF attach.
- */
-static int
-skc_attach(dev)
-	device_t		dev;
-{
-	struct sk_softc		*sc;
-	int			unit, error = 0, rid, *port;
-	uint8_t			skrs;
-	char			*pname, *revstr;
-
-	sc = device_get_softc(dev);
-	unit = device_get_unit(dev);
-
-	mtx_init(&sc->sk_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
-	    MTX_DEF | MTX_RECURSE);
-	/*
-	 * Map control/status registers.
-	 */
-	pci_enable_busmaster(dev);
-
-	rid = SK_RID;
-	sc->sk_res = bus_alloc_resource_any(dev, SK_RES, &rid, RF_ACTIVE);
-
-	if (sc->sk_res == NULL) {
-		printf("sk%d: couldn't map ports/memory\n", unit);
-		error = ENXIO;
-		goto fail;
-	}
-
-	sc->sk_btag = rman_get_bustag(sc->sk_res);
-	sc->sk_bhandle = rman_get_bushandle(sc->sk_res);
-
-	sc->sk_type = sk_win_read_1(sc, SK_CHIPVER);
-	sc->sk_rev = (sk_win_read_1(sc, SK_CONFIG) >> 4) & 0xf;
-
-	/* Bail out if chip is not recognized. */
-	if (sc->sk_type != SK_GENESIS && !SK_YUKON_FAMILY(sc->sk_type)) {
-		printf("skc%d: unknown device: chipver=%02x, rev=%x\n",
-			unit, sc->sk_type, sc->sk_rev);
-		error = ENXIO;
-		goto fail;
-	}
-
-	/* Allocate interrupt */
-	rid = 0;
-	sc->sk_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
-	    RF_SHAREABLE | RF_ACTIVE);
-
-	if (sc->sk_irq == NULL) {
-		printf("skc%d: couldn't map interrupt\n", unit);
-		error = ENXIO;
-		goto fail;
-	}
-
-	SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
-		SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
-		OID_AUTO, "int_mod", CTLTYPE_INT|CTLFLAG_RW,
-		&sc->sk_int_mod, 0, sysctl_hw_sk_int_mod, "I",
-		"SK interrupt moderation");
-
-	/* Pull in device tunables. */
-	sc->sk_int_mod = SK_IM_DEFAULT;
-	error = resource_int_value(device_get_name(dev), unit,
-		"int_mod", &sc->sk_int_mod);
-	if (error == 0) {
-		if (sc->sk_int_mod < SK_IM_MIN ||
-		    sc->sk_int_mod > SK_IM_MAX) {
-			printf("skc%d: int_mod value out of range; "
-			    "using default: %d\n", unit, SK_IM_DEFAULT);
-			sc->sk_int_mod = SK_IM_DEFAULT;
-		}
-	}
-
-	/* Reset the adapter. */
-	sk_reset(sc);
-
-	sc->sk_unit = unit;
-
-	/* Read and save vital product data from EEPROM. */
-	sk_vpd_read(sc);
-
-	skrs = sk_win_read_1(sc, SK_EPROM0);
-	if (sc->sk_type == SK_GENESIS) {
-		/* Read and save RAM size and RAMbuffer offset */
-		switch(skrs) {
-		case SK_RAMSIZE_512K_64:
-			sc->sk_ramsize = 0x80000;
-			sc->sk_rboff = SK_RBOFF_0;
-			break;
-		case SK_RAMSIZE_1024K_64:
-			sc->sk_ramsize = 0x100000;
-			sc->sk_rboff = SK_RBOFF_80000;
-			break;
-		case SK_RAMSIZE_1024K_128:
-			sc->sk_ramsize = 0x100000;
-			sc->sk_rboff = SK_RBOFF_0;
-			break;
-		case SK_RAMSIZE_2048K_128:
-			sc->sk_ramsize = 0x200000;
-			sc->sk_rboff = SK_RBOFF_0;
-			break;
-		default:
-			printf("skc%d: unknown ram size: %d\n",
-			    sc->sk_unit, skrs);
-			error = ENXIO;
-			goto fail;
-		}
-	} else { /* SK_YUKON_FAMILY */
-		if (skrs == 0x00)
-			sc->sk_ramsize = 0x20000;
-		else
-			sc->sk_ramsize = skrs * (1<<12);
-		sc->sk_rboff = SK_RBOFF_0;
-	}
-
-	/* Read and save physical media type */
-	switch(sk_win_read_1(sc, SK_PMDTYPE)) {
-	case SK_PMD_1000BASESX:
-		sc->sk_pmd = IFM_1000_SX;
-		break;
-	case SK_PMD_1000BASELX:
-		sc->sk_pmd = IFM_1000_LX;
-		break;
-	case SK_PMD_1000BASECX:
-		sc->sk_pmd = IFM_1000_CX;
-		break;
-	case SK_PMD_1000BASETX:
-		sc->sk_pmd = IFM_1000_T;
-		break;
-	default:
-		printf("skc%d: unknown media type: 0x%x\n",
-		    sc->sk_unit, sk_win_read_1(sc, SK_PMDTYPE));
-		error = ENXIO;
-		goto fail;
-	}
-
-	/* Determine whether to name it with VPD PN or just make it up.
-	 * Marvell Yukon VPD PN seems to freqently be bogus. */
-	switch (pci_get_device(dev)) {
-	case DEVICEID_SK_V1:
-	case DEVICEID_BELKIN_5005:
-	case DEVICEID_3COM_3C940:
-	case DEVICEID_LINKSYS_EG1032:
-	case DEVICEID_DLINK_DGE530T:
-		/* Stay with VPD PN. */
-		pname = sc->sk_vpd_prodname;
-		break;
-	case DEVICEID_SK_V2:
-		/* YUKON VPD PN might bear no resemblance to reality. */
-		switch (sc->sk_type) {
-		case SK_GENESIS:
-			/* Stay with VPD PN. */
-			pname = sc->sk_vpd_prodname;
-			break;
-		case SK_YUKON:
-			pname = "Marvell Yukon Gigabit Ethernet";
-			break;
-		case SK_YUKON_LITE:
-			pname = "Marvell Yukon Lite Gigabit Ethernet";
-			break;
-		case SK_YUKON_LP:
-			pname = "Marvell Yukon LP Gigabit Ethernet";
-			break;
-		default:
-			pname = "Marvell Yukon (Unknown) Gigabit Ethernet";
-			break;
-		}
-
-		/* Yukon Lite Rev. A0 needs special test. */
-		if (sc->sk_type == SK_YUKON || sc->sk_type == SK_YUKON_LP) {
-			u_int32_t far;
-			u_int8_t testbyte;
-
-			/* Save flash address register before testing. */
-			far = sk_win_read_4(sc, SK_EP_ADDR);
-
-			sk_win_write_1(sc, SK_EP_ADDR+0x03, 0xff);
-			testbyte = sk_win_read_1(sc, SK_EP_ADDR+0x03);
-
-			if (testbyte != 0x00) {
-				/* Yukon Lite Rev. A0 detected. */
-				sc->sk_type = SK_YUKON_LITE;
-				sc->sk_rev = SK_YUKON_LITE_REV_A0;
-				/* Restore flash address register. */
-				sk_win_write_4(sc, SK_EP_ADDR, far);
-			}
-		}
-		break;
-	default:
-		device_printf(dev, "unknown device: vendor=%04x, device=%04x, "
-			"chipver=%02x, rev=%x\n",
-			pci_get_vendor(dev), pci_get_device(dev),
-			sc->sk_type, sc->sk_rev);
-		error = ENXIO;
-		goto fail;
-	}
-
-	if (sc->sk_type == SK_YUKON_LITE) {
-		switch (sc->sk_rev) {
-		case SK_YUKON_LITE_REV_A0:
-			revstr = "A0";
-			break;
-		case SK_YUKON_LITE_REV_A1:
-			revstr = "A1";
-			break;
-		case SK_YUKON_LITE_REV_A3:
-			revstr = "A3";
-			break;
-		default:
-			revstr = "";
-			break;
-		}
-	} else {
-		revstr = "";
-	}
-
-	/* Announce the product name and more VPD data if there. */
-	device_printf(dev, "%s rev. %s(0x%x)\n",
-		pname != NULL ? pname : "<unknown>", revstr, sc->sk_rev);
-
-	if (bootverbose) {
-		if (sc->sk_vpd_readonly != NULL &&
-		    sc->sk_vpd_readonly_len != 0) {
-			char buf[256];
-			char *dp = sc->sk_vpd_readonly;
-			uint16_t l, len = sc->sk_vpd_readonly_len;
-
-			while (len >= 3) {
-				if ((*dp == 'P' && *(dp+1) == 'N') ||
-				    (*dp == 'E' && *(dp+1) == 'C') ||
-				    (*dp == 'M' && *(dp+1) == 'N') ||
-				    (*dp == 'S' && *(dp+1) == 'N')) {
-					l = 0;
-					while (l < *(dp+2)) {
-						buf[l] = *(dp+3+l);
-						++l;
-					}
-					buf[l] = '\0';
-					device_printf(dev, "%c%c: %s\n",
-					    *dp, *(dp+1), buf);
-					len -= (3 + l);
-					dp += (3 + l);
-				} else {
-					len -= (3 + *(dp+2));
-					dp += (3 + *(dp+2));
-				}
-			}
-		}
-		device_printf(dev, "chip ver  = 0x%02x\n", sc->sk_type);
-		device_printf(dev, "chip rev  = 0x%02x\n", sc->sk_rev);
-		device_printf(dev, "SK_EPROM0 = 0x%02x\n", skrs);
-		device_printf(dev, "SRAM size = 0x%06x\n", sc->sk_ramsize);
-	}
-
-	sc->sk_devs[SK_PORT_A] = device_add_child(dev, "sk", -1);
-	if (sc->sk_devs[SK_PORT_A] == NULL) {
-		device_printf(dev, "failed to add child for PORT_A\n");
-		error = ENXIO;
-		goto fail;
-	}
-	port = malloc(sizeof(int), M_DEVBUF, M_NOWAIT);
-	if (port == NULL) {
-		device_printf(dev, "failed to allocate memory for "
-		    "ivars of PORT_A\n");
-		error = ENXIO;
-		goto fail;
-	}
-	*port = SK_PORT_A;
-	device_set_ivars(sc->sk_devs[SK_PORT_A], port);
-
-	if (!(sk_win_read_1(sc, SK_CONFIG) & SK_CONFIG_SINGLEMAC)) {
-		sc->sk_devs[SK_PORT_B] = device_add_child(dev, "sk", -1);
-		if (sc->sk_devs[SK_PORT_B] == NULL) {
-			device_printf(dev, "failed to add child for PORT_B\n");
-			error = ENXIO;
-			goto fail;
-		}
-		port = malloc(sizeof(int), M_DEVBUF, M_NOWAIT);
-		if (port == NULL) {
-			device_printf(dev, "failed to allocate memory for "
-			    "ivars of PORT_B\n");
-			error = ENXIO;
-			goto fail;
-		}
-		*port = SK_PORT_B;
-		device_set_ivars(sc->sk_devs[SK_PORT_B], port);
-	}
-
-	/* Turn on the 'driver is loaded' LED. */
-	CSR_WRITE_2(sc, SK_LED, SK_LED_GREEN_ON);
-
-	error = bus_generic_attach(dev);
-	if (error) {
-		device_printf(dev, "failed to attach port(s)\n");
-		goto fail;
-	}
-
-	/* Hook interrupt last to avoid having to lock softc */
-	error = bus_setup_intr(dev, sc->sk_irq, INTR_TYPE_NET|INTR_MPSAFE,
-	    sk_intr, sc, &sc->sk_intrhand);
-
-	if (error) {
-		printf("skc%d: couldn't set up irq\n", unit);
-		goto fail;
-	}
-
-fail:
-	if (error)
-		skc_detach(dev);
-
-	return(error);
-}
-
-/*
- * Shutdown hardware and free up resources. This can be called any
- * time after the mutex has been initialized. It is called in both
- * the error case in attach and the normal detach case so it needs
- * to be careful about only freeing resources that have actually been
- * allocated.
- */
-static int
-sk_detach(dev)
-	device_t		dev;
-{
-	struct sk_if_softc	*sc_if;
-	struct ifnet		*ifp;
-
-	sc_if = device_get_softc(dev);
-	KASSERT(mtx_initialized(&sc_if->sk_softc->sk_mtx),
-	    ("sk mutex not initialized in sk_detach"));
-	SK_IF_LOCK(sc_if);
-
-	ifp = sc_if->sk_ifp;
-	/* These should only be active if attach_xmac succeeded */
-	if (device_is_attached(dev)) {
-		sk_stop(sc_if);
-		/* Can't hold locks while calling detach */
-		SK_IF_UNLOCK(sc_if);
-		ether_ifdetach(ifp);
-		SK_IF_LOCK(sc_if);
-	}
-	if (ifp)
-		if_free(ifp);
-	/*
-	 * We're generally called from skc_detach() which is using
-	 * device_delete_child() to get to here. It's already trashed
-	 * miibus for us, so don't do it here or we'll panic.
-	 */
-	/*
-	if (sc_if->sk_miibus != NULL)
-		device_delete_child(dev, sc_if->sk_miibus);
-	*/
-	bus_generic_detach(dev);
-	if (sc_if->sk_cdata.sk_jumbo_buf != NULL)
-		sk_free_jumbo_mem(sc_if);
-	if (sc_if->sk_rdata != NULL) {
-		contigfree(sc_if->sk_rdata, sizeof(struct sk_ring_data),
-		    M_DEVBUF);
-	}
-	SK_IF_UNLOCK(sc_if);
-
-	return(0);
-}
-
-static int
-skc_detach(dev)
-	device_t		dev;
-{
-	struct sk_softc		*sc;
-
-	sc = device_get_softc(dev);
-	KASSERT(mtx_initialized(&sc->sk_mtx), ("sk mutex not initialized"));
-
-	if (device_is_alive(dev)) {
-		if (sc->sk_devs[SK_PORT_A] != NULL) {
-			free(device_get_ivars(sc->sk_devs[SK_PORT_A]), M_DEVBUF);
-			device_delete_child(dev, sc->sk_devs[SK_PORT_A]);
-		}
-		if (sc->sk_devs[SK_PORT_B] != NULL) {
-			free(device_get_ivars(sc->sk_devs[SK_PORT_B]), M_DEVBUF);
-			device_delete_child(dev, sc->sk_devs[SK_PORT_B]);
-		}
-		bus_generic_detach(dev);
-	}
-
-	if (sc->sk_vpd_prodname != NULL)
-		free(sc->sk_vpd_prodname, M_DEVBUF);
-	if (sc->sk_vpd_readonly != NULL)
-		free(sc->sk_vpd_readonly, M_DEVBUF);
-
-	if (sc->sk_intrhand)
-		bus_teardown_intr(dev, sc->sk_irq, sc->sk_intrhand);
-	if (sc->sk_irq)
-		bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sk_irq);
-	if (sc->sk_res)
-		bus_release_resource(dev, SK_RES, SK_RID, sc->sk_res);
-
-	mtx_destroy(&sc->sk_mtx);
-
-	return(0);
-}
-
-static int
-sk_encap(sc_if, m_head, txidx)
-        struct sk_if_softc	*sc_if;
-        struct mbuf		*m_head;
-        u_int32_t		*txidx;
-{
-	struct sk_tx_desc	*f = NULL;
-	struct mbuf		*m;
-	u_int32_t		frag, cur, cnt = 0;
-
-	SK_IF_LOCK_ASSERT(sc_if);
-
-	m = m_head;
-	cur = frag = *txidx;
-
-	/*
-	 * Start packing the mbufs in this chain into
-	 * the fragment pointers. Stop when we run out
-	 * of fragments or hit the end of the mbuf chain.
-	 */
-	for (m = m_head; m != NULL; m = m->m_next) {
-		if (m->m_len != 0) {
-			if ((SK_TX_RING_CNT -
-			    (sc_if->sk_cdata.sk_tx_cnt + cnt)) < 2)
-				return(ENOBUFS);
-			f = &sc_if->sk_rdata->sk_tx_ring[frag];
-			f->sk_data_lo = vtophys(mtod(m, vm_offset_t));
-			f->sk_ctl = m->m_len | SK_OPCODE_DEFAULT;
-			if (cnt == 0)
-				f->sk_ctl |= SK_TXCTL_FIRSTFRAG;
-			else
-				f->sk_ctl |= SK_TXCTL_OWN;
-			cur = frag;
-			SK_INC(frag, SK_TX_RING_CNT);
-			cnt++;
-		}
-	}
-
-	if (m != NULL)
-		return(ENOBUFS);
-
-	sc_if->sk_rdata->sk_tx_ring[cur].sk_ctl |=
-		SK_TXCTL_LASTFRAG|SK_TXCTL_EOF_INTR;
-	sc_if->sk_cdata.sk_tx_chain[cur].sk_mbuf = m_head;
-	sc_if->sk_rdata->sk_tx_ring[*txidx].sk_ctl |= SK_TXCTL_OWN;
-	sc_if->sk_cdata.sk_tx_cnt += cnt;
-
-	*txidx = frag;
-
-	return(0);
-}
-
-static void
-sk_start(ifp)
-	struct ifnet		*ifp;
-{
-	struct sk_if_softc *sc_if;
-
-	sc_if = ifp->if_softc;
-
-	SK_IF_LOCK(sc_if);
-	sk_start_locked(ifp);
-	SK_IF_UNLOCK(sc_if);
-
-	return;
-}
-
-static void
-sk_start_locked(ifp)
-	struct ifnet		*ifp;
-{
-        struct sk_softc		*sc;
-        struct sk_if_softc	*sc_if;
-        struct mbuf		*m_head = NULL;
-        u_int32_t		idx;
-
-	sc_if = ifp->if_softc;
-	sc = sc_if->sk_softc;
-
-	SK_IF_LOCK_ASSERT(sc_if);
-
-	idx = sc_if->sk_cdata.sk_tx_prod;
-
-	while(sc_if->sk_cdata.sk_tx_chain[idx].sk_mbuf == NULL) {
-		IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
-		if (m_head == NULL)
-			break;
-
-		/*
-		 * Pack the data into the transmit ring. If we
-		 * don't have room, set the OACTIVE flag and wait
-		 * for the NIC to drain the ring.
-		 */
-		if (sk_encap(sc_if, m_head, &idx)) {
-			IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
-			ifp->if_drv_flags |= IFF_DRV_OACTIVE;
-			break;
-		}
-
-		/*
-		 * If there's a BPF listener, bounce a copy of this frame
-		 * to him.
-		 */
-		BPF_MTAP(ifp, m_head);
-	}
-
-	/* Transmit */
-	if (idx != sc_if->sk_cdata.sk_tx_prod) {
-		sc_if->sk_cdata.sk_tx_prod = idx;
-		CSR_WRITE_4(sc, sc_if->sk_tx_bmu, SK_TXBMU_TX_START);
-
-		/* Set a timeout in case the chip goes out to lunch. */
-		ifp->if_timer = 5;
-	}
-
-	return;
-}
-
-
-static void
-sk_watchdog(ifp)
-	struct ifnet		*ifp;
-{
-	struct sk_if_softc	*sc_if;
-
-	sc_if = ifp->if_softc;
-
-	printf("sk%d: watchdog timeout\n", sc_if->sk_unit);
-	SK_IF_LOCK(sc_if);
-	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
-	sk_init_locked(sc_if);
-	SK_IF_UNLOCK(sc_if);
-
-	return;
-}
-
-static void
-skc_shutdown(dev)
-	device_t		dev;
-{
-	struct sk_softc		*sc;
-
-	sc = device_get_softc(dev);
-	SK_LOCK(sc);
-
-	/* Turn off the 'driver is loaded' LED. */
-	CSR_WRITE_2(sc, SK_LED, SK_LED_GREEN_OFF);
-
-	/*
-	 * Reset the GEnesis controller. Doing this should also
-	 * assert the resets on the attached XMAC(s).
-	 */
-	sk_reset(sc);
-	SK_UNLOCK(sc);
-
-	return;
-}
-
-static void
-sk_rxeof(sc_if)
-	struct sk_if_softc	*sc_if;
-{
-	struct sk_softc		*sc;
-	struct mbuf		*m;
-	struct ifnet		*ifp;
-	struct sk_chain		*cur_rx;
-	int			total_len = 0;
-	int			i;
-	u_int32_t		rxstat;
-
-	sc = sc_if->sk_softc;
-	ifp = sc_if->sk_ifp;
-	i = sc_if->sk_cdata.sk_rx_prod;
-	cur_rx = &sc_if->sk_cdata.sk_rx_chain[i];
-
-	SK_LOCK_ASSERT(sc);
-
-	while(!(sc_if->sk_rdata->sk_rx_ring[i].sk_ctl & SK_RXCTL_OWN)) {
-
-		cur_rx = &sc_if->sk_cdata.sk_rx_chain[i];
-		rxstat = sc_if->sk_rdata->sk_rx_ring[i].sk_xmac_rxstat;
-		m = cur_rx->sk_mbuf;
-		cur_rx->sk_mbuf = NULL;
-		total_len = SK_RXBYTES(sc_if->sk_rdata->sk_rx_ring[i].sk_ctl);
-		SK_INC(i, SK_RX_RING_CNT);
-
-		if (rxstat & XM_RXSTAT_ERRFRAME) {
-			ifp->if_ierrors++;
-			sk_newbuf(sc_if, cur_rx, m);
-			continue;
-		}
-
-		/*
-		 * Try to allocate a new jumbo buffer. If that
-		 * fails, copy the packet to mbufs and put the
-		 * jumbo buffer back in the ring so it can be
-		 * re-used. If allocating mbufs fails, then we
-		 * have to drop the packet.
-		 */
-		if (sk_newbuf(sc_if, cur_rx, NULL) == ENOBUFS) {
-			struct mbuf		*m0;
-			m0 = m_devget(mtod(m, char *), total_len, ETHER_ALIGN,
-			    ifp, NULL);
-			sk_newbuf(sc_if, cur_rx, m);
-			if (m0 == NULL) {
-				printf("sk%d: no receive buffers "
-				    "available -- packet dropped!\n",
-				    sc_if->sk_unit);
-				ifp->if_ierrors++;
-				continue;
-			}
-			m = m0;
-		} else {
-			m->m_pkthdr.rcvif = ifp;
-			m->m_pkthdr.len = m->m_len = total_len;
-		}
-
-		ifp->if_ipackets++;
-		SK_UNLOCK(sc);
-		(*ifp->if_input)(ifp, m);
-		SK_LOCK(sc);
-	}
-
-	sc_if->sk_cdata.sk_rx_prod = i;
-
-	return;
-}
-
-static void
-sk_txeof(sc_if)
-	struct sk_if_softc	*sc_if;
-{
-	struct sk_softc		*sc;
-	struct sk_tx_desc	*cur_tx;
-	struct ifnet		*ifp;
-	u_int32_t		idx;
-
-	sc = sc_if->sk_softc;
-	ifp = sc_if->sk_ifp;
-
-	/*
-	 * Go through our tx ring and free mbufs for those
-	 * frames that have been sent.
-	 */
-	idx = sc_if->sk_cdata.sk_tx_cons;
-	while(idx != sc_if->sk_cdata.sk_tx_prod) {
-		cur_tx = &sc_if->sk_rdata->sk_tx_ring[idx];
-		if (cur_tx->sk_ctl & SK_TXCTL_OWN)
-			break;
-		if (cur_tx->sk_ctl & SK_TXCTL_LASTFRAG)
-			ifp->if_opackets++;
-		if (sc_if->sk_cdata.sk_tx_chain[idx].sk_mbuf != NULL) {
-			m_freem(sc_if->sk_cdata.sk_tx_chain[idx].sk_mbuf);
-			sc_if->sk_cdata.sk_tx_chain[idx].sk_mbuf = NULL;
-		}
-		sc_if->sk_cdata.sk_tx_cnt--;
-		SK_INC(idx, SK_TX_RING_CNT);
-	}
-
-	if (sc_if->sk_cdata.sk_tx_cnt == 0) {
-		ifp->if_timer = 0;
-	} else /* nudge chip to keep tx ring moving */
-		CSR_WRITE_4(sc, sc_if->sk_tx_bmu, SK_TXBMU_TX_START);
-
-	if (sc_if->sk_cdata.sk_tx_cnt < SK_TX_RING_CNT - 2)
-		ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
-
-	sc_if->sk_cdata.sk_tx_cons = idx;
-}
-
-static void
-sk_tick(xsc_if)
-	void			*xsc_if;
-{
-	struct sk_if_softc	*sc_if;
-	struct mii_data		*mii;
-	struct ifnet		*ifp;
-	int			i;
-
-	sc_if = xsc_if;
-	SK_IF_LOCK(sc_if);
-	ifp = sc_if->sk_ifp;
-	mii = device_get_softc(sc_if->sk_miibus);
-
-	if (!(ifp->if_flags & IFF_UP)) {
-		SK_IF_UNLOCK(sc_if);
-		return;
-	}
-
-	if (sc_if->sk_phytype == SK_PHYTYPE_BCOM) {
-		sk_intr_bcom(sc_if);
-		SK_IF_UNLOCK(sc_if);
-		return;
-	}
-
-	/*
-	 * According to SysKonnect, the correct way to verify that
-	 * the link has come back up is to poll bit 0 of the GPIO
-	 * register three times. This pin has the signal from the
-	 * link_sync pin connected to it; if we read the same link
-	 * state 3 times in a row, we know the link is up.
-	 */
-	for (i = 0; i < 3; i++) {
-		if (SK_XM_READ_2(sc_if, XM_GPIO) & XM_GPIO_GP0_SET)
-			break;
-	}
-
-	if (i != 3) {
-		sc_if->sk_tick_ch = timeout(sk_tick, sc_if, hz);
-		SK_IF_UNLOCK(sc_if);
-		return;
-	}
-
-	/* Turn the GP0 interrupt back on. */
-	SK_XM_CLRBIT_2(sc_if, XM_IMR, XM_IMR_GP0_SET);
-	SK_XM_READ_2(sc_if, XM_ISR);
-	mii_tick(mii);
-	untimeout(sk_tick, sc_if, sc_if->sk_tick_ch);
-
-	SK_IF_UNLOCK(sc_if);
-	return;
-}
-
-static void
-sk_intr_bcom(sc_if)
-	struct sk_if_softc	*sc_if;
-{
-	struct mii_data		*mii;
-	struct ifnet		*ifp;
-	int			status;
-	mii = device_get_softc(sc_if->sk_miibus);
-	ifp = sc_if->sk_ifp;
-
-	SK_XM_CLRBIT_2(sc_if, XM_MMUCMD, XM_MMUCMD_TX_ENB|XM_MMUCMD_RX_ENB);
-
-	/*
-	 * Read the PHY interrupt register to make sure
-	 * we clear any pending interrupts.
-	 */
-	status = sk_xmac_miibus_readreg(sc_if, SK_PHYADDR_BCOM, BRGPHY_MII_ISR);
-
-	if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
-		sk_init_xmac(sc_if);
-		return;
-	}
-
-	if (status & (BRGPHY_ISR_LNK_CHG|BRGPHY_ISR_AN_PR)) {
-		int			lstat;
-		lstat = sk_xmac_miibus_readreg(sc_if, SK_PHYADDR_BCOM,
-		    BRGPHY_MII_AUXSTS);
-
-		if (!(lstat & BRGPHY_AUXSTS_LINK) && sc_if->sk_link) {
-			mii_mediachg(mii);
-			/* Turn off the link LED. */
-			SK_IF_WRITE_1(sc_if, 0,
-			    SK_LINKLED1_CTL, SK_LINKLED_OFF);
-			sc_if->sk_link = 0;
-		} else if (status & BRGPHY_ISR_LNK_CHG) {
-			sk_xmac_miibus_writereg(sc_if, SK_PHYADDR_BCOM,
-	    		    BRGPHY_MII_IMR, 0xFF00);
-			mii_tick(mii);
-			sc_if->sk_link = 1;
-			/* Turn on the link LED. */
-			SK_IF_WRITE_1(sc_if, 0, SK_LINKLED1_CTL,
-			    SK_LINKLED_ON|SK_LINKLED_LINKSYNC_OFF|
-			    SK_LINKLED_BLINK_OFF);
-		} else {
-			mii_tick(mii);
-			sc_if->sk_tick_ch = timeout(sk_tick, sc_if, hz);
-		}
-	}
-
-	SK_XM_SETBIT_2(sc_if, XM_MMUCMD, XM_MMUCMD_TX_ENB|XM_MMUCMD_RX_ENB);
-
-	return;
-}
-
-static void
-sk_intr_xmac(sc_if)
-	struct sk_if_softc	*sc_if;
-{
-	struct sk_softc		*sc;
-	u_int16_t		status;
-
-	sc = sc_if->sk_softc;
-	status = SK_XM_READ_2(sc_if, XM_ISR);
-
-	/*
-	 * Link has gone down. Start MII tick timeout to
-	 * watch for link resync.
-	 */
-	if (sc_if->sk_phytype == SK_PHYTYPE_XMAC) {
-		if (status & XM_ISR_GP0_SET) {
-			SK_XM_SETBIT_2(sc_if, XM_IMR, XM_IMR_GP0_SET);
-			sc_if->sk_tick_ch = timeout(sk_tick, sc_if, hz);
-		}
-
-		if (status & XM_ISR_AUTONEG_DONE) {
-			sc_if->sk_tick_ch = timeout(sk_tick, sc_if, hz);
-		}
-	}
-
-	if (status & XM_IMR_TX_UNDERRUN)
-		SK_XM_SETBIT_4(sc_if, XM_MODE, XM_MODE_FLUSH_TXFIFO);
-
-	if (status & XM_IMR_RX_OVERRUN)
-		SK_XM_SETBIT_4(sc_if, XM_MODE, XM_MODE_FLUSH_RXFIFO);
-
-	status = SK_XM_READ_2(sc_if, XM_ISR);
-
-	return;
-}
-
-static void
-sk_intr_yukon(sc_if)
-	struct sk_if_softc	*sc_if;
-{
-	int status;
-
-	status = SK_IF_READ_2(sc_if, 0, SK_GMAC_ISR);
-
-	return;
-}
-
-static void
-sk_intr(xsc)
-	void			*xsc;
-{
-	struct sk_softc		*sc = xsc;
-	struct sk_if_softc	*sc_if0 = NULL, *sc_if1 = NULL;
-	struct ifnet		*ifp0 = NULL, *ifp1 = NULL;
-	u_int32_t		status;
-
-	SK_LOCK(sc);
-
-	sc_if0 = sc->sk_if[SK_PORT_A];
-	sc_if1 = sc->sk_if[SK_PORT_B];
-
-	if (sc_if0 != NULL)
-		ifp0 = sc_if0->sk_ifp;
-	if (sc_if1 != NULL)
-		ifp1 = sc_if1->sk_ifp;
-
-	for (;;) {
-		status = CSR_READ_4(sc, SK_ISSR);
-		if (!(status & sc->sk_intrmask))
-			break;
-
-		/* Handle receive interrupts first. */
-		if (status & SK_ISR_RX1_EOF) {
-			sk_rxeof(sc_if0);
-			CSR_WRITE_4(sc, SK_BMU_RX_CSR0,
-			    SK_RXBMU_CLR_IRQ_EOF|SK_RXBMU_RX_START);
-		}
-		if (status & SK_ISR_RX2_EOF) {
-			sk_rxeof(sc_if1);
-			CSR_WRITE_4(sc, SK_BMU_RX_CSR1,
-			    SK_RXBMU_CLR_IRQ_EOF|SK_RXBMU_RX_START);
-		}
-
-		/* Then transmit interrupts. */
-		if (status & SK_ISR_TX1_S_EOF) {
-			sk_txeof(sc_if0);
-			CSR_WRITE_4(sc, SK_BMU_TXS_CSR0,
-			    SK_TXBMU_CLR_IRQ_EOF);
-		}
-		if (status & SK_ISR_TX2_S_EOF) {
-			sk_txeof(sc_if1);
-			CSR_WRITE_4(sc, SK_BMU_TXS_CSR1,
-			    SK_TXBMU_CLR_IRQ_EOF);
-		}
-
-		/* Then MAC interrupts. */
-		if (status & SK_ISR_MAC1 &&
-		    ifp0->if_drv_flags & IFF_DRV_RUNNING) {
-			if (sc->sk_type == SK_GENESIS)
-				sk_intr_xmac(sc_if0);
-			else
-				sk_intr_yukon(sc_if0);
-		}
-
-		if (status & SK_ISR_MAC2 &&
-		    ifp1->if_drv_flags & IFF_DRV_RUNNING) {
-			if (sc->sk_type == SK_GENESIS)
-				sk_intr_xmac(sc_if1);
-			else
-				sk_intr_yukon(sc_if1);
-		}
-
-		if (status & SK_ISR_EXTERNAL_REG) {
-			if (ifp0 != NULL &&
-			    sc_if0->sk_phytype == SK_PHYTYPE_BCOM)
-				sk_intr_bcom(sc_if0);
-			if (ifp1 != NULL &&
-			    sc_if1->sk_phytype == SK_PHYTYPE_BCOM)
-				sk_intr_bcom(sc_if1);
-		}
-	}
-
-	CSR_WRITE_4(sc, SK_IMR, sc->sk_intrmask);
-
-	if (ifp0 != NULL && !IFQ_DRV_IS_EMPTY(&ifp0->if_snd))
-		sk_start_locked(ifp0);
-	if (ifp1 != NULL && !IFQ_DRV_IS_EMPTY(&ifp1->if_snd))
-		sk_start_locked(ifp1);
-
-	SK_UNLOCK(sc);
-
-	return;
-}
-
-static void
-sk_init_xmac(sc_if)
-	struct sk_if_softc	*sc_if;
-{
-	struct sk_softc		*sc;
-	struct ifnet		*ifp;
-	struct sk_bcom_hack	bhack[] = {
-	{ 0x18, 0x0c20 }, { 0x17, 0x0012 }, { 0x15, 0x1104 }, { 0x17, 0x0013 },
-	{ 0x15, 0x0404 }, { 0x17, 0x8006 }, { 0x15, 0x0132 }, { 0x17, 0x8006 },
-	{ 0x15, 0x0232 }, { 0x17, 0x800D }, { 0x15, 0x000F }, { 0x18, 0x0420 },
-	{ 0, 0 } };
-
-	sc = sc_if->sk_softc;
-	ifp = sc_if->sk_ifp;
-
-	/* Unreset the XMAC. */
-	SK_IF_WRITE_2(sc_if, 0, SK_TXF1_MACCTL, SK_TXMACCTL_XMAC_UNRESET);
-	DELAY(1000);
-
-	/* Reset the XMAC's internal state. */
-	SK_XM_SETBIT_2(sc_if, XM_GPIO, XM_GPIO_RESETMAC);
-
-	/* Save the XMAC II revision */
-	sc_if->sk_xmac_rev = XM_XMAC_REV(SK_XM_READ_4(sc_if, XM_DEVID));
-
-	/*
-	 * Perform additional initialization for external PHYs,
-	 * namely for the 1000baseTX cards that use the XMAC's
-	 * GMII mode.
-	 */
-	if (sc_if->sk_phytype == SK_PHYTYPE_BCOM) {
-		int			i = 0;
-		u_int32_t		val;
-
-		/* Take PHY out of reset. */
-		val = sk_win_read_4(sc, SK_GPIO);
-		if (sc_if->sk_port == SK_PORT_A)
-			val |= SK_GPIO_DIR0|SK_GPIO_DAT0;
-		else
-			val |= SK_GPIO_DIR2|SK_GPIO_DAT2;
-		sk_win_write_4(sc, SK_GPIO, val);
-
-		/* Enable GMII mode on the XMAC. */
-		SK_XM_SETBIT_2(sc_if, XM_HWCFG, XM_HWCFG_GMIIMODE);
-
-		sk_xmac_miibus_writereg(sc_if, SK_PHYADDR_BCOM,
-		    BRGPHY_MII_BMCR, BRGPHY_BMCR_RESET);
-		DELAY(10000);
-		sk_xmac_miibus_writereg(sc_if, SK_PHYADDR_BCOM,
-		    BRGPHY_MII_IMR, 0xFFF0);
-
-		/*
-		 * Early versions of the BCM5400 apparently have
-		 * a bug that requires them to have their reserved
-		 * registers initialized to some magic values. I don't
-		 * know what the numbers do, I'm just the messenger.
-		 */
-		if (sk_xmac_miibus_readreg(sc_if, SK_PHYADDR_BCOM, 0x03)
-		    == 0x6041) {
-			while(bhack[i].reg) {
-				sk_xmac_miibus_writereg(sc_if, SK_PHYADDR_BCOM,
-				    bhack[i].reg, bhack[i].val);
-				i++;
-			}
-		}
-	}
-
-	/* Set station address */
-	SK_XM_WRITE_2(sc_if, XM_PAR0,
-	    *(u_int16_t *)(&IFP2ENADDR(sc_if->sk_ifp)[0]));
-	SK_XM_WRITE_2(sc_if, XM_PAR1,
-	    *(u_int16_t *)(&IFP2ENADDR(sc_if->sk_ifp)[2]));
-	SK_XM_WRITE_2(sc_if, XM_PAR2,
-	    *(u_int16_t *)(&IFP2ENADDR(sc_if->sk_ifp)[4]));
-	SK_XM_SETBIT_4(sc_if, XM_MODE, XM_MODE_RX_USE_STATION);
-
-	if (ifp->if_flags & IFF_BROADCAST) {
-		SK_XM_CLRBIT_4(sc_if, XM_MODE, XM_MODE_RX_NOBROAD);
-	} else {
-		SK_XM_SETBIT_4(sc_if, XM_MODE, XM_MODE_RX_NOBROAD);
-	}
-
-	/* We don't need the FCS appended to the packet. */
-	SK_XM_SETBIT_2(sc_if, XM_RXCMD, XM_RXCMD_STRIPFCS);
-
-	/* We want short frames padded to 60 bytes. */
-	SK_XM_SETBIT_2(sc_if, XM_TXCMD, XM_TXCMD_AUTOPAD);
-
-	/*
-	 * Enable the reception of all error frames. This is is
-	 * a necessary evil due to the design of the XMAC. The
-	 * XMAC's receive FIFO is only 8K in size, however jumbo
-	 * frames can be up to 9000 bytes in length. When bad
-	 * frame filtering is enabled, the XMAC's RX FIFO operates
-	 * in 'store and forward' mode. For this to work, the
-	 * entire frame has to fit into the FIFO, but that means
-	 * that jumbo frames larger than 8192 bytes will be
-	 * truncated. Disabling all bad frame filtering causes
-	 * the RX FIFO to operate in streaming mode, in which
-	 * case the XMAC will start transfering frames out of the
-	 * RX FIFO as soon as the FIFO threshold is reached.
-	 */
-	SK_XM_SETBIT_4(sc_if, XM_MODE, XM_MODE_RX_BADFRAMES|
-	    XM_MODE_RX_GIANTS|XM_MODE_RX_RUNTS|XM_MODE_RX_CRCERRS|
-	    XM_MODE_RX_INRANGELEN);
-
-	if (ifp->if_mtu > (ETHERMTU + ETHER_HDR_LEN + ETHER_CRC_LEN))
-		SK_XM_SETBIT_2(sc_if, XM_RXCMD, XM_RXCMD_BIGPKTOK);
-	else
-		SK_XM_CLRBIT_2(sc_if, XM_RXCMD, XM_RXCMD_BIGPKTOK);
-
-	/*
-	 * Bump up the transmit threshold. This helps hold off transmit
-	 * underruns when we're blasting traffic from both ports at once.
-	 */
-	SK_XM_WRITE_2(sc_if, XM_TX_REQTHRESH, SK_XM_TX_FIFOTHRESH);
-
-	/* Set promiscuous mode */
-	sk_setpromisc(sc_if);
-
-	/* Set multicast filter */
-	sk_setmulti(sc_if);
-
-	/* Clear and enable interrupts */
-	SK_XM_READ_2(sc_if, XM_ISR);
-	if (sc_if->sk_phytype == SK_PHYTYPE_XMAC)
-		SK_XM_WRITE_2(sc_if, XM_IMR, XM_INTRS);
-	else
-		SK_XM_WRITE_2(sc_if, XM_IMR, 0xFFFF);
-
-	/* Configure MAC arbiter */
-	switch(sc_if->sk_xmac_rev) {
-	case XM_XMAC_REV_B2:
-		sk_win_write_1(sc, SK_RCINIT_RX1, SK_RCINIT_XMAC_B2);
-		sk_win_write_1(sc, SK_RCINIT_TX1, SK_RCINIT_XMAC_B2);
-		sk_win_write_1(sc, SK_RCINIT_RX2, SK_RCINIT_XMAC_B2);
-		sk_win_write_1(sc, SK_RCINIT_TX2, SK_RCINIT_XMAC_B2);
-		sk_win_write_1(sc, SK_MINIT_RX1, SK_MINIT_XMAC_B2);
-		sk_win_write_1(sc, SK_MINIT_TX1, SK_MINIT_XMAC_B2);
-		sk_win_write_1(sc, SK_MINIT_RX2, SK_MINIT_XMAC_B2);
-		sk_win_write_1(sc, SK_MINIT_TX2, SK_MINIT_XMAC_B2);
-		sk_win_write_1(sc, SK_RECOVERY_CTL, SK_RECOVERY_XMAC_B2);
-		break;
-	case XM_XMAC_REV_C1:
-		sk_win_write_1(sc, SK_RCINIT_RX1, SK_RCINIT_XMAC_C1);
-		sk_win_write_1(sc, SK_RCINIT_TX1, SK_RCINIT_XMAC_C1);
-		sk_win_write_1(sc, SK_RCINIT_RX2, SK_RCINIT_XMAC_C1);
-		sk_win_write_1(sc, SK_RCINIT_TX2, SK_RCINIT_XMAC_C1);
-		sk_win_write_1(sc, SK_MINIT_RX1, SK_MINIT_XMAC_C1);
-		sk_win_write_1(sc, SK_MINIT_TX1, SK_MINIT_XMAC_C1);
-		sk_win_write_1(sc, SK_MINIT_RX2, SK_MINIT_XMAC_C1);
-		sk_win_write_1(sc, SK_MINIT_TX2, SK_MINIT_XMAC_C1);
-		sk_win_write_1(sc, SK_RECOVERY_CTL, SK_RECOVERY_XMAC_B2);
-		break;
-	default:
-		break;
-	}
-	sk_win_write_2(sc, SK_MACARB_CTL,
-	    SK_MACARBCTL_UNRESET|SK_MACARBCTL_FASTOE_OFF);
-
-	sc_if->sk_link = 1;
-
-	return;
-}
-
-static void
-sk_init_yukon(sc_if)
-	struct sk_if_softc	*sc_if;
-{
-	u_int32_t		phy;
-	u_int16_t		reg;
-	struct sk_softc		*sc;
-	struct ifnet		*ifp;
-	int			i;
-
-	sc = sc_if->sk_softc;
-	ifp = sc_if->sk_ifp;
-
-	if (sc->sk_type == SK_YUKON_LITE &&
-	    sc->sk_rev >= SK_YUKON_LITE_REV_A3) {
-		/* Take PHY out of reset. */
-		sk_win_write_4(sc, SK_GPIO,
-			(sk_win_read_4(sc, SK_GPIO) | SK_GPIO_DIR9) & ~SK_GPIO_DAT9);
-	}
-
-	/* GMAC and GPHY Reset */
-	SK_IF_WRITE_4(sc_if, 0, SK_GPHY_CTRL, SK_GPHY_RESET_SET);
-	SK_IF_WRITE_4(sc_if, 0, SK_GMAC_CTRL, SK_GMAC_RESET_SET);
-	DELAY(1000);
-	SK_IF_WRITE_4(sc_if, 0, SK_GMAC_CTRL, SK_GMAC_RESET_CLEAR);
-	SK_IF_WRITE_4(sc_if, 0, SK_GMAC_CTRL, SK_GMAC_RESET_SET);
-	DELAY(1000);
-
-	phy = SK_GPHY_INT_POL_HI | SK_GPHY_DIS_FC | SK_GPHY_DIS_SLEEP |
-		SK_GPHY_ENA_XC | SK_GPHY_ANEG_ALL | SK_GPHY_ENA_PAUSE;
-
-	switch(sc_if->sk_softc->sk_pmd) {
-	case IFM_1000_SX:
-	case IFM_1000_LX:
-		phy |= SK_GPHY_FIBER;
-		break;
-
-	case IFM_1000_CX:
-	case IFM_1000_T:
-		phy |= SK_GPHY_COPPER;
-		break;
-	}
-
-	SK_IF_WRITE_4(sc_if, 0, SK_GPHY_CTRL, phy | SK_GPHY_RESET_SET);
-	DELAY(1000);
-	SK_IF_WRITE_4(sc_if, 0, SK_GPHY_CTRL, phy | SK_GPHY_RESET_CLEAR);
-	SK_IF_WRITE_4(sc_if, 0, SK_GMAC_CTRL, SK_GMAC_LOOP_OFF |
-		      SK_GMAC_PAUSE_ON | SK_GMAC_RESET_CLEAR);
-
-	/* unused read of the interrupt source register */
-	SK_IF_READ_2(sc_if, 0, SK_GMAC_ISR);
-
-	reg = SK_YU_READ_2(sc_if, YUKON_PAR);
-
-	/* MIB Counter Clear Mode set */
-	reg |= YU_PAR_MIB_CLR;
-	SK_YU_WRITE_2(sc_if, YUKON_PAR, reg);
-
-	/* MIB Counter Clear Mode clear */
-	reg &= ~YU_PAR_MIB_CLR;
-	SK_YU_WRITE_2(sc_if, YUKON_PAR, reg);
-
-	/* receive control reg */
-	SK_YU_WRITE_2(sc_if, YUKON_RCR, YU_RCR_CRCR);
-
-	/* transmit parameter register */
-	SK_YU_WRITE_2(sc_if, YUKON_TPR, YU_TPR_JAM_LEN(0x3) |
-		      YU_TPR_JAM_IPG(0xb) | YU_TPR_JAM2DATA_IPG(0x1a) );
-
-	/* serial mode register */
-	reg = YU_SMR_DATA_BLIND(0x1c) | YU_SMR_MFL_VLAN | YU_SMR_IPG_DATA(0x1e);
-	if (ifp->if_mtu > (ETHERMTU + ETHER_HDR_LEN + ETHER_CRC_LEN))
-		reg |= YU_SMR_MFL_JUMBO;
-	SK_YU_WRITE_2(sc_if, YUKON_SMR, reg);
-
-	/* Setup Yukon's address */
-	for (i = 0; i < 3; i++) {
-		/* Write Source Address 1 (unicast filter) */
-		SK_YU_WRITE_2(sc_if, YUKON_SAL1 + i * 4, 
-			      IFP2ENADDR(sc_if->sk_ifp)[i * 2] |
-			      IFP2ENADDR(sc_if->sk_ifp)[i * 2 + 1] << 8);
-	}
-
-	for (i = 0; i < 3; i++) {
-		reg = sk_win_read_2(sc_if->sk_softc,
-				    SK_MAC1_0 + i * 2 + sc_if->sk_port * 8);
-		SK_YU_WRITE_2(sc_if, YUKON_SAL2 + i * 4, reg);
-	}
-
-	/* Set promiscuous mode */
-	sk_setpromisc(sc_if);
-
-	/* Set multicast filter */
-	sk_setmulti(sc_if);
-
-	/* enable interrupt mask for counter overflows */
-	SK_YU_WRITE_2(sc_if, YUKON_TIMR, 0);
-	SK_YU_WRITE_2(sc_if, YUKON_RIMR, 0);
-	SK_YU_WRITE_2(sc_if, YUKON_TRIMR, 0);
-
-	/* Configure RX MAC FIFO */
-	SK_IF_WRITE_1(sc_if, 0, SK_RXMF1_CTRL_TEST, SK_RFCTL_RESET_CLEAR);
-	SK_IF_WRITE_4(sc_if, 0, SK_RXMF1_CTRL_TEST, SK_RFCTL_OPERATION_ON);
-
-	/* Configure TX MAC FIFO */
-	SK_IF_WRITE_1(sc_if, 0, SK_TXMF1_CTRL_TEST, SK_TFCTL_RESET_CLEAR);
-	SK_IF_WRITE_4(sc_if, 0, SK_TXMF1_CTRL_TEST, SK_TFCTL_OPERATION_ON);
-}
-
-/*
- * Note that to properly initialize any part of the GEnesis chip,
- * you first have to take it out of reset mode.
- */
-static void
-sk_init(xsc)
-	void			*xsc;
-{
-	struct sk_if_softc	*sc_if = xsc;
-
-	SK_IF_LOCK(sc_if);
-	sk_init_locked(sc_if);
-	SK_IF_UNLOCK(sc_if);
-
-	return;
-}
-
-static void
-sk_init_locked(sc_if)
-	struct sk_if_softc	*sc_if;
-{
-	struct sk_softc		*sc;
-	struct ifnet		*ifp;
-	struct mii_data		*mii;
-	u_int16_t		reg;
-	u_int32_t		imr;
-
-	SK_IF_LOCK_ASSERT(sc_if);
-
-	ifp = sc_if->sk_ifp;
-	sc = sc_if->sk_softc;
-	mii = device_get_softc(sc_if->sk_miibus);
-
-	if (ifp->if_drv_flags & IFF_DRV_RUNNING)
-		return;
-
-	/* Cancel pending I/O and free all RX/TX buffers. */
-	sk_stop(sc_if);
-
-	if (sc->sk_type == SK_GENESIS) {
-		/* Configure LINK_SYNC LED */
-		SK_IF_WRITE_1(sc_if, 0, SK_LINKLED1_CTL, SK_LINKLED_ON);
-		SK_IF_WRITE_1(sc_if, 0, SK_LINKLED1_CTL,
-			SK_LINKLED_LINKSYNC_ON);
-
-		/* Configure RX LED */
-		SK_IF_WRITE_1(sc_if, 0, SK_RXLED1_CTL,	
-			SK_RXLEDCTL_COUNTER_START);
-
-		/* Configure TX LED */
-		SK_IF_WRITE_1(sc_if, 0, SK_TXLED1_CTL,
-			SK_TXLEDCTL_COUNTER_START);
-	}
-
-	/* Configure I2C registers */
-
-	/* Configure XMAC(s) */
-	switch (sc->sk_type) {
-	case SK_GENESIS:
-		sk_init_xmac(sc_if);
-		break;
-	case SK_YUKON:
-	case SK_YUKON_LITE:
-	case SK_YUKON_LP:
-		sk_init_yukon(sc_if);
-		break;
-	}
-	mii_mediachg(mii);
-
-	if (sc->sk_type == SK_GENESIS) {
-		/* Configure MAC FIFOs */
-		SK_IF_WRITE_4(sc_if, 0, SK_RXF1_CTL, SK_FIFO_UNRESET);
-		SK_IF_WRITE_4(sc_if, 0, SK_RXF1_END, SK_FIFO_END);
-		SK_IF_WRITE_4(sc_if, 0, SK_RXF1_CTL, SK_FIFO_ON);
-
-		SK_IF_WRITE_4(sc_if, 0, SK_TXF1_CTL, SK_FIFO_UNRESET);
-		SK_IF_WRITE_4(sc_if, 0, SK_TXF1_END, SK_FIFO_END);
-		SK_IF_WRITE_4(sc_if, 0, SK_TXF1_CTL, SK_FIFO_ON);
-	}
-
-	/* Configure transmit arbiter(s) */
-	SK_IF_WRITE_1(sc_if, 0, SK_TXAR1_COUNTERCTL,
-	    SK_TXARCTL_ON|SK_TXARCTL_FSYNC_ON);
-
-	/* Configure RAMbuffers */
-	SK_IF_WRITE_4(sc_if, 0, SK_RXRB1_CTLTST, SK_RBCTL_UNRESET);
-	SK_IF_WRITE_4(sc_if, 0, SK_RXRB1_START, sc_if->sk_rx_ramstart);
-	SK_IF_WRITE_4(sc_if, 0, SK_RXRB1_WR_PTR, sc_if->sk_rx_ramstart);
-	SK_IF_WRITE_4(sc_if, 0, SK_RXRB1_RD_PTR, sc_if->sk_rx_ramstart);
-	SK_IF_WRITE_4(sc_if, 0, SK_RXRB1_END, sc_if->sk_rx_ramend);
-	SK_IF_WRITE_4(sc_if, 0, SK_RXRB1_CTLTST, SK_RBCTL_ON);
-
-	SK_IF_WRITE_4(sc_if, 1, SK_TXRBS1_CTLTST, SK_RBCTL_UNRESET);
-	SK_IF_WRITE_4(sc_if, 1, SK_TXRBS1_CTLTST, SK_RBCTL_STORENFWD_ON);
-	SK_IF_WRITE_4(sc_if, 1, SK_TXRBS1_START, sc_if->sk_tx_ramstart);
-	SK_IF_WRITE_4(sc_if, 1, SK_TXRBS1_WR_PTR, sc_if->sk_tx_ramstart);
-	SK_IF_WRITE_4(sc_if, 1, SK_TXRBS1_RD_PTR, sc_if->sk_tx_ramstart);
-	SK_IF_WRITE_4(sc_if, 1, SK_TXRBS1_END, sc_if->sk_tx_ramend);
-	SK_IF_WRITE_4(sc_if, 1, SK_TXRBS1_CTLTST, SK_RBCTL_ON);
-
-	/* Configure BMUs */
-	SK_IF_WRITE_4(sc_if, 0, SK_RXQ1_BMU_CSR, SK_RXBMU_ONLINE);
-	SK_IF_WRITE_4(sc_if, 0, SK_RXQ1_CURADDR_LO,
-	    vtophys(&sc_if->sk_rdata->sk_rx_ring[0]));
-	SK_IF_WRITE_4(sc_if, 0, SK_RXQ1_CURADDR_HI, 0);
-
-	SK_IF_WRITE_4(sc_if, 1, SK_TXQS1_BMU_CSR, SK_TXBMU_ONLINE);
-	SK_IF_WRITE_4(sc_if, 1, SK_TXQS1_CURADDR_LO,
-	    vtophys(&sc_if->sk_rdata->sk_tx_ring[0]));
-	SK_IF_WRITE_4(sc_if, 1, SK_TXQS1_CURADDR_HI, 0);
-
-	/* Init descriptors */
-	if (sk_init_rx_ring(sc_if) == ENOBUFS) {
-		printf("sk%d: initialization failed: no "
-		    "memory for rx buffers\n", sc_if->sk_unit);
-		sk_stop(sc_if);
-		return;
-	}
-	sk_init_tx_ring(sc_if);
-
-	/* Set interrupt moderation if changed via sysctl. */
-	/* SK_LOCK(sc); */
-	imr = sk_win_read_4(sc, SK_IMTIMERINIT);
-	if (imr != SK_IM_USECS(sc->sk_int_mod)) {
-		sk_win_write_4(sc, SK_IMTIMERINIT, SK_IM_USECS(sc->sk_int_mod));
-		if (bootverbose)
-			printf("skc%d: interrupt moderation is %d us\n",
-			    sc->sk_unit, sc->sk_int_mod);
-	}
-	/* SK_UNLOCK(sc); */
-
-	/* Configure interrupt handling */
-	CSR_READ_4(sc, SK_ISSR);
-	if (sc_if->sk_port == SK_PORT_A)
-		sc->sk_intrmask |= SK_INTRS1;
-	else
-		sc->sk_intrmask |= SK_INTRS2;
-
-	sc->sk_intrmask |= SK_ISR_EXTERNAL_REG;
-
-	CSR_WRITE_4(sc, SK_IMR, sc->sk_intrmask);
-
-	/* Start BMUs. */
-	SK_IF_WRITE_4(sc_if, 0, SK_RXQ1_BMU_CSR, SK_RXBMU_RX_START);
-
-	switch(sc->sk_type) {
-	case SK_GENESIS:
-		/* Enable XMACs TX and RX state machines */
-		SK_XM_CLRBIT_2(sc_if, XM_MMUCMD, XM_MMUCMD_IGNPAUSE);
-		SK_XM_SETBIT_2(sc_if, XM_MMUCMD, XM_MMUCMD_TX_ENB|XM_MMUCMD_RX_ENB);
-		break;
-	case SK_YUKON:
-	case SK_YUKON_LITE:
-	case SK_YUKON_LP:
-		reg = SK_YU_READ_2(sc_if, YUKON_GPCR);
-		reg |= YU_GPCR_TXEN | YU_GPCR_RXEN;
-		reg &= ~(YU_GPCR_SPEED_EN | YU_GPCR_DPLX_EN);
-		SK_YU_WRITE_2(sc_if, YUKON_GPCR, reg);
-	}
-
-	ifp->if_drv_flags |= IFF_DRV_RUNNING;
-	ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
-
-	return;
-}
-
-static void
-sk_stop(sc_if)
-	struct sk_if_softc	*sc_if;
-{
-	int			i;
-	struct sk_softc		*sc;
-	struct ifnet		*ifp;
-
-	SK_IF_LOCK_ASSERT(sc_if);
-	sc = sc_if->sk_softc;
-	ifp = sc_if->sk_ifp;
-
-	untimeout(sk_tick, sc_if, sc_if->sk_tick_ch);
-
-	if (sc_if->sk_phytype == SK_PHYTYPE_BCOM) {
-		u_int32_t		val;
-
-		/* Put PHY back into reset. */
-		val = sk_win_read_4(sc, SK_GPIO);
-		if (sc_if->sk_port == SK_PORT_A) {
-			val |= SK_GPIO_DIR0;
-			val &= ~SK_GPIO_DAT0;
-		} else {
-			val |= SK_GPIO_DIR2;
-			val &= ~SK_GPIO_DAT2;
-		}
-		sk_win_write_4(sc, SK_GPIO, val);
-	}
-
-	/* Turn off various components of this interface. */
-	SK_XM_SETBIT_2(sc_if, XM_GPIO, XM_GPIO_RESETMAC);
-	switch (sc->sk_type) {
-	case SK_GENESIS:
-		SK_IF_WRITE_2(sc_if, 0, SK_TXF1_MACCTL, SK_TXMACCTL_XMAC_RESET);
-		SK_IF_WRITE_4(sc_if, 0, SK_RXF1_CTL, SK_FIFO_RESET);
-		break;
-	case SK_YUKON:
-	case SK_YUKON_LITE:
-	case SK_YUKON_LP:
-		SK_IF_WRITE_1(sc_if,0, SK_RXMF1_CTRL_TEST, SK_RFCTL_RESET_SET);
-		SK_IF_WRITE_1(sc_if,0, SK_TXMF1_CTRL_TEST, SK_TFCTL_RESET_SET);
-		break;
-	}
-	SK_IF_WRITE_4(sc_if, 0, SK_RXQ1_BMU_CSR, SK_RXBMU_OFFLINE);
-	SK_IF_WRITE_4(sc_if, 0, SK_RXRB1_CTLTST, SK_RBCTL_RESET|SK_RBCTL_OFF);
-	SK_IF_WRITE_4(sc_if, 1, SK_TXQS1_BMU_CSR, SK_TXBMU_OFFLINE);
-	SK_IF_WRITE_4(sc_if, 1, SK_TXRBS1_CTLTST, SK_RBCTL_RESET|SK_RBCTL_OFF);
-	SK_IF_WRITE_1(sc_if, 0, SK_TXAR1_COUNTERCTL, SK_TXARCTL_OFF);
-	SK_IF_WRITE_1(sc_if, 0, SK_RXLED1_CTL, SK_RXLEDCTL_COUNTER_STOP);
-	SK_IF_WRITE_1(sc_if, 0, SK_TXLED1_CTL, SK_RXLEDCTL_COUNTER_STOP);
-	SK_IF_WRITE_1(sc_if, 0, SK_LINKLED1_CTL, SK_LINKLED_OFF);
-	SK_IF_WRITE_1(sc_if, 0, SK_LINKLED1_CTL, SK_LINKLED_LINKSYNC_OFF);
-
-	/* Disable interrupts */
-	if (sc_if->sk_port == SK_PORT_A)
-		sc->sk_intrmask &= ~SK_INTRS1;
-	else
-		sc->sk_intrmask &= ~SK_INTRS2;
-	CSR_WRITE_4(sc, SK_IMR, sc->sk_intrmask);
-
-	SK_XM_READ_2(sc_if, XM_ISR);
-	SK_XM_WRITE_2(sc_if, XM_IMR, 0xFFFF);
-
-	/* Free RX and TX mbufs still in the queues. */
-	for (i = 0; i < SK_RX_RING_CNT; i++) {
-		if (sc_if->sk_cdata.sk_rx_chain[i].sk_mbuf != NULL) {
-			m_freem(sc_if->sk_cdata.sk_rx_chain[i].sk_mbuf);
-			sc_if->sk_cdata.sk_rx_chain[i].sk_mbuf = NULL;
-		}
-	}
-
-	for (i = 0; i < SK_TX_RING_CNT; i++) {
-		if (sc_if->sk_cdata.sk_tx_chain[i].sk_mbuf != NULL) {
-			m_freem(sc_if->sk_cdata.sk_tx_chain[i].sk_mbuf);
-			sc_if->sk_cdata.sk_tx_chain[i].sk_mbuf = NULL;
-		}
-	}
-
-	ifp->if_drv_flags &= ~(IFF_DRV_RUNNING|IFF_DRV_OACTIVE);
-
-	return;
-}
-
-static int
-sysctl_int_range(SYSCTL_HANDLER_ARGS, int low, int high)
-{
-	int error, value;
-
-	if (!arg1)
-		return (EINVAL);
-	value = *(int *)arg1;
-	error = sysctl_handle_int(oidp, &value, 0, req);
-	if (error || !req->newptr)
-		return (error);
-	if (value < low || value > high)
-		return (EINVAL);
-	*(int *)arg1 = value;
-	return (0);
-}
-
-static int
-sysctl_hw_sk_int_mod(SYSCTL_HANDLER_ARGS)
-{
-	return (sysctl_int_range(oidp, arg1, arg2, req, SK_IM_MIN, SK_IM_MAX));
-}
Index: if_mn.c
===================================================================
RCS file: /home/cvs/src/sys/pci/if_mn.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/if_mn.c -L sys/pci/if_mn.c -u -r1.1.1.1 -r1.2
--- sys/pci/if_mn.c
+++ sys/pci/if_mn.c
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/if_mn.c,v 1.48 2005/06/10 16:49:22 brooks Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/if_mn.c,v 1.49 2007/02/23 19:41:34 imp Exp $");
 
 /*
  * Stuff to describe the MUNIC32X and FALC54 chips.
@@ -1377,7 +1377,7 @@
 		return(ENXIO);
 	}
 
-	error = bus_setup_intr(self, sc->irq, INTR_TYPE_NET, mn_intr, sc, &sc->intrhand);
+	error = bus_setup_intr(self, sc->irq, INTR_TYPE_NET, NULL, mn_intr, sc, &sc->intrhand);
 
 	if (error) {
 		printf("couldn't set up irq\n");
--- sys/pci/if_ti.c
+++ /dev/null
@@ -1,3554 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998, 1999
- *	Bill Paul <wpaul at ctr.columbia.edu>.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Alteon Networks Tigon PCI gigabit ethernet driver for FreeBSD.
- * Manuals, sample driver and firmware source kits are available
- * from http://www.alteon.com/support/openkits.
- *
- * Written by Bill Paul <wpaul at ctr.columbia.edu>
- * Electrical Engineering Department
- * Columbia University, New York City
- */
-
-/*
- * The Alteon Networks Tigon chip contains an embedded R4000 CPU,
- * gigabit MAC, dual DMA channels and a PCI interface unit. NICs
- * using the Tigon may have anywhere from 512K to 2MB of SRAM. The
- * Tigon supports hardware IP, TCP and UCP checksumming, multicast
- * filtering and jumbo (9014 byte) frames. The hardware is largely
- * controlled by firmware, which must be loaded into the NIC during
- * initialization.
- *
- * The Tigon 2 contains 2 R4000 CPUs and requires a newer firmware
- * revision, which supports new features such as extended commands,
- * extended jumbo receive ring desciptors and a mini receive ring.
- *
- * Alteon Networks is to be commended for releasing such a vast amount
- * of development material for the Tigon NIC without requiring an NDA
- * (although they really should have done it a long time ago). With
- * any luck, the other vendors will finally wise up and follow Alteon's
- * stellar example.
- *
- * The firmware for the Tigon 1 and 2 NICs is compiled directly into
- * this driver by #including it as a C header file. This bloats the
- * driver somewhat, but it's the easiest method considering that the
- * driver code and firmware code need to be kept in sync. The source
- * for the firmware is not provided with the FreeBSD distribution since
- * compiling it requires a GNU toolchain targeted for mips-sgi-irix5.3.
- *
- * The following people deserve special thanks:
- * - Terry Murphy of 3Com, for providing a 3c985 Tigon 1 board
- *   for testing
- * - Raymond Lee of Netgear, for providing a pair of Netgear
- *   GA620 Tigon 2 boards for testing
- * - Ulf Zimmermann, for bringing the GA260 to my attention and
- *   convincing me to write this driver.
- * - Andrew Gallatin for providing FreeBSD/Alpha support.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/if_ti.c,v 1.107.2.5 2006/01/14 10:05:07 glebius Exp $");
-
-#include "opt_ti.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/sockio.h>
-#include <sys/mbuf.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-#include <sys/socket.h>
-#include <sys/queue.h>
-#include <sys/conf.h>
-
-#include <net/if.h>
-#include <net/if_arp.h>
-#include <net/ethernet.h>
-#include <net/if_dl.h>
-#include <net/if_media.h>
-#include <net/if_types.h>
-#include <net/if_vlan_var.h>
-
-#include <net/bpf.h>
-
-#include <netinet/in_systm.h>
-#include <netinet/in.h>
-#include <netinet/ip.h>
-
-#include <vm/vm.h>		/* for vtophys */
-#include <vm/pmap.h>		/* for vtophys */
-#include <machine/bus.h>
-#include <machine/resource.h>
-#include <sys/bus.h>
-#include <sys/rman.h>
-
-/* #define TI_PRIVATE_JUMBOS */
-
-#if !defined(TI_PRIVATE_JUMBOS)
-#include <sys/sockio.h>
-#include <sys/uio.h>
-#include <sys/lock.h>
-#include <sys/sf_buf.h>
-#include <vm/vm_extern.h>
-#include <vm/pmap.h>
-#include <vm/vm_map.h>
-#include <vm/vm_map.h>
-#include <vm/vm_param.h>
-#include <vm/vm_pageout.h>
-#include <sys/vmmeter.h>
-#include <vm/vm_page.h>
-#include <vm/vm_object.h>
-#include <vm/vm_kern.h>
-#include <sys/proc.h>
-#endif /* !TI_PRIVATE_JUMBOS */
-
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcivar.h>
-
-#include <sys/tiio.h>
-#include <pci/if_tireg.h>
-#include <pci/ti_fw.h>
-#include <pci/ti_fw2.h>
-
-#define TI_CSUM_FEATURES	(CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_IP_FRAGS)
-/*
- * We can only turn on header splitting if we're using extended receive
- * BDs.
- */
-#if defined(TI_JUMBO_HDRSPLIT) && defined(TI_PRIVATE_JUMBOS)
-#error "options TI_JUMBO_HDRSPLIT and TI_PRIVATE_JUMBOS are mutually exclusive"
-#endif /* TI_JUMBO_HDRSPLIT && TI_JUMBO_HDRSPLIT */
-
-struct ti_softc *tis[8];
-
-typedef enum {
-	TI_SWAP_HTON,
-	TI_SWAP_NTOH
-} ti_swap_type;
-
-
-/*
- * Various supported device vendors/types and their names.
- */
-
-static struct ti_type ti_devs[] = {
-	{ ALT_VENDORID,	ALT_DEVICEID_ACENIC,
-		"Alteon AceNIC 1000baseSX Gigabit Ethernet" },
-	{ ALT_VENDORID,	ALT_DEVICEID_ACENIC_COPPER,
-		"Alteon AceNIC 1000baseT Gigabit Ethernet" },
-	{ TC_VENDORID,	TC_DEVICEID_3C985,
-		"3Com 3c985-SX Gigabit Ethernet" },
-	{ NG_VENDORID, NG_DEVICEID_GA620,
-		"Netgear GA620 1000baseSX Gigabit Ethernet" },
-	{ NG_VENDORID, NG_DEVICEID_GA620T,
-		"Netgear GA620 1000baseT Gigabit Ethernet" },
-	{ SGI_VENDORID, SGI_DEVICEID_TIGON,
-		"Silicon Graphics Gigabit Ethernet" },
-	{ DEC_VENDORID, DEC_DEVICEID_FARALLON_PN9000SX,
-		"Farallon PN9000SX Gigabit Ethernet" },
-	{ 0, 0, NULL }
-};
-
-
-static	d_open_t	ti_open;
-static	d_close_t	ti_close;
-static	d_ioctl_t	ti_ioctl2;
-
-static struct cdevsw ti_cdevsw = {
-	.d_version =	D_VERSION,
-	.d_flags =	D_NEEDGIANT,
-	.d_open =	ti_open,
-	.d_close =	ti_close,
-	.d_ioctl =	ti_ioctl2,
-	.d_name =	"ti",
-};
-
-static int ti_probe(device_t);
-static int ti_attach(device_t);
-static int ti_detach(device_t);
-static void ti_txeof(struct ti_softc *);
-static void ti_rxeof(struct ti_softc *);
-
-static void ti_stats_update(struct ti_softc *);
-static int ti_encap(struct ti_softc *, struct mbuf *, u_int32_t *);
-
-static void ti_intr(void *);
-static void ti_start(struct ifnet *);
-static int ti_ioctl(struct ifnet *, u_long, caddr_t);
-static void ti_init(void *);
-static void ti_init2(struct ti_softc *);
-static void ti_stop(struct ti_softc *);
-static void ti_watchdog(struct ifnet *);
-static void ti_shutdown(device_t);
-static int ti_ifmedia_upd(struct ifnet *);
-static void ti_ifmedia_sts(struct ifnet *, struct ifmediareq *);
-
-static u_int32_t ti_eeprom_putbyte(struct ti_softc *, int);
-static u_int8_t	ti_eeprom_getbyte(struct ti_softc *, int, u_int8_t *);
-static int ti_read_eeprom(struct ti_softc *, caddr_t, int, int);
-
-static void ti_add_mcast(struct ti_softc *, struct ether_addr *);
-static void ti_del_mcast(struct ti_softc *, struct ether_addr *);
-static void ti_setmulti(struct ti_softc *);
-
-static void ti_mem(struct ti_softc *, u_int32_t, u_int32_t, caddr_t);
-static int ti_copy_mem(struct ti_softc *, u_int32_t, u_int32_t, caddr_t, int, int);
-static int ti_copy_scratch(struct ti_softc *, u_int32_t, u_int32_t, caddr_t,
-		int, int, int);
-static int ti_bcopy_swap(const void *, void *, size_t, ti_swap_type);
-static void ti_loadfw(struct ti_softc *);
-static void ti_cmd(struct ti_softc *, struct ti_cmd_desc *);
-static void ti_cmd_ext(struct ti_softc *, struct ti_cmd_desc *, caddr_t, int);
-static void ti_handle_events(struct ti_softc *);
-#ifdef TI_PRIVATE_JUMBOS
-static int ti_alloc_jumbo_mem(struct ti_softc *);
-static void *ti_jalloc(struct ti_softc *);
-static void ti_jfree(void *, void *);
-#endif /* TI_PRIVATE_JUMBOS */
-static int ti_newbuf_std(struct ti_softc *, int, struct mbuf *);
-static int ti_newbuf_mini(struct ti_softc *, int, struct mbuf *);
-static int ti_newbuf_jumbo(struct ti_softc *, int, struct mbuf *);
-static int ti_init_rx_ring_std(struct ti_softc *);
-static void ti_free_rx_ring_std(struct ti_softc *);
-static int ti_init_rx_ring_jumbo(struct ti_softc *);
-static void ti_free_rx_ring_jumbo(struct ti_softc *);
-static int ti_init_rx_ring_mini(struct ti_softc *);
-static void ti_free_rx_ring_mini(struct ti_softc *);
-static void ti_free_tx_ring(struct ti_softc *);
-static int ti_init_tx_ring(struct ti_softc *);
-
-static int ti_64bitslot_war(struct ti_softc *);
-static int ti_chipinit(struct ti_softc *);
-static int ti_gibinit(struct ti_softc *);
-
-#ifdef TI_JUMBO_HDRSPLIT
-static __inline void ti_hdr_split	(struct mbuf *top, int hdr_len,
-					     int pkt_len, int idx);
-#endif /* TI_JUMBO_HDRSPLIT */
-
-static device_method_t ti_methods[] = {
-	/* Device interface */
-	DEVMETHOD(device_probe,		ti_probe),
-	DEVMETHOD(device_attach,	ti_attach),
-	DEVMETHOD(device_detach,	ti_detach),
-	DEVMETHOD(device_shutdown,	ti_shutdown),
-	{ 0, 0 }
-};
-
-static driver_t ti_driver = {
-	"ti",
-	ti_methods,
-	sizeof(struct ti_softc)
-};
-
-static devclass_t ti_devclass;
-
-DRIVER_MODULE(ti, pci, ti_driver, ti_devclass, 0, 0);
-MODULE_DEPEND(ti, pci, 1, 1, 1);
-MODULE_DEPEND(ti, ether, 1, 1, 1);
-
-/*
- * Send an instruction or address to the EEPROM, check for ACK.
- */
-static u_int32_t ti_eeprom_putbyte(sc, byte)
-	struct ti_softc		*sc;
-	int			byte;
-{
-	register int		i, ack = 0;
-
-	/*
-	 * Make sure we're in TX mode.
-	 */
-	TI_SETBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_TXEN);
-
-	/*
-	 * Feed in each bit and stobe the clock.
-	 */
-	for (i = 0x80; i; i >>= 1) {
-		if (byte & i) {
-			TI_SETBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_DOUT);
-		} else {
-			TI_CLRBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_DOUT);
-		}
-		DELAY(1);
-		TI_SETBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_CLK);
-		DELAY(1);
-		TI_CLRBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_CLK);
-	}
-
-	/*
-	 * Turn off TX mode.
-	 */
-	TI_CLRBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_TXEN);
-
-	/*
-	 * Check for ack.
-	 */
-	TI_SETBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_CLK);
-	ack = CSR_READ_4(sc, TI_MISC_LOCAL_CTL) & TI_MLC_EE_DIN;
-	TI_CLRBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_CLK);
-
-	return (ack);
-}
-
-/*
- * Read a byte of data stored in the EEPROM at address 'addr.'
- * We have to send two address bytes since the EEPROM can hold
- * more than 256 bytes of data.
- */
-static u_int8_t ti_eeprom_getbyte(sc, addr, dest)
-	struct ti_softc		*sc;
-	int			addr;
-	u_int8_t		*dest;
-{
-	register int		i;
-	u_int8_t		byte = 0;
-
-	EEPROM_START;
-
-	/*
-	 * Send write control code to EEPROM.
-	 */
-	if (ti_eeprom_putbyte(sc, EEPROM_CTL_WRITE)) {
-		printf("ti%d: failed to send write command, status: %x\n",
-		    sc->ti_unit, CSR_READ_4(sc, TI_MISC_LOCAL_CTL));
-		return (1);
-	}
-
-	/*
-	 * Send first byte of address of byte we want to read.
-	 */
-	if (ti_eeprom_putbyte(sc, (addr >> 8) & 0xFF)) {
-		printf("ti%d: failed to send address, status: %x\n",
-		    sc->ti_unit, CSR_READ_4(sc, TI_MISC_LOCAL_CTL));
-		return (1);
-	}
-	/*
-	 * Send second byte address of byte we want to read.
-	 */
-	if (ti_eeprom_putbyte(sc, addr & 0xFF)) {
-		printf("ti%d: failed to send address, status: %x\n",
-		    sc->ti_unit, CSR_READ_4(sc, TI_MISC_LOCAL_CTL));
-		return (1);
-	}
-
-	EEPROM_STOP;
-	EEPROM_START;
-	/*
-	 * Send read control code to EEPROM.
-	 */
-	if (ti_eeprom_putbyte(sc, EEPROM_CTL_READ)) {
-		printf("ti%d: failed to send read command, status: %x\n",
-		    sc->ti_unit, CSR_READ_4(sc, TI_MISC_LOCAL_CTL));
-		return (1);
-	}
-
-	/*
-	 * Start reading bits from EEPROM.
-	 */
-	TI_CLRBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_TXEN);
-	for (i = 0x80; i; i >>= 1) {
-		TI_SETBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_CLK);
-		DELAY(1);
-		if (CSR_READ_4(sc, TI_MISC_LOCAL_CTL) & TI_MLC_EE_DIN)
-			byte |= i;
-		TI_CLRBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_EE_CLK);
-		DELAY(1);
-	}
-
-	EEPROM_STOP;
-
-	/*
-	 * No ACK generated for read, so just return byte.
-	 */
-
-	*dest = byte;
-
-	return (0);
-}
-
-/*
- * Read a sequence of bytes from the EEPROM.
- */
-static int
-ti_read_eeprom(sc, dest, off, cnt)
-	struct ti_softc		*sc;
-	caddr_t			dest;
-	int			off;
-	int			cnt;
-{
-	int			err = 0, i;
-	u_int8_t		byte = 0;
-
-	for (i = 0; i < cnt; i++) {
-		err = ti_eeprom_getbyte(sc, off + i, &byte);
-		if (err)
-			break;
-		*(dest + i) = byte;
-	}
-
-	return (err ? 1 : 0);
-}
-
-/*
- * NIC memory access function. Can be used to either clear a section
- * of NIC local memory or (if buf is non-NULL) copy data into it.
- */
-static void
-ti_mem(sc, addr, len, buf)
-	struct ti_softc		*sc;
-	u_int32_t		addr, len;
-	caddr_t			buf;
-{
-	int			segptr, segsize, cnt;
-	caddr_t			ti_winbase, ptr;
-
-	segptr = addr;
-	cnt = len;
-	ti_winbase = (caddr_t)(sc->ti_vhandle + TI_WINDOW);
-	ptr = buf;
-
-	while (cnt) {
-		if (cnt < TI_WINLEN)
-			segsize = cnt;
-		else
-			segsize = TI_WINLEN - (segptr % TI_WINLEN);
-		CSR_WRITE_4(sc, TI_WINBASE, (segptr & ~(TI_WINLEN - 1)));
-		if (buf == NULL)
-			bzero((char *)ti_winbase + (segptr &
-			    (TI_WINLEN - 1)), segsize);
-		else {
-			bcopy((char *)ptr, (char *)ti_winbase +
-			    (segptr & (TI_WINLEN - 1)), segsize);
-			ptr += segsize;
-		}
-		segptr += segsize;
-		cnt -= segsize;
-	}
-}
-
-static int
-ti_copy_mem(sc, tigon_addr, len, buf, useraddr, readdata)
-	struct ti_softc		*sc;
-	u_int32_t		tigon_addr, len;
-	caddr_t			buf;
-	int			useraddr, readdata;
-{
-	int		segptr, segsize, cnt;
-	caddr_t		ptr;
-	u_int32_t	origwin;
-	u_int8_t	tmparray[TI_WINLEN], tmparray2[TI_WINLEN];
-	int		resid, segresid;
-	int		first_pass;
-
-	/*
-	 * At the moment, we don't handle non-aligned cases, we just bail.
-	 * If this proves to be a problem, it will be fixed.
-	 */
-	if ((readdata == 0)
-	 && (tigon_addr & 0x3)) {
-		printf("ti%d: ti_copy_mem: tigon address %#x isn't "
-		       "word-aligned\n", sc->ti_unit, tigon_addr);
-		printf("ti%d: ti_copy_mem: unaligned writes aren't yet "
-		       "supported\n", sc->ti_unit);
-		return (EINVAL);
-	}
-
-	segptr = tigon_addr & ~0x3;
-	segresid = tigon_addr - segptr;
-
-	/*
-	 * This is the non-aligned amount left over that we'll need to
-	 * copy.
-	 */
-	resid = len & 0x3;
-
-	/* Add in the left over amount at the front of the buffer */
-	resid += segresid;
-
-	cnt = len & ~0x3;
-	/*
-	 * If resid + segresid is >= 4, add multiples of 4 to the count and
-	 * decrease the residual by that much.
-	 */
-	cnt += resid & ~0x3;
-	resid -= resid & ~0x3;
-
-	ptr = buf;
-
-	first_pass = 1;
-
-	/*
-	 * Make sure we aren't interrupted while we're changing the window
-	 * pointer.
-	 */
-	TI_LOCK(sc);
-
-	/*
-	 * Save the old window base value.
-	 */
-	origwin = CSR_READ_4(sc, TI_WINBASE);
-
-	while (cnt) {
-		bus_size_t ti_offset;
-
-		if (cnt < TI_WINLEN)
-			segsize = cnt;
-		else
-			segsize = TI_WINLEN - (segptr % TI_WINLEN);
-		CSR_WRITE_4(sc, TI_WINBASE, (segptr & ~(TI_WINLEN - 1)));
-
-		ti_offset = TI_WINDOW + (segptr & (TI_WINLEN -1));
-
-		if (readdata) {
-
-			bus_space_read_region_4(sc->ti_btag,
-						sc->ti_bhandle, ti_offset,
-						(u_int32_t *)tmparray,
-						segsize >> 2);
-			if (useraddr) {
-				/*
-				 * Yeah, this is a little on the kludgy
-				 * side, but at least this code is only
-				 * used for debugging.
-				 */
-				ti_bcopy_swap(tmparray, tmparray2, segsize,
-					      TI_SWAP_NTOH);
-
-				if (first_pass) {
-					copyout(&tmparray2[segresid], ptr,
-						segsize - segresid);
-					first_pass = 0;
-				} else
-					copyout(tmparray2, ptr, segsize);
-			} else {
-				if (first_pass) {
-
-					ti_bcopy_swap(tmparray, tmparray2,
-						      segsize, TI_SWAP_NTOH);
-					bcopy(&tmparray2[segresid], ptr,
-					      segsize - segresid);
-					first_pass = 0;
-				} else
-					ti_bcopy_swap(tmparray, ptr, segsize,
-						      TI_SWAP_NTOH);
-			}
-
-		} else {
-			if (useraddr) {
-				copyin(ptr, tmparray2, segsize);
-				ti_bcopy_swap(tmparray2, tmparray, segsize,
-					      TI_SWAP_HTON);
-			} else
-				ti_bcopy_swap(ptr, tmparray, segsize,
-					      TI_SWAP_HTON);
-
-			bus_space_write_region_4(sc->ti_btag,
-						 sc->ti_bhandle, ti_offset,
-						 (u_int32_t *)tmparray,
-						 segsize >> 2);
-		}
-		segptr += segsize;
-		ptr += segsize;
-		cnt -= segsize;
-	}
-
-	/*
-	 * Handle leftover, non-word-aligned bytes.
-	 */
-	if (resid != 0) {
-		u_int32_t	tmpval, tmpval2;
-		bus_size_t	ti_offset;
-
-		/*
-		 * Set the segment pointer.
-		 */
-		CSR_WRITE_4(sc, TI_WINBASE, (segptr & ~(TI_WINLEN - 1)));
-
-		ti_offset = TI_WINDOW + (segptr & (TI_WINLEN - 1));
-
-		/*
-		 * First, grab whatever is in our source/destination.
-		 * We'll obviously need this for reads, but also for
-		 * writes, since we'll be doing read/modify/write.
-		 */
-		bus_space_read_region_4(sc->ti_btag, sc->ti_bhandle,
-					ti_offset, &tmpval, 1);
-
-		/*
-		 * Next, translate this from little-endian to big-endian
-		 * (at least on i386 boxes).
-		 */
-		tmpval2 = ntohl(tmpval);
-
-		if (readdata) {
-			/*
-			 * If we're reading, just copy the leftover number
-			 * of bytes from the host byte order buffer to
-			 * the user's buffer.
-			 */
-			if (useraddr)
-				copyout(&tmpval2, ptr, resid);
-			else
-				bcopy(&tmpval2, ptr, resid);
-		} else {
-			/*
-			 * If we're writing, first copy the bytes to be
-			 * written into the network byte order buffer,
-			 * leaving the rest of the buffer with whatever was
-			 * originally in there.  Then, swap the bytes
-			 * around into host order and write them out.
-			 *
-			 * XXX KDM the read side of this has been verified
-			 * to work, but the write side of it has not been
-			 * verified.  So user beware.
-			 */
-			if (useraddr)
-				copyin(ptr, &tmpval2, resid);
-			else
-				bcopy(ptr, &tmpval2, resid);
-
-			tmpval = htonl(tmpval2);
-
-			bus_space_write_region_4(sc->ti_btag, sc->ti_bhandle,
-						 ti_offset, &tmpval, 1);
-		}
-	}
-
-	CSR_WRITE_4(sc, TI_WINBASE, origwin);
-
-	TI_UNLOCK(sc);
-
-	return (0);
-}
-
-static int
-ti_copy_scratch(sc, tigon_addr, len, buf, useraddr, readdata, cpu)
-	struct ti_softc		*sc;
-	u_int32_t		tigon_addr, len;
-	caddr_t			buf;
-	int			useraddr, readdata;
-	int			cpu;
-{
-	u_int32_t	segptr;
-	int		cnt;
-	u_int32_t	tmpval, tmpval2;
-	caddr_t		ptr;
-
-	/*
-	 * At the moment, we don't handle non-aligned cases, we just bail.
-	 * If this proves to be a problem, it will be fixed.
-	 */
-	if (tigon_addr & 0x3) {
-		printf("ti%d: ti_copy_scratch: tigon address %#x isn't "
-		       "word-aligned\n", sc->ti_unit, tigon_addr);
-		return (EINVAL);
-	}
-
-	if (len & 0x3) {
-		printf("ti%d: ti_copy_scratch: transfer length %d isn't "
-		       "word-aligned\n", sc->ti_unit, len);
-		return (EINVAL);
-	}
-
-	segptr = tigon_addr;
-	cnt = len;
-	ptr = buf;
-
-	TI_LOCK(sc);
-
-	while (cnt) {
-		CSR_WRITE_4(sc, CPU_REG(TI_SRAM_ADDR, cpu), segptr);
-
-		if (readdata) {
-			tmpval2 = CSR_READ_4(sc, CPU_REG(TI_SRAM_DATA, cpu));
-
-			tmpval = ntohl(tmpval2);
-
-			/*
-			 * Note:  I've used this debugging interface
-			 * extensively with Alteon's 12.3.15 firmware,
-			 * compiled with GCC 2.7.2.1 and binutils 2.9.1.
-			 *
-			 * When you compile the firmware without
-			 * optimization, which is necessary sometimes in
-			 * order to properly step through it, you sometimes
-			 * read out a bogus value of 0xc0017c instead of
-			 * whatever was supposed to be in that scratchpad
-			 * location.  That value is on the stack somewhere,
-			 * but I've never been able to figure out what was
-			 * causing the problem.
-			 *
-			 * The address seems to pop up in random places,
-			 * often not in the same place on two subsequent
-			 * reads.
-			 *
-			 * In any case, the underlying data doesn't seem
-			 * to be affected, just the value read out.
-			 *
-			 * KDM, 3/7/2000
-			 */
-
-			if (tmpval2 == 0xc0017c)
-				printf("ti%d: found 0xc0017c at %#x "
-				       "(tmpval2)\n", sc->ti_unit, segptr);
-
-			if (tmpval == 0xc0017c)
-				printf("ti%d: found 0xc0017c at %#x "
-				       "(tmpval)\n", sc->ti_unit, segptr);
-
-			if (useraddr)
-				copyout(&tmpval, ptr, 4);
-			else
-				bcopy(&tmpval, ptr, 4);
-		} else {
-			if (useraddr)
-				copyin(ptr, &tmpval2, 4);
-			else
-				bcopy(ptr, &tmpval2, 4);
-
-			tmpval = htonl(tmpval2);
-
-			CSR_WRITE_4(sc, CPU_REG(TI_SRAM_DATA, cpu), tmpval);
-		}
-
-		cnt -= 4;
-		segptr += 4;
-		ptr += 4;
-	}
-
-	TI_UNLOCK(sc);
-
-	return (0);
-}
-
-static int
-ti_bcopy_swap(src, dst, len, swap_type)
-	const void	*src;
-	void		*dst;
-	size_t		len;
-	ti_swap_type	swap_type;
-{
-	const u_int8_t *tmpsrc;
-	u_int8_t *tmpdst;
-	size_t tmplen;
-
-	if (len & 0x3) {
-		printf("ti_bcopy_swap: length %zd isn't 32-bit aligned\n",
-		       len);
-		return (-1);
-	}
-
-	tmpsrc = src;
-	tmpdst = dst;
-	tmplen = len;
-
-	while (tmplen) {
-		if (swap_type == TI_SWAP_NTOH)
-			*(u_int32_t *)tmpdst =
-				ntohl(*(const u_int32_t *)tmpsrc);
-		else
-			*(u_int32_t *)tmpdst =
-				htonl(*(const u_int32_t *)tmpsrc);
-
-		tmpsrc += 4;
-		tmpdst += 4;
-		tmplen -= 4;
-	}
-
-	return (0);
-}
-
-/*
- * Load firmware image into the NIC. Check that the firmware revision
- * is acceptable and see if we want the firmware for the Tigon 1 or
- * Tigon 2.
- */
-static void
-ti_loadfw(sc)
-	struct ti_softc		*sc;
-{
-	switch (sc->ti_hwrev) {
-	case TI_HWREV_TIGON:
-		if (tigonFwReleaseMajor != TI_FIRMWARE_MAJOR ||
-		    tigonFwReleaseMinor != TI_FIRMWARE_MINOR ||
-		    tigonFwReleaseFix != TI_FIRMWARE_FIX) {
-			printf("ti%d: firmware revision mismatch; want "
-			    "%d.%d.%d, got %d.%d.%d\n", sc->ti_unit,
-			    TI_FIRMWARE_MAJOR, TI_FIRMWARE_MINOR,
-			    TI_FIRMWARE_FIX, tigonFwReleaseMajor,
-			    tigonFwReleaseMinor, tigonFwReleaseFix);
-			return;
-		}
-		ti_mem(sc, tigonFwTextAddr, tigonFwTextLen,
-		    (caddr_t)tigonFwText);
-		ti_mem(sc, tigonFwDataAddr, tigonFwDataLen,
-		    (caddr_t)tigonFwData);
-		ti_mem(sc, tigonFwRodataAddr, tigonFwRodataLen,
-		    (caddr_t)tigonFwRodata);
-		ti_mem(sc, tigonFwBssAddr, tigonFwBssLen, NULL);
-		ti_mem(sc, tigonFwSbssAddr, tigonFwSbssLen, NULL);
-		CSR_WRITE_4(sc, TI_CPU_PROGRAM_COUNTER, tigonFwStartAddr);
-		break;
-	case TI_HWREV_TIGON_II:
-		if (tigon2FwReleaseMajor != TI_FIRMWARE_MAJOR ||
-		    tigon2FwReleaseMinor != TI_FIRMWARE_MINOR ||
-		    tigon2FwReleaseFix != TI_FIRMWARE_FIX) {
-			printf("ti%d: firmware revision mismatch; want "
-			    "%d.%d.%d, got %d.%d.%d\n", sc->ti_unit,
-			    TI_FIRMWARE_MAJOR, TI_FIRMWARE_MINOR,
-			    TI_FIRMWARE_FIX, tigon2FwReleaseMajor,
-			    tigon2FwReleaseMinor, tigon2FwReleaseFix);
-			return;
-		}
-		ti_mem(sc, tigon2FwTextAddr, tigon2FwTextLen,
-		    (caddr_t)tigon2FwText);
-		ti_mem(sc, tigon2FwDataAddr, tigon2FwDataLen,
-		    (caddr_t)tigon2FwData);
-		ti_mem(sc, tigon2FwRodataAddr, tigon2FwRodataLen,
-		    (caddr_t)tigon2FwRodata);
-		ti_mem(sc, tigon2FwBssAddr, tigon2FwBssLen, NULL);
-		ti_mem(sc, tigon2FwSbssAddr, tigon2FwSbssLen, NULL);
-		CSR_WRITE_4(sc, TI_CPU_PROGRAM_COUNTER, tigon2FwStartAddr);
-		break;
-	default:
-		printf("ti%d: can't load firmware: unknown hardware rev\n",
-		    sc->ti_unit);
-		break;
-	}
-}
-
-/*
- * Send the NIC a command via the command ring.
- */
-static void
-ti_cmd(sc, cmd)
-	struct ti_softc		*sc;
-	struct ti_cmd_desc	*cmd;
-{
-	u_int32_t		index;
-
-	if (sc->ti_rdata->ti_cmd_ring == NULL)
-		return;
-
-	index = sc->ti_cmd_saved_prodidx;
-	CSR_WRITE_4(sc, TI_GCR_CMDRING + (index * 4), *(u_int32_t *)(cmd));
-	TI_INC(index, TI_CMD_RING_CNT);
-	CSR_WRITE_4(sc, TI_MB_CMDPROD_IDX, index);
-	sc->ti_cmd_saved_prodidx = index;
-}
-
-/*
- * Send the NIC an extended command. The 'len' parameter specifies the
- * number of command slots to include after the initial command.
- */
-static void
-ti_cmd_ext(sc, cmd, arg, len)
-	struct ti_softc		*sc;
-	struct ti_cmd_desc	*cmd;
-	caddr_t			arg;
-	int			len;
-{
-	u_int32_t		index;
-	register int		i;
-
-	if (sc->ti_rdata->ti_cmd_ring == NULL)
-		return;
-
-	index = sc->ti_cmd_saved_prodidx;
-	CSR_WRITE_4(sc, TI_GCR_CMDRING + (index * 4), *(u_int32_t *)(cmd));
-	TI_INC(index, TI_CMD_RING_CNT);
-	for (i = 0; i < len; i++) {
-		CSR_WRITE_4(sc, TI_GCR_CMDRING + (index * 4),
-		    *(u_int32_t *)(&arg[i * 4]));
-		TI_INC(index, TI_CMD_RING_CNT);
-	}
-	CSR_WRITE_4(sc, TI_MB_CMDPROD_IDX, index);
-	sc->ti_cmd_saved_prodidx = index;
-}
-
-/*
- * Handle events that have triggered interrupts.
- */
-static void
-ti_handle_events(sc)
-	struct ti_softc		*sc;
-{
-	struct ti_event_desc	*e;
-
-	if (sc->ti_rdata->ti_event_ring == NULL)
-		return;
-
-	while (sc->ti_ev_saved_considx != sc->ti_ev_prodidx.ti_idx) {
-		e = &sc->ti_rdata->ti_event_ring[sc->ti_ev_saved_considx];
-		switch (e->ti_event) {
-		case TI_EV_LINKSTAT_CHANGED:
-			sc->ti_linkstat = e->ti_code;
-			if (e->ti_code == TI_EV_CODE_LINK_UP)
-				printf("ti%d: 10/100 link up\n", sc->ti_unit);
-			else if (e->ti_code == TI_EV_CODE_GIG_LINK_UP)
-				printf("ti%d: gigabit link up\n", sc->ti_unit);
-			else if (e->ti_code == TI_EV_CODE_LINK_DOWN)
-				printf("ti%d: link down\n", sc->ti_unit);
-			break;
-		case TI_EV_ERROR:
-			if (e->ti_code == TI_EV_CODE_ERR_INVAL_CMD)
-				printf("ti%d: invalid command\n", sc->ti_unit);
-			else if (e->ti_code == TI_EV_CODE_ERR_UNIMP_CMD)
-				printf("ti%d: unknown command\n", sc->ti_unit);
-			else if (e->ti_code == TI_EV_CODE_ERR_BADCFG)
-				printf("ti%d: bad config data\n", sc->ti_unit);
-			break;
-		case TI_EV_FIRMWARE_UP:
-			ti_init2(sc);
-			break;
-		case TI_EV_STATS_UPDATED:
-			ti_stats_update(sc);
-			break;
-		case TI_EV_RESET_JUMBO_RING:
-		case TI_EV_MCAST_UPDATED:
-			/* Who cares. */
-			break;
-		default:
-			printf("ti%d: unknown event: %d\n",
-			    sc->ti_unit, e->ti_event);
-			break;
-		}
-		/* Advance the consumer index. */
-		TI_INC(sc->ti_ev_saved_considx, TI_EVENT_RING_CNT);
-		CSR_WRITE_4(sc, TI_GCR_EVENTCONS_IDX, sc->ti_ev_saved_considx);
-	}
-}
-
-#ifdef TI_PRIVATE_JUMBOS
-
-/*
- * Memory management for the jumbo receive ring is a pain in the
- * butt. We need to allocate at least 9018 bytes of space per frame,
- * _and_ it has to be contiguous (unless you use the extended
- * jumbo descriptor format). Using malloc() all the time won't
- * work: malloc() allocates memory in powers of two, which means we
- * would end up wasting a considerable amount of space by allocating
- * 9K chunks. We don't have a jumbo mbuf cluster pool. Thus, we have
- * to do our own memory management.
- *
- * The driver needs to allocate a contiguous chunk of memory at boot
- * time. We then chop this up ourselves into 9K pieces and use them
- * as external mbuf storage.
- *
- * One issue here is how much memory to allocate. The jumbo ring has
- * 256 slots in it, but at 9K per slot than can consume over 2MB of
- * RAM. This is a bit much, especially considering we also need
- * RAM for the standard ring and mini ring (on the Tigon 2). To
- * save space, we only actually allocate enough memory for 64 slots
- * by default, which works out to between 500 and 600K. This can
- * be tuned by changing a #define in if_tireg.h.
- */
-
-static int
-ti_alloc_jumbo_mem(sc)
-	struct ti_softc		*sc;
-{
-	caddr_t			ptr;
-	register int		i;
-	struct ti_jpool_entry   *entry;
-
-	/* Grab a big chunk o' storage. */
-	sc->ti_cdata.ti_jumbo_buf = contigmalloc(TI_JMEM, M_DEVBUF,
-		M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0);
-
-	if (sc->ti_cdata.ti_jumbo_buf == NULL) {
-		printf("ti%d: no memory for jumbo buffers!\n", sc->ti_unit);
-		return (ENOBUFS);
-	}
-
-	SLIST_INIT(&sc->ti_jfree_listhead);
-	SLIST_INIT(&sc->ti_jinuse_listhead);
-
-	/*
-	 * Now divide it up into 9K pieces and save the addresses
-	 * in an array.
-	 */
-	ptr = sc->ti_cdata.ti_jumbo_buf;
-	for (i = 0; i < TI_JSLOTS; i++) {
-		sc->ti_cdata.ti_jslots[i] = ptr;
-		ptr += TI_JLEN;
-		entry = malloc(sizeof(struct ti_jpool_entry),
-			       M_DEVBUF, M_NOWAIT);
-		if (entry == NULL) {
-			contigfree(sc->ti_cdata.ti_jumbo_buf, TI_JMEM,
-			           M_DEVBUF);
-			sc->ti_cdata.ti_jumbo_buf = NULL;
-			printf("ti%d: no memory for jumbo "
-			    "buffer queue!\n", sc->ti_unit);
-			return (ENOBUFS);
-		}
-		entry->slot = i;
-		SLIST_INSERT_HEAD(&sc->ti_jfree_listhead, entry, jpool_entries);
-	}
-
-	return (0);
-}
-
-/*
- * Allocate a jumbo buffer.
- */
-static void *ti_jalloc(sc)
-	struct ti_softc		*sc;
-{
-	struct ti_jpool_entry	*entry;
-
-	entry = SLIST_FIRST(&sc->ti_jfree_listhead);
-
-	if (entry == NULL) {
-		printf("ti%d: no free jumbo buffers\n", sc->ti_unit);
-		return (NULL);
-	}
-
-	SLIST_REMOVE_HEAD(&sc->ti_jfree_listhead, jpool_entries);
-	SLIST_INSERT_HEAD(&sc->ti_jinuse_listhead, entry, jpool_entries);
-	return (sc->ti_cdata.ti_jslots[entry->slot]);
-}
-
-/*
- * Release a jumbo buffer.
- */
-static void
-ti_jfree(buf, args)
-	void			*buf;
-	void			*args;
-{
-	struct ti_softc		*sc;
-	int			i;
-	struct ti_jpool_entry	*entry;
-
-	/* Extract the softc struct pointer. */
-	sc = (struct ti_softc *)args;
-
-	if (sc == NULL)
-		panic("ti_jfree: didn't get softc pointer!");
-
-	/* calculate the slot this buffer belongs to */
-	i = ((vm_offset_t)buf
-	     - (vm_offset_t)sc->ti_cdata.ti_jumbo_buf) / TI_JLEN;
-
-	if ((i < 0) || (i >= TI_JSLOTS))
-		panic("ti_jfree: asked to free buffer that we don't manage!");
-
-	entry = SLIST_FIRST(&sc->ti_jinuse_listhead);
-	if (entry == NULL)
-		panic("ti_jfree: buffer not in use!");
-	entry->slot = i;
-	SLIST_REMOVE_HEAD(&sc->ti_jinuse_listhead, jpool_entries);
-	SLIST_INSERT_HEAD(&sc->ti_jfree_listhead, entry, jpool_entries);
-}
-
-#endif /* TI_PRIVATE_JUMBOS */
-
-/*
- * Intialize a standard receive ring descriptor.
- */
-static int
-ti_newbuf_std(sc, i, m)
-	struct ti_softc		*sc;
-	int			i;
-	struct mbuf		*m;
-{
-	struct mbuf		*m_new = NULL;
-	struct ti_rx_desc	*r;
-
-	if (m == NULL) {
-		MGETHDR(m_new, M_DONTWAIT, MT_DATA);
-		if (m_new == NULL)
-			return (ENOBUFS);
-
-		MCLGET(m_new, M_DONTWAIT);
-		if (!(m_new->m_flags & M_EXT)) {
-			m_freem(m_new);
-			return (ENOBUFS);
-		}
-		m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
-	} else {
-		m_new = m;
-		m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
-		m_new->m_data = m_new->m_ext.ext_buf;
-	}
-
-	m_adj(m_new, ETHER_ALIGN);
-	sc->ti_cdata.ti_rx_std_chain[i] = m_new;
-	r = &sc->ti_rdata->ti_rx_std_ring[i];
-	TI_HOSTADDR(r->ti_addr) = vtophys(mtod(m_new, caddr_t));
-	r->ti_type = TI_BDTYPE_RECV_BD;
-	r->ti_flags = 0;
-	if (sc->ti_ifp->if_hwassist)
-		r->ti_flags |= TI_BDFLAG_TCP_UDP_CKSUM | TI_BDFLAG_IP_CKSUM;
-	r->ti_len = m_new->m_len;
-	r->ti_idx = i;
-
-	return (0);
-}
-
-/*
- * Intialize a mini receive ring descriptor. This only applies to
- * the Tigon 2.
- */
-static int
-ti_newbuf_mini(sc, i, m)
-	struct ti_softc		*sc;
-	int			i;
-	struct mbuf		*m;
-{
-	struct mbuf		*m_new = NULL;
-	struct ti_rx_desc	*r;
-
-	if (m == NULL) {
-		MGETHDR(m_new, M_DONTWAIT, MT_DATA);
-		if (m_new == NULL) {
-			return (ENOBUFS);
-		}
-		m_new->m_len = m_new->m_pkthdr.len = MHLEN;
-	} else {
-		m_new = m;
-		m_new->m_data = m_new->m_pktdat;
-		m_new->m_len = m_new->m_pkthdr.len = MHLEN;
-	}
-
-	m_adj(m_new, ETHER_ALIGN);
-	r = &sc->ti_rdata->ti_rx_mini_ring[i];
-	sc->ti_cdata.ti_rx_mini_chain[i] = m_new;
-	TI_HOSTADDR(r->ti_addr) = vtophys(mtod(m_new, caddr_t));
-	r->ti_type = TI_BDTYPE_RECV_BD;
-	r->ti_flags = TI_BDFLAG_MINI_RING;
-	if (sc->ti_ifp->if_hwassist)
-		r->ti_flags |= TI_BDFLAG_TCP_UDP_CKSUM | TI_BDFLAG_IP_CKSUM;
-	r->ti_len = m_new->m_len;
-	r->ti_idx = i;
-
-	return (0);
-}
-
-#ifdef TI_PRIVATE_JUMBOS
-
-/*
- * Initialize a jumbo receive ring descriptor. This allocates
- * a jumbo buffer from the pool managed internally by the driver.
- */
-static int
-ti_newbuf_jumbo(sc, i, m)
-	struct ti_softc		*sc;
-	int			i;
-	struct mbuf		*m;
-{
-	struct mbuf		*m_new = NULL;
-	struct ti_rx_desc	*r;
-
-	if (m == NULL) {
-		caddr_t			*buf = NULL;
-
-		/* Allocate the mbuf. */
-		MGETHDR(m_new, M_DONTWAIT, MT_DATA);
-		if (m_new == NULL) {
-			return (ENOBUFS);
-		}
-
-		/* Allocate the jumbo buffer */
-		buf = ti_jalloc(sc);
-		if (buf == NULL) {
-			m_freem(m_new);
-			printf("ti%d: jumbo allocation failed "
-			    "-- packet dropped!\n", sc->ti_unit);
-			return (ENOBUFS);
-		}
-
-		/* Attach the buffer to the mbuf. */
-		m_new->m_data = (void *) buf;
-		m_new->m_len = m_new->m_pkthdr.len = TI_JUMBO_FRAMELEN;
-		MEXTADD(m_new, buf, TI_JUMBO_FRAMELEN, ti_jfree,
-		    (struct ti_softc *)sc, 0, EXT_NET_DRV);
-	} else {
-		m_new = m;
-		m_new->m_data = m_new->m_ext.ext_buf;
-		m_new->m_ext.ext_size = TI_JUMBO_FRAMELEN;
-	}
-
-	m_adj(m_new, ETHER_ALIGN);
-	/* Set up the descriptor. */
-	r = &sc->ti_rdata->ti_rx_jumbo_ring[i];
-	sc->ti_cdata.ti_rx_jumbo_chain[i] = m_new;
-	TI_HOSTADDR(r->ti_addr) = vtophys(mtod(m_new, caddr_t));
-	r->ti_type = TI_BDTYPE_RECV_JUMBO_BD;
-	r->ti_flags = TI_BDFLAG_JUMBO_RING;
-	if (sc->ti_ifp->if_hwassist)
-		r->ti_flags |= TI_BDFLAG_TCP_UDP_CKSUM | TI_BDFLAG_IP_CKSUM;
-	r->ti_len = m_new->m_len;
-	r->ti_idx = i;
-
-	return (0);
-}
-
-#else
-#include <vm/vm_page.h>
-
-#if (PAGE_SIZE == 4096)
-#define NPAYLOAD 2
-#else
-#define NPAYLOAD 1
-#endif
-
-#define TCP_HDR_LEN (52 + sizeof(struct ether_header))
-#define UDP_HDR_LEN (28 + sizeof(struct ether_header))
-#define NFS_HDR_LEN (UDP_HDR_LEN)
-static int HDR_LEN =  TCP_HDR_LEN;
-
-
-/*
- * Initialize a jumbo receive ring descriptor. This allocates
- * a jumbo buffer from the pool managed internally by the driver.
- */
-static int
-ti_newbuf_jumbo(sc, idx, m_old)
-	struct ti_softc		*sc;
-	int			idx;
-	struct mbuf		*m_old;
-{
-	struct mbuf		*cur, *m_new = NULL;
-	struct mbuf		*m[3] = {NULL, NULL, NULL};
-	struct ti_rx_desc_ext	*r;
-	vm_page_t		frame;
-	static int		color;
-				/* 1 extra buf to make nobufs easy*/
-	struct sf_buf		*sf[3] = {NULL, NULL, NULL};
-	int			i;
-
-	if (m_old != NULL) {
-		m_new = m_old;
-		cur = m_old->m_next;
-		for (i = 0; i <= NPAYLOAD; i++){
-			m[i] = cur;
-			cur = cur->m_next;
-		}
-	} else {
-		/* Allocate the mbufs. */
-		MGETHDR(m_new, M_DONTWAIT, MT_DATA);
-		if (m_new == NULL) {
-			printf("ti%d: mbuf allocation failed "
-			       "-- packet dropped!\n", sc->ti_unit);
-			goto nobufs;
-		}
-		MGET(m[NPAYLOAD], M_DONTWAIT, MT_DATA);
-		if (m[NPAYLOAD] == NULL) {
-			printf("ti%d: cluster mbuf allocation failed "
-			       "-- packet dropped!\n", sc->ti_unit);
-			goto nobufs;
-		}
-		MCLGET(m[NPAYLOAD], M_DONTWAIT);
-		if ((m[NPAYLOAD]->m_flags & M_EXT) == 0) {
-			printf("ti%d: mbuf allocation failed "
-			       "-- packet dropped!\n", sc->ti_unit);
-			goto nobufs;
-		}
-		m[NPAYLOAD]->m_len = MCLBYTES;
-
-		for (i = 0; i < NPAYLOAD; i++){
-			MGET(m[i], M_DONTWAIT, MT_DATA);
-			if (m[i] == NULL) {
-				printf("ti%d: mbuf allocation failed "
-				       "-- packet dropped!\n", sc->ti_unit);
-				goto nobufs;
-			}
-			frame = vm_page_alloc(NULL, color++,
-			    VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ |
-			    VM_ALLOC_WIRED);
-			if (frame == NULL) {
-				printf("ti%d: buffer allocation failed "
-				       "-- packet dropped!\n", sc->ti_unit);
-				printf("      index %d page %d\n", idx, i);
-				goto nobufs;
-			}
-			sf[i] = sf_buf_alloc(frame, SFB_NOWAIT);
-			if (sf[i] == NULL) {
-				vm_page_lock_queues();
-				vm_page_unwire(frame, 0);
-				vm_page_free(frame);
-				vm_page_unlock_queues();
-				printf("ti%d: buffer allocation failed "
-				       "-- packet dropped!\n", sc->ti_unit);
-				printf("      index %d page %d\n", idx, i);
-				goto nobufs;
-			}
-		}
-		for (i = 0; i < NPAYLOAD; i++){
-		/* Attach the buffer to the mbuf. */
-			m[i]->m_data = (void *)sf_buf_kva(sf[i]);
-			m[i]->m_len = PAGE_SIZE;
-			MEXTADD(m[i], sf_buf_kva(sf[i]), PAGE_SIZE,
-			    sf_buf_mext, sf[i], 0, EXT_DISPOSABLE);
-			m[i]->m_next = m[i+1];
-		}
-		/* link the buffers to the header */
-		m_new->m_next = m[0];
-		m_new->m_data += ETHER_ALIGN;
-		if (sc->ti_hdrsplit)
-			m_new->m_len = MHLEN - ETHER_ALIGN;
-		else
-			m_new->m_len = HDR_LEN;
-		m_new->m_pkthdr.len = NPAYLOAD * PAGE_SIZE + m_new->m_len;
-	}
-
-	/* Set up the descriptor. */
-	r = &sc->ti_rdata->ti_rx_jumbo_ring[idx];
-	sc->ti_cdata.ti_rx_jumbo_chain[idx] = m_new;
-	TI_HOSTADDR(r->ti_addr0) = vtophys(mtod(m_new, caddr_t));
-	r->ti_len0 = m_new->m_len;
-
-	TI_HOSTADDR(r->ti_addr1) = vtophys(mtod(m[0], caddr_t));
-	r->ti_len1 = PAGE_SIZE;
-
-	TI_HOSTADDR(r->ti_addr2) = vtophys(mtod(m[1], caddr_t));
-	r->ti_len2 = m[1]->m_ext.ext_size; /* could be PAGE_SIZE or MCLBYTES */
-
-	if (PAGE_SIZE == 4096) {
-		TI_HOSTADDR(r->ti_addr3) = vtophys(mtod(m[2], caddr_t));
-		r->ti_len3 = MCLBYTES;
-	} else {
-		r->ti_len3 = 0;
-	}
-	r->ti_type = TI_BDTYPE_RECV_JUMBO_BD;
-
-	r->ti_flags = TI_BDFLAG_JUMBO_RING|TI_RCB_FLAG_USE_EXT_RX_BD;
-
-	if (sc->ti_ifp->if_hwassist)
-		r->ti_flags |= TI_BDFLAG_TCP_UDP_CKSUM|TI_BDFLAG_IP_CKSUM;
-
-	r->ti_idx = idx;
-
-	return (0);
-
-nobufs:
-
-	/*
-	 * Warning! :
-	 * This can only be called before the mbufs are strung together.
-	 * If the mbufs are strung together, m_freem() will free the chain,
-	 * so that the later mbufs will be freed multiple times.
-	 */
-	if (m_new)
-		m_freem(m_new);
-
-	for (i = 0; i < 3; i++) {
-		if (m[i])
-			m_freem(m[i]);
-		if (sf[i])
-			sf_buf_mext((void *)sf_buf_kva(sf[i]), sf[i]);
-	}
-	return (ENOBUFS);
-}
-#endif
-
-
-
-/*
- * The standard receive ring has 512 entries in it. At 2K per mbuf cluster,
- * that's 1MB or memory, which is a lot. For now, we fill only the first
- * 256 ring entries and hope that our CPU is fast enough to keep up with
- * the NIC.
- */
-static int
-ti_init_rx_ring_std(sc)
-	struct ti_softc		*sc;
-{
-	register int		i;
-	struct ti_cmd_desc	cmd;
-
-	for (i = 0; i < TI_SSLOTS; i++) {
-		if (ti_newbuf_std(sc, i, NULL) == ENOBUFS)
-			return (ENOBUFS);
-	};
-
-	TI_UPDATE_STDPROD(sc, i - 1);
-	sc->ti_std = i - 1;
-
-	return (0);
-}
-
-static void
-ti_free_rx_ring_std(sc)
-	struct ti_softc		*sc;
-{
-	register int		i;
-
-	for (i = 0; i < TI_STD_RX_RING_CNT; i++) {
-		if (sc->ti_cdata.ti_rx_std_chain[i] != NULL) {
-			m_freem(sc->ti_cdata.ti_rx_std_chain[i]);
-			sc->ti_cdata.ti_rx_std_chain[i] = NULL;
-		}
-		bzero((char *)&sc->ti_rdata->ti_rx_std_ring[i],
-		    sizeof(struct ti_rx_desc));
-	}
-}
-
-static int
-ti_init_rx_ring_jumbo(sc)
-	struct ti_softc		*sc;
-{
-	register int		i;
-	struct ti_cmd_desc	cmd;
-
-	for (i = 0; i < TI_JUMBO_RX_RING_CNT; i++) {
-		if (ti_newbuf_jumbo(sc, i, NULL) == ENOBUFS)
-			return (ENOBUFS);
-	};
-
-	TI_UPDATE_JUMBOPROD(sc, i - 1);
-	sc->ti_jumbo = i - 1;
-
-	return (0);
-}
-
-static void
-ti_free_rx_ring_jumbo(sc)
-	struct ti_softc		*sc;
-{
-	register int		i;
-
-	for (i = 0; i < TI_JUMBO_RX_RING_CNT; i++) {
-		if (sc->ti_cdata.ti_rx_jumbo_chain[i] != NULL) {
-			m_freem(sc->ti_cdata.ti_rx_jumbo_chain[i]);
-			sc->ti_cdata.ti_rx_jumbo_chain[i] = NULL;
-		}
-		bzero((char *)&sc->ti_rdata->ti_rx_jumbo_ring[i],
-		    sizeof(struct ti_rx_desc));
-	}
-}
-
-static int
-ti_init_rx_ring_mini(sc)
-	struct ti_softc		*sc;
-{
-	register int		i;
-
-	for (i = 0; i < TI_MSLOTS; i++) {
-		if (ti_newbuf_mini(sc, i, NULL) == ENOBUFS)
-			return (ENOBUFS);
-	};
-
-	TI_UPDATE_MINIPROD(sc, i - 1);
-	sc->ti_mini = i - 1;
-
-	return (0);
-}
-
-static void
-ti_free_rx_ring_mini(sc)
-	struct ti_softc		*sc;
-{
-	register int		i;
-
-	for (i = 0; i < TI_MINI_RX_RING_CNT; i++) {
-		if (sc->ti_cdata.ti_rx_mini_chain[i] != NULL) {
-			m_freem(sc->ti_cdata.ti_rx_mini_chain[i]);
-			sc->ti_cdata.ti_rx_mini_chain[i] = NULL;
-		}
-		bzero((char *)&sc->ti_rdata->ti_rx_mini_ring[i],
-		    sizeof(struct ti_rx_desc));
-	}
-}
-
-static void
-ti_free_tx_ring(sc)
-	struct ti_softc		*sc;
-{
-	register int		i;
-
-	if (sc->ti_rdata->ti_tx_ring == NULL)
-		return;
-
-	for (i = 0; i < TI_TX_RING_CNT; i++) {
-		if (sc->ti_cdata.ti_tx_chain[i] != NULL) {
-			m_freem(sc->ti_cdata.ti_tx_chain[i]);
-			sc->ti_cdata.ti_tx_chain[i] = NULL;
-		}
-		bzero((char *)&sc->ti_rdata->ti_tx_ring[i],
-		    sizeof(struct ti_tx_desc));
-	}
-}
-
-static int
-ti_init_tx_ring(sc)
-	struct ti_softc		*sc;
-{
-	sc->ti_txcnt = 0;
-	sc->ti_tx_saved_considx = 0;
-	CSR_WRITE_4(sc, TI_MB_SENDPROD_IDX, 0);
-	return (0);
-}
-
-/*
- * The Tigon 2 firmware has a new way to add/delete multicast addresses,
- * but we have to support the old way too so that Tigon 1 cards will
- * work.
- */
-static void
-ti_add_mcast(sc, addr)
-	struct ti_softc		*sc;
-	struct ether_addr	*addr;
-{
-	struct ti_cmd_desc	cmd;
-	u_int16_t		*m;
-	u_int32_t		ext[2] = {0, 0};
-
-	m = (u_int16_t *)&addr->octet[0];
-
-	switch (sc->ti_hwrev) {
-	case TI_HWREV_TIGON:
-		CSR_WRITE_4(sc, TI_GCR_MAR0, htons(m[0]));
-		CSR_WRITE_4(sc, TI_GCR_MAR1, (htons(m[1]) << 16) | htons(m[2]));
-		TI_DO_CMD(TI_CMD_ADD_MCAST_ADDR, 0, 0);
-		break;
-	case TI_HWREV_TIGON_II:
-		ext[0] = htons(m[0]);
-		ext[1] = (htons(m[1]) << 16) | htons(m[2]);
-		TI_DO_CMD_EXT(TI_CMD_EXT_ADD_MCAST, 0, 0, (caddr_t)&ext, 2);
-		break;
-	default:
-		printf("ti%d: unknown hwrev\n", sc->ti_unit);
-		break;
-	}
-}
-
-static void
-ti_del_mcast(sc, addr)
-	struct ti_softc		*sc;
-	struct ether_addr	*addr;
-{
-	struct ti_cmd_desc	cmd;
-	u_int16_t		*m;
-	u_int32_t		ext[2] = {0, 0};
-
-	m = (u_int16_t *)&addr->octet[0];
-
-	switch (sc->ti_hwrev) {
-	case TI_HWREV_TIGON:
-		CSR_WRITE_4(sc, TI_GCR_MAR0, htons(m[0]));
-		CSR_WRITE_4(sc, TI_GCR_MAR1, (htons(m[1]) << 16) | htons(m[2]));
-		TI_DO_CMD(TI_CMD_DEL_MCAST_ADDR, 0, 0);
-		break;
-	case TI_HWREV_TIGON_II:
-		ext[0] = htons(m[0]);
-		ext[1] = (htons(m[1]) << 16) | htons(m[2]);
-		TI_DO_CMD_EXT(TI_CMD_EXT_DEL_MCAST, 0, 0, (caddr_t)&ext, 2);
-		break;
-	default:
-		printf("ti%d: unknown hwrev\n", sc->ti_unit);
-		break;
-	}
-}
-
-/*
- * Configure the Tigon's multicast address filter.
- *
- * The actual multicast table management is a bit of a pain, thanks to
- * slight brain damage on the part of both Alteon and us. With our
- * multicast code, we are only alerted when the multicast address table
- * changes and at that point we only have the current list of addresses:
- * we only know the current state, not the previous state, so we don't
- * actually know what addresses were removed or added. The firmware has
- * state, but we can't get our grubby mits on it, and there is no 'delete
- * all multicast addresses' command. Hence, we have to maintain our own
- * state so we know what addresses have been programmed into the NIC at
- * any given time.
- */
-static void
-ti_setmulti(sc)
-	struct ti_softc		*sc;
-{
-	struct ifnet		*ifp;
-	struct ifmultiaddr	*ifma;
-	struct ti_cmd_desc	cmd;
-	struct ti_mc_entry	*mc;
-	u_int32_t		intrs;
-
-	ifp = sc->ti_ifp;
-
-	if (ifp->if_flags & IFF_ALLMULTI) {
-		TI_DO_CMD(TI_CMD_SET_ALLMULTI, TI_CMD_CODE_ALLMULTI_ENB, 0);
-		return;
-	} else {
-		TI_DO_CMD(TI_CMD_SET_ALLMULTI, TI_CMD_CODE_ALLMULTI_DIS, 0);
-	}
-
-	/* Disable interrupts. */
-	intrs = CSR_READ_4(sc, TI_MB_HOSTINTR);
-	CSR_WRITE_4(sc, TI_MB_HOSTINTR, 1);
-
-	/* First, zot all the existing filters. */
-	while (SLIST_FIRST(&sc->ti_mc_listhead) != NULL) {
-		mc = SLIST_FIRST(&sc->ti_mc_listhead);
-		ti_del_mcast(sc, &mc->mc_addr);
-		SLIST_REMOVE_HEAD(&sc->ti_mc_listhead, mc_entries);
-		free(mc, M_DEVBUF);
-	}
-
-	/* Now program new ones. */
-	IF_ADDR_LOCK(ifp);
-	TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
-		if (ifma->ifma_addr->sa_family != AF_LINK)
-			continue;
-		mc = malloc(sizeof(struct ti_mc_entry), M_DEVBUF, M_NOWAIT);
-		if (mc == NULL) {
-			if_printf(ifp, "no memory for mcast filter entry\n");
-			continue;
-		}
-		bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr),
-		    (char *)&mc->mc_addr, ETHER_ADDR_LEN);
-		SLIST_INSERT_HEAD(&sc->ti_mc_listhead, mc, mc_entries);
-		ti_add_mcast(sc, &mc->mc_addr);
-	}
-	IF_ADDR_UNLOCK(ifp);
-
-	/* Re-enable interrupts. */
-	CSR_WRITE_4(sc, TI_MB_HOSTINTR, intrs);
-}
-
-/*
- * Check to see if the BIOS has configured us for a 64 bit slot when
- * we aren't actually in one. If we detect this condition, we can work
- * around it on the Tigon 2 by setting a bit in the PCI state register,
- * but for the Tigon 1 we must give up and abort the interface attach.
- */
-static int ti_64bitslot_war(sc)
-	struct ti_softc		*sc;
-{
-	if (!(CSR_READ_4(sc, TI_PCI_STATE) & TI_PCISTATE_32BIT_BUS)) {
-		CSR_WRITE_4(sc, 0x600, 0);
-		CSR_WRITE_4(sc, 0x604, 0);
-		CSR_WRITE_4(sc, 0x600, 0x5555AAAA);
-		if (CSR_READ_4(sc, 0x604) == 0x5555AAAA) {
-			if (sc->ti_hwrev == TI_HWREV_TIGON)
-				return (EINVAL);
-			else {
-				TI_SETBIT(sc, TI_PCI_STATE,
-				    TI_PCISTATE_32BIT_BUS);
-				return (0);
-			}
-		}
-	}
-
-	return (0);
-}
-
-/*
- * Do endian, PCI and DMA initialization. Also check the on-board ROM
- * self-test results.
- */
-static int
-ti_chipinit(sc)
-	struct ti_softc		*sc;
-{
-	u_int32_t		cacheline;
-	u_int32_t		pci_writemax = 0;
-	u_int32_t		hdrsplit;
-
-	/* Initialize link to down state. */
-	sc->ti_linkstat = TI_EV_CODE_LINK_DOWN;
-
-	if (sc->ti_ifp->if_capenable & IFCAP_HWCSUM)
-		sc->ti_ifp->if_hwassist = TI_CSUM_FEATURES;
-	else
-		sc->ti_ifp->if_hwassist = 0;
-
-	/* Set endianness before we access any non-PCI registers. */
-#if BYTE_ORDER == BIG_ENDIAN
-	CSR_WRITE_4(sc, TI_MISC_HOST_CTL,
-	    TI_MHC_BIGENDIAN_INIT | (TI_MHC_BIGENDIAN_INIT << 24));
-#else
-	CSR_WRITE_4(sc, TI_MISC_HOST_CTL,
-	    TI_MHC_LITTLEENDIAN_INIT | (TI_MHC_LITTLEENDIAN_INIT << 24));
-#endif
-
-	/* Check the ROM failed bit to see if self-tests passed. */
-	if (CSR_READ_4(sc, TI_CPU_STATE) & TI_CPUSTATE_ROMFAIL) {
-		printf("ti%d: board self-diagnostics failed!\n", sc->ti_unit);
-		return (ENODEV);
-	}
-
-	/* Halt the CPU. */
-	TI_SETBIT(sc, TI_CPU_STATE, TI_CPUSTATE_HALT);
-
-	/* Figure out the hardware revision. */
-	switch (CSR_READ_4(sc, TI_MISC_HOST_CTL) & TI_MHC_CHIP_REV_MASK) {
-	case TI_REV_TIGON_I:
-		sc->ti_hwrev = TI_HWREV_TIGON;
-		break;
-	case TI_REV_TIGON_II:
-		sc->ti_hwrev = TI_HWREV_TIGON_II;
-		break;
-	default:
-		printf("ti%d: unsupported chip revision\n", sc->ti_unit);
-		return (ENODEV);
-	}
-
-	/* Do special setup for Tigon 2. */
-	if (sc->ti_hwrev == TI_HWREV_TIGON_II) {
-		TI_SETBIT(sc, TI_CPU_CTL_B, TI_CPUSTATE_HALT);
-		TI_SETBIT(sc, TI_MISC_LOCAL_CTL, TI_MLC_SRAM_BANK_512K);
-		TI_SETBIT(sc, TI_MISC_CONF, TI_MCR_SRAM_SYNCHRONOUS);
-	}
-
-	/*
-	 * We don't have firmware source for the Tigon 1, so Tigon 1 boards
-	 * can't do header splitting.
-	 */
-#ifdef TI_JUMBO_HDRSPLIT
-	if (sc->ti_hwrev != TI_HWREV_TIGON)
-		sc->ti_hdrsplit = 1;
-	else
-		printf("ti%d: can't do header splitting on a Tigon I board\n",
-		       sc->ti_unit);
-#endif /* TI_JUMBO_HDRSPLIT */
-
-	/* Set up the PCI state register. */
-	CSR_WRITE_4(sc, TI_PCI_STATE, TI_PCI_READ_CMD|TI_PCI_WRITE_CMD);
-	if (sc->ti_hwrev == TI_HWREV_TIGON_II) {
-		TI_SETBIT(sc, TI_PCI_STATE, TI_PCISTATE_USE_MEM_RD_MULT);
-	}
-
-	/* Clear the read/write max DMA parameters. */
-	TI_CLRBIT(sc, TI_PCI_STATE, (TI_PCISTATE_WRITE_MAXDMA|
-	    TI_PCISTATE_READ_MAXDMA));
-
-	/* Get cache line size. */
-	cacheline = CSR_READ_4(sc, TI_PCI_BIST) & 0xFF;
-
-	/*
-	 * If the system has set enabled the PCI memory write
-	 * and invalidate command in the command register, set
-	 * the write max parameter accordingly. This is necessary
-	 * to use MWI with the Tigon 2.
-	 */
-	if (CSR_READ_4(sc, TI_PCI_CMDSTAT) & PCIM_CMD_MWIEN) {
-		switch (cacheline) {
-		case 1:
-		case 4:
-		case 8:
-		case 16:
-		case 32:
-		case 64:
-			break;
-		default:
-		/* Disable PCI memory write and invalidate. */
-			if (bootverbose)
-				printf("ti%d: cache line size %d not "
-				    "supported; disabling PCI MWI\n",
-				    sc->ti_unit, cacheline);
-			CSR_WRITE_4(sc, TI_PCI_CMDSTAT, CSR_READ_4(sc,
-			    TI_PCI_CMDSTAT) & ~PCIM_CMD_MWIEN);
-			break;
-		}
-	}
-
-#ifdef __brokenalpha__
-	/*
-	 * From the Alteon sample driver:
-	 * Must insure that we do not cross an 8K (bytes) boundary
-	 * for DMA reads.  Our highest limit is 1K bytes.  This is a
-	 * restriction on some ALPHA platforms with early revision
-	 * 21174 PCI chipsets, such as the AlphaPC 164lx
-	 */
-	TI_SETBIT(sc, TI_PCI_STATE, pci_writemax|TI_PCI_READMAX_1024);
-#else
-	TI_SETBIT(sc, TI_PCI_STATE, pci_writemax);
-#endif
-
-	/* This sets the min dma param all the way up (0xff). */
-	TI_SETBIT(sc, TI_PCI_STATE, TI_PCISTATE_MINDMA);
-
-	if (sc->ti_hdrsplit)
-		hdrsplit = TI_OPMODE_JUMBO_HDRSPLIT;
-	else
-		hdrsplit = 0;
-
-	/* Configure DMA variables. */
-#if BYTE_ORDER == BIG_ENDIAN
-	CSR_WRITE_4(sc, TI_GCR_OPMODE, TI_OPMODE_BYTESWAP_BD |
-	    TI_OPMODE_BYTESWAP_DATA | TI_OPMODE_WORDSWAP_BD |
-	    TI_OPMODE_WARN_ENB | TI_OPMODE_FATAL_ENB |
-	    TI_OPMODE_DONT_FRAG_JUMBO | hdrsplit);
-#else /* BYTE_ORDER */
-	CSR_WRITE_4(sc, TI_GCR_OPMODE, TI_OPMODE_BYTESWAP_DATA|
-	    TI_OPMODE_WORDSWAP_BD|TI_OPMODE_DONT_FRAG_JUMBO|
-	    TI_OPMODE_WARN_ENB|TI_OPMODE_FATAL_ENB | hdrsplit);
-#endif /* BYTE_ORDER */
-
-	/*
-	 * Only allow 1 DMA channel to be active at a time.
-	 * I don't think this is a good idea, but without it
-	 * the firmware racks up lots of nicDmaReadRingFull
-	 * errors.  This is not compatible with hardware checksums.
-	 */
-	if (sc->ti_ifp->if_hwassist == 0)
-		TI_SETBIT(sc, TI_GCR_OPMODE, TI_OPMODE_1_DMA_ACTIVE);
-
-	/* Recommended settings from Tigon manual. */
-	CSR_WRITE_4(sc, TI_GCR_DMA_WRITECFG, TI_DMA_STATE_THRESH_8W);
-	CSR_WRITE_4(sc, TI_GCR_DMA_READCFG, TI_DMA_STATE_THRESH_8W);
-
-	if (ti_64bitslot_war(sc)) {
-		printf("ti%d: bios thinks we're in a 64 bit slot, "
-		    "but we aren't", sc->ti_unit);
-		return (EINVAL);
-	}
-
-	return (0);
-}
-
-#define	TI_RD_OFF(x)	offsetof(struct ti_ring_data, x)
-
-/*
- * Initialize the general information block and firmware, and
- * start the CPU(s) running.
- */
-static int
-ti_gibinit(sc)
-	struct ti_softc		*sc;
-{
-	struct ti_rcb		*rcb;
-	int			i;
-	struct ifnet		*ifp;
-	uint32_t		rdphys;
-
-	ifp = sc->ti_ifp;
-	rdphys = sc->ti_rdata_phys;
-
-	/* Disable interrupts for now. */
-	CSR_WRITE_4(sc, TI_MB_HOSTINTR, 1);
-
-	/*
-	 * Tell the chip where to find the general information block.
-	 * While this struct could go into >4GB memory, we allocate it in a
-	 * single slab with the other descriptors, and those don't seem to
-	 * support being located in a 64-bit region.
-	 */
-	CSR_WRITE_4(sc, TI_GCR_GENINFO_HI, 0);
-	CSR_WRITE_4(sc, TI_GCR_GENINFO_LO, rdphys + TI_RD_OFF(ti_info));
-
-	/* Load the firmware into SRAM. */
-	ti_loadfw(sc);
-
-	/* Set up the contents of the general info and ring control blocks. */
-
-	/* Set up the event ring and producer pointer. */
-	rcb = &sc->ti_rdata->ti_info.ti_ev_rcb;
-
-	TI_HOSTADDR(rcb->ti_hostaddr) = rdphys + TI_RD_OFF(ti_event_ring);
-	rcb->ti_flags = 0;
-	TI_HOSTADDR(sc->ti_rdata->ti_info.ti_ev_prodidx_ptr) =
-	    rdphys + TI_RD_OFF(ti_ev_prodidx_r);
-	sc->ti_ev_prodidx.ti_idx = 0;
-	CSR_WRITE_4(sc, TI_GCR_EVENTCONS_IDX, 0);
-	sc->ti_ev_saved_considx = 0;
-
-	/* Set up the command ring and producer mailbox. */
-	rcb = &sc->ti_rdata->ti_info.ti_cmd_rcb;
-
-	sc->ti_rdata->ti_cmd_ring =
-	    (struct ti_cmd_desc *)(sc->ti_vhandle + TI_GCR_CMDRING);
-	TI_HOSTADDR(rcb->ti_hostaddr) = TI_GCR_NIC_ADDR(TI_GCR_CMDRING);
-	rcb->ti_flags = 0;
-	rcb->ti_max_len = 0;
-	for (i = 0; i < TI_CMD_RING_CNT; i++) {
-		CSR_WRITE_4(sc, TI_GCR_CMDRING + (i * 4), 0);
-	}
-	CSR_WRITE_4(sc, TI_GCR_CMDCONS_IDX, 0);
-	CSR_WRITE_4(sc, TI_MB_CMDPROD_IDX, 0);
-	sc->ti_cmd_saved_prodidx = 0;
-
-	/*
-	 * Assign the address of the stats refresh buffer.
-	 * We re-use the current stats buffer for this to
-	 * conserve memory.
-	 */
-	TI_HOSTADDR(sc->ti_rdata->ti_info.ti_refresh_stats_ptr) =
-	    rdphys + TI_RD_OFF(ti_info.ti_stats);
-
-	/* Set up the standard receive ring. */
-	rcb = &sc->ti_rdata->ti_info.ti_std_rx_rcb;
-	TI_HOSTADDR(rcb->ti_hostaddr) = rdphys + TI_RD_OFF(ti_rx_std_ring);
-	rcb->ti_max_len = TI_FRAMELEN;
-	rcb->ti_flags = 0;
-	if (sc->ti_ifp->if_hwassist)
-		rcb->ti_flags |= TI_RCB_FLAG_TCP_UDP_CKSUM |
-		     TI_RCB_FLAG_IP_CKSUM | TI_RCB_FLAG_NO_PHDR_CKSUM;
-	rcb->ti_flags |= TI_RCB_FLAG_VLAN_ASSIST;
-
-	/* Set up the jumbo receive ring. */
-	rcb = &sc->ti_rdata->ti_info.ti_jumbo_rx_rcb;
-	TI_HOSTADDR(rcb->ti_hostaddr) = rdphys + TI_RD_OFF(ti_rx_jumbo_ring);
-
-#ifdef TI_PRIVATE_JUMBOS
-	rcb->ti_max_len = TI_JUMBO_FRAMELEN;
-	rcb->ti_flags = 0;
-#else
-	rcb->ti_max_len = PAGE_SIZE;
-	rcb->ti_flags = TI_RCB_FLAG_USE_EXT_RX_BD;
-#endif
-	if (sc->ti_ifp->if_hwassist)
-		rcb->ti_flags |= TI_RCB_FLAG_TCP_UDP_CKSUM |
-		     TI_RCB_FLAG_IP_CKSUM | TI_RCB_FLAG_NO_PHDR_CKSUM;
-	rcb->ti_flags |= TI_RCB_FLAG_VLAN_ASSIST;
-
-	/*
-	 * Set up the mini ring. Only activated on the
-	 * Tigon 2 but the slot in the config block is
-	 * still there on the Tigon 1.
-	 */
-	rcb = &sc->ti_rdata->ti_info.ti_mini_rx_rcb;
-	TI_HOSTADDR(rcb->ti_hostaddr) = rdphys + TI_RD_OFF(ti_rx_mini_ring);
-	rcb->ti_max_len = MHLEN - ETHER_ALIGN;
-	if (sc->ti_hwrev == TI_HWREV_TIGON)
-		rcb->ti_flags = TI_RCB_FLAG_RING_DISABLED;
-	else
-		rcb->ti_flags = 0;
-	if (sc->ti_ifp->if_hwassist)
-		rcb->ti_flags |= TI_RCB_FLAG_TCP_UDP_CKSUM |
-		     TI_RCB_FLAG_IP_CKSUM | TI_RCB_FLAG_NO_PHDR_CKSUM;
-	rcb->ti_flags |= TI_RCB_FLAG_VLAN_ASSIST;
-
-	/*
-	 * Set up the receive return ring.
-	 */
-	rcb = &sc->ti_rdata->ti_info.ti_return_rcb;
-	TI_HOSTADDR(rcb->ti_hostaddr) = rdphys + TI_RD_OFF(ti_rx_return_ring);
-	rcb->ti_flags = 0;
-	rcb->ti_max_len = TI_RETURN_RING_CNT;
-	TI_HOSTADDR(sc->ti_rdata->ti_info.ti_return_prodidx_ptr) =
-	    rdphys + TI_RD_OFF(ti_return_prodidx_r);
-
-	/*
-	 * Set up the tx ring. Note: for the Tigon 2, we have the option
-	 * of putting the transmit ring in the host's address space and
-	 * letting the chip DMA it instead of leaving the ring in the NIC's
-	 * memory and accessing it through the shared memory region. We
-	 * do this for the Tigon 2, but it doesn't work on the Tigon 1,
-	 * so we have to revert to the shared memory scheme if we detect
-	 * a Tigon 1 chip.
-	 */
-	CSR_WRITE_4(sc, TI_WINBASE, TI_TX_RING_BASE);
-	if (sc->ti_hwrev == TI_HWREV_TIGON) {
-		sc->ti_rdata->ti_tx_ring_nic =
-		    (struct ti_tx_desc *)(sc->ti_vhandle + TI_WINDOW);
-	}
-	bzero((char *)sc->ti_rdata->ti_tx_ring,
-	    TI_TX_RING_CNT * sizeof(struct ti_tx_desc));
-	rcb = &sc->ti_rdata->ti_info.ti_tx_rcb;
-	if (sc->ti_hwrev == TI_HWREV_TIGON)
-		rcb->ti_flags = 0;
-	else
-		rcb->ti_flags = TI_RCB_FLAG_HOST_RING;
-	rcb->ti_flags |= TI_RCB_FLAG_VLAN_ASSIST;
-	if (sc->ti_ifp->if_hwassist)
-		rcb->ti_flags |= TI_RCB_FLAG_TCP_UDP_CKSUM |
-		     TI_RCB_FLAG_IP_CKSUM | TI_RCB_FLAG_NO_PHDR_CKSUM;
-	rcb->ti_max_len = TI_TX_RING_CNT;
-	if (sc->ti_hwrev == TI_HWREV_TIGON)
-		TI_HOSTADDR(rcb->ti_hostaddr) = TI_TX_RING_BASE;
-	else
-		TI_HOSTADDR(rcb->ti_hostaddr) = rdphys + TI_RD_OFF(ti_tx_ring);
-	TI_HOSTADDR(sc->ti_rdata->ti_info.ti_tx_considx_ptr) =
-	    rdphys + TI_RD_OFF(ti_tx_considx_r);
-
-	/* Set up tuneables */
-#if 0
-	if (ifp->if_mtu > (ETHERMTU + ETHER_HDR_LEN + ETHER_CRC_LEN))
-		CSR_WRITE_4(sc, TI_GCR_RX_COAL_TICKS,
-		    (sc->ti_rx_coal_ticks / 10));
-	else
-#endif
-		CSR_WRITE_4(sc, TI_GCR_RX_COAL_TICKS, sc->ti_rx_coal_ticks);
-	CSR_WRITE_4(sc, TI_GCR_TX_COAL_TICKS, sc->ti_tx_coal_ticks);
-	CSR_WRITE_4(sc, TI_GCR_STAT_TICKS, sc->ti_stat_ticks);
-	CSR_WRITE_4(sc, TI_GCR_RX_MAX_COAL_BD, sc->ti_rx_max_coal_bds);
-	CSR_WRITE_4(sc, TI_GCR_TX_MAX_COAL_BD, sc->ti_tx_max_coal_bds);
-	CSR_WRITE_4(sc, TI_GCR_TX_BUFFER_RATIO, sc->ti_tx_buf_ratio);
-
-	/* Turn interrupts on. */
-	CSR_WRITE_4(sc, TI_GCR_MASK_INTRS, 0);
-	CSR_WRITE_4(sc, TI_MB_HOSTINTR, 0);
-
-	/* Start CPU. */
-	TI_CLRBIT(sc, TI_CPU_STATE, (TI_CPUSTATE_HALT|TI_CPUSTATE_STEP));
-
-	return (0);
-}
-
-static void
-ti_rdata_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error)
-{
-	struct ti_softc *sc;
-
-	sc = arg;
-	if (error || nseg != 1)
-		return;
-
-	/*
-	 * All of the Tigon data structures need to live at <4GB.  This
-	 * cast is fine since busdma was told about this constraint.
-	 */
-	sc->ti_rdata_phys = (uint32_t)segs[0].ds_addr;
-	return;
-}
-	
-/*
- * Probe for a Tigon chip. Check the PCI vendor and device IDs
- * against our list and return its name if we find a match.
- */
-static int
-ti_probe(dev)
-	device_t		dev;
-{
-	struct ti_type		*t;
-
-	t = ti_devs;
-
-	while (t->ti_name != NULL) {
-		if ((pci_get_vendor(dev) == t->ti_vid) &&
-		    (pci_get_device(dev) == t->ti_did)) {
-			device_set_desc(dev, t->ti_name);
-			return (BUS_PROBE_DEFAULT);
-		}
-		t++;
-	}
-
-	return (ENXIO);
-}
-
-static int
-ti_attach(dev)
-	device_t		dev;
-{
-	struct ifnet		*ifp;
-	struct ti_softc		*sc;
-	int			unit, error = 0, rid;
-	u_char			eaddr[6];
-
-	sc = device_get_softc(dev);
-	unit = device_get_unit(dev);
-	sc->ti_unit = unit;
-
-	mtx_init(&sc->ti_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
-	    MTX_DEF | MTX_RECURSE);
-	ifmedia_init(&sc->ifmedia, IFM_IMASK, ti_ifmedia_upd, ti_ifmedia_sts);
-	ifp = sc->ti_ifp = if_alloc(IFT_ETHER);
-	if (ifp == NULL) {
-		printf("ti%d: can not if_alloc()\n", sc->ti_unit);
-		error = ENOSPC;
-		goto fail;
-	}
-	sc->ti_ifp->if_capabilities = IFCAP_HWCSUM |
-	    IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU;
-	sc->ti_ifp->if_capenable = sc->ti_ifp->if_capabilities;
-
-	/*
-	 * Map control/status registers.
-	 */
-	pci_enable_busmaster(dev);
-
-	rid = TI_PCI_LOMEM;
-	sc->ti_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
-	    RF_ACTIVE|PCI_RF_DENSE);
-
-	if (sc->ti_res == NULL) {
-		printf ("ti%d: couldn't map memory\n", unit);
-		error = ENXIO;
-		goto fail;
-	}
-
-	sc->ti_btag = rman_get_bustag(sc->ti_res);
-	sc->ti_bhandle = rman_get_bushandle(sc->ti_res);
-	sc->ti_vhandle = (vm_offset_t)rman_get_virtual(sc->ti_res);
-
-	/* Allocate interrupt */
-	rid = 0;
-
-	sc->ti_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
-	    RF_SHAREABLE | RF_ACTIVE);
-
-	if (sc->ti_irq == NULL) {
-		printf("ti%d: couldn't map interrupt\n", unit);
-		error = ENXIO;
-		goto fail;
-	}
-
-	if (ti_chipinit(sc)) {
-		printf("ti%d: chip initialization failed\n", sc->ti_unit);
-		error = ENXIO;
-		goto fail;
-	}
-
-	/* Zero out the NIC's on-board SRAM. */
-	ti_mem(sc, 0x2000, 0x100000 - 0x2000,  NULL);
-
-	/* Init again -- zeroing memory may have clobbered some registers. */
-	if (ti_chipinit(sc)) {
-		printf("ti%d: chip initialization failed\n", sc->ti_unit);
-		error = ENXIO;
-		goto fail;
-	}
-
-	/*
-	 * Get station address from the EEPROM. Note: the manual states
-	 * that the MAC address is at offset 0x8c, however the data is
-	 * stored as two longwords (since that's how it's loaded into
-	 * the NIC). This means the MAC address is actually preceded
-	 * by two zero bytes. We need to skip over those.
-	 */
-	if (ti_read_eeprom(sc, eaddr,
-				TI_EE_MAC_OFFSET + 2, ETHER_ADDR_LEN)) {
-		printf("ti%d: failed to read station address\n", unit);
-		error = ENXIO;
-		goto fail;
-	}
-
-	/* Allocate the general information block and ring buffers. */
-	if (bus_dma_tag_create(NULL,			/* parent */
-				1, 0,			/* algnmnt, boundary */
-				BUS_SPACE_MAXADDR,	/* lowaddr */
-				BUS_SPACE_MAXADDR,	/* highaddr */
-				NULL, NULL,		/* filter, filterarg */
-				BUS_SPACE_MAXSIZE_32BIT,/* maxsize */
-				0,			/* nsegments */
-				BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */
-				0,			/* flags */
-				NULL, NULL,		/* lockfunc, lockarg */
-				&sc->ti_parent_dmat) != 0) {
-		printf("ti%d: Failed to allocate parent dmat\n", sc->ti_unit);
-		error = ENOMEM;
-		goto fail;
-	}
-
-	if (bus_dma_tag_create(sc->ti_parent_dmat,	/* parent */
-				PAGE_SIZE, 0,		/* algnmnt, boundary */
-				BUS_SPACE_MAXADDR_32BIT,/* lowaddr */
-				BUS_SPACE_MAXADDR,	/* highaddr */
-				NULL, NULL,		/* filter, filterarg */
-				sizeof(struct ti_ring_data),	/* maxsize */
-				1,			/* nsegments */
-				sizeof(struct ti_ring_data),	/* maxsegsize */
-				0,			/* flags */
-				NULL, NULL,		/* lockfunc, lockarg */
-				&sc->ti_rdata_dmat) != 0) {
-		printf("ti%d: Failed to allocate rdata dmat\n", sc->ti_unit);
-		error = ENOMEM;
-		goto fail;
-	}
-
-	if (bus_dmamem_alloc(sc->ti_rdata_dmat, (void**)&sc->ti_rdata,
-			     BUS_DMA_NOWAIT, &sc->ti_rdata_dmamap) != 0) {
-		printf("ti%d: Failed to allocate rdata memory\n", sc->ti_unit);
-		error = ENOMEM;
-		goto fail;
-	}
-
-	if (bus_dmamap_load(sc->ti_rdata_dmat, sc->ti_rdata_dmamap,
-			    sc->ti_rdata, sizeof(struct ti_ring_data),
-			    ti_rdata_cb, sc, BUS_DMA_NOWAIT) != 0) {
-		printf("ti%d: Failed to load rdata segments\n", sc->ti_unit);
-		error = ENOMEM;
-		goto fail;
-	}
-
-	bzero(sc->ti_rdata, sizeof(struct ti_ring_data));
-
-	/* Try to allocate memory for jumbo buffers. */
-#ifdef TI_PRIVATE_JUMBOS
-	if (ti_alloc_jumbo_mem(sc)) {
-		printf("ti%d: jumbo buffer allocation failed\n", sc->ti_unit);
-		error = ENXIO;
-		goto fail;
-	}
-#endif
-
-	/*
-	 * We really need a better way to tell a 1000baseTX card
-	 * from a 1000baseSX one, since in theory there could be
-	 * OEMed 1000baseTX cards from lame vendors who aren't
-	 * clever enough to change the PCI ID. For the moment
-	 * though, the AceNIC is the only copper card available.
-	 */
-	if (pci_get_vendor(dev) == ALT_VENDORID &&
-	    pci_get_device(dev) == ALT_DEVICEID_ACENIC_COPPER)
-		sc->ti_copper = 1;
-	/* Ok, it's not the only copper card available. */
-	if (pci_get_vendor(dev) == NG_VENDORID &&
-	    pci_get_device(dev) == NG_DEVICEID_GA620T)
-		sc->ti_copper = 1;
-
-	/* Set default tuneable values. */
-	sc->ti_stat_ticks = 2 * TI_TICKS_PER_SEC;
-#if 0
-	sc->ti_rx_coal_ticks = TI_TICKS_PER_SEC / 5000;
-#endif
-	sc->ti_rx_coal_ticks = 170;
-	sc->ti_tx_coal_ticks = TI_TICKS_PER_SEC / 500;
-	sc->ti_rx_max_coal_bds = 64;
-#if 0
-	sc->ti_tx_max_coal_bds = 128;
-#endif
-	sc->ti_tx_max_coal_bds = 32;
-	sc->ti_tx_buf_ratio = 21;
-
-	/* Set up ifnet structure */
-	ifp->if_softc = sc;
-	if_initname(ifp, device_get_name(dev), device_get_unit(dev));
-	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST |
-	    IFF_NEEDSGIANT;
-	tis[unit] = sc;
-	ifp->if_ioctl = ti_ioctl;
-	ifp->if_start = ti_start;
-	ifp->if_watchdog = ti_watchdog;
-	ifp->if_init = ti_init;
-	ifp->if_mtu = ETHERMTU;
-	ifp->if_snd.ifq_maxlen = TI_TX_RING_CNT - 1;
-
-	/* Set up ifmedia support. */
-	if (sc->ti_copper) {
-		/*
-		 * Copper cards allow manual 10/100 mode selection,
-		 * but not manual 1000baseTX mode selection. Why?
-		 * Becuase currently there's no way to specify the
-		 * master/slave setting through the firmware interface,
-		 * so Alteon decided to just bag it and handle it
-		 * via autonegotiation.
-		 */
-		ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_10_T, 0, NULL);
-		ifmedia_add(&sc->ifmedia,
-		    IFM_ETHER|IFM_10_T|IFM_FDX, 0, NULL);
-		ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_100_TX, 0, NULL);
-		ifmedia_add(&sc->ifmedia,
-		    IFM_ETHER|IFM_100_TX|IFM_FDX, 0, NULL);
-		ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_1000_T, 0, NULL);
-		ifmedia_add(&sc->ifmedia,
-		    IFM_ETHER|IFM_1000_T|IFM_FDX, 0, NULL);
-	} else {
-		/* Fiber cards don't support 10/100 modes. */
-		ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_1000_SX, 0, NULL);
-		ifmedia_add(&sc->ifmedia,
-		    IFM_ETHER|IFM_1000_SX|IFM_FDX, 0, NULL);
-	}
-	ifmedia_add(&sc->ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL);
-	ifmedia_set(&sc->ifmedia, IFM_ETHER|IFM_AUTO);
-
-	/*
-	 * We're assuming here that card initialization is a sequential
-	 * thing.  If it isn't, multiple cards probing at the same time
-	 * could stomp on the list of softcs here.
-	 */
-
-	/* Register the device */
-	sc->dev = make_dev(&ti_cdevsw, sc->ti_unit, UID_ROOT, GID_OPERATOR,
-			   0600, "ti%d", sc->ti_unit);
-	sc->dev->si_drv1 = sc;
-
-	/*
-	 * Call MI attach routine.
-	 */
-	ether_ifattach(ifp, eaddr);
-
-	/* Hook interrupt last to avoid having to lock softc */
-	error = bus_setup_intr(dev, sc->ti_irq, INTR_TYPE_NET,
-	   ti_intr, sc, &sc->ti_intrhand);
-
-	if (error) {
-		printf("ti%d: couldn't set up irq\n", unit);
-		ether_ifdetach(ifp);
-		goto fail;
-	}
-
-fail:
-	if (sc && error)
-		ti_detach(dev);
-
-	return (error);
-}
-
-/*
- * Shutdown hardware and free up resources. This can be called any
- * time after the mutex has been initialized. It is called in both
- * the error case in attach and the normal detach case so it needs
- * to be careful about only freeing resources that have actually been
- * allocated.
- */
-static int
-ti_detach(dev)
-	device_t		dev;
-{
-	struct ti_softc		*sc;
-	struct ifnet		*ifp;
-
-	sc = device_get_softc(dev);
-	if (sc->dev)
-		destroy_dev(sc->dev);
-	KASSERT(mtx_initialized(&sc->ti_mtx), ("ti mutex not initialized"));
-	TI_LOCK(sc);
-	ifp = sc->ti_ifp;
-
-	/* These should only be active if attach succeeded */
-	if (device_is_attached(dev)) {
-		ti_stop(sc);
-		ether_ifdetach(ifp);
-		bus_generic_detach(dev);
-	}
-	if (ifp)
-		if_free(ifp);
-	ifmedia_removeall(&sc->ifmedia);
-
-	if (sc->ti_rdata)
-		bus_dmamem_free(sc->ti_rdata_dmat, sc->ti_rdata,
-				sc->ti_rdata_dmamap);
-	if (sc->ti_rdata_dmat)
-		bus_dma_tag_destroy(sc->ti_rdata_dmat);
-	if (sc->ti_parent_dmat)
-		bus_dma_tag_destroy(sc->ti_parent_dmat);
-	if (sc->ti_intrhand)
-		bus_teardown_intr(dev, sc->ti_irq, sc->ti_intrhand);
-	if (sc->ti_irq)
-		bus_release_resource(dev, SYS_RES_IRQ, 0, sc->ti_irq);
-	if (sc->ti_res) {
-		bus_release_resource(dev, SYS_RES_MEMORY, TI_PCI_LOMEM,
-		    sc->ti_res);
-	}
-
-#ifdef TI_PRIVATE_JUMBOS
-	if (sc->ti_cdata.ti_jumbo_buf)
-		contigfree(sc->ti_cdata.ti_jumbo_buf, TI_JMEM, M_DEVBUF);
-#endif
-	if (sc->ti_rdata)
-		contigfree(sc->ti_rdata, sizeof(struct ti_ring_data), M_DEVBUF);
-
-	TI_UNLOCK(sc);
-	mtx_destroy(&sc->ti_mtx);
-
-	return (0);
-}
-
-#ifdef TI_JUMBO_HDRSPLIT
-/*
- * If hdr_len is 0, that means that header splitting wasn't done on
- * this packet for some reason.  The two most likely reasons are that
- * the protocol isn't a supported protocol for splitting, or this
- * packet had a fragment offset that wasn't 0.
- *
- * The header length, if it is non-zero, will always be the length of
- * the headers on the packet, but that length could be longer than the
- * first mbuf.  So we take the minimum of the two as the actual
- * length.
- */
-static __inline void
-ti_hdr_split(struct mbuf *top, int hdr_len, int pkt_len, int idx)
-{
-	int i = 0;
-	int lengths[4] = {0, 0, 0, 0};
-	struct mbuf *m, *mp;
-
-	if (hdr_len != 0)
-		top->m_len = min(hdr_len, top->m_len);
-	pkt_len -= top->m_len;
-	lengths[i++] = top->m_len;
-
-	mp = top;
-	for (m = top->m_next; m && pkt_len; m = m->m_next) {
-		m->m_len = m->m_ext.ext_size = min(m->m_len, pkt_len);
-		pkt_len -= m->m_len;
-		lengths[i++] = m->m_len;
-		mp = m;
-	}
-
-#if 0
-	if (hdr_len != 0)
-		printf("got split packet: ");
-	else
-		printf("got non-split packet: ");
-
-	printf("%d,%d,%d,%d = %d\n", lengths[0],
-	    lengths[1], lengths[2], lengths[3],
-	    lengths[0] + lengths[1] + lengths[2] +
-	    lengths[3]);
-#endif
-
-	if (pkt_len)
-		panic("header splitting didn't");
-
-	if (m) {
-		m_freem(m);
-		mp->m_next = NULL;
-
-	}
-	if (mp->m_next != NULL)
-		panic("ti_hdr_split: last mbuf in chain should be null");
-}
-#endif /* TI_JUMBO_HDRSPLIT */
-
-/*
- * Frame reception handling. This is called if there's a frame
- * on the receive return list.
- *
- * Note: we have to be able to handle three possibilities here:
- * 1) the frame is from the mini receive ring (can only happen)
- *    on Tigon 2 boards)
- * 2) the frame is from the jumbo recieve ring
- * 3) the frame is from the standard receive ring
- */
-
-static void
-ti_rxeof(sc)
-	struct ti_softc		*sc;
-{
-	struct ifnet		*ifp;
-	struct ti_cmd_desc	cmd;
-
-	TI_LOCK_ASSERT(sc);
-
-	ifp = sc->ti_ifp;
-
-	while (sc->ti_rx_saved_considx != sc->ti_return_prodidx.ti_idx) {
-		struct ti_rx_desc	*cur_rx;
-		u_int32_t		rxidx;
-		struct mbuf		*m = NULL;
-		u_int16_t		vlan_tag = 0;
-		int			have_tag = 0;
-
-		cur_rx =
-		    &sc->ti_rdata->ti_rx_return_ring[sc->ti_rx_saved_considx];
-		rxidx = cur_rx->ti_idx;
-		TI_INC(sc->ti_rx_saved_considx, TI_RETURN_RING_CNT);
-
-		if (cur_rx->ti_flags & TI_BDFLAG_VLAN_TAG) {
-			have_tag = 1;
-			vlan_tag = cur_rx->ti_vlan_tag & 0xfff;
-		}
-
-		if (cur_rx->ti_flags & TI_BDFLAG_JUMBO_RING) {
-
-			TI_INC(sc->ti_jumbo, TI_JUMBO_RX_RING_CNT);
-			m = sc->ti_cdata.ti_rx_jumbo_chain[rxidx];
-			sc->ti_cdata.ti_rx_jumbo_chain[rxidx] = NULL;
-			if (cur_rx->ti_flags & TI_BDFLAG_ERROR) {
-				ifp->if_ierrors++;
-				ti_newbuf_jumbo(sc, sc->ti_jumbo, m);
-				continue;
-			}
-			if (ti_newbuf_jumbo(sc, sc->ti_jumbo, NULL) == ENOBUFS) {
-				ifp->if_ierrors++;
-				ti_newbuf_jumbo(sc, sc->ti_jumbo, m);
-				continue;
-			}
-#ifdef TI_PRIVATE_JUMBOS
-			m->m_len = cur_rx->ti_len;
-#else /* TI_PRIVATE_JUMBOS */
-#ifdef TI_JUMBO_HDRSPLIT
-			if (sc->ti_hdrsplit)
-				ti_hdr_split(m, TI_HOSTADDR(cur_rx->ti_addr),
-					     cur_rx->ti_len, rxidx);
-			else
-#endif /* TI_JUMBO_HDRSPLIT */
-			m_adj(m, cur_rx->ti_len - m->m_pkthdr.len);
-#endif /* TI_PRIVATE_JUMBOS */
-		} else if (cur_rx->ti_flags & TI_BDFLAG_MINI_RING) {
-			TI_INC(sc->ti_mini, TI_MINI_RX_RING_CNT);
-			m = sc->ti_cdata.ti_rx_mini_chain[rxidx];
-			sc->ti_cdata.ti_rx_mini_chain[rxidx] = NULL;
-			if (cur_rx->ti_flags & TI_BDFLAG_ERROR) {
-				ifp->if_ierrors++;
-				ti_newbuf_mini(sc, sc->ti_mini, m);
-				continue;
-			}
-			if (ti_newbuf_mini(sc, sc->ti_mini, NULL) == ENOBUFS) {
-				ifp->if_ierrors++;
-				ti_newbuf_mini(sc, sc->ti_mini, m);
-				continue;
-			}
-			m->m_len = cur_rx->ti_len;
-		} else {
-			TI_INC(sc->ti_std, TI_STD_RX_RING_CNT);
-			m = sc->ti_cdata.ti_rx_std_chain[rxidx];
-			sc->ti_cdata.ti_rx_std_chain[rxidx] = NULL;
-			if (cur_rx->ti_flags & TI_BDFLAG_ERROR) {
-				ifp->if_ierrors++;
-				ti_newbuf_std(sc, sc->ti_std, m);
-				continue;
-			}
-			if (ti_newbuf_std(sc, sc->ti_std, NULL) == ENOBUFS) {
-				ifp->if_ierrors++;
-				ti_newbuf_std(sc, sc->ti_std, m);
-				continue;
-			}
-			m->m_len = cur_rx->ti_len;
-		}
-
-		m->m_pkthdr.len = cur_rx->ti_len;
-		ifp->if_ipackets++;
-		m->m_pkthdr.rcvif = ifp;
-
-		if (ifp->if_hwassist) {
-			m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED |
-			    CSUM_DATA_VALID;
-			if ((cur_rx->ti_ip_cksum ^ 0xffff) == 0)
-				m->m_pkthdr.csum_flags |= CSUM_IP_VALID;
-			m->m_pkthdr.csum_data = cur_rx->ti_tcp_udp_cksum;
-		}
-
-		/*
-		 * If we received a packet with a vlan tag,
-		 * tag it before passing the packet upward.
-		 */
-		if (have_tag) {
-			VLAN_INPUT_TAG_NEW(ifp, m, vlan_tag);
-			if (m == NULL)
-				continue;
-		}
-		TI_UNLOCK(sc);
-		(*ifp->if_input)(ifp, m);
-		TI_LOCK(sc);
-	}
-
-	/* Only necessary on the Tigon 1. */
-	if (sc->ti_hwrev == TI_HWREV_TIGON)
-		CSR_WRITE_4(sc, TI_GCR_RXRETURNCONS_IDX,
-		    sc->ti_rx_saved_considx);
-
-	TI_UPDATE_STDPROD(sc, sc->ti_std);
-	TI_UPDATE_MINIPROD(sc, sc->ti_mini);
-	TI_UPDATE_JUMBOPROD(sc, sc->ti_jumbo);
-}
-
-static void
-ti_txeof(sc)
-	struct ti_softc		*sc;
-{
-	struct ti_tx_desc	*cur_tx = NULL;
-	struct ifnet		*ifp;
-
-	ifp = sc->ti_ifp;
-
-	/*
-	 * Go through our tx ring and free mbufs for those
-	 * frames that have been sent.
-	 */
-	while (sc->ti_tx_saved_considx != sc->ti_tx_considx.ti_idx) {
-		u_int32_t		idx = 0;
-
-		idx = sc->ti_tx_saved_considx;
-		if (sc->ti_hwrev == TI_HWREV_TIGON) {
-			if (idx > 383)
-				CSR_WRITE_4(sc, TI_WINBASE,
-				    TI_TX_RING_BASE + 6144);
-			else if (idx > 255)
-				CSR_WRITE_4(sc, TI_WINBASE,
-				    TI_TX_RING_BASE + 4096);
-			else if (idx > 127)
-				CSR_WRITE_4(sc, TI_WINBASE,
-				    TI_TX_RING_BASE + 2048);
-			else
-				CSR_WRITE_4(sc, TI_WINBASE,
-				    TI_TX_RING_BASE);
-			cur_tx = &sc->ti_rdata->ti_tx_ring_nic[idx % 128];
-		} else
-			cur_tx = &sc->ti_rdata->ti_tx_ring[idx];
-		if (cur_tx->ti_flags & TI_BDFLAG_END)
-			ifp->if_opackets++;
-		if (sc->ti_cdata.ti_tx_chain[idx] != NULL) {
-			m_freem(sc->ti_cdata.ti_tx_chain[idx]);
-			sc->ti_cdata.ti_tx_chain[idx] = NULL;
-		}
-		sc->ti_txcnt--;
-		TI_INC(sc->ti_tx_saved_considx, TI_TX_RING_CNT);
-		ifp->if_timer = 0;
-	}
-
-	if (cur_tx != NULL)
-		ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
-}
-
-static void
-ti_intr(xsc)
-	void			*xsc;
-{
-	struct ti_softc		*sc;
-	struct ifnet		*ifp;
-
-	sc = xsc;
-	TI_LOCK(sc);
-	ifp = sc->ti_ifp;
-
-/*#ifdef notdef*/
-	/* Avoid this for now -- checking this register is expensive. */
-	/* Make sure this is really our interrupt. */
-	if (!(CSR_READ_4(sc, TI_MISC_HOST_CTL) & TI_MHC_INTSTATE)) {
-		TI_UNLOCK(sc);
-		return;
-	}
-/*#endif*/
-
-	/* Ack interrupt and stop others from occuring. */
-	CSR_WRITE_4(sc, TI_MB_HOSTINTR, 1);
-
-	if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
-		/* Check RX return ring producer/consumer */
-		ti_rxeof(sc);
-
-		/* Check TX ring producer/consumer */
-		ti_txeof(sc);
-	}
-
-	ti_handle_events(sc);
-
-	/* Re-enable interrupts. */
-	CSR_WRITE_4(sc, TI_MB_HOSTINTR, 0);
-
-	if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
-	    ifp->if_snd.ifq_head != NULL)
-		ti_start(ifp);
-
-	TI_UNLOCK(sc);
-}
-
-static void
-ti_stats_update(sc)
-	struct ti_softc		*sc;
-{
-	struct ifnet		*ifp;
-
-	ifp = sc->ti_ifp;
-
-	ifp->if_collisions +=
-	   (sc->ti_rdata->ti_info.ti_stats.dot3StatsSingleCollisionFrames +
-	   sc->ti_rdata->ti_info.ti_stats.dot3StatsMultipleCollisionFrames +
-	   sc->ti_rdata->ti_info.ti_stats.dot3StatsExcessiveCollisions +
-	   sc->ti_rdata->ti_info.ti_stats.dot3StatsLateCollisions) -
-	   ifp->if_collisions;
-}
-
-/*
- * Encapsulate an mbuf chain in the tx ring  by coupling the mbuf data
- * pointers to descriptors.
- */
-static int
-ti_encap(sc, m_head, txidx)
-	struct ti_softc		*sc;
-	struct mbuf		*m_head;
-	u_int32_t		*txidx;
-{
-	struct ti_tx_desc	*f = NULL;
-	struct mbuf		*m;
-	u_int32_t		frag, cur, cnt = 0;
-	u_int16_t		csum_flags = 0;
-	struct m_tag		*mtag;
-
-	m = m_head;
-	cur = frag = *txidx;
-
-	if (m_head->m_pkthdr.csum_flags) {
-		if (m_head->m_pkthdr.csum_flags & CSUM_IP)
-			csum_flags |= TI_BDFLAG_IP_CKSUM;
-		if (m_head->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP))
-			csum_flags |= TI_BDFLAG_TCP_UDP_CKSUM;
-		if (m_head->m_flags & M_LASTFRAG)
-			csum_flags |= TI_BDFLAG_IP_FRAG_END;
-		else if (m_head->m_flags & M_FRAG)
-			csum_flags |= TI_BDFLAG_IP_FRAG;
-	}
-
-	mtag = VLAN_OUTPUT_TAG(sc->ti_ifp, m);
-
-	/*
-	 * Start packing the mbufs in this chain into
-	 * the fragment pointers. Stop when we run out
-	 * of fragments or hit the end of the mbuf chain.
-	 */
-	for (m = m_head; m != NULL; m = m->m_next) {
-		if (m->m_len != 0) {
-			if (sc->ti_hwrev == TI_HWREV_TIGON) {
-				if (frag > 383)
-					CSR_WRITE_4(sc, TI_WINBASE,
-					    TI_TX_RING_BASE + 6144);
-				else if (frag > 255)
-					CSR_WRITE_4(sc, TI_WINBASE,
-					    TI_TX_RING_BASE + 4096);
-				else if (frag > 127)
-					CSR_WRITE_4(sc, TI_WINBASE,
-					    TI_TX_RING_BASE + 2048);
-				else
-					CSR_WRITE_4(sc, TI_WINBASE,
-					    TI_TX_RING_BASE);
-				f = &sc->ti_rdata->ti_tx_ring_nic[frag % 128];
-			} else
-				f = &sc->ti_rdata->ti_tx_ring[frag];
-			if (sc->ti_cdata.ti_tx_chain[frag] != NULL)
-				break;
-			TI_HOSTADDR(f->ti_addr) = vtophys(mtod(m, vm_offset_t));
-			f->ti_len = m->m_len;
-			f->ti_flags = csum_flags;
-
-			if (mtag != NULL) {
-				f->ti_flags |= TI_BDFLAG_VLAN_TAG;
-				f->ti_vlan_tag = VLAN_TAG_VALUE(mtag) & 0xfff;
-			} else {
-				f->ti_vlan_tag = 0;
-			}
-
-			/*
-			 * Sanity check: avoid coming within 16 descriptors
-			 * of the end of the ring.
-			 */
-			if ((TI_TX_RING_CNT - (sc->ti_txcnt + cnt)) < 16)
-				return (ENOBUFS);
-			cur = frag;
-			TI_INC(frag, TI_TX_RING_CNT);
-			cnt++;
-		}
-	}
-
-	if (m != NULL)
-		return (ENOBUFS);
-
-	if (frag == sc->ti_tx_saved_considx)
-		return (ENOBUFS);
-
-	if (sc->ti_hwrev == TI_HWREV_TIGON)
-		sc->ti_rdata->ti_tx_ring_nic[cur % 128].ti_flags |=
-	            TI_BDFLAG_END;
-	else
-		sc->ti_rdata->ti_tx_ring[cur].ti_flags |= TI_BDFLAG_END;
-	sc->ti_cdata.ti_tx_chain[cur] = m_head;
-	sc->ti_txcnt += cnt;
-
-	*txidx = frag;
-
-	return (0);
-}
-
-/*
- * Main transmit routine. To avoid having to do mbuf copies, we put pointers
- * to the mbuf data regions directly in the transmit descriptors.
- */
-static void
-ti_start(ifp)
-	struct ifnet		*ifp;
-{
-	struct ti_softc		*sc;
-	struct mbuf		*m_head = NULL;
-	u_int32_t		prodidx = 0;
-
-	sc = ifp->if_softc;
-	TI_LOCK(sc);
-
-	prodidx = CSR_READ_4(sc, TI_MB_SENDPROD_IDX);
-
-	while (sc->ti_cdata.ti_tx_chain[prodidx] == NULL) {
-		IF_DEQUEUE(&ifp->if_snd, m_head);
-		if (m_head == NULL)
-			break;
-
-		/*
-		 * XXX
-		 * safety overkill.  If this is a fragmented packet chain
-		 * with delayed TCP/UDP checksums, then only encapsulate
-		 * it if we have enough descriptors to handle the entire
-		 * chain at once.
-		 * (paranoia -- may not actually be needed)
-		 */
-		if (m_head->m_flags & M_FIRSTFRAG &&
-		    m_head->m_pkthdr.csum_flags & (CSUM_DELAY_DATA)) {
-			if ((TI_TX_RING_CNT - sc->ti_txcnt) <
-			    m_head->m_pkthdr.csum_data + 16) {
-				IF_PREPEND(&ifp->if_snd, m_head);
-				ifp->if_drv_flags |= IFF_DRV_OACTIVE;
-				break;
-			}
-		}
-
-		/*
-		 * Pack the data into the transmit ring. If we
-		 * don't have room, set the OACTIVE flag and wait
-		 * for the NIC to drain the ring.
-		 */
-		if (ti_encap(sc, m_head, &prodidx)) {
-			IF_PREPEND(&ifp->if_snd, m_head);
-			ifp->if_drv_flags |= IFF_DRV_OACTIVE;
-			break;
-		}
-
-		/*
-		 * If there's a BPF listener, bounce a copy of this frame
-		 * to him.
-		 */
-		BPF_MTAP(ifp, m_head);
-	}
-
-	/* Transmit */
-	CSR_WRITE_4(sc, TI_MB_SENDPROD_IDX, prodidx);
-
-	/*
-	 * Set a timeout in case the chip goes out to lunch.
-	 */
-	ifp->if_timer = 5;
-	TI_UNLOCK(sc);
-}
-
-static void
-ti_init(xsc)
-	void			*xsc;
-{
-	struct ti_softc		*sc = xsc;
-
-	/* Cancel pending I/O and flush buffers. */
-	ti_stop(sc);
-
-	TI_LOCK(sc);
-	/* Init the gen info block, ring control blocks and firmware. */
-	if (ti_gibinit(sc)) {
-		printf("ti%d: initialization failure\n", sc->ti_unit);
-		TI_UNLOCK(sc);
-		return;
-	}
-
-	TI_UNLOCK(sc);
-}
-
-static void ti_init2(sc)
-	struct ti_softc		*sc;
-{
-	struct ti_cmd_desc	cmd;
-	struct ifnet		*ifp;
-	u_int16_t		*m;
-	struct ifmedia		*ifm;
-	int			tmp;
-
-	ifp = sc->ti_ifp;
-
-	/* Specify MTU and interface index. */
-	CSR_WRITE_4(sc, TI_GCR_IFINDEX, sc->ti_unit);
-	CSR_WRITE_4(sc, TI_GCR_IFMTU, ifp->if_mtu +
-	    ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN);
-	TI_DO_CMD(TI_CMD_UPDATE_GENCOM, 0, 0);
-
-	/* Load our MAC address. */
-	m = (u_int16_t *)&IFP2ENADDR(sc->ti_ifp)[0];
-	CSR_WRITE_4(sc, TI_GCR_PAR0, htons(m[0]));
-	CSR_WRITE_4(sc, TI_GCR_PAR1, (htons(m[1]) << 16) | htons(m[2]));
-	TI_DO_CMD(TI_CMD_SET_MAC_ADDR, 0, 0);
-
-	/* Enable or disable promiscuous mode as needed. */
-	if (ifp->if_flags & IFF_PROMISC) {
-		TI_DO_CMD(TI_CMD_SET_PROMISC_MODE, TI_CMD_CODE_PROMISC_ENB, 0);
-	} else {
-		TI_DO_CMD(TI_CMD_SET_PROMISC_MODE, TI_CMD_CODE_PROMISC_DIS, 0);
-	}
-
-	/* Program multicast filter. */
-	ti_setmulti(sc);
-
-	/*
-	 * If this is a Tigon 1, we should tell the
-	 * firmware to use software packet filtering.
-	 */
-	if (sc->ti_hwrev == TI_HWREV_TIGON) {
-		TI_DO_CMD(TI_CMD_FDR_FILTERING, TI_CMD_CODE_FILT_ENB, 0);
-	}
-
-	/* Init RX ring. */
-	ti_init_rx_ring_std(sc);
-
-	/* Init jumbo RX ring. */
-	if (ifp->if_mtu > (ETHERMTU + ETHER_HDR_LEN + ETHER_CRC_LEN))
-		ti_init_rx_ring_jumbo(sc);
-
-	/*
-	 * If this is a Tigon 2, we can also configure the
-	 * mini ring.
-	 */
-	if (sc->ti_hwrev == TI_HWREV_TIGON_II)
-		ti_init_rx_ring_mini(sc);
-
-	CSR_WRITE_4(sc, TI_GCR_RXRETURNCONS_IDX, 0);
-	sc->ti_rx_saved_considx = 0;
-
-	/* Init TX ring. */
-	ti_init_tx_ring(sc);
-
-	/* Tell firmware we're alive. */
-	TI_DO_CMD(TI_CMD_HOST_STATE, TI_CMD_CODE_STACK_UP, 0);
-
-	/* Enable host interrupts. */
-	CSR_WRITE_4(sc, TI_MB_HOSTINTR, 0);
-
-	ifp->if_drv_flags |= IFF_DRV_RUNNING;
-	ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
-
-	/*
-	 * Make sure to set media properly. We have to do this
-	 * here since we have to issue commands in order to set
-	 * the link negotiation and we can't issue commands until
-	 * the firmware is running.
-	 */
-	ifm = &sc->ifmedia;
-	tmp = ifm->ifm_media;
-	ifm->ifm_media = ifm->ifm_cur->ifm_media;
-	ti_ifmedia_upd(ifp);
-	ifm->ifm_media = tmp;
-}
-
-/*
- * Set media options.
- */
-static int
-ti_ifmedia_upd(ifp)
-	struct ifnet		*ifp;
-{
-	struct ti_softc		*sc;
-	struct ifmedia		*ifm;
-	struct ti_cmd_desc	cmd;
-	u_int32_t		flowctl;
-
-	sc = ifp->if_softc;
-	ifm = &sc->ifmedia;
-
-	if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER)
-		return (EINVAL);
-
-	flowctl = 0;
-
-	switch (IFM_SUBTYPE(ifm->ifm_media)) {
-	case IFM_AUTO:
-		/*
-		 * Transmit flow control doesn't work on the Tigon 1.
-		 */
-		flowctl = TI_GLNK_RX_FLOWCTL_Y;
-
-		/*
-		 * Transmit flow control can also cause problems on the
-		 * Tigon 2, apparantly with both the copper and fiber
-		 * boards.  The symptom is that the interface will just
-		 * hang.  This was reproduced with Alteon 180 switches.
-		 */
-#if 0
-		if (sc->ti_hwrev != TI_HWREV_TIGON)
-			flowctl |= TI_GLNK_TX_FLOWCTL_Y;
-#endif
-
-		CSR_WRITE_4(sc, TI_GCR_GLINK, TI_GLNK_PREF|TI_GLNK_1000MB|
-		    TI_GLNK_FULL_DUPLEX| flowctl |
-		    TI_GLNK_AUTONEGENB|TI_GLNK_ENB);
-
-		flowctl = TI_LNK_RX_FLOWCTL_Y;
-#if 0
-		if (sc->ti_hwrev != TI_HWREV_TIGON)
-			flowctl |= TI_LNK_TX_FLOWCTL_Y;
-#endif
-
-		CSR_WRITE_4(sc, TI_GCR_LINK, TI_LNK_100MB|TI_LNK_10MB|
-		    TI_LNK_FULL_DUPLEX|TI_LNK_HALF_DUPLEX| flowctl |
-		    TI_LNK_AUTONEGENB|TI_LNK_ENB);
-		TI_DO_CMD(TI_CMD_LINK_NEGOTIATION,
-		    TI_CMD_CODE_NEGOTIATE_BOTH, 0);
-		break;
-	case IFM_1000_SX:
-	case IFM_1000_T:
-		flowctl = TI_GLNK_RX_FLOWCTL_Y;
-#if 0
-		if (sc->ti_hwrev != TI_HWREV_TIGON)
-			flowctl |= TI_GLNK_TX_FLOWCTL_Y;
-#endif
-
-		CSR_WRITE_4(sc, TI_GCR_GLINK, TI_GLNK_PREF|TI_GLNK_1000MB|
-		    flowctl |TI_GLNK_ENB);
-		CSR_WRITE_4(sc, TI_GCR_LINK, 0);
-		if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX) {
-			TI_SETBIT(sc, TI_GCR_GLINK, TI_GLNK_FULL_DUPLEX);
-		}
-		TI_DO_CMD(TI_CMD_LINK_NEGOTIATION,
-		    TI_CMD_CODE_NEGOTIATE_GIGABIT, 0);
-		break;
-	case IFM_100_FX:
-	case IFM_10_FL:
-	case IFM_100_TX:
-	case IFM_10_T:
-		flowctl = TI_LNK_RX_FLOWCTL_Y;
-#if 0
-		if (sc->ti_hwrev != TI_HWREV_TIGON)
-			flowctl |= TI_LNK_TX_FLOWCTL_Y;
-#endif
-
-		CSR_WRITE_4(sc, TI_GCR_GLINK, 0);
-		CSR_WRITE_4(sc, TI_GCR_LINK, TI_LNK_ENB|TI_LNK_PREF|flowctl);
-		if (IFM_SUBTYPE(ifm->ifm_media) == IFM_100_FX ||
-		    IFM_SUBTYPE(ifm->ifm_media) == IFM_100_TX) {
-			TI_SETBIT(sc, TI_GCR_LINK, TI_LNK_100MB);
-		} else {
-			TI_SETBIT(sc, TI_GCR_LINK, TI_LNK_10MB);
-		}
-		if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX) {
-			TI_SETBIT(sc, TI_GCR_LINK, TI_LNK_FULL_DUPLEX);
-		} else {
-			TI_SETBIT(sc, TI_GCR_LINK, TI_LNK_HALF_DUPLEX);
-		}
-		TI_DO_CMD(TI_CMD_LINK_NEGOTIATION,
-		    TI_CMD_CODE_NEGOTIATE_10_100, 0);
-		break;
-	}
-
-	return (0);
-}
-
-/*
- * Report current media status.
- */
-static void
-ti_ifmedia_sts(ifp, ifmr)
-	struct ifnet		*ifp;
-	struct ifmediareq	*ifmr;
-{
-	struct ti_softc		*sc;
-	u_int32_t		media = 0;
-
-	sc = ifp->if_softc;
-
-	ifmr->ifm_status = IFM_AVALID;
-	ifmr->ifm_active = IFM_ETHER;
-
-	if (sc->ti_linkstat == TI_EV_CODE_LINK_DOWN)
-		return;
-
-	ifmr->ifm_status |= IFM_ACTIVE;
-
-	if (sc->ti_linkstat == TI_EV_CODE_GIG_LINK_UP) {
-		media = CSR_READ_4(sc, TI_GCR_GLINK_STAT);
-		if (sc->ti_copper)
-			ifmr->ifm_active |= IFM_1000_T;
-		else
-			ifmr->ifm_active |= IFM_1000_SX;
-		if (media & TI_GLNK_FULL_DUPLEX)
-			ifmr->ifm_active |= IFM_FDX;
-		else
-			ifmr->ifm_active |= IFM_HDX;
-	} else if (sc->ti_linkstat == TI_EV_CODE_LINK_UP) {
-		media = CSR_READ_4(sc, TI_GCR_LINK_STAT);
-		if (sc->ti_copper) {
-			if (media & TI_LNK_100MB)
-				ifmr->ifm_active |= IFM_100_TX;
-			if (media & TI_LNK_10MB)
-				ifmr->ifm_active |= IFM_10_T;
-		} else {
-			if (media & TI_LNK_100MB)
-				ifmr->ifm_active |= IFM_100_FX;
-			if (media & TI_LNK_10MB)
-				ifmr->ifm_active |= IFM_10_FL;
-		}
-		if (media & TI_LNK_FULL_DUPLEX)
-			ifmr->ifm_active |= IFM_FDX;
-		if (media & TI_LNK_HALF_DUPLEX)
-			ifmr->ifm_active |= IFM_HDX;
-	}
-}
-
-static int
-ti_ioctl(ifp, command, data)
-	struct ifnet		*ifp;
-	u_long			command;
-	caddr_t			data;
-{
-	struct ti_softc		*sc = ifp->if_softc;
-	struct ifreq		*ifr = (struct ifreq *) data;
-	int			mask, error = 0;
-	struct ti_cmd_desc	cmd;
-
-	TI_LOCK(sc);
-
-	switch (command) {
-	case SIOCSIFMTU:
-		if (ifr->ifr_mtu > TI_JUMBO_MTU)
-			error = EINVAL;
-		else {
-			ifp->if_mtu = ifr->ifr_mtu;
-			ti_init(sc);
-		}
-		break;
-	case SIOCSIFFLAGS:
-		if (ifp->if_flags & IFF_UP) {
-			/*
-			 * If only the state of the PROMISC flag changed,
-			 * then just use the 'set promisc mode' command
-			 * instead of reinitializing the entire NIC. Doing
-			 * a full re-init means reloading the firmware and
-			 * waiting for it to start up, which may take a
-			 * second or two.
-			 */
-			if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
-			    ifp->if_flags & IFF_PROMISC &&
-			    !(sc->ti_if_flags & IFF_PROMISC)) {
-				TI_DO_CMD(TI_CMD_SET_PROMISC_MODE,
-				    TI_CMD_CODE_PROMISC_ENB, 0);
-			} else if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
-			    !(ifp->if_flags & IFF_PROMISC) &&
-			    sc->ti_if_flags & IFF_PROMISC) {
-				TI_DO_CMD(TI_CMD_SET_PROMISC_MODE,
-				    TI_CMD_CODE_PROMISC_DIS, 0);
-			} else
-				ti_init(sc);
-		} else {
-			if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
-				ti_stop(sc);
-			}
-		}
-		sc->ti_if_flags = ifp->if_flags;
-		error = 0;
-		break;
-	case SIOCADDMULTI:
-	case SIOCDELMULTI:
-		if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
-			ti_setmulti(sc);
-			error = 0;
-		}
-		break;
-	case SIOCSIFMEDIA:
-	case SIOCGIFMEDIA:
-		error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command);
-		break;
-	case SIOCSIFCAP:
-		mask = ifr->ifr_reqcap ^ ifp->if_capenable;
-		if (mask & IFCAP_HWCSUM) {
-			if (IFCAP_HWCSUM & ifp->if_capenable)
-				ifp->if_capenable &= ~IFCAP_HWCSUM;
-			else
-				ifp->if_capenable |= IFCAP_HWCSUM;
-			if (ifp->if_drv_flags & IFF_DRV_RUNNING)
-				ti_init(sc);
-		}
-		error = 0;
-		break;
-	default:
-		error = ether_ioctl(ifp, command, data);
-		break;
-	}
-
-	TI_UNLOCK(sc);
-
-	return (error);
-}
-
-static int
-ti_open(struct cdev *dev, int flags, int fmt, struct thread *td)
-{
-	struct ti_softc *sc;
-
-	sc = dev->si_drv1;
-	if (sc == NULL)
-		return (ENODEV);
-
-	TI_LOCK(sc);
-	sc->ti_flags |= TI_FLAG_DEBUGING;
-	TI_UNLOCK(sc);
-
-	return (0);
-}
-
-static int
-ti_close(struct cdev *dev, int flag, int fmt, struct thread *td)
-{
-	struct ti_softc *sc;
-
-	sc = dev->si_drv1;
-	if (sc == NULL)
-		return (ENODEV);
-
-	TI_LOCK(sc);
-	sc->ti_flags &= ~TI_FLAG_DEBUGING;
-	TI_UNLOCK(sc);
-
-	return (0);
-}
-
-/*
- * This ioctl routine goes along with the Tigon character device.
- */
-static int
-ti_ioctl2(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
-{
-	int error;
-	struct ti_softc *sc;
-
-	sc = dev->si_drv1;
-	if (sc == NULL)
-		return (ENODEV);
-
-	error = 0;
-
-	switch (cmd) {
-	case TIIOCGETSTATS:
-	{
-		struct ti_stats *outstats;
-
-		outstats = (struct ti_stats *)addr;
-
-		bcopy(&sc->ti_rdata->ti_info.ti_stats, outstats,
-		      sizeof(struct ti_stats));
-		break;
-	}
-	case TIIOCGETPARAMS:
-	{
-		struct ti_params	*params;
-
-		params = (struct ti_params *)addr;
-
-		params->ti_stat_ticks = sc->ti_stat_ticks;
-		params->ti_rx_coal_ticks = sc->ti_rx_coal_ticks;
-		params->ti_tx_coal_ticks = sc->ti_tx_coal_ticks;
-		params->ti_rx_max_coal_bds = sc->ti_rx_max_coal_bds;
-		params->ti_tx_max_coal_bds = sc->ti_tx_max_coal_bds;
-		params->ti_tx_buf_ratio = sc->ti_tx_buf_ratio;
-		params->param_mask = TI_PARAM_ALL;
-
-		error = 0;
-
-		break;
-	}
-	case TIIOCSETPARAMS:
-	{
-		struct ti_params *params;
-
-		params = (struct ti_params *)addr;
-
-		if (params->param_mask & TI_PARAM_STAT_TICKS) {
-			sc->ti_stat_ticks = params->ti_stat_ticks;
-			CSR_WRITE_4(sc, TI_GCR_STAT_TICKS, sc->ti_stat_ticks);
-		}
-
-		if (params->param_mask & TI_PARAM_RX_COAL_TICKS) {
-			sc->ti_rx_coal_ticks = params->ti_rx_coal_ticks;
-			CSR_WRITE_4(sc, TI_GCR_RX_COAL_TICKS,
-				    sc->ti_rx_coal_ticks);
-		}
-
-		if (params->param_mask & TI_PARAM_TX_COAL_TICKS) {
-			sc->ti_tx_coal_ticks = params->ti_tx_coal_ticks;
-			CSR_WRITE_4(sc, TI_GCR_TX_COAL_TICKS,
-				    sc->ti_tx_coal_ticks);
-		}
-
-		if (params->param_mask & TI_PARAM_RX_COAL_BDS) {
-			sc->ti_rx_max_coal_bds = params->ti_rx_max_coal_bds;
-			CSR_WRITE_4(sc, TI_GCR_RX_MAX_COAL_BD,
-				    sc->ti_rx_max_coal_bds);
-		}
-
-		if (params->param_mask & TI_PARAM_TX_COAL_BDS) {
-			sc->ti_tx_max_coal_bds = params->ti_tx_max_coal_bds;
-			CSR_WRITE_4(sc, TI_GCR_TX_MAX_COAL_BD,
-				    sc->ti_tx_max_coal_bds);
-		}
-
-		if (params->param_mask & TI_PARAM_TX_BUF_RATIO) {
-			sc->ti_tx_buf_ratio = params->ti_tx_buf_ratio;
-			CSR_WRITE_4(sc, TI_GCR_TX_BUFFER_RATIO,
-				    sc->ti_tx_buf_ratio);
-		}
-
-		error = 0;
-
-		break;
-	}
-	case TIIOCSETTRACE: {
-		ti_trace_type	trace_type;
-
-		trace_type = *(ti_trace_type *)addr;
-
-		/*
-		 * Set tracing to whatever the user asked for.  Setting
-		 * this register to 0 should have the effect of disabling
-		 * tracing.
-		 */
-		CSR_WRITE_4(sc, TI_GCR_NIC_TRACING, trace_type);
-
-		error = 0;
-
-		break;
-	}
-	case TIIOCGETTRACE: {
-		struct ti_trace_buf	*trace_buf;
-		u_int32_t		trace_start, cur_trace_ptr, trace_len;
-
-		trace_buf = (struct ti_trace_buf *)addr;
-
-		trace_start = CSR_READ_4(sc, TI_GCR_NICTRACE_START);
-		cur_trace_ptr = CSR_READ_4(sc, TI_GCR_NICTRACE_PTR);
-		trace_len = CSR_READ_4(sc, TI_GCR_NICTRACE_LEN);
-
-#if 0
-		printf("ti%d: trace_start = %#x, cur_trace_ptr = %#x, "
-		       "trace_len = %d\n", sc->ti_unit, trace_start,
-		       cur_trace_ptr, trace_len);
-		printf("ti%d: trace_buf->buf_len = %d\n", sc->ti_unit,
-		       trace_buf->buf_len);
-#endif
-
-		error = ti_copy_mem(sc, trace_start, min(trace_len,
-				    trace_buf->buf_len),
-				    (caddr_t)trace_buf->buf, 1, 1);
-
-		if (error == 0) {
-			trace_buf->fill_len = min(trace_len,
-						  trace_buf->buf_len);
-			if (cur_trace_ptr < trace_start)
-				trace_buf->cur_trace_ptr =
-					trace_start - cur_trace_ptr;
-			else
-				trace_buf->cur_trace_ptr =
-					cur_trace_ptr - trace_start;
-		} else
-			trace_buf->fill_len = 0;
-
-		break;
-	}
-
-	/*
-	 * For debugging, five ioctls are needed:
-	 * ALT_ATTACH
-	 * ALT_READ_TG_REG
-	 * ALT_WRITE_TG_REG
-	 * ALT_READ_TG_MEM
-	 * ALT_WRITE_TG_MEM
-	 */
-	case ALT_ATTACH:
-		/*
-		 * From what I can tell, Alteon's Solaris Tigon driver
-		 * only has one character device, so you have to attach
-		 * to the Tigon board you're interested in.  This seems
-		 * like a not-so-good way to do things, since unless you
-		 * subsequently specify the unit number of the device
-		 * you're interested in in every ioctl, you'll only be
-		 * able to debug one board at a time.
-		 */
-		error = 0;
-		break;
-	case ALT_READ_TG_MEM:
-	case ALT_WRITE_TG_MEM:
-	{
-		struct tg_mem *mem_param;
-		u_int32_t sram_end, scratch_end;
-
-		mem_param = (struct tg_mem *)addr;
-
-		if (sc->ti_hwrev == TI_HWREV_TIGON) {
-			sram_end = TI_END_SRAM_I;
-			scratch_end = TI_END_SCRATCH_I;
-		} else {
-			sram_end = TI_END_SRAM_II;
-			scratch_end = TI_END_SCRATCH_II;
-		}
-
-		/*
-		 * For now, we'll only handle accessing regular SRAM,
-		 * nothing else.
-		 */
-		if ((mem_param->tgAddr >= TI_BEG_SRAM)
-		 && ((mem_param->tgAddr + mem_param->len) <= sram_end)) {
-			/*
-			 * In this instance, we always copy to/from user
-			 * space, so the user space argument is set to 1.
-			 */
-			error = ti_copy_mem(sc, mem_param->tgAddr,
-					    mem_param->len,
-					    mem_param->userAddr, 1,
-					    (cmd == ALT_READ_TG_MEM) ? 1 : 0);
-		} else if ((mem_param->tgAddr >= TI_BEG_SCRATCH)
-			&& (mem_param->tgAddr <= scratch_end)) {
-			error = ti_copy_scratch(sc, mem_param->tgAddr,
-						mem_param->len,
-						mem_param->userAddr, 1,
-						(cmd == ALT_READ_TG_MEM) ?
-						1 : 0, TI_PROCESSOR_A);
-		} else if ((mem_param->tgAddr >= TI_BEG_SCRATCH_B_DEBUG)
-			&& (mem_param->tgAddr <= TI_BEG_SCRATCH_B_DEBUG)) {
-			if (sc->ti_hwrev == TI_HWREV_TIGON) {
-				printf("ti%d:  invalid memory range for "
-				       "Tigon I\n", sc->ti_unit);
-				error = EINVAL;
-				break;
-			}
-			error = ti_copy_scratch(sc, mem_param->tgAddr -
-						TI_SCRATCH_DEBUG_OFF,
-						mem_param->len,
-						mem_param->userAddr, 1,
-						(cmd == ALT_READ_TG_MEM) ?
-						1 : 0, TI_PROCESSOR_B);
-		} else {
-			printf("ti%d: memory address %#x len %d is out of "
-			       "supported range\n", sc->ti_unit,
-			        mem_param->tgAddr, mem_param->len);
-			error = EINVAL;
-		}
-
-		break;
-	}
-	case ALT_READ_TG_REG:
-	case ALT_WRITE_TG_REG:
-	{
-		struct tg_reg	*regs;
-		u_int32_t	tmpval;
-
-		regs = (struct tg_reg *)addr;
-
-		/*
-		 * Make sure the address in question isn't out of range.
-		 */
-		if (regs->addr > TI_REG_MAX) {
-			error = EINVAL;
-			break;
-		}
-		if (cmd == ALT_READ_TG_REG) {
-			bus_space_read_region_4(sc->ti_btag, sc->ti_bhandle,
-						regs->addr, &tmpval, 1);
-			regs->data = ntohl(tmpval);
-#if 0
-			if ((regs->addr == TI_CPU_STATE)
-			 || (regs->addr == TI_CPU_CTL_B)) {
-				printf("ti%d: register %#x = %#x\n",
-				       sc->ti_unit, regs->addr, tmpval);
-			}
-#endif
-		} else {
-			tmpval = htonl(regs->data);
-			bus_space_write_region_4(sc->ti_btag, sc->ti_bhandle,
-						 regs->addr, &tmpval, 1);
-		}
-
-		break;
-	}
-	default:
-		error = ENOTTY;
-		break;
-	}
-	return (error);
-}
-
-static void
-ti_watchdog(ifp)
-	struct ifnet		*ifp;
-{
-	struct ti_softc		*sc;
-
-	sc = ifp->if_softc;
-	TI_LOCK(sc);
-
-	/*
-	 * When we're debugging, the chip is often stopped for long periods
-	 * of time, and that would normally cause the watchdog timer to fire.
-	 * Since that impedes debugging, we don't want to do that.
-	 */
-	if (sc->ti_flags & TI_FLAG_DEBUGING) {
-		TI_UNLOCK(sc);
-		return;
-	}
-
-	printf("ti%d: watchdog timeout -- resetting\n", sc->ti_unit);
-	ti_stop(sc);
-	ti_init(sc);
-
-	ifp->if_oerrors++;
-	TI_UNLOCK(sc);
-}
-
-/*
- * Stop the adapter and free any mbufs allocated to the
- * RX and TX lists.
- */
-static void
-ti_stop(sc)
-	struct ti_softc		*sc;
-{
-	struct ifnet		*ifp;
-	struct ti_cmd_desc	cmd;
-
-	TI_LOCK(sc);
-
-	ifp = sc->ti_ifp;
-
-	/* Disable host interrupts. */
-	CSR_WRITE_4(sc, TI_MB_HOSTINTR, 1);
-	/*
-	 * Tell firmware we're shutting down.
-	 */
-	TI_DO_CMD(TI_CMD_HOST_STATE, TI_CMD_CODE_STACK_DOWN, 0);
-
-	/* Halt and reinitialize. */
-	ti_chipinit(sc);
-	ti_mem(sc, 0x2000, 0x100000 - 0x2000, NULL);
-	ti_chipinit(sc);
-
-	/* Free the RX lists. */
-	ti_free_rx_ring_std(sc);
-
-	/* Free jumbo RX list. */
-	ti_free_rx_ring_jumbo(sc);
-
-	/* Free mini RX list. */
-	ti_free_rx_ring_mini(sc);
-
-	/* Free TX buffers. */
-	ti_free_tx_ring(sc);
-
-	sc->ti_ev_prodidx.ti_idx = 0;
-	sc->ti_return_prodidx.ti_idx = 0;
-	sc->ti_tx_considx.ti_idx = 0;
-	sc->ti_tx_saved_considx = TI_TXCONS_UNSET;
-
-	ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
-	TI_UNLOCK(sc);
-}
-
-/*
- * Stop all chip I/O so that the kernel's probe routines don't
- * get confused by errant DMAs when rebooting.
- */
-static void
-ti_shutdown(dev)
-	device_t		dev;
-{
-	struct ti_softc		*sc;
-
-	sc = device_get_softc(dev);
-	TI_LOCK(sc);
-	ti_chipinit(sc);
-	TI_UNLOCK(sc);
-}
Index: agp_ati.c
===================================================================
RCS file: /home/cvs/src/sys/pci/agp_ati.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/agp_ati.c -L sys/pci/agp_ati.c -u -r1.1.1.1 -r1.2
--- sys/pci/agp_ati.c
+++ sys/pci/agp_ati.c
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/agp_ati.c,v 1.1.2.1 2005/11/14 21:14:14 anholt Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/agp_ati.c,v 1.3.2.1 2007/11/08 20:29:53 jhb Exp $");
 
 #include "opt_bus.h"
 
@@ -89,6 +89,8 @@
 		return ("ATI RS100 AGP bridge");
 	case 0xcab21002:
 		return ("ATI RS200 AGP bridge");
+	case 0xcbb21002:
+		return ("ATI RS200M AGP bridge");
 	case 0xcab31002:
 		return ("ATI RS250 AGP bridge");
 	case 0x58301002:
@@ -111,7 +113,6 @@
 
 	desc = agp_ati_match(dev);
 	if (desc) {
-		device_verbose(dev);
 		device_set_desc(dev, desc);
 		return 0;
 	}
@@ -182,7 +183,8 @@
 
 	switch (pci_get_devid(dev)) {
 	case 0xcab01002: /* ATI RS100 AGP bridge */
-	case 0xcab21002: /*ATI RS200 AGP bridge  */
+	case 0xcab21002: /* ATI RS200 AGP bridge */
+	case 0xcbb21002: /* ATI RS200M AGP bridge */
 	case 0xcab31002: /* ATI RS250 AGP bridge */
 		sc->is_rs300 = 0;
 		apsize_reg = ATI_RS100_APSIZE;
@@ -246,18 +248,15 @@
 agp_ati_detach(device_t dev)
 {
 	struct agp_ati_softc *sc = device_get_softc(dev);
-	int error;
 	u_int32_t apsize_reg, temp;
 
+	agp_free_cdev(dev);
+
 	if (sc->is_rs300)
 		apsize_reg = ATI_RS300_APSIZE;
 	else
 		apsize_reg = ATI_RS100_APSIZE;
 
-	error = agp_generic_detach(dev);
-	if (error)
-		return error;
-
 	/* Clear the GATT base */
 	WRITE4(ATI_GART_BASE, 0);
 
@@ -271,6 +270,7 @@
 	free(sc->ag_virtual, M_AGP);
 
 	bus_release_resource(dev, SYS_RES_MEMORY, ATI_GART_MMADDR, sc->regs);
+	agp_free_res(dev);
 
 	return 0;
 }
@@ -381,6 +381,6 @@
 
 static devclass_t agp_devclass;
 
-DRIVER_MODULE(agp_ati, pci, agp_ati_driver, agp_devclass, 0, 0);
+DRIVER_MODULE(agp_ati, hostb, agp_ati_driver, agp_devclass, 0, 0);
 MODULE_DEPEND(agp_ati, agp, 1, 1, 1);
 MODULE_DEPEND(agp_ati, pci, 1, 1, 1);
Index: if_xl.c
===================================================================
RCS file: /home/cvs/src/sys/pci/if_xl.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -L sys/pci/if_xl.c -L sys/pci/if_xl.c -u -r1.2 -r1.3
--- sys/pci/if_xl.c
+++ sys/pci/if_xl.c
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/if_xl.c,v 1.190.2.7 2006/01/18 09:40:29 glebius Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/if_xl.c,v 1.210 2007/08/06 14:26:03 rwatson Exp $");
 
 /*
  * 3Com 3c90x Etherlink XL PCI NIC driver
@@ -245,7 +245,7 @@
 static void xl_init(void *);
 static void xl_init_locked(struct xl_softc *);
 static void xl_stop(struct xl_softc *);
-static void xl_watchdog(struct ifnet *);
+static int xl_watchdog(struct xl_softc *);
 static void xl_shutdown(device_t);
 static int xl_suspend(device_t);
 static int xl_resume(device_t);
@@ -391,7 +391,7 @@
 	}
 
 	if (i == XL_TIMEOUT)
-		if_printf(sc->xl_ifp, "command never completed!\n");
+		device_printf(sc->xl_dev, "command never completed!\n");
 }
 
 /*
@@ -656,8 +656,7 @@
 		if (sc->xl_type == XL_TYPE_905B &&
 		    sc->xl_media == XL_MEDIAOPT_10FL) {
 			if (bootverbose)
-				if_printf(sc->xl_ifp,
-				    "found 10baseFL\n");
+				device_printf(sc->xl_dev, "found 10baseFL\n");
 			ifmedia_add(ifm, IFM_ETHER | IFM_10_FL, 0, NULL);
 			ifmedia_add(ifm, IFM_ETHER | IFM_10_FL|IFM_HDX, 0,
 			    NULL);
@@ -666,14 +665,14 @@
 				    IFM_ETHER | IFM_10_FL | IFM_FDX, 0, NULL);
 		} else {
 			if (bootverbose)
-				if_printf(sc->xl_ifp, "found AUI\n");
+				device_printf(sc->xl_dev, "found AUI\n");
 			ifmedia_add(ifm, IFM_ETHER | IFM_10_5, 0, NULL);
 		}
 	}
 
 	if (sc->xl_media & XL_MEDIAOPT_BNC) {
 		if (bootverbose)
-			if_printf(sc->xl_ifp, "found BNC\n");
+			device_printf(sc->xl_dev, "found BNC\n");
 		ifmedia_add(ifm, IFM_ETHER | IFM_10_2, 0, NULL);
 	}
 }
@@ -695,7 +694,7 @@
 	}
 
 	if (i == 100) {
-		if_printf(sc->xl_ifp, "eeprom failed to come ready\n");
+		device_printf(sc->xl_dev, "eeprom failed to come ready\n");
 		return (1);
 	}
 
@@ -857,9 +856,9 @@
 	if (m == NULL)
 		return;
 
-	bcopy(&IFP2ENADDR(sc->xl_ifp),
+	bcopy(IF_LLADDR(sc->xl_ifp),
 		mtod(m, struct ether_header *)->ether_dhost, ETHER_ADDR_LEN);
-	bcopy(&IFP2ENADDR(sc->xl_ifp),
+	bcopy(IF_LLADDR(sc->xl_ifp),
 		mtod(m, struct ether_header *)->ether_shost, ETHER_ADDR_LEN);
 	mtod(m, struct ether_header *)->ether_type = htons(3);
 	mtod(m, unsigned char *)[14] = 0;
@@ -984,7 +983,7 @@
 	DELAY(800);
 	XL_SEL_WIN(7);
 
-	if_printf(sc->xl_ifp, "selecting %s, %s duplex\n", pmsg, dmsg);
+	device_printf(sc->xl_dev, "selecting %s, %s duplex\n", pmsg, dmsg);
 }
 
 static void
@@ -1016,7 +1015,7 @@
 	}
 
 	if (i == XL_TIMEOUT)
-		if_printf(sc->xl_ifp, "reset didn't complete\n");
+		device_printf(sc->xl_dev, "reset didn't complete\n");
 
 	/* Reset TX and RX. */
 	/* Note: the RX reset takes an absurd amount of time
@@ -1099,20 +1098,20 @@
 		if (sc->xl_xcvr <= XL_XCVR_AUTO)
 			return;
 		else {
-			if_printf(sc->xl_ifp,
+			device_printf(sc->xl_dev,
 			    "bogus xcvr value in EEPROM (%x)\n", sc->xl_xcvr);
-			if_printf(sc->xl_ifp,
+			device_printf(sc->xl_dev,
 			    "choosing new default based on card type\n");
 		}
 	} else {
 		if (sc->xl_type == XL_TYPE_905B &&
 		    sc->xl_media & XL_MEDIAOPT_10FL)
 			return;
-		if_printf(sc->xl_ifp,
+		device_printf(sc->xl_dev,
 "WARNING: no media options bits set in the media options register!!\n");
-		if_printf(sc->xl_ifp,
+		device_printf(sc->xl_dev,
 "this could be a manufacturing defect in your adapter or system\n");
-		if_printf(sc->xl_ifp,
+		device_printf(sc->xl_dev,
 "attempting to guess media type; you should probably consult your vendor\n");
 	}
 
@@ -1137,7 +1136,7 @@
 		sc->xl_media = XL_MEDIAOPT_BT;
 		sc->xl_xcvr = XL_XCVR_10BT;
 		if (verbose)
-			if_printf(sc->xl_ifp,
+			device_printf(sc->xl_dev,
 			    "guessing 10BaseT transceiver\n");
 		break;
 	case TC_DEVICEID_BOOMERANG_10BT_COMBO:	/* 3c900-COMBO */
@@ -1145,20 +1144,20 @@
 		sc->xl_media = XL_MEDIAOPT_BT|XL_MEDIAOPT_BNC|XL_MEDIAOPT_AUI;
 		sc->xl_xcvr = XL_XCVR_10BT;
 		if (verbose)
-			if_printf(sc->xl_ifp,
+			device_printf(sc->xl_dev,
 			    "guessing COMBO (AUI/BNC/TP)\n");
 		break;
 	case TC_DEVICEID_KRAKATOA_10BT_TPC:	/* 3c900B-TPC */
 		sc->xl_media = XL_MEDIAOPT_BT|XL_MEDIAOPT_BNC;
 		sc->xl_xcvr = XL_XCVR_10BT;
 		if (verbose)
-			if_printf(sc->xl_ifp, "guessing TPC (BNC/TP)\n");
+			device_printf(sc->xl_dev, "guessing TPC (BNC/TP)\n");
 		break;
 	case TC_DEVICEID_CYCLONE_10FL:		/* 3c900B-FL */
 		sc->xl_media = XL_MEDIAOPT_10FL;
 		sc->xl_xcvr = XL_XCVR_AUI;
 		if (verbose)
-			if_printf(sc->xl_ifp, "guessing 10baseFL\n");
+			device_printf(sc->xl_dev, "guessing 10baseFL\n");
 		break;
 	case TC_DEVICEID_BOOMERANG_10_100BT:	/* 3c905-TX */
 	case TC_DEVICEID_HURRICANE_555:		/* 3c555 */
@@ -1175,15 +1174,14 @@
 		sc->xl_media = XL_MEDIAOPT_MII;
 		sc->xl_xcvr = XL_XCVR_MII;
 		if (verbose)
-			if_printf(sc->xl_ifp, "guessing MII\n");
+			device_printf(sc->xl_dev, "guessing MII\n");
 		break;
 	case TC_DEVICEID_BOOMERANG_100BT4:	/* 3c905-T4 */
 	case TC_DEVICEID_CYCLONE_10_100BT4:	/* 3c905B-T4 */
 		sc->xl_media = XL_MEDIAOPT_BT4;
 		sc->xl_xcvr = XL_XCVR_MII;
 		if (verbose)
-			if_printf(sc->xl_ifp,
-			    "guessing 100baseT4/MII\n");
+			device_printf(sc->xl_dev, "guessing 100baseT4/MII\n");
 		break;
 	case TC_DEVICEID_HURRICANE_10_100BT:	/* 3c905B-TX */
 	case TC_DEVICEID_HURRICANE_10_100BT_SERV:/*3c980-TX */
@@ -1194,18 +1192,17 @@
 		sc->xl_media = XL_MEDIAOPT_BTX;
 		sc->xl_xcvr = XL_XCVR_AUTO;
 		if (verbose)
-			if_printf(sc->xl_ifp,
-			    "guessing 10/100 internal\n");
+			device_printf(sc->xl_dev, "guessing 10/100 internal\n");
 		break;
 	case TC_DEVICEID_CYCLONE_10_100_COMBO:	/* 3c905B-COMBO */
 		sc->xl_media = XL_MEDIAOPT_BTX|XL_MEDIAOPT_BNC|XL_MEDIAOPT_AUI;
 		sc->xl_xcvr = XL_XCVR_AUTO;
 		if (verbose)
-			if_printf(sc->xl_ifp,
+			device_printf(sc->xl_dev,
 			    "guessing 10/100 plus BNC/AUI\n");
 		break;
 	default:
-		if_printf(sc->xl_ifp,
+		device_printf(sc->xl_dev,
 		    "unknown device ID: %x -- defaulting to 10baseT\n", devid);
 		sc->xl_media = XL_MEDIAOPT_BT;
 		break;
@@ -1228,6 +1225,8 @@
 	uint16_t		did;
 
 	sc = device_get_softc(dev);
+	sc->xl_dev = dev;
+	
 	unit = device_get_unit(dev);
 
 	mtx_init(&sc->xl_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
@@ -1250,13 +1249,18 @@
 	if (did == TC_DEVICEID_HURRICANE_556B)
 		sc->xl_flags |= XL_FLAG_NO_XCVR_PWR;
 
+	if (did == TC_DEVICEID_HURRICANE_575B ||
+	    did == TC_DEVICEID_HURRICANE_575C ||
+	    did == TC_DEVICEID_HURRICANE_656B ||
+	    did == TC_DEVICEID_TORNADO_656C)
+		sc->xl_flags |= XL_FLAG_FUNCREG;
 	if (did == TC_DEVICEID_HURRICANE_575A ||
 	    did == TC_DEVICEID_HURRICANE_575B ||
 	    did == TC_DEVICEID_HURRICANE_575C ||
 	    did == TC_DEVICEID_HURRICANE_656B ||
 	    did == TC_DEVICEID_TORNADO_656C)
-		sc->xl_flags |= XL_FLAG_FUNCREG | XL_FLAG_PHYOK |
-		    XL_FLAG_EEPROM_OFFSET_30 | XL_FLAG_8BITROM;
+		sc->xl_flags |= XL_FLAG_PHYOK | XL_FLAG_EEPROM_OFFSET_30 |
+		  XL_FLAG_8BITROM;
 	if (did == TC_DEVICEID_HURRICANE_656)
 		sc->xl_flags |= XL_FLAG_FUNCREG | XL_FLAG_PHYOK;
 	if (did == TC_DEVICEID_HURRICANE_575B)
@@ -1322,7 +1326,7 @@
 		    RF_ACTIVE);
 
 		if (sc->xl_fres == NULL) {
-			device_printf(dev, "couldn't map ports/memory\n");
+			device_printf(dev, "couldn't map funcreg memory\n");
 			error = ENXIO;
 			goto fail;
 		}
@@ -1376,7 +1380,7 @@
 	 * All of our lists are allocated as a contiguous block
 	 * of memory.
 	 */
-	error = bus_dma_tag_create(NULL, 8, 0,
+	error = bus_dma_tag_create(bus_get_dma_tag(dev), 8, 0,
 	    BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
 	    XL_RX_LIST_SZ, 1, XL_RX_LIST_SZ, 0, NULL, NULL,
 	    &sc->xl_ldata.xl_rx_tag);
@@ -1408,7 +1412,7 @@
 		goto fail;
 	}
 
-	error = bus_dma_tag_create(NULL, 8, 0,
+	error = bus_dma_tag_create(bus_get_dma_tag(dev), 8, 0,
 	    BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
 	    XL_TX_LIST_SZ, 1, XL_TX_LIST_SZ, 0, NULL, NULL,
 	    &sc->xl_ldata.xl_tx_tag);
@@ -1443,7 +1447,7 @@
 	/*
 	 * Allocate a DMA tag for the mapping of mbufs.
 	 */
-	error = bus_dma_tag_create(NULL, 1, 0,
+	error = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0,
 	    BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
 	    MCLBYTES * XL_MAXFRAGS, XL_MAXFRAGS, MCLBYTES, 0, NULL,
 	    NULL, &sc->xl_mtag);
@@ -1474,7 +1478,9 @@
 	else
 		sc->xl_type = XL_TYPE_90X;
 
-	ifp->if_mtu = ETHERMTU;
+	/* Set the TX start threshold for best performance. */
+	sc->xl_tx_thresh = XL_MIN_FRAMELEN;
+
 	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
 	ifp->if_ioctl = xl_ioctl;
 	ifp->if_capabilities = IFCAP_VLAN_MTU;
@@ -1491,7 +1497,6 @@
 	ifp->if_capabilities |= IFCAP_POLLING;
 #endif
 	ifp->if_start = xl_start;
-	ifp->if_watchdog = xl_watchdog;
 	ifp->if_init = xl_init;
 	IFQ_SET_MAXLEN(&ifp->if_snd, XL_TX_LIST_CNT - 1);
 	ifp->if_snd.ifq_drv_maxlen = XL_TX_LIST_CNT - 1;
@@ -1601,7 +1606,7 @@
 	ether_ifattach(ifp, eaddr);
 
 	error = bus_setup_intr(dev, sc->xl_irq, INTR_TYPE_NET | INTR_MPSAFE,
-	    xl_intr, sc, &sc->xl_intrhand);
+	    NULL, xl_intr, sc, &sc->xl_intrhand);
 	if (error) {
 		device_printf(dev, "couldn't set up irq\n");
 		ether_ifdetach(ifp);
@@ -1655,7 +1660,7 @@
 		*media = IFM_ETHER|IFM_100_FX;
 		break;
 	default:
-		if_printf(sc->xl_ifp, "unknown XCVR type: %d\n",
+		device_printf(sc->xl_dev, "unknown XCVR type: %d\n",
 		    sc->xl_xcvr);
 		/*
 		 * This will probably be wrong, but it prevents
@@ -1710,8 +1715,6 @@
 		callout_drain(&sc->xl_stat_callout);
 		ether_ifdetach(ifp);
 	}
-	if (ifp)
-		if_free(ifp);
 	if (sc->xl_miibus)
 		device_delete_child(dev, sc->xl_miibus);
 	bus_generic_detach(dev);
@@ -1727,6 +1730,9 @@
 	if (sc->xl_res)
 		bus_release_resource(dev, res, rid, sc->xl_res);
 
+	if (ifp)
+		if_free(ifp);
+
 	if (sc->xl_mtag) {
 		bus_dmamap_destroy(sc->xl_mtag, sc->xl_tmpmap);
 		bus_dma_tag_destroy(sc->xl_mtag);
@@ -1902,7 +1908,7 @@
 	    xl_dma_map_rxbuf, &baddr, BUS_DMA_NOWAIT);
 	if (error) {
 		m_freem(m_new);
-		if_printf(sc->xl_ifp, "can't map mbuf (error %d)\n",
+		device_printf(sc->xl_dev, "can't map mbuf (error %d)\n",
 		    error);
 		return (error);
 	}
@@ -2001,7 +2007,7 @@
 		 * If not, something truly strange has happened.
 		 */
 		if (!(rxstat & XL_RXSTAT_UP_CMPLT)) {
-			if_printf(ifp,
+			device_printf(sc->xl_dev,
 			    "bad receive status -- packet dropped\n");
 			ifp->if_ierrors++;
 			cur_rx->xl_ptr->xl_status = 0;
@@ -2096,12 +2102,10 @@
 {
 	struct xl_softc *sc = (struct xl_softc *)arg;
 
-	NET_LOCK_GIANT();
 	XL_LOCK(sc);
 	if (sc->xl_ifp->if_drv_flags & IFF_DRV_RUNNING)
 		xl_rxeof(sc);
 	XL_UNLOCK(sc);
-	NET_UNLOCK_GIANT();
 }
 
 /*
@@ -2116,9 +2120,6 @@
 
 	XL_LOCK_ASSERT(sc);
 
-	/* Clear the timeout timer. */
-	ifp->if_timer = 0;
-
 	/*
 	 * Go through our tx list and free mbufs for those
 	 * frames that have been uploaded. Note: the 3c905B
@@ -2148,6 +2149,7 @@
 
 	if (sc->xl_cdata.xl_tx_head == NULL) {
 		ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
+		sc->xl_wdog_timer = 0;
 		sc->xl_cdata.xl_tx_tail = NULL;
 	} else {
 		if (CSR_READ_4(sc, XL_DMACTL) & XL_DMACTL_DOWN_STALLED ||
@@ -2191,9 +2193,10 @@
 
 		sc->xl_cdata.xl_tx_cnt--;
 		XL_INC(idx, XL_TX_LIST_CNT);
-		ifp->if_timer = 0;
 	}
 
+	if (sc->xl_cdata.xl_tx_cnt == 0)
+		sc->xl_wdog_timer = 0;
 	sc->xl_cdata.xl_tx_cons = idx;
 
 	if (cur_tx != NULL)
@@ -2216,7 +2219,7 @@
 		if (txstat & XL_TXSTATUS_UNDERRUN ||
 			txstat & XL_TXSTATUS_JABBER ||
 			txstat & XL_TXSTATUS_RECLAIM) {
-			if_printf(sc->xl_ifp,
+			device_printf(sc->xl_dev,
 			    "transmission error: %x\n", txstat);
 			CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_TX_RESET);
 			xl_wait(sc);
@@ -2244,7 +2247,7 @@
 			if (txstat & XL_TXSTATUS_UNDERRUN &&
 			    sc->xl_tx_thresh < XL_PACKET_SIZE) {
 				sc->xl_tx_thresh += XL_MIN_FRAMELEN;
-				if_printf(sc->xl_ifp,
+				device_printf(sc->xl_dev,
 "tx underrun, increasing tx start threshold to %d bytes\n", sc->xl_tx_thresh);
 			}
 			CSR_WRITE_2(sc, XL_COMMAND,
@@ -2403,6 +2406,10 @@
 	struct xl_softc *sc = xsc;
 
 	XL_LOCK_ASSERT(sc);
+
+	if (xl_watchdog(sc) == EJUSTRETURN)
+		return;
+
 	xl_stats_update_locked(sc);
 }
 
@@ -2658,7 +2665,7 @@
 	/*
 	 * Set a timeout in case the chip goes out to lunch.
 	 */
-	ifp->if_timer = 5;
+	sc->xl_wdog_timer = 5;
 
 	/*
 	 * XXX Under certain conditions, usually on slower machines
@@ -2756,7 +2763,7 @@
 	/*
 	 * Set a timeout in case the chip goes out to lunch.
 	 */
-	ifp->if_timer = 5;
+	sc->xl_wdog_timer = 5;
 }
 
 static void
@@ -2799,7 +2806,7 @@
 	XL_SEL_WIN(2);
 	for (i = 0; i < ETHER_ADDR_LEN; i++) {
 		CSR_WRITE_1(sc, XL_W2_STATION_ADDR_LO + i,
-				IFP2ENADDR(sc->xl_ifp)[i]);
+				IF_LLADDR(sc->xl_ifp)[i]);
 	}
 
 	/* Clear the station mask. */
@@ -2815,7 +2822,7 @@
 	/* Init circular RX list. */
 	error = xl_list_rx_init(sc);
 	if (error) {
-		if_printf(ifp, "initialization of the rx ring failed (%d)\n",
+		device_printf(sc->xl_dev, "initialization of the rx ring failed (%d)\n",
 		    error);
 		xl_stop(sc);
 		return;
@@ -2827,7 +2834,7 @@
 	else
 		error = xl_list_tx_init(sc);
 	if (error) {
-		if_printf(ifp, "initialization of the tx ring failed (%d)\n",
+		device_printf(sc->xl_dev, "initialization of the tx ring failed (%d)\n",
 		    error);
 		xl_stop(sc);
 		return;
@@ -2842,7 +2849,6 @@
 	CSR_WRITE_1(sc, XL_TX_FREETHRESH, XL_PACKET_SIZE >> 8);
 
 	/* Set the TX start threshold for best performance. */
-	sc->xl_tx_thresh = XL_MIN_FRAMELEN;
 	CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_TX_SET_START|sc->xl_tx_thresh);
 
 	/*
@@ -2992,6 +2998,7 @@
 	ifp->if_drv_flags |= IFF_DRV_RUNNING;
 	ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
 
+	sc->xl_wdog_timer = 0;
 	callout_reset(&sc->xl_stat_callout, hz, xl_stats_update, sc);
 }
 
@@ -3224,24 +3231,25 @@
 	return (error);
 }
 
-/*
- * XXX: Invoked from ifnet slow timer. Lock coverage needed.
- */
-static void
-xl_watchdog(struct ifnet *ifp)
+static int
+xl_watchdog(struct xl_softc *sc)
 {
-	struct xl_softc		*sc = ifp->if_softc;
+	struct ifnet		*ifp = sc->xl_ifp;
 	u_int16_t		status = 0;
 
-	XL_LOCK(sc);
+	XL_LOCK_ASSERT(sc);
+
+	if (sc->xl_wdog_timer == 0 || --sc->xl_wdog_timer != 0)
+		return (0);
 
 	ifp->if_oerrors++;
 	XL_SEL_WIN(4);
 	status = CSR_READ_2(sc, XL_W4_MEDIA_STATUS);
-	if_printf(ifp, "watchdog timeout\n");
+	device_printf(sc->xl_dev, "watchdog timeout\n");
 
 	if (status & XL_MEDIASTAT_CARRIER)
-		if_printf(ifp, "no carrier - transceiver cable problem?\n");
+		device_printf(sc->xl_dev,
+		    "no carrier - transceiver cable problem?\n");
 
 	xl_txeoc(sc);
 	xl_txeof(sc);
@@ -3256,7 +3264,7 @@
 			xl_start_locked(ifp);
 	}
 
-	XL_UNLOCK(sc);
+	return (EJUSTRETURN);
 }
 
 /*
@@ -3271,7 +3279,7 @@
 
 	XL_LOCK_ASSERT(sc);
 
-	ifp->if_timer = 0;
+	sc->xl_wdog_timer = 0;
 
 	CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RX_DISABLE);
 	CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_STATS_DISABLE);
--- sys/pci/if_dcreg.h
+++ /dev/null
@@ -1,1235 +0,0 @@
-/*-
- * Copyright (c) 1997, 1998, 1999
- *	Bill Paul <wpaul at ee.columbia.edu>.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by Bill Paul.
- * 4. Neither the name of the author nor the names of any co-contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/pci/if_dcreg.h,v 1.44.2.2 2006/03/21 21:10:58 jhb Exp $
- */
-
-/*
- * 21143 and clone common register definitions.
- */
-
-#define DC_BUSCTL		0x00	/* bus control */
-#define DC_TXSTART		0x08	/* tx start demand */
-#define DC_RXSTART		0x10	/* rx start demand */
-#define DC_RXADDR		0x18	/* rx descriptor list start addr */
-#define DC_TXADDR		0x20	/* tx descriptor list start addr */
-#define DC_ISR			0x28	/* interrupt status register */
-#define DC_NETCFG		0x30	/* network config register */
-#define DC_IMR			0x38	/* interrupt mask */
-#define DC_FRAMESDISCARDED	0x40	/* # of discarded frames */
-#define DC_SIO			0x48	/* MII and ROM/EEPROM access */
-#define DC_ROM			0x50	/* ROM programming address */
-#define DC_TIMER		0x58	/* general timer */
-#define DC_10BTSTAT		0x60	/* SIA status */
-#define DC_SIARESET		0x68	/* SIA connectivity */
-#define DC_10BTCTRL		0x70	/* SIA transmit and receive */
-#define DC_WATCHDOG		0x78	/* SIA and general purpose port */
-#define DC_SIAGP		0x78	/* SIA and general purpose port (X3201) */
-
-/*
- * There are two general 'types' of MX chips that we need to be
- * concerned with. One is the original 98713, which has its internal
- * NWAY support controlled via the MDIO bits in the serial I/O
- * register. The other is everything else (from the 98713A on up),
- * which has its internal NWAY controlled via CSR13, CSR14 and CSR15,
- * just like the 21143. This type setting also governs which of the
- * 'magic' numbers we write to CSR16. The PNIC II falls into the
- * 98713A/98715/98715A/98725 category.
- */
-#define DC_TYPE_98713		0x1
-#define DC_TYPE_98713A		0x2
-#define DC_TYPE_987x5		0x3
-
-/* Other type of supported chips. */
-#define DC_TYPE_21143		0x4	/* Intel 21143 */
-#define DC_TYPE_ASIX		0x5	/* ASIX AX88140A/AX88141 */
-#define DC_TYPE_AL981		0x6	/* ADMtek AL981 Comet */
-#define DC_TYPE_AN985		0x7	/* ADMtek AN985 Centaur */
-#define DC_TYPE_DM9102		0x8	/* Davicom DM9102 */
-#define DC_TYPE_PNICII		0x9	/* 82c115 PNIC II */
-#define DC_TYPE_PNIC		0xA	/* 82c168/82c169 PNIC I */
-#define	DC_TYPE_XIRCOM		0xB	/* Xircom X3201 */
-#define DC_TYPE_CONEXANT	0xC	/* Conexant LANfinity RS7112 */
-
-#define DC_IS_MACRONIX(x)			\
-	(x->dc_type == DC_TYPE_98713 ||		\
-	 x->dc_type == DC_TYPE_98713A ||	\
-	 x->dc_type == DC_TYPE_987x5)
-
-#define DC_IS_ADMTEK(x)				\
-	(x->dc_type == DC_TYPE_AL981 ||		\
-	 x->dc_type == DC_TYPE_AN985)
-
-#define DC_IS_INTEL(x)		(x->dc_type == DC_TYPE_21143)
-#define DC_IS_ASIX(x)		(x->dc_type == DC_TYPE_ASIX)
-#define DC_IS_COMET(x)		(x->dc_type == DC_TYPE_AL981)
-#define DC_IS_CENTAUR(x)	(x->dc_type == DC_TYPE_AN985)
-#define DC_IS_DAVICOM(x)	(x->dc_type == DC_TYPE_DM9102)
-#define DC_IS_PNICII(x)		(x->dc_type == DC_TYPE_PNICII)
-#define DC_IS_PNIC(x)		(x->dc_type == DC_TYPE_PNIC)
-#define	DC_IS_XIRCOM(x)		(x->dc_type == DC_TYPE_XIRCOM)
-#define DC_IS_CONEXANT(x)	(x->dc_type == DC_TYPE_CONEXANT)
-
-/* MII/symbol mode port types */
-#define DC_PMODE_MII		0x1
-#define DC_PMODE_SYM		0x2
-#define DC_PMODE_SIA		0x3
-
-/*
- * Bus control bits.
- */
-#define DC_BUSCTL_RESET		0x00000001
-#define DC_BUSCTL_ARBITRATION	0x00000002
-#define DC_BUSCTL_SKIPLEN	0x0000007C
-#define DC_BUSCTL_BUF_BIGENDIAN	0x00000080
-#define DC_BUSCTL_BURSTLEN	0x00003F00
-#define DC_BUSCTL_CACHEALIGN	0x0000C000
-#define DC_BUSCTL_TXPOLL	0x000E0000
-#define DC_BUSCTL_DBO		0x00100000
-#define DC_BUSCTL_MRME		0x00200000
-#define DC_BUSCTL_MRLE		0x00800000
-#define DC_BUSCTL_MWIE		0x01000000
-#define DC_BUSCTL_ONNOW_ENB	0x04000000
-
-#define DC_SKIPLEN_1LONG	0x00000004
-#define DC_SKIPLEN_2LONG	0x00000008
-#define DC_SKIPLEN_3LONG	0x00000010
-#define DC_SKIPLEN_4LONG	0x00000020
-#define DC_SKIPLEN_5LONG	0x00000040
-
-#define DC_CACHEALIGN_NONE	0x00000000
-#define DC_CACHEALIGN_8LONG	0x00004000
-#define DC_CACHEALIGN_16LONG	0x00008000
-#define DC_CACHEALIGN_32LONG	0x0000C000
-
-#define DC_BURSTLEN_USECA	0x00000000
-#define DC_BURSTLEN_1LONG	0x00000100
-#define DC_BURSTLEN_2LONG	0x00000200
-#define DC_BURSTLEN_4LONG	0x00000400
-#define DC_BURSTLEN_8LONG	0x00000800
-#define DC_BURSTLEN_16LONG	0x00001000
-#define DC_BURSTLEN_32LONG	0x00002000
-
-#define DC_TXPOLL_OFF		0x00000000
-#define DC_TXPOLL_1		0x00020000
-#define DC_TXPOLL_2		0x00040000
-#define DC_TXPOLL_3		0x00060000
-#define DC_TXPOLL_4		0x00080000
-#define DC_TXPOLL_5		0x000A0000
-#define DC_TXPOLL_6		0x000C0000
-#define DC_TXPOLL_7		0x000E0000
-
-/*
- * Interrupt status bits.
- */
-#define DC_ISR_TX_OK		0x00000001
-#define DC_ISR_TX_IDLE		0x00000002
-#define DC_ISR_TX_NOBUF		0x00000004
-#define DC_ISR_TX_JABBERTIMEO	0x00000008
-#define DC_ISR_LINKGOOD		0x00000010
-#define DC_ISR_TX_UNDERRUN	0x00000020
-#define DC_ISR_RX_OK		0x00000040
-#define DC_ISR_RX_NOBUF		0x00000080
-#define DC_ISR_RX_READ		0x00000100
-#define DC_ISR_RX_WATDOGTIMEO	0x00000200
-#define DC_ISR_TX_EARLY		0x00000400
-#define DC_ISR_TIMER_EXPIRED	0x00000800
-#define DC_ISR_LINKFAIL		0x00001000
-#define DC_ISR_BUS_ERR		0x00002000
-#define DC_ISR_RX_EARLY		0x00004000
-#define DC_ISR_ABNORMAL		0x00008000
-#define DC_ISR_NORMAL		0x00010000
-#define DC_ISR_RX_STATE		0x000E0000
-#define DC_ISR_TX_STATE		0x00700000
-#define DC_ISR_BUSERRTYPE	0x03800000
-#define DC_ISR_100MBPSLINK	0x08000000
-#define DC_ISR_MAGICKPACK	0x10000000
-
-#define DC_RXSTATE_STOPPED	0x00000000	/* 000 - Stopped */
-#define DC_RXSTATE_FETCH	0x00020000	/* 001 - Fetching descriptor */
-#define DC_RXSTATE_ENDCHECK	0x00040000	/* 010 - check for rx end */
-#define DC_RXSTATE_WAIT		0x00060000	/* 011 - waiting for packet */
-#define DC_RXSTATE_SUSPEND	0x00080000	/* 100 - suspend rx */
-#define DC_RXSTATE_CLOSE	0x000A0000	/* 101 - close tx desc */
-#define DC_RXSTATE_FLUSH	0x000C0000	/* 110 - flush from FIFO */
-#define DC_RXSTATE_DEQUEUE	0x000E0000	/* 111 - dequeue from FIFO */
-
-#define DC_TXSTATE_RESET	0x00000000	/* 000 - reset */
-#define DC_TXSTATE_FETCH	0x00100000	/* 001 - fetching descriptor */
-#define DC_TXSTATE_WAITEND	0x00200000	/* 010 - wait for tx end */
-#define DC_TXSTATE_READING	0x00300000	/* 011 - read and enqueue */
-#define DC_TXSTATE_RSVD		0x00400000	/* 100 - reserved */
-#define DC_TXSTATE_SETUP	0x00500000	/* 101 - setup packet */
-#define DC_TXSTATE_SUSPEND	0x00600000	/* 110 - suspend tx */
-#define DC_TXSTATE_CLOSE	0x00700000	/* 111 - close tx desc */
-
-/*
- * Network config bits.
- */
-#define DC_NETCFG_RX_HASHPERF	0x00000001
-#define DC_NETCFG_RX_ON		0x00000002
-#define DC_NETCFG_RX_HASHONLY	0x00000004
-#define DC_NETCFG_RX_BADFRAMES	0x00000008
-#define DC_NETCFG_RX_INVFILT	0x00000010
-#define DC_NETCFG_BACKOFFCNT	0x00000020
-#define DC_NETCFG_RX_PROMISC	0x00000040
-#define DC_NETCFG_RX_ALLMULTI	0x00000080
-#define DC_NETCFG_FULLDUPLEX	0x00000200
-#define DC_NETCFG_LOOPBACK	0x00000C00
-#define DC_NETCFG_FORCECOLL	0x00001000
-#define DC_NETCFG_TX_ON		0x00002000
-#define DC_NETCFG_TX_THRESH	0x0000C000
-#define DC_NETCFG_TX_BACKOFF	0x00020000
-#define DC_NETCFG_PORTSEL	0x00040000	/* 0 == 10, 1 == 100 */
-#define DC_NETCFG_HEARTBEAT	0x00080000
-#define DC_NETCFG_STORENFWD	0x00200000
-#define DC_NETCFG_SPEEDSEL	0x00400000	/* 1 == 10, 0 == 100 */
-#define DC_NETCFG_PCS		0x00800000
-#define DC_NETCFG_SCRAMBLER	0x01000000
-#define DC_NETCFG_NO_RXCRC	0x02000000
-#define DC_NETCFG_RX_ALL	0x40000000
-#define DC_NETCFG_CAPEFFECT	0x80000000
-
-#define DC_OPMODE_NORM		0x00000000
-#define DC_OPMODE_INTLOOP	0x00000400
-#define DC_OPMODE_EXTLOOP	0x00000800
-
-#if 0
-#define DC_TXTHRESH_72BYTES	0x00000000
-#define DC_TXTHRESH_96BYTES	0x00004000
-#define DC_TXTHRESH_128BYTES	0x00008000
-#define DC_TXTHRESH_160BYTES	0x0000C000
-#endif
-
-#define DC_TXTHRESH_MIN		0x00000000
-#define DC_TXTHRESH_INC		0x00004000
-#define DC_TXTHRESH_MAX		0x0000C000
-
-
-/*
- * Interrupt mask bits.
- */
-#define DC_IMR_TX_OK		0x00000001
-#define DC_IMR_TX_IDLE		0x00000002
-#define DC_IMR_TX_NOBUF		0x00000004
-#define DC_IMR_TX_JABBERTIMEO	0x00000008
-#define DC_IMR_LINKGOOD		0x00000010
-#define DC_IMR_TX_UNDERRUN	0x00000020
-#define DC_IMR_RX_OK		0x00000040
-#define DC_IMR_RX_NOBUF		0x00000080
-#define DC_IMR_RX_READ		0x00000100
-#define DC_IMR_RX_WATDOGTIMEO	0x00000200
-#define DC_IMR_TX_EARLY		0x00000400
-#define DC_IMR_TIMER_EXPIRED	0x00000800
-#define DC_IMR_LINKFAIL		0x00001000
-#define DC_IMR_BUS_ERR		0x00002000
-#define DC_IMR_RX_EARLY		0x00004000
-#define DC_IMR_ABNORMAL		0x00008000
-#define DC_IMR_NORMAL		0x00010000
-#define DC_IMR_100MBPSLINK	0x08000000
-#define DC_IMR_MAGICKPACK	0x10000000
-
-#define DC_INTRS	\
-	(DC_IMR_RX_OK|DC_IMR_TX_OK|DC_IMR_RX_NOBUF|DC_IMR_RX_WATDOGTIMEO|\
-	DC_IMR_TX_NOBUF|DC_IMR_TX_UNDERRUN|DC_IMR_BUS_ERR|		\
-	DC_IMR_ABNORMAL|DC_IMR_NORMAL/*|DC_IMR_TX_EARLY*/)
-/*
- * Serial I/O (EEPROM/ROM) bits.
- */
-#define DC_SIO_EE_CS		0x00000001	/* EEPROM chip select */
-#define DC_SIO_EE_CLK		0x00000002	/* EEPROM clock */
-#define DC_SIO_EE_DATAIN	0x00000004	/* EEPROM data output */
-#define DC_SIO_EE_DATAOUT	0x00000008	/* EEPROM data input */
-#define DC_SIO_ROMDATA4		0x00000010
-#define DC_SIO_ROMDATA5		0x00000020
-#define DC_SIO_ROMDATA6		0x00000040
-#define DC_SIO_ROMDATA7		0x00000080
-#define DC_SIO_EESEL		0x00000800
-#define DC_SIO_ROMSEL		0x00001000
-#define DC_SIO_ROMCTL_WRITE	0x00002000
-#define DC_SIO_ROMCTL_READ	0x00004000
-#define DC_SIO_MII_CLK		0x00010000	/* MDIO clock */
-#define DC_SIO_MII_DATAOUT	0x00020000	/* MDIO data out */
-#define DC_SIO_MII_DIR		0x00040000	/* MDIO dir */
-#define DC_SIO_MII_DATAIN	0x00080000	/* MDIO data in */
-
-#define DC_EECMD_WRITE		0x140
-#define DC_EECMD_READ		0x180
-#define DC_EECMD_ERASE		0x1c0
-
-#define DC_EE_NODEADDR_OFFSET	0x70
-#define DC_EE_NODEADDR		10
-
-/*
- * General purpose timer register
- */
-#define DC_TIMER_VALUE		0x0000FFFF
-#define DC_TIMER_CONTINUOUS	0x00010000
-
-/*
- * 10baseT status register
- */
-#define DC_TSTAT_MIIACT		0x00000001 /* MII port activity */
-#define DC_TSTAT_LS100		0x00000002 /* link status of 100baseTX */
-#define DC_TSTAT_LS10		0x00000004 /* link status of 10baseT */
-#define DC_TSTAT_AUTOPOLARITY	0x00000008
-#define DC_TSTAT_AUIACT		0x00000100 /* AUI activity */
-#define DC_TSTAT_10BTACT	0x00000200 /* 10baseT activity */
-#define DC_TSTAT_NSN		0x00000400 /* non-stable FLPs detected */
-#define DC_TSTAT_REMFAULT	0x00000800
-#define DC_TSTAT_ANEGSTAT	0x00007000
-#define DC_TSTAT_LP_CAN_NWAY	0x00008000 /* link partner supports NWAY */
-#define DC_TSTAT_LPCODEWORD	0xFFFF0000 /* link partner's code word */
-
-#define DC_ASTAT_DISABLE	0x00000000
-#define DC_ASTAT_TXDISABLE	0x00001000
-#define DC_ASTAT_ABDETECT	0x00002000
-#define DC_ASTAT_ACKDETECT	0x00003000
-#define DC_ASTAT_CMPACKDETECT	0x00004000
-#define DC_ASTAT_AUTONEGCMP	0x00005000
-#define DC_ASTAT_LINKCHECK	0x00006000
-
-/*
- * PHY reset register
- */
-#define DC_SIA_RESET		0x00000001
-#define DC_SIA_AUI		0x00000008 /* AUI or 10baseT */
-
-/*
- * 10baseT control register
- */
-#define DC_TCTL_ENCODER_ENB	0x00000001
-#define DC_TCTL_LOOPBACK	0x00000002
-#define DC_TCTL_DRIVER_ENB	0x00000004
-#define DC_TCTL_LNKPULSE_ENB	0x00000008
-#define DC_TCTL_HALFDUPLEX	0x00000040
-#define DC_TCTL_AUTONEGENBL	0x00000080
-#define DC_TCTL_RX_SQUELCH	0x00000100
-#define DC_TCTL_COLL_SQUELCH	0x00000200
-#define DC_TCTL_COLL_DETECT	0x00000400
-#define DC_TCTL_SQE_ENB		0x00000800
-#define DC_TCTL_LINKTEST	0x00001000
-#define DC_TCTL_AUTOPOLARITY	0x00002000
-#define DC_TCTL_SET_POL_PLUS	0x00004000
-#define DC_TCTL_AUTOSENSE	0x00008000	/* 10bt/AUI autosense */
-#define DC_TCTL_100BTXHALF	0x00010000
-#define DC_TCTL_100BTXFULL	0x00020000
-#define DC_TCTL_100BT4		0x00040000
-
-/*
- * Watchdog timer register
- */
-#define DC_WDOG_JABBERDIS	0x00000001
-#define DC_WDOG_HOSTUNJAB	0x00000002
-#define DC_WDOG_JABBERCLK	0x00000004
-#define DC_WDOG_RXWDOGDIS	0x00000010
-#define DC_WDOG_RXWDOGCLK	0x00000020
-#define DC_WDOG_MUSTBEZERO	0x00000100
-#define DC_WDOG_AUIBNC		0x00100000
-#define DC_WDOG_ACTIVITY	0x00200000
-#define DC_WDOG_RX_MATCH	0x00400000
-#define DC_WDOG_LINK		0x00800000
-#define DC_WDOG_CTLWREN		0x08000000
-
-/*
- * SIA and General Purpose Port register (X3201)
- */
-#define DC_SIAGP_RXMATCH	0x40000000
-#define DC_SIAGP_INT1		0x20000000
-#define DC_SIAGP_INT0		0x10000000
-#define DC_SIAGP_WRITE_EN	0x08000000
-#define DC_SIAGP_RXMATCH_EN	0x04000000
-#define DC_SIAGP_INT1_EN	0x02000000
-#define DC_SIAGP_INT0_EN	0x01000000
-#define DC_SIAGP_LED3		0x00800000
-#define DC_SIAGP_LED2		0x00400000
-#define DC_SIAGP_LED1		0x00200000
-#define DC_SIAGP_LED0		0x00100000
-#define DC_SIAGP_MD_GP3_OUTPUT	0x00080000
-#define DC_SIAGP_MD_GP2_OUTPUT	0x00040000
-#define DC_SIAGP_MD_GP1_OUTPUT	0x00020000
-#define DC_SIAGP_MD_GP0_OUTPUT	0x00010000
-
-/*
- * Size of a setup frame.
- */
-#define DC_SFRAME_LEN		192
-
-/*
- * 21x4x TX/RX list structure.
- */
-
-struct dc_desc {
-	u_int32_t		dc_status;
-	u_int32_t		dc_ctl;
-	u_int32_t		dc_ptr1;
-	u_int32_t		dc_ptr2;
-};
-
-#define dc_data		dc_ptr1
-#define dc_next		dc_ptr2
-
-#define DC_RXSTAT_FIFOOFLOW	0x00000001
-#define DC_RXSTAT_CRCERR	0x00000002
-#define DC_RXSTAT_DRIBBLE	0x00000004
-#define DC_RXSTAT_MIIERE	0x00000008
-#define DC_RXSTAT_WATCHDOG	0x00000010
-#define DC_RXSTAT_FRAMETYPE	0x00000020	/* 0 == IEEE 802.3 */
-#define DC_RXSTAT_COLLSEEN	0x00000040
-#define DC_RXSTAT_GIANT		0x00000080
-#define DC_RXSTAT_LASTFRAG	0x00000100
-#define DC_RXSTAT_FIRSTFRAG	0x00000200
-#define DC_RXSTAT_MULTICAST	0x00000400
-#define DC_RXSTAT_RUNT		0x00000800
-#define DC_RXSTAT_RXTYPE	0x00003000
-#define DC_RXSTAT_DE		0x00004000
-#define DC_RXSTAT_RXERR		0x00008000
-#define DC_RXSTAT_RXLEN		0x3FFF0000
-#define DC_RXSTAT_OWN		0x80000000
-
-#define DC_RXBYTES(x)		((x & DC_RXSTAT_RXLEN) >> 16)
-#define DC_RXSTAT (DC_RXSTAT_FIRSTFRAG|DC_RXSTAT_LASTFRAG|DC_RXSTAT_OWN)
-
-#define DC_RXCTL_BUFLEN1	0x00000FFF
-#define DC_RXCTL_BUFLEN2	0x00FFF000
-#define DC_RXCTL_RLINK		0x01000000
-#define DC_RXCTL_RLAST		0x02000000
-
-#define DC_TXSTAT_DEFER		0x00000001
-#define DC_TXSTAT_UNDERRUN	0x00000002
-#define DC_TXSTAT_LINKFAIL	0x00000003
-#define DC_TXSTAT_COLLCNT	0x00000078
-#define DC_TXSTAT_SQE		0x00000080
-#define DC_TXSTAT_EXCESSCOLL	0x00000100
-#define DC_TXSTAT_LATECOLL	0x00000200
-#define DC_TXSTAT_NOCARRIER	0x00000400
-#define DC_TXSTAT_CARRLOST	0x00000800
-#define DC_TXSTAT_JABTIMEO	0x00004000
-#define DC_TXSTAT_ERRSUM	0x00008000
-#define DC_TXSTAT_OWN		0x80000000
-
-#define DC_TXCTL_BUFLEN1	0x000007FF
-#define DC_TXCTL_BUFLEN2	0x003FF800
-#define DC_TXCTL_FILTTYPE0	0x00400000
-#define DC_TXCTL_PAD		0x00800000
-#define DC_TXCTL_TLINK		0x01000000
-#define DC_TXCTL_TLAST		0x02000000
-#define DC_TXCTL_NOCRC		0x04000000
-#define DC_TXCTL_SETUP		0x08000000
-#define DC_TXCTL_FILTTYPE1	0x10000000
-#define DC_TXCTL_FIRSTFRAG	0x20000000
-#define DC_TXCTL_LASTFRAG	0x40000000
-#define DC_TXCTL_FINT		0x80000000
-
-#define DC_FILTER_PERFECT	0x00000000
-#define DC_FILTER_HASHPERF	0x00400000
-#define DC_FILTER_INVERSE	0x10000000
-#define DC_FILTER_HASHONLY	0x10400000
-
-#define DC_MAXFRAGS		16
-#ifdef DEVICE_POLLING
-#define DC_RX_LIST_CNT		192
-#else
-#define DC_RX_LIST_CNT		64
-#endif
-#define DC_TX_LIST_CNT		256
-#define DC_MIN_FRAMELEN		60
-#define DC_RXLEN		1536
-
-#define DC_INC(x, y)		(x) = (x + 1) % y
-
-/* Macros to easily get the DMA address of a descriptor. */
-#define DC_RXDESC(sc, i)	(sc->dc_laddr +				\
-    (uintptr_t)(sc->dc_ldata->dc_rx_list + i) - (uintptr_t)sc->dc_ldata)
-#define DC_TXDESC(sc, i)	(sc->dc_laddr +				\
-    (uintptr_t)(sc->dc_ldata->dc_tx_list + i) - (uintptr_t)sc->dc_ldata)
-
-#if BYTE_ORDER == BIG_ENDIAN
-#define DC_SP_MAC(x)		((x) << 16)
-#else
-#define DC_SP_MAC(x)		(x)
-#endif
-
-struct dc_list_data {
-	struct dc_desc		dc_rx_list[DC_RX_LIST_CNT];
-	struct dc_desc		dc_tx_list[DC_TX_LIST_CNT];
-};
-
-struct dc_chain_data {
-	struct mbuf		*dc_rx_chain[DC_RX_LIST_CNT];
-	struct mbuf		*dc_tx_chain[DC_TX_LIST_CNT];
-	struct mbuf		*dc_tx_mapping;
-	bus_dmamap_t		dc_rx_map[DC_RX_LIST_CNT];
-	bus_dmamap_t		dc_tx_map[DC_TX_LIST_CNT];
-	u_int32_t		*dc_sbuf;
-	u_int8_t		dc_pad[DC_MIN_FRAMELEN];
-	int			dc_tx_err;
-	int			dc_tx_first;
-	int			dc_tx_prod;
-	int			dc_tx_cons;
-	int			dc_tx_cnt;
-	int			dc_rx_err;
-	int			dc_rx_cur;
-	int			dc_rx_prod;
-};
-
-struct dc_mediainfo {
-	int			dc_media;
-	u_int8_t		*dc_gp_ptr;
-	u_int8_t		dc_gp_len;
-	u_int8_t		*dc_reset_ptr;
-	u_int8_t		dc_reset_len;
-	struct dc_mediainfo	*dc_next;
-};
-
-
-struct dc_type {
-	u_int16_t		dc_vid;
-	u_int16_t		dc_did;
-	char			*dc_name;
-};
-
-struct dc_mii_frame {
-	u_int8_t		mii_stdelim;
-	u_int8_t		mii_opcode;
-	u_int8_t		mii_phyaddr;
-	u_int8_t		mii_regaddr;
-	u_int8_t		mii_turnaround;
-	u_int16_t		mii_data;
-};
-
-/*
- * MII constants
- */
-#define DC_MII_STARTDELIM	0x01
-#define DC_MII_READOP		0x02
-#define DC_MII_WRITEOP		0x01
-#define DC_MII_TURNAROUND	0x02
-
-
-/*
- * Registers specific to clone devices.
- * This mainly relates to RX filter programming: not all 21x4x clones
- * use the standard DEC filter programming mechanism.
- */
-
-/*
- * ADMtek specific registers and constants for the AL981 and AN985.
- * The AN985 doesn't use the magic PHY registers.
- */
-#define DC_AL_CR		0x88	/* command register */
-#define DC_AL_PAR0		0xA4	/* station address */
-#define DC_AL_PAR1		0xA8	/* station address */
-#define DC_AL_MAR0		0xAC	/* multicast hash filter */
-#define DC_AL_MAR1		0xB0	/* multicast hash filter */
-#define DC_AL_BMCR		0xB4	/* built in PHY control */
-#define DC_AL_BMSR		0xB8	/* built in PHY status */
-#define DC_AL_VENID		0xBC	/* built in PHY ID0 */
-#define DC_AL_DEVID		0xC0	/* built in PHY ID1 */
-#define DC_AL_ANAR		0xC4	/* built in PHY autoneg advert */
-#define DC_AL_LPAR		0xC8	/* bnilt in PHY link part. ability */
-#define DC_AL_ANER		0xCC	/* built in PHY autoneg expansion */
-
-#define DC_AL_CR_ATUR		0x00000001 /* automatic TX underrun recovery */
-#define DC_ADMTEK_PHYADDR	0x1
-#define DC_AL_EE_NODEADDR	4
-/* End of ADMtek specific registers */
-
-/*
- * ASIX specific registers.
- */
-#define DC_AX_FILTIDX		0x68    /* RX filter index */
-#define DC_AX_FILTDATA		0x70    /* RX filter data */
-
-/*
- * Special ASIX-specific bits in the ASIX NETCFG register (CSR6).
- */
-#define DC_AX_NETCFG_RX_BROAD	0x00000100 
-
-/*
- * RX Filter Index Register values
- */
-#define DC_AX_FILTIDX_PAR0	0x00000000
-#define DC_AX_FILTIDX_PAR1	0x00000001
-#define DC_AX_FILTIDX_MAR0	0x00000002
-#define DC_AX_FILTIDX_MAR1	0x00000003
-/* End of ASIX specific registers */
-
-/*
- * Macronix specific registers. The Macronix chips have a special
- * register for reading the NWAY status, which we don't use, plus
- * a magic packet register, which we need to tweak a bit per the
- * Macronix application notes.
- */
-#define DC_MX_MAGICPACKET	0x80
-#define DC_MX_NWAYSTAT		0xA0
-
-/*
- * Magic packet register
- */
-#define DC_MX_MPACK_DISABLE	0x00400000
-
-/*
- * NWAY status register.
- */
-#define DC_MX_NWAY_10BTHALF	0x08000000
-#define DC_MX_NWAY_10BTFULL	0x10000000
-#define DC_MX_NWAY_100BTHALF	0x20000000
-#define DC_MX_NWAY_100BTFULL	0x40000000
-#define DC_MX_NWAY_100BT4	0x80000000
-
-/*
- * These are magic values that must be written into CSR16
- * (DC_MX_MAGICPACKET) in order to put the chip into proper
- * operating mode. The magic numbers are documented in the
- * Macronix 98715 application notes.
- */
-#define DC_MX_MAGIC_98713	0x0F370000
-#define DC_MX_MAGIC_98713A	0x0B3C0000
-#define DC_MX_MAGIC_98715	0x0B3C0000
-#define DC_MX_MAGIC_98725	0x0B3C0000
-/* End of Macronix specific registers */
-
-/*
- * PNIC 82c168/82c169 specific registers.
- * The PNIC has its own special NWAY support, which doesn't work,
- * and shortcut ways of reading the EEPROM and MII bus.
- */
-#define DC_PN_GPIO		0x60	/* general purpose pins control */
-#define DC_PN_PWRUP_CFG		0x90	/* config register, set by EEPROM */
-#define DC_PN_SIOCTL		0x98	/* serial EEPROM control register */
-#define DC_PN_MII		0xA0	/* MII access register */
-#define DC_PN_NWAY		0xB8	/* Internal NWAY register */
-
-/* Serial I/O EEPROM register */
-#define DC_PN_SIOCTL_DATA	0x0000003F
-#define DC_PN_SIOCTL_OPCODE	0x00000300
-#define DC_PN_SIOCTL_BUSY	0x80000000
-
-#define DC_PN_EEOPCODE_ERASE	0x00000300
-#define DC_PN_EEOPCODE_READ	0x00000600
-#define DC_PN_EEOPCODE_WRITE	0x00000100
-
-/*
- * The first two general purpose pins control speed selection and
- * 100Mbps loopback on the 82c168 chip. The control bits should always
- * be set (to make the data pins outputs) and the speed selction and
- * loopback bits set accordingly when changing media. Physically, this
- * will set the state of a relay mounted on the card.
- */
-#define DC_PN_GPIO_DATA0	0x000000001
-#define DC_PN_GPIO_DATA1	0x000000002
-#define DC_PN_GPIO_DATA2	0x000000004
-#define DC_PN_GPIO_DATA3	0x000000008
-#define DC_PN_GPIO_CTL0		0x000000010
-#define DC_PN_GPIO_CTL1		0x000000020
-#define DC_PN_GPIO_CTL2		0x000000040
-#define DC_PN_GPIO_CTL3		0x000000080
-#define DC_PN_GPIO_SPEEDSEL	DC_PN_GPIO_DATA0/* 1 == 100Mbps, 0 == 10Mbps */
-#define DC_PN_GPIO_100TX_LOOP	DC_PN_GPIO_DATA1/* 1 == normal, 0 == loop */
-#define DC_PN_GPIO_BNC_ENB	DC_PN_GPIO_DATA2
-#define DC_PN_GPIO_100TX_LNK	DC_PN_GPIO_DATA3
-#define DC_PN_GPIO_SETBIT(sc, r)			\
-	DC_SETBIT(sc, DC_PN_GPIO, ((r) | (r << 4)))
-#define DC_PN_GPIO_CLRBIT(sc, r)			\
-	{						\
-		DC_SETBIT(sc, DC_PN_GPIO, ((r) << 4));	\
-		DC_CLRBIT(sc, DC_PN_GPIO, (r));		\
-	}
-	
-/* shortcut MII access register */
-#define DC_PN_MII_DATA		0x0000FFFF
-#define DC_PN_MII_RESERVER	0x00020000
-#define DC_PN_MII_REGADDR	0x007C0000
-#define DC_PN_MII_PHYADDR	0x0F800000
-#define DC_PN_MII_OPCODE	0x30000000
-#define DC_PN_MII_BUSY		0x80000000
-
-#define DC_PN_MIIOPCODE_READ	0x60020000
-#define DC_PN_MIIOPCODE_WRITE	0x50020000
-
-/* Internal NWAY bits */
-#define DC_PN_NWAY_RESET	0x00000001	/* reset */
-#define DC_PN_NWAY_PDOWN	0x00000002	/* power down */
-#define DC_PN_NWAY_BYPASS	0x00000004	/* bypass */
-#define DC_PN_NWAY_AUILOWCUR	0x00000008	/* AUI low current */
-#define DC_PN_NWAY_TPEXTEND	0x00000010	/* low squelch voltage */
-#define DC_PN_NWAY_POLARITY	0x00000020	/* 0 == on, 1 == off */
-#define DC_PN_NWAY_TP		0x00000040	/* 1 == tp, 0 == AUI */
-#define DC_PN_NWAY_AUIVOLT	0x00000080	/* 1 == full, 0 == half */
-#define DC_PN_NWAY_DUPLEX	0x00000100	/* LED, 1 == full, 0 == half */
-#define DC_PN_NWAY_LINKTEST	0x00000200	/* 0 == on, 1 == off */
-#define DC_PN_NWAY_AUTODETECT	0x00000400	/* 1 == off, 0 == on */
-#define DC_PN_NWAY_SPEEDSEL	0x00000800	/* LED, 0 = 10, 1 == 100 */
-#define DC_PN_NWAY_NWAY_ENB	0x00001000	/* 0 == off, 1 == on */
-#define DC_PN_NWAY_CAP10HDX	0x00002000
-#define DC_PN_NWAY_CAP10FDX	0x00004000
-#define DC_PN_NWAY_CAP100FDX	0x00008000
-#define DC_PN_NWAY_CAP100HDX	0x00010000
-#define DC_PN_NWAY_CAP100T4	0x00020000
-#define DC_PN_NWAY_ANEGRESTART	0x02000000	/* resets when aneg done */
-#define DC_PN_NWAY_REMFAULT	0x04000000
-#define DC_PN_NWAY_LPAR10HDX	0x08000000
-#define DC_PN_NWAY_LPAR10FDX	0x10000000
-#define DC_PN_NWAY_LPAR100FDX	0x20000000
-#define DC_PN_NWAY_LPAR100HDX	0x40000000
-#define DC_PN_NWAY_LPAR100T4	0x80000000
-
-/* End of PNIC specific registers */
-
-/*
- * CONEXANT specific registers.
- */
-
-#define DC_CONEXANT_PHYADDR	0x1
-#define DC_CONEXANT_EE_NODEADDR	0x19A
-
-/* End of CONEXANT specific registers */
-
-
-struct dc_softc {
-	struct ifnet		*dc_ifp;	/* interface info */
-	bus_space_handle_t	dc_bhandle;	/* bus space handle */
-	bus_space_tag_t		dc_btag;	/* bus space tag */
-	bus_dma_tag_t		dc_ltag;	/* tag for descriptor ring */
-	bus_dmamap_t		dc_lmap;	/* map for descriptor ring */
-	u_int32_t		dc_laddr;	/* DMA address of dc_ldata */
-	bus_dma_tag_t		dc_mtag;	/* tag for mbufs */
-	bus_dmamap_t		dc_sparemap;
-	bus_dma_tag_t		dc_stag;	/* tag for the setup frame */
-	bus_dmamap_t		dc_smap;	/* map for the setup frame */
-	u_int32_t		dc_saddr;	/* DMA address of setup frame */
-	void			*dc_intrhand;
-	struct resource		*dc_irq;
-	struct resource		*dc_res;
-	struct dc_type		*dc_info;	/* adapter info */
-	device_t		dc_miibus;
-	u_int8_t		dc_type;
-	u_int8_t		dc_pmode;
-	u_int8_t		dc_link;
-	u_int8_t		dc_cachesize;
-	int			dc_romwidth;
-	int			dc_pnic_rx_bug_save;
-	unsigned char		*dc_pnic_rx_buf;
-	int			dc_if_flags;
-	int			dc_if_media;
-	u_int32_t		dc_flags;
-	u_int32_t		dc_txthresh;
-	u_int8_t		*dc_srom;
-	struct dc_mediainfo	*dc_mi;
-	struct dc_list_data	*dc_ldata;
-	struct dc_chain_data	dc_cdata;
-	struct callout		dc_stat_ch;
-#ifdef SRM_MEDIA
-	int			dc_srm_media;
-#endif
-	struct mtx		dc_mtx;
-#ifdef DEVICE_POLLING
-	int			rxcycles;	/* ... when polling */
-#endif
-	int			suspended;	/* 0 = normal  1 = suspended */
-};
-
-
-#define	DC_LOCK(_sc)		mtx_lock(&(_sc)->dc_mtx)
-#define	DC_UNLOCK(_sc)		mtx_unlock(&(_sc)->dc_mtx)
-#define	DC_LOCK_ASSERT(_sc)	mtx_assert(&(_sc)->dc_mtx, MA_OWNED)
-
-#define DC_TX_POLL		0x00000001
-#define DC_TX_COALESCE		0x00000002
-#define DC_TX_ADMTEK_WAR	0x00000004
-#define DC_TX_USE_TX_INTR	0x00000008
-#define DC_RX_FILTER_TULIP	0x00000010
-#define DC_TX_INTR_FIRSTFRAG	0x00000020
-#define DC_PNIC_RX_BUG_WAR	0x00000040
-#define DC_TX_FIXED_RING	0x00000080
-#define DC_TX_STORENFWD		0x00000100
-#define DC_REDUCED_MII_POLL	0x00000200
-#define DC_TX_INTR_ALWAYS	0x00000400
-#define DC_21143_NWAY		0x00000800
-#define DC_128BIT_HASH		0x00001000
-#define DC_64BIT_HASH		0x00002000
-#define DC_TULIP_LEDS		0x00004000
-#define DC_TX_ONE		0x00008000
-#define DC_TX_ALIGN		0x00010000	/* align mbuf on tx */
-
-/*
- * register space access macros
- */
-#define CSR_WRITE_4(sc, reg, val)	\
-	bus_space_write_4(sc->dc_btag, sc->dc_bhandle, reg, val)
-
-#define CSR_READ_4(sc, reg)		\
-	bus_space_read_4(sc->dc_btag, sc->dc_bhandle, reg)
-
-#define DC_TIMEOUT		1000
-#define ETHER_ALIGN		2
-
-/*
- * General constants that are fun to know.
- */
-
-/*
- * DEC PCI vendor ID
- */
-#define DC_VENDORID_DEC		0x1011
-
-/*
- * DEC/Intel 21143 PCI device ID
- */
-#define DC_DEVICEID_21143	0x0019
-
-/*
- * Macronix PCI vendor ID
- */
-#define	DC_VENDORID_MX		0x10D9
-
-/*
- * Macronix PMAC device IDs.
- */
-#define DC_DEVICEID_98713	0x0512
-#define DC_DEVICEID_987x5	0x0531
-#define DC_DEVICEID_98727	0x0532
-#define DC_DEVICEID_98732	0x0532
-
-/* Macronix PCI revision codes. */
-#define DC_REVISION_98713	0x00
-#define DC_REVISION_98713A	0x10
-#define DC_REVISION_98715	0x20
-#define DC_REVISION_98715AEC_C	0x25
-#define DC_REVISION_98725	0x30
-
-/*
- * Compex PCI vendor ID.
- */
-#define DC_VENDORID_CP		0x11F6
-
-/*
- * Compex PMAC PCI device IDs.
- */
-#define DC_DEVICEID_98713_CP	0x9881
-
-/*
- * Lite-On PNIC PCI vendor ID
- */
-#define DC_VENDORID_LO		0x11AD
-
-/*
- * 82c168/82c169 PNIC device IDs. Both chips have the same device
- * ID but different revisions. Revision 0x10 is the 82c168, and
- * 0x20 is the 82c169.
- */
-#define DC_DEVICEID_82C168	0x0002
-
-#define DC_REVISION_82C168	0x10
-#define DC_REVISION_82C169	0x20
-
-/* 
- * Lite-On PNIC II device ID. Note: this is actually a Macronix 98715A
- * with wake on lan/magic packet support.
- */
-#define DC_DEVICEID_82C115	0xc115
-
-/*
- * Davicom vendor ID.
- */
-#define DC_VENDORID_DAVICOM	0x1282
-
-/*
- * Davicom device IDs.
- */
-#define DC_DEVICEID_DM9009	0x9009
-#define DC_DEVICEID_DM9100	0x9100
-#define DC_DEVICEID_DM9102	0x9102
-
-/*
- * The DM9102A has the same PCI device ID as the DM9102,
- * but a higher revision code.
- */
-#define DC_REVISION_DM9102	0x10
-#define DC_REVISION_DM9102A	0x30
-
-/*
- * ADMtek vendor ID.
- */
-#define DC_VENDORID_ADMTEK	0x1317
-
-/*
- * ADMtek device IDs.
- */
-#define DC_DEVICEID_AL981	0x0981
-#define DC_DEVICEID_AN985	0x0985
-#define DC_DEVICEID_FA511	0x1985
-#define DC_DEVICEID_ADM9511	0x9511
-#define DC_DEVICEID_ADM9513	0x9513
-
-/*
- * 3COM PCI vendor ID
- */
-#define DC_VENDORID_3COM	0x10b7
-
-/*
- * 3COM OfficeConnect 10/100B (3CSOHO100B-TX)
- */
-#define DC_DEVICEID_3CSOHOB	0x9300
-
-/*
- * ASIX vendor ID.
- */
-#define DC_VENDORID_ASIX	0x125B
-
-/*
- * ASIX device IDs.
- */
-#define DC_DEVICEID_AX88140A	0x1400
-
-/*
- * The ASIX AX88140 and ASIX AX88141 have the same vendor and
- * device IDs but different revision values.
- */
-#define DC_REVISION_88140	0x00
-#define DC_REVISION_88141	0x10
-
-/*
- * Accton vendor ID.
- */
-#define DC_VENDORID_ACCTON	0x1113
-
-/*
- * Accton device IDs.
- */
-#define DC_DEVICEID_EN1217	0x1217
-#define	DC_DEVICEID_EN2242	0x1216
-
-/*
- * Xircom vendor ID
- */
-#define	DC_VENDORID_XIRCOM	0x115d
-
-/*
- * Xircom device IDs.
- */
-#define	DC_DEVICEID_X3201	0x0003
-
-/*
- * D-Link vendor ID
- */
-#define	DC_VENDORID_DLINK	0x1186
-
-/*
- * D-Link device IDs.
- */
-#define	DC_DEVICEID_DRP32TXD	0x1561
-
-/*
- * Abocom vendor ID
- */
-#define DC_VENDORID_ABOCOM	0x13d1
-
-/*
- * Abocom device IDs.
- */
-#define DC_DEVICEID_FE2500	0xAB02
-#define DC_DEVICEID_FE2500MX	0xab08
-
-/*
- * Conexant vendor ID.
- */
-#define DC_VENDORID_CONEXANT	0x14f1
-
-/*
- * Conexant device IDs.
- */
-#define DC_DEVICEID_RS7112	0x1803
-
-/*
- * Planex vendor ID
- */
-#define DC_VENDORID_PLANEX     0x14ea
-
-/*
- * Planex device IDs.
- */
-#define DC_DEVICEID_FNW3602T   0xab08
-
-/*
- * Not sure who this vendor should be, so we'll go with HAWKING until
- * I can locate the right one.
- */
-#define DC_VENDORID_HAWKING	0x17b3
-
-/*
- * Sure looks like an abocom device ID, but it found on my hawking PN672TX
- * card.  Use that for now, and upgrade later.
- */
-#define DC_DEVICEID_HAWKING_PN672TX 0xab08
-
-/*
- * Microsoft device ID.
- */
-#define DC_VENDORID_MICROSOFT		0x1414
-
-/*
- * Supported Microsoft PCI and cardbus NICs. These are really
- * ADMtek parts in disguise.
- */
-
-#define DC_DEVICEID_MSMN120	0x0001
-#define DC_DEVICEID_MSMN130	0x0002
-#define DC_DEVICEID_MSMN130_FAKE	0xFFF2
-
-/*
- * PCI low memory base and low I/O base register, and
- * other PCI registers.
- */
-
-#define DC_PCI_CFID		0x00	/* Id */
-#define DC_PCI_CFCS		0x04	/* Command and status */
-#define DC_PCI_CFRV		0x08	/* Revision */
-#define DC_PCI_CFLT		0x0C	/* Latency timer */
-#define DC_PCI_CFBIO		0x10	/* Base I/O address */
-#define DC_PCI_CFBMA		0x14	/* Base memory address */
-#define DC_PCI_CCIS		0x28	/* Card info struct */
-#define DC_PCI_CSID		0x2C	/* Subsystem ID */
-#define DC_PCI_CBER		0x30	/* Expansion ROM base address */
-#define DC_PCI_CCAP		0x34	/* Caps pointer - PD/TD chip only */
-#define DC_PCI_CFIT		0x3C	/* Interrupt */
-#define DC_PCI_CFDD		0x40	/* Device and driver area */
-#define DC_PCI_CWUA0		0x44	/* Wake-Up LAN addr 0 */
-#define DC_PCI_CWUA1		0x48	/* Wake-Up LAN addr 1 */
-#define DC_PCI_SOP0		0x4C	/* SecureON passwd 0 */
-#define DC_PCI_SOP1		0x50	/* SecureON passwd 1 */
-#define DC_PCI_CWUC		0x54	/* Configuration Wake-Up cmd */
-#define DC_PCI_CCID		0xDC	/* Capability ID - PD/TD only */
-#define DC_PCI_CPMC		0xE0	/* Pwrmgmt ctl & sts - PD/TD only */
-
-/* PCI ID register */
-#define DC_CFID_VENDOR		0x0000FFFF
-#define DC_CFID_DEVICE		0xFFFF0000
-
-/* PCI command/status register */
-#define DC_CFCS_IOSPACE		0x00000001 /* I/O space enable */
-#define DC_CFCS_MEMSPACE	0x00000002 /* memory space enable */
-#define DC_CFCS_BUSMASTER	0x00000004 /* bus master enable */
-#define DC_CFCS_MWI_ENB		0x00000010 /* mem write and inval enable */
-#define DC_CFCS_PARITYERR_ENB	0x00000040 /* parity error enable */
-#define DC_CFCS_SYSERR_ENB	0x00000100 /* system error enable */
-#define DC_CFCS_NEWCAPS		0x00100000 /* new capabilities */
-#define DC_CFCS_FAST_B2B	0x00800000 /* fast back-to-back capable */
-#define DC_CFCS_DATAPARITY	0x01000000 /* Parity error report */
-#define DC_CFCS_DEVSELTIM	0x06000000 /* devsel timing */
-#define DC_CFCS_TGTABRT		0x10000000 /* received target abort */
-#define DC_CFCS_MASTERABRT	0x20000000 /* received master abort */
-#define DC_CFCS_SYSERR		0x40000000 /* asserted system error */
-#define DC_CFCS_PARITYERR	0x80000000 /* asserted parity error */
-
-/* PCI revision register */
-#define DC_CFRV_STEPPING	0x0000000F
-#define DC_CFRV_REVISION	0x000000F0
-#define DC_CFRV_SUBCLASS	0x00FF0000
-#define DC_CFRV_BASECLASS	0xFF000000
-
-#define DC_21143_PB_REV		0x00000030
-#define DC_21143_TB_REV		0x00000030
-#define DC_21143_PC_REV		0x00000030
-#define DC_21143_TC_REV		0x00000030
-#define DC_21143_PD_REV		0x00000041
-#define DC_21143_TD_REV		0x00000041
-
-/* PCI latency timer register */
-#define DC_CFLT_CACHELINESIZE	0x000000FF
-#define DC_CFLT_LATENCYTIMER	0x0000FF00
-
-/* PCI subsystem ID register */
-#define DC_CSID_VENDOR		0x0000FFFF
-#define DC_CSID_DEVICE		0xFFFF0000
-
-/* PCI cababilities pointer */
-#define DC_CCAP_OFFSET		0x000000FF
-
-/* PCI interrupt config register */
-#define DC_CFIT_INTLINE		0x000000FF
-#define DC_CFIT_INTPIN		0x0000FF00
-#define DC_CFIT_MIN_GNT		0x00FF0000
-#define DC_CFIT_MAX_LAT		0xFF000000
-
-/* PCI capability register */
-#define DC_CCID_CAPID		0x000000FF
-#define DC_CCID_NEXTPTR		0x0000FF00
-#define DC_CCID_PM_VERS		0x00070000
-#define DC_CCID_PME_CLK		0x00080000
-#define DC_CCID_DVSPEC_INT	0x00200000
-#define DC_CCID_STATE_D1	0x02000000
-#define DC_CCID_STATE_D2	0x04000000
-#define DC_CCID_PME_D0		0x08000000
-#define DC_CCID_PME_D1		0x10000000
-#define DC_CCID_PME_D2		0x20000000
-#define DC_CCID_PME_D3HOT	0x40000000
-#define DC_CCID_PME_D3COLD	0x80000000
-
-/* PCI power management control/status register */
-#define DC_CPMC_STATE		0x00000003
-#define DC_CPMC_PME_ENB		0x00000100
-#define DC_CPMC_PME_STS		0x00008000
-
-#define DC_PSTATE_D0		0x0
-#define DC_PSTATE_D1		0x1
-#define DC_PSTATE_D2		0x2
-#define DC_PSTATE_D3		0x3
-
-/* Device specific region */
-/* Configuration and driver area */
-#define DC_CFDD_DRVUSE		0x0000FFFF
-#define DC_CFDD_SNOOZE_MODE	0x40000000
-#define DC_CFDD_SLEEP_MODE	0x80000000
-
-/* Configuration wake-up command register */
-#define DC_CWUC_MUST_BE_ZERO	0x00000001
-#define DC_CWUC_SECUREON_ENB	0x00000002
-#define DC_CWUC_FORCE_WUL	0x00000004
-#define DC_CWUC_BNC_ABILITY	0x00000008
-#define DC_CWUC_AUI_ABILITY	0x00000010
-#define DC_CWUC_TP10_ABILITY	0x00000020
-#define DC_CWUC_MII_ABILITY	0x00000040
-#define DC_CWUC_SYM_ABILITY	0x00000080
-#define DC_CWUC_LOCK		0x00000100
-
-/*
- * SROM nonsense.
- */
-
-#define DC_IB_CTLRCNT		0x13
-#define DC_IB_LEAF0_CNUM	0x1A
-#define DC_IB_LEAF0_OFFSET	0x1B
-
-struct dc_info_leaf {
-	u_int16_t		dc_conntype;
-	u_int8_t		dc_blkcnt;
-	u_int8_t		dc_rsvd;
-	u_int16_t		dc_infoblk;
-};
-
-#define DC_CTYPE_10BT			0x0000
-#define DC_CTYPE_10BT_NWAY		0x0100
-#define DC_CTYPE_10BT_FDX		0x0204
-#define DC_CTYPE_10B2			0x0001
-#define DC_CTYPE_10B5			0x0002
-#define DC_CTYPE_100BT			0x0003
-#define DC_CTYPE_100BT_FDX		0x0205
-#define DC_CTYPE_100T4			0x0006
-#define DC_CTYPE_100FX			0x0007
-#define DC_CTYPE_100FX_FDX		0x0208
-#define DC_CTYPE_MII_10BT		0x0009
-#define DC_CTYPE_MII_10BT_FDX		0x020A
-#define DC_CTYPE_MII_100BT		0x000D
-#define DC_CTYPE_MII_100BT_FDX		0x020E
-#define DC_CTYPE_MII_100T4		0x000F
-#define DC_CTYPE_MII_100FX		0x0010
-#define DC_CTYPE_MII_100FX_FDX		0x0211
-#define DC_CTYPE_DYN_PUP_AUTOSENSE	0x0800
-#define DC_CTYPE_PUP_AUTOSENSE		0x8800
-#define DC_CTYPE_NOMEDIA		0xFFFF
-
-#define DC_EBLOCK_SIA			0x0002
-#define DC_EBLOCK_MII			0x0003
-#define DC_EBLOCK_SYM			0x0004
-#define DC_EBLOCK_RESET			0x0005
-#define DC_EBLOCK_PHY_SHUTDOWN		0x0006
-
-struct dc_leaf_hdr {
-	u_int16_t		dc_mtype;
-	u_int8_t		dc_mcnt;
-	u_int8_t		dc_rsvd;
-};
-
-struct dc_eblock_hdr {
-	u_int8_t		dc_len;
-	u_int8_t		dc_type;
-};
-
-struct dc_eblock_sia {
-	struct dc_eblock_hdr	dc_sia_hdr;
-	u_int8_t		dc_sia_code;
-	union {
-		struct dc_sia_ext { /* if (dc_sia_code & DC_SIA_CODE_EXT) */
-			u_int8_t dc_sia_mediaspec[6]; /* CSR13, CSR14, CSR15 */
-			u_int8_t dc_sia_gpio_ctl[2];
-			u_int8_t dc_sia_gpio_dat[2];
-		} dc_sia_ext;
-		struct dc_sia_noext { 
-			u_int8_t dc_sia_gpio_ctl[2];
-			u_int8_t dc_sia_gpio_dat[2];
-		} dc_sia_noext;
-	} dc_un;
-};
-
-#define DC_SIA_CODE_10BT	0x00
-#define DC_SIA_CODE_10B2	0x01
-#define DC_SIA_CODE_10B5	0x02
-#define DC_SIA_CODE_10BT_FDX	0x04
-#define DC_SIA_CODE_EXT		0x40
-
-/*
- * Note that the first word in the gpr and reset
- * sequences is always a control word.
- */
-struct dc_eblock_mii {
-	struct dc_eblock_hdr	dc_mii_hdr;
-	u_int8_t		dc_mii_phynum;
-	u_int8_t		dc_gpr_len;
-/*	u_int16_t		dc_gpr_dat[n]; */
-/*	u_int8_t		dc_reset_len; */
-/*	u_int16_t		dc_reset_dat[n]; */
-/* There are other fields after these, but we don't
- * care about them since they can be determined by looking
- * at the PHY.
- */
-};
-
-struct dc_eblock_sym {
-	struct dc_eblock_hdr	dc_sym_hdr;
-	u_int8_t		dc_sym_code;
-	u_int8_t		dc_sym_gpio_ctl[2];
-	u_int8_t		dc_sym_gpio_dat[2];
-	u_int8_t		dc_sym_cmd[2];
-};
-
-#define DC_SYM_CODE_100BT	0x03
-#define DC_SYM_CODE_100BT_FDX	0x05
-#define DC_SYM_CODE_100T4	0x06
-#define DC_SYM_CODE_100FX	0x07
-#define DC_SYM_CODE_100FX_FDX	0x08
-
-struct dc_eblock_reset {
-	struct dc_eblock_hdr	dc_reset_hdr;
-	u_int8_t		dc_reset_len;
-/*	u_int16_t		dc_reset_dat[n]; */
-};
Index: if_xlreg.h
===================================================================
RCS file: /home/cvs/src/sys/pci/if_xlreg.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/pci/if_xlreg.h -L sys/pci/if_xlreg.h -u -r1.1.1.1 -r1.2
--- sys/pci/if_xlreg.h
+++ sys/pci/if_xlreg.h
@@ -29,7 +29,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/pci/if_xlreg.h,v 1.55.2.1 2005/08/26 14:46:22 jhb Exp $
+ * $FreeBSD: src/sys/pci/if_xlreg.h,v 1.59 2006/12/06 02:18:41 marius Exp $
  */
 
 #define XL_EE_READ	0x0080	/* read, 5 bit address */
@@ -581,6 +581,7 @@
 
 struct xl_softc {
 	struct ifnet		*xl_ifp;	/* interface info */
+	device_t		xl_dev;		/* device info */
 	struct ifmedia		ifmedia;	/* media info */
 	bus_space_handle_t	xl_bhandle;
 	bus_space_tag_t		xl_btag;
@@ -602,6 +603,7 @@
 	struct xl_list_data	xl_ldata;
 	struct xl_chain_data	xl_cdata;
 	struct callout		xl_stat_callout;
+	int			xl_wdog_timer;
 	int			xl_flags;
 	struct resource		*xl_fres;
 	bus_space_handle_t	xl_fhandle;
--- sys/pci/if_de.c
+++ /dev/null
@@ -1,5047 +0,0 @@
-/*	$NetBSD: if_de.c,v 1.86 1999/06/01 19:17:59 thorpej Exp $	*/
-/*-
- * Copyright (c) 1994-1997 Matt Thomas (matt at 3am-software.com)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Id: if_de.c,v 1.94 1997/07/03 16:55:07 thomas Exp
- */
-
-/*
- * DEC 21040 PCI Ethernet Controller
- *
- * Written by Matt Thomas
- * BPF support code stolen directly from if_ec.c
- *
- *   This driver supports the DEC DE435 or any other PCI
- *   board which support 21040, 21041, or 21140 (mostly).
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/if_de.c,v 1.162.2.6 2005/11/28 19:43:57 jhb Exp $");
-
-#define	TULIP_HDR_DATA
-
-#include "opt_ddb.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/endian.h>
-#include <sys/ktr.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/sockio.h>
-#include <sys/malloc.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-#include <sys/eventhandler.h>
-#include <machine/bus.h>
-#include <machine/bus_dma.h>
-#include <machine/resource.h>
-#include <sys/bus.h>
-#include <sys/rman.h>
-
-#include <net/if.h>
-#include <net/if_arp.h>
-#include <net/ethernet.h>
-#include <net/if_media.h>
-#include <net/if_types.h>
-#include <net/if_dl.h>
-
-#include <net/bpf.h>
-
-#ifdef INET
-#include <netinet/in.h>
-#include <netinet/if_ether.h>
-#endif
-
-#include <vm/vm.h>
-
-#include <net/if_var.h>
-#include <vm/pmap.h>
-#include <dev/pci/pcivar.h>
-#include <dev/pci/pcireg.h>
-#include <pci/dc21040reg.h>
-
-#ifdef DDB
-#include <ddb/ddb.h>
-#endif
-
-/*
- * Intel CPUs should use I/O mapped access.
- */
-#if defined(__i386__)
-#define	TULIP_IOMAPPED
-#endif
-
-#if 0
-/* This enables KTR traces at KTR_DEV. */
-#define	KTR_TULIP	KTR_DEV
-#else
-#define	KTR_TULIP	0
-#endif
-
-#if 0
-/*
- * This turns on all sort of debugging stuff and make the
- * driver much larger.
- */
-#define TULIP_DEBUG
-#endif
-
-#if 0
-#define	TULIP_PERFSTATS
-#endif
-
-#define	TULIP_HZ	10
-
-#include <pci/if_devar.h>
-
-#define	SYNC_NONE	0
-#define	SYNC_RX		1
-#define	SYNC_TX		2
-
-/*
- * This module supports
- *	the DEC 21040 PCI Ethernet Controller.
- *	the DEC 21041 PCI Ethernet Controller.
- *	the DEC 21140 PCI Fast Ethernet Controller.
- */
-static void	tulip_addr_filter(tulip_softc_t * const sc);
-static int	tulip_ifmedia_change(struct ifnet * const ifp);
-static void	tulip_ifmedia_status(struct ifnet * const ifp,
-		    struct ifmediareq *req);
-static void	tulip_init(void *);
-static void	tulip_init_locked(tulip_softc_t * const sc);
-static void	tulip_intr_shared(void *arg);
-static void	tulip_intr_normal(void *arg);
-static void	tulip_mii_autonegotiate(tulip_softc_t * const sc,
-		    const unsigned phyaddr);
-static int	tulip_mii_map_abilities(tulip_softc_t * const sc,
-		    unsigned abilities);
-static tulip_media_t
-		tulip_mii_phy_readspecific(tulip_softc_t * const sc);
-static unsigned	tulip_mii_readreg(tulip_softc_t * const sc, unsigned devaddr,
-		    unsigned regno);
-static void	tulip_mii_writereg(tulip_softc_t * const sc, unsigned devaddr,
-		    unsigned regno, unsigned data);
-static void	tulip_reset(tulip_softc_t * const sc);
-static void	tulip_rx_intr(tulip_softc_t * const sc);
-static int	tulip_srom_decode(tulip_softc_t * const sc);
-static void	tulip_start(struct ifnet *ifp);
-static void	tulip_start_locked(tulip_softc_t * const sc);
-static struct mbuf *
-		tulip_txput(tulip_softc_t * const sc, struct mbuf *m);
-static void	tulip_txput_setup(tulip_softc_t * const sc);
-struct mbuf *	tulip_dequeue_mbuf(tulip_ringinfo_t *ri, tulip_descinfo_t *di,
-		    int sync);
-static void	tulip_dma_map_addr(void *, bus_dma_segment_t *, int, int);
-static void	tulip_dma_map_rxbuf(void *, bus_dma_segment_t *, int,
-		    bus_size_t, int);
-
-static void
-tulip_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nseg, int error)
-{
-    u_int32_t *paddr;
-
-    if (error)
-	return;
-
-    paddr = arg;
-    *paddr = segs->ds_addr;
-}
-
-static void
-tulip_dma_map_rxbuf(void *arg, bus_dma_segment_t *segs, int nseg,
-    bus_size_t mapsize, int error)
-{
-    tulip_desc_t *desc;
-
-    if (error)
-	return;
-
-    desc = arg;
-    KASSERT(nseg == 1, ("too many DMA segments"));
-    KASSERT(segs[0].ds_len >= TULIP_RX_BUFLEN, ("receive buffer too small"));
-
-    desc->d_addr1 = segs[0].ds_addr;
-    desc->d_length1 = TULIP_RX_BUFLEN;
-#ifdef not_needed
-    /* These should already always be zero. */
-    desc->d_addr2 = 0;
-    desc->d_length2 = 0;
-#endif
-}
-
-struct mbuf *
-tulip_dequeue_mbuf(tulip_ringinfo_t *ri, tulip_descinfo_t *di, int sync)
-{
-    struct mbuf *m;
-
-    m = di->di_mbuf;
-    if (m != NULL) {
-	switch (sync) {
-	case SYNC_NONE:
-	    break;
-	case SYNC_RX:
-	    TULIP_RXMAP_POSTSYNC(ri, di);
-	    break;
-	case SYNC_TX:
-	    TULIP_TXMAP_POSTSYNC(ri, di);
-	    break;
-	default:
-	    panic("bad sync flag: %d", sync);
-	}
-	bus_dmamap_unload(ri->ri_data_tag, *di->di_map);
-	di->di_mbuf = NULL;
-    }
-    return (m);
-}
-
-static void
-tulip_timeout_callback(void *arg)
-{
-    tulip_softc_t * const sc = arg;
-
-    TULIP_PERFSTART(timeout)
-    TULIP_LOCK_ASSERT(sc);
-
-    sc->tulip_flags &= ~TULIP_TIMEOUTPENDING;
-    sc->tulip_probe_timeout -= 1000 / TULIP_HZ;
-    (sc->tulip_boardsw->bd_media_poll)(sc, TULIP_MEDIAPOLL_TIMER);
-
-    TULIP_PERFEND(timeout);
-}
-
-static void
-tulip_timeout(tulip_softc_t * const sc)
-{
-    TULIP_LOCK_ASSERT(sc);
-    if (sc->tulip_flags & TULIP_TIMEOUTPENDING)
-	return;
-    sc->tulip_flags |= TULIP_TIMEOUTPENDING;
-    callout_reset(&sc->tulip_callout, (hz + TULIP_HZ / 2) / TULIP_HZ,
-	tulip_timeout_callback, sc);
-}
-
-static int
-tulip_txprobe(tulip_softc_t * const sc)
-{
-    struct mbuf *m;
-    /*
-     * Before we are sure this is the right media we need
-     * to send a small packet to make sure there's carrier.
-     * Strangely, BNC and AUI will "see" receive data if
-     * either is connected so the transmit is the only way
-     * to verify the connectivity.
-     */
-    TULIP_LOCK_ASSERT(sc);
-    MGETHDR(m, M_DONTWAIT, MT_DATA);
-    if (m == NULL)
-	return 0;
-    /*
-     * Construct a LLC TEST message which will point to ourselves.
-     */
-    bcopy(IFP2ENADDR(sc->tulip_ifp), mtod(m, struct ether_header *)->ether_dhost, 6);
-    bcopy(IFP2ENADDR(sc->tulip_ifp), mtod(m, struct ether_header *)->ether_shost, 6);
-    mtod(m, struct ether_header *)->ether_type = htons(3);
-    mtod(m, unsigned char *)[14] = 0;
-    mtod(m, unsigned char *)[15] = 0;
-    mtod(m, unsigned char *)[16] = 0xE3;	/* LLC Class1 TEST (no poll) */
-    m->m_len = m->m_pkthdr.len = sizeof(struct ether_header) + 3;
-    /*
-     * send it!
-     */
-    sc->tulip_cmdmode |= TULIP_CMD_TXRUN;
-    sc->tulip_intrmask |= TULIP_STS_TXINTR;
-    sc->tulip_flags |= TULIP_TXPROBE_ACTIVE;
-    TULIP_CSR_WRITE(sc, csr_command, sc->tulip_cmdmode);
-    TULIP_CSR_WRITE(sc, csr_intr, sc->tulip_intrmask);
-    if ((m = tulip_txput(sc, m)) != NULL)
-	m_freem(m);
-    sc->tulip_probe.probe_txprobes++;
-    return 1;
-}
-
-static void
-tulip_media_set(tulip_softc_t * const sc, tulip_media_t media)
-{
-    const tulip_media_info_t *mi = sc->tulip_mediums[media];
-
-    TULIP_LOCK_ASSERT(sc);
-    if (mi == NULL)
-	return;
-
-    /*
-     * If we are switching media, make sure we don't think there's
-     * any stale RX activity
-     */
-    sc->tulip_flags &= ~TULIP_RXACT;
-    if (mi->mi_type == TULIP_MEDIAINFO_SIA) {
-	TULIP_CSR_WRITE(sc, csr_sia_connectivity, TULIP_SIACONN_RESET);
-	TULIP_CSR_WRITE(sc, csr_sia_tx_rx,        mi->mi_sia_tx_rx);
-	if (sc->tulip_features & TULIP_HAVE_SIAGP) {
-	    TULIP_CSR_WRITE(sc, csr_sia_general,  mi->mi_sia_gp_control|mi->mi_sia_general);
-	    DELAY(50);
-	    TULIP_CSR_WRITE(sc, csr_sia_general,  mi->mi_sia_gp_data|mi->mi_sia_general);
-	} else {
-	    TULIP_CSR_WRITE(sc, csr_sia_general,  mi->mi_sia_general);
-	}
-	TULIP_CSR_WRITE(sc, csr_sia_connectivity, mi->mi_sia_connectivity);
-    } else if (mi->mi_type == TULIP_MEDIAINFO_GPR) {
-#define	TULIP_GPR_CMDBITS	(TULIP_CMD_PORTSELECT|TULIP_CMD_PCSFUNCTION|TULIP_CMD_SCRAMBLER|TULIP_CMD_TXTHRSHLDCTL)
-	/*
-	 * If the cmdmode bits don't match the currently operating mode,
-	 * set the cmdmode appropriately and reset the chip.
-	 */
-	if (((mi->mi_cmdmode ^ TULIP_CSR_READ(sc, csr_command)) & TULIP_GPR_CMDBITS) != 0) {
-	    sc->tulip_cmdmode &= ~TULIP_GPR_CMDBITS;
-	    sc->tulip_cmdmode |= mi->mi_cmdmode;
-	    tulip_reset(sc);
-	}
-	TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_PINSET|sc->tulip_gpinit);
-	DELAY(10);
-	TULIP_CSR_WRITE(sc, csr_gp, (u_int8_t) mi->mi_gpdata);
-    } else if (mi->mi_type == TULIP_MEDIAINFO_SYM) {
-	/*
-	 * If the cmdmode bits don't match the currently operating mode,
-	 * set the cmdmode appropriately and reset the chip.
-	 */
-	if (((mi->mi_cmdmode ^ TULIP_CSR_READ(sc, csr_command)) & TULIP_GPR_CMDBITS) != 0) {
-	    sc->tulip_cmdmode &= ~TULIP_GPR_CMDBITS;
-	    sc->tulip_cmdmode |= mi->mi_cmdmode;
-	    tulip_reset(sc);
-	}
-	TULIP_CSR_WRITE(sc, csr_sia_general, mi->mi_gpcontrol);
-	TULIP_CSR_WRITE(sc, csr_sia_general, mi->mi_gpdata);
-    } else if (mi->mi_type == TULIP_MEDIAINFO_MII
-	       && sc->tulip_probe_state != TULIP_PROBE_INACTIVE) {
-	int idx;
-	if (sc->tulip_features & TULIP_HAVE_SIAGP) {
-	    const u_int8_t *dp;
-	    dp = &sc->tulip_rombuf[mi->mi_reset_offset];
-	    for (idx = 0; idx < mi->mi_reset_length; idx++, dp += 2) {
-		DELAY(10);
-		TULIP_CSR_WRITE(sc, csr_sia_general, (dp[0] + 256 * dp[1]) << 16);
-	    }
-	    sc->tulip_phyaddr = mi->mi_phyaddr;
-	    dp = &sc->tulip_rombuf[mi->mi_gpr_offset];
-	    for (idx = 0; idx < mi->mi_gpr_length; idx++, dp += 2) {
-		DELAY(10);
-		TULIP_CSR_WRITE(sc, csr_sia_general, (dp[0] + 256 * dp[1]) << 16);
-	    }
-	} else {
-	    for (idx = 0; idx < mi->mi_reset_length; idx++) {
-		DELAY(10);
-		TULIP_CSR_WRITE(sc, csr_gp, sc->tulip_rombuf[mi->mi_reset_offset + idx]);
-	    }
-	    sc->tulip_phyaddr = mi->mi_phyaddr;
-	    for (idx = 0; idx < mi->mi_gpr_length; idx++) {
-		DELAY(10);
-		TULIP_CSR_WRITE(sc, csr_gp, sc->tulip_rombuf[mi->mi_gpr_offset + idx]);
-	    }
-	}
-	if (sc->tulip_flags & TULIP_TRYNWAY) {
-	    tulip_mii_autonegotiate(sc, sc->tulip_phyaddr);
-	} else if ((sc->tulip_flags & TULIP_DIDNWAY) == 0) {
-	    u_int32_t data = tulip_mii_readreg(sc, sc->tulip_phyaddr, PHYREG_CONTROL);
-	    data &= ~(PHYCTL_SELECT_100MB|PHYCTL_FULL_DUPLEX|PHYCTL_AUTONEG_ENABLE);
-	    sc->tulip_flags &= ~TULIP_DIDNWAY;
-	    if (TULIP_IS_MEDIA_FD(media))
-		data |= PHYCTL_FULL_DUPLEX;
-	    if (TULIP_IS_MEDIA_100MB(media))
-		data |= PHYCTL_SELECT_100MB;
-	    tulip_mii_writereg(sc, sc->tulip_phyaddr, PHYREG_CONTROL, data);
-	}
-    }
-}
-
-static void
-tulip_linkup(tulip_softc_t * const sc, tulip_media_t media)
-{
-    TULIP_LOCK_ASSERT(sc);
-    if ((sc->tulip_flags & TULIP_LINKUP) == 0)
-	sc->tulip_flags |= TULIP_PRINTLINKUP;
-    sc->tulip_flags |= TULIP_LINKUP;
-    sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
-#if 0 /* XXX how does with work with ifmedia? */
-    if ((sc->tulip_flags & TULIP_DIDNWAY) == 0) {
-	if (sc->tulip_ifp->if_flags & IFF_FULLDUPLEX) {
-	    if (TULIP_CAN_MEDIA_FD(media)
-		    && sc->tulip_mediums[TULIP_FD_MEDIA_OF(media)] != NULL)
-		media = TULIP_FD_MEDIA_OF(media);
-	} else {
-	    if (TULIP_IS_MEDIA_FD(media)
-		    && sc->tulip_mediums[TULIP_HD_MEDIA_OF(media)] != NULL)
-		media = TULIP_HD_MEDIA_OF(media);
-	}
-    }
-#endif
-    if (sc->tulip_media != media) {
-#ifdef TULIP_DEBUG
-	sc->tulip_dbg.dbg_last_media = sc->tulip_media;
-#endif
-	sc->tulip_media = media;
-	sc->tulip_flags |= TULIP_PRINTMEDIA;
-	if (TULIP_IS_MEDIA_FD(sc->tulip_media)) {
-	    sc->tulip_cmdmode |= TULIP_CMD_FULLDUPLEX;
-	} else if (sc->tulip_chipid != TULIP_21041 || (sc->tulip_flags & TULIP_DIDNWAY) == 0) {
-	    sc->tulip_cmdmode &= ~TULIP_CMD_FULLDUPLEX;
-	}
-    }
-    /*
-     * We could set probe_timeout to 0 but setting to 3000 puts this
-     * in one central place and the only matters is tulip_link is
-     * followed by a tulip_timeout.  Therefore setting it should not
-     * result in aberrant behavour.
-     */
-    sc->tulip_probe_timeout = 3000;
-    sc->tulip_probe_state = TULIP_PROBE_INACTIVE;
-    sc->tulip_flags &= ~(TULIP_TXPROBE_ACTIVE|TULIP_TRYNWAY);
-    if (sc->tulip_flags & TULIP_INRESET) {
-	tulip_media_set(sc, sc->tulip_media);
-    } else if (sc->tulip_probe_media != sc->tulip_media) {
-	/*
-	 * No reason to change media if we have the right media.
-	 */
-	tulip_reset(sc);
-    }
-    tulip_init_locked(sc);
-}
-
-static void
-tulip_media_print(tulip_softc_t * const sc)
-{
-    struct ifnet *ifp = sc->tulip_ifp;
-
-    TULIP_LOCK_ASSERT(sc);
-    if ((sc->tulip_flags & TULIP_LINKUP) == 0)
-	return;
-    if (sc->tulip_flags & TULIP_PRINTMEDIA) {
-	if_printf(ifp, "enabling %s port\n",
-	       tulip_mediums[sc->tulip_media]);
-	sc->tulip_flags &= ~(TULIP_PRINTMEDIA|TULIP_PRINTLINKUP);
-    } else if (sc->tulip_flags & TULIP_PRINTLINKUP) {
-	if_printf(ifp, "link up\n");
-	sc->tulip_flags &= ~TULIP_PRINTLINKUP;
-    }
-}
-
-#if defined(TULIP_DO_GPR_SENSE)
-static tulip_media_t
-tulip_21140_gpr_media_sense(tulip_softc_t * const sc)
-{
-    struct ifnet *ifp sc->tulip_ifp;
-    tulip_media_t maybe_media = TULIP_MEDIA_UNKNOWN;
-    tulip_media_t last_media = TULIP_MEDIA_UNKNOWN;
-    tulip_media_t media;
-
-    TULIP_LOCK_ASSERT(sc);
-
-    /*
-     * If one of the media blocks contained a default media flag,
-     * use that.
-     */
-    for (media = TULIP_MEDIA_UNKNOWN; media < TULIP_MEDIA_MAX; media++) {
-	const tulip_media_info_t *mi;
-	/*
-	 * Media is not supported (or is full-duplex).
-	 */
-	if ((mi = sc->tulip_mediums[media]) == NULL || TULIP_IS_MEDIA_FD(media))
-	    continue;
-	if (mi->mi_type != TULIP_MEDIAINFO_GPR)
-	    continue;
-
-	/*
-	 * Remember the media is this is the "default" media.
-	 */
-	if (mi->mi_default && maybe_media == TULIP_MEDIA_UNKNOWN)
-	    maybe_media = media;
-
-	/*
-	 * No activity mask?  Can't see if it is active if there's no mask.
-	 */
-	if (mi->mi_actmask == 0)
-	    continue;
-
-	/*
-	 * Does the activity data match?
-	 */
-	if ((TULIP_CSR_READ(sc, csr_gp) & mi->mi_actmask) != mi->mi_actdata)
-	    continue;
-
-#if defined(TULIP_DEBUG)
-	if_printf(ifp, "gpr_media_sense: %s: 0x%02x & 0x%02x == 0x%02x\n",
-	       tulip_mediums[media],
-	       TULIP_CSR_READ(sc, csr_gp) & 0xFF,
-	       mi->mi_actmask, mi->mi_actdata);
-#endif
-	/*
-	 * It does!  If this is the first media we detected, then 
-	 * remember this media.  If isn't the first, then there were
-	 * multiple matches which we equate to no match (since we don't
-	 * which to select (if any).
-	 */
-	if (last_media == TULIP_MEDIA_UNKNOWN) {
-	    last_media = media;
-	} else if (last_media != media) {
-	    last_media = TULIP_MEDIA_UNKNOWN;
-	}
-    }
-    return (last_media != TULIP_MEDIA_UNKNOWN) ? last_media : maybe_media;
-}
-#endif /* TULIP_DO_GPR_SENSE */
-
-static tulip_link_status_t
-tulip_media_link_monitor(tulip_softc_t * const sc)
-{
-    struct ifnet *ifp = sc->tulip_ifp;
-    const tulip_media_info_t * const mi = sc->tulip_mediums[sc->tulip_media];
-    tulip_link_status_t linkup = TULIP_LINK_DOWN;
-
-    TULIP_LOCK_ASSERT(sc);
-    if (mi == NULL) {
-#if defined(DIAGNOSTIC) || defined(TULIP_DEBUG)
-	panic("tulip_media_link_monitor: %s: botch at line %d\n",
-	      tulip_mediums[sc->tulip_media],__LINE__);
-#else
-	return TULIP_LINK_UNKNOWN;
-#endif
-    }
-
-
-    /*
-     * Have we seen some packets?  If so, the link must be good.
-     */
-    if ((sc->tulip_flags & (TULIP_RXACT|TULIP_LINKUP)) == (TULIP_RXACT|TULIP_LINKUP)) {
-	sc->tulip_flags &= ~TULIP_RXACT;
-	sc->tulip_probe_timeout = 3000;
-	return TULIP_LINK_UP;
-    }
-
-    sc->tulip_flags &= ~TULIP_RXACT;
-    if (mi->mi_type == TULIP_MEDIAINFO_MII) {
-	u_int32_t status;
-	/*
-	 * Read the PHY status register.
-	 */
-	status = tulip_mii_readreg(sc, sc->tulip_phyaddr, PHYREG_STATUS);
-	if (status & PHYSTS_AUTONEG_DONE) {
-	    /*
-	     * If the PHY has completed autonegotiation, see the if the
-	     * remote systems abilities have changed.  If so, upgrade or
-	     * downgrade as appropriate.
-	     */
-	    u_int32_t abilities = tulip_mii_readreg(sc, sc->tulip_phyaddr, PHYREG_AUTONEG_ABILITIES);
-	    abilities = (abilities << 6) & status;
-	    if (abilities != sc->tulip_abilities) {
-#if defined(TULIP_DEBUG)
-		loudprintf("%s(phy%d): autonegotiation changed: 0x%04x -> 0x%04x\n",
-			   ifp->if_xname, sc->tulip_phyaddr,
-			   sc->tulip_abilities, abilities);
-#endif
-		if (tulip_mii_map_abilities(sc, abilities)) {
-		    tulip_linkup(sc, sc->tulip_probe_media);
-		    return TULIP_LINK_UP;
-		}
-		/*
-		 * if we had selected media because of autonegotiation,
-		 * we need to probe for the new media.
-		 */
-		sc->tulip_probe_state = TULIP_PROBE_INACTIVE;
-		if (sc->tulip_flags & TULIP_DIDNWAY)
-		    return TULIP_LINK_DOWN;
-	    }
-	}
-	/*
-	 * The link is now up.  If was down, say its back up.
-	 */
-	if ((status & (PHYSTS_LINK_UP|PHYSTS_REMOTE_FAULT)) == PHYSTS_LINK_UP)
-	    linkup = TULIP_LINK_UP;
-    } else if (mi->mi_type == TULIP_MEDIAINFO_GPR) {
-	/*
-	 * No activity sensor?  Assume all's well.
-	 */
-	if (mi->mi_actmask == 0)
-	    return TULIP_LINK_UNKNOWN;
-	/*
-	 * Does the activity data match?
-	 */
-	if ((TULIP_CSR_READ(sc, csr_gp) & mi->mi_actmask) == mi->mi_actdata)
-	    linkup = TULIP_LINK_UP;
-    } else if (mi->mi_type == TULIP_MEDIAINFO_SIA) {
-	/*
-	 * Assume non TP ok for now.
-	 */
-	if (!TULIP_IS_MEDIA_TP(sc->tulip_media))
-	    return TULIP_LINK_UNKNOWN;
-	if ((TULIP_CSR_READ(sc, csr_sia_status) & TULIP_SIASTS_LINKFAIL) == 0)
-	    linkup = TULIP_LINK_UP;
-#if defined(TULIP_DEBUG)
-	if (sc->tulip_probe_timeout <= 0)
-	    if_printf(ifp, "sia status = 0x%08x\n",
-		    TULIP_CSR_READ(sc, csr_sia_status));
-#endif
-    } else if (mi->mi_type == TULIP_MEDIAINFO_SYM) {
-	return TULIP_LINK_UNKNOWN;
-    }
-    /*
-     * We will wait for 3 seconds until the link goes into suspect mode.
-     */
-    if (sc->tulip_flags & TULIP_LINKUP) {
-	if (linkup == TULIP_LINK_UP)
-	    sc->tulip_probe_timeout = 3000;
-	if (sc->tulip_probe_timeout > 0)
-	    return TULIP_LINK_UP;
-
-	sc->tulip_flags &= ~TULIP_LINKUP;
-	if_printf(ifp, "link down: cable problem?\n");
-    }
-#if defined(TULIP_DEBUG)
-    sc->tulip_dbg.dbg_link_downed++;
-#endif
-    return TULIP_LINK_DOWN;
-}
-
-static void
-tulip_media_poll(tulip_softc_t * const sc, tulip_mediapoll_event_t event)
-{
-    struct ifnet *ifp = sc->tulip_ifp;
-
-    TULIP_LOCK_ASSERT(sc);
-#if defined(TULIP_DEBUG)
-    sc->tulip_dbg.dbg_events[event]++;
-#endif
-    if (sc->tulip_probe_state == TULIP_PROBE_INACTIVE
-	    && event == TULIP_MEDIAPOLL_TIMER) {
-	switch (tulip_media_link_monitor(sc)) {
-	    case TULIP_LINK_DOWN: {
-		/*
-		 * Link Monitor failed.  Probe for new media.
-		 */
-		event = TULIP_MEDIAPOLL_LINKFAIL;
-		break;
-	    }
-	    case TULIP_LINK_UP: {
-		/*
-		 * Check again soon.
-		 */
-		tulip_timeout(sc);
-		return;
-	    }
-	    case TULIP_LINK_UNKNOWN: {
-		/*
-		 * We can't tell so don't bother.
-		 */
-		return;
-	    }
-	}
-    }
-
-    if (event == TULIP_MEDIAPOLL_LINKFAIL) {
-	if (sc->tulip_probe_state == TULIP_PROBE_INACTIVE) {
-	    if (TULIP_DO_AUTOSENSE(sc)) {
-#if defined(TULIP_DEBUG)
-		sc->tulip_dbg.dbg_link_failures++;
-#endif
-		sc->tulip_media = TULIP_MEDIA_UNKNOWN;
-		if (sc->tulip_ifp->if_flags & IFF_UP)
-		    tulip_reset(sc);	/* restart probe */
-	    }
-	    return;
-	}
-#if defined(TULIP_DEBUG)
-	sc->tulip_dbg.dbg_link_pollintrs++;
-#endif
-    }
-
-    if (event == TULIP_MEDIAPOLL_START) {
-	sc->tulip_ifp->if_drv_flags |= IFF_DRV_OACTIVE;
-	if (sc->tulip_probe_state != TULIP_PROBE_INACTIVE)
-	    return;
-	sc->tulip_probe_mediamask = 0;
-	sc->tulip_probe_passes = 0;
-#if defined(TULIP_DEBUG)
-	sc->tulip_dbg.dbg_media_probes++;
-#endif
-	/*
-	 * If the SROM contained an explicit media to use, use it.
-	 */
-	sc->tulip_cmdmode &= ~(TULIP_CMD_RXRUN|TULIP_CMD_FULLDUPLEX);
-	sc->tulip_flags |= TULIP_TRYNWAY|TULIP_PROBE1STPASS;
-	sc->tulip_flags &= ~(TULIP_DIDNWAY|TULIP_PRINTMEDIA|TULIP_PRINTLINKUP);
-	/*
-	 * connidx is defaulted to a media_unknown type.
-	 */
-	sc->tulip_probe_media = tulip_srom_conninfo[sc->tulip_connidx].sc_media;
-	if (sc->tulip_probe_media != TULIP_MEDIA_UNKNOWN) {
-	    tulip_linkup(sc, sc->tulip_probe_media);
-	    tulip_timeout(sc);
-	    return;
-	}
-
-	if (sc->tulip_features & TULIP_HAVE_GPR) {
-	    sc->tulip_probe_state = TULIP_PROBE_GPRTEST;
-	    sc->tulip_probe_timeout = 2000;
-	} else {
-	    sc->tulip_probe_media = TULIP_MEDIA_MAX;
-	    sc->tulip_probe_timeout = 0;
-	    sc->tulip_probe_state = TULIP_PROBE_MEDIATEST;
-	}
-    }
-
-    /*
-     * Ignore txprobe failures or spurious callbacks.
-     */
-    if (event == TULIP_MEDIAPOLL_TXPROBE_FAILED
-	    && sc->tulip_probe_state != TULIP_PROBE_MEDIATEST) {
-	sc->tulip_flags &= ~TULIP_TXPROBE_ACTIVE;
-	return;
-    }
-
-    /*
-     * If we really transmitted a packet, then that's the media we'll use.
-     */
-    if (event == TULIP_MEDIAPOLL_TXPROBE_OK || event == TULIP_MEDIAPOLL_LINKPASS) {
-	if (event == TULIP_MEDIAPOLL_LINKPASS) {
-	    /* XXX Check media status just to be sure */
-	    sc->tulip_probe_media = TULIP_MEDIA_10BASET;
-#if defined(TULIP_DEBUG)
-	} else {
-	    sc->tulip_dbg.dbg_txprobes_ok[sc->tulip_probe_media]++;
-#endif
-	}
-	tulip_linkup(sc, sc->tulip_probe_media);
-	tulip_timeout(sc);
-	return;
-    }
-
-    if (sc->tulip_probe_state == TULIP_PROBE_GPRTEST) {
-#if defined(TULIP_DO_GPR_SENSE)
-	/*
-	 * Check for media via the general purpose register.
-	 *
-	 * Try to sense the media via the GPR.  If the same value
-	 * occurs 3 times in a row then just use that.
-	 */
-	if (sc->tulip_probe_timeout > 0) {
-	    tulip_media_t new_probe_media = tulip_21140_gpr_media_sense(sc);
-#if defined(TULIP_DEBUG)
-	    if_printf(ifp, "media_poll: gpr sensing = %s\n",
-		   tulip_mediums[new_probe_media]);
-#endif
-	    if (new_probe_media != TULIP_MEDIA_UNKNOWN) {
-		if (new_probe_media == sc->tulip_probe_media) {
-		    if (--sc->tulip_probe_count == 0)
-			tulip_linkup(sc, sc->tulip_probe_media);
-		} else {
-		    sc->tulip_probe_count = 10;
-		}
-	    }
-	    sc->tulip_probe_media = new_probe_media;
-	    tulip_timeout(sc);
-	    return;
-	}
-#endif /* TULIP_DO_GPR_SENSE */
-	/*
-	 * Brute force.  We cycle through each of the media types
-	 * and try to transmit a packet.
-	 */
-	sc->tulip_probe_state = TULIP_PROBE_MEDIATEST;
-	sc->tulip_probe_media = TULIP_MEDIA_MAX;
-	sc->tulip_probe_timeout = 0;
-	tulip_timeout(sc);
-	return;
-    }
-
-    if (sc->tulip_probe_state != TULIP_PROBE_MEDIATEST
-	   && (sc->tulip_features & TULIP_HAVE_MII)) {
-	tulip_media_t old_media = sc->tulip_probe_media;
-	tulip_mii_autonegotiate(sc, sc->tulip_phyaddr);
-	switch (sc->tulip_probe_state) {
-	    case TULIP_PROBE_FAILED:
-	    case TULIP_PROBE_MEDIATEST: {
-		/*
-		 * Try the next media.
-		 */
-		sc->tulip_probe_mediamask |= sc->tulip_mediums[sc->tulip_probe_media]->mi_mediamask;
-		sc->tulip_probe_timeout = 0;
-#ifdef notyet
-		if (sc->tulip_probe_state == TULIP_PROBE_FAILED)
-		    break;
-		if (sc->tulip_probe_media != tulip_mii_phy_readspecific(sc))
-		    break;
-		sc->tulip_probe_timeout = TULIP_IS_MEDIA_TP(sc->tulip_probe_media) ? 2500 : 300;
-#endif
-		break;
-	    }
-	    case TULIP_PROBE_PHYAUTONEG: {
-		return;
-	    }
-	    case TULIP_PROBE_INACTIVE: {
-		/*
-		 * Only probe if we autonegotiated a media that hasn't failed.
-		 */
-		sc->tulip_probe_timeout = 0;
-		if (sc->tulip_probe_mediamask & TULIP_BIT(sc->tulip_probe_media)) {
-		    sc->tulip_probe_media = old_media;
-		    break;
-		}
-		tulip_linkup(sc, sc->tulip_probe_media);
-		tulip_timeout(sc);
-		return;
-	    }
-	    default: {
-#if defined(DIAGNOSTIC) || defined(TULIP_DEBUG)
-		panic("tulip_media_poll: botch at line %d\n", __LINE__);
-#endif
-		break;
-	    }
-	}
-    }
-
-    if (event == TULIP_MEDIAPOLL_TXPROBE_FAILED) {
-#if defined(TULIP_DEBUG)
-	sc->tulip_dbg.dbg_txprobes_failed[sc->tulip_probe_media]++;
-#endif
-	sc->tulip_flags &= ~TULIP_TXPROBE_ACTIVE;
-	return;
-    }
-
-    /*
-     * switch to another media if we tried this one enough.
-     */
-    if (/* event == TULIP_MEDIAPOLL_TXPROBE_FAILED || */ sc->tulip_probe_timeout <= 0) {
-#if defined(TULIP_DEBUG)
-	if (sc->tulip_probe_media == TULIP_MEDIA_UNKNOWN) {
-	    if_printf(ifp, "poll media unknown!\n");
-	    sc->tulip_probe_media = TULIP_MEDIA_MAX;
-	}
-#endif
-	/*
-	 * Find the next media type to check for.  Full Duplex
-	 * types are not allowed.
-	 */
-	do {
-	    sc->tulip_probe_media -= 1;
-	    if (sc->tulip_probe_media == TULIP_MEDIA_UNKNOWN) {
-		if (++sc->tulip_probe_passes == 3) {
-		    if_printf(ifp, "autosense failed: cable problem?\n");
-		    if ((sc->tulip_ifp->if_flags & IFF_UP) == 0) {
-			sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
-			sc->tulip_probe_state = TULIP_PROBE_INACTIVE;
-			return;
-		    }
-		}
-		sc->tulip_flags ^= TULIP_TRYNWAY;	/* XXX */
-		sc->tulip_probe_mediamask = 0;
-		sc->tulip_probe_media = TULIP_MEDIA_MAX - 1;
-	    }
-	} while (sc->tulip_mediums[sc->tulip_probe_media] == NULL
-		 || (sc->tulip_probe_mediamask & TULIP_BIT(sc->tulip_probe_media))
-		 || TULIP_IS_MEDIA_FD(sc->tulip_probe_media));
-
-#if defined(TULIP_DEBUG)
-	if_printf(ifp, "%s: probing %s\n",
-	       event == TULIP_MEDIAPOLL_TXPROBE_FAILED ? "txprobe failed" : "timeout",
-	       tulip_mediums[sc->tulip_probe_media]);
-#endif
-	sc->tulip_probe_timeout = TULIP_IS_MEDIA_TP(sc->tulip_probe_media) ? 2500 : 1000;
-	sc->tulip_probe_state = TULIP_PROBE_MEDIATEST;
-	sc->tulip_probe.probe_txprobes = 0;
-	tulip_reset(sc);
-	tulip_media_set(sc, sc->tulip_probe_media);
-	sc->tulip_flags &= ~TULIP_TXPROBE_ACTIVE;
-    }
-    tulip_timeout(sc);
-
-    /*
-     * If this is hanging off a phy, we know are doing NWAY and we have
-     * forced the phy to a specific speed.  Wait for link up before
-     * before sending a packet.
-     */
-    switch (sc->tulip_mediums[sc->tulip_probe_media]->mi_type) {
-	case TULIP_MEDIAINFO_MII: {
-	    if (sc->tulip_probe_media != tulip_mii_phy_readspecific(sc))
-		return;
-	    break;
-	}
-	case TULIP_MEDIAINFO_SIA: {
-	    if (TULIP_IS_MEDIA_TP(sc->tulip_probe_media)) {
-		if (TULIP_CSR_READ(sc, csr_sia_status) & TULIP_SIASTS_LINKFAIL)
-		    return;
-		tulip_linkup(sc, sc->tulip_probe_media);
-#ifdef notyet
-		if (sc->tulip_features & TULIP_HAVE_MII)
-		    tulip_timeout(sc);
-#endif
-		return;
-	    }
-	    break;
-	}
-	case TULIP_MEDIAINFO_RESET:
-	case TULIP_MEDIAINFO_SYM:
-	case TULIP_MEDIAINFO_NONE:
-	case TULIP_MEDIAINFO_GPR: {
-	    break;
-	}
-    }
-    /*
-     * Try to send a packet.
-     */
-    tulip_txprobe(sc);
-}
-
-static void
-tulip_media_select(tulip_softc_t * const sc)
-{
-    TULIP_LOCK_ASSERT(sc);
-    if (sc->tulip_features & TULIP_HAVE_GPR) {
-	TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_PINSET|sc->tulip_gpinit);
-	DELAY(10);
-	TULIP_CSR_WRITE(sc, csr_gp, sc->tulip_gpdata);
-    }
-    /*
-     * If this board has no media, just return
-     */
-    if (sc->tulip_features & TULIP_HAVE_NOMEDIA)
-	return;
-
-    if (sc->tulip_media == TULIP_MEDIA_UNKNOWN) {
-	TULIP_CSR_WRITE(sc, csr_intr, sc->tulip_intrmask);
-	(*sc->tulip_boardsw->bd_media_poll)(sc, TULIP_MEDIAPOLL_START);
-    } else {
-	tulip_media_set(sc, sc->tulip_media);
-    }
-}
-
-static void
-tulip_21040_mediainfo_init(tulip_softc_t * const sc, tulip_media_t media)
-{
-    TULIP_LOCK_ASSERT(sc);
-    sc->tulip_cmdmode |= TULIP_CMD_CAPTREFFCT|TULIP_CMD_THRSHLD160
-	|TULIP_CMD_BACKOFFCTR;
-    sc->tulip_ifp->if_baudrate = 10000000;
-
-    if (media == TULIP_MEDIA_10BASET || media == TULIP_MEDIA_UNKNOWN) {
-	TULIP_MEDIAINFO_SIA_INIT(sc, &sc->tulip_mediainfo[0], 21040, 10BASET);
-	TULIP_MEDIAINFO_SIA_INIT(sc, &sc->tulip_mediainfo[1], 21040, 10BASET_FD);
-	sc->tulip_intrmask |= TULIP_STS_LINKPASS|TULIP_STS_LINKFAIL;
-    }
-
-    if (media == TULIP_MEDIA_AUIBNC || media == TULIP_MEDIA_UNKNOWN) {
-	TULIP_MEDIAINFO_SIA_INIT(sc, &sc->tulip_mediainfo[2], 21040, AUIBNC);
-    }
-
-    if (media == TULIP_MEDIA_UNKNOWN) {
-	TULIP_MEDIAINFO_SIA_INIT(sc, &sc->tulip_mediainfo[3], 21040, EXTSIA);
-    }
-}
-
-static void
-tulip_21040_media_probe(tulip_softc_t * const sc)
-{
-    TULIP_LOCK_ASSERT(sc);
-    tulip_21040_mediainfo_init(sc, TULIP_MEDIA_UNKNOWN);
-    return;
-}
-
-static void
-tulip_21040_10baset_only_media_probe(tulip_softc_t * const sc)
-{
-    TULIP_LOCK_ASSERT(sc);
-    tulip_21040_mediainfo_init(sc, TULIP_MEDIA_10BASET);
-    tulip_media_set(sc, TULIP_MEDIA_10BASET);
-    sc->tulip_media = TULIP_MEDIA_10BASET;
-}
-
-static void
-tulip_21040_10baset_only_media_select(tulip_softc_t * const sc)
-{
-    TULIP_LOCK_ASSERT(sc);
-    sc->tulip_flags |= TULIP_LINKUP;
-    if (sc->tulip_media == TULIP_MEDIA_10BASET_FD) {
-	sc->tulip_cmdmode |= TULIP_CMD_FULLDUPLEX;
-	sc->tulip_flags &= ~TULIP_SQETEST;
-    } else {
-	sc->tulip_cmdmode &= ~TULIP_CMD_FULLDUPLEX;
-	sc->tulip_flags |= TULIP_SQETEST;
-    }
-    tulip_media_set(sc, sc->tulip_media);
-}
-
-static void
-tulip_21040_auibnc_only_media_probe(tulip_softc_t * const sc)
-{
-    TULIP_LOCK_ASSERT(sc);
-    tulip_21040_mediainfo_init(sc, TULIP_MEDIA_AUIBNC);
-    sc->tulip_flags |= TULIP_SQETEST|TULIP_LINKUP;
-    tulip_media_set(sc, TULIP_MEDIA_AUIBNC);
-    sc->tulip_media = TULIP_MEDIA_AUIBNC;
-}
-
-static void
-tulip_21040_auibnc_only_media_select(tulip_softc_t * const sc)
-{
-    TULIP_LOCK_ASSERT(sc);
-    tulip_media_set(sc, TULIP_MEDIA_AUIBNC);
-    sc->tulip_cmdmode &= ~TULIP_CMD_FULLDUPLEX;
-}
-
-static const tulip_boardsw_t tulip_21040_boardsw = {
-    TULIP_21040_GENERIC,
-    tulip_21040_media_probe,
-    tulip_media_select,
-    tulip_media_poll,
-};
-
-static const tulip_boardsw_t tulip_21040_10baset_only_boardsw = {
-    TULIP_21040_GENERIC,
-    tulip_21040_10baset_only_media_probe,
-    tulip_21040_10baset_only_media_select,
-    NULL,
-};
-
-static const tulip_boardsw_t tulip_21040_auibnc_only_boardsw = {
-    TULIP_21040_GENERIC,
-    tulip_21040_auibnc_only_media_probe,
-    tulip_21040_auibnc_only_media_select,
-    NULL,
-};
-
-static void
-tulip_21041_mediainfo_init(tulip_softc_t * const sc)
-{
-    tulip_media_info_t * const mi = sc->tulip_mediainfo;
-
-    TULIP_LOCK_ASSERT(sc);
-#ifdef notyet
-    if (sc->tulip_revinfo >= 0x20) {
-	TULIP_MEDIAINFO_SIA_INIT(sc, &mi[0], 21041P2, 10BASET);
-	TULIP_MEDIAINFO_SIA_INIT(sc, &mi[1], 21041P2, 10BASET_FD);
-	TULIP_MEDIAINFO_SIA_INIT(sc, &mi[0], 21041P2, AUI);
-	TULIP_MEDIAINFO_SIA_INIT(sc, &mi[1], 21041P2, BNC);
-	return;
-    }
-#endif
-    TULIP_MEDIAINFO_SIA_INIT(sc, &mi[0], 21041, 10BASET);
-    TULIP_MEDIAINFO_SIA_INIT(sc, &mi[1], 21041, 10BASET_FD);
-    TULIP_MEDIAINFO_SIA_INIT(sc, &mi[2], 21041, AUI);
-    TULIP_MEDIAINFO_SIA_INIT(sc, &mi[3], 21041, BNC);
-}
-
-static void
-tulip_21041_media_probe(tulip_softc_t * const sc)
-{
-    TULIP_LOCK_ASSERT(sc);
-    sc->tulip_ifp->if_baudrate = 10000000;
-    sc->tulip_cmdmode |= TULIP_CMD_CAPTREFFCT|TULIP_CMD_ENHCAPTEFFCT
-	|TULIP_CMD_THRSHLD160|TULIP_CMD_BACKOFFCTR;
-    sc->tulip_intrmask |= TULIP_STS_LINKPASS|TULIP_STS_LINKFAIL;
-    tulip_21041_mediainfo_init(sc);
-}
-
-static void
-tulip_21041_media_poll(tulip_softc_t * const sc,
-    const tulip_mediapoll_event_t event)
-{
-    u_int32_t sia_status;
-
-    TULIP_LOCK_ASSERT(sc);
-#if defined(TULIP_DEBUG)
-    sc->tulip_dbg.dbg_events[event]++;
-#endif
-
-    if (event == TULIP_MEDIAPOLL_LINKFAIL) {
-	if (sc->tulip_probe_state != TULIP_PROBE_INACTIVE
-		|| !TULIP_DO_AUTOSENSE(sc))
-	    return;
-	sc->tulip_media = TULIP_MEDIA_UNKNOWN;
-	tulip_reset(sc);	/* start probe */
-	return;
-    }
-
-    /*
-     * If we've been been asked to start a poll or link change interrupt
-     * restart the probe (and reset the tulip to a known state).
-     */
-    if (event == TULIP_MEDIAPOLL_START) {
-	sc->tulip_ifp->if_drv_flags |= IFF_DRV_OACTIVE;
-	sc->tulip_cmdmode &= ~(TULIP_CMD_FULLDUPLEX|TULIP_CMD_RXRUN);
-#ifdef notyet
-	if (sc->tulip_revinfo >= 0x20) {
-	    sc->tulip_cmdmode |= TULIP_CMD_FULLDUPLEX;
-	    sc->tulip_flags |= TULIP_DIDNWAY;
-	}
-#endif
-	TULIP_CSR_WRITE(sc, csr_command, sc->tulip_cmdmode);
-	sc->tulip_probe_state = TULIP_PROBE_MEDIATEST;
-	sc->tulip_probe_media = TULIP_MEDIA_10BASET;
-	sc->tulip_probe_timeout = TULIP_21041_PROBE_10BASET_TIMEOUT;
-	tulip_media_set(sc, TULIP_MEDIA_10BASET);
-	tulip_timeout(sc);
-	return;
-    }
-
-    if (sc->tulip_probe_state == TULIP_PROBE_INACTIVE)
-	return;
-
-    if (event == TULIP_MEDIAPOLL_TXPROBE_OK) {
-#if defined(TULIP_DEBUG)
-	sc->tulip_dbg.dbg_txprobes_ok[sc->tulip_probe_media]++;
-#endif
-	tulip_linkup(sc, sc->tulip_probe_media);
-	return;
-    }
-
-    sia_status = TULIP_CSR_READ(sc, csr_sia_status);
-    TULIP_CSR_WRITE(sc, csr_sia_status, sia_status);
-    if ((sia_status & TULIP_SIASTS_LINKFAIL) == 0) {
-	if (sc->tulip_revinfo >= 0x20) {
-	    if (sia_status & (PHYSTS_10BASET_FD << (16 - 6)))
-		sc->tulip_probe_media = TULIP_MEDIA_10BASET_FD;
-	}
-	/*
-	 * If the link has passed LinkPass, 10baseT is the
-	 * proper media to use.
-	 */
-	tulip_linkup(sc, sc->tulip_probe_media);
-	return;
-    }
-
-    /*
-     * wait for up to 2.4 seconds for the link to reach pass state.
-     * Only then start scanning the other media for activity.
-     * choose media with receive activity over those without.
-     */
-    if (sc->tulip_probe_media == TULIP_MEDIA_10BASET) {
-	if (event != TULIP_MEDIAPOLL_TIMER)
-	    return;
-	if (sc->tulip_probe_timeout > 0
-		&& (sia_status & TULIP_SIASTS_OTHERRXACTIVITY) == 0) {
-	    tulip_timeout(sc);
-	    return;
-	}
-	sc->tulip_probe_timeout = TULIP_21041_PROBE_AUIBNC_TIMEOUT;
-	sc->tulip_flags |= TULIP_WANTRXACT;
-	if (sia_status & TULIP_SIASTS_OTHERRXACTIVITY) {
-	    sc->tulip_probe_media = TULIP_MEDIA_BNC;
-	} else {
-	    sc->tulip_probe_media = TULIP_MEDIA_AUI;
-	}
-	tulip_media_set(sc, sc->tulip_probe_media);
-	tulip_timeout(sc);
-	return;
-    }
-
-    /*
-     * If we failed, clear the txprobe active flag.
-     */
-    if (event == TULIP_MEDIAPOLL_TXPROBE_FAILED)
-	sc->tulip_flags &= ~TULIP_TXPROBE_ACTIVE;
-
-
-    if (event == TULIP_MEDIAPOLL_TIMER) {
-	/*
-	 * If we've received something, then that's our link!
-	 */
-	if (sc->tulip_flags & TULIP_RXACT) {
-	    tulip_linkup(sc, sc->tulip_probe_media);
-	    return;
-	}
-	/*
-	 * if no txprobe active  
-	 */
-	if ((sc->tulip_flags & TULIP_TXPROBE_ACTIVE) == 0
-		&& ((sc->tulip_flags & TULIP_WANTRXACT) == 0
-		    || (sia_status & TULIP_SIASTS_RXACTIVITY))) {
-	    sc->tulip_probe_timeout = TULIP_21041_PROBE_AUIBNC_TIMEOUT;
-	    tulip_txprobe(sc);
-	    tulip_timeout(sc);
-	    return;
-	}
-	/*
-	 * Take 2 passes through before deciding to not
-	 * wait for receive activity.  Then take another
-	 * two passes before spitting out a warning.
-	 */
-	if (sc->tulip_probe_timeout <= 0) {
-	    if (sc->tulip_flags & TULIP_WANTRXACT) {
-		sc->tulip_flags &= ~TULIP_WANTRXACT;
-		sc->tulip_probe_timeout = TULIP_21041_PROBE_AUIBNC_TIMEOUT;
-	    } else {
-		if_printf(sc->tulip_ifp,
-		    "autosense failed: cable problem?\n");
-		if ((sc->tulip_ifp->if_flags & IFF_UP) == 0) {
-		    sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
-		    sc->tulip_probe_state = TULIP_PROBE_INACTIVE;
-		    return;
-		}
-	    }
-	}
-    }
-    
-    /*
-     * Since this media failed to probe, try the other one.
-     */
-    sc->tulip_probe_timeout = TULIP_21041_PROBE_AUIBNC_TIMEOUT;
-    if (sc->tulip_probe_media == TULIP_MEDIA_AUI) {
-	sc->tulip_probe_media = TULIP_MEDIA_BNC;
-    } else {
-	sc->tulip_probe_media = TULIP_MEDIA_AUI;
-    }
-    tulip_media_set(sc, sc->tulip_probe_media);
-    sc->tulip_flags &= ~TULIP_TXPROBE_ACTIVE;
-    tulip_timeout(sc);
-}
-
-static const tulip_boardsw_t tulip_21041_boardsw = {
-    TULIP_21041_GENERIC,
-    tulip_21041_media_probe,
-    tulip_media_select,
-    tulip_21041_media_poll
-};
-
-static const tulip_phy_attr_t tulip_mii_phy_attrlist[] = {
-    { 0x20005c00, 0,		/* 08-00-17 */
-      {
-	{ 0x19, 0x0040, 0x0040 },	/* 10TX */
-	{ 0x19, 0x0040, 0x0000 },	/* 100TX */
-      },
-#if defined(TULIP_DEBUG)
-      "NS DP83840",
-#endif
-    },
-    { 0x0281F400, 0,		/* 00-A0-7D */
-      {
-	{ 0x12, 0x0010, 0x0000 },	/* 10T */
-	{ },				/* 100TX */
-	{ 0x12, 0x0010, 0x0010 },	/* 100T4 */
-	{ 0x12, 0x0008, 0x0008 },	/* FULL_DUPLEX */
-      },
-#if defined(TULIP_DEBUG)
-      "Seeq 80C240"
-#endif
-    },
-#if 0
-    { 0x0015F420, 0,	/* 00-A0-7D */
-      {
-	{ 0x12, 0x0010, 0x0000 },	/* 10T */
-	{ },				/* 100TX */
-	{ 0x12, 0x0010, 0x0010 },	/* 100T4 */
-	{ 0x12, 0x0008, 0x0008 },	/* FULL_DUPLEX */
-      },
-#if defined(TULIP_DEBUG)
-      "Broadcom BCM5000"
-#endif
-    },
-#endif
-    { 0x0281F400, 0,		/* 00-A0-BE */
-      {
-	{ 0x11, 0x8000, 0x0000 },	/* 10T */
-	{ 0x11, 0x8000, 0x8000 },	/* 100TX */
-	{ },				/* 100T4 */
-	{ 0x11, 0x4000, 0x4000 },	/* FULL_DUPLEX */
-      },
-#if defined(TULIP_DEBUG)
-      "ICS 1890"
-#endif 
-    },
-    { 0 }
-};
-
-static tulip_media_t
-tulip_mii_phy_readspecific(tulip_softc_t * const sc)
-{
-    const tulip_phy_attr_t *attr;
-    u_int16_t data;
-    u_int32_t id;
-    unsigned idx = 0;
-    static const tulip_media_t table[] = {
-	TULIP_MEDIA_UNKNOWN,
-	TULIP_MEDIA_10BASET,
-	TULIP_MEDIA_100BASETX,
-	TULIP_MEDIA_100BASET4,
-	TULIP_MEDIA_UNKNOWN,
-	TULIP_MEDIA_10BASET_FD,
-	TULIP_MEDIA_100BASETX_FD,
-	TULIP_MEDIA_UNKNOWN
-    };
-
-    TULIP_LOCK_ASSERT(sc);
-
-    /*
-     * Don't read phy specific registers if link is not up.
-     */
-    data = tulip_mii_readreg(sc, sc->tulip_phyaddr, PHYREG_STATUS);
-    if ((data & (PHYSTS_LINK_UP|PHYSTS_EXTENDED_REGS)) != (PHYSTS_LINK_UP|PHYSTS_EXTENDED_REGS))
-	return TULIP_MEDIA_UNKNOWN;
-
-    id = (tulip_mii_readreg(sc, sc->tulip_phyaddr, PHYREG_IDLOW) << 16) |
-	tulip_mii_readreg(sc, sc->tulip_phyaddr, PHYREG_IDHIGH);
-    for (attr = tulip_mii_phy_attrlist;; attr++) {
-	if (attr->attr_id == 0)
-	    return TULIP_MEDIA_UNKNOWN;
-	if ((id & ~0x0F) == attr->attr_id)
-	    break;
-    }
-
-    if (attr->attr_modes[PHY_MODE_100TX].pm_regno) {
-	const tulip_phy_modedata_t * const pm = &attr->attr_modes[PHY_MODE_100TX];
-	data = tulip_mii_readreg(sc, sc->tulip_phyaddr, pm->pm_regno);
-	if ((data & pm->pm_mask) == pm->pm_value)
-	    idx = 2;
-    }
-    if (idx == 0 && attr->attr_modes[PHY_MODE_100T4].pm_regno) {
-	const tulip_phy_modedata_t * const pm = &attr->attr_modes[PHY_MODE_100T4];
-	data = tulip_mii_readreg(sc, sc->tulip_phyaddr, pm->pm_regno);
-	if ((data & pm->pm_mask) == pm->pm_value)
-	    idx = 3;
-    }
-    if (idx == 0 && attr->attr_modes[PHY_MODE_10T].pm_regno) {
-	const tulip_phy_modedata_t * const pm = &attr->attr_modes[PHY_MODE_10T];
-	data = tulip_mii_readreg(sc, sc->tulip_phyaddr, pm->pm_regno);
-	if ((data & pm->pm_mask) == pm->pm_value)
-	    idx = 1;
-    } 
-    if (idx != 0 && attr->attr_modes[PHY_MODE_FULLDUPLEX].pm_regno) {
-	const tulip_phy_modedata_t * const pm = &attr->attr_modes[PHY_MODE_FULLDUPLEX];
-	data = tulip_mii_readreg(sc, sc->tulip_phyaddr, pm->pm_regno);
-	idx += ((data & pm->pm_mask) == pm->pm_value ? 4 : 0);
-    }
-    return table[idx];
-}
-
-static unsigned
-tulip_mii_get_phyaddr(tulip_softc_t * const sc, unsigned offset)
-{
-    unsigned phyaddr;
-
-    TULIP_LOCK_ASSERT(sc);
-    for (phyaddr = 1; phyaddr < 32; phyaddr++) {
-	unsigned status = tulip_mii_readreg(sc, phyaddr, PHYREG_STATUS);
-	if (status == 0 || status == 0xFFFF || status < PHYSTS_10BASET)
-	    continue;
-	if (offset == 0)
-	    return phyaddr;
-	offset--;
-    }
-    if (offset == 0) {
-	unsigned status = tulip_mii_readreg(sc, 0, PHYREG_STATUS);
-	if (status == 0 || status == 0xFFFF || status < PHYSTS_10BASET)
-	    return TULIP_MII_NOPHY;
-	return 0;
-    }
-    return TULIP_MII_NOPHY;
-}
-
-static int
-tulip_mii_map_abilities(tulip_softc_t * const sc, unsigned abilities)
-{
-    TULIP_LOCK_ASSERT(sc);
-    sc->tulip_abilities = abilities;
-    if (abilities & PHYSTS_100BASETX_FD) {
-	sc->tulip_probe_media = TULIP_MEDIA_100BASETX_FD;
-    } else if (abilities & PHYSTS_100BASET4) {
-	sc->tulip_probe_media = TULIP_MEDIA_100BASET4;
-    } else if (abilities & PHYSTS_100BASETX) {
-	sc->tulip_probe_media = TULIP_MEDIA_100BASETX;
-    } else if (abilities & PHYSTS_10BASET_FD) {
-	sc->tulip_probe_media = TULIP_MEDIA_10BASET_FD;
-    } else if (abilities & PHYSTS_10BASET) {
-	sc->tulip_probe_media = TULIP_MEDIA_10BASET;
-    } else {
-	sc->tulip_probe_state = TULIP_PROBE_MEDIATEST;
-	return 0;
-    }
-    sc->tulip_probe_state = TULIP_PROBE_INACTIVE;
-    return 1;
-}
-
-static void
-tulip_mii_autonegotiate(tulip_softc_t * const sc, const unsigned phyaddr)
-{
-    struct ifnet *ifp = sc->tulip_ifp;
-
-    TULIP_LOCK_ASSERT(sc);
-    switch (sc->tulip_probe_state) {
-        case TULIP_PROBE_MEDIATEST:
-        case TULIP_PROBE_INACTIVE: {
-	    sc->tulip_flags |= TULIP_DIDNWAY;
-	    tulip_mii_writereg(sc, phyaddr, PHYREG_CONTROL, PHYCTL_RESET);
-	    sc->tulip_probe_timeout = 3000;
-	    sc->tulip_intrmask |= TULIP_STS_ABNRMLINTR|TULIP_STS_NORMALINTR;
-	    sc->tulip_probe_state = TULIP_PROBE_PHYRESET;
-	}
-        /* FALLTHROUGH */
-        case TULIP_PROBE_PHYRESET: {
-	    u_int32_t status;
-	    u_int32_t data = tulip_mii_readreg(sc, phyaddr, PHYREG_CONTROL);
-	    if (data & PHYCTL_RESET) {
-		if (sc->tulip_probe_timeout > 0) {
-		    tulip_timeout(sc);
-		    return;
-		}
-		printf("%s(phy%d): error: reset of PHY never completed!\n",
-			   ifp->if_xname, phyaddr);
-		sc->tulip_flags &= ~TULIP_TXPROBE_ACTIVE;
-		sc->tulip_probe_state = TULIP_PROBE_FAILED;
-		sc->tulip_ifp->if_flags &= ~IFF_UP;
-		sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
-		return;
-	    }
-	    status = tulip_mii_readreg(sc, phyaddr, PHYREG_STATUS);
-	    if ((status & PHYSTS_CAN_AUTONEG) == 0) {
-#if defined(TULIP_DEBUG)
-		loudprintf("%s(phy%d): autonegotiation disabled\n",
-			   ifp->if_xname, phyaddr);
-#endif
-		sc->tulip_flags &= ~TULIP_DIDNWAY;
-		sc->tulip_probe_state = TULIP_PROBE_MEDIATEST;
-		return;
-	    }
-	    if (tulip_mii_readreg(sc, phyaddr, PHYREG_AUTONEG_ADVERTISEMENT) != ((status >> 6) | 0x01))
-		tulip_mii_writereg(sc, phyaddr, PHYREG_AUTONEG_ADVERTISEMENT, (status >> 6) | 0x01);
-	    tulip_mii_writereg(sc, phyaddr, PHYREG_CONTROL, data|PHYCTL_AUTONEG_RESTART|PHYCTL_AUTONEG_ENABLE);
-	    data = tulip_mii_readreg(sc, phyaddr, PHYREG_CONTROL);
-#if defined(TULIP_DEBUG)
-	    if ((data & PHYCTL_AUTONEG_ENABLE) == 0)
-		loudprintf("%s(phy%d): oops: enable autonegotiation failed: 0x%04x\n",
-			   ifp->if_xname, phyaddr, data);
-	    else
-		loudprintf("%s(phy%d): autonegotiation restarted: 0x%04x\n",
-			   ifp->if_xname, phyaddr, data);
-	    sc->tulip_dbg.dbg_nway_starts++;
-#endif
-	    sc->tulip_probe_state = TULIP_PROBE_PHYAUTONEG;
-	    sc->tulip_probe_timeout = 3000;
-	}
-        /* FALLTHROUGH */
-        case TULIP_PROBE_PHYAUTONEG: {
-	    u_int32_t status = tulip_mii_readreg(sc, phyaddr, PHYREG_STATUS);
-	    u_int32_t data;
-	    if ((status & PHYSTS_AUTONEG_DONE) == 0) {
-		if (sc->tulip_probe_timeout > 0) {
-		    tulip_timeout(sc);
-		    return;
-		}
-#if defined(TULIP_DEBUG)
-		loudprintf("%s(phy%d): autonegotiation timeout: sts=0x%04x, ctl=0x%04x\n",
-			   ifp->if_xname, phyaddr, status,
-			   tulip_mii_readreg(sc, phyaddr, PHYREG_CONTROL));
-#endif
-		sc->tulip_flags &= ~TULIP_DIDNWAY;
-		sc->tulip_probe_state = TULIP_PROBE_MEDIATEST;
-		return;
-	    }
-	    data = tulip_mii_readreg(sc, phyaddr, PHYREG_AUTONEG_ABILITIES);
-#if defined(TULIP_DEBUG)
-	    loudprintf("%s(phy%d): autonegotiation complete: 0x%04x\n",
-		       ifp->if_xname, phyaddr, data);
-#endif
-	    data = (data << 6) & status;
-	    if (!tulip_mii_map_abilities(sc, data))
-		sc->tulip_flags &= ~TULIP_DIDNWAY;
-	    return;
-	}
-	default: {
-#if defined(DIAGNOSTIC)
-	    panic("tulip_media_poll: botch at line %d\n", __LINE__);
-#endif
-	    break;
-	}
-    }
-#if defined(TULIP_DEBUG)
-    loudprintf("%s(phy%d): autonegotiation failure: state = %d\n",
-	       ifp->if_xname, phyaddr, sc->tulip_probe_state);
-	    sc->tulip_dbg.dbg_nway_failures++;
-#endif
-}
-
-static void
-tulip_2114x_media_preset(tulip_softc_t * const sc)
-{
-    const tulip_media_info_t *mi = NULL;
-    tulip_media_t media = sc->tulip_media;
-
-    TULIP_LOCK_ASSERT(sc);
-    if (sc->tulip_probe_state == TULIP_PROBE_INACTIVE)
-	media = sc->tulip_media;
-    else
-	media = sc->tulip_probe_media;
-    
-    sc->tulip_cmdmode &= ~TULIP_CMD_PORTSELECT;
-    sc->tulip_flags &= ~TULIP_SQETEST;
-    if (media != TULIP_MEDIA_UNKNOWN && media != TULIP_MEDIA_MAX) {
-#if defined(TULIP_DEBUG)
-	if (media < TULIP_MEDIA_MAX && sc->tulip_mediums[media] != NULL) {
-#endif
-	    mi = sc->tulip_mediums[media];
-	    if (mi->mi_type == TULIP_MEDIAINFO_MII) {
-		sc->tulip_cmdmode |= TULIP_CMD_PORTSELECT;
-	    } else if (mi->mi_type == TULIP_MEDIAINFO_GPR
-		       || mi->mi_type == TULIP_MEDIAINFO_SYM) {
-		sc->tulip_cmdmode &= ~TULIP_GPR_CMDBITS;
-		sc->tulip_cmdmode |= mi->mi_cmdmode;
-	    } else if (mi->mi_type == TULIP_MEDIAINFO_SIA) {
-		TULIP_CSR_WRITE(sc, csr_sia_connectivity, TULIP_SIACONN_RESET);
-	    }
-#if defined(TULIP_DEBUG)
-	} else {
-	    if_printf(sc->tulip_ifp, "preset: bad media %d!\n", media);
-	}
-#endif
-    }
-    switch (media) {
-	case TULIP_MEDIA_BNC:
-	case TULIP_MEDIA_AUI:
-	case TULIP_MEDIA_10BASET: {
-	    sc->tulip_cmdmode &= ~TULIP_CMD_FULLDUPLEX;
-	    sc->tulip_cmdmode |= TULIP_CMD_TXTHRSHLDCTL;
-	    sc->tulip_ifp->if_baudrate = 10000000;
-	    sc->tulip_flags |= TULIP_SQETEST;
-	    break;
-	}
-	case TULIP_MEDIA_10BASET_FD: {
-	    sc->tulip_cmdmode |= TULIP_CMD_FULLDUPLEX|TULIP_CMD_TXTHRSHLDCTL;
-	    sc->tulip_ifp->if_baudrate = 10000000;
-	    break;
-	}
-	case TULIP_MEDIA_100BASEFX:
-	case TULIP_MEDIA_100BASET4:
-	case TULIP_MEDIA_100BASETX: {
-	    sc->tulip_cmdmode &= ~(TULIP_CMD_FULLDUPLEX|TULIP_CMD_TXTHRSHLDCTL);
-	    sc->tulip_cmdmode |= TULIP_CMD_PORTSELECT;
-	    sc->tulip_ifp->if_baudrate = 100000000;
-	    break;
-	}
-	case TULIP_MEDIA_100BASEFX_FD:
-	case TULIP_MEDIA_100BASETX_FD: {
-	    sc->tulip_cmdmode |= TULIP_CMD_FULLDUPLEX|TULIP_CMD_PORTSELECT;
-	    sc->tulip_cmdmode &= ~TULIP_CMD_TXTHRSHLDCTL;
-	    sc->tulip_ifp->if_baudrate = 100000000;
-	    break;
-	}
-	default: {
-	    break;
-	}
-    }
-    TULIP_CSR_WRITE(sc, csr_command, sc->tulip_cmdmode);
-}
-
-/*
- ********************************************************************
- *  Start of 21140/21140A support which does not use the MII interface 
- */
-
-static void
-tulip_null_media_poll(tulip_softc_t * const sc, tulip_mediapoll_event_t event)
-{
-#if defined(TULIP_DEBUG)
-    sc->tulip_dbg.dbg_events[event]++;
-#endif
-#if defined(DIAGNOSTIC)
-    if_printf(sc->tulip_ifp, "botch(media_poll) at line %d\n", __LINE__);
-#endif
-}
-
-__inline static void
-tulip_21140_mediainit(tulip_softc_t * const sc, tulip_media_info_t * const mip,
-    tulip_media_t const media, unsigned gpdata, unsigned cmdmode)
-{
-    TULIP_LOCK_ASSERT(sc);
-    sc->tulip_mediums[media] = mip;
-    mip->mi_type = TULIP_MEDIAINFO_GPR;
-    mip->mi_cmdmode = cmdmode;
-    mip->mi_gpdata = gpdata;
-}
-
-static void
-tulip_21140_evalboard_media_probe(tulip_softc_t * const sc)
-{
-    tulip_media_info_t *mip = sc->tulip_mediainfo;
-
-    TULIP_LOCK_ASSERT(sc);
-    sc->tulip_gpinit = TULIP_GP_EB_PINS;
-    sc->tulip_gpdata = TULIP_GP_EB_INIT;
-    TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_EB_PINS);
-    TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_EB_INIT);
-    TULIP_CSR_WRITE(sc, csr_command,
-	TULIP_CSR_READ(sc, csr_command) | TULIP_CMD_PORTSELECT |
-	TULIP_CMD_PCSFUNCTION | TULIP_CMD_SCRAMBLER | TULIP_CMD_MUSTBEONE);
-    TULIP_CSR_WRITE(sc, csr_command,
-	TULIP_CSR_READ(sc, csr_command) & ~TULIP_CMD_TXTHRSHLDCTL);
-    DELAY(1000000);
-    if ((TULIP_CSR_READ(sc, csr_gp) & TULIP_GP_EB_OK100) != 0) {
-	sc->tulip_media = TULIP_MEDIA_10BASET;
-    } else {
-	sc->tulip_media = TULIP_MEDIA_100BASETX;
-    }
-    tulip_21140_mediainit(sc, mip++, TULIP_MEDIA_10BASET,
-			  TULIP_GP_EB_INIT,
-			  TULIP_CMD_TXTHRSHLDCTL);
-    tulip_21140_mediainit(sc, mip++, TULIP_MEDIA_10BASET_FD,
-			  TULIP_GP_EB_INIT,
-			  TULIP_CMD_TXTHRSHLDCTL|TULIP_CMD_FULLDUPLEX);
-    tulip_21140_mediainit(sc, mip++, TULIP_MEDIA_100BASETX,
-			  TULIP_GP_EB_INIT,
-			  TULIP_CMD_PORTSELECT|TULIP_CMD_PCSFUNCTION
-			      |TULIP_CMD_SCRAMBLER);
-    tulip_21140_mediainit(sc, mip++, TULIP_MEDIA_100BASETX_FD,
-			  TULIP_GP_EB_INIT,
-			  TULIP_CMD_PORTSELECT|TULIP_CMD_PCSFUNCTION
-			      |TULIP_CMD_SCRAMBLER|TULIP_CMD_FULLDUPLEX);
-}
-
-static const tulip_boardsw_t tulip_21140_eb_boardsw = {
-    TULIP_21140_DEC_EB,
-    tulip_21140_evalboard_media_probe,
-    tulip_media_select,
-    tulip_null_media_poll,
-    tulip_2114x_media_preset,
-};
-
-static void
-tulip_21140_accton_media_probe(tulip_softc_t * const sc)
-{
-    tulip_media_info_t *mip = sc->tulip_mediainfo;
-    unsigned gpdata;
-
-    TULIP_LOCK_ASSERT(sc);
-    sc->tulip_gpinit = TULIP_GP_EB_PINS;
-    sc->tulip_gpdata = TULIP_GP_EB_INIT;
-    TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_EB_PINS);
-    TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_EB_INIT);
-    TULIP_CSR_WRITE(sc, csr_command,
-	TULIP_CSR_READ(sc, csr_command) | TULIP_CMD_PORTSELECT |
-	TULIP_CMD_PCSFUNCTION | TULIP_CMD_SCRAMBLER | TULIP_CMD_MUSTBEONE);
-    TULIP_CSR_WRITE(sc, csr_command,
-	TULIP_CSR_READ(sc, csr_command) & ~TULIP_CMD_TXTHRSHLDCTL);
-    DELAY(1000000);
-    gpdata = TULIP_CSR_READ(sc, csr_gp);
-    if ((gpdata & TULIP_GP_EN1207_UTP_INIT) == 0) {
-	sc->tulip_media = TULIP_MEDIA_10BASET;
-    } else {
-	if ((gpdata & TULIP_GP_EN1207_BNC_INIT) == 0) {
-		sc->tulip_media = TULIP_MEDIA_BNC;
-        } else {
-		sc->tulip_media = TULIP_MEDIA_100BASETX;
-        }
-    }
-    tulip_21140_mediainit(sc, mip++, TULIP_MEDIA_BNC,
-			  TULIP_GP_EN1207_BNC_INIT,
-			  TULIP_CMD_TXTHRSHLDCTL);
-    tulip_21140_mediainit(sc, mip++, TULIP_MEDIA_10BASET,
-			  TULIP_GP_EN1207_UTP_INIT,
-			  TULIP_CMD_TXTHRSHLDCTL);
-    tulip_21140_mediainit(sc, mip++, TULIP_MEDIA_10BASET_FD,
-			  TULIP_GP_EN1207_UTP_INIT,
-			  TULIP_CMD_TXTHRSHLDCTL|TULIP_CMD_FULLDUPLEX);
-    tulip_21140_mediainit(sc, mip++, TULIP_MEDIA_100BASETX,
-			  TULIP_GP_EN1207_100_INIT,
-			  TULIP_CMD_PORTSELECT|TULIP_CMD_PCSFUNCTION
-			      |TULIP_CMD_SCRAMBLER);
-    tulip_21140_mediainit(sc, mip++, TULIP_MEDIA_100BASETX_FD,
-			  TULIP_GP_EN1207_100_INIT,
-			  TULIP_CMD_PORTSELECT|TULIP_CMD_PCSFUNCTION
-			      |TULIP_CMD_SCRAMBLER|TULIP_CMD_FULLDUPLEX);
-}
-
-static const tulip_boardsw_t tulip_21140_accton_boardsw = {
-    TULIP_21140_EN1207,
-    tulip_21140_accton_media_probe,
-    tulip_media_select,
-    tulip_null_media_poll,
-    tulip_2114x_media_preset,
-};
-
-static void
-tulip_21140_smc9332_media_probe(tulip_softc_t * const sc)
-{
-    tulip_media_info_t *mip = sc->tulip_mediainfo;
-    int idx, cnt = 0;
-
-    TULIP_LOCK_ASSERT(sc);
-    TULIP_CSR_WRITE(sc, csr_command, TULIP_CMD_PORTSELECT|TULIP_CMD_MUSTBEONE);
-    TULIP_CSR_WRITE(sc, csr_busmode, TULIP_BUSMODE_SWRESET);
-    DELAY(10);	/* Wait 10 microseconds (actually 50 PCI cycles but at 
-		   33MHz that comes to two microseconds but wait a
-		   bit longer anyways) */
-    TULIP_CSR_WRITE(sc, csr_command, TULIP_CMD_PORTSELECT |
-	TULIP_CMD_PCSFUNCTION | TULIP_CMD_SCRAMBLER | TULIP_CMD_MUSTBEONE);
-    sc->tulip_gpinit = TULIP_GP_SMC_9332_PINS;
-    sc->tulip_gpdata = TULIP_GP_SMC_9332_INIT;
-    TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_SMC_9332_PINS|TULIP_GP_PINSET);
-    TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_SMC_9332_INIT);
-    DELAY(200000);
-    for (idx = 1000; idx > 0; idx--) {
-	u_int32_t csr = TULIP_CSR_READ(sc, csr_gp);
-	if ((csr & (TULIP_GP_SMC_9332_OK10|TULIP_GP_SMC_9332_OK100)) == (TULIP_GP_SMC_9332_OK10|TULIP_GP_SMC_9332_OK100)) {
-	    if (++cnt > 100)
-		break;
-	} else if ((csr & TULIP_GP_SMC_9332_OK10) == 0) {
-	    break;
-	} else {
-	    cnt = 0;
-	}
-	DELAY(1000);
-    }
-    sc->tulip_media = cnt > 100 ? TULIP_MEDIA_100BASETX : TULIP_MEDIA_10BASET;
-    tulip_21140_mediainit(sc, mip++, TULIP_MEDIA_100BASETX,
-			  TULIP_GP_SMC_9332_INIT,
-			  TULIP_CMD_PORTSELECT|TULIP_CMD_PCSFUNCTION
-			      |TULIP_CMD_SCRAMBLER);
-    tulip_21140_mediainit(sc, mip++, TULIP_MEDIA_100BASETX_FD,
-			  TULIP_GP_SMC_9332_INIT,
-			  TULIP_CMD_PORTSELECT|TULIP_CMD_PCSFUNCTION
-			      |TULIP_CMD_SCRAMBLER|TULIP_CMD_FULLDUPLEX);
-    tulip_21140_mediainit(sc, mip++, TULIP_MEDIA_10BASET,
-			  TULIP_GP_SMC_9332_INIT,
-			  TULIP_CMD_TXTHRSHLDCTL);
-    tulip_21140_mediainit(sc, mip++, TULIP_MEDIA_10BASET_FD,
-			  TULIP_GP_SMC_9332_INIT,
-			  TULIP_CMD_TXTHRSHLDCTL|TULIP_CMD_FULLDUPLEX);
-}
- 
-static const tulip_boardsw_t tulip_21140_smc9332_boardsw = {
-    TULIP_21140_SMC_9332,
-    tulip_21140_smc9332_media_probe,
-    tulip_media_select,
-    tulip_null_media_poll,
-    tulip_2114x_media_preset,
-};
-
-static void
-tulip_21140_cogent_em100_media_probe(tulip_softc_t * const sc)
-{
-    tulip_media_info_t *mip = sc->tulip_mediainfo;
-    u_int32_t cmdmode = TULIP_CSR_READ(sc, csr_command);
-
-    TULIP_LOCK_ASSERT(sc);
-    sc->tulip_gpinit = TULIP_GP_EM100_PINS;
-    sc->tulip_gpdata = TULIP_GP_EM100_INIT;
-    TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_EM100_PINS);
-    TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_EM100_INIT);
-
-    cmdmode = TULIP_CMD_PORTSELECT|TULIP_CMD_PCSFUNCTION|TULIP_CMD_MUSTBEONE;
-    cmdmode &= ~(TULIP_CMD_TXTHRSHLDCTL|TULIP_CMD_SCRAMBLER);
-    if (sc->tulip_rombuf[32] == TULIP_COGENT_EM100FX_ID) {
-	TULIP_CSR_WRITE(sc, csr_command, cmdmode);
-	sc->tulip_media = TULIP_MEDIA_100BASEFX;
-
-	tulip_21140_mediainit(sc, mip++, TULIP_MEDIA_100BASEFX,
-			  TULIP_GP_EM100_INIT,
-			  TULIP_CMD_PORTSELECT|TULIP_CMD_PCSFUNCTION);
-	tulip_21140_mediainit(sc, mip++, TULIP_MEDIA_100BASEFX_FD,
-			  TULIP_GP_EM100_INIT,
-			  TULIP_CMD_PORTSELECT|TULIP_CMD_PCSFUNCTION
-			      |TULIP_CMD_FULLDUPLEX);
-    } else {
-	TULIP_CSR_WRITE(sc, csr_command, cmdmode|TULIP_CMD_SCRAMBLER);
-	sc->tulip_media = TULIP_MEDIA_100BASETX;
-	tulip_21140_mediainit(sc, mip++, TULIP_MEDIA_100BASETX,
-			  TULIP_GP_EM100_INIT,
-			  TULIP_CMD_PORTSELECT|TULIP_CMD_PCSFUNCTION
-			      |TULIP_CMD_SCRAMBLER);
-	tulip_21140_mediainit(sc, mip++, TULIP_MEDIA_100BASETX_FD,
-			  TULIP_GP_EM100_INIT,
-			  TULIP_CMD_PORTSELECT|TULIP_CMD_PCSFUNCTION
-			      |TULIP_CMD_SCRAMBLER|TULIP_CMD_FULLDUPLEX);
-    }
-}
-
-static const tulip_boardsw_t tulip_21140_cogent_em100_boardsw = {
-    TULIP_21140_COGENT_EM100,
-    tulip_21140_cogent_em100_media_probe,
-    tulip_media_select,
-    tulip_null_media_poll,
-    tulip_2114x_media_preset
-};
-
-static void
-tulip_21140_znyx_zx34x_media_probe(tulip_softc_t * const sc)
-{
-    tulip_media_info_t *mip = sc->tulip_mediainfo;
-    int cnt10 = 0, cnt100 = 0, idx;
-
-    TULIP_LOCK_ASSERT(sc);
-    sc->tulip_gpinit = TULIP_GP_ZX34X_PINS;
-    sc->tulip_gpdata = TULIP_GP_ZX34X_INIT;
-    TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_ZX34X_PINS);
-    TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_ZX34X_INIT);
-    TULIP_CSR_WRITE(sc, csr_command,
-	TULIP_CSR_READ(sc, csr_command) | TULIP_CMD_PORTSELECT |
-	TULIP_CMD_PCSFUNCTION | TULIP_CMD_SCRAMBLER | TULIP_CMD_MUSTBEONE);
-    TULIP_CSR_WRITE(sc, csr_command,
-	TULIP_CSR_READ(sc, csr_command) & ~TULIP_CMD_TXTHRSHLDCTL);
-
-    DELAY(200000);
-    for (idx = 1000; idx > 0; idx--) {
-	u_int32_t csr = TULIP_CSR_READ(sc, csr_gp);
-	if ((csr & (TULIP_GP_ZX34X_LNKFAIL|TULIP_GP_ZX34X_SYMDET|TULIP_GP_ZX34X_SIGDET)) == (TULIP_GP_ZX34X_LNKFAIL|TULIP_GP_ZX34X_SYMDET|TULIP_GP_ZX34X_SIGDET)) {
-	    if (++cnt100 > 100)
-		break;
-	} else if ((csr & TULIP_GP_ZX34X_LNKFAIL) == 0) {
-	    if (++cnt10 > 100)
-		break;
-	} else {
-	    cnt10 = 0;
-	    cnt100 = 0;
-	}
-	DELAY(1000);
-    }
-    sc->tulip_media = cnt100 > 100 ? TULIP_MEDIA_100BASETX : TULIP_MEDIA_10BASET;
-    tulip_21140_mediainit(sc, mip++, TULIP_MEDIA_10BASET,
-			  TULIP_GP_ZX34X_INIT,
-			  TULIP_CMD_TXTHRSHLDCTL);
-    tulip_21140_mediainit(sc, mip++, TULIP_MEDIA_10BASET_FD,
-			  TULIP_GP_ZX34X_INIT,
-			  TULIP_CMD_TXTHRSHLDCTL|TULIP_CMD_FULLDUPLEX);
-    tulip_21140_mediainit(sc, mip++, TULIP_MEDIA_100BASETX,
-			  TULIP_GP_ZX34X_INIT,
-			  TULIP_CMD_PORTSELECT|TULIP_CMD_PCSFUNCTION
-			      |TULIP_CMD_SCRAMBLER);
-    tulip_21140_mediainit(sc, mip++, TULIP_MEDIA_100BASETX_FD,
-			  TULIP_GP_ZX34X_INIT,
-			  TULIP_CMD_PORTSELECT|TULIP_CMD_PCSFUNCTION
-			      |TULIP_CMD_SCRAMBLER|TULIP_CMD_FULLDUPLEX);
-}
-
-static const tulip_boardsw_t tulip_21140_znyx_zx34x_boardsw = {
-    TULIP_21140_ZNYX_ZX34X,
-    tulip_21140_znyx_zx34x_media_probe,
-    tulip_media_select,
-    tulip_null_media_poll,
-    tulip_2114x_media_preset,
-};
-
-static void
-tulip_2114x_media_probe(tulip_softc_t * const sc)
-{
-    TULIP_LOCK_ASSERT(sc);
-    sc->tulip_cmdmode |= TULIP_CMD_MUSTBEONE
-	|TULIP_CMD_BACKOFFCTR|TULIP_CMD_THRSHLD72;
-}
-
-static const tulip_boardsw_t tulip_2114x_isv_boardsw = {
-    TULIP_21140_ISV,
-    tulip_2114x_media_probe,
-    tulip_media_select,
-    tulip_media_poll,
-    tulip_2114x_media_preset,
-};
-
-/*
- * ******** END of chip-specific handlers. ***********
- */
-
-/*
- * Code the read the SROM and MII bit streams (I2C)
- */
-#define EMIT    do { TULIP_CSR_WRITE(sc, csr_srom_mii, csr); DELAY(1); } while (0)
-
-static void
-tulip_srom_idle(tulip_softc_t * const sc)
-{
-    unsigned bit, csr;
-    
-    csr  = SROMSEL ; EMIT;
-    csr  = SROMSEL | SROMRD; EMIT;  
-    csr ^= SROMCS; EMIT;
-    csr ^= SROMCLKON; EMIT;
-
-    /*
-     * Write 25 cycles of 0 which will force the SROM to be idle.
-     */
-    for (bit = 3 + SROM_BITWIDTH + 16; bit > 0; bit--) {
-        csr ^= SROMCLKOFF; EMIT;    /* clock low; data not valid */
-        csr ^= SROMCLKON; EMIT;     /* clock high; data valid */
-    }
-    csr ^= SROMCLKOFF; EMIT;
-    csr ^= SROMCS; EMIT;
-    csr  = 0; EMIT;
-}
-     
-static void
-tulip_srom_read(tulip_softc_t * const sc)
-{   
-    unsigned idx; 
-    const unsigned bitwidth = SROM_BITWIDTH;
-    const unsigned cmdmask = (SROMCMD_RD << bitwidth);
-    const unsigned msb = 1 << (bitwidth + 3 - 1);
-    unsigned lastidx = (1 << bitwidth) - 1;
-
-    tulip_srom_idle(sc);
-
-    for (idx = 0; idx <= lastidx; idx++) {
-        unsigned lastbit, data, bits, bit, csr;
-	csr  = SROMSEL ;	        EMIT;
-        csr  = SROMSEL | SROMRD;        EMIT;
-        csr ^= SROMCSON;                EMIT;
-        csr ^=            SROMCLKON;    EMIT;
-    
-        lastbit = 0;
-        for (bits = idx|cmdmask, bit = bitwidth + 3; bit > 0; bit--, bits <<= 1) {
-            const unsigned thisbit = bits & msb;
-            csr ^= SROMCLKOFF; EMIT;    /* clock low; data not valid */
-            if (thisbit != lastbit) {
-                csr ^= SROMDOUT; EMIT;  /* clock low; invert data */
-            } else {
-		EMIT;
-	    }
-            csr ^= SROMCLKON; EMIT;     /* clock high; data valid */
-            lastbit = thisbit;
-        }
-        csr ^= SROMCLKOFF; EMIT;
-
-        for (data = 0, bits = 0; bits < 16; bits++) {
-            data <<= 1;
-            csr ^= SROMCLKON; EMIT;     /* clock high; data valid */ 
-            data |= TULIP_CSR_READ(sc, csr_srom_mii) & SROMDIN ? 1 : 0;
-            csr ^= SROMCLKOFF; EMIT;    /* clock low; data not valid */
-        }
-	sc->tulip_rombuf[idx*2] = data & 0xFF;
-	sc->tulip_rombuf[idx*2+1] = data >> 8;
-	csr  = SROMSEL | SROMRD; EMIT;
-	csr  = 0; EMIT;
-    }
-    tulip_srom_idle(sc);
-}
-
-#define MII_EMIT    do { TULIP_CSR_WRITE(sc, csr_srom_mii, csr); DELAY(1); } while (0)
-
-static void
-tulip_mii_writebits(tulip_softc_t * const sc, unsigned data, unsigned bits)
-{
-    unsigned msb = 1 << (bits - 1);
-    unsigned csr = TULIP_CSR_READ(sc, csr_srom_mii) & (MII_RD|MII_DOUT|MII_CLK);
-    unsigned lastbit = (csr & MII_DOUT) ? msb : 0;
-
-    TULIP_LOCK_ASSERT(sc);
-    csr |= MII_WR; MII_EMIT;  		/* clock low; assert write */
-
-    for (; bits > 0; bits--, data <<= 1) {
-	const unsigned thisbit = data & msb;
-	if (thisbit != lastbit) {
-	    csr ^= MII_DOUT; MII_EMIT;  /* clock low; invert data */
-	}
-	csr ^= MII_CLKON; MII_EMIT;     /* clock high; data valid */
-	lastbit = thisbit;
-	csr ^= MII_CLKOFF; MII_EMIT;    /* clock low; data not valid */
-    }
-}
-
-static void
-tulip_mii_turnaround(tulip_softc_t * const sc, unsigned cmd)
-{
-    unsigned csr = TULIP_CSR_READ(sc, csr_srom_mii) & (MII_RD|MII_DOUT|MII_CLK);
-
-    TULIP_LOCK_ASSERT(sc);
-    if (cmd == MII_WRCMD) {
-	csr |= MII_DOUT; MII_EMIT;	/* clock low; change data */
-	csr ^= MII_CLKON; MII_EMIT;	/* clock high; data valid */
-	csr ^= MII_CLKOFF; MII_EMIT;	/* clock low; data not valid */
-	csr ^= MII_DOUT; MII_EMIT;	/* clock low; change data */
-    } else {
-	csr |= MII_RD; MII_EMIT;	/* clock low; switch to read */
-    }
-    csr ^= MII_CLKON; MII_EMIT;		/* clock high; data valid */
-    csr ^= MII_CLKOFF; MII_EMIT;	/* clock low; data not valid */
-}
-
-static unsigned
-tulip_mii_readbits(tulip_softc_t * const sc)
-{
-    unsigned data;
-    unsigned csr = TULIP_CSR_READ(sc, csr_srom_mii) & (MII_RD|MII_DOUT|MII_CLK);
-    int idx;
-
-    TULIP_LOCK_ASSERT(sc);
-    for (idx = 0, data = 0; idx < 16; idx++) {
-	data <<= 1;	/* this is NOOP on the first pass through */
-	csr ^= MII_CLKON; MII_EMIT;	/* clock high; data valid */
-	if (TULIP_CSR_READ(sc, csr_srom_mii) & MII_DIN)
-	    data |= 1;
-	csr ^= MII_CLKOFF; MII_EMIT;	/* clock low; data not valid */
-    }
-    csr ^= MII_RD; MII_EMIT;		/* clock low; turn off read */
-
-    return data;
-}
-
-static unsigned
-tulip_mii_readreg(tulip_softc_t * const sc, unsigned devaddr, unsigned regno)
-{
-    unsigned csr = TULIP_CSR_READ(sc, csr_srom_mii) & (MII_RD|MII_DOUT|MII_CLK);
-    unsigned data;
-
-    TULIP_LOCK_ASSERT(sc);
-    csr &= ~(MII_RD|MII_CLK); MII_EMIT;
-    tulip_mii_writebits(sc, MII_PREAMBLE, 32);
-    tulip_mii_writebits(sc, MII_RDCMD, 8);
-    tulip_mii_writebits(sc, devaddr, 5);
-    tulip_mii_writebits(sc, regno, 5);
-    tulip_mii_turnaround(sc, MII_RDCMD);
-
-    data = tulip_mii_readbits(sc);
-#if defined(TULIP_DEBUG)
-    sc->tulip_dbg.dbg_phyregs[regno][0] = data;
-    sc->tulip_dbg.dbg_phyregs[regno][1]++;
-#endif
-    return data;
-}
-
-static void
-tulip_mii_writereg(tulip_softc_t * const sc, unsigned devaddr, unsigned regno,
-    unsigned data)
-{
-    unsigned csr = TULIP_CSR_READ(sc, csr_srom_mii) & (MII_RD|MII_DOUT|MII_CLK);
-
-    TULIP_LOCK_ASSERT(sc);
-    csr &= ~(MII_RD|MII_CLK); MII_EMIT;
-    tulip_mii_writebits(sc, MII_PREAMBLE, 32);
-    tulip_mii_writebits(sc, MII_WRCMD, 8);
-    tulip_mii_writebits(sc, devaddr, 5);
-    tulip_mii_writebits(sc, regno, 5);
-    tulip_mii_turnaround(sc, MII_WRCMD);
-    tulip_mii_writebits(sc, data, 16);
-#if defined(TULIP_DEBUG)
-    sc->tulip_dbg.dbg_phyregs[regno][2] = data;
-    sc->tulip_dbg.dbg_phyregs[regno][3]++;
-#endif
-}
-
-#define	tulip_mchash(mca)	(ether_crc32_le(mca, 6) & 0x1FF)
-#define	tulip_srom_crcok(databuf)	( \
-    ((ether_crc32_le(databuf, 126) & 0xFFFFU) ^ 0xFFFFU) == \
-     ((databuf)[126] | ((databuf)[127] << 8)))
-
-static void
-tulip_identify_dec_nic(tulip_softc_t * const sc)
-{
-    TULIP_LOCK_ASSERT(sc);
-    strcpy(sc->tulip_boardid, "DEC ");
-#define D0	4
-    if (sc->tulip_chipid <= TULIP_21040)
-	return;
-    if (bcmp(sc->tulip_rombuf + 29, "DE500", 5) == 0
-	|| bcmp(sc->tulip_rombuf + 29, "DE450", 5) == 0) {
-	bcopy(sc->tulip_rombuf + 29, &sc->tulip_boardid[D0], 8);
-	sc->tulip_boardid[D0+8] = ' ';
-    }
-#undef D0
-}
-
-static void
-tulip_identify_znyx_nic(tulip_softc_t * const sc)
-{
-    unsigned id = 0;
-
-    TULIP_LOCK_ASSERT(sc);
-    strcpy(sc->tulip_boardid, "ZNYX ZX3XX ");
-    if (sc->tulip_chipid == TULIP_21140 || sc->tulip_chipid == TULIP_21140A) {
-	unsigned znyx_ptr;
-	sc->tulip_boardid[8] = '4';
-	znyx_ptr = sc->tulip_rombuf[124] + 256 * sc->tulip_rombuf[125];
-	if (znyx_ptr < 26 || znyx_ptr > 116) {
-	    sc->tulip_boardsw = &tulip_21140_znyx_zx34x_boardsw;
-	    return;
-	}
-	/* ZX344 = 0010 .. 0013FF
-	 */
-	if (sc->tulip_rombuf[znyx_ptr] == 0x4A
-		&& sc->tulip_rombuf[znyx_ptr + 1] == 0x52
-		&& sc->tulip_rombuf[znyx_ptr + 2] == 0x01) {
-	    id = sc->tulip_rombuf[znyx_ptr + 5] + 256 * sc->tulip_rombuf[znyx_ptr + 4];
-	    if ((id >> 8) == (TULIP_ZNYX_ID_ZX342 >> 8)) {
-		sc->tulip_boardid[9] = '2';
-		if (id == TULIP_ZNYX_ID_ZX342B) {
-		    sc->tulip_boardid[10] = 'B';
-		    sc->tulip_boardid[11] = ' ';
-		}
-		sc->tulip_boardsw = &tulip_21140_znyx_zx34x_boardsw;
-	    } else if (id == TULIP_ZNYX_ID_ZX344) {
-		sc->tulip_boardid[10] = '4';
-		sc->tulip_boardsw = &tulip_21140_znyx_zx34x_boardsw;
-	    } else if (id == TULIP_ZNYX_ID_ZX345) {
-		sc->tulip_boardid[9] = (sc->tulip_rombuf[19] > 1) ? '8' : '5';
-	    } else if (id == TULIP_ZNYX_ID_ZX346) {
-		sc->tulip_boardid[9] = '6';
-	    } else if (id == TULIP_ZNYX_ID_ZX351) {
-		sc->tulip_boardid[8] = '5';
-		sc->tulip_boardid[9] = '1';
-	    }
-	}
-	if (id == 0) {
-	    /*
-	     * Assume it's a ZX342...
-	     */
-	    sc->tulip_boardsw = &tulip_21140_znyx_zx34x_boardsw;
-	}
-	return;
-    }
-    sc->tulip_boardid[8] = '1';
-    if (sc->tulip_chipid == TULIP_21041) {
-	sc->tulip_boardid[10] = '1';
-	return;
-    }
-    if (sc->tulip_rombuf[32] == 0x4A && sc->tulip_rombuf[33] == 0x52) {
-	id = sc->tulip_rombuf[37] + 256 * sc->tulip_rombuf[36];
-	if (id == TULIP_ZNYX_ID_ZX312T) {
-	    sc->tulip_boardid[9] = '2';
-	    sc->tulip_boardid[10] = 'T';
-	    sc->tulip_boardid[11] = ' ';
-	    sc->tulip_boardsw = &tulip_21040_10baset_only_boardsw;
-	} else if (id == TULIP_ZNYX_ID_ZX314_INTA) {
-	    sc->tulip_boardid[9] = '4';
-	    sc->tulip_boardsw = &tulip_21040_10baset_only_boardsw;
-	    sc->tulip_features |= TULIP_HAVE_SHAREDINTR|TULIP_HAVE_BASEROM;
-	} else if (id == TULIP_ZNYX_ID_ZX314) {
-	    sc->tulip_boardid[9] = '4';
-	    sc->tulip_boardsw = &tulip_21040_10baset_only_boardsw;
-	    sc->tulip_features |= TULIP_HAVE_BASEROM;
-	} else if (id == TULIP_ZNYX_ID_ZX315_INTA) {
-	    sc->tulip_boardid[9] = '5';
-	    sc->tulip_features |= TULIP_HAVE_SHAREDINTR|TULIP_HAVE_BASEROM;
-	} else if (id == TULIP_ZNYX_ID_ZX315) {
-	    sc->tulip_boardid[9] = '5';
-	    sc->tulip_features |= TULIP_HAVE_BASEROM;
-	} else {
-	    id = 0;
-	}
-    }		    
-    if (id == 0) {
-	if ((sc->tulip_enaddr[3] & ~3) == 0xF0 && (sc->tulip_enaddr[5] & 2) == 0) {
-	    sc->tulip_boardid[9] = '4';
-	    sc->tulip_boardsw = &tulip_21040_10baset_only_boardsw;
-	    sc->tulip_features |= TULIP_HAVE_SHAREDINTR|TULIP_HAVE_BASEROM;
-	} else if ((sc->tulip_enaddr[3] & ~3) == 0xF4 && (sc->tulip_enaddr[5] & 1) == 0) {
-	    sc->tulip_boardid[9] = '5';
-	    sc->tulip_boardsw = &tulip_21040_boardsw;
-	    sc->tulip_features |= TULIP_HAVE_SHAREDINTR|TULIP_HAVE_BASEROM;
-	} else if ((sc->tulip_enaddr[3] & ~3) == 0xEC) {
-	    sc->tulip_boardid[9] = '2';
-	    sc->tulip_boardsw = &tulip_21040_boardsw;
-	}
-    }
-}
-
-static void
-tulip_identify_smc_nic(tulip_softc_t * const sc)
-{
-    u_int32_t id1, id2, ei;
-    int auibnc = 0, utp = 0;
-    char *cp;
-
-    TULIP_LOCK_ASSERT(sc);
-    strcpy(sc->tulip_boardid, "SMC ");
-    if (sc->tulip_chipid == TULIP_21041)
-	return;
-    if (sc->tulip_chipid != TULIP_21040) {
-	if (sc->tulip_boardsw != &tulip_2114x_isv_boardsw) {
-	    strcpy(&sc->tulip_boardid[4], "9332DST ");
-	    sc->tulip_boardsw = &tulip_21140_smc9332_boardsw;
-	} else if (sc->tulip_features & (TULIP_HAVE_BASEROM|TULIP_HAVE_SLAVEDROM)) {
-	    strcpy(&sc->tulip_boardid[4], "9334BDT ");
-	} else {
-	    strcpy(&sc->tulip_boardid[4], "9332BDT ");
-	}
-	return;
-    }
-    id1 = sc->tulip_rombuf[0x60] | (sc->tulip_rombuf[0x61] << 8);
-    id2 = sc->tulip_rombuf[0x62] | (sc->tulip_rombuf[0x63] << 8);
-    ei  = sc->tulip_rombuf[0x66] | (sc->tulip_rombuf[0x67] << 8);
-
-    strcpy(&sc->tulip_boardid[4], "8432");
-    cp = &sc->tulip_boardid[8];
-    if ((id1 & 1) == 0)
-	*cp++ = 'B', auibnc = 1;
-    if ((id1 & 0xFF) > 0x32)
-	*cp++ = 'T', utp = 1;
-    if ((id1 & 0x4000) == 0)
-	*cp++ = 'A', auibnc = 1;
-    if (id2 == 0x15) {
-	sc->tulip_boardid[7] = '4';
-	*cp++ = '-';
-	*cp++ = 'C';
-	*cp++ = 'H';
-	*cp++ = (ei ? '2' : '1');
-    }
-    *cp++ = ' ';
-    *cp = '\0';
-    if (utp && !auibnc)
-	sc->tulip_boardsw = &tulip_21040_10baset_only_boardsw;
-    else if (!utp && auibnc)
-	sc->tulip_boardsw = &tulip_21040_auibnc_only_boardsw;
-}
-
-static void
-tulip_identify_cogent_nic(tulip_softc_t * const sc)
-{
-    TULIP_LOCK_ASSERT(sc);
-    strcpy(sc->tulip_boardid, "Cogent ");
-    if (sc->tulip_chipid == TULIP_21140 || sc->tulip_chipid == TULIP_21140A) {
-	if (sc->tulip_rombuf[32] == TULIP_COGENT_EM100TX_ID) {
-	    strcat(sc->tulip_boardid, "EM100TX ");
-	    sc->tulip_boardsw = &tulip_21140_cogent_em100_boardsw;
-#if defined(TULIP_COGENT_EM110TX_ID)
-	} else if (sc->tulip_rombuf[32] == TULIP_COGENT_EM110TX_ID) {
-	    strcat(sc->tulip_boardid, "EM110TX ");
-	    sc->tulip_boardsw = &tulip_21140_cogent_em100_boardsw;
-#endif
-	} else if (sc->tulip_rombuf[32] == TULIP_COGENT_EM100FX_ID) {
-	    strcat(sc->tulip_boardid, "EM100FX ");
-	    sc->tulip_boardsw = &tulip_21140_cogent_em100_boardsw;
-	}
-	/*
-	 * Magic number (0x24001109U) is the SubVendor (0x2400) and
-	 * SubDevId (0x1109) for the ANA6944TX (EM440TX).
-	 */
-	if (*(u_int32_t *) sc->tulip_rombuf == 0x24001109U
-		&& (sc->tulip_features & TULIP_HAVE_BASEROM)) {
-	    /*
-	     * Cogent (Adaptec) is still mapping all INTs to INTA of
-	     * first 21140.  Dumb!  Dumb!
-	     */
-	    strcat(sc->tulip_boardid, "EM440TX ");
-	    sc->tulip_features |= TULIP_HAVE_SHAREDINTR;
-	}
-    } else if (sc->tulip_chipid == TULIP_21040) {
-	sc->tulip_features |= TULIP_HAVE_SHAREDINTR|TULIP_HAVE_BASEROM;
-    }
-}
-
-static void
-tulip_identify_accton_nic(tulip_softc_t * const sc)
-{
-    TULIP_LOCK_ASSERT(sc);
-    strcpy(sc->tulip_boardid, "ACCTON ");
-    switch (sc->tulip_chipid) {
-	case TULIP_21140A:
-	    strcat(sc->tulip_boardid, "EN1207 ");
-	    if (sc->tulip_boardsw != &tulip_2114x_isv_boardsw)
-		sc->tulip_boardsw = &tulip_21140_accton_boardsw;
-	    break;
-	case TULIP_21140:
-	    strcat(sc->tulip_boardid, "EN1207TX ");
-	    if (sc->tulip_boardsw != &tulip_2114x_isv_boardsw)
-		sc->tulip_boardsw = &tulip_21140_eb_boardsw;
-            break;
-        case TULIP_21040:
-	    strcat(sc->tulip_boardid, "EN1203 ");
-            sc->tulip_boardsw = &tulip_21040_boardsw;
-            break;
-        case TULIP_21041:
-	    strcat(sc->tulip_boardid, "EN1203 ");
-            sc->tulip_boardsw = &tulip_21041_boardsw;
-            break;
-	default:
-            sc->tulip_boardsw = &tulip_2114x_isv_boardsw;
-            break;
-    }
-}
-
-static void
-tulip_identify_asante_nic(tulip_softc_t * const sc)
-{
-    TULIP_LOCK_ASSERT(sc);
-    strcpy(sc->tulip_boardid, "Asante ");
-    if ((sc->tulip_chipid == TULIP_21140 || sc->tulip_chipid == TULIP_21140A)
-	    && sc->tulip_boardsw != &tulip_2114x_isv_boardsw) {
-	tulip_media_info_t *mi = sc->tulip_mediainfo;
-	int idx;
-	/*
-	 * The Asante Fast Ethernet doesn't always ship with a valid
-	 * new format SROM.  So if isn't in the new format, we cheat
-	 * set it up as if we had.
-	 */
-
-	sc->tulip_gpinit = TULIP_GP_ASANTE_PINS;
-	sc->tulip_gpdata = 0;
-
-	TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_ASANTE_PINS|TULIP_GP_PINSET);
-	TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_ASANTE_PHYRESET);
-	DELAY(100);
-	TULIP_CSR_WRITE(sc, csr_gp, 0);
-
-	mi->mi_type = TULIP_MEDIAINFO_MII;
-	mi->mi_gpr_length = 0;
-	mi->mi_gpr_offset = 0;
-	mi->mi_reset_length = 0;
-	mi->mi_reset_offset = 0;;
-
-	mi->mi_phyaddr = TULIP_MII_NOPHY;
-	for (idx = 20; idx > 0 && mi->mi_phyaddr == TULIP_MII_NOPHY; idx--) {
-	    DELAY(10000);
-	    mi->mi_phyaddr = tulip_mii_get_phyaddr(sc, 0);
-	}
-	if (mi->mi_phyaddr == TULIP_MII_NOPHY) {
-	    if_printf(sc->tulip_ifp, "can't find phy 0\n");
-	    return;
-	}
-
-	sc->tulip_features |= TULIP_HAVE_MII;
-	mi->mi_capabilities  = PHYSTS_10BASET|PHYSTS_10BASET_FD|PHYSTS_100BASETX|PHYSTS_100BASETX_FD;
-	mi->mi_advertisement = PHYSTS_10BASET|PHYSTS_10BASET_FD|PHYSTS_100BASETX|PHYSTS_100BASETX_FD;
-	mi->mi_full_duplex   = PHYSTS_10BASET_FD|PHYSTS_100BASETX_FD;
-	mi->mi_tx_threshold  = PHYSTS_10BASET|PHYSTS_10BASET_FD;
-	TULIP_MEDIAINFO_ADD_CAPABILITY(sc, mi, 100BASETX_FD);
-	TULIP_MEDIAINFO_ADD_CAPABILITY(sc, mi, 100BASETX);
-	TULIP_MEDIAINFO_ADD_CAPABILITY(sc, mi, 100BASET4);
-	TULIP_MEDIAINFO_ADD_CAPABILITY(sc, mi, 10BASET_FD);
-	TULIP_MEDIAINFO_ADD_CAPABILITY(sc, mi, 10BASET);
-	mi->mi_phyid = (tulip_mii_readreg(sc, mi->mi_phyaddr, PHYREG_IDLOW) << 16) |
-	    tulip_mii_readreg(sc, mi->mi_phyaddr, PHYREG_IDHIGH);
-
-	sc->tulip_boardsw = &tulip_2114x_isv_boardsw;
-    }
-}
-
-static void
-tulip_identify_compex_nic(tulip_softc_t * const sc)
-{
-    TULIP_LOCK_ASSERT(sc);
-    strcpy(sc->tulip_boardid, "COMPEX ");
-    if (sc->tulip_chipid == TULIP_21140A) {
-	int root_unit;
-	tulip_softc_t *root_sc = NULL;
-
-	strcat(sc->tulip_boardid, "400TX/PCI ");
-	/*
-	 * All 4 chips on these boards share an interrupt.  This code
-	 * copied from tulip_read_macaddr.
-	 */
-	sc->tulip_features |= TULIP_HAVE_SHAREDINTR;
-	for (root_unit = sc->tulip_unit - 1; root_unit >= 0; root_unit--) {
-	    root_sc = tulips[root_unit];
-	    if (root_sc == NULL
-		|| !(root_sc->tulip_features & TULIP_HAVE_SLAVEDINTR))
-		break;
-	    root_sc = NULL;
-	}
-	if (root_sc != NULL
-	    && root_sc->tulip_chipid == sc->tulip_chipid
-	    && root_sc->tulip_pci_busno == sc->tulip_pci_busno) {
-	    sc->tulip_features |= TULIP_HAVE_SLAVEDINTR;
-	    sc->tulip_slaves = root_sc->tulip_slaves;
-	    root_sc->tulip_slaves = sc;
-	} else if(sc->tulip_features & TULIP_HAVE_SLAVEDINTR) {
-	    printf("\nCannot find master device for %s interrupts",
-		   sc->tulip_ifp->if_xname);
-	}
-    } else {
-	strcat(sc->tulip_boardid, "unknown ");
-    }
-    /*      sc->tulip_boardsw = &tulip_21140_eb_boardsw; */
-    return;
-}
-
-static int
-tulip_srom_decode(tulip_softc_t * const sc)
-{
-    unsigned idx1, idx2, idx3;
-
-    const tulip_srom_header_t *shp = (const tulip_srom_header_t *) &sc->tulip_rombuf[0];
-    const tulip_srom_adapter_info_t *saip = (const tulip_srom_adapter_info_t *) (shp + 1);
-    tulip_srom_media_t srom_media;
-    tulip_media_info_t *mi = sc->tulip_mediainfo;
-    const u_int8_t *dp;
-    u_int32_t leaf_offset, blocks, data;
-
-    TULIP_LOCK_ASSERT(sc);
-    for (idx1 = 0; idx1 < shp->sh_adapter_count; idx1++, saip++) {
-	if (shp->sh_adapter_count == 1)
-	    break;
-	if (saip->sai_device == sc->tulip_pci_devno)
-	    break;
-    }
-    /*
-     * Didn't find the right media block for this card.
-     */
-    if (idx1 == shp->sh_adapter_count)
-	return 0;
-
-    /*
-     * Save the hardware address.
-     */
-    bcopy(shp->sh_ieee802_address, sc->tulip_enaddr, 6);
-    /*
-     * If this is a multiple port card, add the adapter index to the last
-     * byte of the hardware address.  (if it isn't multiport, adding 0
-     * won't hurt.
-     */
-    sc->tulip_enaddr[5] += idx1;
-
-    leaf_offset = saip->sai_leaf_offset_lowbyte
-	+ saip->sai_leaf_offset_highbyte * 256;
-    dp = sc->tulip_rombuf + leaf_offset;
-	
-    sc->tulip_conntype = (tulip_srom_connection_t) (dp[0] + dp[1] * 256); dp += 2;
-
-    for (idx2 = 0;; idx2++) {
-	if (tulip_srom_conninfo[idx2].sc_type == sc->tulip_conntype
-	        || tulip_srom_conninfo[idx2].sc_type == TULIP_SROM_CONNTYPE_NOT_USED)
-	    break;
-    }
-    sc->tulip_connidx = idx2;
-
-    if (sc->tulip_chipid == TULIP_21041) {
-	blocks = *dp++;
-	for (idx2 = 0; idx2 < blocks; idx2++) {
-	    tulip_media_t media;
-	    data = *dp++;
-	    srom_media = (tulip_srom_media_t) (data & 0x3F);
-	    for (idx3 = 0; tulip_srom_mediums[idx3].sm_type != TULIP_MEDIA_UNKNOWN; idx3++) {
-		if (tulip_srom_mediums[idx3].sm_srom_type == srom_media)
-		    break;
-	    }
-	    media = tulip_srom_mediums[idx3].sm_type;
-	    if (media != TULIP_MEDIA_UNKNOWN) {
-		if (data & TULIP_SROM_21041_EXTENDED) {
-		    mi->mi_type = TULIP_MEDIAINFO_SIA;
-		    sc->tulip_mediums[media] = mi;
-		    mi->mi_sia_connectivity = dp[0] + dp[1] * 256;
-		    mi->mi_sia_tx_rx        = dp[2] + dp[3] * 256;
-		    mi->mi_sia_general      = dp[4] + dp[5] * 256;
-		    mi++;
-		} else {
-		    switch (media) {
-			case TULIP_MEDIA_BNC: {
-			    TULIP_MEDIAINFO_SIA_INIT(sc, mi, 21041, BNC);
-			    mi++;
-			    break;
-			}
-			case TULIP_MEDIA_AUI: {
-			    TULIP_MEDIAINFO_SIA_INIT(sc, mi, 21041, AUI);
-			    mi++;
-			    break;
-			}
-			case TULIP_MEDIA_10BASET: {
-			    TULIP_MEDIAINFO_SIA_INIT(sc, mi, 21041, 10BASET);
-			    mi++;
-			    break;
-			}
-			case TULIP_MEDIA_10BASET_FD: {
-			    TULIP_MEDIAINFO_SIA_INIT(sc, mi, 21041, 10BASET_FD);
-			    mi++;
-			    break;
-			}
-			default: {
-			    break;
-			}
-		    }
-		}
-	    }
-	    if (data & TULIP_SROM_21041_EXTENDED)	
-		dp += 6;
-	}
-#ifdef notdef
-	if (blocks == 0) {
-	    TULIP_MEDIAINFO_SIA_INIT(sc, mi, 21041, BNC); mi++;
-	    TULIP_MEDIAINFO_SIA_INIT(sc, mi, 21041, AUI); mi++;
-	    TULIP_MEDIAINFO_SIA_INIT(sc, mi, 21041, 10BASET); mi++;
-	    TULIP_MEDIAINFO_SIA_INIT(sc, mi, 21041, 10BASET_FD); mi++;
-	}
-#endif
-    } else {
-	unsigned length, type;
-	tulip_media_t gp_media = TULIP_MEDIA_UNKNOWN;
-	if (sc->tulip_features & TULIP_HAVE_GPR)
-	    sc->tulip_gpinit = *dp++;
-	blocks = *dp++;
-	for (idx2 = 0; idx2 < blocks; idx2++) {
-	    const u_int8_t *ep;
-	    if ((*dp & 0x80) == 0) {
-		length = 4;
-		type = 0;
-	    } else {
-		length = (*dp++ & 0x7f) - 1;
-		type = *dp++ & 0x3f;
-	    }
-	    ep = dp + length;
-	    switch (type & 0x3f) {
-		case 0: {	/* 21140[A] GPR block */
-		    tulip_media_t media;
-		    srom_media = (tulip_srom_media_t)(dp[0] & 0x3f);
-		    for (idx3 = 0; tulip_srom_mediums[idx3].sm_type != TULIP_MEDIA_UNKNOWN; idx3++) {
-			if (tulip_srom_mediums[idx3].sm_srom_type == srom_media)
-			    break;
-		    }
-		    media = tulip_srom_mediums[idx3].sm_type;
-		    if (media == TULIP_MEDIA_UNKNOWN)
-			break;
-		    mi->mi_type = TULIP_MEDIAINFO_GPR;
-		    sc->tulip_mediums[media] = mi;
-		    mi->mi_gpdata = dp[1];
-		    if (media > gp_media && !TULIP_IS_MEDIA_FD(media)) {
-			sc->tulip_gpdata = mi->mi_gpdata;
-			gp_media = media;
-		    }
-		    data = dp[2] + dp[3] * 256;
-		    mi->mi_cmdmode = TULIP_SROM_2114X_CMDBITS(data);
-		    if (data & TULIP_SROM_2114X_NOINDICATOR) {
-			mi->mi_actmask = 0;
-		    } else {
-#if 0
-			mi->mi_default = (data & TULIP_SROM_2114X_DEFAULT) != 0;
-#endif
-			mi->mi_actmask = TULIP_SROM_2114X_BITPOS(data);
-			mi->mi_actdata = (data & TULIP_SROM_2114X_POLARITY) ? 0 : mi->mi_actmask;
-		    }
-		    mi++;
-		    break;
-		}
-		case 1: {	/* 21140[A] MII block */
-		    const unsigned phyno = *dp++;
-		    mi->mi_type = TULIP_MEDIAINFO_MII;
-		    mi->mi_gpr_length = *dp++;
-		    mi->mi_gpr_offset = dp - sc->tulip_rombuf;
-		    dp += mi->mi_gpr_length;
-		    mi->mi_reset_length = *dp++;
-		    mi->mi_reset_offset = dp - sc->tulip_rombuf;
-		    dp += mi->mi_reset_length;
-
-		    /*
-		     * Before we probe for a PHY, use the GPR information
-		     * to select it.  If we don't, it may be inaccessible.
-		     */
-		    TULIP_CSR_WRITE(sc, csr_gp, sc->tulip_gpinit|TULIP_GP_PINSET);
-		    for (idx3 = 0; idx3 < mi->mi_reset_length; idx3++) {
-			DELAY(10);
-			TULIP_CSR_WRITE(sc, csr_gp, sc->tulip_rombuf[mi->mi_reset_offset + idx3]);
-		    }
-		    sc->tulip_phyaddr = mi->mi_phyaddr;
-		    for (idx3 = 0; idx3 < mi->mi_gpr_length; idx3++) {
-			DELAY(10);
-			TULIP_CSR_WRITE(sc, csr_gp, sc->tulip_rombuf[mi->mi_gpr_offset + idx3]);
-		    }
-
-		    /*
-		     * At least write something!
-		     */
-		    if (mi->mi_reset_length == 0 && mi->mi_gpr_length == 0)
-			TULIP_CSR_WRITE(sc, csr_gp, 0);
-
-		    mi->mi_phyaddr = TULIP_MII_NOPHY;
-		    for (idx3 = 20; idx3 > 0 && mi->mi_phyaddr == TULIP_MII_NOPHY; idx3--) {
-			DELAY(10000);
-			mi->mi_phyaddr = tulip_mii_get_phyaddr(sc, phyno);
-		    }
-		    if (mi->mi_phyaddr == TULIP_MII_NOPHY) {
-#if defined(TULIP_DEBUG)
-			if_printf(sc->tulip_ifp, "can't find phy %d\n",
-			    phyno);
-#endif
-			break;
-		    }
-		    sc->tulip_features |= TULIP_HAVE_MII;
-		    mi->mi_capabilities  = dp[0] + dp[1] * 256; dp += 2;
-		    mi->mi_advertisement = dp[0] + dp[1] * 256; dp += 2;
-		    mi->mi_full_duplex   = dp[0] + dp[1] * 256; dp += 2;
-		    mi->mi_tx_threshold  = dp[0] + dp[1] * 256; dp += 2;
-		    TULIP_MEDIAINFO_ADD_CAPABILITY(sc, mi, 100BASETX_FD);
-		    TULIP_MEDIAINFO_ADD_CAPABILITY(sc, mi, 100BASETX);
-		    TULIP_MEDIAINFO_ADD_CAPABILITY(sc, mi, 100BASET4);
-		    TULIP_MEDIAINFO_ADD_CAPABILITY(sc, mi, 10BASET_FD);
-		    TULIP_MEDIAINFO_ADD_CAPABILITY(sc, mi, 10BASET);
-		    mi->mi_phyid = (tulip_mii_readreg(sc, mi->mi_phyaddr, PHYREG_IDLOW) << 16) |
-			tulip_mii_readreg(sc, mi->mi_phyaddr, PHYREG_IDHIGH);
-		    mi++;
-		    break;
-		}
-		case 2: {	/* 2114[23] SIA block */
-		    tulip_media_t media;
-		    srom_media = (tulip_srom_media_t)(dp[0] & 0x3f);
-		    for (idx3 = 0; tulip_srom_mediums[idx3].sm_type != TULIP_MEDIA_UNKNOWN; idx3++) {
-			if (tulip_srom_mediums[idx3].sm_srom_type == srom_media)
-			    break;
-		    }
-		    media = tulip_srom_mediums[idx3].sm_type;
-		    if (media == TULIP_MEDIA_UNKNOWN)
-			break;
-		    mi->mi_type = TULIP_MEDIAINFO_SIA;
-		    sc->tulip_mediums[media] = mi;
-		    if (dp[0] & 0x40) {
-			mi->mi_sia_connectivity = dp[1] + dp[2] * 256;
-			mi->mi_sia_tx_rx        = dp[3] + dp[4] * 256;
-			mi->mi_sia_general      = dp[5] + dp[6] * 256;
-			dp += 6;
-		    } else {
-			switch (media) {
-			    case TULIP_MEDIA_BNC: {
-				TULIP_MEDIAINFO_SIA_INIT(sc, mi, 21142, BNC);
-				break;
-			    }
-			    case TULIP_MEDIA_AUI: {
-				TULIP_MEDIAINFO_SIA_INIT(sc, mi, 21142, AUI);
-				break;
-			    }
-			    case TULIP_MEDIA_10BASET: {
-				TULIP_MEDIAINFO_SIA_INIT(sc, mi, 21142, 10BASET);
-				sc->tulip_intrmask |= TULIP_STS_LINKPASS|TULIP_STS_LINKFAIL;
-				break;
-			    }
-			    case TULIP_MEDIA_10BASET_FD: {
-				TULIP_MEDIAINFO_SIA_INIT(sc, mi, 21142, 10BASET_FD);
-				sc->tulip_intrmask |= TULIP_STS_LINKPASS|TULIP_STS_LINKFAIL;
-				break;
-			    }
-			    default: {
-				goto bad_media;
-			    }
-			}
-		    }
-		    mi->mi_sia_gp_control = (dp[1] + dp[2] * 256) << 16;
-		    mi->mi_sia_gp_data    = (dp[3] + dp[4] * 256) << 16;
-		    mi++;
-		  bad_media:
-		    break;
-		}
-		case 3: {	/* 2114[23] MII PHY block */
-		    const unsigned phyno = *dp++;
-		    const u_int8_t *dp0;
-		    mi->mi_type = TULIP_MEDIAINFO_MII;
-		    mi->mi_gpr_length = *dp++;
-		    mi->mi_gpr_offset = dp - sc->tulip_rombuf;
-		    dp += 2 * mi->mi_gpr_length;
-		    mi->mi_reset_length = *dp++;
-		    mi->mi_reset_offset = dp - sc->tulip_rombuf;
-		    dp += 2 * mi->mi_reset_length;
-
-		    dp0 = &sc->tulip_rombuf[mi->mi_reset_offset];
-		    for (idx3 = 0; idx3 < mi->mi_reset_length; idx3++, dp0 += 2) {
-			DELAY(10);
-			TULIP_CSR_WRITE(sc, csr_sia_general, (dp0[0] + 256 * dp0[1]) << 16);
-		    }
-		    sc->tulip_phyaddr = mi->mi_phyaddr;
-		    dp0 = &sc->tulip_rombuf[mi->mi_gpr_offset];
-		    for (idx3 = 0; idx3 < mi->mi_gpr_length; idx3++, dp0 += 2) {
-			DELAY(10);
-			TULIP_CSR_WRITE(sc, csr_sia_general, (dp0[0] + 256 * dp0[1]) << 16);
-		    }
-
-		    if (mi->mi_reset_length == 0 && mi->mi_gpr_length == 0)
-			TULIP_CSR_WRITE(sc, csr_sia_general, 0);
-
-		    mi->mi_phyaddr = TULIP_MII_NOPHY;
-		    for (idx3 = 20; idx3 > 0 && mi->mi_phyaddr == TULIP_MII_NOPHY; idx3--) {
-			DELAY(10000);
-			mi->mi_phyaddr = tulip_mii_get_phyaddr(sc, phyno);
-		    }
-		    if (mi->mi_phyaddr == TULIP_MII_NOPHY) {
-#if defined(TULIP_DEBUG)
-			if_printf(sc->tulip_ifp, "can't find phy %d\n",
-			       phyno);
-#endif
-			break;
-		    }
-		    sc->tulip_features |= TULIP_HAVE_MII;
-		    mi->mi_capabilities  = dp[0] + dp[1] * 256; dp += 2;
-		    mi->mi_advertisement = dp[0] + dp[1] * 256; dp += 2;
-		    mi->mi_full_duplex   = dp[0] + dp[1] * 256; dp += 2;
-		    mi->mi_tx_threshold  = dp[0] + dp[1] * 256; dp += 2;
-		    mi->mi_mii_interrupt = dp[0] + dp[1] * 256; dp += 2;
-		    TULIP_MEDIAINFO_ADD_CAPABILITY(sc, mi, 100BASETX_FD);
-		    TULIP_MEDIAINFO_ADD_CAPABILITY(sc, mi, 100BASETX);
-		    TULIP_MEDIAINFO_ADD_CAPABILITY(sc, mi, 100BASET4);
-		    TULIP_MEDIAINFO_ADD_CAPABILITY(sc, mi, 10BASET_FD);
-		    TULIP_MEDIAINFO_ADD_CAPABILITY(sc, mi, 10BASET);
-		    mi->mi_phyid = (tulip_mii_readreg(sc, mi->mi_phyaddr, PHYREG_IDLOW) << 16) |
-			tulip_mii_readreg(sc, mi->mi_phyaddr, PHYREG_IDHIGH);
-		    mi++;
-		    break;
-		}
-		case 4: {	/* 21143 SYM block */
-		    tulip_media_t media;
-		    srom_media = (tulip_srom_media_t) dp[0];
-		    for (idx3 = 0; tulip_srom_mediums[idx3].sm_type != TULIP_MEDIA_UNKNOWN; idx3++) {
-			if (tulip_srom_mediums[idx3].sm_srom_type == srom_media)
-			    break;
-		    }
-		    media = tulip_srom_mediums[idx3].sm_type;
-		    if (media == TULIP_MEDIA_UNKNOWN)
-			break;
-		    mi->mi_type = TULIP_MEDIAINFO_SYM;
-		    sc->tulip_mediums[media] = mi;
-		    mi->mi_gpcontrol = (dp[1] + dp[2] * 256) << 16;
-		    mi->mi_gpdata    = (dp[3] + dp[4] * 256) << 16;
-		    data = dp[5] + dp[6] * 256;
-		    mi->mi_cmdmode = TULIP_SROM_2114X_CMDBITS(data);
-		    if (data & TULIP_SROM_2114X_NOINDICATOR) {
-			mi->mi_actmask = 0;
-		    } else {
-			mi->mi_default = (data & TULIP_SROM_2114X_DEFAULT) != 0;
-			mi->mi_actmask = TULIP_SROM_2114X_BITPOS(data);
-			mi->mi_actdata = (data & TULIP_SROM_2114X_POLARITY) ? 0 : mi->mi_actmask;
-		    }
-		    if (TULIP_IS_MEDIA_TP(media))
-			sc->tulip_intrmask |= TULIP_STS_LINKPASS|TULIP_STS_LINKFAIL;
-		    mi++;
-		    break;
-		}
-#if 0
-		case 5: {	/* 21143 Reset block */
-		    mi->mi_type = TULIP_MEDIAINFO_RESET;
-		    mi->mi_reset_length = *dp++;
-		    mi->mi_reset_offset = dp - sc->tulip_rombuf;
-		    dp += 2 * mi->mi_reset_length;
-		    mi++;
-		    break;
-		}
-#endif
-		default: {
-		}
-	    }
-	    dp = ep;
-	}
-    }
-    return mi - sc->tulip_mediainfo;
-}
-
-static const struct {
-    void (*vendor_identify_nic)(tulip_softc_t * const sc);
-    unsigned char vendor_oui[3];
-} tulip_vendors[] = {
-    { tulip_identify_dec_nic,		{ 0x08, 0x00, 0x2B } },
-    { tulip_identify_dec_nic,		{ 0x00, 0x00, 0xF8 } },
-    { tulip_identify_smc_nic,		{ 0x00, 0x00, 0xC0 } },
-    { tulip_identify_smc_nic,		{ 0x00, 0xE0, 0x29 } },
-    { tulip_identify_znyx_nic,		{ 0x00, 0xC0, 0x95 } },
-    { tulip_identify_cogent_nic,	{ 0x00, 0x00, 0x92 } },
-    { tulip_identify_asante_nic,	{ 0x00, 0x00, 0x94 } },
-    { tulip_identify_cogent_nic,	{ 0x00, 0x00, 0xD1 } },
-    { tulip_identify_accton_nic,	{ 0x00, 0x00, 0xE8 } },
-    { tulip_identify_compex_nic,        { 0x00, 0x80, 0x48 } },
-    { NULL }
-};
-
-/*
- * This deals with the vagaries of the address roms and the
- * brain-deadness that various vendors commit in using them.
- */
-static int
-tulip_read_macaddr(tulip_softc_t * const sc)
-{
-    unsigned cksum, rom_cksum, idx;
-    u_int32_t csr;
-    unsigned char tmpbuf[8];
-    static const u_char testpat[] = { 0xFF, 0, 0x55, 0xAA, 0xFF, 0, 0x55, 0xAA };
-
-    sc->tulip_connidx = TULIP_SROM_LASTCONNIDX;
-
-    if (sc->tulip_chipid == TULIP_21040) {
-	TULIP_CSR_WRITE(sc, csr_enetrom, 1);
-	for (idx = 0; idx < sizeof(sc->tulip_rombuf); idx++) {
-	    int cnt = 0;
-	    while (((csr = TULIP_CSR_READ(sc, csr_enetrom)) & 0x80000000L) && cnt < 10000)
-		cnt++;
-	    sc->tulip_rombuf[idx] = csr & 0xFF;
-	}
-	sc->tulip_boardsw = &tulip_21040_boardsw;
-    } else {
-	if (sc->tulip_chipid == TULIP_21041) {
-	    /*
-	     * Thankfully all 21041's act the same.
-	     */
-	    sc->tulip_boardsw = &tulip_21041_boardsw;
-	} else {
-	    /*
-	     * Assume all 21140 board are compatible with the
-	     * DEC 10/100 evaluation board.  Not really valid but
-	     * it's the best we can do until every one switches to
-	     * the new SROM format.
-	     */
-
-	    sc->tulip_boardsw = &tulip_21140_eb_boardsw;
-	}
-	tulip_srom_read(sc);
-	if (tulip_srom_crcok(sc->tulip_rombuf)) {
-	    /*
-	     * SROM CRC is valid therefore it must be in the
-	     * new format.
-	     */
-	    sc->tulip_features |= TULIP_HAVE_ISVSROM|TULIP_HAVE_OKSROM;
-	} else if (sc->tulip_rombuf[126] == 0xff && sc->tulip_rombuf[127] == 0xFF) {
-	    /*
-	     * No checksum is present.  See if the SROM id checks out;
-	     * the first 18 bytes should be 0 followed by a 1 followed
-	     * by the number of adapters (which we don't deal with yet).
-	     */
-	    for (idx = 0; idx < 18; idx++) {
-		if (sc->tulip_rombuf[idx] != 0)
-		    break;
-	    }
-	    if (idx == 18 && sc->tulip_rombuf[18] == 1 && sc->tulip_rombuf[19] != 0)
-		sc->tulip_features |= TULIP_HAVE_ISVSROM;
-	} else if (sc->tulip_chipid >= TULIP_21142) {
-	    sc->tulip_features |= TULIP_HAVE_ISVSROM;
-	    sc->tulip_boardsw = &tulip_2114x_isv_boardsw;
-	}
-	if ((sc->tulip_features & TULIP_HAVE_ISVSROM) && tulip_srom_decode(sc)) {
-	    if (sc->tulip_chipid != TULIP_21041)
-		sc->tulip_boardsw = &tulip_2114x_isv_boardsw;
-
-	    /*
-	     * If the SROM specifies more than one adapter, tag this as a
-	     * BASE rom.
-	     */
-	    if (sc->tulip_rombuf[19] > 1)
-		sc->tulip_features |= TULIP_HAVE_BASEROM;
-	    if (sc->tulip_boardsw == NULL)
-		return -6;
-	    goto check_oui;
-	}
-    }
-
-
-    if (bcmp(&sc->tulip_rombuf[0], &sc->tulip_rombuf[16], 8) != 0) {
-	/*
-	 * Some folks don't use the standard ethernet rom format
-	 * but instead just put the address in the first 6 bytes
-	 * of the rom and let the rest be all 0xffs.  (Can we say
-	 * ZNYX?) (well sometimes they put in a checksum so we'll
-	 * start at 8).
-	 */
-	for (idx = 8; idx < 32; idx++) {
-	    if (sc->tulip_rombuf[idx] != 0xFF)
-		return -4;
-	}
-	/*
-	 * Make sure the address is not multicast or locally assigned
-	 * that the OUI is not 00-00-00.
-	 */
-	if ((sc->tulip_rombuf[0] & 3) != 0)
-	    return -4;
-	if (sc->tulip_rombuf[0] == 0 && sc->tulip_rombuf[1] == 0
-		&& sc->tulip_rombuf[2] == 0)
-	    return -4;
-	bcopy(sc->tulip_rombuf, sc->tulip_enaddr, 6);
-	sc->tulip_features |= TULIP_HAVE_OKROM;
-	goto check_oui;
-    } else {
-	/*
-	 * A number of makers of multiport boards (ZNYX and Cogent)
-	 * only put on one address ROM on their 21040 boards.  So
-	 * if the ROM is all zeros (or all 0xFFs), look at the
-	 * previous configured boards (as long as they are on the same
-	 * PCI bus and the bus number is non-zero) until we find the
-	 * master board with address ROM.  We then use its address ROM
-	 * as the base for this board.  (we add our relative board
-	 * to the last byte of its address).
-	 */
-	for (idx = 0; idx < sizeof(sc->tulip_rombuf); idx++) {
-	    if (sc->tulip_rombuf[idx] != 0 && sc->tulip_rombuf[idx] != 0xFF)
-		break;
-	}
-	if (idx == sizeof(sc->tulip_rombuf)) {
-	    int root_unit;
-	    tulip_softc_t *root_sc = NULL;
-	    for (root_unit = sc->tulip_unit - 1; root_unit >= 0; root_unit--) {
-		root_sc = tulips[root_unit];
-		if (root_sc == NULL || (root_sc->tulip_features & (TULIP_HAVE_OKROM|TULIP_HAVE_SLAVEDROM)) == TULIP_HAVE_OKROM)
-		    break;
-		root_sc = NULL;
-	    }
-	    if (root_sc != NULL && (root_sc->tulip_features & TULIP_HAVE_BASEROM)
-		    && root_sc->tulip_chipid == sc->tulip_chipid
-		    && root_sc->tulip_pci_busno == sc->tulip_pci_busno) {
-		sc->tulip_features |= TULIP_HAVE_SLAVEDROM;
-		sc->tulip_boardsw = root_sc->tulip_boardsw;
-		strcpy(sc->tulip_boardid, root_sc->tulip_boardid);
-		if (sc->tulip_boardsw->bd_type == TULIP_21140_ISV) {
-		    bcopy(root_sc->tulip_rombuf, sc->tulip_rombuf,
-			  sizeof(sc->tulip_rombuf));
-		    if (!tulip_srom_decode(sc))
-			return -5;
-		} else {
-		    bcopy(root_sc->tulip_enaddr, sc->tulip_enaddr, 6);
-		    sc->tulip_enaddr[5] += sc->tulip_unit - root_sc->tulip_unit;
-		}
-		/*
-		 * Now for a truly disgusting kludge: all 4 21040s on
-		 * the ZX314 share the same INTA line so the mapping
-		 * setup by the BIOS on the PCI bridge is worthless.
-		 * Rather than reprogramming the value in the config
-		 * register, we will handle this internally.
-		 */
-		if (root_sc->tulip_features & TULIP_HAVE_SHAREDINTR) {
-		    sc->tulip_slaves = root_sc->tulip_slaves;
-		    root_sc->tulip_slaves = sc;
-		    sc->tulip_features |= TULIP_HAVE_SLAVEDINTR;
-		}
-		return 0;
-	    }
-	}
-    }
-
-    /*
-     * This is the standard DEC address ROM test.
-     */
-
-    if (bcmp(&sc->tulip_rombuf[24], testpat, 8) != 0)
-	return -3;
-
-    tmpbuf[0] = sc->tulip_rombuf[15]; tmpbuf[1] = sc->tulip_rombuf[14];
-    tmpbuf[2] = sc->tulip_rombuf[13]; tmpbuf[3] = sc->tulip_rombuf[12];
-    tmpbuf[4] = sc->tulip_rombuf[11]; tmpbuf[5] = sc->tulip_rombuf[10];
-    tmpbuf[6] = sc->tulip_rombuf[9];  tmpbuf[7] = sc->tulip_rombuf[8];
-    if (bcmp(&sc->tulip_rombuf[0], tmpbuf, 8) != 0)
-	return -2;
-
-    bcopy(sc->tulip_rombuf, sc->tulip_enaddr, 6);
-
-    cksum = *(u_int16_t *) &sc->tulip_enaddr[0];
-    cksum *= 2;
-    if (cksum > 65535) cksum -= 65535;
-    cksum += *(u_int16_t *) &sc->tulip_enaddr[2];
-    if (cksum > 65535) cksum -= 65535;
-    cksum *= 2;
-    if (cksum > 65535) cksum -= 65535;
-    cksum += *(u_int16_t *) &sc->tulip_enaddr[4];
-    if (cksum >= 65535) cksum -= 65535;
-
-    rom_cksum = *(u_int16_t *) &sc->tulip_rombuf[6];
-	
-    if (cksum != rom_cksum)
-	return -1;
-
-  check_oui:
-    /*
-     * Check for various boards based on OUI.  Did I say braindead?
-     */
-    for (idx = 0; tulip_vendors[idx].vendor_identify_nic != NULL; idx++) {
-	if (bcmp(sc->tulip_enaddr, tulip_vendors[idx].vendor_oui, 3) == 0) {
-	    (*tulip_vendors[idx].vendor_identify_nic)(sc);
-	    break;
-	}
-    }
-
-    sc->tulip_features |= TULIP_HAVE_OKROM;
-    return 0;
-}
-
-static void
-tulip_ifmedia_add(tulip_softc_t * const sc)
-{
-    tulip_media_t media;
-    int medias = 0;
-
-    TULIP_LOCK_ASSERT(sc);
-    for (media = TULIP_MEDIA_UNKNOWN; media < TULIP_MEDIA_MAX; media++) {
-	if (sc->tulip_mediums[media] != NULL) {
-	    ifmedia_add(&sc->tulip_ifmedia, tulip_media_to_ifmedia[media],
-			0, 0);
-	    medias++;
-	}
-    }
-    if (medias == 0) {
-	sc->tulip_features |= TULIP_HAVE_NOMEDIA;
-	ifmedia_add(&sc->tulip_ifmedia, IFM_ETHER | IFM_NONE, 0, 0);
-	ifmedia_set(&sc->tulip_ifmedia, IFM_ETHER | IFM_NONE);
-    } else if (sc->tulip_media == TULIP_MEDIA_UNKNOWN) {
-	ifmedia_add(&sc->tulip_ifmedia, IFM_ETHER | IFM_AUTO, 0, 0);
-	ifmedia_set(&sc->tulip_ifmedia, IFM_ETHER | IFM_AUTO);
-    } else {
-	ifmedia_set(&sc->tulip_ifmedia, tulip_media_to_ifmedia[sc->tulip_media]);
-	sc->tulip_flags |= TULIP_PRINTMEDIA;
-	tulip_linkup(sc, sc->tulip_media);
-    }
-}
-
-static int
-tulip_ifmedia_change(struct ifnet * const ifp)
-{
-    tulip_softc_t * const sc = (tulip_softc_t *)ifp->if_softc;
-
-    TULIP_LOCK(sc);
-    sc->tulip_flags |= TULIP_NEEDRESET;
-    sc->tulip_probe_state = TULIP_PROBE_INACTIVE;
-    sc->tulip_media = TULIP_MEDIA_UNKNOWN;
-    if (IFM_SUBTYPE(sc->tulip_ifmedia.ifm_media) != IFM_AUTO) {
-	tulip_media_t media;
-	for (media = TULIP_MEDIA_UNKNOWN; media < TULIP_MEDIA_MAX; media++) {
-	    if (sc->tulip_mediums[media] != NULL
-		&& sc->tulip_ifmedia.ifm_media == tulip_media_to_ifmedia[media]) {
-		sc->tulip_flags |= TULIP_PRINTMEDIA;
-		sc->tulip_flags &= ~TULIP_DIDNWAY;
-		tulip_linkup(sc, media);
-		TULIP_UNLOCK(sc);
-		return 0;
-	    }
-	}
-    }
-    sc->tulip_flags &= ~(TULIP_TXPROBE_ACTIVE|TULIP_WANTRXACT);
-    tulip_reset(sc);
-    tulip_init_locked(sc);
-    TULIP_UNLOCK(sc);
-    return 0;
-}
-
-/*
- * Media status callback
- */
-static void
-tulip_ifmedia_status(struct ifnet * const ifp, struct ifmediareq *req)
-{
-    tulip_softc_t *sc = (tulip_softc_t *)ifp->if_softc;
-
-    TULIP_LOCK(sc);
-    if (sc->tulip_media == TULIP_MEDIA_UNKNOWN) {
-	TULIP_UNLOCK(sc);
-	return;
-    }
-
-    req->ifm_status = IFM_AVALID;
-    if (sc->tulip_flags & TULIP_LINKUP)
-	req->ifm_status |= IFM_ACTIVE;
-
-    req->ifm_active = tulip_media_to_ifmedia[sc->tulip_media];
-    TULIP_UNLOCK(sc);
-}
-
-static void
-tulip_addr_filter(tulip_softc_t * const sc)
-{
-    struct ifmultiaddr *ifma;
-    struct ifnet *ifp;
-    u_char *addrp;
-    int multicnt;
-
-    TULIP_LOCK_ASSERT(sc);
-    sc->tulip_flags &= ~(TULIP_WANTHASHPERFECT|TULIP_WANTHASHONLY|TULIP_ALLMULTI);
-    sc->tulip_flags |= TULIP_WANTSETUP|TULIP_WANTTXSTART;
-    sc->tulip_cmdmode &= ~TULIP_CMD_RXRUN;
-    sc->tulip_intrmask &= ~TULIP_STS_RXSTOPPED;
-#if defined(IFF_ALLMULTI)    
-    if (sc->tulip_ifp->if_flags & IFF_ALLMULTI)
-	sc->tulip_flags |= TULIP_ALLMULTI ;
-#endif
-
-    multicnt = 0;
-    ifp = sc->tulip_ifp;      
-    IF_ADDR_LOCK(ifp);
-    TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
-
-	    if (ifma->ifma_addr->sa_family == AF_LINK)
-		multicnt++;
-    }
-
-    if (multicnt > 14) {
-	u_int32_t *sp = sc->tulip_setupdata;
-	unsigned hash;
-	/*
-	 * Some early passes of the 21140 have broken implementations of
-	 * hash-perfect mode.  When we get too many multicasts for perfect
-	 * filtering with these chips, we need to switch into hash-only
-	 * mode (this is better than all-multicast on network with lots
-	 * of multicast traffic).
-	 */
-	if (sc->tulip_features & TULIP_HAVE_BROKEN_HASH)
-	    sc->tulip_flags |= TULIP_WANTHASHONLY;
-	else
-	    sc->tulip_flags |= TULIP_WANTHASHPERFECT;
-	/*
-	 * If we have more than 14 multicasts, we have
-	 * go into hash perfect mode (512 bit multicast
-	 * hash and one perfect hardware).
-	 */
-	bzero(sc->tulip_setupdata, sizeof(sc->tulip_setupdata));
-
-	TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
-
-		if (ifma->ifma_addr->sa_family != AF_LINK)
-			continue;
-
-		hash = tulip_mchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
-		sp[hash >> 4] |= htole32(1 << (hash & 0xF));
-	}
-	/*
-	 * No reason to use a hash if we are going to be
-	 * receiving every multicast.
-	 */
-	if ((sc->tulip_flags & TULIP_ALLMULTI) == 0) {
-	    hash = tulip_mchash(ifp->if_broadcastaddr);
-	    sp[hash >> 4] |= htole32(1 << (hash & 0xF));
-	    if (sc->tulip_flags & TULIP_WANTHASHONLY) {
-		hash = tulip_mchash(IFP2ENADDR(ifp));
-		sp[hash >> 4] |= htole32(1 << (hash & 0xF));
-	    } else {
-		sp[39] = TULIP_SP_MAC(((u_int16_t *)IFP2ENADDR(ifp))[0]); 
-		sp[40] = TULIP_SP_MAC(((u_int16_t *)IFP2ENADDR(ifp))[1]); 
-		sp[41] = TULIP_SP_MAC(((u_int16_t *)IFP2ENADDR(ifp))[2]);
-	    }
-	}
-    }
-    if ((sc->tulip_flags & (TULIP_WANTHASHPERFECT|TULIP_WANTHASHONLY)) == 0) {
-	u_int32_t *sp = sc->tulip_setupdata;
-	int idx = 0;
-	if ((sc->tulip_flags & TULIP_ALLMULTI) == 0) {
-	    /*
-	     * Else can get perfect filtering for 16 addresses.
-	     */
-	    TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
-		    if (ifma->ifma_addr->sa_family != AF_LINK)
-			    continue;
-		    addrp = LLADDR((struct sockaddr_dl *)ifma->ifma_addr);
-		    *sp++ = TULIP_SP_MAC(((u_int16_t *)addrp)[0]); 
-		    *sp++ = TULIP_SP_MAC(((u_int16_t *)addrp)[1]); 
-		    *sp++ = TULIP_SP_MAC(((u_int16_t *)addrp)[2]);
-		    idx++;
-	    }
-	    /*
-	     * Add the broadcast address.
-	     */
-	    idx++;
-	    *sp++ = TULIP_SP_MAC(0xFFFF);
-	    *sp++ = TULIP_SP_MAC(0xFFFF);
-	    *sp++ = TULIP_SP_MAC(0xFFFF);
-	}
-	/*
-	 * Pad the rest with our hardware address
-	 */
-	for (; idx < 16; idx++) {
-	    *sp++ = TULIP_SP_MAC(((u_int16_t *)IFP2ENADDR(ifp))[0]); 
-	    *sp++ = TULIP_SP_MAC(((u_int16_t *)IFP2ENADDR(ifp))[1]); 
-	    *sp++ = TULIP_SP_MAC(((u_int16_t *)IFP2ENADDR(ifp))[2]);
-	}
-    }
-    IF_ADDR_UNLOCK(ifp);
-}
-
-static void
-tulip_reset(tulip_softc_t * const sc)
-{
-    tulip_ringinfo_t *ri;
-    tulip_descinfo_t *di;
-    struct mbuf *m;
-    u_int32_t inreset = (sc->tulip_flags & TULIP_INRESET);
-
-    TULIP_LOCK_ASSERT(sc);
-
-    CTR1(KTR_TULIP, "tulip_reset: inreset %d", inreset);
-
-    /*
-     * Brilliant.  Simply brilliant.  When switching modes/speeds
-     * on a 2114*, you need to set the appriopriate MII/PCS/SCL/PS
-     * bits in CSR6 and then do a software reset to get the 21140
-     * to properly reset its internal pathways to the right places.
-     *   Grrrr.
-     */
-    if ((sc->tulip_flags & TULIP_DEVICEPROBE) == 0
-	    && sc->tulip_boardsw->bd_media_preset != NULL)
-	(*sc->tulip_boardsw->bd_media_preset)(sc);
-
-    TULIP_CSR_WRITE(sc, csr_busmode, TULIP_BUSMODE_SWRESET);
-    DELAY(10);	/* Wait 10 microseconds (actually 50 PCI cycles but at 
-		   33MHz that comes to two microseconds but wait a
-		   bit longer anyways) */
-
-    if (!inreset) {
-	sc->tulip_flags |= TULIP_INRESET;
-	sc->tulip_flags &= ~(TULIP_NEEDRESET|TULIP_RXBUFSLOW);
-	sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
-    }
-
-    TULIP_CSR_WRITE(sc, csr_txlist, sc->tulip_txinfo.ri_dma_addr);
-    TULIP_CSR_WRITE(sc, csr_rxlist, sc->tulip_rxinfo.ri_dma_addr);
-    TULIP_CSR_WRITE(sc, csr_busmode,
-		    (1 << (3 /*pci_max_burst_len*/ + 8))
-		    |TULIP_BUSMODE_CACHE_ALIGN8
-		    |TULIP_BUSMODE_READMULTIPLE
-		    |(BYTE_ORDER != LITTLE_ENDIAN ?
-		      TULIP_BUSMODE_DESC_BIGENDIAN : 0));
-
-    sc->tulip_txtimer = 0;
-    /*
-     * Free all the mbufs that were on the transmit ring.
-     */
-    CTR0(KTR_TULIP, "tulip_reset: drain transmit ring");
-    ri = &sc->tulip_txinfo;
-    for (di = ri->ri_first; di < ri->ri_last; di++) {
-	m = tulip_dequeue_mbuf(ri, di, SYNC_NONE);
-	if (m != NULL)
-	    m_freem(m);
-	di->di_desc->d_status = 0;
-    }
-
-    ri->ri_nextin = ri->ri_nextout = ri->ri_first;
-    ri->ri_free = ri->ri_max;
-    TULIP_TXDESC_PRESYNC(ri);
-
-    /*
-     * We need to collect all the mbufs that were on the 
-     * receive ring before we reinit it either to put
-     * them back on or to know if we have to allocate
-     * more.
-     */
-    CTR0(KTR_TULIP, "tulip_reset: drain receive ring");
-    ri = &sc->tulip_rxinfo;
-    ri->ri_nextin = ri->ri_nextout = ri->ri_first;
-    ri->ri_free = ri->ri_max;
-    for (di = ri->ri_first; di < ri->ri_last; di++) {
-	di->di_desc->d_status = 0;
-	di->di_desc->d_length1 = 0; di->di_desc->d_addr1 = 0;
-	di->di_desc->d_length2 = 0; di->di_desc->d_addr2 = 0;
-    }
-    TULIP_RXDESC_PRESYNC(ri);
-    for (di = ri->ri_first; di < ri->ri_last; di++) {
-	m = tulip_dequeue_mbuf(ri, di, SYNC_NONE);
-	if (m != NULL)
-	    m_freem(m);
-    }
-
-    /*
-     * If tulip_reset is being called recursively, exit quickly knowing
-     * that when the outer tulip_reset returns all the right stuff will
-     * have happened.
-     */
-    if (inreset)
-	return;
-
-    sc->tulip_intrmask |= TULIP_STS_NORMALINTR|TULIP_STS_RXINTR|TULIP_STS_TXINTR
-	|TULIP_STS_ABNRMLINTR|TULIP_STS_SYSERROR|TULIP_STS_TXSTOPPED
-	|TULIP_STS_TXUNDERFLOW|TULIP_STS_TXBABBLE
-	|TULIP_STS_RXSTOPPED;
-
-    if ((sc->tulip_flags & TULIP_DEVICEPROBE) == 0)
-	(*sc->tulip_boardsw->bd_media_select)(sc);
-#if defined(TULIP_DEBUG)
-    if ((sc->tulip_flags & TULIP_NEEDRESET) == TULIP_NEEDRESET)
-	if_printf(sc->tulip_ifp,
-	    "tulip_reset: additional reset needed?!?\n");
-#endif
-    if (bootverbose)
-	    tulip_media_print(sc);
-    if (sc->tulip_features & TULIP_HAVE_DUALSENSE)
-	TULIP_CSR_WRITE(sc, csr_sia_status, TULIP_CSR_READ(sc, csr_sia_status));
-
-    sc->tulip_flags &= ~(TULIP_DOINGSETUP|TULIP_WANTSETUP|TULIP_INRESET
-			 |TULIP_RXACT);
-    tulip_addr_filter(sc);
-}
-
-
-static void
-tulip_init(void *arg)
-{
-    tulip_softc_t *sc = (tulip_softc_t *)arg;
-
-    TULIP_LOCK(sc);
-    tulip_init_locked(sc);
-    TULIP_UNLOCK(sc);
-}
-
-static void
-tulip_init_locked(tulip_softc_t * const sc)
-{
-    CTR0(KTR_TULIP, "tulip_init_locked");
-    if (sc->tulip_ifp->if_flags & IFF_UP) {
-	if ((sc->tulip_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
-	    /* initialize the media */
-	    CTR0(KTR_TULIP, "tulip_init_locked: up but not running, reset chip");
-	    tulip_reset(sc);
-	}
-	sc->tulip_ifp->if_drv_flags |= IFF_DRV_RUNNING;
-	if (sc->tulip_ifp->if_flags & IFF_PROMISC) {
-	    sc->tulip_flags |= TULIP_PROMISC;
-	    sc->tulip_cmdmode |= TULIP_CMD_PROMISCUOUS;
-	    sc->tulip_intrmask |= TULIP_STS_TXINTR;
-	} else {
-	    sc->tulip_flags &= ~TULIP_PROMISC;
-	    sc->tulip_cmdmode &= ~TULIP_CMD_PROMISCUOUS;
-	    if (sc->tulip_flags & TULIP_ALLMULTI) {
-		sc->tulip_cmdmode |= TULIP_CMD_ALLMULTI;
-	    } else {
-		sc->tulip_cmdmode &= ~TULIP_CMD_ALLMULTI;
-	    }
-	}
-	sc->tulip_cmdmode |= TULIP_CMD_TXRUN;
-	if ((sc->tulip_flags & (TULIP_TXPROBE_ACTIVE|TULIP_WANTSETUP)) == 0) {
-	    tulip_rx_intr(sc);
-	    sc->tulip_cmdmode |= TULIP_CMD_RXRUN;
-	    sc->tulip_intrmask |= TULIP_STS_RXSTOPPED;
-	} else {
-	    sc->tulip_ifp->if_drv_flags |= IFF_DRV_OACTIVE;
-	    sc->tulip_cmdmode &= ~TULIP_CMD_RXRUN;
-	    sc->tulip_intrmask &= ~TULIP_STS_RXSTOPPED;
-	}
-	CTR2(KTR_TULIP, "tulip_init_locked: intr mask %08x  cmdmode %08x",
-	    sc->tulip_intrmask, sc->tulip_cmdmode);
-	TULIP_CSR_WRITE(sc, csr_intr, sc->tulip_intrmask);
-	TULIP_CSR_WRITE(sc, csr_command, sc->tulip_cmdmode);
-	CTR1(KTR_TULIP, "tulip_init_locked: status %08x\n",
-	    TULIP_CSR_READ(sc, csr_status));
-	if ((sc->tulip_flags & (TULIP_WANTSETUP|TULIP_TXPROBE_ACTIVE)) == TULIP_WANTSETUP)
-	    tulip_txput_setup(sc);
-    } else {
-	CTR0(KTR_TULIP, "tulip_init_locked: not up, reset chip");
-	sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
-	tulip_reset(sc);
-    }
-}
-
-#define DESC_STATUS(di)	(((volatile tulip_desc_t *)((di)->di_desc))->d_status)
-#define DESC_FLAG(di)	((di)->di_desc->d_flag)
-
-static void
-tulip_rx_intr(tulip_softc_t * const sc)
-{
-    TULIP_PERFSTART(rxintr)
-    tulip_ringinfo_t * const ri = &sc->tulip_rxinfo;
-    struct ifnet * const ifp = sc->tulip_ifp;
-    int fillok = 1;
-#if defined(TULIP_DEBUG)
-    int cnt = 0;
-#endif
-
-    TULIP_LOCK_ASSERT(sc);
-    CTR0(KTR_TULIP, "tulip_rx_intr: start");
-    for (;;) {
-	TULIP_PERFSTART(rxget)
-	tulip_descinfo_t *eop = ri->ri_nextin, *dip;
-	int total_len = 0, last_offset = 0;
-	struct mbuf *ms = NULL, *me = NULL;
-	int accept = 0;
-	int error;
-
-	if (fillok && (ri->ri_max - ri->ri_free) < TULIP_RXQ_TARGET)
-	    goto queue_mbuf;
-
-#if defined(TULIP_DEBUG)
-	if (cnt == ri->ri_max)
-	    break;
-#endif
-	/*
-	 * If the TULIP has no descriptors, there can't be any receive
-	 * descriptors to process.
- 	 */
-	if (eop == ri->ri_nextout)
-	    break;
-
-	/*
-	 * 90% of the packets will fit in one descriptor.  So we optimize
-	 * for that case.
-	 */
-	TULIP_RXDESC_POSTSYNC(ri);
-	if ((DESC_STATUS(eop) & (TULIP_DSTS_OWNER|TULIP_DSTS_RxFIRSTDESC|TULIP_DSTS_RxLASTDESC)) == (TULIP_DSTS_RxFIRSTDESC|TULIP_DSTS_RxLASTDESC)) {
-	    ms = tulip_dequeue_mbuf(ri, eop, SYNC_RX);
-	    CTR2(KTR_TULIP,
-		"tulip_rx_intr: single packet mbuf %p from descriptor %td", ms,
-		eop - ri->ri_first);
-	    me = ms;
-	    ri->ri_free++;
-	} else {
-	    /*
-	     * If still owned by the TULIP, don't touch it.
-	     */
-	    if (DESC_STATUS(eop) & TULIP_DSTS_OWNER)
-		break;
-
-	    /*
-	     * It is possible (though improbable unless MCLBYTES < 1518) for
-	     * a received packet to cross more than one receive descriptor.
-	     * We first loop through the descriptor ring making sure we have
-	     * received a complete packet.  If not, we bail until the next
-	     * interrupt.
-	     */
-	    dip = eop;
-	    while ((DESC_STATUS(eop) & TULIP_DSTS_RxLASTDESC) == 0) {
-		if (++eop == ri->ri_last)
-		    eop = ri->ri_first;
-		TULIP_RXDESC_POSTSYNC(ri);
-		if (eop == ri->ri_nextout || DESC_STATUS(eop) & TULIP_DSTS_OWNER) {
-#if defined(TULIP_DEBUG)
-		    sc->tulip_dbg.dbg_rxintrs++;
-		    sc->tulip_dbg.dbg_rxpktsperintr[cnt]++;
-#endif
-		    TULIP_PERFEND(rxget);
-		    TULIP_PERFEND(rxintr);
-		    return;
-		}
-		total_len++;
-	    }
-
-	    /*
-	     * Dequeue the first buffer for the start of the packet.  Hopefully
-	     * this will be the only one we need to dequeue.  However, if the
-	     * packet consumed multiple descriptors, then we need to dequeue
-	     * those buffers and chain to the starting mbuf.  All buffers but
-	     * the last buffer have the same length so we can set that now.
-	     * (we add to last_offset instead of multiplying since we normally
-	     * won't go into the loop and thereby saving ourselves from
-	     * doing a multiplication by 0 in the normal case).
-	     */
-	    ms = tulip_dequeue_mbuf(ri, dip, SYNC_RX);
-	    CTR2(KTR_TULIP,
-		"tulip_rx_intr: start packet mbuf %p from descriptor %td", ms,
-		dip - ri->ri_first);
-	    ri->ri_free++;
-	    for (me = ms; total_len > 0; total_len--) {
-		me->m_len = TULIP_RX_BUFLEN;
-		last_offset += TULIP_RX_BUFLEN;
-		if (++dip == ri->ri_last)
-		    dip = ri->ri_first;
-		me->m_next = tulip_dequeue_mbuf(ri, dip, SYNC_RX);
-		ri->ri_free++;
-		me = me->m_next;
-		CTR2(KTR_TULIP,
-		    "tulip_rx_intr: cont packet mbuf %p from descriptor %td",
-		    me, dip - ri->ri_first);
-	    }
-	    KASSERT(dip == eop, ("mismatched descinfo structs"));
-	}
-
-	/*
-	 *  Now get the size of received packet (minus the CRC).
-	 */
-	total_len = ((DESC_STATUS(eop) >> 16) & 0x7FFF) - ETHER_CRC_LEN;
-	if ((sc->tulip_flags & TULIP_RXIGNORE) == 0
-	    && ((DESC_STATUS(eop) & TULIP_DSTS_ERRSUM) == 0)) {
-	    me->m_len = total_len - last_offset;
-	    sc->tulip_flags |= TULIP_RXACT;
-	    accept = 1;
-	    CTR1(KTR_TULIP, "tulip_rx_intr: good packet; length %d",
-		total_len);
-	} else {
-	    CTR1(KTR_TULIP, "tulip_rx_intr: bad packet; status %08x",
-		DESC_STATUS(eop));
-	    ifp->if_ierrors++;
-	    if (DESC_STATUS(eop) & (TULIP_DSTS_RxBADLENGTH|TULIP_DSTS_RxOVERFLOW|TULIP_DSTS_RxWATCHDOG)) {
-		sc->tulip_dot3stats.dot3StatsInternalMacReceiveErrors++;
-	    } else {
-#if defined(TULIP_VERBOSE)
-		const char *error = NULL;
-#endif
-		if (DESC_STATUS(eop) & TULIP_DSTS_RxTOOLONG) {
-		    sc->tulip_dot3stats.dot3StatsFrameTooLongs++;
-#if defined(TULIP_VERBOSE)
-		    error = "frame too long";
-#endif
-		}
-		if (DESC_STATUS(eop) & TULIP_DSTS_RxBADCRC) {
-		    if (DESC_STATUS(eop) & TULIP_DSTS_RxDRBBLBIT) {
-			sc->tulip_dot3stats.dot3StatsAlignmentErrors++;
-#if defined(TULIP_VERBOSE)
-			error = "alignment error";
-#endif
-		    } else {
-			sc->tulip_dot3stats.dot3StatsFCSErrors++;
-#if defined(TULIP_VERBOSE)
-			error = "bad crc";
-#endif
-		    }
-		}
-#if defined(TULIP_VERBOSE)
-		if (error != NULL && (sc->tulip_flags & TULIP_NOMESSAGES) == 0) {
-		    if_printf(sc->tulip_ifp, "receive: %6D: %s\n",
-			   mtod(ms, u_char *) + 6, ":",
-			   error);
-		    sc->tulip_flags |= TULIP_NOMESSAGES;
-		}
-#endif
-	    }
-
-	}
-#if defined(TULIP_DEBUG)
-	cnt++;
-#endif
-	ifp->if_ipackets++;
-	if (++eop == ri->ri_last)
-	    eop = ri->ri_first;
-	ri->ri_nextin = eop;
-      queue_mbuf:
-	/*
-	 * We have received a good packet that needs to be passed up the
-	 * stack.
-	 */
-	if (accept) {
-	    struct mbuf *m0;
-
-	    KASSERT(ms != NULL, ("no packet to accept"));
-#if defined(TULIP_COPY_RXDATA)
-	    /*
-	     * Copy the data into a new mbuf that is properly aligned.  If
-	     * we fail to allocate a new mbuf, then drop the packet.  We will
-	     * reuse the same rx buffer ('ms') below for another packet
-	     * regardless.
-	     */
-	    m0 = m_devget(mtod(ms, caddr_t), total_len, ETHER_ALIGN, ifp, NULL);
-	    if (m0 == NULL) {
-		ifp->if_ierrors++;
-		goto skip_input;
-	    }
-#else
-	    /*
-	     * Update the header for the mbuf referencing this receive
-	     * buffer and pass it up the stack.  Allocate a new mbuf cluster
-	     * to replace the one we just passed up the stack.
-	     *
-	     * Note that if this packet crossed multiple descriptors
-	     * we don't even try to reallocate all the mbufs here.
-	     * Instead we rely on the test at the beginning of
-	     * the loop to refill for the extra consumed mbufs.
-	     */
-	    ms->m_pkthdr.len = total_len;
-	    ms->m_pkthdr.rcvif = ifp;
-	    m0 = ms;
-	    ms = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR);
-#endif
-	    TULIP_UNLOCK(sc);
-	    CTR1(KTR_TULIP, "tulip_rx_intr: passing %p to upper layer", m0);
-	    (*ifp->if_input)(ifp, m0);
-	    TULIP_LOCK(sc);
-	} else if (ms == NULL)
-	    /*
-	     * If we are priming the TULIP with mbufs, then allocate
-	     * a new cluster for the next descriptor.
-	     */
-	    ms = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR);
-
-#if defined(TULIP_COPY_RXDATA)
-    skip_input:
-#endif
-	if (ms == NULL) {
-	    /*
-	     * Couldn't allocate a new buffer.  Don't bother 
-	     * trying to replenish the receive queue.
-	     */
-	    fillok = 0;
-	    sc->tulip_flags |= TULIP_RXBUFSLOW;
-#if defined(TULIP_DEBUG)
-	    sc->tulip_dbg.dbg_rxlowbufs++;
-#endif
-	    TULIP_PERFEND(rxget);
-	    continue;
-	}
-	/*
-	 * Now give the buffer(s) to the TULIP and save in our
-	 * receive queue.
-	 */
-	do {
-	    tulip_descinfo_t * const nextout = ri->ri_nextout;
-
-	    M_ASSERTPKTHDR(ms);
-	    KASSERT(ms->m_data == ms->m_ext.ext_buf,
-		("rx mbuf data doesn't point to cluster"));	    
-	    ms->m_len = ms->m_pkthdr.len = MCLBYTES;
-	    error = bus_dmamap_load_mbuf(ri->ri_data_tag, *nextout->di_map, ms,
-		tulip_dma_map_rxbuf, nextout->di_desc, BUS_DMA_NOWAIT);
-	    if (error) {
-		if_printf(sc->tulip_ifp,
-		    "unable to load rx map, error = %d\n", error);
-		panic("tulip_rx_intr");		/* XXX */
-	    }
-	    nextout->di_desc->d_status = TULIP_DSTS_OWNER;
-	    KASSERT(nextout->di_mbuf == NULL, ("clobbering earlier rx mbuf"));
-	    nextout->di_mbuf = ms;
-	    CTR2(KTR_TULIP, "tulip_rx_intr: enqueued mbuf %p to descriptor %td",
-		ms, nextout - ri->ri_first);
-	    TULIP_RXDESC_POSTSYNC(ri);
-	    if (++ri->ri_nextout == ri->ri_last)
-		ri->ri_nextout = ri->ri_first;
-	    ri->ri_free--;
-	    me = ms->m_next;
-	    ms->m_next = NULL;
-	} while ((ms = me) != NULL);
-
-	if ((ri->ri_max - ri->ri_free) >= TULIP_RXQ_TARGET)
-	    sc->tulip_flags &= ~TULIP_RXBUFSLOW;
-	TULIP_PERFEND(rxget);
-    }
-
-#if defined(TULIP_DEBUG)
-    sc->tulip_dbg.dbg_rxintrs++;
-    sc->tulip_dbg.dbg_rxpktsperintr[cnt]++;
-#endif
-    TULIP_PERFEND(rxintr);
-}
-
-static int
-tulip_tx_intr(tulip_softc_t * const sc)
-{
-    TULIP_PERFSTART(txintr)    
-    tulip_ringinfo_t * const ri = &sc->tulip_txinfo;
-    struct mbuf *m;
-    int xmits = 0;
-    int descs = 0;
-
-    CTR0(KTR_TULIP, "tulip_tx_intr: start");
-    TULIP_LOCK_ASSERT(sc);
-    while (ri->ri_free < ri->ri_max) {
-	u_int32_t d_flag;
-
-	TULIP_TXDESC_POSTSYNC(ri);
-	if (DESC_STATUS(ri->ri_nextin) & TULIP_DSTS_OWNER)
-	    break;
-
-	ri->ri_free++;
-	descs++;
-	d_flag = DESC_FLAG(ri->ri_nextin);
-	if (d_flag & TULIP_DFLAG_TxLASTSEG) {
-	    if (d_flag & TULIP_DFLAG_TxSETUPPKT) {
-		CTR2(KTR_TULIP,
-		    "tulip_tx_intr: setup packet from descriptor %td: %08x",
-		    ri->ri_nextin - ri->ri_first, DESC_STATUS(ri->ri_nextin));
-		/*
-		 * We've just finished processing a setup packet.
-		 * Mark that we finished it.  If there's not
-		 * another pending, startup the TULIP receiver.
-		 * Make sure we ack the RXSTOPPED so we won't get
-		 * an abormal interrupt indication.
-		 */
-		bus_dmamap_sync(sc->tulip_setup_tag, sc->tulip_setup_map,
-		    BUS_DMASYNC_POSTWRITE);
-		sc->tulip_flags &= ~(TULIP_DOINGSETUP|TULIP_HASHONLY);
-		if (DESC_FLAG(ri->ri_nextin) & TULIP_DFLAG_TxINVRSFILT)
-		    sc->tulip_flags |= TULIP_HASHONLY;
-		if ((sc->tulip_flags & (TULIP_WANTSETUP|TULIP_TXPROBE_ACTIVE)) == 0) {
-		    tulip_rx_intr(sc);
-		    sc->tulip_cmdmode |= TULIP_CMD_RXRUN;
-		    sc->tulip_intrmask |= TULIP_STS_RXSTOPPED;
-		    CTR2(KTR_TULIP,
-			"tulip_tx_intr: intr mask %08x  cmdmode %08x",
-			sc->tulip_intrmask, sc->tulip_cmdmode);
-		    TULIP_CSR_WRITE(sc, csr_status, TULIP_STS_RXSTOPPED);
-		    TULIP_CSR_WRITE(sc, csr_intr, sc->tulip_intrmask);
-		    TULIP_CSR_WRITE(sc, csr_command, sc->tulip_cmdmode);
-		}
-	    } else {
-		const u_int32_t d_status = DESC_STATUS(ri->ri_nextin);
-
-		m = tulip_dequeue_mbuf(ri, ri->ri_nextin, SYNC_TX);
-		CTR2(KTR_TULIP,
-		    "tulip_tx_intr: data packet %p from descriptor %td", m,
-		    ri->ri_nextin - ri->ri_first);
-		if (m != NULL) {
-		    m_freem(m);
-#if defined(TULIP_DEBUG)
-		} else {
-		    if_printf(sc->tulip_ifp,
-		        "tx_intr: failed to dequeue mbuf?!?\n");
-#endif
-		}
-		if (sc->tulip_flags & TULIP_TXPROBE_ACTIVE) {
-		    tulip_mediapoll_event_t event = TULIP_MEDIAPOLL_TXPROBE_OK;
-		    if (d_status & (TULIP_DSTS_TxNOCARR|TULIP_DSTS_TxEXCCOLL)) {
-#if defined(TULIP_DEBUG)
-			if (d_status & TULIP_DSTS_TxNOCARR)
-			    sc->tulip_dbg.dbg_txprobe_nocarr++;
-			if (d_status & TULIP_DSTS_TxEXCCOLL)
-			    sc->tulip_dbg.dbg_txprobe_exccoll++;
-#endif
-			event = TULIP_MEDIAPOLL_TXPROBE_FAILED;
-		    }
-		    (*sc->tulip_boardsw->bd_media_poll)(sc, event);
-		    /*
-		     * Escape from the loop before media poll has reset the TULIP!
-		     */
-		    break;
-		} else {
-		    xmits++;
-		    if (d_status & TULIP_DSTS_ERRSUM) {
-			CTR1(KTR_TULIP, "tulip_tx_intr: output error: %08x",
-			    d_status);
-			sc->tulip_ifp->if_oerrors++;
-			if (d_status & TULIP_DSTS_TxEXCCOLL)
-			    sc->tulip_dot3stats.dot3StatsExcessiveCollisions++;
-			if (d_status & TULIP_DSTS_TxLATECOLL)
-			    sc->tulip_dot3stats.dot3StatsLateCollisions++;
-			if (d_status & (TULIP_DSTS_TxNOCARR|TULIP_DSTS_TxCARRLOSS))
-			    sc->tulip_dot3stats.dot3StatsCarrierSenseErrors++;
-			if (d_status & (TULIP_DSTS_TxUNDERFLOW|TULIP_DSTS_TxBABBLE))
-			    sc->tulip_dot3stats.dot3StatsInternalMacTransmitErrors++;
-			if (d_status & TULIP_DSTS_TxUNDERFLOW)
-			    sc->tulip_dot3stats.dot3StatsInternalTransmitUnderflows++;
-			if (d_status & TULIP_DSTS_TxBABBLE)
-			    sc->tulip_dot3stats.dot3StatsInternalTransmitBabbles++;
-		    } else {
-			u_int32_t collisions = 
-			    (d_status & TULIP_DSTS_TxCOLLMASK)
-				>> TULIP_DSTS_V_TxCOLLCNT;
-
-			CTR2(KTR_TULIP,
-		    "tulip_tx_intr: output ok, collisions %d, status %08x",
-			    collisions, d_status);
-			sc->tulip_ifp->if_collisions += collisions;
-			if (collisions == 1)
-			    sc->tulip_dot3stats.dot3StatsSingleCollisionFrames++;
-			else if (collisions > 1)
-			    sc->tulip_dot3stats.dot3StatsMultipleCollisionFrames++;
-			else if (d_status & TULIP_DSTS_TxDEFERRED)
-			    sc->tulip_dot3stats.dot3StatsDeferredTransmissions++;
-			/*
-			 * SQE is only valid for 10baseT/BNC/AUI when not
-			 * running in full-duplex.  In order to speed up the
-			 * test, the corresponding bit in tulip_flags needs to
-			 * set as well to get us to count SQE Test Errors.
-			 */
-			if (d_status & TULIP_DSTS_TxNOHRTBT & sc->tulip_flags)
-			    sc->tulip_dot3stats.dot3StatsSQETestErrors++;
-		    }
-		}
-	    }
-	}
-
-	if (++ri->ri_nextin == ri->ri_last)
-	    ri->ri_nextin = ri->ri_first;
-
-	if ((sc->tulip_flags & TULIP_TXPROBE_ACTIVE) == 0)
-	    sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
-    }
-    /*
-     * If nothing left to transmit, disable the timer.
-     * Else if progress, reset the timer back to 2 ticks.
-     */
-    if (ri->ri_free == ri->ri_max || (sc->tulip_flags & TULIP_TXPROBE_ACTIVE))
-	sc->tulip_txtimer = 0;
-    else if (xmits > 0)
-	sc->tulip_txtimer = TULIP_TXTIMER;
-    sc->tulip_ifp->if_opackets += xmits;
-    TULIP_PERFEND(txintr);
-    return descs;
-}
-
-static void
-tulip_print_abnormal_interrupt(tulip_softc_t * const sc, u_int32_t csr)
-{
-    const char * const *msgp = tulip_status_bits;
-    const char *sep;
-    u_int32_t mask;
-    const char thrsh[] = "72|128\0\0\0" "96|256\0\0\0" "128|512\0\0" "160|1024";
-
-    TULIP_LOCK_ASSERT(sc);
-    csr &= (1 << (sizeof(tulip_status_bits)/sizeof(tulip_status_bits[0]))) - 1;
-    if_printf(sc->tulip_ifp, "abnormal interrupt:");
-    for (sep = " ", mask = 1; mask <= csr; mask <<= 1, msgp++) {
-	if ((csr & mask) && *msgp != NULL) {
-	    printf("%s%s", sep, *msgp);
-	    if (mask == TULIP_STS_TXUNDERFLOW && (sc->tulip_flags & TULIP_NEWTXTHRESH)) {
-		sc->tulip_flags &= ~TULIP_NEWTXTHRESH;
-		if (sc->tulip_cmdmode & TULIP_CMD_STOREFWD) {
-		    printf(" (switching to store-and-forward mode)");
-		} else {
-		    printf(" (raising TX threshold to %s)",
-			   &thrsh[9 * ((sc->tulip_cmdmode & TULIP_CMD_THRESHOLDCTL) >> 14)]);
-		}
-	    }
-	    sep = ", ";
-	}
-    }
-    printf("\n");
-}
-
-static void
-tulip_intr_handler(tulip_softc_t * const sc)
-{
-    TULIP_PERFSTART(intr)
-    u_int32_t csr;
-
-    CTR0(KTR_TULIP, "tulip_intr_handler invoked");
-    TULIP_LOCK_ASSERT(sc);
-    while ((csr = TULIP_CSR_READ(sc, csr_status)) & sc->tulip_intrmask) {
-	TULIP_CSR_WRITE(sc, csr_status, csr);
-
-	if (csr & TULIP_STS_SYSERROR) {
-	    sc->tulip_last_system_error = (csr & TULIP_STS_ERRORMASK) >> TULIP_STS_ERR_SHIFT;
-	    if (sc->tulip_flags & TULIP_NOMESSAGES) {
-		sc->tulip_flags |= TULIP_SYSTEMERROR;
-	    } else {
-		if_printf(sc->tulip_ifp, "system error: %s\n",
-		       tulip_system_errors[sc->tulip_last_system_error]);
-	    }
-	    sc->tulip_flags |= TULIP_NEEDRESET;
-	    sc->tulip_system_errors++;
-	    break;
-	}
-	if (csr & (TULIP_STS_LINKPASS|TULIP_STS_LINKFAIL) & sc->tulip_intrmask) {
-#if defined(TULIP_DEBUG)
-	    sc->tulip_dbg.dbg_link_intrs++;
-#endif
-	    if (sc->tulip_boardsw->bd_media_poll != NULL) {
-		(*sc->tulip_boardsw->bd_media_poll)(sc, csr & TULIP_STS_LINKFAIL
-						    ? TULIP_MEDIAPOLL_LINKFAIL
-						    : TULIP_MEDIAPOLL_LINKPASS);
-		csr &= ~TULIP_STS_ABNRMLINTR;
-	    }
-	    tulip_media_print(sc);
-	}
-	if (csr & (TULIP_STS_RXINTR|TULIP_STS_RXNOBUF)) {
-	    u_int32_t misses = TULIP_CSR_READ(sc, csr_missed_frames);
-	    if (csr & TULIP_STS_RXNOBUF)
-		sc->tulip_dot3stats.dot3StatsMissedFrames += misses & 0xFFFF;
-	    /*
-	     * Pass 2.[012] of the 21140A-A[CDE] may hang and/or corrupt data
-	     * on receive overflows.
-	     */
-	    if ((misses & 0x0FFE0000) && (sc->tulip_features & TULIP_HAVE_RXBADOVRFLW)) {
-		sc->tulip_dot3stats.dot3StatsInternalMacReceiveErrors++;
-		/*
-		 * Stop the receiver process and spin until it's stopped.
-		 * Tell rx_intr to drop the packets it dequeues.
-		 */
-		TULIP_CSR_WRITE(sc, csr_command, sc->tulip_cmdmode & ~TULIP_CMD_RXRUN);
-		while ((TULIP_CSR_READ(sc, csr_status) & TULIP_STS_RXSTOPPED) == 0)
-		    ;
-		TULIP_CSR_WRITE(sc, csr_status, TULIP_STS_RXSTOPPED);
-		sc->tulip_flags |= TULIP_RXIGNORE;
-	    }
-	    tulip_rx_intr(sc);
-	    if (sc->tulip_flags & TULIP_RXIGNORE) {
-		/*
-		 * Restart the receiver.
-		 */
-		sc->tulip_flags &= ~TULIP_RXIGNORE;
-		TULIP_CSR_WRITE(sc, csr_command, sc->tulip_cmdmode);
-	    }
-	}
-	if (csr & TULIP_STS_ABNRMLINTR) {
-	    u_int32_t tmp = csr & sc->tulip_intrmask
-		& ~(TULIP_STS_NORMALINTR|TULIP_STS_ABNRMLINTR);
-	    if (csr & TULIP_STS_TXUNDERFLOW) {
-		if ((sc->tulip_cmdmode & TULIP_CMD_THRESHOLDCTL) != TULIP_CMD_THRSHLD160) {
-		    sc->tulip_cmdmode += TULIP_CMD_THRSHLD96;
-		    sc->tulip_flags |= TULIP_NEWTXTHRESH;
-		} else if (sc->tulip_features & TULIP_HAVE_STOREFWD) {
-		    sc->tulip_cmdmode |= TULIP_CMD_STOREFWD;
-		    sc->tulip_flags |= TULIP_NEWTXTHRESH;
-		}
-	    }
-	    if (sc->tulip_flags & TULIP_NOMESSAGES) {
-		sc->tulip_statusbits |= tmp;
-	    } else {
-		tulip_print_abnormal_interrupt(sc, tmp);
-		sc->tulip_flags |= TULIP_NOMESSAGES;
-	    }
-	    TULIP_CSR_WRITE(sc, csr_command, sc->tulip_cmdmode);
-	}
-	if (sc->tulip_flags & (TULIP_WANTTXSTART|TULIP_TXPROBE_ACTIVE|TULIP_DOINGSETUP|TULIP_PROMISC)) {
-	    tulip_tx_intr(sc);
-	    if ((sc->tulip_flags & TULIP_TXPROBE_ACTIVE) == 0)
-		tulip_start_locked(sc);
-	}
-    }
-    if (sc->tulip_flags & TULIP_NEEDRESET) {
-	tulip_reset(sc);
-	tulip_init_locked(sc);
-    }
-    TULIP_PERFEND(intr);
-}
-
-static void
-tulip_intr_shared(void *arg)
-{
-    tulip_softc_t * sc = arg;
-
-    for (; sc != NULL; sc = sc->tulip_slaves) {
-	TULIP_LOCK(sc);
-#if defined(TULIP_DEBUG)
-	sc->tulip_dbg.dbg_intrs++;
-#endif
-	tulip_intr_handler(sc);
-	TULIP_UNLOCK(sc);
-    }
-}
-
-static void
-tulip_intr_normal(void *arg)
-{
-    tulip_softc_t * sc = (tulip_softc_t *) arg;
-
-    TULIP_LOCK(sc);
-#if defined(TULIP_DEBUG)
-    sc->tulip_dbg.dbg_intrs++;
-#endif
-    tulip_intr_handler(sc);
-    TULIP_UNLOCK(sc);
-}
-
-static struct mbuf *
-tulip_txput(tulip_softc_t * const sc, struct mbuf *m)
-{
-    TULIP_PERFSTART(txput)
-    tulip_ringinfo_t * const ri = &sc->tulip_txinfo;
-    tulip_descinfo_t *eop, *nextout;
-    int segcnt, free;
-    u_int32_t d_status;
-    bus_dma_segment_t segs[TULIP_MAX_TXSEG];
-    bus_dmamap_t *map;
-    int error, nsegs;
-    struct mbuf *m0;
-
-    TULIP_LOCK_ASSERT(sc);
-#if defined(TULIP_DEBUG)
-    if ((sc->tulip_cmdmode & TULIP_CMD_TXRUN) == 0) {
-	if_printf(sc->tulip_ifp, "txput%s: tx not running\n",
-	       (sc->tulip_flags & TULIP_TXPROBE_ACTIVE) ? "(probe)" : "");
-	sc->tulip_flags |= TULIP_WANTTXSTART;
-	sc->tulip_dbg.dbg_txput_finishes[0]++;
-	goto finish;
-    }
-#endif
-
-    /*
-     * Now we try to fill in our transmit descriptors.  This is
-     * a bit reminiscent of going on the Ark two by two
-     * since each descriptor for the TULIP can describe
-     * two buffers.  So we advance through packet filling
-     * each of the two entries at a time to to fill each
-     * descriptor.  Clear the first and last segment bits
-     * in each descriptor (actually just clear everything
-     * but the end-of-ring or chain bits) to make sure
-     * we don't get messed up by previously sent packets.
-     *
-     * We may fail to put the entire packet on the ring if
-     * there is either not enough ring entries free or if the
-     * packet has more than MAX_TXSEG segments.  In the former
-     * case we will just wait for the ring to empty.  In the
-     * latter case we have to recopy.
-     */
-#if defined(KTR) && KTR_TULIP
-    segcnt = 1;
-    m0 = m;
-    while (m0->m_next != NULL) {
-	    segcnt++;
-	    m0 = m0->m_next;
-    }
-#endif
-    CTR2(KTR_TULIP, "tulip_txput: sending packet %p (%d chunks)", m, segcnt);
-    d_status = 0;
-    eop = nextout = ri->ri_nextout;
-    segcnt = 0;
-    free = ri->ri_free;
-
-    /*
-     * Reclaim some tx descriptors if we are out since we need at least one
-     * free descriptor so that we have a dma_map to load the mbuf.
-     */
-    if (free == 0) {
-#if defined(TULIP_DEBUG)
-	sc->tulip_dbg.dbg_no_txmaps++;
-#endif
-	free += tulip_tx_intr(sc);
-    }
-    if (free == 0) {
-	sc->tulip_flags |= TULIP_WANTTXSTART;
-#if defined(TULIP_DEBUG)
-	sc->tulip_dbg.dbg_txput_finishes[1]++;
-#endif
-	goto finish;
-    }
-    error = bus_dmamap_load_mbuf_sg(ri->ri_data_tag, *eop->di_map, m, segs,
-	&nsegs, BUS_DMA_NOWAIT);
-    if (error != 0) {
-	if (error == EFBIG) {
-	    /*
-	     * The packet exceeds the number of transmit buffer
-	     * entries that we can use for one packet, so we have
-	     * to recopy it into one mbuf and then try again.  If
-	     * we can't recopy it, try again later.
-	     */
-	    m0 = m_defrag(m, M_DONTWAIT);
-	    if (m0 == NULL) {
-		sc->tulip_flags |= TULIP_WANTTXSTART;
-#if defined(TULIP_DEBUG)
-		sc->tulip_dbg.dbg_txput_finishes[2]++;
-#endif
-		goto finish;
-	    }
-	    m = m0;
-	    error = bus_dmamap_load_mbuf_sg(ri->ri_data_tag, *eop->di_map, m,
-		segs, &nsegs, BUS_DMA_NOWAIT);
-	}
-	if (error != 0) {
-	    if_printf(sc->tulip_ifp,
-	        "unable to load tx map, error = %d\n", error);
-#if defined(TULIP_DEBUG)
-	    sc->tulip_dbg.dbg_txput_finishes[3]++;
-#endif
-	    goto finish;
-	}
-    }
-    CTR1(KTR_TULIP, "tulip_txput: nsegs %d", nsegs);
-
-    /*
-     * Each descriptor allows for up to 2 fragments since we don't use
-     * the descriptor chaining mode in this driver.
-     */
-    if ((free -= (nsegs + 1) / 2) <= 0
-	    /*
-	     * See if there's any unclaimed space in the transmit ring.
-	     */
-	    && (free += tulip_tx_intr(sc)) <= 0) {
-	/*
-	 * There's no more room but since nothing
-	 * has been committed at this point, just
-	 * show output is active, put back the
-	 * mbuf and return.
-	 */
-	sc->tulip_flags |= TULIP_WANTTXSTART;
-#if defined(TULIP_DEBUG)
-	sc->tulip_dbg.dbg_txput_finishes[4]++;
-#endif
-	bus_dmamap_unload(ri->ri_data_tag, *eop->di_map);
-	goto finish;
-    }
-    for (; nsegs - segcnt > 1; segcnt += 2) {
-	eop = nextout;
-	eop->di_desc->d_flag   &= TULIP_DFLAG_ENDRING|TULIP_DFLAG_CHAIN;
-	eop->di_desc->d_status  = d_status;
-	eop->di_desc->d_addr1   = segs[segcnt].ds_addr;
-	eop->di_desc->d_length1 = segs[segcnt].ds_len;
-	eop->di_desc->d_addr2   = segs[segcnt+1].ds_addr;
-	eop->di_desc->d_length2 = segs[segcnt+1].ds_len;
-	d_status = TULIP_DSTS_OWNER;
-	if (++nextout == ri->ri_last)
-	    nextout = ri->ri_first;
-    }
-    if (segcnt < nsegs) {
-	eop = nextout;
-	eop->di_desc->d_flag   &= TULIP_DFLAG_ENDRING|TULIP_DFLAG_CHAIN;
-	eop->di_desc->d_status  = d_status;
-	eop->di_desc->d_addr1   = segs[segcnt].ds_addr;
-	eop->di_desc->d_length1 = segs[segcnt].ds_len;
-	eop->di_desc->d_addr2   = 0;
-	eop->di_desc->d_length2 = 0;
-	if (++nextout == ri->ri_last)
-	    nextout = ri->ri_first;
-    }
-
-    /*
-     * tulip_tx_intr() harvests the mbuf from the last descriptor in the
-     * frame.  We just used the dmamap in the first descriptor for the
-     * load operation however.  Thus, to let the tulip_dequeue_mbuf() call
-     * in tulip_tx_intr() unload the correct dmamap, we swap the dmamap
-     * pointers in the two descriptors if this is a multiple-descriptor
-     * packet.
-     */
-    if (eop != ri->ri_nextout) {
-	    map = eop->di_map;
-	    eop->di_map = ri->ri_nextout->di_map;
-	    ri->ri_nextout->di_map = map;
-    }
-
-    /*
-     * bounce a copy to the bpf listener, if any.
-     */
-    BPF_MTAP(sc->tulip_ifp, m);
-
-    /*
-     * The descriptors have been filled in.  Now get ready
-     * to transmit.
-     */
-    CTR3(KTR_TULIP, "tulip_txput: enqueued mbuf %p to descriptors %td - %td",
-	m, ri->ri_nextout - ri->ri_first, eop - ri->ri_first);
-    KASSERT(eop->di_mbuf == NULL, ("clobbering earlier tx mbuf"));
-    eop->di_mbuf = m;
-    TULIP_TXMAP_PRESYNC(ri, ri->ri_nextout);
-    m = NULL;
-
-    /*
-     * Make sure the next descriptor after this packet is owned
-     * by us since it may have been set up above if we ran out
-     * of room in the ring.
-     */
-    nextout->di_desc->d_status = 0;
-    TULIP_TXDESC_PRESYNC(ri);
-
-    /*
-     * Mark the last and first segments, indicate we want a transmit
-     * complete interrupt, and tell it to transmit!
-     */
-    eop->di_desc->d_flag |= TULIP_DFLAG_TxLASTSEG|TULIP_DFLAG_TxWANTINTR;
-
-    /*
-     * Note that ri->ri_nextout is still the start of the packet
-     * and until we set the OWNER bit, we can still back out of
-     * everything we have done.
-     */
-    ri->ri_nextout->di_desc->d_flag |= TULIP_DFLAG_TxFIRSTSEG;
-    TULIP_TXDESC_PRESYNC(ri);
-    ri->ri_nextout->di_desc->d_status = TULIP_DSTS_OWNER;
-    TULIP_TXDESC_PRESYNC(ri);
-
-    /*
-     * This advances the ring for us.
-     */
-    ri->ri_nextout = nextout;
-    ri->ri_free = free;
-
-    TULIP_PERFEND(txput);
-
-    if (sc->tulip_flags & TULIP_TXPROBE_ACTIVE) {
-	TULIP_CSR_WRITE(sc, csr_txpoll, 1);
-	sc->tulip_ifp->if_drv_flags |= IFF_DRV_OACTIVE;
-	TULIP_PERFEND(txput);
-	return NULL;
-    }
-
-    /*
-     * switch back to the single queueing ifstart.
-     */
-    sc->tulip_flags &= ~TULIP_WANTTXSTART;
-    if (sc->tulip_txtimer == 0)
-	sc->tulip_txtimer = TULIP_TXTIMER;
-#if defined(TULIP_DEBUG)
-    sc->tulip_dbg.dbg_txput_finishes[5]++;
-#endif
-
-    /*
-     * If we want a txstart, there must be not enough space in the
-     * transmit ring.  So we want to enable transmit done interrupts
-     * so we can immediately reclaim some space.  When the transmit
-     * interrupt is posted, the interrupt handler will call tx_intr
-     * to reclaim space and then txstart (since WANTTXSTART is set).
-     * txstart will move the packet into the transmit ring and clear
-     * WANTTXSTART thereby causing TXINTR to be cleared.
-     */
-  finish:
-#if defined(TULIP_DEBUG)
-    sc->tulip_dbg.dbg_txput_finishes[6]++;
-#endif
-    if (sc->tulip_flags & (TULIP_WANTTXSTART|TULIP_DOINGSETUP)) {
-	sc->tulip_ifp->if_drv_flags |= IFF_DRV_OACTIVE;
-	if ((sc->tulip_intrmask & TULIP_STS_TXINTR) == 0) {
-	    sc->tulip_intrmask |= TULIP_STS_TXINTR;
-	    TULIP_CSR_WRITE(sc, csr_intr, sc->tulip_intrmask);
-	}
-    } else if ((sc->tulip_flags & TULIP_PROMISC) == 0) {
-	if (sc->tulip_intrmask & TULIP_STS_TXINTR) {
-	    sc->tulip_intrmask &= ~TULIP_STS_TXINTR;
-	    TULIP_CSR_WRITE(sc, csr_intr, sc->tulip_intrmask);
-	}
-    }
-    TULIP_CSR_WRITE(sc, csr_txpoll, 1);
-    TULIP_PERFEND(txput);
-    return m;
-}
-
-static void
-tulip_txput_setup(tulip_softc_t * const sc)
-{
-    tulip_ringinfo_t * const ri = &sc->tulip_txinfo;
-    tulip_desc_t *nextout;
-
-    TULIP_LOCK_ASSERT(sc);
-
-    /*
-     * We will transmit, at most, one setup packet per call to ifstart.
-     */
-
-#if defined(TULIP_DEBUG)
-    if ((sc->tulip_cmdmode & TULIP_CMD_TXRUN) == 0) {
-	if_printf(sc->tulip_ifp, "txput_setup: tx not running\n");
-	sc->tulip_flags |= TULIP_WANTTXSTART;
-	return;
-    }
-#endif
-    /*
-     * Try to reclaim some free descriptors..
-     */
-    if (ri->ri_free < 2)
-	tulip_tx_intr(sc);
-    if ((sc->tulip_flags & TULIP_DOINGSETUP) || ri->ri_free == 1) {
-	sc->tulip_flags |= TULIP_WANTTXSTART;
-	return;
-    }
-    bcopy(sc->tulip_setupdata, sc->tulip_setupbuf,
-	  sizeof(sc->tulip_setupdata));
-    /*
-     * Clear WANTSETUP and set DOINGSETUP.  Since we know that WANTSETUP is
-     * set and DOINGSETUP is clear doing an XOR of the two will DTRT.
-     */
-    sc->tulip_flags ^= TULIP_WANTSETUP|TULIP_DOINGSETUP;
-    ri->ri_free--;
-    nextout = ri->ri_nextout->di_desc;
-    nextout->d_flag &= TULIP_DFLAG_ENDRING|TULIP_DFLAG_CHAIN;
-    nextout->d_flag |= TULIP_DFLAG_TxFIRSTSEG|TULIP_DFLAG_TxLASTSEG
-	|TULIP_DFLAG_TxSETUPPKT|TULIP_DFLAG_TxWANTINTR;
-    if (sc->tulip_flags & TULIP_WANTHASHPERFECT)
-	nextout->d_flag |= TULIP_DFLAG_TxHASHFILT;
-    else if (sc->tulip_flags & TULIP_WANTHASHONLY)
-	nextout->d_flag |= TULIP_DFLAG_TxHASHFILT|TULIP_DFLAG_TxINVRSFILT;
-
-    nextout->d_length2 = 0;
-    nextout->d_addr2 = 0;
-    nextout->d_length1 = sizeof(sc->tulip_setupdata);
-    nextout->d_addr1 = sc->tulip_setup_dma_addr;
-    bus_dmamap_sync(sc->tulip_setup_tag, sc->tulip_setup_map,
-	BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
-    TULIP_TXDESC_PRESYNC(ri);
-    CTR1(KTR_TULIP, "tulip_txput_setup: using descriptor %td",
-	ri->ri_nextout - ri->ri_first);
-
-    /*
-     * Advance the ring for the next transmit packet.
-     */
-    if (++ri->ri_nextout == ri->ri_last)
-	ri->ri_nextout = ri->ri_first;
-
-    /*
-     * Make sure the next descriptor is owned by us since it
-     * may have been set up above if we ran out of room in the
-     * ring.
-     */
-    ri->ri_nextout->di_desc->d_status = 0;
-    TULIP_TXDESC_PRESYNC(ri);
-    nextout->d_status = TULIP_DSTS_OWNER;
-    /*
-     * Flush the ownwership of the current descriptor
-     */
-    TULIP_TXDESC_PRESYNC(ri);
-    TULIP_CSR_WRITE(sc, csr_txpoll, 1);
-    if ((sc->tulip_intrmask & TULIP_STS_TXINTR) == 0) {
-	sc->tulip_intrmask |= TULIP_STS_TXINTR;
-	TULIP_CSR_WRITE(sc, csr_intr, sc->tulip_intrmask);
-    }
-}
-
-static int
-tulip_ifioctl(struct ifnet * ifp, u_long cmd, caddr_t data)
-{
-    TULIP_PERFSTART(ifioctl)
-    tulip_softc_t * const sc = (tulip_softc_t *)ifp->if_softc;
-    struct ifreq *ifr = (struct ifreq *) data;
-    int error = 0;
-
-    switch (cmd) {
-	case SIOCSIFFLAGS: {
-	    TULIP_LOCK(sc);
-	    tulip_addr_filter(sc); /* reinit multicast filter */
-	    tulip_init_locked(sc);
-	    TULIP_UNLOCK(sc);
-	    break;
-	}
-
-	case SIOCSIFMEDIA:
-	case SIOCGIFMEDIA: {
-	    error = ifmedia_ioctl(ifp, ifr, &sc->tulip_ifmedia, cmd);
-	    break;
-	}
-
-	case SIOCADDMULTI:
-	case SIOCDELMULTI: {
-	    /*
-	     * Update multicast listeners
-	     */
-	    TULIP_LOCK(sc);
-	    tulip_addr_filter(sc);		/* reset multicast filtering */
-	    tulip_init_locked(sc);
-	    TULIP_UNLOCK(sc);
-	    error = 0;
-	    break;
-	}
-
-#ifdef SIOCGADDRROM
-	case SIOCGADDRROM: {
-	    error = copyout(sc->tulip_rombuf, ifr->ifr_data, sizeof(sc->tulip_rombuf));
-	    break;
-	}
-#endif
-#ifdef SIOCGCHIPID
-	case SIOCGCHIPID: {
-	    ifr->ifr_metric = (int) sc->tulip_chipid;
-	    break;
-	}
-#endif
-	default: {
-	    error = ether_ioctl(ifp, cmd, data);
-	    break;
-	}
-    }
-
-    TULIP_PERFEND(ifioctl);
-    return error;
-}
-
-static void
-tulip_start(struct ifnet * const ifp)
-{
-    TULIP_PERFSTART(ifstart)
-    tulip_softc_t * const sc = (tulip_softc_t *)ifp->if_softc;
-
-    TULIP_LOCK(sc);
-    tulip_start_locked(sc);
-    TULIP_UNLOCK(sc);
-
-    TULIP_PERFEND(ifstart);
-}
-
-static void
-tulip_start_locked(tulip_softc_t * const sc)
-{
-    struct mbuf *m;
-
-    TULIP_LOCK_ASSERT(sc);
-
-    CTR0(KTR_TULIP, "tulip_start_locked invoked");
-    if ((sc->tulip_flags & (TULIP_WANTSETUP|TULIP_TXPROBE_ACTIVE)) == TULIP_WANTSETUP)
-	tulip_txput_setup(sc);
-
-    CTR1(KTR_TULIP, "tulip_start_locked: %d tx packets pending",
-	sc->tulip_ifp->if_snd.ifq_len);
-    while (!IFQ_DRV_IS_EMPTY(&sc->tulip_ifp->if_snd)) {
-	IFQ_DRV_DEQUEUE(&sc->tulip_ifp->if_snd, m);
-	if(m == NULL)
-	    break;
-	if ((m = tulip_txput(sc, m)) != NULL) {
-	    IFQ_DRV_PREPEND(&sc->tulip_ifp->if_snd, m);
-	    break;
-	}
-    }
-}
-
-/*
- * Even though this routine runs at device spl, it does not break
- * our use of splnet (splsoftnet under NetBSD) for the majority
- * of this driver since 
- * if_watcbog is called from if_watchdog which is called from
- * splsoftclock which is below spl[soft]net.
- */
-static void
-tulip_ifwatchdog(struct ifnet *ifp)
-{
-    TULIP_PERFSTART(ifwatchdog)
-    tulip_softc_t * const sc = (tulip_softc_t *)ifp->if_softc;
-#if defined(TULIP_DEBUG)
-    u_int32_t rxintrs;
-#endif
-
-    TULIP_LOCK(sc);
-#if defined(TULIP_DEBUG)
-    rxintrs = sc->tulip_dbg.dbg_rxintrs - sc->tulip_dbg.dbg_last_rxintrs;
-    if (rxintrs > sc->tulip_dbg.dbg_high_rxintrs_hz)
-	sc->tulip_dbg.dbg_high_rxintrs_hz = rxintrs;
-    sc->tulip_dbg.dbg_last_rxintrs = sc->tulip_dbg.dbg_rxintrs;
-#endif /* TULIP_DEBUG */
-
-    sc->tulip_ifp->if_timer = 1;
-    /*
-     * These should be rare so do a bulk test up front so we can just skip
-     * them if needed.
-     */
-    if (sc->tulip_flags & (TULIP_SYSTEMERROR|TULIP_RXBUFSLOW|TULIP_NOMESSAGES)) {
-	/*
-	 * If the number of receive buffer is low, try to refill
-	 */
-	if (sc->tulip_flags & TULIP_RXBUFSLOW)
-	    tulip_rx_intr(sc);
-
-	if (sc->tulip_flags & TULIP_SYSTEMERROR) {
-	    if_printf(sc->tulip_ifp, "%d system errors: last was %s\n",
-		   sc->tulip_system_errors,
-		   tulip_system_errors[sc->tulip_last_system_error]);
-	}
-	if (sc->tulip_statusbits) {
-	    tulip_print_abnormal_interrupt(sc, sc->tulip_statusbits);
-	    sc->tulip_statusbits = 0;
-	}
-
-	sc->tulip_flags &= ~(TULIP_NOMESSAGES|TULIP_SYSTEMERROR);
-    }
-
-    if (sc->tulip_txtimer)
-	tulip_tx_intr(sc);
-    if (sc->tulip_txtimer && --sc->tulip_txtimer == 0) {
-	if_printf(sc->tulip_ifp, "transmission timeout\n");
-	if (TULIP_DO_AUTOSENSE(sc)) {
-	    sc->tulip_media = TULIP_MEDIA_UNKNOWN;
-	    sc->tulip_probe_state = TULIP_PROBE_INACTIVE;
-	    sc->tulip_flags &= ~(TULIP_WANTRXACT|TULIP_LINKUP);
-	}
-	tulip_reset(sc);
-	tulip_init_locked(sc);
-    }
-
-    TULIP_PERFEND(ifwatchdog);
-    TULIP_PERFMERGE(sc, perf_intr_cycles);
-    TULIP_PERFMERGE(sc, perf_ifstart_cycles);
-    TULIP_PERFMERGE(sc, perf_ifioctl_cycles);
-    TULIP_PERFMERGE(sc, perf_ifwatchdog_cycles);
-    TULIP_PERFMERGE(sc, perf_timeout_cycles);
-    TULIP_PERFMERGE(sc, perf_ifstart_one_cycles);
-    TULIP_PERFMERGE(sc, perf_txput_cycles);
-    TULIP_PERFMERGE(sc, perf_txintr_cycles);
-    TULIP_PERFMERGE(sc, perf_rxintr_cycles);
-    TULIP_PERFMERGE(sc, perf_rxget_cycles);
-    TULIP_PERFMERGE(sc, perf_intr);
-    TULIP_PERFMERGE(sc, perf_ifstart);
-    TULIP_PERFMERGE(sc, perf_ifioctl);
-    TULIP_PERFMERGE(sc, perf_ifwatchdog);
-    TULIP_PERFMERGE(sc, perf_timeout);
-    TULIP_PERFMERGE(sc, perf_ifstart_one);
-    TULIP_PERFMERGE(sc, perf_txput);
-    TULIP_PERFMERGE(sc, perf_txintr);
-    TULIP_PERFMERGE(sc, perf_rxintr);
-    TULIP_PERFMERGE(sc, perf_rxget);
-    TULIP_UNLOCK(sc);
-}
-
-static void
-tulip_attach(tulip_softc_t * const sc)
-{
-    struct ifnet *ifp;
-
-    ifp = sc->tulip_ifp = if_alloc(IFT_ETHER);
-
-    /* XXX: driver name/unit should be set some other way */
-    if_initname(ifp, "de", sc->tulip_unit);
-    ifp->if_softc = sc;
-    ifp->if_flags = IFF_BROADCAST|IFF_SIMPLEX|IFF_MULTICAST;
-    ifp->if_ioctl = tulip_ifioctl;
-    ifp->if_start = tulip_start;
-    ifp->if_watchdog = tulip_ifwatchdog;
-    ifp->if_timer = 1;
-    ifp->if_init = tulip_init;
-    IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen);
-    ifp->if_snd.ifq_drv_maxlen = ifqmaxlen;
-    IFQ_SET_READY(&ifp->if_snd);
-  
-    if_printf(ifp, "%s%s pass %d.%d%s\n",
-	   sc->tulip_boardid,
-	   tulip_chipdescs[sc->tulip_chipid],
-	   (sc->tulip_revinfo & 0xF0) >> 4,
-	   sc->tulip_revinfo & 0x0F,
-	   (sc->tulip_features & (TULIP_HAVE_ISVSROM|TULIP_HAVE_OKSROM))
-		 == TULIP_HAVE_ISVSROM ? " (invalid EESPROM checksum)" : "");
-
-    TULIP_LOCK(sc);
-#if defined(__alpha__)
-    /*
-     * In case the SRM console told us about a bogus media,
-     * we need to check to be safe.
-     */
-    if (sc->tulip_mediums[sc->tulip_media] == NULL)
-	sc->tulip_media = TULIP_MEDIA_UNKNOWN;
-#endif
-
-    (*sc->tulip_boardsw->bd_media_probe)(sc);
-    ifmedia_init(&sc->tulip_ifmedia, 0,
-		 tulip_ifmedia_change,
-		 tulip_ifmedia_status);
-    sc->tulip_flags &= ~TULIP_DEVICEPROBE;
-    tulip_ifmedia_add(sc);
-
-    tulip_reset(sc);
-    TULIP_UNLOCK(sc);
-
-    ether_ifattach(sc->tulip_ifp, sc->tulip_enaddr);
-}
-
-/* Release memory for a single descriptor ring. */
-static void
-tulip_busdma_freering(tulip_ringinfo_t *ri)
-{
-    int i;
-
-    /* Release the DMA maps and tag for data buffers. */
-    if (ri->ri_data_maps != NULL) {
-	for (i = 0; i < ri->ri_max; i++) {
-	    if (ri->ri_data_maps[i] != NULL) {
-		bus_dmamap_destroy(ri->ri_data_tag, ri->ri_data_maps[i]);
-		ri->ri_data_maps[i] = NULL;
-	    }
-	}
-	free(ri->ri_data_maps, M_DEVBUF);
-	ri->ri_data_maps = NULL;
-    }
-    if (ri->ri_data_tag != NULL) {
-	bus_dma_tag_destroy(ri->ri_data_tag);
-	ri->ri_data_tag = NULL;
-    }
-
-    /* Release the DMA memory and tag for the ring descriptors. */
-    if (ri->ri_dma_addr != 0) {
-	bus_dmamap_unload(ri->ri_ring_tag, ri->ri_ring_map);
-	ri->ri_dma_addr = 0;
-    }
-    if (ri->ri_descs != NULL) {
-	bus_dmamem_free(ri->ri_ring_tag, ri->ri_descs, ri->ri_ring_map);
-	ri->ri_ring_map = NULL;
-	ri->ri_descs = NULL;
-    }
-    if (ri->ri_ring_tag != NULL) {
-	bus_dma_tag_destroy(ri->ri_ring_tag);
-	ri->ri_ring_tag = NULL;
-    }
-}
-
-/* Allocate memory for a single descriptor ring. */
-static int
-tulip_busdma_allocring(device_t dev, tulip_softc_t * const sc, size_t count,
-    bus_size_t maxsize, int nsegs, tulip_ringinfo_t *ri, const char *name)
-{
-    size_t size;
-    int error, i;
-
-    /* First, setup a tag. */
-    ri->ri_max = count;
-    size = count * sizeof(tulip_desc_t);
-    error = bus_dma_tag_create(NULL, PAGE_SIZE, 0, BUS_SPACE_MAXADDR_32BIT,
-	BUS_SPACE_MAXADDR, NULL, NULL, size, 1, size, 0, NULL, NULL,
-	&ri->ri_ring_tag);
-    if (error) {
-	device_printf(dev, "failed to allocate %s descriptor ring dma tag\n",
-	    name);
-	return (error);
-    }
-
-    /* Next, allocate memory for the descriptors. */
-    error = bus_dmamem_alloc(ri->ri_ring_tag, (void **)&ri->ri_descs,
-	BUS_DMA_NOWAIT | BUS_DMA_ZERO, &ri->ri_ring_map);
-    if (error) {
-	device_printf(dev, "failed to allocate memory for %s descriptor ring\n",
-	    name);
-	return (error);
-    }
-
-    /* Map the descriptors. */
-    error = bus_dmamap_load(ri->ri_ring_tag, ri->ri_ring_map, ri->ri_descs,
-	size, tulip_dma_map_addr, &ri->ri_dma_addr, BUS_DMA_NOWAIT);
-    if (error) {
-	device_printf(dev, "failed to get dma address for %s descriptor ring\n",
-	    name);
-	return (error);
-    }
-
-    /* Allocate a tag for the data buffers. */
-    error = bus_dma_tag_create(NULL, 4, 0,
-	BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
-	maxsize, nsegs, TULIP_DATA_PER_DESC, 0, NULL, NULL, &ri->ri_data_tag);
-    if (error) {
-	device_printf(dev, "failed to allocate %s buffer dma tag\n", name);
-	return (error);
-    }
-
-    /* Allocate maps for the data buffers. */
-    ri->ri_data_maps = malloc(sizeof(bus_dmamap_t) * count, M_DEVBUF,
-	M_WAITOK | M_ZERO);
-    for (i = 0; i < count; i++) {
-    	error = bus_dmamap_create(ri->ri_data_tag, 0, &ri->ri_data_maps[i]);
-	if (error) {
-	    device_printf(dev, "failed to create map for %s buffer %d\n",
-		name, i);
-	    return (error);
-	}
-    }
-
-    return (0);
-}
-
-/* Release busdma maps, tags, and memory. */
-static void
-tulip_busdma_cleanup(tulip_softc_t * const sc)
-{
-
-    /* Release resources for the setup descriptor. */
-    if (sc->tulip_setup_dma_addr != 0) {
-	bus_dmamap_unload(sc->tulip_setup_tag, sc->tulip_setup_map);
-	sc->tulip_setup_dma_addr = 0;
-    }
-    if (sc->tulip_setupbuf != NULL) {
-	bus_dmamem_free(sc->tulip_setup_tag, sc->tulip_setupdata,
-	    sc->tulip_setup_map);
-	sc->tulip_setup_map = NULL;
-	sc->tulip_setupbuf = NULL;
-    }
-    if (sc->tulip_setup_tag != NULL) {
-	bus_dma_tag_destroy(sc->tulip_setup_tag);
-	sc->tulip_setup_tag = NULL;
-    }
-
-    /* Release the transmit ring. */
-    tulip_busdma_freering(&sc->tulip_txinfo);
-
-    /* Release the receive ring. */
-    tulip_busdma_freering(&sc->tulip_rxinfo);
-}
-
-static int
-tulip_busdma_init(device_t dev, tulip_softc_t * const sc)
-{
-    int error;
-
-    /*
-     * Allocate space and dmamap for transmit ring.
-     */
-    error = tulip_busdma_allocring(dev, sc, TULIP_TXDESCS, TULIP_DATA_PER_DESC,
-	TULIP_MAX_TXSEG, &sc->tulip_txinfo, "transmit");
-    if (error)
-	return (error);
-
-    /*
-     * Allocate space and dmamap for receive ring.  We tell bus_dma that
-     * we can map MCLBYTES so that it will accept a full MCLBYTES cluster,
-     * but we will only map the first TULIP_RX_BUFLEN bytes.  This is not
-     * a waste in practice though as an ethernet frame can easily fit
-     * in TULIP_RX_BUFLEN bytes.
-     */
-    error = tulip_busdma_allocring(dev, sc, TULIP_RXDESCS, MCLBYTES, 1,
-	&sc->tulip_rxinfo, "receive");
-    if (error)
-	return (error);
-
-    /*
-     * Allocate a DMA tag, memory, and map for setup descriptor
-     */
-    error = bus_dma_tag_create(NULL, 4, 0,
-	BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
-	sizeof(sc->tulip_setupdata), 1, sizeof(sc->tulip_setupdata), 0,
-	NULL, NULL, &sc->tulip_setup_tag);
-    if (error) {
-	device_printf(dev, "failed to allocate setup descriptor dma tag\n");
-	return (error);
-    }
-    error = bus_dmamem_alloc(sc->tulip_setup_tag, (void **)&sc->tulip_setupbuf,
-	BUS_DMA_NOWAIT | BUS_DMA_ZERO, &sc->tulip_setup_map);
-    if (error) {
-	device_printf(dev, "failed to allocate memory for setup descriptor\n");
-	return (error);
-    }
-    error = bus_dmamap_load(sc->tulip_setup_tag, sc->tulip_setup_map,
-	sc->tulip_setupbuf, sizeof(sc->tulip_setupdata), 
-	tulip_dma_map_addr, &sc->tulip_setup_dma_addr, BUS_DMA_NOWAIT);
-    if (error) {
-	device_printf(dev, "failed to get dma address for setup descriptor\n");
-	return (error);
-    }
-
-    return error;
-}
-
-static void
-tulip_initcsrs(tulip_softc_t * const sc, tulip_csrptr_t csr_base,
-    size_t csr_size)
-{
-    sc->tulip_csrs.csr_busmode		= csr_base +  0 * csr_size;
-    sc->tulip_csrs.csr_txpoll		= csr_base +  1 * csr_size;
-    sc->tulip_csrs.csr_rxpoll		= csr_base +  2 * csr_size;
-    sc->tulip_csrs.csr_rxlist		= csr_base +  3 * csr_size;
-    sc->tulip_csrs.csr_txlist		= csr_base +  4 * csr_size;
-    sc->tulip_csrs.csr_status		= csr_base +  5 * csr_size;
-    sc->tulip_csrs.csr_command		= csr_base +  6 * csr_size;
-    sc->tulip_csrs.csr_intr		= csr_base +  7 * csr_size;
-    sc->tulip_csrs.csr_missed_frames	= csr_base +  8 * csr_size;
-    sc->tulip_csrs.csr_9		= csr_base +  9 * csr_size;
-    sc->tulip_csrs.csr_10		= csr_base + 10 * csr_size;
-    sc->tulip_csrs.csr_11		= csr_base + 11 * csr_size;
-    sc->tulip_csrs.csr_12		= csr_base + 12 * csr_size;
-    sc->tulip_csrs.csr_13		= csr_base + 13 * csr_size;
-    sc->tulip_csrs.csr_14		= csr_base + 14 * csr_size;
-    sc->tulip_csrs.csr_15		= csr_base + 15 * csr_size;
-}
-
-static int
-tulip_initring(
-    device_t dev,
-    tulip_softc_t * const sc,
-    tulip_ringinfo_t * const ri,
-    int ndescs)
-{
-    int i;
-
-    ri->ri_descinfo = malloc(sizeof(tulip_descinfo_t) * ndescs, M_DEVBUF,
-	M_WAITOK | M_ZERO);
-    for (i = 0; i < ndescs; i++) {
-	ri->ri_descinfo[i].di_desc = &ri->ri_descs[i];
-	ri->ri_descinfo[i].di_map = &ri->ri_data_maps[i];
-    }
-    ri->ri_first = ri->ri_descinfo;
-    ri->ri_max = ndescs;
-    ri->ri_last = ri->ri_first + ri->ri_max;
-    bzero(ri->ri_descs, sizeof(tulip_desc_t) * ri->ri_max);
-    ri->ri_last[-1].di_desc->d_flag = TULIP_DFLAG_ENDRING;
-    return (0);
-}
-
-/*
- * This is the PCI configuration support.
- */
-
-#define	PCI_CBIO	PCIR_BAR(0)	/* Configuration Base IO Address */
-#define	PCI_CBMA	PCIR_BAR(1)	/* Configuration Base Memory Address */
-#define	PCI_CFDA	0x40	/* Configuration Driver Area */
-
-static int
-tulip_pci_probe(device_t dev)
-{
-    const char *name = NULL;
-
-    if (pci_get_vendor(dev) != DEC_VENDORID)
-	return ENXIO;
-
-    /*
-     * Some LanMedia WAN cards use the Tulip chip, but they have
-     * their own driver, and we should not recognize them
-     */
-    if (pci_get_subvendor(dev) == 0x1376)
-	return ENXIO;
-
-    switch (pci_get_device(dev)) {
-    case CHIPID_21040:
-	name = "Digital 21040 Ethernet";
-	break;
-    case CHIPID_21041:
-	name = "Digital 21041 Ethernet";
-	break;
-    case CHIPID_21140:
-	if (pci_get_revid(dev) >= 0x20)
-	    name = "Digital 21140A Fast Ethernet";
-	else
-	    name = "Digital 21140 Fast Ethernet";
-	break;
-    case CHIPID_21142:
-	if (pci_get_revid(dev) >= 0x20)
-	    name = "Digital 21143 Fast Ethernet";
-	else
-	    name = "Digital 21142 Fast Ethernet";
-	break;
-    }
-    if (name) {
-	device_set_desc(dev, name);
-	return BUS_PROBE_LOW_PRIORITY;
-    }
-    return ENXIO;
-}
-
-static int
-tulip_shutdown(device_t dev)
-{
-    tulip_softc_t * const sc = device_get_softc(dev);
-    TULIP_CSR_WRITE(sc, csr_busmode, TULIP_BUSMODE_SWRESET);
-    DELAY(10);	/* Wait 10 microseconds (actually 50 PCI cycles but at 
-		   33MHz that comes to two microseconds but wait a
-		   bit longer anyways) */
-    return 0;
-}
-
-static int
-tulip_pci_attach(device_t dev)
-{
-    tulip_softc_t *sc;
-#if defined(__alpha__)
-    tulip_media_t media = TULIP_MEDIA_UNKNOWN;
-#endif
-    int retval, idx;
-    u_int32_t revinfo, cfdainfo;
-    unsigned csroffset = TULIP_PCI_CSROFFSET;
-    unsigned csrsize = TULIP_PCI_CSRSIZE;
-    tulip_csrptr_t csr_base;
-    tulip_chipid_t chipid = TULIP_CHIPID_UNKNOWN;
-    struct resource *res;
-    int rid, unit;
-
-    unit = device_get_unit(dev);
-
-    if (unit >= TULIP_MAX_DEVICES) {
-	device_printf(dev, "not configured; limit of %d reached or exceeded\n",
-	       TULIP_MAX_DEVICES);
-	return ENXIO;
-    }
-
-    revinfo  = pci_get_revid(dev);
-    cfdainfo = pci_read_config(dev, PCI_CFDA, 4);
-
-    /* turn busmaster on in case BIOS doesn't set it */
-    pci_enable_busmaster(dev);
-
-    if (pci_get_vendor(dev) == DEC_VENDORID) {
-	if (pci_get_device(dev) == CHIPID_21040)
-		chipid = TULIP_21040;
-	else if (pci_get_device(dev) == CHIPID_21041)
-		chipid = TULIP_21041;
-	else if (pci_get_device(dev) == CHIPID_21140)
-		chipid = (revinfo >= 0x20) ? TULIP_21140A : TULIP_21140;
-	else if (pci_get_device(dev) == CHIPID_21142)
-		chipid = (revinfo >= 0x20) ? TULIP_21143 : TULIP_21142;
-    }
-    if (chipid == TULIP_CHIPID_UNKNOWN)
-	return ENXIO;
-
-    if (chipid == TULIP_21040 && revinfo < 0x20) {
-	device_printf(dev,
-	    "not configured; 21040 pass 2.0 required (%d.%d found)\n",
-	    revinfo >> 4, revinfo & 0x0f);
-	return ENXIO;
-    } else if (chipid == TULIP_21140 && revinfo < 0x11) {
-	device_printf(dev,
-	    "not configured; 21140 pass 1.1 required (%d.%d found)\n",
-	    revinfo >> 4, revinfo & 0x0f);
-	return ENXIO;
-    }
-
-    sc = device_get_softc(dev);
-    sc->tulip_pci_busno = pci_get_bus(dev);
-    sc->tulip_pci_devno = pci_get_slot(dev);
-    sc->tulip_chipid = chipid;
-    sc->tulip_flags |= TULIP_DEVICEPROBE;
-    if (chipid == TULIP_21140 || chipid == TULIP_21140A)
-	sc->tulip_features |= TULIP_HAVE_GPR|TULIP_HAVE_STOREFWD;
-    if (chipid == TULIP_21140A && revinfo <= 0x22)
-	sc->tulip_features |= TULIP_HAVE_RXBADOVRFLW;
-    if (chipid == TULIP_21140)
-	sc->tulip_features |= TULIP_HAVE_BROKEN_HASH;
-    if (chipid != TULIP_21040 && chipid != TULIP_21140)
-	sc->tulip_features |= TULIP_HAVE_POWERMGMT;
-    if (chipid == TULIP_21041 || chipid == TULIP_21142 || chipid == TULIP_21143) {
-	sc->tulip_features |= TULIP_HAVE_DUALSENSE;
-	if (chipid != TULIP_21041 || revinfo >= 0x20)
-	    sc->tulip_features |= TULIP_HAVE_SIANWAY;
-	if (chipid != TULIP_21041)
-	    sc->tulip_features |= TULIP_HAVE_SIAGP|TULIP_HAVE_RXBADOVRFLW|TULIP_HAVE_STOREFWD;
-	if (chipid != TULIP_21041 && revinfo >= 0x20)
-	    sc->tulip_features |= TULIP_HAVE_SIA100;
-    }
-
-    if (sc->tulip_features & TULIP_HAVE_POWERMGMT
-	    && (cfdainfo & (TULIP_CFDA_SLEEP|TULIP_CFDA_SNOOZE))) {
-	cfdainfo &= ~(TULIP_CFDA_SLEEP|TULIP_CFDA_SNOOZE);
-	pci_write_config(dev, PCI_CFDA, cfdainfo, 4);
-	DELAY(11*1000);
-    }
-#if defined(__alpha__) 
-    /*
-     * The Alpha SRM console encodes a console set media in the driver
-     * part of the CFDA register.  Note that the Multia presents a
-     * problem in that its BNC mode is really EXTSIA.  So in that case
-     * force a probe.
-     */
-    switch ((cfdainfo >> 8) & 0xff) {
-	case 1: media = chipid > TULIP_21040 ? TULIP_MEDIA_AUI : TULIP_MEDIA_AUIBNC; break;
-	case 2: media = chipid > TULIP_21040 ? TULIP_MEDIA_BNC : TULIP_MEDIA_UNKNOWN; break;
-	case 3: media = TULIP_MEDIA_10BASET; break;
-	case 4: media = TULIP_MEDIA_10BASET_FD; break;
-	case 5: media = TULIP_MEDIA_100BASETX; break;
-	case 6: media = TULIP_MEDIA_100BASETX_FD; break;
-	default: media = TULIP_MEDIA_UNKNOWN; break;
-    }
-#endif
-
-    sc->tulip_unit = unit;
-    sc->tulip_revinfo = revinfo;
-#if defined(TULIP_IOMAPPED)
-    rid = PCI_CBIO;
-    res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE);
-#else
-    rid = PCI_CBMA;
-    res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
-#endif
-    if (!res)
-	return ENXIO;
-    sc->tulip_csrs_bst = rman_get_bustag(res);
-    sc->tulip_csrs_bsh = rman_get_bushandle(res);
-    csr_base = 0;
-
-    mtx_init(TULIP_MUTEX(sc), MTX_NETWORK_LOCK, device_get_nameunit(dev),
-	MTX_DEF);
-    callout_init_mtx(&sc->tulip_callout, TULIP_MUTEX(sc), 0);
-    tulips[unit] = sc;
-
-    tulip_initcsrs(sc, csr_base + csroffset, csrsize);
-
-    if ((retval = tulip_busdma_init(dev, sc)) != 0) {
-	device_printf(dev, "error initing bus_dma: %d\n", retval);
-	tulip_busdma_cleanup(sc);
-	mtx_destroy(TULIP_MUTEX(sc));
-	return ENXIO;
-    }
-
-    retval = tulip_initring(dev, sc, &sc->tulip_rxinfo, TULIP_RXDESCS);
-    if (retval == 0)
-	retval = tulip_initring(dev, sc, &sc->tulip_txinfo, TULIP_TXDESCS);
-    if (retval) {
-	tulip_busdma_cleanup(sc);
-	mtx_destroy(TULIP_MUTEX(sc));
-	return retval;
-    }
-
-    /*
-     * Make sure there won't be any interrupts or such...
-     */
-    TULIP_CSR_WRITE(sc, csr_busmode, TULIP_BUSMODE_SWRESET);
-    DELAY(100);	/* Wait 10 microseconds (actually 50 PCI cycles but at 
-		   33MHz that comes to two microseconds but wait a
-		   bit longer anyways) */
-
-    TULIP_LOCK(sc);
-    retval = tulip_read_macaddr(sc);
-    TULIP_UNLOCK(sc);
-    if (retval < 0) {
-	device_printf(dev, "can't read ENET ROM (why=%d) (", retval);
-	for (idx = 0; idx < 32; idx++)
-	    printf("%02x", sc->tulip_rombuf[idx]);
-	printf("\n");
-	device_printf(dev, "%s%s pass %d.%d\n",
-	       sc->tulip_boardid, tulip_chipdescs[sc->tulip_chipid],
-	       (sc->tulip_revinfo & 0xF0) >> 4, sc->tulip_revinfo & 0x0F);
-	device_printf(dev, "address unknown\n");
-    } else {
-	void (*intr_rtn)(void *) = tulip_intr_normal;
-
-	if (sc->tulip_features & TULIP_HAVE_SHAREDINTR)
-	    intr_rtn = tulip_intr_shared;
-
-#if defined(__alpha__) 
-	sc->tulip_media = media;
-#endif
-	tulip_attach(sc);
-
-	/* Setup interrupt last. */
-	if ((sc->tulip_features & TULIP_HAVE_SLAVEDINTR) == 0) {
-	    void *ih;
-
-	    rid = 0;
-	    res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
-					 RF_SHAREABLE | RF_ACTIVE);
-	    if (res == 0 || bus_setup_intr(dev, res, INTR_TYPE_NET |
-		    INTR_MPSAFE, intr_rtn, sc, &ih)) {
-		device_printf(dev, "couldn't map interrupt\n");
-		tulip_busdma_cleanup(sc);
-		ether_ifdetach(sc->tulip_ifp);
-		if_free(sc->tulip_ifp);
-		mtx_destroy(TULIP_MUTEX(sc));
-		return ENXIO;
-	    }
-	}
-
-#if defined(__alpha__)
-	TULIP_LOCK(sc);
-	if (sc->tulip_media != TULIP_MEDIA_UNKNOWN)
-		tulip_linkup(sc, media);
-	TULIP_UNLOCK(sc);
-#endif
-    }
-    return 0;
-}
-
-static device_method_t tulip_pci_methods[] = {
-    /* Device interface */
-    DEVMETHOD(device_probe,	tulip_pci_probe),
-    DEVMETHOD(device_attach,	tulip_pci_attach),
-    DEVMETHOD(device_shutdown,	tulip_shutdown),
-    { 0, 0 }
-};
-
-static driver_t tulip_pci_driver = {
-    "de",
-    tulip_pci_methods,
-    sizeof(tulip_softc_t),
-};
-
-static devclass_t tulip_devclass;
-
-DRIVER_MODULE(de, pci, tulip_pci_driver, tulip_devclass, 0, 0);
-
-#ifdef DDB
-void	tulip_dumpring(int unit, int ring);
-void	tulip_dumpdesc(int unit, int ring, int desc);
-void	tulip_status(int unit);
-
-void
-tulip_dumpring(int unit, int ring)
-{
-    tulip_softc_t *sc;
-    tulip_ringinfo_t *ri;
-    tulip_descinfo_t *di;
-
-    if (unit < 0 || unit >= TULIP_MAX_DEVICES) {
-	db_printf("invalid unit %d\n", unit);
-	return;
-    }
-    sc = tulips[unit];
-    if (sc == NULL) {
-	db_printf("unit %d not present\n", unit);
-	return;
-    }
-
-    switch (ring) {
-    case 0:
-	db_printf("receive ring:\n");
-	ri = &sc->tulip_rxinfo;
-	break;
-    case 1:
-	db_printf("transmit ring:\n");
-	ri = &sc->tulip_txinfo;
-	break;
-    default:
-	db_printf("invalid ring %d\n", ring);
-	return;
-    }
-
-    db_printf(" nextin: %td, nextout: %td, max: %d, free: %d\n",
-	ri->ri_nextin - ri->ri_first, ri->ri_nextout - ri->ri_first,
-	ri->ri_max, ri->ri_free);
-    for (di = ri->ri_first; di != ri->ri_last; di++) {
-	if (di->di_mbuf != NULL)
-	    db_printf(" descriptor %td: mbuf %p\n", di - ri->ri_first,
-		di->di_mbuf);
-	else if (di->di_desc->d_flag & TULIP_DFLAG_TxSETUPPKT)
-	    db_printf(" descriptor %td: setup packet\n", di - ri->ri_first);
-    }
-}
-
-void
-tulip_dumpdesc(int unit, int ring, int desc)
-{
-    tulip_softc_t *sc;
-    tulip_ringinfo_t *ri;
-    tulip_descinfo_t *di;
-    char *s;
-
-    if (unit < 0 || unit >= TULIP_MAX_DEVICES) {
-	db_printf("invalid unit %d\n", unit);
-	return;
-    }
-    sc = tulips[unit];
-    if (sc == NULL) {
-	db_printf("unit %d not present\n", unit);
-	return;
-    }
-
-    switch (ring) {
-    case 0:
-	s = "receive";
-	ri = &sc->tulip_rxinfo;
-	break;
-    case 1:
-	s = "transmit";
-	ri = &sc->tulip_txinfo;
-	break;
-    default:
-	db_printf("invalid ring %d\n", ring);
-	return;
-    }
-
-    if (desc < 0 || desc >= ri->ri_max) {
-	db_printf("invalid descriptor %d\n", desc);
-	return;
-    }
-
-    db_printf("%s descriptor %d:\n", s, desc);
-    di = &ri->ri_first[desc];
-    db_printf(" mbuf: %p\n", di->di_mbuf);
-    db_printf(" status: %08x  flag: %03x\n", di->di_desc->d_status,
-	di->di_desc->d_flag);
-    db_printf("  addr1: %08x  len1: %03x\n", di->di_desc->d_addr1,
-	di->di_desc->d_length1);
-    db_printf("  addr2: %08x  len2: %03x\n", di->di_desc->d_addr2,
-	di->di_desc->d_length2);
-}
-#endif
--- sys/pci/dc21040reg.h
+++ /dev/null
@@ -1,583 +0,0 @@
-/*	$NetBSD: dc21040reg.h,v 1.15 1998/05/22 18:50:59 matt Exp $	*/
-
-/* $FreeBSD: src/sys/pci/dc21040reg.h,v 1.7 2002/06/02 20:05:55 schweikh Exp $ */
-
-/*-
- * Copyright (c) 1994, 1995, 1996 Matt Thomas <matt at 3am-software.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Id: dc21040reg.h,v 1.24 1997/05/16 19:47:09 thomas Exp
- */
-
-#if !defined(_DC21040_H)
-#define _DC21040_H
-
-#if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN
-#define	TULIP_BITFIELD2(a, b)		      b, a
-#define	TULIP_BITFIELD3(a, b, c)	   c, b, a
-#define	TULIP_BITFIELD4(a, b, c, d)	d, c, b, a
-#else
-#define	TULIP_BITFIELD2(a, b)		a, b
-#define	TULIP_BITFIELD3(a, b, c)	a, b, c
-#define	TULIP_BITFIELD4(a, b, c, d)	a, b, c, d
-#endif
-
-typedef struct {
-    u_int32_t d_status;
-    u_int32_t TULIP_BITFIELD3(d_length1 : 11,
-			      d_length2 : 11,
-			      d_flag : 10);
-    u_int32_t d_addr1;
-    u_int32_t d_addr2;
-} tulip_desc_t;
-
-#define	TULIP_DSTS_OWNER	0x80000000	/* Owner (1 = 21040) */
-#define	TULIP_DSTS_ERRSUM	0x00008000	/* Error Summary */
-/*
- * Transmit Status
- */
-#define	TULIP_DSTS_TxBABBLE	0x00004000	/* Transmitter Babbled */
-#define	TULIP_DSTS_TxCARRLOSS	0x00000800	/* Carrier Loss */
-#define	TULIP_DSTS_TxNOCARR	0x00000400	/* No Carrier */
-#define	TULIP_DSTS_TxLATECOLL	0x00000200	/* Late Collision */
-#define	TULIP_DSTS_TxEXCCOLL	0x00000100	/* Excessive Collisions */
-#define	TULIP_DSTS_TxNOHRTBT	0x00000080	/* No Heartbeat */
-#define	TULIP_DSTS_TxCOLLMASK	0x00000078	/* Collision Count (mask) */
-#define	TULIP_DSTS_V_TxCOLLCNT	0x00000003	/* Collision Count (bit) */
-#define	TULIP_DSTS_TxLINKFAIL	0x00000004	/* Link Failure */
-#define	TULIP_DSTS_TxUNDERFLOW	0x00000002	/* Underflow Error */
-#define	TULIP_DSTS_TxDEFERRED	0x00000001	/* Initially Deferred */
-/*
- * Receive Status
- */
-#define	TULIP_DSTS_RxBADLENGTH	0x00004000	/* Length Error */
-#define	TULIP_DSTS_RxDATATYPE	0x00003000	/* Data Type */
-#define	TULIP_DSTS_RxRUNT	0x00000800	/* Runt Frame */
-#define	TULIP_DSTS_RxMULTICAST	0x00000400	/* Multicast Frame */
-#define	TULIP_DSTS_RxFIRSTDESC	0x00000200	/* First Descriptor */
-#define	TULIP_DSTS_RxLASTDESC	0x00000100	/* Last Descriptor */
-#define	TULIP_DSTS_RxTOOLONG	0x00000080	/* Frame Too Long */
-#define	TULIP_DSTS_RxCOLLSEEN	0x00000040	/* Collision Seen */
-#define	TULIP_DSTS_RxFRAMETYPE	0x00000020	/* Frame Type */
-#define	TULIP_DSTS_RxWATCHDOG	0x00000010	/* Receive Watchdog */
-#define	TULIP_DSTS_RxDRBBLBIT	0x00000004	/* Dribble Bit */
-#define	TULIP_DSTS_RxBADCRC	0x00000002	/* CRC Error */
-#define	TULIP_DSTS_RxOVERFLOW	0x00000001	/* Overflow */
-
-
-#define	TULIP_DFLAG_ENDRING	0x0008		/* End of Transmit Ring */
-#define	TULIP_DFLAG_CHAIN	0x0004		/* Chain using d_addr2 */
-
-#define	TULIP_DFLAG_TxWANTINTR	0x0200		/* Signal Interrupt on Completion */
-#define	TULIP_DFLAG_TxLASTSEG	0x0100		/* Last Segment */
-#define	TULIP_DFLAG_TxFIRSTSEG	0x0080		/* First Segment */
-#define	TULIP_DFLAG_TxINVRSFILT	0x0040		/* Inverse Filtering */
-#define	TULIP_DFLAG_TxSETUPPKT	0x0020		/* Setup Packet */
-#define	TULIP_DFLAG_TxHASCRC	0x0010		/* Don't Append the CRC */
-#define	TULIP_DFLAG_TxNOPADDING	0x0002		/* Don't AutoPad */
-#define	TULIP_DFLAG_TxHASHFILT	0x0001		/* Hash/Perfect Filtering */
-
-/*
- * The 21040 Registers (IO Space Addresses)
- */
-#define	TULIP_REG_BUSMODE	0x00	/* CSR0  -- Bus Mode */
-#define	TULIP_REG_TXPOLL	0x08	/* CSR1  -- Transmit Poll Demand */
-#define	TULIP_REG_RXPOLL	0x10	/* CSR2  -- Receive Poll Demand */
-#define	TULIP_REG_RXLIST	0x18	/* CSR3  -- Receive List Base Addr */
-#define	TULIP_REG_TXLIST	0x20	/* CSR4  -- Transmit List Base Addr */
-#define	TULIP_REG_STATUS	0x28	/* CSR5  -- Status */
-#define	TULIP_REG_CMD		0x30	/* CSR6  -- Command */
-#define	TULIP_REG_INTR		0x38	/* CSR7  -- Interrupt Control */
-#define	TULIP_REG_MISSES	0x40	/* CSR8  -- Missed Frame Counter */
-#define	TULIP_REG_ADDRROM	0x48	/* CSR9  -- ENET ROM Register */
-#define	TULIP_REG_RSRVD		0x50	/* CSR10 -- Reserved */
-#define	TULIP_REG_FULL_DUPLEX	0x58	/* CSR11 -- Full Duplex */
-#define	TULIP_REG_SIA_STATUS	0x60	/* CSR12 -- SIA Status */
-#define	TULIP_REG_SIA_CONN	0x68	/* CSR13 -- SIA Connectivity */
-#define	TULIP_REG_SIA_TXRX	0x70	/* CSR14 -- SIA Tx Rx */
-#define	TULIP_REG_SIA_GEN	0x78	/* CSR15 -- SIA General */
-
-/*
- * CSR5 -- Status Register
- * CSR7 -- Interrupt Control
- */
-#define	TULIP_STS_ERRORMASK	0x03800000L		/* ( R)  Error Bits (Valid when SYSERROR is set) */
-#define	TULIP_STS_ERR_PARITY	0x00000000L		/*        000 - Parity Error (Perform Reset) */
-#define	TULIP_STS_ERR_MASTER	0x00800000L		/*        001 - Master Abort */
-#define	TULIP_STS_ERR_TARGET	0x01000000L		/*        010 - Target Abort */
-#define	TULIP_STS_ERR_SHIFT	23
-#define	TULIP_STS_TXSTATEMASK	0x00700000L		/* ( R)  Transmission Process State */
-#define	TULIP_STS_TXS_RESET	0x00000000L		/*        000 - Rset or transmit jabber expired */
-#define	TULIP_STS_TXS_FETCH	0x00100000L		/*        001 - Fetching transmit descriptor */
-#define	TULIP_STS_TXS_WAITEND	0x00200000L		/*        010 - Wait for end of transmission */
-#define	TULIP_STS_TXS_READING	0x00300000L		/*        011 - Read buffer and enqueue data */
-#define	TULIP_STS_TXS_RSRVD	0x00400000L		/*        100 - Reserved */
-#define	TULIP_STS_TXS_SETUP	0x00500000L		/*        101 - Setup Packet */
-#define	TULIP_STS_TXS_SUSPEND	0x00600000L		/*        110 - Transmit FIFO underflow or an
-								  unavailable transmit descriptor */
-#define	TULIP_STS_TXS_CLOSE	0x00700000L		/*        111 - Close transmit descriptor */
-#define	TULIP_STS_RXSTATEMASK	0x000E0000L		/* ( R)  Receive Process State*/
-#define	TULIP_STS_RXS_STOPPED	0x00000000L		/*        000 - Stopped */
-#define	TULIP_STS_RXS_FETCH	0x00020000L		/*        001 - Running -- Fetch receive descriptor */
-#define	TULIP_STS_RXS_ENDCHECK	0x00040000L		/*        010 - Running -- Check for end of receive
-								  packet before prefetch of next descriptor */
-#define	TULIP_STS_RXS_WAIT	0x00060000L		/*        011 - Running -- Wait for receive packet */
-#define	TULIP_STS_RXS_SUSPEND	0x00080000L		/*        100 - Suspended -- As a result of
-								  unavailable receive buffers */
-#define	TULIP_STS_RXS_CLOSE	0x000A0000L		/*        101 - Running -- Close receive descriptor */
-#define	TULIP_STS_RXS_FLUSH	0x000C0000L		/*        110 - Running -- Flush the current frame
-								  from the receive FIFO as a result of
-								  an unavailable receive buffer */
-#define	TULIP_STS_RXS_DEQUEUE	0x000E0000L		/*        111 - Running -- Dequeue the receive frame
-								  from the receive FIFO into the receive
-								  buffer. */
-#define	TULIP_STS_NORMALINTR	0x00010000L		/* (RW)  Normal Interrupt */
-#define	TULIP_STS_ABNRMLINTR	0x00008000L		/* (RW)  Abnormal Interrupt */
-#define	TULIP_STS_SYSERROR	0x00002000L		/* (RW)  System Error */
-#define	TULIP_STS_LINKFAIL	0x00001000L		/* (RW)  Link Failure (21040) */
-#define	TULIP_STS_FULDPLXSHRT	0x00000800L		/* (RW)  Full Duplex Short Fram Rcvd (21040) */
-#define	TULIP_STS_GPTIMEOUT	0x00000800L		/* (RW)  General Purpose Timeout (21140) */
-#define	TULIP_STS_AUI		0x00000400L		/* (RW)  AUI/TP Switch (21040) */
-#define	TULIP_STS_RXTIMEOUT	0x00000200L		/* (RW)  Receive Watchbog Timeout */
-#define	TULIP_STS_RXSTOPPED	0x00000100L		/* (RW)  Receive Process Stopped */
-#define	TULIP_STS_RXNOBUF	0x00000080L		/* (RW)  Receive Buffer Unavailable */
-#define	TULIP_STS_RXINTR	0x00000040L		/* (RW)  Receive Interrupt */
-#define	TULIP_STS_TXUNDERFLOW	0x00000020L		/* (RW)  Transmit Underflow */
-#define	TULIP_STS_LINKPASS	0x00000010L		/* (RW)  LinkPass (21041) */
-#define	TULIP_STS_TXBABBLE	0x00000008L		/* (RW)  Transmit Jabber Timeout */
-#define	TULIP_STS_TXNOBUF	0x00000004L		/* (RW)  Transmit Buffer Unavailable */
-#define	TULIP_STS_TXSTOPPED	0x00000002L		/* (RW)  Transmit Process Stopped */
-#define	TULIP_STS_TXINTR	0x00000001L		/* (RW)  Transmit Interrupt */
-
-/*
- * CSR6 -- Command (Operation Mode) Register
- */
-#define	TULIP_CMD_MUSTBEONE	0x02000000L		/* (RW)  Must Be One (21140) */
-#define	TULIP_CMD_SCRAMBLER	0x01000000L		/* (RW)  Scrambler Mode (21140) */
-#define	TULIP_CMD_PCSFUNCTION	0x00800000L		/* (RW)  PCS Function (21140) */
-#define	TULIP_CMD_TXTHRSHLDCTL	0x00400000L		/* (RW)  Transmit Threshold Mode (21140) */
-#define	TULIP_CMD_STOREFWD	0x00200000L		/* (RW)  Store and Foward (21140) */
-#define	TULIP_CMD_NOHEARTBEAT	0x00080000L		/* (RW)  No Heartbeat (21140) */
-#define	TULIP_CMD_PORTSELECT	0x00040000L		/* (RW)  Post Select (100Mb) (21140) */
-#define	TULIP_CMD_ENHCAPTEFFCT	0x00040000L		/* (RW)  Enhanced Capture Effecty (21041) */
-#define	TULIP_CMD_CAPTREFFCT	0x00020000L		/* (RW)  Capture Effect (!802.3) */
-#define	TULIP_CMD_BACKPRESSURE	0x00010000L		/* (RW)  Back Pressure (!802.3) (21040) */
-#define	TULIP_CMD_THRESHOLDCTL	0x0000C000L		/* (RW)  Threshold Control */
-#define	TULIP_CMD_THRSHLD72	0x00000000L		/*       00 - 72 Bytes */
-#define	TULIP_CMD_THRSHLD96	0x00004000L		/*       01 - 96 Bytes */
-#define	TULIP_CMD_THRSHLD128	0x00008000L		/*       10 - 128 bytes */
-#define	TULIP_CMD_THRSHLD160	0x0000C000L		/*       11 - 160 Bytes */
-#define	TULIP_CMD_TXRUN 	0x00002000L		/* (RW)  Start/Stop Transmitter */
-#define	TULIP_CMD_FORCECOLL	0x00001000L		/* (RW)  Force Collisions */
-#define	TULIP_CMD_OPERMODE	0x00000C00L		/* (RW)  Operating Mode */
-#define	TULIP_CMD_FULLDUPLEX	0x00000200L		/* (RW)  Full Duplex Mode */
-#define	TULIP_CMD_FLAKYOSCDIS	0x00000100L		/* (RW)  Flakey Oscillator Disable */
-#define	TULIP_CMD_ALLMULTI	0x00000080L		/* (RW)  Pass All Multicasts */
-#define	TULIP_CMD_PROMISCUOUS	0x00000040L		/* (RW)  Promiscuous Mode */
-#define	TULIP_CMD_BACKOFFCTR	0x00000020L		/* (RW)  Start/Stop Backoff Counter (!802.3) */
-#define	TULIP_CMD_INVFILTER	0x00000010L		/* (R )  Inverse Filtering */
-#define	TULIP_CMD_PASSBADPKT	0x00000008L		/* (RW)  Pass Bad Frames  */
-#define	TULIP_CMD_HASHONLYFLTR	0x00000004L		/* (R )  Hash Only Filtering */
-#define	TULIP_CMD_RXRUN		0x00000002L		/* (RW)  Start/Stop Receive Filtering */
-#define	TULIP_CMD_HASHPRFCTFLTR	0x00000001L		/* (R )  Hash/Perfect Receive Filtering */
-
-#define TULIP_SIASTS_OTHERRXACTIVITY	0x00000200L
-#define TULIP_SIASTS_RXACTIVITY		0x00000100L
-#define	TULIP_SIASTS_LINKFAIL		0x00000004L
-#define	TULIP_SIASTS_LINK100FAIL	0x00000002L
-#define	TULIP_SIACONN_RESET		0x00000000L
-
-/*
- * 21040 SIA definitions
- */
-#define	TULIP_21040_PROBE_10BASET_TIMEOUT	2500
-#define	TULIP_21040_PROBE_AUIBNC_TIMEOUT	300
-#define	TULIP_21040_PROBE_EXTSIA_TIMEOUT	300
-
-#define	TULIP_21040_SIACONN_10BASET	0x0000EF01L
-#define	TULIP_21040_SIATXRX_10BASET	0x0000FFFFL
-#define	TULIP_21040_SIAGEN_10BASET	0x00000000L
-
-#define	TULIP_21040_SIACONN_10BASET_FD	0x0000EF01L
-#define	TULIP_21040_SIATXRX_10BASET_FD	0x0000FFFDL
-#define	TULIP_21040_SIAGEN_10BASET_FD	0x00000000L
-
-#define	TULIP_21040_SIACONN_AUIBNC	0x0000EF09L
-#define	TULIP_21040_SIATXRX_AUIBNC	0x00000705L
-#define	TULIP_21040_SIAGEN_AUIBNC	0x00000006L
-
-#define	TULIP_21040_SIACONN_EXTSIA	0x00003041L
-#define	TULIP_21040_SIATXRX_EXTSIA	0x00000000L
-#define	TULIP_21040_SIAGEN_EXTSIA	0x00000006L
-
-/*
- * 21041 SIA definitions
- */
-
-#define	TULIP_21041_PROBE_10BASET_TIMEOUT	2500
-#define	TULIP_21041_PROBE_AUIBNC_TIMEOUT	300
-
-#define	TULIP_21041_SIACONN_10BASET		0x0000EF01L
-#define	TULIP_21041_SIATXRX_10BASET		0x0000FF3FL
-#define	TULIP_21041_SIAGEN_10BASET		0x00000000L
-
-#define	TULIP_21041P2_SIACONN_10BASET		0x0000EF01L
-#define	TULIP_21041P2_SIATXRX_10BASET		0x0000FFFFL
-#define	TULIP_21041P2_SIAGEN_10BASET		0x00000000L
-
-#define	TULIP_21041_SIACONN_10BASET_FD		0x0000EF01L
-#define	TULIP_21041_SIATXRX_10BASET_FD		0x0000FF3DL
-#define	TULIP_21041_SIAGEN_10BASET_FD		0x00000000L
-
-#define	TULIP_21041P2_SIACONN_10BASET_FD	0x0000EF01L
-#define	TULIP_21041P2_SIATXRX_10BASET_FD	0x0000FFFFL
-#define	TULIP_21041P2_SIAGEN_10BASET_FD		0x00000000L
-
-#define	TULIP_21041_SIACONN_AUI			0x0000EF09L
-#define	TULIP_21041_SIATXRX_AUI			0x0000F73DL
-#define	TULIP_21041_SIAGEN_AUI			0x0000000EL
-
-#define	TULIP_21041P2_SIACONN_AUI		0x0000EF09L
-#define	TULIP_21041P2_SIATXRX_AUI		0x0000F7FDL
-#define	TULIP_21041P2_SIAGEN_AUI		0x0000000EL
-
-#define	TULIP_21041_SIACONN_BNC			0x0000EF09L
-#define	TULIP_21041_SIATXRX_BNC			0x0000F73DL
-#define	TULIP_21041_SIAGEN_BNC			0x00000006L
-
-#define	TULIP_21041P2_SIACONN_BNC		0x0000EF09L
-#define	TULIP_21041P2_SIATXRX_BNC		0x0000F7FDL
-#define	TULIP_21041P2_SIAGEN_BNC		0x00000006L
-
-/*
- * 21142 SIA definitions
- */
-
-#define	TULIP_21142_PROBE_10BASET_TIMEOUT	2500
-#define	TULIP_21142_PROBE_AUIBNC_TIMEOUT	300
-
-#define	TULIP_21142_SIACONN_10BASET		0x00000001L
-#define	TULIP_21142_SIATXRX_10BASET		0x00007F3FL
-#define	TULIP_21142_SIAGEN_10BASET		0x00000008L
-
-#define	TULIP_21142_SIACONN_10BASET_FD		0x00000001L
-#define	TULIP_21142_SIATXRX_10BASET_FD		0x00007F3DL
-#define	TULIP_21142_SIAGEN_10BASET_FD		0x00000008L
-
-#define	TULIP_21142_SIACONN_AUI			0x00000009L
-#define	TULIP_21142_SIATXRX_AUI			0x00000705L
-#define	TULIP_21142_SIAGEN_AUI			0x0000000EL
-
-#define	TULIP_21142_SIACONN_BNC			0x00000009L
-#define	TULIP_21142_SIATXRX_BNC			0x00000705L
-#define	TULIP_21142_SIAGEN_BNC			0x00000006L
-
-
-
-
-#define	TULIP_WATCHDOG_TXDISABLE	0x00000001L
-#define	TULIP_WATCHDOG_RXDISABLE	0x00000010L
-
-#define	TULIP_BUSMODE_SWRESET		0x00000001L
-#define	TULIP_BUSMODE_DESCSKIPLEN_MASK	0x0000007CL
-#define	TULIP_BUSMODE_BIGENDIAN		0x00000080L
-#define	TULIP_BUSMODE_BURSTLEN_MASK	0x00003F00L
-#define	TULIP_BUSMODE_BURSTLEN_DEFAULT	0x00000000L
-#define	TULIP_BUSMODE_BURSTLEN_1LW	0x00000100L
-#define	TULIP_BUSMODE_BURSTLEN_2LW	0x00000200L
-#define	TULIP_BUSMODE_BURSTLEN_4LW	0x00000400L
-#define	TULIP_BUSMODE_BURSTLEN_8LW	0x00000800L
-#define	TULIP_BUSMODE_BURSTLEN_16LW	0x00001000L
-#define	TULIP_BUSMODE_BURSTLEN_32LW	0x00002000L
-#define	TULIP_BUSMODE_CACHE_NOALIGN	0x00000000L
-#define	TULIP_BUSMODE_CACHE_ALIGN8	0x00004000L
-#define	TULIP_BUSMODE_CACHE_ALIGN16	0x00008000L
-#define	TULIP_BUSMODE_CACHE_ALIGN32	0x0000C000L
-#define	TULIP_BUSMODE_TXPOLL_NEVER	0x00000000L
-#define	TULIP_BUSMODE_TXPOLL_200000ns	0x00020000L
-#define	TULIP_BUSMODE_TXPOLL_800000ns	0x00040000L
-#define	TULIP_BUSMODE_TXPOLL_1600000ns	0x00060000L
-#define	TULIP_BUSMODE_TXPOLL_12800ns	0x00080000L	/* 21041 only */
-#define	TULIP_BUSMODE_TXPOLL_25600ns	0x000A0000L	/* 21041 only */
-#define	TULIP_BUSMODE_TXPOLL_51200ns	0x000C0000L	/* 21041 only */
-#define	TULIP_BUSMODE_TXPOLL_102400ns	0x000E0000L	/* 21041 only */
-#define	TULIP_BUSMODE_DESC_BIGENDIAN	0x00100000L	/* 21041 only */
-#define	TULIP_BUSMODE_READMULTIPLE	0x00200000L	/* */
-
-#define	TULIP_REG_CFDA			0x40
-#define	TULIP_CFDA_SLEEP		0x80000000L
-#define	TULIP_CFDA_SNOOZE		0x40000000L
-
-#define	TULIP_GP_PINSET			0x00000100L
-/*
- * These are the defintitions used for the DEC 21140
- * evaluation board.
- */
-#define	TULIP_GP_EB_PINS		0x0000001F	/* General Purpose Pin directions */
-#define	TULIP_GP_EB_OK10		0x00000080	/* 10 Mb/sec Signal Detect gep<7> */
-#define	TULIP_GP_EB_OK100		0x00000040	/* 100 Mb/sec Signal Detect gep<6> */
-#define	TULIP_GP_EB_INIT		0x0000000B	/* No loopback --- point-to-point */
-
-/*
- * These are the defintitions used for the SMC9332 (21140) board.
- */
-#define	TULIP_GP_SMC_9332_PINS		0x0000003F	/* General Purpose Pin directions */
-#define	TULIP_GP_SMC_9332_OK10		0x00000080	/* 10 Mb/sec Signal Detect gep<7> */
-#define	TULIP_GP_SMC_9332_OK100		0x00000040	/* 100 Mb/sec Signal Detect gep<6> */
-#define	TULIP_GP_SMC_9332_INIT		0x00000009	/* No loopback --- point-to-point */
-
-/*
- * There are the definitions used for the DEC DE500
- * 10/100 family of boards
- */
-#define	TULIP_GP_DE500_PINS		0x0000001FL
-#define	TULIP_GP_DE500_LINK_PASS	0x00000080L
-#define	TULIP_GP_DE500_SYM_LINK		0x00000040L
-#define	TULIP_GP_DE500_SIGNAL_DETECT	0x00000020L
-#define	TULIP_GP_DE500_PHY_RESET	0x00000010L
-#define	TULIP_GP_DE500_HALFDUPLEX	0x00000008L
-#define	TULIP_GP_DE500_PHY_LOOPBACK	0x00000004L
-#define	TULIP_GP_DE500_FORCE_LED	0x00000002L
-#define	TULIP_GP_DE500_FORCE_100	0x00000001L
-
-/*
- * These are the defintitions used for the Cogent EM100
- * 21140 board.
- */
-#define	TULIP_GP_EM100_PINS		0x0000003F	/* General Purpose Pin directions */
-#define	TULIP_GP_EM100_INIT		0x00000009	/* No loopback --- point-to-point */
-#define	TULIP_COGENT_EM100TX_ID		0x12
-#define	TULIP_COGENT_EM100FX_ID		0x15
-
-
-/*
- * These are the defintitions used for the Znyx ZX342
- * 10/100 board
- */
-#define	TULIP_ZNYX_ID_ZX312		0x0602
-#define	TULIP_ZNYX_ID_ZX312T		0x0622
-#define	TULIP_ZNYX_ID_ZX314_INTA	0x0701
-#define	TULIP_ZNYX_ID_ZX314		0x0711
-#define	TULIP_ZNYX_ID_ZX315_INTA	0x0801
-#define	TULIP_ZNYX_ID_ZX315		0x0811
-#define	TULIP_ZNYX_ID_ZX342		0x0901
-#define	TULIP_ZNYX_ID_ZX342B		0x0921
-#define	TULIP_ZNYX_ID_ZX342_X3		0x0902
-#define	TULIP_ZNYX_ID_ZX342_X4		0x0903
-#define	TULIP_ZNYX_ID_ZX344		0x0A01
-#define	TULIP_ZNYX_ID_ZX351		0x0B01
-#define	TULIP_ZNYX_ID_ZX345		0x0C01
-#define	TULIP_ZNYX_ID_ZX311		0x0D01
-#define	TULIP_ZNYX_ID_ZX346		0x0E01
-
-#define	TULIP_GP_ZX34X_PINS		0x0000001F	/* General Purpose Pin directions */
-#define	TULIP_GP_ZX344_PINS		0x0000000B	/* General Purpose Pin directions */
-#define	TULIP_GP_ZX345_PINS		0x00000003	/* General Purpose Pin directions */
-#define	TULIP_GP_ZX346_PINS		0x00000043	/* General Purpose Pin directions */
-#define	TULIP_GP_ZX34X_LNKFAIL		0x00000080	/* 10Mb/s Link Failure */
-#define	TULIP_GP_ZX34X_SYMDET		0x00000040	/* 100Mb/s Symbol Detect */
-#define	TULIP_GP_ZX345_PHYACT		0x00000040	/* PHY Activity */
-#define	TULIP_GP_ZX34X_SIGDET		0x00000020	/* 100Mb/s Signal Detect */
-#define	TULIP_GP_ZX346_AUTONEG_ENABLED	0x00000020	/* 802.3u autoneg enabled */
-#define	TULIP_GP_ZX342_COLENA		0x00000008	/* 10t Ext LB */
-#define	TULIP_GP_ZX344_ROTINT		0x00000008	/* PPB IRQ rotation */
-#define	TULIP_GP_ZX345_SPEED10		0x00000008	/* 10Mb speed detect */
-#define	TULIP_GP_ZX346_SPEED100		0x00000008	/* 100Mb speed detect */
-#define	TULIP_GP_ZX34X_NCOLENA		0x00000004	/* 10t Int LB */
-#define	TULIP_GP_ZX34X_RXMATCH		0x00000004	/* RX Match */
-#define	TULIP_GP_ZX346_FULLDUPLEX	0x00000004	/* Full Duplex Sensed */
-#define	TULIP_GP_ZX34X_LB102		0x00000002	/* 100tx twister LB */
-#define	TULIP_GP_ZX34X_NLB101		0x00000001	/* PDT/PDR LB */
-#define	TULIP_GP_ZX34X_INIT		0x00000009	
-
-/*
- * Asante's stuff...
- */
-#define TULIP_GP_ASANTE_PINS		0x000000bf	/* GP pin config */
-#define TULIP_GP_ASANTE_PHYRESET	0x00000008	/* Reset PHY */
-
-/*
- * ACCTON EN1207 specialties
- */
-
-#define TULIP_CSR8_EN1207		0x08
-#define TULIP_CSR9_EN1207		0x00
-#define TULIP_CSR10_EN1207		0x03
-#define TULIP_CSR11_EN1207		0x1F
-
-#define TULIP_GP_EN1207_BNC_INIT        0x0000011B
-#define TULIP_GP_EN1207_UTP_INIT        0x9E00000B
-#define TULIP_GP_EN1207_100_INIT        0x6D00031B
-
-/*
- * SROM definitions for the 21140 and 21041.
- */
-#define	SROMXREG	0x0400
-#define SROMSEL         0x0800
-#define SROMRD          0x4000
-#define SROMWR          0x2000
-#define SROMDIN         0x0008
-#define SROMDOUT        0x0004
-#define SROMDOUTON      0x0004
-#define SROMDOUTOFF     0x0004
-#define SROMCLKON       0x0002
-#define SROMCLKOFF      0x0002
-#define SROMCSON        0x0001
-#define SROMCSOFF       0x0001
-#define SROMCS          0x0001
-
-#define	SROMCMD_MODE	4
-#define	SROMCMD_WR	5
-#define	SROMCMD_RD	6
-
-#define	SROM_BITWIDTH	6
-
-/*
- * MII Definitions for the 21041 and 21140/21140A/21142
- */
-#define	MII_PREAMBLE		(~0)
-#define	MII_TEST		0xAAAAAAAA
-#define	MII_RDCMD		0xF6		/* 1111.0110 */
-#define	MII_WRCMD		0xF5		/* 1111.0101 */
-#define	MII_DIN			0x00080000
-#define	MII_RD			0x00040000
-#define	MII_WR			0x00000000
-#define	MII_DOUT		0x00020000
-#define	MII_CLK			0x00010000
-#define	MII_CLKON		MII_CLK
-#define	MII_CLKOFF		MII_CLK
-
-#define	PHYREG_CONTROL			0
-#define	PHYREG_STATUS			1
-#define	PHYREG_IDLOW			2
-#define	PHYREG_IDHIGH			3
-#define	PHYREG_AUTONEG_ADVERTISEMENT	4
-#define	PHYREG_AUTONEG_ABILITIES	5
-#define	PHYREG_AUTONEG_EXPANSION	6
-#define	PHYREG_AUTONEG_NEXTPAGE		7
-
-#define	PHYSTS_100BASET4	0x8000
-#define	PHYSTS_100BASETX_FD	0x4000
-#define	PHYSTS_100BASETX	0x2000
-#define	PHYSTS_10BASET_FD	0x1000
-#define	PHYSTS_10BASET		0x0800
-#define	PHYSTS_AUTONEG_DONE	0x0020
-#define	PHYSTS_REMOTE_FAULT	0x0010
-#define	PHYSTS_CAN_AUTONEG	0x0008
-#define	PHYSTS_LINK_UP		0x0004
-#define	PHYSTS_JABBER_DETECT	0x0002
-#define	PHYSTS_EXTENDED_REGS	0x0001
-
-#define	PHYCTL_RESET		0x8000
-#define	PHYCTL_SELECT_100MB	0x2000
-#define	PHYCTL_AUTONEG_ENABLE	0x1000
-#define	PHYCTL_ISOLATE		0x0400
-#define	PHYCTL_AUTONEG_RESTART	0x0200
-#define	PHYCTL_FULL_DUPLEX	0x0100
-
-/*
- * Definitions for the DE425.
- */
-#define	DE425_CFID		0x08	/* Configuration Id */
-#define	DE425_CFCS		0x0C	/* Configuration Command-Status */
-#define	DE425_CFRV		0x18	/* Configuration Revision */
-#define	DE425_CFLT		0x1C	/* Configuration Latency Timer */
-#define	DE425_CBIO		0x28	/* Configuration Base IO Address */
-#define	DE425_CFDA		0x2C	/* Configuration Driver Area */
-#define	DE425_ENETROM_OFFSET	0xC90	/* Offset in I/O space for ENETROM */
-#define	DE425_CFG0		0xC88	/* IRQ register */
-#define	DE425_EISAID		0x10a34250 /* EISA device id */
-#define	DE425_EISA_IOSIZE	0x100
-
-#define	DEC_VENDORID		0x1011
-#define	CHIPID_21040		0x0002
-#define	CHIPID_21140		0x0009
-#define	CHIPID_21041		0x0014
-#define	CHIPID_21142		0x0019
-#define	PCI_VENDORID(x)		((x) & 0xFFFF)
-#define	PCI_CHIPID(x)		(((x) >> 16) & 0xFFFF)
-
-/*
- * Generic SROM Format
- *
- *
- */
-
-typedef struct {
-    u_int8_t sh_idbuf[18];
-    u_int8_t sh_version;
-    u_int8_t sh_adapter_count;
-    u_int8_t sh_ieee802_address[6];
-} tulip_srom_header_t;
-
-typedef struct {
-    u_int8_t sai_device;
-    u_int8_t sai_leaf_offset_lowbyte;
-    u_int8_t sai_leaf_offset_highbyte;
-} tulip_srom_adapter_info_t;
-
-typedef enum {
-    TULIP_SROM_CONNTYPE_10BASET			=0x0000,
-    TULIP_SROM_CONNTYPE_BNC			=0x0001,
-    TULIP_SROM_CONNTYPE_AUI			=0x0002,
-    TULIP_SROM_CONNTYPE_100BASETX		=0x0003,
-    TULIP_SROM_CONNTYPE_100BASET4		=0x0006,
-    TULIP_SROM_CONNTYPE_100BASEFX		=0x0007,
-    TULIP_SROM_CONNTYPE_MII_10BASET		=0x0009,
-    TULIP_SROM_CONNTYPE_MII_100BASETX		=0x000D,
-    TULIP_SROM_CONNTYPE_MII_100BASET4		=0x000F,
-    TULIP_SROM_CONNTYPE_MII_100BASEFX		=0x0010,
-    TULIP_SROM_CONNTYPE_10BASET_NWAY		=0x0100,
-    TULIP_SROM_CONNTYPE_10BASET_FD		=0x0204,
-    TULIP_SROM_CONNTYPE_MII_10BASET_FD		=0x020A,
-    TULIP_SROM_CONNTYPE_100BASETX_FD		=0x020E,
-    TULIP_SROM_CONNTYPE_MII_100BASETX_FD	=0x0211,
-    TULIP_SROM_CONNTYPE_10BASET_NOLINKPASS	=0x0400,
-    TULIP_SROM_CONNTYPE_AUTOSENSE		=0x0800,
-    TULIP_SROM_CONNTYPE_AUTOSENSE_POWERUP	=0x8800,
-    TULIP_SROM_CONNTYPE_AUTOSENSE_NWAY		=0x9000,
-    TULIP_SROM_CONNTYPE_NOT_USED		=0xFFFF
-} tulip_srom_connection_t;
-
-typedef enum {
-    TULIP_SROM_MEDIA_10BASET			=0x0000,
-    TULIP_SROM_MEDIA_BNC			=0x0001,
-    TULIP_SROM_MEDIA_AUI			=0x0002,
-    TULIP_SROM_MEDIA_100BASETX			=0x0003,
-    TULIP_SROM_MEDIA_10BASET_FD			=0x0004,
-    TULIP_SROM_MEDIA_100BASETX_FD		=0x0005,
-    TULIP_SROM_MEDIA_100BASET4			=0x0006,
-    TULIP_SROM_MEDIA_100BASEFX			=0x0007,
-    TULIP_SROM_MEDIA_100BASEFX_FD		=0x0008
-} tulip_srom_media_t;
-
-#define	TULIP_SROM_21041_EXTENDED	0x40
-
-#define	TULIP_SROM_2114X_NOINDICATOR	0x8000
-#define	TULIP_SROM_2114X_DEFAULT	0x4000
-#define	TULIP_SROM_2114X_POLARITY	0x0080
-#define	TULIP_SROM_2114X_CMDBITS(n)	(((n) & 0x0071) << 18)
-#define	TULIP_SROM_2114X_BITPOS(b)	(1 << (((b) & 0x0E) >> 1))
-
-
-
-#endif /* !defined(_DC21040_H) */
--- sys/pci/if_devar.h
+++ /dev/null
@@ -1,937 +0,0 @@
-/*	$NetBSD: if_devar.h,v 1.32 1999/04/01 14:55:25 tsubai Exp $	*/
-
-/* $FreeBSD: src/sys/pci/if_devar.h,v 1.32.2.2 2005/11/14 19:29:56 jhb Exp $ */
-
-/*-
- * Copyright (c) 1994-1997 Matt Thomas (matt at 3am-software.com)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Id: if_devar.h,v 1.28 1997/07/03 16:55:07 thomas Exp
- */
-
-#ifndef _DEVAR_H
-#define _DEVAR_H
-
-typedef bus_addr_t tulip_csrptr_t;
-
-#define	TULIP_PCI_CSRSIZE	8
-#define	TULIP_PCI_CSROFFSET	0
-
-#define TULIP_CSR_READ(sc, csr)			\
-	bus_space_read_4((sc)->tulip_csrs_bst,	\
-			 (sc)->tulip_csrs_bsh,	\
-			 (sc)->tulip_csrs.csr)
-#define TULIP_CSR_WRITE(sc, csr, val)			\
-	bus_space_write_4((sc)->tulip_csrs_bst,		\
-			  (sc)->tulip_csrs_bsh,		\
-			  (sc)->tulip_csrs.csr, val)
-
-/*
- * This structure contains "pointers" for the registers on
- * the various 21x4x chips.  CSR0 through CSR8 are common
- * to all chips.  After that, it gets messy...
- */
-typedef struct {
-	tulip_csrptr_t	csr_busmode;	/* CSR0 */
-	tulip_csrptr_t	csr_txpoll;	/* CSR1 */
-	tulip_csrptr_t	csr_rxpoll;	/* CSR2 */
-	tulip_csrptr_t	csr_rxlist;	/* CSR3 */
-	tulip_csrptr_t	csr_txlist;	/* CSR4 */
-	tulip_csrptr_t	csr_status;	/* CSR5 */
-	tulip_csrptr_t	csr_command;	/* CSR6 */
-	tulip_csrptr_t	csr_intr;	/* CSR7 */
-	tulip_csrptr_t	csr_missed_frames;	/* CSR8 */
-	tulip_csrptr_t	csr_9;		/* CSR9 */
-	tulip_csrptr_t	csr_10;		/* CSR10 */
-	tulip_csrptr_t	csr_11;		/* CSR11 */
-	tulip_csrptr_t	csr_12;		/* CSR12 */
-	tulip_csrptr_t	csr_13;		/* CSR13 */
-	tulip_csrptr_t	csr_14;		/* CSR14 */
-	tulip_csrptr_t	csr_15;		/* CSR15 */
-} tulip_regfile_t;
-
-#define	csr_enetrom		csr_9	/* 21040 */
-#define	csr_reserved		csr_10	/* 21040 */
-#define	csr_full_duplex		csr_11	/* 21040 */
-#define	csr_bootrom		csr_10	/* 21041/21140A/?? */
-#define	csr_gp			csr_12	/* 21140* */
-#define	csr_watchdog		csr_15	/* 21140* */
-#define	csr_gp_timer		csr_11	/* 21041/21140* */
-#define	csr_srom_mii		csr_9	/* 21041/21140* */
-#define	csr_sia_status		csr_12	/* 2104x */
-#define csr_sia_connectivity	csr_13	/* 2104x */
-#define csr_sia_tx_rx		csr_14	/* 2104x */
-#define csr_sia_general		csr_15	/* 2104x */
-
-/*
- * While 21x4x allows chaining of its descriptors, this driver
- * doesn't take advantage of it.  We keep the descriptors in a
- * traditional FIFO ring.
- */
-typedef struct {
-	tulip_desc_t	*di_desc;
-	struct mbuf	*di_mbuf;
-	bus_dmamap_t	*di_map;
-} tulip_descinfo_t;
-
-typedef struct {
-	tulip_descinfo_t *ri_first;	/* first entry in ring */
-	tulip_descinfo_t *ri_last;	/* one after last entry */
-	tulip_descinfo_t *ri_nextin;	/* next to processed by host */
-	tulip_descinfo_t *ri_nextout;	/* next to processed by adapter */
-	int		ri_max;
-	int		ri_free;
-	tulip_desc_t	*ri_descs;
-	tulip_descinfo_t *ri_descinfo;
-	bus_dma_tag_t	ri_ring_tag;
-	bus_dmamap_t	ri_ring_map;
-	uint32_t	ri_dma_addr;
-	bus_dma_tag_t	ri_data_tag;
-	bus_dmamap_t	*ri_data_maps;
-} tulip_ringinfo_t;
-
-/*
- * The 21040 has a stupid restriction in that the receive
- * buffers must be longword aligned.  But since Ethernet
- * headers are not a multiple of longwords in size this forces
- * the data to non-longword aligned.  Since IP requires the
- * data to be longword aligned, we need to copy it after it has
- * been DMA'ed in our memory.
- *
- * Since we have to copy it anyways, we might as well as allocate
- * dedicated receive space for the input.  This allows to use a
- * small receive buffer size and more ring entries to be able to
- * better keep with a flood of tiny Ethernet packets.
- *
- * The receive space MUST ALWAYS be a multiple of the page size.
- * And the number of receive descriptors multiplied by the size
- * of the receive buffers must equal the receive space.  This
- * is so that we can manipulate the page tables so that even if a
- * packet wraps around the end of the receive space, we can
- * treat it as virtually contiguous.
- *
- * The above used to be true (the stupid restriction is still true)
- * but we gone to directly DMA'ing into MBUFs (unless it's on an
- * architecture which can't handle unaligned accesses) because with
- * 100Mb/s cards the copying is just too much of a hit.
- */
-#if !defined(__i386__)
-#define	TULIP_COPY_RXDATA	1
-#endif
-
-#define	TULIP_DATA_PER_DESC	2032
-#define	TULIP_TXTIMER		4
-#define	TULIP_RXDESCS		48
-#define	TULIP_TXDESCS		128
-#define	TULIP_RXQ_TARGET	32
-#if TULIP_RXQ_TARGET >= TULIP_RXDESCS
-#error	TULIP_RXQ_TARGET must be less than TULIP_RXDESCS
-#endif
-#define	TULIP_RX_BUFLEN		((MCLBYTES < 2048 ? MCLBYTES : 2048) - 16)
-
-/*
- * Forward reference to make C happy.
- */
-typedef struct tulip_softc	tulip_softc_t;
-
-/*
- * Enumeration of the various controllers supported.
- */
-typedef enum {
-	TULIP_21040,
-	TULIP_21041,
-	TULIP_21140,
-	TULIP_21140A,
-	TULIP_21142,
-	TULIP_21143,
-	TULIP_CHIPID_UNKNOWN
-} tulip_chipid_t;
-
-/*
- * Various physical media types supported.
- * BNCAUI is BNC or AUI since on the 21040 you can't really tell
- * which is in use.
- */
-typedef enum {
-	TULIP_MEDIA_UNKNOWN,
-	TULIP_MEDIA_10BASET,
-	TULIP_MEDIA_10BASET_FD,
-	TULIP_MEDIA_BNC,
-	TULIP_MEDIA_AUI,
-	TULIP_MEDIA_EXTSIA,
-	TULIP_MEDIA_AUIBNC,
-	TULIP_MEDIA_100BASETX,
-	TULIP_MEDIA_100BASETX_FD,
-	TULIP_MEDIA_100BASET4,
-	TULIP_MEDIA_100BASEFX,
-	TULIP_MEDIA_100BASEFX_FD,
-	TULIP_MEDIA_MAX
-} tulip_media_t;
-
-#define	TULIP_BIT(b)		(1L << ((int)(b)))
-#define	TULIP_FDBIT(m)		(1L << ((int)TULIP_MEDIA_ ## m ## _FD))
-#define	TULIP_MBIT(m)		(1L << ((int)TULIP_MEDIA_ ## m ))
-#define	TULIP_IS_MEDIA_FD(m)	(TULIP_BIT(m) & \
-				 (TULIP_FDBIT(10BASET) | \
-				  TULIP_FDBIT(100BASETX) | \
-				  TULIP_FDBIT(100BASEFX)))
-#define	TULIP_CAN_MEDIA_FD(m)	(TULIP_BIT(m) & \
-				 (TULIP_MBIT(10BASET) | \
-				  TULIP_MBIT(100BASETX) | \
-				  TULIP_MBIT(100BASEFX)))
-#define	TULIP_FD_MEDIA_OF(m)	((tulip_media_t)((m) + 1))
-#define	TULIP_HD_MEDIA_OF(m)	((tulip_media_t)((m) - 1))
-#define	TULIP_IS_MEDIA_100MB(m)	((m) >= TULIP_MEDIA_100BASETX)
-#define	TULIP_IS_MEDIA_TP(m)	((TULIP_BIT(m) & \
-				  (TULIP_MBIT(BNC) | \
-				   TULIP_MBIT(AUI) | \
-				   TULIP_MBIT(AUIBNC) | \
-				   TULIP_MBIT(EXTSIA))) == 0)
-
-#define	TULIP_SROM_ATTR_MII		0x0100
-#define	TULIP_SROM_ATTR_NWAY		0x0200
-#define	TULIP_SROM_ATTR_AUTOSENSE	0x0400
-#define	TULIP_SROM_ATTR_POWERUP		0x0800
-#define	TULIP_SROM_ATTR_NOLINKPASS	0x1000
-
-typedef struct {
-	enum {
-		TULIP_MEDIAINFO_NONE,
-		TULIP_MEDIAINFO_SIA,
-		TULIP_MEDIAINFO_GPR,
-		TULIP_MEDIAINFO_MII,
-		TULIP_MEDIAINFO_RESET,
-		TULIP_MEDIAINFO_SYM
-	} mi_type;
-	union {
-		struct {
-			u_int16_t sia_connectivity;
-			u_int16_t sia_tx_rx;
-			u_int16_t sia_general;
-			u_int32_t sia_gp_control;	/* 21142/21143 */
-			u_int32_t sia_gp_data;		/* 21142/21143 */
-		} un_sia;
-		struct {
-			u_int32_t gpr_cmdmode;
-			u_int32_t gpr_gpcontrol;	/* 21142/21143 */
-			u_int32_t gpr_gpdata;
-			u_int8_t gpr_actmask;
-			u_int8_t gpr_actdata;
-			u_int gpr_default:1;
-		} un_gpr;
-		struct {
-			u_int32_t mii_mediamask;
-			u_int16_t mii_capabilities;
-			u_int16_t mii_advertisement;
-			u_int16_t mii_full_duplex;
-			u_int16_t mii_tx_threshold;
-			u_int16_t mii_interrupt;	/* 21142/21143 */
-			u_int8_t mii_phyaddr;
-			u_int8_t mii_gpr_length;
-			u_int8_t mii_gpr_offset;
-			u_int8_t mii_reset_length;
-			u_int8_t mii_reset_offset;
-			u_int32_t mii_phyid;
-		} un_mii;
-	} mi_un;
-} tulip_media_info_t;
-
-#define	mi_sia_connectivity	mi_un.un_sia.sia_connectivity
-#define	mi_sia_tx_rx		mi_un.un_sia.sia_tx_rx
-#define mi_sia_general		mi_un.un_sia.sia_general
-#define	mi_sia_gp_control	mi_un.un_sia.sia_gp_control
-#define	mi_sia_gp_data		mi_un.un_sia.sia_gp_data
-
-#define	mi_gpcontrol		mi_un.un_gpr.gpr_gpcontrol
-#define	mi_gpdata		mi_un.un_gpr.gpr_gpdata
-#define	mi_actmask		mi_un.un_gpr.gpr_actmask
-#define	mi_actdata		mi_un.un_gpr.gpr_actdata
-#define	mi_default		mi_un.un_gpr.gpr_default
-#define	mi_cmdmode		mi_un.un_gpr.gpr_cmdmode
-
-#define	mi_phyaddr		mi_un.un_mii.mii_phyaddr
-#define	mi_gpr_length		mi_un.un_mii.mii_gpr_length
-#define	mi_gpr_offset		mi_un.un_mii.mii_gpr_offset
-#define	mi_reset_length		mi_un.un_mii.mii_reset_length
-#define	mi_reset_offset		mi_un.un_mii.mii_reset_offset
-#define	mi_capabilities		mi_un.un_mii.mii_capabilities
-#define	mi_advertisement	mi_un.un_mii.mii_advertisement
-#define	mi_full_duplex		mi_un.un_mii.mii_full_duplex
-#define	mi_tx_threshold		mi_un.un_mii.mii_tx_threshold
-#define	mi_mediamask		mi_un.un_mii.mii_mediamask
-#define	mi_mii_interrupt	mi_un.un_mii.mii_interrupt
-#define	mi_phyid		mi_un.un_mii.mii_phyid
-
-#define	TULIP_MEDIAINFO_SIA_INIT(sc, mi, chipid, media) do {		\
-	(mi)->mi_type = TULIP_MEDIAINFO_SIA;				\
-	sc->tulip_mediums[TULIP_MEDIA_ ## media] = (mi);		\
-	(mi)->mi_sia_connectivity = TULIP_ ## chipid ## _SIACONN_ ## media; \
-	(mi)->mi_sia_tx_rx = TULIP_ ## chipid ## _SIATXRX_ ## media;	\
-	(mi)->mi_sia_general = TULIP_ ## chipid ## _SIAGEN_ ## media;	\
-} while (0)
-
-#define TULIP_MEDIAINFO_ADD_CAPABILITY(sc, mi, media) do {		\
-	if ((sc)->tulip_mediums[TULIP_MEDIA_ ## media] == NULL		\
-	    && ((mi)->mi_capabilities & PHYSTS_ ## media)) {		\
-		(sc)->tulip_mediums[TULIP_MEDIA_ ## media] = (mi);	\
-		(mi)->mi_mediamask |= TULIP_BIT(TULIP_MEDIA_ ## media);	\
-	}								\
-} while (0)
-
-#define	TULIP_MII_NOPHY		32
-/*
- * Some boards need to treated specially.  The following enumeration
- * identifies the cards with quirks (or those we just want to single
- * out for special merit or scorn).
- */
-typedef enum {
-	TULIP_21040_GENERIC,	/* Generic 21040 (works with most any board) */
-	TULIP_21140_ISV,	/* Digital Semicondutor 21140 ISV SROM Format */
-	TULIP_21142_ISV,	/* Digital Semicondutor 21142 ISV SROM Format */
-	TULIP_21143_ISV,	/* Digital Semicondutor 21143 ISV SROM Format */
-	TULIP_21140_DEC_EB,	/* Digital Semicondutor 21140 Eval. Board */
-	TULIP_21140_MII,	/* 21140[A] with MII */
-	TULIP_21140_DEC_DE500,	/* Digital DE500-?? 10/100 */
-	TULIP_21140_SMC_9332,	/* SMC 9332 */
-	TULIP_21140_COGENT_EM100,	/* Cogent EM100 100 only */
-	TULIP_21140_ZNYX_ZX34X,	/* ZNYX ZX342 10/100 */
-	TULIP_21140_ASANTE,	/* AsanteFast 10/100 */
-	TULIP_21140_EN1207,	/* Accton EN2107 10/100 BNC */
-	TULIP_21041_GENERIC	/* Generic 21041 card */
-} tulip_board_t;
-
-typedef enum {
-	TULIP_MEDIAPOLL_TIMER,		/* 100ms timer fired */
-	TULIP_MEDIAPOLL_FASTTIMER,	/* <100ms timer fired */
-	TULIP_MEDIAPOLL_LINKFAIL,	/* called from interrupt routine */
-	TULIP_MEDIAPOLL_LINKPASS,	/* called from interrupt routine */
-	TULIP_MEDIAPOLL_START,		/* start a media probe (from reset) */
-	TULIP_MEDIAPOLL_TXPROBE_OK,	/* txprobe succeeded */
-	TULIP_MEDIAPOLL_TXPROBE_FAILED,	/* txprobe failed */
-	TULIP_MEDIAPOLL_MAX
-} tulip_mediapoll_event_t;
-
-typedef enum {
-	TULIP_LINK_DOWN,	/* Link is down */
-	TULIP_LINK_UP,		/* link is ok */
-	TULIP_LINK_UNKNOWN	/* we can't tell either way */
-} tulip_link_status_t;
-
-/*
- * This data structure is used to abstract out the quirks.
- * media_probe  = tries to determine the media type.
- * media_select = enables the current media (or autosenses)
- * media_poll	= autosenses media
- * media_preset = 21140, etal requires bit to set before the
- *		  the software reset; hence pre-set.  Should be
- *		  pre-reset but that's ugly.
- */
-typedef struct {
-	tulip_board_t bd_type;
-	void (*bd_media_probe)(tulip_softc_t * const sc);
-	void (*bd_media_select)(tulip_softc_t * const sc);
-	void (*bd_media_poll)(tulip_softc_t * const sc,
-    tulip_mediapoll_event_t event);
-	void (*bd_media_preset) (tulip_softc_t * const sc);
-} tulip_boardsw_t;
-
-/*
- * The next few declarations are for MII/PHY based boards.
- *
- *    The first enumeration identifies a superset of various datums
- * that can be obtained from various PHY chips.  Not all PHYs will
- * support all datums.
- *    The modedata structure indicates what register contains
- * a datum, what mask is applied the register contents, and what the
- * result should be.
- *    The attr structure records information about a supported PHY.
- *    The phy structure records information about a PHY instance.
- */
-typedef enum {
-	PHY_MODE_10T,
-	PHY_MODE_100TX,
-	PHY_MODE_100T4,
-	PHY_MODE_FULLDUPLEX,
-	PHY_MODE_MAX
-} tulip_phy_mode_t;
-
-typedef struct {
-	u_int16_t	pm_regno;
-	u_int16_t	pm_mask;
-	u_int16_t	pm_value;
-} tulip_phy_modedata_t;
-
-typedef struct {
-	u_int32_t	attr_id;
-	u_int16_t	attr_flags;
-	tulip_phy_modedata_t	attr_modes[PHY_MODE_MAX];
-#ifdef TULIP_DEBUG
-	const char	*attr_name;
-#endif
-} tulip_phy_attr_t;
-
-/* Definitions for tulip_phy_attr_t.attr_flags */
-#define	PHY_NEED_HARD_RESET	0x0001
-#define	PHY_DUAL_CYCLE_TA	0x0002
-
-/*
- * Various probe states used when trying to autosense the media.
- */
-typedef enum {
-	TULIP_PROBE_INACTIVE,
-	TULIP_PROBE_PHYRESET,
-	TULIP_PROBE_PHYAUTONEG,
-	TULIP_PROBE_GPRTEST,
-	TULIP_PROBE_MEDIATEST,
-	TULIP_PROBE_FAILED
-} tulip_probe_state_t;
-
-typedef struct {
-	/*
-	 * Transmit Statistics
-	 */
-	u_int32_t	dot3StatsSingleCollisionFrames;
-	u_int32_t	dot3StatsMultipleCollisionFrames;
-	u_int32_t	dot3StatsSQETestErrors;
-	u_int32_t	dot3StatsDeferredTransmissions;
-	u_int32_t	dot3StatsLateCollisions;
-	u_int32_t	dot3StatsExcessiveCollisions;
-	u_int32_t	dot3StatsCarrierSenseErrors;
-	u_int32_t	dot3StatsInternalMacTransmitErrors;
-	/* not in rfc1650! */
-	u_int32_t	dot3StatsInternalTransmitUnderflows;
-	/* not in rfc1650! */
-	u_int32_t	dot3StatsInternalTransmitBabbles;
-	/*
-	 * Receive Statistics
-	 */
-	u_int32_t	dot3StatsMissedFrames;	/* not in rfc1650! */
-	u_int32_t	dot3StatsAlignmentErrors;
-	u_int32_t	dot3StatsFCSErrors;
-	u_int32_t	dot3StatsFrameTooLongs;
-	u_int32_t	dot3StatsInternalMacReceiveErrors;
-} tulip_dot3_stats_t;
-
-/*
- * Probe information.
- */
-struct tulip_probe_info {
-	u_int8_t	probe_count;		/* count of probe operations */
-	int32_t		probe_timeout;		/* time (ms) of probe timeout */
-	tulip_probe_state_t	probe_state;	/* current media probe state */
-	tulip_media_t	probe_media;		/* current media being probed */
-	u_int32_t	probe_mediamask;	/* medias checked */
-	u_int32_t	probe_passes;		/* times autosense failed */
-	u_int32_t	probe_txprobes;		/* txprobes attempted */
-};
-
-/*
- * Debugging/Statistical information.
- */
-struct tulip_dbg_info {
-	tulip_media_t	dbg_last_media;
-	u_int32_t	dbg_intrs;
-	u_int32_t	dbg_media_probes;
-	u_int32_t	dbg_txprobe_nocarr;
-	u_int32_t	dbg_txprobe_exccoll;
-	u_int32_t	dbg_link_downed;
-	u_int32_t	dbg_link_suspected;
-	u_int32_t	dbg_link_intrs;
-	u_int32_t	dbg_link_pollintrs;
-	u_int32_t	dbg_link_failures;
-	u_int32_t	dbg_nway_starts;
-	u_int32_t	dbg_nway_failures;
-	u_int16_t	dbg_phyregs[32][4];
-	u_int32_t	dbg_rxlowbufs;
-	u_int32_t	dbg_rxintrs;
-	u_int32_t	dbg_last_rxintrs;
-	u_int32_t	dbg_high_rxintrs_hz;
-	u_int32_t	dbg_no_txmaps;
-	u_int32_t	dbg_txput_finishes[8];
-	u_int32_t	dbg_txprobes_ok[TULIP_MEDIA_MAX];
-	u_int32_t	dbg_txprobes_failed[TULIP_MEDIA_MAX];
-	u_int32_t	dbg_events[TULIP_MEDIAPOLL_MAX];
-	u_int32_t	dbg_rxpktsperintr[TULIP_RXDESCS];
-};
-
-/*
- * Performance statistics.
- */
-struct tulip_perfstat {
-	u_quad_t	perf_intr_cycles;
-	u_quad_t	perf_ifstart_cycles;
-	u_quad_t	perf_ifstart_one_cycles;
-	u_quad_t	perf_ifioctl_cycles;
-	u_quad_t	perf_ifwatchdog_cycles;
-	u_quad_t	perf_timeout_cycles;
-	u_quad_t	perf_txput_cycles;
-	u_quad_t	perf_txintr_cycles;
-	u_quad_t	perf_rxintr_cycles;
-	u_quad_t	perf_rxget_cycles;
-	unsigned int	perf_intr;
-	unsigned int	perf_ifstart;
-	unsigned int	perf_ifstart_one;
-	unsigned int	perf_ifioctl;
-	unsigned int	perf_ifwatchdog;
-	unsigned int	perf_timeout;
-	unsigned int	perf_txput;
-	unsigned int	perf_txintr;
-	unsigned int	perf_rxintr;
-	unsigned int	perf_rxget;
-};
-#define	TULIP_PERF_CURRENT	0
-#define	TULIP_PERF_PREVIOUS	1
-#define	TULIP_PERF_TOTAL	2
-#define	TULIP_PERF_MAX		3
-
-/*
- * Per-driver-instance state.
- */
-struct tulip_softc {
-	struct ifmedia		tulip_ifmedia;
-	int			tulip_unit;
-	struct ifnet		*tulip_ifp;
-	u_char			tulip_enaddr[6];
-	bus_space_tag_t		tulip_csrs_bst;
-	bus_space_handle_t	tulip_csrs_bsh;
-	tulip_regfile_t		tulip_csrs;
-
-	u_int32_t		tulip_flags;
-	u_int32_t		tulip_features;
-	u_int32_t		tulip_intrmask;
-	u_int32_t		tulip_cmdmode;
-	u_int32_t		tulip_last_system_error:3;
-	u_int32_t		tulip_txtimer:2;	/* transmission timer */
-	u_int32_t		tulip_system_errors;
-	u_int32_t		tulip_statusbits;	/* status bits from
-							 * CSR5 that may need
-							 * to be printed
-							 */
-	tulip_media_info_t	*tulip_mediums[TULIP_MEDIA_MAX];
-	tulip_media_t		tulip_media;		/* current media type */
-	u_int32_t		tulip_abilities;	/* remote system's
-							 * abilities (as
-							 * defined in IEEE
-							 * 802.3u)
-							 */
-	u_int8_t		tulip_revinfo;		/* chip revision */
-	u_int8_t		tulip_phyaddr;		/* current phy */
-	u_int8_t		tulip_gpinit;		/* active pins on
-							 * 21140
-							 */
-	u_int8_t		tulip_gpdata;	/* default gpdata for 21140 */
-	struct tulip_probe_info	tulip_probe;
-	tulip_chipid_t		tulip_chipid;	/* type of chip we are using */
-	const tulip_boardsw_t	*tulip_boardsw;	/* board/chip characteristics */
-	tulip_softc_t		*tulip_slaves;	/* slaved devices (ZX3xx) */
-#if defined(TULIP_DEBUG)
-	struct tulip_dbg_info	tulip_dbg;
-#endif
-#if defined(TULIP_PERFSTATS)
-	struct tulip_perfstat	tulip_perfstats[TULIP_PERF_MAX];
-#endif
-	tulip_dot3_stats_t	tulip_dot3stats;
-	tulip_ringinfo_t	tulip_rxinfo;
-	tulip_ringinfo_t	tulip_txinfo;
-	tulip_media_info_t	tulip_mediainfo[10];
-	/*
-	 * The setup buffers for sending the setup frame to the chip. one is
-	 * the one being sent while the other is the one being filled.
-	 */
-	bus_dma_tag_t		tulip_setup_tag;
-	bus_dmamap_t		tulip_setup_map;
-	uint32_t		tulip_setup_dma_addr;
-	u_int32_t		*tulip_setupbuf;
-	u_int32_t		tulip_setupdata[192 / sizeof(u_int32_t)];
-	char			tulip_boardid[24];
-	u_int8_t		tulip_rombuf[128];	/* must be aligned */
-
-	/* needed for multiport boards */
-	u_int8_t		tulip_pci_busno;
-	u_int8_t		tulip_pci_devno;
-
-	u_int8_t		tulip_connidx;
-	tulip_srom_connection_t	tulip_conntype;
-	struct callout		tulip_callout;
-	struct mtx		tulip_mutex;
-};
-
-#define	tulip_curperfstats	tulip_perfstats[TULIP_PERF_CURRENT]
-#define	tulip_probe_count	tulip_probe.probe_count
-#define	tulip_probe_timeout	tulip_probe.probe_timeout
-#define	tulip_probe_state	tulip_probe.probe_state
-#define	tulip_probe_media	tulip_probe.probe_media
-#define	tulip_probe_mediamask	tulip_probe.probe_mediamask
-#define	tulip_probe_passes	tulip_probe.probe_passes
-
-/* Definitions for tulip_flags. */
-#define	TULIP_WANTSETUP		0x00000001
-#define	TULIP_WANTHASHPERFECT	0x00000002
-#define	TULIP_WANTHASHONLY	0x00000004
-#define	TULIP_DOINGSETUP	0x00000008
-#define	TULIP_PRINTMEDIA	0x00000010
-#define	TULIP_TXPROBE_ACTIVE	0x00000020
-#define	TULIP_ALLMULTI		0x00000040
-#define	TULIP_WANTRXACT		0x00000080
-#define	TULIP_RXACT		0x00000100
-#define	TULIP_INRESET		0x00000200
-#define	TULIP_NEEDRESET		0x00000400
-#define	TULIP_SQETEST		0x00000800
-#define	TULIP_xxxxxx0		0x00001000
-#define	TULIP_xxxxxx1		0x00002000
-#define	TULIP_WANTTXSTART	0x00004000
-#define	TULIP_NEWTXTHRESH	0x00008000
-#define	TULIP_NOAUTOSENSE	0x00010000
-#define	TULIP_PRINTLINKUP	0x00020000
-#define	TULIP_LINKUP		0x00040000
-#define	TULIP_RXBUFSLOW		0x00080000
-#define	TULIP_NOMESSAGES	0x00100000
-#define	TULIP_SYSTEMERROR	0x00200000
-#define	TULIP_TIMEOUTPENDING	0x00400000
-#define	TULIP_xxxxxx2		0x00800000
-#define	TULIP_TRYNWAY		0x01000000
-#define	TULIP_DIDNWAY		0x02000000
-#define	TULIP_RXIGNORE		0x04000000
-#define	TULIP_PROBE1STPASS	0x08000000
-#define	TULIP_DEVICEPROBE	0x10000000
-#define	TULIP_PROMISC		0x20000000
-#define	TULIP_HASHONLY		0x40000000
-#define	TULIP_xxxxxx3		0x80000000
-
-/* Definitions for tulip_features. */
-#define	TULIP_HAVE_GPR		0x00000001	/* have gp register (140[A]) */
-#define	TULIP_HAVE_RXBADOVRFLW	0x00000002	/* RX corrupts on overflow */
-#define	TULIP_HAVE_POWERMGMT	0x00000004	/* Snooze/sleep modes */
-#define	TULIP_HAVE_MII		0x00000008	/* Some medium on MII */
-#define	TULIP_HAVE_SIANWAY	0x00000010	/* SIA does NWAY */
-#define	TULIP_HAVE_DUALSENSE	0x00000020	/* SIA senses both AUI & TP */
-#define	TULIP_HAVE_SIAGP	0x00000040	/* SIA has a GP port */
-#define	TULIP_HAVE_BROKEN_HASH	0x00000080	/* Broken Multicast Hash */
-#define	TULIP_HAVE_ISVSROM	0x00000100	/* uses ISV SROM Format */
-#define	TULIP_HAVE_BASEROM	0x00000200	/* Board ROM can be cloned */
-#define	TULIP_HAVE_SLAVEDROM	0x00000400	/* Board ROM cloned */
-#define	TULIP_HAVE_SLAVEDINTR	0x00000800	/* Board slaved interrupt */
-#define	TULIP_HAVE_SHAREDINTR	0x00001000	/* Board shares interrupts */
-#define	TULIP_HAVE_OKROM	0x00002000	/* ROM was recognized */
-#define	TULIP_HAVE_NOMEDIA	0x00004000	/* did not detect any media */
-#define	TULIP_HAVE_STOREFWD	0x00008000	/* have CMD_STOREFWD */
-#define	TULIP_HAVE_SIA100	0x00010000	/* has LS100 in SIA status */
-#define	TULIP_HAVE_OKSROM	0x00020000	/* SROM CRC is OK */
-
-#define	TULIP_DO_AUTOSENSE(sc)	\
-	(IFM_SUBTYPE((sc)->tulip_ifmedia.ifm_media) == IFM_AUTO)
-
-#if defined(TULIP_HDR_DATA)
-static const char *const tulip_chipdescs[] = {
-	"21040 [10Mb/s]",
-	"21041 [10Mb/s]",
-	"21140 [10-100Mb/s]",
-	"21140A [10-100Mb/s]",
-	"21142 [10-100Mb/s]",
-	"21143 [10-100Mb/s]",
-};
-
-static const char *const tulip_mediums[] = {
-	"unknown",		/* TULIP_MEDIA_UNKNOWN */
-	"10baseT",		/* TULIP_MEDIA_10BASET */
-	"Full Duplex 10baseT",	/* TULIP_MEDIA_10BASET_FD */
-	"BNC",			/* TULIP_MEDIA_BNC */
-	"AUI",			/* TULIP_MEDIA_AUI */
-	"External SIA",		/* TULIP_MEDIA_EXTSIA */
-	"AUI/BNC",		/* TULIP_MEDIA_AUIBNC */
-	"100baseTX",		/* TULIP_MEDIA_100BASET */
-	"Full Duplex 100baseTX",/* TULIP_MEDIA_100BASET_FD */
-	"100baseT4",		/* TULIP_MEDIA_100BASET4 */
-	"100baseFX",		/* TULIP_MEDIA_100BASEFX */
-	"Full Duplex 100baseFX",/* TULIP_MEDIA_100BASEFX_FD */
-};
-
-static const int tulip_media_to_ifmedia[] = {
-	IFM_ETHER | IFM_NONE,		/* TULIP_MEDIA_UNKNOWN */
-	IFM_ETHER | IFM_10_T,		/* TULIP_MEDIA_10BASET */
-	IFM_ETHER | IFM_10_T | IFM_FDX,	/* TULIP_MEDIA_10BASET_FD */
-	IFM_ETHER | IFM_10_2,		/* TULIP_MEDIA_BNC */
-	IFM_ETHER | IFM_10_5,		/* TULIP_MEDIA_AUI */
-	IFM_ETHER | IFM_MANUAL,		/* TULIP_MEDIA_EXTSIA */
-	IFM_ETHER | IFM_10_5,		/* TULIP_MEDIA_AUIBNC */
-	IFM_ETHER | IFM_100_TX,		/* TULIP_MEDIA_100BASET */
-	IFM_ETHER | IFM_100_TX | IFM_FDX,	/* TULIP_MEDIA_100BASET_FD */
-	IFM_ETHER | IFM_100_T4,		/* TULIP_MEDIA_100BASET4 */
-	IFM_ETHER | IFM_100_FX,		/* TULIP_MEDIA_100BASEFX */
-	IFM_ETHER | IFM_100_FX | IFM_FDX,	/* TULIP_MEDIA_100BASEFX_FD */
-};
-
-static const char *const tulip_system_errors[] = {
-	"parity error",
-	"master abort",
-	"target abort",
-	"reserved #3",
-	"reserved #4",
-	"reserved #5",
-	"reserved #6",
-	"reserved #7",
-};
-
-static const char *const tulip_status_bits[] = {
-	NULL,
-	"transmit process stopped",
-	NULL,
-	"transmit jabber timeout",
-
-	NULL,
-	"transmit underflow",
-	NULL,
-	"receive underflow",
-
-	"receive process stopped",
-	"receive watchdog timeout",
-	NULL,
-	NULL,
-
-	"link failure",
-	NULL,
-	NULL,
-};
-
-static const struct {
-	tulip_srom_connection_t sc_type;
-	tulip_media_t sc_media;
-	u_int32_t sc_attrs;
-} tulip_srom_conninfo[] = {
-	{
-		TULIP_SROM_CONNTYPE_10BASET, TULIP_MEDIA_10BASET
-	},
-	{
-		TULIP_SROM_CONNTYPE_BNC, TULIP_MEDIA_BNC
-	},
-	{
-		TULIP_SROM_CONNTYPE_AUI, TULIP_MEDIA_AUI
-	},
-	{
-		TULIP_SROM_CONNTYPE_100BASETX, TULIP_MEDIA_100BASETX
-	},
-	{
-		TULIP_SROM_CONNTYPE_100BASET4, TULIP_MEDIA_100BASET4
-	},
-	{
-		TULIP_SROM_CONNTYPE_100BASEFX, TULIP_MEDIA_100BASEFX
-	},
-	{
-		TULIP_SROM_CONNTYPE_MII_10BASET, TULIP_MEDIA_10BASET,
-		TULIP_SROM_ATTR_MII
-	},
-	{
-		TULIP_SROM_CONNTYPE_MII_100BASETX, TULIP_MEDIA_100BASETX,
-		TULIP_SROM_ATTR_MII
-	},
-	{
-		TULIP_SROM_CONNTYPE_MII_100BASET4, TULIP_MEDIA_100BASET4,
-		TULIP_SROM_ATTR_MII
-	},
-	{
-		TULIP_SROM_CONNTYPE_MII_100BASEFX, TULIP_MEDIA_100BASEFX,
-		TULIP_SROM_ATTR_MII
-	},
-	{
-		TULIP_SROM_CONNTYPE_10BASET_NWAY, TULIP_MEDIA_10BASET,
-		TULIP_SROM_ATTR_NWAY
-	},
-	{
-		TULIP_SROM_CONNTYPE_10BASET_FD, TULIP_MEDIA_10BASET_FD
-	},
-	{
-		TULIP_SROM_CONNTYPE_MII_10BASET_FD, TULIP_MEDIA_10BASET_FD,
-		TULIP_SROM_ATTR_MII
-	},
-	{
-		TULIP_SROM_CONNTYPE_100BASETX_FD, TULIP_MEDIA_100BASETX_FD
-	},
-	{
-		TULIP_SROM_CONNTYPE_MII_100BASETX_FD, TULIP_MEDIA_100BASETX_FD,
-		TULIP_SROM_ATTR_MII
-	},
-	{
-		TULIP_SROM_CONNTYPE_10BASET_NOLINKPASS, TULIP_MEDIA_10BASET,
-		TULIP_SROM_ATTR_NOLINKPASS
-	},
-	{
-		TULIP_SROM_CONNTYPE_AUTOSENSE, TULIP_MEDIA_UNKNOWN,
-		TULIP_SROM_ATTR_AUTOSENSE
-	},
-	{
-		TULIP_SROM_CONNTYPE_AUTOSENSE_POWERUP, TULIP_MEDIA_UNKNOWN,
-		TULIP_SROM_ATTR_AUTOSENSE | TULIP_SROM_ATTR_POWERUP
-	},
-	{
-		TULIP_SROM_CONNTYPE_AUTOSENSE_NWAY, TULIP_MEDIA_UNKNOWN,
-		TULIP_SROM_ATTR_AUTOSENSE | TULIP_SROM_ATTR_NWAY
-	},
-	{
-		TULIP_SROM_CONNTYPE_NOT_USED, TULIP_MEDIA_UNKNOWN
-	}
-};
-#define	TULIP_SROM_LASTCONNIDX	\
-		(sizeof(tulip_srom_conninfo)/sizeof(tulip_srom_conninfo[0]) - 1)
-
-static const struct {
-	tulip_media_t sm_type;
-	tulip_srom_media_t sm_srom_type;
-} tulip_srom_mediums[] = {
-	{
-		TULIP_MEDIA_100BASEFX_FD, TULIP_SROM_MEDIA_100BASEFX_FD
-	},
-	{
-		TULIP_MEDIA_100BASEFX, TULIP_SROM_MEDIA_100BASEFX
-	},
-	{
-		TULIP_MEDIA_100BASET4, TULIP_SROM_MEDIA_100BASET4
-	},
-	{
-		TULIP_MEDIA_100BASETX_FD, TULIP_SROM_MEDIA_100BASETX_FD
-	},
-	{
-		TULIP_MEDIA_100BASETX, TULIP_SROM_MEDIA_100BASETX
-	},
-	{
-		TULIP_MEDIA_10BASET_FD, TULIP_SROM_MEDIA_10BASET_FD
-	},
-	{
-		TULIP_MEDIA_AUI, TULIP_SROM_MEDIA_AUI
-	},
-	{
-		TULIP_MEDIA_BNC, TULIP_SROM_MEDIA_BNC
-	},
-	{
-		TULIP_MEDIA_10BASET, TULIP_SROM_MEDIA_10BASET
-	},
-	{
-		TULIP_MEDIA_UNKNOWN
-	}
-};
-
-#endif				/* TULIP_HDR_DATA */
-
-/*
- * Macro to encode 16 bits of a MAC address into the setup buffer.  Since
- * we are casting the two bytes in the char array to a uint16 and then
- * handing them to this macro, we don't need to swap the bytes in the big
- * endian case, just shift them left 16.
- */
-#if BYTE_ORDER == BIG_ENDIAN
-#define	TULIP_SP_MAC(x)		((x) << 16)
-#else
-#define	TULIP_SP_MAC(x)		(x)
-#endif
-
-/*
- * This driver supports a maximum of 32 tulip boards.
- * This should be enough for the forseeable future.
- */
-#define	TULIP_MAX_DEVICES	32
-
-#define	_TULIP_DESC_SYNC(ri, op)					\
-	bus_dmamap_sync((ri)->ri_ring_tag, (ri)->ri_ring_map, (op))
-#define	_TULIP_MAP_SYNC(ri, di, op)					\
-	bus_dmamap_sync((ri)->ri_data_tag, *(di)->di_map, (op))
-
-/*
- * Descriptors are both read from and written to by the card (corresponding
- * to DMA WRITE and READ operations in bus-dma speak).  Receive maps are
- * written to by the card (a DMA READ operation in bus-dma) and transmit
- * buffers are read from by the card (a DMA WRITE operation in bus-dma).
- */
-#define TULIP_RXDESC_PRESYNC(ri)					\
-	_TULIP_DESC_SYNC(ri, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE)
-#define TULIP_RXDESC_POSTSYNC(ri)					\
-	_TULIP_DESC_SYNC(ri, BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE)
-#define	TULIP_RXMAP_PRESYNC(ri, di)					\
-	_TULIP_MAP_SYNC(ri, di, BUS_DMASYNC_PREREAD)
-#define	TULIP_RXMAP_POSTSYNC(ri, di)					\
-	_TULIP_MAP_SYNC(ri, di, BUS_DMASYNC_POSTREAD)
-#define TULIP_TXDESC_PRESYNC(ri)					\
-	_TULIP_DESC_SYNC(ri, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE)
-#define TULIP_TXDESC_POSTSYNC(ri)					\
-	_TULIP_DESC_SYNC(ri, BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE)
-#define	TULIP_TXMAP_PRESYNC(ri, di)					\
-	_TULIP_MAP_SYNC(ri, di, BUS_DMASYNC_PREWRITE)
-#define	TULIP_TXMAP_POSTSYNC(ri, di)					\
-	_TULIP_MAP_SYNC(ri, di, BUS_DMASYNC_POSTWRITE)
-
-#ifdef notyet
-#define	SIOCGADDRROM		_IOW('i', 240, struct ifreq)	/* get 128 bytes of ROM */
-#define	SIOCGCHIPID		_IOWR('i', 241, struct ifreq)	/* get chipid */
-#endif
-
-#if defined(TULIP_HDR_DATA)
-static tulip_softc_t	*tulips[TULIP_MAX_DEVICES];
-#endif
-
-#define	loudprintf			if (bootverbose) printf
-
-#if defined(TULIP_PERFSTATS)
-#define	TULIP_PERFMERGE(sc, member) \
-	do { (sc)->tulip_perfstats[TULIP_PERF_TOTAL].member \
-	     += (sc)->tulip_perfstats[TULIP_PERF_CURRENT].member; \
-	 (sc)->tulip_perfstats[TULIP_PERF_PREVIOUS].member \
-	      = (sc)->tulip_perfstats[TULIP_PERF_CURRENT].member; \
-	    (sc)->tulip_perfstats[TULIP_PERF_CURRENT].member = 0; } while (0)
-#define	TULIP_PERFSTART(name) const tulip_cycle_t perfstart_ ## name = TULIP_PERFREAD();
-#define	TULIP_PERFEND(name)	do { \
-	    (sc)->tulip_curperfstats.perf_ ## name ## _cycles += TULIP_PERFDIFF(perfstart_ ## name, TULIP_PERFREAD()); \
-	    (sc)->tulip_curperfstats.perf_ ## name ++; \
-	} while (0)
-
-typedef u_long tulip_cycle_t;
-
-static __inline tulip_cycle_t
-TULIP_PERFREAD(void)
-{
-	return (get_cyclecount());
-}
-
-#define	TULIP_PERFDIFF(s, f)	((f) - (s))
-#else
-#define	TULIP_PERFSTART(name)
-#define	TULIP_PERFEND(name)	do { } while (0)
-#define	TULIP_PERFMERGE(s,n)	do { } while (0)
-#endif	/* TULIP_PERFSTATS */
-
-#define	TULIP_CRC32_POLY	0xEDB88320UL	/* CRC-32 Poly -- Little
-						 * Endian */
-#define	TULIP_MAX_TXSEG		30
-#define	TULIP_MAX_FRAGS		2
-
-#define	TULIP_ADDREQUAL(a1, a2) \
-	(((u_int16_t *)a1)[0] == ((u_int16_t *)a2)[0] \
-	 && ((u_int16_t *)a1)[1] == ((u_int16_t *)a2)[1] \
-	 && ((u_int16_t *)a1)[2] == ((u_int16_t *)a2)[2])
-#define	TULIP_ADDRBRDCST(a1) \
-	(((u_int16_t *)a1)[0] == 0xFFFFU \
-	 && ((u_int16_t *)a1)[1] == 0xFFFFU \
-	 && ((u_int16_t *)a1)[2] == 0xFFFFU)
-
-#define	TULIP_MUTEX(sc)		(&(sc)->tulip_mutex)
-#define	TULIP_LOCK(sc)		mtx_lock(TULIP_MUTEX(sc))
-#define	TULIP_UNLOCK(sc)	mtx_unlock(TULIP_MUTEX(sc))
-#define	TULIP_LOCK_ASSERT(sc)	mtx_assert(TULIP_MUTEX(sc), MA_OWNED)
-
-#endif	/* _DEVAR_H */
Index: if_sis.c
===================================================================
RCS file: /home/cvs/src/sys/pci/if_sis.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -L sys/pci/if_sis.c -L sys/pci/if_sis.c -u -r1.2 -r1.3
--- sys/pci/if_sis.c
+++ sys/pci/if_sis.c
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/if_sis.c,v 1.132.2.6 2005/10/09 04:11:19 delphij Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/if_sis.c,v 1.150 2007/02/24 14:27:36 delphij Exp $");
 
 /*
  * SiS 900/SiS 7016 fast ethernet PCI NIC driver. Datasheets are
@@ -70,7 +70,6 @@
 #include <sys/kernel.h>
 #include <sys/module.h>
 #include <sys/socket.h>
-#include <sys/sysctl.h>
 
 #include <net/if.h>
 #include <net/if_arp.h>
@@ -101,9 +100,22 @@
 MODULE_DEPEND(sis, ether, 1, 1, 1);
 MODULE_DEPEND(sis, miibus, 1, 1, 1);
 
-/* "controller miibus0" required.  See GENERIC if you get errors here. */
+/* "device miibus" required.  See GENERIC if you get errors here. */
 #include "miibus_if.h"
 
+#define	SIS_LOCK(_sc)		mtx_lock(&(_sc)->sis_mtx)
+#define	SIS_UNLOCK(_sc)		mtx_unlock(&(_sc)->sis_mtx)
+#define	SIS_LOCK_ASSERT(_sc)	mtx_assert(&(_sc)->sis_mtx, MA_OWNED)
+
+/*
+ * register space access macros
+ */
+#define CSR_WRITE_4(sc, reg, val)	bus_write_4(sc->sis_res[0], reg, val)
+
+#define CSR_READ_4(sc, reg)		bus_read_4(sc->sis_res[0], reg)
+
+#define CSR_READ_2(sc, reg)		bus_read_2(sc->sis_res[0], reg)
+
 /*
  * Various supported device vendors/types and their names.
  */
@@ -125,15 +137,18 @@
 static void sis_start(struct ifnet *);
 static void sis_startl(struct ifnet *);
 static void sis_stop(struct sis_softc *);
-static void sis_watchdog(struct ifnet *);
+static void sis_watchdog(struct sis_softc *);
+
 
+static struct resource_spec sis_res_spec[] = {
 #ifdef SIS_USEIOSPACE
-#define SIS_RES			SYS_RES_IOPORT
-#define SIS_RID			SIS_PCI_LOIO
+	{ SYS_RES_IOPORT,	SIS_PCI_LOIO,	RF_ACTIVE},
 #else
-#define SIS_RES			SYS_RES_MEMORY
-#define SIS_RID			SIS_PCI_LOMEM
+	{ SYS_RES_MEMORY,	SIS_PCI_LOMEM,	RF_ACTIVE},
 #endif
+	{ SYS_RES_IRQ,		0,		RF_ACTIVE | RF_SHAREABLE},
+	{ -1, 0 }
+};
 
 #define SIS_SETBIT(sc, reg, x)				\
 	CSR_WRITE_4(sc, reg,				\
@@ -623,7 +638,7 @@
 		}
 
 		if (i == SIS_TIMEOUT) {
-			if_printf(sc->sis_ifp, "PHY failed to come ready\n");
+			device_printf(sc->sis_dev, "PHY failed to come ready\n");
 			return(0);
 		}
 
@@ -681,7 +696,7 @@
 		}
 
 		if (i == SIS_TIMEOUT)
-			if_printf(sc->sis_ifp, "PHY failed to come ready\n");
+			device_printf(sc->sis_dev, "PHY failed to come ready\n");
 	} else {
 		bzero((char *)&frame, sizeof(frame));
 
@@ -847,7 +862,7 @@
 	}
 
 	if (i == SIS_TIMEOUT)
-		if_printf(sc->sis_ifp, "reset never completed\n");
+		device_printf(sc->sis_dev, "reset never completed\n");
 
 	/* Wait a little while for the chip to get its brains in order. */
 	DELAY(1000);
@@ -897,12 +912,12 @@
 	u_char			eaddr[ETHER_ADDR_LEN];
 	struct sis_softc	*sc;
 	struct ifnet		*ifp;
-	int			error = 0, rid, waittime = 0;
+	int			error = 0, waittime = 0;
 
 	waittime = 0;
 	sc = device_get_softc(dev);
 
-	sc->sis_self = dev;
+	sc->sis_dev = dev;
 
 	mtx_init(&sc->sis_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
 	    MTX_DEF);
@@ -921,26 +936,9 @@
 	 */
 	pci_enable_busmaster(dev);
 
-	rid = SIS_RID;
-	sc->sis_res = bus_alloc_resource_any(dev, SIS_RES, &rid, RF_ACTIVE);
-
-	if (sc->sis_res == NULL) {
-		device_printf(dev, "couldn't map ports/memory\n");
-		error = ENXIO;
-		goto fail;
-	}
-
-	sc->sis_btag = rman_get_bustag(sc->sis_res);
-	sc->sis_bhandle = rman_get_bushandle(sc->sis_res);
-
-	/* Allocate interrupt */
-	rid = 0;
-	sc->sis_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
-	    RF_SHAREABLE | RF_ACTIVE);
-
-	if (sc->sis_irq == NULL) {
-		device_printf(dev, "couldn't map interrupt\n");
-		error = ENXIO;
+	error = bus_alloc_resources(dev, sis_res_spec, sc->sis_res);
+	if (error) {
+		device_printf(dev, "couldn't allocate resources\n");
 		goto fail;
 	}
 
@@ -1195,7 +1193,6 @@
 	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
 	ifp->if_ioctl = sis_ioctl;
 	ifp->if_start = sis_start;
-	ifp->if_watchdog = sis_watchdog;
 	ifp->if_init = sis_init;
 	IFQ_SET_MAXLEN(&ifp->if_snd, SIS_TX_LIST_CNT - 1);
 	ifp->if_snd.ifq_drv_maxlen = SIS_TX_LIST_CNT - 1;
@@ -1207,7 +1204,6 @@
 	if (mii_phy_probe(dev, &sc->sis_miibus,
 	    sis_ifmedia_upd, sis_ifmedia_sts)) {
 		device_printf(dev, "MII without any PHY!\n");
-		if_free(ifp);
 		error = ENXIO;
 		goto fail;
 	}
@@ -1228,8 +1224,8 @@
 #endif
 
 	/* Hook interrupt last to avoid having to lock softc */
-	error = bus_setup_intr(dev, sc->sis_irq, INTR_TYPE_NET | INTR_MPSAFE,
-	    sis_intr, sc, &sc->sis_intrhand);
+	error = bus_setup_intr(dev, sc->sis_res[1], INTR_TYPE_NET | INTR_MPSAFE,
+	    NULL, sis_intr, sc, &sc->sis_intrhand);
 
 	if (error) {
 		device_printf(dev, "couldn't set up irq\n");
@@ -1275,18 +1271,16 @@
 		callout_drain(&sc->sis_stat_ch);
 		ether_ifdetach(ifp);
 	}
-	if (ifp)
-		if_free(ifp);
 	if (sc->sis_miibus)
 		device_delete_child(dev, sc->sis_miibus);
 	bus_generic_detach(dev);
 
 	if (sc->sis_intrhand)
-		bus_teardown_intr(dev, sc->sis_irq, sc->sis_intrhand);
-	if (sc->sis_irq)
-		bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sis_irq);
-	if (sc->sis_res)
-		bus_release_resource(dev, SIS_RES, SIS_RID, sc->sis_res);
+		bus_teardown_intr(dev, sc->sis_res[1], sc->sis_intrhand);
+	bus_release_resources(dev, sis_res_spec, sc->sis_res);
+
+	if (ifp)
+		if_free(ifp);
 
 	if (sc->sis_rx_tag) {
 		bus_dmamap_unload(sc->sis_rx_tag,
@@ -1402,8 +1396,8 @@
 static void
 sis_rxeof(struct sis_softc *sc)
 {
-        struct mbuf		*m;
-        struct ifnet		*ifp;
+	struct mbuf		*m, *m0;
+	struct ifnet		*ifp;
 	struct sis_desc		*cur_rx;
 	int			total_len = 0;
 	u_int32_t		rxstat;
@@ -1446,9 +1440,9 @@
 		}
 
 		/* No errors; receive the packet. */	
-#if defined(__i386__) || defined(__amd64__)
+#ifdef __NO_STRICT_ALIGNMENT
 		/*
-		 * On the x86 we do not have alignment problems, so try to
+		 * On architectures without alignment problems we try to
 		 * allocate a new buffer for the receive ring, and pass up
 		 * the one where the packet is already, saving the expensive
 		 * copy done in m_devget().
@@ -1461,7 +1455,6 @@
 		else
 #endif
 		{
-			struct mbuf		*m0;
 			m0 = m_devget(mtod(m, char *), total_len,
 				ETHER_ALIGN, ifp, NULL);
 			sis_newbuf(sc, cur_rx, m);
@@ -1546,7 +1539,7 @@
 		ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
 	}
 
-	ifp->if_timer = (sc->sis_tx_cnt == 0) ? 0 : 5;
+	sc->sis_watchdog_timer = (sc->sis_tx_cnt == 0) ? 0 : 5;
 
 	return;
 }
@@ -1566,6 +1559,8 @@
 	mii = device_get_softc(sc->sis_miibus);
 	mii_tick(mii);
 
+	sis_watchdog(sc);
+
 	if (!sc->sis_link && mii->mii_media_status & IFM_ACTIVE &&
 	    IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) {
 		sc->sis_link++;
@@ -1828,7 +1823,7 @@
 		/*
 		 * Set a timeout in case the chip goes out to lunch.
 		 */
-		ifp->if_timer = 5;
+		sc->sis_watchdog_timer = 5;
 	}
 }
 
@@ -1872,28 +1867,28 @@
 	if (sc->sis_type == SIS_TYPE_83815) {
 		CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_PAR0);
 		CSR_WRITE_4(sc, SIS_RXFILT_DATA,
-		    ((u_int16_t *)IFP2ENADDR(sc->sis_ifp))[0]);
+		    ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[0]);
 		CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_PAR1);
 		CSR_WRITE_4(sc, SIS_RXFILT_DATA,
-		    ((u_int16_t *)IFP2ENADDR(sc->sis_ifp))[1]);
+		    ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[1]);
 		CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_PAR2);
 		CSR_WRITE_4(sc, SIS_RXFILT_DATA,
-		    ((u_int16_t *)IFP2ENADDR(sc->sis_ifp))[2]);
+		    ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[2]);
 	} else {
 		CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR0);
 		CSR_WRITE_4(sc, SIS_RXFILT_DATA,
-		    ((u_int16_t *)IFP2ENADDR(sc->sis_ifp))[0]);
+		    ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[0]);
 		CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR1);
 		CSR_WRITE_4(sc, SIS_RXFILT_DATA,
-		    ((u_int16_t *)IFP2ENADDR(sc->sis_ifp))[1]);
+		    ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[1]);
 		CSR_WRITE_4(sc, SIS_RXFILT_CTL, SIS_FILTADDR_PAR2);
 		CSR_WRITE_4(sc, SIS_RXFILT_DATA,
-		    ((u_int16_t *)IFP2ENADDR(sc->sis_ifp))[2]);
+		    ((u_int16_t *)IF_LLADDR(sc->sis_ifp))[2]);
 	}
 
 	/* Init circular TX/RX lists. */
 	if (sis_ring_init(sc) != 0) {
-		if_printf(ifp,
+		device_printf(sc->sis_dev,
 		    "initialization failed: no memory for rx buffers\n");
 		sis_stop(sc);
 		return;
@@ -2017,7 +2012,7 @@
 		DELAY(100000);
 		reg = CSR_READ_4(sc, NS_PHY_TDATA) & 0xff;
 		if ((reg & 0x0080) == 0 || (reg > 0xd8 && reg <= 0xff)) {
-			device_printf(sc->sis_self,
+			device_printf(sc->sis_dev,
 			    "Applying short cable fix (reg=%x)\n", reg);
 			CSR_WRITE_4(sc, NS_PHY_TDATA, 0x00e8);
 			reg = CSR_READ_4(sc, NS_PHY_DSPCFG);
@@ -2171,29 +2166,27 @@
 }
 
 static void
-sis_watchdog(struct ifnet *ifp)
+sis_watchdog(struct sis_softc *sc)
 {
-	struct sis_softc *sc;
-
-	sc = ifp->if_softc;
 
-	SIS_LOCK(sc);
+	SIS_LOCK_ASSERT(sc);
 	if (sc->sis_stopped) {
 		SIS_UNLOCK(sc);
 		return;
 	}
 
-	ifp->if_oerrors++;
-	if_printf(ifp, "watchdog timeout\n");
+	if (sc->sis_watchdog_timer == 0 || --sc->sis_watchdog_timer >0)
+		return;
+
+	device_printf(sc->sis_dev, "watchdog timeout\n");
+	sc->sis_ifp->if_oerrors++;
 
 	sis_stop(sc);
 	sis_reset(sc);
 	sis_initl(sc);
 
-	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
-		sis_startl(ifp);
-
-	SIS_UNLOCK(sc);
+	if (!IFQ_DRV_IS_EMPTY(&sc->sis_ifp->if_snd))
+		sis_startl(sc->sis_ifp);
 }
 
 /*
@@ -2211,7 +2204,7 @@
 		return;
 	SIS_LOCK_ASSERT(sc);
 	ifp = sc->sis_ifp;
-	ifp->if_timer = 0;
+	sc->sis_watchdog_timer = 0;
 
 	callout_stop(&sc->sis_stat_ch);
 
Index: if_sf.c
===================================================================
RCS file: /home/cvs/src/sys/pci/if_sf.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -L sys/pci/if_sf.c -L sys/pci/if_sf.c -u -r1.2 -r1.3
--- sys/pci/if_sf.c
+++ sys/pci/if_sf.c
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/if_sf.c,v 1.82.2.5 2005/10/09 04:11:19 delphij Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/if_sf.c,v 1.95 2007/02/23 12:19:03 piso Exp $");
 
 /*
  * Adaptec AIC-6915 "Starfire" PCI fast ethernet driver for FreeBSD.
@@ -111,7 +111,7 @@
 #include <dev/mii/mii.h>
 #include <dev/mii/miivar.h>
 
-/* "controller miibus0" required.  See GENERIC if you get errors here. */
+/* "device miibus" required.  See GENERIC if you get errors here. */
 #include "miibus_if.h"
 
 #include <dev/pci/pcireg.h>
@@ -616,7 +616,7 @@
 	}
 
 	if (i == SF_TIMEOUT)
-		if_printf(sc->sf_ifp, "reset never completed!\n");
+		device_printf(sc->sf_dev, "reset never completed!\n");
 
 	/* Wait a little while for the chip to get its brains in order. */
 	DELAY(1000);
@@ -690,6 +690,7 @@
 	u_char			eaddr[6];
 
 	sc = device_get_softc(dev);
+	sc->sf_dev = dev;
 
 	mtx_init(&sc->sf_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
 	    MTX_DEF);
@@ -783,7 +784,7 @@
 
 	/* Hook interrupt last to avoid having to lock softc */
 	error = bus_setup_intr(dev, sc->sf_irq, INTR_TYPE_NET | INTR_MPSAFE,
-	    sf_intr, sc, &sc->sf_intrhand);
+	    NULL, sf_intr, sc, &sc->sf_intrhand);
 
 	if (error) {
 		device_printf(dev, "couldn't set up irq\n");
@@ -829,8 +830,6 @@
 		callout_drain(&sc->sf_stat_callout);
 		ether_ifdetach(ifp);
 	}
-	if (ifp)
-		if_free(ifp);
 	if (sc->sf_miibus)
 		device_delete_child(dev, sc->sf_miibus);
 	bus_generic_detach(dev);
@@ -842,6 +841,9 @@
 	if (sc->sf_res)
 		bus_release_resource(dev, SF_RES, SF_RID, sc->sf_res);
 
+	if (ifp)
+		if_free(ifp);
+
 	if (sc->sf_ldata)
 		contigfree(sc->sf_ldata, sizeof(struct sf_list_data), M_DEVBUF);
 
@@ -1080,7 +1082,7 @@
 		txfctl &= ~SF_TXFRMCTL_TXTHRESH;
 		txfctl |= txthresh;
 #ifdef DIAGNOSTIC
-		if_printf(sc->sf_ifp, "tx underrun, increasing "
+		device_printf(sc->sf_dev, "tx underrun, increasing "
 		    "tx threshold to %d bytes\n",
 		    txthresh * 4);
 #endif
@@ -1237,12 +1239,12 @@
 		    (i + sizeof(u_int32_t)), 0);
 
 	/* Init our MAC address */
-	csr_write_4(sc, SF_PAR0, *(u_int32_t *)(&IFP2ENADDR(sc->sf_ifp)[0]));
-	csr_write_4(sc, SF_PAR1, *(u_int32_t *)(&IFP2ENADDR(sc->sf_ifp)[4]));
-	sf_setperf(sc, 0, (caddr_t)&IFP2ENADDR(sc->sf_ifp));
+	csr_write_4(sc, SF_PAR0, *(u_int32_t *)(&IF_LLADDR(sc->sf_ifp)[0]));
+	csr_write_4(sc, SF_PAR1, *(u_int32_t *)(&IF_LLADDR(sc->sf_ifp)[4]));
+	sf_setperf(sc, 0, IF_LLADDR(sc->sf_ifp));
 
 	if (sf_init_rx_ring(sc) == ENOBUFS) {
-		if_printf(sc->sf_ifp,
+		device_printf(sc->sf_dev,
 		    "initialization failed: no memory for rx buffers\n");
 		return;
 	}
Index: agp_i810.c
===================================================================
RCS file: /home/cvs/src/sys/pci/agp_i810.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -L sys/pci/agp_i810.c -L sys/pci/agp_i810.c -u -r1.2 -r1.3
--- sys/pci/agp_i810.c
+++ sys/pci/agp_i810.c
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/pci/agp_i810.c,v 1.32.2.1 2005/12/14 00:47:25 anholt Exp $");
+__FBSDID("$FreeBSD: src/sys/pci/agp_i810.c,v 1.41.2.2 2007/12/01 16:24:23 remko Exp $");
 
 #include "opt_bus.h"
 
@@ -58,19 +58,41 @@
 
 #include <machine/bus.h>
 #include <machine/resource.h>
+#include <machine/md_var.h>
 #include <sys/rman.h>
 
 MALLOC_DECLARE(M_AGP);
 
-#define READ1(off)	bus_space_read_1(sc->bst, sc->bsh, off)
-#define READ4(off)	bus_space_read_4(sc->bst, sc->bsh, off)
-#define WRITE4(off,v)	bus_space_write_4(sc->bst, sc->bsh, off, v)
-#define WRITEGTT(off,v)	bus_space_write_4(sc->gtt_bst, sc->gtt_bsh, off, v)
-
-#define CHIP_I810 0	/* i810/i815 */
-#define CHIP_I830 1	/* 830M/845G */
-#define CHIP_I855 2	/* 852GM/855GM/865G */
-#define CHIP_I915 3	/* 915G/915GM */
+enum {
+	CHIP_I810,	/* i810/i815 */
+	CHIP_I830,	/* 830M/845G */
+	CHIP_I855,	/* 852GM/855GM/865G */
+	CHIP_I915,	/* 915G/915GM */
+	CHIP_I965,	/* G965 */
+	CHIP_G33,	/* G33/Q33/Q35 */
+};
+
+/* The i810 through i855 have the registers at BAR 1, and the GATT gets
+ * allocated by us.  The i915 has registers in BAR 0 and the GATT is at the
+ * start of the stolen memory, and should only be accessed by the OS through
+ * BAR 3.  The G965 has registers and GATT in the same BAR (0) -- first 512KB
+ * is registers, second 512KB is GATT.
+ */
+static struct resource_spec agp_i810_res_spec[] = {
+	{ SYS_RES_MEMORY, AGP_I810_MMADR, RF_ACTIVE | RF_SHAREABLE },
+	{ -1, 0 }
+};
+
+static struct resource_spec agp_i915_res_spec[] = {
+	{ SYS_RES_MEMORY, AGP_I915_MMADR, RF_ACTIVE | RF_SHAREABLE },
+	{ SYS_RES_MEMORY, AGP_I915_GTTADR, RF_ACTIVE | RF_SHAREABLE },
+	{ -1, 0 }
+};
+
+static struct resource_spec agp_i965_res_spec[] = {
+	{ SYS_RES_MEMORY, AGP_I965_GTTMMADR, RF_ACTIVE | RF_SHAREABLE },
+	{ -1, 0 }
+};
 
 struct agp_i810_softc {
 	struct agp_softc agp;
@@ -81,78 +103,92 @@
 	u_int32_t stolen;		/* number of i830/845 gtt entries for stolen memory */
 	device_t bdev;			/* bridge device */
 
-	struct resource *regs;		/* memory mapped GC registers */
-	bus_space_tag_t bst;		/* bus_space tag */
-	bus_space_handle_t bsh;		/* bus_space handle */
-
-	struct resource *gtt;		/* memory mapped GATT entries */
-	bus_space_tag_t gtt_bst;	/* bus_space tag */
-	bus_space_handle_t gtt_bsh;	/* bus_space handle */
+	void *argb_cursor;		/* contigmalloc area for ARGB cursor */
 
-        struct resource *gm;            /* unmapped (but allocated) aperture */
+	struct resource_spec * sc_res_spec;
+	struct resource *sc_res[2];
 };
 
-static const char*
+/* For adding new devices, devid is the id of the graphics controller
+ * (pci:0:2:0, for example).  The placeholder (usually at pci:0:2:1) for the
+ * second head should never be added.  The bridge_offset is the offset to
+ * subtract from devid to get the id of the hostb that the device is on.
+ */
+static const struct agp_i810_match {
+	int devid;
+	int chiptype;
+	int bridge_offset;
+	char *name;
+} agp_i810_matches[] = {
+	{0x71218086, CHIP_I810, 0x00010000,
+	    "Intel 82810 (i810 GMCH) SVGA controller"},
+	{0x71238086, CHIP_I810, 0x00010000,
+	    "Intel 82810-DC100 (i810-DC100 GMCH) SVGA controller"},
+	{0x71258086, CHIP_I810, 0x00010000,
+	    "Intel 82810E (i810E GMCH) SVGA controller"},
+	{0x11328086, CHIP_I810, 0x00020000,
+	    "Intel 82815 (i815 GMCH) SVGA controller"},
+	{0x35778086, CHIP_I830, 0x00020000,
+	    "Intel 82830M (830M GMCH) SVGA controller"},
+	{0x25628086, CHIP_I830, 0x00020000,
+	    "Intel 82845M (845M GMCH) SVGA controller"},
+	{0x35828086, CHIP_I855, 0x00020000,
+	    "Intel 82852/5"},
+	{0x25728086, CHIP_I855, 0x00020000,
+	    "Intel 82865G (865G GMCH) SVGA controller"},
+	{0x25828086, CHIP_I915, 0x00020000,
+	    "Intel 82915G (915G GMCH) SVGA controller"},
+	{0x258A8086, CHIP_I915, 0x00020000,
+	    "Intel E7221 SVGA controller"},
+	{0x25928086, CHIP_I915, 0x00020000,
+	    "Intel 82915GM (915GM GMCH) SVGA controller"},
+	{0x27728086, CHIP_I915, 0x00020000,
+	    "Intel 82945G (945G GMCH) SVGA controller"},
+	{0x27A28086, CHIP_I915, 0x00020000,
+	    "Intel 82945GM (945GM GMCH) SVGA controller"},
+	{0x27A28086, CHIP_I915, 0x00020000,
+	    "Intel 945GME SVGA controller"},
+	{0x29728086, CHIP_I965, 0x00020000,
+	    "Intel 946GZ SVGA controller"},
+	{0x29828086, CHIP_I965, 0x00020000,
+	    "Intel G965 SVGA controller"},
+	{0x29928086, CHIP_I965, 0x00020000,
+	    "Intel Q965 SVGA controller"},
+	{0x29a28086, CHIP_I965, 0x00020000,
+	    "Intel G965 SVGA controller"},
+/*
+	{0x29b28086, CHIP_G33, 0x00020000,
+	    "Intel Q35 SVGA controller"},
+	{0x29c28086, CHIP_G33, 0x00020000,
+	    "Intel G33 SVGA controller"},
+	{0x29d28086, CHIP_G33, 0x00020000,
+	    "Intel Q33 SVGA controller"},
+*/
+	{0x2a028086, CHIP_I965, 0x00020000,
+	    "Intel GM965 SVGA controller"},
+	{0x2a128086, CHIP_I965, 0x00020000,
+	    "Intel GME965 SVGA controller"},
+	{0, 0, 0, NULL}
+};
+
+static const struct agp_i810_match*
 agp_i810_match(device_t dev)
 {
+	int i, devid;
+
 	if (pci_get_class(dev) != PCIC_DISPLAY
 	    || pci_get_subclass(dev) != PCIS_DISPLAY_VGA)
 		return NULL;
 
-	switch (pci_get_devid(dev)) {
-	case 0x71218086:
-		return ("Intel 82810 (i810 GMCH) SVGA controller");
-
-	case 0x71238086:
-		return ("Intel 82810-DC100 (i810-DC100 GMCH) SVGA controller");
-
-	case 0x71258086:
-		return ("Intel 82810E (i810E GMCH) SVGA controller");
-
-	case 0x11328086:
-		return ("Intel 82815 (i815 GMCH) SVGA controller");
-
-	case 0x35778086:
-		return ("Intel 82830M (830M GMCH) SVGA controller");
-
-	case 0x25628086:
-		return ("Intel 82845G (845G GMCH) SVGA controller");
-
-	case 0x35828086:
-		switch (pci_read_config(dev, AGP_I85X_CAPID, 1)) {
-		case AGP_I855_GME:
-			return ("Intel 82855GME (855GME GMCH) SVGA controller");
-
-		case AGP_I855_GM:
-			return ("Intel 82855GM (855GM GMCH) SVGA controller");
-
-		case AGP_I852_GME:
-			return ("Intel 82852GME (852GME GMCH) SVGA controller");
-
-		case AGP_I852_GM:
-			return ("Intel 82852GM (852GM GMCH) SVGA controller");
-
-		default:
-			return ("Intel 8285xM (85xGM GMCH) SVGA controller");
-		}
-
-	case 0x25728086:
-		return ("Intel 82865G (865G GMCH) SVGA controller");
-
-	case 0x25828086:
-		return ("Intel 82915G (915G GMCH) SVGA controller");
-
-	case 0x25928086:
-		return ("Intel 82915GM (915GM GMCH) SVGA controller");
-
-	case 0x27728086:
-		return ("Intel 82945G (945G GMCH) SVGA controller");
-
-	case 0x27A28086:
-		return ("Intel 82945GM (945GM GMCH) SVGA controller");
-	};
-
-	return NULL;
+	devid = pci_get_devid(dev);
+	for (i = 0; agp_i810_matches[i].devid != 0; i++) {
+		if (agp_i810_matches[i].devid == devid)
+		    break;
+	}
+	if (agp_i810_matches[i].devid == 0)
+		return NULL;
+	else
+		return &agp_i810_matches[i];
 }
 
 /*
@@ -164,29 +200,13 @@
 	device_t *children, child;
 	int nchildren, i;
 	u_int32_t devid;
+	const struct agp_i810_match *match;
+  
+	match = agp_i810_match(dev);
+	devid = match->devid - match->bridge_offset;
 
-	/*
-	 * Calculate bridge device's ID.
-	 */
-	devid = pci_get_devid(dev);
-	switch (devid) {
-	case 0x71218086:
-	case 0x71238086:
-	case 0x71258086:
-		devid -= 0x10000;
-		break;
-
-	case 0x11328086:
-	case 0x35778086:
-	case 0x25628086:
-	case 0x35828086:
-	case 0x25728086:
-	case 0x25828086:
-	case 0x25928086:
-		devid -= 0x20000;
-		break;
-	};
-	if (device_get_children(device_get_parent(dev), &children, &nchildren))
+	if (device_get_children(device_get_parent(device_get_parent(dev)),
+	    &children, &nchildren))
 		return 0;
 
 	for (i = 0; i < nchildren; i++) {
@@ -201,82 +221,134 @@
 	return 0;
 }
 
+static void
+agp_i810_identify(driver_t *driver, device_t parent)
+{
+
+	if (device_find_child(parent, "agp", -1) == NULL &&
+	    agp_i810_match(parent))
+		device_add_child(parent, "agp", -1);
+}
+
 static int
 agp_i810_probe(device_t dev)
 {
-	const char *desc;
+	device_t bdev;
+	const struct agp_i810_match *match;
+	u_int8_t smram;
+	int gcc1, deven;
 
 	if (resource_disabled("agp", device_get_unit(dev)))
 		return (ENXIO);
-	desc = agp_i810_match(dev);
-	if (desc) {
-		device_t bdev;
-		u_int8_t smram;
-		unsigned int gcc1;
-		int devid = pci_get_devid(dev);
+	match = agp_i810_match(dev);
+	if (match == NULL)
+		return ENXIO;
+
+	bdev = agp_i810_find_bridge(dev);
+	if (!bdev) {
+		if (bootverbose)
+			printf("I810: can't find bridge device\n");
+		return ENXIO;
+	}
 
-		bdev = agp_i810_find_bridge(dev);
-		if (!bdev) {
+	/*
+	 * checking whether internal graphics device has been activated.
+	 */
+	switch (match->chiptype) {
+	case CHIP_I810:
+		smram = pci_read_config(bdev, AGP_I810_SMRAM, 1);
+		if ((smram & AGP_I810_SMRAM_GMS) ==
+		    AGP_I810_SMRAM_GMS_DISABLED) {
+			if (bootverbose)
+				printf("I810: disabled, not probing\n");
+			return ENXIO;
+		}
+		break;
+	case CHIP_I830:
+	case CHIP_I855:
+		gcc1 = pci_read_config(bdev, AGP_I830_GCC1, 1);
+		if ((gcc1 & AGP_I830_GCC1_DEV2) ==
+		    AGP_I830_GCC1_DEV2_DISABLED) {
+			if (bootverbose)
+				printf("I830: disabled, not probing\n");
+			return ENXIO;
+		}
+		break;
+	case CHIP_I915:
+	case CHIP_I965:
+	case CHIP_G33:
+		deven = pci_read_config(bdev, AGP_I915_DEVEN, 4);
+		if ((deven & AGP_I915_DEVEN_D2F0) ==
+		    AGP_I915_DEVEN_D2F0_DISABLED) {
 			if (bootverbose)
-				printf("I810: can't find bridge device\n");
+				printf("I915: disabled, not probing\n");
 			return ENXIO;
 		}
+		break;
+	}
 
-		/*
-		 * checking whether internal graphics device has been activated.
-		 */
-		switch (devid) {
-			/* i810 */
-		case 0x71218086:
-		case 0x71238086:
-		case 0x71258086:
-		case 0x11328086:
-			smram = pci_read_config(bdev, AGP_I810_SMRAM, 1);
-			if ((smram & AGP_I810_SMRAM_GMS)
-			    == AGP_I810_SMRAM_GMS_DISABLED) {
-				if (bootverbose)
-					printf("I810: disabled, not probing\n");
-				return ENXIO;
-			}
+	if (match->devid == 0x35828086) {
+		switch (pci_read_config(dev, AGP_I85X_CAPID, 1)) {
+		case AGP_I855_GME:
+			device_set_desc(dev,
+			    "Intel 82855GME (855GME GMCH) SVGA controller");
 			break;
-
-			/* i830 */
-		case 0x35778086:
-		case 0x35828086:
-		case 0x25628086:
-		case 0x25728086:
-			gcc1 = pci_read_config(bdev, AGP_I830_GCC1, 1);
-			if ((gcc1 & AGP_I830_GCC1_DEV2) == AGP_I830_GCC1_DEV2_DISABLED) {
-				if (bootverbose)
-					printf("I830: disabled, not probing\n");
-				return ENXIO;
-			}
+		case AGP_I855_GM:
+			device_set_desc(dev,
+			    "Intel 82855GM (855GM GMCH) SVGA controller");
 			break;
-
-			/* i915 */
-		case 0x25828086:
-		case 0x25928086:
-		case 0x27728086:	/* 945G GMCH */
-		case 0x27A28086:	/* 945GM GMCH */
-			gcc1 = pci_read_config(bdev, AGP_I915_DEVEN, 4);
-			if ((gcc1 & AGP_I915_DEVEN_D2F0) ==
-			    AGP_I915_DEVEN_D2F0_DISABLED) {
-				if (bootverbose)
-					printf("I915: disabled, not probing\n");
-				return ENXIO;
-			}
+		case AGP_I852_GME:
+			device_set_desc(dev,
+			    "Intel 82852GME (852GME GMCH) SVGA controller");
+			break;
+		case AGP_I852_GM:
+			device_set_desc(dev,
+			    "Intel 82852GM (852GM GMCH) SVGA controller");
 			break;
-
 		default:
-			return ENXIO;
+			device_set_desc(dev,
+			    "Intel 8285xM (85xGM GMCH) SVGA controller");
+			break;
 		}
-
-		device_verbose(dev);
-		device_set_desc(dev, desc);
-		return BUS_PROBE_DEFAULT;
+	} else {
+		device_set_desc(dev, match->name);
 	}
 
-	return ENXIO;
+	return BUS_PROBE_DEFAULT;
+}
+
+static void
+agp_i810_dump_regs(device_t dev)
+{
+	struct agp_i810_softc *sc = device_get_softc(dev);
+
+	device_printf(dev, "AGP_I810_PGTBL_CTL: %08x\n",
+	    bus_read_4(sc->sc_res[0], AGP_I810_PGTBL_CTL));
+
+	switch (sc->chiptype) {
+	case CHIP_I810:
+		device_printf(dev, "AGP_I810_MISCC: 0x%04x\n",
+		    pci_read_config(sc->bdev, AGP_I810_MISCC, 2));
+		break;
+	case CHIP_I830:
+		device_printf(dev, "AGP_I830_GCC1: 0x%02x\n",
+		    pci_read_config(sc->bdev, AGP_I830_GCC1, 1));
+		break;
+	case CHIP_I855:
+		device_printf(dev, "AGP_I855_GCC1: 0x%02x\n",
+		    pci_read_config(sc->bdev, AGP_I855_GCC1, 1));
+		break;
+	case CHIP_I915:
+	case CHIP_I965:
+	case CHIP_G33:
+		device_printf(dev, "AGP_I855_GCC1: 0x%02x\n",
+		    pci_read_config(sc->bdev, AGP_I855_GCC1, 1));
+		device_printf(dev, "AGP_I915_MSAC: 0x%02x\n",
+		    pci_read_config(sc->bdev, AGP_I915_MSAC, 1));
+		break;
+	}
+	device_printf(dev, "Aperture resource size: %d bytes\n",
+	    AGP_GET_APERTURE(dev));
 }
 
 static int
@@ -284,91 +356,56 @@
 {
 	struct agp_i810_softc *sc = device_get_softc(dev);
 	struct agp_gatt *gatt;
-	int error, rid;
+	const struct agp_i810_match *match;
+	int error;
 
 	sc->bdev = agp_i810_find_bridge(dev);
 	if (!sc->bdev)
 		return ENOENT;
 
+	match = agp_i810_match(dev);
+	sc->chiptype = match->chiptype;
+
+	switch (sc->chiptype) {
+	case CHIP_I810:
+	case CHIP_I830:
+	case CHIP_I855:
+		sc->sc_res_spec = agp_i810_res_spec;
+		agp_set_aperture_resource(dev, AGP_APBASE);
+		break;
+	case CHIP_I915:
+	case CHIP_G33:
+		sc->sc_res_spec = agp_i915_res_spec;
+		agp_set_aperture_resource(dev, AGP_I915_GMADR);
+		break;
+	case CHIP_I965:
+		sc->sc_res_spec = agp_i965_res_spec;
+		agp_set_aperture_resource(dev, AGP_I915_GMADR);
+		break;
+	}
+
 	error = agp_generic_attach(dev);
 	if (error)
 		return error;
 
-	switch (pci_get_devid(dev)) {
-	case 0x71218086:
-	case 0x71238086:
-	case 0x71258086:
-	case 0x11328086:
-		sc->chiptype = CHIP_I810;
-		break;
-	case 0x35778086:
-	case 0x25628086:
-		sc->chiptype = CHIP_I830;
-		break;
-	case 0x35828086:
-	case 0x25728086:
-		sc->chiptype = CHIP_I855;
-		break;
-	case 0x25828086:
-	case 0x25928086:
-	case 0x27728086:	/* 945G GMCH */
-	case 0x27A28086:	/* 945GM GMCH */
-		sc->chiptype = CHIP_I915;
-		break;
-	};
-
-	/* Same for i810 and i830 */
-	if (sc->chiptype == CHIP_I915)
-		rid = AGP_I915_MMADR;
-	else
-		rid = AGP_I810_MMADR;
+	if (sc->chiptype != CHIP_I965 && sc->chiptype != CHIP_G33 &&
+	    ptoa((vm_paddr_t)Maxmem) > 0xfffffffful)
+	{
+		device_printf(dev, "agp_i810.c does not support physical "
+		    "memory above 4GB.\n");
+		return ENOENT;
+	}
 
-	sc->regs = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
-					  RF_ACTIVE);
-	if (!sc->regs) {
+	if (bus_alloc_resources(dev, sc->sc_res_spec, sc->sc_res)) {
 		agp_generic_detach(dev);
 		return ENODEV;
 	}
-	sc->bst = rman_get_bustag(sc->regs);
-	sc->bsh = rman_get_bushandle(sc->regs);
-
-	if (sc->chiptype == CHIP_I915) {
-		rid = AGP_I915_GTTADR;
-		sc->gtt = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
-						 RF_ACTIVE);
-		if (!sc->gtt) {
-			bus_release_resource(dev, SYS_RES_MEMORY,
-					     AGP_I915_MMADR, sc->regs);
-			agp_generic_detach(dev);
-			return ENODEV;
-		}
-		sc->gtt_bst = rman_get_bustag(sc->gtt);
-		sc->gtt_bsh = rman_get_bushandle(sc->gtt);
-
-		/* While agp_generic_attach allocates the AGP_APBASE resource
-		 * to try to reserve the aperture, on the 915 the aperture
-		 * isn't in PCIR_BAR(0), it's in PCIR_BAR(2), so it allocated
-		 * the registers that we just mapped anyway.  So, allocate the
-		 * aperture here, which also gives us easy access to it for the
-		 * agp_i810_get_aperture().
-		 */
-		rid = AGP_I915_GMADR;
-		sc->gm = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, 0);
-		if (sc->gm == NULL) {
-			bus_release_resource(dev, SYS_RES_MEMORY,
-					     AGP_I915_MMADR, sc->regs);
-			bus_release_resource(dev, SYS_RES_MEMORY,
-					     AGP_I915_GTTADR, sc->regs);
-			agp_generic_detach(dev);
-			return ENODEV;
-		}
-
-	}
 
 	sc->initial_aperture = AGP_GET_APERTURE(dev);
 
 	gatt = malloc( sizeof(struct agp_gatt), M_AGP, M_NOWAIT);
 	if (!gatt) {
+		bus_release_resources(dev, sc->sc_res_spec, sc->sc_res);
  		agp_generic_detach(dev);
  		return ENOMEM;
 	}
@@ -378,7 +415,8 @@
 
 	if ( sc->chiptype == CHIP_I810 ) {
 		/* Some i810s have on-chip memory called dcache */
-		if (READ1(AGP_I810_DRT) & AGP_I810_DRT_POPULATED)
+		if (bus_read_1(sc->sc_res[0], AGP_I810_DRT) &
+		    AGP_I810_DRT_POPULATED)
 			sc->dcache_size = 4 * 1024 * 1024;
 		else
 			sc->dcache_size = 0;
@@ -389,6 +427,8 @@
 		if (!gatt->ag_virtual) {
 			if (bootverbose)
 				device_printf(dev, "contiguous allocation failed\n");
+			bus_release_resources(dev, sc->sc_res_spec,
+			    sc->sc_res);
 			free(gatt, M_AGP);
 			agp_generic_detach(dev);
 			return ENOMEM;
@@ -398,7 +438,8 @@
 		gatt->ag_physical = vtophys((vm_offset_t) gatt->ag_virtual);
 		agp_flush_cache();
 		/* Install the GATT. */
-		WRITE4(AGP_I810_PGTBL_CTL, gatt->ag_physical | 1);
+		bus_write_4(sc->sc_res[0], AGP_I810_PGTBL_CTL,
+		    gatt->ag_physical | 1);
 	} else if ( sc->chiptype == CHIP_I830 ) {
 		/* The i830 automatically initializes the 128k gatt on boot. */
 		unsigned int gcc1, pgtblctl;
@@ -417,98 +458,144 @@
 			default:
 				sc->stolen = 0;
 				device_printf(dev, "unknown memory configuration, disabling\n");
+				bus_release_resources(dev, sc->sc_res_spec,
+				    sc->sc_res);
+				free(gatt, M_AGP);
 				agp_generic_detach(dev);
 				return EINVAL;
 		}
-		if (sc->stolen > 0)
-			device_printf(dev, "detected %dk stolen memory\n", sc->stolen * 4);
-		device_printf(dev, "aperture size is %dM\n", sc->initial_aperture / 1024 / 1024);
+		if (sc->stolen > 0) {
+			device_printf(dev, "detected %dk stolen memory\n",
+			    sc->stolen * 4);
+		}
+		device_printf(dev, "aperture size is %dM\n",
+		    sc->initial_aperture / 1024 / 1024);
 
 		/* GATT address is already in there, make sure it's enabled */
-		pgtblctl = READ4(AGP_I810_PGTBL_CTL);
+		pgtblctl = bus_read_4(sc->sc_res[0], AGP_I810_PGTBL_CTL);
 		pgtblctl |= 1;
-		WRITE4(AGP_I810_PGTBL_CTL, pgtblctl);
+		bus_write_4(sc->sc_res[0], AGP_I810_PGTBL_CTL, pgtblctl);
 
 		gatt->ag_physical = pgtblctl & ~1;
-	} else if (sc->chiptype == CHIP_I855 || sc->chiptype == CHIP_I915) {	/* CHIP_I855 */
-		unsigned int gcc1, pgtblctl, stolen;
+	} else if (sc->chiptype == CHIP_I855 || sc->chiptype == CHIP_I915 ||
+	    sc->chiptype == CHIP_I965 || sc->chiptype == CHIP_G33) {
+		unsigned int gcc1, pgtblctl, stolen, gtt_size;
 
 		/* Stolen memory is set up at the beginning of the aperture by
-		 * the BIOS, consisting of the GATT followed by 4kb for the BIOS
-		 * display.
+		 * the BIOS, consisting of the GATT followed by 4kb for the
+		 * BIOS display.
 		 */
-		if (sc->chiptype == CHIP_I855)
-			stolen = 132;
-		else
-			stolen = 260;
-
-		gcc1 = pci_read_config(sc->bdev, AGP_I855_GCC1, 1);
-		switch (gcc1 & AGP_I855_GCC1_GMS) {
-			case AGP_I855_GCC1_GMS_STOLEN_1M:
-				sc->stolen = (1024 - stolen) * 1024 / 4096;
-				break;
-			case AGP_I855_GCC1_GMS_STOLEN_4M: 
-				sc->stolen = (4096 - stolen) * 1024 / 4096;
-				break;
-			case AGP_I855_GCC1_GMS_STOLEN_8M: 
-				sc->stolen = (8192 - stolen) * 1024 / 4096;
-				break;
-			case AGP_I855_GCC1_GMS_STOLEN_16M: 
-				sc->stolen = (16384 - stolen) * 1024 / 4096;
-				break;
-			case AGP_I855_GCC1_GMS_STOLEN_32M: 
-				sc->stolen = (32768 - stolen) * 1024 / 4096;
+		switch (sc->chiptype) {
+		case CHIP_I855:
+			gtt_size = 128;
+			break;
+		case CHIP_I915:
+			gtt_size = 256;
+			break;
+		case CHIP_I965:
+		case CHIP_G33:
+			switch (bus_read_4(sc->sc_res[0], AGP_I810_PGTBL_CTL) &
+			    AGP_I810_PGTBL_SIZE_MASK) {
+			case AGP_I810_PGTBL_SIZE_128KB:
+				gtt_size = 128;
 				break;
-			case AGP_I915_GCC1_GMS_STOLEN_48M: 
-				sc->stolen = (49152 - stolen) * 1024 / 4096;
+			case AGP_I810_PGTBL_SIZE_256KB:
+				gtt_size = 256;
 				break;
-			case AGP_I915_GCC1_GMS_STOLEN_64M: 
-				sc->stolen = (65536 - stolen) * 1024 / 4096;
+			case AGP_I810_PGTBL_SIZE_512KB:
+				gtt_size = 512;
 				break;
 			default:
-				sc->stolen = 0;
-				device_printf(dev, "unknown memory configuration, disabling\n");
+				device_printf(dev, "Bad PGTBL size\n");
+				bus_release_resources(dev, sc->sc_res_spec,
+				    sc->sc_res);
+				free(gatt, M_AGP);
 				agp_generic_detach(dev);
 				return EINVAL;
+			}
+			break;
+		default:
+			device_printf(dev, "Bad chiptype\n");
+			bus_release_resources(dev, sc->sc_res_spec,
+			    sc->sc_res);
+			free(gatt, M_AGP);
+			agp_generic_detach(dev);
+			return EINVAL;
 		}
+
+		/* GCC1 is called MGGC on i915+ */
+		gcc1 = pci_read_config(sc->bdev, AGP_I855_GCC1, 1);
+		switch (gcc1 & AGP_I855_GCC1_GMS) {
+		case AGP_I855_GCC1_GMS_STOLEN_1M:
+			stolen = 1024;
+			break;
+		case AGP_I855_GCC1_GMS_STOLEN_4M:
+			stolen = 4096;
+			break;
+		case AGP_I855_GCC1_GMS_STOLEN_8M:
+			stolen = 8192;
+			break;
+		case AGP_I855_GCC1_GMS_STOLEN_16M:
+			stolen = 16384;
+			break;
+		case AGP_I855_GCC1_GMS_STOLEN_32M:
+			stolen = 32768;
+			break;
+		case AGP_I915_GCC1_GMS_STOLEN_48M:
+			stolen = 49152;
+			break;
+		case AGP_I915_GCC1_GMS_STOLEN_64M:
+			stolen = 65536;
+			break;
+		case AGP_G33_GCC1_GMS_STOLEN_128M:
+			stolen = 128 * 1024;
+			break;
+		case AGP_G33_GCC1_GMS_STOLEN_256M:
+			stolen = 256 * 1024;
+			break;
+		default:
+			device_printf(dev, "unknown memory configuration, "
+			    "disabling\n");
+			bus_release_resources(dev, sc->sc_res_spec,
+			    sc->sc_res);
+			free(gatt, M_AGP);
+			agp_generic_detach(dev);
+			return EINVAL;
+		}
+		sc->stolen = (stolen - gtt_size - 4) * 1024 / 4096;
 		if (sc->stolen > 0)
 			device_printf(dev, "detected %dk stolen memory\n", sc->stolen * 4);
 		device_printf(dev, "aperture size is %dM\n", sc->initial_aperture / 1024 / 1024);
 
 		/* GATT address is already in there, make sure it's enabled */
-		pgtblctl = READ4(AGP_I810_PGTBL_CTL);
+		pgtblctl = bus_read_4(sc->sc_res[0], AGP_I810_PGTBL_CTL);
 		pgtblctl |= 1;
-		WRITE4(AGP_I810_PGTBL_CTL, pgtblctl);
+		bus_write_4(sc->sc_res[0], AGP_I810_PGTBL_CTL, pgtblctl);
 
 		gatt->ag_physical = pgtblctl & ~1;
 	}
 
-	/* Add a device for the drm to attach to */
-	if (!device_add_child( dev, "drmsub", -1 ))
-		printf("out of memory...\n");
+	if (0)
+		agp_i810_dump_regs(dev);
 
-	return bus_generic_attach(dev);
+	return 0;
 }
 
 static int
 agp_i810_detach(device_t dev)
 {
 	struct agp_i810_softc *sc = device_get_softc(dev);
-	int error;
-	device_t child;
 
-	error = agp_generic_detach(dev);
-	if (error)
-		return error;
+	agp_free_cdev(dev);
 
 	/* Clear the GATT base. */
 	if ( sc->chiptype == CHIP_I810 ) {
-		WRITE4(AGP_I810_PGTBL_CTL, 0);
+		bus_write_4(sc->sc_res[0], AGP_I810_PGTBL_CTL, 0);
 	} else {
 		unsigned int pgtblctl;
-		pgtblctl = READ4(AGP_I810_PGTBL_CTL);
+		pgtblctl = bus_read_4(sc->sc_res[0], AGP_I810_PGTBL_CTL);
 		pgtblctl &= ~1;
-		WRITE4(AGP_I810_PGTBL_CTL, pgtblctl);
+		bus_write_4(sc->sc_res[0], AGP_I810_PGTBL_CTL, pgtblctl);
 	}
 
 	/* Put the aperture back the way it started. */
@@ -519,65 +606,26 @@
 	}
 	free(sc->gatt, M_AGP);
 
-	if (sc->chiptype == CHIP_I915) {
-		bus_release_resource(dev, SYS_RES_MEMORY, AGP_I915_GMADR,
-				     sc->gm);
-		bus_release_resource(dev, SYS_RES_MEMORY, AGP_I915_GTTADR,
-				     sc->gtt);
-		bus_release_resource(dev, SYS_RES_MEMORY, AGP_I915_MMADR,
-				     sc->regs);
-	} else {
-		bus_release_resource(dev, SYS_RES_MEMORY, AGP_I810_MMADR,
-				     sc->regs);
-	}
-
-	child = device_find_child( dev, "drmsub", 0 );
-	if (child)
-	   device_delete_child( dev, child );
-
-	return 0;
-}
-
-static u_int32_t
-agp_i810_get_aperture(device_t dev)
-{
-	struct agp_i810_softc *sc = device_get_softc(dev);
-	uint32_t temp;
-	u_int16_t miscc;
-
-	switch (sc->chiptype) {
-	case CHIP_I810:
-		miscc = pci_read_config(sc->bdev, AGP_I810_MISCC, 2);
-		if ((miscc & AGP_I810_MISCC_WINSIZE) == AGP_I810_MISCC_WINSIZE_32)
-			return 32 * 1024 * 1024;
-		else
-			return 64 * 1024 * 1024;
-	case CHIP_I830:
-		temp = pci_read_config(sc->bdev, AGP_I830_GCC1, 2);
-		if ((temp & AGP_I830_GCC1_GMASIZE) == AGP_I830_GCC1_GMASIZE_64)
-			return 64 * 1024 * 1024;
-		else
-			return 128 * 1024 * 1024;
-	case CHIP_I855:
-		return 128 * 1024 * 1024;
-	case CHIP_I915:
-		/* The documentation states that AGP_I915_MSAC should have bit
-		 * 1 set if the aperture is 128MB instead of 256.  However,
-		 * that bit appears to not get set, so we instead use the
-		 * aperture resource size, which should always be correct.
-		 */
-		return rman_get_size(sc->gm);
-	}
+	bus_release_resources(dev, sc->sc_res_spec, sc->sc_res);
+	agp_free_res(dev);
 
 	return 0;
 }
 
+/**
+ * Sets the PCI resource size of the aperture on i830-class and below chipsets,
+ * while returning failure on later chipsets when an actual change is
+ * requested.
+ *
+ * This whole function is likely bogus, as the kernel would probably need to
+ * reconfigure the placement of the AGP aperture if a larger size is requested,
+ * which doesn't happen currently.
+ */
 static int
 agp_i810_set_aperture(device_t dev, u_int32_t aperture)
 {
 	struct agp_i810_softc *sc = device_get_softc(dev);
 	u_int16_t miscc, gcc1;
-	u_int32_t temp;
 
 	switch (sc->chiptype) {
 	case CHIP_I810:
@@ -614,32 +662,55 @@
 		pci_write_config(sc->bdev, AGP_I830_GCC1, gcc1, 2);
 		break;
 	case CHIP_I855:
-		if (aperture != 128 * 1024 * 1024) {
-			device_printf(dev, "bad aperture size %d\n", aperture);
-			return EINVAL;
-		}
-		break;
 	case CHIP_I915:
-		temp = pci_read_config(dev, AGP_I915_MSAC, 1);
-		temp &= ~AGP_I915_MSAC_GMASIZE;
+	case CHIP_I965:
+	case CHIP_G33:
+		return agp_generic_set_aperture(dev, aperture);
+	}
 
-		switch (aperture) {
-		case 128 * 1024 * 1024:
-			temp |= AGP_I915_MSAC_GMASIZE_128;
-			break;
-		case 256 * 1024 * 1024:
-			temp |= AGP_I915_MSAC_GMASIZE_256;
-			break;
-		default:
-			device_printf(dev, "bad aperture size %d\n", aperture);
-			return EINVAL;
-		}
+	return 0;
+}
 
-		pci_write_config(dev, AGP_I915_MSAC, temp, 1);
-		break;
+/**
+ * Writes a GTT entry mapping the page at the given offset from the beginning
+ * of the aperture to the given physical address.
+ */
+static void
+agp_i810_write_gtt_entry(device_t dev, int offset, vm_offset_t physical,
+    int enabled)
+{
+	struct agp_i810_softc *sc = device_get_softc(dev);
+	u_int32_t pte;
+
+	pte = (u_int32_t)physical | 1;
+	if (sc->chiptype == CHIP_I965 || sc->chiptype == CHIP_G33) {
+		pte |= (physical & 0x0000000f00000000ull) >> 28;
+	} else {
+		/* If we do actually have memory above 4GB on an older system,
+		 * crash cleanly rather than scribble on system memory,
+		 * so we know we need to fix it.
+		 */
+		KASSERT((pte & 0x0000000f00000000ull) == 0,
+		    (">4GB physical address in agp"));
 	}
 
-	return 0;
+	switch (sc->chiptype) {
+	case CHIP_I810:
+	case CHIP_I830:
+	case CHIP_I855:
+		bus_write_4(sc->sc_res[0],
+		    AGP_I810_GTT + (offset >> AGP_PAGE_SHIFT) * 4, pte);
+		break;
+	case CHIP_I915:
+	case CHIP_G33:
+		bus_write_4(sc->sc_res[1],
+		    (offset >> AGP_PAGE_SHIFT) * 4, pte);
+		break;
+	case CHIP_I965:
+		bus_write_4(sc->sc_res[0],
+		    (offset >> AGP_PAGE_SHIFT) * 4 + (512 * 1024), pte);
+		break;
+	}
 }
 
 static int
@@ -659,11 +730,7 @@
 		}
 	}
 
-	if (sc->chiptype == CHIP_I915) {
-		WRITEGTT((offset >> AGP_PAGE_SHIFT) * 4, physical | 1);
-	} else {
-		WRITE4(AGP_I810_GTT + (offset >> AGP_PAGE_SHIFT) * 4, physical | 1);
-	}
+	agp_i810_write_gtt_entry(dev, offset, physical, 1);
 
 	return 0;
 }
@@ -683,12 +750,8 @@
 		}
 	}
 
-	if (sc->chiptype == CHIP_I915) {
-		WRITEGTT((offset >> AGP_PAGE_SHIFT) * 4, 0);
-	} else {
-		WRITE4(AGP_I810_GTT + (offset >> AGP_PAGE_SHIFT) * 4, 0);
-	}
-	
+	agp_i810_write_gtt_entry(dev, offset, 0, 0);
+
 	return 0;
 }
 
@@ -729,34 +792,53 @@
 			return 0;
 	} else if (type == 2) {
 		/*
-		 * Bogus mapping of a single page for the hardware cursor.
+		 * Type 2 is the contiguous physical memory type, that hands
+		 * back a physical address.  This is used for cursors on i810.
+		 * Hand back as many single pages with physical as the user
+		 * wants, but only allow one larger allocation (ARGB cursor)
+		 * for simplicity.
 		 */
-		if (size != AGP_PAGE_SIZE)
-			return 0;
+		if (size != AGP_PAGE_SIZE) {
+			if (sc->argb_cursor != NULL)
+				return 0;
+
+			/* Allocate memory for ARGB cursor, if we can. */
+			sc->argb_cursor = contigmalloc(size, M_AGP,
+			   0, 0, ~0, PAGE_SIZE, 0);
+			if (sc->argb_cursor == NULL)
+				return 0;
+		}
 	}
 
 	mem = malloc(sizeof *mem, M_AGP, M_WAITOK);
 	mem->am_id = sc->agp.as_nextid++;
 	mem->am_size = size;
 	mem->am_type = type;
-	if (type != 1)
+	if (type != 1 && (type != 2 || size == AGP_PAGE_SIZE))
 		mem->am_obj = vm_object_allocate(OBJT_DEFAULT,
 						 atop(round_page(size)));
 	else
 		mem->am_obj = 0;
 
 	if (type == 2) {
-		/*
-		 * Allocate and wire down the page now so that we can
-		 * get its physical address.
-		 */
-		vm_page_t m;
-
-		VM_OBJECT_LOCK(mem->am_obj);
-		m = vm_page_grab(mem->am_obj, 0, VM_ALLOC_NOBUSY |
-		    VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_RETRY);
-		VM_OBJECT_UNLOCK(mem->am_obj);
-		mem->am_physical = VM_PAGE_TO_PHYS(m);
+		if (size == AGP_PAGE_SIZE) {
+			/*
+			 * Allocate and wire down the page now so that we can
+			 * get its physical address.
+			 */
+			vm_page_t m;
+	
+			VM_OBJECT_LOCK(mem->am_obj);
+			m = vm_page_grab(mem->am_obj, 0, VM_ALLOC_NOBUSY |
+			    VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_RETRY);
+			VM_OBJECT_UNLOCK(mem->am_obj);
+			mem->am_physical = VM_PAGE_TO_PHYS(m);
+		} else {
+			/* Our allocation is already nicely wired down for us.
+			 * Just grab the physical address.
+			 */
+			mem->am_physical = vtophys(sc->argb_cursor);
+		}
 	} else {
 		mem->am_physical = 0;
 	}
@@ -778,17 +860,22 @@
 		return EBUSY;
 
 	if (mem->am_type == 2) {
-		/*
-		 * Unwire the page which we wired in alloc_memory.
-		 */
-		vm_page_t m;
-
-		VM_OBJECT_LOCK(mem->am_obj);
-		m = vm_page_lookup(mem->am_obj, 0);
-		VM_OBJECT_UNLOCK(mem->am_obj);
-		vm_page_lock_queues();
-		vm_page_unwire(m, 0);
-		vm_page_unlock_queues();
+		if (mem->am_size == AGP_PAGE_SIZE) {
+			/*
+			 * Unwire the page which we wired in alloc_memory.
+			 */
+			vm_page_t m;
+	
+			VM_OBJECT_LOCK(mem->am_obj);
+			m = vm_page_lookup(mem->am_obj, 0);
+			VM_OBJECT_UNLOCK(mem->am_obj);
+			vm_page_lock_queues();
+			vm_page_unwire(m, 0);
+			vm_page_unlock_queues();
+		} else {
+			contigfree(sc->argb_cursor, mem->am_size, M_AGP);
+			sc->argb_cursor = NULL;
+		}
 	}
 
 	sc->agp.as_allocated -= mem->am_size;
@@ -806,6 +893,32 @@
 	struct agp_i810_softc *sc = device_get_softc(dev);
 	vm_offset_t i;
 
+	/* Do some sanity checks first. */
+	if (offset < 0 || (offset & (AGP_PAGE_SIZE - 1)) != 0 ||
+	    offset + mem->am_size > AGP_GET_APERTURE(dev)) {
+		device_printf(dev, "binding memory at bad offset %#x\n",
+		    (int)offset);
+		return EINVAL;
+	}
+
+	if (mem->am_type == 2 && mem->am_size != AGP_PAGE_SIZE) {
+		mtx_lock(&sc->agp.as_lock);
+		if (mem->am_is_bound) {
+			mtx_unlock(&sc->agp.as_lock);
+			return EINVAL;
+		}
+		/* The memory's already wired down, just stick it in the GTT. */
+		for (i = 0; i < mem->am_size; i += AGP_PAGE_SIZE) {
+			agp_i810_write_gtt_entry(dev, offset + i,
+			    mem->am_physical + i, 1);
+		}
+		agp_flush_cache();
+		mem->am_offset = offset;
+		mem->am_is_bound = 1;
+		mtx_unlock(&sc->agp.as_lock);
+		return 0;
+	}
+
 	if (mem->am_type != 1)
 		return agp_generic_bind_memory(dev, mem, offset);
 
@@ -813,8 +926,8 @@
 		return EINVAL;
 
 	for (i = 0; i < mem->am_size; i += AGP_PAGE_SIZE) {
-		WRITE4(AGP_I810_GTT + (offset >> AGP_PAGE_SHIFT) * 4,
-		       i | 3);
+		bus_write_4(sc->sc_res[0],
+		    AGP_I810_GTT + (i >> AGP_PAGE_SHIFT) * 4, i | 3);
 	}
 
 	return 0;
@@ -826,41 +939,46 @@
 	struct agp_i810_softc *sc = device_get_softc(dev);
 	vm_offset_t i;
 
+	if (mem->am_type == 2 && mem->am_size != AGP_PAGE_SIZE) {
+		mtx_lock(&sc->agp.as_lock);
+		if (!mem->am_is_bound) {
+			mtx_unlock(&sc->agp.as_lock);
+			return EINVAL;
+		}
+
+		for (i = 0; i < mem->am_size; i += AGP_PAGE_SIZE) {
+			agp_i810_write_gtt_entry(dev, mem->am_offset + i,
+			    0, 0);
+		}
+		agp_flush_cache();
+		mem->am_is_bound = 0;
+		mtx_unlock(&sc->agp.as_lock);
+		return 0;
+	}
+
 	if (mem->am_type != 1)
 		return agp_generic_unbind_memory(dev, mem);
 
 	if ( sc->chiptype != CHIP_I810 )
 		return EINVAL;
 
-	for (i = 0; i < mem->am_size; i += AGP_PAGE_SIZE)
-		WRITE4(AGP_I810_GTT + (i >> AGP_PAGE_SHIFT) * 4, 0);
+	for (i = 0; i < mem->am_size; i += AGP_PAGE_SIZE) {
+		bus_write_4(sc->sc_res[0],
+		    AGP_I810_GTT + (i >> AGP_PAGE_SHIFT) * 4, 0);
+	}
 
 	return 0;
 }
 
-static int
-agp_i810_print_child(device_t dev, device_t child)
-{
-	int retval = 0;
-
-	retval += bus_print_child_header(dev, child);
-	retval += printf(": (child of agp_i810.c)");
-	retval += bus_print_child_footer(dev, child);
-
-	return retval;
-}
-
 static device_method_t agp_i810_methods[] = {
 	/* Device interface */
+	DEVMETHOD(device_identify,	agp_i810_identify),
 	DEVMETHOD(device_probe,		agp_i810_probe),
 	DEVMETHOD(device_attach,	agp_i810_attach),
 	DEVMETHOD(device_detach,	agp_i810_detach),
-	DEVMETHOD(device_shutdown,	bus_generic_shutdown),
-	DEVMETHOD(device_suspend,	bus_generic_suspend),
-	DEVMETHOD(device_resume,	bus_generic_resume),
 
 	/* AGP interface */
-	DEVMETHOD(agp_get_aperture,	agp_i810_get_aperture),
+	DEVMETHOD(agp_get_aperture,	agp_generic_get_aperture),
 	DEVMETHOD(agp_set_aperture,	agp_i810_set_aperture),
 	DEVMETHOD(agp_bind_page,	agp_i810_bind_page),
 	DEVMETHOD(agp_unbind_page,	agp_i810_unbind_page),
@@ -871,14 +989,6 @@
 	DEVMETHOD(agp_bind_memory,	agp_i810_bind_memory),
 	DEVMETHOD(agp_unbind_memory,	agp_i810_unbind_memory),
 
-	/* bus methods */
-	DEVMETHOD(bus_print_child,	agp_i810_print_child),
-	DEVMETHOD(bus_alloc_resource,	bus_generic_alloc_resource),
-	DEVMETHOD(bus_release_resource,	bus_generic_release_resource),
-	DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
-	DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
-	DEVMETHOD(bus_setup_intr,	bus_generic_setup_intr),
-	DEVMETHOD(bus_teardown_intr,	bus_generic_teardown_intr),
 	{ 0, 0 }
 };
 
@@ -890,6 +1000,6 @@
 
 static devclass_t agp_devclass;
 
-DRIVER_MODULE(agp_i810, pci, agp_i810_driver, agp_devclass, 0, 0);
+DRIVER_MODULE(agp_i810, vgapci, agp_i810_driver, agp_devclass, 0, 0);
 MODULE_DEPEND(agp_i810, agp, 1, 1, 1);
 MODULE_DEPEND(agp_i810, pci, 1, 1, 1);


More information about the Midnightbsd-cvs mailing list