Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KnuEx-0007Q5-5r for qemu-devel@nongnu.org; Thu, 09 Oct 2008 08:03:35 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KnuEu-0007PX-IM for qemu-devel@nongnu.org; Thu, 09 Oct 2008 08:03:33 -0400 Received: from [199.232.76.173] (port=51733 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KnuEs-0007P8-Lw for qemu-devel@nongnu.org; Thu, 09 Oct 2008 08:03:31 -0400 Received: from batfish.pepperfish.net ([87.237.62.180]:40705 helo=flounder.pepperfish.net) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KnuEs-000896-9l for qemu-devel@nongnu.org; Thu, 09 Oct 2008 08:03:30 -0400 Received: from jennifer-internal.kyllikki.org ([10.112.102.2] helo=jennifer.kylikki.org) by flounder.pepperfish.net with esmtps (Exim 4.68 #1 (Debian)) id 1KnuEn-0004ns-5d for ; Thu, 09 Oct 2008 13:03:25 +0100 Received: from derik.kyllikki.org ([192.168.7.20]) by jennifer.kylikki.org with esmtp (Exim 4.63) (envelope-from ) id 1KnuEm-0006Hw-NC for qemu-devel@nongnu.org; Thu, 09 Oct 2008 13:03:24 +0100 Received: from vince by derik.kyllikki.org with local (Exim 4.69) (envelope-from ) id 1KnuEm-0006pB-D4 for qemu-devel@nongnu.org; Thu, 09 Oct 2008 13:03:24 +0100 Date: Thu, 9 Oct 2008 13:03:24 +0100 From: Vincent Sanders Message-ID: <20081009120324.GA25767@kyllikki.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] Fix IDE DIAGNOSE for packet devices Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 === 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: