diff options
author | John Snow <jsnow@redhat.com> | 2015-07-04 02:06:03 -0400 |
---|---|---|
committer | John Snow <jsnow@redhat.com> | 2015-07-04 02:06:03 -0400 |
commit | cb45304108ab733aaf2e4351e77cb6d07ac88fd5 (patch) | |
tree | c92694ce9acf13502ef694ee0c7c96925f902dc1 /tests/libqos/ahci.h | |
parent | 40d29928caa6db154182f5314f497020f81e640e (diff) |
libqos/ahci: add NCQ frame support
NCQ frames are generated a little differently than
their non-NCQ cousins. Add support for them.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1435016308-6150-11-git-send-email-jsnow@redhat.com
Diffstat (limited to 'tests/libqos/ahci.h')
-rw-r--r-- | tests/libqos/ahci.h | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/tests/libqos/ahci.h b/tests/libqos/ahci.h index ca8abee22c..594a1c9781 100644 --- a/tests/libqos/ahci.h +++ b/tests/libqos/ahci.h @@ -291,8 +291,9 @@ enum { #define CMDH_PMP (0xF000) /* ATA device register masks */ -#define ATA_DEVICE_MAGIC 0xA0 +#define ATA_DEVICE_MAGIC 0xA0 /* used in ata1-3 */ #define ATA_DEVICE_LBA 0x40 +#define NCQ_DEVICE_MAGIC 0x40 /* for ncq device registers */ #define ATA_DEVICE_DRIVE 0x10 #define ATA_DEVICE_HEAD 0x0F @@ -397,6 +398,32 @@ typedef struct RegH2DFIS { } __attribute__((__packed__)) RegH2DFIS; /** + * Register host-to-device FIS structure, for NCQ commands. + * Actually just a RegH2DFIS, but with fields repurposed. + * Repurposed fields are annotated below. + */ +typedef struct NCQFIS { + /* DW0 */ + uint8_t fis_type; + uint8_t flags; + uint8_t command; + uint8_t sector_low; /* H2D: Feature 7:0 */ + /* DW1 */ + uint8_t lba_lo[3]; + uint8_t device; + /* DW2 */ + uint8_t lba_hi[3]; + uint8_t sector_hi; /* H2D: Feature 15:8 */ + /* DW3 */ + uint8_t tag; /* H2D: Count 0:7 */ + uint8_t prio; /* H2D: Count 15:8 */ + uint8_t icc; + uint8_t control; + /* DW4 */ + uint8_t aux[4]; +} __attribute__((__packed__)) NCQFIS; + +/** * Command List entry structure. * The command list contains between 1-32 of these structures. */ |