diff options
Diffstat (limited to 'SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.h')
-rw-r--r-- | SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.h | 97 |
1 files changed, 15 insertions, 82 deletions
diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.h b/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.h index 31aab37f5d..5c1719b9b7 100644 --- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.h +++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.h @@ -1,7 +1,7 @@ /** @file
Opal Password PEI driver which is used to unlock Opal Password for S3.
-Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -16,8 +16,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define _OPAL_PASSWORD_PEI_H_
#include <PiPei.h>
-#include <IndustryStandard/Atapi.h>
-#include <IndustryStandard/Pci.h>
#include <Library/DebugLib.h>
#include <Library/IoLib.h>
@@ -27,107 +25,42 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include <Library/MemoryAllocationLib.h>
#include <Library/PeimEntryPoint.h>
#include <Library/PeiServicesLib.h>
-#include <Library/HobLib.h>
-#include <Library/TimerLib.h>
#include <Library/LockBoxLib.h>
#include <Library/TcgStorageOpalLib.h>
#include <Library/Tcg2PhysicalPresenceLib.h>
+#include <Library/PeiServicesTablePointerLib.h>
#include <Protocol/StorageSecurityCommand.h>
#include <Ppi/IoMmu.h>
+#include <Ppi/StorageSecurityCommand.h>
#include "OpalPasswordCommon.h"
-#include "OpalAhciMode.h"
-#include "OpalNvmeMode.h"
-//
-// Time out Value for ATA pass through protocol
-//
-#define ATA_TIMEOUT 30000000
//
-// The payload Length of HDD related ATA commands
-//
-#define HDD_PAYLOAD 512
-//
-// According to ATA spec, the max Length of hdd password is 32 bytes
+// The generic command timeout value (unit in us) for Storage Security Command
+// PPI ReceiveData/SendData services
//
-#define OPAL_PASSWORD_MAX_LENGTH 32
+#define SSC_PPI_GENERIC_TIMEOUT 30000000
#pragma pack(1)
-/**
-* Opal I/O Type utilized by the Trusted IO callback
-*
-* The type indicates if the I/O is a send or receive
-*/
-typedef enum {
- //
- // I/O is a TCG Trusted Send command
- //
- OpalSend,
-
- //
- // I/O is a TCG Trusted Receive command
- //
- OpalRecv
-} OPAL_IO_TYPE;
-
-#define OPAL_PEI_DEVICE_SIGNATURE SIGNATURE_32 ('o', 'p', 'd', 's')
+#define OPAL_PEI_DEVICE_SIGNATURE SIGNATURE_32 ('o', 'p', 'd', 's')
typedef struct {
- UINTN Signature;
- EFI_STORAGE_SECURITY_COMMAND_PROTOCOL Sscp;
- UINT8 DeviceType;
- OPAL_DEVICE_COMMON *Device;
- VOID *Context;
+ UINTN Signature;
+ EFI_STORAGE_SECURITY_COMMAND_PROTOCOL Sscp;
+ OPAL_DEVICE_LOCKBOX_DATA *Device;
+ VOID *Context;
+ EDKII_PEI_STORAGE_SECURITY_CMD_PPI *SscPpi;
+ UINTN DeviceIndex;
} OPAL_PEI_DEVICE;
-#define OPAL_PEI_DEVICE_FROM_THIS(a) CR (a, OPAL_PEI_DEVICE, Sscp, OPAL_PEI_DEVICE_SIGNATURE)
+#define OPAL_PEI_DEVICE_FROM_THIS(a) \
+ CR (a, OPAL_PEI_DEVICE, Sscp, OPAL_PEI_DEVICE_SIGNATURE)
#pragma pack()
-/**
- Allocates pages that are suitable for an OperationBusMasterCommonBuffer or
- OperationBusMasterCommonBuffer64 mapping.
-
- @param Pages The number of pages to allocate.
- @param HostAddress A pointer to store the base system memory address of the
- allocated range.
- @param DeviceAddress The resulting map address for the bus master PCI controller to use to
- access the hosts HostAddress.
- @param Mapping A resulting value to pass to Unmap().
-
- @retval EFI_SUCCESS The requested memory pages were allocated.
- @retval EFI_UNSUPPORTED Attributes is unsupported. The only legal attribute bits are
- MEMORY_WRITE_COMBINE and MEMORY_CACHED.
- @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
- @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated.
-
-**/
-EFI_STATUS
-IoMmuAllocateBuffer (
- IN UINTN Pages,
- OUT VOID **HostAddress,
- OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
- OUT VOID **Mapping
- );
-
-/**
- Frees memory that was allocated with AllocateBuffer().
-
- @param Pages The number of pages to free.
- @param HostAddress The base system memory address of the allocated range.
- @param Mapping The mapping value returned from Map().
-
-**/
-VOID
-IoMmuFreeBuffer (
- IN UINTN Pages,
- IN VOID *HostAddress,
- IN VOID *Mapping
- );
-
#endif // _OPAL_PASSWORD_PEI_H_
|