patch-1.3.76 linux/drivers/scsi/sr_ioctl.c
Next file: linux/drivers/sound/configure.c
Previous file: linux/drivers/scsi/sr.c
Back to the patch index
Back to the overall index
- Lines: 45
- Date:
Tue Mar 19 08:58:59 1996
- Orig file:
v1.3.75/linux/drivers/scsi/sr_ioctl.c
- Orig date:
Sat Nov 11 17:41:33 1995
diff -u --recursive --new-file v1.3.75/linux/drivers/scsi/sr_ioctl.c linux/drivers/scsi/sr_ioctl.c
@@ -378,6 +378,44 @@
return result;
}
+ case CDROMVOLREAD:
+ {
+ char * buffer;
+ struct cdrom_volctrl volctrl;
+
+ err = verify_area (VERIFY_WRITE, (void *) arg, sizeof (struct cdrom_volctrl));
+ if (err) return err;
+
+ /* Get the current params */
+
+ 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;
+
+ buffer = (unsigned char *) scsi_malloc(512);
+ if(!buffer) return -ENOMEM;
+
+ if ((result = do_ioctl (target, sr_cmd, buffer, 28))) {
+ printk ("(CDROMVOLREAD) Hosed while obtaining audio mode page\n");
+ scsi_free(buffer, 512);
+ return result;
+ }
+
+ volctrl.channel0 = buffer[21];
+ volctrl.channel1 = buffer[23];
+ volctrl.channel2 = buffer[25];
+ volctrl.channel3 = buffer[27];
+
+ memcpy_tofs ((void *) arg, &volctrl, sizeof (struct cdrom_volctrl));
+
+ scsi_free(buffer, 512);
+
+ return 0;
+ }
+
case CDROMSUBCHNL:
{
struct cdrom_subchnl subchnl;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this