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()
275 int vmci_dbell_host_context_notify(u32 src_cid, struct vmci_handle handle) in vmci_dbell_host_context_notify() argument
280 if (vmci_handle_is_invalid(handle)) { in vmci_dbell_host_context_notify()
281 pr_devel("Notifying an invalid doorbell (handle=0x%x:0x%x)\n", in vmci_dbell_host_context_notify()
282 handle.context, handle.resource); in vmci_dbell_host_context_notify()
286 resource = vmci_resource_by_handle(handle, in vmci_dbell_host_context_notify()
289 pr_devel("Notifying an unknown doorbell (handle=0x%x:0x%x)\n", in vmci_dbell_host_context_notify()
290 handle.context, handle.resource); in vmci_dbell_host_context_notify()
377 * @handle: A handle used to track the resource. Can be invalid.
383 * Creates a doorbell with the given callback. If the handle is
384 * VMCI_INVALID_HANDLE, a free handle will be assigned, if
392 int vmci_doorbell_create(struct vmci_handle *handle, in vmci_doorbell_create() argument
401 if (!handle || !notify_cb || flags & ~VMCI_FLAG_DELAYED_CB || in vmci_doorbell_create()
411 if (vmci_handle_is_invalid(*handle)) { in vmci_doorbell_create()
426 * Validate the handle. We must do both of the checks below in vmci_doorbell_create()
432 if (handle->context == VMCI_HOST_CONTEXT_ID || in vmci_doorbell_create()
434 vmci_get_context_id() == handle->context)) { in vmci_doorbell_create()
438 if (!valid_context || handle->resource == VMCI_INVALID_ID) { in vmci_doorbell_create()
439 pr_devel("Invalid argument (handle=0x%x:0x%x)\n", in vmci_doorbell_create()
440 handle->context, handle->resource); in vmci_doorbell_create()
445 new_handle = *handle; in vmci_doorbell_create()
461 pr_warn("Failed to add new resource (handle=0x%x:0x%x), error: %d\n", in vmci_doorbell_create()
476 *handle = new_handle; in vmci_doorbell_create()
491 * @handle: The handle tracking the resource.
496 int vmci_doorbell_destroy(struct vmci_handle handle) in vmci_doorbell_destroy() argument
501 if (vmci_handle_is_invalid(handle)) in vmci_doorbell_destroy()
504 resource = vmci_resource_by_handle(handle, in vmci_doorbell_destroy()
507 pr_devel("Failed to destroy doorbell (handle=0x%x:0x%x)\n", in vmci_doorbell_destroy()
508 handle.context, handle.resource); in vmci_doorbell_destroy()
519 result = dbell_unlink(handle); in vmci_doorbell_destroy()
531 * hypervisor side yet. Since the handle has in vmci_doorbell_destroy()
535 pr_devel("Unlink of doorbell (handle=0x%x:0x%x) unknown by hypervisor (error=%d)\n", in vmci_doorbell_destroy()
536 handle.context, handle.resource, result); in vmci_doorbell_destroy()