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
12 #include <Library/UefiLib.h>
15 Retrieves a Unicode string that is the user readable name of the driver.
17 This function retrieves the user readable name of a driver in the form of a
18 Unicode string. If the driver specified by This has a user readable name in
19 the language specified by Language, then a pointer to the driver name is
20 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
21 by This does not support the language specified by Language,
22 then EFI_UNSUPPORTED is returned.
24 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
25 EFI_COMPONENT_NAME_PROTOCOL instance.
27 @param Language[in] A pointer to a Null-terminated ASCII string
28 array indicating the language. This is the
29 language of the driver name that the caller is
30 requesting, and it must match one of the
31 languages specified in SupportedLanguages. The
32 number of languages supported by a driver is up
33 to the driver writer. Language is specified
34 in RFC 4646 or ISO 639-2 language code format.
36 @param DriverName[out] A pointer to the Unicode string to return.
37 This Unicode string is the name of the
38 driver specified by This in the language
39 specified by Language.
41 @retval EFI_SUCCESS The Unicode string for the Driver specified by
42 This and the language specified by Language was
43 returned in DriverName.
45 @retval EFI_INVALID_PARAMETER Language is NULL.
47 @retval EFI_INVALID_PARAMETER DriverName is NULL.
49 @retval EFI_UNSUPPORTED The driver specified by This does not support
50 the language specified by Language.
55 UsbBusComponentNameGetDriverName (
56 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
58 OUT CHAR16
**DriverName
62 Retrieves a Unicode string that is the user readable name of the controller
63 that is being managed by a driver.
65 This function retrieves the user readable name of the controller specified by
66 ControllerHandle and ChildHandle in the form of a Unicode string. If the
67 driver specified by This has a user readable name in the language specified by
68 Language, then a pointer to the controller name is returned in ControllerName,
69 and EFI_SUCCESS is returned. If the driver specified by This is not currently
70 managing the controller specified by ControllerHandle and ChildHandle,
71 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
72 support the language specified by Language, then EFI_UNSUPPORTED is returned.
74 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
75 EFI_COMPONENT_NAME_PROTOCOL instance.
77 @param ControllerHandle[in] The handle of a controller that the driver
78 specified by This is managing. This handle
79 specifies the controller whose name is to be
82 @param ChildHandle[in] The handle of the child controller to retrieve
83 the name of. This is an optional parameter that
84 may be NULL. It will be NULL for device
85 drivers. It will also be NULL for a bus drivers
86 that wish to retrieve the name of the bus
87 controller. It will not be NULL for a bus
88 driver that wishes to retrieve the name of a
91 @param Language[in] A pointer to a Null-terminated ASCII string
92 array indicating the language. This is the
93 language of the driver name that the caller is
94 requesting, and it must match one of the
95 languages specified in SupportedLanguages. The
96 number of languages supported by a driver is up
97 to the driver writer. Language is specified in
98 RFC 4646 or ISO 639-2 language code format.
100 @param ControllerName[out] A pointer to the Unicode string to return.
101 This Unicode string is the name of the
102 controller specified by ControllerHandle and
103 ChildHandle in the language specified by
104 Language from the point of view of the driver
107 @retval EFI_SUCCESS The Unicode string for the user readable name in
108 the language specified by Language for the
109 driver specified by This was returned in
112 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
114 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
117 @retval EFI_INVALID_PARAMETER Language is NULL.
119 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
121 @retval EFI_UNSUPPORTED The driver specified by This is not currently
122 managing the controller specified by
123 ControllerHandle and ChildHandle.
125 @retval EFI_UNSUPPORTED The driver specified by This does not support
126 the language specified by Language.
131 UsbBusComponentNameGetControllerName (
132 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
133 IN EFI_HANDLE ControllerHandle
,
134 IN EFI_HANDLE ChildHandle OPTIONAL
,
136 OUT CHAR16
**ControllerName
140 // EFI Component Name Protocol
142 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL mUsbBusComponentName
= {
143 UsbBusComponentNameGetDriverName
,
144 UsbBusComponentNameGetControllerName
,
149 // EFI Component Name 2 Protocol
151 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL mUsbBusComponentName2
= {
152 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME
)UsbBusComponentNameGetDriverName
,
153 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME
)UsbBusComponentNameGetControllerName
,
157 GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mUsbBusDriverNameTable
[] = {
158 { "eng;en", L
"Usb Bus Driver" },
163 Retrieves a Unicode string that is the user readable name of the driver.
165 This function retrieves the user readable name of a driver in the form of a
166 Unicode string. If the driver specified by This has a user readable name in
167 the language specified by Language, then a pointer to the driver name is
168 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
169 by This does not support the language specified by Language,
170 then EFI_UNSUPPORTED is returned.
172 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
173 EFI_COMPONENT_NAME_PROTOCOL instance.
175 @param Language[in] A pointer to a Null-terminated ASCII string
176 array indicating the language. This is the
177 language of the driver name that the caller is
178 requesting, and it must match one of the
179 languages specified in SupportedLanguages. The
180 number of languages supported by a driver is up
181 to the driver writer. Language is specified
182 in RFC 4646 or ISO 639-2 language code format.
184 @param DriverName[out] A pointer to the Unicode string to return.
185 This Unicode string is the name of the
186 driver specified by This in the language
187 specified by Language.
189 @retval EFI_SUCCESS The Unicode string for the Driver specified by
190 This and the language specified by Language was
191 returned in DriverName.
193 @retval EFI_INVALID_PARAMETER Language is NULL.
195 @retval EFI_INVALID_PARAMETER DriverName is NULL.
197 @retval EFI_UNSUPPORTED The driver specified by This does not support
198 the language specified by Language.
203 UsbBusComponentNameGetDriverName (
204 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
206 OUT CHAR16
**DriverName
209 return LookupUnicodeString2 (
211 This
->SupportedLanguages
,
212 mUsbBusDriverNameTable
,
214 (BOOLEAN
)(This
== &mUsbBusComponentName
)
219 Retrieves a Unicode string that is the user readable name of the controller
220 that is being managed by a driver.
222 This function retrieves the user readable name of the controller specified by
223 ControllerHandle and ChildHandle in the form of a Unicode string. If the
224 driver specified by This has a user readable name in the language specified by
225 Language, then a pointer to the controller name is returned in ControllerName,
226 and EFI_SUCCESS is returned. If the driver specified by This is not currently
227 managing the controller specified by ControllerHandle and ChildHandle,
228 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
229 support the language specified by Language, then EFI_UNSUPPORTED is returned.
231 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
232 EFI_COMPONENT_NAME_PROTOCOL instance.
234 @param ControllerHandle[in] The handle of a controller that the driver
235 specified by This is managing. This handle
236 specifies the controller whose name is to be
239 @param ChildHandle[in] The handle of the child controller to retrieve
240 the name of. This is an optional parameter that
241 may be NULL. It will be NULL for device
242 drivers. It will also be NULL for a bus drivers
243 that wish to retrieve the name of the bus
244 controller. It will not be NULL for a bus
245 driver that wishes to retrieve the name of a
248 @param Language[in] A pointer to a Null-terminated ASCII string
249 array indicating the language. This is the
250 language of the driver name that the caller is
251 requesting, and it must match one of the
252 languages specified in SupportedLanguages. The
253 number of languages supported by a driver is up
254 to the driver writer. Language is specified in
255 RFC 4646 or ISO 639-2 language code format.
257 @param ControllerName[out] A pointer to the Unicode string to return.
258 This Unicode string is the name of the
259 controller specified by ControllerHandle and
260 ChildHandle in the language specified by
261 Language from the point of view of the driver
264 @retval EFI_SUCCESS The Unicode string for the user readable name in
265 the language specified by Language for the
266 driver specified by This was returned in
269 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
271 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
274 @retval EFI_INVALID_PARAMETER Language is NULL.
276 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
278 @retval EFI_UNSUPPORTED The driver specified by This is not currently
279 managing the controller specified by
280 ControllerHandle and ChildHandle.
282 @retval EFI_UNSUPPORTED The driver specified by This does not support
283 the language specified by Language.
288 UsbBusComponentNameGetControllerName (
289 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
290 IN EFI_HANDLE ControllerHandle
,
291 IN EFI_HANDLE ChildHandle OPTIONAL
,
293 OUT CHAR16
**ControllerName
296 return EFI_UNSUPPORTED
;