* NVME_LOG_LID_PERSISTENT_EVENT:
* NVME_LOG_LID_LBA_STATUS:
* NVME_LOG_LID_ENDURANCE_GRP_EVT:
- * NVME_LOG_LID_DISC:
+ * NVME_LOG_LID_DISCOVER:
* NVME_LOG_LID_RESERVATION:
* NVME_LOG_LID_SANITIZE:
*/
enum nvme_cmd_get_log_lid {
NVME_LOG_LID_ERROR = 0x01,
NVME_LOG_LID_SMART = 0x02,
- NVME_LOG_LID_FW_SLOT = 0x03,
- NVME_LOG_LID_CHANGED_NS = 0x04,
+ NVME_LOG_LID_FW_SLOT = 0x03,
+ NVME_LOG_LID_CHANGED_NS = 0x04,
NVME_LOG_LID_CMD_EFFECTS = 0x05,
- NVME_LOG_LID_DEVICE_SELF_TEST = 0x06,
+ NVME_LOG_LID_DEVICE_SELF_TEST = 0x06,
NVME_LOG_LID_TELEMETRY_HOST = 0x07,
NVME_LOG_LID_TELEMETRY_CTRL = 0x08,
- NVME_LOG_LID_ENDURANCE_GROUP = 0x09,
+ NVME_LOG_LID_ENDURANCE_GROUP = 0x09,
NVME_LOG_LID_PREDICTABLE_LAT_NVMSET = 0x0a,
NVME_LOG_LID_PREDICTABLE_LAT_AGG = 0x0b,
NVME_LOG_LID_ANA = 0x0c,
- NVME_LOG_LID_PERSISTENT_EVENT = 0x0d,
- NVME_LOG_LID_LBA_STATUS = 0x0e,
- NVME_LOG_LID_ENDURANCE_GRP_EVT = 0x0f,
- NVME_LOG_LID_DISC = 0x70,
+ NVME_LOG_LID_PERSISTENT_EVENT = 0x0d,
+ NVME_LOG_LID_LBA_STATUS = 0x0e,
+ NVME_LOG_LID_ENDURANCE_GRP_EVT = 0x0f,
+ NVME_LOG_LID_DISCOVER = 0x70,
NVME_LOG_LID_RESERVATION = 0x80,
- NVME_LOG_LID_SANITIZE = 0x81,
+ NVME_LOG_LID_SANITIZE = 0x81,
};
/**
* Return: The nvme command status if a response was received or -1 with errno
* set otherwise.
*/
-int nvme_identify_allocated_ns_list(int fd, __u32 nsid, struct nvme_ns_list *list);
+int nvme_identify_allocated_ns_list(int fd, __u32 nsid,
+ struct nvme_ns_list *list);
/**
* nvme_identify_ctrl_list() - Retrieves identify controller list
* Return: The nvme command status if a response was received or -1 with errno
* set otherwise.
*/
-int nvme_identify_nvmset_list(int fd, __u16 nvmsetid, struct nvme_id_nvmset_list *nvmset);
+int nvme_identify_nvmset_list(int fd, __u16 nvmsetid,
+ struct nvme_id_nvmset_list *nvmset);
/**
* nvme_identify_primary_ctrl() - Retrieve NVMe Primary Controller
* Return: The nvme command status if a response was received or -1
* with errno set otherwise.
*/
-int nvme_identify_primary_ctrl(int fd, __u16 cntid, struct nvme_primary_ctrl_cap *cap);
+int nvme_identify_primary_ctrl(int fd, __u16 cntid,
+ struct nvme_primary_ctrl_cap *cap);
/**
* nvme_identify_secondary_ctrl_list() - Retrieves secondary controller list
* Return: The nvme command status if a response was received or -1 with errno
* set otherwise.
*/
-int nvme_identify_secondary_ctrl_list(int fd, __u16 cntid, struct nvme_secondary_ctrl_list *list);
+int nvme_identify_secondary_ctrl_list(int fd, __u16 cntid,
+ struct nvme_secondary_ctrl_list *list);
/**
* nvme_identify_ns_granularity() - Retrieves namespace granularity
* @len: Length of provided user buffer to hold the log data in bytes
* @log: User address for log page data
*/
-int nvme_get_log_telemetry_ctrl(int fd, bool rae, __u64 offset, __u32 len, void *log);
+int nvme_get_log_telemetry_ctrl(int fd, bool rae, __u64 offset, __u32 len,
+ void *log);
/**
* nvme_get_log_endurance_group() -
* Return: The nvme command status if a response was received or -1 with errno
* set otherwise.
*/
-int nvme_get_log_endurance_group(int fd, __u16 endgid, struct nvme_endurance_group_log *log);
+int nvme_get_log_endurance_group(int fd, __u16 endgid,
+ struct nvme_endurance_group_log *log);
/**
* nvme_get_log_predictable_lat_nvmset() -
/**
* nvme_set_features_arbitration() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_arbitration(int fd, __u8 ab, __u8 lpw, __u8 mpw,
__u8 hpw, bool save, __u32 *result);
/**
* nvme_set_features_power_mgmt() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_power_mgmt(int fd, __u8 ps, __u8 wh, bool save,
__u32 *result);
/**
* nvme_set_features_lba_range() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_lba_range(int fd, __u32 nsid, __u32 nr_ranges, bool save,
struct nvme_lba_range_type *data, __u32 *result);
/**
* nvme_set_features_temp_thresh() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_temp_thresh(int fd, __u16 tmpth, __u8 tmpsel,
enum nvme_feat_tmpthresh_thsel thsel,
/**
* nvme_set_features_err_recovery() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_err_recovery(int fd, __u32 nsid, __u16 tler,
bool dulbe, bool save, __u32 *result);
/**
* nvme_set_features_volatile_wc() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_volatile_wc(int fd, bool wce, bool save,
__u32 *result);
/**
* nvme_set_features_irq_coalesce() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_irq_coalesce(int fd, __u8 thr, __u8 time,
bool save, __u32 *result);
/**
* nvme_set_features_irq_config() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_irq_config(int fd, __u16 iv, bool cd, bool save,
__u32 *result);
/**
* nvme_set_features_write_atomic() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_write_atomic(int fd, bool dn, bool save,
__u32 *result);
/**
* nvme_set_features_async_event() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_async_event(int fd, __u32 events, bool save,
__u32 *result);
/**
* nvme_set_features_auto_pst() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_auto_pst(int fd, bool apste, bool save,
struct nvme_feat_auto_pst *apst,
/**
* nvme_set_features_timestamp() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_timestamp(int fd, bool save, __u64 timestamp);
/**
* nvme_set_features_hctm() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_hctm(int fd, __u16 tmt2, __u16 tmt1, bool save,
__u32 *result);
/**
* nvme_set_features_rrl() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_rrl(int fd, __u8 rrl, __u16 nvmsetid, bool save,
__u32 *result);
/**
* nvme_set_features_plm_config() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_plm_config(int fd, bool enable, __u16 nvmsetid,
bool save, struct nvme_plm_config *data,
/**
* nvme_set_features_plm_window() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_plm_window(int fd, enum nvme_feat_plm_window_select sel,
__u16 nvmsetid, bool save, __u32 *result);
/**
* nvme_set_features_lba_sts_interval() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_lba_sts_interval(int fd, __u16 lsiri, __u16 lsipi,
bool save, __u32 *result);
/**
* nvme_set_features_host_behavior() -
+ * @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.
*/
int nvme_set_features_host_behavior(int fd, bool save,
struct nvme_feat_host_behavior *data);
/**
* nvme_set_features_sanitize() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_sanitize(int fd, bool nodrm, bool save, __u32 *result);
/**
* nvme_set_features_endurance_evt_cfg() -
- * @fd:
+ * @fd: File descriptor of nvme device
* @endgid:
* @egwarn: Flags to enable warning, see &enum nvme_eg_critical_warning_flags
+ * @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.
*/
int nvme_set_features_endurance_evt_cfg(int fd, __u16 endgid, __u8 egwarn,
bool save, __u32 *result);
/**
* nvme_set_features_sw_progress() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_sw_progress(int fd, __u8 pbslc, bool save,
__u32 *result);
/**
* nvme_set_features_host_id() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_host_id(int fd, bool exhid, bool save, __u8 *hostid);
/**
* nvme_set_features_resv_mask() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_resv_mask(int fd, __u32 mask, bool save, __u32 *result);
/**
* nvme_set_features_resv_persist() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_resv_persist(int fd, bool ptpl, bool save, __u32 *result);
/**
* nvme_set_features_write_protect() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_set_features_write_protect(int fd, enum nvme_feat_nswpcfg_state state,
bool save, __u32 *result);
/**
* nvme_get_features_arbitration() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_arbitration(int fd, enum nvme_get_features_sel sel,
__u32 *result);
/**
* nvme_get_features_power_mgmt() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_power_mgmt(int fd, enum nvme_get_features_sel sel,
__u32 *result);
/**
* nvme_get_features_lba_range() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_lba_range(int fd, enum nvme_get_features_sel sel,
struct nvme_lba_range_type *data,
/**
* nvme_get_features_temp_thresh() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_temp_thresh(int fd, enum nvme_get_features_sel sel,
__u32 *result);
/**
* nvme_get_features_err_recovery() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_err_recovery(int fd, enum nvme_get_features_sel sel,
__u32 *result);
/**
* nvme_get_features_volatile_wc() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_volatile_wc(int fd, enum nvme_get_features_sel sel,
__u32 *result);
/**
* nvme_get_features_num_queues() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_num_queues(int fd, enum nvme_get_features_sel sel,
__u32 *result);
/**
* nvme_get_features_irq_coalesce() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_irq_coalesce(int fd, enum nvme_get_features_sel sel,
__u32 *result);
/**
* nvme_get_features_irq_config() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_irq_config(int fd, enum nvme_get_features_sel sel,
__u16 iv, __u32 *result);
/**
* nvme_get_features_write_atomic() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_write_atomic(int fd, enum nvme_get_features_sel sel,
__u32 *result);
/**
* nvme_get_features_async_event() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_async_event(int fd, enum nvme_get_features_sel sel,
__u32 *result);
/**
* nvme_get_features_auto_pst() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_auto_pst(int fd, enum nvme_get_features_sel sel,
struct nvme_feat_auto_pst *apst, __u32 *result);
/**
* nvme_get_features_host_mem_buf() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_host_mem_buf(int fd, enum nvme_get_features_sel sel,
__u32 *result);
/**
* nvme_get_features_timestamp() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_timestamp(int fd, enum nvme_get_features_sel sel,
struct nvme_timestamp *ts);
/**
* nvme_get_features_kato() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_kato(int fd, enum nvme_get_features_sel sel, __u32 *result);
/**
* nvme_get_features_hctm() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_hctm(int fd, enum nvme_get_features_sel sel, __u32 *result);
/**
* nvme_get_features_nopsc() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_nopsc(int fd, enum nvme_get_features_sel sel, __u32 *result);
/**
* nvme_get_features_rrl() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_rrl(int fd, enum nvme_get_features_sel sel, __u32 *result);
/**
* nvme_get_features_plm_config() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_plm_config(int fd, enum nvme_get_features_sel sel,
__u16 nvmsetid, struct nvme_plm_config *data,
/**
* nvme_get_features_plm_window() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_plm_window(int fd, enum nvme_get_features_sel sel,
__u16 nvmsetid, __u32 *result);
/**
* nvme_get_features_lba_sts_interval() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_lba_sts_interval(int fd, enum nvme_get_features_sel sel,
__u32 *result);
/**
* nvme_get_features_host_behavior() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_host_behavior(int fd, enum nvme_get_features_sel sel,
struct nvme_feat_host_behavior *data,
/**
* nvme_get_features_sanitize() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_sanitize(int fd, enum nvme_get_features_sel sel,
__u32 *result);
/**
* nvme_get_features_endurance_event_cfg() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_endurance_event_cfg(int fd, enum nvme_get_features_sel sel,
__u16 endgid, __u32 *result);
/**
* nvme_get_features_sw_progress() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_sw_progress(int fd, enum nvme_get_features_sel sel,
__u32 *result);
/**
* nvme_get_features_host_id() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_host_id(int fd, enum nvme_get_features_sel sel,
bool exhid, __u32 len, __u8 *hostid);
/**
* nvme_get_features_resv_mask() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_resv_mask(int fd, enum nvme_get_features_sel sel,
__u32 *result);
/**
* nvme_get_features_resv_persist() -
+ * @fd: File descriptor of nvme device
+ * @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.
*/
int nvme_get_features_resv_persist(int fd, enum nvme_get_features_sel sel,
__u32 *result);
/**
* nvme_get_features_write_protect() -
+ * @fd: File descriptor of nvme device
+ * @nsid: Namespace ID
+ * @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.
*/
int nvme_get_features_write_protect(int fd, __u32 nsid,
enum nvme_get_features_sel sel,
__u32 *result);
/**
- * DOC: NVMe IO command enums
+ * DOC: NVMe IO command
*/
/**
/**
* nvme_read() - Submit an nvme user read command
* @fd: File descriptor of nvme device
- * @nsid:
+ * @nsid: Namespace ID
* @slba: Starting logical block
* @nblocks: Number of logical blocks to send (0's based value)
* @control: Command control flags, see &enum nvme_io_control_flags.
/**
* nvme_write() - Submit an nvme user write command
* @fd: File descriptor of nvme device
- * @nsid:
+ * @nsid: Namespace ID
* @slba: Starting logical block
* @nblocks: Number of logical blocks to send (0's based value)
* @control: Command control flags, see &enum nvme_io_control_flags.
/**
* nvme_compare() - Submit an nvme user compare command
* @fd: File descriptor of nvme device
- * @nsid:
+ * @nsid: Namespace ID
* @slba: Starting logical block
* @nblocks: Number of logical blocks to send (0's based value)
* @control: Command control flags, see &enum nvme_io_control_flags.
#include "ioctl.h"
#include "util.h"
-extern const char *nvme_ctrl_sysfs_dir;
-extern const char *nvme_subsys_sysfs_dir;
-
typedef struct nvme_ns *nvme_ns_t;
typedef struct nvme_path *nvme_path_t;
typedef struct nvme_ctrl *nvme_ctrl_t;
typedef struct nvme_subsystem *nvme_subsystem_t;
typedef struct nvme_root *nvme_root_t;
+/**
+ * nvme_first_subsystem() -
+ */
nvme_subsystem_t nvme_first_subsystem(nvme_root_t r);
+
+/**
+ * nvme_next_subsystem() -
+ */
nvme_subsystem_t nvme_next_subsystem(nvme_root_t r, nvme_subsystem_t s);
+/**
+ * nvme_ctrl_first_ns() -
+ */
nvme_ns_t nvme_ctrl_first_ns(nvme_ctrl_t c);
+
+/**
+ * nvme_ctrl_next_ns() -
+ */
nvme_ns_t nvme_ctrl_next_ns(nvme_ctrl_t c, nvme_ns_t n);
+/**
+ * nvme_ctrl_first_path() -
+ */
nvme_path_t nvme_ctrl_first_path(nvme_ctrl_t c);
+
+/**
+ * nvme_ctrl_next_path() -
+ */
nvme_path_t nvme_ctrl_next_path(nvme_ctrl_t c, nvme_path_t p);
+/**
+ * nvme_subsystem_first_ctrl() -
+ */
nvme_ctrl_t nvme_subsystem_first_ctrl(nvme_subsystem_t s);
+
+/**
+ * nvme_subsystem_next_ctrl() -
+ */
nvme_ctrl_t nvme_subsystem_next_ctrl(nvme_subsystem_t s, nvme_ctrl_t c);
+/**
+ * nvme_subsystem_first_ns() -
+ */
nvme_ns_t nvme_subsystem_first_ns(nvme_subsystem_t s);
+
+/**
+ * nvme_subsystem_next_ns() -
+ */
nvme_ns_t nvme_subsystem_next_ns(nvme_subsystem_t s, nvme_ns_t n);
+/**
+ * ()
+ */
#define nvme_for_each_subsystem_safe(r, s, _s) \
for (s = nvme_first_subsystem(r), \
_s = nvme_next_subsystem(r, s); \
s != NULL; \
s = _s, _s = nvme_next_subsystem(r, s))
+/**
+ * ()
+ */
#define nvme_for_each_subsystem(r, s) \
for (s = nvme_first_subsystem(r); s != NULL; \
s = nvme_next_subsystem(r, s))
+/**
+ * ()
+ */
#define nvme_subsystem_for_each_ctrl_safe(s, c, _c) \
for (c = nvme_subsystem_first_ctrl(s), \
_c = nvme_subsystem_next_ctrl(s, c); \
c != NULL; \
c = _c, _c = nvme_subsystem_next_ctrl(s, c))
+/**
+ * ()
+ */
#define nvme_subsystem_for_each_ctrl(s, c) \
for (c = nvme_subsystem_first_ctrl(s); c != NULL; \
c = nvme_subsystem_next_ctrl(s, c))
+/**
+ * ()
+ */
#define nvme_ctrl_for_each_ns_safe(c, n, _n) \
for (n = nvme_ctrl_first_ns(c), \
_n = nvme_ctrl_next_ns(c, n); \
n != NULL; \
n = _n, _n = nvme_ctrl_next_ns(c, n))
+/**
+ * ()
+ */
#define nvme_ctrl_for_each_ns(c, n) \
for (n = nvme_ctrl_first_ns(c); n != NULL; \
n = nvme_ctrl_next_ns(c, n))
+/**
+ * ()
+ */
#define nvme_ctrl_for_each_path_safe(c, p, _p) \
for (p = nvme_ctrl_first_path(c), \
_p = nvme_ctrl_next_path(c, p); \
p != NULL; \
p = _p, _p = nvme_ctrl_next_path(c, p))
+/**
+ * ()
+ */
#define nvme_ctrl_for_each_path(c, p) \
for (p = nvme_ctrl_first_path(c); p != NULL; \
p = nvme_ctrl_next_path(c, p))
+/**
+ * ()
+ */
#define nvme_subsystem_for_each_ns_safe(s, n, _n) \
for (n = nvme_subsystem_first_ns(s), \
_n = nvme_subsystem_next_ns(s, n); \
n != NULL; \
n = _n, _n = nvme_subsystem_next_ns(s, n))
+/**
+ * ()
+ */
#define nvme_subsystem_for_each_ns(s, n) \
for (n = nvme_subsystem_first_ns(s); n != NULL; \
n = nvme_subsystem_next_ns(s, n))
+/**
+ * nvme_ns_get_fd() -
+ */
int nvme_ns_get_fd(nvme_ns_t n);
+
+/**
+ * nvme_ns_get_nsid() -
+ */
int nvme_ns_get_nsid(nvme_ns_t n);
+
+/**
+ * nvme_ns_get_lba_size() -
+ */
int nvme_ns_get_lba_size(nvme_ns_t n);
+
+/**
+ * nvme_ns_get_lba_count() -
+ */
uint64_t nvme_ns_get_lba_count(nvme_ns_t n);
+
+/**
+ * nvme_ns_get_lba_util() -
+ */
uint64_t nvme_ns_get_lba_util(nvme_ns_t n);
+
+/**
+ * char () -
+ */
const char *nvme_ns_get_sysfs_dir(nvme_ns_t n);
+
+/**
+ * char () -
+ */
const char *nvme_ns_get_name(nvme_ns_t n);
+
+/**
+ * nvme_ns_get_subsystem() -
+ */
nvme_subsystem_t nvme_ns_get_subsystem(nvme_ns_t n);
+
+/**
+ * nvme_ns_get_ctrl() -
+ */
nvme_ctrl_t nvme_ns_get_ctrl(nvme_ns_t n);
/**
*/
int nvme_ns_identify(nvme_ns_t n, struct nvme_id_ns *ns);
+/**
+ * char () -
+ */
const char *nvme_path_get_name(nvme_path_t p);
+
+/**
+ * char () -
+ */
const char *nvme_path_get_sysfs_dir(nvme_path_t p);
+
+/**
+ * char () -
+ */
const char *nvme_path_get_ana_state(nvme_path_t p);
+
+/**
+ * nvme_path_get_subsystem() -
+ */
nvme_ctrl_t nvme_path_get_subsystem(nvme_path_t p);
+
+/**
+ * nvme_path_get_ns() -
+ */
nvme_ns_t nvme_path_get_ns(nvme_path_t p);
int nvme_ctrl_get_fd(nvme_ctrl_t c);
+/**
+ * char () -
+ */
const char *nvme_ctrl_get_name(nvme_ctrl_t c);
+/**
+ * char () -
+ */
const char *nvme_ctrl_get_sysfs_dir(nvme_ctrl_t c);
+/**
+ * char () -
+ */
const char *nvme_ctrl_get_address(nvme_ctrl_t c);
+/**
+ * char () -
+ */
const char *nvme_ctrl_get_firmware(nvme_ctrl_t c);
+/**
+ * char () -
+ */
const char *nvme_ctrl_get_model(nvme_ctrl_t c);
+/**
+ * char () -
+ */
const char *nvme_ctrl_get_state(nvme_ctrl_t c);
+/**
+ * char () -
+ */
const char *nvme_ctrl_get_numa_node(nvme_ctrl_t c);
+/**
+ * char () -
+ */
const char *nvme_ctrl_get_queue_count(nvme_ctrl_t c);
+/**
+ * char () -
+ */
const char *nvme_ctrl_get_serial(nvme_ctrl_t c);
+/**
+ * char () -
+ */
const char *nvme_ctrl_get_sqsize(nvme_ctrl_t c);
+/**
+ * char () -
+ */
const char *nvme_ctrl_get_transport(nvme_ctrl_t c);
+/**
+ * char () -
+ */
const char *nvme_ctrl_get_nqn(nvme_ctrl_t c);
+/**
+ * char () -
+ */
const char *nvme_ctrl_get_subsysnqn(nvme_ctrl_t c);
+/**
+ * nvme_ctrl_get_subsystem() -
+ */
nvme_subsystem_t nvme_ctrl_get_subsystem(nvme_ctrl_t c);
+/**
+ * nvme_ctrl_identify() -
+ */
int nvme_ctrl_identify(nvme_ctrl_t c, struct nvme_id_ctrl *id);
+/**
+ * nvme_ctrl_disconnect() -
+ */
int nvme_ctrl_disconnect(nvme_ctrl_t c);
+/**
+ * nvme_scan_ctrl() -
+ */
nvme_ctrl_t nvme_scan_ctrl(const char *name);
+/**
+ * nvme_free_ctrl() -
+ */
void nvme_free_ctrl(struct nvme_ctrl *c);
+/**
+ * nvme_unlink_ctrl() -
+ */
void nvme_unlink_ctrl(struct nvme_ctrl *c);
+/**
+ * char () -
+ */
const char *nvme_subsystem_get_nqn(nvme_subsystem_t s);
+/**
+ * char () -
+ */
const char *nvme_subsystem_get_sysfs_dir(nvme_subsystem_t s);
+/**
+ * char () -
+ */
const char *nvme_subsystem_get_name(nvme_subsystem_t s);
typedef bool (*nvme_scan_filter_t)(nvme_subsystem_t);
+
+/**
+ * nvme_scan_filter() -
+ */
nvme_root_t nvme_scan_filter(nvme_scan_filter_t f);
+/**
+ * nvme_scan() -
+ */
nvme_root_t nvme_scan();
+
+/**
+ * nvme_refresh_topology() -
+ */
void nvme_refresh_topology(nvme_root_t r);
+
+/**
+ * nvme_reset_topology() -
+ */
void nvme_reset_topology(nvme_root_t r);
+
+/**
+ * nvme_free_tree() -
+ */
void nvme_free_tree(nvme_root_t r);
+/**
+ * *() -
+ */
char *nvme_get_subsys_attr(nvme_subsystem_t s, const char *attr);
+
+/**
+ * *() -
+ */
char *nvme_get_ctrl_attr(nvme_ctrl_t c, const char *attr);
+
+/**
+ * *() -
+ */
char *nvme_get_ns_attr(nvme_ns_t n, const char *attr);
+
+/**
+ * *() -
+ */
char *nvme_get_path_attr(nvme_path_t p, const char *attr);
+extern const char *nvme_ctrl_sysfs_dir;
+extern const char *nvme_subsys_sysfs_dir;
#endif /* _LIBNVME_TREE_H */