From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIlJ7-0001pj-Nn for qemu-devel@nongnu.org; Tue, 03 Feb 2015 16:46:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YIlJ6-0002f1-TM for qemu-devel@nongnu.org; Tue, 03 Feb 2015 16:46:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53057) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIlJ6-0002eo-KX for qemu-devel@nongnu.org; Tue, 03 Feb 2015 16:46:52 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t13LkpJ2000757 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 3 Feb 2015 16:46:52 -0500 From: John Snow Date: Tue, 3 Feb 2015 16:46:31 -0500 Message-Id: <1422999999-25868-12-git-send-email-jsnow@redhat.com> In-Reply-To: <1422999999-25868-1-git-send-email-jsnow@redhat.com> References: <1422999999-25868-1-git-send-email-jsnow@redhat.com> Subject: [Qemu-devel] [PATCH v2 11/19] libqos/ahci: Add ide cmd properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: famz@redhat.com, mst@redhat.com, armbru@redhat.com, stefanha@redhat.com, pbonzini@redhat.com, John Snow Add a structure that defines some properties of various IDE commands. These will be used to simplify the interface to the libqos AHCI calls, lessening the redundancy of specifying and respecifying properties of commands to various helper functions. Signed-off-by: John Snow --- tests/libqos/ahci.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c index 7336781..c2d16e2 100644 --- a/tests/libqos/ahci.c +++ b/tests/libqos/ahci.c @@ -34,6 +34,45 @@ #include "hw/pci/pci_ids.h" #include "hw/pci/pci_regs.h" +typedef struct AHCICommandProp { + uint8_t cmd; /* Command Code */ + bool data; /* Data transfer command? */ + bool pio; + bool dma; + bool lba28; + bool lba48; + bool read; + bool write; + bool atapi; + bool ncq; + uint64_t size; /* Static transfer size, for commands like IDENTIFY. */ + uint32_t interrupts; /* Expected interrupts for this command. */ +} AHCICommandProp; + +AHCICommandProp ahci_command_properties[] = { + { .cmd = CMD_READ_PIO, .data = true, .pio = true, + .lba28 = true, .read = true }, + { .cmd = CMD_WRITE_PIO, .data = true, .pio = true, + .lba28 = true, .write = true }, + { .cmd = CMD_READ_PIO_EXT, .data = true, .pio = true, + .lba48 = true, .read = true }, + { .cmd = CMD_WRITE_PIO_EXT, .data = true, .pio = true, + .lba48 = true, .write = true }, + { .cmd = CMD_READ_DMA, .data = true, .dma = true, + .lba28 = true, .read = true }, + { .cmd = CMD_WRITE_DMA, .data = true, .dma = true, + .lba28 = true, .write = true }, + { .cmd = CMD_READ_DMA_EXT, .data = true, .dma = true, + .lba48 = true, .read = true }, + { .cmd = CMD_WRITE_DMA_EXT, .data = true, .dma = true, + .lba48 = true, .write = true }, + { .cmd = CMD_IDENTIFY, .data = true, .pio = true, + .size = 512, .read = true }, + { .cmd = CMD_READ_MAX, .lba28 = true }, + { .cmd = CMD_READ_MAX_EXT, .lba48 = true }, + { .cmd = CMD_FLUSH_CACHE, .data = false } +}; + /** * Allocate space in the guest using information in the AHCIQState object. */ -- 1.9.3