diff --git a/smartmontools/ChangeLog b/smartmontools/ChangeLog
index a7525366..c53e847e 100644
a
|
b
|
|
1 | 1 | $Id$ |
2 | 2 | |
| 3 | 2023-12-21 cyrozap <cyrozap@gmail.com> |
| 4 | |
| 5 | scsinvme.cpp: Fix sntasmedia "Get Log Page" passthrough |
| 6 | |
3 | 7 | 2023-12-19 Christian Franke <franke@computer.org> |
4 | 8 | |
5 | 9 | os_win32/update-smart-drivedb.ps1.in: Fix call of external commands. |
diff --git a/smartmontools/scsinvme.cpp b/smartmontools/scsinvme.cpp
index f4fda25f..10f8eec3 100644
a
|
b
|
bool sntasmedia_device::nvme_pass_through(const nvme_cmd_in & in, nvme_cmd_out &
|
72 | 72 | case smartmontools::nvme_admin_get_log_page: |
73 | 73 | if (!(in.nsid == 0xffffffff || !in.nsid)) |
74 | 74 | return set_err(ENOSYS, "NVMe Get Log Page with NSID=0x%x not supported", in.nsid); |
75 | | if (size > 0x200) { // Reading more results in command timeout |
76 | | // TODO: Add ability to return short reads to caller |
77 | | size = 0x200; |
78 | | cdw10_hi = (size / 4) - 1; |
79 | | pout("Warning: NVMe Get Log truncated to 0x%03x bytes, 0x%03x bytes zero filled\n", size, in.size - size); |
80 | | } |
81 | 75 | break; |
82 | 76 | default: |
83 | 77 | return set_err(ENOSYS, "NVMe admin command 0x%02x not supported", in.opcode); |
84 | 78 | break; |
85 | 79 | } |
86 | | if (in.cdw11 || in.cdw12 || in.cdw13 || in.cdw14 || in.cdw15) |
87 | | return set_err(ENOSYS, "Nonzero NVMe command dwords 11-15 not supported"); |
| 80 | if (in.cdw11 || in.cdw14 || in.cdw15) |
| 81 | return set_err(ENOSYS, "Nonzero NVMe command dwords 11, 14, or 15 not supported"); |
88 | 82 | |
89 | 83 | uint8_t cdb[16] = {0, }; |
90 | 84 | cdb[0] = 0xe6; |
91 | 85 | cdb[1] = in.opcode; |
92 | | //cdb[2] = ? |
| 86 | //cdb[2] = 0 |
93 | 87 | cdb[3] = (uint8_t)in.cdw10; |
94 | | //cdb[4..6] = ? |
| 88 | //cdb[4..5] = 0 |
| 89 | cdb[6] = (uint8_t)(cdw10_hi >> 8); |
95 | 90 | cdb[7] = (uint8_t)cdw10_hi; |
96 | | //cdb[8..15] = ? |
| 91 | cdb[8] = (uint8_t)(in.cdw13 >> 24); |
| 92 | cdb[9] = (uint8_t)(in.cdw13 >> 16); |
| 93 | cdb[10] = (uint8_t)(in.cdw13 >> 8); |
| 94 | cdb[11] = (uint8_t)in.cdw13; |
| 95 | cdb[12] = (uint8_t)(in.cdw12 >> 24); |
| 96 | cdb[13] = (uint8_t)(in.cdw12 >> 16); |
| 97 | cdb[14] = (uint8_t)(in.cdw12 >> 8); |
| 98 | cdb[15] = (uint8_t)in.cdw12; |
97 | 99 | |
98 | 100 | scsi_cmnd_io io_hdr = {}; |
99 | 101 | io_hdr.cmnd = cdb; |