XilinxProcessorIPLib/drivers/hdcp22_rx/src/xhdcp22_rx.c
static int XHdcp22Rx_SendMessageAKESendHPrime(XHdcp22_Rx *InstancePtr)
{
	/* Verify arguments */
	Xil_AssertNonvoid(InstancePtr != NULL);

	u32 Offset;
	XHdcp22_Rx_Message *MsgPtr = (XHdcp22_Rx_Message*)InstancePtr->MessageBuffer;

	/* Compute H Prime */
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_DEBUG, XHDCP22_RX_LOG_DEBUG_COMPUTE_HPRIME);
	XHdcp22Rx_ComputeHPrime(InstancePtr->Params.Rrx, InstancePtr->Params.RxCaps,
			InstancePtr->Params.Rtx, InstancePtr->Params.TxCaps, InstancePtr->Params.Km,
			MsgPtr->AKESendHPrime.HPrime);
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_DEBUG, XHDCP22_RX_LOG_DEBUG_COMPUTE_HPRIME_DONE);

	/* Generate AKE_Send_H_prime message */
	MsgPtr->AKESendHPrime.MsgId = XHDCP22_RX_MSG_ID_AKESENDHPRIME;

	/* Write message to buffer */
	InstancePtr->Handles.DdcSetAddressCallback(InstancePtr->Handles.DdcSetAddressCallbackRef,
		XHDCP22_RX_DDC_READ_REG);
	for(Offset = 0; Offset < sizeof(XHdcp22_Rx_AKESendHPrime); Offset++)
	{
		InstancePtr->Handles.DdcSetDataCallback(InstancePtr->Handles.DdcSetDataCallbackRef,
			InstancePtr->MessageBuffer[Offset]);
	}

	/* Write message size signaling completion */
	XHdcp22Rx_SetRxStatus(InstancePtr, sizeof(XHdcp22_Rx_AKESendHPrime),
		InstancePtr->Info.ReauthReq, InstancePtr->Info.TopologyReady);

	/* Record HPrime */
	memcpy(InstancePtr->Params.HPrime, MsgPtr->AKESendHPrime.HPrime, XHDCP22_RX_HPRIME_SIZE);

	/* Log message write completion */
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_INFO_MESSAGE, XHDCP22_RX_MSG_ID_AKESENDHPRIME);

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
* This function computes HPrime, generates AKE_Send_H_prime message, and
* writes it into the read message buffer. After the complete message has
* been written to the buffer the MessageSize is set in the DDC RxStatus
* register signaling the transmitter that the message is available for
* reading.
*
* @param    InstancePtr is a pointer to the XHdcp22_Rx core instance.
*
* @return   XST_SUCCESS.
*
* @note     This message must be available for the transmitter within
*           1s after receiving AKENoStoredKm or 200ms after receiving
*           AKEStoredKm.
******************************************************************************/
This function computes HPrime, generates AKE_Send_H_prime message, and
writes it into the read message buffer. After the complete message has
been written to the buffer the MessageSize is set in the DDC RxStatus
register signaling the transmitter that the message is available for
reading.
This function computes HPrime generates AKE_Send_H_prime message and writes it into the read message buffer . After the complete message has been written to the buffer the MessageSize is set in the DDC RxStatus register signaling the transmitter that the message is available for reading .
static int XHdcp22Rx_SendMessageAKESendHPrime(XHdcp22_Rx *InstancePtr)
{
	Xil_AssertNonvoid(InstancePtr != NULL);
	u32 Offset;
	XHdcp22_Rx_Message *MsgPtr = (XHdcp22_Rx_Message*)InstancePtr->MessageBuffer;
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_DEBUG, XHDCP22_RX_LOG_DEBUG_COMPUTE_HPRIME);
	XHdcp22Rx_ComputeHPrime(InstancePtr->Params.Rrx, InstancePtr->Params.RxCaps,
			InstancePtr->Params.Rtx, InstancePtr->Params.TxCaps, InstancePtr->Params.Km,
			MsgPtr->AKESendHPrime.HPrime);
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_DEBUG, XHDCP22_RX_LOG_DEBUG_COMPUTE_HPRIME_DONE);
	MsgPtr->AKESendHPrime.MsgId = XHDCP22_RX_MSG_ID_AKESENDHPRIME;
	InstancePtr->Handles.DdcSetAddressCallback(InstancePtr->Handles.DdcSetAddressCallbackRef,
		XHDCP22_RX_DDC_READ_REG);
	for(Offset = 0; Offset < sizeof(XHdcp22_Rx_AKESendHPrime); Offset++)
	{
		InstancePtr->Handles.DdcSetDataCallback(InstancePtr->Handles.DdcSetDataCallbackRef,
			InstancePtr->MessageBuffer[Offset]);
	}
	XHdcp22Rx_SetRxStatus(InstancePtr, sizeof(XHdcp22_Rx_AKESendHPrime),
		InstancePtr->Info.ReauthReq, InstancePtr->Info.TopologyReady);
	memcpy(InstancePtr->Params.HPrime, MsgPtr->AKESendHPrime.HPrime, XHDCP22_RX_HPRIME_SIZE);
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_INFO_MESSAGE, XHDCP22_RX_MSG_ID_AKESENDHPRIME);
	return XST_SUCCESS;
}
static int XHdcp22Rx_SendMessageAKESendHPrime ( XHdcp22_Rx * InstancePtr ) { Xil_AssertNonvoid ( InstancePtr != NULL ) ; u32 Offset ; XHdcp22_Rx_Message * MsgPtr = ( XHdcp22_Rx_Message * ) InstancePtr -> MessageBuffer ; XHdcp22Rx_LogWr ( InstancePtr , XHDCP22_RX_LOG_EVT_DEBUG , XHDCP22_RX_LOG_DEBUG_COMPUTE_HPRIME ) ; XHdcp22Rx_ComputeHPrime ( InstancePtr -> Params . Rrx , InstancePtr -> Params . RxCaps , InstancePtr -> Params . Rtx , InstancePtr -> Params . TxCaps , InstancePtr -> Params . Km , MsgPtr -> AKESendHPrime . HPrime ) ; XHdcp22Rx_LogWr ( InstancePtr , XHDCP22_RX_LOG_EVT_DEBUG , XHDCP22_RX_LOG_DEBUG_COMPUTE_HPRIME_DONE ) ; MsgPtr -> AKESendHPrime . MsgId = XHDCP22_RX_MSG_ID_AKESENDHPRIME ; InstancePtr -> Handles . DdcSetAddressCallback ( InstancePtr -> Handles . DdcSetAddressCallbackRef , XHDCP22_RX_DDC_READ_REG ) ; for ( Offset = 0 ; Offset < sizeof ( XHdcp22_Rx_AKESendHPrime ) ; Offset ++ ) { InstancePtr -> Handles . DdcSetDataCallback ( InstancePtr -> Handles . DdcSetDataCallbackRef , InstancePtr -> MessageBuffer [ Offset ] ) ; } XHdcp22Rx_SetRxStatus ( InstancePtr , sizeof ( XHdcp22_Rx_AKESendHPrime ) , InstancePtr -> Info . ReauthReq , InstancePtr -> Info . TopologyReady ) ; memcpy ( InstancePtr -> Params . HPrime , MsgPtr -> AKESendHPrime . HPrime , XHDCP22_RX_HPRIME_SIZE ) ; XHdcp22Rx_LogWr ( InstancePtr , XHDCP22_RX_LOG_EVT_INFO_MESSAGE , XHDCP22_RX_MSG_ID_AKESENDHPRIME ) ; return XST_SUCCESS ; }
This function computes HPrime, generates AKE_Send_H_prime message, and
writes it into the read message buffer.
This function computes HPrime generates AKE_Send_H_prime message and writes it into the read message buffer .
/* Verify arguments */ /* Compute H Prime */ /* Generate AKE_Send_H_prime message */ /* Write message to buffer */ /* Write message size signaling completion */ /* Record HPrime */ /* Log message write completion */