* [Qemu-devel] [PATCH] Fix IDE DIAGNOSE for packet devices
@ 2008-10-09 12:03 Vincent Sanders
2008-10-09 14:19 ` Anthony Liguori
0 siblings, 1 reply; 2+ messages in thread
From: Vincent Sanders @ 2008-10-09 12:03 UTC (permalink / raw)
To: qemu-devel
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>
=== modified file 'hw/ide.c'
--- hw/ide.c 2008-10-01 01:43:16 +0000
+++ hw/ide.c 2008-10-04 10:56:58 +0000
@@ -2308,8 +2308,15 @@
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:
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] Fix IDE DIAGNOSE for packet devices
2008-10-09 12:03 [Qemu-devel] [PATCH] Fix IDE DIAGNOSE for packet devices Vincent Sanders
@ 2008-10-09 14:19 ` Anthony Liguori
0 siblings, 0 replies; 2+ messages in thread
From: Anthony Liguori @ 2008-10-09 14:19 UTC (permalink / raw)
To: qemu-devel
Vincent Sanders wrote:
> 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>
>
Applied. Thanks.
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-10-09 14:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-09 12:03 [Qemu-devel] [PATCH] Fix IDE DIAGNOSE for packet devices Vincent Sanders
2008-10-09 14:19 ` Anthony Liguori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).