From 3002ac8a4a0f67da22d08a568ffbbfa4d41e845b Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 17 Sep 2019 21:59:32 -0400 Subject: [PATCH] Adds mapping of READ(8) size 0 to size 256. --- Storage/MassStorage/SCSI/Target.cpp | 3 +++ Storage/MassStorage/SCSI/Target.hpp | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Storage/MassStorage/SCSI/Target.cpp b/Storage/MassStorage/SCSI/Target.cpp index 558d3f331..817a9461e 100644 --- a/Storage/MassStorage/SCSI/Target.cpp +++ b/Storage/MassStorage/SCSI/Target.cpp @@ -45,6 +45,9 @@ CommandState::ReadWrite CommandState::read_write_specs() const { specs.address = address(); specs.number_of_blocks = number_of_blocks(); + if(!specs.number_of_blocks && (data_.size() == 6)) { + specs.number_of_blocks = 256; + } return specs; } diff --git a/Storage/MassStorage/SCSI/Target.hpp b/Storage/MassStorage/SCSI/Target.hpp index b5e46e194..9401d61b4 100644 --- a/Storage/MassStorage/SCSI/Target.hpp +++ b/Storage/MassStorage/SCSI/Target.hpp @@ -27,8 +27,7 @@ class CommandState { // For read and write commands. struct ReadWrite { - uint32_t address; - uint16_t number_of_blocks; + uint32_t address, number_of_blocks; }; ReadWrite read_write_specs() const;