FreeBSD/sys/dev/drm2/radeon/radeon_acpi.c
/**
 * radeon_atcs_verify_interface - verify ATCS
 *
 * @handle: acpi handle
 * @atcs: radeon atcs struct
 *
 * Execute the ATCS_FUNCTION_VERIFY_INTERFACE ATCS function
 * to initialize ATCS and determine what features are supported
 * (all asics).
 * returns 0 on success, error on failure.
 */
verify ATCS
@handle: acpi handle
@atcs: radeon atcs struct

Execute the ATCS_FUNCTION_VERIFY_INTERFACE ATCS function
to initialize ATCS and determine what features are supported
(all asics).
returns 0 on success, error on failure.
verify ATCS @handle : acpi handle @atcs : radeon atcs struct Execute the ATCS_FUNCTION_VERIFY_INTERFACE ATCS function to initialize ATCS and determine what features are supported ( all asics ) . returns 0 on success error on failure .
static int radeon_atcs_verify_interface(ACPI_HANDLE handle,
					struct radeon_atcs *atcs)
{
	ACPI_OBJECT *info;
	struct atcs_verify_interface output;
	size_t size;
	int err = 0;
	info = radeon_atcs_call(handle, ATCS_FUNCTION_VERIFY_INTERFACE, NULL);
	if (!info)
		return -EIO;
	memset(&output, 0, sizeof(output));
	size = *(u16 *) info->Buffer.Pointer;
	if (size < 8) {
		DRM_INFO("ATCS buffer is too small: %zu\n", size);
		err = -EINVAL;
		goto out;
	}
	size = min(sizeof(output), size);
	memcpy(&output, info->Buffer.Pointer, size);
	DRM_DEBUG_DRIVER("ATCS version %u\n", output.version);
	radeon_atcs_parse_functions(&atcs->functions, output.function_bits);
out:
	AcpiOsFree(info);
	return err;
}
static int radeon_atcs_verify_interface ( ACPI_HANDLE handle , struct radeon_atcs * atcs ) { ACPI_OBJECT * info ; struct atcs_verify_interface output ; size_t size ; int err = 0 ; info = radeon_atcs_call ( handle , ATCS_FUNCTION_VERIFY_INTERFACE , NULL ) ; if ( ! info ) return - EIO ; memset ( & output , 0 , sizeof ( output ) ) ; size = * ( u16 * ) info -> Buffer . Pointer ; if ( size < 8 ) { DRM_INFO ( " \n " , size ) ; err = - EINVAL ; goto out ; } size = min ( sizeof ( output ) , size ) ; memcpy ( & output , info -> Buffer . Pointer , size ) ; DRM_DEBUG_DRIVER ( " \n " , output . version ) ; radeon_atcs_parse_functions ( & atcs -> functions , output . function_bits ) ; out : AcpiOsFree ( info ) ; return err ; }
radeon_atcs_verify_interface - verify ATCS
 @handle: acpi handle
 @atcs: radeon atcs struct
radeon_atcs_verify_interface - verify ATCS @handle : acpi handle @atcs : radeon atcs struct
/* TODO: check version? */