Scroll to navigation

CXL_AFU_OPEN_H(3) CXL Programmer's Manual CXL_AFU_OPEN_H(3)

NAME

cxl_afu_open_h - open an AFU by AFU handle

SYNOPSIS

#include <libcxl.h>

struct cxl_afu_h cxl_afu_open_h(struct cxl_afu_h *afu, enum cxl_views view);

DESCRIPTION

cxl_afu_open_h() opens the device and returns a new AFU handle for afu, as specified by the CXL view:
CXL_VIEW_DEDICATED
AFU opened in dedicated process mode,
CXL_VIEW_MASTER
AFU opened in AFU directed mode, master context,
CXL_VIEW_SLAVE
AFU opened in AFU directed mode, slave context.

A dedicated process mode AFU only has one context and only allows the device to be opened once. An AFU directed mode AFU can have many contexts, the device can be opened once for each context that is available.

RETURN VALUE

On success, an AFU handle is returned. On error, NULL is returned, and errno is set appropriately.

ERRORS

ENODEV
The AFU does not support this view.
ENOMEM
Insufficient memory.
ENOSPC
No AFU context available.
EPROTO
Unsupported kernel CXL API version.

FILES

/dev/cxl/afu<i>.<j>d
AFU device in dedicated process mode.
/dev/cxl/afu<i>.<j>m
AFU device in AFU directed mode, master context.
/dev/cxl/afu<i>.<j>s
AFU device in AFU directed mode, slave context.

SEE ALSO

cxl(3), cxl_afu_dev_name(3), cxl_afu_fd(3), cxl_afu_fd_to_h(3), cxl_afu_free(3), cxl_afu_get_process_element(3), cxl_afu_open_dev(3), cxl_afu_opened(3), cxl_get_api_version(3), cxl_get_api_version_compatible(3), cxl_get_cr_class(3), cxl_get_cr_device(3), cxl_get_cr_vendor(3), cxl_get_mode(3), cxl_get_modes_supported(3), cxl_read_event(3), cxl_read_expected_event(3), cxl_set_mode(3), open(2)
2017-05-24 LIBCXL 1.5