From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AEFC11A1FCC for ; Thu, 22 Sep 2016 14:22:09 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 22 Sep 2016 14:21:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,379,1470726000"; d="scan'208";a="882830295" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga003.jf.intel.com with ESMTP; 22 Sep 2016 14:21:51 -0700 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 22 Sep 2016 14:21:49 -0700 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.80]) by FMSMSX119.amr.corp.intel.com ([169.254.14.243]) with mapi id 14.03.0248.002; Thu, 22 Sep 2016 14:21:49 -0700 From: "Carsey, Jaben" To: Tapan Shah , "edk2-devel@lists.01.org" CC: "Carsey, Jaben" Thread-Topic: [PATCH] ShellPkg: Add '-nc' flag support in 'disconnect' command Thread-Index: AQHSFQppdKQLVxYRG0ynUHfA7otDtqCGBI8Q Date: Thu, 22 Sep 2016 21:21:48 +0000 Message-ID: References: <1474573752-14816-1-git-send-email-tapandshah@hpe.com> In-Reply-To: <1474573752-14816-1-git-send-email-tapandshah@hpe.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZGVkNzk3YmQtZGJiZi00ZDczLThmNDQtODA2YTE2NGFmNzI1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkpnSDIwR25ab3N0dmw2Tms2MHE5Yksyak15T3ZrVFdzWERaQ1NMeVlPOWM9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.1.200.108] MIME-Version: 1.0 Subject: Re: [PATCH] ShellPkg: Add '-nc' flag support in 'disconnect' command 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: Thu, 22 Sep 2016 21:22:09 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jaben Carsey And commited. > -----Original Message----- > From: Tapan Shah [mailto:tapandshah@hpe.com] > Sent: Thursday, September 22, 2016 12:49 PM > To: edk2-devel@lists.01.org > Cc: Carsey, Jaben ; Tapan Shah > > Subject: [PATCH] ShellPkg: Add '-nc' flag support in 'disconnect' command > Importance: High >=20 > 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. >=20 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Tapan Shah > --- > .../Library/UefiShellDriver1CommandsLib/Disconnect.c | 18 > +++++++++++++++++- > .../UefiShellDriver1CommandsLib.uni | 14 +++++++++++-= -- > 2 files changed, 28 insertions(+), 4 deletions(-) >=20 > diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c > b/ShellPkg/Library/UefiShellDriver1CommandsLib/Disconnect.c > index 9afbf07..e9205a3 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. >=20 > + (C) Copyright 2016 Hewlett Packard Enterprise Development LP
> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
> Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.
> This program and the accompanying materials > @@ -17,6 +18,7 @@ >=20 > STATIC CONST SHELL_PARAM_ITEM ParamList[] =3D { > {L"-r", TypeFlag}, > + {L"-nc", TypeFlag}, > {NULL, TypeMax} > }; >=20 > @@ -132,8 +134,22 @@ ShellCommandRunDisconnect ( > ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), > gShellDriver1HiiHandle, L"disconnect"); > ShellStatus =3D SHELL_INVALID_PARAMETER; > } else { > - Status =3D DisconnectAll(); > + Status =3D 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 =3D SHELL_INVALID_PARAMETER; > } else { > if (ShellCommandLineGetCount(Package) > 4){ > ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), > gShellDriver1HiiHandle, L"disconnect"); > diff --git > a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1Command > sLib.uni > b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1Comman > dsLib.uni > index a14469a..c6b8fcd 100644 > --- > a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1Command > sLib.uni > +++ > b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1Comman > dsLib.uni > @@ -1,5 +1,6 @@ > // /** > // > +// (C) Copyright 2016 Hewlett Packard Enterprise Development LP
> // (C) Copyright 2012-2015 Hewlett-Packard Development Company, > L.P.
> // Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved. > // This program and the accompanying materials > @@ -299,11 +300,14 @@ > "Disconnects one or more drivers from the specified devices. \r\n" > ".SH SYNOPSIS\r\n" > " \r\n" > -"DISCONNECT DeviceHandle [DriverHandle [ChildHandle]] [-r] \r\n" > +"DISCONNECT DeviceHandle [DriverHandle [ChildHandle]] \r\n" > +"DISCONNECT [-r] [-nc] \r\n" > ".SH OPTIONS\r\n" > " \r\n" > "NOTES:\r\n" > -" -r - Disconnects all drivers from all devices.\r\n" > +" -r - Disconnects all drivers from all devices, then reconne= ct\r\n" > +" consoles.\r\n" > +" -nc - Do not reconnect the console devices.\r\n" > " DeviceHandle - Specifies a device handle (a hexadecimal number). If n= ot > specified, then\r\n" > " disconnect DriverHandle.\r\n" > " DriverHandle - Specifies a driver handle (a hexadecimal number).\r\n" > @@ -324,9 +328,13 @@ > ".SH EXAMPLES\r\n" > " \r\n" > "EXAMPLES:\r\n" > -" * To disconnect all drivers from all devices:\r\n" > +" * To disconnect all drivers from all devices, then reconnect console\= r\n" > +" devices:\r\n" > " Shell> disconnect -r\r\n" > " \r\n" > +" * To disconnect all drivers from all devices, including console devic= es:\r\n" > +" Shell> disconnect -r -nc\r\n" > +" \r\n" > " * To disconnect all drivers from device 0x28:\r\n" > " fs0:\> disconnect 28\r\n" > " \r\n" > -- > 1.9.5.msysgit.0