From d3c10e33e62906d1a792cfade4d63dd66a466b10 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Wed, 4 Sep 2002 15:29:04 +0000 Subject: [PATCH] Bring back the PUC_FASTINTR option, and implement it correctly so that child devices also know if they are fast or normal. Requested by: bde --- sys/dev/puc/puc.c | 14 ++++++++++++-- sys/dev/puc/pucvar.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/sys/dev/puc/puc.c b/sys/dev/puc/puc.c index 919c3dc5c4e..195cb842033 100644 --- a/sys/dev/puc/puc.c +++ b/sys/dev/puc/puc.c @@ -159,8 +159,18 @@ puc_attach(device_t dev, const struct puc_device_description *desc) sc->irqres = res; sc->irqrid = rid; +#ifdef PUC_FASTINTR + irq_setup = BUS_SETUP_INTR(device_get_parent(dev), dev, res, + INTR_TYPE_TTY | INTR_FAST, puc_intr, sc, &sc->intr_cookie); + if (irq_setup == 0) + sc->fastintr = 1; + else + irq_setup = BUS_SETUP_INTR(device_get_parent(dev), dev, res, + INTR_TYPE_TTY, puc_intr, sc, &sc->intr_cookie); +#else irq_setup = BUS_SETUP_INTR(device_get_parent(dev), dev, res, INTR_TYPE_TTY, puc_intr, sc, &sc->intr_cookie); +#endif if (irq_setup != 0) return (ENXIO); @@ -450,9 +460,9 @@ puc_setup_intr(device_t dev, device_t child, struct resource *r, int flags, int i; struct puc_softc *sc; - if (flags & INTR_FAST) - return (ENXIO); sc = (struct puc_softc *)device_get_softc(dev); + if ((flags & INTR_FAST) && !sc->fastintr) + return (ENXIO); for (i = 0; PUC_PORT_VALID(sc->sc_desc, i); i++) { if (sc->sc_ports[i].dev == child) { if (sc->sc_ports[i].ihand != 0) diff --git a/sys/dev/puc/pucvar.h b/sys/dev/puc/pucvar.h index e5a082dc65b..46f8e986e44 100644 --- a/sys/dev/puc/pucvar.h +++ b/sys/dev/puc/pucvar.h @@ -118,6 +118,7 @@ struct puc_softc { const struct puc_device_description *sc_desc; /* card-global dynamic data */ + int fastintr; int barmuxed; int irqrid; struct resource *irqres;