RtndAllocateRxFrameDataBuffers
RtndAllocateRxFrameDataBuffers allocates a set of receive frame data buffers.
Syntax
BOOL RtndAllocateRxFrameDataBuffers(
[in] ULONG_PTR RtndInterfaceId,
[in] ULONG RxQueueIndex,
[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] RxQueueIndex
An index of the Receive 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.RxFrameLength.
The driver must allocate one or more blocks of memory, each large enough to contain an integral number of receive frame data buffers. Then, the driver must fill in the passed buffer headers with the virtual and physical addresses of each receive 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 NIC's DMA must be able to store the content of the received frames in those buffers.
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: