2 Main file for Reconnect shell Driver1 function.
4 Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #include "UefiShellDriver1CommandsLib.h"
17 STATIC CONST SHELL_PARAM_ITEM ParamList
[] = {
23 Connect all the possible console devices.
31 ShellConnectFromDevPaths(L
"ConInDev");
32 ShellConnectFromDevPaths(L
"ConOutDev");
33 ShellConnectFromDevPaths(L
"ErrOutDev");
35 ShellConnectFromDevPaths(L
"ErrOut");
36 ShellConnectFromDevPaths(L
"ConIn");
37 ShellConnectFromDevPaths(L
"ConOut");
42 Function for 'reconnect' command.
44 @param[in] ImageHandle Handle to the Image (NULL if Internal).
45 @param[in] SystemTable Pointer to the System Table (NULL if Internal).
49 ShellCommandRunReconnect (
50 IN EFI_HANDLE ImageHandle
,
51 IN EFI_SYSTEM_TABLE
*SystemTable
54 SHELL_STATUS ShellStatus
;
60 ShellStatus
= SHELL_SUCCESS
;
63 // initialize the shell lib (we must be in non-auto-init...)
65 Status
= ShellInitialize();
66 ASSERT_EFI_ERROR(Status
);
68 Status
= CommandInit();
69 ASSERT_EFI_ERROR(Status
);
72 // parse the command line
74 Status
= ShellCommandLineParse (ParamList
, &Package
, &ProblemParam
, TRUE
);
75 if (EFI_ERROR(Status
)) {
76 if (Status
== EFI_VOLUME_CORRUPTED
&& ProblemParam
!= NULL
) {
77 ShellPrintHiiEx(-1, -1, NULL
, STRING_TOKEN (STR_GEN_PROBLEM
), gShellDriver1HiiHandle
, ProblemParam
);
78 FreePool(ProblemParam
);
79 ShellStatus
= SHELL_INVALID_PARAMETER
;
84 ShellStatus
= ShellCommandRunDisconnect(ImageHandle
, SystemTable
);
85 if (ShellStatus
== SHELL_SUCCESS
) {
86 if (ShellCommandLineGetFlag(Package
, L
"-r")) {
89 ShellStatus
= ShellCommandRunConnect(ImageHandle
, SystemTable
);