[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/88] esp.c: update esp_set_tc() to set STAT_TC flag
From: |
Mark Cave-Ayland |
Subject: |
[PULL 06/88] esp.c: update esp_set_tc() to set STAT_TC flag |
Date: |
Tue, 13 Feb 2024 19:39:30 +0000 |
This flag is set once the transfer counter counts down to zero.
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-7-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/scsi/esp.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index 8c1c6bfc1c..c7b79a2949 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -161,9 +161,15 @@ static uint32_t esp_get_tc(ESPState *s)
static void esp_set_tc(ESPState *s, uint32_t dmalen)
{
+ uint32_t old_tc = esp_get_tc(s);
+
s->rregs[ESP_TCLO] = dmalen;
s->rregs[ESP_TCMID] = dmalen >> 8;
s->rregs[ESP_TCHI] = dmalen >> 16;
+
+ if (old_tc && dmalen == 0) {
+ s->rregs[ESP_RSTAT] |= STAT_TC;
+ }
}
static uint32_t esp_get_stc(ESPState *s)
--
2.39.2
- [PULL 00/88] qemu-sparc queue 20240213, Mark Cave-Ayland, 2024/02/13
- [PULL 01/88] esp.c: don't clear cmdfifo when esp_select() fails in get_cmd(), Mark Cave-Ayland, 2024/02/13
- [PULL 02/88] esp.c: move existing request cancel check into esp_select(), Mark Cave-Ayland, 2024/02/13
- [PULL 03/88] esp.c: add FIFO wraparound support to esp_fifo_pop_buf(), Mark Cave-Ayland, 2024/02/13
- [PULL 04/88] esp.c: remove FIFO clear from esp_select(), Mark Cave-Ayland, 2024/02/13
- [PULL 05/88] esp.c: move esp_select() to ESP selection commands from get_cmd(), Mark Cave-Ayland, 2024/02/13
- [PULL 06/88] esp.c: update esp_set_tc() to set STAT_TC flag,
Mark Cave-Ayland <=
- [PULL 08/88] esp.c: move command execution logic to new esp_run_cmd() function, Mark Cave-Ayland, 2024/02/13
- [PULL 07/88] esp.c: start removal of manual STAT_TC setting when transfer counter reaches zero, Mark Cave-Ayland, 2024/02/13
- [PULL 09/88] esp.c: update TC check logic in do_dma_pdma_cb() to check for TC == 0, Mark Cave-Ayland, 2024/02/13
- [PULL 10/88] esp.c: move buffer and TC logic into separate to/from device paths in esp_do_dma(), Mark Cave-Ayland, 2024/02/13
- [PULL 11/88] esp.c: remove unused case from esp_pdma_read(), Mark Cave-Ayland, 2024/02/13
- [PULL 13/88] esp.c: decrement the TC during MESSAGE OUT and COMMAND phases, Mark Cave-Ayland, 2024/02/13
- [PULL 12/88] esp.c: don't accumulate directly into cmdfifo, Mark Cave-Ayland, 2024/02/13
- [PULL 14/88] esp.c: introduce esp_set_phase() helper function, Mark Cave-Ayland, 2024/02/13
- [PULL 16/88] esp.c: remove MacOS TI workaround that pads FIFO transfers to ESP_FIFO_SZ, Mark Cave-Ayland, 2024/02/13
- [PULL 15/88] esp.c: remove another set of manual STAT_TC updates, Mark Cave-Ayland, 2024/02/13