aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2024-01-12 12:54:00 +0000
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2024-02-13 19:37:28 +0000
commit83428f7a971344cabbbebbac97f8812fa1aec1f9 (patch)
treec33b80c5b3ee49163e3bff15a244cdfbfc89b363 /hw
parentd39592ff64ba2c0e58cadd1b7f79a0c3a7aba404 (diff)
downloadqemu-83428f7a971344cabbbebbac97f8812fa1aec1f9.zip
qemu-83428f7a971344cabbbebbac97f8812fa1aec1f9.tar.gz
qemu-83428f7a971344cabbbebbac97f8812fa1aec1f9.tar.bz2
esp.c: move write_response() non-DMA logic to esp_do_nodma()
This moves the remaining non-DMA STATUS and MESSAGE IN phase logic from write_response() to esp_do_nodma(). Note that we can also now drop the extra fifo_reset() which is no longer required. 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-69-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.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index 277eb86..824ebe9 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -392,20 +392,12 @@ static void handle_satn_stop(ESPState *s)
static void write_response(ESPState *s)
{
- uint8_t buf[2];
-
trace_esp_write_response(s->status);
if (s->dma) {
esp_do_dma(s);
} else {
- buf[0] = s->status;
- buf[1] = 0;
-
- fifo8_reset(&s->fifo);
- fifo8_push_all(&s->fifo, buf, 2);
- s->rregs[ESP_RFLAGS] = 2;
- esp_raise_irq(s);
+ esp_do_nodma(s);
}
}
@@ -815,6 +807,28 @@ static void esp_do_nodma(ESPState *s)
s->rregs[ESP_RINTR] |= INTR_BS;
esp_raise_irq(s);
break;
+
+ case STAT_ST:
+ switch (s->rregs[ESP_CMD]) {
+ case CMD_ICCS:
+ fifo8_push(&s->fifo, s->status);
+ esp_set_phase(s, STAT_MI);
+
+ /* Process any message in phase data */
+ esp_do_nodma(s);
+ break;
+ }
+ break;
+
+ case STAT_MI:
+ switch (s->rregs[ESP_CMD]) {
+ case CMD_ICCS:
+ fifo8_push(&s->fifo, 0);
+
+ esp_raise_irq(s);
+ break;
+ }
+ break;
}
}