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

	XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG,
	                XHDCP22_TX_LOG_DBG_TX_STOREDKM);

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

	memcpy(MsgPtr->Message.AKEStoredKm.EKhKm, PairingInfoPtr->Ekh_Km,
	       sizeof(MsgPtr->Message.AKEStoredKm.EKhKm));
	memcpy(MsgPtr->Message.AKEStoredKm.Rtx, PairingInfoPtr->Rtx,
	       sizeof(MsgPtr->Message.AKEStoredKm.Rtx));
	memcpy(MsgPtr->Message.AKEStoredKm.Rrx, PairingInfoPtr->Rrx,
	       sizeof(MsgPtr->Message.AKEStoredKm.Rrx));
	if (InstancePtr->Config.Protocol == XHDCP22_TX_DP) {
		xdbg_printf(XDBG_DEBUG_GENERAL,
				"HDCP22TX: Writing AKE_STORED_KM\n\r");
		return XHdcp22Tx_Dp_Write_Dpcd_Msg(InstancePtr);

	} else {
		/* Execute write */
		return InstancePtr->DdcWrite(XHDCP22_TX_DDC_BASE_ADDRESS,
				sizeof(XHdcp22_Tx_AKEStoredKm)+1, (u8 *)MsgPtr,
				(TRUE), InstancePtr->DdcHandlerRef);
	}
}
/*****************************************************************************/
/**
*
* This function issues a AKE_Stored_km message
*
* @param  InstancePtr is a pointer to the XHdcp22Tx core instance.
* @param  MsgBufferPtr the buffer to use for messaging.
*
* @return
*         - XST_SUCCESS if writing succeeded
*         - XST_FAILURE if failed to write
*
* @note   None.
*
******************************************************************************/
This function issues a AKE_Stored_km message
This function issues a AKE_Stored_km message
static int XHdcp22Tx_WriteAKEStoredKm(XHdcp22_Tx *InstancePtr,
                                       const XHdcp22_Tx_PairingInfo *PairingInfoPtr)
{
	XHdcp22_Tx_DDCMessage* MsgPtr =
	                       (XHdcp22_Tx_DDCMessage*)InstancePtr->MessageBuffer;
	XHdcp22Tx_LogWr(InstancePtr, XHDCP22_TX_LOG_EVT_DBG,
	                XHDCP22_TX_LOG_DBG_TX_STOREDKM);
	MsgPtr->DdcAddress = XHDCP22_TX_HDCPPORT_WRITE_MSG_OFFSET;
	MsgPtr->Message.MsgId = XHDCP22_TX_AKE_STORED_KM;
	memcpy(MsgPtr->Message.AKEStoredKm.EKhKm, PairingInfoPtr->Ekh_Km,
	       sizeof(MsgPtr->Message.AKEStoredKm.EKhKm));
	memcpy(MsgPtr->Message.AKEStoredKm.Rtx, PairingInfoPtr->Rtx,
	       sizeof(MsgPtr->Message.AKEStoredKm.Rtx));
	memcpy(MsgPtr->Message.AKEStoredKm.Rrx, PairingInfoPtr->Rrx,
	       sizeof(MsgPtr->Message.AKEStoredKm.Rrx));
	if (InstancePtr->Config.Protocol == XHDCP22_TX_DP) {
		xdbg_printf(XDBG_DEBUG_GENERAL,
				"HDCP22TX: Writing AKE_STORED_KM\n\r");
		return XHdcp22Tx_Dp_Write_Dpcd_Msg(InstancePtr);
	} else {
		return InstancePtr->DdcWrite(XHDCP22_TX_DDC_BASE_ADDRESS,
				sizeof(XHdcp22_Tx_AKEStoredKm)+1, (u8 *)MsgPtr,
				(TRUE), InstancePtr->DdcHandlerRef);
	}
}
static int XHdcp22Tx_WriteAKEStoredKm ( XHdcp22_Tx * InstancePtr , const XHdcp22_Tx_PairingInfo * PairingInfoPtr ) { XHdcp22_Tx_DDCMessage * MsgPtr = ( XHdcp22_Tx_DDCMessage * ) InstancePtr -> MessageBuffer ; XHdcp22Tx_LogWr ( InstancePtr , XHDCP22_TX_LOG_EVT_DBG , XHDCP22_TX_LOG_DBG_TX_STOREDKM ) ; MsgPtr -> DdcAddress = XHDCP22_TX_HDCPPORT_WRITE_MSG_OFFSET ; MsgPtr -> Message . MsgId = XHDCP22_TX_AKE_STORED_KM ; memcpy ( MsgPtr -> Message . AKEStoredKm . EKhKm , PairingInfoPtr -> Ekh_Km , sizeof ( MsgPtr -> Message . AKEStoredKm . EKhKm ) ) ; memcpy ( MsgPtr -> Message . AKEStoredKm . Rtx , PairingInfoPtr -> Rtx , sizeof ( MsgPtr -> Message . AKEStoredKm . Rtx ) ) ; memcpy ( MsgPtr -> Message . AKEStoredKm . Rrx , PairingInfoPtr -> Rrx , sizeof ( MsgPtr -> Message . AKEStoredKm . Rrx ) ) ; if ( InstancePtr -> Config . Protocol == XHDCP22_TX_DP ) { xdbg_printf ( XDBG_DEBUG_GENERAL , " \n \r " ) ; return XHdcp22Tx_Dp_Write_Dpcd_Msg ( InstancePtr ) ; } else { return InstancePtr -> DdcWrite ( XHDCP22_TX_DDC_BASE_ADDRESS , sizeof ( XHdcp22_Tx_AKEStoredKm ) + 1 , ( u8 * ) MsgPtr , ( TRUE ) , InstancePtr -> DdcHandlerRef ) ; } }
This function issues a AKE_Stored_km message
This function issues a AKE_Stored_km message
/* Execute write */