Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 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 1 2 3 4 5 6


usbdevice_fs.h
001: /*****************************************************************************/
002: 
003: /*
004:  *      usbdevice_fs.h  --  USB device file system.
005:  *
006:  *      Copyright (C) 2000
007:  *          Thomas Sailer (sailer@ife.ee.ethz.ch)
008:  *
009:  *      This program is free software; you can redistribute it and/or modify
010:  *      it under the terms of the GNU General Public License as published by
011:  *      the Free Software Foundation; either version 2 of the License, or
012:  *      (at your option) any later version.
013:  *
014:  *      This program is distributed in the hope that it will be useful,
015:  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
016:  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
017:  *      GNU General Public License for more details.
018:  *
019:  *      You should have received a copy of the GNU General Public License
020:  *      along with this program; if not, write to the Free Software
021:  *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
022:  *
023:  *  History:
024:  *   0.1  04.01.2000  Created
025:  */
026: 
027: /*****************************************************************************/
028: 
029: #ifndef _LINUX_USBDEVICE_FS_H
030: #define _LINUX_USBDEVICE_FS_H
031: 
032: #include <linux/types.h>
033: #include <linux/magic.h>
034: 
035: /* --------------------------------------------------------------------- */
036: 
037: /* usbdevfs ioctl codes */
038: 
039: struct usbdevfs_ctrltransfer {
040:         __u8 bRequestType;
041:         __u8 bRequest;
042:         __u16 wValue;
043:         __u16 wIndex;
044:         __u16 wLength;
045:         __u32 timeout;  /* in milliseconds */
046:         void *data;
047: };
048: 
049: struct usbdevfs_bulktransfer {
050:         unsigned int ep;
051:         unsigned int len;
052:         unsigned int timeout; /* in milliseconds */
053:         void *data;
054: };
055: 
056: struct usbdevfs_setinterface {
057:         unsigned int interface;
058:         unsigned int altsetting;
059: };
060: 
061: struct usbdevfs_disconnectsignal {
062:         unsigned int signr;
063:         void *context;
064: };
065: 
066: #define USBDEVFS_MAXDRIVERNAME 255
067: 
068: struct usbdevfs_getdriver {
069:         unsigned int interface;
070:         char driver[USBDEVFS_MAXDRIVERNAME + 1];
071: };
072: 
073: struct usbdevfs_connectinfo {
074:         unsigned int devnum;
075:         unsigned char slow;
076: };
077: 
078: #define USBDEVFS_URB_SHORT_NOT_OK       0x01
079: #define USBDEVFS_URB_ISO_ASAP           0x02
080: #define USBDEVFS_URB_BULK_CONTINUATION  0x04
081: #define USBDEVFS_URB_NO_FSBR            0x20
082: #define USBDEVFS_URB_ZERO_PACKET        0x40
083: #define USBDEVFS_URB_NO_INTERRUPT       0x80
084: 
085: #define USBDEVFS_URB_TYPE_ISO              0
086: #define USBDEVFS_URB_TYPE_INTERRUPT        1
087: #define USBDEVFS_URB_TYPE_CONTROL          2
088: #define USBDEVFS_URB_TYPE_BULK             3
089: 
090: struct usbdevfs_iso_packet_desc {
091:         unsigned int length;
092:         unsigned int actual_length;
093:         unsigned int status;
094: };
095: 
096: struct usbdevfs_urb {
097:         unsigned char type;
098:         unsigned char endpoint;
099:         int status;
100:         unsigned int flags;
101:         void *buffer;
102:         int buffer_length;
103:         int actual_length;
104:         int start_frame;
105:         int number_of_packets;
106:         int error_count;
107:         unsigned int signr;     /* signal to be sent on completion,
108:                                   or 0 if none should be sent. */
109:         void *usercontext;
110:         struct usbdevfs_iso_packet_desc iso_frame_desc[0];
111: };
112: 
113: /* ioctls for talking directly to drivers */
114: struct usbdevfs_ioctl {
115:         int     ifno;           /* interface 0..N ; negative numbers reserved */
116:         int     ioctl_code;     /* MUST encode size + direction of data so the
117:                                  * macros in <asm/ioctl.h> give correct values */
118:         void *data;     /* param buffer (in, or out) */
119: };
120: 
121: /* You can do most things with hubs just through control messages,
122:  * except find out what device connects to what port. */
123: struct usbdevfs_hub_portinfo {
124:         char nports;            /* number of downstream ports in this hub */
125:         char port [127];        /* e.g. port 3 connects to device 27 */
126: };
127: 
128: 
129: #define USBDEVFS_CONTROL           _IOWR('U', 0, struct usbdevfs_ctrltransfer)
130: #define USBDEVFS_CONTROL32           _IOWR('U', 0, struct usbdevfs_ctrltransfer32)
131: #define USBDEVFS_BULK              _IOWR('U', 2, struct usbdevfs_bulktransfer)
132: #define USBDEVFS_BULK32              _IOWR('U', 2, struct usbdevfs_bulktransfer32)
133: #define USBDEVFS_RESETEP           _IOR('U', 3, unsigned int)
134: #define USBDEVFS_SETINTERFACE      _IOR('U', 4, struct usbdevfs_setinterface)
135: #define USBDEVFS_SETCONFIGURATION  _IOR('U', 5, unsigned int)
136: #define USBDEVFS_GETDRIVER         _IOW('U', 8, struct usbdevfs_getdriver)
137: #define USBDEVFS_SUBMITURB         _IOR('U', 10, struct usbdevfs_urb)
138: #define USBDEVFS_SUBMITURB32       _IOR('U', 10, struct usbdevfs_urb32)
139: #define USBDEVFS_DISCARDURB        _IO('U', 11)
140: #define USBDEVFS_REAPURB           _IOW('U', 12, void *)
141: #define USBDEVFS_REAPURB32         _IOW('U', 12, __u32)
142: #define USBDEVFS_REAPURBNDELAY     _IOW('U', 13, void *)
143: #define USBDEVFS_REAPURBNDELAY32   _IOW('U', 13, __u32)
144: #define USBDEVFS_DISCSIGNAL        _IOR('U', 14, struct usbdevfs_disconnectsignal)
145: #define USBDEVFS_DISCSIGNAL32      _IOR('U', 14, struct usbdevfs_disconnectsignal32)
146: #define USBDEVFS_CLAIMINTERFACE    _IOR('U', 15, unsigned int)
147: #define USBDEVFS_RELEASEINTERFACE  _IOR('U', 16, unsigned int)
148: #define USBDEVFS_CONNECTINFO       _IOW('U', 17, struct usbdevfs_connectinfo)
149: #define USBDEVFS_IOCTL             _IOWR('U', 18, struct usbdevfs_ioctl)
150: #define USBDEVFS_IOCTL32           _IOWR('U', 18, struct usbdevfs_ioctl32)
151: #define USBDEVFS_HUB_PORTINFO      _IOR('U', 19, struct usbdevfs_hub_portinfo)
152: #define USBDEVFS_RESET             _IO('U', 20)
153: #define USBDEVFS_CLEAR_HALT        _IOR('U', 21, unsigned int)
154: #define USBDEVFS_DISCONNECT        _IO('U', 22)
155: #define USBDEVFS_CONNECT           _IO('U', 23)
156: #define USBDEVFS_CLAIM_PORT        _IOR('U', 24, unsigned int)
157: #define USBDEVFS_RELEASE_PORT      _IOR('U', 25, unsigned int)
158: #endif /* _LINUX_USBDEVICE_FS_H */
159: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/