XilinxProcessorIPLib/drivers/axiethernet/examples/xaxiethernet_example_intr_fifo.c
static int AxiEthernetResetDevice(XAxiEthernet *AxiEthernetInstancePtr,
					XLlFifo *FifoInstancePtr)
{
	int Status;
	u8 MacSave[6];
	u32 Options;

	/*
	 * Stop the Axi Ethernet device
	 */
	XAxiEthernet_Stop(AxiEthernetInstancePtr);


	/*
	 * Save the device state
	 */
	XAxiEthernet_GetMacAddress(AxiEthernetInstancePtr, MacSave);
	Options = XAxiEthernet_GetOptions(AxiEthernetInstancePtr);

	/*
	 * Stop and reset the Axi Ethernet device
	 */
	XAxiEthernet_Reset(AxiEthernetInstancePtr);

	/*
	 * reset the fifo
	 */
	XLlFifo_Reset(FifoInstancePtr);

	/*
	 * Restore the state
	 */
	Status = XAxiEthernet_SetMacAddress(AxiEthernetInstancePtr, MacSave);
	Status |= XAxiEthernet_SetOptions(AxiEthernetInstancePtr, Options);
	Status |= XAxiEthernet_ClearOptions(AxiEthernetInstancePtr, ~Options);
	if (Status != XST_SUCCESS) {
		AxiEthernetUtilErrorTrap("Error restoring state after reset");
		return XST_FAILURE;
	}

	/*
	 * Restart the device
	 */
	XAxiEthernet_Start(AxiEthernetInstancePtr);

	return XST_SUCCESS;
}
/******************************************************************************/
/**
* This function resets the device but preserves the options set by the user.
*
* @param	AxiEthernetInstancePtr is a pointer to the instance of the
*		AxiEthernet component.
* @param	FifoInstancePtr is a pointer to the instance of the Fifo
*		component.
*
* @return	- XST_SUCCESS to indicate success.
*		- XST_FAILURE.to indicate failure.
*
* @note		None.
*
******************************************************************************/
This function resets the device but preserves the options set by the user.
This function resets the device but preserves the options set by the user .
static int AxiEthernetResetDevice(XAxiEthernet *AxiEthernetInstancePtr,
					XLlFifo *FifoInstancePtr)
{
	int Status;
	u8 MacSave[6];
	u32 Options;
	XAxiEthernet_Stop(AxiEthernetInstancePtr);
	XAxiEthernet_GetMacAddress(AxiEthernetInstancePtr, MacSave);
	Options = XAxiEthernet_GetOptions(AxiEthernetInstancePtr);
	XAxiEthernet_Reset(AxiEthernetInstancePtr);
	XLlFifo_Reset(FifoInstancePtr);
	Status = XAxiEthernet_SetMacAddress(AxiEthernetInstancePtr, MacSave);
	Status |= XAxiEthernet_SetOptions(AxiEthernetInstancePtr, Options);
	Status |= XAxiEthernet_ClearOptions(AxiEthernetInstancePtr, ~Options);
	if (Status != XST_SUCCESS) {
		AxiEthernetUtilErrorTrap("Error restoring state after reset");
		return XST_FAILURE;
	}
	XAxiEthernet_Start(AxiEthernetInstancePtr);
	return XST_SUCCESS;
}
static int AxiEthernetResetDevice ( XAxiEthernet * AxiEthernetInstancePtr , XLlFifo * FifoInstancePtr ) { int Status ; u8 MacSave [ 6 ] ; u32 Options ; XAxiEthernet_Stop ( AxiEthernetInstancePtr ) ; XAxiEthernet_GetMacAddress ( AxiEthernetInstancePtr , MacSave ) ; Options = XAxiEthernet_GetOptions ( AxiEthernetInstancePtr ) ; XAxiEthernet_Reset ( AxiEthernetInstancePtr ) ; XLlFifo_Reset ( FifoInstancePtr ) ; Status = XAxiEthernet_SetMacAddress ( AxiEthernetInstancePtr , MacSave ) ; Status |= XAxiEthernet_SetOptions ( AxiEthernetInstancePtr , Options ) ; Status |= XAxiEthernet_ClearOptions ( AxiEthernetInstancePtr , ~ Options ) ; if ( Status != XST_SUCCESS ) { AxiEthernetUtilErrorTrap ( " " ) ; return XST_FAILURE ; } XAxiEthernet_Start ( AxiEthernetInstancePtr ) ; return XST_SUCCESS ; }
This function resets the device but preserves the options set by the user.
This function resets the device but preserves the options set by the user .
/*
	 * Stop the Axi Ethernet device
	 */ /*
	 * Save the device state
	 */ /*
	 * Stop and reset the Axi Ethernet device
	 */ /*
	 * reset the fifo
	 */ /*
	 * Restore the state
	 */ /*
	 * Restart the device
	 */