]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Network/PxeDhcp4Dxe/ComponentName.c
b174fe23157ba1da988795b7f6503be258bef11a
[mirror_edk2.git] / MdeModulePkg / Universal / Network / PxeDhcp4Dxe / ComponentName.c
1 /** @file
2
3 Copyright (c) 2004 - 2007, Intel Corporation
4 All rights reserved. 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
8
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.
11
12 Module Name:
13 ComponentName.c
14
15 Abstract:
16 PxeDhcp4 component name protocol declarations
17
18
19 **/
20
21 #include "PxeDhcp4.h"
22
23 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
24
25 //
26 // EFI Component Name Functions
27 //
28 /**
29 Retrieves a Unicode string that is the user readable name of the driver.
30
31 This function retrieves the user readable name of a driver in the form of a
32 Unicode string. If the driver specified by This has a user readable name in
33 the language specified by Language, then a pointer to the driver name is
34 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
35 by This does not support the language specified by Language,
36 then EFI_UNSUPPORTED is returned.
37
38 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
39 EFI_COMPONENT_NAME_PROTOCOL instance.
40
41 @param Language[in] A pointer to a Null-terminated ASCII string
42 array indicating the language. This is the
43 language of the driver name that the caller is
44 requesting, and it must match one of the
45 languages specified in SupportedLanguages. The
46 number of languages supported by a driver is up
47 to the driver writer. Language is specified
48 in RFC 3066 or ISO 639-2 language code format.
49
50 @param DriverName[out] A pointer to the Unicode string to return.
51 This Unicode string is the name of the
52 driver specified by This in the language
53 specified by Language.
54
55 @retval EFI_SUCCESS The Unicode string for the Driver specified by
56 This and the language specified by Language was
57 returned in DriverName.
58
59 @retval EFI_INVALID_PARAMETER Language is NULL.
60
61 @retval EFI_INVALID_PARAMETER DriverName is NULL.
62
63 @retval EFI_UNSUPPORTED The driver specified by This does not support
64 the language specified by Language.
65
66 **/
67 EFI_STATUS
68 EFIAPI
69 PxeDhcp4ComponentNameGetDriverName (
70 IN EFI_COMPONENT_NAME_PROTOCOL *This,
71 IN CHAR8 *Language,
72 OUT CHAR16 **DriverName
73 );
74
75
76 /**
77 Retrieves a Unicode string that is the user readable name of the controller
78 that is being managed by a driver.
79
80 This function retrieves the user readable name of the controller specified by
81 ControllerHandle and ChildHandle in the form of a Unicode string. If the
82 driver specified by This has a user readable name in the language specified by
83 Language, then a pointer to the controller name is returned in ControllerName,
84 and EFI_SUCCESS is returned. If the driver specified by This is not currently
85 managing the controller specified by ControllerHandle and ChildHandle,
86 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
87 support the language specified by Language, then EFI_UNSUPPORTED is returned.
88
89 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
90 EFI_COMPONENT_NAME_PROTOCOL instance.
91
92 @param ControllerHandle[in] The handle of a controller that the driver
93 specified by This is managing. This handle
94 specifies the controller whose name is to be
95 returned.
96
97 @param ChildHandle[in] The handle of the child controller to retrieve
98 the name of. This is an optional parameter that
99 may be NULL. It will be NULL for device
100 drivers. It will also be NULL for a bus drivers
101 that wish to retrieve the name of the bus
102 controller. It will not be NULL for a bus
103 driver that wishes to retrieve the name of a
104 child controller.
105
106 @param Language[in] A pointer to a Null-terminated ASCII string
107 array indicating the language. This is the
108 language of the driver name that the caller is
109 requesting, and it must match one of the
110 languages specified in SupportedLanguages. The
111 number of languages supported by a driver is up
112 to the driver writer. Language is specified in
113 RFC 3066 or ISO 639-2 language code format.
114
115 @param ControllerName[out] A pointer to the Unicode string to return.
116 This Unicode string is the name of the
117 controller specified by ControllerHandle and
118 ChildHandle in the language specified by
119 Language from the point of view of the driver
120 specified by This.
121
122 @retval EFI_SUCCESS The Unicode string for the user readable name in
123 the language specified by Language for the
124 driver specified by This was returned in
125 DriverName.
126
127 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
128
129 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
130 EFI_HANDLE.
131
132 @retval EFI_INVALID_PARAMETER Language is NULL.
133
134 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
135
136 @retval EFI_UNSUPPORTED The driver specified by This is not currently
137 managing the controller specified by
138 ControllerHandle and ChildHandle.
139
140 @retval EFI_UNSUPPORTED The driver specified by This does not support
141 the language specified by Language.
142
143 **/
144 EFI_STATUS
145 EFIAPI
146 PxeDhcp4ComponentNameGetControllerName (
147 IN EFI_COMPONENT_NAME_PROTOCOL *This,
148 IN EFI_HANDLE ControllerHandle,
149 IN EFI_HANDLE ChildHandle OPTIONAL,
150 IN CHAR8 *Language,
151 OUT CHAR16 **ControllerName
152 );
153
154
155 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
156
157 //
158 // EFI Component Name Protocol
159 //
160 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gPxeDhcp4ComponentName = {
161 PxeDhcp4ComponentNameGetDriverName,
162 PxeDhcp4ComponentNameGetControllerName,
163 "eng"
164 };
165
166 //
167 // EFI Component Name 2 Protocol
168 //
169 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gPxeDhcp4ComponentName2 = {
170 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) PxeDhcp4ComponentNameGetDriverName,
171 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) PxeDhcp4ComponentNameGetControllerName,
172 "en"
173 };
174
175
176 static EFI_UNICODE_STRING_TABLE mPxeDhcp4DriverNameTable[] = {
177 {
178 "eng;en",
179 L"PXE DHCPv4 Driver"
180 },
181 {
182 NULL,
183 NULL
184 }
185 };
186
187 /**
188 Retrieves a Unicode string that is the user readable name of the driver.
189
190 This function retrieves the user readable name of a driver in the form of a
191 Unicode string. If the driver specified by This has a user readable name in
192 the language specified by Language, then a pointer to the driver name is
193 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
194 by This does not support the language specified by Language,
195 then EFI_UNSUPPORTED is returned.
196
197 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
198 EFI_COMPONENT_NAME_PROTOCOL instance.
199
200 @param Language[in] A pointer to a Null-terminated ASCII string
201 array indicating the language. This is the
202 language of the driver name that the caller is
203 requesting, and it must match one of the
204 languages specified in SupportedLanguages. The
205 number of languages supported by a driver is up
206 to the driver writer. Language is specified
207 in RFC 3066 or ISO 639-2 language code format.
208
209 @param DriverName[out] A pointer to the Unicode string to return.
210 This Unicode string is the name of the
211 driver specified by This in the language
212 specified by Language.
213
214 @retval EFI_SUCCESS The Unicode string for the Driver specified by
215 This and the language specified by Language was
216 returned in DriverName.
217
218 @retval EFI_INVALID_PARAMETER Language is NULL.
219
220 @retval EFI_INVALID_PARAMETER DriverName is NULL.
221
222 @retval EFI_UNSUPPORTED The driver specified by This does not support
223 the language specified by Language.
224
225 **/
226 EFI_STATUS
227 EFIAPI
228 PxeDhcp4ComponentNameGetDriverName (
229 IN EFI_COMPONENT_NAME_PROTOCOL *This,
230 IN CHAR8 *Language,
231 OUT CHAR16 **DriverName
232 )
233 {
234 return LookupUnicodeString2 (
235 Language,
236 This->SupportedLanguages,
237 mPxeDhcp4DriverNameTable,
238 DriverName,
239 (BOOLEAN)(This == &gPxeDhcp4ComponentName)
240 );
241 }
242
243 /**
244 Retrieves a Unicode string that is the user readable name of the controller
245 that is being managed by a driver.
246
247 This function retrieves the user readable name of the controller specified by
248 ControllerHandle and ChildHandle in the form of a Unicode string. If the
249 driver specified by This has a user readable name in the language specified by
250 Language, then a pointer to the controller name is returned in ControllerName,
251 and EFI_SUCCESS is returned. If the driver specified by This is not currently
252 managing the controller specified by ControllerHandle and ChildHandle,
253 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
254 support the language specified by Language, then EFI_UNSUPPORTED is returned.
255
256 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
257 EFI_COMPONENT_NAME_PROTOCOL instance.
258
259 @param ControllerHandle[in] The handle of a controller that the driver
260 specified by This is managing. This handle
261 specifies the controller whose name is to be
262 returned.
263
264 @param ChildHandle[in] The handle of the child controller to retrieve
265 the name of. This is an optional parameter that
266 may be NULL. It will be NULL for device
267 drivers. It will also be NULL for a bus drivers
268 that wish to retrieve the name of the bus
269 controller. It will not be NULL for a bus
270 driver that wishes to retrieve the name of a
271 child controller.
272
273 @param Language[in] A pointer to a Null-terminated ASCII string
274 array indicating the language. This is the
275 language of the driver name that the caller is
276 requesting, and it must match one of the
277 languages specified in SupportedLanguages. The
278 number of languages supported by a driver is up
279 to the driver writer. Language is specified in
280 RFC 3066 or ISO 639-2 language code format.
281
282 @param ControllerName[out] A pointer to the Unicode string to return.
283 This Unicode string is the name of the
284 controller specified by ControllerHandle and
285 ChildHandle in the language specified by
286 Language from the point of view of the driver
287 specified by This.
288
289 @retval EFI_SUCCESS The Unicode string for the user readable name in
290 the language specified by Language for the
291 driver specified by This was returned in
292 DriverName.
293
294 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
295
296 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
297 EFI_HANDLE.
298
299 @retval EFI_INVALID_PARAMETER Language is NULL.
300
301 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
302
303 @retval EFI_UNSUPPORTED The driver specified by This is not currently
304 managing the controller specified by
305 ControllerHandle and ChildHandle.
306
307 @retval EFI_UNSUPPORTED The driver specified by This does not support
308 the language specified by Language.
309
310 **/
311 EFI_STATUS
312 EFIAPI
313 PxeDhcp4ComponentNameGetControllerName (
314 IN EFI_COMPONENT_NAME_PROTOCOL *This,
315 IN EFI_HANDLE ControllerHandle,
316 IN EFI_HANDLE ChildHandle OPTIONAL,
317 IN CHAR8 *Language,
318 OUT CHAR16 **ControllerName
319 )
320 {
321 return EFI_UNSUPPORTED;
322 }
323
324 /* EOF - ComponentName.c */