diff options
| author | cgd <cgd@NetBSD.org> | 1995-04-17 12:06:30 +0000 |
|---|---|---|
| committer | cgd <cgd@NetBSD.org> | 1995-04-17 12:06:30 +0000 |
| commit | 8a640328edd60eb5a19fc29a8847efd3baeb4fa8 (patch) | |
| tree | 8f8ab3df0b9f5b324f7c9ac9288e1c3123eb36a5 /sys/dev/ic | |
| parent | 78ec8e770169b76edc642d16e220a93f577713f9 (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/ic')
| -rw-r--r-- | sys/dev/ic/aic6360.c | 19 | ||||
| -rw-r--r-- | sys/dev/ic/com.c | 22 | ||||
| -rw-r--r-- | sys/dev/ic/lpt.c | 22 | ||||
| -rw-r--r-- | sys/dev/ic/lptvar.h | 22 |
4 files changed, 39 insertions, 46 deletions
diff --git a/sys/dev/ic/aic6360.c b/sys/dev/ic/aic6360.c index 53e5ce8edf9..12bf11b8f5a 100644 --- a/sys/dev/ic/aic6360.c +++ b/sys/dev/ic/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/ic/com.c b/sys/dev/ic/com.c index 65581425085..32d791a9566 100644 --- a/sys/dev/ic/com.c +++ b/sys/dev/ic/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/ic/lpt.c b/sys/dev/ic/lpt.c index 9423e799293..aee3a5be153 100644 --- a/sys/dev/ic/lpt.c +++ b/sys/dev/ic/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/ic/lptvar.h b/sys/dev/ic/lptvar.h index d87e984863c..87ee438dfec 100644 --- a/sys/dev/ic/lptvar.h +++ b/sys/dev/ic/lptvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: lptvar.h,v 1.29 1995/01/29 07:37:10 cgd Exp $ */ +/* $NetBSD: lptvar.h,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 |
