mirror of
https://github.com/akuker/RASCSI.git
synced 2024-06-08 20:29:30 +00:00
9099d7249c
* Fixed opcode
* Fixed segfault
* Re-added 0x06 as additional SASI FORMAT opcode
* Added support of SASI drives with 512 bytes
* SASI LUN must always be taken from CDB and must be 0 or 1
* Fixed typo
* Fixed one more SASI segfault
* Removed duplicate code
* Updated error handling
* Updated error handling
* Logging update
* Added enum value for SPC-6
* Comment update
* Added support for SASI Inquiry
* Updated SASI LUN check
* Updated SASI LUN handling
* Comment update
* Revert "Comment update"
This reverts commit c6adbde25c
.
* Updated logging
* Implemented SASI READ CAPACITY
* Validate SASI block count
* Do not support ICD semantics for SASI drives
* SASI READ CAPACITY is a group 1 command with 10 bytes
* Comment update
55 lines
1.3 KiB
C++
55 lines
1.3 KiB
C++
//---------------------------------------------------------------------------
|
|
//
|
|
// SCSI Target Emulator RaSCSI (*^..^*)
|
|
// for Raspberry Pi
|
|
//
|
|
// Copyright (C) 2022 Uwe Seimet
|
|
//
|
|
// A device implementing mandatory SCSI primary commands, to be used for subclassing
|
|
//
|
|
//---------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "controllers/scsidev_ctrl.h"
|
|
#include "interfaces/scsi_primary_commands.h"
|
|
#include "device.h"
|
|
#include "dispatcher.h"
|
|
#include <string>
|
|
|
|
using namespace std;
|
|
|
|
class PrimaryDevice: public Device, virtual public ScsiPrimaryCommands
|
|
{
|
|
public:
|
|
|
|
PrimaryDevice(const string&);
|
|
virtual ~PrimaryDevice() {}
|
|
|
|
virtual bool Dispatch(SCSIDEV *);
|
|
|
|
void TestUnitReady(SASIDEV *);
|
|
void RequestSense(SASIDEV *);
|
|
virtual void Inquiry(SASIDEV *);
|
|
|
|
void SetCtrl(SASIDEV::ctrl_t *ctrl) { this->ctrl = ctrl; }
|
|
|
|
bool CheckReady();
|
|
virtual vector<BYTE> Inquiry() const = 0;
|
|
virtual vector<BYTE> RequestSense(int);
|
|
virtual bool WriteBytes(BYTE *, uint32_t);
|
|
virtual int GetSendDelay() const { return BUS::SEND_NO_DELAY; }
|
|
|
|
protected:
|
|
|
|
vector<BYTE> Inquiry(scsi_defs::device_type, scsi_level, bool) const;
|
|
|
|
SASIDEV::ctrl_t *ctrl;
|
|
|
|
private:
|
|
|
|
Dispatcher<PrimaryDevice, SASIDEV> dispatcher;
|
|
|
|
void ReportLuns(SASIDEV *);
|
|
};
|