*
* Uses NVME_IOCTL_ADMIN64_CMD for the ioctl request.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_submit_admin_passthru64(int fd, struct nvme_passthru_cmd64 *cmd,
__u64 *result);
*
* Known values for @opcode are defined in &enum nvme_admin_opcode.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_admin_passthru64(int fd, __u8 opcode, __u8 flags, __u16 rsvd,
__u32 nsid, __u32 cdw2, __u32 cdw3, __u32 cdw10, __u32 cdw11,
*
* Uses NVME_IOCTL_ADMIN_CMD for the ioctl request.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_submit_admin_passthru(int fd, struct nvme_passthru_cmd *cmd,
__u32 *result);
*
* Known values for @opcode are defined in &enum nvme_admin_opcode.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_admin_passthru(int fd, __u8 opcode, __u8 flags, __u16 rsvd,
__u32 nsid, __u32 cdw2, __u32 cdw3, __u32 cdw10, __u32 cdw11,
*
* 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.
+ * Return: The nvme command status if a response was received (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_submit_io_passthru64(int fd, struct nvme_passthru_cmd64 *cmd,
__u64 *result);
*
* Known values for @opcode are defined in &enum nvme_io_opcode.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_io_passthru64(int fd, __u8 opcode, __u8 flags, __u16 rsvd,
__u32 nsid, __u32 cdw2, __u32 cdw3, __u32 cdw10, __u32 cdw11,
*
* 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.
+ * Return: The nvme command status if a response was received (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_submit_io_passthru(int fd, struct nvme_passthru_cmd *cmd,
__u32 *result);
*
* Known values for @opcode are defined in &enum nvme_io_opcode.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_io_passthru(int fd, __u8 opcode, __u8 flags, __u16 rsvd,
__u32 nsid, __u32 cdw2, __u32 cdw3, __u32 cdw10, __u32 cdw11,
*/
int nvme_get_nsid(int fd);
-/**
- * DOC: NVMe Admin command enums
- */
-
/**
* enum nvme_admin_opcode - Known NVMe admin opcodes
* @nvme_admin_delete_sq:
* The Identify command returns a data buffer that describes information about
* the NVM subsystem, the controller or the namespace(s).
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_identify(int fd, enum nvme_identify_cns cns, __u32 nsid,
__u16 cntid, __u16 nvmsetid, __u8 uuidx, void *data);
*
* See &struct nvme_id_ctrl for details on the data returned.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_identify_ctrl(int fd, struct nvme_id_ctrl *id);
*
* See &struct nvme_id_ns for details on the structure returned.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_identify_ns(int fd, __u32 nsid, struct nvme_id_ns *ns);
* @nsid: Namespace to identify
* @ns: User space destination address to transfer the data
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_identify_allocated_ns(int fd, __u32 nsid, struct nvme_id_ns *ns);
*
* See &struct nvme_ns_list for the definition of the returned structure.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_identify_active_ns_list(int fd, __u32 nsid, struct nvme_ns_list *list);
*
* See &struct nvme_ns_list for the definition of the returned structure.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_identify_allocated_ns_list(int fd, __u32 nsid,
struct nvme_ns_list *list);
*
* See &struct 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.
+ * Return: The nvme command status if a response was received (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_identify_ctrl_list(int fd, __u16 cntid,
struct nvme_ctrl_list *ctrlist);
*
* See &struct nvme_ctrl_list for a definition of the structure returned.
*
- * Return: The nvme command status if a response was received or -1
+ * Return: The nvme command status if a response was received (see &enum
+ * nvme_status_field) or -1
*/
int nvme_identify_nsid_ctrl_list(int fd, __u32 nsid, __u16 cntid,
struct nvme_ctrl_list *ctrlist);
*
* See &struct nvme_ns_id_desc for the definition of the returned structure.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_identify_ns_descs(int fd, __u32 nsid, struct nvme_ns_id_desc *descs);
*
* See &struct nvme_id_nvmset_list for the defintion of the returned structure.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_identify_nvmset_list(int fd, __u16 nvmsetid,
struct nvme_id_nvmset_list *nvmset);
*
* See &struct nvme_primary_ctrl_cap for the defintion of the returned structure, @cap.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_identify_primary_ctrl(int fd, __u16 cntid,
struct nvme_primary_ctrl_cap *cap);
* See &struct nvme_secondary_ctrls_list for a defintion of the returned
* structure.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_identify_secondary_ctrl_list(int fd, __u16 cntid,
struct nvme_secondary_ctrl_list *list);
* See &struct nvme_id_ns_granularity_list for the definition of the returned
* structure.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_identify_ns_granularity(int fd, struct nvme_id_ns_granularity_list *list);
*
* See &struct nvme_id_uuid_list for the definition of the returned structure.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_identify_uuid(int fd, struct nvme_id_uuid_list *list);
* @len: Length of provided user buffer to hold the log data in bytes
* @log: User space destination address to transfer the data
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
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);
* 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.
+ * Return: The nvme command status if a response was received (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_log_error(int fd, unsigned nr_entries, bool rae,
struct nvme_error_log_page *log);
* 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: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_log_smart(int fd, __u32 nsid, bool rae, struct nvme_smart_log *log);
* 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.
+ * Return: The nvme command status if a response was received (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_log_fw_slot(int fd, bool rae, struct nvme_firmware_slot *log);
* that have changed since the last time the namespace was identified, been
* added, or deleted.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_log_changed_ns_list(int fd, bool rae, struct nvme_ns_list *log);
* 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.
+ * Return: The nvme command status if a response was received (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_log_cmd_effects(int fd, struct nvme_cmd_effects_log *log);
* the percent complete of that operation, and the results of the previous 20
* self-test operations.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_log_device_self_test(int fd, struct nvme_self_test_log *log);
* Retreives the Telemetry Host-Initiated log page at the requested offset
* using the previously existing capture.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_log_telemetry_host(int fd, __u64 offset, __u32 len, void *log);
* generated when an entry for an Endurance Group is newly added to this log
* page.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_log_endurance_group(int fd, __u16 endgid,
struct nvme_endurance_group_log *log);
* @fd:
* @nvmsetid:
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_log_predictable_lat_nvmset(int fd, __u16 nvmsetid,
struct nvme_nvmset_predictable_lat_log *log);
*
* See &struct nvme_ana_rsp_hdr for the defintion of the returned structure.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_log_ana(int fd, enum nvme_log_ana_lsp lsp, bool rae, __u64 offset,
__u32 len, void *log);
* 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.
+ * Return: The nvme command status if a response was received (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_log_discovery(int fd, bool rae, __u32 offset, __u32 len, void *log);
* The Sanitize Status log page is used to report sanitize operation time
* estimates and information about the most recent sanitize operation.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_log_sanitize(int fd, bool rae,
struct nvme_sanitize_log_page *log);
* @data: User address of feature data, if applicable
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features(int fd, __u8 fid, __u32 nsid, __u32 cdw11, __u32 cdw12,
bool save, __u8 uuidx, __u32 cdw15, __u32 data_len,
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_arbitration(int fd, __u8 ab, __u8 lpw, __u8 mpw,
__u8 hpw, bool save, __u32 *result);
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_power_mgmt(int fd, __u8 ps, __u8 wh, bool save,
__u32 *result);
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_lba_range(int fd, __u32 nsid, __u32 nr_ranges, bool save,
struct nvme_lba_range_type *data, __u32 *result);
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_temp_thresh(int fd, __u16 tmpth, __u8 tmpsel,
enum nvme_feat_tmpthresh_thsel thsel,
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_err_recovery(int fd, __u32 nsid, __u16 tler,
bool dulbe, bool save, __u32 *result);
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_volatile_wc(int fd, bool wce, bool save,
__u32 *result);
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_irq_coalesce(int fd, __u8 thr, __u8 time,
bool save, __u32 *result);
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_irq_config(int fd, __u16 iv, bool cd, bool save,
__u32 *result);
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_write_atomic(int fd, bool dn, bool save,
__u32 *result);
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_async_event(int fd, __u32 events, bool save,
__u32 *result);
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_auto_pst(int fd, bool apste, bool save,
struct nvme_feat_auto_pst *apst,
* @save: Save value across power states
* @timestamp: The current timestamp value to assign to this this feature
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_timestamp(int fd, bool save, __u64 timestamp);
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_hctm(int fd, __u16 tmt2, __u16 tmt1, bool save,
__u32 *result);
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_rrl(int fd, __u8 rrl, __u16 nvmsetid, bool save,
__u32 *result);
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_plm_config(int fd, bool enable, __u16 nvmsetid,
bool save, struct nvme_plm_config *data,
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_plm_window(int fd, enum nvme_feat_plm_window_select sel,
__u16 nvmsetid, bool save, __u32 *result);
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_lba_sts_interval(int fd, __u16 lsiri, __u16 lsipi,
bool save, __u32 *result);
* @fd: File descriptor of nvme device
* @save: Save value across power states
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_host_behavior(int fd, bool save,
struct nvme_feat_host_behavior *data);
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_sanitize(int fd, bool nodrm, bool save, __u32 *result);
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_endurance_evt_cfg(int fd, __u16 endgid, __u8 egwarn,
bool save, __u32 *result);
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_sw_progress(int fd, __u8 pbslc, bool save,
__u32 *result);
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_host_id(int fd, bool exhid, bool save, __u8 *hostid);
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_resv_mask(int fd, __u32 mask, bool save, __u32 *result);
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_resv_persist(int fd, bool ptpl, bool save, __u32 *result);
* @save: Save value across power states
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_features_write_protect(int fd, enum nvme_feat_nswpcfg_state state,
bool save, __u32 *result);
* @data: User address of feature data, if applicable
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features(int fd, enum nvme_features_id fid, __u32 nsid,
enum nvme_get_features_sel sel, __u32 cdw11, __u8 uuidx,
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_arbitration(int fd, enum nvme_get_features_sel sel,
__u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_power_mgmt(int fd, enum nvme_get_features_sel sel,
__u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_lba_range(int fd, enum nvme_get_features_sel sel,
struct nvme_lba_range_type *data,
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_temp_thresh(int fd, enum nvme_get_features_sel sel,
__u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_err_recovery(int fd, enum nvme_get_features_sel sel,
__u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_volatile_wc(int fd, enum nvme_get_features_sel sel,
__u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_num_queues(int fd, enum nvme_get_features_sel sel,
__u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_irq_coalesce(int fd, enum nvme_get_features_sel sel,
__u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_irq_config(int fd, enum nvme_get_features_sel sel,
__u16 iv, __u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_write_atomic(int fd, enum nvme_get_features_sel sel,
__u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_async_event(int fd, enum nvme_get_features_sel sel,
__u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_auto_pst(int fd, enum nvme_get_features_sel sel,
struct nvme_feat_auto_pst *apst, __u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_host_mem_buf(int fd, enum nvme_get_features_sel sel,
__u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_timestamp(int fd, enum nvme_get_features_sel sel,
struct nvme_timestamp *ts);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_kato(int fd, enum nvme_get_features_sel sel, __u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_hctm(int fd, enum nvme_get_features_sel sel, __u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_nopsc(int fd, enum nvme_get_features_sel sel, __u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_rrl(int fd, enum nvme_get_features_sel sel, __u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_plm_config(int fd, enum nvme_get_features_sel sel,
__u16 nvmsetid, struct nvme_plm_config *data,
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_plm_window(int fd, enum nvme_get_features_sel sel,
__u16 nvmsetid, __u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_lba_sts_interval(int fd, enum nvme_get_features_sel sel,
__u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_host_behavior(int fd, enum nvme_get_features_sel sel,
struct nvme_feat_host_behavior *data,
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_sanitize(int fd, enum nvme_get_features_sel sel,
__u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_endurance_event_cfg(int fd, enum nvme_get_features_sel sel,
__u16 endgid, __u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_sw_progress(int fd, enum nvme_get_features_sel sel,
__u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_host_id(int fd, enum nvme_get_features_sel sel,
bool exhid, __u32 len, __u8 *hostid);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_resv_mask(int fd, enum nvme_get_features_sel sel,
__u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_resv_persist(int fd, enum nvme_get_features_sel sel,
__u32 *result);
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_features_write_protect(int fd, __u32 nsid,
enum nvme_get_features_sel sel,
* 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: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_format_nvm(int fd, __u32 nsid, __u8 lbaf,
enum nvme_cmd_format_mset mset,
* attached to any controller. Use the nvme_ns_attach_ctrls() to assign the
* namespace to one or more controllers.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_ns_mgmt_create(int fd, struct nvme_id_ns *ns, __u32 *nsid,
__u32 timeout);
* controller. Use the nvme_ns_detach_ctrls() first if the namespace is still
* attached.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_ns_mgmt_delete(int fd, __u32 nsid);
int nvme_ns_attach_ctrls(int fd, __u32 nsid, struct nvme_ctrl_list *ctrlist);
/**
- * nvme_ns_dettach_ctrls() -
+ * nvme_ns_detach_ctrls() -
* @fd: File descriptor of nvme device
- * @nsid: Namespace ID to dettach
+ * @nsid: Namespace ID to detach
* @ctrlist: Controller list to modify attachment state of nsid
*/
-int nvme_ns_dettach_ctrls(int fd, __u32 nsid, struct nvme_ctrl_list *ctrlist);
+int nvme_ns_detach_ctrls(int fd, __u32 nsid, struct nvme_ctrl_list *ctrlist);
/**
* nvme_fw_download() - Download part or all of a firmware image to the
* Download command. Use the nvme_fw_commit() to activate a newly downloaded
* image.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_fw_download(int fd, __u32 offset, __u32 data_len, void *data);
* The Firmware Commit command is used to modify the firmware image or Boot
* Partitions.
*
- * Return: The nvme command status if a response was received or -1 with errno
- * set otherwise. The command status response may specify additional
+ * Return: The nvme command status if a response was received (see &enum
+ * nvme_status_field) or -1 with errno set otherwise. The command status
+ * response may specify additional
* reset actions required to complete the commit process.
*/
int nvme_fw_commit(int fd, __u8 slot, enum nvme_fw_commit_ca action, bool bpid);
* 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.
+ * Return: The nvme command status if a response was received (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_security_send(int fd, __u32 nsid, __u8 nssf, __u8 spsp0, __u8 spsp1,
__u8 secp, __u32 tl, __u32 data_len, void *data,
* @data: Security data payload to send
* @result: The command completion result from CQE dword0
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_security_receive(int fd, __u32 nsid, __u8 nssf, __u8 spsp0,
__u8 spsp1, __u8 secp, __u32 al, __u32 data_len,
* The Get LBA Status command requests information about Potentially
* Unrecoverable LBAs. Refer to the specification for action type descriptions.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_lba_status(int fd, __u32 nsid, __u64 slba, __u32 mndw, __u16 rl,
enum nvme_lba_status_atype atype,
*
* See the NVMe specification for more information.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_directive_send(int fd, __u32 nsid, __u16 dspec,
enum nvme_directive_send_doper doper,
* @fd: File descriptor of nvme device
* @nsid: Namespace ID
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_directive_send_id_endir(int fd, __u32 nsid, bool endir,
enum nvme_directive_dtype dtype,
* @fd: File descriptor of nvme device
* @nsid: Namespace ID
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_directive_send_stream_release_identifier(int fd, __u32 nsid,
__u16 stream_id);
* @fd: File descriptor of nvme device
* @nsid: Namespace ID
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_directive_send_stream_release_resource(int fd, __u32 nsid);
* @data: Usespace address of data payload in bytes
* @result: If successful, the CQE dword0 value
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_directive_recv(int fd, __u32 nsid, __u16 dspec,
enum nvme_directive_receive_doper doper,
* @fd: File descriptor of nvme device
* @nsid: Namespace ID
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_directive_recv_identify_parameters(int fd, __u32 nsid,
struct nvme_id_directives *id);
* @fd: File descriptor of nvme device
* @nsid: Namespace ID
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_directive_recv_stream_parameters(int fd, __u32 nsid,
struct nvme_streams_directive_params *parms);
* @fd: File descriptor of nvme device
* @nsid: Namespace ID
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_directive_recv_stream_status(int fd, __u32 nsid, unsigned nr_entries,
struct nvme_streams_directive_status *id);
* @fd: File descriptor of nvme device
* @nsid: Namespace ID
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_directive_recv_stream_allocate(int fd, __u32 nsid, __u16 nsr,
__u32 *result);
* This is an NVMe-over-Fabrics specific command, not applicable to PCIe. These
* properties align to the PCI MMIO controller registers.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_set_property(int fd, int offset, __u64 value);
* This is an NVMe-over-Fabrics specific command, not applicable to PCIe. These
* properties align to the PCI MMIO controller registers.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_get_property(int fd, int offset, __u64 *value);
* sanitize operations are processed in the background, i.e., completion of the
* sanitize command does not indicate completion of the sanitize operation.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_sanitize_nvm(int fd, enum nvme_sanitize_sanact sanact, bool ause,
__u8 owpass, bool oipbp, bool nodas, __u32 ovrpat);
* 0xffffffff to test all namespaces. All other values tests a specific
* namespace, if present.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_dev_self_test(int fd, __u32 nsid, enum nvme_dst_stc stc);
* - Assigning Flexible Resources for secondary controllers
* - Setting the Online and Offline state for secondary controllers
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_virtual_mgmt(int fd, enum nvme_virt_mgmt_act act,
enum nvme_virt_mgmt_rt rt, __u16 cntlid, __u16 nr,
__u32 *result);
-/**
- * DOC: NVMe IO command
- */
-
/**
* enum nvme_io_opcode -
* @nvme_cmd_flush:
* The Flush command is used to request that the contents of volatile write
* cache be made non-volatile.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_flush(int fd, __u32 nsid);
* metadata_len:Length of user buffer, @metadata, in bytes
* @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.
+ * Return: The nvme command status if a response was received (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_read(int fd, __u32 nsid, __u64 slba, __u16 nlb, __u16 control,
__u8 dsm, __u32 reftag, __u16 apptag, __u16 appmask,
* metadata_len:Length of user buffer, @metadata, in bytes
* @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.
+ * Return: The nvme command status if a response was received (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_write(int fd, __u32 nsid, __u64 slba, __u16 nlb, __u16 control,
__u8 dsm, __u16 dspec, __u32 reftag, __u16 apptag,
* metadata_len:Length of user buffer, @metadata, in bytes
* @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.
+ * Return: The nvme command status if a response was received (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_compare(int fd, __u32 nsid, __u64 slba, __u16 nlb, __u16 control,
__u32 reftag, __u16 apptag, __u16 appmask, __u32 data_len,
* 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.
+ * Return: The nvme command status if a response was received (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_write_zeros(int fd, __u32 nsid, __u64 slba, __u16 nlb, __u16 control,
__u32 reftag, __u16 apptag, __u16 appmask);
* 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.
+ * Return: The nvme command status if a response was received (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_write_uncorrectable(int fd, __u32 nsid, __u64 slba, __u16 nlb);
* and metadata, if applicable, for the LBAs indicated without transferring any
* data or metadata to the host.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_verify(int fd, __u32 nsid, __u64 slba, __u16 nlb, __u16 control,
__u32 reftag, __u16 apptag, __u16 appmask);
* to optimize performance and reliability, and may be used to
* deallocate/unmap/trim those logical blocks.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_dsm(int fd, __u32 nsid, __u32 attrs, __u16 nr_ranges,
struct nvme_dsm_range *dsm);
* namespace, preempt a reservation held on a namespace, and abort a
* reservation held on a namespace.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_resv_acquire(int fd, __u32 nsid, enum nvme_reservation_rtype rtype,
enum nvme_reservation_racqa racqa, bool iekey,
* The Reservation Register command is used to register, unregister, or replace
* a reservation key.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_resv_register(int fd, __u32 nsid, enum nvme_reservation_rrega rrega,
enum nvme_reservation_cptpl cptpl, bool iekey,
* @iekey: Set to ignore the existing key
* @crkey: The current reservation key to release
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_resv_release(int fd, __u32 nsid, enum nvme_reservation_rtype rtype,
enum nvme_reservation_rrela rrela, bool iekey,
* registration and reservation status of a namespace. See the defintion for
* the returned structure, &struct nvme_reservation_status, for more details.
*
- * Return: 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 (see &enum
+ * nvme_status_field) or -1 with errno set otherwise.
*/
int nvme_resv_report(int fd, __u32 nsid, bool eds, __u32 len,
struct nvme_reservation_status *report);
#define __force
#endif
+/**
+ * cpu_to_le16() -
+ * @x: 16-bit CPU value to turn to little endian.
+ */
static inline __le16 cpu_to_le16(uint16_t x)
{
return (__force __le16)htole16(x);
}
+/**
+ * cpu_to_le32() -
+ * @x: 32-bit CPU value to turn little endian.
+ */
static inline __le32 cpu_to_le32(uint32_t x)
{
return (__force __le32)htole32(x);
}
+/**
+ * cpu_to_le64() -
+ * @x: 64-bit CPU value to turn little endian.
+ */
static inline __le64 cpu_to_le64(uint64_t x)
{
return (__force __le64)htole64(x);
}
+/**
+ * le16_to_cpu() -
+ * @x: 16-bit little endian value to turn to CPU.
+ */
static inline uint16_t le16_to_cpu(__le16 x)
{
return le16toh((__force __u16)x);
}
+/**
+ * le32_to_cpu() -
+ * @x: 32-bit little endian value to turn to CPU.
+ */
static inline uint32_t le32_to_cpu(__le32 x)
{
- return le32toh((__force __u32)x); }
+ return le32toh((__force __u32)x);
+}
+/**
+ * le64_to_cpu() -
+ * @x: 64-bit little endian value to turn to CPU.
+ */
static inline uint64_t le64_to_cpu(__le64 x)
{
return le64toh((__force __u64)x);
* lba range type
* @NVME_LOG_ST_MAX_RESULTS: The largest possible self test result index in the
* device self test log
+ * @NVME_LOG_TELEM_BLOCK_SIZE: Specification defined size of Telemetry Data Blocks
* @NVME_DSM_MAX_RANGES: The largest possible range index in a data-set
* management command
+ * @NVME_NQN_LENGTH: Max length for NVMe Qualified Name.
+ * @NVMF_TRADDR_SIZE:
+ * @NVMF_TSAS_SIZE:
*/
enum nvme_constants {
NVME_NSID_ALL = 0xffffffff,
NVME_ID_ND_DESCRIPTOR_MAX = 16,
NVME_FEAT_LBA_RANGE_MAX = 64,
NVME_LOG_ST_MAX_RESULTS = 20,
+ NVME_LOG_TELEM_BLOCK_SIZE = 512,
NVME_DSM_MAX_RANGES = 256,
+ NVME_NQN_LENGTH = 256,
+ NVMF_TRADDR_SIZE = 256,
+ NVMF_TSAS_SIZE = 256,
};
/**
};
/**
- * is_64bit_reg() - Checks if offset of the controller register is 64bit or not.
+ * nvme_is_64bit_reg() - Checks if offset of the controller register is a know
+ * 64bit value.
* @offset: Offset of controller register field in bytes
*
* This function does not care about transport so that the offset is not going
*
* Returns true if given offset is 64bit register, otherwise it returns false.
*/
-static inline bool is_64bit_reg(__u32 offset)
+static inline bool nvme_is_64bit_reg(__u32 offset)
{
switch (offset) {
case NVME_REG_CAP:
__le32 sgls;
__le32 mnan;
__u8 rsvd544[224];
- char subnqn[256];
+ char subnqn[NVME_NQN_LENGTH];
__u8 rsvd1024[768];
/* Fabrics Only */
__le16 ssvid;
char sn[20];
char mn[40];
- char subnqn[256];
+ char subnqn[NVME_NQN_LENGTH];
__u8 rsvd372;
__u8 seb[32];
};
#define NVME_DISC_SUBSYS_NAME "nqn.2014-08.org.nvmexpress.discovery"
#define NVME_RDMA_IP_PORT 4420
-/* NQN names in commands fields specified one size */
-#define NVMF_NQN_FIELD_LEN 256
-
/* However the max length of a qualified name is another size */
#define NVMF_NQN_SIZE 223
#define NVMF_TRSVCID_SIZE 32
-#define NVMF_TRADDR_SIZE 256
-#define NVMF_TSAS_SIZE 256
/**
* struct nvmf_disc_log_entry - Discovery log page entry
__u8 resv10[22];
char trsvcid[NVMF_TRSVCID_SIZE];
__u8 resv64[192];
- char subnqn[NVMF_NQN_FIELD_LEN];
+ char subnqn[NVME_NQN_LENGTH];
char traddr[NVMF_TRADDR_SIZE];
union tsas {
char common[NVMF_TSAS_SIZE];
__u8 hostid[16];
__le16 cntlid;
char resv4[238];
- char subsysnqn[NVMF_NQN_FIELD_LEN];
- char hostnqn[NVMF_NQN_FIELD_LEN];
+ char subsysnqn[NVME_NQN_LENGTH];
+ char hostnqn[NVME_NQN_LENGTH];
char resv5[256];
};
/**
* struct nvme_mi_vpd_mr_common -
- * @type;
- * @rf;
- * @rlen;
- * @rchksum;
- * @hchksum;
-nmra;
- * @ppmra;
- * @tmra;
+ * @type:
+ * @rf:
+ * @rlen:
+ * @rchksum:
+ * @hchksum:
+ * @nmra:
+ * @ppmra:
+ * @tmra:
*/
struct nvme_mi_vpd_mr_common {
__u8 type;
};
/**
- * enum -
- */
-enum {
+ * enum nvme_status_code - Defines all parts of the nvme status field: status
+ * code, status code type, and additional flags.
+ * @NVME_SCT_MASK: Mask to get the value of the Status Code Type
+ * @NVME_SCT_GENERIC: Generic errors applicable to multiple opcodes
+ * @NVME_SCT_CMD_SPECIFIC: Errors associated to a specific opcode
+ * @NVME_SCT_MEDIA: Errors associated with media and data integrity
+ * @NVME_SCT_PATH: Errors associated with the paths connection
+ * @NVME_SCT_VS: Vendor specific errors
+ * @NVME_SC_MASK: Mask to get the value of the status code.
+ * @NVME_SC_SUCCESS: Successful Completion: The command
+ * completed without error.
+ * @NVME_SC_INVALID_OPCODE: Invalid Command Opcode: A reserved coded
+ * value or an unsupported value in the command opcode field.
+ * @NVME_SC_INVALID_FIELD: Invalid Field in Command: A reserved
+ * coded value or an unsupported value in a defined field.
+ * @NVME_SC_CMDID_CONFLICT: Command ID Conflict: The command
+ * identifier is already in use.
+ * @NVME_SC_DATA_XFER_ERROR: Data Transfer Error: Transferring the
+ * data or metadata associated with a command experienced an error.
+ * @NVME_SC_POWER_LOSS: Commands Aborted due to Power Loss
+ * Notification: Indicates that the command
+ * was aborted due to a power loss
+ * notification.
+ * @NVME_SC_INTERNAL: Internal Error: The command was not
+ * completed successfully due to an internal error.
+ * @NVME_SC_ABORT_REQ: Command Abort Requested: The command was
+ * aborted due to an Abort command being
+ * received that specified the Submission
+ * Queue Identifier and Command Identifier
+ * of this command.
+ * @NVME_SC_ABORT_QUEUE: Command Aborted due to SQ Deletion: The
+ * command was aborted due to a Delete I/O
+ * Submission Queue request received for the
+ * Submission Queue to which the command was
+ * submitted.
+ * @NVME_SC_FUSED_FAIL: Command Aborted due to Failed Fused Command:
+ * The command was aborted due to the other
+ * command in a fused operation failing.
+ * @NVME_SC_FUSED_MISSING: Aborted due to Missing Fused Command: The
+ * fused command was aborted due to the
+ * adjacent submission queue entry not
+ * containing a fused command that is the
+ * other command.
+ * @NVME_SC_INVALID_NS: Invalid Namespace or Format: The
+ * namespace or the format of that namespace is invalid.
+ * @NVME_SC_CMD_SEQ_ERROR: Command Sequence Error: The command was
+ * aborted due to a protocol violation in a multi-command sequence.
+ * @NVME_SC_SGL_INVALID_LAST: Invalid SGL Segment Descriptor: The
+ * command includes an invalid SGL Last Segment or SGL Segment descriptor.
+ * @NVME_SC_SGL_INVALID_COUNT: Invalid Number of SGL Descriptors: There
+ * is an SGL Last Segment descriptor or an
+ * SGL Segment descriptor in a location
+ * other than the last descriptor of a
+ * segment based on the length indicated.
+ * @NVME_SC_SGL_INVALID_DATA: Data SGL Length Invalid: This may occur
+ * if the length of a Data SGL is too short.
+ * This may occur if the length of a Data
+ * SGL is too long and the controller does
+ * not support SGL transfers longer than the
+ * amount of data to be transferred as
+ * indicated in the SGL Support field of the
+ * Identify Controller data structure.
+ * @NVME_SC_SGL_INVALID_METADATA: Metadata SGL Length Invalid: This may
+ * occur if the length of a Metadata SGL is
+ * too short. This may occur if the length
+ * of a Metadata SGL is too long and the
+ * controller does not support SGL transfers
+ * longer than the amount of data to be
+ * transferred as indicated in the SGL
+ * Support field of the Identify Controller
+ * data structure.
+ * @NVME_SC_SGL_INVALID_TYPE: SGL Descriptor Type Invalid: The type of
+ * an SGL Descriptor is a type that is not supported by the controller.
+ * @NVME_SC_CMB_INVALID_USE: Invalid Use of Controller Memory Buffer:
+ * The attempted use of the Controller
+ * Memory Buffer is not supported by the
+ * controller.
+ * @NVME_SC_PRP_INVALID_OFFSET: PRP Offset Invalid: The Offset field for
+ * a PRP entry is invalid.
+ * @NVME_SC_AWU_EXCEEDED: Atomic Write Unit Exceeded: The length
+ * specified exceeds the atomic write unit size.
+ * @NVME_SC_OP_DENIED: Operation Denied: The command was denied
+ * due to lack of access rights. Refer to
+ * the appropriate security specification.
+ * @NVME_SC_SGL_INVALID_OFFSET: SGL Offset Invalid: The offset specified
+ * in a descriptor is invalid. This may
+ * occur when using capsules for data
+ * transfers in NVMe over Fabrics
+ * implementations and an invalid offset in
+ * the capsule is specified.
+ * @NVME_SC_HOSTID_FORMAT: Host Identifier Inconsistent Format: The
+ * NVM subsystem detected the simultaneous
+ * use of 64- bit and 128-bit Host
+ * Identifier values on different
+ * controllers.
+ * @NVME_SC_KAT_EXPIRED: Keep Alive Timer Expired: The Keep Alive
+ * Timer expired.
+ * @NVME_SC_KAT_INVALID: Keep Alive Timeout Invalid: The Keep
+ * Alive Timeout value specified is invalid.
+ * @NVME_SC_CMD_ABORTED_PREMEPT: Command Aborted due to Preempt and Abort:
+ * The command was aborted due to a Reservation Acquire command.
+ * @NVME_SC_SANITIZE_FAILED: Sanitize Failed: The most recent sanitize
+ * operation failed and no recovery action has been successfully completed.
+ * @NVME_SC_SANITIZE_IN_PROGRESS: Sanitize In Progress: The requested
+ * function (e.g., command) is prohibited
+ * while a sanitize operation is in
+ * progress.
+ * @NVME_SC_SGL_INVALID_GRANULARITY: SGL Data Block Granularity Invalid: The
+ * Address alignment or Length granularity
+ * for an SGL Data Block descriptor is
+ * invalid.
+ * @NVME_SC_CMD_IN_CMBQ_NOT_SUPP: Command Not Supported for Queue in CMB:
+ * The implementation does not support
+ * submission of the command to a Submission
+ * Queue in the Controller Memory Buffer or
+ * command completion to a Completion Queue
+ * in the Controller Memory Buffer.
+ * @NVME_SC_NS_WRITE_PROTECTED: Namespace is Write Protected: The command
+ * is prohibited while the namespace is
+ * write protected as a result of a change
+ * in the namespace write protection state
+ * as defined by the Namespace Write
+ * Protection State Machine.
+ * @NVME_SC_CMD_INTERRUPTED: Command Interrupted: Command processing
+ * was interrupted and the controller is
+ * unable to successfully complete the
+ * command. The host should retry the
+ * command.
+ * @NVME_SC_TRAN_TPORT_ERROR: Transient Transport Error: A transient
+ * transport error was detected. If the
+ * command is retried on the same
+ * controller, the command is likely to
+ * succeed. A command that fails with a
+ * transient transport error four or more
+ * times should be treated as a persistent
+ * transport error that is not likely to
+ * succeed if retried on the same
+ * controller.
+ * @NVME_SC_LBA_RANGE: LBA Out of Range: The command references
+ * an LBA that exceeds the size of the namespace.
+ * @NVME_SC_CAP_EXCEEDED: Capacity Exceeded: Execution of the
+ * command has caused the capacity of the
+ * namespace to be exceeded.
+ * @NVME_SC_NS_NOT_READY: Namespace Not Ready: The namespace is not
+ * ready to be accessed as a result of a
+ * condition other than a condition that is
+ * reported as an Asymmetric Namespace
+ * Access condition.
+ * @NVME_SC_RESERVATION_CONFLICT: Reservation Conflict: The command was
+ * aborted due to a conflict with a
+ * reservation held on the accessed
+ * namespace.
+ * @NVME_SC_FORMAT_IN_PROGRESS: Format In Progress: A Format NVM command
+ * is in progress on the namespace.
+ * @NVME_SC_CQ_INVALID: Completion Queue Invalid: The Completion
+ * Queue identifier specified in the command
+ * does not exist.
+ * @NVME_SC_QID_INVALID: Invalid Queue Identifier: The creation of
+ * the I/O Completion Queue failed due to an
+ * invalid queue identifier specified as
+ * part of the command. An invalid queue
+ * identifier is one that is currently in
+ * use or one that is outside the range
+ * supported by the controller.
+ * @NVME_SC_QUEUE_SIZE: Invalid Queue Size: The host attempted to
+ * create an I/O Completion Queue with an
+ * invalid number of entries.
+ * @NVME_SC_ABORT_LIMIT: Abort Command Limit Exceeded: The number
+ * of concurrently outstanding Abort commands has exceeded the limit indicated
+ * in the Identify Controller data
+ * structure.
+ * @NVME_SC_ABORT_MISSING: Abort Command is missing: The abort
+ * command is missing.
+ * @NVME_SC_ASYNC_LIMIT: Asynchronous Event Request Limit
+ * Exceeded: The number of concurrently
+ * outstanding Asynchronous Event Request
+ * commands has been exceeded.
+ * @NVME_SC_FIRMWARE_SLOT: Invalid Firmware Slot: The firmware slot
+ * indicated is invalid or read only. This
+ * error is indicated if the firmware slot
+ * exceeds the number supported.
+ * @NVME_SC_FIRMWARE_IMAGE: Invalid Firmware Image: The firmware
+ * image specified for activation is invalid
+ * and not loaded by the controller.
+ * @NVME_SC_INVALID_VECTOR: Invalid Interrupt Vector: The creation of
+ * the I/O Completion Queue failed due to an
+ * invalid interrupt vector specified as
+ * part of the command.
+ * @NVME_SC_INVALID_LOG_PAGE: Invalid Log Page: The log page indicated
+ * is invalid. This error condition is also
+ * returned if a reserved log page is
+ * requested.
+ * @NVME_SC_INVALID_FORMAT: Invalid Format: The LBA Format specified
+ * is not supported.
+ * @NVME_SC_FW_NEEDS_CONV_RESET: Firmware Activation Requires Conventional Reset:
+ * The firmware commit was successful,
+ * however, activation of the firmware image
+ * requires a conventional reset.
+ * @NVME_SC_INVALID_QUEUE: Invalid Queue Deletion: Invalid I/O
+ * Completion Queue specified to delete.
+ * @NVME_SC_FEATURE_NOT_SAVEABLE: Feature Identifier Not Saveable: The
+ * Feature Identifier specified does not
+ * support a saveable value.
+ * @NVME_SC_FEATURE_NOT_CHANGEABLE: Feature Not Changeable: The Feature
+ * Identifier is not able to be changed.
+ * @NVME_SC_FEATURE_NOT_PER_NS: Feature Not Namespace Specific: The
+ * Feature Identifier specified is not
+ * namespace specific. The Feature
+ * Identifier settings apply across all
+ * namespaces.
+ * @NVME_SC_FW_NEEDS_SUBSYS_RESET: Firmware Activation Requires NVM
+ * Subsystem Reset: The firmware commit was
+ * successful, however, activation of the
+ * firmware image requires an NVM Subsystem.
+ * @NVME_SC_FW_NEEDS_RESET: Firmware Activation Requires Controller
+ * Level Reset: The firmware commit was
+ * successful; however, the image specified
+ * does not support being activated without
+ * a reset.
+ * @NVME_SC_FW_NEEDS_MAX_TIME: Firmware Activation Requires Maximum Time
+ * Violation: The image specified if
+ * activated immediately would exceed the
+ * Maximum Time for Firmware Activation
+ * (MTFA) value reported in Identify
+ * Controller.
+ * @NVME_SC_FW_ACTIVATE_PROHIBITED: Firmware Activation Prohibited: The image
+ * specified is being prohibited from
+ * activation by the controller for vendor
+ * specific reasons.
+ * @NVME_SC_OVERLAPPING_RANGE: Overlapping Range: The downloaded
+ * firmware image has overlapping ranges.
+ * @NVME_SC_NS_INSUFFICIENT_CAP: Namespace Insufficient Capacity: Creating
+ * the namespace requires more free space
+ * than is currently available.
+ * @NVME_SC_NS_ID_UNAVAILABLE: Namespace Identifier Unavailable: The
+ * number of namespaces supported has been
+ * exceeded.
+ * @NVME_SC_NS_ALREADY_ATTACHED: Namespace Already Attached: The
+ * controller is already attached to the
+ * namespace specified.
+ * @NVME_SC_NS_IS_PRIVATE: Namespace Is Private: The namespace is
+ * private and is already attached to one
+ * controller.
+ * @NVME_SC_NS_NOT_ATTACHED: Namespace Not Attached: The request to
+ * detach the controller could not be completed because the controller is not
+ * attached to the namespace.
+ * @NVME_SC_THIN_PROV_NOT_SUPP: Thin Provisioning Not Supported: Thin
+ * provisioning is not supported by the
+ * controller.
+ * @NVME_SC_CTRL_LIST_INVALID: Controller List Invalid: The controller
+ * list provided contains invalid controller
+ * ids.
+ * @NVME_SC_SELF_TEST_IN_PROGRESS: Device Self-test In Progress:
+ * @NVME_SC_BP_WRITE_PROHIBITED: Boot Partition Write Prohibited: The
+ * command is trying to modify a locked Boot
+ * Partition.
+ * @NVME_SC_INVALID_CTRL_ID: Invalid Controller Identifier:
+ * @NVME_SC_INVALID_SEC_CTRL_STATE: Invalid Secondary Controller State
+ * @NVME_SC_INVALID_CTRL_RESOURCES: Invalid Number of Controller Resources
+ * @NVME_SC_INVALID_RESOURCE_ID: Invalid Resource Identifier
+ * @NVME_SC_PMR_SAN_PROHIBITED: Sanitize Prohibited While Persistent
+ * Memory Region is Enabled
+ * @NVME_SC_ANA_GROUP_ID_INVALID: ANA Group Identifier Invalid
+ * @NVME_SC_ANA_ATTACH_FAILED: ANA Attach Failed
+ * @NVME_SC_BAD_ATTRIBUTES: Conflicting Dataset Management Attributes
+ * @NVME_SC_INVALID_PI: Invalid Protection Information
+ * @NVME_SC_READ_ONLY: Attempted Write to Read Only Range
+ * @NVME_SC_CONNECT_FORMAT: Incompatible Format: The NVM subsystem
+ * does not support the record format
+ * specified by the host.
+ * @NVME_SC_CONNECT_CTRL_BUSY: Controller Busy: The controller is
+ * already associated with a host.
+ * @NVME_SC_CONNECT_INVALID_PARAM: Connect Invalid Parameters: One or more
+ * of the command parameters.
+ * @NVME_SC_CONNECT_RESTART_DISC: Connect Restart Discovery: The NVM
+ * subsystem requested is not available.
+ * @NVME_SC_CONNECT_INVALID_HOST: Connect Invalid Host: The host is either
+ * not allowed to establish an association
+ * to any controller in the NVM subsystem or
+ * the host is not allowed to establish an
+ * association to the specified controller
+ * @NVME_SC_DISCONNECT_INVALID_QTYPE: Invalid Queue Type: The command was sent
+ * on the wrong queue type.
+ * @NVME_SC_DISCOVERY_RESTART: Discover Restart: The snapshot of the
+ * records is now invalid or out of date.
+ * @NVME_SC_AUTH_REQUIRED: Authentication Required: NVMe in-band
+ * authentication is required and the queue
+ * has not yet been authenticated.
+ * @NVME_SC_WRITE_FAULT: Write Fault: The write data could not be
+ * committed to the media.
+ * @NVME_SC_READ_ERROR: Unrecovered Read Error: The read data
+ * could not be recovered from the media.
+ * @NVME_SC_GUARD_CHECK: End-to-end Guard Check Error: The command
+ * was aborted due to an end-to-end guard
+ * check failure.
+ * @NVME_SC_APPTAG_CHECK: End-to-end Application Tag Check Error:
+ * The command was aborted due to an
+ * end-to-end application tag check failure.
+ * @NVME_SC_REFTAG_CHECK: End-to-end Reference Tag Check Error: The
+ * command was aborted due to an end-to-end
+ * reference tag check failure.
+ * @NVME_SC_COMPARE_FAILED: Compare Failure: The command failed due
+ * to a miscompare during a Compare command.
+ * @NVME_SC_ACCESS_DENIED: Access Denied: Access to the namespace
+ * and/or LBA range is denied due to lack of
+ * access rights.
+ * @NVME_SC_UNWRITTEN_BLOCK: Deallocated or Unwritten Logical Block:
+ * The command failed due to an attempt to
+ * read from or verify an LBA range
+ * containing a deallocated or unwritten
+ * logical block.
+ * @NVME_SC_ANA_INTERNAL_PATH_ERROR: Internal Path Error: The command was not
+ * completed as the result of a controller
+ * internal error that is specific to the
+ * controller processing the command.
+ * @NVME_SC_ANA_PERSISTENT_LOSS: Asymmetric Access Persistent Loss: The
+ * requested function (e.g., command) is not
+ * able to be performed as a result of the
+ * relationship between the controller and
+ * the namespace being in the ANA Persistent
+ * Loss state.
+ * @NVME_SC_ANA_INACCESSIBLE: Asymmetric Access Inaccessible: The
+ * requested function (e.g., command) is not
+ * able to be performed as a result of the
+ * relationship between the controller and
+ * the namespace being in the ANA
+ * Inaccessible state.
+ * @NVME_SC_ANA_TRANSITION: Asymmetric Access Transition: The
+ * requested function (e.g., command) is not
+ * able to be performed as a result of the
+ * relationship between the controller and
+ * the namespace transitioning between
+ * Asymmetric Namespace Access states.
+ * @NVME_SC_CTRL_PATH_ERROR: Controller Pathing Error: A pathing error
+ * was detected by the controller.
+ * @NVME_SC_HOST_PATH_ERROR: Host Pathing Error: A pathing error was
+ * detected by the host.
+ * @NVME_SC_CMD_ABORTED_BY_HOST: Command Aborted By Host: The command was
+ * aborted as a result of host action.
+ * @NVME_SC_CRD: Mask to get value of Command Retry Delay
+ * index
+ * @NVME_SC_MORE: More bit. If set, more status information
+ * for this command as part of the Error
+ * Information log that may be retrieved with
+ * the Get Log Page command.
+ * @NVME_SC_DNR: Do Not Retry bit. If set, if the same
+ * command is re-submitted to any controller
+ * in the NVM subsystem, then that
+ * re-submitted command is expected to fail.
+ */
+enum nvme_status_field {
/*
- * Status code type
+ * Status Code Type indicators
*/
+ NVME_SCT_MASK = 0x700,
NVME_SCT_GENERIC = 0x000,
NVME_SCT_CMD_SPECIFIC = 0x100,
NVME_SCT_MEDIA = 0x200,
NVME_SCT_PATH = 0x300,
NVME_SCT_VS = 0x700,
- NVME_SCT_MASK = 0x700,
/*
- * Generic Command Status:
+ * Status Code inidicators
+ */
+ NVME_SC_MASK = 0xff,
+
+ /*
+ * Generic Command Status Codes:
*/
NVME_SC_SUCCESS = 0x0,
NVME_SC_INVALID_OPCODE = 0x1,
NVME_SC_AWU_EXCEEDED = 0x14,
NVME_SC_OP_DENIED = 0x15,
NVME_SC_SGL_INVALID_OFFSET = 0x16,
-
NVME_SC_HOSTID_FORMAT = 0x18,
NVME_SC_KAT_EXPIRED = 0x19,
NVME_SC_KAT_INVALID = 0x1a,
NVME_SC_NS_WRITE_PROTECTED = 0x20,
NVME_SC_CMD_INTERRUPTED = 0x21,
NVME_SC_TRAN_TPORT_ERROR = 0x22,
-
NVME_SC_LBA_RANGE = 0x80,
NVME_SC_CAP_EXCEEDED = 0x81,
NVME_SC_NS_NOT_READY = 0x82,
NVME_SC_FORMAT_IN_PROGRESS = 0x84,
/*
- * Command Specific Status:
+ * Command Specific Status Codes:
*/
NVME_SC_CQ_INVALID = 0x00,
NVME_SC_QID_INVALID = 0x01,
NVME_SC_CONNECT_RESTART_DISC = 0x83,
NVME_SC_CONNECT_INVALID_HOST = 0x84,
NVME_SC_DISCONNECT_INVALID_QTYPE= 0x85,
-
NVME_SC_DISCOVERY_RESTART = 0x90,
NVME_SC_AUTH_REQUIRED = 0x91,
NVME_SC_ANA_PERSISTENT_LOSS = 0x01,
NVME_SC_ANA_INACCESSIBLE = 0x02,
NVME_SC_ANA_TRANSITION = 0x03,
-
NVME_SC_CTRL_PATH_ERROR = 0x60,
-
NVME_SC_HOST_PATH_ERROR = 0x70,
NVME_SC_CMD_ABORTED_BY_HOST = 0x71,
/*
- * Status code mask
- */
- NVME_SC_MASK = 0xff,
-
- /*
- * Additional status info
+ * Additional status field flags
*/
NVME_SC_CRD = 0x1800,
NVME_SC_MORE = 0x2000,
NVME_SC_DNR = 0x4000,
};
+/**
+ * nvme_status_code_type() - Returns the NVMe Status Code Type
+ * @status_field: The NVMe Completion Queue Entry's Status Field
+ *
+ * See &enum nvme_status_field
+ */
+static inline __u16 nvme_status_code_type(__u16 status_field)
+{
+ return status_field & NVME_SCT_MASK;
+}
+
+/**
+ * nvme_status_code() - Returns the NVMe Status Code
+ * @status_field: The NVMe Completion Queue Entry's Status Field
+ *
+ * See &enum nvme_status_field
+ */
+static inline __u16 nvme_status_code(__u16 status_field)
+{
+ return status_field & NVME_SCT_MASK;
+}
+
#define NVME_MAJOR(ver) ((ver) >> 16)
#define NVME_MINOR(ver) (((ver) >> 8) & 0xff)
#define NVME_TERTIARY(ver) ((ver) & 0xff)