diff options
Diffstat (limited to 'sys/arch/hppa/dev/lasi.c')
-rw-r--r-- | sys/arch/hppa/dev/lasi.c | 74 |
1 files changed, 8 insertions, 66 deletions
diff --git a/sys/arch/hppa/dev/lasi.c b/sys/arch/hppa/dev/lasi.c index 0b634fc94f0..f0614519c95 100644 --- a/sys/arch/hppa/dev/lasi.c +++ b/sys/arch/hppa/dev/lasi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lasi.c,v 1.9 2002/04/22 01:48:37 mickey Exp $ */ +/* $OpenBSD: lasi.c,v 1.10 2002/12/17 21:54:20 mickey Exp $ */ /* * Copyright (c) 1998-2002 Michael Shalayeff @@ -39,6 +39,7 @@ #include <machine/bus.h> #include <machine/iomod.h> +#include <machine/reg.h> #include <machine/autoconf.h> #include <hppa/dev/cpudevs.h> @@ -50,7 +51,7 @@ struct lasi_hwr { u_int32_t lasi_power; #define LASI_BLINK 0x01 -#define LASI_ON 0x02 +#define LASI_OFF 0x02 u_int32_t lasi_error; u_int32_t lasi_version; u_int32_t lasi_reset; @@ -86,13 +87,8 @@ struct cfdriver lasi_cd = { NULL, "lasi", DV_DULL }; -void lasi_intr_establish(void *v, u_int32_t mask); -void lasi_intr_disestablish(void *v, u_int32_t mask); -u_int32_t lasi_intr_check(void *v); -void lasi_intr_ack(void *v, u_int32_t mask); void lasi_cold_hook(int on); - int lasimatch(parent, cfdata, aux) struct device *parent; @@ -133,8 +129,8 @@ lasiattach(parent, self, aux) /* XXX should we reset the chip here? */ - printf (": rev %d.%d\n", (sc->sc_hw->lasi_version & 0xf0) >> 4, - sc->sc_hw->lasi_version & 0xf); + printf(": rev %d.%d\n", (sc->sc_hw->lasi_version & 0xf0) >> 4, + sc->sc_hw->lasi_version & 0xf); /* interrupts guts */ s = splhigh(); @@ -147,13 +143,9 @@ lasiattach(parent, self, aux) sc->sc_ic.gsc_type = gsc_lasi; sc->sc_ic.gsc_dv = sc; - sc->sc_ic.gsc_intr_establish = lasi_intr_establish; - sc->sc_ic.gsc_intr_disestablish = lasi_intr_disestablish; - sc->sc_ic.gsc_intr_check = lasi_intr_check; - sc->sc_ic.gsc_intr_ack = lasi_intr_ack; + sc->sc_ic.gsc_base = sc->sc_trs; sc->ga.ga_ca = *ca; /* clone from us */ - sc->ga.ga_hpamask = LASI_IOMASK; if (sc->sc_dev.dv_unit) config_defer(self, lasi_gsc_attach); else { @@ -171,6 +163,7 @@ lasi_gsc_attach(self) struct lasi_softc *sc = (struct lasi_softc *)self; sc->ga.ga_name = "gsc"; + sc->ga.ga_hpamask = LASI_IOMASK; sc->ga.ga_ic = &sc->sc_ic; config_found(self, &sc->ga, gscprint); } @@ -192,58 +185,7 @@ lasi_cold_hook(on) sc->sc_hw->lasi_power = 0; break; case HPPA_COLD_OFF: - sc->sc_hw->lasi_power = LASI_BLINK; + sc->sc_hw->lasi_power = LASI_OFF; break; } } - -void -lasi_intr_establish(v, mask) - void *v; - u_int32_t mask; -{ - register struct lasi_softc *sc = v; - - sc->sc_trs->lasi_imr |= mask; -} - -void -lasi_intr_disestablish(v, mask) - void *v; - u_int32_t mask; -{ - register struct lasi_softc *sc = v; - - sc->sc_trs->lasi_imr &= ~mask; -} - -u_int32_t -lasi_intr_check(v) - void *v; -{ - register struct lasi_softc *sc = v; - register u_int32_t irr, imr, ipr; - - imr = sc->sc_trs->lasi_imr; - ipr = sc->sc_trs->lasi_ipr; - irr = sc->sc_trs->lasi_irr; - sc->sc_trs->lasi_irr = irr; - -#ifdef LASIDEBUG - printf ("%s: imr=0x%x, irr=0x%x, ipr=0x%x, iar=0x%x, icr=0x%x\n", - sc->sc_dev.dv_xname, imr, irr, ipr, - sc->sc_trs->lasi_iar, sc->sc_trs->lasi_icr); -#endif - - return irr; -} - -void -lasi_intr_ack(v, mask) - void *v; - u_int32_t mask; -{ - register struct lasi_softc *sc = v; - - sc->sc_trs->lasi_imr |= mask; -} |