.\" Copyright 2015-2017 IBM Corp. .\" .TH CXL_AFU_OPEN_H 3 2017-05-24 "LIBCXL 1.5" "CXL Programmer's Manual" .SH NAME cxl_afu_open_h \- open an AFU by AFU handle .SH SYNOPSIS .B #include .PP .B "struct cxl_afu_h cxl_afu_open_h(struct cxl_afu_h" .BI * afu ", enum cxl_views " view ); .SH DESCRIPTION .BR cxl_afu_open_h () opens the device and returns a new AFU handle for .IR afu , as specified by the CXL .IR view : .TP .B CXL_VIEW_DEDICATED AFU opened in dedicated process mode, .TP .B CXL_VIEW_MASTER AFU opened in AFU directed mode, master context, .TP .B CXL_VIEW_SLAVE AFU opened in AFU directed mode, slave context. .PP 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. .SH RETURN VALUE On success, an AFU handle is returned. On error, NULL is returned, and .I errno is set appropriately. .SH ERRORS .TP .B ENODEV The AFU does not support this view. .TP .B ENOMEM Insufficient memory. .TP .B ENOSPC No AFU context available. .TP .B EPROTO Unsupported kernel CXL API version. .SH FILES .TP .BI /dev/cxl/afu . d AFU device in dedicated process mode. .TP .BI /dev/cxl/afu . m AFU device in AFU directed mode, master context. .TP .BI /dev/cxl/afu . s AFU device in AFU directed mode, slave context. .SH SEE ALSO .BR cxl (3), .BR cxl_afu_dev_name (3), .BR cxl_afu_fd (3), .BR cxl_afu_fd_to_h (3), .BR cxl_afu_free (3), .BR cxl_afu_get_process_element (3), .BR cxl_afu_open_dev (3), .BR cxl_afu_opened (3), .BR cxl_get_api_version (3), .BR cxl_get_api_version_compatible (3), .BR cxl_get_cr_class (3), .BR cxl_get_cr_device (3), .BR cxl_get_cr_vendor (3), .BR cxl_get_mode (3), .BR cxl_get_modes_supported (3), .BR cxl_read_event (3), .BR cxl_read_expected_event (3), .BR cxl_set_mode (3), .BR open (2)