diff options
author | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2024-01-12 12:53:23 +0000 |
---|---|---|
committer | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2024-02-13 19:37:27 +0000 |
commit | 004826d03e400118d8bd9dc1261ddd5e697d3d97 (patch) | |
tree | 9e72a3c6f180f4ae732b19d7bf6b51b557de08f5 /hw | |
parent | af74b3c15d440d3a3718b8dc6a751c094db75ba3 (diff) | |
download | qemu-004826d03e400118d8bd9dc1261ddd5e697d3d97.zip qemu-004826d03e400118d8bd9dc1261ddd5e697d3d97.tar.gz qemu-004826d03e400118d8bd9dc1261ddd5e697d3d97.tar.bz2 |
esp.c: rename esp_dma_done() to esp_dma_ti_check()
This is because a single DMA request can be transferred using multiple TI
commands, and so a TC equal to zero may not represent the completion of
the SCSI DMA command.
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-32-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/scsi/esp.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 4d58a49..14c6d05 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -543,7 +543,7 @@ static void write_response(ESPState *s) esp_raise_irq(s); } -static void esp_dma_done(ESPState *s) +static void esp_dma_ti_check(ESPState *s) { if (esp_get_tc(s) == 0 && fifo8_num_used(&s->fifo) < 2) { s->rregs[ESP_RINTR] |= INTR_BS; @@ -613,7 +613,7 @@ static void do_dma_pdma_cb(ESPState *s) return; } - esp_dma_done(s); + esp_dma_ti_check(s); } else { if (s->async_len == 0 && fifo8_num_used(&s->fifo) < 2) { /* Defer until the scsi layer has completed */ @@ -622,7 +622,7 @@ static void do_dma_pdma_cb(ESPState *s) return; } - esp_dma_done(s); + esp_dma_ti_check(s); /* Copy device data to FIFO */ len = MIN(s->async_len, esp_get_tc(s)); @@ -708,7 +708,7 @@ static void esp_do_dma(ESPState *s) return; } - esp_dma_done(s); + esp_dma_ti_check(s); } else { esp_set_pdma_cb(s, DO_DMA_PDMA_CB); esp_raise_drq(s); @@ -719,7 +719,7 @@ static void esp_do_dma(ESPState *s) return; } - esp_dma_done(s); + esp_dma_ti_check(s); } } else { if (s->dma_memory_write) { @@ -736,7 +736,7 @@ static void esp_do_dma(ESPState *s) return; } - esp_dma_done(s); + esp_dma_ti_check(s); } else { /* Copy device data to FIFO */ len = MIN(len, fifo8_num_free(&s->fifo)); @@ -754,7 +754,7 @@ static void esp_do_dma(ESPState *s) return; } - esp_dma_done(s); + esp_dma_ti_check(s); } } } @@ -890,7 +890,7 @@ void esp_command_complete(SCSIRequest *req, size_t resid) * this) */ esp_set_tc(s, 0); - esp_dma_done(s); + esp_dma_ti_check(s); } else { /* * Transfer truncated: raise INTR_BS to indicate early change of @@ -939,7 +939,7 @@ void esp_transfer_data(SCSIRequest *req, uint32_t len) if (s->ti_cmd == (CMD_TI | CMD_DMA)) { /* When the SCSI layer returns more data, raise deferred INTR_BS */ - esp_dma_done(s); + esp_dma_ti_check(s); esp_do_dma(s); } else if (s->ti_cmd == CMD_TI) { |