RtndAllocateTxFrameDataBuffers

RtndAllocateTxFrameDataBuffers allocates a set of transmit frame data buffers.

Syntax

Copy
BOOL RtndAllocateTxFrameDataBuffers(
  [in]      ULONG_PTR RtndInterfaceId,
  [in]      ULONG TxQueueIndex,
  [in]      ULONG BufferCount
  [in, out] RTND_BUFFER_HEADER *pBufferHeader
);

Parameters

[in] RtndInterfaceId

A number or pointer returned by RtndManageInterface, used to identify the interface.

[in] TxQueueIndex

An index of the Transmit Queue.

[in] BufferCount

The count of buffers to allocate.

[in, out] pBufferHeader

The head of a linked list of buffer headers allocated by the NL2.

Return Value

If the function succeeds, it returns TRUE. If the function fails, it returns FALSE. To get extended error information, call GetLastError.

Common error codes:

Error code Meaning

ERROR_OUTOFMEMORY

Failed to allocate the required memory.

Remarks

The NL2 guarantees that the passed linked list of buffer headers contains exactly BufferCount elements.

The NL2 guarantees that this function will never be called with a BufferLength value greater than RTND_FEATURE_BUFFERS.MaxTxFrameLength.

The driver must allocate one or more blocks of memory, each large enough to contain an integral number of transmit frame data buffers. Then, the driver must fill in the passed buffer headers with the virtual and physical addresses of each transmit frame data buffer. Ideally, the driver should allocate one large block only to contain all the buffers to reduce fragmentation and allocation time. If the allocation of the large block fails, the driver should try to allocate smaller blocks until it finds a size that succeeds. Typically, drivers for physical devices will allocate contiguous memory, as the DMA of the NIC needs to be able to fetch from those buffers the content of the frames to transmit.

Characteristics

Real-time requirements

Deterministic behavior

Not required

Local memory allocation/deallocation restrictions

Process

External MSpace

Internal MSpace

System

Not allowed

Not allowed

Process

Allowed

Not allowed

Contiguous memory allocation/deallocation restrictions

Contiguous memory

Allowed

Requirements

Minimum supported version Header

eRTOS 1.0 SDK

Rtnd.h

See Also: