XilinxProcessorIPLib/drivers/hdcp1x/src/xhdcp1x_rx.c
static void XHdcp1x_RxPollForComputations(XHdcp1x *InstancePtr,
		XHdcp1x_StateType *NextStatePtr)
{
	/* Check for done */
	if (XHdcp1x_CipherIsRequestComplete(InstancePtr)) {
		u8 Buf[4];
		u16 Ro = 0;

		/* Log */
		XHdcp1x_RxDebugLog(InstancePtr, "computations complete");

		/* Read theRo */
		Ro = XHdcp1x_CipherGetRo(InstancePtr);

		/* Initialize Buf */
		memset(Buf, 0, 4);
		XHDCP1X_PORT_UINT_TO_BUF(Buf, Ro, 16);

		/* Update the value of Ro' */
		XHdcp1x_PortWrite(InstancePtr, XHDCP1X_PORT_OFFSET_RO,
				Buf, 2);

#if (defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && \
     (XPAR_XV_HDMIRX_NUM_INSTANCES > 0)) || \
    (defined(XPAR_XV_HDMIRX1_NUM_INSTANCES) && \
     (XPAR_XV_HDMIRX1_NUM_INSTANCES > 0))
		/* No reset required in the sofware for HDMI. KSV fifo
		 * pointer reset is implemented in the hardware. */

#else
		u32 KSVPtrReset = 0;

		/* Reset the KSV FIFO read pointer to ox6802C */
		XHdcp1x_PortRead(InstancePtr, XHDCP1X_PORT_HDCP_RESET_KSV,
				&KSVPtrReset, 4);
		KSVPtrReset |= XHDCP1X_PORT_HDCP_RESET_KSV_RST;
		XHdcp1x_PortWrite(InstancePtr, XHDCP1X_PORT_HDCP_RESET_KSV,
				&KSVPtrReset, 4);

		KSVPtrReset &= ~XHDCP1X_PORT_HDCP_RESET_KSV_RST;
		XHdcp1x_PortWrite(InstancePtr, XHDCP1X_PORT_HDCP_RESET_KSV,
				&KSVPtrReset, 4);

#if defined(XHDCP1X_PORT_BIT_BSTATUS_RO_AVAILABLE)
		/* Update the Bstatus to indicate Ro' available */
		XHdcp1x_PortRead(InstancePtr, XHDCP1X_PORT_OFFSET_BSTATUS,
				Buf, XHDCP1X_PORT_SIZE_BSTATUS);
		Buf[0] |= XHDCP1X_PORT_BIT_BSTATUS_RO_AVAILABLE;
		XHdcp1x_PortWrite(InstancePtr, XHDCP1X_PORT_OFFSET_BSTATUS,
				Buf, XHDCP1X_PORT_SIZE_BSTATUS);
#endif

#endif

		if (InstancePtr->IsRepeater) {
			*NextStatePtr = XHDCP1X_STATE_WAITFORDOWNSTREAM;
			if (InstancePtr->Rx.
				IsRepeaterDownstreamAuthCallbackSet) {
				if (InstancePtr->Rx.
					RepeaterDownstreamAuthCallback
							!= NULL) {
				InstancePtr->Rx.RepeaterDownstreamAuthCallback
				(InstancePtr->Rx.RepeaterDownstreamAuthRef);
				}
				else {
					XHdcp1x_RxDebugLog(InstancePtr,
					"Warning: Repeater Downstream"
					"interface not triggered,"
					"CallBack not Initialized !!!");
				}
			}
		}
		else {
			*NextStatePtr = XHDCP1X_STATE_AUTHENTICATED;
		}
	}
	else {
		XHdcp1x_RxDebugLog(InstancePtr, "waiting for computations");
	}
}
/*****************************************************************************/
/**
* This function polls the progress of the computations for a state machine.
*
* @param	InstancePtr is the receiver instance.
* @param	NextStatePtr is the next state.
*
* @return	None.
*
* @note		None.
*
******************************************************************************/
This function polls the progress of the computations for a state machine.
This function polls the progress of the computations for a state machine .
static void XHdcp1x_RxPollForComputations(XHdcp1x *InstancePtr,
		XHdcp1x_StateType *NextStatePtr)
{
	if (XHdcp1x_CipherIsRequestComplete(InstancePtr)) {
		u8 Buf[4];
		u16 Ro = 0;
		XHdcp1x_RxDebugLog(InstancePtr, "computations complete");
		Ro = XHdcp1x_CipherGetRo(InstancePtr);
		memset(Buf, 0, 4);
		XHDCP1X_PORT_UINT_TO_BUF(Buf, Ro, 16);
		XHdcp1x_PortWrite(InstancePtr, XHDCP1X_PORT_OFFSET_RO,
				Buf, 2);
#if (defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && \
     (XPAR_XV_HDMIRX_NUM_INSTANCES > 0)) || \
    (defined(XPAR_XV_HDMIRX1_NUM_INSTANCES) && \
     (XPAR_XV_HDMIRX1_NUM_INSTANCES > 0))
#else
		u32 KSVPtrReset = 0;
		XHdcp1x_PortRead(InstancePtr, XHDCP1X_PORT_HDCP_RESET_KSV,
				&KSVPtrReset, 4);
		KSVPtrReset |= XHDCP1X_PORT_HDCP_RESET_KSV_RST;
		XHdcp1x_PortWrite(InstancePtr, XHDCP1X_PORT_HDCP_RESET_KSV,
				&KSVPtrReset, 4);
		KSVPtrReset &= ~XHDCP1X_PORT_HDCP_RESET_KSV_RST;
		XHdcp1x_PortWrite(InstancePtr, XHDCP1X_PORT_HDCP_RESET_KSV,
				&KSVPtrReset, 4);
#if defined(XHDCP1X_PORT_BIT_BSTATUS_RO_AVAILABLE)
		XHdcp1x_PortRead(InstancePtr, XHDCP1X_PORT_OFFSET_BSTATUS,
				Buf, XHDCP1X_PORT_SIZE_BSTATUS);
		Buf[0] |= XHDCP1X_PORT_BIT_BSTATUS_RO_AVAILABLE;
		XHdcp1x_PortWrite(InstancePtr, XHDCP1X_PORT_OFFSET_BSTATUS,
				Buf, XHDCP1X_PORT_SIZE_BSTATUS);
#endif
#endif
		if (InstancePtr->IsRepeater) {
			*NextStatePtr = XHDCP1X_STATE_WAITFORDOWNSTREAM;
			if (InstancePtr->Rx.
				IsRepeaterDownstreamAuthCallbackSet) {
				if (InstancePtr->Rx.
					RepeaterDownstreamAuthCallback
							!= NULL) {
				InstancePtr->Rx.RepeaterDownstreamAuthCallback
				(InstancePtr->Rx.RepeaterDownstreamAuthRef);
				}
				else {
					XHdcp1x_RxDebugLog(InstancePtr,
					"Warning: Repeater Downstream"
					"interface not triggered,"
					"CallBack not Initialized !!!");
				}
			}
		}
		else {
			*NextStatePtr = XHDCP1X_STATE_AUTHENTICATED;
		}
	}
	else {
		XHdcp1x_RxDebugLog(InstancePtr, "waiting for computations");
	}
}
static void XHdcp1x_RxPollForComputations ( XHdcp1x * InstancePtr , XHdcp1x_StateType * NextStatePtr ) { if ( XHdcp1x_CipherIsRequestComplete ( InstancePtr ) ) { u8 Buf [ 4 ] ; u16 Ro = 0 ; XHdcp1x_RxDebugLog ( InstancePtr , " " ) ; Ro = XHdcp1x_CipherGetRo ( InstancePtr ) ; memset ( Buf , 0 , 4 ) ; XHDCP1X_PORT_UINT_TO_BUF ( Buf , Ro , 16 ) ; XHdcp1x_PortWrite ( InstancePtr , XHDCP1X_PORT_OFFSET_RO , Buf , 2 ) ; #if ( defined ( XPAR_XV_HDMIRX_NUM_INSTANCES ) && ( XPAR_XV_HDMIRX_NUM_INSTANCES > 0 ) ) || ( defined ( XPAR_XV_HDMIRX1_NUM_INSTANCES ) && ( XPAR_XV_HDMIRX1_NUM_INSTANCES > 0 ) ) #else u32 KSVPtrReset = 0 ; XHdcp1x_PortRead ( InstancePtr , XHDCP1X_PORT_HDCP_RESET_KSV , & KSVPtrReset , 4 ) ; KSVPtrReset |= XHDCP1X_PORT_HDCP_RESET_KSV_RST ; XHdcp1x_PortWrite ( InstancePtr , XHDCP1X_PORT_HDCP_RESET_KSV , & KSVPtrReset , 4 ) ; KSVPtrReset &= ~ XHDCP1X_PORT_HDCP_RESET_KSV_RST ; XHdcp1x_PortWrite ( InstancePtr , XHDCP1X_PORT_HDCP_RESET_KSV , & KSVPtrReset , 4 ) ; #if defined ( XHDCP1X_PORT_BIT_BSTATUS_RO_AVAILABLE ) XHdcp1x_PortRead ( InstancePtr , XHDCP1X_PORT_OFFSET_BSTATUS , Buf , XHDCP1X_PORT_SIZE_BSTATUS ) ; Buf [ 0 ] |= XHDCP1X_PORT_BIT_BSTATUS_RO_AVAILABLE ; XHdcp1x_PortWrite ( InstancePtr , XHDCP1X_PORT_OFFSET_BSTATUS , Buf , XHDCP1X_PORT_SIZE_BSTATUS ) ; #endif #endif if ( InstancePtr -> IsRepeater ) { * NextStatePtr = XHDCP1X_STATE_WAITFORDOWNSTREAM ; if ( InstancePtr -> Rx . IsRepeaterDownstreamAuthCallbackSet ) { if ( InstancePtr -> Rx . RepeaterDownstreamAuthCallback != NULL ) { InstancePtr -> Rx . RepeaterDownstreamAuthCallback ( InstancePtr -> Rx . RepeaterDownstreamAuthRef ) ; } else { XHdcp1x_RxDebugLog ( InstancePtr , " " " " " " ) ; } } } else { * NextStatePtr = XHDCP1X_STATE_AUTHENTICATED ; } } else { XHdcp1x_RxDebugLog ( InstancePtr , " " ) ; } }
This function polls the progress of the computations for a state machine.
This function polls the progress of the computations for a state machine .
/* Check for done */ /* Log */ /* Read theRo */ /* Initialize Buf */ /* Update the value of Ro' */ /* No reset required in the sofware for HDMI. KSV fifo
		 * pointer reset is implemented in the hardware. */ /* Reset the KSV FIFO read pointer to ox6802C */ /* Update the Bstatus to indicate Ro' available */