XilinxProcessorIPLib/drivers/axiethernet/examples/xaxiethernet_example_util.c
void AxiEthernetUtilFrameSetPayloadData(EthernetFrame *FramePtr,
							int PayloadSize)
{
	unsigned BytesLeft = PayloadSize;
	u8 *Frame;
	u16 Counter = 0;

	/*
	 * Set the frame pointer to the start of the payload area
	 */
	Frame = (u8 *) FramePtr + XAE_HDR_SIZE + Padding;

	/*
	 * Insert 8 bit incrementing pattern
	 */
	while (BytesLeft && (Counter < 256)) {
		*Frame++ = (u8) Counter++;
		BytesLeft--;
	}

	/*
	 * Switch to 16 bit incrementing pattern
	 */
	while (BytesLeft) {
		*Frame++ = (u8) (Counter >> 8);	/* high */
		BytesLeft--;

		if (!BytesLeft)
			break;

		*Frame++ = (u8) Counter++;	/* low */
		BytesLeft--;
	}
}
/******************************************************************************/
/**
* This function places a pattern in the payload section of a frame. The pattern
* is a  8 bit incrementing series of numbers starting with 0.
* Once the pattern reaches 256, then the pattern changes to a 16 bit
* incrementing pattern:
* <pre>
*   0, 1, 2, ... 254, 255, 00, 00, 00, 01, 00, 02, ...
* </pre>
*
* @param	FramePtr is a pointer to the frame to change.
* @param	PayloadSize is the number of bytes in the payload that will be
*		set.
*
* @return	None.
*
* @note		None.
*
******************************************************************************/
This function places a pattern in the payload section of a frame. The pattern
is a  8 bit incrementing series of numbers starting with 0.
Once the pattern reaches 256, then the pattern changes to a 16 bit
incrementing pattern:

0, 1, 2, ...
This function places a pattern in the payload section of a frame . The pattern is a 8 bit incrementing series of numbers starting with 0 . Once the pattern reaches 256 then the pattern changes to a 16 bit incrementing pattern : 0 1 2 ...
void AxiEthernetUtilFrameSetPayloadData(EthernetFrame *FramePtr,
							int PayloadSize)
{
	unsigned BytesLeft = PayloadSize;
	u8 *Frame;
	u16 Counter = 0;
	Frame = (u8 *) FramePtr + XAE_HDR_SIZE + Padding;
	while (BytesLeft && (Counter < 256)) {
		*Frame++ = (u8) Counter++;
		BytesLeft--;
	}
	while (BytesLeft) {
		*Frame++ = (u8) (Counter >> 8);	
		BytesLeft--;
		if (!BytesLeft)
			break;
		*Frame++ = (u8) Counter++;	
		BytesLeft--;
	}
}
void AxiEthernetUtilFrameSetPayloadData ( EthernetFrame * FramePtr , int PayloadSize ) { unsigned BytesLeft = PayloadSize ; u8 * Frame ; u16 Counter = 0 ; Frame = ( u8 * ) FramePtr + XAE_HDR_SIZE + Padding ; while ( BytesLeft && ( Counter < 256 ) ) { * Frame ++ = ( u8 ) Counter ++ ; BytesLeft -- ; } while ( BytesLeft ) { * Frame ++ = ( u8 ) ( Counter >> 8 ) ; BytesLeft -- ; if ( ! BytesLeft ) break ; * Frame ++ = ( u8 ) Counter ++ ; BytesLeft -- ; } }
This function places a pattern in the payload section of a frame.
This function places a pattern in the payload section of a frame .
/*
	 * Set the frame pointer to the start of the payload area
	 */ /*
	 * Insert 8 bit incrementing pattern
	 */ /*
	 * Switch to 16 bit incrementing pattern
	 */ /* high */ /* low */