Interpreting feature 0023h for BD-R formatting capabilities

This commit is contained in:
Thomas Schmitt 2008-12-12 21:40:34 +00:00
parent e035ee80fa
commit 7618b01d1c
4 changed files with 78 additions and 5 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2008.12.12.112129"
#define Cdrskin_timestamP "2008.12.12.214013"

View File

@ -439,9 +439,51 @@ void burn_disc_format(struct burn_drive *drive, off_t size, int flag)
} else if (drive->current_profile == 0x43) {
ok = 1; /* BD-RE */
/* >>> check feature 0023h for QCert (= bit6)
and Cert (= !bit6)
*/
if ((flag & 32) && !(drive->current_feat23h_byte4 & 8)) {
libdax_msgs_submit(libdax_messenger,
drive->global_index, 0x00020164,
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
"Drive does not format BD-RE without spares.",
0, 0);
drive->cancel = 1;
return;
}
if ((flag & 6) != 3 || (flag & 128)) {
if ((flag & 64) && !(drive->current_feat23h_byte4 & 2)) {
if (drive->current_feat23h_byte4 & 1) {
libdax_msgs_submit(libdax_messenger,
drive->global_index, 0x00020165,
LIBDAX_MSGS_SEV_WARNING,
LIBDAX_MSGS_PRIO_HIGH,
"Drive does not support fast formatting",
0, 0);
flag &= ~64;
} else {
no_non_default_bd_re:;
libdax_msgs_submit(libdax_messenger,
drive->global_index, 0x00020167,
LIBDAX_MSGS_SEV_SORRY,
LIBDAX_MSGS_PRIO_HIGH,
"Drive does not support non-default formatting",
0, 0);
drive->cancel = 1;
return;
}
}
if ((!(flag & 64)) && !(drive->current_feat23h_byte4 & 1)){
if (drive->current_feat23h_byte4 & 2) {
libdax_msgs_submit(libdax_messenger,
drive->global_index, 0x00020166,
LIBDAX_MSGS_SEV_WARNING,
LIBDAX_MSGS_PRIO_HIGH,
"Drive does not support full formatting",
0, 0);
flag |= 64;
} else
goto no_non_default_bd_re;
}
}
}

View File

@ -2211,6 +2211,8 @@ static int mmc_get_configuration_al(struct burn_drive *d, int *alloc_len)
d->current_is_supported_profile = 0;
d->current_has_feat21h = 0;
d->current_feat21h_link_size = -1;
d->current_feat23h_byte4 = 0;
d->current_feat23h_byte8 = 0;
d->current_feat2fh_byte4 = -1;
scsi_init_command(&c, MMC_GET_CONFIGURATION,
@ -2372,6 +2374,20 @@ static int mmc_get_configuration_al(struct burn_drive *d, int *alloc_len)
}
} else if (feature_code == 0x23) {
d->current_feat23h_byte4 = descr[4];
d->current_feat23h_byte8 = descr[8];
#ifdef Libburn_print_feature_descriptorS
if (cp >= 0x41 && cp <= 0x43)
fprintf(stderr,
"LIBBURN_EXPERIMENTAL : BD formats: %s%s%s%s%s\n",
descr[4] & 1 ? " Cert" : "",
descr[4] & 2 ? " QCert" : "",
descr[4] & 4 ? " Expand" : "",
descr[4] & 8 ? " RENoSA" : "",
descr[8] & 1 ? " RRM" : "");
#endif /* Libburn_print_feature_descriptorS */
} else if (feature_code == 0x2F) {
if (descr[2] & 1)
d->current_feat2fh_byte4 = descr[4];
@ -3153,7 +3169,7 @@ no_suitable_formatting_type:;
if (0) {
#else
if (size_mode == 0 || size_mode == 1) {
#endif /* ! Libburn_bd_re_format_olD */
#endif /* ! Libburn_bd_r_format_olD */
if (min_size < 0 || max_size < 0)
goto no_suitable_formatting_type;
@ -3775,6 +3791,8 @@ int mmc_setup_drive(struct burn_drive *d)
d->current_is_supported_profile = 0;
d->current_has_feat21h = 0;
d->current_feat21h_link_size = -1;
d->current_feat23h_byte4 = 0;
d->current_feat23h_byte8 = 0;
d->current_feat2fh_byte4 = -1;
d->needs_close_session = 0;
d->needs_sync_cache = 0;

View File

@ -171,6 +171,19 @@ struct burn_drive
/* Link Size item number 0 from feature 0021h descriptor */
int current_feat21h_link_size;
/* Flags from feature 0023h for formatting BD mmc5r03c.pdf 5.3.13
Byte 4 BD-RE:
bit0= Cert format 30h sub-type 10b
bit1= QCert format 30h sub-type 11b
bit2= Expand format 01h
bit3= RENoSA format 31h
Byte 8 BD-R:
bit0= RRM format 32h sub-type 10b
*/
int current_feat23h_byte4;
int current_feat23h_byte8;
/* Flags from feature 002Fh feature descriptor mmc5r03c.pdf 5.3.25 :
bit1= DVD-RW supported
bit2= Test Write available