Added command byte count to SCSI command mapping (#966)

* Extended mapping table with command byte count

* Terminate early if command is unknown
This commit is contained in:
Uwe Seimet
2022-11-06 19:44:44 +01:00
committed by GitHub
parent c98c52ffb8
commit 1cae530d42
10 changed files with 121 additions and 101 deletions

View File

@@ -199,7 +199,14 @@ void ScsiController::Command()
GetBus().SetCD(true);
GetBus().SetIO(false);
const int actual_count = GetBus().CommandHandShake(GetBuffer().data());
const int actual_count = GetBus().CommandHandShake(GetBuffer());
if (actual_count == 0) {
LOGTRACE("ID %d LUN %d received unknown command: $%02X", GetTargetId(), GetEffectiveLun(), GetBuffer()[0])
Error(sense_key::ILLEGAL_REQUEST, asc::INVALID_COMMAND_OPERATION_CODE);
return;
}
const int command_byte_count = BUS::GetCommandByteCount(GetBuffer()[0]);
// If not able to receive all, move to the status phase