New flag bit4 of burn_read_data() for better handling of TAO end blocks

This commit is contained in:
Thomas Schmitt 2012-10-25 12:39:50 +00:00
parent f689525bee
commit 3fce53d739
6 changed files with 38 additions and 6 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2012.10.24.095725"
#define Cdrskin_timestamP "2012.10.25.123837"

View File

@ -3767,6 +3767,13 @@ int burn_get_read_capacity(struct burn_drive *d, int *capacity, int flag);
bit3= return -2 on permission denied error rather than
issueing a warning message.
@since 1.0.6
bit4= return -3 on SCSI error
5 64 00 ILLEGAL MODE FOR THIS TRACK
and prevent this error from being reported as
event message. Do not retry reading in this case.
(Useful to try the last two blocks of a CD
track which might be non-data because of TAO.)
@since 1.2.6
@return 1=sucessful , <=0 an error occured
with bit3: -2= permission denied error
@since 0.4.0

View File

@ -4193,7 +4193,7 @@ int mmc_read_10(struct burn_drive *d, int start,int amount, struct buffer *buf)
{
struct command *c;
char *msg = NULL;
int key, asc, ascq;
int key, asc, ascq, silent;
c = &(d->casual_command);
mmc_start_if_needed(d, 0);
@ -4221,7 +4221,12 @@ int mmc_read_10(struct burn_drive *d, int start,int amount, struct buffer *buf)
"SCSI error on read_10(%d,%d): ", start, amount);
scsi_error_msg(d, c->sense, 14, msg + strlen(msg),
&key, &asc, &ascq);
if(!d->silent_on_scsi_error)
silent = (d->silent_on_scsi_error == 1);
if (key == 5 && asc == 0x64 && ascq == 0x0) {
d->had_particular_error |= 1;
silent = 1;
}
if(!silent)
libdax_msgs_submit(libdax_messenger,
d->global_index,
0x00020144,

View File

@ -1,7 +1,7 @@
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
Copyright (c) 2006 - 2012 Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later.
*/
@ -472,6 +472,11 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
cpy_size = data_size - *data_count;
if (flag & 2)
d->silent_on_scsi_error = 1;
if (flag & 16) {
d->had_particular_error &= ~1;
if (!d->silent_on_scsi_error)
d->silent_on_scsi_error = 2;
}
if (d->drive_role == 1) {
err = d->read_10(d, start, chunksize, d->buffer);
} else {
@ -481,9 +486,11 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
if (ret <= 0)
err = BE_CANCELLED;
}
if (flag & 2)
if (flag & (2 | 16))
d->silent_on_scsi_error = sose_mem;
if (err == BE_CANCELLED) {
if ((flag & 16) && (d->had_particular_error & 1))
ret = -3; goto ex;
/* Try to read a smaller part of the chunk */
if(!(flag & 4))
for (i = 0; i < chunksize - 1; i++) {

View File

@ -1003,6 +1003,9 @@ int burn_scsi_setup_drive(struct burn_drive *d, int bus_no, int host_no,
/* ts A61106 */
d->silent_on_scsi_error = 0;
/* ts B21023 */
d->had_particular_error = 0;
d->idata = calloc(1, sizeof(struct burn_scsi_inquiry_data));
d->mdata = calloc(1, sizeof(struct scsi_mode_data));

View File

@ -1,7 +1,7 @@
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
Copyright (c) 2006 - 2012 Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later.
*/
@ -261,8 +261,18 @@ struct burn_drive
volatile int released;
/* ts A61106 */
/* 0= report errors
1= do not report errors
2= do not report errors which the libburn function indicates in
member .had_particular_error
*/
int silent_on_scsi_error;
/* ts B21023 */
/* bit0= 5 64 00 occured with READ10 in mmc_read_10()
*/
int had_particular_error;
int stdio_fd;
int nwa; /* next writeable address */