2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH QASSOCIATE 9F "Feb 01, 2007"
8 qassociate \- associate STREAMS queue with driver instance
12 #include <sys/types.h>
13 #include <sys/stream.h>
14 #include <sys/stropts.h>
16 #include <sys/sunddi.h>
18 \fBint\fR \fBqassociate\fR(\fBqueue_t *\fR\fIq\fR, \fBint\fR \fIinstance\fR
24 Solaris DDI specific (Solaris DDI).
29 \fBqueue_t *\fIq\fR\fR
32 Pointer to a \fBqueue\fR(9S) structure. Either the read or write queue can be
39 \fBint \fIinstance\fR\fR
42 Driver instance number or -1.
48 The \fBqassociate()\fR function must be used by \fBDLPI\fR style 2 device
49 drivers to manage the association between STREAMS queues and device instances.
50 The \fBgld\fR(7D) does this automatically on behalf of drivers based on it. It
51 is recommended that the \fBgld\fR(7D) be used for network device drivers
55 The \fBqassociate()\fR function associates the specified STREAMS queue with the
56 specified instance of the bottom driver in the queue. Upon successful return,
57 the stream is associated with the instance with any prior association
61 A DLPI style 2 driver calls \fBqassociate()\fR while processing the
62 \fBDL_ATTACH_REQ\fR message. The driver is also expected to call this interface
63 while performing stream associations through other means, such as \fBndd\fR(8)
67 If \fIinstance\fR is -1, the stream is left unassociated with any hardware
71 If the interface returns failure, the stream is not associated with the
72 specified instance. Any prior association is left untouched.
75 The interface typically fails because of failure to locate and attach the
76 device instance. The interface never fails if the specified instance is -1.
80 The \fBqassociate()\fR function can be called from the stream's \fBput\fR(9E)
104 DLPI style 2 network driver \fBDL_ATTACH_REQ\fR code specifies:
108 if (qassociate(q, instance) != 0)
115 The association prevents Dynamic Reconfiguration (DR) from detaching the
119 DLPI style 2 network driver \fBDL_DETACH\fR code specifies:
123 (void) qassociate(q, -1);
129 This dissolves the queue's association with any device instance.
132 DLPI style 2 network driver \fBopen\fR(9E) code must call:
142 This informs the framework that this driver has been modified to be
147 \fBdlpi\fR(7P), \fBgld\fR(7D), \fBopen\fR(9E), \fBput\fR(9E),
148 \fBddi_no_info\fR(9F), \fBqueue\fR(9S)