]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Ppi/DeviceRecoveryModule.h
6dd525a859449022a1d4d120534d4ff32401ecb2
[mirror_edk2.git] / IntelFrameworkPkg / Include / Ppi / DeviceRecoveryModule.h
1 /** @file
2 This file declares Device Recovery Module PPI.
3 The interface of this PPI does the following:
4 - Reports the number of recovery DXE capsules that exist on the associated device(s)
5 - Finds the requested firmware binary capsule
6 - Loads that capsule into memory
7 A device can be either a group of devices, such as a block device, or an individual device.T he
8 module determines the internal search order, with capsule number 1 as the highest load priority and
9 number N as the lowest priority.
10
11 Copyright (c) 2007 - 2009, Intel Corporation
12 All rights reserved. This program and the accompanying materials
13 are licensed and made available under the terms and conditions of the BSD License
14 which accompanies this distribution. The full text of the license may be found at
15 http://opensource.org/licenses/bsd-license.php
16
17 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
18 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19
20 @par Revision Reference:
21 This PPI is defined in Framework of EFI Recovery spec.
22 Version 0.9
23
24 **/
25
26 #ifndef _PEI_DEVICE_RECOVERY_MODULE_PPI_H_
27 #define _PEI_DEVICE_RECOVERY_MODULE_PPI_H_
28
29 #include <PiPei.h>
30
31 #define EFI_PEI_DEVICE_RECOVERY_MODULE_PPI_GUID \
32 { \
33 0x0DE2CE25, 0x446A, 0x45a7, {0xBF, 0xC9, 0x37, 0xDA, 0x26, 0x34, 0x4B, 0x37 } \
34 }
35
36 typedef struct _EFI_PEI_DEVICE_RECOVERY_MODULE_PPI EFI_PEI_DEVICE_RECOVERY_MODULE_PPI;
37
38 /**
39 This function searches for DXE capsules from the associated device and returns the number
40 and maximum size in bytes of the capsules discovered. Entry 1 is assumed to be the
41 highest load priority and entry N is assumed to be the lowest priority.
42
43 @param PeiServices General-purpose services that are available to every PEIM
44 @param This Indicates the EFI_PEI_DEVICE_RECOVERY_MODULE_PPI instance.
45 @param NumberRecoveryCapsules Pointer to a caller-allocated UINTN. On output,
46 *NumberRecoveryCapsules contains the number of recovery capsule
47 images available for retrieval from this PEIM instance.
48
49 @retval EFI_SUCCESS One or more capsules were discovered.
50 @retval EFI_DEVICE_ERROR A device error occurred.
51 @retval EFI_NOT_FOUND A recovery DXE capsule cannot be found.
52
53 **/
54 typedef
55 EFI_STATUS
56 (EFIAPI *EFI_PEI_DEVICE_GET_NUMBER_RECOVERY_CAPSULE)(
57 IN EFI_PEI_SERVICES **PeiServices,
58 IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This,
59 OUT UINTN *NumberRecoveryCapsules
60 );
61
62 /**
63 This function gets the size and type of the requested recovery capsule.
64
65 @param PeiServices General-purpose services that are available to every PEIM
66 @param This Indicates the EFI_PEI_DEVICE_RECOVERY_MODULE_PPI instance.
67 @param CapsuleInstance Specifies for which capsule instance to retrieve the information.
68 @param Size A pointer to a caller-allocated UINTN in which the size of
69 the requested recovery module is returned.
70 @param CapsuleType A pointer to a caller-allocated EFI_GUID in
71 which the type of the requested recovery capsule is returned.
72
73 @retval EFI_SUCCESS One or more capsules were discovered.
74 @retval EFI_DEVICE_ERROR A device error occurred.
75 @retval EFI_NOT_FOUND A recovery DXE capsule cannot be found.
76
77 **/
78 typedef
79 EFI_STATUS
80 (EFIAPI *EFI_PEI_DEVICE_GET_RECOVERY_CAPSULE_INFO)(
81 IN EFI_PEI_SERVICES **PeiServices,
82 IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This,
83 IN UINTN CapsuleInstance,
84 OUT UINTN *Size,
85 OUT EFI_GUID *CapsuleType
86 );
87
88 /**
89 This function retrieves a DXE capsule from some device and loads it into memory.
90 Note that the published interface is device neutral.
91
92 @param PeiServices General-purpose services that are available to every PEIM
93 @param This Indicates the EFI_PEI_DEVICE_RECOVERY_MODULE_PPI instance.
94 @param CapsuleInstance Specifies which capsule instance to retrieve.
95 @param Buffer Specifies a caller-allocated buffer in which the requested
96 recovery capsule will be returned.
97
98 @retval EFI_SUCCESS One or more capsules were discovered.
99 @retval EFI_DEVICE_ERROR A device error occurred.
100 @retval EFI_NOT_FOUND A recovery DXE capsule cannot be found.
101
102 **/
103 typedef
104 EFI_STATUS
105 (EFIAPI *EFI_PEI_DEVICE_LOAD_RECOVERY_CAPSULE)(
106 IN OUT EFI_PEI_SERVICES **PeiServices,
107 IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This,
108 IN UINTN CapsuleInstance,
109 OUT VOID *Buffer
110 );
111
112 ///
113 /// Presents a standard interface to EFI_PEI_DEVICE_RECOVERY_MODULE_PPI,
114 /// regardless of the underlying device(s).
115 ///
116 struct _EFI_PEI_DEVICE_RECOVERY_MODULE_PPI {
117 ///
118 /// Returns the number of DXE capsules that were found.
119 ///
120 EFI_PEI_DEVICE_GET_NUMBER_RECOVERY_CAPSULE GetNumberRecoveryCapsules;
121
122 ///
123 /// Returns the capsule image type and the size of a given image.
124 ///
125 EFI_PEI_DEVICE_GET_RECOVERY_CAPSULE_INFO GetRecoveryCapsuleInfo;
126
127 ///
128 /// Loads a DXE capsule into memory
129 ///
130 EFI_PEI_DEVICE_LOAD_RECOVERY_CAPSULE LoadRecoveryCapsule;
131 };
132
133 extern EFI_GUID gEfiPeiDeviceRecoveryModulePpiGuid;
134
135 #endif /* _PEI_DEVICE_RECOVERY_MODULE_PPI_H_ */