Thomas Schmitt's first patches towards supporting writing from libcdio. Somewhat experimental and for now just the GNU/Linux driver.

This commit is contained in:
R. Bernstein
2009-12-19 18:17:18 -05:00
parent 423dc300f6
commit 4e8eff137e
2 changed files with 18 additions and 17 deletions

View File

@@ -374,18 +374,20 @@ typedef struct mmc_cdb_s {
unsigned char reserved2; unsigned char reserved2;
unsigned char profile_msb; unsigned char profile_msb;
unsigned char profile_lsb; unsigned char profile_lsb;
} cdio_mmc_feature_list_header_t; } cdio_mmc_feature_list_header_t;
/** An enumeration indicating whether an MMC command is sending /** An enumeration indicating whether an MMC command is sending
data or getting data. data, or getting data, or does none of both.
*/
typedef enum mmc_direction_s {
SCSI_MMC_DATA_READ,
SCSI_MMC_DATA_WRITE,
SCSI_MMC_DATA_NONE
} cdio_mmc_direction_t;
/** Indicate to applications that SCSI_MMC_DATA_NONE is available
*/ */
typedef enum mmc_direction_s { #define SCSI_MMC_HAS_DIR_NONE 1
SCSI_MMC_DATA_READ,
SCSI_MMC_DATA_WRITE
} cdio_mmc_direction_t;
typedef struct mmc_subchannel_s typedef struct mmc_subchannel_s
{ {
uint8_t reserved; uint8_t reserved;
uint8_t audio_status; uint8_t audio_status;
uint16_t data_length; /**< Really ISO 9660 7.2.2 */ uint16_t data_length; /**< Really ISO 9660 7.2.2 */

View File

@@ -1224,13 +1224,12 @@ run_mmc_cmd_linux( void *p_user_data,
const _img_private_t *p_env = p_user_data; const _img_private_t *p_env = p_user_data;
struct cdrom_generic_command cgc; struct cdrom_generic_command cgc;
memset (&cgc, 0, sizeof (struct cdrom_generic_command)); memset (&cgc, 0, sizeof (struct cdrom_generic_command));
memcpy(&cgc.cmd, p_cdb, i_cdb); memcpy(&cgc.cmd, p_cdb, i_cdb);
cgc.buflen = i_buf; cgc.buflen = i_buf;
cgc.buffer = p_buf; cgc.buffer = p_buf;
cgc.data_direction = (SCSI_MMC_DATA_READ == cgc.data_direction) cgc.data_direction = (SCSI_MMC_DATA_READ == e_direction)
? CGC_DATA_READ : CGC_DATA_WRITE; ? CGC_DATA_READ : CGC_DATA_WRITE;
#ifdef HAVE_LINUX_CDROM_TIMEOUT
#ifdef HAVE_LINUX_CDROM_TIMEOUT
cgc.timeout = i_timeout_ms; cgc.timeout = i_timeout_ms;
#endif #endif
@@ -1639,7 +1638,7 @@ cdio_open_am_linux (const char *psz_orig_source, const char *access_mode)
ret->driver_id = DRIVER_LINUX; ret->driver_id = DRIVER_LINUX;
if (cdio_generic_init(_data, O_RDONLY|O_NONBLOCK)) { if (cdio_generic_init(_data, O_RDWR|O_NONBLOCK)) {
return ret; return ret;
} else { } else {
cdio_generic_free (_data); cdio_generic_free (_data);