diff --git a/doc/libcdio.texi b/doc/libcdio.texi index fe787db4..1843a377 100644 --- a/doc/libcdio.texi +++ b/doc/libcdio.texi @@ -46,7 +46,7 @@ development.'' @titlepage @title GNU libcdio library -@subtitle $Id: libcdio.texi,v 1.34 2005/01/29 15:43:28 rocky Exp $ +@subtitle $Id: libcdio.texi,v 1.35 2005/01/29 20:54:20 rocky Exp $ @author Rocky Bernstein et al. @page @@ -1498,7 +1498,7 @@ main(int argc, const char *argv[]) @} else @{ int i_status; /* Result of MMC command */ char buf[36] = @{ 0, @}; /* Place to hold returned data */ - scsi_mmc_cdb_t cdb = @{@{0, @}@}; /* Command Descriptor Block */ + scsi_mmc_cdb_t cdb = @{@{0, @}@}; /* Command Descriptor Buffer */ CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_INQUIRY); cdb.field[4] = sizeof(buf); @@ -1852,13 +1852,14 @@ CD frame. There seems to be a fascination in the MMC specification world with the number of bytes a command takes. (Size matters?) So often the name of an operation will have a suffix with the number of bytes of the -command (actually in MMC jargon this is called a ``cdb'' or command -descriptor block). So for example there is a 6-byte ``MODE SELECT'' -often called ``MODE SELECT 6'' and a 10-byte ``MODE SELECT'' sometimes -called ``MODE SELECT 10''. Presumably the 6-byte command came first -and it was discovered that there was some deficiency causing the -longer command. In @value{libcdio} often in the later or more common -name we drop the size suffix. +command (actually in MMC jargon this is called a ``cdb'' +@cindex cdb (Command Descriptor Buffer) +or command descriptor buffer). So for example there is a 6-byte ``MODE +SELECT'' often called ``MODE SELECT 6'' and a 10-byte ``MODE SELECT'' +sometimes called ``MODE SELECT 10''. Presumably the 6-byte command +came first and it was discovered that there was some deficiency +causing the longer command. In @value{libcdio} often in the later or +more common name we drop the size suffix. If the fascination and emphasis in the MMC specifications of cdb size is a bit odd, equally so is the fact that this too often has bled diff --git a/example/scsi-mmc1.c b/example/scsi-mmc1.c index c19a4df3..fade16bf 100644 --- a/example/scsi-mmc1.c +++ b/example/scsi-mmc1.c @@ -1,5 +1,5 @@ /* - $Id: scsi-mmc1.c,v 1.3 2005/01/29 10:05:33 rocky Exp $ + $Id: scsi-mmc1.c,v 1.4 2005/01/29 20:54:20 rocky Exp $ Copyright (C) 2004 Rocky Bernstein @@ -46,7 +46,7 @@ main(int argc, const char *argv[]) } else { int i_status; /* Result of MMC command */ char buf[36] = { 0, }; /* Place to hold returned data */ - scsi_mmc_cdb_t cdb = {{0, }}; /* Command Descriptor Block */ + scsi_mmc_cdb_t cdb = {{0, }}; /* Command Descriptor Buffer */ CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_INQUIRY); cdb.field[4] = sizeof(buf); diff --git a/example/scsi-mmc2.c b/example/scsi-mmc2.c index 814e2821..78793d4d 100644 --- a/example/scsi-mmc2.c +++ b/example/scsi-mmc2.c @@ -1,5 +1,5 @@ /* - $Id: scsi-mmc2.c,v 1.2 2005/01/29 10:05:33 rocky Exp $ + $Id: scsi-mmc2.c,v 1.3 2005/01/29 20:54:20 rocky Exp $ Copyright (C) 2004 Rocky Bernstein @@ -45,7 +45,7 @@ main(int argc, const char *argv[]) } else { int i_status; /* Result of MMC command */ uint8_t buf[500] = { 0, }; /* Place to hold returned data */ - scsi_mmc_cdb_t cdb = {{0, }}; /* Command Descriptor Block */ + scsi_mmc_cdb_t cdb = {{0, }}; /* Command Descriptor Buffer */ CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_GET_CONFIGURATION); CDIO_MMC_SET_READ_LENGTH8(cdb.field, sizeof(buf)); diff --git a/include/cdio/bytesex.h b/include/cdio/bytesex.h index 3100f947..f03612ba 100644 --- a/include/cdio/bytesex.h +++ b/include/cdio/bytesex.h @@ -1,5 +1,5 @@ /* - $Id: bytesex.h,v 1.2 2005/01/12 11:34:52 rocky Exp $ + $Id: bytesex.h,v 1.3 2005/01/29 20:54:20 rocky Exp $ Copyright (C) 2000, 2004 Herbert Valerio Riedel Copyright (C) 2005 Rocky Bernstein @@ -19,6 +19,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/** \file bytesex.h + * \brief Generic Byte-swapping routines. + * + * Note: this header will is slated to get removed and libcdio will + * use glib.h routines instead. +*/ + #ifndef __CDIO_BYTESEX_H__ #define __CDIO_BYTESEX_H__ @@ -26,13 +33,6 @@ #include #include -/** \file bytesex.h - * \brief Generic Byte-swapping routines. - - Note: this header will is slated to get removed and libcdio will use - glib.h routines instead. -*/ - /** 16-bit big-endian to little-endian */ #define UINT16_SWAP_LE_BE_C(val) ((uint16_t) ( \ (((uint16_t) (val) & (uint16_t) 0x00ffU) << 8) | \ diff --git a/include/cdio/bytesex_asm.h b/include/cdio/bytesex_asm.h index 8e3afa1c..cafff3ea 100644 --- a/include/cdio/bytesex_asm.h +++ b/include/cdio/bytesex_asm.h @@ -1,8 +1,8 @@ /* - $Id: bytesex_asm.h,v 1.1 2004/10/22 01:13:38 rocky Exp $ + $Id: bytesex_asm.h,v 1.2 2005/01/29 20:54:20 rocky Exp $ Copyright (C) 2001 Sven Ottemann - 2001, 2004 Herbert Valerio Riedel + 2001, 2004, 2005 Herbert Valerio Riedel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,6 +19,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/** \file bytesex_asm.h + * \brief Assembly code to handle byte-swapping. + + Note: this header will is slated to get removed and libcdio will use + glib.h routines instead. +*/ + #ifndef __CDIO_BYTESEX_ASM_H__ #define __CDIO_BYTESEX_ASM_H__ #if !defined(DISABLE_ASM_OPTIMIZE) diff --git a/include/cdio/cdda.h b/include/cdio/cdda.h index 8b39b081..8ef46262 100644 --- a/include/cdio/cdda.h +++ b/include/cdio/cdda.h @@ -1,5 +1,5 @@ /* - $Id: cdda.h,v 1.13 2005/01/27 03:10:06 rocky Exp $ + $Id: cdda.h,v 1.14 2005/01/29 20:54:20 rocky Exp $ Copyright (C) 2004, 2005 Rocky Bernstein Copyright (C) 2001 Xiph.org @@ -20,8 +20,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** \file cdda.h - * \brief The top-level interface header for cd-paranoia; applications - * include this. + * + * \brief The top-level interface header for libcdio_cdda. + * Applications include this for paranoia access. * ******************************************************************/ @@ -41,7 +42,8 @@ */ #define MAXTRK (CDIO_CD_MAX_TRACKS+1) -typedef struct TOC { /* structure of table of contents */ +/** \brief Structure for cdparanoia's CD Table of Contents */ +typedef struct TOC_s { unsigned char bTrack; int32_t dwStartSector; } TOC_t; @@ -58,8 +60,7 @@ typedef struct TOC { /* structure of table of contents */ #define CDDA_MESSAGE_PRINTIT 1 #define CDDA_MESSAGE_LOGIT 2 -/** cdrom access function pointer */ - +/** \brief Structure for cdparanoia's CD-ROM access */ struct cdrom_drive_s { CdIo_t *p_cdio; diff --git a/include/cdio/cdio.h b/include/cdio/cdio.h index 8b62390b..4c90aef7 100644 --- a/include/cdio/cdio.h +++ b/include/cdio/cdio.h @@ -1,5 +1,5 @@ /* -*- c -*- - $Id: cdio.h,v 1.77 2005/01/23 19:16:58 rocky Exp $ + $Id: cdio.h,v 1.78 2005/01/29 20:54:20 rocky Exp $ Copyright (C) 2001 Herbert Valerio Riedel Copyright (C) 2003, 2004, 2005 Rocky Bernstein @@ -20,7 +20,9 @@ */ /** \file cdio.h - * \brief The top-level header for libcdio: the CD Input and Control library. + * + * \brief The top-level header for libcdio: the CD Input and Control + * library. Applications include this for anything regarding libcdio. */ diff --git a/include/cdio/cdtext.h b/include/cdio/cdtext.h index f36a6f3a..fbd932f7 100644 --- a/include/cdio/cdtext.h +++ b/include/cdio/cdtext.h @@ -1,7 +1,7 @@ /* - $Id: cdtext.h,v 1.9 2005/01/27 03:10:06 rocky Exp $ + $Id: cdtext.h,v 1.10 2005/01/29 20:54:20 rocky Exp $ - Copyright (C) 2004 Rocky Bernstein + Copyright (C) 2004, 2005 Rocky Bernstein adapted from cuetools Copyright (C) 2003 Svend Sanjay Sorensen @@ -21,7 +21,9 @@ */ /*! * \file cdtext.h - * \brief Header CD-Text information + * + * \brief The top-level header for CD-Text information. Applications + * include this for CD-Text access. */ diff --git a/include/cdio/device.h b/include/cdio/device.h index fe81c1bf..6abb66b1 100644 --- a/include/cdio/device.h +++ b/include/cdio/device.h @@ -1,5 +1,5 @@ /* -*- c -*- - $Id: device.h,v 1.8 2005/01/23 19:16:58 rocky Exp $ + $Id: device.h,v 1.9 2005/01/29 20:54:20 rocky Exp $ Copyright (C) 2005 Rocky Bernstein @@ -465,19 +465,6 @@ extern "C" { */ char **cdio_get_devices_aix(void); - /*! Set up CD-ROM for reading using the BSDI driver. The device_name is - the some sort of device name. - - @param psz_source the name of the device to open - @param am the preferred access mode to use - @return the cdio object for subsequent operations. - NULL on error or there is no BSDI driver. - - @see cdio_open - */ - CdIo_t * cdio_open_am_bsdi (const char *psz_source, - const char *psz_access_mode); - /*! Set up CD-ROM for reading using the BSDI driver. The device_name is the some sort of device name. diff --git a/include/cdio/iso9660.h b/include/cdio/iso9660.h index 82ecb4e0..ccfbd2b8 100644 --- a/include/cdio/iso9660.h +++ b/include/cdio/iso9660.h @@ -1,5 +1,5 @@ /* - $Id: iso9660.h,v 1.57 2005/01/20 04:51:14 rocky Exp $ + $Id: iso9660.h,v 1.58 2005/01/29 20:54:20 rocky Exp $ Copyright (C) 2000 Herbert Valerio Riedel Copyright (C) 2003, 2004, 2005 Rocky Bernstein @@ -25,7 +25,9 @@ */ /*! * \file iso9660.h - * \brief Header for libiso9660: the ISO-9660 filesystem library. + * + * \brief The top-level interface eader for libiso9660: the ISO-9660 + * filesystem library; applications include this. */ @@ -48,41 +50,43 @@ For ISO-9660 Level 1, the maximum needed string length is: -\verbatim +@code 30 chars (filename + ext) + 2 chars ('.' + ';') + 5 chars (strlen("32767")) + 1 null byte ================================ = 38 chars -\endverbatim +@endcode + */ -/*! size in bytes of the filename portion + null byte */ + +/*! \brief size in bytes of the filename portion + null byte */ #define LEN_ISONAME 31 -/*! Max # characters in the entire ISO 9660 filename. */ +/*! \brief Maximum number of characters in the entire ISO 9660 filename. */ #define MAX_ISONAME 37 -/*! Max # characters in the entire ISO 9660 filename. */ +/*! \brief Maximum number of characters in the entire ISO 9660 filename. */ #define MAX_ISOPATHNAME 255 -/*! Max # characters in an perparer id. */ +/*! \brief Maximum number of characters in an perparer id. */ #define ISO_MAX_PREPARER_ID 128 -/*! Max # characters in an publisher id. */ +/*! \brief Maximum number of characters in an publisher id. */ #define ISO_MAX_PUBLISHER_ID 128 -/*! Max # characters in an application id. */ +/*! \brief Maximum number of characters in an application id. */ #define ISO_MAX_APPLICATION_ID 128 -/*! Max # characters in an system id. */ +/*! \brief Maximum number of characters in an system id. */ #define ISO_MAX_SYSTEM_ID 32 -/*! Max # characters in an volume id. */ +/*! \brief Maximum number of characters in an volume id. */ #define ISO_MAX_VOLUME_ID 32 -/*! Max # characters in an volume-set id. */ +/*! \brief Maximum number of characters in an volume-set id. */ #define ISO_MAX_VOLUMESET_ID 128 /**! ISO 9660 directory flags. */ @@ -389,7 +393,7 @@ typedef struct _iso9660 iso9660_t; Read the Primary Volume Descriptor for a CD. True is returned if read, and false if there was an error. */ - bool iso9660_fs_read_pvd ( const CdIo *p_cdio, + bool iso9660_fs_read_pvd ( const CdIo_t *p_cdio, /*out*/ iso9660_pvd_t *p_pvd ); /*! @@ -404,7 +408,7 @@ typedef struct _iso9660 iso9660_t; Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume Descriptor if (Joliet) extensions are acceptable. */ - bool iso9660_fs_read_superblock (CdIo *p_cdio, + bool iso9660_fs_read_superblock (CdIo_t *p_cdio, iso_extension_mask_t iso_extension_mask); /*! @@ -564,7 +568,7 @@ iso9660_dir_calc_record_size (unsigned int namelen, unsigned int su_len); Returns stat_t of entry if we found lsn, or NULL otherwise. */ -iso9660_stat_t *iso9660_find_fs_lsn(CdIo *p_cdio, lsn_t i_lsn); +iso9660_stat_t *iso9660_find_fs_lsn(CdIo_t *p_cdio, lsn_t i_lsn); /*! @@ -579,7 +583,7 @@ iso9660_stat_t *iso9660_find_ifs_lsn(const iso9660_t *p_iso, lsn_t i_lsn); /*! Return file status for psz_path. NULL is returned on error. */ -iso9660_stat_t *iso9660_fs_stat (CdIo *p_cdio, const char psz_path[]); +iso9660_stat_t *iso9660_fs_stat (CdIo_t *p_cdio, const char psz_path[]); /*! @@ -587,7 +591,7 @@ iso9660_stat_t *iso9660_fs_stat (CdIo *p_cdio, const char psz_path[]); pathname version numbers in the ISO 9660 name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names are lowercased. */ -iso9660_stat_t *iso9660_fs_stat_translate (CdIo *p_cdio, +iso9660_stat_t *iso9660_fs_stat_translate (CdIo_t *p_cdio, const char psz_path[], bool b_mode2); @@ -608,7 +612,7 @@ iso9660_stat_t *iso9660_ifs_stat_translate (iso9660_t *p_iso, pointers for the files inside that directory. The caller must free the returned result. */ -CdioList_t * iso9660_fs_readdir (CdIo *p_cdio, const char psz_path[], +CdioList_t * iso9660_fs_readdir (CdIo_t *p_cdio, const char psz_path[], bool b_mode2); /*! Read psz_path (a directory) and return a list of iso9660_stat_t diff --git a/include/cdio/paranoia.h b/include/cdio/paranoia.h index 6808149c..5ce9a9cc 100644 --- a/include/cdio/paranoia.h +++ b/include/cdio/paranoia.h @@ -1,5 +1,5 @@ /* - $Id: paranoia.h,v 1.7 2005/01/27 03:10:06 rocky Exp $ + $Id: paranoia.h,v 1.8 2005/01/29 20:54:20 rocky Exp $ Copyright (C) 2004, 2005 Rocky Bernstein Copyright (C) 1998 Monty xiphmont@mit.edu @@ -20,8 +20,10 @@ */ /** \file paranoia.h - * \brief The top-level header for libcdda_paranoia: - a library for reading CD-DA with error tolerance and repair. + * + * \brief The top-level header for libcdda_paranoia: a device- and OS- + * independent library for reading CD-DA with error tolerance and + * repair. Applications include this for paranoia access. */ #ifndef _CDIO_PARANOIA_H_ @@ -119,8 +121,20 @@ extern int16_t *cdio_paranoia_read(cdrom_paranoia_t *p, void(*callback)(long int, paranoia_cb_mode_t)); /*! The same as cdio_paranoia_read but the number of retries is set. + @param p paranoia object. + + + @param callback callback routine which gets called with the status + on each read. + @param maxretries number of times to try re-reading a block before - failing. @see cdio_paranoia_read. + failing. + + @return the block of CDIO_FRAMEIZE_RAW bytes (or + CDIO_FRAMESIZE_RAW / 2 16-bit integers). Unless byte-swapping has + been turned off the 16-bit integers Endian independent order. + + @see cdio_paranoia_read. */ extern int16_t *cdio_paranoia_read_limited(cdrom_paranoia_t *p, diff --git a/include/cdio/scsi_mmc.h b/include/cdio/scsi_mmc.h index 740aed59..2504808e 100644 --- a/include/cdio/scsi_mmc.h +++ b/include/cdio/scsi_mmc.h @@ -1,5 +1,5 @@ /* - $Id: scsi_mmc.h,v 1.41 2005/01/24 00:06:31 rocky Exp $ + $Id: scsi_mmc.h,v 1.42 2005/01/29 20:54:20 rocky Exp $ Copyright (C) 2003, 2004, 2005 Rocky Bernstein @@ -19,8 +19,10 @@ */ /*! - \file scsi_mmc.h - \brief Common definitions for SCSI MMC (Multi-Media Commands). + * \file scsi_mmc.h + * + * \brief Common definitions for MMC (Multimedia Commands). Applications + * include this for direct MMC access. */ #ifndef __SCSI_MMC_H__ @@ -30,7 +32,7 @@ #include #include -/*! \brief The opcode-portion (generic packet commands) of a SCSI-MMC command. +/*! \brief The opcode-portion (generic packet commands) of an MMC command. In general, those opcodes that end in 6 take a 6-byte command @@ -38,55 +40,103 @@ descriptor, those that end in 10 take a 10-byte descriptor and those that in in 12 take a 12-byte descriptor. (Not that you need to know that, but it seems to be a -big deal in the SCSI-MMC specification.) +big deal in the MMC specification.) */ typedef enum { - CDIO_MMC_GPCMD_INQUIRY = 0x12, - CDIO_MMC_GPCMD_MODE_SELECT_6 = 0x15, - CDIO_MMC_GPCMD_MODE_SENSE = 0x1a, - CDIO_MMC_GPCMD_START_STOP = 0x1b, - CDIO_MMC_GPCMD_ALLOW_MEDIUM_REMOVAL = 0x1e, - CDIO_MMC_GPCMD_READ_10 = 0x28, + CDIO_MMC_GPCMD_INQUIRY = 0x12, /**< Request drive + information. */ + CDIO_MMC_GPCMD_MODE_SELECT_6 = 0x15, /**< Select medium + (6 bytes). */ + CDIO_MMC_GPCMD_MODE_SENSE_6 = 0x1a, /**< Get medium or device + information. Should be issued + before MODE SELECT to get + mode support or save current + settings. (6 bytes). */ + CDIO_MMC_GPCMD_START_STOP = 0x1b, /**< Enable/disable Disc + operations. (6 bytes). */ + CDIO_MMC_GPCMD_ALLOW_MEDIUM_REMOVAL = 0x1e, /**< Enable/disable Disc + removal. (6 bytes). */ /** Group 2 Commands (CDB's here are 10-bytes) - * @{ */ - CDIO_MMC_GPCMD_READ_SUBCHANNEL = 0x42, - CDIO_MMC_GPCMD_READ_TOC = 0x43, + CDIO_MMC_GPCMD_READ_10 = 0x28, /**< Read data from drive + (10 bytes). */ + CDIO_MMC_GPCMD_READ_SUBCHANNEL = 0x42, /**< Read Sub-Channel data. + (10 bytes). */ + CDIO_MMC_GPCMD_READ_TOC = 0x43, /**< Read CD TOC. + (10 bytes). */ CDIO_MMC_GPCMD_READ_HEADER = 0x44, - CDIO_MMC_GPCMD_PLAY_AUDIO_10 = 0x45, - CDIO_MMC_GPCMD_GET_CONFIGURATION = 0x46, - CDIO_MMC_GPCMD_PLAY_AUDIO_MSF = 0x47, + CDIO_MMC_GPCMD_PLAY_AUDIO_10 = 0x45, /**< Begin audio playing at + current position + (10 bytes). */ + CDIO_MMC_GPCMD_GET_CONFIGURATION = 0x46, /**< Get drive Capabilities + (10 bytes) */ + CDIO_MMC_GPCMD_PLAY_AUDIO_MSF = 0x47, /**< Begin audio playing at + specified MSF (10 + bytes). */ CDIO_MMC_GPCMD_PLAY_AUDIO_TI = 0x48, - CDIO_MMC_GPCMD_PLAY_TRACK_REL_10 = 0x49, - CDIO_MMC_GPCMD_PAUSE_RESUME = 0x4b, + CDIO_MMC_GPCMD_PLAY_TRACK_REL_10 = 0x49, /**< Play audio at the track + relative LBA. (10 bytes). + Doesn't seem to be part + of MMC standards but is + handled by Plextor drives. + */ + + CDIO_MMC_GPCMD_PAUSE_RESUME = 0x4b, /**< Stop or restart audio + playback. (10 bytes). + Used with a PLAY command. */ - CDIO_MMC_GPCMD_READ_DISC_INFO = 0x51, - CDIO_MMC_GPCMD_MODE_SELECT = 0x55, - CDIO_MMC_GPCMD_MODE_SENSE_10 = 0x5a, - /**@}*/ + CDIO_MMC_GPCMD_READ_DISC_INFO = 0x51, /**< Get CD information. + (10 bytes). */ + CDIO_MMC_GPCMD_MODE_SELECT_10 = 0x55, /**< Select medium + (10-bytes). */ + CDIO_MMC_GPCMD_MODE_SENSE_10 = 0x5a, /**< Get medium or device + information. Should be issued + before MODE SELECT to get + mode support or save current + settings. (6 bytes). */ /** Group 5 Commands (CDB's here are 12-bytes) - * @{ */ - CDIO_MMC_GPCMD_PLAY_AUDIO_12 = 0xa5, - CDIO_MMC_GPCMD_READ_12 = 0xa8, - CDIO_MMC_GPCMD_PLAY_TRACK_REL_12 = 0xa9, - CDIO_MMC_GPCMD_READ_DVD_STRUCTURE = 0xad, - CDIO_MMC_GPCMD_READ_CD = 0xbe, - CDIO_MMC_GPCMD_READ_MSF = 0xb9, - /**@}*/ - + CDIO_MMC_GPCMD_PLAY_AUDIO_12 = 0xa5, /**< Begin audio playing at + current position + (12 bytes) */ + CDIO_MMC_GPCMD_LOAD_UNLOAD = 0xa6, /**< Load/unload a Disc + (12 bytes) */ + CDIO_MMC_GPCMD_READ_12 = 0xa8, /**< Read data from drive + (12 bytes). */ + CDIO_MMC_GPCMD_PLAY_TRACK_REL_12 = 0xa9, /**< Play audio at the track + relative LBA. (12 bytes). + Doesn't seem to be part + of MMC standards but is + handled by Plextor drives. + */ + CDIO_MMC_GPCMD_READ_DVD_STRUCTURE = 0xad, /**< Get DVD structure info + from media (12 bytes). */ + CDIO_MMC_GPCMD_READ_MSF = 0xb9, /**< Read almost any field + of a CD sector at specified + MSF. (12 bytes). */ + CDIO_MMC_GPCMD_SET_SPEED = 0xbb, /**< Set drive speed + (12 bytes). This is listed + as optional in ATAPI 2.6, + but is (curiously) + missing from Mt. Fuji, + Table 57. It is mentioned + in Mt. Fuji Table 377 as an + MMC command for SCSI + devices though... Most + ATAPI drives support it. */ + CDIO_MMC_GPCMD_READ_CD = 0xbe, /**< Read almost any field + of a CD sector at current + location. (12 bytes). */ /** Vendor-unique Commands - * @{ */ CDIO_MMC_GPCMD_CD_PLAYBACK_STATUS = 0xc4 /**< SONY unique = command */, CDIO_MMC_GPCMD_PLAYBACK_CONTROL = 0xc9 /**< SONY unique = command */, CDIO_MMC_GPCMD_READ_CDDA = 0xd8 /**< Vendor unique = command */, CDIO_MMC_GPCMD_READ_CDXA = 0xdb /**< Vendor unique = command */, CDIO_MMC_GPCMD_READ_ALL_SUBCODES = 0xdf /**< Vendor unique = command */ - /**@}*/ } cdio_mmc_gpcmd_t; @@ -264,26 +314,19 @@ typedef enum { conform to any Profile. */ -/*! This is listed as optional in ATAPI 2.6, but is (curiously) - missing from Mt. Fuji, Table 57. It _is_ mentioned in Mt. Fuji - Table 377 as an MMC command for SCSi devices though... Most ATAPI - drives support it. */ -#define CDIO_MMC_GPCMD_SET_SPEED 0xbb - - /*! The largest Command Descriptor Buffer (CDB) size. The possible sizes are 6, 10, and 12 bytes. */ #define MAX_CDB_LEN 12 -/*! \brief A Command Descriptor Buffer (CDB) used in sending SCSI MMC +/*! \brief A Command Descriptor Buffer (CDB) used in sending MMC commands. */ typedef struct scsi_mmc_cdb { uint8_t field[MAX_CDB_LEN]; } scsi_mmc_cdb_t; -/*! \brief Format of header block in data returned from a SCSI-MMC +/*! \brief Format of header block in data returned from an MMC GET_CONFIGURATION command. */ typedef struct scsi_mmc_feature_list_header { @@ -297,7 +340,7 @@ typedef struct scsi_mmc_feature_list_header { unsigned char profile_lsb; } scs_mmc_feature_list_header_t; -/*! An enumeration indicating whether a SCSI MMC command is sending +/*! An enumeration indicating whether an MMC command is sending data or getting data. */ typedef enum scsi_mmc_direction { @@ -348,14 +391,14 @@ typedef enum scsi_mmc_direction { /*! Return the length in bytes of the Command Descriptor - Buffer (CDB) for a given SCSI MMC command. The length will be + Buffer (CDB) for a given MMC command. The length will be either 6, 10, or 12. */ uint8_t scsi_mmc_get_cmd_len(uint8_t scsi_cmd); /*! - Run a SCSI MMC command. + Run an MMC command. @param p_cdio CD structure set by cdio_open(). @param i_timeout_ms time in milliseconds we will wait for the command @@ -374,7 +417,7 @@ int scsi_mmc_run_cmd( const CdIo_t *p_cdio, unsigned int i_timeout_ms, scsi_mmc_direction_t e_direction, unsigned int i_buf, /*in/out*/ void *p_buf ); /*! - * Eject using SCSI MMC commands. + * Eject using MMC commands. @return 0 if successful. */ @@ -388,11 +431,11 @@ int scsi_mmc_eject_media( const CdIo_t *p_cdio ); lsn_t scsi_mmc_get_disc_last_lsn( const CdIo_t *p_cdio ); /*! - Return the discmode as reported by the SCSI-MMC Read (FULL) TOC + Return the discmode as reported by the MMC Read (FULL) TOC command. Information was obtained from Section 5.1.13 (Read TOC/PMA/ATIP) - pages 56-62 from the SCSI MMC draft specification, revision 10a + pages 56-62 from the MMC draft specification, revision 10a at http://www.t10.org/ftp/t10/drafts/mmc/mmc-r10a.pdf See especially tables 72, 73 and 75. */ @@ -413,11 +456,11 @@ void scsi_mmc_get_drive_cap (const CdIo_t *p_cdio, @return the DVD discmode. */ -discmode_t scsi_mmc_get_dvd_struct_physical ( const CdIo *p_cdio, +discmode_t scsi_mmc_get_dvd_struct_physical ( const CdIo_t *p_cdio, cdio_dvd_struct_t *s); /*! - Get the CD-ROM hardware info via a SCSI MMC INQUIRY command. + Get the CD-ROM hardware info via an MMC INQUIRY command. @return true if we were able to get hardware info, false if we had an error. @@ -445,13 +488,13 @@ int scsi_mmc_read_sectors ( const CdIo_t *p_cdio, void *p_buf, lba_t lba, int sector_type, unsigned int i_blocks); /*! - Set the block size for subsequest read requests, via a SCSI MMC + Set the block size for subsequest read requests, via an MMC MODE_SELECT 6 command. */ int scsi_mmc_set_blocksize ( const CdIo_t *p_cdio, unsigned int i_bsize); /*! - Set the block size for subsequest read requests, via a SCSI MMC + Set the block size for subsequest read requests, via an MMC MODE_SENSE 6 command. */ int scsi_mmc_get_blocksize ( const CdIo_t *p_cdio ); diff --git a/include/cdio/track.h b/include/cdio/track.h index 09d7fbea..6abd247a 100644 --- a/include/cdio/track.h +++ b/include/cdio/track.h @@ -1,5 +1,5 @@ /* -*- c -*- - $Id: track.h,v 1.5 2005/01/27 03:10:06 rocky Exp $ + $Id: track.h,v 1.6 2005/01/29 20:54:20 rocky Exp $ Copyright (C) 2005 Rocky Bernstein @@ -67,10 +67,13 @@ extern "C" { CDIO_TRACK_FLAG_UNKNOWN } track_flag_t; + /*! \brief Structure containing attributes associated with a track */ typedef struct { - track_flag_t preemphasis; - track_flag_t copy_permit; - int channels; + track_flag_t preemphasis; /**< Linear preemphasis on an audio track */ + track_flag_t copy_permit; /**< Whether copying is permitted */ + int channels; /**< Number of audio channels, 2, 4. -2 if not + implemented or -1 for error. + */ } track_flags_t; /*! @@ -114,17 +117,18 @@ extern "C" { implemented or -1 for error. Not meaningful if track is not an audio track. */ - int cdio_get_track_channels(const CdIo *p_cdio, track_t i_track); + int cdio_get_track_channels(const CdIo_t *p_cdio, track_t i_track); /*! Return copy protection status on a track. Is this meaningful if not an audio track? */ - track_flag_t cdio_get_track_copy_permit(const CdIo *p_cdio, track_t i_track); + track_flag_t cdio_get_track_copy_permit(const CdIo_t *p_cdio, + track_t i_track); /*! Get the format (audio, mode2, mode1) of track. */ - track_format_t cdio_get_track_format(const CdIo *p_cdio, track_t i_track); + track_format_t cdio_get_track_format(const CdIo_t *p_cdio, track_t i_track); /*! Return true if we have XA data (green, mode2 form1) or diff --git a/include/cdio/version.h.in b/include/cdio/version.h.in index c2d5db72..17d199e7 100644 --- a/include/cdio/version.h.in +++ b/include/cdio/version.h.in @@ -1,6 +1,8 @@ -/* $Id: version.h.in,v 1.5 2005/01/22 19:39:16 rocky Exp $ */ +/* $Id: version.h.in,v 1.6 2005/01/29 20:54:20 rocky Exp $ */ /** \file version.h - * \brief A file simply containing the library version number. + * + * \brief A file containing the libcdio package version + * number (@LIBCDIO_VERSION_NUM@) and OS build name. */ /*! CDIO_VERSION can as a string in programs to show what version is used. */ diff --git a/lib/driver/scsi_mmc.c b/lib/driver/scsi_mmc.c index 0602bbbb..5965e840 100644 --- a/lib/driver/scsi_mmc.c +++ b/lib/driver/scsi_mmc.c @@ -1,6 +1,6 @@ /* Common SCSI Multimedia Command (MMC) routines. - $Id: scsi_mmc.c,v 1.12 2005/01/27 11:08:55 rocky Exp $ + $Id: scsi_mmc.c,v 1.13 2005/01/29 20:54:20 rocky Exp $ Copyright (C) 2004, 2005 Rocky Bernstein @@ -143,7 +143,7 @@ scsi_mmc_get_blocksize_private ( void *p_env, memset (&mh, 0, sizeof (mh)); - CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_MODE_SENSE); + CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_MODE_SENSE_6); cdb.field[1] = 0x3F&1; cdb.field[4] = 12; diff --git a/test/check_cd_read.sh b/test/check_cd_read.sh index 76b3ef39..9b398e83 100755 --- a/test/check_cd_read.sh +++ b/test/check_cd_read.sh @@ -1,7 +1,7 @@ #!/bin/sh -#$Id: check_cd_read.sh,v 1.6 2004/05/07 02:15:49 rocky Exp $ +#$Id: check_cd_read.sh,v 1.7 2005/01/29 20:54:20 rocky Exp $ # -# Copyright (C) 2003 Rocky Bernstein +# Copyright (C) 2003, 2005 Rocky Bernstein # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -43,7 +43,7 @@ testnum=MODE1 opts="-i ${srcdir}/${fname}.cue --mode m1f1 -s 26 -n 2" test_cd_read "$opts" ${fname}-read.dump ${srcdir}/${fname}-read.right RC=$? -check_result $RC "cd-read CUE test $testnum" "cd-read $opts" +check_result $RC "cd-read CUE test $testnum" "$CD_READ $opts" exit $RC