summaryrefslogtreecommitdiff
path: root/EmbeddedPkg/Include/Protocol/GblEfiFastbootTransport.h
blob: c6a563f1cb1fb213a13b6cfed6190d37125e4582 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/** @file
  GBL EFI Fastboot Transport Protocol.

  Enables firmware to expose a transport interface for Android Fastboot.

  Related docs:
  https://android.googlesource.com/platform/bootable/libbootloader/+/refs/heads/gbl-mainline/gbl/docs/gbl_efi_fastboot_transport_protocol.md

  Copyright (c) 2025, The Android Open Source Project.<BR>
  SPDX-License-Identifier: BSD-2-Clause-Patent

**/

#pragma once

#include <Uefi/UefiBaseType.h>

//
// {edade92c-5c48-440d-849c-e2a0c7e55143}
//
#define GBL_EFI_FASTBOOT_TRANSPORT_PROTOCOL_GUID \
  { 0xedade92c, 0x5c48, 0x440d, { 0x84, 0x9c, 0xe2, 0xa0, 0xc7, 0xe5, 0x51, 0x43 } }

#define GBL_EFI_FASTBOOT_TRANSPORT_PROTOCOL_REVISION  0x00010000

typedef struct _GBL_EFI_FASTBOOT_TRANSPORT_PROTOCOL GBL_EFI_FASTBOOT_TRANSPORT_PROTOCOL;

typedef enum {
  GblEfiFastbootRxModeSinglePacket = 0,
  GblEfiFastbootRxModeFixedLength
} GBL_EFI_FASTBOOT_RX_MODE;

typedef
EFI_STATUS
(EFIAPI *GBL_EFI_FASTBOOT_TRANSPORT_START)(
  IN GBL_EFI_FASTBOOT_TRANSPORT_PROTOCOL *This
  );

typedef
EFI_STATUS
(EFIAPI *GBL_EFI_FASTBOOT_TRANSPORT_STOP)(
  IN GBL_EFI_FASTBOOT_TRANSPORT_PROTOCOL *This
  );

typedef
EFI_STATUS
(EFIAPI *GBL_EFI_FASTBOOT_TRANSPORT_RECEIVE)(
  IN GBL_EFI_FASTBOOT_TRANSPORT_PROTOCOL *This,
  IN OUT UINTN                           *BufferSize,
  OUT VOID                               *Buffer,
  IN UINT32                              Mode // GBL_EFI_FASTBOOT_RX_MODE
  );

typedef
EFI_STATUS
(EFIAPI *GBL_EFI_FASTBOOT_TRANSPORT_SEND)(
  IN GBL_EFI_FASTBOOT_TRANSPORT_PROTOCOL *This,
  IN OUT UINTN                           *BufferSize,
  IN CONST VOID                          *Buffer
  );

typedef
EFI_STATUS
(EFIAPI *GBL_EFI_FASTBOOT_TRANSPORT_FLUSH)(
  IN GBL_EFI_FASTBOOT_TRANSPORT_PROTOCOL *This
  );

struct _GBL_EFI_FASTBOOT_TRANSPORT_PROTOCOL {
  UINT64                                Revision;
  CONST CHAR8                           *Description;
  GBL_EFI_FASTBOOT_TRANSPORT_START      Start;
  GBL_EFI_FASTBOOT_TRANSPORT_STOP       Stop;
  GBL_EFI_FASTBOOT_TRANSPORT_RECEIVE    Receive;
  GBL_EFI_FASTBOOT_TRANSPORT_SEND       Send;
  GBL_EFI_FASTBOOT_TRANSPORT_FLUSH      Flush;
};

extern EFI_GUID  gGblEfiFastbootTransportProtocolGuid;