libnvme\_mi\_aem\_enable(9) libnvme API manual libnvme\_mi\_aem\_enable(9)

# [NAME](#NAME)

libnvme\_mi\_aem\_enable - Enable AE on the provided endpoint

# [SYNOPSIS](#SYNOPSIS)

**int libnvme\_mi\_aem\_enable** **(struct libnvme\_mi\_ep \*ep ,** **struct libnvme\_mi\_aem\_config \*config ,** **void \*userdata );**

# [ARGUMENTS](#ARGUMENTS)

[ep](#ep)

Endpoint to enable AEs

[config](#config)

AE configuraiton including which events are enabled and the callback function

[userdata](#userdata)

Application provided context pointer for callback function

# [DESCRIPTION](#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 **libnvme\_mi\_aem\_get\_next\_event**.

Application should poll the fd that can be obtained from libnvme\_mi\_aem\_get\_fd and then call **libnvme\_mi\_aem\_process** when **poll** indicates data available.

A call to **libnvme\_mi\_aem\_process** will grab AEM data and call the aem\_handler fn pointer. At this point the application can call **libnvme\_mi\_aem\_get\_next\_event** to get information for each triggered event.

# [RETURN](#RETURN)

0 on success, negative error code otherwise.

libnvme\_mi\_aem\_enable September 2026

---

Document: libnvme_mi_aem_enable-libnvme3(2) from nvme-cli 3.1-r0 (Chainguard OS)
Source: https://github.com/linux-nvme/nvme-cli
