INtime SDK Help
mhpeAllocateReceiveBufferSet
INtime SDK v7.1 > About INtime > Networking and I/O > Multiprocess HPE > mhpeAllocateReceiveBufferSet

Allocate a receive buffer set
Attaches a set of receive buffers to the designated RX endpoint for use by the DMA engine to Ethernet frames. This call should be made only once at initialization time and number of receive buffers should not be changed during active reception of frames.
The receive buffer set must be allocated by mhpeAllocateReceiveBufferSet to make the application compatible across different Network Devices.
The buffer_count field of the HPERXBUFFERSET structure should be initialized to the number of elements in the set. Each element of the buffer set should be initialized so that the ptr and size fields of each HPEBUFFER element are initialized to point to each memory buffer to be used for receive frames. The other fields are for internal use.
The DMA engine will use the receive buffers cyclically. Before any receive buffer can be reused for a received frame a call to hpeGetReceiveBuffer must be made referring to that buffer.

HPESTATUS mhpeAllocateReceiveBufferSet(
    MHPEHANDLE      ephandle,
MHPERXBUFFERSET **rx_buffer_set,
uint32_t buffer_count,
uint32_t buffer_size
);

Parameters

ephandle
A handle for an RX endpoint.
rx_buffer_set
If non-null, set the receive buffer belongs to.
buffer_count
Number of buffers in the buffer set.
buffer_size
Size of each buffer in the set.

Return Values

A HPESTATUS value indicating the success or failure of the operation.

Status

E_OK
The operation completed successfully.
E_EXIST
The handle given is not a handle for an open HPE interface.
E_INVALID_ADDR
The rx_buffer_set parameter is not a valid pointer.
E_PARAM
The rx_buffer_set.buffer_count field is zero, or too big for the size of the buffer allocated, or the field is not compatible with the requirements of the hardware.
E_STATE
The Ethernet receiver was active when the call was made and it was not possible to attach the buffer set.
E_LIMIT
One of:
The number of buffers to be attached exceeds the maximum number of receive descriptors at the device.
The number of receive descriptors can be set when the driver is loaded.
E_ALIGNMENT
The interface was not able to accept the receive buffer because of hardware alignment constraints.

Requirements

Versions Defined in Include Link to
INtime 7.1 intime/rt/include/mhpeif.h mhpeif.h mhpeif.lib
See Also