diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2002-04-16 19:49:07 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2002-04-16 19:49:07 +0000 |
commit | 8cdc09a53e0a96c16151d9121d5164eb6cec70fa (patch) | |
tree | 6a1a100ceebf1c9a861feacbda9e06645c7e4249 /sys/arch/sparc64/dev/lpt_ebus.c | |
parent | fb9fc974e1da08877081e0f94fa77c33988e847e (diff) |
use polled access for now (prevents a hang on the Momenco Leopard-V)
Diffstat (limited to 'sys/arch/sparc64/dev/lpt_ebus.c')
-rw-r--r-- | sys/arch/sparc64/dev/lpt_ebus.c | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/sys/arch/sparc64/dev/lpt_ebus.c b/sys/arch/sparc64/dev/lpt_ebus.c index d020ebfd8f8..d9df4c9b286 100644 --- a/sys/arch/sparc64/dev/lpt_ebus.c +++ b/sys/arch/sparc64/dev/lpt_ebus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lpt_ebus.c,v 1.3 2002/04/16 16:19:32 jason Exp $ */ +/* $OpenBSD: lpt_ebus.c,v 1.4 2002/04/16 19:49:06 jason Exp $ */ /* $NetBSD: lpt_ebus.c,v 1.8 2002/03/01 11:51:00 martin Exp $ */ /* @@ -46,11 +46,16 @@ #include <dev/ic/lptvar.h> +struct lpt_ebus_softc { + struct lpt_softc sc_lpt; + bus_space_handle_t sc_ctrl; +}; + int lpt_ebus_match __P((struct device *, void *, void *)); void lpt_ebus_attach __P((struct device *, struct device *, void *)); struct cfattach lpt_ebus_ca = { - sizeof(struct lpt_softc), lpt_ebus_match, lpt_ebus_attach + sizeof(struct lpt_ebus_softc), lpt_ebus_match, lpt_ebus_attach }; int @@ -72,21 +77,29 @@ lpt_ebus_attach(parent, self, aux) struct device *parent, *self; void *aux; { - struct lpt_softc *sc = (void *)self; + struct lpt_ebus_softc *sc = (void *)self; struct ebus_attach_args *ea = aux; - int i; - sc->sc_iot = ea->ea_bustag; + sc->sc_lpt.sc_iot = ea->ea_bustag; - if (ebus_bus_map(sc->sc_iot, 0, EBUS_PADDR_FROM_REG(&ea->ea_regs[0]), - ea->ea_regs[0].size, BUS_SPACE_MAP_LINEAR, 0, &sc->sc_ioh) != 0) { + if (ebus_bus_map(sc->sc_lpt.sc_iot, 0, + EBUS_PADDR_FROM_REG(&ea->ea_regs[0]), ea->ea_regs[0].size, + BUS_SPACE_MAP_LINEAR, 0, &sc->sc_lpt.sc_ioh) != 0) { printf(": can't map register space\n"); return; } - for (i = 0; i < ea->ea_nintrs; i++) - bus_intr_establish(ea->ea_bustag, ea->ea_intrs[i], IPL_SERIAL, - 0, lptintr, sc); + if (ebus_bus_map(sc->sc_lpt.sc_iot, 0, + EBUS_PADDR_FROM_REG(&ea->ea_regs[1]), ea->ea_regs[1].size, + BUS_SPACE_MAP_LINEAR, 0, &sc->sc_ctrl) != 0) { + printf(": can't map control space\n"); + bus_space_unmap(sc->sc_lpt.sc_iot, sc->sc_lpt.sc_ioh, + ea->ea_regs[0].size); + return; + } + + sc->sc_lpt.sc_flags |= LPT_POLLED; + printf(": polled"); - lpt_attach_common(sc); + lpt_attach_common(&sc->sc_lpt); } |