mirror of https://github.com/acidanthera/audk.git
MdeModulePkg/TerminalDxe: Refine SetTerminalDevicePath
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
This commit is contained in:
parent
390b95a49c
commit
802c39b03b
|
@ -1577,46 +1577,11 @@ SetTerminalDevicePath (
|
||||||
{
|
{
|
||||||
VENDOR_DEVICE_PATH Node;
|
VENDOR_DEVICE_PATH Node;
|
||||||
|
|
||||||
*TerminalDevicePath = NULL;
|
ASSERT (TerminalType < ARRAY_SIZE (mTerminalType));
|
||||||
Node.Header.Type = MESSAGING_DEVICE_PATH;
|
Node.Header.Type = MESSAGING_DEVICE_PATH;
|
||||||
Node.Header.SubType = MSG_VENDOR_DP;
|
Node.Header.SubType = MSG_VENDOR_DP;
|
||||||
|
SetDevicePathNodeLength (&Node, sizeof (VENDOR_DEVICE_PATH));
|
||||||
//
|
CopyGuid (&Node.Guid, mTerminalType[TerminalType]);
|
||||||
// Generate terminal device path node according to terminal type.
|
|
||||||
//
|
|
||||||
switch (TerminalType) {
|
|
||||||
|
|
||||||
case TerminalTypePcAnsi:
|
|
||||||
CopyGuid (&Node.Guid, &gEfiPcAnsiGuid);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case TerminalTypeVt100:
|
|
||||||
CopyGuid (&Node.Guid, &gEfiVT100Guid);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case TerminalTypeVt100Plus:
|
|
||||||
CopyGuid (&Node.Guid, &gEfiVT100PlusGuid);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case TerminalTypeVtUtf8:
|
|
||||||
CopyGuid (&Node.Guid, &gEfiVTUTF8Guid);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case TerminalTypeTtyTerm:
|
|
||||||
CopyGuid (&Node.Guid, &gEfiTtyTermGuid);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return EFI_UNSUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Get VENDOR_DEVCIE_PATH size and put into Node.Header
|
|
||||||
//
|
|
||||||
SetDevicePathNodeLength (
|
|
||||||
&Node.Header,
|
|
||||||
sizeof (VENDOR_DEVICE_PATH)
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Append the terminal node onto parent device path
|
// Append the terminal node onto parent device path
|
||||||
|
|
Loading…
Reference in New Issue