summaryrefslogtreecommitdiff
path: root/Include/Protocol/FirmwareManagement.h
blob: 8d68fbf63214c622027d13a1743675273b7d303c (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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
//*************************************************************************
//*************************************************************************
//**                                                                     **
//**        (C)Copyright 1985-2011, American Megatrends, Inc.            **
//**                                                                     **
//**                       All Rights Reserved.                          **
//**                                                                     **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                     **
//**                       Phone: (770)-246-8600                         **
//**                                                                     **
//*************************************************************************
//*************************************************************************

//*************************************************************************
// $Header: /Alaska/BIN/Core/Include/Protocol/FirmwareManagement.h 1     5/02/11 5:39p Artems $
//
// $Revision: 1 $
//
// $Date: 5/02/11 5:39p $
//*************************************************************************
// Revision History
// ----------------
// $Log: /Alaska/BIN/Core/Include/Protocol/FirmwareManagement.h $
// 
// 1     5/02/11 5:39p Artems
// 
//*************************************************************************
//<AMI_FHDR_START>
//
// Name:  FirmwareManagement.h
//
//  Description:
//  EFI_FIRMWARE_MANAGEMENT_PROTOCOL definition file
//
//<AMI_FHDR_END>
//*************************************************************************
#ifndef __FIRMWARE_MANAGEMENT_PROTOCOL__H__
#define __FIRMWARE_MANAGEMENT_PROTOCOL__H__
#ifdef __cplusplus
extern "C" {
#endif

#include <EFI.h>
#include <WinCertificate.h>

#define EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GUID \
    { 0x86c77a67, 0xb97, 0x4633, 0xa1, 0x87, 0x49, 0x10, 0x4d, 0x6, 0x85, 0xc7 }

#define IMAGE_ATTRIBUTE_IMAGE_UPDATABLE         0x0000000000000001
#define IMAGE_ATTRIBUTE_RESET_REQUIRED          0x0000000000000002
#define IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED 0x0000000000000004
#define IMAGE_ATTRIBUTE_IN_USE                  0x0000000000000008

#define IMAGE_COMPATIBILITY_CHECK_SUPPORTED     0x0000000000000001

#define EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION 1

#define IMAGE_UPDATABLE_VALID        0x0000000000000001
#define IMAGE_UPDATABLE_INVALID      0x0000000000000002
#define IMAGE_UPDATABLE_INVALID_TYPE 0x0000000000000004
#define IMAGE_UPDATABLE_INVALID_OLD  0x0000000000000008

#define PACKAGE_ATTRIBUTE_VERSION_UPDATABLE       0x0000000000000001
#define PACKAGE_ATTRIBUTE_RESET_REQUIRED          0x0000000000000002
#define PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED 0x0000000000000004

GUID_VARIABLE_DECLARATION(gEfiFirmwareManagementProtocolGuid, EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GUID);


typedef struct _EFI_FIRMWARE_MANAGEMENT_PROTOCOL EFI_FIRMWARE_MANAGEMENT_PROTOCOL;

typedef struct {
    UINT64                    MonotonicCount;
    WIN_CERTIFICATE_UEFI_GUID AuthInfo;
} EFI_FIRMWARE_IMAGE_AUTHENTICATION;

typedef struct {
    UINT8    ImageIndex;
    EFI_GUID ImageTypeId;
    UINT64   ImageId;
    CHAR16   *ImageIdName;
    UINT32   Version;
    CHAR16   *VersionName;
    UINTN    Size;
    UINT64   AttributesSupported;
    UINT64   AttributesSetting;
    UINT64   Compatibilities;
} EFI_FIRMWARE_IMAGE_DESCRIPTOR;

typedef
EFI_STATUS
(EFIAPI *EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS) (
    IN UINTN Completion
);

typedef
EFI_STATUS
(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_IMAGE_INFO) (
    IN     EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,
    IN OUT UINTN                            *ImageInfoSize,
    IN OUT EFI_FIRMWARE_IMAGE_DESCRIPTOR    *ImageInfo,
    OUT    UINT32                           *DescriptorVersion,
    OUT    UINT8                            *DescriptorCount,
    OUT    UINTN                            *DescriptorSize,
    OUT    UINT32                           *PackageVersion,
    OUT    CHAR16                           **PackageVersionName
);

typedef
EFI_STATUS
(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_IMAGE) (
    IN     EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,
    IN     UINT8                            ImageIndex,
    IN OUT VOID                             *Image,
    IN OUT UINTN                            *ImageSize
);

typedef
EFI_STATUS
(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_SET_IMAGE) (
    IN       EFI_FIRMWARE_MANAGEMENT_PROTOCOL              *This,
    IN       UINT8                                         ImageIndex,
    IN CONST VOID                                          *Image,
    IN       UINTN                                         ImageSize,
    IN CONST VOID                                          *VendorCode,
    IN       EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS Progress,
    OUT      CHAR16                                        **AbortReason
);

typedef
EFI_STATUS
(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_CHECK_IMAGE) (
    IN       EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,
    IN       UINT8                            ImageIndex,
    IN CONST VOID                             *Image,
    IN       UINTN                            ImageSize,
    OUT      UINT32                           *ImageUpdatable
);

typedef
EFI_STATUS
(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_PACKAGE_INFO) (
    IN  EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,
    OUT UINT32                           *PackageVersion,
    OUT CHAR16                           **PackageVersionName,
    OUT UINT32                           *PackageVersionNameMaxLen,
    OUT UINT64                           *AttributesSupported,
    OUT UINT64                           *AttributesSetting
);

typedef
EFI_STATUS
(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_SET_PACKAGE_INFO) (
    IN       EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,
    IN CONST VOID                             *Image,
    IN       UINTN                            ImageSize,
    IN CONST VOID                             *VendorCode,
    IN       UINT32                           PackageVersion,
    IN CONST CHAR16                           *PackageVersionName
);

struct _EFI_FIRMWARE_MANAGEMENT_PROTOCOL {
    EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_IMAGE_INFO   GetImageInfo;
    EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_IMAGE        GetImage;
    EFI_FIRMWARE_MANAGEMENT_PROTOCOL_SET_IMAGE        SetImage;
    EFI_FIRMWARE_MANAGEMENT_PROTOCOL_CHECK_IMAGE      CheckImage;
    EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_PACKAGE_INFO GetPackageInfo;
    EFI_FIRMWARE_MANAGEMENT_PROTOCOL_SET_PACKAGE_INFO SetPackageInfo;
};

/****** DO NOT WRITE BELOW THIS LINE *******/
#ifdef __cplusplus
}
#endif
#endif
//*************************************************************************
//*************************************************************************
//**                                                                     **
//**        (C)Copyright 1985-2011, American Megatrends, Inc.            **
//**                                                                     **
//**                       All Rights Reserved.                          **
//**                                                                     **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                     **
//**                       Phone: (770)-246-8600                         **
//**                                                                     **
//*************************************************************************
//*************************************************************************