Architecture independent level 1 (DDI/DKI)
A STREAMS driver or module consists of two queue structures, one for upstream processing (read) and one for downstream processing (write). This structure is the major building block of a stream. It contains pointers to the processing procedures, pointers to the next and previous queues in the stream, flow control parameters, and a pointer defining the position of its messages on the STREAMS scheduler list.
The queue structure is defined as type queue_t.
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 */ struct queue*q_link; /* to next queue for scheduling*/ void *q_ptr; /* pointer to private data structure */ size_t q_count; /* approximate size of message queue */ uint_t q_flag; /* status of queue */ ssize_t q_minpsz; /* smallest packet accepted by QUEUE*/ ssize_t q_maxpsz; /*largest packet accepted by QUEUE */ size_t q_hiwat; /* high water mark */ size_t q_lowat; /* low water mark */
Queue is already enabled to run.
Someone wants to read queue.
Someone wants to write to queue.
Queue is considered full.
This is the reader (first) queue.
This queue is in use (allocation).
Do not enable queue by way of putq().