smartmontools SVN Rev 5471
Utility to control and monitor storage systems with "S.M.A.R.T."
nvmecmds.cpp
Go to the documentation of this file.
1/*
2 * nvmecmds.cpp
3 *
4 * Home page of code is: https://www.smartmontools.org
5 *
6 * Copyright (C) 2016-23 Christian Franke
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10
11#include "config.h"
12#include "nvmecmds.h"
13
14const char * nvmecmds_cvsid = "$Id: nvmecmds.cpp 5471 2023-05-29 12:22:41Z chrfranke $"
16
17#include "dev_interface.h"
18#include "atacmds.h" // swapx(), dont_print_serial_number
19#include "scsicmds.h" // dStrHex()
20#include "utility.h"
21
22#include <errno.h>
23
24using namespace smartmontools;
25
26// Print NVMe debug messages?
27unsigned char nvme_debugmode = 0;
28
29// Dump up to 4096 bytes, do not dump trailing zero bytes.
30// TODO: Handle this by new unified function in utility.cpp
31static void debug_hex_dump(const void * data, unsigned size)
32{
33 const unsigned char * p = (const unsigned char *)data;
34 const unsigned limit = 4096; // sizeof(nvme_id_ctrl)
35 unsigned sz = (size <= limit ? size : limit);
36
37 while (sz > 0x10 && !p[sz-1])
38 sz--;
39 if (sz < size) {
40 if (sz & 0x0f)
41 sz = (sz & ~0x0f) + 0x10;
42 sz += 0x10;
43 if (sz > size)
44 sz = size;
45 }
46
47 dStrHex((const uint8_t *)p, sz, 0);
48 if (sz < size)
49 pout(" ...\n");
50}
51
52// Call NVMe pass-through and print debug info if requested.
53static bool nvme_pass_through(nvme_device * device, const nvme_cmd_in & in,
54 nvme_cmd_out & out)
55{
56 if (nvme_debugmode) {
57 pout(" [NVMe call: opcode=0x%02x, size=0x%04x, nsid=0x%08x, cdw10=0x%08x",
58 in.opcode, in.size, in.nsid, in.cdw10);
59 if (in.cdw11 || in.cdw12 || in.cdw13 || in.cdw14 || in.cdw15)
60 pout(",\n cdw1x=0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x",
61 in.cdw11, in.cdw12, in.cdw13, in.cdw14, in.cdw15);
62 pout("]\n");
63 }
64
65 auto start_usec = (nvme_debugmode ? get_timer_usec() : -1);
66
67 bool ok = device->nvme_pass_through(in, out);
68
69 if (start_usec >= 0) {
70 auto duration_usec = get_timer_usec() - start_usec;
71 if (duration_usec > 0)
72 pout(" [Duration: %.6fs]\n", duration_usec / 1000000.0);
73 }
74
76 && in.opcode == nvme_admin_identify && in.cdw10 == 0x01) {
77 // Invalidate serial number
78 nvme_id_ctrl & id_ctrl = *reinterpret_cast<nvme_id_ctrl *>(in.buffer);
79 memset(id_ctrl.sn, 'X', sizeof(id_ctrl.sn));
80 }
81
82 if (nvme_debugmode) {
83 if (!ok) {
84 pout(" [NVMe call failed: ");
85 if (out.status_valid)
86 pout("NVMe Status=0x%04x", out.status);
87 else
88 pout("%s", device->get_errmsg());
89 }
90 else {
91 pout(" [NVMe call succeeded: result=0x%08x", out.result);
93 pout("\n");
95 pout(" ");
96 }
97 }
98 pout("]\n");
99 }
100
101 return ok;
102}
103
104// Call NVMe pass-through and print debug info if requested.
105// Version without output parameters.
106static bool nvme_pass_through(nvme_device * device, const nvme_cmd_in & in)
107{
108 nvme_cmd_out out;
109 return nvme_pass_through(device, in, out);
110}
111
112// Read NVMe identify info with controller/namespace field CNS.
113static bool nvme_read_identify(nvme_device * device, unsigned nsid,
114 unsigned char cns, void * data, unsigned size)
115{
116 memset(data, 0, size);
117 nvme_cmd_in in;
119 in.nsid = nsid;
120 in.cdw10 = cns;
121
122 return nvme_pass_through(device, in);
123}
124
125// Read NVMe Identify Controller data structure.
127{
128 if (!nvme_read_identify(device, 0, 0x01, &id_ctrl, sizeof(id_ctrl)))
129 return false;
130
131 if (isbigendian()) {
132 swapx(&id_ctrl.vid);
133 swapx(&id_ctrl.ssvid);
134 swapx(&id_ctrl.cntlid);
135 swapx(&id_ctrl.ver);
136 swapx(&id_ctrl.oacs);
137 swapx(&id_ctrl.wctemp);
138 swapx(&id_ctrl.cctemp);
139 swapx(&id_ctrl.mtfa);
140 swapx(&id_ctrl.hmpre);
141 swapx(&id_ctrl.hmmin);
142 swapx(&id_ctrl.rpmbs);
143 swapx(&id_ctrl.nn);
144 swapx(&id_ctrl.oncs);
145 swapx(&id_ctrl.fuses);
146 swapx(&id_ctrl.awun);
147 swapx(&id_ctrl.awupf);
148 swapx(&id_ctrl.acwu);
149 swapx(&id_ctrl.sgls);
150 for (int i = 0; i < 32; i++) {
151 swapx(&id_ctrl.psd[i].max_power);
152 swapx(&id_ctrl.psd[i].entry_lat);
153 swapx(&id_ctrl.psd[i].exit_lat);
154 swapx(&id_ctrl.psd[i].idle_power);
155 swapx(&id_ctrl.psd[i].active_power);
156 }
157 }
158
159 return true;
160}
161
162// Read NVMe Identify Namespace data structure for namespace NSID.
163bool nvme_read_id_ns(nvme_device * device, unsigned nsid, nvme_id_ns & id_ns)
164{
165 if (!nvme_read_identify(device, nsid, 0x00, &id_ns, sizeof(id_ns)))
166 return false;
167
168 if (isbigendian()) {
169 swapx(&id_ns.nsze);
170 swapx(&id_ns.ncap);
171 swapx(&id_ns.nuse);
172 swapx(&id_ns.nawun);
173 swapx(&id_ns.nawupf);
174 swapx(&id_ns.nacwu);
175 swapx(&id_ns.nabsn);
176 swapx(&id_ns.nabo);
177 swapx(&id_ns.nabspf);
178 for (int i = 0; i < 16; i++)
179 swapx(&id_ns.lbaf[i].ms);
180 }
181
182 return true;
183}
184
185static bool nvme_read_log_page_1(nvme_device * device, unsigned nsid,
186 unsigned char lid, void * data, unsigned size, unsigned offset = 0)
187{
188 if (!(4 <= size && size <= 0x1000 && !(size % 4) && !(offset % 4)))
189 return device->set_err(EINVAL, "Invalid NVMe log size %u or offset %u", size, offset);
190
191 memset(data, 0, size);
192 nvme_cmd_in in;
194 in.nsid = nsid;
195 in.cdw10 = lid | (((size / 4) - 1) << 16);
196 in.cdw12 = offset; // LPOL, NVMe 1.2.1
197
198 return nvme_pass_through(device, in);
199}
200
201// Read NVMe log page with identifier LID.
202unsigned nvme_read_log_page(nvme_device * device, unsigned nsid, unsigned char lid,
203 void * data, unsigned size, bool lpo_sup, unsigned offset /* = 0 */)
204{
205 unsigned n, bs;
206 for (n = 0; n < size; n += bs) {
207 if (!lpo_sup && offset + n > 0) {
208 device->set_err(ENOSYS, "Log Page Offset not supported");
209 break;
210 }
211
212 // Limit transfer size to one page to avoid problems with
213 // limits of NVMe pass-through layer or too low MDTS values.
214 bs = size - n;
215 if (bs > 0x1000)
216 bs = 0x1000;
217 if (!nvme_read_log_page_1(device, nsid, lid, (char *)data + n, bs, offset + n))
218 break;
219 }
220
221 return n;
222}
223
224// Read NVMe Error Information Log.
226 unsigned num_entries, bool lpo_sup)
227{
228 unsigned n = nvme_read_log_page(device, 0xffffffff, 0x01, error_log,
229 num_entries * sizeof(*error_log), lpo_sup);
230
231 unsigned read_entries = n / sizeof(*error_log);
232 if (isbigendian()) {
233 for (unsigned i = 0; i < read_entries; i++) {
234 swapx(&error_log[i].error_count);
235 swapx(&error_log[i].sqid);
236 swapx(&error_log[i].cmdid);
237 swapx(&error_log[i].status_field);
238 swapx(&error_log[i].parm_error_location);
239 swapx(&error_log[i].lba);
240 swapx(&error_log[i].nsid);
241 }
242 }
243
244 return read_entries;
245}
246
247// Read NVMe SMART/Health Information log.
249{
250 if (!nvme_read_log_page_1(device, 0xffffffff, 0x02, &smart_log, sizeof(smart_log)))
251 return false;
252
253 if (isbigendian()) {
254 swapx(&smart_log.warning_temp_time);
255 swapx(&smart_log.critical_comp_time);
256 for (int i = 0; i < 8; i++)
257 swapx(&smart_log.temp_sensor[i]);
258 }
259
260 return true;
261}
262
263// Read NVMe Self-test Log.
265 smartmontools::nvme_self_test_log & self_test_log)
266{
267 if (!nvme_read_log_page_1(device, nsid, 0x06, &self_test_log, sizeof(self_test_log)))
268 return false;
269
270 if (isbigendian()) {
271 for (int i = 0; i < 20; i++)
272 swapx(&self_test_log.results[i].nsid);
273 }
274
275 return true;
276}
277
278// Start Self-test
279bool nvme_self_test(nvme_device * device, uint8_t stc, uint32_t nsid)
280{
281 nvme_cmd_in in;
283 in.nsid = nsid;
284 in.cdw10 = stc;
285 return nvme_pass_through(device, in);
286}
287
288// Return flagged error message for NVMe status SCT/SC fields or nullptr if unknown.
289// If message starts with '-', the status indicates an invalid command (EINVAL).
290static const char * nvme_status_to_flagged_str(uint16_t status)
291{
292 // Section 3.3.3.2.1 of NVM Express Base Specification Revision 2.0c, October 4, 2022
293 uint8_t sc = (uint8_t)status;
294 switch ((status >> 8) & 0x7) {
295 case 0x0: // Generic Command Status
296 if (sc < 0x80) switch (sc) {
297 case 0x00: return "Successful Completion";
298 case 0x01: return "-Invalid Command Opcode";
299 case 0x02: return "-Invalid Field in Command";
300 case 0x03: return "Command ID Conflict";
301 case 0x04: return "Data Transfer Error";
302 case 0x05: return "Commands Aborted due to Power Loss Notification";
303 case 0x06: return "Internal Error";
304 case 0x07: return "Command Abort Requested";
305 case 0x08: return "Command Aborted due to SQ Deletion";
306 case 0x09: return "Command Aborted due to Failed Fused Command";
307 case 0x0a: return "Command Aborted due to Missing Fused Command";
308 case 0x0b: return "-Invalid Namespace or Format";
309 case 0x0c: return "Command Sequence Error";
310 case 0x0d: return "-Invalid SGL Segment Descriptor";
311 case 0x0e: return "-Invalid Number of SGL Descriptors";
312 case 0x0f: return "-Data SGL Length Invalid";
313 case 0x10: return "-Metadata SGL Length Invalid";
314 case 0x11: return "-SGL Descriptor Type Invalid";
315 case 0x12: return "-Invalid Use of Controller Memory Buffer";
316 case 0x13: return "-PRP Offset Invalid";
317 case 0x14: return "Atomic Write Unit Exceeded";
318 case 0x15: return "Operation Denied";
319 case 0x16: return "-SGL Offset Invalid";
320 case 0x18: return "Host Identifier Inconsistent Format";
321 case 0x19: return "Keep Alive Timer Expired";
322 case 0x1a: return "-Keep Alive Timeout Invalid";
323 case 0x1b: return "Command Aborted due to Preempt and Abort";
324 case 0x1c: return "Sanitize Failed";
325 case 0x1d: return "Sanitize In Progress";
326 case 0x1e: return "SGL Data Block Granularity Invalid";
327 case 0x1f: return "Command Not Supported for Queue in CMB";
328 case 0x20: return "Namespace is Write Protected";
329 case 0x21: return "Command Interrupted";
330 case 0x22: return "Transient Transport Error";
331 case 0x23: return "Command Prohibited by Command and Feature Lockdown";
332 case 0x24: return "Admin Command Media Not Ready";
333 // 0x25-0x7f: Reserved
334 }
335 else switch (sc) {
336 // 0x80-0xbf: I/O Command Set Specific
337 case 0x80: return "LBA Out of Range";
338 case 0x81: return "Capacity Exceeded";
339 case 0x82: return "Namespace Not Ready";
340 case 0x83: return "Reservation Conflict";
341 case 0x84: return "Format In Progress";
342 case 0x85: return "-Invalid Value Size";
343 case 0x86: return "-Invalid Key Size";
344 case 0x87: return "KV Key Does Not Exist";
345 case 0x88: return "Unrecovered Error";
346 case 0x89: return "Key Exists";
347 // 0x90-0xbf: Reserved
348 // 0xc0-0xff: Vendor Specific
349 }
350 break;
351
352 case 0x1: // Command Specific Status
353 if (sc < 0x80) switch (sc) {
354 case 0x00: return "-Completion Queue Invalid";
355 case 0x01: return "-Invalid Queue Identifier";
356 case 0x02: return "-Invalid Queue Size";
357 case 0x03: return "Abort Command Limit Exceeded";
358 case 0x04: return "Abort Command Is Missing";
359 case 0x05: return "Asynchronous Event Request Limit Exceeded";
360 case 0x06: return "-Invalid Firmware Slot";
361 case 0x07: return "-Invalid Firmware Image";
362 case 0x08: return "-Invalid Interrupt Vector";
363 case 0x09: return "-Invalid Log Page";
364 case 0x0a: return "-Invalid Format";
365 case 0x0b: return "Firmware Activation Requires Conventional Reset";
366 case 0x0c: return "-Invalid Queue Deletion";
367 case 0x0d: return "Feature Identifier Not Saveable";
368 case 0x0e: return "Feature Not Changeable";
369 case 0x0f: return "Feature Not Namespace Specific";
370 case 0x10: return "Firmware Activation Requires NVM Subsystem Reset";
371 case 0x11: return "Firmware Activation Requires Controller Level Reset";
372 case 0x12: return "Firmware Activation Requires Maximum Time Violation";
373 case 0x13: return "Firmware Activation Prohibited";
374 case 0x14: return "Overlapping Range";
375 case 0x15: return "Namespace Insufficient Capacity";
376 case 0x16: return "-Namespace Identifier Unavailable";
377 case 0x18: return "Namespace Already Attached";
378 case 0x19: return "Namespace Is Private";
379 case 0x1a: return "Namespace Not Attached";
380 case 0x1b: return "Thin Provisioning Not Supported";
381 case 0x1c: return "-Controller List Invalid";
382 case 0x1d: return "Device Self-test In Progress";
383 case 0x1e: return "Boot Partition Write Prohibited";
384 case 0x1f: return "Invalid Controller Identifier";
385 case 0x20: return "-Invalid Secondary Controller State";
386 case 0x21: return "-Invalid Number of Controller Resources";
387 case 0x22: return "-Invalid Resource Identifier";
388 case 0x23: return "Sanitize Prohibited While Persistent Memory Region is Enabled";
389 case 0x24: return "-ANA Group Identifier Invalid";
390 case 0x25: return "ANA Attach Failed";
391 case 0x26: return "Insufficient Capacity";
392 case 0x27: return "Namespace Attachment Limit Exceeded";
393 case 0x28: return "Prohibition of Command Execution Not Supported";
394 case 0x29: return "I/O Command Set Not Supported";
395 case 0x2a: return "I/O Command Set Not Enabled";
396 case 0x2b: return "I/O Command Set Combination Rejected";
397 case 0x2c: return "-Invalid I/O Command Set";
398 case 0x2d: return "-Identifier Unavailable";
399 // 0x2e-0x6f: Reserved
400 // 0x70-0x7f: Directive Specific
401 }
402 else if (sc < 0xb8) switch (sc) {
403 // 0x80-0xbf: I/O Command Set Specific (overlap with Fabrics Command Set)
404 case 0x80: return "-Conflicting Attributes";
405 case 0x81: return "-Invalid Protection Information";
406 case 0x82: return "Attempted Write to Read Only Range";
407 case 0x83: return "Command Size Limit Exceeded";
408 // 0x84-0xb7: Reserved
409 }
410 else switch (sc) {
411 case 0xb8: return "Zoned Boundary Error";
412 case 0xb9: return "Zone Is Full";
413 case 0xba: return "Zone Is Read Only";
414 case 0xbb: return "Zone Is Offline";
415 case 0xbc: return "Zone Invalid Write";
416 case 0xbd: return "Too Many Active Zones";
417 case 0xbe: return "Too Many Open Zones";
418 case 0xbf: return "Invalid Zone State Transition";
419 // 0xc0-0xff: Vendor Specific
420 }
421 break;
422
423 case 0x2: // Media and Data Integrity Errors
424 switch (sc) {
425 // 0x00-0x7f: Reserved
426 case 0x80: return "Write Fault";
427 case 0x81: return "Unrecovered Read Error";
428 case 0x82: return "End-to-end Guard Check Error";
429 case 0x83: return "End-to-end Application Tag Check Error";
430 case 0x84: return "End-to-end Reference Tag Check Error";
431 case 0x85: return "Compare Failure";
432 case 0x86: return "Access Denied";
433 case 0x87: return "Deallocated or Unwritten Logical Block";
434 case 0x88: return "End-to-End Storage Tag Check Error";
435 // 0x89-0xbf: Reserved
436 // 0xc0-0xff: Vendor Specific
437 }
438 break;
439
440 case 0x3: // Path Related Status
441 switch (sc) {
442 case 0x00: return "Internal Path Error";
443 case 0x01: return "Asymmetric Access Persistent Loss";
444 case 0x02: return "Asymmetric Access Inaccessible";
445 case 0x03: return "Asymmetric Access Transition";
446 // 0x04-0x5f: Reserved
447 // 0x60-0x6f: Controller Detected Pathing Errors
448 case 0x60: return "Controller Pathing Error";
449 // 0x61-0x6f: Reserved
450 // 0x70-0x7f: Host Detected Pathing Errors
451 case 0x70: return "Host Pathing Error";
452 case 0x71: return "Command Aborted By Host";
453 // 0x72-0x7f: Reserved
454 // 0x80-0xbf: I/O Command Set Specific
455 // 0xc0-0xff: Vendor Specific
456 }
457 break;
458
459 // 0x4-0x6: Reserved
460 // 0x7: Vendor Specific
461 }
462 return nullptr;
463}
464
465// Return errno for NVMe status SCT/SC fields: 0, EINVAL or EIO.
466int nvme_status_to_errno(uint16_t status)
467{
468 if (!nvme_status_is_error(status))
469 return 0;
470 const char * s = nvme_status_to_flagged_str(status);
471 if (s && *s == '-')
472 return EINVAL;
473 return EIO;
474}
475
476// Return error message for NVMe status SCT/SC fields or nullptr if unknown.
477const char * nvme_status_to_str(uint16_t status)
478{
479 const char * s = nvme_status_to_flagged_str(status);
480 return (s && *s == '-' ? s + 1 : s);
481}
482
483// Return error message for NVMe status SCT/SC fields or explanatory message if unknown.
484const char * nvme_status_to_info_str(char * buf, size_t bufsize, uint16_t status)
485{
486 const char * s = nvme_status_to_str(status);
487 if (s)
488 return s;
489
490 uint8_t sct = (status >> 8) & 0x7, sc = (uint8_t)status;
491 const char * pfx = (sc >= 0xc0 ? "Vendor Specific " : "Unknown ");
492 switch (sct) {
493 case 0x0: s = "Generic Command Status"; break;
494 case 0x1: s = "Command Specific Status"; break;
495 case 0x2: s = "Media and Data Integrity Error"; break;
496 case 0x3: s = "Path Related Status"; break;
497 case 0x7: s = "Vendor Specific Status"; pfx = ""; break;
498 }
499 if (s)
500 snprintf(buf, bufsize, "%s%s 0x%02x", pfx, s, sc);
501 else
502 snprintf(buf, bufsize, "Unknown Status 0x%x/0x%02x", sct, sc);
503 return buf;
504}
bool dont_print_serial_number
Definition: atacmds.cpp:37
NVMe device access.
virtual bool nvme_pass_through(const nvme_cmd_in &in, nvme_cmd_out &out)=0
NVMe pass through.
const char * get_errmsg() const
Get last error message.
bool set_err(int no, const char *msg,...) __attribute_format_printf(3
Set last error number and message.
u16 s[6]
Definition: megaraid.h:18
ptr_t data
Definition: megaraid.h:15
u32 size
Definition: megaraid.h:0
@ nvme_admin_identify
Definition: nvmecmds.h:210
@ nvme_admin_get_log_page
Definition: nvmecmds.h:207
@ nvme_admin_dev_self_test
Definition: nvmecmds.h:218
uint32_t nsid
uint16_t sqid
static bool nvme_read_log_page_1(nvme_device *device, unsigned nsid, unsigned char lid, void *data, unsigned size, unsigned offset=0)
Definition: nvmecmds.cpp:185
bool nvme_read_self_test_log(nvme_device *device, uint32_t nsid, smartmontools::nvme_self_test_log &self_test_log)
Definition: nvmecmds.cpp:264
int nvme_status_to_errno(uint16_t status)
Definition: nvmecmds.cpp:466
bool nvme_read_id_ns(nvme_device *device, unsigned nsid, nvme_id_ns &id_ns)
Definition: nvmecmds.cpp:163
bool nvme_read_id_ctrl(nvme_device *device, nvme_id_ctrl &id_ctrl)
Definition: nvmecmds.cpp:126
unsigned char nvme_debugmode
Definition: nvmecmds.cpp:27
bool nvme_self_test(nvme_device *device, uint8_t stc, uint32_t nsid)
Definition: nvmecmds.cpp:279
const char * nvme_status_to_str(uint16_t status)
Definition: nvmecmds.cpp:477
bool nvme_read_smart_log(nvme_device *device, nvme_smart_log &smart_log)
Definition: nvmecmds.cpp:248
unsigned nvme_read_log_page(nvme_device *device, unsigned nsid, unsigned char lid, void *data, unsigned size, bool lpo_sup, unsigned offset)
Definition: nvmecmds.cpp:202
unsigned nvme_read_error_log(nvme_device *device, nvme_error_log_page *error_log, unsigned num_entries, bool lpo_sup)
Definition: nvmecmds.cpp:225
const char * nvmecmds_cvsid
Definition: nvmecmds.cpp:14
static bool nvme_pass_through(nvme_device *device, const nvme_cmd_in &in, nvme_cmd_out &out)
Definition: nvmecmds.cpp:53
static bool nvme_read_identify(nvme_device *device, unsigned nsid, unsigned char cns, void *data, unsigned size)
Definition: nvmecmds.cpp:113
const char * nvme_status_to_info_str(char *buf, size_t bufsize, uint16_t status)
Definition: nvmecmds.cpp:484
static void debug_hex_dump(const void *data, unsigned size)
Definition: nvmecmds.cpp:31
static const char * nvme_status_to_flagged_str(uint16_t status)
Definition: nvmecmds.cpp:290
constexpr bool nvme_status_is_error(uint16_t status)
Definition: nvmecmds.h:284
#define NVMECMDS_H_CVSID
Definition: nvmecmds.h:17
void dStrHex(const uint8_t *up, int len, int no_ascii)
Definition: scsicmds.cpp:368
void pout(const char *fmt,...)
Definition: smartd.cpp:1333
NVMe pass through input parameters.
unsigned char direction() const
Get I/O direction from opcode.
unsigned cdw10
unsigned cdw13
unsigned cdw11
unsigned char opcode
Opcode (CDW0 07:00)
unsigned size
Size of buffer.
unsigned cdw14
unsigned cdw15
Cmd specific.
unsigned nsid
Namespace ID.
unsigned cdw12
void set_data_in(unsigned char op, void *buf, unsigned sz)
void * buffer
Pointer to data buffer.
NVMe pass through output parameters.
bool status_valid
true if status is valid
unsigned short status
Status Field (DW3 31:17)
unsigned result
Command specific result (DW0)
unsigned short wctemp
Definition: nvmecmds.h:92
unsigned short ssvid
Definition: nvmecmds.h:68
unsigned short cntlid
Definition: nvmecmds.h:76
struct nvme_id_power_state psd[32]
Definition: nvmecmds.h:133
unsigned short fuses
Definition: nvmecmds.h:114
unsigned short mtfa
Definition: nvmecmds.h:94
unsigned short vid
Definition: nvmecmds.h:67
unsigned short oacs
Definition: nvmecmds.h:83
unsigned short awupf
Definition: nvmecmds.h:118
unsigned short cctemp
Definition: nvmecmds.h:93
struct nvme_lbaf lbaf[16]
Definition: nvmecmds.h:170
unsigned short nabspf
Definition: nvmecmds.h:164
unsigned short nacwu
Definition: nvmecmds.h:161
unsigned short nawun
Definition: nvmecmds.h:159
unsigned short nabo
Definition: nvmecmds.h:163
unsigned short nabsn
Definition: nvmecmds.h:162
unsigned short nawupf
Definition: nvmecmds.h:160
unsigned short ms
Definition: nvmecmds.h:139
nvme_self_test_result results[20]
Definition: nvmecmds.h:248
unsigned int critical_comp_time
Definition: nvmecmds.h:194
unsigned short temp_sensor[8]
Definition: nvmecmds.h:195
unsigned int warning_temp_time
Definition: nvmecmds.h:193
long long get_timer_usec()
Get microseconds since some unspecified starting point.
Definition: utility.cpp:841
bool isbigendian()
Definition: utility.h:81
void swapx(unsigned short *p)
Definition: utility.h:94