XilinxProcessorIPLib/drivers/axiethernet/examples/avb/xavb_ptp_packets.c
u32 XAvb_IncSequenceId(u32 BaseAddress, u32 PtpFrameBaseAddress) {
  u32 BufferWord = 0;
  u32 SequenceId = 0;

  /** Read the 32-bit BufferWord containing the SequenceId from the PTP buffer */
  BufferWord =  XAvb_ReadPtpBuffer(BaseAddress,
                                    PtpFrameBaseAddress,
                                    XAVB_PTP_TX_PKT_SEQUENCEID_OFFSET);

  /** Swap byte order into correct binary and increment the SequenceId */
  SequenceId = XAvb_ReorderWord(BufferWord) + 0x10000;

  /** Swap back the byte order into frame storage order */
  SequenceId = XAvb_ReorderWord(SequenceId);

  /** Write the 32-bit BufferWord variable containing the updated SequenceId */
  XAvb_WritePtpBuffer(BaseAddress,
                      PtpFrameBaseAddress,
                      XAVB_PTP_TX_PKT_SEQUENCEID_OFFSET,
                      SequenceId);

  return SequenceId;

}
/****************************************************************************/
/**
*
* A function to increment the sequenceId in a PTP frame template
*
* @param  BaseAddress is the base address of the device
* @param  PtpFrameBaseAddress is the base address of the TX PTP Buffer whose
*         SequenceID is to be incremented
*
* @return None.  But the relevant TX PTP Packet Buffer is written to with the
*                updated SequenceID
*
* @note   None.
*
*****************************************************************************/
A function to increment the sequenceId in a PTP frame template
A function to increment the sequenceId in a PTP frame template
u32 XAvb_IncSequenceId(u32 BaseAddress, u32 PtpFrameBaseAddress) {
  u32 BufferWord = 0;
  u32 SequenceId = 0;
  BufferWord =  XAvb_ReadPtpBuffer(BaseAddress,
                                    PtpFrameBaseAddress,
                                    XAVB_PTP_TX_PKT_SEQUENCEID_OFFSET);
  SequenceId = XAvb_ReorderWord(BufferWord) + 0x10000;
  SequenceId = XAvb_ReorderWord(SequenceId);
  XAvb_WritePtpBuffer(BaseAddress,
                      PtpFrameBaseAddress,
                      XAVB_PTP_TX_PKT_SEQUENCEID_OFFSET,
                      SequenceId);
  return SequenceId;
}
u32 XAvb_IncSequenceId ( u32 BaseAddress , u32 PtpFrameBaseAddress ) { u32 BufferWord = 0 ; u32 SequenceId = 0 ; BufferWord = XAvb_ReadPtpBuffer ( BaseAddress , PtpFrameBaseAddress , XAVB_PTP_TX_PKT_SEQUENCEID_OFFSET ) ; SequenceId = XAvb_ReorderWord ( BufferWord ) + 0x10000 ; SequenceId = XAvb_ReorderWord ( SequenceId ) ; XAvb_WritePtpBuffer ( BaseAddress , PtpFrameBaseAddress , XAVB_PTP_TX_PKT_SEQUENCEID_OFFSET , SequenceId ) ; return SequenceId ; }
A function to increment the sequenceId in a PTP frame template
A function to increment the sequenceId in a PTP frame template
/** Read the 32-bit BufferWord containing the SequenceId from the PTP buffer */ /** Swap byte order into correct binary and increment the SequenceId */ /** Swap back the byte order into frame storage order */ /** Write the 32-bit BufferWord variable containing the updated SequenceId */