diff options
author | imp <imp@FreeBSD.org> | 2001-05-28 02:53:02 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2001-05-28 02:53:02 +0000 |
commit | 476e3d24e2f2e209b5a8f8b090f341decf72bcc6 (patch) | |
tree | 896bc928d7846a9a7e5c9e26e5a0de8a4d70447e /sys/pccard/pcic.c | |
parent | 315d04216a024b672d86764ea09a860493672bb5 (diff) | |
download | FreeBSD-src-476e3d24e2f2e209b5a8f8b090f341decf72bcc6.zip FreeBSD-src-476e3d24e2f2e209b5a8f8b090f341decf72bcc6.tar.gz |
Turns out that one bit isn't enough. Introduce two new fields
csc_route and func_route to hold the way that each interrupt is
routed. csc is Card Status Change in the datasheets and standard, but
is called "Management Interrupt" in FreeBSDese. There are three types
of interrupt routing: ISA parallel, PCI parallel and ISA serial (some
chipsets support other types as well, but I don't plan on supporting
them).
When we try to allocate an interrupt, and the type for that interrupt
is pci_parallel, allow it to be shared by oring in RF_SHAREABLE to the
flags argument. Introduce pcic_alloc_resource to allow this to
happen.
Diffstat (limited to 'sys/pccard/pcic.c')
-rw-r--r-- | sys/pccard/pcic.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c index 8a3598c..43b33d3 100644 --- a/sys/pccard/pcic.c +++ b/sys/pccard/pcic.c @@ -324,7 +324,7 @@ pcic_attach(device_t dev) rid = 0; r = NULL; flags = RF_ACTIVE; - if (sc->flags & PCIC_SHARED_IRQ) + if (sc->csc_route == pci_parallel) flags |= RF_SHAREABLE; r = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, flags); if (r == NULL) { @@ -905,3 +905,19 @@ pcic_get_memory_offset(device_t bus, device_t child, int rid, u_int32_t *offset) return (0); } + +struct resource * +pcic_alloc_resource(device_t dev, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct pcic_softc *sc = device_get_softc(dev); + + /* + * If we're routing via pci, we can share. + */ + if (sc->func_route == pci_parallel && type == SYS_RES_IRQ) + flags |= RF_SHAREABLE; + + return (bus_generic_alloc_resource(dev, child, type, rid, start, end, + count, flags)); +} |