TianoCore EDK2 master
Loading...
Searching...
No Matches
TftpDynamicCommand.c
Go to the documentation of this file.
1
10#include "Tftp.h"
12
27EFIAPI
30 IN EFI_SYSTEM_TABLE *SystemTable,
31 IN EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters,
33 )
34{
35 gEfiShellParametersProtocol = ShellParameters;
36 gEfiShellProtocol = Shell;
37 return RunTftp (gImageHandle, SystemTable);
38}
39
50CHAR16 *
51EFIAPI
54 IN CONST CHAR8 *Language
55 )
56{
57 return HiiGetString (mTftpHiiHandle, STRING_TOKEN (STR_GET_HELP_TFTP), Language);
58}
59
60EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL mTftpDynamicCommand = {
61 L"tftp",
64};
65
79EFIAPI
81 IN EFI_HANDLE ImageHandle,
82 IN EFI_SYSTEM_TABLE *SystemTable
83 )
84{
85 EFI_STATUS Status;
86
87 mTftpHiiHandle = InitializeHiiPackage (ImageHandle);
88 if (mTftpHiiHandle == NULL) {
89 return EFI_ABORTED;
90 }
91
92 Status = gBS->InstallProtocolInterface (
93 &ImageHandle,
94 &gEfiShellDynamicCommandProtocolGuid,
96 &mTftpDynamicCommand
97 );
98 ASSERT_EFI_ERROR (Status);
99 return Status;
100}
101
111EFIAPI
113 IN EFI_HANDLE ImageHandle
114 )
115{
116 EFI_STATUS Status;
117
118 Status = gBS->UninstallProtocolInterface (
119 ImageHandle,
120 &gEfiShellDynamicCommandProtocolGuid,
121 &mTftpDynamicCommand
122 );
123 if (EFI_ERROR (Status)) {
124 return Status;
125 }
126
127 HiiRemovePackages (mTftpHiiHandle);
128 return EFI_SUCCESS;
129}
EFI_STRING EFIAPI HiiGetString(IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId, IN CONST CHAR8 *Language OPTIONAL)
Definition: HiiString.c:211
VOID EFIAPI HiiRemovePackages(IN EFI_HII_HANDLE HiiHandle)
Definition: HiiLib.c:253
STATIC EFI_HII_HANDLE InitializeHiiPackage(EFI_HANDLE ImageHandle)
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
SHELL_STATUS
Definition: Shell.h:21
SHELL_STATUS RunTftp(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition: Tftp.c:277
EFI_STATUS EFIAPI TftpCommandInitialize(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
CHAR16 *EFIAPI TftpCommandGetHelp(IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This, IN CONST CHAR8 *Language)
SHELL_STATUS EFIAPI TftpCommandHandler(IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This, IN EFI_SYSTEM_TABLE *SystemTable, IN EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters, IN EFI_SHELL_PROTOCOL *Shell)
EFI_STATUS EFIAPI TftpUnload(IN EFI_HANDLE ImageHandle)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_HANDLE gImageHandle
EFI_BOOT_SERVICES * gBS
#define STRING_TOKEN(t)
@ EFI_NATIVE_INTERFACE
Definition: UefiSpec.h:1193
EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL protocol structure.