RtndSubmitTxBuffer
RtndSubmitTxBuffer inserts a buffer into the specified Transmit Queue.
Syntax
BOOL RtndSubmitTxBuffer(
[in] ULONG_PTR RtndInterfaceId,
[in] ULONG TxQueueIndex,
[in] VOID *pTxQueueAppContext,
[in] RTND_BUFFER_HEADER *pBufferHeader,
[in, ignored] ULONG Flags
);
Parameters
[in] RtndInterfaceId
The number or pointer used to identify the interface. This value is returned by RtndManageInterface.
[in] TxQueueIndex
The index of the Transmit Queue.
[in] pTxQueueAppContext
The address of the context returned when the calling process called RtndAttachTxQueue.
[in] pBufferHeader
The address of the buffer header.
[in, ignored] Flags
Reserved for future use. The value is set to zero by the NL2. Drivers must ignore this parameter.
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_IO_DEVICE |
An unexpected error occurred while trying to access the device. |
RTNL2_ERROR_DEVICE_NO_LINK |
The device didn't accept the new buffer submission because the link is down. Note: This error code is used only for hardware that is not able to flush its Transmit Queues while the link is down. |
ERROR_DEVICE_NO_RESOURCES |
Failed to allocate the required memory. |
Note: Custom drivers may return other error codes not listed above.
Remarks
This function may be called from any process.
Depending on the design of the driver, this function may trigger the transmission of the buffer that has just been inserted. For performance reasons, the NL2 will group buffers in bursts when it can, call RtndSubmitTxBuffer in a row for each buffer of the burst, and then call RtndApplyTxBuffers at the end of the burst. Therefore, to achieve the best performance, the driver should NOT write to the hardware register that triggers the transmission until RtndApplyTxBuffers is called. Alternatively, the driver can also trigger the transmission in RtndSubmitTxBuffer and leave RtndApplyTxBuffers empty.
Characteristics
Real-time requirements | ||
Deterministic behavior |
Recommended |
|
Local memory allocation/deallocation restrictions | ||
Process |
External MSpace |
Internal MSpace |
System |
Not allowed |
Not allowed |
Process |
Not allowed |
Not allowed |
Contiguous memory allocation/deallocation restrictions | ||
Contiguous memory |
Not allowed |
Requirements
Minimum supported version | Header |
---|---|
eRTOS 1.0 SDK |
Rtnd.h |
See Also: