Lines Matching full:handle

426  * The protocols list is initialized. The object handle is set.
428 void efi_add_handle(efi_handle_t handle) in efi_add_handle() argument
430 if (!handle) in efi_add_handle()
432 INIT_LIST_HEAD(&handle->protocols); in efi_add_handle()
433 list_add_tail(&handle->link, &efi_obj_list); in efi_add_handle()
437 * efi_create_handle() - create handle
438 * @handle: new handle
442 efi_status_t efi_create_handle(efi_handle_t *handle) in efi_create_handle() argument
451 *handle = obj; in efi_create_handle()
457 * efi_search_protocol() - find a protocol on a handle.
458 * @handle: handle
464 efi_status_t efi_search_protocol(const efi_handle_t handle, in efi_search_protocol() argument
471 if (!handle || !protocol_guid) in efi_search_protocol()
473 efiobj = efi_search_obj(handle); in efi_search_protocol()
490 * efi_remove_protocol() - delete protocol from a handle
491 * @handle: handle from which the protocol shall be deleted
497 efi_status_t efi_remove_protocol(const efi_handle_t handle, in efi_remove_protocol() argument
504 ret = efi_search_protocol(handle, protocol, &handler); in efi_remove_protocol()
517 * efi_remove_all_protocols() - delete all protocols from a handle
518 * @handle: handle from which the protocols shall be deleted
522 efi_status_t efi_remove_all_protocols(const efi_handle_t handle) in efi_remove_all_protocols() argument
528 efiobj = efi_search_obj(handle); in efi_remove_all_protocols()
534 ret = efi_remove_protocol(handle, protocol->guid, in efi_remove_all_protocols()
543 * efi_delete_handle() - delete handle
545 * @obj: handle to delete
547 void efi_delete_handle(efi_handle_t handle) in efi_delete_handle() argument
549 if (!handle) in efi_delete_handle()
551 efi_remove_all_protocols(handle); in efi_delete_handle()
552 list_del(&handle->link); in efi_delete_handle()
553 free(handle); in efi_delete_handle()
928 * efi_search_obj() - find the internal EFI object for a handle
929 * @handle: handle to find
933 struct efi_object *efi_search_obj(const efi_handle_t handle) in efi_search_obj() argument
938 if (efiobj == handle) in efi_search_obj()
981 * efi_add_protocol() - install new protocol on a handle
982 * @handle: handle on which the protocol shall be installed
988 efi_status_t efi_add_protocol(const efi_handle_t handle, in efi_add_protocol() argument
996 efiobj = efi_search_obj(handle); in efi_add_protocol()
999 ret = efi_search_protocol(handle, protocol, NULL); in efi_add_protocol()
1016 * @handle: handle on which the protocol shall be installed
1030 efi_handle_t *handle, const efi_guid_t *protocol, in efi_install_protocol_interface() argument
1035 EFI_ENTRY("%p, %pUl, %d, %p", handle, protocol, protocol_interface_type, in efi_install_protocol_interface()
1038 if (!handle || !protocol || in efi_install_protocol_interface()
1044 /* Create new handle if requested. */ in efi_install_protocol_interface()
1045 if (!*handle) { in efi_install_protocol_interface()
1046 r = efi_create_handle(handle); in efi_install_protocol_interface()
1049 debug("%sEFI: new handle %p\n", indent_string(nesting_level), in efi_install_protocol_interface()
1050 *handle); in efi_install_protocol_interface()
1052 debug("%sEFI: handle %p\n", indent_string(nesting_level), in efi_install_protocol_interface()
1053 *handle); in efi_install_protocol_interface()
1056 r = efi_add_protocol(*handle, protocol, protocol_interface); in efi_install_protocol_interface()
1063 * @handle: handle of the controller
1072 static efi_status_t efi_get_drivers(efi_handle_t handle, in efi_get_drivers() argument
1083 list_for_each_entry(handler, &handle->protocols, link) { in efi_get_drivers()
1101 list_for_each_entry(handler, &handle->protocols, link) { in efi_get_drivers()
1114 /* Copy handle to buffer */ in efi_get_drivers()
1128 * @handle: handle of the controller
1130 * @child_handle: handle of the child to destroy
1140 (efi_handle_t handle, in efi_disconnect_all_drivers() argument
1148 ret = efi_get_drivers(handle, protocol, &number_of_drivers, in efi_disconnect_all_drivers()
1156 handle, in efi_disconnect_all_drivers()
1169 * @handle: handle from which the protocol shall be removed
1173 * This function DOES NOT delete a handle without installed protocol.
1178 (efi_handle_t handle, const efi_guid_t *protocol, in efi_uninstall_protocol() argument
1187 /* Check handle */ in efi_uninstall_protocol()
1188 efiobj = efi_search_obj(handle); in efi_uninstall_protocol()
1193 /* Find the protocol on the handle */ in efi_uninstall_protocol()
1194 r = efi_search_protocol(handle, protocol, &handler); in efi_uninstall_protocol()
1215 r = efi_remove_protocol(handle, protocol, protocol_interface); in efi_uninstall_protocol()
1222 * @handle: handle from which the protocol shall be removed
1234 (efi_handle_t handle, const efi_guid_t *protocol, in efi_uninstall_protocol_interface() argument
1239 EFI_ENTRY("%p, %pUl, %p", handle, protocol, protocol_interface); in efi_uninstall_protocol_interface()
1241 ret = efi_uninstall_protocol(handle, protocol, protocol_interface); in efi_uninstall_protocol_interface()
1245 /* If the last protocol has been removed, delete the handle. */ in efi_uninstall_protocol_interface()
1246 if (list_empty(&handle->protocols)) { in efi_uninstall_protocol_interface()
1247 list_del(&handle->link); in efi_uninstall_protocol_interface()
1248 free(handle); in efi_uninstall_protocol_interface()
1277 * efi_search() - determine if an EFI handle implements a protocol
1281 * @handle: handle
1285 * Return: 0 if the handle implements the protocol
1289 efi_handle_t handle) in efi_search() argument
1300 ret = efi_search_protocol(handle, protocol, NULL); in efi_search()
1391 * Return: 0 if the handle implements the protocol
1510 * @handle_ptr: handle of the loaded image
1557 * return handle which points to loaded_image_info in efi_setup_loaded_image()
1669 * @parent_image: the caller's image handle
1673 * @image_handle: handle for the newly installed image
1763 * @image_handle: handle of the image
1828 * @image_handle: handle of the application or driver that is exiting
1872 * @image_handle: handle of the image to be unloaded
1910 * @image_handle: handle of the loaded image
2050 * @handle: handle on which the protocol shall be closed
2052 * @agent_handle: handle of the driver
2053 * @controller_handle: handle of the controller
2062 static efi_status_t EFIAPI efi_close_protocol(efi_handle_t handle, in efi_close_protocol() argument
2072 EFI_ENTRY("%p, %pUl, %p, %p", handle, protocol, agent_handle, in efi_close_protocol()
2079 r = efi_search_protocol(handle, protocol, &handler); in efi_close_protocol()
2098 * of a protocol on a handle
2099 * @handle: handle for which the information shall be retrieved
2112 efi_handle_t handle, const efi_guid_t *protocol, in efi_open_protocol_information() argument
2122 EFI_ENTRY("%p, %pUl, %p, %p", handle, protocol, entry_buffer, in efi_open_protocol_information()
2130 r = efi_search_protocol(handle, protocol, &handler); in efi_open_protocol_information()
2162 * efi_protocols_per_handle() - get protocols installed on a handle
2163 * @handle: handle for which the information is retrieved
2175 efi_handle_t handle, efi_guid_t ***protocol_buffer, in efi_protocols_per_handle() argument
2183 EFI_ENTRY("%p, %p, %p", handle, protocol_buffer, in efi_protocols_per_handle()
2186 if (!handle || !protocol_buffer || !protocol_buffer_count) in efi_protocols_per_handle()
2192 efiobj = efi_search_obj(handle); in efi_protocols_per_handle()
2314 * efi_locate_device_path() - Get the device path and handle of an device
2318 * @device: handle of the device
2367 * This handle can only be a better fit in efi_locate_device_path()
2394 * @handle: handle on which the protocol interfaces shall be installed
2406 (efi_handle_t *handle, ...) in efi_install_multiple_protocol_interfaces() argument
2408 EFI_ENTRY("%p", handle); in efi_install_multiple_protocol_interfaces()
2416 if (!handle) in efi_install_multiple_protocol_interfaces()
2419 efi_va_start(argptr, handle); in efi_install_multiple_protocol_interfaces()
2426 handle, protocol, in efi_install_multiple_protocol_interfaces()
2438 efi_va_start(argptr, handle); in efi_install_multiple_protocol_interfaces()
2442 EFI_CALL(efi_uninstall_protocol_interface(*handle, protocol, in efi_install_multiple_protocol_interfaces()
2453 * @handle: handle from which the protocol interfaces shall be removed
2465 efi_handle_t handle, ...) in efi_uninstall_multiple_protocol_interfaces() argument
2467 EFI_ENTRY("%p", handle); in efi_uninstall_multiple_protocol_interfaces()
2475 if (!handle) in efi_uninstall_multiple_protocol_interfaces()
2478 efi_va_start(argptr, handle); in efi_uninstall_multiple_protocol_interfaces()
2484 r = efi_uninstall_protocol(handle, protocol, in efi_uninstall_multiple_protocol_interfaces()
2492 /* If the last protocol has been removed, delete the handle. */ in efi_uninstall_multiple_protocol_interfaces()
2493 if (list_empty(&handle->protocols)) { in efi_uninstall_multiple_protocol_interfaces()
2494 list_del(&handle->link); in efi_uninstall_multiple_protocol_interfaces()
2495 free(handle); in efi_uninstall_multiple_protocol_interfaces()
2501 efi_va_start(argptr, handle); in efi_uninstall_multiple_protocol_interfaces()
2505 EFI_CALL(efi_install_protocol_interface(&handle, protocol, in efi_uninstall_multiple_protocol_interfaces()
2575 * efi_protocol_open() - open protocol interface on a handle
2578 * @agent_handle: handle of the driver
2579 * @controller_handle: handle of the controller
2670 * efi_open_protocol() - open protocol interface on a handle
2671 * @handle: handle on which the protocol shall be opened
2674 * @agent_handle: handle of the driver
2675 * @controller_handle: handle of the controller
2686 (efi_handle_t handle, const efi_guid_t *protocol, in efi_open_protocol() argument
2693 EFI_ENTRY("%p, %pUl, %p, %p, %p, 0x%x", handle, protocol, in efi_open_protocol()
2697 if (!handle || !protocol || in efi_open_protocol()
2709 if (controller_handle == handle) in efi_open_protocol()
2714 /* Check that the controller handle is valid */ in efi_open_protocol()
2719 /* Check that the agent handle is valid */ in efi_open_protocol()
2727 r = efi_search_protocol(handle, protocol, &handler); in efi_open_protocol()
2738 * efi_handle_protocol() - get interface of a protocol on a handle
2739 * @handle: handle on which the protocol shall be opened
2750 static efi_status_t EFIAPI efi_handle_protocol(efi_handle_t handle, in efi_handle_protocol() argument
2754 return efi_open_protocol(handle, protocol, protocol_interface, NULL, in efi_handle_protocol()
2760 * @controller_handle: controller handle
2761 * @driver_image_handle: driver handle
2868 * @controller_handle: handle of the controller
2869 * @driver_image_handle: handle of the driver
2937 * @handle: handle on which the protocol shall be reinstalled
2953 efi_handle_t handle, const efi_guid_t *protocol, in efi_reinstall_protocol_interface() argument
2958 EFI_ENTRY("%p, %pUl, %p, %p", handle, protocol, old_interface, in efi_reinstall_protocol_interface()
2961 /* Uninstall protocol but do not delete handle */ in efi_reinstall_protocol_interface()
2962 ret = efi_uninstall_protocol(handle, protocol, old_interface); in efi_reinstall_protocol_interface()
2967 ret = efi_add_protocol(handle, protocol, new_interface); in efi_reinstall_protocol_interface()
2969 * The UEFI spec does not specify what should happen to the handle in efi_reinstall_protocol_interface()
2970 * if in case of an error no protocol interface remains on the handle. in efi_reinstall_protocol_interface()
2977 * Do not create an error if no suitable driver for the handle exists. in efi_reinstall_protocol_interface()
2979 EFI_CALL(efi_connect_controller(handle, NULL, NULL, true)); in efi_reinstall_protocol_interface()
2986 * @efiobj: handle of the controller
2987 * @driver_handle: handle of the driver
3036 /* Copy handle to buffer */ in efi_get_child_controllers()
3050 * @controller_handle: handle of the controller
3051 * @driver_image_handle: handle of the driver
3052 * @child_handle: handle of the child to destroy
3087 /* If no driver handle is supplied, disconnect all drivers */ in efi_disconnect_controller()