XilinxProcessorIPLib/drivers/hdcp1x/src/xhdcp1x_cipher_intr.c
int XHdcp1x_CipherSetCallback(XHdcp1x *InstancePtr, u32 HandlerType,
                XHdcp1x_Callback CallbackFunc, void *CallbackRef)
{
	u32 Status = XST_SUCCESS;

	/* Verify arguments. */
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(HandlerType >= XHDCP1X_CIPHER_HANDLER_LINK_FAILURE);
	Xil_AssertNonvoid(CallbackFunc != NULL);
	Xil_AssertNonvoid(CallbackRef != NULL);

	/* Check for handler type */
	switch (HandlerType) {
		/* Link Failure Callback */
		case (XHDCP1X_CIPHER_HANDLER_LINK_FAILURE):
			InstancePtr->Cipher.LinkFailCallback = CallbackFunc;
			InstancePtr->Cipher.LinkFailRef = CallbackRef;
			InstancePtr->Cipher.IsLinkFailCallbackSet = (TRUE);
			break;

		/* Ri Update Callback */
		case (XHDCP1X_CIPHER_HANDLER_Ri_UPDATE):
			InstancePtr->Cipher.RiUpdateCallback = CallbackFunc;
			InstancePtr->Cipher.RiUpdateRef = CallbackRef;
			InstancePtr->Cipher.IsRiUpdateCallbackSet = (TRUE);
			break;

		default:
			Status = (XST_INVALID_PARAM);
			break;
	}

	return (Status);
}
/*****************************************************************************/
/**
* This function installs an asynchronous callback function for the given
* HandlerType:
*
* <pre>
* HandlerType                             Callback Function Type
* -----------------------------------     -----------------------------------
* (XHDCP1X_CIPHER_HANDLER_LINK_FAILURE)   LinkFailCallback
* (XHDCP1X_CIPHER_HANDLER_Ri_UPDATE)      RiUpdateCallback
* </pre>
*
* @param	InstancePtr is a pointer to the HDCP cipher core instance.
* @param	HandlerType specifies the type of handler.
* @param	CallbackFunc is the address of the callback function.
* @param	CallbackRef is a user data item that will be passed to the
*		callback function when it is invoked.
*
* @return
*		- XST_SUCCESS if callback function installed successfully.
*		- XST_INVALID_PARAM when HandlerType is invalid.
*
* @note		Invoking this function for a handler that already has been
*		installed replaces it with the new handler.
*
******************************************************************************/
This function installs an asynchronous callback function for the given
HandlerType.


HandlerType                             Callback Function Type


This function installs an asynchronous callback function for the given HandlerType . HandlerType Callback Function Type
int XHdcp1x_CipherSetCallback(XHdcp1x *InstancePtr, u32 HandlerType,
                XHdcp1x_Callback CallbackFunc, void *CallbackRef)
{
	u32 Status = XST_SUCCESS;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(HandlerType >= XHDCP1X_CIPHER_HANDLER_LINK_FAILURE);
	Xil_AssertNonvoid(CallbackFunc != NULL);
	Xil_AssertNonvoid(CallbackRef != NULL);
	switch (HandlerType) {
		case (XHDCP1X_CIPHER_HANDLER_LINK_FAILURE):
			InstancePtr->Cipher.LinkFailCallback = CallbackFunc;
			InstancePtr->Cipher.LinkFailRef = CallbackRef;
			InstancePtr->Cipher.IsLinkFailCallbackSet = (TRUE);
			break;
		case (XHDCP1X_CIPHER_HANDLER_Ri_UPDATE):
			InstancePtr->Cipher.RiUpdateCallback = CallbackFunc;
			InstancePtr->Cipher.RiUpdateRef = CallbackRef;
			InstancePtr->Cipher.IsRiUpdateCallbackSet = (TRUE);
			break;
		default:
			Status = (XST_INVALID_PARAM);
			break;
	}
	return (Status);
}
int XHdcp1x_CipherSetCallback ( XHdcp1x * InstancePtr , u32 HandlerType , XHdcp1x_Callback CallbackFunc , void * CallbackRef ) { u32 Status = XST_SUCCESS ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( HandlerType >= XHDCP1X_CIPHER_HANDLER_LINK_FAILURE ) ; Xil_AssertNonvoid ( CallbackFunc != NULL ) ; Xil_AssertNonvoid ( CallbackRef != NULL ) ; switch ( HandlerType ) { case ( XHDCP1X_CIPHER_HANDLER_LINK_FAILURE ) : InstancePtr -> Cipher . LinkFailCallback = CallbackFunc ; InstancePtr -> Cipher . LinkFailRef = CallbackRef ; InstancePtr -> Cipher . IsLinkFailCallbackSet = ( TRUE ) ; break ; case ( XHDCP1X_CIPHER_HANDLER_Ri_UPDATE ) : InstancePtr -> Cipher . RiUpdateCallback = CallbackFunc ; InstancePtr -> Cipher . RiUpdateRef = CallbackRef ; InstancePtr -> Cipher . IsRiUpdateCallbackSet = ( TRUE ) ; break ; default : Status = ( XST_INVALID_PARAM ) ; break ; } return ( Status ) ; }
This function installs an asynchronous callback function for the given
HandlerType:
This function installs an asynchronous callback function for the given HandlerType :
/* Verify arguments. */ /* Check for handler type */ /* Link Failure Callback */ /* Ri Update Callback */