aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2024-01-12 12:53:24 +0000
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2024-02-13 19:37:27 +0000
commit19e9afb1a3d905f9892bb696e156f4524f2cbbf6 (patch)
treecec93689801c9ccaf9cc61a6a1442f70ddae9cf8 /hw/scsi
parent004826d03e400118d8bd9dc1261ddd5e697d3d97 (diff)
downloadqemu-19e9afb1a3d905f9892bb696e156f4524f2cbbf6.zip
qemu-19e9afb1a3d905f9892bb696e156f4524f2cbbf6.tar.gz
qemu-19e9afb1a3d905f9892bb696e156f4524f2cbbf6.tar.bz2
esp.c: copy PDMA logic for transfers to device from do_dma_pdma_cb() to esp_do_dma()
This is so that PDMA transfers can be performend by esp_do_dma() as well as do_dma_pdma_cb(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Tested-by: Helge Deller <deller@gmx.de> Tested-by: Thomas Huth <thuth@redhat.com> Message-Id: <20240112125420.514425-33-mark.cave-ayland@ilande.co.uk> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'hw/scsi')
-rw-r--r--hw/scsi/esp.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index 14c6d05..65b4baa 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -640,6 +640,7 @@ static void esp_do_dma(ESPState *s)
uint32_t len, cmdlen;
int to_device = ((s->rregs[ESP_RSTAT] & 7) == STAT_DO);
uint8_t buf[ESP_CMDFIFO_SZ];
+ int n;
len = esp_get_tc(s);
if (s->do_cmd) {
@@ -710,6 +711,14 @@ static void esp_do_dma(ESPState *s)
esp_dma_ti_check(s);
} else {
+ /* Copy FIFO data to device */
+ len = MIN(s->async_len, ESP_FIFO_SZ);
+ len = MIN(len, fifo8_num_used(&s->fifo));
+ n = esp_fifo_pop_buf(&s->fifo, s->async_buf, len);
+ s->async_buf += n;
+ s->async_len -= n;
+ s->ti_size += n;
+
esp_set_pdma_cb(s, DO_DMA_PDMA_CB);
esp_raise_drq(s);