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