3 Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
4 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.
15 #include "PxeBcImpl.h"
18 // EFI Component Name Functions
21 Retrieves a Unicode string that is the user readable name of the driver.
23 This function retrieves the user readable name of a driver in the form of a
24 Unicode string. If the driver specified by This has a user readable name in
25 the language specified by Language, then a pointer to the driver name is
26 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
27 by This does not support the language specified by Language,
28 then EFI_UNSUPPORTED is returned.
30 @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
31 EFI_COMPONENT_NAME_PROTOCOL instance.
33 @param[in] Language A pointer to a Null-terminated ASCII string
34 array indicating the language. This is the
35 language of the driver name that the caller is
36 requesting, and it must match one of the
37 languages specified in SupportedLanguages. The
38 number of languages supported by a driver is up
39 to the driver writer. Language is specified
40 in RFC 4646 or ISO 639-2 language code format.
42 @param[out] DriverName A pointer to the Unicode string to return.
43 This Unicode string is the name of the
44 driver specified by This in the language
45 specified by Language.
47 @retval EFI_SUCCESS The Unicode string for the Driver specified by
48 This and the language specified by Language was
49 returned in DriverName.
51 @retval EFI_INVALID_PARAMETER Language is NULL.
53 @retval EFI_INVALID_PARAMETER DriverName is NULL.
55 @retval EFI_UNSUPPORTED The driver specified by This does not support
56 the language specified by Language.
61 PxeBcComponentNameGetDriverName (
62 IN EFI_COMPONENT_NAME_PROTOCOL
* This
,
64 OUT CHAR16
**DriverName
68 Retrieves a Unicode string that is the user readable name of the controller
69 that is being managed by a driver.
71 This function retrieves the user readable name of the controller specified by
72 ControllerHandle and ChildHandle in the form of a Unicode string. If the
73 driver specified by This has a user readable name in the language specified by
74 Language, then a pointer to the controller name is returned in ControllerName,
75 and EFI_SUCCESS is returned. If the driver specified by This is not currently
76 managing the controller specified by ControllerHandle and ChildHandle,
77 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
78 support the language specified by Language, then EFI_UNSUPPORTED is returned.
80 @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
81 EFI_COMPONENT_NAME_PROTOCOL instance.
83 @param[in] ControllerHandle The handle of a controller that the driver
84 specified by This is managing. This handle
85 specifies the controller whose name is to be
88 @param[in] ChildHandle The handle of the child controller to retrieve
89 the name of. This is an optional parameter that
90 may be NULL. It will be NULL for device
91 drivers. It will also be NULL for a bus drivers
92 that wish to retrieve the name of the bus
93 controller. It will not be NULL for a bus
94 driver that wishes to retrieve the name of a
97 @param[in] Language A pointer to a Null-terminated ASCII string
98 array indicating the language. This is the
99 language of the driver name that the caller is
100 requesting, and it must match one of the
101 languages specified in SupportedLanguages. The
102 number of languages supported by a driver is up
103 to the driver writer. Language is specified in
104 RFC 4646 or ISO 639-2 language code format.
106 @param[out] ControllerName A pointer to the Unicode string to return.
107 This Unicode string is the name of the
108 controller specified by ControllerHandle and
109 ChildHandle in the language specified by
110 Language from the point of view of the driver
113 @retval EFI_SUCCESS The Unicode string for the user readable name in
114 the language specified by Language for the
115 driver specified by This was returned in
118 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
120 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
123 @retval EFI_INVALID_PARAMETER Language is NULL.
125 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
127 @retval EFI_UNSUPPORTED The driver specified by This is not currently
128 managing the controller specified by
129 ControllerHandle and ChildHandle.
131 @retval EFI_UNSUPPORTED The driver specified by This does not support
132 the language specified by Language.
137 PxeBcComponentNameGetControllerName (
138 IN EFI_COMPONENT_NAME_PROTOCOL
* This
,
139 IN EFI_HANDLE ControllerHandle
,
140 IN EFI_HANDLE ChildHandle OPTIONAL
,
142 OUT CHAR16
**ControllerName
146 // EFI Component Name Protocol
148 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gPxeBcComponentName
= {
149 PxeBcComponentNameGetDriverName
,
150 PxeBcComponentNameGetControllerName
,
154 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gPxeBcComponentName2
= {
155 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME
) PxeBcComponentNameGetDriverName
,
156 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME
) PxeBcComponentNameGetControllerName
,
160 GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mPxeBcDriverNameTable
[] = {
163 L
"UEFI PXE Base Code Driver"
172 Retrieves a Unicode string that is the user readable name of the driver.
174 This function retrieves the user readable name of a driver in the form of a
175 Unicode string. If the driver specified by This has a user readable name in
176 the language specified by Language, then a pointer to the driver name is
177 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
178 by This does not support the language specified by Language,
179 then EFI_UNSUPPORTED is returned.
181 @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
182 EFI_COMPONENT_NAME_PROTOCOL instance.
184 @param[in] Language A pointer to a Null-terminated ASCII string
185 array indicating the language. This is the
186 language of the driver name that the caller is
187 requesting, and it must match one of the
188 languages specified in SupportedLanguages. The
189 number of languages supported by a driver is up
190 to the driver writer. Language is specified
191 in RFC 4646 or ISO 639-2 language code format.
193 @param[out] DriverName A pointer to the Unicode string to return.
194 This Unicode string is the name of the
195 driver specified by This in the language
196 specified by Language.
198 @retval EFI_SUCCESS The Unicode string for the Driver specified by
199 This and the language specified by Language was
200 returned in DriverName.
202 @retval EFI_INVALID_PARAMETER Language is NULL.
204 @retval EFI_INVALID_PARAMETER DriverName is NULL.
206 @retval EFI_UNSUPPORTED The driver specified by This does not support
207 the language specified by Language.
212 PxeBcComponentNameGetDriverName (
213 IN EFI_COMPONENT_NAME_PROTOCOL
* This
,
215 OUT CHAR16
**DriverName
218 return LookupUnicodeString2 (
220 This
->SupportedLanguages
,
221 mPxeBcDriverNameTable
,
223 (BOOLEAN
)(This
== &gPxeBcComponentName
)
228 Retrieves a Unicode string that is the user readable name of the controller
229 that is being managed by a driver.
231 This function retrieves the user readable name of the controller specified by
232 ControllerHandle and ChildHandle in the form of a Unicode string. If the
233 driver specified by This has a user readable name in the language specified by
234 Language, then a pointer to the controller name is returned in ControllerName,
235 and EFI_SUCCESS is returned. If the driver specified by This is not currently
236 managing the controller specified by ControllerHandle and ChildHandle,
237 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
238 support the language specified by Language, then EFI_UNSUPPORTED is returned.
240 @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
241 EFI_COMPONENT_NAME_PROTOCOL instance.
243 @param[in] ControllerHandle The handle of a controller that the driver
244 specified by This is managing. This handle
245 specifies the controller whose name is to be
248 @param[in] ChildHandle The handle of the child controller to retrieve
249 the name of. This is an optional parameter that
250 may be NULL. It will be NULL for device
251 drivers. It will also be NULL for a bus drivers
252 that wish to retrieve the name of the bus
253 controller. It will not be NULL for a bus
254 driver that wishes to retrieve the name of a
257 @param[in] Language A pointer to a Null-terminated ASCII string
258 array indicating the language. This is the
259 language of the driver name that the caller is
260 requesting, and it must match one of the
261 languages specified in SupportedLanguages. The
262 number of languages supported by a driver is up
263 to the driver writer. Language is specified in
264 RFC 4646 or ISO 639-2 language code format.
266 @param[out] ControllerName A pointer to the Unicode string to return.
267 This Unicode string is the name of the
268 controller specified by ControllerHandle and
269 ChildHandle in the language specified by
270 Language from the point of view of the driver
273 @retval EFI_SUCCESS The Unicode string for the user readable name in
274 the language specified by Language for the
275 driver specified by This was returned in
278 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
280 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
283 @retval EFI_INVALID_PARAMETER Language is NULL.
285 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
287 @retval EFI_UNSUPPORTED The driver specified by This is not currently
288 managing the controller specified by
289 ControllerHandle and ChildHandle.
291 @retval EFI_UNSUPPORTED The driver specified by This does not support
292 the language specified by Language.
297 PxeBcComponentNameGetControllerName (
298 IN EFI_COMPONENT_NAME_PROTOCOL
* This
,
299 IN EFI_HANDLE ControllerHandle
,
300 IN EFI_HANDLE ChildHandle OPTIONAL
,
302 OUT CHAR16
**ControllerName
305 return EFI_UNSUPPORTED
;