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 This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #include "UefiShellDriver1CommandsLib.h"
19 STATIC CONST SHELL_PARAM_ITEM ParamList
[] = {
25 Connect all the possible console devices.
33 ShellConnectFromDevPaths(L
"ConInDev");
34 ShellConnectFromDevPaths(L
"ConOutDev");
35 ShellConnectFromDevPaths(L
"ErrOutDev");
37 ShellConnectFromDevPaths(L
"ErrOut");
38 ShellConnectFromDevPaths(L
"ConIn");
39 ShellConnectFromDevPaths(L
"ConOut");
44 Function for 'reconnect' command.
46 @param[in] ImageHandle Handle to the Image (NULL if Internal).
47 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
51 ShellCommandRunReconnect (
52 IN EFI_HANDLE ImageHandle
,
53 IN EFI_SYSTEM_TABLE
*SystemTable
56 SHELL_STATUS ShellStatus
;
62 ShellStatus
= SHELL_SUCCESS
;
65 // initialize the shell lib (we must be in non-auto-init...)
67 Status
= ShellInitialize();
68 ASSERT_EFI_ERROR(Status
);
70 Status
= CommandInit();
71 ASSERT_EFI_ERROR(Status
);
74 // parse the command line
76 Status
= ShellCommandLineParse (ParamList
, &Package
, &ProblemParam
, TRUE
);
77 if (EFI_ERROR(Status
)) {
78 if (Status
== EFI_VOLUME_CORRUPTED
&& ProblemParam
!= NULL
) {
79 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_PROBLEM
), gShellDriver1HiiHandle
, L
"reconnect", ProblemParam
);
80 FreePool(ProblemParam
);
81 ShellStatus
= SHELL_INVALID_PARAMETER
;
86 ShellStatus
= ShellCommandRunDisconnect(ImageHandle
, SystemTable
);
87 if (ShellStatus
== SHELL_SUCCESS
) {
88 if (ShellCommandLineGetFlag(Package
, L
"-r")) {
91 ShellStatus
= ShellCommandRunConnect(ImageHandle
, SystemTable
);