/* Convert TRNG status codes to RETURN status codes. */
STATIC RETURN_STATUS TrngStatusToReturnStatus(IN INT32 TrngStatus)
/* Convert TRNG status codes to RETURN status codes. */
STATIC RETURN_STATUS TrngStatusToReturnStatus(IN INT32 TrngStatus)
{
  switch (TrngStatus) {
    case TRNG_STATUS_NOT_SUPPORTED:
      return RETURN_UNSUPPORTED;
    case TRNG_STATUS_INVALID_PARAMETER:
      return RETURN_INVALID_PARAMETER;
    case TRNG_STATUS_NO_ENTROPY:
      return RETURN_NOT_READY;
    case TRNG_STATUS_SUCCESS:
      return RETURN_SUCCESS;
    default:
      if (TrngStatus < 0) {
        return RETURN_UNSUPPORTED;
      }
      return RETURN_SUCCESS;
  }
}