summaryrefslogtreecommitdiff
path: root/sys/dev/isa/rtfps.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/isa/rtfps.c')
-rw-r--r--sys/dev/isa/rtfps.c47
1 files changed, 25 insertions, 22 deletions
diff --git a/sys/dev/isa/rtfps.c b/sys/dev/isa/rtfps.c
index d8e87928a33..03207c4a6db 100644
--- a/sys/dev/isa/rtfps.c
+++ b/sys/dev/isa/rtfps.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: rtfps.c,v 1.13 1996/11/23 21:46:45 kstailey Exp $ */
-/* $NetBSD: rtfps.c,v 1.23 1996/05/12 23:53:29 mycroft Exp $ */
+/* $OpenBSD: rtfps.c,v 1.14 1996/11/29 22:55:07 niklas Exp $ */
+/* $NetBSD: rtfps.c,v 1.27 1996/10/21 22:41:18 thorpej Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@@ -39,7 +39,7 @@
#include <sys/device.h>
#include <sys/termios.h>
-#include <machine/bus.old.h>
+#include <machine/bus.h>
#include <machine/intr.h>
#include <dev/isa/isavar.h>
@@ -52,14 +52,15 @@ struct rtfps_softc {
struct device sc_dev;
void *sc_ih;
- bus_chipset_tag_t sc_bc;
+ bus_space_tag_t sc_iot;
+ isa_chipset_tag_t sc_ic;
int sc_iobase;
int sc_irqport;
- bus_io_handle_t sc_irqioh;
+ bus_space_handle_t sc_irqioh;
int sc_alive; /* mask of slave units attached */
void *sc_slaves[NSLAVES]; /* com device unit numbers */
- bus_io_handle_t sc_slaveioh[NSLAVES];
+ bus_space_handle_t sc_slaveioh[NSLAVES];
};
int rtfpsprobe __P((struct device *, void *, void *));
@@ -83,8 +84,8 @@ rtfpsprobe(parent, self, aux)
{
struct isa_attach_args *ia = aux;
int iobase = ia->ia_iobase;
- bus_chipset_tag_t bc = ia->ia_bc;
- bus_io_handle_t ioh;
+ bus_space_tag_t iot = ia->ia_iot;
+ bus_space_handle_t ioh;
int i, rv = 1;
/*
@@ -98,12 +99,12 @@ rtfpsprobe(parent, self, aux)
if (iobase == comconsaddr && !comconsattached)
goto checkmappings;
- if (bus_io_map(bc, iobase, COM_NPORTS, &ioh)) {
+ if (bus_space_map(iot, iobase, COM_NPORTS, 0, &ioh)) {
rv = 0;
goto out;
}
- rv = comprobe1(bc, ioh, iobase);
- bus_io_unmap(bc, ioh, COM_NPORTS);
+ rv = comprobe1(iot, ioh, iobase);
+ bus_space_unmap(iot, ioh, COM_NPORTS);
if (rv == 0)
goto out;
@@ -114,11 +115,11 @@ checkmappings:
if (iobase == comconsaddr && !comconsattached)
continue;
- if (bus_io_map(bc, iobase, COM_NPORTS, &ioh)) {
+ if (bus_space_map(iot, iobase, COM_NPORTS, 0, &ioh)) {
rv = 0;
goto out;
}
- bus_io_unmap(bc, ioh, COM_NPORTS);
+ bus_space_unmap(iot, ioh, COM_NPORTS);
}
out:
@@ -154,10 +155,11 @@ rtfpsattach(parent, self, aux)
IOBASEUNK, 0x2f2, 0x6f2, 0x6f3,
IOBASEUNK, IOBASEUNK, IOBASEUNK, IOBASEUNK
};
- bus_chipset_tag_t bc = ia->ia_bc;
+ bus_space_tag_t iot = ia->ia_iot;
int i;
- sc->sc_bc = ia->ia_bc;
+ sc->sc_iot = ia->ia_iot;
+ sc->sc_ic = ia->ia_ic;
sc->sc_iobase = ia->ia_iobase;
if (ia->ia_irq >= 16 || irqport[ia->ia_irq] == IOBASEUNK)
@@ -165,20 +167,21 @@ rtfpsattach(parent, self, aux)
sc->sc_irqport = irqport[ia->ia_irq];
for (i = 0; i < NSLAVES; i++)
- if (bus_io_map(bc, sc->sc_iobase + i * COM_NPORTS, COM_NPORTS,
- &sc->sc_slaveioh[i]))
+ if (bus_space_map(iot, sc->sc_iobase + i * COM_NPORTS,
+ COM_NPORTS, 0, &sc->sc_slaveioh[i]))
panic("rtfpsattach: couldn't map slave %d", i);
- if (bus_io_map(bc, sc->sc_irqport, 1, &sc->sc_irqioh))
+ if (bus_space_map(iot, sc->sc_irqport, 1, 0, &sc->sc_irqioh))
panic("rtfpsattach: couldn't map irq port at 0x%x\n",
sc->sc_irqport);
- bus_io_write_1(bc, sc->sc_irqioh, 0, 0);
+ bus_space_write_1(iot, sc->sc_irqioh, 0, 0);
printf("\n");
for (i = 0; i < NSLAVES; i++) {
ca.ca_slave = i;
- ca.ca_bc = sc->sc_bc;
+ ca.ca_iot = sc->sc_iot;
+ ca.ca_ic = sc->sc_ic;
ca.ca_ioh = sc->sc_slaveioh[i];
ca.ca_iobase = sc->sc_iobase + i * COM_NPORTS;
ca.ca_noien = 0;
@@ -197,10 +200,10 @@ rtfpsintr(arg)
void *arg;
{
struct rtfps_softc *sc = arg;
- bus_chipset_tag_t bc = sc->sc_bc;
+ bus_space_tag_t iot = sc->sc_iot;
int alive = sc->sc_alive;
- bus_io_write_1(bc, sc->sc_irqioh, 0, 0);
+ bus_space_write_1(iot, sc->sc_irqioh, 0, 0);
#define TRY(n) \
if (alive & (1 << (n))) \