New SCSI comand response "GO_ON"

This commit is contained in:
Thomas Schmitt 2010-08-08 09:13:04 +00:00
parent d4e4607a84
commit 54651df146
7 changed files with 55 additions and 3 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2010.08.03.091119"
#define Cdrskin_timestamP "2010.08.08.091224"

View File

@ -974,6 +974,14 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
done = 1;
c->error = 1;
break;
case GO_ON:
if (burn_sg_log_scsi & 3)
/* >>> Need own duration time
measurement. Then remove bit1 */
scsi_log_err(c, fp, c->sense,
sense_len > 0 ? sense_len : 18,
0, 1 | 2);
{ret = 1; goto ex;}
}
} else {
done = 1;
@ -1003,6 +1011,10 @@ int burn_os_is_2k_seekrw(char *path, int flag)
struct stat stbuf;
char *spt;
int i, e;
#ifdef Libburn_DIOCGMEDIASIZE_ISBLK
int fd;
off_t add_size;
#endif
if (stat(path, &stbuf) == -1)
return 0;
@ -1010,6 +1022,22 @@ int burn_os_is_2k_seekrw(char *path, int flag)
return 1;
if (!S_ISCHR(stbuf.st_mode))
return 0;
#ifdef Libburn_DIOCGMEDIASIZE_ISBLK
/* If it throws no error with DIOCGMEDIASIZE then it is a
'block device'
*/
fd = open(path, O_RDONLY);
if (fd == -1)
return 0;
ret = ioctl(fd, DIOCGMEDIASIZE, &add_size);
close(fd);
return 1;
#else /* Libburn_DIOCGMEDIASIZE_ISBLK */
spt = strrchr(path, '/');
if (spt == NULL)
spt = path;
@ -1032,6 +1060,9 @@ int burn_os_is_2k_seekrw(char *path, int flag)
if (strncmp(spt, "fla", e) == 0) /* Flash drive */
return 1;
return 0;
#endif /* ! Libburn_DIOCGMEDIASIZE_ISBLK */
}

View File

@ -705,6 +705,13 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
case FAIL:
c->error = 1;
goto ex;
case GO_ON:
if (burn_sg_log_scsi & 3)
/* >>> Need own duration time
measurement. Then remove bit1 */
scsi_log_err(c, fp, c->sense, 18, 0,
1 | 2);
goto ex;
}
/*
Calming down retries and breaking up endless cycle

View File

@ -1930,6 +1930,11 @@ if(0){
done = 1;
c->error = 1;
break;
case GO_ON:
if (burn_sg_log_scsi & 3)
scsi_log_err(c, fp, s.sbp, s.sb_len_wr,
s.duration, 1);
goto ex;
}
/* ts A90921 :

View File

@ -660,6 +660,13 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
case FAIL:
c->error = 1;
goto ex;
case GO_ON:
if (burn_sg_log_scsi & 3)
/* >>> Need own duration time
measurement. Then remove bit1 */
scsi_log_err(c, fp, c->sense, 18, 0,
1 | 2);
goto ex;
}
/*
Calming down retries and breaking up endless cycle

View File

@ -1017,8 +1017,10 @@ enum response scsi_error_msg(struct burn_drive *d, unsigned char *sense,
switch (*asc) {
case 0x00:
if (*key > 0 || *ascq > 0)
break; /* Fall through to unknown error */
sprintf(msg, "(No error reported by SCSI transaction)");
return RETRY;
return GO_ON;
case 0x02:
sprintf(msg, "Not ready");

View File

@ -49,7 +49,7 @@ int burn_scsi_setup_drive(struct burn_drive *d, int bus_no, int host_no,
int channel_no, int target_no, int lun_no, int flag);
/* ts A61115 moved from sg-*.h */
enum response { RETRY, FAIL };
enum response { RETRY, FAIL, GO_ON };
enum response scsi_error(struct burn_drive *, unsigned char *, int);
/* ts A61122 */