Handled SCSI status "BUSY" on Solaris

This commit is contained in:
Thomas Schmitt 2010-06-08 17:50:33 +00:00
parent 800f9d8e01
commit f96f595486
2 changed files with 7 additions and 10 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2010.06.08.173156" #define Cdrskin_timestamP "2010.06.08.174946"

View File

@ -577,6 +577,7 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
int i, usleep_time, timeout_ms, no_retry = 0, ret; int i, usleep_time, timeout_ms, no_retry = 0, ret;
time_t start_time; time_t start_time;
struct uscsi_cmd cgc; struct uscsi_cmd cgc;
char msg[80];
static FILE *fp = NULL; static FILE *fp = NULL;
c->error = 0; c->error = 0;
@ -632,13 +633,14 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
0 = GOOD , 2 = CHECK CONDITION : Sense Data are delivered 0 = GOOD , 2 = CHECK CONDITION : Sense Data are delivered
8 = BUSY 8 = BUSY
*/ */
if (ret != 0 && if (ret != 0 && cgc.uscsi_status != 2) {
cgc.uscsi_status != 2 && cgc.uscsi_status != 8) { sprintf(msg,
"Failed to transfer command to drive. (uscsi_status = 0x%X)",
(unsigned int) cgc.uscsi_status),
libdax_msgs_submit(libdax_messenger, libdax_msgs_submit(libdax_messenger,
d->global_index, 0x0002010c, d->global_index, 0x0002010c,
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH, LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
"Failed to transfer command to drive", msg, errno, 0);
errno, 0);
sg_close_drive(d); sg_close_drive(d);
d->released = 1; d->released = 1;
d->busy = BURN_DRIVE_IDLE; d->busy = BURN_DRIVE_IDLE;
@ -648,10 +650,6 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
c->sense[2] &= 15; c->sense[2] &= 15;
if (cgc.uscsi_status == 8) {
/* >>> fake BUSY sense */;
}
/* >>> valid sense: cgc.uscsi_rqlen - cgc.uscsi_rqresid */; /* >>> valid sense: cgc.uscsi_rqlen - cgc.uscsi_rqresid */;
if (c->sense[2] || c->sense[12] || c->sense[13]) { if (c->sense[2] || c->sense[12] || c->sense[13]) {
@ -698,7 +696,6 @@ ex:;
return 1; return 1;
} }
/* >>> */
/** Tries to obtain SCSI address parameters. /** Tries to obtain SCSI address parameters.
@return 1 is success , 0 is failure @return 1 is success , 0 is failure