diff options
author | Mark Cave-Ayland | 2021-03-04 23:10:34 +0100 |
---|---|---|
committer | Mark Cave-Ayland | 2021-03-07 11:39:05 +0100 |
commit | 6cc88d6bf932a905ce36e933dc078eeb6b54ac92 (patch) | |
tree | 51c86f762e37ff6f8211372c20c37a32db5b0365 /include/hw | |
parent | esp: remove dma_counter from ESPState (diff) | |
download | qemu-6cc88d6bf932a905ce36e933dc078eeb6b54ac92.tar.gz qemu-6cc88d6bf932a905ce36e933dc078eeb6b54ac92.tar.xz qemu-6cc88d6bf932a905ce36e933dc078eeb6b54ac92.zip |
esp: remove dma_left from ESPState
The ESP device already keeps track of the remaining bytes left to transfer via
its TC (transfer counter) register which is decremented for each byte that
is transferred across the SCSI bus.
Switch the transfer logic to use the value of TC instead of dma_left and then
remove dma_left completely, adding logic to the vmstate_esp post_load() function
to transfer the old dma_left value to the TC register during migration from
older versions.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-14-mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'include/hw')
-rw-r--r-- | include/hw/scsi/esp.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/hw/scsi/esp.h b/include/hw/scsi/esp.h index ff1372947b..ff50c9e7d8 100644 --- a/include/hw/scsi/esp.h +++ b/include/hw/scsi/esp.h @@ -48,8 +48,6 @@ struct ESPState { uint32_t cmdlen; uint32_t do_cmd; - /* The amount of data left in the current DMA transfer. */ - uint32_t dma_left; int dma_enabled; uint32_t async_len; @@ -67,6 +65,9 @@ struct ESPState { void (*pdma_cb)(ESPState *s); uint8_t mig_version_id; + + /* Legacy fields for vmstate_esp version < 5 */ + uint32_t mig_dma_left; }; #define TYPE_SYSBUS_ESP "sysbus-esp" |