mirror of
https://github.com/erichelgeson/BlueSCSI.git
synced 2025-01-26 15:33:21 +00:00
Implement Send Diagnostic
This commit is contained in:
parent
3c258451fa
commit
906b8be9aa
@ -1468,6 +1468,27 @@ byte onReadBuffer(byte mode, uint32_t allocLength)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* On Send Diagnostic
|
||||
*/
|
||||
byte onSendDiagnostic(byte flags)
|
||||
{
|
||||
int self_test = flags & 0x4;
|
||||
LOGN("-SendDiagnostic");
|
||||
LOGHEXN(flags);
|
||||
if(self_test)
|
||||
{
|
||||
// Don't actually do a test, we're good.
|
||||
return SCSI_STATUS_GOOD;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_senseKey = SCSI_SENSE_ILLEGAL_REQUEST;
|
||||
m_addition_sense = SCSI_ASC_INVALID_FIELD_IN_CDB;
|
||||
return SCSI_STATUS_CHECK_CONDITION;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* MsgIn2.
|
||||
*/
|
||||
@ -1718,6 +1739,9 @@ void loop()
|
||||
LOGN("[ReadBuffer]");
|
||||
m_sts |= onReadBuffer(cmd[1] & 7, ((uint32_t)cmd[6] << 16) | ((uint32_t)cmd[7] << 8) | cmd[8]);
|
||||
break;
|
||||
case SCSI_SEND_DIAG:
|
||||
m_sts |= onSendDiagnostic(cmd[1]);
|
||||
break;
|
||||
default:
|
||||
LOGN("[*Unknown]");
|
||||
m_sts |= SCSI_STATUS_CHECK_CONDITION;
|
||||
|
Loading…
x
Reference in New Issue
Block a user