106 lines
6.3 KiB
C
106 lines
6.3 KiB
C
/**********************************************************************************************************************
|
|
* COPYRIGHT
|
|
* -------------------------------------------------------------------------------------------------------------------
|
|
* \verbatim
|
|
* Copyright (c) 2025 by Vector Informatik GmbH. All rights reserved.
|
|
*
|
|
* This software is copyright protected and proprietary to Vector Informatik GmbH.
|
|
* Vector Informatik GmbH grants to you only those rights as set out in the license conditions.
|
|
* All other rights remain with Vector Informatik GmbH.
|
|
* \endverbatim
|
|
* -------------------------------------------------------------------------------------------------------------------
|
|
* FILE DESCRIPTION
|
|
* -----------------------------------------------------------------------------------------------------------------*/
|
|
/*! \file Crypto_30_vHsm_Private.h
|
|
* \brief MICROSAR vHsm Crypto Driver (Crypto)
|
|
*
|
|
* \details Private declarations for the module.
|
|
*
|
|
*********************************************************************************************************************/
|
|
|
|
/**********************************************************************************************************************
|
|
* REVISION HISTORY
|
|
* -------------------------------------------------------------------------------------------------------------------
|
|
* Refer to the module's header file.
|
|
*********************************************************************************************************************/
|
|
|
|
#if !defined (CRYPTO_30_VHSM_PRIVATE_H)
|
|
# define CRYPTO_30_VHSM_PRIVATE_H
|
|
|
|
/**********************************************************************************************************************
|
|
* INCLUDES
|
|
*********************************************************************************************************************/
|
|
# include "Crypto_30_vHsm_Cfg.h"
|
|
|
|
/**********************************************************************************************************************
|
|
* GLOBAL CONSTANT MACROS
|
|
*********************************************************************************************************************/
|
|
|
|
/**********************************************************************************************************************
|
|
* GLOBAL FUNCTION MACROS
|
|
*********************************************************************************************************************/
|
|
|
|
/**********************************************************************************************************************
|
|
* GLOBAL DATA TYPES AND STRUCTURES
|
|
*********************************************************************************************************************/
|
|
|
|
/**********************************************************************************************************************
|
|
* GLOBAL DATA PROTOTYPES
|
|
*********************************************************************************************************************/
|
|
|
|
/**********************************************************************************************************************
|
|
* GLOBAL FUNCTION PROTOTYPES
|
|
*********************************************************************************************************************/
|
|
# define CRYPTO_30_VHSM_START_SEC_CODE
|
|
# include "Crypto_30_vHsm_MemMap.h" /* PRQA S 5087 */ /* MD_MSR_MemMap */
|
|
|
|
# if (CRYPTO_30_VHSM_TIMEOUT_RECOVERY == STD_ON)
|
|
/**********************************************************************************************************************
|
|
* Crypto_30_vHsm_HandleTimeout()
|
|
*********************************************************************************************************************/
|
|
/*!
|
|
* \brief Poll all timeouted Ipc job requests for an answer of the Hsm.
|
|
* \details -
|
|
* \param[in] partitionIdx The currently active partition index
|
|
* \pre -
|
|
* \context TASK, ISR2
|
|
* \reentrant FALSE
|
|
* \synchronous TRUE
|
|
*********************************************************************************************************************/
|
|
FUNC(void, CRYPTO_30_VHSM_CODE) Crypto_30_vHsm_HandleTimeout(Crypto_30_vHsm_PartitionIdentifiersIterType partitionIdx);
|
|
|
|
/**********************************************************************************************************************
|
|
* Crypto_30_vHsm_RecoverFromTimeout()
|
|
*********************************************************************************************************************/
|
|
/*!
|
|
* \brief Frees the Ipc channel of the jobRequestId. Also tries to recover the jobRequest.
|
|
* \details Can be callout by inside the loop callout by the user when a timeout is detected.
|
|
* \param[in] partitionIdx The currently active partition index
|
|
* \param[in] jobRequestId The Id of the timeouted jobRequest
|
|
* \param[in] writeIdx The writeIdx of the Hsm response
|
|
* \param[in] jobResponseData Data containing concatenated information of the job response like the retval and state
|
|
* \param[in] jobResponseBuffer Valid job response buffer with at least CRYPTO_30_VHSM_CRYPTO_JOBRESULTTYPE_DESERIALIZED_BUF_SIZE bytes of storage
|
|
* \pre Crypto_30_vHsm_SetChannelOfJobRequest has to have been called for the same jobRequestId.
|
|
* \context TASK, ISR2
|
|
* \reentrant FALSE
|
|
* \synchronous TRUE
|
|
*********************************************************************************************************************/
|
|
FUNC(void, CRYPTO_30_VHSM_CODE) Crypto_30_vHsm_RecoverFromTimeout(
|
|
Crypto_30_vHsm_PartitionIdentifiersIterType partitionIdx,
|
|
Crypto_30_vHsm_JobRequestIterType jobRequestId,
|
|
uint32 writeIdx,
|
|
# if (CRYPTO_30_VHSM_IPC_PROTOCOL_VERSION == 3u)
|
|
uint32 jobResponseData,
|
|
# endif
|
|
Crypto_30_vHsm_JobResponseBufferPtrType jobResponseBuffer);
|
|
# endif /* (CRYPTO_30_VHSM_TIMEOUT_RECOVERY == STD_ON) */
|
|
|
|
# define CRYPTO_30_VHSM_STOP_SEC_CODE
|
|
# include "Crypto_30_vHsm_MemMap.h" /* PRQA S 5087 */ /* MD_MSR_MemMap */
|
|
|
|
#endif /* !defined (CRYPTO_30_VHSM_PRIVATE_H) */
|
|
|
|
/**********************************************************************************************************************
|
|
* END OF FILE: Crypto_30_vHsm_Private.h
|
|
*********************************************************************************************************************/
|