| /* |
| * Copyright (c) 2026 The Fuchsia Authors |
| * |
| * SPDX-License-Identifier: BSD-3-Clause |
| */ |
| |
| #ifndef __GBL_EFI_FASTBOOT_PROTOCOL_H__ |
| #define __GBL_EFI_FASTBOOT_PROTOCOL_H__ |
| |
| #include <efi_api.h> |
| #include <gbl_efi_common.h> |
| |
| #define GBL_EFI_FASTBOOT_PROTOCOL_GUID \ |
| EFI_GUID(0xc67e48a0, 0x5eb8, 0x4127, 0xbe, 0x89, 0xdf, 0x2e, 0xd9, \ |
| 0x3d, 0x8a, 0x9a) |
| |
| #define GBL_EFI_FASTBOOT_PROTOCOL_REVISION GBL_PROTOCOL_REVISION(1, 0) |
| |
| #define GBL_EFI_FASTBOOT_SERIAL_NUMBER_MAX_LEN_UTF8 32 |
| |
| typedef void (*GetVarAllCallback)(void* context, size_t num_args, |
| const char *const *args, |
| const char *val); |
| |
| EFI_ENUM(GblEfiFastbootMessageType, uint32_t, |
| GBL_EFI_FASTBOOT_MESSAGE_TYPE_OKAY, |
| GBL_EFI_FASTBOOT_MESSAGE_TYPE_FAIL, |
| GBL_EFI_FASTBOOT_MESSAGE_TYPE_INFO); |
| |
| typedef efi_status_t (*FastbootMessageSender)(void* context, |
| GblEfiFastbootMessageType msg_type, |
| size_t msg_len, const char *msg); |
| |
| EFI_ENUM(GblEfiFastbootCommandExecResult, uint32_t, |
| GBL_EFI_FASTBOOT_COMMAND_EXEC_RESULT_PROHIBITED, |
| GBL_EFI_FASTBOOT_COMMAND_EXEC_RESULT_DEFAULT_IMPL, |
| GBL_EFI_FASTBOOT_COMMAND_EXEC_RESULT_CUSTOM_IMPL); |
| |
| typedef struct GblEfiFastbootProtocol { |
| uint64_t revision; |
| char serial_number[GBL_EFI_FASTBOOT_SERIAL_NUMBER_MAX_LEN_UTF8]; |
| |
| efi_status_t (*get_var)(struct GblEfiFastbootProtocol *self, |
| size_t num_args, const char *const *args, |
| size_t *buffer_size, char *buffer); |
| efi_status_t (*get_var_all)(struct GblEfiFastbootProtocol *self, |
| void *context, GetVarAllCallback cb); |
| |
| efi_status_t (*get_staged)(struct GblEfiFastbootProtocol *self, |
| size_t *buffer_size, size_t *buffer_remains, |
| uint8_t *buffer); |
| |
| efi_status_t (*command_exec)(struct GblEfiFastbootProtocol *self, |
| size_t num_args, const char *const *args, |
| size_t download_buffer_size, |
| size_t download_buffer_used_size, |
| uint8_t *download_buffer, |
| GblEfiFastbootCommandExecResult *implementation, |
| FastbootMessageSender sender, void *context); |
| efi_status_t (*get_partition_type)(struct GblEfiFastbootProtocol *self, |
| const char *part_name, |
| size_t *part_type_len, char *part_type); |
| } GblEfiFastbootProtocol; |
| |
| #endif /* __GBL_EFI_FASTBOOT_PROTOCOL_H__ */ |