diff options
| author | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2025-07-11 21:46:35 +0100 |
|---|---|---|
| committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-07-15 00:25:17 +0200 |
| commit | ab1207401edc19d17fad6cb473cd6beae31b1dd1 (patch) | |
| tree | 2c55e0707b2468d02b73d94af09d12ecaee2dbbe /include/hw/scsi/esp.h | |
| parent | 28a579a349015a7ed5a57cb4bdcdc5c60ba6b6fc (diff) | |
| download | focaccia-qemu-ab1207401edc19d17fad6cb473cd6beae31b1dd1.tar.gz focaccia-qemu-ab1207401edc19d17fad6cb473cd6beae31b1dd1.zip | |
esp.c: add asc_mode property to indicate the current ESP mode
Add a new asc_mode property to ESPState which indicates the current mode of the ESP and update the ESP state machine accordingly. Bump the vmstate version and include migration logic to ensure that asc_mode is set to initiator mode such that any commands in progress will always continue. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20250711204636.542964-7-mark.cave-ayland@ilande.co.uk> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'include/hw/scsi/esp.h')
| -rw-r--r-- | include/hw/scsi/esp.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/hw/scsi/esp.h b/include/hw/scsi/esp.h index c9afcb7cac..6327060c7c 100644 --- a/include/hw/scsi/esp.h +++ b/include/hw/scsi/esp.h @@ -14,6 +14,12 @@ typedef void (*ESPDMAMemoryReadWriteFunc)(void *opaque, uint8_t *buf, int len); #define ESP_FIFO_SZ 16 #define ESP_CMDFIFO_SZ 32 +enum ESPASCMode { + ESP_ASC_MODE_DIS = 0, /* Disconnected */ + ESP_ASC_MODE_INI = 1, /* Initiator */ + ESP_ASC_MODE_TGT = 2 /* Target */ +}; + #define TYPE_ESP "esp" OBJECT_DECLARE_SIMPLE_TYPE(ESPState, ESP) @@ -38,6 +44,7 @@ struct ESPState { uint8_t cmdfifo_cdb_offset; uint8_t lun; uint32_t do_cmd; + uint8_t asc_mode; bool data_ready; int dma_enabled; |