XilinxProcessorIPLib/drivers/hdcp22_tx_dp/src/xhdcp22_tx.c
static XHdcp22_Tx_PairingInfo *XHdcp22Tx_UpdatePairingInfo(
	                          XHdcp22_Tx *InstancePtr,
                              const XHdcp22_Tx_PairingInfo *PairingInfo,
                              u8 Ready)
{
	int i = 0;
	int i_match = 0;
	u8 Match = (FALSE);
	XHdcp22_Tx_PairingInfo * PairingInfoPtr = NULL;

	/* Find slot */
	for (i=0; i<XHDCP22_TX_MAX_STORED_PAIRINGINFO; i++) {

		PairingInfoPtr = &InstancePtr->Info.PairingInfo[i];

		/* Look for empty slot */
		if ((PairingInfoPtr->Ready == FALSE) && (Match == FALSE)) {
			i_match = i;
			Match = (TRUE);
		}

		/* Look for match, match overrides empty slot */
		if (memcmp(PairingInfo->ReceiverId, PairingInfoPtr->ReceiverId,
		           XHDCP22_TX_CERT_RCVID_SIZE) == 0) {
			i_match = i;
			break;
		}
	}

	PairingInfoPtr = &InstancePtr->Info.PairingInfo[i_match];

	/* Copy pairing info*/
	memcpy(PairingInfoPtr, PairingInfo, sizeof(XHdcp22_Tx_PairingInfo));

	/* Set table ready */
	PairingInfoPtr->Ready = Ready;

	return PairingInfoPtr;
}
/*****************************************************************************/
/**
*
* This function updates a pairing info entry in the storage.
*
* @param  PairingInfo is a pointer to a pairing info structure.
*
* @return
*         - XST_SUCCESS if there was enough room
*         - XST_FAILURE if there was no room for this receiver
*
* @note   None.
*
******************************************************************************/
This function updates a pairing info entry in the storage.
This function updates a pairing info entry in the storage .
static XHdcp22_Tx_PairingInfo *XHdcp22Tx_UpdatePairingInfo(
	                          XHdcp22_Tx *InstancePtr,
                              const XHdcp22_Tx_PairingInfo *PairingInfo,
                              u8 Ready)
{
	int i = 0;
	int i_match = 0;
	u8 Match = (FALSE);
	XHdcp22_Tx_PairingInfo * PairingInfoPtr = NULL;
	for (i=0; i<XHDCP22_TX_MAX_STORED_PAIRINGINFO; i++) {
		PairingInfoPtr = &InstancePtr->Info.PairingInfo[i];
		if ((PairingInfoPtr->Ready == FALSE) && (Match == FALSE)) {
			i_match = i;
			Match = (TRUE);
		}
		if (memcmp(PairingInfo->ReceiverId, PairingInfoPtr->ReceiverId,
		           XHDCP22_TX_CERT_RCVID_SIZE) == 0) {
			i_match = i;
			break;
		}
	}
	PairingInfoPtr = &InstancePtr->Info.PairingInfo[i_match];
	memcpy(PairingInfoPtr, PairingInfo, sizeof(XHdcp22_Tx_PairingInfo));
	PairingInfoPtr->Ready = Ready;
	return PairingInfoPtr;
}
static XHdcp22_Tx_PairingInfo * XHdcp22Tx_UpdatePairingInfo ( XHdcp22_Tx * InstancePtr , const XHdcp22_Tx_PairingInfo * PairingInfo , u8 Ready ) { int i = 0 ; int i_match = 0 ; u8 Match = ( FALSE ) ; XHdcp22_Tx_PairingInfo * PairingInfoPtr = NULL ; for ( i = 0 ; i < XHDCP22_TX_MAX_STORED_PAIRINGINFO ; i ++ ) { PairingInfoPtr = & InstancePtr -> Info . PairingInfo [ i ] ; if ( ( PairingInfoPtr -> Ready == FALSE ) && ( Match == FALSE ) ) { i_match = i ; Match = ( TRUE ) ; } if ( memcmp ( PairingInfo -> ReceiverId , PairingInfoPtr -> ReceiverId , XHDCP22_TX_CERT_RCVID_SIZE ) == 0 ) { i_match = i ; break ; } } PairingInfoPtr = & InstancePtr -> Info . PairingInfo [ i_match ] ; memcpy ( PairingInfoPtr , PairingInfo , sizeof ( XHdcp22_Tx_PairingInfo ) ) ; PairingInfoPtr -> Ready = Ready ; return PairingInfoPtr ; }
This function updates a pairing info entry in the storage.
This function updates a pairing info entry in the storage .
/* Find slot */ /* Look for empty slot */ /* Look for match, match overrides empty slot */ /* Copy pairing info*/ /* Set table ready */