XilinxProcessorIPLib/drivers/hdcp22_tx_dp/src/xhdcp22_tx.c
static XHdcp22_Tx_StateType XHdcp22Tx_StateA5(XHdcp22_Tx *InstancePtr)
{

#ifndef _XHDCP22_TX_DISABLE_TIMEOUT_CHECKING_
	/* wait for a timer to expire, either it is the 200 ms mandatory time
	 * before cipher enabling, or the re-authentication check timer */
	if (InstancePtr->Timer.TimerExpired == (FALSE)) {
		return XHDCP22_TX_STATE_A5;
	}
#endif

	/* Do not pollute the logging on polling log authenticated only once */
	if (InstancePtr->Info.AuthenticationStatus != XHDCP22_TX_AUTHENTICATED) {
		XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_STATE,
		                (u16)XHDCP22_TX_STATE_A5);
	}

	/* Timer has expired, handle it */

	/* Handle mandatory 200 ms cipher timeout */
	if (InstancePtr->Timer.ReasonId == XHDCP22_TX_TS_WAIT_FOR_CIPHER) {

		/* Check re-authentication before enabling cipher */
		u8 handle_reauth_request = FALSE;

		if (InstancePtr->Config.Protocol == XHDCP22_TX_DP) {
			/*Check if Reauth_Req/Link_Integirty_Fail happened*/
			if ((InstancePtr->Info.Dp_RxStatus &
				(XHDCP22_RX_STATUS_REAUTH_REQ |
				 XHDCP22_RX_STATUS_LINK_INTEGRITY_FAIL))) {
				InstancePtr->Info.Dp_RxStatus &=
					~(XHDCP22_RX_STATUS_REAUTH_REQ |
					XHDCP22_RX_STATUS_LINK_INTEGRITY_FAIL);
				handle_reauth_request = TRUE;
			}
		} else {
			if (InstancePtr->Info.RxStatus &
					XHDCP22_TX_RXSTATUS_REAUTH_REQ_MASK)
				handle_reauth_request = TRUE;
		}

		if (handle_reauth_request) {
			XHdcp22Tx_HandleReauthenticationRequest(InstancePtr);
			return XHDCP22_TX_STATE_A0;
		}

		/* Authenticated ! */
		InstancePtr->Info.AuthenticationStatus = XHDCP22_TX_AUTHENTICATED;
		InstancePtr->Info.ReAuthenticationRequested = (FALSE);

		/* Authenticated callback */
		if (InstancePtr->IsAuthenticatedCallbackSet) {
			InstancePtr->AuthenticatedCallback(InstancePtr->AuthenticatedCallbackRef);
		}

		/* Start the re-authentication check timer */
		XHdcp22Tx_StartTimer(InstancePtr, 1000, XHDCP22_TX_TS_RX_REAUTH_CHECK);
		return XHDCP22_TX_STATE_A5;

	}

	/* Handle the re-authentication check timer */
	if (InstancePtr->Timer.ReasonId == XHDCP22_TX_TS_RX_REAUTH_CHECK) {

		u8 handle_reauth_request = FALSE;
		u8 handle_repeater_rdy = FALSE;

		XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG,
				XHDCP22_TX_LOG_DBG_CHECK_REAUTH);

		if (InstancePtr->Config.Protocol == XHDCP22_TX_DP) {
			if ((InstancePtr->Info.Dp_RxStatus &
				(XHDCP22_RX_STATUS_REAUTH_REQ |
				 XHDCP22_RX_STATUS_LINK_INTEGRITY_FAIL))) {
				InstancePtr->Info.Dp_RxStatus &=
					~(XHDCP22_RX_STATUS_REAUTH_REQ |
					XHDCP22_RX_STATUS_LINK_INTEGRITY_FAIL);
				handle_reauth_request = TRUE;
			}

			/* Has the repeater built an updated downstream
			 * receiver ID list? */
			if ((InstancePtr->Info.Dp_RxStatus &
						XHDCP22_RX_STATUS_RPTR_RDY) ==
					XHDCP22_RX_STATUS_RPTR_RDY) {
				handle_repeater_rdy = TRUE;
			}
		} else {
			if (InstancePtr->Info.RxStatus &
					XHDCP22_TX_RXSTATUS_REAUTH_REQ_MASK)
				handle_reauth_request = (TRUE);

			/* Has the repeater built an updated downstream
			 * receiver ID list? */
			if (InstancePtr->Info.RxStatus &
					XHDCP22_TX_RXSTATUS_READY_MASK)
				handle_repeater_rdy = (TRUE);
		}

		if (handle_reauth_request) {
			XHdcp22Tx_HandleReauthenticationRequest(InstancePtr);
			return XHDCP22_TX_STATE_A0;
		}
		if (handle_repeater_rdy) {
			/* The downstream topology has changed */
			return XHDCP22_TX_STATE_A6_A7_A8;
		}

		/* Re-Start the timer for the next status check */
		XHdcp22Tx_StartTimer(InstancePtr, 1000,
				XHDCP22_TX_TS_RX_REAUTH_CHECK);
	}

	return XHDCP22_TX_STATE_A5;
}
/*****************************************************************************/
/**
*
* This function executes the A5 state of the HDCP2.2 TX protocol.
* Before authentication is granted, a 200 ms mandatory wait is added, so the
* integrating application does not start the cipher premature.
*
* @param  InstancePtr is a pointer to the XHdcp22Tx core instance.
*
* @return The next state to execute.
*
* @note   None.
*
******************************************************************************/
This function executes the A5 state of the HDCP2.2 TX protocol.
Before authentication is granted, a 200 ms mandatory wait is added, so the
integrating application does not start the cipher premature.
This function executes the A5 state of the HDCP2 . 2 TX protocol . Before authentication is granted a 200 ms mandatory wait is added so the integrating application does not start the cipher premature .
static XHdcp22_Tx_StateType XHdcp22Tx_StateA5(XHdcp22_Tx *InstancePtr)
{
#ifndef _XHDCP22_TX_DISABLE_TIMEOUT_CHECKING_
	if (InstancePtr->Timer.TimerExpired == (FALSE)) {
		return XHDCP22_TX_STATE_A5;
	}
#endif
	if (InstancePtr->Info.AuthenticationStatus != XHDCP22_TX_AUTHENTICATED) {
		XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_STATE,
		                (u16)XHDCP22_TX_STATE_A5);
	}
	if (InstancePtr->Timer.ReasonId == XHDCP22_TX_TS_WAIT_FOR_CIPHER) {
		u8 handle_reauth_request = FALSE;
		if (InstancePtr->Config.Protocol == XHDCP22_TX_DP) {
			if ((InstancePtr->Info.Dp_RxStatus &
				(XHDCP22_RX_STATUS_REAUTH_REQ |
				 XHDCP22_RX_STATUS_LINK_INTEGRITY_FAIL))) {
				InstancePtr->Info.Dp_RxStatus &=
					~(XHDCP22_RX_STATUS_REAUTH_REQ |
					XHDCP22_RX_STATUS_LINK_INTEGRITY_FAIL);
				handle_reauth_request = TRUE;
			}
		} else {
			if (InstancePtr->Info.RxStatus &
					XHDCP22_TX_RXSTATUS_REAUTH_REQ_MASK)
				handle_reauth_request = TRUE;
		}
		if (handle_reauth_request) {
			XHdcp22Tx_HandleReauthenticationRequest(InstancePtr);
			return XHDCP22_TX_STATE_A0;
		}
		InstancePtr->Info.AuthenticationStatus = XHDCP22_TX_AUTHENTICATED;
		InstancePtr->Info.ReAuthenticationRequested = (FALSE);
		if (InstancePtr->IsAuthenticatedCallbackSet) {
			InstancePtr->AuthenticatedCallback(InstancePtr->AuthenticatedCallbackRef);
		}
		XHdcp22Tx_StartTimer(InstancePtr, 1000, XHDCP22_TX_TS_RX_REAUTH_CHECK);
		return XHDCP22_TX_STATE_A5;
	}
	if (InstancePtr->Timer.ReasonId == XHDCP22_TX_TS_RX_REAUTH_CHECK) {
		u8 handle_reauth_request = FALSE;
		u8 handle_repeater_rdy = FALSE;
		XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG,
				XHDCP22_TX_LOG_DBG_CHECK_REAUTH);
		if (InstancePtr->Config.Protocol == XHDCP22_TX_DP) {
			if ((InstancePtr->Info.Dp_RxStatus &
				(XHDCP22_RX_STATUS_REAUTH_REQ |
				 XHDCP22_RX_STATUS_LINK_INTEGRITY_FAIL))) {
				InstancePtr->Info.Dp_RxStatus &=
					~(XHDCP22_RX_STATUS_REAUTH_REQ |
					XHDCP22_RX_STATUS_LINK_INTEGRITY_FAIL);
				handle_reauth_request = TRUE;
			}
			if ((InstancePtr->Info.Dp_RxStatus &
						XHDCP22_RX_STATUS_RPTR_RDY) ==
					XHDCP22_RX_STATUS_RPTR_RDY) {
				handle_repeater_rdy = TRUE;
			}
		} else {
			if (InstancePtr->Info.RxStatus &
					XHDCP22_TX_RXSTATUS_REAUTH_REQ_MASK)
				handle_reauth_request = (TRUE);
			if (InstancePtr->Info.RxStatus &
					XHDCP22_TX_RXSTATUS_READY_MASK)
				handle_repeater_rdy = (TRUE);
		}
		if (handle_reauth_request) {
			XHdcp22Tx_HandleReauthenticationRequest(InstancePtr);
			return XHDCP22_TX_STATE_A0;
		}
		if (handle_repeater_rdy) {
			return XHDCP22_TX_STATE_A6_A7_A8;
		}
		XHdcp22Tx_StartTimer(InstancePtr, 1000,
				XHDCP22_TX_TS_RX_REAUTH_CHECK);
	}
	return XHDCP22_TX_STATE_A5;
}
static XHdcp22_Tx_StateType XHdcp22Tx_StateA5 ( XHdcp22_Tx * InstancePtr ) { #ifndef _XHDCP22_TX_DISABLE_TIMEOUT_CHECKING_ if ( InstancePtr -> Timer . TimerExpired == ( FALSE ) ) { return XHDCP22_TX_STATE_A5 ; } #endif if ( InstancePtr -> Info . AuthenticationStatus != XHDCP22_TX_AUTHENTICATED ) { XHdcp22Tx_LogWr ( InstancePtr , XHDCP22_TX_LOG_EVT_STATE , ( u16 ) XHDCP22_TX_STATE_A5 ) ; } if ( InstancePtr -> Timer . ReasonId == XHDCP22_TX_TS_WAIT_FOR_CIPHER ) { u8 handle_reauth_request = FALSE ; if ( InstancePtr -> Config . Protocol == XHDCP22_TX_DP ) { if ( ( InstancePtr -> Info . Dp_RxStatus & ( XHDCP22_RX_STATUS_REAUTH_REQ | XHDCP22_RX_STATUS_LINK_INTEGRITY_FAIL ) ) ) { InstancePtr -> Info . Dp_RxStatus &= ~ ( XHDCP22_RX_STATUS_REAUTH_REQ | XHDCP22_RX_STATUS_LINK_INTEGRITY_FAIL ) ; handle_reauth_request = TRUE ; } } else { if ( InstancePtr -> Info . RxStatus & XHDCP22_TX_RXSTATUS_REAUTH_REQ_MASK ) handle_reauth_request = TRUE ; } if ( handle_reauth_request ) { XHdcp22Tx_HandleReauthenticationRequest ( InstancePtr ) ; return XHDCP22_TX_STATE_A0 ; } InstancePtr -> Info . AuthenticationStatus = XHDCP22_TX_AUTHENTICATED ; InstancePtr -> Info . ReAuthenticationRequested = ( FALSE ) ; if ( InstancePtr -> IsAuthenticatedCallbackSet ) { InstancePtr -> AuthenticatedCallback ( InstancePtr -> AuthenticatedCallbackRef ) ; } XHdcp22Tx_StartTimer ( InstancePtr , 1000 , XHDCP22_TX_TS_RX_REAUTH_CHECK ) ; return XHDCP22_TX_STATE_A5 ; } if ( InstancePtr -> Timer . ReasonId == XHDCP22_TX_TS_RX_REAUTH_CHECK ) { u8 handle_reauth_request = FALSE ; u8 handle_repeater_rdy = FALSE ; XHdcp22Tx_LogWr ( InstancePtr , XHDCP22_TX_LOG_EVT_DBG , XHDCP22_TX_LOG_DBG_CHECK_REAUTH ) ; if ( InstancePtr -> Config . Protocol == XHDCP22_TX_DP ) { if ( ( InstancePtr -> Info . Dp_RxStatus & ( XHDCP22_RX_STATUS_REAUTH_REQ | XHDCP22_RX_STATUS_LINK_INTEGRITY_FAIL ) ) ) { InstancePtr -> Info . Dp_RxStatus &= ~ ( XHDCP22_RX_STATUS_REAUTH_REQ | XHDCP22_RX_STATUS_LINK_INTEGRITY_FAIL ) ; handle_reauth_request = TRUE ; } if ( ( InstancePtr -> Info . Dp_RxStatus & XHDCP22_RX_STATUS_RPTR_RDY ) == XHDCP22_RX_STATUS_RPTR_RDY ) { handle_repeater_rdy = TRUE ; } } else { if ( InstancePtr -> Info . RxStatus & XHDCP22_TX_RXSTATUS_REAUTH_REQ_MASK ) handle_reauth_request = ( TRUE ) ; if ( InstancePtr -> Info . RxStatus & XHDCP22_TX_RXSTATUS_READY_MASK ) handle_repeater_rdy = ( TRUE ) ; } if ( handle_reauth_request ) { XHdcp22Tx_HandleReauthenticationRequest ( InstancePtr ) ; return XHDCP22_TX_STATE_A0 ; } if ( handle_repeater_rdy ) { return XHDCP22_TX_STATE_A6_A7_A8 ; } XHdcp22Tx_StartTimer ( InstancePtr , 1000 , XHDCP22_TX_TS_RX_REAUTH_CHECK ) ; } return XHDCP22_TX_STATE_A5 ; }
This function executes the A5 state of the HDCP2.2 TX protocol.
This function executes the A5 state of the HDCP2 . 2 TX protocol .
/* wait for a timer to expire, either it is the 200 ms mandatory time
	 * before cipher enabling, or the re-authentication check timer */ /* Do not pollute the logging on polling log authenticated only once */ /* Timer has expired, handle it */ /* Handle mandatory 200 ms cipher timeout */ /* Check re-authentication before enabling cipher */ /*Check if Reauth_Req/Link_Integirty_Fail happened*/ /* Authenticated ! */ /* Authenticated callback */ /* Start the re-authentication check timer */ /* Handle the re-authentication check timer */ /* Has the repeater built an updated downstream
			 * receiver ID list? */ /* Has the repeater built an updated downstream
			 * receiver ID list? */ /* The downstream topology has changed */ /* Re-Start the timer for the next status check */