diff options
author | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2024-01-12 12:53:33 +0000 |
---|---|---|
committer | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2024-02-13 19:37:28 +0000 |
commit | ad2725af5799c74c9023ffcec8f6dbe3e0539798 (patch) | |
tree | 83894c75204a019620a49c82db4c56e07dcf8fe0 | |
parent | 9d1aa52b761bc9e38d19009ada723bd4f734cd90 (diff) | |
download | qemu-ad2725af5799c74c9023ffcec8f6dbe3e0539798.zip qemu-ad2725af5799c74c9023ffcec8f6dbe3e0539798.tar.gz qemu-ad2725af5799c74c9023ffcec8f6dbe3e0539798.tar.bz2 |
esp.c: convert esp_do_dma() 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-42-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
-rw-r--r-- | hw/scsi/esp.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index c1b44e5..22739d3 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -635,11 +635,10 @@ static void esp_do_dma(ESPState *s) int n; len = esp_get_tc(s); - if (s->do_cmd) { - /* - * handle_ti_cmd() case: esp_do_dma() is called only from - * handle_ti_cmd() with do_cmd != NULL (see the assert()) - */ + + switch (esp_get_phase(s)) { + case STAT_MO: + case STAT_CD: cmdlen = fifo8_num_used(&s->cmdfifo); trace_esp_do_dma(cmdlen, len); if (s->dma_memory_read) { @@ -683,10 +682,8 @@ static void esp_do_dma(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; |