[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 22/65] qtest/ahci: rename 'Command' to 'CommandHea
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL v2 22/65] qtest/ahci: rename 'Command' to 'CommandHeader' |
Date: |
Mon, 16 Feb 2015 15:45:47 +0000 |
From: John Snow <address@hidden>
The structure name is a bit of a misnomer; the structure currently named
command is actually the commandheader. A future patch in this series
will add an actual "Command" structure, so we'll rename it now before the
rest of the functions in this series try to use it.
In addition, rename the "b1" and "b2" fields
to be a unified uint16_t named "flags."
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/ahci-test.c | 8 ++++----
tests/libqos/ahci.h | 7 +++----
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/tests/ahci-test.c b/tests/ahci-test.c
index 90647f2..d420e5f 100644
--- a/tests/ahci-test.c
+++ b/tests/ahci-test.c
@@ -660,7 +660,7 @@ static void ahci_test_identify(AHCIQState *ahci)
RegD2HFIS *d2h = g_malloc0(0x20);
RegD2HFIS *pio = g_malloc0(0x20);
RegH2DFIS fis;
- AHCICommand cmd;
+ AHCICommandHeader cmd;
PRD prd;
uint32_t reg, table, data_ptr;
uint16_t buff[256];
@@ -703,9 +703,9 @@ static void ahci_test_identify(AHCIQState *ahci)
/* Copy the existing Command #0 structure from the CLB into local memory,
* and build a new command #0. */
memread(ahci->port[i].clb, &cmd, sizeof(cmd));
- cmd.b1 = 5; /* reg_h2d_fis is 5 double-words long */
- cmd.b2 = 0x04; /* clear PxTFD.STS.BSY when done */
- cmd.prdtl = cpu_to_le16(1); /* One PRD table entry. */
+ cmd.flags = cpu_to_le16(5); /* reg_h2d_fis is 5 double-words long */
+ cmd.flags |= cpu_to_le16(0x400); /* clear PxTFD.STS.BSY when done */
+ cmd.prdtl = cpu_to_le16(1); /* One PRD table entry. */
cmd.prdbc = 0;
cmd.ctba = cpu_to_le32(table);
cmd.ctbau = 0;
diff --git a/tests/libqos/ahci.h b/tests/libqos/ahci.h
index 39ba94e..1fddf33 100644
--- a/tests/libqos/ahci.h
+++ b/tests/libqos/ahci.h
@@ -329,15 +329,14 @@ typedef struct RegH2DFIS {
* Command List entry structure.
* The command list contains between 1-32 of these structures.
*/
-typedef struct AHCICommand {
- uint8_t b1;
- uint8_t b2;
+typedef struct AHCICommandHeader {
+ uint16_t flags; /* Cmd-Fis-Len, PMP#, and flags. */
uint16_t prdtl; /* Phys Region Desc. Table Length */
uint32_t prdbc; /* Phys Region Desc. Byte Count */
uint32_t ctba; /* Command Table Descriptor Base Address */
uint32_t ctbau; /* '' Upper */
uint32_t res[4];
-} __attribute__((__packed__)) AHCICommand;
+} __attribute__((__packed__)) AHCICommandHeader;
/**
* Physical Region Descriptor; pointed to by the Command List Header,
--
2.1.0
- [Qemu-devel] [PULL v2 11/65] qtest/ahci: Store hba_base in AHCIQState, (continued)
- [Qemu-devel] [PULL v2 11/65] qtest/ahci: Store hba_base in AHCIQState, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 13/65] qtest/ahci: remove pcibus global, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 16/65] qtest/ahci: remove getter/setter macros, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 17/65] qtest/ahci: Bookmark FB and CLB pointers, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 14/65] qtest/ahci: remove guest_malloc global, Stefan Hajnoczi, 2015/02/16
- [Qemu-devel] [PULL v2 18/65] libqos/ahci: create libqos/ahci.c, Stefan Hajnoczi, 2015/02/16
- [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 <=
- [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, 2015/02/16
- [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