summaryrefslogtreecommitdiffstats
path: root/sys/pccard/pccard.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-06-16 06:33:01 +0000
committerimp <imp@FreeBSD.org>2001-06-16 06:33:01 +0000
commit9b40d4fdc235bc4fa04660e68ebf19292c1102e8 (patch)
tree85f82e3d0e50c54dd45921470c257a65c62e5952 /sys/pccard/pccard.c
parent9d1e0e392656bbbe77a4873606955970699ada5c (diff)
downloadFreeBSD-src-9b40d4fdc235bc4fa04660e68ebf19292c1102e8.zip
FreeBSD-src-9b40d4fdc235bc4fa04660e68ebf19292c1102e8.tar.gz
Save the IRQ that we get in pci attachment.
Print type of pci bridge we find. Force the IRQ of pci bridges upon all its children. Allocate the resources on behalf of the bridge when we're testing to see if they exist. This should help people who don't read updating instructions very well. This patch started out with an idea from Shigeru Yamamoto-san in -current.
Diffstat (limited to 'sys/pccard/pccard.c')
-rw-r--r--sys/pccard/pccard.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/sys/pccard/pccard.c b/sys/pccard/pccard.c
index 01c33cc..6a9039e 100644
--- a/sys/pccard/pccard.c
+++ b/sys/pccard/pccard.c
@@ -434,14 +434,13 @@ crdioctl_sresource(dev_t dev, caddr_t data)
{
struct pccard_resource *pr;
struct resource *r;
- int i;
- int rid = 1;
- int err;
+ int flags;
+ int rid = 0;
device_t bridgedev;
pr = (struct pccard_resource *)data;
pr->resource_addr = ~0ul;
- bridgedev = device_get_parent(PCCARD_DEV2SOFTC(dev)->dev);
+ bridgedev = PCCARD_DEV2SOFTC(dev)->dev;
switch(pr->type) {
default:
return (EINVAL);
@@ -450,17 +449,12 @@ crdioctl_sresource(dev_t dev, caddr_t data)
case SYS_RES_IOPORT:
break;
}
- for (i = pr->min; i + pr->size - 1 <= pr->max; i++) {
- err = bus_set_resource(bridgedev, pr->type, rid, i, pr->size);
- if (err != 0)
- continue;
- r = bus_alloc_resource(bridgedev, pr->type, &rid, 0ul, ~0ul,
- pr->size, 0);
- if (r == NULL)
- continue;
+ flags = rman_make_alignment_flags(pr->size);
+ r = bus_alloc_resource(bridgedev, pr->type, &rid, pr->min, pr->max,
+ pr->size, flags);
+ if (r != NULL) {
pr->resource_addr = (u_long)rman_get_start(r);
bus_release_resource(bridgedev, pr->type, rid, r);
- return (0);
}
return (0);
}
OpenPOWER on IntegriCloud