-**NVMe Admin command enums**
+.. c:type:: struct nvme_fabrics_config
-.. c:type:: enum nvme_admin_opcode
+**Definition**
- Known NVMe admin opcodes
+::
-**Constants**
+ struct nvme_fabrics_config {
+ const char *transport;
+ const char *traddr;
+ const char *trsvcid;
+ const char *nqn;
+ const char *hostnqn;
+ const char *host_traddr;
+ const char *hostid;
+ int queue_size;
+ int nr_io_queues;
+ int reconnect_delay;
+ int ctrl_loss_tmo;
+ int keep_alive_tmo;
+ int nr_write_queues;
+ int nr_poll_queues;
+ int tos;
+ bool duplicate_connect;
+ bool disable_sqflow;
+ bool hdr_digest;
+ bool data_digest;
+ uint8_t rsvd[0x200];
+ };
-``nvme_admin_delete_sq``
- *undescribed*
+**Members**
-``nvme_admin_create_sq``
- *undescribed*
-``nvme_admin_get_log_page``
- *undescribed*
-``nvme_admin_delete_cq``
- *undescribed*
+.. c:function:: int nvmf_add_ctrl_opts (struct nvme_fabrics_config * cfg)
-``nvme_admin_create_cq``
- *undescribed*
-``nvme_admin_identify``
- *undescribed*
+**Parameters**
-``nvme_admin_abort_cmd``
+``struct nvme_fabrics_config * cfg``
*undescribed*
-``nvme_admin_set_features``
- *undescribed*
-``nvme_admin_get_features``
- *undescribed*
+.. c:function:: nvme_ctrl_t nvmf_add_ctrl (struct nvme_fabrics_config * cfg)
-``nvme_admin_async_event``
- *undescribed*
-``nvme_admin_ns_mgmt``
- *undescribed*
+**Parameters**
-``nvme_admin_fw_commit``
+``struct nvme_fabrics_config * cfg``
*undescribed*
-``nvme_admin_fw_download``
- *undescribed*
-``nvme_admin_dev_self_test``
- *undescribed*
+.. c:function:: int nvmf_get_discovery_log (nvme_ctrl_t c, struct nvmf_discovery_log ** logp, int max_retries)
-``nvme_admin_ns_attach``
- *undescribed*
-``nvme_admin_keep_alive``
- *undescribed*
+**Parameters**
-``nvme_admin_directive_send``
+``nvme_ctrl_t c``
*undescribed*
-``nvme_admin_directive_recv``
+``struct nvmf_discovery_log ** logp``
*undescribed*
-``nvme_admin_virtual_mgmt``
+``int max_retries``
*undescribed*
-``nvme_admin_nvme_mi_send``
- *undescribed*
-``nvme_admin_nvme_mi_recv``
- *undescribed*
+.. c:function:: char * nvmf_hostnqn_generate ()
-``nvme_admin_dbbuf``
- *undescribed*
-``nvme_admin_fabrics``
- *undescribed*
+**Parameters**
-``nvme_admin_format_nvm``
- *undescribed*
-``nvme_admin_security_send``
- *undescribed*
+.. c:function:: char * nvmf_hostnqn_from_file ()
-``nvme_admin_security_recv``
- *undescribed*
-``nvme_admin_sanitize_nvm``
- *undescribed*
+**Parameters**
-``nvme_admin_get_lba_status``
- *undescribed*
+.. c:function:: char * nvmf_hostid_from_file ()
+**Parameters**
-.. c:type:: enum nvme_identify_cns
+.. c:function:: const char * nvmf_trtype_str (__u8 trtype)
-**Constants**
-``NVME_IDENTIFY_CNS_NS``
- *undescribed*
+**Parameters**
-``NVME_IDENTIFY_CNS_CTRL``
+``__u8 trtype``
*undescribed*
-``NVME_IDENTIFY_CNS_NS_ACTIVE_LIST``
- *undescribed*
-``NVME_IDENTIFY_CNS_NS_DESC_LIST``
- *undescribed*
+.. c:function:: const char * nvmf_adrfam_str (__u8 adrfam)
-``NVME_IDENTIFY_CNS_NVMSET_LIST``
- *undescribed*
-``NVME_IDENTIFY_CNS_ALLOCATED_NS_LIST``
- *undescribed*
+**Parameters**
-``NVME_IDENTIFY_CNS_ALLOCATED_NS``
+``__u8 adrfam``
*undescribed*
-``NVME_IDENTIFY_CNS_NS_CTRL_LIST``
- *undescribed*
-``NVME_IDENTIFY_CNS_CTRL_LIST``
- *undescribed*
+.. c:function:: const char * nvmf_subtype_str (__u8 subtype)
-``NVME_IDENTIFY_CNS_PRIMARY_CTRL_CAP``
- *undescribed*
-``NVME_IDENTIFY_CNS_SECONDARY_CTRL_LIST``
- *undescribed*
+**Parameters**
-``NVME_IDENTIFY_CNS_NS_GRANULARITY``
+``__u8 subtype``
*undescribed*
-``NVME_IDENTIFY_CNS_UUID_LIST``
- *undescribed*
+.. c:function:: const char * nvmf_treq_str (__u8 treq)
+**Parameters**
-.. c:type:: enum nvme_cmd_get_log_lid
+``__u8 treq``
+ *undescribed*
-**Constants**
+.. c:function:: const char * nvmf_sectype_str (__u8 sectype)
-``NVME_LOG_LID_ERROR``
- *undescribed*
-``NVME_LOG_LID_SMART``
- *undescribed*
+**Parameters**
-``NVME_LOG_LID_FW_SLOT``
+``__u8 sectype``
*undescribed*
-``NVME_LOG_LID_CHANGED_NS``
- *undescribed*
-``NVME_LOG_LID_CMD_EFFECTS``
- *undescribed*
+.. c:function:: const char * nvmf_prtype_str (__u8 prtype)
-``NVME_LOG_LID_DEVICE_SELF_TEST``
- *undescribed*
-``NVME_LOG_LID_TELEMETRY_HOST``
- *undescribed*
+**Parameters**
-``NVME_LOG_LID_TELEMETRY_CTRL``
+``__u8 prtype``
*undescribed*
-``NVME_LOG_LID_ENDURANCE_GROUP``
- *undescribed*
-``NVME_LOG_LID_PREDICTABLE_LAT_NVMSET``
- *undescribed*
+.. c:function:: const char * nvmf_qptype_str (__u8 qptype)
-``NVME_LOG_LID_PREDICTABLE_LAT_AGG``
- *undescribed*
-``NVME_LOG_LID_ANA``
- *undescribed*
+**Parameters**
-``NVME_LOG_LID_PERSISTENT_EVENT``
+``__u8 qptype``
*undescribed*
-``NVME_LOG_LID_LBA_STATUS``
- *undescribed*
-``NVME_LOG_LID_ENDURANCE_GRP_EVT``
- *undescribed*
+.. c:function:: const char * nvmf_cms_str (__u8 cm)
-``NVME_LOG_LID_DISCOVER``
- *undescribed*
-``NVME_LOG_LID_RESERVATION``
- *undescribed*
+**Parameters**
-``NVME_LOG_LID_SANITIZE``
+``__u8 cm``
*undescribed*
+.. c:function:: nvme_ctrl_t nvmf_connect_disc_entry (struct nvmf_disc_log_entry * e, const struct nvme_fabrics_config * defcfg, bool * discover)
-.. c:type:: enum nvme_features_id
-
-
-**Constants**
+**Parameters**
-``NVME_FEAT_FID_ARBITRATION``
+``struct nvmf_disc_log_entry * e``
*undescribed*
-``NVME_FEAT_FID_POWER_MGMT``
+``const struct nvme_fabrics_config * defcfg``
*undescribed*
-``NVME_FEAT_FID_LBA_RANGE``
+``bool * discover``
*undescribed*
-``NVME_FEAT_FID_TEMP_THRESH``
- *undescribed*
-``NVME_FEAT_FID_ERR_RECOVERY``
- *undescribed*
+.. c:function:: int nvme_namespace_filter (const struct dirent * d)
-``NVME_FEAT_FID_VOLATILE_WC``
- *undescribed*
-``NVME_FEAT_FID_NUM_QUEUES``
- *undescribed*
+**Parameters**
-``NVME_FEAT_FID_IRQ_COALESCE``
- *undescribed*
+``const struct dirent * d``
-``NVME_FEAT_FID_IRQ_CONFIG``
- *undescribed*
-``NVME_FEAT_FID_WRITE_ATOMIC``
- *undescribed*
+.. c:function:: int nvme_paths_filter (const struct dirent * d)
-``NVME_FEAT_FID_ASYNC_EVENT``
- *undescribed*
-``NVME_FEAT_FID_AUTO_PST``
- *undescribed*
+**Parameters**
-``NVME_FEAT_FID_HOST_MEM_BUF``
- *undescribed*
+``const struct dirent * d``
-``NVME_FEAT_FID_TIMESTAMP``
- *undescribed*
-``NVME_FEAT_FID_KATO``
- *undescribed*
+.. c:function:: int nvme_ctrls_filter (const struct dirent * d)
-``NVME_FEAT_FID_HCTM``
- *undescribed*
-``NVME_FEAT_FID_NOPSC``
- *undescribed*
+**Parameters**
-``NVME_FEAT_FID_RRL``
- *undescribed*
+``const struct dirent * d``
-``NVME_FEAT_FID_PLM_CONFIG``
- *undescribed*
-``NVME_FEAT_FID_PLM_WINDOW``
- *undescribed*
+.. c:function:: int nvme_subsys_filter (const struct dirent * d)
-``NVME_FEAT_FID_LBA_STS_INTERVAL``
- *undescribed*
-``NVME_FEAT_FID_HOST_BEHAVIOR``
- *undescribed*
+**Parameters**
-``NVME_FEAT_FID_SANITIZE``
- *undescribed*
+``const struct dirent * d``
-``NVME_FEAT_FID_ENDURANCE_EVT_CFG``
- *undescribed*
-``NVME_FEAT_FID_SW_PROGRESS``
- *undescribed*
+.. c:function:: int nvme_scan_subsystems (struct dirent *** subsys)
-``NVME_FEAT_FID_HOST_ID``
- *undescribed*
-``NVME_FEAT_FID_RESV_MASK``
- *undescribed*
+**Parameters**
-``NVME_FEAT_RESV_PERSIST``
- *undescribed*
-
-``NVME_FEAT_FID_WRITE_PROTECT``
- *undescribed*
+``struct dirent *** subsys``
+.. c:function:: int nvme_scan_subsystem_ctrls (nvme_subsystem_t s, struct dirent *** ctrls)
-.. c:type:: enum nvme_get_features_sel
+**Parameters**
+``nvme_subsystem_t s``
+ *undescribed*
-**Constants**
+``struct dirent *** ctrls``
-``NVME_GET_FEATURES_SEL_CURRENT``
- *undescribed*
-``NVME_GET_FEATURES_SEL_DEFAULT``
- *undescribed*
+.. c:function:: int nvme_scan_subsystem_namespaces (nvme_subsystem_t s, struct dirent *** namespaces)
-``NVME_GET_FEATURES_SEL_SAVED``
- *undescribed*
+**Parameters**
+``nvme_subsystem_t s``
+ *undescribed*
+``struct dirent *** namespaces``
-.. c:type:: enum nvme_cmd_format_mset
+.. c:function:: int nvme_scan_ctrl_namespace_paths (nvme_ctrl_t c, struct dirent *** namespaces)
-**Constants**
-``NVME_FORMAT_MSET_SEPARATE``
- *undescribed*
+**Parameters**
-``NVME_FORMAT_MSET_EXTENEDED``
+``nvme_ctrl_t c``
*undescribed*
+``struct dirent *** namespaces``
-
-.. c:type:: enum nvme_cmd_format_pi
+.. c:function:: int nvme_scan_ctrl_namespaces (nvme_ctrl_t c, struct dirent *** namespaces)
-**Constants**
+**Parameters**
-``NVME_FORMAT_PI_DISABLE``
+``nvme_ctrl_t c``
*undescribed*
-``NVME_FORMAT_PI_TYPE1``
- *undescribed*
+``struct dirent *** namespaces``
-``NVME_FORMAT_PI_TYPE2``
- *undescribed*
-``NVME_FORMAT_PI_TYPE3``
- *undescribed*
+.. c:type:: struct nvme_passthru_cmd
-.. c:type:: enum nvme_cmd_format_ses
+**Definition**
+::
-**Constants**
+ struct nvme_passthru_cmd {
+ __u8 opcode;
+ __u8 flags;
+ __u16 rsvd1;
+ __u32 nsid;
+ __u32 cdw2;
+ __u32 cdw3;
+ __u64 metadata;
+ __u64 addr;
+ __u32 metadata_len;
+ __u32 data_len;
+ __u32 cdw10;
+ __u32 cdw11;
+ __u32 cdw12;
+ __u32 cdw13;
+ __u32 cdw14;
+ __u32 cdw15;
+ __u32 timeout_ms;
+ __u32 result;
+ };
-``NVME_FORMAT_SES_NONE``
- *undescribed*
+**Members**
-``NVME_FORMAT_SES_USER_DATA_ERASE``
- *undescribed*
+``opcode``
+ Operation code, see :c:type:`enum nvme_io_opcodes <nvme_io_opcodes>` and :c:type:`enum nvme_admin_opcodes <nvme_admin_opcodes>`
-``NVME_FORMAT_SES_CRYPTO_ERASE``
- *undescribed*
+``flags``
+ Not supported: intended for command flags (eg: SGL, FUSE)
+``rsvd1``
+ Reserved for future use
+``nsid``
+ Namespace Identifier, or Fabrics type
+``cdw2``
+ Command Dword 2 (no spec defined use)
-.. c:type:: enum nvme_ns_mgmt_sel
+``cdw3``
+ Command Dword 3 (no spec defined use)
+``metadata``
+ User space address to metadata buffer (NULL if not used)
-**Constants**
+``addr``
+ User space address to data buffer (NULL if not used)
-``NVME_NS_MGMT_SEL_CREATE``
- *undescribed*
+``metadata_len``
+ Metadata buffer transfer length
-``NVME_NS_MGMT_SEL_DELETE``
- *undescribed*
+``data_len``
+ Data buffer transfer length
+``cdw10``
+ Command Dword 10 (command specific)
+``cdw11``
+ Command Dword 11 (command specific)
+``cdw12``
+ Command Dword 12 (command specific)
-.. c:type:: enum nvme_ns_attach_sel
+``cdw13``
+ Command Dword 13 (command specific)
- NVME_NS_ATTACH_SEL_CTRL_ATTACH: NVME_NP_ATTACH_SEL_CTRL_DEATTACH:
+``cdw14``
+ Command Dword 14 (command specific)
-**Constants**
+``cdw15``
+ Command Dword 15 (command specific)
-``NVME_NS_ATTACH_SEL_CTRL_ATTACH``
- *undescribed*
+``timeout_ms``
+ If non-zero, overrides system default timeout in milliseconds
-``NVME_NS_ATTACH_SEL_CTRL_DEATTACH``
- *undescribed*
+``result``
+ Set on completion to the command's CQE DWORD 0 controller response
-.. c:type:: enum nvme_fw_commit_ca
+.. c:type:: struct nvme_passthru_cmd64
-**Constants**
-``NVME_FW_COMMIT_CA_REPLACE``
- *undescribed*
+**Definition**
-``NVME_FW_COMMIT_CA_REPLACE_AND_ACTIVATE``
- *undescribed*
+::
-``NVME_FW_COMMIT_CA_SET_ACTIVE``
- *undescribed*
+ struct nvme_passthru_cmd64 {
+ __u8 opcode;
+ __u8 flags;
+ __u16 rsvd1;
+ __u32 nsid;
+ __u32 cdw2;
+ __u32 cdw3;
+ __u64 metadata;
+ __u64 addr;
+ __u32 metadata_len;
+ __u32 data_len;
+ __u32 cdw10;
+ __u32 cdw11;
+ __u32 cdw12;
+ __u32 cdw13;
+ __u32 cdw14;
+ __u32 cdw15;
+ __u32 timeout_ms;
+ __u32 rsvd2;
+ __u64 result;
+ };
-``NVME_FW_COMMIT_CA_REPLACE_AND_ACTIVATE_IMMEDIATE``
- *undescribed*
+**Members**
-``NVME_FW_COMMIT_CA_REPLACE_BOOT_PARTITION``
- *undescribed*
+``opcode``
+ Operation code, see :c:type:`enum nvme_io_opcodes <nvme_io_opcodes>` and :c:type:`enum nvme_admin_opcodes <nvme_admin_opcodes>`
-``NVME_FW_COMMIT_CA_ACTIVATE_BOOT_PARTITION``
- *undescribed*
+``flags``
+ Not supported: intended for command flags (eg: SGL, FUSE)
+``rsvd1``
+ Reserved for future use
+``nsid``
+ Namespace Identifier, or Fabrics type
+``cdw2``
+ Command Dword 2 (no spec defined use)
-.. c:type:: enum nvme_directive_dtype
+``cdw3``
+ Command Dword 3 (no spec defined use)
+``metadata``
+ User space address to metadata buffer (NULL if not used)
-**Constants**
+``addr``
+ User space address to data buffer (NULL if not used)
-``NVME_DIRECTIVE_DTYPE_IDENTIFY``
- *undescribed*
+``metadata_len``
+ Metadata buffer transfer length
-``NVME_DIRECTIVE_DTYPE_STREAMS``
- *undescribed*
+``data_len``
+ Data buffer transfer length
+``cdw10``
+ Command Dword 10 (command specific)
+``cdw11``
+ Command Dword 11 (command specific)
+``cdw12``
+ Command Dword 12 (command specific)
-.. c:type:: enum nvme_cmd_directive_receive_identify_doper
+``cdw13``
+ Command Dword 13 (command specific)
+``cdw14``
+ Command Dword 14 (command specific)
-**Constants**
+``cdw15``
+ Command Dword 15 (command specific)
-``NVME_DIRECTIVE_RECEIVE_IDENTIFY_DOPER_PARAM``
- *undescribed*
+``timeout_ms``
+ If non-zero, overrides system default timeout in milliseconds
+``rsvd2``
+ Reserved for future use (and fills an impicit struct pad
+``result``
+ Set on completion to the command's CQE DWORD 0-1 controller response
-.. c:type:: enum nvme_cmd_directive_receive_streams_doper
+.. c:function:: int nvme_submit_admin_passthru64 (int fd, struct nvme_passthru_cmd64 * cmd, __u64 * result)
-**Constants**
+ Submit a 64-bit nvme passthrough admin command
-``NVME_DIRECTIVE_RECEIVE_STREAMS_DOPER_PARAM``
- *undescribed*
+**Parameters**
-``NVME_DIRECTIVE_RECEIVE_STREAMS_DOPER_STATUS``
- *undescribed*
+``int fd``
+ File descriptor of nvme device
-``NVME_DIRECTIVE_RECEIVE_STREAMS_DOPER_RESOURCE``
- *undescribed*
+``struct nvme_passthru_cmd64 * cmd``
+ The nvme admin command to send
+``__u64 * result``
+ Optional field to return the result from the CQE DW0-1
+**Description**
+Uses NVME_IOCTL_ADMIN64_CMD for the ioctl request.
-.. c:type:: enum nvme_cmd_directive_send_identify_doper
+**Return**
+The nvme command status if a response was received or -1
+ with errno set otherwise.
-**Constants**
-``NVME_DIRECTIVE_SEND_IDENTIFY_DOPER_ENDIR``
- *undescribed*
+.. c:function:: int nvme_admin_passthru64 (int fd, __u8 opcode, __u8 flags, __u16 rsvd, __u32 nsid, __u32 cdw2, __u32 cdw3, __u32 cdw10, __u32 cdw11, __u32 cdw12, __u32 cdw13, __u32 cdw14, __u32 cdw15, __u32 data_len, void * data, __u32 metadata_len, void * metadata, __u32 timeout_ms, __u64 * result)
+ Submit an nvme passthrough command
+**Parameters**
+``int fd``
+ File descriptor of nvme device
-.. c:type:: enum nvme_cmd_directive_send_identify_endir
+``__u8 opcode``
+ The nvme io command to send
+``__u8 flags``
+ NVMe command flags (not used)
-**Constants**
+``__u16 rsvd``
+ Reserevd for future use
-``NVME_DIRECTIVE_SEND_IDENTIFY_ENDIR_DISABLE``
- *undescribed*
-
-``NVME_DIRECTIVE_SEND_IDENTIFY_ENDIR_ENABLE``
- *undescribed*
-
-
-
-
-.. c:type:: enum nvme_cmd_directive_send_streams_doper
+``__u32 nsid``
+ Namespace identifier
+``__u32 cdw2``
+ Command dword 2
-**Constants**
+``__u32 cdw3``
+ Command dword 3
-``NVME_DIRECTIVE_SEND_STREAMS_DOPER_RELEASE_IDENTIFIER``
- *undescribed*
+``__u32 cdw10``
+ Command dword 10
-``NVME_DIRECTIVE_SEND_STREAMS_DOPER_RELEASE_RESOURCE``
- *undescribed*
+``__u32 cdw11``
+ Command dword 11
+``__u32 cdw12``
+ Command dword 12
+``__u32 cdw13``
+ Command dword 13
+``__u32 cdw14``
+ Command dword 14
-.. c:type:: enum nvme_sanitize_sanact
+``__u32 cdw15``
+ Command dword 15
+``__u32 data_len``
+ Length of the data transfered in this command in bytes
-**Constants**
+``void * data``
+ Pointer to user address of the data buffer
-``NVME_SANITIZE_SANACT_EXIT_FAILURE``
- *undescribed*
+``__u32 metadata_len``
+ Length of metadata transfered in this command
-``NVME_SANITIZE_SANACT_START_BLOCK_ERASE``
- *undescribed*
+``void * metadata``
+ Pointer to user address of the metadata buffer
-``NVME_SANITIZE_SANACT_START_OVERWRITE``
- *undescribed*
+``__u32 timeout_ms``
+ How long the kernel waits for the command to complete
-``NVME_SANITIZE_SANACT_START_CRYPTO_ERASE``
- *undescribed*
+``__u64 * result``
+ Optional field to return the result from the CQE dword 0
+**Description**
+Parameterized form of nvme_submit_admin_passthru64(). This sets up and
+submits a :c:type:`struct nvme_passthru_cmd64 <nvme_passthru_cmd64>`.
+Known values for **opcode** are defined in :c:type:`enum nvme_admin_opcode <nvme_admin_opcode>`.
-.. c:type:: enum nvme_dst_stc
+**Return**
+The nvme command status if a response was received or -1
+ with errno set otherwise.
-**Constants**
-``NVME_DST_STC_SHORT``
- *undescribed*
+.. c:function:: int nvme_submit_admin_passthru (int fd, struct nvme_passthru_cmd * cmd, __u32 * result)
-``NVME_DST_STC_LONG``
- *undescribed*
+ Submit an nvme passthrough admin command
-``NVME_DST_STC_VS``
- *undescribed*
+**Parameters**
-``NVME_DST_STC_ABORT``
- *undescribed*
+``int fd``
+ File descriptor of nvme device
+``struct nvme_passthru_cmd * cmd``
+ The nvme admin command to send
+``__u32 * result``
+ Optional field to return the result from the CQE DW0
+**Description**
-.. c:type:: enum nvme_virt_mgmt_act
+Uses NVME_IOCTL_ADMIN_CMD for the ioctl request.
+**Return**
-**Constants**
+The nvme command status if a response was received or -1
+ with errno set otherwise.
-``NVME_VIRT_MGMT_ACT_PRIM_CTRL_FLEX_ALLOC``
- *undescribed*
-``NVME_VIRT_MGMT_ACT_OFFLINE_SEC_CTRL``
- *undescribed*
+.. c:function:: int nvme_admin_passthru (int fd, __u8 opcode, __u8 flags, __u16 rsvd, __u32 nsid, __u32 cdw2, __u32 cdw3, __u32 cdw10, __u32 cdw11, __u32 cdw12, __u32 cdw13, __u32 cdw14, __u32 cdw15, __u32 data_len, void * data, __u32 metadata_len, void * metadata, __u32 timeout_ms, __u32 * result)
-``NVME_VIRT_MGMT_ACT_ASSIGN_SEC_CTRL``
- *undescribed*
+ Submit an nvme passthrough command
-``NVME_VIRT_MGMT_ACT_ONLINE_SEC_CTRL``
- *undescribed*
+**Parameters**
+``int fd``
+ File descriptor of nvme device
+``__u8 opcode``
+ The nvme io command to send
+``__u8 flags``
+ NVMe command flags (not used)
-.. c:type:: enum nvme_virt_mgmt_rt
+``__u16 rsvd``
+ Reserevd for future use
+``__u32 nsid``
+ Namespace identifier
-**Constants**
+``__u32 cdw2``
+ Command dword 2
-``NVME_VIRT_MGMT_RT_VQ_RESOURCE``
- *undescribed*
+``__u32 cdw3``
+ Command dword 3
-``NVME_VIRT_MGMT_RT_VI_RESOURCE``
- *undescribed*
+``__u32 cdw10``
+ Command dword 10
+``__u32 cdw11``
+ Command dword 11
-.. c:function:: int nvme_identify (int fd, enum nvme_identify_cns cns, __u32 nsid, __u16 cntid, __u16 nvmsetid, __u8 uuidx, void * data)
+``__u32 cdw12``
+ Command dword 12
- Send the NVMe Identify command
+``__u32 cdw13``
+ Command dword 13
-**Parameters**
+``__u32 cdw14``
+ Command dword 14
-``int fd``
- File descriptor of nvme device
+``__u32 cdw15``
+ Command dword 15
-``enum nvme_identify_cns cns``
- The Controller or Namespace structure, see **enum** nvme_identify_cns
+``__u32 data_len``
+ Length of the data transfered in this command in bytes
-``__u32 nsid``
- Namespace identifier, if applicable
+``void * data``
+ Pointer to user address of the data buffer
-``__u16 cntid``
- The Controller Identifier, if applicable
+``__u32 metadata_len``
+ Length of metadata transfered in this command
-``__u16 nvmsetid``
- The NVMe Set ID if CNS is 04h
+``void * metadata``
+ Pointer to user address of the metadata buffer
-``__u8 uuidx``
- UUID Index if controller supports this id selection method
+``__u32 timeout_ms``
+ How long the kernel waits for the command to complete
-``void * data``
- User space destination address to transfer the data
+``__u32 * result``
+ Optional field to return the result from the CQE dword 0
**Description**
-The Identify command returns a data buffer that describes information about
-the NVM subsystem, the controller or the namespace(s).
+Parameterized form of nvme_submit_admin_passthru(). This sets up and
+submits a :c:type:`struct nvme_passthru_cmd <nvme_passthru_cmd>`.
+
+Known values for **opcode** are defined in :c:type:`enum nvme_admin_opcode <nvme_admin_opcode>`.
**Return**
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+The nvme command status if a response was received or -1
+ with errno set otherwise.
-.. c:function:: int nvme_identify_ctrl (int fd, struct nvme_id_ctrl * id)
+.. c:function:: int nvme_submit_io_passthru64 (int fd, struct nvme_passthru_cmd64 * cmd, __u64 * result)
- Retrieves nvme identify controller
+ Submit a 64-bit nvme passthrough command
**Parameters**
``int fd``
File descriptor of nvme device
- id: User space destination address to transfer the data,
-``struct nvme_id_ctrl * id``
- *undescribed*
+``struct nvme_passthru_cmd64 * cmd``
+ The nvme io command to send
-**Description**
+``__u64 * result``
+ Optional field to return the result from the CQE DW0-1
-Sends nvme identify with CNS value ``NVME_IDENTIFY_CNS_CTRL``.
+**Description**
-See :c:type:`struct nvme_id_ctrl <nvme_id_ctrl>` for details on the data returned.
+Uses NVME_IOCTL_IO64_CMD for the ioctl request.
**Return**
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+The nvme command status if a response was received or -1
+ with errno set otherwise.
-.. c:function:: int nvme_identify_ns (int fd, __u32 nsid, struct nvme_id_ns * ns)
+.. c:function:: int nvme_io_passthru64 (int fd, __u8 opcode, __u8 flags, __u16 rsvd, __u32 nsid, __u32 cdw2, __u32 cdw3, __u32 cdw10, __u32 cdw11, __u32 cdw12, __u32 cdw13, __u32 cdw14, __u32 cdw15, __u32 data_len, void * data, __u32 metadata_len, void * metadata, __u32 timeout_ms, __u64 * result)
- Retrieves nvme identify namespace
+ Submit an nvme io passthrough command
**Parameters**
``int fd``
File descriptor of nvme device
+``__u8 opcode``
+ The nvme io command to send
+
+``__u8 flags``
+ NVMe command flags (not used)
+
+``__u16 rsvd``
+ Reserevd for future use
+
``__u32 nsid``
- Namespace to identify
+ Namespace identifier
-``struct nvme_id_ns * ns``
- User space destination address to transfer the data
+``__u32 cdw2``
+ Command dword 2
-**Description**
+``__u32 cdw3``
+ Command dword 3
-If the Namespace Identifier (NSID) field specifies an active NSID, then the
-Identify Namespace data structure is returned to the host for that specified
-namespace.
+``__u32 cdw10``
+ Command dword 10
-If the controller supports the Namespace Management capability and the NSID
-field is set to ``NVME_NSID_ALL``, then the controller returns an Identify Namespace
-data structure that specifies capabilities that are common across namespaces
-for this controller.
+``__u32 cdw11``
+ Command dword 11
-See :c:type:`struct nvme_id_ns <nvme_id_ns>` for details on the structure returned.
+``__u32 cdw12``
+ Command dword 12
-**Return**
+``__u32 cdw13``
+ Command dword 13
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``__u32 cdw14``
+ Command dword 14
+``__u32 cdw15``
+ Command dword 15
-.. c:function:: int nvme_identify_allocated_ns (int fd, __u32 nsid, struct nvme_id_ns * ns)
+``__u32 data_len``
+ Length of the data transfered in this command in bytes
- Same as nvme_identify_ns, but only for allocated namespaces
+``void * data``
+ Pointer to user address of the data buffer
-**Parameters**
+``__u32 metadata_len``
+ Length of metadata transfered in this command
-``int fd``
- File descriptor of nvme device
+``void * metadata``
+ Pointer to user address of the metadata buffer
-``__u32 nsid``
- Namespace to identify
+``__u32 timeout_ms``
+ How long the kernel waits for the command to complete
-``struct nvme_id_ns * ns``
- User space destination address to transfer the data
+``__u64 * result``
+ Optional field to return the result from the CQE dword 0
+
+**Description**
+
+Parameterized form of nvme_submit_io_passthru64(). This sets up and submits
+a :c:type:`struct nvme_passthru_cmd64 <nvme_passthru_cmd64>`.
+
+Known values for **opcode** are defined in :c:type:`enum nvme_io_opcode <nvme_io_opcode>`.
**Return**
set otherwise.
-.. c:function:: int nvme_identify_active_ns_list (int fd, __u32 nsid, struct nvme_ns_list * list)
+.. c:function:: int nvme_submit_io_passthru (int fd, struct nvme_passthru_cmd * cmd, __u32 * result)
- Retrieves active namespaces id list
+ Submit an nvme passthrough command
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Return namespaces greater than this identifer
+``struct nvme_passthru_cmd * cmd``
+ The nvme io command to send
-``struct nvme_ns_list * list``
- *undescribed*
+``__u32 * result``
+ Optional field to return the result from the CQE DW0
**Description**
-A list of 1024 namespace IDs is returned to the host containing NSIDs in
-increasing order that are greater than the value specified in the Namespace
-Identifier (nsid) field of the command.
-
-See :c:type:`struct nvme_ns_list <nvme_ns_list>` for the definition of the returned structure.
+Uses NVME_IOCTL_IO_CMD for the ioctl request.
**Return**
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+The nvme command status if a response was received or -1
+ with errno set otherwise.
-.. c:function:: int nvme_identify_allocated_ns_list (int fd, __u32 nsid, struct nvme_ns_list * list)
+.. c:function:: int nvme_io_passthru (int fd, __u8 opcode, __u8 flags, __u16 rsvd, __u32 nsid, __u32 cdw2, __u32 cdw3, __u32 cdw10, __u32 cdw11, __u32 cdw12, __u32 cdw13, __u32 cdw14, __u32 cdw15, __u32 data_len, void * data, __u32 metadata_len, void * metadata, __u32 timeout_ms, __u32 * result)
- Retrieves allocated namespace id list
+ Submit an nvme io passthrough command
**Parameters**
``int fd``
File descriptor of nvme device
+``__u8 opcode``
+ The nvme io command to send
+
+``__u8 flags``
+ NVMe command flags (not used)
+
+``__u16 rsvd``
+ Reserevd for future use
+
``__u32 nsid``
- Return namespaces greater than this identifer
+ Namespace identifier
-``struct nvme_ns_list * list``
- *undescribed*
+``__u32 cdw2``
+ Command dword 2
-**Description**
+``__u32 cdw3``
+ Command dword 3
-A list of 1024 namespace IDs is returned to the host containing NSIDs in
-increasing order that are greater than the value specified in the Namespace
-Identifier (nsid) field of the command.
+``__u32 cdw10``
+ Command dword 10
-See :c:type:`struct nvme_ns_list <nvme_ns_list>` for the definition of the returned structure.
+``__u32 cdw11``
+ Command dword 11
-**Return**
+``__u32 cdw12``
+ Command dword 12
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``__u32 cdw13``
+ Command dword 13
+``__u32 cdw14``
+ Command dword 14
-.. c:function:: int nvme_identify_ctrl_list (int fd, __u16 cntid, struct nvme_ctrl_list * ctrlist)
+``__u32 cdw15``
+ Command dword 15
- Retrieves identify controller list
+``__u32 data_len``
+ Length of the data transfered in this command in bytes
-**Parameters**
+``void * data``
+ Pointer to user address of the data buffer
-``int fd``
- File descriptor of nvme device
+``__u32 metadata_len``
+ Length of metadata transfered in this command
-``__u16 cntid``
- *undescribed*
+``void * metadata``
+ Pointer to user address of the metadata buffer
-``struct nvme_ctrl_list * ctrlist``
- *undescribed*
+``__u32 timeout_ms``
+ How long the kernel waits for the command to complete
+
+``__u32 * result``
+ Optional field to return the result from the CQE dword 0
**Description**
-Up to 2047 controller identifiers is returned containing a controller
-identifier greater than or equal to the controller identifier specified in
-**cntid**.
+Parameterized form of nvme_submit_io_passthru(). This sets up and submits
+a :c:type:`struct nvme_passthru_cmd <nvme_passthru_cmd>`.
-See :c:type:`struct nvme_ctrl_list <nvme_ctrl_list>` for a definition of the structure returned.
+Known values for **opcode** are defined in :c:type:`enum nvme_io_opcode <nvme_io_opcode>`.
**Return**
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+The nvme command status if a response was received or -1
+ with errno set otherwise.
-.. c:function:: int nvme_identify_nsid_ctrl_list (int fd, __u32 nsid, __u16 cntid, struct nvme_ctrl_list * ctrlist)
+.. c:function:: int nvme_subsystem_reset (int fd)
+ Initiate a subsystem reset
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Return controllers that are attached to this nsid
-
-``__u16 cntid``
- *undescribed*
-
-``struct nvme_ctrl_list * ctrlist``
- *undescribed*
-
**Description**
-Up to 2047 controller identifiers is returned containing a controller
-identifier greater than or equal to the controller identifier specified in
-**cntid**.
-
-See :c:type:`struct nvme_ctrl_list <nvme_ctrl_list>` for a definition of the structure returned.
+This should only be sent to controller handles, not to namespaces.
**Return**
-The nvme command status if a response was received or -1
+Zero if a subsystem reset was initiated or -1 with errno set
+ otherwise.
-.. c:function:: int nvme_identify_ns_descs (int fd, __u32 nsid, struct nvme_ns_id_desc * descs)
+.. c:function:: int nvme_ctrl_reset (int fd)
- Retrieves namespace descriptor list
+ Initiate a controller reset
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- The namespace id to retrieve destriptors
-
-``struct nvme_ns_id_desc * descs``
- User space destination address to transfer the data
-
**Description**
-A list of Namespace Identification Descriptor structures is returned to the
-host for the namespace specified in the Namespace Identifier (NSID) field if
-it is an active NSID.
-
-The data returned is in the form of an arrray of 'struct nvme_ns_id_desc'.
-
-See :c:type:`struct nvme_ns_id_desc <nvme_ns_id_desc>` for the definition of the returned structure.
+This should only be sent to controller handles, not to namespaces.
**Return**
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+Zero if a reset was initiated or -1 with errno set otherwise.
-.. c:function:: int nvme_identify_nvmset_list (int fd, __u16 nvmsetid, struct nvme_id_nvmset_list * nvmset)
+.. c:function:: int nvme_ns_rescan (int fd)
- Retrieves NVM Set List
+ Initiate a controller rescan
**Parameters**
``int fd``
File descriptor of nvme device
-``__u16 nvmsetid``
- *undescribed*
-
-``struct nvme_id_nvmset_list * nvmset``
- User space destination address to transfer the data
-
**Description**
-Retrieves an NVM Set List, struct nvme_id_nvmset. The data structure is an
-ordered list by NVM Set Identifier, starting with the first NVM Set
-Identifier supported by the NVM subsystem that is equal to or greater than
-the NVM Set Identifier.
-
-See :c:type:`struct nvme_id_nvmset_list <nvme_id_nvmset_list>` for the defintion of the returned structure.
+This should only be sent to controller handles, not to namespaces.
**Return**
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+Zero if a rescan was initiated or -1 with errno set otherwise.
-.. c:function:: int nvme_identify_primary_ctrl (int fd, __u16 cntid, struct nvme_primary_ctrl_cap * cap)
+.. c:function:: int nvme_get_nsid (int fd)
- Retrieve NVMe Primary Controller identification :c:type:`fd`:
+ Retrieve the NSID from a namespace file descriptor
**Parameters**
``int fd``
- *undescribed*
-
-``__u16 cntid``
- *undescribed*
-
-``struct nvme_primary_ctrl_cap * cap``
+ File descriptor of nvme namespace
**Description**
-See :c:type:`struct nvme_primary_ctrl_cap <nvme_primary_ctrl_cap>` for the defintion of the returned structure, **cap**.
+This should only be sent to namespace handles, not to controllers.
**Return**
-The nvme command status if a response was received or -1
- with errno set otherwise.
-
-
-.. c:function:: int nvme_identify_secondary_ctrl_list (int fd, __u16 cntid, struct nvme_secondary_ctrl_list * list)
-
- Retrieves secondary controller list
+The namespace identifier if a succecssful or -1 with errno set
+ otherwise.
-**Parameters**
-``int fd``
- File descriptor of nvme device
+**NVMe Admin command enums**
-``__u16 cntid``
- Return controllers starting at this identifier
-``struct nvme_secondary_ctrl_list * list``
- *undescribed*
-**Description**
-A Secondary Controller List is returned to the host for up to 127 secondary
-controllers associated with the primary controller processing this command.
-The list contains entries for controller identifiers greater than or equal
-to the value specified in the Controller Identifier (cntid).
+.. c:type:: enum nvme_admin_opcode
-See :c:type:`struct nvme_secondary_ctrls_list <nvme_secondary_ctrls_list>` for a defintion of the returned
-structure.
+ Known NVMe admin opcodes
-**Return**
+**Constants**
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``nvme_admin_delete_sq``
+ *undescribed*
+``nvme_admin_create_sq``
+ *undescribed*
-.. c:function:: int nvme_identify_ns_granularity (int fd, struct nvme_id_ns_granularity_list * list)
+``nvme_admin_get_log_page``
+ *undescribed*
- Retrieves namespace granularity identification
+``nvme_admin_delete_cq``
+ *undescribed*
-**Parameters**
+``nvme_admin_create_cq``
+ *undescribed*
-``int fd``
- File descriptor of nvme device
+``nvme_admin_identify``
+ *undescribed*
-``struct nvme_id_ns_granularity_list * list``
+``nvme_admin_abort_cmd``
*undescribed*
-**Description**
+``nvme_admin_set_features``
+ *undescribed*
-If the controller supports reporting of Namespace Granularity, then a
-Namespace Granularity List is returned to the host for up to sixteen
-namespace granularity descriptors
+``nvme_admin_get_features``
+ *undescribed*
-See :c:type:`struct nvme_id_ns_granularity_list <nvme_id_ns_granularity_list>` for the definition of the returned
-structure.
+``nvme_admin_async_event``
+ *undescribed*
-**Return**
+``nvme_admin_ns_mgmt``
+ *undescribed*
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``nvme_admin_fw_commit``
+ *undescribed*
+``nvme_admin_fw_download``
+ *undescribed*
-.. c:function:: int nvme_identify_uuid (int fd, struct nvme_id_uuid_list * list)
+``nvme_admin_dev_self_test``
+ *undescribed*
- Retrieves device's UUIDs
+``nvme_admin_ns_attach``
+ *undescribed*
-**Parameters**
+``nvme_admin_keep_alive``
+ *undescribed*
-``int fd``
- File descriptor of nvme device
+``nvme_admin_directive_send``
+ *undescribed*
-``struct nvme_id_uuid_list * list``
+``nvme_admin_directive_recv``
*undescribed*
-**Description**
+``nvme_admin_virtual_mgmt``
+ *undescribed*
-Each UUID List entry is either 0h, the NVMe Invalid UUID, or a valid UUID.
-Valid UUIDs are those which are non-zero and are not the NVMe Invalid UUID.
+``nvme_admin_nvme_mi_send``
+ *undescribed*
-See :c:type:`struct nvme_id_uuid_list <nvme_id_uuid_list>` for the definition of the returned structure.
+``nvme_admin_nvme_mi_recv``
+ *undescribed*
-**Return**
+``nvme_admin_dbbuf``
+ *undescribed*
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``nvme_admin_fabrics``
+ *undescribed*
+``nvme_admin_format_nvm``
+ *undescribed*
-.. c:function:: int nvme_get_log (int fd, enum nvme_cmd_get_log_lid lid, __u32 nsid, __u64 lpo, __u8 lsp, __u16 lsi, bool rae, __u8 uuidx, __u32 len, void * log)
+``nvme_admin_security_send``
+ *undescribed*
- NVMe Admin Get Log command
+``nvme_admin_security_recv``
+ *undescribed*
-**Parameters**
+``nvme_admin_sanitize_nvm``
+ *undescribed*
-``int fd``
- File descriptor of nvme device
+``nvme_admin_get_lba_status``
+ *undescribed*
-``enum nvme_cmd_get_log_lid lid``
- Log page identifier, see :c:type:`enum nvme_cmd_get_log_lid <nvme_cmd_get_log_lid>` for known values
-``__u32 nsid``
- Namespace identifier, if applicable
-``__u64 lpo``
- Log page offset for partial log transfers
-``__u8 lsp``
- Log specific field
+.. c:type:: enum nvme_identify_cns
-``__u16 lsi``
- Endurance group information
-``bool rae``
- Retain asynchronous events
+**Constants**
-``__u8 uuidx``
- UUID selection, if supported
+``NVME_IDENTIFY_CNS_NS``
+ *undescribed*
-``__u32 len``
- Length of provided user buffer to hold the log data in bytes
+``NVME_IDENTIFY_CNS_CTRL``
+ *undescribed*
-``void * log``
- User space destination address to transfer the data
+``NVME_IDENTIFY_CNS_NS_ACTIVE_LIST``
+ *undescribed*
-**Return**
+``NVME_IDENTIFY_CNS_NS_DESC_LIST``
+ *undescribed*
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``NVME_IDENTIFY_CNS_NVMSET_LIST``
+ *undescribed*
+``NVME_IDENTIFY_CNS_ALLOCATED_NS_LIST``
+ *undescribed*
-.. c:function:: int nvme_get_log_error (int fd, unsigned nr_entries, bool rae, struct nvme_error_log_page * log)
+``NVME_IDENTIFY_CNS_ALLOCATED_NS``
+ *undescribed*
- Retrieve nvme error log
+``NVME_IDENTIFY_CNS_NS_CTRL_LIST``
+ *undescribed*
-**Parameters**
+``NVME_IDENTIFY_CNS_CTRL_LIST``
+ *undescribed*
-``int fd``
- File descriptor of nvme device
+``NVME_IDENTIFY_CNS_PRIMARY_CTRL_CAP``
+ *undescribed*
-``unsigned nr_entries``
+``NVME_IDENTIFY_CNS_SECONDARY_CTRL_LIST``
*undescribed*
-``bool rae``
- Retain asynchronous events
+``NVME_IDENTIFY_CNS_NS_GRANULARITY``
+ *undescribed*
-``struct nvme_error_log_page * log``
+``NVME_IDENTIFY_CNS_UUID_LIST``
*undescribed*
-**Description**
-This log page is used to describe extended error information for a command
-that completed with error, or may report an error that is not specific to a
-particular command.
-**Return**
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+.. c:type:: enum nvme_cmd_get_log_lid
-.. c:function:: int nvme_get_log_smart (int fd, __u32 nsid, bool rae, struct nvme_smart_log * log)
+**Constants**
- Retrieve nvme smart log
+``NVME_LOG_LID_ERROR``
+ *undescribed*
-**Parameters**
+``NVME_LOG_LID_SMART``
+ *undescribed*
-``int fd``
- File descriptor of nvme device
+``NVME_LOG_LID_FW_SLOT``
+ *undescribed*
-``__u32 nsid``
- Optional namespace identifier
+``NVME_LOG_LID_CHANGED_NS``
+ *undescribed*
-``bool rae``
- Retain asynchronous events
+``NVME_LOG_LID_CMD_EFFECTS``
+ *undescribed*
-``struct nvme_smart_log * log``
+``NVME_LOG_LID_DEVICE_SELF_TEST``
*undescribed*
-**Description**
+``NVME_LOG_LID_TELEMETRY_HOST``
+ *undescribed*
-This log page is used to provide SMART and general health information. The
-information provided is over the life of the controller and is retained
-across power cycles. To request the controller log page, the namespace
-identifier specified is FFFFFFFFh. The controller may also support
-requesting the log page on a per namespace basis, as indicated by bit 0 of
-the LPA field in the Identify Controller data structure.
+``NVME_LOG_LID_TELEMETRY_CTRL``
+ *undescribed*
-**Return**
+``NVME_LOG_LID_ENDURANCE_GROUP``
+ *undescribed*
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``NVME_LOG_LID_PREDICTABLE_LAT_NVMSET``
+ *undescribed*
+``NVME_LOG_LID_PREDICTABLE_LAT_AGG``
+ *undescribed*
-.. c:function:: int nvme_get_log_fw_slot (int fd, bool rae, struct nvme_firmware_slot * log)
+``NVME_LOG_LID_ANA``
+ *undescribed*
- Retrieves the controller firmware log
+``NVME_LOG_LID_PERSISTENT_EVENT``
+ *undescribed*
-**Parameters**
+``NVME_LOG_LID_LBA_STATUS``
+ *undescribed*
-``int fd``
- File descriptor of nvme device
+``NVME_LOG_LID_ENDURANCE_GRP_EVT``
+ *undescribed*
-``bool rae``
- Retain asynchronous events
+``NVME_LOG_LID_DISCOVER``
+ *undescribed*
-``struct nvme_firmware_slot * log``
+``NVME_LOG_LID_RESERVATION``
*undescribed*
-**Description**
+``NVME_LOG_LID_SANITIZE``
+ *undescribed*
-This log page is used to describe the firmware revision stored in each
-firmware slot supported. The firmware revision is indicated as an ASCII
-string. The log page also indicates the active slot number.
-**Return**
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+.. c:type:: enum nvme_features_id
-.. c:function:: int nvme_get_log_changed_ns_list (int fd, bool rae, struct nvme_ns_list * log)
- Retrieve namespace changed list
+**Constants**
-**Parameters**
+``NVME_FEAT_FID_ARBITRATION``
+ *undescribed*
-``int fd``
- File descriptor of nvme device
+``NVME_FEAT_FID_POWER_MGMT``
+ *undescribed*
-``bool rae``
- Retain asynchronous events
+``NVME_FEAT_FID_LBA_RANGE``
+ *undescribed*
-``struct nvme_ns_list * log``
+``NVME_FEAT_FID_TEMP_THRESH``
*undescribed*
-**Description**
+``NVME_FEAT_FID_ERR_RECOVERY``
+ *undescribed*
-This log page is used to describe namespaces attached to this controller
-that have changed since the last time the namespace was identified, been
-added, or deleted.
+``NVME_FEAT_FID_VOLATILE_WC``
+ *undescribed*
-**Return**
+``NVME_FEAT_FID_NUM_QUEUES``
+ *undescribed*
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``NVME_FEAT_FID_IRQ_COALESCE``
+ *undescribed*
+``NVME_FEAT_FID_IRQ_CONFIG``
+ *undescribed*
-.. c:function:: int nvme_get_log_cmd_effects (int fd, struct nvme_cmd_effects_log * log)
+``NVME_FEAT_FID_WRITE_ATOMIC``
+ *undescribed*
- Retrieve nvme command effects log
+``NVME_FEAT_FID_ASYNC_EVENT``
+ *undescribed*
-**Parameters**
+``NVME_FEAT_FID_AUTO_PST``
+ *undescribed*
-``int fd``
- File descriptor of nvme device
+``NVME_FEAT_FID_HOST_MEM_BUF``
+ *undescribed*
-``struct nvme_cmd_effects_log * log``
+``NVME_FEAT_FID_TIMESTAMP``
*undescribed*
-**Description**
+``NVME_FEAT_FID_KATO``
+ *undescribed*
-This log page is used to describe the commands that the controller supports
-and the effects of those commands on the state of the NVM subsystem.
+``NVME_FEAT_FID_HCTM``
+ *undescribed*
-**Return**
+``NVME_FEAT_FID_NOPSC``
+ *undescribed*
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``NVME_FEAT_FID_RRL``
+ *undescribed*
+``NVME_FEAT_FID_PLM_CONFIG``
+ *undescribed*
-.. c:function:: int nvme_get_log_device_self_test (int fd, struct nvme_self_test_log * log)
+``NVME_FEAT_FID_PLM_WINDOW``
+ *undescribed*
- Retrieve the device self test log
+``NVME_FEAT_FID_LBA_STS_INTERVAL``
+ *undescribed*
-**Parameters**
+``NVME_FEAT_FID_HOST_BEHAVIOR``
+ *undescribed*
-``int fd``
- File descriptor of nvme device
+``NVME_FEAT_FID_SANITIZE``
+ *undescribed*
-``struct nvme_self_test_log * log``
- Userspace address of the log payload
+``NVME_FEAT_FID_ENDURANCE_EVT_CFG``
+ *undescribed*
-**Description**
+``NVME_FEAT_FID_SW_PROGRESS``
+ *undescribed*
-The log page is used to indicate the status of an in progress self test and
-the percent complete of that operation, and the results of the previous 20
-self-test operations.
+``NVME_FEAT_FID_HOST_ID``
+ *undescribed*
-**Return**
-
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``NVME_FEAT_FID_RESV_MASK``
+ *undescribed*
+``NVME_FEAT_RESV_PERSIST``
+ *undescribed*
-.. c:function:: int nvme_get_log_create_telemetry_host (int fd, struct nvme_telemetry_log * log)
+``NVME_FEAT_FID_WRITE_PROTECT``
+ *undescribed*
-**Parameters**
-``int fd``
- *undescribed*
-``struct nvme_telemetry_log * log``
- *undescribed*
+.. c:type:: enum nvme_get_features_sel
-.. c:function:: int nvme_get_log_telemetry_host (int fd, __u64 offset, __u32 len, void * log)
+**Constants**
+``NVME_GET_FEATURES_SEL_CURRENT``
+ *undescribed*
-**Parameters**
+``NVME_GET_FEATURES_SEL_DEFAULT``
+ *undescribed*
-``int fd``
- File descriptor of nvme device
+``NVME_GET_FEATURES_SEL_SAVED``
+ *undescribed*
-``__u64 offset``
- Offset into the telemetry data
-``__u32 len``
- Length of provided user buffer to hold the log data in bytes
-``void * log``
- User address for log page data
-**Description**
+.. c:type:: enum nvme_cmd_format_mset
-Retreives the Telemetry Host-Initiated log page at the requested offset
-using the previously existing capture.
-**Return**
+**Constants**
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``NVME_FORMAT_MSET_SEPARATE``
+ *undescribed*
+``NVME_FORMAT_MSET_EXTENEDED``
+ *undescribed*
-.. c:function:: int nvme_get_log_telemetry_ctrl (int fd, bool rae, __u64 offset, __u32 len, void * log)
-**Parameters**
-``int fd``
- File descriptor of nvme device
+.. c:type:: enum nvme_cmd_format_pi
-``bool rae``
- Retain asynchronous events
-``__u64 offset``
- Offset into the telemetry data
+**Constants**
-``__u32 len``
- Length of provided user buffer to hold the log data in bytes
+``NVME_FORMAT_PI_DISABLE``
+ *undescribed*
-``void * log``
- User address for log page data
+``NVME_FORMAT_PI_TYPE1``
+ *undescribed*
+``NVME_FORMAT_PI_TYPE2``
+ *undescribed*
-.. c:function:: int nvme_get_log_endurance_group (int fd, __u16 endgid, struct nvme_endurance_group_log * log)
+``NVME_FORMAT_PI_TYPE3``
+ *undescribed*
-**Parameters**
-``int fd``
- File descriptor of nvme device
-``__u16 endgid``
- Starting group identifier to return in the list
+.. c:type:: enum nvme_cmd_format_ses
-``struct nvme_endurance_group_log * log``
- User address to store the endurance log
-**Description**
+**Constants**
-This log page indicates if an Endurance Group Event has occurred for a
-particular Endurance Group. If an Endurance Group Event has occurred, the
-details of the particular event are included in the Endurance Group
-Information log page for that Endurance Group. An asynchronous event is
-generated when an entry for an Endurance Group is newly added to this log
-page.
+``NVME_FORMAT_SES_NONE``
+ *undescribed*
-**Return**
+``NVME_FORMAT_SES_USER_DATA_ERASE``
+ *undescribed*
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``NVME_FORMAT_SES_CRYPTO_ERASE``
+ *undescribed*
-.. c:function:: int nvme_get_log_predictable_lat_nvmset (int fd, __u16 nvmsetid, struct nvme_nvmset_predictable_lat_log * log)
-**Parameters**
+.. c:type:: enum nvme_ns_mgmt_sel
-``int fd``
- *undescribed*
-``__u16 nvmsetid``
+**Constants**
-``struct nvme_nvmset_predictable_lat_log * log``
+``NVME_NS_MGMT_SEL_CREATE``
*undescribed*
-**Return**
-
-The nvme command status if a response was received or -1 with errno
- set otherwise.
-
+``NVME_NS_MGMT_SEL_DELETE``
+ *undescribed*
-.. c:function:: int nvme_get_log_predictable_lat_event (int fd, bool rae, __u32 offset, __u32 len, void * log)
-**Parameters**
-``int fd``
- File descriptor of nvme device
+.. c:type:: enum nvme_ns_attach_sel
-``bool rae``
- Retain asynchronous events
+ NVME_NS_ATTACH_SEL_CTRL_ATTACH: NVME_NP_ATTACH_SEL_CTRL_DEATTACH:
-``__u32 offset``
- *undescribed*
+**Constants**
-``__u32 len``
+``NVME_NS_ATTACH_SEL_CTRL_ATTACH``
*undescribed*
-``void * log``
+``NVME_NS_ATTACH_SEL_CTRL_DEATTACH``
*undescribed*
-.. c:function:: int nvme_get_log_ana (int fd, enum nvme_log_ana_lsp lsp, bool rae, __u64 offset, __u32 len, void * log)
-
-**Parameters**
-``int fd``
- File descriptor of nvme device
+.. c:type:: enum nvme_fw_commit_ca
-``enum nvme_log_ana_lsp lsp``
- Log specific, see :c:type:`enum nvme_get_log_ana_lsp <nvme_get_log_ana_lsp>`
-``bool rae``
- Retain asynchronous events
+**Constants**
-``__u64 offset``
+``NVME_FW_COMMIT_CA_REPLACE``
*undescribed*
-``__u32 len``
- The allocated length of the log page
-
-``void * log``
- User address to store the ana log
-
-**Description**
+``NVME_FW_COMMIT_CA_REPLACE_AND_ACTIVATE``
+ *undescribed*
-This log consists of a header describing the log and descriptors containing
-the asymmetric namespace access information for ANA Groups that contain
-namespaces that are attached to the controller processing the command.
+``NVME_FW_COMMIT_CA_SET_ACTIVE``
+ *undescribed*
-See :c:type:`struct nvme_ana_rsp_hdr <nvme_ana_rsp_hdr>` for the defintion of the returned structure.
+``NVME_FW_COMMIT_CA_REPLACE_AND_ACTIVATE_IMMEDIATE``
+ *undescribed*
-**Return**
+``NVME_FW_COMMIT_CA_REPLACE_BOOT_PARTITION``
+ *undescribed*
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``NVME_FW_COMMIT_CA_ACTIVATE_BOOT_PARTITION``
+ *undescribed*
-.. c:function:: int nvme_get_log_ana_groups (int fd, bool rae, __u32 len, struct nvme_ana_group_desc * log)
-**Parameters**
+.. c:type:: enum nvme_directive_dtype
-``int fd``
- File descriptor of nvme device
-``bool rae``
- Retain asynchronous events
+**Constants**
-``__u32 len``
+``NVME_DIRECTIVE_DTYPE_IDENTIFY``
*undescribed*
-``struct nvme_ana_group_desc * log``
+``NVME_DIRECTIVE_DTYPE_STREAMS``
*undescribed*
-**Description**
-
-See :c:type:`struct nvme_ana_group_desc <nvme_ana_group_desc>` for the defintion of the returned structure.
-.. c:function:: int nvme_get_log_lba_status (int fd, bool rae, __u64 offset, __u32 len, void * log)
+.. c:type:: enum nvme_directive_receive_doper
-**Parameters**
-``int fd``
- File descriptor of nvme device
+**Constants**
-``bool rae``
- Retain asynchronous events
+``NVME_DIRECTIVE_RECEIVE_IDENTIFY_DOPER_PARAM``
+ *undescribed*
-``__u64 offset``
+``NVME_DIRECTIVE_RECEIVE_STREAMS_DOPER_PARAM``
*undescribed*
-``__u32 len``
+``NVME_DIRECTIVE_RECEIVE_STREAMS_DOPER_STATUS``
*undescribed*
-``void * log``
+``NVME_DIRECTIVE_RECEIVE_STREAMS_DOPER_RESOURCE``
*undescribed*
-.. c:function:: int nvme_get_log_endurance_grp_evt (int fd, bool rae, __u32 offset, __u32 len, void * log)
-**Parameters**
+.. c:type:: enum nvme_directive_send_doper
-``int fd``
- File descriptor of nvme device
-``bool rae``
- Retain asynchronous events
+**Constants**
-``__u32 offset``
+``NVME_DIRECTIVE_SEND_IDENTIFY_DOPER_ENDIR``
*undescribed*
-``__u32 len``
+``NVME_DIRECTIVE_SEND_STREAMS_DOPER_RELEASE_IDENTIFIER``
*undescribed*
-``void * log``
+``NVME_DIRECTIVE_SEND_STREAMS_DOPER_RELEASE_RESOURCE``
*undescribed*
-.. c:function:: int nvme_get_log_discovery (int fd, bool rae, __u32 offset, __u32 len, void * log)
-
-
-**Parameters**
-``int fd``
- File descriptor of nvme device
-``bool rae``
- Retain asynchronous events
+.. c:type:: enum nvme_directive_send_identify_endir
-``__u32 offset``
- Offset of this log to retrieve
-``__u32 len``
- The allocated size for this portion of the log
+**Constants**
-``void * log``
- User address to store the discovery log
+``NVME_DIRECTIVE_SEND_IDENTIFY_ENDIR_DISABLE``
+ *undescribed*
-**Description**
+``NVME_DIRECTIVE_SEND_IDENTIFY_ENDIR_ENABLE``
+ *undescribed*
-Supported only by fabrics discovery controllers, returning discovery
-records.
-**Return**
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+.. c:type:: enum nvme_sanitize_sanact
-.. c:function:: int nvme_get_log_reservation (int fd, bool rae, struct nvme_resv_notification_log * log)
+**Constants**
-**Parameters**
+``NVME_SANITIZE_SANACT_EXIT_FAILURE``
+ *undescribed*
-``int fd``
- File descriptor of nvme device
+``NVME_SANITIZE_SANACT_START_BLOCK_ERASE``
+ *undescribed*
-``bool rae``
- Retain asynchronous events
+``NVME_SANITIZE_SANACT_START_OVERWRITE``
+ *undescribed*
-``struct nvme_resv_notification_log * log``
+``NVME_SANITIZE_SANACT_START_CRYPTO_ERASE``
*undescribed*
-.. c:function:: int nvme_get_log_sanitize (int fd, bool rae, struct nvme_sanitize_log_page * log)
-**Parameters**
+.. c:type:: enum nvme_dst_stc
-``int fd``
- File descriptor of nvme device
-``bool rae``
- Retain asynchronous events
+**Constants**
-``struct nvme_sanitize_log_page * log``
- User address to store the sanitize log
+``NVME_DST_STC_SHORT``
+ *undescribed*
-**Description**
+``NVME_DST_STC_LONG``
+ *undescribed*
-The Sanitize Status log page is used to report sanitize operation time
-estimates and information about the most recent sanitize operation.
+``NVME_DST_STC_VS``
+ *undescribed*
-**Return**
+``NVME_DST_STC_ABORT``
+ *undescribed*
-The nvme command status if a response was received or -1 with errno
- set otherwise.
-.. c:function:: int nvme_set_features (int fd, __u8 fid, __u32 nsid, __u32 cdw11, __u32 cdw12, bool save, __u8 uuidx, __u32 cdw15, __u32 data_len, void * data, __u32 * result)
- Set a feature attribute
+.. c:type:: enum nvme_virt_mgmt_act
-**Parameters**
-``int fd``
- File descriptor of nvme device
+**Constants**
-``__u8 fid``
- Feature identifier
+``NVME_VIRT_MGMT_ACT_PRIM_CTRL_FLEX_ALLOC``
+ *undescribed*
-``__u32 nsid``
- Namespace ID, if applicable
+``NVME_VIRT_MGMT_ACT_OFFLINE_SEC_CTRL``
+ *undescribed*
-``__u32 cdw11``
- Value to set the feature to
+``NVME_VIRT_MGMT_ACT_ASSIGN_SEC_CTRL``
+ *undescribed*
-``__u32 cdw12``
- Feature specific command dword12 field
+``NVME_VIRT_MGMT_ACT_ONLINE_SEC_CTRL``
+ *undescribed*
-``bool save``
- Save value across power states
-``__u8 uuidx``
- UUID Index for differentiating vendor specific encoding
-``__u32 cdw15``
- *undescribed*
-``__u32 data_len``
- Length of feature data, if applicable, in bytes
+.. c:type:: enum nvme_virt_mgmt_rt
-``void * data``
- User address of feature data, if applicable
-``__u32 * result``
- The command completion result from CQE dword0
+**Constants**
-**Return**
+``NVME_VIRT_MGMT_RT_VQ_RESOURCE``
+ *undescribed*
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``NVME_VIRT_MGMT_RT_VI_RESOURCE``
+ *undescribed*
-.. c:function:: int nvme_set_features_arbitration (int fd, __u8 ab, __u8 lpw, __u8 mpw, __u8 hpw, bool save, __u32 * result)
+.. c:function:: int nvme_identify (int fd, enum nvme_identify_cns cns, __u32 nsid, __u16 cntid, __u16 nvmsetid, __u8 uuidx, void * data)
+ Send the NVMe Identify command
**Parameters**
``int fd``
File descriptor of nvme device
-``__u8 ab``
- *undescribed*
+``enum nvme_identify_cns cns``
+ The Controller or Namespace structure, see **enum** nvme_identify_cns
-``__u8 lpw``
- *undescribed*
+``__u32 nsid``
+ Namespace identifier, if applicable
-``__u8 mpw``
- *undescribed*
+``__u16 cntid``
+ The Controller Identifier, if applicable
-``__u8 hpw``
- *undescribed*
+``__u16 nvmsetid``
+ The NVMe Set ID if CNS is 04h
-``bool save``
- Save value across power states
+``__u8 uuidx``
+ UUID Index if controller supports this id selection method
-``__u32 * result``
- The command completion result from CQE dword0
+``void * data``
+ User space destination address to transfer the data
+
+**Description**
+
+The Identify command returns a data buffer that describes information about
+the NVM subsystem, the controller or the namespace(s).
**Return**
set otherwise.
-.. c:function:: int nvme_set_features_power_mgmt (int fd, __u8 ps, __u8 wh, bool save, __u32 * result)
+.. c:function:: int nvme_identify_ctrl (int fd, struct nvme_id_ctrl * id)
+ Retrieves nvme identify controller
**Parameters**
``int fd``
File descriptor of nvme device
+ id: User space destination address to transfer the data,
-``__u8 ps``
+``struct nvme_id_ctrl * id``
*undescribed*
-``__u8 wh``
- *undescribed*
+**Description**
-``bool save``
- Save value across power states
+Sends nvme identify with CNS value ``NVME_IDENTIFY_CNS_CTRL``.
-``__u32 * result``
- The command completion result from CQE dword0
+See :c:type:`struct nvme_id_ctrl <nvme_id_ctrl>` for details on the data returned.
**Return**
set otherwise.
-.. c:function:: int nvme_set_features_lba_range (int fd, __u32 nsid, __u32 nr_ranges, bool save, struct nvme_lba_range_type * data, __u32 * result)
+.. c:function:: int nvme_identify_ns (int fd, __u32 nsid, struct nvme_id_ns * ns)
+ Retrieves nvme identify namespace
**Parameters**
File descriptor of nvme device
``__u32 nsid``
- *undescribed*
+ Namespace to identify
-``__u32 nr_ranges``
- *undescribed*
+``struct nvme_id_ns * ns``
+ User space destination address to transfer the data
-``bool save``
- Save value across power states
+**Description**
-``struct nvme_lba_range_type * data``
- *undescribed*
+If the Namespace Identifier (NSID) field specifies an active NSID, then the
+Identify Namespace data structure is returned to the host for that specified
+namespace.
-``__u32 * result``
- The command completion result from CQE dword0
+If the controller supports the Namespace Management capability and the NSID
+field is set to ``NVME_NSID_ALL``, then the controller returns an Identify Namespace
+data structure that specifies capabilities that are common across namespaces
+for this controller.
+
+See :c:type:`struct nvme_id_ns <nvme_id_ns>` for details on the structure returned.
**Return**
set otherwise.
+.. c:function:: int nvme_identify_allocated_ns (int fd, __u32 nsid, struct nvme_id_ns * ns)
+ Same as nvme_identify_ns, but only for allocated namespaces
-.. c:type:: enum nvme_feat_tmpthresh_thsel
+**Parameters**
+``int fd``
+ File descriptor of nvme device
-**Constants**
+``__u32 nsid``
+ Namespace to identify
-``NVME_FEATURE_TEMPTHRESH_THSEL_OVER``
- *undescribed*
+``struct nvme_id_ns * ns``
+ User space destination address to transfer the data
-``NVME_FEATURETEMPTHRESH__THSEL_UNDER``
- *undescribed*
+**Return**
+
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-.. c:function:: int nvme_set_features_temp_thresh (int fd, __u16 tmpth, __u8 tmpsel, enum nvme_feat_tmpthresh_thsel thsel, bool save, __u32 * result)
+.. c:function:: int nvme_identify_active_ns_list (int fd, __u32 nsid, struct nvme_ns_list * list)
+ Retrieves active namespaces id list
**Parameters**
``int fd``
File descriptor of nvme device
-``__u16 tmpth``
- *undescribed*
+``__u32 nsid``
+ Return namespaces greater than this identifer
-``__u8 tmpsel``
+``struct nvme_ns_list * list``
*undescribed*
-``enum nvme_feat_tmpthresh_thsel thsel``
- *undescribed*
+**Description**
-``bool save``
- Save value across power states
+A list of 1024 namespace IDs is returned to the host containing NSIDs in
+increasing order that are greater than the value specified in the Namespace
+Identifier (nsid) field of the command.
-``__u32 * result``
- The command completion result from CQE dword0
+See :c:type:`struct nvme_ns_list <nvme_ns_list>` for the definition of the returned structure.
**Return**
set otherwise.
-.. c:function:: int nvme_set_features_err_recovery (int fd, __u32 nsid, __u16 tler, bool dulbe, bool save, __u32 * result)
+.. c:function:: int nvme_identify_allocated_ns_list (int fd, __u32 nsid, struct nvme_ns_list * list)
+ Retrieves allocated namespace id list
**Parameters**
File descriptor of nvme device
``__u32 nsid``
- *undescribed*
+ Return namespaces greater than this identifer
-``__u16 tler``
+``struct nvme_ns_list * list``
*undescribed*
-``bool dulbe``
- *undescribed*
+**Description**
-``bool save``
- Save value across power states
+A list of 1024 namespace IDs is returned to the host containing NSIDs in
+increasing order that are greater than the value specified in the Namespace
+Identifier (nsid) field of the command.
-``__u32 * result``
- The command completion result from CQE dword0
+See :c:type:`struct nvme_ns_list <nvme_ns_list>` for the definition of the returned structure.
**Return**
set otherwise.
-.. c:function:: int nvme_set_features_volatile_wc (int fd, bool wce, bool save, __u32 * result)
+.. c:function:: int nvme_identify_ctrl_list (int fd, __u16 cntid, struct nvme_ctrl_list * ctrlist)
+ Retrieves identify controller list
**Parameters**
``int fd``
File descriptor of nvme device
-``bool wce``
+``__u16 cntid``
*undescribed*
-``bool save``
- Save value across power states
+``struct nvme_ctrl_list * ctrlist``
+ *undescribed*
-``__u32 * result``
- The command completion result from CQE dword0
+**Description**
+
+Up to 2047 controller identifiers is returned containing a controller
+identifier greater than or equal to the controller identifier specified in
+**cntid**.
+
+See :c:type:`struct nvme_ctrl_list <nvme_ctrl_list>` for a definition of the structure returned.
**Return**
set otherwise.
-.. c:function:: int nvme_set_features_irq_coalesce (int fd, __u8 thr, __u8 time, bool save, __u32 * result)
+.. c:function:: int nvme_identify_nsid_ctrl_list (int fd, __u32 nsid, __u16 cntid, struct nvme_ctrl_list * ctrlist)
**Parameters**
``int fd``
File descriptor of nvme device
-``__u8 thr``
+``__u32 nsid``
+ Return controllers that are attached to this nsid
+
+``__u16 cntid``
*undescribed*
-``__u8 time``
+``struct nvme_ctrl_list * ctrlist``
*undescribed*
-``bool save``
- Save value across power states
+**Description**
-``__u32 * result``
- The command completion result from CQE dword0
+Up to 2047 controller identifiers is returned containing a controller
+identifier greater than or equal to the controller identifier specified in
+**cntid**.
+
+See :c:type:`struct nvme_ctrl_list <nvme_ctrl_list>` for a definition of the structure returned.
**Return**
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+The nvme command status if a response was received or -1
-.. c:function:: int nvme_set_features_irq_config (int fd, __u16 iv, bool cd, bool save, __u32 * result)
+.. c:function:: int nvme_identify_ns_descs (int fd, __u32 nsid, struct nvme_ns_id_desc * descs)
+ Retrieves namespace descriptor list
**Parameters**
``int fd``
File descriptor of nvme device
-``__u16 iv``
- *undescribed*
+``__u32 nsid``
+ The namespace id to retrieve destriptors
-``bool cd``
- *undescribed*
+``struct nvme_ns_id_desc * descs``
+ User space destination address to transfer the data
-``bool save``
- Save value across power states
+**Description**
-``__u32 * result``
- The command completion result from CQE dword0
+A list of Namespace Identification Descriptor structures is returned to the
+host for the namespace specified in the Namespace Identifier (NSID) field if
+it is an active NSID.
+
+The data returned is in the form of an arrray of 'struct nvme_ns_id_desc'.
+
+See :c:type:`struct nvme_ns_id_desc <nvme_ns_id_desc>` for the definition of the returned structure.
**Return**
set otherwise.
-.. c:function:: int nvme_set_features_write_atomic (int fd, bool dn, bool save, __u32 * result)
+.. c:function:: int nvme_identify_nvmset_list (int fd, __u16 nvmsetid, struct nvme_id_nvmset_list * nvmset)
+ Retrieves NVM Set List
**Parameters**
``int fd``
File descriptor of nvme device
-``bool dn``
+``__u16 nvmsetid``
*undescribed*
-``bool save``
- Save value across power states
+``struct nvme_id_nvmset_list * nvmset``
+ User space destination address to transfer the data
-``__u32 * result``
- The command completion result from CQE dword0
+**Description**
+
+Retrieves an NVM Set List, struct nvme_id_nvmset. The data structure is an
+ordered list by NVM Set Identifier, starting with the first NVM Set
+Identifier supported by the NVM subsystem that is equal to or greater than
+the NVM Set Identifier.
+
+See :c:type:`struct nvme_id_nvmset_list <nvme_id_nvmset_list>` for the defintion of the returned structure.
**Return**
set otherwise.
+.. c:function:: int nvme_identify_primary_ctrl (int fd, __u16 cntid, struct nvme_primary_ctrl_cap * cap)
+ Retrieve NVMe Primary Controller identification :c:type:`fd`:
-.. c:type:: enum nvme_features_async_event_config_flags
-
-
-**Constants**
-
-``NVME_FEATURE_AENCFG_SMART_CRIT_SPARE``
- *undescribed*
-
-``NVME_FEATURE_AENCFG_SMART_CRIT_TEMPERATURE``
- *undescribed*
-
-``NVME_FEATURE_AENCFG_SMART_CRIT_DEGRADED``
- *undescribed*
-
-``NVME_FEATURE_AENCFG_SMART_CRIT_READ_ONLY``
- *undescribed*
-
-``NVME_FEATURE_AENCFG_SMART_CRIT_VOLATILE_BACKUP``
- *undescribed*
-
-``NVME_FEATURE_AENCFG_SMART_CRIT_READ_ONLY_PMR``
- *undescribed*
-
-``NVME_FEATURE_AENCFG_NOTICE_NAMESPACE_ATTRIBUTES``
- *undescribed*
+**Parameters**
-``NVME_FEATURE_AENCFG_NOTICE_FIRMWARE_ACTIVATION``
+``int fd``
*undescribed*
-``NVME_FEATURE_AENCFG_NOTICE_TELEMETRY_LOG``
+``__u16 cntid``
*undescribed*
-``NVME_FEATURE_AENCFG_NOTICE_ANA_CHANGE``
- *undescribed*
+``struct nvme_primary_ctrl_cap * cap``
-``NVME_FEATURE_AENCFG_NOTICE_PL_EVENT``
- *undescribed*
+**Description**
-``NVME_FEATURE_AENCFG_NOTICE_LBA_STATUS``
- *undescribed*
+See :c:type:`struct nvme_primary_ctrl_cap <nvme_primary_ctrl_cap>` for the defintion of the returned structure, **cap**.
-``NVME_FEATURE_AENCFG_NOTICE_EG_EVENT``
- *undescribed*
+**Return**
-``NVME_FEATURE_AENCFG_NOTICE_DISCOVERY_CHANGE``
- *undescribed*
+The nvme command status if a response was received or -1
+ with errno set otherwise.
-.. c:function:: int nvme_set_features_async_event (int fd, __u32 events, bool save, __u32 * result)
+.. c:function:: int nvme_identify_secondary_ctrl_list (int fd, __u16 cntid, struct nvme_secondary_ctrl_list * list)
+ Retrieves secondary controller list
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 events``
+``__u16 cntid``
+ Return controllers starting at this identifier
+
+``struct nvme_secondary_ctrl_list * list``
*undescribed*
-``bool save``
- Save value across power states
+**Description**
-``__u32 * result``
- The command completion result from CQE dword0
+A Secondary Controller List is returned to the host for up to 127 secondary
+controllers associated with the primary controller processing this command.
+The list contains entries for controller identifiers greater than or equal
+to the value specified in the Controller Identifier (cntid).
+
+See :c:type:`struct nvme_secondary_ctrls_list <nvme_secondary_ctrls_list>` for a defintion of the returned
+structure.
**Return**
set otherwise.
-.. c:function:: int nvme_set_features_auto_pst (int fd, bool apste, bool save, struct nvme_feat_auto_pst * apst, __u32 * result)
+.. c:function:: int nvme_identify_ns_granularity (int fd, struct nvme_id_ns_granularity_list * list)
+ Retrieves namespace granularity identification
**Parameters**
``int fd``
File descriptor of nvme device
-``bool apste``
+``struct nvme_id_ns_granularity_list * list``
*undescribed*
-``bool save``
- Save value across power states
+**Description**
-``struct nvme_feat_auto_pst * apst``
- *undescribed*
+If the controller supports reporting of Namespace Granularity, then a
+Namespace Granularity List is returned to the host for up to sixteen
+namespace granularity descriptors
-``__u32 * result``
- The command completion result from CQE dword0
+See :c:type:`struct nvme_id_ns_granularity_list <nvme_id_ns_granularity_list>` for the definition of the returned
+structure.
**Return**
set otherwise.
-.. c:function:: int nvme_set_features_timestamp (int fd, bool save, __u64 timestamp)
+.. c:function:: int nvme_identify_uuid (int fd, struct nvme_id_uuid_list * list)
+ Retrieves device's UUIDs
**Parameters**
``int fd``
File descriptor of nvme device
-``bool save``
- Save value across power states
+``struct nvme_id_uuid_list * list``
+ *undescribed*
-``__u64 timestamp``
- The current timestamp value to assign to this this feature
+**Description**
+
+Each UUID List entry is either 0h, the NVMe Invalid UUID, or a valid UUID.
+Valid UUIDs are those which are non-zero and are not the NVMe Invalid UUID.
+
+See :c:type:`struct nvme_id_uuid_list <nvme_id_uuid_list>` for the definition of the returned structure.
**Return**
set otherwise.
-.. c:function:: int nvme_set_features_hctm (int fd, __u16 tmt2, __u16 tmt1, bool save, __u32 * result)
+.. c:function:: int nvme_get_log (int fd, enum nvme_cmd_get_log_lid lid, __u32 nsid, __u64 lpo, __u8 lsp, __u16 lsi, bool rae, __u8 uuidx, __u32 len, void * log)
+ NVMe Admin Get Log command
**Parameters**
``int fd``
File descriptor of nvme device
-``__u16 tmt2``
- *undescribed*
-
-``__u16 tmt1``
- *undescribed*
-
-``bool save``
- Save value across power states
-
-``__u32 * result``
- The command completion result from CQE dword0
+``enum nvme_cmd_get_log_lid lid``
+ Log page identifier, see :c:type:`enum nvme_cmd_get_log_lid <nvme_cmd_get_log_lid>` for known values
-**Return**
+``__u32 nsid``
+ Namespace identifier, if applicable
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``__u64 lpo``
+ Log page offset for partial log transfers
+``__u8 lsp``
+ Log specific field
-.. c:function:: int nvme_set_features_nopsc (int fd, bool noppme, bool save, __u32 * result)
+``__u16 lsi``
+ Endurance group information
+``bool rae``
+ Retain asynchronous events
-**Parameters**
+``__u8 uuidx``
+ UUID selection, if supported
-``int fd``
- *undescribed*
+``__u32 len``
+ Length of provided user buffer to hold the log data in bytes
-``bool noppme``
- *undescribed*
+``void * log``
+ User space destination address to transfer the data
-``bool save``
- *undescribed*
+**Return**
-``__u32 * result``
- *undescribed*
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-.. c:function:: int nvme_set_features_rrl (int fd, __u8 rrl, __u16 nvmsetid, bool save, __u32 * result)
+.. c:function:: int nvme_get_log_error (int fd, unsigned nr_entries, bool rae, struct nvme_error_log_page * log)
+ Retrieve nvme error log
**Parameters**
``int fd``
File descriptor of nvme device
-``__u8 rrl``
+``unsigned nr_entries``
*undescribed*
-``__u16 nvmsetid``
+``bool rae``
+ Retain asynchronous events
+
+``struct nvme_error_log_page * log``
*undescribed*
-``bool save``
- Save value across power states
+**Description**
-``__u32 * result``
- The command completion result from CQE dword0
+This log page is used to describe extended error information for a command
+that completed with error, or may report an error that is not specific to a
+particular command.
**Return**
set otherwise.
-.. c:function:: int nvme_set_features_plm_config (int fd, bool enable, __u16 nvmsetid, bool save, struct nvme_plm_config * data, __u32 * result)
+.. c:function:: int nvme_get_log_smart (int fd, __u32 nsid, bool rae, struct nvme_smart_log * log)
+ Retrieve nvme smart log
**Parameters**
``int fd``
File descriptor of nvme device
-``bool enable``
- *undescribed*
-
-``__u16 nvmsetid``
- *undescribed*
+``__u32 nsid``
+ Optional namespace identifier
-``bool save``
- Save value across power states
+``bool rae``
+ Retain asynchronous events
-``struct nvme_plm_config * data``
+``struct nvme_smart_log * log``
*undescribed*
-``__u32 * result``
- The command completion result from CQE dword0
+**Description**
+
+This log page is used to provide SMART and general health information. The
+information provided is over the life of the controller and is retained
+across power cycles. To request the controller log page, the namespace
+identifier specified is FFFFFFFFh. The controller may also support
+requesting the log page on a per namespace basis, as indicated by bit 0 of
+the LPA field in the Identify Controller data structure.
**Return**
set otherwise.
+.. c:function:: int nvme_get_log_fw_slot (int fd, bool rae, struct nvme_firmware_slot * log)
-
-.. c:type:: enum nvme_feat_plm_window_select
-
-
-**Constants**
-
-``NVME_FEATURE_PLM_DTWIN``
- *undescribed*
-
-``NVME_FEATURE_PLM_NDWIN``
- *undescribed*
-
-
-.. c:function:: int nvme_set_features_plm_window (int fd, enum nvme_feat_plm_window_select sel, __u16 nvmsetid, bool save, __u32 * result)
-
+ Retrieves the controller firmware log
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_feat_plm_window_select sel``
- *undescribed*
+``bool rae``
+ Retain asynchronous events
-``__u16 nvmsetid``
+``struct nvme_firmware_slot * log``
*undescribed*
-``bool save``
- Save value across power states
+**Description**
-``__u32 * result``
- The command completion result from CQE dword0
+This log page is used to describe the firmware revision stored in each
+firmware slot supported. The firmware revision is indicated as an ASCII
+string. The log page also indicates the active slot number.
**Return**
set otherwise.
-.. c:function:: int nvme_set_features_lba_sts_interval (int fd, __u16 lsiri, __u16 lsipi, bool save, __u32 * result)
+.. c:function:: int nvme_get_log_changed_ns_list (int fd, bool rae, struct nvme_ns_list * log)
+ Retrieve namespace changed list
**Parameters**
``int fd``
File descriptor of nvme device
-``__u16 lsiri``
- *undescribed*
+``bool rae``
+ Retain asynchronous events
-``__u16 lsipi``
+``struct nvme_ns_list * log``
*undescribed*
-``bool save``
- Save value across power states
+**Description**
-``__u32 * result``
- The command completion result from CQE dword0
+This log page is used to describe namespaces attached to this controller
+that have changed since the last time the namespace was identified, been
+added, or deleted.
**Return**
set otherwise.
-.. c:function:: int nvme_set_features_host_behavior (int fd, bool save, struct nvme_feat_host_behavior * data)
+.. c:function:: int nvme_get_log_cmd_effects (int fd, struct nvme_cmd_effects_log * log)
+ Retrieve nvme command effects log
**Parameters**
``int fd``
File descriptor of nvme device
-``bool save``
- Save value across power states
-
-``struct nvme_feat_host_behavior * data``
+``struct nvme_cmd_effects_log * log``
*undescribed*
+**Description**
+
+This log page is used to describe the commands that the controller supports
+and the effects of those commands on the state of the NVM subsystem.
+
**Return**
The nvme command status if a response was received or -1 with errno
set otherwise.
-.. c:function:: int nvme_set_features_sanitize (int fd, bool nodrm, bool save, __u32 * result)
+.. c:function:: int nvme_get_log_device_self_test (int fd, struct nvme_self_test_log * log)
+ Retrieve the device self test log
**Parameters**
``int fd``
File descriptor of nvme device
-``bool nodrm``
- *undescribed*
+``struct nvme_self_test_log * log``
+ Userspace address of the log payload
-``bool save``
- Save value across power states
+**Description**
-``__u32 * result``
- The command completion result from CQE dword0
+The log page is used to indicate the status of an in progress self test and
+the percent complete of that operation, and the results of the previous 20
+self-test operations.
**Return**
set otherwise.
-.. c:function:: int nvme_set_features_endurance_evt_cfg (int fd, __u16 endgid, __u8 egwarn, bool save, __u32 * result)
+.. c:function:: int nvme_get_log_create_telemetry_host (int fd, struct nvme_telemetry_log * log)
**Parameters**
``int fd``
- File descriptor of nvme device
-
-``__u16 endgid``
*undescribed*
-``__u8 egwarn``
- Flags to enable warning, see :c:type:`enum nvme_eg_critical_warning_flags <nvme_eg_critical_warning_flags>`
-
-``bool save``
- Save value across power states
-
-``__u32 * result``
- The command completion result from CQE dword0
-
-**Return**
-
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``struct nvme_telemetry_log * log``
+ *undescribed*
-.. c:function:: int nvme_set_features_sw_progress (int fd, __u8 pbslc, bool save, __u32 * result)
+.. c:function:: int nvme_get_log_telemetry_host (int fd, __u64 offset, __u32 len, void * log)
**Parameters**
``int fd``
File descriptor of nvme device
-``__u8 pbslc``
- *undescribed*
+``__u64 offset``
+ Offset into the telemetry data
-``bool save``
- Save value across power states
+``__u32 len``
+ Length of provided user buffer to hold the log data in bytes
-``__u32 * result``
- The command completion result from CQE dword0
+``void * log``
+ User address for log page data
+
+**Description**
+
+Retreives the Telemetry Host-Initiated log page at the requested offset
+using the previously existing capture.
**Return**
set otherwise.
-.. c:function:: int nvme_set_features_host_id (int fd, bool exhid, bool save, __u8 * hostid)
+.. c:function:: int nvme_get_log_telemetry_ctrl (int fd, bool rae, __u64 offset, __u32 len, void * log)
**Parameters**
``int fd``
File descriptor of nvme device
-``bool exhid``
- *undescribed*
-
-``bool save``
- Save value across power states
+``bool rae``
+ Retain asynchronous events
-``__u8 * hostid``
- *undescribed*
+``__u64 offset``
+ Offset into the telemetry data
-**Return**
+``__u32 len``
+ Length of provided user buffer to hold the log data in bytes
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``void * log``
+ User address for log page data
-.. c:function:: int nvme_set_features_resv_mask (int fd, __u32 mask, bool save, __u32 * result)
+.. c:function:: int nvme_get_log_endurance_group (int fd, __u16 endgid, struct nvme_endurance_group_log * log)
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 mask``
- *undescribed*
+``__u16 endgid``
+ Starting group identifier to return in the list
-``bool save``
- Save value across power states
+``struct nvme_endurance_group_log * log``
+ User address to store the endurance log
-``__u32 * result``
- The command completion result from CQE dword0
+**Description**
+
+This log page indicates if an Endurance Group Event has occurred for a
+particular Endurance Group. If an Endurance Group Event has occurred, the
+details of the particular event are included in the Endurance Group
+Information log page for that Endurance Group. An asynchronous event is
+generated when an entry for an Endurance Group is newly added to this log
+page.
**Return**
set otherwise.
-.. c:function:: int nvme_set_features_resv_persist (int fd, bool ptpl, bool save, __u32 * result)
+.. c:function:: int nvme_get_log_predictable_lat_nvmset (int fd, __u16 nvmsetid, struct nvme_nvmset_predictable_lat_log * log)
**Parameters**
``int fd``
- File descriptor of nvme device
-
-``bool ptpl``
*undescribed*
-``bool save``
- Save value across power states
+``__u16 nvmsetid``
-``__u32 * result``
- The command completion result from CQE dword0
+``struct nvme_nvmset_predictable_lat_log * log``
+ *undescribed*
**Return**
set otherwise.
+.. c:function:: int nvme_get_log_predictable_lat_event (int fd, bool rae, __u32 offset, __u32 len, void * log)
-.. c:type:: enum nvme_feat_nswpcfg_state
-
+**Parameters**
-**Constants**
+``int fd``
+ File descriptor of nvme device
-``NVME_FEAT_NS_NO_WRITE_PROTECT``
- *undescribed*
+``bool rae``
+ Retain asynchronous events
-``NVME_FEAT_NS_WRITE_PROTECT``
+``__u32 offset``
*undescribed*
-``NVME_FEAT_NS_WRITE_PROTECT_PWR_CYCLE``
+``__u32 len``
*undescribed*
-``NVME_FEAT_NS_WRITE_PROTECT_PERMANENT``
+``void * log``
*undescribed*
-.. c:function:: int nvme_set_features_write_protect (int fd, enum nvme_feat_nswpcfg_state state, bool save, __u32 * result)
+.. c:function:: int nvme_get_log_ana (int fd, enum nvme_log_ana_lsp lsp, bool rae, __u64 offset, __u32 len, void * log)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_feat_nswpcfg_state state``
+``enum nvme_log_ana_lsp lsp``
+ Log specific, see :c:type:`enum nvme_get_log_ana_lsp <nvme_get_log_ana_lsp>`
+
+``bool rae``
+ Retain asynchronous events
+
+``__u64 offset``
*undescribed*
-``bool save``
- Save value across power states
+``__u32 len``
+ The allocated length of the log page
-``__u32 * result``
- The command completion result from CQE dword0
+``void * log``
+ User address to store the ana log
+
+**Description**
+
+This log consists of a header describing the log and descriptors containing
+the asymmetric namespace access information for ANA Groups that contain
+namespaces that are attached to the controller processing the command.
+
+See :c:type:`struct nvme_ana_rsp_hdr <nvme_ana_rsp_hdr>` for the defintion of the returned structure.
**Return**
set otherwise.
-.. c:function:: int nvme_get_features (int fd, enum nvme_features_id fid, __u32 nsid, enum nvme_get_features_sel sel, __u32 cdw11, __u8 uuidx, __u32 data_len, void * data, __u32 * result)
+.. c:function:: int nvme_get_log_ana_groups (int fd, bool rae, __u32 len, struct nvme_ana_group_desc * log)
- Retrieve a feature attribute
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_features_id fid``
- Feature identifier
-
-``__u32 nsid``
- Namespace ID, if applicable
-
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-
-``__u32 cdw11``
- Feature specific command dword11 field
-
-``__u8 uuidx``
- UUID Index for differentiating vendor specific encoding
-
-``__u32 data_len``
- Length of feature data, if applicable, in bytes
+``bool rae``
+ Retain asynchronous events
-``void * data``
- User address of feature data, if applicable
+``__u32 len``
+ *undescribed*
-``__u32 * result``
- The command completion result from CQE dword0
+``struct nvme_ana_group_desc * log``
+ *undescribed*
-**Return**
+**Description**
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+See :c:type:`struct nvme_ana_group_desc <nvme_ana_group_desc>` for the defintion of the returned structure.
-.. c:function:: int nvme_get_features_arbitration (int fd, enum nvme_get_features_sel sel, __u32 * result)
+.. c:function:: int nvme_get_log_lba_status (int fd, bool rae, __u64 offset, __u32 len, void * log)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``bool rae``
+ Retain asynchronous events
-``__u32 * result``
- The command completion result from CQE dword0
+``__u64 offset``
+ *undescribed*
-**Return**
+``__u32 len``
+ *undescribed*
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``void * log``
+ *undescribed*
-.. c:function:: int nvme_get_features_power_mgmt (int fd, enum nvme_get_features_sel sel, __u32 * result)
+.. c:function:: int nvme_get_log_endurance_grp_evt (int fd, bool rae, __u32 offset, __u32 len, void * log)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``bool rae``
+ Retain asynchronous events
-``__u32 * result``
- The command completion result from CQE dword0
+``__u32 offset``
+ *undescribed*
-**Return**
+``__u32 len``
+ *undescribed*
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``void * log``
+ *undescribed*
-.. c:function:: int nvme_get_features_lba_range (int fd, enum nvme_get_features_sel sel, struct nvme_lba_range_type * data, __u32 * result)
+.. c:function:: int nvme_get_log_discovery (int fd, bool rae, __u32 offset, __u32 len, void * log)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``bool rae``
+ Retain asynchronous events
-``struct nvme_lba_range_type * data``
- *undescribed*
+``__u32 offset``
+ Offset of this log to retrieve
-``__u32 * result``
- The command completion result from CQE dword0
+``__u32 len``
+ The allocated size for this portion of the log
+
+``void * log``
+ User address to store the discovery log
+
+**Description**
+
+Supported only by fabrics discovery controllers, returning discovery
+records.
**Return**
set otherwise.
-.. c:function:: int nvme_get_features_temp_thresh (int fd, enum nvme_get_features_sel sel, __u32 * result)
+.. c:function:: int nvme_get_log_reservation (int fd, bool rae, struct nvme_resv_notification_log * log)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``bool rae``
+ Retain asynchronous events
-``__u32 * result``
- The command completion result from CQE dword0
-
-**Return**
-
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``struct nvme_resv_notification_log * log``
+ *undescribed*
-.. c:function:: int nvme_get_features_err_recovery (int fd, enum nvme_get_features_sel sel, __u32 * result)
+.. c:function:: int nvme_get_log_sanitize (int fd, bool rae, struct nvme_sanitize_log_page * log)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``bool rae``
+ Retain asynchronous events
-``__u32 * result``
- The command completion result from CQE dword0
+``struct nvme_sanitize_log_page * log``
+ User address to store the sanitize log
+
+**Description**
+
+The Sanitize Status log page is used to report sanitize operation time
+estimates and information about the most recent sanitize operation.
**Return**
set otherwise.
-.. c:function:: int nvme_get_features_volatile_wc (int fd, enum nvme_get_features_sel sel, __u32 * result)
+.. c:function:: int nvme_set_features (int fd, __u8 fid, __u32 nsid, __u32 cdw11, __u32 cdw12, bool save, __u8 uuidx, __u32 cdw15, __u32 data_len, void * data, __u32 * result)
+ Set a feature attribute
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-
-``__u32 * result``
- The command completion result from CQE dword0
+``__u8 fid``
+ Feature identifier
-**Return**
+``__u32 nsid``
+ Namespace ID, if applicable
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``__u32 cdw11``
+ Value to set the feature to
+``__u32 cdw12``
+ Feature specific command dword12 field
-.. c:function:: int nvme_get_features_num_queues (int fd, enum nvme_get_features_sel sel, __u32 * result)
+``bool save``
+ Save value across power states
+``__u8 uuidx``
+ UUID Index for differentiating vendor specific encoding
-**Parameters**
+``__u32 cdw15``
+ *undescribed*
-``int fd``
- File descriptor of nvme device
+``__u32 data_len``
+ Length of feature data, if applicable, in bytes
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``void * data``
+ User address of feature data, if applicable
``__u32 * result``
The command completion result from CQE dword0
set otherwise.
-.. c:function:: int nvme_get_features_irq_coalesce (int fd, enum nvme_get_features_sel sel, __u32 * result)
+.. c:function:: int nvme_set_features_arbitration (int fd, __u8 ab, __u8 lpw, __u8 mpw, __u8 hpw, bool save, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``__u8 ab``
+ *undescribed*
+
+``__u8 lpw``
+ *undescribed*
+
+``__u8 mpw``
+ *undescribed*
+
+``__u8 hpw``
+ *undescribed*
+
+``bool save``
+ Save value across power states
``__u32 * result``
The command completion result from CQE dword0
set otherwise.
-.. c:function:: int nvme_get_features_irq_config (int fd, enum nvme_get_features_sel sel, __u16 iv, __u32 * result)
+.. c:function:: int nvme_set_features_power_mgmt (int fd, __u8 ps, __u8 wh, bool save, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``__u8 ps``
+ *undescribed*
-``__u16 iv``
+``__u8 wh``
*undescribed*
+``bool save``
+ Save value across power states
+
``__u32 * result``
The command completion result from CQE dword0
set otherwise.
-.. c:function:: int nvme_get_features_write_atomic (int fd, enum nvme_get_features_sel sel, __u32 * result)
+.. c:function:: int nvme_set_features_lba_range (int fd, __u32 nsid, __u32 nr_ranges, bool save, struct nvme_lba_range_type * data, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``__u32 nsid``
+ *undescribed*
+
+``__u32 nr_ranges``
+ *undescribed*
+
+``bool save``
+ Save value across power states
+
+``struct nvme_lba_range_type * data``
+ *undescribed*
``__u32 * result``
The command completion result from CQE dword0
set otherwise.
-.. c:function:: int nvme_get_features_async_event (int fd, enum nvme_get_features_sel sel, __u32 * result)
-
-**Parameters**
-``int fd``
- File descriptor of nvme device
+.. c:type:: enum nvme_feat_tmpthresh_thsel
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-``__u32 * result``
- The command completion result from CQE dword0
+**Constants**
-**Return**
+``NVME_FEATURE_TEMPTHRESH_THSEL_OVER``
+ *undescribed*
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``NVME_FEATURETEMPTHRESH__THSEL_UNDER``
+ *undescribed*
-.. c:function:: int nvme_get_features_auto_pst (int fd, enum nvme_get_features_sel sel, struct nvme_feat_auto_pst * apst, __u32 * result)
+.. c:function:: int nvme_set_features_temp_thresh (int fd, __u16 tmpth, __u8 tmpsel, enum nvme_feat_tmpthresh_thsel thsel, bool save, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``__u16 tmpth``
+ *undescribed*
-``struct nvme_feat_auto_pst * apst``
+``__u8 tmpsel``
+ *undescribed*
+
+``enum nvme_feat_tmpthresh_thsel thsel``
*undescribed*
+``bool save``
+ Save value across power states
+
``__u32 * result``
The command completion result from CQE dword0
set otherwise.
-.. c:function:: int nvme_get_features_host_mem_buf (int fd, enum nvme_get_features_sel sel, __u32 * result)
+.. c:function:: int nvme_set_features_err_recovery (int fd, __u32 nsid, __u16 tler, bool dulbe, bool save, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``__u32 nsid``
+ *undescribed*
+
+``__u16 tler``
+ *undescribed*
+
+``bool dulbe``
+ *undescribed*
+
+``bool save``
+ Save value across power states
``__u32 * result``
The command completion result from CQE dword0
set otherwise.
-.. c:function:: int nvme_get_features_timestamp (int fd, enum nvme_get_features_sel sel, struct nvme_timestamp * ts)
+.. c:function:: int nvme_set_features_volatile_wc (int fd, bool wce, bool save, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-
-``struct nvme_timestamp * ts``
+``bool wce``
*undescribed*
+``bool save``
+ Save value across power states
+
+``__u32 * result``
+ The command completion result from CQE dword0
+
**Return**
The nvme command status if a response was received or -1 with errno
set otherwise.
-.. c:function:: int nvme_get_features_kato (int fd, enum nvme_get_features_sel sel, __u32 * result)
+.. c:function:: int nvme_set_features_irq_coalesce (int fd, __u8 thr, __u8 time, bool save, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``__u8 thr``
+ *undescribed*
+
+``__u8 time``
+ *undescribed*
+
+``bool save``
+ Save value across power states
``__u32 * result``
The command completion result from CQE dword0
set otherwise.
-.. c:function:: int nvme_get_features_hctm (int fd, enum nvme_get_features_sel sel, __u32 * result)
+.. c:function:: int nvme_set_features_irq_config (int fd, __u16 iv, bool cd, bool save, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``__u16 iv``
+ *undescribed*
+
+``bool cd``
+ *undescribed*
+
+``bool save``
+ Save value across power states
``__u32 * result``
The command completion result from CQE dword0
set otherwise.
-.. c:function:: int nvme_get_features_nopsc (int fd, enum nvme_get_features_sel sel, __u32 * result)
+.. c:function:: int nvme_set_features_write_atomic (int fd, bool dn, bool save, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``bool dn``
+ *undescribed*
+
+``bool save``
+ Save value across power states
``__u32 * result``
The command completion result from CQE dword0
set otherwise.
-.. c:function:: int nvme_get_features_rrl (int fd, enum nvme_get_features_sel sel, __u32 * result)
-**Parameters**
+.. c:type:: enum nvme_features_async_event_config_flags
-``int fd``
- File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+**Constants**
-``__u32 * result``
- The command completion result from CQE dword0
+``NVME_FEATURE_AENCFG_SMART_CRIT_SPARE``
+ *undescribed*
-**Return**
+``NVME_FEATURE_AENCFG_SMART_CRIT_TEMPERATURE``
+ *undescribed*
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``NVME_FEATURE_AENCFG_SMART_CRIT_DEGRADED``
+ *undescribed*
+``NVME_FEATURE_AENCFG_SMART_CRIT_READ_ONLY``
+ *undescribed*
-.. c:function:: int nvme_get_features_plm_config (int fd, enum nvme_get_features_sel sel, __u16 nvmsetid, struct nvme_plm_config * data, __u32 * result)
+``NVME_FEATURE_AENCFG_SMART_CRIT_VOLATILE_BACKUP``
+ *undescribed*
+``NVME_FEATURE_AENCFG_SMART_CRIT_READ_ONLY_PMR``
+ *undescribed*
-**Parameters**
+``NVME_FEATURE_AENCFG_NOTICE_NAMESPACE_ATTRIBUTES``
+ *undescribed*
-``int fd``
- File descriptor of nvme device
+``NVME_FEATURE_AENCFG_NOTICE_FIRMWARE_ACTIVATION``
+ *undescribed*
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``NVME_FEATURE_AENCFG_NOTICE_TELEMETRY_LOG``
+ *undescribed*
-``__u16 nvmsetid``
+``NVME_FEATURE_AENCFG_NOTICE_ANA_CHANGE``
*undescribed*
-``struct nvme_plm_config * data``
+``NVME_FEATURE_AENCFG_NOTICE_PL_EVENT``
*undescribed*
-``__u32 * result``
- The command completion result from CQE dword0
+``NVME_FEATURE_AENCFG_NOTICE_LBA_STATUS``
+ *undescribed*
-**Return**
+``NVME_FEATURE_AENCFG_NOTICE_EG_EVENT``
+ *undescribed*
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``NVME_FEATURE_AENCFG_NOTICE_DISCOVERY_CHANGE``
+ *undescribed*
-.. c:function:: int nvme_get_features_plm_window (int fd, enum nvme_get_features_sel sel, __u16 nvmsetid, __u32 * result)
+.. c:function:: int nvme_set_features_async_event (int fd, __u32 events, bool save, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-
-``__u16 nvmsetid``
+``__u32 events``
*undescribed*
-``__u32 * result``
+``bool save``
+ Save value across power states
+
+``__u32 * result``
The command completion result from CQE dword0
**Return**
set otherwise.
-.. c:function:: int nvme_get_features_lba_sts_interval (int fd, enum nvme_get_features_sel sel, __u32 * result)
+.. c:function:: int nvme_set_features_auto_pst (int fd, bool apste, bool save, struct nvme_feat_auto_pst * apst, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``bool apste``
+ *undescribed*
+
+``bool save``
+ Save value across power states
+
+``struct nvme_feat_auto_pst * apst``
+ *undescribed*
``__u32 * result``
The command completion result from CQE dword0
set otherwise.
-.. c:function:: int nvme_get_features_host_behavior (int fd, enum nvme_get_features_sel sel, struct nvme_feat_host_behavior * data, __u32 * result)
+.. c:function:: int nvme_set_features_timestamp (int fd, bool save, __u64 timestamp)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-
-``struct nvme_feat_host_behavior * data``
- *undescribed*
+``bool save``
+ Save value across power states
-``__u32 * result``
- The command completion result from CQE dword0
+``__u64 timestamp``
+ The current timestamp value to assign to this this feature
**Return**
set otherwise.
-.. c:function:: int nvme_get_features_sanitize (int fd, enum nvme_get_features_sel sel, __u32 * result)
+.. c:function:: int nvme_set_features_hctm (int fd, __u16 tmt2, __u16 tmt1, bool save, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``__u16 tmt2``
+ *undescribed*
+
+``__u16 tmt1``
+ *undescribed*
+
+``bool save``
+ Save value across power states
``__u32 * result``
The command completion result from CQE dword0
set otherwise.
-.. c:function:: int nvme_get_features_endurance_event_cfg (int fd, enum nvme_get_features_sel sel, __u16 endgid, __u32 * result)
+.. c:function:: int nvme_set_features_nopsc (int fd, bool noppme, bool save, __u32 * result)
+
+
+**Parameters**
+
+``int fd``
+ *undescribed*
+
+``bool noppme``
+ *undescribed*
+
+``bool save``
+ *undescribed*
+
+``__u32 * result``
+ *undescribed*
+
+
+.. c:function:: int nvme_set_features_rrl (int fd, __u8 rrl, __u16 nvmsetid, bool save, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``__u8 rrl``
+ *undescribed*
-``__u16 endgid``
+``__u16 nvmsetid``
*undescribed*
+``bool save``
+ Save value across power states
+
``__u32 * result``
The command completion result from CQE dword0
set otherwise.
-.. c:function:: int nvme_get_features_sw_progress (int fd, enum nvme_get_features_sel sel, __u32 * result)
+.. c:function:: int nvme_set_features_plm_config (int fd, bool enable, __u16 nvmsetid, bool save, struct nvme_plm_config * data, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``bool enable``
+ *undescribed*
+
+``__u16 nvmsetid``
+ *undescribed*
+
+``bool save``
+ Save value across power states
+
+``struct nvme_plm_config * data``
+ *undescribed*
``__u32 * result``
The command completion result from CQE dword0
set otherwise.
-.. c:function:: int nvme_get_features_host_id (int fd, enum nvme_get_features_sel sel, bool exhid, __u32 len, __u8 * hostid)
+
+
+.. c:type:: enum nvme_feat_plm_window_select
+
+
+**Constants**
+
+``NVME_FEATURE_PLM_DTWIN``
+ *undescribed*
+
+``NVME_FEATURE_PLM_NDWIN``
+ *undescribed*
+
+
+.. c:function:: int nvme_set_features_plm_window (int fd, enum nvme_feat_plm_window_select sel, __u16 nvmsetid, bool save, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-
-``bool exhid``
+``enum nvme_feat_plm_window_select sel``
*undescribed*
-``__u32 len``
+``__u16 nvmsetid``
*undescribed*
-``__u8 * hostid``
- *undescribed*
+``bool save``
+ Save value across power states
+
+``__u32 * result``
+ The command completion result from CQE dword0
**Return**
set otherwise.
-.. c:function:: int nvme_get_features_resv_mask (int fd, enum nvme_get_features_sel sel, __u32 * result)
+.. c:function:: int nvme_set_features_lba_sts_interval (int fd, __u16 lsiri, __u16 lsipi, bool save, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``__u16 lsiri``
+ *undescribed*
+
+``__u16 lsipi``
+ *undescribed*
+
+``bool save``
+ Save value across power states
``__u32 * result``
The command completion result from CQE dword0
set otherwise.
-.. c:function:: int nvme_get_features_resv_persist (int fd, enum nvme_get_features_sel sel, __u32 * result)
+.. c:function:: int nvme_set_features_host_behavior (int fd, bool save, struct nvme_feat_host_behavior * data)
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``bool save``
+ Save value across power states
-``__u32 * result``
- The command completion result from CQE dword0
+``struct nvme_feat_host_behavior * data``
+ *undescribed*
**Return**
set otherwise.
-.. c:function:: int nvme_get_features_write_protect (int fd, __u32 nsid, enum nvme_get_features_sel sel, __u32 * result)
+.. c:function:: int nvme_set_features_sanitize (int fd, bool nodrm, bool save, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Namespace ID
+``bool nodrm``
+ *undescribed*
-``enum nvme_get_features_sel sel``
- Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``bool save``
+ Save value across power states
``__u32 * result``
The command completion result from CQE dword0
set otherwise.
-.. c:function:: int nvme_format_nvm (int fd, __u32 nsid, __u8 lbaf, enum nvme_cmd_format_mset mset, enum nvme_cmd_format_pi pi, enum nvme_cmd_format_pil pil, enum nvme_cmd_format_ses ses, __u32 timeout)
+.. c:function:: int nvme_set_features_endurance_evt_cfg (int fd, __u16 endgid, __u8 egwarn, bool save, __u32 * result)
- Format nvme namespace(s)
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Namespace ID to format
-
-``__u8 lbaf``
- Logical block address format
-
-``enum nvme_cmd_format_mset mset``
- Metadata settings (extended or separated), true if extended
-
-``enum nvme_cmd_format_pi pi``
- Protection information type
-
-``enum nvme_cmd_format_pil pil``
- Protection information location (beginning or end), true if end
-
-``enum nvme_cmd_format_ses ses``
- Secure erase settings
+``__u16 endgid``
+ *undescribed*
-``__u32 timeout``
- Set to override default timeout to this value in milliseconds;
- useful for long running formats. 0 will use system default.
+``__u8 egwarn``
+ Flags to enable warning, see :c:type:`enum nvme_eg_critical_warning_flags <nvme_eg_critical_warning_flags>`
-**Description**
+``bool save``
+ Save value across power states
-The Format NVM command is used to low level format the NVM media. This
-command is used by the host to change the LBA data size and/or metadata
-size. A low level format may destroy all data and metadata associated with
-all namespaces or only the specific namespace associated with the command
+``__u32 * result``
+ The command completion result from CQE dword0
**Return**
set otherwise.
-.. c:function:: int nvme_ns_mgmt (int fd, __u32 nsid, enum nvme_ns_mgmt_sel sel, struct nvme_id_ns * ns, __u32 * result, __u32 timeout)
+.. c:function:: int nvme_set_features_sw_progress (int fd, __u8 pbslc, bool save, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- *undescribed*
-
-``enum nvme_ns_mgmt_sel sel``
+``__u8 pbslc``
*undescribed*
-``struct nvme_id_ns * ns``
- *undescribed*
+``bool save``
+ Save value across power states
``__u32 * result``
- *undescribed*
+ The command completion result from CQE dword0
-``__u32 timeout``
- *undescribed*
+**Return**
+
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-.. c:function:: int nvme_ns_mgmt_create (int fd, struct nvme_id_ns * ns, __u32 * nsid, __u32 timeout)
+.. c:function:: int nvme_set_features_host_id (int fd, bool exhid, bool save, __u8 * hostid)
**Parameters**
``int fd``
File descriptor of nvme device
-``struct nvme_id_ns * ns``
- Namespace identifiaction that defines creation parameters
-
-``__u32 * nsid``
- On success, set to the namespace id that was created
-
-``__u32 timeout``
- Overide the default timeout to this value in milliseconds;
- set to 0 to use the system default.
+``bool exhid``
+ *undescribed*
-**Description**
+``bool save``
+ Save value across power states
-On successful creation, the namespace exists in the subsystem, but is not
-attached to any controller. Use the nvme_ns_attach_ctrls() to assign the
-namespace to one or more controllers.
+``__u8 * hostid``
+ *undescribed*
**Return**
set otherwise.
-.. c:function:: int nvme_ns_mgmt_delete (int fd, __u32 nsid)
+.. c:function:: int nvme_set_features_resv_mask (int fd, __u32 mask, bool save, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Namespace identifier to delete
+``__u32 mask``
+ *undescribed*
-**Description**
+``bool save``
+ Save value across power states
-It is recommended that a namespace being deleted is not attached to any
-controller. Use the nvme_ns_detach_ctrls() first if the namespace is still
-attached.
+``__u32 * result``
+ The command completion result from CQE dword0
**Return**
set otherwise.
-.. c:function:: int nvme_ns_attach (int fd, __u32 nsid, enum nvme_ns_attach_sel sel, struct nvme_ctrl_list * ctrlist)
+.. c:function:: int nvme_set_features_resv_persist (int fd, bool ptpl, bool save, __u32 * result)
- Attach or detach namespace to controller(s)
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Namespace ID to execute attach selection
+``bool ptpl``
+ *undescribed*
-``enum nvme_ns_attach_sel sel``
- Attachment selection, see :c:type:`enum nvme_ns_attach_sel <nvme_ns_attach_sel>`
+``bool save``
+ Save value across power states
-``struct nvme_ctrl_list * ctrlist``
- Controller list to modify attachment state of nsid
+``__u32 * result``
+ The command completion result from CQE dword0
+**Return**
-.. c:function:: int nvme_ns_attach_ctrls (int fd, __u32 nsid, struct nvme_ctrl_list * ctrlist)
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-**Parameters**
-
-``int fd``
- File descriptor of nvme device
-``__u32 nsid``
- Namespace ID to attach
-
-``struct nvme_ctrl_list * ctrlist``
- Controller list to modify attachment state of nsid
+.. c:type:: enum nvme_feat_nswpcfg_state
-.. c:function:: int nvme_ns_dettach_ctrls (int fd, __u32 nsid, struct nvme_ctrl_list * ctrlist)
+**Constants**
-**Parameters**
+``NVME_FEAT_NS_NO_WRITE_PROTECT``
+ *undescribed*
-``int fd``
- File descriptor of nvme device
+``NVME_FEAT_NS_WRITE_PROTECT``
+ *undescribed*
-``__u32 nsid``
- Namespace ID to dettach
+``NVME_FEAT_NS_WRITE_PROTECT_PWR_CYCLE``
+ *undescribed*
-``struct nvme_ctrl_list * ctrlist``
- Controller list to modify attachment state of nsid
+``NVME_FEAT_NS_WRITE_PROTECT_PERMANENT``
+ *undescribed*
-.. c:function:: int nvme_fw_download (int fd, __u32 offset, __u32 data_len, void * data)
+.. c:function:: int nvme_set_features_write_protect (int fd, enum nvme_feat_nswpcfg_state state, bool save, __u32 * result)
- Download part or all of a firmware image to the controller
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 offset``
- Offset in the firmware data
-
-``__u32 data_len``
- Length of data in this command in bytes
-
-``void * data``
- Userspace address of the firmware data
-
-**Description**
-
-The Firmware Image Download command is used to download all or a portion of
-an image for a future update to the controller. The Firmware Image Download
-command downloads a new image (in whole or in part) to the controller.
+``enum nvme_feat_nswpcfg_state state``
+ *undescribed*
-The image may be constructed of multiple pieces that are individually
-downloaded with separate Firmware Image Download commands. Each Firmware
-Image Download command includes a Dword Offset and Number of Dwords that
-specify a dword range.
+``bool save``
+ Save value across power states
-The new firmware image is not activated as part of the Firmware Image
-Download command. Use the nvme_fw_commit() to activate a newly downloaded
-image.
+``__u32 * result``
+ The command completion result from CQE dword0
**Return**
set otherwise.
-.. c:function:: int nvme_fw_commit (int fd, __u8 slot, enum nvme_fw_commit_ca action, bool bpid)
+.. c:function:: int nvme_get_features (int fd, enum nvme_features_id fid, __u32 nsid, enum nvme_get_features_sel sel, __u32 cdw11, __u8 uuidx, __u32 data_len, void * data, __u32 * result)
- Commit firmware using the specified action
+ Retrieve a feature attribute
**Parameters**
``int fd``
File descriptor of nvme device
-``__u8 slot``
- Firmware slot to commit the downloaded image
+``enum nvme_features_id fid``
+ Feature identifier
-``enum nvme_fw_commit_ca action``
- Action to use for the firmware image, see :c:type:`enum nvme_fw_commit_ca <nvme_fw_commit_ca>`
+``__u32 nsid``
+ Namespace ID, if applicable
-``bool bpid``
- Set to true to select the boot partition id
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-**Description**
+``__u32 cdw11``
+ Feature specific command dword11 field
-The Firmware Commit command is used to modify the firmware image or Boot
-Partitions.
+``__u8 uuidx``
+ UUID Index for differentiating vendor specific encoding
+
+``__u32 data_len``
+ Length of feature data, if applicable, in bytes
+
+``void * data``
+ User address of feature data, if applicable
+
+``__u32 * result``
+ The command completion result from CQE dword0
**Return**
The nvme command status if a response was received or -1 with errno
- set otherwise. The command status response may specify additional
- reset actions required to complete the commit process.
+ set otherwise.
-.. c:function:: int nvme_security_send (int fd, __u32 nsid, __u8 nssf, __u8 spsp0, __u8 spsp1, __u8 secp, __u32 tl, __u32 data_len, void * data, __u32 * result)
+.. c:function:: int nvme_get_features_arbitration (int fd, enum nvme_get_features_sel sel, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Namespace ID to issue security command on
-
-``__u8 nssf``
- NVMe Security Specific field
-
-``__u8 spsp0``
- Security Protocol Specific field
-
-``__u8 spsp1``
- Security Protocol Specific field
-
-``__u8 secp``
- Security Protocol
-
-``__u32 tl``
- Protocol specific transfer length
-
-``__u32 data_len``
- Data length of the payload in bytes
-
-``void * data``
- Security data payload to send
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
``__u32 * result``
The command completion result from CQE dword0
-**Description**
-
-The Security Send command is used to transfer security protocol data to the
-controller. The data structure transferred to the controller as part of this
-command contains security protocol specific commands to be performed by the
-controller. The data structure transferred may also contain data or
-parameters associated with the security protocol commands.
-
-The security data is protocol specific and is not defined by the NVMe
-specification.
-
**Return**
The nvme command status if a response was received or -1 with errno
set otherwise.
-.. c:function:: int nvme_security_receive (int fd, __u32 nsid, __u8 nssf, __u8 spsp0, __u8 spsp1, __u8 secp, __u32 al, __u32 data_len, void * data, __u32 * result)
+.. c:function:: int nvme_get_features_power_mgmt (int fd, enum nvme_get_features_sel sel, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Namespace ID to issue security command on
-
-``__u8 nssf``
- NVMe Security Specific field
-
-``__u8 spsp0``
- Security Protocol Specific field
-
-``__u8 spsp1``
- Security Protocol Specific field
-
-``__u8 secp``
- Security Protocol
-
-``__u32 al``
- Protocol specific allocation length
-
-``__u32 data_len``
- Data length of the payload in bytes
-
-``void * data``
- Security data payload to send
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
``__u32 * result``
The command completion result from CQE dword0
set otherwise.
-.. c:function:: int nvme_get_lba_status (int fd, __u32 nsid, __u64 slba, __u32 mndw, __u16 rl, enum nvme_lba_status_atype atype, struct nvme_lba_status * lbas)
+.. c:function:: int nvme_get_features_lba_range (int fd, enum nvme_get_features_sel sel, struct nvme_lba_range_type * data, __u32 * result)
- Retrieve information on possibly unrecoverable LBAs
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Namespace ID to retrieve LBA status
-
-``__u64 slba``
- Starting logical block address to check statuses
-
-``__u32 mndw``
- Maximum number of dwords to return
-
-``__u16 rl``
- Range length from slba to perform the action
-
-``enum nvme_lba_status_atype atype``
- Action type mechanism to determine LBA status desctriptors to
- return, see :c:type:`enum nvme_lba_status_atype <nvme_lba_status_atype>`
-
-``struct nvme_lba_status * lbas``
- Data payload to return status descriptors
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-**Description**
+``struct nvme_lba_range_type * data``
+ *undescribed*
-The Get LBA Status command requests information about Potentially
-Unrecoverable LBAs. Refer to the specification for action type descriptions.
+``__u32 * result``
+ The command completion result from CQE dword0
**Return**
set otherwise.
-.. c:function:: int nvme_directive_send (int fd, __u32 nsid, __u16 dspec, __u8 doper, enum nvme_directive_dtype dtype, __u32 cdw12, __u32 data_len, void * data, __u32 * result)
+.. c:function:: int nvme_get_features_temp_thresh (int fd, enum nvme_get_features_sel sel, __u32 * result)
- Send directive command
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Namespace ID, if applicable
-
-``__u16 dspec``
- Directive specific field
-
-``__u8 doper``
- Directive operation
-
-``enum nvme_directive_dtype dtype``
- Directive type, see :c:type:`enum nvme_directive_dtype <nvme_directive_dtype>`
-
-``__u32 cdw12``
- *undescribed*
-
-``__u32 data_len``
- Length of data payload in bytes
-
-``void * data``
- Usespace address of data payload
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
``__u32 * result``
- If successful, the CQE dword0 value
-
-**Description**
-
-Directives is a mechanism to enable host and NVM subsystem or controller
-information exchange. The Directive Send command is used to transfer data
-related to a specific Directive Type from the host to the controller.
-
-See the NVMe specification for more information.
+ The command completion result from CQE dword0
**Return**
set otherwise.
-.. c:function:: int nvme_directive_send_id_endir (int fd, __u32 nsid, bool endir, enum nvme_directive_dtype dtype, struct nvme_id_directives * id)
+.. c:function:: int nvme_get_features_err_recovery (int fd, enum nvme_get_features_sel sel, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Namespace ID
-
-``bool endir``
- *undescribed*
-
-``enum nvme_directive_dtype dtype``
- *undescribed*
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-``struct nvme_id_directives * id``
- *undescribed*
+``__u32 * result``
+ The command completion result from CQE dword0
**Return**
set otherwise.
-.. c:function:: int nvme_directive_send_stream_release_identifier (int fd, __u32 nsid, __u16 stream_id)
+.. c:function:: int nvme_get_features_volatile_wc (int fd, enum nvme_get_features_sel sel, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Namespace ID
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-``__u16 stream_id``
- *undescribed*
+``__u32 * result``
+ The command completion result from CQE dword0
**Return**
set otherwise.
-.. c:function:: int nvme_directive_send_stream_release_resource (int fd, __u32 nsid)
+.. c:function:: int nvme_get_features_num_queues (int fd, enum nvme_get_features_sel sel, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Namespace ID
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+
+``__u32 * result``
+ The command completion result from CQE dword0
**Return**
set otherwise.
-.. c:function:: int nvme_directive_recv (int fd, __u32 nsid, __u16 dspec, __u8 doper, enum nvme_directive_dtype dtype, __u32 cdw12, __u32 data_len, void * data, __u32 * result)
+.. c:function:: int nvme_get_features_irq_coalesce (int fd, enum nvme_get_features_sel sel, __u32 * result)
- Receive directive specific data
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Namespace ID, if applicable
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-``__u16 dspec``
- Directive specific field
+``__u32 * result``
+ The command completion result from CQE dword0
-``__u8 doper``
- Directive operation
+**Return**
-``enum nvme_directive_dtype dtype``
- Directive type, see :c:type:`enum nvme_directive_dtype <nvme_directive_dtype>`
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-``__u32 cdw12``
- *undescribed*
-``__u32 data_len``
- Length of data payload
+.. c:function:: int nvme_get_features_irq_config (int fd, enum nvme_get_features_sel sel, __u16 iv, __u32 * result)
-``void * data``
- Usespace address of data payload in bytes
+
+**Parameters**
+
+``int fd``
+ File descriptor of nvme device
+
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+
+``__u16 iv``
+ *undescribed*
``__u32 * result``
- If successful, the CQE dword0 value
+ The command completion result from CQE dword0
**Return**
set otherwise.
-.. c:function:: int nvme_directive_recv_identify_parameters (int fd, __u32 nsid, struct nvme_id_directives * id)
+.. c:function:: int nvme_get_features_write_atomic (int fd, enum nvme_get_features_sel sel, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Namespace ID
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-``struct nvme_id_directives * id``
- *undescribed*
+``__u32 * result``
+ The command completion result from CQE dword0
**Return**
set otherwise.
-.. c:function:: int nvme_directive_recv_stream_parameters (int fd, __u32 nsid, struct nvme_streams_directive_params * parms)
+.. c:function:: int nvme_get_features_async_event (int fd, enum nvme_get_features_sel sel, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Namespace ID
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-``struct nvme_streams_directive_params * parms``
- *undescribed*
+``__u32 * result``
+ The command completion result from CQE dword0
**Return**
set otherwise.
-.. c:function:: int nvme_directive_recv_stream_status (int fd, __u32 nsid, unsigned nr_entries, struct nvme_streams_directive_status * id)
+.. c:function:: int nvme_get_features_auto_pst (int fd, enum nvme_get_features_sel sel, struct nvme_feat_auto_pst * apst, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Namespace ID
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-``unsigned nr_entries``
+``struct nvme_feat_auto_pst * apst``
*undescribed*
-``struct nvme_streams_directive_status * id``
- *undescribed*
+``__u32 * result``
+ The command completion result from CQE dword0
**Return**
set otherwise.
-.. c:function:: int nvme_directive_recv_stream_allocate (int fd, __u32 nsid, __u16 nsr, __u32 * result)
+.. c:function:: int nvme_get_features_host_mem_buf (int fd, enum nvme_get_features_sel sel, __u32 * result)
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Namespace ID
-
-``__u16 nsr``
- *undescribed*
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
``__u32 * result``
- *undescribed*
+ The command completion result from CQE dword0
**Return**
set otherwise.
+.. c:function:: int nvme_get_features_timestamp (int fd, enum nvme_get_features_sel sel, struct nvme_timestamp * ts)
-.. c:type:: enum nvme_fctype
-
-
-**Constants**
-
-``nvme_fabrics_type_property_set``
- *undescribed*
+**Parameters**
-``nvme_fabrics_type_connect``
- *undescribed*
+``int fd``
+ File descriptor of nvme device
-``nvme_fabrics_type_property_get``
- *undescribed*
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-``nvme_fabrics_type_auth_send``
+``struct nvme_timestamp * ts``
*undescribed*
-``nvme_fabrics_type_auth_receive``
- *undescribed*
+**Return**
-``nvme_fabrics_type_disconnect``
- *undescribed*
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-.. c:function:: int nvme_set_property (int fd, int offset, __u64 value)
+.. c:function:: int nvme_get_features_kato (int fd, enum nvme_get_features_sel sel, __u32 * result)
- Set controller property
**Parameters**
``int fd``
File descriptor of nvme device
-``int offset``
- Property offset from the base to set
-
-``__u64 value``
- The value to set the property
-
-**Description**
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-This is an NVMe-over-Fabrics specific command, not applicable to PCIe. These
-properties align to the PCI MMIO controller registers.
+``__u32 * result``
+ The command completion result from CQE dword0
**Return**
set otherwise.
-.. c:function:: int nvme_get_property (int fd, int offset, __u64 * value)
+.. c:function:: int nvme_get_features_hctm (int fd, enum nvme_get_features_sel sel, __u32 * result)
- Get a controller property
**Parameters**
``int fd``
File descriptor of nvme device
-``int offset``
- Property offset from the base to retrieve
-
-``__u64 * value``
- Where the property's value will be stored on success
-
-**Description**
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-This is an NVMe-over-Fabrics specific command, not applicable to PCIe. These
-properties align to the PCI MMIO controller registers.
+``__u32 * result``
+ The command completion result from CQE dword0
**Return**
set otherwise.
-.. c:function:: int nvme_sanitize_nvm (int fd, enum nvme_sanitize_sanact sanact, bool ause, __u8 owpass, bool oipbp, bool nodas, __u32 ovrpat)
+.. c:function:: int nvme_get_features_nopsc (int fd, enum nvme_get_features_sel sel, __u32 * result)
- Start a sanitize operation
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_sanitize_sanact sanact``
- Sanitize action, see :c:type:`enum nvme_sanitize_sanact <nvme_sanitize_sanact>`
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-``bool ause``
- Set to allow unrestriced sanitize exit
+``__u32 * result``
+ The command completion result from CQE dword0
-``__u8 owpass``
- Overwrite pass count
+**Return**
-``bool oipbp``
- Set to overwrite invert pattern between passes
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-``bool nodas``
- Set to not deallocate blocks after sanitizing
-``__u32 ovrpat``
- Overwrite pattern
+.. c:function:: int nvme_get_features_rrl (int fd, enum nvme_get_features_sel sel, __u32 * result)
-**Description**
-A sanitize operation alters all user data in the NVM subsystem such that
-recovery of any previous user data from any cache, the non-volatile media,
-or any Controller Memory Buffer is not possible.
+**Parameters**
-The Sanitize command is used to start a sanitize operation or to recover
-from a previously failed sanitize operation. The sanitize operation types
-that may be supported are Block Erase, Crypto Erase, and Overwrite. All
-sanitize operations are processed in the background, i.e., completion of the
-sanitize command does not indicate completion of the sanitize operation.
+``int fd``
+ File descriptor of nvme device
+
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+
+``__u32 * result``
+ The command completion result from CQE dword0
**Return**
set otherwise.
-.. c:function:: int nvme_dev_self_test (int fd, __u32 nsid, enum nvme_dst_stc stc)
+.. c:function:: int nvme_get_features_plm_config (int fd, enum nvme_get_features_sel sel, __u16 nvmsetid, struct nvme_plm_config * data, __u32 * result)
- Start or abort a self test
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Namespace ID to test
-
-``enum nvme_dst_stc stc``
- Self test code, see :c:type:`enum nvme_dst_stc <nvme_dst_stc>`
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-**Description**
+``__u16 nvmsetid``
+ *undescribed*
-The Device Self-test command is used to start a device self-test operation
-or abort a device self-test operation. A device self-test operation is a
-diagnostic testing sequence that tests the integrity and functionality of
-the controller and may include testing of the media associated with
-namespaces. The controller may return a response to this command immediately
-while running the self-test in the background.
+``struct nvme_plm_config * data``
+ *undescribed*
-Set the 'nsid' field to 0 to not include namepsaces in the test. Set to
-0xffffffff to test all namespaces. All other values tests a specific
-namespace, if present.
+``__u32 * result``
+ The command completion result from CQE dword0
**Return**
set otherwise.
-.. c:function:: int nvme_virtual_mgmt (int fd, enum nvme_virt_mgmt_act act, enum nvme_virt_mgmt_rt rt, __u16 cntlid, __u16 nr, __u32 * result)
+.. c:function:: int nvme_get_features_plm_window (int fd, enum nvme_get_features_sel sel, __u16 nvmsetid, __u32 * result)
- Virtualization resource management
**Parameters**
``int fd``
File descriptor of nvme device
-``enum nvme_virt_mgmt_act act``
- Virtual resource action, see :c:type:`enum nvme_virt_mgmt_act <nvme_virt_mgmt_act>`
-
-``enum nvme_virt_mgmt_rt rt``
- Resource type to modify, see :c:type:`enum nvme_virt_mgmt_rt <nvme_virt_mgmt_rt>`
-
-``__u16 cntlid``
- Controller id for which resources are bing modified
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-``__u16 nr``
- Number of resources being allocated or assigned
+``__u16 nvmsetid``
+ *undescribed*
``__u32 * result``
- If successful, the CQE dword0
-
-**Description**
+ The command completion result from CQE dword0
-The Virtualization Management command is supported by primary controllers
-that support the Virtualization Enhancements capability. This command is
-used for several functions:
+**Return**
- - Modifying Flexible Resource allocation for the primary controller
- - Assigning Flexible Resources for secondary controllers
- - Setting the Online and Offline state for secondary controllers
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-**Return**
-The nvme command status if a response was received or -1
- with errno set otherwise.
+.. c:function:: int nvme_get_features_lba_sts_interval (int fd, enum nvme_get_features_sel sel, __u32 * result)
-**NVMe IO command**
+**Parameters**
+``int fd``
+ File descriptor of nvme device
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``__u32 * result``
+ The command completion result from CQE dword0
-.. c:type:: enum nvme_io_opcode
+**Return**
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-**Constants**
-``nvme_cmd_flush``
- *undescribed*
+.. c:function:: int nvme_get_features_host_behavior (int fd, enum nvme_get_features_sel sel, struct nvme_feat_host_behavior * data, __u32 * result)
-``nvme_cmd_write``
- *undescribed*
-``nvme_cmd_read``
- *undescribed*
+**Parameters**
-``nvme_cmd_write_uncor``
- *undescribed*
-
-``nvme_cmd_compare``
- *undescribed*
-
-``nvme_cmd_write_zeroes``
- *undescribed*
-
-``nvme_cmd_dsm``
- *undescribed*
+``int fd``
+ File descriptor of nvme device
-``nvme_cmd_verify``
- *undescribed*
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-``nvme_cmd_resv_register``
+``struct nvme_feat_host_behavior * data``
*undescribed*
-``nvme_cmd_resv_report``
- *undescribed*
+``__u32 * result``
+ The command completion result from CQE dword0
-``nvme_cmd_resv_acquire``
- *undescribed*
+**Return**
-``nvme_cmd_resv_release``
- *undescribed*
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-.. c:function:: int nvme_flush (int fd, __u32 nsid)
+.. c:function:: int nvme_get_features_sanitize (int fd, enum nvme_get_features_sel sel, __u32 * result)
- Send an nvme flush command
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Namespace identifier
-
-**Description**
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-The Flush command is used to request that the contents of volatile write
-cache be made non-volatile.
+``__u32 * result``
+ The command completion result from CQE dword0
**Return**
set otherwise.
+.. c:function:: int nvme_get_features_endurance_event_cfg (int fd, enum nvme_get_features_sel sel, __u16 endgid, __u32 * result)
-.. c:type:: enum nvme_io_control_flags
+**Parameters**
+``int fd``
+ File descriptor of nvme device
-**Constants**
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-``NVME_IO_DTYPE_STREAMS``
+``__u16 endgid``
*undescribed*
-``NVME_IO_DEAC``
- *undescribed*
+``__u32 * result``
+ The command completion result from CQE dword0
-``NVME_IO_PRINFO_PRCHK_REF``
- *undescribed*
+**Return**
-``NVME_IO_PRINFO_PRCHK_APP``
- *undescribed*
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-``NVME_IO_PRINFO_PRCHK_GUARD``
- *undescribed*
-``NVME_IO_PRINFO_PRACT``
- *undescribed*
+.. c:function:: int nvme_get_features_sw_progress (int fd, enum nvme_get_features_sel sel, __u32 * result)
-``NVME_IO_FUA``
- *undescribed*
-``NVME_IO_LR``
- *undescribed*
+**Parameters**
+``int fd``
+ File descriptor of nvme device
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
+``__u32 * result``
+ The command completion result from CQE dword0
-.. c:type:: enum nvme_io_dsm_flags
+**Return**
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-**Constants**
-``NVME_IO_DSM_FREQ_UNSPEC``
- *undescribed*
+.. c:function:: int nvme_get_features_host_id (int fd, enum nvme_get_features_sel sel, bool exhid, __u32 len, __u8 * hostid)
-``NVME_IO_DSM_FREQ_TYPICAL``
- *undescribed*
-``NVME_IO_DSM_FREQ_RARE``
- *undescribed*
+**Parameters**
-``NVME_IO_DSM_FREQ_READS``
- *undescribed*
+``int fd``
+ File descriptor of nvme device
-``NVME_IO_DSM_FREQ_WRITES``
- *undescribed*
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-``NVME_IO_DSM_FREQ_RW``
+``bool exhid``
*undescribed*
-``NVME_IO_DSM_FREQ_ONCE``
+``__u32 len``
*undescribed*
-``NVME_IO_DSM_FREQ_PREFETCH``
+``__u8 * hostid``
*undescribed*
-``NVME_IO_DSM_FREQ_TEMP``
- *undescribed*
+**Return**
-``NVME_IO_DSM_LATENCY_NONE``
- *undescribed*
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-``NVME_IO_DSM_LATENCY_IDLE``
- *undescribed*
-``NVME_IO_DSM_LATENCY_NORM``
- *undescribed*
+.. c:function:: int nvme_get_features_resv_mask (int fd, enum nvme_get_features_sel sel, __u32 * result)
-``NVME_IO_DSM_LATENCY_LOW``
- *undescribed*
-``NVME_IO_DSM_SEQ_REQ``
- *undescribed*
+**Parameters**
-``NVME_IO_DSM_COMPRESSED``
- *undescribed*
+``int fd``
+ File descriptor of nvme device
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-.. c:function:: int nvme_read (int fd, __u32 nsid, __u64 slba, __u16 nlb, __u16 control, __u8 dsm, __u32 reftag, __u16 apptag, __u16 appmask, __u32 data_len, void * data, __u32 metadata_len, void * metadata)
+``__u32 * result``
+ The command completion result from CQE dword0
+
+**Return**
+
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
+
+
+.. c:function:: int nvme_get_features_resv_persist (int fd, enum nvme_get_features_sel sel, __u32 * result)
- Submit an nvme user read command
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Namespace ID
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-``__u64 slba``
- Starting logical block
+``__u32 * result``
+ The command completion result from CQE dword0
-``__u16 nlb``
- *undescribed*
+**Return**
-``__u16 control``
- Command control flags, see :c:type:`enum nvme_io_control_flags <nvme_io_control_flags>`.
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-``__u8 dsm``
- Data set management attributes, see :c:type:`enum nvme_io_dsm_flags <nvme_io_dsm_flags>`
-``__u32 reftag``
- This field specifies the Initial Logical Block Reference Tag
- expected value. Used only if the namespace is formatted to use
- end-to-end protection information.
+.. c:function:: int nvme_get_features_write_protect (int fd, __u32 nsid, enum nvme_get_features_sel sel, __u32 * result)
-``__u16 apptag``
- This field specifies the Application Tag Mask expected value.
- Used only if the namespace is formatted to use end-to-end
- protection information.
-``__u16 appmask``
- This field specifies the Application Tag expected value. Used
- only if the namespace is formatted to use end-to-end protection
- information.
+**Parameters**
-``__u32 data_len``
- Length of user buffer, **data**, in bytes
+``int fd``
+ File descriptor of nvme device
-``void * data``
- Pointer to user address of the data buffer
- metadata_len:Length of user buffer, **metadata**, in bytes
+``__u32 nsid``
+ Namespace ID
-``__u32 metadata_len``
- *undescribed*
+``enum nvme_get_features_sel sel``
+ Select which type of attribute to return, see :c:type:`enum nvme_get_features_sel <nvme_get_features_sel>`
-``void * metadata``
- Pointer to user address of the metadata buffer
+``__u32 * result``
+ The command completion result from CQE dword0
**Return**
set otherwise.
-.. c:function:: int nvme_write (int fd, __u32 nsid, __u64 slba, __u16 nlb, __u16 control, __u8 dsm, __u16 dspec, __u32 reftag, __u16 apptag, __u16 appmask, __u32 data_len, void * data, __u32 metadata_len, void * metadata)
+.. c:function:: int nvme_format_nvm (int fd, __u32 nsid, __u8 lbaf, enum nvme_cmd_format_mset mset, enum nvme_cmd_format_pi pi, enum nvme_cmd_format_pil pil, enum nvme_cmd_format_ses ses, __u32 timeout)
- Submit an nvme user write command
+ Format nvme namespace(s)
**Parameters**
File descriptor of nvme device
``__u32 nsid``
- Namespace ID
-
-``__u64 slba``
- Starting logical block
-
-``__u16 nlb``
- *undescribed*
-
-``__u16 control``
- Command control flags, see :c:type:`enum nvme_io_control_flags <nvme_io_control_flags>`.
-
-``__u8 dsm``
- Data set management attributes, see :c:type:`enum nvme_io_dsm_flags <nvme_io_dsm_flags>`
+ Namespace ID to format
-``__u16 dspec``
- Directive specific command, eg: stream identifier
+``__u8 lbaf``
+ Logical block address format
-``__u32 reftag``
- This field specifies the Initial Logical Block Reference Tag
- expected value. Used only if the namespace is formatted to use
- end-to-end protection information.
+``enum nvme_cmd_format_mset mset``
+ Metadata settings (extended or separated), true if extended
-``__u16 apptag``
- This field specifies the Application Tag Mask expected value.
- Used only if the namespace is formatted to use end-to-end
- protection information.
+``enum nvme_cmd_format_pi pi``
+ Protection information type
-``__u16 appmask``
- This field specifies the Application Tag expected value. Used
- only if the namespace is formatted to use end-to-end protection
- information.
+``enum nvme_cmd_format_pil pil``
+ Protection information location (beginning or end), true if end
-``__u32 data_len``
- Length of user buffer, **data**, in bytes
+``enum nvme_cmd_format_ses ses``
+ Secure erase settings
-``void * data``
- Pointer to user address of the data buffer
- metadata_len:Length of user buffer, **metadata**, in bytes
+``__u32 timeout``
+ Set to override default timeout to this value in milliseconds;
+ useful for long running formats. 0 will use system default.
-``__u32 metadata_len``
- *undescribed*
+**Description**
-``void * metadata``
- Pointer to user address of the metadata buffer
+The Format NVM command is used to low level format the NVM media. This
+command is used by the host to change the LBA data size and/or metadata
+size. A low level format may destroy all data and metadata associated with
+all namespaces or only the specific namespace associated with the command
**Return**
set otherwise.
-.. c:function:: int nvme_compare (int fd, __u32 nsid, __u64 slba, __u16 nlb, __u16 control, __u32 reftag, __u16 apptag, __u16 appmask, __u32 data_len, void * data, __u32 metadata_len, void * metadata)
+.. c:function:: int nvme_ns_mgmt (int fd, __u32 nsid, enum nvme_ns_mgmt_sel sel, struct nvme_id_ns * ns, __u32 * result, __u32 timeout)
- Submit an nvme user compare command
**Parameters**
File descriptor of nvme device
``__u32 nsid``
- Namespace ID
+ *undescribed*
-``__u64 slba``
- Starting logical block
-
-``__u16 nlb``
+``enum nvme_ns_mgmt_sel sel``
*undescribed*
-``__u16 control``
- Command control flags, see :c:type:`enum nvme_io_control_flags <nvme_io_control_flags>`.
-
-``__u32 reftag``
- This field specifies the Initial Logical Block Reference Tag
- expected value. Used only if the namespace is formatted to use
- end-to-end protection information.
-
-``__u16 apptag``
- This field specifies the Application Tag Mask expected value.
- Used only if the namespace is formatted to use end-to-end
- protection information.
-
-``__u16 appmask``
- This field specifies the Application Tag expected value. Used
- only if the namespace is formatted to use end-to-end protection
- information.
-
-``__u32 data_len``
- Length of user buffer, **data**, in bytes
-
-``void * data``
- Pointer to user address of the data buffer
- metadata_len:Length of user buffer, **metadata**, in bytes
-
-``__u32 metadata_len``
+``struct nvme_id_ns * ns``
*undescribed*
-``void * metadata``
- Pointer to user address of the metadata buffer
-
-**Return**
+``__u32 * result``
+ *undescribed*
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``__u32 timeout``
+ *undescribed*
-.. c:function:: int nvme_write_zeros (int fd, __u32 nsid, __u64 slba, __u16 nlb, __u16 control, __u32 reftag, __u16 apptag, __u16 appmask)
+.. c:function:: int nvme_ns_mgmt_create (int fd, struct nvme_id_ns * ns, __u32 * nsid, __u32 timeout)
- Submit an nvme write zeroes command
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Namespace identifier
-
-``__u64 slba``
- Starting logical block
-
-``__u16 nlb``
- Number of logical blocks to clear (0's based value)
-
-``__u16 control``
- Command control flags, see :c:type:`enum nvme_io_control_flags <nvme_io_control_flags>`.
-
-``__u32 reftag``
- This field specifies the Initial Logical Block Reference Tag
- expected value. Used only if the namespace is formatted to use
- end-to-end protection information.
+``struct nvme_id_ns * ns``
+ Namespace identifiaction that defines creation parameters
-``__u16 apptag``
- This field specifies the Application Tag Mask expected value.
- Used only if the namespace is formatted to use end-to-end
- protection information.
+``__u32 * nsid``
+ On success, set to the namespace id that was created
-``__u16 appmask``
- This field specifies the Application Tag expected value. Used
- only if the namespace is formatted to use end-to-end protection
- information.
+``__u32 timeout``
+ Overide the default timeout to this value in milliseconds;
+ set to 0 to use the system default.
**Description**
-The Write Zeroes command is used to set a range of logical blocks to zero.
-After successful completion of this command, the value returned by
-subsequent reads of logical blocks in this range shall be all bytes cleared
-to 0h until a write occurs to this LBA range.
+On successful creation, the namespace exists in the subsystem, but is not
+attached to any controller. Use the nvme_ns_attach_ctrls() to assign the
+namespace to one or more controllers.
**Return**
set otherwise.
-.. c:function:: int nvme_write_uncorrectable (int fd, __u32 nsid, __u64 slba, __u16 nlb)
+.. c:function:: int nvme_ns_mgmt_delete (int fd, __u32 nsid)
- Submit an nvme write uncorrectable command
**Parameters**
File descriptor of nvme device
``__u32 nsid``
- Namespace identifier
-
-``__u64 slba``
- Starting logical block
-
-``__u16 nlb``
- Number of logical blocks to invalidate (0's based value)
+ Namespace identifier to delete
**Description**
-The Write Uncorrectable command is used to mark a range of logical blocks as
-invalid. When the specified logical block(s) are read after this operation,
-a failure is returned with Unrecovered Read Error status. To clear the
-invalid logical block status, a write operation on those logical blocks is
-required.
+It is recommended that a namespace being deleted is not attached to any
+controller. Use the nvme_ns_detach_ctrls() first if the namespace is still
+attached.
**Return**
set otherwise.
-.. c:function:: int nvme_verify (int fd, __u32 nsid, __u64 slba, __u16 nlb, __u16 control, __u32 reftag, __u16 apptag, __u16 appmask)
+.. c:function:: int nvme_ns_attach (int fd, __u32 nsid, enum nvme_ns_attach_sel sel, struct nvme_ctrl_list * ctrlist)
- Send an nvme verify command
+ Attach or detach namespace to controller(s)
**Parameters**
File descriptor of nvme device
``__u32 nsid``
- Namespace identifier
-
-``__u64 slba``
- Starting logical block
-
-``__u16 nlb``
- Number of logical blocks to verify (0's based value)
-
-``__u16 control``
- Command control flags, see :c:type:`enum nvme_io_control_flags <nvme_io_control_flags>`.
+ Namespace ID to execute attach selection
-``__u32 reftag``
- This field specifies the Initial Logical Block Reference Tag
- expected value. Used only if the namespace is formatted to use
- end-to-end protection information.
+``enum nvme_ns_attach_sel sel``
+ Attachment selection, see :c:type:`enum nvme_ns_attach_sel <nvme_ns_attach_sel>`
-``__u16 apptag``
- This field specifies the Application Tag Mask expected value.
- Used only if the namespace is formatted to use end-to-end
- protection information.
+``struct nvme_ctrl_list * ctrlist``
+ Controller list to modify attachment state of nsid
-``__u16 appmask``
- This field specifies the Application Tag expected value. Used
- only if the namespace is formatted to use end-to-end protection
- information.
-**Description**
+.. c:function:: int nvme_ns_attach_ctrls (int fd, __u32 nsid, struct nvme_ctrl_list * ctrlist)
-The Verify command verifies integrity of stored information by reading data
-and metadata, if applicable, for the LBAs indicated without transferring any
-data or metadata to the host.
-**Return**
+**Parameters**
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``int fd``
+ File descriptor of nvme device
+``__u32 nsid``
+ Namespace ID to attach
+``struct nvme_ctrl_list * ctrlist``
+ Controller list to modify attachment state of nsid
-.. c:type:: enum nvme_dsm_attributes
+.. c:function:: int nvme_ns_dettach_ctrls (int fd, __u32 nsid, struct nvme_ctrl_list * ctrlist)
-**Constants**
+**Parameters**
-``NVME_DSMGMT_IDR``
- *undescribed*
+``int fd``
+ File descriptor of nvme device
-``NVME_DSMGMT_IDW``
- *undescribed*
+``__u32 nsid``
+ Namespace ID to dettach
-``NVME_DSMGMT_AD``
- *undescribed*
+``struct nvme_ctrl_list * ctrlist``
+ Controller list to modify attachment state of nsid
-.. c:function:: int nvme_dsm (int fd, __u32 nsid, __u32 attrs, __u16 nr_ranges, struct nvme_dsm_range * dsm)
+.. c:function:: int nvme_fw_download (int fd, __u32 offset, __u32 data_len, void * data)
- Send an nvme data set management command
+ Download part or all of a firmware image to the controller
**Parameters**
``int fd``
File descriptor of nvme device
-``__u32 nsid``
- Namespace identifier
-
-``__u32 attrs``
- DSM attributes, see :c:type:`enum nvme_dsm_attributes <nvme_dsm_attributes>`
- :c:type:`nr_ranges`: Number of block ranges in the data set management attributes
+``__u32 offset``
+ Offset in the firmware data
-``__u16 nr_ranges``
- *undescribed*
+``__u32 data_len``
+ Length of data in this command in bytes
-``struct nvme_dsm_range * dsm``
- The data set management attributes
+``void * data``
+ Userspace address of the firmware data
**Description**
-The Dataset Management command is used by the host to indicate attributes
-for ranges of logical blocks. This includes attributes like frequency that
-data is read or written, access size, and other information that may be used
-to optimize performance and reliability, and may be used to
-deallocate/unmap/trim those logical blocks.
+The Firmware Image Download command is used to download all or a portion of
+an image for a future update to the controller. The Firmware Image Download
+command downloads a new image (in whole or in part) to the controller.
+
+The image may be constructed of multiple pieces that are individually
+downloaded with separate Firmware Image Download commands. Each Firmware
+Image Download command includes a Dword Offset and Number of Dwords that
+specify a dword range.
+
+The new firmware image is not activated as part of the Firmware Image
+Download command. Use the nvme_fw_commit() to activate a newly downloaded
+image.
**Return**
set otherwise.
+.. c:function:: int nvme_fw_commit (int fd, __u8 slot, enum nvme_fw_commit_ca action, bool bpid)
+ Commit firmware using the specified action
-.. c:type:: enum nvme_reservation_rtype
+**Parameters**
+``int fd``
+ File descriptor of nvme device
-**Constants**
+``__u8 slot``
+ Firmware slot to commit the downloaded image
-``NVME_RESERVATION_RTYPE_WE``
- *undescribed*
+``enum nvme_fw_commit_ca action``
+ Action to use for the firmware image, see :c:type:`enum nvme_fw_commit_ca <nvme_fw_commit_ca>`
-``NVME_RESERVATION_RTYPE_EA``
- *undescribed*
+``bool bpid``
+ Set to true to select the boot partition id
-``NVME_RESERVATION_RTYPE_WERO``
- *undescribed*
+**Description**
-``NVME_RESERVATION_RTYPE_EARO``
- *undescribed*
+The Firmware Commit command is used to modify the firmware image or Boot
+Partitions.
-``NVME_RESERVATION_RTYPE_WEAR``
- *undescribed*
+**Return**
-``NVME_RESERVATION_RTYPE_EAAR``
- *undescribed*
+The nvme command status if a response was received or -1 with errno
+ set otherwise. The command status response may specify additional
+ reset actions required to complete the commit process.
+.. c:function:: int nvme_security_send (int fd, __u32 nsid, __u8 nssf, __u8 spsp0, __u8 spsp1, __u8 secp, __u32 tl, __u32 data_len, void * data, __u32 * result)
-.. c:type:: enum nvme_reservation_racqa
+**Parameters**
+``int fd``
+ File descriptor of nvme device
-**Constants**
+``__u32 nsid``
+ Namespace ID to issue security command on
-``NVME_RESERVATION_RACQA_ACQUIRE``
- *undescribed*
+``__u8 nssf``
+ NVMe Security Specific field
-``NVME_RESERVATION_RACQA_PREEMPT``
- *undescribed*
+``__u8 spsp0``
+ Security Protocol Specific field
-``NVME_RESERVATION_RACQA_PREEMPT_AND_ABORT``
- *undescribed*
+``__u8 spsp1``
+ Security Protocol Specific field
+``__u8 secp``
+ Security Protocol
-.. c:function:: int nvme_resv_acquire (int fd, __u32 nsid, enum nvme_reservation_rtype rtype, enum nvme_reservation_racqa racqa, bool iekey, __u64 crkey, __u64 nrkey)
+``__u32 tl``
+ Protocol specific transfer length
+
+``__u32 data_len``
+ Data length of the payload in bytes
+
+``void * data``
+ Security data payload to send
+
+``__u32 * result``
+ The command completion result from CQE dword0
+
+**Description**
+
+The Security Send command is used to transfer security protocol data to the
+controller. The data structure transferred to the controller as part of this
+command contains security protocol specific commands to be performed by the
+controller. The data structure transferred may also contain data or
+parameters associated with the security protocol commands.
+
+The security data is protocol specific and is not defined by the NVMe
+specification.
+
+**Return**
+
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
+
+
+.. c:function:: int nvme_security_receive (int fd, __u32 nsid, __u8 nssf, __u8 spsp0, __u8 spsp1, __u8 secp, __u32 al, __u32 data_len, void * data, __u32 * result)
- Send an nvme reservation acquire
**Parameters**
File descriptor of nvme device
``__u32 nsid``
- Namespace identifier
+ Namespace ID to issue security command on
-``enum nvme_reservation_rtype rtype``
- The type of reservation to be create, see :c:type:`enum nvme_reservation_rtype <nvme_reservation_rtype>`
+``__u8 nssf``
+ NVMe Security Specific field
-``enum nvme_reservation_racqa racqa``
- The action that is performed by the command, see :c:type:`enum nvme_reservation_racqa <nvme_reservation_racqa>`
+``__u8 spsp0``
+ Security Protocol Specific field
-``bool iekey``
- Set to ignore the existing key
+``__u8 spsp1``
+ Security Protocol Specific field
-``__u64 crkey``
- The current reservation key associated with the host
+``__u8 secp``
+ Security Protocol
-``__u64 nrkey``
- The reservation key to be unregistered from the namespace if
- the action is preempt
+``__u32 al``
+ Protocol specific allocation length
-**Description**
+``__u32 data_len``
+ Data length of the payload in bytes
-The Reservation Acquire command is used to acquire a reservation on a
-namespace, preempt a reservation held on a namespace, and abort a
-reservation held on a namespace.
+``void * data``
+ Security data payload to send
+
+``__u32 * result``
+ The command completion result from CQE dword0
**Return**
set otherwise.
+.. c:function:: int nvme_get_lba_status (int fd, __u32 nsid, __u64 slba, __u32 mndw, __u16 rl, enum nvme_lba_status_atype atype, struct nvme_lba_status * lbas)
+ Retrieve information on possibly unrecoverable LBAs
-.. c:type:: enum nvme_reservation_rrega
-
-
-**Constants**
-
-``NVME_RESERVATION_RREGA_REGISTER_KEY``
- *undescribed*
+**Parameters**
-``NVME_RESERVATION_RREGA_UNREGISTER_KEY``
- *undescribed*
+``int fd``
+ File descriptor of nvme device
-``NVME_RESERVATION_RREGA_REPLACE_KEY``
- *undescribed*
+``__u32 nsid``
+ Namespace ID to retrieve LBA status
+``__u64 slba``
+ Starting logical block address to check statuses
+``__u32 mndw``
+ Maximum number of dwords to return
+``__u16 rl``
+ Range length from slba to perform the action
-.. c:type:: enum nvme_reservation_cptpl
+``enum nvme_lba_status_atype atype``
+ Action type mechanism to determine LBA status desctriptors to
+ return, see :c:type:`enum nvme_lba_status_atype <nvme_lba_status_atype>`
+``struct nvme_lba_status * lbas``
+ Data payload to return status descriptors
-**Constants**
+**Description**
-``NVME_RESERVATION_CPTPL_NO_CHANGE``
- *undescribed*
+The Get LBA Status command requests information about Potentially
+Unrecoverable LBAs. Refer to the specification for action type descriptions.
-``NVME_RESERVATION_CPTPL_CLEAR``
- *undescribed*
+**Return**
-``NVME_RESERVATION_CPTPL_PERSIST``
- *undescribed*
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-.. c:function:: int nvme_resv_register (int fd, __u32 nsid, enum nvme_reservation_rrega rrega, enum nvme_reservation_cptpl cptpl, bool iekey, __u64 crkey, __u64 nrkey)
+.. c:function:: int nvme_directive_send (int fd, __u32 nsid, __u16 dspec, enum nvme_directive_send_doper doper, enum nvme_directive_dtype dtype, __u32 cdw12, __u32 data_len, void * data, __u32 * result)
- Send an nvme reservation register
+ Send directive command
**Parameters**
File descriptor of nvme device
``__u32 nsid``
- Namespace identifier
+ Namespace ID, if applicable
-``enum nvme_reservation_rrega rrega``
- The registration action, see :c:type:`enum nvme_reservation_rrega <nvme_reservation_rrega>`
+``__u16 dspec``
+ Directive specific field
-``enum nvme_reservation_cptpl cptpl``
- Change persist through power loss, see :c:type:`enum nvme_reservation_cptpl <nvme_reservation_cptpl>`
+``enum nvme_directive_send_doper doper``
+ Directive send operation, see :c:type:`enum nvme_directive_send_doper <nvme_directive_send_doper>`
-``bool iekey``
- Set to ignore the existing key
+``enum nvme_directive_dtype dtype``
+ Directive type, see :c:type:`enum nvme_directive_dtype <nvme_directive_dtype>`
-``__u64 crkey``
- The current reservation key associated with the host
+``__u32 cdw12``
+ *undescribed*
-``__u64 nrkey``
- The new reservation key to be register if action is register or
- replace
+``__u32 data_len``
+ Length of data payload in bytes
+
+``void * data``
+ Usespace address of data payload
+
+``__u32 * result``
+ If successful, the CQE dword0 value
**Description**
-The Reservation Register command is used to register, unregister, or replace
-a reservation key.
+Directives is a mechanism to enable host and NVM subsystem or controller
+information exchange. The Directive Send command is used to transfer data
+related to a specific Directive Type from the host to the controller.
+
+See the NVMe specification for more information.
**Return**
set otherwise.
+.. c:function:: int nvme_directive_send_id_endir (int fd, __u32 nsid, bool endir, enum nvme_directive_dtype dtype, struct nvme_id_directives * id)
-.. c:type:: enum nvme_reservation_rrela
+**Parameters**
+``int fd``
+ File descriptor of nvme device
-**Constants**
+``__u32 nsid``
+ Namespace ID
-``NVME_RESERVATION_RRELA_RELEASE``
+``bool endir``
*undescribed*
-``NVME_RESERVATION_RRELA_CLEAR``
+``enum nvme_directive_dtype dtype``
*undescribed*
+``struct nvme_id_directives * id``
+ *undescribed*
-.. c:function:: int nvme_resv_release (int fd, __u32 nsid, enum nvme_reservation_rtype rtype, enum nvme_reservation_rrela rrela, bool iekey, __u64 crkey)
+**Return**
+
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
+
+
+.. c:function:: int nvme_directive_send_stream_release_identifier (int fd, __u32 nsid, __u16 stream_id)
- Send an nvme reservation release
**Parameters**
File descriptor of nvme device
``__u32 nsid``
- Namespace identifier
-
-``enum nvme_reservation_rtype rtype``
- The type of reservation to be create, see :c:type:`enum nvme_reservation_rtype <nvme_reservation_rtype>`
-
-``enum nvme_reservation_rrela rrela``
- Reservation releast action, see :c:type:`enum nvme_reservation_rrela <nvme_reservation_rrela>`
-
-``bool iekey``
- Set to ignore the existing key
+ Namespace ID
-``__u64 crkey``
- The current reservation key to release
+``__u16 stream_id``
+ *undescribed*
**Return**
set otherwise.
-.. c:function:: int nvme_resv_report (int fd, __u32 nsid, bool eds, __u32 len, struct nvme_reservation_status * report)
+.. c:function:: int nvme_directive_send_stream_release_resource (int fd, __u32 nsid)
- Send an nvme reservation report
**Parameters**
File descriptor of nvme device
``__u32 nsid``
- Namespace identifier
-
-``bool eds``
- Request extended Data Structure
-
-``__u32 len``
- Number of bytes to request transfered with this command
-
-``struct nvme_reservation_status * report``
- The user space destination address to store the reservation report
-
-**Description**
-
-Returns a Reservation Status data structure to memory that describes the
-registration and reservation status of a namespace. See the defintion for
-the returned structure, :c:type:`struct nvme_reservation_status <nvme_reservation_status>`, for more details.
+ Namespace ID
**Return**
set otherwise.
+.. c:function:: int nvme_directive_recv (int fd, __u32 nsid, __u16 dspec, enum nvme_directive_receive_doper doper, enum nvme_directive_dtype dtype, __u32 cdw12, __u32 data_len, void * data, __u32 * result)
+ Receive directive specific data
-.. c:type:: struct nvme_fabrics_config
+**Parameters**
+``int fd``
+ File descriptor of nvme device
-**Definition**
+``__u32 nsid``
+ Namespace ID, if applicable
-::
+``__u16 dspec``
+ Directive specific field
- struct nvme_fabrics_config {
- const char *transport;
- const char *traddr;
- const char *trsvcid;
- const char *nqn;
- const char *hostnqn;
- const char *host_traddr;
- const char *hostid;
- int queue_size;
- int nr_io_queues;
- int reconnect_delay;
- int ctrl_loss_tmo;
- int keep_alive_tmo;
- int nr_write_queues;
- int nr_poll_queues;
- int tos;
- bool duplicate_connect;
- bool disable_sqflow;
- bool hdr_digest;
- bool data_digest;
- uint8_t rsvd[0x200];
- };
+``enum nvme_directive_receive_doper doper``
+ Directive receive operation, see :c:type:`enum nvme_directive_receive_doper <nvme_directive_receive_doper>`
-**Members**
+``enum nvme_directive_dtype dtype``
+ Directive type, see :c:type:`enum nvme_directive_dtype <nvme_directive_dtype>`
+``__u32 cdw12``
+ *undescribed*
+``__u32 data_len``
+ Length of data payload
-.. c:function:: int nvmf_add_ctrl_opts (struct nvme_fabrics_config * cfg)
+``void * data``
+ Usespace address of data payload in bytes
+``__u32 * result``
+ If successful, the CQE dword0 value
-**Parameters**
+**Return**
-``struct nvme_fabrics_config * cfg``
- *undescribed*
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-.. c:function:: nvme_ctrl_t nvmf_add_ctrl (struct nvme_fabrics_config * cfg)
+.. c:function:: int nvme_directive_recv_identify_parameters (int fd, __u32 nsid, struct nvme_id_directives * id)
**Parameters**
-``struct nvme_fabrics_config * cfg``
- *undescribed*
-
-
-.. c:function:: int nvmf_get_discovery_log (nvme_ctrl_t c, struct nvmf_discovery_log ** logp, int max_retries)
-
+``int fd``
+ File descriptor of nvme device
-**Parameters**
+``__u32 nsid``
+ Namespace ID
-``nvme_ctrl_t c``
+``struct nvme_id_directives * id``
*undescribed*
-``struct nvmf_discovery_log ** logp``
- *undescribed*
+**Return**
-``int max_retries``
- *undescribed*
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-.. c:function:: char * nvmf_hostnqn_generate ()
+.. c:function:: int nvme_directive_recv_stream_parameters (int fd, __u32 nsid, struct nvme_streams_directive_params * parms)
**Parameters**
+``int fd``
+ File descriptor of nvme device
-.. c:function:: char * nvmf_hostnqn_from_file ()
-
+``__u32 nsid``
+ Namespace ID
-**Parameters**
+``struct nvme_streams_directive_params * parms``
+ *undescribed*
+**Return**
-.. c:function:: char * nvmf_hostid_from_file ()
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-**Parameters**
+.. c:function:: int nvme_directive_recv_stream_status (int fd, __u32 nsid, unsigned nr_entries, struct nvme_streams_directive_status * id)
-.. c:function:: const char * nvmf_trtype_str (__u8 trtype)
+**Parameters**
+``int fd``
+ File descriptor of nvme device
-**Parameters**
+``__u32 nsid``
+ Namespace ID
-``__u8 trtype``
+``unsigned nr_entries``
*undescribed*
+``struct nvme_streams_directive_status * id``
+ *undescribed*
-.. c:function:: const char * nvmf_adrfam_str (__u8 adrfam)
+**Return**
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-**Parameters**
-``__u8 adrfam``
- *undescribed*
+.. c:function:: int nvme_directive_recv_stream_allocate (int fd, __u32 nsid, __u16 nsr, __u32 * result)
-.. c:function:: const char * nvmf_subtype_str (__u8 subtype)
+**Parameters**
+``int fd``
+ File descriptor of nvme device
-**Parameters**
+``__u32 nsid``
+ Namespace ID
-``__u8 subtype``
+``__u16 nsr``
*undescribed*
+``__u32 * result``
+ *undescribed*
-.. c:function:: const char * nvmf_treq_str (__u8 treq)
+**Return**
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-**Parameters**
-``__u8 treq``
- *undescribed*
-.. c:function:: const char * nvmf_sectype_str (__u8 sectype)
+.. c:type:: enum nvme_fctype
-**Parameters**
+**Constants**
-``__u8 sectype``
+``nvme_fabrics_type_property_set``
*undescribed*
+``nvme_fabrics_type_connect``
+ *undescribed*
-.. c:function:: const char * nvmf_prtype_str (__u8 prtype)
+``nvme_fabrics_type_property_get``
+ *undescribed*
+``nvme_fabrics_type_auth_send``
+ *undescribed*
-**Parameters**
+``nvme_fabrics_type_auth_receive``
+ *undescribed*
-``__u8 prtype``
+``nvme_fabrics_type_disconnect``
*undescribed*
-.. c:function:: const char * nvmf_qptype_str (__u8 qptype)
+.. c:function:: int nvme_set_property (int fd, int offset, __u64 value)
+ Set controller property
**Parameters**
-``__u8 qptype``
- *undescribed*
+``int fd``
+ File descriptor of nvme device
+``int offset``
+ Property offset from the base to set
-.. c:function:: const char * nvmf_cms_str (__u8 cm)
+``__u64 value``
+ The value to set the property
+**Description**
-**Parameters**
+This is an NVMe-over-Fabrics specific command, not applicable to PCIe. These
+properties align to the PCI MMIO controller registers.
-``__u8 cm``
- *undescribed*
+**Return**
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-.. c:function:: nvme_ctrl_t nvmf_connect_disc_entry (struct nvmf_disc_log_entry * e, const struct nvme_fabrics_config * defcfg, bool * discover)
+.. c:function:: int nvme_get_property (int fd, int offset, __u64 * value)
-**Parameters**
+ Get a controller property
-``struct nvmf_disc_log_entry * e``
- *undescribed*
+**Parameters**
-``const struct nvme_fabrics_config * defcfg``
- *undescribed*
+``int fd``
+ File descriptor of nvme device
-``bool * discover``
- *undescribed*
+``int offset``
+ Property offset from the base to retrieve
+``__u64 * value``
+ Where the property's value will be stored on success
-.. c:function:: int nvme_namespace_filter (const struct dirent * d)
+**Description**
+This is an NVMe-over-Fabrics specific command, not applicable to PCIe. These
+properties align to the PCI MMIO controller registers.
-**Parameters**
+**Return**
-``const struct dirent * d``
- *undescribed*
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-.. c:function:: int nvme_paths_filter (const struct dirent * d)
+.. c:function:: int nvme_sanitize_nvm (int fd, enum nvme_sanitize_sanact sanact, bool ause, __u8 owpass, bool oipbp, bool nodas, __u32 ovrpat)
+ Start a sanitize operation
**Parameters**
-``const struct dirent * d``
- *undescribed*
+``int fd``
+ File descriptor of nvme device
+``enum nvme_sanitize_sanact sanact``
+ Sanitize action, see :c:type:`enum nvme_sanitize_sanact <nvme_sanitize_sanact>`
-.. c:function:: int nvme_ctrls_filter (const struct dirent * d)
+``bool ause``
+ Set to allow unrestriced sanitize exit
+
+``__u8 owpass``
+ Overwrite pass count
+``bool oipbp``
+ Set to overwrite invert pattern between passes
-**Parameters**
+``bool nodas``
+ Set to not deallocate blocks after sanitizing
-``const struct dirent * d``
- *undescribed*
+``__u32 ovrpat``
+ Overwrite pattern
+**Description**
-.. c:function:: int nvme_subsys_filter (const struct dirent * d)
+A sanitize operation alters all user data in the NVM subsystem such that
+recovery of any previous user data from any cache, the non-volatile media,
+or any Controller Memory Buffer is not possible.
+The Sanitize command is used to start a sanitize operation or to recover
+from a previously failed sanitize operation. The sanitize operation types
+that may be supported are Block Erase, Crypto Erase, and Overwrite. All
+sanitize operations are processed in the background, i.e., completion of the
+sanitize command does not indicate completion of the sanitize operation.
-**Parameters**
+**Return**
-``const struct dirent * d``
- *undescribed*
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-.. c:function:: int nvme_scan_subsystems (struct dirent *** subsys)
+.. c:function:: int nvme_dev_self_test (int fd, __u32 nsid, enum nvme_dst_stc stc)
+ Start or abort a self test
**Parameters**
-``struct dirent *** subsys``
- *undescribed*
+``int fd``
+ File descriptor of nvme device
+``__u32 nsid``
+ Namespace ID to test
-.. c:function:: int nvme_scan_subsystem_ctrls (nvme_subsystem_t s, struct dirent *** ctrls)
+``enum nvme_dst_stc stc``
+ Self test code, see :c:type:`enum nvme_dst_stc <nvme_dst_stc>`
+**Description**
-**Parameters**
+The Device Self-test command is used to start a device self-test operation
+or abort a device self-test operation. A device self-test operation is a
+diagnostic testing sequence that tests the integrity and functionality of
+the controller and may include testing of the media associated with
+namespaces. The controller may return a response to this command immediately
+while running the self-test in the background.
-``nvme_subsystem_t s``
- *undescribed*
+Set the 'nsid' field to 0 to not include namepsaces in the test. Set to
+0xffffffff to test all namespaces. All other values tests a specific
+namespace, if present.
-``struct dirent *** ctrls``
- *undescribed*
+**Return**
+
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-.. c:function:: int nvme_scan_subsystem_namespaces (nvme_subsystem_t s, struct dirent *** namespaces)
+.. c:function:: int nvme_virtual_mgmt (int fd, enum nvme_virt_mgmt_act act, enum nvme_virt_mgmt_rt rt, __u16 cntlid, __u16 nr, __u32 * result)
+ Virtualization resource management
**Parameters**
-``nvme_subsystem_t s``
- *undescribed*
-
-``struct dirent *** namespaces``
- *undescribed*
+``int fd``
+ File descriptor of nvme device
+``enum nvme_virt_mgmt_act act``
+ Virtual resource action, see :c:type:`enum nvme_virt_mgmt_act <nvme_virt_mgmt_act>`
-.. c:function:: int nvme_scan_ctrl_namespace_paths (nvme_ctrl_t c, struct dirent *** namespaces)
+``enum nvme_virt_mgmt_rt rt``
+ Resource type to modify, see :c:type:`enum nvme_virt_mgmt_rt <nvme_virt_mgmt_rt>`
+``__u16 cntlid``
+ Controller id for which resources are bing modified
-**Parameters**
+``__u16 nr``
+ Number of resources being allocated or assigned
-``nvme_ctrl_t c``
- *undescribed*
+``__u32 * result``
+ If successful, the CQE dword0
-``struct dirent *** namespaces``
- *undescribed*
+**Description**
+The Virtualization Management command is supported by primary controllers
+that support the Virtualization Enhancements capability. This command is
+used for several functions:
-.. c:function:: int nvme_scan_ctrl_namespaces (nvme_ctrl_t c, struct dirent *** namespaces)
+ - Modifying Flexible Resource allocation for the primary controller
+ - Assigning Flexible Resources for secondary controllers
+ - Setting the Online and Offline state for secondary controllers
+**Return**
-**Parameters**
+The nvme command status if a response was received or -1
+ with errno set otherwise.
-``nvme_ctrl_t c``
- *undescribed*
-``struct dirent *** namespaces``
- *undescribed*
+**NVMe IO command**
-.. c:type:: struct nvme_passthru_cmd
+.. c:type:: enum nvme_io_opcode
-**Definition**
+**Constants**
-::
+``nvme_cmd_flush``
+ *undescribed*
- struct nvme_passthru_cmd {
- __u8 opcode;
- __u8 flags;
- __u16 rsvd1;
- __u32 nsid;
- __u32 cdw2;
- __u32 cdw3;
- __u64 metadata;
- __u64 addr;
- __u32 metadata_len;
- __u32 data_len;
- __u32 cdw10;
- __u32 cdw11;
- __u32 cdw12;
- __u32 cdw13;
- __u32 cdw14;
- __u32 cdw15;
- __u32 timeout_ms;
- __u32 result;
- };
+``nvme_cmd_write``
+ *undescribed*
-**Members**
+``nvme_cmd_read``
+ *undescribed*
-``opcode``
- Operation code, see :c:type:`enum nvme_io_opcodes <nvme_io_opcodes>` and :c:type:`enum nvme_admin_opcodes <nvme_admin_opcodes>`
+``nvme_cmd_write_uncor``
+ *undescribed*
-``flags``
- Not supported: intended for command flags (eg: SGL, FUSE)
+``nvme_cmd_compare``
+ *undescribed*
-``rsvd1``
- Reserved for future use
+``nvme_cmd_write_zeroes``
+ *undescribed*
-``nsid``
- Namespace Identifier, or Fabrics type
+``nvme_cmd_dsm``
+ *undescribed*
-``cdw2``
- Command Dword 2 (no spec defined use)
+``nvme_cmd_verify``
+ *undescribed*
-``cdw3``
- Command Dword 3 (no spec defined use)
+``nvme_cmd_resv_register``
+ *undescribed*
-``metadata``
- User space address to metadata buffer (NULL if not used)
+``nvme_cmd_resv_report``
+ *undescribed*
-``addr``
- User space address to data buffer (NULL if not used)
+``nvme_cmd_resv_acquire``
+ *undescribed*
-``metadata_len``
- Metadata buffer transfer length
+``nvme_cmd_resv_release``
+ *undescribed*
-``data_len``
- Data buffer transfer length
-``cdw10``
- Command Dword 10 (command specific)
+.. c:function:: int nvme_flush (int fd, __u32 nsid)
-``cdw11``
- Command Dword 11 (command specific)
+ Send an nvme flush command
-``cdw12``
- Command Dword 12 (command specific)
+**Parameters**
-``cdw13``
- Command Dword 13 (command specific)
+``int fd``
+ File descriptor of nvme device
-``cdw14``
- Command Dword 14 (command specific)
+``__u32 nsid``
+ Namespace identifier
-``cdw15``
- Command Dword 15 (command specific)
+**Description**
-``timeout_ms``
- If non-zero, overrides system default timeout in milliseconds
+The Flush command is used to request that the contents of volatile write
+cache be made non-volatile.
-``result``
- Set on completion to the command's CQE DWORD 0 controller response
+**Return**
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-.. c:type:: struct nvme_passthru_cmd64
+.. c:type:: enum nvme_io_control_flags
-**Definition**
+**Constants**
-::
+``NVME_IO_DTYPE_STREAMS``
+ *undescribed*
- struct nvme_passthru_cmd64 {
- __u8 opcode;
- __u8 flags;
- __u16 rsvd1;
- __u32 nsid;
- __u32 cdw2;
- __u32 cdw3;
- __u64 metadata;
- __u64 addr;
- __u32 metadata_len;
- __u32 data_len;
- __u32 cdw10;
- __u32 cdw11;
- __u32 cdw12;
- __u32 cdw13;
- __u32 cdw14;
- __u32 cdw15;
- __u32 timeout_ms;
- __u32 rsvd2;
- __u64 result;
- };
+``NVME_IO_DEAC``
+ *undescribed*
-**Members**
+``NVME_IO_PRINFO_PRCHK_REF``
+ *undescribed*
-``opcode``
- Operation code, see :c:type:`enum nvme_io_opcodes <nvme_io_opcodes>` and :c:type:`enum nvme_admin_opcodes <nvme_admin_opcodes>`
+``NVME_IO_PRINFO_PRCHK_APP``
+ *undescribed*
-``flags``
- Not supported: intended for command flags (eg: SGL, FUSE)
+``NVME_IO_PRINFO_PRCHK_GUARD``
+ *undescribed*
-``rsvd1``
- Reserved for future use
+``NVME_IO_PRINFO_PRACT``
+ *undescribed*
-``nsid``
- Namespace Identifier, or Fabrics type
+``NVME_IO_FUA``
+ *undescribed*
-``cdw2``
- Command Dword 2 (no spec defined use)
+``NVME_IO_LR``
+ *undescribed*
-``cdw3``
- Command Dword 3 (no spec defined use)
-``metadata``
- User space address to metadata buffer (NULL if not used)
-``addr``
- User space address to data buffer (NULL if not used)
-``metadata_len``
- Metadata buffer transfer length
+.. c:type:: enum nvme_io_dsm_flags
-``data_len``
- Data buffer transfer length
-``cdw10``
- Command Dword 10 (command specific)
+**Constants**
-``cdw11``
- Command Dword 11 (command specific)
+``NVME_IO_DSM_FREQ_UNSPEC``
+ *undescribed*
-``cdw12``
- Command Dword 12 (command specific)
+``NVME_IO_DSM_FREQ_TYPICAL``
+ *undescribed*
-``cdw13``
- Command Dword 13 (command specific)
+``NVME_IO_DSM_FREQ_RARE``
+ *undescribed*
-``cdw14``
- Command Dword 14 (command specific)
+``NVME_IO_DSM_FREQ_READS``
+ *undescribed*
-``cdw15``
- Command Dword 15 (command specific)
+``NVME_IO_DSM_FREQ_WRITES``
+ *undescribed*
-``timeout_ms``
- If non-zero, overrides system default timeout in milliseconds
+``NVME_IO_DSM_FREQ_RW``
+ *undescribed*
-``rsvd2``
- Reserved for future use (and fills an impicit struct pad
+``NVME_IO_DSM_FREQ_ONCE``
+ *undescribed*
-``result``
- Set on completion to the command's CQE DWORD 0-1 controller response
+``NVME_IO_DSM_FREQ_PREFETCH``
+ *undescribed*
+``NVME_IO_DSM_FREQ_TEMP``
+ *undescribed*
+``NVME_IO_DSM_LATENCY_NONE``
+ *undescribed*
-.. c:function:: int nvme_submit_admin_passthru64 (int fd, struct nvme_passthru_cmd64 * cmd, __u64 * result)
+``NVME_IO_DSM_LATENCY_IDLE``
+ *undescribed*
- Submit a 64-bit nvme passthrough admin command
+``NVME_IO_DSM_LATENCY_NORM``
+ *undescribed*
+
+``NVME_IO_DSM_LATENCY_LOW``
+ *undescribed*
+
+``NVME_IO_DSM_SEQ_REQ``
+ *undescribed*
+
+``NVME_IO_DSM_COMPRESSED``
+ *undescribed*
+
+
+.. c:function:: int nvme_read (int fd, __u32 nsid, __u64 slba, __u16 nlb, __u16 control, __u8 dsm, __u32 reftag, __u16 apptag, __u16 appmask, __u32 data_len, void * data, __u32 metadata_len, void * metadata)
+
+ Submit an nvme user read command
**Parameters**
``int fd``
File descriptor of nvme device
-``struct nvme_passthru_cmd64 * cmd``
- The nvme admin command to send
+``__u32 nsid``
+ Namespace ID
-``__u64 * result``
- Optional field to return the result from the CQE DW0-1
+``__u64 slba``
+ Starting logical block
-**Description**
+``__u16 nlb``
+ *undescribed*
+
+``__u16 control``
+ Command control flags, see :c:type:`enum nvme_io_control_flags <nvme_io_control_flags>`.
+
+``__u8 dsm``
+ Data set management attributes, see :c:type:`enum nvme_io_dsm_flags <nvme_io_dsm_flags>`
+
+``__u32 reftag``
+ This field specifies the Initial Logical Block Reference Tag
+ expected value. Used only if the namespace is formatted to use
+ end-to-end protection information.
+
+``__u16 apptag``
+ This field specifies the Application Tag Mask expected value.
+ Used only if the namespace is formatted to use end-to-end
+ protection information.
+
+``__u16 appmask``
+ This field specifies the Application Tag expected value. Used
+ only if the namespace is formatted to use end-to-end protection
+ information.
+
+``__u32 data_len``
+ Length of user buffer, **data**, in bytes
+
+``void * data``
+ Pointer to user address of the data buffer
+ metadata_len:Length of user buffer, **metadata**, in bytes
+
+``__u32 metadata_len``
+ *undescribed*
+
+``void * metadata``
+ Pointer to user address of the metadata buffer
+
+**Return**
+
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
+
+
+.. c:function:: int nvme_write (int fd, __u32 nsid, __u64 slba, __u16 nlb, __u16 control, __u8 dsm, __u16 dspec, __u32 reftag, __u16 apptag, __u16 appmask, __u32 data_len, void * data, __u32 metadata_len, void * metadata)
+
+ Submit an nvme user write command
+
+**Parameters**
+
+``int fd``
+ File descriptor of nvme device
+
+``__u32 nsid``
+ Namespace ID
+
+``__u64 slba``
+ Starting logical block
+
+``__u16 nlb``
+ *undescribed*
+
+``__u16 control``
+ Command control flags, see :c:type:`enum nvme_io_control_flags <nvme_io_control_flags>`.
+
+``__u8 dsm``
+ Data set management attributes, see :c:type:`enum nvme_io_dsm_flags <nvme_io_dsm_flags>`
+
+``__u16 dspec``
+ Directive specific command, eg: stream identifier
+
+``__u32 reftag``
+ This field specifies the Initial Logical Block Reference Tag
+ expected value. Used only if the namespace is formatted to use
+ end-to-end protection information.
+
+``__u16 apptag``
+ This field specifies the Application Tag Mask expected value.
+ Used only if the namespace is formatted to use end-to-end
+ protection information.
+
+``__u16 appmask``
+ This field specifies the Application Tag expected value. Used
+ only if the namespace is formatted to use end-to-end protection
+ information.
+
+``__u32 data_len``
+ Length of user buffer, **data**, in bytes
+
+``void * data``
+ Pointer to user address of the data buffer
+ metadata_len:Length of user buffer, **metadata**, in bytes
+
+``__u32 metadata_len``
+ *undescribed*
+
+``void * metadata``
+ Pointer to user address of the metadata buffer
+
+**Return**
+
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
+
+
+.. c:function:: int nvme_compare (int fd, __u32 nsid, __u64 slba, __u16 nlb, __u16 control, __u32 reftag, __u16 apptag, __u16 appmask, __u32 data_len, void * data, __u32 metadata_len, void * metadata)
+
+ Submit an nvme user compare command
+
+**Parameters**
+
+``int fd``
+ File descriptor of nvme device
+
+``__u32 nsid``
+ Namespace ID
+
+``__u64 slba``
+ Starting logical block
+
+``__u16 nlb``
+ *undescribed*
+
+``__u16 control``
+ Command control flags, see :c:type:`enum nvme_io_control_flags <nvme_io_control_flags>`.
+
+``__u32 reftag``
+ This field specifies the Initial Logical Block Reference Tag
+ expected value. Used only if the namespace is formatted to use
+ end-to-end protection information.
+
+``__u16 apptag``
+ This field specifies the Application Tag Mask expected value.
+ Used only if the namespace is formatted to use end-to-end
+ protection information.
+
+``__u16 appmask``
+ This field specifies the Application Tag expected value. Used
+ only if the namespace is formatted to use end-to-end protection
+ information.
+
+``__u32 data_len``
+ Length of user buffer, **data**, in bytes
+
+``void * data``
+ Pointer to user address of the data buffer
+ metadata_len:Length of user buffer, **metadata**, in bytes
+
+``__u32 metadata_len``
+ *undescribed*
-Uses NVME_IOCTL_ADMIN64_CMD for the ioctl request.
+``void * metadata``
+ Pointer to user address of the metadata buffer
**Return**
-The nvme command status if a response was received or -1
- with errno set otherwise.
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-.. c:function:: int nvme_admin_passthru64 (int fd, __u8 opcode, __u8 flags, __u16 rsvd, __u32 nsid, __u32 cdw2, __u32 cdw3, __u32 cdw10, __u32 cdw11, __u32 cdw12, __u32 cdw13, __u32 cdw14, __u32 cdw15, __u32 data_len, void * data, __u32 metadata_len, void * metadata, __u32 timeout_ms, __u64 * result)
+.. c:function:: int nvme_write_zeros (int fd, __u32 nsid, __u64 slba, __u16 nlb, __u16 control, __u32 reftag, __u16 apptag, __u16 appmask)
- Submit an nvme passthrough command
+ Submit an nvme write zeroes command
**Parameters**
``int fd``
File descriptor of nvme device
-``__u8 opcode``
- The nvme io command to send
-
-``__u8 flags``
- NVMe command flags (not used)
-
-``__u16 rsvd``
- Reserevd for future use
-
``__u32 nsid``
Namespace identifier
-``__u32 cdw2``
- Command dword 2
-
-``__u32 cdw3``
- Command dword 3
-
-``__u32 cdw10``
- Command dword 10
-
-``__u32 cdw11``
- Command dword 11
-
-``__u32 cdw12``
- Command dword 12
-
-``__u32 cdw13``
- Command dword 13
-
-``__u32 cdw14``
- Command dword 14
-
-``__u32 cdw15``
- Command dword 15
-
-``__u32 data_len``
- Length of the data transfered in this command in bytes
+``__u64 slba``
+ Starting logical block
-``void * data``
- Pointer to user address of the data buffer
+``__u16 nlb``
+ Number of logical blocks to clear (0's based value)
-``__u32 metadata_len``
- Length of metadata transfered in this command
+``__u16 control``
+ Command control flags, see :c:type:`enum nvme_io_control_flags <nvme_io_control_flags>`.
-``void * metadata``
- Pointer to user address of the metadata buffer
+``__u32 reftag``
+ This field specifies the Initial Logical Block Reference Tag
+ expected value. Used only if the namespace is formatted to use
+ end-to-end protection information.
-``__u32 timeout_ms``
- How long the kernel waits for the command to complete
+``__u16 apptag``
+ This field specifies the Application Tag Mask expected value.
+ Used only if the namespace is formatted to use end-to-end
+ protection information.
-``__u64 * result``
- Optional field to return the result from the CQE dword 0
+``__u16 appmask``
+ This field specifies the Application Tag expected value. Used
+ only if the namespace is formatted to use end-to-end protection
+ information.
**Description**
-Parameterized form of nvme_submit_admin_passthru64(). This sets up and
-submits a :c:type:`struct nvme_passthru_cmd64 <nvme_passthru_cmd64>`.
-
-Known values for **opcode** are defined in :c:type:`enum nvme_admin_opcode <nvme_admin_opcode>`.
+The Write Zeroes command is used to set a range of logical blocks to zero.
+After successful completion of this command, the value returned by
+subsequent reads of logical blocks in this range shall be all bytes cleared
+to 0h until a write occurs to this LBA range.
**Return**
-The nvme command status if a response was received or -1
- with errno set otherwise.
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-.. c:function:: int nvme_submit_admin_passthru (int fd, struct nvme_passthru_cmd * cmd, __u32 * result)
+.. c:function:: int nvme_write_uncorrectable (int fd, __u32 nsid, __u64 slba, __u16 nlb)
- Submit an nvme passthrough admin command
+ Submit an nvme write uncorrectable command
**Parameters**
``int fd``
File descriptor of nvme device
-``struct nvme_passthru_cmd * cmd``
- The nvme admin command to send
+``__u32 nsid``
+ Namespace identifier
-``__u32 * result``
- Optional field to return the result from the CQE DW0
+``__u64 slba``
+ Starting logical block
+
+``__u16 nlb``
+ Number of logical blocks to invalidate (0's based value)
**Description**
-Uses NVME_IOCTL_ADMIN_CMD for the ioctl request.
+The Write Uncorrectable command is used to mark a range of logical blocks as
+invalid. When the specified logical block(s) are read after this operation,
+a failure is returned with Unrecovered Read Error status. To clear the
+invalid logical block status, a write operation on those logical blocks is
+required.
**Return**
-The nvme command status if a response was received or -1
- with errno set otherwise.
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-.. c:function:: int nvme_admin_passthru (int fd, __u8 opcode, __u8 flags, __u16 rsvd, __u32 nsid, __u32 cdw2, __u32 cdw3, __u32 cdw10, __u32 cdw11, __u32 cdw12, __u32 cdw13, __u32 cdw14, __u32 cdw15, __u32 data_len, void * data, __u32 metadata_len, void * metadata, __u32 timeout_ms, __u32 * result)
+.. c:function:: int nvme_verify (int fd, __u32 nsid, __u64 slba, __u16 nlb, __u16 control, __u32 reftag, __u16 apptag, __u16 appmask)
- Submit an nvme passthrough command
+ Send an nvme verify command
**Parameters**
``int fd``
File descriptor of nvme device
-``__u8 opcode``
- The nvme io command to send
-
-``__u8 flags``
- NVMe command flags (not used)
-
-``__u16 rsvd``
- Reserevd for future use
-
``__u32 nsid``
Namespace identifier
-``__u32 cdw2``
- Command dword 2
+``__u64 slba``
+ Starting logical block
-``__u32 cdw3``
- Command dword 3
+``__u16 nlb``
+ Number of logical blocks to verify (0's based value)
-``__u32 cdw10``
- Command dword 10
+``__u16 control``
+ Command control flags, see :c:type:`enum nvme_io_control_flags <nvme_io_control_flags>`.
-``__u32 cdw11``
- Command dword 11
+``__u32 reftag``
+ This field specifies the Initial Logical Block Reference Tag
+ expected value. Used only if the namespace is formatted to use
+ end-to-end protection information.
-``__u32 cdw12``
- Command dword 12
+``__u16 apptag``
+ This field specifies the Application Tag Mask expected value.
+ Used only if the namespace is formatted to use end-to-end
+ protection information.
-``__u32 cdw13``
- Command dword 13
+``__u16 appmask``
+ This field specifies the Application Tag expected value. Used
+ only if the namespace is formatted to use end-to-end protection
+ information.
-``__u32 cdw14``
- Command dword 14
+**Description**
-``__u32 cdw15``
- Command dword 15
+The Verify command verifies integrity of stored information by reading data
+and metadata, if applicable, for the LBAs indicated without transferring any
+data or metadata to the host.
-``__u32 data_len``
- Length of the data transfered in this command in bytes
+**Return**
-``void * data``
- Pointer to user address of the data buffer
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-``__u32 metadata_len``
- Length of metadata transfered in this command
-``void * metadata``
- Pointer to user address of the metadata buffer
-``__u32 timeout_ms``
- How long the kernel waits for the command to complete
-``__u32 * result``
- Optional field to return the result from the CQE dword 0
+.. c:type:: enum nvme_dsm_attributes
-**Description**
-Parameterized form of nvme_submit_admin_passthru(). This sets up and
-submits a :c:type:`struct nvme_passthru_cmd <nvme_passthru_cmd>`.
+**Constants**
-Known values for **opcode** are defined in :c:type:`enum nvme_admin_opcode <nvme_admin_opcode>`.
+``NVME_DSMGMT_IDR``
+ *undescribed*
-**Return**
+``NVME_DSMGMT_IDW``
+ *undescribed*
-The nvme command status if a response was received or -1
- with errno set otherwise.
+``NVME_DSMGMT_AD``
+ *undescribed*
-.. c:function:: int nvme_submit_io_passthru64 (int fd, struct nvme_passthru_cmd64 * cmd, __u64 * result)
+.. c:function:: int nvme_dsm (int fd, __u32 nsid, __u32 attrs, __u16 nr_ranges, struct nvme_dsm_range * dsm)
- Submit a 64-bit nvme passthrough command
+ Send an nvme data set management command
**Parameters**
``int fd``
File descriptor of nvme device
-``struct nvme_passthru_cmd64 * cmd``
- The nvme io command to send
-
-``__u64 * result``
- Optional field to return the result from the CQE DW0-1
-
-**Description**
-
-Uses NVME_IOCTL_IO64_CMD for the ioctl request.
-
-**Return**
-
-The nvme command status if a response was received or -1
- with errno set otherwise.
+``__u32 nsid``
+ Namespace identifier
+``__u32 attrs``
+ DSM attributes, see :c:type:`enum nvme_dsm_attributes <nvme_dsm_attributes>`
+ :c:type:`nr_ranges`: Number of block ranges in the data set management attributes
-.. c:function:: int nvme_io_passthru64 (int fd, __u8 opcode, __u8 flags, __u16 rsvd, __u32 nsid, __u32 cdw2, __u32 cdw3, __u32 cdw10, __u32 cdw11, __u32 cdw12, __u32 cdw13, __u32 cdw14, __u32 cdw15, __u32 data_len, void * data, __u32 metadata_len, void * metadata, __u32 timeout_ms, __u64 * result)
+``__u16 nr_ranges``
+ *undescribed*
- Submit an nvme io passthrough command
+``struct nvme_dsm_range * dsm``
+ The data set management attributes
-**Parameters**
+**Description**
-``int fd``
- File descriptor of nvme device
+The Dataset Management command is used by the host to indicate attributes
+for ranges of logical blocks. This includes attributes like frequency that
+data is read or written, access size, and other information that may be used
+to optimize performance and reliability, and may be used to
+deallocate/unmap/trim those logical blocks.
-``__u8 opcode``
- The nvme io command to send
+**Return**
-``__u8 flags``
- NVMe command flags (not used)
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-``__u16 rsvd``
- Reserevd for future use
-``__u32 nsid``
- Namespace identifier
-``__u32 cdw2``
- Command dword 2
-``__u32 cdw3``
- Command dword 3
+.. c:type:: enum nvme_reservation_rtype
-``__u32 cdw10``
- Command dword 10
-``__u32 cdw11``
- Command dword 11
+**Constants**
-``__u32 cdw12``
- Command dword 12
+``NVME_RESERVATION_RTYPE_WE``
+ *undescribed*
-``__u32 cdw13``
- Command dword 13
+``NVME_RESERVATION_RTYPE_EA``
+ *undescribed*
-``__u32 cdw14``
- Command dword 14
+``NVME_RESERVATION_RTYPE_WERO``
+ *undescribed*
-``__u32 cdw15``
- Command dword 15
+``NVME_RESERVATION_RTYPE_EARO``
+ *undescribed*
-``__u32 data_len``
- Length of the data transfered in this command in bytes
+``NVME_RESERVATION_RTYPE_WEAR``
+ *undescribed*
-``void * data``
- Pointer to user address of the data buffer
+``NVME_RESERVATION_RTYPE_EAAR``
+ *undescribed*
-``__u32 metadata_len``
- Length of metadata transfered in this command
-``void * metadata``
- Pointer to user address of the metadata buffer
-``__u32 timeout_ms``
- How long the kernel waits for the command to complete
-``__u64 * result``
- Optional field to return the result from the CQE dword 0
+.. c:type:: enum nvme_reservation_racqa
-**Description**
-Parameterized form of nvme_submit_io_passthru64(). This sets up and submits
-a :c:type:`struct nvme_passthru_cmd64 <nvme_passthru_cmd64>`.
+**Constants**
-Known values for **opcode** are defined in :c:type:`enum nvme_io_opcode <nvme_io_opcode>`.
+``NVME_RESERVATION_RACQA_ACQUIRE``
+ *undescribed*
-**Return**
+``NVME_RESERVATION_RACQA_PREEMPT``
+ *undescribed*
-The nvme command status if a response was received or -1 with errno
- set otherwise.
+``NVME_RESERVATION_RACQA_PREEMPT_AND_ABORT``
+ *undescribed*
-.. c:function:: int nvme_submit_io_passthru (int fd, struct nvme_passthru_cmd * cmd, __u32 * result)
+.. c:function:: int nvme_resv_acquire (int fd, __u32 nsid, enum nvme_reservation_rtype rtype, enum nvme_reservation_racqa racqa, bool iekey, __u64 crkey, __u64 nrkey)
- Submit an nvme passthrough command
+ Send an nvme reservation acquire
**Parameters**
``int fd``
File descriptor of nvme device
-``struct nvme_passthru_cmd * cmd``
- The nvme io command to send
+``__u32 nsid``
+ Namespace identifier
-``__u32 * result``
- Optional field to return the result from the CQE DW0
+``enum nvme_reservation_rtype rtype``
+ The type of reservation to be create, see :c:type:`enum nvme_reservation_rtype <nvme_reservation_rtype>`
-**Description**
+``enum nvme_reservation_racqa racqa``
+ The action that is performed by the command, see :c:type:`enum nvme_reservation_racqa <nvme_reservation_racqa>`
-Uses NVME_IOCTL_IO_CMD for the ioctl request.
+``bool iekey``
+ Set to ignore the existing key
-**Return**
+``__u64 crkey``
+ The current reservation key associated with the host
-The nvme command status if a response was received or -1
- with errno set otherwise.
+``__u64 nrkey``
+ The reservation key to be unregistered from the namespace if
+ the action is preempt
+**Description**
-.. c:function:: int nvme_io_passthru (int fd, __u8 opcode, __u8 flags, __u16 rsvd, __u32 nsid, __u32 cdw2, __u32 cdw3, __u32 cdw10, __u32 cdw11, __u32 cdw12, __u32 cdw13, __u32 cdw14, __u32 cdw15, __u32 data_len, void * data, __u32 metadata_len, void * metadata, __u32 timeout_ms, __u32 * result)
+The Reservation Acquire command is used to acquire a reservation on a
+namespace, preempt a reservation held on a namespace, and abort a
+reservation held on a namespace.
- Submit an nvme io passthrough command
+**Return**
-**Parameters**
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-``int fd``
- File descriptor of nvme device
-``__u8 opcode``
- The nvme io command to send
-``__u8 flags``
- NVMe command flags (not used)
-``__u16 rsvd``
- Reserevd for future use
+.. c:type:: enum nvme_reservation_rrega
-``__u32 nsid``
- Namespace identifier
-``__u32 cdw2``
- Command dword 2
+**Constants**
-``__u32 cdw3``
- Command dword 3
+``NVME_RESERVATION_RREGA_REGISTER_KEY``
+ *undescribed*
-``__u32 cdw10``
- Command dword 10
+``NVME_RESERVATION_RREGA_UNREGISTER_KEY``
+ *undescribed*
-``__u32 cdw11``
- Command dword 11
+``NVME_RESERVATION_RREGA_REPLACE_KEY``
+ *undescribed*
-``__u32 cdw12``
- Command dword 12
-``__u32 cdw13``
- Command dword 13
-``__u32 cdw14``
- Command dword 14
-``__u32 cdw15``
- Command dword 15
+.. c:type:: enum nvme_reservation_cptpl
-``__u32 data_len``
- Length of the data transfered in this command in bytes
-``void * data``
- Pointer to user address of the data buffer
+**Constants**
-``__u32 metadata_len``
- Length of metadata transfered in this command
+``NVME_RESERVATION_CPTPL_NO_CHANGE``
+ *undescribed*
-``void * metadata``
- Pointer to user address of the metadata buffer
+``NVME_RESERVATION_CPTPL_CLEAR``
+ *undescribed*
-``__u32 timeout_ms``
- How long the kernel waits for the command to complete
+``NVME_RESERVATION_CPTPL_PERSIST``
+ *undescribed*
-``__u32 * result``
- Optional field to return the result from the CQE dword 0
-**Description**
+.. c:function:: int nvme_resv_register (int fd, __u32 nsid, enum nvme_reservation_rrega rrega, enum nvme_reservation_cptpl cptpl, bool iekey, __u64 crkey, __u64 nrkey)
-Parameterized form of nvme_submit_io_passthru(). This sets up and submits
-a :c:type:`struct nvme_passthru_cmd <nvme_passthru_cmd>`.
+ Send an nvme reservation register
-Known values for **opcode** are defined in :c:type:`enum nvme_io_opcode <nvme_io_opcode>`.
+**Parameters**
-**Return**
+``int fd``
+ File descriptor of nvme device
-The nvme command status if a response was received or -1
- with errno set otherwise.
+``__u32 nsid``
+ Namespace identifier
+``enum nvme_reservation_rrega rrega``
+ The registration action, see :c:type:`enum nvme_reservation_rrega <nvme_reservation_rrega>`
-.. c:function:: int nvme_subsystem_reset (int fd)
+``enum nvme_reservation_cptpl cptpl``
+ Change persist through power loss, see :c:type:`enum nvme_reservation_cptpl <nvme_reservation_cptpl>`
- Initiate a subsystem reset
+``bool iekey``
+ Set to ignore the existing key
-**Parameters**
+``__u64 crkey``
+ The current reservation key associated with the host
-``int fd``
- File descriptor of nvme device
+``__u64 nrkey``
+ The new reservation key to be register if action is register or
+ replace
**Description**
-This should only be sent to controller handles, not to namespaces.
+The Reservation Register command is used to register, unregister, or replace
+a reservation key.
**Return**
-Zero if a subsystem reset was initiated or -1 with errno set
- otherwise.
-
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-.. c:function:: int nvme_ctrl_reset (int fd)
- Initiate a controller reset
-**Parameters**
-``int fd``
- File descriptor of nvme device
+.. c:type:: enum nvme_reservation_rrela
-**Description**
-This should only be sent to controller handles, not to namespaces.
+**Constants**
-**Return**
+``NVME_RESERVATION_RRELA_RELEASE``
+ *undescribed*
-Zero if a reset was initiated or -1 with errno set otherwise.
+``NVME_RESERVATION_RRELA_CLEAR``
+ *undescribed*
-.. c:function:: int nvme_ns_rescan (int fd)
+.. c:function:: int nvme_resv_release (int fd, __u32 nsid, enum nvme_reservation_rtype rtype, enum nvme_reservation_rrela rrela, bool iekey, __u64 crkey)
- Initiate a controller rescan
+ Send an nvme reservation release
**Parameters**
``int fd``
File descriptor of nvme device
-**Description**
+``__u32 nsid``
+ Namespace identifier
-This should only be sent to controller handles, not to namespaces.
+``enum nvme_reservation_rtype rtype``
+ The type of reservation to be create, see :c:type:`enum nvme_reservation_rtype <nvme_reservation_rtype>`
+
+``enum nvme_reservation_rrela rrela``
+ Reservation releast action, see :c:type:`enum nvme_reservation_rrela <nvme_reservation_rrela>`
+
+``bool iekey``
+ Set to ignore the existing key
+
+``__u64 crkey``
+ The current reservation key to release
**Return**
-Zero if a rescan was initiated or -1 with errno set otherwise.
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
-.. c:function:: int nvme_get_nsid (int fd)
+.. c:function:: int nvme_resv_report (int fd, __u32 nsid, bool eds, __u32 len, struct nvme_reservation_status * report)
- Retrieve the NSID from a namespace file descriptor
+ Send an nvme reservation report
**Parameters**
``int fd``
- File descriptor of nvme namespace
+ File descriptor of nvme device
+
+``__u32 nsid``
+ Namespace identifier
+
+``bool eds``
+ Request extended Data Structure
+
+``__u32 len``
+ Number of bytes to request transfered with this command
+
+``struct nvme_reservation_status * report``
+ The user space destination address to store the reservation report
**Description**
-This should only be sent to namespace handles, not to controllers.
+Returns a Reservation Status data structure to memory that describes the
+registration and reservation status of a namespace. See the defintion for
+the returned structure, :c:type:`struct nvme_reservation_status <nvme_reservation_status>`, for more details.
**Return**
-The namespace identifier if a succecssful or -1 with errno set
- otherwise.
+The nvme command status if a response was received or -1 with errno
+ set otherwise.
.. c:function:: nvme_subsystem_t nvme_first_subsystem (nvme_root_t r)
**Parameters**
``nvme_root_t r``
- *undescribed*
.. c:function:: nvme_subsystem_t nvme_next_subsystem (nvme_root_t r, nvme_subsystem_t s)
*undescribed*
``nvme_subsystem_t s``
- *undescribed*
.. c:function:: nvme_ns_t nvme_ctrl_first_ns (nvme_ctrl_t c)
**Parameters**
``nvme_ctrl_t c``
- *undescribed*
.. c:function:: nvme_ns_t nvme_ctrl_next_ns (nvme_ctrl_t c, nvme_ns_t n)
*undescribed*
``nvme_ns_t n``
- *undescribed*
.. c:function:: nvme_path_t nvme_ctrl_first_path (nvme_ctrl_t c)
**Parameters**
``nvme_ctrl_t c``
- *undescribed*
.. c:function:: nvme_path_t nvme_ctrl_next_path (nvme_ctrl_t c, nvme_path_t p)
*undescribed*
``nvme_path_t p``
- *undescribed*
.. c:function:: nvme_ctrl_t nvme_subsystem_first_ctrl (nvme_subsystem_t s)
**Parameters**
``nvme_subsystem_t s``
- *undescribed*
.. c:function:: nvme_ctrl_t nvme_subsystem_next_ctrl (nvme_subsystem_t s, nvme_ctrl_t c)
*undescribed*
``nvme_ctrl_t c``
- *undescribed*
.. c:function:: nvme_ns_t nvme_subsystem_first_ns (nvme_subsystem_t s)
**Parameters**
``nvme_subsystem_t s``
- *undescribed*
.. c:function:: nvme_ns_t nvme_subsystem_next_ns (nvme_subsystem_t s, nvme_ns_t n)
*undescribed*
``nvme_ns_t n``
- *undescribed*
.. c:function:: nvme_for_each_subsystem_safe ( r, s, _s)
**Parameters**
``nvme_ns_t n``
- *undescribed*
.. c:function:: int nvme_ns_get_nsid (nvme_ns_t n)
**Parameters**
``nvme_ns_t n``
- *undescribed*
.. c:function:: int nvme_ns_get_lba_size (nvme_ns_t n)
**Parameters**
``nvme_ns_t n``
- *undescribed*
.. c:function:: uint64_t nvme_ns_get_lba_count (nvme_ns_t n)
**Parameters**
``nvme_ns_t n``
- *undescribed*
.. c:function:: uint64_t nvme_ns_get_lba_util (nvme_ns_t n)
**Parameters**
``nvme_ns_t n``
- *undescribed*
.. c:function:: const char * nvme_ns_get_sysfs_dir (nvme_ns_t n)
**Parameters**
``nvme_ns_t n``
- *undescribed*
.. c:function:: const char * nvme_ns_get_name (nvme_ns_t n)
**Parameters**
``nvme_ns_t n``
- *undescribed*
.. c:function:: nvme_subsystem_t nvme_ns_get_subsystem (nvme_ns_t n)
**Parameters**
``nvme_ns_t n``
- *undescribed*
.. c:function:: nvme_ctrl_t nvme_ns_get_ctrl (nvme_ns_t n)
**Parameters**
``nvme_ns_t n``
- *undescribed*
.. c:function:: int nvme_ns_read (nvme_ns_t n, void * buf, off_t offset, size_t count)
*undescribed*
``size_t count``
- *undescribed*
.. c:function:: int nvme_ns_write (nvme_ns_t n, void * buf, off_t offset, size_t count)
*undescribed*
``size_t count``
- *undescribed*
.. c:function:: int nvme_ns_verify (nvme_ns_t n, off_t offset, size_t count)
*undescribed*
``size_t count``
- *undescribed*
.. c:function:: int nvme_ns_compare (nvme_ns_t n, void * buf, off_t offset, size_t count)
*undescribed*
``size_t count``
- *undescribed*
.. c:function:: int nvme_ns_write_zeros (nvme_ns_t n, off_t offset, size_t count)
*undescribed*
``size_t count``
- *undescribed*
.. c:function:: int nvme_ns_write_uncorrectable (nvme_ns_t n, off_t offset, size_t count)
*undescribed*
``size_t count``
- *undescribed*
.. c:function:: int nvme_ns_flush (nvme_ns_t n)
**Parameters**
``nvme_ns_t n``
- *undescribed*
.. c:function:: int nvme_ns_identify (nvme_ns_t n, struct nvme_id_ns * ns)
*undescribed*
``struct nvme_id_ns * ns``
- *undescribed*
.. c:function:: const char * nvme_path_get_name (nvme_path_t p)
**Parameters**
``nvme_path_t p``
- *undescribed*
.. c:function:: const char * nvme_path_get_sysfs_dir (nvme_path_t p)
**Parameters**
``nvme_path_t p``
- *undescribed*
.. c:function:: const char * nvme_path_get_ana_state (nvme_path_t p)
**Parameters**
``nvme_path_t p``
- *undescribed*
.. c:function:: nvme_ctrl_t nvme_path_get_subsystem (nvme_path_t p)
**Parameters**
``nvme_path_t p``
- *undescribed*
.. c:function:: nvme_ns_t nvme_path_get_ns (nvme_path_t p)
**Parameters**
``nvme_path_t p``
- *undescribed*
.. c:function:: int nvme_ctrl_get_fd (nvme_ctrl_t c)
**Parameters**
``nvme_ctrl_t c``
- *undescribed*
.. c:function:: const char * nvme_ctrl_get_name (nvme_ctrl_t c)
**Parameters**
``nvme_ctrl_t c``
- *undescribed*
.. c:function:: const char * nvme_ctrl_get_sysfs_dir (nvme_ctrl_t c)
**Parameters**
``nvme_ctrl_t c``
- *undescribed*
.. c:function:: const char * nvme_ctrl_get_address (nvme_ctrl_t c)
**Parameters**
``nvme_ctrl_t c``
- *undescribed*
.. c:function:: const char * nvme_ctrl_get_firmware (nvme_ctrl_t c)
**Parameters**
``nvme_ctrl_t c``
- *undescribed*
.. c:function:: const char * nvme_ctrl_get_model (nvme_ctrl_t c)
**Parameters**
``nvme_ctrl_t c``
- *undescribed*
.. c:function:: const char * nvme_ctrl_get_state (nvme_ctrl_t c)
**Parameters**
``nvme_ctrl_t c``
- *undescribed*
.. c:function:: const char * nvme_ctrl_get_numa_node (nvme_ctrl_t c)
**Parameters**
``nvme_ctrl_t c``
- *undescribed*
.. c:function:: const char * nvme_ctrl_get_queue_count (nvme_ctrl_t c)
**Parameters**
``nvme_ctrl_t c``
- *undescribed*
.. c:function:: const char * nvme_ctrl_get_serial (nvme_ctrl_t c)
**Parameters**
``nvme_ctrl_t c``
- *undescribed*
.. c:function:: const char * nvme_ctrl_get_sqsize (nvme_ctrl_t c)
**Parameters**
``nvme_ctrl_t c``
- *undescribed*
.. c:function:: const char * nvme_ctrl_get_transport (nvme_ctrl_t c)
**Parameters**
``nvme_ctrl_t c``
- *undescribed*
.. c:function:: const char * nvme_ctrl_get_nqn (nvme_ctrl_t c)
**Parameters**
``nvme_ctrl_t c``
- *undescribed*
.. c:function:: const char * nvme_ctrl_get_subsysnqn (nvme_ctrl_t c)
**Parameters**
``nvme_ctrl_t c``
- *undescribed*
.. c:function:: nvme_subsystem_t nvme_ctrl_get_subsystem (nvme_ctrl_t c)
**Parameters**
``nvme_ctrl_t c``
- *undescribed*
.. c:function:: int nvme_ctrl_identify (nvme_ctrl_t c, struct nvme_id_ctrl * id)
*undescribed*
``struct nvme_id_ctrl * id``
- *undescribed*
.. c:function:: int nvme_ctrl_disconnect (nvme_ctrl_t c)
**Parameters**
``nvme_ctrl_t c``
- *undescribed*
.. c:function:: nvme_ctrl_t nvme_scan_ctrl (const char * name)
**Parameters**
``const char * name``
- *undescribed*
.. c:function:: void nvme_free_ctrl (struct nvme_ctrl * c)
**Parameters**
``nvme_subsystem_t s``
- *undescribed*
.. c:function:: const char * nvme_subsystem_get_sysfs_dir (nvme_subsystem_t s)
**Parameters**
``nvme_subsystem_t s``
- *undescribed*
.. c:function:: const char * nvme_subsystem_get_name (nvme_subsystem_t s)
**Parameters**
``nvme_subsystem_t s``
- *undescribed*
.. c:function:: nvme_root_t nvme_scan_filter (nvme_scan_filter_t f)
**Parameters**
``nvme_scan_filter_t f``
- *undescribed*
.. c:function:: nvme_root_t nvme_scan ()
*undescribed*
``const char * attr``
- *undescribed*
.. c:function:: char * nvme_get_ctrl_attr (nvme_ctrl_t c, const char * attr)
*undescribed*
``const char * attr``
- *undescribed*
.. c:function:: char * nvme_get_ns_attr (nvme_ns_t n, const char * attr)
*undescribed*
``const char * attr``
- *undescribed*
.. c:function:: char * nvme_get_path_attr (nvme_path_t p, const char * attr)
*undescribed*
``const char * attr``
- *undescribed*
.. c:type:: enum nvme_constants
+ A place to stash various constant nvme values
**Constants**
``NVME_NSID_ALL``
- *undescribed*
+ A broadcast value that is used to specify all
+ namespaces
``NVME_NSID_NONE``
- *undescribed*
+ The invalid namespace id, for when the nsid
+ parameter is not used in a command
``NVME_UUID_NONE``
- *undescribed*
+ Use to omit the uuid command parameter
``NVME_CNTLID_NONE``
- *undescribed*
+ Use to omit the cntlid command parameter
``NVME_NVMSETID_NONE``
- *undescribed*
+ Use to omit the nvmsetid command parameter
``NVME_LOG_LSP_NONE``
- *undescribed*
+ Use to omit the log lsp command parameter
``NVME_LOG_LSI_NONE``
- *undescribed*
+ Use to omit the log lsi command parameter
``NVME_IDENTIFY_DATA_SIZE``
- *undescribed*
+ The transfer size for nvme identify commands
``NVME_ID_NVMSET_LIST_MAX``
- *undescribed*
+ The largest possible nvmset index in identify
+ nvmeset
``NVME_ID_UUID_LIST_MAX``
- *undescribed*
+ The largest possible uuid index in identify
+ uuid list
``NVME_ID_CTRL_LIST_MAX``
- *undescribed*
+ The largest possible controller index in
+ identify controller list
``NVME_ID_NS_LIST_MAX``
- *undescribed*
+ The largest possible namespace index in
+ identify namespace list
``NVME_ID_SECONDARY_CTRL_MAX``
+ The largest possible secondary controller index
+ in identify secondary controller
+
+``NVME_ID_ND_DESCRIPTOR_MAX``
*undescribed*
``NVME_FEAT_LBA_RANGE_MAX``
- *undescribed*
+ The largest possible LBA range index in feature
+ lba range type
``NVME_LOG_ST_MAX_RESULTS``
- *undescribed*
+ The largest possible self test result index in the
+ device self test log
``NVME_DSM_MAX_RANGES``
- *undescribed*
-
-
-**NVMe controller registers/properties**
+ The largest possible range index in a data-set
+ management command
.. c:type:: enum nvme_registers
+ The nvme controller registers for all transports. This is the layout of BAR0/1 for PCIe, and properties for fabrics.
**Constants**
SQ 0 Tail Doorbell
+.. c:function:: bool is_64bit_reg (__u32 offset)
+ Checks if offset of the controller register is 64bit or not.
-.. c:type:: enum
+**Parameters**
+``__u32 offset``
+ Offset of controller register field in bytes
-**Constants**
+**Description**
-``NVME_CC_ENABLE``
- *undescribed*
+This function does not care about transport so that the offset is not going
+to be checked inside of this function for the unsupported fields in a
+specific transport. For example, BPMBL(Boot Partition Memory Buffer
+Location) register is not supported by fabrics, but it can be chcked here.
-``NVME_CC_CSS_NVM``
- *undescribed*
+Returns true if given offset is 64bit register, otherwise it returns false.
-``NVME_CC_EN_SHIFT``
- *undescribed*
-``NVME_CC_CSS_SHIFT``
- *undescribed*
-``NVME_CC_MPS_SHIFT``
- *undescribed*
-``NVME_CC_AMS_SHIFT``
- *undescribed*
+.. c:type:: enum nvme_psd_flags
-``NVME_CC_SHN_SHIFT``
- *undescribed*
+ Possible flag values in nvme power state descriptor
-``NVME_CC_IOSQES_SHIFT``
- *undescribed*
+**Constants**
-``NVME_CC_IOCQES_SHIFT``
- *undescribed*
+``NVME_PSD_FLAGS_MXPS``
+ Indicates the scale for the Maximum Power
+ field. If this bit is cleared, then the scale of the
+ Maximum Power field is in 0.01 Watts. If this bit is
+ set, then the scale of the Maximum Power field is in
+ 0.0001 Watts.
-``NVME_CC_AMS_RR``
- *undescribed*
+``NVME_PSD_FLAGS_NOPS``
+ Indicates whether the controller processes I/O
+ commands in this power state. If this bit is cleared,
+ then the controller processes I/O commands in this
+ power state. If this bit is set, then the controller
+ does not process I/O commands in this power state.
-``NVME_CC_AMS_WRRU``
- *undescribed*
-``NVME_CC_AMS_VS``
- *undescribed*
-``NVME_CC_SHN_NONE``
- *undescribed*
-``NVME_CC_SHN_NORMAL``
- *undescribed*
+.. c:type:: enum nvme_psd_ps
-``NVME_CC_SHN_ABRUPT``
- *undescribed*
+ Known values for :c:type:`struct nvme_psd <nvme_psd>` #ips and #aps. Use with nvme_psd_power_scale() to extract the power scale field to match this enum. NVME_PSD_IPS_100_MICRO_WATT: 0.0001 watt scale NVME_PSD_IPS_10_MILLI_WATT: 0.01 watt scale
-``NVME_CC_SHN_MASK``
- *undescribed*
+**Constants**
-``NVME_CSTS_RDY``
+``NVME_PSD_PS_100_MICRO_WATT``
*undescribed*
-``NVME_CSTS_CFS``
+``NVME_PSD_PS_10_MILLI_WATT``
*undescribed*
-``NVME_CSTS_NSSRO``
- *undescribed*
-``NVME_CSTS_PP``
- *undescribed*
+.. c:function:: unsigned nvme_psd_power_scale (__u8 ps)
-``NVME_CSTS_SHST_NORMAL``
- *undescribed*
+ power scale occupies the upper 3 bits
-``NVME_CSTS_SHST_OCCUR``
- *undescribed*
+**Parameters**
-``NVME_CSTS_SHST_CMPLT``
+``__u8 ps``
*undescribed*
-``NVME_CSTS_SHST_MASK``
- *undescribed*
-**NVMe Identify**
+
+.. c:type:: enum nvme_psd_workload
+
+ Specifies a workload hint in the Power Management Feature (see :c:type:`struct nvme_psd <nvme_psd>`.apw) to inform the NVM subsystem or indicate the conditions for the active power level.
+
+**Constants**
+
+``NVME_PSD_WORKLOAD_1``
+ Extended Idle Period with a Burst of Random Write
+ consists of five minutes of idle followed by
+ thirty-two random write commands of size 1 MiB
+ submitted to a single controller while all other
+ controllers in the NVM subsystem are idle, and then
+ thirty (30) seconds of idle.
+
+``NVME_PSD_WORKLOAD_2``
+ Heavy Sequential Writes consists of 80,000
+ sequential write commands of size 128 KiB submitted to
+ a single controller while all other controllers in the
+ NVM subsystem are idle. The submission queue(s)
+ should be sufficiently large allowing the host to
+ ensure there are multiple commands pending at all
+ times during the workload.
**Members**
+``mp``
+ Maximum Power indicates the sustained maximum power consumed by the
+ NVM subsystem in this power state. The power in Watts is equal to
+ the value in this field multiplied by the scale specified in the Max
+ Power Scale bit (see :c:type:`enum nvme_psd_flags <nvme_psd_flags>`). A value of 0 indicates
+ Maximum Power is not reported.
+``flags``
+ Additional decoding flags, see :c:type:`enum nvme_psd_flags <nvme_psd_flags>`.
-.. c:function:: unsigned nvme_psd_power_scale (__u8 ps)
-
- power scale occupies the upper 3 bits
-
-**Parameters**
+``enlat``
+ Entry Latency indicates the maximum latency in microseconds
+ associated with entering this power state. A value of 0 indicates
+ Entry Latency is not reported.
-``__u8 ps``
- *undescribed*
+``exlat``
+ Exit Latency indicates the maximum latency in microseconds
+ associated with exiting this power state. A value of 0 indicates
+ Exit Latency is not reported.
+``rrt``
+ Relative Read Throughput indicates the read throughput rank
+ associated with this power state relative to others. The value in
+ this is less than the number of supported power states.
+``rrl``
+ Relative Reade Latency indicates the read latency rank associated
+ with this power state relative to others. The value in this field is
+ less than the number of supported power states.
+``rwt``
+ Relative Write Throughput indicates write throughput rank associated
+ with this power state relative to others. The value in this field is
+ less than the number of supported power states
-.. c:type:: enum
+``rwl``
+ Relative Write Latency indicates the write latency rank associated
+ with this power state relative to others. The value in this field is
+ less than the number of supported power states
+``idlp``
+ Idle Power indicates the typical power consumed by the NVM
+ subsystem over 30 seconds in this power state when idle.
-**Constants**
+``ips``
+ Idle Power Scale indicates the scale for :c:type:`struct nvme_id_psd <nvme_id_psd>`.idlp,
+ see :c:type:`enum nvme_psd_ps <nvme_psd_ps>` for decoding this field.
-``NVME_PSD_FLAGS_MAX_POWER_SCALE``
- *undescribed*
+``actp``
+ Active Power indicates the largest average power consumed by the
+ NVM subsystem over a 10 second period in this power state with
+ the workload indicated in the Active Power Workload field.
-``NVME_PSD_FLAGS_NON_OP_STATE``
- *undescribed*
+``apw``
+ Active Power Workload indicates the workload used to calculate
+ maximum power for this power state. See :c:type:`enum nvme_psd_workload <nvme_psd_workload>` for
+ decoding this field.
-``NVME_PSD_RELATIVE_MASK``
- *undescribed*
+``aps``
+ Active Power Scale indicates the scale for the :c:type:`struct
+ nvme_id_psd <nvme_id_psd>`.actp, see :c:type:`enum nvme_psd_ps <nvme_psd_ps>` for decoding this value.
-``NVME_PSD_APW_MASK``
- *undescribed*
**Members**
``vid``
- Vendor ID
+ PCI Vendor ID, the company vendor identifier that is assigned by
+ the PCI SIG.
``ssvid``
- Subsystem Vendor Id
+ PCI Subsystem Vendor ID, the company vendor identifier that is
+ assigned by the PCI SIG for the subsystem.
``sn``
- Serial Number
+ Serial Number in ascii
``mn``
- Model Number
+ Model Number in ascii
``fr``
- Firmware Revision
+ Firmware Revision in ascii, the currently active firmware
+ revision for the NVM subsystem
``rab``
- Recommended Arbitration Burst
+ Recommended Arbitration Burst, reported as a power of two
``ieee``
- IEEE
+ IEEE assigned Organization Unique Identifier
``cmic``
- Controller Mulitpathing Capabilities
+ Controller Multipath IO and Namespace Sharing Capabilities of
+ the controller and NVM subsystem. See :c:type:`enum nvme_id_ctrl_cmic <nvme_id_ctrl_cmic>`.
``mdts``
- Max Data Transfer Size
+ Max Data Transfer Size is the largest data transfer size. The
+ host should not submit a command that exceeds this maximum data
+ transfer size. The value is in units of the minimum memory page
+ size (CAP.MPSMIN) and is reported as a power of two
``cntlid``
- Controller Identifier
+ Controller ID, the NVM subsystem unique controller identifier
+ associated with the controller.
``ver``
- Version
+ Version, this field contains the value reported in the Version
+ register, or property (see :c:type:`enum nvme_registers <nvme_registers>` ``NVME_REG_VS``).
``rtd3r``
- Runtime D3 Resume
+ RTD3 Resume Latency, the expected latency in microseconds to resume
+ from Runtime D3
``rtd3e``
- Runtime D3 Exit
+ RTD3 Exit Latency, the typical latency in microseconds to enter
+ Runtime D3.
``oaes``
- Optional Async Events Supported
+ Optional Async Events Supported, see **enum** nvme_id_ctrl_oaes .
``ctratt``
- Controller Attributes
+ Controller Attributes, see **enum** nvme_id_ctrl_ctratt
``rrls``
- Read Recovery Levels
+ Read Recovery Levels. If a bit is set, then the corresponding
+ Read Recovery Level is supported. If a bit is cleared, then the
+ corresponding Read Recovery Level is not supported.
``cntrltype``
- Controller Type
+ Controller Type, see :c:type:`enum nvme_id_ctrl_cntrltype <nvme_id_ctrl_cntrltype>`
``fguid``
- FRU GUID
+ FRU GUID, a 128-bit value that is globally unique for a given
+ Field Replaceable Unit
``crdt1``
- Controller Retry Delay 1
+ Controller Retry Delay time in 100 millisecod units if CQE CRD
+ field is 1
``crdt2``
- Controller Retry Delay 2
+ Controller Retry Delay time in 100 millisecod units if CQE CRD
+ field is 2
``crdt3``
- Controller Retry Delay 3
+ Controller Retry Delay time in 100 millisecod units if CQE CRD
+ field is 3
+
+``nvmsr``
+ NVM Subsystem Report, see :c:type:`enum nvme_id_ctrl_nvmsr <nvme_id_ctrl_nvmsr>`
+
+``vwci``
+ VPD Write Cycle Information, see :c:type:`enum nvme_id_ctrl_vwci <nvme_id_ctrl_vwci>`
+
+``mec``
+ Management Endpoint Capabilities, see :c:type:`enum nvme_id_ctrl_mec <nvme_id_ctrl_mec>`
``oacs``
- Optional Admin Commands Supported
+ Optional Admin Command Support,the optional Admin commands and
+ features supported by the controller, see :c:type:`enum nvme_id_ctrl_oacs <nvme_id_ctrl_oacs>`.
``acl``
- Abort Command Limit
+ Abort Command Limit, the maximum number of concurrently
+ executing Abort commands supported by the controller. This is a
+ 0's based value.
``aerl``
- Async Event Request Limit
+ Async Event Request Limit, the maximum number of concurrently
+ outstanding Asynchronous Event Request commands supported by the
+ controller This is a 0's based value.
+
+``frmw``
+ Firmware Updates indicates capabilities regarding firmware
+ updates. See :c:type:`enum nvme_id_ctrl_frmw <nvme_id_ctrl_frmw>`.
``lpa``
- Log Page Attributes
+ Log Page Attributes, see :c:type:`enum nvme_id_ctrl_lpa <nvme_id_ctrl_lpa>`.
+
+``elpe``
+ Error Log Page Entries, the maximum number of Error Information
+ log entries that are stored by the controller. This field is a
+ 0's based value.
``npss``
- Number of Power States Supported
+ Number of Power States Supported, the number of NVM Express
+ power states supported by the controller, indicating the number
+ of valid entries in :c:type:`struct nvme_id_ctrl <nvme_id_ctrl>`.psd. This is a 0's
+ based value.
+
+``avscc``
+ Admin Vendor Specific Command Configuration, see :c:type:`enum
+ nvme_id_ctrl_avscc <nvme_id_ctrl_avscc>`.
+
+``apsta``
+ Autonomous Power State Transition Attributes, see :c:type:`enum
+ nvme_id_ctrl_apsta <nvme_id_ctrl_apsta>`.
+
+``wctemp``
+ Warning Composite Temperature Threshold indicates
+ the minimum Composite Temperature field value (see :c:type:`struct
+ nvme_smart_log <nvme_smart_log>`.critical_comp_time) that indicates an overheating
+ condition during which controller operation continues.
+
+``cctemp``
+ Critical Composite Temperature Threshold, field indicates the
+ minimum Composite Temperature field value (see :c:type:`struct
+ nvme_smart_log <nvme_smart_log>`.critical_comp_time) that indicates a critical
+ overheating condition.
+
+``mtfa``
+ Maximum Time for Firmware Activation indicates the maximum time
+ the controller temporarily stops processing commands to activate
+ the firmware image, specified in 100 millisecond units. This
+ field is always valid if the controller supports firmware
+ activation without a reset.
+
+``hmpre``
+ Host Memory Buffer Preferred Size indicates the preferred size
+ that the host is requested to allocate for the Host Memory
+ Buffer feature in 4 KiB units.
+
+``hmmin``
+ Host Memory Buffer Minimum Size indicates the minimum size that
+ the host is requested to allocate for the Host Memory Buffer
+ feature in 4 KiB units.
+
+``tnvmcap``
+ Total NVM Capacity, the total NVM capacity in the NVM subsystem.
+ The value is in bytes.
+
+``unvmcap``
+ Unallocated NVM Capacity, the unallocated NVM capacity in the
+ NVM subsystem. The value is in bytes.
+ **rpmbs** Replay Protected Memory Block Support, see :c:type:`enum
+ nvme_id_ctrl_rpmbs <nvme_id_ctrl_rpmbs>`.
+ **edstt** Extended Device Self-test Time, if Device Self-test command is
+ supported (see :c:type:`struct nvme_id_ctrl <nvme_id_ctrl>`.oacs, ``NVME_CTRL_OACS_SELF_TEST``),
+ then this field indicates the nominal amount of time in one
+ minute units that the controller takes to complete an extended
+ device self-test operation when in power state 0.
+
+``dsto``
+ Device Self-test Options, see :c:type:`enum nvme_id_ctrl_dsto <nvme_id_ctrl_dsto>`.
+
+``fwug``
+ Firmware Update Granularity indicates the granularity and
+ alignment requirement of the firmware image being updated by the
+ Firmware Image Download command. The value is reported in 4 KiB
+ units. A value of 0h indicates no information on granularity is
+ provided. A value of FFh indicates no restriction
+
+``kas``
+ Keep Alive Support indicates the granularity of the Keep Alive
+ Timer in 100 millisecond units.
+
+``hctma``
+ Host Controlled Thermal Management Attributes, see :c:type:`enum nvme_id_ctrl_hctm <nvme_id_ctrl_hctm>`.
+
+``mntmt``
+ Minimum Thermal Management Temperature indicates the minimum
+ temperature, in degrees Kelvin, that the host may request in the
+ Thermal Management Temperature 1 field and Thermal Management
+ Temperature 2 field of a Set Features command with the Feature
+ Identifier field set to #NVME_FEAT_FID_HCTM.
+
+``mxtmt``
+ Maximum Thermal Management Temperature indicates the maximum
+ temperature, in degrees Kelvin, that the host may request in the
+ Thermal Management Temperature 1 field and Thermal Management
+ Temperature 2 field of the Set Features command with the Feature
+ Identifier set to #NVME_FEAT_FID_HCTM.
+
+``sanicap``
+ Sanitize Capabilities, see :c:type:`enum nvme_id_ctrl_sanicap <nvme_id_ctrl_sanicap>`
+
+``hmminds``
+ Host Memory Buffer Minimum Descriptor Entry Size indicates the
+ minimum usable size of a Host Memory Buffer Descriptor Entry in
+ 4 KiB units.
+
+``hmmaxd``
+ Host Memory Maximum Descriptors Entries indicates the number of
+ usable Host Memory Buffer Descriptor Entries.
+
+``nsetidmax``
+ NVM Set Identifier Maximum, defines the maximum value of a valid
+ NVM Set Identifier for any controller in the NVM subsystem.
+
+``endgidmax``
+ Endurance Group Identifier Maximum, defines the maximum value of
+ a valid Endurance Group Identifier for any controller in the NVM
+ subsystem.
+
+``anatt``
+ ANA Transition Time indicates the maximum amount of time, in
+ seconds, for a transition between ANA states or the maximum
+ amount of time, in seconds, that the controller reports the ANA
+ change state.
+
+``anacap``
+ Asymmetric Namespace Access Capabilities, see :c:type:`enum
+ nvme_id_ctrl_anacap <nvme_id_ctrl_anacap>`.
+
+``anagrpmax``
+ ANA Group Identifier Maximum indicates the maximum value of a
+ valid ANA Group Identifier for any controller in the NVM
+ subsystem.
+
+``nanagrpid``
+ Number of ANA Group Identifiers indicates the number of ANA
+ groups supported by this controller.
+
+``pels``
+ Persistent Event Log Size indicates the maximum reportable size
+ for the Persistent Event Log.
+
+``sqes``
+ Submission Queue Entry Size, see :c:type:`enum nvme_id_ctrl_sqes <nvme_id_ctrl_sqes>`.
+
+``cqes``
+ Completion Queue Entry Size, see :c:type:`enum nvme_id_ctrl_cqes <nvme_id_ctrl_cqes>`.
+
+``maxcmd``
+ Maximum Outstanding Commands indicates the maximum number of
+ commands that the controller processes at one time for a
+ particular queue.
+``nn``
+ Number of Namespaces indicates the maximum value of a valid
+ nsid for the NVM subsystem. If the MNAN (:c:type:`struct nvme_id_ctrl <nvme_id_ctrl>`.mnan
+ field is cleared to 0h, then this field also indicates the
+ maximum number of namespaces supported by the NVM. subsystem.
+``oncs``
+ Optional NVM Command Support, see :c:type:`enum nvme_id_ctrl_oncs <nvme_id_ctrl_oncs>`.
+``fuses``
+ Fused Operation Support, see :c:type:`enum nvme_id_ctrl_fuses <nvme_id_ctrl_fuses>`.
+``fna``
+ Format NVM Attributes, see :c:type:`enum nvme_id_ctrl_fna <nvme_id_ctrl_fna>`.
-.. c:type:: enum
+``vwc``
+ Volatile Write Cache, see :c:type:`enum nvme_id_ctrl_vwc <nvme_id_ctrl_vwc>`.
+
+``awun``
+ Atomic Write Unit Normal indicates the size of the write
+ operation guaranteed to be written atomically to the NVM across
+ all namespaces with any supported namespace format during normal
+ operation. This field is specified in logical blocks and is a
+ 0's based value.
+
+``awupf``
+ Atomic Write Unit Power Fail indicates the size of the write
+ operation guaranteed to be written atomically to the NVM across
+ all namespaces with any supported namespace format during a
+ power fail or error condition. This field is specified in
+ logical blocks and is a 0’s based value.
+
+``nvscc``
+ NVM Vendor Specific Command Configuration, see :c:type:`enum
+ nvme_id_ctrl_nvscc <nvme_id_ctrl_nvscc>`.
+
+``nwpc``
+ Namespace Write Protection Capabilities, see :c:type:`enum
+ nvme_id_ctrl_nwpc <nvme_id_ctrl_nwpc>`.
+
+``acwu``
+ Atomic Compare & Write Unit indicates the size of the write
+ operation guaranteed to be written atomically to the NVM across
+ all namespaces with any supported namespace format for a Compare
+ and Write fused operation. This field is specified in logical
+ blocks and is a 0’s based value.
+
+``sgls``
+ SGL Support, see :c:type:`enum nvme_id_ctrl_sgls <nvme_id_ctrl_sgls>`
+
+``mnan``
+ Maximum Number of Allowed Namespaces indicates the maximum
+ number of namespaces supported by the NVM subsystem.
+
+``subnqn``
+ NVM Subsystem NVMe Qualified Name, UTF-8 null terminated string
+
+``ioccsz``
+ I/O Queue Command Capsule Supported Size, defines the maximum
+ I/O command capsule size in 16 byte units.
+
+``iorcsz``
+ I/O Queue Response Capsule Supported Size, defines the maximum
+ I/O response capsule size in 16 byte units.
+
+``icdoff``
+ In Capsule Data Offset, defines the offset where data starts
+ within a capsule. This value is applicable to I/O Queues only.
+
+``fcatt``
+ Fabrics Controller Attributes, see :c:type:`enum nvme_id_ctrl_fcatt <nvme_id_ctrl_fcatt>`.
+
+``msdbd``
+ Maximum SGL Data Block Descriptors indicates the maximum
+ number of SGL Data Block or Keyed SGL Data Block descriptors
+ that a host is allowed to place in a capsule. A value of 0h
+ indicates no limit.
+
+``ofcs``
+ Optional Fabric Commands Support, see :c:type:`enum nvme_id_ctrl_ofcs <nvme_id_ctrl_ofcs>`.
+
+``psd``
+ Power State Descriptors, see :c:type:`struct nvme_id_psd <nvme_id_psd>`.
+
+``vs``
+ Vendor Specific
+
+
+
+
+
+.. c:type:: enum nvme_id_ctrl_cmic
**Constants**
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_oaes
+ The typical latency in microseconds to enter Runtime D3
**Constants**
*undescribed*
``NVME_CTRL_OAES_LBAS``
- *undescribed*
+ :
``NVME_CTRL_OAES_EGE``
*undescribed*
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_ctratt
**Constants**
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_cntrltype
**Constants**
-``NVME_CTRL_CNTRLTYPE_RESERVED``
- *undescribed*
-
``NVME_CTRL_CNTRLTYPE_IO``
*undescribed*
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_nvmsr
+ This field reports information associated with the NVM Subsystem, see :c:type:`struct nvme_id_ctrl <nvme_id_ctrl>`.nvmsr.
**Constants**
``NVME_CTRL_NVMSR_NVMESD``
- *undescribed*
+ If set, then the NVM Subsystem is part of an NVMe
+ Storage Device; if cleared, then the NVM Subsystem
+ is not part of an NVMe Storage Device.
``NVME_CTRL_NVMSR_NVMEE``
- *undescribed*
+ If set’, then the NVM Subsystem is part of an NVMe
+ Enclosure; if cleared, then the NVM Subsystem is
+ not part of an NVMe Enclosure.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_vwci
+ This field indicates information about remaining number of times that VPD contents are able to be updated using the VPD Write command, see :c:type:`struct nvme_id_ctrl <nvme_id_ctrl>`.vwci.
**Constants**
``NVME_CTRL_VWCI_VWCR``
- *undescribed*
+ Mask to get value of VPD Write Cycles Remaining. If
+ the VPD Write Cycle Remaining Valid bit is set, then
+ this field contains a value indicating the remaining
+ number of times that VPD contents are able to be
+ updated using the VPD Write command. If this field is
+ set to 7Fh, then the remaining number of times that
+ VPD contents are able to be updated using the VPD
+ Write command is greater than or equal to 7Fh.
``NVME_CTRL_VWCI_VWCRV``
- *undescribed*
+ VPD Write Cycle Remaining Valid. If this bit is set,
+ then the VPD Write Cycle Remaining field is valid. If
+ this bit is cleared, then the VPD Write Cycles
+ Remaining field is invalid and cleared to 0h.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_mec
+ Flags indicatings the capabilities of the Management Endpoint in the Controller, :c:type:`struct nvme_id_ctrl <nvme_id_ctrl>`.mec.
**Constants**
``NVME_CTRL_MEC_SMBUSME``
- *undescribed*
+ If set, then the NVM Subsystem contains a Management
+ Endpoint on an SMBus/I2C port.
``NVME_CTRL_MEC_PCIEME``
- *undescribed*
+ If set, then the NVM Subsystem contains a Management
+ Endpoint on a PCIe port.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_oacs
+ Flags indicating the optional Admin commands and features supported by the controller, see :c:type:`struct nvme_id_ctrl <nvme_id_ctrl>`.oacs.
**Constants**
``NVME_CTRL_OACS_SECURITY``
- *undescribed*
+ If set, then the controller supports the
+ Security Send and Security Receive commands.
``NVME_CTRL_OACS_FORMAT``
- *undescribed*
+ If set then the controller supports the Format
+ NVM command.
``NVME_CTRL_OACS_FW``
- *undescribed*
+ If set, then the controller supports the
+ Firmware Commit and Firmware Image Download commands.
``NVME_CTRL_OACS_NS_MGMT``
- *undescribed*
+ If set, then the controller supports the
+ Namespace Management capability
``NVME_CTRL_OACS_SELF_TEST``
- *undescribed*
+ If set, then the controller supports the Device
+ Self-test command.
``NVME_CTRL_OACS_DIRECTIVES``
- *undescribed*
+ If set, then the controller supports Directives
+ and the Directive Send and Directive Receive
+ commands.
``NVME_CTRL_OACS_NVME_MI``
- *undescribed*
+ If set, then the controller supports the NVMe-MI
+ Send and NVMe-MI Receive commands.
``NVME_CTRL_OACS_VIRT_MGMT``
- *undescribed*
+ If set, then the controller supports the
+ Virtualization Management command.
``NVME_CTRL_OACS_DBBUF_CFG``
- *undescribed*
+ If set, then the controller supports the
+ Doorbell Buffer Config command.
``NVME_CTRL_OACS_LBA_STATUS``
- *undescribed*
+ If set, then the controller supports the Get LBA
+ Status capability.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_frmw
+ Flags and values indicates capabilities regarding firmware updates from :c:type:`struct nvme_id_ctrl <nvme_id_ctrl>`.frmw.
**Constants**
``NVME_CTRL_FRMW_1ST_RO``
- *undescribed*
+ If set, the first firmware slot is readonly
``NVME_CTRL_FRMW_NR_SLOTS``
- *undescribed*
+ Mask to get the value of the number of
+ firmware slots that the controller supports.
``NVME_CTRL_FRMW_FW_ACT_NO_RESET``
- *undescribed*
+ If set, the controller supports firmware
+ activation without a reset.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_lpa
+ Flags indicating optional attributes for log pages that are accessed via the Get Log Page command.
**Constants**
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_avscc
+ Flags indicating the configuration settings for Admin Vendor Specific command handling.
**Constants**
``NVME_CTRL_AVSCC_AVS``
- *undescribed*
+ If set, all Admin Vendor Specific Commands use the
+ optional vendor specific command format with NDT and
+ NDM fields.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_apsta
+ Flags indicating the attributes of the autonomous power state transition feature.
**Constants**
``NVME_CTRL_APSTA_APST``
- *undescribed*
+ If set, then the controller supports autonomous power
+ state transitions.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_rpmbs
+ This field indicates if the controller supports one or more Replay Protected Memory Blocks, from :c:type:`struct nvme_id_ctrl <nvme_id_ctrl>`.rpmbs.
**Constants**
``NVME_CTRL_RPMBS_NR_UNITS``
- *undescribed*
+ Mask to get the value of the Number of RPMB Units
``NVME_CTRL_RPMBS_AUTH_METHOD``
- *undescribed*
+ Mask to get the value of the Authentication Method
``NVME_CTRL_RPMBS_TOTAL_SIZE``
- *undescribed*
+ Mask to get the value of Total Size
``NVME_CTRL_RPMBS_ACCESS_SIZE``
- *undescribed*
+ Mask to get the value of Access Size
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_dsto
+ Flags indicating the optional Device Self-test command or operation behaviors supported by the controller or NVM subsystem.
**Constants**
``NVME_CTRL_DSTO_ONE_DST``
- *undescribed*
+ If set, then the NVM subsystem supports only one
+ device self-test operation in progress at a time.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_hctm
+ Flags indicate the attributes of the host controlled thermal management feature
**Constants**
``NVME_CTRL_HCTMA_HCTM``
- *undescribed*
+ then the controller supports host controlled thermal
+ management, and the Set Features command and Get
+ Features command with the Feature Identifier field
+ set to ``NVME_FEAT_FID_HCTM``.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_sanicap
+ Indicates attributes for sanitize operations.
**Constants**
``NVME_CTRL_SANICAP_CES``
- *undescribed*
+ Crypto Erase Support. If set, then the
+ controller supports the Crypto Erase sanitize operation.
``NVME_CTRL_SANICAP_BES``
- *undescribed*
+ Block Erase Support. If set, then the controller
+ supports the Block Erase sanitize operation.
``NVME_CTRL_SANICAP_OWS``
- *undescribed*
+ Overwrite Support. If set, then the controller
+ supports the Overwrite sanitize operation.
``NVME_CTRL_SANICAP_NDI``
- *undescribed*
+ No-Deallocate Inhibited. If set and the No-
+ Deallocate Response Mode bit is set, then the
+ controller deallocates after the sanitize
+ operation even if the No-Deallocate After
+ Sanitize bit is set in a Sanitize command.
``NVME_CTRL_SANICAP_NODMMAS``
- *undescribed*
+ No-Deallocate Modifies Media After Sanitize,
+ mask to extract value.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_anacap
+ This field indicates the capabilities associated with Asymmetric Namespace Access Reporting.
**Constants**
``NVME_CTRL_ANACAP_OPT``
- *undescribed*
+ If set, then the controller is able to
+ report ANA Optimized state.
``NVME_CTRL_ANACAP_NON_OPT``
- *undescribed*
+ If set, then the controller is able to
+ report ANA Non-Optimized state.
``NVME_CTRL_ANACAP_INACCESSIBLE``
- *undescribed*
+ If set, then the controller is able to
+ report ANA Inaccessible state.
``NVME_CTRL_ANACAP_PERSISTENT_LOSS``
- *undescribed*
+ If set, then the controller is able to
+ report ANA Persistent Loss state.
``NVME_CTRL_ANACAP_CHANGE``
- *undescribed*
+ If set, then the controller is able to
+ report ANA Change state.
``NVME_CTRL_ANACAP_GRPID_NO_CHG``
- *undescribed*
+ If set, then the ANAGRPID field in the
+ Identify Namespace data structure
+ (:c:type:`struct nvme_id_ns <nvme_id_ns>`.anagrpid), does not
+ change while the namespace is attached to
+ any controller.
``NVME_CTRL_ANACAP_GRPID_MGMT``
- *undescribed*
+ If set, then the controller supports a
+ non-zero value in the ANAGRPID field of
+ the Namespace Management command.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_sqes
+ Defines the required and maximum Submission Queue entry size when using the NVM Command Set.
**Constants**
``NVME_CTRL_SQES_MIN``
- *undescribed*
+ Mask to get the value of the required Submission Queue
+ Entry size when using the NVM Command Set.
``NVME_CTRL_SQES_MAX``
- *undescribed*
+ Mask to get the value of the maximum Submission Queue
+ entry size when using the NVM Command Set.
.. c:type:: enum
+ Defines the required and maximum Completion Queue entry size when using the NVM Command Set.
**Constants**
``NVME_CTRL_CQES_MIN``
- *undescribed*
+ Mask to get the value of the required Completion Queue
+ Entry size when using the NVM Command Set.
``NVME_CTRL_CQES_MAX``
- *undescribed*
+ Mask to get the value of the maximum Completion Queue
+ entry size when using the NVM Command Set.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_oncs
+ This field indicates the optional NVM commands and features supported by the controller.
**Constants**
``NVME_CTRL_ONCS_COMPARE``
- *undescribed*
+ If set, then the controller supports
+ the Compare command.
``NVME_CTRL_ONCS_WRITE_UNCORRECTABLE``
- *undescribed*
+ If set, then the controller supports
+ the Write Uncorrectable command.
``NVME_CTRL_ONCS_DSM``
- *undescribed*
+ If set, then the controller supports
+ the Dataset Management command.
``NVME_CTRL_ONCS_WRITE_ZEROES``
- *undescribed*
+ If set, then the controller supports
+ the Write Zeroes command.
``NVME_CTRL_ONCS_SAVE_FEATURES``
- *undescribed*
+ If set, then the controller supports
+ the Save field set to a non-zero value
+ in the Set Features command and the
+ Select field set to a non-zero value in
+ the Get Features command.
``NVME_CTRL_ONCS_RESERVATIONS``
- *undescribed*
+ If set, then the controller supports
+ reservations.
``NVME_CTRL_ONCS_TIMESTAMP``
- *undescribed*
+ If set, then the controller supports
+ the Timestamp feature.
``NVME_CTRL_ONCS_VERIFY``
- *undescribed*
+ If set, then the controller supports
+ the Verify command.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_fuses
+ This field indicates the fused operations that the controller supports.
**Constants**
``NVME_CTRL_FUSES_COMPARE_AND_WRITE``
- *undescribed*
+ If set, then the controller supports the
+ Compare and Write fused operation.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_fna
+ This field indicates attributes for the Format NVM command.
**Constants**
``NVME_CTRL_FNA_FMT_ALL_NAMESPACES``
- *undescribed*
+ If set, then all namespaces in an NVM
+ subsystem shall be configured with the
+ same attributes and a format (excluding
+ secure erase) of any namespace results in
+ a format of all namespaces in an NVM
+ subsystem. If cleared, then the
+ controller supports format on a per
+ namespace basis.
``NVME_CTRL_FNA_SEC_ALL_NAMESPACES``
- *undescribed*
+ If set, then any secure erase performed
+ as part of a format operation results in
+ a secure erase of all namespaces in the
+ NVM subsystem. If cleared, then any
+ secure erase performed as part of a
+ format results in a secure erase of the
+ particular namespace specified.
``NVME_CTRL_FNA_CRYPTO_ERASE``
- *undescribed*
+ If set, then cryptographic erase is
+ supported. If cleared, then cryptographic
+ erase is not supported.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_vwc
**Constants**
``NVME_CTRL_VWC_PRESENT``
- *undescribed*
+ If set, indicates a volatile write cache is present.
+ If a volatile write cache is present, then the host
+ controls whether the volatile write cache is enabled
+ with a Set Features command specifying the value
+ ``NVME_FEAT_FID_VOLATILE_WC``.
``NVME_CTRL_VWC_FLUSH``
- *undescribed*
+ Mask to get the value of the flush command behavior.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_nvscc
+ This field indicates the configuration settings for NVM Vendor Specific command handling.
**Constants**
``NVME_CTRL_NVSCC_FMT``
- *undescribed*
+ If set, all NVM Vendor Specific Commands use the
+ format format with NDT and NDM fields.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_nwpc
+ This field indicates the optional namespace write protection capabilities supported by the controller.
**Constants**
``NVME_CTRL_NWPC_WRITE_PROTECT``
- *undescribed*
+ If set, then the controller shall
+ support the No Write Protect and
+ Write Protect namespace write
+ protection states and may support
+ the Write Protect Until Power
+ Cycle state and Permanent Write
+ Protect namespace write
+ protection states.
``NVME_CTRL_NWPC_WRITE_PROTECT_POWER_CYCLE``
- *undescribed*
+ If set, then the controller
+ supports the Write Protect Until
+ Power Cycle state.
``NVME_CTRL_NWPC_WRITE_PROTECT_PERMANENT``
- *undescribed*
+ If set, then the controller
+ supports the Permanent Write
+ Protect state.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_sgls
+ This field indicates if SGLs are supported for the NVM Command Set and the particular SGL types supported.
**Constants**
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_fcatt
+ This field indicates attributes of the controller that are specific to NVMe over Fabrics.
**Constants**
``NVME_CTRL_FCATT_DYNAMIC``
- *undescribed*
+ If cleared, then the NVM subsystem uses a dynamic
+ controller model. If set, then the NVM subsystem
+ uses a static controller model.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ctrl_ofcs
+ Indicate whether the controller supports optional fabric commands.
**Constants**
``NVME_CTRL_OFCS_DISCONNECT``
- *undescribed*
+ If set, then the controller supports the
+ Disconnect command and deletion of individual
+ I/O Queues.
.. c:type:: struct nvme_lbaf
+ LBA Format Data Structure
**Definition**
**Members**
+``ms``
+ Metadata Size indicates the number of metadata bytes provided per LBA
+ based on the LBA Data Size indicated.
+``ds``
+ LBA Data Size indicates the LBA data size supported, reported as a
+ power of two.
+
+``rp``
+ Relative Performance, see :c:type:`enum nvme_lbaf_rp <nvme_lbaf_rp>`.
-.. c:type:: enum
+.. c:type:: enum nvme_lbaf_rp
+
+ This field indicates the relative performance of the LBA format indicated relative to other LBA formats supported by the controller.
+
**Constants**
``NVME_LBAF_RP_BEST``
- *undescribed*
+ Best performance
``NVME_LBAF_RP_BETTER``
- *undescribed*
+ Better performance
``NVME_LBAF_RP_GOOD``
- *undescribed*
+ Good performance
``NVME_LBAF_RP_DEGRADED``
- *undescribed*
+ Degraded performance
``NVME_LBAF_RP_MASK``
- *undescribed*
+ Mask to get the relative performance value from the
+ field
.. c:type:: struct nvme_id_ns
+ Identify Namespace data structure
**Definition**
**Members**
+``nsze``
+ Namespace Size indicates the total size of the namespace in
+ logical blocks. The number of logical blocks is based on the
+ formatted LBA size.
+
+``ncap``
+ Namespace Capacity indicates the maximum number of logical blocks
+ that may be allocated in the namespace at any point in time. The
+ number of logical blocks is based on the formatted LBA size.
+
+``nuse``
+ Namespace Utilization indicates the current number of logical
+ blocks allocated in the namespace. This field is smaller than or
+ equal to the Namespace Capacity. The number of logical blocks is
+ based on the formatted LBA size.
+
+``nsfeat``
+ Namespace Features, see :c:type:`enum nvme_id_nsfeat <nvme_id_nsfeat>`.
+
+``nlbaf``
+ Number of LBA Formats defines the number of supported LBA data
+ size and metadata size combinations supported by the namespace
+ and the highest possible index to :c:type:`struct nvme_id_ns <nvme_id_ns>`.labf.
+
+``flbas``
+ Formatted LBA Size, see :c:type:`enum nvme_id_ns_flbas <nvme_id_ns_flbas>`.
+
+``mc``
+ Metadata Capabilities, see :c:type:`enum nvme_id_ns_mc <nvme_id_ns_mc>`.
+
+``dpc``
+ End-to-end Data Protection Capabilities, see :c:type:`enum
+ nvme_id_ns_dpc <nvme_id_ns_dpc>`.
+
+``dps``
+ End-to-end Data Protection Type Settings, see :c:type:`enum
+ nvme_id_ns_dps <nvme_id_ns_dps>`.
+
+``nmic``
+ Namespace Multi-path I/O and Namespace Sharing Capabilities, see
+ :c:type:`enum nvme_id_ns_nmic <nvme_id_ns_nmic>`.
+
+``rescap``
+ Reservation Capabilities, see :c:type:`enum nvme_id_ns_rescap <nvme_id_ns_rescap>`.
+
+``fpi``
+ Format Progress Indicator, see :c:type:`enum nvme_nd_ns_fpi <nvme_nd_ns_fpi>`.
+
+``dlfeat``
+ Deallocate Logical Block Features, see :c:type:`enum nvme_id_ns_dlfeat <nvme_id_ns_dlfeat>`.
+
+``nawun``
+ Namespace Atomic Write Unit Normal indicates the
+ namespace specific size of the write operation guaranteed to be
+ written atomically to the NVM during normal operation.
+
+``nawupf``
+ Namespace Atomic Write Unit Power Fail indicates the
+ namespace specific size of the write operation guaranteed to be
+ written atomically to the NVM during a power fail or error
+ condition.
+
+``nacwu``
+ Namespace Atomic Compare & Write Unit indicates the namespace
+ specific size of the write operation guaranteed to be written
+ atomically to the NVM for a Compare and Write fused command.
+
+``nabsn``
+ Namespace Atomic Boundary Size Normal indicates the atomic
+ boundary size for this namespace for the NAWUN value. This field
+ is specified in logical blocks.
+
+``nabo``
+ Namespace Atomic Boundary Offset indicates the LBA on this
+ namespace where the first atomic boundary starts.
+
+``nabspf``
+ Namespace Atomic Boundary Size Power Fail indicates the atomic
+ boundary size for this namespace specific to the Namespace Atomic
+ Write Unit Power Fail value. This field is specified in logical
+ blocks.
+
+``noiob``
+ Namespace Optimal I/O Boundary indicates the optimal I/O boundary
+ for this namespace. This field is specified in logical blocks.
+ The host should construct Read and Write commands that do not
+ cross the I/O boundary to achieve optimal performance.
+
+``nvmcap``
+ NVM Capacity indicates the total size of the NVM allocated to
+ this namespace. The value is in bytes.
+
+``npwg``
+ Namespace Preferred Write Granularity indicates the smallest
+ recommended write granularity in logical blocks for this
+ namespace. This is a 0's based value.
+
+``npwa``
+ Namespace Preferred Write Alignment indicates the recommended
+ write alignment in logical blocks for this namespace. This is a
+ 0's based value.
+
+``npdg``
+ Namespace Preferred Deallocate Granularity indicates the
+ recommended granularity in logical blocks for the Dataset
+ Management command with the Attribute - Deallocate bit.
+
+``npda``
+ Namespace Preferred Deallocate Alignment indicates the
+ recommended alignment in logical blocks for the Dataset
+ Management command with the Attribute - Deallocate bit
+
+``nows``
+ Namespace Optimal Write Size indicates the size in logical blocks
+ for optimal write performance for this namespace. This is a 0's
+ based value.
+
+``anagrpid``
+ ANA Group Identifier indicates the ANA Group Identifier of the
+ ANA group of which the namespace is a member.
+
+``nsattr``
+ Namespace Attributes, see :c:type:`enum nvme_id_ns_attr <nvme_id_ns_attr>`.
+
+``nvmsetid``
+ NVM Set Identifier indicates the NVM Set with which this
+ namespace is associated.
+
+``endgid``
+ Endurance Group Identifier indicates the Endurance Group with
+ which this namespace is associated.
+
+``nguid``
+ Namespace Globally Unique Identifier contains a 128-bit value
+ that is globally unique and assigned to the namespace when the
+ namespace is created. This field remains fixed throughout the
+ life of the namespace and is preserved across namespace and
+ controller operations
+
+``eui64``
+ IEEE Extended Unique Identifier contains a 64-bit IEEE Extended
+ Unique Identifier (EUI-64) that is globally unique and assigned
+ to the namespace when the namespace is created. This field
+ remains fixed throughout the life of the namespace and is
+ preserved across namespace and controller operations
+
+``lbaf``
+ LBA Format, see :c:type:`struct nvme_lbaf <nvme_lbaf>`.
+
+``vs``
+ Vendor Specific
+
-.. c:type:: enum
+.. c:type:: enum nvme_id_nsfeat
+ This field defines features of the namespace.
**Constants**
``NVME_NS_FEAT_THIN``
- *undescribed*
+ If set, indicates that the namespace supports thin
+ provisioning. Specifically, the Namespace Capacity
+ reported may be less than the Namespace Size.
``NVME_NS_FEAT_NATOMIC``
- *undescribed*
+ If set, indicates that the fields NAWUN, NAWUPF, and
+ NACWU are defined for this namespace and should be
+ used by the host for this namespace instead of the
+ AWUN, AWUPF, and ACWU fields in the Identify
+ Controller data structure.
``NVME_NS_FEAT_DULBE``
- *undescribed*
+ If set, indicates that the controller supports the
+ Deallocated or Unwritten Logical Block error for
+ this namespace. **NVME_NS_FEAT_ID_REUSE**: If set,
+ indicates that the value in the NGUID field for this
+ namespace, if non- zero, is never reused by the
+ controller and that the value in the EUI64 field for
+ this namespace, if non-zero, is never reused by the
+ controller.
``NVME_NS_FEAT_ID_REUSE``
*undescribed*
``NVME_NS_FEAT_IO_OPT``
- *undescribed*
+ If set, indicates that the fields NPWG, NPWA, NPDG,
+ NPDA, and NOWS are defined for this namespace and
+ should be used by the host for I/O optimization
-.. c:type:: enum
+.. c:type:: enum nvme_id_ns_flbas
+ This field indicates the LBA data size & metadata size combination that the namespace has been formatted with
**Constants**
``NVME_NS_FLBAS_LBA_MASK``
- *undescribed*
+ Mask to get the index of one of the 16 supported
+ LBA Formats indicated in :c:type:`struct nvme_id_ns <nvme_id_ns>`.lbaf.
``NVME_NS_FLBAS_META_EXT``
- *undescribed*
+ Applicable only if format contains metadata. If
+ this bit is set, indicates that the metadata is
+ transferred at the end of the data LBA, creating an
+ extended data LBA. If cleared, indicates that all
+ of the metadata for a command is transferred as a
+ separate contiguous buffer of data.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ns_mc
+ This field indicates the capabilities for metadata.
**Constants**
``NVME_NS_MC_EXTENDED``
- *undescribed*
+ If set, indicates the namespace supports the metadata
+ being transferred as part of a separate buffer that is
+ specified in the Metadata Pointer.
``NVME_NS_MC_SEPARATE``
- *undescribed*
+ If set, indicates that the namespace supports the
+ metadata being transferred as part of an extended data LBA.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ns_dpc
+ This field indicates the capabilities for the end-to-end data protection feature.
**Constants**
``NVME_NS_DPC_PI_TYPE1``
- *undescribed*
+ If set, indicates that the namespace supports
+ Protection Information Type 1.
``NVME_NS_DPC_PI_TYPE2``
- *undescribed*
+ If set, indicates that the namespace supports
+ Protection Information Type 2.
``NVME_NS_DPC_PI_TYPE3``
- *undescribed*
+ If set, indicates that the namespace supports
+ Protection Information Type 3.
``NVME_NS_DPC_PI_FIRST``
- *undescribed*
+ If set, indicates that the namespace supports
+ protection information transferred as the first eight
+ bytes of metadata.
``NVME_NS_DPC_PI_LAST``
- *undescribed*
+ If set, indicates that the namespace supports
+ protection information transferred as the last eight
+ bytes of metadata.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ns_dps
+ This field indicates the Type settings for the end-to-end data protection feature.
**Constants**
``NVME_NS_DPS_PI_NONE``
- *undescribed*
+ Protection information is not enabled
``NVME_NS_DPS_PI_TYPE1``
- *undescribed*
+ Protection information is enabled, Type 1
``NVME_NS_DPS_PI_TYPE2``
- *undescribed*
+ Protection information is enabled, Type 2
``NVME_NS_DPS_PI_TYPE3``
- *undescribed*
+ Protection information is enabled, Type 3
``NVME_NS_DPS_PI_MASK``
- *undescribed*
+ Mask to get the value of the PI type
``NVME_NS_DPS_PI_FIRST``
- *undescribed*
+ If set, indicates that the protection information, if
+ enabled, is transferred as the first eight bytes of
+ metadata.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ns_nmic
+ This field specifies multi-path I/O and namespace sharing capabilities of the namespace.
**Constants**
``NVME_NS_NMIC_SHARED``
- *undescribed*
+ If set, then the namespace may be attached to two or
+ more controllers in the NVM subsystem concurrently
-.. c:type:: enum
+.. c:type:: enum nvme_id_ns_rescap
+ This field indicates the reservation capabilities of the namespace.
**Constants**
``NVME_NS_RESCAP_PTPL``
- *undescribed*
+ If set, indicates that the namespace supports the
+ Persist Through Power Loss capability.
``NVME_NS_RESCAP_WE``
- *undescribed*
+ If set, indicates that the namespace supports the
+ Write Exclusive reservation type.
``NVME_NS_RESCAP_EA``
- *undescribed*
+ If set, indicates that the namespace supports the
+ Exclusive Access reservation type.
``NVME_NS_RESCAP_WERO``
- *undescribed*
+ If set, indicates that the namespace supports the
+ Write Exclusive - Registrants Only reservation type.
``NVME_NS_RESCAP_EARO``
- *undescribed*
+ If set, indicates that the namespace supports the
+ Exclusive Access - Registrants Only reservation type.
``NVME_NS_RESCAP_WEAR``
- *undescribed*
+ If set, indicates that the namespace supports the
+ Write Exclusive - All Registrants reservation type.
``NVME_NS_RESCAP_EAAR``
- *undescribed*
+ If set, indicates that the namespace supports the
+ Exclusive Access - All Registrants reservation type.
``NVME_NS_RESCAP_IEK_13``
- *undescribed*
+ If set, indicates that Ignore Existing Key is used
+ as defined in revision 1.3 or later of this specification.
-.. c:type:: enum
+.. c:type:: enum nvme_nd_ns_fpi
+ If a format operation is in progress, this field indicates the percentage of the namespace that remains to be formatted.
**Constants**
``NVME_NS_FPI_REMAINING``
- *undescribed*
+ Mask to get the format percent remaining value
``NVME_NS_FPI_SUPPORTED``
- *undescribed*
+ If set, indicates that the namespace supports the
+ Format Progress Indicator defined for the field.
-.. c:type:: enum
+.. c:type:: enum nvme_id_ns_dlfeat
+ This field indicates information about features that affect deallocating logical blocks for this namespace.
**Constants**
``NVME_NS_DLFEAT_RB``
- *undescribed*
+ Mask to get the value of the read behavior
``NVME_NS_DLFEAT_RB_NR``
- *undescribed*
+ Read behvaior is not reported
``NVME_NS_DLFEAT_RB_ALL_0S``
- *undescribed*
+ A deallocated logical block returns all bytes
+ cleared to 0h.
``NVME_NS_DLFEAT_RB_ALL_FS``
- *undescribed*
+ A deallocated logical block returns all bytes
+ set to FFh.
``NVME_NS_DLFEAT_WRITE_ZEROES``
- *undescribed*
+ If set, indicates that the controller supports
+ the Deallocate bit in the Write Zeroes command
+ for this namespace.
``NVME_NS_DLFEAT_CRC_GUARD``
- *undescribed*
+ If set, indicates that the Guard field for
+ deallocated logical blocks that contain
+ protection information is set to the CRC for
+ the value read from the deallocated logical
+ block and its metadata
-.. c:type:: enum
+.. c:type:: enum nvme_id_ns_attr
+ Specifies attributes of the namespace.
**Constants**
``NVME_NS_NSATTR_WRITE_PROTECTED``
- *undescribed*
+ If set, then the namespace is currently
+ write protected and all write access to the
+ namespace shall fail.
**Members**
+``nidt``
+ Namespace Identifier Type, see :c:type:`enum nvme_ns_id_desc_nidt <nvme_ns_id_desc_nidt>`
+``nidl``
+ Namespace Identifier Length contains the length in bytes of the
+ :c:type:`struct nvme_id_ns <nvme_id_ns>`.nid.
+``nid``
+ Namespace Identifier contains a value that is globally unique and
+ assigned to the namespace when the namespace is created. The length
+ is defined in :c:type:`struct nvme_id_ns <nvme_id_ns>`.nidl.
-.. c:type:: enum
+
+.. c:type:: enum nvme_ns_id_desc_nidt
+
+ Known namespace identifier types
+
**Constants**
``NVME_NIDT_EUI64``
- *undescribed*
+ IEEE Extended Unique Identifier, the NID field contains a
+ copy of the EUI64 field in the struct nvme_id_ns.eui64.
``NVME_NIDT_NGUID``
- *undescribed*
+ Namespace Globally Unique Identifier, the NID field
+ contains a copy of the NGUID field in struct nvme_id_ns.nguid.
``NVME_NIDT_UUID``
- *undescribed*
+ The NID field contains a 128-bit Universally Unique
+ Identifier (UUID) as specified in RFC 4122.
.. c:type:: struct nvme_nvmset_attr
+ NVM Set Attributes Entry
**Definition**
**Members**
+``id``
+ NVM Set Identifier
+
+``endurance_group_id``
+ Endurance Group Identifier
+
+``random_4k_read_typical``
+ Random 4 KiB Read Typical indicates the typical
+ time to complete a 4 KiB random read in 100
+ nanosecond units when the NVM Set is in a
+ Predictable Latency Mode Deterministic Window and
+ there is 1 outstanding command per NVM Set.
+
.. c:type:: struct nvme_id_nvmset_list
+ **nid**;
**Definition**
**Members**
+``ent``
+ ;
+
-.. c:type:: struct nvme_id_ns_granularity_list_entry
+.. c:type:: struct nvme_id_ns_granularity_desc
**Definition**
::
- struct nvme_id_ns_granularity_list_entry {
+ struct nvme_id_ns_granularity_desc {
__le64 namespace_size_granularity;
__le64 namespace_capacity_granularity;
};
__le32 attributes;
__u8 num_descriptors;
__u8 rsvd[27];
- struct nvme_id_ns_granularity_list_entry entry[16];
+ struct nvme_id_ns_granularity_desc entry[NVME_ID_ND_DESCRIPTOR_MAX];
+ __u8 rsvd288[3808];
};
**Members**
.. c:type:: struct nvme_ctrl_list
+ **num**;
**Definition**
.. c:type:: struct nvme_secondary_ctrl_list
+ **num**;
**Definition**
-**NVMe Logs**
-
-
.. c:type:: struct nvme_error_log_page
-**NVMe Directives**
-
-
.. c:type:: enum
-**NVMe Management Interface**
-
-
-
-
-.. c:type:: struct nvme_mi_read_nvm_ss_info
-
-
-**Definition**
-
-::
-
- struct nvme_mi_read_nvm_ss_info {
- __u8 nump;
- __u8 mjr;
- __u8 mnr;
- __u8 rsvd3[29];
- };
-
-**Members**
-
-
-
-.. c:type:: struct nvme_mi_port_pcie
+.. c:type:: struct nvme_feat_auto_pst
**Definition**
::
- struct nvme_mi_port_pcie {
- __u8 mps;
- __u8 sls;
- __u8 cls;
- __u8 mlw;
- __u8 nlw;
- __u8 pn;
- __u8 rsvd14[18];
+ struct nvme_feat_auto_pst {
+ __le64 apst_entry[32];
};
**Members**
-.. c:type:: struct nvme_mi_port_smb
+.. c:type:: struct nvme_timestamp
+ timestamp:
**Definition**
::
- struct nvme_mi_port_smb {
- __u8 vpd_addr;
- __u8 mvpd_freq;
- __u8 mme_addr;
- __u8 mme_freq;
- __u8 nvmebm;
- __u8 rsvd13[19];
+ struct nvme_timestamp {
+ __u8 timestamp[6];
+ __u8 attr;
+ __u8 rsvd;
};
**Members**
-.. c:type:: struct nvme_mi_read_port_info
+.. c:type:: struct nvme_lba_range_type_entry
**Definition**
::
- struct nvme_mi_read_port_info {
- __u8 portt;
- __u8 rsvd1;
- __le16 mmctptus;
- __le32 meb;
- union {
- struct nvme_mi_port_pcie pcie;
- struct nvme_mi_port_smb smb;
- };
+ struct nvme_lba_range_type_entry {
+ __u8 type;
+ __u8 attributes;
+ __u8 rsvd2[14];
+ __u64 slba;
+ __u64 nlb;
+ __u8 guid[16];
+ __u8 rsvd48[16];
};
**Members**
-``{unnamed_union}``
- anonymous
-
-
-
-
-
-.. c:type:: struct nvme_mi_read_ctrl_info
-**Definition**
-
-::
-
- struct nvme_mi_read_ctrl_info {
- __u8 portid;
- __u8 rsvd1[4];
- __u8 prii;
- __le16 pri;
- __le16 vid;
- __le16 did;
- __le16 ssvid;
- __le16 ssid;
- __u8 rsvd16[16];
- };
-
-**Members**
+.. c:type:: enum
+**Constants**
-.. c:type:: struct nvme_mi_osc
+``NVME_LBART_TYPE_GP``
+ *undescribed*
+``NVME_LBART_TYPE_FS``
+ *undescribed*
-**Definition**
+``NVME_LBART_TYPE_RAID``
+ *undescribed*
-::
+``NVME_LBART_TYPE_CACHE``
+ *undescribed*
- struct nvme_mi_osc {
- __u8 type;
- __u8 opc;
- };
+``NVME_LBART_TYPE_SWAP``
+ *undescribed*
-**Members**
+``NVME_LBART_ATTRIB_TEMP``
+ *undescribed*
+``NVME_LBART_ATTRIB_HIDE``
+ *undescribed*
-.. c:type:: struct nvme_mi_read_sc_list
+.. c:type:: struct nvme_lba_range_type
**Definition**
::
- struct nvme_mi_read_sc_list {
- __le16 numcmd;
- struct nvme_mi_osc cmds[];
+ struct nvme_lba_range_type {
+ struct nvme_lba_range_type_entry entry[NVME_FEAT_LBA_RANGE_MAX];
};
**Members**
-.. c:type:: struct nvme_mi_nvm_ss_health_status
+.. c:type:: struct nvme_plm_config
+ **ee**; **dtwinrt**; **dtwinwt**; **dtwintt**;
**Definition**
::
- struct nvme_mi_nvm_ss_health_status {
- __u8 nss;
- __u8 sw;
- __u8 ctemp;
- __u8 pdlu;
- __le16 ccs;
- __u8 rsvd8[2];
+ struct nvme_plm_config {
+ __le16 ee;
+ __u8 rsvd2[30];
+ __le64 dtwinrt;
+ __le64 dtwinwt;
+ __le64 dtwintt;
+ __u8 rsvd56[456];
};
**Members**
-.. c:type:: enum
-
-
-**Constants**
-
-``NVME_MI_CCS_RDY``
- *undescribed*
-
-``NVME_MI_CSS_CFS``
- *undescribed*
-
-``NVME_MI_CSS_SHST``
- *undescribed*
-
-``NVME_MI_CSS_NSSRO``
- *undescribed*
-
-``NVME_MI_CSS_CECO``
- *undescribed*
-
-``NVME_MI_CSS_NAC``
- *undescribed*
-
-``NVME_MI_CSS_FA``
- *undescribed*
-
-``NVME_MI_CSS_CSTS``
- *undescribed*
-
-``NVME_MI_CSS_CTEMP``
- *undescribed*
-
-``NVME_MI_CSS_PDLU``
- *undescribed*
-
-``NVME_MI_CSS_SPARE``
- *undescribed*
-
-``NVME_MI_CSS_CCWARN``
- *undescribed*
-
-
-
-
-.. c:type:: struct nvme_mi_ctrl_heal_status
+.. c:type:: struct nvme_feat_host_behavior
**Definition**
::
- struct nvme_mi_ctrl_heal_status {
- __le16 ctlid;
- __le16 csts;
- __le16 ctemp;
- __u8 pdlu;
- __u8 spare;
- __u8 cwarn;
- __u8 rsvd9[7];
+ struct nvme_feat_host_behavior {
+ __u8 acre;
+ __u8 resv1[511];
};
**Members**
**Constants**
-``NVME_MI_CSTS_RDY``
- *undescribed*
-
-``NVME_MI_CSTS_CFS``
+``NVME_ENABLE_ACRE``
*undescribed*
-``NVME_MI_CSTS_SHST``
- *undescribed*
-``NVME_MI_CSTS_NSSRO``
- *undescribed*
-``NVME_MI_CSTS_CECO``
- *undescribed*
-``NVME_MI_CSTS_NAC``
- *undescribed*
+.. c:type:: struct nvme_dsm_range
-``NVME_MI_CSTS_FA``
- *undescribed*
-``NVME_MI_CWARN_ST``
- *undescribed*
+**Definition**
-``NVME_MI_CWARN_TAUT``
- *undescribed*
+::
-``NVME_MI_CWARN_RD``
- *undescribed*
+ struct nvme_dsm_range {
+ __le32 cattr;
+ __le32 nlb;
+ __le64 slba;
+ };
-``NVME_MI_CWARN_RO``
- *undescribed*
+**Members**
-``NVME_MI_CWARN_VMBF``
- *undescribed*
-.. c:type:: struct nvme_mi_vpd_mra
+.. c:type:: struct nvme_registered_ctrl
**Definition**
::
- struct nvme_mi_vpd_mra {
- __u8 nmravn;
- __u8 ff;
- __u8 rsvd7[6];
- __u8 i18vpwr;
- __u8 m18vpwr;
- __u8 i33vpwr;
- __u8 m33vpwr;
- __u8 rsvd17;
- __u8 m33vapsr;
- __u8 i5vapsr;
- __u8 m5vapsr;
- __u8 i12vapsr;
- __u8 m12vapsr;
- __u8 mtl;
- __u8 tnvmcap[16];
- __u8 rsvd37[27];
+ struct nvme_registered_ctrl {
+ __le16 cntlid;
+ __u8 rcsts;
+ __u8 rsvd3[5];
+ __le64 hostid;
+ __le64 rkey;
};
**Members**
-.. c:type:: struct nvme_mi_vpd_ppmra
+.. c:type:: struct nvme_registered_ctrl_ext
**Definition**
::
- struct nvme_mi_vpd_ppmra {
- __u8 nppmravn;
- __u8 pn;
- __u8 ppi;
- __u8 ls;
- __u8 mlw;
- __u8 mctp;
- __u8 refccap;
- __u8 pi;
- __u8 rsvd13[3];
+ struct nvme_registered_ctrl_ext {
+ __le16 cntlid;
+ __u8 rcsts;
+ __u8 resv3[5];
+ __le64 rkey;
+ __u8 hostid[16];
+ __u8 resv32[32];
};
**Members**
-.. c:type:: struct nvme_mi_vpd_telem
+.. c:type:: struct nvme_reservation_status
+ {
**Definition**
::
- struct nvme_mi_vpd_telem {
- __u8 type;
- __u8 rev;
- __u8 len;
- __u8 data[0];
+ struct nvme_reservation_status {
+ __le32 gen;
+ __u8 rtype;
+ __u8 regctl[2];
+ __u8 rsvd7[2];
+ __u8 ptpls;
+ __u8 rsvd10[14];
+ union {
+ struct {
+ __u8 resv24[40];
+ struct nvme_registered_ctrl_ext regctl_eds[0];
+ };
+ struct nvme_registered_ctrl regctl_ds[0];
+ };
};
**Members**
+``{unnamed_union}``
+ anonymous
+``{unnamed_struct}``
+ anonymous
-.. c:type:: enum
-
-**Constants**
-``NVME_MI_ELEM_EED``
- *undescribed*
+.. c:type:: struct nvme_streams_directive_params
-``NVME_MI_ELEM_USCE``
- *undescribed*
-``NVME_MI_ELEM_ECED``
- *undescribed*
+**Definition**
-``NVME_MI_ELEM_LED``
- *undescribed*
+::
-``NVME_MI_ELEM_SMBMED``
- *undescribed*
+ struct nvme_streams_directive_params {
+ __le16 msl;
+ __le16 nssa;
+ __le16 nsso;
+ __u8 nssc;
+ __u8 rsvd[9];
+ __le32 sws;
+ __le16 sgs;
+ __le16 nsa;
+ __le16 nso;
+ __u8 rsvd2[6];
+ };
-``NVME_MI_ELEM_PCIESED``
- *undescribed*
+**Members**
-``NVME_MI_ELEM_NVMED``
- *undescribed*
-.. c:type:: struct nvme_mi_vpd_tra
+.. c:type:: struct nvme_streams_directive_status
**Definition**
::
- struct nvme_mi_vpd_tra {
- __u8 vn;
- __u8 rsvd6;
- __u8 ec;
- struct nvme_mi_vpd_telem elems[0];
+ struct nvme_streams_directive_status {
+ __le16 osc;
+ __le16 sid[];
};
**Members**
-.. c:type:: struct nvme_mi_vpd_mr_common
+.. c:type:: struct nvme_id_directives
**Definition**
::
- struct nvme_mi_vpd_mr_common {
- __u8 type;
- __u8 rf;
- __u8 rlen;
- __u8 rchksum;
- __u8 hchksum;
- union {
- struct nvme_mi_vpd_mra nmra;
- struct nvme_mi_vpd_ppmra ppmra;
- struct nvme_mi_vpd_tra tmra;
- };
+ struct nvme_id_directives {
+ __u8 supported[32];
+ __u8 enabled[32];
+ __u8 rsvd64[4032];
};
**Members**
-``{unnamed_union}``
- anonymous
+.. c:type:: enum
-.. c:type:: struct nvme_mi_vpd_hdr
+
+**Constants**
+
+``NVME_ID_DIR_ID_BIT``
+ *undescribed*
+
+``NVME_ID_DIR_SD_BIT``
+ *undescribed*
+
+
+
+
+.. c:type:: struct nvme_host_mem_buf_desc
**Definition**
::
- struct nvme_mi_vpd_hdr {
- __u8 ipmiver;
- __u8 iuaoff;
- __u8 ciaoff;
- __u8 biaoff;
- __u8 piaoff;
- __u8 mrioff;
- __u8 rsvd6;
- __u8 chchk;
- __u8 vpd[];
+ struct nvme_host_mem_buf_desc {
+ __le64 addr;
+ __le32 size;
+ __u32 rsvd;
};
**Members**
-**NVMe Features**
+.. c:type:: enum nvme_ae_type
-.. c:type:: struct nvme_feat_auto_pst
+**Constants**
+``NVME_AER_ERROR``
+ *undescribed*
-**Definition**
+``NVME_AER_SMART``
+ *undescribed*
-::
+``NVME_AER_NOTICE``
+ *undescribed*
- struct nvme_feat_auto_pst {
- __le64 apst_entry[32];
- };
+``NVME_AER_CSS``
+ *undescribed*
-**Members**
+``NVME_AER_VS``
+ *undescribed*
+.. c:type:: enum nvme_ae_info_error
-.. c:type:: struct nvme_timestamp
+**Constants**
-**Definition**
+``NVME_AER_ERROR_INVALID_DB_REG``
+ *undescribed*
-::
+``NVME_AER_ERROR_INVALID_DB_VAL``
+ *undescribed*
- struct nvme_timestamp {
- __u8 timestamp[6];
- __u8 attr;
- __u8 rsvd;
- };
+``NVME_AER_ERROR_DIAG_FAILURE``
+ *undescribed*
-**Members**
+``NVME_AER_ERROR_PERSISTENT_INTERNAL_ERROR``
+ *undescribed*
+
+``NVME_AER_ERROR_TRANSIENT_INTERNAL_ERROR``
+ *undescribed*
+``NVME_AER_ERROR_FW_IMAGE_LOAD_ERROR``
+ *undescribed*
-.. c:type:: struct nvme_lba_range_type_entry
+.. c:type:: enum nvme_ae_info_smart
-**Definition**
+**Constants**
+
+``NVME_AER_SMART_SUBSYSTEM_RELIABILITY``
+ *undescribed*
+
+``NVME_AER_SMART_TEMPERATURE_THRESHOLD``
+ *undescribed*
+
+``NVME_AER_SMART_SPARE_THRESHOLD``
+ *undescribed*
+
+
+
+
+.. c:type:: enum nvme_ae_info_css_nvm
+
-::
+**Constants**
- struct nvme_lba_range_type_entry {
- __u8 type;
- __u8 attributes;
- __u8 rsvd2[14];
- __u64 slba;
- __u64 nlb;
- __u8 guid[16];
- __u8 rsvd48[16];
- };
+``NVME_AER_CSS_NVM_RESERVATION``
+ *undescribed*
-**Members**
+``NVME_AER_CSS_NVM_SANITIZE_COMPLETED``
+ *undescribed*
+``NVME_AER_CSS_NVM_UNEXPECTED_SANITIZE_DEALLOC``
+ *undescribed*
-.. c:type:: enum
+.. c:type:: enum nvme_ae_info_notice
**Constants**
-``NVME_LBART_TYPE_GP``
+``NVME_AER_NOTICE_NS_CHANGED``
*undescribed*
-``NVME_LBART_TYPE_FS``
+``NVME_AER_NOTICE_FW_ACT_STARTING``
*undescribed*
-``NVME_LBART_TYPE_RAID``
+``NVME_AER_NOTICE_TELEMETRY``
*undescribed*
-``NVME_LBART_TYPE_CACHE``
+``NVME_AER_NOTICE_ANA``
*undescribed*
-``NVME_LBART_TYPE_SWAP``
+``NVME_AER_NOTICE_PL_EVENT``
*undescribed*
-``NVME_LBART_ATTRIB_TEMP``
+``NVME_AER_NOTICE_LBA_STATUS_ALERT``
*undescribed*
-``NVME_LBART_ATTRIB_HIDE``
+``NVME_AER_NOTICE_EG_EVENT``
+ *undescribed*
+
+``NVME_AER_NOTICE_DISC_CHANGED``
*undescribed*
-.. c:type:: struct nvme_lba_range_type
+.. c:type:: enum nvme_subsys_type
+
+
+**Constants**
+
+``NVME_NQN_DISC``
+ Discovery type target subsystem
+
+``NVME_NQN_NVME``
+ NVME type target subsystem
+
+
+
+.. c:type:: struct nvmf_disc_log_entry
+
+ Discovery log page entry
**Definition**
::
- struct nvme_lba_range_type {
- struct nvme_lba_range_type_entry entry[NVME_FEAT_LBA_RANGE_MAX];
+ struct nvmf_disc_log_entry {
+ __u8 trtype;
+ __u8 adrfam;
+ __u8 subtype;
+ __u8 treq;
+ __le16 portid;
+ __le16 cntlid;
+ __le16 asqsz;
+ __u8 resv10[22];
+ char trsvcid[NVMF_TRSVCID_SIZE];
+ __u8 resv64[192];
+ char subnqn[NVMF_NQN_FIELD_LEN];
+ char traddr[NVMF_TRADDR_SIZE];
+ union tsas {
+ char common[NVMF_TSAS_SIZE];
+ struct rdma {
+ __u8 qptype;
+ __u8 prtype;
+ __u8 cms;
+ __u8 resv3[5];
+ __u16 pkey;
+ __u8 resv10[246];
+ } rdma;
+ struct tcp {
+ __u8 sectype;
+ } tcp;
+ } tsas;
};
**Members**
-.. c:type:: struct nvme_plm_config
+.. c:type:: enum
+ Transport Type codes for Discovery Log Page entry TRTYPE field
-**Definition**
+**Constants**
-::
+``NVMF_TRTYPE_UNSPECIFIED``
+ Not indicated
- struct nvme_plm_config {
- __le16 ee;
- __u8 rsvd2[30];
- __le64 dtwinrt;
- __le64 dtwinwt;
- __le64 dtwintt;
- __u8 rsvd56[456];
- };
+``NVMF_TRTYPE_RDMA``
+ RDMA
-**Members**
+``NVMF_TRTYPE_FC``
+ Fibre Channel
+``NVMF_TRTYPE_TCP``
+ TCP
+``NVMF_TRTYPE_LOOP``
+ Reserved for host usage
+``NVMF_TRTYPE_MAX``
+ *undescribed*
-.. c:type:: struct nvme_feat_host_behavior
-**Definition**
+.. c:type:: enum
-::
+ Address Family codes for Discovery Log Page entry ADRFAM field
- struct nvme_feat_host_behavior {
- __u8 acre;
- __u8 resv1[511];
- };
+**Constants**
-**Members**
+``NVMF_ADDR_FAMILY_PCI``
+ PCIe
+
+``NVMF_ADDR_FAMILY_IP4``
+ IPv4
+
+``NVMF_ADDR_FAMILY_IP6``
+ IPv6
+
+``NVMF_ADDR_FAMILY_IB``
+ InfiniBand
+``NVMF_ADDR_FAMILY_FC``
+ Fibre Channel
.. c:type:: enum
+ Transport Requirements codes for Discovery Log Page entry TREQ field
**Constants**
-``NVME_ENABLE_ACRE``
- *undescribed*
+``NVMF_TREQ_NOT_SPECIFIED``
+ Not specified
+``NVMF_TREQ_REQUIRED``
+ Required
+``NVMF_TREQ_NOT_REQUIRED``
+ Not Required
+``NVMF_TREQ_DISABLE_SQFLOW``
+ SQ flow control disable supported
-.. c:type:: struct nvme_dsm_range
-**Definition**
-::
+.. c:type:: enum
- struct nvme_dsm_range {
- __le32 cattr;
- __le32 nlb;
- __le64 slba;
- };
+ RDMA QP Service Type codes for Discovery Log Page entry TSAS RDMA_QPTYPE field
-**Members**
+**Constants**
+``NVMF_RDMA_QPTYPE_CONNECTED``
+ Reliable Connected
+``NVMF_RDMA_QPTYPE_DATAGRAM``
+ Reliable Datagram
-.. c:type:: struct nvme_registered_ctrl
+.. c:type:: enum
-**Definition**
+ RDMA Provider Type codes for Discovery Log Page entry TSAS RDMA_PRTYPE field
-::
+**Constants**
- struct nvme_registered_ctrl {
- __le16 cntlid;
- __u8 rcsts;
- __u8 rsvd3[5];
- __le64 hostid;
- __le64 rkey;
- };
+``NVMF_RDMA_PRTYPE_NOT_SPECIFIED``
+ No Provider Specified
-**Members**
+``NVMF_RDMA_PRTYPE_IB``
+ InfiniBand
+``NVMF_RDMA_PRTYPE_ROCE``
+ InfiniBand RoCE
+``NVMF_RDMA_PRTYPE_ROCEV2``
+ InfiniBand RoCEV2
+``NVMF_RDMA_PRTYPE_IWARP``
+ iWARP
-.. c:type:: struct nvme_registered_ctrl_ext
-**Definition**
+.. c:type:: enum
-::
+ RDMA Connection Management Service Type codes for Discovery Log Page entry TSAS RDMA_CMS field
- struct nvme_registered_ctrl_ext {
- __le16 cntlid;
- __u8 rcsts;
- __u8 resv3[5];
- __le64 rkey;
- __u8 hostid[16];
- __u8 resv32[32];
- };
+**Constants**
-**Members**
+``NVMF_RDMA_CMS_RDMA_CM``
+ Sockets based endpoint addressing
+.. c:type:: enum
+
+
+**Constants**
+
+``NVMF_TCP_SECTYPE_NONE``
+ No Security
+
+``NVMF_TCP_SECTYPE_TLS``
+ Transport Layer Security
+
-.. c:type:: struct nvme_reservation_status
+
+
+.. c:type:: struct nvmf_discovery_log
**Definition**
::
- struct nvme_reservation_status {
- __le32 gen;
- __u8 rtype;
- __u8 regctl[2];
- __u8 rsvd7[2];
- __u8 ptpls;
- __u8 rsvd10[14];
- union {
- struct {
- __u8 resv24[40];
- struct nvme_registered_ctrl_ext regctl_eds[0];
- };
- struct nvme_registered_ctrl regctl_ds[0];
- };
+ struct nvmf_discovery_log {
+ __le64 genctr;
+ __le64 numrec;
+ __le16 recfmt;
+ __u8 resv14[1006];
+ struct nvmf_disc_log_entry entries[0];
};
**Members**
-``{unnamed_union}``
- anonymous
-
-``{unnamed_struct}``
- anonymous
-
-.. c:type:: struct nvme_streams_directive_params
+.. c:type:: struct nvmf_connect_data
**Definition**
::
- struct nvme_streams_directive_params {
- __le16 msl;
- __le16 nssa;
- __le16 nsso;
- __u8 nssc;
- __u8 rsvd[9];
- __le32 sws;
- __le16 sgs;
- __le16 nsa;
- __le16 nso;
- __u8 rsvd2[6];
+ struct nvmf_connect_data {
+ __u8 hostid[16];
+ __le16 cntlid;
+ char resv4[238];
+ char subsysnqn[NVMF_NQN_FIELD_LEN];
+ char hostnqn[NVMF_NQN_FIELD_LEN];
+ char resv5[256];
};
**Members**
+``cntlid``
+ **subsysnqn**
+ **hostnqn**
+
-.. c:type:: struct nvme_streams_directive_status
+.. c:type:: struct nvme_mi_read_nvm_ss_info
**Definition**
::
- struct nvme_streams_directive_status {
- __le16 osc;
- __le16 sid[];
+ struct nvme_mi_read_nvm_ss_info {
+ __u8 nump;
+ __u8 mjr;
+ __u8 mnr;
+ __u8 rsvd3[29];
};
**Members**
-.. c:type:: struct nvme_id_directives
+.. c:type:: struct nvme_mi_port_pcie
**Definition**
::
- struct nvme_id_directives {
- __u8 supported[32];
- __u8 enabled[32];
- __u8 rsvd64[4032];
+ struct nvme_mi_port_pcie {
+ __u8 mps;
+ __u8 sls;
+ __u8 cls;
+ __u8 mlw;
+ __u8 nlw;
+ __u8 pn;
+ __u8 rsvd14[18];
};
**Members**
-.. c:type:: enum
+.. c:type:: struct nvme_mi_port_smb
-**Constants**
+**Definition**
-``NVME_ID_DIR_ID_BIT``
- *undescribed*
+::
-``NVME_ID_DIR_SD_BIT``
- *undescribed*
+ struct nvme_mi_port_smb {
+ __u8 vpd_addr;
+ __u8 mvpd_freq;
+ __u8 mme_addr;
+ __u8 mme_freq;
+ __u8 nvmebm;
+ __u8 rsvd13[19];
+ };
+**Members**
-.. c:type:: struct nvme_host_mem_buf_desc
+
+
+.. c:type:: struct nvme_mi_read_port_info
**Definition**
::
- struct nvme_host_mem_buf_desc {
- __le64 addr;
- __le32 size;
- __u32 rsvd;
+ struct nvme_mi_read_port_info {
+ __u8 portt;
+ __u8 rsvd1;
+ __le16 mmctptus;
+ __le32 meb;
+ union {
+ struct nvme_mi_port_pcie pcie;
+ struct nvme_mi_port_smb smb;
+ };
};
**Members**
+``portt``
+ **mmctptus**;
+``{unnamed_union}``
+ anonymous
-.. c:type:: enum nvme_ae_type
-**Constants**
+.. c:type:: struct nvme_mi_read_ctrl_info
-``NVME_AER_ERROR``
- *undescribed*
+ **portid**; **prii**; **pri**; **vid**; **did**; **ssvid**; **ssid**;
-``NVME_AER_SMART``
- *undescribed*
+**Definition**
-``NVME_AER_NOTICE``
- *undescribed*
+::
-``NVME_AER_CSS``
- *undescribed*
+ struct nvme_mi_read_ctrl_info {
+ __u8 portid;
+ __u8 rsvd1[4];
+ __u8 prii;
+ __le16 pri;
+ __le16 vid;
+ __le16 did;
+ __le16 ssvid;
+ __le16 ssid;
+ __u8 rsvd16[16];
+ };
-``NVME_AER_VS``
- *undescribed*
+**Members**
-.. c:type:: enum nvme_ae_info_error
+.. c:type:: struct nvme_mi_osc
-**Constants**
+ **type**; **opc**;
-``NVME_AER_ERROR_INVALID_DB_REG``
- *undescribed*
+**Definition**
-``NVME_AER_ERROR_INVALID_DB_VAL``
- *undescribed*
+::
-``NVME_AER_ERROR_DIAG_FAILURE``
- *undescribed*
+ struct nvme_mi_osc {
+ __u8 type;
+ __u8 opc;
+ };
-``NVME_AER_ERROR_PERSISTENT_INTERNAL_ERROR``
- *undescribed*
+**Members**
-``NVME_AER_ERROR_TRANSIENT_INTERNAL_ERROR``
- *undescribed*
-``NVME_AER_ERROR_FW_IMAGE_LOAD_ERROR``
- *undescribed*
+.. c:type:: struct nvme_mi_read_sc_list
-.. c:type:: enum nvme_ae_info_smart
+**Definition**
-**Constants**
+::
-``NVME_AER_SMART_SUBSYSTEM_RELIABILITY``
- *undescribed*
+ struct nvme_mi_read_sc_list {
+ __le16 numcmd;
+ struct nvme_mi_osc cmds[];
+ };
-``NVME_AER_SMART_TEMPERATURE_THRESHOLD``
- *undescribed*
+**Members**
-``NVME_AER_SMART_SPARE_THRESHOLD``
- *undescribed*
-.. c:type:: enum nvme_ae_info_css_nvm
+.. c:type:: struct nvme_mi_nvm_ss_health_status
-**Constants**
+**Definition**
-``NVME_AER_CSS_NVM_RESERVATION``
- *undescribed*
+::
-``NVME_AER_CSS_NVM_SANITIZE_COMPLETED``
- *undescribed*
+ struct nvme_mi_nvm_ss_health_status {
+ __u8 nss;
+ __u8 sw;
+ __u8 ctemp;
+ __u8 pdlu;
+ __le16 ccs;
+ __u8 rsvd8[2];
+ };
-``NVME_AER_CSS_NVM_UNEXPECTED_SANITIZE_DEALLOC``
- *undescribed*
+**Members**
-.. c:type:: enum nvme_ae_info_notice
+
+.. c:type:: enum
**Constants**
-``NVME_AER_NOTICE_NS_CHANGED``
+``NVME_MI_CCS_RDY``
*undescribed*
-``NVME_AER_NOTICE_FW_ACT_STARTING``
+``NVME_MI_CSS_CFS``
*undescribed*
-``NVME_AER_NOTICE_TELEMETRY``
+``NVME_MI_CSS_SHST``
*undescribed*
-``NVME_AER_NOTICE_ANA``
+``NVME_MI_CSS_NSSRO``
*undescribed*
-``NVME_AER_NOTICE_PL_EVENT``
+``NVME_MI_CSS_CECO``
*undescribed*
-``NVME_AER_NOTICE_LBA_STATUS_ALERT``
+``NVME_MI_CSS_NAC``
*undescribed*
-``NVME_AER_NOTICE_EG_EVENT``
+``NVME_MI_CSS_FA``
*undescribed*
-``NVME_AER_NOTICE_DISC_CHANGED``
+``NVME_MI_CSS_CSTS``
*undescribed*
+``NVME_MI_CSS_CTEMP``
+ *undescribed*
+``NVME_MI_CSS_PDLU``
+ *undescribed*
+``NVME_MI_CSS_SPARE``
+ *undescribed*
-.. c:type:: enum nvme_subsys_type
-
-
-**Constants**
-
-``NVME_NQN_DISC``
- Discovery type target subsystem
-
-``NVME_NQN_NVME``
- NVME type target subsystem
+``NVME_MI_CSS_CCWARN``
+ *undescribed*
-.. c:type:: struct nvmf_disc_log_entry
+.. c:type:: struct nvme_mi_ctrl_heal_status
**Definition**
::
- struct nvmf_disc_log_entry {
- __u8 trtype;
- __u8 adrfam;
- __u8 subtype;
- __u8 treq;
- __le16 portid;
- __le16 cntlid;
- __le16 asqsz;
- __u8 resv10[22];
- char trsvcid[NVMF_TRSVCID_SIZE];
- __u8 resv64[192];
- char subnqn[NVMF_NQN_FIELD_LEN];
- char traddr[NVMF_TRADDR_SIZE];
- union tsas {
- char common[NVMF_TSAS_SIZE];
- struct rdma {
- __u8 qptype;
- __u8 prtype;
- __u8 cms;
- __u8 resv3[5];
- __u16 pkey;
- __u8 resv10[246];
- } rdma;
- struct tcp {
- __u8 sectype;
- } tcp;
- } tsas;
+ struct nvme_mi_ctrl_heal_status {
+ __le16 ctlid;
+ __le16 csts;
+ __le16 ctemp;
+ __u8 pdlu;
+ __u8 spare;
+ __u8 cwarn;
+ __u8 rsvd9[7];
};
**Members**
-**Description**
-
-
-Discovery log page entry
-
**Constants**
-``NVMF_TRTYPE_UNSPECIFIED``
- Not indicated
-
-``NVMF_TRTYPE_RDMA``
- RDMA
-
-``NVMF_TRTYPE_FC``
- Fibre Channel
-
-``NVMF_TRTYPE_TCP``
- TCP
-
-``NVMF_TRTYPE_LOOP``
- Reserved for host usage
-
-``NVMF_TRTYPE_MAX``
+``NVME_MI_CSTS_RDY``
*undescribed*
-**Description**
-
-Transport Type codes for Discovery Log Page entry TRTYPE field
-
-
+``NVME_MI_CSTS_CFS``
+ *undescribed*
+``NVME_MI_CSTS_SHST``
+ *undescribed*
-.. c:type:: enum
+``NVME_MI_CSTS_NSSRO``
+ *undescribed*
+``NVME_MI_CSTS_CECO``
+ *undescribed*
-**Constants**
+``NVME_MI_CSTS_NAC``
+ *undescribed*
-``NVMF_ADDR_FAMILY_PCI``
- PCIe
+``NVME_MI_CSTS_FA``
+ *undescribed*
-``NVMF_ADDR_FAMILY_IP4``
- IPv4
+``NVME_MI_CWARN_ST``
+ *undescribed*
-``NVMF_ADDR_FAMILY_IP6``
- IPv6
+``NVME_MI_CWARN_TAUT``
+ *undescribed*
-``NVMF_ADDR_FAMILY_IB``
- InfiniBand
+``NVME_MI_CWARN_RD``
+ *undescribed*
-``NVMF_ADDR_FAMILY_FC``
- Fibre Channel
+``NVME_MI_CWARN_RO``
+ *undescribed*
-**Description**
+``NVME_MI_CWARN_VMBF``
+ *undescribed*
-Address Family codes for Discovery Log Page entry ADRFAM field
+.. c:type:: struct nvme_mi_vpd_mra
-.. c:type:: enum
+ **nmravn**; **ff**; **i18vpwr**; **m18vpwr**; **i33vpwr**; **m33vpwr**; **m33vapsr**; **i5vapsr**; **m5vapsr**; **i12vapsr**; **m12vapsr**; **mtl**; **tnvmcap**[16];
+**Definition**
-**Constants**
+::
-``NVMF_TREQ_NOT_SPECIFIED``
- Not specified
+ struct nvme_mi_vpd_mra {
+ __u8 nmravn;
+ __u8 ff;
+ __u8 rsvd7[6];
+ __u8 i18vpwr;
+ __u8 m18vpwr;
+ __u8 i33vpwr;
+ __u8 m33vpwr;
+ __u8 rsvd17;
+ __u8 m33vapsr;
+ __u8 i5vapsr;
+ __u8 m5vapsr;
+ __u8 i12vapsr;
+ __u8 m12vapsr;
+ __u8 mtl;
+ __u8 tnvmcap[16];
+ __u8 rsvd37[27];
+ };
-``NVMF_TREQ_REQUIRED``
- Required
+**Members**
-``NVMF_TREQ_NOT_REQUIRED``
- Not Required
-``NVMF_TREQ_DISABLE_SQFLOW``
- SQ flow control disable supported
-**Description**
-Transport Requirements codes for Discovery Log Page entry TREQ field
+.. c:type:: struct nvme_mi_vpd_ppmra
+**Definition**
-.. c:type:: enum
+::
+ struct nvme_mi_vpd_ppmra {
+ __u8 nppmravn;
+ __u8 pn;
+ __u8 ppi;
+ __u8 ls;
+ __u8 mlw;
+ __u8 mctp;
+ __u8 refccap;
+ __u8 pi;
+ __u8 rsvd13[3];
+ };
-**Constants**
+**Members**
-``NVMF_RDMA_QPTYPE_CONNECTED``
- Reliable Connected
-``NVMF_RDMA_QPTYPE_DATAGRAM``
- Reliable Datagram
-**Description**
-RDMA QP Service Type codes for Discovery Log Page entry TSAS
-RDMA_QPTYPE field
+.. c:type:: struct nvme_mi_vpd_telem
+**Definition**
-.. c:type:: enum
+::
+ struct nvme_mi_vpd_telem {
+ __u8 type;
+ __u8 rev;
+ __u8 len;
+ __u8 data[0];
+ };
-**Constants**
+**Members**
-``NVMF_RDMA_PRTYPE_NOT_SPECIFIED``
- No Provider Specified
-``NVMF_RDMA_PRTYPE_IB``
- InfiniBand
-``NVMF_RDMA_PRTYPE_ROCE``
- InfiniBand RoCE
-``NVMF_RDMA_PRTYPE_ROCEV2``
- InfiniBand RoCEV2
-``NVMF_RDMA_PRTYPE_IWARP``
- iWARP
+.. c:type:: enum
-**Description**
-RDMA Provider Type codes for Discovery Log Page entry TSAS
-RDMA_PRTYPE field
+**Constants**
+``NVME_MI_ELEM_EED``
+ *undescribed*
+``NVME_MI_ELEM_USCE``
+ *undescribed*
+``NVME_MI_ELEM_ECED``
+ *undescribed*
-.. c:type:: enum
+``NVME_MI_ELEM_LED``
+ *undescribed*
+``NVME_MI_ELEM_SMBMED``
+ *undescribed*
-**Constants**
+``NVME_MI_ELEM_PCIESED``
+ *undescribed*
-``NVMF_RDMA_CMS_RDMA_CM``
- Sockets based endpoint addressing
+``NVME_MI_ELEM_NVMED``
+ *undescribed*
-**Description**
-RDMA Connection Management Service Type codes for Discovery Log Page
-entry TSAS RDMA_CMS field
+.. c:type:: struct nvme_mi_vpd_tra
-.. c:type:: enum
+**Definition**
+::
-**Constants**
+ struct nvme_mi_vpd_tra {
+ __u8 vn;
+ __u8 rsvd6;
+ __u8 ec;
+ struct nvme_mi_vpd_telem elems[0];
+ };
-``NVMF_TCP_SECTYPE_NONE``
- No Security
+**Members**
-``NVMF_TCP_SECTYPE_TLS``
- Transport Layer Security
-.. c:type:: struct nvmf_discovery_log
+.. c:type:: struct nvme_mi_vpd_mr_common
+ **type**; **rf**; **rlen**; **rchksum**; **hchksum**; **ppmra**; **tmra**;
**Definition**
::
- struct nvmf_discovery_log {
- __le64 genctr;
- __le64 numrec;
- __le16 recfmt;
- __u8 resv14[1006];
- struct nvmf_disc_log_entry entries[0];
+ struct nvme_mi_vpd_mr_common {
+ __u8 type;
+ __u8 rf;
+ __u8 rlen;
+ __u8 rchksum;
+ __u8 hchksum;
+ union {
+ struct nvme_mi_vpd_mra nmra;
+ struct nvme_mi_vpd_ppmra ppmra;
+ struct nvme_mi_vpd_tra tmra;
+ };
};
**Members**
+``{unnamed_union}``
+ anonymous
-.. c:type:: struct nvmf_connect_data
+
+.. c:type:: struct nvme_mi_vpd_hdr
**Definition**
::
- struct nvmf_connect_data {
- __u8 hostid[16];
- __le16 cntlid;
- char resv4[238];
- char subsysnqn[NVMF_NQN_FIELD_LEN];
- char hostnqn[NVMF_NQN_FIELD_LEN];
- char resv5[256];
+ struct nvme_mi_vpd_hdr {
+ __u8 ipmiver;
+ __u8 iuaoff;
+ __u8 ciaoff;
+ __u8 biaoff;
+ __u8 piaoff;
+ __u8 mrioff;
+ __u8 rsvd6;
+ __u8 chchk;
+ __u8 vpd[];
};
**Members**
*undescribed*
-.. c:function:: __u8 nvme_status_type (__u16 status)
+.. c:function:: __u8 nvme_status_to_errno (int status, bool fabrics)
- Returns SCT(Status Code Type) in status field of the completion queue entry.
+ Converts nvme return status to errno
**Parameters**
-``__u16 status``
- return value from nvme passthrough commands, which is the nvme
- status field, located at DW3 in completion queue entry
-
+``int status``
+ Return status from an nvme passthrough commmand
-.. c:function:: const char * nvme_status_to_string (int status, bool fabrics)
+``bool fabrics``
+ true if given status is for fabrics
+**Description**
-**Parameters**
+If status < 0, errno is already set.
-``int status``
- *undescribed*
+**Return**
-``bool fabrics``
- *undescribed*
+Appropriate errno for the given nvme status
.. c:function:: int nvme_fw_download_seq (int fd, __u32 size, __u32 xfer, __u32 offset, void * buf)
*undescribed*
``void * buf``
- *undescribed*
-.. c:function:: int nvme_get_telemetry_log (int fd, bool create, bool ctrl, int data_area, void ** buf, __u32 * log_size)
+.. c:function:: int nvme_get_ctrl_telemetry (int fd, bool rae, void ** buf, __u32 * log_size)
**Parameters**
``int fd``
*undescribed*
-``bool create``
+``bool rae``
*undescribed*
-``bool ctrl``
+``void ** buf``
*undescribed*
-``int data_area``
+``__u32 * log_size``
+
+
+.. c:function:: int nvme_get_host_telemetry (int fd, void ** buf, __u32 * log_size)
+
+
+**Parameters**
+
+``int fd``
*undescribed*
``void ** buf``
*undescribed*
``__u32 * log_size``
+
+
+.. c:function:: int nvme_get_new_host_telemetry (int fd, void ** buf, __u32 * log_size)
+
+
+**Parameters**
+
+``int fd``
+ *undescribed*
+
+``void ** buf``
*undescribed*
+``__u32 * log_size``
+
.. c:function:: void nvme_setup_id_ns (struct nvme_id_ns * ns, __u64 nsze, __u64 ncap, __u8 flbas, __u8 dps, __u8 nmic, __u32 anagrpid, __u16 nvmsetid)
.. c:function:: int nvme_get_ana_log_len (int fd, size_t * analen)
+ Retreive size of the current ANA log
**Parameters**
``int fd``
- *undescribed*
+ File descriptor of nvme device
``size_t * analen``
- *undescribed*
+ Pointer to where the length will be set on success
+
+**Return**
+
+0 on success, -1 otherwise with errno set
.. c:function:: int nvme_namespace_attach_ctrls (int fd, __u32 nsid, __u16 num_ctrls, __u16 * ctrlist)
**Return**
-The nvme command status if a response was received or -errno
- otherwise.
+The nvme command status if a response was received or -1
+ with errno set otherwise.
.. c:function:: int nvme_namespace_detach_ctrls (int fd, __u32 nsid, __u16 num_ctrls, __u16 * ctrlist)
**Return**
-The nvme command status if a response was received or -errno
- otherwise.
+The nvme command status if a response was received or -1
+ with errno set otherwise.
.. c:function:: int nvme_get_feature_length (int fid, __u32 cdw11, __u32 * len)
+ Retreive the command payload length for a specific feature identifier
**Parameters**
*undescribed*
``__u32 * len``
- *undescribed*
+
+**Return**
+
+0 on success, -1 with errno set otherwise
-.. c:function:: int nvme_get_directive_receive_length (__u8 dtype, __u8 doper, __u32 * len)
+.. c:function:: int nvme_get_directive_receive_length (enum nvme_directive_dtype dtype, enum nvme_directive_receive_doper doper, __u32 * len)
**Parameters**
-``__u8 dtype``
- *undescribed*
+``enum nvme_directive_dtype dtype``
+ Directive type, see :c:type:`enum nvme_directive_dtype <nvme_directive_dtype>`
-``__u8 doper``
- *undescribed*
+``enum nvme_directive_receive_doper doper``
+ Directive receive operation, see :c:type:`enum nvme_directive_receive_doper <nvme_directive_receive_doper>`
``__u32 * len``
- *undescribed*
+ Address to save the payload length of the directive in bytes on
+ a successful decode
+
+**Return**
+
+0 on success, -1 with errno set to EINVAL.
.. c:function:: int nvme_open (const char * name)
errno set otherwise.
+.. c:function:: int nvme_set_attr (const char * dir, const char * attr, const char * value)
+
+
+**Parameters**
+
+``const char * dir``
+ *undescribed*
+
+``const char * attr``
+ *undescribed*
+
+``const char * value``
+
+**Description**
+
+Return
+
+