patch-2.2.18 linux/drivers/scsi/sr_ioctl.c
Next file: linux/drivers/scsi/st.c
Previous file: linux/drivers/scsi/sr.c
Back to the patch index
Back to the overall index
- Lines: 71
- Date:
Fri Sep 15 12:47:12 2000
- Orig file:
v2.2.17/drivers/scsi/sr_ioctl.c
- Orig date:
Sat Sep 9 18:42:41 2000
diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.17/drivers/scsi/sr_ioctl.c linux/drivers/scsi/sr_ioctl.c
@@ -314,6 +314,8 @@
u_char sr_cmd[10];
int result, target = MINOR(cdi->dev);
unsigned char buffer[32];
+
+ memset(sr_cmd, 0, sizeof(sr_cmd));
switch (cmd)
{
@@ -324,10 +326,7 @@
sr_cmd[0] = GPCMD_READ_TOC_PMA_ATIP;
sr_cmd[1] = ((scsi_CDs[target].device->lun) << 5);
sr_cmd[2] = sr_cmd[3] = sr_cmd[4] = sr_cmd[5] = 0;
- sr_cmd[6] = 0;
- sr_cmd[7] = 0; /* MSB of length (12) */
sr_cmd[8] = 12; /* LSB of length */
- sr_cmd[9] = 0;
result = sr_do_ioctl(target, sr_cmd, buffer, 12, 1);
@@ -346,9 +345,7 @@
(tocentry->cdte_format == CDROM_MSF ? 0x02 : 0);
sr_cmd[2] = sr_cmd[3] = sr_cmd[4] = sr_cmd[5] = 0;
sr_cmd[6] = tocentry->cdte_track;
- sr_cmd[7] = 0; /* MSB of length (12) */
sr_cmd[8] = 12; /* LSB of length */
- sr_cmd[9] = 0;
result = sr_do_ioctl (target, sr_cmd, buffer, 12, 0);
@@ -373,9 +370,7 @@
sr_cmd[0] = MODE_SENSE;
sr_cmd[1] = (scsi_CDs[target].device -> lun) << 5;
sr_cmd[2] = 0xe; /* Want mode page 0xe, CDROM audio params */
- sr_cmd[3] = 0;
sr_cmd[4] = 28;
- sr_cmd[5] = 0;
if ((buffer = (unsigned char *) scsi_malloc(512)) == NULL)
return -ENOMEM;
@@ -436,9 +431,7 @@
sr_cmd[0] = MODE_SENSE;
sr_cmd[1] = (scsi_CDs[target].device -> lun) << 5;
sr_cmd[2] = 0xe; /* Want mode page 0xe, CDROM audio params */
- sr_cmd[3] = 0;
sr_cmd[4] = 28;
- sr_cmd[5] = 0;
if ((buffer = (unsigned char *) scsi_malloc(512)) == NULL)
return -ENOMEM;
@@ -455,6 +448,20 @@
volctrl->channel3 = buffer[27];
scsi_free(buffer, 512);
+ break;
+ }
+
+ case CDROMPLAYTRKIND: {
+ struct cdrom_ti* ti = (struct cdrom_ti*)arg;
+
+ sr_cmd[0] = GPCMD_PLAYAUDIO_TI;
+ sr_cmd[1] = scsi_CDs[target].device->lun << 5;
+ sr_cmd[4] = ti->cdti_trk0;
+ sr_cmd[5] = ti->cdti_ind0;
+ sr_cmd[7] = ti->cdti_trk1;
+ sr_cmd[8] = ti->cdti_ind1;
+
+ result = sr_do_ioctl(target, sr_cmd, NULL, 255, 0);
break;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)