]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Bus/Usb/UsbBusDxe/ComponentName.c
Comment out unused ECP library which no any module referenced,
[mirror_edk2.git] / MdeModulePkg / Bus / Usb / UsbBusDxe / ComponentName.c
CommitLineData
e237e7ae 1/** @file\r
2\r
3Copyright (c) 2004 - 2007, Intel Corporation\r
4All rights reserved. This program and the accompanying materials\r
5are licensed and made available under the terms and conditions of the BSD License\r
6which accompanies this distribution. The full text of the license may be found at\r
7http://opensource.org/licenses/bsd-license.php\r
8\r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11\r
12Module Name:\r
13\r
14 ComponentName.c\r
15\r
16Abstract:\r
17\r
18\r
19**/\r
20\r
ed7748fe 21\r
e237e7ae 22#include <PiDxe.h>\r
23\r
ed7748fe 24\r
e237e7ae 25#include <Library/UefiLib.h>\r
26\r
27\r
28//\r
29// EFI Component Name Functions\r
30//\r
62b9bb55 31/**\r
32 Retrieves a Unicode string that is the user readable name of the driver.\r
33\r
34 This function retrieves the user readable name of a driver in the form of a\r
35 Unicode string. If the driver specified by This has a user readable name in\r
36 the language specified by Language, then a pointer to the driver name is\r
37 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
38 by This does not support the language specified by Language,\r
39 then EFI_UNSUPPORTED is returned.\r
40\r
41 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
42 EFI_COMPONENT_NAME_PROTOCOL instance.\r
43\r
44 @param Language[in] A pointer to a Null-terminated ASCII string\r
45 array indicating the language. This is the\r
46 language of the driver name that the caller is\r
47 requesting, and it must match one of the\r
48 languages specified in SupportedLanguages. The\r
49 number of languages supported by a driver is up\r
50 to the driver writer. Language is specified\r
51 in RFC 3066 or ISO 639-2 language code format.\r
52\r
53 @param DriverName[out] A pointer to the Unicode string to return.\r
54 This Unicode string is the name of the\r
55 driver specified by This in the language\r
56 specified by Language.\r
57\r
58 @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
59 This and the language specified by Language was\r
60 returned in DriverName.\r
61\r
62 @retval EFI_INVALID_PARAMETER Language is NULL.\r
63\r
64 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
65\r
66 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
67 the language specified by Language.\r
68\r
69**/\r
e237e7ae 70EFI_STATUS\r
71EFIAPI\r
72UsbBusComponentNameGetDriverName (\r
62b9bb55 73 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
74 IN CHAR8 *Language,\r
75 OUT CHAR16 **DriverName\r
e237e7ae 76 );\r
77\r
62b9bb55 78\r
79/**\r
80 Retrieves a Unicode string that is the user readable name of the controller\r
81 that is being managed by a driver.\r
82\r
83 This function retrieves the user readable name of the controller specified by\r
84 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
85 driver specified by This has a user readable name in the language specified by\r
86 Language, then a pointer to the controller name is returned in ControllerName,\r
87 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
88 managing the controller specified by ControllerHandle and ChildHandle,\r
89 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
90 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
91\r
92 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
93 EFI_COMPONENT_NAME_PROTOCOL instance.\r
94\r
95 @param ControllerHandle[in] The handle of a controller that the driver\r
96 specified by This is managing. This handle\r
97 specifies the controller whose name is to be\r
98 returned.\r
99\r
100 @param ChildHandle[in] The handle of the child controller to retrieve\r
101 the name of. This is an optional parameter that\r
102 may be NULL. It will be NULL for device\r
103 drivers. It will also be NULL for a bus drivers\r
104 that wish to retrieve the name of the bus\r
105 controller. It will not be NULL for a bus\r
106 driver that wishes to retrieve the name of a\r
107 child controller.\r
108\r
109 @param Language[in] A pointer to a Null-terminated ASCII string\r
110 array indicating the language. This is the\r
111 language of the driver name that the caller is\r
112 requesting, and it must match one of the\r
113 languages specified in SupportedLanguages. The\r
114 number of languages supported by a driver is up\r
115 to the driver writer. Language is specified in\r
116 RFC 3066 or ISO 639-2 language code format.\r
117\r
118 @param ControllerName[out] A pointer to the Unicode string to return.\r
119 This Unicode string is the name of the\r
120 controller specified by ControllerHandle and\r
121 ChildHandle in the language specified by\r
122 Language from the point of view of the driver\r
123 specified by This.\r
124\r
125 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
126 the language specified by Language for the\r
127 driver specified by This was returned in\r
128 DriverName.\r
129\r
130 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
131\r
132 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
133 EFI_HANDLE.\r
134\r
135 @retval EFI_INVALID_PARAMETER Language is NULL.\r
136\r
137 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
138\r
139 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
140 managing the controller specified by\r
141 ControllerHandle and ChildHandle.\r
142\r
143 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
144 the language specified by Language.\r
145\r
146**/\r
e237e7ae 147EFI_STATUS\r
148EFIAPI\r
149UsbBusComponentNameGetControllerName (\r
62b9bb55 150 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
151 IN EFI_HANDLE ControllerHandle,\r
152 IN EFI_HANDLE ChildHandle OPTIONAL,\r
153 IN CHAR8 *Language,\r
154 OUT CHAR16 **ControllerName\r
e237e7ae 155 );\r
156\r
62b9bb55 157\r
e237e7ae 158//\r
159// EFI Component Name Protocol\r
160//\r
1307dcd7 161GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL mUsbBusComponentName = {\r
e237e7ae 162 UsbBusComponentNameGetDriverName,\r
163 UsbBusComponentNameGetControllerName,\r
164 "eng"\r
1307dcd7 165};\r
62b9bb55 166\r
167//\r
168// EFI Component Name 2 Protocol\r
169//\r
1307dcd7 170GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL mUsbBusComponentName2 = {\r
62b9bb55 171 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) UsbBusComponentNameGetDriverName,\r
172 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) UsbBusComponentNameGetControllerName,\r
173 "en"\r
1307dcd7 174};\r
62b9bb55 175\r
e237e7ae 176\r
d1aeb0bd 177GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mUsbBusDriverNameTable[] = {\r
62b9bb55 178 { "eng;en", L"Usb Bus Driver" },\r
e237e7ae 179 { NULL , NULL }\r
180};\r
181\r
62b9bb55 182/**\r
183 Retrieves a Unicode string that is the user readable name of the driver.\r
184\r
185 This function retrieves the user readable name of a driver in the form of a\r
186 Unicode string. If the driver specified by This has a user readable name in\r
187 the language specified by Language, then a pointer to the driver name is\r
188 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
189 by This does not support the language specified by Language,\r
190 then EFI_UNSUPPORTED is returned.\r
191\r
192 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
193 EFI_COMPONENT_NAME_PROTOCOL instance.\r
194\r
195 @param Language[in] A pointer to a Null-terminated ASCII string\r
196 array indicating the language. This is the\r
197 language of the driver name that the caller is\r
198 requesting, and it must match one of the\r
199 languages specified in SupportedLanguages. The\r
200 number of languages supported by a driver is up\r
201 to the driver writer. Language is specified\r
202 in RFC 3066 or ISO 639-2 language code format.\r
203\r
204 @param DriverName[out] A pointer to the Unicode string to return.\r
205 This Unicode string is the name of the\r
206 driver specified by This in the language\r
207 specified by Language.\r
208\r
209 @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
210 This and the language specified by Language was\r
211 returned in DriverName.\r
212\r
213 @retval EFI_INVALID_PARAMETER Language is NULL.\r
214\r
215 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
216\r
217 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
218 the language specified by Language.\r
219\r
220**/\r
e237e7ae 221EFI_STATUS\r
222EFIAPI\r
223UsbBusComponentNameGetDriverName (\r
62b9bb55 224 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
225 IN CHAR8 *Language,\r
226 OUT CHAR16 **DriverName\r
e237e7ae 227 )\r
e237e7ae 228{\r
62b9bb55 229 return LookupUnicodeString2 (\r
230 Language,\r
231 This->SupportedLanguages,\r
232 mUsbBusDriverNameTable,\r
233 DriverName,\r
234 (BOOLEAN)(This == &mUsbBusComponentName)\r
235 );\r
e237e7ae 236}\r
237\r
62b9bb55 238/**\r
239 Retrieves a Unicode string that is the user readable name of the controller\r
240 that is being managed by a driver.\r
241\r
242 This function retrieves the user readable name of the controller specified by\r
243 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
244 driver specified by This has a user readable name in the language specified by\r
245 Language, then a pointer to the controller name is returned in ControllerName,\r
246 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
247 managing the controller specified by ControllerHandle and ChildHandle,\r
248 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
249 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
250\r
251 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
252 EFI_COMPONENT_NAME_PROTOCOL instance.\r
253\r
254 @param ControllerHandle[in] The handle of a controller that the driver\r
255 specified by This is managing. This handle\r
256 specifies the controller whose name is to be\r
257 returned.\r
258\r
259 @param ChildHandle[in] The handle of the child controller to retrieve\r
260 the name of. This is an optional parameter that\r
261 may be NULL. It will be NULL for device\r
262 drivers. It will also be NULL for a bus drivers\r
263 that wish to retrieve the name of the bus\r
264 controller. It will not be NULL for a bus\r
265 driver that wishes to retrieve the name of a\r
266 child controller.\r
267\r
268 @param Language[in] A pointer to a Null-terminated ASCII string\r
269 array indicating the language. This is the\r
270 language of the driver name that the caller is\r
271 requesting, and it must match one of the\r
272 languages specified in SupportedLanguages. The\r
273 number of languages supported by a driver is up\r
274 to the driver writer. Language is specified in\r
275 RFC 3066 or ISO 639-2 language code format.\r
276\r
277 @param ControllerName[out] A pointer to the Unicode string to return.\r
278 This Unicode string is the name of the\r
279 controller specified by ControllerHandle and\r
280 ChildHandle in the language specified by\r
281 Language from the point of view of the driver\r
282 specified by This.\r
283\r
284 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
285 the language specified by Language for the\r
286 driver specified by This was returned in\r
287 DriverName.\r
288\r
289 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
290\r
291 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
292 EFI_HANDLE.\r
293\r
294 @retval EFI_INVALID_PARAMETER Language is NULL.\r
295\r
296 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
297\r
298 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
299 managing the controller specified by\r
300 ControllerHandle and ChildHandle.\r
301\r
302 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
303 the language specified by Language.\r
304\r
305**/\r
e237e7ae 306EFI_STATUS\r
307EFIAPI\r
308UsbBusComponentNameGetControllerName (\r
62b9bb55 309 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
310 IN EFI_HANDLE ControllerHandle,\r
311 IN EFI_HANDLE ChildHandle OPTIONAL,\r
312 IN CHAR8 *Language,\r
313 OUT CHAR16 **ControllerName\r
e237e7ae 314 )\r
e237e7ae 315{\r
316 return EFI_UNSUPPORTED;\r
317}\r