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

Attaches a set of transmit buffers to the designated queue as described in a HPETXBUFFERSET or HPETXSTREAMBUFFERSET structure. Data in these buffers will be accessed directly by the DMA engine of the queue. Each buffer may be defined as a number (up to four) of fragments which will be chained together when the frame is transmitted.

HPESTATUS hpeAttachTransmitBufferSetToQueue(
    HPEHANDLE devhandle, 
DWORD queue_index, HPETXBUFFERSET *tx_buffer_set );

Parameters

devhandle
A handle value for the device.
queue_index
The index of the designated queue.
tx_buffer_set
A pointer to a HPETXBUFFERSET or a HPETXSTREAMBUFFSETSET structure, which describes a set of buffers to be used for transmitting frames.

Remarks

If this call is made after a transmit operation has been completed and the currently-attached buffers have not been reset, the completed buffers will be detached from the hardware before the new set is attached.

The buffer_count field of the HPETXBUFFERSET or HPETXSTREAMBUFFERSET structure should be initialized to the number of elements in the set. Each element of the buffer set should be initialized so that the fragment_count field of each HPETXBUFFER element and the ptr and size fields of each HPEBUFFER fragment are initialized to point to each memory buffer to be used for receive frames. The other fields are for internal use.

The maximum length of a single frame (or the total size of fragments in a single frame) is limited to 1514 bytes including the 14 bytes Ethernet header.

Note: A driver optimization means that the paddr fields of all HPEBUFFER structure passed in the tx_buffer_set parameter must be either cleared to zero, or contain a valid physical address corresponding to the associated ptr field. If a non-zero value is passed in the structure, the driver assumes that this physical address is valid, otherwise the driver will calculate the physical address of the corresponding buffer. If the buffer set is going to be reused, it is recommended that the driver is allowed to calculate the physical address the first time, then the user should leave the values for subsequent calls to hpeAttachTransmitBufferSet.

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 tx_buffer_set parameter was not a valid pointer.
E_PARAM At least one of the tx_buffer_set, fragment_count or buffer_count fields was zero, or too big for the buffer allocated.
E_STATE The transmit engine was active at the time of the call and it was not possible to attach the buffers.
E_LIMIT One of:
The transmit descriptor list is full; no more buffers can be added. The size of the transmitter buffer queue can be set when the driver is loaded.
The queue_index parameter is out of bounds for the current hardware interface.
E_TRANSMISSION The physical link is down; no buffers can be added to the queue.
If this condition is received, terminate any outstanding receive operation, then close the interface (hpeClose) and reinitialize the software before reopening the interface.

Requirements

Versions Defined in Include Link to
INtime 6.0 (HPE3) intime/rt/include/hpeif2.h hpeif2.h hpeif2.lib
See Also