]> git.proxmox.com Git - mirror_edk2.git/blob - SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.h
SecurityPkg/OpalPassword: Add PCD to skip password prompt
[mirror_edk2.git] / SecurityPkg / Tcg / Opal / OpalPassword / OpalPasswordPei.h
1 /** @file
2 Opal Password PEI driver which is used to unlock Opal Password for S3.
3
4 Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #ifndef _OPAL_PASSWORD_PEI_H_
10 #define _OPAL_PASSWORD_PEI_H_
11
12 #include <PiPei.h>
13
14 #include <Library/DebugLib.h>
15 #include <Library/IoLib.h>
16 #include <Library/PciLib.h>
17 #include <Library/BaseLib.h>
18 #include <Library/BaseMemoryLib.h>
19 #include <Library/MemoryAllocationLib.h>
20 #include <Library/PeimEntryPoint.h>
21 #include <Library/PeiServicesLib.h>
22 #include <Library/LockBoxLib.h>
23 #include <Library/TcgStorageOpalLib.h>
24 #include <Library/Tcg2PhysicalPresenceLib.h>
25 #include <Library/PeiServicesTablePointerLib.h>
26
27 #include <Protocol/StorageSecurityCommand.h>
28
29 #include <Ppi/IoMmu.h>
30 #include <Ppi/StorageSecurityCommand.h>
31
32 #include "OpalPasswordCommon.h"
33
34
35 //
36 // The generic command timeout value (unit in us) for Storage Security Command
37 // PPI ReceiveData/SendData services
38 //
39 #define SSC_PPI_GENERIC_TIMEOUT 30000000
40
41 #pragma pack(1)
42
43 #define OPAL_PEI_DEVICE_SIGNATURE SIGNATURE_32 ('o', 'p', 'd', 's')
44
45 typedef struct {
46 UINTN Signature;
47 EFI_STORAGE_SECURITY_COMMAND_PROTOCOL Sscp;
48 OPAL_DEVICE_LOCKBOX_DATA *Device;
49 VOID *Context;
50 EDKII_PEI_STORAGE_SECURITY_CMD_PPI *SscPpi;
51 UINTN DeviceIndex;
52 } OPAL_PEI_DEVICE;
53
54 #define OPAL_PEI_DEVICE_FROM_THIS(a) \
55 CR (a, OPAL_PEI_DEVICE, Sscp, OPAL_PEI_DEVICE_SIGNATURE)
56
57 #pragma pack()
58
59 #endif // _OPAL_PASSWORD_PEI_H_
60