mirror of https://github.com/acidanthera/audk.git
ShellPkg/dh: Modify the dump of UsbIo protocol
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Huajing Li <huajing.li@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
This commit is contained in:
parent
66e427feca
commit
719c23481e
|
@ -1244,6 +1244,65 @@ PciIoProtocolDumpInformation (
|
|||
return RetVal;
|
||||
}
|
||||
|
||||
/**
|
||||
Function to dump information about UsbIoProtocol.
|
||||
|
||||
This will allocate the return buffer from boot services pool.
|
||||
|
||||
@param[in] TheHandle The handle that has PciRootBridgeIo installed.
|
||||
@param[in] Verbose TRUE for additional information, FALSE otherwise.
|
||||
|
||||
@retval A poitner to a string containing the information.
|
||||
**/
|
||||
CHAR16*
|
||||
EFIAPI
|
||||
UsbIoProtocolDumpInformation (
|
||||
IN CONST EFI_HANDLE TheHandle,
|
||||
IN CONST BOOLEAN Verbose
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_USB_IO_PROTOCOL *UsbIo;
|
||||
EFI_USB_INTERFACE_DESCRIPTOR InterfaceDesc;
|
||||
CHAR16 *GetString;
|
||||
CHAR16 *RetVal;
|
||||
|
||||
if (!Verbose) {
|
||||
return (NULL);
|
||||
}
|
||||
RetVal = NULL;
|
||||
GetString = NULL;
|
||||
Status = gBS->OpenProtocol (
|
||||
TheHandle,
|
||||
&gEfiUsbIoProtocolGuid,
|
||||
(VOID**)&UsbIo,
|
||||
gImageHandle,
|
||||
NULL,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
);
|
||||
|
||||
if (EFI_ERROR(Status)) {
|
||||
return NULL;
|
||||
}
|
||||
UsbIo->UsbGetInterfaceDescriptor (UsbIo, &InterfaceDesc);
|
||||
HandleParsingHiiInit ();
|
||||
GetString = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_USBIO_DUMP_MAIN), NULL);
|
||||
if (GetString == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
RetVal = CatSPrint (
|
||||
NULL,
|
||||
GetString,
|
||||
InterfaceDesc.InterfaceNumber,
|
||||
InterfaceDesc.InterfaceClass,
|
||||
InterfaceDesc.InterfaceSubClass,
|
||||
InterfaceDesc.InterfaceProtocol
|
||||
);
|
||||
|
||||
FreePool (GetString);
|
||||
return RetVal;
|
||||
}
|
||||
|
||||
/**
|
||||
Function to dump information about EfiAdapterInformation Protocol.
|
||||
|
||||
|
@ -1964,7 +2023,7 @@ STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = {
|
|||
{STRING_TOKEN(STR_SCSI_IO), &gEfiScsiIoProtocolGuid, NULL},
|
||||
{STRING_TOKEN(STR_SCSI_PT_EXT), &gEfiExtScsiPassThruProtocolGuid, NULL},
|
||||
{STRING_TOKEN(STR_ISCSI), &gEfiIScsiInitiatorNameProtocolGuid, NULL},
|
||||
{STRING_TOKEN(STR_USB_IO), &gEfiUsbIoProtocolGuid, NULL},
|
||||
{STRING_TOKEN(STR_USB_IO), &gEfiUsbIoProtocolGuid, UsbIoProtocolDumpInformation},
|
||||
{STRING_TOKEN(STR_USB_HC), &gEfiUsbHcProtocolGuid, NULL},
|
||||
{STRING_TOKEN(STR_USB_HC2), &gEfiUsb2HcProtocolGuid, NULL},
|
||||
{STRING_TOKEN(STR_DEBUG_SUPPORT), &gEfiDebugSupportProtocolGuid, DebugSupportProtocolDumpInformation},
|
||||
|
|
|
@ -358,7 +358,10 @@
|
|||
" Device ID.....: %04x\r\n"
|
||||
" Class Code....: %02x %02x %02x\r\n"
|
||||
" Configuration Header :"
|
||||
|
||||
#string STR_USBIO_DUMP_MAIN #language en-US " Interface Number #.....: %02x\r\n"
|
||||
" Interface Class #......: %02x\r\n"
|
||||
" Interface Subclass #...: %02x\r\n"
|
||||
" Interface Protocol #...: %02x"
|
||||
|
||||
#string STR_LI_DUMP_NAME #language en-US " Name..........: %%H%s%%N\r\n"
|
||||
|
||||
|
|
Loading…
Reference in New Issue