INtime SDK Help
hpeAttachReceiveBufferSetToQueue
INtime SDK v7.1 > About INtime > Networking and I/O > High-Performance Ethernet > hpeAttachReceiveBufferSetToQueue

Attaches a set of receive buffers to the designated queue for use by the DMA engine to receive 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 hpeAllocateReceiveBufferSet 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 hpeAttachReceiveBufferSetToQueue(
    HPEHANDLE devhandle, 
    DWORD queue_index,
    HPERXBUFFERSET *rx_buffer_set
);

Parameters

devhandle
A handle value for the device.
queue_index
The index of the queue where the buffers will be attached.
rx_buffer_set
A pointer to an initialized HPERXBUFFERSET structure, which describes a set of buffers to be used for receiving frames.

Return Values

A status value indicating the success or failure of the operation:

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 6.0 (HPE3) intime/rt/include/hpeif2.h hpeif2.h hpeif2.lib
See Also