summaryrefslogtreecommitdiffstats
path: root/src/nvme/fabrics.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-05 18:17:17 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-05 18:17:17 +0000
commit0e75b5495117b9888b7a557fab1db40145a9a705 (patch)
treee294b5156b7a85197e4b3192b6fba291a26dd5c6 /src/nvme/fabrics.h
parentAdding upstream version 1.1. (diff)
downloadlibnvme-0e75b5495117b9888b7a557fab1db40145a9a705.tar.xz
libnvme-0e75b5495117b9888b7a557fab1db40145a9a705.zip
Adding upstream version 1.2.upstream/1.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/nvme/fabrics.h')
-rw-r--r--src/nvme/fabrics.h44
1 files changed, 42 insertions, 2 deletions
diff --git a/src/nvme/fabrics.h b/src/nvme/fabrics.h
index 9e099fe..272bb40 100644
--- a/src/nvme/fabrics.h
+++ b/src/nvme/fabrics.h
@@ -195,9 +195,14 @@ int nvmf_add_ctrl(nvme_host_t h, nvme_ctrl_t c,
/**
* nvmf_get_discovery_log() - Return the discovery log page
- * @c: Discover controller to use
+ * @c: Discovery controller to use
* @logp: Pointer to the log page to be returned
- * @max_retries: maximum number of log page entries to be returned
+ * @max_retries: Number of retries in case of failure
+ *
+ * The memory allocated for the log page and returned in @logp
+ * must be freed by the caller using free().
+ *
+ * Note: Consider using nvmf_get_discovery_wargs() instead.
*
* Return: 0 on success; on failure -1 is returned and errno is set
*/
@@ -205,6 +210,41 @@ int nvmf_get_discovery_log(nvme_ctrl_t c, struct nvmf_discovery_log **logp,
int max_retries);
/**
+ * struct nvme_get_discovery_args - Arguments for nvmf_get_discovery_wargs()
+ * @c: Discovery controller
+ * @args_size: Length of the structure
+ * @max_retries: Number of retries in case of failure
+ * @result: The command completion result from CQE dword0
+ * @timeout: Timeout in ms (default: NVME_DEFAULT_IOCTL_TIMEOUT)
+ * @lsp: Log specific field (See enum nvmf_log_discovery_lsp)
+ */
+struct nvme_get_discovery_args {
+ nvme_ctrl_t c;
+ int args_size;
+ int max_retries;
+ __u32 *result;
+ __u32 timeout;
+ __u8 lsp;
+};
+
+/**
+ * nvmf_get_discovery_wargs() - Get the discovery log page with args
+ * @args: Argument structure
+ *
+ * This function is similar to nvmf_get_discovery_log(), but
+ * takes an extensible @args parameter. @args provides more
+ * options than nvmf_get_discovery_log().
+ *
+ * This function performs a get discovery log page (DLP) command
+ * and returns the DLP. The memory allocated for the returned
+ * DLP must be freed by the caller using free().
+ *
+ * Return: Pointer to the discovery log page (to be freed). NULL
+ * on failure and errno is set.
+ */
+struct nvmf_discovery_log *nvmf_get_discovery_wargs(struct nvme_get_discovery_args *args);
+
+/**
* nvmf_hostnqn_generate() - Generate a machine specific host nqn
* Returns: An nvm namespace qualified name string based on the machine
* identifier, or NULL if not successful.