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

Execute the ATIF_FUNCTION_VERIFY_INTERFACE ATIF function
to initialize ATIF and determine what features are supported
(all asics).
returns 0 on success, error on failure.
verify ATIF @handle : acpi handle @atif : radeon atif struct Execute the ATIF_FUNCTION_VERIFY_INTERFACE ATIF function to initialize ATIF and determine what features are supported ( all asics ) . returns 0 on success error on failure .
static int radeon_atif_verify_interface(ACPI_HANDLE handle,
		struct radeon_atif *atif)
{
	ACPI_OBJECT *info;
	struct atif_verify_interface output;
	size_t size;
	int err = 0;
	info = radeon_atif_call(handle, ATIF_FUNCTION_VERIFY_INTERFACE, NULL);
	if (!info)
		return -EIO;
	memset(&output, 0, sizeof(output));
	size = *(u16 *) info->Buffer.Pointer;
	if (size < 12) {
		DRM_INFO("ATIF 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("ATIF version %u\n", output.version);
	radeon_atif_parse_notification(&atif->notifications, output.notification_mask);
	radeon_atif_parse_functions(&atif->functions, output.function_bits);
out:
	AcpiOsFree(info);
	return err;
}
static int radeon_atif_verify_interface ( ACPI_HANDLE handle , struct radeon_atif * atif ) { ACPI_OBJECT * info ; struct atif_verify_interface output ; size_t size ; int err = 0 ; info = radeon_atif_call ( handle , ATIF_FUNCTION_VERIFY_INTERFACE , NULL ) ; if ( ! info ) return - EIO ; memset ( & output , 0 , sizeof ( output ) ) ; size = * ( u16 * ) info -> Buffer . Pointer ; if ( size < 12 ) { 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_atif_parse_notification ( & atif -> notifications , output . notification_mask ) ; radeon_atif_parse_functions ( & atif -> functions , output . function_bits ) ; out : AcpiOsFree ( info ) ; return err ; }
radeon_atif_verify_interface - verify ATIF
 @handle: acpi handle
 @atif: radeon atif struct
radeon_atif_verify_interface - verify ATIF @handle : acpi handle @atif : radeon atif struct
/* TODO: check version? */