- Redo types of lsn and lba to allow negative values. Should model MMC3

specs. Add max/min values for lsn.
- More complete MMC command set
This commit is contained in:
rocky
2004-05-11 02:15:42 +00:00
parent aab600b46a
commit 3f6cba2b0a
8 changed files with 81 additions and 45 deletions

View File

@@ -1,5 +1,5 @@
/*
$Id: scsi_mmc.h,v 1.1 2004/05/10 03:28:52 rocky Exp $
$Id: scsi_mmc.h,v 1.2 2004/05/11 02:15:47 rocky Exp $
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
@@ -41,9 +41,12 @@
#define CDIO_MMC_GPCMD_READ_10 0x28
#define CDIO_MMC_GPCMD_READ_SUBCHANNEL 0x42
#define CDIO_MMC_READ_TOC 0x43
#define CDIO_MMC_MODE_SELECT 0x55
#define CDIO_MMC_MODE_SELECT_6 0x15
#define CDIO_MMC_MODE_SENSE_10 0x5a
#define CDIO_MMC_GPCMD_READ_12 0xa8
#define CDIO_MMC_GPCMD_READ_CD 0xbe
#define CDIO_MMC_GPCMD_READ_MSF 0xb9
#define CDIO_MMC_SET_COMMAND(rec, command) \
rec[0] = command

View File

@@ -1,5 +1,5 @@
/*
$Id: sector.h,v 1.11 2004/05/10 03:28:52 rocky Exp $
$Id: sector.h,v 1.12 2004/05/11 02:15:49 rocky Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
@@ -123,8 +123,11 @@
#define M2SUB_SECTOR_SIZE 2332
#define M2RAW_SECTOR_SIZE 2336
#define CDIO_CD_MAX_TRACKS 99
#define CDIO_CD_MIN_TRACK_NO 1
#define CDIO_CD_MAX_TRACKS 99
#define CDIO_CD_MIN_TRACK_NO 1
#define CDIO_CD_MAX_LSN 450150
#define CDIO_CD_MIN_LSN -450150
#define CDIO_CD_FRAMES_PER_MIN \
(CDIO_CD_FRAMES_PER_SEC*CDIO_CD_SECS_PER_MIN)

View File

@@ -1,5 +1,5 @@
/*
$Id: types.h,v 1.15 2004/05/08 14:07:09 rocky Exp $
$Id: types.h,v 1.16 2004/05/11 02:15:57 rocky Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
@@ -204,14 +204,19 @@ extern "C" {
typedef uint8_t bitfield_t;
#endif
/*! The type of a Logical Block Address.
/*! The type of a Logical Block Address. We allow for an lba to be
negative to be consistent with an lba, although I'm not sure this
this is possible.
*/
typedef int32_t lba_t;
/*! The type of a Logical Sector Number. Note that an lba lsn be negative
and the MMC3 specs allow for a conversion of a negative lba
@see msf_t
*/
typedef uint32_t lba_t;
/*! The type of an Logical Sector Number. */
typedef uint32_t lsn_t;
typedef int32_t lsn_t;
/*! The type of an track number 0..99. */
typedef uint8_t track_t;
@@ -222,14 +227,16 @@ extern "C" {
#define CDIO_INVALID_TRACK 0xFF
/*!
Constant for invalid LBA
Constant for invalid LBA. It is 151 less than the most negative
LBA -45150. This provide slack for the 150-frame offset in
LBA to LSN 150 conversions
*/
#define CDIO_INVALID_LBA 0xFFFFFFFF
#define CDIO_INVALID_LBA -45301
/*!
Constant for invalid LSN
*/
#define CDIO_INVALID_LSN 0xFFFFFFFF
#define CDIO_INVALID_LSN CDIO_INVALID_LBA
typedef int cdio_fs_anal_t;