Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / usb_pipe_get_state.9f
bloba236d6649e37d73eeb354474d2bd6300216aae9e
1 '\" te
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_GET_STATE 9F "Sep 16, 2016"
7 .SH NAME
8 usb_pipe_get_state \- Return USB pipe state
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/usb/usba.h>
16 \fBint\fR \fBusb_pipe_get_state\fR(\fBusb_pipe_handle_t\fR \fIpipe_handle\fR,
17      \fBusb_pipe_state_t *\fR\fIpipe_state\fR, \fBusb_flags_t\fR \fIusb_flags\fR);
18 .fi
20 .SH INTERFACE LEVEL
21 .LP
22 Solaris DDI specific (Solaris DDI)
23 .SH PARAMETERS
24 .ne 2
25 .na
26 \fB\fIpipe_handle\fR\fR
27 .ad
28 .RS 15n
29 Handle of the pipe to retrieve the state.
30 .RE
32 .sp
33 .ne 2
34 .na
35 \fB\fIpipe_state\fR\fR
36 .ad
37 .RS 15n
38 Pointer to where pipe state is returned.
39 .RE
41 .sp
42 .ne 2
43 .na
44 \fB\fIusb_flags\fR\fR
45 .ad
46 .RS 15n
47 No flags are recognized. Reserved for future expansion.
48 .RE
50 .SH DESCRIPTION
51 .LP
52 The \fBusb_pipe_get_state()\fR function retrieves the state of the pipe
53 referred to by \fIpipe_handle\fR into the location pointed to by
54 \fIpipe_state\fR.
55 .sp
56 .LP
57 Possible pipe states are:
58 .sp
59 .ne 2
60 .na
61 \fBUSB_PIPE_STATE_CLOSED\fR
62 .ad
63 .RS 26n
64 Pipe is closed.
65 .RE
67 .sp
68 .ne 2
69 .na
70 \fBUSB_PIPE_STATE_ACTIVE\fR
71 .ad
72 .RS 26n
73 Pipe is active and can send/receive data. Polling is active for isochronous and
74 interrupt pipes.
75 .RE
77 .sp
78 .ne 2
79 .na
80 \fBUSB_PIPE_STATE_IDLE\fR
81 .ad
82 .RS 26n
83 Polling is stopped for isochronous and interrupt-IN pipes.
84 .RE
86 .sp
87 .ne 2
88 .na
89 \fBUSB_PIPE_STATE_ERROR\fR
90 .ad
91 .RS 26n
92 An error occurred. Client must call \fBusb_pipe_reset()\fR. Note that this
93 status is not seen by a client driver if USB_ATTRS_AUTOCLEARING is set in the
94 request attributes.
95 .RE
97 .sp
98 .ne 2
99 .na
100 \fBUSB_PIPE_STATE_CLOSING\fR
102 .RS 26n
103 Pipe is being closed. Requests are being drained from the pipe and other
104 cleanup is in progress.
107 .SH RETURN VALUES
108 .ne 2
110 \fBUSB_SUCCESS\fR
112 .RS 20n
113 Pipe state returned in second argument.
117 .ne 2
119 \fBUSB_INVALID_ARGS\fR
121 .RS 20n
122 Pipe_state argument is \fBNULL\fR.
126 .ne 2
128 \fBUSB_INVALID_PIPE\fR
130 .RS 20n
131 Pipe_handle argument is \fBNULL\fR.
134 .SH CONTEXT
136 May be called from user, kernel or interrupt context.
137 .SH EXAMPLES
138 .in +2
140     usb_pipe_handle_t pipe;
141     usb_pipe_state_t state;
143     /* Recover if the pipe is in an error state. */
144     if ((usb_pipe_get_state(pipe, &state, 0) == USB_SUCCESS) &&
145         (state == USB_PIPE_STATE_ERROR)) {
146             cmn_err (CE_WARN, "%s%d: USB Pipe error.",
147                 ddi_driver_name(dip), ddi_get_instance(dip));
148             do_recovery();
149     }
152 .in -2
154 .SH ATTRIBUTES
156 See \fBattributes\fR(5) for descriptions of the following attributes:
161 box;
162 c | c
163 l | l .
164 ATTRIBUTE TYPE  ATTRIBUTE VALUE
166 Architecture    PCI-based systems
168 Interface stability     Committed
171 .SH SEE ALSO
173 \fBattributes\fR(5), \fBusb_clr_feature\fR(9F), \fBusb_get_cfg\fR(9F),
174 \fBusb_get_status\fR(9F), \fBusb_pipe_close\fR(9F),
175 \fBusb_pipe_ctrl_xfer\fR(9F), \fBusb_pipe_xopen\fR(9F),
176 \fBusb_pipe_reset\fR(9F)