"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libburn/mmc.c" between
xorriso-1.5.2.tar.gz and xorriso-1.5.4.tar.gz

About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.

mmc.c  (xorriso-1.5.2):mmc.c  (xorriso-1.5.4)
skipping to change at line 103 skipping to change at line 103
/* ts A90603 : Simulate the command restrictions of an old MMC-1 drive /* ts A90603 : Simulate the command restrictions of an old MMC-1 drive
# define Libisofs_simulate_old_mmc1_drivE 1 # define Libisofs_simulate_old_mmc1_drivE 1
*/ */
/* DVD/BD progress report: /* DVD/BD progress report:
ts A61219 : It seems to work with a used (i.e. thoroughly formatted) DVD+RW. ts A61219 : It seems to work with a used (i.e. thoroughly formatted) DVD+RW.
Error messages of class DEBUG appear because of inability to Error messages of class DEBUG appear because of inability to
read TOC or track info. Nevertheless, the written images verify. read TOC or track info. Nevertheless, the written images verify.
ts A61220 : Burned to a virgin DVD+RW by help of new mmc_format_unit() ts A61220 : Burned to a virgin DVD+RW by help of new mmc_format_unit()
(did not test wether it would work without). Burned to a (did not test whether it would work without). Burned to a
not completely formatted DVD+RW. (Had worked before without not completely formatted DVD+RW. (Had worked before without
mmc_format_unit() but i did not exceed the formatted range mmc_format_unit() but i did not exceed the formatted range
as reported by dvd+rw-mediainfo.) as reported by dvd+rw-mediainfo.)
ts A61221 : Speed setting now works for both of my drives. The according ts A61221 : Speed setting now works for both of my drives. The according
functions in dvd+rw-tools are a bit intimidating to the reader. functions in dvd+rw-tools are a bit intimidating to the reader.
I hope it is possible to leave much of this to the drive. I hope it is possible to leave much of this to the drive.
And if it fails ... well, it's only speed setting. :)) And if it fails ... well, it's only speed setting. :))
ts A61229 : Burned to several DVD-RW formatted to mode Restricted Overwrite ts A61229 : Burned to several DVD-RW formatted to mode Restricted Overwrite
by dvd+rw-format. Needs Libburn_support_dvd_minusrw_overW. by dvd+rw-format. Needs Libburn_support_dvd_minusrw_overW.
ts A61230 : Other than growisofs, libburn does not send a mode page 5 for ts A61230 : Other than growisofs, libburn does not send a mode page 5 for
skipping to change at line 487 skipping to change at line 487
} }
BURN_ALLOC_MEM(msg, char, 160); BURN_ALLOC_MEM(msg, char, 160);
if (trackno > 0) if (trackno > 0)
sprintf(msg, "Track number %d: ", trackno); sprintf(msg, "Track number %d: ", trackno);
else else
sprintf(msg, "Upcoming track: "); sprintf(msg, "Upcoming track: ");
if (d->current_profile == 0x1a || d->current_profile == 0x13 || if (d->current_profile == 0x1a || d->current_profile == 0x13 ||
d->current_profile == 0x12 || d->current_profile == 0x43) { d->current_profile == 0x12 || d->current_profile == 0x43) {
/* overwriteable */ /* overwritable */
*lba = *nwa = num = 0; *lba = *nwa = num = 0;
} else if (data[5] & 32) { /* ts B10534 : MMC-5 6.27.3.7 Damage Bit */ } else if (data[5] & 32) { /* ts B10534 : MMC-5 6.27.3.7 Damage Bit */
if (!(data[7] & 1)) { /* NWA_V is set to zero */ if (!(data[7] & 1)) { /* NWA_V is set to zero */
/* "not closed due to an incomplete write" */ /* "not closed due to an incomplete write" */
strcat(msg, "Damaged, not closed and not writable"); strcat(msg, "Damaged, not closed and not writable");
err= 0x00020185; err= 0x00020185;
} else { } else {
/* "may be recorded further in an incremental manner"*/ /* "may be recorded further in an incremental manner"*/
strcat(msg, "Damaged and not closed"); strcat(msg, "Damaged and not closed");
skipping to change at line 1552 skipping to change at line 1552
c->page = buf; c->page = buf;
c->page->bytes = 0; c->page->bytes = 0;
c->page->sectors = 0; c->page->sectors = 0;
c->dir = FROM_DRIVE; c->dir = FROM_DRIVE;
d->issue_command(d, c); d->issue_command(d, c);
if (c->error) { if (c->error) {
/* ts A61020 : this snaps on non-blank DVD media */ /* ts A61020 : this snaps on non-blank DVD media */
/* ts A61106 : also snaps on CD with unclosed track/session */ /* ts A61106 : also snaps on CD with unclosed track/session */
/* Very unsure wether this old measure is ok. /* Very unsure whether this old measure is ok.
Obviously higher levels do not care about this. Obviously higher levels do not care about this.
outdated info: DVD+RW burns go on after passing through here. outdated info: DVD+RW burns go on after passing through here.
d->busy = BURN_DRIVE_IDLE; d->busy = BURN_DRIVE_IDLE;
*/ */
libdax_msgs_submit(libdax_messenger, d->global_index, libdax_msgs_submit(libdax_messenger, d->global_index,
0x0002010d, 0x0002010d,
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH, LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH,
"Could not inquire TOC", 0,0); "Could not inquire TOC", 0,0);
d->status = BURN_DISC_UNSUITABLE; d->status = BURN_DISC_UNSUITABLE;
skipping to change at line 2790 skipping to change at line 2790
c->page = buf; c->page = buf;
c->page->bytes = 28; c->page->bytes = 28;
c->opcode[9] = (c->page->bytes >> 8) & 0xff; c->opcode[9] = (c->page->bytes >> 8) & 0xff;
c->opcode[10] = c->page->bytes & 0xff; c->opcode[10] = c->page->bytes & 0xff;
c->page->sectors = 0; c->page->sectors = 0;
c->dir = TO_DRIVE; c->dir = TO_DRIVE;
memset(c->page->data, 0, c->page->bytes); memset(c->page->data, 0, c->page->bytes);
pd = c->page->data; pd = c->page->data;
pd[0] = 0; /* WRC=0 (Default Rotation Control), RDD=Exact=RA=0 */ pd[0] = 0; /* WRC=0 (Default Rotation Control), RDD=Exact=RA=0 */
if (d->set_streaming_exact_bit)
pd[0] |= 2; /* Exact= 1 */
if (w_speed == 0) if (w_speed == 0)
w_speed = 0x10000000; /* ~ 2 TB/s */ w_speed = 0x10000000; /* ~ 2 TB/s */
else if (w_speed < 0) else if (w_speed < 0)
w_speed = 177; /* 1x CD */ w_speed = 177; /* 1x CD */
if (r_speed == 0) if (r_speed == 0)
r_speed = 0x10000000; /* ~ 2 TB/s */ r_speed = 0x10000000; /* ~ 2 TB/s */
else if (r_speed < 0) else if (r_speed < 0)
r_speed = 177; /* 1x CD */ r_speed = 177; /* 1x CD */
if (end_lba == 0) { if (end_lba == 0) {
/* Default computed from 4.7e9 */ /* Default computed from 4.7e9 */
eff_end_lba = 2294921 - 1; eff_end_lba = 2294921 - 1;
if (d->mdata->max_end_lba > 0) if (d->mdata->max_end_lba > 0)
eff_end_lba = d->mdata->max_end_lba - 1; eff_end_lba = d->mdata->max_end_lba - 1;
} else } else
eff_end_lba = end_lba; eff_end_lba = end_lba;
sprintf(msg, "mmc_set_streaming: end_lba=%d , r=%d , w=%d", sprintf(msg,
eff_end_lba, r_speed, w_speed); "mmc_set_streaming: end_lba=%d , r=%d , w=%d , exact=%d",
eff_end_lba, r_speed, w_speed, !!(pd[0] & 2));
libdax_msgs_submit(libdax_messenger, d->global_index, 0x00000002, libdax_msgs_submit(libdax_messenger, d->global_index, 0x00000002,
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO, LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
msg, 0, 0); msg, 0, 0);
/* start_lba is 0 , 1000 = 1 second as base time for data rate */ /* start_lba is 0 , 1000 = 1 second as base time for data rate */
for (b = 0; b < 4 ; b++) { for (b = 0; b < 4 ; b++) {
pd[8+b] = (eff_end_lba >> (24 - 8 * b)) & 0xff; pd[8+b] = (eff_end_lba >> (24 - 8 * b)) & 0xff;
pd[12+b] = (r_speed >> (24 - 8 * b)) & 0xff; pd[12+b] = (r_speed >> (24 - 8 * b)) & 0xff;
pd[16+b] = (1000 >> (24 - 8 * b)) & 0xff; pd[16+b] = (1000 >> (24 - 8 * b)) & 0xff;
pd[20+b] = (w_speed >> (24 - 8 * b)) & 0xff; pd[20+b] = (w_speed >> (24 - 8 * b)) & 0xff;
skipping to change at line 2843 skipping to change at line 2846
sprintf(msg, sprintf(msg,
"SCSI error on set_streaming(%d): ", w_speed); "SCSI error on set_streaming(%d): ", w_speed);
scsi_error_msg(d, c->sense, 14, msg + strlen(msg), scsi_error_msg(d, c->sense, 14, msg + strlen(msg),
&key, &asc, &ascq); &key, &asc, &ascq);
libdax_msgs_submit(libdax_messenger, d->global_index, libdax_msgs_submit(libdax_messenger, d->global_index,
0x00020124, 0x00020124,
d->silent_on_scsi_error == 3 ? d->silent_on_scsi_error == 3 ?
LIBDAX_MSGS_SEV_DEBUG : LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_SEV_DEBUG : LIBDAX_MSGS_SEV_SORRY,
LIBDAX_MSGS_PRIO_HIGH, msg, 0, 0); LIBDAX_MSGS_PRIO_HIGH, msg, 0, 0);
} }
if (key != 0)
d->set_streaming_err = 1;
{ret = 0; goto ex;} {ret = 0; goto ex;}
} }
ret = 1; ret = 1;
ex:; ex:;
BURN_FREE_MEM(msg); BURN_FREE_MEM(msg);
BURN_FREE_MEM(c); BURN_FREE_MEM(c);
BURN_FREE_MEM(buf); BURN_FREE_MEM(buf);
return ret; return ret;
} }
skipping to change at line 2919 skipping to change at line 2924
end_lba = best_sd->end_lba; end_lba = best_sd->end_lba;
} }
} }
} }
/* A70711 */ /* A70711 */
d->nominal_write_speed = w; d->nominal_write_speed = w;
/* ts A61221 : try to set DVD speed via command B6h */ /* ts A61221 : try to set DVD speed via command B6h */
if (strstr(d->current_profile_text, "DVD") == d->current_profile_text if (strstr(d->current_profile_text, "DVD") == d->current_profile_text
|| || strstr(d->current_profile_text, "BD") == d->current_profile_text
strstr(d->current_profile_text, "BD") == d->current_profile_text) { || d->set_streaming_exact_bit) {
ret = mmc_set_streaming(d, r, w, end_lba); ret = mmc_set_streaming(d, r, w, end_lba);
if (ret != 0) if (ret != 0)
return; /* success or really fatal failure */ return; /* success or really fatal failure */
} }
/* ts A61112 : MMC standards prescribe FFFFh as max speed. /* ts A61112 : MMC standards prescribe FFFFh as max speed.
But libburn.h prescribes 0. But libburn.h prescribes 0.
ts A70715 : <0 now means minimum speed */ ts A70715 : <0 now means minimum speed */
if (r == 0 || r > 0xffff) if (r == 0 || r > 0xffff)
r = 0xffff; r = 0xffff;
skipping to change at line 3607 skipping to change at line 3612
ret = 1; ret = 1;
ex:; ex:;
BURN_FREE_MEM(c); BURN_FREE_MEM(c);
BURN_FREE_MEM(buf); BURN_FREE_MEM(buf);
return ret; return ret;
} }
/* ts A61219 : learned much from dvd+rw-tools-7.0: plus_rw_format() /* ts A61219 : learned much from dvd+rw-tools-7.0: plus_rw_format()
and mmc5r03c.pdf, 6.5 FORMAT UNIT */ and mmc5r03c.pdf, 6.5 FORMAT UNIT */
/* /*
@param size The size (in bytes) to be sent with the FORMAT comand @param size The size (in bytes) to be sent with the FORMAT command
@param flag bit1+2: size mode @param flag bit1+2: size mode
0 = use parameter size as far as it makes sense 0 = use parameter size as far as it makes sense
1 = insist in size 0 even if there is a better default known 1 = insist in size 0 even if there is a better default known
2 = without bit7: format to maximum available size 2 = without bit7: format to maximum available size
with bit7 : take size from indexed format descriptor with bit7 : take size from indexed format descriptor
3 = format to default size 3 = format to default size
bit3= expand format up to at least size bit3= expand format up to at least size
bit4= enforce re-format of (partly) formatted media bit4= enforce re-format of (partly) formatted media
bit5= try to disable eventual defect management bit5= try to disable eventual defect management
bit6= try to avoid lengthy media certification bit6= try to avoid lengthy media certification
skipping to change at line 3662 skipping to change at line 3667
c->timeout = Libburn_mmc_blank_timeouT; c->timeout = Libburn_mmc_blank_timeouT;
memset(c->page->data, 0, c->page->bytes); memset(c->page->data, 0, c->page->bytes);
descr[0] = 0; descr[0] = 0;
if (!d->do_no_immed) if (!d->do_no_immed)
c->page->data[1] = 0x02; /* Immed */ c->page->data[1] = 0x02; /* Immed */
c->page->data[3] = 8; /* Format descriptor length */ c->page->data[3] = 8; /* Format descriptor length */
num_of_blocks = size / 2048; num_of_blocks = size / 2048;
mmc_int_to_four_char(c->page->data + 4, num_of_blocks); mmc_int_to_four_char(c->page->data + 4, num_of_blocks);
if (flag & 128) { /* explicitely chosen format descriptor */ if (flag & 128) { /* explicitly chosen format descriptor */
/* use case: the app knows what to do */ /* use case: the app knows what to do */
ret = mmc_read_format_capacities(d, -1); ret = mmc_read_format_capacities(d, -1);
if (ret <= 0) if (ret <= 0)
goto selected_not_suitable; goto selected_not_suitable;
index = (flag >> 8) & 0xff; index = (flag >> 8) & 0xff;
if(index < 0 || index >= d->num_format_descr) { if(index < 0 || index >= d->num_format_descr) {
selected_not_suitable:; selected_not_suitable:;
libdax_msgs_submit(libdax_messenger, d->global_index, libdax_msgs_submit(libdax_messenger, d->global_index,
0x00020132, 0x00020132,
 End of changes. 9 change blocks. 
9 lines changed or deleted 14 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)