diff --git a/cpp/devices/storage_device.cpp b/cpp/devices/storage_device.cpp index a6a0e1a7..daf61b16 100644 --- a/cpp/devices/storage_device.cpp +++ b/cpp/devices/storage_device.cpp @@ -135,7 +135,7 @@ void StorageDevice::ModeSelect(cdb_t cdb, span buf, int length) { // PF if (!(cdb[1] & 0x10)) { - // Vendor-specific parameters (SCSI-1) are not supported. + // Vendor-specific parameters (all parameters in SCSI-1 are vendor-specific) are not supported. // Do not report an error in order to support Apple's HD SC Setup. return; } diff --git a/cpp/devices/storage_device.h b/cpp/devices/storage_device.h index 7aa6c8e7..4c8e2a20 100644 --- a/cpp/devices/storage_device.h +++ b/cpp/devices/storage_device.h @@ -117,7 +117,7 @@ class StorageDevice : public PrimaryDevice void ModeSelect(cdb_t, span, int) override; pair EvaluateBlockDescriptors(scsi_command, span, int) const; - int VerifyBlockSizeChange(int, bool) const; + virtual int VerifyBlockSizeChange(int, bool) const; unordered_set GetBlockSizes() const; bool SetBlockSize(uint32_t); diff --git a/cpp/devices/tape.cpp b/cpp/devices/tape.cpp index 225c34d5..6df9e1c4 100644 --- a/cpp/devices/tape.cpp +++ b/cpp/devices/tape.cpp @@ -271,6 +271,12 @@ vector Tape::InquiryInternal() const return HandleInquiry(device_type::sequential_access, true); } +int Tape::VerifyBlockSizeChange(int requested_size, bool temporary) const +{ + // Special handling of block size 0 for sequential-access devices, according to the SCSI-2 specification + return requested_size || !temporary ? VerifyBlockSizeChange(requested_size, temporary) : 0; +} + void Tape::SetUpModePages(map> &pages, int page, bool changeable) const { StorageDevice::SetUpModePages(pages, page, changeable); diff --git a/cpp/devices/tape.h b/cpp/devices/tape.h index 8026fb24..2efc84d1 100644 --- a/cpp/devices/tape.h +++ b/cpp/devices/tape.h @@ -93,6 +93,8 @@ class Tape : public StorageDevice, public ScsiStreamCommands uint32_t GetByteCount() const; + int VerifyBlockSizeChange(int, bool) const override; + void AddModeBlockDescriptor(map>&) const; void AddMediumPartitionPage(map>&, bool) const; void AddDataCompressionPage(map>&) const;