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

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

	/* Compute MPrime */
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_DEBUG, XHDCP22_RX_LOG_DEBUG_COMPUTE_MPRIME);
	XHdcp22Rx_ComputeMPrime(InstancePtr->Params.StreamIdType, InstancePtr->Params.SeqNumM,
		InstancePtr->Params.Km, InstancePtr->Params.Rrx, InstancePtr->Params.Rtx,
		MsgPtr->RepeaterAuthStreamReady.MPrime);
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_DEBUG, XHDCP22_RX_LOG_DEBUG_COMPUTE_MPRIME_DONE);

	/* Generate RepeaterAuth_Stream_Ready message */
	MsgPtr->RepeaterAuthStreamReady.MsgId = XHDCP22_RX_MSG_ID_REPEATERAUTHSTREAMREADY;

	if (InstancePtr->Config.Protocol == XHDCP22_RX_DP) {
		/*Write message to DPCD registers*/
		XHdcp22Rx_Dp_Write_Dpcd_Msg(InstancePtr);
	} else {
		/* Write message to buffer */
		InstancePtr->Handles.DdcSetAddressCallback(InstancePtr->Handles.DdcSetAddressCallbackRef,
			XHDCP22_RX_DDC_READ_REG);
		for(Offset = 0; Offset < sizeof(XHdcp22_Rx_RepeaterAuthStreamReady); Offset++)
		{
			InstancePtr->Handles.DdcSetDataCallback(InstancePtr->Handles.DdcSetDataCallbackRef,
				InstancePtr->MessageBuffer[Offset]);
		}
	}

	if (InstancePtr->Config.Protocol != XHDCP22_RX_DP) {
		/* Write message size signaling completion */
		XHdcp22Rx_SetRxStatus(InstancePtr, sizeof(XHdcp22_Rx_RepeaterAuthStreamReady),
			InstancePtr->Info.ReauthReq, InstancePtr->Info.TopologyReady);
	}
	/* Record MPrime parameter */
	memcpy(InstancePtr->Params.MPrime, MsgPtr->RepeaterAuthStreamReady.MPrime, XHDCP22_RX_MPRIME_SIZE);

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

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
* This function computes MPrime and sends the RepeaterAuth_Stream_Ready
* message.
*
* @param    InstancePtr is a pointer to the XHdcp22_Rx core instance.
*
* @return   XST_SUCCESS.
*
* @note     None.
******************************************************************************/
This function computes MPrime and sends the RepeaterAuth_Stream_Ready
message.
This function computes MPrime and sends the RepeaterAuth_Stream_Ready message .
static int XHdcp22Rx_SendMessageRepeaterAuthStreamReady(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_MPRIME);
	XHdcp22Rx_ComputeMPrime(InstancePtr->Params.StreamIdType, InstancePtr->Params.SeqNumM,
		InstancePtr->Params.Km, InstancePtr->Params.Rrx, InstancePtr->Params.Rtx,
		MsgPtr->RepeaterAuthStreamReady.MPrime);
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_DEBUG, XHDCP22_RX_LOG_DEBUG_COMPUTE_MPRIME_DONE);
	MsgPtr->RepeaterAuthStreamReady.MsgId = XHDCP22_RX_MSG_ID_REPEATERAUTHSTREAMREADY;
	if (InstancePtr->Config.Protocol == XHDCP22_RX_DP) {
		XHdcp22Rx_Dp_Write_Dpcd_Msg(InstancePtr);
	} else {
		InstancePtr->Handles.DdcSetAddressCallback(InstancePtr->Handles.DdcSetAddressCallbackRef,
			XHDCP22_RX_DDC_READ_REG);
		for(Offset = 0; Offset < sizeof(XHdcp22_Rx_RepeaterAuthStreamReady); Offset++)
		{
			InstancePtr->Handles.DdcSetDataCallback(InstancePtr->Handles.DdcSetDataCallbackRef,
				InstancePtr->MessageBuffer[Offset]);
		}
	}
	if (InstancePtr->Config.Protocol != XHDCP22_RX_DP) {
		XHdcp22Rx_SetRxStatus(InstancePtr, sizeof(XHdcp22_Rx_RepeaterAuthStreamReady),
			InstancePtr->Info.ReauthReq, InstancePtr->Info.TopologyReady);
	}
	memcpy(InstancePtr->Params.MPrime, MsgPtr->RepeaterAuthStreamReady.MPrime, XHDCP22_RX_MPRIME_SIZE);
	XHdcp22Rx_LogWr(InstancePtr, XHDCP22_RX_LOG_EVT_INFO_MESSAGE, XHDCP22_RX_MSG_ID_REPEATERAUTHSTREAMREADY);
	return XST_SUCCESS;
}
static int XHdcp22Rx_SendMessageRepeaterAuthStreamReady ( 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_MPRIME ) ; XHdcp22Rx_ComputeMPrime ( InstancePtr -> Params . StreamIdType , InstancePtr -> Params . SeqNumM , InstancePtr -> Params . Km , InstancePtr -> Params . Rrx , InstancePtr -> Params . Rtx , MsgPtr -> RepeaterAuthStreamReady . MPrime ) ; XHdcp22Rx_LogWr ( InstancePtr , XHDCP22_RX_LOG_EVT_DEBUG , XHDCP22_RX_LOG_DEBUG_COMPUTE_MPRIME_DONE ) ; MsgPtr -> RepeaterAuthStreamReady . MsgId = XHDCP22_RX_MSG_ID_REPEATERAUTHSTREAMREADY ; if ( InstancePtr -> Config . Protocol == XHDCP22_RX_DP ) { XHdcp22Rx_Dp_Write_Dpcd_Msg ( InstancePtr ) ; } else { InstancePtr -> Handles . DdcSetAddressCallback ( InstancePtr -> Handles . DdcSetAddressCallbackRef , XHDCP22_RX_DDC_READ_REG ) ; for ( Offset = 0 ; Offset < sizeof ( XHdcp22_Rx_RepeaterAuthStreamReady ) ; Offset ++ ) { InstancePtr -> Handles . DdcSetDataCallback ( InstancePtr -> Handles . DdcSetDataCallbackRef , InstancePtr -> MessageBuffer [ Offset ] ) ; } } if ( InstancePtr -> Config . Protocol != XHDCP22_RX_DP ) { XHdcp22Rx_SetRxStatus ( InstancePtr , sizeof ( XHdcp22_Rx_RepeaterAuthStreamReady ) , InstancePtr -> Info . ReauthReq , InstancePtr -> Info . TopologyReady ) ; } memcpy ( InstancePtr -> Params . MPrime , MsgPtr -> RepeaterAuthStreamReady . MPrime , XHDCP22_RX_MPRIME_SIZE ) ; XHdcp22Rx_LogWr ( InstancePtr , XHDCP22_RX_LOG_EVT_INFO_MESSAGE , XHDCP22_RX_MSG_ID_REPEATERAUTHSTREAMREADY ) ; return XST_SUCCESS ; }
This function computes MPrime and sends the RepeaterAuth_Stream_Ready
message.
This function computes MPrime and sends the RepeaterAuth_Stream_Ready message .
/* Verify arguments */ /* Compute MPrime */ /* Generate RepeaterAuth_Stream_Ready message */ /*Write message to DPCD registers*/ /* Write message to buffer */ /* Write message size signaling completion */ /* Record MPrime parameter */ /* Log message write completion */