UefiHandleParsingLib.h 9.6 KB

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