summaryrefslogtreecommitdiff
path: root/sys/dev/isa
diff options
context:
space:
mode:
authorcgd <cgd@NetBSD.org>1995-04-17 12:06:30 +0000
committercgd <cgd@NetBSD.org>1995-04-17 12:06:30 +0000
commit8a640328edd60eb5a19fc29a8847efd3baeb4fa8 (patch)
tree8f8ab3df0b9f5b324f7c9ac9288e1c3123eb36a5 /sys/dev/isa
parent78ec8e770169b76edc642d16e220a93f577713f9 (diff)
clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done, but it's getting better...
Diffstat (limited to 'sys/dev/isa')
-rw-r--r--sys/dev/isa/ad1848.c13
-rw-r--r--sys/dev/isa/ad1848var.h10
-rw-r--r--sys/dev/isa/aha1542.c19
-rw-r--r--sys/dev/isa/aic6360.c19
-rw-r--r--sys/dev/isa/ast.c19
-rw-r--r--sys/dev/isa/boca.c19
-rw-r--r--sys/dev/isa/bt742a.c21
-rw-r--r--sys/dev/isa/com.c22
-rw-r--r--sys/dev/isa/cy.c6
-rw-r--r--sys/dev/isa/if_ed.c48
-rw-r--r--sys/dev/isa/if_eg.c21
-rw-r--r--sys/dev/isa/if_el.c19
-rw-r--r--sys/dev/isa/if_ep.c21
-rw-r--r--sys/dev/isa/if_hp.c8
-rw-r--r--sys/dev/isa/if_ie.c26
-rw-r--r--sys/dev/isa/if_le.c30
-rw-r--r--sys/dev/isa/isa.c33
-rw-r--r--sys/dev/isa/isadma.c8
-rw-r--r--sys/dev/isa/isareg.h54
-rw-r--r--sys/dev/isa/isavar.h87
-rw-r--r--sys/dev/isa/lpt.c22
-rw-r--r--sys/dev/isa/lpt_isa.c22
-rw-r--r--sys/dev/isa/mcd.c12
-rw-r--r--sys/dev/isa/pas.c16
-rw-r--r--sys/dev/isa/pss.c68
-rw-r--r--sys/dev/isa/rtfps.c19
-rw-r--r--sys/dev/isa/sb.c18
-rw-r--r--sys/dev/isa/sbdsp.c13
-rw-r--r--sys/dev/isa/sbdspvar.h8
-rw-r--r--sys/dev/isa/seagate.c20
-rw-r--r--sys/dev/isa/ultra14f.c26
-rw-r--r--sys/dev/isa/wd.c19
-rw-r--r--sys/dev/isa/wd7000.c6
-rw-r--r--sys/dev/isa/wss.c18
-rw-r--r--sys/dev/isa/wt.c21
35 files changed, 391 insertions, 420 deletions
diff --git a/sys/dev/isa/ad1848.c b/sys/dev/isa/ad1848.c
index d0892f2c802..63be64a2ec7 100644
--- a/sys/dev/isa/ad1848.c
+++ b/sys/dev/isa/ad1848.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ad1848.c,v 1.2 1995/03/25 00:00:53 mycroft Exp $ */
+/* $NetBSD: ad1848.c,v 1.3 1995/04/17 12:06:55 cgd Exp $ */
/*
* Copyright (c) 1994 John Brezak
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ad1848.c,v 1.2 1995/03/25 00:00:53 mycroft Exp $
+ * $Id: ad1848.c,v 1.3 1995/04/17 12:06:55 cgd Exp $
*/
/*
@@ -87,8 +87,8 @@
#include <sys/audioio.h>
#include <dev/audio_if.h>
-#include <i386/isa/isavar.h>
-#include <i386/isa/dmavar.h>
+#include <dev/isa/isavar.h>
+#include <dev/isa/isadmavar.h>
#include <i386/isa/icu.h>
#include <i386/isa/ad1848reg.h>
@@ -1341,9 +1341,10 @@ ad1848_dma_output(addr, p, cc, intr, arg)
}
int
-ad1848_intr(sc)
- register struct ad1848_softc *sc;
+ad1848_intr(arg)
+ void *arg;
{
+ register struct ad1848_softc *sc = arg;
int retval = 0;
u_char status;
diff --git a/sys/dev/isa/ad1848var.h b/sys/dev/isa/ad1848var.h
index 70a5c1639f0..d72815e3a87 100644
--- a/sys/dev/isa/ad1848var.h
+++ b/sys/dev/isa/ad1848var.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ad1848var.h,v 1.3 1995/03/28 18:17:42 jtc Exp $ */
+/* $NetBSD: ad1848var.h,v 1.4 1995/04/17 12:06:57 cgd Exp $ */
/*
* Copyright (c) 1994 John Brezak
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ad1848var.h,v 1.3 1995/03/28 18:17:42 jtc Exp $
+ * $Id: ad1848var.h,v 1.4 1995/04/17 12:06:57 cgd Exp $
*/
#define AD1848_NPORT 8
@@ -46,7 +46,7 @@ struct ad1848_volume {
struct ad1848_softc {
struct device sc_dev; /* base device */
struct isadev sc_id; /* ISA device */
- struct intrhand sc_ih; /* interrupt vectoring */
+ void *sc_ih; /* interrupt vectoring */
void *parent;
@@ -88,7 +88,7 @@ struct ad1848_softc {
u_char format_bits;
u_long sc_interrupts; /* number of interrupts taken */
- void (*sc_intr)(void*); /* dma completion intr handler */
+ void (*sc_intr)(void *); /* dma completion intr handler */
void *sc_arg; /* arg for sc_intr() */
};
@@ -135,7 +135,7 @@ int ad1848_halt_out_dma __P((void *));
int ad1848_cont_in_dma __P((void *));
int ad1848_cont_out_dma __P((void *));
-int ad1848_intr __P((struct ad1848_softc *));
+int ad1848_intr __P((void *));
int ad1848_set_rec_port __P((struct ad1848_softc *, int));
int ad1848_get_rec_port __P((struct ad1848_softc *));
diff --git a/sys/dev/isa/aha1542.c b/sys/dev/isa/aha1542.c
index aaa4ed87de8..6e4b17c1a6e 100644
--- a/sys/dev/isa/aha1542.c
+++ b/sys/dev/isa/aha1542.c
@@ -1,4 +1,4 @@
-/* $NetBSD: aha1542.c,v 1.41 1995/01/13 14:46:44 mycroft Exp $ */
+/* $NetBSD: aha1542.c,v 1.42 1995/04/17 12:08:28 cgd Exp $ */
/*
* Copyright (c) 1994 Charles Hannum. All rights reserved.
@@ -62,7 +62,7 @@
#include <machine/pio.h>
-#include <i386/isa/isavar.h>
+#include <dev/isa/isavar.h>
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
@@ -313,7 +313,7 @@ int aha_debug = 1;
struct aha_softc {
struct device sc_dev;
struct isadev sc_id;
- struct intrhand sc_ih;
+ void *sc_ih;
int sc_iobase;
int sc_irq, sc_drq;
@@ -327,7 +327,7 @@ struct aha_softc {
};
int aha_cmd(); /* XXX must be varargs to prototype */
-int ahaintr __P((struct aha_softc *));
+int ahaintr __P((void *));
void aha_free_ccb __P((struct aha_softc *, struct aha_ccb *, int));
struct aha_ccb *aha_get_ccb __P((struct aha_softc *, int));
struct aha_ccb *aha_ccb_phys_kv __P((struct aha_softc *, u_long));
@@ -581,10 +581,8 @@ ahaattach(parent, self, aux)
#ifdef NEWCONFIG
isa_establish(&aha->sc_id, &aha->sc_dev);
#endif
- aha->sc_ih.ih_fun = ahaintr;
- aha->sc_ih.ih_arg = aha;
- aha->sc_ih.ih_level = IPL_BIO;
- intr_establish(ia->ia_irq, IST_EDGE, &aha->sc_ih);
+ aha->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_BIO,
+ ahaintr, aha);
/*
* ask the adapter what subunits are present
@@ -596,9 +594,10 @@ ahaattach(parent, self, aux)
* Catch an interrupt from the adaptor
*/
int
-ahaintr(aha)
- struct aha_softc *aha;
+ahaintr(arg)
+ void *arg;
{
+ struct aha_softc *aha = arg;
struct aha_mbx_in *wmbi;
struct aha_mbx *wmbx;
struct aha_ccb *ccb;
diff --git a/sys/dev/isa/aic6360.c b/sys/dev/isa/aic6360.c
index 53e5ce8edf9..12bf11b8f5a 100644
--- a/sys/dev/isa/aic6360.c
+++ b/sys/dev/isa/aic6360.c
@@ -1,4 +1,4 @@
-/* $NetBSD: aic6360.c,v 1.30 1995/02/02 21:08:42 mycroft Exp $ */
+/* $NetBSD: aic6360.c,v 1.31 1995/04/17 12:08:32 cgd Exp $ */
/*
* Copyright (c) 1994, 1995 Charles Hannum. All rights reserved.
@@ -129,7 +129,7 @@
#include <scsi/scsi_message.h>
#include <scsi/scsiconf.h>
-#include <i386/isa/isavar.h>
+#include <dev/isa/isavar.h>
/* Definitions, most of them has turned out to be unneccesary, but here they
* are anyway.
@@ -486,7 +486,7 @@ struct aic_tinfo {
struct aic_softc {
struct device sc_dev;
struct isadev sc_id;
- struct intrhand sc_ih;
+ void *sc_ih;
int sc_iobase;
int sc_irq, sc_drq;
@@ -575,7 +575,7 @@ int aic_debug = 0x00; /* AIC_SHOWSTART|AIC_SHOWMISC|AIC_SHOWTRACE; /**/
int aicprobe __P((struct device *, void *, void *));
void aicattach __P((struct device *, struct device *, void *));
void aic_minphys __P((struct buf *));
-int aicintr __P((struct aic_softc *));
+int aicintr __P((void *));
void aic_init __P((struct aic_softc *));
void aic_done __P((struct aic_softc *, struct aic_acb *));
void aic_dequeue __P((struct aic_softc *, struct aic_acb *));
@@ -763,10 +763,8 @@ aicattach(parent, self, aux)
#ifdef NEWCONFIG
isa_establish(&sc->sc_id, &sc->sc_dev);
#endif
- sc->sc_ih.ih_fun = aicintr;
- sc->sc_ih.ih_arg = sc;
- sc->sc_ih.ih_level = IPL_BIO;
- intr_establish(ia->ia_irq, IST_EDGE, &sc->sc_ih);
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_BIO,
+ aicintr, sc);
config_found(self, &sc->sc_link, aicprint);
}
@@ -2047,9 +2045,10 @@ phasechange:
* 1) always uses programmed I/O
*/
int
-aicintr(sc)
- register struct aic_softc *sc;
+aicintr(arg)
+ void *arg;
{
+ register struct aic_softc *sc = arg;
u_char sstat0, sstat1;
register struct aic_acb *acb;
register struct scsi_link *sc_link;
diff --git a/sys/dev/isa/ast.c b/sys/dev/isa/ast.c
index 093cf693b8d..e270df805bd 100644
--- a/sys/dev/isa/ast.c
+++ b/sys/dev/isa/ast.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ast.c,v 1.16 1995/01/04 00:47:53 mycroft Exp $ */
+/* $NetBSD: ast.c,v 1.17 1995/04/17 12:08:36 cgd Exp $ */
/*
* Copyright (c) 1995 Charles Hannum. All rights reserved.
@@ -37,11 +37,11 @@
#include <machine/pio.h>
-#include <i386/isa/isavar.h>
+#include <dev/isa/isavar.h>
struct ast_softc {
struct device sc_dev;
- struct intrhand sc_ih;
+ void *sc_ih;
int sc_iobase;
int sc_alive; /* mask of slave units attached */
@@ -50,7 +50,7 @@ struct ast_softc {
int astprobe();
void astattach();
-int astintr __P((struct ast_softc *));
+int astintr __P((void *));
struct cfdriver astcd = {
NULL, "ast", astprobe, astattach, DV_TTY, sizeof(struct ast_softc)
@@ -137,16 +137,15 @@ astattach(parent, self, aux)
}
}
- sc->sc_ih.ih_fun = astintr;
- sc->sc_ih.ih_arg = sc;
- sc->sc_ih.ih_level = IPL_TTY;
- intr_establish(ia->ia_irq, IST_EDGE, &sc->sc_ih);
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_TTY,
+ astintr, sc);
}
int
-astintr(sc)
- struct ast_softc *sc;
+astintr(arg)
+ void *arg;
{
+ struct ast_softc *sc = arg;
int iobase = sc->sc_iobase;
int alive = sc->sc_alive;
int bits;
diff --git a/sys/dev/isa/boca.c b/sys/dev/isa/boca.c
index 51adfbdb701..8bc15038581 100644
--- a/sys/dev/isa/boca.c
+++ b/sys/dev/isa/boca.c
@@ -1,4 +1,4 @@
-/* $NetBSD: boca.c,v 1.3 1995/01/04 00:47:54 mycroft Exp $ */
+/* $NetBSD: boca.c,v 1.4 1995/04/17 12:08:37 cgd Exp $ */
/*
* Copyright (c) 1995 Charles Hannum. All rights reserved.
@@ -37,11 +37,11 @@
#include <machine/pio.h>
-#include <i386/isa/isavar.h>
+#include <dev/isa/isavar.h>
struct boca_softc {
struct device sc_dev;
- struct intrhand sc_ih;
+ void *sc_ih;
int sc_iobase;
int sc_alive; /* mask of slave units attached */
@@ -50,7 +50,7 @@ struct boca_softc {
int bocaprobe();
void bocaattach();
-int bocaintr __P((struct boca_softc *));
+int bocaintr __P((void *));
struct cfdriver bocacd = {
NULL, "boca", bocaprobe, bocaattach, DV_TTY, sizeof(struct boca_softc)
@@ -132,16 +132,15 @@ bocaattach(parent, self, aux)
}
}
- sc->sc_ih.ih_fun = bocaintr;
- sc->sc_ih.ih_arg = sc;
- sc->sc_ih.ih_level = IPL_TTY;
- intr_establish(ia->ia_irq, IST_EDGE, &sc->sc_ih);
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_TTY,
+ bocaintr, sc);
}
int
-bocaintr(sc)
- struct boca_softc *sc;
+bocaintr(arg)
+ void *arg;
{
+ struct boca_softc *sc = arg;
int iobase = sc->sc_iobase;
int alive = sc->sc_alive;
int bits;
diff --git a/sys/dev/isa/bt742a.c b/sys/dev/isa/bt742a.c
index 3d5e870882f..5785cd64c94 100644
--- a/sys/dev/isa/bt742a.c
+++ b/sys/dev/isa/bt742a.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bt742a.c,v 1.38 1995/01/13 14:46:51 mycroft Exp $ */
+/* $NetBSD: bt742a.c,v 1.39 1995/04/17 12:08:39 cgd Exp $ */
/*
* Copyright (c) 1994 Charles Hannum. All rights reserved.
@@ -62,8 +62,8 @@
#include <machine/pio.h>
-#include <i386/isa/isavar.h>
-#include <i386/isa/dmavar.h>
+#include <dev/isa/isavar.h>
+#include <dev/isa/isadmavar.h>
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
@@ -333,7 +333,7 @@ struct bt_config {
struct bt_softc {
struct device sc_dev;
struct isadev sc_id;
- struct intrhand sc_ih;
+ void *sc_ih;
int sc_iobase;
int sc_irq, bt_drq;
@@ -354,7 +354,7 @@ struct bt_softc {
int bt_debug = 0;
int bt_cmd(); /* XXX must be varargs to prototype */
-int btintr __P((struct bt_softc *));
+int btintr __P((void *));
void bt_free_ccb __P((struct bt_softc *, struct bt_ccb *, int));
struct bt_ccb *bt_get_ccb __P((struct bt_softc *, int));
struct bt_ccb *bt_ccb_phys_kv __P((struct bt_softc *, u_long));
@@ -608,10 +608,8 @@ btattach(parent, self, aux)
#ifdef NEWCONFIG
isa_establish(&bt->sc_id, &bt->sc_dev);
#endif
- bt->sc_ih.ih_fun = btintr;
- bt->sc_ih.ih_arg = bt;
- bt->sc_ih.ih_level = IPL_BIO;
- intr_establish(ia->ia_irq, IST_EDGE, &bt->sc_ih);
+ bt->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_BIO,
+ btintr, bt);
/*
* ask the adapter what subunits are present
@@ -623,9 +621,10 @@ btattach(parent, self, aux)
* Catch an interrupt from the adaptor
*/
int
-btintr(bt)
- struct bt_softc *bt;
+btintr(arg)
+ void *arg;
{
+ struct bt_softc *bt = arg;
struct bt_mbx_in *wmbi;
struct bt_mbx *wmbx;
struct bt_ccb *ccb;
diff --git a/sys/dev/isa/com.c b/sys/dev/isa/com.c
index 65581425085..32d791a9566 100644
--- a/sys/dev/isa/com.c
+++ b/sys/dev/isa/com.c
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.48 1995/04/10 01:05:55 mycroft Exp $ */
+/* $NetBSD: com.c,v 1.49 1995/04/17 12:08:44 cgd Exp $ */
/*-
* Copyright (c) 1993, 1994 Charles Hannum.
@@ -60,13 +60,13 @@
#include <machine/cpu.h>
#include <machine/pio.h>
-#include <i386/isa/isavar.h>
+#include <dev/isa/isavar.h>
#include <dev/isa/comreg.h>
#include <dev/ic/ns16550.h>
struct com_softc {
struct device sc_dev;
- struct intrhand sc_ih;
+ void *sc_ih;
int sc_overflows;
int sc_iobase;
@@ -89,7 +89,7 @@ void comattach __P((struct device *, struct device *, void *));
int comopen __P((dev_t, int, int, struct proc *));
int comclose __P((dev_t, int, int, struct proc *));
void comdiag __P((void *));
-int comintr __P((struct com_softc *));
+int comintr __P((void *));
int comparam __P((struct tty *, struct termios *));
void comstart __P((struct tty *));
@@ -211,12 +211,9 @@ comattach(parent, self, aux)
outb(iobase + com_ier, 0);
outb(iobase + com_mcr, 0);
- if (ia->ia_irq != IRQUNK) {
- sc->sc_ih.ih_fun = comintr;
- sc->sc_ih.ih_arg = sc;
- sc->sc_ih.ih_level = IPL_TTY;
- intr_establish(ia->ia_irq, IST_EDGE, &sc->sc_ih);
- }
+ if (ia->ia_irq != IRQUNK)
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE,
+ ISA_IPL_TTY, comintr, sc);
#ifdef KGDB
if (kgdb_dev == makedev(commajor, unit)) {
@@ -768,9 +765,10 @@ comdiag(arg)
}
int
-comintr(sc)
- struct com_softc *sc;
+comintr(arg)
+ void *arg;
{
+ struct com_softc *sc = arg;
int iobase = sc->sc_iobase;
struct tty *tp;
u_char code;
diff --git a/sys/dev/isa/cy.c b/sys/dev/isa/cy.c
index 1056b038663..f9d0fec3859 100644
--- a/sys/dev/isa/cy.c
+++ b/sys/dev/isa/cy.c
@@ -1,4 +1,6 @@
-/* $NetBSD: cy.c,v 1.10 1995/01/29 02:58:24 cgd Exp $ */
+/* $NetBSD: cy.c,v 1.11 1995/04/17 12:08:46 cgd Exp $ */
+
+/* XXX THIS DRIVER IS BROKEN. IT WILL NOT EVEN COMPILE. */
/*
* cyclades cyclom-y serial driver
@@ -77,7 +79,7 @@
#include <machine/pio.h>
#include <machine/cpufunc.h>
-#include <i386/isa/isa_device.h>
+#include <i386/isa/isa_device.h> /* XXX BROKEN */
#include <dev/ic/cd1400.h>
#define RxFifoThreshold 3 /* 3 characters (out of 12) in the receive
diff --git a/sys/dev/isa/if_ed.c b/sys/dev/isa/if_ed.c
index b83a4f732d6..48c8e5800e1 100644
--- a/sys/dev/isa/if_ed.c
+++ b/sys/dev/isa/if_ed.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ed.c,v 1.72 1995/04/11 04:46:09 mycroft Exp $ */
+/* $NetBSD: if_ed.c,v 1.73 1995/04/17 12:08:50 cgd Exp $ */
/*
* Device driver for National Semiconductor DS8390/WD83C690 based ethernet
@@ -54,8 +54,9 @@
#include <machine/cpu.h>
#include <machine/pio.h>
-#include <i386/isa/isareg.h>
-#include <i386/isa/isavar.h>
+#include <dev/isa/isareg.h>
+#include <dev/isa/isavar.h>
+#include <i386/isa/isa_machdep.h> /* XXX USES ISA HOLE DIRECTLY */
#include <dev/ic/dp8390.h>
#include <dev/isa/if_edreg.h>
@@ -64,7 +65,7 @@
*/
struct ed_softc {
struct device sc_dev;
- struct intrhand sc_ih;
+ void *sc_ih;
struct arpcom sc_arpcom; /* ethernet common */
@@ -110,10 +111,10 @@ struct ed_softc {
int edprobe __P((struct device *, void *, void *));
void edattach __P((struct device *, struct device *, void *));
-int edintr __P((struct ed_softc *));
+int edintr __P((void *));
int ed_ioctl __P((struct ifnet *, u_long, caddr_t));
void ed_start __P((struct ifnet *));
-void ed_watchdog __P((/* short */));
+void ed_watchdog __P((int));
void ed_reset __P((struct ed_softc *));
void ed_init __P((struct ed_softc *));
void ed_stop __P((struct ed_softc *));
@@ -121,15 +122,15 @@ void ed_getmcaf __P((struct arpcom *, u_long *));
#define inline /* XXX for debugging porpoises */
-void ed_get_packet __P((/* struct ed_softc *, caddr_t, u_short */));
+void ed_get_packet __P((struct ed_softc *, caddr_t, u_short));
static inline void ed_rint __P((struct ed_softc *));
static inline void ed_xmit __P((struct ed_softc *));
-static inline caddr_t ed_ring_copy __P((/* struct ed_softc *, caddr_t, caddr_t,
- u_short */));
+static inline caddr_t ed_ring_copy __P((struct ed_softc *, caddr_t, caddr_t,
+ u_short));
-void ed_pio_readmem __P((/* struct ed_softc *, u_short, caddr_t, u_short */));
-void ed_pio_writemem __P((/* struct ed_softc *, caddr_t, u_short, u_short */));
-u_short ed_pio_write_mbufs __P((/* struct ed_softc *, struct mbuf *, u_short */));
+void ed_pio_readmem __P((struct ed_softc *, u_short, caddr_t, u_short));
+void ed_pio_writemem __P((struct ed_softc *, caddr_t, u_short, u_short));
+u_short ed_pio_write_mbufs __P((struct ed_softc *, struct mbuf *, u_short));
struct cfdriver edcd = {
NULL, "ed", edprobe, edattach, DV_IFNET, sizeof(struct ed_softc)
@@ -1091,10 +1092,8 @@ edattach(parent, self, aux)
bpfattach(&ifp->if_bpf, ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
- sc->sc_ih.ih_fun = edintr;
- sc->sc_ih.ih_arg = sc;
- sc->sc_ih.ih_level = IPL_NET;
- intr_establish(ia->ia_irq, IST_EDGE, &sc->sc_ih);
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_NET,
+ edintr, sc);
}
/*
@@ -1138,7 +1137,7 @@ ed_stop(sc)
*/
void
ed_watchdog(unit)
- short unit;
+ int unit;
{
struct ed_softc *sc = edcd.cd_devs[unit];
@@ -1443,7 +1442,7 @@ outloop:
break;
}
} else
- len = ed_pio_write_mbufs(sc, m, (u_short)buffer);
+ len = ed_pio_write_mbufs(sc, m, (long)buffer);
sc->txb_len[sc->txb_new] = max(len, ETHER_MIN_LEN);
sc->txb_inuse++;
@@ -1511,7 +1510,7 @@ loop:
if (sc->mem_shared)
packet_hdr = *(struct ed_ring *)packet_ptr;
else
- ed_pio_readmem(sc, (u_short)packet_ptr,
+ ed_pio_readmem(sc, (long)packet_ptr,
(caddr_t) &packet_hdr, sizeof(packet_hdr));
len = packet_hdr.count;
@@ -1586,9 +1585,10 @@ loop:
/* Ethernet interface interrupt processor. */
int
-edintr(sc)
- struct ed_softc *sc;
+edintr(arg)
+ void *arg;
{
+ struct ed_softc *sc = arg;
u_char isr;
/* Set NIC to page 0 registers. */
@@ -1916,7 +1916,7 @@ ed_get_packet(sc, buf, len)
if (sc->mem_shared)
bcopy(buf, mtod(m, caddr_t), sizeof(struct ether_header));
else
- ed_pio_readmem(sc, (u_short)buf, mtod(m, caddr_t),
+ ed_pio_readmem(sc, (long)buf, mtod(m, caddr_t),
sizeof(struct ether_header));
buf += sizeof(struct ether_header);
m->m_len += sizeof(struct ether_header);
@@ -2171,7 +2171,7 @@ ed_ring_copy(sc, src, dst, amount)
if (sc->mem_shared)
bcopy(src, dst, tmp_amount);
else
- ed_pio_readmem(sc, (u_short)src, dst, tmp_amount);
+ ed_pio_readmem(sc, (long)src, dst, tmp_amount);
amount -= tmp_amount;
src = sc->mem_ring;
@@ -2181,7 +2181,7 @@ ed_ring_copy(sc, src, dst, amount)
if (sc->mem_shared)
bcopy(src, dst, amount);
else
- ed_pio_readmem(sc, (u_short)src, dst, amount);
+ ed_pio_readmem(sc, (long)src, dst, amount);
return (src + amount);
}
diff --git a/sys/dev/isa/if_eg.c b/sys/dev/isa/if_eg.c
index fd3a902274e..69d9a9db1c7 100644
--- a/sys/dev/isa/if_eg.c
+++ b/sys/dev/isa/if_eg.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_eg.c,v 1.11 1995/04/11 05:10:20 mycroft Exp $ */
+/* $NetBSD: if_eg.c,v 1.12 1995/04/17 12:08:53 cgd Exp $ */
/*
* Copyright (c) 1993 Dean Huxley <dean@fsa.ca>
@@ -73,7 +73,7 @@
#include <machine/cpu.h>
#include <machine/pio.h>
-#include <i386/isa/isavar.h>
+#include <dev/isa/isavar.h>
#include <dev/isa/if_egreg.h>
#include <dev/isa/elink.h>
@@ -96,7 +96,7 @@
*/
struct eg_softc {
struct device sc_dev;
- struct intrhand sc_ih;
+ void *sc_ih;
struct arpcom sc_arpcom; /* Ethernet common part */
int eg_cmd; /* Command register R/W */
int eg_ctl; /* Control register R/W (EG_CTL_*) */
@@ -118,7 +118,7 @@ struct cfdriver egcd = {
NULL, "eg", egprobe, egattach, DV_IFNET, sizeof(struct eg_softc)
};
-int egintr __P((struct eg_softc *));
+int egintr __P((void *));
static void eginit __P((struct eg_softc *));
static int egioctl __P((struct ifnet *, u_long, caddr_t));
static int egrecv __P((struct eg_softc *));
@@ -404,11 +404,9 @@ egattach(parent, self, aux)
#if NBPFILTER > 0
bpfattach(&ifp->if_bpf, ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
-
- sc->sc_ih.ih_fun = egintr;
- sc->sc_ih.ih_arg = sc;
- sc->sc_ih.ih_level = IPL_NET;
- intr_establish(ia->ia_irq, IST_EDGE, &sc->sc_ih);
+
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_NET,
+ egintr, sc);
}
static void
@@ -556,9 +554,10 @@ egstart(ifp)
}
int
-egintr(sc)
- register struct eg_softc *sc;
+egintr(arg)
+ void *arg;
{
+ register struct eg_softc *sc = arg;
int i, len;
short *ptr;
diff --git a/sys/dev/isa/if_el.c b/sys/dev/isa/if_el.c
index e569e0ff439..b9569833df3 100644
--- a/sys/dev/isa/if_el.c
+++ b/sys/dev/isa/if_el.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_el.c,v 1.22 1995/04/11 05:10:24 mycroft Exp $ */
+/* $NetBSD: if_el.c,v 1.23 1995/04/17 12:08:56 cgd Exp $ */
/*
* Copyright (c) 1994, Matthew E. Kimmel. Permission is hereby granted
@@ -53,7 +53,7 @@
#include <machine/cpu.h>
#include <machine/pio.h>
-#include <i386/isa/isavar.h>
+#include <dev/isa/isavar.h>
#include <dev/isa/if_elreg.h>
#define ETHER_MIN_LEN 64
@@ -72,7 +72,7 @@
*/
struct el_softc {
struct device sc_dev;
- struct intrhand sc_ih;
+ void *sc_ih;
struct arpcom sc_arpcom; /* ethernet common */
int sc_iobase; /* base I/O addr */
@@ -82,7 +82,7 @@ struct el_softc {
/*
* prototypes
*/
-int elintr __P((struct el_softc *));
+int elintr __P((void *));
static int el_init __P((struct el_softc *));
static int el_ioctl __P((struct ifnet *, u_long, caddr_t));
static void el_start __P((struct ifnet *));
@@ -206,10 +206,8 @@ elattach(parent, self, aux)
bpfattach(&ifp->if_bpf, ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
- sc->sc_ih.ih_fun = elintr;
- sc->sc_ih.ih_arg = sc;
- sc->sc_ih.ih_level = IPL_NET;
- intr_establish(ia->ia_irq, IST_EDGE, &sc->sc_ih);
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_NET,
+ elintr, sc);
dprintf(("elattach() finished.\n"));
}
@@ -451,9 +449,10 @@ el_xmit(sc, len)
* Controller interrupt.
*/
int
-elintr(sc)
- register struct el_softc *sc;
+elintr(arg)
+ void *arg;
{
+ register struct el_softc *sc = arg;
int iobase = sc->sc_iobase;
int stat, rxstat, len, done;
diff --git a/sys/dev/isa/if_ep.c b/sys/dev/isa/if_ep.c
index e3b476ae7ab..bcec73aa43f 100644
--- a/sys/dev/isa/if_ep.c
+++ b/sys/dev/isa/if_ep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ep.c,v 1.71 1995/04/11 05:10:26 mycroft Exp $ */
+/* $NetBSD: if_ep.c,v 1.72 1995/04/17 12:08:59 cgd Exp $ */
/*
* Copyright (c) 1994 Herb Peyerl <hpeyerl@novatel.ca>
@@ -68,7 +68,7 @@
#include <machine/cpu.h>
#include <machine/pio.h>
-#include <i386/isa/isavar.h>
+#include <dev/isa/isavar.h>
#include <dev/isa/if_epreg.h>
#include <dev/isa/elink.h>
@@ -80,7 +80,7 @@
*/
struct ep_softc {
struct device sc_dev;
- struct intrhand sc_ih;
+ void *sc_ih;
struct arpcom sc_arpcom; /* Ethernet common part */
int ep_iobase; /* i/o bus address */
@@ -102,7 +102,7 @@ struct cfdriver epcd = {
NULL, "ep", epprobe, epattach, DV_IFNET, sizeof(struct ep_softc)
};
-int epintr __P((struct ep_softc *));
+int epintr __P((void *));
static void epxstat __P((struct ep_softc *));
static int epstatus __P((struct ep_softc *));
static void epinit __P((struct ep_softc *));
@@ -337,10 +337,8 @@ epattach(parent, self, aux)
sc->tx_start_thresh = 20; /* probably a good starting point. */
- sc->sc_ih.ih_fun = epintr;
- sc->sc_ih.ih_arg = sc;
- sc->sc_ih.ih_level = IPL_NET;
- intr_establish(ia->ia_irq, IST_EDGE, &sc->sc_ih);
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_NET,
+ epintr, sc);
}
/*
@@ -675,9 +673,10 @@ eptxstat(sc)
}
int
-epintr(sc)
- register struct ep_softc *sc;
+epintr(arg)
+ void *arg;
{
+ register struct ep_softc *sc = arg;
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
u_short status;
int ret = 0;
@@ -1041,7 +1040,7 @@ epwatchdog(unit)
log(LOG_ERR, "%s: device timeout\n", sc->sc_dev.dv_xname);
epreset(sc);
- return 0;
+ return;
}
static void
diff --git a/sys/dev/isa/if_hp.c b/sys/dev/isa/if_hp.c
index 02f84baf759..d0117ae2839 100644
--- a/sys/dev/isa/if_hp.c
+++ b/sys/dev/isa/if_hp.c
@@ -1,4 +1,6 @@
-/* $NetBSD: if_hp.c,v 1.19 1995/01/29 07:37:06 cgd Exp $ */
+/* $NetBSD: if_hp.c,v 1.20 1995/04/17 12:09:01 cgd Exp $ */
+
+/* XXX THIS DRIVER IS BROKEN. IT WILL NOT EVEN COMPILE. */
/*-
* Copyright (c) 1990, 1991 William F. Jolitz.
@@ -90,9 +92,9 @@
#include <machine/cpu.h>
#include <machine/pio.h>
-#include <i386/isa/isa_device.h>
+#include <i386/isa/isa_device.h> /* XXX BROKEN */
#include <dev/isa/if_nereg.h>
-#include <i386/isa/icu.h>
+#include <i386/isa/icu.h> /* XXX BROKEN */
int hpprobe(), hpattach(), hpintr();
int hpstart(), hpinit(), ether_output(), hpioctl();
diff --git a/sys/dev/isa/if_ie.c b/sys/dev/isa/if_ie.c
index aef8c99ad8a..3ecde1a2120 100644
--- a/sys/dev/isa/if_ie.c
+++ b/sys/dev/isa/if_ie.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ie.c,v 1.37 1995/04/07 22:27:42 mycroft Exp $ */
+/* $NetBSD: if_ie.c,v 1.38 1995/04/17 12:09:03 cgd Exp $ */
/*-
* Copyright (c) 1993, 1994, 1995 Charles Hannum.
@@ -143,8 +143,9 @@ iomem, and to make 16-pointers, we subtract sc_maddr and and with 0xffff.
#include <machine/cpu.h>
#include <machine/pio.h>
-#include <i386/isa/isareg.h>
-#include <i386/isa/isavar.h>
+#include <dev/isa/isareg.h>
+#include <dev/isa/isavar.h>
+#include <i386/isa/isa_machdep.h> /* XXX USES ISA HOLE DIRECTLY */
#include <dev/ic/i82586.h>
#include <dev/isa/if_ieatt.h>
#include <dev/isa/if_ie507.h>
@@ -218,7 +219,7 @@ const char *ie_hardware_names[] = {
*/
struct ie_softc {
struct device sc_dev;
- struct intrhand sc_ih;
+ void *sc_ih;
int sc_iobase;
caddr_t sc_maddr;
@@ -256,8 +257,8 @@ struct ie_softc {
#endif
};
-void iewatchdog __P((/* short */));
-int ieintr __P((struct ie_softc *));
+void iewatchdog __P((int));
+int ieintr __P((void *));
void iestop __P((struct ie_softc *));
int ieinit __P((struct ie_softc *));
int ieioctl __P((struct ifnet *, u_long, caddr_t));
@@ -553,10 +554,8 @@ ieattach(parent, self, aux)
sizeof(struct ether_header));
#endif
- sc->sc_ih.ih_fun = ieintr;
- sc->sc_ih.ih_arg = sc;
- sc->sc_ih.ih_level = IPL_NET;
- intr_establish(ia->ia_irq, IST_EDGE, &sc->sc_ih);
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_NET,
+ ieintr, sc);
}
/*
@@ -565,7 +564,7 @@ ieattach(parent, self, aux)
*/
void
iewatchdog(unit)
- short unit;
+ int unit;
{
struct ie_softc *sc = iecd.cd_devs[unit];
@@ -578,9 +577,10 @@ iewatchdog(unit)
* What to do upon receipt of an interrupt.
*/
int
-ieintr(sc)
- struct ie_softc *sc;
+ieintr(arg)
+ void *arg;
{
+ struct ie_softc *sc = arg;
register u_short status;
/* Clear the interrupt latch on the 3C507. */
diff --git a/sys/dev/isa/if_le.c b/sys/dev/isa/if_le.c
index f608e64bf43..3170298d002 100644
--- a/sys/dev/isa/if_le.c
+++ b/sys/dev/isa/if_le.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_le.c,v 1.24 1995/04/10 18:21:52 mycroft Exp $ */
+/* $NetBSD: if_le.c,v 1.25 1995/04/17 12:09:06 cgd Exp $ */
/*
* LANCE Ethernet driver
@@ -52,9 +52,10 @@
#include <machine/cpu.h>
#include <machine/pio.h>
-#include <i386/isa/isareg.h>
-#include <i386/isa/isavar.h>
-#include <i386/isa/dmavar.h>
+#include <dev/isa/isareg.h>
+#include <dev/isa/isavar.h>
+#include <i386/isa/isa_machdep.h> /* XXX USES ISA HOLE DIRECTLY */
+#include <dev/isa/isadmavar.h>
#include <dev/isa/if_lereg.h>
@@ -75,7 +76,7 @@ char *chip_type[] = {"unknown", "Am7990 LANCE", "Am79960 PCnet-ISA"};
*/
struct le_softc {
struct device sc_dev;
- struct intrhand sc_ih;
+ void *sc_ih;
struct arpcom sc_arpcom; /* Ethernet common part */
int sc_iobase; /* IO base address of card */
@@ -92,12 +93,12 @@ struct le_softc {
#endif
};
-int leintr __P((struct le_softc *));
+int leintr __P((void *));
int leioctl __P((struct ifnet *, u_long, caddr_t));
void lestart __P((struct ifnet *));
-void lewatchdog __P((/* short */));
-static inline void lewrcsr __P((/* struct le_softc *, u_short, u_short */));
-static inline u_short lerdcsr __P((/* struct le_softc *, u_short */));
+void lewatchdog __P((short));
+static inline void lewrcsr __P((struct le_softc *, u_short, u_short));
+static inline u_short lerdcsr __P((struct le_softc *, u_short));
void leinit __P((struct le_softc *));
void lememinit __P((struct le_softc *));
void lereset __P((struct le_softc *));
@@ -416,10 +417,8 @@ leattach(parent, self, aux)
bpfattach(&sc->sc_arpcom.ac_if.if_bpf, ifp, DLT_EN10MB, sizeof(struct ether_header));
#endif
- sc->sc_ih.ih_fun = leintr;
- sc->sc_ih.ih_arg = sc;
- sc->sc_ih.ih_level = IPL_NET;
- intr_establish(ia->ia_irq, IST_EDGE, &sc->sc_ih);
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_NET,
+ leintr, sc);
}
void
@@ -581,9 +580,10 @@ leinit(sc)
* Controller interrupt.
*/
int
-leintr(sc)
- register struct le_softc *sc;
+leintr(arg)
+ void *arg;
{
+ register struct le_softc *sc = arg;
register u_short isr;
isr = lerdcsr(sc, 0);
diff --git a/sys/dev/isa/isa.c b/sys/dev/isa/isa.c
index 4d1861b1d5f..1774d44ee13 100644
--- a/sys/dev/isa/isa.c
+++ b/sys/dev/isa/isa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: isa.c,v 1.71 1995/01/16 10:36:26 mycroft Exp $ */
+/* $NetBSD: isa.c,v 1.72 1995/04/17 12:09:09 cgd Exp $ */
/*-
* Copyright (c) 1993, 1994 Charles Hannum. All rights reserved.
@@ -36,14 +36,8 @@
#include <sys/malloc.h>
#include <sys/device.h>
-#include <i386/isa/isareg.h>
-#include <i386/isa/isavar.h>
-
-#include <machine/limits.h>
-
-/* sorry, has to be here, no place else really suitable */
-#include <machine/pc/display.h>
-u_short *Crtat = (u_short *)MONO_BUF;
+#include <dev/isa/isareg.h>
+#include <dev/isa/isavar.h>
int isamatch __P((struct device *, void *, void *));
void isaattach __P((struct device *, struct device *, void *));
@@ -113,8 +107,29 @@ isaattach(parent, self, aux)
struct device *parent, *self;
void *aux;
{
+ struct isa_softc *sc = (struct isa_softc *)self;
printf("\n");
+ TAILQ_INIT(&sc->sc_subdevs);
config_scan(isascan, self);
}
+
+char *
+isa_intr_typename(type)
+ isa_intrtype type;
+{
+
+ switch (type) {
+ case ISA_IST_NONE :
+ return ("none");
+ case ISA_IST_PULSE:
+ return ("pulsed");
+ case ISA_IST_EDGE:
+ return ("edge-triggered");
+ case ISA_IST_LEVEL:
+ return ("level-triggered");
+ default:
+ panic("isa_intr_typename: invalid type %d", type);
+ }
+}
diff --git a/sys/dev/isa/isadma.c b/sys/dev/isa/isadma.c
index 877cf5e3c04..bcb72cc085b 100644
--- a/sys/dev/isa/isadma.c
+++ b/sys/dev/isa/isadma.c
@@ -1,4 +1,4 @@
-/* $NetBSD: isadma.c,v 1.11 1995/04/10 13:14:54 mycroft Exp $ */
+/* $NetBSD: isadma.c,v 1.12 1995/04/17 12:09:11 cgd Exp $ */
#include <sys/param.h>
#include <sys/systm.h>
@@ -12,9 +12,9 @@
#include <machine/pio.h>
-#include <i386/isa/isareg.h>
-#include <i386/isa/dmavar.h>
-#include <i386/isa/dmareg.h>
+#include <dev/isa/isareg.h>
+#include <dev/isa/isadmavar.h>
+#include <dev/isa/isadmareg.h>
/* region of physical memory known to be contiguous */
vm_offset_t isaphysmem;
diff --git a/sys/dev/isa/isareg.h b/sys/dev/isa/isareg.h
index 194706f2585..311ed697c37 100644
--- a/sys/dev/isa/isareg.h
+++ b/sys/dev/isa/isareg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: isareg.h,v 1.4 1994/10/27 04:17:49 cgd Exp $ */
+/* $NetBSD: isareg.h,v 1.5 1995/04/17 12:09:13 cgd Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -42,20 +42,11 @@
* ISA Bus conventions
*/
-#ifndef LOCORE
-#include <sys/cdefs.h>
-
-unsigned char rtcin __P((int));
-void sysbeep __P((int, int));
-unsigned kbd_8042cmd __P((int));
-#endif /* !LOCORE */
-
-
/*
* Input / Output Port Assignments
*/
-#ifndef IO_BEGIN
+#ifndef IO_ISABEGIN
#define IO_ISABEGIN 0x000 /* 0x000 - Beginning of I/O Registers */
/* CPU Board */
@@ -143,7 +134,7 @@ unsigned kbd_8042cmd __P((int));
#ifndef IO_ISASIZES
#define IO_ISASIZES
-#define IO_COMSIZE 8 /* 8250, 16X50 com controllers (*/
+#define IO_COMSIZE 8 /* 8250, 16X50 com controllers */
#define IO_CGASIZE 16 /* CGA controllers */
#define IO_DMASIZE 16 /* 8237 DMA controllers */
#define IO_DPGSIZE 32 /* 74LS612 DMA page reisters */
@@ -170,42 +161,3 @@ unsigned kbd_8042cmd __P((int));
#define IOM_END 0x100000 /* End of I/O Memory "hole" */
#define IOM_SIZE (IOM_END - IOM_BEGIN)
#endif /* !IOM_BEGIN */
-
-/*
- * RAM Physical Address Space (ignoring the above mentioned "hole")
- */
-
-#ifndef RAM_BEGIN
-#define RAM_BEGIN 0x0000000 /* Start of RAM Memory */
-#define RAM_END 0x1000000 /* End of RAM Memory */
-#define RAM_SIZE (RAM_END - RAM_BEGIN)
-#endif /* !RAM_BEGIN */
-
-/*
- * Oddball Physical Memory Addresses
- */
-#ifndef COMPAQ_RAMRELOC
-#define COMPAQ_RAMRELOC 0x80c00000 /* Compaq RAM relocation/diag */
-#define COMPAQ_RAMSETUP 0x80c00002 /* Compaq RAM setup */
-#define WEITEK_FPU 0xC0000000 /* WTL 2167 */
-#define CYRIX_EMC 0xC0000000 /* Cyrix EMC */
-#endif /* !COMPAQ_RAMRELOC */
-
-/* stuff that used to be in pccons.c */
-#define MONO_BASE 0x3B4
-#define MONO_BUF (KERNBASE + 0xB0000)
-#define CGA_BASE 0x3D4
-#define CGA_BUF (KERNBASE + 0xB8000)
-#define IOPHYSMEM 0xA0000
-
-/*
- * size of dma bounce buffer in pages
- * - currently 1 page per channel
- */
-#ifndef DMA_BOUNCE
-#define DMA_BOUNCE 8
-#endif
-
-#ifndef LOCORE
-extern vm_offset_t isaphysmem;
-#endif /* !LOCORE */
diff --git a/sys/dev/isa/isavar.h b/sys/dev/isa/isavar.h
index 15e9d11f160..8a6976e100e 100644
--- a/sys/dev/isa/isavar.h
+++ b/sys/dev/isa/isavar.h
@@ -1,6 +1,7 @@
-/* $NetBSD: isavar.h,v 1.14 1995/01/03 03:14:35 mycroft Exp $ */
+/* $NetBSD: isavar.h,v 1.15 1995/04/17 12:09:15 cgd Exp $ */
/*
+ * Copyright (c) 1995 Chris G. Demetriou
* Copyright (c) 1992 Berkeley Software Design, Inc.
* All rights reserved.
*
@@ -36,6 +37,12 @@
*/
/*
+ * Definitions for ISA autoconfiguration.
+ */
+
+#include <sys/queue.h>
+
+/*
* ISA driver attach arguments
*/
struct isa_attach_args {
@@ -54,19 +61,21 @@ struct isa_attach_args {
#define MADDRUNK -1 /* shared memory address is unknown */
/*
- * per-device ISA variables
+ * Per-device ISA variables
*/
struct isadev {
struct device *id_dev; /* back pointer to generic */
- struct isadev *id_bchain; /* forward link in bus chain */
+ TAILQ_ENTRY(isadev)
+ id_bchain; /* bus chain */
};
/*
- * ISA masterbus
+ * ISA master bus
*/
struct isa_softc {
struct device sc_dev; /* base device */
- struct isadev *sc_isadev; /* list of all children */
+ TAILQ_HEAD(, isadev)
+ sc_subdevs; /* list of all children */
};
#define cf_iobase cf_loc[0]
@@ -77,38 +86,54 @@ struct isa_softc {
#define cf_drq cf_loc[5]
/*
- * Interrupt handler chains. Interrupt handlers should return 0 for
- * `not I', 1 (`I took care of it'), or -1 (`I guess it was mine, but
- * I wasn't expecting it'). intr_establish() inserts a handler into
- * the list. The handler is called with its (single) argument.
+ * ISA interrupt handler manipulation.
+ *
+ * To establish an ISA interrupt handler, a driver calls isa_intr_establish()
+ * with the interrupt number, type, level, function, and function argument of
+ * the interrupt it wants to handle. Isa_intr_establish() returns an opaque
+ * handle to an event descriptor if it succeeds, and invokes panic() if it
+ * fails. (XXX It should return NULL, then drivers should handle that, but
+ * what should they do?) Interrupt handlers should return 0 for "interrupt
+ * not for me", 1 for "I took care of it", or -1 for "I guess it was mine,
+ * but I wasn't expecting it."
+ *
+ * To remove an interrupt handler, the driver calls isa_intr_disestablish()
+ * with the handle returned by isa_intr_establish() for that handler.
*/
-struct intrhand {
- int (*ih_fun)();
- void *ih_arg;
- u_long ih_count;
- struct intrhand *ih_next;
- int ih_level;
-};
-void intr_establish __P((int intr, int type, struct intrhand *));
-void intr_disestablish __P((int intr, struct intrhand *));
-void isa_establish __P((struct isadev *, struct device *));
+/* ISA interrupt sharing types */
+typedef enum {
+ ISA_IST_NONE = 0, /* not yet assigned */
+ ISA_IST_PULSE, /* pulsed */
+ ISA_IST_EDGE, /* edge-triggered */
+ ISA_IST_LEVEL /* level-triggered */
+} isa_intrtype;
-/*
- * software conventions
- */
-typedef enum { BUS_ISA, BUS_EISA, BUS_MCA } isa_type;
+/* ISA interrupt levels; system interrupt levels for ISA bus use */
+typedef enum {
+ ISA_IPL_NONE, /* block only the interrupt's IRQ*/
+ ISA_IPL_BIO, /* block I/O interrupts */
+ ISA_IPL_NET, /* network */
+ ISA_IPL_TTY, /* terminal */
+ ISA_IPL_CLOCK, /* clock */
+} isa_intrlevel;
-extern int atdevbase; /* kernel virtual address of "hole" */
-extern isa_type isa_bustype; /* type of bus */
+void *isa_intr_establish __P((int intr, isa_intrtype type,
+ isa_intrlevel level, int (*ih_fun)(void *),
+ void *ih_arg));
+void isa_intr_disestablish __P((void *handler));
+char *isa_intr_typename __P((isa_intrtype type));
+#ifdef NEWCONFIG
/*
- * Given a kernel virtual address for some location
- * in the "hole" I/O space, return a physical address.
+ * Establish a device as being on the ISA bus (XXX NOT IMPLEMENTED).
*/
-#define ISA_PHYSADDR(v) ((caddr_t) ((u_long)(v) - atdevbase + IOM_BEGIN))
+void isa_establish __P((struct isadev *, struct device *));
+#endif
+
/*
- * Given a physical address in the "hole",
- * return a kernel virtual address.
+ * software conventions
*/
-#define ISA_HOLE_VADDR(p) ((caddr_t) ((u_long)(p) - IOM_BEGIN + atdevbase))
+typedef enum { BUS_ISA, BUS_EISA } isa_type;
+
+extern isa_type isa_bustype; /* type of bus; XXX should be in softc */
diff --git a/sys/dev/isa/lpt.c b/sys/dev/isa/lpt.c
index 9423e799293..aee3a5be153 100644
--- a/sys/dev/isa/lpt.c
+++ b/sys/dev/isa/lpt.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lpt.c,v 1.29 1995/01/29 07:37:10 cgd Exp $ */
+/* $NetBSD: lpt.c,v 1.30 1995/04/17 12:09:17 cgd Exp $ */
/*
* Copyright (c) 1993, 1994 Charles Hannum.
@@ -67,7 +67,7 @@
#include <machine/cpu.h>
#include <machine/pio.h>
-#include <i386/isa/isavar.h>
+#include <dev/isa/isavar.h>
#include <dev/isa/lptreg.h>
#define TIMEOUT hz*16 /* wait up to 16 seconds for a ready */
@@ -85,7 +85,7 @@ int lptdebug = 1;
struct lpt_softc {
struct device sc_dev;
- struct intrhand sc_ih;
+ void *sc_ih;
size_t sc_count;
struct buf *sc_inbuf;
@@ -107,7 +107,7 @@ struct lpt_softc {
int lptprobe __P((struct device *, void *, void *));
void lptattach __P((struct device *, struct device *, void *));
-int lptintr __P((struct lpt_softc *));
+int lptintr __P((void *));
struct cfdriver lptcd = {
NULL, "lpt", lptprobe, lptattach, DV_TTY, sizeof(struct lpt_softc)
@@ -237,12 +237,9 @@ lptattach(parent, self, aux)
sc->sc_state = 0;
outb(iobase + lpt_control, LPC_NINIT);
- if (ia->ia_irq != IRQUNK) {
- sc->sc_ih.ih_fun = lptintr;
- sc->sc_ih.ih_arg = sc;
- sc->sc_ih.ih_level = IPL_NONE;
- intr_establish(ia->ia_irq, IST_EDGE, &sc->sc_ih);
- }
+ if (ia->ia_irq != IRQUNK)
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE,
+ ISA_IPL_NONE, lptintr, sc);
}
/*
@@ -482,9 +479,10 @@ lptwrite(dev, uio)
* another char.
*/
int
-lptintr(sc)
- struct lpt_softc *sc;
+lptintr(arg)
+ void *arg;
{
+ struct lpt_softc *sc = arg;
int iobase = sc->sc_iobase;
#if 0
diff --git a/sys/dev/isa/lpt_isa.c b/sys/dev/isa/lpt_isa.c
index ddd561fca96..f0cfc85a43d 100644
--- a/sys/dev/isa/lpt_isa.c
+++ b/sys/dev/isa/lpt_isa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lpt_isa.c,v 1.29 1995/01/29 07:37:10 cgd Exp $ */
+/* $NetBSD: lpt_isa.c,v 1.30 1995/04/17 12:09:17 cgd Exp $ */
/*
* Copyright (c) 1993, 1994 Charles Hannum.
@@ -67,7 +67,7 @@
#include <machine/cpu.h>
#include <machine/pio.h>
-#include <i386/isa/isavar.h>
+#include <dev/isa/isavar.h>
#include <dev/isa/lptreg.h>
#define TIMEOUT hz*16 /* wait up to 16 seconds for a ready */
@@ -85,7 +85,7 @@ int lptdebug = 1;
struct lpt_softc {
struct device sc_dev;
- struct intrhand sc_ih;
+ void *sc_ih;
size_t sc_count;
struct buf *sc_inbuf;
@@ -107,7 +107,7 @@ struct lpt_softc {
int lptprobe __P((struct device *, void *, void *));
void lptattach __P((struct device *, struct device *, void *));
-int lptintr __P((struct lpt_softc *));
+int lptintr __P((void *));
struct cfdriver lptcd = {
NULL, "lpt", lptprobe, lptattach, DV_TTY, sizeof(struct lpt_softc)
@@ -237,12 +237,9 @@ lptattach(parent, self, aux)
sc->sc_state = 0;
outb(iobase + lpt_control, LPC_NINIT);
- if (ia->ia_irq != IRQUNK) {
- sc->sc_ih.ih_fun = lptintr;
- sc->sc_ih.ih_arg = sc;
- sc->sc_ih.ih_level = IPL_NONE;
- intr_establish(ia->ia_irq, IST_EDGE, &sc->sc_ih);
- }
+ if (ia->ia_irq != IRQUNK)
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE,
+ ISA_IPL_NONE, lptintr, sc);
}
/*
@@ -482,9 +479,10 @@ lptwrite(dev, uio)
* another char.
*/
int
-lptintr(sc)
- struct lpt_softc *sc;
+lptintr(arg)
+ void *arg;
{
+ struct lpt_softc *sc = arg;
int iobase = sc->sc_iobase;
#if 0
diff --git a/sys/dev/isa/mcd.c b/sys/dev/isa/mcd.c
index ea25c106f32..ff076c76e17 100644
--- a/sys/dev/isa/mcd.c
+++ b/sys/dev/isa/mcd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mcd.c,v 1.36 1995/04/15 05:02:53 mycroft Exp $ */
+/* $NetBSD: mcd.c,v 1.37 1995/04/17 12:09:20 cgd Exp $ */
/*
* Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved.
@@ -75,7 +75,7 @@
#include <machine/cpu.h>
#include <machine/pio.h>
-#include <i386/isa/isavar.h>
+#include <dev/isa/isavar.h>
#include <dev/isa/mcdreg.h>
#ifndef MCDDEBUG
@@ -108,7 +108,7 @@ struct mcd_mbx {
struct mcd_softc {
struct device sc_dev;
struct dkdevice sc_dk;
- struct intrhand sc_ih;
+ void *sc_ih;
int iobase;
int irq, drq;
@@ -221,10 +221,8 @@ mcdattach(parent, self, aux)
sc->sc_dk.dk_driver = &mcddkdriver;
- sc->sc_ih.ih_fun = mcdintr;
- sc->sc_ih.ih_arg = sc;
- sc->sc_ih.ih_level = IPL_BIO;
- intr_establish(ia->ia_irq, IST_EDGE, &sc->sc_ih);
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_BIO,
+ mcdintr, sc);
}
/*
diff --git a/sys/dev/isa/pas.c b/sys/dev/isa/pas.c
index 3270a7d5492..683221b73ef 100644
--- a/sys/dev/isa/pas.c
+++ b/sys/dev/isa/pas.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pas.c,v 1.4 1995/03/25 00:01:19 mycroft Exp $ */
+/* $NetBSD: pas.c,v 1.5 1995/04/17 12:07:23 cgd Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: pas.c,v 1.4 1995/03/25 00:01:19 mycroft Exp $
+ * $Id: pas.c,v 1.5 1995/04/17 12:07:23 cgd Exp $
*/
/*
* Todo:
@@ -54,8 +54,8 @@
#include <sys/audioio.h>
#include <dev/audio_if.h>
-#include <i386/isa/isavar.h>
-#include <i386/isa/dmavar.h>
+#include <dev/isa/isavar.h>
+#include <dev/isa/isadmavar.h>
#include <i386/isa/icu.h>
#include <i386/isa/sbdspvar.h>
@@ -89,7 +89,7 @@ int pasdebug = 0;
struct pas_softc {
struct device sc_dev; /* base device */
struct isadev sc_id; /* ISA device */
- struct intrhand sc_ih; /* interrupt vectoring */
+ void *sc_ih; /* interrupt vectoring */
u_short sc_iobase; /* PAS iobase */
u_short sc_irq; /* PAS irq */
@@ -439,10 +439,8 @@ pasattach(parent, self, aux)
#ifdef NEWCONFIG
isa_establish(&sc->sc_id, &sc->sc_dev);
#endif
- sc->sc_ih.ih_fun = sbdsp_intr;
- sc->sc_ih.ih_arg = &sc->sc_sbdsp;
- sc->sc_ih.ih_level = IPL_BIO;
- intr_establish(ia->ia_irq, IST_EDGE, &sc->sc_ih);
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_BIO,
+ sbdsp_intr, &sc->sc_sbdsp);
#ifdef NEWCONFIG
/*
diff --git a/sys/dev/isa/pss.c b/sys/dev/isa/pss.c
index ca65ef4898e..6413b38b78e 100644
--- a/sys/dev/isa/pss.c
+++ b/sys/dev/isa/pss.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pss.c,v 1.3 1995/03/25 00:01:10 mycroft Exp $ */
+/* $NetBSD: pss.c,v 1.4 1995/04/17 12:07:34 cgd Exp $ */
/*
* Copyright (c) 1994 John Brezak
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: pss.c,v 1.3 1995/03/25 00:01:10 mycroft Exp $
+ * $Id: pss.c,v 1.4 1995/04/17 12:07:34 cgd Exp $
*/
/*
@@ -66,7 +66,7 @@
#include <sys/audioio.h>
#include <dev/audio_if.h>
-#include <i386/isa/isavar.h>
+#include <dev/isa/isavar.h>
#include <i386/isa/dmavar.h>
#include <i386/isa/icu.h>
@@ -107,40 +107,40 @@
struct pss_softc {
struct device sc_dev; /* base device */
struct isadev sc_id; /* ISA device */
- struct intrhand sc_ih; /* interrupt vectoring */
+ void *sc_ih; /* interrupt vectoring */
u_short sc_iobase; /* I/O port base address */
- u_short sc_drq; /* dma channel */
+ u_short sc_drq; /* dma channel */
- struct ad1848_softc *ad1848_sc;
+ struct ad1848_softc *ad1848_sc;
- int out_port;
+ int out_port;
- struct ad1848_volume master_volume;
- int master_mode;
+ struct ad1848_volume master_volume;
+ int master_mode;
- int monitor_treble;
- int monitor_bass;
+ int monitor_treble;
+ int monitor_bass;
- int mic_mute, cd_mute, dac_mute;
+ int mic_mute, cd_mute, dac_mute;
};
struct mpu_softc {
struct device sc_dev; /* base device */
struct isadev sc_id; /* ISA device */
- struct intrhand sc_ih; /* interrupt vectoring */
+ void *sc_ih; /* interrupt vectoring */
- u_short sc_iobase; /* MIDI I/O port base address */
- u_short sc_irq; /* MIDI interrupt */
+ u_short sc_iobase; /* MIDI I/O port base address */
+ u_short sc_irq; /* MIDI interrupt */
};
struct cd_softc {
struct device sc_dev; /* base device */
struct isadev sc_id; /* ISA device */
- struct intrhand sc_ih; /* interrupt vectoring */
+ void *sc_ih; /* interrupt vectoring */
- u_short sc_iobase; /* CD I/O port base address */
- u_short sc_irq; /* CD interrupt */
+ u_short sc_iobase; /* CD I/O port base address */
+ u_short sc_irq; /* CD interrupt */
};
#define DEBUG /*XXX*/
@@ -165,8 +165,8 @@ void pcdattach __P((struct device *, struct device *, void *));
int spopen __P((dev_t, int));
-int pssintr __P((struct pss_softc *));
-int mpuintr __P((struct mpu_softc *));
+int pssintr __P((void *));
+int mpuintr __P((void *));
int pss_speaker_ctl __P((void *, int));
@@ -1004,10 +1004,8 @@ pssattach(parent, self, aux)
#endif
/* Setup interrupt handler for PSS */
- sc->sc_ih.ih_fun = pssintr;
- sc->sc_ih.ih_arg = sc;
- sc->sc_ih.ih_level = IPL_CLOCK;
- intr_establish(ia->ia_irq, IST_EDGE, &sc->sc_ih);
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_CLOCK,
+ pssintr, sc);
vers = (inw(sc->sc_iobase+PSS_ID_VERS)&0xff) - 1;
printf(": esc614%c\n", (vers > 0)?'A'+vers:' ');
@@ -1041,10 +1039,8 @@ spattach(parent, self, aux)
isa_establish(&sc->sc_id, &sc->sc_dev);
#endif
- sc->sc_ih.ih_fun = ad1848_intr;
- sc->sc_ih.ih_arg = sc;
- sc->sc_ih.ih_level = IPL_CLOCK;
- intr_establish(cf->cf_irq, IST_EDGE, &sc->sc_ih);
+ sc->sc_ih = isa_intr_establish(cf->cf_irq, ISA_IST_EDGE, ISA_IPL_CLOCK,
+ ad1848_intr, sc);
/* XXX might use pssprint func ?? */
printf(" port 0x%x-0x%x irq %d drq %d",
@@ -1071,10 +1067,8 @@ mpuattach(parent, self, aux)
isa_establish(&sc->sc_id, &sc->sc_dev);
#endif
- sc->sc_ih.ih_fun = mpuintr;
- sc->sc_ih.ih_arg = sc;
- sc->sc_ih.ih_level = IPL_CLOCK;
- intr_establish(cf->cf_irq, IST_EDGE, &sc->sc_ih);
+ sc->sc_ih = isa_intr_establish(cf->cf_irq, ISA_IST_EDGE, ISA_IPL_CLOCK,
+ mpuintr, sc);
/* XXX might use pssprint func ?? */
printf(" port 0x%x-0x%x irq %d\n",
@@ -1304,9 +1298,10 @@ pss_speaker_ctl(addr, newstate)
}
int
-pssintr(sc)
- register struct pss_softc *sc;
+pssintr(arg)
+ void *arg;
{
+ register struct pss_softc *sc = arg;
u_short sr;
sr = inw(sc->sc_iobase+PSS_STATUS);
@@ -1326,9 +1321,10 @@ pssintr(sc)
}
int
-mpuintr(sc)
- register struct mpu_softc *sc;
+mpuintr(arg)
+ void *arg;
{
+ register struct mpu_softc *sc = arg;
u_char sr;
sr = inb(sc->sc_iobase+MIDI_STATUS_REG);
diff --git a/sys/dev/isa/rtfps.c b/sys/dev/isa/rtfps.c
index 2c6d9899343..af1f506f778 100644
--- a/sys/dev/isa/rtfps.c
+++ b/sys/dev/isa/rtfps.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rtfps.c,v 1.11 1995/01/04 00:47:58 mycroft Exp $ */
+/* $NetBSD: rtfps.c,v 1.12 1995/04/17 12:09:22 cgd Exp $ */
/*
* Copyright (c) 1995 Charles Hannum. All rights reserved.
@@ -37,11 +37,11 @@
#include <machine/pio.h>
-#include <i386/isa/isavar.h>
+#include <dev/isa/isavar.h>
struct rtfps_softc {
struct device sc_dev;
- struct intrhand sc_ih;
+ void *sc_ih;
int sc_iobase;
int sc_irqport;
@@ -51,7 +51,7 @@ struct rtfps_softc {
int rtfpsprobe();
void rtfpsattach();
-int rtfpsintr __P((struct rtfps_softc *));
+int rtfpsintr __P((void *));
struct cfdriver rtfpscd = {
NULL, "rtfps", rtfpsprobe, rtfpsattach, DV_TTY, sizeof(struct rtfps_softc)
@@ -145,16 +145,15 @@ rtfpsattach(parent, self, aux)
}
}
- sc->sc_ih.ih_fun = rtfpsintr;
- sc->sc_ih.ih_arg = sc;
- sc->sc_ih.ih_level = IPL_TTY;
- intr_establish(ia->ia_irq, IST_EDGE, &sc->sc_ih);
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_TTY,
+ rtfpsintr, sc);
}
int
-rtfpsintr(sc)
- struct rtfps_softc *sc;
+rtfpsintr(arg)
+ void *arg;
{
+ struct rtfps_softc *sc = arg;
int iobase = sc->sc_iobase;
int alive = sc->sc_alive;
diff --git a/sys/dev/isa/sb.c b/sys/dev/isa/sb.c
index 7dd70c3f42f..f0d876d5ad6 100644
--- a/sys/dev/isa/sb.c
+++ b/sys/dev/isa/sb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sb.c,v 1.22 1995/03/25 00:01:23 mycroft Exp $ */
+/* $NetBSD: sb.c,v 1.23 1995/04/17 12:07:37 cgd Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: sb.c,v 1.22 1995/03/25 00:01:23 mycroft Exp $
+ * $Id: sb.c,v 1.23 1995/04/17 12:07:37 cgd Exp $
*/
#include <sys/param.h>
@@ -49,8 +49,8 @@
#include <sys/audioio.h>
#include <dev/audio_if.h>
-#include <i386/isa/isavar.h>
-#include <i386/isa/dmavar.h>
+#include <dev/isa/isavar.h>
+#include <dev/isa/isadmavar.h>
#include <i386/isa/icu.h>
#include <i386/isa/sbdspvar.h>
@@ -67,9 +67,9 @@ int sbdebug = 0;
struct sb_softc {
struct device sc_dev; /* base device */
struct isadev sc_id; /* ISA device */
- struct intrhand sc_ih; /* interrupt vectoring */
+ void *sc_ih; /* interrupt vectoring */
- struct sbdsp_softc sc_sbdsp;
+ struct sbdsp_softc sc_sbdsp;
};
int sbprobe();
@@ -277,10 +277,8 @@ sbattach(parent, self, aux)
#ifdef NEWCONFIG
isa_establish(&sc->sc_id, &sc->sc_dev);
#endif
- sc->sc_ih.ih_fun = sbdsp_intr;
- sc->sc_ih.ih_arg = &sc->sc_sbdsp;
- sc->sc_ih.ih_level = IPL_BIO;
- intr_establish(ia->ia_irq, IST_EDGE, &sc->sc_ih);
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_BIO,
+ sbdsp_intr, &sc->sc_sbdsp);
sbdsp_attach(&sc->sc_sbdsp);
diff --git a/sys/dev/isa/sbdsp.c b/sys/dev/isa/sbdsp.c
index cbccd510e56..9e7488a3d85 100644
--- a/sys/dev/isa/sbdsp.c
+++ b/sys/dev/isa/sbdsp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sbdsp.c,v 1.5 1995/03/25 00:01:00 mycroft Exp $ */
+/* $NetBSD: sbdsp.c,v 1.6 1995/04/17 12:07:41 cgd Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: sbdsp.c,v 1.5 1995/03/25 00:01:00 mycroft Exp $
+ * $Id: sbdsp.c,v 1.6 1995/04/17 12:07:41 cgd Exp $
*/
/*
* SoundBlaster Pro code provided by John Kohl, based on lots of
@@ -57,8 +57,8 @@
#include <sys/audioio.h>
#include <dev/audio_if.h>
-#include <i386/isa/isavar.h>
-#include <i386/isa/dmavar.h>
+#include <dev/isa/isavar.h>
+#include <dev/isa/isadmavar.h>
#include <i386/isa/icu.h>
#include <i386/isa/sbreg.h>
@@ -1123,9 +1123,10 @@ sbdsp_dma_output(addr, p, cc, intr, arg)
* exclusive so we know a priori which event has occurred.
*/
int
-sbdsp_intr(sc)
- register struct sbdsp_softc *sc;
+sbdsp_intr(arg)
+ void *arg;
{
+ register struct sbdsp_softc *sc = arg;
#ifdef DEBUG
if (sbdspdebug > 1)
diff --git a/sys/dev/isa/sbdspvar.h b/sys/dev/isa/sbdspvar.h
index 2d642148116..dc16d9e049b 100644
--- a/sys/dev/isa/sbdspvar.h
+++ b/sys/dev/isa/sbdspvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: sbdspvar.h,v 1.4 1995/03/28 18:17:49 jtc Exp $ */
+/* $NetBSD: sbdspvar.h,v 1.5 1995/04/17 12:07:44 cgd Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: sbdspvar.h,v 1.4 1995/03/28 18:17:49 jtc Exp $
+ * $Id: sbdspvar.h,v 1.5 1995/04/17 12:07:44 cgd Exp $
*/
#define SB_MIC_PORT 0
@@ -74,7 +74,7 @@
struct sbdsp_softc {
struct device sc_dev; /* base device */
struct isadev sc_id; /* ISA device */
- struct intrhand sc_ih; /* interrupt vectoring */
+ void *sc_ih; /* interrupt vectoring */
u_short sc_iobase; /* I/O port base address */
u_short sc_irq; /* interrupt */
@@ -184,7 +184,7 @@ void sbdsp_spkroff __P((struct sbdsp_softc *));
int sbdsp_wdsp(u_short iobase, int v);
int sbdsp_rdsp(u_short iobase);
-int sbdsp_intr __P((struct sbdsp_softc *));
+int sbdsp_intr __P((void *));
short sbversion __P((struct sbdsp_softc *));
int sbdsp_set_sr __P((struct sbdsp_softc *, u_long *, int));
diff --git a/sys/dev/isa/seagate.c b/sys/dev/isa/seagate.c
index 5455fef98b1..6b9417f3a91 100644
--- a/sys/dev/isa/seagate.c
+++ b/sys/dev/isa/seagate.c
@@ -81,8 +81,9 @@
#include <scsi/scsi_message.h>
#include <scsi/scsiconf.h>
-#include <i386/isa/isareg.h>
-#include <i386/isa/isavar.h>
+#include <dev/isa/isareg.h>
+#include <dev/isa/isavar.h>
+#include <i386/isa/isa_machdep.h> /* XXX USES ISA HOLE DIRECTLY */
#define SEA_SCB_MAX 32 /* allow maximally 8 scsi control blocks */
#define SCB_TABLE_SIZE 8 /* start with 8 scb entries in table */
@@ -186,7 +187,7 @@ struct sea_scb {
struct sea_softc {
struct device sc_dev;
struct isadev sc_id;
- struct intrhand sc_ih;
+ void *sc_ih;
int type; /* board type */
caddr_t maddr; /* Base address for card */
@@ -266,7 +267,7 @@ static const char *bases[] = {
#define nbases (sizeof(bases) / sizeof(bases[0]))
-int seaintr __P((struct sea_softc *));
+int seaintr __P((void *));
int sea_scsi_cmd __P((struct scsi_xfer *));
void sea_timeout __P((void *));
void seaminphys __P((struct buf *));
@@ -430,10 +431,8 @@ seaattach(parent, self, aux)
#ifdef NEWCONFIG
isa_establish(&sea->sc_id, &sea->sc_deV);
#endif
- sea->sc_ih.ih_fun = seaintr;
- sea->sc_ih.ih_arg = sea;
- sea->sc_ih.ih_level = IPL_BIO;
- intr_establish(ia->ia_irq, IST_EDGE, &sea->sc_ih);
+ sea->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_BIO,
+ seaintr, sea);
/*
* ask the adapter what subunits are present
@@ -445,9 +444,10 @@ seaattach(parent, self, aux)
* Catch an interrupt from the adaptor
*/
int
-seaintr(sea)
- struct sea_softc *sea;
+seaintr(arg)
+ void *arg;
{
+ struct sea_softc *sea = arg;
#ifdef DEBUG /* extra overhead, and only needed for intr debugging */
if ((STATUS & STAT_PARITY) == 0 &&
diff --git a/sys/dev/isa/ultra14f.c b/sys/dev/isa/ultra14f.c
index 516000fe14c..3e311031a44 100644
--- a/sys/dev/isa/ultra14f.c
+++ b/sys/dev/isa/ultra14f.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ultra14f.c,v 1.48 1995/03/14 02:35:11 mycroft Exp $ */
+/* $NetBSD: ultra14f.c,v 1.49 1995/04/17 12:09:27 cgd Exp $ */
/*
* Copyright (c) 1994 Charles Hannum. All rights reserved.
@@ -65,7 +65,7 @@
#include <machine/pio.h>
-#include <i386/isa/isavar.h>
+#include <dev/isa/isavar.h>
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
@@ -259,7 +259,7 @@ struct uha_mscp {
struct uha_softc {
struct device sc_dev;
struct isadev sc_id;
- struct intrhand sc_ih;
+ void *sc_ih;
int sc_iobase;
int sc_irq, sc_drq;
@@ -285,8 +285,8 @@ int u14_abort __P((struct uha_softc *, struct uha_mscp *));
int u24_abort __P((struct uha_softc *, struct uha_mscp *));
int u14_poll __P((struct uha_softc *, struct scsi_xfer *, int));
int u24_poll __P((struct uha_softc *, struct scsi_xfer *, int));
-int u14intr __P((struct uha_softc *));
-int u24intr __P((struct uha_softc *));
+int u14intr __P((void *));
+int u24intr __P((void *));
void uha_done __P((struct uha_softc *, struct uha_mscp *));
void uha_free_mscp __P((struct uha_softc *, struct uha_mscp *, int flags));
struct uha_mscp *uha_get_mscp __P((struct uha_softc *, int));
@@ -604,10 +604,8 @@ uhaattach(parent, self, aux)
#ifdef NEWCONFIG
isa_establish(&uha->sc_id, &uha->sc_dev);
#endif
- uha->sc_ih.ih_fun = uha->intr;
- uha->sc_ih.ih_arg = uha;
- uha->sc_ih.ih_level = IPL_BIO;
- intr_establish(ia->ia_irq, IST_EDGE, &uha->sc_ih);
+ uha->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_BIO,
+ uha->intr, uha);
/*
* ask the adapter what subunits are present
@@ -619,9 +617,10 @@ uhaattach(parent, self, aux)
* Catch an interrupt from the adaptor
*/
int
-u14intr(uha)
- struct uha_softc *uha;
+u14intr(arg)
+ void *arg;
{
+ struct uha_softc *uha = arg;
struct uha_mscp *mscp;
u_char uhastat;
u_long mboxval;
@@ -665,9 +664,10 @@ u14intr(uha)
}
int
-u24intr(uha)
- struct uha_softc *uha;
+u24intr(arg)
+ void *arg;
{
+ struct uha_softc *uha = arg;
struct uha_mscp *mscp;
u_char uhastat;
u_long mboxval;
diff --git a/sys/dev/isa/wd.c b/sys/dev/isa/wd.c
index d945e394a78..0ae8f6eb282 100644
--- a/sys/dev/isa/wd.c
+++ b/sys/dev/isa/wd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wd.c,v 1.138 1995/04/15 05:02:56 mycroft Exp $ */
+/* $NetBSD: wd.c,v 1.139 1995/04/17 12:09:31 cgd Exp $ */
/*
* Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved.
@@ -54,7 +54,7 @@
#include <machine/cpu.h>
#include <machine/pio.h>
-#include <i386/isa/isavar.h>
+#include <dev/isa/isavar.h>
#include <dev/isa/wdreg.h>
#define WAITTIME (4 * hz) /* time to wait for a completion */
@@ -120,7 +120,7 @@ struct wd_softc {
struct wdc_softc {
struct device sc_dev;
- struct intrhand sc_ih;
+ void *sc_ih;
int sc_iobase; /* I/O port base */
int sc_drq; /* DMA channel */
@@ -158,7 +158,7 @@ void wdstart __P((struct wd_softc *));
struct dkdriver wddkdriver = { wdstrategy };
void wdfinish __P((struct wd_softc *, struct buf *));
-int wdcintr __P((struct wdc_softc *));
+int wdcintr __P((void *));
void wdcstart __P((struct wdc_softc *));
int wdcommand __P((struct wd_softc *, int, int, int, int, int));
int wdcommandshort __P((struct wdc_softc *, int, int));
@@ -249,10 +249,8 @@ wdcattach(parent, self, aux)
printf("\n");
- wdc->sc_ih.ih_fun = wdcintr;
- wdc->sc_ih.ih_arg = wdc;
- wdc->sc_ih.ih_level = IPL_BIO;
- intr_establish(ia->ia_irq, IST_EDGE, &wdc->sc_ih);
+ wdc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_BIO,
+ wdcintr, wdc);
for (wa.wa_drive = 0; wa.wa_drive < 2; wa.wa_drive++)
(void)config_found(self, (void *)&wa, wdprint);
@@ -700,9 +698,10 @@ loop:
* the next chunk if so.
*/
int
-wdcintr(wdc)
- struct wdc_softc *wdc;
+wdcintr(arg)
+ void *arg;
{
+ struct wdc_softc *wdc = arg;
struct wd_softc *wd;
struct buf *bp;
diff --git a/sys/dev/isa/wd7000.c b/sys/dev/isa/wd7000.c
index 3df977602ba..119dd10767d 100644
--- a/sys/dev/isa/wd7000.c
+++ b/sys/dev/isa/wd7000.c
@@ -1,4 +1,6 @@
-/* $NetBSD: wd7000.c,v 1.19 1994/11/18 22:03:49 mycroft Exp $ */
+/* $NetBSD: wd7000.c,v 1.20 1995/04/17 12:09:35 cgd Exp $ */
+
+/* XXX THIS DRIVER IS BROKEN. IT WILL NOT EVEN COMPILE. */
/*
* UNFINISHED! UNFINISHED! UNFINISHED! UNFINISHED! UNFINISHED! UNFINISHED!
@@ -38,7 +40,7 @@
#include <machine/cpu.h>
#include <machine/pio.h>
-#include <i386/isa/isa_device.h>
+#include <i386/isa/isa_device.h> /* XXX BROKEN */
extern int delaycount; /* from clock setup code */
diff --git a/sys/dev/isa/wss.c b/sys/dev/isa/wss.c
index 463ca2da351..3fcd3b3491f 100644
--- a/sys/dev/isa/wss.c
+++ b/sys/dev/isa/wss.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wss.c,v 1.2 1995/03/25 00:01:07 mycroft Exp $ */
+/* $NetBSD: wss.c,v 1.3 1995/04/17 12:07:50 cgd Exp $ */
/*
* Copyright (c) 1994 John Brezak
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: wss.c,v 1.2 1995/03/25 00:01:07 mycroft Exp $
+ * $Id: wss.c,v 1.3 1995/04/17 12:07:50 cgd Exp $
*/
#include <sys/param.h>
@@ -51,8 +51,8 @@
#include <sys/audioio.h>
#include <dev/audio_if.h>
-#include <i386/isa/isavar.h>
-#include <i386/isa/dmavar.h>
+#include <dev/isa/isavar.h>
+#include <dev/isa/isadmavar.h>
#include <i386/isa/icu.h>
#include <i386/isa/ad1848var.h>
@@ -89,14 +89,14 @@ int wssdebug = 0;
struct wss_softc {
struct device sc_dev; /* base device */
struct isadev sc_id; /* ISA device */
- struct intrhand sc_ih; /* interrupt vectoring */
+ void *sc_ih; /* interrupt vectoring */
struct ad1848_softc sc_ad1848;
#define wss_iobase sc_ad1848.sc_iobase
#define wss_irq sc_ad1848.sc_irq
#define wss_drq sc_ad1848.sc_drq
- int mic_mute, cd_mute, dac_mute;
+ int mic_mute, cd_mute, dac_mute;
};
struct audio_device wss_device = {
@@ -251,10 +251,8 @@ wssattach(parent, self, aux)
#ifdef NEWCONFIG
isa_establish(&sc->sc_id, &sc->sc_dev);
#endif
- sc->sc_ih.ih_fun = ad1848_intr;
- sc->sc_ih.ih_arg = &sc->sc_ad1848;
- sc->sc_ih.ih_level = IPL_BIO;
- intr_establish(ia->ia_irq, IST_EDGE, &sc->sc_ih);
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_BIO,
+ ad1848_intr, &sc->sc_ad1848);
ad1848_attach(&sc->sc_ad1848);
diff --git a/sys/dev/isa/wt.c b/sys/dev/isa/wt.c
index 246ef7af332..de9c1d69e80 100644
--- a/sys/dev/isa/wt.c
+++ b/sys/dev/isa/wt.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wt.c,v 1.23 1995/01/29 07:37:18 cgd Exp $ */
+/* $NetBSD: wt.c,v 1.24 1995/04/17 12:09:37 cgd Exp $ */
/*
* Streamer tape driver.
@@ -64,8 +64,8 @@
#include <machine/pio.h>
-#include <i386/isa/isavar.h>
-#include <i386/isa/dmavar.h>
+#include <dev/isa/isavar.h>
+#include <dev/isa/isadmavar.h>
#include <dev/isa/wtreg.h>
/*
@@ -126,7 +126,7 @@ enum wttype {
struct wt_softc {
struct device sc_dev;
- struct intrhand sc_ih;
+ void *sc_ih;
enum wttype type; /* type of controller */
int sc_iobase; /* base i/o port */
@@ -165,7 +165,7 @@ u_char wtpoll __P((struct wt_softc *sc, int mask, int bits));
int wtprobe __P((struct device *, void *, void *));
void wtattach __P((struct device *, struct device *, void *));
-int wtintr __P((struct wt_softc *sc));
+int wtintr __P((void *sc));
struct cfdriver wtcd = {
NULL, "wt", wtprobe, wtattach, DV_TAPE, sizeof(struct wt_softc)
@@ -249,10 +249,8 @@ wtattach(parent, self, aux)
sc->flags = TPSTART; /* tape is rewound */
sc->dens = -1; /* unknown density */
- sc->sc_ih.ih_fun = wtintr;
- sc->sc_ih.ih_arg = sc;
- sc->sc_ih.ih_level = IPL_BIO;
- intr_establish(ia->ia_irq, IST_EDGE, &sc->sc_ih);
+ sc->sc_ih = isa_intr_establish(ia->ia_irq, ISA_IST_EDGE, ISA_IPL_BIO,
+ wtintr, sc);
}
int
@@ -598,9 +596,10 @@ xit:
* Interrupt routine.
*/
int
-wtintr(sc)
- struct wt_softc *sc;
+wtintr(arg)
+ void *arg;
{
+ struct wt_softc *sc = arg;
u_char x;
x = inb(sc->STATPORT); /* get status */