2 Produce "dp" shell dynamic command.
4 Copyright (c) 2017, Intel Corporation. All rights reserved. <BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include <Protocol/ShellDynamicCommand.h>
13 This is the shell command handler function pointer callback type. This
14 function handles the command when it is invoked in the shell.
16 @param[in] This The instance of the EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
17 @param[in] SystemTable The pointer to the system table.
18 @param[in] ShellParameters The parameters associated with the command.
19 @param[in] Shell The instance of the shell protocol used in the context
20 of processing this command.
22 @return EFI_SUCCESS the operation was sucessful
23 @return other the operation failed.
28 IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL
*This
,
29 IN EFI_SYSTEM_TABLE
*SystemTable
,
30 IN EFI_SHELL_PARAMETERS_PROTOCOL
*ShellParameters
,
31 IN EFI_SHELL_PROTOCOL
*Shell
34 gEfiShellParametersProtocol
= ShellParameters
;
35 gEfiShellProtocol
= Shell
;
36 return RunDp (gImageHandle
, SystemTable
);
40 This is the command help handler function pointer callback type. This
41 function is responsible for displaying help information for the associated
44 @param[in] This The instance of the EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL.
45 @param[in] Language The pointer to the language string to use.
47 @return string Pool allocated help string, must be freed by caller
52 IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL
*This
,
53 IN CONST CHAR8
*Language
56 return HiiGetString (mDpHiiHandle
, STRING_TOKEN (STR_GET_HELP_DP
), Language
);
59 EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL mDpDynamicCommand
= {
66 Entry point of Tftp Dynamic Command.
68 Produce the DynamicCommand protocol to handle "tftp" command.
70 @param ImageHandle The image handle of the process.
71 @param SystemTable The EFI System Table pointer.
73 @retval EFI_SUCCESS Tftp command is executed sucessfully.
74 @retval EFI_ABORTED HII package was failed to initialize.
75 @retval others Other errors when executing tftp command.
80 IN EFI_HANDLE ImageHandle
,
81 IN EFI_SYSTEM_TABLE
*SystemTable
85 mDpHiiHandle
= InitializeHiiPackage (ImageHandle
);
86 if (mDpHiiHandle
== NULL
) {
90 Status
= gBS
->InstallProtocolInterface (
92 &gEfiShellDynamicCommandProtocolGuid
,
96 ASSERT_EFI_ERROR (Status
);
101 Tftp driver unload handler.
103 @param ImageHandle The image handle of the process.
105 @retval EFI_SUCCESS The image is unloaded.
106 @retval Others Failed to unload the image.
111 IN EFI_HANDLE ImageHandle
115 Status
= gBS
->UninstallProtocolInterface (
117 &gEfiShellDynamicCommandProtocolGuid
,
120 if (EFI_ERROR (Status
)) {
123 HiiRemovePackages (mDpHiiHandle
);