// Copyright (c) Qualcomm Technologies, Inc. 
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.

//-------------------------------------------------------------------
// Interface to send TPM commands to WinSecApp
//------------------------------------------------------------------
/** @cond */
interface ITPM {
/** @endcond */

  /**
   * @addtogroup ITPM
   * @{
   */

  /** @cond */
  const int32 MAX_REQ_BUFF_SIZE = 0x1000;   //4KB
  const int32 MAX_RSP_BUFF_SIZE = 0x1000;   //4KB

  const uint8 FLUSH_PENDING_TRUE = 1;
  const uint8 FLUSH_PENDING_FALSE = 0;
  /** @endcond */

  /**
    Sends TPM command to TpmApp.

    @param[in]  locality   Locality for the command (4 < locality < 32).
    @param[in]  reqBuffer  Request buffer containing command.
    @param[out] rspBuffer  Response buffer.

    @return
    Object_OK on success.
  */
  method SendTPMCommand(in uint8 locality, in buffer reqBuffer, out buffer rspBuffer);

  /**
    Returns status of NV Flush to storage.

    @param[out] flushPending 1 if NV flush is pending. \n
                             0 if NV has been flushed.

    @return
    Object_OK on success.
  */
  method CheckNVFlushState(out uint8 flushPending);

/**
    Sends TPM _TPM_HASH_START command.

    @return
    Object_OK on success.
  */
  method TpmHashStart();

/**
    Sends TPM _TPM_HASH_DATA command.

    @param[in]  data  data to be hashed.

    @return
    Object_OK on success.
  */
  method TpmHashData( in buffer data );

/**
    Sends TPM _TPM_HASH_END command.

    @return
    Object_OK on success.
  */
  method TpmHashEnd();


/**
    Sends TPM check locality command.

    @return
    Object_OK on success which means no active locality of 0,1,2,3
  */
  method TpmCheckLocality();

   /**

    get tpm control area address

    @param[out] addr: pointer to tpm control area address 

    @return
    Object_OK on success.
  */
  method GetControlAreadAddr( out uint64 addr );

  /* @} */ /* end_addtogroup ITPM */
};


