esp: determine transfer direction directly from SCSI phase
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Thu, 4 Mar 2021 22:10:29 +0000 (22:10 +0000)
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Sun, 7 Mar 2021 10:39:05 +0000 (10:39 +0000)
commit4ca2ba6fb0bdf1099a742a361d1e2ad227c3bbf4
tree13118f0cffc8c2c04101282b49f657516f1190dd
parent960ebfd94e8f6ea879472e7efb84b1704f685d39
esp: determine transfer direction directly from SCSI phase

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