| /* |
| * Copyright (C) 2024 The Android Open Source Project |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, embodiment or |
| * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| * KIND, either express or implied. See the License for the specific language |
| * governing permissions and limitations under the License. |
| * |
| * SPDX-License-Identifier: Apache-2.0 OR BSD-2-Clause-Patent |
| * |
| * This file is dual-licensed under Apache 2.0 and BSD-2-Clause-Patent. |
| * You may choose to use this file under the terms of either: |
| * (a) the Apache License, Version 2.0, or |
| * (b) the BSD 2-Clause Patent License. |
| * |
| * Unless you expressly elect the BSD-2-Clause-Patent terms, the Apache-2.0 |
| * license terms apply by default. |
| */ |
| |
| #include <efi_api.h> |
| #include <gbl_efi_common.h> |
| |
| #define GBL_EFI_FASTBOOT_TRANSPORT_PROTOCOL_REVISION GBL_PROTOCOL_REVISION(1, 0) |
| |
| #define GBL_EFI_FASTBOOT_TRANSPORT_PROTOCOL_GUID \ |
| EFI_GUID(0xedade92c, 0x5c48, 0x440d, 0x84, 0x9c, 0xe2, 0xa0, 0xc7, \ |
| 0xe5, 0x51, 0x43) |
| |
| EFI_ENUM(GblEfiFastbootRxMode, uint32_t, |
| SINGLE_PACKET = 0, |
| FIXED_LENGTH); |
| |
| typedef struct GblEfiFastbootTransportProtocol { |
| uint64_t revision; |
| const char *description; |
| efi_status_t (*start)(struct GblEfiFastbootTransportProtocol *self); |
| efi_status_t (*stop)(struct GblEfiFastbootTransportProtocol *self); |
| efi_status_t (*receive)(struct GblEfiFastbootTransportProtocol *self, |
| size_t *buffer_size, void *buffer, |
| GblEfiFastbootRxMode mode); |
| efi_status_t (*send)(struct GblEfiFastbootTransportProtocol *self, |
| size_t *buffer_size, const void *buffer); |
| efi_status_t (*flush)(struct GblEfiFastbootTransportProtocol *self); |
| } GblEfiFastbootTransportProtocol; |