Merge pull request #120 from erichelgeson/eric/readDefectData

Implement Read Defect Data 0x37
This commit is contained in:
Eric Helgeson 2022-06-08 15:51:18 -05:00 committed by GitHub
commit 2641e80fac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1487,6 +1487,20 @@ byte onSendDiagnostic(byte flags)
}
}
/*
* Read Defect Data
*/
byte onReadDefectData(const byte *cdb)
{
byte response[4] = {
0x0, // Reserved
cdb[2], // echo back Reserved, Plist, Glist, Defect list format
cdb[7], cdb[8] // echo back defect list length
};
writeDataPhase(4, response);
return SCSI_STATUS_GOOD;
}
/*
* MsgIn2.
*/
@ -1732,6 +1746,9 @@ void loop()
case SCSI_SEND_DIAG:
m_sts |= onSendDiagnostic(cmd[1]);
break;
case SCSI_READ_DEFECT_DATA:
m_sts |= onReadDefectData(cmd);
break;
case SCSI_LOCK_UNLOCK_CACHE: // Commands we dont have anything to do but can safely respond GOOD.
case SCSI_PREFETCH: // In the future we could implement something to mimic these.
case SCSI_PREVENT_ALLOW_REMOVAL: