TianoCore EDK2 master
Loading...
Searching...
No Matches
Dh.c File Reference

Go to the source code of this file.

Functions

BOOLEAN IsValidGuidString (IN CONST CHAR16 *String)
 
UINTN HexCharToDecimal (IN CHAR16 Char)
 
EFI_STATUS ConvertStrToGuid (IN CONST CHAR16 *String, OUT GUID *Guid)
 
EFI_STATUS GetDriverName (IN EFI_HANDLE TheHandle, IN CONST CHAR8 *Language, IN CHAR16 **NameFound)
 
BOOLEAN IsDriverProt (IN CONST EFI_GUID *Guid)
 
CHAR16 * GetProtocolInfoString (IN CONST EFI_HANDLE TheHandle, IN CONST CHAR8 *Language, IN CONST CHAR16 *Separator, IN CONST BOOLEAN Verbose, IN CONST BOOLEAN ExtraInfo)
 
EFI_STATUS GetDriverImageName (IN EFI_HANDLE TheHandle, OUT CHAR16 **Name)
 
EFI_STATUS DisplayDriverModelHandle (IN EFI_HANDLE Handle, IN BOOLEAN BestName, IN CONST CHAR8 *Language OPTIONAL)
 
VOID DoDhByHandle (IN CONST EFI_HANDLE TheHandle, IN CONST BOOLEAN Verbose, IN CONST BOOLEAN Sfo, IN CONST CHAR8 *Language, IN CONST BOOLEAN DriverInfo, IN CONST BOOLEAN Multiple)
 
SHELL_STATUS DoDhForHandleList (IN CONST EFI_HANDLE *HandleList, IN CONST BOOLEAN Verbose, IN CONST BOOLEAN Sfo, IN CONST CHAR8 *Language, IN CONST BOOLEAN DriverInfo)
 
SHELL_STATUS DoDhByProtocolGuid (IN CONST GUID *Guid, IN CONST BOOLEAN Verbose, IN CONST BOOLEAN Sfo, IN CONST CHAR8 *Language, IN CONST BOOLEAN DriverInfo)
 
SHELL_STATUS DoDhByProtocol (IN CONST CHAR16 *Protocol, IN CONST BOOLEAN Verbose, IN CONST BOOLEAN Sfo, IN CONST CHAR8 *Language, IN CONST BOOLEAN DriverInfo)
 
SHELL_STATUS DoDecodeByProtocol (IN CONST CHAR16 *Protocol, IN CONST CHAR8 *Language)
 
SHELL_STATUS EFIAPI ShellCommandRunDh (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC CONST SHELL_PARAM_ITEM ParamList []
 
STATIC CONST EFI_GUIDUefiDriverModelProtocolsGuidArray []
 
UINTN mGuidDataLen [] = { 8, 4, 4, 4, 12 }
 

Detailed Description

Main file for Dh shell Driver1 function.

(C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2017 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Dh.c.

Function Documentation

◆ ConvertStrToGuid()

EFI_STATUS ConvertStrToGuid ( IN CONST CHAR16 *  String,
OUT GUID Guid 
)

Function try to convert a string to GUID format.

Parameters
[in]StringThe string will be converted.
[out]GuidSave the result convert from string.
Return values
EFI_SUCCESSThe string was successfully converted to a GUID.
EFI_UNSUPPORTEDThe input string is not in registry format.

Definition at line 128 of file Dh.c.

◆ DisplayDriverModelHandle()

EFI_STATUS DisplayDriverModelHandle ( IN EFI_HANDLE  Handle,
IN BOOLEAN  BestName,
IN CONST CHAR8 *Language  OPTIONAL 
)

Display driver model information for a given handle.

Parameters
[in]HandleThe handle to display info on.
[in]BestNameUse the best name?
[in]LanguageThe language to output in.

Definition at line 416 of file Dh.c.

◆ DoDecodeByProtocol()

SHELL_STATUS DoDecodeByProtocol ( IN CONST CHAR16 *  Protocol,
IN CONST CHAR8 *  Language 
)

Function to display decode information by Protocol. The parameter Protocol is either a GUID or the name of protocol. If the parameter Protocol is NULL, the function will print all decode information.

Parameters
[in]ProtocolThe pointer to the name or GUID of protocol.
[in]LanguageLanguage string per UEFI specification.
Return values
SHELL_SUCCESSThe operation was successful.
SHELL_OUT_OT_RESOURCESA memory allocation failed.

Definition at line 1026 of file Dh.c.

◆ DoDhByHandle()

VOID DoDhByHandle ( IN CONST EFI_HANDLE  TheHandle,
IN CONST BOOLEAN  Verbose,
IN CONST BOOLEAN  Sfo,
IN CONST CHAR8 *  Language,
IN CONST BOOLEAN  DriverInfo,
IN CONST BOOLEAN  Multiple 
)

Display information for a handle.

Parameters
[in]TheHandleThe handles to show info on.
[in]VerboseTRUE for extra info, FALSE otherwise.
[in]SfoTRUE to output in standard format output (spec).
[in]LanguageLanguage string per UEFI specification.
[in]DriverInfoTRUE to show all info about the handle.
[in]MultipleTRUE indicates more than will be output, FALSE for a single one.

Definition at line 807 of file Dh.c.

◆ DoDhByProtocol()

SHELL_STATUS DoDhByProtocol ( IN CONST CHAR16 *  Protocol,
IN CONST BOOLEAN  Verbose,
IN CONST BOOLEAN  Sfo,
IN CONST CHAR8 *  Language,
IN CONST BOOLEAN  DriverInfo 
)

Function to determine use which method to print information. If Protocol is NULL, The function will print all information.

Parameters
[in]ProtocolThe pointer to the name or GUID of protocol or NULL.
[in]VerboseTRUE for extra info, FALSE otherwise.
[in]SfoTRUE to output in standard format output (spec).
[in]LanguageLanguage string per UEFI specification.
[in]DriverInfoTRUE to show all info about the handle.
Return values
SHELL_SUCCESSThe operation was successful.
SHELL_NOT_FOUNDThe protocol was not found.
SHELL_INVALID_PARAMETERProtocol is invalid parameter.

Definition at line 980 of file Dh.c.

◆ DoDhByProtocolGuid()

SHELL_STATUS DoDhByProtocolGuid ( IN CONST GUID Guid,
IN CONST BOOLEAN  Verbose,
IN CONST BOOLEAN  Sfo,
IN CONST CHAR8 *  Language,
IN CONST BOOLEAN  DriverInfo 
)

Display information for a GUID of protocol.

Parameters
[in]GuidThe pointer to the name of the protocol.
[in]VerboseTRUE for extra info, FALSE otherwise.
[in]SfoTRUE to output in standard format output (spec).
[in]LanguageLanguage string per UEFI specification.
[in]DriverInfoTRUE to show all info about the handle.
Return values
SHELL_SUCCESSThe operation was successful.
SHELL_NOT_FOUNDThe GUID was not found.
SHELL_INVALID_PARAMETERProtocolName was NULL or invalid.

Definition at line 933 of file Dh.c.

◆ DoDhForHandleList()

SHELL_STATUS DoDhForHandleList ( IN CONST EFI_HANDLE HandleList,
IN CONST BOOLEAN  Verbose,
IN CONST BOOLEAN  Sfo,
IN CONST CHAR8 *  Language,
IN CONST BOOLEAN  DriverInfo 
)

Display information for all handles on a list.

Parameters
[in]HandleListThe NULL-terminated list of handles.
[in]VerboseTRUE for extra info, FALSE otherwise.
[in]SfoTRUE to output in standard format output (spec).
[in]LanguageLanguage string per UEFI specification.
[in]DriverInfoTRUE to show all info about the handle.
Return values
SHELL_SUCCESSThe operation was successful.
SHELL_ABORTEDThe operation was aborted.

Definition at line 896 of file Dh.c.

◆ GetDriverImageName()

EFI_STATUS GetDriverImageName ( IN EFI_HANDLE  TheHandle,
OUT CHAR16 **  Name 
)

Gets the name of the loaded image.

Parameters
[in]TheHandleThe handle of the driver to get info on.
[out]NameThe pointer to the pointer. Valid upon a successful return.
Return values
EFI_SUCCESSThe operation was successful.

Definition at line 377 of file Dh.c.

◆ GetDriverName()

EFI_STATUS GetDriverName ( IN EFI_HANDLE  TheHandle,
IN CONST CHAR8 *  Language,
IN CHAR16 **  NameFound 
)

Get the name of a driver by it's handle.

If a name is found the memory must be callee freed.

Parameters
[in]TheHandleThe driver's handle.
[in]LanguageThe language to use.
[in]NameFoundUpon a successful return the name found.
Return values
EFI_SUCCESSThe name was found.

Definition at line 184 of file Dh.c.

◆ GetProtocolInfoString()

CHAR16 * GetProtocolInfoString ( IN CONST EFI_HANDLE  TheHandle,
IN CONST CHAR8 *  Language,
IN CONST CHAR16 *  Separator,
IN CONST BOOLEAN  Verbose,
IN CONST BOOLEAN  ExtraInfo 
)

Get information for a handle.

Parameters
[in]TheHandleThe handles to show info on.
[in]LanguageLanguage string per UEFI specification.
[in]SeparatorSeparator string between information blocks.
[in]VerboseTRUE for extra info, FALSE otherwise.
[in]ExtraInfoTRUE for extra info, FALSE otherwise.
Return values
SHELL_SUCCESSThe operation was successful.
SHELL_INVALID_PARAMETERProtocolName was NULL or invalid.

Definition at line 281 of file Dh.c.

◆ HexCharToDecimal()

UINTN HexCharToDecimal ( IN CHAR16  Char)

Convert a hex-character to decimal value.

This internal function only deal with Unicode character which maps to a valid hexadecimal ASII character, i.e. L'0' to L'9', L'a' to L'f' or L'A' to L'F'. For other Unicode character, the value returned does not make sense.

Parameters
[in]CharThe character to convert.
Return values
Thenumerical value converted.

Definition at line 105 of file Dh.c.

◆ IsDriverProt()

BOOLEAN IsDriverProt ( IN CONST EFI_GUID Guid)

Discover if a protocol guid is one of the UEFI Driver Model Protocols.

Parameters
[in]GuidThe guid to test.
Return values
TRUEThe guid does represent a driver model protocol.
FALSEThe guid does not represent a driver model protocol.

Definition at line 246 of file Dh.c.

◆ IsValidGuidString()

BOOLEAN IsValidGuidString ( IN CONST CHAR16 *  String)

Function to determine if the string can convert to a GUID. The string must be restricted as "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" format.

Parameters
[in]StringThe string to test.
Return values
TRUEThe string can convert to a GUID.
FALSEThe string can't convert to a GUID.

Definition at line 51 of file Dh.c.

◆ ShellCommandRunDh()

SHELL_STATUS EFIAPI ShellCommandRunDh ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Function for 'dh' command.

Parameters
[in]ImageHandleHandle to the Image (NULL if Internal).
[in]SystemTablePointer to the System Table (NULL if Internal).

Definition at line 1094 of file Dh.c.

Variable Documentation

◆ mGuidDataLen

UINTN mGuidDataLen[] = { 8, 4, 4, 4, 12 }

Definition at line 39 of file Dh.c.

◆ ParamList

Initial value:
= {
{ L"-p", TypeValue },
{ L"-d", TypeFlag },
{ L"-v", TypeFlag },
{ L"-verbose", TypeFlag },
{ L"-sfo", TypeFlag },
{ L"-l", TypeValue },
{ NULL, TypeMax }
}
#define NULL
Definition: Base.h:319
@ TypeValue
A flag that has some data following it with a space (IE "-a 1").
Definition: ShellLib.h:700
@ TypeFlag
A flag that is present or not present only (IE "-a").
Definition: ShellLib.h:699

Definition at line 13 of file Dh.c.

◆ UefiDriverModelProtocolsGuidArray

STATIC CONST EFI_GUID* UefiDriverModelProtocolsGuidArray[]
Initial value:
= {
&gEfiDriverBindingProtocolGuid,
&gEfiPlatformDriverOverrideProtocolGuid,
&gEfiBusSpecificDriverOverrideProtocolGuid,
&gEfiDriverDiagnosticsProtocolGuid,
&gEfiDriverDiagnostics2ProtocolGuid,
&gEfiComponentNameProtocolGuid,
&gEfiComponentName2ProtocolGuid,
&gEfiPlatformToDriverConfigurationProtocolGuid,
&gEfiDriverSupportedEfiVersionProtocolGuid,
&gEfiDriverFamilyOverrideProtocolGuid,
&gEfiDriverHealthProtocolGuid,
&gEfiLoadedImageProtocolGuid,
}

Definition at line 23 of file Dh.c.