Add a couple of "features".
freebsd_ioctl.c: hopefully less-erroneous MCN extraction.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: sample10.c,v 1.6 2004/08/08 03:11:11 rocky Exp $
|
||||
$Id: sample10.c,v 1.7 2004/08/10 02:29:46 rocky Exp $
|
||||
|
||||
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
|
||||
|
||||
@@ -232,9 +232,19 @@ main(int argc, const char *argv[])
|
||||
case CDIO_MMC_FEATURE_FORMATABLE:
|
||||
printf("Formattable Feature\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_DEFECT_MGMT:
|
||||
printf("Management Ability of the Logical Unit/media system "
|
||||
"to provide an apparently defect-free space.\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_WRITE_ONCE:
|
||||
printf("Write Once Feature\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_RESTRICT_OVERW:
|
||||
printf("Restricted Overwrite Feature\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_CD_RW_CAV:
|
||||
printf("CD-RW CAV Write Feature\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_MRW:
|
||||
printf("MRW Feature\n");
|
||||
break;
|
||||
@@ -244,18 +254,15 @@ main(int argc, const char *argv[])
|
||||
case CDIO_MMC_FEATURE_DVD_PR:
|
||||
printf("DVD+R Feature\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_CD_RW_CAV:
|
||||
printf("CD-RW CAV Write Feature\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_RESTRICT_OVERW:
|
||||
printf("Restricted Overwrite Feature\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_CD_TAO:
|
||||
printf("CD Track at Once Feature\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_CD_SAO:
|
||||
printf("CD Mastering (Session at Once) Feature\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_POWER_MGMT:
|
||||
printf("Initiator and device directed power management\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_CDDA_EXT_PLAY:
|
||||
printf("CD Audio External Play Feature\n");
|
||||
printf("\tSCAN command is %ssupported\n",
|
||||
@@ -271,9 +278,6 @@ main(int argc, const char *argv[])
|
||||
}
|
||||
printf("\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_POWER_MGMT:
|
||||
printf("Initiator and device directed power management\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_MCODE_UPGRADE:
|
||||
printf("Ability for the device to accept new microcode via "
|
||||
"the interface\n");
|
||||
@@ -286,6 +290,9 @@ main(int argc, const char *argv[])
|
||||
printf("Ability to perform DVD CSS/CPPM authentication and"
|
||||
" RPC\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_RT_STREAMING:
|
||||
printf("\tAbility to read and write using Initiator requested performance parameters\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_LU_SN: {
|
||||
uint8_t i_serial = *(p+3);
|
||||
char serial[257] = { '\0', };
|
||||
@@ -297,7 +304,11 @@ main(int argc, const char *argv[])
|
||||
break;
|
||||
}
|
||||
default:
|
||||
printf("Unknown feature code %x\n", i_feature);
|
||||
if ( 0 != (i_feature & 0xFF00) ) {
|
||||
printf("Vendor-specific feature code %x\n", i_feature);
|
||||
} else {
|
||||
printf("Unknown feature code %x\n", i_feature);
|
||||
}
|
||||
}
|
||||
p += i_feature_additional + 4;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: scsi_mmc.h,v 1.30 2004/08/07 03:25:25 rocky Exp $
|
||||
$Id: scsi_mmc.h,v 1.31 2004/08/10 02:29:46 rocky Exp $
|
||||
|
||||
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||
|
||||
@@ -140,6 +140,13 @@
|
||||
Feature */
|
||||
#define CDIO_MMC_FEATURE_FORMATABLE 0x023 /**< Formattable
|
||||
Feature */
|
||||
#define CDIO_MMC_FEATURE_DEFECT_MGMT 0x024 /**< Management
|
||||
Ability of the
|
||||
Logical Unit/media
|
||||
system to provide
|
||||
an apparently
|
||||
defect-free
|
||||
space.*/
|
||||
#define CDIO_MMC_FEATURE_WRITE_ONCE 0x025 /**< Write Once
|
||||
Feature */
|
||||
#define CDIO_MMC_FEATURE_RESTRICT_OVERW 0x026 /**< Restricted
|
||||
@@ -172,6 +179,12 @@
|
||||
CSS/CPPM
|
||||
authentication and
|
||||
RPC */
|
||||
#define CDIO_MMC_FEATURE_RT_STREAMING 0x107 /**< Ability to read
|
||||
and write using
|
||||
Initiator requested
|
||||
performance
|
||||
parameters
|
||||
*/
|
||||
#define CDIO_MMC_FEATURE_LU_SN 0x108 /**< The Logical Unit
|
||||
has a unique
|
||||
identifier. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: freebsd_ioctl.c,v 1.11 2004/07/28 11:45:21 rocky Exp $
|
||||
$Id: freebsd_ioctl.c,v 1.12 2004/08/10 02:29:46 rocky Exp $
|
||||
|
||||
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
static const char _rcsid[] = "$Id: freebsd_ioctl.c,v 1.11 2004/07/28 11:45:21 rocky Exp $";
|
||||
static const char _rcsid[] = "$Id: freebsd_ioctl.c,v 1.12 2004/08/10 02:29:46 rocky Exp $";
|
||||
|
||||
#ifdef HAVE_FREEBSD_CDROM
|
||||
|
||||
@@ -182,7 +182,7 @@ get_mcn_freebsd_ioctl (const _img_private_t *env) {
|
||||
subchannel.address_format = CDIO_CDROM_MSF;
|
||||
subchannel.data_format = CDIO_SUBCHANNEL_MEDIA_CATALOG;
|
||||
subchannel.track = 0;
|
||||
subchannel.data_len = 28;
|
||||
subchannel.data_len = sizeof(subchannel_info);
|
||||
subchannel.data = &subchannel_info;
|
||||
|
||||
if(ioctl(env->gen.fd, CDIOCREADSUBCHANNEL, &subchannel) < 0) {
|
||||
|
||||
28
src/util.c
28
src/util.c
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: util.c,v 1.19 2004/08/08 03:11:11 rocky Exp $
|
||||
$Id: util.c,v 1.20 2004/08/10 02:29:46 rocky Exp $
|
||||
|
||||
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||
|
||||
@@ -283,9 +283,19 @@ print_mmc_drive_features(CdIo *p_cdio)
|
||||
case CDIO_MMC_FEATURE_FORMATABLE:
|
||||
printf("Formattable Feature\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_DEFECT_MGMT:
|
||||
printf("Management Ability of the Logical Unit/media system "
|
||||
"to provide an apparently defect-free space.\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_WRITE_ONCE:
|
||||
printf("Write Once Feature\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_RESTRICT_OVERW:
|
||||
printf("Restricted Overwrite Feature\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_CD_RW_CAV:
|
||||
printf("CD-RW CAV Write Feature\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_MRW:
|
||||
printf("MRW Feature\n");
|
||||
break;
|
||||
@@ -295,12 +305,6 @@ print_mmc_drive_features(CdIo *p_cdio)
|
||||
case CDIO_MMC_FEATURE_DVD_PR:
|
||||
printf("DVD+R Feature\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_CD_RW_CAV:
|
||||
printf("CD-RW CAV Write Feature\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_RESTRICT_OVERW:
|
||||
printf("Restricted Overwrite Feature\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_CD_TAO:
|
||||
printf("CD Track at Once Feature\n");
|
||||
break;
|
||||
@@ -343,6 +347,9 @@ print_mmc_drive_features(CdIo *p_cdio)
|
||||
printf("\tCSS version %d\n", p[7]);
|
||||
printf("\t\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_RT_STREAMING:
|
||||
printf("\tAbility to read and write using Initiator requested performance parameters\n");
|
||||
break;
|
||||
case CDIO_MMC_FEATURE_LU_SN: {
|
||||
uint8_t i_serial = *(p+3);
|
||||
char serial[257] = { '\0', };
|
||||
@@ -354,7 +361,12 @@ print_mmc_drive_features(CdIo *p_cdio)
|
||||
break;
|
||||
}
|
||||
default:
|
||||
printf("Unknown feature code %x\n", i_feature);
|
||||
if ( 0 != (i_feature & 0xFF00) ) {
|
||||
printf("Vendor-specific feature code %x\n", i_feature);
|
||||
} else {
|
||||
printf("Unknown feature code %x\n", i_feature);
|
||||
}
|
||||
|
||||
}
|
||||
p += i_feature_additional + 4;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user