3 Copyright (c) 2004 - 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
25 #include <Library/UefiLib.h>
29 // EFI Component Name Functions
32 Retrieves a Unicode string that is the user readable name of the driver.
34 This function retrieves the user readable name of a driver in the form of a
35 Unicode string. If the driver specified by This has a user readable name in
36 the language specified by Language, then a pointer to the driver name is
37 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
38 by This does not support the language specified by Language,
39 then EFI_UNSUPPORTED is returned.
41 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
42 EFI_COMPONENT_NAME_PROTOCOL instance.
44 @param Language[in] A pointer to a Null-terminated ASCII string
45 array indicating the language. This is the
46 language of the driver name that the caller is
47 requesting, and it must match one of the
48 languages specified in SupportedLanguages. The
49 number of languages supported by a driver is up
50 to the driver writer. Language is specified
51 in RFC 3066 or ISO 639-2 language code format.
53 @param DriverName[out] A pointer to the Unicode string to return.
54 This Unicode string is the name of the
55 driver specified by This in the language
56 specified by Language.
58 @retval EFI_SUCCESS The Unicode string for the Driver specified by
59 This and the language specified by Language was
60 returned in DriverName.
62 @retval EFI_INVALID_PARAMETER Language is NULL.
64 @retval EFI_INVALID_PARAMETER DriverName is NULL.
66 @retval EFI_UNSUPPORTED The driver specified by This does not support
67 the language specified by Language.
72 UsbBusComponentNameGetDriverName (
73 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
75 OUT CHAR16
**DriverName
80 Retrieves a Unicode string that is the user readable name of the controller
81 that is being managed by a driver.
83 This function retrieves the user readable name of the controller specified by
84 ControllerHandle and ChildHandle in the form of a Unicode string. If the
85 driver specified by This has a user readable name in the language specified by
86 Language, then a pointer to the controller name is returned in ControllerName,
87 and EFI_SUCCESS is returned. If the driver specified by This is not currently
88 managing the controller specified by ControllerHandle and ChildHandle,
89 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
90 support the language specified by Language, then EFI_UNSUPPORTED is returned.
92 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
93 EFI_COMPONENT_NAME_PROTOCOL instance.
95 @param ControllerHandle[in] The handle of a controller that the driver
96 specified by This is managing. This handle
97 specifies the controller whose name is to be
100 @param ChildHandle[in] The handle of the child controller to retrieve
101 the name of. This is an optional parameter that
102 may be NULL. It will be NULL for device
103 drivers. It will also be NULL for a bus drivers
104 that wish to retrieve the name of the bus
105 controller. It will not be NULL for a bus
106 driver that wishes to retrieve the name of a
109 @param Language[in] A pointer to a Null-terminated ASCII string
110 array indicating the language. This is the
111 language of the driver name that the caller is
112 requesting, and it must match one of the
113 languages specified in SupportedLanguages. The
114 number of languages supported by a driver is up
115 to the driver writer. Language is specified in
116 RFC 3066 or ISO 639-2 language code format.
118 @param ControllerName[out] A pointer to the Unicode string to return.
119 This Unicode string is the name of the
120 controller specified by ControllerHandle and
121 ChildHandle in the language specified by
122 Language from the point of view of the driver
125 @retval EFI_SUCCESS The Unicode string for the user readable name in
126 the language specified by Language for the
127 driver specified by This was returned in
130 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
132 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
135 @retval EFI_INVALID_PARAMETER Language is NULL.
137 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
139 @retval EFI_UNSUPPORTED The driver specified by This is not currently
140 managing the controller specified by
141 ControllerHandle and ChildHandle.
143 @retval EFI_UNSUPPORTED The driver specified by This does not support
144 the language specified by Language.
149 UsbBusComponentNameGetControllerName (
150 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
151 IN EFI_HANDLE ControllerHandle
,
152 IN EFI_HANDLE ChildHandle OPTIONAL
,
154 OUT CHAR16
**ControllerName
159 // EFI Component Name Protocol
161 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL mUsbBusComponentName
= {
162 UsbBusComponentNameGetDriverName
,
163 UsbBusComponentNameGetControllerName
,
168 // EFI Component Name 2 Protocol
170 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL mUsbBusComponentName2
= {
171 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME
) UsbBusComponentNameGetDriverName
,
172 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME
) UsbBusComponentNameGetControllerName
,
177 GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mUsbBusDriverNameTable
[] = {
178 { "eng;en", L
"Usb Bus Driver" },
183 Retrieves a Unicode string that is the user readable name of the driver.
185 This function retrieves the user readable name of a driver in the form of a
186 Unicode string. If the driver specified by This has a user readable name in
187 the language specified by Language, then a pointer to the driver name is
188 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
189 by This does not support the language specified by Language,
190 then EFI_UNSUPPORTED is returned.
192 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
193 EFI_COMPONENT_NAME_PROTOCOL instance.
195 @param Language[in] A pointer to a Null-terminated ASCII string
196 array indicating the language. This is the
197 language of the driver name that the caller is
198 requesting, and it must match one of the
199 languages specified in SupportedLanguages. The
200 number of languages supported by a driver is up
201 to the driver writer. Language is specified
202 in RFC 3066 or ISO 639-2 language code format.
204 @param DriverName[out] A pointer to the Unicode string to return.
205 This Unicode string is the name of the
206 driver specified by This in the language
207 specified by Language.
209 @retval EFI_SUCCESS The Unicode string for the Driver specified by
210 This and the language specified by Language was
211 returned in DriverName.
213 @retval EFI_INVALID_PARAMETER Language is NULL.
215 @retval EFI_INVALID_PARAMETER DriverName is NULL.
217 @retval EFI_UNSUPPORTED The driver specified by This does not support
218 the language specified by Language.
223 UsbBusComponentNameGetDriverName (
224 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
226 OUT CHAR16
**DriverName
229 return LookupUnicodeString2 (
231 This
->SupportedLanguages
,
232 mUsbBusDriverNameTable
,
234 (BOOLEAN
)(This
== &mUsbBusComponentName
)
239 Retrieves a Unicode string that is the user readable name of the controller
240 that is being managed by a driver.
242 This function retrieves the user readable name of the controller specified by
243 ControllerHandle and ChildHandle in the form of a Unicode string. If the
244 driver specified by This has a user readable name in the language specified by
245 Language, then a pointer to the controller name is returned in ControllerName,
246 and EFI_SUCCESS is returned. If the driver specified by This is not currently
247 managing the controller specified by ControllerHandle and ChildHandle,
248 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
249 support the language specified by Language, then EFI_UNSUPPORTED is returned.
251 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
252 EFI_COMPONENT_NAME_PROTOCOL instance.
254 @param ControllerHandle[in] The handle of a controller that the driver
255 specified by This is managing. This handle
256 specifies the controller whose name is to be
259 @param ChildHandle[in] The handle of the child controller to retrieve
260 the name of. This is an optional parameter that
261 may be NULL. It will be NULL for device
262 drivers. It will also be NULL for a bus drivers
263 that wish to retrieve the name of the bus
264 controller. It will not be NULL for a bus
265 driver that wishes to retrieve the name of a
268 @param Language[in] A pointer to a Null-terminated ASCII string
269 array indicating the language. This is the
270 language of the driver name that the caller is
271 requesting, and it must match one of the
272 languages specified in SupportedLanguages. The
273 number of languages supported by a driver is up
274 to the driver writer. Language is specified in
275 RFC 3066 or ISO 639-2 language code format.
277 @param ControllerName[out] A pointer to the Unicode string to return.
278 This Unicode string is the name of the
279 controller specified by ControllerHandle and
280 ChildHandle in the language specified by
281 Language from the point of view of the driver
284 @retval EFI_SUCCESS The Unicode string for the user readable name in
285 the language specified by Language for the
286 driver specified by This was returned in
289 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
291 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
294 @retval EFI_INVALID_PARAMETER Language is NULL.
296 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
298 @retval EFI_UNSUPPORTED The driver specified by This is not currently
299 managing the controller specified by
300 ControllerHandle and ChildHandle.
302 @retval EFI_UNSUPPORTED The driver specified by This does not support
303 the language specified by Language.
308 UsbBusComponentNameGetControllerName (
309 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
310 IN EFI_HANDLE ControllerHandle
,
311 IN EFI_HANDLE ChildHandle OPTIONAL
,
313 OUT CHAR16
**ControllerName
316 return EFI_UNSUPPORTED
;