Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is auto-generated. Modifications will be lost. |
| 3 | * |
| 4 | * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/ |
| 5 | * for more information. |
| 6 | */ |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 7 | #ifndef _UAPI_LINUX_USBDEVICE_FS_H |
| 8 | #define _UAPI_LINUX_USBDEVICE_FS_H |
| 9 | #include <linux/types.h> |
| 10 | #include <linux/magic.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 11 | struct usbdevfs_ctrltransfer { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 12 | __u8 bRequestType; |
| 13 | __u8 bRequest; |
| 14 | __u16 wValue; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 15 | __u16 wIndex; |
| 16 | __u16 wLength; |
| 17 | __u32 timeout; |
Elliott Hughes | 0f0c18f | 2023-03-29 15:53:31 -0700 | [diff] [blame] | 18 | void * data; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 19 | }; |
| 20 | struct usbdevfs_bulktransfer { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 21 | unsigned int ep; |
| 22 | unsigned int len; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 23 | unsigned int timeout; |
Elliott Hughes | 0f0c18f | 2023-03-29 15:53:31 -0700 | [diff] [blame] | 24 | void * data; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 25 | }; |
| 26 | struct usbdevfs_setinterface { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 27 | unsigned int interface; |
| 28 | unsigned int altsetting; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 29 | }; |
| 30 | struct usbdevfs_disconnectsignal { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 31 | unsigned int signr; |
Elliott Hughes | 0f0c18f | 2023-03-29 15:53:31 -0700 | [diff] [blame] | 32 | void * context; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 33 | }; |
| 34 | #define USBDEVFS_MAXDRIVERNAME 255 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 35 | struct usbdevfs_getdriver { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 36 | unsigned int interface; |
| 37 | char driver[USBDEVFS_MAXDRIVERNAME + 1]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 38 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 39 | struct usbdevfs_connectinfo { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 40 | unsigned int devnum; |
| 41 | unsigned char slow; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 42 | }; |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 43 | struct usbdevfs_conninfo_ex { |
| 44 | __u32 size; |
| 45 | __u32 busnum; |
| 46 | __u32 devnum; |
| 47 | __u32 speed; |
| 48 | __u8 num_ports; |
| 49 | __u8 ports[7]; |
| 50 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 51 | #define USBDEVFS_URB_SHORT_NOT_OK 0x01 |
| 52 | #define USBDEVFS_URB_ISO_ASAP 0x02 |
| 53 | #define USBDEVFS_URB_BULK_CONTINUATION 0x04 |
| 54 | #define USBDEVFS_URB_NO_FSBR 0x20 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 55 | #define USBDEVFS_URB_ZERO_PACKET 0x40 |
| 56 | #define USBDEVFS_URB_NO_INTERRUPT 0x80 |
| 57 | #define USBDEVFS_URB_TYPE_ISO 0 |
| 58 | #define USBDEVFS_URB_TYPE_INTERRUPT 1 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 59 | #define USBDEVFS_URB_TYPE_CONTROL 2 |
| 60 | #define USBDEVFS_URB_TYPE_BULK 3 |
| 61 | struct usbdevfs_iso_packet_desc { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 62 | unsigned int length; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 63 | unsigned int actual_length; |
| 64 | unsigned int status; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 65 | }; |
| 66 | struct usbdevfs_urb { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 67 | unsigned char type; |
| 68 | unsigned char endpoint; |
| 69 | int status; |
| 70 | unsigned int flags; |
Elliott Hughes | 0f0c18f | 2023-03-29 15:53:31 -0700 | [diff] [blame] | 71 | void * buffer; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 72 | int buffer_length; |
| 73 | int actual_length; |
| 74 | int start_frame; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 75 | union { |
| 76 | int number_of_packets; |
| 77 | unsigned int stream_id; |
| 78 | }; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 79 | int error_count; |
| 80 | unsigned int signr; |
Elliott Hughes | 0f0c18f | 2023-03-29 15:53:31 -0700 | [diff] [blame] | 81 | void * usercontext; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 82 | struct usbdevfs_iso_packet_desc iso_frame_desc[]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 83 | }; |
| 84 | struct usbdevfs_ioctl { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 85 | int ifno; |
| 86 | int ioctl_code; |
Elliott Hughes | 0f0c18f | 2023-03-29 15:53:31 -0700 | [diff] [blame] | 87 | void * data; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 88 | }; |
| 89 | struct usbdevfs_hub_portinfo { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 90 | char nports; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 91 | char port[127]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 92 | }; |
| 93 | #define USBDEVFS_CAP_ZERO_PACKET 0x01 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 94 | #define USBDEVFS_CAP_BULK_CONTINUATION 0x02 |
| 95 | #define USBDEVFS_CAP_NO_PACKET_SIZE_LIM 0x04 |
| 96 | #define USBDEVFS_CAP_BULK_SCATTER_GATHER 0x08 |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 97 | #define USBDEVFS_CAP_REAP_AFTER_DISCONNECT 0x10 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 98 | #define USBDEVFS_CAP_MMAP 0x20 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 99 | #define USBDEVFS_CAP_DROP_PRIVILEGES 0x40 |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 100 | #define USBDEVFS_CAP_CONNINFO_EX 0x80 |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 101 | #define USBDEVFS_CAP_SUSPEND 0x100 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 102 | #define USBDEVFS_DISCONNECT_CLAIM_IF_DRIVER 0x01 |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 103 | #define USBDEVFS_DISCONNECT_CLAIM_EXCEPT_DRIVER 0x02 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 104 | struct usbdevfs_disconnect_claim { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 105 | unsigned int interface; |
| 106 | unsigned int flags; |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 107 | char driver[USBDEVFS_MAXDRIVERNAME + 1]; |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 108 | }; |
| 109 | struct usbdevfs_streams { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 110 | unsigned int num_streams; |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 111 | unsigned int num_eps; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 112 | unsigned char eps[]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 113 | }; |
| 114 | #define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer) |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 115 | #define USBDEVFS_CONTROL32 _IOWR('U', 0, struct usbdevfs_ctrltransfer32) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 116 | #define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer) |
| 117 | #define USBDEVFS_BULK32 _IOWR('U', 2, struct usbdevfs_bulktransfer32) |
| 118 | #define USBDEVFS_RESETEP _IOR('U', 3, unsigned int) |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 119 | #define USBDEVFS_SETINTERFACE _IOR('U', 4, struct usbdevfs_setinterface) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 120 | #define USBDEVFS_SETCONFIGURATION _IOR('U', 5, unsigned int) |
| 121 | #define USBDEVFS_GETDRIVER _IOW('U', 8, struct usbdevfs_getdriver) |
| 122 | #define USBDEVFS_SUBMITURB _IOR('U', 10, struct usbdevfs_urb) |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 123 | #define USBDEVFS_SUBMITURB32 _IOR('U', 10, struct usbdevfs_urb32) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 124 | #define USBDEVFS_DISCARDURB _IO('U', 11) |
| 125 | #define USBDEVFS_REAPURB _IOW('U', 12, void *) |
| 126 | #define USBDEVFS_REAPURB32 _IOW('U', 12, __u32) |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 127 | #define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 128 | #define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, __u32) |
| 129 | #define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_disconnectsignal) |
| 130 | #define USBDEVFS_DISCSIGNAL32 _IOR('U', 14, struct usbdevfs_disconnectsignal32) |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 131 | #define USBDEVFS_CLAIMINTERFACE _IOR('U', 15, unsigned int) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 132 | #define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int) |
| 133 | #define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo) |
| 134 | #define USBDEVFS_IOCTL _IOWR('U', 18, struct usbdevfs_ioctl) |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 135 | #define USBDEVFS_IOCTL32 _IOWR('U', 18, struct usbdevfs_ioctl32) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 136 | #define USBDEVFS_HUB_PORTINFO _IOR('U', 19, struct usbdevfs_hub_portinfo) |
| 137 | #define USBDEVFS_RESET _IO('U', 20) |
| 138 | #define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int) |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 139 | #define USBDEVFS_DISCONNECT _IO('U', 22) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 140 | #define USBDEVFS_CONNECT _IO('U', 23) |
| 141 | #define USBDEVFS_CLAIM_PORT _IOR('U', 24, unsigned int) |
| 142 | #define USBDEVFS_RELEASE_PORT _IOR('U', 25, unsigned int) |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 143 | #define USBDEVFS_GET_CAPABILITIES _IOR('U', 26, __u32) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 144 | #define USBDEVFS_DISCONNECT_CLAIM _IOR('U', 27, struct usbdevfs_disconnect_claim) |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 145 | #define USBDEVFS_ALLOC_STREAMS _IOR('U', 28, struct usbdevfs_streams) |
| 146 | #define USBDEVFS_FREE_STREAMS _IOR('U', 29, struct usbdevfs_streams) |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 147 | #define USBDEVFS_DROP_PRIVILEGES _IOW('U', 30, __u32) |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 148 | #define USBDEVFS_GET_SPEED _IO('U', 31) |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 149 | #define USBDEVFS_CONNINFO_EX(len) _IOC(_IOC_READ, 'U', 32, len) |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 150 | #define USBDEVFS_FORBID_SUSPEND _IO('U', 33) |
| 151 | #define USBDEVFS_ALLOW_SUSPEND _IO('U', 34) |
| 152 | #define USBDEVFS_WAIT_FOR_RESUME _IO('U', 35) |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 153 | #endif |