[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/19] libqos/ahci: Add ide cmd properties
From: |
John Snow |
Subject: |
[Qemu-devel] [PATCH 10/19] libqos/ahci: Add ide cmd properties |
Date: |
Fri, 30 Jan 2015 13:42:04 -0500 |
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.
The "Invalid Command Sentinel" here that caps the property array is an
invalid ATA command, namely 0x01. 0x00 is NOP and 0xFF is reserved for
vendor usage, so I chose the first invalid one instead.
Signed-off-by: John Snow <address@hidden>
---
tests/libqos/ahci.c | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c
index 924b9f0..f0e2a27 100644
--- a/tests/libqos/ahci.c
+++ b/tests/libqos/ahci.c
@@ -34,6 +34,48 @@
#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;
+
+#define CMD_INVALID_SENTINEL 0x01
+
+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 },
+ { .cmd = CMD_INVALID_SENTINEL }
+};
+
/**
* Allocate space in the guest using information in the AHCIQState object.
*/
--
1.9.3
- [Qemu-devel] [PATCH 01/19] libqos/ahci: Add ahci_port_select helper, (continued)
- [Qemu-devel] [PATCH 01/19] libqos/ahci: Add ahci_port_select helper, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 06/19] libqos/ahci: Add ahci_port_check_interrupts helper, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 07/19] libqos/ahci: Add port_check_nonbusy helper, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 03/19] qtest/ahci: rename 'Command' to 'CommandHeader', John Snow, 2015/01/30
- [Qemu-devel] [PATCH 02/19] libqos/ahci: Add ahci_port_clear helper, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 05/19] libqos/ahci: Add ahci_port_check_error helper, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 04/19] libqos/ahci: Add command header helpers, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 09/19] qtest/ahci: Demagic ahci tests., John Snow, 2015/01/30
- [Qemu-devel] [PATCH 13/19] libqos/ahci: add ahci command size setters, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 08/19] libqos/ahci: Add cmd response sanity check helpers, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 10/19] libqos/ahci: Add ide cmd properties,
John Snow <=
- [Qemu-devel] [PATCH 14/19] libqos/ahci: Add ahci_guest_io, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 11/19] libqos/ahci: add ahci command functions, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 17/19] qtest/ahci: Add a macro bootup routine, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 12/19] libqos/ahci: add ahci command verify, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 18/19] qtest/ahci: Assert sector size in identify test, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 19/19] qtest/ahci: Adding simple dma read-write test, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 15/19] libqos/ahci: add ahci_io, John Snow, 2015/01/30
- [Qemu-devel] [PATCH 16/19] libqos/ahci: Add ahci_clean_mem, John Snow, 2015/01/30