[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/42] esp: determine transfer direction directly from SCSI phase
From: |
Mark Cave-Ayland |
Subject: |
[PULL 08/42] esp: determine transfer direction directly from SCSI phase |
Date: |
Sun, 7 Mar 2021 12:08:16 +0000 |
The transfer direction is currently determined by checking the sign of ti_size
but as this series progresses ti_size can be zero at the end of the transfer.
Use the SCSI phase to determine the transfer direction as used in other SCSI
controller implementations.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-9-mark.cave-ayland@ilande.co.uk>
---
hw/scsi/esp.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index e0676ae790..5365523f6b 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -356,7 +356,7 @@ static void esp_dma_done(ESPState *s)
static void do_dma_pdma_cb(ESPState *s)
{
- int to_device = (s->ti_size < 0);
+ int to_device = ((s->rregs[ESP_RSTAT] & 7) == STAT_DO);
int len = s->pdma_cur - s->pdma_start;
if (s->do_cmd) {
s->ti_size = 0;
@@ -392,7 +392,7 @@ static void do_dma_pdma_cb(ESPState *s)
static void esp_do_dma(ESPState *s)
{
uint32_t len;
- int to_device;
+ int to_device = ((s->rregs[ESP_RSTAT] & 7) == STAT_DO);
len = s->dma_left;
if (s->do_cmd) {
@@ -425,7 +425,6 @@ static void esp_do_dma(ESPState *s)
if (len > s->async_len) {
len = s->async_len;
}
- to_device = (s->ti_size < 0);
if (to_device) {
if (s->dma_memory_read) {
s->dma_memory_read(s->dma_opaque, s->async_buf, len);
--
2.20.1
- [PULL 00/42] qemu-sparc queue 20210307, Mark Cave-Ayland, 2021/03/07
- [PULL 01/42] esp: checkpatch fixes, Mark Cave-Ayland, 2021/03/07
- [PULL 02/42] esp: rename existing ESP QOM type to SYSBUS_ESP, Mark Cave-Ayland, 2021/03/07
- [PULL 03/42] esp: QOMify the internal ESP device state, Mark Cave-Ayland, 2021/03/07
- [PULL 04/42] esp: add vmstate_esp version to embedded ESPState, Mark Cave-Ayland, 2021/03/07
- [PULL 05/42] esp: add trace event when receiving a TI command, Mark Cave-Ayland, 2021/03/07
- [PULL 06/42] esp: fix esp_reg_read() trace event, Mark Cave-Ayland, 2021/03/07
- [PULL 07/42] esp: add PDMA trace events, Mark Cave-Ayland, 2021/03/07
- [PULL 08/42] esp: determine transfer direction directly from SCSI phase,
Mark Cave-Ayland <=
- [PULL 09/42] esp: introduce esp_get_tc() and esp_set_tc(), Mark Cave-Ayland, 2021/03/07
- [PULL 10/42] esp: introduce esp_get_stc(), Mark Cave-Ayland, 2021/03/07
- [PULL 11/42] esp: apply transfer length adjustment when STC is zero at TC load time, Mark Cave-Ayland, 2021/03/07
- [PULL 12/42] esp: remove dma_counter from ESPState, Mark Cave-Ayland, 2021/03/07
- [PULL 13/42] esp: remove dma_left from ESPState, Mark Cave-Ayland, 2021/03/07
- [PULL 14/42] esp: remove minlen restriction in handle_ti, Mark Cave-Ayland, 2021/03/07
- [PULL 15/42] esp: introduce esp_pdma_read() and esp_pdma_write() functions, Mark Cave-Ayland, 2021/03/07
- [PULL 16/42] esp: use pdma_origin directly in esp_pdma_read()/esp_pdma_write(), Mark Cave-Ayland, 2021/03/07
- [PULL 17/42] esp: move pdma_len and TC logic into esp_pdma_read()/esp_pdma_write(), Mark Cave-Ayland, 2021/03/07
- [PULL 18/42] esp: accumulate SCSI commands for PDMA transfers in cmdbuf instead of pdma_buf, Mark Cave-Ayland, 2021/03/07