2 UEFI Component Name(2) protocol implementation for IPsec driver.
4 Copyright (c) 2009 - 2010, 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 "IpSecImpl.h"
19 // EFI Component Name Functions
22 Retrieves a Unicode string that is the user-readable name of the driver.
24 This function retrieves the user-readable name of a driver in the form of a
25 Unicode string. If the driver specified by This has a user-readable name in
26 the language specified by Language, then a pointer to the driver name is
27 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
28 by This does not support the language specified by Language,
29 then EFI_UNSUPPORTED is returned.
31 @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
32 EFI_COMPONENT_NAME_PROTOCOL instance.
34 @param[in] Language A pointer to a Null-terminated ASCII string
35 array indicating the language. This is the
36 language of the driver name that the caller is
37 requesting, and it must match one of the
38 languages specified in SupportedLanguages. The
39 number of languages supported by a driver is up
40 to the driver writer. Language is specified
41 in RFC 4646 or ISO 639-2 language code format.
43 @param[out] DriverName A pointer to the Unicode string to return.
44 This Unicode string is the name of the
45 driver specified by This in the language
46 specified by Language.
48 @retval EFI_SUCCESS The Unicode string for the Driver specified by
49 This and the language specified by Language was
50 returned in DriverName.
52 @retval EFI_INVALID_PARAMETER Language is NULL.
54 @retval EFI_INVALID_PARAMETER DriverName is NULL.
56 @retval EFI_UNSUPPORTED The driver specified by This does not support
57 the language specified by Language.
62 IpSecComponentNameGetDriverName (
63 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
65 OUT CHAR16
**DriverName
69 Retrieves a Unicode string that is the user-readable name of the controller
70 that is being managed by a driver.
72 This function retrieves the user-readable name of the controller specified by
73 ControllerHandle and ChildHandle in the form of a Unicode string. If the
74 driver specified by This has a user-readable name in the language specified by
75 Language, then a pointer to the controller name is returned in ControllerName,
76 and EFI_SUCCESS is returned. If the driver specified by This is not currently
77 managing the controller specified by ControllerHandle and ChildHandle,
78 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
79 support the language specified by Language, then EFI_UNSUPPORTED is returned.
81 @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
82 EFI_COMPONENT_NAME_PROTOCOL instance.
84 @param[in] ControllerHandle The handle of a controller that the driver
85 specified by This is managing. This handle
86 specifies the controller whose name is to be
89 @param[in] ChildHandle The handle of the child controller to retrieve
90 the name of. This is an optional parameter that
91 may be NULL. It will be NULL for device
92 drivers. It will also be NULL for a bus drivers
93 that wish to retrieve the name of the bus
94 controller. It will not be NULL for a bus
95 driver that wishes to retrieve the name of a
98 @param[in] Language A pointer to a Null-terminated ASCII string
99 array indicating the language. This is the
100 language of the driver name that the caller is
101 requesting, and it must match one of the
102 languages specified in SupportedLanguages. The
103 number of languages supported by a driver is up
104 to the driver writer. Language is specified in
105 RFC 4646 or ISO 639-2 language code format.
107 @param[out] ControllerName A pointer to the Unicode string to return.
108 This Unicode string is the name of the
109 controller specified by ControllerHandle and
110 ChildHandle in the language specified by
111 Language from the point of view of the driver
114 @retval EFI_SUCCESS The Unicode string for the user-readable name in
115 the language specified by Language for the
116 driver specified by This was returned in
119 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
121 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
124 @retval EFI_INVALID_PARAMETER Language is NULL.
126 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
128 @retval EFI_UNSUPPORTED The driver specified by This is not currently
129 managing the controller specified by
130 ControllerHandle and ChildHandle.
132 @retval EFI_UNSUPPORTED The driver specified by This does not support
133 the language specified by Language.
138 IpSecComponentNameGetControllerName (
139 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
140 IN EFI_HANDLE ControllerHandle
,
141 IN EFI_HANDLE ChildHandle
, OPTIONAL
143 OUT CHAR16
**ControllerName
147 // EFI Component Name Protocol
149 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gIpSecComponentName
= {
150 IpSecComponentNameGetDriverName
,
151 IpSecComponentNameGetControllerName
,
156 // EFI Component Name 2 Protocol
158 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gIpSecComponentName2
= {
159 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME
) IpSecComponentNameGetDriverName
,
160 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME
) IpSecComponentNameGetControllerName
,
164 GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mIpSecDriverNameTable
[] = {
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 IpSecComponentNameGetDriverName (
217 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
219 OUT CHAR16
**DriverName
222 return LookupUnicodeString2 (
224 This
->SupportedLanguages
,
225 mIpSecDriverNameTable
,
227 (BOOLEAN
) (This
== &gIpSecComponentName
)
232 Retrieves a Unicode string that is the user-readable name of the controller
233 that is being managed by a driver.
235 This function retrieves the user-readable name of the controller specified by
236 ControllerHandle and ChildHandle in the form of a Unicode string. If the
237 driver specified by This has a user-readable name in the language specified by
238 Language, then a pointer to the controller name is returned in ControllerName,
239 and EFI_SUCCESS is returned. If the driver specified by This is not currently
240 managing the controller specified by ControllerHandle and ChildHandle,
241 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
242 support the language specified by Language, then EFI_UNSUPPORTED is returned.
244 @param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
245 EFI_COMPONENT_NAME_PROTOCOL instance.
247 @param[in] ControllerHandle The handle of a controller that the driver
248 specified by This is managing. This handle
249 specifies the controller whose name is to be
252 @param[in] ChildHandle The handle of the child controller to retrieve
253 the name of. This is an optional parameter that
254 may be NULL. It will be NULL for device
255 drivers. It will also be NULL for a bus drivers
256 that wish to retrieve the name of the bus
257 controller. It will not be NULL for a bus
258 driver that wishes to retrieve the name of a
261 @param[in] Language A pointer to a Null-terminated ASCII string
262 array indicating the language. This is the
263 language of the driver name that the caller is
264 requesting, and it must match one of the
265 languages specified in SupportedLanguages. The
266 number of languages supported by a driver is up
267 to the driver writer. Language is specified in
268 RFC 4646 or ISO 639-2 language code format.
270 @param[out] ControllerName A pointer to the Unicode string to return.
271 This Unicode string is the name of the
272 controller specified by ControllerHandle and
273 ChildHandle in the language specified by
274 Language from the point of view of the driver
277 @retval EFI_SUCCESS The Unicode string for the user-readable name in
278 the language specified by Language for the
279 driver specified by This was returned in
282 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
284 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL, and it is not a valid
287 @retval EFI_INVALID_PARAMETER Language is NULL.
289 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
291 @retval EFI_UNSUPPORTED The driver specified by This is not currently
292 managing the controller specified by
293 ControllerHandle and ChildHandle.
295 @retval EFI_UNSUPPORTED The driver specified by This does not support
296 the language specified by Language.
301 IpSecComponentNameGetControllerName (
302 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
303 IN EFI_HANDLE ControllerHandle
,
304 IN EFI_HANDLE ChildHandle
, OPTIONAL
306 OUT CHAR16
**ControllerName
309 return EFI_UNSUPPORTED
;