From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3FA8881B56 for ; Tue, 10 Jan 2017 00:39:12 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP; 10 Jan 2017 00:39:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,343,1477983600"; d="scan'208";a="211599013" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.25]) by fmsmga004.fm.intel.com with ESMTP; 10 Jan 2017 00:39:11 -0800 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: Star Zeng , Feng Tian Date: Tue, 10 Jan 2017 16:39:01 +0800 Message-Id: <20170110083904.34104-6-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.9.0.windows.1 In-Reply-To: <20170110083904.34104-1-ruiyu.ni@intel.com> References: <20170110083904.34104-1-ruiyu.ni@intel.com> Subject: [PATCH 5/8] MdeModulePkg/TerminalDxe: Refine SetTerminalDevicePath X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 08:39:12 -0000 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Cc: Star Zeng Cc: Feng Tian --- .../Universal/Console/TerminalDxe/Terminal.c | 41 ++-------------------- 1 file changed, 3 insertions(+), 38 deletions(-) diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c index 4b0c00d..7197f59 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 -- 2.9.0.windows.1