esp: store lun coming from the MESSAGE OUT phase

The LUN is selected with an IDENTIFY message, and persists
until the next message out phase.  Instead of passing it to
do_busid_cmd, store it in ESPState.  Because do_cmd can simply
skip the message out phase if cmdfifo_cdb_offset is zero, it
can now be used for the S without ATN cases as well.

Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2021-06-11 13:38:58 +02:00
parent 0bcd5a1894
commit 4eb8606560
3 changed files with 34 additions and 17 deletions

View file

@ -37,6 +37,7 @@ struct ESPState {
SCSIRequest *current_req;
Fifo8 cmdfifo;
uint8_t cmdfifo_cdb_offset;
uint8_t lun;
uint32_t do_cmd;
bool data_in_ready;