XenevaOS
Loading...
Searching...
No Matches
Nvme.h
Go to the documentation of this file.
1
19#ifndef __NVM_E_H__
20#define __NVM_E_H__
21
22#pragma pack(1)
23
24//
25// controller register offsets
26//
27#define NVME_CAP_OFFSET 0x0000 // Controller Capabilities
28#define NVME_VER_OFFSET 0x0008 // Version
29#define NVME_INTMS_OFFSET 0x000c // Interrupt Mask Set
30#define NVME_INTMC_OFFSET 0x0010 // Interrupt Mask Clear
31#define NVME_CC_OFFSET 0x0014 // Controller Configuration
32#define NVME_CSTS_OFFSET 0x001c // Controller Status
33#define NVME_NSSR_OFFSET 0x0020 // NVM Subsystem Reset
34#define NVME_AQA_OFFSET 0x0024 // Admin Queue Attributes
35#define NVME_ASQ_OFFSET 0x0028 // Admin Submission Queue Base Address
36#define NVME_ACQ_OFFSET 0x0030 // Admin Completion Queue Base Address
37#define NVME_SQ0_OFFSET 0x1000 // Submission Queue 0 (admin) Tail Doorbell
38#define NVME_CQ0_OFFSET 0x1004 // Completion Queue 0 (admin) Head Doorbell
39
40//
41// These register offsets are defined as 0x1000 + (N * (4 << CAP.DSTRD))
42// Get the doorbell stride bit shift value from the controller capabilities.
43//
44#define NVME_SQTDBL_OFFSET(QID, DSTRD) 0x1000 + ((2 * (QID)) * (4 << (DSTRD))) // Submission Queue y (NVM) Tail Doorbell
45#define NVME_CQHDBL_OFFSET(QID, DSTRD) 0x1000 + (((2 * (QID)) + 1) * (4 << (DSTRD))) // Completion Queue y (NVM) Head Doorbell
46
47
48#pragma pack(1)
49
50//
51// 3.1.1 Offset 00h: CAP - Controller Capabilities
52//
53typedef struct {
54 UINT16 Mqes; // Maximum Queue Entries Supported
55 UINT8 Cqr:1; // Contiguous Queues Required
56 UINT8 Ams:2; // Arbitration Mechanism Supported
58 UINT8 To; // Timeout
60 UINT16 Nssrs:1; // NVM Subsystem Reset Supported NSSRS
61 UINT16 Css:4; // Command Sets Supported - Bit 37
66} NVME_CAP;
67
68//
69// 3.1.2 Offset 08h: VS - Version
70//
71typedef struct {
72 UINT16 Mnr; // Minor version number
73 UINT16 Mjr; // Major version number
74} NVME_VER;
75
76//
77// 3.1.5 Offset 14h: CC - Controller Configuration
78//
79typedef struct {
80 UINT16 En:1; // Enable
82 UINT16 Css:3; // I/O Command Set Selected
83 UINT16 Mps:4; // Memory Page Size
84 UINT16 Ams:3; // Arbitration Mechanism Selected
85 UINT16 Shn:2; // Shutdown Notification
86 UINT8 Iosqes:4; // I/O Submission Queue Entry Size
87 UINT8 Iocqes:4; // I/O Completion Queue Entry Size
89} NVME_CC;
90#define NVME_CC_SHN_NORMAL_SHUTDOWN 1
91#define NVME_CC_SHN_ABRUPT_SHUTDOWN 2
92
93//
94// 3.1.6 Offset 1Ch: CSTS - Controller Status
95//
96typedef struct {
97 UINT32 Rdy:1; // Ready
98 UINT32 Cfs:1; // Controller Fatal Status
99 UINT32 Shst:2; // Shutdown Status
100 UINT32 Nssro:1; // NVM Subsystem Reset Occurred
102} NVME_CSTS;
103#define NVME_CSTS_SHST_SHUTDOWN_OCCURRING 1
104#define NVME_CSTS_SHST_SHUTDOWN_COMPLETED 2
105//
106// 3.1.8 Offset 24h: AQA - Admin Queue Attributes
107//
108typedef struct {
109 UINT16 Asqs:12; // Submission Queue Size
111 UINT16 Acqs:12; // Completion Queue Size
113} NVME_AQA;
114
115//
116// 3.1.9 Offset 28h: ASQ - Admin Submission Queue Base Address
117//
118#define NVME_ASQ UINT64
119//
120// 3.1.10 Offset 30h: ACQ - Admin Completion Queue Base Address
121//
122#define NVME_ACQ UINT64
123
124//
125// 3.1.11 Offset (1000h + ((2y) * (4 << CAP.DSTRD))): SQyTDBL - Submission Queue y Tail Doorbell
126//
127typedef struct {
131
132//
133// 3.1.12 Offset (1000h + ((2y + 1) * (4 << CAP.DSTRD))): CQyHDBL - Completion Queue y Head Doorbell
134//
135typedef struct {
139
140//
141// NVM command set structures
142//
143// Read Command
144//
145typedef struct {
146 //
147 // CDW 10, 11
148 //
149 UINT64 Slba; /* Starting Sector Address */
150 //
151 // CDW 12
152 //
153 UINT16 Nlb; /* Number of Sectors */
155 UINT16 Prinfo:4; /* Protection Info Check */
156 UINT16 Fua:1; /* Force Unit Access */
157 UINT16 Lr:1; /* Limited Retry */
158 //
159 // CDW 13
160 //
161 UINT32 Af:4; /* Access Frequency */
162 UINT32 Al:2; /* Access Latency */
163 UINT32 Sr:1; /* Sequential Request */
164 UINT32 In:1; /* Incompressible */
166 //
167 // CDW 14
168 //
169 UINT32 Eilbrt; /* Expected Initial Logical Block Reference Tag */
170 //
171 // CDW 15
172 //
173 UINT16 Elbat; /* Expected Logical Block Application Tag */
174 UINT16 Elbatm; /* Expected Logical Block Application Tag Mask */
175} NVME_READ;
176
177//
178// Write Command
179//
180typedef struct {
181 //
182 // CDW 10, 11
183 //
184 UINT64 Slba; /* Starting Sector Address */
185 //
186 // CDW 12
187 //
188 UINT16 Nlb; /* Number of Sectors */
190 UINT16 Prinfo:4; /* Protection Info Check */
191 UINT16 Fua:1; /* Force Unit Access */
192 UINT16 Lr:1; /* Limited Retry */
193 //
194 // CDW 13
195 //
196 UINT32 Af:4; /* Access Frequency */
197 UINT32 Al:2; /* Access Latency */
198 UINT32 Sr:1; /* Sequential Request */
199 UINT32 In:1; /* Incompressible */
201 //
202 // CDW 14
203 //
204 UINT32 Ilbrt; /* Initial Logical Block Reference Tag */
205 //
206 // CDW 15
207 //
208 UINT16 Lbat; /* Logical Block Application Tag */
209 UINT16 Lbatm; /* Logical Block Application Tag Mask */
210} NVME_WRITE;
211
212//
213// Flush
214//
215typedef struct {
216 //
217 // CDW 10
218 //
219 UINT32 Flush; /* Flush */
220} NVME_FLUSH;
221
222//
223// Write Uncorrectable command
224//
225typedef struct {
226 //
227 // CDW 10, 11
228 //
229 UINT64 Slba; /* Starting LBA */
230 //
231 // CDW 12
232 //
233 UINT32 Nlb:16; /* Number of Logical Blocks */
236
237//
238// Write Zeroes command
239//
240typedef struct {
241 //
242 // CDW 10, 11
243 //
244 UINT64 Slba; /* Starting LBA */
245 //
246 // CDW 12
247 //
248 UINT16 Nlb; /* Number of Logical Blocks */
250 UINT16 Prinfo:4; /* Protection Info Check */
251 UINT16 Fua:1; /* Force Unit Access */
252 UINT16 Lr:1; /* Limited Retry */
253 //
254 // CDW 13
255 //
257 //
258 // CDW 14
259 //
260 UINT32 Ilbrt; /* Initial Logical Block Reference Tag */
261 //
262 // CDW 15
263 //
264 UINT16 Lbat; /* Logical Block Application Tag */
265 UINT16 Lbatm; /* Logical Block Application Tag Mask */
267
268//
269// Compare command
270//
271typedef struct {
272 //
273 // CDW 10, 11
274 //
275 UINT64 Slba; /* Starting LBA */
276 //
277 // CDW 12
278 //
279 UINT16 Nlb; /* Number of Logical Blocks */
281 UINT16 Prinfo:4; /* Protection Info Check */
282 UINT16 Fua:1; /* Force Unit Access */
283 UINT16 Lr:1; /* Limited Retry */
284 //
285 // CDW 13
286 //
288 //
289 // CDW 14
290 //
291 UINT32 Eilbrt; /* Expected Initial Logical Block Reference Tag */
292 //
293 // CDW 15
294 //
295 UINT16 Elbat; /* Expected Logical Block Application Tag */
296 UINT16 Elbatm; /* Expected Logical Block Application Tag Mask */
298
307
308typedef struct {
309 UINT16 Mp; /* Maximum Power */
310 UINT8 Rsvd1; /* Reserved as of Nvm Express 1.1 Spec */
311 UINT8 Mps:1; /* Max Power Scale */
312 UINT8 Nops:1; /* Non-Operational State */
313 UINT8 Rsvd2:6; /* Reserved as of Nvm Express 1.1 Spec */
314 UINT32 Enlat; /* Entry Latency */
315 UINT32 Exlat; /* Exit Latency */
316 UINT8 Rrt:5; /* Relative Read Throughput */
317 UINT8 Rsvd3:3; /* Reserved as of Nvm Express 1.1 Spec */
318 UINT8 Rrl:5; /* Relative Read Leatency */
319 UINT8 Rsvd4:3; /* Reserved as of Nvm Express 1.1 Spec */
320 UINT8 Rwt:5; /* Relative Write Throughput */
321 UINT8 Rsvd5:3; /* Reserved as of Nvm Express 1.1 Spec */
322 UINT8 Rwl:5; /* Relative Write Leatency */
323 UINT8 Rsvd6:3; /* Reserved as of Nvm Express 1.1 Spec */
324 UINT8 Rsvd7[16]; /* Reserved as of Nvm Express 1.1 Spec */
326
327//
328// Identify Controller Data
329//
330typedef struct {
331 //
332 // Controller Capabilities and Features 0-255
333 //
334 UINT16 Vid; /* PCI Vendor ID */
335 UINT16 Ssvid; /* PCI sub-system vendor ID */
336 UINT8 Sn[20]; /* Product serial number */
337
338 UINT8 Mn[40]; /* Proeduct model number */
339 UINT8 Fr[8]; /* Firmware Revision */
340 UINT8 Rab; /* Recommended Arbitration Burst */
341 UINT8 Ieee_oui[3]; /* Organization Unique Identifier */
342 UINT8 Cmic; /* Multi-interface Capabilities */
343 UINT8 Mdts; /* Maximum Data Transfer Size */
344 UINT8 Cntlid[2]; /* Controller ID */
345 UINT8 Rsvd1[176]; /* Reserved as of Nvm Express 1.1 Spec */
346 //
347 // Admin Command Set Attributes
348 //
349 UINT16 Oacs; /* Optional Admin Command Support */
350 #define NAMESPACE_MANAGEMENT_SUPPORTED BIT3
351 #define FW_DOWNLOAD_ACTIVATE_SUPPORTED BIT2
352 #define FORMAT_NVM_SUPPORTED BIT1
353 #define SECURITY_SEND_RECEIVE_SUPPORTED BIT0
354 UINT8 Acl; /* Abort Command Limit */
355 UINT8 Aerl; /* Async Event Request Limit */
356 UINT8 Frmw; /* Firmware updates */
357 UINT8 Lpa; /* Log Page Attributes */
358 UINT8 Elpe; /* Error Log Page Entries */
359 UINT8 Npss; /* Number of Power States Support */
360 UINT8 Avscc; /* Admin Vendor Specific Command Configuration */
361 UINT8 Apsta; /* Autonomous Power State Transition Attributes */
362 UINT8 Rsvd2[246]; /* Reserved as of Nvm Express 1.1 Spec */
363 //
364 // NVM Command Set Attributes
365 //
366 UINT8 Sqes; /* Submission Queue Entry Size */
367 UINT8 Cqes; /* Completion Queue Entry Size */
368 UINT16 Rsvd3; /* Reserved as of Nvm Express 1.1 Spec */
369 UINT32 Nn; /* Number of Namespaces */
370 UINT16 Oncs; /* Optional NVM Command Support */
371 UINT16 Fuses; /* Fused Operation Support */
372 UINT8 Fna; /* Format NVM Attributes */
373 UINT8 Vwc; /* Volatile Write Cache */
374 UINT16 Awun; /* Atomic Write Unit Normal */
375 UINT16 Awupf; /* Atomic Write Unit Power Fail */
376 UINT8 Nvscc; /* NVM Vendor Specific Command Configuration */
377 UINT8 Rsvd4; /* Reserved as of Nvm Express 1.1 Spec */
378 UINT16 Acwu; /* Atomic Compare & Write Unit */
379 UINT16 Rsvd5; /* Reserved as of Nvm Express 1.1 Spec */
380 UINT32 Sgls; /* SGL Support */
381 UINT8 Rsvd6[164]; /* Reserved as of Nvm Express 1.1 Spec */
382 //
383 // I/O Command set Attributes
384 //
385 UINT8 Rsvd7[1344]; /* Reserved as of Nvm Express 1.1 Spec */
386 //
387 // Power State Descriptors
388 //
389 NVME_PSDESCRIPTOR PsDescriptor[32];
390
391 UINT8 VendorData[1024]; /* Vendor specific data */
393
394typedef struct {
395 UINT16 Ms; /* Metadata Size */
396 UINT8 Lbads; /* LBA Data Size */
397 UINT8 Rp:2; /* Relative Performance */
398 #define LBAF_RP_BEST 00b
399 #define LBAF_RP_BETTER 01b
400 #define LBAF_RP_GOOD 10b
401 #define LBAF_RP_DEGRADED 11b
402 UINT8 Rsvd1:6; /* Reserved as of Nvm Express 1.1 Spec */
404
405//
406// Identify Namespace Data
407//
408typedef struct {
409 //
410 // NVM Command Set Specific
411 //
412 UINT64 Nsze; /* Namespace Size (total number of blocks in formatted namespace) */
413 UINT64 Ncap; /* Namespace Capacity (max number of logical blocks) */
414 UINT64 Nuse; /* Namespace Utilization */
415 UINT8 Nsfeat; /* Namespace Features */
416 UINT8 Nlbaf; /* Number of LBA Formats */
417 UINT8 Flbas; /* Formatted LBA size */
418 UINT8 Mc; /* Metadata Capabilities */
419 UINT8 Dpc; /* End-to-end Data Protection capabilities */
420 UINT8 Dps; /* End-to-end Data Protection Type Settings */
421 UINT8 Nmic; /* Namespace Multi-path I/O and Namespace Sharing Capabilities */
422 UINT8 Rescap; /* Reservation Capabilities */
423 UINT8 Rsvd1[88]; /* Reserved as of Nvm Express 1.1 Spec */
424 UINT64 Eui64; /* IEEE Extended Unique Identifier */
425 //
426 // LBA Format
427 //
428 NVME_LBAFORMAT LbaFormat[16];
429
430 UINT8 Rsvd2[192]; /* Reserved as of Nvm Express 1.1 Spec */
431 UINT8 VendorData[3712]; /* Vendor specific data */
433
434//
435// NvmExpress Admin Identify Cmd
436//
437typedef struct {
438 //
439 // CDW 10
440 //
444
445//
446// NvmExpress Admin Create I/O Completion Queue
447//
448typedef struct {
449 //
450 // CDW 10
451 //
452 UINT32 Qid:16; /* Queue Identifier */
453 UINT32 Qsize:16; /* Queue Size */
454
455 //
456 // CDW 11
457 //
458 UINT32 Pc:1; /* Physically Contiguous */
459 UINT32 Ien:1; /* Interrupts Enabled */
460 UINT32 Rsvd1:14; /* reserved as of Nvm Express 1.1 Spec */
461 UINT32 Iv:16; /* Interrupt Vector for MSI-X or MSI*/
463
464//
465// NvmExpress Admin Create I/O Submission Queue
466//
467typedef struct {
468 //
469 // CDW 10
470 //
471 UINT32 Qid:16; /* Queue Identifier */
472 UINT32 Qsize:16; /* Queue Size */
473
474 //
475 // CDW 11
476 //
477 UINT32 Pc:1; /* Physically Contiguous */
478 UINT32 Qprio:2; /* Queue Priority */
479 UINT32 Rsvd1:13; /* Reserved as of Nvm Express 1.1 Spec */
480 UINT32 Cqid:16; /* Completion Queue ID */
482
483//
484// NvmExpress Admin Delete I/O Completion Queue
485//
486typedef struct {
487 //
488 // CDW 10
489 //
493
494//
495// NvmExpress Admin Delete I/O Submission Queue
496//
497typedef struct {
498 //
499 // CDW 10
500 //
504
505//
506// NvmExpress Admin Abort Command
507//
508typedef struct {
509 //
510 // CDW 10
511 //
512 UINT32 Sqid:16; /* Submission Queue identifier */
513 UINT32 Cid:16; /* Command Identifier */
515
516//
517// NvmExpress Admin Firmware Activate Command
518//
519typedef struct {
520 //
521 // CDW 10
522 //
523 UINT32 Fs:3; /* Submission Queue identifier */
524 UINT32 Aa:2; /* Command Identifier */
527
528//
529// NvmExpress Admin Firmware Image Download Command
530//
531typedef struct {
532 //
533 // CDW 10
534 //
535 UINT32 Numd; /* Number of Dwords */
536 //
537 // CDW 11
538 //
539 UINT32 Ofst; /* Offset */
541
542//
543// NvmExpress Admin Get Features Command
544//
545typedef struct {
546 //
547 // CDW 10
548 //
549 UINT32 Fid:8; /* Feature Identifier */
550 UINT32 Sel:3; /* Select */
553
554//
555// NvmExpress Admin Get Log Page Command
556//
557typedef struct {
558 //
559 // CDW 10
560 //
561 UINT32 Lid:8; /* Log Page Identifier */
562 #define LID_ERROR_INFO 0x1
563 #define LID_SMART_INFO 0x2
564 #define LID_FW_SLOT_INFO 0x3
566 UINT32 Numd:12; /* Number of Dwords */
567 UINT32 Rsvd2:4; /* Reserved as of Nvm Express 1.1 Spec */
569
570//
571// NvmExpress Admin Set Features Command
572//
573typedef struct {
574 //
575 // CDW 10
576 //
577 UINT32 Fid:8; /* Feature Identifier */
579 UINT32 Sv:1; /* Save */
581
582//
583// NvmExpress Admin Format NVM Command
584//
585typedef struct {
586 //
587 // CDW 10
588 //
589 UINT32 Lbaf:4; /* LBA Format */
590 UINT32 Ms:1; /* Metadata Settings */
591 UINT32 Pi:3; /* Protection Information */
592 UINT32 Pil:1; /* Protection Information Location */
593 UINT32 Ses:3; /* Secure Erase Settings */
596
597//
598// NvmExpress Admin Security Receive Command
599//
600typedef struct {
601 //
602 // CDW 10
603 //
605 UINT32 Spsp:16; /* SP Specific */
606 UINT32 Secp:8; /* Security Protocol */
607 //
608 // CDW 11
609 //
610 UINT32 Al; /* Allocation Length */
612
613//
614// NvmExpress Admin Security Send Command
615//
616typedef struct {
617 //
618 // CDW 10
619 //
621 UINT32 Spsp:16; /* SP Specific */
622 UINT32 Secp:8; /* Security Protocol */
623 //
624 // CDW 11
625 //
626 UINT32 Tl; /* Transfer Length */
628
645
654
655typedef union {
656 NVME_ADMIN_CMD Admin; // Union of Admin commands
657 NVME_CMD Nvm; // Union of Nvm commands
660
661//
662// Submission Queue
663//
664typedef struct {
665 //
666 // CDW 0, Common to all comnmands
667 //
668 UINT8 Opc; // Opcode
669 UINT8 Fuse:2; // Fused Operation
671 UINT8 Psdt:1; // PRP or SGL for Data Transfer
672 UINT16 Cid; // Command Identifier
673
674 //
675 // CDW 1
676 //
677 UINT32 Nsid; // Namespace Identifier
678
679 //
680 // CDW 2,3
681 //
683
684 //
685 // CDW 4,5
686 //
687 UINT64 Mptr; // Metadata Pointer
688
689 //
690 // CDW 6-9
691 //
692 UINT64 Prp[2]; // First and second PRP entries
693
695
696} NVME_SQ;
697
698//
699// Completion Queue
700//
701typedef struct {
702 //
703 // CDW 0
704 //
706 //
707 // CDW 1
708 //
710 //
711 // CDW 2
712 //
713 UINT16 Sqhd; // Submission Queue Head Pointer
714 UINT16 Sqid; // Submission Queue Identifier
715 //
716 // CDW 3
717 //
718 UINT16 Cid; // Command Identifier
719 UINT16 Pt:1; // Phase Tag
720 UINT16 Sc:8; // Status Code
721 UINT16 Sct:3; // Status Code Type
723 UINT16 Mo:1; // More
724 UINT16 Dnr:1; // Do Not Retry
725} NVME_CQ;
726
727//
728// Nvm Express Admin cmd opcodes
729//
730#define NVME_ADMIN_DEIOSQ_CMD 0x00
731#define NVME_ADMIN_CRIOSQ_CMD 0x01
732#define NVME_ADMIN_GET_LOG_PAGE_CMD 0x02
733#define NVME_ADMIN_DEIOCQ_CMD 0x04
734#define NVME_ADMIN_CRIOCQ_CMD 0x05
735#define NVME_ADMIN_IDENTIFY_CMD 0x06
736#define NVME_ADMIN_ABORT_CMD 0x08
737#define NVME_ADMIN_SET_FEATURES_CMD 0x09
738#define NVME_ADMIN_GET_FEATURES_CMD 0x0A
739#define NVME_ADMIN_ASYNC_EVENT_REQUEST_CMD 0x0C
740#define NVME_ADMIN_NAMESACE_MANAGEMENT_CMD 0x0D
741#define NVME_ADMIN_FW_COMMIT_CMD 0x10
742#define NVME_ADMIN_FW_IAMGE_DOWNLOAD_CMD 0x11
743#define NVME_ADMIN_NAMESACE_ATTACHMENT_CMD 0x15
744#define NVME_ADMIN_FORMAT_NVM_CMD 0x80
745#define NVME_ADMIN_SECURITY_SEND_CMD 0x81
746#define NVME_ADMIN_SECURITY_RECEIVE_CMD 0x82
747
748#define NVME_IO_FLUSH_OPC 0
749#define NVME_IO_WRITE_OPC 1
750#define NVME_IO_READ_OPC 2
751
771
772//
773// Controller or Namespace Structure (CNS) field
774// (ref. spec. v1.1 figure 82).
775//
781
782//
783// Commit Action
784// (ref. spec. 1.1 figure 60).
785//
791
792//
793// Firmware Slot
794// (ref. spec. 1.1 Figure 60).
795//
806
807//
808// Get Log Page ? Log Page Identifiers
809// (ref. spec. v1.1 Figure 73).
810//
816
817//
818// Get Log Page ? Firmware Slot Information Log
819// (ref. spec. v1.1 Figure 77).
820//
821typedef struct {
822 //
823 // Indicates the firmware slot from which the actively running firmware revision was loaded.
824 //
827 //
828 // Indicates the firmware slot that is going to be activated at the next controller reset. If this field is 0h, then the controller does not indicate the firmware slot that is going to be activated at the next controller reset.
829 //
833
834//
835// Get Log Page ? Firmware Slot Information Log
836// (ref. spec. v1.1 Figure 77).
837//
838typedef struct {
839 //
840 // Specifies information about the active firmware revision.
841 //s
844 //
845 // Contains the revision of the firmware downloaded to firmware slot 1/7. If no valid firmware revision is present or if this slot is unsupported, all zeros shall be returned.
846 //
847 CHAR8 FwRevisionSlot[7][8];
848 UINT8 Reserved2[448];
850
851//
852// SMART / Health Information (Log Identifier 02h)
853// (ref. spec. v1.1 5.10.1.2)
854//
855typedef struct {
856 //
857 // This field indicates critical warnings for the state of the controller.
858 //
865 //
866 // Contains a value corresponding to a temperature in degrees Kelvin that represents the current composite temperature of the controller and namespace(s) associated with that controller. The manner in which this value is computed is implementation specific and may not represent the actual temperature of any physical point in the NVM subsystem.
867 //
869 //
870 // Contains a normalized percentage (0 to 100%) of the remaining spare capacity available.
871 //
873 //
874 // When the Available Spare falls below the threshold indicated in this field, an asynchronous event completion may occur. The value is indicated as a normalized percentage (0 to 100%).
875 //
877 //
878 // Contains a vendor specific estimate of the percentage of NVM subsystem life used based on the actual usage and the manufacturer?s prediction of NVM life. A value of 100 indicates that the estimated endurance of the NVM in the NVM subsystem has been consumed, but may not indicate an NVM subsystem failure. The value is allowed to exceed 100. Percentages greater than 254 shall be represented as 255. This value shall be updated once per power-on hour (when the controller is not in a sleep state).
879 //
882 //
883 // Contains the number of 512 byte data units the host has read from the controller; this value does not include metadata.
884 //
885 UINT8 DataUnitsRead[16];
886 //
887 // Contains the number of 512 byte data units the host has written to the controller; this value does not include metadata.
888 //
889 UINT8 DataUnitsWritten[16];
890 //
891 // Contains the number of read commands completed by the controller.
892 //
893 UINT8 HostReadCommands[16];
894 //
895 // Contains the number of write commands completed by the controller.
896 //
897 UINT8 HostWriteCommands[16];
898 //
899 // Contains the amount of time the controller is busy with I/O commands. This value is reported in minutes.
900 //
901 UINT8 ControllerBusyTime[16];
902 //
903 // Contains the number of power cycles.
904 //
905 UINT8 PowerCycles[16];
906 //
907 // Contains the number of power-on hours.
908 //
909 UINT8 PowerOnHours[16];
910 //
911 // Contains the number of unsafe shutdowns.
912 //
913 UINT8 UnsafeShutdowns[16];
914 //
915 // Contains the number of occurrences where the controller detected an unrecovered data integrity error.
916 //
917 UINT8 MediaAndDataIntegrityErrors[16];
918 //
919 // Contains the number of Error Information log entries over the life of the controller.
920 //
921 UINT8 NumberErrorInformationLogEntries[16];
922 //
923 // Contains the amount of time in minutes that the controller is operational and the Composite Temperature is greater than or equal to the Warning Composite Temperature Threshold (WCTEMP) field and less than the Critical Composite Temperature Threshold (CCTEMP) field in the Identify Controller data structure in Figure 90.
924 //
926 //
927 // Contains the amount of time in minutes that the controller is operational and the Composite Temperature is greater the Critical Composite Temperature Threshold (CCTEMP) field in the Identify Controller data structure in Figure 90.
928 //
930 //
931 // Contains the current temperature in degrees Kelvin reported by the temperature sensor. An implementation that does not implement the temperature sensor reports a temperature of zero degrees Kelvin.
932 //
933 UINT16 TemperatureSensor[8];
934 UINT8 Reserved2[296];
936
937#pragma pack()
938
939#endif
char CHAR8
Definition ProcessorBind.h:109
unsigned int UINT32
Definition ProcessorBind.h:102
uint32_t Reserved1
Definition pe.h:18
NVME_FW_ACTIVATE_ACTION
Definition Nvme.h:786
@ ActivateActionReplace
Definition Nvme.h:787
@ ActivateActionActivate
Definition Nvme.h:789
@ ActivateActionReplaceActivate
Definition Nvme.h:788
#define NVME_ADMIN_CRIOSQ_CMD
Definition Nvme.h:731
#define NVME_ADMIN_NAMESACE_ATTACHMENT_CMD
Definition Nvme.h:743
#define NVME_ADMIN_IDENTIFY_CMD
Definition Nvme.h:735
#define NVME_ADMIN_DEIOSQ_CMD
Definition Nvme.h:730
#define NVME_ADMIN_SET_FEATURES_CMD
Definition Nvme.h:737
#define NVME_ADMIN_NAMESACE_MANAGEMENT_CMD
Definition Nvme.h:740
#define LID_ERROR_INFO
Definition Nvme.h:562
#define NVME_ADMIN_GET_LOG_PAGE_CMD
Definition Nvme.h:732
NVME_LOG_ID
Definition Nvme.h:811
@ ErrorInfoLogID
Definition Nvme.h:812
@ FirmwareSlotInfoLogID
Definition Nvme.h:814
@ SmartHealthInfoLogID
Definition Nvme.h:813
#define NVME_ADMIN_FW_COMMIT_CMD
Definition Nvme.h:741
#define NVME_ADMIN_FORMAT_NVM_CMD
Definition Nvme.h:744
#define LID_SMART_INFO
Definition Nvme.h:563
NVME_ADMIN_COMMAND_OPCODE
Definition Nvme.h:752
@ CreateIOCompletionQueueOpcode
Definition Nvme.h:757
@ NamespaceAttachmentOpcode
Definition Nvme.h:766
@ GetLogPageOpcode
Definition Nvme.h:755
@ FirmwareImageDownloadOpcode
Definition Nvme.h:765
@ FormatNvmOpcode
Definition Nvme.h:767
@ DeleteIOCompletionQueueOpcode
Definition Nvme.h:756
@ SetFeaturesOpcode
Definition Nvme.h:760
@ GetFeaturesOpcode
Definition Nvme.h:761
@ DeleteIOSubmissionQueueOpcode
Definition Nvme.h:753
@ IdentifyOpcode
Definition Nvme.h:758
@ NamespaceManagementOpcode
Definition Nvme.h:763
@ FirmwareCommitOpcode
Definition Nvme.h:764
@ SecurityReceiveOpcode
Definition Nvme.h:769
@ CreateIOSubmissionQueueOpcode
Definition Nvme.h:754
@ AsyncEventRequestOpcode
Definition Nvme.h:762
@ SecuritySendOpcode
Definition Nvme.h:768
@ AbortOpcode
Definition Nvme.h:759
#define NVME_ADMIN_DEIOCQ_CMD
Definition Nvme.h:733
#define NVME_ADMIN_SECURITY_RECEIVE_CMD
Definition Nvme.h:746
#define LID_FW_SLOT_INFO
Definition Nvme.h:564
NVME_FW_ACTIVATE_SLOT
Definition Nvme.h:796
@ FirmwareSlot7
Definition Nvme.h:804
@ FirmwareSlot5
Definition Nvme.h:802
@ FirmwareSlotCtrlChooses
Definition Nvme.h:797
@ FirmwareSlot2
Definition Nvme.h:799
@ FirmwareSlot6
Definition Nvme.h:803
@ FirmwareSlot3
Definition Nvme.h:800
@ FirmwareSlot4
Definition Nvme.h:801
@ FirmwareSlot1
Definition Nvme.h:798
#define NVME_ADMIN_CRIOCQ_CMD
Definition Nvme.h:734
NVME_ADMIN_IDENTIFY_CNS
Definition Nvme.h:776
@ IdentifyControllerCns
Definition Nvme.h:778
@ IdentifyNamespaceCns
Definition Nvme.h:777
@ IdentifyActiveNsListCns
Definition Nvme.h:779
#define NVME_ADMIN_FW_IAMGE_DOWNLOAD_CMD
Definition Nvme.h:742
#define NVME_ADMIN_ABORT_CMD
Definition Nvme.h:736
#define NVME_ADMIN_ASYNC_EVENT_REQUEST_CMD
Definition Nvme.h:739
#define NVME_ADMIN_GET_FEATURES_CMD
Definition Nvme.h:738
#define NVME_ADMIN_SECURITY_SEND_CMD
Definition Nvme.h:745
unsigned short UINT16
Definition actypes.h:237
unsigned char UINT8
Definition actypes.h:236
COMPILER_DEPENDENT_UINT64 UINT64
Definition actypes.h:239
Definition Nvme.h:821
UINT8 ActivelyRunningFwSlot
Definition Nvme.h:825
UINT8 NextActiveFwSlot
Definition Nvme.h:830
Definition Nvme.h:508
UINT32 Cid
Definition Nvme.h:513
UINT32 Sqid
Definition Nvme.h:512
Definition Nvme.h:330
UINT8 Acl
Definition Nvme.h:354
UINT16 Acwu
Definition Nvme.h:378
UINT8 Sqes
Definition Nvme.h:366
UINT16 Ssvid
Definition Nvme.h:335
UINT16 Rsvd3
Definition Nvme.h:368
UINT8 Lpa
Definition Nvme.h:357
UINT8 Frmw
Definition Nvme.h:356
UINT8 Nvscc
Definition Nvme.h:376
UINT16 Oacs
Definition Nvme.h:349
UINT8 Rab
Definition Nvme.h:340
UINT16 Awun
Definition Nvme.h:374
UINT8 Vwc
Definition Nvme.h:373
UINT16 Vid
Definition Nvme.h:334
UINT16 Awupf
Definition Nvme.h:375
UINT8 Elpe
Definition Nvme.h:358
UINT8 Apsta
Definition Nvme.h:361
UINT8 Cmic
Definition Nvme.h:342
UINT8 Mdts
Definition Nvme.h:343
UINT16 Oncs
Definition Nvme.h:370
UINT16 Rsvd5
Definition Nvme.h:379
UINT32 Sgls
Definition Nvme.h:380
UINT8 Aerl
Definition Nvme.h:355
UINT8 Cqes
Definition Nvme.h:367
UINT8 Npss
Definition Nvme.h:359
UINT32 Nn
Definition Nvme.h:369
UINT8 Avscc
Definition Nvme.h:360
UINT8 Rsvd4
Definition Nvme.h:377
UINT16 Fuses
Definition Nvme.h:371
UINT8 Fna
Definition Nvme.h:372
Definition Nvme.h:448
UINT32 Ien
Definition Nvme.h:459
UINT32 Iv
Definition Nvme.h:461
UINT32 Rsvd1
Definition Nvme.h:460
UINT32 Qid
Definition Nvme.h:452
UINT32 Pc
Definition Nvme.h:458
UINT32 Qsize
Definition Nvme.h:453
Definition Nvme.h:467
UINT32 Qsize
Definition Nvme.h:472
UINT32 Qid
Definition Nvme.h:471
UINT32 Cqid
Definition Nvme.h:480
UINT32 Rsvd1
Definition Nvme.h:479
UINT32 Pc
Definition Nvme.h:477
UINT32 Qprio
Definition Nvme.h:478
Definition Nvme.h:486
UINT16 Qid
Definition Nvme.h:490
UINT16 Rsvd1
Definition Nvme.h:491
Definition Nvme.h:497
UINT16 Rsvd1
Definition Nvme.h:502
UINT16 Qid
Definition Nvme.h:501
Definition Nvme.h:519
UINT32 Rsvd1
Definition Nvme.h:525
UINT32 Fs
Definition Nvme.h:523
UINT32 Aa
Definition Nvme.h:524
UINT32 Ofst
Definition Nvme.h:539
UINT32 Numd
Definition Nvme.h:535
Definition Nvme.h:585
UINT32 Ms
Definition Nvme.h:590
UINT32 Rsvd1
Definition Nvme.h:594
UINT32 Pil
Definition Nvme.h:592
UINT32 Pi
Definition Nvme.h:591
UINT32 Lbaf
Definition Nvme.h:589
UINT32 Ses
Definition Nvme.h:593
Definition Nvme.h:545
UINT32 Fid
Definition Nvme.h:549
UINT32 Rsvd1
Definition Nvme.h:551
UINT32 Sel
Definition Nvme.h:550
Definition Nvme.h:557
UINT32 Numd
Definition Nvme.h:566
UINT32 Rsvd1
Definition Nvme.h:565
UINT32 Lid
Definition Nvme.h:561
UINT32 Rsvd2
Definition Nvme.h:567
Definition Nvme.h:437
UINT32 Cns
Definition Nvme.h:441
UINT32 Rsvd1
Definition Nvme.h:442
Definition Nvme.h:408
UINT8 Nsfeat
Definition Nvme.h:415
UINT64 Nuse
Definition Nvme.h:414
UINT8 Mc
Definition Nvme.h:418
UINT8 Rescap
Definition Nvme.h:422
UINT64 Eui64
Definition Nvme.h:424
UINT64 Nsze
Definition Nvme.h:412
UINT8 Flbas
Definition Nvme.h:417
UINT64 Ncap
Definition Nvme.h:413
UINT8 Nmic
Definition Nvme.h:421
UINT8 Dps
Definition Nvme.h:420
UINT8 Nlbaf
Definition Nvme.h:416
UINT8 Dpc
Definition Nvme.h:419
Definition Nvme.h:600
UINT32 Spsp
Definition Nvme.h:605
UINT32 Secp
Definition Nvme.h:606
UINT32 Al
Definition Nvme.h:610
UINT32 Rsvd1
Definition Nvme.h:604
Definition Nvme.h:616
UINT32 Rsvd1
Definition Nvme.h:620
UINT32 Secp
Definition Nvme.h:622
UINT32 Tl
Definition Nvme.h:626
UINT32 Spsp
Definition Nvme.h:621
Definition Nvme.h:573
UINT32 Sv
Definition Nvme.h:579
UINT32 Rsvd1
Definition Nvme.h:578
UINT32 Fid
Definition Nvme.h:577
Definition Nvme.h:108
UINT16 Asqs
Definition Nvme.h:109
UINT16 Rsvd1
Definition Nvme.h:110
UINT16 Acqs
Definition Nvme.h:111
UINT16 Rsvd2
Definition Nvme.h:112
Definition Nvme.h:53
UINT8 Mpsmax
Definition Nvme.h:64
UINT16 Css
Definition Nvme.h:61
UINT8 Ams
Definition Nvme.h:56
UINT8 Mpsmin
Definition Nvme.h:63
UINT16 Nssrs
Definition Nvme.h:60
UINT16 Mqes
Definition Nvme.h:54
UINT16 Dstrd
Definition Nvme.h:59
UINT8 Rsvd1
Definition Nvme.h:57
UINT16 Rsvd3
Definition Nvme.h:62
UINT8 Rsvd4
Definition Nvme.h:65
UINT8 Cqr
Definition Nvme.h:55
UINT8 To
Definition Nvme.h:58
Definition Nvme.h:79
UINT16 Css
Definition Nvme.h:82
UINT8 Iocqes
Definition Nvme.h:87
UINT16 En
Definition Nvme.h:80
UINT16 Rsvd1
Definition Nvme.h:81
UINT16 Ams
Definition Nvme.h:84
UINT8 Rsvd2
Definition Nvme.h:88
UINT16 Mps
Definition Nvme.h:83
UINT8 Iosqes
Definition Nvme.h:86
UINT16 Shn
Definition Nvme.h:85
Definition Nvme.h:271
UINT16 Nlb
Definition Nvme.h:279
UINT32 Rsvd2
Definition Nvme.h:287
UINT32 Eilbrt
Definition Nvme.h:291
UINT16 Rsvd1
Definition Nvme.h:280
UINT64 Slba
Definition Nvme.h:275
UINT16 Lr
Definition Nvme.h:283
UINT16 Prinfo
Definition Nvme.h:281
UINT16 Elbat
Definition Nvme.h:295
UINT16 Fua
Definition Nvme.h:282
UINT16 Elbatm
Definition Nvme.h:296
Definition Nvme.h:135
UINT16 Rsvd1
Definition Nvme.h:137
UINT16 Cqh
Definition Nvme.h:136
Definition Nvme.h:701
UINT16 Mo
Definition Nvme.h:723
UINT16 Cid
Definition Nvme.h:718
UINT16 Sqid
Definition Nvme.h:714
UINT16 Sqhd
Definition Nvme.h:713
UINT32 Rsvd1
Definition Nvme.h:709
UINT32 Dword0
Definition Nvme.h:705
UINT16 Rsvd2
Definition Nvme.h:722
UINT16 Sct
Definition Nvme.h:721
UINT16 Dnr
Definition Nvme.h:724
UINT16 Sc
Definition Nvme.h:720
UINT16 Pt
Definition Nvme.h:719
Definition Nvme.h:96
UINT32 Cfs
Definition Nvme.h:98
UINT32 Shst
Definition Nvme.h:99
UINT32 Rsvd1
Definition Nvme.h:101
UINT32 Nssro
Definition Nvme.h:100
UINT32 Rdy
Definition Nvme.h:97
Definition Nvme.h:215
UINT32 Flush
Definition Nvme.h:219
Definition Nvme.h:838
NVME_ACTIVE_FW_INFO ActiveFwInfo
Definition Nvme.h:842
Definition Nvme.h:394
UINT16 Ms
Definition Nvme.h:395
UINT8 Rsvd1
Definition Nvme.h:402
UINT8 Rp
Definition Nvme.h:397
UINT8 Lbads
Definition Nvme.h:396
Definition Nvme.h:308
UINT8 Mps
Definition Nvme.h:311
UINT8 Rsvd3
Definition Nvme.h:317
UINT8 Rsvd6
Definition Nvme.h:323
UINT8 Rrl
Definition Nvme.h:318
UINT16 Mp
Definition Nvme.h:309
UINT32 Exlat
Definition Nvme.h:315
UINT8 Rsvd2
Definition Nvme.h:313
UINT8 Rwt
Definition Nvme.h:320
UINT8 Nops
Definition Nvme.h:312
UINT8 Rrt
Definition Nvme.h:316
UINT8 Rwl
Definition Nvme.h:322
UINT32 Enlat
Definition Nvme.h:314
UINT8 Rsvd4
Definition Nvme.h:319
UINT8 Rsvd1
Definition Nvme.h:310
UINT8 Rsvd5
Definition Nvme.h:321
Definition Nvme.h:646
UINT32 Cdw15
Definition Nvme.h:652
UINT32 Cdw14
Definition Nvme.h:651
UINT32 Cdw12
Definition Nvme.h:649
UINT32 Cdw10
Definition Nvme.h:647
UINT32 Cdw13
Definition Nvme.h:650
UINT32 Cdw11
Definition Nvme.h:648
Definition Nvme.h:145
UINT16 Elbat
Definition Nvme.h:173
UINT32 In
Definition Nvme.h:164
UINT32 Rsvd2
Definition Nvme.h:165
UINT64 Slba
Definition Nvme.h:149
UINT16 Prinfo
Definition Nvme.h:155
UINT32 Al
Definition Nvme.h:162
UINT32 Eilbrt
Definition Nvme.h:169
UINT16 Fua
Definition Nvme.h:156
UINT16 Lr
Definition Nvme.h:157
UINT32 Af
Definition Nvme.h:161
UINT16 Elbatm
Definition Nvme.h:174
UINT16 Nlb
Definition Nvme.h:153
UINT16 Rsvd1
Definition Nvme.h:154
UINT32 Sr
Definition Nvme.h:163
Definition Nvme.h:855
UINT8 CriticalWarningMediaReadOnly
Definition Nvme.h:862
UINT8 AvailableSpare
Definition Nvme.h:872
UINT32 CriticalCompositeTemperatureTime
Definition Nvme.h:929
UINT8 AvailableSpareThreshold
Definition Nvme.h:876
UINT8 CriticalWarningAvailableSpare
Definition Nvme.h:859
UINT8 CriticalWarningTemperature
Definition Nvme.h:860
UINT8 CriticalWarningVolatileBackup
Definition Nvme.h:863
UINT8 PercentageUsed
Definition Nvme.h:880
UINT8 CriticalWarningReserved
Definition Nvme.h:864
UINT32 WarningCompositeTemperatureTime
Definition Nvme.h:925
UINT16 CompositeTemp
Definition Nvme.h:868
UINT8 CriticalWarningReliability
Definition Nvme.h:861
Definition Nvme.h:127
UINT16 Rsvd1
Definition Nvme.h:129
UINT16 Sqt
Definition Nvme.h:128
Definition Nvme.h:664
UINT8 Opc
Definition Nvme.h:668
UINT8 Fuse
Definition Nvme.h:669
UINT64 Rsvd2
Definition Nvme.h:682
UINT8 Rsvd1
Definition Nvme.h:670
NVME_PAYLOAD Payload
Definition Nvme.h:694
UINT32 Nsid
Definition Nvme.h:677
UINT8 Psdt
Definition Nvme.h:671
UINT16 Cid
Definition Nvme.h:672
UINT64 Mptr
Definition Nvme.h:687
Definition Nvme.h:71
UINT16 Mjr
Definition Nvme.h:73
UINT16 Mnr
Definition Nvme.h:72
Definition Nvme.h:225
UINT32 Rsvd1
Definition Nvme.h:234
UINT64 Slba
Definition Nvme.h:229
UINT32 Nlb
Definition Nvme.h:233
Definition Nvme.h:240
UINT32 Ilbrt
Definition Nvme.h:260
UINT16 Lbat
Definition Nvme.h:264
UINT32 Rsvd2
Definition Nvme.h:256
UINT16 Lbatm
Definition Nvme.h:265
UINT16 Nlb
Definition Nvme.h:248
UINT16 Fua
Definition Nvme.h:251
UINT16 Rsvd1
Definition Nvme.h:249
UINT16 Lr
Definition Nvme.h:252
UINT16 Prinfo
Definition Nvme.h:250
UINT64 Slba
Definition Nvme.h:244
Definition Nvme.h:180
UINT16 Fua
Definition Nvme.h:191
UINT32 Al
Definition Nvme.h:197
UINT16 Lbat
Definition Nvme.h:208
UINT16 Lr
Definition Nvme.h:192
UINT16 Lbatm
Definition Nvme.h:209
UINT16 Nlb
Definition Nvme.h:188
UINT32 Ilbrt
Definition Nvme.h:204
UINT32 Rsvd2
Definition Nvme.h:200
UINT32 Sr
Definition Nvme.h:198
UINT32 Af
Definition Nvme.h:196
UINT64 Slba
Definition Nvme.h:184
UINT32 In
Definition Nvme.h:199
UINT16 Rsvd1
Definition Nvme.h:189
UINT16 Prinfo
Definition Nvme.h:190
Definition Nvme.h:629
NVME_ADMIN_FORMAT_NVM FormatNvm
Definition Nvme.h:641
NVME_ADMIN_FIRMWARE_IMAGE_DOWNLOAD FirmwareImageDownload
Definition Nvme.h:637
NVME_ADMIN_IDENTIFY Identify
Definition Nvme.h:630
NVME_ADMIN_CRIOSQ CrIoSq
Definition Nvme.h:632
NVME_ADMIN_DEIOSQ DeIoSq
Definition Nvme.h:634
NVME_ADMIN_CRIOCQ CrIoCq
Definition Nvme.h:631
NVME_ADMIN_SECURITY_RECEIVE SecurityReceive
Definition Nvme.h:642
NVME_ADMIN_DEIOCQ DeIoCq
Definition Nvme.h:633
NVME_ADMIN_SECURITY_SEND SecuritySend
Definition Nvme.h:643
NVME_ADMIN_SET_FEATURES SetFeatures
Definition Nvme.h:640
NVME_ADMIN_GET_LOG_PAGE GetLogPage
Definition Nvme.h:639
NVME_ADMIN_ABORT Abort
Definition Nvme.h:635
NVME_ADMIN_GET_FEATURES GetFeatures
Definition Nvme.h:638
NVME_ADMIN_FIRMWARE_ACTIVATE Activate
Definition Nvme.h:636
Definition Nvme.h:299
NVME_WRITE Write
Definition Nvme.h:301
NVME_FLUSH Flush
Definition Nvme.h:302
NVME_WRITE_UNCORRECTABLE WriteUncorrectable
Definition Nvme.h:303
NVME_COMPARE Compare
Definition Nvme.h:305
NVME_WRITE_ZEROES WriteZeros
Definition Nvme.h:304
NVME_READ Read
Definition Nvme.h:300
Definition Nvme.h:655
NVME_RAW Raw
Definition Nvme.h:658
NVME_CMD Nvm
Definition Nvme.h:657
NVME_ADMIN_CMD Admin
Definition Nvme.h:656