axiethernet
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
xavb.h File Reference
#include "xavb_hw.h"
#include "xstatus.h"
#include "stdio.h"

Data Structures

struct  XAvb_Config
 Holds configuration information for a device. More...
 
struct  XAvb_PortIdentity
 Defines the format for a data structure which stores the Port. More...
 
struct  XAvb_ClockIdentity
 Defines the format for a data structure which stores the Clock. More...
 
struct  XAvb_ClockQuality
 Defines the quality of a clock. More...
 
struct  XAvb_BmcData
 Defines the format for a data structure which stores the relevant. More...
 
struct  XAvb_PtpStruct
 Defines the format for a data structure which stores information. More...
 
struct  XAvb_SequenceIdStruct
 Defines the format for a data structure which stores the last. More...
 
struct  XAvb_SignallingFrameData
 The Signalling frame defines the delays to be used between Sync Frames, Link. More...
 
struct  XAvb_Counters
 Defines the various counters which have to maintained for the. More...
 
struct  XAvb_StateMachineData
 Keep track of state machine data to make sure we're fully compliant with the spec. More...
 
struct  XAvb_MDSyncReceive
 This struct captures information from RX'd Sync/FollowUp message pairs in a format similar to the MDSyncReceive structure described in the IEEE P802.1AS specification. More...
 
struct  XAvb
 The XAvb driver instance data. More...
 

Macros

#define XAVB_H
 by using protection macros. More...
 
MAC Latency Definitions
#define XAVB_TX_MAC_LATENCY_IN_NS   80
 XAVB TX MAC LATENCY IN NS. More...
 
#define XAVB_RX_MAC_LATENCY_IN_NS   80
 XAVB RX MAC LATENCY IN NS. More...
 
PTP Buffer Storage Definitions
#define XAVB_PTP_TX_SYNC   0x0
 XAVB PTP TX SYNC. More...
 
#define XAVB_PTP_TX_FOLLOW_UP   0x1
 XAVB PTP TX FOLLOW UP. More...
 
#define XAVB_PTP_TX_PDELAYREQ   0x2
 XAVB PTP TX PDELAYREQ. More...
 
#define XAVB_PTP_TX_PDELAYRESP   0x3
 XAVB PTP TX PDELAYRESP. More...
 
#define XAVB_PTP_TX_PDELAYRESP_FOLLOW_UP   0x4
 XAVB PTP TX PDELAYRESP FOLLOW UP. More...
 
#define XAVB_PTP_TX_ANNOUNCE   0x5
 XAVB PTP TX ANNOUNCE. More...
 
#define XAVB_PTP_TX_SIGNALING   0x6
 XAVB PTP TX SIGNALING. More...
 
PTP Packet Message Type Definitions
#define XAVB_PTP_TYPE_SYNC   0x0
 XAVB PTP TYPE SYNC. More...
 
#define XAVB_PTP_TYPE_FOLLOW_UP   0x8
 XAVB PTP TYPE FOLLOW UP. More...
 
#define XAVB_PTP_TYPE_PDELAYREQ   0x2
 XAVB PTP TYPE PDELAYREQ. More...
 
#define XAVB_PTP_TYPE_PDELAYRESP   0x3
 XAVB PTP TYPE PDELAYRESP. More...
 
#define XAVB_PTP_TYPE_PDELAYRESP_FOLLOW_UP   0xA
 XAVB PTP TYPE PDELAYRESP FOLLOW UP. More...
 
#define XAVB_PTP_TYPE_ANNOUNCE   0xB
 XAVB PTP TYPE ANNOUNCE. More...
 
#define XAVB_PTP_TYPE_SIGNALING   0xC
 XAVB PTP TYPE SIGNALING. More...
 
Common PTP Frame Structure Definitions.
#define XAVB_PTP_PKT_CAPTURED_TIMESTAMP_OFFSET   0x000000FC
 XAVB PTP PKT CAPTURED TIMESTAMP OFFSET. More...
 
General Tx PTP Frame Structure Definitions.
#define XAVB_PTP_TX_PKT_SA_UPPER_OFFSET   0x0000000C
 XAVB PTP TX PKT SA UPPER OFFSET. More...
 
#define XAVB_PTP_TX_PKT_SA_LOWER_OFFSET   0x00000010
 XAVB PTP TX PKT SA LOWER OFFSET. More...
 
#define XAVB_PTP_TX_PKT_TYPE_OFFSET   0x00000014
 XAVB PTP TX PKT TYPE OFFSET. More...
 
#define XAVB_PTP_TX_PKT_CORRECTION_FIELD_OFFSET   0x00000020
 XAVB PTP TX PKT CORRECTION FIELD OFFSET. More...
 
#define XAVB_PTP_TX_PKT_PORTID_UPPER_OFFSET   0x00000028
 XAVB PTP TX PKT PORTID UPPER OFFSET. More...
 
#define XAVB_PTP_TX_PKT_PORTID_MID_OFFSET   0x0000002C
 XAVB PTP TX PKT PORTID MID OFFSET. More...
 
#define XAVB_PTP_TX_PKT_PORTID_LOWER_OFFSET   0x00000030
 XAVB PTP TX PKT PORTID LOWER OFFSET. More...
 
#define XAVB_PTP_TX_PKT_SEQUENCEID_OFFSET   0x00000034
 XAVB PTP TX PKT SEQUENCEID OFFSET. More...
 
#define XAVB_PTP_TX_PKT_TIMESTAMP_UPPER_OFFSET   0x00000038
 XAVB PTP TX PKT TIMESTAMP UPPER OFFSET. More...
 
#define XAVB_PTP_TX_PKT_TIMESTAMP_MID_OFFSET   0x0000003C
 XAVB PTP TX PKT TIMESTAMP MID OFFSET. More...
 
#define XAVB_PTP_TX_PKT_TIMESTAMP_LOWER_OFFSET   0x00000040
 upper 2 bytes. More...
 
#define XAVB_PTP_TX_PKT_REQ_PORTID_UPPER_OFFSET   0x00000040
 lower 2 bytes. More...
 
#define XAVB_PTP_TX_PKT_REQ_PORTID_MID_OFFSET   0x00000044
 XAVB PTP TX PKT REQ PORTID MID OFFSET. More...
 
#define XAVB_PTP_TX_PKT_REQ_PORTID_LOWER_OFFSET   0x00000048
 XAVB PTP TX PKT REQ PORTID LOWER OFFSET. More...
 
Tx Announce PTP Frame Structure Definitions.
#define XAVB_PTP_TX_PKT_ANNOUNCE_CURR_UTCOFF_OFFSET   0x00000040
 XAVB PTP TX PKT ANNOUNCE CURR UTCOFF OFFSET. More...
 
#define XAVB_PTP_TX_PKT_ANNOUNCE_QUAL_LOW_PRI2_GMID_HI_OFFSET   0x00000048
 XAVB PTP TX PKT ANNOUNCE QUAL LOW PRI2 GMID HI OFFSET. More...
 
#define XAVB_PTP_TX_PKT_ANNOUNCE_GMID_MID_OFFSET   0x0000004C
 XAVB PTP TX PKT ANNOUNCE GMID MID OFFSET. More...
 
#define XAVB_PTP_TX_PKT_ANNOUNCE_GMID_LOW_STEPSREMOVED_HI_OFFSET   0x00000050
 XAVB PTP TX PKT ANNOUNCE GMID LOW STEPSREMOVED HI OFFSET. More...
 
#define XAVB_PTP_TX_PKT_ANNOUNCE_STEPSREMOVED_LOW_TIMESRC_OFFSET   0x00000054
 XAVB PTP TX PKT ANNOUNCE STEPSREMOVED LOW TIMESRC OFFSET. More...
 
#define XAVB_PTP_TX_PKT_ANNOUNCE_TLVLEN_PATHSEQ_START_OFFSET   0x00000058
 XAVB PTP TX PKT ANNOUNCE TLVLEN PATHSEQ START OFFSET. More...
 
PTP frame constant definitions

Constant value for the control field and LogMeanMessageInterval field for.

pDelayResp and pDelayRespFollowUp PTP frames (defined in IEEE802.1 AS)

#define XAVB_PDELAY_LOG_MEAN_MESSAGE_INT   0x7F050000
 XAVB PDELAY LOG MEAN MESSAGE INT. More...
 
Default LogMeanInterval values
#define XAVB_DEFAULT_LOG_MEAN_SYNC_INTERVAL   (-3)
 
#define XAVB_DEFAULT_LOG_MEAN_PDELAY_REQ_INTERVAL   0
 
#define XAVB_DEFAULT_LOG_MEAN_ANNOUNCE_INTERVAL   0
 
#define XAVB_PKT_TYPE_DISABLED   0xffff
 XAVB PKT TYPE DISABLED. More...
 
#define XAVB_MAX_SUPPORTED_LOG_MEAN_INTERVAL   8
 
#define XAVB_MIN_SUPPORTED_LOG_MEAN_INTERVAL   (-7)
 
Announce / Sync Timeout values
#define XAVB_ANNOUNCE_RECEIPT_TIMEOUT   2
 XAVB_ANNOUNCE_RECEIPT_TIMEOUT is the number of announce intervals without the receipt of an Announce message from. More...
 
#define XAVB_SYNC_RECEIPT_TIMEOUT   3
 XAVB_SYNC_RECEIPT_TIMEOUT is the number of sync intervals without the receipt of an Sync message from the GM that are. More...
 
AS Network Requirements
#define XAVB_NEIGHBOR_PROP_DELAY_THRESH   5000
 XAVB_NEIGHBOR_PROP_DELAY_THRESH is the maximum allowed delay (in nanosecs) across a full duplex link for which the AVB protocol is allowed to function. More...
 
#define XAVB_ALLOWED_LOST_RESPONSES   3
 XAVB_ALLOWED_LOST_RESPONSES is the number of Pdelay_Req messages for which a valid response is not received, above. More...
 
General Rx PTP Frame Structure Definitions.
#define XAVB_PTP_RX_PKT_SA_UPPER_OFFSET   0x00000004
 XAVB PTP RX PKT SA UPPER OFFSET. More...
 
#define XAVB_PTP_RX_PKT_SA_LOWER_OFFSET   0x00000008
 XAVB PTP RX PKT SA LOWER OFFSET. More...
 
#define XAVB_PTP_RX_PKT_TYPE_OFFSET   0x0000000C
 XAVB PTP RX PKT TYPE OFFSET. More...
 
#define XAVB_PTP_RX_PKT_CORRECTION_FIELD_OFFSET   0x00000018
 XAVB PTP RX PKT CORRECTION FIELD OFFSET. More...
 
#define XAVB_PTP_RX_PKT_PORTID_UPPER_OFFSET   0x00000020
 XAVB PTP RX PKT PORTID UPPER OFFSET. More...
 
#define XAVB_PTP_RX_PKT_PORTID_MID_OFFSET   0x00000024
 XAVB PTP RX PKT PORTID MID OFFSET. More...
 
#define XAVB_PTP_RX_PKT_PORTID_LOWER_OFFSET   0x00000028
 XAVB PTP RX PKT PORTID LOWER OFFSET. More...
 
#define XAVB_PTP_RX_PKT_SEQUENCEID_OFFSET   0x0000002C
 XAVB PTP RX PKT SEQUENCEID OFFSET. More...
 
#define XAVB_PTP_RX_PKT_TIMESTAMP_UPPER_OFFSET   0x00000030
 XAVB PTP RX PKT TIMESTAMP UPPER OFFSET. More...
 
#define XAVB_PTP_RX_PKT_TIMESTAMP_MID_OFFSET   0x00000034
 XAVB PTP RX PKT TIMESTAMP MID OFFSET. More...
 
#define XAVB_PTP_RX_PKT_TIMESTAMP_LOWER_OFFSET   0x00000038
 upper 2 bytes. More...
 
#define XAVB_PTP_RX_PKT_REQ_PORTID_UPPER_OFFSET   0x00000038
 lower 2 bytes. More...
 
#define XAVB_PTP_RX_PKT_REQ_PORTID_MID_OFFSET   0x0000003C
 XAVB PTP RX PKT REQ PORTID MID OFFSET. More...
 
#define XAVB_PTP_RX_PKT_REQ_PORTID_LOWER_OFFSET   0x00000040
 XAVB PTP RX PKT REQ PORTID LOWER OFFSET. More...
 
Rx Announce PTP Frame Structure Definitions.
#define XAVB_PTP_RX_PKT_ANNOUNCE_PRI1_QUAL_HI_OFFSET   0x0000003C
 XAVB PTP RX PKT ANNOUNCE PRI1 QUAL HI OFFSET. More...
 
#define XAVB_PTP_RX_PKT_ANNOUNCE_QUAL_LOW_PRI2_GMID_HI_OFFSET   0x00000040
 XAVB PTP RX PKT ANNOUNCE QUAL LOW PRI2 GMID HI OFFSET. More...
 
#define XAVB_PTP_RX_PKT_ANNOUNCE_GMID_MID_OFFSET   0x00000044
 XAVB PTP RX PKT ANNOUNCE GMID MID OFFSET. More...
 
#define XAVB_PTP_RX_PKT_ANNOUNCE_GMID_LOW_STEPSREMOVED_HI_OFFSET   0x00000048
 XAVB PTP RX PKT ANNOUNCE GMID LOW STEPSREMOVED HI OFFSET. More...
 
#define XAVB_PTP_RX_PKT_ANNOUNCE_STEPSREMOVED_LOW_TIMESRC_OFFSET   0x0000004C
 XAVB PTP RX PKT ANNOUNCE STEPSREMOVED LOW TIMESRC OFFSET. More...
 
Rx Signalling PTP Frame Structure Definitions.
#define XAVB_PTP_RX_PKT_SIGNALING_DELAY_INTERVAL_OFFSET   0x00000044
 XAVB PTP RX PKT SIGNALING DELAY INTERVAL OFFSET. More...
 
Standard PTP Frame Field Definitions (from IEEE802.1AS specification).
#define XAVB_PTP_ETHERTYPE   0x88F7
 XAVB PTP ETHERTYPE. More...
 
#define XAVB_PTP_VERSION_PTP   2
 XAVB PTP VERSION PTP. More...
 
Real Time Clock Definitions.
#define XAVB_ONE_SECOND   1000000000
 Value in ns. More...
 
#define XAVB_PERIOD_8KHZ   125000
 Value in ns. More...
 
Real Time Clock Locked Definitions.

If the Slave error is > this threshold then define PTP to be.

unlocked and link not asCapable. This threshold is not specified in IEEE 802.1as.

#define XAVB_CLOCK_LOCK_THRESHOLD   1000
 Value in ns. More...
 
RTC Increment Value Update Definitions

Define how often to re-calculate the RTC Increment This value.

indicates how many good Sync/FollowUp message pairs are received before the re-calculation is performed.

#define XAVB_NUM_SYNC_FU_PAIR_CALC_RTC_INCREMENT   2
 XAVB NUM SYNC FU PAIR CALC RTC INCREMENT. More...
 

Typedefs

typedef void(* XAvb_Handler )(void *CallBackRef, u32 TimestampsUncertain)
 Callback function. More...
 

Functions

XStatus XAvb_CfgInitialize (XAvb *InstancePtr, XAvb_Config *ConfigPtr, u32 EffectiveAddress)
 A function to initialise variables in the data structure records. More...
 
XAvb_Config * XAvb_LookupConfig (u16 DeviceId)
 Looks up the device configuration matching the given device ID. More...
 
void XAvb_Reset (XAvb *InstancePtr)
 Implements the XAvb_Reset helper. More...
 
void XAvb_Start (XAvb *InstancePtr)
 start the PTP drivers running. More...
 
void XAvb_Stop (XAvb *InstancePtr)
 stop the PTP drivers from running. More...
 
void XAvb_PtpTimerInterruptHandler (XAvb *InstancePtr)
 The Interrupt subroutine for the "interruptPtpTimer" signal. More...
 
void XAvb_PtpRxInterruptHandler (XAvb *InstancePtr)
 Implements the XAvb_PtpRxInterruptHandler helper. More...
 
void XAvb_SetupRxFilterControlPcp (XAvb *InstancePtr, u32 VlanPriority, u8 SrClass)
 A function to set the VLAN PCP field for either SR A or B traffic in the. More...
 
void XAvb_SetupRxFilterControlVid (XAvb *InstancePtr, u32 VlanVid, u8 SrClass)
 Implements the XAvb_SetupRxFilterControlVid helper. More...
 
void XAvb_SetupRxFilterControlMatchMode (XAvb *InstancePtr, u32 VlanMatchMode)
 Implements the XAvb_SetupRxFilterControlMatchMode helper. More...
 
u32 XAvb_ReorderWord (u32 Data)
 Implements the XAvb_ReorderWord helper. More...
 
u32 XAvb_CompareClockIdentity (u32 BaseAddress, XAvb_ClockIdentity Identity1, XAvb_ClockIdentity Identity2)
 A function to compare two ClockIdentity values. More...
 
u32 XAvb_ComparePortIdentity (u32 BaseAddress, XAvb_PortIdentity Identity1, XAvb_PortIdentity Identity2)
 Implements the XAvb_ComparePortIdentity helper. More...
 
void XAvb_WriteToMultipleTxPtpFrames (u32 BaseAddress, u32 Address, u32 Data, u32 DataBitEnable, u8 BufferEnable)
 Implements the XAvb_WriteToMultipleTxPtpFrames helper. More...
 
u32 XAvb_IncSequenceId (u32 BaseAddress, u32 PTPFrameBaseAddress)
 Implements the XAvb_IncSequenceId helper. More...
 
void XAvb_GetPortIdentity (u32 BaseAddress, u32 PtpFrameBaseAddr, u32 PortIdOffset, XAvb_PortIdentity *portID)
 A function to extract portIdentity information from a received PTP frame. More...
 
void XAvb_WaitOnTxPtpQueue (XAvb *InstancePtr)
 Implements the XAvb_WaitOnTxPtpQueue helper. More...
 
void XAvb_MasterSendAnnounce (XAvb *InstancePtr)
 A function to format then request the transmission of a PTP Announce Packet. More...
 
void XAvb_MasterSendSync (XAvb *InstancePtr)
 A function to format then request the transmission of a PTP Sync Packet. More...
 
void XAvb_MasterSendFollowUp (XAvb *InstancePtr)
 Implements the XAvb_MasterSendFollowUp helper. More...
 
void XAvb_SendPDelayReq (XAvb *InstancePtr)
 A function to format then request the transmission of a PTP PDelay Request. More...
 
void XAvb_SendPDelayResp (XAvb *InstancePtr, u32 PtpFrameBaseAddr)
 A function to format then request the transmission of a PTP PDelay Response. More...
 
void XAvb_SendPDelayRespFollowUp (XAvb *InstancePtr)
 Implements the XAvb_SendPDelayRespFollowUp helper. More...
 
u32 XAvb_IsRxFramePTP (XAvb *InstancePtr, u32 PtpFrameBaseAddr)
 A function to check that various fields in the received frame contain the. More...
 
void XAvb_DecodeRxSync (XAvb *InstancePtr, u32 PtpFrameBaseAddr)
 Implements the XAvb_DecodeRxSync helper. More...
 
void XAvb_DecodeRxFollowUp (XAvb *InstancePtr, u32 PtpFrameBaseAddr)
 A function to decode a received PTP Follow-up Packet. More...
 
void XAvb_DecodeRxPDelayResp (XAvb *InstancePtr, u32 PtpFrameBaseAddr)
 Implements the XAvb_DecodeRxPDelayResp helper. More...
 
void XAvb_DecodeRxPDelayRespFollowUp (XAvb *InstancePtr, u32 PtpFrameBaseAddr)
 A function to decode a received PDelayRespFollowUp Packet. More...
 
void XAvb_DecodeRxSignaling (XAvb *InstancePtr, u32 PtpFrameBaseAddr)
 Implements the XAvb_DecodeRxSignaling helper. More...
 
u16 XAvb_UpdateIntervalDuration (u16 currentIntervalDuration, char logMeanVal)
 A function to update a PTP message Interval Duration (defined as a. More...
 
u16 XAvb_ConvertLogMeanToDuration (char logMeanVal)
 Implements the XAvb_ConvertLogMeanToDuration helper. More...
 
char XAvb_ConvertDurationToLogMean (u16 fractionalVal)
 A function to convert a fraction of 128 value that is compatible with. More...
 
void XAvb_UpdateLogMeanMessageInterval (u32 BaseAddress, u32 PtpFrameBaseAddr, u16 intervalDuration)
 A function to update the logMeanMessageInterval field in a PTP packet. More...
 
void XAvb_SetupSourcePortIdentity (XAvb *InstancePtr, XAvb_PortIdentity systemIdentity)
 Implements the XAvb_SetupSourcePortIdentity helper. More...
 
void XAvb_DecodeTxAnnounceFrame (XAvb *InstancePtr)
 Implements the XAvb_DecodeTxAnnounceFrame helper. More...
 
void XAvb_DecodeRxAnnounceFrame (XAvb *InstancePtr, u32 PtpFrameBaseAddr)
 A New Announce Packet has been received. More...
 
void XAvb_ReadAnnounceFrame (u32 BaseAddress, u32 PtpFrameBaseAddr, XAvb_BmcData *AnnounceFrame)
 Implements the XAvb_ReadAnnounceFrame helper. More...
 
void XAvb_ReadAnnounceReceiptTimeout (u32 BaseAddress, u32 PtpFrameBaseAddr, XAvb_BmcData *AnnounceFrame)
 Implements the XAvb_ReadAnnounceReceiptTimeout helper. More...
 
void XAvb_UpdateBmcRecords (XAvb_BmcData *NewMaster, XAvb_BmcData *CurrentBmc)
 Implements the XAvb_UpdateBmcRecords helper. More...
 
u32 XAvb_BestMasterClockAlgorithm (XAvb_BmcData *AnnounceFrame, XAvb_BmcData *CurrentBmc)
 accept the data pointer to the current BMCA records, accept. More...
 
void XAvb_BecomeRtcMaster (XAvb *InstancePtr, u8 txAnnounceHasWon)
 Implements the XAvb_BecomeRtcMaster helper. More...
 
void XAvb_BecomeRtcSlave (XAvb *InstancePtr)
 make any adjustments needed when the node becomes a PTP slave. More...
 
void XAvb_ChangePTPLockStatus (XAvb *InstancePtr, u8 locked)
 Operations needed when PTP locks or unlocks. More...
 
void XAvb_ChangePeerASCapability (XAvb *InstancePtr, u8 capable)
 Implements the XAvb_ChangePeerASCapability helper. More...
 
void XAvb_SetGMDiscontinuityHandler (XAvb *InstancePtr, XAvb_Handler FuncPtr, void *CallBackRef)
 Sets the handler that will be called when a GM discontinuity. More...
 
u32 XAvb_CaptureNanoSec (u32 BaseAddress, u32 PtpFrameBaseAddr)
 Captures the nanosecond timestamp field from a received PTP frame. More...
 
void XAvb_CalcDelay (XAvb *InstancePtr)
 Measures the link delay of the local full-duplex Ethernet link. More...
 
void XAvb_CalcRtcOffset (XAvb *InstancePtr, u32 PtpFrameBaseAddr)
 Calculates the slave RTC offset from the grandmaster time. More...
 
void XAvb_UpdateRtcIncrement (XAvb *InstancePtr)
 Updates the RTC increment rate based on measured sync timing error. More...
 
void XAvb_Adjust8kClock (u32 BaseAddress, u32 NewOffset)
 Adjusts the 8 kHz clock phase offset. More...
 

Macro Definition Documentation

#define XAVB_ALLOWED_LOST_RESPONSES   3

XAVB_ALLOWED_LOST_RESPONSES is the number of Pdelay_Req messages for which a valid response is not received, above.

which the Peer should no longer be considered ASCapableXAVB ALLOWED LOST RESPONSES.

Referenced by XAvb_PtpTimerInterruptHandler().

#define XAVB_ANNOUNCE_RECEIPT_TIMEOUT   2

XAVB_ANNOUNCE_RECEIPT_TIMEOUT is the number of announce intervals without the receipt of an Announce message from.

the GM that are allowed before the GM is assumed to be no longer present and BMCA should be run againXAVB ANNOUNCE RECEIPT TIMEOUT.

Referenced by XAvb_PtpTimerInterruptHandler().

#define XAVB_CLOCK_LOCK_THRESHOLD   1000

Value in ns.

Referenced by XAvb_UpdateRtcIncrement().

#define XAVB_DEFAULT_LOG_MEAN_ANNOUNCE_INTERVAL   0
  • 128/128 = 2^(0) = 1 s.

Referenced by XAvb_DecodeRxSignaling(), and XAvb_Reset().

#define XAVB_DEFAULT_LOG_MEAN_PDELAY_REQ_INTERVAL   0
  • 128/128 = 2^(0) = 1 s.

Referenced by XAvb_DecodeRxSignaling(), and XAvb_Reset().

#define XAVB_DEFAULT_LOG_MEAN_SYNC_INTERVAL   (-3)
  • 2^(-3) = 125ms.

Referenced by XAvb_DecodeRxSignaling(), and XAvb_Reset().

#define XAVB_H

by using protection macros.

#define XAVB_MAX_SUPPORTED_LOG_MEAN_INTERVAL   8
  • 32768/128 = 256 s.

Referenced by XAvb_UpdateIntervalDuration().

#define XAVB_MIN_SUPPORTED_LOG_MEAN_INTERVAL   (-7)
  • 1/128 s.

Referenced by XAvb_UpdateIntervalDuration().

#define XAVB_NEIGHBOR_PROP_DELAY_THRESH   5000

XAVB_NEIGHBOR_PROP_DELAY_THRESH is the maximum allowed delay (in nanosecs) across a full duplex link for which the AVB protocol is allowed to function.

Although this parameter is defined in the IEEE spec, no default is defined.XAVB NEIGHBOR PROP DELAY THRESH.

Referenced by XAvb_CalcDelay().

#define XAVB_NUM_SYNC_FU_PAIR_CALC_RTC_INCREMENT   2

XAVB NUM SYNC FU PAIR CALC RTC INCREMENT.

Referenced by XAvb_DecodeRxFollowUp(), and XAvb_UpdateRtcIncrement().

#define XAVB_PDELAY_LOG_MEAN_MESSAGE_INT   0x7F050000

XAVB PDELAY LOG MEAN MESSAGE INT.

Referenced by XAvb_SendPDelayResp().

#define XAVB_PERIOD_8KHZ   125000

Value in ns.

Referenced by XAvb_Adjust8kClock().

#define XAVB_PKT_TYPE_DISABLED   0xffff

XAVB PKT TYPE DISABLED.

Referenced by XAvb_DecodeRxSignaling(), and XAvb_PtpTimerInterruptHandler().

#define XAVB_PTP_ETHERTYPE   0x88F7

XAVB PTP ETHERTYPE.

Referenced by XAvb_IsRxFramePTP().

#define XAVB_PTP_PKT_CAPTURED_TIMESTAMP_OFFSET   0x000000FC
#define XAVB_PTP_RX_PKT_ANNOUNCE_GMID_LOW_STEPSREMOVED_HI_OFFSET   0x00000048

XAVB PTP RX PKT ANNOUNCE GMID LOW STEPSREMOVED HI OFFSET.

Referenced by XAvb_ReadAnnounceFrame().

#define XAVB_PTP_RX_PKT_ANNOUNCE_GMID_MID_OFFSET   0x00000044

XAVB PTP RX PKT ANNOUNCE GMID MID OFFSET.

Referenced by XAvb_ReadAnnounceFrame().

#define XAVB_PTP_RX_PKT_ANNOUNCE_PRI1_QUAL_HI_OFFSET   0x0000003C

XAVB PTP RX PKT ANNOUNCE PRI1 QUAL HI OFFSET.

Referenced by XAvb_ReadAnnounceFrame().

#define XAVB_PTP_RX_PKT_ANNOUNCE_QUAL_LOW_PRI2_GMID_HI_OFFSET   0x00000040

XAVB PTP RX PKT ANNOUNCE QUAL LOW PRI2 GMID HI OFFSET.

Referenced by XAvb_ReadAnnounceFrame().

#define XAVB_PTP_RX_PKT_ANNOUNCE_STEPSREMOVED_LOW_TIMESRC_OFFSET   0x0000004C

XAVB PTP RX PKT ANNOUNCE STEPSREMOVED LOW TIMESRC OFFSET.

Referenced by XAvb_ReadAnnounceFrame().

#define XAVB_PTP_RX_PKT_CORRECTION_FIELD_OFFSET   0x00000018

XAVB PTP RX PKT CORRECTION FIELD OFFSET.

Referenced by XAvb_DecodeRxFollowUp().

#define XAVB_PTP_RX_PKT_PORTID_LOWER_OFFSET   0x00000028

XAVB PTP RX PKT PORTID LOWER OFFSET.

Referenced by XAvb_SendPDelayResp().

#define XAVB_PTP_RX_PKT_PORTID_MID_OFFSET   0x00000024

XAVB PTP RX PKT PORTID MID OFFSET.

Referenced by XAvb_SendPDelayResp().

#define XAVB_PTP_RX_PKT_PORTID_UPPER_OFFSET   0x00000020
#define XAVB_PTP_RX_PKT_REQ_PORTID_LOWER_OFFSET   0x00000040

XAVB PTP RX PKT REQ PORTID LOWER OFFSET.

#define XAVB_PTP_RX_PKT_REQ_PORTID_MID_OFFSET   0x0000003C

XAVB PTP RX PKT REQ PORTID MID OFFSET.

#define XAVB_PTP_RX_PKT_REQ_PORTID_UPPER_OFFSET   0x00000038
#define XAVB_PTP_RX_PKT_SA_LOWER_OFFSET   0x00000008

XAVB PTP RX PKT SA LOWER OFFSET.

#define XAVB_PTP_RX_PKT_SA_UPPER_OFFSET   0x00000004

XAVB PTP RX PKT SA UPPER OFFSET.

#define XAVB_PTP_RX_PKT_SEQUENCEID_OFFSET   0x0000002C
#define XAVB_PTP_RX_PKT_SIGNALING_DELAY_INTERVAL_OFFSET   0x00000044

XAVB PTP RX PKT SIGNALING DELAY INTERVAL OFFSET.

Referenced by XAvb_DecodeRxSignaling().

#define XAVB_PTP_RX_PKT_TIMESTAMP_LOWER_OFFSET   0x00000038

upper 2 bytes.

Referenced by XAvb_CaptureNanoSec().

#define XAVB_PTP_RX_PKT_TIMESTAMP_MID_OFFSET   0x00000034

XAVB PTP RX PKT TIMESTAMP MID OFFSET.

Referenced by XAvb_CalcRtcOffset(), and XAvb_CaptureNanoSec().

#define XAVB_PTP_RX_PKT_TIMESTAMP_UPPER_OFFSET   0x00000030

XAVB PTP RX PKT TIMESTAMP UPPER OFFSET.

Referenced by XAvb_CalcRtcOffset().

#define XAVB_PTP_RX_PKT_TYPE_OFFSET   0x0000000C

XAVB PTP RX PKT TYPE OFFSET.

Referenced by XAvb_IsRxFramePTP(), and XAvb_PtpRxInterruptHandler().

#define XAVB_PTP_TX_ANNOUNCE   0x5

XAVB PTP TX ANNOUNCE.

#define XAVB_PTP_TX_FOLLOW_UP   0x1

XAVB PTP TX FOLLOW UP.

#define XAVB_PTP_TX_PDELAYREQ   0x2

XAVB PTP TX PDELAYREQ.

#define XAVB_PTP_TX_PDELAYRESP   0x3

XAVB PTP TX PDELAYRESP.

#define XAVB_PTP_TX_PDELAYRESP_FOLLOW_UP   0x4

XAVB PTP TX PDELAYRESP FOLLOW UP.

#define XAVB_PTP_TX_PKT_ANNOUNCE_CURR_UTCOFF_OFFSET   0x00000040

XAVB PTP TX PKT ANNOUNCE CURR UTCOFF OFFSET.

#define XAVB_PTP_TX_PKT_ANNOUNCE_GMID_LOW_STEPSREMOVED_HI_OFFSET   0x00000050

XAVB PTP TX PKT ANNOUNCE GMID LOW STEPSREMOVED HI OFFSET.

Referenced by XAvb_SetupSourcePortIdentity().

#define XAVB_PTP_TX_PKT_ANNOUNCE_GMID_MID_OFFSET   0x0000004C

XAVB PTP TX PKT ANNOUNCE GMID MID OFFSET.

Referenced by XAvb_SetupSourcePortIdentity().

#define XAVB_PTP_TX_PKT_ANNOUNCE_QUAL_LOW_PRI2_GMID_HI_OFFSET   0x00000048

XAVB PTP TX PKT ANNOUNCE QUAL LOW PRI2 GMID HI OFFSET.

Referenced by XAvb_SetupSourcePortIdentity().

#define XAVB_PTP_TX_PKT_ANNOUNCE_STEPSREMOVED_LOW_TIMESRC_OFFSET   0x00000054

XAVB PTP TX PKT ANNOUNCE STEPSREMOVED LOW TIMESRC OFFSET.

#define XAVB_PTP_TX_PKT_ANNOUNCE_TLVLEN_PATHSEQ_START_OFFSET   0x00000058

XAVB PTP TX PKT ANNOUNCE TLVLEN PATHSEQ START OFFSET.

Referenced by XAvb_SetupSourcePortIdentity().

#define XAVB_PTP_TX_PKT_CORRECTION_FIELD_OFFSET   0x00000020

XAVB PTP TX PKT CORRECTION FIELD OFFSET.

Referenced by XAvb_MasterSendFollowUp().

#define XAVB_PTP_TX_PKT_PORTID_LOWER_OFFSET   0x00000030

XAVB PTP TX PKT PORTID LOWER OFFSET.

Referenced by XAvb_SetupSourcePortIdentity().

#define XAVB_PTP_TX_PKT_PORTID_MID_OFFSET   0x0000002C

XAVB PTP TX PKT PORTID MID OFFSET.

Referenced by XAvb_SetupSourcePortIdentity().

#define XAVB_PTP_TX_PKT_PORTID_UPPER_OFFSET   0x00000028

XAVB PTP TX PKT PORTID UPPER OFFSET.

Referenced by XAvb_SetupSourcePortIdentity().

#define XAVB_PTP_TX_PKT_REQ_PORTID_LOWER_OFFSET   0x00000048

XAVB PTP TX PKT REQ PORTID LOWER OFFSET.

Referenced by XAvb_SendPDelayResp().

#define XAVB_PTP_TX_PKT_REQ_PORTID_MID_OFFSET   0x00000044

XAVB PTP TX PKT REQ PORTID MID OFFSET.

Referenced by XAvb_SendPDelayResp().

#define XAVB_PTP_TX_PKT_REQ_PORTID_UPPER_OFFSET   0x00000040

lower 2 bytes.

Referenced by XAvb_SendPDelayResp().

#define XAVB_PTP_TX_PKT_SA_LOWER_OFFSET   0x00000010

XAVB PTP TX PKT SA LOWER OFFSET.

Referenced by main().

#define XAVB_PTP_TX_PKT_SA_UPPER_OFFSET   0x0000000C

XAVB PTP TX PKT SA UPPER OFFSET.

Referenced by main().

#define XAVB_PTP_TX_PKT_SEQUENCEID_OFFSET   0x00000034
#define XAVB_PTP_TX_PKT_TIMESTAMP_LOWER_OFFSET   0x00000040
#define XAVB_PTP_TX_PKT_TIMESTAMP_MID_OFFSET   0x0000003C

XAVB PTP TX PKT TIMESTAMP MID OFFSET.

Referenced by XAvb_MasterSendSync(), XAvb_SendPDelayResp(), and XAvb_SendPDelayRespFollowUp().

#define XAVB_PTP_TX_PKT_TIMESTAMP_UPPER_OFFSET   0x00000038

XAVB PTP TX PKT TIMESTAMP UPPER OFFSET.

Referenced by XAvb_MasterSendSync(), XAvb_SendPDelayResp(), and XAvb_SendPDelayRespFollowUp().

#define XAVB_PTP_TX_PKT_TYPE_OFFSET   0x00000014

XAVB PTP TX PKT TYPE OFFSET.

#define XAVB_PTP_TX_SIGNALING   0x6

XAVB PTP TX SIGNALING.

#define XAVB_PTP_TX_SYNC   0x0

XAVB PTP TX SYNC.

#define XAVB_PTP_TYPE_ANNOUNCE   0xB

XAVB PTP TYPE ANNOUNCE.

Referenced by XAvb_PtpRxInterruptHandler().

#define XAVB_PTP_TYPE_FOLLOW_UP   0x8

XAVB PTP TYPE FOLLOW UP.

Referenced by XAvb_PtpRxInterruptHandler().

#define XAVB_PTP_TYPE_PDELAYREQ   0x2

XAVB PTP TYPE PDELAYREQ.

Referenced by XAvb_PtpRxInterruptHandler().

#define XAVB_PTP_TYPE_PDELAYRESP   0x3

XAVB PTP TYPE PDELAYRESP.

Referenced by XAvb_PtpRxInterruptHandler().

#define XAVB_PTP_TYPE_PDELAYRESP_FOLLOW_UP   0xA

XAVB PTP TYPE PDELAYRESP FOLLOW UP.

Referenced by XAvb_PtpRxInterruptHandler().

#define XAVB_PTP_TYPE_SIGNALING   0xC

XAVB PTP TYPE SIGNALING.

Referenced by XAvb_PtpRxInterruptHandler().

#define XAVB_PTP_TYPE_SYNC   0x0

XAVB PTP TYPE SYNC.

Referenced by XAvb_PtpRxInterruptHandler().

#define XAVB_PTP_VERSION_PTP   2

XAVB PTP VERSION PTP.

Referenced by XAvb_IsRxFramePTP().

#define XAVB_RX_MAC_LATENCY_IN_NS   80

XAVB RX MAC LATENCY IN NS.

Referenced by XAvb_DecodeRxPDelayResp(), XAvb_DecodeRxSync(), and XAvb_SendPDelayResp().

#define XAVB_SYNC_RECEIPT_TIMEOUT   3

XAVB_SYNC_RECEIPT_TIMEOUT is the number of sync intervals without the receipt of an Sync message from the GM that are.

allowed before the GM is assumed to be no longer present and BMCA should be run againXAVB SYNC RECEIPT TIMEOUT.

Referenced by XAvb_PtpTimerInterruptHandler().

#define XAVB_TX_MAC_LATENCY_IN_NS   80

XAVB TX MAC LATENCY IN NS.

Referenced by XAvb_MasterSendFollowUp(), XAvb_SendPDelayReq(), and XAvb_SendPDelayRespFollowUp().

Typedef Documentation

typedef void(* XAvb_Handler)(void *CallBackRef, u32 TimestampsUncertain)

Callback function.

The first argument is a callback reference passed in by. the upper layer when setting the callback functions, and passed back to the upper layer when the callback is invoked. The second argument is a '1' if a Grandmaster Discontinuity event has occurred otherwise it is '0'.

Function Documentation

XAvb_Config* XAvb_LookupConfig ( u16  DeviceId)

Looks up the device configuration matching the given device ID.

Parameters
[in]DeviceIdcontains the unique ID of the device.
Returns
A pointer to the configuration table entry for the given device ID, or NULL if no match is found.