XilinxProcessorIPLib/drivers/hdcp1x/src/xhdcp1x_rx.c
static void XHdcp1x_RxEnterState(XHdcp1x *InstancePtr, XHdcp1x_StateType State,
		XHdcp1x_StateType *NextStatePtr)
{
	/* Case-wise process the kind of state called */
	switch (State) {
		/* For the disabled state */
		case XHDCP1X_STATE_DISABLED:
			XHdcp1x_RxDisableState(InstancePtr);
			break;

		/* For the unauthenticated state */
		case XHDCP1X_STATE_UNAUTHENTICATED:
			XHdcp1x_RxSetCheckLinkState(InstancePtr, FALSE);
			InstancePtr->Rx.Flags |= XVPHY_FLAG_PHY_UP;
			if (InstancePtr->Rx.IsUnauthenticatedCallbackSet) {
				InstancePtr->Rx.UnauthenticatedCallback(
				InstancePtr->Rx.UnauthenticatedCallbackRef);
			}
			break;

		/* For the computations state */
		case XHDCP1X_STATE_COMPUTATIONS:
			XHdcp1x_RxStartComputations(InstancePtr,
						NextStatePtr);
			break;

		/* For the wait-for-downstream state */
		case XHDCP1X_STATE_WAITFORDOWNSTREAM:
			XHdcp1x_RxSetCheckLinkState(InstancePtr, TRUE);
			XHdcp1x_RxStartTimer(InstancePtr,
			((5 * XVPHY_TMO_1SECOND) + (5 * XVPHY_TMO_100MS)) );
			break;

		/* For assemble KSV list */
		case XHDCP1X_STATE_ASSEMBLEKSVLIST:
			XHdcp1x_RxAssembleKSVList(InstancePtr,
						NextStatePtr);
			break;

		/* For the authenticated state */
		case XHDCP1X_STATE_AUTHENTICATED:
			XHdcp1x_RxDebugLog(InstancePtr, "authenticated");
			XHdcp1x_RxSetCheckLinkState(InstancePtr, TRUE);
			if(InstancePtr->Rx.IsAuthenticatedCallbackSet) {
				InstancePtr->Rx.AuthenticatedCallback(
				InstancePtr->Rx.AuthenticatedCallbackRef);
			}
			XHdcp1x_RxStartTimer(InstancePtr,
					(2 * XVPHY_TMO_1SECOND));
			break;

		/* For the link integrity failed state */
		case XHDCP1X_STATE_LINKINTEGRITYFAILED:
			InstancePtr->Rx.Stats.LinkFailures++;
			XHdcp1x_RxReportLinkIntegrityFailure(InstancePtr,
					NextStatePtr);
			break;

		/* For physical layer down */
		case XHDCP1X_STATE_PHYDOWN:
			InstancePtr->Rx.Flags &= ~XVPHY_FLAG_PHY_UP;
			XHdcp1x_CipherDisable(InstancePtr);
			break;

		/* Otherwise */
		default:
			/* Do nothing */
			break;
	}
}
/*****************************************************************************/
/**
* This function enters a HDCP receiver state.
*
* @param	InstancePtr is the receiver instance.
* @param	State is the state to enter.
* @param	NextStatePtr is the next state.
*
* @return	None.
*
* @note		None.
*
******************************************************************************/
This function enters a HDCP receiver state.
This function enters a HDCP receiver state .
static void XHdcp1x_RxEnterState(XHdcp1x *InstancePtr, XHdcp1x_StateType State,
		XHdcp1x_StateType *NextStatePtr)
{
	switch (State) {
		case XHDCP1X_STATE_DISABLED:
			XHdcp1x_RxDisableState(InstancePtr);
			break;
		case XHDCP1X_STATE_UNAUTHENTICATED:
			XHdcp1x_RxSetCheckLinkState(InstancePtr, FALSE);
			InstancePtr->Rx.Flags |= XVPHY_FLAG_PHY_UP;
			if (InstancePtr->Rx.IsUnauthenticatedCallbackSet) {
				InstancePtr->Rx.UnauthenticatedCallback(
				InstancePtr->Rx.UnauthenticatedCallbackRef);
			}
			break;
		case XHDCP1X_STATE_COMPUTATIONS:
			XHdcp1x_RxStartComputations(InstancePtr,
						NextStatePtr);
			break;
		case XHDCP1X_STATE_WAITFORDOWNSTREAM:
			XHdcp1x_RxSetCheckLinkState(InstancePtr, TRUE);
			XHdcp1x_RxStartTimer(InstancePtr,
			((5 * XVPHY_TMO_1SECOND) + (5 * XVPHY_TMO_100MS)) );
			break;
		case XHDCP1X_STATE_ASSEMBLEKSVLIST:
			XHdcp1x_RxAssembleKSVList(InstancePtr,
						NextStatePtr);
			break;
		case XHDCP1X_STATE_AUTHENTICATED:
			XHdcp1x_RxDebugLog(InstancePtr, "authenticated");
			XHdcp1x_RxSetCheckLinkState(InstancePtr, TRUE);
			if(InstancePtr->Rx.IsAuthenticatedCallbackSet) {
				InstancePtr->Rx.AuthenticatedCallback(
				InstancePtr->Rx.AuthenticatedCallbackRef);
			}
			XHdcp1x_RxStartTimer(InstancePtr,
					(2 * XVPHY_TMO_1SECOND));
			break;
		case XHDCP1X_STATE_LINKINTEGRITYFAILED:
			InstancePtr->Rx.Stats.LinkFailures++;
			XHdcp1x_RxReportLinkIntegrityFailure(InstancePtr,
					NextStatePtr);
			break;
		case XHDCP1X_STATE_PHYDOWN:
			InstancePtr->Rx.Flags &= ~XVPHY_FLAG_PHY_UP;
			XHdcp1x_CipherDisable(InstancePtr);
			break;
		default:
			break;
	}
}
static void XHdcp1x_RxEnterState ( XHdcp1x * InstancePtr , XHdcp1x_StateType State , XHdcp1x_StateType * NextStatePtr ) { switch ( State ) { case XHDCP1X_STATE_DISABLED : XHdcp1x_RxDisableState ( InstancePtr ) ; break ; case XHDCP1X_STATE_UNAUTHENTICATED : XHdcp1x_RxSetCheckLinkState ( InstancePtr , FALSE ) ; InstancePtr -> Rx . Flags |= XVPHY_FLAG_PHY_UP ; if ( InstancePtr -> Rx . IsUnauthenticatedCallbackSet ) { InstancePtr -> Rx . UnauthenticatedCallback ( InstancePtr -> Rx . UnauthenticatedCallbackRef ) ; } break ; case XHDCP1X_STATE_COMPUTATIONS : XHdcp1x_RxStartComputations ( InstancePtr , NextStatePtr ) ; break ; case XHDCP1X_STATE_WAITFORDOWNSTREAM : XHdcp1x_RxSetCheckLinkState ( InstancePtr , TRUE ) ; XHdcp1x_RxStartTimer ( InstancePtr , ( ( 5 * XVPHY_TMO_1SECOND ) + ( 5 * XVPHY_TMO_100MS ) ) ) ; break ; case XHDCP1X_STATE_ASSEMBLEKSVLIST : XHdcp1x_RxAssembleKSVList ( InstancePtr , NextStatePtr ) ; break ; case XHDCP1X_STATE_AUTHENTICATED : XHdcp1x_RxDebugLog ( InstancePtr , " " ) ; XHdcp1x_RxSetCheckLinkState ( InstancePtr , TRUE ) ; if ( InstancePtr -> Rx . IsAuthenticatedCallbackSet ) { InstancePtr -> Rx . AuthenticatedCallback ( InstancePtr -> Rx . AuthenticatedCallbackRef ) ; } XHdcp1x_RxStartTimer ( InstancePtr , ( 2 * XVPHY_TMO_1SECOND ) ) ; break ; case XHDCP1X_STATE_LINKINTEGRITYFAILED : InstancePtr -> Rx . Stats . LinkFailures ++ ; XHdcp1x_RxReportLinkIntegrityFailure ( InstancePtr , NextStatePtr ) ; break ; case XHDCP1X_STATE_PHYDOWN : InstancePtr -> Rx . Flags &= ~ XVPHY_FLAG_PHY_UP ; XHdcp1x_CipherDisable ( InstancePtr ) ; break ; default : break ; } }
This function enters a HDCP receiver state.
This function enters a HDCP receiver state .
/* Case-wise process the kind of state called */ /* For the disabled state */ /* For the unauthenticated state */ /* For the computations state */ /* For the wait-for-downstream state */ /* For assemble KSV list */ /* For the authenticated state */ /* For the link integrity failed state */ /* For physical layer down */ /* Otherwise */ /* Do nothing */