diff options
author | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2024-01-12 12:54:12 +0000 |
---|---|---|
committer | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2024-02-13 19:37:28 +0000 |
commit | 67ea170ee46509aa71b8227fd9521cf9c7ca0c4b (patch) | |
tree | a85a50c11be1513826532614c9b4cc3249cd6568 /hw/scsi | |
parent | c37cc88e9cb966501fd16f2162793a7203d91c29 (diff) |
esp.c: consolidate DMA and PDMA logic in MESSAGE OUT phase
This allows the removal of duplicate logic shared between the two implementations.
Note that we restrict esp_raise_drq() to PDMA to help reduce the log verbosity
for normal DMA.
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-81-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.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 49fc059eaa..ae65c2ef37 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -436,17 +436,15 @@ static void esp_do_dma(ESPState *s) if (s->dma_memory_read) { len = MIN(len, fifo8_num_free(&s->cmdfifo)); s->dma_memory_read(s->dma_opaque, buf, len); - fifo8_push_all(&s->cmdfifo, buf, len); esp_set_tc(s, esp_get_tc(s) - len); - s->cmdfifo_cdb_offset += len; } else { - n = esp_fifo_pop_buf(&s->fifo, buf, fifo8_num_used(&s->fifo)); - n = MIN(fifo8_num_free(&s->cmdfifo), n); - fifo8_push_all(&s->cmdfifo, buf, n); - s->cmdfifo_cdb_offset += n; + len = esp_fifo_pop_buf(&s->fifo, buf, fifo8_num_used(&s->fifo)); + len = MIN(fifo8_num_free(&s->cmdfifo), len); + esp_raise_drq(s); } - esp_raise_drq(s); + fifo8_push_all(&s->cmdfifo, buf, len); + s->cmdfifo_cdb_offset += len; switch (s->rregs[ESP_CMD]) { case CMD_SELATN | CMD_DMA: |