Merging upstream version 1.2.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
de317aafca
commit
a2fa71affa
762 changed files with 7536 additions and 1096 deletions
|
@ -322,19 +322,94 @@ into the topology using **h** as parent.
|
|||
**Parameters**
|
||||
|
||||
``nvme_ctrl_t c``
|
||||
Discover controller to use
|
||||
Discovery controller to use
|
||||
|
||||
``struct nvmf_discovery_log **logp``
|
||||
Pointer to the log page to be returned
|
||||
|
||||
``int max_retries``
|
||||
maximum number of log page entries to be returned
|
||||
Number of retries in case of failure
|
||||
|
||||
**Description**
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
||||
.. c:struct:: nvme_get_discovery_args
|
||||
|
||||
Arguments for nvmf_get_discovery_wargs()
|
||||
|
||||
**Definition**
|
||||
|
||||
::
|
||||
|
||||
struct nvme_get_discovery_args {
|
||||
nvme_ctrl_t c;
|
||||
int args_size;
|
||||
int max_retries;
|
||||
__u32 *result;
|
||||
__u32 timeout;
|
||||
__u8 lsp;
|
||||
};
|
||||
|
||||
**Members**
|
||||
|
||||
``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)
|
||||
|
||||
|
||||
|
||||
.. c:function:: struct nvmf_discovery_log * nvmf_get_discovery_wargs (struct nvme_get_discovery_args *args)
|
||||
|
||||
Get the discovery log page with args
|
||||
|
||||
**Parameters**
|
||||
|
||||
``struct nvme_get_discovery_args *args``
|
||||
Argument structure
|
||||
|
||||
**Description**
|
||||
|
||||
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.
|
||||
|
||||
|
||||
.. c:function:: char * nvmf_hostnqn_generate ()
|
||||
|
||||
Generate a machine specific host nqn
|
||||
|
|
1457
doc/rst/mi.rst
1457
doc/rst/mi.rst
File diff suppressed because it is too large
Load diff
|
@ -824,7 +824,7 @@ A pointer to the 64-bit eui
|
|||
A pointer to the 128-bit nguid
|
||||
|
||||
|
||||
.. c:function:: void nvme_ns_get_uuid (nvme_ns_t n, uuid_t out)
|
||||
.. c:function:: void nvme_ns_get_uuid (nvme_ns_t n, unsigned char out[NVME_UUID_LEN])
|
||||
|
||||
UUID of a namespace
|
||||
|
||||
|
@ -833,7 +833,7 @@ A pointer to the 128-bit nguid
|
|||
``nvme_ns_t n``
|
||||
Namespace instance
|
||||
|
||||
``uuid_t out``
|
||||
``unsigned char out[NVME_UUID_LEN]``
|
||||
buffer for the UUID
|
||||
|
||||
**Description**
|
||||
|
@ -1477,6 +1477,33 @@ Host transport address of **c** (if present)
|
|||
Host interface name of **c** (if present)
|
||||
|
||||
|
||||
.. c:function:: const char * nvme_ctrl_get_dhchap_host_key (nvme_ctrl_t c)
|
||||
|
||||
Return host key
|
||||
|
||||
**Parameters**
|
||||
|
||||
``nvme_ctrl_t c``
|
||||
Controller to be checked
|
||||
|
||||
**Return**
|
||||
|
||||
DH-HMAC-CHAP host key or NULL if not set
|
||||
|
||||
|
||||
.. c:function:: void nvme_ctrl_set_dhchap_host_key (nvme_ctrl_t c, const char *key)
|
||||
|
||||
Set host key
|
||||
|
||||
**Parameters**
|
||||
|
||||
``nvme_ctrl_t c``
|
||||
Host for which the key should be set
|
||||
|
||||
``const char *key``
|
||||
DH-HMAC-CHAP Key to set or NULL to clear existing key
|
||||
|
||||
|
||||
.. c:function:: const char * nvme_ctrl_get_dhchap_key (nvme_ctrl_t c)
|
||||
|
||||
Return controller key
|
||||
|
|
|
@ -7551,6 +7551,48 @@ bytes, in size. This log captures the controller’s internal state.
|
|||
|
||||
|
||||
|
||||
.. c:enum:: nvmf_log_discovery_lid_support
|
||||
|
||||
Discovery log specific support
|
||||
|
||||
**Constants**
|
||||
|
||||
``NVMF_LOG_DISC_LID_NONE``
|
||||
None
|
||||
|
||||
``NVMF_LOG_DISC_LID_EXTDLPES``
|
||||
Extended Discovery Log Page Entries Supported
|
||||
|
||||
``NVMF_LOG_DISC_LID_PLEOS``
|
||||
Port Local Entries Only Supported
|
||||
|
||||
``NVMF_LOG_DISC_LID_ALLSUBES``
|
||||
All NVM Subsystem Entries Supported
|
||||
|
||||
|
||||
|
||||
|
||||
.. c:enum:: nvmf_log_discovery_lsp
|
||||
|
||||
Discovery log specific field
|
||||
|
||||
**Constants**
|
||||
|
||||
``NVMF_LOG_DISC_LSP_NONE``
|
||||
None
|
||||
|
||||
``NVMF_LOG_DISC_LSP_EXTDLPE``
|
||||
Extended Discovery Log Page Entries
|
||||
|
||||
``NVMF_LOG_DISC_LSP_PLEO``
|
||||
Port Local Entries Only
|
||||
|
||||
``NVMF_LOG_DISC_LSP_ALLSUBE``
|
||||
All NVM Subsystem Entries
|
||||
|
||||
|
||||
|
||||
|
||||
.. c:struct:: nvmf_discovery_log
|
||||
|
||||
Discovery Log Page (Log Identifier 70h)
|
||||
|
@ -9483,6 +9525,88 @@ status code
|
|||
|
||||
|
||||
|
||||
.. c:enum:: nvme_status_type
|
||||
|
||||
type encoding for NVMe return values, when represented as an int.
|
||||
|
||||
**Constants**
|
||||
|
||||
``NVME_STATUS_TYPE_SHIFT``
|
||||
shift value for status bits
|
||||
|
||||
``NVME_STATUS_TYPE_MASK``
|
||||
mask value for status bits
|
||||
|
||||
``NVME_STATUS_TYPE_NVME``
|
||||
NVMe command status value, typically from CDW3
|
||||
|
||||
``NVME_STATUS_TYPE_MI``
|
||||
NVMe-MI header status
|
||||
|
||||
**Description**
|
||||
|
||||
|
||||
The nvme_* api returns an int, with negative values indicating an internal
|
||||
or syscall error, zero signifying success, positive values representing
|
||||
the NVMe status.
|
||||
|
||||
That latter case (the NVMe status) may represent status values from
|
||||
different parts of the transport/controller/etc, and are at most 16 bits of
|
||||
data. So, we use the most-significant 3 bits of the signed int to indicate
|
||||
which type of status this is.
|
||||
|
||||
|
||||
.. c:function:: __u32 nvme_status_get_type (int status)
|
||||
|
||||
extract the type from a nvme_* return value
|
||||
|
||||
**Parameters**
|
||||
|
||||
``int status``
|
||||
the (non-negative) return value from the NVMe API
|
||||
|
||||
**Return**
|
||||
|
||||
the type component of the status.
|
||||
|
||||
|
||||
.. c:function:: __u32 nvme_status_get_value (int status)
|
||||
|
||||
extract the status value from a nvme_* return value
|
||||
|
||||
**Parameters**
|
||||
|
||||
``int status``
|
||||
the (non-negative) return value from the NVMe API
|
||||
|
||||
**Return**
|
||||
|
||||
the value component of the status; the set of values will depend
|
||||
on the status type.
|
||||
|
||||
|
||||
.. c:function:: __u32 nvme_status_equals (int status, enum nvme_status_type type, unsigned int value)
|
||||
|
||||
helper to check a status against a type and value
|
||||
|
||||
**Parameters**
|
||||
|
||||
``int status``
|
||||
the (non-negative) return value from the NVMe API
|
||||
|
||||
``enum nvme_status_type type``
|
||||
the status type
|
||||
|
||||
``unsigned int value``
|
||||
the status value
|
||||
|
||||
**Return**
|
||||
|
||||
true if **status** is of the specified type and value
|
||||
|
||||
|
||||
|
||||
|
||||
.. c:enum:: nvme_admin_opcode
|
||||
|
||||
Known NVMe admin opcodes
|
||||
|
@ -10592,6 +10716,27 @@ status code
|
|||
|
||||
|
||||
|
||||
.. c:enum:: nvme_data_tfr
|
||||
|
||||
Data transfer direction of the command
|
||||
|
||||
**Constants**
|
||||
|
||||
``NVME_DATA_TFR_NO_DATA_TFR``
|
||||
No data transfer
|
||||
|
||||
``NVME_DATA_TFR_HOST_TO_CTRL``
|
||||
Host to controller
|
||||
|
||||
``NVME_DATA_TFR_CTRL_TO_HOST``
|
||||
Controller to host
|
||||
|
||||
``NVME_DATA_TFR_BIDIRECTIONAL``
|
||||
Bidirectional
|
||||
|
||||
|
||||
|
||||
|
||||
.. c:enum:: nvme_io_opcode
|
||||
|
||||
Opcodes for I/O Commands
|
||||
|
|
|
@ -246,6 +246,33 @@ otherwise.
|
|||
recognize :c:type:`fid`.
|
||||
|
||||
|
||||
.. c:function:: int nvme_get_feature_length2 (int fid, __u32 cdw11, enum nvme_data_tfr dir, __u32 *len)
|
||||
|
||||
Retreive the command payload length for a specific feature identifier
|
||||
|
||||
**Parameters**
|
||||
|
||||
``int fid``
|
||||
Feature identifier, see :c:type:`enum nvme_features_id <nvme_features_id>`.
|
||||
|
||||
``__u32 cdw11``
|
||||
The cdw11 value may affect the transfer (only known fid is
|
||||
``NVME_FEAT_FID_HOST_ID``)
|
||||
|
||||
``enum nvme_data_tfr dir``
|
||||
Data transfer direction: false - host to controller, true -
|
||||
controller to host may affect the transfer (only known fid is
|
||||
``NVME_FEAT_FID_HOST_MEM_BUF``).
|
||||
|
||||
``__u32 *len``
|
||||
On success, set to this features payload length in bytes.
|
||||
|
||||
**Return**
|
||||
|
||||
0 on success, -1 with errno set to EINVAL if the function did not
|
||||
recognize :c:type:`fid`.
|
||||
|
||||
|
||||
.. c:function:: int nvme_get_directive_receive_length (enum nvme_directive_dtype dtype, enum nvme_directive_receive_doper doper, __u32 *len)
|
||||
|
||||
Get directive receive length
|
||||
|
@ -492,3 +519,56 @@ Pointer to the next element in the array.
|
|||
Returns version string for known types or else "n/a"
|
||||
|
||||
|
||||
.. c:function:: int nvme_uuid_to_string (unsigned char uuid[NVME_UUID_LEN], char *str)
|
||||
|
||||
Return string represenation of encoded UUID
|
||||
|
||||
**Parameters**
|
||||
|
||||
``unsigned char uuid[NVME_UUID_LEN]``
|
||||
Binary encoded input UUID
|
||||
|
||||
``char *str``
|
||||
Output string represenation of UUID
|
||||
|
||||
**Return**
|
||||
|
||||
Returns error code if type conversion fails.
|
||||
|
||||
|
||||
.. c:function:: int nvme_uuid_from_string (const char *str, unsigned char uuid[NVME_UUID_LEN])
|
||||
|
||||
Return encoded UUID represenation of string UUID
|
||||
|
||||
**Parameters**
|
||||
|
||||
``const char *str``
|
||||
Output string represenation of UUID
|
||||
|
||||
``unsigned char uuid[NVME_UUID_LEN]``
|
||||
Binary encoded input UUID
|
||||
|
||||
**Return**
|
||||
|
||||
Returns error code if type conversion fails.
|
||||
|
||||
|
||||
.. c:function:: int nvme_uuid_random (unsigned char uuid[NVME_UUID_LEN])
|
||||
|
||||
Generate random UUID
|
||||
|
||||
**Parameters**
|
||||
|
||||
``unsigned char uuid[NVME_UUID_LEN]``
|
||||
Generated random UUID
|
||||
|
||||
**Description**
|
||||
|
||||
Generate random number according
|
||||
https://www.rfc-editor.org/rfc/rfc4122#section-4.4
|
||||
|
||||
**Return**
|
||||
|
||||
Returns error code if generating of random number fails.
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue