Fix for VMS 5.5-2 for incorrect Inquiry command allocation lengths
[SCSI2SD.git] / software / SCSI2SD / src / inquiry.c
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