Imported Upstream version 3.0
[debian/gnuradio] / usrp / firmware / include / usb_requests.h
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2003 Free Software Foundation, Inc.
4  * 
5  * This file is part of GNU Radio
6  * 
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 2, or (at your option)
10  * any later version.
11  * 
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.
16  * 
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.
21  */
22
23 // Standard USB requests.
24 // These are contained in end point 0 setup packets
25
26
27 #ifndef _USB_REQUESTS_H_
28 #define _USB_REQUESTS_H_
29
30 // format of bmRequestType byte
31
32 #define bmRT_DIR_MASK           (0x1 << 7)
33 #define bmRT_DIR_IN             (1 << 7)
34 #define bmRT_DIR_OUT            (0 << 7)
35
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)
41
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)
47
48
49 // standard request codes (bRequest)
50
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
64
65 // standard descriptor types
66
67 #define DT_DEVICE               1
68 #define DT_CONFIG               2
69 #define DT_STRING               3
70 #define DT_INTERFACE            4
71 #define DT_ENDPOINT             5
72 #define DT_DEVQUAL              6
73 #define DT_OTHER_SPEED          7
74 #define DT_INTERFACE_POWER      8
75
76 // standard feature selectors
77
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
81
82 // Get Status device attributes
83
84 #define bmGSDA_SELF_POWERED     0x01
85 #define bmGSDA_REM_WAKEUP       0x02
86
87
88 #endif /* _USB_REQUESTS_H_ */