memcpy(&scsiDev.data[8], config->vendor, sizeof(config->vendor));
memcpy(&scsiDev.data[16], config->prodId, sizeof(config->prodId));
memcpy(&scsiDev.data[32], config->revision, sizeof(config->revision));
+
scsiDev.dataLen = sizeof(StandardResponse) +
sizeof(config->vendor) +
sizeof(config->prodId) +
scsiDev.dataLen = allocationLength;
// Set the device type as needed.
+ scsiDev.data[0] = getDeviceTypeQualifier();
+
switch (scsiDev.target->cfg->deviceType)
{
case CONFIG_OPTICAL:
- scsiDev.data[0] = 0x05; // device type
scsiDev.data[1] |= 0x80; // Removable bit.
break;
case CONFIG_SEQUENTIAL:
- scsiDev.data[0] = 0x01; // device type
scsiDev.data[1] |= 0x80; // Removable bit.
break;
case CONFIG_MO:
- scsiDev.data[0] = 0x07; // device type
scsiDev.data[1] |= 0x80; // Removable bit.
break;
// Accept defaults for a fixed disk.
break;
}
+
}
// Set the first byte to indicate LUN presence.
}
}
+uint8_t getDeviceTypeQualifier()
+{
+ // Set the device type as needed.
+ switch (scsiDev.target->cfg->deviceType)
+ {
+ case CONFIG_OPTICAL:
+ return 0x05;
+ break;
+
+ case CONFIG_SEQUENTIAL:
+ return 0x01;
+ break;
+
+ case CONFIG_MO:
+ return 0x07;
+ break;
+
+ case CONFIG_FLOPPY_14MB:
+ case CONFIG_REMOVEABLE:
+ return 0;
+ break;
+
+ default:
+ // Accept defaults for a fixed disk.
+ return 0;
+ }
+}
+
#include "scsi.h"\r
#include "mode.h"\r
#include "disk.h"\r
+#include "inquiry.h"\r
\r
#include <string.h>\r
\r
+// "Vendor" defined page which was included by Seagate, and required for\r
+// Amiga 500 using DKB SpitFire controller.\r
+static const uint8 OperatingPage[] =\r
+{\r
+0x00, // Page code\r
+0x02, // Page length\r
+\r
+// Bit 4 = unit attension (0 = on, 1 = off).\r
+// Bit 7 = usage bit, EEPROM life exceeded warning = 1.\r
+0x80, \r
+\r
+// Bit 7 = reserved.\r
+// Bits 0:6: Device type qualifier, as per Inquiry data\r
+0x00\r
+};\r
+\r
static const uint8 ReadWriteErrorRecoveryPage[] =\r
{\r
0x01, // Page code\r
idx += sizeof(AppleVendorPage);\r
}\r
\r
+ // SCSI 2 standard says page 0 is always last.\r
+ if (pageCode == 0x00 || pageCode == 0x3F)\r
+ {\r
+ pageFound = 1;\r
+ pageIn(pc, idx, OperatingPage, sizeof(OperatingPage));\r
+\r
+ // Note inverted logic for the flag.\r
+ scsiDev.data[idx+2] =\r
+ (scsiDev.boardCfg.flags & CONFIG_ENABLE_UNIT_ATTENTION) ? 0x80 : 0x90;\r
+\r
+ scsiDev.data[idx+3] = getDeviceTypeQualifier();\r
+\r
+ idx += sizeof(OperatingPage);\r
+ }\r
+\r
if (!pageFound)\r
{\r
// Unknown Page Code\r