]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
qtest/ahci: rename 'Command' to 'CommandHeader'
authorJohn Snow <jsnow@redhat.com>
Thu, 5 Feb 2015 17:41:14 +0000 (12:41 -0500)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 16 Feb 2015 15:07:16 +0000 (15:07 +0000)
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 <stefanha@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 1423158090-25580-4-git-send-email-jsnow@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
tests/ahci-test.c
tests/libqos/ahci.h

index 90647f2a0cba0f35d4fb601cd1ca2d119a9ce63c..d420e5f8beded2d337b1528c0dfc3e52022e4fa9 100644 (file)
@@ -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;
index 39ba94e3f46ea7c953cc0905b5c4143394e5c40a..1fddf331566265443bce11a0f68256594324f181 100644 (file)
@@ -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,