XilinxProcessorIPLib/drivers/hdcp22_tx_dp/src/xhdcp22_tx.c
static int XHdcp22Tx_WriteAKEInit(XHdcp22_Tx *InstancePtr)
{
	XHdcp22_Tx_DDCMessage* MsgPtr = (XHdcp22_Tx_DDCMessage*)InstancePtr->MessageBuffer;

	XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG, XHDCP22_TX_LOG_DBG_TX_AKEINIT);

	/* Increment authentication request count */
	InstancePtr->Info.AuthRequestCnt++;

	MsgPtr->DdcAddress = XHDCP22_TX_HDCPPORT_WRITE_MSG_OFFSET;
	MsgPtr->Message.MsgId = XHDCP22_TX_AKE_INIT;

	/* Generate Rtx and add to the buffer*/
	XHdcp22Tx_GenerateRtx(InstancePtr, InstancePtr->Info.Rtx);

	memcpy(&MsgPtr->Message.AKEInit.Rtx, InstancePtr->Info.Rtx,
	       sizeof(MsgPtr->Message.AKEInit.Rtx));
	/* Add TxCaps to the buffer*/
	memcpy(&MsgPtr->Message.AKEInit.TxCaps, XHdcp22_Tx_TxCaps,
	       sizeof(MsgPtr->Message.AKEInit.TxCaps));

	if (InstancePtr->Config.Protocol == XHDCP22_TX_DP) {
		xdbg_printf(XDBG_DEBUG_GENERAL,"HDCP22TX: Writing AKE_INIT\n\r");
		return XHdcp22Tx_Dp_Write_Dpcd_Msg(InstancePtr);

	} else {
		/* Execute write */
		return InstancePtr->DdcWrite(XHDCP22_TX_DDC_BASE_ADDRESS,
				sizeof(XHdcp22_Tx_AKEInit)+1,
				(u8 *)MsgPtr, (TRUE),
				InstancePtr->DdcHandlerRef);
	}
}
/*****************************************************************************/
/**
*
* This function issues a AKE_Init message
*
* @param  InstancePtr is a pointer to the XHdcp22Tx core instance.
* @param  MsgBufferPtr the buffer to use for messaging.
*
* @return
*         - XST_SUCCESS if writing succeeded
*         - XST_FAILURE if failed to write.
*
* @note   None.
*
******************************************************************************/
This function issues a AKE_Init message
This function issues a AKE_Init message
static int XHdcp22Tx_WriteAKEInit(XHdcp22_Tx *InstancePtr)
{
	XHdcp22_Tx_DDCMessage* MsgPtr = (XHdcp22_Tx_DDCMessage*)InstancePtr->MessageBuffer;
	XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG, XHDCP22_TX_LOG_DBG_TX_AKEINIT);
	InstancePtr->Info.AuthRequestCnt++;
	MsgPtr->DdcAddress = XHDCP22_TX_HDCPPORT_WRITE_MSG_OFFSET;
	MsgPtr->Message.MsgId = XHDCP22_TX_AKE_INIT;
	XHdcp22Tx_GenerateRtx(InstancePtr, InstancePtr->Info.Rtx);
	memcpy(&MsgPtr->Message.AKEInit.Rtx, InstancePtr->Info.Rtx,
	       sizeof(MsgPtr->Message.AKEInit.Rtx));
	memcpy(&MsgPtr->Message.AKEInit.TxCaps, XHdcp22_Tx_TxCaps,
	       sizeof(MsgPtr->Message.AKEInit.TxCaps));
	if (InstancePtr->Config.Protocol == XHDCP22_TX_DP) {
		xdbg_printf(XDBG_DEBUG_GENERAL,"HDCP22TX: Writing AKE_INIT\n\r");
		return XHdcp22Tx_Dp_Write_Dpcd_Msg(InstancePtr);
	} else {
		return InstancePtr->DdcWrite(XHDCP22_TX_DDC_BASE_ADDRESS,
				sizeof(XHdcp22_Tx_AKEInit)+1,
				(u8 *)MsgPtr, (TRUE),
				InstancePtr->DdcHandlerRef);
	}
}
static int XHdcp22Tx_WriteAKEInit ( XHdcp22_Tx * InstancePtr ) { XHdcp22_Tx_DDCMessage * MsgPtr = ( XHdcp22_Tx_DDCMessage * ) InstancePtr -> MessageBuffer ; XHdcp22Tx_LogWr ( InstancePtr , XHDCP22_TX_LOG_EVT_DBG , XHDCP22_TX_LOG_DBG_TX_AKEINIT ) ; InstancePtr -> Info . AuthRequestCnt ++ ; MsgPtr -> DdcAddress = XHDCP22_TX_HDCPPORT_WRITE_MSG_OFFSET ; MsgPtr -> Message . MsgId = XHDCP22_TX_AKE_INIT ; XHdcp22Tx_GenerateRtx ( InstancePtr , InstancePtr -> Info . Rtx ) ; memcpy ( & MsgPtr -> Message . AKEInit . Rtx , InstancePtr -> Info . Rtx , sizeof ( MsgPtr -> Message . AKEInit . Rtx ) ) ; memcpy ( & MsgPtr -> Message . AKEInit . TxCaps , XHdcp22_Tx_TxCaps , sizeof ( MsgPtr -> Message . AKEInit . TxCaps ) ) ; if ( InstancePtr -> Config . Protocol == XHDCP22_TX_DP ) { xdbg_printf ( XDBG_DEBUG_GENERAL , " \n \r " ) ; return XHdcp22Tx_Dp_Write_Dpcd_Msg ( InstancePtr ) ; } else { return InstancePtr -> DdcWrite ( XHDCP22_TX_DDC_BASE_ADDRESS , sizeof ( XHdcp22_Tx_AKEInit ) + 1 , ( u8 * ) MsgPtr , ( TRUE ) , InstancePtr -> DdcHandlerRef ) ; } }
This function issues a AKE_Init message
This function issues a AKE_Init message
/* Increment authentication request count */ /* Generate Rtx and add to the buffer*/ /* Add TxCaps to the buffer*/ /* Execute write */