XilinxProcessorIPLib/drivers/hdcp22_tx_dp/src/xhdcp22_tx.c
static XHdcp22_Tx_StateType XHdcp22Tx_StateA2(XHdcp22_Tx *InstancePtr)
{
	int Result;

	/* Log but don't clutter our log buffer, check on counter */
	if (InstancePtr->Info.LocalityCheckCounter == 0) {
		XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_STATE,
		                (u16)XHDCP22_TX_STATE_A2);
	}

	/* It is allowed to retry locality check until it has been
	 * checked for 1024 times */
	InstancePtr->Info.LocalityCheckCounter++;

	if (InstancePtr->Info.LocalityCheckCounter > XHDCP22_TX_MAX_ALLOWED_LOCALITY_CHECKS) {
		XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_LCCHK_COUNT,
		                (u16)InstancePtr->Info.LocalityCheckCounter-1);
		return XHDCP22_TX_STATE_A0;
	}

	/* Generate Rn */
	XHdcp22Tx_GenerateRn(InstancePtr, InstancePtr->Info.Rn);

	/* Send LC Init message */
	Result = XHdcp22Tx_WriteLcInit(InstancePtr, InstancePtr->Info.Rn);

	if (Result != XST_SUCCESS) {
		XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG, XHDCP22_TX_LOG_DBG_MSG_WRITE_FAIL);
		return XHDCP22_TX_STATE_A0;
	}
	if (InstancePtr->Config.Protocol == XHDCP22_TX_DP)
		/* Start the timer for receiving
		 * XHDCP22_TX_AKE_SEND_PAIRING_INFO */
		XHdcp22Tx_StartTimer(InstancePtr,
				XHDCP22_TX_DP_LC_SEND_L_PRIME_TIMEOUT,
				XHDCP22_TX_LC_SEND_L_PRIME);
	else
		/* Start the timer for receiving XHDCP22_TX_AKE_SEND_PAIRING_INFO */
		XHdcp22Tx_StartTimer(InstancePtr, 20, XHDCP22_TX_LC_SEND_L_PRIME);

	return XHDCP22_TX_STATE_A2_1;
}
/*****************************************************************************/
/**
*
* This function executes the A2 state of the HDCP2.2 TX protocol.
*
* @param  InstancePtr is a pointer to the XHdcp22Tx core instance.
*
* @return The next state to execute.
*
* @note   None.
*
******************************************************************************/
This function executes the A2 state of the HDCP2.2 TX protocol.
This function executes the A2 state of the HDCP2 . 2 TX protocol .
static XHdcp22_Tx_StateType XHdcp22Tx_StateA2(XHdcp22_Tx *InstancePtr)
{
	int Result;
	if (InstancePtr->Info.LocalityCheckCounter == 0) {
		XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_STATE,
		                (u16)XHDCP22_TX_STATE_A2);
	}
	InstancePtr->Info.LocalityCheckCounter++;
	if (InstancePtr->Info.LocalityCheckCounter > XHDCP22_TX_MAX_ALLOWED_LOCALITY_CHECKS) {
		XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_LCCHK_COUNT,
		                (u16)InstancePtr->Info.LocalityCheckCounter-1);
		return XHDCP22_TX_STATE_A0;
	}
	XHdcp22Tx_GenerateRn(InstancePtr, InstancePtr->Info.Rn);
	Result = XHdcp22Tx_WriteLcInit(InstancePtr, InstancePtr->Info.Rn);
	if (Result != XST_SUCCESS) {
		XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG, XHDCP22_TX_LOG_DBG_MSG_WRITE_FAIL);
		return XHDCP22_TX_STATE_A0;
	}
	if (InstancePtr->Config.Protocol == XHDCP22_TX_DP)
		XHdcp22Tx_StartTimer(InstancePtr,
				XHDCP22_TX_DP_LC_SEND_L_PRIME_TIMEOUT,
				XHDCP22_TX_LC_SEND_L_PRIME);
	else
		XHdcp22Tx_StartTimer(InstancePtr, 20, XHDCP22_TX_LC_SEND_L_PRIME);
	return XHDCP22_TX_STATE_A2_1;
}
static XHdcp22_Tx_StateType XHdcp22Tx_StateA2 ( XHdcp22_Tx * InstancePtr ) { int Result ; if ( InstancePtr -> Info . LocalityCheckCounter == 0 ) { XHdcp22Tx_LogWr ( InstancePtr , XHDCP22_TX_LOG_EVT_STATE , ( u16 ) XHDCP22_TX_STATE_A2 ) ; } InstancePtr -> Info . LocalityCheckCounter ++ ; if ( InstancePtr -> Info . LocalityCheckCounter > XHDCP22_TX_MAX_ALLOWED_LOCALITY_CHECKS ) { XHdcp22Tx_LogWr ( InstancePtr , XHDCP22_TX_LOG_EVT_LCCHK_COUNT , ( u16 ) InstancePtr -> Info . LocalityCheckCounter - 1 ) ; return XHDCP22_TX_STATE_A0 ; } XHdcp22Tx_GenerateRn ( InstancePtr , InstancePtr -> Info . Rn ) ; Result = XHdcp22Tx_WriteLcInit ( InstancePtr , InstancePtr -> Info . Rn ) ; if ( Result != XST_SUCCESS ) { XHdcp22Tx_LogWr ( InstancePtr , XHDCP22_TX_LOG_EVT_DBG , XHDCP22_TX_LOG_DBG_MSG_WRITE_FAIL ) ; return XHDCP22_TX_STATE_A0 ; } if ( InstancePtr -> Config . Protocol == XHDCP22_TX_DP ) XHdcp22Tx_StartTimer ( InstancePtr , XHDCP22_TX_DP_LC_SEND_L_PRIME_TIMEOUT , XHDCP22_TX_LC_SEND_L_PRIME ) ; else XHdcp22Tx_StartTimer ( InstancePtr , 20 , XHDCP22_TX_LC_SEND_L_PRIME ) ; return XHDCP22_TX_STATE_A2_1 ; }
This function executes the A2 state of the HDCP2.2 TX protocol.
This function executes the A2 state of the HDCP2 . 2 TX protocol .
/* Log but don't clutter our log buffer, check on counter */ /* It is allowed to retry locality check until it has been
	 * checked for 1024 times */ /* Generate Rn */ /* Send LC Init message */ /* Start the timer for receiving
		 * XHDCP22_TX_AKE_SEND_PAIRING_INFO */ /* Start the timer for receiving XHDCP22_TX_AKE_SEND_PAIRING_INFO */