Fix for VMS 5.5-2 for incorrect Inquiry command allocation lengths
authorMichael McMaster <michael@codesrc.com>
Tue, 19 Nov 2019 06:13:46 +0000 (16:13 +1000)
committerMichael McMaster <michael@codesrc.com>
Tue, 19 Nov 2019 06:13:46 +0000 (16:13 +1000)
CHANGELOG
include/scsi2sd.h
src/firmware/inquiry.c
src/scsi2sd-util6/ConfigUtil.cc

index 61da61e..39059f9 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,9 @@
+20191119               6.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)
+
 20191030               6.2.8
        - Fix incorrect results from the self-test function.
 
index 7a7217e..c5a4aae 100755 (executable)
@@ -81,7 +81,8 @@ typedef enum
        S2S_CFG_QUIRKS_NONE = 0,
        S2S_CFG_QUIRKS_APPLE = 1,
        S2S_CFG_QUIRKS_OMTI = 2,
-       S2S_CFG_QUIRKS_XEBEC = 4
+       S2S_CFG_QUIRKS_XEBEC = 4,
+       S2S_CFG_QUIRKS_VMS = 8
 } S2S_CFG_QUIRKS;
 
 typedef enum
index 99bb8dc..138e8c2 100755 (executable)
@@ -1,4 +1,5 @@
 //     Copyright (C) 2013 Michael McMaster <michael@codesrc.com>\r
+//     Copyright (C) 2019 Landon Rodgers  <g.landon.rodgers@gmail.com>\r
 //\r
 //     This file is part of SCSI2SD.\r
 //\r
@@ -154,6 +155,13 @@ void s2s_scsiInquiry()
 \r
        if (scsiDev.phase == DATA_IN)\r
        {\r
+               // VAX workaround\r
+               if (allocationLength == 255 &&\r
+                       (scsiDev.target->cfg->quirks & S2S_CFG_QUIRKS_VMS))\r
+               {\r
+                       allocationLength = 254;\r
+               }\r
+\r
                // "real" hard drives send back exactly allocationLenth bytes, padded\r
                // with zeroes. This only seems to happen for Inquiry responses, and not\r
                // other commands that also supply an allocation length such as Mode Sense or\r
index 33edaff..3080c33 100755 (executable)
@@ -168,6 +168,7 @@ ConfigUtil::toBytes(const S2S_TargetCfg& _config)
        config.headsPerCylinder = fromLE16(config.headsPerCylinder);
 
        const uint8_t* begin = reinterpret_cast<const uint8_t*>(&config);
+
        return std::vector<uint8_t>(begin, begin + sizeof(config));
 }
 
@@ -229,6 +230,10 @@ ConfigUtil::toXML(const S2S_TargetCfg& config)
        {
                s << "xebec";
        }
+       else if (config.quirks == S2S_CFG_QUIRKS_VMS)
+       {
+               s << "vms";
+       }
 
        s <<
                        "</quirks>\n" <<
@@ -465,6 +470,10 @@ parseTarget(wxXmlNode* node)
                                {
                                        result.quirks |= S2S_CFG_QUIRKS_XEBEC;
                                }
+                               else if (quirk == "vms")
+                               {
+                                       result.quirks |= S2S_CFG_QUIRKS_VMS;
+                               }
                        }
                }
                else if (child->GetName() == "deviceType")