diff options
author | Warner Losh <imp@FreeBSD.org> | 2001-06-16 06:33:01 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2001-06-16 06:33:01 +0000 |
commit | 7077bc34aaa89004297ab5dd4f123e5497844447 (patch) | |
tree | 85f82e3d0e50c54dd45921470c257a65c62e5952 /sys/pccard/pccard.c | |
parent | b62ddc136384ac750336fb6a68486434a07e0fbc (diff) |
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.
Notes
Notes:
svn path=/head/; revision=78336
Diffstat (limited to 'sys/pccard/pccard.c')
-rw-r--r-- | sys/pccard/pccard.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/sys/pccard/pccard.c b/sys/pccard/pccard.c index 01c33cc8fbf8..6a9039e01cda 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); } |