Rtnl2DestroyLogicalTxQueue

Rtnl2DestroyLogicalTxQueue destroys a Logical Transmit Queue object created by Rtnl2CreateLogicalTxQueue.

Syntax

Copy
BOOL Rtnl2DestroyLogicalTxQueue(
  [in]    RTNL2_HLOGICAL_TX_QUEUE LogicalTxQueue
);

Parameters

[in] LogicalTxQueue

A handle to the Logical Transmit Queue object to destroy.

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 interface handle is invalid.

RTNL2_ERROR_LOGICAL_TX_QUEUE_IN_USE

Another thread of the calling process is executing Rtnl2TransmitOverLogicalTxQueue at the same time.

RTNL2_ERROR_LOGICAL_TX_QUEUE_IS_DESTROYING Another thread of the calling process is executing Rtnl2DestroyLogicalTxQueue at the same time.

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_SERIALIZED_COMMAND_TIMEOUT

The NL2 process didn’t reply within an acceptable delay.

Remarks

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

Only the process that created a Logical Transmit Queue is allowed to destroy it.

This function will fail if called while another thread of the process is currently executing the Rtnl2TransmitOverLogicalTxQueue function.

This function is a non-blocking operation. It marks the Logical Transmit Queue as invalid and starts the process of destroying it in background. This can take time, as one or more buffers might already be submitted to the hardware queue, and the NL2 needs to wait until they are flushed. During that time, the underlying Physical Transmit Queue is busy and cannot be acquired by the Rtnl2AcquirePhysicalTxQueue function.

Characteristics

Real-time

Deterministic

No

Local memory usage

Process

External MSpace usage

Internal MSpace usage

System

No

Yes. This function will potentially free the memory that was allocated for the kernel objects in Rtnl2CreateLogicalTxQueue.

NL2 process

Yes. This function will free the memory that was allocated for the local buffers and the Logical Tx Queue structure in Rtnl2CreateLogicalTxQueue. Also, it may free the memory that was allocated for the driver state structure in Rtnl2CreateLogicalTxQueue, depending on the underlying driver.

No

Calling process

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

No

Contiguous memory usage

Usage

No

Requirements

Minimum supported version Header Library

eRTOS 1.0 SDK

Rtnl2Api.h

Rtnl2Api.lib

See Also: