Implemented automatic START UNIT after STOP UNIT before any other SCSI command

This commit is contained in:
Thomas Schmitt 2009-08-24 20:24:39 +00:00
parent b900831914
commit 22c187cd61
4 changed files with 19 additions and 3 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2009.08.24.161646"
#define Cdrskin_timestamP "2009.08.24.202517"

View File

@ -236,6 +236,11 @@ int mmc_function_spy(struct burn_drive *d, char * text)
d->cancel = 1;
return 0;
}
if (d->is_stopped && strcmp(text, "stop_unit") != 0 &&
strcmp(text, "start_unit") != 0) {
d->start_unit(d);
d->is_stopped = 0;
}
return 1;
}

View File

@ -80,6 +80,7 @@ void sbc_eject(struct burn_drive *d)
int sbc_start_unit(struct burn_drive *d)
{
struct command c;
int ret;
if (mmc_function_spy(d, "start_unit") <= 0)
return 0;
@ -92,13 +93,16 @@ int sbc_start_unit(struct burn_drive *d)
if (c.error)
return 0;
/* ts A70918 : now asynchronous */
return spc_wait_unit_attention(d, 1800, "START UNIT", 0);
d->is_stopped = 0;
ret = spc_wait_unit_attention(d, 1800, "START UNIT", 0);
return ret;
}
/* ts A90824 : Trying to reduce drive noise */
int sbc_stop_unit(struct burn_drive *d)
{
struct command c;
int ret;
if (mmc_function_spy(d, "stop_unit") <= 0)
return 0;
@ -110,7 +114,9 @@ int sbc_stop_unit(struct burn_drive *d)
d->issue_command(d, &c);
if (c.error)
return 0;
return spc_wait_unit_attention(d, 1800, "STOP UNIT", 0);
ret = spc_wait_unit_attention(d, 1800, "STOP UNIT", 0);
d->is_stopped = 1;
return ret;
}
@ -123,6 +129,7 @@ int sbc_setup_drive(struct burn_drive *d)
d->load = sbc_load;
d->start_unit = sbc_start_unit;
d->stop_unit = sbc_stop_unit;
d->is_stopped = 0;
return 1;
}

View File

@ -317,7 +317,11 @@ struct burn_drive
void (*eject) (struct burn_drive *);
void (*load) (struct burn_drive *);
int (*start_unit) (struct burn_drive *);
/* ts A90824 : Calming down noisy drives */
int (*stop_unit) (struct burn_drive *);
int is_stopped;
void (*read_disc_info) (struct burn_drive *);
void (*read_sectors) (struct burn_drive *,
int start,