New SCSI comand response "GO_ON"

This commit is contained in:
Thomas Schmitt 2010-08-08 09:13:04 +00:00
parent 6062ae2b50
commit d60cac2c92
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; done = 1;
c->error = 1; c->error = 1;
break; 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 { } else {
done = 1; done = 1;
@ -1003,6 +1011,10 @@ int burn_os_is_2k_seekrw(char *path, int flag)
struct stat stbuf; struct stat stbuf;
char *spt; char *spt;
int i, e; int i, e;
#ifdef Libburn_DIOCGMEDIASIZE_ISBLK
int fd;
off_t add_size;
#endif
if (stat(path, &stbuf) == -1) if (stat(path, &stbuf) == -1)
return 0; return 0;
@ -1010,6 +1022,22 @@ int burn_os_is_2k_seekrw(char *path, int flag)
return 1; return 1;
if (!S_ISCHR(stbuf.st_mode)) if (!S_ISCHR(stbuf.st_mode))
return 0; 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, '/'); spt = strrchr(path, '/');
if (spt == NULL) if (spt == NULL)
spt = path; spt = path;
@ -1032,6 +1060,9 @@ int burn_os_is_2k_seekrw(char *path, int flag)
if (strncmp(spt, "fla", e) == 0) /* Flash drive */ if (strncmp(spt, "fla", e) == 0) /* Flash drive */
return 1; return 1;
return 0; 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: case FAIL:
c->error = 1; c->error = 1;
goto ex; 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 Calming down retries and breaking up endless cycle

View File

@ -1930,6 +1930,11 @@ if(0){
done = 1; done = 1;
c->error = 1; c->error = 1;
break; 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 : /* ts A90921 :

View File

@ -660,6 +660,13 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
case FAIL: case FAIL:
c->error = 1; c->error = 1;
goto ex; 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 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) { switch (*asc) {
case 0x00: case 0x00:
if (*key > 0 || *ascq > 0)
break; /* Fall through to unknown error */
sprintf(msg, "(No error reported by SCSI transaction)"); sprintf(msg, "(No error reported by SCSI transaction)");
return RETRY; return GO_ON;
case 0x02: case 0x02:
sprintf(msg, "Not ready"); 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); int channel_no, int target_no, int lun_no, int flag);
/* ts A61115 moved from sg-*.h */ /* 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); enum response scsi_error(struct burn_drive *, unsigned char *, int);
/* ts A61122 */ /* ts A61122 */