Xilinx UG492 Switch User Manual


 
136 www.xilinx.com Ethernet AVB Endpoint User Guide
UG492 July 23, 2010
Chapter 13: Software Drivers
* This function is the handler which will be called if the PTP drivers
* identify a possible discontinuity in GrandMaster time.
* This handler provides an example of how to handle this situation -
* but this function is application specific.
*
* @param CallBackRef contains a callback reference from the driver, in
* this case it is the instance pointer for the AVB driver.
* @param TimestampsUncertain - a value of 1 indicates that there is a
* possible discontinuity in GrandMaster time. A value of 0
* indicates that Timestamps are no longer uncertain.
******************************************************************/
static void GMDiscontinuityHandler(void *CallBackRef,
unsigned int TimestampsUncertain)
{
xil_printf("\r\nGMDiscontinuityHandler: Timestamps are now %s\r\n",
TimestampsUncertain ? "uncertain" : "certain");
}
Starting and Stopping the AVB Drivers
The default state after driver initialization is for the AVB drivers to be inactive. After the
Ethernet link has been established, the drivers can be started using the following function
call. This will begin operation of the IEEE802.1 AS PTP protocol.
XAvb_Start(InstancePtr);
Before starting the drivers, ensure that the Ethernet PHY has successfully auto-negotiated
a full duplex link at either 100 Mbps or 1 Gbps Ethernet speeds. Early implementations
may also require the completion of an LLDP (Link Layer Discovery Protocol) function.
LLDP has been used in early AVB implementations to negotiate support of AVB between
peer devices for interoperability (AVB standards are still considering the use of LLDP).
LLDP is not currently included in our software drivers or example file.
The AVB drivers can be stopped at any time (to halt the IEEE802.1 AS PTP protocol) by
calling the following function:
XAvb_Stop(InstancePtr);
The software example included will halt the drivers whenever the Ethernet PHY Auto-
Negotiation indicates that it has lost the link, or has negotiation to an unsupported ethernet
mode (for example, half duplex).