]> xenbits.xensource.com Git - seabios.git/commitdiff
esp-scsi: indicate acceptance of MESSAGE IN phase data
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Thu, 29 Aug 2024 11:58:46 +0000 (12:58 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 4 Sep 2024 10:05:56 +0000 (12:05 +0200)
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>
Message-ID: <20240829115846.954993-1-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
src/hw/esp-scsi.c

index 8612069f99dee5616753784ab97a00af2332c209..e1bee54541450daafdd3abc08f555be51848cb71 100644 (file)
@@ -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);