| [4] | 1 | /* -*- c++ -*- */
|
|---|
| 2 | /*-----------------------------------------------------------------------------
|
|---|
| 3 | * USB request definitions
|
|---|
| 4 | *-----------------------------------------------------------------------------
|
|---|
| 5 | * Code taken from USRP2 firmware (GNU Radio Project), version 3.0.2,
|
|---|
| 6 | * Copyright 2003 Free Software Foundation, Inc.
|
|---|
| 7 | *-----------------------------------------------------------------------------
|
|---|
| 8 | * This code is part of usbjtag. usbjtag is free software; you can redistribute
|
|---|
| 9 | * it and/or modify it under the terms of the GNU General Public License as
|
|---|
| 10 | * published by the Free Software Foundation; either version 2 of the License,
|
|---|
| 11 | * or (at your option) any later version. usbjtag is distributed in the hope
|
|---|
| 12 | * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
|---|
| 13 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 14 | * GNU General Public License for more details. You should have received a
|
|---|
| 15 | * copy of the GNU General Public License along with this program in the file
|
|---|
| 16 | * COPYING; if not, write to the Free Software Foundation, Inc., 51 Franklin
|
|---|
| 17 | * St, Fifth Floor, Boston, MA 02110-1301 USA
|
|---|
| 18 | *-----------------------------------------------------------------------------
|
|---|
| 19 | */
|
|---|
| 20 |
|
|---|
| 21 | // Standard USB requests.
|
|---|
| 22 | // These are contained in end point 0 setup packets
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 | #ifndef _USB_REQUESTS_H_
|
|---|
| 26 | #define _USB_REQUESTS_H_
|
|---|
| 27 |
|
|---|
| 28 | // format of bmRequestType byte
|
|---|
| 29 |
|
|---|
| 30 | #define bmRT_DIR_MASK (0x1 << 7)
|
|---|
| 31 | #define bmRT_DIR_IN (1 << 7)
|
|---|
| 32 | #define bmRT_DIR_OUT (0 << 7)
|
|---|
| 33 |
|
|---|
| 34 | #define bmRT_TYPE_MASK (0x3 << 5)
|
|---|
| 35 | #define bmRT_TYPE_STD (0 << 5)
|
|---|
| 36 | #define bmRT_TYPE_CLASS (1 << 5)
|
|---|
| 37 | #define bmRT_TYPE_VENDOR (2 << 5)
|
|---|
| 38 | #define bmRT_TYPE_RESERVED (3 << 5)
|
|---|
| 39 |
|
|---|
| 40 | #define bmRT_RECIP_MASK (0x1f << 0)
|
|---|
| 41 | #define bmRT_RECIP_DEVICE (0 << 0)
|
|---|
| 42 | #define bmRT_RECIP_INTERFACE (1 << 0)
|
|---|
| 43 | #define bmRT_RECIP_ENDPOINT (2 << 0)
|
|---|
| 44 | #define bmRT_RECIP_OTHER (3 << 0)
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 | // standard request codes (bRequest)
|
|---|
| 48 |
|
|---|
| 49 | #define RQ_GET_STATUS 0
|
|---|
| 50 | #define RQ_CLEAR_FEATURE 1
|
|---|
| 51 | #define RQ_RESERVED_2 2
|
|---|
| 52 | #define RQ_SET_FEATURE 3
|
|---|
| 53 | #define RQ_RESERVED_4 4
|
|---|
| 54 | #define RQ_SET_ADDRESS 5
|
|---|
| 55 | #define RQ_GET_DESCR 6
|
|---|
| 56 | #define RQ_SET_DESCR 7
|
|---|
| 57 | #define RQ_GET_CONFIG 8
|
|---|
| 58 | #define RQ_SET_CONFIG 9
|
|---|
| 59 | #define RQ_GET_INTERFACE 10
|
|---|
| 60 | #define RQ_SET_INTERFACE 11
|
|---|
| 61 | #define RQ_SYNCH_FRAME 12
|
|---|
| 62 |
|
|---|
| 63 | // standard descriptor types
|
|---|
| 64 |
|
|---|
| 65 | #define DT_DEVICE 1
|
|---|
| 66 | #define DT_CONFIG 2
|
|---|
| 67 | #define DT_STRING 3
|
|---|
| 68 | #define DT_INTERFACE 4
|
|---|
| 69 | #define DT_ENDPOINT 5
|
|---|
| 70 | #define DT_DEVQUAL 6
|
|---|
| 71 | #define DT_OTHER_SPEED 7
|
|---|
| 72 | #define DT_INTERFACE_POWER 8
|
|---|
| 73 |
|
|---|
| 74 | // standard feature selectors
|
|---|
| 75 |
|
|---|
| 76 | #define FS_ENDPOINT_HALT 0 // recip: endpoint
|
|---|
| 77 | #define FS_DEV_REMOTE_WAKEUP 1 // recip: device
|
|---|
| 78 | #define FS_TEST_MODE 2 // recip: device
|
|---|
| 79 |
|
|---|
| 80 | // Get Status device attributes
|
|---|
| 81 |
|
|---|
| 82 | #define bmGSDA_SELF_POWERED 0x01
|
|---|
| 83 | #define bmGSDA_REM_WAKEUP 0x02
|
|---|
| 84 |
|
|---|
| 85 |
|
|---|
| 86 | #endif /* _USB_REQUESTS_H_ */
|
|---|