]> git.proxmox.com Git - mirror_edk2.git/blob - ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
ShellPkg: Modify the 'dh' Shell command to dump the Firmware Management Protocol...
[mirror_edk2.git] / ShellPkg / Library / UefiHandleParsingLib / UefiHandleParsingLib.h
1 /** @file
2 Provides interface to advanced shell functionality for parsing both handle and protocol database.
3
4 (C) Copyright 2013-2016 Hewlett-Packard Development Company, L.P.<BR>
5 Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef _UEFI_HANDLE_PARSING_LIB_INTERNAL_H_
17 #define _UEFI_HANDLE_PARSING_LIB_INTERNAL_H_
18
19 #include <Uefi.h>
20
21 #include <Guid/FileInfo.h>
22 #include <Guid/ConsoleInDevice.h>
23 #include <Guid/ConsoleOutDevice.h>
24 #include <Guid/StandardErrorDevice.h>
25 #include <Guid/GlobalVariable.h>
26 #include <Guid/Gpt.h>
27 #include <Guid/FileSystemInfo.h>
28 #include <Guid/ShellLibHiiGuid.h>
29
30 #include <Protocol/SimpleFileSystem.h>
31 #include <Protocol/LoadedImage.h>
32 #include <Protocol/EfiShellInterface.h>
33 #include <Protocol/EfiShellEnvironment2.h>
34 #include <Protocol/EfiShell.h>
35 #include <Protocol/EfiShellParameters.h>
36 #include <Protocol/DevicePathToText.h>
37 #include <Protocol/DriverBinding.h>
38 #include <Protocol/DriverConfiguration2.h>
39 #include <Protocol/DriverConfiguration.h>
40 #include <Protocol/DriverDiagnostics2.h>
41 #include <Protocol/DriverDiagnostics.h>
42 #include <Protocol/ComponentName2.h>
43 #include <Protocol/ComponentName.h>
44 #include <Protocol/PlatformDriverOverride.h>
45 #include <Protocol/DevicePathUtilities.h>
46 #include <Protocol/DevicePathFromText.h>
47 #include <Protocol/BusSpecificDriverOverride.h>
48 #include <Protocol/PlatformToDriverConfiguration.h>
49 #include <Protocol/DriverSupportedEfiVersion.h>
50 #include <Protocol/SimpleTextInEx.h>
51 #include <Protocol/SimplePointer.h>
52 #include <Protocol/SerialIo.h>
53 #include <Protocol/AbsolutePointer.h>
54 #include <Protocol/GraphicsOutput.h>
55 #include <Protocol/EdidDiscovered.h>
56 #include <Protocol/EdidActive.h>
57 #include <Protocol/EdidOverride.h>
58 #include <Protocol/LoadFile.h>
59 #include <Protocol/LoadFile2.h>
60 #include <Protocol/TapeIo.h>
61 #include <Protocol/DiskIo.h>
62 #include <Protocol/BlockIo.h>
63 #include <Protocol/UnicodeCollation.h>
64 #include <Protocol/PciRootBridgeIo.h>
65 #include <Protocol/PciIo.h>
66 #include <Protocol/ScsiPassThru.h>
67 #include <Protocol/ScsiPassThruExt.h>
68 #include <Protocol/ScsiIo.h>
69 #include <Protocol/IScsiInitiatorName.h>
70 #include <Protocol/UsbIo.h>
71 #include <Protocol/UsbHostController.h>
72 #include <Protocol/Usb2HostController.h>
73 #include <Protocol/DebugSupport.h>
74 #include <Protocol/DebugPort.h>
75 #include <Protocol/Decompress.h>
76 #include <Protocol/AcpiTable.h>
77 #include <Protocol/Ebc.h>
78 #include <Protocol/SimpleNetwork.h>
79 #include <Protocol/NetworkInterfaceIdentifier.h>
80 #include <Protocol/PxeBaseCode.h>
81 #include <Protocol/PxeBaseCodeCallBack.h>
82 #include <Protocol/Bis.h>
83 #include <Protocol/ManagedNetwork.h>
84 #include <Protocol/Arp.h>
85 #include <Protocol/Dhcp4.h>
86 #include <Protocol/Tcp4.h>
87 #include <Protocol/Ip4.h>
88 #include <Protocol/Ip4Config.h>
89 #include <Protocol/Ip4Config2.h>
90 #include <Protocol/Udp4.h>
91 #include <Protocol/Mtftp4.h>
92 #include <Protocol/AuthenticationInfo.h>
93 #include <Protocol/Hash.h>
94 #include <Protocol/HiiFont.h>
95 #include <Protocol/HiiString.h>
96 #include <Protocol/HiiImage.h>
97 #include <Protocol/HiiDatabase.h>
98 #include <Protocol/HiiConfigRouting.h>
99 #include <Protocol/HiiConfigAccess.h>
100 #include <Protocol/FormBrowser2.h>
101 #include <Protocol/DeviceIo.h>
102 #include <Protocol/UgaDraw.h>
103 #include <Protocol/UgaIo.h>
104 #include <Protocol/DriverConfiguration.h>
105 #include <Protocol/DriverConfiguration2.h>
106 #include <Protocol/DevicePathUtilities.h>
107 //#include <Protocol/FirmwareVolume.h>
108 //#include <Protocol/FirmwareVolume2.h>
109 #include <Protocol/DriverFamilyOverride.h>
110 #include <Protocol/Pcd.h>
111 #include <Protocol/TcgService.h>
112 #include <Protocol/HiiPackageList.h>
113 #include <Protocol/Ip6.h>
114 #include <Protocol/Ip6Config.h>
115 #include <Protocol/Mtftp6.h>
116 #include <Protocol/Dhcp6.h>
117 #include <Protocol/Udp6.h>
118 #include <Protocol/Tcp6.h>
119 #include <Protocol/VlanConfig.h>
120 #include <Protocol/Eap.h>
121 #include <Protocol/EapManagement.h>
122 #include <Protocol/Ftp4.h>
123 #include <Protocol/IpSecConfig.h>
124 #include <Protocol/DriverHealth.h>
125 #include <Protocol/DeferredImageLoad.h>
126 #include <Protocol/UserCredential.h>
127 #include <Protocol/UserManager.h>
128 #include <Protocol/AtaPassThru.h>
129 #include <Protocol/FirmwareManagement.h>
130 #include <Protocol/IpSec.h>
131 #include <Protocol/Kms.h>
132 #include <Protocol/BlockIo2.h>
133 #include <Protocol/StorageSecurityCommand.h>
134 #include <Protocol/UserCredential2.h>
135 #include <Protocol/IdeControllerInit.h>
136 #include <Protocol/DiskIo2.h>
137 #include <Protocol/AdapterInformation.h>
138 #include <Protocol/EfiShellDynamicCommand.h>
139 #include <Protocol/DiskInfo.h>
140
141 #include <Library/HandleParsingLib.h>
142 #include <Library/UefiBootServicesTableLib.h>
143 #include <Library/BaseLib.h>
144 #include <Library/BaseMemoryLib.h>
145 #include <Library/DebugLib.h>
146 #include <Library/MemoryAllocationLib.h>
147 #include <Library/DevicePathLib.h>
148 #include <Library/PcdLib.h>
149 #include <Library/PrintLib.h>
150 #include <Library/UefiLib.h>
151 #include <Library/HiiLib.h>
152 #include <Library/ShellLib.h>
153 #include <Library/SortLib.h>
154
155 #define EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION_V1 1
156 #define EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION_V2 2
157
158 ///
159 /// EFI_FIRMWARE_IMAGE_DESCRIPTOR in UEFI spec < 2.4a
160 ///
161 typedef struct {
162 ///
163 /// A unique number identifying the firmware image within the device. The number is
164 /// between 1 and DescriptorCount.
165 ///
166 UINT8 ImageIndex;
167 ///
168 /// A unique number identifying the firmware image type.
169 ///
170 EFI_GUID ImageTypeId;
171 ///
172 /// A unique number identifying the firmware image.
173 ///
174 UINT64 ImageId;
175 ///
176 /// A pointer to a null-terminated string representing the firmware image name.
177 ///
178 CHAR16 *ImageIdName;
179 ///
180 /// Identifies the version of the device firmware. The format is vendor specific and new
181 /// version must have a greater value than an old version.
182 ///
183 UINT32 Version;
184 ///
185 /// A pointer to a null-terminated string representing the firmware image version name.
186 ///
187 CHAR16 *VersionName;
188 ///
189 /// Size of the image in bytes. If size=0, then only ImageIndex and ImageTypeId are valid.
190 ///
191 UINTN Size;
192 ///
193 /// Image attributes that are supported by this device. See 'Image Attribute Definitions'
194 /// for possible returned values of this parameter. A value of 1 indicates the attribute is
195 /// supported and the current setting value is indicated in AttributesSetting. A
196 /// value of 0 indicates the attribute is not supported and the current setting value in
197 /// AttributesSetting is meaningless.
198 ///
199 UINT64 AttributesSupported;
200 ///
201 /// Image attributes. See 'Image Attribute Definitions' for possible returned values of
202 /// this parameter.
203 ///
204 UINT64 AttributesSetting;
205 ///
206 /// Image compatibilities. See 'Image Compatibility Definitions' for possible returned
207 /// values of this parameter.
208 ///
209 UINT64 Compatibilities;
210 } EFI_FIRMWARE_IMAGE_DESCRIPTOR_V1;
211
212
213 ///
214 /// EFI_FIRMWARE_IMAGE_DESCRIPTOR in UEFI spec > 2.4a and < 2.5
215 ///
216 typedef struct {
217 ///
218 /// A unique number identifying the firmware image within the device. The number is
219 /// between 1 and DescriptorCount.
220 ///
221 UINT8 ImageIndex;
222 ///
223 /// A unique number identifying the firmware image type.
224 ///
225 EFI_GUID ImageTypeId;
226 ///
227 /// A unique number identifying the firmware image.
228 ///
229 UINT64 ImageId;
230 ///
231 /// A pointer to a null-terminated string representing the firmware image name.
232 ///
233 CHAR16 *ImageIdName;
234 ///
235 /// Identifies the version of the device firmware. The format is vendor specific and new
236 /// version must have a greater value than an old version.
237 ///
238 UINT32 Version;
239 ///
240 /// A pointer to a null-terminated string representing the firmware image version name.
241 ///
242 CHAR16 *VersionName;
243 ///
244 /// Size of the image in bytes. If size=0, then only ImageIndex and ImageTypeId are valid.
245 ///
246 UINTN Size;
247 ///
248 /// Image attributes that are supported by this device. See 'Image Attribute Definitions'
249 /// for possible returned values of this parameter. A value of 1 indicates the attribute is
250 /// supported and the current setting value is indicated in AttributesSetting. A
251 /// value of 0 indicates the attribute is not supported and the current setting value in
252 /// AttributesSetting is meaningless.
253 ///
254 UINT64 AttributesSupported;
255 ///
256 /// Image attributes. See 'Image Attribute Definitions' for possible returned values of
257 /// this parameter.
258 ///
259 UINT64 AttributesSetting;
260 ///
261 /// Image compatibilities. See 'Image Compatibility Definitions' for possible returned
262 /// values of this parameter.
263 ///
264 UINT64 Compatibilities;
265 ///
266 /// Describes the lowest ImageDescriptor version that the device will accept. Only
267 /// present in version 2 or higher.
268 UINT32 LowestSupportedImageVersion;
269 } EFI_FIRMWARE_IMAGE_DESCRIPTOR_V2;
270
271 typedef struct {
272 LIST_ENTRY Link;
273 EFI_HANDLE TheHandle;
274 UINTN TheIndex;
275 }HANDLE_LIST;
276
277 typedef struct {
278 HANDLE_LIST List;
279 UINTN NextIndex;
280 } HANDLE_INDEX_LIST;
281
282 typedef
283 CHAR16 *
284 (EFIAPI *DUMP_PROTOCOL_INFO)(
285 IN CONST EFI_HANDLE TheHandle,
286 IN CONST BOOLEAN Verbose
287 );
288
289 typedef struct _GUID_INFO_BLOCK{
290 EFI_STRING_ID StringId;
291 EFI_GUID *GuidId;
292 DUMP_PROTOCOL_INFO DumpInfo;
293 } GUID_INFO_BLOCK;
294
295 #endif
296