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

Method ModeSense6

cpp/devices/host_services.cpp:80–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80int HostServices::ModeSense6(cdb_t cdb, vector<uint8_t>& buf) const
81{
82 // Block descriptors cannot be returned
83 if (!(cdb[1] & 0x08)) {
84 throw scsi_exception(sense_key::illegal_request, asc::invalid_field_in_cdb);
85 }
86
87 const auto length = static_cast<int>(min(buf.size(), static_cast<size_t>(cdb[4])));
88 fill_n(buf.begin(), length, 0);
89
90 // 4 bytes basic information
91 const int size = AddModePages(cdb, buf, 4, length, 255);
92
93 buf[0] = (uint8_t)size;
94
95 return size;
96}
97
98int HostServices::ModeSense10(cdb_t cdb, vector<uint8_t>& buf) const
99{

Callers

nothing calls this directly

Calls 1

scsi_exceptionClass · 0.85

Tested by

no test coverage detected