2 UEFI Component Name(2) protocol implementation for UefiPxeBc driver.
4 Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include "PxeBcImpl.h"
19 Retrieves a Unicode string that is the user-readable name of the driver.
21 This function retrieves the user-readable name of a driver in the form of a
22 Unicode string. If the driver specified by This has a user-readable name in
23 the language specified by Language, then a pointer to the driver name is
24 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
25 by This does not support the language specified by Language,
26 then EFI_UNSUPPORTED is returned.
28 @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
29 EFI_COMPONENT_NAME_PROTOCOL instance.
31 @param[in] Language A pointer to a Null-terminated ASCII string
32 array indicating the language. This is the
33 language of the driver name that the caller is
34 requesting, and it must match one of the
35 languages specified in SupportedLanguages. The
36 number of languages supported by a driver is up
37 to the driver writer. Language is specified
38 in RFC 4646 or ISO 639-2 language code format.
40 @param[out] DriverName A pointer to the Unicode string to return.
41 This Unicode string is the name of the
42 driver specified by This in the language
43 specified by Language.
45 @retval EFI_SUCCESS The Unicode string for the Driver specified by
46 This and the language specified by Language was
47 returned in DriverName.
49 @retval EFI_INVALID_PARAMETER Language is NULL.
51 @retval EFI_INVALID_PARAMETER DriverName is NULL.
53 @retval EFI_UNSUPPORTED The driver specified by This does not support
54 the language specified by Language.
59 PxeBcComponentNameGetDriverName (
60 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
62 OUT CHAR16
**DriverName
67 Retrieves a Unicode string that is the user-readable name of the controller
68 that is being managed by a driver.
70 This function retrieves the user-readable name of the controller specified by
71 ControllerHandle and ChildHandle in the form of a Unicode string. If the
72 driver specified by This has a user-readable name in the language specified by
73 Language, then a pointer to the controller name is returned in ControllerName,
74 and EFI_SUCCESS is returned. If the driver specified by This is not currently
75 managing the controller specified by ControllerHandle and ChildHandle,
76 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
77 support the language specified by Language, then EFI_UNSUPPORTED is returned.
79 @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
80 EFI_COMPONENT_NAME_PROTOCOL instance.
82 @param[in] ControllerHandle The handle of a controller that the driver
83 specified by This is managing. This handle
84 specifies the controller whose name is to be
87 @param[in] ChildHandle The handle of the child controller to retrieve
88 the name of. This is an optional parameter that
89 may be NULL. It will be NULL for device
90 drivers. It will also be NULL for a bus drivers
91 that wish to retrieve the name of the bus
92 controller. It will not be NULL for a bus
93 driver that wishes to retrieve the name of a
96 @param[in] Language A pointer to a Null-terminated ASCII string
97 array indicating the language. This is the
98 language of the driver name that the caller is
99 requesting, and it must match one of the
100 languages specified in SupportedLanguages. The
101 number of languages supported by a driver is up
102 to the driver writer. Language is specified in
103 RFC 4646 or ISO 639-2 language code format.
105 @param[out] ControllerName A pointer to the Unicode string to return.
106 This Unicode string is the name of the
107 controller specified by ControllerHandle and
108 ChildHandle in the language specified by
109 Language from the point of view of the driver
112 @retval EFI_SUCCESS The Unicode string for the user-readable name in
113 the language specified by Language for the
114 driver specified by This was returned in
117 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
119 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL, and it is not a valid
122 @retval EFI_INVALID_PARAMETER Language is NULL.
124 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
126 @retval EFI_UNSUPPORTED The driver specified by This is not currently
127 managing the controller specified by
128 ControllerHandle and ChildHandle.
130 @retval EFI_UNSUPPORTED The driver specified by This does not support
131 the language specified by Language.
136 PxeBcComponentNameGetControllerName (
137 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
138 IN EFI_HANDLE ControllerHandle
,
139 IN EFI_HANDLE ChildHandle OPTIONAL
,
141 OUT CHAR16
**ControllerName
146 // EFI Component Name Protocol
148 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gPxeBcComponentName
= {
149 PxeBcComponentNameGetDriverName
,
150 PxeBcComponentNameGetControllerName
,
155 // EFI Component Name 2 Protocol
157 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gPxeBcComponentName2
= {
158 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME
) PxeBcComponentNameGetDriverName
,
159 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME
) PxeBcComponentNameGetControllerName
,
163 GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mPxeBcDriverNameTable
[] = {
166 L
"UEFI PXE Base Code Driver"
176 Retrieves a Unicode string that is the user-readable name of the driver.
178 This function retrieves the user-readable name of a driver in the form of a
179 Unicode string. If the driver specified by This has a user-readable name in
180 the language specified by Language, then a pointer to the driver name is
181 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
182 by This does not support the language specified by Language,
183 then EFI_UNSUPPORTED is returned.
185 @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
186 EFI_COMPONENT_NAME_PROTOCOL instance.
188 @param[in] Language A pointer to a Null-terminated ASCII string
189 array indicating the language. This is the
190 language of the driver name that the caller is
191 requesting, and it must match one of the
192 languages specified in SupportedLanguages. The
193 number of languages supported by a driver is up
194 to the driver writer. Language is specified
195 in RFC 4646 or ISO 639-2 language code format.
197 @param[out] DriverName A pointer to the Unicode string to return.
198 This Unicode string is the name of the
199 driver specified by This in the language
200 specified by Language.
202 @retval EFI_SUCCESS The Unicode string for the Driver specified by
203 This and the language specified by Language was
204 returned in DriverName.
206 @retval EFI_INVALID_PARAMETER Language is NULL.
208 @retval EFI_INVALID_PARAMETER DriverName is NULL.
210 @retval EFI_UNSUPPORTED The driver specified by This does not support
211 the language specified by Language.
216 PxeBcComponentNameGetDriverName (
217 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
219 OUT CHAR16
**DriverName
222 return LookupUnicodeString2(
224 This
->SupportedLanguages
,
225 mPxeBcDriverNameTable
,
227 (BOOLEAN
)(This
== &gPxeBcComponentName
)
233 Retrieves a Unicode string that is the user-readable name of the controller
234 that is being managed by a driver.
236 This function retrieves the user-readable name of the controller specified by
237 ControllerHandle and ChildHandle in the form of a Unicode string. If the
238 driver specified by This has a user-readable name in the language specified by
239 Language, then a pointer to the controller name is returned in ControllerName,
240 and EFI_SUCCESS is returned. If the driver specified by This is not currently
241 managing the controller specified by ControllerHandle and ChildHandle,
242 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
243 support the language specified by Language, then EFI_UNSUPPORTED is returned.
245 @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
246 EFI_COMPONENT_NAME_PROTOCOL instance.
248 @param[in] ControllerHandle The handle of a controller that the driver
249 specified by This is managing. This handle
250 specifies the controller whose name is to be
253 @param[in] ChildHandle The handle of the child controller to retrieve
254 the name of. This is an optional parameter that
255 may be NULL. It will be NULL for device
256 drivers. It will also be NULL for a bus drivers
257 that wish to retrieve the name of the bus
258 controller. It will not be NULL for a bus
259 driver that wishes to retrieve the name of a
262 @param[in] Language A pointer to a Null-terminated ASCII string
263 array indicating the language. This is the
264 language of the driver name that the caller is
265 requesting, and it must match one of the
266 languages specified in SupportedLanguages. The
267 number of languages supported by a driver is up
268 to the driver writer. Language is specified in
269 RFC 4646 or ISO 639-2 language code format.
271 @param[out] ControllerName A pointer to the Unicode string to return.
272 This Unicode string is the name of the
273 controller specified by ControllerHandle and
274 ChildHandle in the language specified by
275 Language from the point of view of the driver
278 @retval EFI_SUCCESS The Unicode string for the user-readable name in
279 the language specified by Language for the
280 driver specified by This was returned in
283 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
285 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
288 @retval EFI_INVALID_PARAMETER Language is NULL.
290 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
292 @retval EFI_UNSUPPORTED The driver specified by This is not currently
293 managing the controller specified by
294 ControllerHandle and ChildHandle.
296 @retval EFI_UNSUPPORTED The driver specified by This does not support
297 the language specified by Language.
302 PxeBcComponentNameGetControllerName (
303 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
304 IN EFI_HANDLE ControllerHandle
,
305 IN EFI_HANDLE ChildHandle OPTIONAL
,
307 OUT CHAR16
**ControllerName
310 return EFI_UNSUPPORTED
;