From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KnwMf-0008Sm-7z for qemu-devel@nongnu.org; Thu, 09 Oct 2008 10:19:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KnwMb-0008NA-JE for qemu-devel@nongnu.org; Thu, 09 Oct 2008 10:19:40 -0400 Received: from [199.232.76.173] (port=53533 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KnwMb-0008Mx-Di for qemu-devel@nongnu.org; Thu, 09 Oct 2008 10:19:37 -0400 Received: from savannah.gnu.org ([199.232.41.3]:35720 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KnwMa-0000nU-ID for qemu-devel@nongnu.org; Thu, 09 Oct 2008 10:19:36 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KnwMZ-0000KC-Sp for qemu-devel@nongnu.org; Thu, 09 Oct 2008 14:19:36 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KnwMZ-0000K8-FK for qemu-devel@nongnu.org; Thu, 09 Oct 2008 14:19:35 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Thu, 09 Oct 2008 14:19:35 +0000 Subject: [Qemu-devel] [5452] Fix IDE DIAGNOSE for packet devices (Vincent Sanders) 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 Revision: 5452 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5452 Author: aliguori Date: 2008-10-09 14:19:34 +0000 (Thu, 09 Oct 2008) Log Message: ----------- 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 Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/hw/ide.c Modified: trunk/hw/ide.c =================================================================== --- trunk/hw/ide.c 2008-10-08 19:50:24 UTC (rev 5451) +++ trunk/hw/ide.c 2008-10-09 14:19:34 UTC (rev 5452) @@ -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: