[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 68/88] esp.c: move write_response() non-DMA logic to esp_do_nodma
|
From: |
Mark Cave-Ayland |
|
Subject: |
[PATCH 68/88] esp.c: move write_response() non-DMA logic to esp_do_nodma() |
|
Date: |
Fri, 12 Jan 2024 12:54:00 +0000 |
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>
---
hw/scsi/esp.c | 32 +++++++++++++++++++++++---------
1 file changed, 23 insertions(+), 9 deletions(-)
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index 277eb8647b..824ebe9ff0 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;
}
}
--
2.39.2
- [PATCH 84/88] esp.c: implement DMA Transfer Pad command for DATA phases, (continued)
- [PATCH 84/88] esp.c: implement DMA Transfer Pad command for DATA phases, Mark Cave-Ayland, 2024/01/12
- [PATCH 53/88] esp.c: replace do_dma_pdma_cb() with esp_do_dma(), Mark Cave-Ayland, 2024/01/12
- [PATCH 58/88] esp.c: separate logic based upon ESP command in esp_command_complete(), Mark Cave-Ayland, 2024/01/12
- [PATCH 61/88] esp.c: remove DATA IN phase logic when reading from FIFO, Mark Cave-Ayland, 2024/01/12
- [PATCH 77/88] esp.c: only transfer non-DMA MESSAGE OUT phase data for specific commands, Mark Cave-Ayland, 2024/01/12
- [PATCH 62/88] esp.c: zero command register when TI command terminates due to phase change, Mark Cave-Ayland, 2024/01/12
- [PATCH 63/88] esp.c: remove unneeded ti_cmd field, Mark Cave-Ayland, 2024/01/12
- [PATCH 82/88] esp.c: consolidate DMA and PDMA logic in STATUS and MESSAGE IN phases, Mark Cave-Ayland, 2024/01/12
- [PATCH 69/88] esp.c: consolidate end of command sequence after ICCS command, Mark Cave-Ayland, 2024/01/12
- [PATCH 52/88] esp.c: move CMD_SELATNS end of command logic to esp_do_dma() and do_dma_pdma_cb(), Mark Cave-Ayland, 2024/01/12
- [PATCH 68/88] esp.c: move write_response() non-DMA logic to esp_do_nodma(),
Mark Cave-Ayland <=
- [PATCH 86/88] esp.c: keep track of the DRQ state during DMA, Mark Cave-Ayland, 2024/01/12
- [PATCH 88/88] esp.c: add my copyright to the file, Mark Cave-Ayland, 2024/01/12
- [PATCH 60/88] esp.c: use deferred interrupts for both DATA IN and DATA OUT phases, Mark Cave-Ayland, 2024/01/12
- [PATCH 85/88] esp.c: rename irq_data IRQ to drq_irq, Mark Cave-Ayland, 2024/01/12
- [PATCH 83/88] esp.c: replace n variable with len in esp_do_nodma(), Mark Cave-Ayland, 2024/01/12
- [PATCH 67/88] esp.c: replace get_cmd() with esp_do_nodma(), Mark Cave-Ayland, 2024/01/12
- [PATCH 87/88] esp.c: switch TypeInfo registration to use DEFINE_TYPES() macro, Mark Cave-Ayland, 2024/01/12
- Re: [PATCH 00/88] esp: rework ESP emulation to use a SCSI phase-based state machine, Mark Cave-Ayland, 2024/01/22
- Re: [PATCH 00/88] esp: rework ESP emulation to use a SCSI phase-based state machine, Thomas Huth, 2024/01/25