OpenSSD Cosmos+ Platform Firmware  0.0.2
The firmware of Cosmos+ OpenSSD Platform for TOSHIBA nand flash module.
nvme.h
Go to the documentation of this file.
1
2// nvme.h for Cosmos+ OpenSSD
3// Copyright (c) 2016 Hanyang University ENC Lab.
4// Contributed by Yong Ho Song <yhsong@enc.hanyang.ac.kr>
5// Youngjin Jo <yjjo@enc.hanyang.ac.kr>
6// Sangjin Lee <sjlee@enc.hanyang.ac.kr>
7//
8// This file is part of Cosmos+ OpenSSD.
9//
10// Cosmos+ OpenSSD is free software; you can redistribute it and/or modify
11// it under the terms of the GNU General Public License as published by
12// the Free Software Foundation; either version 3, or (at your option)
13// any later version.
14//
15// Cosmos+ OpenSSD is distributed in the hope that it will be useful,
16// but WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18// See the GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Cosmos+ OpenSSD; see the file COPYING.
22// If not, see <http://www.gnu.org/licenses/>.
24
26// Company: ENC Lab. <http://enc.hanyang.ac.kr>
27// Engineer: Sangjin Lee <sjlee@enc.hanyang.ac.kr>
28//
29// Project Name: Cosmos+ OpenSSD
30// Design Name: Cosmos+ Firmware
31// Module Name: NVMe header
32// File Name: nvme.h
33//
34// Version: v1.0.1
35//
36// Description:
37// - defines parameters and data structures of the NVMe controller
39
41// Revision History:
42//
43// * v1.0.1
44// - Status code types are added
45// - Status codes are added
46//
47// * v1.0.0
48// - First draft
50
51#ifndef __NVME_H_
52#define __NVME_H_
53
54#define MAX_NUM_OF_IO_SQ 8
55#define MAX_NUM_OF_IO_CQ 8
56
57#define ADMIN_CMD_DRAM_DATA_BUFFER 0x00200000
58
59#define STORAGE_CAPACITY_L 0x00000000 // not used
60#define STORAGE_CAPACITY_H 0x00000000
61
62#define MAX_NUM_OF_NLB (512 * 1024 / 4096)
63
64/*Opcodes for Admin Commands */
65#define ADMIN_DELETE_IO_SQ 0x00
66#define ADMIN_CREATE_IO_SQ 0x01
67#define ADMIN_GET_LOG_PAGE 0x02
68#define ADMIN_DELETE_IO_CQ 0x04
69#define ADMIN_CREATE_IO_CQ 0x05
70#define ADMIN_IDENTIFY 0x06
71#define ADMIN_ABORT 0x08
72#define ADMIN_SET_FEATURES 0x09
73#define ADMIN_GET_FEATURES 0x0A
74#define ADMIN_ASYNCHRONOUS_EVENT_REQUEST 0x0C
75#define ADMIN_FIRMWARE_ACTIVATE 0x10
76#define ADMIN_FIRMWARE_IMAGE_DOWNLOAD 0x11
77#define ADMIN_FORMAT_NVM 0x80
78#define ADMIN_DOORBELL_BUFFER_CONFIG 0x7C
79#define ADMIN_SECURITY_SEND 0x81
80#define ADMIN_SECURITY_RECEIVE 0x82
81
82/*Opcodes for IO Commands */
83#define IO_NVM_FLUSH 0x00
84#define IO_NVM_WRITE 0x01
85#define IO_NVM_READ 0x02
86#define IO_NVM_WRITE_UNCORRECTABLE 0x04 /* Not acceptable yet */
87#define IO_NVM_COMPARE 0x05 /* Not acceptable yet */
88#define IO_NVM_DATASET_MANAGEMENT 0x09 /* Not acceptable yet */
89
90/*Status Code Type */
91#define SCT_GENERIC_COMMAND_STATUS 0
92#define SCT_COMMAND_SPECIFIC_STATUS 1
93#define SCT_MEDIA_AND_DATA_INTEGRITY_ERRORS 2
94#define SCT_VENDOR_SPECIFIC 7
95
96/*Status Code - Generic Command Status Values */
97#define SC_SUCCESSFUL_COMPLETION 0x00
98#define SC_INVALID_COMMAND_OPCODE 0x01
99#define SC_INVALID_FIELD_IN_COMMAND 0x02
100#define SC_COMMAND_ID_CONFLICT 0x03
101#define SC_DATA_TRANSFER_ERROR 0x04
102#define SC_COMMANDS_ABORTED_DUE_TO_POWER_LOSS_NOTIFICATION 0x05
103#define SC_INTERNAL_DEVICE_ERROR 0x06
104#define SC_COMMAND_ABORT_REQUESTED 0x07
105#define SC_COMMAND_ABORTED_DUE_TO_SQ_DELETION 0x08
106#define SC_COMMAND_ABORTED_DUE_TO_FAILED_FUSED_COMMAND 0x09
107#define SC_COMMAND_ABORTED_DUE_TO_MISSING_FUSED_COMMAND 0x0A
108#define SC_INVALID_NAMESPACE_OR_FORMAT 0x0B
109#define SC_COMMAND_SEQUENCE_ERROR 0x0C
110#define SC_INVALID_SGL_SEGMENT_DESCRIPTOR 0x0D
111#define SC_INVALID_NUMBER_OF_SGL_DESCRIPTORS 0x0E
112#define SC_DATA_SGL_LENGTH_INVALID 0x0F
113#define SC_METADATA_SGL_LENGTH_INVALID 0x10
114#define SC_SGL_DESCRIPTOR_TYPE_INVALID 0x11
115#define SC_INVALID_USE_OF_CONTROLLER_MEMORY_BUFFER 0x12
116#define SC_PRP_OFFSET_INVALID 0x13
117#define SC_ATOMIC_WRITE_UNIT_EXCEEDED 0x14
118#define SC_SGL_OFFSET_INVALID 0x16
119#define SC_SGL_SUB_TYPE_INVALID 0x17
120#define SC_HOST_IDENTIFIER_INCONSISTENT_FORMAT 0x18
121#define SC_KEEP_ALIVE_TIMEOUT_EXPIRED 0x19
122#define SC_KEEP_ALIVE_TIMEOUT_INVALID 0x1A
123
124/*Status Code - Generic Command Status Values, NVM Command Set */
125#define SC_LBA_OUT_OF_RANGE 0x80
126#define SC_CAPACITY_EXCEEDED 0x81
127#define SC_NAMESPACE_NOT_READY 0x82
128#define SC_RESERVATION_CONFLICT 0x83
129#define SC_FORMAT_IN_PROGRESS 0x84
130
131/*Status Code - Command Specific Status Values */
132#define SC_COMPLETION_QUEUE_INVALID 0x00 // Create I/O Submission Queue
133#define SC_INVALID_QUEUE_IDENTIFIER \
134 0x01 // Create I/O Submission Queue, Create I/O Completion Queue, Delete I/O Completion Queue, Delete I/O
135 // Submission Queue
136#define SC_INVALID_QUEUE_SIZE 0x02 // Create I/O Submission Queue, Create I/O Completion Queue
137#define SC_ABORT_COMMAND_LIMIT_EXCEEDED 0x03 // Abort
138#define SC_ASYNCHRONOUS_EVENT_REQUEST_LIMIT_EXCEEDED 0x05 // Asynchronous Event Request
139#define SC_INVALID_FIRMWARE_SLOT 0x06 // Firmware Commit
140#define SC_INVALID_FIRMWARE_IMAGE 0x07 // Firmware Commit
141#define SC_INVALID_INTERRUPT_VECTOR 0x08 // Create I/O Completion Queue
142#define SC_INVALID_LOG_PAGE 0x09 // Get Log Page
143#define SC_INVALID_FORMAT 0x0A // Format NVM, Namespace Management
144#define SC_FIRMWARE_ACTIVATION_REQUIRES_CONVENTIONAL_RESET 0x0B // Firmware Commit
145#define SC_INVALID_QUEUE_DELETION 0x0C // Delete I/O Completion Queue
146#define SC_FEATURE_IDENTIFIER_NOT_SAVEABLE 0x0D // Set Features
147#define SC_FEATURE_NOT_CHANGEABLE 0x0E // Set Features
148#define SC_FEATURE_NOT_NAMESPACE_SPECIFIC 0x0F // Set Features
149#define SC_FIRMWARE_ACTIVATION_REQUIRES_NVM_SUBSYSTEM_RESET 0x10 // Firmware Commit
150#define SC_FIRMWARE_ACTIVATION_REQUIRES_RESET 0x11 // Firmware Commit
151#define SC_FIRMWARE_ACTIVATION_REQUIRES_MAXIMUM_TIME_VIOLATION 0x12 // Firmware Commit
152#define SC_FIRMWARE_ACTIVATION_PROHIBITED 0x13 // Firmware Commit
153#define SC_OVERLAPPING_RANGE 0x14 // Firmware Commit, Firmware Image Download,Set Features
154#define SC_NAMESPACE_INSUFFICIENT_CAPACITY 0x15 // Namespace Management
155#define SC_NAMESPACE_IDENTIFIER_UNAVAILABLE 0x16 // Namespace Management
156#define SC_NAMESPACE_ALREADY_ATTACHED 0x18 // Namespace Attachment
157#define SC_NAMESPACE_IS_PRIVATE 0x19 // Namespace Attachment
158#define SC_NAMESPACE_NOT_ATTACHED 0x1A // Namespace Attachment
159#define SC_THIN_PROVISIONING_NOT_SUPPORTED 0x1B // Namespace Management
160#define SC_CONTROLLER_LIST_INVALID 0x1C // Namespace Attachment
161
162/*Status Code - Command Specific Status Values, NVM Command Set */
163#define SC_CONFLICTING_ATTRIBUTES 0x80 // Dataset Management, Read, Write
164#define SC_INVALID_PROTECTION_INFORMATION 0x81 // Compare, Read, Write, Write Zeroes
165#define SC_ATTEMPTED_WRITE_TO_READ_ONLY_RANGE 0x82 // Dataset Management, Write, Write Uncorrectable, Write Zeroes
166
167/*Status Code - Media and Data Integrity Error Values, NVM Command Set */
168#define SC_WRITE_FAULT 0x80
169#define SC_UNRECOVERED_READ_ERROR 0x81
170#define SC_END_TO_END_GUARD_CHECK_ERROR 0x82
171#define SC_END_TO_END_APPLICATION_TAG_CHECK_ERROR 0x83
172#define SC_END_TO_END_REFERENCE_TAG_CHECK_ERROR 0x84
173#define SC_COMPARE_FAILURE 0x85
174#define SC_ACCESS_DENIED 0x86
175#define SC_DEALLOCATED_OR_UNWRITTEN_LOGICAL_BLOCK 0x87
176
177/* Set/Get Features - Features Identifiers */
178
179#define ARBITRATION 0x01
180#define POWER_MANAGEMENT 0x02
181#define LBA_RANGE_TYPE 0x03
182#define TEMPERATURE_THRESHOLD 0x04
183#define ERROR_RECOVERY 0x05
184#define VOLATILE_WRITE_CACHE 0x06
185#define NUMBER_OF_QUEUES 0x07
186#define INTERRUPT_COALESCING 0x08
187#define INTERRUPT_VECTOR_CONFIGURATION 0x09
188#define WRITE_ATOMICITY 0x0A
189#define ASYNCHRONOUS_EVENT_CONFIGURATION 0x0B
190#define Power_State_Transition 0x0C
191#define Timestamp 0x0E
192#define SOFTWARE_PROGRESS_MARKER 0x80
193
194#define NVME_TASK_IDLE 0x0
195#define NVME_TASK_WAIT_CC_EN 0x1
196#define NVME_TASK_RUNNING 0x2
197#define NVME_TASK_SHUTDOWN 0x3
198#define NVME_TASK_WAIT_RESET 0x4
199#define NVME_TASK_RESET 0x5
200#pragma pack(push, 1)
201
205typedef struct _NVME_COMMAND
206{
207 unsigned short qID; // Queue ID, 0 for admin queue.
208 unsigned short cmdSlotTag; // TODO
209 unsigned int cmdSeqNum; // TODO
210
233 unsigned int cmdDword[16];
235
241{
242 union
243 {
244 unsigned int dword[16];
245 struct
246 {
247 struct
248 {
249 unsigned char OPC;
250 unsigned char FUSE : 2;
251 unsigned char reserved0 : 5;
252 unsigned char PSDT : 1;
253 unsigned short CID;
254 };
255 unsigned int NSID;
256 unsigned int reserved1[2];
257 unsigned int MPTR[2];
258 unsigned int PRP1[2];
259 unsigned int PRP2[2];
260 unsigned int dword10;
261 unsigned int dword11;
262 unsigned int dword12;
263 unsigned int dword13;
264 unsigned int dword14;
265 unsigned int dword15;
266 };
267 };
269
271{
272 union
273 {
274 unsigned int dword;
275 struct
276 {
277 unsigned short NCQA; // zero-based value
278 unsigned short NSQA; // zero-based value
279 };
280 };
282
287typedef struct _NVME_IO_COMMAND
288{
289 union
290 {
291 unsigned int dword[16];
292 struct
293 {
294 struct
295 {
296 unsigned char OPC;
297 unsigned char FUSE : 2;
298 unsigned char reserved0 : 5;
299 unsigned char PSDT : 1;
300 unsigned short CID;
301 };
302 unsigned int NSID;
303
315 unsigned int reserved1[2];
316
323 unsigned int MPTR[2];
324 unsigned int PRP1[2];
325 unsigned int PRP2[2];
326
332 unsigned int dword10;
333 unsigned int dword11;
334 unsigned int dword12;
335 unsigned int dword13;
336 unsigned int dword14;
337 unsigned int dword15;
338 };
339 };
341
349typedef struct _NVME_COMPLETION
350{
351 union
352 {
353 unsigned int dword[2];
354 struct
355 {
356 union
357 {
358 unsigned short statusFieldWord;
359 struct
360 {
361 unsigned short reserved0 : 1;
362 unsigned short SC : 8;
363 unsigned short SCT : 3;
364 unsigned short reserved1 : 2;
365 unsigned short MORE : 1;
366 unsigned short DNR : 1;
368 };
369
370 unsigned int specific;
371 };
372 };
374
376{
377 union
378 {
379 unsigned int dword;
380 struct
381 {
382 unsigned char FID;
383 unsigned char reserved0[2];
384 unsigned char reserved1 : 7;
385 unsigned char SV : 1;
386 };
387 };
389
391{
392 union
393 {
394 unsigned int dword;
395 struct
396 {
397 unsigned short NCQR;
398 unsigned short NSQR;
399 };
400 };
402
403/* Get Features Command */
405{
406 union
407 {
408 unsigned int dword;
409 struct
410 {
411 unsigned char FID;
412 unsigned char SEL : 3;
413 unsigned char reserved0 : 5;
414 unsigned char reserved1[2];
415 };
416 };
418
419/* Create I/O Completion Queue Command */
421{
422 union
423 {
424 unsigned int dword;
425 struct
426 {
427 unsigned short QID;
428 unsigned short QSIZE;
429 };
430 };
432
434{
435 union
436 {
437 unsigned int dword;
438 struct
439 {
440 unsigned short PC : 1;
441 unsigned short IEN : 1;
442 unsigned short reserved0 : 14;
443 unsigned short IV;
444 };
445 };
447
448/* Delete I/O Completion Queue Command */
450{
451 union
452 {
453 unsigned int dword;
454 struct
455 {
456 unsigned short QID;
457 unsigned short reserved0;
458 };
459 };
461
462/* Create I/O Submission Queue Command */
464{
465 union
466 {
467 unsigned int dword;
468 struct
469 {
470 unsigned short QID;
471 unsigned short QSIZE;
472 };
473 };
475
477{
478 union
479 {
480 unsigned int dword;
481 struct
482 {
483 unsigned short PC : 1;
484 unsigned short QPRIO : 2;
485 unsigned short reserved0 : 13;
486 unsigned short CQID;
487 };
488 };
490
491/* Delete I/O Submission Queue Command */
493{
494 union
495 {
496 unsigned int dword;
497 struct
498 {
499 unsigned short QID;
500 unsigned short reserved0;
501 };
502 };
504
505/* Identify Command */
507{
508 union
509 {
510 unsigned int dword;
511 struct
512 {
513 unsigned int CNS : 1;
514 unsigned int reserved0 : 31;
515 };
516 };
518
519/* Get Log Page Command */
521{
522 union
523 {
524 unsigned int dword;
525 struct
526 {
527 unsigned char LID;
528 unsigned char reserved0;
529 unsigned short NUMD : 12;
530 unsigned short reserved1 : 4;
531 };
532 };
534
535/* Identify - Power State Descriptor Data Structure */
537{
538 union
539 {
540 unsigned int dword[8];
541 struct
542 {
543 unsigned short MP;
544 unsigned short reserved0 : 8;
545 unsigned short MPS : 1;
546 unsigned short NOPS : 1;
547 unsigned short reserved1 : 6;
548 unsigned int ENLAT;
549 unsigned int EXLAT;
550 unsigned char RRT : 5;
551 unsigned char reserved2 : 3;
552 unsigned char RRL : 5;
553 unsigned char reserved3 : 3;
554 unsigned char RWT : 5;
555 unsigned char reserved4 : 3;
556 unsigned char RWL : 5;
557 unsigned char reserved5 : 3;
558 unsigned int reserved6[4];
559 };
560 };
562
563/* Identify Controller Data Structure */
565{
566 unsigned short VID;
567 unsigned short SSVID;
568 unsigned char SN[20];
569 unsigned char MN[40];
570 unsigned char FR[8];
571 unsigned char RAB;
572 unsigned char IEEE[3];
573 unsigned char CMIC;
574 unsigned char MDTS;
575 unsigned short CNTLID;
576 unsigned char reserved0[176];
577
578 struct
579 {
581 unsigned short supportsFormatNVM : 1;
583 unsigned short reserved0 : 13;
585
586 unsigned char ACL;
587 unsigned char AERL;
588
589 struct
590 {
591 unsigned char firstFirmwareSlotReadOnly : 1;
593 unsigned char reserved0 : 4;
595
596 struct
597 {
600 unsigned char reserved0 : 6;
602
603 unsigned char ELPE;
604 unsigned char NPSS;
605
606 unsigned char AVSCC : 1;
607 unsigned char reserved1 : 7;
608
609 unsigned char APSTA : 1;
610 unsigned char reserved2 : 7;
611
612 unsigned char reserved3[246];
613
614 struct
615 {
619
620 struct
621 {
625
626 unsigned char reserved4[2];
627 unsigned int NN;
628
629 struct
630 {
631 unsigned short supportsCompare : 1;
632 unsigned short supportsWriteUncorrectable : 1;
633 unsigned short supportsDataSetManagement : 1;
634 unsigned short reserved0 : 13;
636
637 struct
638 {
639 unsigned short supportsCompareWrite : 1;
640 unsigned short reserved0 : 15;
642
643 struct
644 {
647 unsigned char supportsCryptographicErase : 1;
648 unsigned char reserved0 : 5;
650
651 struct
652 {
653 unsigned char present : 1;
654 unsigned char reserved0 : 7;
656
657 unsigned short AWUN;
658 unsigned short AWUPF;
659
660 unsigned char NVSCC : 1;
661 unsigned char reserved5 : 7;
662
663 unsigned char reserved6;
664
665 unsigned short ACWU;
666
667 unsigned char reserved7[2];
668
669 struct
670 {
671 unsigned int supportsSGL : 1;
672 unsigned int reserved0 : 15;
674 unsigned int reserved1 : 15;
676
677 unsigned char reserved8[164];
678 unsigned char reserved9[1344];
679
681
682 unsigned char VS[1024];
683
685
686/* Identify - LBA Format Data Structure */
688{
689 unsigned short MS;
690 unsigned char LBADS;
691 unsigned char RP : 2;
692 unsigned char reserved : 6;
694
695/* Identify Namespace Data Structure */
697{
698 unsigned int NSZE[2];
699 unsigned int NCAP[2];
700 unsigned int NUSE[2];
701
702 struct
703 {
704 unsigned char supportsThinProvisioning : 1;
705 unsigned char reserved0 : 7;
707
708 unsigned char NLBAF;
709
710 struct
711 {
712 unsigned char supportedCombination : 4;
713 unsigned char supportsMetadataAtEndOfLBA : 1;
714 unsigned char reserved0 : 3;
716
717 struct
718 {
720 unsigned char supportsMetadataAsSeperate : 1;
721 unsigned char reserved0 : 6;
722 } MC;
723
724 struct
725 {
726 unsigned char supportsProtectionType1 : 1;
727 unsigned char supportsProtectionType2 : 1;
728 unsigned char supportsProtectionType3 : 1;
729 unsigned char supportsProtectionFirst8 : 1;
730 unsigned char supportsProtectionLast8 : 1;
731 unsigned char reserved0 : 3;
733
734 struct
735 {
736 unsigned char protectionEnabled : 3;
737 unsigned char protectionInFirst8 : 1;
738 unsigned char reserved0 : 4;
740
741 struct
742 {
743 unsigned char supportsMultipathIOSharing : 1;
744 unsigned char reserved0 : 7;
746
747 struct
748 {
755 unsigned char reserved0 : 2;
757
758 unsigned char reserved0[88];
759 unsigned char EUI64[8];
760
762
763 unsigned char reserved1[192];
764 unsigned char VS[3712];
765
767
768/* IO Write Command */
769
785{
786 union
787 {
788 unsigned int dword;
789 struct
790 {
791 unsigned short NLB;
792 unsigned short reserved0 : 10;
793 unsigned short PRINFO : 4;
794 unsigned short FUA : 1;
795 unsigned short LR : 1;
796 };
797 };
799
801{
802 union
803 {
804 unsigned int dword;
805 struct
806 {
807 struct
808 {
809 unsigned char AccessFrequency : 4;
818 unsigned char AccessLatency : 2;
819 unsigned char SequentialRequest : 1; // seq request or not
820 unsigned char Incompressible : 1; // could be compressed or not
822 unsigned char reserved0[3];
823 };
824 };
826
828{
829 union
830 {
831 unsigned int dword;
832 struct
833 {
834 unsigned short ELBAT;
835 unsigned short ELBATM;
836 };
837 };
839
840/* IO Read Command */
842{
843 union
844 {
845 unsigned int dword;
846 struct
847 {
848 /* Num of logical blocks to read, 0's based */
849 unsigned short NLB;
850 unsigned short reserved0 : 10;
851 /* Protection information action and check field */
852 unsigned short PRINFO : 4;
853 /* Force Unit Access */
854 unsigned short FUA : 1;
855 /* Enable Limited Retry or not */
856 unsigned short LR : 1;
857 };
858 };
860
862{
863 union
864 {
865 unsigned int dword;
866 struct
867 {
868 struct
869 {
870 unsigned char AccessFrequency : 4;
871 unsigned char AccessLatency : 2;
872 unsigned char SequentialRequest : 1;
873 unsigned char Incompressible : 1;
875 unsigned char reserved0[3];
876 };
877 };
879
881{
882 union
883 {
884 unsigned int dword;
885 struct
886 {
887 unsigned short ELBAT;
888 unsigned short ELBATM;
889 };
890 };
892
893/* IO Dataset Management Command */
895{
896 unsigned int NR : 8;
897 unsigned int reserved0 : 24;
899
901{
902 unsigned int IDR : 1;
903 unsigned int IDW : 1;
904 unsigned int AD : 1;
905 unsigned int reserved0 : 29;
907
909{
910 unsigned int AF : 4;
911 unsigned int AL : 2;
912 unsigned int reserved0 : 2;
913 unsigned int SR : 1;
914 unsigned int SW : 1;
915 unsigned int WP : 1;
916 unsigned int reserved1 : 13;
917 unsigned int CommandAccessSize : 8;
919
921{
924 unsigned int startingLBA[2];
926
927#pragma pack(pop)
928
930{
931 unsigned char enable;
932 unsigned char sqValid;
933 unsigned char cqValid;
934 unsigned char irqEn;
936
937typedef struct _NVME_IO_SQ_STATUS
938{
939 unsigned char valid;
940 unsigned char cqVector;
941 unsigned short qSzie;
942 unsigned int pcieBaseAddrL;
943 unsigned int pcieBaseAddrH;
945
946typedef struct _NVME_IO_CQ_STATUS
947{
948 unsigned char valid;
949 unsigned char irqEn;
950 unsigned short reserved0;
951 unsigned short irqVector;
952 unsigned short qSzie;
953 unsigned int pcieBaseAddrL;
954 unsigned int pcieBaseAddrH;
956
957typedef struct _NVME_STATUS
958{
959 unsigned int status;
960 unsigned int cacheEn;
962 unsigned short numOfIOSubmissionQueuesAllocated; // non zero-based value
963 unsigned short numOfIOCompletionQueuesAllocated; // non zero-based value
967
968#endif //__NVME_H_
struct _ADMIN_CREATE_IO_SQ_DW11 ADMIN_CREATE_IO_SQ_DW11
struct _NVME_ADMIN_COMMAND NVME_ADMIN_COMMAND
struct _NVME_STATUS NVME_CONTEXT
struct _IO_READ_COMMAND_DW12 IO_READ_COMMAND_DW12
struct _ADMIN_CREATE_IO_SQ_DW10 ADMIN_CREATE_IO_SQ_DW10
struct _IO_DATASET_MANAGEMENT_COMMAND_DW10 _IO_DATASET_MANAGEMENT_COMMAND_DW10
struct _ADMIN_DELETE_IO_SQ_DW10 ADMIN_DELETE_IO_SQ_DW10
struct _NVME_IO_CQ_STATUS NVME_IO_CQ_STATUS
struct _ADMIN_SET_FEATURES_DW10 ADMIN_SET_FEATURES_DW10
struct _ADMIN_GET_LOG_PAGE_DW10 ADMIN_GET_LOG_PAGE_DW10
struct _ADMIN_IDENTIFY_POWER_STATE_DESCRIPTOR ADMIN_IDENTIFY_POWER_STATE_DESCRIPTOR
struct _NVME_IO_COMMAND NVME_IO_COMMAND
struct _ADMIN_IDENTIFY_NAMESPACE ADMIN_IDENTIFY_NAMESPACE
struct _NVME_COMPLETION NVME_COMPLETION
The main structure of completion queue entry.
struct _DATASET_MANAGEMENT_RANGE DATASET_MANAGEMENT_RANGE
struct _IO_DATASET_MANAGEMENT_COMMAND_DW11 _IO_DATASET_MANAGEMENT_COMMAND_DW11
struct _ADMIN_CREATE_IO_CQ_DW11 ADMIN_CREATE_IO_CQ_DW11
struct _DATASET_MANAGEMENT_CONTEXT_ATTRIBUTES DATASET_MANAGEMENT_CONTEXT_ATTRIBUTES
#define MAX_NUM_OF_IO_SQ
Definition: nvme.h:54
struct _ADMIN_SET_FEATURES_NUMBER_OF_QUEUES_DW11 ADMIN_SET_FEATURES_NUMBER_OF_QUEUES_DW11
struct _IO_READ_COMMAND_DW15 IO_READ_COMMAND_DW15
struct _ADMIN_IDENTIFY_CONTROLLER ADMIN_IDENTIFY_CONTROLLER
struct _ADMIN_IDENTIFY_COMMAND_DW10 ADMIN_IDENTIFY_COMMAND_DW10
struct _NVME_IO_SQ_STATUS NVME_IO_SQ_STATUS
struct _ADMIN_GET_FEATURES_DW10 ADMIN_GET_FEATURES_DW10
struct _IO_READ_COMMAND_DW13 IO_READ_COMMAND_DW13
struct _ADMIN_CREATE_IO_CQ_DW10 ADMIN_CREATE_IO_CQ_DW10
struct _ADMIN_SET_FEATURES_NUMBER_OF_QUEUES_COMPLETE ADMIN_SET_FEATURES_NUMBER_OF_QUEUES_COMPLETE
struct _IO_WRITE_COMMAND_DW13 IO_WRITE_COMMAND_DW13
struct _NVME_ADMIN_QUEUE_STATUS NVME_ADMIN_QUEUE_STATUS
struct _NVME_COMMAND NVME_COMMAND
struct _ADMIN_DELETE_IO_CQ_DW10 ADMIN_DELETE_IO_CQ_DW10
struct _IO_WRITE_COMMAND_DW12 IO_WRITE_COMMAND_DW12
struct _IO_WRITE_COMMAND_DW15 IO_WRITE_COMMAND_DW15
#define MAX_NUM_OF_IO_CQ
Definition: nvme.h:55
struct _ADMIN_IDENTIFY_FORMAT_DATA ADMIN_IDENTIFY_FORMAT_DATA
unsigned int dword
Definition: nvme.h:424
unsigned short QID
Definition: nvme.h:427
unsigned short QSIZE
Definition: nvme.h:428
unsigned short IV
Definition: nvme.h:443
unsigned short reserved0
Definition: nvme.h:442
unsigned short PC
Definition: nvme.h:440
unsigned int dword
Definition: nvme.h:437
unsigned short IEN
Definition: nvme.h:441
unsigned int dword
Definition: nvme.h:467
unsigned short QSIZE
Definition: nvme.h:471
unsigned short QID
Definition: nvme.h:470
unsigned short CQID
Definition: nvme.h:486
unsigned short reserved0
Definition: nvme.h:485
unsigned short PC
Definition: nvme.h:483
unsigned short QPRIO
Definition: nvme.h:484
unsigned int dword
Definition: nvme.h:480
unsigned short reserved0
Definition: nvme.h:457
unsigned int dword
Definition: nvme.h:453
unsigned short QID
Definition: nvme.h:456
unsigned int dword
Definition: nvme.h:496
unsigned short reserved0
Definition: nvme.h:500
unsigned short QID
Definition: nvme.h:499
unsigned char reserved0
Definition: nvme.h:413
unsigned char FID
Definition: nvme.h:411
unsigned int dword
Definition: nvme.h:408
unsigned char reserved1[2]
Definition: nvme.h:414
unsigned char SEL
Definition: nvme.h:412
unsigned short reserved1
Definition: nvme.h:530
unsigned char LID
Definition: nvme.h:527
unsigned char reserved0
Definition: nvme.h:528
unsigned short NUMD
Definition: nvme.h:529
unsigned int dword
Definition: nvme.h:524
unsigned int dword
Definition: nvme.h:510
unsigned int reserved0
Definition: nvme.h:514
unsigned short supportsFirmwareActivateFirmwareDownload
Definition: nvme.h:582
struct _ADMIN_IDENTIFY_CONTROLLER::@129 LPA
unsigned char reserved5
Definition: nvme.h:661
unsigned char reserved1
Definition: nvme.h:607
unsigned char AERL
Definition: nvme.h:587
unsigned short CNTLID
Definition: nvme.h:575
struct _ADMIN_IDENTIFY_CONTROLLER::@128 FRMW
unsigned char NPSS
Definition: nvme.h:604
unsigned char APSTA
Definition: nvme.h:609
struct _ADMIN_IDENTIFY_CONTROLLER::@131 CQES
unsigned char VS[1024]
Definition: nvme.h:682
unsigned char NVSCC
Definition: nvme.h:660
unsigned short AWUPF
Definition: nvme.h:658
unsigned short reserved0
Definition: nvme.h:583
unsigned char reserved0[176]
Definition: nvme.h:576
ADMIN_IDENTIFY_POWER_STATE_DESCRIPTOR PSDx[32]
Definition: nvme.h:680
unsigned char ACL
Definition: nvme.h:586
unsigned char supportsSMARTHealthInformationLogPage
Definition: nvme.h:598
unsigned int supportsSGLBitBucketDescriptor
Definition: nvme.h:673
unsigned char reserved2
Definition: nvme.h:610
unsigned short AWUN
Definition: nvme.h:657
unsigned char supportsCryptographicErase
Definition: nvme.h:647
unsigned char suppottsCommandEffectsLogPage
Definition: nvme.h:599
unsigned short VID
Definition: nvme.h:566
struct _ADMIN_IDENTIFY_CONTROLLER::@130 SQES
struct _ADMIN_IDENTIFY_CONTROLLER::@133 FUSES
unsigned short supportsDataSetManagement
Definition: nvme.h:633
struct _ADMIN_IDENTIFY_CONTROLLER::@127 OACS
unsigned char reserved3[246]
Definition: nvme.h:612
unsigned char IEEE[3]
Definition: nvme.h:572
unsigned char ELPE
Definition: nvme.h:603
unsigned char AVSCC
Definition: nvme.h:606
unsigned int supportsSGL
Definition: nvme.h:671
unsigned char reserved8[164]
Definition: nvme.h:677
unsigned char supportedNumberOfFirmwareSlots
Definition: nvme.h:592
unsigned short ACWU
Definition: nvme.h:665
unsigned char maximumSubmissionQueueEntrySize
Definition: nvme.h:617
unsigned char RAB
Definition: nvme.h:571
unsigned char reserved9[1344]
Definition: nvme.h:678
unsigned short supportsFormatNVM
Definition: nvme.h:581
unsigned int NN
Definition: nvme.h:627
unsigned short supportsCompare
Definition: nvme.h:631
unsigned char present
Definition: nvme.h:653
unsigned char MDTS
Definition: nvme.h:574
struct _ADMIN_IDENTIFY_CONTROLLER::@135 VWC
unsigned char maximumCompletionQueueEntrySize
Definition: nvme.h:623
unsigned char firstFirmwareSlotReadOnly
Definition: nvme.h:591
unsigned char MN[40]
Definition: nvme.h:569
unsigned short supportsWriteUncorrectable
Definition: nvme.h:632
unsigned char secureEraseAppliesToAllNamespaces
Definition: nvme.h:646
unsigned char reserved4[2]
Definition: nvme.h:626
unsigned char SN[20]
Definition: nvme.h:568
struct _ADMIN_IDENTIFY_CONTROLLER::@136 SGLS
unsigned short supportsSecuritySendSecurityReceive
Definition: nvme.h:580
struct _ADMIN_IDENTIFY_CONTROLLER::@132 ONCS
unsigned char reserved7[2]
Definition: nvme.h:667
unsigned short supportsCompareWrite
Definition: nvme.h:639
unsigned char FR[8]
Definition: nvme.h:570
struct _ADMIN_IDENTIFY_CONTROLLER::@134 FNA
unsigned int reserved1
Definition: nvme.h:674
unsigned char CMIC
Definition: nvme.h:573
unsigned short SSVID
Definition: nvme.h:567
unsigned int reserved0
Definition: nvme.h:672
unsigned char requiredCompletionQueueEntrySize
Definition: nvme.h:622
unsigned char formatAppliesToAllNamespaces
Definition: nvme.h:645
unsigned char reserved6
Definition: nvme.h:663
unsigned char requiredSubmissionQueueEntrySize
Definition: nvme.h:616
unsigned char reserved
Definition: nvme.h:692
unsigned char RP
Definition: nvme.h:691
unsigned char LBADS
Definition: nvme.h:690
unsigned short MS
Definition: nvme.h:689
struct _ADMIN_IDENTIFY_NAMESPACE::@141 DPS
unsigned int NSZE[2]
Definition: nvme.h:698
unsigned char supportsThinProvisioning
Definition: nvme.h:704
unsigned char supportsWriteExclusiveRegistrants
Definition: nvme.h:751
unsigned char protectionEnabled
Definition: nvme.h:736
unsigned char NLBAF
Definition: nvme.h:708
unsigned char supportsPersistThroughPowerLoss
Definition: nvme.h:749
unsigned int NUSE[2]
Definition: nvme.h:700
unsigned char supportedCombination
Definition: nvme.h:712
unsigned char reserved0
Definition: nvme.h:705
unsigned char supportsMetadataAtEndOfLBA
Definition: nvme.h:713
struct _ADMIN_IDENTIFY_NAMESPACE::@137 NSFEAT
unsigned char supportsWriteExclusiveReservation
Definition: nvme.h:750
unsigned char supportsExclusiveAccessAllRegistrants
Definition: nvme.h:754
unsigned char VS[3712]
Definition: nvme.h:764
unsigned int NCAP[2]
Definition: nvme.h:699
unsigned char supportsMultipathIOSharing
Definition: nvme.h:743
unsigned char supportsExclusiveAccessRegistrants
Definition: nvme.h:752
struct _ADMIN_IDENTIFY_NAMESPACE::@143 RESCAP
struct _ADMIN_IDENTIFY_NAMESPACE::@142 NMIC
unsigned char supportsProtectionType1
Definition: nvme.h:726
unsigned char supportsProtectionLast8
Definition: nvme.h:730
struct _ADMIN_IDENTIFY_NAMESPACE::@139 MC
unsigned char supportsMetadataAsSeperate
Definition: nvme.h:720
unsigned char supportsWriteExclusiveAllRegistrants
Definition: nvme.h:753
struct _ADMIN_IDENTIFY_NAMESPACE::@138 FLBAS
unsigned char protectionInFirst8
Definition: nvme.h:737
unsigned char supportsProtectionFirst8
Definition: nvme.h:729
ADMIN_IDENTIFY_FORMAT_DATA LBAFx[16]
Definition: nvme.h:761
unsigned char supportsProtectionType2
Definition: nvme.h:727
unsigned char supportsMetadataAsPartOfLBA
Definition: nvme.h:719
unsigned char reserved1[192]
Definition: nvme.h:763
unsigned char EUI64[8]
Definition: nvme.h:759
struct _ADMIN_IDENTIFY_NAMESPACE::@140 DPC
unsigned char supportsProtectionType3
Definition: nvme.h:728
unsigned char reserved1
Definition: nvme.h:384
unsigned char SV
Definition: nvme.h:385
unsigned char reserved0[2]
Definition: nvme.h:383
unsigned char FID
Definition: nvme.h:382
unsigned int dword
Definition: nvme.h:379
unsigned int startingLBA[2]
Definition: nvme.h:924
DATASET_MANAGEMENT_CONTEXT_ATTRIBUTES ContextAttributes
Definition: nvme.h:922
unsigned int lengthInLogicalBlocks
Definition: nvme.h:923
unsigned int dword
Definition: nvme.h:845
unsigned short PRINFO
Definition: nvme.h:852
unsigned short NLB
Definition: nvme.h:849
unsigned short LR
Definition: nvme.h:856
unsigned short FUA
Definition: nvme.h:854
unsigned short reserved0
Definition: nvme.h:850
unsigned char reserved0[3]
Definition: nvme.h:875
unsigned char AccessLatency
Definition: nvme.h:871
unsigned char SequentialRequest
Definition: nvme.h:872
unsigned int dword
Definition: nvme.h:865
unsigned char AccessFrequency
Definition: nvme.h:870
struct _IO_READ_COMMAND_DW13::@161::@163::@165 DSM
unsigned char Incompressible
Definition: nvme.h:873
unsigned short ELBAT
Definition: nvme.h:887
unsigned short ELBATM
Definition: nvme.h:888
unsigned int dword
Definition: nvme.h:884
unsigned short FUA
Definition: nvme.h:794
unsigned short PRINFO
Definition: nvme.h:793
unsigned short LR
Definition: nvme.h:795
unsigned short NLB
Definition: nvme.h:791
unsigned int dword
Definition: nvme.h:788
unsigned short reserved0
Definition: nvme.h:792
unsigned char SequentialRequest
Definition: nvme.h:819
unsigned char reserved0[3]
Definition: nvme.h:822
struct _IO_WRITE_COMMAND_DW13::@148::@150::@152 DSM
unsigned char AccessFrequency
Definition: nvme.h:809
unsigned int dword
Definition: nvme.h:804
unsigned char Incompressible
Definition: nvme.h:820
unsigned char AccessLatency
Definition: nvme.h:818
unsigned short ELBATM
Definition: nvme.h:835
unsigned int dword
Definition: nvme.h:831
unsigned short ELBAT
Definition: nvme.h:834
unsigned int dword13
Definition: nvme.h:263
unsigned int PRP2[2]
Definition: nvme.h:259
unsigned int PRP1[2]
Definition: nvme.h:258
unsigned short CID
Definition: nvme.h:253
unsigned int dword10
Definition: nvme.h:260
unsigned char PSDT
Definition: nvme.h:252
unsigned int MPTR[2]
Definition: nvme.h:257
unsigned int dword11
Definition: nvme.h:261
unsigned int dword15
Definition: nvme.h:265
unsigned int dword14
Definition: nvme.h:264
unsigned int reserved1[2]
Definition: nvme.h:256
unsigned char OPC
Definition: nvme.h:249
unsigned int dword12
Definition: nvme.h:262
unsigned int NSID
Definition: nvme.h:255
unsigned char FUSE
Definition: nvme.h:250
unsigned int dword[16]
Definition: nvme.h:244
unsigned char reserved0
Definition: nvme.h:251
unsigned char irqEn
Definition: nvme.h:934
unsigned char cqValid
Definition: nvme.h:933
unsigned char enable
Definition: nvme.h:931
unsigned char sqValid
Definition: nvme.h:932
unsigned int cmdSeqNum
Definition: nvme.h:209
unsigned short qID
Definition: nvme.h:207
unsigned short cmdSlotTag
Definition: nvme.h:208
unsigned int cmdDword[16]
Definition: nvme.h:233
The main structure of completion queue entry.
Definition: nvme.h:350
unsigned short MORE
Definition: nvme.h:365
unsigned int specific
Definition: nvme.h:370
unsigned short reserved0
Definition: nvme.h:361
unsigned short SC
Definition: nvme.h:362
struct _NVME_COMPLETION::@72::@74::@76::@78 statusField
unsigned short statusFieldWord
Definition: nvme.h:358
unsigned short SCT
Definition: nvme.h:363
unsigned short DNR
Definition: nvme.h:366
unsigned int dword[2]
Definition: nvme.h:353
unsigned short reserved1
Definition: nvme.h:364
unsigned int dword[16]
Definition: nvme.h:291
unsigned int MPTR[2]
Definition: nvme.h:323
unsigned int dword14
Definition: nvme.h:336
unsigned int dword12
Definition: nvme.h:334
unsigned int PRP1[2]
Definition: nvme.h:324
unsigned int dword15
Definition: nvme.h:337
unsigned char OPC
Definition: nvme.h:296
unsigned int dword13
Definition: nvme.h:335
unsigned int reserved1[2]
Definition: nvme.h:315
unsigned char reserved0
Definition: nvme.h:298
unsigned int dword10
Definition: nvme.h:332
unsigned int dword11
Definition: nvme.h:333
unsigned char FUSE
Definition: nvme.h:297
unsigned char PSDT
Definition: nvme.h:299
unsigned int NSID
Definition: nvme.h:302
unsigned int PRP2[2]
Definition: nvme.h:325
unsigned short CID
Definition: nvme.h:300
unsigned char valid
Definition: nvme.h:948
unsigned int pcieBaseAddrH
Definition: nvme.h:954
unsigned int pcieBaseAddrL
Definition: nvme.h:953
unsigned short reserved0
Definition: nvme.h:950
unsigned short irqVector
Definition: nvme.h:951
unsigned char irqEn
Definition: nvme.h:949
unsigned short qSzie
Definition: nvme.h:952
unsigned short qSzie
Definition: nvme.h:941
unsigned char valid
Definition: nvme.h:939
unsigned int pcieBaseAddrH
Definition: nvme.h:943
unsigned char cqVector
Definition: nvme.h:940
unsigned int pcieBaseAddrL
Definition: nvme.h:942
NVME_IO_SQ_STATUS ioSqInfo[MAX_NUM_OF_IO_SQ]
Definition: nvme.h:964
unsigned short numOfIOSubmissionQueuesAllocated
Definition: nvme.h:962
unsigned int cacheEn
Definition: nvme.h:960
unsigned int status
Definition: nvme.h:959
NVME_IO_CQ_STATUS ioCqInfo[MAX_NUM_OF_IO_CQ]
Definition: nvme.h:965
unsigned short numOfIOCompletionQueuesAllocated
Definition: nvme.h:963
NVME_ADMIN_QUEUE_STATUS adminQueueInfo
Definition: nvme.h:961