TianoCore EDK2 master
|
Go to the source code of this file.
Variables | |
EFI_GUID | mOpalDeviceLockBoxGuid = OPAL_DEVICE_LOCKBOX_GUID |
BOOLEAN | mOpalEndOfDxe = FALSE |
OPAL_REQUEST_VARIABLE * | mOpalRequestVariable = NULL |
UINTN | mOpalRequestVariableSize = 0 |
CHAR16 | mPopUpString [100] |
OPAL_DRIVER | mOpalDriver |
EFI_DRIVER_BINDING_PROTOCOL | gOpalDriverBinding |
Entrypoint of Opal UEFI Driver and contains all the logic to register for new Opal device instances.
Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file OpalDriver.c.
VOID AddDeviceToTail | ( | IN OPAL_DRIVER_DEVICE * | Dev | ) |
Add new device to the global device list.
Dev | New create device. |
Definition at line 2295 of file OpalDriver.c.
VOID BuildOpalDeviceInfo | ( | VOID | ) |
Build OPAL device info and save them to LockBox.
Definition at line 288 of file OpalDriver.c.
EFI_STATUS EFIAPI EfiDriverEntryPoint | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Main entry for this driver.
ImageHandle | Image Handle this driver. |
SystemTable | Pointer to SystemTable. |
EFI_SUCCESS | This function always complete successfully. |
Definition at line 2639 of file OpalDriver.c.
VOID ExtractDeviceInfoFromDevicePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath, |
OUT UINT32 * | DevInfoLength, | ||
OUT OPAL_DEVICE_LOCKBOX_DATA *DevInfo | OPTIONAL | ||
) |
Extract device info from the device path.
[in] | DevicePath | Device path info for the device. |
[out] | DevInfoLength | Device information length needed. |
[out] | DevInfo | Device information extracted. |
Definition at line 208 of file OpalDriver.c.
UINT8 GetDeviceCount | ( | VOID | ) |
Get current device count.
return | the current created device count. |
Definition at line 2351 of file OpalDriver.c.
OPAL_DRIVER_DEVICE * OpalDriverGetDeviceList | ( | VOID | ) |
Get devcie list info.
return | the device list pointer. |
Definition at line 2375 of file OpalDriver.c.
BOOLEAN OpalDriverGetDeviceNameByProtocol | ( | EFI_HANDLE * | AllHandlesBuffer, |
UINTN | NumAllHandles, | ||
OPAL_DRIVER_DEVICE * | Dev, | ||
BOOLEAN | UseComp1 | ||
) |
Get devcie name through the component name protocol.
[in] | AllHandlesBuffer | The handle buffer for current system. |
[in] | NumAllHandles | The number of handles for the handle buffer. |
[in] | Dev | The device which need to get name. |
[in] | UseComp1 | Whether use component name or name2 protocol. |
TRUE | Find the name for this device. |
FALSE | Not found the name for this device. |
Definition at line 2436 of file OpalDriver.c.
BOOLEAN OpalDriverGetDriverDeviceName | ( | OPAL_DRIVER_DEVICE * | Dev | ) |
Get devcie name through the component name protocol.
[in] | Dev | The device which need to get name. |
TRUE | Find the name for this device. |
FALSE | Not found the name for this device. |
Definition at line 2581 of file OpalDriver.c.
CHAR8 * OpalDriverPopUpPasswordInput | ( | IN OPAL_DRIVER_DEVICE * | Dev, |
IN CHAR16 * | PopUpString1, | ||
IN CHAR16 * | PopUpString2, | ||
IN CHAR16 * | PopUpString3, | ||
OUT BOOLEAN * | PressEsc | ||
) |
Get password input from the popup window.
[in] | Dev | The device which need password to unlock or process OPAL request. |
[in] | PopUpString1 | Pop up string 1. |
[in] | PopUpString2 | Pop up string 2. |
[in] | PopUpString3 | Pop up string 3. |
[out] | PressEsc | Whether user escape function through Press ESC. |
Password | string if success. NULL if failed. |
Definition at line 708 of file OpalDriver.c.
CHAR8 * OpalDriverPopUpPsidInput | ( | IN OPAL_DRIVER_DEVICE * | Dev, |
IN CHAR16 * | PopUpString, | ||
IN CHAR16 * | PopUpString2, | ||
IN CHAR16 * | PopUpString3, | ||
OUT BOOLEAN * | PressEsc | ||
) |
Get Psid input from the popup window.
[in] | Dev | The device which need Psid to process Psid Revert OPAL request. |
[in] | PopUpString | Pop up string. |
[in] | PopUpString2 | Pop up string in line 2. |
[in] | PopUpString3 | Pop up string in line 3. |
[out] | PressEsc | Whether user escape function through Press ESC. |
Psid | string if success. NULL if failed. |
Definition at line 556 of file OpalDriver.c.
VOID OpalDriverRequestPassword | ( | IN OPAL_DRIVER_DEVICE * | Dev, |
IN CHAR16 * | RequestString | ||
) |
Check if disk is locked, show popup window and ask for password if it is.
[in] | Dev | The device which need to be unlocked. |
[in] | RequestString | Request string. |
Definition at line 875 of file OpalDriver.c.
VOID OpalDriverStopDevice | ( | OPAL_DRIVER_DEVICE * | Dev | ) |
Stop this Controller.
Dev | The device need to be stopped. |
Definition at line 2389 of file OpalDriver.c.
EFI_STATUS EFIAPI OpalEfiDriverBindingStart | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | Controller, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | RemainingDevicePath | ||
) |
Enables Opal Management on a supported device if available.
The start function is designed to be called after the Opal UEFI Driver has confirmed the "controller", which is a child Handle, contains the EF_STORAGE_SECURITY_COMMAND protocols. This function will complete the other necessary checks, such as verifying the device supports the correct version of Opal. Upon verification, it will add the device to the Opal HII list in order to expose Opal management options.
[in] | This | A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance. |
[in] | ControllerHandle | The Handle of the controller to start. This Handle must support a protocol interface that supplies an I/O abstraction to the driver. |
[in] | RemainingDevicePath | A pointer to the remaining portion of a device path. This parameter is ignored by device drivers, and is optional for bus drivers. For a bus driver, if this parameter is NULL, then handles for all the children of Controller are created by this driver. If this parameter is not NULL and the first Device Path Node is not the End of Device Path Node, then only the Handle for the child device specified by the first Device Path Node of RemainingDevicePath is created by this driver. If the first Device Path Node of RemainingDevicePath is the End of Device Path Node, no child Handle is created by this driver. |
EFI_SUCCESS | Opal management was enabled. |
EFI_DEVICE_ERROR | The device could not be started due to a device error.Currently not implemented. |
EFI_OUT_OF_RESOURCES | The request could not be completed due to a lack of resources. |
Others | The driver failed to start the device. |
Definition at line 2790 of file OpalDriver.c.
EFI_STATUS EFIAPI OpalEfiDriverBindingStop | ( | EFI_DRIVER_BINDING_PROTOCOL * | This, |
EFI_HANDLE | Controller, | ||
UINTN | NumberOfChildren, | ||
EFI_HANDLE * | ChildHandleBuffer | ||
) |
Stop this driver on Controller.
This | Protocol instance pointer. |
Controller | Handle of device to stop driver on |
NumberOfChildren | Number of Handles in ChildHandleBuffer. If number of children is zero stop the entire bus driver. |
ChildHandleBuffer | List of Child Handles to Stop. |
EFI_SUCCESS | This driver is removed Controller. |
other | This driver could not be removed from this device. |
Definition at line 2947 of file OpalDriver.c.
EFI_STATUS EFIAPI OpalEfiDriverBindingSupported | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
IN EFI_HANDLE | Controller, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | RemainingDevicePath | ||
) |
Tests to see if this driver supports a given controller.
This function checks to see if the controller contains an instance of the EFI_STORAGE_SECURITY_COMMAND_PROTOCOL and the EFI_BLOCK_IO_PROTOCOL and returns EFI_SUCCESS if it does.
[in] | This | A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance. |
[in] | ControllerHandle | The Handle of the controller to test. This Handle must support a protocol interface that supplies an I/O abstraction to the driver. |
[in] | RemainingDevicePath | This parameter is ignored. |
EFI_SUCCESS | The device contains required protocols |
EFI_ALREADY_STARTED | The device specified by ControllerHandle and RemainingDevicePath is already being managed by the driver specified by This. |
EFI_ACCESS_DENIED | The device specified by ControllerHandle and RemainingDevicePath is already being managed by a different driver or an application that requires exclusive access. Currently not implemented. |
EFI_UNSUPPORTED | The device does not contain requires protocols |
Definition at line 2711 of file OpalDriver.c.
EFI_STATUS EFIAPI OpalEfiDriverUnload | ( | IN EFI_HANDLE | ImageHandle | ) |
Unloads UEFI Driver. Very useful for debugging and testing.
ImageHandle | Image Handle this driver. |
EFI_SUCCESS | This function always complete successfully. |
EFI_INVALID_PARAMETER | The input ImageHandle is not valid. |
Definition at line 2983 of file OpalDriver.c.
VOID EFIAPI OpalEndOfDxeEventNotify | ( | EFI_EVENT | Event, |
VOID * | Context | ||
) |
Notification function of EFI_END_OF_DXE_EVENT_GROUP_GUID event group.
This is a notification function registered on EFI_END_OF_DXE_EVENT_GROUP_GUID event group.
Event | Event whose notification function is being invoked. |
Context | Pointer to the notification function's context. |
Definition at line 491 of file OpalDriver.c.
CHAR16 * OpalGetPopUpString | ( | IN OPAL_DRIVER_DEVICE * | Dev, |
IN CHAR16 * | RequestString | ||
) |
Get pop up string.
[in] | Dev | The OPAL device. |
[in] | RequestString | Request string. |
Definition at line 853 of file OpalDriver.c.
TCG_RESULT EFIAPI OpalSupportEnableOpalFeature | ( | IN OPAL_SESSION * | Session, |
IN VOID * | Msid, | ||
IN UINT32 | MsidLength, | ||
IN VOID * | Password, | ||
IN UINT32 | PassLength | ||
) |
Enable Opal Feature for the input device.
[in] | Session | The opal session for the opal device. |
[in] | Msid | Msid |
[in] | MsidLength | Msid Length |
[in] | Password | Admin password |
[in] | PassLength | Length of password in bytes |
Definition at line 138 of file OpalDriver.c.
TCG_RESULT EFIAPI OpalSupportGetAvailableActions | ( | IN OPAL_DISK_SUPPORT_ATTRIBUTE * | SupportedAttributes, |
IN TCG_LOCKING_FEATURE_DESCRIPTOR * | LockingFeature, | ||
IN UINT16 | OwnerShip, | ||
OUT OPAL_DISK_ACTIONS * | AvalDiskActions | ||
) |
The function determines the available actions for the OPAL_DISK provided.
[in] | SupportedAttributes | The supported attributes for the device. |
[in] | LockingFeature | The locking status for the device. |
[in] | OwnerShip | The ownership for the device. |
[out] | AvalDiskActions | Pointer to fill-out with appropriate disk actions. |
Definition at line 51 of file OpalDriver.c.
VOID OpalSupportUpdatePassword | ( | IN OUT OPAL_DISK * | OpalDisk, |
IN VOID * | Password, | ||
IN UINT32 | PasswordLength | ||
) |
Update password for the Opal disk.
[in,out] | OpalDisk | The disk to update password. |
[in] | Password | The input password. |
[in] | PasswordLength | The input password length. |
Definition at line 189 of file OpalDriver.c.
VOID ProcessOpalRequest | ( | IN OPAL_DRIVER_DEVICE * | Dev | ) |
Process OPAL request.
[in] | Dev | The device which has OPAL request. |
Definition at line 2175 of file OpalDriver.c.
VOID ProcessOpalRequestDisableUser | ( | IN OPAL_DRIVER_DEVICE * | Dev, |
IN CHAR16 * | RequestString | ||
) |
Process Disable User OPAL request.
[in] | Dev | The device which has Disable User OPAL request. |
[in] | RequestString | Request string. |
Definition at line 1211 of file OpalDriver.c.
VOID ProcessOpalRequestEnableFeature | ( | IN OPAL_DRIVER_DEVICE * | Dev, |
IN CHAR16 * | RequestString | ||
) |
Process Enable Feature OPAL request.
[in] | Dev | The device which has Enable Feature OPAL request. |
[in] | RequestString | Request string. |
Definition at line 1061 of file OpalDriver.c.
VOID ProcessOpalRequestPsidRevert | ( | IN OPAL_DRIVER_DEVICE * | Dev, |
IN CHAR16 * | RequestString | ||
) |
Process Psid Revert OPAL request.
[in] | Dev | The device which has Psid Revert OPAL request. |
[in] | RequestString | Request string. |
Definition at line 1325 of file OpalDriver.c.
VOID ProcessOpalRequestRevert | ( | IN OPAL_DRIVER_DEVICE * | Dev, |
IN BOOLEAN | KeepUserData, | ||
IN CHAR16 * | RequestString | ||
) |
Process Admin Revert OPAL request.
[in] | Dev | The device which has Revert OPAL request. |
[in] | KeepUserData | Whether to keep user data or not. |
[in] | RequestString | Request string. |
Definition at line 1462 of file OpalDriver.c.
VOID ProcessOpalRequestSecureErase | ( | IN OPAL_DRIVER_DEVICE * | Dev, |
IN CHAR16 * | RequestString | ||
) |
Process Secure Erase OPAL request.
[in] | Dev | The device which has Secure Erase OPAL request. |
[in] | RequestString | Request string. |
Definition at line 1631 of file OpalDriver.c.
VOID ProcessOpalRequestSetAdminPwd | ( | IN OPAL_DRIVER_DEVICE * | Dev, |
IN CHAR16 * | RequestString | ||
) |
Process Set Admin Pwd OPAL request.
[in] | Dev | The device which has Set Admin Pwd Feature OPAL request. |
[in] | RequestString | Request string. |
Definition at line 1975 of file OpalDriver.c.
VOID ProcessOpalRequestSetUserPwd | ( | IN OPAL_DRIVER_DEVICE * | Dev, |
IN CHAR16 * | RequestString | ||
) |
Process Set Admin Pwd OPAL request.
[in] | Dev | The device which has Set Admin Pwd Feature OPAL request. |
[in] | RequestString | Request string. |
Definition at line 1769 of file OpalDriver.c.
VOID RemoveDevice | ( | IN OPAL_DRIVER_DEVICE * | Dev | ) |
Remove one device in the global device list.
Dev | The device need to be removed. |
Definition at line 2320 of file OpalDriver.c.
VOID SendBlockSidCommand | ( | VOID | ) |
Send BlockSid command if needed.
Definition at line 440 of file OpalDriver.c.
EFI_DRIVER_BINDING_PROTOCOL gOpalDriverBinding |
Definition at line 30 of file OpalDriver.c.
EFI_GUID mOpalDeviceLockBoxGuid = OPAL_DEVICE_LOCKBOX_GUID |
Definition at line 18 of file OpalDriver.c.
OPAL_DRIVER mOpalDriver |
Definition at line 25 of file OpalDriver.c.
BOOLEAN mOpalEndOfDxe = FALSE |
Definition at line 20 of file OpalDriver.c.
OPAL_REQUEST_VARIABLE* mOpalRequestVariable = NULL |
Definition at line 21 of file OpalDriver.c.
UINTN mOpalRequestVariableSize = 0 |
Definition at line 22 of file OpalDriver.c.
CHAR16 mPopUpString[100] |
Definition at line 23 of file OpalDriver.c.