print out error reason if it was failed in assign_io

Obtained from:	PAO3
This commit is contained in:
MIHIRA Sanpei Yoshiro 2000-10-10 13:01:18 +00:00
parent 8e6f860ac9
commit 29d26e2f27

View File

@ -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 @@ card_inserted(struct slot *sp)
}
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;
}