]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Ppi/DeviceRecoveryModule.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Ppi / DeviceRecoveryModule.h
CommitLineData
1cddf2ef 1/** @file\r
2 This file declares the Device Recovery Module PPI.\r
3\r
4 The interface of this PPI does the following:\r
5 - Reports the number of recovery DXE capsules that exist on the associated device(s)\r
6 - Finds the requested firmware binary capsule\r
7 - Loads that capsule into memory\r
8\r
9 A device can be either a group of devices, such as a block device, or an individual device.\r
10 The module determines the internal search order, with capsule number 1 as the highest load\r
11 priority and number N as the lowest priority.\r
12\r
9095d37b 13 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 14 SPDX-License-Identifier: BSD-2-Clause-Patent\r
1cddf2ef 15\r
16 @par Revision Reference:\r
9095d37b 17 This PPI is defined in UEFI Platform Initialization Specification 1.2 Volume 1:\r
1cddf2ef 18 Pre-EFI Initalization Core Interface\r
19\r
20**/\r
21\r
22#ifndef _PEI_DEVICE_RECOVERY_MODULE_PPI_H_\r
23#define _PEI_DEVICE_RECOVERY_MODULE_PPI_H_\r
24\r
25#define EFI_PEI_DEVICE_RECOVERY_MODULE_PPI_GUID \\r
26 { \\r
27 0x0DE2CE25, 0x446A, 0x45a7, {0xBF, 0xC9, 0x37, 0xDA, 0x26, 0x34, 0x4B, 0x37 } \\r
28 }\r
29\r
30typedef struct _EFI_PEI_DEVICE_RECOVERY_MODULE_PPI EFI_PEI_DEVICE_RECOVERY_MODULE_PPI;\r
31\r
32/**\r
33 Returns the number of DXE capsules residing on the device.\r
34\r
35 This function searches for DXE capsules from the associated device and returns\r
9095d37b
LG
36 the number and maximum size in bytes of the capsules discovered. Entry 1 is\r
37 assumed to be the highest load priority and entry N is assumed to be the lowest\r
1cddf2ef 38 priority.\r
39\r
9095d37b 40 @param[in] PeiServices General-purpose services that are available\r
1cddf2ef 41 to every PEIM\r
42 @param[in] This Indicates the EFI_PEI_DEVICE_RECOVERY_MODULE_PPI\r
43 instance.\r
9095d37b
LG
44 @param[out] NumberRecoveryCapsules Pointer to a caller-allocated UINTN. On\r
45 output, *NumberRecoveryCapsules contains\r
46 the number of recovery capsule images\r
47 available for retrieval from this PEIM\r
1cddf2ef 48 instance.\r
49\r
50 @retval EFI_SUCCESS One or more capsules were discovered.\r
51 @retval EFI_DEVICE_ERROR A device error occurred.\r
52 @retval EFI_NOT_FOUND A recovery DXE capsule cannot be found.\r
53\r
54**/\r
55typedef\r
56EFI_STATUS\r
57(EFIAPI *EFI_PEI_DEVICE_GET_NUMBER_RECOVERY_CAPSULE)(\r
58 IN EFI_PEI_SERVICES **PeiServices,\r
59 IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This,\r
60 OUT UINTN *NumberRecoveryCapsules\r
61 );\r
62\r
63/**\r
64 Returns the size and type of the requested recovery capsule.\r
65\r
66 This function gets the size and type of the capsule specified by CapsuleInstance.\r
67\r
68 @param[in] PeiServices General-purpose services that are available to every PEIM\r
9095d37b 69 @param[in] This Indicates the EFI_PEI_DEVICE_RECOVERY_MODULE_PPI\r
1cddf2ef 70 instance.\r
9095d37b
LG
71 @param[in] CapsuleInstance Specifies for which capsule instance to retrieve\r
72 the information. This parameter must be between\r
73 one and the value returned by GetNumberRecoveryCapsules()\r
1cddf2ef 74 in NumberRecoveryCapsules.\r
9095d37b
LG
75 @param[out] Size A pointer to a caller-allocated UINTN in which\r
76 the size of the requested recovery module is\r
1cddf2ef 77 returned.\r
9095d37b
LG
78 @param[out] CapsuleType A pointer to a caller-allocated EFI_GUID in which\r
79 the type of the requested recovery capsule is\r
80 returned. The semantic meaning of the value\r
1cddf2ef 81 returned is defined by the implementation.\r
82\r
83 @retval EFI_SUCCESS One or more capsules were discovered.\r
84 @retval EFI_DEVICE_ERROR A device error occurred.\r
85 @retval EFI_NOT_FOUND A recovery DXE capsule cannot be found.\r
86\r
87**/\r
88typedef\r
89EFI_STATUS\r
90(EFIAPI *EFI_PEI_DEVICE_GET_RECOVERY_CAPSULE_INFO)(\r
91 IN EFI_PEI_SERVICES **PeiServices,\r
92 IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This,\r
93 IN UINTN CapsuleInstance,\r
94 OUT UINTN *Size,\r
95 OUT EFI_GUID *CapsuleType\r
96 );\r
97\r
98/**\r
99 Loads a DXE capsule from some media into memory.\r
100\r
101 This function, by whatever mechanism, retrieves a DXE capsule from some device\r
102 and loads it into memory. Note that the published interface is device neutral.\r
103\r
9095d37b 104 @param[in] PeiServices General-purpose services that are available\r
1cddf2ef 105 to every PEIM\r
106 @param[in] This Indicates the EFI_PEI_DEVICE_RECOVERY_MODULE_PPI\r
107 instance.\r
108 @param[in] CapsuleInstance Specifies which capsule instance to retrieve.\r
9095d37b 109 @param[out] Buffer Specifies a caller-allocated buffer in which\r
1cddf2ef 110 the requested recovery capsule will be returned.\r
111\r
112 @retval EFI_SUCCESS The capsule was loaded correctly.\r
113 @retval EFI_DEVICE_ERROR A device error occurred.\r
114 @retval EFI_NOT_FOUND A requested recovery DXE capsule cannot be found.\r
115\r
116**/\r
117typedef\r
118EFI_STATUS\r
119(EFIAPI *EFI_PEI_DEVICE_LOAD_RECOVERY_CAPSULE)(\r
5fbfa2d0 120 IN EFI_PEI_SERVICES **PeiServices,\r
1cddf2ef 121 IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This,\r
122 IN UINTN CapsuleInstance,\r
123 OUT VOID *Buffer\r
124 );\r
125\r
126///\r
127/// Presents a standard interface to EFI_PEI_DEVICE_RECOVERY_MODULE_PPI,\r
128/// regardless of the underlying device(s).\r
129///\r
130struct _EFI_PEI_DEVICE_RECOVERY_MODULE_PPI {\r
131 EFI_PEI_DEVICE_GET_NUMBER_RECOVERY_CAPSULE GetNumberRecoveryCapsules; ///< Returns the number of DXE capsules residing on the device.\r
132 EFI_PEI_DEVICE_GET_RECOVERY_CAPSULE_INFO GetRecoveryCapsuleInfo; ///< Returns the size and type of the requested recovery capsule.\r
133 EFI_PEI_DEVICE_LOAD_RECOVERY_CAPSULE LoadRecoveryCapsule; ///< Loads a DXE capsule from some media into memory.\r
134};\r
135\r
136extern EFI_GUID gEfiPeiDeviceRecoveryModulePpiGuid;\r
137\r
138#endif /* _PEI_DEVICE_RECOVERY_MODULE_PPI_H_ */\r