Add READ DEFECT DATA command emulation

This commit is contained in:
Michael McMaster 2019-12-02 19:25:08 +10:00
parent 52828268ae
commit 54ac6377ce
1 changed files with 14 additions and 4 deletions

View File

@ -522,11 +522,21 @@ int scsiDiskCommand()
else if (unlikely(command == 0x37))
{
// READ DEFECT DATA
scsiDev.status = CHECK_CONDITION;
scsiDev.target->sense.code = NO_SENSE;
scsiDev.target->sense.asc = DEFECT_LIST_NOT_FOUND;
scsiDev.phase = STATUS;
uint32_t allocLength = (((uint16_t)scsiDev.cdb[7]) << 8) |
scsiDev.cdb[8];
scsiDev.data[0] = 0;
scsiDev.data[1] = scsiDev.cdb[1]
scsiDev.data[2] = 0;
scsiDev.data[3] = 0;
scsiDev.dataLen = 4;
if (scsiDev.dataLen > allocLength)
{
scsiDev.dataLen = allocLength;
}
scsiDev.phase = DATA_IN;
}
else
{