diff --git a/src/raspberrypi/devices/disk.cpp b/src/raspberrypi/devices/disk.cpp index b1144ee6..79b6e91b 100644 --- a/src/raspberrypi/devices/disk.cpp +++ b/src/raspberrypi/devices/disk.cpp @@ -36,7 +36,7 @@ // Constructor // //--------------------------------------------------------------------------- -Disk::Disk(const std::string id) : Device(id), PrimaryDevice(), BlockDevice() +Disk::Disk(const std::string id) : Device(id), ScsiPrimaryCommands(), ScsiBlockCommands() { // Work initialization configured_sector_size = 0; @@ -394,7 +394,7 @@ void Disk::Inquiry(SASIDEV *controller) // Find a valid unit // TODO The code below is probably wrong. It results in the same INQUIRY data being // used for all LUNs, even though each LUN has its individual set of INQUIRY data. - PrimaryDevice *device = NULL; + ScsiPrimaryCommands *device = NULL; for (int valid_lun = 0; valid_lun < SASIDEV::UnitMax; valid_lun++) { if (ctrl->unit[valid_lun]) { device = ctrl->unit[valid_lun]; diff --git a/src/raspberrypi/devices/disk.h b/src/raspberrypi/devices/disk.h index 59f92f9e..d417900b 100644 --- a/src/raspberrypi/devices/disk.h +++ b/src/raspberrypi/devices/disk.h @@ -21,8 +21,6 @@ #include "log.h" #include "scsi.h" #include "controllers/scsidev_ctrl.h" -#include "primary_device.h" -#include "block_device.h" #include "device.h" #include "disk_track_cache.h" #include "file_support.h" @@ -30,8 +28,10 @@ #include #include #include +#include "scsi_block_commands.h" +#include "scsi_primary_commands.h" -class Disk : public Device, public PrimaryDevice, public BlockDevice +class Disk : public Device, public ScsiPrimaryCommands, public ScsiBlockCommands { private: enum access_mode { RW6, RW10, RW16 }; diff --git a/src/raspberrypi/devices/block_device.h b/src/raspberrypi/devices/scsi_block_commands.h similarity index 88% rename from src/raspberrypi/devices/block_device.h rename to src/raspberrypi/devices/scsi_block_commands.h index 8511c227..ac664438 100644 --- a/src/raspberrypi/devices/block_device.h +++ b/src/raspberrypi/devices/scsi_block_commands.h @@ -5,7 +5,7 @@ // // Copyright (C) 2021 Uwe Seimet // -// A BlockDevice supports SCSI block commands (see https://www.t10.org/drafts.htm, SBC-5) +// Interface for SCSI block commands (see https://www.t10.org/drafts.htm, SBC-5) // //--------------------------------------------------------------------------- @@ -13,12 +13,12 @@ class SASIDEV; -class BlockDevice +class ScsiBlockCommands { public: - BlockDevice() {}; - virtual ~BlockDevice() {}; + ScsiBlockCommands() {}; + virtual ~ScsiBlockCommands() {}; // Mandatory commands virtual void TestUnitReady(SASIDEV *) = 0; diff --git a/src/raspberrypi/devices/mmc_device.h b/src/raspberrypi/devices/scsi_mmc_commands.h similarity index 72% rename from src/raspberrypi/devices/mmc_device.h rename to src/raspberrypi/devices/scsi_mmc_commands.h index deff28d4..55353c01 100644 --- a/src/raspberrypi/devices/mmc_device.h +++ b/src/raspberrypi/devices/scsi_mmc_commands.h @@ -5,7 +5,7 @@ // // Copyright (C) 2021 Uwe Seimet // -// An MmcDevice supports SCSI MMC commands (see https://www.t10.org/drafts.htm, MMC-6) +// Interface for SCSI MMC commands (see https://www.t10.org/drafts.htm, MMC-6) // //--------------------------------------------------------------------------- @@ -13,12 +13,12 @@ class SASIDEV; -class MmcDevice +class ScsiMmcCommands { public: - MmcDevice() {}; - virtual ~MmcDevice() {}; + ScsiMmcCommands() {}; + virtual ~ScsiMmcCommands() {}; virtual void ReadToc(SASIDEV *) = 0; virtual void GetEventStatusNotification(SASIDEV *) = 0; diff --git a/src/raspberrypi/devices/primary_device.h b/src/raspberrypi/devices/scsi_primary_commands.h similarity index 80% rename from src/raspberrypi/devices/primary_device.h rename to src/raspberrypi/devices/scsi_primary_commands.h index 7909940e..72cfa8c4 100644 --- a/src/raspberrypi/devices/primary_device.h +++ b/src/raspberrypi/devices/scsi_primary_commands.h @@ -5,7 +5,7 @@ // // Copyright (C) 2021 Uwe Seimet // -// A PrimaryDevice supports SCSI primary commands (see https://www.t10.org/drafts.htm, SPC-6) +// Interface for SCSI primary commands (see https://www.t10.org/drafts.htm, SPC-6) // //--------------------------------------------------------------------------- @@ -13,12 +13,12 @@ class SASIDEV; -class PrimaryDevice +class ScsiPrimaryCommands { public: - PrimaryDevice() {}; - virtual ~PrimaryDevice() {}; + ScsiPrimaryCommands() {}; + virtual ~ScsiPrimaryCommands() {}; // Mandatory commands virtual void TestUnitReady(SASIDEV *) = 0; diff --git a/src/raspberrypi/devices/scsicd.cpp b/src/raspberrypi/devices/scsicd.cpp index b3d75c7c..cc2ade36 100644 --- a/src/raspberrypi/devices/scsicd.cpp +++ b/src/raspberrypi/devices/scsicd.cpp @@ -225,7 +225,7 @@ bool CDTrack::IsAudio() const // Constructor // //--------------------------------------------------------------------------- -SCSICD::SCSICD() : Disk("SCCD"), MmcDevice(), FileSupport() +SCSICD::SCSICD() : Disk("SCCD"), ScsiMmcCommands(), FileSupport() { // NOT in raw format rawfile = false; diff --git a/src/raspberrypi/devices/scsicd.h b/src/raspberrypi/devices/scsicd.h index 26f381d6..6dd11fba 100644 --- a/src/raspberrypi/devices/scsicd.h +++ b/src/raspberrypi/devices/scsicd.h @@ -16,10 +16,10 @@ #pragma once #include "os.h" -#include "primary_device.h" -#include "mmc_device.h" #include "disk.h" #include "filepath.h" +#include "scsi_mmc_commands.h" +#include "scsi_primary_commands.h" //--------------------------------------------------------------------------- @@ -69,7 +69,7 @@ private: // SCSI CD-ROM // //=========================================================================== -class SCSICD : public Disk, public MmcDevice, public FileSupport +class SCSICD : public Disk, public ScsiMmcCommands, public FileSupport { private: typedef struct _command_t {