Home | History | Annotate | Line # | Download | only in dev
if_ie_obio.c revision 1.8
      1  1.8  pk /*	$NetBSD: if_ie_obio.c,v 1.8 1998/08/23 10:04:56 pk Exp $	*/
      2  1.1  pk 
      3  1.1  pk /*-
      4  1.1  pk  * Copyright (c) 1997 The NetBSD Foundation, Inc.
      5  1.1  pk  * All rights reserved.
      6  1.1  pk  *
      7  1.1  pk  * This code is derived from software contributed to The NetBSD Foundation
      8  1.1  pk  * by Paul Kranenburg.
      9  1.1  pk  *
     10  1.1  pk  * Redistribution and use in source and binary forms, with or without
     11  1.1  pk  * modification, are permitted provided that the following conditions
     12  1.1  pk  * are met:
     13  1.1  pk  * 1. Redistributions of source code must retain the above copyright
     14  1.1  pk  *    notice, this list of conditions and the following disclaimer.
     15  1.1  pk  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.1  pk  *    notice, this list of conditions and the following disclaimer in the
     17  1.1  pk  *    documentation and/or other materials provided with the distribution.
     18  1.1  pk  * 3. All advertising materials mentioning features or use of this software
     19  1.1  pk  *    must display the following acknowledgement:
     20  1.1  pk  *        This product includes software developed by the NetBSD
     21  1.1  pk  *        Foundation, Inc. and its contributors.
     22  1.1  pk  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  1.1  pk  *    contributors may be used to endorse or promote products derived
     24  1.1  pk  *    from this software without specific prior written permission.
     25  1.1  pk  *
     26  1.1  pk  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  1.1  pk  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  1.1  pk  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  1.1  pk  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  1.1  pk  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  1.1  pk  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  1.1  pk  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  1.1  pk  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  1.1  pk  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  1.1  pk  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  1.1  pk  * POSSIBILITY OF SUCH DAMAGE.
     37  1.1  pk  */
     38  1.1  pk 
     39  1.1  pk /*-
     40  1.1  pk  * Copyright (c) 1995 Charles D. Cranor
     41  1.1  pk  * All rights reserved.
     42  1.1  pk  *
     43  1.1  pk  * Redistribution and use in source and binary forms, with or without
     44  1.1  pk  * modification, are permitted provided that the following conditions
     45  1.1  pk  * are met:
     46  1.1  pk  * 1. Redistributions of source code must retain the above copyright
     47  1.1  pk  *    notice, this list of conditions and the following disclaimer.
     48  1.1  pk  * 2. Redistributions in binary form must reproduce the above copyright
     49  1.1  pk  *    notice, this list of conditions and the following disclaimer in the
     50  1.1  pk  *    documentation and/or other materials provided with the distribution.
     51  1.1  pk  * 3. All advertising materials mentioning features or use of this software
     52  1.1  pk  *    must display the following acknowledgement:
     53  1.1  pk  *      This product includes software developed by Charles D. Cranor.
     54  1.1  pk  * 4. The name of the author may not be used to endorse or promote products
     55  1.1  pk  *    derived from this software without specific prior written permission.
     56  1.1  pk  *
     57  1.1  pk  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     58  1.1  pk  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     59  1.1  pk  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     60  1.1  pk  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     61  1.1  pk  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     62  1.1  pk  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     63  1.1  pk  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     64  1.1  pk  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     65  1.1  pk  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     66  1.1  pk  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     67  1.1  pk  */
     68  1.1  pk 
     69  1.1  pk 
     70  1.1  pk 
     71  1.1  pk /*
     72  1.1  pk  * Sparc OBIO front-end for the Intel 82586 Ethernet driver
     73  1.1  pk  *
     74  1.1  pk  * Converted to SUN ie driver by Charles D. Cranor,
     75  1.1  pk  *		October 1994, January 1995.
     76  1.1  pk  */
     77  1.1  pk 
     78  1.1  pk /*
     79  1.1  pk  * The i82586 is a very painful chip, found in sun3's, sun-4/100's
     80  1.1  pk  * sun-4/200's, and VME based suns.  The byte order is all wrong for a
     81  1.1  pk  * SUN, making life difficult.  Programming this chip is mostly the same,
     82  1.1  pk  * but certain details differ from system to system.  This driver is
     83  1.1  pk  * written so that different "ie" interfaces can be controled by the same
     84  1.1  pk  * driver.
     85  1.1  pk  */
     86  1.1  pk 
     87  1.1  pk #include <sys/param.h>
     88  1.1  pk #include <sys/systm.h>
     89  1.1  pk #include <sys/errno.h>
     90  1.1  pk #include <sys/device.h>
     91  1.1  pk #include <sys/malloc.h>
     92  1.1  pk #include <sys/protosw.h>
     93  1.1  pk #include <sys/socket.h>
     94  1.1  pk 
     95  1.1  pk #include <net/if.h>
     96  1.1  pk #include <net/if_types.h>
     97  1.1  pk #include <net/if_dl.h>
     98  1.1  pk #include <net/if_media.h>
     99  1.1  pk #include <net/if_ether.h>
    100  1.1  pk 
    101  1.1  pk #include <vm/vm.h>
    102  1.1  pk 
    103  1.1  pk #include <machine/autoconf.h>
    104  1.1  pk #include <machine/cpu.h>
    105  1.1  pk #include <machine/pmap.h>
    106  1.1  pk #include <machine/bus.h>
    107  1.1  pk 
    108  1.1  pk #include <dev/ic/i82586reg.h>
    109  1.1  pk #include <dev/ic/i82586var.h>
    110  1.1  pk 
    111  1.1  pk /*
    112  1.1  pk  * the on-board interface
    113  1.1  pk  */
    114  1.1  pk struct ieob {
    115  1.1  pk 	u_char  obctrl;
    116  1.1  pk };
    117  1.1  pk #define IEOB_NORSET 0x80	/* don't reset the board */
    118  1.1  pk #define IEOB_ONAIR  0x40	/* put us on the air */
    119  1.1  pk #define IEOB_ATTEN  0x20	/* attention! */
    120  1.1  pk #define IEOB_IENAB  0x10	/* interrupt enable */
    121  1.1  pk #define IEOB_XXXXX  0x08	/* free bit */
    122  1.1  pk #define IEOB_XCVRL2 0x04	/* level 2 transceiver? */
    123  1.1  pk #define IEOB_BUSERR 0x02	/* bus error */
    124  1.1  pk #define IEOB_INT    0x01	/* interrupt */
    125  1.1  pk 
    126  1.1  pk #define IEOB_ADBASE 0xff000000  /* KVA base addr of 24 bit address space */
    127  1.1  pk 
    128  1.1  pk 
    129  1.1  pk static void ie_obreset __P((struct ie_softc *, int));
    130  1.1  pk static void ie_obattend __P((struct ie_softc *));
    131  1.1  pk static void ie_obrun __P((struct ie_softc *));
    132  1.1  pk 
    133  1.1  pk int ie_obio_match __P((struct device *, struct cfdata *, void *));
    134  1.1  pk void ie_obio_attach __P((struct device *, struct device *, void *));
    135  1.1  pk 
    136  1.1  pk struct cfattach ie_obio_ca = {
    137  1.1  pk 	sizeof(struct ie_softc), ie_obio_match, ie_obio_attach
    138  1.1  pk };
    139  1.1  pk 
    140  1.1  pk /* Supported media */
    141  1.1  pk static int media[] = {
    142  1.1  pk 	IFM_ETHER | IFM_10_2,
    143  1.1  pk };
    144  1.1  pk #define NMEDIA	(sizeof(media) / sizeof(media[0]))
    145  1.1  pk 
    146  1.1  pk 
    147  1.1  pk /*
    148  1.1  pk  * OBIO ie support routines
    149  1.1  pk  */
    150  1.1  pk void
    151  1.1  pk ie_obreset(sc, what)
    152  1.1  pk 	struct ie_softc *sc;
    153  1.1  pk {
    154  1.1  pk 	volatile struct ieob *ieo = (struct ieob *) sc->sc_reg;
    155  1.1  pk 	ieo->obctrl = 0;
    156  1.1  pk 	delay(100);			/* XXX could be shorter? */
    157  1.1  pk 	ieo->obctrl = IEOB_NORSET;
    158  1.1  pk }
    159  1.1  pk void
    160  1.1  pk ie_obattend(sc)
    161  1.1  pk 	struct ie_softc *sc;
    162  1.1  pk {
    163  1.1  pk 	volatile struct ieob *ieo = (struct ieob *) sc->sc_reg;
    164  1.1  pk 
    165  1.1  pk 	ieo->obctrl |= IEOB_ATTEN;	/* flag! */
    166  1.1  pk 	ieo->obctrl &= ~IEOB_ATTEN;	/* down. */
    167  1.1  pk }
    168  1.1  pk 
    169  1.1  pk void
    170  1.1  pk ie_obrun(sc)
    171  1.1  pk 	struct ie_softc *sc;
    172  1.1  pk {
    173  1.1  pk 	volatile struct ieob *ieo = (struct ieob *) sc->sc_reg;
    174  1.1  pk 
    175  1.1  pk 	ieo->obctrl |= (IEOB_ONAIR|IEOB_IENAB|IEOB_NORSET);
    176  1.1  pk }
    177  1.1  pk 
    178  1.1  pk void ie_obio_memcopyin __P((struct ie_softc *, void *, int, size_t));
    179  1.1  pk void ie_obio_memcopyout __P((struct ie_softc *, const void *, int, size_t));
    180  1.1  pk 
    181  1.1  pk /*
    182  1.1  pk  * Copy board memory to kernel.
    183  1.1  pk  */
    184  1.1  pk void
    185  1.1  pk ie_obio_memcopyin(sc, p, offset, size)
    186  1.1  pk 	struct ie_softc	*sc;
    187  1.1  pk 	void *p;
    188  1.1  pk 	int offset;
    189  1.1  pk 	size_t size;
    190  1.1  pk {
    191  1.1  pk 	void *addr = (void *)((u_long)sc->bh + offset);/*XXX - not MI!*/
    192  1.1  pk 	wcopy(addr, p, size);
    193  1.1  pk }
    194  1.1  pk 
    195  1.1  pk /*
    196  1.1  pk  * Copy from kernel space to naord memory.
    197  1.1  pk  */
    198  1.1  pk void
    199  1.1  pk ie_obio_memcopyout(sc, p, offset, size)
    200  1.1  pk 	struct ie_softc	*sc;
    201  1.1  pk 	const void *p;
    202  1.1  pk 	int offset;
    203  1.1  pk 	size_t size;
    204  1.1  pk {
    205  1.1  pk 	void *addr = (void *)((u_long)sc->bh + offset);/*XXX - not MI!*/
    206  1.1  pk 	wcopy(p, addr, size);
    207  1.1  pk }
    208  1.1  pk 
    209  1.1  pk /* read a 16-bit value at BH offset */
    210  1.1  pk u_int16_t ie_obio_read16 __P((struct ie_softc *, int offset));
    211  1.1  pk /* write a 16-bit value at BH offset */
    212  1.1  pk void ie_obio_write16 __P((struct ie_softc *, int offset, u_int16_t value));
    213  1.1  pk void ie_obio_write24 __P((struct ie_softc *, int offset, int addr));
    214  1.1  pk 
    215  1.1  pk u_int16_t
    216  1.1  pk ie_obio_read16(sc, offset)
    217  1.1  pk 	struct ie_softc *sc;
    218  1.1  pk 	int offset;
    219  1.1  pk {
    220  1.1  pk 	u_int16_t v = bus_space_read_2(sc->bt, sc->bh, offset);
    221  1.1  pk 	return (((v&0xff)<<8) | ((v>>8)&0xff));
    222  1.1  pk }
    223  1.1  pk 
    224  1.1  pk void
    225  1.1  pk ie_obio_write16(sc, offset, v)
    226  1.1  pk 	struct ie_softc *sc;
    227  1.1  pk 	int offset;
    228  1.1  pk 	u_int16_t v;
    229  1.1  pk {
    230  1.1  pk 	v = (((v&0xff)<<8) | ((v>>8)&0xff));
    231  1.1  pk 	bus_space_write_2(sc->bt, sc->bh, offset, v);
    232  1.1  pk }
    233  1.1  pk 
    234  1.1  pk void
    235  1.1  pk ie_obio_write24(sc, offset, addr)
    236  1.1  pk 	struct ie_softc *sc;
    237  1.1  pk 	int offset;
    238  1.1  pk 	int addr;
    239  1.1  pk {
    240  1.1  pk 	u_int32_t v;
    241  1.1  pk 	u_char *t = (u_char *)&v, *f = (u_char *)&addr;
    242  1.1  pk 
    243  1.1  pk 	t[0] = f[3]; t[1] = f[2]; t[2] = f[1]; t[3] = 0;
    244  1.1  pk 	bus_space_write_4(sc->bt, sc->bh, offset, v);
    245  1.1  pk }
    246  1.1  pk 
    247  1.1  pk int
    248  1.1  pk ie_obio_match(parent, cf, aux)
    249  1.1  pk 	struct device *parent;
    250  1.1  pk 	struct cfdata *cf;
    251  1.1  pk 	void *aux;
    252  1.1  pk {
    253  1.4  pk 	union obio_attach_args *uoba = aux;
    254  1.4  pk 	struct obio4_attach_args *oba;
    255  1.1  pk 
    256  1.4  pk 	if (uoba->uoba_isobio4 == 0)
    257  1.1  pk 		return (0);
    258  1.1  pk 
    259  1.4  pk 	oba = &uoba->uoba_oba4;
    260  1.6  pk 	return (bus_space_probe(oba->oba_bustag, 0, oba->oba_paddr,
    261  1.6  pk 				1,	/* probe size */
    262  1.6  pk 				0,	/* offset */
    263  1.6  pk 				0,	/* flags */
    264  1.6  pk 				NULL, NULL));
    265  1.1  pk }
    266  1.1  pk 
    267  1.1  pk void
    268  1.1  pk ie_obio_attach(parent, self, aux)
    269  1.1  pk 	struct device *parent;
    270  1.1  pk 	struct device *self;
    271  1.1  pk 	void   *aux;
    272  1.1  pk {
    273  1.4  pk 	union obio_attach_args *uoba = aux;
    274  1.4  pk 	struct obio4_attach_args *oba = &uoba->uoba_oba4;
    275  1.1  pk 	struct ie_softc *sc = (void *) self;
    276  1.4  pk 	bus_space_handle_t bh;
    277  1.8  pk 	bus_dma_segment_t seg;
    278  1.8  pk 	int rseg;
    279  1.4  pk 	struct bootpath *bp;
    280  1.1  pk 	volatile struct ieob *ieo;
    281  1.7  pk 	paddr_t pa;
    282  1.4  pk 	struct intrhand *ih;
    283  1.4  pk 	u_int8_t myaddr[ETHER_ADDR_LEN];
    284  1.4  pk extern	void myetheraddr(u_char *);	/* should be elsewhere */
    285  1.1  pk 
    286  1.8  pk 	sc->bt = oba->oba_bustag;
    287  1.1  pk 
    288  1.1  pk 	sc->hwreset = ie_obreset;
    289  1.1  pk 	sc->chan_attn = ie_obattend;
    290  1.1  pk 	sc->hwinit = ie_obrun;
    291  1.1  pk 	sc->memcopyout = ie_obio_memcopyout;
    292  1.1  pk 	sc->memcopyin = ie_obio_memcopyin;
    293  1.1  pk 	sc->ie_bus_read16 = ie_obio_read16;
    294  1.1  pk 	sc->ie_bus_write16 = ie_obio_write16;
    295  1.1  pk 	sc->ie_bus_write24 = ie_obio_write24;
    296  1.1  pk 	sc->sc_msize = 65536; /* XXX */
    297  1.1  pk 
    298  1.4  pk 	if (obio_bus_map(oba->oba_bustag, oba->oba_paddr,
    299  1.4  pk 			 0,
    300  1.4  pk 			 sizeof(struct ieob),
    301  1.4  pk 			 BUS_SPACE_MAP_LINEAR,
    302  1.4  pk 			 0, &bh) != 0) {
    303  1.4  pk 		printf("%s: cannot map registers\n", self->dv_xname);
    304  1.4  pk 		return;
    305  1.4  pk 	}
    306  1.4  pk 	sc->sc_reg = (void *)bh;
    307  1.4  pk 	ieo = (volatile struct ieob *)bh;
    308  1.1  pk 
    309  1.1  pk 	/*
    310  1.8  pk 	 * Allocate control & buffer memory.
    311  1.1  pk 	 */
    312  1.8  pk 	if (bus_dmamem_alloc(oba->oba_dmatag, sc->sc_msize, 64*1024, 0,
    313  1.8  pk 			     &seg, 1, &rseg,
    314  1.8  pk 			     BUS_DMA_NOWAIT | BUS_DMA_24BIT) != 0) {
    315  1.8  pk 		printf("%s @ obio: DMA memory allocation error\n",
    316  1.8  pk 			self->dv_xname);
    317  1.8  pk 		return;
    318  1.8  pk 	}
    319  1.8  pk 	if (bus_dmamem_map(oba->oba_dmatag, &seg, rseg, sc->sc_msize,
    320  1.8  pk 			   (caddr_t *)&sc->sc_maddr,
    321  1.8  pk 			   BUS_DMA_NOWAIT|BUS_DMA_COHERENT) != 0) {
    322  1.8  pk 		printf("%s @ obio: DMA memory map error\n", self->dv_xname);
    323  1.8  pk 		bus_dmamem_free(oba->oba_dmatag, &seg, rseg);
    324  1.8  pk 		return;
    325  1.8  pk 	}
    326  1.1  pk 
    327  1.8  pk 	wzero(sc->sc_maddr, sc->sc_msize);
    328  1.1  pk 	sc->bh = (bus_space_handle_t)(sc->sc_maddr);
    329  1.1  pk 
    330  1.8  pk #if 0
    331  1.1  pk 	sc->sc_iobase = (caddr_t)IEOB_ADBASE; /* 24 bit base addr */
    332  1.8  pk #endif
    333  1.1  pk 
    334  1.1  pk 	/*
    335  1.5  pk 	 * The i82586's 24-bit address space maps to the last 16MB of
    336  1.5  pk 	 * KVA space ().  In addition, the SCP must appear
    337  1.5  pk 	 * at IE_SCP_ADDR within the 24-bit address space,
    338  1.5  pk 	 * i.e. at KVA  IEOB_ADBASE+IE_SCP_ADDR, at the very top of
    339  1.5  pk 	 * kernel space.  We double-map this last page to the first
    340  1.5  pk 	 * page (starting at `maddr') of the memory we allocate to the chip.
    341  1.5  pk 	 * (a side-effect of this double-map is that the ISCP and SCB
    342  1.5  pk 	 * structures also get aliased there, but we ignore this). The
    343  1.5  pk 	 * first page at `maddr' is only used for ISCP, SCB and the aliased
    344  1.5  pk 	 * SCP; the actual buffers start at maddr+NBPG.
    345  1.5  pk 	 *
    346  1.5  pk 	 * In a picture:
    347  1.1  pk 
    348  1.4  pk 	|---//--- ISCP-SCB-----scp-|--//- buffers -//-|... |iscp-scb-----SCP-|
    349  1.5  pk 	|         |                |                  |    |             |   |
    350  1.5  pk 	|         |<----- NBPG --->|                  |    |<----- NBPG -+-->|
    351  1.5  pk 	|         |<------------- msize ------------->|    |       ^     |
    352  1.5  pk 	|         |                                                |     |
    353  1.4  pk 	|         \@maddr                                 (last page dbl mapped)
    354  1.5  pk 	|                                                                |
    355  1.5  pk 	\@IEOB_ADBASE                           @IEOB_ADBASE+IE_SCP_ADDR-+
    356  1.5  pk 
    357  1.5  pk 	 *
    358  1.5  pk 	 */
    359  1.4  pk 
    360  1.8  pk 	/* Double map the SCP */
    361  1.7  pk 	pa = pmap_extract(pmap_kernel(), (vaddr_t)sc->sc_maddr);
    362  1.1  pk 	if (pa == 0)
    363  1.1  pk 		panic("ie pmap_extract");
    364  1.1  pk 
    365  1.1  pk 	pmap_enter(pmap_kernel(), trunc_page(IEOB_ADBASE+IE_SCP_ADDR),
    366  1.7  pk 		   pa | PMAP_NC /*| PMAP_IOC*/,
    367  1.4  pk 		   VM_PROT_READ | VM_PROT_WRITE, 1);
    368  1.1  pk 
    369  1.8  pk 	/* Map iscp at location 0 (relative to `maddr') */
    370  1.5  pk 	sc->iscp = 0;
    371  1.5  pk 
    372  1.5  pk 	/* scb follows iscp */
    373  1.5  pk 	sc->scb = IE_ISCP_SZ;
    374  1.5  pk 
    375  1.8  pk 	/* scp is at the fixed location IE_SCP_ADDR (relative to IEOB_ADBASE) */
    376  1.8  pk 	sc->scp = IE_SCP_ADDR + IEOB_ADBASE - (u_long)sc->sc_maddr;
    377  1.5  pk 
    378  1.8  pk 	ie_obio_write16(sc, IE_ISCP_SCB(sc->iscp), sc->scb);
    379  1.8  pk 	ie_obio_write24(sc, IE_ISCP_BASE(sc->iscp), (u_long)sc->sc_maddr);
    380  1.8  pk 	ie_obio_write24(sc, IE_SCP_ISCP(sc->scp),
    381  1.8  pk 			(u_long)sc->sc_maddr - (u_long)IEOB_ADBASE + sc->iscp);
    382  1.5  pk 
    383  1.1  pk 
    384  1.1  pk 	/*
    385  1.1  pk 	 * Rest of first page is unused (wasted!); rest of ram
    386  1.1  pk 	 * for buffers.
    387  1.1  pk 	 */
    388  1.1  pk 	sc->buf_area = NBPG;
    389  1.1  pk 	sc->buf_area_sz = sc->sc_msize - NBPG;
    390  1.1  pk 
    391  1.1  pk 	myetheraddr(myaddr);
    392  1.1  pk 	i82586_attach(sc, "onboard", myaddr, media, NMEDIA, media[0]);
    393  1.1  pk 
    394  1.4  pk 	/* Establish interrupt channel */
    395  1.4  pk 	ih = bus_intr_establish(oba->oba_bustag,
    396  1.4  pk 				oba->oba_pri, 0,
    397  1.4  pk 				i82586_intr, sc);
    398  1.1  pk 
    399  1.4  pk 	bp = oba->oba_bp;
    400  1.1  pk 	if (bp != NULL && strcmp(bp->name, "ie") == 0 &&
    401  1.1  pk 	    sc->sc_dev.dv_unit == bp->val[1])
    402  1.1  pk 		bp->dev = &sc->sc_dev;
    403  1.1  pk }
    404