From 4cd3aed7820c96942625ae6405c01a007d972195 Mon Sep 17 00:00:00 2001 From: Michael McMaster Date: Mon, 2 Dec 2019 19:43:05 +1000 Subject: [PATCH] Fix for VMS 5.5-2 for incorrect Inquiry command allocation lengths --- CHANGELOG | 6 ++++++ software/SCSI2SD/src/inquiry.c | 8 ++++++++ software/include/scsi2sd.h | 3 ++- software/scsi2sd-util/ConfigUtil.cc | 9 +++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 255acb6..aa5c126 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +20191202 4.x.x + - Fix to prevent sending floppy geometry mode page when not configured as + a floppy (Thanks Landon Rodgers) + - Fix for VMS 5.5-2 Inquiry allocation lengths. Requires setting "vms" quirk + mode in the XML config (Thanks Landon Rodgers) + 20190610 4.8.3 - Improve XEBEC controller support - Add Flexible Disk Drive Geometry SCSI MODE page diff --git a/software/SCSI2SD/src/inquiry.c b/software/SCSI2SD/src/inquiry.c index 463b8ea..3b84c52 100755 --- a/software/SCSI2SD/src/inquiry.c +++ b/software/SCSI2SD/src/inquiry.c @@ -1,4 +1,5 @@ // Copyright (C) 2013 Michael McMaster +// Copyright (C) 2019 Landon Rodgers // // This file is part of SCSI2SD. // @@ -213,6 +214,13 @@ void scsiInquiry() if (scsiDev.phase == DATA_IN) { + // VAX workaround + if (allocationLength == 255 && + (scsiDev.target->cfg->quirks & CONFIG_QUIRKS_VMS)) + { + allocationLength = 254; + } + // "real" hard drives send back exactly allocationLenth bytes, padded // with zeroes. This only seems to happen for Inquiry responses, and not // other commands that also supply an allocation length such as Mode Sense or diff --git a/software/include/scsi2sd.h b/software/include/scsi2sd.h index fc92714..e9e44e2 100755 --- a/software/include/scsi2sd.h +++ b/software/include/scsi2sd.h @@ -131,7 +131,8 @@ typedef enum CONFIG_QUIRKS_NONE = 0, CONFIG_QUIRKS_APPLE = 1, CONFIG_QUIRKS_OMTI = 2, - CONFIG_QUIRKS_XEBEC = 4 + CONFIG_QUIRKS_XEBEC = 4, + CONFIG_QUIRKS_VMS = 8 } CONFIG_QUIRKS; typedef enum diff --git a/software/scsi2sd-util/ConfigUtil.cc b/software/scsi2sd-util/ConfigUtil.cc index a11f1fc..f08fa3c 100755 --- a/software/scsi2sd-util/ConfigUtil.cc +++ b/software/scsi2sd-util/ConfigUtil.cc @@ -251,6 +251,7 @@ ConfigUtil::toXML(const TargetConfig& config) " apple\t\tReturns Apple-specific mode pages\n" << " omti\t\tOMTI host non-standard link control\n" << " xebec\t\tXEBEC ignore step options in control byte\n" << + " vms\t\tVMS output max 254 bytes inquiry data\n" << " ********************************************************* -->\n" << " "; if (config.quirks == CONFIG_QUIRKS_APPLE) @@ -265,6 +266,10 @@ ConfigUtil::toXML(const TargetConfig& config) { s << "xebec"; } + else if (config.quirks == CONFIG_QUIRKS_VMS) + { + s << "vms"; + } s << "\n" << @@ -527,6 +532,10 @@ parseTarget(wxXmlNode* node) { result.quirks |= CONFIG_QUIRKS_XEBEC; } + else if (quirk == "vms") + { + result.quirks |= CONFIG_QUIRKS_VMS; + } } } else if (child->GetName() == "deviceType") -- 2.38.5