diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-01-07 15:57:44 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-01-07 15:57:44 +0000 |
commit | 56e3b5b6b33377b5dd1ac9def5ae90460bd9c98e (patch) | |
tree | 71518881dedf41729152c2c6eac7a43bb09e4786 /sys/dev | |
parent | 1a2a1d8cdbb018362db23a2a71ff582651f0d6cd (diff) |
revert to polled mode if configured irq is not available
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/isa/lpt_isa.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/isa/lpt_isa.c b/sys/dev/isa/lpt_isa.c index 0c206efa555..72dcf410196 100644 --- a/sys/dev/isa/lpt_isa.c +++ b/sys/dev/isa/lpt_isa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lpt_isa.c,v 1.8 1997/10/07 05:58:26 mickey Exp $ */ +/* $OpenBSD: lpt_isa.c,v 1.9 1999/01/07 15:57:43 niklas Exp $ */ /* * Copyright (c) 1993, 1994 Charles Hannum. @@ -97,6 +97,7 @@ lpt_isa_probe(parent, match, aux) struct device *parent; void *match, *aux; { + struct isa_softc *sc = (struct isa_softc *)parent; struct isa_attach_args *ia = aux; bus_space_tag_t iot; bus_space_handle_t ioh; @@ -147,6 +148,14 @@ lpt_isa_probe(parent, match, aux) bus_space_write_1(iot, ioh, lpt_data, 0); bus_space_write_1(iot, ioh, lpt_control, 0); + /* + * Check if the specified IRQ is available. If not revert to + * polled mode. + */ + if (ia->ia_irq != IRQUNK && + !isa_intr_check(sc->sc_ic, ia->ia_irq, IST_EDGE)) + ia->ia_irq = IRQUNK; + ia->ia_msize = 0; ia->ia_iosize = iosz; |