XilinxProcessorIPLib/drivers/hdcp1x/src/xhdcp1x_tx.c
static void XHdcp1x_TxDoTheState(XHdcp1x *InstancePtr, XHdcp1x_EventType Event)
{
	XHdcp1x_StateType NextState = InstancePtr->Tx.CurrentState;

	/* Case-wise process the kind of state called */
	switch (InstancePtr->Tx.CurrentState) {
		/* For the disabled state */
		case XHDCP1X_STATE_DISABLED:
			XHdcp1x_TxRunDisabledState(InstancePtr, Event,
				&NextState);
			break;

		/* For determine rx capable state */
		case XHDCP1X_STATE_DETERMINERXCAPABLE:
			XHdcp1x_TxRunDetermineRxCapableState(InstancePtr,
				Event, &NextState);
			break;

		/* For exchange ksvs state */
		case XHDCP1X_STATE_EXCHANGEKSVS:
			XHdcp1x_TxRunExchangeKsvsState(InstancePtr, Event,
				&NextState);
			break;

		/* For the computations state */
		case XHDCP1X_STATE_COMPUTATIONS:
			XHdcp1x_TxRunComputationsState(InstancePtr, Event,
				&NextState);
			break;

		/* For the validate rx state */
		case XHDCP1X_STATE_VALIDATERX:
			XHdcp1x_TxRunValidateRxState(InstancePtr, Event,
				&NextState);
			break;

		/* For the authenticated state */
		case XHDCP1X_STATE_AUTHENTICATED:
			XHdcp1x_TxRunAuthenticatedState(InstancePtr, Event,
				&NextState);
			break;

		/* For the link integrity check state */
		case XHDCP1X_STATE_LINKINTEGRITYCHECK:
			XHdcp1x_TxRunLinkIntegrityCheckState(InstancePtr,
				Event, &NextState);
			break;

		/* For the test for repeater state */
		case XHDCP1X_STATE_TESTFORREPEATER:
			XHdcp1x_TxRunTestForRepeaterState(InstancePtr, Event,
				&NextState);
			break;

		/* For the wait for ready state */
		case XHDCP1X_STATE_WAITFORREADY:
			XHdcp1x_TxRunWaitForReadyState(InstancePtr, Event,
				&NextState);
			break;

		/* For the reads ksv list state */
		case XHDCP1X_STATE_READKSVLIST:
			XHdcp1x_TxRunReadKsvListState(InstancePtr, Event,
				&NextState);
			break;

		/* For the unauthenticated state */
		case XHDCP1X_STATE_UNAUTHENTICATED:
			XHdcp1x_TxRunUnauthenticatedState(InstancePtr,
				Event, &NextState);
			break;

		/* For the physical layer down state */
		case XHDCP1X_STATE_PHYDOWN:
			XHdcp1x_TxRunPhysicalLayerDownState(InstancePtr,
				Event, &NextState);
			break;

		/* Otherwise */
		default:
			break;
	}

	/* Check for state change */
	while (InstancePtr->Tx.CurrentState != NextState) {
		/* Perform the state transition */
		XHdcp1x_TxExitState(InstancePtr,
				InstancePtr->Tx.CurrentState, &NextState);
		InstancePtr->Tx.PreviousState = InstancePtr->Tx.CurrentState;
		InstancePtr->Tx.CurrentState = NextState;
		XHdcp1x_TxEnterState(InstancePtr, InstancePtr->Tx.CurrentState,
				&NextState);
		if( ((InstancePtr->Tx.PreviousState != XHDCP1X_STATE_DISABLED)
		&& (InstancePtr->Tx.PreviousState != XHDCP1X_STATE_PHYDOWN))
		&& (InstancePtr->Tx.CurrentState
			== XHDCP1X_STATE_UNAUTHENTICATED) ){
			/* Clear auth request pending flag */
			InstancePtr->Tx.IsAuthReqPending = (FALSE);

			if (InstancePtr->Tx.IsUnauthenticatedCallbackSet) {
				InstancePtr->Tx.UnauthenticatedCallback(
				InstancePtr->Tx.UnauthenticatedCallbackRef);
			}
		}
	}
}
/*****************************************************************************/
/**
* This function drives a transmit state machine.
*
* @param	InstancePtr is the HDCP state machine.
* @param	Event is the event to process.
*
* @return	None.
*
* @note		None.
*
******************************************************************************/
This function drives a transmit state machine.
This function drives a transmit state machine .
static void XHdcp1x_TxDoTheState(XHdcp1x *InstancePtr, XHdcp1x_EventType Event)
{
	XHdcp1x_StateType NextState = InstancePtr->Tx.CurrentState;
	switch (InstancePtr->Tx.CurrentState) {
		case XHDCP1X_STATE_DISABLED:
			XHdcp1x_TxRunDisabledState(InstancePtr, Event,
				&NextState);
			break;
		case XHDCP1X_STATE_DETERMINERXCAPABLE:
			XHdcp1x_TxRunDetermineRxCapableState(InstancePtr,
				Event, &NextState);
			break;
		case XHDCP1X_STATE_EXCHANGEKSVS:
			XHdcp1x_TxRunExchangeKsvsState(InstancePtr, Event,
				&NextState);
			break;
		case XHDCP1X_STATE_COMPUTATIONS:
			XHdcp1x_TxRunComputationsState(InstancePtr, Event,
				&NextState);
			break;
		case XHDCP1X_STATE_VALIDATERX:
			XHdcp1x_TxRunValidateRxState(InstancePtr, Event,
				&NextState);
			break;
		case XHDCP1X_STATE_AUTHENTICATED:
			XHdcp1x_TxRunAuthenticatedState(InstancePtr, Event,
				&NextState);
			break;
		case XHDCP1X_STATE_LINKINTEGRITYCHECK:
			XHdcp1x_TxRunLinkIntegrityCheckState(InstancePtr,
				Event, &NextState);
			break;
		case XHDCP1X_STATE_TESTFORREPEATER:
			XHdcp1x_TxRunTestForRepeaterState(InstancePtr, Event,
				&NextState);
			break;
		case XHDCP1X_STATE_WAITFORREADY:
			XHdcp1x_TxRunWaitForReadyState(InstancePtr, Event,
				&NextState);
			break;
		case XHDCP1X_STATE_READKSVLIST:
			XHdcp1x_TxRunReadKsvListState(InstancePtr, Event,
				&NextState);
			break;
		case XHDCP1X_STATE_UNAUTHENTICATED:
			XHdcp1x_TxRunUnauthenticatedState(InstancePtr,
				Event, &NextState);
			break;
		case XHDCP1X_STATE_PHYDOWN:
			XHdcp1x_TxRunPhysicalLayerDownState(InstancePtr,
				Event, &NextState);
			break;
		default:
			break;
	}
	while (InstancePtr->Tx.CurrentState != NextState) {
		XHdcp1x_TxExitState(InstancePtr,
				InstancePtr->Tx.CurrentState, &NextState);
		InstancePtr->Tx.PreviousState = InstancePtr->Tx.CurrentState;
		InstancePtr->Tx.CurrentState = NextState;
		XHdcp1x_TxEnterState(InstancePtr, InstancePtr->Tx.CurrentState,
				&NextState);
		if( ((InstancePtr->Tx.PreviousState != XHDCP1X_STATE_DISABLED)
		&& (InstancePtr->Tx.PreviousState != XHDCP1X_STATE_PHYDOWN))
		&& (InstancePtr->Tx.CurrentState
			== XHDCP1X_STATE_UNAUTHENTICATED) ){
			InstancePtr->Tx.IsAuthReqPending = (FALSE);
			if (InstancePtr->Tx.IsUnauthenticatedCallbackSet) {
				InstancePtr->Tx.UnauthenticatedCallback(
				InstancePtr->Tx.UnauthenticatedCallbackRef);
			}
		}
	}
}
static void XHdcp1x_TxDoTheState ( XHdcp1x * InstancePtr , XHdcp1x_EventType Event ) { XHdcp1x_StateType NextState = InstancePtr -> Tx . CurrentState ; switch ( InstancePtr -> Tx . CurrentState ) { case XHDCP1X_STATE_DISABLED : XHdcp1x_TxRunDisabledState ( InstancePtr , Event , & NextState ) ; break ; case XHDCP1X_STATE_DETERMINERXCAPABLE : XHdcp1x_TxRunDetermineRxCapableState ( InstancePtr , Event , & NextState ) ; break ; case XHDCP1X_STATE_EXCHANGEKSVS : XHdcp1x_TxRunExchangeKsvsState ( InstancePtr , Event , & NextState ) ; break ; case XHDCP1X_STATE_COMPUTATIONS : XHdcp1x_TxRunComputationsState ( InstancePtr , Event , & NextState ) ; break ; case XHDCP1X_STATE_VALIDATERX : XHdcp1x_TxRunValidateRxState ( InstancePtr , Event , & NextState ) ; break ; case XHDCP1X_STATE_AUTHENTICATED : XHdcp1x_TxRunAuthenticatedState ( InstancePtr , Event , & NextState ) ; break ; case XHDCP1X_STATE_LINKINTEGRITYCHECK : XHdcp1x_TxRunLinkIntegrityCheckState ( InstancePtr , Event , & NextState ) ; break ; case XHDCP1X_STATE_TESTFORREPEATER : XHdcp1x_TxRunTestForRepeaterState ( InstancePtr , Event , & NextState ) ; break ; case XHDCP1X_STATE_WAITFORREADY : XHdcp1x_TxRunWaitForReadyState ( InstancePtr , Event , & NextState ) ; break ; case XHDCP1X_STATE_READKSVLIST : XHdcp1x_TxRunReadKsvListState ( InstancePtr , Event , & NextState ) ; break ; case XHDCP1X_STATE_UNAUTHENTICATED : XHdcp1x_TxRunUnauthenticatedState ( InstancePtr , Event , & NextState ) ; break ; case XHDCP1X_STATE_PHYDOWN : XHdcp1x_TxRunPhysicalLayerDownState ( InstancePtr , Event , & NextState ) ; break ; default : break ; } while ( InstancePtr -> Tx . CurrentState != NextState ) { XHdcp1x_TxExitState ( InstancePtr , InstancePtr -> Tx . CurrentState , & NextState ) ; InstancePtr -> Tx . PreviousState = InstancePtr -> Tx . CurrentState ; InstancePtr -> Tx . CurrentState = NextState ; XHdcp1x_TxEnterState ( InstancePtr , InstancePtr -> Tx . CurrentState , & NextState ) ; if ( ( ( InstancePtr -> Tx . PreviousState != XHDCP1X_STATE_DISABLED ) && ( InstancePtr -> Tx . PreviousState != XHDCP1X_STATE_PHYDOWN ) ) && ( InstancePtr -> Tx . CurrentState == XHDCP1X_STATE_UNAUTHENTICATED ) ) { InstancePtr -> Tx . IsAuthReqPending = ( FALSE ) ; if ( InstancePtr -> Tx . IsUnauthenticatedCallbackSet ) { InstancePtr -> Tx . UnauthenticatedCallback ( InstancePtr -> Tx . UnauthenticatedCallbackRef ) ; } } } }
This function drives a transmit state machine.
This function drives a transmit state machine .
/* Case-wise process the kind of state called */ /* For the disabled state */ /* For determine rx capable state */ /* For exchange ksvs state */ /* For the computations state */ /* For the validate rx state */ /* For the authenticated state */ /* For the link integrity check state */ /* For the test for repeater state */ /* For the wait for ready state */ /* For the reads ksv list state */ /* For the unauthenticated state */ /* For the physical layer down state */ /* Otherwise */ /* Check for state change */ /* Perform the state transition */ /* Clear auth request pending flag */