libocxl
Functions
OpenCAPI AFU Getters

The AFU getter functions provide access to AFU metadata, such as the identifier, paths, and PASID. More...

Functions

uint32_t ocxl_afu_get_pasid (ocxl_afu_h afu)
 Get the PASID for the currently open context. More...
 
const ocxl_identifierocxl_afu_get_identifier (ocxl_afu_h afu)
 Get the identifier of the AFU. More...
 
const char * ocxl_afu_get_device_path (ocxl_afu_h afu)
 Get the canonical device path of the AFU. More...
 
const char * ocxl_afu_get_sysfs_path (ocxl_afu_h afu)
 Get the canonical sysfs path of the AFU. More...
 
void ocxl_afu_get_version (ocxl_afu_h afu, uint8_t *major, uint8_t *minor)
 Get the version of the AFU. More...
 

Detailed Description

The AFU getter functions provide access to AFU metadata, such as the identifier, paths, and PASID.

These operate on any valid AFU handle, even if it has not been opened.

Function Documentation

◆ ocxl_afu_get_device_path()

const char* ocxl_afu_get_device_path ( ocxl_afu_h  afu)

Get the canonical device path of the AFU.

Returns the 'true' device path of the AFU from (within /dev), which may or may not be the same as the path passed to the library. It will differ when the specified path is a symlink or duplicate device.

Parameters
afuThe AFU to get the device path of
Returns
the device path, or NULL if the device is invalid

Definition at line 95 of file afu.c.

◆ ocxl_afu_get_identifier()

const ocxl_identifier* ocxl_afu_get_identifier ( ocxl_afu_h  afu)

Get the identifier of the AFU.

The identifier contains the AFU name & index.

Parameters
afuThe AFU to find the identifier of
Returns
the identifier of the AFU

Definition at line 77 of file afu.c.

◆ ocxl_afu_get_pasid()

uint32_t ocxl_afu_get_pasid ( ocxl_afu_h  afu)

Get the PASID for the currently open context.

While not commonly used, some AFU implementations may need their PASID written back to MMIO registers, or shared with other AFUs.

Precondition
ocxl_afu_open() has been successfully called
Parameters
afuthe AFU instance to get the PASID of
Returns
the PASID
Return values
UINT32_MAXif the context has not been attached

Definition at line 60 of file afu.c.

◆ ocxl_afu_get_sysfs_path()

const char* ocxl_afu_get_sysfs_path ( ocxl_afu_h  afu)

Get the canonical sysfs path of the AFU.

Returns the 'true' sysfs path of the AFU (within /sys/class/ocxl).

Parameters
afuThe AFU to get the sysfs path of
Returns
the sysfs path, or NULL if the device is invalid

Definition at line 111 of file afu.c.

◆ ocxl_afu_get_version()

void ocxl_afu_get_version ( ocxl_afu_h  afu,
uint8_t *  major,
uint8_t *  minor 
)

Get the version of the AFU.

Returns the version of the AFU, as specified by the AFU implementation. See Section 4.3.3.1 AFU Descriptor Template 0 of the OpenCAPI Data Link Specification Offset 0x1C, AFU Version Major/Minor.

Parameters
afuThe AFU to get the sysfs path of
[out]majorthe major version number
[out]minorthe minor version number

Definition at line 129 of file afu.c.