[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 30/65] libqos/ahci: Add ide cmd properties
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL v2 30/65] libqos/ahci: Add ide cmd properties |
Date: |
Mon, 16 Feb 2015 15:45:55 +0000 |
From: John Snow <address@hidden>
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.
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
tests/libqos/ahci.c | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c
index 1294f80..148aa1b 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.
*/
--
2.1.0
- [Qemu-devel] [PULL v2 19/65] dataplane: endianness-aware accesses, (continued)
- [Qemu-devel] [PULL v2 19/65] dataplane: endianness-aware accesses, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 20/65] libqos/ahci: Add ahci_port_select helper, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 24/65] libqos/ahci: Add ahci_port_check_error helper, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 21/65] libqos/ahci: Add ahci_port_clear helper, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 22/65] qtest/ahci: rename 'Command' to 'CommandHeader', Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 23/65] libqos/ahci: Add command header helpers, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 25/65] libqos/ahci: Add ahci_port_check_interrupts helper, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 26/65] libqos/ahci: Add port_check_nonbusy helper, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 28/65] qtest/ahci: Demagic ahci tests., Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 29/65] qtest/ahci: add ahci_write_fis, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 30/65] libqos/ahci: Add ide cmd properties,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL v2 32/65] libqos/ahci: add ahci command verify, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 34/65] libqos/ahci: Add ahci_guest_io, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 31/65] libqos/ahci: add ahci command functions, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 36/65] libqos/ahci: Add ahci_clean_mem, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 33/65] libqos/ahci: add ahci command size setters, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 35/65] libqos/ahci: add ahci_io, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 41/65] block: vmdk - fixed sizeof() error, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 43/65] qemu-io: Account IO by aio_read and aio_write, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 38/65] qtest/ahci: Adding simple dma read-write test, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 40/65] savevm: Improve error message for blocked migration, Stefan Hajnoczi, 2015/02/16