Rtnl2ReleasePhysicalTxQueue

Rtnl2ReleasePhysicalTxQueue releases a Physical Transmit Queue object previously acquired by Rtnl2AcquirePhysicalTxQueue.

Syntax

Copy
BOOL Rtnl2ReleasePhysicalTxQueue(
  [in]    RTNL2_HPHYSICAL_TX_QUEUE PhysicalTxQueue,
);

Parameters

[in] PhysicalTxQueue

A handle to the Physical Transmit Queue object to release. The handle can be obtained from Rtnl2AcquirePhysicalTxQueue.

Return Value

If the function succeeds, it returns TRUE. If the function fails, it returns FALSE. Call GetLastError to obtain an error code.

Possible error codes:

Error code Meaning

ERROR_NOT_READY

The calling process has not called Rtnl2Init.

ERROR_INVALID_PARAMETER

The supplied Physical Transmit Queue handle is invalid.

RTNL2_ERROR_NO_MORE_COMMUNICATION

Unable to communicate with the NL2 process. This might be because the NL2 process is not running anymore, or because an application process thread was terminated during a previous call to an NL2 API function.

RTNL2_ERROR_PHYSICAL_TX_QUEUE_EVENT_EXISTS

A Transmit Event is associated with the Physical Transmit Queue handle. The Transmit Event must be closed by Rtnl2DestroyPhysicalTxQueueEvent before the Physical Transmit Queue can be released.

RTNL2_ERROR_PHYSICAL_TX_QUEUE_IN_USE

Another thread of the calling process is also executing one of these functions:

RTNL2_ERROR_PHYSICAL_TX_QUEUE_IS_RELEASING

Another thread of the calling process is also executing Rtnl2ReleasePhysicalTxQueue.

RTNL2_ERROR_PHYSICAL_TX_QUEUE_OWNED_BUFFERS_EXIST

Some of the NL2 Buffers for this Physical Transmit Queue are still owned by the user application. These buffers must be returned by Rtnl2ReturnPhysicalTxQueueBuffers before the Physical Transmit Queue can be released.

RTNL2_ERROR_SERIALIZED_COMMAND_TIMEOUT

The NL2 process didn’t reply within an acceptable amount of time.

Remarks

After a successful call to this function, the supplied Physical Transmit Queue handle is no longer valid and can't be used as a parameter of other API functions.

NL2 Buffers associated with this Physical Transmit Queue and owned by the application are not automatically freed by the NL2. The application must call Rtnl2ReturnPhysicalTxQueueBuffers to free them before calling Rtnl2ReleasePhysicalTxQueue to release the Physical Transmit Queue.

Characteristics

Real-time

Deterministic

No

Local memory usage

Process

External MSpace usage

Internal MSpace usage

System

No

Yes. This function will free the memory for the Egress Timestamp Event kernel object if Rtnl2EnablePhysicalTxQueueTimestamping was successfully called. Also, this function may free the memory allocated for the kernel objects in Rtnl2AcquirePhysicalTxQueue, depending on the underlying driver.

NL2 process

No

No

Calling process

Yes. This function may free the memory allocated for the application-specific state structure in Rtnl2AcquirePhysicalTxQueue, depending on the underlying driver.

No

Contiguous memory usage

Usage

Yes. Calling this API function may request to free contiguous memory in the context of the NL2 process, depending on the underlying driver. Such requests may occur during execution of the API function or asynchronously by the NL2 process as buffers are consumed by the NIC.

Requirements

Minimum supported version Header Library

eRTOS 1.0 SDK

Rtnl2Api.h

Rtnl2Api.lib

See Also: