XilinxProcessorIPLib/drivers/hdcp1x/src/xhdcp1x_tx.c
static void XHdcp1x_TxRunWaitForReadyState(XHdcp1x *InstancePtr,
		XHdcp1x_EventType Event, XHdcp1x_StateType *NextStatePtr)
{
	/* Case-wise process the kind of event called */
	switch (Event) {
		/* For authenticate */
		case XHDCP1X_EVENT_AUTHENTICATE:
			*NextStatePtr = XHDCP1X_STATE_DETERMINERXCAPABLE;
			break;

		/* For disable */
		case XHDCP1X_EVENT_DISABLE:
			*NextStatePtr = XHDCP1X_STATE_DISABLED;
			break;

		/* For physical layer down */
		case XHDCP1X_EVENT_PHYDOWN:
			*NextStatePtr = XHDCP1X_STATE_PHYDOWN;
			break;

		/* For poll */
		case XHDCP1X_EVENT_POLL:
#if (defined(XPAR_XV_HDMITX_NUM_INSTANCES) && \
     (XPAR_XV_HDMITX_NUM_INSTANCES > 0)) || \
    (defined(XPAR_XV_HDMITX1_NUM_INSTANCES) && \
     (XPAR_XV_HDMITX1_NUM_INSTANCES > 0))
			/* Don't read the Repeater info for HDMI from a
			 * poll from application. We'll poll every 100ms. */
#else
			/* Attempt to read the repeater info */
			XHdcp1x_TxPollForWaitForReady(InstancePtr,
				NextStatePtr);
#endif
			break;

		/* For reading the READY bit in BStatus register of the
		 * attached downstream device.
		 */
		case XHDCP1X_EVENT_READDOWNSTREAM:
			XHdcp1x_TxPollForWaitForReady(InstancePtr,
				NextStatePtr);
			break;

		/* For timeout */
		case XHDCP1X_EVENT_TIMEOUT:
			XHdcp1x_TxDebugLog(InstancePtr,
					"wait-for-ready timeout");
#if (defined(XPAR_XV_HDMITX_NUM_INSTANCES) && \
     (XPAR_XV_HDMITX_NUM_INSTANCES > 0)) || \
    (defined(XPAR_XV_HDMITX1_NUM_INSTANCES) && \
     (XPAR_XV_HDMITX1_NUM_INSTANCES > 0))
			InstancePtr->Tx.WaitForReadyPollCntFlag++;
			XHdcp1x_TxStopTimer(InstancePtr);
			XHdcp1x_TxPollForWaitForReady(InstancePtr,
						      NextStatePtr);
			if (InstancePtr->Tx.WaitForReadyPollCntFlag >
					XHDCP1X_MAX_BCAPS_RDY_POLL_CNT) {
				*NextStatePtr = XHDCP1X_STATE_UNAUTHENTICATED;
				InstancePtr->Tx.WaitForReadyPollCntFlag = 0;
			} else {
				if (*NextStatePtr == XHDCP1X_STATE_READKSVLIST ||
				    *NextStatePtr == XHDCP1X_STATE_UNAUTHENTICATED) {
					/* Do nothing, timer
					 * is already stopped */
				} else {
					XHdcp1x_TxStartTimer(InstancePtr, XVPHY_TMO_100MS);
				}
			}
#else
			/* Poll on DisplayPort to check
			 * if the READY bit is set. */
			XHdcp1x_TxPollForWaitForReady(InstancePtr,
						      NextStatePtr);
			if (*NextStatePtr == XHDCP1X_STATE_WAITFORREADY) {
				*NextStatePtr = XHDCP1X_STATE_UNAUTHENTICATED;
			}
#endif
			break;

		/* Otherwise */
		default:
			/* Do nothing */
			break;
	}
}
/*****************************************************************************/
/**
* This function runs the "wait-for-ready" state of the transmit state machine.
*
* @param	InstancePtr is the transmitter instance.
* @param	Event is the event to process.
* @param	NextStatePtr is the next state.
*
* @return	None.
*
* @note		None.
*
******************************************************************************/
This function runs the "wait-for-ready" state of the transmit state machine.
This function runs the " wait - for - ready " state of the transmit state machine .
static void XHdcp1x_TxRunWaitForReadyState(XHdcp1x *InstancePtr,
		XHdcp1x_EventType Event, XHdcp1x_StateType *NextStatePtr)
{
	switch (Event) {
		case XHDCP1X_EVENT_AUTHENTICATE:
			*NextStatePtr = XHDCP1X_STATE_DETERMINERXCAPABLE;
			break;
		case XHDCP1X_EVENT_DISABLE:
			*NextStatePtr = XHDCP1X_STATE_DISABLED;
			break;
		case XHDCP1X_EVENT_PHYDOWN:
			*NextStatePtr = XHDCP1X_STATE_PHYDOWN;
			break;
		case XHDCP1X_EVENT_POLL:
#if (defined(XPAR_XV_HDMITX_NUM_INSTANCES) && \
     (XPAR_XV_HDMITX_NUM_INSTANCES > 0)) || \
    (defined(XPAR_XV_HDMITX1_NUM_INSTANCES) && \
     (XPAR_XV_HDMITX1_NUM_INSTANCES > 0))
#else
			XHdcp1x_TxPollForWaitForReady(InstancePtr,
				NextStatePtr);
#endif
			break;
		case XHDCP1X_EVENT_READDOWNSTREAM:
			XHdcp1x_TxPollForWaitForReady(InstancePtr,
				NextStatePtr);
			break;
		case XHDCP1X_EVENT_TIMEOUT:
			XHdcp1x_TxDebugLog(InstancePtr,
					"wait-for-ready timeout");
#if (defined(XPAR_XV_HDMITX_NUM_INSTANCES) && \
     (XPAR_XV_HDMITX_NUM_INSTANCES > 0)) || \
    (defined(XPAR_XV_HDMITX1_NUM_INSTANCES) && \
     (XPAR_XV_HDMITX1_NUM_INSTANCES > 0))
			InstancePtr->Tx.WaitForReadyPollCntFlag++;
			XHdcp1x_TxStopTimer(InstancePtr);
			XHdcp1x_TxPollForWaitForReady(InstancePtr,
						      NextStatePtr);
			if (InstancePtr->Tx.WaitForReadyPollCntFlag >
					XHDCP1X_MAX_BCAPS_RDY_POLL_CNT) {
				*NextStatePtr = XHDCP1X_STATE_UNAUTHENTICATED;
				InstancePtr->Tx.WaitForReadyPollCntFlag = 0;
			} else {
				if (*NextStatePtr == XHDCP1X_STATE_READKSVLIST ||
				    *NextStatePtr == XHDCP1X_STATE_UNAUTHENTICATED) {
				} else {
					XHdcp1x_TxStartTimer(InstancePtr, XVPHY_TMO_100MS);
				}
			}
#else
			XHdcp1x_TxPollForWaitForReady(InstancePtr,
						      NextStatePtr);
			if (*NextStatePtr == XHDCP1X_STATE_WAITFORREADY) {
				*NextStatePtr = XHDCP1X_STATE_UNAUTHENTICATED;
			}
#endif
			break;
		default:
			break;
	}
}
static void XHdcp1x_TxRunWaitForReadyState ( XHdcp1x * InstancePtr , XHdcp1x_EventType Event , XHdcp1x_StateType * NextStatePtr ) { switch ( Event ) { case XHDCP1X_EVENT_AUTHENTICATE : * NextStatePtr = XHDCP1X_STATE_DETERMINERXCAPABLE ; break ; case XHDCP1X_EVENT_DISABLE : * NextStatePtr = XHDCP1X_STATE_DISABLED ; break ; case XHDCP1X_EVENT_PHYDOWN : * NextStatePtr = XHDCP1X_STATE_PHYDOWN ; break ; case XHDCP1X_EVENT_POLL : #if ( defined ( XPAR_XV_HDMITX_NUM_INSTANCES ) && ( XPAR_XV_HDMITX_NUM_INSTANCES > 0 ) ) || ( defined ( XPAR_XV_HDMITX1_NUM_INSTANCES ) && ( XPAR_XV_HDMITX1_NUM_INSTANCES > 0 ) ) #else XHdcp1x_TxPollForWaitForReady ( InstancePtr , NextStatePtr ) ; #endif break ; case XHDCP1X_EVENT_READDOWNSTREAM : XHdcp1x_TxPollForWaitForReady ( InstancePtr , NextStatePtr ) ; break ; case XHDCP1X_EVENT_TIMEOUT : XHdcp1x_TxDebugLog ( InstancePtr , " " ) ; #if ( defined ( XPAR_XV_HDMITX_NUM_INSTANCES ) && ( XPAR_XV_HDMITX_NUM_INSTANCES > 0 ) ) || ( defined ( XPAR_XV_HDMITX1_NUM_INSTANCES ) && ( XPAR_XV_HDMITX1_NUM_INSTANCES > 0 ) ) InstancePtr -> Tx . WaitForReadyPollCntFlag ++ ; XHdcp1x_TxStopTimer ( InstancePtr ) ; XHdcp1x_TxPollForWaitForReady ( InstancePtr , NextStatePtr ) ; if ( InstancePtr -> Tx . WaitForReadyPollCntFlag > XHDCP1X_MAX_BCAPS_RDY_POLL_CNT ) { * NextStatePtr = XHDCP1X_STATE_UNAUTHENTICATED ; InstancePtr -> Tx . WaitForReadyPollCntFlag = 0 ; } else { if ( * NextStatePtr == XHDCP1X_STATE_READKSVLIST || * NextStatePtr == XHDCP1X_STATE_UNAUTHENTICATED ) { } else { XHdcp1x_TxStartTimer ( InstancePtr , XVPHY_TMO_100MS ) ; } } #else XHdcp1x_TxPollForWaitForReady ( InstancePtr , NextStatePtr ) ; if ( * NextStatePtr == XHDCP1X_STATE_WAITFORREADY ) { * NextStatePtr = XHDCP1X_STATE_UNAUTHENTICATED ; } #endif break ; default : break ; } }
This function runs the "wait-for-ready" state of the transmit state machine.
This function runs the " wait - for - ready " state of the transmit state machine .
/* Case-wise process the kind of event called */ /* For authenticate */ /* For disable */ /* For physical layer down */ /* For poll */ /* Don't read the Repeater info for HDMI from a
			 * poll from application. We'll poll every 100ms. */ /* Attempt to read the repeater info */ /* For reading the READY bit in BStatus register of the
		 * attached downstream device.
		 */ /* For timeout */ /* Do nothing, timer
					 * is already stopped */ /* Poll on DisplayPort to check
			 * if the READY bit is set. */ /* Otherwise */ /* Do nothing */