summaryrefslogtreecommitdiffstats
path: root/hw/ide/atapi.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-09-13 15:08:22 +0200
committerKevin Wolf <kwolf@redhat.com>2011-10-28 19:25:50 +0200
commita07c7dcd6f33b668747148ac28c0e147f958aa18 (patch)
tree08ac31ca4c0bcce5b81c09bfa93d96237425fef9 /hw/ide/atapi.c
parenta8f4bbe2900f0ebdead032fb8da137777bddd925 (diff)
downloadhqemu-a07c7dcd6f33b668747148ac28c0e147f958aa18.zip
hqemu-a07c7dcd6f33b668747148ac28c0e147f958aa18.tar.gz
atapi/scsi-disk: make mode page values coherent between the two
This patch adds to scsi-disk the missing mode page 0x01 for both disk and CD-ROM drives, and mode page 0x0e for CD drives only. A few offsets were wrong in atapi.c. Also change the 2Ah mode page to expose DVD media read capabilities in the IDE cdrom. This lets you run dvd+rw-mediainfo on the virtual DVD drives. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/ide/atapi.c')
-rw-r--r--hw/ide/atapi.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
index e898da2..90b6729 100644
--- a/hw/ide/atapi.c
+++ b/hw/ide/atapi.c
@@ -751,7 +751,7 @@ static void cmd_mode_sense(IDEState *s, uint8_t *buf)
buf[8] = MODE_PAGE_CAPABILITIES;
buf[9] = 28 - 10;
- buf[10] = 0x00;
+ buf[10] = 0x3b; /* read CDR/CDRW/DVDROM/DVDR/DVDRAM */
buf[11] = 0x00;
/* Claim PLAY_AUDIO capability (0x01) since some Linux
@@ -760,14 +760,14 @@ static void cmd_mode_sense(IDEState *s, uint8_t *buf)
buf[13] = 3 << 5;
buf[14] = (1 << 0) | (1 << 3) | (1 << 5);
if (s->tray_locked) {
- buf[6] |= 1 << 1;
+ buf[14] |= 1 << 1;
}
- buf[15] = 0x00;
- cpu_to_ube16(&buf[16], 706);
- buf[18] = 0;
+ buf[15] = 0x00; /* No volume & mute control, no changer */
+ cpu_to_ube16(&buf[16], 704); /* 4x read speed */
+ buf[18] = 0; /* Two volume levels */
buf[19] = 2;
- cpu_to_ube16(&buf[20], 512);
- cpu_to_ube16(&buf[22], 706);
+ cpu_to_ube16(&buf[20], 512); /* 512k buffer */
+ cpu_to_ube16(&buf[22], 704); /* 4x read speed current */
buf[24] = 0;
buf[25] = 0;
buf[26] = 0;
OpenPOWER on IntegriCloud