queue(D4DK) —
NAME
queue − STREAMS queue structure
SYNOPSIS
#include <sys/types.h>
#include <sys/stream.h>
DESCRIPTION
A instance of a STREAMS driver or module consists of two queue structures, one for upstream (read-side) processing and one for downstream (write-side) processing. This structure is the major building block of a stream. It contains pointers to the processing procedures, pointers to the next queue in the stream, flow control parameters, and a list of messages to be processed.
STRUCTURE MEMBERS
| struct qinit | ∗q_qinfo; | /∗ module or driver entry points ∗/ |
| struct msgb | ∗q_first; | /∗ first message in queue ∗/ |
| struct msgb | ∗q_last; | /∗ last message in queue ∗/ |
| struct queue | ∗q_next; | /∗ next queue in stream ∗/ |
| void | ∗q_ptr; | /∗ pointer to private data structure ∗/ |
| ulong_t | q_count; | /∗ approximate size of message queue ∗/ |
| ulong_t | q_flag; | /∗ status of queue ∗/ |
| long | q_minpsz; | /∗ smallest packet accepted by QUEUE ∗/ |
| long | q_maxpsz; | /∗ largest packet accepted by QUEUE ∗/ |
| ulong_t | q_hiwat; | /∗ high water mark ∗/ |
| ulong_t | q_lowat; | /∗ low water mark ∗/ |
The q_qinfo field contains a pointer to the qinit(D4DK) structure specifying the processing routines and default values for the queue. This field should not be changed by drivers or modules.
The q_first field points to the first message on the queue, or is NULL if the queue is empty. This field should not be changed by drivers or modules.
The q_last field points to the last message on the queue, or is NULL if the queue is empty. This field should not be changed by drivers or modules.
The q_next field points to the next queue in the stream. This field should not be changed by drivers or modules.
The q_ptr field is a private field for use by drivers and modules. It provides a way to associate the driver’s per-minor data structure with the queue.
The q_count field contains the number of bytes in messages on the queue in priority band 0. This includes normal messages and high priority messages.
The q_flag field contains a bitmask of flags that indicate different queue characteristics. No flags may be set or cleared by drivers or modules. However, the following flags may be tested:
QREADRThe queue is the read queue. Absence of this flag implies a write queue.
The q_minpsz field is the minimum packet size for the queue. This is an advisory limit specifying the smallest message that can be accepted by the queue. It is initially set to the value specified by the mi_minpsz field in the module_info(D4DK) structure. This field can be changed by drivers or modules.
The q_maxpsz field is the maximum packet size for the queue. This is an advisory limit specifying the largest message that can be accepted by the queue. It is initially set to the value specified by the mi_maxpsz field in the module_info structure. This field can be changed by drivers or modules.
The q_hiwat field is the high water mark for the queue. This specifies the number of bytes of data contained in messages on the queue such that the queue is considered full, and hence flow-controlled. It is initially set to the value specified by the mi_hiwat field in the module_info structure. This field can be changed by drivers or modules.
The q_lowat field is the low water mark for the queue. This specifies the number of bytes of data contained in messages on the queue such that the queue is no longer flow-controlled. It is initially set to the value specified by the mi_lowat field in the module_info structure. This field can be changed by drivers or modules.
NOTES
The queue structure is defined as type queue_t.
SEE ALSO
getq(D3DK), putq(D3DK), strqget(D3DK), strqset(D3DK), module_info(D4DK), msgb(D4DK), qinit(D4DK)
DDI/DKI — STREAMS