diff options
author | Mark Cave-Ayland | 2021-03-04 23:11:00 +0100 |
---|---|---|
committer | Mark Cave-Ayland | 2021-03-07 11:39:05 +0100 |
commit | 023666da792ac465e43dee3bacb21bb781de5cdb (patch) | |
tree | bb22cbc9ad2de6fceb05fb2876433ebb0237751c /include/hw | |
parent | esp: convert ti_buf from array to Fifo8 (diff) | |
download | qemu-023666da792ac465e43dee3bacb21bb781de5cdb.tar.gz qemu-023666da792ac465e43dee3bacb21bb781de5cdb.tar.xz qemu-023666da792ac465e43dee3bacb21bb781de5cdb.zip |
esp: convert cmdbuf from array to Fifo8
Rename ESP_CMDBUF_SZ to ESP_CMDFIFO_SZ and cmdbuf_cdb_offset to cmdfifo_cdb_offset
to indicate that the command buffer type has changed from an array to a Fifo8.
This also enables us to remove the ESPState field cmdlen since the command length
is now simply the number of elements used in cmdfifo.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-40-mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'include/hw')
-rw-r--r-- | include/hw/scsi/esp.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/hw/scsi/esp.h b/include/hw/scsi/esp.h index eb4e8ba171..2fe8d20ab5 100644 --- a/include/hw/scsi/esp.h +++ b/include/hw/scsi/esp.h @@ -12,7 +12,7 @@ typedef void (*ESPDMAMemoryReadWriteFunc)(void *opaque, uint8_t *buf, int len); #define ESP_REGS 16 #define ESP_FIFO_SZ 16 -#define ESP_CMDBUF_SZ 32 +#define ESP_CMDFIFO_SZ 32 typedef struct ESPState ESPState; @@ -35,9 +35,8 @@ struct ESPState { SCSIBus bus; SCSIDevice *current_dev; SCSIRequest *current_req; - uint8_t cmdbuf[ESP_CMDBUF_SZ]; - uint32_t cmdlen; - uint8_t cmdbuf_cdb_offset; + Fifo8 cmdfifo; + uint8_t cmdfifo_cdb_offset; uint32_t do_cmd; bool data_in_ready; @@ -60,6 +59,8 @@ struct ESPState { bool mig_deferred_complete; uint32_t mig_ti_rptr, mig_ti_wptr; uint8_t mig_ti_buf[ESP_FIFO_SZ]; + uint8_t mig_cmdbuf[ESP_CMDFIFO_SZ]; + uint32_t mig_cmdlen; }; #define TYPE_SYSBUS_ESP "sysbus-esp" |