Fix for VMS 5.5-2 for incorrect Inquiry command allocation lengths
authorMichael McMaster <michael@codesrc.com>
Mon, 2 Dec 2019 09:43:05 +0000 (19:43 +1000)
committerMichael McMaster <michael@codesrc.com>
Mon, 2 Dec 2019 09:43:05 +0000 (19:43 +1000)
CHANGELOG
software/SCSI2SD/src/inquiry.c
software/include/scsi2sd.h
software/scsi2sd-util/ConfigUtil.cc

index 255acb6..aa5c126 100644 (file)
--- 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
index 463b8ea..3b84c52 100755 (executable)
@@ -1,4 +1,5 @@
 //     Copyright (C) 2013 Michael McMaster <michael@codesrc.com>
+//     Copyright (C) 2019 Landon Rodgers  <g.landon.rodgers@gmail.com>
 //
 //     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
index fc92714..e9e44e2 100755 (executable)
@@ -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
index a11f1fc..f08fa3c 100755 (executable)
@@ -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" <<
                "       <quirks>";
        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 <<
                        "</quirks>\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")