Home | History | Annotate | Line # | Download | only in podulebus
if_ei.c revision 1.4.10.1
      1  1.4.10.1   tron /* $NetBSD: if_ei.c,v 1.4.10.1 2002/11/01 11:13:37 tron Exp $ */
      2       1.1  bjh21 
      3       1.1  bjh21 /*-
      4       1.1  bjh21  * Copyright (c) 2000, 2001 Ben Harris
      5       1.1  bjh21  * All rights reserved.
      6       1.1  bjh21  *
      7       1.1  bjh21  * Redistribution and use in source and binary forms, with or without
      8       1.1  bjh21  * modification, are permitted provided that the following conditions
      9       1.1  bjh21  * are met:
     10       1.1  bjh21  * 1. Redistributions of source code must retain the above copyright
     11       1.1  bjh21  *    notice, this list of conditions and the following disclaimer.
     12       1.1  bjh21  * 2. Redistributions in binary form must reproduce the above copyright
     13       1.1  bjh21  *    notice, this list of conditions and the following disclaimer in the
     14       1.1  bjh21  *    documentation and/or other materials provided with the distribution.
     15       1.1  bjh21  * 3. The name of the author may not be used to endorse or promote products
     16       1.1  bjh21  *    derived from this software without specific prior written permission.
     17       1.1  bjh21  *
     18       1.1  bjh21  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     19       1.1  bjh21  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     20       1.1  bjh21  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     21       1.1  bjh21  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     22       1.1  bjh21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     23       1.1  bjh21  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     24       1.1  bjh21  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     25       1.1  bjh21  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     26       1.1  bjh21  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     27       1.1  bjh21  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     28       1.1  bjh21  */
     29       1.1  bjh21 /*
     30       1.1  bjh21  * if_ei.c -- driver for Acorn AKA25 Ether1 card
     31       1.1  bjh21  */
     32       1.1  bjh21 /*
     33       1.1  bjh21  * This is not directly based on the arm32 ie driver, as that doesn't
     34       1.1  bjh21  * use the MI 82586 driver, and generally looks a mess (not to mention
     35       1.1  bjh21  * having dodgy copyright status).  Let's try again.
     36       1.1  bjh21  */
     37       1.1  bjh21 
     38       1.2  lukem #include <sys/cdefs.h>
     39  1.4.10.1   tron __KERNEL_RCSID(0, "$NetBSD: if_ei.c,v 1.4.10.1 2002/11/01 11:13:37 tron Exp $");
     40       1.2  lukem 
     41       1.1  bjh21 #include <sys/param.h>
     42       1.1  bjh21 
     43       1.1  bjh21 #include <sys/device.h>
     44       1.1  bjh21 #include <sys/malloc.h>
     45       1.1  bjh21 #include <sys/reboot.h>	/* For bootverbose */
     46       1.1  bjh21 #include <sys/socket.h>
     47       1.1  bjh21 #include <sys/syslog.h>
     48       1.1  bjh21 #include <sys/systm.h>
     49       1.1  bjh21 #include <net/if.h>
     50       1.1  bjh21 #include <net/if_ether.h>
     51       1.1  bjh21 #include <net/if_media.h>
     52       1.1  bjh21 #include <machine/bus.h>
     53       1.1  bjh21 #include <dev/ic/i82586reg.h>
     54       1.1  bjh21 #include <dev/ic/i82586var.h>
     55       1.1  bjh21 #include <dev/podulebus/podulebus.h>
     56       1.1  bjh21 #include <dev/podulebus/podules.h>
     57       1.1  bjh21 #include <dev/podulebus/if_eireg.h>
     58       1.1  bjh21 
     59       1.1  bjh21 /* Callbacks from the MI 82586 driver */
     60       1.1  bjh21 static void ei_hwreset(struct ie_softc *, int);
     61       1.1  bjh21 /* static void ei_hwinit(struct ie_softc *); */
     62       1.1  bjh21 static void ei_attn(struct ie_softc *, int);
     63       1.1  bjh21 static int ei_intrhook(struct ie_softc *, int);
     64       1.1  bjh21 
     65       1.1  bjh21 static void ei_copyin(struct ie_softc *, void *, int, size_t);
     66       1.1  bjh21 static void ei_copyout(struct ie_softc *, const void *, int, size_t);
     67       1.1  bjh21 static u_int16_t ei_read16(struct ie_softc *, int);
     68       1.1  bjh21 static void ei_write16(struct ie_softc *, int, u_int16_t);
     69       1.1  bjh21 static void ei_write24(struct ie_softc *, int, int);
     70       1.1  bjh21 
     71       1.1  bjh21 /* autoconfiguration glue */
     72       1.1  bjh21 static int ei_match(struct device *, struct cfdata *, void *);
     73       1.1  bjh21 static void ei_attach(struct device *, struct device *, void *);
     74       1.1  bjh21 
     75       1.1  bjh21 struct ei_softc {
     76       1.1  bjh21 	struct	ie_softc sc_ie;
     77       1.1  bjh21 	bus_space_tag_t		sc_ctl_t;
     78       1.1  bjh21 	bus_space_handle_t	sc_ctl_h;
     79       1.1  bjh21 	bus_space_tag_t		sc_mem_t;
     80       1.1  bjh21 	bus_space_handle_t	sc_mem_h;
     81       1.1  bjh21 	bus_space_tag_t		sc_rom_t;
     82       1.1  bjh21 	bus_space_handle_t	sc_rom_h;
     83       1.1  bjh21 	u_int8_t	sc_idrom[EI_ROMSIZE];
     84       1.1  bjh21 	void			*sc_ih;
     85       1.1  bjh21 	struct		evcnt	sc_intrcnt;
     86       1.1  bjh21 };
     87       1.1  bjh21 
     88       1.1  bjh21 struct cfattach ei_ca = {
     89       1.1  bjh21 	sizeof(struct ei_softc), ei_match, ei_attach
     90       1.1  bjh21 };
     91       1.1  bjh21 
     92       1.1  bjh21 static inline void
     93       1.1  bjh21 ei_setpage(struct ei_softc *sc, int page)
     94       1.1  bjh21 {
     95       1.1  bjh21 
     96       1.1  bjh21 	bus_space_write_1(sc->sc_ctl_t, sc->sc_ctl_h, EI_PAGE, page);
     97       1.1  bjh21 }
     98       1.1  bjh21 
     99       1.1  bjh21 static inline void
    100       1.1  bjh21 ei_cli(struct ei_softc *sc)
    101       1.1  bjh21 {
    102       1.1  bjh21 
    103       1.1  bjh21 	bus_space_write_1(sc->sc_ctl_t, sc->sc_ctl_h, EI_CONTROL, EI_CTL_CLI);
    104       1.1  bjh21 }
    105       1.1  bjh21 
    106       1.1  bjh21 static int
    107       1.1  bjh21 ei_match(struct device *parent, struct cfdata *cf, void *aux)
    108       1.1  bjh21 {
    109       1.1  bjh21 	struct podulebus_attach_args *pa = aux;
    110       1.1  bjh21 
    111  1.4.10.1   tron 	return pa->pa_product == PODULE_ETHER1;
    112       1.1  bjh21 }
    113       1.1  bjh21 
    114       1.1  bjh21 static void
    115       1.1  bjh21 ei_attach(struct device *parent, struct device *self, void *aux)
    116       1.1  bjh21 {
    117       1.1  bjh21 	struct podulebus_attach_args *pa = aux;
    118       1.1  bjh21 	struct ei_softc *sc = (struct ei_softc *)self;
    119       1.1  bjh21 	int i;
    120       1.1  bjh21 	char descr[16];
    121       1.1  bjh21 
    122       1.1  bjh21 	/* Set up bus spaces */
    123       1.1  bjh21 	sc->sc_ctl_t = sc->sc_mem_t = pa->pa_fast_t;
    124       1.1  bjh21 	bus_space_map(pa->pa_fast_t, pa->pa_fast_base, EI_MEMOFF, 0,
    125       1.1  bjh21 	    &sc->sc_ctl_h);
    126       1.1  bjh21 	bus_space_map(pa->pa_fast_t, pa->pa_fast_base + EI_MEMOFF,
    127       1.1  bjh21 	    EI_PAGESIZE * 2, 0, &sc->sc_mem_h);
    128       1.1  bjh21 	sc->sc_rom_t = pa->pa_sync_t;
    129       1.1  bjh21 	bus_space_map(pa->pa_sync_t, pa->pa_sync_base, EI_ROMSIZE, 0,
    130       1.1  bjh21 	    &sc->sc_rom_h);
    131       1.1  bjh21 
    132       1.1  bjh21 	/* Set up callbacks */
    133       1.1  bjh21 	sc->sc_ie.hwinit = NULL;
    134       1.1  bjh21 	sc->sc_ie.intrhook = ei_intrhook;
    135       1.1  bjh21 	sc->sc_ie.hwreset = ei_hwreset;
    136       1.1  bjh21 	sc->sc_ie.chan_attn = ei_attn;
    137       1.1  bjh21 
    138       1.1  bjh21 	sc->sc_ie.memcopyin = ei_copyin;
    139       1.1  bjh21 	sc->sc_ie.memcopyout = ei_copyout;
    140       1.1  bjh21 
    141       1.1  bjh21 	sc->sc_ie.ie_bus_barrier = NULL;
    142       1.1  bjh21 	sc->sc_ie.ie_bus_read16 = ei_read16;
    143       1.1  bjh21 	sc->sc_ie.ie_bus_write16 = ei_write16;
    144       1.1  bjh21 	sc->sc_ie.ie_bus_write24 = ei_write24;
    145       1.1  bjh21 
    146       1.1  bjh21 	sc->sc_ie.do_xmitnopchain = 0; /* Does it listen? */
    147       1.1  bjh21 
    148       1.1  bjh21 	sc->sc_ie.sc_mediachange = NULL;
    149       1.1  bjh21 	sc->sc_ie.sc_mediastatus = NULL;
    150       1.1  bjh21 
    151       1.1  bjh21 	sc->sc_ie.bt = sc->sc_mem_t; /* XXX hope it doesn't use them */
    152       1.1  bjh21 	sc->sc_ie.bh = sc->sc_mem_h;
    153       1.1  bjh21 
    154       1.1  bjh21 	printf(":");
    155       1.1  bjh21 
    156       1.1  bjh21 	/* All Ether1s are 64k (I believe) */
    157       1.1  bjh21 	sc->sc_ie.sc_msize = EI_MEMSIZE;
    158       1.1  bjh21 
    159       1.1  bjh21 	/* set up pointers to important on-card control structures */
    160       1.1  bjh21 	sc->sc_ie.iscp = 0;
    161       1.1  bjh21 	sc->sc_ie.scb = IE_ISCP_SZ;
    162       1.1  bjh21 	sc->sc_ie.scp = sc->sc_ie.sc_msize + IE_SCP_ADDR - (1 << 24);
    163       1.1  bjh21 
    164       1.1  bjh21 	sc->sc_ie.buf_area = sc->sc_ie.scb + IE_SCB_SZ;
    165       1.1  bjh21 	sc->sc_ie.buf_area_sz =
    166       1.1  bjh21 	    sc->sc_ie.sc_msize - IE_ISCP_SZ - IE_SCB_SZ - IE_SCP_SZ;
    167       1.1  bjh21 
    168       1.1  bjh21 	/* Wipe the whole of the card's memory */
    169       1.1  bjh21 	for (i = 0; i < EI_NPAGES; i++) {
    170       1.1  bjh21 		ei_setpage(sc, i);
    171       1.1  bjh21 		bus_space_set_region_2(sc->sc_mem_t, sc->sc_mem_h,
    172       1.1  bjh21 				       0, 0,EI_PAGESIZE / 2);
    173       1.1  bjh21 	}
    174       1.1  bjh21 
    175       1.1  bjh21 	/* set up pointers to key structures */
    176       1.1  bjh21 	ei_write24(&sc->sc_ie, IE_SCP_ISCP((u_long)sc->sc_ie.scp),
    177       1.1  bjh21 		    (u_long) sc->sc_ie.iscp);
    178       1.1  bjh21 	ei_write16(&sc->sc_ie, IE_ISCP_SCB((u_long)sc->sc_ie.iscp),
    179       1.1  bjh21 		    (u_long) sc->sc_ie.scb);
    180       1.1  bjh21 	ei_write24(&sc->sc_ie, IE_ISCP_BASE((u_long)sc->sc_ie.iscp),
    181       1.1  bjh21 		    (u_long) sc->sc_ie.iscp);
    182       1.1  bjh21 
    183       1.1  bjh21 	/* check if chip answers */
    184       1.1  bjh21 	if (i82586_proberam(&sc->sc_ie) == 0) {
    185       1.1  bjh21 		printf(" memory probe failed\n");
    186       1.1  bjh21 		return;
    187       1.1  bjh21 	}
    188       1.1  bjh21 
    189       1.1  bjh21 	/* Read ROM */
    190       1.1  bjh21 	bus_space_read_region_1(sc->sc_rom_t, sc->sc_rom_h, 0,
    191       1.1  bjh21 				sc->sc_idrom, EI_ROMSIZE);
    192       1.1  bjh21 
    193       1.1  bjh21 	snprintf(descr, 15, "AKA25 iss. %d", sc->sc_idrom[EI_ROM_HWREV]);
    194       1.1  bjh21 	i82586_attach(&sc->sc_ie, descr, sc->sc_idrom + EI_ROM_EADDR,
    195       1.1  bjh21 		      NULL, 0, 0);
    196       1.1  bjh21 
    197       1.1  bjh21 	evcnt_attach_dynamic(&sc->sc_intrcnt, EVCNT_TYPE_INTR, NULL,
    198       1.1  bjh21 	    self->dv_xname, "intr");
    199       1.1  bjh21 	sc->sc_ih = podulebus_irq_establish(pa->pa_ih, IPL_NET, i82586_intr,
    200       1.1  bjh21 	    self, &sc->sc_intrcnt);
    201       1.1  bjh21 	ei_cli(sc);
    202       1.1  bjh21 }
    203       1.1  bjh21 
    204       1.1  bjh21 static void
    205       1.1  bjh21 ei_hwreset(struct ie_softc *sc_ie, int why)
    206       1.1  bjh21 {
    207       1.1  bjh21 	struct ei_softc *sc = (struct ei_softc *)sc_ie;
    208       1.1  bjh21 
    209       1.4  bjh21 	bus_space_write_1(sc->sc_ctl_t, sc->sc_ctl_h, EI_CONTROL, EI_CTL_RST);
    210       1.1  bjh21 	DELAY(1000);
    211       1.1  bjh21 	bus_space_write_1(sc->sc_ctl_t, sc->sc_ctl_h, EI_CONTROL, 0);
    212       1.1  bjh21 	DELAY(1000);
    213       1.1  bjh21 	ei_cli(sc);
    214       1.1  bjh21 }
    215       1.1  bjh21 
    216       1.1  bjh21 static int
    217       1.1  bjh21 ei_intrhook(struct ie_softc *sc_ie, int why)
    218       1.1  bjh21 {
    219       1.1  bjh21 	struct ei_softc *sc = (struct ei_softc *)sc_ie;
    220       1.1  bjh21 
    221       1.1  bjh21 	switch (why) {
    222       1.1  bjh21 	case INTR_EXIT:
    223       1.1  bjh21 	case INTR_ACK:
    224       1.1  bjh21 		ei_cli(sc);
    225       1.1  bjh21 		break;
    226       1.1  bjh21 	}
    227       1.1  bjh21 	return 0;
    228       1.1  bjh21 }
    229       1.1  bjh21 
    230       1.1  bjh21 static void
    231       1.1  bjh21 ei_attn(struct ie_softc *sc_ie, int why)
    232       1.1  bjh21 {
    233       1.1  bjh21 	struct ei_softc *sc = (void *)sc_ie;
    234       1.1  bjh21 
    235       1.4  bjh21 	bus_space_write_1(sc->sc_ctl_t, sc->sc_ctl_h, EI_CONTROL, EI_CTL_CA);
    236       1.1  bjh21 }
    237       1.1  bjh21 
    238       1.1  bjh21 /*
    239       1.1  bjh21  * Various access functions to allow the MI 82586 driver to get at the
    240       1.1  bjh21  * board's memory.  All memory accesses must go through these, as
    241       1.1  bjh21  * nothing else knows how to manipulate the page register.  Note that
    242       1.1  bjh21  * all addresses and lengths passed in are in bytes of actual data.
    243       1.1  bjh21  * The bus_space functions deal in words, though, so we have to
    244       1.1  bjh21  * convert on the way through.
    245       1.1  bjh21  */
    246       1.1  bjh21 
    247       1.1  bjh21 static void
    248       1.1  bjh21 ei_copyin(struct ie_softc *sc_ie, void *dest, int src, size_t size)
    249       1.1  bjh21 {
    250       1.1  bjh21 	struct ei_softc *sc = (struct ei_softc *)sc_ie;
    251       1.1  bjh21 	int cnt, s, extra_byte;
    252       1.1  bjh21 	u_int16_t *wptr;
    253       1.1  bjh21 
    254       1.1  bjh21 #ifdef DIAGNOSTIC
    255       1.1  bjh21 	if (src % 2 != 0 || !ALIGNED_POINTER(dest, u_int16_t))
    256       1.1  bjh21 		panic("%s: unaligned copyin", sc_ie->sc_dev.dv_xname);
    257       1.1  bjh21 #endif
    258       1.1  bjh21 	wptr = dest;
    259       1.1  bjh21 	extra_byte = size % 2;
    260       1.1  bjh21 	size -= extra_byte;
    261       1.1  bjh21 	while (size > 0) {
    262       1.1  bjh21 		cnt = EI_PAGESIZE - src % EI_PAGESIZE;
    263       1.1  bjh21 		if (cnt > size)
    264       1.1  bjh21 			cnt = size;
    265       1.1  bjh21 		s = splnet();
    266       1.1  bjh21 		ei_setpage(sc, ei_atop(src));
    267       1.1  bjh21 		/* bus ops are in words */
    268       1.1  bjh21 		bus_space_read_region_2(sc->sc_mem_t, sc->sc_mem_h,
    269       1.1  bjh21 					ei_atopo(src) / 2, wptr, cnt / 2);
    270       1.1  bjh21 		splx(s);
    271       1.1  bjh21 		src += cnt;
    272       1.1  bjh21 		wptr += cnt / 2;
    273       1.1  bjh21 		size -= cnt;
    274       1.1  bjh21 	}
    275       1.1  bjh21 	if (extra_byte) {
    276       1.1  bjh21 		/* Do we need to be this careful? */
    277       1.1  bjh21 		s = splnet();
    278       1.1  bjh21 		ei_setpage(sc, ei_atop(src));
    279       1.1  bjh21 		*(u_int8_t *)wptr =
    280       1.1  bjh21 		    bus_space_read_2(sc->sc_mem_t, sc->sc_mem_h,
    281       1.1  bjh21 				     ei_atopo(src) / 2) & 0xff;
    282       1.1  bjh21 		splx(s);
    283       1.1  bjh21 	}
    284       1.1  bjh21 }
    285       1.1  bjh21 
    286       1.1  bjh21 static void
    287       1.1  bjh21 ei_copyout(struct ie_softc *sc_ie, const void *src, int dest, size_t size)
    288       1.1  bjh21 {
    289       1.1  bjh21 	struct ei_softc *sc = (struct ei_softc *)sc_ie;
    290       1.1  bjh21 	int cnt, s;
    291       1.1  bjh21 	const u_int16_t *wptr;
    292       1.1  bjh21 	u_int16_t *bounce = NULL;
    293       1.1  bjh21 
    294       1.1  bjh21 #ifdef DIAGNOSTIC
    295       1.1  bjh21 	if (dest % 2 != 0)
    296       1.1  bjh21 		panic("%s: unaligned copyout", sc_ie->sc_dev.dv_xname);
    297       1.1  bjh21 #endif
    298       1.1  bjh21 	if (!ALIGNED_POINTER(src, u_int16_t)) {
    299       1.1  bjh21 		MALLOC(bounce, u_int16_t *, size, M_DEVBUF, M_NOWAIT);
    300       1.1  bjh21 		if (bounce == NULL)
    301       1.1  bjh21 			panic("%s: no memory to align copyout",
    302       1.1  bjh21 			      sc_ie->sc_dev.dv_xname);
    303       1.1  bjh21 		memcpy(bounce, src, size);
    304       1.1  bjh21 		src = bounce;
    305       1.1  bjh21 	}
    306       1.1  bjh21 	wptr = src;
    307       1.1  bjh21 	if (size % 2 != 0)
    308       1.1  bjh21 		size++; /* This is safe, since the buffer is 16bit aligned */
    309       1.1  bjh21 	while (size > 0) {
    310       1.1  bjh21 		cnt = EI_PAGESIZE - dest % EI_PAGESIZE;
    311       1.1  bjh21 		if (cnt > size)
    312       1.1  bjh21 			cnt = size;
    313       1.1  bjh21 		s = splnet();
    314       1.1  bjh21 		ei_setpage(sc, ei_atop(dest));
    315       1.1  bjh21 		/* bus ops are in words */
    316       1.1  bjh21 		bus_space_write_region_2(sc->sc_mem_t, sc->sc_mem_h,
    317       1.1  bjh21 					 ei_atopo(dest) / 2, wptr, cnt / 2);
    318       1.1  bjh21 		splx(s);
    319       1.1  bjh21 		wptr += cnt / 2;
    320       1.1  bjh21 		dest += cnt;
    321       1.1  bjh21 		size -= cnt;
    322       1.1  bjh21 	}
    323       1.1  bjh21 	if (bounce != NULL)
    324       1.1  bjh21 		FREE(bounce, M_DEVBUF);
    325       1.1  bjh21 }
    326       1.1  bjh21 
    327       1.1  bjh21 static u_int16_t
    328       1.1  bjh21 ei_read16(struct ie_softc *sc_ie, int addr)
    329       1.1  bjh21 {
    330       1.1  bjh21 	struct ei_softc *sc = (struct ei_softc *)sc_ie;
    331       1.1  bjh21 	int result, s;
    332       1.1  bjh21 
    333       1.1  bjh21 #ifdef DIAGNOSTIC
    334       1.1  bjh21 	if (addr % 2 != 0)
    335       1.1  bjh21 		panic("%s: unaligned read16", sc_ie->sc_dev.dv_xname);
    336       1.1  bjh21 #endif
    337       1.1  bjh21 	s = splnet();
    338       1.1  bjh21 	ei_setpage(sc, ei_atop(addr));
    339       1.1  bjh21 	result = bus_space_read_2(sc->sc_mem_t, sc->sc_mem_h,
    340       1.1  bjh21 				  ei_atopo(addr) / 2);
    341       1.1  bjh21 	splx(s);
    342       1.1  bjh21 	return result;
    343       1.1  bjh21 }
    344       1.1  bjh21 
    345       1.1  bjh21 static void
    346       1.1  bjh21 ei_write16(struct ie_softc *sc_ie, int addr, u_int16_t value)
    347       1.1  bjh21 {
    348       1.1  bjh21 	struct ei_softc *sc = (struct ei_softc *)sc_ie;
    349       1.1  bjh21 	int s;
    350       1.1  bjh21 
    351       1.1  bjh21 #ifdef DIAGNOSTIC
    352       1.1  bjh21 	if (addr % 2 != 0)
    353       1.1  bjh21 		panic("%s: unaligned write16", sc_ie->sc_dev.dv_xname);
    354       1.1  bjh21 #endif
    355       1.1  bjh21 	s = splnet();
    356       1.1  bjh21 	ei_setpage(sc, ei_atop(addr));
    357       1.1  bjh21 	bus_space_write_2(sc->sc_mem_t, sc->sc_mem_h, ei_atopo(addr) / 2,
    358       1.1  bjh21 			  value);
    359       1.1  bjh21 	splx(s);
    360       1.1  bjh21 }
    361       1.1  bjh21 
    362       1.1  bjh21 static void
    363       1.1  bjh21 ei_write24(struct ie_softc *sc_ie, int addr, int value)
    364       1.1  bjh21 {
    365       1.1  bjh21 	int s;
    366       1.1  bjh21 
    367       1.1  bjh21 #ifdef DIAGNOSTIC
    368       1.1  bjh21 	if (addr % 2 != 0)
    369       1.1  bjh21 		panic("%s: unaligned write24", sc_ie->sc_dev.dv_xname);
    370       1.1  bjh21 #endif
    371       1.1  bjh21 	s = splnet();
    372       1.1  bjh21 	ei_write16(sc_ie, addr, value & 0xffff);
    373       1.1  bjh21 	ei_write16(sc_ie, addr + 2, (value >> 16) & 0xff);
    374       1.1  bjh21 	splx(s);
    375       1.1  bjh21 }
    376       1.1  bjh21 
    377