]> git.proxmox.com Git - mirror_qemu.git/blobdiff - tests/libqos/ahci.h
ahci-test: test atapi read_cd with bcl, nb_sectors = 0
[mirror_qemu.git] / tests / libqos / ahci.h
index caaafe3fdf1fbe133eebc4dbbc8c8b0fd09dfe2f..f144fab37a86f62e836f61db8219cb399b3897ab 100644 (file)
@@ -288,6 +288,7 @@ enum {
 /* ATAPI Commands */
 enum {
     CMD_ATAPI_READ_10 = 0x28,
+    CMD_ATAPI_READ_CD = 0xbe,
 };
 
 /* AHCI Command Header Flags & Masks*/
@@ -462,12 +463,14 @@ typedef struct AHCICommand AHCICommand;
 
 /* Options to ahci_exec */
 typedef struct AHCIOpts {
-    size_t size;
-    unsigned prd_size;
-    uint64_t lba;
-    uint64_t buffer;
-    bool atapi;
-    bool atapi_dma;
+    size_t size;        /* Size of transfer */
+    unsigned prd_size;  /* Size per-each PRD */
+    bool set_bcl;       /* Override the default BCL of ATAPI_SECTOR_SIZE */
+    unsigned bcl;       /* Byte Count Limit, for ATAPI PIO */
+    uint64_t lba;       /* Starting LBA offset */
+    uint64_t buffer;    /* Pointer to source or destination guest buffer */
+    bool atapi;         /* ATAPI command? */
+    bool atapi_dma;     /* Use DMA for ATAPI? */
     bool error;
     int (*pre_cb)(AHCIQState*, AHCICommand*, const struct AHCIOpts *);
     int (*mid_cb)(AHCIQState*, AHCICommand*, const struct AHCIOpts *);
@@ -599,7 +602,7 @@ void ahci_exec(AHCIQState *ahci, uint8_t port,
 
 /* Command: Fine-grained lifecycle */
 AHCICommand *ahci_command_create(uint8_t command_name);
-AHCICommand *ahci_atapi_command_create(uint8_t scsi_cmd);
+AHCICommand *ahci_atapi_command_create(uint8_t scsi_cmd, uint16_t bcl);
 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);