]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Console/ConPlatformDxe/ComponentName.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdeModulePkg / Universal / Console / ConPlatformDxe / ComponentName.c
1 /** @file
2 UEFI Component Name(2) protocol implementation for ConPlatform driver.
3
4 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #include "ConPlatform.h"
10
11 //
12 // EFI Component Name Protocol
13 //
14 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gConPlatformComponentName = {
15 ConPlatformComponentNameGetDriverName,
16 ConPlatformComponentNameGetControllerName,
17 "eng"
18 };
19
20 //
21 // EFI Component Name 2 Protocol
22 //
23 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gConPlatformComponentName2 = {
24 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME)ConPlatformComponentNameGetDriverName,
25 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)ConPlatformComponentNameGetControllerName,
26 "en"
27 };
28
29 GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mConPlatformDriverNameTable[] = {
30 {
31 "eng;en",
32 L"Platform Console Management Driver"
33 },
34 {
35 NULL,
36 NULL
37 }
38 };
39
40 /**
41 Retrieves a Unicode string that is the user readable name of the driver.
42
43 This function retrieves the user readable name of a driver in the form of a
44 Unicode string. If the driver specified by This has a user readable name in
45 the language specified by Language, then a pointer to the driver name is
46 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
47 by This does not support the language specified by Language,
48 then EFI_UNSUPPORTED is returned.
49
50 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
51 EFI_COMPONENT_NAME_PROTOCOL instance.
52 @param Language[in] A pointer to a Null-terminated ASCII string
53 array indicating the language. This is the
54 language of the driver name that the caller is
55 requesting, and it must match one of the
56 languages specified in SupportedLanguages. The
57 number of languages supported by a driver is up
58 to the driver writer. Language is specified
59 in RFC 4646 or ISO 639-2 language code format.
60 @param DriverName[out] A pointer to the Unicode string to return.
61 This Unicode string is the name of the
62 driver specified by This in the language
63 specified by Language.
64
65 @retval EFI_SUCCESS The Unicode string for the Driver specified by
66 This and the language specified by Language was
67 returned in DriverName.
68 @retval EFI_INVALID_PARAMETER Language is NULL.
69 @retval EFI_INVALID_PARAMETER DriverName is NULL.
70 @retval EFI_UNSUPPORTED The driver specified by This does not support
71 the language specified by Language.
72
73 **/
74 EFI_STATUS
75 EFIAPI
76 ConPlatformComponentNameGetDriverName (
77 IN EFI_COMPONENT_NAME_PROTOCOL *This,
78 IN CHAR8 *Language,
79 OUT CHAR16 **DriverName
80 )
81 {
82 return LookupUnicodeString2 (
83 Language,
84 This->SupportedLanguages,
85 mConPlatformDriverNameTable,
86 DriverName,
87 (BOOLEAN)(This == &gConPlatformComponentName)
88 );
89 }
90
91 /**
92 Retrieves a Unicode string that is the user readable name of the controller
93 that is being managed by a driver.
94
95 This function retrieves the user readable name of the controller specified by
96 ControllerHandle and ChildHandle in the form of a Unicode string. If the
97 driver specified by This has a user readable name in the language specified by
98 Language, then a pointer to the controller name is returned in ControllerName,
99 and EFI_SUCCESS is returned. If the driver specified by This is not currently
100 managing the controller specified by ControllerHandle and ChildHandle,
101 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
102 support the language specified by Language, then EFI_UNSUPPORTED is returned.
103
104 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
105 EFI_COMPONENT_NAME_PROTOCOL instance.
106 @param ControllerHandle[in] The handle of a controller that the driver
107 specified by This is managing. This handle
108 specifies the controller whose name is to be
109 returned.
110 @param ChildHandle[in] The handle of the child controller to retrieve
111 the name of. This is an optional parameter that
112 may be NULL. It will be NULL for device
113 drivers. It will also be NULL for a bus drivers
114 that wish to retrieve the name of the bus
115 controller. It will not be NULL for a bus
116 driver that wishes to retrieve the name of a
117 child controller.
118 @param Language[in] A pointer to a Null-terminated ASCII string
119 array indicating the language. This is the
120 language of the driver name that the caller is
121 requesting, and it must match one of the
122 languages specified in SupportedLanguages. The
123 number of languages supported by a driver is up
124 to the driver writer. Language is specified in
125 RFC 4646 or ISO 639-2 language code format.
126 @param ControllerName[out] A pointer to the Unicode string to return.
127 This Unicode string is the name of the
128 controller specified by ControllerHandle and
129 ChildHandle in the language specified by
130 Language from the point of view of the driver
131 specified by This.
132
133 @retval EFI_SUCCESS The Unicode string for the user readable name in
134 the language specified by Language for the
135 driver specified by This was returned in
136 DriverName.
137 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
138 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
139 EFI_HANDLE.
140 @retval EFI_INVALID_PARAMETER Language is NULL.
141 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
142 @retval EFI_UNSUPPORTED The driver specified by This is not currently
143 managing the controller specified by
144 ControllerHandle and ChildHandle.
145 @retval EFI_UNSUPPORTED The driver specified by This does not support
146 the language specified by Language.
147
148 **/
149 EFI_STATUS
150 EFIAPI
151 ConPlatformComponentNameGetControllerName (
152 IN EFI_COMPONENT_NAME_PROTOCOL *This,
153 IN EFI_HANDLE ControllerHandle,
154 IN EFI_HANDLE ChildHandle OPTIONAL,
155 IN CHAR8 *Language,
156 OUT CHAR16 **ControllerName
157 )
158 {
159 return EFI_UNSUPPORTED;
160 }