ADC Home > Reference Library > Reference > Darwin > Kernel Framework Reference
|
IOOutputQueue |
Inherits from: | |
Declared In: |
A packet queue that supports multiple producers and a single consumer.
Each producer, or a client thread, will deliver a chain of packets to the queue. A single consumer will remove packets from the queue one at a time and forward it to the registered target/action. This object may be used by an IONetworkController on the output (transmit) side to handle the output packet flow downstream from an IONetworkInterface, and then call the driver's output function. IOOutputQueue is an abstract class that provides an interface for its subclasses. Concrete subclasses will complete the implementation, and specify the context that the target is called for packets removed from the queue.
Cancels any pending service thread callout.
Adds a packet, or a chain of packets, to the queue.
Drops and frees all packets currently held by the queue.
Frees the IOOutputQueue object.
Gets the number of packets that the queue can hold.
Returns the address of a function that is designated to handle incoming packets sent to the queue object.
Gets the number of packets currently held in the queue.
Returns an IONetworkData object containing statistics counters updated by the queue.
Initializes an IOOutputQueue object.
Schedules a service thread callout.
Services the queue.
Method called by the scheduled service thread when it starts to run.
Changes the number of packets that the queue can hold before it begins to drop excess packets.
Starts up the queue.
Stops the queue.
cancelServiceThread |
Cancels any pending service thread callout.
protected
virtual bool cancelServiceThread();
Returns true if a previously scheduled thread callout was canceled, false otherwise.
enqueue |
Adds a packet, or a chain of packets, to the queue.
public
virtual UInt32 enqueue( mbuf_t m, void *param) = 0;
m
A single packet, or a chain of packets.
param
A parameter provided by the caller.
Returns a return code.
This method is called by a client to add a packet, or a chain of packets, to the queue. A packet is described by an mbuf chain, while a chain of packets is constructed by linking multiple mbuf chains via the m_nextpkt field.
flush |
Drops and frees all packets currently held by the queue.
public
virtual UInt32 flush() = 0;
Returns the number of packets that were dropped and freed.
free |
Frees the IOOutputQueue object.
protected
virtual void free();
Release allocated resources, then call super::free().
getCapacity |
Gets the number of packets that the queue can hold.
public
virtual UInt32 getCapacity() const = 0;
Returns the current queue capacity.
The queue will begin to drop incoming packets when the size of queue reaches its capacity.
getOutputHandler |
Returns the address of a function that is designated to handle incoming packets sent to the queue object.
public
virtual IOOutputAction getOutputHandler() const;
Returns the address of the enqueue() method.
getSize |
Gets the number of packets currently held in the queue.
public
virtual UInt32 getSize() const = 0;
Returns the size of the queue.
getStatisticsData |
Returns an IONetworkData object containing statistics counters updated by the queue.
public
virtual IONetworkData * getStatisticsData() const;
Returns an IONetworkData object. This implementation will always return 0.
init |
Initializes an IOOutputQueue object.
protected
virtual bool init();
Returns true if initialized successfully, false otherwise.
scheduleServiceThread |
Schedules a service thread callout.
protected
virtual bool scheduleServiceThread( void *param);
param
A parameter to pass to the serviceThread() method.
Returns true if a thread callout was scheduled, false otherwise.
This method can be called by service() to schedule a thread that will call serviceThread() when it starts running.
service |
Services the queue.
public
virtual bool service( IOOptionBits options = 0) = 0;
options
Options for the service request.
Returns a return value to indicate the service result.
Manage the queue after it has been started.
serviceThread |
Method called by the scheduled service thread when it starts to run.
protected
virtual void serviceThread( void *param);
param
A parameter that was given to scheduleServiceThread() when the service thread was scheduled.
Must be implemented by a subclass that calls scheduleServiceThread(). The default implementation does nothing.
setCapacity |
Changes the number of packets that the queue can hold before it begins to drop excess packets.
public
virtual bool setCapacity( UInt32 capacity) = 0;
capacity
The new desired capacity.
Returns true if the new capacity was accepted, false otherwise.
start |
Starts up the queue.
public
virtual bool start() = 0;
Returns true if the queue was started successfully, false otherwise.
This method is called by the target to start the queue. This will allow packets to be removed from the queue, then delivered to the target.
stop |
Stops the queue.
public
virtual bool stop() = 0;
Returns the previous running state of the queue, true if the queue was running, false if the queue was already stopped.
Stop the queue and prevent it from sending packets to its target.
_reserved |
protected
ExpansionData *_reserved;
Reserved for future use. (Internal use only)
reserved |
protected
ExpansionData *_reserved;
Reserved for future use. (Internal use only)
|
Last Updated: 2008-12-19