Skip to content

Commit

Permalink
Merge pull request erichelgeson#120 from erichelgeson/eric/readDefect…
Browse files Browse the repository at this point in the history
…Data

Implement Read Defect Data 0x37
  • Loading branch information
erichelgeson authored and androda committed Jun 19, 2022
1 parent 46d47cb commit 9f00e87
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions F4_BlueSCSI/F4_BlueSCSI.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,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.
*/
Expand Down Expand Up @@ -1804,6 +1818,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:
Expand Down

0 comments on commit 9f00e87

Please sign in to comment.