blob: af8681b3bdc82885046fb6912fa62134a8464e51 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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 Cheng655a7c02013-10-16 16:09:24 -070023struct usbdevfs_ctrltransfer {
Tao Baod7db5942015-01-28 10:07:51 -080024 __u8 bRequestType;
25 __u8 bRequest;
26 __u16 wValue;
Tao Baod7db5942015-01-28 10:07:51 -080027 __u16 wIndex;
28 __u16 wLength;
29 __u32 timeout;
Elliott Hughes0f0c18f2023-03-29 15:53:31 -070030 void * data;
Ben Cheng655a7c02013-10-16 16:09:24 -070031};
32struct usbdevfs_bulktransfer {
Tao Baod7db5942015-01-28 10:07:51 -080033 unsigned int ep;
34 unsigned int len;
Tao Baod7db5942015-01-28 10:07:51 -080035 unsigned int timeout;
Elliott Hughes0f0c18f2023-03-29 15:53:31 -070036 void * data;
Ben Cheng655a7c02013-10-16 16:09:24 -070037};
38struct usbdevfs_setinterface {
Tao Baod7db5942015-01-28 10:07:51 -080039 unsigned int interface;
40 unsigned int altsetting;
Ben Cheng655a7c02013-10-16 16:09:24 -070041};
42struct usbdevfs_disconnectsignal {
Tao Baod7db5942015-01-28 10:07:51 -080043 unsigned int signr;
Elliott Hughes0f0c18f2023-03-29 15:53:31 -070044 void * context;
Ben Cheng655a7c02013-10-16 16:09:24 -070045};
46#define USBDEVFS_MAXDRIVERNAME 255
Ben Cheng655a7c02013-10-16 16:09:24 -070047struct usbdevfs_getdriver {
Tao Baod7db5942015-01-28 10:07:51 -080048 unsigned int interface;
49 char driver[USBDEVFS_MAXDRIVERNAME + 1];
Ben Cheng655a7c02013-10-16 16:09:24 -070050};
Ben Cheng655a7c02013-10-16 16:09:24 -070051struct usbdevfs_connectinfo {
Tao Baod7db5942015-01-28 10:07:51 -080052 unsigned int devnum;
53 unsigned char slow;
Ben Cheng655a7c02013-10-16 16:09:24 -070054};
Christopher Ferrisb8a95e22019-10-02 18:29:20 -070055struct usbdevfs_conninfo_ex {
56 __u32 size;
57 __u32 busnum;
58 __u32 devnum;
59 __u32 speed;
60 __u8 num_ports;
61 __u8 ports[7];
62};
Ben Cheng655a7c02013-10-16 16:09:24 -070063#define USBDEVFS_URB_SHORT_NOT_OK 0x01
64#define USBDEVFS_URB_ISO_ASAP 0x02
65#define USBDEVFS_URB_BULK_CONTINUATION 0x04
66#define USBDEVFS_URB_NO_FSBR 0x20
Ben Cheng655a7c02013-10-16 16:09:24 -070067#define USBDEVFS_URB_ZERO_PACKET 0x40
68#define USBDEVFS_URB_NO_INTERRUPT 0x80
69#define USBDEVFS_URB_TYPE_ISO 0
70#define USBDEVFS_URB_TYPE_INTERRUPT 1
Ben Cheng655a7c02013-10-16 16:09:24 -070071#define USBDEVFS_URB_TYPE_CONTROL 2
72#define USBDEVFS_URB_TYPE_BULK 3
73struct usbdevfs_iso_packet_desc {
Tao Baod7db5942015-01-28 10:07:51 -080074 unsigned int length;
Tao Baod7db5942015-01-28 10:07:51 -080075 unsigned int actual_length;
76 unsigned int status;
Ben Cheng655a7c02013-10-16 16:09:24 -070077};
78struct usbdevfs_urb {
Tao Baod7db5942015-01-28 10:07:51 -080079 unsigned char type;
80 unsigned char endpoint;
81 int status;
82 unsigned int flags;
Elliott Hughes0f0c18f2023-03-29 15:53:31 -070083 void * buffer;
Tao Baod7db5942015-01-28 10:07:51 -080084 int buffer_length;
85 int actual_length;
86 int start_frame;
Tao Baod7db5942015-01-28 10:07:51 -080087 union {
88 int number_of_packets;
89 unsigned int stream_id;
90 };
Tao Baod7db5942015-01-28 10:07:51 -080091 int error_count;
92 unsigned int signr;
Elliott Hughes0f0c18f2023-03-29 15:53:31 -070093 void * usercontext;
Christopher Ferris7447a1c2022-10-04 18:24:44 -070094 struct usbdevfs_iso_packet_desc iso_frame_desc[];
Ben Cheng655a7c02013-10-16 16:09:24 -070095};
96struct usbdevfs_ioctl {
Tao Baod7db5942015-01-28 10:07:51 -080097 int ifno;
98 int ioctl_code;
Elliott Hughes0f0c18f2023-03-29 15:53:31 -070099 void * data;
Ben Cheng655a7c02013-10-16 16:09:24 -0700100};
101struct usbdevfs_hub_portinfo {
Tao Baod7db5942015-01-28 10:07:51 -0800102 char nports;
Tao Baod7db5942015-01-28 10:07:51 -0800103 char port[127];
Ben Cheng655a7c02013-10-16 16:09:24 -0700104};
105#define USBDEVFS_CAP_ZERO_PACKET 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700106#define USBDEVFS_CAP_BULK_CONTINUATION 0x02
107#define USBDEVFS_CAP_NO_PACKET_SIZE_LIM 0x04
108#define USBDEVFS_CAP_BULK_SCATTER_GATHER 0x08
Christopher Ferris915bf812015-09-02 17:23:31 -0700109#define USBDEVFS_CAP_REAP_AFTER_DISCONNECT 0x10
Christopher Ferris106b3a82016-08-24 12:15:38 -0700110#define USBDEVFS_CAP_MMAP 0x20
Christopher Ferris106b3a82016-08-24 12:15:38 -0700111#define USBDEVFS_CAP_DROP_PRIVILEGES 0x40
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700112#define USBDEVFS_CAP_CONNINFO_EX 0x80
Christopher Ferris9584fa42019-12-09 15:36:13 -0800113#define USBDEVFS_CAP_SUSPEND 0x100
Christopher Ferris106b3a82016-08-24 12:15:38 -0700114#define USBDEVFS_DISCONNECT_CLAIM_IF_DRIVER 0x01
Christopher Ferris915bf812015-09-02 17:23:31 -0700115#define USBDEVFS_DISCONNECT_CLAIM_EXCEPT_DRIVER 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700116struct usbdevfs_disconnect_claim {
Tao Baod7db5942015-01-28 10:07:51 -0800117 unsigned int interface;
118 unsigned int flags;
Christopher Ferris915bf812015-09-02 17:23:31 -0700119 char driver[USBDEVFS_MAXDRIVERNAME + 1];
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700120};
121struct usbdevfs_streams {
Tao Baod7db5942015-01-28 10:07:51 -0800122 unsigned int num_streams;
Christopher Ferris915bf812015-09-02 17:23:31 -0700123 unsigned int num_eps;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700124 unsigned char eps[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700125};
126#define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer)
Christopher Ferris915bf812015-09-02 17:23:31 -0700127#define USBDEVFS_CONTROL32 _IOWR('U', 0, struct usbdevfs_ctrltransfer32)
Ben Cheng655a7c02013-10-16 16:09:24 -0700128#define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer)
129#define USBDEVFS_BULK32 _IOWR('U', 2, struct usbdevfs_bulktransfer32)
130#define USBDEVFS_RESETEP _IOR('U', 3, unsigned int)
Christopher Ferris915bf812015-09-02 17:23:31 -0700131#define USBDEVFS_SETINTERFACE _IOR('U', 4, struct usbdevfs_setinterface)
Ben Cheng655a7c02013-10-16 16:09:24 -0700132#define USBDEVFS_SETCONFIGURATION _IOR('U', 5, unsigned int)
133#define USBDEVFS_GETDRIVER _IOW('U', 8, struct usbdevfs_getdriver)
134#define USBDEVFS_SUBMITURB _IOR('U', 10, struct usbdevfs_urb)
Christopher Ferris915bf812015-09-02 17:23:31 -0700135#define USBDEVFS_SUBMITURB32 _IOR('U', 10, struct usbdevfs_urb32)
Ben Cheng655a7c02013-10-16 16:09:24 -0700136#define USBDEVFS_DISCARDURB _IO('U', 11)
137#define USBDEVFS_REAPURB _IOW('U', 12, void *)
138#define USBDEVFS_REAPURB32 _IOW('U', 12, __u32)
Christopher Ferris915bf812015-09-02 17:23:31 -0700139#define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *)
Ben Cheng655a7c02013-10-16 16:09:24 -0700140#define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, __u32)
141#define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_disconnectsignal)
142#define USBDEVFS_DISCSIGNAL32 _IOR('U', 14, struct usbdevfs_disconnectsignal32)
Christopher Ferris915bf812015-09-02 17:23:31 -0700143#define USBDEVFS_CLAIMINTERFACE _IOR('U', 15, unsigned int)
Ben Cheng655a7c02013-10-16 16:09:24 -0700144#define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int)
145#define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo)
146#define USBDEVFS_IOCTL _IOWR('U', 18, struct usbdevfs_ioctl)
Christopher Ferris915bf812015-09-02 17:23:31 -0700147#define USBDEVFS_IOCTL32 _IOWR('U', 18, struct usbdevfs_ioctl32)
Ben Cheng655a7c02013-10-16 16:09:24 -0700148#define USBDEVFS_HUB_PORTINFO _IOR('U', 19, struct usbdevfs_hub_portinfo)
149#define USBDEVFS_RESET _IO('U', 20)
150#define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int)
Christopher Ferris915bf812015-09-02 17:23:31 -0700151#define USBDEVFS_DISCONNECT _IO('U', 22)
Ben Cheng655a7c02013-10-16 16:09:24 -0700152#define USBDEVFS_CONNECT _IO('U', 23)
153#define USBDEVFS_CLAIM_PORT _IOR('U', 24, unsigned int)
154#define USBDEVFS_RELEASE_PORT _IOR('U', 25, unsigned int)
Christopher Ferris915bf812015-09-02 17:23:31 -0700155#define USBDEVFS_GET_CAPABILITIES _IOR('U', 26, __u32)
Ben Cheng655a7c02013-10-16 16:09:24 -0700156#define USBDEVFS_DISCONNECT_CLAIM _IOR('U', 27, struct usbdevfs_disconnect_claim)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700157#define USBDEVFS_ALLOC_STREAMS _IOR('U', 28, struct usbdevfs_streams)
158#define USBDEVFS_FREE_STREAMS _IOR('U', 29, struct usbdevfs_streams)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700159#define USBDEVFS_DROP_PRIVILEGES _IOW('U', 30, __u32)
Christopher Ferris1308ad32017-11-14 17:32:13 -0800160#define USBDEVFS_GET_SPEED _IO('U', 31)
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700161#define USBDEVFS_CONNINFO_EX(len) _IOC(_IOC_READ, 'U', 32, len)
Christopher Ferris9584fa42019-12-09 15:36:13 -0800162#define USBDEVFS_FORBID_SUSPEND _IO('U', 33)
163#define USBDEVFS_ALLOW_SUSPEND _IO('U', 34)
164#define USBDEVFS_WAIT_FOR_RESUME _IO('U', 35)
Christopher Ferris915bf812015-09-02 17:23:31 -0700165#endif