Test wether SCSI 1Bh START UNIT would be helpful with ticket 90

This commit is contained in:
Thomas Schmitt 2006-11-18 19:49:18 +00:00
parent 18a592ad28
commit ebb94ee212
5 changed files with 26 additions and 2 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2006.11.16.133951"
#define Cdrskin_timestamP "2006.11.18.194606"

View File

@ -156,10 +156,13 @@ int burn_drive_grab(struct burn_drive *d, int le)
}
d->busy = BURN_DRIVE_GRABBING;
if (le)
if (le) {
d->load(d);
d->start_unit(d);
}
d->lock(d);
d->start_unit(d);
/* ts A61020 : this was BURN_DISC_BLANK as pure guess */
d->status = BURN_DISC_UNREADY;

View File

@ -11,6 +11,7 @@
/* spc command set */
static char SBC_LOAD[] = { 0x1b, 0, 0, 0, 3, 0 };
static char SBC_UNLOAD[] = { 0x1b, 0, 0, 0, 2, 0 };
static char SBC_START_UNIT[] = { 0x1b, 0, 0, 0, 1, 0 };
void sbc_load(struct burn_drive *d)
{
@ -37,12 +38,28 @@ void sbc_eject(struct burn_drive *d)
d->issue_command(d, &c);
}
/* ts A61118 : is it necessary to tell the drive to get ready for use ? */
int sbc_start_unit(struct burn_drive *d)
{
struct command c;
memcpy(c.opcode, SBC_START_UNIT, sizeof(SBC_START_UNIT));
c.retry = 1;
c.oplen = sizeof(SBC_START_UNIT);
c.dir = NO_TRANSFER;
c.page = NULL;
d->issue_command(d, &c);
return (c.error==0);
}
/* ts A61021 : the sbc specific part of sg.c:enumerate_common()
*/
int sbc_setup_drive(struct burn_drive *d)
{
d->eject = sbc_eject;
d->load = sbc_load;
d->start_unit = sbc_start_unit;
return 1;
}

View File

@ -8,6 +8,9 @@ struct burn_drive;
void sbc_load(struct burn_drive *);
void sbc_eject(struct burn_drive *);
/* ts A61118 */
int sbc_start_unit(struct burn_drive *);
/* ts A61021 : the sbc specific part of sg.c:enumerate_common()
*/
int sbc_setup_drive(struct burn_drive *d);

View File

@ -159,6 +159,7 @@ struct burn_drive
void (*unlock) (struct burn_drive *);
void (*eject) (struct burn_drive *);
void (*load) (struct burn_drive *);
int (*start_unit) (struct burn_drive *);
void (*read_disc_info) (struct burn_drive *);
void (*read_sectors) (struct burn_drive *,
int start,