HddPasswordCommon.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /** @file
  2. HDD Password common header file.
  3. Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef _HDD_PASSWORD_COMMON_H_
  7. #define _HDD_PASSWORD_COMMON_H_
  8. //
  9. // The payload length of HDD related ATA commands
  10. //
  11. #define HDD_PAYLOAD 512
  12. #define ATA_SECURITY_SET_PASSWORD_CMD 0xF1
  13. #define ATA_SECURITY_UNLOCK_CMD 0xF2
  14. #define ATA_SECURITY_FREEZE_LOCK_CMD 0xF5
  15. #define ATA_SECURITY_DIS_PASSWORD_CMD 0xF6
  16. //
  17. // The max retry count specified in ATA 8 spec.
  18. //
  19. #define MAX_HDD_PASSWORD_RETRY_COUNT 5
  20. //
  21. // According to ATA spec, the max length of hdd password is 32 bytes
  22. //
  23. #define HDD_PASSWORD_MAX_LENGTH 32
  24. #define HDD_PASSWORD_DEVICE_INFO_GUID { 0x96d877ad, 0x48af, 0x4b39, { 0x9b, 0x27, 0x4d, 0x97, 0x43, 0x9, 0xae, 0x47 } }
  25. typedef struct {
  26. UINT8 Bus;
  27. UINT8 Device;
  28. UINT8 Function;
  29. UINT8 Reserved;
  30. UINT16 Port;
  31. UINT16 PortMultiplierPort;
  32. } HDD_PASSWORD_DEVICE;
  33. //
  34. // It will be used to unlock HDD password for S3.
  35. //
  36. typedef struct {
  37. HDD_PASSWORD_DEVICE Device;
  38. CHAR8 Password[HDD_PASSWORD_MAX_LENGTH];
  39. UINT32 DevicePathLength;
  40. EFI_DEVICE_PATH_PROTOCOL DevicePath[];
  41. } HDD_PASSWORD_DEVICE_INFO;
  42. #endif // _HDD_PASSWORD_COMMON_H_