]> git.proxmox.com Git - mirror_edk2.git/blame - SecurityPkg/HddPassword/HddPasswordCommon.h
SecurityPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / SecurityPkg / HddPassword / HddPasswordCommon.h
CommitLineData
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
289b714b 6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
e8959f81
HW
7\r
8**/\r
9\r
10#ifndef _HDD_PASSWORD_COMMON_H_\r
11#define _HDD_PASSWORD_COMMON_H_\r
12\r
13//\r
14// The payload length of HDD related ATA commands\r
15//\r
16#define HDD_PAYLOAD 512\r
17\r
18#define ATA_SECURITY_SET_PASSWORD_CMD 0xF1\r
19#define ATA_SECURITY_UNLOCK_CMD 0xF2\r
20#define ATA_SECURITY_FREEZE_LOCK_CMD 0xF5\r
21#define ATA_SECURITY_DIS_PASSWORD_CMD 0xF6\r
22\r
23//\r
24// The max retry count specified in ATA 8 spec.\r
25//\r
26#define MAX_HDD_PASSWORD_RETRY_COUNT 5\r
27\r
28//\r
29// According to ATA spec, the max length of hdd password is 32 bytes\r
30//\r
31#define HDD_PASSWORD_MAX_LENGTH 32\r
32\r
33#define HDD_PASSWORD_DEVICE_INFO_GUID { 0x96d877ad, 0x48af, 0x4b39, { 0x9b, 0x27, 0x4d, 0x97, 0x43, 0x9, 0xae, 0x47 } }\r
34\r
35typedef struct {\r
36 UINT8 Bus;\r
37 UINT8 Device;\r
38 UINT8 Function;\r
39 UINT8 Reserved;\r
40 UINT16 Port;\r
41 UINT16 PortMultiplierPort;\r
42} HDD_PASSWORD_DEVICE;\r
43\r
44//\r
45// It will be used to unlock HDD password for S3.\r
46//\r
47typedef struct {\r
48 HDD_PASSWORD_DEVICE Device;\r
49 CHAR8 Password[HDD_PASSWORD_MAX_LENGTH];\r
50 UINT32 DevicePathLength;\r
51 EFI_DEVICE_PATH_PROTOCOL DevicePath[];\r
52} HDD_PASSWORD_DEVICE_INFO;\r
53\r
54#endif // _HDD_PASSWORD_COMMON_H_\r