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");
38 Function for 'reconnect' command.
40 @param[in] ImageHandle Handle to the Image (NULL if Internal).
41 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
45 ShellCommandRunReconnect (
46 IN EFI_HANDLE ImageHandle
,
47 IN EFI_SYSTEM_TABLE
*SystemTable
50 SHELL_STATUS ShellStatus
;
56 ShellStatus
= SHELL_SUCCESS
;
59 // initialize the shell lib (we must be in non-auto-init...)
61 Status
= ShellInitialize();
62 ASSERT_EFI_ERROR(Status
);
64 Status
= CommandInit();
65 ASSERT_EFI_ERROR(Status
);
68 // parse the command line
70 Status
= ShellCommandLineParse (ParamList
, &Package
, &ProblemParam
, TRUE
);
71 if (EFI_ERROR(Status
)) {
72 if (Status
== EFI_VOLUME_CORRUPTED
&& ProblemParam
!= NULL
) {
73 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_PROBLEM
), gShellDriver1HiiHandle
, L
"reconnect", ProblemParam
);
74 FreePool(ProblemParam
);
75 ShellStatus
= SHELL_INVALID_PARAMETER
;
80 ShellStatus
= ShellCommandRunDisconnect(ImageHandle
, SystemTable
);
81 if (ShellStatus
== SHELL_SUCCESS
) {
82 if (ShellCommandLineGetFlag(Package
, L
"-r")) {
85 ShellStatus
= ShellCommandRunConnect(ImageHandle
, SystemTable
);