text:
# nvme_mi_admin_get_log_rotational_media_info(2)

## NAME
nvme_mi_admin_get_log_rotational_media_info - Retrieve Rotational Media Information Log

## SYNOPSIS
int nvme_mi_admin_get_log_rotational_media_info (nvme_mi_ctrl_t ctrl , __u16 endgid , __u32 len , struct nvme_rotational_media_info_log *log );

## ARGUMENTS
ctrl

Controller to query

endgid

Endurance Group Identifier

len

The allocated length of the log page

log

User address to store the log page

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise


package: libnvme-devel

title: nvme_mi_admin_get_log_sanitize(2)

summary: Retrieve Sanitize Status

text:
# nvme_mi_admin_get_log_sanitize(2)

## NAME
nvme_mi_admin_get_log_sanitize - Retrieve Sanitize Status

## SYNOPSIS
int nvme_mi_admin_get_log_sanitize (nvme_mi_ctrl_t ctrl , bool rae , struct nvme_sanitize_log_page *log );

## ARGUMENTS
ctrl

Controller to query

rae

Retain asynchronous events

log

User address to store the sanitize log

## DESCRIPTION
The Sanitize Status log page reports sanitize operation time estimates and information about the most recent sanitize operation.

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_mi_admin_get_log_simple(2)

text:
# nvme_mi_admin_get_log_simple(2)

## NAME
nvme_mi_admin_get_log_simple - Helper for Get Log Page functions with no NSID or RAE requirements

## SYNOPSIS
int nvme_mi_admin_get_log_simple (nvme_mi_ctrl_t ctrl , enum nvme_cmd_get_log_lid lid , __u32 len , void *log );

## ARGUMENTS
ctrl

Controller to query

lid

Log identifier

len

length of log buffer

log

pointer for resulting log data

## DESCRIPTION
Performs a Get Log Page Admin command for a specific log ID lid, using NVME_NSID_ALL for the namespace identifier, and rae set to false.

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_mi_admin_get_log_smart(2)

summary: Retrieve nvme smart log

text:
# nvme_mi_admin_get_log_smart(2)

## NAME
nvme_mi_admin_get_log_smart - Retrieve nvme smart log

## SYNOPSIS
int nvme_mi_admin_get_log_smart (nvme_mi_ctrl_t ctrl , __u32 nsid , bool rae , struct nvme_smart_log *smart_log );

## ARGUMENTS
ctrl

Controller to query

nsid

Optional namespace identifier

rae

Retain asynchronous events

smart_log

User address to store the smart log

## DESCRIPTION
This log page provides SMART and general health information. The information provided is over the life of the controller and is retained across power cycles. To request the controller log page, the namespace identifier specified is FFFFFFFFh. The controller may also support requesting the log page on a per namespace basis, as indicated by bit 0 of the LPA field in the Identify Controller data structure.

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


text:
# nvme_mi_admin_get_log_support_cap_config_list(2)

## NAME
nvme_mi_admin_get_log_support_cap_config_list - Retrieve Supported Capacity Configuration List

## SYNOPSIS
int nvme_mi_admin_get_log_support_cap_config_list (nvme_mi_ctrl_t ctrl , __u16 domid , struct nvme_supported_cap_config_list_log *cap );

## ARGUMENTS
ctrl

Controller to query

domid

Domain Identifier selection, if supported

cap

User address to store supported capabilities config list

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


summary: Retrieve nmve supported log pages

text:
# nvme_mi_admin_get_log_supported_log_pages(2)

## NAME
nvme_mi_admin_get_log_supported_log_pages - Retrieve nmve supported log pages

## SYNOPSIS
int nvme_mi_admin_get_log_supported_log_pages (nvme_mi_ctrl_t ctrl , bool rae , struct nvme_supported_log_pages *log );

## ARGUMENTS
ctrl

Controller to query

rae

Retain asynchronous events

log

Array of LID supported and Effects data structures

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_mi_admin_get_log_telemetry_ctrl(2)

text:
# nvme_mi_admin_get_log_telemetry_ctrl(2)

## NAME
nvme_mi_admin_get_log_telemetry_ctrl - Get Telemetry Controller-Initiated log page

## SYNOPSIS
int nvme_mi_admin_get_log_telemetry_ctrl (nvme_mi_ctrl_t ctrl , bool rae , __u64 offset , __u32 len , void *log );

## ARGUMENTS
ctrl

Controller to query

rae

Retain asynchronous events

offset

Offset into the telemetry data

len

Length of provided user buffer to hold the log data in bytes

log

User address for log page data

## DESCRIPTION
Retrieves the Telemetry Controller-Initiated log page at the requested offset using the previously existing capture.

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_mi_admin_get_log_telemetry_host(2)

summary: Get Telemetry Host-Initiated log page

text:
# nvme_mi_admin_get_log_telemetry_host(2)

## NAME
nvme_mi_admin_get_log_telemetry_host - Get Telemetry Host-Initiated log page

## SYNOPSIS
int nvme_mi_admin_get_log_telemetry_host (nvme_mi_ctrl_t ctrl , __u64 offset , __u32 len , void *log );

## ARGUMENTS
ctrl

Controller to query

offset

Offset into the telemetry data

len

Length of provided user buffer to hold the log data in bytes

log

User address for log page data

## DESCRIPTION
Retrieves the Telemetry Host-Initiated log page at the requested offset using the previously existing capture.

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


text:
# nvme_mi_admin_get_log_zns_changed_zones(2)

## NAME
nvme_mi_admin_get_log_zns_changed_zones - Retrieve list of zones that have changed

## SYNOPSIS
int nvme_mi_admin_get_log_zns_changed_zones (nvme_mi_ctrl_t ctrl , __u32 nsid , bool rae , struct nvme_zns_changed_zone_log *log );

## ARGUMENTS
ctrl

Controller to query

nsid

Namespace ID

rae

Retain asynchronous events

log

User address to store the changed zone log

## DESCRIPTION
The list of zones that have changed state due to an exceptional event.

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_mi_admin_get_nsid_log(2)

summary: Helper for Get Log Page functions

text:
# nvme_mi_admin_get_nsid_log(2)

## NAME
nvme_mi_admin_get_nsid_log - Helper for Get Log Page functions

## SYNOPSIS
int nvme_mi_admin_get_nsid_log (nvme_mi_ctrl_t ctrl , bool rae , enum nvme_cmd_get_log_lid lid , __u32 nsid , __u32 len , void *log );

## ARGUMENTS
ctrl

Controller to query

rae

Retain Asynchronous Events

lid

Log identifier

nsid

Namespace ID

len

length of log buffer

log

pointer for resulting log data

## DESCRIPTION
Performs a Get Log Page Admin command for a specific log ID lid and namespace ID nsid. Log data is expected to be len bytes, and is stored in log on success. The rae flag is passed as-is to the Get Log Page command, and is specific to the Log Page requested.

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_mi_admin_identify(2)

summary: Perform an Admin identify command.

text:
# nvme_mi_admin_identify(2)

## NAME
nvme_mi_admin_identify - Perform an Admin identify command.

## SYNOPSIS
int nvme_mi_admin_identify (nvme_mi_ctrl_t ctrl , struct nvme_identify_args *args );

## ARGUMENTS
ctrl

Controller to process identify command

args

Identify command arguments

## DESCRIPTION
Perform an Identify command, using the Identify command parameters in args. Stores the identify data in ->data, and (if set) the result from cdw0 into args->result.

Will return an error if the length of the response data (from the controller) is not a full NVME_IDENTIFY_DATA_SIZE.

See: struct nvme_identify_args

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


text:
# nvme_mi_admin_identify_active_ns_list(2)

## NAME
nvme_mi_admin_identify_active_ns_list - Perform an Admin identify for an active namespace list

## SYNOPSIS
int nvme_mi_admin_identify_active_ns_list (nvme_mi_ctrl_t ctrl , __u32 nsid , struct nvme_ns_list *list );

## ARGUMENTS
ctrl

Controller to process identify command

nsid

Namespace ID to specify list start

list

List data to populate

## DESCRIPTION
Perform an Identify command, for the active namespace list starting with IDs greater than or equal to nsid. Specify NVME_NSID_NONE for the start of the list.

Will return an error if the length of the response data (from the controller) is not a full NVME_IDENTIFY_DATA_SIZE, so list will be be fully populated on success.

See: struct nvme_ns_list

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_mi_admin_identify_allocated_ns(2)

text:
# nvme_mi_admin_identify_allocated_ns(2)

## NAME
nvme_mi_admin_identify_allocated_ns - Perform an Admin identify command for an allocated namespace

## SYNOPSIS
int nvme_mi_admin_identify_allocated_ns (nvme_mi_ctrl_t ctrl , __u32 nsid , struct nvme_id_ns *ns );

## ARGUMENTS
ctrl

Controller to process identify command

nsid

namespace ID

ns

Namespace identification to populate

## DESCRIPTION
Perform an Identify (namespace) command, setting the namespace id data in ns.

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


text:
# nvme_mi_admin_identify_allocated_ns_list(2)

## NAME
nvme_mi_admin_identify_allocated_ns_list - Perform an Admin identify for an allocated namespace list

## SYNOPSIS
int nvme_mi_admin_identify_allocated_ns_list (nvme_mi_ctrl_t ctrl , __u32 nsid , struct nvme_ns_list *list );

## ARGUMENTS
ctrl

Controller to process identify command

nsid

Namespace ID to specify list start

list

List data to populate

## DESCRIPTION
Perform an Identify command, for the allocated namespace list starting with IDs greater than or equal to nsid. Specify NVME_NSID_NONE for the start of the list.

Will return an error if the length of the response data (from the controller) is not a full NVME_IDENTIFY_DATA_SIZE, so list will be be fully populated on success.

See: struct nvme_ns_list

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_mi_admin_identify_cns_nsid(2)

text:
# nvme_mi_admin_identify_cns_nsid(2)

## NAME
nvme_mi_admin_identify_cns_nsid - Perform an Admin identify command using specific CNS/NSID parameters.

## SYNOPSIS
int nvme_mi_admin_identify_cns_nsid (nvme_mi_ctrl_t ctrl , enum nvme_identify_cns cns , __u32 nsid , void *data );

## ARGUMENTS
ctrl

Controller to process identify command

cns

Controller or Namespace Structure, specifying identified object

nsid

namespace ID

data

buffer for identify data response

## DESCRIPTION
Perform an Identify command, using the CNS specifier cns, and the namespace ID nsid if required by the CNS type.

Stores the identify data in data, which is expected to be a buffer of NVME_IDENTIFY_DATA_SIZE bytes.

Will return an error if the length of the response data (from the controller) is not a full NVME_IDENTIFY_DATA_SIZE.

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_mi_admin_identify_ctrl(2)

text:
# nvme_mi_admin_identify_ctrl(2)

## NAME
nvme_mi_admin_identify_ctrl - Perform an Admin identify for a controller

## SYNOPSIS
int nvme_mi_admin_identify_ctrl (nvme_mi_ctrl_t ctrl , struct nvme_id_ctrl *id );

## ARGUMENTS
ctrl

Controller to process identify command

id

Controller identify data to populate

## DESCRIPTION
Perform an Identify command, for the controller specified by ctrl, writing identify data to id.

Will return an error if the length of the response data (from the controller) is not a full NVME_IDENTIFY_DATA_SIZE, so id will be fully populated on success.

See: struct nvme_id_ctrl

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_mi_admin_identify_ctrl_list(2)

text:
# nvme_mi_admin_identify_ctrl_list(2)

## NAME
nvme_mi_admin_identify_ctrl_list - Perform an Admin identify for a controller list.

## SYNOPSIS
int nvme_mi_admin_identify_ctrl_list (nvme_mi_ctrl_t ctrl , __u16 cntid , struct nvme_ctrl_list *list );

## ARGUMENTS
ctrl

Controller to process identify command

cntid

Controller ID to specify list start

list

List data to populate

## DESCRIPTION
Perform an Identify command, for the controller list starting with IDs greater than or equal to cntid.

Will return an error if the length of the response data (from the controller) is not a full NVME_IDENTIFY_DATA_SIZE, so id will be fully populated on success.

See: struct nvme_ctrl_list

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_mi_admin_identify_ns(2)

text:
# nvme_mi_admin_identify_ns(2)

## NAME
nvme_mi_admin_identify_ns - Perform an Admin identify command for a namespace

## SYNOPSIS
int nvme_mi_admin_identify_ns (nvme_mi_ctrl_t ctrl , __u32 nsid , struct nvme_id_ns *ns );

## ARGUMENTS
ctrl

Controller to process identify command

nsid

namespace ID

ns

Namespace identification to populate

## DESCRIPTION
Perform an Identify (namespace) command, setting the namespace id data in ns. The namespace is expected to active and allocated.

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_mi_admin_identify_ns_descs(2)

text:
# nvme_mi_admin_identify_ns_descs(2)

## NAME
nvme_mi_admin_identify_ns_descs - Perform an Admin identify Namespace Identification Descriptor list command for a namespace

## SYNOPSIS
int nvme_mi_admin_identify_ns_descs (nvme_mi_ctrl_t ctrl , __u32 nsid , struct nvme_ns_id_desc *descs );

## ARGUMENTS
ctrl

Controller to process identify command

nsid

Namespace ID

descs

Namespace Identification Descriptor list to populate

## DESCRIPTION
Perform an Identify namespace identification description list command, setting the namespace identification description list in descs

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


text:
# nvme_mi_admin_identify_nsid_ctrl_list(2)

## NAME
nvme_mi_admin_identify_nsid_ctrl_list - Perform an Admin identify for a controller list with specific namespace ID

## SYNOPSIS
int nvme_mi_admin_identify_nsid_ctrl_list (nvme_mi_ctrl_t ctrl , __u32 nsid , __u16 cntid , struct nvme_ctrl_list *list );

## ARGUMENTS
ctrl

Controller to process identify command

nsid

Namespace identifier

cntid

Controller ID to specify list start

list

List data to populate

## DESCRIPTION
Perform an Identify command, for the controller list for nsid, starting with IDs greater than or equal to cntid.

Will return an error if the length of the response data (from the controller) is not a full NVME_IDENTIFY_DATA_SIZE, so id will be fully populated on success.

See: struct nvme_ctrl_list

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_mi_admin_identify_partial(2)

text:
# nvme_mi_admin_identify_partial(2)

## NAME
nvme_mi_admin_identify_partial - Perform an Admin identify command, and retrieve partial response data.

## SYNOPSIS
int nvme_mi_admin_identify_partial (nvme_mi_ctrl_t ctrl , struct nvme_identify_args *args , off_t offset , size_t size );

## ARGUMENTS
ctrl

Controller to process identify command

args

Identify command arguments

offset

offset of identify data to retrieve from response

size

size of identify data to return

## DESCRIPTION
Perform an Identify command, using the Identify command parameters in args. The offset and size arguments allow the caller to retrieve part of the identify response. See NVMe-MI section 6.2 for the semantics (and some handy diagrams) of the offset & size parameters.

Will return an error if the length of the response data (from the controller) did not match size.

Unless you're performing a vendor-unique identify command, You'll probably want to use one of the identify helpers (nvme_mi_admin_identify, nvme_mi_admin_identify_cns_nsid, or nvme_mi_admin_identify_<type>) instead of this. If the type of your identify command is standardized but not yet supported by libnvme-mi, please contact the maintainers.

See: struct nvme_identify_args

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_mi_admin_identify_primary_ctrl(2)

text:
# nvme_mi_admin_identify_primary_ctrl(2)

## NAME
nvme_mi_admin_identify_primary_ctrl - Perform an Admin identify for primary controller capabilities data structure.

## SYNOPSIS
int nvme_mi_admin_identify_primary_ctrl (nvme_mi_ctrl_t ctrl , __u16 cntid , struct nvme_primary_ctrl_cap *cap );

## ARGUMENTS
ctrl

Controller to process identify command

cntid

Controller ID to specify

cap

Primary Controller Capabilities data structure to populate

## DESCRIPTION
Perform an Identify command to get the Primary Controller Capabilities data for the controller specified by cntid

Will return an error if the length of the response data (from the controller) is not a full NVME_IDENTIFY_DATA_SIZE, so cap will be be fully populated on success.

See: struct nvme_primary_ctrl_cap

## RETURN
0 on success, non-zero on failure


text:
# nvme_mi_admin_identify_secondary_ctrl_list(2)

## NAME
nvme_mi_admin_identify_secondary_ctrl_list - Perform an Admin identify for a secondary controller list.

## SYNOPSIS
int nvme_mi_admin_identify_secondary_ctrl_list (nvme_mi_ctrl_t ctrl , __u16 cntid , struct nvme_secondary_ctrl_list *list );

## ARGUMENTS
ctrl

Controller to process identify command

cntid

Controller ID to specify list start

list

List data to populate

## DESCRIPTION
Perform an Identify command, for the secondary controllers associated with the current primary controller. Only entries with IDs greater than or equal to cntid are returned.

Will return an error if the length of the response data (from the controller) is not a full NVME_IDENTIFY_DATA_SIZE, so list will be be fully populated on success.

See: struct nvme_secondary_ctrl_list

## RETURN
0 on success, non-zero on failure


title: nvme_mi_admin_ns_attach(2)

text:
# nvme_mi_admin_ns_attach(2)

## NAME
nvme_mi_admin_ns_attach - Attach or detach namespace to controller(s)

## SYNOPSIS
int nvme_mi_admin_ns_attach (nvme_mi_ctrl_t ctrl , struct nvme_ns_attach_args *args );

## ARGUMENTS
ctrl

Controller to send command to

args

Namespace Attach command arguments

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_mi_admin_ns_attach_ctrls(2)

summary: Attach namespace to controllers

text:
# nvme_mi_admin_ns_attach_ctrls(2)

## NAME
nvme_mi_admin_ns_attach_ctrls - Attach namespace to controllers

## SYNOPSIS
int nvme_mi_admin_ns_attach_ctrls (nvme_mi_ctrl_t ctrl , __u32 nsid , struct nvme_ctrl_list *ctrlist );

## ARGUMENTS
ctrl

Controller to send command to

nsid

Namespace ID to attach

ctrlist

Controller list to modify attachment state of nsid

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_mi_admin_ns_detach_ctrls(2)

summary: Detach namespace from controllers

text:
# nvme_mi_admin_ns_detach_ctrls(2)

## NAME
nvme_mi_admin_ns_detach_ctrls - Detach namespace from controllers

## SYNOPSIS
int nvme_mi_admin_ns_detach_ctrls (nvme_mi_ctrl_t ctrl , __u32 nsid , struct nvme_ctrl_list *ctrlist );

## ARGUMENTS
ctrl

Controller to send command to

nsid

Namespace ID to detach

ctrlist

Controller list to modify attachment state of nsid

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_mi_admin_req_hdr(2)

summary: Admin command request header.

text:
# nvme_mi_admin_req_hdr(2)

## NAME
struct nvme_mi_admin_req_hdr - Admin command request header.

## SYNOPSIS
struct nvme_mi_admin_req_hdr {

struct nvme_mi_msg_hdr hdr;

__u8 opcode;

__u8 flags;

__le16 ctrl_id;

__le32 cdw1, cdw2, cdw3, cdw4, cdw5;

__le32 doff;

__le32 dlen;

__le32 rsvd0, rsvd1;

__le32 cdw10, cdw11, cdw12, cdw13, cdw14, cdw15;

};

## Members
hdr

Generic MI message header

opcode

Admin command opcode (using enum nvme_admin_opcode)

flags

Command Flags, indicating dlen and doff validity; Only defined in NVMe-MI version 1.1, no fields defined in 1.2 (where the dlen/doff are always considered valid).

ctrl_id

Controller ID target of command

cdw1

Submission Queue Entry doubleword 1

cdw2

Submission Queue Entry doubleword 2

cdw3

Submission Queue Entry doubleword 3

cdw4

Submission Queue Entry doubleword 4

cdw5

Submission Queue Entry doubleword 5

doff

Offset of data to return from command

dlen

Length of sent/returned data

rsvd0

Reserved

rsvd1

Reserved

cdw10

Submission Queue Entry doubleword 10

cdw11

Submission Queue Entry doubleword 11

cdw12

Submission Queue Entry doubleword 12

cdw13

Submission Queue Entry doubleword 13

cdw14

Submission Queue Entry doubleword 14

cdw15

Submission Queue Entry doubleword 15

## Description
Wire format for Admin command message headers, defined in section 6 of NVMe-MI.


title: nvme_mi_admin_resp_hdr(2)

summary: Admin command response header.

text:
# nvme_mi_admin_resp_hdr(2)

## NAME
struct nvme_mi_admin_resp_hdr - Admin command response header.

## SYNOPSIS
struct nvme_mi_admin_resp_hdr {

struct nvme_mi_msg_hdr hdr;

__u8 status;

__u8 rsvd0[3];

__le32 cdw0, cdw1, cdw3;

};

## Members
hdr

Generic MI message header

status

Generic response code, non-zero on failure

rsvd0

Reserved

cdw0

Completion Queue Entry doubleword 0

cdw1

Completion Queue Entry doubleword 1

cdw3

Completion Queue Entry doubleword 3

## Description
This is the generic response format with the three doublewords of completion queue data, plus optional response data.


title: nvme_mi_admin_sanitize_nvm(2)

summary: Start a subsystem Sanitize operation

text:
# nvme_mi_admin_sanitize_nvm(2)

## NAME
nvme_mi_admin_sanitize_nvm - Start a subsystem Sanitize operation

## SYNOPSIS
int nvme_mi_admin_sanitize_nvm (nvme_mi_ctrl_t ctrl , struct nvme_sanitize_nvm_args *args );

## ARGUMENTS
ctrl

Controller to send command to

args

Sanitize command arguments

## DESCRIPTION
A sanitize operation alters all user data in the NVM subsystem such that recovery of any previous user data from any cache, the non-volatile media, or any Controller Memory Buffer is not possible.

The Sanitize command starts a sanitize operation or to recover from a previously failed sanitize operation. The sanitize operation types that may be supported are Block Erase, Crypto Erase, and Overwrite. All sanitize operations are processed in the background, i.e., completion of the sanitize command does not indicate completion of the sanitize operation.

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_mi_admin_security_recv(2)

text:
# nvme_mi_admin_security_recv(2)

## NAME
nvme_mi_admin_security_recv - Perform a Security Receive command on a controller.

## SYNOPSIS
int nvme_mi_admin_security_recv (nvme_mi_ctrl_t ctrl , struct nvme_security_receive_args *args );

## ARGUMENTS
ctrl

Controller to send command to

args

Security Receive command arguments

## DESCRIPTION
Performs a Security Receive Admin command as specified by args. Response data is stored in args->data, which should be a buffer of args->data_len bytes. Resulting data length is stored in args->data_len on successful command completion.

Security Receive data length should not be greater than 4096 bytes to comply with specification limits.

See: struct nvme_get_log_args

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_mi_admin_security_send(2)

text:
# nvme_mi_admin_security_send(2)

## NAME
nvme_mi_admin_security_send - Perform a Security Send command on a controller.

## SYNOPSIS
int nvme_mi_admin_security_send (nvme_mi_ctrl_t ctrl , struct nvme_security_send_args *args );

## ARGUMENTS
ctrl

Controller to send command to

args

Security Send command arguments

## DESCRIPTION
Performs a Security Send Admin command as specified by args. Response data is stored in args->data, which should be a buffer of args->data_len bytes. Resulting data length is stored in args->data_len on successful command completion.

Security Send data length should not be greater than 4096 bytes to comply with specification limits.

See: struct nvme_get_log_args

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


summary: Set power management feature

text:
# nvme_mi_admin_set_features_power_mgmt(2)

## NAME
nvme_mi_admin_set_features_power_mgmt - Set power management feature

## SYNOPSIS
int nvme_mi_admin_set_features_power_mgmt (nvme_mi_ctrl_t ctrl , __u8 ps , __u8 wh , bool save , __u32 *result );

## ARGUMENTS
ctrl

Controller to send command to

ps

Power State

wh

Workload Hint

save

Save value across power states

result

The feature data is returned in this argument

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_mi_admin_xfer(2)

summary: Raw admin transfer interface.

text:
# nvme_mi_admin_xfer(2)

## NAME
nvme_mi_admin_xfer - Raw admin transfer interface.

## SYNOPSIS
int nvme_mi_admin_xfer (nvme_mi_ctrl_t ctrl , struct nvme_mi_admin_req_hdr *admin_req , size_t req_data_size , struct nvme_mi_admin_resp_hdr *admin_resp , off_t resp_data_offset , size_t *resp_data_size );

## ARGUMENTS
ctrl

controller to send the admin command to

admin_req

request data

req_data_size

size of request data payload

admin_resp

buffer for response data

resp_data_offset

offset into request data to retrieve from controller

resp_data_size

size of response data buffer, updated to received size

## DESCRIPTION
Performs an arbitrary NVMe Admin command, using the provided request data, in admin_req. The size of the request data *payload* is specified in req_data_size - this does not include the standard header length (so a header-only request would have a size of 0).

On success, response data is stored in admin_resp, which has an optional appended payload buffer of resp_data_size bytes. The actual payload transferred will be stored in resp_data_size. These sizes do not include the Admin request header, so 0 represents no payload.

As with all Admin commands, we can request partial data from the Admin Response payload, offset by resp_data_offset.

See: struct nvme_mi_admin_req_hdr and struct nvme_mi_admin_resp_hdr.

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise..


title: nvme_mi_aem_aeei_get_aee(2)

summary: return aee from aeei field

text:
# nvme_mi_aem_aeei_get_aee(2)

## NAME
nvme_mi_aem_aeei_get_aee - return aee from aeei field

## SYNOPSIS
bool nvme_mi_aem_aeei_get_aee (__le16 aeei );

## ARGUMENTS
aeei

aeei field from nvme_mi_aem_enable_item

## RETURN
aee value


title: nvme_mi_aem_aeei_get_aeeid(2)

summary: return aeeid from aeei field

text:
# nvme_mi_aem_aeei_get_aeeid(2)

## NAME
nvme_mi_aem_aeei_get_aeeid - return aeeid from aeei field

## SYNOPSIS
__u8 nvme_mi_aem_aeei_get_aeeid (__le16 aeei );

## ARGUMENTS
aeei

aeei field from nvme_mi_aem_enable_item

## RETURN
aeeid value


title: nvme_mi_aem_aeei_set_aee(2)

summary: set aee in the aeei field

text:
# nvme_mi_aem_aeei_set_aee(2)

## NAME
nvme_mi_aem_aeei_set_aee - set aee in the aeei field

## SYNOPSIS
void nvme_mi_aem_aeei_set_aee (struct nvme_mi_aem_enable_item *item , bool enabled );

## ARGUMENTS
item

Pointer to nvme_mi_aem_enable_item to update the aee field

enabled

aee value to use


title: nvme_mi_aem_aeei_set_aeeid(2)

summary: set aeeid in the aeei field

text:
# nvme_mi_aem_aeei_set_aeeid(2)

## NAME
nvme_mi_aem_aeei_set_aeeid - set aeeid in the aeei field

## SYNOPSIS
void nvme_mi_aem_aeei_set_aeeid (struct nvme_mi_aem_enable_item *item , __u8 aeeid );

## ARGUMENTS
item

Pointer to nvme_mi_aem_enable_item to update the aeei field

aeeid

aeeid value to use


title: nvme_mi_aem_aemti_get_aemgn(2)

summary: return aemgn from aemti field

text:
# nvme_mi_aem_aemti_get_aemgn(2)

## NAME
nvme_mi_aem_aemti_get_aemgn - return aemgn from aemti field

## SYNOPSIS
__u8 nvme_mi_aem_aemti_get_aemgn (__u8 aemti );

## ARGUMENTS
aemti

aemti field from nvme_mi_aem_occ_list_hdr

## RETURN
aemgn value


title: nvme_mi_aem_aeolli_get_aeoltl(2)

summary: return aeoltl from aeolli field

text:
# nvme_mi_aem_aeolli_get_aeoltl(2)

## NAME
nvme_mi_aem_aeolli_get_aeoltl - return aeoltl from aeolli field

## SYNOPSIS
__u32 nvme_mi_aem_aeolli_get_aeoltl (__u8 *aeolli );

## ARGUMENTS
aeolli

Pointer to 3 byte aeolli field from nvme_mi_aem_occ_list_hdr

## RETURN
aeoltl value


title: nvme_mi_aem_aeolli_set_aeoltl(2)

summary: set aeoltl in the aeolli field

text:
# nvme_mi_aem_aeolli_set_aeoltl(2)

## NAME
nvme_mi_aem_aeolli_set_aeoltl - set aeoltl in the aeolli field

## SYNOPSIS
void nvme_mi_aem_aeolli_set_aeoltl (struct nvme_mi_aem_occ_list_hdr *hdr , __u32 aeoltl );

## ARGUMENTS
hdr

Pointer to nvme_mi_aem_occ_list_hdr to set the aeolli field

aeoltl

aeoltl value to use


title: nvme_mi_aem_aesi_get_aese(2)

summary: return aese from aesi field

text:
# nvme_mi_aem_aesi_get_aese(2)

## NAME
nvme_mi_aem_aesi_get_aese - return aese from aesi field

## SYNOPSIS
bool nvme_mi_aem_aesi_get_aese (__le16 aesi );

## ARGUMENTS
aesi

aesi field from nvme_mi_aem_supported_item

## RETURN
A bool representing the aese value


title: nvme_mi_aem_aesi_get_aesid(2)

summary: return aesid from aesi field

text:
# nvme_mi_aem_aesi_get_aesid(2)

## NAME
nvme_mi_aem_aesi_get_aesid - return aesid from aesi field

## SYNOPSIS
__u8 nvme_mi_aem_aesi_get_aesid (__le16 aesi );

## ARGUMENTS
aesi

aesi field from nvme_mi_aem_supported_item

## RETURN
aesid value


title: nvme_mi_aem_aesi_set_aee(2)

summary: set aee in the aesi field

text:
# nvme_mi_aem_aesi_set_aee(2)

## NAME
nvme_mi_aem_aesi_set_aee - set aee in the aesi field

## SYNOPSIS
void nvme_mi_aem_aesi_set_aee (struct nvme_mi_aem_supported_item *item , bool enabled );

## ARGUMENTS
item

Pointer to nvme_mi_aem_supported_item to update the aesi field

enabled

aee value to use


title: nvme_mi_aem_aesi_set_aesid(2)

summary: set aesid in the aesi field

text:
# nvme_mi_aem_aesi_set_aesid(2)

## NAME
nvme_mi_aem_aesi_set_aesid - set aesid in the aesi field

## SYNOPSIS
void nvme_mi_aem_aesi_set_aesid (struct nvme_mi_aem_supported_item *item , __u8 aesid );

## ARGUMENTS
item

Pointer to nvme_mi_aem_supported_item to update the aesi field

aesid

aesid value to use


title: nvme_mi_aem_config(2)

summary: Provided for nvme_mi_aem_enable

text:
# nvme_mi_aem_config(2)

## NAME
struct nvme_mi_aem_config - Provided for nvme_mi_aem_enable

## SYNOPSIS
struct nvme_mi_aem_config {

enum nvme_mi_aem_handler_next_action (*aem_handler)(nvme_mi_ep_t ep,size_t num_events, void *userdata);

struct nvme_mi_aem_enabled_map enabled_map;

bool envfa;

bool empfa;

bool encfa;

__u8 aemd;

__u8 aerd;

};

## Members
aem_handler

Callback function for application processing of events

enabled_map

Map indicating which AE should be enabled on the endpoint

envfa

Enable SR-IOV virtual functions AE

empfa

Enable SR-IOV physical functions AE

encfa

Enable PCIe functions AE

aemd

AEM Delay (time in seconds from when event happens to AEM being batched and sent)

aerd

AEM Retry Delay (time in 100s of ms between AEM retries from the endpoint)

## Description
Application callbacks for nvme_mi_aem_process will be able to call nvme_mi_aem_get_next_event which will return a pointer to such an identifier for the next event the application should parse


title: nvme_mi_aem_disable(2)

summary: Disable AE on the provided endpoint

text:
# nvme_mi_aem_disable(2)

## NAME
nvme_mi_aem_disable - Disable AE on the provided endpoint

## SYNOPSIS
int nvme_mi_aem_disable (nvme_mi_ep_t ep );

## ARGUMENTS
ep

Endpoint to disable AEs

## RETURN
0 is a success, nonzero is an error and errno may be read for further details


title: nvme_mi_aem_enable(2)

summary: Enable AE on the provided endpoint

text:
# nvme_mi_aem_enable(2)

## NAME
nvme_mi_aem_enable - Enable AE on the provided endpoint

## SYNOPSIS
int nvme_mi_aem_enable (nvme_mi_ep_t ep , struct nvme_mi_aem_config *config , void *userdata );

## ARGUMENTS
ep

Endpoint to enable AEs

config

AE configuraiton including which events are enabled and the callback function

userdata

Application provided context pointer for callback function

## DESCRIPTION
This function is called to enable AE on the endpoint. Endpoint will provide initial state (if any) of enabled AEs and application can parse those via the aem_handler fn pointer in callbacks. Thes can be obtained in the callback by calling nvme_mi_aem_get_next_event.

Application should poll the fd that can be obtained from nvme_mi_aem_get_fd and then call nvme_mi_aem_process when poll indicates data available.

A call to nvme_mi_aem_process will grab AEM data and call the aem_handler fn pointer. At this point the application can call nvme_mi_aem_get_next_event to get information for each triggered event.

## RETURN
0 is a success, nonzero is an error and errno may be read for further details


title: nvme_mi_aem_enable_item(2)

summary: AE Enabled item entry

text:
# nvme_mi_aem_enable_item(2)

## NAME
struct nvme_mi_aem_enable_item - AE Enabled item entry

## SYNOPSIS
struct nvme_mi_aem_enable_item {

__u8 aeel;

__le16 aeei;

};

## Members
aeel

AE Enable Length (length of this structure which is 3)

aeei

AE Enable Info


title: nvme_mi_aem_enable_list(2)

text:
# nvme_mi_aem_enable_list(2)

## NAME
struct nvme_mi_aem_enable_list - AE enable list sent with SET CONFIG Asyncronous Event

## SYNOPSIS
struct nvme_mi_aem_enable_list {

struct nvme_mi_aem_enable_list_header hdr;

};

## Members
hdr

AE enable list header

## Description
Following this header should be hdr.numaee entries of nvme_mi_aem_enable_item structures


title: nvme_mi_aem_enable_list_header(2)

summary: AE Enable list header

text:
# nvme_mi_aem_enable_list_header(2)

## NAME
struct nvme_mi_aem_enable_list_header - AE Enable list header

## SYNOPSIS
struct nvme_mi_aem_enable_list_header {

__u8 numaee;

__u8 aeelver;

__le16 aeetl;

__u8 aeelhl;

};

## Members
numaee

Number of AE enable items following the header

aeelver

Version of the AE enable list (zero)

aeetl

Total length of the AE enable list including header and items

aeelhl

Header length of this header (5)


title: nvme_mi_aem_get_enabled(2)

text:
# nvme_mi_aem_get_enabled(2)

## NAME
nvme_mi_aem_get_enabled - Return information on which AEs are enabled

## SYNOPSIS
int nvme_mi_aem_get_enabled (nvme_mi_ep_t ep , struct nvme_mi_aem_enabled_map *enabled );

## ARGUMENTS
ep

Endpoint to check enabled status

enabled

nvme_mi_aem_enabled_map indexed by AE event ID of enabled state

## RETURN
0 is a success, nonzero is an error and errno may be read for further details


title: nvme_mi_aem_get_fd(2)

text:
# nvme_mi_aem_get_fd(2)

## NAME
nvme_mi_aem_get_fd - Returns the pollable fd for AEM data available

## SYNOPSIS
int nvme_mi_aem_get_fd (nvme_mi_ep_t ep );

## ARGUMENTS
ep

The endpoint being monitored for asynchronous data

## DESCRIPTION
This populated structure can be polled from the application to understand if a call to nvme_mi_aem_process is required (when a poll returns > 0).

## RETURN
The fd value or -1 if error


title: nvme_mi_aem_get_next_event(2)

summary: Get details for the next event to parse

text:
# nvme_mi_aem_get_next_event(2)

## NAME
nvme_mi_aem_get_next_event - Get details for the next event to parse

## SYNOPSIS
struct nvme_mi_event * nvme_mi_aem_get_next_event (nvme_mi_ep_t ep );

## ARGUMENTS
ep

The endpoint with the event

## DESCRIPTION
When inside a aem_handler, call this and a returned struct pointer will provide details of event information. Will return NULL when end of parsing is occurred. spec_info and vend_spec_info must be copied to persist as they will not be valid after the handler_next_action has returned.

## RETURN
Pointer no next nvme_mi_event or NULL if this is the last one


title: nvme_mi_aem_handler_next_action(2)

text:
# nvme_mi_aem_handler_next_action(2)

## NAME
enum nvme_mi_aem_handler_next_action - Next action for the AEM state machine handler

## SYNOPSIS
enum nvme_mi_aem_handler_next_action {

NVME_MI_AEM_HNA_ACK ,

NVME_MI_AEM_HNA_NONE

};

## Constants
NVME_MI_AEM_HNA_ACK

Send an ack for the AEM

NVME_MI_AEM_HNA_NONE

No further action

## Description
Used as return value for the AE callback generated when calling nvme_mi_aem_process


title: nvme_mi_aem_msg(2)

summary: AEM Message definition.

text:
# nvme_mi_aem_msg(2)

## NAME
struct nvme_mi_aem_msg - AEM Message definition.

## SYNOPSIS
struct nvme_mi_aem_msg {

struct nvme_mi_msg_hdr hdr;

struct nvme_mi_aem_occ_list_hdr occ_list_hdr;

};

## Members
hdr

the general response message header

occ_list_hdr

ae occurrence list header.

## Description
Every ae message will start with one of these. The occ_list_hder wil define information about how many ae occ data entries are included. Each entry is defined by the nvme_mi_aem_occ_data structure which will follow the occ_list_hdr. Each nvme_mi_aem_occ_data structure has a fixed length header but a variable length payload ude to occurrence specific and vendor specific info. For this reason, do not index the nvme_mi_ae_occ data structures by array or fixed offset.


title: nvme_mi_aem_occ_data(2)

summary: AEM Message definition.

text:
# nvme_mi_aem_occ_data(2)

## NAME
struct nvme_mi_aem_occ_data - AEM Message definition.

## SYNOPSIS
struct nvme_mi_aem_occ_data {

__u8 aelhlen;

__u8 aeosil;

__u8 aeovsil;

struct {

__u8 aeoi;

__le32 aeocidi;

__u8 aessi;

} aeoui;

};

## Members
aelhlen

AE Occurrence Header Length

aeosil

AE Occurrence Specific Info Length

aeovsil

AE Occurrence Vendor Specific Info Length

aeoui

AE Occurrence Unique ID made up of other subfields

## Description
A single entry of ae occurrence data that comes with an nvme_aem_msg. Following this structure is variable length AEOSI (occurrence specific info) and variable length AEVSI (vendor specific info). The length of AEOSI is specified by aeosil and the length of AEVSI is specified by AEVSI. Neither field is mandatory and shall be omitted if their length parameter is set to zero.


title: nvme_mi_aem_occ_list_hdr(2)

summary: AE occurrence list header

text:
# nvme_mi_aem_occ_list_hdr(2)

## NAME
struct nvme_mi_aem_occ_list_hdr - AE occurrence list header

## SYNOPSIS
struct nvme_mi_aem_occ_list_hdr {

__u8 numaeo;

__u8 aelver;

__u8 aeolli[3];

__u8 aeolhl;

__u8 aemti;

};

## Members
numaeo

Number of AE Occurrence Data Structures

aelver

AE Occurrence List Version Number

aeolli

AE Occurrence List Length Info (AEOLLI)

aeolhl

AE Occurrence List Header Length (shall be set to 7)

aemti

AEM Transmission Info

## Description
The header for the occurrence list. numaeo defines how many nvme_mi_aem_occ_data structures (including variable payaloads) are included. Following this header is each of the numaeo occurrence data structures.


title: nvme_mi_aem_open(2)

text:
# nvme_mi_aem_open(2)

## NAME
nvme_mi_aem_open - Prepare an existing endpoint to receive AEMs

## SYNOPSIS
int nvme_mi_aem_open (nvme_mi_ep_t ep );

## ARGUMENTS
ep

Endpoint to configure for AEMs

## RETURN
0 if success, -1 otherwise


title: nvme_mi_aem_process(2)

summary: Process AEM on the provided endpoint

text:
# nvme_mi_aem_process(2)

## NAME
nvme_mi_aem_process - Process AEM on the provided endpoint

## SYNOPSIS
int nvme_mi_aem_process (nvme_mi_ep_t ep , void *userdata );

## ARGUMENTS
ep

Endpoint to process

userdata

Application provided context pointer for callback function

## DESCRIPTION
Call this if poll indicates data is available on the fd provided by nvme_mi_aem_get_fd

This will call the fn pointer, aem_handler, provided with nvme_mi_aem_config and the application can call nvme_mi_aem_get_next_event from within this callback to get aem event data. The callback function should return NVME_MI_AEM_HNA_ACK for normal operation.

## RETURN
0 is a success, nonzero is an error and errno may be read for further details


title: nvme_mi_aem_supported_item(2)

summary: AE Supported List Item

text:
# nvme_mi_aem_supported_item(2)

## NAME
struct nvme_mi_aem_supported_item - AE Supported List Item

## SYNOPSIS
struct nvme_mi_aem_supported_item {

__u8 aesl;

__le16 aesi;

};

## Members
aesl

AE supported list item length

aesi

AE supported info

## Description
Following this header should be hdr.numaes entries of nvme_mi_aem_supported_item structures


title: nvme_mi_aem_supported_list(2)

text:
# nvme_mi_aem_supported_list(2)

## NAME
struct nvme_mi_aem_supported_list - AE Supported List received with GET CONFIG Asynchronous Event

## SYNOPSIS
struct nvme_mi_aem_supported_list {

struct nvme_mi_aem_supported_list_header hdr;

};

## Members
hdr

AE supported list header

## Description
Following this header should be hdr.numaes entries of nvme_mi_aem_supported_item structures


title: nvme_mi_aem_supported_list_header(2)

text:
# nvme_mi_aem_supported_list_header(2)

## NAME
struct nvme_mi_aem_supported_list_header - Asynchronous Event Supported List Header.

## SYNOPSIS
struct nvme_mi_aem_supported_list_header {

__u8 numaes;

__u8 aeslver;

__le16 aest;

__u8 aeslhl;

};

## Members
numaes

Number of AE supported data structures that follow the header

aeslver

AE Supported List Version

aest

AE Supported list length (including this header)

aeslhl

AE Supported list header length

## Description
This header preceeds a number, (numaes), of AE supported data structures


title: nvme_mi_ccs(2)

text:
# nvme_mi_ccs(2)

## NAME
enum nvme_mi_ccs - Get State Control Primitive Success Response Fields - Control Primitive Specific Response

## SYNOPSIS
enum nvme_mi_ccs {

NVME_MI_CCS_RDY ,

NVME_MI_CCS_CFS ,

NVME_MI_CCS_SHST ,

NVME_MI_CCS_NSSRO ,

NVME_MI_CCS_CECO ,

NVME_MI_CCS_NAC ,

NVME_MI_CCS_FA ,

NVME_MI_CCS_CSTS ,

NVME_MI_CCS_CTEMP ,

NVME_MI_CCS_PDLU ,

NVME_MI_CCS_SPARE ,

NVME_MI_CCS_CCWARN

};

## Constants
NVME_MI_CCS_RDY

Ready

NVME_MI_CCS_CFS

Controller Fatal Status

NVME_MI_CCS_SHST

Shutdown Status

NVME_MI_CCS_NSSRO

NVM Subsystem Reset Occurred

NVME_MI_CCS_CECO

Controller Enable Change Occurred

NVME_MI_CCS_NAC

Namespace Attribute Changed

NVME_MI_CCS_FA

Firmware Activated

NVME_MI_CCS_CSTS

Controller Status Change

NVME_MI_CCS_CTEMP

Composite Temperature Change

NVME_MI_CCS_PDLU

Percentage Used

NVME_MI_CCS_SPARE

Available Spare

NVME_MI_CCS_CCWARN

Critical Warning


title: nvme_mi_close(2)

text:
# nvme_mi_close(2)

## NAME
nvme_mi_close - Close an endpoint connection and release resources, including controller objects.

## SYNOPSIS
void nvme_mi_close (nvme_mi_ep_t ep );

## ARGUMENTS
ep

Endpoint object to close


title: nvme_mi_close_ctrl(2)

summary: free a controller

text:
# nvme_mi_close_ctrl(2)

## NAME
nvme_mi_close_ctrl - free a controller

## SYNOPSIS
void nvme_mi_close_ctrl (nvme_mi_ctrl_t ctrl );

## ARGUMENTS
ctrl

controller to free


title: nvme_mi_cmd_supported_effects(2)

text:
# nvme_mi_cmd_supported_effects(2)

## NAME
enum nvme_mi_cmd_supported_effects - MI Command Supported and Effects Data Structure

## SYNOPSIS
enum nvme_mi_cmd_supported_effects {

NVME_MI_CMD_SUPPORTED_EFFECTS_CSUPP ,

NVME_MI_CMD_SUPPORTED_EFFECTS_UDCC ,

NVME_MI_CMD_SUPPORTED_EFFECTS_NCC ,

NVME_MI_CMD_SUPPORTED_EFFECTS_NIC ,

NVME_MI_CMD_SUPPORTED_EFFECTS_CCC ,

NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_SHIFT ,

NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_MASK ,

NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_NS ,

NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_CTRL ,

NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_NVM_SET ,

NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_ENDGRP ,

NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_DOMAIN ,

NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_NSS

};

## Constants
NVME_MI_CMD_SUPPORTED_EFFECTS_CSUPP

Command Supported

NVME_MI_CMD_SUPPORTED_EFFECTS_UDCC

User Data Content Change

NVME_MI_CMD_SUPPORTED_EFFECTS_NCC

Namespace Capability Change

NVME_MI_CMD_SUPPORTED_EFFECTS_NIC

Namespace Inventory Change

NVME_MI_CMD_SUPPORTED_EFFECTS_CCC

Controller Capability Change

NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_SHIFT

20 bit shift

NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_MASK

12 bit mask - 0xfff

NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_NS

Namespace Scope

NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_CTRL

Controller Scope

NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_NVM_SET

NVM Set Scope

NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_ENDGRP

Endurance Group Scope

NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_DOMAIN

Domain Scope

NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_NSS

NVM Subsystem Scope


title: nvme_mi_cmd_supported_effects_log(2)

text:
# nvme_mi_cmd_supported_effects_log(2)

## NAME
struct nvme_mi_cmd_supported_effects_log - NVMe-MI Commands Supported and Effects Log

## SYNOPSIS
struct nvme_mi_cmd_supported_effects_log {

__le32 mi_cmd_support[NVME_LOG_MI_CMD_SUPPORTED_EFFECTS_MAX];

__le32 reserved1[NVME_LOG_MI_CMD_SUPPORTED_EFFECTS_RESERVED];

};

## Members
mi_cmd_support

NVMe-MI Commands Supported

reserved1

Reserved


title: nvme_mi_config_id(2)

summary: NVMe-MI Configuration identifier.

text:
# nvme_mi_config_id(2)

## NAME
enum nvme_mi_config_id - NVMe-MI Configuration identifier.

## SYNOPSIS
enum nvme_mi_config_id {

NVME_MI_CONFIG_SMBUS_FREQ ,

NVME_MI_CONFIG_HEALTH_STATUS_CHANGE ,

NVME_MI_CONFIG_MCTP_MTU ,

NVME_MI_CONFIG_AE

};

## Constants
NVME_MI_CONFIG_SMBUS_FREQ

Current SMBus/I2C frequency

NVME_MI_CONFIG_HEALTH_STATUS_CHANGE

Health Status change - used to clear health status bits in CCS bits of status poll. Only for Set ops.

NVME_MI_CONFIG_MCTP_MTU

MCTP maximum transmission unit size of port specified in dw 0

NVME_MI_CONFIG_AE

Asynchronous Events configuration Configuration parameters for the MI Get/Set Configuration commands.

## Description
See &nvme_mi_mi_config_get and &nvme_mi_config_set.


title: nvme_mi_config_smbus_freq(2)

summary: SMBus/I2C frequency values

text:
# nvme_mi_config_smbus_freq(2)

## NAME
enum nvme_mi_config_smbus_freq - SMBus/I2C frequency values

## SYNOPSIS
enum nvme_mi_config_smbus_freq {

NVME_MI_CONFIG_SMBUS_FREQ_100kHz ,

NVME_MI_CONFIG_SMBUS_FREQ_400kHz ,

NVME_MI_CONFIG_SMBUS_FREQ_1MHz

};

## Constants
NVME_MI_CONFIG_SMBUS_FREQ_100kHz

100kHz

NVME_MI_CONFIG_SMBUS_FREQ_400kHz

400kHz

NVME_MI_CONFIG_SMBUS_FREQ_1MHz

1MHz

## Description
Values used in the SMBus Frequency device configuration. See &nvme_mi_mi_config_get_smbus_freq and &nvme_mi_mi_config_set_smbus_freq.


title: nvme_mi_control(2)

summary: Perform a Control Primitive command

text:
# nvme_mi_control(2)

## NAME
nvme_mi_control - Perform a Control Primitive command

## SYNOPSIS
int nvme_mi_control (nvme_mi_ep_t ep , __u8 opcode , __u16 cpsp , __u16 *result_cpsr );

## ARGUMENTS
ep

endpoint for MI communication

opcode

Control Primitive opcode (using enum nvme_mi_control_opcode)

cpsp

Control Primitive Specific Parameter

result_cpsr

Optional field to return the result from the CPSR field

## DESCRIPTION
Perform a Control Primitive command, using the opcode specified in opcode Stores the result from the CPSR field in result_cpsr if set.

See: enum nvme_mi_control_opcode

## RETURN
0 on success, non-zero on failure


title: nvme_mi_control_opcode(2)

summary: Operation code for Control Primitives.

text:
# nvme_mi_control_opcode(2)

## NAME
enum nvme_mi_control_opcode - Operation code for Control Primitives.

## SYNOPSIS
enum nvme_mi_control_opcode {

nvme_mi_control_opcode_pause ,

nvme_mi_control_opcode_resume ,

nvme_mi_control_opcode_abort ,

nvme_mi_control_opcode_get_state ,

nvme_mi_control_opcode_replay

};

## Constants
nvme_mi_control_opcode_pause

Suspend response transmission/timeout

nvme_mi_control_opcode_resume

Resume from a paused condition

nvme_mi_control_opcode_abort

Re-initialize a Command Slot to the Idle state

nvme_mi_control_opcode_get_state

Get the state of a Command Slot

nvme_mi_control_opcode_replay

Retransmit the Response Message


title: nvme_mi_control_req(2)

summary: The Control Primitive request.

text:
# nvme_mi_control_req(2)

## NAME
struct nvme_mi_control_req - The Control Primitive request.

## SYNOPSIS
struct nvme_mi_control_req {

struct nvme_mi_msg_hdr hdr;

__u8 opcode;

__u8 tag;

__le16 cpsp;

};

## Members
hdr

Generic MI message header

opcode

Control Primitive Opcodes (using enum nvme_mi_control_opcode)

tag

flag - Opaque value passed from request to response

cpsp

Control Primitive Specific Parameter


title: nvme_mi_create_root(2)

summary: Create top-level MI (root) handle.

text:
# nvme_mi_create_root(2)

## NAME
nvme_mi_create_root - Create top-level MI (root) handle.

## SYNOPSIS
nvme_root_t nvme_mi_create_root (FILE *fp , int log_level );

## ARGUMENTS
fp

File descriptor for logging messages

log_level

Logging level to use

## DESCRIPTION
Create the top-level (library) handle for creating subsequent endpoint objects. Similar to nvme_create_root, but we provide this to allow linking without the core libnvme.

See nvme_create_root.

## RETURN
new root object, or NULL on failure.


title: nvme_mi_csts(2)

text:
# nvme_mi_csts(2)

## NAME
enum nvme_mi_csts - Controller Health Data Structure (CHDS) - Controller Status (CSTS)

## SYNOPSIS
enum nvme_mi_csts {

NVME_MI_CSTS_RDY ,

NVME_MI_CSTS_CFS ,

NVME_MI_CSTS_SHST ,

NVME_MI_CSTS_NSSRO ,

NVME_MI_CSTS_CECO ,

NVME_MI_CSTS_NAC ,

NVME_MI_CSTS_FA

};

## Constants
NVME_MI_CSTS_RDY

Ready

NVME_MI_CSTS_CFS

Controller Fatal Status

NVME_MI_CSTS_SHST

Shutdown Status

NVME_MI_CSTS_NSSRO

NVM Subsystem Reset Occurred

NVME_MI_CSTS_CECO

Controller Enable Change Occurred

NVME_MI_CSTS_NAC

Namespace Attribute Changed

NVME_MI_CSTS_FA

Firmware Activated


title: nvme_mi_ctrl_health_status(2)

summary: Controller Health Data Structure (CHDS)

text:
# nvme_mi_ctrl_health_status(2)

## NAME
struct nvme_mi_ctrl_health_status - Controller Health Data Structure (CHDS)

## SYNOPSIS
struct nvme_mi_ctrl_health_status {

__le16 ctlid;

__le16 csts;

__le16 ctemp;

__u8 pdlu;

__u8 spare;

__u8 cwarn;

__u8 rsvd9[7];

};

## Members
ctlid

Controller Identifier

csts

Controller Status

ctemp

Composite Temperature

pdlu

Percentage Used

spare

Available Spare

cwarn

Critical Warning

rsvd9

Reserved


title: nvme_mi_ctrl_id(2)

summary: get the ID of a controller

text:
# nvme_mi_ctrl_id(2)

## NAME
nvme_mi_ctrl_id - get the ID of a controller

## SYNOPSIS
__u16 nvme_mi_ctrl_id (nvme_mi_ctrl_t ctrl );

## ARGUMENTS
ctrl

controller to query

## DESCRIPTION
Retrieve the ID of the controller, as defined by hardware, and available in the Identify (Controller List) data. This is the value passed to nvme_mi_init_ctrl, but may have been created internally via nvme_mi_scan_ep.

## RETURN
the (locally-stored) ID of this controller.


title: nvme_mi_cwarn(2)

text:
# nvme_mi_cwarn(2)

## NAME
enum nvme_mi_cwarn - Controller Health Data Structure (CHDS) - Critical Warning (CWARN)

## SYNOPSIS
enum nvme_mi_cwarn {

NVME_MI_CWARN_ST ,

NVME_MI_CWARN_TAUT ,

NVME_MI_CWARN_RD ,

NVME_MI_CWARN_RO ,

NVME_MI_CWARN_VMBF

};

## Constants
NVME_MI_CWARN_ST

Spare Threshold

NVME_MI_CWARN_TAUT

Temperature Above or Under Threshold

NVME_MI_CWARN_RD

Reliability Degraded

NVME_MI_CWARN_RO

Read Only

NVME_MI_CWARN_VMBF

Volatile Memory Backup Failed


title: nvme_mi_dtyp(2)

summary: Data Structure Type field.

text:
# nvme_mi_dtyp(2)

## NAME
enum nvme_mi_dtyp - Data Structure Type field.

## SYNOPSIS
enum nvme_mi_dtyp {

nvme_mi_dtyp_subsys_info ,

nvme_mi_dtyp_port_info ,

nvme_mi_dtyp_ctrl_list ,

nvme_mi_dtyp_ctrl_info ,

nvme_mi_dtyp_opt_cmd_support ,

nvme_mi_dtyp_meb_support

};

## Constants
nvme_mi_dtyp_subsys_info

NVM Subsystem Information

nvme_mi_dtyp_port_info

Port information

nvme_mi_dtyp_ctrl_list

Controller List

nvme_mi_dtyp_ctrl_info

Controller Information

nvme_mi_dtyp_opt_cmd_support

Optionally Supported Command List

nvme_mi_dtyp_meb_support

Management Endpoint Buffer Command Support List

## Description
Data Structure Type field for Read NVMe-MI Data Structure command, used to indicate the particular structure to query from the endpoint.


title: nvme_mi_elem(2)

summary: Element Descriptor Types

text:
# nvme_mi_elem(2)

## NAME
enum nvme_mi_elem - Element Descriptor Types

## SYNOPSIS
enum nvme_mi_elem {

NVME_MI_ELEM_EED ,

NVME_MI_ELEM_USCE ,

NVME_MI_ELEM_ECED ,

NVME_MI_ELEM_LED ,

NVME_MI_ELEM_SMBMED ,

NVME_MI_ELEM_PCIESED ,

NVME_MI_ELEM_NVMED

};

## Constants
NVME_MI_ELEM_EED

Extended Element Descriptor

NVME_MI_ELEM_USCE

Upstream Connector Element Descriptor

NVME_MI_ELEM_ECED

Expansion Connector Element Descriptor

NVME_MI_ELEM_LED

Label Element Descriptor

NVME_MI_ELEM_SMBMED

SMBus/I2C Mux Element Descriptor

NVME_MI_ELEM_PCIESED

PCIe Switch Element Descriptor

NVME_MI_ELEM_NVMED

NVM Subsystem Element Descriptor


title: nvme_mi_event(2)

summary: AE event information structure

text:
# nvme_mi_event(2)

## NAME
struct nvme_mi_event - AE event information structure

## SYNOPSIS
struct nvme_mi_event {

uint8_t aeoi;

uint8_t aessi;

uint32_t aeocidi;

void *spec_info;

size_t spec_info_len;

void *vend_spec_info;

size_t vend_spec_info_len;

};

## Members
aeoi

Event identifier

aessi

Event occurrence scope info

aeocidi

Event occurrence scope ID info

spec_info

Specific info buffer

spec_info_len

Length of specific info buffer

vend_spec_info

Vendor specific info buffer

vend_spec_info_len

Length of vendor specific info buffer

## Description
Application callbacks for nvme_mi_aem_process will be able to call nvme_mi_aem_get_next_event which will return a pointer to such an identifier for the next event the application should parse


title: nvme_mi_free_root(2)

summary: Free root object.

text:
# nvme_mi_free_root(2)

## NAME
nvme_mi_free_root - Free root object.

## SYNOPSIS
void nvme_mi_free_root (nvme_root_t root );

## ARGUMENTS
root

root to free


title: nvme_mi_init_ctrl(2)

summary: initialise a NVMe controller.

text:
# nvme_mi_init_ctrl(2)

## NAME
nvme_mi_init_ctrl - initialise a NVMe controller.

## SYNOPSIS
nvme_mi_ctrl_t nvme_mi_init_ctrl (nvme_mi_ep_t ep , __u16 ctrl_id );

## ARGUMENTS
ep

Endpoint to create under

ctrl_id

ID of controller to initialize.

## DESCRIPTION
Create a connection to a controller behind the endpoint specified in ep. Controller IDs may be queried from the endpoint through nvme_mi_mi_read_mi_data_ctrl_list.

See nvme_mi_close_ctrl

## RETURN
New controller object, or NULL on failure.


title: nvme_mi_message_type(2)

summary: NVMe-MI message type field.

text:
# nvme_mi_message_type(2)

## NAME
enum nvme_mi_message_type - NVMe-MI message type field.

## SYNOPSIS
enum nvme_mi_message_type {

NVME_MI_MT_CONTROL ,

NVME_MI_MT_MI ,

NVME_MI_MT_ADMIN ,

NVME_MI_MT_PCIE ,

NVME_MI_MT_AE

};

## Constants
NVME_MI_MT_CONTROL

NVME-MI Control Primitive

NVME_MI_MT_MI

NVMe-MI command

NVME_MI_MT_ADMIN

NVMe Admin command

NVME_MI_MT_PCIE

PCIe command

NVME_MI_MT_AE

Asynchronous Event

## Description
Used as byte 1 of both request and response messages (NMIMT bits of NMP byte). Not to be confused with the MCTP message type in byte 0.


title: nvme_mi_mi_opcode(2)

text:
# nvme_mi_mi_opcode(2)

## NAME
enum nvme_mi_mi_opcode - Operation code for supported NVMe-MI commands.

## SYNOPSIS
enum nvme_mi_mi_opcode {

nvme_mi_mi_opcode_mi_data_read ,

nvme_mi_mi_opcode_subsys_health_status_poll ,

nvme_mi_mi_opcode_configuration_set ,

nvme_mi_mi_opcode_configuration_get

};

## Constants
nvme_mi_mi_opcode_mi_data_read

Read NVMe-MI Data Structure

nvme_mi_mi_opcode_subsys_health_status_poll

Subsystem Health Status Poll

nvme_mi_mi_opcode_configuration_set

MI Configuration Set

nvme_mi_mi_opcode_configuration_get

MI Configuration Get


title: nvme_mi_mi_read_mi_data_ctrl(2)

text:
# nvme_mi_mi_read_mi_data_ctrl(2)

## NAME
nvme_mi_mi_read_mi_data_ctrl - Perform a Read MI Data Structure command, retrieving controller information

## SYNOPSIS
int nvme_mi_mi_read_mi_data_ctrl (nvme_mi_ep_t ep , __u16 ctrl_id , struct nvme_mi_read_ctrl_info *ctrl );

## ARGUMENTS
ep

endpoint for MI communication

ctrl_id

ID of controller to query

ctrl

controller data to populate

## DESCRIPTION
Retrieves the Controller Information Data Structure for the attached controller with ID ctrlid.

See struct nvme_mi_read_ctrl_info.

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise..


title: nvme_mi_mi_read_mi_data_ctrl_list(2)

text:
# nvme_mi_mi_read_mi_data_ctrl_list(2)

## NAME
nvme_mi_mi_read_mi_data_ctrl_list - Perform a Read MI Data Structure command, retrieving the list of attached controllers.

## SYNOPSIS
int nvme_mi_mi_read_mi_data_ctrl_list (nvme_mi_ep_t ep , __u8 start_ctrlid , struct nvme_ctrl_list *list );

## ARGUMENTS
ep

endpoint for MI communication

start_ctrlid

starting controller ID

list

controller list to populate

## DESCRIPTION
Retrieves the list of attached controllers, with IDs greater than or equal to start_ctrlid.

See struct nvme_ctrl_list.

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise..


title: nvme_mi_mi_read_mi_data_port(2)

text:
# nvme_mi_mi_read_mi_data_port(2)

## NAME
nvme_mi_mi_read_mi_data_port - Perform a Read MI Data Structure command, retrieving port data.

## SYNOPSIS
int nvme_mi_mi_read_mi_data_port (nvme_mi_ep_t ep , __u8 portid , struct nvme_mi_read_port_info *p );

## ARGUMENTS
ep

endpoint for MI communication

portid

id of port data to retrieve

p

port information to populate

## DESCRIPTION
Retrieves the Port information, for the specified port ID. The subsystem data (from nvme_mi_mi_read_mi_data_subsys) nmp field contains the allowed range of port IDs.

See struct nvme_mi_read_port_info.

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise..


title: nvme_mi_mi_read_mi_data_subsys(2)

text:
# nvme_mi_mi_read_mi_data_subsys(2)

## NAME
nvme_mi_mi_read_mi_data_subsys - Perform a Read MI Data Structure command, retrieving subsystem data.

## SYNOPSIS
int nvme_mi_mi_read_mi_data_subsys (nvme_mi_ep_t ep , struct nvme_mi_read_nvm_ss_info *s );

## ARGUMENTS
ep

endpoint for MI communication

s

subsystem information to populate

## DESCRIPTION
Retrieves the Subsystem information - number of external ports and NVMe version information. See struct nvme_mi_read_nvm_ss_info.

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise..


title: nvme_mi_mi_req_hdr(2)

summary: MI request message header.

text:
# nvme_mi_mi_req_hdr(2)

## NAME
struct nvme_mi_mi_req_hdr - MI request message header.

## SYNOPSIS
struct nvme_mi_mi_req_hdr {

struct nvme_mi_msg_hdr hdr;

__u8 opcode;

__u8 rsvd0[3];

__le32 cdw0, cdw1;

};

## Members
hdr

generic MI message header

opcode

opcode (OPC) for the specific MI command

rsvd0

reserved bytes

cdw0

Management Request Doubleword 0 - command specific usage

cdw1

Management Request Doubleword 1 - command specific usage

## Description
Wire format for MI request message headers, defined in section 5 of NVMe-MI.


title: nvme_mi_mi_resp_hdr(2)

summary: MI response message header.

text:
# nvme_mi_mi_resp_hdr(2)

## NAME
struct nvme_mi_mi_resp_hdr - MI response message header.

## SYNOPSIS
struct nvme_mi_mi_resp_hdr {

struct nvme_mi_msg_hdr hdr;

__u8 status;

__u8 nmresp[3];

};

## Members
hdr

generic MI message header

status

generic response status from command; non-zero on failure.

nmresp

NVMe Management Response: command-type-specific response data

## Description
Wire format for MI response message header, defined in section 5 of NVMe-MI.


text:
# nvme_mi_mi_subsystem_health_status_poll(2)

## NAME
nvme_mi_mi_subsystem_health_status_poll - Read the Subsystem Health Data Structure from the NVM subsystem

## SYNOPSIS
int nvme_mi_mi_subsystem_health_status_poll (nvme_mi_ep_t ep , bool clear , struct nvme_mi_nvm_ss_health_status *nshds );

## ARGUMENTS
ep

endpoint for MI communication

clear

flag to clear the Composite Controller Status state

nshds

subsystem health status data to populate

## DESCRIPTION
Retrieves the Subsystem Health Data Structure into nshds. If clear is set, requests that the Composite Controller Status bits are cleared after the read. See NVMe-MI section 5.6 for details on the CCS bits.

See struct nvme_mi_nvm_ss_health_status.

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise..


title: nvme_mi_mi_xfer(2)

summary: Raw mi transfer interface.

text:
# nvme_mi_mi_xfer(2)

## NAME
nvme_mi_mi_xfer - Raw mi transfer interface.

## SYNOPSIS
int nvme_mi_mi_xfer (nvme_mi_ep_t ep , struct nvme_mi_mi_req_hdr *mi_req , size_t req_data_size , struct nvme_mi_mi_resp_hdr *mi_resp , size_t *resp_data_size );

## ARGUMENTS
ep

endpoint to send the MI command to

mi_req

request data

req_data_size

size of request data payload

mi_resp

buffer for response data

resp_data_size

size of response data buffer, updated to received size

## DESCRIPTION
Performs an arbitrary NVMe MI command, using the provided request data, in mi_req. The size of the request data *payload* is specified in req_data_size - this does not include the standard header length (so a header-only request would have a size of 0). Note that the Management Request Doublewords are considered part of the header data.

On success, response data is stored in mi_resp, which has an optional appended payload buffer of resp_data_size bytes. The actual payload size transferred will be stored in resp_data_size. This size does not include the MI response header, so 0 represents no payload.

See: struct nvme_mi_mi_req_hdr and struct nvme_mi_mi_resp_hdr.

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise..


title: nvme_mi_msg_hdr(2)

summary: General MI message header.

text:
# nvme_mi_msg_hdr(2)

## NAME
struct nvme_mi_msg_hdr - General MI message header.

## SYNOPSIS
struct nvme_mi_msg_hdr {

__u8 type;

__u8 nmp;

__u8 meb;

__u8 rsvd0;

};

## Members
type

MCTP message type, will always be NVME_MI_MSGTYPE_NVME

nmp

NVMe-MI message parameters (including MI message type)

meb

Management Endpoint Buffer flag; unused for libnvme-mi implementation

rsvd0

currently reserved

## Description
Wire format shared by both request and response messages, per NVMe-MI section 3.1. This is used for all message types, MI and Admin.


title: nvme_mi_msg_resp(2)

summary: Generic response type.

text:
# nvme_mi_msg_resp(2)

## NAME
struct nvme_mi_msg_resp - Generic response type.

## SYNOPSIS
struct nvme_mi_msg_resp {

struct nvme_mi_msg_hdr hdr;

__u8 status;

__u8 rsvd0[3];

};

## Members
hdr

the general request/response message header

status

response status value (see enum nvme_mi_resp_status)

rsvd0

reserved data, may be defined by specific response

## Description
Every response will start with one of these; command-specific responses will define parts of the reserved data, and may add further fields.


title: nvme_mi_nvm_ss_health_status(2)

summary: Subsystem Management Data Structure

text:
# nvme_mi_nvm_ss_health_status(2)

## NAME
struct nvme_mi_nvm_ss_health_status - Subsystem Management Data Structure

## SYNOPSIS
struct nvme_mi_nvm_ss_health_status {

__u8 nss;

__u8 sw;

__u8 ctemp;

__u8 pdlu;

__le16 ccs;

__u8 rsvd8[2];

};

## Members
nss

NVM Subsystem Status

sw

Smart Warnings

ctemp

Composite Temperature

pdlu

Percentage Drive Life Used

ccs

Composite Controller Status

rsvd8

Reserved


title: nvme_mi_open_mctp(2)

text:
# nvme_mi_open_mctp(2)

## NAME
nvme_mi_open_mctp - Create an endpoint using a MCTP connection.

## SYNOPSIS
nvme_mi_ep_t nvme_mi_open_mctp (nvme_root_t root , unsigned int netid , uint8_t eid );

## ARGUMENTS
root

root object to create under

netid

MCTP network ID on this system

eid

MCTP endpoint ID

## DESCRIPTION
Transport-specific endpoint initialization for MI-connected endpoints. Once an endpoint is created, the rest of the API is transport-independent.

See nvme_mi_close

## RETURN
New endpoint object for netid & eid, or NULL on failure.


title: nvme_mi_osc(2)

text:
# nvme_mi_osc(2)

## NAME
struct nvme_mi_osc - Optionally Supported Command Data Structure

## SYNOPSIS
struct nvme_mi_osc {

__u8 type;

__u8 opc;

};

## Members
type

Command Type

opc

Opcode


title: nvme_mi_port_pcie(2)

summary: PCIe Port Specific Data

text:
# nvme_mi_port_pcie(2)

## NAME
struct nvme_mi_port_pcie - PCIe Port Specific Data

## SYNOPSIS
struct nvme_mi_port_pcie {

__u8 mps;

__u8 sls;

__u8 cls;

__u8 mlw;

__u8 nlw;

__u8 pn;

__u8 rsvd14[18];

};

## Members
mps

PCIe Maximum Payload Size

sls

PCIe Supported Link Speeds Vector

cls

PCIe Current Link Speed

mlw

PCIe Maximum Link Width

nlw

PCIe Negotiated Link Width

pn

PCIe Port Number

rsvd14

Reserved


title: nvme_mi_port_smb(2)

summary: SMBus Port Specific Data

text:
# nvme_mi_port_smb(2)

## NAME
struct nvme_mi_port_smb - SMBus Port Specific Data

## SYNOPSIS
struct nvme_mi_port_smb {

__u8 vpd_addr;

__u8 mvpd_freq;

__u8 mme_addr;

__u8 mme_freq;

__u8 nvmebm;

__u8 rsvd13[19];

};

## Members
vpd_addr

Current VPD SMBus/I2C Address

mvpd_freq

Maximum VPD Access SMBus/I2C Frequency

mme_addr

Current Management Endpoint SMBus/I2C Address

mme_freq

Maximum Management Endpoint SMBus/I2C Frequency

nvmebm

NVMe Basic Management

rsvd13

Reserved


title: nvme_mi_read_ctrl_info(2)

summary: Controller Information Data Structure

text:
# nvme_mi_read_ctrl_info(2)

## NAME
struct nvme_mi_read_ctrl_info - Controller Information Data Structure

## SYNOPSIS
struct nvme_mi_read_ctrl_info {

__u8 portid;

__u8 rsvd1[4];

__u8 prii;

__le16 pri;

__le16 vid;

__le16 did;

__le16 ssvid;

__le16 ssid;

__u8 rsvd16[16];

};

## Members
portid

Port Identifier

rsvd1

Reserved

prii

PCIe Routing ID Information

pri

PCIe Routing ID

vid

PCI Vendor ID

did

PCI Device ID

ssvid

PCI Subsystem Vendor ID

ssid

PCI Subsystem Device ID

rsvd16

Reserved


title: nvme_mi_read_nvm_ss_info(2)

text:
# nvme_mi_read_nvm_ss_info(2)

## NAME
struct nvme_mi_read_nvm_ss_info - NVM Subsystem Information Data Structure

## SYNOPSIS
struct nvme_mi_read_nvm_ss_info {

__u8 nump;

__u8 mjr;

__u8 mnr;

__u8 rsvd3[29];

};

## Members
nump

Number of Ports

mjr

NVMe-MI Major Version Number

mnr

NVMe-MI Minor Version Number

rsvd3

Reserved


title: nvme_mi_read_port_info(2)

summary: Port Information Data Structure

text:
# nvme_mi_read_port_info(2)

## NAME
struct nvme_mi_read_port_info - Port Information Data Structure

## SYNOPSIS
struct nvme_mi_read_port_info {

__u8 portt;

__u8 rsvd1;

__le16 mmctptus;

__le32 meb;

union {

struct nvme_mi_port_pcie pcie;

struct nvme_mi_port_smb smb;

};

};

## Members
portt

Port Type

rsvd1

Reserved

mmctptus

Maximum MCTP Transmission Unit Size

meb

Management Endpoint Buffer Size

{unnamed_union}

anonymous

pcie

PCIe Port Specific Data

smb

SMBus Port Specific Data


title: nvme_mi_read_sc_list(2)

text:
# nvme_mi_read_sc_list(2)

## NAME
struct nvme_mi_read_sc_list - Management Endpoint Buffer Supported Command List Data Structure

## SYNOPSIS
struct nvme_mi_read_sc_list {

__le16 numcmd;

struct nvme_mi_osc cmds[];

};

## Members
numcmd

Number of Commands

cmds

MEB supported Command Data Structure. See struct nvme_mi_osc


title: nvme_mi_resp_status(2)

summary: values for the response status field

text:
# nvme_mi_resp_status(2)

## NAME
enum nvme_mi_resp_status - values for the response status field

## SYNOPSIS
enum nvme_mi_resp_status {

NVME_MI_RESP_SUCCESS ,

NVME_MI_RESP_MPR ,

NVME_MI_RESP_INTERNAL_ERR ,

NVME_MI_RESP_INVALID_OPCODE ,

NVME_MI_RESP_INVALID_PARAM ,

NVME_MI_RESP_INVALID_CMD_SIZE ,

NVME_MI_RESP_INVALID_INPUT_SIZE ,

NVME_MI_RESP_ACCESS_DENIED ,

NVME_MI_RESP_VPD_UPDATES_EXCEEDED ,

NVME_MI_RESP_PCIE_INACCESSIBLE ,

NVME_MI_RESP_MEB_SANITIZED ,

NVME_MI_RESP_ENC_SERV_FAILURE ,

NVME_MI_RESP_ENC_SERV_XFER_FAILURE ,

NVME_MI_RESP_ENC_FAILURE ,

NVME_MI_RESP_ENC_XFER_REFUSED ,

NVME_MI_RESP_ENC_FUNC_UNSUP ,

NVME_MI_RESP_ENC_SERV_UNAVAIL ,

NVME_MI_RESP_ENC_DEGRADED ,

NVME_MI_RESP_SANITIZE_IN_PROGRESS

};

## Constants
NVME_MI_RESP_SUCCESS

success

NVME_MI_RESP_MPR

More Processing Required

NVME_MI_RESP_INTERNAL_ERR

Internal Error

NVME_MI_RESP_INVALID_OPCODE

Invalid command opcode

NVME_MI_RESP_INVALID_PARAM

Invalid command parameter

NVME_MI_RESP_INVALID_CMD_SIZE

Invalid command size

NVME_MI_RESP_INVALID_INPUT_SIZE

Invalid command input data size

NVME_MI_RESP_ACCESS_DENIED

Access Denied

NVME_MI_RESP_VPD_UPDATES_EXCEEDED

More VPD updates than allowed

NVME_MI_RESP_PCIE_INACCESSIBLE

PCIe functionality currently unavailable

NVME_MI_RESP_MEB_SANITIZED

MEB has been cleared due to sanitize

NVME_MI_RESP_ENC_SERV_FAILURE

Enclosure services process failed

NVME_MI_RESP_ENC_SERV_XFER_FAILURE

Transfer with enclosure services failed

NVME_MI_RESP_ENC_FAILURE

Unreoverable enclosure failure

NVME_MI_RESP_ENC_XFER_REFUSED

Enclosure services transfer refused

NVME_MI_RESP_ENC_FUNC_UNSUP

Unsupported enclosure services function

NVME_MI_RESP_ENC_SERV_UNAVAIL

Enclosure services unavailable

NVME_MI_RESP_ENC_DEGRADED

Noncritical failure detected by enc. services

NVME_MI_RESP_SANITIZE_IN_PROGRESS

Command prohibited during sanitize


title: nvme_mi_set_probe_enabled(2)

text:
# nvme_mi_set_probe_enabled(2)

## NAME
nvme_mi_set_probe_enabled - enable/disable the probe for new endpoints

## SYNOPSIS
void nvme_mi_set_probe_enabled (nvme_root_t root , bool enabled );

## ARGUMENTS
root

nvme_root_t object

enabled

whether to probe new endpoints

## DESCRIPTION
Controls whether newly-created endpoints are probed for quirks on creation. Defaults to enabled, which results in some initial messaging with the endpoint to determine model-specific details.


title: nvme_mi_status_to_string(2)

text:
# nvme_mi_status_to_string(2)

## NAME
nvme_mi_status_to_string - return a string representation of the MI status.

## SYNOPSIS
const char * nvme_mi_status_to_string (int status );

## ARGUMENTS
status

MI response status

## DESCRIPTION
Gives a string description of status, as per section 4.1.2 of the NVMe-MI spec. The status value should be of type NVME_STATUS_MI, and extracted from the return value using nvme_status_get_value.

Returned string is const, and should not be freeed.

## RETURN
A string representing the status value


title: nvme_mi_vpd_hdr(2)

summary: Vital Product Data Common Header

text:
# nvme_mi_vpd_hdr(2)

## NAME
struct nvme_mi_vpd_hdr - Vital Product Data Common Header

## SYNOPSIS
struct nvme_mi_vpd_hdr {

__u8 ipmiver;

__u8 iuaoff;

__u8 ciaoff;

__u8 biaoff;

__u8 piaoff;

__u8 mrioff;

__u8 rsvd6;

__u8 chchk;

__u8 vpd[];

};

## Members
ipmiver

IPMI Format Version Number

iuaoff

Internal Use Area Starting Offset

ciaoff

Chassis Info Area Starting Offset

biaoff

Board Info Area Starting Offset

piaoff

Product Info Area Starting Offset

mrioff

MultiRecord Info Area Starting Offset

rsvd6

Reserved

chchk

Common Header Checksum

vpd

Vital Product Data


title: nvme_mi_vpd_mr_common(2)

summary: NVMe MultiRecord Area

text:
# nvme_mi_vpd_mr_common(2)

## NAME
struct nvme_mi_vpd_mr_common - NVMe MultiRecord Area

## SYNOPSIS
struct nvme_mi_vpd_mr_common {

__u8 type;

__u8 rf;

__u8 rlen;

__u8 rchksum;

__u8 hchksum;

union {

struct nvme_mi_vpd_mra nmra;

struct nvme_mi_vpd_ppmra ppmra;

struct nvme_mi_vpd_tra tmra;

};

};

## Members
type

NVMe Record Type ID

rf

Record Format

rlen

Record Length

rchksum

Record Checksum

hchksum

Header Checksum

{unnamed_union}

anonymous

nmra

NVMe MultiRecord Area

ppmra

NVMe PCIe Port MultiRecord Area

tmra

Topology MultiRecord Area


title: nvme_mi_vpd_mra(2)

summary: NVMe MultiRecord Area

text:
# nvme_mi_vpd_mra(2)

## NAME
struct nvme_mi_vpd_mra - NVMe MultiRecord Area

## SYNOPSIS
struct nvme_mi_vpd_mra {

__u8 nmravn;

__u8 ff;

__u8 rsvd7[6];

__u8 i18vpwr;

__u8 m18vpwr;

__u8 i33vpwr;

__u8 m33vpwr;

__u8 rsvd17;

__u8 m33vapsr;

__u8 i5vapsr;

__u8 m5vapsr;

__u8 i12vapsr;

__u8 m12vapsr;

__u8 mtl;

__u8 tnvmcap[16];

__u8 rsvd37[27];

};

## Members
nmravn

NVMe MultiRecord Area Version Number

ff

Form Factor

rsvd7

Reserved

i18vpwr

Initial 1.8 V Power Supply Requirements

m18vpwr

Maximum 1.8 V Power Supply Requirements

i33vpwr

Initial 3.3 V Power Supply Requirements

m33vpwr

Maximum 3.3 V Power Supply Requirements

rsvd17

Reserved

m33vapsr

Maximum 3.3 Vi aux Power Supply Requirements

i5vapsr

Initial 5 V Power Supply Requirements

m5vapsr

Maximum 5 V Power Supply Requirements

i12vapsr

Initial 12 V Power Supply Requirements

m12vapsr

Maximum 12 V Power Supply Requirements

mtl

Maximum Thermal Load

tnvmcap

Total NVM Capacity

rsvd37

Reserved


title: nvme_mi_vpd_ppmra(2)

summary: NVMe PCIe Port MultiRecord Area

text:
# nvme_mi_vpd_ppmra(2)

## NAME
struct nvme_mi_vpd_ppmra - NVMe PCIe Port MultiRecord Area

## SYNOPSIS
struct nvme_mi_vpd_ppmra {

__u8 nppmravn;

__u8 pn;

__u8 ppi;

__u8 ls;

__u8 mlw;

__u8 mctp;

__u8 refccap;

__u8 pi;

__u8 rsvd13[3];

};

## Members
nppmravn

NVMe PCIe Port MultiRecord Area Version Number

pn

PCIe Port Number

ppi

Port Information

ls

PCIe Link Speed

mlw

PCIe Maximum Link Width

mctp

MCTP Support

refccap

Ref Clk Capability

pi

Port Identifier

rsvd13

Reserved


title: nvme_mi_vpd_telem(2)

summary: Vital Product Data Element Descriptor

text:
# nvme_mi_vpd_telem(2)

## NAME
struct nvme_mi_vpd_telem - Vital Product Data Element Descriptor

## SYNOPSIS
struct nvme_mi_vpd_telem {

__u8 type;

__u8 rev;

__u8 len;

__u8 data[0];

};

## Members
type

Type of the Element Descriptor

rev

Revision of the Element Descriptor

len

Number of bytes in the Element Descriptor

data

Type-specific information associated with the Element Descriptor


title: nvme_mi_vpd_tra(2)

summary: Vital Product Data Topology MultiRecord

text:
# nvme_mi_vpd_tra(2)

## NAME
struct nvme_mi_vpd_tra - Vital Product Data Topology MultiRecord

## SYNOPSIS
struct nvme_mi_vpd_tra {

__u8 vn;

__u8 rsvd6;

__u8 ec;

struct nvme_mi_vpd_telem elems[0];

};

## Members
vn

Version Number

rsvd6

Reserved

ec

Element Count

elems

Element Descriptor


title: nvme_namespace_attach_ctrls(2)

summary: Attach namespace to controller(s)

text:
# nvme_namespace_attach_ctrls(2)

## NAME
nvme_namespace_attach_ctrls - Attach namespace to controller(s)

## SYNOPSIS
int nvme_namespace_attach_ctrls (int fd , __u32 nsid , __u16 num_ctrls , __u16 *ctrlist );

## ARGUMENTS
fd

File descriptor of nvme device

nsid

Namespace ID to attach

num_ctrls

Number of controllers in ctrlist

ctrlist

List of controller IDs to perform the attach action

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_namespace_detach_ctrls(2)

summary: Detach namespace from controller(s)

text:
# nvme_namespace_detach_ctrls(2)

## NAME
nvme_namespace_detach_ctrls - Detach namespace from controller(s)

## SYNOPSIS
int nvme_namespace_detach_ctrls (int fd , __u32 nsid , __u16 num_ctrls , __u16 *ctrlist );

## ARGUMENTS
fd

File descriptor of nvme device

nsid

Namespace ID to detach

num_ctrls

Number of controllers in ctrlist

ctrlist

List of controller IDs to perform the detach action

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_namespace_filter(2)

summary: Filter for namespaces

text:
# nvme_namespace_filter(2)

## NAME
nvme_namespace_filter - Filter for namespaces

## SYNOPSIS
int nvme_namespace_filter (const struct dirent *d );

## ARGUMENTS
d

dirent to check

## RETURN
1 if d matches, 0 otherwise


title: nvme_namespace_first_path(2)

summary: Start path iterator

text:
# nvme_namespace_first_path(2)

## NAME
nvme_namespace_first_path - Start path iterator

## SYNOPSIS
nvme_path_t nvme_namespace_first_path (nvme_ns_t ns );

## ARGUMENTS
ns

Namespace instance

## RETURN
First nvme_path_t object of an ns iterator


title: nvme_namespace_for_each_path(2)

summary: Traverse paths

text:
# nvme_namespace_for_each_path(2)

## NAME
nvme_namespace_for_each_path - Traverse paths

## SYNOPSIS
nvme_namespace_for_each_path (n , p );

## ARGUMENTS
n

Namespace instance

p

nvme_path_t object


title: nvme_namespace_for_each_path_safe(2)

summary: Traverse paths

text:
# nvme_namespace_for_each_path_safe(2)

## NAME
nvme_namespace_for_each_path_safe - Traverse paths

## SYNOPSIS
nvme_namespace_for_each_path_safe (n , p , _p );

## ARGUMENTS
n

Namespace instance

p

nvme_path_t object

_p

A nvme_path_t_node to use as temporary storage


title: nvme_namespace_next_path(2)

summary: Next path iterator

text:
# nvme_namespace_next_path(2)

## NAME
nvme_namespace_next_path - Next path iterator

## SYNOPSIS
nvme_path_t nvme_namespace_next_path (nvme_ns_t ns , nvme_path_t p );

## ARGUMENTS
ns

Namespace instance

p

Previous nvme_path_t object of an ns iterator

## RETURN
Next nvme_path_t object of an ns iterator


title: nvme_nbft_free(2)

text:
# nvme_nbft_free(2)

## NAME
nvme_nbft_free - Free the struct nbft_info and its contents

## SYNOPSIS
void nvme_nbft_free (struct nbft_info *nbft );

## ARGUMENTS
nbft

Parsed NBFT table data.


title: nvme_nbft_read(2)

text:
# nvme_nbft_read(2)

## NAME
nvme_nbft_read - Read and parse contents of an ACPI NBFT table

## SYNOPSIS
int nvme_nbft_read (struct nbft_info **nbft , const char *filename );

## ARGUMENTS
nbft

Parsed NBFT table data.

filename

Filename of the raw NBFT table to read.

## DESCRIPTION
Read and parse the specified NBFT file into a struct nbft_info. Free with nvme_nbft_free.

## RETURN
0 on success, errno otherwise.


title: nvme_nd_ns_fpi(2)

text:
# nvme_nd_ns_fpi(2)

## NAME
enum nvme_nd_ns_fpi - If a format operation is in progress, this field indicates the percentage of the namespace that remains to be formatted.

## SYNOPSIS
enum nvme_nd_ns_fpi {

NVME_NS_FPI_REMAINING ,

NVME_NS_FPI_SUPPORTED

};

## Constants
NVME_NS_FPI_REMAINING

Mask to get the format percent remaining value

NVME_NS_FPI_SUPPORTED

If set, indicates that the namespace supports the Format Progress Indicator defined for the field.


title: nvme_next_host(2)

summary: Next host iterator

text:
# nvme_next_host(2)

## NAME
nvme_next_host - Next host iterator

## SYNOPSIS
nvme_host_t nvme_next_host (nvme_root_t r , nvme_host_t h );

## ARGUMENTS
r

nvme_root_t object

h

Previous nvme_host_t iterator

## RETURN
Next nvme_host_t object in an iterator


title: nvme_next_subsystem(2)

summary: Next subsystem iterator

text:
# nvme_next_subsystem(2)

## NAME
nvme_next_subsystem - Next subsystem iterator

## SYNOPSIS
nvme_subsystem_t nvme_next_subsystem (nvme_host_t h , nvme_subsystem_t s );

## ARGUMENTS
h

nvme_host_t object

s

Previous nvme_subsystem_t iterator

## RETURN
next nvme_subsystem_t object in an iterator


title: nvme_ns_attach(2)

text:
# nvme_ns_attach(2)

## NAME
nvme_ns_attach - Attach or detach namespace to controller(s)

## SYNOPSIS
int nvme_ns_attach (struct nvme_ns_attach_args *args );

## ARGUMENTS
args

struct nvme_ns_attach_args Argument structure

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_ns_attach_ctrls(2)

summary: Attach namespace to controllers

text:
# nvme_ns_attach_ctrls(2)

## NAME
nvme_ns_attach_ctrls - Attach namespace to controllers

## SYNOPSIS
int nvme_ns_attach_ctrls (int fd , __u32 nsid , struct nvme_ctrl_list *ctrlist );

## ARGUMENTS
fd

File descriptor of nvme device

nsid

Namespace ID to attach

ctrlist

Controller list to modify attachment state of nsid

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_ns_attach_sel(2)

summary: Namespace Attachment - Select

text:
# nvme_ns_attach_sel(2)

## NAME
enum nvme_ns_attach_sel - Namespace Attachment - Select

## SYNOPSIS
enum nvme_ns_attach_sel {

NVME_NS_ATTACH_SEL_CTRL_ATTACH ,

NVME_NS_ATTACH_SEL_CTRL_DEATTACH

};

## Constants
NVME_NS_ATTACH_SEL_CTRL_ATTACH

Namespace attach selection

NVME_NS_ATTACH_SEL_CTRL_DEATTACH

Namespace detach selection


title: nvme_ns_compare(2)

summary: Compare data on a namespace

text:
# nvme_ns_compare(2)

## NAME
nvme_ns_compare - Compare data on a namespace

## SYNOPSIS
int nvme_ns_compare (nvme_ns_t n , void *buf , off_t offset , size_t count );

## ARGUMENTS
n

Namespace instance

buf

Buffer with data to be compared

offset

LBA offset of n

count

Number of sectors in buf

## RETURN
Number of sectors compared


title: nvme_ns_detach_ctrls(2)

summary: Detach namespace from controllers

text:
# nvme_ns_detach_ctrls(2)

## NAME
nvme_ns_detach_ctrls - Detach namespace from controllers

## SYNOPSIS
int nvme_ns_detach_ctrls (int fd , __u32 nsid , struct nvme_ctrl_list *ctrlist );

## ARGUMENTS
fd

File descriptor of nvme device

nsid

Namespace ID to detach

ctrlist

Controller list to modify attachment state of nsid

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_ns_flush(2)

summary: Flush data to a namespace

text:
# nvme_ns_flush(2)

## NAME
nvme_ns_flush - Flush data to a namespace

## SYNOPSIS
int nvme_ns_flush (nvme_ns_t n );

## ARGUMENTS
n

Namespace instance

## RETURN
0 on success, -1 on error.


title: nvme_ns_get_csi(2)

summary: Command set identifier of a namespace

text:
# nvme_ns_get_csi(2)

## NAME
nvme_ns_get_csi - Command set identifier of a namespace

## SYNOPSIS
enum nvme_csi nvme_ns_get_csi (nvme_ns_t n );

## ARGUMENTS
n

Namespace instance

## RETURN
The namespace's command set identifier in use


title: nvme_ns_get_ctrl(2)

summary: &nvme_ctrl_t of a namespace

text:
# nvme_ns_get_ctrl(2)

## NAME
nvme_ns_get_ctrl - &nvme_ctrl_t of a namespace

## SYNOPSIS
nvme_ctrl_t nvme_ns_get_ctrl (nvme_ns_t n );

## ARGUMENTS
n

Namespace instance

## DESCRIPTION
nvme_ctrl_t object may be NULL for a multipathed namespace

## RETURN
nvme_ctrl_t object of n if present


title: nvme_ns_get_eui64(2)

summary: 64-bit eui of a namespace

text:
# nvme_ns_get_eui64(2)

## NAME
nvme_ns_get_eui64 - 64-bit eui of a namespace

## SYNOPSIS
const uint8_t * nvme_ns_get_eui64 (nvme_ns_t n );

## ARGUMENTS
n

Namespace instance

## RETURN
A pointer to the 64-bit eui


title: nvme_ns_get_fd(2)

summary: Get associated file descriptor

text:
# nvme_ns_get_fd(2)

## NAME
nvme_ns_get_fd - Get associated file descriptor

## SYNOPSIS
int nvme_ns_get_fd (nvme_ns_t n );

## ARGUMENTS
n

Namespace instance

## DESCRIPTION
libnvme will open the file (if not already opened) and keep an internal copy of the file descriptor. Following calls to this API retrieve the internal cached copy of the file descriptor. The file will remain opened and the fd will remain cached until the ns object is deleted or nvme_ns_release_fd is called.

## RETURN
File descriptor associated with n or -1


title: nvme_ns_get_firmware(2)

summary: Firmware string of a namespace

text:
# nvme_ns_get_firmware(2)

## NAME
nvme_ns_get_firmware - Firmware string of a namespace

## SYNOPSIS
const char * nvme_ns_get_firmware (nvme_ns_t n );

## ARGUMENTS
n

Namespace instance

## RETURN
Firmware string of n


title: nvme_ns_get_generic_name(2)

text:
# nvme_ns_get_generic_name(2)

## NAME
nvme_ns_get_generic_name - Returns name of generic namespace chardev.

## SYNOPSIS
const char * nvme_ns_get_generic_name (nvme_ns_t n );

## ARGUMENTS
n

Namespace instance

## RETURN
Name of generic namespace chardev


title: nvme_ns_get_lba_count(2)

summary: LBA count of a namespace

text:
# nvme_ns_get_lba_count(2)

## NAME
nvme_ns_get_lba_count - LBA count of a namespace

## SYNOPSIS
uint64_t nvme_ns_get_lba_count (nvme_ns_t n );

## ARGUMENTS
n

Namespace instance

## RETURN
LBA count of n


title: nvme_ns_get_lba_size(2)

summary: LBA size of a namespace

text:
# nvme_ns_get_lba_size(2)

## NAME
nvme_ns_get_lba_size - LBA size of a namespace

## SYNOPSIS
int nvme_ns_get_lba_size (nvme_ns_t n );

## ARGUMENTS
n

Namespace instance

## RETURN
LBA size of n


title: nvme_ns_get_lba_util(2)

summary: LBA utilization of a namespace

text:
# nvme_ns_get_lba_util(2)

## NAME
nvme_ns_get_lba_util - LBA utilization of a namespace

## SYNOPSIS
uint64_t nvme_ns_get_lba_util (nvme_ns_t n );

## ARGUMENTS
n

Namespace instance

## RETURN
LBA utilization of n


title: nvme_ns_get_meta_size(2)

summary: Metadata size of a namespace

text:
# nvme_ns_get_meta_size(2)

## NAME
nvme_ns_get_meta_size - Metadata size of a namespace

## SYNOPSIS
int nvme_ns_get_meta_size (nvme_ns_t n );

## ARGUMENTS
n

Namespace instance

## RETURN
Metadata size of n


title: nvme_ns_get_model(2)

summary: Model of a namespace

text:
# nvme_ns_get_model(2)

## NAME
nvme_ns_get_model - Model of a namespace

## SYNOPSIS
const char * nvme_ns_get_model (nvme_ns_t n );

## ARGUMENTS
n

Namespace instance

## RETURN
Model string of n


title: nvme_ns_get_name(2)

summary: sysfs name of a namespace

text:
# nvme_ns_get_name(2)

## NAME
nvme_ns_get_name - sysfs name of a namespace

## SYNOPSIS
const char * nvme_ns_get_name (nvme_ns_t n );

## ARGUMENTS
n

Namespace instance

## RETURN
sysfs name of n


title: nvme_ns_get_nguid(2)

summary: 128-bit nguid of a namespace

text:
# nvme_ns_get_nguid(2)

## NAME
nvme_ns_get_nguid - 128-bit nguid of a namespace

## SYNOPSIS
const uint8_t * nvme_ns_get_nguid (nvme_ns_t n );

## ARGUMENTS
n

Namespace instance

## RETURN
A pointer to the 128-bit nguid


title: nvme_ns_get_nsid(2)

summary: NSID of a namespace

text:
# nvme_ns_get_nsid(2)

## NAME
nvme_ns_get_nsid - NSID of a namespace

## SYNOPSIS
int nvme_ns_get_nsid (nvme_ns_t n );

## ARGUMENTS
n

Namespace instance

## RETURN
NSID of n


title: nvme_ns_get_serial(2)

summary: Serial number of a namespace

text:
# nvme_ns_get_serial(2)

## NAME
nvme_ns_get_serial - Serial number of a namespace

## SYNOPSIS
const char * nvme_ns_get_serial (nvme_ns_t n );

## ARGUMENTS
n

Namespace instance

## RETURN
Serial number string of n


title: nvme_ns_get_subsystem(2)

summary: &nvme_subsystem_t of a namespace

text:
# nvme_ns_get_subsystem(2)

## NAME
nvme_ns_get_subsystem - &nvme_subsystem_t of a namespace

## SYNOPSIS
nvme_subsystem_t nvme_ns_get_subsystem (nvme_ns_t n );

## ARGUMENTS
n

Namespace instance

## RETURN
nvme_subsystem_t object of n


title: nvme_ns_get_sysfs_dir(2)

summary: sysfs directory of a namespace

text:
# nvme_ns_get_sysfs_dir(2)

## NAME
nvme_ns_get_sysfs_dir - sysfs directory of a namespace

## SYNOPSIS
const char * nvme_ns_get_sysfs_dir (nvme_ns_t n );

## ARGUMENTS
n

Namespace instance

## RETURN
sysfs directory name of n


title: nvme_ns_get_uuid(2)

summary: UUID of a namespace

text:
# nvme_ns_get_uuid(2)

## NAME
nvme_ns_get_uuid - UUID of a namespace

## SYNOPSIS
void nvme_ns_get_uuid (nvme_ns_t n , unsigned char out[NVME_UUID_LEN] );

## ARGUMENTS
n

Namespace instance

out

buffer for the UUID

## DESCRIPTION
Copies the namespace's uuid into out


title: nvme_ns_head_get_sysfs_dir(2)

summary: sysfs dir of namespave head

text:
# nvme_ns_head_get_sysfs_dir(2)

## NAME
nvme_ns_head_get_sysfs_dir - sysfs dir of namespave head

## SYNOPSIS
const char * nvme_ns_head_get_sysfs_dir (nvme_ns_head_t head );

## ARGUMENTS
head

namespace head instance

## RETURN
sysfs directory name of head


title: nvme_ns_id_desc(2)

summary: Namespace identifier type descriptor

text:
# nvme_ns_id_desc(2)

## NAME
struct nvme_ns_id_desc - Namespace identifier type descriptor

## SYNOPSIS
struct nvme_ns_id_desc {

__u8 nidt;

__u8 nidl;

__le16 rsvd;

__u8 nid[];

};

## Members
nidt

Namespace Identifier Type, see enum nvme_ns_id_desc_nidt

nidl

Namespace Identifier Length contains the length in bytes of the struct nvme_id_ns.nid.

rsvd

Reserved

nid

Namespace Identifier contains a value that is globally unique and assigned to the namespace when the namespace is created. The length is defined in struct nvme_id_ns.nidl.


title: nvme_ns_id_desc_nidt(2)

summary: Known namespace identifier types

text:
# nvme_ns_id_desc_nidt(2)

## NAME
enum nvme_ns_id_desc_nidt - Known namespace identifier types

## SYNOPSIS
enum nvme_ns_id_desc_nidt {

NVME_NIDT_EUI64 ,

NVME_NIDT_NGUID ,

NVME_NIDT_UUID ,

NVME_NIDT_CSI

};

## Constants
NVME_NIDT_EUI64

IEEE Extended Unique Identifier, the NID field contains a copy of the EUI64 field in the struct nvme_id_ns.eui64.

NVME_NIDT_NGUID

Namespace Globally Unique Identifier, the NID field contains a copy of the NGUID field in struct nvme_id_ns.nguid.

NVME_NIDT_UUID

The NID field contains a 128-bit Universally Unique Identifier (UUID) as specified in RFC 4122.

NVME_NIDT_CSI

The NID field contains the command set identifier.


title: nvme_ns_identify(2)

summary: Issue an 'identify namespace' command

text:
# nvme_ns_identify(2)

## NAME
nvme_ns_identify - Issue an 'identify namespace' command

## SYNOPSIS
int nvme_ns_identify (nvme_ns_t n , struct nvme_id_ns *ns );

## ARGUMENTS
n

Namespace instance

ns

nvme_id_ns buffer

## DESCRIPTION
Writes the data returned by the 'identify namespace' command into ns.

## RETURN
0 on success, -1 on error.


title: nvme_ns_identify_descs(2)

summary: Issue an 'identify descriptors' command

text:
# nvme_ns_identify_descs(2)

## NAME
nvme_ns_identify_descs - Issue an 'identify descriptors' command

## SYNOPSIS
int nvme_ns_identify_descs (nvme_ns_t n , struct nvme_ns_id_desc *descs );

## ARGUMENTS
n

Namespace instance

descs

List of identify descriptors

## DESCRIPTION
Writes the data returned by the 'identify descriptors' command into descs.

## RETURN
0 on success, -1 on error.


title: nvme_ns_list(2)

summary: Namespace List

text:
# nvme_ns_list(2)

## NAME
struct nvme_ns_list - Namespace List

## SYNOPSIS
struct nvme_ns_list {

__le32 ns[NVME_ID_NS_LIST_MAX];

};

## Members
ns

Namespace Identifier


title: nvme_ns_metadata_type(2)

summary: Namespace Metadata Element Types

text:
# nvme_ns_metadata_type(2)

## NAME
enum nvme_ns_metadata_type - Namespace Metadata Element Types

## SYNOPSIS
enum nvme_ns_metadata_type {

NVME_NS_METADATA_OS_NS_NAME ,

NVME_NS_METADATA_PRE_BOOT_NS_NAME ,

NVME_NS_METADATA_OS_NS_QUAL_1 ,

NVME_NS_METADATA_OS_NS_QUAL_2

};

## Constants
NVME_NS_METADATA_OS_NS_NAME

Name of the namespace in the operating system

NVME_NS_METADATA_PRE_BOOT_NS_NAME

Name of the namespace in the pre-boot environment.

NVME_NS_METADATA_OS_NS_QUAL_1

First qualifier of the Operating System Namespace Name.

NVME_NS_METADATA_OS_NS_QUAL_2

Second qualifier of the Operating System Namespace Name.


title: nvme_ns_mgmt(2)

summary: Issue a Namespace management command

text:
# nvme_ns_mgmt(2)

## NAME
nvme_ns_mgmt - Issue a Namespace management command

## SYNOPSIS
int nvme_ns_mgmt (struct nvme_ns_mgmt_args *args );

## ARGUMENTS
args

struct nvme_ns_mgmt_args Argument structure

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_ns_mgmt_create(2)

summary: Create a non attached namespace

text:
# nvme_ns_mgmt_create(2)

## NAME
nvme_ns_mgmt_create - Create a non attached namespace

## SYNOPSIS
int nvme_ns_mgmt_create (int fd , struct nvme_id_ns *ns , __u32 *nsid , __u32 timeout , __u8 csi , struct nvme_ns_mgmt_host_sw_specified *data );

## ARGUMENTS
fd

File descriptor of nvme device

ns

Namespace identification that defines ns creation parameters

nsid

On success, set to the namespace id that was created

timeout

Override the default timeout to this value in milliseconds; set to 0 to use the system default.

csi

Command Set Identifier

data

Host Software Specified Fields that defines ns creation parameters

## DESCRIPTION
On successful creation, the namespace exists in the subsystem, but is not attached to any controller. Use the nvme_ns_attach_ctrls to assign the namespace to one or more controllers.

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_ns_mgmt_delete(2)

summary: Delete a non attached namespace

text:
# nvme_ns_mgmt_delete(2)

## NAME
nvme_ns_mgmt_delete - Delete a non attached namespace

## SYNOPSIS
int nvme_ns_mgmt_delete (int fd , __u32 nsid );

## ARGUMENTS
fd

File descriptor of nvme device

nsid

Namespace identifier to delete

## DESCRIPTION
It is recommended that a namespace being deleted is not attached to any controller. Use the nvme_ns_detach_ctrls first if the namespace is still attached.

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_ns_mgmt_delete_timeout(2)

text:
# nvme_ns_mgmt_delete_timeout(2)

## NAME
nvme_ns_mgmt_delete_timeout - Delete a non attached namespace with timeout

## SYNOPSIS
int nvme_ns_mgmt_delete_timeout (int fd , __u32 nsid , __u32 timeout );

## ARGUMENTS
fd

File descriptor of nvme device

nsid

Namespace identifier to delete

timeout

Override the default timeout to this value in milliseconds; set to 0 to use the system default.

## DESCRIPTION
It is recommended that a namespace being deleted is not attached to any controller. Use the nvme_ns_detach_ctrls first if the namespace is still attached.

## RETURN
The nvme command status if a response was received (see enum nvme_status_field) or -1 with errno set otherwise.


title: nvme_ns_mgmt_host_sw_specified(2)

text:
# nvme_ns_mgmt_host_sw_specified(2)

## NAME
struct nvme_ns_mgmt_host_sw_specified - Namespace management Host Software Specified Fields.

## SYNOPSIS
struct nvme_ns_mgmt_host_sw_specified {

__le64 nsze;

__le64 ncap;

__u8 rsvd16[10];

__u8 flbas;

__u8 rsvd27[2];

__u8 dps;

__u8 nmic;

__u8 rsvd31[61];

__le32 anagrpid;

__u8 rsvd96[4];

__le16 nvmsetid;

__le16 endgid;

__u8 rsvd104[280];

__le64 lbstm;

__le16 nphndls;

__u8 rsvd394[105];

union {

__u8 rsvd499[13];

struct {

__u8 znsco;

__le32 rar;

__le32 ror;

__le32 rnumzrwa;

} zns;

};

__le16 phndl[128];

__u8 rsvd768[3328];

};

## Members
nsze

Namespace Size indicates the total size of the namespace in logical blocks. The number of logical blocks is based on the formatted LBA size.

ncap

Namespace Capacity indicates the maximum number of logical blocks that may be allocated in the namespace at any point in time. The number of logical blocks is based on the formatted LBA size.

rsvd16

Reserved

flbas

Formatted LBA Size, see enum nvme_id_ns_flbas.

rsvd27

Reserved

dps

End-to-end Data Protection Type Settings, see enum nvme_id_ns_dps.

nmic

Namespace Multi-path I/O and Namespace Sharing Capabilities, see enum nvme_id_ns_nmic.

rsvd31

Reserved

anagrpid

ANA Group Identifier indicates the ANA Group Identifier of the ANA group of which the namespace is a member.

rsvd96

Reserved

nvmsetid

NVM Set Identifier indicates the NVM Set with which this namespace is associated.

endgid

Endurance Group Identifier indicates the Endurance Group with which this namespace is associated.

rsvd104

Reserved

lbstm

Logical Block Storage Tag Mask Identifies the mask for the Storage Tag field for the protection information

nphndls

Number of Placement Handles specifies the number of Placement Handles included in the Placement Handle List

rsvd394

Reserved

{unnamed_union}

anonymous

rsvd499

Reserved for I/O Command Sets that extend this specification.

zns

rsvd499( Zoned Namespace Command Set specific field )

phndl

Placement Handle Associated RUH : This field specifies the Reclaim Unit Handle Identifier to be associated with the Placement Handle value. If the Flexible Data Placement capability is not supported or not enabled in specified Endurance Group, then the controller shall ignore this field.

rsvd768

Reserved


title: nvme_ns_mgmt_sel(2)

summary: Namespace Management - Select

text:
# nvme_ns_mgmt_sel(2)

## NAME
enum nvme_ns_mgmt_sel - Namespace Management - Select

## SYNOPSIS
enum nvme_ns_mgmt_sel {

NVME_NS_MGMT_SEL_CREATE ,

NVME_NS_MGMT_SEL_DELETE

};

## Constants
NVME_NS_MGMT_SEL_CREATE

Namespace Create selection

NVME_NS_MGMT_SEL_DELETE

Namespace Delete selection


title: nvme_ns_read(2)

summary: Read from a namespace

text:
# nvme_ns_read(2)

## NAME
nvme_ns_read - Read from a namespace

## SYNOPSIS
int nvme_ns_read (nvme_ns_t n , void *buf , off_t offset , size_t count );

## ARGUMENTS
n

Namespace instance

buf

Buffer into which the data will be transferred

offset

LBA offset of n

count

Number of sectors in buf

## RETURN
Number of sectors read or -1 on error.


title: nvme_ns_release_fd(2)

summary: Close fd and clear fd from ns object

text:
# nvme_ns_release_fd(2)

## NAME
nvme_ns_release_fd - Close fd and clear fd from ns object

## SYNOPSIS
void nvme_ns_release_fd (nvme_ns_t n );

## ARGUMENTS
n

Namespace instance


title: nvme_ns_rescan(2)

summary: Initiate a controller rescan

text:
# nvme_ns_rescan(2)

## NAME
nvme_ns_rescan - Initiate a controller rescan

## SYNOPSIS
int nvme_ns_rescan (int fd );

## ARGUMENTS
fd

File descriptor of nvme device

## DESCRIPTION
This should only be sent to controller handles, not to namespaces.

## RETURN
0 if a rescan was initiated or -1 with errno set otherwise.


title: nvme_ns_verify(2)

summary: Verify data on a namespace

text:
# nvme_ns_verify(2)

## NAME
nvme_ns_verify - Verify data on a namespace

## SYNOPSIS
int nvme_ns_verify (nvme_ns_t n , off_t offset , size_t count );

## ARGUMENTS
n

Namespace instance

offset

LBA offset of n

count

Number of sectors to be verified

## RETURN
Number of sectors verified


title: nvme_ns_write(2)

summary: Write to a namespace

text:
# nvme_ns_write(2)

## NAME
nvme_ns_write - Write to a namespace

## SYNOPSIS
int nvme_ns_write (nvme_ns_t n , void *buf , off_t offset , size_t count );

## ARGUMENTS
n

Namespace instance

buf

Buffer with data to be written

offset

LBA offset of n

count

Number of sectors in buf

## RETURN
Number of sectors written or -1 on error


title: nvme_ns_write_protect_cfg(2)

text:
# nvme_ns_write_protect_cfg(2)

## NAME
enum nvme_ns_write_protect_cfg - Write Protection - Write Protection State

## SYNOPSIS
enum nvme_ns_write_protect_cfg {

NVME_NS_WP_CFG_NONE ,

NVME_NS_WP_CFG_PROTECT ,

NVME_NS_WP_CFG_PROTECT_POWER_CYCLE ,

NVME_NS_WP_CFG_PROTECT_PERMANENT

};

## Constants
NVME_NS_WP_CFG_NONE

No Write Protect

NVME_NS_WP_CFG_PROTECT

Write Protect

NVME_NS_WP_CFG_PROTECT_POWER_CYCLE

Write Protect Until Power Cycle

NVME_NS_WP_CFG_PROTECT_PERMANENT

Permanent Write Protect