Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
| 10 | *** To edit the content of this header, modify the corresponding |
| 11 | *** source file (e.g. under external/kernel-headers/original/) then |
| 12 | *** run bionic/libc/kernel/tools/update_all.py |
| 13 | *** |
| 14 | *** Any manual change here will be lost the next time this script will |
| 15 | *** be run. You've been warned! |
| 16 | *** |
| 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
| 19 | #ifndef _UAPI_LINUX_USBDEVICE_FS_H |
| 20 | #define _UAPI_LINUX_USBDEVICE_FS_H |
| 21 | #include <linux/types.h> |
| 22 | #include <linux/magic.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 23 | struct usbdevfs_ctrltransfer { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 24 | __u8 bRequestType; |
| 25 | __u8 bRequest; |
| 26 | __u16 wValue; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 27 | __u16 wIndex; |
| 28 | __u16 wLength; |
| 29 | __u32 timeout; |
| 30 | void __user * data; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 31 | }; |
| 32 | struct usbdevfs_bulktransfer { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 33 | unsigned int ep; |
| 34 | unsigned int len; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 35 | unsigned int timeout; |
| 36 | void __user * data; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 37 | }; |
| 38 | struct usbdevfs_setinterface { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 39 | unsigned int interface; |
| 40 | unsigned int altsetting; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 41 | }; |
| 42 | struct usbdevfs_disconnectsignal { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 43 | unsigned int signr; |
| 44 | void __user * context; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 45 | }; |
| 46 | #define USBDEVFS_MAXDRIVERNAME 255 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 47 | struct usbdevfs_getdriver { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 48 | unsigned int interface; |
| 49 | char driver[USBDEVFS_MAXDRIVERNAME + 1]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 50 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 51 | struct usbdevfs_connectinfo { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 52 | unsigned int devnum; |
| 53 | unsigned char slow; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 54 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 55 | #define USBDEVFS_URB_SHORT_NOT_OK 0x01 |
| 56 | #define USBDEVFS_URB_ISO_ASAP 0x02 |
| 57 | #define USBDEVFS_URB_BULK_CONTINUATION 0x04 |
| 58 | #define USBDEVFS_URB_NO_FSBR 0x20 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 59 | #define USBDEVFS_URB_ZERO_PACKET 0x40 |
| 60 | #define USBDEVFS_URB_NO_INTERRUPT 0x80 |
| 61 | #define USBDEVFS_URB_TYPE_ISO 0 |
| 62 | #define USBDEVFS_URB_TYPE_INTERRUPT 1 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 63 | #define USBDEVFS_URB_TYPE_CONTROL 2 |
| 64 | #define USBDEVFS_URB_TYPE_BULK 3 |
| 65 | struct usbdevfs_iso_packet_desc { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 66 | unsigned int length; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 67 | unsigned int actual_length; |
| 68 | unsigned int status; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 69 | }; |
| 70 | struct usbdevfs_urb { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 71 | unsigned char type; |
| 72 | unsigned char endpoint; |
| 73 | int status; |
| 74 | unsigned int flags; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 75 | void __user * buffer; |
| 76 | int buffer_length; |
| 77 | int actual_length; |
| 78 | int start_frame; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 79 | union { |
| 80 | int number_of_packets; |
| 81 | unsigned int stream_id; |
| 82 | }; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 83 | int error_count; |
| 84 | unsigned int signr; |
| 85 | void __user * usercontext; |
| 86 | struct usbdevfs_iso_packet_desc iso_frame_desc[0]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 87 | }; |
| 88 | struct usbdevfs_ioctl { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 89 | int ifno; |
| 90 | int ioctl_code; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 91 | void __user * data; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 92 | }; |
| 93 | struct usbdevfs_hub_portinfo { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 94 | char nports; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 95 | char port[127]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 96 | }; |
| 97 | #define USBDEVFS_CAP_ZERO_PACKET 0x01 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 98 | #define USBDEVFS_CAP_BULK_CONTINUATION 0x02 |
| 99 | #define USBDEVFS_CAP_NO_PACKET_SIZE_LIM 0x04 |
| 100 | #define USBDEVFS_CAP_BULK_SCATTER_GATHER 0x08 |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 101 | #define USBDEVFS_CAP_REAP_AFTER_DISCONNECT 0x10 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 102 | #define USBDEVFS_CAP_MMAP 0x20 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 103 | #define USBDEVFS_CAP_DROP_PRIVILEGES 0x40 |
| 104 | #define USBDEVFS_DISCONNECT_CLAIM_IF_DRIVER 0x01 |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 105 | #define USBDEVFS_DISCONNECT_CLAIM_EXCEPT_DRIVER 0x02 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 106 | struct usbdevfs_disconnect_claim { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 107 | unsigned int interface; |
| 108 | unsigned int flags; |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 109 | char driver[USBDEVFS_MAXDRIVERNAME + 1]; |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 110 | }; |
| 111 | struct usbdevfs_streams { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 112 | unsigned int num_streams; |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 113 | unsigned int num_eps; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 114 | unsigned char eps[0]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 115 | }; |
| 116 | #define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer) |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 117 | #define USBDEVFS_CONTROL32 _IOWR('U', 0, struct usbdevfs_ctrltransfer32) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 118 | #define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer) |
| 119 | #define USBDEVFS_BULK32 _IOWR('U', 2, struct usbdevfs_bulktransfer32) |
| 120 | #define USBDEVFS_RESETEP _IOR('U', 3, unsigned int) |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 121 | #define USBDEVFS_SETINTERFACE _IOR('U', 4, struct usbdevfs_setinterface) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 122 | #define USBDEVFS_SETCONFIGURATION _IOR('U', 5, unsigned int) |
| 123 | #define USBDEVFS_GETDRIVER _IOW('U', 8, struct usbdevfs_getdriver) |
| 124 | #define USBDEVFS_SUBMITURB _IOR('U', 10, struct usbdevfs_urb) |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 125 | #define USBDEVFS_SUBMITURB32 _IOR('U', 10, struct usbdevfs_urb32) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 126 | #define USBDEVFS_DISCARDURB _IO('U', 11) |
| 127 | #define USBDEVFS_REAPURB _IOW('U', 12, void *) |
| 128 | #define USBDEVFS_REAPURB32 _IOW('U', 12, __u32) |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 129 | #define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 130 | #define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, __u32) |
| 131 | #define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_disconnectsignal) |
| 132 | #define USBDEVFS_DISCSIGNAL32 _IOR('U', 14, struct usbdevfs_disconnectsignal32) |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 133 | #define USBDEVFS_CLAIMINTERFACE _IOR('U', 15, unsigned int) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 134 | #define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int) |
| 135 | #define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo) |
| 136 | #define USBDEVFS_IOCTL _IOWR('U', 18, struct usbdevfs_ioctl) |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 137 | #define USBDEVFS_IOCTL32 _IOWR('U', 18, struct usbdevfs_ioctl32) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 138 | #define USBDEVFS_HUB_PORTINFO _IOR('U', 19, struct usbdevfs_hub_portinfo) |
| 139 | #define USBDEVFS_RESET _IO('U', 20) |
| 140 | #define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int) |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 141 | #define USBDEVFS_DISCONNECT _IO('U', 22) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 142 | #define USBDEVFS_CONNECT _IO('U', 23) |
| 143 | #define USBDEVFS_CLAIM_PORT _IOR('U', 24, unsigned int) |
| 144 | #define USBDEVFS_RELEASE_PORT _IOR('U', 25, unsigned int) |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 145 | #define USBDEVFS_GET_CAPABILITIES _IOR('U', 26, __u32) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 146 | #define USBDEVFS_DISCONNECT_CLAIM _IOR('U', 27, struct usbdevfs_disconnect_claim) |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 147 | #define USBDEVFS_ALLOC_STREAMS _IOR('U', 28, struct usbdevfs_streams) |
| 148 | #define USBDEVFS_FREE_STREAMS _IOR('U', 29, struct usbdevfs_streams) |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 149 | #define USBDEVFS_DROP_PRIVILEGES _IOW('U', 30, __u32) |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 150 | #define USBDEVFS_GET_SPEED _IO('U', 31) |
Christopher Ferris | 915bf81 | 2015-09-02 17:23:31 -0700 | [diff] [blame] | 151 | #endif |