XilinxProcessorIPLib/drivers/emacps/examples/xemacps_example_intr_dma.c
static void XEmacPsErrorHandler(void *Callback, u8 Direction, u32 ErrorWord)
{
	XEmacPs *EmacPsInstancePtr = (XEmacPs *) Callback;

	/*
	 * Increment the counter so that main thread knows something
	 * happened. Reset the device and reallocate resources ...
	 */
	DeviceErrors++;

	switch (Direction) {
	case XEMACPS_RECV:
		if (ErrorWord & XEMACPS_RXSR_HRESPNOK_MASK) {
			EmacPsUtilErrorTrap("Receive DMA error");
		}
		if (ErrorWord & XEMACPS_RXSR_RXOVR_MASK) {
			EmacPsUtilErrorTrap("Receive over run");
		}
		if (ErrorWord & XEMACPS_RXSR_BUFFNA_MASK) {
			EmacPsUtilErrorTrap("Receive buffer not available");
		}
		break;
	case XEMACPS_SEND:
		if (ErrorWord & XEMACPS_TXSR_HRESPNOK_MASK) {
			EmacPsUtilErrorTrap("Transmit DMA error");
		}
		if (ErrorWord & XEMACPS_TXSR_URUN_MASK) {
			EmacPsUtilErrorTrap("Transmit under run");
		}
		if (ErrorWord & XEMACPS_TXSR_BUFEXH_MASK) {
			EmacPsUtilErrorTrap("Transmit buffer exhausted");
		}
		if (ErrorWord & XEMACPS_TXSR_RXOVR_MASK) {
			EmacPsUtilErrorTrap("Transmit retry excessed limits");
		}
		if (ErrorWord & XEMACPS_TXSR_FRAMERX_MASK) {
			EmacPsUtilErrorTrap("Transmit collision");
		}
		if (ErrorWord & XEMACPS_TXSR_USEDREAD_MASK) {
			EmacPsUtilErrorTrap("Transmit buffer not available");
		}
		break;
	}
	/*
	 * Bypassing the reset functionality as the default tx status for q0 is
	 * USED BIT READ. so, the first interrupt will be tx used bit and it resets
	 * the core always.
	 */
	if (GemVersion == 2) {
	EmacPsResetDevice(EmacPsInstancePtr);
	}
}
/****************************************************************************/
/**
*
* This is the Error handler callback function and this function increments
* the error counter so that the main thread knows the number of errors.
*
* @param	Callback is the callback function for the driver. This
*		parameter is not used in this example.
* @param	Direction is passed in from the driver specifying which
*		direction error has occurred.
* @param	ErrorWord is the status register value passed in.
*
* @return	None.
*
* @note		None.
*
*****************************************************************************/
This is the Error handler callback function and this function increments
the error counter so that the main thread knows the number of errors.
This is the Error handler callback function and this function increments the error counter so that the main thread knows the number of errors .
static void XEmacPsErrorHandler(void *Callback, u8 Direction, u32 ErrorWord)
{
	XEmacPs *EmacPsInstancePtr = (XEmacPs *) Callback;
	DeviceErrors++;
	switch (Direction) {
	case XEMACPS_RECV:
		if (ErrorWord & XEMACPS_RXSR_HRESPNOK_MASK) {
			EmacPsUtilErrorTrap("Receive DMA error");
		}
		if (ErrorWord & XEMACPS_RXSR_RXOVR_MASK) {
			EmacPsUtilErrorTrap("Receive over run");
		}
		if (ErrorWord & XEMACPS_RXSR_BUFFNA_MASK) {
			EmacPsUtilErrorTrap("Receive buffer not available");
		}
		break;
	case XEMACPS_SEND:
		if (ErrorWord & XEMACPS_TXSR_HRESPNOK_MASK) {
			EmacPsUtilErrorTrap("Transmit DMA error");
		}
		if (ErrorWord & XEMACPS_TXSR_URUN_MASK) {
			EmacPsUtilErrorTrap("Transmit under run");
		}
		if (ErrorWord & XEMACPS_TXSR_BUFEXH_MASK) {
			EmacPsUtilErrorTrap("Transmit buffer exhausted");
		}
		if (ErrorWord & XEMACPS_TXSR_RXOVR_MASK) {
			EmacPsUtilErrorTrap("Transmit retry excessed limits");
		}
		if (ErrorWord & XEMACPS_TXSR_FRAMERX_MASK) {
			EmacPsUtilErrorTrap("Transmit collision");
		}
		if (ErrorWord & XEMACPS_TXSR_USEDREAD_MASK) {
			EmacPsUtilErrorTrap("Transmit buffer not available");
		}
		break;
	}
	if (GemVersion == 2) {
	EmacPsResetDevice(EmacPsInstancePtr);
	}
}
static void XEmacPsErrorHandler ( void * Callback , u8 Direction , u32 ErrorWord ) { XEmacPs * EmacPsInstancePtr = ( XEmacPs * ) Callback ; DeviceErrors ++ ; switch ( Direction ) { case XEMACPS_RECV : if ( ErrorWord & XEMACPS_RXSR_HRESPNOK_MASK ) { EmacPsUtilErrorTrap ( " " ) ; } if ( ErrorWord & XEMACPS_RXSR_RXOVR_MASK ) { EmacPsUtilErrorTrap ( " " ) ; } if ( ErrorWord & XEMACPS_RXSR_BUFFNA_MASK ) { EmacPsUtilErrorTrap ( " " ) ; } break ; case XEMACPS_SEND : if ( ErrorWord & XEMACPS_TXSR_HRESPNOK_MASK ) { EmacPsUtilErrorTrap ( " " ) ; } if ( ErrorWord & XEMACPS_TXSR_URUN_MASK ) { EmacPsUtilErrorTrap ( " " ) ; } if ( ErrorWord & XEMACPS_TXSR_BUFEXH_MASK ) { EmacPsUtilErrorTrap ( " " ) ; } if ( ErrorWord & XEMACPS_TXSR_RXOVR_MASK ) { EmacPsUtilErrorTrap ( " " ) ; } if ( ErrorWord & XEMACPS_TXSR_FRAMERX_MASK ) { EmacPsUtilErrorTrap ( " " ) ; } if ( ErrorWord & XEMACPS_TXSR_USEDREAD_MASK ) { EmacPsUtilErrorTrap ( " " ) ; } break ; } if ( GemVersion == 2 ) { EmacPsResetDevice ( EmacPsInstancePtr ) ; } }
This is the Error handler callback function and this function increments
the error counter so that the main thread knows the number of errors.
This is the Error handler callback function and this function increments the error counter so that the main thread knows the number of errors .
/*
	 * Increment the counter so that main thread knows something
	 * happened. Reset the device and reallocate resources ...
	 */ /*
	 * Bypassing the reset functionality as the default tx status for q0 is
	 * USED BIT READ. so, the first interrupt will be tx used bit and it resets
	 * the core always.
	 */