]> git.proxmox.com Git - mirror_edk2.git/blob - SecurityPkg/HddPassword/HddPasswordCommon.h
b904b7d39ed531d1e56740a26bd353cec36a1a3f
[mirror_edk2.git] / SecurityPkg / HddPassword / HddPasswordCommon.h
1 /** @file
2 HDD Password common header file.
3
4 Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
5
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions
8 of the BSD License which accompanies this distribution. The
9 full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 **/
16
17 #ifndef _HDD_PASSWORD_COMMON_H_
18 #define _HDD_PASSWORD_COMMON_H_
19
20 //
21 // The payload length of HDD related ATA commands
22 //
23 #define HDD_PAYLOAD 512
24
25 #define ATA_SECURITY_SET_PASSWORD_CMD 0xF1
26 #define ATA_SECURITY_UNLOCK_CMD 0xF2
27 #define ATA_SECURITY_FREEZE_LOCK_CMD 0xF5
28 #define ATA_SECURITY_DIS_PASSWORD_CMD 0xF6
29
30 //
31 // The max retry count specified in ATA 8 spec.
32 //
33 #define MAX_HDD_PASSWORD_RETRY_COUNT 5
34
35 //
36 // According to ATA spec, the max length of hdd password is 32 bytes
37 //
38 #define HDD_PASSWORD_MAX_LENGTH 32
39
40 #define HDD_PASSWORD_DEVICE_INFO_GUID { 0x96d877ad, 0x48af, 0x4b39, { 0x9b, 0x27, 0x4d, 0x97, 0x43, 0x9, 0xae, 0x47 } }
41
42 typedef struct {
43 UINT8 Bus;
44 UINT8 Device;
45 UINT8 Function;
46 UINT8 Reserved;
47 UINT16 Port;
48 UINT16 PortMultiplierPort;
49 } HDD_PASSWORD_DEVICE;
50
51 //
52 // It will be used to unlock HDD password for S3.
53 //
54 typedef struct {
55 HDD_PASSWORD_DEVICE Device;
56 CHAR8 Password[HDD_PASSWORD_MAX_LENGTH];
57 UINT32 DevicePathLength;
58 EFI_DEVICE_PATH_PROTOCOL DevicePath[];
59 } HDD_PASSWORD_DEVICE_INFO;
60
61 #endif // _HDD_PASSWORD_COMMON_H_