diff options
author | Ruiyu Ni <ruiyu.ni@intel.com> | 2017-01-10 13:17:35 +0800 |
---|---|---|
committer | Ruiyu Ni <ruiyu.ni@intel.com> | 2017-01-11 17:25:26 +0800 |
commit | 802c39b03bdfddfea7c70545a9479d4418d5deaa (patch) | |
tree | dc68b5c11565989ae5363ea40e19bee5f576a8d3 /MdeModulePkg/Universal | |
parent | 390b95a49c14c6c0d0b8caacfa74d8132b3763de (diff) | |
download | edk2-platforms-802c39b03bdfddfea7c70545a9479d4418d5deaa.tar.xz |
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>
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r-- | MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c | 41 |
1 files changed, 3 insertions, 38 deletions
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c index 3b2e34fba0..129d7b3e60 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c @@ -1577,46 +1577,11 @@ SetTerminalDevicePath ( {
VENDOR_DEVICE_PATH Node;
- *TerminalDevicePath = NULL;
+ ASSERT (TerminalType < ARRAY_SIZE (mTerminalType));
Node.Header.Type = MESSAGING_DEVICE_PATH;
Node.Header.SubType = MSG_VENDOR_DP;
-
- //
- // 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)
- );
+ SetDevicePathNodeLength (&Node, sizeof (VENDOR_DEVICE_PATH));
+ CopyGuid (&Node.Guid, mTerminalType[TerminalType]);
//
// Append the terminal node onto parent device path
|