ide: implement stub for audio control/volume read
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Mon, 30 Nov 2009 19:37:03 +0000 (17:37 -0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Thu, 3 Dec 2009 21:26:01 +0000 (15:26 -0600)
This implements the audio control or volume read support as needed by
some systems. A Conectiva Parolin system required this to detect an IDE
device as CD-ROM, through the CDVOLREAD ioctl.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/ide/core.c

index e40fc75a223a65d7e02bd729bab3f85441a8a341..76c3820806661d529029822697535fac5c4a7e15 100644 (file)
@@ -1269,6 +1269,23 @@ static void ide_atapi_cmd(IDEState *s)
                     buf[15] = 0x00;
                     ide_atapi_cmd_reply(s, 16, max_len);
                     break;
+                case GPMODE_AUDIO_CTL_PAGE:
+                    cpu_to_ube16(&buf[0], 24 + 6);
+                    buf[2] = 0x70;
+                    buf[3] = 0;
+                    buf[4] = 0;
+                    buf[5] = 0;
+                    buf[6] = 0;
+                    buf[7] = 0;
+
+                    /* Fill with CDROM audio volume */
+                    buf[17] = 0;
+                    buf[19] = 0;
+                    buf[21] = 0;
+                    buf[23] = 0;
+
+                    ide_atapi_cmd_reply(s, 24, max_len);
+                    break;
                 case GPMODE_CAPABILITIES_PAGE:
                     cpu_to_ube16(&buf[0], 28 + 6);
                     buf[2] = 0x70;