Skip to content

Commit

Permalink
continued iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Devine committed Mar 22, 2022
1 parent 02afbc0 commit ccc7e23
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 7 deletions.
6 changes: 6 additions & 0 deletions src/raspberrypi/controllers/sasidev_ctrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,11 @@ class SASIDEV
// Special operations
void FlushUnit(); // Flush the logical unit

//Xebec s1410 specific commands
void SetDriveParams();
void RamDiagnostics();
void DriveDiagnostics();
void ControllerDiagnostics();

ctrl_t ctrl; // Internal data
};
2 changes: 1 addition & 1 deletion src/raspberrypi/controllers/scsidev_ctrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SCSIDEV : public SASIDEV
eCmdEnableInterface = 0x0E, // DaynaPort specific command
eCmdSetDriveParams = 0x0C, // Xebec s1410 specific command
eCmdRamDiagnostics = 0xE0, // Xebec s1410 specific command
eCmdDriveDiagnostics = 0xE4, // Xebec s1410 specific command
eCmdDriveDiagnostics = 0xE3, // Xebec s1410 specific command
eCmdCntrlDiagnostics = 0xE4, // Xebec s1410 specific command
eCmdInquiry = 0x12,
eCmdModeSelect6 = 0x15,
Expand Down
69 changes: 68 additions & 1 deletion src/raspberrypi/devices/disk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Disk::Disk(const std::string id) : Device(id), ScsiPrimaryCommands(), ScsiBlockC
AddCommand(SCSIDEV::eCmdSetDriveParams, "SetDriveParams", &Disk::SetDriveParams);
AddCommand(SCSIDEV::eCmdRamDiagnostics, "RamDiagnostics", &Disk::RamDiagnostics);
AddCommand(SCSIDEV::eCmdDriveDiagnostics, "DriveDiagnostics", &Disk::DriveDiagnostics);
AddCommand(SCSIDEV::eCmdCntrlDiagnostics, "ControllerDiagnostics", &Disk::CntrlDiagnostics);
AddCommand(SCSIDEV::eCmdCntrlDiagnostics, "ControllerDiagnostics", &Disk::ControllerDiagnostics);
}

Disk::~Disk()
Expand Down Expand Up @@ -1458,6 +1458,73 @@ void Disk::ReportLuns(SASIDEV *controller)
controller->DataIn();
}

//
// SET DRIVE PARAMS
//
// The Xebec s1410 requests that hosts send an initialization of drive
// characteristics before issuing other commands as part of the board
// bootup process. RaSCSI doesn't support this use case. However, the
// Victor 9000 requires a positive repsonse before proceeding with
// additional checks as part of the startup process. We respond with
// an OK status.
//
//---------------------------------------------------------------------------
void Disk::SetDriveParams(SASIDEV *controller)
{
LOGTRACE("%s Status $%02X, Sense Key $%02X, ASC $%02X",__PRETTY_FUNCTION__, ctrl->status, ctrl->buffer[2], ctrl->buffer[12]);

controller->Status();
}

//
// RAM DIAGNOSTICS
//
// The Xebec s1410 requests that hosts request a RAM diagnostics of the
// SASI controller prior to working with the drive. This command verifies
// that the sector buffer is operational by writing, reading and verifying
// various data patterns to and from all locations. RaSCSI doesn't
// support this use case. However, the Victor 9000 requires a
// positive repsonse before proceeding with additional checks as part
// of the startup process. We respond with an OK status.
//
//---------------------------------------------------------------------------
void Disk::RamDiagnostics(SASIDEV *controller)
{
controller->Status();
}

//
// DRIVE DIAGNOSTICS
//
// The Xebec s1410 requests that hosts request a drive diagnostics from the
// SASI controller prior to working with the drive. The diagnostic involved
// steping through all tracks and verifying the ECC on the identifier fields
// of the first sector of each track. RaSCSI doesn't
// support this use case. However, the Victor 9000 requires a
// positive repsonse before proceeding with additional checks as part
// of the startup process. We respond with an OK status.
//
//---------------------------------------------------------------------------
void Disk::DriveDiagnostics(SASIDEV *controller)
{
controller->Status();
}

//
// CONTROLLER DIAGNOSTICS
//
// The Xebec s1410 requests that hosts request a controller self-test from the
// SASI board prior to working with the drive. RaSCSI doesn't
// support this use case. However, the Victor 9000 requires a
// positive repsonse before proceeding with additional checks as part
// of the startup process. We respond with an OK status.
//
//---------------------------------------------------------------------------
void Disk::ControllerDiagnostics(SASIDEV *controller)
{
controller->Status();
}

//---------------------------------------------------------------------------
//
// RESERVE(6)
Expand Down
8 changes: 4 additions & 4 deletions src/raspberrypi/devices/disk.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ class Disk : public Device, ScsiPrimaryCommands, ScsiBlockCommands
void ReadCapacity10(SASIDEV *) override;
void ReadCapacity16(SASIDEV *) override;
void ReportLuns(SASIDEV *) override;
void SetDriveParams(SASIDEV *);
void RamDiagnostics(SASIDEV *);
void DriveDiagnostics(SASIDEV *);
void ControllerDiagnostics(SASIDEV *);
void Reserve6(SASIDEV *);
void Reserve10(SASIDEV *);
void Release6(SASIDEV *);
Expand Down Expand Up @@ -144,10 +148,6 @@ class Disk : public Device, ScsiPrimaryCommands, ScsiBlockCommands
bool CheckBlockAddress(SASIDEV *, access_mode);
bool GetStartAndCount(SASIDEV *, uint64_t&, uint32_t&, access_mode);
bool CheckReady();
bool SetDriveParams();
bool RamDiagnostics();
bool DriveDiagnostics();
bool ControllerDiagnostics();

// TODO This method should not be called by SASIDEV
virtual bool ModeSelect(const DWORD *cdb, const BYTE *buf, int length);
Expand Down
2 changes: 1 addition & 1 deletion src/raspberrypi/devices/interfaces/scsi_primary_commands.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
n//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//
// SCSI Target Emulator RaSCSI (*^..^*)
// for Raspberry Pi
Expand Down

0 comments on commit ccc7e23

Please sign in to comment.