Don't rely on MMC backward compatibility.

This commit is contained in:
rocky
2005-03-06 00:54:50 +00:00
parent 3e84283fa8
commit 29780fc927
5 changed files with 27 additions and 27 deletions

View File

@@ -1,5 +1,5 @@
/* /*
$Id: aspi32.c,v 1.7 2005/02/07 03:36:02 rocky Exp $ $Id: aspi32.c,v 1.8 2005/03/06 00:54:50 rocky Exp $
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -27,7 +27,7 @@
# include "config.h" # include "config.h"
#endif #endif
static const char _rcsid[] = "$Id: aspi32.c,v 1.7 2005/02/07 03:36:02 rocky Exp $"; static const char _rcsid[] = "$Id: aspi32.c,v 1.8 2005/03/06 00:54:50 rocky Exp $";
#include <cdio/cdio.h> #include <cdio/cdio.h>
#include <cdio/sector.h> #include <cdio/sector.h>
@@ -488,8 +488,8 @@ init_aspi (_img_private_t *env)
*/ */
int int
run_mmc_cmd_aspi( void *p_user_data, unsigned int i_timeout_ms, run_mmc_cmd_aspi( void *p_user_data, unsigned int i_timeout_ms,
unsigned int i_cdb, const scsi_mmc_cdb_t * p_cdb, unsigned int i_cdb, const mmc_cdb_t * p_cdb,
scsi_mmc_direction_t e_direction, mmc_direction_t e_direction,
unsigned int i_buf, /*in/out*/ void *p_buf ) unsigned int i_buf, /*in/out*/ void *p_buf )
{ {
const _img_private_t *p_env = p_user_data; const _img_private_t *p_env = p_user_data;
@@ -552,7 +552,7 @@ static int
read_sectors_aspi (_img_private_t *p_env, void *data, lsn_t lsn, read_sectors_aspi (_img_private_t *p_env, void *data, lsn_t lsn,
int sector_type, unsigned int nblocks) int sector_type, unsigned int nblocks)
{ {
scsi_mmc_cdb_t cdb = {{0, }}; mmc_cdb_t cdb = {{0, }};
unsigned int i_buf; unsigned int i_buf;
int sync = 0; int sync = 0;
@@ -602,7 +602,7 @@ read_sectors_aspi (_img_private_t *p_env, void *data, lsn_t lsn,
} }
return run_mmc_cmd_aspi(p_env, OP_TIMEOUT_MS, return run_mmc_cmd_aspi(p_env, OP_TIMEOUT_MS,
scsi_mmc_get_cmd_len(cdb.field[0]), mmc_get_cmd_len(cdb.field[0]),
&cdb, SCSI_MMC_DATA_READ, i_buf*nblocks, data); &cdb, SCSI_MMC_DATA_READ, i_buf*nblocks, data);
} }
@@ -653,7 +653,7 @@ read_mode1_sector_aspi (_img_private_t *p_env, void *data, lsn_t lsn,
bool bool
read_toc_aspi (_img_private_t *p_env) read_toc_aspi (_img_private_t *p_env)
{ {
scsi_mmc_cdb_t cdb = {{0, }}; mmc_cdb_t cdb = {{0, }};
unsigned char tocheader[ 4 ]; unsigned char tocheader[ 4 ];
int i_status; int i_status;
@@ -669,7 +669,7 @@ read_toc_aspi (_img_private_t *p_env)
CDIO_MMC_SET_READ_LENGTH16(cdb.field, sizeof(tocheader)); CDIO_MMC_SET_READ_LENGTH16(cdb.field, sizeof(tocheader));
i_status = run_mmc_cmd_aspi (p_env, OP_TIMEOUT_MS, i_status = run_mmc_cmd_aspi (p_env, OP_TIMEOUT_MS,
scsi_mmc_get_cmd_len(cdb.field[0]), mmc_get_cmd_len(cdb.field[0]),
&cdb, SCSI_MMC_DATA_READ, &cdb, SCSI_MMC_DATA_READ,
sizeof(tocheader), &tocheader); sizeof(tocheader), &tocheader);
@@ -695,7 +695,7 @@ read_toc_aspi (_img_private_t *p_env)
CDIO_MMC_SET_READ_LENGTH16(cdb.field, i_toclength); CDIO_MMC_SET_READ_LENGTH16(cdb.field, i_toclength);
i_status = run_mmc_cmd_aspi (p_env, OP_TIMEOUT_MS, i_status = run_mmc_cmd_aspi (p_env, OP_TIMEOUT_MS,
scsi_mmc_get_cmd_len(cdb.field[0]), mmc_get_cmd_len(cdb.field[0]),
&cdb, SCSI_MMC_DATA_READ, &cdb, SCSI_MMC_DATA_READ,
i_toclength, p_fulltoc); i_toclength, p_fulltoc);
if( 0 != i_status ) { if( 0 != i_status ) {

View File

@@ -1,6 +1,6 @@
/* Win32 aspi specific */ /* Win32 aspi specific */
/* /*
$Id: aspi32.h,v 1.3 2005/02/06 17:36:17 rocky Exp $ $Id: aspi32.h,v 1.4 2005/03/06 00:54:50 rocky Exp $
Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -243,7 +243,7 @@ bool read_toc_aspi (_img_private_t *env);
int run_mmc_cmd_aspi( void *p_user_data, int run_mmc_cmd_aspi( void *p_user_data,
unsigned int i_timeout, unsigned int i_timeout,
unsigned int i_cdb, unsigned int i_cdb,
const scsi_mmc_cdb_t * p_cdb, const mmc_cdb_t * p_cdb,
scsi_mmc_direction_t e_direction, mmc_direction_t e_direction,
unsigned int i_buf, /*in/out*/ void *p_buf ); unsigned int i_buf, /*in/out*/ void *p_buf );

View File

@@ -1,5 +1,5 @@
/* /*
$Id: win32.c,v 1.23 2005/03/05 19:27:28 rocky Exp $ $Id: win32.c,v 1.24 2005/03/06 00:54:50 rocky Exp $
Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -26,7 +26,7 @@
# include "config.h" # include "config.h"
#endif #endif
static const char _rcsid[] = "$Id: win32.c,v 1.23 2005/03/05 19:27:28 rocky Exp $"; static const char _rcsid[] = "$Id: win32.c,v 1.24 2005/03/06 00:54:50 rocky Exp $";
#include <cdio/cdio.h> #include <cdio/cdio.h>
#include <cdio/sector.h> #include <cdio/sector.h>
@@ -246,8 +246,8 @@ is_cdrom_win32(const char drive_letter) {
*/ */
static int static int
run_mmc_cmd_win32( void *p_user_data, unsigned int i_timeout_ms, run_mmc_cmd_win32( void *p_user_data, unsigned int i_timeout_ms,
unsigned int i_cdb, const scsi_mmc_cdb_t *p_cdb, unsigned int i_cdb, const mmc_cdb_t *p_cdb,
scsi_mmc_direction_t e_direction, mmc_direction_t e_direction,
unsigned int i_buf, /*in/out*/ void *p_buf ) unsigned int i_buf, /*in/out*/ void *p_buf )
{ {
_img_private_t *p_env = p_user_data; _img_private_t *p_env = p_user_data;
@@ -340,7 +340,7 @@ read_audio_sectors (void *p_user_data, void *p_buf, lsn_t i_lsn,
#if 0 #if 0
return read_audio_sectors_win32ioctl( p_env, p_buf, i_lsn, i_blocks ); return read_audio_sectors_win32ioctl( p_env, p_buf, i_lsn, i_blocks );
#else #else
return scsi_mmc_read_sectors( p_env->gen.cdio, p_buf, i_lsn, return mmc_read_sectors( p_env->gen.cdio, p_buf, i_lsn,
CDIO_MMC_READ_TYPE_CDDA, i_blocks); CDIO_MMC_READ_TYPE_CDDA, i_blocks);
#endif #endif
} }
@@ -603,7 +603,7 @@ _cdio_get_mcn (const void *p_user_data) {
const _img_private_t *p_env = p_user_data; const _img_private_t *p_env = p_user_data;
if( p_env->hASPI ) { if( p_env->hASPI ) {
return scsi_mmc_get_mcn( p_env->gen.cdio ); return mmc_get_mcn( p_env->gen.cdio );
} else { } else {
return get_mcn_win32ioctl(p_env); return get_mcn_win32ioctl(p_env);
} }

View File

@@ -1,5 +1,5 @@
/* /*
$Id: win32.h,v 1.5 2005/03/05 09:11:44 rocky Exp $ $Id: win32.h,v 1.6 2005/03/06 00:54:50 rocky Exp $
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -145,8 +145,8 @@ const char *is_cdrom_win32ioctl (const char drive_letter);
int run_mmc_cmd_win32ioctl( void *p_user_data, int run_mmc_cmd_win32ioctl( void *p_user_data,
unsigned int i_timeout, unsigned int i_timeout,
unsigned int i_cdb, unsigned int i_cdb,
const scsi_mmc_cdb_t * p_cdb, const mmc_cdb_t * p_cdb,
scsi_mmc_direction_t e_direction, mmc_direction_t e_direction,
unsigned int i_buf, /*in/out*/ void *p_buf ); unsigned int i_buf, /*in/out*/ void *p_buf );
/*! /*!

View File

@@ -1,5 +1,5 @@
/* /*
$Id: win32_ioctl.c,v 1.17 2005/03/05 22:10:20 rocky Exp $ $Id: win32_ioctl.c,v 1.18 2005/03/06 00:54:50 rocky Exp $
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -26,7 +26,7 @@
# include "config.h" # include "config.h"
#endif #endif
static const char _rcsid[] = "$Id: win32_ioctl.c,v 1.17 2005/03/05 22:10:20 rocky Exp $"; static const char _rcsid[] = "$Id: win32_ioctl.c,v 1.18 2005/03/06 00:54:50 rocky Exp $";
#ifdef HAVE_WIN32_CDROM #ifdef HAVE_WIN32_CDROM
@@ -288,8 +288,8 @@ audio_set_volume_win32ioctl (void *p_user_data,
int int
run_mmc_cmd_win32ioctl( void *p_user_data, run_mmc_cmd_win32ioctl( void *p_user_data,
unsigned int i_timeout_ms, unsigned int i_timeout_ms,
unsigned int i_cdb, const scsi_mmc_cdb_t * p_cdb, unsigned int i_cdb, const mmc_cdb_t * p_cdb,
scsi_mmc_direction_t e_direction, mmc_direction_t e_direction,
unsigned int i_buf, /*in/out*/ void *p_buf ) unsigned int i_buf, /*in/out*/ void *p_buf )
{ {
const _img_private_t *p_env = p_user_data; const _img_private_t *p_env = p_user_data;
@@ -520,7 +520,7 @@ read_audio_sectors_win32ioctl (_img_private_t *p_env, void *data, lsn_t lsn,
static int static int
read_raw_sector (_img_private_t *p_env, void *p_buf, lsn_t lsn) read_raw_sector (_img_private_t *p_env, void *p_buf, lsn_t lsn)
{ {
scsi_mmc_cdb_t cdb = {{0, }}; mmc_cdb_t cdb = {{0, }};
/* ReadCD CDB12 command. The values were taken from MMC1 draft paper. */ /* ReadCD CDB12 command. The values were taken from MMC1 draft paper. */
CDIO_MMC_SET_COMMAND (cdb.field, CDIO_MMC_GPCMD_READ_CD); CDIO_MMC_SET_COMMAND (cdb.field, CDIO_MMC_GPCMD_READ_CD);
@@ -675,7 +675,7 @@ init_win32ioctl (_img_private_t *env)
static bool static bool
read_fulltoc_win32mmc (_img_private_t *p_env) read_fulltoc_win32mmc (_img_private_t *p_env)
{ {
scsi_mmc_cdb_t cdb = {{0, }}; mmc_cdb_t cdb = {{0, }};
CDROM_TOC_FULL cdrom_toc_full; CDROM_TOC_FULL cdrom_toc_full;
int i_status, i, j; int i_status, i, j;
int i_track_format = 0; int i_track_format = 0;