aboutsummaryrefslogtreecommitdiff
path: root/tests/libqos/ahci.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libqos/ahci.h')
-rw-r--r--tests/libqos/ahci.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/libqos/ahci.h b/tests/libqos/ahci.h
index 05ce3de..5f9627b 100644
--- a/tests/libqos/ahci.h
+++ b/tests/libqos/ahci.h
@@ -287,11 +287,24 @@ enum {
/* ATAPI Commands */
enum {
+ CMD_ATAPI_TEST_UNIT_READY = 0x00,
+ CMD_ATAPI_REQUEST_SENSE = 0x03,
CMD_ATAPI_START_STOP_UNIT = 0x1b,
CMD_ATAPI_READ_10 = 0x28,
CMD_ATAPI_READ_CD = 0xbe,
};
+enum {
+ SENSE_NO_SENSE = 0x00,
+ SENSE_NOT_READY = 0x02,
+ SENSE_UNIT_ATTENTION = 0x06,
+};
+
+enum {
+ ASC_MEDIUM_MAY_HAVE_CHANGED = 0x28,
+ ASC_MEDIUM_NOT_PRESENT = 0x3a,
+};
+
/* AHCI Command Header Flags & Masks*/
#define CMDH_CFL (0x1F)
#define CMDH_ATAPI (0x20)
@@ -601,6 +614,10 @@ void ahci_io(AHCIQState *ahci, uint8_t port, uint8_t ide_cmd,
void *buffer, size_t bufsize, uint64_t sector);
void ahci_exec(AHCIQState *ahci, uint8_t port,
uint8_t op, const AHCIOpts *opts);
+void ahci_atapi_test_ready(AHCIQState *ahci, uint8_t port, bool ready,
+ uint8_t expected_sense);
+void ahci_atapi_get_sense(AHCIQState *ahci, uint8_t port,
+ uint8_t *sense, uint8_t *asc);
void ahci_atapi_eject(AHCIQState *ahci, uint8_t port);
void ahci_atapi_load(AHCIQState *ahci, uint8_t port);