'\"! tbl | mmdoc '\"macro stdmacro .if n .pH ddi.rm/d4/gen/queue @(#)queue 43.8 of 11/18/92 .\" Copyright 1992, 1991 UNIX System Laboratories, Inc. .TH queue D4 .IX "\f4queue\fP(D4)" .SH NAME \f4queue\fP \- STREAMS queue structure .SH SYNOPSIS .nf .na .ft 4 #include #include #include .ft 1 .ad .fi .SH DESCRIPTION A instance of a STREAMS driver or module consists of two \f4queue\fP structures, one for upstream (read-side) processing and one for downstream (write-side) processing. .SH USAGE 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. .SS Structure Definitions The \f4queue\fP structure is defined as type \f4queue_t\fP and contains the following members: .P .TS lf4 2 lf4 2 lf4. 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 */ .TE The \f4q_qinfo\fP field contains a pointer to the \f4qinit\fP(D4) structure specifying the processing routines and default values for the queue. This field should not be changed by drivers or modules. .P The \f4q_first\fP field points to the first message on the queue, or is \f4NULL\fP if the queue is empty. This field should not be changed by drivers or modules. .P The \f4q_last\fP field points to the last message on the queue, or is \f4NULL\fP if the queue is empty. This field should not be changed by drivers or modules. .P The \f4q_next\fP field points to the next queue in the stream. This field should not be changed by drivers or modules. .P The \f4q_ptr\fP 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. .P The \f4q_count\fP field contains the number of bytes in messages on the queue in priority band 0. This includes normal messages and high priority messages. .P The \f4q_flag\fP 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: .RS 0 .IP \f4QREADR\fP 14n The queue is the read queue. Absence of this flag implies a write queue. .RE .P The \f4q_minpsz\fP 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 \f4mi_minpsz\fP field in the \f4module_info\fP(D4) structure. This field can be changed by drivers or modules. .P The \f4q_maxpsz\fP 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 \f4mi_maxpsz\fP field in the \f4module_info\fP structure. This field can be changed by drivers or modules. .P The \f4q_hiwat\fP 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 \f4mi_hiwat\fP field in the \f4module_info\fP structure. This field can be changed by drivers or modules. .P The \f4q_lowat\fP 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 \f4mi_lowat\fP field in the \f4module_info\fP structure. This field can be changed by drivers or modules. .SH REFERENCES .na \f4getq\fP(D3), \f4module_info\fP(D4), \f4msgb\fP(D4), \f4putq\fP(D3), \f4qinit\fP(D4), \f4strqget\fP(D3), \f4strqset\fP(D3) .ad