RtndAttachTxQueue

RtndAttachTxQueue attaches the specified Transmit Queue to the current application process.

Syntax

Copy
BOOL RtndAttachTxQueue(
  [in]    ULONG_PTR RtndInterfaceId,
  [in]    ULONG TxQueueIndex,
  [out]   VOID **ppTxQueueAppContext
);

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.

[out] ppTxQueueAppContext

The address of a context structure allocated by the driver for the calling process.

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.

Note: Custom drivers may return other error codes not listed above.

Remarks

This function may be called from any process.

This function allows the driver to allocate resources specifically needed for the calling process before it calls RtndSubmitTxBuffer, RtndApplyTxBuffers, and RtndExtractTxBuffer for the Transmit Queue. If there is no specific requirement, the driver should set ppTxQueueAppContext to NULL and return. Otherwise, it should allocate memory for a context structure, open all needed handles to kernel objects, store the handle values in the context, and set ppTxQueueAppContext to the address of that context.

In all subsequent calls to RtndSubmitTxBuffer, RtndApplyTxBuffers, and RtndExtractTxBuffer, the NL2 will supply as a parameter the address of the context that was allocated by the driver here, for the specific calling process.

The driver must NOT access a register of the NIC in this function, and must make sure that if the calling process is terminated, all the resources allocated here are released by the kernel as if the calling process had called RtndDetachTxQueue. This is the case for all memory allocated with RtAllocateLocalMemory and all open handles to kernel objects – mutexes, events, etc.

Characteristics

Real-time requirements

Deterministic behavior

Not required

Local memory allocation/deallocation restrictions

Process

External MSpace

Internal MSpace

System

Not allowed

Allowed

Process

Allowed

Allowed

Contiguous memory allocation/deallocation restrictions

Contiguous memory

Not allowed

Requirements

Minimum supported version Header

eRTOS 1.0 SDK

Rtnd.h

See Also: