1usb_ctrl_request(9S) Data Structures for Drivers usb_ctrl_request(9S)
2
3
4
6 usb_ctrl_request - USB control pipe request structure
7
9 #include <sys/usb/usba.h>
10
11
13 Solaris DDI specific (Solaris DDI)
14
16 A control request is used to send device commands (or requests) and to
17 read status. Please refer to Section 5.5 of the USB 2.0 specification
18 for information on control pipes. For information on formatting
19 requests, see Section 9.3 of the USB 2.0 specification. The USB 2.0
20 specification is available at www.usb.org.
21
23 The fields in the usb_ctrl_req_t are used to format a control request:
24
25 uint8_t ctrl_bmRequestType; /* characteristics of request */
26 uint8_t ctrl_bRequest; /* specific request */
27 uint16_t ctrl_wValue; /* varies according to request */
28 uint16_t ctrl_wIndex; /* index or offset */
29 uint16_t ctrl_wLength; /* number of bytes to xfer */
30 mblk_t *ctrl_data; /* data for the data phase */
31 /* IN or OUT: allocated by client */
32 uint_t ctrl_timeout; /* time until USBA framework */
33 /* retires req, in seconds */
34 /* If set to zero, defaults to 5 sec */
35 usb_opaque_t ctrl_client_private; /* client private info */
36 usb_req_attrs_t ctrl_attributes; /* attrib. for this req */
37
38 /* Normal callback function, called upon completion. */
39 void (*ctrl_cb)(
40 usb_pipe_handle_t ph, struct usb_ctrl_req *req);
41
42 /* Exception callback function, for error handling. */
43 void (*ctrl_exc_cb)(
44 usb_pipe_handle_t ph, struct usb_ctrl_req *req);
45 usb_cr_t ctrl_completion_reason; /* overall success status */
46 /* See usb_completion_reason(9S) */
47 usb_cb_flags_t ctrl_cb_flags; /* recovery done by callback hndlr */
48 /* See usb_callback_flags(9S) */
49
50
51
52 Request attributes define special handling for transfers. The following
53 attributes are valid for control requests:
54
55 USB_ATTRS_SHORT_XFER_OK Accept transfers where less data is received
56 than expected.
57
58
59 USB_ATTRS_AUTOCLEARING Have USB framework reset pipe and clear
60 functional stalls automatically on excep‐
61 tion.
62
63
64 USB_ATTRS_PIPE_RESET Have USB framework reset pipe automatically
65 on exception.
66
67
68
69 Please see usb_request_attributes(9S) for more information.
70
71
72 The following definitions directly pertain to fields in the USB control
73 request structure. (See Section 9.3 of the USB 2.0 specification.)
74
75 Direction bitmasks of a control request's ctrl_bmRequestType field
76 (USB 2.0 spec, section 9.3.1)
77
78 USB_DEV_REQ_HOST_TO_DEV | Host to device direction
79 USB_DEV_REQ_DEV_TO_HOST | Device to host direction
80 USB_DEV_REQ_DIR_MASK | Bitmask of direction bits
81
82 Request type bitmasks of a control request's ctrl_bmRequestType field
83 (USB 2.0 spec, section 9.3.1)
84
85 USB_DEV_REQ_TYPE_STANDARD | USB 2.0 defined command
86 | for all USB devices
87 USB_DEV_REQ_TYPE_CLASS | USB 2.0 defined
88 | class-specific command
89 USB_DEV_REQ_TYPE_VENDOR | Vendor-specific command
90 USB_DEV_REQ_TYPE_MASK | Bitmask of request type bits
91
92 Recipient bitmasks of a control request's ctrl_bmRequestType field
93 (USB 2.0 spec, section 9.3.1)
94
95 USB_DEV_REQ_RCPT_DEV | Request is for device
96 USB_DEV_REQ_RCPT_IF | Request is for interface
97 USB_DEV_REQ_RCPT_EP | Request is for endpoint
98 USB_DEV_REQ_RCPT_OTHER | Req is for other than above
99 USB_DEV_REQ_RCPT_MASK | Bitmask of request recipient bits
100
101 Standard requests (USB 2.0 spec, section 9.4)
102 USB_REQ_GET_STATUS | Get status of device, endpoint
103 |or interface (9.4.5)
104 USB_REQ_CLEAR_FEATURE | Clear feature specified by
105 |wValue field (9.4.1)
106 USB_REQ_SET_FEATURE | Set feature specified by
107 | wValue field (9.4.9)
108 USB_REQ_SET_ADDRESS | Set address specified by
109 | wValue field (9.4.6)
110 USB_REQ_GET_DESCR | Get descr for item/idx in
111 | wValue field (9.4.3)
112 USB_REQ_SET_DESCR | Set descr for item/idx in
113 | wValue field (9.4.8)
114 USB_REQ_GET_CFG | Get current device
115 | configuration (9.4.2)
116 USB_REQ_SET_CFG | Set current device
117 | configuration (9.4.7)
118 USB_REQ_GET_IF | Get alternate interface
119 | setting (9.4.4)
120 USB_REQ_SET_IF | Set alternate interface
121 | setting (9.4.10)
122 USB_REQ_SYNC_FRAME | Set and report an endpoint's
123 | sync frame (9.4.11)
124
125 Unicode language ID, used as wIndex for USB_REQ_SET/GET_DESCRIPTOR
126
127 USB_LANG_ID | Unicode English Lang ID for
128 | parsing str descr
129
130
132 See attributes(5) for descriptions of the following attributes:
133
134
135
136
137 ┌─────────────────────────────┬─────────────────────────────┐
138 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
139 ├─────────────────────────────┼─────────────────────────────┤
140 │Architecture │PCI-based systems │
141 ├─────────────────────────────┼─────────────────────────────┤
142 │Interface stability │Committed │
143 ├─────────────────────────────┼─────────────────────────────┤
144 │Availability │SUNWusbu │
145 └─────────────────────────────┴─────────────────────────────┘
146
148 usb_alloc_request(9F), usb_pipe_bulk_xfer(9F), usb_pipe_ctrl_xfer(9F),
149 usb_pipe_intr_xfer(9F), usb_pipe_isoc_xfer(9F), usb_bulk_request(9S),
150 usb_callback_flags(9S), usb_completion_reason(9S),
151 usb_intr_request(9S), usb_isoc_request(9S), usb_request_attributes(9S)
152
153
154
155SunOS 5.11 5 Jan 2004 usb_ctrl_request(9S)