summaryrefslogtreecommitdiffstats
path: root/sys/dev/puc
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-09-04 15:29:04 +0000
committerphk <phk@FreeBSD.org>2002-09-04 15:29:04 +0000
commit131e0609dcf0d357aef4fb81416189a6d94dd285 (patch)
tree1fe1bedb5e7328d83657f945afab4afbd123e051 /sys/dev/puc
parent8ceeefb3da4a98a7b2631b976210c60828fecf56 (diff)
downloadFreeBSD-src-131e0609dcf0d357aef4fb81416189a6d94dd285.zip
FreeBSD-src-131e0609dcf0d357aef4fb81416189a6d94dd285.tar.gz
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
Diffstat (limited to 'sys/dev/puc')
-rw-r--r--sys/dev/puc/puc.c14
-rw-r--r--sys/dev/puc/pucvar.h1
2 files changed, 13 insertions, 2 deletions
diff --git a/sys/dev/puc/puc.c b/sys/dev/puc/puc.c
index 919c3dc5..195cb84 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 e5a082d..46f8e98 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;
OpenPOWER on IntegriCloud