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