Mac Developer Library

Developer

IOGatedOutputQueue Class Reference

Options
Deployment Target:

On This Page

IOGatedOutputQueue

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.

  • Frees the IOGatedOutputQueue object.

    Declaration

    virtual void free();

    Discussion

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

  • Initializes an IOGatedOutputQueue object.

    Declaration

    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.

  • Transfers all packets in the mbuf queue to the target.

    Declaration

    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.

  • Overrides the method inherited from IOOutputQueue.

    Declaration

    virtual bool scheduleServiceThread( void *param);

    Return Value

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

  • Overrides the method inherited from IOOutputQueue.

    Declaration

    virtual bool scheduleServiceThread( void *param);

    Return Value

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

  • Factory method that constructs and initializes an IOGatedOutputQueue object.

    Declaration

    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.

  • Factory method that constructs and initializes an IOGatedOutputQueue object.

    Declaration

    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.

  • Factory method that constructs and initializes an IOGatedOutputQueue object.

    Declaration

    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.

  • Factory method that constructs and initializes an IOGatedOutputQueue object.

    Declaration

    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.