2 Main file for Reconnect shell Driver1 function.
4 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
5 (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
6 (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #include "UefiShellDriver1CommandsLib.h"
13 STATIC CONST SHELL_PARAM_ITEM ParamList
[] = {
19 Connect all the possible console devices.
27 ShellConnectFromDevPaths (L
"ConInDev");
28 ShellConnectFromDevPaths (L
"ConOutDev");
29 ShellConnectFromDevPaths (L
"ErrOutDev");
31 ShellConnectFromDevPaths (L
"ErrOut");
32 ShellConnectFromDevPaths (L
"ConIn");
33 ShellConnectFromDevPaths (L
"ConOut");
37 Function for 'reconnect' command.
39 @param[in] ImageHandle Handle to the Image (NULL if Internal).
40 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
44 ShellCommandRunReconnect (
45 IN EFI_HANDLE ImageHandle
,
46 IN EFI_SYSTEM_TABLE
*SystemTable
49 SHELL_STATUS ShellStatus
;
55 ShellStatus
= SHELL_SUCCESS
;
58 // initialize the shell lib (we must be in non-auto-init...)
60 Status
= ShellInitialize ();
61 ASSERT_EFI_ERROR (Status
);
63 Status
= CommandInit ();
64 ASSERT_EFI_ERROR (Status
);
67 // parse the command line
69 Status
= ShellCommandLineParse (ParamList
, &Package
, &ProblemParam
, TRUE
);
70 if (EFI_ERROR (Status
)) {
71 if ((Status
== EFI_VOLUME_CORRUPTED
) && (ProblemParam
!= NULL
)) {
72 ShellPrintHiiEx (-1, -1, NULL
, STRING_TOKEN (STR_GEN_PROBLEM
), gShellDriver1HiiHandle
, L
"reconnect", ProblemParam
);
73 FreePool (ProblemParam
);
74 ShellStatus
= SHELL_INVALID_PARAMETER
;
79 ShellStatus
= ShellCommandRunDisconnect (ImageHandle
, SystemTable
);
80 if (ShellStatus
== SHELL_SUCCESS
) {
81 if (ShellCommandLineGetFlag (Package
, L
"-r")) {
82 ConnectAllConsoles ();
85 ShellStatus
= ShellCommandRunConnect (ImageHandle
, SystemTable
);