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"
8 usb_pipe_get_state \- Return USB pipe state
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);
22 Solaris DDI specific (Solaris DDI)
26 \fB\fIpipe_handle\fR\fR
29 Handle of the pipe to retrieve the state.
35 \fB\fIpipe_state\fR\fR
38 Pointer to where pipe state is returned.
47 No flags are recognized. Reserved for future expansion.
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
57 Possible pipe states are:
61 \fBUSB_PIPE_STATE_CLOSED\fR
70 \fBUSB_PIPE_STATE_ACTIVE\fR
73 Pipe is active and can send/receive data. Polling is active for isochronous and
80 \fBUSB_PIPE_STATE_IDLE\fR
83 Polling is stopped for isochronous and interrupt-IN pipes.
89 \fBUSB_PIPE_STATE_ERROR\fR
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
100 \fBUSB_PIPE_STATE_CLOSING\fR
103 Pipe is being closed. Requests are being drained from the pipe and other
104 cleanup is in progress.
113 Pipe state returned in second argument.
119 \fBUSB_INVALID_ARGS\fR
122 Pipe_state argument is \fBNULL\fR.
128 \fBUSB_INVALID_PIPE\fR
131 Pipe_handle argument is \fBNULL\fR.
136 May be called from user, kernel or interrupt context.
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));
156 See \fBattributes\fR(5) for descriptions of the following attributes:
164 ATTRIBUTE TYPE ATTRIBUTE VALUE
166 Architecture PCI-based systems
168 Interface stability Committed
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). \fBusb_pipe_reset\fR(9F)