1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-29 12:50:28 +00:00
CLK/Storage/MassStorage/SCSI/DirectAccessDevice.hpp

38 lines
905 B
C++
Raw Normal View History

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.
//
#pragma once
2019-08-23 03:16:58 +00:00
#include "Target.hpp"
#include "../MassStorageDevice.hpp"
#include <memory>
2019-08-23 03:16:58 +00:00
namespace SCSI {
class DirectAccessDevice: public Target::Executor {
public:
/*!
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 &);
bool write(const Target::CommandState &, Target::Responder &);
Inquiry inquiry_values();
bool read_capacity(const Target::CommandState &, Target::Responder &);
bool format_unit(const Target::CommandState &, Target::Responder &);
private:
std::shared_ptr<Storage::MassStorage::MassStorageDevice> device_;
2019-08-23 03:16:58 +00:00
};
}