1 /*****************************************************************************/
4 * usbdevice_fs.h -- USB device file system.
7 * Thomas Sailer (sailer@ife.ee.ethz.ch)
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 * 0.1 04.01.2000 Created
26 * $Id: usbdevice_fs.h,v 1.1 2000/01/06 18:40:41 tom Exp $
29 /*****************************************************************************/
31 #ifndef _LINUX_USBDEVICE_FS_H
32 #define _LINUX_USBDEVICE_FS_H
34 #include <linux/types.h>
35 #include <linux/magic.h>
37 /* --------------------------------------------------------------------- */
39 /* usbdevfs ioctl codes */
41 struct usbdevfs_ctrltransfer
{
47 __u32 timeout
; /* in milliseconds */
51 struct usbdevfs_bulktransfer
{
54 unsigned int timeout
; /* in milliseconds */
58 struct usbdevfs_setinterface
{
59 unsigned int interface
;
60 unsigned int altsetting
;
63 struct usbdevfs_disconnectsignal
{
68 #define USBDEVFS_MAXDRIVERNAME 255
70 struct usbdevfs_getdriver
{
71 unsigned int interface
;
72 char driver
[USBDEVFS_MAXDRIVERNAME
+ 1];
75 struct usbdevfs_connectinfo
{
80 #define USBDEVFS_URB_SHORT_NOT_OK 1
81 #define USBDEVFS_URB_ISO_ASAP 2
83 #define USBDEVFS_URB_TYPE_ISO 0
84 #define USBDEVFS_URB_TYPE_INTERRUPT 1
85 #define USBDEVFS_URB_TYPE_CONTROL 2
86 #define USBDEVFS_URB_TYPE_BULK 3
88 struct usbdevfs_iso_packet_desc
{
90 unsigned int actual_length
;
96 unsigned char endpoint
;
103 int number_of_packets
;
105 unsigned int signr
; /* signal to be sent on error, -1 if none should be sent */
107 struct usbdevfs_iso_packet_desc iso_frame_desc
[0];
110 /* ioctls for talking directly to drivers */
111 struct usbdevfs_ioctl
{
112 int ifno
; /* interface 0..N ; negative numbers reserved */
113 int ioctl_code
; /* MUST encode size + direction of data so the
114 * macros in <asm/ioctl.h> give correct values */
115 void __user
*data
; /* param buffer (in, or out) */
118 /* You can do most things with hubs just through control messages,
119 * except find out what device connects to what port. */
120 struct usbdevfs_hub_portinfo
{
121 char nports
; /* number of downstream ports in this hub */
122 char port
[127]; /* e.g. port 3 connects to device 27 */
127 #include <linux/compat.h>
128 struct usbdevfs_urb32
{
130 unsigned char endpoint
;
133 compat_caddr_t buffer
;
134 compat_int_t buffer_length
;
135 compat_int_t actual_length
;
136 compat_int_t start_frame
;
137 compat_int_t number_of_packets
;
138 compat_int_t error_count
;
140 compat_caddr_t usercontext
; /* unused */
141 struct usbdevfs_iso_packet_desc iso_frame_desc
[0];
144 struct usbdevfs_ioctl32
{
150 #endif /* __KERNEL__ */
152 #define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer)
153 #define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer)
154 #define USBDEVFS_RESETEP _IOR('U', 3, unsigned int)
155 #define USBDEVFS_SETINTERFACE _IOR('U', 4, struct usbdevfs_setinterface)
156 #define USBDEVFS_SETCONFIGURATION _IOR('U', 5, unsigned int)
157 #define USBDEVFS_GETDRIVER _IOW('U', 8, struct usbdevfs_getdriver)
158 #define USBDEVFS_SUBMITURB _IOR('U', 10, struct usbdevfs_urb)
159 #define USBDEVFS_SUBMITURB32 _IOR('U', 10, struct usbdevfs_urb32)
160 #define USBDEVFS_DISCARDURB _IO('U', 11)
161 #define USBDEVFS_REAPURB _IOW('U', 12, void *)
162 #define USBDEVFS_REAPURB32 _IOW('U', 12, __u32)
163 #define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *)
164 #define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, __u32)
165 #define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_disconnectsignal)
166 #define USBDEVFS_CLAIMINTERFACE _IOR('U', 15, unsigned int)
167 #define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int)
168 #define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo)
169 #define USBDEVFS_IOCTL _IOWR('U', 18, struct usbdevfs_ioctl)
170 #define USBDEVFS_IOCTL32 _IOWR('U', 18, struct usbdevfs_ioctl32)
171 #define USBDEVFS_HUB_PORTINFO _IOR('U', 19, struct usbdevfs_hub_portinfo)
172 #define USBDEVFS_RESET _IO('U', 20)
173 #define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int)
174 #define USBDEVFS_DISCONNECT _IO('U', 22)
175 #define USBDEVFS_CONNECT _IO('U', 23)
176 #endif /* _LINUX_USBDEVICE_FS_H */