From ff49db8449a7ea3c47df098241fafdd2c79b82b5 Mon Sep 17 00:00:00 2001 From: "R. Bernstein" Date: Thu, 11 Feb 2010 06:35:22 -0500 Subject: [PATCH] Move another routine from mmc.c into mmc_hl_cmds.c --- include/cdio/mmc.h | 8 ---- include/cdio/mmc_hl_cmds.h | 8 ++++ lib/driver/mmc/mmc.c | 71 ++++++++++++++---------------------- lib/driver/mmc/mmc_hl_cmds.c | 16 ++++++++ test/driver/mmc_read.c | 2 - 5 files changed, 52 insertions(+), 53 deletions(-) diff --git a/include/cdio/mmc.h b/include/cdio/mmc.h index c95872e4..69d7fb32 100644 --- a/include/cdio/mmc.h +++ b/include/cdio/mmc.h @@ -657,14 +657,6 @@ mmc_audio_read_subchannel (CdIo_t *p_cdio, */ lsn_t mmc_get_disc_last_lsn( const CdIo_t *p_cdio ); - /** - Close tray using a MMC START STOP UNIT command. - @param p_cdio the CD object to be acted upon. - @return DRIVER_OP_SUCCESS (0) if we got the status. - return codes are the same as driver_return_code_t - */ - driver_return_code_t mmc_close_tray( CdIo_t *p_cdio ); - /** Return the discmode as reported by the MMC Read (FULL) TOC command. diff --git a/include/cdio/mmc_hl_cmds.h b/include/cdio/mmc_hl_cmds.h index 30940d59..f8e899d9 100644 --- a/include/cdio/mmc_hl_cmds.h +++ b/include/cdio/mmc_hl_cmds.h @@ -31,6 +31,14 @@ extern "C" { #endif /* __cplusplus */ + /** + Close tray using a MMC START STOP UNIT command. + @param p_cdio the CD object to be acted upon. + @return DRIVER_OP_SUCCESS (0) if we got the status. + return codes are the same as driver_return_code_t + */ + driver_return_code_t mmc_close_tray( CdIo_t *p_cdio ); + /** Detects if a disc (CD or DVD) is erasable or not. diff --git a/lib/driver/mmc/mmc.c b/lib/driver/mmc/mmc.c index 35de3b08..bccd2696 100644 --- a/lib/driver/mmc/mmc.c +++ b/lib/driver/mmc/mmc.c @@ -199,9 +199,35 @@ get_tray_status (const void *p_user_data) return mmc_get_tray_status( p_env->cdio ); } -/*! Read sectors using SCSI-MMC GPCMD_READ_CD. +/** + Read sectors using SCSI-MMC GPCMD_READ_CD. + */ +driver_return_code_t +mmc_read_data_sectors ( CdIo_t *p_cdio, void *p_buf, + lsn_t i_lsn, uint16_t i_blocksize, + uint32_t i_blocks ) +{ + return mmc_read_cd(p_cdio, + p_buf, /* place to store data */ + i_lsn, /* lsn */ + 0, /* read_sector_type */ + false, /* digital audio play */ + false, /* return sync header */ + 0, /* header codes */ + true, /* return user data */ + false, /* return EDC ECC */ + false, /* return C2 Error information */ + 0, /* subchannel selection bits */ + ISO_BLOCKSIZE, /* blocksize*/ + i_blocks /* Number of blocks. */); + +} + + +/** + Read sectors using SCSI-MMC GPCMD_READ_CD. Can read only up to 25 blocks. -*/ + */ driver_return_code_t read_data_sectors_mmc ( void *p_user_data, void *p_buf, lsn_t i_lsn, uint16_t i_blocksize, @@ -1014,22 +1040,6 @@ mmc_run_cmd_len( const CdIo_t *p_cdio, unsigned int i_timeout_ms, p_cdb, e_direction, i_buf, p_buf); } -/** - Close tray using a MMC START STOP UNIT command. - @param p_cdio the CD object to be acted upon. - @return DRIVER_OP_SUCCESS (0) if we got the status. - return codes are the same as driver_return_code_t -*/ -driver_return_code_t -mmc_close_tray( CdIo_t *p_cdio ) -{ - if (p_cdio) { - return mmc_start_stop_unit(p_cdio, false, false, 0, 0); - } else { - return DRIVER_OP_ERROR; - } -} - /** Return a string containing the name of the given feature */ @@ -1338,31 +1348,6 @@ mmc_is_disctype_rewritable (cdio_mmc_feature_profile_t disctype) { } } - -/** - Read sectors using SCSI-MMC GPCMD_READ_CD. -*/ -driver_return_code_t -mmc_read_data_sectors ( CdIo_t *p_cdio, void *p_buf, - lsn_t i_lsn, uint16_t i_blocksize, - uint32_t i_blocks ) -{ - return mmc_read_cd(p_cdio, - p_buf, /* place to store data */ - i_lsn, /* lsn */ - 0, /* read_sector_type */ - false, /* digital audio play */ - false, /* return sync header */ - 0, /* header codes */ - true, /* return user data */ - false, /* return EDC ECC */ - false, /* return C2 Error information */ - 0, /* subchannel selection bits */ - ISO_BLOCKSIZE, /* blocksize*/ - i_blocks /* Number of blocks. */); - -} - /** Read sectors using SCSI-MMC GPCMD_READ_CD. Can read only up to 25 blocks. diff --git a/lib/driver/mmc/mmc_hl_cmds.c b/lib/driver/mmc/mmc_hl_cmds.c index 2912161c..940846d6 100644 --- a/lib/driver/mmc/mmc_hl_cmds.c +++ b/lib/driver/mmc/mmc_hl_cmds.c @@ -24,6 +24,22 @@ #include #include +/** + Close tray using a MMC START STOP UNIT command. + @param p_cdio the CD object to be acted upon. + @return DRIVER_OP_SUCCESS (0) if we got the status. + return codes are the same as driver_return_code_t +*/ +driver_return_code_t +mmc_close_tray( CdIo_t *p_cdio ) +{ + if (p_cdio) { + return mmc_start_stop_unit(p_cdio, false, false, 0, 0); + } else { + return DRIVER_OP_ERROR; + } +} + /** Eject using MMC commands. If CD-ROM is "locked" we'll unlock it. Command is not "immediate" -- we'll wait for the command to complete. diff --git a/test/driver/mmc_read.c b/test/driver/mmc_read.c index d493ba83..7d2c2bdf 100644 --- a/test/driver/mmc_read.c +++ b/test/driver/mmc_read.c @@ -432,5 +432,3 @@ main(int argc, const char *argv[]) return exitrc; } - -