]>
Commit | Line | Data |
---|---|---|
112e584b SZ |
1 | /** @file\r |
2 | Values defined and used by the Opal UEFI Driver.\r | |
3 | \r | |
4 | Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>\r | |
5 | This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef _OPAL_DRIVER_H_\r | |
16 | #define _OPAL_DRIVER_H_\r | |
17 | \r | |
18 | #include <PiDxe.h>\r | |
19 | \r | |
20 | #include <IndustryStandard/Pci.h>\r | |
21 | \r | |
22 | #include <Protocol/PciIo.h>\r | |
23 | #include <Protocol/SmmCommunication.h>\r | |
24 | #include <Protocol/BlockIo.h>\r | |
25 | #include <Protocol/LoadedImage.h>\r | |
26 | #include <Protocol/DevicePath.h>\r | |
27 | #include <Protocol/DevicePathToText.h>\r | |
28 | #include <Protocol/StorageSecurityCommand.h>\r | |
29 | \r | |
30 | #include <Guid/EventGroup.h>\r | |
31 | \r | |
32 | #include <Library/UefiLib.h>\r | |
33 | #include <Library/UefiBootServicesTableLib.h>\r | |
34 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
35 | #include <Library/DxeServicesTableLib.h>\r | |
36 | #include <Library/BaseMemoryLib.h>\r | |
37 | #include <Library/MemoryAllocationLib.h>\r | |
38 | #include <Library/BaseLib.h>\r | |
39 | #include <Library/PrintLib.h>\r | |
40 | #include <Library/DebugLib.h>\r | |
41 | #include <Library/DevicePathLib.h>\r | |
42 | #include <Library/HiiLib.h>\r | |
43 | #include <Library/UefiHiiServicesLib.h>\r | |
44 | #include <Library/PciLib.h>\r | |
45 | #include <Library/S3BootScriptLib.h>\r | |
46 | #include <Library/LockBoxLib.h>\r | |
47 | #include <Library/TcgStorageOpalLib.h>\r | |
48 | #include <Library/Tcg2PhysicalPresenceLib.h>\r | |
49 | \r | |
50 | #include "OpalPasswordCommon.h"\r | |
51 | #include "OpalHiiFormValues.h"\r | |
52 | \r | |
53 | #define EFI_DRIVER_NAME_UNICODE L"1.0 UEFI Opal Driver"\r | |
54 | \r | |
55 | // UEFI 2.1\r | |
56 | #define LANGUAGE_RFC_3066_ENGLISH ((CHAR8*)"en")\r | |
57 | \r | |
58 | // UEFI/EFI < 2.1\r | |
59 | #define LANGUAGE_ISO_639_2_ENGLISH ((CHAR8*)"eng")\r | |
60 | \r | |
61 | #define CONCAT_(x, y) x ## y\r | |
62 | #define CONCAT(x, y) CONCAT_(x, y)\r | |
63 | \r | |
64 | #define UNICODE_STR(x) CONCAT( L, x )\r | |
65 | \r | |
66 | extern EFI_DRIVER_BINDING_PROTOCOL gOpalDriverBinding;\r | |
67 | extern EFI_COMPONENT_NAME_PROTOCOL gOpalComponentName;\r | |
68 | extern EFI_COMPONENT_NAME2_PROTOCOL gOpalComponentName2;\r | |
69 | \r | |
70 | #define OPAL_MSID_LENGHT 128\r | |
71 | \r | |
72 | #define MAX_PASSWORD_TRY_COUNT 5\r | |
73 | \r | |
74 | // PSID Length\r | |
75 | #define PSID_CHARACTER_LENGTH 0x20\r | |
76 | #define MAX_PSID_TRY_COUNT 5\r | |
77 | \r | |
78 | #pragma pack(1)\r | |
79 | \r | |
80 | //\r | |
81 | // Structure that is used to represent the available actions for an OpalDisk.\r | |
82 | // The data can then be utilized to expose/hide certain actions available to an end user\r | |
83 | // by the consumer of this library.\r | |
84 | //\r | |
85 | typedef struct {\r | |
86 | //\r | |
87 | // Indicates if the disk can support PSID Revert action. should verify disk supports PSID authority\r | |
88 | //\r | |
89 | UINT16 PsidRevert : 1;\r | |
90 | \r | |
91 | //\r | |
92 | // Indicates if the disk can support Revert action\r | |
93 | //\r | |
94 | UINT16 Revert : 1;\r | |
95 | \r | |
96 | //\r | |
97 | // Indicates if the user must keep data for revert action. It is true if no media encryption is supported.\r | |
98 | //\r | |
99 | UINT16 RevertKeepDataForced : 1;\r | |
100 | \r | |
101 | //\r | |
102 | // Indicates if the disk can support set Admin password\r | |
103 | //\r | |
104 | UINT16 AdminPass : 1;\r | |
105 | \r | |
106 | //\r | |
107 | // Indicates if the disk can support set User password. This action requires that a user\r | |
108 | // password is first enabled.\r | |
109 | //\r | |
110 | UINT16 UserPass : 1;\r | |
111 | \r | |
112 | //\r | |
113 | // Indicates if unlock action is available. Requires disk to be currently locked.\r | |
114 | //\r | |
115 | UINT16 Unlock : 1;\r | |
116 | \r | |
117 | //\r | |
118 | // Indicates if Secure Erase action is available. Action requires admin credentials and media encryption support.\r | |
119 | //\r | |
120 | UINT16 SecureErase : 1;\r | |
121 | \r | |
122 | //\r | |
123 | // Indicates if Disable User action is available. Action requires admin credentials.\r | |
124 | //\r | |
125 | UINT16 DisableUser : 1;\r | |
126 | } OPAL_DISK_ACTIONS;\r | |
127 | \r | |
128 | //\r | |
129 | // Structure that is used to represent an OPAL_DISK.\r | |
130 | //\r | |
131 | typedef struct {\r | |
132 | UINT32 MsidLength; // Byte length of MSID Pin for device\r | |
133 | UINT8 Msid[OPAL_MSID_LENGHT]; // MSID Pin for device\r | |
134 | EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *Sscp;\r | |
135 | UINT32 MediaId; // MediaId is used by Ssc Protocol.\r | |
136 | EFI_DEVICE_PATH_PROTOCOL *OpalDevicePath;\r | |
137 | UINT16 OpalBaseComId; // Opal SSC 1 base com id.\r | |
138 | OPAL_OWNER_SHIP Owner;\r | |
139 | OPAL_DISK_SUPPORT_ATTRIBUTE SupportedAttributes;\r | |
140 | TCG_LOCKING_FEATURE_DESCRIPTOR LockingFeature; // Locking Feature Descriptor retrieved from performing a Level 0 Discovery\r | |
141 | UINT8 PasswordLength;\r | |
142 | UINT8 Password[OPAL_MAX_PASSWORD_SIZE];\r | |
143 | } OPAL_DISK;\r | |
144 | \r | |
145 | //\r | |
146 | // Device with block IO protocol\r | |
147 | //\r | |
148 | typedef struct _OPAL_DRIVER_DEVICE OPAL_DRIVER_DEVICE;\r | |
149 | \r | |
150 | struct _OPAL_DRIVER_DEVICE {\r | |
151 | OPAL_DRIVER_DEVICE *Next; ///< Linked list pointer\r | |
152 | EFI_HANDLE Handle; ///< Device handle\r | |
153 | OPAL_DISK OpalDisk; ///< User context\r | |
154 | CHAR16 *Name16; ///< Allocated/freed by UEFI Filter Driver at device creation/removal\r | |
155 | CHAR8 *NameZ; ///< Allocated/freed by UEFI Filter Driver at device creation/removal\r | |
156 | UINT32 MediaId; ///< Required parameter for EFI_STORAGE_SECURITY_COMMAND_PROTOCOL, from BLOCK_IO_MEDIA\r | |
157 | \r | |
158 | EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *Sscp; /// Device protocols consumed\r | |
159 | EFI_DEVICE_PATH_PROTOCOL *OpalDevicePath;\r | |
160 | };\r | |
161 | \r | |
162 | //\r | |
163 | // Opal Driver UEFI Driver Model\r | |
164 | //\r | |
165 | typedef struct {\r | |
166 | EFI_HANDLE Handle; ///< Driver image handle\r | |
167 | OPAL_DRIVER_DEVICE *DeviceList; ///< Linked list of controllers owned by this Driver\r | |
168 | } OPAL_DRIVER;\r | |
169 | \r | |
170 | #pragma pack()\r | |
171 | \r | |
172 | //\r | |
173 | // Retrieves a OPAL_DRIVER_DEVICE based on the pointer to its StorageSecurity protocol.\r | |
174 | //\r | |
175 | #define DRIVER_DEVICE_FROM_OPALDISK(OpalDiskPointer) (OPAL_DRIVER_DEVICE*)(BASE_CR(OpalDiskPointer, OPAL_DRIVER_DEVICE, OpalDisk))\r | |
176 | \r | |
177 | /**\r | |
178 | Get devcie list info.\r | |
179 | \r | |
180 | @retval return the device list pointer.\r | |
181 | **/\r | |
182 | OPAL_DRIVER_DEVICE*\r | |
183 | OpalDriverGetDeviceList(\r | |
184 | VOID\r | |
185 | );\r | |
186 | \r | |
187 | /**\r | |
188 | Get devcie name through the component name protocol.\r | |
189 | \r | |
190 | @param[in] Dev The device which need to get name.\r | |
191 | \r | |
192 | @retval TRUE Find the name for this device.\r | |
193 | @retval FALSE Not found the name for this device.\r | |
194 | **/\r | |
195 | BOOLEAN\r | |
196 | OpalDriverGetDriverDeviceName(\r | |
197 | OPAL_DRIVER_DEVICE *Dev\r | |
198 | );\r | |
199 | \r | |
200 | /**\r | |
201 | Get current device count.\r | |
202 | \r | |
203 | @retval return the current created device count.\r | |
204 | \r | |
205 | **/\r | |
206 | UINT8\r | |
207 | GetDeviceCount (\r | |
208 | VOID\r | |
209 | );\r | |
210 | \r | |
211 | /**\r | |
212 | Update password for the Opal disk.\r | |
213 | \r | |
214 | @param[in, out] OpalDisk The disk to update password.\r | |
215 | @param[in] Password The input password.\r | |
216 | @param[in] PasswordLength The input password length.\r | |
217 | \r | |
218 | **/\r | |
219 | VOID\r | |
220 | OpalSupportUpdatePassword (\r | |
221 | IN OUT OPAL_DISK *OpalDisk,\r | |
222 | IN VOID *Password,\r | |
223 | IN UINT32 PasswordLength\r | |
224 | );\r | |
225 | \r | |
226 | /**\r | |
227 | \r | |
228 | The function performs determines the available actions for the OPAL_DISK provided.\r | |
229 | \r | |
230 | @param[in] SupportedAttributes The support attribute for the device.\r | |
231 | @param[in] LockingFeature The locking status for the device.\r | |
232 | @param[in] OwnerShip The ownership for the device.\r | |
233 | @param[out] AvalDiskActions Pointer to fill-out with appropriate disk actions.\r | |
234 | \r | |
235 | **/\r | |
236 | TCG_RESULT\r | |
237 | EFIAPI\r | |
238 | OpalSupportGetAvailableActions(\r | |
239 | IN OPAL_DISK_SUPPORT_ATTRIBUTE *SupportedAttributes,\r | |
240 | IN TCG_LOCKING_FEATURE_DESCRIPTOR *LockingFeature,\r | |
241 | IN UINT16 OwnerShip,\r | |
242 | OUT OPAL_DISK_ACTIONS *AvalDiskActions\r | |
243 | );\r | |
244 | \r | |
245 | /**\r | |
246 | Enable Opal Feature for the input device.\r | |
247 | \r | |
248 | @param[in] Session The opal session for the opal device.\r | |
249 | @param[in] Msid Msid\r | |
250 | @param[in] MsidLength Msid Length\r | |
251 | @param[in] Password Admin password\r | |
252 | @param[in] PassLength Length of password in bytes \r | |
253 | \r | |
254 | **/\r | |
255 | TCG_RESULT\r | |
256 | EFIAPI\r | |
257 | OpalSupportEnableOpalFeature (\r | |
258 | IN OPAL_SESSION *Session,\r | |
259 | IN VOID *Msid,\r | |
260 | IN UINT32 MsidLength,\r | |
261 | IN VOID *Password,\r | |
262 | IN UINT32 PassLength\r | |
263 | );\r | |
264 | \r | |
265 | /**\r | |
266 | Unloads UEFI Driver. Very useful for debugging and testing.\r | |
267 | \r | |
268 | @param ImageHandle Image handle this driver.\r | |
269 | \r | |
270 | @retval EFI_SUCCESS This function always complete successfully.\r | |
271 | @retval EFI_INVALID_PARAMETER The input ImageHandle is not valid.\r | |
272 | **/\r | |
273 | EFI_STATUS\r | |
274 | EFIAPI\r | |
275 | EfiDriverUnload(\r | |
276 | EFI_HANDLE ImageHandle\r | |
277 | );\r | |
278 | \r | |
279 | \r | |
280 | /**\r | |
281 | Test to see if this driver supports Controller.\r | |
282 | \r | |
283 | @param This Protocol instance pointer.\r | |
284 | @param ControllerHandle Handle of device to test\r | |
285 | @param RemainingDevicePath Optional parameter use to pick a specific child\r | |
286 | device to start.\r | |
287 | \r | |
288 | @retval EFI_SUCCESS This driver supports this device.\r | |
289 | @retval EFI_ALREADY_STARTED This driver is already running on this device.\r | |
290 | @retval other This driver does not support this device.\r | |
291 | \r | |
292 | **/\r | |
293 | EFI_STATUS\r | |
294 | EFIAPI\r | |
295 | OpalEfiDriverBindingSupported(\r | |
296 | EFI_DRIVER_BINDING_PROTOCOL* This,\r | |
297 | EFI_HANDLE Controller,\r | |
298 | EFI_DEVICE_PATH_PROTOCOL* RemainingDevicePath\r | |
299 | );\r | |
300 | \r | |
301 | /**\r | |
302 | Enables Opal Management on a supported device if available.\r | |
303 | \r | |
304 | The start function is designed to be called after the Opal UEFI Driver has confirmed the\r | |
305 | "controller", which is a child handle, contains the EF_STORAGE_SECURITY_COMMAND protocols.\r | |
306 | This function will complete the other necessary checks, such as verifying the device supports\r | |
307 | the correct version of Opal. Upon verification, it will add the device to the\r | |
308 | Opal HII list in order to expose Opal managmeent options.\r | |
309 | \r | |
310 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r | |
311 | @param[in] ControllerHandle The handle of the controller to start. This handle\r | |
312 | must support a protocol interface that supplies\r | |
313 | an I/O abstraction to the driver.\r | |
314 | @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This\r | |
315 | parameter is ignored by device drivers, and is optional for bus\r | |
316 | drivers. For a bus driver, if this parameter is NULL, then handles\r | |
317 | for all the children of Controller are created by this driver.\r | |
318 | If this parameter is not NULL and the first Device Path Node is\r | |
319 | not the End of Device Path Node, then only the handle for the\r | |
320 | child device specified by the first Device Path Node of\r | |
321 | RemainingDevicePath is created by this driver.\r | |
322 | If the first Device Path Node of RemainingDevicePath is\r | |
323 | the End of Device Path Node, no child handle is created by this\r | |
324 | driver.\r | |
325 | \r | |
326 | @retval EFI_SUCCESS Opal management was enabled.\r | |
327 | @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.\r | |
328 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r | |
329 | @retval Others The driver failed to start the device.\r | |
330 | \r | |
331 | **/\r | |
332 | EFI_STATUS\r | |
333 | EFIAPI\r | |
334 | OpalEfiDriverBindingStart(\r | |
335 | EFI_DRIVER_BINDING_PROTOCOL* This,\r | |
336 | EFI_HANDLE Controller,\r | |
337 | EFI_DEVICE_PATH_PROTOCOL* RemainingDevicePath\r | |
338 | );\r | |
339 | \r | |
340 | /**\r | |
341 | Stop this driver on Controller.\r | |
342 | \r | |
343 | @param This Protocol instance pointer.\r | |
344 | @param Controller Handle of device to stop driver on\r | |
345 | @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of\r | |
346 | children is zero stop the entire bus driver.\r | |
347 | @param ChildHandleBuffer List of Child Handles to Stop.\r | |
348 | \r | |
349 | @retval EFI_SUCCESS This driver is removed Controller.\r | |
350 | @retval other This driver could not be removed from this device.\r | |
351 | \r | |
352 | **/\r | |
353 | EFI_STATUS\r | |
354 | EFIAPI\r | |
355 | OpalEfiDriverBindingStop(\r | |
356 | EFI_DRIVER_BINDING_PROTOCOL* This,\r | |
357 | EFI_HANDLE Controller,\r | |
358 | UINTN NumberOfChildren,\r | |
359 | EFI_HANDLE* ChildHandleBuffer\r | |
360 | );\r | |
361 | \r | |
362 | /**\r | |
363 | Retrieves a Unicode string that is the user readable name of the driver.\r | |
364 | \r | |
365 | This function retrieves the user readable name of a driver in the form of a\r | |
366 | Unicode string. If the driver specified by This has a user readable name in\r | |
367 | the language specified by Language, then a pointer to the driver name is\r | |
368 | returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r | |
369 | by This does not support the language specified by Language,\r | |
370 | then EFI_UNSUPPORTED is returned.\r | |
371 | \r | |
372 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
373 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
374 | \r | |
375 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
376 | array indicating the language. This is the\r | |
377 | language of the driver name that the caller is\r | |
378 | requesting, and it must match one of the\r | |
379 | languages specified in SupportedLanguages. The\r | |
380 | number of languages supported by a driver is up\r | |
381 | to the driver writer. Language is specified\r | |
382 | in RFC 4646 or ISO 639-2 language code format.\r | |
383 | \r | |
384 | @param DriverName[out] A pointer to the Unicode string to return.\r | |
385 | This Unicode string is the name of the\r | |
386 | driver specified by This in the language\r | |
387 | specified by Language.\r | |
388 | \r | |
389 | @retval EFI_SUCCESS The Unicode string for the Driver specified by\r | |
390 | This and the language specified by Language was\r | |
391 | returned in DriverName.\r | |
392 | \r | |
393 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
394 | \r | |
395 | @retval EFI_INVALID_PARAMETER DriverName is NULL.\r | |
396 | \r | |
397 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
398 | the language specified by Language.\r | |
399 | \r | |
400 | **/\r | |
401 | EFI_STATUS\r | |
402 | EFIAPI\r | |
403 | OpalEfiDriverComponentNameGetDriverName(\r | |
404 | EFI_COMPONENT_NAME_PROTOCOL* This,\r | |
405 | CHAR8* Language,\r | |
406 | CHAR16** DriverName\r | |
407 | );\r | |
408 | \r | |
409 | /**\r | |
410 | Retrieves a Unicode string that is the user readable name of the controller\r | |
411 | that is being managed by a driver.\r | |
412 | \r | |
413 | This function retrieves the user readable name of the controller specified by\r | |
414 | ControllerHandle and ChildHandle in the form of a Unicode string. If the\r | |
415 | driver specified by This has a user readable name in the language specified by\r | |
416 | Language, then a pointer to the controller name is returned in ControllerName,\r | |
417 | and EFI_SUCCESS is returned. If the driver specified by This is not currently\r | |
418 | managing the controller specified by ControllerHandle and ChildHandle,\r | |
419 | then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r | |
420 | support the language specified by Language, then EFI_UNSUPPORTED is returned.\r | |
421 | \r | |
422 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
423 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
424 | \r | |
425 | @param ControllerHandle[in] The handle of a controller that the driver\r | |
426 | specified by This is managing. This handle\r | |
427 | specifies the controller whose name is to be\r | |
428 | returned.\r | |
429 | \r | |
430 | @param ChildHandle[in] The handle of the child controller to retrieve\r | |
431 | the name of. This is an optional parameter that\r | |
432 | may be NULL. It will be NULL for device\r | |
433 | drivers. It will also be NULL for a bus drivers\r | |
434 | that wish to retrieve the name of the bus\r | |
435 | controller. It will not be NULL for a bus\r | |
436 | driver that wishes to retrieve the name of a\r | |
437 | child controller.\r | |
438 | \r | |
439 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
440 | array indicating the language. This is the\r | |
441 | language of the driver name that the caller is\r | |
442 | requesting, and it must match one of the\r | |
443 | languages specified in SupportedLanguages. The\r | |
444 | number of languages supported by a driver is up\r | |
445 | to the driver writer. Language is specified in\r | |
446 | RFC 4646 or ISO 639-2 language code format.\r | |
447 | \r | |
448 | @param ControllerName[out] A pointer to the Unicode string to return.\r | |
449 | This Unicode string is the name of the\r | |
450 | controller specified by ControllerHandle and\r | |
451 | ChildHandle in the language specified by\r | |
452 | Language from the point of view of the driver\r | |
453 | specified by This.\r | |
454 | \r | |
455 | @retval EFI_SUCCESS The Unicode string for the user readable name in\r | |
456 | the language specified by Language for the\r | |
457 | driver specified by This was returned in\r | |
458 | DriverName.\r | |
459 | \r | |
460 | @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r | |
461 | \r | |
462 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r | |
463 | EFI_HANDLE.\r | |
464 | \r | |
465 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
466 | \r | |
467 | @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r | |
468 | \r | |
469 | @retval EFI_UNSUPPORTED The driver specified by This is not currently\r | |
470 | managing the controller specified by\r | |
471 | ControllerHandle and ChildHandle.\r | |
472 | \r | |
473 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
474 | the language specified by Language.\r | |
475 | \r | |
476 | **/\r | |
477 | EFI_STATUS\r | |
478 | EFIAPI\r | |
479 | OpalEfiDriverComponentNameGetControllerName(\r | |
480 | EFI_COMPONENT_NAME_PROTOCOL* This,\r | |
481 | EFI_HANDLE ControllerHandle,\r | |
482 | EFI_HANDLE ChildHandle,\r | |
483 | CHAR8* Language,\r | |
484 | CHAR16** ControllerName\r | |
485 | );\r | |
486 | \r | |
487 | /**\r | |
488 | Retrieves a Unicode string that is the user readable name of the driver.\r | |
489 | \r | |
490 | This function retrieves the user readable name of a driver in the form of a\r | |
491 | Unicode string. If the driver specified by This has a user readable name in\r | |
492 | the language specified by Language, then a pointer to the driver name is\r | |
493 | returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r | |
494 | by This does not support the language specified by Language,\r | |
495 | then EFI_UNSUPPORTED is returned.\r | |
496 | \r | |
497 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
498 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
499 | \r | |
500 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
501 | array indicating the language. This is the\r | |
502 | language of the driver name that the caller is\r | |
503 | requesting, and it must match one of the\r | |
504 | languages specified in SupportedLanguages. The\r | |
505 | number of languages supported by a driver is up\r | |
506 | to the driver writer. Language is specified\r | |
507 | in RFC 4646 or ISO 639-2 language code format.\r | |
508 | \r | |
509 | @param DriverName[out] A pointer to the Unicode string to return.\r | |
510 | This Unicode string is the name of the\r | |
511 | driver specified by This in the language\r | |
512 | specified by Language.\r | |
513 | \r | |
514 | @retval EFI_SUCCESS The Unicode string for the Driver specified by\r | |
515 | This and the language specified by Language was\r | |
516 | returned in DriverName.\r | |
517 | \r | |
518 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
519 | \r | |
520 | @retval EFI_INVALID_PARAMETER DriverName is NULL.\r | |
521 | \r | |
522 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
523 | the language specified by Language.\r | |
524 | \r | |
525 | **/\r | |
526 | EFI_STATUS\r | |
527 | EFIAPI\r | |
528 | OpalEfiDriverComponentName2GetDriverName(\r | |
529 | EFI_COMPONENT_NAME2_PROTOCOL* This,\r | |
530 | CHAR8* Language,\r | |
531 | CHAR16** DriverName\r | |
532 | );\r | |
533 | \r | |
534 | /**\r | |
535 | Retrieves a Unicode string that is the user readable name of the controller\r | |
536 | that is being managed by a driver.\r | |
537 | \r | |
538 | This function retrieves the user readable name of the controller specified by\r | |
539 | ControllerHandle and ChildHandle in the form of a Unicode string. If the\r | |
540 | driver specified by This has a user readable name in the language specified by\r | |
541 | Language, then a pointer to the controller name is returned in ControllerName,\r | |
542 | and EFI_SUCCESS is returned. If the driver specified by This is not currently\r | |
543 | managing the controller specified by ControllerHandle and ChildHandle,\r | |
544 | then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r | |
545 | support the language specified by Language, then EFI_UNSUPPORTED is returned.\r | |
546 | \r | |
547 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
548 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
549 | \r | |
550 | @param ControllerHandle[in] The handle of a controller that the driver\r | |
551 | specified by This is managing. This handle\r | |
552 | specifies the controller whose name is to be\r | |
553 | returned.\r | |
554 | \r | |
555 | @param ChildHandle[in] The handle of the child controller to retrieve\r | |
556 | the name of. This is an optional parameter that\r | |
557 | may be NULL. It will be NULL for device\r | |
558 | drivers. It will also be NULL for a bus drivers\r | |
559 | that wish to retrieve the name of the bus\r | |
560 | controller. It will not be NULL for a bus\r | |
561 | driver that wishes to retrieve the name of a\r | |
562 | child controller.\r | |
563 | \r | |
564 | @param Language[in] A pointer to a Null-terminated ASCII string\r | |
565 | array indicating the language. This is the\r | |
566 | language of the driver name that the caller is\r | |
567 | requesting, and it must match one of the\r | |
568 | languages specified in SupportedLanguages. The\r | |
569 | number of languages supported by a driver is up\r | |
570 | to the driver writer. Language is specified in\r | |
571 | RFC 4646 or ISO 639-2 language code format.\r | |
572 | \r | |
573 | @param ControllerName[out] A pointer to the Unicode string to return.\r | |
574 | This Unicode string is the name of the\r | |
575 | controller specified by ControllerHandle and\r | |
576 | ChildHandle in the language specified by\r | |
577 | Language from the point of view of the driver\r | |
578 | specified by This.\r | |
579 | \r | |
580 | @retval EFI_SUCCESS The Unicode string for the user readable name in\r | |
581 | the language specified by Language for the\r | |
582 | driver specified by This was returned in\r | |
583 | DriverName.\r | |
584 | \r | |
585 | @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r | |
586 | \r | |
587 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r | |
588 | EFI_HANDLE.\r | |
589 | \r | |
590 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
591 | \r | |
592 | @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r | |
593 | \r | |
594 | @retval EFI_UNSUPPORTED The driver specified by This is not currently\r | |
595 | managing the controller specified by\r | |
596 | ControllerHandle and ChildHandle.\r | |
597 | \r | |
598 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
599 | the language specified by Language.\r | |
600 | \r | |
601 | **/\r | |
602 | EFI_STATUS\r | |
603 | EFIAPI\r | |
604 | OpalEfiDriverComponentName2GetControllerName(\r | |
605 | EFI_COMPONENT_NAME2_PROTOCOL* This,\r | |
606 | EFI_HANDLE ControllerHandle,\r | |
607 | EFI_HANDLE ChildHandle,\r | |
608 | CHAR8* Language,\r | |
609 | CHAR16** ControllerName\r | |
610 | );\r | |
611 | \r | |
612 | #endif //_OPAL_DRIVER_H_\r |