3 /*-----------------------------------------------------------------------------
\r
5 * USB request definitions
\r
7 *-----------------------------------------------------------------------------
\r
9 * Code taken from USRP2 firmware (GNU Radio Project), version 3.0.2,
\r
11 * Copyright 2003 Free Software Foundation, Inc.
\r
13 *-----------------------------------------------------------------------------
\r
15 * This code is part of usbjtag. usbjtag is free software; you can redistribute
\r
17 * it and/or modify it under the terms of the GNU General Public License as
\r
19 * published by the Free Software Foundation; either version 2 of the License,
\r
21 * or (at your option) any later version. usbjtag is distributed in the hope
\r
23 * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
\r
25 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
27 * GNU General Public License for more details. You should have received a
\r
29 * copy of the GNU General Public License along with this program in the file
\r
31 * COPYING; if not, write to the Free Software Foundation, Inc., 51 Franklin
\r
33 * St, Fifth Floor, Boston, MA 02110-1301 USA
\r
35 *-----------------------------------------------------------------------------
\r
41 // Standard USB requests.
\r
43 // These are contained in end point 0 setup packets
\r
49 #ifndef _USB_REQUESTS_H_
\r
51 #define _USB_REQUESTS_H_
\r
55 // format of bmRequestType byte
\r
59 #define bmRT_DIR_MASK (0x1 << 7)
\r
61 #define bmRT_DIR_IN (1 << 7)
\r
63 #define bmRT_DIR_OUT (0 << 7)
\r
67 #define bmRT_TYPE_MASK (0x3 << 5)
\r
69 #define bmRT_TYPE_STD (0 << 5)
\r
71 #define bmRT_TYPE_CLASS (1 << 5)
\r
73 #define bmRT_TYPE_VENDOR (2 << 5)
\r
75 #define bmRT_TYPE_RESERVED (3 << 5)
\r
79 #define bmRT_RECIP_MASK (0x1f << 0)
\r
81 #define bmRT_RECIP_DEVICE (0 << 0)
\r
83 #define bmRT_RECIP_INTERFACE (1 << 0)
\r
85 #define bmRT_RECIP_ENDPOINT (2 << 0)
\r
87 #define bmRT_RECIP_OTHER (3 << 0)
\r
93 // standard request codes (bRequest)
\r
97 #define RQ_GET_STATUS 0
\r
99 #define RQ_CLEAR_FEATURE 1
\r
101 #define RQ_RESERVED_2 2
\r
103 #define RQ_SET_FEATURE 3
\r
105 #define RQ_RESERVED_4 4
\r
107 #define RQ_SET_ADDRESS 5
\r
109 #define RQ_GET_DESCR 6
\r
111 #define RQ_SET_DESCR 7
\r
113 #define RQ_GET_CONFIG 8
\r
115 #define RQ_SET_CONFIG 9
\r
117 #define RQ_GET_INTERFACE 10
\r
119 #define RQ_SET_INTERFACE 11
\r
121 #define RQ_SYNCH_FRAME 12
\r
125 // standard descriptor types
\r
129 #define DT_DEVICE 1
\r
131 #define DT_CONFIG 2
\r
133 #define DT_STRING 3
\r
135 #define DT_INTERFACE 4
\r
137 #define DT_ENDPOINT 5
\r
139 #define DT_DEVQUAL 6
\r
141 #define DT_OTHER_SPEED 7
\r
143 #define DT_INTERFACE_POWER 8
\r
147 // standard feature selectors
\r
151 #define FS_ENDPOINT_HALT 0 // recip: endpoint
\r
153 #define FS_DEV_REMOTE_WAKEUP 1 // recip: device
\r
155 #define FS_TEST_MODE 2 // recip: device
\r
159 // Get Status device attributes
\r
163 #define bmGSDA_SELF_POWERED 0x01
\r
165 #define bmGSDA_REM_WAKEUP 0x02
\r
171 #endif /* _USB_REQUESTS_H_ */
\r