Lines Matching full:handle
30 * DoorbellEntry describes the a doorbell notification handle allocated by the
80 * with a given doorbell handle. For guest endpoints, the
83 * handle. Hypervisor endpoints are not yet supported.
85 int vmci_dbell_get_priv_flags(struct vmci_handle handle, u32 *priv_flags) in vmci_dbell_get_priv_flags() argument
87 if (priv_flags == NULL || handle.context == VMCI_INVALID_ID) in vmci_dbell_get_priv_flags()
90 if (handle.context == VMCI_HOST_CONTEXT_ID) { in vmci_dbell_get_priv_flags()
94 resource = vmci_resource_by_handle(handle, in vmci_dbell_get_priv_flags()
102 } else if (handle.context == VMCI_HYPERVISOR_CONTEXT_ID) { in vmci_dbell_get_priv_flags()
109 *priv_flags = vmci_context_get_priv_flags(handle.context); in vmci_dbell_get_priv_flags()
225 * Creates a link between the given doorbell handle and the given
229 static int dbell_link(struct vmci_handle handle, u32 notify_idx) in dbell_link() argument
237 link_msg.handle = handle; in dbell_link()
244 * Unlinks the given doorbell handle from an index in the bitmap in
247 static int dbell_unlink(struct vmci_handle handle) in dbell_unlink() argument
255 unlink_msg.handle = handle; in dbell_unlink()
264 static int dbell_notify_as_guest(struct vmci_handle handle, u32 priv_flags) in dbell_notify_as_guest() argument
272 notify_msg.handle = handle; in dbell_notify_as_guest()
292 int vmci_dbell_host_context_notify(u32 src_cid, struct vmci_handle handle) in vmci_dbell_host_context_notify() argument
297 if (vmci_handle_is_invalid(handle)) { in vmci_dbell_host_context_notify()
298 pr_devel("Notifying an invalid doorbell (handle=0x%x:0x%x)\n", in vmci_dbell_host_context_notify()
299 handle.context, handle.resource); in vmci_dbell_host_context_notify()
303 resource = vmci_resource_by_handle(handle, in vmci_dbell_host_context_notify()
306 pr_devel("Notifying an unknown doorbell (handle=0x%x:0x%x)\n", in vmci_dbell_host_context_notify()
307 handle.context, handle.resource); in vmci_dbell_host_context_notify()
394 * @handle: A handle used to track the resource. Can be invalid.
400 * Creates a doorbell with the given callback. If the handle is
401 * VMCI_INVALID_HANDLE, a free handle will be assigned, if
409 int vmci_doorbell_create(struct vmci_handle *handle, in vmci_doorbell_create() argument
418 if (!handle || !notify_cb || flags & ~VMCI_FLAG_DELAYED_CB || in vmci_doorbell_create()
428 if (vmci_handle_is_invalid(*handle)) { in vmci_doorbell_create()
443 * Validate the handle. We must do both of the checks below in vmci_doorbell_create()
449 if (handle->context == VMCI_HOST_CONTEXT_ID || in vmci_doorbell_create()
451 vmci_get_context_id() == handle->context)) { in vmci_doorbell_create()
455 if (!valid_context || handle->resource == VMCI_INVALID_ID) { in vmci_doorbell_create()
456 pr_devel("Invalid argument (handle=0x%x:0x%x)\n", in vmci_doorbell_create()
457 handle->context, handle->resource); in vmci_doorbell_create()
462 new_handle = *handle; in vmci_doorbell_create()
478 pr_warn("Failed to add new resource (handle=0x%x:0x%x), error: %d\n", in vmci_doorbell_create()
493 *handle = new_handle; in vmci_doorbell_create()
508 * @handle: The handle tracking the resource.
513 int vmci_doorbell_destroy(struct vmci_handle handle) in vmci_doorbell_destroy() argument
518 if (vmci_handle_is_invalid(handle)) in vmci_doorbell_destroy()
521 resource = vmci_resource_by_handle(handle, in vmci_doorbell_destroy()
524 pr_devel("Failed to destroy doorbell (handle=0x%x:0x%x)\n", in vmci_doorbell_destroy()
525 handle.context, handle.resource); in vmci_doorbell_destroy()
536 result = dbell_unlink(handle); in vmci_doorbell_destroy()
548 * hypervisor side yet. Since the handle has in vmci_doorbell_destroy()
552 pr_devel("Unlink of doorbell (handle=0x%x:0x%x) unknown by hypervisor (error=%d)\n", in vmci_doorbell_destroy()
553 handle.context, handle.resource, result); in vmci_doorbell_destroy()
576 * handle. For host side generation of notifications, the caller