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