TianoCore EDK2 master
Loading...
Searching...
No Matches
Reconnect.c
Go to the documentation of this file.
1
12
13STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
14 { L"-r", TypeFlag },
15 { NULL, TypeMax }
16};
17
22VOID
24 VOID
25 )
26{
27 ShellConnectFromDevPaths (L"ConInDev");
28 ShellConnectFromDevPaths (L"ConOutDev");
29 ShellConnectFromDevPaths (L"ErrOutDev");
30
31 ShellConnectFromDevPaths (L"ErrOut");
32 ShellConnectFromDevPaths (L"ConIn");
33 ShellConnectFromDevPaths (L"ConOut");
34}
35
43EFIAPI
45 IN EFI_HANDLE ImageHandle,
46 IN EFI_SYSTEM_TABLE *SystemTable
47 )
48{
49 SHELL_STATUS ShellStatus;
50 LIST_ENTRY *Package;
51 CHAR16 *ProblemParam;
52 EFI_STATUS Status;
53
54 gInReconnect = TRUE;
55 ShellStatus = SHELL_SUCCESS;
56
57 //
58 // initialize the shell lib (we must be in non-auto-init...)
59 //
60 Status = ShellInitialize ();
61 ASSERT_EFI_ERROR (Status);
62
63 Status = CommandInit ();
64 ASSERT_EFI_ERROR (Status);
65
66 //
67 // parse the command line
68 //
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;
75 } else {
76 ASSERT (FALSE);
77 }
78 } else {
79 ShellStatus = ShellCommandRunDisconnect (ImageHandle, SystemTable);
80 if (ShellStatus == SHELL_SUCCESS) {
81 if (ShellCommandLineGetFlag (Package, L"-r")) {
83 }
84
85 ShellStatus = ShellCommandRunConnect (ImageHandle, SystemTable);
86 }
87 }
88
89 gInReconnect = FALSE;
90
91 return (ShellStatus);
92}
EFI_STATUS ShellConnectFromDevPaths(IN CONST CHAR16 *Key)
Definition: Connect.c:193
SHELL_STATUS EFIAPI ShellCommandRunConnect(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition: Connect.c:409
SHELL_STATUS EFIAPI ShellCommandRunDisconnect(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition: Disconnect.c:82
VOID EFIAPI FreePool(IN VOID *Buffer)
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define STATIC
Definition: Base.h:264
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
SHELL_STATUS
Definition: Shell.h:21
@ SHELL_SUCCESS
Definition: Shell.h:25
@ SHELL_INVALID_PARAMETER
Definition: Shell.h:35
SHELL_STATUS EFIAPI ShellCommandRunReconnect(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition: Reconnect.c:44
VOID ConnectAllConsoles(VOID)
Definition: Reconnect.c:23
EFI_STATUS EFIAPI CommandInit(VOID)
#define ShellCommandLineParse(CheckList, CheckPackage, ProblemParam, AutoPageBreak)
Make it easy to upgrade from older versions of the shell library.
Definition: ShellLib.h:755
EFI_STATUS EFIAPI ShellPrintHiiEx(IN INT32 Col OPTIONAL, IN INT32 Row OPTIONAL, IN CONST CHAR8 *Language OPTIONAL, IN CONST EFI_STRING_ID HiiFormatStringId, IN CONST EFI_HII_HANDLE HiiFormatHandle,...)
BOOLEAN EFIAPI ShellCommandLineGetFlag(IN CONST LIST_ENTRY *CONST CheckPackage, IN CONST CHAR16 *CONST KeyString)
@ TypeFlag
A flag that is present or not present only (IE "-a").
Definition: ShellLib.h:699
EFI_STATUS EFIAPI ShellInitialize(VOID)
Definition: UefiShellLib.c:532
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define STRING_TOKEN(t)