Adapted to pitfalls of U3 memory sticks which appear as CD-ROM drives

This commit is contained in:
Thomas Schmitt 2009-08-23 13:08:19 +00:00
parent ff23614200
commit 0571f4dc2e
4 changed files with 36 additions and 9 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2009.08.15.133744"
#define Cdrskin_timestamP "2009.08.23.130326"

View File

@ -1892,11 +1892,16 @@ int burn_disc_read_atip(struct burn_drive *d)
}
if(d->drive_role != 1)
return 0;
if (d->current_profile == -1 || d->current_is_cd_profile) {
if ((d->current_profile == -1 || d->current_is_cd_profile)
&& (d->mdata->cdrw_write || d->current_profile != 0x08)) {
d->read_atip(d);
/* >>> some control of success would be nice :) */
} else {
/* mmc5r03c.pdf 6.26.3.6.3 : ATIP is undefined for non-CD */;
/* mmc5r03c.pdf 6.26.3.6.3 : ATIP is undefined for non-CD
(and it seems meaningless for non-burners).
ts A90823: Pseudo-CD U3 memory stick stalls with ATIP.
It is !cdrw_write and profile is 0x08.
*/
return 0;
}
return 1;

View File

@ -1159,7 +1159,7 @@ static int mmc_read_toc_al(struct burn_drive *d, int *alloc_len)
struct buffer buf;
struct command c;
int dlen;
int i, bpl= 12, old_alloc_len, t_idx;
int i, bpl= 12, old_alloc_len, t_idx, ret;
unsigned char *tdata;
char msg[321];
@ -1185,6 +1185,16 @@ static int mmc_read_toc_al(struct burn_drive *d, int *alloc_len)
d->status = BURN_DISC_FULL;
return 1;
}
/* ts A90823:
SanDisk Cruzer U3 memory stick stalls on format 2.
Format 0 seems to be more conservative with read-only drives.
*/
if (!(d->mdata->cdrw_write || d->current_profile != 0x08)) {
ret = mmc_read_toc_fmt0(d);
return ret;
}
scsi_init_command(&c, MMC_GET_TOC, sizeof(MMC_GET_TOC));
/*
memcpy(c.opcode, MMC_GET_TOC, sizeof(MMC_GET_TOC));

View File

@ -463,12 +463,24 @@ static int spc_sense_caps_al(struct burn_drive *d, int *alloc_len, int flag)
m->min_write_speed, m->max_write_speed);
try_mmc_get_performance:;
if (m->cdrw_write || page_length >= 32) {
/* ts A90823:
One has to avoid U3 enhanced memory sticks here. On my
SuSE 10.2 a SanDisk Cruzer 4GB stalls at the second occasion
of ACh GET PERFORMANCE. (The first one is obviously called
by the OS at plug time.)
This pseudo drive returns no write capabilities and a page
length of 28. MMC-3 describes page length 32. Regrettably
MMC-2 prescribes a page length of 26. Here i have to trust
m->cdrw_write to reliably indicate any MMC-2 burner.
*/
ret = mmc_get_write_performance(d);
if (ret > 0 && speed_debug)
fprintf(stderr,
"LIBBURN_DEBUG: ACh min_write_speed = %d , max_write_speed = %d\n",
m->min_write_speed, m->max_write_speed);
}
return !was_error;
}