Bewerken

Delen via


Queue States and Operations

For each queue, a network adapter must support the following set of operational states:

Undefined
The queue is not allocated. To allocate a queue, an overlying driver sends an OID_RECEIVE_FILTER_ALLOCATE_QUEUE OID request.

Allocated
The Allocated state is the initial state for a queue. When a queue is in the Allocated state, the overlying driver usually sets filters on the queue with the OID_RECEIVE_FILTER_SET_FILTER OID or completes the queue allocation with the OID_RECEIVE_FILTER_QUEUE_ALLOCATION_COMPLETE OID request.

Set
In the Set state, a queue has at least one filter allocated but the overlying driver has not sent the OID_RECEIVE_FILTER_QUEUE_ALLOCATION_COMPLETE OID.

Running
In the Running state, the queue has filters set, the queue allocation is complete and the miniport adapter is indicating receive packets for the queue.

Paused
In the Paused state, the network adapter does not indicate received network data for the queue. Either there were no filters set on the queue before the OID_RECEIVE_FILTER_QUEUE_ALLOCATION_COMPLETE OID request or all of the filters that were set on the queue were cleared with the OID_RECEIVE_FILTER_CLEAR_FILTER OID request.

DMA Stopped
In the DMA Stopped state, a miniport driver received an OID_RECEIVE_FILTER_FREE_QUEUE OID request. When the DMA is stopped and the driver has issued the DMA-stopped status indication (with NDIS_STATUS_RECEIVE_QUEUE_STATE), the driver enters the Freeing state.

Freeing
In the Freeing state, a miniport driver completes the operations that are required to stop send and receive operations for the queue, and releases the associated resources. After all of the outstanding receive indications are complete, the queue is deleted and the queue is Undefined.

In the following table, the headings are the queue states. Major events are listed in the first column. The rest of the entries in the table specify the next state that the queue enters after an event occurs within a state. The blank entries represent invalid event/state combinations.

Event \ State Undefined Allocated Set Running Paused Stop DMA Freeing

OID_RECEIVE_FILTER_ALLOCATE_QUEUE - method (set)

Allocated

OID_RECEIVE_FILTER_QUEUE_PARAMETERS - method (query) request

Allocated

Set

Running

Paused

OID_RECEIVE_FILTER_QUEUE_PARAMETERS - set request

Allocated

Set

Running

Paused

OID_RECEIVE_FILTER_SET_FILTER - method (set) request

Set

Set

Running

Running

OID_RECEIVE_FILTER_CLEAR_FILTER - set request (last filter)

Allocated

Paused

OID_RECEIVE_FILTER_CLEAR_FILTER - set request (not last filter)

Set

Running

OID_RECEIVE_FILTER_ENUM_FILTERS - method (query request)

Allocated

Set

Running

Paused

OID_RECEIVE_FILTER_PARAMETERS - method (query) request

Set

Running

OID_RECEIVE_FILTER_QUEUE_ALLOCATION_COMPLETE - method (set) request

Paused

Running

Receive packet

Running

OID_RECEIVE_FILTER_FREE_QUEUE set request

Stop DMA

Stop DMA

DMA is stopped and NDIS_STATUS_RECEIVE_QUEUE_STATE status indication was sent (Note: DMA was probably already stopped in Allocated or Paused state)

Freeing

All receive indications are complete and the queue resources are freed

Undefined

Note  The events listed in the preceding table include some secondary events that do not result in a state change. These secondary events are included in the table to specify the states where these events are valid.

The primary queue events are defined as follows:

OID_RECEIVE_FILTER_ALLOCATE_QUEUE - method (set) request
An overlying driver allocated a queue. For more information about allocating queues, see Allocating and Freeing VM Queues.

OID_RECEIVE_FILTER_SET_FILTER - method (set) request
An overlying driver set a filter on a queue. If the overlying driver has not sent the OID_RECEIVE_FILTER_QUEUE_ALLOCATION_COMPLETE OID, the queue is in the Set state. Otherwise, the queue is in the Running state. For more information about setting filters on queues, see Setting and Clearing VMQ Filters.

OID_RECEIVE_FILTER_CLEAR_FILTER - set request
An overlying driver cleared a filter on a queue. If the last filter was cleared on a running queue, the DMA can be stopped; receive indications are stopped and the queue should be cleared of received data, if any. For more information about clearing filters on queues, see Setting and Clearing VMQ Filters.

OID_RECEIVE_FILTER_QUEUE_ALLOCATION_COMPLETE - method (set) request
An overlying driver completed the queue allocation. If there are filters set on the queue, it is in the Running state and receive indications can start. For more information about completing queue allocation, see Allocating and Freeing VM Queues.

Receive packet
A miniport driver can only indicate receive packets for a queue that is in the Running state. For more information about indicating received data for queues, see VMQ Send and Receive Operations.

OID_RECEIVE_FILTER_FREE_QUEUE set request.
An overlying driver freed a queue. The driver issues the DMA-stopped status indication (with NDIS_STATUS_RECEIVE_QUEUE_STATE), the driver enters the Freeing state. When all of the outstanding receive indications are complete and the queue resources are freed, the queue is undefined.