TcgStorageOpalLibInternal.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /** @file
  2. Internal functions for Opal Core library.
  3. Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef _OPAL_INTERNAL_H_
  7. #define _OPAL_INTERNAL_H_
  8. #include <Library/TcgStorageOpalLib.h>
  9. /**
  10. The function retrieves the MSID from the device specified
  11. @param[in] AdminSpSession OPAL_SESSION with OPAL_UID_ADMIN_SP as OPAL_ADMIN_SP_ANYBODY_AUTHORITY
  12. @param[out] ActiveDataRemovalMechanism Active Data Removal Mechanism that the device will use for Revert/RevertSP calls.
  13. **/
  14. TCG_RESULT
  15. OpalPyrite2GetActiveDataRemovalMechanism (
  16. OPAL_SESSION *AdminSpSession,
  17. UINT8 *ActiveDataRemovalMechanism
  18. );
  19. /**
  20. Get the support attribute info.
  21. @param[in] Session OPAL_SESSION with OPAL_UID_LOCKING_SP to retrieve info.
  22. @param[in] FeatureCode The feature code user request.
  23. @param[in, out] DataSize The data size.
  24. @param[out] Data The data buffer used to save the feature descriptor.
  25. **/
  26. TCG_RESULT
  27. OpalGetFeatureDescriptor (
  28. IN OPAL_SESSION *Session,
  29. IN UINT16 FeatureCode,
  30. IN OUT UINTN *DataSize,
  31. OUT VOID *Data
  32. );
  33. /**
  34. Get revert timeout value.
  35. @param[in] Session The session info for one opal device.
  36. **/
  37. UINT32
  38. GetRevertTimeOut (
  39. IN OPAL_SESSION *Session
  40. );
  41. /**
  42. Reverts device using Admin SP Revert method.
  43. @param[in] AdminSpSession OPAL_SESSION with OPAL_UID_ADMIN_SP as OPAL_ADMIN_SP_PSID_AUTHORITY to perform PSID revert.
  44. @param[in] EstimateTimeCost Input the timeout value.
  45. **/
  46. TCG_RESULT
  47. OpalPyrite2PsidRevert (
  48. OPAL_SESSION *AdminSpSession,
  49. UINT32 EstimateTimeCost
  50. );
  51. /**
  52. The function calls the Admin SP RevertSP method on the Locking SP. If KeepUserData is True, then the optional parameter
  53. to keep the user Data is set to True, otherwise the optional parameter is not provided.
  54. @param[in] LockingSpSession OPAL_SESSION with OPAL_UID_LOCKING_SP as OPAL_LOCKING_SP_ADMIN1_AUTHORITY to revertSP
  55. @param[in] KeepUserData Specifies whether or not to keep user Data when performing RevertSP action. True = keeps user Data.
  56. @param[in/out] MethodStatus Method status of last action performed. If action succeeded, it should be TCG_METHOD_STATUS_CODE_SUCCESS.
  57. @param[in] EstimateTimeCost Input the timeout value.
  58. **/
  59. TCG_RESULT
  60. OpalPyrite2AdminRevert (
  61. OPAL_SESSION *LockingSpSession,
  62. BOOLEAN KeepUserData,
  63. UINT8 *MethodStatus,
  64. UINT32 EstimateTimeCost
  65. );
  66. #endif // _OPAL_CORE_H_