diff --git a/cpp/controllers/scsi_controller.cpp b/cpp/controllers/scsi_controller.cpp index 26bb553e..762d0868 100644 --- a/cpp/controllers/scsi_controller.cpp +++ b/cpp/controllers/scsi_controller.cpp @@ -433,10 +433,7 @@ void ScsiController::Send() if (HasValidLength()) { LogTrace("Sending data, offset: " + to_string(GetOffset()) + ", length: " + to_string(GetLength())); - // The delay should be taken from the respective LUN, but as there are no Daynaport drivers for - // LUNs other than 0 this work-around works. - if (const int len = GetBus().SendHandShake(GetBuffer().data() + GetOffset(), GetLength(), - HasDeviceForLun(0) ? GetDeviceForLun(0)->GetSendDelay() : 0); + if (const int len = GetBus().SendHandShake(GetBuffer().data() + GetOffset(), GetLength()); len != static_cast(GetLength())) { // If you cannot send all, move to status phase Error(sense_key::aborted_command); diff --git a/cpp/devices/primary_device.h b/cpp/devices/primary_device.h index c30bc123..1959c7e9 100644 --- a/cpp/devices/primary_device.h +++ b/cpp/devices/primary_device.h @@ -46,8 +46,6 @@ public: virtual bool WriteByteSequence(span); - int GetSendDelay() const { return send_delay; } - bool CheckReservation(int, scsi_command, bool) const; void DiscardReservation(); @@ -71,8 +69,6 @@ protected: virtual vector InquiryInternal() const = 0; void CheckReady(); - void SetSendDelay(int s) { send_delay = s; } - void SendDiagnostic() override; void ReserveUnit() override; void ReleaseUnit() override; @@ -110,7 +106,5 @@ private: unordered_map commands; - int send_delay = BUS::SEND_NO_DELAY; - int reserving_initiator = NOT_RESERVED; }; diff --git a/cpp/devices/scsi_daynaport.cpp b/cpp/devices/scsi_daynaport.cpp index a945bd17..3d14c993 100644 --- a/cpp/devices/scsi_daynaport.cpp +++ b/cpp/devices/scsi_daynaport.cpp @@ -50,10 +50,6 @@ bool SCSIDaynaPort::Init(const param_map& params) AddCommand(scsi_command::eCmdSetMcastAddr, [this] { SetMcastAddr(); }); AddCommand(scsi_command::eCmdEnableInterface, [this] { EnableInterface(); }); - // The Daynaport needs to have a delay after the size/flags field of the read response. - // In the MacOS driver, it looks like the driver is doing two "READ" system calls. - SetSendDelay(DAYNAPORT_READ_HEADER_SZ); - tap_enabled = tap.Init(GetParams()); if (!tap_enabled) { // Not terminating on regular Linux PCs is helpful for testing diff --git a/cpp/hal/bus.h b/cpp/hal/bus.h index 23740fe2..8c1f49e2 100644 --- a/cpp/hal/bus.h +++ b/cpp/hal/bus.h @@ -92,7 +92,7 @@ class BUS : public PinControl virtual unique_ptr GetSample(uint64_t timestamp = 0) = 0; virtual int CommandHandShake(vector &) = 0; virtual int ReceiveHandShake(uint8_t *buf, int count) = 0; - virtual int SendHandShake(uint8_t *buf, int count, int delay_after_bytes) = 0; + virtual int SendHandShake(uint8_t *buf, int count) = 0; // SEL signal event polling virtual bool PollSelectEvent() = 0; diff --git a/cpp/hal/gpiobus.cpp b/cpp/hal/gpiobus.cpp index f4ec559d..937ce869 100644 --- a/cpp/hal/gpiobus.cpp +++ b/cpp/hal/gpiobus.cpp @@ -266,7 +266,7 @@ int GPIOBUS::ReceiveHandShake(uint8_t *buf, int count) // Data transmission handshake // //--------------------------------------------------------------------------- -int GPIOBUS::SendHandShake(uint8_t *buf, int count, int) +int GPIOBUS::SendHandShake(uint8_t *buf, int count) { GPIO_FUNCTION_TRACE int i; diff --git a/cpp/hal/gpiobus.h b/cpp/hal/gpiobus.h index 7dbff55c..bf28cfd8 100644 --- a/cpp/hal/gpiobus.h +++ b/cpp/hal/gpiobus.h @@ -172,7 +172,7 @@ class GPIOBUS : public BUS // Data receive handshake int ReceiveHandShake(uint8_t *, int) override; // Data transmission handshake - int SendHandShake(uint8_t *, int, int) override; + int SendHandShake(uint8_t *, int) override; // SEL signal event polling bool PollSelectEvent() override; diff --git a/cpp/scsidump/scsidump_core.cpp b/cpp/scsidump/scsidump_core.cpp index 41c1dabd..55bb6780 100644 --- a/cpp/scsidump/scsidump_core.cpp +++ b/cpp/scsidump/scsidump_core.cpp @@ -214,7 +214,7 @@ void ScsiDump::Command(scsi_command cmd, vector& cdb) const cdb[0] = static_cast(cmd); cdb[1] = static_cast(static_cast(cdb[1]) | static_cast(target_lun << 5)); if (static_cast(cdb.size()) != - bus->SendHandShake(cdb.data(), static_cast(cdb.size()), BUS::SEND_NO_DELAY)) { + bus->SendHandShake(cdb.data(), static_cast(cdb.size()))) { BusFree(); throw phase_exception(command_mapping.find(cmd)->second.second + string(" failed")); @@ -234,7 +234,7 @@ void ScsiDump::DataOut(int length) { WaitForPhase(phase_t::dataout); - if (!bus->SendHandShake(buffer.data(), length, BUS::SEND_NO_DELAY)) { + if (!bus->SendHandShake(buffer.data(), length)) { throw phase_exception("DATA OUT failed"); } } diff --git a/cpp/test/mocks.h b/cpp/test/mocks.h index fcf45cd5..044fddd2 100644 --- a/cpp/test/mocks.h +++ b/cpp/test/mocks.h @@ -57,7 +57,7 @@ public: MOCK_METHOD(uint32_t, Acquire, (), (override)); MOCK_METHOD(int, CommandHandShake, (vector&), (override)); MOCK_METHOD(int, ReceiveHandShake, (uint8_t *, int), (override)); - MOCK_METHOD(int, SendHandShake, (uint8_t *, int, int), (override)); + MOCK_METHOD(int, SendHandShake, (uint8_t *, int), (override)); MOCK_METHOD(bool, GetSignal, (int), (const override)); MOCK_METHOD(void, SetSignal, (int, bool), (override)); MOCK_METHOD(bool, PollSelectEvent, (), (override)); diff --git a/cpp/test/primary_device_test.cpp b/cpp/test/primary_device_test.cpp index 0a3739a0..3fdb4b8b 100644 --- a/cpp/test/primary_device_test.cpp +++ b/cpp/test/primary_device_test.cpp @@ -339,15 +339,6 @@ TEST(PrimaryDeviceTest, WriteByteSequence) EXPECT_FALSE(device->WriteByteSequence({})) << "Primary device does not support writing byte sequences"; } -TEST(PrimaryDeviceTest, GetSetSendDelay) -{ - MockPrimaryDevice device(0); - - EXPECT_EQ(-1, device.GetSendDelay()) << "Wrong delay default value"; - device.SetSendDelay(1234); - EXPECT_EQ(1234, device.GetSendDelay()); -} - TEST(PrimaryDeviceTest, Init) { param_map params; diff --git a/cpp/test/scsi_daynaport_test.cpp b/cpp/test/scsi_daynaport_test.cpp index 712b3b38..e2a434be 100644 --- a/cpp/test/scsi_daynaport_test.cpp +++ b/cpp/test/scsi_daynaport_test.cpp @@ -177,11 +177,3 @@ TEST(ScsiDaynaportTest, EnableInterface) Property(&scsi_exception::get_sense_key, sense_key::aborted_command), Property(&scsi_exception::get_asc, asc::no_additional_sense_information)))); } - -TEST(ScsiDaynaportTest, GetSendDelay) -{ - SCSIDaynaPort daynaport(0); - daynaport.Init({}); - - EXPECT_EQ(6, daynaport.GetSendDelay()); -}