Workaround for Pioneer DVR-216D refusal to eject

This commit is contained in:
Thomas Schmitt 2009-11-12 17:56:18 +00:00
parent 0f37170759
commit 9160b1dcbb
4 changed files with 35 additions and 29 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2009.11.12.175514"
#define Cdrskin_timestamP "2009.11.12.175735"

View File

@ -245,8 +245,14 @@ int mmc_function_spy(struct burn_drive *d, char * text)
d->cancel = 1;
return 0;
}
/* >>> should one rather have a positve list ? */
if (d->is_stopped && strcmp(text, "stop_unit") != 0 &&
strcmp(text, "eject") != 0 &&
strcmp(text, "start_unit") != 0 &&
strcmp(text, "load") != 0 &&
strncmp(text, "enumerate", 9) != 0 &&
strncmp(text, "sg_", 3) != 0) {
d->start_unit(d);
d->is_stopped = 0;

View File

@ -31,11 +31,6 @@ void sbc_load(struct burn_drive *d)
return;
scsi_init_command(&c, SBC_LOAD, sizeof(SBC_LOAD));
/*
memcpy(c.opcode, SBC_LOAD, sizeof(SBC_LOAD));
c.oplen = sizeof(SBC_LOAD);
c.page = NULL;
*/
c.retry = 1;
/* ts A70921 : Had to revoke Immed because of LG GSA-4082B */
@ -59,14 +54,7 @@ void sbc_eject(struct burn_drive *d)
return;
scsi_init_command(&c, SBC_UNLOAD, sizeof(SBC_UNLOAD));
/*
memcpy(c.opcode, SBC_UNLOAD, sizeof(SBC_UNLOAD));
c.oplen = sizeof(SBC_UNLOAD);
c.page = NULL;
*/
c.opcode[1] |= 1; /* ts A70918 : Immed */
c.page = NULL;
c.dir = NO_TRANSFER;
d->issue_command(d, &c);
@ -76,8 +64,11 @@ void sbc_eject(struct burn_drive *d)
spc_wait_unit_attention(d, 1800, "STOP UNIT (+ EJECT)", 0);
}
/* ts A61118 : is it necessary to tell the drive to get ready for use ? */
int sbc_start_unit(struct burn_drive *d)
/* ts A91112 : Now with flag */
/* @param flag bit0= asynchronous waiting
*/
int sbc_start_unit_flag(struct burn_drive *d, int flag)
{
struct command c;
int ret;
@ -87,17 +78,37 @@ int sbc_start_unit(struct burn_drive *d)
scsi_init_command(&c, SBC_START_UNIT, sizeof(SBC_START_UNIT));
c.retry = 1;
c.opcode[1] |= 1; /* ts A70918 : Immed */
c.opcode[1] |= (flag & 1); /* ts A70918 : Immed */
c.dir = NO_TRANSFER;
d->issue_command(d, &c);
if (c.error)
return 0;
/* ts A70918 : now asynchronous */
d->is_stopped = 0;
if (!(flag & 1))
return 1;
/* ts A70918 : asynchronous */
ret = spc_wait_unit_attention(d, 1800, "START UNIT", 0);
return ret;
}
int sbc_start_unit(struct burn_drive *d)
{
int ret;
d->is_stopped = 0; /* no endless starting attempts */
/* Asynchronous, not to block controller by waiting */
ret = sbc_start_unit_flag(d, 1);
if (ret <= 0)
return ret;
/* Synchronous to catch Pioneer DVD-216D which is ready too early.
A pending START UNIT can prevent ejecting of the tray.
*/
ret = sbc_start_unit_flag(d, 0);
return ret;
}
/* ts A90824 : Trying to reduce drive noise */
int sbc_stop_unit(struct burn_drive *d)
{

View File

@ -761,14 +761,6 @@ void spc_probe_write_modes(struct burn_drive *d)
c.page->data[23] = 150;
c.dir = TO_DRIVE;
#ifdef Libburn_pioneer_dvr_216d_no_probe_wM
key = asc = ascq = 0;
if (last_try)
break;
#else /* Libburn_pioneer_dvr_216d_no_probe_wM */
d->silent_on_scsi_error = 1;
d->issue_command(d, &c);
d->silent_on_scsi_error = 0;
@ -779,9 +771,6 @@ void spc_probe_write_modes(struct burn_drive *d)
key = c.sense[2];
asc = c.sense[12];
ascq = c.sense[13];
#endif /* ! Libburn_pioneer_dvr_216d_no_probe_wM */
if (key)
burn_print(7, "%d not supported\n", try_block_type);
else {