From a3a53354cc585e8cbcd1f78420379d1c31ba022b Mon Sep 17 00:00:00 2001 From: Uwe Seimet <48174652+uweseimet@users.noreply.github.com> Date: Tue, 26 Apr 2022 22:08:28 +0200 Subject: [PATCH] Fix issue 750 (Daynaport problems in develop branch) (#754) INQUIRY for the Daynaport can return up to 37 bytes. The additional length field for the Daynaport is now 0x20 instead of 0x1b. --- src/raspberrypi/devices/scsi_daynaport.cpp | 17 +++++++++++++++-- src/raspberrypi/rascsi_version.cpp | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/raspberrypi/devices/scsi_daynaport.cpp b/src/raspberrypi/devices/scsi_daynaport.cpp index 5d3b9625..a763a77f 100644 --- a/src/raspberrypi/devices/scsi_daynaport.cpp +++ b/src/raspberrypi/devices/scsi_daynaport.cpp @@ -60,6 +60,13 @@ SCSIDaynaPort::~SCSIDaynaPort() bool SCSIDaynaPort::Dispatch(SCSIDEV *controller) { + // TODO As long as DaynaPort suffers from being a subclass of Disk at least reject MODE SENSE and MODE SELECT + SASIDEV::ctrl_t *ctrl = controller->GetCtrl(); + if (ctrl->cmd[0] == eCmdModeSense6 || ctrl->cmd[0] == eCmdModeSelect6 || + ctrl->cmd[0] == eCmdModeSense10 || ctrl->cmd[0] == eCmdModeSelect10) { + return false; + } + // The superclass class handles the less specific commands return dispatcher.Dispatch(this, controller) ? true : super::Dispatch(controller); } @@ -69,7 +76,6 @@ bool SCSIDaynaPort::Init(const unordered_map& params) SetParams(params); #ifdef __linux__ - // TAP Driver Generation m_tap = new CTapDriver(); m_bTapEnable = m_tap->Init(GetParams()); if(!m_bTapEnable){ @@ -114,7 +120,14 @@ void SCSIDaynaPort::Open(const Filepath& path) vector SCSIDaynaPort::Inquiry() const { - return PrimaryDevice::Inquiry(device_type::PROCESSOR, scsi_level::SCSI_2, false); + vector buf = PrimaryDevice::Inquiry(device_type::PROCESSOR, scsi_level::SCSI_2, false); + + // The Daynaport driver for the Mac expects 37 bytes: Increase additional length and + // add a vendor-specific byte in order to satisfy this driver. + buf[4]++; + buf.push_back(0); + + return buf; } //--------------------------------------------------------------------------- diff --git a/src/raspberrypi/rascsi_version.cpp b/src/raspberrypi/rascsi_version.cpp index 733b8c5f..cbcebd28 100644 --- a/src/raspberrypi/rascsi_version.cpp +++ b/src/raspberrypi/rascsi_version.cpp @@ -13,7 +13,7 @@ // The following should be updated for each release const int rascsi_major_version = 22; // Last two digits of year -const int rascsi_minor_version = 03; // Month +const int rascsi_minor_version = 04; // Month const int rascsi_patch_version = -1; // Patch number - increment for each update static char rascsi_version_string[30]; // Allow for string up to "XX.XX.XXX" + null character + "development build"