2 .\" Copyright (c) 2004, 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 USB_PIPE_SET_PRIVATE 9F "Sep 16, 2016"
8 usb_pipe_set_private, usb_pipe_get_private \- USB user-defined pipe data-field
13 #include <sys/usb/usba.h>
15 \fBint \fR\fBusb_pipe_set_private\fR(\fBusb_pipe_handle_t\fR \fIpipe_handle\fR, \fBusb_opaque_t\fR \fIdata\fR);
20 \fB\fR\fBusb_opaque_t usb_pipe_get_private \fR(\fBusb_pipe_handle_t\fR \fIpipe_handle\fR);
25 Solaris DDI specific (Solaris DDI)
28 For \fBusb_pipe_set_private()\fR:
32 \fB\fIpipe_handle\fR\fR
35 Pipe handle into which user-defined data is placed.
44 Data to store in the pipe handle.
49 For \fBusb_pipe_get_private()\fR:
53 \fB\fIpipe_handle\fR\fR
56 Pipe handle from which user-defined data is retrieved.
61 The \fBusb_set_driver_private()\fR function initializes the user-private data
62 field of the pipe referred to by \fIpipe_handle\fR, using \fIdata\fR. The
63 user-private data field is used to store any data the client desires and is
64 not used in any way by the USBA or OS framework. Client drivers often store
65 their soft-state here for convenient retrieval by their callback handlers.
68 The \fBusb_get_driver_private()\fR function retrieves the user-private data
69 stored via \fBusb_set_driver_private()\fR, from the pipe referred to by
73 For \fBusb_pipe_set_private()\fR:
80 Private data has been successfully stored in pipe handle.
86 \fBUSB_INVALID_PIPE\fR
89 \fIpipe_handle\fR argument is \fBNULL\fR or invalid.
91 Pipe is closing or closed.
97 \fBUSB_INVALID_PERM\fR
100 The \fIpipe_handle\fR argument refers to the default control pipe.
105 For \fBusb_pipe_get_private()\fR:
108 On success: usb_opaque_t pointer to data being retrieved.
111 On failure: \fBNULL\fR. Fails if pipe handle is \fBNULL\fR or invalid. Fails if
112 pipe handle is to a pipe which is closing or closed.
115 May be called from user, kernel or interrupt context.
119 usb_pipe_handle_t pipe;
121 /* Some driver defined datatype. */
122 xxx_data_t *data = kmem_zalloc(...);
124 usb_pipe_set_private(pipe, data);
128 xxx_data_t *xxx_data_ptr = (xxx_data_t *)usb_pipe_get_private(pipe);
135 See \fBattributes\fR(5) for descriptions of the following attributes:
143 ATTRIBUTE TYPE ATTRIBUTE VALUE
145 Architecture PCI-based systems
147 Interface stability Committed
152 \fBattributes\fR(5), \fBusb_pipe_xopen\fR(9F), \fBusb_alloc_request\fR(9F)