libcdio  0.90
mmc.h
Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012
00003                   Rocky Bernstein <rocky@gnu.org>
00004 
00005     This program is free software: you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation, either version 3 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 
00036 #ifndef CDIO_MMC_H_
00037 #define CDIO_MMC_H_
00038 
00039 #include <cdio/cdio.h>
00040 #include <cdio/types.h>
00041 #include <cdio/dvd.h>
00042 #include <cdio/audio.h>
00043 #include <cdio/mmc_util.h>
00044 
00045 #ifdef __cplusplus
00046 extern "C" {
00047 #endif /* __cplusplus */
00048 
00049 /* On GNU/Linux see <linux/byteorder/big_endian.h> and 
00050    <linux/byteorder/little_endian.h>
00051 */
00052 #ifdef WORDS_BIGENDIAN
00053 #  if !defined(__LITTLE_ENDIAN_BITFIELD) && !defined(__BIG_ENDIAN_BITFIELD)
00054 #  define __MMC_BIG_ENDIAN_BITFIELD
00055 #  endif
00056 #else 
00057 #  if !defined(__LITTLE_ENDIAN_BITFIELD) && !defined(__BIG_ENDIAN_BITFIELD)
00058 #  define __MMC_LITTLE_ENDIAN_BITFIELD
00059 #  endif
00060 #endif
00061 
00069     typedef struct cdio_mmc_request_sense {
00070 #if defined(__MMC_BIG_ENDIAN_BITFIELD)
00071         uint8_t valid           : 1;  
00072         uint8_t error_code      : 7;
00073 #else
00074         uint8_t error_code      : 7;
00075         uint8_t valid           : 1;  
00076 #endif
00077         uint8_t segment_number;
00078 #if defined(__MMC_BIG_ENDIAN_BITFIELD)
00079         uint8_t filemark        : 1; 
00081         uint8_t eom             : 1; 
00084         uint8_t ili             : 1; 
00085         uint8_t reserved1       : 1;
00086         uint8_t sense_key       : 4;
00087 #else
00088         uint8_t sense_key       : 4;
00089         uint8_t reserved1       : 1;
00090         uint8_t ili             : 1; 
00091         uint8_t eom             : 1; 
00094         uint8_t filemark        : 1; 
00096 #endif
00097         uint8_t information[4];
00098         uint8_t additional_sense_len; 
00099         uint8_t command_info[4];      
00100         uint8_t asc;                  
00101         uint8_t ascq;                 
00102         uint8_t fruc;                 
00103         uint8_t sks[3];               
00104         uint8_t asb[46];              
00105     } cdio_mmc_request_sense_t;
00106 
00107 
00111     typedef enum {
00112         CDIO_MMC_SENSE_KEY_NO_SENSE        =  0,
00113         CDIO_MMC_SENSE_KEY_RECOVERED_ERROR =  1,
00114         CDIO_MMC_SENSE_KEY_NOT_READY       =  2,
00115         CDIO_MMC_SENSE_KEY_MEDIUM_ERROR    =  3,
00116         CDIO_MMC_SENSE_KEY_HARDWARE_ERROR  =  4,
00117         CDIO_MMC_SENSE_KEY_ILLEGAL_REQUEST =  5,
00118         CDIO_MMC_SENSE_KEY_UNIT_ATTENTION  =  6,
00119         CDIO_MMC_SENSE_KEY_DATA_PROTECT    =  7,
00120         CDIO_MMC_SENSE_KEY_BLANK_CHECK     =  8,
00121         CDIO_MMC_SENSE_KEY_VENDOR_SPECIFIC =  9,
00122         CDIO_MMC_SENSE_KEY_COPY_ABORTED    = 10,
00123         CDIO_MMC_SENSE_KEY_ABORTED_COMMAND = 11,
00124         CDIO_MMC_SENSE_KEY_OBSOLETE        = 12,
00125     } cdio_mmc_sense_key_t;
00126 
00138     typedef enum {
00139   CDIO_MMC_GPCMD_TEST_UNIT_READY        = 0x00, 
00140   CDIO_MMC_GPCMD_REQUEST_SENSE          = 0x03, 
00141   CDIO_MMC_GPCMD_FORMAT_UNIT            = 0x04,
00142   CDIO_MMC_GPCMD_INQUIRY                = 0x12, 
00144   CDIO_MMC_GPCMD_MODE_SELECT_6          = 0x15, 
00146   CDIO_MMC_GPCMD_MODE_SENSE_6           = 0x1a, 
00151   CDIO_MMC_GPCMD_START_STOP_UNIT        = 0x1b, 
00153   CDIO_MMC_GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL 
00154                                         = 0x1e, 
00160   CDIO_MMC_GPCMD_READ_FORMAT_CAPACITIES = 0x23, 
00161   CDIO_MMC_GPCMD_READ_CAPACITIY         = 0x25, 
00162   CDIO_MMC_GPCMD_READ_10                = 0x28, 
00164   CDIO_MMC_GPCMD_WRITE_10               = 0x2a, 
00165   CDIO_MMC_GPCMD_SEEK_10                = 0x2b, 
00166   CDIO_MMC_GPCMD_ERASE_10               = 0x2c, 
00167   CDIO_MMC_GPCMD_WRITE_AND_VERIFY_10    = 0x2e, 
00168   CDIO_MMC_GPCMD_VERIFY_10              = 0x2f, 
00169   CDIO_MMC_GPCMD_SYNCHRONIZE_CACHE      = 0x35, 
00170   CDIO_MMC_GPCMD_WRITE_BUFFER           = 0x3b, 
00171   CDIO_MMC_GPCMD_READ_BUFFER            = 0x3c, 
00172   CDIO_MMC_GPCMD_READ_SUBCHANNEL        = 0x42, 
00174   CDIO_MMC_GPCMD_READ_TOC               = 0x43, 
00176   CDIO_MMC_GPCMD_READ_HEADER            = 0x44,
00177   CDIO_MMC_GPCMD_PLAY_AUDIO_10          = 0x45, 
00180   CDIO_MMC_GPCMD_GET_CONFIGURATION      = 0x46, 
00182   CDIO_MMC_GPCMD_PLAY_AUDIO_MSF         = 0x47, 
00185   CDIO_MMC_GPCMD_PLAY_AUDIO_TI          = 0x48,
00186   CDIO_MMC_GPCMD_PLAY_TRACK_REL_10      = 0x49, 
00193   CDIO_MMC_GPCMD_GET_EVENT_STATUS       = 0x4a, 
00195   CDIO_MMC_GPCMD_PAUSE_RESUME           = 0x4b, 
00199   CDIO_MMC_GPCMD_READ_DISC_INFORMATION  = 0x51, 
00201   CDIO_MMC_GPCMD_READ_TRACK_INFORMATION = 0x52, 
00203   CDIO_MMC_GPCMD_RESERVE_TRACK          = 0x53,
00204   CDIO_MMC_GPCMD_SEND_OPC_INFORMATION   = 0x54,
00205   CDIO_MMC_GPCMD_MODE_SELECT_10         = 0x55, 
00207   CDIO_MMC_GPCMD_REPAIR_TRACK           = 0x58,
00208   CDIO_MMC_GPCMD_MODE_SENSE_10          = 0x5a, 
00213   CDIO_MMC_GPCMD_CLOSE_TRACK_SESSION    = 0x5b,
00214   CDIO_MMC_GPCMD_READ_BUFFER_CAPACITY   = 0x5c,
00215   CDIO_MMC_GPCMD_SEND_CUE_SHEET         = 0x5d,
00216 
00220   CDIO_MMC_GPCMD_REPORT_LUNS            = 0xa0, 
00221   CDIO_MMC_GPCMD_BLANK                  = 0xa1, 
00222   CDIO_MMC_GPCMD_SECURITY_PROTOCOL_IN   = 0xa2, 
00223   CDIO_MMC_GPCMD_SEND_KEY               = 0xa3, 
00224   CDIO_MMC_GPCMD_REPORT_KEY             = 0xa4, 
00225   CDIO_MMC_GPCMD_PLAY_AUDIO_12          = 0xa5, 
00228   CDIO_MMC_GPCMD_LOAD_UNLOAD            = 0xa6, 
00230   CDIO_MMC_GPCMD_SET_READ_AHEAD         = 0xa7,
00231   CDIO_MMC_GPCMD_READ_12                = 0xa8, 
00233   CDIO_MMC_GPCMD_PLAY_TRACK_REL_12      = 0xa9, 
00239   CDIO_MMC_GPCMD_WRITE_12               = 0xaa,
00240   CDIO_MMC_GPCMD_READ_MEDIA_SERIAL_12   = 0xab, 
00241   CDIO_MMC_GPCMD_GET_PERFORMANCE        = 0xac,
00242   CDIO_MMC_GPCMD_READ_DVD_STRUCTURE     = 0xad, 
00244   CDIO_MMC_GPCMD_SECURITY_PROTOCOL_OUT  = 0xb5,
00245   CDIO_MMC_GPCMD_SET_STREAMING          = 0xb6,
00246   CDIO_MMC_GPCMD_READ_MSF               = 0xb9, 
00249   CDIO_MMC_GPCMD_SET_SPEED              = 0xbb, 
00259   CDIO_MMC_GPCMD_MECHANISM_STATUS       = 0xbd,
00260   CDIO_MMC_GPCMD_READ_CD                = 0xbe, 
00263   CDIO_MMC_GPCMD_SEND_DISC_STRUCTURE    = 0xbf,
00267   CDIO_MMC_GPCMD_CD_PLAYBACK_STATUS  = 0xc4 ,
00268   CDIO_MMC_GPCMD_PLAYBACK_CONTROL    = 0xc9 ,
00269   CDIO_MMC_GPCMD_READ_CDDA           = 0xd8 ,
00270   CDIO_MMC_GPCMD_READ_CDXA           = 0xdb ,
00271   CDIO_MMC_GPCMD_READ_ALL_SUBCODES   = 0xdf 
00272   } cdio_mmc_gpcmd_t;
00273 
00277   typedef enum {
00278     CDIO_MMC_READ_SUB_ST_INVALID   = 0x00, 
00279     CDIO_MMC_READ_SUB_ST_PLAY      = 0x11, 
00281     CDIO_MMC_READ_SUB_ST_PAUSED    = 0x12, 
00282     CDIO_MMC_READ_SUB_ST_COMPLETED = 0x13, 
00284     CDIO_MMC_READ_SUB_ST_ERROR     = 0x14, 
00286     CDIO_MMC_READ_SUB_ST_NO_STATUS = 0x15, 
00288   } cdio_mmc_read_sub_state_t;
00289 
00291   typedef enum {
00292     CDIO_MMC_READ_TYPE_ANY  =  0,  
00293     CDIO_MMC_READ_TYPE_CDDA =  1,  
00294     CDIO_MMC_READ_TYPE_MODE1 = 2,  
00295     CDIO_MMC_READ_TYPE_MODE2 = 3,  
00296     CDIO_MMC_READ_TYPE_M2F1 =  4,  
00297     CDIO_MMC_READ_TYPE_M2F2 =  5   
00298   } cdio_mmc_read_cd_type_t;
00299 
00303   typedef enum {
00304     CDIO_MMC_READTOC_FMT_TOC     =  0,
00305     CDIO_MMC_READTOC_FMT_SESSION =  1,  
00306     CDIO_MMC_READTOC_FMT_FULTOC  =  2,
00307     CDIO_MMC_READTOC_FMT_PMA     =  3,  
00308     CDIO_MMC_READTOC_FMT_ATIP    =  4,  
00309     CDIO_MMC_READTOC_FMT_CDTEXT  =  5   
00310   } cdio_mmc_readtoc_t;
00311     
00315   typedef enum {
00316       CDIO_MMC_R_W_ERROR_PAGE     = 0x01,
00317       CDIO_MMC_WRITE_PARMS_PAGE   = 0x05,
00318       CDIO_MMC_CDR_PARMS_PAGE     = 0x0d,
00319       CDIO_MMC_AUDIO_CTL_PAGE     = 0x0e,
00320       CDIO_MMC_POWER_PAGE         = 0x1a,
00321       CDIO_MMC_FAULT_FAIL_PAGE    = 0x1c,
00322       CDIO_MMC_TO_PROTECT_PAGE    = 0x1d,
00323       CDIO_MMC_CAPABILITIES_PAGE  = 0x2a,
00324       CDIO_MMC_ALL_PAGES          = 0x3f,
00325   } cdio_mmc_mode_page_t;
00326 
00330   typedef enum {
00331       CDIO_MMC_READ_DISC_INFO_STANDARD   = 0x0,
00332       CDIO_MMC_READ_DISC_INFO_TRACK      = 0x1,
00333       CDIO_MMC_READ_DISC_INFO_POW        = 0x2,
00334   } cdio_mmc_read_disc_info_datatype_t;
00335         
00336 /* For backward compatibility. */
00337 #define CDIO_MMC_GPCMD_READ_DISC_INFO CDIO_MMC_GPCMD_READ_DISC_INFORMATION
00338 #define CDIO_MMC_GPCMD_READ_DISC_STRUCTURE CDIO_MMC_GPMD_READ_DVD_STRUCTURE
00339 
00340 
00341 PRAGMA_BEGIN_PACKED
00342   struct mmc_audio_volume_entry_s 
00343   {
00344     uint8_t  selection; /* Only the lower 4 bits are used. */
00345     uint8_t  volume;
00346   } GNUC_PACKED;
00347 
00348   typedef struct mmc_audio_volume_entry_s mmc_audio_volume_entry_t;
00349   
00353   struct mmc_audio_volume_s
00354   {
00355     mmc_audio_volume_entry_t port[4];
00356   } GNUC_PACKED;
00357 
00358   typedef struct mmc_audio_volume_s mmc_audio_volume_t;
00359   
00360 PRAGMA_END_PACKED
00361   
00362 
00366 typedef enum {
00367   CDIO_MMC_GET_CONF_ALL_FEATURES     = 0,  
00369   CDIO_MMC_GET_CONF_CURRENT_FEATURES = 1,  
00372   CDIO_MMC_GET_CONF_NAMED_FEATURE    = 2   
00374 } cdio_mmc_get_conf_t;
00375   
00376 
00380 typedef enum {
00381   CDIO_MMC_FEATURE_PROFILE_LIST     = 0x000, 
00382   CDIO_MMC_FEATURE_CORE             = 0x001, 
00383   CDIO_MMC_FEATURE_MORPHING         = 0x002, 
00385   CDIO_MMC_FEATURE_REMOVABLE_MEDIUM = 0x003, 
00386   CDIO_MMC_FEATURE_WRITE_PROTECT    = 0x004, 
00387   CDIO_MMC_FEATURE_RANDOM_READABLE  = 0x010, 
00388   CDIO_MMC_FEATURE_MULTI_READ       = 0x01D, 
00389   CDIO_MMC_FEATURE_CD_READ          = 0x01E, 
00390   CDIO_MMC_FEATURE_DVD_READ         = 0x01F, 
00391   CDIO_MMC_FEATURE_RANDOM_WRITABLE  = 0x020, 
00392   CDIO_MMC_FEATURE_INCR_WRITE       = 0x021, 
00394   CDIO_MMC_FEATURE_SECTOR_ERASE     = 0x022, 
00395   CDIO_MMC_FEATURE_FORMATABLE       = 0x023, 
00396   CDIO_MMC_FEATURE_DEFECT_MGMT      = 0x024, 
00400   CDIO_MMC_FEATURE_WRITE_ONCE       = 0x025, 
00402   CDIO_MMC_FEATURE_RESTRICT_OVERW   = 0x026, 
00404   CDIO_MMC_FEATURE_CD_RW_CAV        = 0x027, 
00405   CDIO_MMC_FEATURE_MRW              = 0x028, 
00406   CDIO_MMC_FEATURE_ENHANCED_DEFECT  = 0x029, 
00407   CDIO_MMC_FEATURE_DVD_PRW          = 0x02A, 
00408   CDIO_MMC_FEATURE_DVD_PR           = 0x02B, 
00409   CDIO_MMC_FEATURE_RIGID_RES_OVERW  = 0x02C, 
00410   CDIO_MMC_FEATURE_CD_TAO           = 0x02D, 
00411   CDIO_MMC_FEATURE_CD_SAO           = 0x02E, 
00413   CDIO_MMC_FEATURE_DVD_R_RW_WRITE   = 0x02F, 
00414   CDIO_MMC_FEATURE_CD_RW_MEDIA_WRITE= 0x037, 
00415   CDIO_MMC_FEATURE_DVD_PR_2_LAYER   = 0x03B, 
00416   CDIO_MMC_FEATURE_POWER_MGMT       = 0x100, 
00418   CDIO_MMC_FEATURE_CDDA_EXT_PLAY    = 0x103, 
00421   CDIO_MMC_FEATURE_MCODE_UPGRADE    = 0x104, /* Ability for the device to 
00422                                                 accept  new microcode via
00423                                                 the interface */
00424   CDIO_MMC_FEATURE_TIME_OUT         = 0x105, 
00427   CDIO_MMC_FEATURE_DVD_CSS          = 0x106, 
00430   CDIO_MMC_FEATURE_RT_STREAMING     = 0x107, 
00433   CDIO_MMC_FEATURE_LU_SN            = 0x108, 
00435   CDIO_MMC_FEATURE_FIRMWARE_DATE    = 0x1FF, 
00437 } cdio_mmc_feature_t;
00438                                 
00439 typedef enum {
00440   CDIO_MMC_FEATURE_INTERFACE_UNSPECIFIED = 0,
00441   CDIO_MMC_FEATURE_INTERFACE_SCSI        = 1,
00442   CDIO_MMC_FEATURE_INTERFACE_ATAPI       = 2,
00443   CDIO_MMC_FEATURE_INTERFACE_IEEE_1394   = 3,
00444   CDIO_MMC_FEATURE_INTERFACE_IEEE_1394A  = 4,
00445   CDIO_MMC_FEATURE_INTERFACE_FIBRE_CH    = 5
00446 } cdio_mmc_feature_interface_t;
00447   
00448 
00453 #define MAX_CDB_LEN 12
00454 
00459 typedef struct mmc_cdb_s {
00460   uint8_t field[MAX_CDB_LEN];
00461 } mmc_cdb_t;
00462   
00467   typedef struct mmc_feature_list_header_s {
00468     unsigned char length_msb;
00469     unsigned char length_1sb;
00470     unsigned char length_2sb;
00471     unsigned char length_lsb;
00472     unsigned char reserved1;
00473     unsigned char reserved2;
00474     unsigned char profile_msb;
00475     unsigned char profile_lsb;
00476   } cdio_mmc_feature_list_header_t;
00477 
00482   typedef enum mmc_direction_s {
00483     SCSI_MMC_DATA_READ,
00484     SCSI_MMC_DATA_WRITE,
00485     SCSI_MMC_DATA_NONE
00486   } cdio_mmc_direction_t;
00493 #define SCSI_MMC_HAS_DIR_NONE 1
00494   
00495   typedef struct mmc_subchannel_s
00496   {
00497     uint8_t       reserved;
00498     uint8_t       audio_status;
00499     uint16_t      data_length; 
00500     uint8_t       format;
00501     uint8_t       address:      4;
00502     uint8_t       control:      4;
00503     uint8_t       track;
00504     uint8_t       index;
00505     uint8_t       abs_addr[4];
00506     uint8_t       rel_addr[4];
00507   } cdio_mmc_subchannel_t;
00508   
00509 #define CDIO_MMC_SET_COMMAND(cdb, command)      \
00510   cdb[0] = command
00511   
00512 #define CDIO_MMC_SET_READ_TYPE(cdb, sector_type) \
00513   cdb[1] = (sector_type << 2)
00514   
00515 #define CDIO_MMC_GETPOS_LEN16(p, pos)           \
00516   (p[pos]<<8) + p[pos+1]
00517   
00518 #define CDIO_MMC_GET_LEN16(p)                   \
00519   (p[0]<<8) + p[1]
00520   
00521 #define CDIO_MMC_GET_LEN32(p) \
00522   (p[0] << 24) + (p[1] << 16) + (p[2] << 8) + p[3];
00523   
00524 #define CDIO_MMC_SET_LEN16(cdb, pos, len)       \
00525   cdb[pos  ] = (len >>  8) & 0xff;              \
00526   cdb[pos+1] = (len      ) & 0xff
00527 
00528 #define CDIO_MMC_SET_READ_LBA(cdb, lba)         \
00529   cdb[2] = (lba >> 24) & 0xff; \
00530   cdb[3] = (lba >> 16) & 0xff; \
00531   cdb[4] = (lba >>  8) & 0xff; \
00532   cdb[5] = (lba      ) & 0xff
00533 
00534 #define CDIO_MMC_SET_START_TRACK(cdb, command) \
00535   cdb[6] = command
00536 
00537 #define CDIO_MMC_SET_READ_LENGTH24(cdb, len) \
00538   cdb[6] = (len >> 16) & 0xff; \
00539   cdb[7] = (len >>  8) & 0xff; \
00540   cdb[8] = (len      ) & 0xff
00541 
00542 #define CDIO_MMC_SET_READ_LENGTH16(cdb, len) \
00543   CDIO_MMC_SET_LEN16(cdb, 7, len)
00544 
00545 #define CDIO_MMC_SET_READ_LENGTH8(cdb, len) \
00546   cdb[8] = (len      ) & 0xff
00547 
00548 #define CDIO_MMC_MCSB_ALL_HEADERS 0xf
00549 
00550 #define CDIO_MMC_SET_MAIN_CHANNEL_SELECTION_BITS(cdb, val) \
00551   cdb[9] = val << 3;
00552 
00561 driver_return_code_t mmc_audio_get_volume (CdIo_t *p_cdio,  /*out*/
00562                                            mmc_audio_volume_t *p_volume);
00563   
00570     driver_return_code_t
00571     mmc_audio_read_subchannel (CdIo_t *p_cdio, 
00572                            /*out*/ cdio_subchannel_t *p_subchannel);
00573   
00583     driver_return_code_t
00584     mmc_isrc_track_read_subchannel (CdIo_t *p_cdio,  /*in*/ const track_t track,
00585                                     /*out*/ char *p_isrc);
00586   
00591   const char *mmc_audio_state2str( uint8_t i_audio_state );
00592   
00599   int mmc_get_blocksize ( CdIo_t *p_cdio );
00600   
00606   uint8_t mmc_get_cmd_len(uint8_t mmc_cmd);
00607   
00614   lsn_t mmc_get_disc_last_lsn( const CdIo_t *p_cdio );
00615   
00625   discmode_t mmc_get_discmode( const CdIo_t *p_cdio );
00626   
00627   
00628   typedef enum {
00629     CDIO_MMC_LEVEL_WEIRD,
00630     CDIO_MMC_LEVEL_1,
00631     CDIO_MMC_LEVEL_2,
00632     CDIO_MMC_LEVEL_3,
00633     CDIO_MMC_LEVEL_NONE
00634   } cdio_mmc_level_t;
00635   
00641   cdio_mmc_level_t mmc_get_drive_mmc_cap(CdIo_t *p_cdio);
00642   
00643 
00651   discmode_t mmc_get_dvd_struct_physical ( const CdIo_t *p_cdio, 
00652                                            cdio_dvd_struct_t *s);
00653   
00660   int mmc_get_tray_status ( const CdIo_t *p_cdio );
00661 
00670   bool mmc_get_hwinfo ( const CdIo_t *p_cdio, 
00671                         /* out*/ cdio_hwinfo_t *p_hw_info );
00672   
00673   
00680   int mmc_get_media_changed(const CdIo_t *p_cdio);
00681   
00693   char * mmc_get_mcn(const CdIo_t *p_cdio);
00694   
00703   bool_3way_t mmc_have_interface(CdIo_t *p_cdio, 
00704                                  cdio_mmc_feature_interface_t e_interface );
00705   
00706 
00725   driver_return_code_t mmc_read_data_sectors ( CdIo_t *p_cdio, void *p_buf, 
00726                                                lsn_t i_lsn, 
00727                                                uint16_t i_blocksize,
00728                                                uint32_t i_blocks );
00729   
00734   driver_return_code_t mmc_read_sectors ( const CdIo_t *p_cdio, void *p_buf, 
00735                                           lsn_t i_lsn,  int read_sector_type, 
00736                                           uint32_t i_blocks);
00737   
00753   driver_return_code_t
00754   mmc_run_cmd( const CdIo_t *p_cdio, unsigned int i_timeout_ms,
00755                const mmc_cdb_t *p_cdb,
00756                cdio_mmc_direction_t e_direction, unsigned int i_buf, 
00757                /*in/out*/ void *p_buf );
00758 
00778   driver_return_code_t
00779   mmc_run_cmd_len( const CdIo_t *p_cdio, unsigned int i_timeout_ms,
00780                    const mmc_cdb_t *p_cdb, unsigned int i_cdb,
00781                    cdio_mmc_direction_t e_direction, unsigned int i_buf,
00782                    /*in/out*/ void *p_buf );
00783 
00801   int mmc_last_cmd_sense ( const CdIo_t *p_cdio, 
00802                            cdio_mmc_request_sense_t **pp_sense);
00803 
00807   driver_return_code_t mmc_set_blocksize ( const CdIo_t *p_cdio, 
00808                                            uint16_t i_blocksize);
00809 
00817   const char *mmc_cmd2str(uint8_t command);
00818         
00819 
00820   
00821 #ifdef __cplusplus
00822 }
00823 #endif /* __cplusplus */
00824 
00831 extern cdio_mmc_feature_t           debug_cdio_mmc_feature;
00832 extern cdio_mmc_feature_interface_t debug_cdio_mmc_feature_interface;
00833 extern cdio_mmc_feature_profile_t   debug_cdio_mmc_feature_profile;
00834 extern cdio_mmc_get_conf_t          debug_cdio_mmc_get_conf;
00835 extern cdio_mmc_gpcmd_t             debug_cdio_mmc_gpcmd;
00836 extern cdio_mmc_read_sub_state_t    debug_cdio_mmc_read_sub_state;
00837 extern cdio_mmc_read_cd_type_t      debug_cdio_mmc_read_cd_type;
00838 extern cdio_mmc_readtoc_t           debug_cdio_mmc_readtoc;
00839 extern cdio_mmc_mode_page_t         debug_cdio_mmc_mode_page;
00840   
00841 #ifndef DO_NOT_WANT_OLD_MMC_COMPATIBILITY
00842 #define CDIO_MMC_GPCMD_START_STOP CDIO_MMC_GPCMD_START_STOP_UNIT 
00843 #define CDIO_MMC_GPCMD_ALLOW_MEDIUM_REMOVAL  \
00844     CDIO_MMC_GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL
00845 #endif /*DO_NOT_WANT_PARANOIA_COMPATIBILITY*/
00846 
00847 #endif /* CDIO_MMC_H_ */
00848 
00849 /* 
00850  * Local variables:
00851  *  c-file-style: "ruby"
00852  *  tab-width: 8
00853  *  indent-tabs-mode: nil
00854  * End:
00855  */