2010-09-14 07:18:09 +02:00
|
|
|
/** @file
|
|
|
|
Provides interface to advanced shell functionality for parsing both handle and protocol database.
|
|
|
|
|
2015-07-08 04:55:09 +02:00
|
|
|
Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
|
2016-04-22 18:32:26 +02:00
|
|
|
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
|
|
|
|
(C) Copyright 2013-2016 Hewlett-Packard Development Company, L.P.<BR>
|
2010-09-14 07:18:09 +02:00
|
|
|
This program and the accompanying materials
|
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
2011-04-05 22:55:45 +02:00
|
|
|
#ifndef _UEFI_HANDLE_PARSING_LIB_INTERNAL_H_
|
2011-03-25 22:06:23 +01:00
|
|
|
#define _UEFI_HANDLE_PARSING_LIB_INTERNAL_H_
|
|
|
|
|
2010-09-14 07:18:09 +02:00
|
|
|
#include <Uefi.h>
|
|
|
|
|
|
|
|
#include <Guid/FileInfo.h>
|
|
|
|
#include <Guid/ConsoleInDevice.h>
|
|
|
|
#include <Guid/ConsoleOutDevice.h>
|
|
|
|
#include <Guid/StandardErrorDevice.h>
|
|
|
|
#include <Guid/GlobalVariable.h>
|
|
|
|
#include <Guid/Gpt.h>
|
|
|
|
#include <Guid/FileSystemInfo.h>
|
2011-09-21 03:56:00 +02:00
|
|
|
#include <Guid/ShellLibHiiGuid.h>
|
2010-09-14 07:18:09 +02:00
|
|
|
|
|
|
|
#include <Protocol/SimpleFileSystem.h>
|
|
|
|
#include <Protocol/LoadedImage.h>
|
|
|
|
#include <Protocol/EfiShellInterface.h>
|
|
|
|
#include <Protocol/EfiShellEnvironment2.h>
|
|
|
|
#include <Protocol/EfiShell.h>
|
|
|
|
#include <Protocol/EfiShellParameters.h>
|
|
|
|
#include <Protocol/DevicePathToText.h>
|
|
|
|
#include <Protocol/DriverBinding.h>
|
|
|
|
#include <Protocol/DriverConfiguration2.h>
|
|
|
|
#include <Protocol/DriverConfiguration.h>
|
|
|
|
#include <Protocol/DriverDiagnostics2.h>
|
|
|
|
#include <Protocol/DriverDiagnostics.h>
|
|
|
|
#include <Protocol/ComponentName2.h>
|
|
|
|
#include <Protocol/ComponentName.h>
|
|
|
|
#include <Protocol/PlatformDriverOverride.h>
|
|
|
|
#include <Protocol/DevicePathUtilities.h>
|
|
|
|
#include <Protocol/DevicePathFromText.h>
|
|
|
|
#include <Protocol/BusSpecificDriverOverride.h>
|
|
|
|
#include <Protocol/PlatformToDriverConfiguration.h>
|
|
|
|
#include <Protocol/DriverSupportedEfiVersion.h>
|
|
|
|
#include <Protocol/SimpleTextInEx.h>
|
|
|
|
#include <Protocol/SimplePointer.h>
|
|
|
|
#include <Protocol/SerialIo.h>
|
|
|
|
#include <Protocol/AbsolutePointer.h>
|
|
|
|
#include <Protocol/GraphicsOutput.h>
|
|
|
|
#include <Protocol/EdidDiscovered.h>
|
|
|
|
#include <Protocol/EdidActive.h>
|
|
|
|
#include <Protocol/EdidOverride.h>
|
|
|
|
#include <Protocol/LoadFile.h>
|
|
|
|
#include <Protocol/LoadFile2.h>
|
|
|
|
#include <Protocol/TapeIo.h>
|
|
|
|
#include <Protocol/DiskIo.h>
|
|
|
|
#include <Protocol/BlockIo.h>
|
|
|
|
#include <Protocol/UnicodeCollation.h>
|
|
|
|
#include <Protocol/PciRootBridgeIo.h>
|
|
|
|
#include <Protocol/PciIo.h>
|
|
|
|
#include <Protocol/ScsiPassThru.h>
|
|
|
|
#include <Protocol/ScsiPassThruExt.h>
|
|
|
|
#include <Protocol/ScsiIo.h>
|
|
|
|
#include <Protocol/IScsiInitiatorName.h>
|
|
|
|
#include <Protocol/UsbIo.h>
|
|
|
|
#include <Protocol/UsbHostController.h>
|
|
|
|
#include <Protocol/Usb2HostController.h>
|
|
|
|
#include <Protocol/DebugSupport.h>
|
|
|
|
#include <Protocol/DebugPort.h>
|
|
|
|
#include <Protocol/Decompress.h>
|
|
|
|
#include <Protocol/AcpiTable.h>
|
|
|
|
#include <Protocol/Ebc.h>
|
|
|
|
#include <Protocol/SimpleNetwork.h>
|
|
|
|
#include <Protocol/NetworkInterfaceIdentifier.h>
|
|
|
|
#include <Protocol/PxeBaseCode.h>
|
|
|
|
#include <Protocol/PxeBaseCodeCallBack.h>
|
|
|
|
#include <Protocol/Bis.h>
|
|
|
|
#include <Protocol/ManagedNetwork.h>
|
|
|
|
#include <Protocol/Arp.h>
|
|
|
|
#include <Protocol/Dhcp4.h>
|
|
|
|
#include <Protocol/Tcp4.h>
|
|
|
|
#include <Protocol/Ip4.h>
|
|
|
|
#include <Protocol/Ip4Config.h>
|
2015-07-08 04:55:09 +02:00
|
|
|
#include <Protocol/Ip4Config2.h>
|
2010-09-14 07:18:09 +02:00
|
|
|
#include <Protocol/Udp4.h>
|
|
|
|
#include <Protocol/Mtftp4.h>
|
|
|
|
#include <Protocol/AuthenticationInfo.h>
|
|
|
|
#include <Protocol/Hash.h>
|
|
|
|
#include <Protocol/HiiFont.h>
|
|
|
|
#include <Protocol/HiiString.h>
|
|
|
|
#include <Protocol/HiiImage.h>
|
|
|
|
#include <Protocol/HiiDatabase.h>
|
|
|
|
#include <Protocol/HiiConfigRouting.h>
|
|
|
|
#include <Protocol/HiiConfigAccess.h>
|
|
|
|
#include <Protocol/FormBrowser2.h>
|
|
|
|
#include <Protocol/DeviceIo.h>
|
|
|
|
#include <Protocol/UgaDraw.h>
|
|
|
|
#include <Protocol/UgaIo.h>
|
|
|
|
#include <Protocol/DriverConfiguration.h>
|
|
|
|
#include <Protocol/DriverConfiguration2.h>
|
|
|
|
#include <Protocol/DevicePathUtilities.h>
|
|
|
|
//#include <Protocol/FirmwareVolume.h>
|
|
|
|
//#include <Protocol/FirmwareVolume2.h>
|
2012-01-09 20:11:54 +01:00
|
|
|
#include <Protocol/DriverFamilyOverride.h>
|
|
|
|
#include <Protocol/Pcd.h>
|
|
|
|
#include <Protocol/TcgService.h>
|
|
|
|
#include <Protocol/HiiPackageList.h>
|
|
|
|
#include <Protocol/Ip6.h>
|
|
|
|
#include <Protocol/Ip6Config.h>
|
|
|
|
#include <Protocol/Mtftp6.h>
|
|
|
|
#include <Protocol/Dhcp6.h>
|
|
|
|
#include <Protocol/Udp6.h>
|
|
|
|
#include <Protocol/Tcp6.h>
|
|
|
|
#include <Protocol/VlanConfig.h>
|
|
|
|
#include <Protocol/Eap.h>
|
|
|
|
#include <Protocol/EapManagement.h>
|
|
|
|
#include <Protocol/Ftp4.h>
|
|
|
|
#include <Protocol/IpSecConfig.h>
|
|
|
|
#include <Protocol/DriverHealth.h>
|
|
|
|
#include <Protocol/DeferredImageLoad.h>
|
|
|
|
#include <Protocol/UserCredential.h>
|
|
|
|
#include <Protocol/UserManager.h>
|
|
|
|
#include <Protocol/AtaPassThru.h>
|
|
|
|
#include <Protocol/FirmwareManagement.h>
|
|
|
|
#include <Protocol/IpSec.h>
|
|
|
|
#include <Protocol/Kms.h>
|
|
|
|
#include <Protocol/BlockIo2.h>
|
|
|
|
#include <Protocol/StorageSecurityCommand.h>
|
|
|
|
#include <Protocol/UserCredential2.h>
|
2013-11-19 23:18:33 +01:00
|
|
|
#include <Protocol/IdeControllerInit.h>
|
2013-11-15 19:44:29 +01:00
|
|
|
#include <Protocol/DiskIo2.h>
|
2014-05-08 00:38:16 +02:00
|
|
|
#include <Protocol/AdapterInformation.h>
|
2014-08-05 20:03:49 +02:00
|
|
|
#include <Protocol/EfiShellDynamicCommand.h>
|
2015-05-14 18:50:40 +02:00
|
|
|
#include <Protocol/DiskInfo.h>
|
2010-09-14 07:18:09 +02:00
|
|
|
|
|
|
|
#include <Library/HandleParsingLib.h>
|
|
|
|
#include <Library/UefiBootServicesTableLib.h>
|
|
|
|
#include <Library/BaseLib.h>
|
|
|
|
#include <Library/BaseMemoryLib.h>
|
|
|
|
#include <Library/DebugLib.h>
|
|
|
|
#include <Library/MemoryAllocationLib.h>
|
|
|
|
#include <Library/DevicePathLib.h>
|
|
|
|
#include <Library/PcdLib.h>
|
|
|
|
#include <Library/PrintLib.h>
|
|
|
|
#include <Library/UefiLib.h>
|
|
|
|
#include <Library/HiiLib.h>
|
|
|
|
#include <Library/ShellLib.h>
|
2013-11-15 19:44:29 +01:00
|
|
|
#include <Library/SortLib.h>
|
2016-04-22 18:32:26 +02:00
|
|
|
#include <Library/ShellCommandLib.h>
|
2010-09-14 07:18:09 +02:00
|
|
|
|
2016-03-18 17:28:03 +01:00
|
|
|
#define EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION_V1 1
|
|
|
|
#define EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION_V2 2
|
|
|
|
|
|
|
|
///
|
|
|
|
/// EFI_FIRMWARE_IMAGE_DESCRIPTOR in UEFI spec < 2.4a
|
|
|
|
///
|
|
|
|
typedef struct {
|
|
|
|
///
|
|
|
|
/// A unique number identifying the firmware image within the device. The number is
|
|
|
|
/// between 1 and DescriptorCount.
|
|
|
|
///
|
|
|
|
UINT8 ImageIndex;
|
|
|
|
///
|
|
|
|
/// A unique number identifying the firmware image type.
|
|
|
|
///
|
|
|
|
EFI_GUID ImageTypeId;
|
|
|
|
///
|
|
|
|
/// A unique number identifying the firmware image.
|
|
|
|
///
|
|
|
|
UINT64 ImageId;
|
|
|
|
///
|
|
|
|
/// A pointer to a null-terminated string representing the firmware image name.
|
|
|
|
///
|
|
|
|
CHAR16 *ImageIdName;
|
|
|
|
///
|
|
|
|
/// Identifies the version of the device firmware. The format is vendor specific and new
|
|
|
|
/// version must have a greater value than an old version.
|
|
|
|
///
|
|
|
|
UINT32 Version;
|
|
|
|
///
|
|
|
|
/// A pointer to a null-terminated string representing the firmware image version name.
|
|
|
|
///
|
|
|
|
CHAR16 *VersionName;
|
|
|
|
///
|
|
|
|
/// Size of the image in bytes. If size=0, then only ImageIndex and ImageTypeId are valid.
|
|
|
|
///
|
|
|
|
UINTN Size;
|
|
|
|
///
|
|
|
|
/// Image attributes that are supported by this device. See 'Image Attribute Definitions'
|
|
|
|
/// for possible returned values of this parameter. A value of 1 indicates the attribute is
|
|
|
|
/// supported and the current setting value is indicated in AttributesSetting. A
|
|
|
|
/// value of 0 indicates the attribute is not supported and the current setting value in
|
|
|
|
/// AttributesSetting is meaningless.
|
|
|
|
///
|
|
|
|
UINT64 AttributesSupported;
|
|
|
|
///
|
|
|
|
/// Image attributes. See 'Image Attribute Definitions' for possible returned values of
|
|
|
|
/// this parameter.
|
|
|
|
///
|
|
|
|
UINT64 AttributesSetting;
|
|
|
|
///
|
|
|
|
/// Image compatibilities. See 'Image Compatibility Definitions' for possible returned
|
|
|
|
/// values of this parameter.
|
|
|
|
///
|
|
|
|
UINT64 Compatibilities;
|
|
|
|
} EFI_FIRMWARE_IMAGE_DESCRIPTOR_V1;
|
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
/// EFI_FIRMWARE_IMAGE_DESCRIPTOR in UEFI spec > 2.4a and < 2.5
|
|
|
|
///
|
|
|
|
typedef struct {
|
|
|
|
///
|
|
|
|
/// A unique number identifying the firmware image within the device. The number is
|
|
|
|
/// between 1 and DescriptorCount.
|
|
|
|
///
|
|
|
|
UINT8 ImageIndex;
|
|
|
|
///
|
|
|
|
/// A unique number identifying the firmware image type.
|
|
|
|
///
|
|
|
|
EFI_GUID ImageTypeId;
|
|
|
|
///
|
|
|
|
/// A unique number identifying the firmware image.
|
|
|
|
///
|
|
|
|
UINT64 ImageId;
|
|
|
|
///
|
|
|
|
/// A pointer to a null-terminated string representing the firmware image name.
|
|
|
|
///
|
|
|
|
CHAR16 *ImageIdName;
|
|
|
|
///
|
|
|
|
/// Identifies the version of the device firmware. The format is vendor specific and new
|
|
|
|
/// version must have a greater value than an old version.
|
|
|
|
///
|
|
|
|
UINT32 Version;
|
|
|
|
///
|
|
|
|
/// A pointer to a null-terminated string representing the firmware image version name.
|
|
|
|
///
|
|
|
|
CHAR16 *VersionName;
|
|
|
|
///
|
|
|
|
/// Size of the image in bytes. If size=0, then only ImageIndex and ImageTypeId are valid.
|
|
|
|
///
|
|
|
|
UINTN Size;
|
|
|
|
///
|
|
|
|
/// Image attributes that are supported by this device. See 'Image Attribute Definitions'
|
|
|
|
/// for possible returned values of this parameter. A value of 1 indicates the attribute is
|
|
|
|
/// supported and the current setting value is indicated in AttributesSetting. A
|
|
|
|
/// value of 0 indicates the attribute is not supported and the current setting value in
|
|
|
|
/// AttributesSetting is meaningless.
|
|
|
|
///
|
|
|
|
UINT64 AttributesSupported;
|
|
|
|
///
|
|
|
|
/// Image attributes. See 'Image Attribute Definitions' for possible returned values of
|
|
|
|
/// this parameter.
|
|
|
|
///
|
|
|
|
UINT64 AttributesSetting;
|
|
|
|
///
|
|
|
|
/// Image compatibilities. See 'Image Compatibility Definitions' for possible returned
|
|
|
|
/// values of this parameter.
|
|
|
|
///
|
|
|
|
UINT64 Compatibilities;
|
|
|
|
///
|
|
|
|
/// Describes the lowest ImageDescriptor version that the device will accept. Only
|
|
|
|
/// present in version 2 or higher.
|
|
|
|
UINT32 LowestSupportedImageVersion;
|
|
|
|
} EFI_FIRMWARE_IMAGE_DESCRIPTOR_V2;
|
|
|
|
|
2010-09-14 07:18:09 +02:00
|
|
|
typedef struct {
|
|
|
|
LIST_ENTRY Link;
|
|
|
|
EFI_HANDLE TheHandle;
|
|
|
|
UINTN TheIndex;
|
|
|
|
}HANDLE_LIST;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
HANDLE_LIST List;
|
|
|
|
UINTN NextIndex;
|
|
|
|
} HANDLE_INDEX_LIST;
|
|
|
|
|
|
|
|
typedef
|
|
|
|
CHAR16 *
|
|
|
|
(EFIAPI *DUMP_PROTOCOL_INFO)(
|
|
|
|
IN CONST EFI_HANDLE TheHandle,
|
|
|
|
IN CONST BOOLEAN Verbose
|
|
|
|
);
|
|
|
|
|
2012-01-09 20:11:54 +01:00
|
|
|
typedef struct _GUID_INFO_BLOCK{
|
2010-09-14 07:18:09 +02:00
|
|
|
EFI_STRING_ID StringId;
|
|
|
|
EFI_GUID *GuidId;
|
|
|
|
DUMP_PROTOCOL_INFO DumpInfo;
|
2012-01-09 20:11:54 +01:00
|
|
|
} GUID_INFO_BLOCK;
|
2010-09-14 07:18:09 +02:00
|
|
|
|
2011-03-25 22:06:23 +01:00
|
|
|
#endif
|
|
|
|
|