mirror of
https://github.com/thewesker/RASCSI.git
synced 2025-12-20 20:31:24 -05:00
Workingish
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
#include "controllers/scsidev_ctrl.h"
|
#include "controllers/scsidev_ctrl.h"
|
||||||
#include "gpiobus.h"
|
#include "gpiobus.h"
|
||||||
#include "devices/scsi_host_bridge.h"
|
#include "devices/scsi_host_bridge.h"
|
||||||
|
#include "devices/scsi_nuvolink.h"
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
//
|
//
|
||||||
@@ -263,44 +264,44 @@ void FASTCALL SCSIDEV::Execute()
|
|||||||
#endif // RASCSI
|
#endif // RASCSI
|
||||||
|
|
||||||
// Process by command
|
// Process by command
|
||||||
switch (ctrl.cmd[0]) {
|
switch ((scsi_command)ctrl.cmd[0]) {
|
||||||
// TEST UNIT READY
|
// TEST UNIT READY
|
||||||
case 0x00:
|
case eCmdTestUnitReady:
|
||||||
CmdTestUnitReady();
|
CmdTestUnitReady();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// REZERO
|
// REZERO
|
||||||
case 0x01:
|
case eCmdRezero:
|
||||||
CmdRezero();
|
CmdRezero();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// REQUEST SENSE
|
// REQUEST SENSE
|
||||||
case 0x03:
|
case eCmdRequestSense:
|
||||||
CmdRequestSense();
|
CmdRequestSense();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// FORMAT UNIT
|
// FORMAT UNIT
|
||||||
case 0x04:
|
case eCmdFormat:
|
||||||
CmdFormat();
|
CmdFormat();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// REASSIGN BLOCKS
|
// REASSIGN BLOCKS
|
||||||
case 0x07:
|
case eCmdReassign:
|
||||||
CmdReassign();
|
CmdReassign();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// READ(6)
|
// READ(6)
|
||||||
case 0x08:
|
case eCmdRead6:
|
||||||
CmdRead6();
|
CmdRead6();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// WRITE(6)
|
// WRITE(6)
|
||||||
case 0x0a:
|
case eCmdWrite6:
|
||||||
CmdWrite6();
|
CmdWrite6();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// SEEK(6)
|
// SEEK(6)
|
||||||
case 0x0b:
|
case eCmdSeek6:
|
||||||
CmdSeek6();
|
CmdSeek6();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -310,115 +311,114 @@ void FASTCALL SCSIDEV::Execute()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// INQUIRY
|
// INQUIRY
|
||||||
case 0x12:
|
case eCmdInquiry:
|
||||||
CmdInquiry();
|
CmdInquiry();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// MODE SELECT
|
// MODE SELECT
|
||||||
case 0x15:
|
case eCmdModeSelect:
|
||||||
CmdModeSelect();
|
CmdModeSelect();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// MDOE SENSE
|
// MDOE SENSE
|
||||||
case 0x1a:
|
case eCmdModeSense:
|
||||||
CmdModeSense();
|
CmdModeSense();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// START STOP UNIT
|
// START STOP UNIT
|
||||||
case 0x1b:
|
case eCmdStartStop:
|
||||||
CmdStartStop();
|
CmdStartStop();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// SEND DIAGNOSTIC
|
// SEND DIAGNOSTIC
|
||||||
case 0x1d:
|
case eCmdSendDiag:
|
||||||
CmdSendDiag();
|
CmdSendDiag();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// PREVENT/ALLOW MEDIUM REMOVAL
|
// PREVENT/ALLOW MEDIUM REMOVAL
|
||||||
case 0x1e:
|
case eCmdRemoval:
|
||||||
CmdRemoval();
|
CmdRemoval();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// READ CAPACITY
|
// READ CAPACITY
|
||||||
case 0x25:
|
case eCmdReadCapacity:
|
||||||
CmdReadCapacity();
|
CmdReadCapacity();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// READ(10)
|
// READ(10)
|
||||||
case 0x28:
|
case eCmdRead10:
|
||||||
CmdRead10();
|
CmdRead10();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// WRITE(10)
|
// WRITE(10)
|
||||||
case 0x2a:
|
case eCmdWrite10:
|
||||||
|
// WRITE and VERIFY(10)
|
||||||
|
case eCmdWriteAndVerify10:
|
||||||
CmdWrite10();
|
CmdWrite10();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// SEEK(10)
|
// SEEK(10)
|
||||||
case 0x2b:
|
case eCmdSeek10:
|
||||||
CmdSeek10();
|
CmdSeek10();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// WRITE and VERIFY
|
|
||||||
case 0x2e:
|
|
||||||
CmdWrite10();
|
|
||||||
return;
|
|
||||||
|
|
||||||
// VERIFY
|
// VERIFY
|
||||||
case 0x2f:
|
case eCmdVerify:
|
||||||
CmdVerify();
|
CmdVerify();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// SYNCHRONIZE CACHE
|
// SYNCHRONIZE CACHE
|
||||||
case 0x35:
|
case eCmdSynchronizeCache:
|
||||||
CmdSynchronizeCache();
|
CmdSynchronizeCache();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// READ DEFECT DATA(10)
|
// READ DEFECT DATA(10)
|
||||||
case 0x37:
|
case eCmdReadDefectData10:
|
||||||
CmdReadDefectData10();
|
CmdReadDefectData10();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// READ TOC
|
// READ TOC
|
||||||
case 0x43:
|
case eCmdReadToc:
|
||||||
CmdReadToc();
|
CmdReadToc();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// PLAY AUDIO(10)
|
// PLAY AUDIO(10)
|
||||||
case 0x45:
|
case eCmdPlayAudio10:
|
||||||
CmdPlayAudio10();
|
CmdPlayAudio10();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// PLAY AUDIO MSF
|
// PLAY AUDIO MSF
|
||||||
case 0x47:
|
case eCmdPlayAudioMSF:
|
||||||
CmdPlayAudioMSF();
|
CmdPlayAudioMSF();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// PLAY AUDIO TRACK
|
// PLAY AUDIO TRACK
|
||||||
case 0x48:
|
case eCmdPlayAudioTrack:
|
||||||
CmdPlayAudioTrack();
|
CmdPlayAudioTrack();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// MODE SELECT(10)
|
// MODE SELECT(10)
|
||||||
case 0x55:
|
case eCmdModeSelect10:
|
||||||
CmdModeSelect10();
|
CmdModeSelect10();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// MDOE SENSE(10)
|
// MDOE SENSE(10)
|
||||||
case 0x5a:
|
case eCmdModeSense10:
|
||||||
CmdModeSense10();
|
CmdModeSense10();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// SPECIFY (SASI only/Suppress warning when using SxSI)
|
// SPECIFY (SASI only/Suppress warning when using SxSI)
|
||||||
case 0xc2:
|
case eCmdInvalid:
|
||||||
CmdInvalid();
|
CmdInvalid();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
default:
|
||||||
|
|
||||||
// No other support
|
// No other support
|
||||||
Log(Log::Normal, "Unsupported command received: $%02X", ctrl.cmd[0]);
|
Log(Log::Normal, "Unsupported command received: $%02X", ctrl.cmd[0]);
|
||||||
CmdInvalid();
|
CmdInvalid();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
@@ -1390,7 +1390,9 @@ void FASTCALL SCSIDEV::CmdSendMessage10()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Error if not a host bridge
|
// Error if not a host bridge
|
||||||
if (ctrl.unit[lun]->GetID() != MAKEID('S', 'C', 'B', 'R')) {
|
if ((ctrl.unit[lun]->GetID() != MAKEID('S', 'C', 'B', 'R')) &&
|
||||||
|
(ctrl.unit[lun]->GetID() != MAKEID('S', 'C', 'N', 'L'))) {
|
||||||
|
LOGERROR("Received CmdSendMessage10 for a non-bridge device");
|
||||||
Error();
|
Error();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,44 @@ public:
|
|||||||
BYTE msb[256];
|
BYTE msb[256];
|
||||||
} scsi_t;
|
} scsi_t;
|
||||||
|
|
||||||
|
enum scsi_command : BYTE {
|
||||||
|
eCmdTestUnitReady = 0x00,
|
||||||
|
eCmdRezero = 0x01,
|
||||||
|
eCmdResetStatistics = 0x02, // Nuvolink specific command
|
||||||
|
eCmdRequestSense = 0x03,
|
||||||
|
eCmdFormat = 0x04,
|
||||||
|
eCmdSendPacket = 0x05, // Nuvolink specific command
|
||||||
|
eCmdChangeMacAddr = 0x06, // Nuvolink specific command
|
||||||
|
eCmdReassign = 0x07,
|
||||||
|
eCmdRead6 = 0x08,
|
||||||
|
eCmdSetMcastReg = 0x09, // Nuvolink specific command
|
||||||
|
eCmdWrite6 = 0x0A,
|
||||||
|
eCmdSeek6 = 0x0B,
|
||||||
|
eCmdMediaSense = 0x0C, // Nuvolink specific command
|
||||||
|
eCmdInquiry = 0x12,
|
||||||
|
eCmdModeSelect = 0x15,
|
||||||
|
eCmdModeSense = 0x1A,
|
||||||
|
eCmdStartStop = 0x1B,
|
||||||
|
eCmdRcvDiag = 0x1C,
|
||||||
|
eCmdSendDiag = 0x1D,
|
||||||
|
eCmdRemoval = 0x1E,
|
||||||
|
eCmdReadCapacity = 0x25,
|
||||||
|
eCmdRead10 = 0x28,
|
||||||
|
eCmdWrite10 = 0x2A,
|
||||||
|
eCmdSeek10 = 0x2B,
|
||||||
|
eCmdWriteAndVerify10 = 0x2E,
|
||||||
|
eCmdVerify = 0x2F,
|
||||||
|
eCmdSynchronizeCache = 0x35,
|
||||||
|
eCmdReadDefectData10 = 0x37,
|
||||||
|
eCmdReadToc = 0x43,
|
||||||
|
eCmdPlayAudio10 = 0x45,
|
||||||
|
eCmdPlayAudioMSF = 0x47,
|
||||||
|
eCmdPlayAudioTrack = 0x48,
|
||||||
|
eCmdModeSelect10 = 0x55,
|
||||||
|
eCmdModeSense10 = 0x5A,
|
||||||
|
eCmdInvalid = 0xC2, // (SASI only/Suppress warning when using SxSI)
|
||||||
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Basic Functions
|
// Basic Functions
|
||||||
#ifdef RASCSI
|
#ifdef RASCSI
|
||||||
|
|||||||
@@ -298,6 +298,8 @@ void ListDevice(FILE *fp)
|
|||||||
// mount status output
|
// mount status output
|
||||||
if (pUnit->GetID() == MAKEID('S', 'C', 'B', 'R')) {
|
if (pUnit->GetID() == MAKEID('S', 'C', 'B', 'R')) {
|
||||||
FPRT(fp, "%s", "HOST BRIDGE");
|
FPRT(fp, "%s", "HOST BRIDGE");
|
||||||
|
} else if (pUnit->GetID() == MAKEID('S', 'C', 'N', 'L')) {
|
||||||
|
FPRT(fp, "%s", "NuvoLink SC");
|
||||||
} else {
|
} else {
|
||||||
pUnit->GetPath(filepath);
|
pUnit->GetPath(filepath);
|
||||||
FPRT(fp, "%s",
|
FPRT(fp, "%s",
|
||||||
|
|||||||
Reference in New Issue
Block a user