From d6ff7017c9989ca4c8f85b64280bbc31e79ee6b6 Mon Sep 17 00:00:00 2001 From: Eric Helgeson Date: Thu, 2 Jun 2022 21:49:27 -0500 Subject: [PATCH] Implement Read Defect Data 0x37 --- src/BlueSCSI.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/BlueSCSI.cpp b/src/BlueSCSI.cpp index 1733ebd..76e2b70 100644 --- a/src/BlueSCSI.cpp +++ b/src/BlueSCSI.cpp @@ -1489,6 +1489,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. */ @@ -1734,6 +1748,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: