aboutsummaryrefslogtreecommitdiff
path: root/tests/libqos/ahci.h
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2016-01-11 14:10:42 -0500
committerJohn Snow <jsnow@redhat.com>2016-01-11 14:10:42 -0500
commit54d268b26ace741f2acab2b8fee0eb325da66b2c (patch)
tree994be653151ce67e30837c02f97bc896a16e2126 /tests/libqos/ahci.h
parent248de4a89915001e64176580d620d22b612e06f2 (diff)
libqos/ahci: ATAPI support
Add pathways to tolerate ATAPI commands. Notably, unlike ATA, each SCSI command's layout is a little different, so support will have to be patched in for each command as we want to test them in e.g. ahci_command_set_sizes and ahci_command_set_offset. For now, I'm adding support for 0x28, READ (10). [Maintainer edit: replaced type-punning with stl_be_p(). --js] Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1452282920-21550-3-git-send-email-jsnow@redhat.com
Diffstat (limited to 'tests/libqos/ahci.h')
-rw-r--r--tests/libqos/ahci.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/libqos/ahci.h b/tests/libqos/ahci.h
index cffc2c351c..9ffd415f48 100644
--- a/tests/libqos/ahci.h
+++ b/tests/libqos/ahci.h
@@ -244,6 +244,10 @@
#define AHCI_VERSION_1_3 (0x00010300)
#define AHCI_SECTOR_SIZE (512)
+#define ATAPI_SECTOR_SIZE (2048)
+
+#define AHCI_SIGNATURE_CDROM (0xeb140101)
+#define AHCI_SIGNATURE_DISK (0x00000101)
/* FIS types */
enum {
@@ -277,11 +281,18 @@ enum {
CMD_READ_MAX_EXT = 0x27,
CMD_FLUSH_CACHE = 0xE7,
CMD_IDENTIFY = 0xEC,
+ CMD_PACKET = 0xA0,
+ CMD_PACKET_ID = 0xA1,
/* NCQ */
READ_FPDMA_QUEUED = 0x60,
WRITE_FPDMA_QUEUED = 0x61,
};
+/* ATAPI Commands */
+enum {
+ CMD_ATAPI_READ_10 = 0x28,
+};
+
/* AHCI Command Header Flags & Masks*/
#define CMDH_CFL (0x1F)
#define CMDH_ATAPI (0x20)
@@ -561,6 +572,7 @@ void ahci_io(AHCIQState *ahci, uint8_t port, uint8_t ide_cmd,
/* Command Lifecycle */
AHCICommand *ahci_command_create(uint8_t command_name);
+AHCICommand *ahci_atapi_command_create(uint8_t scsi_cmd);
void ahci_command_commit(AHCIQState *ahci, AHCICommand *cmd, uint8_t port);
void ahci_command_issue(AHCIQState *ahci, AHCICommand *cmd);
void ahci_command_issue_async(AHCIQState *ahci, AHCICommand *cmd);
@@ -577,6 +589,8 @@ void ahci_command_set_size(AHCICommand *cmd, uint64_t xbytes);
void ahci_command_set_prd_size(AHCICommand *cmd, unsigned prd_size);
void ahci_command_set_sizes(AHCICommand *cmd, uint64_t xbytes,
unsigned prd_size);
+void ahci_command_set_acmd(AHCICommand *cmd, void *acmd);
+void ahci_command_enable_atapi_dma(AHCICommand *cmd);
void ahci_command_adjust(AHCICommand *cmd, uint64_t lba_sect, uint64_t gbuffer,
uint64_t xbytes, unsigned prd_size);