2022-02-10 18:54:48 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// SCSI Target Emulator RaSCSI (*^..^*)
|
|
|
|
// for Raspberry Pi
|
|
|
|
//
|
|
|
|
// Copyright (C) 2022 Uwe Seimet
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "primary_device.h"
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
class ModePageDevice: public PrimaryDevice
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2022-02-13 19:30:02 +00:00
|
|
|
ModePageDevice(const string&);
|
2022-02-10 18:54:48 +00:00
|
|
|
virtual ~ModePageDevice() {}
|
|
|
|
|
|
|
|
virtual bool Dispatch(SCSIDEV *) override;
|
|
|
|
|
|
|
|
virtual int ModeSense6(const DWORD *, BYTE *) = 0;
|
|
|
|
virtual int ModeSense10(const DWORD *, BYTE *) = 0;
|
|
|
|
|
|
|
|
// TODO This method should not be called by SASIDEV
|
|
|
|
virtual bool ModeSelect(const DWORD *, const BYTE *, int);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2022-02-13 19:30:02 +00:00
|
|
|
typedef PrimaryDevice super;
|
2022-02-10 18:54:48 +00:00
|
|
|
|
2022-02-17 02:04:42 +00:00
|
|
|
Dispatcher<ModePageDevice, SASIDEV> dispatcher;
|
2022-02-10 18:54:48 +00:00
|
|
|
|
2022-02-13 19:30:02 +00:00
|
|
|
void ModeSense6(SASIDEV *);
|
|
|
|
void ModeSense10(SASIDEV *);
|
|
|
|
void ModeSelect6(SASIDEV *);
|
|
|
|
void ModeSelect10(SASIDEV *);
|
2022-02-10 18:54:48 +00:00
|
|
|
|
|
|
|
int ModeSelectCheck(const DWORD *, int);
|
|
|
|
int ModeSelectCheck6(const DWORD *);
|
|
|
|
int ModeSelectCheck10(const DWORD *);
|
|
|
|
};
|