/* The function performs send, recv, check comIDs, check method status action. */
TCG_RESULT EFIAPI OpalPerformMethod(OPAL_SESSION *Session, UINT32 SendSize, VOID *Buffer, UINT32 BufferSize, TCG_PARSE_STRUCT *ParseStruct, UINT8 *MethodStatus, UINT32 EstimateTimeCost)
/* The function performs send, recv, check comIDs, check method status action. */
TCG_RESULT EFIAPI OpalPerformMethod(OPAL_SESSION *Session, UINT32 SendSize, VOID *Buffer, UINT32 BufferSize, TCG_PARSE_STRUCT *ParseStruct, UINT8 *MethodStatus, UINT32 EstimateTimeCost)
{
  NULL_CHECK (Session);
  NULL_CHECK (MethodStatus);
  ERROR_CHECK (
    OpalTrustedSend (
      Session->Sscp,
      Session->MediaId,
      TCG_OPAL_SECURITY_PROTOCOL_1,
      Session->OpalBaseComId,
      SendSize,
      Buffer,
      BufferSize
      )
    );
  ERROR_CHECK (
    OpalTrustedRecv (
      Session->Sscp,
      Session->MediaId,
      TCG_OPAL_SECURITY_PROTOCOL_1,
      Session->OpalBaseComId,
      Buffer,
      BufferSize,
      EstimateTimeCost
      )
    );
  ERROR_CHECK (TcgInitTcgParseStruct (ParseStruct, Buffer, BufferSize));
  ERROR_CHECK (TcgCheckComIds (ParseStruct, Session->OpalBaseComId, Session->ComIdExtension));
  ERROR_CHECK (TcgGetMethodStatus (ParseStruct, MethodStatus));
  return TcgResultSuccess;
}