XilinxProcessorIPLib/drivers/axiethernet/examples/xaxiethernet_example_polled.c
int AxiEthernetResetDevice(void)
{
	int Status;
	u8 MacSave[6];
	u32 Options;

	/*
	 * Stop device
	 */
	XAxiEthernet_Stop(&AxiEthernetInstance);

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

	/*
	 * Stop and reset both the fifo and the AxiEthernet the devices
	 */
	XLlFifo_Reset(&FifoInstance);
	XAxiEthernet_Reset(&AxiEthernetInstance);

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

	return XST_SUCCESS;
}
/******************************************************************************/
/**
* This function resets the device but preserves the options set by the user.
*
* @param	None.
*
* @return	-XST_SUCCESS if reset is successful
*		-XST_FAILURE. if reset is not successful
*
* @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 .
int AxiEthernetResetDevice(void)
{
	int Status;
	u8 MacSave[6];
	u32 Options;
	XAxiEthernet_Stop(&AxiEthernetInstance);
	XAxiEthernet_GetMacAddress(&AxiEthernetInstance, MacSave);
	Options = XAxiEthernet_GetOptions(&AxiEthernetInstance);
	XLlFifo_Reset(&FifoInstance);
	XAxiEthernet_Reset(&AxiEthernetInstance);
	Status = XAxiEthernet_SetMacAddress(&AxiEthernetInstance, MacSave);
	Status |= XAxiEthernet_SetOptions(&AxiEthernetInstance, Options);
	Status |= XAxiEthernet_ClearOptions(&AxiEthernetInstance, ~Options);
	if (Status != XST_SUCCESS) {
		AxiEthernetUtilErrorTrap("Error restoring state after reset");
		return XST_FAILURE;
	}
	return XST_SUCCESS;
}
int AxiEthernetResetDevice ( void ) { int Status ; u8 MacSave [ 6 ] ; u32 Options ; XAxiEthernet_Stop ( & AxiEthernetInstance ) ; XAxiEthernet_GetMacAddress ( & AxiEthernetInstance , MacSave ) ; Options = XAxiEthernet_GetOptions ( & AxiEthernetInstance ) ; XLlFifo_Reset ( & FifoInstance ) ; XAxiEthernet_Reset ( & AxiEthernetInstance ) ; Status = XAxiEthernet_SetMacAddress ( & AxiEthernetInstance , MacSave ) ; Status |= XAxiEthernet_SetOptions ( & AxiEthernetInstance , Options ) ; Status |= XAxiEthernet_ClearOptions ( & AxiEthernetInstance , ~ Options ) ; if ( Status != XST_SUCCESS ) { AxiEthernetUtilErrorTrap ( " " ) ; return XST_FAILURE ; } 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 device
	 */ /*
	 * Save the device state
	 */ /*
	 * Stop and reset both the fifo and the AxiEthernet the devices
	 */ /*
	 * Restore the state
	 */