Skip to content

Commit

Permalink
Report SCSI-1-CCS for USB devices not compliant with any standard
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Jan 7, 2025
1 parent edec228 commit 446171b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cpp/devices/scsi_generic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ int ScsiGeneric::ReadWriteData(span<uint8_t> buf, int chunk_size)

UpdateStartBlock(local_cdb, length / block_size);

// Report SCSI-1-CCS compatibility for devices not compliant with any standard
if (static_cast<ScsiCommand>(local_cdb[0]) == ScsiCommand::INQUIRY && !buf[2]) {
buf[2] = static_cast<uint8_t>(ScsiLevel::SCSI_1_CCS);
}

// The remaining count for non-block oriented commands is 0 because there may be less than allocation length bytes
if (command_meta_data.GetCdbMetaData(static_cast<ScsiCommand>(local_cdb[0])).block_size) {
remaining_count -= transferred_length;
Expand Down

0 comments on commit 446171b

Please sign in to comment.