From 68227ac33e998b1a2859d68a5a9b0fa510c10708 Mon Sep 17 00:00:00 2001 From: Tapan Shah Date: Tue, 14 Jul 2015 17:54:12 +0000 Subject: [PATCH] ShellPkg: decode serial console attribute set failure status when used thru sermode command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Serial console driver may not support all databits / stopbits attribute values. But ‘sermode’ command only displays a general error indicating operation failure. Instead it should decode error status and report more accurate error message. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah Reviewed-by: Jaben Carsey git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17978 6f19259b-4bc3-4df7-8a09-765794883524 --- .../UefiShellDebug1CommandsLib/SerMode.c | 12 ++++++++++-- .../UefiShellDebug1CommandsLib.uni | Bin 140130 -> 140668 bytes 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c index 448e5cc97b..d885677065 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c @@ -337,8 +337,16 @@ ShellCommandRunSerMode ( StopBits ); if (EFI_ERROR (Status)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_FAIL), gShellDebug1HiiHandle, L"sermode", ConvertHandleToHandleIndex(Handles[Index])); - ShellStatus = SHELL_ACCESS_DENIED; + if (Status == EFI_INVALID_PARAMETER) { + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_UNSUPPORTED), gShellDebug1HiiHandle, L"sermode", ConvertHandleToHandleIndex(Handles[Index])); + ShellStatus = SHELL_UNSUPPORTED; + } else if (Status == EFI_DEVICE_ERROR) { + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_DEV_ERROR), gShellDebug1HiiHandle, L"sermode", ConvertHandleToHandleIndex(Handles[Index])); + ShellStatus = SHELL_ACCESS_DENIED; + } else { + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_FAIL), gShellDebug1HiiHandle, L"sermode", ConvertHandleToHandleIndex(Handles[Index])); + ShellStatus = SHELL_ACCESS_DENIED; + } } else { ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_HANDLE), gShellDebug1HiiHandle, ConvertHandleToHandleIndex(Handles[Index])); } diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni index 91802818fff1e1cd42302942bc28b0427a25e8a4..167cacc70dc5fe582a8c3b4d47ed042f7994879c 100644 GIT binary patch delta 145 zcmaEKjN{KKjtzAwlMOf}CM(3TOm;{T5e;SVV+dvlWe5O5e}*825C&HUm&t{kri}j6 z0~wjbr%%|;$j6$;kjhX#y>K<7=yaD5MuF+C3K#_@&q`98d??vsvQH9+pbJo27(+ae t3<5%+L6bj9+fT3A!zeR(4p7;xM84_E_ArJ`UQo%=yeMV+q7=ph`v6moE}Z}X delta 26 icmex!isR8SjtzAwlM8}nCOe$xXx@{yeNP(WfqekBFbygI