glossary.texi, mmc.h: note acronyms SPC-3, MMC-5, SBC-2.

glossary.texi: start using texinfo cross references
test/driver/mmc.c: use provided routine for start/stop unit. Warning: might have broken things here.
This commit is contained in:
R. Bernstein
2010-02-05 13:50:07 -05:00
parent 0ae0a2ca8b
commit e3d2e21123
4 changed files with 85 additions and 57 deletions

View File

@@ -3,13 +3,13 @@ See also @uref{http://www.dvdrhelp.com/glossary}.
@table @dfn @table @dfn
@item ASPI @item @anchor{ASPI}ASPI
@cindex ASPI @cindex ASPI
See @acronym{Win32 ASPI} See @acronym{Win32 ASPI}
@item ATA @item ATA
Advanced Technology Attachment (ATA). The same things as IDE. Advanced Technology Attachment (ATA). The same thing as IDE.
@item ATAPI @item ATAPI
@@ -35,13 +35,15 @@ actual data of each track.
@item Blu-ray Disc (BD) @item Blu-ray Disc (BD)
@cindex Blu-ray Disc (BD) @cindex Blu-ray Disc (BD)
Optical media with capacity of 25 GB as single layer and 50 GB Optical media with capacity of 25 GB as single layer and 50 GB as
as double layer. See also "Media models and profiles". double layer. See also @pxref{models-profiles,,"Media models and
profiles"}.
@item CD @item CD
@cindex 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 @item CD-DA
@cindex 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 arranger. Commercially available audio CDs sometimes contain CD Text
information. information.
@item CD XA @item @anchor{XA}CD XA
@cindex CD XA @cindex CD XA
CD-ROM EXtended Architecture. A modification to the CD-ROM CD-ROM EXtended Architecture. A modification to the CD-ROM
@@ -123,8 +125,9 @@ fully compatible.
@item DVD @item DVD
@cindex DVD @cindex DVD
Digital Versatile Disc. Capacity up to 4.5 GB as single layer and Digital Versatile Disc. Capacity up to 4.5 GB as single layer and 8.5
8.5 GB as double layer media. See also "Media models and profiles". GB as double layer media. See also @pxref{models-profiles,,"Media
models and profiles"}.
@item Defect management @item Defect management
@cindex 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 Media Catalog Number. A identification number on an audio CD. Also
called a UPC. Another identification number is ISRC. called a UPC. Another identification number is ISRC.
@item MMC @item @anchor{MMC}MMC
@cindex MMC (Multimedia Commands) @cindex MMC (Multimedia Commands)
MMC (Multimedia Commands). A SCSI programming specification made by MMC (Multimedia Commands).
the SCSI committee T10 organization @url{http://www.t10.org/}. MMC
are raw commands for communicating with CDROM drives, CD-Rewriters, MMC are raw commands for communicating with CDROM drives,
DVD-Rewriters, etc. 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 Many manufacturers have adopted this standard and it also applies to
ATAPI versions of their drives. 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 @cindex Media models and profiles
MMC classifies media as models, which describe their logical structure, 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) @item BD-RE 0x43 (single or double layer)
@end table @end table
BD-R profile 0x42 is defined by MMC but not implemented by the consumer 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 @item Mixed Mode CD
@cindex 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 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. standard on X/Open systems like GNU/Linux, FreeBSD, Solaris, et.\ al.
@item SCSI @item @anchor{SCSI}SCSI
@cindex SCSI @cindex SCSI
Small Computer System Interface. A set of ANSI standard electronic 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 The contemporary electronic technologies which transport SCSI commands
to optical drives are P-ATA, SATA, and USB. 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 @item SCSI CDB
@cindex 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 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 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 @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 interface, and has take steps to make using ASPI more inaccessible
(e.g. requiring administrative access to use ASPI). (e.g. requiring administrative access to use ASPI).
See also @acronym{MMC} See also @pxref{MMC,,@acronym{MMC}}.
@item Win32 ioctl driver @item Win32 ioctl driver
@@ -521,6 +542,6 @@ defined codes and structures.
@item XA @item XA
@cindex XA @cindex XA
See @acronym{CD-ROM XA} @xref{XA,,@acronym{CD-ROM XA}}.
@end table @end table

View File

@@ -17,10 +17,20 @@
*/ */
/** /**
* \file mmc.h \file mmc.h
*
* \brief Common definitions for MMC (Multimedia Commands). Applications \brief Common definitions for MMC (Multimedia Commands). Applications
* include this for direct MMC access. 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__ #ifndef __CDIO_MMC_H__
@@ -53,8 +63,7 @@ extern "C" {
This has been adapted from GNU/Linux request_sense of <linux/cdrom.h> This has been adapted from GNU/Linux request_sense of <linux/cdrom.h>
include this for direct MMC access. include this for direct MMC access.
See SCSI Primary Commands-2 (SPC-2) table 102 or See SCSI Primary Commands-2 (SPC-3) table 26 page 38.
SPC 4.5.3, Table 26.
*/ */
typedef struct mmc_request_sense { typedef struct mmc_request_sense {
#if defined(__MMC_BIG_ENDIAN_BITFIELD) #if defined(__MMC_BIG_ENDIAN_BITFIELD)
@@ -1013,16 +1022,16 @@ mmc_audio_read_subchannel (CdIo_t *p_cdio,
the drive while the command was performed. With some commands they tell 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). about the current state of the drive (e.g. 00h TEST UNIT READY).
@param p_cdio CD structure set by cdio_open(). @param p_cdio CD structure set by cdio_open().
@param sense returns the sense bytes received from the drive. @param sense returns the sense bytes received from the drive.
This is allocated memory or NULL if no sense bytes are This is allocated memory or NULL if no sense bytes are
available. Dispose non-NULL pointers by free() when available. Dispose non-NULL pointers by free() when no longer
no longer needed. needed. See SPC-3 4.5.3 Fixed format sense data. SCSI error
See SPC-3 4.5.3 Fixed format sense data. codes as of SPC-3 Annex D, MMC-5 Annex F: sense[2]&15 = Key ,
SCSI error codes as of SPC-3 Annex D, MMC-5 Annex F: sense[12] = ASC , sense[13] = ASCQ
sense[2]&15 = Key , sense[12] = ASC , sense[13] = ASCQ
@return number of valid bytes in sense, @return number of valid bytes in sense, 0 in case of no sense
0 in case of no sense bytes available, bytes available, <0 in case of internal error.
<0 in case of internal error.
*/ */
int mmc_last_cmd_sense ( const CdIo_t *p_cdio, mmc_request_sense_t **pp_sense); int mmc_last_cmd_sense ( const CdIo_t *p_cdio, mmc_request_sense_t **pp_sense);

View File

@@ -1073,17 +1073,18 @@ int mmc_get_tray_status(const CdIo_t *p_cdio)
These bytes give an indication of possible problems which occured in These bytes give an indication of possible problems which occured in
the drive while the command was performed. With some commands they tell 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). 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. @param sense returns the sense bytes received from the drive.
This is allocated memory or NULL if no sense bytes are This is allocated memory or NULL if no sense bytes are
available. Dispose non-NULL pointers by free() when available. Dispose non-NULL pointers by free() when no longer
no longer needed. needed. See SPC-3 4.5.3 Fixed format sense data. SCSI error
See SPC-3 4.5.3 Fixed format sense data. codes as of SPC-3 Annex D, MMC-5 Annex F: sense[2]&15 = Key ,
SCSI error codes as of SPC-3 Annex D, MMC-5 Annex F: sense[12] = ASC , sense[13] = ASCQ
sense[2]&15 = Key , sense[12] = ASC , sense[13] = ASCQ
@return number of valid bytes in sense, @return number of valid bytes in sense, 0 in case of no sense
0 in case of no sense bytes available, bytes available, <0 in case of internal error.
<0 in case of internal error. */
*/
int int
mmc_last_cmd_sense( const CdIo_t *p_cdio, mmc_request_sense_t **pp_sense) mmc_last_cmd_sense( const CdIo_t *p_cdio, mmc_request_sense_t **pp_sense)
{ {

View File

@@ -174,16 +174,13 @@ tmmc_load_eject(CdIo_t *p_cdio, int *sense_avail,
{ {
int i_status; int i_status;
mmc_cdb_t cdb = {{0, }}; 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); i_status = mmc_start_stop_media(p_cdio, b_eject, b_immediate, 0);
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 */
if (flag & 1) if (flag & 1)
fprintf(stderr, "tmmc_load_eject(0x%X) ... ", (unsigned int) flag); 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, return tmmc_handle_outcome(p_cdio, i_status, sense_avail, sense_reply,
flag & 1); flag & 1);