|
@@ -21,6 +21,7 @@
|
|
|
#include "mode.h"
|
|
#include "mode.h"
|
|
|
#include "disk.h"
|
|
#include "disk.h"
|
|
|
#include "inquiry.h"
|
|
#include "inquiry.h"
|
|
|
|
|
+#include "ZuluSCSI_mode.h"
|
|
|
|
|
|
|
|
#include <string.h>
|
|
#include <string.h>
|
|
|
|
|
|
|
@@ -220,33 +221,6 @@ static const uint8_t ControlModePage[] =
|
|
|
0x00, 0x00 // AEN holdoff period.
|
|
0x00, 0x00 // AEN holdoff period.
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-#ifdef ENABLE_AUDIO_OUTPUT
|
|
|
|
|
-static const uint8_t CDROMCDParametersPage[] =
|
|
|
|
|
-{
|
|
|
|
|
-0x0D, // page code
|
|
|
|
|
-0x06, // page length
|
|
|
|
|
-0x00, // reserved
|
|
|
|
|
-0x0D, // reserved, inactivity time 8 min
|
|
|
|
|
-0x00, 0x3C, // 60 seconds per MSF M unit
|
|
|
|
|
-0x00, 0x4B // 75 frames per MSF S unit
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-static const uint8_t CDROMAudioControlParametersPage[] =
|
|
|
|
|
-{
|
|
|
|
|
-0x0E, // page code
|
|
|
|
|
-0x0E, // page length
|
|
|
|
|
-0x04, // 'Immed' bit set, 'SOTC' bit not set
|
|
|
|
|
-0x00, // reserved
|
|
|
|
|
-0x00, // reserved
|
|
|
|
|
-0x80, // 1 LBAs/sec multip
|
|
|
|
|
-0x00, 0x4B, // 75 LBAs/sec
|
|
|
|
|
-0x03, 0xFF, // output port 0 active, max volume
|
|
|
|
|
-0x03, 0xFF, // output port 1 active, max volume
|
|
|
|
|
-0x00, 0x00, // output port 2 inactive
|
|
|
|
|
-0x00, 0x00 // output port 3 inactive
|
|
|
|
|
-};
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
static const uint8_t SequentialDeviceConfigPage[] =
|
|
static const uint8_t SequentialDeviceConfigPage[] =
|
|
|
{
|
|
{
|
|
|
0x10, // page code
|
|
0x10, // page code
|
|
@@ -420,7 +394,8 @@ static void doModeSense(
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (pageCode == 0x03 || pageCode == 0x3F)
|
|
|
|
|
|
|
+ if ((pageCode == 0x03 || pageCode == 0x3F) &&
|
|
|
|
|
+ (scsiDev.target->cfg->deviceType != S2S_CFG_OPTICAL))
|
|
|
{
|
|
{
|
|
|
pageFound = 1;
|
|
pageFound = 1;
|
|
|
pageIn(pc, idx, FormatDevicePage, sizeof(FormatDevicePage));
|
|
pageIn(pc, idx, FormatDevicePage, sizeof(FormatDevicePage));
|
|
@@ -445,7 +420,8 @@ static void doModeSense(
|
|
|
idx += sizeof(FormatDevicePage);
|
|
idx += sizeof(FormatDevicePage);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (pageCode == 0x04 || pageCode == 0x3F)
|
|
|
|
|
|
|
+ if ((pageCode == 0x04 || pageCode == 0x3F) &&
|
|
|
|
|
+ (scsiDev.target->cfg->deviceType != S2S_CFG_OPTICAL))
|
|
|
{
|
|
{
|
|
|
pageFound = 1;
|
|
pageFound = 1;
|
|
|
if ((scsiDev.compatMode >= COMPAT_SCSI2))
|
|
if ((scsiDev.compatMode >= COMPAT_SCSI2))
|
|
@@ -523,31 +499,8 @@ static void doModeSense(
|
|
|
idx += sizeof(ControlModePage);
|
|
idx += sizeof(ControlModePage);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-#ifdef ENABLE_AUDIO_OUTPUT
|
|
|
|
|
- if ((scsiDev.target->cfg->deviceType == S2S_CFG_OPTICAL)
|
|
|
|
|
- && (pageCode == 0x0D || pageCode == 0x3F))
|
|
|
|
|
- {
|
|
|
|
|
- pageFound = 1;
|
|
|
|
|
- pageIn(
|
|
|
|
|
- pc,
|
|
|
|
|
- idx,
|
|
|
|
|
- CDROMCDParametersPage,
|
|
|
|
|
- sizeof(CDROMCDParametersPage));
|
|
|
|
|
- idx += sizeof(CDROMCDParametersPage);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if ((scsiDev.target->cfg->deviceType == S2S_CFG_OPTICAL)
|
|
|
|
|
- && (pageCode == 0x0E || pageCode == 0x3F))
|
|
|
|
|
- {
|
|
|
|
|
- pageFound = 1;
|
|
|
|
|
- pageIn(
|
|
|
|
|
- pc,
|
|
|
|
|
- idx,
|
|
|
|
|
- CDROMAudioControlParametersPage,
|
|
|
|
|
- sizeof(CDROMAudioControlParametersPage));
|
|
|
|
|
- idx += sizeof(CDROMAudioControlParametersPage);
|
|
|
|
|
- }
|
|
|
|
|
-#endif
|
|
|
|
|
|
|
+ idx += modeSenseCDDevicePage(pc, idx, pageCode, &pageFound);
|
|
|
|
|
+ idx += modeSenseCDAudioControlPage(pc, idx, pageCode, &pageFound);
|
|
|
|
|
|
|
|
if ((scsiDev.target->cfg->deviceType == S2S_CFG_SEQUENTIAL) &&
|
|
if ((scsiDev.target->cfg->deviceType == S2S_CFG_SEQUENTIAL) &&
|
|
|
(pageCode == 0x10 || pageCode == 0x3F))
|
|
(pageCode == 0x10 || pageCode == 0x3F))
|
|
@@ -670,10 +623,16 @@ static void doModeSelect(void)
|
|
|
|
|
|
|
|
while (idx < scsiDev.dataLen)
|
|
while (idx < scsiDev.dataLen)
|
|
|
{
|
|
{
|
|
|
|
|
+ // Change from SCSI2SD: if code page is 0x0 (vendor-specific) it
|
|
|
|
|
+ // will not follow the normal page mode format and cannot be
|
|
|
|
|
+ // parsed, but isn't necessarily an error. Instead, just treat it
|
|
|
|
|
+ // as an 'end of data' field and allow normal command completion.
|
|
|
|
|
+ int pageCode = scsiDev.data[idx] & 0x3F;
|
|
|
|
|
+ if (pageCode == 0) goto out;
|
|
|
|
|
+
|
|
|
int pageLen = scsiDev.data[idx + 1];
|
|
int pageLen = scsiDev.data[idx + 1];
|
|
|
if (idx + 2 + pageLen > scsiDev.dataLen) goto bad;
|
|
if (idx + 2 + pageLen > scsiDev.dataLen) goto bad;
|
|
|
|
|
|
|
|
- int pageCode = scsiDev.data[idx] & 0x3F;
|
|
|
|
|
switch (pageCode)
|
|
switch (pageCode)
|
|
|
{
|
|
{
|
|
|
case 0x03: // Format Device Page
|
|
case 0x03: // Format Device Page
|
|
@@ -699,6 +658,11 @@ static void doModeSelect(void)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case 0x0E: // CD audio control page
|
|
|
|
|
+ {
|
|
|
|
|
+ if (!modeSelectCDAudioControlPage(pageLen, idx)) goto bad;
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
//default:
|
|
//default:
|
|
|
|
|
|
|
|
// Easiest to just ignore for now. We'll get here when changing
|
|
// Easiest to just ignore for now. We'll get here when changing
|