1/*
2 * Copyright 2007 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Niels Sascha Reedijk, niels.reedijk@gmail.com
7 *
8 * Corresponds to:
9 *		headers/os/drivers/USB_spec.h rev 19915
10 */
11
12
13/*!
14	\file USB_spec.h
15	\ingroup drivers
16	\ingroup libbe
17	\brief General definitions as defined by the USB standard.
18*/
19
20
21/*!
22	\name Request Types: targets and direction
23
24	These request types can be used in the usb_module_info::send_request()
25	and usb_module_info::queue_request() methods. They specifiy both the type
26	of interface and the direction of the transfer.
27
28	These are usually combined with a category (found on this page).
29*/
30
31
32//! @{
33
34
35/*! 
36	\def USB_REQTYPE_DEVICE_IN
37	\brief Device. In.
38*/
39
40
41/*!
42	\def USB_REQTYPE_DEVICE_OUT
43	\brief Device. Out.
44*/
45
46
47/*!
48	\def USB_REQTYPE_INTERFACE_IN
49	\brief Interface. In.
50*/
51
52
53/*!
54	\def USB_REQTYPE_INTERFACE_OUT
55	\brief Interface. Out.
56*/
57
58
59/*!
60	\def USB_REQTYPE_ENDPOINT_IN
61	\brief Endpoint. In.
62*/
63
64
65/*!
66	\def USB_REQTYPE_ENDPOINT_OUT
67	\brief Endpoint. Out.
68*/
69
70
71/*!
72	\def USB_REQTYPE_OTHER_OUT 
73	\brief Other. Out.
74*/
75
76
77/*!
78	\def USB_REQTYPE_OTHER_IN
79	\brief Other. In.
80*/
81
82
83//! @}
84
85
86/*!
87	\name Request Types: categories
88
89	These request types can be used in the usb_module_info::send_request()
90	and usb_module_info::queue_request() methods. They specifiy the category
91	of the transfer.
92
93	These are usually combined with a target and direction (found on this page).
94*/
95
96
97//! @{
98
99
100/*!
101	\def USB_REQTYPE_STANDARD
102	\brief Request that adheres to the USB specifications.
103*/
104
105
106/*!
107	\def USB_REQTYPE_CLASS
108	\brief Request that adheres to the specifications of the class.
109*/
110
111
112/*!
113	\def USB_REQTYPE_VENDOR
114	\brief Request that is defined by the specifications of the vendor.
115*/
116
117
118/*!
119	\def USB_REQTYPE_RESERVED
120	\brief Reserved for special implementations.
121*/
122
123
124/*!
125	\def USB_REQTYPE_MASK
126	\brief Constant that can be used as mask over the requesttype field.
127*/
128
129
130//! @}
131
132
133/*!
134	\name Standard Request Values
135
136	These request values are defined by the USB standard. You can use these
137	constants in both the usb_module_info::send_request() and
138	usb_module_info::queue_request() methods.
139
140	\warning The stack handles most of these standard requests for you. Use the
141	supplied convenience functions the the usb_module_info interface rather than
142	doing the requests yourself. Some of these request may actually interfere
143	with the inner workings of the USB stack!
144*/
145
146
147//! @{
148
149
150/*!
151	\def USB_REQUEST_GET_STATUS
152	\brief Get the status of a device.
153*/
154
155
156/*!
157	\def USB_REQUEST_CLEAR_FEATURE 
158	\brief Clear a feature.
159*/
160
161
162/*!
163	\def USB_REQUEST_SET_FEATURE 
164	\brief Set a feature.
165*/
166
167
168/*!
169	\def USB_REQUEST_SET_ADDRESS
170	\brief Set the device address.
171*/
172
173
174/*!
175	\def USB_REQUEST_GET_DESCRIPTOR 
176	\brief Get a descriptor.
177*/
178
179
180/*!
181	\def USB_REQUEST_SET_DESCRIPTOR 
182	\brief Update a descriptor to a supplied one.
183*/
184
185
186/*!
187	\def USB_REQUEST_GET_CONFIGURATION
188	\brief Get a configuration.
189*/
190
191
192/*!
193	\def USB_REQUEST_SET_CONFIGURATION 
194	\brief Set the configuration.
195*/
196
197
198/*!
199	\def USB_REQUEST_GET_INTERFACE
200	\brief Request an interface descriptor.
201*/
202
203
204/*!
205	\def USB_REQUEST_SET_INTERFACE
206	\brief Set a specific interface.
207*/
208
209
210/*!
211	\def USB_REQUEST_SYNCH_FRAME
212	\brief Synchronize a frame.
213*/
214
215
216//! @}
217
218
219/*!
220	\name Descriptor Constants
221
222	These constants refer to a specific descriptor. They can be used when
223	building a standard USB request for a descriptor, or in the
224	usb_module_info::get_descriptor() method.
225*/
226
227
228//! @{
229
230
231/*!
232	\def USB_DESCRIPTOR_DEVICE
233	\brief Constant for the device descriptor.
234*/
235
236
237/*!
238	\def USB_DESCRIPTOR_CONFIGURATION
239	\brief Constant for a configuration descriptor.
240*/
241
242
243/*!
244	\def USB_DESCRIPTOR_STRING
245	\brief Constant for a string descriptor.
246*/
247
248
249/*!
250	\def USB_DESCRIPTOR_INTERFACE
251	\brief Constant for an interface descriptor.
252*/
253
254
255/*!
256	\def USB_DESCRIPTOR_ENDPOINT
257	\brief Constant for an endpoint descriptor.
258*/
259
260
261//! @}
262
263
264/*!
265	\name Feature Requests
266
267	These constants refer to standard feature requests. You can use these
268	using the convenient usb_module_info::set_feature() and 
269	usb_module_info::clear_feature() methods.
270*/
271
272
273//! @{
274
275
276/*!
277	\def USB_FEATURE_DEVICE_REMOTE_WAKEUP
278	\brief Request a device to wakeup from remote calls.
279*/
280
281
282/*!
283	\def USB_FEATURE_ENDPOINT_HALT
284	\brief Request for a specific endpoint to halt.
285*/
286
287
288//! @}
289
290
291/*!
292	\name Endpoint Attributes
293
294	These constants refer to values in the usb_endpoint_descriptor::attributes
295	field.
296*/
297
298
299//! @{
300
301
302/*!
303	\def USB_ENDPOINT_ATTR_CONTROL
304	\brief Endpoint facilitates control transfers.
305*/
306
307
308/*!
309	\def USB_ENDPOINT_ATTR_ISOCHRONOUS
310	\brief Endpoint facilitates isochronous transfers.
311*/
312
313
314/*!
315	\def USB_ENDPOINT_ATTR_BULK
316	\brief Endpoint facilitates bulk transfers.
317*/
318
319
320/*!
321	\def USB_ENDPOINT_ATTR_INTERRUPT
322	\brief Endpoint facilitates interrupt transfers.
323*/
324
325
326/*!
327	\def USB_ENDPOINT_ATTR_MASK
328	\brief Constant to mask out transfer types.
329*/
330
331
332//! @}
333
334
335/*!
336	\name Endpoint Address
337
338	These constants refer to the direction that is embedded in the
339	usb_endpoint_descriptor::address field.
340*/
341
342
343//! @{
344
345
346/*!
347	\def USB_ENDPOINT_ADDR_DIR_IN
348	\brief The endpoint provides data for the driver.
349*/
350
351
352/*!
353	\def USB_ENDPOINT_ADDR_DIR_OUT	
354	\brief The endpoint accepts data from the host.
355*/
356
357
358//! @}
359