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_GET_STATUS 9F "Jan 5, 2004"
8 usb_get_status \- Get status of a USB device/endpoint/interface
12 #include <sys/usb/usba.h>
16 \fBint\fR \fBusb_get_status\fR(\fBdev_info_t *\fR\fIdip\fR, \fBusb_pipe_handle_t\fR \fIpipe_handle\fR,
17 \fBuint_t\fR \fIrequest_type\fR, \fBuint_t\fR \fIwhich\fR, \fBuint16_t *\fR\fIstatus\fR,
18 \fBusb_flags_t\fR \fIflags\fR);
24 Solaris DDI specific (Solaris DDI)
32 Pointer to device's dev_info structure.
38 \fB\fIpipe_handle\fR\fR
41 Default control pipe handle on which request is made.
47 \fB\fIrequest_type\fR\fR
50 bmRequestType. Either:
52 USB_DEV_REQ_RCPT_DEV \(em Get device status.
54 USB_DEV_REQ_RCPT_IF \(em Get interface status.
56 USB_DEV_REQ_RCPT_EP \(em Get endpoint status.
65 Device, interface or endpoint from which to get status. Either number of
66 interface or endpoint, or 0 if device status requested.
75 Address into which the status is written.
90 The \fBusb_get_status()\fR function returns the status of a device, interface
91 or endpoint. All status requests use the default control pipe. Length of data
92 returned is USB_GET_STATUS_LEN bytes. Always block and wait for resources if
93 not available, regardless of the flags argument.
96 When the \fIrequest_type\fR recipient is USB_DEV_REQ_RCPT_DEV, device status is
97 requested. Status returned includes bits for USB_DEV_SLF_PWRD_STATUS (device is
98 currently self-powered) and USB_DEV_RWAKEUP_STATUS (device has remote wakeup
99 enabled). A set bit indicates the corresponding status.
102 When the \fIrequest_type\fR is USB_DEV_REQ_RCPT_EP, endpoint status is
103 requested. Status returned includes bits for USB_EP_HALT_STATUS (endpoint is
104 halted). A set bit indicates the corresponding status.
107 When the \fIrequest_type\fR is USB_DEV_REQ_RCPT_IF, interface status is
108 requested and USB_IF_STATUS (zero) is returned.
116 Status returned successfully in the status argument.
122 \fBUSB_INVALID_ARGS\fR
125 Status pointer and/or dip argument is NULL.
131 \fBUSB_INVALID_PIPE\fR
143 Status not returned successfully.
149 May be called from user or kernel context.
157 dip, pipe_handle, USB_DEV_REQ_RCPT_DEV, 0 &status, 0) ==
159 if (status & USB_DEV_SLF_PWRD_STATUS) {
161 "%s%d: USB device is running on its own power.",
162 ddi_driver_name(dip), ddi_get_instance(dip));
171 See \fBattributes\fR(5) for descriptions of the following attributes:
179 ATTRIBUTE TYPE ATTRIBUTE VALUE
181 Architecture PCI-based systems
183 Interface stability Committed
189 \fBattributes\fR(5), \fBusb_clr_feature\fR(9F), \fBusb_get_alt_if\fR(9F),
190 \fBusb_pipe_get_state\fR(9F), \fBusb_get_cfg\fR(9F),