-/* $OpenBSD: if_ep_pcmcia.c,v 1.2 1996/05/05 13:39:22 mickey Exp $ */
+/* $OpenBSD: if_ep_pcmcia.c,v 1.3 1996/05/07 07:34:16 deraadt Exp $ */
/* $NetBSD: if_ep.c,v 1.90 1996/04/11 22:29:15 cgd Exp $ */
/*
#endif
#include <machine/cpu.h>
-#include <machine/pio.h>
+#include <machine/bus.h>
#include <dev/ic/elink3var.h>
#include <dev/ic/elink3reg.h>
struct ep_softc *sc = (void *) match;
struct isa_attach_args *ia = aux;
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+ bus_chipset_tag_t bc = sc->sc_bc;
+ bus_io_handle_t ioh = sc->sc_ioh;
int i;
extern int ifqmaxlen;
- outw(ia->ia_iobase + EP_COMMAND, WINDOW_SELECT | 0);
- outw(ia->ia_iobase + EP_W0_CONFIG_CTRL, ENABLE_DRQ_IRQ);
- outw(ia->ia_iobase + EP_W0_RESOURCE_CFG, 0x3f00);
+ bus_io_write_2(bc, ioh, EP_COMMAND, WINDOW_SELECT | 0);
+ bus_io_write_2(bc, ioh, EP_W0_CONFIG_CTRL, ENABLE_DRQ_IRQ);
+ bus_io_write_2(bc, ioh, EP_W0_RESOURCE_CFG, 0x3f00);
/*
* ok til here. Now try to figure out which link we have.
* try coax first...
*/
#ifdef EP_COAX_DEFAULT
- outw(ia->ia_iobase + EP_W0_ADDRESS_CFG, 0xC000);
+ bus_io_write_2(bc, ioh, EP_W0_ADDRESS_CFG, 0xC000);
#else
/* COAX as default is reported to be a problem */
- outw(ia->ia_iobase + EP_W0_ADDRESS_CFG, 0x0000);
+ bus_io_write_2(bc, ioh, EP_W0_ADDRESS_CFG, 0x0000);
#endif
ifp->if_snd.ifq_maxlen = ifqmaxlen;
void *aux;
{
struct ep_softc *sc = (void *)self;
- u_short conn = 0;
struct isa_attach_args *ia = aux;
+ bus_chipset_tag_t bc = ia->ia_bc;
+ bus_io_handle_t ioh;
+ u_short conn = 0;
+
+ if (bus_io_map(bc, ia->ia_iobase, ia->ia_iosize, &ioh))
+ panic("ep_isa_attach: can't map i/o space");
- sc->ep_iobase = ia->ia_iobase;
+ sc->sc_bc = bc;
+ sc->sc_ioh = ioh;
+
GO_WINDOW(0);
- conn = inw(ia->ia_iobase + EP_W0_CONFIG_CTRL);
+ conn = bus_io_read_2(bc, ioh, EP_W0_CONFIG_CTRL);
printf(": ");
-/* $Id: pcmcia.c,v 1.4 1996/05/03 07:59:40 deraadt Exp $ */
+/* $Id: pcmcia.c,v 1.5 1996/05/07 07:34:17 deraadt Exp $ */
/*
* Copyright (c) 1996 John T. Kohl. All rights reserved.
* Copyright (c) 1994 Stefan Grefen. All rights reserved.
#include <sys/ioctl.h>
#include <sys/fcntl.h>
#include <sys/proc.h>
-#include <sys/cpu.h>
#include <dev/pcmcia/pcmciavar.h>
#include <dev/pcmcia/pcmciareg.h>
goto error;
}
-#define GETMEM(x) bus_mem_read_1(pca->scratch_bc, SCRATCH_MEM(pca), \
+#define GETMEM(x) bus_mem_read_1(pca->pa_bc, SCRATCH_MEM(pca), \
(pc_cf->cfg_off & (SCRATCH_SIZE(pca)-1)) + x)
#define PUTMEM(x,v) \
- bus_mem_write_1(pca->scratch_bc, SCRATCH_MEM(pca), \
+ bus_mem_write_1(pca->pa_bc, SCRATCH_MEM(pca), \
(pc_cf->cfg_off & (SCRATCH_SIZE(pca)-1)) + x, v)
if (ISSET(pc_cf->cfgtype, DOSRESET)) {