The AFU getter functions provide access to AFU metadata, such as the identifier, paths, and PASID.
More...
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.
◆ 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
-
afu | The 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()
Get the identifier of the AFU.
The identifier contains the AFU name & index.
- Parameters
-
afu | The AFU to find the identifier of |
- Returns
- the identifier of the AFU
Definition at line 77 of file afu.c.
◆ ocxl_afu_get_pasid()
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
-
afu | the AFU instance to get the PASID of |
- Returns
- the PASID
- Return values
-
UINT32_MAX | if 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
-
afu | The 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
-
| afu | The AFU to get the sysfs path of |
[out] | major | the major version number |
[out] | minor | the minor version number |
Definition at line 129 of file afu.c.