3 UEFI Component Name(2) protocol implementation for Usb Bus driver.
5 Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
14 #include <Library/UefiLib.h>
18 Retrieves a Unicode string that is the user readable name of the driver.
20 This function retrieves the user readable name of a driver in the form of a
21 Unicode string. If the driver specified by This has a user readable name in
22 the language specified by Language, then a pointer to the driver name is
23 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
24 by This does not support the language specified by Language,
25 then EFI_UNSUPPORTED is returned.
27 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
28 EFI_COMPONENT_NAME_PROTOCOL instance.
30 @param Language[in] A pointer to a Null-terminated ASCII string
31 array indicating the language. This is the
32 language of the driver name that the caller is
33 requesting, and it must match one of the
34 languages specified in SupportedLanguages. The
35 number of languages supported by a driver is up
36 to the driver writer. Language is specified
37 in RFC 4646 or ISO 639-2 language code format.
39 @param DriverName[out] A pointer to the Unicode string to return.
40 This Unicode string is the name of the
41 driver specified by This in the language
42 specified by Language.
44 @retval EFI_SUCCESS The Unicode string for the Driver specified by
45 This and the language specified by Language was
46 returned in DriverName.
48 @retval EFI_INVALID_PARAMETER Language is NULL.
50 @retval EFI_INVALID_PARAMETER DriverName is NULL.
52 @retval EFI_UNSUPPORTED The driver specified by This does not support
53 the language specified by Language.
58 UsbBusComponentNameGetDriverName (
59 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
61 OUT CHAR16
**DriverName
66 Retrieves a Unicode string that is the user readable name of the controller
67 that is being managed by a driver.
69 This function retrieves the user readable name of the controller specified by
70 ControllerHandle and ChildHandle in the form of a Unicode string. If the
71 driver specified by This has a user readable name in the language specified by
72 Language, then a pointer to the controller name is returned in ControllerName,
73 and EFI_SUCCESS is returned. If the driver specified by This is not currently
74 managing the controller specified by ControllerHandle and ChildHandle,
75 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
76 support the language specified by Language, then EFI_UNSUPPORTED is returned.
78 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
79 EFI_COMPONENT_NAME_PROTOCOL instance.
81 @param ControllerHandle[in] The handle of a controller that the driver
82 specified by This is managing. This handle
83 specifies the controller whose name is to be
86 @param ChildHandle[in] The handle of the child controller to retrieve
87 the name of. This is an optional parameter that
88 may be NULL. It will be NULL for device
89 drivers. It will also be NULL for a bus drivers
90 that wish to retrieve the name of the bus
91 controller. It will not be NULL for a bus
92 driver that wishes to retrieve the name of a
95 @param Language[in] A pointer to a Null-terminated ASCII string
96 array indicating the language. This is the
97 language of the driver name that the caller is
98 requesting, and it must match one of the
99 languages specified in SupportedLanguages. The
100 number of languages supported by a driver is up
101 to the driver writer. Language is specified in
102 RFC 4646 or ISO 639-2 language code format.
104 @param ControllerName[out] A pointer to the Unicode string to return.
105 This Unicode string is the name of the
106 controller specified by ControllerHandle and
107 ChildHandle in the language specified by
108 Language from the point of view of the driver
111 @retval EFI_SUCCESS The Unicode string for the user readable name in
112 the language specified by Language for the
113 driver specified by This was returned in
116 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
118 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
121 @retval EFI_INVALID_PARAMETER Language is NULL.
123 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
125 @retval EFI_UNSUPPORTED The driver specified by This is not currently
126 managing the controller specified by
127 ControllerHandle and ChildHandle.
129 @retval EFI_UNSUPPORTED The driver specified by This does not support
130 the language specified by Language.
135 UsbBusComponentNameGetControllerName (
136 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
137 IN EFI_HANDLE ControllerHandle
,
138 IN EFI_HANDLE ChildHandle OPTIONAL
,
140 OUT CHAR16
**ControllerName
145 // EFI Component Name Protocol
147 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL mUsbBusComponentName
= {
148 UsbBusComponentNameGetDriverName
,
149 UsbBusComponentNameGetControllerName
,
154 // EFI Component Name 2 Protocol
156 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL mUsbBusComponentName2
= {
157 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME
) UsbBusComponentNameGetDriverName
,
158 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME
) UsbBusComponentNameGetControllerName
,
163 GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mUsbBusDriverNameTable
[] = {
164 { "eng;en", L
"Usb Bus Driver" },
169 Retrieves a Unicode string that is the user readable name of the driver.
171 This function retrieves the user readable name of a driver in the form of a
172 Unicode string. If the driver specified by This has a user readable name in
173 the language specified by Language, then a pointer to the driver name is
174 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
175 by This does not support the language specified by Language,
176 then EFI_UNSUPPORTED is returned.
178 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
179 EFI_COMPONENT_NAME_PROTOCOL instance.
181 @param Language[in] A pointer to a Null-terminated ASCII string
182 array indicating the language. This is the
183 language of the driver name that the caller is
184 requesting, and it must match one of the
185 languages specified in SupportedLanguages. The
186 number of languages supported by a driver is up
187 to the driver writer. Language is specified
188 in RFC 4646 or ISO 639-2 language code format.
190 @param DriverName[out] A pointer to the Unicode string to return.
191 This Unicode string is the name of the
192 driver specified by This in the language
193 specified by Language.
195 @retval EFI_SUCCESS The Unicode string for the Driver specified by
196 This and the language specified by Language was
197 returned in DriverName.
199 @retval EFI_INVALID_PARAMETER Language is NULL.
201 @retval EFI_INVALID_PARAMETER DriverName is NULL.
203 @retval EFI_UNSUPPORTED The driver specified by This does not support
204 the language specified by Language.
209 UsbBusComponentNameGetDriverName (
210 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
212 OUT CHAR16
**DriverName
215 return LookupUnicodeString2 (
217 This
->SupportedLanguages
,
218 mUsbBusDriverNameTable
,
220 (BOOLEAN
)(This
== &mUsbBusComponentName
)
225 Retrieves a Unicode string that is the user readable name of the controller
226 that is being managed by a driver.
228 This function retrieves the user readable name of the controller specified by
229 ControllerHandle and ChildHandle in the form of a Unicode string. If the
230 driver specified by This has a user readable name in the language specified by
231 Language, then a pointer to the controller name is returned in ControllerName,
232 and EFI_SUCCESS is returned. If the driver specified by This is not currently
233 managing the controller specified by ControllerHandle and ChildHandle,
234 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
235 support the language specified by Language, then EFI_UNSUPPORTED is returned.
237 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
238 EFI_COMPONENT_NAME_PROTOCOL instance.
240 @param ControllerHandle[in] The handle of a controller that the driver
241 specified by This is managing. This handle
242 specifies the controller whose name is to be
245 @param ChildHandle[in] The handle of the child controller to retrieve
246 the name of. This is an optional parameter that
247 may be NULL. It will be NULL for device
248 drivers. It will also be NULL for a bus drivers
249 that wish to retrieve the name of the bus
250 controller. It will not be NULL for a bus
251 driver that wishes to retrieve the name of a
254 @param Language[in] A pointer to a Null-terminated ASCII string
255 array indicating the language. This is the
256 language of the driver name that the caller is
257 requesting, and it must match one of the
258 languages specified in SupportedLanguages. The
259 number of languages supported by a driver is up
260 to the driver writer. Language is specified in
261 RFC 4646 or ISO 639-2 language code format.
263 @param ControllerName[out] A pointer to the Unicode string to return.
264 This Unicode string is the name of the
265 controller specified by ControllerHandle and
266 ChildHandle in the language specified by
267 Language from the point of view of the driver
270 @retval EFI_SUCCESS The Unicode string for the user readable name in
271 the language specified by Language for the
272 driver specified by This was returned in
275 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
277 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
280 @retval EFI_INVALID_PARAMETER Language is NULL.
282 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
284 @retval EFI_UNSUPPORTED The driver specified by This is not currently
285 managing the controller specified by
286 ControllerHandle and ChildHandle.
288 @retval EFI_UNSUPPORTED The driver specified by This does not support
289 the language specified by Language.
294 UsbBusComponentNameGetControllerName (
295 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
296 IN EFI_HANDLE ControllerHandle
,
297 IN EFI_HANDLE ChildHandle OPTIONAL
,
299 OUT CHAR16
**ControllerName
302 return EFI_UNSUPPORTED
;