IOGatedOutputQueue

Inherits from
IOBasicOutputQueue
Availability
Available in OS X v10.0 and later.
Declared in
IOGatedOutputQueue.h

Overview

An extension of an IOBasicOutputQueue.

An IOCommandGate object is created by this queue and added to a work loop as an event source. All calls to the target by the consumer thread must occur with the gate closed. Therefore, all calls to the target of this type of queue will be serialized with any other thread that runs on the same work loop context. This is useful for network drivers that have a tight hardware coupling between the transmit and receive engines, and a single-threaded hardware access model is desirable.

Tasks

Miscellaneous

Instance Methods

free

Frees the IOGatedOutputQueue object.

virtual void free();
Discussion

Release allocated resources, then call super::free().

init

Initializes an IOGatedOutputQueue object.

virtual bool init( OSObject *target, IOOutputAction action, IOWorkLoop *workloop, UInt32 capacity = 0, UInt32 priorities = 1);
Parameters
target

The object that will handle packets removed from the queue, and is usually a subclass of IONetworkController.

action

The function that will handle packets removed from the queue.

workloop

A workloop object. An IOCommandGate object is created and added to this workloop as an event source.

capacity

The initial capacity of the output queue.

Return Value

Returns true if initialized successfully, false otherwise.

output(IOMbufQueue *, UInt32 *)

Transfers all packets in the mbuf queue to the target.

virtual void output( IOMbufQueue *queue, UInt32 *state);
Parameters
queue

A queue of output packets.

state

Return a state bit defined by IOBasicOutputQueue that declares the new state of the queue following this method call. A kStateStalled is returned if the queue should stall, otherwise 0 is returned.

output(void *)

Overrides the method inherited from IOOutputQueue.

virtual bool scheduleServiceThread( void *param);
Return Value

Returns true if a thread was successfully scheduled to service the queue.

scheduleServiceThread

Overrides the method inherited from IOOutputQueue.

virtual bool scheduleServiceThread( void *param);
Return Value

Returns true if a thread was successfully scheduled to service the queue.

withTarget(IONetworkController *, IOWorkLoop *, UInt32)

Factory method that constructs and initializes an IOGatedOutputQueue object.

static IOGatedOutputQueue * withTarget( IONetworkController *target, IOWorkLoop *workloop, UInt32 capacity = 0);
Parameters
target

An IONetworkController object that will handle packets removed from the queue.

workloop

A workloop object. An IOCommandGate object is created and added to this workloop as an event source.

capacity

The initial capacity of the output queue.

Return Value

Returns an IOGatedOutputQueue object on success, or 0 otherwise.

withTarget(IONetworkController *, IOWorkLoop *, UInt32, UInt32)

Factory method that constructs and initializes an IOGatedOutputQueue object.

static IOGatedOutputQueue * withTarget( IONetworkController *target, IOWorkLoop *workloop, UInt32 capacity, UInt32 priorities);
Parameters
target

An IONetworkController object that will handle packets removed from the queue.

workloop

A workloop object. An IOCommandGate object is created and added to this workloop as an event source.

capacity

The initial capacity of the output queue.

priorities

The number of traffic priorities supported

Return Value

Returns an IOGatedOutputQueue object on success, or 0 otherwise.

withTarget(OSObject *, IOOutputAction, IOWorkLoop *, UInt32)

Factory method that constructs and initializes an IOGatedOutputQueue object.

static IOGatedOutputQueue * withTarget( OSObject *target, IOOutputAction action, IOWorkLoop *workloop, UInt32 capacity = 0);
Parameters
target

The object that will handle packets removed from the queue.

action

The function that will handle packets removed from the queue.

workloop

A workloop object. An IOCommandGate object is created and added to this workloop as an event source.

capacity

The initial capacity of the output queue.

Return Value

Returns an IOGatedOutputQueue object on success, or 0 otherwise.

withTarget(OSObject *, IOOutputAction, IOWorkLoop *, UInt32, UInt32)

Factory method that constructs and initializes an IOGatedOutputQueue object.

static IOGatedOutputQueue * withTarget( OSObject *target, IOOutputAction action, IOWorkLoop *workloop, UInt32 capacity, UInt32 priorities);
Parameters
target

The object that will handle packets removed from the queue.

action

The function that will handle packets removed from the queue.

workloop

A workloop object. An IOCommandGate object is created and added to this workloop as an event source.

capacity

The initial capacity of the output queue.

priorities

The number of traffic priorities supported

Return Value

Returns an IOGatedOutputQueue object on success, or 0 otherwise.