]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Bhyve/BhyveRfbDxe/ComponentName.c
OvmfPkg: Fix spelling mistake for occurred
[mirror_edk2.git] / OvmfPkg / Bhyve / BhyveRfbDxe / ComponentName.c
1 /** @file
2
3 Copyright (c) 2020, Rebecca Cran <rebecca@bsdio.com>
4 Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
5 Portions copyright (c) 2010,Apple Inc. All rights reserved.<BR>
6
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9 Module Name:
10
11 ComponentName.c
12
13 Abstract:
14
15 **/
16
17 #include "Gop.h"
18
19 //
20 // EFI Component Name Functions
21 //
22 EFI_STATUS
23 EFIAPI
24 EmuGopComponentNameGetDriverName (
25 IN EFI_COMPONENT_NAME_PROTOCOL *This,
26 IN CHAR8 *Language,
27 OUT CHAR16 **DriverName
28 );
29
30 EFI_STATUS
31 EFIAPI
32 EmuGopComponentNameGetControllerName (
33 IN EFI_COMPONENT_NAME_PROTOCOL *This,
34 IN EFI_HANDLE ControllerHandle,
35 IN EFI_HANDLE ChildHandle OPTIONAL,
36 IN CHAR8 *Language,
37 OUT CHAR16 **ControllerName
38 );
39
40 //
41 // EFI Component Name Protocol
42 //
43 EFI_COMPONENT_NAME_PROTOCOL gEmuGopComponentName = {
44 EmuGopComponentNameGetDriverName,
45 EmuGopComponentNameGetControllerName,
46 "eng"
47 };
48
49 //
50 // EFI Component Name 2 Protocol
51 //
52 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gEmuGopComponentName2 = {
53 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) EmuGopComponentNameGetDriverName,
54 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) EmuGopComponentNameGetControllerName,
55 "en"
56 };
57
58
59 EFI_UNICODE_STRING_TABLE mEmuGopDriverNameTable[] = {
60 { "eng", L"Emulator GOP Driver" },
61 { NULL , NULL }
62 };
63
64
65 /**
66 Retrieves a Unicode string that is the user readable name of the driver.
67
68 This function retrieves the user readable name of a driver in the form of a
69 Unicode string. If the driver specified by This has a user readable name in
70 the language specified by Language, then a pointer to the driver name is
71 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
72 by This does not support the language specified by Language,
73 then EFI_UNSUPPORTED is returned.
74
75 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
76 EFI_COMPONENT_NAME_PROTOCOL instance.
77
78 @param Language[in] A pointer to a Null-terminated ASCII string
79 array indicating the language. This is the
80 language of the driver name that the caller is
81 requesting, and it must match one of the
82 languages specified in SupportedLanguages. The
83 number of languages supported by a driver is up
84 to the driver writer. Language is specified
85 in RFC 4646 or ISO 639-2 language code format.
86
87 @param DriverName[out] A pointer to the Unicode string to return.
88 This Unicode string is the name of the
89 driver specified by This in the language
90 specified by Language.
91
92 @retval EFI_SUCCESS The Unicode string for the Driver specified by
93 This and the language specified by Language was
94 returned in DriverName.
95
96 @retval EFI_INVALID_PARAMETER Language is NULL.
97
98 @retval EFI_INVALID_PARAMETER DriverName is NULL.
99
100 @retval EFI_UNSUPPORTED The driver specified by This does not support
101 the language specified by Language.
102
103 **/
104 EFI_STATUS
105 EFIAPI
106 EmuGopComponentNameGetDriverName (
107 IN EFI_COMPONENT_NAME_PROTOCOL *This,
108 IN CHAR8 *Language,
109 OUT CHAR16 **DriverName
110 )
111 {
112 return LookupUnicodeString2 (
113 Language,
114 This->SupportedLanguages,
115 mEmuGopDriverNameTable,
116 DriverName,
117 (BOOLEAN)(This == &gEmuGopComponentName)
118 );
119 }
120
121
122 /**
123 Retrieves a Unicode string that is the user readable name of the controller
124 that is being managed by a driver.
125
126 This function retrieves the user readable name of the controller specified by
127 ControllerHandle and ChildHandle in the form of a Unicode string. If the
128 driver specified by This has a user readable name in the language specified by
129 Language, then a pointer to the controller name is returned in ControllerName,
130 and EFI_SUCCESS is returned. If the driver specified by This is not currently
131 managing the controller specified by ControllerHandle and ChildHandle,
132 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
133 support the language specified by Language, then EFI_UNSUPPORTED is returned.
134
135 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
136 EFI_COMPONENT_NAME_PROTOCOL instance.
137
138 @param ControllerHandle[in] The handle of a controller that the driver
139 specified by This is managing. This handle
140 specifies the controller whose name is to be
141 returned.
142
143 @param ChildHandle[in] The handle of the child controller to retrieve
144 the name of. This is an optional parameter that
145 may be NULL. It will be NULL for device
146 drivers. It will also be NULL for a bus drivers
147 that wish to retrieve the name of the bus
148 controller. It will not be NULL for a bus
149 driver that wishes to retrieve the name of a
150 child controller.
151
152 @param Language[in] A pointer to a Null-terminated ASCII string
153 array indicating the language. This is the
154 language of the driver name that the caller is
155 requesting, and it must match one of the
156 languages specified in SupportedLanguages. The
157 number of languages supported by a driver is up
158 to the driver writer. Language is specified in
159 RFC 4646 or ISO 639-2 language code format.
160
161 @param ControllerName[out] A pointer to the Unicode string to return.
162 This Unicode string is the name of the
163 controller specified by ControllerHandle and
164 ChildHandle in the language specified by
165 Language from the point of view of the driver
166 specified by This.
167
168 @retval EFI_SUCCESS The Unicode string for the user readable name in
169 the language specified by Language for the
170 driver specified by This was returned in
171 DriverName.
172
173 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
174
175 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
176 EFI_HANDLE.
177
178 @retval EFI_INVALID_PARAMETER Language is NULL.
179
180 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
181
182 @retval EFI_UNSUPPORTED The driver specified by This is not currently
183 managing the controller specified by
184 ControllerHandle and ChildHandle.
185
186 @retval EFI_UNSUPPORTED The driver specified by This does not support
187 the language specified by Language.
188
189 **/
190 EFI_STATUS
191 EFIAPI
192 EmuGopComponentNameGetControllerName (
193 IN EFI_COMPONENT_NAME_PROTOCOL *This,
194 IN EFI_HANDLE ControllerHandle,
195 IN EFI_HANDLE ChildHandle OPTIONAL,
196 IN CHAR8 *Language,
197 OUT CHAR16 **ControllerName
198 )
199 {
200 return EFI_UNSUPPORTED;
201 }