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

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

	/* Compute LPrime */
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_DEBUG, XHDCP22_RX_LOG_DEBUG_COMPUTE_LPRIME);
	XHdcp22Rx_ComputeLPrime(InstancePtr->Params.Rn, InstancePtr->Params.Km, InstancePtr->Params.Rrx,
		InstancePtr->Params.Rtx, MsgPtr->LCSendLPrime.LPrime);
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_DEBUG, XHDCP22_RX_LOG_DEBUG_COMPUTE_LPRIME_DONE);

	/* Generate LC_Send_L_prime message */
	MsgPtr->LCSendLPrime.MsgId = XHDCP22_RX_MSG_ID_LCSENDLPRIME;

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

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

	/* Record LPrime parameter */
	memcpy(InstancePtr->Params.LPrime, MsgPtr->LCSendLPrime.LPrime, XHDCP22_RX_LPRIME_SIZE);

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

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
* This function computes LPrime, generates LC_Send_L_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     The LCSendLPrime message must be available for the transmitter
*           within 20ms after receiving LCInit.
******************************************************************************/
This function computes LPrime, generates LC_Send_L_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 LPrime generates LC_Send_L_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_SendMessageLCSendLPrime(XHdcp22_Rx *InstancePtr)
{
	Xil_AssertNonvoid(InstancePtr != NULL);
	XHdcp22_Rx_Message *MsgPtr = (XHdcp22_Rx_Message*)InstancePtr->MessageBuffer;
	u32 Offset;
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_DEBUG, XHDCP22_RX_LOG_DEBUG_COMPUTE_LPRIME);
	XHdcp22Rx_ComputeLPrime(InstancePtr->Params.Rn, InstancePtr->Params.Km, InstancePtr->Params.Rrx,
		InstancePtr->Params.Rtx, MsgPtr->LCSendLPrime.LPrime);
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_DEBUG, XHDCP22_RX_LOG_DEBUG_COMPUTE_LPRIME_DONE);
	MsgPtr->LCSendLPrime.MsgId = XHDCP22_RX_MSG_ID_LCSENDLPRIME;
	InstancePtr->Handles.DdcSetAddressCallback(InstancePtr->Handles.DdcSetAddressCallbackRef,
		XHDCP22_RX_DDC_READ_REG);
	for(Offset = 0; Offset < sizeof(XHdcp22_Rx_LCSendLPrime); Offset++)
	{
		InstancePtr->Handles.DdcSetDataCallback(InstancePtr->Handles.DdcSetDataCallbackRef,
			InstancePtr->MessageBuffer[Offset]);
	}
	XHdcp22Rx_SetRxStatus(InstancePtr, sizeof(XHdcp22_Rx_LCSendLPrime),
		InstancePtr->Info.ReauthReq, InstancePtr->Info.TopologyReady);
	memcpy(InstancePtr->Params.LPrime, MsgPtr->LCSendLPrime.LPrime, XHDCP22_RX_LPRIME_SIZE);
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_INFO_MESSAGE, XHDCP22_RX_MSG_ID_LCSENDLPRIME);
	return XST_SUCCESS;
}
static int XHdcp22Rx_SendMessageLCSendLPrime ( XHdcp22_Rx * InstancePtr ) { Xil_AssertNonvoid ( InstancePtr != NULL ) ; XHdcp22_Rx_Message * MsgPtr = ( XHdcp22_Rx_Message * ) InstancePtr -> MessageBuffer ; u32 Offset ; XHdcp22Rx_LogWr ( InstancePtr , XHDCP22_RX_LOG_EVT_DEBUG , XHDCP22_RX_LOG_DEBUG_COMPUTE_LPRIME ) ; XHdcp22Rx_ComputeLPrime ( InstancePtr -> Params . Rn , InstancePtr -> Params . Km , InstancePtr -> Params . Rrx , InstancePtr -> Params . Rtx , MsgPtr -> LCSendLPrime . LPrime ) ; XHdcp22Rx_LogWr ( InstancePtr , XHDCP22_RX_LOG_EVT_DEBUG , XHDCP22_RX_LOG_DEBUG_COMPUTE_LPRIME_DONE ) ; MsgPtr -> LCSendLPrime . MsgId = XHDCP22_RX_MSG_ID_LCSENDLPRIME ; InstancePtr -> Handles . DdcSetAddressCallback ( InstancePtr -> Handles . DdcSetAddressCallbackRef , XHDCP22_RX_DDC_READ_REG ) ; for ( Offset = 0 ; Offset < sizeof ( XHdcp22_Rx_LCSendLPrime ) ; Offset ++ ) { InstancePtr -> Handles . DdcSetDataCallback ( InstancePtr -> Handles . DdcSetDataCallbackRef , InstancePtr -> MessageBuffer [ Offset ] ) ; } XHdcp22Rx_SetRxStatus ( InstancePtr , sizeof ( XHdcp22_Rx_LCSendLPrime ) , InstancePtr -> Info . ReauthReq , InstancePtr -> Info . TopologyReady ) ; memcpy ( InstancePtr -> Params . LPrime , MsgPtr -> LCSendLPrime . LPrime , XHDCP22_RX_LPRIME_SIZE ) ; XHdcp22Rx_LogWr ( InstancePtr , XHDCP22_RX_LOG_EVT_INFO_MESSAGE , XHDCP22_RX_MSG_ID_LCSENDLPRIME ) ; return XST_SUCCESS ; }
This function computes LPrime, generates LC_Send_L_prime message,
and writes it into the read message buffer.
This function computes LPrime generates LC_Send_L_prime message and writes it into the read message buffer .
/* Verify arguments */ /* Compute LPrime */ /* Generate LC_Send_L_prime message */ /* Write message to buffer */ /* Write message size signaling completion */ /* Record LPrime parameter */ /* Log message write completion */