Add READTOC format defines.

This commit is contained in:
rocky
2004-07-19 01:13:31 +00:00
parent f33f04ac99
commit 8a99889f49
8 changed files with 87 additions and 57 deletions

View File

@@ -1,5 +1,5 @@
/*
$Id: freebsd_cam.c,v 1.18 2004/07/18 04:19:48 rocky Exp $
$Id: freebsd_cam.c,v 1.19 2004/07/19 01:13:32 rocky Exp $
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
@@ -26,7 +26,7 @@
# include "config.h"
#endif
static const char _rcsid[] = "$Id: freebsd_cam.c,v 1.18 2004/07/18 04:19:48 rocky Exp $";
static const char _rcsid[] = "$Id: freebsd_cam.c,v 1.19 2004/07/19 01:13:32 rocky Exp $";
#ifdef HAVE_FREEBSD_CDROM
@@ -353,11 +353,18 @@ stat_size_freebsd_cam (_img_private_t *env)
sizeof(env->ccb.csio.sense_data), 0, 30*1000);
env->ccb.csio.cdb_len = 8+1;
/* Operation code */
CDIO_MMC_SET_COMMAND(env->ccb.csio.cdb_io.cdb_bytes,
CDIO_MMC_GPCMD_READ_TOC);
env->ccb.csio.cdb_io.cdb_bytes[1] = 0; /* lba; msf: 0x2 */
/* Format */
env->ccb.csio.cdb_io.cdb_bytes[2] = CDIO_MMC_READTOC_FMT_TOC;
CDIO_MMC_SET_START_TRACK(env->ccb.csio.cdb_io.cdb_bytes,
CDIO_CDROM_LEADOUT_TRACK);
env->ccb.csio.cdb_io.cdb_bytes[8] = 12; /* ? */
env->ccb.csio.data_ptr = buf;

View File

@@ -1,5 +1,5 @@
/*
$Id: aspi32.c,v 1.29 2004/07/18 06:51:49 rocky Exp $
$Id: aspi32.c,v 1.30 2004/07/19 01:13:32 rocky Exp $
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
@@ -27,7 +27,7 @@
# include "config.h"
#endif
static const char _rcsid[] = "$Id: aspi32.c,v 1.29 2004/07/18 06:51:49 rocky Exp $";
static const char _rcsid[] = "$Id: aspi32.c,v 1.30 2004/07/19 01:13:32 rocky Exp $";
#include <cdio/cdio.h>
#include <cdio/sector.h>
@@ -569,13 +569,16 @@ read_toc_aspi (_img_private_t *env)
ssc.SRB_SenseLen = SENSE_LEN;
ssc.SRB_PostProc = (LPVOID) hEvent;
/* Sizes for command descriptor buffer (CDB) are set by the SCSI opcode.
The size for READ TOC is 10. */
ssc.SRB_CDBLen = 10;
/* Operation code */
CDIO_MMC_SET_COMMAND(ssc.CDBByte, CDIO_MMC_GPCMD_READ_TOC);
/* Format */
ssc.CDBByte[ 2 ] = READ_TOC_FORMAT_TOC;
ssc.CDBByte[ 2 ] = CDIO_MMC_READTOC_FMT_TOC;
/* Starting track */
CDIO_MMC_SET_START_TRACK(ssc.CDBByte, 0);

View File

@@ -1,5 +1,5 @@
/*
$Id: win32_ioctl.c,v 1.18 2004/07/18 06:51:49 rocky Exp $
$Id: win32_ioctl.c,v 1.19 2004/07/19 01:13:32 rocky Exp $
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
@@ -26,7 +26,7 @@
# include "config.h"
#endif
static const char _rcsid[] = "$Id: win32_ioctl.c,v 1.18 2004/07/18 06:51:49 rocky Exp $";
static const char _rcsid[] = "$Id: win32_ioctl.c,v 1.19 2004/07/19 01:13:32 rocky Exp $";
#include <cdio/cdio.h>
#include <cdio/sector.h>
@@ -425,9 +425,14 @@ init_cdtext_win32ioctl (_img_private_t *env)
sptd.DataBuffer= (void *) wdata;
sptd.SenseInfoOffset=0;
/* Operation code */
CDIO_MMC_SET_COMMAND(sptd.Cdb, CDIO_MMC_GPCMD_READ_TOC);
sptd.Cdb[1] = 0x02; /* MSF mode */
sptd.Cdb[2] = 0x05; /* CD text */
/* Format */
sptd.Cdb[2] = CDIO_MMC_READTOC_FMT_CDTEXT;
CDIO_MMC_SET_READ_LENGTH(sptd.Cdb, sizeof(wdata));
/* Send the command to drive */

View File

@@ -1,5 +1,5 @@
/*
$Id: _cdio_linux.c,v 1.69 2004/07/18 03:35:07 rocky Exp $
$Id: _cdio_linux.c,v 1.70 2004/07/19 01:13:31 rocky Exp $
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
@@ -27,7 +27,7 @@
# include "config.h"
#endif
static const char _rcsid[] = "$Id: _cdio_linux.c,v 1.69 2004/07/18 03:35:07 rocky Exp $";
static const char _rcsid[] = "$Id: _cdio_linux.c,v 1.70 2004/07/19 01:13:31 rocky Exp $";
#include <string.h>
@@ -718,9 +718,15 @@ _init_cdtext_linux (_img_private_t *env)
} scsi_cmd;
memset( scsi_cmd.cdb, 0, sizeof(scsi_cmd.cdb) );
/* Operation code */
CDIO_MMC_SET_COMMAND(scsi_cmd.cdb, CDIO_MMC_GPCMD_READ_TOC);
scsi_cmd.cdb[1] = 0x02; /* MSF mode */
scsi_cmd.cdb[2] = 0x05; /* CD text */
/* Format */
scsi_cmd.cdb[2] = CDIO_MMC_READTOC_FMT_CDTEXT;
CDIO_MMC_SET_READ_LENGTH(scsi_cmd.cdb, sizeof(scsi_cmd.wdata));
scsi_cmd.inlen = sizeof(scsi_cmd.cdb);

View File

@@ -1,5 +1,5 @@
/*
$Id: _cdio_sunos.c,v 1.54 2004/07/18 03:35:07 rocky Exp $
$Id: _cdio_sunos.c,v 1.55 2004/07/19 01:13:32 rocky Exp $
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
@@ -38,7 +38,7 @@
#ifdef HAVE_SOLARIS_CDROM
static const char _rcsid[] = "$Id: _cdio_sunos.c,v 1.54 2004/07/18 03:35:07 rocky Exp $";
static const char _rcsid[] = "$Id: _cdio_sunos.c,v 1.55 2004/07/19 01:13:32 rocky Exp $";
#ifdef HAVE_GLOB_H
#include <glob.h>
@@ -442,9 +442,10 @@ _init_cdtext_solaris (_img_private_t *env)
The size for READ TOC is 10. */
unsigned char scsi_cdb[10] = {0, };
/* Operation code */
CDIO_MMC_SET_COMMAND(scsi_cdb, CDIO_MMC_GPCMD_READ_TOC);
scsi_cdb[1] = 0x02; /* MSF mode */
scsi_cdb[2] = 0x05; /* CD text */
scsi_cdb[1] = 0x02; /* MSF mode */
scsi_cdb[2] = CDIO_MMC_READTOC_FMT_CDTEXT;
CDIO_MMC_SET_READ_LENGTH( scsi_cdb, sizeof(wdata) );
my_cmd.uscsi_flags = (USCSI_READ|USCSI_RQENABLE); /* We're going get data */
@@ -625,7 +626,7 @@ _get_drive_cap_solaris (const void *user_data,
my_cmd.uscsi_rqbuf = my_rq_buf; /* Pointer to the request sense buffer */
status = ioctl(env->gen.fd, USCSICMD, &my_cmd);
if(status == 0) {
if (status == 0) {
uint8_t *p;
int lenData = ((unsigned int)buf[0] << 8) + buf[1];
uint8_t *pMax = buf + 256;

View File

@@ -1,6 +1,6 @@
/* Common MMC routines.
$Id: scsi_mmc.c,v 1.5 2004/07/18 03:35:07 rocky Exp $
$Id: scsi_mmc.c,v 1.6 2004/07/19 01:13:32 rocky Exp $
Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
@@ -27,15 +27,15 @@
#include <cdio/scsi_mmc.h>
/*!
On input A MODE_SENSE command was issued and we have the results
On input a MODE_SENSE command was issued and we have the results
in p. We interpret this and return a bit mask set according to the
capabilities.
*/
void
cdio_get_drive_cap_mmc(const uint8_t *p,
cdio_drive_read_cap_t *p_read_cap,
cdio_drive_write_cap_t *p_write_cap,
cdio_drive_misc_cap_t *p_misc_cap)
/*out*/ cdio_drive_read_cap_t *p_read_cap,
/*out*/ cdio_drive_write_cap_t *p_write_cap,
/*out*/ cdio_drive_misc_cap_t *p_misc_cap)
{
/* Reader */
if (p[2] & 0x01) *p_read_cap |= CDIO_DRIVE_CAP_READ_CD_R;
@@ -50,10 +50,10 @@ cdio_get_drive_cap_mmc(const uint8_t *p,
if (p[3] & 0x02) *p_write_cap |= CDIO_DRIVE_CAP_WRITE_CD_RW;
if (p[3] & 0x10) *p_write_cap |= CDIO_DRIVE_CAP_WRITE_DVD_R;
if (p[3] & 0x20) *p_write_cap |= CDIO_DRIVE_CAP_WRITE_DVD_RAM;
if (p[4] & 0x80) *p_misc_cap |= CDIO_DRIVE_CAP_WRITE_BURN_PROOF;
/* Misc */
if (p[4] & 0x40) *p_misc_cap |= CDIO_DRIVE_CAP_MISC_MULTI_SESSION;
if (p[6] & 0x01) *p_misc_cap |= CDIO_DRIVE_CAP_MISC_LOCK;
if (p[6] & 0x08) *p_misc_cap |= CDIO_DRIVE_CAP_MISC_EJECT;
if (p[6] >> 5 != 0)