Commit 62950936 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] mt rainier support

From: Jens Axboe <axboe@suse.de>

Following patch adds mt rainier support to the cdrom uniform layer (it
works with atapi and scsi/usb).
parent 9147d7be
This diff is collapsed.
This diff is collapsed.
......@@ -35,6 +35,12 @@
#define NO_DOOR_LOCKING 0
#endif
/*
* typical timeout for packet command
*/
#define ATAPI_WAIT_PC (60 * HZ)
#define ATAPI_WAIT_BUSY (5 * HZ)
/************************************************************************/
#define SECTOR_BITS 9
......@@ -75,6 +81,9 @@ struct ide_cd_config_flags {
__u8 dvd : 1; /* Drive is a DVD-ROM */
__u8 dvd_r : 1; /* Drive can write DVD-R */
__u8 dvd_ram : 1; /* Drive can write DVD-RAM */
__u8 mrw : 1; /* drive can read mrw */
__u8 mrw_w : 1; /* drive can write mrw */
__u8 ram : 1; /* generic WRITE (dvd-ram/mrw) */
__u8 test_write : 1; /* Drive can fake writes */
__u8 supp_disc_present : 1; /* Changer can report exact contents
of slots. */
......@@ -482,6 +491,8 @@ struct cdrom_info {
/* Per-device info needed by cdrom.c generic driver. */
struct cdrom_device_info devinfo;
unsigned long write_timeout;
};
/****************************************************************************
......
......@@ -67,7 +67,8 @@ MODULE_PARM(xa_test, "i"); /* see sr_ioctl.c */
(CDC_CLOSE_TRAY|CDC_OPEN_TRAY|CDC_LOCK|CDC_SELECT_SPEED| \
CDC_SELECT_DISC|CDC_MULTI_SESSION|CDC_MCN|CDC_MEDIA_CHANGED| \
CDC_PLAY_AUDIO|CDC_RESET|CDC_IOCTLS|CDC_DRIVE_STATUS| \
CDC_CD_R|CDC_CD_RW|CDC_DVD|CDC_DVD_R|CDC_DVD_RAM|CDC_GENERIC_PACKET)
CDC_CD_R|CDC_CD_RW|CDC_DVD|CDC_DVD_R|CDC_DVD_RAM|CDC_GENERIC_PACKET| \
CDC_MRW|CDC_MRW_W|CDC_RAM)
static int sr_probe(struct device *);
static int sr_remove(struct device *);
......@@ -692,7 +693,7 @@ static void get_sectorsize(struct scsi_cd *cd)
static void get_capabilities(struct scsi_cd *cd)
{
unsigned char *buffer;
int rc, n;
int rc, n, mrw_write = 0, mrw = 1;
struct scsi_mode_data data;
struct scsi_request *SRpnt;
unsigned char cmd[MAX_COMMAND_SIZE];
......@@ -765,6 +766,15 @@ static void get_capabilities(struct scsi_cd *cd)
printk("%s: scsi-1 drive\n", cd->cdi.name);
return;
}
if (cdrom_is_mrw(&cd->cdi, &mrw_write)) {
mrw = 0;
cd->cdi.mask |= CDC_MRW;
cd->cdi.mask |= CDC_MRW_W;
}
if (!mrw_write)
cd->cdi.mask |= CDC_MRW_W;
n = data.header_length + data.block_descriptor_length;
cd->cdi.speed = ((buffer[n + 8] << 8) + buffer[n + 9]) / 176;
cd->readcd_known = 1;
......@@ -788,9 +798,7 @@ static void get_capabilities(struct scsi_cd *cd)
if ((buffer[n + 3] & 0x20) == 0) {
/* can't write DVD-RAM media */
cd->cdi.mask |= CDC_DVD_RAM;
} else {
cd->device->writeable = 1;
}
} else
if ((buffer[n + 3] & 0x10) == 0)
/* can't write DVD-R media */
cd->cdi.mask |= CDC_DVD_R;
......@@ -814,6 +822,12 @@ static void get_capabilities(struct scsi_cd *cd)
/*else I don't think it can close its tray
cd->cdi.mask |= CDC_CLOSE_TRAY; */
/*
* if DVD-RAM of MRW-W, we are randomly writeable
*/
if ((cd->cdi.mask & (CDC_DVD_RAM | CDC_MRW_W)) != (CDC_DVD_RAM | CDC_MRW_W))
cd->device->writeable = 1;
scsi_release_request(SRpnt);
kfree(buffer);
}
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment