diff options
author | sanpei <sanpei@FreeBSD.org> | 2000-09-20 14:54:21 +0000 |
---|---|---|
committer | sanpei <sanpei@FreeBSD.org> | 2000-09-20 14:54:21 +0000 |
commit | 2ad52d2b59d060a991f7385173da24f358555341 (patch) | |
tree | a83a23c69c568b1a9f528b3e7f7f26a76e77972f /usr.sbin/pccard | |
parent | 4f8ad903982b462cae9230aaf2464b63bc948edd (diff) | |
download | FreeBSD-src-2ad52d2b59d060a991f7385173da24f358555341.zip FreeBSD-src-2ad52d2b59d060a991f7385173da24f358555341.tar.gz |
fix previous PIOCSRESOURCE code in assign_card_index
Diffstat (limited to 'usr.sbin/pccard')
-rw-r--r-- | usr.sbin/pccard/pccardd/cardd.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/usr.sbin/pccard/pccardd/cardd.c b/usr.sbin/pccard/pccardd/cardd.c index 3a7153d..6514c8a 100644 --- a/usr.sbin/pccard/pccardd/cardd.c +++ b/usr.sbin/pccard/pccardd/cardd.c @@ -543,16 +543,19 @@ assign_card_index(struct cis * cis) continue; for (cio = cp->io; cio; cio = cio->next) { resource.size = cio->size; + resource.min = cio->addr; + resource.max = resource.min + cio->size; + if (ioctl(fd, PIOCSRESOURCE, &resource) < 0) { + perror("ioctl (PIOCSRESOURCE)"); + exit(1); + } + if (resource.resource_addr != cio->addr) + goto next; for (i = cio->addr; i < cio->addr + cio->size - 1; i++) - resource.min = i; - resource.max = resource.min + cio->size - 1; - if (ioctl(fd, PIOCSRESOURCE, &resource) < 0) { - perror("ioctl (PIOCSRESOURCE)"); - exit(1); - } - if (!bit_test(io_avail, i) || resource.resource_addr != i) + if (!bit_test(io_avail, i)) goto next; } + close(fd); return cp; /* found */ next: } |