ADC Home > Reference Library > Reference > Darwin > Kernel Framework Reference

 


IOGatedOutputQueue

Inherits from:
Declared In:

Overview

An extension of an IOBasicOutputQueue.

Discussion

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.



Functions

free

Frees the IOGatedOutputQueue object.

init

Initializes an IOGatedOutputQueue object.

output

Transfers all packets in the mbuf queue to the target.

scheduleServiceThread

Overrides the method inherited from IOOutputQueue.

withTarget(IONetworkController *, IOWorkLoop *, UInt32)

Factory method that constructs and initializes an IOGatedOutputQueue object.

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

Factory method that constructs and initializes an IOGatedOutputQueue object.


free


Frees the IOGatedOutputQueue object.

protected

virtual void free();
Discussion

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


init


Initializes an IOGatedOutputQueue object.

public

virtual bool init( OSObject *target, IOOutputAction action, IOWorkLoop *workloop, UInt32 capacity = 0);
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


Transfers all packets in the mbuf queue to the target.

protected

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.


scheduleServiceThread


Overrides the method inherited from IOOutputQueue.

protected

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.

public

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(OSObject *, IOOutputAction, IOWorkLoop *, UInt32)


Factory method that constructs and initializes an IOGatedOutputQueue object.

public

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.


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.

 

Last Updated: 2008-12-19