From ebe52027673b71f65dde62120e2c127b13b21551 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Fri, 12 Apr 2024 13:03:27 +0200 Subject: [PATCH] Revert "ioctl: Update function documentation" This reverts commit e3d3371160eba2bd26dcffaea4eed910898dfb2d. The result field is undefined for many commands and thus can have random values. Thus we can't blindly evaluate these for all commands. Signed-off-by: Daniel Wagner --- src/nvme/ioctl.h | 425 ++++++++++++++++++++++++++--------------------- 1 file changed, 231 insertions(+), 194 deletions(-) diff --git a/src/nvme/ioctl.h b/src/nvme/ioctl.h index 89130132..be4c1b70 100644 --- a/src/nvme/ioctl.h +++ b/src/nvme/ioctl.h @@ -327,8 +327,8 @@ enum nvme_cmd_dword_fields { * * Uses NVME_IOCTL_ADMIN64_CMD for the ioctl request. * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -360,8 +360,8 @@ int nvme_submit_admin_passthru64(int fd, struct nvme_passthru_cmd64 *cmd, * * Known values for @opcode are defined in &enum nvme_admin_opcode. * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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, @@ -377,8 +377,8 @@ int nvme_admin_passthru64(int fd, __u8 opcode, __u8 flags, __u16 rsvd, * * Uses NVME_IOCTL_ADMIN_CMD for the ioctl request. * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -410,8 +410,8 @@ int nvme_submit_admin_passthru(int fd, struct nvme_passthru_cmd *cmd, * * Known values for @opcode are defined in &enum nvme_admin_opcode. * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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, @@ -427,8 +427,8 @@ int nvme_admin_passthru(int fd, __u8 opcode, __u8 flags, __u16 rsvd, * * Uses NVME_IOCTL_IO64_CMD for the ioctl request. * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -460,8 +460,8 @@ int nvme_submit_io_passthru64(int fd, struct nvme_passthru_cmd64 *cmd, * * Known values for @opcode are defined in &enum nvme_io_opcode. * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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, @@ -474,11 +474,12 @@ int nvme_io_passthru64(int fd, __u8 opcode, __u8 flags, __u16 rsvd, * @fd: File descriptor of nvme device * @cmd: The nvme io command to send * @result: Optional field to return the result from the CQE dword 0 + * @result: Optional field to return the result from the CQE DW0 * * Uses NVME_IOCTL_IO_CMD for the ioctl request. * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -510,8 +511,8 @@ int nvme_submit_io_passthru(int fd, struct nvme_passthru_cmd *cmd, * * Known values for @opcode are defined in &enum nvme_io_opcode. * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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, @@ -571,7 +572,8 @@ int nvme_get_nsid(int fd, __u32 *nsid); * The Identify command returns a data buffer that describes information about * the NVM subsystem, the controller or the namespace(s). * - * Return: 0 if the ioctl was successful 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(struct nvme_identify_args *args); @@ -633,8 +635,7 @@ static inline int nvme_identify_ctrl(int fd, struct nvme_id_ctrl *id) * Return: The nvme command status if a response was received (see * &enum nvme_status_field) or -1 with errno set otherwise. */ -static inline int nvme_identify_ns(int fd, __u32 nsid, - struct nvme_id_ns *ns) +static inline int nvme_identify_ns(int fd, __u32 nsid, struct nvme_id_ns *ns) { return nvme_identify_cns_nsid(fd, NVME_IDENTIFY_CNS_NS, nsid, ns); } @@ -936,8 +937,7 @@ static inline int nvme_identify_ns_granularity(int fd, * Return: The nvme command status if a response was received (see * &enum nvme_status_field) or -1 with errno set otherwise. */ -static inline int nvme_identify_uuid(int fd, - struct nvme_id_uuid_list *uuid_list) +static inline int nvme_identify_uuid(int fd, struct nvme_id_uuid_list *uuid_list) { return nvme_identify_cns_nsid(fd, NVME_IDENTIFY_CNS_UUID_LIST, NVME_NSID_NONE, uuid_list); @@ -1320,7 +1320,8 @@ static inline int nvme_zns_identify_ctrl(int fd, struct nvme_zns_id_ctrl *id) * nvme_get_log() - NVMe Admin Get Log command * @args: &struct nvme_get_log_args argument structure * - * Return: 0 if the ioctl was successful 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(struct nvme_get_log_args *args); @@ -1330,7 +1331,8 @@ int nvme_get_log(struct nvme_get_log_args *args); * @xfer_len: Max log transfer size per request to split the total. * @args: &struct nvme_get_log_args argument structure * - * Return: 0 if the ioctl was successful 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_page(int fd, __u32 xfer_len, struct nvme_get_log_args *args); @@ -1395,8 +1397,8 @@ static inline int nvme_get_log_supported_log_pages(int fd, bool rae, * Return: The nvme command status if a response was received (see * &enum nvme_status_field) or -1 with errno set otherwise. */ -static inline int nvme_get_log_error(int fd, unsigned int nr_entries, - bool rae, struct nvme_error_log_page *err_log) +static inline int nvme_get_log_error(int fd, unsigned int nr_entries, bool rae, + struct nvme_error_log_page *err_log) { return nvme_get_nsid_log(fd, rae, NVME_LOG_LID_ERROR, NVME_NSID_ALL, sizeof(*err_log) * nr_entries, @@ -2289,7 +2291,8 @@ static inline int nvme_get_log_persistent_event(int fd, * nvme_set_features() - Set a feature attribute * @args: &struct nvme_set_features_args argument structure * - * Return: 0 if the ioctl was successful 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(struct nvme_set_features_args *args); @@ -2304,8 +2307,8 @@ int nvme_set_features(struct nvme_set_features_args *args); * @data: User address of feature data, if applicable * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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. */ static inline int nvme_set_features_data(int fd, __u8 fid, __u32 nsid, __u32 cdw11, bool save, __u32 data_len, void *data, @@ -2339,8 +2342,8 @@ static inline int nvme_set_features_data(int fd, __u8 fid, __u32 nsid, * @save: Save value across power states * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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. */ static inline int nvme_set_features_simple(int fd, __u8 fid, __u32 nsid, __u32 cdw11, bool save, __u32 *result) @@ -2359,8 +2362,8 @@ static inline int nvme_set_features_simple(int fd, __u8 fid, __u32 nsid, * @save: Save value across power states * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -2373,8 +2376,8 @@ int nvme_set_features_arbitration(int fd, __u8 ab, __u8 lpw, __u8 mpw, * @save: Save value across power states * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -2388,8 +2391,8 @@ int nvme_set_features_power_mgmt(int fd, __u8 ps, __u8 wh, bool save, * @data: User address of feature data * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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, __u8 nr_ranges, bool save, struct nvme_lba_range_type *data, __u32 *result); @@ -2403,8 +2406,8 @@ int nvme_set_features_lba_range(int fd, __u32 nsid, __u8 nr_ranges, bool save, * @save: Save value across power states * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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, @@ -2419,8 +2422,8 @@ int nvme_set_features_temp_thresh(int fd, __u16 tmpth, __u8 tmpsel, * @save: Save value across power states * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -2432,8 +2435,8 @@ int nvme_set_features_err_recovery(int fd, __u32 nsid, __u16 tler, * @save: Save value across power states * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -2446,8 +2449,8 @@ int nvme_set_features_volatile_wc(int fd, bool wce, bool save, * @save: Save value across power states * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -2460,8 +2463,8 @@ int nvme_set_features_irq_coalesce(int fd, __u8 thr, __u8 time, * @save: Save value across power states * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -2473,8 +2476,8 @@ int nvme_set_features_irq_config(int fd, __u16 iv, bool cd, bool save, * @save: Save value across power states * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -2486,8 +2489,8 @@ int nvme_set_features_write_atomic(int fd, bool dn, bool save, * @save: Save value across power states * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -2500,8 +2503,8 @@ int nvme_set_features_async_event(int fd, __u32 events, bool save, * @save: Save value across power states * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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, @@ -2526,8 +2529,8 @@ 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: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -2539,8 +2542,8 @@ int nvme_set_features_hctm(int fd, __u16 tmt2, __u16 tmt1, bool save, * @save: Save value across power states * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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_nopsc(int fd, bool noppme, bool save, __u32 *result); @@ -2552,8 +2555,8 @@ int nvme_set_features_nopsc(int fd, bool noppme, bool save, __u32 *result); * @save: Save value across power states * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -2567,8 +2570,8 @@ int nvme_set_features_rrl(int fd, __u8 rrl, __u16 nvmsetid, bool save, * @data: Pointer to structure nvme_plm_config * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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, @@ -2582,8 +2585,8 @@ int nvme_set_features_plm_config(int fd, bool enable, __u16 nvmsetid, * @save: Save value across power states * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -2596,8 +2599,8 @@ int nvme_set_features_plm_window(int fd, enum nvme_feat_plm_window_select sel, * @lsipi: LBA Status Information Poll Interval * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -2608,7 +2611,8 @@ int nvme_set_features_lba_sts_interval(int fd, __u16 lsiri, __u16 lsipi, * @save: Save value across power states * @data: Pointer to structure nvme_feat_host_behavior * - * Return: 0 if the ioctl was successful 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); @@ -2620,9 +2624,8 @@ int nvme_set_features_host_behavior(int fd, bool save, * @save: Save value across power states * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, or -1 with errno set otherwise. - * Return: 0 if the ioctl was successful 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); @@ -2634,8 +2637,8 @@ 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: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -2647,8 +2650,8 @@ int nvme_set_features_endurance_evt_cfg(int fd, __u16 endgid, __u8 egwarn, * @save: Save value across power states * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -2676,8 +2679,8 @@ 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: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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) __attribute__((deprecated)); @@ -2690,8 +2693,8 @@ 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: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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_mask2(int fd, __u32 nsid, __u32 mask, bool save, __u32 *result); @@ -2707,8 +2710,8 @@ int nvme_set_features_resv_mask2(int fd, __u32 nsid, __u32 mask, bool save, * @save: Save value across power states * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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) __attribute__((deprecated)); @@ -2721,8 +2724,8 @@ 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: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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_persist2(int fd, __u32 nsid, bool ptpl, bool save, __u32 *result); @@ -2738,8 +2741,8 @@ int nvme_set_features_resv_persist2(int fd, __u32 nsid, bool ptpl, bool save, * @save: Save value across power states * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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) @@ -2753,8 +2756,8 @@ int nvme_set_features_write_protect(int fd, enum nvme_feat_nswpcfg_state state, * @save: Save value across power states * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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_protect2(int fd, __u32 nsid, enum nvme_feat_nswpcfg_state state, @@ -2775,7 +2778,8 @@ int nvme_set_features_iocs_profile(int fd, __u16 iocsi, bool save); * nvme_get_features() - Retrieve a feature attribute * @args: &struct nvme_get_features_args argument structure * - * Return: 0 if the ioctl was successful 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(struct nvme_get_features_args *args); @@ -2788,8 +2792,8 @@ int nvme_get_features(struct nvme_get_features_args *args); * @data: User address of feature data, if applicable * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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. */ static inline int nvme_get_features_data(int fd, enum nvme_features_id fid, __u32 nsid, __u32 data_len, void *data, __u32 *result) @@ -2818,8 +2822,8 @@ static inline int nvme_get_features_data(int fd, enum nvme_features_id fid, * @nsid: Namespace ID, if applicable * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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. */ static inline int nvme_get_features_simple(int fd, enum nvme_features_id fid, __u32 nsid, __u32 *result) @@ -2833,8 +2837,8 @@ static inline int nvme_get_features_simple(int fd, enum nvme_features_id fid, * @sel: Select which type of attribute to return, see &enum nvme_get_features_sel * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -2845,8 +2849,8 @@ int nvme_get_features_arbitration(int fd, enum nvme_get_features_sel sel, * @sel: Select which type of attribute to return, see &enum nvme_get_features_sel * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -2862,8 +2866,8 @@ int nvme_get_features_power_mgmt(int fd, enum nvme_get_features_sel sel, * @data: User address of feature data, if applicable * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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, @@ -2877,8 +2881,8 @@ int nvme_get_features_lba_range(int fd, enum nvme_get_features_sel sel, * @data: Buffer to receive LBA Range Type data structure * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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_range2(int fd, enum nvme_get_features_sel sel, __u32 nsid, struct nvme_lba_range_type *data, @@ -2890,8 +2894,8 @@ int nvme_get_features_lba_range2(int fd, enum nvme_get_features_sel sel, * @sel: Select which type of attribute to return, see &enum nvme_get_features_sel * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -2906,8 +2910,8 @@ int nvme_get_features_temp_thresh(int fd, enum nvme_get_features_sel sel, * @sel: Select which type of attribute to return, see &enum nvme_get_features_sel * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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) __attribute__((deprecated)); @@ -2919,8 +2923,8 @@ int nvme_get_features_err_recovery(int fd, enum nvme_get_features_sel sel, * @nsid: Namespace ID * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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_recovery2(int fd, enum nvme_get_features_sel sel, __u32 nsid, __u32 *result); @@ -2931,8 +2935,8 @@ int nvme_get_features_err_recovery2(int fd, enum nvme_get_features_sel sel, * @sel: Select which type of attribute to return, see &enum nvme_get_features_sel * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -2943,8 +2947,8 @@ int nvme_get_features_volatile_wc(int fd, enum nvme_get_features_sel sel, * @sel: Select which type of attribute to return, see &enum nvme_get_features_sel * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -2955,8 +2959,8 @@ int nvme_get_features_num_queues(int fd, enum nvme_get_features_sel sel, * @sel: Select which type of attribute to return, see &enum nvme_get_features_sel * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -2968,8 +2972,8 @@ int nvme_get_features_irq_coalesce(int fd, enum nvme_get_features_sel sel, * @iv: * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -2980,8 +2984,8 @@ int nvme_get_features_irq_config(int fd, enum nvme_get_features_sel sel, * @sel: Select which type of attribute to return, see &enum nvme_get_features_sel * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -2992,8 +2996,8 @@ int nvme_get_features_write_atomic(int fd, enum nvme_get_features_sel sel, * @sel: Select which type of attribute to return, see &enum nvme_get_features_sel * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -3005,8 +3009,8 @@ int nvme_get_features_async_event(int fd, enum nvme_get_features_sel sel, * @apst: * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -3021,8 +3025,8 @@ int nvme_get_features_auto_pst(int fd, enum nvme_get_features_sel sel, * @sel: Select which type of attribute to return, see &enum nvme_get_features_sel * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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) __attribute__((deprecated)); @@ -3034,8 +3038,8 @@ int nvme_get_features_host_mem_buf(int fd, enum nvme_get_features_sel sel, * @attrs: Buffer for returned Host Memory Buffer Attributes * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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_buf2(int fd, enum nvme_get_features_sel sel, struct nvme_host_mem_buf_attrs *attrs, @@ -3059,8 +3063,8 @@ int nvme_get_features_timestamp(int fd, enum nvme_get_features_sel sel, * @sel: Select which type of attribute to return, see &enum nvme_get_features_sel * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -3070,8 +3074,8 @@ 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: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -3081,8 +3085,8 @@ 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: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -3092,8 +3096,8 @@ int nvme_get_features_nopsc(int fd, enum nvme_get_features_sel sel, __u32 *resul * @sel: Select which type of attribute to return, see &enum nvme_get_features_sel * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -3105,8 +3109,8 @@ int nvme_get_features_rrl(int fd, enum nvme_get_features_sel sel, __u32 *result) * @data: * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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, @@ -3119,8 +3123,8 @@ int nvme_get_features_plm_config(int fd, enum nvme_get_features_sel sel, * @nvmsetid: NVM set id * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -3131,8 +3135,8 @@ int nvme_get_features_plm_window(int fd, enum nvme_get_features_sel sel, * @sel: Select which type of attribute to return, see &enum nvme_get_features_sel * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -3144,8 +3148,8 @@ int nvme_get_features_lba_sts_interval(int fd, enum nvme_get_features_sel sel, * @data: Pointer to structure nvme_feat_host_behavior * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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, @@ -3157,8 +3161,8 @@ int nvme_get_features_host_behavior(int fd, enum nvme_get_features_sel sel, * @sel: Select which type of attribute to return, see &enum nvme_get_features_sel * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -3170,8 +3174,8 @@ int nvme_get_features_sanitize(int fd, enum nvme_get_features_sel sel, * @endgid: Endurance Group Identifier * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -3182,8 +3186,8 @@ int nvme_get_features_endurance_event_cfg(int fd, enum nvme_get_features_sel sel * @sel: Select which type of attribute to return, see &enum nvme_get_features_sel * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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); @@ -3212,8 +3216,8 @@ int nvme_get_features_host_id(int fd, enum nvme_get_features_sel sel, * @sel: Select which type of attribute to return, see &enum nvme_get_features_sel * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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) __attribute__((deprecated)); @@ -3225,8 +3229,8 @@ int nvme_get_features_resv_mask(int fd, enum nvme_get_features_sel sel, * @nsid: Namespace ID * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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_mask2(int fd, enum nvme_get_features_sel sel, __u32 nsid, __u32 *result); @@ -3241,8 +3245,8 @@ int nvme_get_features_resv_mask2(int fd, enum nvme_get_features_sel sel, * @sel: Select which type of attribute to return, see &enum nvme_get_features_sel * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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) __attribute__((deprecated)); @@ -3254,8 +3258,8 @@ int nvme_get_features_resv_persist(int fd, enum nvme_get_features_sel sel, * @nsid: Namespace ID * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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_persist2(int fd, enum nvme_get_features_sel sel, __u32 nsid, __u32 *result); @@ -3267,8 +3271,8 @@ int nvme_get_features_resv_persist2(int fd, enum nvme_get_features_sel sel, * @sel: Select which type of attribute to return, see &enum nvme_get_features_sel * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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, @@ -3280,8 +3284,8 @@ int nvme_get_features_write_protect(int fd, __u32 nsid, * @sel: Select which type of attribute to return, see &enum nvme_get_features_sel * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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_iocs_profile(int fd, enum nvme_get_features_sel sel, __u32 *result); @@ -3295,7 +3299,8 @@ int nvme_get_features_iocs_profile(int fd, enum nvme_get_features_sel sel, * format may destroy all data and metadata associated with all namespaces or * only the specific namespace associated with the command * - * Return: 0 if the ioctl was successful 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(struct nvme_format_nvm_args *args); @@ -3303,7 +3308,8 @@ int nvme_format_nvm(struct nvme_format_nvm_args *args); * nvme_ns_mgmt() - Issue a Namespace management command * @args: &struct nvme_ns_mgmt_args Argument structure * - * Return: 0 if the ioctl was successful 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(struct nvme_ns_mgmt_args *args); @@ -3472,7 +3478,8 @@ static inline int nvme_ns_detach_ctrls(int fd, __u32 nsid, * Download command. Use the nvme_fw_commit() to activate a newly downloaded * image. * - * Return: 0 if the ioctl was successful 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(struct nvme_fw_download_args *args); @@ -3482,9 +3489,10 @@ int nvme_fw_download(struct nvme_fw_download_args *args); * * The Firmware Commit command modifies the firmware image or Boot Partitions. * - * Return: 0 if the ioctl was successful or -1 with errno set otherwise. - * The command status response may specify additional reset actions required - * to complete the commit process. + * 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(struct nvme_fw_commit_args *args); @@ -3501,7 +3509,8 @@ int nvme_fw_commit(struct nvme_fw_commit_args *args); * The security data is protocol specific and is not defined by the NVMe * specification. * - * Return: 0 if the ioctl was successful 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(struct nvme_security_send_args *args); @@ -3509,7 +3518,8 @@ int nvme_security_send(struct nvme_security_send_args *args); * nvme_security_receive() - Security Receive command * @args: &struct nvme_security_receive argument structure * - * Return: 0 if the ioctl was successful 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(struct nvme_security_receive_args *args); @@ -3520,7 +3530,8 @@ int nvme_security_receive(struct nvme_security_receive_args *args); * The Get LBA Status command requests information about Potentially * Unrecoverable LBAs. Refer to the specification for action type descriptions. * - * Return: 0 if the ioctl was successful 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(struct nvme_get_lba_status_args *args); @@ -3715,8 +3726,8 @@ static inline int nvme_directive_recv_stream_status(int fd, __u32 nsid, * @nsr: Namespace Streams Requested * @result: If successful, the CQE dword0 value * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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. */ static inline int nvme_directive_recv_stream_allocate(int fd, __u32 nsid, __u16 nsr, __u32 *result) @@ -3742,7 +3753,8 @@ static inline int nvme_directive_recv_stream_allocate(int fd, __u32 nsid, * nvme_capacity_mgmt() - Capacity management command * @args: &struct nvme_capacity_mgmt_args argument structure * - * Return: 0 if the ioctl was successful 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_capacity_mgmt(struct nvme_capacity_mgmt_args *args); @@ -3750,7 +3762,8 @@ int nvme_capacity_mgmt(struct nvme_capacity_mgmt_args *args); * nvme_lockdown() - Issue lockdown command * @args: &struct nvme_lockdown_args argument structure * - * Return: 0 if the ioctl was successful 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_lockdown(struct nvme_lockdown_args *args); @@ -3761,7 +3774,8 @@ int nvme_lockdown(struct nvme_lockdown_args *args); * This is an NVMe-over-Fabrics specific command, not applicable to PCIe. These * properties align to the PCI MMIO controller registers. * - * Return: 0 if the ioctl was successful 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(struct nvme_set_property_args *args); @@ -3772,7 +3786,8 @@ int nvme_set_property(struct nvme_set_property_args *args); * This is an NVMe-over-Fabrics specific command, not applicable to PCIe. These * properties align to the PCI MMIO controller registers. * - * Return: 0 if the ioctl was successful 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(struct nvme_get_property_args *args); @@ -3790,7 +3805,8 @@ int nvme_get_property(struct nvme_get_property_args *args); * operations are processed in the background, i.e., completion of the sanitize * command does not indicate completion of the sanitize operation. * - * Return: 0 if the ioctl was successful 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(struct nvme_sanitize_nvm_args *args); @@ -3809,7 +3825,8 @@ int nvme_sanitize_nvm(struct nvme_sanitize_nvm_args *args); * 0xffffffff to test all namespaces. All other values tests a specific * namespace, if present. * - * Return: 0 if the ioctl was successful 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(struct nvme_dev_self_test_args *args); @@ -3825,7 +3842,8 @@ int nvme_dev_self_test(struct nvme_dev_self_test_args *args); * - Assigning Flexible Resources for secondary controllers * - Setting the Online and Offline state for secondary controllers * - * Return: 0 if the ioctl was successful 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(struct nvme_virtual_mgmt_args *args); @@ -3855,7 +3873,8 @@ static inline int nvme_flush(int fd, __u32 nsid) * @args: &struct nvme_io_args argument structure * @opcode: Opcode to execute * - * Return: 0 if the ioctl was successful 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(struct nvme_io_args *args, __u8 opcode); @@ -3863,7 +3882,8 @@ int nvme_io(struct nvme_io_args *args, __u8 opcode); * nvme_read() - Submit an nvme user read command * @args: &struct nvme_io_args argument structure * - * Return: 0 if the ioctl was successful 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. */ static inline int nvme_read(struct nvme_io_args *args) { @@ -3874,7 +3894,8 @@ static inline int nvme_read(struct nvme_io_args *args) * nvme_write() - Submit an nvme user write command * @args: &struct nvme_io_args argument structure * - * Return: 0 if the ioctl was successful 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. */ static inline int nvme_write(struct nvme_io_args *args) { @@ -3885,7 +3906,8 @@ static inline int nvme_write(struct nvme_io_args *args) * nvme_compare() - Submit an nvme user compare command * @args: &struct nvme_io_args argument structure * - * Return: 0 if the ioctl was successful 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. */ static inline int nvme_compare(struct nvme_io_args *args) { @@ -3901,7 +3923,8 @@ static inline int nvme_compare(struct nvme_io_args *args) * reads of logical blocks in this range shall be all bytes cleared to 0h until * a write occurs to this LBA range. * - * Return: 0 if the ioctl was successful 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. */ static inline int nvme_write_zeros(struct nvme_io_args *args) { @@ -3917,7 +3940,8 @@ static inline int nvme_write_zeros(struct nvme_io_args *args) * is returned with Unrecovered Read Error status. To clear the invalid logical * block status, a write operation on those logical blocks is required. * - * Return: 0 if the ioctl was successful 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. */ static inline int nvme_write_uncorrectable(struct nvme_io_args *args) { @@ -3932,7 +3956,8 @@ static inline int nvme_write_uncorrectable(struct nvme_io_args *args) * and metadata, if applicable, for the LBAs indicated without transferring any * data or metadata to the host. * - * Return: 0 if the ioctl was successful 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. */ static inline int nvme_verify(struct nvme_io_args *args) { @@ -3949,7 +3974,8 @@ static inline int nvme_verify(struct nvme_io_args *args) * to optimize performance and reliability, and may be used to * deallocate/unmap/trim those logical blocks. * - * Return: 0 if the ioctl was successful 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(struct nvme_dsm_args *args); @@ -3958,7 +3984,8 @@ int nvme_dsm(struct nvme_dsm_args *args); * * @args: &struct nvme_copy_args argument structure * - * Return: 0 if the ioctl was successful 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_copy(struct nvme_copy_args *args); @@ -3970,7 +3997,8 @@ int nvme_copy(struct nvme_copy_args *args); * preempt a reservation held on a namespace, and abort a reservation held on a * namespace. * - * Return: 0 if the ioctl was successful 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(struct nvme_resv_acquire_args *args); @@ -3981,7 +4009,8 @@ int nvme_resv_acquire(struct nvme_resv_acquire_args *args); * The Reservation Register command registers, unregisters, or replaces a * reservation key. * - * Return: 0 if the ioctl was successful 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(struct nvme_resv_register_args *args); @@ -3989,7 +4018,8 @@ int nvme_resv_register(struct nvme_resv_register_args *args); * nvme_resv_release() - Send an nvme reservation release * @args: &struct nvme_resv_release_args argument structure * - * Return: 0 if the ioctl was successful 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(struct nvme_resv_release_args *args); @@ -4001,7 +4031,8 @@ int nvme_resv_release(struct nvme_resv_release_args *args); * registration and reservation status of a namespace. See the definition for * the returned structure, &struct nvme_reservation_status, for more details. * - * Return: 0 if the ioctl was successful 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(struct nvme_resv_report_args *args); @@ -4009,7 +4040,8 @@ int nvme_resv_report(struct nvme_resv_report_args *args); * nvme_io_mgmt_recv() - I/O Management Receive command * @args: &struct nvme_io_mgmt_recv_args argument structure * - * Return: 0 if the ioctl was successful 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_mgmt_recv(struct nvme_io_mgmt_recv_args *args); @@ -4044,7 +4076,8 @@ static inline int nvme_fdp_reclaim_unit_handle_status(int fd, __u32 nsid, * nvme_io_mgmt_send() - I/O Management Send command * @args: &struct nvme_io_mgmt_send_args argument structure * - * Return: 0 if the ioctl was successful 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_mgmt_send(struct nvme_io_mgmt_send_args *args); @@ -4079,7 +4112,8 @@ static inline int nvme_fdp_reclaim_unit_handle_update(int fd, __u32 nsid, * nvme_zns_mgmt_send() - ZNS management send command * @args: &struct nvme_zns_mgmt_send_args argument structure * - * Return: 0 if the ioctl was successful 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_zns_mgmt_send(struct nvme_zns_mgmt_send_args *args); @@ -4088,7 +4122,8 @@ int nvme_zns_mgmt_send(struct nvme_zns_mgmt_send_args *args); * nvme_zns_mgmt_recv() - ZNS management receive command * @args: &struct nvme_zns_mgmt_recv_args argument structure * - * Return: 0 if the ioctl was successful 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_zns_mgmt_recv(struct nvme_zns_mgmt_recv_args *args); @@ -4105,8 +4140,8 @@ int nvme_zns_mgmt_recv(struct nvme_zns_mgmt_recv_args *args); * @timeout: timeout in ms * @result: The command completion result from CQE dword0 * - * Return: 0 if the ioctl was successful, -1 with errno set to EPROTO when - * a non-zero state is returned in @result, 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. */ static inline int nvme_zns_report_zones(int fd, __u32 nsid, __u64 slba, enum nvme_zns_report_options opts, @@ -4136,7 +4171,8 @@ static inline int nvme_zns_report_zones(int fd, __u32 nsid, __u64 slba, * nvme_zns_append() - Append data to a zone * @args: &struct nvme_zns_append_args argument structure * - * Return: 0 if the ioctl was successful 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_zns_append(struct nvme_zns_append_args *args); @@ -4144,7 +4180,8 @@ int nvme_zns_append(struct nvme_zns_append_args *args); * nvme_dim_send - Send a Discovery Information Management (DIM) command * @args: &struct nvme_dim_args argument structure * - * Return: 0 if the ioctl was successful 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_dim_send(struct nvme_dim_args *args);