Index: arch/atari/atari/autoconf.c =================================================================== RCS file: /cvsroot/src/sys/arch/atari/atari/autoconf.c,v retrieving revision 1.56 diff -u -r1.56 autoconf.c --- arch/atari/atari/autoconf.c 8 Mar 2009 05:25:30 -0000 1.56 +++ arch/atari/atari/autoconf.c 29 Mar 2010 16:07:16 -0000 @@ -280,6 +280,7 @@ config_found(dp, __UNCONST("nvr") , simple_devprint); config_found(dp, __UNCONST("lpt") , simple_devprint); config_found(dp, __UNCONST("wdc") , simple_devprint); + config_found(dp, __UNCONST("ne") , simple_devprint); config_found(dp, __UNCONST("isab") , simple_devprint); config_found(dp, __UNCONST("pcib") , simple_devprint); config_found(dp, __UNCONST("avmebus") , simple_devprint); Index: arch/atari/conf/ATARITT =================================================================== RCS file: /cvsroot/src/sys/arch/atari/conf/ATARITT,v retrieving revision 1.97 diff -u -r1.97 ATARITT --- arch/atari/conf/ATARITT 13 Mar 2010 16:31:38 -0000 1.97 +++ arch/atari/conf/ATARITT 29 Mar 2010 16:07:16 -0000 @@ -107,6 +107,7 @@ ite2 at grfcc2 # 3rd tty lp0 at mainbus0 # centronics printer ser0 at mainbus0 # UART on first 68901 (ttyB0) +ne0 at mainbus0 # EtherNEC on Atari ROM cartridge slot avmebus0 at mainbus0 # VME bus vme0 at avmebus0 le0 at vme0 irq 5 # Lance ethernet (Riebl/PAM). Index: arch/atari/conf/FALCON =================================================================== RCS file: /cvsroot/src/sys/arch/atari/conf/FALCON,v retrieving revision 1.94 diff -u -r1.94 FALCON --- arch/atari/conf/FALCON 13 Mar 2010 16:31:38 -0000 1.94 +++ arch/atari/conf/FALCON 29 Mar 2010 16:07:16 -0000 @@ -110,6 +110,7 @@ ite2 at grfcc2 # 3rd tty lp0 at mainbus0 # centronics printer ser0 at mainbus0 # UART on first 68901 (ttyB0) +ne0 at mainbus0 # EtherNEC on Atari ROM cartridge slot wdc0 at mainbus0 # IDE-bus atabus* at wdc? channel ? wd* at atabus? drive ? Index: arch/atari/conf/GENERIC.in =================================================================== RCS file: /cvsroot/src/sys/arch/atari/conf/GENERIC.in,v retrieving revision 1.84 diff -u -r1.84 GENERIC.in --- arch/atari/conf/GENERIC.in 13 Mar 2010 16:30:02 -0000 1.84 +++ arch/atari/conf/GENERIC.in 29 Mar 2010 16:07:16 -0000 @@ -349,6 +349,7 @@ ite2 at grfcc2 # 3rd tty lp0 at mainbus0 # centronics printer ser0 at mainbus0 # UART on first 68901 (ttyB0) +ne0 at mainbus0 # EtherNEC on Atari ROM cartridge slot #if defined(TT030_KERNEL) avmebus0 at mainbus0 # VME bus Index: arch/atari/conf/HADES =================================================================== RCS file: /cvsroot/src/sys/arch/atari/conf/HADES,v retrieving revision 1.86 diff -u -r1.86 HADES --- arch/atari/conf/HADES 13 Mar 2010 16:31:38 -0000 1.86 +++ arch/atari/conf/HADES 29 Mar 2010 16:07:16 -0000 @@ -114,6 +114,7 @@ nvr0 at mainbus0 # nvram driver lp0 at mainbus0 # centronics printer ser0 at mainbus0 # UART on first 68901 (ttyB0) +ne0 at mainbus0 # EtherNEC on Atari ROM cartridge slot grfbus0 at mainbus0 # bitmapped display's grfet0 at grfbus0 # et4000/et6000/et6100 consoles ite0 at grfet0 Index: arch/atari/conf/HADES.in =================================================================== RCS file: /cvsroot/src/sys/arch/atari/conf/HADES.in,v retrieving revision 1.9 diff -u -r1.9 HADES.in --- arch/atari/conf/HADES.in 24 Jan 2009 00:19:47 -0000 1.9 +++ arch/atari/conf/HADES.in 29 Mar 2010 16:07:16 -0000 @@ -21,6 +21,7 @@ nvr0 at mainbus0 # nvram driver lp0 at mainbus0 # centronics printer ser0 at mainbus0 # UART on first 68901 (ttyB0) +ne0 at mainbus0 # EtherNEC on Atari ROM cartridge slot grfbus0 at mainbus0 # bitmapped display's grfet0 at grfbus0 # et4000/et6000/et6100 consoles ite0 at grfet0 Index: arch/atari/conf/MILAN-ISAIDE =================================================================== RCS file: /cvsroot/src/sys/arch/atari/conf/MILAN-ISAIDE,v retrieving revision 1.63 diff -u -r1.63 MILAN-ISAIDE --- arch/atari/conf/MILAN-ISAIDE 13 Mar 2010 16:31:38 -0000 1.63 +++ arch/atari/conf/MILAN-ISAIDE 29 Mar 2010 16:07:16 -0000 @@ -115,6 +115,7 @@ pci0 at pcib0 nvr0 at mainbus0 # nvram driver ser0 at mainbus0 +ne0 at mainbus0 # EtherNEC fdcisa0 at isa? port 0x3f0 irq 6 drq 2 # standard PC floppy contr. fdisa0 at fdcisa0 drive 0 wdc0 at isa? port 0x1f0 irq 14 flags 0x04 # 1st IDE controller Index: arch/atari/conf/MILAN-PCIIDE =================================================================== RCS file: /cvsroot/src/sys/arch/atari/conf/MILAN-PCIIDE,v retrieving revision 1.67 diff -u -r1.67 MILAN-PCIIDE --- arch/atari/conf/MILAN-PCIIDE 13 Mar 2010 16:31:38 -0000 1.67 +++ arch/atari/conf/MILAN-PCIIDE 29 Mar 2010 16:07:16 -0000 @@ -115,6 +115,7 @@ pci0 at pcib0 nvr0 at mainbus0 # nvram driver ser0 at mainbus0 +ne0 at mainbus0 # EtherNEC fdcisa0 at isa? port 0x3f0 irq 6 drq 2 # standard PC floppy contr. fdisa0 at fdcisa0 drive 0 pciide* at pci? dev ? function ? flags 0x0000 # GENERIC pciide driver Index: arch/atari/conf/MILAN.in =================================================================== RCS file: /cvsroot/src/sys/arch/atari/conf/MILAN.in,v retrieving revision 1.23 diff -u -r1.23 MILAN.in --- arch/atari/conf/MILAN.in 23 Dec 2009 09:17:41 -0000 1.23 +++ arch/atari/conf/MILAN.in 29 Mar 2010 16:07:16 -0000 @@ -45,6 +45,7 @@ pci0 at pcib0 nvr0 at mainbus0 # nvram driver ser0 at mainbus0 +ne0 at mainbus0 # EtherNEC fdcisa0 at isa? port 0x3f0 irq 6 drq 2 # standard PC floppy contr. fdisa0 at fdcisa0 drive 0 Index: arch/atari/conf/files.atari =================================================================== RCS file: /cvsroot/src/sys/arch/atari/conf/files.atari,v retrieving revision 1.116 diff -u -r1.116 files.atari --- arch/atari/conf/files.atari 13 Mar 2010 16:30:03 -0000 1.116 +++ arch/atari/conf/files.atari 29 Mar 2010 16:07:16 -0000 @@ -182,6 +182,10 @@ attach wdc at mainbus with wdc_mb: mbdma file arch/atari/dev/wdc_mb.c wdc_mb +# EtherNEC on Atari ROM cartridge slot +attach ne at mainbus with ne_mb: rtl80x9 +file arch/atari/dev/if_ne_mb.c ne_mb + # ISA Plug 'n Play devices file arch/atari/isa/isapnp_machdep.c isapnp --- /dev/null 2010-03-30 01:05:19.000000000 +0900 +++ arch/atari/dev/if_ne_mb.c 2010-03-30 00:52:56.000000000 +0900 @@ -0,0 +1,458 @@ +/* $NetBSD$ */ + +/* + * Copyright (c) 2010 Izumi Tsutsui. 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. + * + * 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. + */ + +/* + * Device driver for the EtherNEC, + * NE2000 in 8bit mode over Atari ROM cartridge slot. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD$"); + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include + +/* + * EtherNEC specific address configuration + */ + +/* I/O read ops are through /ROM4 area (0xFA0000) */ +#define AD_CART_ROM4 (AD_CART + 0x00000) +#define ETHERNEC_READ_PORT AD_CART_ROM4 + +/* I/O write ops are through /ROM3 area (0xFB0000) */ +#define AD_CART_ROM3 (AD_CART + 0x10000) +#define ETHERNEC_WRITE_PORT AD_CART_ROM3 + +/* CPU address lines A13-A9 are connected to ISA A4-A0 */ +#define ETHERNEC_PORT_STRIDE 9 + +/* Using A8-A1 lines to specify write data (no A0 but UDS/LDS on m68k) */ +#define ETHERNEC_WR_ADDR_SHIFT 1 + +/* interrupt polling per HZ */ +#define ETHERNEC_TICK 1 + +static int ne_mb_probe(device_t, cfdata_t, void *); +static void ne_mb_attach(device_t, device_t, void *); + +static void ne_mb_poll(void *); + +static bus_space_tag_t ethernec_init_bus_space_tag(bus_space_tag_t); + +static int ethernec_bus_space_peek_1(bus_space_tag_t, bus_space_handle_t, + bus_size_t); +static uint8_t ethernec_bus_space_read_1(bus_space_tag_t, bus_space_handle_t, + bus_size_t); +static void ethernec_bus_space_write_1(bus_space_tag_t, bus_space_handle_t, + bus_size_t, uint8_t); +static void ethernec_bus_space_read_multi_1(bus_space_tag_t, + bus_space_handle_t, bus_size_t, uint8_t *, bus_size_t); +static void ethernec_bus_space_read_multi_2(bus_space_tag_t, + bus_space_handle_t, bus_size_t, uint16_t *, bus_size_t); +static void ethernec_bus_space_write_multi_1(bus_space_tag_t, + bus_space_handle_t, bus_size_t, const uint8_t *, bus_size_t); +static void ethernec_bus_space_write_multi_2(bus_space_tag_t, + bus_space_handle_t, bus_size_t, const uint16_t *, bus_size_t); +static void ethernec_bus_space_unimpl(void); + +struct ne_mb_softc { + struct ne2000_softc sc_ne2000; /* MI ne2000 softc */ + + struct atari_bus_space sc_bs; + struct callout sc_poll; +}; + +CFATTACH_DECL_NEW(ne_mb, sizeof(struct ne_mb_softc), + ne_mb_probe, ne_mb_attach, NULL, NULL); + +static int +ne_mb_probe(device_t parent, cfdata_t cf, void *aux) +{ + static bool ne_matched = false; + struct atari_bus_space bs; + bus_space_tag_t iot, asict; + bus_space_handle_t ioh, iowh, asich; + int netype, rv; + + rv = 0; + + if (!atari_realconfig) + goto out; + if (strcmp("ne", aux) || ne_matched) + goto out; + + iot = ethernec_init_bus_space_tag(&bs); + + /* map I/O space for read ops */ + if (bus_space_map(iot, ETHERNEC_READ_PORT, + NE2000_NPORTS << ETHERNEC_PORT_STRIDE, 0, &ioh) != 0) + goto out; + + /* map I/O space for write ops */ + if (bus_space_map(iot, ETHERNEC_WRITE_PORT, + NE2000_NPORTS << ETHERNEC_PORT_STRIDE, 0, &iowh) != 0) + goto out1; + + /* XXX abuse stride for offset of write ports from read ones */ + iot->stride = + (vaddr_t)bus_space_vaddr(iot, iowh) - + (vaddr_t)bus_space_vaddr(iot, ioh); + + /* check if register regions are vaild */ + if (bus_space_peek_1(iot, ioh, 0) == 0) + goto out2; + + asict = iot; + if (bus_space_subregion(iot, ioh, + NE2000_ASIC_OFFSET << ETHERNEC_PORT_STRIDE, + NE2000_ASIC_NPORTS << ETHERNEC_PORT_STRIDE, &asich)) + goto out2; + + /* Look for an NE2000 compatible card */ + netype = ne2000_detect(iot, ioh, asict, asich); + switch (netype) { + /* XXX should we reject non RTL8019 varilants? */ + case NE2000_TYPE_NE1000: + case NE2000_TYPE_NE2000: + case NE2000_TYPE_RTL8019: + ne_matched = true; + rv = 1; + break; + default: + break; + } + + out2: + bus_space_unmap(iot, iowh, NE2000_NPORTS << ETHERNEC_PORT_STRIDE); + out1: + bus_space_unmap(iot, ioh, NE2000_NPORTS << ETHERNEC_PORT_STRIDE); + out: + return rv; +} + +static void +ne_mb_attach(device_t parent, device_t self, void *aux) +{ + struct ne_mb_softc *sc = device_private(self); + struct ne2000_softc *nsc = &sc->sc_ne2000; + struct dp8390_softc *dsc = &nsc->sc_dp8390; + bus_space_tag_t iot, asict; + bus_space_handle_t ioh, iowh, asich; + const char *typestr; + int netype; + + dsc->sc_dev = self; + aprint_normal(": EtherNEC on Atari ROM cartridge slot\n"); + + iot = ethernec_init_bus_space_tag(&sc->sc_bs); + + /* map I/O space for read ops */ + if (bus_space_map(iot, ETHERNEC_READ_PORT, + NE2000_NPORTS << ETHERNEC_PORT_STRIDE, 0, &ioh) != 0) + goto out; + + /* map I/O space for write ops */ + if (bus_space_map(iot, ETHERNEC_WRITE_PORT, + NE2000_NPORTS << ETHERNEC_PORT_STRIDE, 0, &iowh) != 0) + goto out1; + + /* XXX abuse stride */ + iot->stride = + (vaddr_t)bus_space_vaddr(iot, iowh) - + (vaddr_t)bus_space_vaddr(iot, ioh); + + asict = iot; + if (bus_space_subregion(iot, ioh, + NE2000_ASIC_OFFSET << ETHERNEC_PORT_STRIDE, + NE2000_ASIC_NPORTS << ETHERNEC_PORT_STRIDE, &asich)) + goto out2; + + dsc->sc_regt = iot; + dsc->sc_regh = ioh; + + nsc->sc_asict = asict; + nsc->sc_asich = asich; + + /* EtherNEC uses 8-bit data bus */ + nsc->sc_quirk = NE2000_QUIRK_8BIT; + + /* + * detect it again, so we can print some information about + * the interface. + * XXX: Should we accept only RTL8019? + */ + netype = ne2000_detect(iot, ioh, asict, asich); + switch (netype) { + case NE2000_TYPE_NE1000: + typestr = "NE1000"; + break; + + case NE2000_TYPE_NE2000: + typestr = "NE2000"; + break; + + case NE2000_TYPE_RTL8019: + typestr = "NE2000 (RTL8019)"; + break; + + default: + aprint_error_dev(self, "where did the card go?!\n"); + goto out2; + } + + aprint_normal_dev(self, "%s Ethernet (8-bit)\n", typestr); + + /* this interface is always enabled */ + dsc->sc_enabled = 1; + + /* call MI ne2000 attach function */ + ne2000_attach(nsc, NULL); + + /* emulate interrupts by callout(9) */ + aprint_normal_dev(self, "using %d Hz polling\n", hz / ETHERNEC_TICK); + callout_init(&sc->sc_poll, 0); + callout_reset(&sc->sc_poll, ETHERNEC_TICK, ne_mb_poll, sc); + + return; + + out2: + bus_space_unmap(iot, iowh, NE2000_NPORTS << ETHERNEC_PORT_STRIDE); + out1: + bus_space_unmap(iot, ioh, NE2000_NPORTS << ETHERNEC_PORT_STRIDE); + out: + return; +} + +static void +ne_mb_poll(void *arg) +{ + struct ne_mb_softc *sc; + struct ne2000_softc *nsc; + struct dp8390_softc *dsc; + int s; + + sc = arg; + nsc = &sc->sc_ne2000; + dsc = &nsc->sc_dp8390; + + s = splnet(); + (void)dp8390_intr(dsc); + splx(s); + + callout_reset(&sc->sc_poll, ETHERNEC_TICK, ne_mb_poll, sc); +} + +/* + * bus_space(9) functions for EtherNEC + * + * XXX: should these belong to an independent cartridge slot bus? + */ +static bus_space_tag_t +ethernec_init_bus_space_tag(bus_space_tag_t en_t) +{ + + if (en_t == NULL) + return NULL; + + memset(en_t, 0, sizeof(*en_t)); + + /* XXX: implement functions used by MI ne2000 and dp8390 only */ + en_t->abs_p_1 = ethernec_bus_space_peek_1; + en_t->abs_p_2 = (void *)ethernec_bus_space_unimpl; + en_t->abs_p_4 = (void *)ethernec_bus_space_unimpl; + en_t->abs_p_8 = (void *)ethernec_bus_space_unimpl; + en_t->abs_r_1 = ethernec_bus_space_read_1; + en_t->abs_r_2 = (void *)ethernec_bus_space_unimpl; + en_t->abs_r_4 = (void *)ethernec_bus_space_unimpl; + en_t->abs_r_8 = (void *)ethernec_bus_space_unimpl; + en_t->abs_rs_1 = ethernec_bus_space_read_1; + en_t->abs_rs_2 = (void *)ethernec_bus_space_unimpl; + en_t->abs_rs_4 = (void *)ethernec_bus_space_unimpl; + en_t->abs_rs_8 = (void *)ethernec_bus_space_unimpl; + en_t->abs_rm_1 = ethernec_bus_space_read_multi_1; + en_t->abs_rm_2 = (void *)ethernec_bus_space_unimpl; + en_t->abs_rm_4 = (void *)ethernec_bus_space_unimpl; + en_t->abs_rm_8 = (void *)ethernec_bus_space_unimpl; + en_t->abs_rms_1 = ethernec_bus_space_read_multi_1; + en_t->abs_rms_2 = ethernec_bus_space_read_multi_2; /* XXX dummy */ + en_t->abs_rms_4 = (void *)ethernec_bus_space_unimpl; + en_t->abs_rms_8 = (void *)ethernec_bus_space_unimpl; + en_t->abs_rr_1 = (void *)ethernec_bus_space_unimpl; + en_t->abs_rr_2 = (void *)ethernec_bus_space_unimpl; + en_t->abs_rr_4 = (void *)ethernec_bus_space_unimpl; + en_t->abs_rr_8 = (void *)ethernec_bus_space_unimpl; + en_t->abs_rrs_1 = (void *)ethernec_bus_space_unimpl; + en_t->abs_rrs_2 = (void *)ethernec_bus_space_unimpl; + en_t->abs_rrs_4 = (void *)ethernec_bus_space_unimpl; + en_t->abs_rrs_8 = (void *)ethernec_bus_space_unimpl; + en_t->abs_w_1 = ethernec_bus_space_write_1; + en_t->abs_w_2 = (void *)ethernec_bus_space_unimpl; + en_t->abs_w_4 = (void *)ethernec_bus_space_unimpl; + en_t->abs_w_8 = (void *)ethernec_bus_space_unimpl; + en_t->abs_ws_1 = ethernec_bus_space_write_1; + en_t->abs_ws_2 = (void *)ethernec_bus_space_unimpl; + en_t->abs_ws_4 = (void *)ethernec_bus_space_unimpl; + en_t->abs_ws_8 = (void *)ethernec_bus_space_unimpl; + en_t->abs_wm_1 = ethernec_bus_space_write_multi_1; + en_t->abs_wm_2 = (void *)ethernec_bus_space_unimpl; + en_t->abs_wm_4 = (void *)ethernec_bus_space_unimpl; + en_t->abs_wm_8 = (void *)ethernec_bus_space_unimpl; + en_t->abs_wms_1 = ethernec_bus_space_write_multi_1; + en_t->abs_wms_2 = ethernec_bus_space_write_multi_2; /* XXX dummy */ + en_t->abs_wms_4 = (void *)ethernec_bus_space_unimpl; + en_t->abs_wms_8 = (void *)ethernec_bus_space_unimpl; + en_t->abs_wr_1 = (void *)ethernec_bus_space_unimpl; + en_t->abs_wr_2 = (void *)ethernec_bus_space_unimpl; + en_t->abs_wr_4 = (void *)ethernec_bus_space_unimpl; + en_t->abs_wr_8 = (void *)ethernec_bus_space_unimpl; + en_t->abs_wrs_1 = (void *)ethernec_bus_space_unimpl; + en_t->abs_wrs_2 = (void *)ethernec_bus_space_unimpl; + en_t->abs_wrs_4 = (void *)ethernec_bus_space_unimpl; + en_t->abs_wrs_8 = (void *)ethernec_bus_space_unimpl; + en_t->abs_sm_1 = (void *)ethernec_bus_space_unimpl; + en_t->abs_sm_2 = (void *)ethernec_bus_space_unimpl; + en_t->abs_sm_4 = (void *)ethernec_bus_space_unimpl; + en_t->abs_sm_8 = (void *)ethernec_bus_space_unimpl; + en_t->abs_sr_1 = (void *)ethernec_bus_space_unimpl; + en_t->abs_sr_2 = (void *)ethernec_bus_space_unimpl; + en_t->abs_sr_4 = (void *)ethernec_bus_space_unimpl; + en_t->abs_sr_8 = (void *)ethernec_bus_space_unimpl; + + return en_t; +} + +static void +ethernec_bus_space_unimpl(void) +{ + + panic("%s: unimplemented EtherNEC bus_space(9) function called", + __func__); +} + +static int +ethernec_bus_space_peek_1(bus_space_tag_t bt, bus_space_handle_t bh, + bus_size_t reg) +{ + uint8_t *va; + + va = (uint8_t *)(bh + (reg << ETHERNEC_PORT_STRIDE)); + + return !badbaddr(va, sizeof(uint8_t)); +} + +static uint8_t +ethernec_bus_space_read_1(bus_space_tag_t bt, bus_space_handle_t bh, + bus_size_t reg) +{ + volatile uint8_t *ba; + + ba = (volatile uint8_t *)(bh + (reg << ETHERNEC_PORT_STRIDE)); + + return *ba; +} + +static void +ethernec_bus_space_write_1(bus_space_tag_t bt, bus_space_handle_t bh, + bus_size_t reg, uint8_t val) +{ + volatile uint8_t *wport; + + /* + * Write ops are done by read against write region (ROM3) address. + * 8-bit write data is specified via lower address bits. + */ + wport = (volatile uint8_t *)bh + + bt->stride + (reg << ETHERNEC_PORT_STRIDE); + wport += (u_int)val << ETHERNEC_WR_ADDR_SHIFT; + + (void)*wport; +} + +static void +ethernec_bus_space_read_multi_1(bus_space_tag_t bt, bus_space_handle_t bh, + bus_size_t reg, uint8_t *a, bus_size_t c) +{ + volatile uint8_t *ba; + + ba = (volatile uint8_t *)(bh + (reg << ETHERNEC_PORT_STRIDE)); + for (; c != 0; c--) + *a++ = *ba; +} + +static void +ethernec_bus_space_read_multi_2(bus_space_tag_t bt, bus_space_handle_t bh, + bus_size_t reg, uint16_t *a, bus_size_t c) +{ + + /* XXX: dummy function for probe ops in ne2000_detect() */ +} + +static void +ethernec_bus_space_write_multi_1(bus_space_tag_t bt, bus_space_handle_t bh, + bus_size_t reg, const uint8_t *a, bus_size_t c) +{ + volatile uint8_t *ba, *wport; + u_int val; + + ba = (volatile uint8_t *)(bh + + bt->stride + (reg << ETHERNEC_PORT_STRIDE)); + + for (; c != 0; c--) { + val = *a++; + wport = ba + (val << ETHERNEC_WR_ADDR_SHIFT); + (void)*wport; + } +} + +static void +ethernec_bus_space_write_multi_2(bus_space_tag_t bt, bus_space_handle_t bh, + bus_size_t reg, const uint16_t *a, bus_size_t c) +{ + + /* XXX: dummy function for probe ops in ne2000_detect() */ +}