1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30#ifndef _UAPI_LINUX_USBDEVICE_FS_H
31#define _UAPI_LINUX_USBDEVICE_FS_H
32
33#include <linux/types.h>
34#include <linux/magic.h>
35
36
37
38
39
40struct usbdevfs_ctrltransfer {
41 __u8 bRequestType;
42 __u8 bRequest;
43 __u16 wValue;
44 __u16 wIndex;
45 __u16 wLength;
46 __u32 timeout;
47 void __user *data;
48};
49
50struct usbdevfs_bulktransfer {
51 unsigned int ep;
52 unsigned int len;
53 unsigned int timeout;
54 void __user *data;
55};
56
57struct usbdevfs_setinterface {
58 unsigned int interface;
59 unsigned int altsetting;
60};
61
62struct usbdevfs_disconnectsignal {
63 unsigned int signr;
64 void __user *context;
65};
66
67#define USBDEVFS_MAXDRIVERNAME 255
68
69struct usbdevfs_getdriver {
70 unsigned int interface;
71 char driver[USBDEVFS_MAXDRIVERNAME + 1];
72};
73
74struct usbdevfs_connectinfo {
75 unsigned int devnum;
76 unsigned char slow;
77};
78
79struct usbdevfs_conninfo_ex {
80 __u32 size;
81
82
83
84 __u32 busnum;
85
86 __u32 devnum;
87 __u32 speed;
88 __u8 num_ports;
89
90
91
92 __u8 ports[7];
93
94
95
96
97};
98
99#define USBDEVFS_URB_SHORT_NOT_OK 0x01
100#define USBDEVFS_URB_ISO_ASAP 0x02
101#define USBDEVFS_URB_BULK_CONTINUATION 0x04
102#define USBDEVFS_URB_NO_FSBR 0x20
103#define USBDEVFS_URB_ZERO_PACKET 0x40
104#define USBDEVFS_URB_NO_INTERRUPT 0x80
105
106#define USBDEVFS_URB_TYPE_ISO 0
107#define USBDEVFS_URB_TYPE_INTERRUPT 1
108#define USBDEVFS_URB_TYPE_CONTROL 2
109#define USBDEVFS_URB_TYPE_BULK 3
110
111struct usbdevfs_iso_packet_desc {
112 unsigned int length;
113 unsigned int actual_length;
114 unsigned int status;
115};
116
117struct usbdevfs_urb {
118 unsigned char type;
119 unsigned char endpoint;
120 int status;
121 unsigned int flags;
122 void __user *buffer;
123 int buffer_length;
124 int actual_length;
125 int start_frame;
126 union {
127 int number_of_packets;
128 unsigned int stream_id;
129 };
130 int error_count;
131 unsigned int signr;
132
133 void __user *usercontext;
134 struct usbdevfs_iso_packet_desc iso_frame_desc[0];
135};
136
137
138struct usbdevfs_ioctl {
139 int ifno;
140 int ioctl_code;
141
142 void __user *data;
143};
144
145
146
147struct usbdevfs_hub_portinfo {
148 char nports;
149 char port [127];
150};
151
152
153#define USBDEVFS_CAP_ZERO_PACKET 0x01
154#define USBDEVFS_CAP_BULK_CONTINUATION 0x02
155#define USBDEVFS_CAP_NO_PACKET_SIZE_LIM 0x04
156#define USBDEVFS_CAP_BULK_SCATTER_GATHER 0x08
157#define USBDEVFS_CAP_REAP_AFTER_DISCONNECT 0x10
158#define USBDEVFS_CAP_MMAP 0x20
159#define USBDEVFS_CAP_DROP_PRIVILEGES 0x40
160#define USBDEVFS_CAP_CONNINFO_EX 0x80
161#define USBDEVFS_CAP_SUSPEND 0x100
162
163
164
165
166#define USBDEVFS_DISCONNECT_CLAIM_IF_DRIVER 0x01
167
168#define USBDEVFS_DISCONNECT_CLAIM_EXCEPT_DRIVER 0x02
169
170struct usbdevfs_disconnect_claim {
171 unsigned int interface;
172 unsigned int flags;
173 char driver[USBDEVFS_MAXDRIVERNAME + 1];
174};
175
176struct usbdevfs_streams {
177 unsigned int num_streams;
178 unsigned int num_eps;
179 unsigned char eps[0];
180};
181
182
183
184
185
186
187#define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer)
188#define USBDEVFS_CONTROL32 _IOWR('U', 0, struct usbdevfs_ctrltransfer32)
189#define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer)
190#define USBDEVFS_BULK32 _IOWR('U', 2, struct usbdevfs_bulktransfer32)
191#define USBDEVFS_RESETEP _IOR('U', 3, unsigned int)
192#define USBDEVFS_SETINTERFACE _IOR('U', 4, struct usbdevfs_setinterface)
193#define USBDEVFS_SETCONFIGURATION _IOR('U', 5, unsigned int)
194#define USBDEVFS_GETDRIVER _IOW('U', 8, struct usbdevfs_getdriver)
195#define USBDEVFS_SUBMITURB _IOR('U', 10, struct usbdevfs_urb)
196#define USBDEVFS_SUBMITURB32 _IOR('U', 10, struct usbdevfs_urb32)
197#define USBDEVFS_DISCARDURB _IO('U', 11)
198#define USBDEVFS_REAPURB _IOW('U', 12, void *)
199#define USBDEVFS_REAPURB32 _IOW('U', 12, __u32)
200#define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *)
201#define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, __u32)
202#define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_disconnectsignal)
203#define USBDEVFS_DISCSIGNAL32 _IOR('U', 14, struct usbdevfs_disconnectsignal32)
204#define USBDEVFS_CLAIMINTERFACE _IOR('U', 15, unsigned int)
205#define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int)
206#define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo)
207#define USBDEVFS_IOCTL _IOWR('U', 18, struct usbdevfs_ioctl)
208#define USBDEVFS_IOCTL32 _IOWR('U', 18, struct usbdevfs_ioctl32)
209#define USBDEVFS_HUB_PORTINFO _IOR('U', 19, struct usbdevfs_hub_portinfo)
210#define USBDEVFS_RESET _IO('U', 20)
211#define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int)
212#define USBDEVFS_DISCONNECT _IO('U', 22)
213#define USBDEVFS_CONNECT _IO('U', 23)
214#define USBDEVFS_CLAIM_PORT _IOR('U', 24, unsigned int)
215#define USBDEVFS_RELEASE_PORT _IOR('U', 25, unsigned int)
216#define USBDEVFS_GET_CAPABILITIES _IOR('U', 26, __u32)
217#define USBDEVFS_DISCONNECT_CLAIM _IOR('U', 27, struct usbdevfs_disconnect_claim)
218#define USBDEVFS_ALLOC_STREAMS _IOR('U', 28, struct usbdevfs_streams)
219#define USBDEVFS_FREE_STREAMS _IOR('U', 29, struct usbdevfs_streams)
220#define USBDEVFS_DROP_PRIVILEGES _IOW('U', 30, __u32)
221#define USBDEVFS_GET_SPEED _IO('U', 31)
222
223
224
225
226#define USBDEVFS_CONNINFO_EX(len) _IOC(_IOC_READ, 'U', 32, len)
227#define USBDEVFS_FORBID_SUSPEND _IO('U', 33)
228#define USBDEVFS_ALLOW_SUSPEND _IO('U', 34)
229#define USBDEVFS_WAIT_FOR_RESUME _IO('U', 35)
230
231#endif
232