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