| 96 | } |
| 97 | |
| 98 | int 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 | |
| 116 | void HostServices::SetUpModePages(map<int, vector<byte>>& pages, int page, bool changeable) const |
| 117 | { |
nothing calls this directly
no test coverage detected