]> git.proxmox.com Git - mirror_edk2.git/blob - SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordCommon.h
e10146e46619a8b5e1f388531e565c4055828e0e
[mirror_edk2.git] / SecurityPkg / Tcg / Opal / OpalPassword / OpalPasswordCommon.h
1 /** @file
2 Opal Password common header file.
3
4 Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef _OPAL_PASSWORD_COMMON_H_
16 #define _OPAL_PASSWORD_COMMON_H_
17
18 #define OPAL_MAX_PASSWORD_SIZE 32
19
20 #define OPAL_DEVICE_TYPE_UNKNOWN 0x0
21 #define OPAL_DEVICE_TYPE_ATA 0x1
22 #define OPAL_DEVICE_TYPE_NVME 0x2
23
24 typedef struct {
25 UINT16 Segment;
26 UINT8 Bus;
27 UINT8 Device;
28 UINT8 Function;
29 UINT8 Reserved;
30 } OPAL_PCI_DEVICE;
31
32 typedef struct {
33 UINT16 Length;
34 OPAL_PCI_DEVICE Device;
35 UINT8 PasswordLength;
36 UINT8 Password[OPAL_MAX_PASSWORD_SIZE];
37 UINT16 OpalBaseComId;
38 UINT32 BarAddr;
39 } OPAL_DEVICE_COMMON;
40
41 #define OPAL_DEVICE_ATA_GUID { 0xcb934fe1, 0xb8cd, 0x46b1, { 0xa0, 0x58, 0xdd, 0xcb, 0x7, 0xb7, 0xb4, 0x17 } }
42
43 typedef struct {
44 UINT16 Length;
45 OPAL_PCI_DEVICE Device;
46 UINT8 PasswordLength;
47 UINT8 Password[OPAL_MAX_PASSWORD_SIZE];
48 UINT16 OpalBaseComId;
49 UINT32 BarAddr;
50 UINT16 Port;
51 UINT16 PortMultiplierPort;
52 } OPAL_DEVICE_ATA;
53
54 #define OPAL_DEVICE_NVME_GUID { 0xde116925, 0xaf7f, 0x42d9, { 0x83, 0xc0, 0x7e, 0xd6, 0x26, 0x59, 0x0, 0xfb } }
55
56 typedef struct {
57 UINT16 Length;
58 OPAL_PCI_DEVICE Device;
59 UINT8 PasswordLength;
60 UINT8 Password[OPAL_MAX_PASSWORD_SIZE];
61 UINT16 OpalBaseComId;
62 UINT32 BarAddr;
63 UINT32 NvmeNamespaceId;
64 OPAL_PCI_DEVICE PciBridgeNode[0];
65 } OPAL_DEVICE_NVME;
66
67 #endif // _OPAL_PASSWORD_COMMON_H_