diff --git a/doc/glossary.texi b/doc/glossary.texi index 9b7f556b..886e2444 100644 --- a/doc/glossary.texi +++ b/doc/glossary.texi @@ -3,13 +3,13 @@ See also @uref{http://www.dvdrhelp.com/glossary}. @table @dfn -@item ASPI +@item @anchor{ASPI}ASPI @cindex ASPI See @acronym{Win32 ASPI} @item ATA -Advanced Technology Attachment (ATA). The same things as IDE. +Advanced Technology Attachment (ATA). The same thing as IDE. @item ATAPI @@ -35,13 +35,15 @@ actual data of each track. @item Blu-ray Disc (BD) @cindex Blu-ray Disc (BD) -Optical media with capacity of 25 GB as single layer and 50 GB -as double layer. See also "Media models and profiles". +Optical media with capacity of 25 GB as single layer and 50 GB as +double layer. See also @pxref{models-profiles,,"Media models and +profiles"}. @item CD @cindex CD -Compact Disc. Capacity up to 900 MB. See also "Media models and profiles". +Compact Disc. Capacity up to 900 MB. See also +@pxref{models-profiles,,"Media models and profiles"}. @item CD-DA @cindex CD-DA @@ -100,7 +102,7 @@ information such as artist name, title, songwriter, composer, or arranger. Commercially available audio CDs sometimes contain CD Text information. -@item CD XA +@item @anchor{XA}CD XA @cindex CD XA CD-ROM EXtended Architecture. A modification to the CD-ROM @@ -123,8 +125,9 @@ fully compatible. @item DVD @cindex DVD -Digital Versatile Disc. Capacity up to 4.5 GB as single layer and -8.5 GB as double layer media. See also "Media models and profiles". +Digital Versatile Disc. Capacity up to 4.5 GB as single layer and 8.5 +GB as double layer media. See also @pxref{models-profiles,,"Media +models and profiles"}. @item Defect management @cindex Defect management @@ -270,18 +273,24 @@ it can be represented as an unsigned value. Media Catalog Number. A identification number on an audio CD. Also called a UPC. Another identification number is ISRC. -@item MMC +@item @anchor{MMC}MMC @cindex MMC (Multimedia Commands) -MMC (Multimedia Commands). A SCSI programming specification made by -the SCSI committee T10 organization @url{http://www.t10.org/}. MMC -are raw commands for communicating with CDROM drives, CD-Rewriters, -DVD-Rewriters, etc. +MMC (Multimedia Commands). + +MMC are raw commands for communicating with CDROM drives, +CD-Rewriters, DVD-Rewriters, etc. The are subset of the larger SCSI +command set. See also @pxref{SCSI,,@acronym{SCSI}}. Many manufacturers have adopted this standard and it also applies to ATAPI versions of their drives. -@item Media models and profiles +The documents @code{libcdio} makes use of are described in the +Multi-Media Commands standard (MMC). This document generally has a +numeric level number appended. For example MMC-5 refers to +``Multi-Media Commands - 5. + +@item @anchor{models-profiles}Media models and profiles @cindex Media models and profiles MMC classifies media as models, which describe their logical structure, @@ -343,7 +352,7 @@ POSIX operations lseek(), read(), write() of the operating system. @item BD-RE 0x43 (single or double layer) @end table BD-R profile 0x42 is defined by MMC but not implemented by the consumer -priced Blu-ray burners as of year 2009. +priced Blu-ray burners as of year 2010. @item Mixed Mode CD @cindex Mixed Mode CD @@ -393,7 +402,7 @@ file. Rock Ridge is described by unapproved standard IEEE P1282 / RRIP-1.12 and based on unapproved IEEE P1281 / SUSP-1.10. It has become a de-facto standard on X/Open systems like GNU/Linux, FreeBSD, Solaris, et.\ al. -@item SCSI +@item @anchor{SCSI}SCSI @cindex SCSI Small Computer System Interface. A set of ANSI standard electronic @@ -406,6 +415,17 @@ set nowadays controls most storage devices including all optical disc drives. The contemporary electronic technologies which transport SCSI commands to optical drives are P-ATA, SATA, and USB. +A SCSI programming specification made by the SCSI committee T10 +organization @url{http://www.t10.org/}. + +The documents @code{libcdio} makes use of are described in SCSI +standards documents SCSI Primary Commands (SPC), SCSI Block Commands +(SBC), and Multi-Media Commands (MMC). These documents generally have +a numeric level number appended. For example SPC-3 refers to +``SCSI Primary Commands - 3'. + +In year 2010 the current versions were SPC-3, SBC-2, MMC-5. + @item SCSI CDB @cindex SCSI CDB @@ -417,7 +437,8 @@ issue a SCSI command. Yet another way of issuing MMC commands for accessing a CD-ROM. As with MMC or ASPI, the CD-ROM doesn't necessarily have to be a -SCSI-attached drive. See also @acronym{MMC} and @acronym{ASPI}. +SCSI-attached drive. See also @pxref{MMC,,@acronym{MMC}} and +@pxref{MMC,,@acronym{ASPI}}. @item Session @@ -510,7 +531,7 @@ However in Windows NT/2K/XP, Microsoft provides their Win32 ioctl interface, and has take steps to make using ASPI more inaccessible (e.g. requiring administrative access to use ASPI). -See also @acronym{MMC} +See also @pxref{MMC,,@acronym{MMC}}. @item Win32 ioctl driver @@ -521,6 +542,6 @@ defined codes and structures. @item XA @cindex XA -See @acronym{CD-ROM XA} +@xref{XA,,@acronym{CD-ROM XA}}. @end table diff --git a/include/cdio/mmc.h b/include/cdio/mmc.h index bb1186fa..d2d2fd94 100644 --- a/include/cdio/mmc.h +++ b/include/cdio/mmc.h @@ -17,10 +17,20 @@ */ /** - * \file mmc.h - * - * \brief Common definitions for MMC (Multimedia Commands). Applications - * include this for direct MMC access. + \file mmc.h + + \brief Common definitions for MMC (Multimedia Commands). Applications + include this for direct MMC access. + + The documents we make use of are described in several + specifications made by the SCSI committee T10 + http://www.t10.org. In particular, SCSI Primary Commands (SPC), + SCSI Block Commands (SBC), and Multi-Media Commands (MMC). These + documents generally have a numeric level number appended. For + example SPC-3 refers to ``SCSI Primary Commands - 3'. + + In year 2010 the current versions were SPC-3, SBC-2, MMC-5. + */ #ifndef __CDIO_MMC_H__ @@ -53,8 +63,7 @@ extern "C" { This has been adapted from GNU/Linux request_sense of include this for direct MMC access. - See SCSI Primary Commands-2 (SPC-2) table 102 or - SPC 4.5.3, Table 26. + See SCSI Primary Commands-2 (SPC-3) table 26 page 38. */ typedef struct mmc_request_sense { #if defined(__MMC_BIG_ENDIAN_BITFIELD) @@ -1012,17 +1021,17 @@ mmc_audio_read_subchannel (CdIo_t *p_cdio, These bytes give an indication of possible problems which occured in the drive while the command was performed. With some commands they tell about the current state of the drive (e.g. 00h TEST UNIT READY). - @param p_cdio CD structure set by cdio_open(). - @param sense returns the sense bytes received from the drive. - This is allocated memory or NULL if no sense bytes are - available. Dispose non-NULL pointers by free() when - no longer needed. - See SPC-3 4.5.3 Fixed format sense data. - SCSI error codes as of SPC-3 Annex D, MMC-5 Annex F: - sense[2]&15 = Key , sense[12] = ASC , sense[13] = ASCQ - @return number of valid bytes in sense, - 0 in case of no sense bytes available, - <0 in case of internal error. + @param p_cdio CD structure set by cdio_open(). + + @param sense returns the sense bytes received from the drive. + This is allocated memory or NULL if no sense bytes are + available. Dispose non-NULL pointers by free() when no longer + needed. See SPC-3 4.5.3 Fixed format sense data. SCSI error + codes as of SPC-3 Annex D, MMC-5 Annex F: sense[2]&15 = Key , + sense[12] = ASC , sense[13] = ASCQ + + @return number of valid bytes in sense, 0 in case of no sense + bytes available, <0 in case of internal error. */ int mmc_last_cmd_sense ( const CdIo_t *p_cdio, mmc_request_sense_t **pp_sense); diff --git a/lib/driver/mmc.c b/lib/driver/mmc.c index dee99b33..e062927e 100644 --- a/lib/driver/mmc.c +++ b/lib/driver/mmc.c @@ -1069,21 +1069,22 @@ int mmc_get_tray_status(const CdIo_t *p_cdio) /* Added in version 0.83 by scdbackup */ /** - Obtain the SCSI sense reply of the most-recently-performed MMC command. - These bytes give an indication of possible problems which occured in - the drive while the command was performed. With some commands they tell - about the current state of the drive (e.g. 00h TEST UNIT READY). - @param sense returns the sense bytes received from the drive. - This is allocated memory or NULL if no sense bytes are - available. Dispose non-NULL pointers by free() when - no longer needed. - See SPC-3 4.5.3 Fixed format sense data. - SCSI error codes as of SPC-3 Annex D, MMC-5 Annex F: - sense[2]&15 = Key , sense[12] = ASC , sense[13] = ASCQ - @return number of valid bytes in sense, - 0 in case of no sense bytes available, - <0 in case of internal error. -*/ + Obtain the SCSI sense reply of the most-recently-performed MMC command. + These bytes give an indication of possible problems which occured in + the drive while the command was performed. With some commands they tell + about the current state of the drive (e.g. 00h TEST UNIT READY). + @param p_cdio CD structure set by cdio_open(). + + @param sense returns the sense bytes received from the drive. + This is allocated memory or NULL if no sense bytes are + available. Dispose non-NULL pointers by free() when no longer + needed. See SPC-3 4.5.3 Fixed format sense data. SCSI error + codes as of SPC-3 Annex D, MMC-5 Annex F: sense[2]&15 = Key , + sense[12] = ASC , sense[13] = ASCQ + + @return number of valid bytes in sense, 0 in case of no sense + bytes available, <0 in case of internal error. + */ int mmc_last_cmd_sense( const CdIo_t *p_cdio, mmc_request_sense_t **pp_sense) { diff --git a/test/driver/mmc.c b/test/driver/mmc.c index e24e8214..60182ad3 100644 --- a/test/driver/mmc.c +++ b/test/driver/mmc.c @@ -174,16 +174,13 @@ tmmc_load_eject(CdIo_t *p_cdio, int *sense_avail, { int i_status; mmc_cdb_t cdb = {{0, }}; - char buf[1]; /* just to have an address to pass to mmc_run_cmd() */ + bool b_eject = !!(flag & 4); + bool b_immediate = !!(flag & 2); - memset(cdb.field, 0, 6); - cdb.field[0] = 0x1b; /* START/STOP UNIT, SBC-2 5.17 */ - cdb.field[1] = !!(flag & 2); /* bit0= Immed */ - cdb.field[4] = (flag & 4) ? 3 : 2; /* bit0= Start , bit1= Load/Eject */ + i_status = mmc_start_stop_media(p_cdio, b_eject, b_immediate, 0); if (flag & 1) fprintf(stderr, "tmmc_load_eject(0x%X) ... ", (unsigned int) flag); - i_status = mmc_run_cmd(p_cdio, 10000, &cdb, SCSI_MMC_DATA_NONE, 0, buf); return tmmc_handle_outcome(p_cdio, i_status, sense_avail, sense_reply, flag & 1);