linux/drivers/misc/vmw_balloon.c
/*
 * Initialize vmci doorbell, to get notified as soon as balloon changes
 */
Initialize vmci doorbell, to get notified as soon as balloon changes
Initialize vmci doorbell to get notified as soon as balloon changes
static int vmballoon_vmci_init(struct vmballoon *b)
{
	unsigned long error, dummy;
	if ((b->capabilities & VMW_BALLOON_SIGNALLED_WAKEUP_CMD) == 0)
		return 0;
	error = vmci_doorbell_create(&b->vmci_doorbell, VMCI_FLAG_DELAYED_CB,
				     VMCI_PRIVILEGE_FLAG_RESTRICTED,
				     vmballoon_doorbell, b);
	if (error != VMCI_SUCCESS)
		goto fail;
	error = VMWARE_BALLOON_CMD(VMCI_DOORBELL_SET, b->vmci_doorbell.context,
				   b->vmci_doorbell.resource, dummy);
	STATS_INC(b->stats.doorbell_set);
	if (error != VMW_BALLOON_SUCCESS)
		goto fail;
	return 0;
fail:
	vmballoon_vmci_cleanup(b);
	return -EIO;
}
static int vmballoon_vmci_init ( struct vmballoon * b ) { unsigned long error , dummy ; if ( ( b -> capabilities & VMW_BALLOON_SIGNALLED_WAKEUP_CMD ) == 0 ) return 0 ; error = vmci_doorbell_create ( & b -> vmci_doorbell , VMCI_FLAG_DELAYED_CB , VMCI_PRIVILEGE_FLAG_RESTRICTED , vmballoon_doorbell , b ) ; if ( error != VMCI_SUCCESS ) goto fail ; error = VMWARE_BALLOON_CMD ( VMCI_DOORBELL_SET , b -> vmci_doorbell . context , b -> vmci_doorbell . resource , dummy ) ; STATS_INC ( b -> stats . doorbell_set ) ; if ( error != VMW_BALLOON_SUCCESS ) goto fail ; return 0 ; fail : vmballoon_vmci_cleanup ( b ) ; return - EIO ; }
Initialize vmci doorbell, to get notified as soon as balloon changes
Initialize vmci doorbell to get notified as soon as balloon changes