- bullseye 1.7-2+b1
|CXL_ADAPTER_AFU_NEXT(3)||CXL Programmer's Manual||CXL_ADAPTER_AFU_NEXT(3)|
cxl_adapter_afu_next - iterate to the next AFU of a CXL adapter
cxl_for_each_adapter_afu - iteration macro
struct cxl_afu_h *cxl_adapter_afu_next(struct cxl_adapter_h *adapter, struct cxl_afu_h *afu);
cxl_adapter_afu_next() returns an AFU handle describing the next AFU of the CXL adapter.
When afu is NULL, then an AFU handle is allocated, and the first available AFU of adapter is returned.
When afu is the last AFU of the current adapter, then the AFU handle is freed, errno is set to zero, and NULL is returned. Alternatively, the AFU handle can be freed explicitly with cxl_afu_free().
On success, an AFU handle is returned, or NULL is returned and errno is set to zero. On error, NULL is returned, and errno is set appropriately.
The CXL library provides the following macro to enumerate the AFUs of a CXL adapter:
#define cxl_for_each_adapter_afu(adapter, afu) \
for (afu = cxl_adapter_afu_next(adapter, NULL); afu; \
afu = cxl_adapter_afu_next(NULL, afu))
cxl(3), cxl_adapter_next(3), cxl_afu_dev_name(3), cxl_afu_free(3), cxl_afu_next(3), cxl_afu_sysfs_pci(3), cxl_get_mmio_size(3), cxl_get_mode(3), cxl_get_modes_supported(3), cxl_get_pp_mmio_len(3), cxl_get_pp_mmio_off(3), cxl_get_prefault_mode(3), cxl_set_mode(3), cxl_set_prefault_mode(3)