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_CTRL_REQUEST 9S "Jan 5, 2004"
8 usb_ctrl_req, usb_ctrl_req_t, usb_ctrl_request \- USB control pipe request structure
12 #include <sys/usb/usba.h>
17 Solaris DDI specific (Solaris DDI)
20 A control request is used to send device commands (or requests) and to read
21 status. Please refer to Section\fI 5.5\fR of the \fIUSB 2.0\fR specification
22 for information on control pipes. For information on formatting requests, see
23 Section \fI9.3\fR of the \fIUSB 2.0\fR specification. The USB 2.0 specification
24 is available at \fIwww.usb.org\fR.
27 The fields in the usb_ctrl_req_t are used to format a control request:
31 uint8_t ctrl_bmRequestType; /* characteristics of request */
32 uint8_t ctrl_bRequest; /* specific request */
33 uint16_t ctrl_wValue; /* varies according to request */
34 uint16_t ctrl_wIndex; /* index or offset */
35 uint16_t ctrl_wLength; /* number of bytes to xfer */
36 mblk_t *ctrl_data; /* data for the data phase */
37 /* IN or OUT: allocated by client */
38 uint_t ctrl_timeout; /* time until USBA framework */
39 /* retires req, in seconds */
40 /* If set to zero, defaults to 5 sec */
41 usb_opaque_t ctrl_client_private; /* client private info */
42 usb_req_attrs_t ctrl_attributes; /* attrib. for this req */
44 /* Normal callback function, called upon completion. */
46 usb_pipe_handle_t ph, struct usb_ctrl_req *req);
48 /* Exception callback function, for error handling. */
50 usb_pipe_handle_t ph, struct usb_ctrl_req *req);
51 usb_cr_t ctrl_completion_reason; /* overall success status */
52 /* See usb_completion_reason(9S) */
53 usb_cb_flags_t ctrl_cb_flags; /* recovery done by callback hndlr */
54 /* See \fBusb_callback_flags(9S)\fR */
60 Request attributes define special handling for transfers. The following
61 attributes are valid for control requests:
65 \fBUSB_ATTRS_SHORT_XFER_OK\fR
68 Accept transfers where less data is received than expected.
74 \fBUSB_ATTRS_AUTOCLEARING\fR
77 Have USB framework reset pipe and clear functional stalls automatically on
84 \fBUSB_ATTRS_PIPE_RESET\fR
87 Have USB framework reset pipe automatically on exception.
92 Please see \fBusb_request_attributes\fR(9S) for more information.
95 The following definitions directly pertain to fields in the USB control request
96 structure. (See Section \fI 9.3\fR of the \fIUSB 2.0\fR specification.)
100 Direction bitmasks of a control request's ctrl_bmRequestType field
101 (USB 2.0 spec, section 9.3.1)
103 USB_DEV_REQ_HOST_TO_DEV | Host to device direction
104 USB_DEV_REQ_DEV_TO_HOST | Device to host direction
105 USB_DEV_REQ_DIR_MASK | Bitmask of direction bits
107 Request type bitmasks of a control request's ctrl_bmRequestType field
108 (USB 2.0 spec, section 9.3.1)
110 USB_DEV_REQ_TYPE_STANDARD | USB 2.0 defined command
111 | for all USB devices
112 USB_DEV_REQ_TYPE_CLASS | USB 2.0 defined
113 | class-specific command
114 USB_DEV_REQ_TYPE_VENDOR | Vendor-specific command
115 USB_DEV_REQ_TYPE_MASK | Bitmask of request type bits
117 Recipient bitmasks of a control request's ctrl_bmRequestType field
118 (USB 2.0 spec, section 9.3.1)
120 USB_DEV_REQ_RCPT_DEV | Request is for device
121 USB_DEV_REQ_RCPT_IF | Request is for interface
122 USB_DEV_REQ_RCPT_EP | Request is for endpoint
123 USB_DEV_REQ_RCPT_OTHER | Req is for other than above
124 USB_DEV_REQ_RCPT_MASK | Bitmask of request recipient bits
126 Standard requests (USB 2.0 spec, section 9.4)
127 USB_REQ_GET_STATUS | Get status of device, endpoint
128 |or interface (9.4.5)
129 USB_REQ_CLEAR_FEATURE | Clear feature specified by
130 |wValue field (9.4.1)
131 USB_REQ_SET_FEATURE | Set feature specified by
132 | wValue field (9.4.9)
133 USB_REQ_SET_ADDRESS | Set address specified by
134 | wValue field (9.4.6)
135 USB_REQ_GET_DESCR | Get descr for item/idx in
136 | wValue field (9.4.3)
137 USB_REQ_SET_DESCR | Set descr for item/idx in
138 | wValue field (9.4.8)
139 USB_REQ_GET_CFG | Get current device
140 | configuration (9.4.2)
141 USB_REQ_SET_CFG | Set current device
142 | configuration (9.4.7)
143 USB_REQ_GET_IF | Get alternate interface
145 USB_REQ_SET_IF | Set alternate interface
147 USB_REQ_SYNC_FRAME | Set and report an endpoint's
148 | sync frame (9.4.11)
150 Unicode language ID, used as wIndex for USB_REQ_SET/GET_DESCRIPTOR
152 USB_LANG_ID | Unicode English Lang ID for
159 See attributes(5) for descriptions of the following attributes:
167 ATTRIBUTE TYPE ATTRIBUTE VALUE
169 Architecture PCI-based systems
171 Interface stability Committed
176 \fBusb_alloc_request\fR(9F), \fBusb_pipe_bulk_xfer\fR(9F),
177 \fBusb_pipe_ctrl_xfer\fR(9F), \fBusb_pipe_intr_xfer\fR(9F),
178 \fBusb_pipe_isoc_xfer\fR(9F), \fBusb_bulk_request\fR(9S),
179 \fBusb_callback_flags\fR(9S), \fBusb_completion_reason\fR(9S),
180 \fBusb_intr_request\fR(9S), \fBusb_isoc_request\fR(9S),
181 \fBusb_request_attributes\fR(9S)