]> localhost Git - SCSI2SD-V6.git/commitdiff
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 61da61ef56eeb1c3252f3c2cbe6010f53db75be5..39059f9ede7c39bc1b62af59965287e53ca31d63 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 7a7217e502ed80c7361732d0fff2ed2de7588bf9..c5a4aaed1f23bedd956b07ef7da65350aad31553 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 99bb8dc0e98f0ac0b86c00d5b5ef55f7c7450ef1..138e8c2182d6ef4acf3b42911fb50181cbeed834 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 33edaff902eb59598f4df5e371f0eb826467b571..3080c3327e0c776a6d56f3b5953797295250ad1d 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")