XilinxProcessorIPLib/drivers/xxvethernet/examples/xxxvethernet_example_util.c
int XxvEthernetUtilEnterLocalLoopback(XXxvEthernet *XxvEthernetInstancePtr)
{
	UINTPTR BaseAddress = XxvEthernetInstancePtr->Config.BaseAddress;

	XXxvEthernet_WriteReg(BaseAddress, XXE_MODE_OFFSET,
			XXxvEthernet_ReadReg(BaseAddress, XXE_MODE_OFFSET) |
			XXE_MODE_LCLLPBK_MASK);

	/* Need to perform a GT reset after setting local loopback bit */
	XXxvEthernet_WriteReg(BaseAddress, XXE_GRR_OFFSET, 0x1);
	usleep(100);
	XXxvEthernet_WriteReg(BaseAddress, XXE_GRR_OFFSET, 0x0);

	return 0;
}
/******************************************************************************/
/**
*
* This function sets 10G ethernet in local loopback
*
* @param	XxvEthernetInstancePtr is a pointer to the instance of the
*		XxvEthernet component.
*
* @return	- XST_SUCCESS if successful.
*		- XST_FAILURE, in case of failure..
*
* @note		None.
*
******************************************************************************/
This function sets 10G ethernet in local loopback
This function sets 10G ethernet in local loopback
int XxvEthernetUtilEnterLocalLoopback(XXxvEthernet *XxvEthernetInstancePtr)
{
	UINTPTR BaseAddress = XxvEthernetInstancePtr->Config.BaseAddress;
	XXxvEthernet_WriteReg(BaseAddress, XXE_MODE_OFFSET,
			XXxvEthernet_ReadReg(BaseAddress, XXE_MODE_OFFSET) |
			XXE_MODE_LCLLPBK_MASK);
	XXxvEthernet_WriteReg(BaseAddress, XXE_GRR_OFFSET, 0x1);
	usleep(100);
	XXxvEthernet_WriteReg(BaseAddress, XXE_GRR_OFFSET, 0x0);
	return 0;
}
int XxvEthernetUtilEnterLocalLoopback ( XXxvEthernet * XxvEthernetInstancePtr ) { UINTPTR BaseAddress = XxvEthernetInstancePtr -> Config . BaseAddress ; XXxvEthernet_WriteReg ( BaseAddress , XXE_MODE_OFFSET , XXxvEthernet_ReadReg ( BaseAddress , XXE_MODE_OFFSET ) | XXE_MODE_LCLLPBK_MASK ) ; XXxvEthernet_WriteReg ( BaseAddress , XXE_GRR_OFFSET , 0x1 ) ; usleep ( 100 ) ; XXxvEthernet_WriteReg ( BaseAddress , XXE_GRR_OFFSET , 0x0 ) ; return 0 ; }
This function sets 10G ethernet in local loopback
This function sets 10G ethernet in local loopback
/* Need to perform a GT reset after setting local loopback bit */