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

	int Status;
	XHdcp22_Rx_Message *MsgPtr = (XHdcp22_Rx_Message*)InstancePtr->MessageBuffer;

	/* Update state */
	InstancePtr->Info.AuthenticationStatus = XHDCP22_RX_AUTHENTICATION_BUSY;
	InstancePtr->Info.CurrentState = InstancePtr->Info.NextState;

	/* Check error condition */
	if(InstancePtr->Info.ErrorFlag & XHDCP22_RX_ERROR_FLAG_DDC_BURST)
	{
		XHdcp22Rx_ResetDdc(InstancePtr, FALSE, TRUE, TRUE, TRUE);
		XHdcp22Rx_ResetAfterError(InstancePtr);
		return (void *)XHdcp22Rx_StateB0;
	}
	else if(InstancePtr->Info.ErrorFlag & XHDCP22_RX_ERROR_FLAG_LINK_INTEGRITY)
	{
		XHdcp22Rx_SetDdcReauthReq(InstancePtr);
		InstancePtr->Info.AuthenticationStatus = XHDCP22_RX_REAUTHENTICATE_REQUESTED;
	}

	/* Check timeout for RepeaterAuth_Send_Ack message */
	if(InstancePtr->Info.TimerExpired == TRUE)
	{
		XHdcp22Rx_ResetAfterError(InstancePtr);
		XHdcp22Rx_SetDdcReauthReq(InstancePtr);
		return (void *)XHdcp22Rx_StateB0; /* Transition C6->B0 */
	}

	/* Check if message is available.
	   When SkipRead flag is set, this indicates that a message has
	   already been read by another state and should get processed
	   by this state; therefore, skip the first read. */
	if(InstancePtr->Info.SkipRead != TRUE)
	{
		InstancePtr->MessageSize = XHdcp22Rx_PollMessage(InstancePtr);
	}
	InstancePtr->Info.SkipRead = FALSE;


	/* Message handling */
	if(InstancePtr->MessageSize > 0)
	{
		switch(MsgPtr->MsgId)
		{
		case XHDCP22_RX_MSG_ID_AKEINIT: /* Transition C6->B1 */
			Status = XHdcp22Rx_ProcessMessageAKEInit(InstancePtr);
			if(Status == XST_SUCCESS)
			{
			    InstancePtr->Info.NextState = XHDCP22_RX_STATE_B1_SEND_AKESENDCERT;
			    return (void *)XHdcp22Rx_StateB1;
			}
			XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_ERROR,
				XHDCP22_RX_ERROR_FLAG_PROCESSING_AKEINIT);
			XHdcp22Rx_ResetAfterError(InstancePtr);
			return (void *)XHdcp22Rx_StateB0;
		case XHDCP22_RX_MSG_ID_REPEATERAUTHSTREAMMANAGE: /* Transition C6->C7 */
			InstancePtr->Info.NextState = XHDCP22_RX_STATE_C7_WAIT_STREAM_MANAGEMENT;
			InstancePtr->Info.ReturnState = InstancePtr->Info.CurrentState;
			InstancePtr->Info.SkipRead = TRUE;
			return (void *)XHdcp22Rx_StateC7;
		case XHDCP22_RX_MSG_ID_REPEATERAUTHSENDACK:
			Status = XHdcp22Rx_ProcessMessageRepeaterAuthSendAck(InstancePtr);
			if(Status == XST_SUCCESS)
			{
				if(InstancePtr->Info.HasStreamManagementInfo == TRUE) /* Transition C6->C8 */
				{
				InstancePtr->Info.NextState = XHDCP22_RX_STATE_C8_AUTHENTICATED;
				return (void *)XHdcp22Rx_StateC8;
				}
				else /* Transition C6->C7 */
				{
					if(InstancePtr->Info.ReturnState == XHDCP22_RX_STATE_UNDEFINED)
					{
					InstancePtr->Info.NextState = XHDCP22_RX_STATE_C7_WAIT_STREAM_MANAGEMENT;
					return (void *)XHdcp22Rx_StateC7;
					}
					else
					{
						InstancePtr->Info.NextState = InstancePtr->Info.ReturnState;
						switch(InstancePtr->Info.ReturnState)
						{
						case XHDCP22_RX_STATE_C7_SEND_STREAM_READY:
							InstancePtr->Info.ReturnState = XHDCP22_RX_STATE_UNDEFINED;
							return (void *)XHdcp22Rx_StateC7;
						default:
							break;
						}
					}
				}
			}
			XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_ERROR,
				XHDCP22_RX_ERROR_FLAG_PROCESSING_REPEATERAUTHSENDACK);
			XHdcp22Rx_ResetAfterError(InstancePtr);
			XHdcp22Rx_SetDdcReauthReq(InstancePtr);
			return (void *)XHdcp22Rx_StateB0; /* Transition C6->B0 */
		default:
			XHdcp22Rx_ResetAfterError(InstancePtr);
			return (void *)XHdcp22Rx_StateB0;
		}
	}

	return (void *)XHdcp22Rx_StateC6; /* Transition C6->C6 */
}
/*****************************************************************************/
/**
* This function implements the Repeater State C6 (VerifyReceiverIdListAck).
* The RepeaterAuth_Send_Ack message should be available for the receiver
* upstream interface within two seconds from when the READY bit in the
* RxStatus register was set in State C5. If the message is not
* available within the two second window then the state machine
* transitions back into the un-authenticated state. If the message
* is received in-time and the least significant 128-bits of V and VPrime
* match, this indicated successful upstream transmission of topology
* information and triggers a transition to State C7. If there is a
* mismatch then the state machine transitions back to the un-authenticated
* state, and the REAUTH_REQ bit is set in the RxStatus Register.
*
* @param    InstancePtr is a pointer to the XHdcp22_Rx core instance.
*
* @return   Pointer to the function that implements the next state.
*
* @note     If a link integrity problem is detected during this state
*           then the REAUTH_REQ bit is set in the RxStatus register.
*           If the RepeaterAuth_Stream_Manage message is received then
*           transition to State C7 then return back to this state.
******************************************************************************/
This function implements the Repeater State C6 (VerifyReceiverIdListAck).
The RepeaterAuth_Send_Ack message should be available for the receiver
upstream interface within two seconds from when the READY bit in the
RxStatus register was set in State C5. If the message is not
available within the two second window then the state machine
transitions back into the un-authenticated state. If the message
is received in-time and the least significant 128-bits of V and VPrime
match, this indicated successful upstream transmission of topology
information and triggers a transition to State C7. If there is a
mismatch then the state machine transitions back to the un-authenticated
state, and the REAUTH_REQ bit is set in the RxStatus Register.
This function implements the Repeater State C6 ( VerifyReceiverIdListAck ) . The RepeaterAuth_Send_Ack message should be available for the receiver upstream interface within two seconds from when the READY bit in the RxStatus register was set in State C5 . If the message is not available within the two second window then the state machine transitions back into the un - authenticated state . If the message is received in - time and the least significant 128 - bits of V and VPrime match this indicated successful upstream transmission of topology information and triggers a transition to State C7 . If there is a mismatch then the state machine transitions back to the un - authenticated state and the REAUTH_REQ bit is set in the RxStatus Register .
static void *XHdcp22Rx_StateC6(XHdcp22_Rx *InstancePtr)
{
	Xil_AssertNonvoid(InstancePtr != NULL);
	int Status;
	XHdcp22_Rx_Message *MsgPtr = (XHdcp22_Rx_Message*)InstancePtr->MessageBuffer;
	InstancePtr->Info.AuthenticationStatus = XHDCP22_RX_AUTHENTICATION_BUSY;
	InstancePtr->Info.CurrentState = InstancePtr->Info.NextState;
	if(InstancePtr->Info.ErrorFlag & XHDCP22_RX_ERROR_FLAG_DDC_BURST)
	{
		XHdcp22Rx_ResetDdc(InstancePtr, FALSE, TRUE, TRUE, TRUE);
		XHdcp22Rx_ResetAfterError(InstancePtr);
		return (void *)XHdcp22Rx_StateB0;
	}
	else if(InstancePtr->Info.ErrorFlag & XHDCP22_RX_ERROR_FLAG_LINK_INTEGRITY)
	{
		XHdcp22Rx_SetDdcReauthReq(InstancePtr);
		InstancePtr->Info.AuthenticationStatus = XHDCP22_RX_REAUTHENTICATE_REQUESTED;
	}
	if(InstancePtr->Info.TimerExpired == TRUE)
	{
		XHdcp22Rx_ResetAfterError(InstancePtr);
		XHdcp22Rx_SetDdcReauthReq(InstancePtr);
		return (void *)XHdcp22Rx_StateB0; 
	}
	if(InstancePtr->Info.SkipRead != TRUE)
	{
		InstancePtr->MessageSize = XHdcp22Rx_PollMessage(InstancePtr);
	}
	InstancePtr->Info.SkipRead = FALSE;
	if(InstancePtr->MessageSize > 0)
	{
		switch(MsgPtr->MsgId)
		{
		case XHDCP22_RX_MSG_ID_AKEINIT: 
			Status = XHdcp22Rx_ProcessMessageAKEInit(InstancePtr);
			if(Status == XST_SUCCESS)
			{
			    InstancePtr->Info.NextState = XHDCP22_RX_STATE_B1_SEND_AKESENDCERT;
			    return (void *)XHdcp22Rx_StateB1;
			}
			XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_ERROR,
				XHDCP22_RX_ERROR_FLAG_PROCESSING_AKEINIT);
			XHdcp22Rx_ResetAfterError(InstancePtr);
			return (void *)XHdcp22Rx_StateB0;
		case XHDCP22_RX_MSG_ID_REPEATERAUTHSTREAMMANAGE: 
			InstancePtr->Info.NextState = XHDCP22_RX_STATE_C7_WAIT_STREAM_MANAGEMENT;
			InstancePtr->Info.ReturnState = InstancePtr->Info.CurrentState;
			InstancePtr->Info.SkipRead = TRUE;
			return (void *)XHdcp22Rx_StateC7;
		case XHDCP22_RX_MSG_ID_REPEATERAUTHSENDACK:
			Status = XHdcp22Rx_ProcessMessageRepeaterAuthSendAck(InstancePtr);
			if(Status == XST_SUCCESS)
			{
				if(InstancePtr->Info.HasStreamManagementInfo == TRUE) 
				{
				InstancePtr->Info.NextState = XHDCP22_RX_STATE_C8_AUTHENTICATED;
				return (void *)XHdcp22Rx_StateC8;
				}
				else 
				{
					if(InstancePtr->Info.ReturnState == XHDCP22_RX_STATE_UNDEFINED)
					{
					InstancePtr->Info.NextState = XHDCP22_RX_STATE_C7_WAIT_STREAM_MANAGEMENT;
					return (void *)XHdcp22Rx_StateC7;
					}
					else
					{
						InstancePtr->Info.NextState = InstancePtr->Info.ReturnState;
						switch(InstancePtr->Info.ReturnState)
						{
						case XHDCP22_RX_STATE_C7_SEND_STREAM_READY:
							InstancePtr->Info.ReturnState = XHDCP22_RX_STATE_UNDEFINED;
							return (void *)XHdcp22Rx_StateC7;
						default:
							break;
						}
					}
				}
			}
			XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_ERROR,
				XHDCP22_RX_ERROR_FLAG_PROCESSING_REPEATERAUTHSENDACK);
			XHdcp22Rx_ResetAfterError(InstancePtr);
			XHdcp22Rx_SetDdcReauthReq(InstancePtr);
			return (void *)XHdcp22Rx_StateB0; 
		default:
			XHdcp22Rx_ResetAfterError(InstancePtr);
			return (void *)XHdcp22Rx_StateB0;
		}
	}
	return (void *)XHdcp22Rx_StateC6; 
}
static void * XHdcp22Rx_StateC6 ( XHdcp22_Rx * InstancePtr ) { Xil_AssertNonvoid ( InstancePtr != NULL ) ; int Status ; XHdcp22_Rx_Message * MsgPtr = ( XHdcp22_Rx_Message * ) InstancePtr -> MessageBuffer ; InstancePtr -> Info . AuthenticationStatus = XHDCP22_RX_AUTHENTICATION_BUSY ; InstancePtr -> Info . CurrentState = InstancePtr -> Info . NextState ; if ( InstancePtr -> Info . ErrorFlag & XHDCP22_RX_ERROR_FLAG_DDC_BURST ) { XHdcp22Rx_ResetDdc ( InstancePtr , FALSE , TRUE , TRUE , TRUE ) ; XHdcp22Rx_ResetAfterError ( InstancePtr ) ; return ( void * ) XHdcp22Rx_StateB0 ; } else if ( InstancePtr -> Info . ErrorFlag & XHDCP22_RX_ERROR_FLAG_LINK_INTEGRITY ) { XHdcp22Rx_SetDdcReauthReq ( InstancePtr ) ; InstancePtr -> Info . AuthenticationStatus = XHDCP22_RX_REAUTHENTICATE_REQUESTED ; } if ( InstancePtr -> Info . TimerExpired == TRUE ) { XHdcp22Rx_ResetAfterError ( InstancePtr ) ; XHdcp22Rx_SetDdcReauthReq ( InstancePtr ) ; return ( void * ) XHdcp22Rx_StateB0 ; } if ( InstancePtr -> Info . SkipRead != TRUE ) { InstancePtr -> MessageSize = XHdcp22Rx_PollMessage ( InstancePtr ) ; } InstancePtr -> Info . SkipRead = FALSE ; if ( InstancePtr -> MessageSize > 0 ) { switch ( MsgPtr -> MsgId ) { case XHDCP22_RX_MSG_ID_AKEINIT : Status = XHdcp22Rx_ProcessMessageAKEInit ( InstancePtr ) ; if ( Status == XST_SUCCESS ) { InstancePtr -> Info . NextState = XHDCP22_RX_STATE_B1_SEND_AKESENDCERT ; return ( void * ) XHdcp22Rx_StateB1 ; } XHdcp22Rx_LogWr ( InstancePtr , XHDCP22_RX_LOG_EVT_ERROR , XHDCP22_RX_ERROR_FLAG_PROCESSING_AKEINIT ) ; XHdcp22Rx_ResetAfterError ( InstancePtr ) ; return ( void * ) XHdcp22Rx_StateB0 ; case XHDCP22_RX_MSG_ID_REPEATERAUTHSTREAMMANAGE : InstancePtr -> Info . NextState = XHDCP22_RX_STATE_C7_WAIT_STREAM_MANAGEMENT ; InstancePtr -> Info . ReturnState = InstancePtr -> Info . CurrentState ; InstancePtr -> Info . SkipRead = TRUE ; return ( void * ) XHdcp22Rx_StateC7 ; case XHDCP22_RX_MSG_ID_REPEATERAUTHSENDACK : Status = XHdcp22Rx_ProcessMessageRepeaterAuthSendAck ( InstancePtr ) ; if ( Status == XST_SUCCESS ) { if ( InstancePtr -> Info . HasStreamManagementInfo == TRUE ) { InstancePtr -> Info . NextState = XHDCP22_RX_STATE_C8_AUTHENTICATED ; return ( void * ) XHdcp22Rx_StateC8 ; } else { if ( InstancePtr -> Info . ReturnState == XHDCP22_RX_STATE_UNDEFINED ) { InstancePtr -> Info . NextState = XHDCP22_RX_STATE_C7_WAIT_STREAM_MANAGEMENT ; return ( void * ) XHdcp22Rx_StateC7 ; } else { InstancePtr -> Info . NextState = InstancePtr -> Info . ReturnState ; switch ( InstancePtr -> Info . ReturnState ) { case XHDCP22_RX_STATE_C7_SEND_STREAM_READY : InstancePtr -> Info . ReturnState = XHDCP22_RX_STATE_UNDEFINED ; return ( void * ) XHdcp22Rx_StateC7 ; default : break ; } } } } XHdcp22Rx_LogWr ( InstancePtr , XHDCP22_RX_LOG_EVT_ERROR , XHDCP22_RX_ERROR_FLAG_PROCESSING_REPEATERAUTHSENDACK ) ; XHdcp22Rx_ResetAfterError ( InstancePtr ) ; XHdcp22Rx_SetDdcReauthReq ( InstancePtr ) ; return ( void * ) XHdcp22Rx_StateB0 ; default : XHdcp22Rx_ResetAfterError ( InstancePtr ) ; return ( void * ) XHdcp22Rx_StateB0 ; } } return ( void * ) XHdcp22Rx_StateC6 ; }
This function implements the Repeater State C6 (VerifyReceiverIdListAck).
This function implements the Repeater State C6 ( VerifyReceiverIdListAck ) .
/* Verify arguments */ /* Update state */ /* Check error condition */ /* Check timeout for RepeaterAuth_Send_Ack message */ /* Transition C6->B0 */ /* Check if message is available.
	   When SkipRead flag is set, this indicates that a message has
	   already been read by another state and should get processed
	   by this state; therefore, skip the first read. */ /* Message handling */ /* Transition C6->B1 */ /* Transition C6->C7 */ /* Transition C6->C8 */ /* Transition C6->C7 */ /* Transition C6->B0 */ /* Transition C6->C6 */