XilinxProcessorIPLib/drivers/axiethernet/examples/xaxiethernet_example_polled.c
int AxiEthernetPollForTxStatus(void)
{
	int Status = XST_NO_DATA;
	int Attempts = 100000;	/*
				 * Number of attempts to get status before
				 * giving up
				 */

	/*
	 * Wait for transmit complete indication
	 */
	do {

		if (--Attempts <= 0)
			break;	/* Give up? */

		if (XLlFifo_Status(&FifoInstance) & XLLF_INT_TC_MASK) {
			XLlFifo_IntClear(&FifoInstance, XLLF_INT_TC_MASK);
			Status = XST_SUCCESS;
		}
		if (XLlFifo_Status(&FifoInstance) & XLLF_INT_ERROR_MASK) {
			Status = XST_FIFO_ERROR;
		}

	} while (Status == XST_NO_DATA);


	switch (Status) {
	case XST_SUCCESS:	/* Frame sent without error */
	case XST_NO_DATA:	/* Timeout */
		break;

	case XST_FIFO_ERROR:
		AxiEthernetUtilErrorTrap("FIFO error");
		AxiEthernetResetDevice();
		break;

	default:
		AxiEthernetUtilErrorTrap("Driver returned unknown transmit status");
		break;
	}

	return (Status);
}
/******************************************************************************/
/**
* This functions polls the Tx status and waits for an indication that a frame
* has been transmitted successfully or a transmit related error has occurred.
* If an error is reported, it handles all the possible  error conditions.
*
* @param	None.
*
* @return
*		- XST_SUCCESS, Tx has completed
*		- XST_NO_DATA, Timeout. Tx failure.
*		- XST_FIFO_ERROR, Error in the FIFO.
*
* @note		None.
*
******************************************************************************/
This functions polls the Tx status and waits for an indication that a frame
has been transmitted successfully or a transmit related error has occurred.
If an error is reported, it handles all the possible  error conditions.
This functions polls the Tx status and waits for an indication that a frame has been transmitted successfully or a transmit related error has occurred . If an error is reported it handles all the possible error conditions .
int AxiEthernetPollForTxStatus(void)
{
	int Status = XST_NO_DATA;
	int Attempts = 100000;	
	do {
		if (--Attempts <= 0)
			break;	
		if (XLlFifo_Status(&FifoInstance) & XLLF_INT_TC_MASK) {
			XLlFifo_IntClear(&FifoInstance, XLLF_INT_TC_MASK);
			Status = XST_SUCCESS;
		}
		if (XLlFifo_Status(&FifoInstance) & XLLF_INT_ERROR_MASK) {
			Status = XST_FIFO_ERROR;
		}
	} while (Status == XST_NO_DATA);
	switch (Status) {
	case XST_SUCCESS:	
	case XST_NO_DATA:	
		break;
	case XST_FIFO_ERROR:
		AxiEthernetUtilErrorTrap("FIFO error");
		AxiEthernetResetDevice();
		break;
	default:
		AxiEthernetUtilErrorTrap("Driver returned unknown transmit status");
		break;
	}
	return (Status);
}
int AxiEthernetPollForTxStatus ( void ) { int Status = XST_NO_DATA ; int Attempts = 100000 ; do { if ( -- Attempts <= 0 ) break ; if ( XLlFifo_Status ( & FifoInstance ) & XLLF_INT_TC_MASK ) { XLlFifo_IntClear ( & FifoInstance , XLLF_INT_TC_MASK ) ; Status = XST_SUCCESS ; } if ( XLlFifo_Status ( & FifoInstance ) & XLLF_INT_ERROR_MASK ) { Status = XST_FIFO_ERROR ; } } while ( Status == XST_NO_DATA ) ; switch ( Status ) { case XST_SUCCESS : case XST_NO_DATA : break ; case XST_FIFO_ERROR : AxiEthernetUtilErrorTrap ( " " ) ; AxiEthernetResetDevice ( ) ; break ; default : AxiEthernetUtilErrorTrap ( " " ) ; break ; } return ( Status ) ; }
This functions polls the Tx status and waits for an indication that a frame
has been transmitted successfully or a transmit related error has occurred.
This functions polls the Tx status and waits for an indication that a frame has been transmitted successfully or a transmit related error has occurred .
/*
				 * Number of attempts to get status before
				 * giving up
				 */ /*
	 * Wait for transmit complete indication
	 */ /* Give up? */ /* Frame sent without error */ /* Timeout */