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