1OTHERQ(9F)               Kernel Functions for Drivers               OTHERQ(9F)
2
3
4

NAME

6       OTHERQ, otherq - get pointer to queue's partner queue
7

SYNOPSIS

9       #include <sys/stream.h>
10       #include <sys/ddi.h>
11
12
13
14       queue_t *OTHERQ(queue_t *q);
15
16

INTERFACE LEVEL

18       Architecture independent level 1 (DDI/DKI).
19

PARAMETERS

21       q    Pointer to the queue.
22
23

DESCRIPTION

25       The  OTHERQ()  function returns a pointer to the other of the two queue
26       structures that make up a STREAMS module or driver. If q points to  the
27       read queue the write queue will be returned, and vice versa.
28

RETURN VALUES

30       The OTHERQ() function returns a pointer to a queue's partner.
31

CONTEXT

33       The  OTHERQ()  function  can  be called from user, interrupt, or kernel
34       context.
35

EXAMPLES

37       Example 1 Setting Queues
38
39
40       This routine sets the minimum packet size, the maximum packet size, the
41       high  water  mark, and the low water mark for the read and write queues
42       of a given module or driver. It is passed either  one  of  the  queues.
43       This  could  be  used  if a module or driver wished to update its queue
44       parameters dynamically.
45
46
47          1  void
48          2  set_q_params(q, min, max, hi, lo)
49          3      queue_t *q;
50          4      short min;
51          5      short max;
52          6      ushort_t hi;
53          7      ushort_t lo;
54          8  {
55          9           q->q_minpsz = min;
56         10           q->q_maxpsz = max;
57         11           q->q_hiwat = hi;
58         12             q->q_lowat = lo;
59         13           OTHERQ(q)->q_minpsz = min;
60         14           OTHERQ(q)->q_maxpsz = max;
61         15           OTHERQ(q)->q_hiwat = hi;
62         16           OTHERQ(q)->q_lowat = lo;
63         17  }
64
65

SEE ALSO

67       Writing Device Drivers
68
69
70       STREAMS Programming Guide
71
72
73
74SunOS 5.11                        16 Jan 2006                       OTHERQ(9F)
Impressum