Explorar o código

scsi: few fixes to Zip

Eric Helgeson hai 1 ano
pai
achega
8cb85f821a
Modificáronse 4 ficheiros con 25 adicións e 15 borrados
  1. 19 1
      lib/SCSI2SD/src/firmware/inquiry.c
  2. 1 1
      src/BlueSCSI.cpp
  3. 1 1
      src/BlueSCSI_config.h
  4. 4 12
      src/BlueSCSI_disk.cpp

+ 19 - 1
lib/SCSI2SD/src/firmware/inquiry.c

@@ -80,6 +80,16 @@ static const uint8_t AscImpOperatingDefinition[] =
 'S','C','S','I','-','2'
 };
 
+static const uint8_t IOMegaVendorInquiry[] =
+{
+'0', '8', '/', '2', '0', '/', '9', '6', 0x0, 0x0, 0x0, 0x0,
+0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+'(', 'c', ')', ' ', 'C', 'o', 'p', 'y', 'r', 'i', 'g', 'h', 't', ' ', 'I', 'O',
+'M', 'E', 'G', 'A', ' ', '1', '9', '9', '5', ' '
+};
+
 void s2s_scsiInquiry()
 {
 	uint8_t evpd = scsiDev.cdb[1] & 1; // enable vital product data.
@@ -200,6 +210,7 @@ void s2s_scsiInquiry()
 
 		case S2S_CFG_FLOPPY_14MB:
 		case S2S_CFG_REMOVEABLE:
+		case S2S_CFG_ZIP100:
 			scsiDev.data[1] |= 0x80; // Removable bit.
 			break;
 
@@ -248,8 +259,15 @@ uint32_t s2s_getStandardInquiry(
 		sizeof(cfg->prodId) +
 		sizeof(cfg->revision);
 
+    if(cfg->deviceType == S2S_CFG_ZIP100) {
+        memcpy(&out[size], IOMegaVendorInquiry, sizeof(IOMegaVendorInquiry));
+        size += sizeof(IOMegaVendorInquiry);
+        out[7] = 0x00; // Disable sync and linked commands
+        out[4] = 0x75; // 117 length
+    }
 	// Mac Daynaport Driver does not like this added.
-	if(cfg->deviceType != S2S_CFG_NETWORK) {
+    // IOMega already has a vendor inquiry
+	if(cfg->deviceType != S2S_CFG_NETWORK && cfg->deviceType != S2S_CFG_ZIP100) {
 		memcpy(&out[size], PLATFORM_INQUIRY, sizeof(PLATFORM_INQUIRY));
 		size += sizeof(PLATFORM_INQUIRY);
 		out[size] = PLATFORM_TOOLBOX_API;

+ 1 - 1
src/BlueSCSI.cpp

@@ -194,7 +194,7 @@ const char * typeToChar(int deviceType)
   case S2S_CFG_REMOVEABLE:
     return "Removable";
   case S2S_CFG_ZIP100:
-    return "Zip100";
+    return "ZIP100";
   default:
     return "Unknown";
   }

+ 1 - 1
src/BlueSCSI_config.h

@@ -68,7 +68,7 @@
 #define APPLE_DRIVEINFO_TAPE      {"BlueSCSI", "APPLE_TAPE",      "",     ""}
 
 // Default Iomega ZIP drive information
-#define IOMEGA_DRIVEINFO_ZIP100     {"IOMEGA", "ZIP 100", "E.08", ""}
+#define IOMEGA_DRIVEINFO_ZIP100     {"IOMEGA", "ZIP 100", "D.13", ""}
 #define IOMEGA_DRIVEINFO_ZIP250     {"IOMEGA", "ZIP 250", "42.S", ""}
 #define IOMEGA_DRIVEINFO_JAZ        {"iomega", "jaz", "", ""}
 

+ 4 - 12
src/BlueSCSI_disk.cpp

@@ -289,6 +289,7 @@ static void setDefaultDriveInfo(int target_idx)
             case S2S_CFG_MO:            driveinfo = apl_driveinfo_magopt; break;
             case S2S_CFG_NETWORK:       driveinfo = apl_driveinfo_network; break;
             case S2S_CFG_SEQUENTIAL:    driveinfo = apl_driveinfo_tape; break;
+            case S2S_CFG_ZIP100:        driveinfo = iomega_driveinfo_removeable; break;
             default:                    driveinfo = apl_driveinfo_fixed; break;
         }
     }
@@ -1887,22 +1888,13 @@ int scsiDiskCommand()
         //int immed = scsiDev.cdb[1] & 1;
         int start = scsiDev.cdb[4] & 1;
 
-        if (scsiDev.target->cfg->deviceType == S2S_CFG_ZIP100)
+        if (start)
         {
-            // If it's a ZIP drive, it likes to eject all the time so this
-            // little dance helps keep a disc loaded
-            if (start)
-            {
-                scsiDev.target->started = 1;
-            }
-            else
-            {
-                scsiDev.target->started = 0;
-            }
+            scsiDev.target->started = 1;
         }
         else
         {
-            scsiDev.target->started = 1;
+            scsiDev.target->started = 0;
         }
     }
     else if (unlikely(command == 0x00))