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