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

	u32 Offset = 0;
	int Status = XST_SUCCESS;
	XHdcp22_Rx_Message *MsgPtr = (XHdcp22_Rx_Message*)InstancePtr->MessageBuffer;

	/* Generate AKE_Send_Cert message */
	MsgPtr->AKESendCert.MsgId = XHDCP22_RX_MSG_ID_AKESENDCERT;
	memcpy(MsgPtr->AKESendCert.RxCaps, InstancePtr->RxCaps, XHDCP22_RX_RXCAPS_SIZE);
	Status = XHdcp22Rx_GenerateRrx(InstancePtr, MsgPtr->AKESendCert.Rrx);
	memcpy(MsgPtr->AKESendCert.CertRx, InstancePtr->PublicCertPtr, XHDCP22_RX_CERT_SIZE);

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

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

	/* Record Rrx and RxCaps */
	memcpy(InstancePtr->Params.Rrx, MsgPtr->AKESendCert.Rrx, XHDCP22_RX_RRX_SIZE);
	memcpy(InstancePtr->Params.RxCaps, MsgPtr->AKESendCert.RxCaps, XHDCP22_RX_RXCAPS_SIZE);

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

	return Status;
}
/*****************************************************************************/
/**
* This function generates the AKE_Send_Cert 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 if message written successfully.
*           - XST_FAILURE if generation of random integer Rrx failed.
*
* @note     This message must be available for the transmitter with 100ms
*           after receiving AKEInit.
******************************************************************************/
This function generates the AKE_Send_Cert 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 generates the AKE_Send_Cert 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_SendMessageAKESendCert(XHdcp22_Rx *InstancePtr)
{
	Xil_AssertNonvoid(InstancePtr != NULL);
	u32 Offset = 0;
	int Status = XST_SUCCESS;
	XHdcp22_Rx_Message *MsgPtr = (XHdcp22_Rx_Message*)InstancePtr->MessageBuffer;
	MsgPtr->AKESendCert.MsgId = XHDCP22_RX_MSG_ID_AKESENDCERT;
	memcpy(MsgPtr->AKESendCert.RxCaps, InstancePtr->RxCaps, XHDCP22_RX_RXCAPS_SIZE);
	Status = XHdcp22Rx_GenerateRrx(InstancePtr, MsgPtr->AKESendCert.Rrx);
	memcpy(MsgPtr->AKESendCert.CertRx, InstancePtr->PublicCertPtr, XHDCP22_RX_CERT_SIZE);
	InstancePtr->Handles.DdcSetAddressCallback(InstancePtr->Handles.DdcSetAddressCallbackRef,
		XHDCP22_RX_DDC_READ_REG);
	for(Offset = 0; Offset < sizeof(XHdcp22_Rx_AKESendCert); Offset++)
	{
		InstancePtr->Handles.DdcSetDataCallback(InstancePtr->Handles.DdcSetDataCallbackRef,
			InstancePtr->MessageBuffer[Offset]);
	}
	XHdcp22Rx_SetRxStatus(InstancePtr, sizeof(XHdcp22_Rx_AKESendCert),
		InstancePtr->Info.ReauthReq, InstancePtr->Info.TopologyReady);
	memcpy(InstancePtr->Params.Rrx, MsgPtr->AKESendCert.Rrx, XHDCP22_RX_RRX_SIZE);
	memcpy(InstancePtr->Params.RxCaps, MsgPtr->AKESendCert.RxCaps, XHDCP22_RX_RXCAPS_SIZE);
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_INFO_MESSAGE, XHDCP22_RX_MSG_ID_AKESENDCERT);
	return Status;
}
static int XHdcp22Rx_SendMessageAKESendCert ( XHdcp22_Rx * InstancePtr ) { Xil_AssertNonvoid ( InstancePtr != NULL ) ; u32 Offset = 0 ; int Status = XST_SUCCESS ; XHdcp22_Rx_Message * MsgPtr = ( XHdcp22_Rx_Message * ) InstancePtr -> MessageBuffer ; MsgPtr -> AKESendCert . MsgId = XHDCP22_RX_MSG_ID_AKESENDCERT ; memcpy ( MsgPtr -> AKESendCert . RxCaps , InstancePtr -> RxCaps , XHDCP22_RX_RXCAPS_SIZE ) ; Status = XHdcp22Rx_GenerateRrx ( InstancePtr , MsgPtr -> AKESendCert . Rrx ) ; memcpy ( MsgPtr -> AKESendCert . CertRx , InstancePtr -> PublicCertPtr , XHDCP22_RX_CERT_SIZE ) ; InstancePtr -> Handles . DdcSetAddressCallback ( InstancePtr -> Handles . DdcSetAddressCallbackRef , XHDCP22_RX_DDC_READ_REG ) ; for ( Offset = 0 ; Offset < sizeof ( XHdcp22_Rx_AKESendCert ) ; Offset ++ ) { InstancePtr -> Handles . DdcSetDataCallback ( InstancePtr -> Handles . DdcSetDataCallbackRef , InstancePtr -> MessageBuffer [ Offset ] ) ; } XHdcp22Rx_SetRxStatus ( InstancePtr , sizeof ( XHdcp22_Rx_AKESendCert ) , InstancePtr -> Info . ReauthReq , InstancePtr -> Info . TopologyReady ) ; memcpy ( InstancePtr -> Params . Rrx , MsgPtr -> AKESendCert . Rrx , XHDCP22_RX_RRX_SIZE ) ; memcpy ( InstancePtr -> Params . RxCaps , MsgPtr -> AKESendCert . RxCaps , XHDCP22_RX_RXCAPS_SIZE ) ; XHdcp22Rx_LogWr ( InstancePtr , XHDCP22_RX_LOG_EVT_INFO_MESSAGE , XHDCP22_RX_MSG_ID_AKESENDCERT ) ; return Status ; }
This function generates the AKE_Send_Cert message and writes it into the
read message buffer.
This function generates the AKE_Send_Cert message and writes it into the read message buffer .
/* Verify arguments */ /* Generate AKE_Send_Cert message */ /* Write message to read buffer */ /* Write message size signaling completion */ /* Record Rrx and RxCaps */ /* Log message write completion */