2019-08-23 03:16:58 +00:00
|
|
|
//
|
|
|
|
// DirectAccessDevice.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 22/08/2019.
|
|
|
|
// Copyright © 2019 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2024-01-17 04:34:46 +00:00
|
|
|
#pragma once
|
2019-08-23 03:16:58 +00:00
|
|
|
|
|
|
|
#include "Target.hpp"
|
2019-08-25 21:03:41 +00:00
|
|
|
#include "../MassStorageDevice.hpp"
|
|
|
|
|
|
|
|
#include <memory>
|
2019-08-23 03:16:58 +00:00
|
|
|
|
|
|
|
namespace SCSI {
|
|
|
|
|
|
|
|
class DirectAccessDevice: public Target::Executor {
|
|
|
|
public:
|
2019-08-25 21:03:41 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
Sets the backing storage exposed by this direct-access device.
|
|
|
|
*/
|
|
|
|
void set_storage(const std::shared_ptr<Storage::MassStorage::MassStorageDevice> &device);
|
|
|
|
|
|
|
|
/* SCSI commands. */
|
2019-08-23 03:16:58 +00:00
|
|
|
bool read(const Target::CommandState &, Target::Responder &);
|
2019-09-13 01:58:09 +00:00
|
|
|
bool write(const Target::CommandState &, Target::Responder &);
|
2019-09-09 01:59:56 +00:00
|
|
|
Inquiry inquiry_values();
|
2019-09-12 01:52:02 +00:00
|
|
|
bool read_capacity(const Target::CommandState &, Target::Responder &);
|
2019-09-13 01:58:09 +00:00
|
|
|
bool format_unit(const Target::CommandState &, Target::Responder &);
|
2019-08-25 21:03:41 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::shared_ptr<Storage::MassStorage::MassStorageDevice> device_;
|
2019-08-23 03:16:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|