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

Method ModeSense10

cpp/devices/host_services.cpp:98–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98int HostServices::ModeSense10(cdb_t cdb, vector<uint8_t>& buf) const
99{
100 // Block descriptors cannot be returned
101 if (!(cdb[1] & 0x08)) {
102 throw scsi_exception(sense_key::illegal_request, asc::invalid_field_in_cdb);
103 }
104
105 const auto length = static_cast<int>(min(buf.size(), static_cast<size_t>(GetInt16(cdb, 7))));
106 fill_n(buf.begin(), length, 0);
107
108 // 8 bytes basic information
109 const int size = AddModePages(cdb, buf, 8, length, 65535);
110
111 SetInt16(buf, 0, size);
112
113 return size;
114}
115
116void HostServices::SetUpModePages(map<int, vector<byte>>& pages, int page, bool changeable) const
117{

Callers

nothing calls this directly

Calls 3

scsi_exceptionClass · 0.85
SetInt16Function · 0.85
GetInt16Function · 0.70

Tested by

no test coverage detected