Rtnl2ReleasePhysicalRxQueue

Rtnl2ReleasePhysicalRxQueue releases a Physical Receive Queue object previously acquired by Rtnl2AcquirePhysicalRxQueue.

Syntax

Copy
BOOL Rtnl2ReleasePhysicalRxQueue(
  [in]    RTNL2_HPHYSICAL_RX_QUEUE PhysicalRxQueue, 
  [out]   RTNL2_BUFFER_HEADER **pExtracted, 
  [out]   ULONG *pNbExtracted
);

Parameters

[in] PhysicalRxQueue

A handle to the Physical Receive Queue object to release. The handle can be obtained from Rtnl2AcquirePhysicalRxQueue.

[out] pExtracted

The address of the first buffer header of a buffer list extracted from the queue. If the queue is empty, it returns NULL.

[out] pNbExtracted

The number of buffers in the returned ppExtracted list.

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

RTNL2_ERROR_PHYSICAL_RX_QUEUE_IS_RELEASING

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

RTNL2_ERROR_PHYSICAL_RX_QUEUE_EVENT_EXISTS

A Receive event associated with the Physical Receive Queue handle exists. The Receive event must be closed by Rtnl2DestroyPhysicalRxQueueEvent before the Physical Receive Queue can be released.

RTNL2_ERROR_PHYSICAL_RX_QUEUE_OWNED_BUFFERS_EXIST

Some of the NL2 Buffers associated with the Physical Receive Queue are still owned by the user application. These buffers must be returned to the NL2 by Rtnl2SubmitToPhysicalRxQueue before the Physical Receive Queue can be released.

RTNL2_ERROR_PHYSICAL_RX_QUEUE_IN_USE

Another thread of the calling process is executing Rtnl2SubmitToPhysicalRxQueue, Rtnl2ExtractFromPhysicalRxQueue, Rtnl2CreatePhysicalRxQueueEvent, or Rtnl2DestroyPhysicalRxQueueEvent at the same time.

RTNL2_ERROR_SERIALIZED_COMMAND_TIMEOUT

The NL2 process didn’t reply within an acceptable amount of 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.

Remarks

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

NL2 Buffers associated with this Physical Receive Queue and owned by the application are not automatically returned to the NL2. The application must call Rtnl2SubmitToPhysicalTxQueue to return them before calling Rtnl2ReleasePhysicalRxQueue to release the Physical Receive Queue.

Characteristics

Real-time

Deterministic

No

Local memory usage

Process

External MSpace usage

Internal MSpace usage

System

No

Yes. This function may free the memory allocated for the kernel objects in Rtnl2AcquirePhysicalRxQueue, 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 Rtnl2AcquirePhysicalRxQueue, 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: