XilinxProcessorIPLib/drivers/hdcp22_tx_dp/src/xhdcp22_tx.c
void XHdcp22Tx_LogDisplay(XHdcp22_Tx *InstancePtr)
{
	XHdcp22_Tx_LogItem* LogPtr;
	char str[255];
	u32 TimeStampPrev = 0;

	/* Verify argument. */
	Xil_AssertVoid(InstancePtr != NULL);

	xil_printf("\r\n-------HDCP22 TX log start-------\r\n");
	xil_printf("[Time(us):Delta(us)] <Event>\r\n");
	strcpy(str, "UNDEFINED");
	do {
		/* Read log data */
		LogPtr = XHdcp22Tx_LogRd(InstancePtr);

		/* Print timestamp */
		if(LogPtr->LogEvent != XHDCP22_TX_LOG_EVT_NONE)
		{
			if(LogPtr->TimeStamp < TimeStampPrev) TimeStampPrev = 0;
			xil_printf("[%8u:", LogPtr->TimeStamp);
			xil_printf("%8u] ", (LogPtr->TimeStamp - TimeStampPrev));
			TimeStampPrev = LogPtr->TimeStamp;
		}

		/* Print log event */
		switch (LogPtr->LogEvent) {
		case (XHDCP22_TX_LOG_EVT_NONE):
			xil_printf("-------HDCP22 TX log end-------\r\n\r\n");
			break;
		case XHDCP22_TX_LOG_EVT_STATE:
			switch(LogPtr->Data)
			{
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, H0)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, H1)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A0)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A1)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A1_1)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A1_NSK0)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A1_NSK1)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A1_SK0)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A2)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A2_1)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A3)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A4)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A5)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A6_A7_A8)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A6)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A7)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A8)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A9)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A9_1)
				default: break;
			};
			xil_printf("Current state [%s]\r\n", str);
			break;
		case XHDCP22_TX_LOG_EVT_POLL_RESULT:
			switch(LogPtr->Data)
			{
			case XHDCP22_TX_INCOMPATIBLE_RX: strcpy(str, "INCOMPATIBLE RX"); break;
			case XHDCP22_TX_AUTHENTICATION_BUSY: strcpy(str, "AUTHENTICATION BUSY"); break;
			case XHDCP22_TX_AUTHENTICATED: strcpy(str, "AUTHENTICATED"); break;
			case XHDCP22_TX_UNAUTHENTICATED: strcpy(str, "UN-AUTHENTICATED"); break;
			case XHDCP22_TX_REAUTHENTICATE_REQUESTED: strcpy(str, "RE-AUTHENTICATION REQUESTED"); break;
			default: break;
			}
			xil_printf("Poll result [%s]\r\n", str);
			break;
		case XHDCP22_TX_LOG_EVT_ENABLED:
			if (LogPtr->Data == (FALSE)) {
				strcpy(str, "DISABLED");
			} else {
				strcpy(str, "ENABLED");
			}
			xil_printf("State machine [%s]\r\n", str);
			break;
		case XHDCP22_TX_LOG_EVT_RESET:
			xil_printf("Asserted [RESET]\r\n");
			break;
		case XHDCP22_TX_LOG_EVT_ENCR_ENABLED:
			if (LogPtr->Data == (FALSE)) {
				strcpy(str, "DISABLED");
			} else {
				strcpy(str, "ENABLED");
			}
			xil_printf("Encryption [%s]\r\n", str);
			break;
		case XHDCP22_TX_LOG_EVT_TEST_ERROR:
			switch(LogPtr->Data)
			{
			case XHDCP22_TX_AKE_NO_STORED_KM:
			      strcpy(str, "EkpubKm does not match the calculated value.");
			      break;
			case XHDCP22_TX_SKE_SEND_EKS:
			      strcpy(str, "EdkeyKs does not match the calculated value.");
			      break;
			case XHDCP22_TX_MSG_UNDEFINED:
			      strcpy(str, "Trying to write an unexpected message.");
			      break;
			default: break;
			};
			xil_printf("Error: Test error [%s]\r\n", str);
			break;
		case XHDCP22_TX_LOG_EVT_LCCHK_COUNT:
			xil_printf("Locality check count [%d]\r\n", LogPtr->Data);
			break;
		case XHDCP22_TX_LOG_EVT_STRMMNGCHK_COUNT:
			xil_printf("Content Stream Management check count [%d]\r\n", LogPtr->Data);
			break;
		case XHDCP22_TX_LOG_EVT_DBG:
			switch(LogPtr->Data)
			{
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, STARTIMER)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, MSGAVAILABLE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, TX_AKEINIT)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, RX_CERT)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, VERIFY_SIGNATURE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, VERIFY_SIGNATURE_PASS)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, VERIFY_SIGNATURE_FAIL)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, DEVICE_IS_REVOKED)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, ENCRYPT_KM)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, ENCRYPT_KM_DONE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, TX_NOSTOREDKM)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, TX_STOREDKM)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, RX_H1)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, RX_EKHKM)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPUTE_H)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPUTE_H_DONE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPARE_H_FAIL)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, TX_LCINIT)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, RX_L1)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPUTE_L)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPUTE_L_DONE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPARE_L_FAIL)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPUTE_EDKEYKS)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPUTE_EDKEYKS_DONE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, TX_EKS)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, RX_RCVIDLIST)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPUTE_V)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPUTE_V_DONE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPARE_V_FAIL)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, RX_M1)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPUTE_M)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPUTE_M_DONE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, CHECK_REAUTH)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, TIMEOUT)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, TIMESTAMP)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, AES128ENC)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, AES128ENC_DONE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, SHA256HASH)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, SHA256HASH_DONE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, OEAPENC)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, OEAPENC_DONE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, RSAENC)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, RSAENC_DONE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, MSG_WRITE_FAIL)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, MSG_READ_FAIL)
				default: break;
			};
			xil_printf("Debug: Event [%s]\r\n", str);
			break;
		case XHDCP22_TX_LOG_EVT_USER:
			xil_printf("User: %d\r\n", LogPtr->Data);
			break;
		default:
			xil_printf("Error: Unknown log event\r\n");
			break;
		}
	} while (LogPtr->LogEvent != XHDCP22_TX_LOG_EVT_NONE);
}
/*****************************************************************************/
/**
*
* This function prints the content of log buffer.
*
* @param  InstancePtr is a pointer to the HDCP22 TX core instance.
*
* @return None.
*
* @note   None.
*
******************************************************************************/
This function prints the content of log buffer.
This function prints the content of log buffer .
void XHdcp22Tx_LogDisplay(XHdcp22_Tx *InstancePtr)
{
	XHdcp22_Tx_LogItem* LogPtr;
	char str[255];
	u32 TimeStampPrev = 0;
	Xil_AssertVoid(InstancePtr != NULL);
	xil_printf("\r\n-------HDCP22 TX log start-------\r\n");
	xil_printf("[Time(us):Delta(us)] <Event>\r\n");
	strcpy(str, "UNDEFINED");
	do {
		LogPtr = XHdcp22Tx_LogRd(InstancePtr);
		if(LogPtr->LogEvent != XHDCP22_TX_LOG_EVT_NONE)
		{
			if(LogPtr->TimeStamp < TimeStampPrev) TimeStampPrev = 0;
			xil_printf("[%8u:", LogPtr->TimeStamp);
			xil_printf("%8u] ", (LogPtr->TimeStamp - TimeStampPrev));
			TimeStampPrev = LogPtr->TimeStamp;
		}
		switch (LogPtr->LogEvent) {
		case (XHDCP22_TX_LOG_EVT_NONE):
			xil_printf("-------HDCP22 TX log end-------\r\n\r\n");
			break;
		case XHDCP22_TX_LOG_EVT_STATE:
			switch(LogPtr->Data)
			{
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, H0)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, H1)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A0)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A1)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A1_1)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A1_NSK0)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A1_NSK1)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A1_SK0)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A2)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A2_1)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A3)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A4)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A5)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A6_A7_A8)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A6)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A7)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A8)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A9)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_STATE_, A9_1)
				default: break;
			};
			xil_printf("Current state [%s]\r\n", str);
			break;
		case XHDCP22_TX_LOG_EVT_POLL_RESULT:
			switch(LogPtr->Data)
			{
			case XHDCP22_TX_INCOMPATIBLE_RX: strcpy(str, "INCOMPATIBLE RX"); break;
			case XHDCP22_TX_AUTHENTICATION_BUSY: strcpy(str, "AUTHENTICATION BUSY"); break;
			case XHDCP22_TX_AUTHENTICATED: strcpy(str, "AUTHENTICATED"); break;
			case XHDCP22_TX_UNAUTHENTICATED: strcpy(str, "UN-AUTHENTICATED"); break;
			case XHDCP22_TX_REAUTHENTICATE_REQUESTED: strcpy(str, "RE-AUTHENTICATION REQUESTED"); break;
			default: break;
			}
			xil_printf("Poll result [%s]\r\n", str);
			break;
		case XHDCP22_TX_LOG_EVT_ENABLED:
			if (LogPtr->Data == (FALSE)) {
				strcpy(str, "DISABLED");
			} else {
				strcpy(str, "ENABLED");
			}
			xil_printf("State machine [%s]\r\n", str);
			break;
		case XHDCP22_TX_LOG_EVT_RESET:
			xil_printf("Asserted [RESET]\r\n");
			break;
		case XHDCP22_TX_LOG_EVT_ENCR_ENABLED:
			if (LogPtr->Data == (FALSE)) {
				strcpy(str, "DISABLED");
			} else {
				strcpy(str, "ENABLED");
			}
			xil_printf("Encryption [%s]\r\n", str);
			break;
		case XHDCP22_TX_LOG_EVT_TEST_ERROR:
			switch(LogPtr->Data)
			{
			case XHDCP22_TX_AKE_NO_STORED_KM:
			      strcpy(str, "EkpubKm does not match the calculated value.");
			      break;
			case XHDCP22_TX_SKE_SEND_EKS:
			      strcpy(str, "EdkeyKs does not match the calculated value.");
			      break;
			case XHDCP22_TX_MSG_UNDEFINED:
			      strcpy(str, "Trying to write an unexpected message.");
			      break;
			default: break;
			};
			xil_printf("Error: Test error [%s]\r\n", str);
			break;
		case XHDCP22_TX_LOG_EVT_LCCHK_COUNT:
			xil_printf("Locality check count [%d]\r\n", LogPtr->Data);
			break;
		case XHDCP22_TX_LOG_EVT_STRMMNGCHK_COUNT:
			xil_printf("Content Stream Management check count [%d]\r\n", LogPtr->Data);
			break;
		case XHDCP22_TX_LOG_EVT_DBG:
			switch(LogPtr->Data)
			{
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, STARTIMER)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, MSGAVAILABLE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, TX_AKEINIT)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, RX_CERT)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, VERIFY_SIGNATURE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, VERIFY_SIGNATURE_PASS)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, VERIFY_SIGNATURE_FAIL)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, DEVICE_IS_REVOKED)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, ENCRYPT_KM)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, ENCRYPT_KM_DONE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, TX_NOSTOREDKM)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, TX_STOREDKM)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, RX_H1)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, RX_EKHKM)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPUTE_H)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPUTE_H_DONE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPARE_H_FAIL)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, TX_LCINIT)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, RX_L1)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPUTE_L)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPUTE_L_DONE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPARE_L_FAIL)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPUTE_EDKEYKS)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPUTE_EDKEYKS_DONE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, TX_EKS)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, RX_RCVIDLIST)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPUTE_V)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPUTE_V_DONE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPARE_V_FAIL)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, RX_M1)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPUTE_M)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, COMPUTE_M_DONE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, CHECK_REAUTH)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, TIMEOUT)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, TIMESTAMP)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, AES128ENC)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, AES128ENC_DONE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, SHA256HASH)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, SHA256HASH_DONE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, OEAPENC)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, OEAPENC_DONE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, RSAENC)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, RSAENC_DONE)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, MSG_WRITE_FAIL)
				XHDCP22_TX_CASE_TO_STR_PRE(XHDCP22_TX_LOG_DBG_, MSG_READ_FAIL)
				default: break;
			};
			xil_printf("Debug: Event [%s]\r\n", str);
			break;
		case XHDCP22_TX_LOG_EVT_USER:
			xil_printf("User: %d\r\n", LogPtr->Data);
			break;
		default:
			xil_printf("Error: Unknown log event\r\n");
			break;
		}
	} while (LogPtr->LogEvent != XHDCP22_TX_LOG_EVT_NONE);
}
void XHdcp22Tx_LogDisplay ( XHdcp22_Tx * InstancePtr ) { XHdcp22_Tx_LogItem * LogPtr ; char str [ 255 ] ; u32 TimeStampPrev = 0 ; Xil_AssertVoid ( InstancePtr != NULL ) ; xil_printf ( " \r \n \r \n " ) ; xil_printf ( " \r \n " ) ; strcpy ( str , " " ) ; do { LogPtr = XHdcp22Tx_LogRd ( InstancePtr ) ; if ( LogPtr -> LogEvent != XHDCP22_TX_LOG_EVT_NONE ) { if ( LogPtr -> TimeStamp < TimeStampPrev ) TimeStampPrev = 0 ; xil_printf ( " " , LogPtr -> TimeStamp ) ; xil_printf ( " " , ( LogPtr -> TimeStamp - TimeStampPrev ) ) ; TimeStampPrev = LogPtr -> TimeStamp ; } switch ( LogPtr -> LogEvent ) { case ( XHDCP22_TX_LOG_EVT_NONE ) : xil_printf ( " \r \n \r \n " ) ; break ; case XHDCP22_TX_LOG_EVT_STATE : switch ( LogPtr -> Data ) { XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_STATE_ , H0 ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_STATE_ , H1 ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_STATE_ , A0 ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_STATE_ , A1 ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_STATE_ , A1_1 ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_STATE_ , A1_NSK0 ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_STATE_ , A1_NSK1 ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_STATE_ , A1_SK0 ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_STATE_ , A2 ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_STATE_ , A2_1 ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_STATE_ , A3 ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_STATE_ , A4 ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_STATE_ , A5 ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_STATE_ , A6_A7_A8 ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_STATE_ , A6 ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_STATE_ , A7 ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_STATE_ , A8 ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_STATE_ , A9 ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_STATE_ , A9_1 ) default : break ; } ; xil_printf ( " \r \n " , str ) ; break ; case XHDCP22_TX_LOG_EVT_POLL_RESULT : switch ( LogPtr -> Data ) { case XHDCP22_TX_INCOMPATIBLE_RX : strcpy ( str , " " ) ; break ; case XHDCP22_TX_AUTHENTICATION_BUSY : strcpy ( str , " " ) ; break ; case XHDCP22_TX_AUTHENTICATED : strcpy ( str , " " ) ; break ; case XHDCP22_TX_UNAUTHENTICATED : strcpy ( str , " " ) ; break ; case XHDCP22_TX_REAUTHENTICATE_REQUESTED : strcpy ( str , " " ) ; break ; default : break ; } xil_printf ( " \r \n " , str ) ; break ; case XHDCP22_TX_LOG_EVT_ENABLED : if ( LogPtr -> Data == ( FALSE ) ) { strcpy ( str , " " ) ; } else { strcpy ( str , " " ) ; } xil_printf ( " \r \n " , str ) ; break ; case XHDCP22_TX_LOG_EVT_RESET : xil_printf ( " \r \n " ) ; break ; case XHDCP22_TX_LOG_EVT_ENCR_ENABLED : if ( LogPtr -> Data == ( FALSE ) ) { strcpy ( str , " " ) ; } else { strcpy ( str , " " ) ; } xil_printf ( " \r \n " , str ) ; break ; case XHDCP22_TX_LOG_EVT_TEST_ERROR : switch ( LogPtr -> Data ) { case XHDCP22_TX_AKE_NO_STORED_KM : strcpy ( str , " " ) ; break ; case XHDCP22_TX_SKE_SEND_EKS : strcpy ( str , " " ) ; break ; case XHDCP22_TX_MSG_UNDEFINED : strcpy ( str , " " ) ; break ; default : break ; } ; xil_printf ( " \r \n " , str ) ; break ; case XHDCP22_TX_LOG_EVT_LCCHK_COUNT : xil_printf ( " \r \n " , LogPtr -> Data ) ; break ; case XHDCP22_TX_LOG_EVT_STRMMNGCHK_COUNT : xil_printf ( " \r \n " , LogPtr -> Data ) ; break ; case XHDCP22_TX_LOG_EVT_DBG : switch ( LogPtr -> Data ) { XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , STARTIMER ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , MSGAVAILABLE ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , TX_AKEINIT ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , RX_CERT ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , VERIFY_SIGNATURE ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , VERIFY_SIGNATURE_PASS ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , VERIFY_SIGNATURE_FAIL ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , DEVICE_IS_REVOKED ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , ENCRYPT_KM ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , ENCRYPT_KM_DONE ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , TX_NOSTOREDKM ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , TX_STOREDKM ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , RX_H1 ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , RX_EKHKM ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , COMPUTE_H ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , COMPUTE_H_DONE ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , COMPARE_H_FAIL ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , TX_LCINIT ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , RX_L1 ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , COMPUTE_L ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , COMPUTE_L_DONE ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , COMPARE_L_FAIL ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , COMPUTE_EDKEYKS ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , COMPUTE_EDKEYKS_DONE ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , TX_EKS ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , RX_RCVIDLIST ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , COMPUTE_V ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , COMPUTE_V_DONE ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , COMPARE_V_FAIL ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , RX_M1 ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , COMPUTE_M ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , COMPUTE_M_DONE ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , CHECK_REAUTH ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , TIMEOUT ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , TIMESTAMP ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , AES128ENC ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , AES128ENC_DONE ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , SHA256HASH ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , SHA256HASH_DONE ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , OEAPENC ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , OEAPENC_DONE ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , RSAENC ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , RSAENC_DONE ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , MSG_WRITE_FAIL ) XHDCP22_TX_CASE_TO_STR_PRE ( XHDCP22_TX_LOG_DBG_ , MSG_READ_FAIL ) default : break ; } ; xil_printf ( " \r \n " , str ) ; break ; case XHDCP22_TX_LOG_EVT_USER : xil_printf ( " \r \n " , LogPtr -> Data ) ; break ; default : xil_printf ( " \r \n " ) ; break ; } } while ( LogPtr -> LogEvent != XHDCP22_TX_LOG_EVT_NONE ) ; }
This function prints the content of log buffer.
This function prints the content of log buffer .
/* Verify argument. */ /* Read log data */ /* Print timestamp */ /* Print log event */