3 * Copyright 2003 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Radio; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
23 // Standard USB requests.
24 // These are contained in end point 0 setup packets
27 #ifndef _USB_REQUESTS_H_
28 #define _USB_REQUESTS_H_
30 // format of bmRequestType byte
32 #define bmRT_DIR_MASK (0x1 << 7)
33 #define bmRT_DIR_IN (1 << 7)
34 #define bmRT_DIR_OUT (0 << 7)
36 #define bmRT_TYPE_MASK (0x3 << 5)
37 #define bmRT_TYPE_STD (0 << 5)
38 #define bmRT_TYPE_CLASS (1 << 5)
39 #define bmRT_TYPE_VENDOR (2 << 5)
40 #define bmRT_TYPE_RESERVED (3 << 5)
42 #define bmRT_RECIP_MASK (0x1f << 0)
43 #define bmRT_RECIP_DEVICE (0 << 0)
44 #define bmRT_RECIP_INTERFACE (1 << 0)
45 #define bmRT_RECIP_ENDPOINT (2 << 0)
46 #define bmRT_RECIP_OTHER (3 << 0)
49 // standard request codes (bRequest)
51 #define RQ_GET_STATUS 0
52 #define RQ_CLEAR_FEATURE 1
53 #define RQ_RESERVED_2 2
54 #define RQ_SET_FEATURE 3
55 #define RQ_RESERVED_4 4
56 #define RQ_SET_ADDRESS 5
57 #define RQ_GET_DESCR 6
58 #define RQ_SET_DESCR 7
59 #define RQ_GET_CONFIG 8
60 #define RQ_SET_CONFIG 9
61 #define RQ_GET_INTERFACE 10
62 #define RQ_SET_INTERFACE 11
63 #define RQ_SYNCH_FRAME 12
65 // standard descriptor types
70 #define DT_INTERFACE 4
73 #define DT_OTHER_SPEED 7
74 #define DT_INTERFACE_POWER 8
76 // standard feature selectors
78 #define FS_ENDPOINT_HALT 0 // recip: endpoint
79 #define FS_DEV_REMOTE_WAKEUP 1 // recip: device
80 #define FS_TEST_MODE 2 // recip: device
82 // Get Status device attributes
84 #define bmGSDA_SELF_POWERED 0x01
85 #define bmGSDA_REM_WAKEUP 0x02
88 #endif /* _USB_REQUESTS_H_ */