Merge pull request #6604 from davide125/eject

nscsi/cd: handle eject command for SGI drives
This commit is contained in:
ajrhacker 2020-04-27 23:30:24 -04:00 committed by GitHub
commit b25fdfbe46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -604,13 +604,23 @@ enum sgi_scsi_command_e : uint8_t {
* in the kernel runs, if there are SCSI problems.
*/
SGI_HD2CDROM = 0xc9,
/*
* IRIX 5.3 sends this command when it wants to eject the drive
*/
SGI_EJECT = 0xc4,
};
void nscsi_cdrom_sgi_device::scsi_command()
{
switch (scsi_cmdbuf[0]) {
case SGI_HD2CDROM:
LOG("command SGI_HD2CDROM");
LOG("command SGI_HD2CDROM\n");
// No need to do anything (yet). Just acknowledge the command.
scsi_status_complete(SS_GOOD);
break;
case SGI_EJECT:
LOG("command SGI_EJECT\n");
// No need to do anything (yet). Just acknowledge the command.
scsi_status_complete(SS_GOOD);
break;
@ -627,6 +637,9 @@ bool nscsi_cdrom_sgi_device::scsi_command_done(uint8_t command, uint8_t length)
case SGI_HD2CDROM:
return length == 10;
case SGI_EJECT:
return length == 10;
default:
return nscsi_full_device::scsi_command_done(command, length);
}