diff options
author | imp <imp@FreeBSD.org> | 2001-08-14 19:23:12 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2001-08-14 19:23:12 +0000 |
commit | 0ae65492e23199bd2bfe04bac607d4c06c0be050 (patch) | |
tree | e21e8712299fcf512ef2242dc8a8e8da077cf4b3 /sys/pccard/pcic.c | |
parent | 566a98cb135433c2de5707ef25700adb5447d77f (diff) | |
download | FreeBSD-src-0ae65492e23199bd2bfe04bac607d4c06c0be050.zip FreeBSD-src-0ae65492e23199bd2bfe04bac607d4c06c0be050.tar.gz |
Treat min,max of 0,0 for IRQ special. Reject it if we didn't specifically
assing an IRQ. Add better comments while I'm here.
MFC after: 1 day
# Note: That's merging all the -current pci pcic code, not just this one
# change for the Aug 15th code freeze.
Diffstat (limited to 'sys/pccard/pcic.c')
-rw-r--r-- | sys/pccard/pcic.c | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c index 1cd257e..96f667c 100644 --- a/sys/pccard/pcic.c +++ b/sys/pccard/pcic.c @@ -402,10 +402,27 @@ pcic_sresource(struct slot *slt, caddr_t data) pr = (struct pccard_resource *)data; pr->resource_addr = ~0ul; - if (pr->type == SYS_RES_IRQ && sp->sc->func_route == pci_parallel) { - pr->resource_addr = sp->sc->irq; - return (0); + + /* + * If we're using PCI interrupt routing, then force the IRQ to + * use and to heck with what the user requested. If they want + * to be able to request IRQs, they must use ISA interrupt + * routing. If we don't give them an irq, and it is the + * pccardd 0,0 case, then just return (giving the "bad resource" + * return in pr->resource_addr). + */ + if (pr->type == SYS_RES_IRQ) { + if (sp->sc->func_route >= pci_parallel) { + pr->resource_addr = sp->sc->irq; + return (0); + } + if (pr->min == 0 && pr->max == 0) + return (0); } + + /* + * Make sure we grok this type. + */ switch(pr->type) { default: return (EINVAL); @@ -414,6 +431,12 @@ pcic_sresource(struct slot *slt, caddr_t data) case SYS_RES_IOPORT: break; } + + /* + * Allocate the resource, and align it to the most natural + * size. If we get it, then tell userland what we actually got + * in the range they requested. + */ flags = rman_make_alignment_flags(pr->size); r = bus_alloc_resource(bridgedev, pr->type, &rid, pr->min, pr->max, pr->size, flags); |