[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 80/88] esp.c: consolidate DMA and PDMA logic in MESSAGE OUT phase
From: |
Mark Cave-Ayland |
Subject: |
[PULL 80/88] esp.c: consolidate DMA and PDMA logic in MESSAGE OUT phase |
Date: |
Tue, 13 Feb 2024 19:40:44 +0000 |
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>
---
hw/scsi/esp.c | 12 +++++-------
1 file 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:
--
2.39.2
- [PULL 68/88] esp.c: move write_response() non-DMA logic to esp_do_nodma(), (continued)
- [PULL 68/88] esp.c: move write_response() non-DMA logic to esp_do_nodma(), Mark Cave-Ayland, 2024/02/13
- [PULL 74/88] esp.c: handle non-DMA FIFO writes used to terminate DMA commands, Mark Cave-Ayland, 2024/02/13
- [PULL 59/88] esp.c: separate logic based upon ESP command in esp_transfer_data(), Mark Cave-Ayland, 2024/02/13
- [PULL 72/88] esp.c: handle TC underflow for DMA SCSI requests, Mark Cave-Ayland, 2024/02/13
- [PULL 75/88] esp.c: improve ESP_RSEQ logic consolidation, Mark Cave-Ayland, 2024/02/13
- [PULL 84/88] esp.c: implement DMA Transfer Pad command for DATA phases, Mark Cave-Ayland, 2024/02/13
- [PULL 60/88] esp.c: use deferred interrupts for both DATA IN and DATA OUT phases, Mark Cave-Ayland, 2024/02/13
- [PULL 82/88] esp.c: consolidate DMA and PDMA logic in STATUS and MESSAGE IN phases, Mark Cave-Ayland, 2024/02/13
- [PULL 56/88] esp.c: remove unused PDMA callback implementation, Mark Cave-Ayland, 2024/02/13
- [PULL 58/88] esp.c: separate logic based upon ESP command in esp_command_complete(), Mark Cave-Ayland, 2024/02/13
- [PULL 80/88] esp.c: consolidate DMA and PDMA logic in MESSAGE OUT phase,
Mark Cave-Ayland <=
- Re: [PULL 00/88] qemu-sparc queue 20240213, Peter Maydell, 2024/02/14