summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authoraliguori2008-10-09 16:19:34 +0200
committeraliguori2008-10-09 16:19:34 +0200
commit33256a25b3b31915b9038eefe7923c68bb034118 (patch)
treea31d440dffd8173bc9f9c39bcd8d09dec7f40d89 /hw
parentFix IO performance regression in sparc (diff)
downloadqemu-33256a25b3b31915b9038eefe7923c68bb034118.tar.gz
qemu-33256a25b3b31915b9038eefe7923c68bb034118.tar.xz
qemu-33256a25b3b31915b9038eefe7923c68bb034118.zip
Fix IDE DIAGNOSE for packet devices (Vincent Sanders)
The DIAGNOSE command in the qemu IDE implementation has an error when use dfor packet devices. The status register value is dependant on the drive being a packet device or not, this patch corrects the returned status. From the ATA/PI specification (V6 draft): "If the device implements the PACKET command feature set, the device SHALL clear bits 6,5,4,3,2 and 0 in the Status register to zero." A selection of physical devices have been checked and do conform to the specifications behaviour. Signed-off-by: Vincent Sanders <vince@simtec.co.uk> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5452 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r--hw/ide.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/hw/ide.c b/hw/ide.c
index 686d372d18..33e8b39329 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -2308,8 +2308,15 @@ static void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val)
break;
case WIN_DIAGNOSE:
ide_set_signature(s);
- s->status = READY_STAT | SEEK_STAT;
- s->error = 0x01;
+ if (s->is_cdrom)
+ s->status = 0; /* ATAPI spec (v6) section 9.10 defines packet
+ * devices to return a clear status register
+ * with READY_STAT *not* set. */
+ else
+ s->status = READY_STAT | SEEK_STAT;
+ s->error = 0x01; /* Device 0 passed, Device 1 passed or not
+ * present.
+ */
ide_set_irq(s);
break;
case WIN_SRST: