diff options
author | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2024-01-12 12:53:34 +0000 |
---|---|---|
committer | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2024-02-13 19:37:28 +0000 |
commit | e8c84b19733172bc68ff9fde90981464e9aab443 (patch) | |
tree | 306f3503d90ee9bfcbad4aba6f1e4dd6175978e3 /hw | |
parent | ad2725af5799c74c9023ffcec8f6dbe3e0539798 (diff) |
esp.c: convert do_dma_pdma_cb() do_cmd path to check for SCSI phase instead
Currently do_cmd is used to determine whether MESSAGE OUT and COMMAND phase data
is being accumulated in cmdfifo. Update esp_do_dma() to check directly for these
two SCSI phases instead.
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-43-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 | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 22739d3875..b48e020689 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -546,7 +546,9 @@ static void do_dma_pdma_cb(ESPState *s) int len; uint32_t n; - if (s->do_cmd) { + switch (esp_get_phase(s)) { + case STAT_MO: + case STAT_CD: /* Copy FIFO into cmdfifo */ n = esp_fifo_pop_buf(&s->fifo, buf, fifo8_num_used(&s->fifo)); n = MIN(fifo8_num_free(&s->cmdfifo), n); @@ -578,10 +580,8 @@ static void do_dma_pdma_cb(ESPState *s) s->rregs[ESP_RINTR] |= INTR_BS; esp_raise_irq(s); } - return; - } + break; - switch (esp_get_phase(s)) { case STAT_DO: if (!s->current_req) { return; |