mirror of
https://github.com/akuker/RASCSI.git
synced 2024-06-26 22:29:45 +00:00
* Added unit tests * Fixed SonarCloud issues * Updated error handling * Updated deletion of controllers * Image folder handling cleanup * Fixed clang warning * Removed duplicate code * Reduced code complexity * Updated array handling * Initialize device with ID and LUN * Use smart pointers * Updated memory management * Logging updates * Extracted methods * Split scsi.h
51 lines
1.1 KiB
C++
51 lines
1.1 KiB
C++
//---------------------------------------------------------------------------
|
|
//
|
|
// SCSI Target Emulator RaSCSI Reloaded
|
|
// for Raspberry Pi
|
|
//
|
|
// Copyright (C) 2022 Uwe Seimet
|
|
//
|
|
//---------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "primary_device.h"
|
|
#include <string>
|
|
#include <vector>
|
|
#include <map>
|
|
|
|
class ModePageDevice: public PrimaryDevice
|
|
{
|
|
public:
|
|
|
|
ModePageDevice(const string&, int);
|
|
~ModePageDevice()override = default;
|
|
|
|
bool Dispatch(scsi_command) override;
|
|
|
|
virtual void ModeSelect(const vector<int>&, const vector<BYTE>&, int) const;
|
|
|
|
protected:
|
|
|
|
int AddModePages(const vector<int>&, vector<BYTE>&, int, int) const;
|
|
virtual void SetUpModePages(map<int, vector<byte>>&, int, bool) const = 0;
|
|
|
|
private:
|
|
|
|
using super = PrimaryDevice;
|
|
|
|
Dispatcher<ModePageDevice> dispatcher;
|
|
|
|
virtual int ModeSense6(const vector<int>&, vector<BYTE>&) const = 0;
|
|
virtual int ModeSense10(const vector<int>&, vector<BYTE>&) const = 0;
|
|
|
|
void ModeSense6();
|
|
void ModeSense10();
|
|
void ModeSelect6();
|
|
void ModeSelect10();
|
|
|
|
int ModeSelectCheck(int) const;
|
|
int ModeSelectCheck6() const;
|
|
int ModeSelectCheck10() const;
|
|
};
|