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