diff options
author | nate <nate@FreeBSD.org> | 1996-06-19 01:25:37 +0000 |
---|---|---|
committer | nate <nate@FreeBSD.org> | 1996-06-19 01:25:37 +0000 |
commit | 9cb4c78b339519556f722a86d51bdb715c656c6e (patch) | |
tree | 821c191b95fa727611fd6a1bc7c3280baeec65a1 /usr.sbin/pccard | |
parent | 583ac053ede090e4a3daa2faac76fd7dacd18dc8 (diff) | |
download | FreeBSD-src-9cb4c78b339519556f722a86d51bdb715c656c6e.zip FreeBSD-src-9cb4c78b339519556f722a86d51bdb715c656c6e.tar.gz |
Enable code that allows the daemon to select a free IRQ from the list if
none is selected. The code was already there but needed to be updated
to use the correct structure element.
Diffstat (limited to 'usr.sbin/pccard')
-rw-r--r-- | usr.sbin/pccard/pccardd/cardd.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/usr.sbin/pccard/pccardd/cardd.c b/usr.sbin/pccard/pccardd/cardd.c index 83c465e..c26c37e 100644 --- a/usr.sbin/pccard/pccardd/cardd.c +++ b/usr.sbin/pccard/pccardd/cardd.c @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: cardd.c,v 1.9 1996/04/23 16:46:48 nate Exp $ + * $Id: cardd.c,v 1.10 1996/06/18 19:52:28 nate Exp $ */ #include <stdio.h> @@ -405,8 +405,22 @@ assign_driver(struct card *cp) log_1s("Driver already being used for %s", cp->manuf); return (0); } + /* Allocate a free IRQ if none has been specified */ + if (conf->irq == 0) { + int i; + for (i = 1; i < 16; i++) + if (pool_irq[i]) { + conf->irq = i; + pool_irq[i] = 0; + break; + } + if (conf->irq == 0) { + log_1s("Failed to allocate IRQ for %s\n", cp->manuf); + return (0); + } + } #if 0 - /* Allocate I/O, memory and IRQ resources. */ + /* Allocate I/O and memory resources. */ for (ap = drvp->io; ap; ap = ap->next) { if (ap->addr == 0 && ap->size) { int i = bit_fns(io_avail, IOPORTS, ap->size); @@ -420,19 +434,6 @@ assign_driver(struct card *cp) bit_nclear(io_avail, i, ap->size); } } - if (drvp->irq == 0) { - int i; - for (i = 1; i < 16; i++) - if (pool_irq[i]) { - drvp->irq = i; - pool_irq[i] = 0; - break; - } - if (drvp->irq == 0) { - log_1s("Failed to allocate IRQ for %s\n", cp->manuf); - return (0); - } - } for (ap = drvp->mem; ap; ap = ap->next) { if (ap->addr == 0 && ap->size) { ap->addr = alloc_memory(ap->size); |