XilinxProcessorIPLib/drivers/axiethernet/examples/avb/xavb_ptp_packets.c
void XAvb_GetPortIdentity(u32 BaseAddress, u32 PtpFrameBaseAddr,
                          u32 PortIdOffset, XAvb_PortIdentity *portID) {

  u32 ReadWord;

  ReadWord = XAvb_ReorderWord(XAvb_ReadPtpBuffer(BaseAddress, PtpFrameBaseAddr, PortIdOffset));

  portID->ClockIdentityUpper = (ReadWord << 16);

  ReadWord = XAvb_ReorderWord(XAvb_ReadPtpBuffer(BaseAddress, PtpFrameBaseAddr, PortIdOffset + 4));

  portID->ClockIdentityUpper |= (ReadWord >> 16);
  portID->ClockIdentityLower  = (ReadWord << 16);

  ReadWord = XAvb_ReorderWord(XAvb_ReadPtpBuffer(BaseAddress, PtpFrameBaseAddr, PortIdOffset + 8));

  portID->ClockIdentityLower |= (ReadWord >> 16);
  portID->PortNumber          = ReadWord;

}
/****************************************************************************/
/**
*
* A function to extract portIdentity information from a received PTP frame.
* This can be any portIdentity field (header portIdentity, requestingPortIdentity,
* etc.)
*
* @param  BaseAddress is the base address of the device
* @param  PtpFrameBaseAddr is the base address of the received Announce Packet
*         in the Rx PTP Packet Buffer
* @param  PortIdOffset is the packet offset of the first byte of the portIdentity
*         field to be parsed
* @param  portID is the XAvb_PortIdentity struct that the data will be written to.
*
* @return None, but portID will be updated with the portIdentity information
*
* @note   None.
*
*****************************************************************************/
A function to extract portIdentity information from a received PTP frame.
This can be any portIdentity field (header portIdentity, requestingPortIdentity,
etc.)
A function to extract portIdentity information from a received PTP frame . This can be any portIdentity field ( header portIdentity requestingPortIdentity etc . )
void XAvb_GetPortIdentity(u32 BaseAddress, u32 PtpFrameBaseAddr,
                          u32 PortIdOffset, XAvb_PortIdentity *portID) {
  u32 ReadWord;
  ReadWord = XAvb_ReorderWord(XAvb_ReadPtpBuffer(BaseAddress, PtpFrameBaseAddr, PortIdOffset));
  portID->ClockIdentityUpper = (ReadWord << 16);
  ReadWord = XAvb_ReorderWord(XAvb_ReadPtpBuffer(BaseAddress, PtpFrameBaseAddr, PortIdOffset + 4));
  portID->ClockIdentityUpper |= (ReadWord >> 16);
  portID->ClockIdentityLower  = (ReadWord << 16);
  ReadWord = XAvb_ReorderWord(XAvb_ReadPtpBuffer(BaseAddress, PtpFrameBaseAddr, PortIdOffset + 8));
  portID->ClockIdentityLower |= (ReadWord >> 16);
  portID->PortNumber          = ReadWord;
}
void XAvb_GetPortIdentity ( u32 BaseAddress , u32 PtpFrameBaseAddr , u32 PortIdOffset , XAvb_PortIdentity * portID ) { u32 ReadWord ; ReadWord = XAvb_ReorderWord ( XAvb_ReadPtpBuffer ( BaseAddress , PtpFrameBaseAddr , PortIdOffset ) ) ; portID -> ClockIdentityUpper = ( ReadWord << 16 ) ; ReadWord = XAvb_ReorderWord ( XAvb_ReadPtpBuffer ( BaseAddress , PtpFrameBaseAddr , PortIdOffset + 4 ) ) ; portID -> ClockIdentityUpper |= ( ReadWord >> 16 ) ; portID -> ClockIdentityLower = ( ReadWord << 16 ) ; ReadWord = XAvb_ReorderWord ( XAvb_ReadPtpBuffer ( BaseAddress , PtpFrameBaseAddr , PortIdOffset + 8 ) ) ; portID -> ClockIdentityLower |= ( ReadWord >> 16 ) ; portID -> PortNumber = ReadWord ; }
A function to extract portIdentity information from a received PTP frame.
A function to extract portIdentity information from a received PTP frame .