MCPcopy Create free account
hub / github.com/PiSCSI/piscsi / Init

Method Init

cpp/devices/primary_device.cpp:20–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18using namespace scsi_command_util;
19
20bool PrimaryDevice::Init(const param_map& params)
21{
22 // Mandatory SCSI primary commands
23 AddCommand(scsi_command::eCmdTestUnitReady, [this] { TestUnitReady(); });
24 AddCommand(scsi_command::eCmdInquiry, [this] { Inquiry(); });
25 AddCommand(scsi_command::eCmdReportLuns, [this] { ReportLuns(); });
26
27 // Optional commands supported by all PiSCSI devices
28 AddCommand(scsi_command::eCmdRequestSense, [this] { RequestSense(); });
29 AddCommand(scsi_command::eCmdReserve6, [this] { ReserveUnit(); });
30 AddCommand(scsi_command::eCmdRelease6, [this] { ReleaseUnit(); });
31 AddCommand(scsi_command::eCmdSendDiagnostic, [this] { SendDiagnostic(); });
32
33 SetParams(params);
34
35 return true;
36}
37
38void PrimaryDevice::AddCommand(scsi_command cmd, const operation& execute)
39{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected