When the target has sent its MESSAGE IN phase data to the initiator, it waits for the initiator to release the ACK signal before disconnecting from the bus.
Send a MSG_ACC command to the ESP so that the initiator releases the ACK signal to allow the target to disconnect, and also return the ASC back to the disconnected state.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- src/hw/esp-scsi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
[MCA: this is required for an upcoming QEMU ESP patch series which enforces the commands that can be executed in each internal ESP state. Without this fix SeaBIOS doesn't return the ESP back to its disconnected state after the SCSI transfer, causing subsequent ESP commands to fail.]
diff --git a/src/hw/esp-scsi.c b/src/hw/esp-scsi.c index 8612069f..e1bee545 100644 --- a/src/hw/esp-scsi.c +++ b/src/hw/esp-scsi.c @@ -50,6 +50,7 @@ #define ESP_CMD_RESET 0x02 #define ESP_CMD_TI 0x10 #define ESP_CMD_ICCS 0x11 +#define ESP_CMD_MSGACC 0x12 #define ESP_CMD_SELATN 0x42
#define ESP_STAT_DI 0x01 @@ -159,11 +160,12 @@ esp_scsi_process_op(struct disk_op_s *op) continue; }
- /* Finally read data from the message in phase. */ + /* Finally read data from the message in phase and accept. */ if (state == 3 && (stat & ESP_STAT_MSG)) { state++; status = inb(iobase + ESP_FIFO); inb(iobase + ESP_FIFO); + outb(ESP_CMD_MSGACC, iobase + ESP_CMD); break; } usleep(5);