From 15e82a6e815ce8f34ef182a069a02cf99cabfb5f Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Tue, 10 Dec 2024 11:34:40 +0100 Subject: [PATCH] Remove interface header files, they are not useful anymore --- cpp/base/interfaces/scsi_block_commands.h | 32 ----------------- .../interfaces/scsi_communications_commands.h | 29 ---------------- cpp/base/interfaces/scsi_mmc_commands.h | 25 -------------- cpp/base/interfaces/scsi_primary_commands.h | 34 ------------------- cpp/base/interfaces/scsi_printer_commands.h | 28 --------------- cpp/base/interfaces/scsi_stream_commands.h | 32 ----------------- cpp/base/primary_device.h | 21 +++++------- cpp/devices/daynaport.h | 8 ++--- cpp/devices/disk.h | 17 +++++----- cpp/devices/printer.h | 6 ++-- cpp/devices/scsi_cd.h | 5 ++- cpp/devices/tape.cpp | 7 +--- cpp/devices/tape.h | 16 ++++----- 13 files changed, 31 insertions(+), 229 deletions(-) delete mode 100644 cpp/base/interfaces/scsi_block_commands.h delete mode 100644 cpp/base/interfaces/scsi_communications_commands.h delete mode 100644 cpp/base/interfaces/scsi_mmc_commands.h delete mode 100644 cpp/base/interfaces/scsi_primary_commands.h delete mode 100644 cpp/base/interfaces/scsi_printer_commands.h delete mode 100644 cpp/base/interfaces/scsi_stream_commands.h diff --git a/cpp/base/interfaces/scsi_block_commands.h b/cpp/base/interfaces/scsi_block_commands.h deleted file mode 100644 index d547269b..00000000 --- a/cpp/base/interfaces/scsi_block_commands.h +++ /dev/null @@ -1,32 +0,0 @@ -//--------------------------------------------------------------------------- -// -// SCSI2Pi, SCSI device emulator and SCSI tools for the Raspberry Pi -// -// Copyright (C) 2021-2024 Uwe Seimet -// -// Interface for SCSI block commands (see https://www.t10.org/drafts.htm, SBC-5) -// -//--------------------------------------------------------------------------- - -#pragma once - -class ScsiBlockCommands -{ - -public: - - virtual ~ScsiBlockCommands() = default; - - // Mandatory commands - virtual void FormatUnit() = 0; - virtual void ReadCapacity10() = 0; - virtual void ReadCapacity16() = 0; - virtual void Read10() = 0; - virtual void Read16() = 0; - virtual void Write10() = 0; - virtual void Write16() = 0; - -protected: - - ScsiBlockCommands() = default; -}; diff --git a/cpp/base/interfaces/scsi_communications_commands.h b/cpp/base/interfaces/scsi_communications_commands.h deleted file mode 100644 index 8cf77545..00000000 --- a/cpp/base/interfaces/scsi_communications_commands.h +++ /dev/null @@ -1,29 +0,0 @@ -//--------------------------------------------------------------------------- -// -// SCSI2Pi, SCSI device emulator and SCSI tools for the Raspberry Pi -// -// Copyright (C) 2024 Uwe Seimet -// -// Interface for SCSI communications devices commands (see SCSI-2 specification) -// -//--------------------------------------------------------------------------- - -#pragma once - -class ScsiCommunicationsCommands -{ - -public: - - virtual ~ScsiCommunicationsCommands() = default; - - // Mandatory commands - virtual void SendMessage6() const = 0; - - // Optional commands - virtual void GetMessage6() = 0; - -protected: - - ScsiCommunicationsCommands() = default; -}; diff --git a/cpp/base/interfaces/scsi_mmc_commands.h b/cpp/base/interfaces/scsi_mmc_commands.h deleted file mode 100644 index ad86773d..00000000 --- a/cpp/base/interfaces/scsi_mmc_commands.h +++ /dev/null @@ -1,25 +0,0 @@ -//--------------------------------------------------------------------------- -// -// SCSI2Pi, SCSI device emulator and SCSI tools for the Raspberry Pi -// -// Copyright (C) 2021-2024 Uwe Seimet -// -// Interface for SCSI Multi-Media commands (see https://www.t10.org/drafts.htm, MMC-6) -// -//--------------------------------------------------------------------------- - -#pragma once - -class ScsiMmcCommands -{ - -public: - - virtual ~ScsiMmcCommands() = default; - - virtual void ReadToc() = 0; - -protected: - - ScsiMmcCommands() = default; -}; diff --git a/cpp/base/interfaces/scsi_primary_commands.h b/cpp/base/interfaces/scsi_primary_commands.h deleted file mode 100644 index af0587dc..00000000 --- a/cpp/base/interfaces/scsi_primary_commands.h +++ /dev/null @@ -1,34 +0,0 @@ -//--------------------------------------------------------------------------- -// -// SCSI2Pi, SCSI device emulator and SCSI tools for the Raspberry Pi -// -// Copyright (C) 2021-2024 Uwe Seimet -// -// Interface for SCSI primary commands (see https://www.t10.org/drafts.htm, SPC-6) -// -//--------------------------------------------------------------------------- - -#pragma once - -class ScsiPrimaryCommands -{ - -public: - - virtual ~ScsiPrimaryCommands() = default; - - // Mandatory commands - virtual void TestUnitReady() = 0; - virtual void Inquiry() = 0; - virtual void ReportLuns() = 0; - - // Optional commands implemented by all device types - virtual void RequestSense() = 0; - virtual void ReleaseUnit() = 0; - virtual void ReserveUnit() = 0; - virtual void SendDiagnostic() = 0; - -protected: - - ScsiPrimaryCommands() = default; -}; diff --git a/cpp/base/interfaces/scsi_printer_commands.h b/cpp/base/interfaces/scsi_printer_commands.h deleted file mode 100644 index 6e63ec29..00000000 --- a/cpp/base/interfaces/scsi_printer_commands.h +++ /dev/null @@ -1,28 +0,0 @@ -//--------------------------------------------------------------------------- -// -// SCSI2Pi, SCSI device emulator and SCSI tools for the Raspberry Pi -// -// Copyright (C) 2021-2024 Uwe Seimet -// -// Interface for SCSI printer commands (see SCSI-2 specification) -// -//--------------------------------------------------------------------------- - -#pragma once - -class ScsiPrinterCommands -{ - -public: - - virtual ~ScsiPrinterCommands() = default; - - // Mandatory commands - virtual void Print() = 0; - - // ReleaseUnit(), ReserveUnit() and SendDiagnostic() are contributed by PrimaryDevice - -protected: - - ScsiPrinterCommands() = default; -}; diff --git a/cpp/base/interfaces/scsi_stream_commands.h b/cpp/base/interfaces/scsi_stream_commands.h deleted file mode 100644 index cc1326c4..00000000 --- a/cpp/base/interfaces/scsi_stream_commands.h +++ /dev/null @@ -1,32 +0,0 @@ -//--------------------------------------------------------------------------- -// -// SCSI2Pi, SCSI device emulator and SCSI tools for the Raspberry Pi -// -// Copyright (C) 2024 Uwe Seimet -// -// Interface for SCSI streamer commands (see SCSI-2 and SSC-2 specification) -// -//--------------------------------------------------------------------------- - -#pragma once - -class ScsiStreamCommands -{ - -public: - - virtual ~ScsiStreamCommands() = default; - - // Mandatory commands - virtual void Erase6() = 0; - virtual void Read6() = 0; - virtual void ReadBlockLimits() = 0; - virtual void Rewind() = 0; - virtual void Space6() = 0; - virtual void Write6() = 0; - virtual void WriteFilemarks6() = 0; - -protected: - - ScsiStreamCommands() = default; -}; diff --git a/cpp/base/primary_device.h b/cpp/base/primary_device.h index 781f94d9..891fb76a 100644 --- a/cpp/base/primary_device.h +++ b/cpp/base/primary_device.h @@ -11,13 +11,12 @@ #pragma once #include -#include "interfaces/scsi_primary_commands.h" #include "controllers/abstract_controller.h" #include "shared/s2p_exceptions.h" #include "s2p_defs.h" #include "device.h" -class PrimaryDevice : public ScsiPrimaryCommands, public Device +class PrimaryDevice : public Device { friend class AbstractController; friend class PageHandler; @@ -26,8 +25,6 @@ class PrimaryDevice : public ScsiPrimaryCommands, public Device public: - ~PrimaryDevice() override = default; - bool Init(); virtual bool SetUp() = 0; virtual void CleanUp() @@ -111,13 +108,11 @@ class PrimaryDevice : public ScsiPrimaryCommands, public Device virtual vector InquiryInternal() const = 0; void CheckReady(); - void Inquiry() override; - void RequestSense() override; - - - void SendDiagnostic() override; - void ReserveUnit() override; - void ReleaseUnit() override; + virtual void Inquiry(); + virtual void RequestSense(); + void SendDiagnostic(); + void ReserveUnit(); + void ReleaseUnit(); virtual int ModeSense6(cdb_t, data_in_t) const { @@ -191,8 +186,8 @@ class PrimaryDevice : public ScsiPrimaryCommands, public Device void SetController(AbstractController*); - void TestUnitReady() override; - void ReportLuns() override; + void TestUnitReady(); + void ReportLuns(); vector HandleRequestSense() const; diff --git a/cpp/devices/daynaport.h b/cpp/devices/daynaport.h index 17390066..6d8a7c63 100644 --- a/cpp/devices/daynaport.h +++ b/cpp/devices/daynaport.h @@ -27,17 +27,15 @@ #ifndef __NetBSD__ #include #endif -#include "base/interfaces/scsi_communications_commands.h" #include "base/primary_device.h" #include "tap_driver.h" -class DaynaPort : public PrimaryDevice, public ScsiCommunicationsCommands +class DaynaPort : public PrimaryDevice { public: explicit DaynaPort(int); - ~DaynaPort() override = default; bool SetUp() override; void CleanUp() override; @@ -50,8 +48,8 @@ class DaynaPort : public PrimaryDevice, public ScsiCommunicationsCommands vector InquiryInternal() const override; int WriteData(cdb_t, data_out_t, int, int) override; - void GetMessage6() override; - void SendMessage6() const override; + void GetMessage6(); + void SendMessage6() const; void RetrieveStats() const; void SetInterfaceMode() const; void SetMcastAddr() const; diff --git a/cpp/devices/disk.h b/cpp/devices/disk.h index 8a70cdf6..3da7ef1b 100644 --- a/cpp/devices/disk.h +++ b/cpp/devices/disk.h @@ -14,14 +14,13 @@ #pragma once #include -#include "base/interfaces/scsi_block_commands.h" #include "storage_device.h" using namespace std; class Cache; -class Disk : public StorageDevice, public ScsiBlockCommands +class Disk : public StorageDevice { public: @@ -82,11 +81,11 @@ class Disk : public StorageDevice, public ScsiBlockCommands { Read(RW6); } - void Read10() override + void Read10() { Read(RW10); } - void Read16() override + void Read16() { Read(RW16); } @@ -94,20 +93,20 @@ class Disk : public StorageDevice, public ScsiBlockCommands { Write(RW6); } - void Write10() override + void Write10() { Write(RW10); } - void Write16() override + void Write16() { Write(RW16); } void ReAssignBlocks(); void Seek10(); - void ReadCapacity10() override; - void ReadCapacity16() override; + void ReadCapacity10(); + void ReadCapacity16(); void ReadFormatCapacities(); - void FormatUnit() override; + void FormatUnit(); void Seek6(); void Read(access_mode); void Write(access_mode); diff --git a/cpp/devices/printer.h b/cpp/devices/printer.h index 69a60b9d..407f6dbd 100644 --- a/cpp/devices/printer.h +++ b/cpp/devices/printer.h @@ -11,18 +11,16 @@ #include #include -#include "base/interfaces/scsi_printer_commands.h" #include "base/primary_device.h" using namespace std; -class Printer : public PrimaryDevice, public ScsiPrinterCommands +class Printer : public PrimaryDevice { public: explicit Printer(int); - ~Printer() override = default; bool SetUp() override; void CleanUp() override; @@ -39,7 +37,7 @@ class Printer : public PrimaryDevice, public ScsiPrinterCommands private: - void Print() override; + void Print(); void SynchronizeBuffer(); string file_template; diff --git a/cpp/devices/scsi_cd.h b/cpp/devices/scsi_cd.h index 8826bbf0..d293c43d 100644 --- a/cpp/devices/scsi_cd.h +++ b/cpp/devices/scsi_cd.h @@ -8,10 +8,9 @@ #pragma once -#include "base/interfaces/scsi_mmc_commands.h" #include "disk.h" -class ScsiCd : public Disk, public ScsiMmcCommands +class ScsiCd : public Disk { public: @@ -33,7 +32,7 @@ class ScsiCd : public Disk, public ScsiMmcCommands private: - void ReadToc() override; + void ReadToc(); void CreateDataTrack(); diff --git a/cpp/devices/tape.cpp b/cpp/devices/tape.cpp index 135a42eb..a2cf54a8 100644 --- a/cpp/devices/tape.cpp +++ b/cpp/devices/tape.cpp @@ -61,7 +61,7 @@ bool Tape::SetUp() }); AddCommand(scsi_command::write_filemarks_6, [this] { - WriteFilemarks6(); + WriteFilemarks(false); }); AddCommand(scsi_command::write_filemarks_16, [this] { @@ -466,11 +466,6 @@ void Tape::Space6() StatusPhase(); } -void Tape::WriteFilemarks6() -{ - WriteFilemarks(false); -} - void Tape::WriteFilemarks(bool write_filemarks_16) { if (tar_file) { diff --git a/cpp/devices/tape.h b/cpp/devices/tape.h index 753efcf1..fdb29c93 100644 --- a/cpp/devices/tape.h +++ b/cpp/devices/tape.h @@ -9,14 +9,13 @@ #pragma once #include -#include "base/interfaces/scsi_stream_commands.h" #include "shared/simh_util.h" #include "storage_device.h" using namespace std; using namespace simh_util; -class Tape : public StorageDevice, public ScsiStreamCommands +class Tape : public StorageDevice { public: @@ -71,13 +70,12 @@ class Tape : public StorageDevice, public ScsiStreamCommands // Commands covered by the SCSI specifications (see https://www.t10.org/drafts.htm) - void Read6() override; - void Write6() override; - void Erase6() override; - void ReadBlockLimits() override; - void Rewind() override; - void Space6() override; - void WriteFilemarks6() override; + void Read6(); + void Write6(); + void Erase6(); + void ReadBlockLimits(); + void Rewind(); + void Space6(); void WriteFilemarks(bool); void FormatMedium(); void ReadPosition() const;