From 65239bc8b29cfd0bc50a1eed2c08e35729e1f055 Mon Sep 17 00:00:00 2001 From: sanpei Date: Wed, 4 Oct 2000 15:22:09 +0000 Subject: check {IO,IRQ}_ASSIGNED flags before release {io,irq} resources. fix multi io window in release io routine PR: 20454 --- usr.sbin/pccard/pccardd/cardd.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'usr.sbin/pccard/pccardd') diff --git a/usr.sbin/pccard/pccardd/cardd.c b/usr.sbin/pccard/pccardd/cardd.c index 881cfe1..b6e4179 100644 --- a/usr.sbin/pccard/pccardd/cardd.c +++ b/usr.sbin/pccard/pccardd/cardd.c @@ -192,6 +192,7 @@ void card_removed(struct slot *sp) { struct card *cp; + struct allocblk *sio; int in_use = 0; if (sp->config && sp->config->driver && sp->card) @@ -210,10 +211,14 @@ card_removed(struct slot *sp) sp->cis = 0; sp->config = 0; /* release io */ - bit_nset(io_avail, sp->io.addr, sp->io.addr + sp->io.size - 1); + if (sp->flags & IO_ASSIGNED) + for (sio = &sp->io; sio; sio = sio->next) + if (sio->addr && sio->size) + bit_nset(io_avail, sio->addr, sio->addr + sio->size - 1); /* release irq */ - if (sp->irq) - pool_irq[sp->irq] = 1; + if (sp->flags & IRQ_ASSIGNED) + if (sp->irq >= 1 && sp->irq <= 15) + pool_irq[sp->irq] = 1; } /* CIS string comparison */ -- cgit v1.1