Skip to content

Commit

Permalink
Update logging
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Dec 12, 2024
1 parent 418a53f commit a08945c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cpp/initiator/initiator_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ void InitiatorExecutor::Command(span<uint8_t> cdb)
const auto cmd = static_cast<scsi_command>(cdb[cdb_offset]);
const int sent_count = bus.SendHandShake(cdb.data() + cdb_offset, static_cast<int>(cdb.size()) - cdb_offset);
if (static_cast<int>(cdb.size()) < sent_count) {
initiator_logger.error("Command {} failed", CommandMetaData::Instance().GetCommandName(cmd));
initiator_logger.error("Execution of {} failed", CommandMetaData::Instance().GetCommandName(cmd));
}

cdb_offset += sent_count;
Expand Down
8 changes: 4 additions & 4 deletions cpp/shared/command_meta_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ using namespace spdlog;
CommandMetaData::CommandMetaData()
{
for (int i = 0x00; i < 0x1f; i++) {
AddCommand(static_cast<scsi_command>(i), 6, fmt::format("UNKNOWN COMMAND ${:02x}", i), { 0, 0, 0, 0, false });
AddCommand(static_cast<scsi_command>(i), 6, fmt::format("command ${:02x}", i), { 0, 0, 0, 0, false });
}

for (int i = 0x20; i < 0x80; i++) {
AddCommand(static_cast<scsi_command>(i), 10, fmt::format("UNKNOWN COMMAND ${:02x}", i), { 0, 0, 0, 0, false });
AddCommand(static_cast<scsi_command>(i), 10, fmt::format("command ${:02x}", i), { 0, 0, 0, 0, false });
}

for (int i = 0x80; i < 0xa0; i++) {
AddCommand(static_cast<scsi_command>(i), 16, fmt::format("UNKNOWN COMMAND ${:02x}", i), { 0, 0, 0, 0, false });
AddCommand(static_cast<scsi_command>(i), 16, fmt::format("command ${:02x}", i), { 0, 0, 0, 0, false });
}

for (int i = 0xa0; i < 0xc0; i++) {
AddCommand(static_cast<scsi_command>(i), 12, fmt::format("UNKNOWN COMMAND ${:02x}", i), { 0, 0, 0, 0, false });
AddCommand(static_cast<scsi_command>(i), 12, fmt::format("command ${:02x}", i), { 0, 0, 0, 0, false });
}

// This explicit mapping only contains commands known/supported by s2p
Expand Down

0 comments on commit a08945c

Please sign in to comment.