XilinxProcessorIPLib/drivers/hdcp22_tx_dp/src/xhdcp22_tx.c
static int XHdcp22Tx_WriteRepeaterAuth_Stream_Manage(XHdcp22_Tx *InstancePtr)
{
	XHdcp22_Tx_PairingInfo *PairingInfoPtr =
		(XHdcp22_Tx_PairingInfo *)InstancePtr->Info.StateContext;
	XHdcp22_Tx_DDCMessage* MsgPtr =
		(XHdcp22_Tx_DDCMessage*)InstancePtr->MessageBuffer;

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

	/* Value is sent in big endian format */
	MsgPtr->Message.RepeatAuthStreamManage.SeqNum_M[0] = (InstancePtr->Info.SeqNum_M >> 16) & 0xFF; // MSB
	MsgPtr->Message.RepeatAuthStreamManage.SeqNum_M[1] = (InstancePtr->Info.SeqNum_M >> 8)  & 0xFF;
	MsgPtr->Message.RepeatAuthStreamManage.SeqNum_M[2] =  InstancePtr->Info.SeqNum_M        & 0xFF; // LSB

	/* The parameter K is always set to 0x1 by the HDCP transmitter */
	/* Value is sent in big endian format */
	MsgPtr->Message.RepeatAuthStreamManage.K[0] = 0x0; // MSB
	MsgPtr->Message.RepeatAuthStreamManage.K[1] = 0x1; // LSB

	/* StreamID_Type = STREAM_ID || Type */
	/* Value is sent in big endian format */
	MsgPtr->Message.RepeatAuthStreamManage.StreamID_Type[0] = 0x0; // STREAM_ID: must always be 0x0
	MsgPtr->Message.RepeatAuthStreamManage.StreamID_Type[1] = (u8)InstancePtr->Info.ContentStreamType; // Stream Type

	/* To make verifying the MPrime from the repeater easier,
	 * the M is calculated and stored before executing the write */
	XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG, XHDCP22_TX_LOG_DBG_COMPUTE_M);
	XHdcp22Tx_ComputeM(InstancePtr->Info.Rn,
		InstancePtr->Info.Rrx,
		InstancePtr->Info.Rtx,
		MsgPtr->Message.RepeatAuthStreamManage.StreamID_Type,
		MsgPtr->Message.RepeatAuthStreamManage.K,
		MsgPtr->Message.RepeatAuthStreamManage.SeqNum_M,
		PairingInfoPtr->Km,
		InstancePtr->Info.M);
	XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG, XHDCP22_TX_LOG_DBG_COMPUTE_M_DONE);

	/* Increment the M */
	InstancePtr->Info.SeqNum_M += 1;
	/* Seq_num_M is 3 bytes, the variable is a u32.
	 * Mask out the most-significant byte.
	 */
	InstancePtr->Info.SeqNum_M &= 0xFFF;

	if (InstancePtr->Config.Protocol == XHDCP22_TX_DP) {
		return XHdcp22Tx_Dp_Write_Dpcd_Msg(InstancePtr);
	} else {
		/* Execute write */
		return InstancePtr->DdcWrite(XHDCP22_TX_DDC_BASE_ADDRESS,
				XHDCP22_TX_REPEATAUTH_STREAM_MANAGE_SIZE + 1, (u8 *)MsgPtr,
				(TRUE), InstancePtr->DdcHandlerRef);
	}
}
/******************************************************************************/
/**
*
* This function sends the Content Stream Type to the repeater.
*
* @param  InstancePtr is a pointer to the XHdcp22Tx core instance.
*
* @return
*         - XST_SUCCESS if writing succeeded
*         - XST_FAILURE if failed to write
*
* @note   None.
*
******************************************************************************/
This function sends the Content Stream Type to the repeater.
This function sends the Content Stream Type to the repeater .
static int XHdcp22Tx_WriteRepeaterAuth_Stream_Manage(XHdcp22_Tx *InstancePtr)
{
	XHdcp22_Tx_PairingInfo *PairingInfoPtr =
		(XHdcp22_Tx_PairingInfo *)InstancePtr->Info.StateContext;
	XHdcp22_Tx_DDCMessage* MsgPtr =
		(XHdcp22_Tx_DDCMessage*)InstancePtr->MessageBuffer;
	MsgPtr->DdcAddress = XHDCP22_TX_HDCPPORT_WRITE_MSG_OFFSET;
	MsgPtr->Message.MsgId = XHDCP22_TX_REPEATAUTH_STREAM_MANAGE;
	MsgPtr->Message.RepeatAuthStreamManage.SeqNum_M[0] = (InstancePtr->Info.SeqNum_M >> 16) & 0xFF; 
	MsgPtr->Message.RepeatAuthStreamManage.SeqNum_M[1] = (InstancePtr->Info.SeqNum_M >> 8)  & 0xFF;
	MsgPtr->Message.RepeatAuthStreamManage.SeqNum_M[2] =  InstancePtr->Info.SeqNum_M        & 0xFF; 
	MsgPtr->Message.RepeatAuthStreamManage.K[0] = 0x0; 
	MsgPtr->Message.RepeatAuthStreamManage.K[1] = 0x1; 
	MsgPtr->Message.RepeatAuthStreamManage.StreamID_Type[0] = 0x0; 
	MsgPtr->Message.RepeatAuthStreamManage.StreamID_Type[1] = (u8)InstancePtr->Info.ContentStreamType; 
	XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG, XHDCP22_TX_LOG_DBG_COMPUTE_M);
	XHdcp22Tx_ComputeM(InstancePtr->Info.Rn,
		InstancePtr->Info.Rrx,
		InstancePtr->Info.Rtx,
		MsgPtr->Message.RepeatAuthStreamManage.StreamID_Type,
		MsgPtr->Message.RepeatAuthStreamManage.K,
		MsgPtr->Message.RepeatAuthStreamManage.SeqNum_M,
		PairingInfoPtr->Km,
		InstancePtr->Info.M);
	XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG, XHDCP22_TX_LOG_DBG_COMPUTE_M_DONE);
	InstancePtr->Info.SeqNum_M += 1;
	InstancePtr->Info.SeqNum_M &= 0xFFF;
	if (InstancePtr->Config.Protocol == XHDCP22_TX_DP) {
		return XHdcp22Tx_Dp_Write_Dpcd_Msg(InstancePtr);
	} else {
		return InstancePtr->DdcWrite(XHDCP22_TX_DDC_BASE_ADDRESS,
				XHDCP22_TX_REPEATAUTH_STREAM_MANAGE_SIZE + 1, (u8 *)MsgPtr,
				(TRUE), InstancePtr->DdcHandlerRef);
	}
}
static int XHdcp22Tx_WriteRepeaterAuth_Stream_Manage ( XHdcp22_Tx * InstancePtr ) { XHdcp22_Tx_PairingInfo * PairingInfoPtr = ( XHdcp22_Tx_PairingInfo * ) InstancePtr -> Info . StateContext ; XHdcp22_Tx_DDCMessage * MsgPtr = ( XHdcp22_Tx_DDCMessage * ) InstancePtr -> MessageBuffer ; MsgPtr -> DdcAddress = XHDCP22_TX_HDCPPORT_WRITE_MSG_OFFSET ; MsgPtr -> Message . MsgId = XHDCP22_TX_REPEATAUTH_STREAM_MANAGE ; MsgPtr -> Message . RepeatAuthStreamManage . SeqNum_M [ 0 ] = ( InstancePtr -> Info . SeqNum_M >> 16 ) & 0xFF ; MsgPtr -> Message . RepeatAuthStreamManage . SeqNum_M [ 1 ] = ( InstancePtr -> Info . SeqNum_M >> 8 ) & 0xFF ; MsgPtr -> Message . RepeatAuthStreamManage . SeqNum_M [ 2 ] = InstancePtr -> Info . SeqNum_M & 0xFF ; MsgPtr -> Message . RepeatAuthStreamManage . K [ 0 ] = 0x0 ; MsgPtr -> Message . RepeatAuthStreamManage . K [ 1 ] = 0x1 ; MsgPtr -> Message . RepeatAuthStreamManage . StreamID_Type [ 0 ] = 0x0 ; MsgPtr -> Message . RepeatAuthStreamManage . StreamID_Type [ 1 ] = ( u8 ) InstancePtr -> Info . ContentStreamType ; XHdcp22Tx_LogWr ( InstancePtr , XHDCP22_TX_LOG_EVT_DBG , XHDCP22_TX_LOG_DBG_COMPUTE_M ) ; XHdcp22Tx_ComputeM ( InstancePtr -> Info . Rn , InstancePtr -> Info . Rrx , InstancePtr -> Info . Rtx , MsgPtr -> Message . RepeatAuthStreamManage . StreamID_Type , MsgPtr -> Message . RepeatAuthStreamManage . K , MsgPtr -> Message . RepeatAuthStreamManage . SeqNum_M , PairingInfoPtr -> Km , InstancePtr -> Info . M ) ; XHdcp22Tx_LogWr ( InstancePtr , XHDCP22_TX_LOG_EVT_DBG , XHDCP22_TX_LOG_DBG_COMPUTE_M_DONE ) ; InstancePtr -> Info . SeqNum_M += 1 ; InstancePtr -> Info . SeqNum_M &= 0xFFF ; if ( InstancePtr -> Config . Protocol == XHDCP22_TX_DP ) { return XHdcp22Tx_Dp_Write_Dpcd_Msg ( InstancePtr ) ; } else { return InstancePtr -> DdcWrite ( XHDCP22_TX_DDC_BASE_ADDRESS , XHDCP22_TX_REPEATAUTH_STREAM_MANAGE_SIZE + 1 , ( u8 * ) MsgPtr , ( TRUE ) , InstancePtr -> DdcHandlerRef ) ; } }
This function sends the Content Stream Type to the repeater.
This function sends the Content Stream Type to the repeater .
/* Value is sent in big endian format */ // MSB // LSB /* The parameter K is always set to 0x1 by the HDCP transmitter */ /* Value is sent in big endian format */ // MSB // LSB /* StreamID_Type = STREAM_ID || Type */ /* Value is sent in big endian format */ // STREAM_ID: must always be 0x0 // Stream Type /* To make verifying the MPrime from the repeater easier,
	 * the M is calculated and stored before executing the write */ /* Increment the M */ /* Seq_num_M is 3 bytes, the variable is a u32.
	 * Mask out the most-significant byte.
	 */ /* Execute write */