summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c
diff options
context:
space:
mode:
authorTapan Shah <tapandshah@hpe.com>2016-09-22 12:49:12 -0700
committerJaben Carsey <jaben.carsey@intel.com>2016-09-22 14:17:01 -0700
commit339a2b935e7dd40525e8d71f1b80b8ba1be83215 (patch)
treebf2e73d531f1a1672303d66afc65550f3ae9d612 /ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c
parent7f1bf51bdbcaf9dd46f77cf4bd5e69a294dd995e (diff)
downloadedk2-platforms-339a2b935e7dd40525e8d71f1b80b8ba1be83215.tar.xz
ShellPkg: Add '-nc' flag support in 'disconnect' command
As per ECR 1416, latest UEFI Shell 2.2 specification: Define a behavior where 'disconnect -r' will disconnect drivers from all devices but it will reconnect all consoles. If -nc flag is used (e.g. 'disconnect -r -nc') then disconnect drivers from all devices and don't reconnect consoles. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Diffstat (limited to 'ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c')
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c
index 9afbf07329..adca80ed61 100644
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c
+++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c
@@ -1,6 +1,7 @@
/** @file
Main file for Disconnect shell Driver1 function.
+ (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
@@ -17,6 +18,7 @@
STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
{L"-r", TypeFlag},
+ {L"-nc", TypeFlag},
{NULL, TypeMax}
};
@@ -132,8 +134,22 @@ ShellCommandRunDisconnect (
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDriver1HiiHandle, L"disconnect");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- Status = DisconnectAll();
+ Status = DisconnectAll ();
+ //
+ // Reconnect all consoles if -nc is not provided
+ //
+ if (!ShellCommandLineGetFlag (Package, L"-nc")){
+ ShellConnectFromDevPaths (L"ConInDev");
+ ShellConnectFromDevPaths (L"ConOutDev");
+ ShellConnectFromDevPaths (L"ErrOutDev");
+ ShellConnectFromDevPaths (L"ErrOut");
+ ShellConnectFromDevPaths (L"ConIn");
+ ShellConnectFromDevPaths (L"ConOut");
+ }
}
+ } else if (ShellCommandLineGetFlag (Package, L"-nc")) {
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDriver1HiiHandle, L"disconnect");
+ ShellStatus = SHELL_INVALID_PARAMETER;
} else {
if (ShellCommandLineGetCount(Package) > 4){
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"disconnect");