XilinxProcessorIPLib/drivers/hdcp22_rx_dp/src/xhdcp22_rx.c
static void XHdcp22Rx_ResetAfterError(XHdcp22_Rx *InstancePtr)
{
	/* Verify arguments */
	Xil_AssertVoid(InstancePtr != NULL);

	int AuthenticationStatus = InstancePtr->Info.AuthenticationStatus;

	/* Log info event */
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_ERROR, XHDCP22_RX_ERROR_FLAG_FORCE_RESET);

	/* Reset cipher */
	XHdcp22Cipher_Disable(&InstancePtr->CipherInst);
	XHdcp22Cipher_Enable(&InstancePtr->CipherInst);

	/* Clear message buffer */
	memset(&InstancePtr->MessageBuffer, 0, sizeof(XHdcp22_Rx_Message));
	InstancePtr->MessageSize = 0;

	/* Set default values */
	InstancePtr->StateFunc = (XHdcp22_Rx_StateFunc)(&XHdcp22Rx_StateB0);
	InstancePtr->Info.AuthenticationStatus = XHDCP22_RX_UNAUTHENTICATED;
	InstancePtr->Info.IsNoStoredKm = FALSE;
	InstancePtr->Info.IsEncrypted = FALSE;
	InstancePtr->Info.LCInitAttempts = 0;
	InstancePtr->Info.CurrentState = XHDCP22_RX_STATE_B0_WAIT_AKEINIT;
	InstancePtr->Info.NextState = XHDCP22_RX_STATE_B0_WAIT_AKEINIT;

	/* Reset repeater values */
	memset(&InstancePtr->Topology, 0, sizeof(XHdcp22_Rx_Topology));
	InstancePtr->Info.IsTopologyValid = FALSE;
	InstancePtr->Info.ReturnState = XHDCP22_RX_STATE_UNDEFINED;
	InstancePtr->Info.SeqNumV = 0;
	InstancePtr->Info.HasStreamManagementInfo = FALSE;
	InstancePtr->Info.SkipRead = FALSE;

	/* Disable timer */
	XHdcp22Rx_StopTimer(InstancePtr);

	/* Reset parameters */
	XHdcp22Rx_ResetParams(InstancePtr);

	/* Run callback function type: XHDCP22_RX_HANDLER_UNAUTHENTICATED */
	if((InstancePtr->Handles.IsUnauthenticatedCallbackSet) &&
		 (AuthenticationStatus == XHDCP22_RX_AUTHENTICATED))
	{
		InstancePtr->Handles.UnauthenticatedCallback(InstancePtr->Handles.UnauthenticatedCallbackRef);
	}
}
/*****************************************************************************/
/**
* This function resets the HDCP22-RX system after an error event. The
* driver calls this function when recovering from error conditions.
*
* @param	InstancePtr is a pointer to the XHdcp22_Rx core instance.
*
* @return	None.
*
* @note		None.
******************************************************************************/
This function resets the HDCP22-RX system after an error event. The
driver calls this function when recovering from error conditions.
This function resets the HDCP22 - RX system after an error event . The driver calls this function when recovering from error conditions .
static void XHdcp22Rx_ResetAfterError(XHdcp22_Rx *InstancePtr)
{
	Xil_AssertVoid(InstancePtr != NULL);
	int AuthenticationStatus = InstancePtr->Info.AuthenticationStatus;
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_ERROR, XHDCP22_RX_ERROR_FLAG_FORCE_RESET);
	XHdcp22Cipher_Disable(&InstancePtr->CipherInst);
	XHdcp22Cipher_Enable(&InstancePtr->CipherInst);
	memset(&InstancePtr->MessageBuffer, 0, sizeof(XHdcp22_Rx_Message));
	InstancePtr->MessageSize = 0;
	InstancePtr->StateFunc = (XHdcp22_Rx_StateFunc)(&XHdcp22Rx_StateB0);
	InstancePtr->Info.AuthenticationStatus = XHDCP22_RX_UNAUTHENTICATED;
	InstancePtr->Info.IsNoStoredKm = FALSE;
	InstancePtr->Info.IsEncrypted = FALSE;
	InstancePtr->Info.LCInitAttempts = 0;
	InstancePtr->Info.CurrentState = XHDCP22_RX_STATE_B0_WAIT_AKEINIT;
	InstancePtr->Info.NextState = XHDCP22_RX_STATE_B0_WAIT_AKEINIT;
	memset(&InstancePtr->Topology, 0, sizeof(XHdcp22_Rx_Topology));
	InstancePtr->Info.IsTopologyValid = FALSE;
	InstancePtr->Info.ReturnState = XHDCP22_RX_STATE_UNDEFINED;
	InstancePtr->Info.SeqNumV = 0;
	InstancePtr->Info.HasStreamManagementInfo = FALSE;
	InstancePtr->Info.SkipRead = FALSE;
	XHdcp22Rx_StopTimer(InstancePtr);
	XHdcp22Rx_ResetParams(InstancePtr);
	if((InstancePtr->Handles.IsUnauthenticatedCallbackSet) &&
		 (AuthenticationStatus == XHDCP22_RX_AUTHENTICATED))
	{
		InstancePtr->Handles.UnauthenticatedCallback(InstancePtr->Handles.UnauthenticatedCallbackRef);
	}
}
static void XHdcp22Rx_ResetAfterError ( XHdcp22_Rx * InstancePtr ) { Xil_AssertVoid ( InstancePtr != NULL ) ; int AuthenticationStatus = InstancePtr -> Info . AuthenticationStatus ; XHdcp22Rx_LogWr ( InstancePtr , XHDCP22_RX_LOG_EVT_ERROR , XHDCP22_RX_ERROR_FLAG_FORCE_RESET ) ; XHdcp22Cipher_Disable ( & InstancePtr -> CipherInst ) ; XHdcp22Cipher_Enable ( & InstancePtr -> CipherInst ) ; memset ( & InstancePtr -> MessageBuffer , 0 , sizeof ( XHdcp22_Rx_Message ) ) ; InstancePtr -> MessageSize = 0 ; InstancePtr -> StateFunc = ( XHdcp22_Rx_StateFunc ) ( & XHdcp22Rx_StateB0 ) ; InstancePtr -> Info . AuthenticationStatus = XHDCP22_RX_UNAUTHENTICATED ; InstancePtr -> Info . IsNoStoredKm = FALSE ; InstancePtr -> Info . IsEncrypted = FALSE ; InstancePtr -> Info . LCInitAttempts = 0 ; InstancePtr -> Info . CurrentState = XHDCP22_RX_STATE_B0_WAIT_AKEINIT ; InstancePtr -> Info . NextState = XHDCP22_RX_STATE_B0_WAIT_AKEINIT ; memset ( & InstancePtr -> Topology , 0 , sizeof ( XHdcp22_Rx_Topology ) ) ; InstancePtr -> Info . IsTopologyValid = FALSE ; InstancePtr -> Info . ReturnState = XHDCP22_RX_STATE_UNDEFINED ; InstancePtr -> Info . SeqNumV = 0 ; InstancePtr -> Info . HasStreamManagementInfo = FALSE ; InstancePtr -> Info . SkipRead = FALSE ; XHdcp22Rx_StopTimer ( InstancePtr ) ; XHdcp22Rx_ResetParams ( InstancePtr ) ; if ( ( InstancePtr -> Handles . IsUnauthenticatedCallbackSet ) && ( AuthenticationStatus == XHDCP22_RX_AUTHENTICATED ) ) { InstancePtr -> Handles . UnauthenticatedCallback ( InstancePtr -> Handles . UnauthenticatedCallbackRef ) ; } }
This function resets the HDCP22-RX system after an error event.
This function resets the HDCP22 - RX system after an error event .
/* Verify arguments */ /* Log info event */ /* Reset cipher */ /* Clear message buffer */ /* Set default values */ /* Reset repeater values */ /* Disable timer */ /* Reset parameters */ /* Run callback function type: XHDCP22_RX_HANDLER_UNAUTHENTICATED */