diff options
author | sanpei <sanpei@FreeBSD.org> | 2000-10-10 13:01:18 +0000 |
---|---|---|
committer | sanpei <sanpei@FreeBSD.org> | 2000-10-10 13:01:18 +0000 |
commit | ebcd791ed808b28f8ac489d9bbb8da550d6262e4 (patch) | |
tree | e7dc9aede41b9e37108723b054ecac4f66524103 /usr.sbin | |
parent | 09e2c0befba5c9394f01a30f9f5edf15e7fb7234 (diff) | |
download | FreeBSD-src-ebcd791ed808b28f8ac489d9bbb8da550d6262e4.zip FreeBSD-src-ebcd791ed808b28f8ac489d9bbb8da550d6262e4.tar.gz |
print out error reason if it was failed in assign_io
Obtained from: PAO3
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pccard/pccardd/cardd.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/usr.sbin/pccard/pccardd/cardd.c b/usr.sbin/pccard/pccardd/cardd.c index b6e4179..7e6387f 100644 --- a/usr.sbin/pccard/pccardd/cardd.c +++ b/usr.sbin/pccard/pccardd/cardd.c @@ -279,6 +279,7 @@ void card_inserted(struct slot *sp) { struct card *cp; + int err; usleep(pccard_init_sleep); sp->cis = readcis(sp->fd); @@ -361,8 +362,27 @@ escape: } if ((sp->config = assign_driver(cp)) == NULL) return; - if (assign_io(sp)) { - logmsg("Resource allocation failure for %s", sp->cis->manuf); + if (err = assign_io(sp)) { + char *reason; + + switch (err) { + case -1: + reason = "specified CIS was not found"; + break; + case -2: + reason = "memory block allocation failed"; + break; + case -3: + reason = "I/O block allocation failed"; + break; + default: + reason = "Unknown"; + break; + } + logmsg("Resource allocation failure for \"%s\"(\"%s\") " + "[%s] [%s]; Reason %s\n", + sp->cis->manuf, sp->cis->vers, + sp->cis->add_info1, sp->cis->add_info2, reason); return; } @@ -711,7 +731,7 @@ assign_io(struct slot *sp) break; } if (j < 0) { - return (-1); + return (-3); } else { sio->addr = j; } |