XilinxProcessorIPLib/drivers/hdcp22_rx_dp/src/xhdcp22_rx.c
static int XHdcp22Rx_Dp_Write_Dpcd_Msg(XHdcp22_Rx *InstancePtr)
{
	XHdcp22_Rx_Message buffer;
	int numwritten = 0;

	memcpy(&buffer, InstancePtr->MessageBuffer, sizeof(XHdcp22_Rx_Message));

	switch (buffer.MsgId) {
		case XHDCP22_RX_MSG_ID_AKESENDCERT:
			/*Write CertRx*/
			numwritten = InstancePtr->Handles.RxDpAuxWriteCallback(
					InstancePtr->Handles.
						RxDpAuxWriteCallbackRef,
					CERT_RX_OFFSET,
					buffer.AKESendCert.CertRx,
					CERT_RX_SIZE + R_RX_SIZE + RX_CAPS_SIZE);
			break;
		case XHDCP22_RX_MSG_ID_AKESENDHPRIME:
			/*Write H'*/
			numwritten = InstancePtr->Handles.RxDpAuxWriteCallback(
					InstancePtr->Handles.
						RxDpAuxWriteCallbackRef,
					H_PRIME_OFFSET,
					buffer.AKESendHPrime.HPrime,
					H_PRIME_SIZE);
			break;
		case XHDCP22_RX_MSG_ID_AKESENDPAIRINGINFO:
			/*Write Ake_Send_Pairing info msg*/
			numwritten = InstancePtr->Handles.RxDpAuxWriteCallback(
					InstancePtr->Handles.
					RxDpAuxWriteCallbackRef,
					E_KH_KM_PAIRING_OFFSET,
					buffer.AKESendHPrime.HPrime,
					E_KH_KM_PAIRING_SIZE);
			break;
		case XHDCP22_RX_MSG_ID_LCSENDLPRIME:
			/*Write L'*/
			numwritten = InstancePtr->Handles.RxDpAuxWriteCallback(
					InstancePtr->Handles.
						RxDpAuxWriteCallbackRef,
					L_PRIME_OFFSET,
					buffer.LCSendLPrime.LPrime,
					L_PRIME_SIZE);
			break;
		case XHDCP22_RX_MSG_ID_REPEATERAUTHSENDRXIDLIST:
			/*Write Repeater Auth rcvid List*/
			numwritten = InstancePtr->Handles.RxDpAuxWriteCallback(
					InstancePtr->Handles.
						RxDpAuxWriteCallbackRef,
					RX_INFO_OFFSET,
					buffer.RepeaterAuthSendRxIdList.RxInfo,
					(RX_INFO_SIZE + SEQ_NUM_V_SIZE +
					V_PRIME_SIZE + RCVID_LIST_SIZE));
			break;
		case XHDCP22_RX_MSG_ID_REPEATERAUTHSTREAMREADY:
			/*Write Stream ready*/
			numwritten = InstancePtr->Handles.RxDpAuxWriteCallback(
					InstancePtr->Handles.
						RxDpAuxWriteCallbackRef,
					M_PRIME_OFFSET,
					buffer.RepeaterAuthStreamReady.MPrime,
					M_PRIME_SIZE);
			break;
		default:
			break;
	}

	return numwritten;
}
/*****************************************************************************/
/**
 * This function writes a complete message into the DPCD registers.
 *
 * @param	InstancePtr is a pointer to the XHdcp22_Rx core instance.
 *
 * @return	Size of message read out of read message buffer.
 *
 * @note	For DP there are no msg_ids for all the HDCP msgs,
 * 		But to make less changes in the already existed HDCP22
 * 		statmachine which is written for HDMI,
 * 		Assigned msg_ids for each msg rcvd.
 ******************************************************************************/
This function writes a complete message into the DPCD registers.
@param       InstancePtr is a pointer to the XHdcp22_Rx core instance.

@return      Size of message read out of read message buffer.

@note        For DP there are no msg_ids for all the HDCP msgs,
But to make less changes in the already existed HDCP22
statmachine which is written for HDMI,
Assigned msg_ids for each msg rcvd.
This function writes a complete message into the DPCD registers . @param InstancePtr is a pointer to the XHdcp22_Rx core instance . @return Size of message read out of read message buffer . @note For DP there are no msg_ids for all the HDCP msgs But to make less changes in the already existed HDCP22 statmachine which is written for HDMI Assigned msg_ids for each msg rcvd .
static int XHdcp22Rx_Dp_Write_Dpcd_Msg(XHdcp22_Rx *InstancePtr)
{
	XHdcp22_Rx_Message buffer;
	int numwritten = 0;
	memcpy(&buffer, InstancePtr->MessageBuffer, sizeof(XHdcp22_Rx_Message));
	switch (buffer.MsgId) {
		case XHDCP22_RX_MSG_ID_AKESENDCERT:
			numwritten = InstancePtr->Handles.RxDpAuxWriteCallback(
					InstancePtr->Handles.
						RxDpAuxWriteCallbackRef,
					CERT_RX_OFFSET,
					buffer.AKESendCert.CertRx,
					CERT_RX_SIZE + R_RX_SIZE + RX_CAPS_SIZE);
			break;
		case XHDCP22_RX_MSG_ID_AKESENDHPRIME:
			numwritten = InstancePtr->Handles.RxDpAuxWriteCallback(
					InstancePtr->Handles.
						RxDpAuxWriteCallbackRef,
					H_PRIME_OFFSET,
					buffer.AKESendHPrime.HPrime,
					H_PRIME_SIZE);
			break;
		case XHDCP22_RX_MSG_ID_AKESENDPAIRINGINFO:
			numwritten = InstancePtr->Handles.RxDpAuxWriteCallback(
					InstancePtr->Handles.
					RxDpAuxWriteCallbackRef,
					E_KH_KM_PAIRING_OFFSET,
					buffer.AKESendHPrime.HPrime,
					E_KH_KM_PAIRING_SIZE);
			break;
		case XHDCP22_RX_MSG_ID_LCSENDLPRIME:
			numwritten = InstancePtr->Handles.RxDpAuxWriteCallback(
					InstancePtr->Handles.
						RxDpAuxWriteCallbackRef,
					L_PRIME_OFFSET,
					buffer.LCSendLPrime.LPrime,
					L_PRIME_SIZE);
			break;
		case XHDCP22_RX_MSG_ID_REPEATERAUTHSENDRXIDLIST:
			numwritten = InstancePtr->Handles.RxDpAuxWriteCallback(
					InstancePtr->Handles.
						RxDpAuxWriteCallbackRef,
					RX_INFO_OFFSET,
					buffer.RepeaterAuthSendRxIdList.RxInfo,
					(RX_INFO_SIZE + SEQ_NUM_V_SIZE +
					V_PRIME_SIZE + RCVID_LIST_SIZE));
			break;
		case XHDCP22_RX_MSG_ID_REPEATERAUTHSTREAMREADY:
			numwritten = InstancePtr->Handles.RxDpAuxWriteCallback(
					InstancePtr->Handles.
						RxDpAuxWriteCallbackRef,
					M_PRIME_OFFSET,
					buffer.RepeaterAuthStreamReady.MPrime,
					M_PRIME_SIZE);
			break;
		default:
			break;
	}
	return numwritten;
}
static int XHdcp22Rx_Dp_Write_Dpcd_Msg ( XHdcp22_Rx * InstancePtr ) { XHdcp22_Rx_Message buffer ; int numwritten = 0 ; memcpy ( & buffer , InstancePtr -> MessageBuffer , sizeof ( XHdcp22_Rx_Message ) ) ; switch ( buffer . MsgId ) { case XHDCP22_RX_MSG_ID_AKESENDCERT : numwritten = InstancePtr -> Handles . RxDpAuxWriteCallback ( InstancePtr -> Handles . RxDpAuxWriteCallbackRef , CERT_RX_OFFSET , buffer . AKESendCert . CertRx , CERT_RX_SIZE + R_RX_SIZE + RX_CAPS_SIZE ) ; break ; case XHDCP22_RX_MSG_ID_AKESENDHPRIME : numwritten = InstancePtr -> Handles . RxDpAuxWriteCallback ( InstancePtr -> Handles . RxDpAuxWriteCallbackRef , H_PRIME_OFFSET , buffer . AKESendHPrime . HPrime , H_PRIME_SIZE ) ; break ; case XHDCP22_RX_MSG_ID_AKESENDPAIRINGINFO : numwritten = InstancePtr -> Handles . RxDpAuxWriteCallback ( InstancePtr -> Handles . RxDpAuxWriteCallbackRef , E_KH_KM_PAIRING_OFFSET , buffer . AKESendHPrime . HPrime , E_KH_KM_PAIRING_SIZE ) ; break ; case XHDCP22_RX_MSG_ID_LCSENDLPRIME : numwritten = InstancePtr -> Handles . RxDpAuxWriteCallback ( InstancePtr -> Handles . RxDpAuxWriteCallbackRef , L_PRIME_OFFSET , buffer . LCSendLPrime . LPrime , L_PRIME_SIZE ) ; break ; case XHDCP22_RX_MSG_ID_REPEATERAUTHSENDRXIDLIST : numwritten = InstancePtr -> Handles . RxDpAuxWriteCallback ( InstancePtr -> Handles . RxDpAuxWriteCallbackRef , RX_INFO_OFFSET , buffer . RepeaterAuthSendRxIdList . RxInfo , ( RX_INFO_SIZE + SEQ_NUM_V_SIZE + V_PRIME_SIZE + RCVID_LIST_SIZE ) ) ; break ; case XHDCP22_RX_MSG_ID_REPEATERAUTHSTREAMREADY : numwritten = InstancePtr -> Handles . RxDpAuxWriteCallback ( InstancePtr -> Handles . RxDpAuxWriteCallbackRef , M_PRIME_OFFSET , buffer . RepeaterAuthStreamReady . MPrime , M_PRIME_SIZE ) ; break ; default : break ; } return numwritten ; }
This function writes a complete message into the DPCD registers.
This function writes a complete message into the DPCD registers .
/*Write CertRx*/ /*Write H'*/ /*Write Ake_Send_Pairing info msg*/ /*Write L'*/ /*Write Repeater Auth rcvid List*/ /*Write Stream ready*/